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
lab 3 checkpoint 1
public CakeController(CakeView newCakeView) { cakeView = newCakeView; cakeModel = cakeView.getCakeModel(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "void checkpoint() throws IOException;", "public void initializeGraphPrueba() {\n //path to checkpoit.ckpt HACER\n //To load the checkpoint, place the checkpoint files in the device and create a Tensor\n //to the path of the checkpoint prefix\n //FALTA ******\n\n // si modelo updated se usa el checkpoints que he descargado del servidor. Si no, el del movil.\n if (isModelUpdated){\n /* //NO VA BIEN:\n checkpointPrefix = Tensors.create((file_descargado).toString());\n Toast.makeText(MainActivity.this, \"Usando el modelo actualizado\", Toast.LENGTH_SHORT).show();\n\n */\n\n //A VER SI VA\n try {\n //Place the .pb file generated before in the assets folder and import it as a byte[] array\n // hay que poner el .meta\n inputCheck = getAssets().open(\"+checkpoints_name_1002-.ckpt.meta\");\n // inputCheck = getAssets().open(\"+checkpoints_name_1002-.ckpt\"); NOT FOUND\n byte[] buffer = new byte[inputCheck.available()];\n int bytesRead;\n ByteArrayOutputStream output = new ByteArrayOutputStream();\n while ((bytesRead = inputCheck.read(buffer)) != -1) {\n output.write(buffer, 0, bytesRead);\n }\n variableAuxCheck = output.toByteArray(); // array con el checkpoint\n } catch (IOException e) {\n e.printStackTrace();\n }\n checkpointPrefix = Tensors.create((variableAuxCheck).toString());\n }\n\n else {\n try {\n //Place the .pb file generated before in the assets folder and import it as a byte[] array\n // hay que poner el .meta\n inputCheck = getAssets().open(\"checkpoint_name1.ckpt.meta\");\n byte[] buffer = new byte[inputCheck.available()];\n int bytesRead;\n ByteArrayOutputStream output = new ByteArrayOutputStream();\n while ((bytesRead = inputCheck.read(buffer)) != -1) {\n output.write(buffer, 0, bytesRead);\n }\n variableAuxCheck = output.toByteArray(); // array con el checkpoint\n } catch (IOException e) {\n e.printStackTrace();\n }\n checkpointPrefix = Tensors.create((variableAuxCheck).toString());\n }\n\n //checkpointPrefix = Tensors.create((getApplicationContext().getExternalFilesDir(Environment.DIRECTORY_DOCUMENTS).getAbsolutePath() + \"final_model.ckpt\").toString()); //PARA USAR EL CHECKPOINT DESCARGADO\n // checkpointDir = getApplicationContext().getExternalFilesDir(Environment.DIRECTORY_DOCUMENTS).getAbsolutePath();\n //Create a variable of class org.tensorflow.Graph:\n graph = new Graph();\n sess = new Session(graph);\n InputStream inputStream;\n try {\n // inputStream = getAssets().open(\"graph.pb\"); //MODELO SENCILLO //PROBAR CON GRAPH_PRUEBA QUE ES MI GRAPH DE O BYTES\n // inputStream = getAssets().open(\"graph5.pb\"); //MODELO SENCILLO\n if (isModelUpdated) { // ESTO ES ALGO TEMPORAL. NO ES BUENO\n inputStream = getAssets().open(\"graph_pesos.pb\");\n }\n else {\n inputStream = getAssets().open(\"graph5.pb\");\n }\n byte[] buffer = new byte[inputStream.available()];\n int bytesRead;\n ByteArrayOutputStream output = new ByteArrayOutputStream();\n while ((bytesRead = inputStream.read(buffer)) != -1) {\n output.write(buffer, 0, bytesRead);\n }\n graphDef = output.toByteArray();\n } catch (IOException e) {\n e.printStackTrace();\n }\n //Place the .pb file generated before in the assets folder and import it as a byte[] array.\n // Let the array's name be graphdef.\n //Now, load the graph from the graphdef:\n graph.importGraphDef(graphDef);\n try {\n //Now, load the checkpoint by running the restore checkpoint op in the graph:\n sess.runner().feed(\"save/Const\", checkpointPrefix).addTarget(\"save/restore_all\").run();\n Toast.makeText(this, \"Checkpoint Found and Loaded!\", Toast.LENGTH_SHORT).show();\n }\n catch (Exception e) {\n //Alternatively, initialize the graph by calling the init op:\n sess.runner().addTarget(\"init\").run();\n Log.i(\"Checkpoint: \", \"Graph Initialized\");\n }\n }", "protected void checkpoint(S state) {\n checkpoint();\n state(state);\n }", "void checkpoint(Node node) throws RepositoryException;", "protected void checkpoint() {\n checkpoint = internalBuffer().readerIndex();\n }", "public void save(){\n checkpoint = chapter;\n }", "public void train ()\t{\t}", "@Override\n\tpublic Serializable checkpointInfo() throws Exception {\n\t\treturn null;\n\t}", "public static void main(String[] args) {\n\t\tString solutionFile = \"dataset/vlc/task1_solution.en.clusterMle.txt\";\n//\t\tString queryFile = \"dataset/vlc/task1_query.en.f8.n5.txt\";\n//\t\tString targetFile = \"dataset/vlc/task1_target.en.f8.n5.txt\";\n//\t\tString linkFile = \"dataset/vlc/sim_0p_100n.csv\";\n\t\t\n\t\tString malletFile = \"dataset/vlc/folds/all.0.4189.mallet\";\n\t\tString queryFile = \"dataset/vlc/folds/query.0.csv\";\n\t\tString targetFile = \"dataset/vlc/folds/target.0.csv\";\n\t\tString linkFile = \"dataset/vlc/folds/trainingPairs.0.csv\";\n\t\t\n\t\tdouble alpha = 0.01, beta = 0.01, lambda = 0.01;\n\t\t\n\t\tMalletMleCluster clusterMle = new MalletMleCluster(malletFile, linkFile, alpha);\n\t\tTask1Solution solver = new Task1Solution(clusterMle);\n//\t\tfor(alpha = 0.1; alpha<1; alpha += 0.2) {\n//\t\t\tfor(beta = 0.1; beta<1; beta += 0.2) {\n\t\t\t\tfor (lambda = 0.1; lambda<1; lambda += 0.05) {\n\t\t\tclusterMle.setSmoothParameters(alpha, beta, lambda);\n//\t\t\tclusterMle.retrieveTask1Solution(queryFile, solutionFile);\n\t\t\ttry {\n\t\t\t\tsolver.retrieveTask1Solution(queryFile, solutionFile);\n\t\t\t\tdouble precision = Task1Solution.evaluateResult(targetFile, solutionFile);\n\t\t\t\tSystem.out.println(\"alpha: \" + alpha + \"beta: \" + beta + \n\t\t\t\t\t\t\", Lambda: \" + lambda + \", Mle precision: \" + precision);\n\t\t\t} catch (Exception e) {\n\t\t\t\t// TODO Auto-generated catch block\n\t\t\t\te.printStackTrace();\n\t\t\t}\n\t\t\t\t}\n//\t\t\t}\n//\t\t}\n\t}", "private static GeneticProgram loadCheckpoint(String arg) {\n CheckpointLoader cpl = new CheckpointLoader(arg);\n GeneticProgram gp = cpl.instantiate();\n if (gp == null) {\n System.err.println(\"Could not load checkpoint.\");\n System.exit(-1);\n }\n return gp;\n }", "@Test(timeout = 4000)\n public void test021() throws Throwable {\n TextDirectoryLoader textDirectoryLoader0 = new TextDirectoryLoader();\n Instances instances0 = textDirectoryLoader0.getStructure();\n Evaluation evaluation0 = new Evaluation(instances0);\n String string0 = evaluation0.toSummaryString(\"\", false);\n assertEquals(\"\\nTotal Number of Instances 0 \\n\", string0);\n assertEquals(0.0, evaluation0.unclassified(), 0.01);\n assertEquals(0.0, evaluation0.SFSchemeEntropy(), 0.01);\n }", "public void kirimNotifikasiPengajuan(Training training){\n\t\t\n\t}", "public void kirimNotifikasiPersetujuan(Training training){\n\t\t\n\t}", "TrainingTest createTrainingTest();", "public static void main(String[] args) {/\n\t\t// Exercise 1 //\n\t\t////////////////////////////////////////////////////////////////////////////////\n\t\t\n\t\tSystem.out.println(\"Exercise 1\");\n\t\tSystem.out.println(\"-----------\");\n\t\t\n\t\tint[] inputs = {1,0,1,1};\n\t\tint[] outputs = {0,0,1,1};\n\t\tNetwork n = new Network(inputs.length);\n\t\ttrainNet(n, inputs, outputs);\n\t\tint[] result = n.test(inputs, true);\n\t\tSystem.out.println(\"Output neurons after testing: \" + Arrays.toString(result));\n\t\t\n\t\t/////////////////////////////////////////////////////////////////////////////////\n\t\t// Exercise 2 //\n\t\t////////////////////////////////////////////////////////////////////////////////\n\t\t\n\t\tSystem.out.println(\"\\nExercise 2\");\n\t\tSystem.out.println(\"-----------\");\n\t\tint[] modifiedI = {1,0,0,1};\n\t\tSystem.out.println(\"Testing with incomplete input: \" + Arrays.toString(modifiedI));\n\t\tresult = n.test(modifiedI, true);\n\t\tSystem.out.println(\"Output neurons after testing: \" + Arrays.toString(result));\n\t\t\n\t\t/////////////////////////////////////////////////////////////////////////////////\n\t\t// Exercise 3 //\n\t\t////////////////////////////////////////////////////////////////////////////////\n\t\t\n\t\tSystem.out.println(\"\\nExercise 3\");\n\t\tSystem.out.println(\"-----------\");\n\t\tint[] noizyI = {1,1,1,1};\n\t\tSystem.out.println(\"Testing with noizy input: \" + Arrays.toString(noizyI));\n\t\tresult = n.test(noizyI, true);\n\t\tSystem.out.println(\"Output neurons after testing: \" + Arrays.toString(result));\n\t\tSystem.out.println(n);\n\t\t\n\t\t/////////////////////////////////////////////////////////////////////////////////\n\t\t// Exercise 4 //\n\t\t////////////////////////////////////////////////////////////////////////////////\n\t\t\n\t\tSystem.out.println(\"\\nExercise 4\");\n\t\tSystem.out.println(\"-----------\");\n\t\tinputs = new int[] {1,0,1,0,0,1};\n\t\toutputs = new int[] {1,1,0,0,1,1};\n\t\tint[] newIns = {0,1,1,0,0,0};\n\t\tint[] newOuts = {1,1,0,1,0,1};\n\t\tn = new Network(inputs.length);\n\t\ttrainNet(n, inputs, outputs);\n\t\ttrainNet(n, newIns, newOuts);\n\t\tresult = n.test(inputs, true);\n\t\tSystem.out.println(\"load param: \" + n.getLoadParameter());\n\t\tSystem.out.println(\"Output neurons after testing: \" + Arrays.toString(result));\n\t\tint[] newResult = n.test(newIns, true);\n\t\tSystem.out.println(\"Output neurons after testing: \" + Arrays.toString(newResult));\n\t\t\n\t\t/////////////////////////////////////////////////////////////////////////////////\n\t\t// Exercise 5 //\n\t\t////////////////////////////////////////////////////////////////////////////////\n\t\t\n\t\tSystem.out.println(\"\\nExercise 5\");\n\t\tSystem.out.println(\"-----------\");\n\t\tmodifiedI = new int[] {1,0,0,0,0,1};\n\t\tSystem.out.println(\"Testing with incomplete input:\");\n\t\tresult = n.test(modifiedI, true);\n\t\tSystem.out.println(\"Output neurons after testing: \" + Arrays.toString(result));\n\t\tmodifiedI = new int[] {0,1,0,0,0,0};\n\t\tSystem.out.println(\"Testing with noisy input:\");\n\t\tresult = n.test(modifiedI, true);\n\t\tSystem.out.println(\"Output neurons after testing: \" + Arrays.toString(result));\n\t\t\n\t\t/////////////////////////////////////////////////////////////////////////////////\n\t\t// Exercise 6 //\n\t\t////////////////////////////////////////////////////////////////////////////////\n\t\tSystem.out.println(\"\\nExercise 6\");\n\t\tSystem.out.println(\"-----------\");\n\t\tint size = 10, iterations = 500, total = 0, maxCount = 0;\n\t\tdouble loadParameter = 0, maxLoad = 0, synapsesLoad = 0, maxSyn = 0;\n\t\tfor(int j = 0 ; j < iterations ; j++) {\n\t\t\tNetwork net = new Network(size);\n\t\t\tint[][] inPatterns = generateRandomPatterns(size);\n\t\t\tint[][] outPatterns = generateRandomPatterns(size);\n\t\t\tint count = 0;\n\t\t\tfor(int i = 0 ; i < inPatterns.length ; i++) {\n\t\t\t\tnet.train(inPatterns[i], outPatterns[i]);\n\t\t\t\tint[] res = net.test(inPatterns[i], false);\n\t\t\t\tif(Arrays.equals(res, outPatterns[i])) {\n\t\t\t\t\tcount++;\n\t\t\t\t} else {\n\t\t\t\t\t// network has made an error\n\t\t\t\t\tnet.pop();\n\t\t\t\t\tdouble lp = net.getLoadParameter();\n\t\t\t\t\tdouble sl = net.synapsesLoad();\n\t\t\t\t\tloadParameter += lp;\n\t\t\t\t\tsynapsesLoad += sl;\n\t\t\t\t\tif(lp > maxLoad)\n\t\t\t\t\t\tmaxLoad = lp;\n\t\t\t\t\tif(sl > maxSyn)\n\t\t\t\t\t\tmaxSyn = sl;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t\ttotal += count;\n\t\t\tif(count > maxCount)\n\t\t\t\tmaxCount = count;\n\t\t}\n\t\t\n\t\tSystem.out.println(\"Network of size: \" + size);\n\t\tSystem.out.println(\"Network on average trained: \" + total/iterations + \" patterns\");\n\t\tSystem.out.println(\"Network average load param: \" + loadParameter/iterations);\n\t\tSystem.out.println(\"Network average synapses load: \" + synapsesLoad/iterations);\n\t\tSystem.out.println(\"Network max load parameter: \" + maxLoad);\n\t\tSystem.out.println(\"Network max synapses load: \" + maxSyn);\n\t\tSystem.out.println(\"Network max number of trained patterns: \" + maxCount);\n\t}", "public String toCheckpoint() {\n return null;\n }", "private static void jbptTest2() throws FileNotFoundException, Exception {\n\t\tFile folder = new File(\"models\");\n\t\t\n\t\tFile[] arModels = folder.listFiles(new FileUtil().getFileter(\"pnml\"));\n\t\tfor(File file: arModels)\n\t\t{\n\t\t\t//print the file name\n\t\t\tSystem.out.println(\"========\" + file.getName() + \"========\");\n\n\t\t\t//initialize the counter for conditions and events\n\t\t\tAbstractEvent.count = 0;\n\t\t\tAbstractCondition.count = 0;\n\n\t\t\t//get the file path\n\t\t\tString filePrefix = file.getPath();\n\t\t\tfilePrefix = filePrefix.substring(0, filePrefix.lastIndexOf('.'));\n\t\t\tString filePNG = filePrefix + \".png\";\n\t\t\tString fileCPU = filePrefix + \"-cpu.png\";\n\t\t\tString fileNet = filePrefix + \"-cpu.pnml\";\n\n\t\t\tPnmlImport pnmlImport = new PnmlImport();\n\t\t\tPetriNet p1 = pnmlImport.read(new FileInputStream(file));\n\n\t\t\t// ori\n\t\t\t/*ProvidedObject po1 = new ProvidedObject(\"petrinet\", p1);\n\t\t\t\n\t\t\tDotPngExport dpe1 = new DotPngExport();\n\t\t\tOutputStream image1 = new FileOutputStream(filePNG);\n\t\t\t\n\t\t\tdpe1.export(po1, image1);*/\n\n\t\t\tNetSystem ns = PetriNetConversion.convert(p1);\n\t\t\tProperCompletePrefixUnfolding cpu = new ProperCompletePrefixUnfolding(ns);\n\t\t\tNetSystem netPCPU = PetriNetConversion.convertCPU2NS(cpu);\n\t\t\t// cpu\n\t\t\tPetriNet p2 = PetriNetConversion.convert(netPCPU);\n\t\t\t\n\t\t\tProvidedObject po2 = new ProvidedObject(\"petrinet\", p2);\n\t\t\tDotPngExport dpe2 = new DotPngExport();\n\t\t\tOutputStream image2 = new FileOutputStream(fileCPU);\n\t\t\tdpe2.export(po2, image2);\n//\t\t\t\n\t\t\tExport(p2, fileNet);\n//\t\t\t// net\n//\t\t\tNetSystem nsCPU = PetriNetConversion.convertCPU2NS(cpu);\n//\t\t\tPetriNet pnCPU = PetriNetConversion.convertNS2PN(nsCPU);\n//\t\t\tProvidedObject po3 = new ProvidedObject(\"petrinet\", pnCPU);\n//\t\t\tDotPngExport dpe3 = new DotPngExport();\n//\t\t\tOutputStream image3 = new FileOutputStream(fileNet);\n//\t\t\tdpe3.export(po3, image3);\n\t\t}\n\t\t\tSystem.exit(0);\n\t}", "@Test(timeout = 4000)\n public void test113() throws Throwable {\n TextDirectoryLoader textDirectoryLoader0 = new TextDirectoryLoader();\n Instances instances0 = textDirectoryLoader0.getStructure();\n Evaluation evaluation0 = new Evaluation(instances0);\n String string0 = evaluation0.toSummaryString(false);\n assertEquals(\"=== Summary ===\\n\\nTotal Number of Instances 0 \\n\", string0);\n assertEquals(0.0, evaluation0.SFSchemeEntropy(), 0.01);\n assertEquals(0.0, evaluation0.unclassified(), 0.01);\n }", "public void startTrainingMode() {\n\t\t\r\n\t}", "@Test\n public void test30() throws Throwable {\n TextDirectoryLoader textDirectoryLoader0 = new TextDirectoryLoader();\n Instances instances0 = textDirectoryLoader0.getDataSet();\n Evaluation evaluation0 = new Evaluation(instances0);\n boolean boolean0 = evaluation0.getDiscardPredictions();\n assertEquals(0.0, evaluation0.SFPriorEntropy(), 0.01D);\n assertFalse(boolean0);\n }", "public static void test(String[] args) throws Exception {\n\t\tAbstractPILPDelegate.setDebugMode(null);\r\n\t\t\r\n\t\tComputeCostBasedOnFreq ins = new ComputeCostBasedOnFreq();\r\n\t\tins.initPreMapping(\"D:/data4code/replay/pre.csv\");\r\n\t\tins.getEventSeqForEachPatient(\"D:/data4code/cluster/LogBasedOnKmeansPlusPlus-14.csv\");\r\n\t\tins.removeOneLoop();\r\n\r\n\t\tPetrinetGraph net = null;\r\n\t\tMarking initialMarking = null;\r\n\t\tMarking[] finalMarkings = null; // only one marking is used so far\r\n\t\tXLog log = null;\r\n\t\tMap<Transition, Integer> costMOS = null; // movements on system\r\n\t\tMap<XEventClass, Integer> costMOT = null; // movements on trace\r\n\t\tTransEvClassMapping mapping = null;\r\n\r\n\t\tnet = constructNet(\"D:/data4code/mm.pnml\");\r\n\t\tinitialMarking = getInitialMarking(net);\r\n\t\tfinalMarkings = getFinalMarkings(net);\r\n\t\tXParserRegistry temp=XParserRegistry.instance();\r\n\t\ttemp.setCurrentDefault(new XesXmlParser());\r\n\t\tlog = temp.currentDefault().parse(new File(\"D:/data4code/mm.xes\")).get(0);\r\n//\t\tlog = XParserRegistry.instance().currentDefault().parse(new File(\"d:/temp/BPI2013all90.xes.gz\")).get(0);\r\n\t\t//\t\t\tlog = XParserRegistry.instance().currentDefault().parse(new File(\"d:/temp/BPI 730858110.xes.gz\")).get(0);\r\n\t\t//\t\t\tlog = XFactoryRegistry.instance().currentDefault().openLog();\r\n\t\tcostMOS = constructMOSCostFunction(net);\r\n\t\tXEventClass dummyEvClass = new XEventClass(\"DUMMY\", 99999);\r\n\t\tXEventClassifier eventClassifier = XLogInfoImpl.STANDARD_CLASSIFIER;\r\n\t\tcostMOT = constructMOTCostFunction(net, log, eventClassifier, dummyEvClass);\r\n\t\tmapping = constructMapping(net, log, dummyEvClass, eventClassifier);\r\n\r\n\t\tint cost1 = AlignmentTest.computeCost(costMOS, costMOT, initialMarking, finalMarkings, null, net, log,\r\n\t\t\t\tmapping, false);\r\n\t\tSystem.out.println(cost1);\r\n\t\t\r\n//\t\tint iteration = 0;\r\n//\t\twhile (true) {\r\n//\t\t\tSystem.out.println(\"start: \" + iteration);\r\n//\t\t\tlong start = System.currentTimeMillis();\r\n//\t\t\tint cost1 = AlignmentTest.computeCost(costMOS, costMOT, initialMarking, finalMarkings, null, net, log,\r\n//\t\t\t\t\tmapping, false);\r\n//\t\t\tlong mid = System.currentTimeMillis();\r\n//\t\t\tSystem.out.println(\" With ILP cost: \" + cost1 + \" t: \" + (mid - start));\r\n//\r\n//\t\t\tlong mid2 = System.currentTimeMillis();\r\n//\t\t\tint cost2 = AlignmentTest.computeCost(costMOS, costMOT, initialMarking, finalMarkings, null, net, log,\r\n//\t\t\t\t\tmapping, false);\r\n//\t\t\tlong end = System.currentTimeMillis();\r\n//\r\n//\t\t\tSystem.out.println(\" No ILP cost: \" + cost2 + \" t: \" + (end - mid2));\r\n//\t\t\tif (cost1 != cost2) {\r\n//\t\t\t\tSystem.err.println(\"ERROR\");\r\n//\t\t\t}\r\n//\t\t\t//System.gc();\r\n//\t\t\tSystem.out.flush();\r\n//\t\t\titeration++;\r\n//\t\t}\r\n\r\n\t}", "private Parameters createCheckpoint() {\n Parameters checkpoint = Parameters.create();\n checkpoint.set(\"lastDoc/identifier\", this.lastAddedDocumentIdentifier);\n checkpoint.set(\"lastDoc/number\", this.lastAddedDocumentNumber);\n checkpoint.set(\"indexBlockCount\", this.indexBlockCount);\n Parameters shards = Parameters.create();\n for (Bin b : this.geometricParts.radixBins.values()) {\n for (String indexPath : b.getBinPaths()) {\n shards.set(indexPath, b.size);\n }\n }\n checkpoint.set(\"shards\", shards);\n return checkpoint;\n }", "boolean previousStep();", "public static void main(String[] args) throws IOException {\n String dataName = \"Dianping\";\n String fileName = \"checkin_pitf\";\n int coreNum = 1;\n// List<Post> trainPosts = DataReader.readPosts(\"./demo/data/\" + dataName + \"/all_id_core\"+coreNum+\"_train\");\n// List<Post> testPosts = DataReader.readPosts(\"./demo/data/\" + dataName + \"/all_id_core\"+coreNum+\"_test\");\n List<Post> trainPosts = DataReader.readPosts(\"./demo/data/\" + dataName + \"/\"+fileName+\"_train\");\n List<Post> testPosts = DataReader.readPosts(\"./demo/data/\" + dataName + \"/\"+fileName+\"_test\");\n\n System.out.println(\"PITFTest\");\n System.out.println(dataName+\" \"+coreNum);\n int dim = 64;\n double initStdev = 0.01;\n int iter = 20;//100\n double learnRate = 0.05;\n double regU = 0.00005;\n double regI = regU, regT = regU;\n int numSample = 100;\n int randomSeed = 1;\n\n PITF pitf = new PITF(trainPosts, testPosts, dim, initStdev, iter, learnRate, regU, regI, regT, randomSeed, numSample);\n pitf.run();//这个函数会调用model的初始化及创建函数\n System.out.println(\"dataName:\\t\" + dataName);\n System.out.println(\"coreNum:\\t\" + coreNum);\n }", "@Test\n public void test33() throws Throwable {\n TextDirectoryLoader textDirectoryLoader0 = new TextDirectoryLoader();\n Instances instances0 = textDirectoryLoader0.getDataSet();\n Evaluation evaluation0 = new Evaluation(instances0);\n double double0 = evaluation0.correct();\n assertEquals(0.0, evaluation0.SFPriorEntropy(), 0.01D);\n assertEquals(0.0, double0, 0.01D);\n }", "public long flushCheckpoint()\r\n/* 119: */ {\r\n/* 120:150 */ return this.checkpoint;\r\n/* 121: */ }", "@Override\n\tpublic void run() {\n\t\tfileName = \"out_\" + Program.getProgram().getFileName() + \"_\";\n\t\tint numAddStop = 0;\n\t\t//fileName = \"out_themida_\";\n\n\t\t//fileState.clearContentFile();\n\t\t//bkFile.clearContentFile();\n\t\toverallStartTime = System.currentTimeMillis();\n\t\tlong overallStartTemp = overallStartTime;\n\t\t// BE-PUM algorithm\n\t\tSystem.out.println(\"Starting On-the-fly Model Generation algorithm.\");\n\t\tprogram.getResultFileTemp().appendInLine('\\n' + program.getFileName() + '\\t');\n\t\t\n\t\t// Set up initial context\n\t\tX86TransitionRule rule = new X86TransitionRule();\n\t\tBPCFG cfg = Program.getProgram().getBPCFG();\n\t\tEnvironment env = new Environment();\n\t\t//env.getMemory().resetImportTable(program);\n\t\tAbsoluteAddress location = Program.getProgram().getEntryPoint();\n\t\tInstruction inst = Program.getProgram().getInstruction(location, env);\n\t\tList<BPPath> pathList = new ArrayList<BPPath>();\n\t\t\n\t\t// Insert start node\n\t\tBPVertex startNode = null;\n\t\tstartNode = new BPVertex(location, inst);\n\t\tstartNode.setType(0);\n\t\tcfg.insertVertex(startNode);\n\n\t\tBPState curState = null;\n\t\tBPPath path = null;\n\t\tcurState = new BPState(env, location, inst);\n\t\tpath = new BPPath(curState, new PathList(), new Formulas());\n\t\tpath.setCurrentState(curState);\n\t\tpathList.add(path);\n\n\t\t/*if (Program.getProgram().getFileName().equals(\"api_test_v2.3_lvl1.exe\") \n\t\t\t\t&& isRestored) {\n\t\t\tSystem.out.println(\"Restore State from File.\");\n\t\t\tFileProcess reFile = new FileProcess(\"data/data/restoreState.txt\");\n\t\t\tpathList = restoreState(reFile);\n\t\t\t// bkFile.clearContentFile();\n\t\t\tSystem.out.println(\"Finished restoring state!\");\n\t\t}*/\n\n\t\t// Update at first -----------------------------\n\t\tTIB.setBeUpdated(true);\n\t\tTIB.updateTIB(curState);\n\t\t// ---------------------------------------------\n\n\t\t// PHONG - 20150801 /////////////////////////////\n\t\t// Packer Detection via Header\n\t\tSystem.out.println(\"================PACKER DETECTION VIA HEADER ======================\");\n\t\tif (OTFModelGeneration.detectPacker)\n\t\t{\n\t\t\tprogram.getDetection().detectViaHeader(program);\n\t\t\tprogram.getDetection().setToLogFirst(program);\n\t\t}\n\t\tSystem.out.println(\"==================================================================\");\n\t\t/////////////////////////////////////////////////\n\t\t\n\t\tsynchronized (OTFThreadManager.getInstance()) {\n\t\t\ttry {\n\t\t\t\tOTFThreadManager.getInstance().check(this, pathList);\n\t\t\t\tOTFThreadManager.getInstance().wait();\n\t\t\t} catch (Exception e) {\n\t\t\t\te.printStackTrace();\n\t\t\t}\n\t\t}\n\t\t// PHONG - 20150724\n\t\tSystem.out.println(\"================PACKER DETECTION VIA OTF======================\");\n\t\tprogram.getDetection().packedByTechniques();\n\t\tprogram.getDetection().packedByTechniquesFrequency();\n\t\tSystem.out.println(\"==============================================================\");\n\t}", "@Test\n public void test22() throws Throwable {\n TextDirectoryLoader textDirectoryLoader0 = new TextDirectoryLoader();\n Instances instances0 = textDirectoryLoader0.getDataSet();\n Evaluation evaluation0 = new Evaluation(instances0);\n FastVector fastVector0 = evaluation0.predictions();\n assertEquals(0.0, evaluation0.SFEntropyGain(), 0.01D);\n }", "public void train() throws Exception;", "private String checkpointString(int cp, long time) {\n\t\treturn \"Checkpoint \" + ChatColor.GRAY + String.valueOf(cp) + ChatColor.WHITE + \" = \" + ChatColor.GRAY + _.getGameController().getTimeString(0, time) + ChatColor.WHITE;\n\t}", "public MultiLayerNetwork loadCheckpointMLN(Checkpoint checkpoint){\n return loadCheckpointMLN(checkpoint.getCheckpointNum());\n }", "static void playC45() throws IOException {\n\t\tRealVector[] data = NNDataset.getData(NNDataset.HOME);\n\t\tRealVector[] label = NNDataset.getLabel(NNDataset.HOME);\n\t\tRealMatrix d = MatrixUtils.createRealMatrix(data.length, data[0].getDimension());\n\t\tfor (int i = 0; i < data.length; i++) {\n\t\t\td.setRowVector(i, data[i]);\n\t\t}\n\t\td = d.transpose(); // data = column vector\n\n\t\tRealVector l = MatrixUtils.createRealVector(new double[label.length]);\n\t\tfor (int i = 0; i < l.getDimension(); i++) {\n\t\t\tl.setEntry(i, label[i].getEntry(0));\n\t\t}\n\n\t\tDecisionNode root = training(d, l);\n\t\tString[] header = NNDataset.getHeader(NNDataset.HOME);\n\t\tprintTree(root, header);\n\n\t\tInteger lb = predict(root, data[0]);\n\t\tSystem.out.println(lb);\n\n\t\tdouble ok = MSE(root, data, label);\n\t\tSystem.out.println(\"total hit: \" + ok);\n\t}", "public static void main(String[] args) throws Exception {\n\t\tStoreAlphaWeight.dimensionForSVM=200;\n\t\tLibEstimate le=new LibEstimate();\n\t\tle.countLine();\n\t\tle.readVec();\n\t\tle.readLabel();\n\t\tle.readBias();\n\t\tle.addBiastoVec();\n\t\tle.prepTrainData();\n\t\tle.prepTestData();\n\t\tle.lib();\n\t}", "@Procedure(value = \"mlp.train\", mode = WRITE)\n @Description(\"Backward pass through NN\")\n public void train(@Name(value = \"no. of passes\") long nPasses) {\n\n DataLogger logger = new DataLogger(\"proto1\", \"error\");\n\n for (int i = 0; i < nPasses; i++) {\n updateTrainRate(i + 1);\n forwardPass();\n\n double error = calculateError();\n\n double reward = 1.0 - error;\n\n// if (Math.random() > 0.9) reward = error;\n\n backwardPass(reward);\n moveNext();\n\n\n// System.out.println(String.format(\"Error: %f\", error));\n// if (i % 100 == 0 && i > 0) {\n// double meanError = errors.stream().reduce(0.0, Double::sum) / 100;\n// System.out.println(String.format(\n// \"Mean error: %f, eta: %f\", meanError, eta));\n// errors.clear();\n// }\n// errors.add(error);\n logger.append(error);\n\n\n }\n\n forwardPass();\n logger.close();\n }", "public static void main(String[] args) throws IOException {\n\t\tMain t = new Main();\n\t\tSystem.out.println(\"The model is trained: \");\n\t\tt.training(enTrainingDir, 0.7);\n\t\tSystem.out.println(\"Check validation in example of \\\"AB\\\":\");\n\t\tt.checkValid(\"AB\");\n\t\tSystem.out.println();\n\t\tSystem.out.println(\"============= unsmoothed models =============================================================================\");\n\t\tSystem.out.print(\"Unigram: \");\n\t\tSystem.out.println(t.uni);\n\t\tSystem.out.print(\"Bigram: \");\n\t\tSystem.out.println(t.bi);\n\t\tSystem.out.print(\"Trigram: \");\n\t\tSystem.out.println(t.tri);\n\t\tSystem.out.println();\n\t\tSystem.out.println(\"============= add-one smoothed models ========================================================================\");\n\t\tSystem.out.println(\"Note: this is only one of smoothed models , not the tuning process. Because there would be too many console lines.\");\n\t\tSystem.out.println(\"Here I take add-k = 0.7 as an example.\");\n\t\tSystem.out.println(\"*************************************************************************************************************\");\n\t\tdouble k = 0.7;\n\t\tt.training(enTrainingDir, 0.7);\n\t\tt.calculateScore(testDir, k, null, null);\n\t\tt.training(esTrainingDir, 0.7);\n\t\tt.calculateScore(testDir, k, null, null);\n\t\tt.training(deTrainingDir, 0.7);\n\t\tt.calculateScore(testDir, k, null, null);\n\t\tSystem.out.println(\"*************************************************************************************************************\");\n\t\tSystem.out.println(\"Then I take the classic add-k = 1.0 as an example.\");\n\t\tSystem.out.println(\"*************************************************************************************************************\");\n\t\tk = 1.0;\n\t\tt.training(enTrainingDir, 0.7);\n\t\tt.calculateScore(testDir, k, null, null);\n\t\tt.training(esTrainingDir, 0.7);\n\t\tt.calculateScore(testDir, k, null, null);\n\t\tt.training(deTrainingDir, 0.7);\n\t\tt.calculateScore(testDir, k, null, null);\n\t\tSystem.out.println();\n\t\tSystem.out.println(\"===== linear interpolation smoothed models ===================================================================\");\n\t\tdouble[] lambdas_tri = new double[] {1.0 / 3, 1.0 / 3, 1.0 / 3};\n\t\tdouble[] lambdas_bi = new double[] {1.0 / 2, 1.0 / 2};\n\t\tSystem.out.println(\"First is equally weighted lambdas: \" + Arrays.toString(lambdas_tri) + \" and \" + Arrays.toString(lambdas_bi));\n\t\tt.training(enTrainingDir, 0.7);\n\t\tt.calculateScore(testDir, 0, lambdas_bi, lambdas_tri);\n\t\tt.training(esTrainingDir, 0.7);\n\t\tt.calculateScore(testDir, 0, lambdas_bi, lambdas_tri);\n\t\tt.training(deTrainingDir, 0.7);\n\t\tt.calculateScore(testDir, 0, lambdas_bi, lambdas_tri);\n\t\tSystem.out.println(\"**************************************************************************************************************\");\n\t\tlambdas_tri = new double[] {0.5, 0.3, 0.2};\n\t\tlambdas_bi = new double[] {0.7, 0.3};\n\t\tSystem.out.println(\"Then is tuned-weighted lambdas: \" + Arrays.toString(lambdas_tri) + \" and \" + Arrays.toString(lambdas_bi));\n\t\tSystem.out.println(\"Again, this is not all the tuning process. Here is only one set of lambdas.\");\n\t\tt.training(enTrainingDir, 0.7);\n\t\tt.calculateScore(testDir, 0, lambdas_bi, lambdas_tri);\n\t\tt.training(esTrainingDir, 0.7);\n\t\tt.calculateScore(testDir, 0, lambdas_bi, lambdas_tri);\n\t\tt.training(deTrainingDir, 0.7);\n\t\tt.calculateScore(testDir, 0, lambdas_bi, lambdas_tri);\n\t\tSystem.out.println();\n\t\tSystem.out.println(\"=================== Generating texts ==========================================================================\");\n\t\tSystem.out.println(\"To save console space, here I generate A to E, five sentences. Feel free to adjust parameters in code.\");\n\t\tSystem.out.println(\"***************************************************************************************************************\");\n\t\tt.training(enTrainingDir, 0.7);\n\t\tSystem.out.println(\"**************** Bi-gram generating ***************************************************************************\");\n\t\tfor (char c = 'A'; c <= 'E'; c++) {\n\t\t\tt.generateWithBigramModel(String.valueOf(c));\n\t\t}\n\t\tSystem.out.println();\n\t\tSystem.out.println();\n\t\tSystem.out.println(\"Not that good huh?\");\n\t\tSystem.out.println(\"**************** Tri-gram generating *************************************************************************\");\n\t\tfor (char c = 'A'; c <= 'E'; c++) {\n\t\t\tt.generateWithBigramModel(String.valueOf(c));\n\t\t}\n\t\tSystem.out.println();\n\t\tSystem.out.println();\n\t\tSystem.out.println(\"...Seems not good as well.\");\n\t}", "public static void main(String[] args) throws IOException {\n\t\t \tstart=new A1063307_Checkpoint6();\r\n\t\t\tstart.setVisible(true);\r\n\t\t\tstart.setSize(200,200);\r\n\t\t\tstart.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);\r\n\t\t\tstart.setResizable(false);\t\r\n\t}", "@Test(timeout = 4000)\n public void test022() throws Throwable {\n TextDirectoryLoader textDirectoryLoader0 = new TextDirectoryLoader();\n Instances instances0 = textDirectoryLoader0.getStructure();\n Evaluation evaluation0 = new Evaluation(instances0);\n evaluation0.toMatrixString(\"getPreBuiltClassifiers\");\n assertEquals(0.0, evaluation0.SFEntropyGain(), 0.01);\n }", "public static void main(String[] args) {\n\t\tLab3 test = new Lab3();\n\t\t\n\t\tSystem.out.println(\"\\nTest Case (0, 7, 4) to (2, 7, 2):\");\n\t\ttest.pouring(0, 7, 4, 2, 7, 2);\n\t\ttest.backTrack(0, 7, 4, 2, 7, 2);\n\t\ttest = new Lab3();\n\t\t\n\t\tSystem.out.println(\"\\nTest Case (10, 0, 4) to (2, 7, 2):\");\n\t\ttest.pouring(10, 0, 4, 2, 7, 2);\n\t\ttest.backTrack(10, 0, 4, 2, 7, 2);\n\t\ttest = new Lab3();\n\t\t\n\t\tSystem.out.println(\"\\nTest Case (8, 6, 3) to (7, 6, 4):\");\n\t\ttest.pouring(8, 6, 3, 7, 6, 4);\n\t\ttest.backTrack(8, 6, 3, 7, 6, 4);\n\t\ttest = new Lab3();\n\t\t\n\t\tSystem.out.println(\"\\nTest Case (1, 7, 4) to (3, 6, 2):\");\n\t\ttest.pouring(1, 7, 4, 3, 6, 2);\n\t\ttest.backTrack(1, 7, 4, 3, 6, 2);\n\t\ttest = new Lab3();\n\t\t\n\t\tSystem.out.println(\"\\nTest Case (2, 7, 4) to (3, 6, 2):\");\n\t\ttest.pouring(2, 7, 4, 3, 6, 2);\n\t\ttest.backTrack(2, 7, 4, 3, 6, 2);\n\t\ttest = new Lab3();\n\t\t\n\t\tSystem.out.println(\"\\nTest Case (6, 3, 3) to (3, 6, 3):\");\n\t\ttest.pouring(6, 3, 3, 3, 6, 3);\n\t\ttest.backTrack(6, 3, 3, 3, 6, 3);\n\t}", "static synchronized void makeNewCheckpoint() {\n HashMap<String, String> newCheckpoint = new HashMap<>(localState);\n checkpoints.put(Thread.currentThread(), newCheckpoint);\n }", "@Test(timeout = 4000)\n public void test111() throws Throwable {\n TextDirectoryLoader textDirectoryLoader0 = new TextDirectoryLoader();\n Instances instances0 = textDirectoryLoader0.getDataSet();\n Evaluation evaluation0 = new Evaluation(instances0);\n evaluation0.relativeAbsoluteError();\n assertEquals(Double.NaN, evaluation0.meanPriorAbsoluteError(), 0.01);\n assertEquals(0.0, evaluation0.SFEntropyGain(), 0.01);\n assertEquals(Double.NaN, evaluation0.meanAbsoluteError(), 0.01);\n }", "@Test\n public void test19() throws Throwable {\n TextDirectoryLoader textDirectoryLoader0 = new TextDirectoryLoader();\n Instances instances0 = textDirectoryLoader0.getDataSet();\n Evaluation evaluation0 = new Evaluation(instances0);\n double double0 = evaluation0.KBInformation();\n assertEquals(0.0, double0, 0.01D);\n assertEquals(0.0, evaluation0.SFPriorEntropy(), 0.01D);\n }", "private void saveLab(boolean usetmp) throws FileNotFoundException{\n //Get path to start.config\n String startConfigPath;\n if(!usetmp){\n startConfigPath = currentLab.getPath()+File.separator+\"config\"+File.separator+\"start.config\";\n }else{\n startConfigPath = currentLab.getPath()+File.separator+\"config\"+File.separator+\"start.config\";\n }\n PrintWriter writer = new PrintWriter(startConfigPath);\n String startConfigText = \"\"; \n \n // Write Global Params\n for(String line : labDataCurrent.getGlobals()){\n startConfigText += line+\"\\n\";\n }\n\n // Cycle through network objects and write\n Component[] networks = NetworkPanePanel.getComponents();\n for(Component network : networks){\n NetworkData data = ((NetworkObjPanel)network).getConfigData();\n startConfigText += \"NETWORK \"+data.name+\"\\n\";\n startConfigText += \" MASK \"+data.mask+\"\\n\";\n startConfigText += \" GATEWAY \"+data.gateway+\"\\n\";\n \n if(data.macvlan > 0){\n startConfigText += \" MACVLAN \"+data.macvlan+\"\\n\";\n }\n if(data.macvlan_ext > 0){\n startConfigText += \" MACVLAN_EXT\" +data.macvlan_ext+\"\\n\";\n }\n \n if(!data.ip_range.isEmpty()){\n startConfigText += \" IP_RANGE \"+data.ip_range+\"\\n\";\n } \n\n if(data.tap){\n startConfigText += \" TAP YES\"+\"\\n\";\n }\n for(String unknownParam : data.unknownNetworkParams){\n startConfigText += \" \"+unknownParam+\"\\n\";\n }\n }\n \n // Cycle through container objects and write \n Component[] containers = ContainerPanePanel.getComponents();\n for(Component container : containers){\n ContainerData data = ((ContainerObjPanel)container).getConfigData(); \n startConfigText += \"CONTAINER \"+data.name+\"\\n\";\n startConfigText += \" USER \"+data.user+\"\\n\";\n if(data.script.isEmpty()){\n startConfigText += \" SCRIPT NONE\\n\";\n }\n else{\n startConfigText += \" SCRIPT \"+data.script+\"\\n\"; \n }\n \n if(data.x11){\n startConfigText += \" X11 YES\\n\"; \n }\n else{\n startConfigText += \" X11 NO\\n\";\n }\n // Not default\n if(data.terminal_count != 1)\n startConfigText += \" TERMINALS \"+data.terminal_count+\"\\n\";\n if(!data.terminal_group.isEmpty())\n startConfigText += \" TERMINAL_GROUP \"+data.terminal_group+\"\\n\";\n if(!data.xterm_title.isEmpty())\n startConfigText += \" XTERM \"+data.xterm_title+\" \"+data.xterm_script+\"\\n\";\n if(!data.password.isEmpty())\n startConfigText += \" PASSWORD \"+data.password+\"\\n\";\n for(LabData.ContainerAddHostSubData addHost : data.listOfContainerAddHost){\n if(addHost.type.equals(\"network\"))\n startConfigText += \" ADD-HOST \"+addHost.add_host_network+\"\\n\";\n else if(addHost.type.equals(\"ip\"))\n startConfigText += \" ADD-HOST \"+addHost.add_host_host+\":\"+addHost.add_host_ip+\"\\n\"; \n }\n for(LabData.ContainerNetworkSubData network : data.listOfContainerNetworks){\n startConfigText += \" \"+network.network_name+\" \"+network.network_ipaddress+\"\\n\"; \n }\n if(data.clone > 0){\n startConfigText += \" CLONE \"+data.clone+\"\\n\";\n }\n if(!data.lab_gateway.isEmpty()){\n startConfigText += \" LAB_GATEWAY \"+data.lab_gateway+\"\\n\";\n }\n if(data.no_gw){\n startConfigText += \" NO_GW YES\\n\";\n }\n if(!data.base_registry.isEmpty()){\n startConfigText += \" BASE_REGISTRY \"+data.base_registry+\"\\n\";\n }\n if(!data.thumb_volume.isEmpty()){\n startConfigText += \" THUMB_VOLUME \"+data.thumb_volume+\"\\n\";\n }\n if(!data.thumb_command.isEmpty()){\n startConfigText += \" THUMB_COMMAND \"+data.thumb_command+\"\\n\";\n }\n if(!data.thumb_stop.isEmpty()){\n startConfigText += \" THUMB_STOP \"+data.thumb_stop+\"\\n\";\n }\n if(!data.publish.isEmpty()){\n startConfigText += \" PUBLISH \"+data.publish+\"\\n\";\n }\n if(data.hide){\n startConfigText += \" HIDE YES\\n\";\n }\n if(data.no_privilege){\n startConfigText += \" NO_PRIVILEGE YES\\n\";\n }\n if(data.no_pull){\n startConfigText += \" NO_PULL YES\\n\";\n }\n if(data.mystuff){\n startConfigText += \" MYSTUFF YES\\n\";\n }\n if(data.tap){\n startConfigText += \" TAP YES\\n\";\n }\n if(!data.mount1.isEmpty() && !data.mount2.isEmpty()){\n startConfigText += \" MOUNT \"+data.mount1+\":\"+data.mount2+\"\\n\";\n }\n \n }\n \n //Write to File\n writer.print(startConfigText);\n writer.close();\n \n //Save results.config and goals.config file\n labDataCurrent.getResultsData().writeResultsConfig(usetmp);\n labDataCurrent.getGoalsData().writeGoalsConfig(usetmp);\n labDataCurrent.getParamsData().writeParamsConfig(usetmp);\n \n System.out.println(\"Lab Saved\");\n }", "@Test\n public void test08() throws Throwable {\n DecisionStump decisionStump0 = new DecisionStump();\n String string0 = Evaluation.makeOptionString(decisionStump0, false);\n assertEquals(\"\\n\\nGeneral options:\\n\\n-h or -help\\n\\tOutput help information.\\n-synopsis or -info\\n\\tOutput synopsis for classifier (use in conjunction with -h)\\n-t <name of training file>\\n\\tSets training file.\\n-T <name of test file>\\n\\tSets test file. If missing, a cross-validation will be performed\\n\\ton the training data.\\n-c <class index>\\n\\tSets index of class attribute (default: last).\\n-x <number of folds>\\n\\tSets number of folds for cross-validation (default: 10).\\n-no-cv\\n\\tDo not perform any cross validation.\\n-split-percentage <percentage>\\n\\tSets the percentage for the train/test set split, e.g., 66.\\n-preserve-order\\n\\tPreserves the order in the percentage split.\\n-s <random number seed>\\n\\tSets random number seed for cross-validation or percentage split\\n\\t(default: 1).\\n-m <name of file with cost matrix>\\n\\tSets file with cost matrix.\\n-l <name of input file>\\n\\tSets model input file. In case the filename ends with '.xml',\\n\\ta PMML file is loaded or, if that fails, options are loaded\\n\\tfrom the XML file.\\n-d <name of output file>\\n\\tSets model output file. In case the filename ends with '.xml',\\n\\tonly the options are saved to the XML file, not the model.\\n-v\\n\\tOutputs no statistics for training data.\\n-o\\n\\tOutputs statistics only, not the classifier.\\n-i\\n\\tOutputs detailed information-retrieval statistics for each class.\\n-k\\n\\tOutputs information-theoretic statistics.\\n-classifications \\\"weka.classifiers.evaluation.output.prediction.AbstractOutput + options\\\"\\n\\tUses the specified class for generating the classification output.\\n\\tE.g.: weka.classifiers.evaluation.output.prediction.PlainText\\n-p range\\n\\tOutputs predictions for test instances (or the train instances if\\n\\tno test instances provided and -no-cv is used), along with the \\n\\tattributes in the specified range (and nothing else). \\n\\tUse '-p 0' if no attributes are desired.\\n\\tDeprecated: use \\\"-classifications ...\\\" instead.\\n-distribution\\n\\tOutputs the distribution instead of only the prediction\\n\\tin conjunction with the '-p' option (only nominal classes).\\n\\tDeprecated: use \\\"-classifications ...\\\" instead.\\n-r\\n\\tOnly outputs cumulative margin distribution.\\n-z <class name>\\n\\tOnly outputs the source representation of the classifier,\\n\\tgiving it the supplied name.\\n-xml filename | xml-string\\n\\tRetrieves the options from the XML-data instead of the command line.\\n-threshold-file <file>\\n\\tThe file to save the threshold data to.\\n\\tThe format is determined by the extensions, e.g., '.arff' for ARFF \\n\\tformat or '.csv' for CSV.\\n-threshold-label <label>\\n\\tThe class label to determine the threshold data for\\n\\t(default is the first label)\\n\\nOptions specific to weka.classifiers.trees.DecisionStump:\\n\\n-D\\n\\tIf set, classifier is run in debug mode and\\n\\tmay output additional info to the console\\n\", string0);\n }", "@Test(timeout = 4000)\n public void test093() throws Throwable {\n TextDirectoryLoader textDirectoryLoader0 = new TextDirectoryLoader();\n Instances instances0 = textDirectoryLoader0.getDataSet();\n Evaluation evaluation0 = new Evaluation(instances0);\n Object[] objectArray0 = new Object[2];\n evaluation0.evaluateModel((Classifier) null, instances0, objectArray0);\n assertEquals(0.0, evaluation0.SFEntropyGain(), 0.01);\n }", "public void train(SieveDocuments trainingInfo) {\r\n\t\t// no training\r\n\t}", "@Test\n public void test18() throws Throwable {\n TextDirectoryLoader textDirectoryLoader0 = new TextDirectoryLoader();\n Instances instances0 = textDirectoryLoader0.getDataSet();\n Evaluation evaluation0 = new Evaluation(instances0);\n double double0 = evaluation0.KBMeanInformation();\n assertEquals(0.0, evaluation0.SFPriorEntropy(), 0.01D);\n }", "public Checkpoint(File checkpointDir) {\n this.directory = checkpointDir;\n readValid();\n }", "public static void main(String[] args) {\n\t\tSparkConf conf = new SparkConf().setAppName(\"NB\").setMaster(\"local[*]\").set(\"spark.ui.port\",\"4040\");;\n\t JavaSparkContext jsc = new JavaSparkContext(conf);\n\t\tString path = \"localpath\";\n\t\tJavaRDD<LabeledPoint> inputData = MLUtils.loadLabeledPoints(jsc.sc(), path).toJavaRDD();\n\t\tJavaRDD<LabeledPoint>[] tmp = inputData.randomSplit(new double[]{0.6, 0.4});\n\t\tJavaRDD<LabeledPoint> training = tmp[0]; // training set\n\t\tJavaRDD<LabeledPoint> test = tmp[1]; // test set\n\t\tNaiveBayesModel model = NaiveBayes.train(training.rdd(), 1.0);\n\t\tJavaPairRDD<Double, Double> predictionAndLabel =\n\t\t test.mapToPair(p -> new Tuple2<>(model.predict(p.features()), p.label()));\n\t\t// Save and load model\n\t\tmodel.save(jsc.sc(), \"localotuput_path\");\n\t\tNaiveBayesModel sameModel = NaiveBayesModel.load(jsc.sc(), \"localotuput_path\");\n\t\t\n\t\tdouble accuracy =\n\t\t\t\t predictionAndLabel.filter(pl -> pl._1().equals(pl._2())).count() / (double) test.count();\n\t\t\t\t\n\t\tSystem.out.println(\"The final accuracy is\"+accuracy);\n//\t\tpredictionAndLabel.foreach(data -> {\n//\t\t System.out.println(\"final model=\"+data._1() + \"final label=\" + data._2());\n//\t\t}); \n\t}", "@MediumTest\n public void test_1314_2() throws Exception {\n String imagePath = Environment.getExternalStorageDirectory()+\"/LeCoder_Image/statement_without_prev.png\";\n //Load the file and process it\n activity.loadImageFile(imagePath);\n activity.processImage();\n //Generate the nodes and construct the graph\n activity.generateNodes();\n activity.generateGraph();\n //Print all nodes\n activity.printAllNodes();\n //Check whether the flowchart has no start point\n assertFalse(activity.checkAllNodes());\n }", "void storeTraining(Training training);", "private static void task3() {\n\n\n System.out.printf(\"\\nTASK 3:\\nSee the 8 puzzles generated by this \" +\n \"task.\\nEach size (5, 7, 9 & 11) has two puzzles each; one \" +\n \"with a positive k value and one with a negative k value.\\n\" +\n \"Each puzzle is provided with a corresponding visualization \" +\n \"of it's solution\\n\");\n int[] puzzleSizes = new int[]{5, 7, 9, 11};\n for (int puzzleSize : puzzleSizes){\n createT3Puzzles(puzzleSize, true);\n createT3Puzzles(puzzleSize, false);\n }\n return;\n }", "@Test\n public void testRun() {\n System.out.println(\"run\");\n FluorescenceImporter importer = null;\n try {\n FluorescenceFixture tf = new FluorescenceFixture();\n importer = new FluorescenceImporter(tf.testData());\n ProgressHandle ph = ProgressHandleFactory.createHandle(\"Importing dataset\");\n importer.setProgressHandle(ph);\n \n importer.run();\n } catch (IOException ex) {\n Exceptions.printStackTrace(ex);\n }\n \n //FluorescenceDataset dataset = importer.getDataset();\n Dataset<? extends Instance> plate = importer.getDataset();\n System.out.println(\"inst A1 \"+ plate.instance(0).toString());\n System.out.println(\"plate \"+plate.toString());\n Dataset<Instance> output = new SampleDataset<Instance>();\n output.setParent((Dataset<Instance>) plate);\n ProgressHandle ph = ProgressHandleFactory.createHandle(\"Analyzing dataset\");\n // AnalyzeRunner instance = new AnalyzeRunner((Timeseries<ContinuousInstance>) plate, output, ph);\n // instance.run();\n \n }", "@Test(timeout = 4000)\n public void test091() throws Throwable {\n TextDirectoryLoader textDirectoryLoader0 = new TextDirectoryLoader();\n Instances instances0 = textDirectoryLoader0.getDataSet();\n Evaluation evaluation0 = new Evaluation(instances0);\n BinarySparseInstance binarySparseInstance0 = new BinarySparseInstance(11);\n IBk iBk0 = new IBk();\n try { \n evaluation0.evaluationForSingleInstance((Classifier) iBk0, (Instance) binarySparseInstance0, true);\n fail(\"Expecting exception: RuntimeException\");\n \n } catch(RuntimeException e) {\n //\n // DenseInstance doesn't have access to a dataset!\n //\n verifyException(\"weka.core.AbstractInstance\", e);\n }\n }", "@Test\n public void trainWithMasterSplinterTest() {\n\n }", "@Test(timeout = 4000)\n public void test031() throws Throwable {\n TextDirectoryLoader textDirectoryLoader0 = new TextDirectoryLoader();\n Instances instances0 = textDirectoryLoader0.getStructure();\n Evaluation evaluation0 = new Evaluation(instances0);\n double double0 = evaluation0.numFalseNegatives((-1436));\n assertEquals(0.0, evaluation0.SFPriorEntropy(), 0.01);\n assertEquals(0.0, double0, 0.01);\n }", "public synchronized long getCheckpoint() {\n return globalCheckpoint;\n }", "@RequiresApi(api = Build.VERSION_CODES.KITKAT)\n public void initializeGraph() {\n checkpointPrefix = Tensors.create((getApplicationContext().getExternalFilesDir(Environment.DIRECTORY_DOCUMENTS).getAbsolutePath() + \"final_model.ckpt\").toString());\n checkpointDir = getApplicationContext().getExternalFilesDir(Environment.DIRECTORY_DOCUMENTS).getAbsolutePath();\n graph = new Graph();\n sess = new Session(graph);\n InputStream inputStream;\n try {\n inputStream = getAssets().open(\"final_graph_hdd.pb\");\n byte[] buffer = new byte[inputStream.available()];\n int bytesRead;\n ByteArrayOutputStream output = new ByteArrayOutputStream();\n while ((bytesRead = inputStream.read(buffer)) != -1) {\n output.write(buffer, 0, bytesRead);\n }\n graphDef = output.toByteArray();\n } catch (IOException e) {\n e.printStackTrace();\n }\n graph.importGraphDef(graphDef);\n try {\n sess.runner().feed(\"save/Const\", checkpointPrefix).addTarget(\"save/restore_all\").run();\n Toast.makeText(this, \"Checkpoint Found and Loaded!\", Toast.LENGTH_SHORT).show();\n }\n catch (Exception e) {\n sess.runner().addTarget(\"init\").run();\n Log.i(\"Checkpoint: \", \"Graph Initialized\");\n }\n }", "public void testSVMChunkLearnng() throws IOException, GateException {\n // Initialisation\n System.out.print(\"Testing the SVM with liner kernenl on chunk learning...\");\n File chunklearningHome = new File(new File(learningHome, \"test\"),\n \"chunklearning\");\n String configFileURL = new File(chunklearningHome, \"engines-svm.xml\")\n .getAbsolutePath();\n String corpusDirName = new File(chunklearningHome, \"data-ontonews\")\n .getAbsolutePath();\n //Remove the label list file, feature list file and chunk length files.\n String wdResults = new File(chunklearningHome,\n ConstantParameters.SUBDIRFORRESULTS).getAbsolutePath();\n emptySavedFiles(wdResults);\n String inputASN = \"Key\";\n loadSettings(configFileURL, corpusDirName, inputASN, inputASN);\n // Set the evaluation mode\n RunMode runM=RunMode.EVALUATION;\n learningApi.setLearningMode(runM);\n controller.execute();\n // Using the evaluation mode for testing\n EvaluationBasedOnDocs evaluation = learningApi.getEvaluation();\n // Compare the overall results with the correct numbers\n assertEquals(\"Wrong value for correct: \", 44, (int)Math.floor(evaluation.macroMeasuresOfResults.correct));\n assertEquals(\"Wrong value for partial: \", 10, (int)Math.floor(evaluation.macroMeasuresOfResults.partialCor));\n assertEquals(\"Wrong value for spurious: \", 11, (int)Math.floor(evaluation.macroMeasuresOfResults.spurious));\n assertEquals(\"Wrong value for missing: \", 40, (int)Math.floor(evaluation.macroMeasuresOfResults.missing));\n\n System.out.println(\"completed\");\n // Remove the resources\n clearOneTest();\n }", "public final void mT__82() throws RecognitionException {\n try {\n int _type = T__82;\n int _channel = DEFAULT_TOKEN_CHANNEL;\n // InternalDSL.g:65:7: ( 'checkpoint' )\n // InternalDSL.g:65:9: 'checkpoint'\n {\n match(\"checkpoint\"); \n\n\n }\n\n state.type = _type;\n state.channel = _channel;\n }\n finally {\n }\n }", "@Test\n public void testCase1() {\n File base = new File(DIR, \"case1\");\n File pl0 = new File(base, \"pl0/EASy\");\n File pl1 = new File(base, \"pl1/EASy\");\n try {\n Location pl0Loc = VarModel.INSTANCE.locations().addLocation(pl0, OBSERVER);\n Location pl1Loc = VarModel.INSTANCE.locations().addLocation(pl1, OBSERVER);\n // add Parent\n pl1Loc.addDependentLocation(pl0Loc);\n \n VarModel.INSTANCE.loaders().registerLoader(ModelUtility.INSTANCE, OBSERVER);\n \n List<ModelInfo<Project>> infos = VarModel.INSTANCE.availableModels().getModelInfo(\"pl1\");\n Assert.assertNotNull(infos);\n Assert.assertTrue(1 == infos.size());\n Project project = VarModel.INSTANCE.load(infos.get(0));\n Assert.assertNotNull(project);\n \n VarModel.INSTANCE.locations().removeLocation(pl1Loc, OBSERVER);\n VarModel.INSTANCE.locations().removeLocation(pl0Loc, OBSERVER);\n VarModel.INSTANCE.loaders().unregisterLoader(ModelUtility.INSTANCE, OBSERVER);\n } catch (ModelManagementException e) {\n Assert.fail(\"unexpected exception \" + e);\n }\n }", "public SModel createBlankCheckpointModel(SModelReference originalModel, @Nullable CheckpointIdentity previousCheckpoint, CheckpointIdentity step) {\n final SModelName transientModelName = createCheckpointModelName(originalModel, step);\n // I'd like to have stable model id to minimize number of changes in CP models\n int mid = originalModel.getModelId().hashCode() ^ step.getName().hashCode();\n // make sure value fits into MPS reserved range, see IntegerSModelId doc.\n mid &= 0x0FFFFFFF;\n mid |= 0x0F000000;\n final SModelReference mr = PersistenceFacade.getInstance()\n .createModelReference(myModule.getModuleReference(), new IntegerSModelId(mid),\n transientModelName.getValue());\n SModel existing = myModule.getModel(mr.getModelId());\n if (existing != null) {\n // Why it's important to forget existing model? E.g. if a model being generated has been already generated and exposed as checkpoint, and\n // was renamed since. Renamed here means change of model name, e.g. due to rename of a containing language module.\n // Besides, it doesn't hurt to drop old checkpoint in any case.\n // There were few possible ways to address MPS-26174 (rename of a module breaks x-model generation).\n // - listen to changes of original model/module and react (e.g. remove related CP models or clear all CPs altogether).\n // - drop all transients as part of rename module action (likely, most safe)\n // - respect model name when building module id value, above. Leaves duplicated, hard-to-distinguish models among checkpoints.\n // - detect there's already model with same id and forget it (least destructive, keeps other CP models in place).\n myModule.forgetModel(existing, true);\n }\n SModel checkpointModel = myModule.createTransientModel(mr);\n assert checkpointModel instanceof ModelWithAttributes;\n ((ModelWithAttributes) checkpointModel).setAttribute(GENERATION_PLAN, step.getPlan().getName());\n ((ModelWithAttributes) checkpointModel).setAttribute(CHECKPOINT, step.getName());\n if (previousCheckpoint != null) {\n ((ModelWithAttributes) checkpointModel).setAttribute(PREV_GENERATION_PLAN, previousCheckpoint.getPlan().getName());\n ((ModelWithAttributes) checkpointModel).setAttribute(PREV_CHECKPOINT, previousCheckpoint.getName());\n }\n return checkpointModel;\n }", "LabState state();", "@Before\n public void DataSmoothExamples3() {\n\t LinkedList<Episode> eps9 = new LinkedList<Episode>();\n\t\teps9.add(new Episode(\"The One with the Tea Leaves\", 150));\n\t\teps9.add(new Episode(\"The One with Pricess Consuela\", 200));\n\t\teps9.add(new Episode(\"The One with the Bird Mother\", 250));\t\t\n\t\tshows3.add(new Show(\"Friends\", 2100, eps9, false));\n\t\t\n\t\tLinkedList<Episode> eps10 = new LinkedList<Episode>();\n\t\teps10.add(new Episode(\"Java\", 200));\n\t\teps10.add(new Episode(\"Python\", 210));\n\t\teps10.add(new Episode(\"C\", 210));\n\t\teps10.add(new Episode(\"C++\", 200));\n\t\tshows3.add(new Show(\"Programming Languages\", 2000, eps10, false));\n\t\t\n\t\tLinkedList<Episode> eps11 = new LinkedList<Episode>();\n\t\teps11.add(new Episode(\"Leaving Storybrooke\", 180));\n\t\teps11.add(new Episode(\"Homecoming\", 190));\n\t\teps11.add(new Episode(\"Where\", 200));\n\t\tshows3.add(new Show(\"Sisterhood\", 600, eps11, false));\n\n\t showResults3.add(200.0);\n\t showResults3.add(198.333);\n\t showResults3.add(190.0);\n\t}", "@Test(timeout = 4000)\n public void test020() throws Throwable {\n TextDirectoryLoader textDirectoryLoader0 = new TextDirectoryLoader();\n Instances instances0 = textDirectoryLoader0.getDataSet();\n Evaluation evaluation0 = new Evaluation(instances0);\n String string0 = evaluation0.toSummaryString(\".arff\", true);\n assertEquals(0.0, evaluation0.unclassified(), 0.01);\n assertEquals(\".arff\\nTotal Number of Instances 0 \\n\", string0);\n assertEquals(0.0, evaluation0.SFEntropyGain(), 0.01);\n }", "@Test\n public void test29() throws Throwable {\n TextDirectoryLoader textDirectoryLoader0 = new TextDirectoryLoader();\n Instances instances0 = textDirectoryLoader0.getDataSet();\n Evaluation evaluation0 = new Evaluation(instances0, (CostMatrix) null);\n double double0 = evaluation0.pctCorrect();\n assertEquals(Double.NaN, double0, 0.01D);\n assertEquals(0.0, evaluation0.SFPriorEntropy(), 0.01D);\n }", "public static void main(String[] args) {\n\t\tList<String> listSouceCode = Helper.getAllDataFromFolder(DATASET1);\n\n\t\t//Create the HMM for concepts\n\t\tHMMConcept hmmConcept = new HMMConcept();\n\t\thmmConcept.init();\n\t\tHMMConceptInit.initTransition(hmmConcept);\n\n\t\t//Now, let us test the training phase\n\t\t//Transition probabilities\n\t\tHMMConceptTransition.\n\t\t\tpreTransition(listSouceCode, hmmConcept);\n\t\tHMMConceptTransition.\n\t\t\ttargetTransition(listSouceCode, hmmConcept);\n\t\tHMMConceptTransition.\n\t\t\totherTransition(listSouceCode, hmmConcept);\n//\t\t//Observations probabilities\n\t\tHMMConceptObservation.\n\t\t\tpreObservation(listSouceCode, hmmConcept);\n\t\tHMMConceptObservation.\n\t\t\ttargetObservation(listSouceCode, hmmConcept);\n\t\tHMMConceptObservation.\n\t\t\totherObservation(listSouceCode, hmmConcept);\n\t\t\n//\t\tSystem.out.println(hmmConcept);\n\n//\t\t//*************************END of the HMM training***************************************\n\n\t\t///To extract knowledge, just uncomment the corresponding source code\n\t\t\n\t\t/**\n\t\t * EPICAM Knowledge extraction\n//\t\t */\n//\t\t//Knowledge extraction\n//\t\tList<String> testedSourceCode = Helper.getAllDataFromFolder(DATASET2);\n//\t\tList<Column> alphaTable;\n//\t\t\n//\t\tfor (String sourceFile : testedSourceCode) {\n//\t\t\talphaTable = MostLikelyExplanationConcept.\n//\t\t\t\t\tfillAlphaStartTable4Concepts(hmmConcept, sourceFile);\n//\n//\t\t\tString extracted = MostLikelyExplanationConcept.knowledgeExtraction(alphaTable);\n////\t\t\tWriting to an OWL file\n//\t\t\tHelper.writeDataToFile(CONCEPTSEXTRACTED, extracted);\n//\t\t\t//The number of false positives and the number of target\n//\t\t\tSystem.out.println(MostLikelyExplanationConcept.nbFalsePositive+\"\\n and nb target: \"+\n//\t\t\tMostLikelyExplanationConcept.nbTarget);\n//\t\t\t\n////\t\t\tSystem.out.println(Term2OWL.term2OWL(new File(CONCEPTSEXTRACTED)));\n//\n//\t\t}\n\n\t\t/**\n\t\t * Geoserver knowledge extraction\n\t\t */\n\n\t\tList<String> testedSourceCode = Helper.getAllDataFromFolder(GEOSERVER);\n\t\tList<Column> alphaTable;\n\t\t\n\t\tfor (String sourceFile : testedSourceCode) {\n\t\t\talphaTable = MostLikelyExplanationConcept.\n\t\t\t\t\tfillAlphaStartTable4Concepts(hmmConcept, sourceFile);\n\n\t\t\tString extracted = MostLikelyExplanationConcept.knowledgeExtraction(alphaTable);\n//\t\t\tWriting to an OWL file\n\t\t\tHelper.writeDataToFile(TERMSEXTRACTED2GEOSERVER, extracted);\n\t\t\t//The number of false positives and the number of target\n\t\t\t\n//\t\t\tSystem.out.println(Term2OWL.term2OWL(new File(CONCEPTSEXTRACTED)));\n\n\t}\n\t\tSystem.out.println(MostLikelyExplanationConcept.nbFalsePositive+\"\\n and nb target: \"+\n\t\tMostLikelyExplanationConcept.nbTarget);\n\t}", "@Test(timeout = 4000)\n public void test110() throws Throwable {\n TextDirectoryLoader textDirectoryLoader0 = new TextDirectoryLoader();\n Instances instances0 = textDirectoryLoader0.getDataSet();\n Evaluation evaluation0 = new Evaluation(instances0);\n String string0 = evaluation0.toSummaryString();\n assertEquals(0.0, evaluation0.unclassified(), 0.01);\n assertEquals(\"\\nTotal Number of Instances 0 \\n\", string0);\n assertEquals(0.0, evaluation0.SFPriorEntropy(), 0.01);\n }", "@Test\n public void test03() throws Throwable {\n TextDirectoryLoader textDirectoryLoader0 = new TextDirectoryLoader();\n Instances instances0 = textDirectoryLoader0.getDataSet();\n Evaluation evaluation0 = new Evaluation(instances0);\n double[] doubleArray0 = new double[19];\n evaluation0.updateMargins(doubleArray0, 0, 0.0);\n assertEquals(0.0, evaluation0.SFPriorEntropy(), 0.01D);\n }", "public static void main(String[] args) throws FileNotFoundException, IOException, InterruptedException {\n ArrayList<Metric> metrics = new ArrayList<Metric>();\n metrics.add(new ELOC());\n metrics.add(new NOPA());\n metrics.add(new NMNOPARAM());\n MyClassifier c1 = new MyClassifier(\"Logistic Regression\");\n c1.setClassifier(new Logistic());\n String type = \"CodeSmellDetection\";\n String smell = \"Large Class\";\n Model model = new Model(\"antModel1\", \"ant\", \"https://github.com/apache/ant.git\", metrics, c1, \"\", type, smell);\n Process process = new Process();\n String periodLength = \"All\";\n String version = \"rel/1.8.3\";\n \n String projectName = model.getProjName();\n process.initGitRepositoryFromFile(scatteringFolderPath + \"/\" + projectName\n + \"/gitRepository.data\");\n try {\n DeveloperTreeManager.calculateDeveloperTrees(process.getGitRepository()\n .getCommits(), periodLength);\n DeveloperFITreeManager.calculateDeveloperTrees(process.getGitRepository()\n .getCommits(), periodLength);\n } catch (Exception ex) {\n Logger.getLogger(TestFile.class.getName()).log(Level.SEVERE, null, ex);\n }\n \n List<Commit> commits = process.getGitRepository().getCommits();\n PeriodManager.calculatePeriods(commits, periodLength);\n List<Period> periods = PeriodManager.getList();\n \n String dirPath = Config.baseDir + projectName + \"/models/\" + model.getName();\n Files.createDirectories(Paths.get(dirPath));\n \n for (Period p : periods) {\n File periodData = new File(dirPath + \"/predictors.csv\");\n PrintWriter pw1 = new PrintWriter(periodData);\n \n String message1 = \"nome,\";\n for(Metric m : metrics) {\n message1 += m.getNome() + \",\";\n }\n message1 += \"isSmell\\n\";\n pw1.write(message1);\n \n //String baseSmellPatch = \"C:/ProgettoTirocinio/dataset/apache-ant-data/apache_1.8.3/Validated\";\n CalculateSmellFiles cs = new CalculateSmellFiles(model.getProjName(), \"Large Class\", \"1.8.1\");\n \n List<FileBean> smellClasses = cs.getSmellClasses();\n \n String projectPath = baseFolderPath + projectName;\n \n Git.gitReset(new File(projectPath));\n Git.clean(new File(projectPath));\n \n List<FileBean> repoFiles = Git.gitList(new File(projectPath), version);\n System.out.println(\"Repo size: \"+repoFiles.size());\n \n \n for (FileBean file : repoFiles) {\n \n if (file.getPath().contains(\".java\")) {\n File workTreeFile = new File(projectPath + \"/\" + file.getPath());\n\n ClassBean classBean = null;\n \n if (workTreeFile.exists()) {\n ArrayList<ClassBean> code = new ArrayList<>();\n ArrayList<ClassBean> classes = ReadSourceCode.readSourceCode(workTreeFile, code);\n \n String body = file.getPath() + \",\";\n if (classes.size() > 0) {\n classBean = classes.get(0);\n\n }\n for(Metric m : metrics) {\n try{\n body += m.getValue(classBean, classes, null, null, null, null) + \",\";\n } catch(NullPointerException e) {\n body += \"0.0,\";\n }\n }\n \n //isSmell\n boolean isSmell = false;\n for(FileBean sm : smellClasses) {\n if(file.getPath().contains(sm.getPath())) {\n System.out.println(\"ok\");\n isSmell = true;\n break;\n }\n }\n \n body = body + isSmell + \"\\n\";\n pw1.write(body); \n }\n }\n }\n Git.gitReset(new File(projectPath));\n pw1.flush();\n }\n \n WekaEvaluator we1 = new WekaEvaluator(baseFolderPath, projectName, new Logistic(), \"Logistic Regression\", model.getName());\n \n ArrayList<Model> models = new ArrayList<Model>();\n \n models.add(model);\n System.out.println(models);\n //create a project\n Project p1 = new Project(\"https://github.com/apache/ant.git\");\n p1.setModels(models);\n p1.setName(\"ant\");\n p1.setVersion(version);\n \n ArrayList<Project> projects;\n //projects.add(p1);\n \n //create a file\n// try {\n// File f = new File(Config.baseDir + \"projects.txt\");\n// FileOutputStream fileOut;\n// if(f.exists()){\n// projects = ProjectHandler.getAllProjects(); \n// Files.delete(Paths.get(Config.baseDir + \"projects.txt\"));\n// //fileOut = new FileOutputStream(f, true);\n// } else {\n// projects = new ArrayList<Project>();\n// Files.createFile(Paths.get(Config.baseDir + \"projects.txt\"));\n// }\n// fileOut = new FileOutputStream(f);\n// projects.add(p1);\n// ObjectOutputStream out = new ObjectOutputStream(fileOut);\n// out.writeObject(projects);\n// out.close();\n// fileOut.close();\n//\n// } catch (FileNotFoundException e) {\n// e.printStackTrace();\n// } catch (IOException e) {\n// e.printStackTrace();\n// }\n// ProjectHandler.setCurrentProject(p1);\n// Project curr = ProjectHandler.getCurrentProject();\n// System.out.println(curr.getGitURL()+\" --- \"+curr.getModels());\n// ArrayList<Project> projectest = ProjectHandler.getAllProjects();\n// for(Project testp : projectest){\n// System.out.println(testp.getModels());\n// }\n }", "public static void demo() {\n\t\tlab_2_2_5();\n\n\t}", "public void testParFileReading() {\n GUIManager oManager = null;\n String sFileName = null;\n try {\n\n oManager = new GUIManager(null);\n \n //Valid file 1\n oManager.clearCurrentData();\n sFileName = writeFile1();\n oManager.inputXMLParameterFile(sFileName);\n SeedPredationBehaviors oPredBeh = oManager.getSeedPredationBehaviors();\n ArrayList<Behavior> p_oBehs = oPredBeh.getBehaviorByParameterFileTag(\"DensDepRodentSeedPredation\");\n assertEquals(1, p_oBehs.size());\n DensDepRodentSeedPredation oPred = (DensDepRodentSeedPredation) p_oBehs.get(0);\n double SMALL_VAL = 0.00001;\n \n assertEquals(oPred.m_fDensDepDensDepCoeff.getValue(), 0.07, SMALL_VAL);\n assertEquals(oPred.m_fDensDepFuncRespExpA.getValue(), 0.02, SMALL_VAL);\n\n assertEquals( ( (Float) oPred.mp_fDensDepFuncRespSlope.getValue().get(0)).\n floatValue(), 0.9, SMALL_VAL);\n assertEquals( ( (Float) oPred.mp_fDensDepFuncRespSlope.getValue().get(1)).\n floatValue(), 0.05, SMALL_VAL);\n\n //Test grid setup\n assertEquals(1, oPred.getNumberOfGrids());\n Grid oGrid = oManager.getGridByName(\"Rodent Lambda\");\n assertEquals(1, oGrid.getDataMembers().length);\n assertTrue(-1 < oGrid.getFloatCode(\"rodent_lambda\")); \n \n }\n catch (ModelException oErr) {\n fail(\"Seed predation validation failed with message \" + oErr.getMessage());\n }\n catch (java.io.IOException oE) {\n fail(\"Caught IOException. Message: \" + oE.getMessage());\n }\n finally {\n new File(sFileName).delete();\n }\n }", "public void flushCheckpoint(long checkpoint)\r\n/* 124: */ {\r\n/* 125:155 */ this.checkpoint = checkpoint;\r\n/* 126: */ }", "@Test\n public void test23() throws Throwable {\n TextDirectoryLoader textDirectoryLoader0 = new TextDirectoryLoader();\n Instances instances0 = textDirectoryLoader0.getDataSet();\n Evaluation evaluation0 = new Evaluation(instances0);\n SerializedClassifier serializedClassifier0 = new SerializedClassifier();\n Object[] objectArray0 = new Object[25];\n double[] doubleArray0 = evaluation0.evaluateModel((Classifier) serializedClassifier0, instances0, objectArray0);\n assertEquals(0.0, evaluation0.SFEntropyGain(), 0.01D);\n }", "@RequiresApi(api = Build.VERSION_CODES.KITKAT)\n public void finalSave1() {\n ArrayList<ArrayList<Tensor<?>>> at = getWeightsPrueba();\n int ctr = 0;\n ArrayList<float[]> diff = new ArrayList<>();\n ArrayList<ArrayList<Tensor<?>>> bt = getWeightsPrueba();\n for (int x = 0; x < 2; x++) { ///vale 2 porque solo w1 y b1\n ArrayList<Tensor<?>> u1 = at.get(x); //para pruebas\n Tensor<?> u = at.get(x).get(0); //variable auxiliar para pruebas\n float[] d = new float[flattenedWeight(bt.get(x).get(0)).length];\n float[] bw = flattenedWeight(bt.get(x).get(0));\n float[] aw = flattenedWeight(at.get(x).get(0));\n\n diff.add(aw);\n\n // float aux = at.get(x).get(0);\n // diff.add(at.get(x).get(0));\n for(int j = 0; j < bw.length; j++)\n {\n d[j] = aw[j] - bw[j];\n }\n diff.add(d);\n }\n Log.i(\"COUNTER: \", String.valueOf(ctr));\n savePrueba1(diff);\n }", "@Test(timeout = 4000)\n public void test011() throws Throwable {\n TextDirectoryLoader textDirectoryLoader0 = new TextDirectoryLoader();\n Instances instances0 = textDirectoryLoader0.getDataSet();\n Evaluation evaluation0 = new Evaluation(instances0);\n double double0 = evaluation0.unclassified();\n assertEquals(0.0, double0, 0.01);\n assertEquals(0.0, evaluation0.SFEntropyGain(), 0.01);\n }", "@Override\n\tpublic void lab() {\n\t\t\n\t}", "public TestPrelab2()\n {\n }", "public static void main(String[] args) throws IOException{\n \n int cells = 16;\n MnistManager mm = new MnistManager(Config.MNIST_TRAIN_IMAGES, Config.MNIST_TRAIN_LABELS);\n \n // Grab first image\n mm.setCurrent(1);\n int[][] image = mm.readPixelMatrix();\n BufferedImage bimg = mm.readImage();\n \n ImageHelper.printImage(mm.readImage(), \"llf_test.png\");\n System.out.println(\"The number is: \" + mm.readLabel());\n \n // Make sure the cell size is correct -> 7 pixels\n int cellSize = image.length / (int)Math.sqrt(cells);\n System.out.println(\"The size of the cells are \" + cellSize + \" pixels\");\n \n // Check that the cell iteration is correct\n for(int i = 0; i < image.length; i += cellSize) {\n for(int j = 0; j < image[0].length; j += cellSize) {\n String info = \"Top left X: \"+i+\" Y: \"+j+\" Bottom right X: \"+(i + cellSize)+\" Y: \"+(j + cellSize);\n System.out.println(info);\n double b = slope(i, j, cellSize, image);\n System.out.println(b);\n System.out.println(\"\\n\\n\");\n }\n }\n }", "public void testStep() {\n\n DT_TractographyImage crossing = Images.getCrossing();\n\n FACT_FibreTracker tracker = new FACT_FibreTracker(crossing);\n\n Vector3D[] pds = crossing.getPDs(1,1,1);\n\n Vector3D step = tracker.getFirstStep(new Point3D(1.5 * Images.xVoxelDim, 1.2 * Images.yVoxelDim, 1.1 * Images.zVoxelDim), 0, true);\n\n assertEquals(1.0, pds[0].dot(step.normalized()), 1E-8);\n\n assertEquals(Images.xVoxelDim / 2.0, step.mod(), 0.05);\n \n step = tracker.getFirstStep(new Point3D(1.5 * Images.xVoxelDim, 1.2 * Images.yVoxelDim, 1.1 * Images.zVoxelDim), 0, false);\n\n assertEquals(-1.0, pds[0].dot(step.normalized()), 1E-8);\n\n step = tracker.getFirstStep(new Point3D(1.5 * Images.xVoxelDim, 1.2 * Images.yVoxelDim, 1.1 * Images.zVoxelDim), 1, true);\n\n assertEquals(1.0, pds[1].dot(step.normalized()), 1E-8);\n\n\n for (int i = 0; i < 2; i++) {\n\n step = tracker.getNextStep(new Point3D(1.5 * Images.xVoxelDim, 1.2 * Images.yVoxelDim, 1.1 * Images.zVoxelDim), new Vector3D(pds[i].x + 0.01, pds[i].y + 0.02, pds[i].z + 0.03).normalized());\n\n assertEquals(1.0, pds[i].dot(step.normalized()), 1E-8);\n\n }\n\n \n }", "public ComputationGraph loadCheckpointCG(Checkpoint checkpoint){\n return loadCheckpointCG(checkpoint.getCheckpointNum());\n }", "@MediumTest\n public void test_1314_3() throws Exception {\n String imagePath = Environment.getExternalStorageDirectory()+\"/LeCoder_Image/if_without_false.png\";\n //Load the file and process it\n activity.loadImageFile(imagePath);\n activity.processImage();\n //Generate the nodes and construct the graph\n activity.generateNodes();\n activity.generateGraph();\n //Print all nodes\n activity.printAllNodes();\n //Check whether the flowchart has no start point\n assertFalse(activity.checkAllNodes());\n }", "@Test\n public void testUpdateCheckpoint() throws Exception {\n TestHarnessBuilder builder = new TestHarnessBuilder();\n builder.withLease(leaseKey, null).build();\n\n // Run the taker and renewer in-between getting the Lease object and calling checkpoint\n coordinator.runLeaseTaker();\n coordinator.runLeaseRenewer();\n\n Lease lease = coordinator.getCurrentlyHeldLease(leaseKey);\n if (lease == null) {\n List<Lease> leases = leaseRefresher.listLeases();\n for (Lease kinesisClientLease : leases) {\n System.out.println(kinesisClientLease);\n }\n }\n\n assertNotNull(lease);\n final ExtendedSequenceNumber initialCheckpoint = new ExtendedSequenceNumber(\"initialCheckpoint\");\n final ExtendedSequenceNumber pendingCheckpoint = new ExtendedSequenceNumber(\"pendingCheckpoint\");\n final ExtendedSequenceNumber newCheckpoint = new ExtendedSequenceNumber(\"newCheckpoint\");\n final byte[] checkpointState = \"checkpointState\".getBytes();\n\n // lease's leaseCounter is wrong at this point, but it shouldn't matter.\n assertTrue(dynamoDBCheckpointer.setCheckpoint(lease.leaseKey(), initialCheckpoint, lease.concurrencyToken()));\n\n final Lease leaseFromDDBAtInitialCheckpoint = leaseRefresher.getLease(lease.leaseKey());\n lease.leaseCounter(lease.leaseCounter() + 1);\n lease.checkpoint(initialCheckpoint);\n lease.leaseOwner(coordinator.workerIdentifier());\n assertEquals(lease, leaseFromDDBAtInitialCheckpoint);\n\n dynamoDBCheckpointer.prepareCheckpoint(lease.leaseKey(), pendingCheckpoint, lease.concurrencyToken().toString(), checkpointState);\n\n final Lease leaseFromDDBAtPendingCheckpoint = leaseRefresher.getLease(lease.leaseKey());\n lease.leaseCounter(lease.leaseCounter() + 1);\n lease.checkpoint(initialCheckpoint);\n lease.pendingCheckpoint(pendingCheckpoint);\n lease.pendingCheckpointState(checkpointState);\n assertEquals(lease, leaseFromDDBAtPendingCheckpoint);\n\n assertTrue(dynamoDBCheckpointer.setCheckpoint(lease.leaseKey(), newCheckpoint, lease.concurrencyToken()));\n\n final Lease leaseFromDDBAtNewCheckpoint = leaseRefresher.getLease(lease.leaseKey());\n lease.leaseCounter(lease.leaseCounter() + 1);\n lease.checkpoint(newCheckpoint);\n lease.pendingCheckpoint(null);\n lease.pendingCheckpointState(null);\n assertEquals(lease, leaseFromDDBAtNewCheckpoint);\n }", "public static void main(String[] args) {\n\t\tUtility utility = new Utility();\n\t\t\n\t\t// build trainingset\n\t\tSystem.out.println(\"Training System....\");\n\t\tArrayList<Student> trainingSet = utility.readStudentfile(\"porto_math_train.csv\");\n\t\tArrayList<Variable> variableSets = Student.getAllVar();\n\n\t\tTree tree = new Tree();\n\t\tNode decisionTree = tree.buildTree2(trainingSet, variableSets);\n\n\t\tutility .printNode(decisionTree);\n\n\t\t// testing DT\n\t\tSystem.out.println(\"\\tTesting System (trainingSet)....\");\n\t\tutility.testTree2(trainingSet, decisionTree);\n\t\t\n\t\tSystem.out.println();\n\t\tSystem.out.println(\"\\tTesting System (testSet)....\");\n\t\tArrayList<Student> testSet = utility.readStudentfile(\"porto_math_test.csv\");\n\t\tutility.testTree2(testSet, decisionTree);\t\t\n\t}", "@Test(timeout = 4000)\n public void test068() throws Throwable {\n TextDirectoryLoader textDirectoryLoader0 = new TextDirectoryLoader();\n Instances instances0 = textDirectoryLoader0.getStructure();\n Evaluation evaluation0 = new Evaluation(instances0);\n evaluation0.addNumericTrainClass(360, (-336.251));\n assertEquals(0.0, evaluation0.SFPriorEntropy(), 0.01);\n }", "@Override\n\tpublic void trainLocal() throws Exception {\n\t\tdouble [][] input = parameters.getInput();\n\t\tdouble [][] result = ann.getResults(parameters);\n\t\tif (state == preTraining) {//in this case, it is running in the pre-training mode.\n\t\t\tinput = newInput;\n\t\t\tresult = newInput;\n\t\t}\n\t\terr = 0; \n\t\tfor (int i = 0; i < mb; i++) {\t\n\t\t\tif (pos > input.length - 1) {\n\t\t\t\tpos = 0;\n\t\t\t}\n\t\t\terr = err + ann.runEpoch(input[pos], pos, result[pos], parameters);\n\t\t\tpos++;\n\t\t}\n\t}", "public static void main(String[] args) throws Exception {\n final int numRows = 28;\n final int numColumns = 28;\n int outputNum = 10; // number of output classes\n int batchSize = 128; // batch size for each epoch\n int rngSeed = 123; // random number seed for reproducibility\n int numEpochs = 15; // number of epochs to perform\n String modelPath = \"モデルパスを入力\";\n\n //Get the DataSetIterators:\n DataSetIterator mnistTrain = new MnistDataSetIterator(batchSize, true, rngSeed);\n DataSetIterator mnistTest = new MnistDataSetIterator(batchSize, false, rngSeed);\n\n\n System.out.println(\"Build model....\");\n MultiLayerConfiguration conf = new NeuralNetConfiguration.Builder()\n .seed(rngSeed) //include a random seed for reproducibility\n // use stochastic gradient descent as an optimization algorithm\n .updater(new Nesterovs(0.006, 0.9))\n .l2(1e-4)\n .list()\n .layer(new DenseLayer.Builder() //create the first, input layer with xavier initialization\n .nIn(numRows * numColumns)\n .nOut(1000)\n .activation(Activation.RELU)\n .weightInit(WeightInit.XAVIER)\n .build())\n .layer(new OutputLayer.Builder(LossFunctions.LossFunction.NEGATIVELOGLIKELIHOOD) //create hidden layer\n .nIn(1000)\n .nOut(outputNum)\n .activation(Activation.SOFTMAX)\n .weightInit(WeightInit.XAVIER)\n .build())\n .build();\n\n\n MultiLayerNetwork model = new MultiLayerNetwork(conf);\n model.init();\n //print the score with every 1 iteration\n UIServer uiServer = UIServer.getInstance();\n InMemoryStatsStorage statsStorage = new InMemoryStatsStorage();\n uiServer.attach(statsStorage);\n model.setListeners(new StatsListener(statsStorage),new ScoreIterationListener(1));\n\n System.out.println(\"Train model....\");\n model.fit(mnistTrain, numEpochs);\n\n\n\n\n System.out.println(\"Evaluate model....\");\n Evaluation eval = model.evaluate(mnistTest);\n System.out.println(eval.stats());\n ModelSerializer.writeModel(model, new File(modelPath), false);\n System.out.println(\"****************Example finished********************\");\n\n }", "private void writeCheckpoint(String filename) {\n File file = new File(checkpointDir, filename);\n try {\n geneticProgram.savePopulation(new FileOutputStream(file));\n } catch (FileNotFoundException e) {\n log.log(Level.WARNING, \"Exception in dump\", e);\n }\n }", "public static void main(final String[] args) {\n \tString enginePath = engines[8];\n\t\tEngineParameter eparams = new EngineParameter(enginePath);\n\n\t\tString url = \"http://files.grouplens.org/datasets/movielens/ml-1m.zip\";\n String folder = \"src/resources/main/data/ml-1m\";\n String modelPath = \"src/resources/main/crossValid/ml-1m/model/\";\n String recPath = \"src/resources/main/crossValid/ml-1m/recommendations/\";\n String dataFile = eparams.getDataSouceParams().getSourceLocation().get(0);\n int nFolds = N_FOLDS;\n \t\t\n System.out.println(\"Preparing splits...\");\n prepareSplits(url, nFolds, dataFile, folder, modelPath);\n \n System.out.println(\"Gathering recomendations...\");\n //recommend(nFolds, modelPath, recPath); // RiVal's original step.\n //orbsRecommend(nFolds, eparams, modelPath); // Based on RiVal' step\n mixedRecommend(nFolds, eparams, modelPath); // Mixed step\n \n //System.out.println(\"Preparing strategy...\");\n // the strategy files are (currently) being ignored\n //prepareStrategy(nFolds, modelPath, recPath, modelPath);\n\n System.out.println(\"Evaluating...\");\n evaluate(nFolds, modelPath, recPath);\n }", "@Test\n public void persistedCorfuTableCheckpointTest() {\n String path = PARAMETERS.TEST_TEMP_DIR;\n\n CorfuRuntime rt = getDefaultRuntime();\n\n final UUID tableId = UUID.randomUUID();\n final PersistenceOptionsBuilder persistenceOptions = PersistenceOptions.builder()\n .dataPath(Paths.get(path + tableId + \"writer\"));\n final int numKeys = 303;\n\n try (PersistedCorfuTable<String, String> table = rt.getObjectsView()\n .build()\n .setTypeToken(PersistedCorfuTable.<String, String>getTypeToken())\n .setStreamID(tableId)\n .setSerializer(Serializers.JSON)\n .setArguments(persistenceOptions.build(), Serializers.JSON)\n .open()) {\n\n for (int x = 0; x < numKeys; x++) {\n table.insert(String.valueOf(x), \"payload\" + x);\n }\n assertThat(table.size()).isEqualTo(numKeys);\n\n MultiCheckpointWriter mcw = new MultiCheckpointWriter();\n mcw.addMap(table);\n Token token = mcw.appendCheckpoints(rt, \"Author1\");\n rt.getAddressSpaceView().prefixTrim(token);\n rt.getAddressSpaceView().gc();\n }\n\n CorfuRuntime newRt = getNewRuntime();\n\n persistenceOptions.dataPath(Paths.get(path + tableId + \"reader\"));\n try (PersistedCorfuTable<String, String> table = newRt.getObjectsView().build()\n .setTypeToken(PersistedCorfuTable.<String, String>getTypeToken())\n .setStreamID(tableId)\n .setSerializer(Serializers.JSON)\n .setArguments(persistenceOptions.build(), Serializers.JSON)\n .open()) {\n\n assertThat(Iterators.elementsEqual(table.entryStream().iterator(),\n table.entryStream().iterator())).isTrue();\n assertThat(table.size()).isEqualTo(numKeys);\n\n }\n }", "@Test\n public void test28() throws Throwable {\n TextDirectoryLoader textDirectoryLoader0 = new TextDirectoryLoader();\n Instances instances0 = textDirectoryLoader0.getDataSet();\n CostSensitiveClassifier costSensitiveClassifier0 = new CostSensitiveClassifier();\n CostMatrix costMatrix0 = costSensitiveClassifier0.getCostMatrix();\n Evaluation evaluation0 = null;\n try {\n evaluation0 = new Evaluation(instances0, costMatrix0);\n fail(\"Expecting exception: Exception\");\n \n } catch(Exception e) {\n //\n // Cost matrix not compatible with data!\n //\n }\n }", "public static void main(String[] args) throws IOException {\n Date date = Calendar.getInstance().getTime();\n DateFormat dateFormat = new SimpleDateFormat(\"yyyy-MM-dd HH.mm.ss\");\n String strDate = dateFormat.format(date);\n String pathString = \"C:/Users/Akshay/Desktop/RL LUT Values/Neural Net Outputs/\"+strDate+\"/\";\n File dir = new File(pathString);\n dir.mkdirs();\n\n String pathStringWeights = pathString+\"Final Weights/\";\n File dirWeights = new File(pathStringWeights);\n dirWeights.mkdirs();\n\n\n //Declare All Variables\n double[][][][][][] LUT = new double[6][4][4][4][4][8];\n\n //Read Input LUT\n String pathToLut = \"C:/Users/Akshay/Desktop/RL LUT Values/Battle 3.txt\";\n loadLutToArray(LUT, pathToLut);\n\n //Initialize Neural Net\n int numInputNeurons = 13; //5 State Variables and 8 for Action with 1 hot Encoding\n int numHiddenNeurons = 20;\n int numOutputNeurons = 1;\n\n double learningRate = 0.01;\n double momentum = 0.5;\n\n double argA = 0;\n double argB = 0;\n\n int t = 1;\n String activation = \"\";\n switch (t) {\n case 1:\n activation = \"Bipolar Sigmoid\";\n break;\n case 2:\n activation = \"Tan Hyperbolic\";\n break;\n default:\n activation = \"Sigmoid\";\n }\n\n double E = 0;\n\n NeuralNet nn1 = new NeuralNet(numInputNeurons, numHiddenNeurons, numOutputNeurons, learningRate, momentum, argA, argB);\n nn1.initWeights(-0.5, 0.5);\n\n //Track Epoch using k\n int k = 0;\n String s = \"Activation = \"+activation+\"\\nLearning Rate = \"+learningRate+\"\\nMomentum = \"+momentum+\"\\nHidden Neurons = \"+numHiddenNeurons;\n\n while(true){\n k++;\n\n if(k>10000){\n String identifier = k+\".\";\n nn1.saveWeights(pathStringWeights,identifier);\n break;\n }\n\n //Start Loop Across LUT\n for(int d = 0; d < 6; d++){\n double di = absScale(d,0,5,-0.8,0.8);\n for(int men = 0; men < 4; men++){\n double meni = absScale(men,0,3,-0.8,0.8);\n for(int een = 0; een < 4; een++){\n double eeni = absScale(een,0,3,-0.8,0.8);\n for(int ex = 0; ex < 4; ex++){\n double exi = absScale(ex,0,3,-0.8,0.8);\n for(int yi = 0; yi < 4; yi++){\n double yii = absScale(yi,0,3,-0.8,0.8);\n for(int act = 0; act < 8; act++){\n //Each action needs to be 1 hot encoded\n double x[] = new double[13];\n switch(act){\n case 0: x = new double[] {di,meni,eeni,exi,yii,0.8,-0.8,-0.8,-0.8,-0.8,-0.8,-0.8,-0.8};\n break;\n case 1: x = new double[] {di,meni,eeni,exi,yii,-0.8,0.8,-0.8,-0.8,-0.8,-0.8,-0.8,-0.8};\n break;\n case 2: x = new double[] {di,meni,eeni,exi,yii,-0.8,-0.8,0.8,-0.8,-0.8,-0.8,-0.8,-0.8};\n break;\n case 3: x = new double[] {di,meni,eeni,exi,yii,-0.8,-0.8,-0.8,0.8,-0.8,-0.8,-0.8,-0.8};\n break;\n case 4: x = new double[] {di,meni,eeni,exi,yii,-0.8,-0.8,-0.8,-0.8,0.8,-0.8,-0.8,-0.8};\n break;\n case 5: x = new double[] {di,meni,eeni,exi,yii,-0.8,-0.8,-0.8,-0.8,-0.8,0.8,-0.8,-0.8};\n break;\n case 6: x = new double[] {di,meni,eeni,exi,yii,-0.8,-0.8,-0.8,-0.8,-0.8,-0.8,0.8,-0.8};\n break;\n case 7: x = new double[] {di,meni,eeni,exi,yii,-0.8,-0.8,-0.8,-0.8,-0.8,-0.8,-0.8,0.8};\n break;\n }\n\n //Defining Training Output For ErrorBackPropagation\n double y[] = {absScale(LUT[d][men][een][ex][yi][act],-1000,1000,-0.8,0.8)};\n\n //Error Back Propagation\n nn1.propagateForward(x,t);\n nn1.propagateBackwardOutput(y,t);\n nn1.weightUpdateOutput(learningRate,momentum);\n nn1.propagateBackwardHidden(t);\n nn1.weightUpdateHidden(learningRate,momentum,x);\n\n E = E + Math.pow((nn1.finalOutput[0] - y[0]),2);\n }\n }\n }\n }\n }\n }\n //RMS Error This Time. Not Total Error\n E = Math.sqrt(E/(12288));\n //Perfect Condition Stuff\n /*if(E<=0.05){\n //System.out.println(\"Trial Number: \"+loop+\" Converged at Epoch \"+k);\n String identifier = k+\".\";\n nn1.saveWeights(pathStringWeights,identifier);\n break;\n }*/\n\n //End of Epoch Code Goes Here\n String cmdOp = \"Epoch \"+k+\", Error = \"+E;\n System.out.println(cmdOp);\n\n s = s + \"\\n\" + k + \" \" + E;\n writeToFile(pathString+\"Stats.txt\",s);\n E = 0;\n }\n }", "@Test(timeout = 4000)\n public void test119() throws Throwable {\n TextDirectoryLoader textDirectoryLoader0 = new TextDirectoryLoader();\n Instances instances0 = textDirectoryLoader0.getDataSet();\n Evaluation evaluation0 = new Evaluation(instances0);\n String string0 = evaluation0.toSummaryString((String) null, true);\n assertEquals(0.0, evaluation0.SFPriorEntropy(), 0.01);\n assertEquals(\"null\\nTotal Number of Instances 0 \\n\", string0);\n }", "@Test(timeout = 4000)\n public void test083() throws Throwable {\n TextDirectoryLoader textDirectoryLoader0 = new TextDirectoryLoader();\n Instances instances0 = textDirectoryLoader0.getStructure();\n Evaluation evaluation0 = new Evaluation(instances0);\n double double0 = evaluation0.SFMeanEntropyGain();\n assertEquals(0.0, evaluation0.SFPriorEntropy(), 0.01);\n assertEquals(Double.NaN, double0, 0.01);\n }", "public synchronized void writeCheckpoint() {\n\t\tflush();\n\t\tpw.println(\"CHECKPOINT \" \n\t\t\t\t\t+ TransactionManager.instance().transactionList());\n\t\tflush();\n\t}", "public static void main(String[] args) throws IOException {\n final dev.punchcafe.vngine.game.GameBuilder<NarrativeImp> gameBuilder = new dev.punchcafe.vngine.game.GameBuilder();\n final NarrativeAdaptor<Object> narrativeReader = (file) -> List.of();\n final var pom = PomLoader.forGame(new File(\"command-line/src/main/resources/vng-game-1\"), narrativeReader).loadGameConfiguration();\n final var narratives = NarrativeParser.parseNarrative(new File(\"command-line/src/main/resources/vng-game-1/narratives/narratives.yml\"));\n final var narrativeService = new NarrativeServiceImp(narratives);\n gameBuilder.setNarrativeReader(new NarrativeReaderImp());\n gameBuilder.setNarrativeService(narrativeService);\n gameBuilder.setPlayerObserver(new SimplePlayerObserver());\n gameBuilder.setProjectObjectModel(pom);\n final var game = gameBuilder.build();\n //game.startNewGame();\n final var saveFile = GameSave.builder()\n .nodeIdentifier(NodeIdentifier.builder()\n .chapterId(\"ch_01\")\n .nodeId(\"1_2_2\")\n .build())\n .savedGameState(SavedGameState.builder()\n .chapterStateSnapshot(StateSnapshot.builder()\n .booleanPropertyMap(Map.of())\n .integerPropertyMap(Map.of())\n .stringPropertyMap(Map.of())\n .build())\n .gameStateSnapshot(StateSnapshot.builder()\n .booleanPropertyMap(Map.of())\n .integerPropertyMap(Map.of())\n .stringPropertyMap(Map.of())\n .build())\n .build())\n .build();\n final var saveGame = game.loadGame(saveFile)\n .tick()\n .tick()\n .saveGame();\n System.out.println(\"checkpoint\");\n }", "public static void intro() {\n System.out.println(\"-----------------------------------------------------------------------\");\n System.out.println(\"Project Phase One\\nCPSC 377\\nVincent Tennant\\n230099844\");\n System.out.println(\"A simple interface to do unit testsing, perform the XOR problem, and give an example of a\\n\" +\n \"rubix cube neural network. The XOR problem and the rubix cube problems will be performed using neural\\n\" +\n \"networks, and trained by stochastic backpropagation.\");\n }", "@Test(timeout = 4000)\n public void test103() throws Throwable {\n TextDirectoryLoader textDirectoryLoader0 = new TextDirectoryLoader();\n Instances instances0 = textDirectoryLoader0.getDataSet();\n Evaluation evaluation0 = new Evaluation(instances0);\n double[][] doubleArray0 = evaluation0.confusionMatrix();\n assertEquals(0, doubleArray0.length);\n assertEquals(0.0, evaluation0.SFPriorEntropy(), 0.01);\n }", "void passivateFlowStorer();", "@Test\n public void test21() throws Throwable {\n TextDirectoryLoader textDirectoryLoader0 = new TextDirectoryLoader();\n Instances instances0 = textDirectoryLoader0.getDataSet();\n Evaluation evaluation0 = new Evaluation(instances0);\n double double0 = evaluation0.errorRate();\n assertEquals(Double.NaN, double0, 0.01D);\n assertEquals(0.0, evaluation0.SFPriorEntropy(), 0.01D);\n }", "@Test(timeout = 4000)\n public void test105() throws Throwable {\n TextDirectoryLoader textDirectoryLoader0 = new TextDirectoryLoader();\n Instances instances0 = textDirectoryLoader0.getStructure();\n Evaluation evaluation0 = new Evaluation(instances0);\n evaluation0.setDiscardPredictions(true);\n assertTrue(evaluation0.getDiscardPredictions());\n }", "void activateFlowStorer();" ]
[ "0.6974207", "0.63968855", "0.6139157", "0.58569604", "0.5841955", "0.5765879", "0.5728435", "0.570278", "0.5670228", "0.5664144", "0.5562027", "0.55581594", "0.55316967", "0.5519555", "0.5514777", "0.55051553", "0.54921216", "0.548769", "0.54753494", "0.5464514", "0.5455792", "0.53795946", "0.5357473", "0.53496504", "0.53423184", "0.53411806", "0.53325546", "0.53293765", "0.532622", "0.5323884", "0.53148675", "0.53077763", "0.53039545", "0.53024274", "0.52873355", "0.5284097", "0.5279372", "0.52631843", "0.52541155", "0.52415705", "0.5225889", "0.52211756", "0.5215053", "0.5202958", "0.5194472", "0.5185556", "0.51707757", "0.5168726", "0.5165917", "0.516275", "0.5157524", "0.5155373", "0.5144903", "0.5133491", "0.51238483", "0.51217926", "0.5120595", "0.5119921", "0.51174396", "0.51156324", "0.5113917", "0.51065314", "0.51037997", "0.5103456", "0.5097641", "0.50952625", "0.5092936", "0.509284", "0.5086544", "0.5085485", "0.5080868", "0.507456", "0.5073125", "0.5071089", "0.5068977", "0.5066694", "0.50614107", "0.50555456", "0.50439125", "0.504255", "0.5037178", "0.50346607", "0.50335443", "0.5031731", "0.5030707", "0.5029288", "0.5029274", "0.50278", "0.502156", "0.50211674", "0.5020596", "0.5019484", "0.50129837", "0.5009672", "0.49989185", "0.49882904", "0.49854234", "0.49838832", "0.49807566", "0.4978919", "0.4976943" ]
0.0
-1
lab 3 checkpoint 2
public void onClick (View v) { //System.out.println("on click"); cakeModel.isLit = false; cakeView.invalidate(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "void checkpoint() throws IOException;", "public void initializeGraphPrueba() {\n //path to checkpoit.ckpt HACER\n //To load the checkpoint, place the checkpoint files in the device and create a Tensor\n //to the path of the checkpoint prefix\n //FALTA ******\n\n // si modelo updated se usa el checkpoints que he descargado del servidor. Si no, el del movil.\n if (isModelUpdated){\n /* //NO VA BIEN:\n checkpointPrefix = Tensors.create((file_descargado).toString());\n Toast.makeText(MainActivity.this, \"Usando el modelo actualizado\", Toast.LENGTH_SHORT).show();\n\n */\n\n //A VER SI VA\n try {\n //Place the .pb file generated before in the assets folder and import it as a byte[] array\n // hay que poner el .meta\n inputCheck = getAssets().open(\"+checkpoints_name_1002-.ckpt.meta\");\n // inputCheck = getAssets().open(\"+checkpoints_name_1002-.ckpt\"); NOT FOUND\n byte[] buffer = new byte[inputCheck.available()];\n int bytesRead;\n ByteArrayOutputStream output = new ByteArrayOutputStream();\n while ((bytesRead = inputCheck.read(buffer)) != -1) {\n output.write(buffer, 0, bytesRead);\n }\n variableAuxCheck = output.toByteArray(); // array con el checkpoint\n } catch (IOException e) {\n e.printStackTrace();\n }\n checkpointPrefix = Tensors.create((variableAuxCheck).toString());\n }\n\n else {\n try {\n //Place the .pb file generated before in the assets folder and import it as a byte[] array\n // hay que poner el .meta\n inputCheck = getAssets().open(\"checkpoint_name1.ckpt.meta\");\n byte[] buffer = new byte[inputCheck.available()];\n int bytesRead;\n ByteArrayOutputStream output = new ByteArrayOutputStream();\n while ((bytesRead = inputCheck.read(buffer)) != -1) {\n output.write(buffer, 0, bytesRead);\n }\n variableAuxCheck = output.toByteArray(); // array con el checkpoint\n } catch (IOException e) {\n e.printStackTrace();\n }\n checkpointPrefix = Tensors.create((variableAuxCheck).toString());\n }\n\n //checkpointPrefix = Tensors.create((getApplicationContext().getExternalFilesDir(Environment.DIRECTORY_DOCUMENTS).getAbsolutePath() + \"final_model.ckpt\").toString()); //PARA USAR EL CHECKPOINT DESCARGADO\n // checkpointDir = getApplicationContext().getExternalFilesDir(Environment.DIRECTORY_DOCUMENTS).getAbsolutePath();\n //Create a variable of class org.tensorflow.Graph:\n graph = new Graph();\n sess = new Session(graph);\n InputStream inputStream;\n try {\n // inputStream = getAssets().open(\"graph.pb\"); //MODELO SENCILLO //PROBAR CON GRAPH_PRUEBA QUE ES MI GRAPH DE O BYTES\n // inputStream = getAssets().open(\"graph5.pb\"); //MODELO SENCILLO\n if (isModelUpdated) { // ESTO ES ALGO TEMPORAL. NO ES BUENO\n inputStream = getAssets().open(\"graph_pesos.pb\");\n }\n else {\n inputStream = getAssets().open(\"graph5.pb\");\n }\n byte[] buffer = new byte[inputStream.available()];\n int bytesRead;\n ByteArrayOutputStream output = new ByteArrayOutputStream();\n while ((bytesRead = inputStream.read(buffer)) != -1) {\n output.write(buffer, 0, bytesRead);\n }\n graphDef = output.toByteArray();\n } catch (IOException e) {\n e.printStackTrace();\n }\n //Place the .pb file generated before in the assets folder and import it as a byte[] array.\n // Let the array's name be graphdef.\n //Now, load the graph from the graphdef:\n graph.importGraphDef(graphDef);\n try {\n //Now, load the checkpoint by running the restore checkpoint op in the graph:\n sess.runner().feed(\"save/Const\", checkpointPrefix).addTarget(\"save/restore_all\").run();\n Toast.makeText(this, \"Checkpoint Found and Loaded!\", Toast.LENGTH_SHORT).show();\n }\n catch (Exception e) {\n //Alternatively, initialize the graph by calling the init op:\n sess.runner().addTarget(\"init\").run();\n Log.i(\"Checkpoint: \", \"Graph Initialized\");\n }\n }", "protected void checkpoint(S state) {\n checkpoint();\n state(state);\n }", "void checkpoint(Node node) throws RepositoryException;", "@Override\n\tpublic Serializable checkpointInfo() throws Exception {\n\t\treturn null;\n\t}", "protected void checkpoint() {\n checkpoint = internalBuffer().readerIndex();\n }", "public void save(){\n checkpoint = chapter;\n }", "private static GeneticProgram loadCheckpoint(String arg) {\n CheckpointLoader cpl = new CheckpointLoader(arg);\n GeneticProgram gp = cpl.instantiate();\n if (gp == null) {\n System.err.println(\"Could not load checkpoint.\");\n System.exit(-1);\n }\n return gp;\n }", "private static void jbptTest2() throws FileNotFoundException, Exception {\n\t\tFile folder = new File(\"models\");\n\t\t\n\t\tFile[] arModels = folder.listFiles(new FileUtil().getFileter(\"pnml\"));\n\t\tfor(File file: arModels)\n\t\t{\n\t\t\t//print the file name\n\t\t\tSystem.out.println(\"========\" + file.getName() + \"========\");\n\n\t\t\t//initialize the counter for conditions and events\n\t\t\tAbstractEvent.count = 0;\n\t\t\tAbstractCondition.count = 0;\n\n\t\t\t//get the file path\n\t\t\tString filePrefix = file.getPath();\n\t\t\tfilePrefix = filePrefix.substring(0, filePrefix.lastIndexOf('.'));\n\t\t\tString filePNG = filePrefix + \".png\";\n\t\t\tString fileCPU = filePrefix + \"-cpu.png\";\n\t\t\tString fileNet = filePrefix + \"-cpu.pnml\";\n\n\t\t\tPnmlImport pnmlImport = new PnmlImport();\n\t\t\tPetriNet p1 = pnmlImport.read(new FileInputStream(file));\n\n\t\t\t// ori\n\t\t\t/*ProvidedObject po1 = new ProvidedObject(\"petrinet\", p1);\n\t\t\t\n\t\t\tDotPngExport dpe1 = new DotPngExport();\n\t\t\tOutputStream image1 = new FileOutputStream(filePNG);\n\t\t\t\n\t\t\tdpe1.export(po1, image1);*/\n\n\t\t\tNetSystem ns = PetriNetConversion.convert(p1);\n\t\t\tProperCompletePrefixUnfolding cpu = new ProperCompletePrefixUnfolding(ns);\n\t\t\tNetSystem netPCPU = PetriNetConversion.convertCPU2NS(cpu);\n\t\t\t// cpu\n\t\t\tPetriNet p2 = PetriNetConversion.convert(netPCPU);\n\t\t\t\n\t\t\tProvidedObject po2 = new ProvidedObject(\"petrinet\", p2);\n\t\t\tDotPngExport dpe2 = new DotPngExport();\n\t\t\tOutputStream image2 = new FileOutputStream(fileCPU);\n\t\t\tdpe2.export(po2, image2);\n//\t\t\t\n\t\t\tExport(p2, fileNet);\n//\t\t\t// net\n//\t\t\tNetSystem nsCPU = PetriNetConversion.convertCPU2NS(cpu);\n//\t\t\tPetriNet pnCPU = PetriNetConversion.convertNS2PN(nsCPU);\n//\t\t\tProvidedObject po3 = new ProvidedObject(\"petrinet\", pnCPU);\n//\t\t\tDotPngExport dpe3 = new DotPngExport();\n//\t\t\tOutputStream image3 = new FileOutputStream(fileNet);\n//\t\t\tdpe3.export(po3, image3);\n\t\t}\n\t\t\tSystem.exit(0);\n\t}", "public static void main(String[] args) {\n\t\tString solutionFile = \"dataset/vlc/task1_solution.en.clusterMle.txt\";\n//\t\tString queryFile = \"dataset/vlc/task1_query.en.f8.n5.txt\";\n//\t\tString targetFile = \"dataset/vlc/task1_target.en.f8.n5.txt\";\n//\t\tString linkFile = \"dataset/vlc/sim_0p_100n.csv\";\n\t\t\n\t\tString malletFile = \"dataset/vlc/folds/all.0.4189.mallet\";\n\t\tString queryFile = \"dataset/vlc/folds/query.0.csv\";\n\t\tString targetFile = \"dataset/vlc/folds/target.0.csv\";\n\t\tString linkFile = \"dataset/vlc/folds/trainingPairs.0.csv\";\n\t\t\n\t\tdouble alpha = 0.01, beta = 0.01, lambda = 0.01;\n\t\t\n\t\tMalletMleCluster clusterMle = new MalletMleCluster(malletFile, linkFile, alpha);\n\t\tTask1Solution solver = new Task1Solution(clusterMle);\n//\t\tfor(alpha = 0.1; alpha<1; alpha += 0.2) {\n//\t\t\tfor(beta = 0.1; beta<1; beta += 0.2) {\n\t\t\t\tfor (lambda = 0.1; lambda<1; lambda += 0.05) {\n\t\t\tclusterMle.setSmoothParameters(alpha, beta, lambda);\n//\t\t\tclusterMle.retrieveTask1Solution(queryFile, solutionFile);\n\t\t\ttry {\n\t\t\t\tsolver.retrieveTask1Solution(queryFile, solutionFile);\n\t\t\t\tdouble precision = Task1Solution.evaluateResult(targetFile, solutionFile);\n\t\t\t\tSystem.out.println(\"alpha: \" + alpha + \"beta: \" + beta + \n\t\t\t\t\t\t\", Lambda: \" + lambda + \", Mle precision: \" + precision);\n\t\t\t} catch (Exception e) {\n\t\t\t\t// TODO Auto-generated catch block\n\t\t\t\te.printStackTrace();\n\t\t\t}\n\t\t\t\t}\n//\t\t\t}\n//\t\t}\n\t}", "public void train ()\t{\t}", "public String toCheckpoint() {\n return null;\n }", "public static void test(String[] args) throws Exception {\n\t\tAbstractPILPDelegate.setDebugMode(null);\r\n\t\t\r\n\t\tComputeCostBasedOnFreq ins = new ComputeCostBasedOnFreq();\r\n\t\tins.initPreMapping(\"D:/data4code/replay/pre.csv\");\r\n\t\tins.getEventSeqForEachPatient(\"D:/data4code/cluster/LogBasedOnKmeansPlusPlus-14.csv\");\r\n\t\tins.removeOneLoop();\r\n\r\n\t\tPetrinetGraph net = null;\r\n\t\tMarking initialMarking = null;\r\n\t\tMarking[] finalMarkings = null; // only one marking is used so far\r\n\t\tXLog log = null;\r\n\t\tMap<Transition, Integer> costMOS = null; // movements on system\r\n\t\tMap<XEventClass, Integer> costMOT = null; // movements on trace\r\n\t\tTransEvClassMapping mapping = null;\r\n\r\n\t\tnet = constructNet(\"D:/data4code/mm.pnml\");\r\n\t\tinitialMarking = getInitialMarking(net);\r\n\t\tfinalMarkings = getFinalMarkings(net);\r\n\t\tXParserRegistry temp=XParserRegistry.instance();\r\n\t\ttemp.setCurrentDefault(new XesXmlParser());\r\n\t\tlog = temp.currentDefault().parse(new File(\"D:/data4code/mm.xes\")).get(0);\r\n//\t\tlog = XParserRegistry.instance().currentDefault().parse(new File(\"d:/temp/BPI2013all90.xes.gz\")).get(0);\r\n\t\t//\t\t\tlog = XParserRegistry.instance().currentDefault().parse(new File(\"d:/temp/BPI 730858110.xes.gz\")).get(0);\r\n\t\t//\t\t\tlog = XFactoryRegistry.instance().currentDefault().openLog();\r\n\t\tcostMOS = constructMOSCostFunction(net);\r\n\t\tXEventClass dummyEvClass = new XEventClass(\"DUMMY\", 99999);\r\n\t\tXEventClassifier eventClassifier = XLogInfoImpl.STANDARD_CLASSIFIER;\r\n\t\tcostMOT = constructMOTCostFunction(net, log, eventClassifier, dummyEvClass);\r\n\t\tmapping = constructMapping(net, log, dummyEvClass, eventClassifier);\r\n\r\n\t\tint cost1 = AlignmentTest.computeCost(costMOS, costMOT, initialMarking, finalMarkings, null, net, log,\r\n\t\t\t\tmapping, false);\r\n\t\tSystem.out.println(cost1);\r\n\t\t\r\n//\t\tint iteration = 0;\r\n//\t\twhile (true) {\r\n//\t\t\tSystem.out.println(\"start: \" + iteration);\r\n//\t\t\tlong start = System.currentTimeMillis();\r\n//\t\t\tint cost1 = AlignmentTest.computeCost(costMOS, costMOT, initialMarking, finalMarkings, null, net, log,\r\n//\t\t\t\t\tmapping, false);\r\n//\t\t\tlong mid = System.currentTimeMillis();\r\n//\t\t\tSystem.out.println(\" With ILP cost: \" + cost1 + \" t: \" + (mid - start));\r\n//\r\n//\t\t\tlong mid2 = System.currentTimeMillis();\r\n//\t\t\tint cost2 = AlignmentTest.computeCost(costMOS, costMOT, initialMarking, finalMarkings, null, net, log,\r\n//\t\t\t\t\tmapping, false);\r\n//\t\t\tlong end = System.currentTimeMillis();\r\n//\r\n//\t\t\tSystem.out.println(\" No ILP cost: \" + cost2 + \" t: \" + (end - mid2));\r\n//\t\t\tif (cost1 != cost2) {\r\n//\t\t\t\tSystem.err.println(\"ERROR\");\r\n//\t\t\t}\r\n//\t\t\t//System.gc();\r\n//\t\t\tSystem.out.flush();\r\n//\t\t\titeration++;\r\n//\t\t}\r\n\r\n\t}", "@Override\n\tpublic void step2() {\n\t\t\n\t}", "public void kirimNotifikasiPengajuan(Training training){\n\t\t\n\t}", "public static void main(String[] args) throws Exception {\n\t\tStoreAlphaWeight.dimensionForSVM=200;\n\t\tLibEstimate le=new LibEstimate();\n\t\tle.countLine();\n\t\tle.readVec();\n\t\tle.readLabel();\n\t\tle.readBias();\n\t\tle.addBiastoVec();\n\t\tle.prepTrainData();\n\t\tle.prepTestData();\n\t\tle.lib();\n\t}", "TrainingTest createTrainingTest();", "@Test\n public void testOutputNTBc2GmTrainingData() throws IOException {\n testSameAsOriginalOutput(\"genia-nt.bc2gm-training.in\", \"genia-nt.bc2gm-training.out\", \"-nt\");\n }", "public static void main(String[] args) {\n\t\tList<String> listSouceCode = Helper.getAllDataFromFolder(DATASET1);\n\n\t\t//Create the HMM for concepts\n\t\tHMMConcept hmmConcept = new HMMConcept();\n\t\thmmConcept.init();\n\t\tHMMConceptInit.initTransition(hmmConcept);\n\n\t\t//Now, let us test the training phase\n\t\t//Transition probabilities\n\t\tHMMConceptTransition.\n\t\t\tpreTransition(listSouceCode, hmmConcept);\n\t\tHMMConceptTransition.\n\t\t\ttargetTransition(listSouceCode, hmmConcept);\n\t\tHMMConceptTransition.\n\t\t\totherTransition(listSouceCode, hmmConcept);\n//\t\t//Observations probabilities\n\t\tHMMConceptObservation.\n\t\t\tpreObservation(listSouceCode, hmmConcept);\n\t\tHMMConceptObservation.\n\t\t\ttargetObservation(listSouceCode, hmmConcept);\n\t\tHMMConceptObservation.\n\t\t\totherObservation(listSouceCode, hmmConcept);\n\t\t\n//\t\tSystem.out.println(hmmConcept);\n\n//\t\t//*************************END of the HMM training***************************************\n\n\t\t///To extract knowledge, just uncomment the corresponding source code\n\t\t\n\t\t/**\n\t\t * EPICAM Knowledge extraction\n//\t\t */\n//\t\t//Knowledge extraction\n//\t\tList<String> testedSourceCode = Helper.getAllDataFromFolder(DATASET2);\n//\t\tList<Column> alphaTable;\n//\t\t\n//\t\tfor (String sourceFile : testedSourceCode) {\n//\t\t\talphaTable = MostLikelyExplanationConcept.\n//\t\t\t\t\tfillAlphaStartTable4Concepts(hmmConcept, sourceFile);\n//\n//\t\t\tString extracted = MostLikelyExplanationConcept.knowledgeExtraction(alphaTable);\n////\t\t\tWriting to an OWL file\n//\t\t\tHelper.writeDataToFile(CONCEPTSEXTRACTED, extracted);\n//\t\t\t//The number of false positives and the number of target\n//\t\t\tSystem.out.println(MostLikelyExplanationConcept.nbFalsePositive+\"\\n and nb target: \"+\n//\t\t\tMostLikelyExplanationConcept.nbTarget);\n//\t\t\t\n////\t\t\tSystem.out.println(Term2OWL.term2OWL(new File(CONCEPTSEXTRACTED)));\n//\n//\t\t}\n\n\t\t/**\n\t\t * Geoserver knowledge extraction\n\t\t */\n\n\t\tList<String> testedSourceCode = Helper.getAllDataFromFolder(GEOSERVER);\n\t\tList<Column> alphaTable;\n\t\t\n\t\tfor (String sourceFile : testedSourceCode) {\n\t\t\talphaTable = MostLikelyExplanationConcept.\n\t\t\t\t\tfillAlphaStartTable4Concepts(hmmConcept, sourceFile);\n\n\t\t\tString extracted = MostLikelyExplanationConcept.knowledgeExtraction(alphaTable);\n//\t\t\tWriting to an OWL file\n\t\t\tHelper.writeDataToFile(TERMSEXTRACTED2GEOSERVER, extracted);\n\t\t\t//The number of false positives and the number of target\n\t\t\t\n//\t\t\tSystem.out.println(Term2OWL.term2OWL(new File(CONCEPTSEXTRACTED)));\n\n\t}\n\t\tSystem.out.println(MostLikelyExplanationConcept.nbFalsePositive+\"\\n and nb target: \"+\n\t\tMostLikelyExplanationConcept.nbTarget);\n\t}", "public static void main(String[] args) {/\n\t\t// Exercise 1 //\n\t\t////////////////////////////////////////////////////////////////////////////////\n\t\t\n\t\tSystem.out.println(\"Exercise 1\");\n\t\tSystem.out.println(\"-----------\");\n\t\t\n\t\tint[] inputs = {1,0,1,1};\n\t\tint[] outputs = {0,0,1,1};\n\t\tNetwork n = new Network(inputs.length);\n\t\ttrainNet(n, inputs, outputs);\n\t\tint[] result = n.test(inputs, true);\n\t\tSystem.out.println(\"Output neurons after testing: \" + Arrays.toString(result));\n\t\t\n\t\t/////////////////////////////////////////////////////////////////////////////////\n\t\t// Exercise 2 //\n\t\t////////////////////////////////////////////////////////////////////////////////\n\t\t\n\t\tSystem.out.println(\"\\nExercise 2\");\n\t\tSystem.out.println(\"-----------\");\n\t\tint[] modifiedI = {1,0,0,1};\n\t\tSystem.out.println(\"Testing with incomplete input: \" + Arrays.toString(modifiedI));\n\t\tresult = n.test(modifiedI, true);\n\t\tSystem.out.println(\"Output neurons after testing: \" + Arrays.toString(result));\n\t\t\n\t\t/////////////////////////////////////////////////////////////////////////////////\n\t\t// Exercise 3 //\n\t\t////////////////////////////////////////////////////////////////////////////////\n\t\t\n\t\tSystem.out.println(\"\\nExercise 3\");\n\t\tSystem.out.println(\"-----------\");\n\t\tint[] noizyI = {1,1,1,1};\n\t\tSystem.out.println(\"Testing with noizy input: \" + Arrays.toString(noizyI));\n\t\tresult = n.test(noizyI, true);\n\t\tSystem.out.println(\"Output neurons after testing: \" + Arrays.toString(result));\n\t\tSystem.out.println(n);\n\t\t\n\t\t/////////////////////////////////////////////////////////////////////////////////\n\t\t// Exercise 4 //\n\t\t////////////////////////////////////////////////////////////////////////////////\n\t\t\n\t\tSystem.out.println(\"\\nExercise 4\");\n\t\tSystem.out.println(\"-----------\");\n\t\tinputs = new int[] {1,0,1,0,0,1};\n\t\toutputs = new int[] {1,1,0,0,1,1};\n\t\tint[] newIns = {0,1,1,0,0,0};\n\t\tint[] newOuts = {1,1,0,1,0,1};\n\t\tn = new Network(inputs.length);\n\t\ttrainNet(n, inputs, outputs);\n\t\ttrainNet(n, newIns, newOuts);\n\t\tresult = n.test(inputs, true);\n\t\tSystem.out.println(\"load param: \" + n.getLoadParameter());\n\t\tSystem.out.println(\"Output neurons after testing: \" + Arrays.toString(result));\n\t\tint[] newResult = n.test(newIns, true);\n\t\tSystem.out.println(\"Output neurons after testing: \" + Arrays.toString(newResult));\n\t\t\n\t\t/////////////////////////////////////////////////////////////////////////////////\n\t\t// Exercise 5 //\n\t\t////////////////////////////////////////////////////////////////////////////////\n\t\t\n\t\tSystem.out.println(\"\\nExercise 5\");\n\t\tSystem.out.println(\"-----------\");\n\t\tmodifiedI = new int[] {1,0,0,0,0,1};\n\t\tSystem.out.println(\"Testing with incomplete input:\");\n\t\tresult = n.test(modifiedI, true);\n\t\tSystem.out.println(\"Output neurons after testing: \" + Arrays.toString(result));\n\t\tmodifiedI = new int[] {0,1,0,0,0,0};\n\t\tSystem.out.println(\"Testing with noisy input:\");\n\t\tresult = n.test(modifiedI, true);\n\t\tSystem.out.println(\"Output neurons after testing: \" + Arrays.toString(result));\n\t\t\n\t\t/////////////////////////////////////////////////////////////////////////////////\n\t\t// Exercise 6 //\n\t\t////////////////////////////////////////////////////////////////////////////////\n\t\tSystem.out.println(\"\\nExercise 6\");\n\t\tSystem.out.println(\"-----------\");\n\t\tint size = 10, iterations = 500, total = 0, maxCount = 0;\n\t\tdouble loadParameter = 0, maxLoad = 0, synapsesLoad = 0, maxSyn = 0;\n\t\tfor(int j = 0 ; j < iterations ; j++) {\n\t\t\tNetwork net = new Network(size);\n\t\t\tint[][] inPatterns = generateRandomPatterns(size);\n\t\t\tint[][] outPatterns = generateRandomPatterns(size);\n\t\t\tint count = 0;\n\t\t\tfor(int i = 0 ; i < inPatterns.length ; i++) {\n\t\t\t\tnet.train(inPatterns[i], outPatterns[i]);\n\t\t\t\tint[] res = net.test(inPatterns[i], false);\n\t\t\t\tif(Arrays.equals(res, outPatterns[i])) {\n\t\t\t\t\tcount++;\n\t\t\t\t} else {\n\t\t\t\t\t// network has made an error\n\t\t\t\t\tnet.pop();\n\t\t\t\t\tdouble lp = net.getLoadParameter();\n\t\t\t\t\tdouble sl = net.synapsesLoad();\n\t\t\t\t\tloadParameter += lp;\n\t\t\t\t\tsynapsesLoad += sl;\n\t\t\t\t\tif(lp > maxLoad)\n\t\t\t\t\t\tmaxLoad = lp;\n\t\t\t\t\tif(sl > maxSyn)\n\t\t\t\t\t\tmaxSyn = sl;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t\ttotal += count;\n\t\t\tif(count > maxCount)\n\t\t\t\tmaxCount = count;\n\t\t}\n\t\t\n\t\tSystem.out.println(\"Network of size: \" + size);\n\t\tSystem.out.println(\"Network on average trained: \" + total/iterations + \" patterns\");\n\t\tSystem.out.println(\"Network average load param: \" + loadParameter/iterations);\n\t\tSystem.out.println(\"Network average synapses load: \" + synapsesLoad/iterations);\n\t\tSystem.out.println(\"Network max load parameter: \" + maxLoad);\n\t\tSystem.out.println(\"Network max synapses load: \" + maxSyn);\n\t\tSystem.out.println(\"Network max number of trained patterns: \" + maxCount);\n\t}", "public final void mT__82() throws RecognitionException {\n try {\n int _type = T__82;\n int _channel = DEFAULT_TOKEN_CHANNEL;\n // InternalDSL.g:65:7: ( 'checkpoint' )\n // InternalDSL.g:65:9: 'checkpoint'\n {\n match(\"checkpoint\"); \n\n\n }\n\n state.type = _type;\n state.channel = _channel;\n }\n finally {\n }\n }", "public long flushCheckpoint()\r\n/* 119: */ {\r\n/* 120:150 */ return this.checkpoint;\r\n/* 121: */ }", "@Override\n\tpublic void run() {\n\t\tfileName = \"out_\" + Program.getProgram().getFileName() + \"_\";\n\t\tint numAddStop = 0;\n\t\t//fileName = \"out_themida_\";\n\n\t\t//fileState.clearContentFile();\n\t\t//bkFile.clearContentFile();\n\t\toverallStartTime = System.currentTimeMillis();\n\t\tlong overallStartTemp = overallStartTime;\n\t\t// BE-PUM algorithm\n\t\tSystem.out.println(\"Starting On-the-fly Model Generation algorithm.\");\n\t\tprogram.getResultFileTemp().appendInLine('\\n' + program.getFileName() + '\\t');\n\t\t\n\t\t// Set up initial context\n\t\tX86TransitionRule rule = new X86TransitionRule();\n\t\tBPCFG cfg = Program.getProgram().getBPCFG();\n\t\tEnvironment env = new Environment();\n\t\t//env.getMemory().resetImportTable(program);\n\t\tAbsoluteAddress location = Program.getProgram().getEntryPoint();\n\t\tInstruction inst = Program.getProgram().getInstruction(location, env);\n\t\tList<BPPath> pathList = new ArrayList<BPPath>();\n\t\t\n\t\t// Insert start node\n\t\tBPVertex startNode = null;\n\t\tstartNode = new BPVertex(location, inst);\n\t\tstartNode.setType(0);\n\t\tcfg.insertVertex(startNode);\n\n\t\tBPState curState = null;\n\t\tBPPath path = null;\n\t\tcurState = new BPState(env, location, inst);\n\t\tpath = new BPPath(curState, new PathList(), new Formulas());\n\t\tpath.setCurrentState(curState);\n\t\tpathList.add(path);\n\n\t\t/*if (Program.getProgram().getFileName().equals(\"api_test_v2.3_lvl1.exe\") \n\t\t\t\t&& isRestored) {\n\t\t\tSystem.out.println(\"Restore State from File.\");\n\t\t\tFileProcess reFile = new FileProcess(\"data/data/restoreState.txt\");\n\t\t\tpathList = restoreState(reFile);\n\t\t\t// bkFile.clearContentFile();\n\t\t\tSystem.out.println(\"Finished restoring state!\");\n\t\t}*/\n\n\t\t// Update at first -----------------------------\n\t\tTIB.setBeUpdated(true);\n\t\tTIB.updateTIB(curState);\n\t\t// ---------------------------------------------\n\n\t\t// PHONG - 20150801 /////////////////////////////\n\t\t// Packer Detection via Header\n\t\tSystem.out.println(\"================PACKER DETECTION VIA HEADER ======================\");\n\t\tif (OTFModelGeneration.detectPacker)\n\t\t{\n\t\t\tprogram.getDetection().detectViaHeader(program);\n\t\t\tprogram.getDetection().setToLogFirst(program);\n\t\t}\n\t\tSystem.out.println(\"==================================================================\");\n\t\t/////////////////////////////////////////////////\n\t\t\n\t\tsynchronized (OTFThreadManager.getInstance()) {\n\t\t\ttry {\n\t\t\t\tOTFThreadManager.getInstance().check(this, pathList);\n\t\t\t\tOTFThreadManager.getInstance().wait();\n\t\t\t} catch (Exception e) {\n\t\t\t\te.printStackTrace();\n\t\t\t}\n\t\t}\n\t\t// PHONG - 20150724\n\t\tSystem.out.println(\"================PACKER DETECTION VIA OTF======================\");\n\t\tprogram.getDetection().packedByTechniques();\n\t\tprogram.getDetection().packedByTechniquesFrequency();\n\t\tSystem.out.println(\"==============================================================\");\n\t}", "public void testSVMChunkLearnng() throws IOException, GateException {\n // Initialisation\n System.out.print(\"Testing the SVM with liner kernenl on chunk learning...\");\n File chunklearningHome = new File(new File(learningHome, \"test\"),\n \"chunklearning\");\n String configFileURL = new File(chunklearningHome, \"engines-svm.xml\")\n .getAbsolutePath();\n String corpusDirName = new File(chunklearningHome, \"data-ontonews\")\n .getAbsolutePath();\n //Remove the label list file, feature list file and chunk length files.\n String wdResults = new File(chunklearningHome,\n ConstantParameters.SUBDIRFORRESULTS).getAbsolutePath();\n emptySavedFiles(wdResults);\n String inputASN = \"Key\";\n loadSettings(configFileURL, corpusDirName, inputASN, inputASN);\n // Set the evaluation mode\n RunMode runM=RunMode.EVALUATION;\n learningApi.setLearningMode(runM);\n controller.execute();\n // Using the evaluation mode for testing\n EvaluationBasedOnDocs evaluation = learningApi.getEvaluation();\n // Compare the overall results with the correct numbers\n assertEquals(\"Wrong value for correct: \", 44, (int)Math.floor(evaluation.macroMeasuresOfResults.correct));\n assertEquals(\"Wrong value for partial: \", 10, (int)Math.floor(evaluation.macroMeasuresOfResults.partialCor));\n assertEquals(\"Wrong value for spurious: \", 11, (int)Math.floor(evaluation.macroMeasuresOfResults.spurious));\n assertEquals(\"Wrong value for missing: \", 40, (int)Math.floor(evaluation.macroMeasuresOfResults.missing));\n\n System.out.println(\"completed\");\n // Remove the resources\n clearOneTest();\n }", "@Test\n public void test30() throws Throwable {\n TextDirectoryLoader textDirectoryLoader0 = new TextDirectoryLoader();\n Instances instances0 = textDirectoryLoader0.getDataSet();\n Evaluation evaluation0 = new Evaluation(instances0);\n boolean boolean0 = evaluation0.getDiscardPredictions();\n assertEquals(0.0, evaluation0.SFPriorEntropy(), 0.01D);\n assertFalse(boolean0);\n }", "@Test\n public void test22() throws Throwable {\n TextDirectoryLoader textDirectoryLoader0 = new TextDirectoryLoader();\n Instances instances0 = textDirectoryLoader0.getDataSet();\n Evaluation evaluation0 = new Evaluation(instances0);\n FastVector fastVector0 = evaluation0.predictions();\n assertEquals(0.0, evaluation0.SFEntropyGain(), 0.01D);\n }", "private Parameters createCheckpoint() {\n Parameters checkpoint = Parameters.create();\n checkpoint.set(\"lastDoc/identifier\", this.lastAddedDocumentIdentifier);\n checkpoint.set(\"lastDoc/number\", this.lastAddedDocumentNumber);\n checkpoint.set(\"indexBlockCount\", this.indexBlockCount);\n Parameters shards = Parameters.create();\n for (Bin b : this.geometricParts.radixBins.values()) {\n for (String indexPath : b.getBinPaths()) {\n shards.set(indexPath, b.size);\n }\n }\n checkpoint.set(\"shards\", shards);\n return checkpoint;\n }", "public static void main(String[] args) throws IOException {\n String dataName = \"Dianping\";\n String fileName = \"checkin_pitf\";\n int coreNum = 1;\n// List<Post> trainPosts = DataReader.readPosts(\"./demo/data/\" + dataName + \"/all_id_core\"+coreNum+\"_train\");\n// List<Post> testPosts = DataReader.readPosts(\"./demo/data/\" + dataName + \"/all_id_core\"+coreNum+\"_test\");\n List<Post> trainPosts = DataReader.readPosts(\"./demo/data/\" + dataName + \"/\"+fileName+\"_train\");\n List<Post> testPosts = DataReader.readPosts(\"./demo/data/\" + dataName + \"/\"+fileName+\"_test\");\n\n System.out.println(\"PITFTest\");\n System.out.println(dataName+\" \"+coreNum);\n int dim = 64;\n double initStdev = 0.01;\n int iter = 20;//100\n double learnRate = 0.05;\n double regU = 0.00005;\n double regI = regU, regT = regU;\n int numSample = 100;\n int randomSeed = 1;\n\n PITF pitf = new PITF(trainPosts, testPosts, dim, initStdev, iter, learnRate, regU, regI, regT, randomSeed, numSample);\n pitf.run();//这个函数会调用model的初始化及创建函数\n System.out.println(\"dataName:\\t\" + dataName);\n System.out.println(\"coreNum:\\t\" + coreNum);\n }", "public void startTrainingMode() {\n\t\t\r\n\t}", "public MultiLayerNetwork loadCheckpointMLN(Checkpoint checkpoint){\n return loadCheckpointMLN(checkpoint.getCheckpointNum());\n }", "@Test(timeout = 4000)\n public void test113() throws Throwable {\n TextDirectoryLoader textDirectoryLoader0 = new TextDirectoryLoader();\n Instances instances0 = textDirectoryLoader0.getStructure();\n Evaluation evaluation0 = new Evaluation(instances0);\n String string0 = evaluation0.toSummaryString(false);\n assertEquals(\"=== Summary ===\\n\\nTotal Number of Instances 0 \\n\", string0);\n assertEquals(0.0, evaluation0.SFSchemeEntropy(), 0.01);\n assertEquals(0.0, evaluation0.unclassified(), 0.01);\n }", "@Test(timeout = 4000)\n public void test021() throws Throwable {\n TextDirectoryLoader textDirectoryLoader0 = new TextDirectoryLoader();\n Instances instances0 = textDirectoryLoader0.getStructure();\n Evaluation evaluation0 = new Evaluation(instances0);\n String string0 = evaluation0.toSummaryString(\"\", false);\n assertEquals(\"\\nTotal Number of Instances 0 \\n\", string0);\n assertEquals(0.0, evaluation0.unclassified(), 0.01);\n assertEquals(0.0, evaluation0.SFSchemeEntropy(), 0.01);\n }", "public void kirimNotifikasiPersetujuan(Training training){\n\t\t\n\t}", "boolean previousStep();", "@Procedure(value = \"mlp.train\", mode = WRITE)\n @Description(\"Backward pass through NN\")\n public void train(@Name(value = \"no. of passes\") long nPasses) {\n\n DataLogger logger = new DataLogger(\"proto1\", \"error\");\n\n for (int i = 0; i < nPasses; i++) {\n updateTrainRate(i + 1);\n forwardPass();\n\n double error = calculateError();\n\n double reward = 1.0 - error;\n\n// if (Math.random() > 0.9) reward = error;\n\n backwardPass(reward);\n moveNext();\n\n\n// System.out.println(String.format(\"Error: %f\", error));\n// if (i % 100 == 0 && i > 0) {\n// double meanError = errors.stream().reduce(0.0, Double::sum) / 100;\n// System.out.println(String.format(\n// \"Mean error: %f, eta: %f\", meanError, eta));\n// errors.clear();\n// }\n// errors.add(error);\n logger.append(error);\n\n\n }\n\n forwardPass();\n logger.close();\n }", "@Test\n public void testCase1() {\n File base = new File(DIR, \"case1\");\n File pl0 = new File(base, \"pl0/EASy\");\n File pl1 = new File(base, \"pl1/EASy\");\n try {\n Location pl0Loc = VarModel.INSTANCE.locations().addLocation(pl0, OBSERVER);\n Location pl1Loc = VarModel.INSTANCE.locations().addLocation(pl1, OBSERVER);\n // add Parent\n pl1Loc.addDependentLocation(pl0Loc);\n \n VarModel.INSTANCE.loaders().registerLoader(ModelUtility.INSTANCE, OBSERVER);\n \n List<ModelInfo<Project>> infos = VarModel.INSTANCE.availableModels().getModelInfo(\"pl1\");\n Assert.assertNotNull(infos);\n Assert.assertTrue(1 == infos.size());\n Project project = VarModel.INSTANCE.load(infos.get(0));\n Assert.assertNotNull(project);\n \n VarModel.INSTANCE.locations().removeLocation(pl1Loc, OBSERVER);\n VarModel.INSTANCE.locations().removeLocation(pl0Loc, OBSERVER);\n VarModel.INSTANCE.loaders().unregisterLoader(ModelUtility.INSTANCE, OBSERVER);\n } catch (ModelManagementException e) {\n Assert.fail(\"unexpected exception \" + e);\n }\n }", "@Test\n public void test08() throws Throwable {\n DecisionStump decisionStump0 = new DecisionStump();\n String string0 = Evaluation.makeOptionString(decisionStump0, false);\n assertEquals(\"\\n\\nGeneral options:\\n\\n-h or -help\\n\\tOutput help information.\\n-synopsis or -info\\n\\tOutput synopsis for classifier (use in conjunction with -h)\\n-t <name of training file>\\n\\tSets training file.\\n-T <name of test file>\\n\\tSets test file. If missing, a cross-validation will be performed\\n\\ton the training data.\\n-c <class index>\\n\\tSets index of class attribute (default: last).\\n-x <number of folds>\\n\\tSets number of folds for cross-validation (default: 10).\\n-no-cv\\n\\tDo not perform any cross validation.\\n-split-percentage <percentage>\\n\\tSets the percentage for the train/test set split, e.g., 66.\\n-preserve-order\\n\\tPreserves the order in the percentage split.\\n-s <random number seed>\\n\\tSets random number seed for cross-validation or percentage split\\n\\t(default: 1).\\n-m <name of file with cost matrix>\\n\\tSets file with cost matrix.\\n-l <name of input file>\\n\\tSets model input file. In case the filename ends with '.xml',\\n\\ta PMML file is loaded or, if that fails, options are loaded\\n\\tfrom the XML file.\\n-d <name of output file>\\n\\tSets model output file. In case the filename ends with '.xml',\\n\\tonly the options are saved to the XML file, not the model.\\n-v\\n\\tOutputs no statistics for training data.\\n-o\\n\\tOutputs statistics only, not the classifier.\\n-i\\n\\tOutputs detailed information-retrieval statistics for each class.\\n-k\\n\\tOutputs information-theoretic statistics.\\n-classifications \\\"weka.classifiers.evaluation.output.prediction.AbstractOutput + options\\\"\\n\\tUses the specified class for generating the classification output.\\n\\tE.g.: weka.classifiers.evaluation.output.prediction.PlainText\\n-p range\\n\\tOutputs predictions for test instances (or the train instances if\\n\\tno test instances provided and -no-cv is used), along with the \\n\\tattributes in the specified range (and nothing else). \\n\\tUse '-p 0' if no attributes are desired.\\n\\tDeprecated: use \\\"-classifications ...\\\" instead.\\n-distribution\\n\\tOutputs the distribution instead of only the prediction\\n\\tin conjunction with the '-p' option (only nominal classes).\\n\\tDeprecated: use \\\"-classifications ...\\\" instead.\\n-r\\n\\tOnly outputs cumulative margin distribution.\\n-z <class name>\\n\\tOnly outputs the source representation of the classifier,\\n\\tgiving it the supplied name.\\n-xml filename | xml-string\\n\\tRetrieves the options from the XML-data instead of the command line.\\n-threshold-file <file>\\n\\tThe file to save the threshold data to.\\n\\tThe format is determined by the extensions, e.g., '.arff' for ARFF \\n\\tformat or '.csv' for CSV.\\n-threshold-label <label>\\n\\tThe class label to determine the threshold data for\\n\\t(default is the first label)\\n\\nOptions specific to weka.classifiers.trees.DecisionStump:\\n\\n-D\\n\\tIf set, classifier is run in debug mode and\\n\\tmay output additional info to the console\\n\", string0);\n }", "public static void main(String[] args) throws FileNotFoundException, IOException, InterruptedException {\n ArrayList<Metric> metrics = new ArrayList<Metric>();\n metrics.add(new ELOC());\n metrics.add(new NOPA());\n metrics.add(new NMNOPARAM());\n MyClassifier c1 = new MyClassifier(\"Logistic Regression\");\n c1.setClassifier(new Logistic());\n String type = \"CodeSmellDetection\";\n String smell = \"Large Class\";\n Model model = new Model(\"antModel1\", \"ant\", \"https://github.com/apache/ant.git\", metrics, c1, \"\", type, smell);\n Process process = new Process();\n String periodLength = \"All\";\n String version = \"rel/1.8.3\";\n \n String projectName = model.getProjName();\n process.initGitRepositoryFromFile(scatteringFolderPath + \"/\" + projectName\n + \"/gitRepository.data\");\n try {\n DeveloperTreeManager.calculateDeveloperTrees(process.getGitRepository()\n .getCommits(), periodLength);\n DeveloperFITreeManager.calculateDeveloperTrees(process.getGitRepository()\n .getCommits(), periodLength);\n } catch (Exception ex) {\n Logger.getLogger(TestFile.class.getName()).log(Level.SEVERE, null, ex);\n }\n \n List<Commit> commits = process.getGitRepository().getCommits();\n PeriodManager.calculatePeriods(commits, periodLength);\n List<Period> periods = PeriodManager.getList();\n \n String dirPath = Config.baseDir + projectName + \"/models/\" + model.getName();\n Files.createDirectories(Paths.get(dirPath));\n \n for (Period p : periods) {\n File periodData = new File(dirPath + \"/predictors.csv\");\n PrintWriter pw1 = new PrintWriter(periodData);\n \n String message1 = \"nome,\";\n for(Metric m : metrics) {\n message1 += m.getNome() + \",\";\n }\n message1 += \"isSmell\\n\";\n pw1.write(message1);\n \n //String baseSmellPatch = \"C:/ProgettoTirocinio/dataset/apache-ant-data/apache_1.8.3/Validated\";\n CalculateSmellFiles cs = new CalculateSmellFiles(model.getProjName(), \"Large Class\", \"1.8.1\");\n \n List<FileBean> smellClasses = cs.getSmellClasses();\n \n String projectPath = baseFolderPath + projectName;\n \n Git.gitReset(new File(projectPath));\n Git.clean(new File(projectPath));\n \n List<FileBean> repoFiles = Git.gitList(new File(projectPath), version);\n System.out.println(\"Repo size: \"+repoFiles.size());\n \n \n for (FileBean file : repoFiles) {\n \n if (file.getPath().contains(\".java\")) {\n File workTreeFile = new File(projectPath + \"/\" + file.getPath());\n\n ClassBean classBean = null;\n \n if (workTreeFile.exists()) {\n ArrayList<ClassBean> code = new ArrayList<>();\n ArrayList<ClassBean> classes = ReadSourceCode.readSourceCode(workTreeFile, code);\n \n String body = file.getPath() + \",\";\n if (classes.size() > 0) {\n classBean = classes.get(0);\n\n }\n for(Metric m : metrics) {\n try{\n body += m.getValue(classBean, classes, null, null, null, null) + \",\";\n } catch(NullPointerException e) {\n body += \"0.0,\";\n }\n }\n \n //isSmell\n boolean isSmell = false;\n for(FileBean sm : smellClasses) {\n if(file.getPath().contains(sm.getPath())) {\n System.out.println(\"ok\");\n isSmell = true;\n break;\n }\n }\n \n body = body + isSmell + \"\\n\";\n pw1.write(body); \n }\n }\n }\n Git.gitReset(new File(projectPath));\n pw1.flush();\n }\n \n WekaEvaluator we1 = new WekaEvaluator(baseFolderPath, projectName, new Logistic(), \"Logistic Regression\", model.getName());\n \n ArrayList<Model> models = new ArrayList<Model>();\n \n models.add(model);\n System.out.println(models);\n //create a project\n Project p1 = new Project(\"https://github.com/apache/ant.git\");\n p1.setModels(models);\n p1.setName(\"ant\");\n p1.setVersion(version);\n \n ArrayList<Project> projects;\n //projects.add(p1);\n \n //create a file\n// try {\n// File f = new File(Config.baseDir + \"projects.txt\");\n// FileOutputStream fileOut;\n// if(f.exists()){\n// projects = ProjectHandler.getAllProjects(); \n// Files.delete(Paths.get(Config.baseDir + \"projects.txt\"));\n// //fileOut = new FileOutputStream(f, true);\n// } else {\n// projects = new ArrayList<Project>();\n// Files.createFile(Paths.get(Config.baseDir + \"projects.txt\"));\n// }\n// fileOut = new FileOutputStream(f);\n// projects.add(p1);\n// ObjectOutputStream out = new ObjectOutputStream(fileOut);\n// out.writeObject(projects);\n// out.close();\n// fileOut.close();\n//\n// } catch (FileNotFoundException e) {\n// e.printStackTrace();\n// } catch (IOException e) {\n// e.printStackTrace();\n// }\n// ProjectHandler.setCurrentProject(p1);\n// Project curr = ProjectHandler.getCurrentProject();\n// System.out.println(curr.getGitURL()+\" --- \"+curr.getModels());\n// ArrayList<Project> projectest = ProjectHandler.getAllProjects();\n// for(Project testp : projectest){\n// System.out.println(testp.getModels());\n// }\n }", "public static void main(String[] args) throws IOException {\n\t\tMain t = new Main();\n\t\tSystem.out.println(\"The model is trained: \");\n\t\tt.training(enTrainingDir, 0.7);\n\t\tSystem.out.println(\"Check validation in example of \\\"AB\\\":\");\n\t\tt.checkValid(\"AB\");\n\t\tSystem.out.println();\n\t\tSystem.out.println(\"============= unsmoothed models =============================================================================\");\n\t\tSystem.out.print(\"Unigram: \");\n\t\tSystem.out.println(t.uni);\n\t\tSystem.out.print(\"Bigram: \");\n\t\tSystem.out.println(t.bi);\n\t\tSystem.out.print(\"Trigram: \");\n\t\tSystem.out.println(t.tri);\n\t\tSystem.out.println();\n\t\tSystem.out.println(\"============= add-one smoothed models ========================================================================\");\n\t\tSystem.out.println(\"Note: this is only one of smoothed models , not the tuning process. Because there would be too many console lines.\");\n\t\tSystem.out.println(\"Here I take add-k = 0.7 as an example.\");\n\t\tSystem.out.println(\"*************************************************************************************************************\");\n\t\tdouble k = 0.7;\n\t\tt.training(enTrainingDir, 0.7);\n\t\tt.calculateScore(testDir, k, null, null);\n\t\tt.training(esTrainingDir, 0.7);\n\t\tt.calculateScore(testDir, k, null, null);\n\t\tt.training(deTrainingDir, 0.7);\n\t\tt.calculateScore(testDir, k, null, null);\n\t\tSystem.out.println(\"*************************************************************************************************************\");\n\t\tSystem.out.println(\"Then I take the classic add-k = 1.0 as an example.\");\n\t\tSystem.out.println(\"*************************************************************************************************************\");\n\t\tk = 1.0;\n\t\tt.training(enTrainingDir, 0.7);\n\t\tt.calculateScore(testDir, k, null, null);\n\t\tt.training(esTrainingDir, 0.7);\n\t\tt.calculateScore(testDir, k, null, null);\n\t\tt.training(deTrainingDir, 0.7);\n\t\tt.calculateScore(testDir, k, null, null);\n\t\tSystem.out.println();\n\t\tSystem.out.println(\"===== linear interpolation smoothed models ===================================================================\");\n\t\tdouble[] lambdas_tri = new double[] {1.0 / 3, 1.0 / 3, 1.0 / 3};\n\t\tdouble[] lambdas_bi = new double[] {1.0 / 2, 1.0 / 2};\n\t\tSystem.out.println(\"First is equally weighted lambdas: \" + Arrays.toString(lambdas_tri) + \" and \" + Arrays.toString(lambdas_bi));\n\t\tt.training(enTrainingDir, 0.7);\n\t\tt.calculateScore(testDir, 0, lambdas_bi, lambdas_tri);\n\t\tt.training(esTrainingDir, 0.7);\n\t\tt.calculateScore(testDir, 0, lambdas_bi, lambdas_tri);\n\t\tt.training(deTrainingDir, 0.7);\n\t\tt.calculateScore(testDir, 0, lambdas_bi, lambdas_tri);\n\t\tSystem.out.println(\"**************************************************************************************************************\");\n\t\tlambdas_tri = new double[] {0.5, 0.3, 0.2};\n\t\tlambdas_bi = new double[] {0.7, 0.3};\n\t\tSystem.out.println(\"Then is tuned-weighted lambdas: \" + Arrays.toString(lambdas_tri) + \" and \" + Arrays.toString(lambdas_bi));\n\t\tSystem.out.println(\"Again, this is not all the tuning process. Here is only one set of lambdas.\");\n\t\tt.training(enTrainingDir, 0.7);\n\t\tt.calculateScore(testDir, 0, lambdas_bi, lambdas_tri);\n\t\tt.training(esTrainingDir, 0.7);\n\t\tt.calculateScore(testDir, 0, lambdas_bi, lambdas_tri);\n\t\tt.training(deTrainingDir, 0.7);\n\t\tt.calculateScore(testDir, 0, lambdas_bi, lambdas_tri);\n\t\tSystem.out.println();\n\t\tSystem.out.println(\"=================== Generating texts ==========================================================================\");\n\t\tSystem.out.println(\"To save console space, here I generate A to E, five sentences. Feel free to adjust parameters in code.\");\n\t\tSystem.out.println(\"***************************************************************************************************************\");\n\t\tt.training(enTrainingDir, 0.7);\n\t\tSystem.out.println(\"**************** Bi-gram generating ***************************************************************************\");\n\t\tfor (char c = 'A'; c <= 'E'; c++) {\n\t\t\tt.generateWithBigramModel(String.valueOf(c));\n\t\t}\n\t\tSystem.out.println();\n\t\tSystem.out.println();\n\t\tSystem.out.println(\"Not that good huh?\");\n\t\tSystem.out.println(\"**************** Tri-gram generating *************************************************************************\");\n\t\tfor (char c = 'A'; c <= 'E'; c++) {\n\t\t\tt.generateWithBigramModel(String.valueOf(c));\n\t\t}\n\t\tSystem.out.println();\n\t\tSystem.out.println();\n\t\tSystem.out.println(\"...Seems not good as well.\");\n\t}", "public static void main(String[] args) {\n\t\tSparkConf conf = new SparkConf().setAppName(\"NB\").setMaster(\"local[*]\").set(\"spark.ui.port\",\"4040\");;\n\t JavaSparkContext jsc = new JavaSparkContext(conf);\n\t\tString path = \"localpath\";\n\t\tJavaRDD<LabeledPoint> inputData = MLUtils.loadLabeledPoints(jsc.sc(), path).toJavaRDD();\n\t\tJavaRDD<LabeledPoint>[] tmp = inputData.randomSplit(new double[]{0.6, 0.4});\n\t\tJavaRDD<LabeledPoint> training = tmp[0]; // training set\n\t\tJavaRDD<LabeledPoint> test = tmp[1]; // test set\n\t\tNaiveBayesModel model = NaiveBayes.train(training.rdd(), 1.0);\n\t\tJavaPairRDD<Double, Double> predictionAndLabel =\n\t\t test.mapToPair(p -> new Tuple2<>(model.predict(p.features()), p.label()));\n\t\t// Save and load model\n\t\tmodel.save(jsc.sc(), \"localotuput_path\");\n\t\tNaiveBayesModel sameModel = NaiveBayesModel.load(jsc.sc(), \"localotuput_path\");\n\t\t\n\t\tdouble accuracy =\n\t\t\t\t predictionAndLabel.filter(pl -> pl._1().equals(pl._2())).count() / (double) test.count();\n\t\t\t\t\n\t\tSystem.out.println(\"The final accuracy is\"+accuracy);\n//\t\tpredictionAndLabel.foreach(data -> {\n//\t\t System.out.println(\"final model=\"+data._1() + \"final label=\" + data._2());\n//\t\t}); \n\t}", "@RequiresApi(api = Build.VERSION_CODES.KITKAT)\n public void initializeGraph() {\n checkpointPrefix = Tensors.create((getApplicationContext().getExternalFilesDir(Environment.DIRECTORY_DOCUMENTS).getAbsolutePath() + \"final_model.ckpt\").toString());\n checkpointDir = getApplicationContext().getExternalFilesDir(Environment.DIRECTORY_DOCUMENTS).getAbsolutePath();\n graph = new Graph();\n sess = new Session(graph);\n InputStream inputStream;\n try {\n inputStream = getAssets().open(\"final_graph_hdd.pb\");\n byte[] buffer = new byte[inputStream.available()];\n int bytesRead;\n ByteArrayOutputStream output = new ByteArrayOutputStream();\n while ((bytesRead = inputStream.read(buffer)) != -1) {\n output.write(buffer, 0, bytesRead);\n }\n graphDef = output.toByteArray();\n } catch (IOException e) {\n e.printStackTrace();\n }\n graph.importGraphDef(graphDef);\n try {\n sess.runner().feed(\"save/Const\", checkpointPrefix).addTarget(\"save/restore_all\").run();\n Toast.makeText(this, \"Checkpoint Found and Loaded!\", Toast.LENGTH_SHORT).show();\n }\n catch (Exception e) {\n sess.runner().addTarget(\"init\").run();\n Log.i(\"Checkpoint: \", \"Graph Initialized\");\n }\n }", "@Test(timeout = 4000)\n public void test022() throws Throwable {\n TextDirectoryLoader textDirectoryLoader0 = new TextDirectoryLoader();\n Instances instances0 = textDirectoryLoader0.getStructure();\n Evaluation evaluation0 = new Evaluation(instances0);\n evaluation0.toMatrixString(\"getPreBuiltClassifiers\");\n assertEquals(0.0, evaluation0.SFEntropyGain(), 0.01);\n }", "public static void main(String[] args) throws IOException {\n final dev.punchcafe.vngine.game.GameBuilder<NarrativeImp> gameBuilder = new dev.punchcafe.vngine.game.GameBuilder();\n final NarrativeAdaptor<Object> narrativeReader = (file) -> List.of();\n final var pom = PomLoader.forGame(new File(\"command-line/src/main/resources/vng-game-1\"), narrativeReader).loadGameConfiguration();\n final var narratives = NarrativeParser.parseNarrative(new File(\"command-line/src/main/resources/vng-game-1/narratives/narratives.yml\"));\n final var narrativeService = new NarrativeServiceImp(narratives);\n gameBuilder.setNarrativeReader(new NarrativeReaderImp());\n gameBuilder.setNarrativeService(narrativeService);\n gameBuilder.setPlayerObserver(new SimplePlayerObserver());\n gameBuilder.setProjectObjectModel(pom);\n final var game = gameBuilder.build();\n //game.startNewGame();\n final var saveFile = GameSave.builder()\n .nodeIdentifier(NodeIdentifier.builder()\n .chapterId(\"ch_01\")\n .nodeId(\"1_2_2\")\n .build())\n .savedGameState(SavedGameState.builder()\n .chapterStateSnapshot(StateSnapshot.builder()\n .booleanPropertyMap(Map.of())\n .integerPropertyMap(Map.of())\n .stringPropertyMap(Map.of())\n .build())\n .gameStateSnapshot(StateSnapshot.builder()\n .booleanPropertyMap(Map.of())\n .integerPropertyMap(Map.of())\n .stringPropertyMap(Map.of())\n .build())\n .build())\n .build();\n final var saveGame = game.loadGame(saveFile)\n .tick()\n .tick()\n .saveGame();\n System.out.println(\"checkpoint\");\n }", "public static void main(String[] args) throws IOException {\n\t\t \tstart=new A1063307_Checkpoint6();\r\n\t\t\tstart.setVisible(true);\r\n\t\t\tstart.setSize(200,200);\r\n\t\t\tstart.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);\r\n\t\t\tstart.setResizable(false);\t\r\n\t}", "static void playC45() throws IOException {\n\t\tRealVector[] data = NNDataset.getData(NNDataset.HOME);\n\t\tRealVector[] label = NNDataset.getLabel(NNDataset.HOME);\n\t\tRealMatrix d = MatrixUtils.createRealMatrix(data.length, data[0].getDimension());\n\t\tfor (int i = 0; i < data.length; i++) {\n\t\t\td.setRowVector(i, data[i]);\n\t\t}\n\t\td = d.transpose(); // data = column vector\n\n\t\tRealVector l = MatrixUtils.createRealVector(new double[label.length]);\n\t\tfor (int i = 0; i < l.getDimension(); i++) {\n\t\t\tl.setEntry(i, label[i].getEntry(0));\n\t\t}\n\n\t\tDecisionNode root = training(d, l);\n\t\tString[] header = NNDataset.getHeader(NNDataset.HOME);\n\t\tprintTree(root, header);\n\n\t\tInteger lb = predict(root, data[0]);\n\t\tSystem.out.println(lb);\n\n\t\tdouble ok = MSE(root, data, label);\n\t\tSystem.out.println(\"total hit: \" + ok);\n\t}", "public static void main(String[] args) throws FileFormatException,\n IOException {\n \n OpdfMultiGaussianFactory initFactoryPunch = new OpdfMultiGaussianFactory(\n 3);\n \n Reader learnReaderPunch = new FileReader(\n \"punchlearn.seq\");\n List<List<ObservationVector>> learnSequencesPunch = ObservationSequencesReader\n .readSequences(new ObservationVectorReader(), learnReaderPunch);\n learnReaderPunch.close();\n \n KMeansLearner<ObservationVector> kMeansLearnerPunch = new KMeansLearner<ObservationVector>(\n 10, initFactoryPunch, learnSequencesPunch);\n // Create an estimation of the HMM (initHmm) using one iteration of the\n // k-Means algorithm\n Hmm<ObservationVector> initHmmPunch = kMeansLearnerPunch.iterate();\n \n // Use BaumWelchLearner to create the HMM (learntHmm) from initHmm\n BaumWelchLearner baumWelchLearnerPunch = new BaumWelchLearner();\n Hmm<ObservationVector> learntHmmPunch = baumWelchLearnerPunch.learn(\n initHmmPunch, learnSequencesPunch);\n \n // Create HMM for scroll-down gesture\n \n OpdfMultiGaussianFactory initFactoryScrolldown = new OpdfMultiGaussianFactory(\n 3);\n \n Reader learnReaderScrolldown = new FileReader(\n \"scrolllearn.seq\");\n List<List<ObservationVector>> learnSequencesScrolldown = ObservationSequencesReader\n .readSequences(new ObservationVectorReader(),\n learnReaderScrolldown);\n learnReaderScrolldown.close();\n \n KMeansLearner<ObservationVector> kMeansLearnerScrolldown = new KMeansLearner<ObservationVector>(\n 10, initFactoryScrolldown, learnSequencesScrolldown);\n // Create an estimation of the HMM (initHmm) using one iteration of the\n // k-Means algorithm\n Hmm<ObservationVector> initHmmScrolldown = kMeansLearnerScrolldown\n .iterate();\n \n // Use BaumWelchLearner to create the HMM (learntHmm) from initHmm\n BaumWelchLearner baumWelchLearnerScrolldown = new BaumWelchLearner();\n Hmm<ObservationVector> learntHmmScrolldown = baumWelchLearnerScrolldown\n .learn(initHmmScrolldown, learnSequencesScrolldown);\n \n // Create HMM for send gesture\n \n OpdfMultiGaussianFactory initFactorySend = new OpdfMultiGaussianFactory(\n 3);\n \n Reader learnReaderSend = new FileReader(\n \"sendlearn.seq\");\n List<List<ObservationVector>> learnSequencesSend = ObservationSequencesReader\n .readSequences(new ObservationVectorReader(), learnReaderSend);\n learnReaderSend.close();\n \n KMeansLearner<ObservationVector> kMeansLearnerSend = new KMeansLearner<ObservationVector>(\n 10, initFactorySend, learnSequencesSend);\n // Create an estimation of the HMM (initHmm) using one iteration of the\n // k-Means algorithm\n Hmm<ObservationVector> initHmmSend = kMeansLearnerSend.iterate();\n \n // Use BaumWelchLearner to create the HMM (learntHmm) from initHmm\n BaumWelchLearner baumWelchLearnerSend = new BaumWelchLearner();\n Hmm<ObservationVector> learntHmmSend = baumWelchLearnerSend.learn(\n initHmmSend, learnSequencesSend);\n \n Reader testReader = new FileReader(\n \"scroll.seq\");\n List<List<ObservationVector>> testSequences = ObservationSequencesReader\n .readSequences(new ObservationVectorReader(), testReader);\n testReader.close();\n \n short gesture; // punch = 1, scrolldown = 2, send = 3\n double punchProbability, scrolldownProbability, sendProbability;\n for (int i = 0; i <= 4; i++) {\n punchProbability = learntHmmPunch.probability(testSequences\n .get(i));\n gesture = 1;\n scrolldownProbability = learntHmmScrolldown.probability(testSequences\n .get(i));\n if (scrolldownProbability > punchProbability) {\n gesture = 2;\n }\n sendProbability = learntHmmSend.probability(testSequences\n .get(i));\n if ((gesture == 1 && sendProbability > punchProbability)\n || (gesture == 2 && sendProbability > scrolldownProbability)) {\n gesture = 3;\n }\n if (gesture == 1) {\n System.out.println(\"This is a punch gesture\");\n } else if (gesture == 2) {\n System.out.println(\"This is a scroll-down gesture\");\n } else if (gesture == 3) {\n System.out.println(\"This is a send gesture\");\n }\n }\n }", "public static void main(final String[] args) {\n \tString enginePath = engines[8];\n\t\tEngineParameter eparams = new EngineParameter(enginePath);\n\n\t\tString url = \"http://files.grouplens.org/datasets/movielens/ml-1m.zip\";\n String folder = \"src/resources/main/data/ml-1m\";\n String modelPath = \"src/resources/main/crossValid/ml-1m/model/\";\n String recPath = \"src/resources/main/crossValid/ml-1m/recommendations/\";\n String dataFile = eparams.getDataSouceParams().getSourceLocation().get(0);\n int nFolds = N_FOLDS;\n \t\t\n System.out.println(\"Preparing splits...\");\n prepareSplits(url, nFolds, dataFile, folder, modelPath);\n \n System.out.println(\"Gathering recomendations...\");\n //recommend(nFolds, modelPath, recPath); // RiVal's original step.\n //orbsRecommend(nFolds, eparams, modelPath); // Based on RiVal' step\n mixedRecommend(nFolds, eparams, modelPath); // Mixed step\n \n //System.out.println(\"Preparing strategy...\");\n // the strategy files are (currently) being ignored\n //prepareStrategy(nFolds, modelPath, recPath, modelPath);\n\n System.out.println(\"Evaluating...\");\n evaluate(nFolds, modelPath, recPath);\n }", "private String checkpointString(int cp, long time) {\n\t\treturn \"Checkpoint \" + ChatColor.GRAY + String.valueOf(cp) + ChatColor.WHITE + \" = \" + ChatColor.GRAY + _.getGameController().getTimeString(0, time) + ChatColor.WHITE;\n\t}", "@Test\n public void test33() throws Throwable {\n TextDirectoryLoader textDirectoryLoader0 = new TextDirectoryLoader();\n Instances instances0 = textDirectoryLoader0.getDataSet();\n Evaluation evaluation0 = new Evaluation(instances0);\n double double0 = evaluation0.correct();\n assertEquals(0.0, evaluation0.SFPriorEntropy(), 0.01D);\n assertEquals(0.0, double0, 0.01D);\n }", "@Test\n public void trainWithMasterSplinterTest() {\n\n }", "@Test\n public void test19() throws Throwable {\n TextDirectoryLoader textDirectoryLoader0 = new TextDirectoryLoader();\n Instances instances0 = textDirectoryLoader0.getDataSet();\n Evaluation evaluation0 = new Evaluation(instances0);\n double double0 = evaluation0.KBInformation();\n assertEquals(0.0, double0, 0.01D);\n assertEquals(0.0, evaluation0.SFPriorEntropy(), 0.01D);\n }", "public void testParFileReading() {\n GUIManager oManager = null;\n String sFileName = null;\n try {\n\n oManager = new GUIManager(null);\n \n //Valid file 1\n oManager.clearCurrentData();\n sFileName = writeFile1();\n oManager.inputXMLParameterFile(sFileName);\n SeedPredationBehaviors oPredBeh = oManager.getSeedPredationBehaviors();\n ArrayList<Behavior> p_oBehs = oPredBeh.getBehaviorByParameterFileTag(\"DensDepRodentSeedPredation\");\n assertEquals(1, p_oBehs.size());\n DensDepRodentSeedPredation oPred = (DensDepRodentSeedPredation) p_oBehs.get(0);\n double SMALL_VAL = 0.00001;\n \n assertEquals(oPred.m_fDensDepDensDepCoeff.getValue(), 0.07, SMALL_VAL);\n assertEquals(oPred.m_fDensDepFuncRespExpA.getValue(), 0.02, SMALL_VAL);\n\n assertEquals( ( (Float) oPred.mp_fDensDepFuncRespSlope.getValue().get(0)).\n floatValue(), 0.9, SMALL_VAL);\n assertEquals( ( (Float) oPred.mp_fDensDepFuncRespSlope.getValue().get(1)).\n floatValue(), 0.05, SMALL_VAL);\n\n //Test grid setup\n assertEquals(1, oPred.getNumberOfGrids());\n Grid oGrid = oManager.getGridByName(\"Rodent Lambda\");\n assertEquals(1, oGrid.getDataMembers().length);\n assertTrue(-1 < oGrid.getFloatCode(\"rodent_lambda\")); \n \n }\n catch (ModelException oErr) {\n fail(\"Seed predation validation failed with message \" + oErr.getMessage());\n }\n catch (java.io.IOException oE) {\n fail(\"Caught IOException. Message: \" + oE.getMessage());\n }\n finally {\n new File(sFileName).delete();\n }\n }", "@MediumTest\n public void test_1314_2() throws Exception {\n String imagePath = Environment.getExternalStorageDirectory()+\"/LeCoder_Image/statement_without_prev.png\";\n //Load the file and process it\n activity.loadImageFile(imagePath);\n activity.processImage();\n //Generate the nodes and construct the graph\n activity.generateNodes();\n activity.generateGraph();\n //Print all nodes\n activity.printAllNodes();\n //Check whether the flowchart has no start point\n assertFalse(activity.checkAllNodes());\n }", "public void train() throws Exception;", "public static void main (String [] args) throws Exception { \n//\t\tconf.setMapperClass(DadaMapper.class);\n//\t\tconf.setReducerClass(DataReducer.class);\n\t\t\n//\t\tConfiguration conf = new Configuration(); \n//\t\tconf.set(\"fs.default.name\", \"hdfs://zli:9000\"); \n//\t\tconf.set(\"hadoop.job.user\", \"hadoop\"); \t\t \n//\t\tconf.set(\"mapred.job.tracker\", \"zli:9001\");\n\t\t\n\t\tJob job = new Job(); \n\t\tjob.setJarByClass(NBModelTestJob.class);\n\t\tjob.getConfiguration().set(\"fs.defaultFS\", \"hdfs://NYSJHL101-142.opi.com:8020\"); \n\t\tjob.getConfiguration().set(\"hadoop.job.user\", \"hdfs\"); \t\t \n\t\tjob.getConfiguration().set(\"mapred.job.tracker\", \"NYSJHL101-144.opi.com:8021\");\n\t\tjob.getConfiguration().set(\"trainpath\", args[0]);\n\t\tFileInputFormat.addInputPath(job, new Path(args[1]));\n\t\tFileOutputFormat.setOutputPath(job, new Path(args[2]));\n\t\tFileSystem hdfs = FileSystem.get(job.getConfiguration());\n\t\t\t\t\n\t\tjob.setMapperClass(DataMapper.class);\n\t\tjob.setReducerClass(DataReducer.class);\n\t\tjob.setCombinerClass(DataCombiner.class);\n\t\tjob.setOutputKeyClass(Text.class);\n\t\tjob.setOutputValueClass(Text.class);\n\t\tjob.setNumReduceTasks(10);\n\t\t\n\t\tSystem.exit(job.waitForCompletion(true) ? 0 : 1);\n\t\t\n\t}", "private void saveLab(boolean usetmp) throws FileNotFoundException{\n //Get path to start.config\n String startConfigPath;\n if(!usetmp){\n startConfigPath = currentLab.getPath()+File.separator+\"config\"+File.separator+\"start.config\";\n }else{\n startConfigPath = currentLab.getPath()+File.separator+\"config\"+File.separator+\"start.config\";\n }\n PrintWriter writer = new PrintWriter(startConfigPath);\n String startConfigText = \"\"; \n \n // Write Global Params\n for(String line : labDataCurrent.getGlobals()){\n startConfigText += line+\"\\n\";\n }\n\n // Cycle through network objects and write\n Component[] networks = NetworkPanePanel.getComponents();\n for(Component network : networks){\n NetworkData data = ((NetworkObjPanel)network).getConfigData();\n startConfigText += \"NETWORK \"+data.name+\"\\n\";\n startConfigText += \" MASK \"+data.mask+\"\\n\";\n startConfigText += \" GATEWAY \"+data.gateway+\"\\n\";\n \n if(data.macvlan > 0){\n startConfigText += \" MACVLAN \"+data.macvlan+\"\\n\";\n }\n if(data.macvlan_ext > 0){\n startConfigText += \" MACVLAN_EXT\" +data.macvlan_ext+\"\\n\";\n }\n \n if(!data.ip_range.isEmpty()){\n startConfigText += \" IP_RANGE \"+data.ip_range+\"\\n\";\n } \n\n if(data.tap){\n startConfigText += \" TAP YES\"+\"\\n\";\n }\n for(String unknownParam : data.unknownNetworkParams){\n startConfigText += \" \"+unknownParam+\"\\n\";\n }\n }\n \n // Cycle through container objects and write \n Component[] containers = ContainerPanePanel.getComponents();\n for(Component container : containers){\n ContainerData data = ((ContainerObjPanel)container).getConfigData(); \n startConfigText += \"CONTAINER \"+data.name+\"\\n\";\n startConfigText += \" USER \"+data.user+\"\\n\";\n if(data.script.isEmpty()){\n startConfigText += \" SCRIPT NONE\\n\";\n }\n else{\n startConfigText += \" SCRIPT \"+data.script+\"\\n\"; \n }\n \n if(data.x11){\n startConfigText += \" X11 YES\\n\"; \n }\n else{\n startConfigText += \" X11 NO\\n\";\n }\n // Not default\n if(data.terminal_count != 1)\n startConfigText += \" TERMINALS \"+data.terminal_count+\"\\n\";\n if(!data.terminal_group.isEmpty())\n startConfigText += \" TERMINAL_GROUP \"+data.terminal_group+\"\\n\";\n if(!data.xterm_title.isEmpty())\n startConfigText += \" XTERM \"+data.xterm_title+\" \"+data.xterm_script+\"\\n\";\n if(!data.password.isEmpty())\n startConfigText += \" PASSWORD \"+data.password+\"\\n\";\n for(LabData.ContainerAddHostSubData addHost : data.listOfContainerAddHost){\n if(addHost.type.equals(\"network\"))\n startConfigText += \" ADD-HOST \"+addHost.add_host_network+\"\\n\";\n else if(addHost.type.equals(\"ip\"))\n startConfigText += \" ADD-HOST \"+addHost.add_host_host+\":\"+addHost.add_host_ip+\"\\n\"; \n }\n for(LabData.ContainerNetworkSubData network : data.listOfContainerNetworks){\n startConfigText += \" \"+network.network_name+\" \"+network.network_ipaddress+\"\\n\"; \n }\n if(data.clone > 0){\n startConfigText += \" CLONE \"+data.clone+\"\\n\";\n }\n if(!data.lab_gateway.isEmpty()){\n startConfigText += \" LAB_GATEWAY \"+data.lab_gateway+\"\\n\";\n }\n if(data.no_gw){\n startConfigText += \" NO_GW YES\\n\";\n }\n if(!data.base_registry.isEmpty()){\n startConfigText += \" BASE_REGISTRY \"+data.base_registry+\"\\n\";\n }\n if(!data.thumb_volume.isEmpty()){\n startConfigText += \" THUMB_VOLUME \"+data.thumb_volume+\"\\n\";\n }\n if(!data.thumb_command.isEmpty()){\n startConfigText += \" THUMB_COMMAND \"+data.thumb_command+\"\\n\";\n }\n if(!data.thumb_stop.isEmpty()){\n startConfigText += \" THUMB_STOP \"+data.thumb_stop+\"\\n\";\n }\n if(!data.publish.isEmpty()){\n startConfigText += \" PUBLISH \"+data.publish+\"\\n\";\n }\n if(data.hide){\n startConfigText += \" HIDE YES\\n\";\n }\n if(data.no_privilege){\n startConfigText += \" NO_PRIVILEGE YES\\n\";\n }\n if(data.no_pull){\n startConfigText += \" NO_PULL YES\\n\";\n }\n if(data.mystuff){\n startConfigText += \" MYSTUFF YES\\n\";\n }\n if(data.tap){\n startConfigText += \" TAP YES\\n\";\n }\n if(!data.mount1.isEmpty() && !data.mount2.isEmpty()){\n startConfigText += \" MOUNT \"+data.mount1+\":\"+data.mount2+\"\\n\";\n }\n \n }\n \n //Write to File\n writer.print(startConfigText);\n writer.close();\n \n //Save results.config and goals.config file\n labDataCurrent.getResultsData().writeResultsConfig(usetmp);\n labDataCurrent.getGoalsData().writeGoalsConfig(usetmp);\n labDataCurrent.getParamsData().writeParamsConfig(usetmp);\n \n System.out.println(\"Lab Saved\");\n }", "public void testStep() {\n\n DT_TractographyImage crossing = Images.getCrossing();\n\n FACT_FibreTracker tracker = new FACT_FibreTracker(crossing);\n\n Vector3D[] pds = crossing.getPDs(1,1,1);\n\n Vector3D step = tracker.getFirstStep(new Point3D(1.5 * Images.xVoxelDim, 1.2 * Images.yVoxelDim, 1.1 * Images.zVoxelDim), 0, true);\n\n assertEquals(1.0, pds[0].dot(step.normalized()), 1E-8);\n\n assertEquals(Images.xVoxelDim / 2.0, step.mod(), 0.05);\n \n step = tracker.getFirstStep(new Point3D(1.5 * Images.xVoxelDim, 1.2 * Images.yVoxelDim, 1.1 * Images.zVoxelDim), 0, false);\n\n assertEquals(-1.0, pds[0].dot(step.normalized()), 1E-8);\n\n step = tracker.getFirstStep(new Point3D(1.5 * Images.xVoxelDim, 1.2 * Images.yVoxelDim, 1.1 * Images.zVoxelDim), 1, true);\n\n assertEquals(1.0, pds[1].dot(step.normalized()), 1E-8);\n\n\n for (int i = 0; i < 2; i++) {\n\n step = tracker.getNextStep(new Point3D(1.5 * Images.xVoxelDim, 1.2 * Images.yVoxelDim, 1.1 * Images.zVoxelDim), new Vector3D(pds[i].x + 0.01, pds[i].y + 0.02, pds[i].z + 0.03).normalized());\n\n assertEquals(1.0, pds[i].dot(step.normalized()), 1E-8);\n\n }\n\n \n }", "void passivateFlowStorer();", "public synchronized long getCheckpoint() {\n return globalCheckpoint;\n }", "@Test(timeout = 4000)\n public void test093() throws Throwable {\n TextDirectoryLoader textDirectoryLoader0 = new TextDirectoryLoader();\n Instances instances0 = textDirectoryLoader0.getDataSet();\n Evaluation evaluation0 = new Evaluation(instances0);\n Object[] objectArray0 = new Object[2];\n evaluation0.evaluateModel((Classifier) null, instances0, objectArray0);\n assertEquals(0.0, evaluation0.SFEntropyGain(), 0.01);\n }", "public static void main(String[] args) {\n\t\tLab3 test = new Lab3();\n\t\t\n\t\tSystem.out.println(\"\\nTest Case (0, 7, 4) to (2, 7, 2):\");\n\t\ttest.pouring(0, 7, 4, 2, 7, 2);\n\t\ttest.backTrack(0, 7, 4, 2, 7, 2);\n\t\ttest = new Lab3();\n\t\t\n\t\tSystem.out.println(\"\\nTest Case (10, 0, 4) to (2, 7, 2):\");\n\t\ttest.pouring(10, 0, 4, 2, 7, 2);\n\t\ttest.backTrack(10, 0, 4, 2, 7, 2);\n\t\ttest = new Lab3();\n\t\t\n\t\tSystem.out.println(\"\\nTest Case (8, 6, 3) to (7, 6, 4):\");\n\t\ttest.pouring(8, 6, 3, 7, 6, 4);\n\t\ttest.backTrack(8, 6, 3, 7, 6, 4);\n\t\ttest = new Lab3();\n\t\t\n\t\tSystem.out.println(\"\\nTest Case (1, 7, 4) to (3, 6, 2):\");\n\t\ttest.pouring(1, 7, 4, 3, 6, 2);\n\t\ttest.backTrack(1, 7, 4, 3, 6, 2);\n\t\ttest = new Lab3();\n\t\t\n\t\tSystem.out.println(\"\\nTest Case (2, 7, 4) to (3, 6, 2):\");\n\t\ttest.pouring(2, 7, 4, 3, 6, 2);\n\t\ttest.backTrack(2, 7, 4, 3, 6, 2);\n\t\ttest = new Lab3();\n\t\t\n\t\tSystem.out.println(\"\\nTest Case (6, 3, 3) to (3, 6, 3):\");\n\t\ttest.pouring(6, 3, 3, 3, 6, 3);\n\t\ttest.backTrack(6, 3, 3, 3, 6, 3);\n\t}", "private void writeCheckpoint(String filename) {\n File file = new File(checkpointDir, filename);\n try {\n geneticProgram.savePopulation(new FileOutputStream(file));\n } catch (FileNotFoundException e) {\n log.log(Level.WARNING, \"Exception in dump\", e);\n }\n }", "public static void main(String[] args) {\n\n\t\tlong startTime = System.currentTimeMillis();\n\n\t\t//NaiveBayesParam nb = new NaiveBayesParam(\"data/split1.arff\",\"data/split1_test.arff\");\n\t\t//NaiveBayesParam nb = new NaiveBayesParam(\"/media/F/Acads/iitb/mtp/naivebayesdataset/bronchiolitis/br-processed.arff\",\"\" +\n\t\t//\t\t\"/media/F/Acads/iitb/mtp/naivebayesdataset/bronchiolitis/br-processed.arff\");\n\t\t//NaiveBayesParam nb = new NaiveBayesParam(\"/media/F/Acads/iitb/mtp/naivebayesdataset/01/sylva_agnostic_valid.arff\",\"\" +\n\t\t//\t\t\"/media/F/Acads/iitb/mtp/naivebayesdataset/01/sylva_agnostic_valid.arff\");\n\n\t\t// NaiveBayesParam nb = new NaiveBayesParam(\"data/split1lac.arff\",\n\t\t// \"data/split1lacTest.arff\");\n\t\t//NaiveBayesParam nb = new NaiveBayesParam(\"data/split1b.arff\", \"data/split1bTest.arff\");\n\t\t// NaiveBayesParam nb = new NaiveBayesPFaram(\"data/split1lac.arff\",\n\t\t// \"data/split1bTest.arff\");\n\t\t//NaiveBayesParam nb = new NaiveBayesParam(\"data/split1lac.arff\",\"data/split1hTest.arff\");\n\t\t\n\t\t\n\t\tNaiveBayesParam nb = new NaiveBayesParam(\"/media/F/Acads/iitb/mtp/QuickHeal/data/split1per1.arff\", \"/media/F/Acads/iitb/mtp/QuickHeal/data/split1.arff\");\n\t\t\t\t\n\t\tInputData initialData = nb.calcInitialState();\n\t\ttry {\n\t\t\tinitialData.serialize(\"/home/agam/nb.dat\");\n\t\t} catch (IOException e1) {\n\t\t\t// TODO Auto-generated catch block\n\t\t\te1.printStackTrace();\n\t\t}\n\t\t/*nb.calcNewState(nb.param);\n\n\n\t\ttry {\n\t\t\tdouble dist1[][] = nb.distributionForInstances(nb.trainInstances);\n\t\t\tdouble dist2[][] = nb.distributionForInstances(nb.testInstances);\n\t\t\t\n\t\t\tint countFN=0;\n\t\t\tint countFP=0;\n\t\t\tSystem.out.println(\"1.# prob0 - prob1 - actual - pred\");\n\t\t\tfor (int i = 0; i < nb.trainInstances.numInstances(); i++)\n\t\t\t{\n\t\t\t\tdouble pred;\n\t\t\t\tdouble actual = nb.trainInstances.instance(i).classValue();\n\t\t\t\t//System.out.print(\"actual=\"+actual);\n\t\t\t\tif(dist1[i][0] >= dist1[i][1])\n\t\t\t\t\tpred=0d;\n\t\t\t\telse\n\t\t\t\t\tpred=1d;\n\t\t //if (pred != actual)\n\t\t if (!(pred > actual-0.1d && pred < actual + 0.1d))\n\t\t {\n//\t\t \tif(pred == 1)\n\t\t \tif(pred > 0.9d && pred < 1.1d)\n\t\t \t\tcountFP++;\n\t\t \telse\n\t\t \t\tcountFN++;\n\t\t }\n\t\t\t}\n\t\t\tSystem.out.println(\"countFP=\"+countFP);\n\t\t\tSystem.out.println(\"%FP=\"+countFP*200.0/nb.trainInstances.numInstances());\n\t\t\tSystem.out.println(\"countFN=\"+countFN);\n\t\t\tSystem.out.println(\"%FN=\"+countFN*200.0/nb.trainInstances.numInstances());\n\t\t\t\n\t\t\tcountFN=0;\n\t\t\tcountFP=0;\n\t\t\tSystem.out.println(\"2.# prob0 - prob1 - actual - pred\");\n\t\t\tfor (int i = 0; i < nb.testInstances.numInstances(); i++)\n\t\t\t{\n\t\t\t\tdouble pred;\n\t\t\t\tdouble actual = nb.testInstances.instance(i).classValue();\n\t\t\t\tif(dist2[i][0] >= dist2[i][1])\n\t\t\t\t\tpred=0d;\n\t\t\t\telse\n\t\t\t\t\tpred=1d;\n//\t\t if (pred != actual)\n\t\t if (!(pred > actual-0.1d && pred < actual + 0.1d))\n\t\t {\n\t\t \tif(pred > 0.9d && pred < 1.1d)\n//\t\t \tif(pred == 1)\n\t\t \t\tcountFP++;\n\t\t \telse\n\t\t \t\tcountFN++;\n\t\t }\n\t\t System.out.println(\"2.#\"+dist2[i][0]+\" \"+dist2[i][1]+\" \" +actual+\" \"+pred);\n\t\t\t}\n\t\t\tSystem.out.println(\"countFP=\"+countFP);\n\t\t\tSystem.out.println(\"%FP=\"+countFP*100.0/nb.testInstances.numInstances());\n\t\t\tSystem.out.println(\"countFN=\"+countFN);\n\t\t\tSystem.out.println(\"%FN=\"+countFN*100.0/nb.testInstances.numInstances());\n\t\t} catch (Exception e) {\n\t\t\t// TODO Auto-generated catch block\n\t\t\te.printStackTrace();\n\t\t}\n*/\n/*\t\t\n\t\tdouble jac[][]=nb.calcJacobian(nb.trainInstances.instance(0));\n\n\t\tfor(int i=0;i<nb.trainInstances.numClasses();i++)\n\t\t{\n\t\t\tfor(int j=0;j<4*nb.trainInstances.numAttributes()-4+nb.trainInstances.numClasses();j++)\n\t\t\t{\n\t\t\t\tSystem.out.println(\"jac[\"+i+\"]=[\"+j+\"]=\"+jac[i][j]);\n\t\t\t}\n\t\t}\n*/\t\t\n\t\tlong endTime = System.currentTimeMillis();\n\t\tlong totalTime = endTime - startTime;\n\t\tSystem.out.println(totalTime + \" milliseconds\");\n\t}", "@Test\n public void testRun() {\n System.out.println(\"run\");\n FluorescenceImporter importer = null;\n try {\n FluorescenceFixture tf = new FluorescenceFixture();\n importer = new FluorescenceImporter(tf.testData());\n ProgressHandle ph = ProgressHandleFactory.createHandle(\"Importing dataset\");\n importer.setProgressHandle(ph);\n \n importer.run();\n } catch (IOException ex) {\n Exceptions.printStackTrace(ex);\n }\n \n //FluorescenceDataset dataset = importer.getDataset();\n Dataset<? extends Instance> plate = importer.getDataset();\n System.out.println(\"inst A1 \"+ plate.instance(0).toString());\n System.out.println(\"plate \"+plate.toString());\n Dataset<Instance> output = new SampleDataset<Instance>();\n output.setParent((Dataset<Instance>) plate);\n ProgressHandle ph = ProgressHandleFactory.createHandle(\"Analyzing dataset\");\n // AnalyzeRunner instance = new AnalyzeRunner((Timeseries<ContinuousInstance>) plate, output, ph);\n // instance.run();\n \n }", "@Test\n public void persistedCorfuTableCheckpointTest() {\n String path = PARAMETERS.TEST_TEMP_DIR;\n\n CorfuRuntime rt = getDefaultRuntime();\n\n final UUID tableId = UUID.randomUUID();\n final PersistenceOptionsBuilder persistenceOptions = PersistenceOptions.builder()\n .dataPath(Paths.get(path + tableId + \"writer\"));\n final int numKeys = 303;\n\n try (PersistedCorfuTable<String, String> table = rt.getObjectsView()\n .build()\n .setTypeToken(PersistedCorfuTable.<String, String>getTypeToken())\n .setStreamID(tableId)\n .setSerializer(Serializers.JSON)\n .setArguments(persistenceOptions.build(), Serializers.JSON)\n .open()) {\n\n for (int x = 0; x < numKeys; x++) {\n table.insert(String.valueOf(x), \"payload\" + x);\n }\n assertThat(table.size()).isEqualTo(numKeys);\n\n MultiCheckpointWriter mcw = new MultiCheckpointWriter();\n mcw.addMap(table);\n Token token = mcw.appendCheckpoints(rt, \"Author1\");\n rt.getAddressSpaceView().prefixTrim(token);\n rt.getAddressSpaceView().gc();\n }\n\n CorfuRuntime newRt = getNewRuntime();\n\n persistenceOptions.dataPath(Paths.get(path + tableId + \"reader\"));\n try (PersistedCorfuTable<String, String> table = newRt.getObjectsView().build()\n .setTypeToken(PersistedCorfuTable.<String, String>getTypeToken())\n .setStreamID(tableId)\n .setSerializer(Serializers.JSON)\n .setArguments(persistenceOptions.build(), Serializers.JSON)\n .open()) {\n\n assertThat(Iterators.elementsEqual(table.entryStream().iterator(),\n table.entryStream().iterator())).isTrue();\n assertThat(table.size()).isEqualTo(numKeys);\n\n }\n }", "public static void demo() {\n\t\tlab_2_2_5();\n\n\t}", "private void backupState(BPState curState, FileProcess fileState) {\n\n\t\tprogram.generageCFG(\"/asm/cfg/\" + program.getFileName() + \"_test\");\n\t\tprogram.getResultFileTemp().appendInLine(\n\t\t\t\tprogram.getDetailTechnique() + \" Nodes:\" + program.getBPCFG().getVertexCount() + \" Edges:\"\n\t\t\t\t\t\t+ program.getBPCFG().getEdgeCount() + \" \");\n\t\t//System.out.println();\n\t}", "public static void main(String[] args) throws Exception {\n \t\n \tbyte[] fileData = Files.readAllBytes(Paths.get(new File(System.getProperty(\"user.dir\")+\"/bin/main/re/bytecode/obfuscat/pass/vm/VMRefImpl.class\").toURI()));\n \tDSLParser p = new DSLParser();\n \tMap<String, Function> functions = p.processFile(fileData);\n \tFunction refF = MergedFunction.mergeFunctions(functions, \"process\"); // functions.get(\"process\");\n \t\n \t\n \t\n \tfileData = Files.readAllBytes(Paths.get(new File(System.getProperty(\"user.dir\")+\"/bin/test/re/bytecode/obfuscat/samples/Sample8.class\").toURI()));\n \tp = new DSLParser();\n functions = p.processFile(fileData);\n \n \tFunction f = MergedFunction.mergeFunctions(functions, \"entry\");\n \t\n\t\t//HashMap<String, Object> map = new HashMap<String, Object>();\n\t\t//Function f = Obfuscat.buildFunction(\"Test\", map);\n \t\n \t\n\t\t//HashMap<String, Object> map = new HashMap<String, Object>();\n\t\t//map.put(\"data\", new byte[] { 1, 2, 3, 4 });\n\t\t//Function f = Obfuscat.buildFunction(\"KeyBuilder\", map );\n\t\n \tf = Obfuscat.applyPass(f, \"Flatten\");\n\t\tf = Obfuscat.applyPass(f, \"OperationEncode\");\n\t\t\n\t\tint[] gen = new VMCodeGenerator(new Context(System.currentTimeMillis()), f).generate();\n\n\t\tbyte[] vmcode = new byte[gen.length];\n\t\tStringBuilder sb = new StringBuilder();\n\t\tfor (int i = 0; i < gen.length; i++) {\n\t\t\tsb.append(String.format(\"%02X\", gen[i] & 0xFF));\n\t\t\tvmcode[i] = (byte) gen[i];\n\t\t}\n\n\t\tSystem.out.println(sb.toString());\n\n\t\tSystem.out.println(\"=========================================\");\n\n\t\t\n\t\tSystem.out.println(f.getBlocks().get(0));\n\t\t\n\t\tEmulateFunction eFB = new EmulateFunction(f);\n\t\tbyte[] arr = new byte[] {0, 0, 0, 0};\n\t\tSystem.out.println(\"Emulate Original => \"+eFB.run(-1, arr));\n\t\tSystem.out.println(Arrays.toString(arr));\n\t\t\n\t\tarr = new byte[] {0, 0, 0, 0};\n\t\tSystem.out.println(\"Java Reference => \"+VMRefImpl.process(vmcode, f.getData() ,new Object[]{0, arr}));\n\t\tSystem.out.println(Arrays.toString(arr));\n\n\t\t\n\t\tEmulateFunction eFRef = new EmulateFunction(refF);\n\t\tarr = new byte[] {0, 0, 0, 0};\n\t\tSystem.out.println(\"Emulated Reference => \"+eFRef.run(-1, gen, f.getData(), new Object[] {0, arr}));\n\t\tSystem.out.println(Arrays.toString(arr));\n\t\t\n\t\tEmulateFunction eFPass = new EmulateFunction(Obfuscat.applyPass(f, \"Virtualize\"));\n\t\tarr = new byte[] {0, 0, 0, 0};\n\t\tSystem.out.println(\"Emulate Pass VM => \"+eFPass.run(-1, arr ));\n\t\tSystem.out.println(Arrays.toString(arr));\n\t\t\n\n }", "@Override\n\tpublic void initStateNodes() {\n \tSystem.err.println(Randomizer.getSeed());\n\t\tPartitionedTreeLikelihood likelihood = null;\n\t\tfor (BEASTInterface plugin : getOutputs()) {\n\t\t\tif (plugin instanceof PartitionedTreeLikelihood) {\n\t\t\t\tlikelihood = (PartitionedTreeLikelihood) plugin;\n\t\t\t}\n\t\t}\n\t\tif (likelihood == null) {\n\t\t\tthrow new IllegalArgumentException(\"PartitionProvider must have PartitionedTreeLikelihood as output\");\n\t\t}\n\t\tSiteModel.Base siteModel = (SiteModel.Base) likelihood.siteModelInput.get();\n\t\t\n\t\tif (siteModel instanceof SiteModel) {\n\t\t\tRealParameter mu = ((SiteModel) siteModel).muParameterInput.get();\n\t\t\tif (!mu.isEstimatedInput.get()) {\n\t\t\t\tSystem.err.println(\"Warning: sitemodel mutation rates are NOT estimated. This is probably not what you want\");\n\t\t\t}\n\t\t}\n\t\t\n\t\tString sPartition = BeautiDoc.parsePartition(getID());\n\t\tSet<BEASTInterface> ancestors = new HashSet<BEASTInterface>();\n\t\tBeautiDoc.collectAncestors(this, ancestors, new HashSet<BEASTInterface>());\n\t\tMCMC mcmc = null;\n\t\tfor (BEASTInterface plugin : ancestors) {\n\t\t\tif (plugin instanceof MCMC) {\n\t\t\t\tmcmc = (MCMC) plugin;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t\tm_pSiteModel.get().add(siteModel);\n\t\tList<BEASTInterface> tabuList = new ArrayList<BEASTInterface>();\n\t\ttabuList.add(this);\n\t\tfor (int i = 1; i < numPartitions.get(); i++) {\n\t\t\tBeautiDoc doc = new BeautiDoc();\n\t\t\tPartitionContext oldContext = new PartitionContext(sPartition);\n\t\t\tPartitionContext newContext = new PartitionContext(sPartition+i);\n\t\t\tBEASTInterface plugin = BeautiDoc.deepCopyPlugin(siteModel, this, mcmc, oldContext, newContext, doc, tabuList);\n\t\t\tm_pSiteModel.get().add((SiteModel.Base) plugin);\n\t\t}\n\t\tif (siteModel instanceof SiteModel) {\n\t\t\tRealParameter mu = ((SiteModel) siteModel).muParameterInput.get();\n\t\t\tmu.isEstimatedInput.setValue(false, mu);\n\t\t\tmu.initByName(\"lower\", \"\"+mu.getValue(), \"upper\" , \"\" + mu.getValue());\n\t\t}\n\t\tState state = mcmc.startStateInput.get();\n\t\tstate.initialise();\n state.setPosterior(mcmc.posteriorInput.get());\n\t\tneedsInitilising = false;\n\t\tinitAndValidate();\n\n\t\tSet<BEASTInterface> plugins = new HashSet<BEASTInterface>();\n\t\tfor (BEASTInterface plugin : mcmc.listActiveBEASTObjects()) {\n\t\t\treinitialise(plugin, plugins);\n\t\t}\n//\t\t\n//\t\tfor (Plugin plugin : ancestors) {\n//\t\t\tif (plugin instanceof PartitionedTreeLikelihood) {\n//\t\t\t\t((PartitionedTreeLikelihood) plugin).initAndValidate();\n//\t\t\t\tbreak;\n//\t\t\t}\n//\t\t}\n\t}", "public static void main(String[] args) {\n\t\tUtility utility = new Utility();\n\t\t\n\t\t// build trainingset\n\t\tSystem.out.println(\"Training System....\");\n\t\tArrayList<Student> trainingSet = utility.readStudentfile(\"porto_math_train.csv\");\n\t\tArrayList<Variable> variableSets = Student.getAllVar();\n\n\t\tTree tree = new Tree();\n\t\tNode decisionTree = tree.buildTree2(trainingSet, variableSets);\n\n\t\tutility .printNode(decisionTree);\n\n\t\t// testing DT\n\t\tSystem.out.println(\"\\tTesting System (trainingSet)....\");\n\t\tutility.testTree2(trainingSet, decisionTree);\n\t\t\n\t\tSystem.out.println();\n\t\tSystem.out.println(\"\\tTesting System (testSet)....\");\n\t\tArrayList<Student> testSet = utility.readStudentfile(\"porto_math_test.csv\");\n\t\tutility.testTree2(testSet, decisionTree);\t\t\n\t}", "@Test\n public void test18() throws Throwable {\n TextDirectoryLoader textDirectoryLoader0 = new TextDirectoryLoader();\n Instances instances0 = textDirectoryLoader0.getDataSet();\n Evaluation evaluation0 = new Evaluation(instances0);\n double double0 = evaluation0.KBMeanInformation();\n assertEquals(0.0, evaluation0.SFPriorEntropy(), 0.01D);\n }", "public void test2() {\n //$NON-NLS-1$\n deployBundles(\"test2\");\n IApiBaseline before = getBeforeState();\n IApiBaseline after = getAfterState();\n IApiComponent beforeApiComponent = before.getApiComponent(BUNDLE_NAME);\n //$NON-NLS-1$\n assertNotNull(\"no api component\", beforeApiComponent);\n IApiComponent afterApiComponent = after.getApiComponent(BUNDLE_NAME);\n //$NON-NLS-1$\n assertNotNull(\"no api component\", afterApiComponent);\n IDelta delta = ApiComparator.compare(beforeApiComponent, afterApiComponent, before, after, VisibilityModifiers.ALL_VISIBILITIES, null);\n //$NON-NLS-1$\n assertNotNull(\"No delta\", delta);\n IDelta[] allLeavesDeltas = collectLeaves(delta);\n //$NON-NLS-1$\n assertEquals(\"Wrong size\", 1, allLeavesDeltas.length);\n IDelta child = allLeavesDeltas[0];\n //$NON-NLS-1$\n assertEquals(\"Wrong kind\", IDelta.CHANGED, child.getKind());\n //$NON-NLS-1$\n assertEquals(\"Wrong flag\", IDelta.VALUE, child.getFlags());\n //$NON-NLS-1$\n assertEquals(\"Wrong element type\", IDelta.FIELD_ELEMENT_TYPE, child.getElementType());\n //$NON-NLS-1$\n assertFalse(\"Is compatible\", DeltaProcessor.isCompatible(child));\n }", "@RequiresApi(api = Build.VERSION_CODES.KITKAT)\n public void finalSave1() {\n ArrayList<ArrayList<Tensor<?>>> at = getWeightsPrueba();\n int ctr = 0;\n ArrayList<float[]> diff = new ArrayList<>();\n ArrayList<ArrayList<Tensor<?>>> bt = getWeightsPrueba();\n for (int x = 0; x < 2; x++) { ///vale 2 porque solo w1 y b1\n ArrayList<Tensor<?>> u1 = at.get(x); //para pruebas\n Tensor<?> u = at.get(x).get(0); //variable auxiliar para pruebas\n float[] d = new float[flattenedWeight(bt.get(x).get(0)).length];\n float[] bw = flattenedWeight(bt.get(x).get(0));\n float[] aw = flattenedWeight(at.get(x).get(0));\n\n diff.add(aw);\n\n // float aux = at.get(x).get(0);\n // diff.add(at.get(x).get(0));\n for(int j = 0; j < bw.length; j++)\n {\n d[j] = aw[j] - bw[j];\n }\n diff.add(d);\n }\n Log.i(\"COUNTER: \", String.valueOf(ctr));\n savePrueba1(diff);\n }", "private static void writeFinalRuleBase (boolean printStdOut) throws IllegalArgumentException, IOException{\n \t\n \tFileSystem fs = FileSystem.get(Mediator.getConfiguration());\n \tPath textPath = new Path(Mediator.getHDFSLocation()+Mediator.getLearnerRuleBasePath()+\"_text.txt\");\n BufferedWriter bwText = new BufferedWriter(new OutputStreamWriter(fs.create(textPath,true)));\n FileStatus[] status = fs.listStatus(new Path(Mediator.getHDFSLocation()+Mediator.getLearnerRuleBasePath()+\"_TMP\"));\n \tWriter writer = SequenceFile.createWriter(Mediator.getConfiguration(), \n \t\t\tWriter.file(new Path(Mediator.getHDFSLocation()+Mediator.getLearnerRuleBasePath())), \n \t\t\tWriter.keyClass(ByteArrayWritable.class), Writer.valueClass(FloatWritable.class));\n Reader reader;\n\t\tByteArrayWritable rule = new ByteArrayWritable();\n\t\tFloatWritable ruleWeight = new FloatWritable();\n\t\tint id = 0;\n \n bwText.write(\"\\nRULE BASE:\\n\\n\");\n if (printStdOut)\n \tSystem.out.println(\"\\nRULE BASE:\\n\");\n \t\n \t// Read all sequence files from stage 2\n \tfor (FileStatus fileStatus:status){\n \t\t\n \t\tif (!fileStatus.getPath().getName().contains(\"_SUCCESS\")){\n \t\t\n\t \t\t// Open sequence file\n\t \t\treader = new Reader(Mediator.getConfiguration(), Reader.file(fileStatus.getPath()));\n\t \n\t // Read all rules\n\t while (reader.next(rule, ruleWeight)) {\n\t \t\n\t \t// Write rule in the output sequence file\n\t \twriter.append(rule, ruleWeight);\n\t \t\n\t \tbwText.write(\"Rule (\"+id+\"): IF \");\n\t \tif (printStdOut)\n\t \t\tSystem.out.print(\"Rule (\"+id+\"): IF \");\n\t \t\n\t \t// Write antecedents\n\t \tfor (int i = 0; i < rule.getBytes().length - 2; i++){\n\t \t\t\n\t \t\tbwText.write(Mediator.getVariables()[i].getName()+\" IS \");\n\t \t\tif (printStdOut)\n\t \t\tSystem.out.print(Mediator.getVariables()[i].getName()+\" IS \");\n\t \t\tif (Mediator.getVariables()[i] instanceof NominalVariable){\n\t \t\t\tbwText.write(((NominalVariable)Mediator.getVariables()[i]).getNominalValue(rule.getBytes()[i])+\" AND \");\n\t \t\t\tif (printStdOut)\n\t \t\tSystem.out.print(((NominalVariable)Mediator.getVariables()[i]).getNominalValue(rule.getBytes()[i])+\" AND \");\n\t \t\t}\n\t \t\t\telse {\n\t \t\t\t\tbwText.write(\"L_\"+rule.getBytes()[i]+\" AND \");\n\t \t\t\t\tif (printStdOut)\n\t \t\tSystem.out.print(\"L_\"+rule.getBytes()[i]+\" AND \");\n\t \t\t\t}\n\t \t\t\n\t \t}\n\t \t\n\t \t// Write the last antecedent\n\t \tbwText.write(Mediator.getVariables()[rule.getBytes().length-2].getName()+\" IS \");\n\t \tif (printStdOut)\n\t \t\tSystem.out.print(Mediator.getVariables()[rule.getBytes().length-2].getName()+\" IS \");\n\t \tif (Mediator.getVariables()[rule.getBytes().length-2] instanceof NominalVariable){\n\t \t\tbwText.write(((NominalVariable)Mediator.getVariables()[rule.getBytes().length-2]).getNominalValue(rule.getBytes()[rule.getBytes().length-2]));\n\t \t\tif (printStdOut)\n\t \t\tSystem.out.print(((NominalVariable)Mediator.getVariables()[rule.getBytes().length-2]).getNominalValue(rule.getBytes()[rule.getBytes().length-2]));\n\t \t}\n\t \t\telse {\n\t \t\t\tbwText.write(\"L_\"+rule.getBytes()[rule.getBytes().length-2]);\n\t \t\t\tif (printStdOut)\n\t \t\tSystem.out.print(\"L_\"+rule.getBytes()[rule.getBytes().length-2]);\n\t \t\t}\n\t \t\n\t \t// Write the class and rule weight\n\t \tbwText.write(\" THEN CLASS = \"+Mediator.getClassLabel(rule.getBytes()[rule.getBytes().length-1]));\n\t \tbwText.write(\" WITH RW = \"+ruleWeight.get()+\"\\n\\n\");\n\t \tif (printStdOut){\n\t \t\tSystem.out.print(\" THEN CLASS = \"+Mediator.getClassLabel(rule.getBytes()[rule.getBytes().length-1]));\n\t \t\tSystem.out.print(\" WITH RW = \"+ruleWeight.get()+\"\\n\\n\");\n\t \t}\n\t\n\t \tid++;\n\t \t\n\t }\n\t \n\t reader.close();\n \n \t\t}\n \t\t\n \t}\n \t\n \tbwText.close();\n writer.close();\n \t\n \t// Remove temporary rule base\n \tfs.delete(new Path(Mediator.getHDFSLocation()+Mediator.getLearnerRuleBasePath()+\"_TMP\"),true);\n \t\n }", "public static void main(String[] args)\n {\n System.out.println(\"CompareTD2BU :fileName1 :dirName2 :rootName2 :ext2 :outputNameRoot :gammaMultiplier\");\n// System.out.println(\"CompareTD2BU takes compares a series of vertex communties against a standard community\");\n// System.out.println(\"for the timgraph defined by the\");\n// System.out.println(\"final timgraph arguments (including the input file name and directory).\");\n// System.out.println(\"The first community is given by fileName1 and is the fixed standard against\");\n// System.out.println(\"which all others are compared. The second community is a set formed from\");\n// System.out.println(\"<dirName2><rootName2>*<ext2> so note the dirName2 must end in a slash.\");\n// System.out.println(\"The * is taken to be the values of gamma involved. The last argument\");\n// System.out.println(\"outputNameRoot gives the full directory and name root of the output file.\");\n// \n //First arg chooses first community file\n //String fileName1=\"input/ICtest_psecinputBVNLS.dat\";\n //String fileName1=\"input/ICNS090224npstemppew0020inputELS.dat\";\n //String fileName1=\"input/ICNS090729_psecinputBVNLS.dat\";\n String fileName1=\"input/karateTSEActualVPinputBVNLS.dat\";\n int ano=0;\n if (args.length>ano ) if (timgraph.isOtherArgument(args[ano])) fileName1=args[ano].substring(1);\n System.out.println(\"--- Using reference network \"+fileName1);\n\n\n //String dirName2=\"output/IC/PaperTerm/\";\n String dirName2=\"output/karate/\";\n ano++;\n if (args.length>ano ) if (timgraph.isOtherArgument(args[ano])) dirName2=args[ano].substring(1);\n\n //String rootName2=\"ICNS090729stempt_PapersVCWLG_VP\";\n String rootName2=\"karateTSE_VC_WLG_VP\";\n ano++;\n if (args.length>ano ) if (timgraph.isOtherArgument(args[ano])) rootName2=args[ano].substring(1);\n\n String ext2 = \"output.vcis\";\n ano++;\n if (args.length>ano ) if (timgraph.isOtherArgument(args[ano])) ext2=args[ano].substring(1);\n\n System.out.println(\"--- Comparing against networks \"+dirName2+rootName2+\"(gamma)\"+ext2);\n\n //Third arg is output file name\n String rootName3=\"output/karateTSE_actual_WLG_VP\";\n //String rootName3=\"output/ICNS090729stempt_psec_Papers\";\n ano++;\n if (args.length>ano ) if (timgraph.isOtherArgument(args[ano])) rootName3=args[ano].substring(1);\n System.out.println(\"--- Output to \"+rootName3);\n\n //Third arg is gamma multiplier\n double gammaMultiplier=1.0;\n ano++;\n if (args.length>ano ) if (timgraph.isOtherArgument(args[ano])) gammaMultiplier=Double.parseDouble(args[ano].substring(1));\n System.out.println(\"--- gamma multiplier \"+gammaMultiplier);\n\n\n FindFile ff = new FindFile();\n ff.getFileList(dirName2, rootName2, ext2, true);\n int nf = ff.filelist.length;\n String [] name2Array = new String[nf];\n MutualInformation [] miArray = new MutualInformation[nf];\n double [] gammaArray = new double[nf];\n PrintWriter results = null;\n String outputFile=rootName3+\"_gammaMI.dat\";\n try {results = new PrintWriter(new FileWriter(outputFile));}// eo try\n catch (IOException e){\n System.err.println(\"Problem with output file \"+outputFile+\", \"+e);\n System.exit(1);\n }\n System.out.println(\"--- Opened output file \"+outputFile);\n String sep=\"\\t\";\n results.println(MutualInformation.toStringBasicLabel(sep)+sep+\"gamma\"+sep+MutualInformation.toStringLabel(sep));\n\n for (int f=0; f<nf; f++){\n String fullFileName2=dirName2+ff.filelist[f];\n System.out.println(\"--- Using network two \"+fullFileName2);\n int c0= fullFileName2.lastIndexOf(rootName2)+rootName2.length();\n int c1= fullFileName2.lastIndexOf(ext2);\n String gammaString=fullFileName2.substring(c0, c1);\n double gamma=Double.parseDouble(gammaString)*gammaMultiplier;\n System.out.println(\"--- gamma = \"+gamma);\n \n MutualInformation mi = CompareVertexCommunities.doComparision(fileName1,fullFileName2);\n results.println(mi.toStringBasic(sep)+sep+gamma+sep+mi.toString(sep));\n results.flush();\n miArray[f]= new MutualInformation(mi,false,false);\n name2Array[f]=ff.filelist[f];\n gammaArray[f]=gamma;\n } // eo for\n results.close();\n System.out.println(\"--- Closed output file \"+outputFile);\n }", "@Test\n public void test23() throws Throwable {\n TextDirectoryLoader textDirectoryLoader0 = new TextDirectoryLoader();\n Instances instances0 = textDirectoryLoader0.getDataSet();\n Evaluation evaluation0 = new Evaluation(instances0);\n SerializedClassifier serializedClassifier0 = new SerializedClassifier();\n Object[] objectArray0 = new Object[25];\n double[] doubleArray0 = evaluation0.evaluateModel((Classifier) serializedClassifier0, instances0, objectArray0);\n assertEquals(0.0, evaluation0.SFEntropyGain(), 0.01D);\n }", "@Test\n public void test28() throws Throwable {\n TextDirectoryLoader textDirectoryLoader0 = new TextDirectoryLoader();\n Instances instances0 = textDirectoryLoader0.getDataSet();\n CostSensitiveClassifier costSensitiveClassifier0 = new CostSensitiveClassifier();\n CostMatrix costMatrix0 = costSensitiveClassifier0.getCostMatrix();\n Evaluation evaluation0 = null;\n try {\n evaluation0 = new Evaluation(instances0, costMatrix0);\n fail(\"Expecting exception: Exception\");\n \n } catch(Exception e) {\n //\n // Cost matrix not compatible with data!\n //\n }\n }", "@Test(timeout = 4000)\n public void test020() throws Throwable {\n TextDirectoryLoader textDirectoryLoader0 = new TextDirectoryLoader();\n Instances instances0 = textDirectoryLoader0.getDataSet();\n Evaluation evaluation0 = new Evaluation(instances0);\n String string0 = evaluation0.toSummaryString(\".arff\", true);\n assertEquals(0.0, evaluation0.unclassified(), 0.01);\n assertEquals(\".arff\\nTotal Number of Instances 0 \\n\", string0);\n assertEquals(0.0, evaluation0.SFEntropyGain(), 0.01);\n }", "public TestPrelab2()\n {\n }", "public static void main(String[] args) throws Exception {\n final int numRows = 28;\n final int numColumns = 28;\n int outputNum = 10; // number of output classes\n int batchSize = 128; // batch size for each epoch\n int rngSeed = 123; // random number seed for reproducibility\n int numEpochs = 15; // number of epochs to perform\n String modelPath = \"モデルパスを入力\";\n\n //Get the DataSetIterators:\n DataSetIterator mnistTrain = new MnistDataSetIterator(batchSize, true, rngSeed);\n DataSetIterator mnistTest = new MnistDataSetIterator(batchSize, false, rngSeed);\n\n\n System.out.println(\"Build model....\");\n MultiLayerConfiguration conf = new NeuralNetConfiguration.Builder()\n .seed(rngSeed) //include a random seed for reproducibility\n // use stochastic gradient descent as an optimization algorithm\n .updater(new Nesterovs(0.006, 0.9))\n .l2(1e-4)\n .list()\n .layer(new DenseLayer.Builder() //create the first, input layer with xavier initialization\n .nIn(numRows * numColumns)\n .nOut(1000)\n .activation(Activation.RELU)\n .weightInit(WeightInit.XAVIER)\n .build())\n .layer(new OutputLayer.Builder(LossFunctions.LossFunction.NEGATIVELOGLIKELIHOOD) //create hidden layer\n .nIn(1000)\n .nOut(outputNum)\n .activation(Activation.SOFTMAX)\n .weightInit(WeightInit.XAVIER)\n .build())\n .build();\n\n\n MultiLayerNetwork model = new MultiLayerNetwork(conf);\n model.init();\n //print the score with every 1 iteration\n UIServer uiServer = UIServer.getInstance();\n InMemoryStatsStorage statsStorage = new InMemoryStatsStorage();\n uiServer.attach(statsStorage);\n model.setListeners(new StatsListener(statsStorage),new ScoreIterationListener(1));\n\n System.out.println(\"Train model....\");\n model.fit(mnistTrain, numEpochs);\n\n\n\n\n System.out.println(\"Evaluate model....\");\n Evaluation eval = model.evaluate(mnistTest);\n System.out.println(eval.stats());\n ModelSerializer.writeModel(model, new File(modelPath), false);\n System.out.println(\"****************Example finished********************\");\n\n }", "public void flushCheckpoint(long checkpoint)\r\n/* 124: */ {\r\n/* 125:155 */ this.checkpoint = checkpoint;\r\n/* 126: */ }", "public void testNBChunkLearnng() throws IOException, GateException {\n // Initialisation\n System.out.print(\"Testing the Naive Bayes method on chunk learning...\");\n File chunklearningHome = new File(new File(learningHome, \"test\"),\n \"chunklearning\");\n String configFileURL = new File(chunklearningHome,\n \"engines-naivebayesweka.xml\").getAbsolutePath();\n String corpusDirName = new File(chunklearningHome, \"data-ontonews\")\n .getAbsolutePath();\n //Remove the label list file, feature list file and chunk length files.\n String wdResults = new File(chunklearningHome,\n ConstantParameters.SUBDIRFORRESULTS).getAbsolutePath();\n emptySavedFiles(wdResults);\n String inputASN = \"Key\";\n loadSettings(configFileURL, corpusDirName, inputASN, inputASN);\n // Set the evaluation mode\n RunMode runM=RunMode.EVALUATION;\n learningApi.setLearningMode(runM);\n controller.execute();\n // Using the evaluation mode for testing\n EvaluationBasedOnDocs evaluation = learningApi.getEvaluation();\n // Compare the overall results with the correct numbers\n /*assertEquals(evaluation.macroMeasuresOfResults.correct, 3);\n assertEquals(evaluation.macroMeasuresOfResults.partialCor, 1);\n assertEquals(evaluation.macroMeasuresOfResults.spurious, 19);\n assertEquals(evaluation.macroMeasuresOfResults.missing, 68);*/\n assertEquals(\"Wrong value for correct: \", 27, (int)Math.floor(evaluation.macroMeasuresOfResults.correct));\n assertEquals(\"Wrong value for partial: \", 3, (int)Math.floor(evaluation.macroMeasuresOfResults.partialCor));\n assertEquals(\"Wrong value for spurious: \", 26, (int)Math.floor(evaluation.macroMeasuresOfResults.spurious));\n assertEquals(\"Wrong value for missing: \", 42, (int)Math.floor(evaluation.macroMeasuresOfResults.missing));\n // Remove the resources\n clearOneTest();\n System.out.println(\"completed\");\n }", "public void test3() {\n //$NON-NLS-1$\n deployBundles(\"test3\");\n IApiBaseline before = getBeforeState();\n IApiBaseline after = getAfterState();\n IApiComponent beforeApiComponent = before.getApiComponent(BUNDLE_NAME);\n //$NON-NLS-1$\n assertNotNull(\"no api component\", beforeApiComponent);\n IApiComponent afterApiComponent = after.getApiComponent(BUNDLE_NAME);\n //$NON-NLS-1$\n assertNotNull(\"no api component\", afterApiComponent);\n IDelta delta = ApiComparator.compare(beforeApiComponent, afterApiComponent, before, after, VisibilityModifiers.ALL_VISIBILITIES, null);\n //$NON-NLS-1$\n assertNotNull(\"No delta\", delta);\n IDelta[] allLeavesDeltas = collectLeaves(delta);\n //$NON-NLS-1$\n assertEquals(\"Wrong size\", 1, allLeavesDeltas.length);\n IDelta child = allLeavesDeltas[0];\n //$NON-NLS-1$\n assertEquals(\"Wrong kind\", IDelta.CHANGED, child.getKind());\n //$NON-NLS-1$\n assertTrue(\"Is visible\", !Util.isVisible(child.getNewModifiers()));\n //$NON-NLS-1$\n assertEquals(\"Wrong flag\", IDelta.TYPE, child.getFlags());\n //$NON-NLS-1$\n assertEquals(\"Wrong element type\", IDelta.FIELD_ELEMENT_TYPE, child.getElementType());\n //$NON-NLS-1$\n assertTrue(\"Not compatible\", DeltaProcessor.isCompatible(child));\n }", "public SModel createBlankCheckpointModel(SModelReference originalModel, @Nullable CheckpointIdentity previousCheckpoint, CheckpointIdentity step) {\n final SModelName transientModelName = createCheckpointModelName(originalModel, step);\n // I'd like to have stable model id to minimize number of changes in CP models\n int mid = originalModel.getModelId().hashCode() ^ step.getName().hashCode();\n // make sure value fits into MPS reserved range, see IntegerSModelId doc.\n mid &= 0x0FFFFFFF;\n mid |= 0x0F000000;\n final SModelReference mr = PersistenceFacade.getInstance()\n .createModelReference(myModule.getModuleReference(), new IntegerSModelId(mid),\n transientModelName.getValue());\n SModel existing = myModule.getModel(mr.getModelId());\n if (existing != null) {\n // Why it's important to forget existing model? E.g. if a model being generated has been already generated and exposed as checkpoint, and\n // was renamed since. Renamed here means change of model name, e.g. due to rename of a containing language module.\n // Besides, it doesn't hurt to drop old checkpoint in any case.\n // There were few possible ways to address MPS-26174 (rename of a module breaks x-model generation).\n // - listen to changes of original model/module and react (e.g. remove related CP models or clear all CPs altogether).\n // - drop all transients as part of rename module action (likely, most safe)\n // - respect model name when building module id value, above. Leaves duplicated, hard-to-distinguish models among checkpoints.\n // - detect there's already model with same id and forget it (least destructive, keeps other CP models in place).\n myModule.forgetModel(existing, true);\n }\n SModel checkpointModel = myModule.createTransientModel(mr);\n assert checkpointModel instanceof ModelWithAttributes;\n ((ModelWithAttributes) checkpointModel).setAttribute(GENERATION_PLAN, step.getPlan().getName());\n ((ModelWithAttributes) checkpointModel).setAttribute(CHECKPOINT, step.getName());\n if (previousCheckpoint != null) {\n ((ModelWithAttributes) checkpointModel).setAttribute(PREV_GENERATION_PLAN, previousCheckpoint.getPlan().getName());\n ((ModelWithAttributes) checkpointModel).setAttribute(PREV_CHECKPOINT, previousCheckpoint.getName());\n }\n return checkpointModel;\n }", "private static void task3() {\n\n\n System.out.printf(\"\\nTASK 3:\\nSee the 8 puzzles generated by this \" +\n \"task.\\nEach size (5, 7, 9 & 11) has two puzzles each; one \" +\n \"with a positive k value and one with a negative k value.\\n\" +\n \"Each puzzle is provided with a corresponding visualization \" +\n \"of it's solution\\n\");\n int[] puzzleSizes = new int[]{5, 7, 9, 11};\n for (int puzzleSize : puzzleSizes){\n createT3Puzzles(puzzleSize, true);\n createT3Puzzles(puzzleSize, false);\n }\n return;\n }", "public static void main(String[] args) {\n\t\tnew TwoMultiprocessorsMarkovChain(1/20.0, 1/50.0, 1/10.0, 1/20.0).steadyState();\n\t}", "public static void main(String[] args) throws IOException {\n // All but last arg is a file/directory of LDC tagged input data\n File[] files = new File[args.length - 1];\n for (int i = 0; i < files.length; i++)\n files[i] = new File(args[i]);\n\n // Last arg is the TestFrac\n double testFraction = Double.valueOf(args[args.length -1]);\n\n // Get list of sentences from the LDC POS tagged input files\n List<List<String>> sentences = POSTaggedFile.convertToTokenLists(files);\n int numSentences = sentences.size();\n\n // Compute number of test sentences based on TestFrac\n int numTest = (int)Math.round(numSentences * testFraction);\n\n // Take test sentences from end of data\n List<List<String>> testSentences = sentences.subList(numSentences - numTest, numSentences);\n\n // Take training sentences from start of data\n List<List<String>> trainSentences = sentences.subList(0, numSentences - numTest);\n System.out.println(\"# Train Sentences = \" + trainSentences.size() +\n \" (# words = \" + BigramModel.wordCount(trainSentences) +\n \") \\n# Test Sentences = \" + testSentences.size() +\n \" (# words = \" + BigramModel.wordCount(testSentences) + \")\");\n\n // Create a BidirectionalBigramModel model and train it.\n BidirectionalBigramModel model = new BidirectionalBigramModel();\n\n System.out.println(\"Training...\");\n model.train(trainSentences);\n\n // Test on training data using test2\n model.test2(trainSentences);\n\n System.out.println(\"Testing...\");\n // Test on test data using test2\n model.test2(testSentences);\n }", "@Test\n public void test29() throws Throwable {\n TextDirectoryLoader textDirectoryLoader0 = new TextDirectoryLoader();\n Instances instances0 = textDirectoryLoader0.getDataSet();\n Evaluation evaluation0 = new Evaluation(instances0, (CostMatrix) null);\n double double0 = evaluation0.pctCorrect();\n assertEquals(Double.NaN, double0, 0.01D);\n assertEquals(0.0, evaluation0.SFPriorEntropy(), 0.01D);\n }", "@Test\n public void test03() throws Throwable {\n TextDirectoryLoader textDirectoryLoader0 = new TextDirectoryLoader();\n Instances instances0 = textDirectoryLoader0.getDataSet();\n Evaluation evaluation0 = new Evaluation(instances0);\n double[] doubleArray0 = new double[19];\n evaluation0.updateMargins(doubleArray0, 0, 0.0);\n assertEquals(0.0, evaluation0.SFPriorEntropy(), 0.01D);\n }", "protected void init()\r\n\t{\n\t\tif (ConfigManager.getInstance().getIsCrossClassify() && WekaTool.dataStageOn)\r\n\t\t{\r\n\t\t\t//System.out.println(\"in init for data stage\");\r\n\t\t\tsrcDirUrl = ConfigManager.getInstance().getTrainPath();\r\n\t\t\tdestDirUrl = ConfigManager.getInstance().getTrainPath() +\r\n\t\t\t File.separator + \"output\";\r\n\t\t\t//System.out.println(\"srcDirUrl = \" + srcDirUrl);\r\n\t\t\t//System.out.println(\"destDirUrl = \" + destDirUrl);\r\n\t\t}\r\n\t\telse\r\n\t\t{\r\n\t\t\t//System.out.println(\"here, good\");\r\n\t\t\tsrcDirUrl = getSrcDirUrl();\r\n\t\t\tdestDirUrl = getDestDirUrl();\r\n\t\t}\r\n\t\tdatalibSVMUrl = getLibSVMDirUrl();\r\n\t\ttry {\r\n\t\t\tsrcDir = Utils.getDir(srcDirUrl);\r\n\t\t\tdestDir = Utils.getDir(destDirUrl);\r\n\t\t} catch (Exception e)\r\n\t\t{\r\n\t\t}\r\n\t}", "public void train(SieveDocuments trainingInfo) {\r\n\t\t// no training\r\n\t}", "static synchronized void makeNewCheckpoint() {\n HashMap<String, String> newCheckpoint = new HashMap<>(localState);\n checkpoints.put(Thread.currentThread(), newCheckpoint);\n }", "public static void main(String[] args) throws IOException{\n \n int cells = 16;\n MnistManager mm = new MnistManager(Config.MNIST_TRAIN_IMAGES, Config.MNIST_TRAIN_LABELS);\n \n // Grab first image\n mm.setCurrent(1);\n int[][] image = mm.readPixelMatrix();\n BufferedImage bimg = mm.readImage();\n \n ImageHelper.printImage(mm.readImage(), \"llf_test.png\");\n System.out.println(\"The number is: \" + mm.readLabel());\n \n // Make sure the cell size is correct -> 7 pixels\n int cellSize = image.length / (int)Math.sqrt(cells);\n System.out.println(\"The size of the cells are \" + cellSize + \" pixels\");\n \n // Check that the cell iteration is correct\n for(int i = 0; i < image.length; i += cellSize) {\n for(int j = 0; j < image[0].length; j += cellSize) {\n String info = \"Top left X: \"+i+\" Y: \"+j+\" Bottom right X: \"+(i + cellSize)+\" Y: \"+(j + cellSize);\n System.out.println(info);\n double b = slope(i, j, cellSize, image);\n System.out.println(b);\n System.out.println(\"\\n\\n\");\n }\n }\n }", "public static void main(String[] args) \n\t{\n\t\t// Konfiguration\n\t\tTraining training = new Training();\n\t\tint numberOfAttributes = 18;\n\t\tStatisticOutput statisticWriter = new StatisticOutput(\"data/statistics.txt\");\n\t\t\n\t\ttraining.printMessage(\"*** TCR-Predictor: Training ***\");\n\t\t\n\t\ttraining.printMessage(\"Datenbank von Aminosäure-Codierungen wird eingelesen\");\n\t\t// Lies die EncodingDB ein\n\t\tAAEncodingFileReader aa = new AAEncodingFileReader();\n\t\tAAEncodingDatabase db = aa.readAAEncodings(\"data/AAEncodings.txt\");\n\t\ttraining.printMessage(\"Es wurden \" + db.getEncodingDatabase().size() + \" Codierungen einglesen\");\n\t\t\n\t\ttraining.printMessage(\"Trainingsdatensatz wird eingelesen und prozessiert\");\n\t\t// Lies zunächst die gesamten Trainingsdaten ein\n\t\tExampleReader exampleReader = new ExampleReader();\n\t\t\n\t\t// Spalte das Datenset\n\t\tDataSplit dataSplit_positives = new DataSplit(exampleReader.getSequnces(\"data/positive.txt\"), 5);\n\t\tArrayList<ArrayList<String>> complete_list_positiv = dataSplit_positives.getDataSet();\n\t\t\n\t\tDataSplit dataSplit_negatives = new DataSplit(exampleReader.getSequnces(\"data/negative.txt\"), 5);\n\t\tArrayList<ArrayList<String>> complete_list_negativ = dataSplit_negatives.getDataSet();\n\t\t\n\t\t// Lege Listen für die besten Klassifizierer und deren Evaluation an\n\t\tModelCollection modelCollection = new ModelCollection();\n\t\t\n\t\t/*\n\t\t * \n\t\t * Beginne Feature Selection\n\t\t * \n\t\t */\n\t\tArrayList<String> positivesForFeatureSelection = training.concatenateLists(complete_list_positiv);\n\t\tArrayList<String> negativesForFeatureSelection = training.concatenateLists(complete_list_negativ);\n\t\t\n\t\ttraining.printMessage(\"Convertiere Daten ins Weka ARFF Format\");\t\t\n\t\t// Convertiere Daten in Wekas File Format\n\t\tARFFFileGenerator arff = new ARFFFileGenerator();\n\t\tInstances dataSet = arff.createARFFFile(positivesForFeatureSelection, negativesForFeatureSelection, db.getEncodingDatabase());\n\t\tdataSet.setClass(dataSet.attribute(\"activator\"));\t\t\t// Lege das nominale Attribut fest, wonach klassifiziert wird\n\t\tdataSet.deleteStringAttributes(); \t\t\t\t\t\t\t// Entferne String-Attribute\n\t\t\n\t\ttraining.printMessage(\"Führe Feature Selection (Filtering) aus\");\n\t\t// Beginne Feature Selection\n\t\tFeatureFilter featureFilter = new FeatureFilter();\n\t\tfeatureFilter.rankFeatures(dataSet, numberOfAttributes);\t\t\t\t\t// Wähle die x wichtigsten Features aus\n\t\tdataSet = featureFilter.getProcessedInstances();\n\t\ttraining.printMessage(\"Ausgewählte Features: \" + featureFilter.getTopResults());\n\n\t\t/*\n\t\t * Führe die äußere Evaluierung fünfmal durch und wähle das beste Modell\n\t\t */\n\t\tfor (int outer_run = 0; outer_run < 5; outer_run++)\n\t\t{\n\t\t\tstatisticWriter.writeString(\"===== Äußere Evaluation \" + (outer_run + 1) + \"/5 =====\\n\\n\");\n\t\t\t\n\t\t\t\n\t\t\tArrayList<ArrayList<String>> list_positives = new ArrayList<ArrayList<String>>();\n\t\t\tlist_positives.addAll(complete_list_positiv);\n\t\t\t\n\t\t\tArrayList<ArrayList<String>> list_negatives = new ArrayList<ArrayList<String>>();\n\t\t\tlist_negatives.addAll(complete_list_negativ);\n\t\t\t\n\t\t\t// Lege das erste Fragment beider Listen für nasted-Crossvalidation beiseite\n\t\t\tArrayList<String> outer_List_pos = new ArrayList<String>();\n\t\t\touter_List_pos.addAll(list_positives.get(outer_run));\n\t\t\tlist_positives.remove(outer_run);\n\t\t\t\n\t\t\tArrayList<String> outer_List_neg = new ArrayList<String>();\n\t\t\touter_List_neg.addAll(list_negatives.get(outer_run));\n\t\t\tlist_negatives.remove(outer_run);\n\t\t\t\n\t\t\t// Füge die verbleibende Liste zu einer Zusammen\n\t\t\tArrayList<String> inner_List_pos = training.concatenateLists(list_positives);\n\t\t\tArrayList<String> inner_List_neg = training.concatenateLists(list_negatives);\n\t\t\t\t\n\n\t\t\t/*\n\t\t\t * \n\t\t\t * Ab hier nur noch Arbeiten mit innerer Liste, die Daten zum Evaluieren bekommt Weka vorerst \n\t\t\t * nicht zu sehen!\n\t\t\t * \n\t\t\t */\n\t\t\ttraining.printMessage(\"Convertiere Daten ins Weka ARFF Format\");\t\t\n\t\t\t// Convertiere Daten in Wekas File Format\n\t\t\tarff = new ARFFFileGenerator();\n\t\t\tdataSet = arff.createARFFFile(inner_List_pos, inner_List_neg, db.getEncodingDatabase());\n\t\t\tdataSet.setClass(dataSet.attribute(\"activator\"));\t\t\t// Lege das nominale Attribut fest, wonach klassifiziert wird\n\t\t\tdataSet.deleteStringAttributes(); \t\t\t\t\t\t\t// Entferne String-Attribute\n\t\t\t\n\t\t\tfeatureFilter.processInstances(featureFilter.getRanking(), dataSet, numberOfAttributes); // Filtere das innere Datenset nach Vorgabe\n\t\t\tdataSet = featureFilter.getProcessedInstances();\n\t\t\t\n\t\t\ttraining.printMessage(\"Beginne Gridsearch\");\n\t\t\t// Gridsearch starten\n\t\n\t\t\t\n\t\t\t\n\t\t\tParameterOptimization optimizer = new ParameterOptimization();\n\t\t\tString logFileName = outer_run + \"_\" + numberOfAttributes;\n\t\t\tGridSearch gridSearch = optimizer.performGridSearch(dataSet, logFileName);\n\t\t\ttraining.printMessage(\"Gefundene Parameter [C, gamma]: \" + gridSearch.getValues()); // liefert unter diesen Settings 1.0 und 0.0\n\n\t\t\tSMO sMO = (SMO)gridSearch.getBestClassifier();\n\t\t\t\t\t\t\t\n\t\t\t/*\n\t\t\t * \n\t\t\t * Evaluationsbeginn \n\t\t\t *\n\t\t\t */\n\t\t\ttraining.printMessage(\"Evaluiere die Performance gegen das äußere Datenset\");\n\t\t\ttraining.printMessage(\"Transcodierung des Evaluationsdatensatzes\");\n\t\t\tarff = new ARFFFileGenerator();\n\t\t\tdataSet = arff.createARFFFile(outer_List_pos, outer_List_neg, db.getEncodingDatabase());\n\t\t\tdataSet.setClass(dataSet.attribute(\"activator\"));\t\t\t// Lege das nominale Attribut fest, wonach klassifiziert wird\n\t\t\tdataSet.deleteStringAttributes(); \t\t\t\t\t\t\t// Entferne String-Attribute\n\t\t\t\n\t\t\t// Führe Feature-Filtering mit den Einstellungen der GridSearch aus\n\t\t\ttraining.printMessage(\"Führe Feature Selection (Filtering) auf GridSearch-Basis aus\");\n\t\t\t// Beginne Feature Selection\n\t\t\tfeatureFilter.processInstances(featureFilter.getRanking(), dataSet, numberOfAttributes);\t // Wähle die x wichtigsten Features aus\n\t\t\tdataSet = featureFilter.getProcessedInstances();\n\t\t\t\n\t\t\t\n\t\t\t\n\t\t\ttraining.printMessage(\"Ermittle Performance\");\n\t\t\tEvaluator eval = new Evaluator();\n\t\t\teval.classifyDataSet(sMO, dataSet);\n\t\t\ttraining.printMessage(eval.printRawData());\n\t\t\t\n\t\t\t/*\n\t\t\t * Füge das Modell und die externe Evaulation zur Sammlung hinzu\n\t\t\t */\t\t\t\n\t\t\tmodelCollection.bestClassifiers.add(sMO);\n\t\t\tmodelCollection.evalsOfBestClassifiers.add(eval);\n\t\t\tmodelCollection.listOfNumberOfAttributes.add(numberOfAttributes);\n\t\t\tmodelCollection.listOfFeatureFilters.add(featureFilter);\n\t\t\t\n\t\t\tstatisticWriter.writeString(\"Verwendete Attribute: \" + featureFilter.getTopResults());\n\t\t\tstatisticWriter.writeString(eval.printRawData());\n\t\t\t\n\t\t}\n\t\tstatisticWriter.close();\n\t\t\n\t\t// Wähle das beste aller Modelle aus\n\t\ttraining.printMessage(\"Ermittle die allgemein besten Einstellungen\");\n\t\tModelSelection modelSelection = new ModelSelection();\n\t\tmodelSelection.calculateBestModel(modelCollection);\n\t\t\n\t\ttraining.printMessage(\"Das beste Model: \");\n\t\ttraining.printMessage(modelSelection.getBestEvaluator().printRawData());\n\t\tSystem.out.println(\"------ SMO ------\");\n\t\tfor (int i = 0; i < modelSelection.getBestClassifier().getOptions().length; i++)\n\t\t{\n\t\t\tSystem.out.print(modelSelection.getBestClassifier().getOptions()[i] + \" \");\n\t\t}\n\t\tSystem.out.println(\"\\n--- Features ---\");\n\t\tSystem.out.println(modelSelection.getBestListOfFeatures().getTopResults());\n\t\t\n\t\t// Schreibe das Modell in eine Datei\n\t\ttraining.printMessage(\"Das beste Modell wird auf Festplatte geschrieben\");\n\t\ttry\n\t\t{\n\t\t\tSerializationHelper.write(\"data/bestPredictor.model\", modelSelection.getBestClassifier());\n\t\t\tSerializationHelper.write(\"data/ranking.filter\", modelSelection.getBestListOfFeatures().getRanking());\n\t\t\tSerializationHelper.write(\"data/components.i\", (modelSelection.getBestListOfFeatures().getProcessedInstances().numAttributes()-1));\n\t\t}\n\t\tcatch (Exception ex)\n\t\t{\n\t\t\tSystem.err.println(\"Fehler beim Schreiben des Modells auf Festplatte: \" + ex);\n\t\t}\n\t}", "public ComputationGraph loadCheckpointCG(Checkpoint checkpoint){\n return loadCheckpointCG(checkpoint.getCheckpointNum());\n }", "@MediumTest\n public void test_1314_3() throws Exception {\n String imagePath = Environment.getExternalStorageDirectory()+\"/LeCoder_Image/if_without_false.png\";\n //Load the file and process it\n activity.loadImageFile(imagePath);\n activity.processImage();\n //Generate the nodes and construct the graph\n activity.generateNodes();\n activity.generateGraph();\n //Print all nodes\n activity.printAllNodes();\n //Check whether the flowchart has no start point\n assertFalse(activity.checkAllNodes());\n }", "@Before\n public void DataSmoothExamples3() {\n\t LinkedList<Episode> eps9 = new LinkedList<Episode>();\n\t\teps9.add(new Episode(\"The One with the Tea Leaves\", 150));\n\t\teps9.add(new Episode(\"The One with Pricess Consuela\", 200));\n\t\teps9.add(new Episode(\"The One with the Bird Mother\", 250));\t\t\n\t\tshows3.add(new Show(\"Friends\", 2100, eps9, false));\n\t\t\n\t\tLinkedList<Episode> eps10 = new LinkedList<Episode>();\n\t\teps10.add(new Episode(\"Java\", 200));\n\t\teps10.add(new Episode(\"Python\", 210));\n\t\teps10.add(new Episode(\"C\", 210));\n\t\teps10.add(new Episode(\"C++\", 200));\n\t\tshows3.add(new Show(\"Programming Languages\", 2000, eps10, false));\n\t\t\n\t\tLinkedList<Episode> eps11 = new LinkedList<Episode>();\n\t\teps11.add(new Episode(\"Leaving Storybrooke\", 180));\n\t\teps11.add(new Episode(\"Homecoming\", 190));\n\t\teps11.add(new Episode(\"Where\", 200));\n\t\tshows3.add(new Show(\"Sisterhood\", 600, eps11, false));\n\n\t showResults3.add(200.0);\n\t showResults3.add(198.333);\n\t showResults3.add(190.0);\n\t}", "public static void main(String[] args) {\n String dataset = args[1];\n if(args[0].equals(\"nb\")) {\n if (args.length > 2) {\n boolean cf = Boolean.parseBoolean(args[2]);\n int ngram = Integer.parseInt(args[3]);\n if(dataset.equals(\"small\"))\n naiveBayes(cf, ngram);\n else {\n indexFileRead_TREC(cf, ngram);\n //testNewNaiveBayes(cf, ngram);\n //naiveBayesClassifier(cf, ngram);\n }\n\n }else {\n if(dataset.equals(\"small\"))\n naiveBayes(false, 0);\n else {\n indexFileRead_TREC(false, 0);\n //testNewNaiveBayes(false, 0);\n //naiveBayesClassifier(false, 0);\n }\n }\n }else if(args[0].equals(\"svm\")) {\n if (args.length > 2) {\n boolean rp = Boolean.parseBoolean(args[2]);\n int size = Integer.parseInt(args[3]);\n svm_test(rp, size);\n } else\n svm_test(false, 0);\n }\n //indexFileRead_LBJ();\n\t}", "@Test(timeout = 4000)\n public void test031() throws Throwable {\n TextDirectoryLoader textDirectoryLoader0 = new TextDirectoryLoader();\n Instances instances0 = textDirectoryLoader0.getStructure();\n Evaluation evaluation0 = new Evaluation(instances0);\n double double0 = evaluation0.numFalseNegatives((-1436));\n assertEquals(0.0, evaluation0.SFPriorEntropy(), 0.01);\n assertEquals(0.0, double0, 0.01);\n }", "@Test\n public void test25() throws Throwable {\n try {\n CostMatrix costMatrix0 = Evaluation.handleCostOption(\" // can classifier handle the data?\\n\", (-1802));\n fail(\"Expecting exception: Exception\");\n \n } catch(Exception e) {\n //\n // Can't open file null.\n //\n }\n }", "public static void main(String args[]) throws Exception {\n\n String sourceFile = args[0]; //source file has supervised SRL tags\n String targetFile = args[1]; //target file has supervised SRL tags\n String alignmentFile = args[2];\n String sourceClusterFilePath = args[3];\n String targetClusterFilePath = args[4];\n String projectionFilters = args[5];\n double sparsityThresholdStart = Double.parseDouble(args[6]);\n double sparsityThresholdEnd = Double.parseDouble(args[6]);\n\n\n Alignment alignment = new Alignment(alignmentFile);\n HashMap<Integer, HashMap<Integer, Integer>> alignmentDic = alignment.getSourceTargetAlignmentDic();\n\n final IndexMap sourceIndexMap = new IndexMap(sourceFile, sourceClusterFilePath);\n final IndexMap targetIndexMap = new IndexMap(targetFile, targetClusterFilePath);\n ArrayList<String> sourceSents = IO.readCoNLLFile(sourceFile);\n ArrayList<String> targetSents = IO.readCoNLLFile(targetFile);\n\n System.out.println(\"Projection started...\");\n DependencyLabelsAnalyser dla = new DependencyLabelsAnalyser();\n for (int senId = 0; senId < sourceSents.size(); senId++) {\n if (senId % 100000 == 0)\n System.out.print(senId);\n else if (senId % 10000 == 0)\n System.out.print(\".\");\n\n Sentence sourceSen = new Sentence(sourceSents.get(senId), sourceIndexMap);\n Sentence targetSen = new Sentence(targetSents.get(senId), targetIndexMap);\n int maxNumOfProjectedLabels = dla.getNumOfProjectedLabels(sourceSen, alignmentDic.get(senId));\n double trainGainPerWord = (double) maxNumOfProjectedLabels/targetSen.getLength();\n\n if (trainGainPerWord >= sparsityThresholdStart && trainGainPerWord< sparsityThresholdEnd) {\n dla.analysSourceTargetDependencyMatch(sourceSen, targetSen, alignmentDic.get(senId),\n sourceIndexMap, targetIndexMap, projectionFilters);\n }\n }\n System.out.print(sourceSents.size() + \"\\n\");\n dla.writeConfusionMatrix(\"confusion_\"+sparsityThresholdStart+\"_\"+sparsityThresholdEnd+\".out\", sourceIndexMap, targetIndexMap);\n }" ]
[ "0.68669885", "0.63208383", "0.58471835", "0.58332914", "0.56282437", "0.55992925", "0.5587145", "0.5566159", "0.5559105", "0.54951495", "0.5393127", "0.536027", "0.5358139", "0.5313797", "0.53026944", "0.52970964", "0.5296752", "0.5284018", "0.5274095", "0.5265534", "0.525062", "0.5247823", "0.5236585", "0.5215226", "0.5211203", "0.5210672", "0.519331", "0.5175439", "0.51655287", "0.5164902", "0.5162015", "0.5155158", "0.51546174", "0.5146625", "0.5144779", "0.5142426", "0.51357853", "0.5135112", "0.5130702", "0.5126439", "0.51248395", "0.51189345", "0.5110457", "0.51024467", "0.50988674", "0.5090132", "0.5081188", "0.5066766", "0.5063588", "0.5054459", "0.50460774", "0.5040721", "0.5039693", "0.50302863", "0.50289994", "0.5026019", "0.5023413", "0.5020831", "0.50077486", "0.49972552", "0.49905506", "0.49878868", "0.49761236", "0.49676907", "0.49624932", "0.49586862", "0.49543616", "0.49523798", "0.49516794", "0.49500027", "0.49497777", "0.49495828", "0.49354994", "0.49321058", "0.49290013", "0.49245927", "0.4924377", "0.49237403", "0.49193147", "0.49180365", "0.49162954", "0.4913917", "0.4909862", "0.49063775", "0.49052218", "0.4896037", "0.4895199", "0.48934013", "0.4885429", "0.48853785", "0.4880866", "0.48801994", "0.48788556", "0.48769012", "0.48706186", "0.48703507", "0.48677456", "0.48651674", "0.48650843", "0.48616058", "0.48613524" ]
0.0
-1
lab 3 checkpoint 3
@Override public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) { cakeModel.hasCandles = isChecked; cakeView.invalidate(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "void checkpoint() throws IOException;", "public void initializeGraphPrueba() {\n //path to checkpoit.ckpt HACER\n //To load the checkpoint, place the checkpoint files in the device and create a Tensor\n //to the path of the checkpoint prefix\n //FALTA ******\n\n // si modelo updated se usa el checkpoints que he descargado del servidor. Si no, el del movil.\n if (isModelUpdated){\n /* //NO VA BIEN:\n checkpointPrefix = Tensors.create((file_descargado).toString());\n Toast.makeText(MainActivity.this, \"Usando el modelo actualizado\", Toast.LENGTH_SHORT).show();\n\n */\n\n //A VER SI VA\n try {\n //Place the .pb file generated before in the assets folder and import it as a byte[] array\n // hay que poner el .meta\n inputCheck = getAssets().open(\"+checkpoints_name_1002-.ckpt.meta\");\n // inputCheck = getAssets().open(\"+checkpoints_name_1002-.ckpt\"); NOT FOUND\n byte[] buffer = new byte[inputCheck.available()];\n int bytesRead;\n ByteArrayOutputStream output = new ByteArrayOutputStream();\n while ((bytesRead = inputCheck.read(buffer)) != -1) {\n output.write(buffer, 0, bytesRead);\n }\n variableAuxCheck = output.toByteArray(); // array con el checkpoint\n } catch (IOException e) {\n e.printStackTrace();\n }\n checkpointPrefix = Tensors.create((variableAuxCheck).toString());\n }\n\n else {\n try {\n //Place the .pb file generated before in the assets folder and import it as a byte[] array\n // hay que poner el .meta\n inputCheck = getAssets().open(\"checkpoint_name1.ckpt.meta\");\n byte[] buffer = new byte[inputCheck.available()];\n int bytesRead;\n ByteArrayOutputStream output = new ByteArrayOutputStream();\n while ((bytesRead = inputCheck.read(buffer)) != -1) {\n output.write(buffer, 0, bytesRead);\n }\n variableAuxCheck = output.toByteArray(); // array con el checkpoint\n } catch (IOException e) {\n e.printStackTrace();\n }\n checkpointPrefix = Tensors.create((variableAuxCheck).toString());\n }\n\n //checkpointPrefix = Tensors.create((getApplicationContext().getExternalFilesDir(Environment.DIRECTORY_DOCUMENTS).getAbsolutePath() + \"final_model.ckpt\").toString()); //PARA USAR EL CHECKPOINT DESCARGADO\n // checkpointDir = getApplicationContext().getExternalFilesDir(Environment.DIRECTORY_DOCUMENTS).getAbsolutePath();\n //Create a variable of class org.tensorflow.Graph:\n graph = new Graph();\n sess = new Session(graph);\n InputStream inputStream;\n try {\n // inputStream = getAssets().open(\"graph.pb\"); //MODELO SENCILLO //PROBAR CON GRAPH_PRUEBA QUE ES MI GRAPH DE O BYTES\n // inputStream = getAssets().open(\"graph5.pb\"); //MODELO SENCILLO\n if (isModelUpdated) { // ESTO ES ALGO TEMPORAL. NO ES BUENO\n inputStream = getAssets().open(\"graph_pesos.pb\");\n }\n else {\n inputStream = getAssets().open(\"graph5.pb\");\n }\n byte[] buffer = new byte[inputStream.available()];\n int bytesRead;\n ByteArrayOutputStream output = new ByteArrayOutputStream();\n while ((bytesRead = inputStream.read(buffer)) != -1) {\n output.write(buffer, 0, bytesRead);\n }\n graphDef = output.toByteArray();\n } catch (IOException e) {\n e.printStackTrace();\n }\n //Place the .pb file generated before in the assets folder and import it as a byte[] array.\n // Let the array's name be graphdef.\n //Now, load the graph from the graphdef:\n graph.importGraphDef(graphDef);\n try {\n //Now, load the checkpoint by running the restore checkpoint op in the graph:\n sess.runner().feed(\"save/Const\", checkpointPrefix).addTarget(\"save/restore_all\").run();\n Toast.makeText(this, \"Checkpoint Found and Loaded!\", Toast.LENGTH_SHORT).show();\n }\n catch (Exception e) {\n //Alternatively, initialize the graph by calling the init op:\n sess.runner().addTarget(\"init\").run();\n Log.i(\"Checkpoint: \", \"Graph Initialized\");\n }\n }", "public static void main(String[] args) {\n\t\tString solutionFile = \"dataset/vlc/task1_solution.en.clusterMle.txt\";\n//\t\tString queryFile = \"dataset/vlc/task1_query.en.f8.n5.txt\";\n//\t\tString targetFile = \"dataset/vlc/task1_target.en.f8.n5.txt\";\n//\t\tString linkFile = \"dataset/vlc/sim_0p_100n.csv\";\n\t\t\n\t\tString malletFile = \"dataset/vlc/folds/all.0.4189.mallet\";\n\t\tString queryFile = \"dataset/vlc/folds/query.0.csv\";\n\t\tString targetFile = \"dataset/vlc/folds/target.0.csv\";\n\t\tString linkFile = \"dataset/vlc/folds/trainingPairs.0.csv\";\n\t\t\n\t\tdouble alpha = 0.01, beta = 0.01, lambda = 0.01;\n\t\t\n\t\tMalletMleCluster clusterMle = new MalletMleCluster(malletFile, linkFile, alpha);\n\t\tTask1Solution solver = new Task1Solution(clusterMle);\n//\t\tfor(alpha = 0.1; alpha<1; alpha += 0.2) {\n//\t\t\tfor(beta = 0.1; beta<1; beta += 0.2) {\n\t\t\t\tfor (lambda = 0.1; lambda<1; lambda += 0.05) {\n\t\t\tclusterMle.setSmoothParameters(alpha, beta, lambda);\n//\t\t\tclusterMle.retrieveTask1Solution(queryFile, solutionFile);\n\t\t\ttry {\n\t\t\t\tsolver.retrieveTask1Solution(queryFile, solutionFile);\n\t\t\t\tdouble precision = Task1Solution.evaluateResult(targetFile, solutionFile);\n\t\t\t\tSystem.out.println(\"alpha: \" + alpha + \"beta: \" + beta + \n\t\t\t\t\t\t\", Lambda: \" + lambda + \", Mle precision: \" + precision);\n\t\t\t} catch (Exception e) {\n\t\t\t\t// TODO Auto-generated catch block\n\t\t\t\te.printStackTrace();\n\t\t\t}\n\t\t\t\t}\n//\t\t\t}\n//\t\t}\n\t}", "protected void checkpoint(S state) {\n checkpoint();\n state(state);\n }", "private static void task3() {\n\n\n System.out.printf(\"\\nTASK 3:\\nSee the 8 puzzles generated by this \" +\n \"task.\\nEach size (5, 7, 9 & 11) has two puzzles each; one \" +\n \"with a positive k value and one with a negative k value.\\n\" +\n \"Each puzzle is provided with a corresponding visualization \" +\n \"of it's solution\\n\");\n int[] puzzleSizes = new int[]{5, 7, 9, 11};\n for (int puzzleSize : puzzleSizes){\n createT3Puzzles(puzzleSize, true);\n createT3Puzzles(puzzleSize, false);\n }\n return;\n }", "void checkpoint(Node node) throws RepositoryException;", "private static void jbptTest2() throws FileNotFoundException, Exception {\n\t\tFile folder = new File(\"models\");\n\t\t\n\t\tFile[] arModels = folder.listFiles(new FileUtil().getFileter(\"pnml\"));\n\t\tfor(File file: arModels)\n\t\t{\n\t\t\t//print the file name\n\t\t\tSystem.out.println(\"========\" + file.getName() + \"========\");\n\n\t\t\t//initialize the counter for conditions and events\n\t\t\tAbstractEvent.count = 0;\n\t\t\tAbstractCondition.count = 0;\n\n\t\t\t//get the file path\n\t\t\tString filePrefix = file.getPath();\n\t\t\tfilePrefix = filePrefix.substring(0, filePrefix.lastIndexOf('.'));\n\t\t\tString filePNG = filePrefix + \".png\";\n\t\t\tString fileCPU = filePrefix + \"-cpu.png\";\n\t\t\tString fileNet = filePrefix + \"-cpu.pnml\";\n\n\t\t\tPnmlImport pnmlImport = new PnmlImport();\n\t\t\tPetriNet p1 = pnmlImport.read(new FileInputStream(file));\n\n\t\t\t// ori\n\t\t\t/*ProvidedObject po1 = new ProvidedObject(\"petrinet\", p1);\n\t\t\t\n\t\t\tDotPngExport dpe1 = new DotPngExport();\n\t\t\tOutputStream image1 = new FileOutputStream(filePNG);\n\t\t\t\n\t\t\tdpe1.export(po1, image1);*/\n\n\t\t\tNetSystem ns = PetriNetConversion.convert(p1);\n\t\t\tProperCompletePrefixUnfolding cpu = new ProperCompletePrefixUnfolding(ns);\n\t\t\tNetSystem netPCPU = PetriNetConversion.convertCPU2NS(cpu);\n\t\t\t// cpu\n\t\t\tPetriNet p2 = PetriNetConversion.convert(netPCPU);\n\t\t\t\n\t\t\tProvidedObject po2 = new ProvidedObject(\"petrinet\", p2);\n\t\t\tDotPngExport dpe2 = new DotPngExport();\n\t\t\tOutputStream image2 = new FileOutputStream(fileCPU);\n\t\t\tdpe2.export(po2, image2);\n//\t\t\t\n\t\t\tExport(p2, fileNet);\n//\t\t\t// net\n//\t\t\tNetSystem nsCPU = PetriNetConversion.convertCPU2NS(cpu);\n//\t\t\tPetriNet pnCPU = PetriNetConversion.convertNS2PN(nsCPU);\n//\t\t\tProvidedObject po3 = new ProvidedObject(\"petrinet\", pnCPU);\n//\t\t\tDotPngExport dpe3 = new DotPngExport();\n//\t\t\tOutputStream image3 = new FileOutputStream(fileNet);\n//\t\t\tdpe3.export(po3, image3);\n\t\t}\n\t\t\tSystem.exit(0);\n\t}", "static void playC45() throws IOException {\n\t\tRealVector[] data = NNDataset.getData(NNDataset.HOME);\n\t\tRealVector[] label = NNDataset.getLabel(NNDataset.HOME);\n\t\tRealMatrix d = MatrixUtils.createRealMatrix(data.length, data[0].getDimension());\n\t\tfor (int i = 0; i < data.length; i++) {\n\t\t\td.setRowVector(i, data[i]);\n\t\t}\n\t\td = d.transpose(); // data = column vector\n\n\t\tRealVector l = MatrixUtils.createRealVector(new double[label.length]);\n\t\tfor (int i = 0; i < l.getDimension(); i++) {\n\t\t\tl.setEntry(i, label[i].getEntry(0));\n\t\t}\n\n\t\tDecisionNode root = training(d, l);\n\t\tString[] header = NNDataset.getHeader(NNDataset.HOME);\n\t\tprintTree(root, header);\n\n\t\tInteger lb = predict(root, data[0]);\n\t\tSystem.out.println(lb);\n\n\t\tdouble ok = MSE(root, data, label);\n\t\tSystem.out.println(\"total hit: \" + ok);\n\t}", "@Test\n public void test30() throws Throwable {\n TextDirectoryLoader textDirectoryLoader0 = new TextDirectoryLoader();\n Instances instances0 = textDirectoryLoader0.getDataSet();\n Evaluation evaluation0 = new Evaluation(instances0);\n boolean boolean0 = evaluation0.getDiscardPredictions();\n assertEquals(0.0, evaluation0.SFPriorEntropy(), 0.01D);\n assertFalse(boolean0);\n }", "public static void main(String[] args) {\n\t\tLab3 test = new Lab3();\n\t\t\n\t\tSystem.out.println(\"\\nTest Case (0, 7, 4) to (2, 7, 2):\");\n\t\ttest.pouring(0, 7, 4, 2, 7, 2);\n\t\ttest.backTrack(0, 7, 4, 2, 7, 2);\n\t\ttest = new Lab3();\n\t\t\n\t\tSystem.out.println(\"\\nTest Case (10, 0, 4) to (2, 7, 2):\");\n\t\ttest.pouring(10, 0, 4, 2, 7, 2);\n\t\ttest.backTrack(10, 0, 4, 2, 7, 2);\n\t\ttest = new Lab3();\n\t\t\n\t\tSystem.out.println(\"\\nTest Case (8, 6, 3) to (7, 6, 4):\");\n\t\ttest.pouring(8, 6, 3, 7, 6, 4);\n\t\ttest.backTrack(8, 6, 3, 7, 6, 4);\n\t\ttest = new Lab3();\n\t\t\n\t\tSystem.out.println(\"\\nTest Case (1, 7, 4) to (3, 6, 2):\");\n\t\ttest.pouring(1, 7, 4, 3, 6, 2);\n\t\ttest.backTrack(1, 7, 4, 3, 6, 2);\n\t\ttest = new Lab3();\n\t\t\n\t\tSystem.out.println(\"\\nTest Case (2, 7, 4) to (3, 6, 2):\");\n\t\ttest.pouring(2, 7, 4, 3, 6, 2);\n\t\ttest.backTrack(2, 7, 4, 3, 6, 2);\n\t\ttest = new Lab3();\n\t\t\n\t\tSystem.out.println(\"\\nTest Case (6, 3, 3) to (3, 6, 3):\");\n\t\ttest.pouring(6, 3, 3, 3, 6, 3);\n\t\ttest.backTrack(6, 3, 3, 3, 6, 3);\n\t}", "public static void main(String[] args) {/\n\t\t// Exercise 1 //\n\t\t////////////////////////////////////////////////////////////////////////////////\n\t\t\n\t\tSystem.out.println(\"Exercise 1\");\n\t\tSystem.out.println(\"-----------\");\n\t\t\n\t\tint[] inputs = {1,0,1,1};\n\t\tint[] outputs = {0,0,1,1};\n\t\tNetwork n = new Network(inputs.length);\n\t\ttrainNet(n, inputs, outputs);\n\t\tint[] result = n.test(inputs, true);\n\t\tSystem.out.println(\"Output neurons after testing: \" + Arrays.toString(result));\n\t\t\n\t\t/////////////////////////////////////////////////////////////////////////////////\n\t\t// Exercise 2 //\n\t\t////////////////////////////////////////////////////////////////////////////////\n\t\t\n\t\tSystem.out.println(\"\\nExercise 2\");\n\t\tSystem.out.println(\"-----------\");\n\t\tint[] modifiedI = {1,0,0,1};\n\t\tSystem.out.println(\"Testing with incomplete input: \" + Arrays.toString(modifiedI));\n\t\tresult = n.test(modifiedI, true);\n\t\tSystem.out.println(\"Output neurons after testing: \" + Arrays.toString(result));\n\t\t\n\t\t/////////////////////////////////////////////////////////////////////////////////\n\t\t// Exercise 3 //\n\t\t////////////////////////////////////////////////////////////////////////////////\n\t\t\n\t\tSystem.out.println(\"\\nExercise 3\");\n\t\tSystem.out.println(\"-----------\");\n\t\tint[] noizyI = {1,1,1,1};\n\t\tSystem.out.println(\"Testing with noizy input: \" + Arrays.toString(noizyI));\n\t\tresult = n.test(noizyI, true);\n\t\tSystem.out.println(\"Output neurons after testing: \" + Arrays.toString(result));\n\t\tSystem.out.println(n);\n\t\t\n\t\t/////////////////////////////////////////////////////////////////////////////////\n\t\t// Exercise 4 //\n\t\t////////////////////////////////////////////////////////////////////////////////\n\t\t\n\t\tSystem.out.println(\"\\nExercise 4\");\n\t\tSystem.out.println(\"-----------\");\n\t\tinputs = new int[] {1,0,1,0,0,1};\n\t\toutputs = new int[] {1,1,0,0,1,1};\n\t\tint[] newIns = {0,1,1,0,0,0};\n\t\tint[] newOuts = {1,1,0,1,0,1};\n\t\tn = new Network(inputs.length);\n\t\ttrainNet(n, inputs, outputs);\n\t\ttrainNet(n, newIns, newOuts);\n\t\tresult = n.test(inputs, true);\n\t\tSystem.out.println(\"load param: \" + n.getLoadParameter());\n\t\tSystem.out.println(\"Output neurons after testing: \" + Arrays.toString(result));\n\t\tint[] newResult = n.test(newIns, true);\n\t\tSystem.out.println(\"Output neurons after testing: \" + Arrays.toString(newResult));\n\t\t\n\t\t/////////////////////////////////////////////////////////////////////////////////\n\t\t// Exercise 5 //\n\t\t////////////////////////////////////////////////////////////////////////////////\n\t\t\n\t\tSystem.out.println(\"\\nExercise 5\");\n\t\tSystem.out.println(\"-----------\");\n\t\tmodifiedI = new int[] {1,0,0,0,0,1};\n\t\tSystem.out.println(\"Testing with incomplete input:\");\n\t\tresult = n.test(modifiedI, true);\n\t\tSystem.out.println(\"Output neurons after testing: \" + Arrays.toString(result));\n\t\tmodifiedI = new int[] {0,1,0,0,0,0};\n\t\tSystem.out.println(\"Testing with noisy input:\");\n\t\tresult = n.test(modifiedI, true);\n\t\tSystem.out.println(\"Output neurons after testing: \" + Arrays.toString(result));\n\t\t\n\t\t/////////////////////////////////////////////////////////////////////////////////\n\t\t// Exercise 6 //\n\t\t////////////////////////////////////////////////////////////////////////////////\n\t\tSystem.out.println(\"\\nExercise 6\");\n\t\tSystem.out.println(\"-----------\");\n\t\tint size = 10, iterations = 500, total = 0, maxCount = 0;\n\t\tdouble loadParameter = 0, maxLoad = 0, synapsesLoad = 0, maxSyn = 0;\n\t\tfor(int j = 0 ; j < iterations ; j++) {\n\t\t\tNetwork net = new Network(size);\n\t\t\tint[][] inPatterns = generateRandomPatterns(size);\n\t\t\tint[][] outPatterns = generateRandomPatterns(size);\n\t\t\tint count = 0;\n\t\t\tfor(int i = 0 ; i < inPatterns.length ; i++) {\n\t\t\t\tnet.train(inPatterns[i], outPatterns[i]);\n\t\t\t\tint[] res = net.test(inPatterns[i], false);\n\t\t\t\tif(Arrays.equals(res, outPatterns[i])) {\n\t\t\t\t\tcount++;\n\t\t\t\t} else {\n\t\t\t\t\t// network has made an error\n\t\t\t\t\tnet.pop();\n\t\t\t\t\tdouble lp = net.getLoadParameter();\n\t\t\t\t\tdouble sl = net.synapsesLoad();\n\t\t\t\t\tloadParameter += lp;\n\t\t\t\t\tsynapsesLoad += sl;\n\t\t\t\t\tif(lp > maxLoad)\n\t\t\t\t\t\tmaxLoad = lp;\n\t\t\t\t\tif(sl > maxSyn)\n\t\t\t\t\t\tmaxSyn = sl;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t\ttotal += count;\n\t\t\tif(count > maxCount)\n\t\t\t\tmaxCount = count;\n\t\t}\n\t\t\n\t\tSystem.out.println(\"Network of size: \" + size);\n\t\tSystem.out.println(\"Network on average trained: \" + total/iterations + \" patterns\");\n\t\tSystem.out.println(\"Network average load param: \" + loadParameter/iterations);\n\t\tSystem.out.println(\"Network average synapses load: \" + synapsesLoad/iterations);\n\t\tSystem.out.println(\"Network max load parameter: \" + maxLoad);\n\t\tSystem.out.println(\"Network max synapses load: \" + maxSyn);\n\t\tSystem.out.println(\"Network max number of trained patterns: \" + maxCount);\n\t}", "public static void test(String[] args) throws Exception {\n\t\tAbstractPILPDelegate.setDebugMode(null);\r\n\t\t\r\n\t\tComputeCostBasedOnFreq ins = new ComputeCostBasedOnFreq();\r\n\t\tins.initPreMapping(\"D:/data4code/replay/pre.csv\");\r\n\t\tins.getEventSeqForEachPatient(\"D:/data4code/cluster/LogBasedOnKmeansPlusPlus-14.csv\");\r\n\t\tins.removeOneLoop();\r\n\r\n\t\tPetrinetGraph net = null;\r\n\t\tMarking initialMarking = null;\r\n\t\tMarking[] finalMarkings = null; // only one marking is used so far\r\n\t\tXLog log = null;\r\n\t\tMap<Transition, Integer> costMOS = null; // movements on system\r\n\t\tMap<XEventClass, Integer> costMOT = null; // movements on trace\r\n\t\tTransEvClassMapping mapping = null;\r\n\r\n\t\tnet = constructNet(\"D:/data4code/mm.pnml\");\r\n\t\tinitialMarking = getInitialMarking(net);\r\n\t\tfinalMarkings = getFinalMarkings(net);\r\n\t\tXParserRegistry temp=XParserRegistry.instance();\r\n\t\ttemp.setCurrentDefault(new XesXmlParser());\r\n\t\tlog = temp.currentDefault().parse(new File(\"D:/data4code/mm.xes\")).get(0);\r\n//\t\tlog = XParserRegistry.instance().currentDefault().parse(new File(\"d:/temp/BPI2013all90.xes.gz\")).get(0);\r\n\t\t//\t\t\tlog = XParserRegistry.instance().currentDefault().parse(new File(\"d:/temp/BPI 730858110.xes.gz\")).get(0);\r\n\t\t//\t\t\tlog = XFactoryRegistry.instance().currentDefault().openLog();\r\n\t\tcostMOS = constructMOSCostFunction(net);\r\n\t\tXEventClass dummyEvClass = new XEventClass(\"DUMMY\", 99999);\r\n\t\tXEventClassifier eventClassifier = XLogInfoImpl.STANDARD_CLASSIFIER;\r\n\t\tcostMOT = constructMOTCostFunction(net, log, eventClassifier, dummyEvClass);\r\n\t\tmapping = constructMapping(net, log, dummyEvClass, eventClassifier);\r\n\r\n\t\tint cost1 = AlignmentTest.computeCost(costMOS, costMOT, initialMarking, finalMarkings, null, net, log,\r\n\t\t\t\tmapping, false);\r\n\t\tSystem.out.println(cost1);\r\n\t\t\r\n//\t\tint iteration = 0;\r\n//\t\twhile (true) {\r\n//\t\t\tSystem.out.println(\"start: \" + iteration);\r\n//\t\t\tlong start = System.currentTimeMillis();\r\n//\t\t\tint cost1 = AlignmentTest.computeCost(costMOS, costMOT, initialMarking, finalMarkings, null, net, log,\r\n//\t\t\t\t\tmapping, false);\r\n//\t\t\tlong mid = System.currentTimeMillis();\r\n//\t\t\tSystem.out.println(\" With ILP cost: \" + cost1 + \" t: \" + (mid - start));\r\n//\r\n//\t\t\tlong mid2 = System.currentTimeMillis();\r\n//\t\t\tint cost2 = AlignmentTest.computeCost(costMOS, costMOT, initialMarking, finalMarkings, null, net, log,\r\n//\t\t\t\t\tmapping, false);\r\n//\t\t\tlong end = System.currentTimeMillis();\r\n//\r\n//\t\t\tSystem.out.println(\" No ILP cost: \" + cost2 + \" t: \" + (end - mid2));\r\n//\t\t\tif (cost1 != cost2) {\r\n//\t\t\t\tSystem.err.println(\"ERROR\");\r\n//\t\t\t}\r\n//\t\t\t//System.gc();\r\n//\t\t\tSystem.out.flush();\r\n//\t\t\titeration++;\r\n//\t\t}\r\n\r\n\t}", "public static void main(String[] args) throws Exception {\n\t\tStoreAlphaWeight.dimensionForSVM=200;\n\t\tLibEstimate le=new LibEstimate();\n\t\tle.countLine();\n\t\tle.readVec();\n\t\tle.readLabel();\n\t\tle.readBias();\n\t\tle.addBiastoVec();\n\t\tle.prepTrainData();\n\t\tle.prepTestData();\n\t\tle.lib();\n\t}", "@Override\n\tpublic Serializable checkpointInfo() throws Exception {\n\t\treturn null;\n\t}", "public static void test2() {\n String dataDir = \"/Data/cteam/tp/csm/seismicz/subz_401_4_600/\";\n String dataFile = \"tpets.dat\";\n int n1 = 401, n2 = 357, n3 = 161;\n float v = 1.0f, d = 30.0f;\n EigenTensors3 et = loadTensors(dataDir+dataFile);\n System.out.println(et);\n float[][][] paint = new float[n3][n2][n1];\n Painting3Group p3g = new Painting3Group(paint);\n PaintBrush pb = new PaintBrush(n1,n2,n3,et);\n pb.setSize(30);\n Painting3 p3 = p3g.getPainting3();\n for (int i3=0; i3<10; ++i3)\n for (int i2=0; i2<10; ++i2)\n for (int i1=0; i1<1; ++i1) {\n p3.paintAt(n1/2+i1,n2/2+i2,n3/2+i3,v,d,pb);\n }\n\n Contour c = p3.getContour(v);\n\n SimpleFrame sf = new SimpleFrame();\n sf.setTitle(\"Formation\");\n World world = sf.getWorld();\n TriangleGroup tg = new TriangleGroup(c.i,c.x);\n world.addChild(tg);\n }", "@Test(timeout = 4000)\n public void test113() throws Throwable {\n TextDirectoryLoader textDirectoryLoader0 = new TextDirectoryLoader();\n Instances instances0 = textDirectoryLoader0.getStructure();\n Evaluation evaluation0 = new Evaluation(instances0);\n String string0 = evaluation0.toSummaryString(false);\n assertEquals(\"=== Summary ===\\n\\nTotal Number of Instances 0 \\n\", string0);\n assertEquals(0.0, evaluation0.SFSchemeEntropy(), 0.01);\n assertEquals(0.0, evaluation0.unclassified(), 0.01);\n }", "protected void checkpoint() {\n checkpoint = internalBuffer().readerIndex();\n }", "@Before\n public void DataSmoothExamples3() {\n\t LinkedList<Episode> eps9 = new LinkedList<Episode>();\n\t\teps9.add(new Episode(\"The One with the Tea Leaves\", 150));\n\t\teps9.add(new Episode(\"The One with Pricess Consuela\", 200));\n\t\teps9.add(new Episode(\"The One with the Bird Mother\", 250));\t\t\n\t\tshows3.add(new Show(\"Friends\", 2100, eps9, false));\n\t\t\n\t\tLinkedList<Episode> eps10 = new LinkedList<Episode>();\n\t\teps10.add(new Episode(\"Java\", 200));\n\t\teps10.add(new Episode(\"Python\", 210));\n\t\teps10.add(new Episode(\"C\", 210));\n\t\teps10.add(new Episode(\"C++\", 200));\n\t\tshows3.add(new Show(\"Programming Languages\", 2000, eps10, false));\n\t\t\n\t\tLinkedList<Episode> eps11 = new LinkedList<Episode>();\n\t\teps11.add(new Episode(\"Leaving Storybrooke\", 180));\n\t\teps11.add(new Episode(\"Homecoming\", 190));\n\t\teps11.add(new Episode(\"Where\", 200));\n\t\tshows3.add(new Show(\"Sisterhood\", 600, eps11, false));\n\n\t showResults3.add(200.0);\n\t showResults3.add(198.333);\n\t showResults3.add(190.0);\n\t}", "private static GeneticProgram loadCheckpoint(String arg) {\n CheckpointLoader cpl = new CheckpointLoader(arg);\n GeneticProgram gp = cpl.instantiate();\n if (gp == null) {\n System.err.println(\"Could not load checkpoint.\");\n System.exit(-1);\n }\n return gp;\n }", "@Test\n public void test33() throws Throwable {\n TextDirectoryLoader textDirectoryLoader0 = new TextDirectoryLoader();\n Instances instances0 = textDirectoryLoader0.getDataSet();\n Evaluation evaluation0 = new Evaluation(instances0);\n double double0 = evaluation0.correct();\n assertEquals(0.0, evaluation0.SFPriorEntropy(), 0.01D);\n assertEquals(0.0, double0, 0.01D);\n }", "public void kirimNotifikasiPengajuan(Training training){\n\t\t\n\t}", "public void test3() {\n //$NON-NLS-1$\n deployBundles(\"test3\");\n IApiBaseline before = getBeforeState();\n IApiBaseline after = getAfterState();\n IApiComponent beforeApiComponent = before.getApiComponent(BUNDLE_NAME);\n //$NON-NLS-1$\n assertNotNull(\"no api component\", beforeApiComponent);\n IApiComponent afterApiComponent = after.getApiComponent(BUNDLE_NAME);\n //$NON-NLS-1$\n assertNotNull(\"no api component\", afterApiComponent);\n IDelta delta = ApiComparator.compare(beforeApiComponent, afterApiComponent, before, after, VisibilityModifiers.ALL_VISIBILITIES, null);\n //$NON-NLS-1$\n assertNotNull(\"No delta\", delta);\n IDelta[] allLeavesDeltas = collectLeaves(delta);\n //$NON-NLS-1$\n assertEquals(\"Wrong size\", 1, allLeavesDeltas.length);\n IDelta child = allLeavesDeltas[0];\n //$NON-NLS-1$\n assertEquals(\"Wrong kind\", IDelta.CHANGED, child.getKind());\n //$NON-NLS-1$\n assertTrue(\"Is visible\", !Util.isVisible(child.getNewModifiers()));\n //$NON-NLS-1$\n assertEquals(\"Wrong flag\", IDelta.TYPE, child.getFlags());\n //$NON-NLS-1$\n assertEquals(\"Wrong element type\", IDelta.FIELD_ELEMENT_TYPE, child.getElementType());\n //$NON-NLS-1$\n assertTrue(\"Not compatible\", DeltaProcessor.isCompatible(child));\n }", "@Test(timeout = 4000)\n public void test021() throws Throwable {\n TextDirectoryLoader textDirectoryLoader0 = new TextDirectoryLoader();\n Instances instances0 = textDirectoryLoader0.getStructure();\n Evaluation evaluation0 = new Evaluation(instances0);\n String string0 = evaluation0.toSummaryString(\"\", false);\n assertEquals(\"\\nTotal Number of Instances 0 \\n\", string0);\n assertEquals(0.0, evaluation0.unclassified(), 0.01);\n assertEquals(0.0, evaluation0.SFSchemeEntropy(), 0.01);\n }", "private void saveLab(boolean usetmp) throws FileNotFoundException{\n //Get path to start.config\n String startConfigPath;\n if(!usetmp){\n startConfigPath = currentLab.getPath()+File.separator+\"config\"+File.separator+\"start.config\";\n }else{\n startConfigPath = currentLab.getPath()+File.separator+\"config\"+File.separator+\"start.config\";\n }\n PrintWriter writer = new PrintWriter(startConfigPath);\n String startConfigText = \"\"; \n \n // Write Global Params\n for(String line : labDataCurrent.getGlobals()){\n startConfigText += line+\"\\n\";\n }\n\n // Cycle through network objects and write\n Component[] networks = NetworkPanePanel.getComponents();\n for(Component network : networks){\n NetworkData data = ((NetworkObjPanel)network).getConfigData();\n startConfigText += \"NETWORK \"+data.name+\"\\n\";\n startConfigText += \" MASK \"+data.mask+\"\\n\";\n startConfigText += \" GATEWAY \"+data.gateway+\"\\n\";\n \n if(data.macvlan > 0){\n startConfigText += \" MACVLAN \"+data.macvlan+\"\\n\";\n }\n if(data.macvlan_ext > 0){\n startConfigText += \" MACVLAN_EXT\" +data.macvlan_ext+\"\\n\";\n }\n \n if(!data.ip_range.isEmpty()){\n startConfigText += \" IP_RANGE \"+data.ip_range+\"\\n\";\n } \n\n if(data.tap){\n startConfigText += \" TAP YES\"+\"\\n\";\n }\n for(String unknownParam : data.unknownNetworkParams){\n startConfigText += \" \"+unknownParam+\"\\n\";\n }\n }\n \n // Cycle through container objects and write \n Component[] containers = ContainerPanePanel.getComponents();\n for(Component container : containers){\n ContainerData data = ((ContainerObjPanel)container).getConfigData(); \n startConfigText += \"CONTAINER \"+data.name+\"\\n\";\n startConfigText += \" USER \"+data.user+\"\\n\";\n if(data.script.isEmpty()){\n startConfigText += \" SCRIPT NONE\\n\";\n }\n else{\n startConfigText += \" SCRIPT \"+data.script+\"\\n\"; \n }\n \n if(data.x11){\n startConfigText += \" X11 YES\\n\"; \n }\n else{\n startConfigText += \" X11 NO\\n\";\n }\n // Not default\n if(data.terminal_count != 1)\n startConfigText += \" TERMINALS \"+data.terminal_count+\"\\n\";\n if(!data.terminal_group.isEmpty())\n startConfigText += \" TERMINAL_GROUP \"+data.terminal_group+\"\\n\";\n if(!data.xterm_title.isEmpty())\n startConfigText += \" XTERM \"+data.xterm_title+\" \"+data.xterm_script+\"\\n\";\n if(!data.password.isEmpty())\n startConfigText += \" PASSWORD \"+data.password+\"\\n\";\n for(LabData.ContainerAddHostSubData addHost : data.listOfContainerAddHost){\n if(addHost.type.equals(\"network\"))\n startConfigText += \" ADD-HOST \"+addHost.add_host_network+\"\\n\";\n else if(addHost.type.equals(\"ip\"))\n startConfigText += \" ADD-HOST \"+addHost.add_host_host+\":\"+addHost.add_host_ip+\"\\n\"; \n }\n for(LabData.ContainerNetworkSubData network : data.listOfContainerNetworks){\n startConfigText += \" \"+network.network_name+\" \"+network.network_ipaddress+\"\\n\"; \n }\n if(data.clone > 0){\n startConfigText += \" CLONE \"+data.clone+\"\\n\";\n }\n if(!data.lab_gateway.isEmpty()){\n startConfigText += \" LAB_GATEWAY \"+data.lab_gateway+\"\\n\";\n }\n if(data.no_gw){\n startConfigText += \" NO_GW YES\\n\";\n }\n if(!data.base_registry.isEmpty()){\n startConfigText += \" BASE_REGISTRY \"+data.base_registry+\"\\n\";\n }\n if(!data.thumb_volume.isEmpty()){\n startConfigText += \" THUMB_VOLUME \"+data.thumb_volume+\"\\n\";\n }\n if(!data.thumb_command.isEmpty()){\n startConfigText += \" THUMB_COMMAND \"+data.thumb_command+\"\\n\";\n }\n if(!data.thumb_stop.isEmpty()){\n startConfigText += \" THUMB_STOP \"+data.thumb_stop+\"\\n\";\n }\n if(!data.publish.isEmpty()){\n startConfigText += \" PUBLISH \"+data.publish+\"\\n\";\n }\n if(data.hide){\n startConfigText += \" HIDE YES\\n\";\n }\n if(data.no_privilege){\n startConfigText += \" NO_PRIVILEGE YES\\n\";\n }\n if(data.no_pull){\n startConfigText += \" NO_PULL YES\\n\";\n }\n if(data.mystuff){\n startConfigText += \" MYSTUFF YES\\n\";\n }\n if(data.tap){\n startConfigText += \" TAP YES\\n\";\n }\n if(!data.mount1.isEmpty() && !data.mount2.isEmpty()){\n startConfigText += \" MOUNT \"+data.mount1+\":\"+data.mount2+\"\\n\";\n }\n \n }\n \n //Write to File\n writer.print(startConfigText);\n writer.close();\n \n //Save results.config and goals.config file\n labDataCurrent.getResultsData().writeResultsConfig(usetmp);\n labDataCurrent.getGoalsData().writeGoalsConfig(usetmp);\n labDataCurrent.getParamsData().writeParamsConfig(usetmp);\n \n System.out.println(\"Lab Saved\");\n }", "public void save(){\n checkpoint = chapter;\n }", "public void train ()\t{\t}", "public void kirimNotifikasiPersetujuan(Training training){\n\t\t\n\t}", "public static void main(String[] args) throws IOException {\n String dataName = \"Dianping\";\n String fileName = \"checkin_pitf\";\n int coreNum = 1;\n// List<Post> trainPosts = DataReader.readPosts(\"./demo/data/\" + dataName + \"/all_id_core\"+coreNum+\"_train\");\n// List<Post> testPosts = DataReader.readPosts(\"./demo/data/\" + dataName + \"/all_id_core\"+coreNum+\"_test\");\n List<Post> trainPosts = DataReader.readPosts(\"./demo/data/\" + dataName + \"/\"+fileName+\"_train\");\n List<Post> testPosts = DataReader.readPosts(\"./demo/data/\" + dataName + \"/\"+fileName+\"_test\");\n\n System.out.println(\"PITFTest\");\n System.out.println(dataName+\" \"+coreNum);\n int dim = 64;\n double initStdev = 0.01;\n int iter = 20;//100\n double learnRate = 0.05;\n double regU = 0.00005;\n double regI = regU, regT = regU;\n int numSample = 100;\n int randomSeed = 1;\n\n PITF pitf = new PITF(trainPosts, testPosts, dim, initStdev, iter, learnRate, regU, regI, regT, randomSeed, numSample);\n pitf.run();//这个函数会调用model的初始化及创建函数\n System.out.println(\"dataName:\\t\" + dataName);\n System.out.println(\"coreNum:\\t\" + coreNum);\n }", "TrainingTest createTrainingTest();", "@Test(timeout = 4000)\n public void test022() throws Throwable {\n TextDirectoryLoader textDirectoryLoader0 = new TextDirectoryLoader();\n Instances instances0 = textDirectoryLoader0.getStructure();\n Evaluation evaluation0 = new Evaluation(instances0);\n evaluation0.toMatrixString(\"getPreBuiltClassifiers\");\n assertEquals(0.0, evaluation0.SFEntropyGain(), 0.01);\n }", "public static void main(final String[] args) {\n \tString enginePath = engines[8];\n\t\tEngineParameter eparams = new EngineParameter(enginePath);\n\n\t\tString url = \"http://files.grouplens.org/datasets/movielens/ml-1m.zip\";\n String folder = \"src/resources/main/data/ml-1m\";\n String modelPath = \"src/resources/main/crossValid/ml-1m/model/\";\n String recPath = \"src/resources/main/crossValid/ml-1m/recommendations/\";\n String dataFile = eparams.getDataSouceParams().getSourceLocation().get(0);\n int nFolds = N_FOLDS;\n \t\t\n System.out.println(\"Preparing splits...\");\n prepareSplits(url, nFolds, dataFile, folder, modelPath);\n \n System.out.println(\"Gathering recomendations...\");\n //recommend(nFolds, modelPath, recPath); // RiVal's original step.\n //orbsRecommend(nFolds, eparams, modelPath); // Based on RiVal' step\n mixedRecommend(nFolds, eparams, modelPath); // Mixed step\n \n //System.out.println(\"Preparing strategy...\");\n // the strategy files are (currently) being ignored\n //prepareStrategy(nFolds, modelPath, recPath, modelPath);\n\n System.out.println(\"Evaluating...\");\n evaluate(nFolds, modelPath, recPath);\n }", "@Test\n public void test03() throws Throwable {\n TextDirectoryLoader textDirectoryLoader0 = new TextDirectoryLoader();\n Instances instances0 = textDirectoryLoader0.getDataSet();\n Evaluation evaluation0 = new Evaluation(instances0);\n double[] doubleArray0 = new double[19];\n evaluation0.updateMargins(doubleArray0, 0, 0.0);\n assertEquals(0.0, evaluation0.SFPriorEntropy(), 0.01D);\n }", "public void testSVMChunkLearnng() throws IOException, GateException {\n // Initialisation\n System.out.print(\"Testing the SVM with liner kernenl on chunk learning...\");\n File chunklearningHome = new File(new File(learningHome, \"test\"),\n \"chunklearning\");\n String configFileURL = new File(chunklearningHome, \"engines-svm.xml\")\n .getAbsolutePath();\n String corpusDirName = new File(chunklearningHome, \"data-ontonews\")\n .getAbsolutePath();\n //Remove the label list file, feature list file and chunk length files.\n String wdResults = new File(chunklearningHome,\n ConstantParameters.SUBDIRFORRESULTS).getAbsolutePath();\n emptySavedFiles(wdResults);\n String inputASN = \"Key\";\n loadSettings(configFileURL, corpusDirName, inputASN, inputASN);\n // Set the evaluation mode\n RunMode runM=RunMode.EVALUATION;\n learningApi.setLearningMode(runM);\n controller.execute();\n // Using the evaluation mode for testing\n EvaluationBasedOnDocs evaluation = learningApi.getEvaluation();\n // Compare the overall results with the correct numbers\n assertEquals(\"Wrong value for correct: \", 44, (int)Math.floor(evaluation.macroMeasuresOfResults.correct));\n assertEquals(\"Wrong value for partial: \", 10, (int)Math.floor(evaluation.macroMeasuresOfResults.partialCor));\n assertEquals(\"Wrong value for spurious: \", 11, (int)Math.floor(evaluation.macroMeasuresOfResults.spurious));\n assertEquals(\"Wrong value for missing: \", 40, (int)Math.floor(evaluation.macroMeasuresOfResults.missing));\n\n System.out.println(\"completed\");\n // Remove the resources\n clearOneTest();\n }", "@Override\n\tpublic void run() {\n\t\tfileName = \"out_\" + Program.getProgram().getFileName() + \"_\";\n\t\tint numAddStop = 0;\n\t\t//fileName = \"out_themida_\";\n\n\t\t//fileState.clearContentFile();\n\t\t//bkFile.clearContentFile();\n\t\toverallStartTime = System.currentTimeMillis();\n\t\tlong overallStartTemp = overallStartTime;\n\t\t// BE-PUM algorithm\n\t\tSystem.out.println(\"Starting On-the-fly Model Generation algorithm.\");\n\t\tprogram.getResultFileTemp().appendInLine('\\n' + program.getFileName() + '\\t');\n\t\t\n\t\t// Set up initial context\n\t\tX86TransitionRule rule = new X86TransitionRule();\n\t\tBPCFG cfg = Program.getProgram().getBPCFG();\n\t\tEnvironment env = new Environment();\n\t\t//env.getMemory().resetImportTable(program);\n\t\tAbsoluteAddress location = Program.getProgram().getEntryPoint();\n\t\tInstruction inst = Program.getProgram().getInstruction(location, env);\n\t\tList<BPPath> pathList = new ArrayList<BPPath>();\n\t\t\n\t\t// Insert start node\n\t\tBPVertex startNode = null;\n\t\tstartNode = new BPVertex(location, inst);\n\t\tstartNode.setType(0);\n\t\tcfg.insertVertex(startNode);\n\n\t\tBPState curState = null;\n\t\tBPPath path = null;\n\t\tcurState = new BPState(env, location, inst);\n\t\tpath = new BPPath(curState, new PathList(), new Formulas());\n\t\tpath.setCurrentState(curState);\n\t\tpathList.add(path);\n\n\t\t/*if (Program.getProgram().getFileName().equals(\"api_test_v2.3_lvl1.exe\") \n\t\t\t\t&& isRestored) {\n\t\t\tSystem.out.println(\"Restore State from File.\");\n\t\t\tFileProcess reFile = new FileProcess(\"data/data/restoreState.txt\");\n\t\t\tpathList = restoreState(reFile);\n\t\t\t// bkFile.clearContentFile();\n\t\t\tSystem.out.println(\"Finished restoring state!\");\n\t\t}*/\n\n\t\t// Update at first -----------------------------\n\t\tTIB.setBeUpdated(true);\n\t\tTIB.updateTIB(curState);\n\t\t// ---------------------------------------------\n\n\t\t// PHONG - 20150801 /////////////////////////////\n\t\t// Packer Detection via Header\n\t\tSystem.out.println(\"================PACKER DETECTION VIA HEADER ======================\");\n\t\tif (OTFModelGeneration.detectPacker)\n\t\t{\n\t\t\tprogram.getDetection().detectViaHeader(program);\n\t\t\tprogram.getDetection().setToLogFirst(program);\n\t\t}\n\t\tSystem.out.println(\"==================================================================\");\n\t\t/////////////////////////////////////////////////\n\t\t\n\t\tsynchronized (OTFThreadManager.getInstance()) {\n\t\t\ttry {\n\t\t\t\tOTFThreadManager.getInstance().check(this, pathList);\n\t\t\t\tOTFThreadManager.getInstance().wait();\n\t\t\t} catch (Exception e) {\n\t\t\t\te.printStackTrace();\n\t\t\t}\n\t\t}\n\t\t// PHONG - 20150724\n\t\tSystem.out.println(\"================PACKER DETECTION VIA OTF======================\");\n\t\tprogram.getDetection().packedByTechniques();\n\t\tprogram.getDetection().packedByTechniquesFrequency();\n\t\tSystem.out.println(\"==============================================================\");\n\t}", "public MultiLayerNetwork loadCheckpointMLN(Checkpoint checkpoint){\n return loadCheckpointMLN(checkpoint.getCheckpointNum());\n }", "public static void main(String[] args) throws IOException {\n\t\tMain t = new Main();\n\t\tSystem.out.println(\"The model is trained: \");\n\t\tt.training(enTrainingDir, 0.7);\n\t\tSystem.out.println(\"Check validation in example of \\\"AB\\\":\");\n\t\tt.checkValid(\"AB\");\n\t\tSystem.out.println();\n\t\tSystem.out.println(\"============= unsmoothed models =============================================================================\");\n\t\tSystem.out.print(\"Unigram: \");\n\t\tSystem.out.println(t.uni);\n\t\tSystem.out.print(\"Bigram: \");\n\t\tSystem.out.println(t.bi);\n\t\tSystem.out.print(\"Trigram: \");\n\t\tSystem.out.println(t.tri);\n\t\tSystem.out.println();\n\t\tSystem.out.println(\"============= add-one smoothed models ========================================================================\");\n\t\tSystem.out.println(\"Note: this is only one of smoothed models , not the tuning process. Because there would be too many console lines.\");\n\t\tSystem.out.println(\"Here I take add-k = 0.7 as an example.\");\n\t\tSystem.out.println(\"*************************************************************************************************************\");\n\t\tdouble k = 0.7;\n\t\tt.training(enTrainingDir, 0.7);\n\t\tt.calculateScore(testDir, k, null, null);\n\t\tt.training(esTrainingDir, 0.7);\n\t\tt.calculateScore(testDir, k, null, null);\n\t\tt.training(deTrainingDir, 0.7);\n\t\tt.calculateScore(testDir, k, null, null);\n\t\tSystem.out.println(\"*************************************************************************************************************\");\n\t\tSystem.out.println(\"Then I take the classic add-k = 1.0 as an example.\");\n\t\tSystem.out.println(\"*************************************************************************************************************\");\n\t\tk = 1.0;\n\t\tt.training(enTrainingDir, 0.7);\n\t\tt.calculateScore(testDir, k, null, null);\n\t\tt.training(esTrainingDir, 0.7);\n\t\tt.calculateScore(testDir, k, null, null);\n\t\tt.training(deTrainingDir, 0.7);\n\t\tt.calculateScore(testDir, k, null, null);\n\t\tSystem.out.println();\n\t\tSystem.out.println(\"===== linear interpolation smoothed models ===================================================================\");\n\t\tdouble[] lambdas_tri = new double[] {1.0 / 3, 1.0 / 3, 1.0 / 3};\n\t\tdouble[] lambdas_bi = new double[] {1.0 / 2, 1.0 / 2};\n\t\tSystem.out.println(\"First is equally weighted lambdas: \" + Arrays.toString(lambdas_tri) + \" and \" + Arrays.toString(lambdas_bi));\n\t\tt.training(enTrainingDir, 0.7);\n\t\tt.calculateScore(testDir, 0, lambdas_bi, lambdas_tri);\n\t\tt.training(esTrainingDir, 0.7);\n\t\tt.calculateScore(testDir, 0, lambdas_bi, lambdas_tri);\n\t\tt.training(deTrainingDir, 0.7);\n\t\tt.calculateScore(testDir, 0, lambdas_bi, lambdas_tri);\n\t\tSystem.out.println(\"**************************************************************************************************************\");\n\t\tlambdas_tri = new double[] {0.5, 0.3, 0.2};\n\t\tlambdas_bi = new double[] {0.7, 0.3};\n\t\tSystem.out.println(\"Then is tuned-weighted lambdas: \" + Arrays.toString(lambdas_tri) + \" and \" + Arrays.toString(lambdas_bi));\n\t\tSystem.out.println(\"Again, this is not all the tuning process. Here is only one set of lambdas.\");\n\t\tt.training(enTrainingDir, 0.7);\n\t\tt.calculateScore(testDir, 0, lambdas_bi, lambdas_tri);\n\t\tt.training(esTrainingDir, 0.7);\n\t\tt.calculateScore(testDir, 0, lambdas_bi, lambdas_tri);\n\t\tt.training(deTrainingDir, 0.7);\n\t\tt.calculateScore(testDir, 0, lambdas_bi, lambdas_tri);\n\t\tSystem.out.println();\n\t\tSystem.out.println(\"=================== Generating texts ==========================================================================\");\n\t\tSystem.out.println(\"To save console space, here I generate A to E, five sentences. Feel free to adjust parameters in code.\");\n\t\tSystem.out.println(\"***************************************************************************************************************\");\n\t\tt.training(enTrainingDir, 0.7);\n\t\tSystem.out.println(\"**************** Bi-gram generating ***************************************************************************\");\n\t\tfor (char c = 'A'; c <= 'E'; c++) {\n\t\t\tt.generateWithBigramModel(String.valueOf(c));\n\t\t}\n\t\tSystem.out.println();\n\t\tSystem.out.println();\n\t\tSystem.out.println(\"Not that good huh?\");\n\t\tSystem.out.println(\"**************** Tri-gram generating *************************************************************************\");\n\t\tfor (char c = 'A'; c <= 'E'; c++) {\n\t\t\tt.generateWithBigramModel(String.valueOf(c));\n\t\t}\n\t\tSystem.out.println();\n\t\tSystem.out.println();\n\t\tSystem.out.println(\"...Seems not good as well.\");\n\t}", "private String checkpointString(int cp, long time) {\n\t\treturn \"Checkpoint \" + ChatColor.GRAY + String.valueOf(cp) + ChatColor.WHITE + \" = \" + ChatColor.GRAY + _.getGameController().getTimeString(0, time) + ChatColor.WHITE;\n\t}", "public static void main(String[] args) throws IOException {\n\t\t \tstart=new A1063307_Checkpoint6();\r\n\t\t\tstart.setVisible(true);\r\n\t\t\tstart.setSize(200,200);\r\n\t\t\tstart.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);\r\n\t\t\tstart.setResizable(false);\t\r\n\t}", "@Test\n public void test22() throws Throwable {\n TextDirectoryLoader textDirectoryLoader0 = new TextDirectoryLoader();\n Instances instances0 = textDirectoryLoader0.getDataSet();\n Evaluation evaluation0 = new Evaluation(instances0);\n FastVector fastVector0 = evaluation0.predictions();\n assertEquals(0.0, evaluation0.SFEntropyGain(), 0.01D);\n }", "@Test\n public void test19() throws Throwable {\n TextDirectoryLoader textDirectoryLoader0 = new TextDirectoryLoader();\n Instances instances0 = textDirectoryLoader0.getDataSet();\n Evaluation evaluation0 = new Evaluation(instances0);\n double double0 = evaluation0.KBInformation();\n assertEquals(0.0, double0, 0.01D);\n assertEquals(0.0, evaluation0.SFPriorEntropy(), 0.01D);\n }", "public static void main(String[] args) {\n\t\tExemplaryContent ec = new ExemplaryContent();\n\t\tRendezvous rendezvous = ec.getExample();\n\n\t\t// make a few steps\n\t\tILOGExporter exporter = new ILOGExporter();\n\t\tILOGSolver solver = new ILOGSolver();\n\n\t\tFile modelFile = new File(\"Constraints-Displays-Model.mod\");\n\n\t\tPreferenceStructure preferences = new PreferenceStructure(); // unit preference structure Max-CSP\n\n\t\tResultChecker checker = new ResultChecker();\n\t\tfor (int steps = 0; steps < 5; ++steps) {\n\n\t\t\tString dataContent = exporter.getILOGDataFile(rendezvous);\n\t\t\tString preferencesContent = exporter.getPreferenceContent(preferences);\n\n\t\t\tSolution solution = solver.solve(modelFile, dataContent + \"\\n\" + preferencesContent);\n\n\t\t\tFrame selectedFrame = rendezvous.getContent().getFrameGraph().lookup(solution.getSelectedFrameId());\n\t\t\tsolution.setSelectedFrame(selectedFrame);\n\n\t\t\tSystem.out.println(\"Selected \" + solution.getSelectedFrameId());\n\n\t\t\tchecker.check(solution, rendezvous, preferences);\n\n\t\t\t// add to the seen frames\n\t\t\tfor (Group g : rendezvous.getMeetup().getGroups()) {\n\t\t\t\tfor (User u : g.getMembers()) {\n\t\t\t\t\tu.getSeenFrames().add(selectedFrame);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t// test suite has ended\n\t\tSystem.out.println(checker.retrieveCoverageInformation());\n\t}", "@Test(timeout = 4000)\n public void test093() throws Throwable {\n TextDirectoryLoader textDirectoryLoader0 = new TextDirectoryLoader();\n Instances instances0 = textDirectoryLoader0.getDataSet();\n Evaluation evaluation0 = new Evaluation(instances0);\n Object[] objectArray0 = new Object[2];\n evaluation0.evaluateModel((Classifier) null, instances0, objectArray0);\n assertEquals(0.0, evaluation0.SFEntropyGain(), 0.01);\n }", "private Parameters createCheckpoint() {\n Parameters checkpoint = Parameters.create();\n checkpoint.set(\"lastDoc/identifier\", this.lastAddedDocumentIdentifier);\n checkpoint.set(\"lastDoc/number\", this.lastAddedDocumentNumber);\n checkpoint.set(\"indexBlockCount\", this.indexBlockCount);\n Parameters shards = Parameters.create();\n for (Bin b : this.geometricParts.radixBins.values()) {\n for (String indexPath : b.getBinPaths()) {\n shards.set(indexPath, b.size);\n }\n }\n checkpoint.set(\"shards\", shards);\n return checkpoint;\n }", "@Test(timeout = 4000)\n public void test103() throws Throwable {\n TextDirectoryLoader textDirectoryLoader0 = new TextDirectoryLoader();\n Instances instances0 = textDirectoryLoader0.getDataSet();\n Evaluation evaluation0 = new Evaluation(instances0);\n double[][] doubleArray0 = evaluation0.confusionMatrix();\n assertEquals(0, doubleArray0.length);\n assertEquals(0.0, evaluation0.SFPriorEntropy(), 0.01);\n }", "public static void main(String[] args) {\n\t\tList<String> listSouceCode = Helper.getAllDataFromFolder(DATASET1);\n\n\t\t//Create the HMM for concepts\n\t\tHMMConcept hmmConcept = new HMMConcept();\n\t\thmmConcept.init();\n\t\tHMMConceptInit.initTransition(hmmConcept);\n\n\t\t//Now, let us test the training phase\n\t\t//Transition probabilities\n\t\tHMMConceptTransition.\n\t\t\tpreTransition(listSouceCode, hmmConcept);\n\t\tHMMConceptTransition.\n\t\t\ttargetTransition(listSouceCode, hmmConcept);\n\t\tHMMConceptTransition.\n\t\t\totherTransition(listSouceCode, hmmConcept);\n//\t\t//Observations probabilities\n\t\tHMMConceptObservation.\n\t\t\tpreObservation(listSouceCode, hmmConcept);\n\t\tHMMConceptObservation.\n\t\t\ttargetObservation(listSouceCode, hmmConcept);\n\t\tHMMConceptObservation.\n\t\t\totherObservation(listSouceCode, hmmConcept);\n\t\t\n//\t\tSystem.out.println(hmmConcept);\n\n//\t\t//*************************END of the HMM training***************************************\n\n\t\t///To extract knowledge, just uncomment the corresponding source code\n\t\t\n\t\t/**\n\t\t * EPICAM Knowledge extraction\n//\t\t */\n//\t\t//Knowledge extraction\n//\t\tList<String> testedSourceCode = Helper.getAllDataFromFolder(DATASET2);\n//\t\tList<Column> alphaTable;\n//\t\t\n//\t\tfor (String sourceFile : testedSourceCode) {\n//\t\t\talphaTable = MostLikelyExplanationConcept.\n//\t\t\t\t\tfillAlphaStartTable4Concepts(hmmConcept, sourceFile);\n//\n//\t\t\tString extracted = MostLikelyExplanationConcept.knowledgeExtraction(alphaTable);\n////\t\t\tWriting to an OWL file\n//\t\t\tHelper.writeDataToFile(CONCEPTSEXTRACTED, extracted);\n//\t\t\t//The number of false positives and the number of target\n//\t\t\tSystem.out.println(MostLikelyExplanationConcept.nbFalsePositive+\"\\n and nb target: \"+\n//\t\t\tMostLikelyExplanationConcept.nbTarget);\n//\t\t\t\n////\t\t\tSystem.out.println(Term2OWL.term2OWL(new File(CONCEPTSEXTRACTED)));\n//\n//\t\t}\n\n\t\t/**\n\t\t * Geoserver knowledge extraction\n\t\t */\n\n\t\tList<String> testedSourceCode = Helper.getAllDataFromFolder(GEOSERVER);\n\t\tList<Column> alphaTable;\n\t\t\n\t\tfor (String sourceFile : testedSourceCode) {\n\t\t\talphaTable = MostLikelyExplanationConcept.\n\t\t\t\t\tfillAlphaStartTable4Concepts(hmmConcept, sourceFile);\n\n\t\t\tString extracted = MostLikelyExplanationConcept.knowledgeExtraction(alphaTable);\n//\t\t\tWriting to an OWL file\n\t\t\tHelper.writeDataToFile(TERMSEXTRACTED2GEOSERVER, extracted);\n\t\t\t//The number of false positives and the number of target\n\t\t\t\n//\t\t\tSystem.out.println(Term2OWL.term2OWL(new File(CONCEPTSEXTRACTED)));\n\n\t}\n\t\tSystem.out.println(MostLikelyExplanationConcept.nbFalsePositive+\"\\n and nb target: \"+\n\t\tMostLikelyExplanationConcept.nbTarget);\n\t}", "public void startTrainingMode() {\n\t\t\r\n\t}", "public String toCheckpoint() {\n return null;\n }", "private void initZ3DataStructures() throws Z3Exception {\n\t\tcfg = new HashMap<String, String>();\n\t\tcfg.put(\"model\", \"false\");\n\t\t//cfg.put(\"macro-finder\", \"true\");\n\t\tctx = new Context(cfg);\n\t\tsolver = ctx.MkSolver();\n\t\tactionAndFeatureToZ3=new HashMap<>();\n\t\tactionAndFeatureToZ3Val=new HashMap<>();\n\t\t/*varToZ3=new HashMap<>();\n\t\tvarToZ3Val=new HashMap<>();*/\n\n\t\t//DO\n\t\t//(define-fun do ((x Int)) Bool (if (or false (= x sell) ) true false))\n\t\tdoFunc = ctx.MkFuncDecl(\"do\", ctx.MkIntSort(), ctx.MkBoolSort());\n\t\t//I don't need to scan the constraints to search for \"do(sell)\". I always add it explicitly when checking if an action is allowed. \n\t\t//solver.Assert(arg0);\n\t\t/*NormalAction sell = new NormalAction(\"sell\");\n\tSymbol actionName = ctx.MkSymbol(sell.getName());\n\tactionAndFeatureToZ3.put(sell, (ArithExpr)ctx.MkConst(actionName,ctx.MkIntSort()));\n\tactionAndFeatureToZ3Val.put(sell,ctx.MkInt(actionAndFeatureToZ3Val.size()+1));\n\tExpr aaa = doFunc.Apply(actionAndFeatureToZ3.get(sell));\n\tsolver.Assert(ctx.MkEq(ctx.MkTrue(), aaa));*/\n\n\t\t//INSTALLED ACTIONS\n\t\t//eq installedFeaturesForz3(Cons) = \" (define-fun has ((x Int)) Bool (if (or false \" #+ $store2smtStatus(\"has\",Cons) #+ \") true false))\" .\n\t\t//(define-fun has ((x Int)) Bool (if (or false (= x AllYear) (= x Diamond) ) true false))\n\t\thasFunc = ctx.MkFuncDecl(\"has\", ctx.MkIntSort(), ctx.MkBoolSort());\n\n\t\t//Static constraints: this I have to do only once, as I assume them to be unmutable. I have to pass to z3 all the constraints\n\t\t//staticConstraints(initFragment)\n\n\t}", "@Test\n public void test08() throws Throwable {\n DecisionStump decisionStump0 = new DecisionStump();\n String string0 = Evaluation.makeOptionString(decisionStump0, false);\n assertEquals(\"\\n\\nGeneral options:\\n\\n-h or -help\\n\\tOutput help information.\\n-synopsis or -info\\n\\tOutput synopsis for classifier (use in conjunction with -h)\\n-t <name of training file>\\n\\tSets training file.\\n-T <name of test file>\\n\\tSets test file. If missing, a cross-validation will be performed\\n\\ton the training data.\\n-c <class index>\\n\\tSets index of class attribute (default: last).\\n-x <number of folds>\\n\\tSets number of folds for cross-validation (default: 10).\\n-no-cv\\n\\tDo not perform any cross validation.\\n-split-percentage <percentage>\\n\\tSets the percentage for the train/test set split, e.g., 66.\\n-preserve-order\\n\\tPreserves the order in the percentage split.\\n-s <random number seed>\\n\\tSets random number seed for cross-validation or percentage split\\n\\t(default: 1).\\n-m <name of file with cost matrix>\\n\\tSets file with cost matrix.\\n-l <name of input file>\\n\\tSets model input file. In case the filename ends with '.xml',\\n\\ta PMML file is loaded or, if that fails, options are loaded\\n\\tfrom the XML file.\\n-d <name of output file>\\n\\tSets model output file. In case the filename ends with '.xml',\\n\\tonly the options are saved to the XML file, not the model.\\n-v\\n\\tOutputs no statistics for training data.\\n-o\\n\\tOutputs statistics only, not the classifier.\\n-i\\n\\tOutputs detailed information-retrieval statistics for each class.\\n-k\\n\\tOutputs information-theoretic statistics.\\n-classifications \\\"weka.classifiers.evaluation.output.prediction.AbstractOutput + options\\\"\\n\\tUses the specified class for generating the classification output.\\n\\tE.g.: weka.classifiers.evaluation.output.prediction.PlainText\\n-p range\\n\\tOutputs predictions for test instances (or the train instances if\\n\\tno test instances provided and -no-cv is used), along with the \\n\\tattributes in the specified range (and nothing else). \\n\\tUse '-p 0' if no attributes are desired.\\n\\tDeprecated: use \\\"-classifications ...\\\" instead.\\n-distribution\\n\\tOutputs the distribution instead of only the prediction\\n\\tin conjunction with the '-p' option (only nominal classes).\\n\\tDeprecated: use \\\"-classifications ...\\\" instead.\\n-r\\n\\tOnly outputs cumulative margin distribution.\\n-z <class name>\\n\\tOnly outputs the source representation of the classifier,\\n\\tgiving it the supplied name.\\n-xml filename | xml-string\\n\\tRetrieves the options from the XML-data instead of the command line.\\n-threshold-file <file>\\n\\tThe file to save the threshold data to.\\n\\tThe format is determined by the extensions, e.g., '.arff' for ARFF \\n\\tformat or '.csv' for CSV.\\n-threshold-label <label>\\n\\tThe class label to determine the threshold data for\\n\\t(default is the first label)\\n\\nOptions specific to weka.classifiers.trees.DecisionStump:\\n\\n-D\\n\\tIf set, classifier is run in debug mode and\\n\\tmay output additional info to the console\\n\", string0);\n }", "@Test\n public void test18() throws Throwable {\n TextDirectoryLoader textDirectoryLoader0 = new TextDirectoryLoader();\n Instances instances0 = textDirectoryLoader0.getDataSet();\n Evaluation evaluation0 = new Evaluation(instances0);\n double double0 = evaluation0.KBMeanInformation();\n assertEquals(0.0, evaluation0.SFPriorEntropy(), 0.01D);\n }", "boolean previousStep();", "@Test\n public void test28() throws Throwable {\n TextDirectoryLoader textDirectoryLoader0 = new TextDirectoryLoader();\n Instances instances0 = textDirectoryLoader0.getDataSet();\n CostSensitiveClassifier costSensitiveClassifier0 = new CostSensitiveClassifier();\n CostMatrix costMatrix0 = costSensitiveClassifier0.getCostMatrix();\n Evaluation evaluation0 = null;\n try {\n evaluation0 = new Evaluation(instances0, costMatrix0);\n fail(\"Expecting exception: Exception\");\n \n } catch(Exception e) {\n //\n // Cost matrix not compatible with data!\n //\n }\n }", "@Test\n public void test29() throws Throwable {\n TextDirectoryLoader textDirectoryLoader0 = new TextDirectoryLoader();\n Instances instances0 = textDirectoryLoader0.getDataSet();\n Evaluation evaluation0 = new Evaluation(instances0, (CostMatrix) null);\n double double0 = evaluation0.pctCorrect();\n assertEquals(Double.NaN, double0, 0.01D);\n assertEquals(0.0, evaluation0.SFPriorEntropy(), 0.01D);\n }", "public static void demo() {\n\t\tlab_2_2_5();\n\n\t}", "public static void main(String[] args) throws IOException {\n final dev.punchcafe.vngine.game.GameBuilder<NarrativeImp> gameBuilder = new dev.punchcafe.vngine.game.GameBuilder();\n final NarrativeAdaptor<Object> narrativeReader = (file) -> List.of();\n final var pom = PomLoader.forGame(new File(\"command-line/src/main/resources/vng-game-1\"), narrativeReader).loadGameConfiguration();\n final var narratives = NarrativeParser.parseNarrative(new File(\"command-line/src/main/resources/vng-game-1/narratives/narratives.yml\"));\n final var narrativeService = new NarrativeServiceImp(narratives);\n gameBuilder.setNarrativeReader(new NarrativeReaderImp());\n gameBuilder.setNarrativeService(narrativeService);\n gameBuilder.setPlayerObserver(new SimplePlayerObserver());\n gameBuilder.setProjectObjectModel(pom);\n final var game = gameBuilder.build();\n //game.startNewGame();\n final var saveFile = GameSave.builder()\n .nodeIdentifier(NodeIdentifier.builder()\n .chapterId(\"ch_01\")\n .nodeId(\"1_2_2\")\n .build())\n .savedGameState(SavedGameState.builder()\n .chapterStateSnapshot(StateSnapshot.builder()\n .booleanPropertyMap(Map.of())\n .integerPropertyMap(Map.of())\n .stringPropertyMap(Map.of())\n .build())\n .gameStateSnapshot(StateSnapshot.builder()\n .booleanPropertyMap(Map.of())\n .integerPropertyMap(Map.of())\n .stringPropertyMap(Map.of())\n .build())\n .build())\n .build();\n final var saveGame = game.loadGame(saveFile)\n .tick()\n .tick()\n .saveGame();\n System.out.println(\"checkpoint\");\n }", "public void testStep() {\n\n DT_TractographyImage crossing = Images.getCrossing();\n\n FACT_FibreTracker tracker = new FACT_FibreTracker(crossing);\n\n Vector3D[] pds = crossing.getPDs(1,1,1);\n\n Vector3D step = tracker.getFirstStep(new Point3D(1.5 * Images.xVoxelDim, 1.2 * Images.yVoxelDim, 1.1 * Images.zVoxelDim), 0, true);\n\n assertEquals(1.0, pds[0].dot(step.normalized()), 1E-8);\n\n assertEquals(Images.xVoxelDim / 2.0, step.mod(), 0.05);\n \n step = tracker.getFirstStep(new Point3D(1.5 * Images.xVoxelDim, 1.2 * Images.yVoxelDim, 1.1 * Images.zVoxelDim), 0, false);\n\n assertEquals(-1.0, pds[0].dot(step.normalized()), 1E-8);\n\n step = tracker.getFirstStep(new Point3D(1.5 * Images.xVoxelDim, 1.2 * Images.yVoxelDim, 1.1 * Images.zVoxelDim), 1, true);\n\n assertEquals(1.0, pds[1].dot(step.normalized()), 1E-8);\n\n\n for (int i = 0; i < 2; i++) {\n\n step = tracker.getNextStep(new Point3D(1.5 * Images.xVoxelDim, 1.2 * Images.yVoxelDim, 1.1 * Images.zVoxelDim), new Vector3D(pds[i].x + 0.01, pds[i].y + 0.02, pds[i].z + 0.03).normalized());\n\n assertEquals(1.0, pds[i].dot(step.normalized()), 1E-8);\n\n }\n\n \n }", "@Procedure(value = \"mlp.train\", mode = WRITE)\n @Description(\"Backward pass through NN\")\n public void train(@Name(value = \"no. of passes\") long nPasses) {\n\n DataLogger logger = new DataLogger(\"proto1\", \"error\");\n\n for (int i = 0; i < nPasses; i++) {\n updateTrainRate(i + 1);\n forwardPass();\n\n double error = calculateError();\n\n double reward = 1.0 - error;\n\n// if (Math.random() > 0.9) reward = error;\n\n backwardPass(reward);\n moveNext();\n\n\n// System.out.println(String.format(\"Error: %f\", error));\n// if (i % 100 == 0 && i > 0) {\n// double meanError = errors.stream().reduce(0.0, Double::sum) / 100;\n// System.out.println(String.format(\n// \"Mean error: %f, eta: %f\", meanError, eta));\n// errors.clear();\n// }\n// errors.add(error);\n logger.append(error);\n\n\n }\n\n forwardPass();\n logger.close();\n }", "public static void main(String[] args) {\n\t\tUtility utility = new Utility();\n\t\t\n\t\t// build trainingset\n\t\tSystem.out.println(\"Training System....\");\n\t\tArrayList<Student> trainingSet = utility.readStudentfile(\"porto_math_train.csv\");\n\t\tArrayList<Variable> variableSets = Student.getAllVar();\n\n\t\tTree tree = new Tree();\n\t\tNode decisionTree = tree.buildTree2(trainingSet, variableSets);\n\n\t\tutility .printNode(decisionTree);\n\n\t\t// testing DT\n\t\tSystem.out.println(\"\\tTesting System (trainingSet)....\");\n\t\tutility.testTree2(trainingSet, decisionTree);\n\t\t\n\t\tSystem.out.println();\n\t\tSystem.out.println(\"\\tTesting System (testSet)....\");\n\t\tArrayList<Student> testSet = utility.readStudentfile(\"porto_math_test.csv\");\n\t\tutility.testTree2(testSet, decisionTree);\t\t\n\t}", "public static void main(String[] args) throws FileNotFoundException, IOException, InterruptedException {\n ArrayList<Metric> metrics = new ArrayList<Metric>();\n metrics.add(new ELOC());\n metrics.add(new NOPA());\n metrics.add(new NMNOPARAM());\n MyClassifier c1 = new MyClassifier(\"Logistic Regression\");\n c1.setClassifier(new Logistic());\n String type = \"CodeSmellDetection\";\n String smell = \"Large Class\";\n Model model = new Model(\"antModel1\", \"ant\", \"https://github.com/apache/ant.git\", metrics, c1, \"\", type, smell);\n Process process = new Process();\n String periodLength = \"All\";\n String version = \"rel/1.8.3\";\n \n String projectName = model.getProjName();\n process.initGitRepositoryFromFile(scatteringFolderPath + \"/\" + projectName\n + \"/gitRepository.data\");\n try {\n DeveloperTreeManager.calculateDeveloperTrees(process.getGitRepository()\n .getCommits(), periodLength);\n DeveloperFITreeManager.calculateDeveloperTrees(process.getGitRepository()\n .getCommits(), periodLength);\n } catch (Exception ex) {\n Logger.getLogger(TestFile.class.getName()).log(Level.SEVERE, null, ex);\n }\n \n List<Commit> commits = process.getGitRepository().getCommits();\n PeriodManager.calculatePeriods(commits, periodLength);\n List<Period> periods = PeriodManager.getList();\n \n String dirPath = Config.baseDir + projectName + \"/models/\" + model.getName();\n Files.createDirectories(Paths.get(dirPath));\n \n for (Period p : periods) {\n File periodData = new File(dirPath + \"/predictors.csv\");\n PrintWriter pw1 = new PrintWriter(periodData);\n \n String message1 = \"nome,\";\n for(Metric m : metrics) {\n message1 += m.getNome() + \",\";\n }\n message1 += \"isSmell\\n\";\n pw1.write(message1);\n \n //String baseSmellPatch = \"C:/ProgettoTirocinio/dataset/apache-ant-data/apache_1.8.3/Validated\";\n CalculateSmellFiles cs = new CalculateSmellFiles(model.getProjName(), \"Large Class\", \"1.8.1\");\n \n List<FileBean> smellClasses = cs.getSmellClasses();\n \n String projectPath = baseFolderPath + projectName;\n \n Git.gitReset(new File(projectPath));\n Git.clean(new File(projectPath));\n \n List<FileBean> repoFiles = Git.gitList(new File(projectPath), version);\n System.out.println(\"Repo size: \"+repoFiles.size());\n \n \n for (FileBean file : repoFiles) {\n \n if (file.getPath().contains(\".java\")) {\n File workTreeFile = new File(projectPath + \"/\" + file.getPath());\n\n ClassBean classBean = null;\n \n if (workTreeFile.exists()) {\n ArrayList<ClassBean> code = new ArrayList<>();\n ArrayList<ClassBean> classes = ReadSourceCode.readSourceCode(workTreeFile, code);\n \n String body = file.getPath() + \",\";\n if (classes.size() > 0) {\n classBean = classes.get(0);\n\n }\n for(Metric m : metrics) {\n try{\n body += m.getValue(classBean, classes, null, null, null, null) + \",\";\n } catch(NullPointerException e) {\n body += \"0.0,\";\n }\n }\n \n //isSmell\n boolean isSmell = false;\n for(FileBean sm : smellClasses) {\n if(file.getPath().contains(sm.getPath())) {\n System.out.println(\"ok\");\n isSmell = true;\n break;\n }\n }\n \n body = body + isSmell + \"\\n\";\n pw1.write(body); \n }\n }\n }\n Git.gitReset(new File(projectPath));\n pw1.flush();\n }\n \n WekaEvaluator we1 = new WekaEvaluator(baseFolderPath, projectName, new Logistic(), \"Logistic Regression\", model.getName());\n \n ArrayList<Model> models = new ArrayList<Model>();\n \n models.add(model);\n System.out.println(models);\n //create a project\n Project p1 = new Project(\"https://github.com/apache/ant.git\");\n p1.setModels(models);\n p1.setName(\"ant\");\n p1.setVersion(version);\n \n ArrayList<Project> projects;\n //projects.add(p1);\n \n //create a file\n// try {\n// File f = new File(Config.baseDir + \"projects.txt\");\n// FileOutputStream fileOut;\n// if(f.exists()){\n// projects = ProjectHandler.getAllProjects(); \n// Files.delete(Paths.get(Config.baseDir + \"projects.txt\"));\n// //fileOut = new FileOutputStream(f, true);\n// } else {\n// projects = new ArrayList<Project>();\n// Files.createFile(Paths.get(Config.baseDir + \"projects.txt\"));\n// }\n// fileOut = new FileOutputStream(f);\n// projects.add(p1);\n// ObjectOutputStream out = new ObjectOutputStream(fileOut);\n// out.writeObject(projects);\n// out.close();\n// fileOut.close();\n//\n// } catch (FileNotFoundException e) {\n// e.printStackTrace();\n// } catch (IOException e) {\n// e.printStackTrace();\n// }\n// ProjectHandler.setCurrentProject(p1);\n// Project curr = ProjectHandler.getCurrentProject();\n// System.out.println(curr.getGitURL()+\" --- \"+curr.getModels());\n// ArrayList<Project> projectest = ProjectHandler.getAllProjects();\n// for(Project testp : projectest){\n// System.out.println(testp.getModels());\n// }\n }", "@Test(timeout = 4000)\n public void test031() throws Throwable {\n TextDirectoryLoader textDirectoryLoader0 = new TextDirectoryLoader();\n Instances instances0 = textDirectoryLoader0.getStructure();\n Evaluation evaluation0 = new Evaluation(instances0);\n double double0 = evaluation0.numFalseNegatives((-1436));\n assertEquals(0.0, evaluation0.SFPriorEntropy(), 0.01);\n assertEquals(0.0, double0, 0.01);\n }", "public static void main(String[] args) throws IOException {\n Date date = Calendar.getInstance().getTime();\n DateFormat dateFormat = new SimpleDateFormat(\"yyyy-MM-dd HH.mm.ss\");\n String strDate = dateFormat.format(date);\n String pathString = \"C:/Users/Akshay/Desktop/RL LUT Values/Neural Net Outputs/\"+strDate+\"/\";\n File dir = new File(pathString);\n dir.mkdirs();\n\n String pathStringWeights = pathString+\"Final Weights/\";\n File dirWeights = new File(pathStringWeights);\n dirWeights.mkdirs();\n\n\n //Declare All Variables\n double[][][][][][] LUT = new double[6][4][4][4][4][8];\n\n //Read Input LUT\n String pathToLut = \"C:/Users/Akshay/Desktop/RL LUT Values/Battle 3.txt\";\n loadLutToArray(LUT, pathToLut);\n\n //Initialize Neural Net\n int numInputNeurons = 13; //5 State Variables and 8 for Action with 1 hot Encoding\n int numHiddenNeurons = 20;\n int numOutputNeurons = 1;\n\n double learningRate = 0.01;\n double momentum = 0.5;\n\n double argA = 0;\n double argB = 0;\n\n int t = 1;\n String activation = \"\";\n switch (t) {\n case 1:\n activation = \"Bipolar Sigmoid\";\n break;\n case 2:\n activation = \"Tan Hyperbolic\";\n break;\n default:\n activation = \"Sigmoid\";\n }\n\n double E = 0;\n\n NeuralNet nn1 = new NeuralNet(numInputNeurons, numHiddenNeurons, numOutputNeurons, learningRate, momentum, argA, argB);\n nn1.initWeights(-0.5, 0.5);\n\n //Track Epoch using k\n int k = 0;\n String s = \"Activation = \"+activation+\"\\nLearning Rate = \"+learningRate+\"\\nMomentum = \"+momentum+\"\\nHidden Neurons = \"+numHiddenNeurons;\n\n while(true){\n k++;\n\n if(k>10000){\n String identifier = k+\".\";\n nn1.saveWeights(pathStringWeights,identifier);\n break;\n }\n\n //Start Loop Across LUT\n for(int d = 0; d < 6; d++){\n double di = absScale(d,0,5,-0.8,0.8);\n for(int men = 0; men < 4; men++){\n double meni = absScale(men,0,3,-0.8,0.8);\n for(int een = 0; een < 4; een++){\n double eeni = absScale(een,0,3,-0.8,0.8);\n for(int ex = 0; ex < 4; ex++){\n double exi = absScale(ex,0,3,-0.8,0.8);\n for(int yi = 0; yi < 4; yi++){\n double yii = absScale(yi,0,3,-0.8,0.8);\n for(int act = 0; act < 8; act++){\n //Each action needs to be 1 hot encoded\n double x[] = new double[13];\n switch(act){\n case 0: x = new double[] {di,meni,eeni,exi,yii,0.8,-0.8,-0.8,-0.8,-0.8,-0.8,-0.8,-0.8};\n break;\n case 1: x = new double[] {di,meni,eeni,exi,yii,-0.8,0.8,-0.8,-0.8,-0.8,-0.8,-0.8,-0.8};\n break;\n case 2: x = new double[] {di,meni,eeni,exi,yii,-0.8,-0.8,0.8,-0.8,-0.8,-0.8,-0.8,-0.8};\n break;\n case 3: x = new double[] {di,meni,eeni,exi,yii,-0.8,-0.8,-0.8,0.8,-0.8,-0.8,-0.8,-0.8};\n break;\n case 4: x = new double[] {di,meni,eeni,exi,yii,-0.8,-0.8,-0.8,-0.8,0.8,-0.8,-0.8,-0.8};\n break;\n case 5: x = new double[] {di,meni,eeni,exi,yii,-0.8,-0.8,-0.8,-0.8,-0.8,0.8,-0.8,-0.8};\n break;\n case 6: x = new double[] {di,meni,eeni,exi,yii,-0.8,-0.8,-0.8,-0.8,-0.8,-0.8,0.8,-0.8};\n break;\n case 7: x = new double[] {di,meni,eeni,exi,yii,-0.8,-0.8,-0.8,-0.8,-0.8,-0.8,-0.8,0.8};\n break;\n }\n\n //Defining Training Output For ErrorBackPropagation\n double y[] = {absScale(LUT[d][men][een][ex][yi][act],-1000,1000,-0.8,0.8)};\n\n //Error Back Propagation\n nn1.propagateForward(x,t);\n nn1.propagateBackwardOutput(y,t);\n nn1.weightUpdateOutput(learningRate,momentum);\n nn1.propagateBackwardHidden(t);\n nn1.weightUpdateHidden(learningRate,momentum,x);\n\n E = E + Math.pow((nn1.finalOutput[0] - y[0]),2);\n }\n }\n }\n }\n }\n }\n //RMS Error This Time. Not Total Error\n E = Math.sqrt(E/(12288));\n //Perfect Condition Stuff\n /*if(E<=0.05){\n //System.out.println(\"Trial Number: \"+loop+\" Converged at Epoch \"+k);\n String identifier = k+\".\";\n nn1.saveWeights(pathStringWeights,identifier);\n break;\n }*/\n\n //End of Epoch Code Goes Here\n String cmdOp = \"Epoch \"+k+\", Error = \"+E;\n System.out.println(cmdOp);\n\n s = s + \"\\n\" + k + \" \" + E;\n writeToFile(pathString+\"Stats.txt\",s);\n E = 0;\n }\n }", "static void setExample() throws Exception {\n PetriNet net = new PetriNet(2);\n PetriNet.setNet(net);\n \n int[] tmin = {2, 1};\n int[] tdelta = {-1, 1};\n int[] umin = {1, 2};\n int[] udelta = {-1, 2};\n int[] vmin = {1, 0};\n int[] vdelta = {1, 1};\n m0 = new Marking(new int[]{3, 1});\n mF = new Marking(new int[]{0, 4});\n \n PNTransition t = new PNTransition(tmin, tdelta);\n PNTransition u = new PNTransition(umin, udelta);\n PNTransition v = new PNTransition(vmin, vdelta);\n net.addTransition(t);\n net.addTransition(u);\n // net.addTransition(v);\n }", "@Test(timeout = 4000)\n public void test111() throws Throwable {\n TextDirectoryLoader textDirectoryLoader0 = new TextDirectoryLoader();\n Instances instances0 = textDirectoryLoader0.getDataSet();\n Evaluation evaluation0 = new Evaluation(instances0);\n evaluation0.relativeAbsoluteError();\n assertEquals(Double.NaN, evaluation0.meanPriorAbsoluteError(), 0.01);\n assertEquals(0.0, evaluation0.SFEntropyGain(), 0.01);\n assertEquals(Double.NaN, evaluation0.meanAbsoluteError(), 0.01);\n }", "@RequiresApi(api = Build.VERSION_CODES.KITKAT)\n public void initializeGraph() {\n checkpointPrefix = Tensors.create((getApplicationContext().getExternalFilesDir(Environment.DIRECTORY_DOCUMENTS).getAbsolutePath() + \"final_model.ckpt\").toString());\n checkpointDir = getApplicationContext().getExternalFilesDir(Environment.DIRECTORY_DOCUMENTS).getAbsolutePath();\n graph = new Graph();\n sess = new Session(graph);\n InputStream inputStream;\n try {\n inputStream = getAssets().open(\"final_graph_hdd.pb\");\n byte[] buffer = new byte[inputStream.available()];\n int bytesRead;\n ByteArrayOutputStream output = new ByteArrayOutputStream();\n while ((bytesRead = inputStream.read(buffer)) != -1) {\n output.write(buffer, 0, bytesRead);\n }\n graphDef = output.toByteArray();\n } catch (IOException e) {\n e.printStackTrace();\n }\n graph.importGraphDef(graphDef);\n try {\n sess.runner().feed(\"save/Const\", checkpointPrefix).addTarget(\"save/restore_all\").run();\n Toast.makeText(this, \"Checkpoint Found and Loaded!\", Toast.LENGTH_SHORT).show();\n }\n catch (Exception e) {\n sess.runner().addTarget(\"init\").run();\n Log.i(\"Checkpoint: \", \"Graph Initialized\");\n }\n }", "@MediumTest\n public void test_1314_2() throws Exception {\n String imagePath = Environment.getExternalStorageDirectory()+\"/LeCoder_Image/statement_without_prev.png\";\n //Load the file and process it\n activity.loadImageFile(imagePath);\n activity.processImage();\n //Generate the nodes and construct the graph\n activity.generateNodes();\n activity.generateGraph();\n //Print all nodes\n activity.printAllNodes();\n //Check whether the flowchart has no start point\n assertFalse(activity.checkAllNodes());\n }", "public static void main(String[] args) throws IOException{\n \n int cells = 16;\n MnistManager mm = new MnistManager(Config.MNIST_TRAIN_IMAGES, Config.MNIST_TRAIN_LABELS);\n \n // Grab first image\n mm.setCurrent(1);\n int[][] image = mm.readPixelMatrix();\n BufferedImage bimg = mm.readImage();\n \n ImageHelper.printImage(mm.readImage(), \"llf_test.png\");\n System.out.println(\"The number is: \" + mm.readLabel());\n \n // Make sure the cell size is correct -> 7 pixels\n int cellSize = image.length / (int)Math.sqrt(cells);\n System.out.println(\"The size of the cells are \" + cellSize + \" pixels\");\n \n // Check that the cell iteration is correct\n for(int i = 0; i < image.length; i += cellSize) {\n for(int j = 0; j < image[0].length; j += cellSize) {\n String info = \"Top left X: \"+i+\" Y: \"+j+\" Bottom right X: \"+(i + cellSize)+\" Y: \"+(j + cellSize);\n System.out.println(info);\n double b = slope(i, j, cellSize, image);\n System.out.println(b);\n System.out.println(\"\\n\\n\");\n }\n }\n }", "@Test\n public void testRun() {\n System.out.println(\"run\");\n FluorescenceImporter importer = null;\n try {\n FluorescenceFixture tf = new FluorescenceFixture();\n importer = new FluorescenceImporter(tf.testData());\n ProgressHandle ph = ProgressHandleFactory.createHandle(\"Importing dataset\");\n importer.setProgressHandle(ph);\n \n importer.run();\n } catch (IOException ex) {\n Exceptions.printStackTrace(ex);\n }\n \n //FluorescenceDataset dataset = importer.getDataset();\n Dataset<? extends Instance> plate = importer.getDataset();\n System.out.println(\"inst A1 \"+ plate.instance(0).toString());\n System.out.println(\"plate \"+plate.toString());\n Dataset<Instance> output = new SampleDataset<Instance>();\n output.setParent((Dataset<Instance>) plate);\n ProgressHandle ph = ProgressHandleFactory.createHandle(\"Analyzing dataset\");\n // AnalyzeRunner instance = new AnalyzeRunner((Timeseries<ContinuousInstance>) plate, output, ph);\n // instance.run();\n \n }", "@Test\n public void testCase1() {\n File base = new File(DIR, \"case1\");\n File pl0 = new File(base, \"pl0/EASy\");\n File pl1 = new File(base, \"pl1/EASy\");\n try {\n Location pl0Loc = VarModel.INSTANCE.locations().addLocation(pl0, OBSERVER);\n Location pl1Loc = VarModel.INSTANCE.locations().addLocation(pl1, OBSERVER);\n // add Parent\n pl1Loc.addDependentLocation(pl0Loc);\n \n VarModel.INSTANCE.loaders().registerLoader(ModelUtility.INSTANCE, OBSERVER);\n \n List<ModelInfo<Project>> infos = VarModel.INSTANCE.availableModels().getModelInfo(\"pl1\");\n Assert.assertNotNull(infos);\n Assert.assertTrue(1 == infos.size());\n Project project = VarModel.INSTANCE.load(infos.get(0));\n Assert.assertNotNull(project);\n \n VarModel.INSTANCE.locations().removeLocation(pl1Loc, OBSERVER);\n VarModel.INSTANCE.locations().removeLocation(pl0Loc, OBSERVER);\n VarModel.INSTANCE.loaders().unregisterLoader(ModelUtility.INSTANCE, OBSERVER);\n } catch (ModelManagementException e) {\n Assert.fail(\"unexpected exception \" + e);\n }\n }", "@Test(timeout = 4000)\n public void test105() throws Throwable {\n TextDirectoryLoader textDirectoryLoader0 = new TextDirectoryLoader();\n Instances instances0 = textDirectoryLoader0.getStructure();\n Evaluation evaluation0 = new Evaluation(instances0);\n evaluation0.setDiscardPredictions(true);\n assertTrue(evaluation0.getDiscardPredictions());\n }", "@Test\n\tpublic void testLoad3() {\n\t\ttry {\n\t\t\tSubtitleSeq seq = SubtitleSeqFactory.loadSubtitleSeq(\"src/sample3Load.srt\");\n\t\t\tassertNull(\"incorrect file format\", seq);\n\n\t\t} catch (Exception e) {\n\t\t\te.printStackTrace();\n\t\t}\n\t}", "public static void main(String[] args) \n\t{\n\t\t// Konfiguration\n\t\tTraining training = new Training();\n\t\tint numberOfAttributes = 18;\n\t\tStatisticOutput statisticWriter = new StatisticOutput(\"data/statistics.txt\");\n\t\t\n\t\ttraining.printMessage(\"*** TCR-Predictor: Training ***\");\n\t\t\n\t\ttraining.printMessage(\"Datenbank von Aminosäure-Codierungen wird eingelesen\");\n\t\t// Lies die EncodingDB ein\n\t\tAAEncodingFileReader aa = new AAEncodingFileReader();\n\t\tAAEncodingDatabase db = aa.readAAEncodings(\"data/AAEncodings.txt\");\n\t\ttraining.printMessage(\"Es wurden \" + db.getEncodingDatabase().size() + \" Codierungen einglesen\");\n\t\t\n\t\ttraining.printMessage(\"Trainingsdatensatz wird eingelesen und prozessiert\");\n\t\t// Lies zunächst die gesamten Trainingsdaten ein\n\t\tExampleReader exampleReader = new ExampleReader();\n\t\t\n\t\t// Spalte das Datenset\n\t\tDataSplit dataSplit_positives = new DataSplit(exampleReader.getSequnces(\"data/positive.txt\"), 5);\n\t\tArrayList<ArrayList<String>> complete_list_positiv = dataSplit_positives.getDataSet();\n\t\t\n\t\tDataSplit dataSplit_negatives = new DataSplit(exampleReader.getSequnces(\"data/negative.txt\"), 5);\n\t\tArrayList<ArrayList<String>> complete_list_negativ = dataSplit_negatives.getDataSet();\n\t\t\n\t\t// Lege Listen für die besten Klassifizierer und deren Evaluation an\n\t\tModelCollection modelCollection = new ModelCollection();\n\t\t\n\t\t/*\n\t\t * \n\t\t * Beginne Feature Selection\n\t\t * \n\t\t */\n\t\tArrayList<String> positivesForFeatureSelection = training.concatenateLists(complete_list_positiv);\n\t\tArrayList<String> negativesForFeatureSelection = training.concatenateLists(complete_list_negativ);\n\t\t\n\t\ttraining.printMessage(\"Convertiere Daten ins Weka ARFF Format\");\t\t\n\t\t// Convertiere Daten in Wekas File Format\n\t\tARFFFileGenerator arff = new ARFFFileGenerator();\n\t\tInstances dataSet = arff.createARFFFile(positivesForFeatureSelection, negativesForFeatureSelection, db.getEncodingDatabase());\n\t\tdataSet.setClass(dataSet.attribute(\"activator\"));\t\t\t// Lege das nominale Attribut fest, wonach klassifiziert wird\n\t\tdataSet.deleteStringAttributes(); \t\t\t\t\t\t\t// Entferne String-Attribute\n\t\t\n\t\ttraining.printMessage(\"Führe Feature Selection (Filtering) aus\");\n\t\t// Beginne Feature Selection\n\t\tFeatureFilter featureFilter = new FeatureFilter();\n\t\tfeatureFilter.rankFeatures(dataSet, numberOfAttributes);\t\t\t\t\t// Wähle die x wichtigsten Features aus\n\t\tdataSet = featureFilter.getProcessedInstances();\n\t\ttraining.printMessage(\"Ausgewählte Features: \" + featureFilter.getTopResults());\n\n\t\t/*\n\t\t * Führe die äußere Evaluierung fünfmal durch und wähle das beste Modell\n\t\t */\n\t\tfor (int outer_run = 0; outer_run < 5; outer_run++)\n\t\t{\n\t\t\tstatisticWriter.writeString(\"===== Äußere Evaluation \" + (outer_run + 1) + \"/5 =====\\n\\n\");\n\t\t\t\n\t\t\t\n\t\t\tArrayList<ArrayList<String>> list_positives = new ArrayList<ArrayList<String>>();\n\t\t\tlist_positives.addAll(complete_list_positiv);\n\t\t\t\n\t\t\tArrayList<ArrayList<String>> list_negatives = new ArrayList<ArrayList<String>>();\n\t\t\tlist_negatives.addAll(complete_list_negativ);\n\t\t\t\n\t\t\t// Lege das erste Fragment beider Listen für nasted-Crossvalidation beiseite\n\t\t\tArrayList<String> outer_List_pos = new ArrayList<String>();\n\t\t\touter_List_pos.addAll(list_positives.get(outer_run));\n\t\t\tlist_positives.remove(outer_run);\n\t\t\t\n\t\t\tArrayList<String> outer_List_neg = new ArrayList<String>();\n\t\t\touter_List_neg.addAll(list_negatives.get(outer_run));\n\t\t\tlist_negatives.remove(outer_run);\n\t\t\t\n\t\t\t// Füge die verbleibende Liste zu einer Zusammen\n\t\t\tArrayList<String> inner_List_pos = training.concatenateLists(list_positives);\n\t\t\tArrayList<String> inner_List_neg = training.concatenateLists(list_negatives);\n\t\t\t\t\n\n\t\t\t/*\n\t\t\t * \n\t\t\t * Ab hier nur noch Arbeiten mit innerer Liste, die Daten zum Evaluieren bekommt Weka vorerst \n\t\t\t * nicht zu sehen!\n\t\t\t * \n\t\t\t */\n\t\t\ttraining.printMessage(\"Convertiere Daten ins Weka ARFF Format\");\t\t\n\t\t\t// Convertiere Daten in Wekas File Format\n\t\t\tarff = new ARFFFileGenerator();\n\t\t\tdataSet = arff.createARFFFile(inner_List_pos, inner_List_neg, db.getEncodingDatabase());\n\t\t\tdataSet.setClass(dataSet.attribute(\"activator\"));\t\t\t// Lege das nominale Attribut fest, wonach klassifiziert wird\n\t\t\tdataSet.deleteStringAttributes(); \t\t\t\t\t\t\t// Entferne String-Attribute\n\t\t\t\n\t\t\tfeatureFilter.processInstances(featureFilter.getRanking(), dataSet, numberOfAttributes); // Filtere das innere Datenset nach Vorgabe\n\t\t\tdataSet = featureFilter.getProcessedInstances();\n\t\t\t\n\t\t\ttraining.printMessage(\"Beginne Gridsearch\");\n\t\t\t// Gridsearch starten\n\t\n\t\t\t\n\t\t\t\n\t\t\tParameterOptimization optimizer = new ParameterOptimization();\n\t\t\tString logFileName = outer_run + \"_\" + numberOfAttributes;\n\t\t\tGridSearch gridSearch = optimizer.performGridSearch(dataSet, logFileName);\n\t\t\ttraining.printMessage(\"Gefundene Parameter [C, gamma]: \" + gridSearch.getValues()); // liefert unter diesen Settings 1.0 und 0.0\n\n\t\t\tSMO sMO = (SMO)gridSearch.getBestClassifier();\n\t\t\t\t\t\t\t\n\t\t\t/*\n\t\t\t * \n\t\t\t * Evaluationsbeginn \n\t\t\t *\n\t\t\t */\n\t\t\ttraining.printMessage(\"Evaluiere die Performance gegen das äußere Datenset\");\n\t\t\ttraining.printMessage(\"Transcodierung des Evaluationsdatensatzes\");\n\t\t\tarff = new ARFFFileGenerator();\n\t\t\tdataSet = arff.createARFFFile(outer_List_pos, outer_List_neg, db.getEncodingDatabase());\n\t\t\tdataSet.setClass(dataSet.attribute(\"activator\"));\t\t\t// Lege das nominale Attribut fest, wonach klassifiziert wird\n\t\t\tdataSet.deleteStringAttributes(); \t\t\t\t\t\t\t// Entferne String-Attribute\n\t\t\t\n\t\t\t// Führe Feature-Filtering mit den Einstellungen der GridSearch aus\n\t\t\ttraining.printMessage(\"Führe Feature Selection (Filtering) auf GridSearch-Basis aus\");\n\t\t\t// Beginne Feature Selection\n\t\t\tfeatureFilter.processInstances(featureFilter.getRanking(), dataSet, numberOfAttributes);\t // Wähle die x wichtigsten Features aus\n\t\t\tdataSet = featureFilter.getProcessedInstances();\n\t\t\t\n\t\t\t\n\t\t\t\n\t\t\ttraining.printMessage(\"Ermittle Performance\");\n\t\t\tEvaluator eval = new Evaluator();\n\t\t\teval.classifyDataSet(sMO, dataSet);\n\t\t\ttraining.printMessage(eval.printRawData());\n\t\t\t\n\t\t\t/*\n\t\t\t * Füge das Modell und die externe Evaulation zur Sammlung hinzu\n\t\t\t */\t\t\t\n\t\t\tmodelCollection.bestClassifiers.add(sMO);\n\t\t\tmodelCollection.evalsOfBestClassifiers.add(eval);\n\t\t\tmodelCollection.listOfNumberOfAttributes.add(numberOfAttributes);\n\t\t\tmodelCollection.listOfFeatureFilters.add(featureFilter);\n\t\t\t\n\t\t\tstatisticWriter.writeString(\"Verwendete Attribute: \" + featureFilter.getTopResults());\n\t\t\tstatisticWriter.writeString(eval.printRawData());\n\t\t\t\n\t\t}\n\t\tstatisticWriter.close();\n\t\t\n\t\t// Wähle das beste aller Modelle aus\n\t\ttraining.printMessage(\"Ermittle die allgemein besten Einstellungen\");\n\t\tModelSelection modelSelection = new ModelSelection();\n\t\tmodelSelection.calculateBestModel(modelCollection);\n\t\t\n\t\ttraining.printMessage(\"Das beste Model: \");\n\t\ttraining.printMessage(modelSelection.getBestEvaluator().printRawData());\n\t\tSystem.out.println(\"------ SMO ------\");\n\t\tfor (int i = 0; i < modelSelection.getBestClassifier().getOptions().length; i++)\n\t\t{\n\t\t\tSystem.out.print(modelSelection.getBestClassifier().getOptions()[i] + \" \");\n\t\t}\n\t\tSystem.out.println(\"\\n--- Features ---\");\n\t\tSystem.out.println(modelSelection.getBestListOfFeatures().getTopResults());\n\t\t\n\t\t// Schreibe das Modell in eine Datei\n\t\ttraining.printMessage(\"Das beste Modell wird auf Festplatte geschrieben\");\n\t\ttry\n\t\t{\n\t\t\tSerializationHelper.write(\"data/bestPredictor.model\", modelSelection.getBestClassifier());\n\t\t\tSerializationHelper.write(\"data/ranking.filter\", modelSelection.getBestListOfFeatures().getRanking());\n\t\t\tSerializationHelper.write(\"data/components.i\", (modelSelection.getBestListOfFeatures().getProcessedInstances().numAttributes()-1));\n\t\t}\n\t\tcatch (Exception ex)\n\t\t{\n\t\t\tSystem.err.println(\"Fehler beim Schreiben des Modells auf Festplatte: \" + ex);\n\t\t}\n\t}", "@Test\n public void testExample3() {\n assertSolution(\"-6\", \"example-day01-2018-3.txt\");\n }", "public static void main(String[] args) {\n\t\tSparkConf conf = new SparkConf().setAppName(\"NB\").setMaster(\"local[*]\").set(\"spark.ui.port\",\"4040\");;\n\t JavaSparkContext jsc = new JavaSparkContext(conf);\n\t\tString path = \"localpath\";\n\t\tJavaRDD<LabeledPoint> inputData = MLUtils.loadLabeledPoints(jsc.sc(), path).toJavaRDD();\n\t\tJavaRDD<LabeledPoint>[] tmp = inputData.randomSplit(new double[]{0.6, 0.4});\n\t\tJavaRDD<LabeledPoint> training = tmp[0]; // training set\n\t\tJavaRDD<LabeledPoint> test = tmp[1]; // test set\n\t\tNaiveBayesModel model = NaiveBayes.train(training.rdd(), 1.0);\n\t\tJavaPairRDD<Double, Double> predictionAndLabel =\n\t\t test.mapToPair(p -> new Tuple2<>(model.predict(p.features()), p.label()));\n\t\t// Save and load model\n\t\tmodel.save(jsc.sc(), \"localotuput_path\");\n\t\tNaiveBayesModel sameModel = NaiveBayesModel.load(jsc.sc(), \"localotuput_path\");\n\t\t\n\t\tdouble accuracy =\n\t\t\t\t predictionAndLabel.filter(pl -> pl._1().equals(pl._2())).count() / (double) test.count();\n\t\t\t\t\n\t\tSystem.out.println(\"The final accuracy is\"+accuracy);\n//\t\tpredictionAndLabel.foreach(data -> {\n//\t\t System.out.println(\"final model=\"+data._1() + \"final label=\" + data._2());\n//\t\t}); \n\t}", "public void train() throws Exception;", "@Test(timeout = 4000)\n public void test068() throws Throwable {\n TextDirectoryLoader textDirectoryLoader0 = new TextDirectoryLoader();\n Instances instances0 = textDirectoryLoader0.getStructure();\n Evaluation evaluation0 = new Evaluation(instances0);\n evaluation0.addNumericTrainClass(360, (-336.251));\n assertEquals(0.0, evaluation0.SFPriorEntropy(), 0.01);\n }", "public TestPrelab2()\n {\n }", "@Test\n public void test25() throws Throwable {\n try {\n CostMatrix costMatrix0 = Evaluation.handleCostOption(\" // can classifier handle the data?\\n\", (-1802));\n fail(\"Expecting exception: Exception\");\n \n } catch(Exception e) {\n //\n // Can't open file null.\n //\n }\n }", "@MediumTest\n public void test_1314_3() throws Exception {\n String imagePath = Environment.getExternalStorageDirectory()+\"/LeCoder_Image/if_without_false.png\";\n //Load the file and process it\n activity.loadImageFile(imagePath);\n activity.processImage();\n //Generate the nodes and construct the graph\n activity.generateNodes();\n activity.generateGraph();\n //Print all nodes\n activity.printAllNodes();\n //Check whether the flowchart has no start point\n assertFalse(activity.checkAllNodes());\n }", "@Test\n @Tag(\"bm1000\")\n public void testBORE3D() {\n CuteNetlibCase.doTest(\"BORE3D.SIF\", \"1373.0803942085367\", null, NumberContext.of(7, 4));\n }", "public void testParFileReading() {\n GUIManager oManager = null;\n String sFileName = null;\n try {\n\n oManager = new GUIManager(null);\n \n //Valid file 1\n oManager.clearCurrentData();\n sFileName = writeFile1();\n oManager.inputXMLParameterFile(sFileName);\n SeedPredationBehaviors oPredBeh = oManager.getSeedPredationBehaviors();\n ArrayList<Behavior> p_oBehs = oPredBeh.getBehaviorByParameterFileTag(\"DensDepRodentSeedPredation\");\n assertEquals(1, p_oBehs.size());\n DensDepRodentSeedPredation oPred = (DensDepRodentSeedPredation) p_oBehs.get(0);\n double SMALL_VAL = 0.00001;\n \n assertEquals(oPred.m_fDensDepDensDepCoeff.getValue(), 0.07, SMALL_VAL);\n assertEquals(oPred.m_fDensDepFuncRespExpA.getValue(), 0.02, SMALL_VAL);\n\n assertEquals( ( (Float) oPred.mp_fDensDepFuncRespSlope.getValue().get(0)).\n floatValue(), 0.9, SMALL_VAL);\n assertEquals( ( (Float) oPred.mp_fDensDepFuncRespSlope.getValue().get(1)).\n floatValue(), 0.05, SMALL_VAL);\n\n //Test grid setup\n assertEquals(1, oPred.getNumberOfGrids());\n Grid oGrid = oManager.getGridByName(\"Rodent Lambda\");\n assertEquals(1, oGrid.getDataMembers().length);\n assertTrue(-1 < oGrid.getFloatCode(\"rodent_lambda\")); \n \n }\n catch (ModelException oErr) {\n fail(\"Seed predation validation failed with message \" + oErr.getMessage());\n }\n catch (java.io.IOException oE) {\n fail(\"Caught IOException. Message: \" + oE.getMessage());\n }\n finally {\n new File(sFileName).delete();\n }\n }", "public static void main(String[] args) throws Exception {\n final int numRows = 28;\n final int numColumns = 28;\n int outputNum = 10; // number of output classes\n int batchSize = 128; // batch size for each epoch\n int rngSeed = 123; // random number seed for reproducibility\n int numEpochs = 15; // number of epochs to perform\n String modelPath = \"モデルパスを入力\";\n\n //Get the DataSetIterators:\n DataSetIterator mnistTrain = new MnistDataSetIterator(batchSize, true, rngSeed);\n DataSetIterator mnistTest = new MnistDataSetIterator(batchSize, false, rngSeed);\n\n\n System.out.println(\"Build model....\");\n MultiLayerConfiguration conf = new NeuralNetConfiguration.Builder()\n .seed(rngSeed) //include a random seed for reproducibility\n // use stochastic gradient descent as an optimization algorithm\n .updater(new Nesterovs(0.006, 0.9))\n .l2(1e-4)\n .list()\n .layer(new DenseLayer.Builder() //create the first, input layer with xavier initialization\n .nIn(numRows * numColumns)\n .nOut(1000)\n .activation(Activation.RELU)\n .weightInit(WeightInit.XAVIER)\n .build())\n .layer(new OutputLayer.Builder(LossFunctions.LossFunction.NEGATIVELOGLIKELIHOOD) //create hidden layer\n .nIn(1000)\n .nOut(outputNum)\n .activation(Activation.SOFTMAX)\n .weightInit(WeightInit.XAVIER)\n .build())\n .build();\n\n\n MultiLayerNetwork model = new MultiLayerNetwork(conf);\n model.init();\n //print the score with every 1 iteration\n UIServer uiServer = UIServer.getInstance();\n InMemoryStatsStorage statsStorage = new InMemoryStatsStorage();\n uiServer.attach(statsStorage);\n model.setListeners(new StatsListener(statsStorage),new ScoreIterationListener(1));\n\n System.out.println(\"Train model....\");\n model.fit(mnistTrain, numEpochs);\n\n\n\n\n System.out.println(\"Evaluate model....\");\n Evaluation eval = model.evaluate(mnistTest);\n System.out.println(eval.stats());\n ModelSerializer.writeModel(model, new File(modelPath), false);\n System.out.println(\"****************Example finished********************\");\n\n }", "static void feladat3() {\n\t}", "public void test33() {\n //$NON-NLS-1$\n deployBundles(\"test33\");\n IApiBaseline before = getBeforeState();\n IApiBaseline after = getAfterState();\n IApiComponent beforeApiComponent = before.getApiComponent(BUNDLE_NAME);\n //$NON-NLS-1$\n assertNotNull(\"no api component\", beforeApiComponent);\n IApiComponent afterApiComponent = after.getApiComponent(BUNDLE_NAME);\n //$NON-NLS-1$\n assertNotNull(\"no api component\", afterApiComponent);\n IDelta delta = ApiComparator.compare(beforeApiComponent, afterApiComponent, before, after, VisibilityModifiers.ALL_VISIBILITIES, null);\n //$NON-NLS-1$\n assertNotNull(\"No delta\", delta);\n IDelta[] allLeavesDeltas = collectLeaves(delta);\n //$NON-NLS-1$\n assertEquals(\"Wrong size\", 1, allLeavesDeltas.length);\n IDelta child = allLeavesDeltas[0];\n //$NON-NLS-1$\n assertEquals(\"Wrong kind\", IDelta.REMOVED, child.getKind());\n //$NON-NLS-1$\n assertEquals(\"Wrong flag\", IDelta.TYPE_ARGUMENT, child.getFlags());\n //$NON-NLS-1$\n assertEquals(\"Wrong element type\", IDelta.FIELD_ELEMENT_TYPE, child.getElementType());\n //$NON-NLS-1$\n assertFalse(\"Is compatible\", DeltaProcessor.isCompatible(child));\n }", "protected void init()\r\n\t{\n\t\tif (ConfigManager.getInstance().getIsCrossClassify() && WekaTool.dataStageOn)\r\n\t\t{\r\n\t\t\t//System.out.println(\"in init for data stage\");\r\n\t\t\tsrcDirUrl = ConfigManager.getInstance().getTrainPath();\r\n\t\t\tdestDirUrl = ConfigManager.getInstance().getTrainPath() +\r\n\t\t\t File.separator + \"output\";\r\n\t\t\t//System.out.println(\"srcDirUrl = \" + srcDirUrl);\r\n\t\t\t//System.out.println(\"destDirUrl = \" + destDirUrl);\r\n\t\t}\r\n\t\telse\r\n\t\t{\r\n\t\t\t//System.out.println(\"here, good\");\r\n\t\t\tsrcDirUrl = getSrcDirUrl();\r\n\t\t\tdestDirUrl = getDestDirUrl();\r\n\t\t}\r\n\t\tdatalibSVMUrl = getLibSVMDirUrl();\r\n\t\ttry {\r\n\t\t\tsrcDir = Utils.getDir(srcDirUrl);\r\n\t\t\tdestDir = Utils.getDir(destDirUrl);\r\n\t\t} catch (Exception e)\r\n\t\t{\r\n\t\t}\r\n\t}", "@Test\n public void test23() throws Throwable {\n TextDirectoryLoader textDirectoryLoader0 = new TextDirectoryLoader();\n Instances instances0 = textDirectoryLoader0.getDataSet();\n Evaluation evaluation0 = new Evaluation(instances0);\n SerializedClassifier serializedClassifier0 = new SerializedClassifier();\n Object[] objectArray0 = new Object[25];\n double[] doubleArray0 = evaluation0.evaluateModel((Classifier) serializedClassifier0, instances0, objectArray0);\n assertEquals(0.0, evaluation0.SFEntropyGain(), 0.01D);\n }", "public void evaluate(String sampleFile, String featureDefFile, int nFold, float tvs, String modelDir, String modelFile) {\n/* 854 */ List<List<RankList>> trainingData = new ArrayList<>();\n/* 855 */ List<List<RankList>> validationData = new ArrayList<>();\n/* 856 */ List<List<RankList>> testData = new ArrayList<>();\n/* */ \n/* */ \n/* */ \n/* 860 */ List<RankList> samples = readInput(sampleFile);\n/* */ \n/* */ \n/* 863 */ int[] features = readFeature(featureDefFile);\n/* 864 */ if (features == null) {\n/* 865 */ features = FeatureManager.getFeatureFromSampleVector(samples);\n/* */ }\n/* 867 */ FeatureManager.prepareCV(samples, nFold, tvs, trainingData, validationData, testData);\n/* */ \n/* */ \n/* 870 */ if (normalize)\n/* */ {\n/* 872 */ for (int j = 0; j < nFold; j++) {\n/* */ \n/* 874 */ normalizeAll(trainingData, features);\n/* 875 */ normalizeAll(validationData, features);\n/* 876 */ normalizeAll(testData, features);\n/* */ } \n/* */ }\n/* */ \n/* 880 */ Ranker ranker = null;\n/* 881 */ double scoreOnTrain = 0.0D;\n/* 882 */ double scoreOnTest = 0.0D;\n/* 883 */ double totalScoreOnTest = 0.0D;\n/* 884 */ int totalTestSampleSize = 0;\n/* */ \n/* 886 */ double[][] scores = new double[nFold][]; int i;\n/* 887 */ for (i = 0; i < nFold; i++) {\n/* 888 */ (new double[2])[0] = 0.0D; (new double[2])[1] = 0.0D; scores[i] = new double[2];\n/* 889 */ } for (i = 0; i < nFold; i++) {\n/* */ \n/* 891 */ List<RankList> train = trainingData.get(i);\n/* 892 */ List<RankList> vali = null;\n/* 893 */ if (tvs > 0.0F)\n/* 894 */ vali = validationData.get(i); \n/* 895 */ List<RankList> test = testData.get(i);\n/* */ \n/* 897 */ RankerTrainer trainer = new RankerTrainer();\n/* 898 */ ranker = trainer.train(this.type, train, vali, features, this.trainScorer);\n/* */ \n/* 900 */ double s2 = evaluate(ranker, test);\n/* 901 */ scoreOnTrain += ranker.getScoreOnTrainingData();\n/* 902 */ scoreOnTest += s2;\n/* 903 */ totalScoreOnTest += s2 * test.size();\n/* 904 */ totalTestSampleSize += test.size();\n/* */ \n/* */ \n/* 907 */ scores[i][0] = ranker.getScoreOnTrainingData();\n/* 908 */ scores[i][1] = s2;\n/* */ \n/* */ \n/* 911 */ if (!modelDir.isEmpty()) {\n/* */ \n/* 913 */ ranker.save(FileUtils.makePathStandard(modelDir) + \"f\" + (i + 1) + \".\" + modelFile);\n/* 914 */ System.out.println(\"Fold-\" + (i + 1) + \" model saved to: \" + modelFile);\n/* */ } \n/* */ } \n/* 917 */ System.out.println(\"Summary:\");\n/* 918 */ System.out.println(this.testScorer.name() + \"\\t| Train\\t| Test\");\n/* 919 */ System.out.println(\"----------------------------------\");\n/* 920 */ for (i = 0; i < nFold; i++)\n/* 921 */ System.out.println(\"Fold \" + (i + 1) + \"\\t| \" + SimpleMath.round(scores[i][0], 4) + \"\\t| \" + SimpleMath.round(scores[i][1], 4) + \"\\t\"); \n/* 922 */ System.out.println(\"----------------------------------\");\n/* 923 */ System.out.println(\"Avg.\\t| \" + SimpleMath.round(scoreOnTrain / nFold, 4) + \"\\t| \" + SimpleMath.round(scoreOnTest / nFold, 4) + \"\\t\");\n/* 924 */ System.out.println(\"----------------------------------\");\n/* 925 */ System.out.println(\"Total\\t| \\t\\t| \" + SimpleMath.round(totalScoreOnTest / totalTestSampleSize, 4) + \"\\t\");\n/* */ }", "@Test\n\tpublic void testPhase3(){\n\t\tSystem.out.println(\"Array test\");\n\t\tParseDriver driver = new ParseDriver(\"resources/pascal_files/array.pas\");\n\t\tdriver.run();\n\t\tSystem.out.println();\n\t\tSystem.out.println(\"Array Ref test\");\n\t\tdriver = new ParseDriver(\"resources/pascal_files/arrayref.pas\");\n\t\tdriver.run();\n\t\t\n\t\tSystem.out.println();\n\t\tSystem.out.println(\"If2 test\");\n\t\tdriver = new ParseDriver(\"resources/pascal_files/if2.pas\");\n\t\tdriver.run();\n\t}", "@Test\n\tpublic void testCollectTrainingConfig() {\n\t\t\n\t\tLearningSystemInfo lsi = new LearningSystemInfo(\n\t\t\t\tnew BenchmarkConfig(runtimeConfig), \"aleph\", fileFinder);\n\t\tFileFinder alephFileFinder = fileFinder.updateLearningSytemInfo(lsi);\n\t\tAbsoluteStep step = new AbsoluteStep(scenario, lsi, examples,\n\t\t\t\truntimeConfig, alephFileFinder, log);\n\t\t\n\t\tConfiguration collectedConfig = step.collectTrainingConfig(runtimeConfig);\n\t\t\n\t\t/*\n\t\t * Check general config part: workdir, pos, neg, output, learningtask,\n\t\t * learningproblem, step\n\t\t */\n\t\tHashSet<String> expectedKeys = Sets.newHashSet(\n\t\t\t\tConstants.WORKDIR_KEY,\n\t\t\t\tConstants.POS_EXAMPLE_FILE_KEY,\n\t\t\t\tConstants.NEG_EXAMPLE_FILE_KEY,\n\t\t\t\tConstants.OUTPUT_FILE_KEY,\n\t\t\t\tConstants.LEARNING_TASK_KEY,\n\t\t\t\tConstants.LEARNING_PROBLEM_KEY,\n\t\t\t\tConstants.STEP_KEY);\n\t\tint expectedNumberOfLSSpecificSettings = 1;\n\t\t\n\t\tassertEquals(\n\t\t\t\texpectedKeys.size() + expectedNumberOfLSSpecificSettings,\n\t\t\t\tcollectedConfig.size());\n\t\t\n\t\tHashSet<String> testKeys = Sets.newHashSet(collectedConfig.getKeys());\n\t\tfor (String key : expectedKeys) {\n\t\t\tassertTrue(testKeys.contains(key));\n\t\t}\n\t\t\n\t\tassertEquals(scenario.getTask(),\n\t\t\t\tcollectedConfig.getString(Constants.LEARNING_TASK_KEY));\n\t\tassertEquals(scenario.getProblem(),\n\t\t\t\tcollectedConfig.getString(Constants.LEARNING_PROBLEM_KEY));\n\t\tassertEquals(Constants.STEP_TRAIN,\n\t\t\t\tcollectedConfig.getString(Constants.STEP_KEY));\n\t\t\n\t\t// Test learning system-specific settings\n\t\tassertEquals(expectedNumberOfLSSpecificSettings,\n\t\t\t\tcollectedConfig.subset(Constants.LS_SPECIFIC_SETTINGS_KEY).size());\n\t\tMap<String,Object> expectedSettings = new HashMap<>();\n\t\texpectedSettings.put(Constants.LS_SPECIFIC_SETTINGS_KEY + \".caching\", \"ON\");\n\n\t\tIterator<String> keysIt = collectedConfig.getKeys(Constants.LS_SPECIFIC_SETTINGS_KEY);\n\t\tString key;\n\t\tObject value;\n\t\twhile (keysIt.hasNext()) {\n\t\t\tkey = keysIt.next();\n\t\t\tvalue = collectedConfig.get(Object.class, key);\n\t\t\tassertTrue(expectedSettings.containsKey(key));\n\t\t\tassertEquals(expectedSettings.get(key), value);\n\t\t}\n\t\t\n\t\t/*\n\t\t * dllearner\n\t\t * \n\t\t * settings.lp.type = \"posnegstandard\"\n\t\t */\n\t\tlsi = new LearningSystemInfo(new BenchmarkConfig(runtimeConfig), \"dllearner\", fileFinder);\n\t\tFileFinder dllearnerFileFinder = fileFinder.updateLearningSytemInfo(lsi);\n\t\tstep = new AbsoluteStep(scenario, lsi, examples, runtimeConfig, dllearnerFileFinder, log);\n\t\tcollectedConfig = step.collectTrainingConfig(runtimeConfig);\n\t\t\n\t\t// Test general config part\n\t\texpectedNumberOfLSSpecificSettings = 1;\n\t\tassertEquals(\n\t\t\t\texpectedKeys.size() + expectedNumberOfLSSpecificSettings,\n\t\t\t\tcollectedConfig.size());\n\t\t\n\t\ttestKeys = Sets.newHashSet(collectedConfig.getKeys());\n\t\tfor (String k : expectedKeys) {\n\t\t\tassertTrue(testKeys.contains(k));\n\t\t}\n\t\t\n\t\tassertEquals(scenario.getTask(),\n\t\t\t\tcollectedConfig.getString(Constants.LEARNING_TASK_KEY));\n\t\tassertEquals(scenario.getProblem(),\n\t\t\t\tcollectedConfig.getString(Constants.LEARNING_PROBLEM_KEY));\n\t\tassertEquals(Constants.STEP_TRAIN,\n\t\t\t\tcollectedConfig.getString(Constants.STEP_KEY));\n\t\t\n\t\t// Test learning system-specific settings\n\t\tassertEquals(\n\t\t\t\texpectedNumberOfLSSpecificSettings,\n\t\t\t\tcollectedConfig.subset(Constants.LS_SPECIFIC_SETTINGS_KEY).size());\n\t\texpectedSettings = new HashMap<>();\n\t\texpectedSettings.put(\n\t\t\t\tConstants.LS_SPECIFIC_SETTINGS_KEY + \".lp.type\", \"posnegstandard\");\n\n\t\tkeysIt = collectedConfig.getKeys(Constants.LS_SPECIFIC_SETTINGS_KEY);\n\t\twhile (keysIt.hasNext()) {\n\t\t\tkey = keysIt.next();\n\t\t\tvalue = collectedConfig.get(Object.class, key);\n\t\t\tassertTrue(expectedSettings.containsKey(key));\n\t\t\tassertEquals(expectedSettings.get(key), value);\n\t\t}\n\t\t\n\t\t/*\n\t\t * dllearner-1\n\t\t * \n\t\t * settings.algorithm.type = celoe\n\t\t * settings.algorithm.maxClassExpressionTests = 54321\n\t\t * settings.lp.type = \"posnegstandard\"\n\t\t */\n\t\tlsi = new LearningSystemInfo(new BenchmarkConfig(runtimeConfig), \"dllearner-1\", fileFinder);\n\t\tFileFinder dllearnerFileFinder1 = fileFinder.updateLearningSytemInfo(lsi);\n\t\tstep = new AbsoluteStep(scenario, lsi, examples, runtimeConfig, dllearnerFileFinder1, log);\n\t\tcollectedConfig = step.collectTrainingConfig(runtimeConfig);\n\t\t\n\t\t// Test general config part\n\t\texpectedNumberOfLSSpecificSettings = 3;\n\t\tassertEquals(\n\t\t\t\texpectedKeys.size() + expectedNumberOfLSSpecificSettings,\n\t\t\t\tcollectedConfig.size());\n\t\t\n\t\ttestKeys = Sets.newHashSet(collectedConfig.getKeys());\n\t\tfor (String k : expectedKeys) {\n\t\t\tassertTrue(testKeys.contains(k));\n\t\t}\n\t\t\n\t\tassertEquals(scenario.getTask(),\n\t\t\t\tcollectedConfig.getString(Constants.LEARNING_TASK_KEY));\n\t\tassertEquals(scenario.getProblem(),\n\t\t\t\tcollectedConfig.getString(Constants.LEARNING_PROBLEM_KEY));\n\t\tassertEquals(Constants.STEP_TRAIN,\n\t\t\t\tcollectedConfig.getString(Constants.STEP_KEY));\n\t\t\n\t\t// Test learning system-specific settings\n\t\tassertEquals(\n\t\t\t\texpectedNumberOfLSSpecificSettings,\n\t\t\t\tcollectedConfig.subset(Constants.LS_SPECIFIC_SETTINGS_KEY).size());\n\t\t\n\t\texpectedSettings = new HashMap<>();\n\t\texpectedSettings.put(\n\t\t\t\tConstants.LS_SPECIFIC_SETTINGS_KEY + \".algorithm.type\", \"celoe\");\n\t\texpectedSettings.put(\n\t\t\t\tConstants.LS_SPECIFIC_SETTINGS_KEY + \".algorithm.maxClassExpressionTests\",\n\t\t\t\t\"54321\");\n\t\texpectedSettings.put(\n\t\t\t\tConstants.LS_SPECIFIC_SETTINGS_KEY + \".lp.type\", \"posnegstandard\");\n\n\t\tkeysIt = collectedConfig.getKeys(Constants.LS_SPECIFIC_SETTINGS_KEY);\n\t\twhile (keysIt.hasNext()) {\n\t\t\tkey = keysIt.next();\n\t\t\tvalue = collectedConfig.get(Object.class, key);\n\t\t\tassertTrue(expectedSettings.containsKey(key));\n\t\t\tassertEquals(expectedSettings.get(key), value);\n\t\t}\n\t\t\n\t\t/*\n\t\t * dllearner-2\n\t\t * \n\t\t * settings.algorithm.type = ocel\n\t\t * settings.algorithm.maxExecutionTimeInSeconds = 63\n\t\t * settings.lp.type = \"posnegstandard\"\n\t\t */\n\t\tlsi = new LearningSystemInfo(\n\t\t\t\tnew BenchmarkConfig(runtimeConfig), \"dllearner-2\", fileFinder);\n\t\t\n\t\tFileFinder dllearnerFileFinder2 = fileFinder.updateLearningSytemInfo(lsi);\n\t\tstep = new AbsoluteStep(\n\t\t\t\tscenario, lsi, examples, runtimeConfig, dllearnerFileFinder2, log);\n\t\t\n\t\tcollectedConfig = step.collectTrainingConfig(runtimeConfig);\n\t\t\n\t\t// Test general config part\n\t\texpectedNumberOfLSSpecificSettings = 3;\n\t\tassertEquals(\n\t\t\t\texpectedKeys.size() + expectedNumberOfLSSpecificSettings,\n\t\t\t\tcollectedConfig.size());\n\t\t\n\t\ttestKeys = Sets.newHashSet(collectedConfig.getKeys());\n\t\tfor (String k : expectedKeys) {\n\t\t\tassertTrue(testKeys.contains(k));\n\t\t}\n\t\t\n\t\tassertEquals(scenario.getTask(),\n\t\t\t\tcollectedConfig.getString(Constants.LEARNING_TASK_KEY));\n\t\tassertEquals(scenario.getProblem(),\n\t\t\t\tcollectedConfig.getString(Constants.LEARNING_PROBLEM_KEY));\n\t\tassertEquals(Constants.STEP_TRAIN,\n\t\t\t\tcollectedConfig.getString(Constants.STEP_KEY));\n\t\t\n\t\t// Test learning system-specific settings\n\t\tassertEquals(\n\t\t\t\texpectedNumberOfLSSpecificSettings,\n\t\t\t\tcollectedConfig.subset(Constants.LS_SPECIFIC_SETTINGS_KEY).size());\n\t\t\n\t\texpectedSettings = new HashMap<>();\n\t\texpectedSettings.put(\n\t\t\t\tConstants.LS_SPECIFIC_SETTINGS_KEY + \".algorithm.type\", \"ocel\");\n\t\texpectedSettings.put(\n\t\t\t\tConstants.LS_SPECIFIC_SETTINGS_KEY + \".algorithm.maxExecutionTimeInSeconds\",\n\t\t\t\t\"63\");\n\t\texpectedSettings.put(\n\t\t\t\tConstants.LS_SPECIFIC_SETTINGS_KEY + \".lp.type\", \"posnegstandard\");\n\n\t\tkeysIt = collectedConfig.getKeys(Constants.LS_SPECIFIC_SETTINGS_KEY);\n\t\twhile (keysIt.hasNext()) {\n\t\t\tkey = keysIt.next();\n\t\t\tvalue = collectedConfig.get(Object.class, key);\n\t\t\tassertTrue(expectedSettings.containsKey(key));\n\t\t\tassertEquals(expectedSettings.get(key), value);\n\t\t}\n\t\t\n\t\t/*\n\t\t * progol\n\t\t * \n\t\t * <no learning problem-specific settings>\n\t\t */\n\t\tlsi = new LearningSystemInfo(new BenchmarkConfig(runtimeConfig), \"progol\", fileFinder);\n\t\tFileFinder progolFileFinder2 = fileFinder.updateLearningSytemInfo(lsi);\n\t\tstep = new AbsoluteStep(scenario, lsi, examples, runtimeConfig, progolFileFinder2, log);\n\t\tcollectedConfig = step.collectTrainingConfig(runtimeConfig);\n\t\t\n\t\t// Test general config part\n\t\texpectedNumberOfLSSpecificSettings = 0;\n\t\tassertEquals(\n\t\t\t\texpectedKeys.size() + expectedNumberOfLSSpecificSettings,\n\t\t\t\tcollectedConfig.size());\n\t\t\n\t\ttestKeys = Sets.newHashSet(collectedConfig.getKeys());\n\t\tfor (String k : expectedKeys) {\n\t\t\tassertTrue(testKeys.contains(k));\n\t\t}\n\t\t\n\t\tassertEquals(scenario.getTask(),\n\t\t\t\tcollectedConfig.getString(Constants.LEARNING_TASK_KEY));\n\t\tassertEquals(scenario.getProblem(),\n\t\t\t\tcollectedConfig.getString(Constants.LEARNING_PROBLEM_KEY));\n\t\tassertEquals(Constants.STEP_TRAIN,\n\t\t\t\tcollectedConfig.getString(Constants.STEP_KEY));\n\t\t\n\t\t// Test learning system-specific settings\n\t\tassertEquals(\n\t\t\t\texpectedNumberOfLSSpecificSettings,\n\t\t\t\tcollectedConfig.subset(Constants.LS_SPECIFIC_SETTINGS_KEY).size());\n\t}", "@Test(timeout = 4000)\n public void test020() throws Throwable {\n TextDirectoryLoader textDirectoryLoader0 = new TextDirectoryLoader();\n Instances instances0 = textDirectoryLoader0.getDataSet();\n Evaluation evaluation0 = new Evaluation(instances0);\n String string0 = evaluation0.toSummaryString(\".arff\", true);\n assertEquals(0.0, evaluation0.unclassified(), 0.01);\n assertEquals(\".arff\\nTotal Number of Instances 0 \\n\", string0);\n assertEquals(0.0, evaluation0.SFEntropyGain(), 0.01);\n }", "public static void main(String args[]) throws IOException{\n\t\t\n\t\t\n\t\tfor (int fold = 0; fold<10; fold++) {\n\t\t\t//triples_result(\"holders_\"+fold, \"test_holders_\"+fold+\"_result\"); //file, result_file\n\t\t\t//sentence_triples_word(\"holders_\"+fold, \"holders_gold_\"+fold, 0, \"holders_\"+fold); //crf_output\n\t\t\t\n\t\t\ttriples_result(\"holders_full_t_\"+fold, \"test_holders_t_\"+fold+\"_result\"); //file, result_file\n\t\t\tsentence_triples_hard_word(\"holders_\"+fold, \"holders_gold_\"+fold, 0, \"holders_t_\"+fold); //crf_output\n\n\t\t\t\n\t\t\tholder_triples = new LinkedList<Triples>();\n\t\t\tholder_prob = new LinkedList<Double>();\n\t\t\tgold_holders = new HashMap<String, Entries>();\n\n\t\t}\n\t\t\n\n\t\t\n\t\tfor (int fold = 0; fold<10; fold++) {\n\t\t\ttriples_result(\"targets_full_t_\"+fold, \"test_targets_t_\"+fold+\"_result\"); //file, result_file\n\t\t\tsentence_triples_hard_word(\"targets_\"+fold, \"targets_gold_\"+fold, 0, \"targets_t_\"+fold); //crf_output\n\t\t\t\n\t\t\tholder_triples = new LinkedList<Triples>();\n\t\t\tholder_prob = new LinkedList<Double>();\n\t\t\tgold_holders = new HashMap<String, Entries>();\n\n\t\t}\n\n\t\t\n\n\t\t\n\t\t//triples_result(\"targets_0\", \"test_targets_0_result\"); //file, result_file\n\t\t//sentence_triples_word(\"targets_0\", \"targets_gold_0\", 0, \"targets_0\"); //crf_output\n\t\t\n\t\t//triples_result(\"targets_1\", \"test_targets_1_result\"); //file, result_file\n\t\t//sentence_triples_word(\"targets_1\", \"targets_gold_1\", 1, \"targets_1\"); //crf_output\n\t}", "@Test(timeout = 4000)\n public void test091() throws Throwable {\n TextDirectoryLoader textDirectoryLoader0 = new TextDirectoryLoader();\n Instances instances0 = textDirectoryLoader0.getDataSet();\n Evaluation evaluation0 = new Evaluation(instances0);\n BinarySparseInstance binarySparseInstance0 = new BinarySparseInstance(11);\n IBk iBk0 = new IBk();\n try { \n evaluation0.evaluationForSingleInstance((Classifier) iBk0, (Instance) binarySparseInstance0, true);\n fail(\"Expecting exception: RuntimeException\");\n \n } catch(RuntimeException e) {\n //\n // DenseInstance doesn't have access to a dataset!\n //\n verifyException(\"weka.core.AbstractInstance\", e);\n }\n }", "@Test\n public void testOutputNTBc2GmTrainingData() throws IOException {\n testSameAsOriginalOutput(\"genia-nt.bc2gm-training.in\", \"genia-nt.bc2gm-training.out\", \"-nt\");\n }", "@Override\n\tpublic void lab() {\n\t\t\n\t}", "public void testPAUMChunkLearnng() throws IOException, GateException {\n // Initialisation\n System.out.print(\"Testing the PAUM method on chunk learning...\");\n File chunklearningHome = new File(new File(learningHome, \"test\"),\n \"chunklearning\");\n String configFileURL = new File(chunklearningHome,\n \"engines-paum.xml\").getAbsolutePath();\n String corpusDirName = new File(chunklearningHome, \"data-ontonews\")\n .getAbsolutePath();\n //Remove the label list file, feature list file and chunk length files.\n String wdResults = new File(chunklearningHome,\n ConstantParameters.SUBDIRFORRESULTS).getAbsolutePath();\n emptySavedFiles(wdResults);\n String inputASN = \"Key\";\n loadSettings(configFileURL, corpusDirName, inputASN, inputASN);\n // Set the evaluation mode\n RunMode runM=RunMode.EVALUATION;\n learningApi.setLearningMode(runM);\n controller.execute();\n // Using the evaluation mode for testing\n EvaluationBasedOnDocs evaluation = learningApi.getEvaluation();\n // Compare the overall results with the correct numbers\n /*assertEquals(evaluation.macroMeasuresOfResults.correct, 3);\n assertEquals(evaluation.macroMeasuresOfResults.partialCor, 1);\n assertEquals(evaluation.macroMeasuresOfResults.spurious, 19);\n assertEquals(evaluation.macroMeasuresOfResults.missing, 68);*/\n assertEquals(\"Wrong value for correct: \", 52, (int)Math.floor(evaluation.macroMeasuresOfResults.correct));\n assertEquals(\"Wrong value for partial: \", 12, (int)Math.floor(evaluation.macroMeasuresOfResults.partialCor));\n assertEquals(\"Wrong value for spurious: \", 24, (int)Math.floor(evaluation.macroMeasuresOfResults.spurious));\n assertEquals(\"Wrong value for missing: \", 30, (int)Math.floor(evaluation.macroMeasuresOfResults.missing));\n // Remove the resources\n clearOneTest();\n System.out.println(\"completed\");\n }", "@Test(timeout = 4000)\n public void test083() throws Throwable {\n TextDirectoryLoader textDirectoryLoader0 = new TextDirectoryLoader();\n Instances instances0 = textDirectoryLoader0.getStructure();\n Evaluation evaluation0 = new Evaluation(instances0);\n double double0 = evaluation0.SFMeanEntropyGain();\n assertEquals(0.0, evaluation0.SFPriorEntropy(), 0.01);\n assertEquals(Double.NaN, double0, 0.01);\n }", "public void checkTraining() {\r\n loadGenome();\r\n MLDataSet trainingSet;\r\n float sum = 0;\r\n try (Stream<Path> walk = Files.walk(Paths.get(\"check_train_data\"))) {\r\n\r\n List<String> result = walk.filter(Files::isRegularFile)\r\n .map(x -> x.toString()).collect(Collectors.toList());\r\n\r\n for (int i = 0; i < result.size(); i++) {\r\n trainingSet = new CSVNeuralDataSet(result.get(i), input, output, true);\r\n sum += network.calculateError(trainingSet);\r\n }\r\n System.out.println(\"Validation, Average error: \" + sum / result.size());\r\n } catch (IOException e) {\r\n e.printStackTrace();\r\n }\r\n\r\n }", "@Test(timeout = 4000)\n public void test110() throws Throwable {\n TextDirectoryLoader textDirectoryLoader0 = new TextDirectoryLoader();\n Instances instances0 = textDirectoryLoader0.getDataSet();\n Evaluation evaluation0 = new Evaluation(instances0);\n String string0 = evaluation0.toSummaryString();\n assertEquals(0.0, evaluation0.unclassified(), 0.01);\n assertEquals(\"\\nTotal Number of Instances 0 \\n\", string0);\n assertEquals(0.0, evaluation0.SFPriorEntropy(), 0.01);\n }", "public final void mT__82() throws RecognitionException {\n try {\n int _type = T__82;\n int _channel = DEFAULT_TOKEN_CHANNEL;\n // InternalDSL.g:65:7: ( 'checkpoint' )\n // InternalDSL.g:65:9: 'checkpoint'\n {\n match(\"checkpoint\"); \n\n\n }\n\n state.type = _type;\n state.channel = _channel;\n }\n finally {\n }\n }", "public static void intro() {\n System.out.println(\"-----------------------------------------------------------------------\");\n System.out.println(\"Project Phase One\\nCPSC 377\\nVincent Tennant\\n230099844\");\n System.out.println(\"A simple interface to do unit testsing, perform the XOR problem, and give an example of a\\n\" +\n \"rubix cube neural network. The XOR problem and the rubix cube problems will be performed using neural\\n\" +\n \"networks, and trained by stochastic backpropagation.\");\n }", "@Test\r\n\tpublic void testInput3() throws BasePriceMustBePositiveException, \r\n\t NegativePersonCountException, ProductCategoryNotSpecifiedException {\r\n\t\tNuPackEstimator estimator = new NuPackEstimator(new BigDecimal(\"12456.95\"), 4, \"books\");\r\n\t assertEquals(estimator.estimateFinalCost(), new BigDecimal(\"13707.63\"));\r\n\t}", "public static void main(String[] args) {\n\t\tUtility utility = new Utility();\n\t\t\n\t\t// build trainingset\n\t\tSystem.out.println(\"Training System....\");\n\t\tArrayList<Horse> trainingSet = utility.readHorseColicfile(\"horseTrain.txt\");\n\t\tArrayList<Variable> variableSets = Horse.getAllVar();\n\t\tTree tree = new Tree();\n\t\t\n\t\tNode decisionTree = tree.buildTree(trainingSet, variableSets);\n\t\tutility.printNode(decisionTree);\n\t\t\n\t\t// testing DT\n\t\tSystem.out.println(\"\\tTesting System (trainingSet)....\");\n\t\tutility.testTree(trainingSet, decisionTree);\n\t\t\n\t\tSystem.out.println();\n\t\tSystem.out.println(\"\\tTesting System (testSet)....\");\n\t\tArrayList<Horse> testSet = utility.readHorseColicfile(\"horseTest.txt\");\n\t\tutility.testTree(testSet, decisionTree);\n\t\t\n\n\t}" ]
[ "0.6567511", "0.62809163", "0.56895727", "0.56225824", "0.55712056", "0.5544007", "0.5543751", "0.5513608", "0.5472868", "0.5466681", "0.54623497", "0.5438754", "0.5419717", "0.53861445", "0.5382968", "0.5370904", "0.5364154", "0.5363623", "0.5352988", "0.5334065", "0.5318487", "0.53100544", "0.5297073", "0.52957964", "0.5285001", "0.5260489", "0.5255115", "0.5231609", "0.5227748", "0.5207137", "0.52035815", "0.51820964", "0.5178841", "0.51657766", "0.51535547", "0.51531106", "0.5139739", "0.5137157", "0.51338255", "0.5131551", "0.51273453", "0.5110028", "0.5103965", "0.50970393", "0.5091536", "0.50866324", "0.5083424", "0.5079652", "0.5070261", "0.50560164", "0.5040749", "0.50363785", "0.5031682", "0.50268435", "0.5021877", "0.5020179", "0.5018935", "0.50185966", "0.50141335", "0.50108546", "0.49997604", "0.49989048", "0.49988562", "0.49986824", "0.4994959", "0.49904984", "0.49795413", "0.49771613", "0.4971016", "0.49674982", "0.4960001", "0.49570227", "0.49557784", "0.4953513", "0.4951614", "0.49512976", "0.49480477", "0.49480394", "0.49477476", "0.49456638", "0.4944526", "0.49424753", "0.49351096", "0.49346033", "0.49328333", "0.49300262", "0.49258834", "0.49222443", "0.49141878", "0.4907155", "0.4901371", "0.48993388", "0.48992437", "0.4894781", "0.48821753", "0.4881315", "0.48793", "0.48714453", "0.48705515", "0.48686528", "0.48672512" ]
0.0
-1
lab 3 checkpoint 4
@Override public void onProgressChanged(SeekBar seekBar, int progress, boolean fromUser) { cakeModel.numCandles = progress; cakeView.invalidate(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "void checkpoint() throws IOException;", "public void initializeGraphPrueba() {\n //path to checkpoit.ckpt HACER\n //To load the checkpoint, place the checkpoint files in the device and create a Tensor\n //to the path of the checkpoint prefix\n //FALTA ******\n\n // si modelo updated se usa el checkpoints que he descargado del servidor. Si no, el del movil.\n if (isModelUpdated){\n /* //NO VA BIEN:\n checkpointPrefix = Tensors.create((file_descargado).toString());\n Toast.makeText(MainActivity.this, \"Usando el modelo actualizado\", Toast.LENGTH_SHORT).show();\n\n */\n\n //A VER SI VA\n try {\n //Place the .pb file generated before in the assets folder and import it as a byte[] array\n // hay que poner el .meta\n inputCheck = getAssets().open(\"+checkpoints_name_1002-.ckpt.meta\");\n // inputCheck = getAssets().open(\"+checkpoints_name_1002-.ckpt\"); NOT FOUND\n byte[] buffer = new byte[inputCheck.available()];\n int bytesRead;\n ByteArrayOutputStream output = new ByteArrayOutputStream();\n while ((bytesRead = inputCheck.read(buffer)) != -1) {\n output.write(buffer, 0, bytesRead);\n }\n variableAuxCheck = output.toByteArray(); // array con el checkpoint\n } catch (IOException e) {\n e.printStackTrace();\n }\n checkpointPrefix = Tensors.create((variableAuxCheck).toString());\n }\n\n else {\n try {\n //Place the .pb file generated before in the assets folder and import it as a byte[] array\n // hay que poner el .meta\n inputCheck = getAssets().open(\"checkpoint_name1.ckpt.meta\");\n byte[] buffer = new byte[inputCheck.available()];\n int bytesRead;\n ByteArrayOutputStream output = new ByteArrayOutputStream();\n while ((bytesRead = inputCheck.read(buffer)) != -1) {\n output.write(buffer, 0, bytesRead);\n }\n variableAuxCheck = output.toByteArray(); // array con el checkpoint\n } catch (IOException e) {\n e.printStackTrace();\n }\n checkpointPrefix = Tensors.create((variableAuxCheck).toString());\n }\n\n //checkpointPrefix = Tensors.create((getApplicationContext().getExternalFilesDir(Environment.DIRECTORY_DOCUMENTS).getAbsolutePath() + \"final_model.ckpt\").toString()); //PARA USAR EL CHECKPOINT DESCARGADO\n // checkpointDir = getApplicationContext().getExternalFilesDir(Environment.DIRECTORY_DOCUMENTS).getAbsolutePath();\n //Create a variable of class org.tensorflow.Graph:\n graph = new Graph();\n sess = new Session(graph);\n InputStream inputStream;\n try {\n // inputStream = getAssets().open(\"graph.pb\"); //MODELO SENCILLO //PROBAR CON GRAPH_PRUEBA QUE ES MI GRAPH DE O BYTES\n // inputStream = getAssets().open(\"graph5.pb\"); //MODELO SENCILLO\n if (isModelUpdated) { // ESTO ES ALGO TEMPORAL. NO ES BUENO\n inputStream = getAssets().open(\"graph_pesos.pb\");\n }\n else {\n inputStream = getAssets().open(\"graph5.pb\");\n }\n byte[] buffer = new byte[inputStream.available()];\n int bytesRead;\n ByteArrayOutputStream output = new ByteArrayOutputStream();\n while ((bytesRead = inputStream.read(buffer)) != -1) {\n output.write(buffer, 0, bytesRead);\n }\n graphDef = output.toByteArray();\n } catch (IOException e) {\n e.printStackTrace();\n }\n //Place the .pb file generated before in the assets folder and import it as a byte[] array.\n // Let the array's name be graphdef.\n //Now, load the graph from the graphdef:\n graph.importGraphDef(graphDef);\n try {\n //Now, load the checkpoint by running the restore checkpoint op in the graph:\n sess.runner().feed(\"save/Const\", checkpointPrefix).addTarget(\"save/restore_all\").run();\n Toast.makeText(this, \"Checkpoint Found and Loaded!\", Toast.LENGTH_SHORT).show();\n }\n catch (Exception e) {\n //Alternatively, initialize the graph by calling the init op:\n sess.runner().addTarget(\"init\").run();\n Log.i(\"Checkpoint: \", \"Graph Initialized\");\n }\n }", "public static void main(String[] args) {\n\t\tString solutionFile = \"dataset/vlc/task1_solution.en.clusterMle.txt\";\n//\t\tString queryFile = \"dataset/vlc/task1_query.en.f8.n5.txt\";\n//\t\tString targetFile = \"dataset/vlc/task1_target.en.f8.n5.txt\";\n//\t\tString linkFile = \"dataset/vlc/sim_0p_100n.csv\";\n\t\t\n\t\tString malletFile = \"dataset/vlc/folds/all.0.4189.mallet\";\n\t\tString queryFile = \"dataset/vlc/folds/query.0.csv\";\n\t\tString targetFile = \"dataset/vlc/folds/target.0.csv\";\n\t\tString linkFile = \"dataset/vlc/folds/trainingPairs.0.csv\";\n\t\t\n\t\tdouble alpha = 0.01, beta = 0.01, lambda = 0.01;\n\t\t\n\t\tMalletMleCluster clusterMle = new MalletMleCluster(malletFile, linkFile, alpha);\n\t\tTask1Solution solver = new Task1Solution(clusterMle);\n//\t\tfor(alpha = 0.1; alpha<1; alpha += 0.2) {\n//\t\t\tfor(beta = 0.1; beta<1; beta += 0.2) {\n\t\t\t\tfor (lambda = 0.1; lambda<1; lambda += 0.05) {\n\t\t\tclusterMle.setSmoothParameters(alpha, beta, lambda);\n//\t\t\tclusterMle.retrieveTask1Solution(queryFile, solutionFile);\n\t\t\ttry {\n\t\t\t\tsolver.retrieveTask1Solution(queryFile, solutionFile);\n\t\t\t\tdouble precision = Task1Solution.evaluateResult(targetFile, solutionFile);\n\t\t\t\tSystem.out.println(\"alpha: \" + alpha + \"beta: \" + beta + \n\t\t\t\t\t\t\", Lambda: \" + lambda + \", Mle precision: \" + precision);\n\t\t\t} catch (Exception e) {\n\t\t\t\t// TODO Auto-generated catch block\n\t\t\t\te.printStackTrace();\n\t\t\t}\n\t\t\t\t}\n//\t\t\t}\n//\t\t}\n\t}", "public static void main(String[] args) {/\n\t\t// Exercise 1 //\n\t\t////////////////////////////////////////////////////////////////////////////////\n\t\t\n\t\tSystem.out.println(\"Exercise 1\");\n\t\tSystem.out.println(\"-----------\");\n\t\t\n\t\tint[] inputs = {1,0,1,1};\n\t\tint[] outputs = {0,0,1,1};\n\t\tNetwork n = new Network(inputs.length);\n\t\ttrainNet(n, inputs, outputs);\n\t\tint[] result = n.test(inputs, true);\n\t\tSystem.out.println(\"Output neurons after testing: \" + Arrays.toString(result));\n\t\t\n\t\t/////////////////////////////////////////////////////////////////////////////////\n\t\t// Exercise 2 //\n\t\t////////////////////////////////////////////////////////////////////////////////\n\t\t\n\t\tSystem.out.println(\"\\nExercise 2\");\n\t\tSystem.out.println(\"-----------\");\n\t\tint[] modifiedI = {1,0,0,1};\n\t\tSystem.out.println(\"Testing with incomplete input: \" + Arrays.toString(modifiedI));\n\t\tresult = n.test(modifiedI, true);\n\t\tSystem.out.println(\"Output neurons after testing: \" + Arrays.toString(result));\n\t\t\n\t\t/////////////////////////////////////////////////////////////////////////////////\n\t\t// Exercise 3 //\n\t\t////////////////////////////////////////////////////////////////////////////////\n\t\t\n\t\tSystem.out.println(\"\\nExercise 3\");\n\t\tSystem.out.println(\"-----------\");\n\t\tint[] noizyI = {1,1,1,1};\n\t\tSystem.out.println(\"Testing with noizy input: \" + Arrays.toString(noizyI));\n\t\tresult = n.test(noizyI, true);\n\t\tSystem.out.println(\"Output neurons after testing: \" + Arrays.toString(result));\n\t\tSystem.out.println(n);\n\t\t\n\t\t/////////////////////////////////////////////////////////////////////////////////\n\t\t// Exercise 4 //\n\t\t////////////////////////////////////////////////////////////////////////////////\n\t\t\n\t\tSystem.out.println(\"\\nExercise 4\");\n\t\tSystem.out.println(\"-----------\");\n\t\tinputs = new int[] {1,0,1,0,0,1};\n\t\toutputs = new int[] {1,1,0,0,1,1};\n\t\tint[] newIns = {0,1,1,0,0,0};\n\t\tint[] newOuts = {1,1,0,1,0,1};\n\t\tn = new Network(inputs.length);\n\t\ttrainNet(n, inputs, outputs);\n\t\ttrainNet(n, newIns, newOuts);\n\t\tresult = n.test(inputs, true);\n\t\tSystem.out.println(\"load param: \" + n.getLoadParameter());\n\t\tSystem.out.println(\"Output neurons after testing: \" + Arrays.toString(result));\n\t\tint[] newResult = n.test(newIns, true);\n\t\tSystem.out.println(\"Output neurons after testing: \" + Arrays.toString(newResult));\n\t\t\n\t\t/////////////////////////////////////////////////////////////////////////////////\n\t\t// Exercise 5 //\n\t\t////////////////////////////////////////////////////////////////////////////////\n\t\t\n\t\tSystem.out.println(\"\\nExercise 5\");\n\t\tSystem.out.println(\"-----------\");\n\t\tmodifiedI = new int[] {1,0,0,0,0,1};\n\t\tSystem.out.println(\"Testing with incomplete input:\");\n\t\tresult = n.test(modifiedI, true);\n\t\tSystem.out.println(\"Output neurons after testing: \" + Arrays.toString(result));\n\t\tmodifiedI = new int[] {0,1,0,0,0,0};\n\t\tSystem.out.println(\"Testing with noisy input:\");\n\t\tresult = n.test(modifiedI, true);\n\t\tSystem.out.println(\"Output neurons after testing: \" + Arrays.toString(result));\n\t\t\n\t\t/////////////////////////////////////////////////////////////////////////////////\n\t\t// Exercise 6 //\n\t\t////////////////////////////////////////////////////////////////////////////////\n\t\tSystem.out.println(\"\\nExercise 6\");\n\t\tSystem.out.println(\"-----------\");\n\t\tint size = 10, iterations = 500, total = 0, maxCount = 0;\n\t\tdouble loadParameter = 0, maxLoad = 0, synapsesLoad = 0, maxSyn = 0;\n\t\tfor(int j = 0 ; j < iterations ; j++) {\n\t\t\tNetwork net = new Network(size);\n\t\t\tint[][] inPatterns = generateRandomPatterns(size);\n\t\t\tint[][] outPatterns = generateRandomPatterns(size);\n\t\t\tint count = 0;\n\t\t\tfor(int i = 0 ; i < inPatterns.length ; i++) {\n\t\t\t\tnet.train(inPatterns[i], outPatterns[i]);\n\t\t\t\tint[] res = net.test(inPatterns[i], false);\n\t\t\t\tif(Arrays.equals(res, outPatterns[i])) {\n\t\t\t\t\tcount++;\n\t\t\t\t} else {\n\t\t\t\t\t// network has made an error\n\t\t\t\t\tnet.pop();\n\t\t\t\t\tdouble lp = net.getLoadParameter();\n\t\t\t\t\tdouble sl = net.synapsesLoad();\n\t\t\t\t\tloadParameter += lp;\n\t\t\t\t\tsynapsesLoad += sl;\n\t\t\t\t\tif(lp > maxLoad)\n\t\t\t\t\t\tmaxLoad = lp;\n\t\t\t\t\tif(sl > maxSyn)\n\t\t\t\t\t\tmaxSyn = sl;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t\ttotal += count;\n\t\t\tif(count > maxCount)\n\t\t\t\tmaxCount = count;\n\t\t}\n\t\t\n\t\tSystem.out.println(\"Network of size: \" + size);\n\t\tSystem.out.println(\"Network on average trained: \" + total/iterations + \" patterns\");\n\t\tSystem.out.println(\"Network average load param: \" + loadParameter/iterations);\n\t\tSystem.out.println(\"Network average synapses load: \" + synapsesLoad/iterations);\n\t\tSystem.out.println(\"Network max load parameter: \" + maxLoad);\n\t\tSystem.out.println(\"Network max synapses load: \" + maxSyn);\n\t\tSystem.out.println(\"Network max number of trained patterns: \" + maxCount);\n\t}", "public static void test(String[] args) throws Exception {\n\t\tAbstractPILPDelegate.setDebugMode(null);\r\n\t\t\r\n\t\tComputeCostBasedOnFreq ins = new ComputeCostBasedOnFreq();\r\n\t\tins.initPreMapping(\"D:/data4code/replay/pre.csv\");\r\n\t\tins.getEventSeqForEachPatient(\"D:/data4code/cluster/LogBasedOnKmeansPlusPlus-14.csv\");\r\n\t\tins.removeOneLoop();\r\n\r\n\t\tPetrinetGraph net = null;\r\n\t\tMarking initialMarking = null;\r\n\t\tMarking[] finalMarkings = null; // only one marking is used so far\r\n\t\tXLog log = null;\r\n\t\tMap<Transition, Integer> costMOS = null; // movements on system\r\n\t\tMap<XEventClass, Integer> costMOT = null; // movements on trace\r\n\t\tTransEvClassMapping mapping = null;\r\n\r\n\t\tnet = constructNet(\"D:/data4code/mm.pnml\");\r\n\t\tinitialMarking = getInitialMarking(net);\r\n\t\tfinalMarkings = getFinalMarkings(net);\r\n\t\tXParserRegistry temp=XParserRegistry.instance();\r\n\t\ttemp.setCurrentDefault(new XesXmlParser());\r\n\t\tlog = temp.currentDefault().parse(new File(\"D:/data4code/mm.xes\")).get(0);\r\n//\t\tlog = XParserRegistry.instance().currentDefault().parse(new File(\"d:/temp/BPI2013all90.xes.gz\")).get(0);\r\n\t\t//\t\t\tlog = XParserRegistry.instance().currentDefault().parse(new File(\"d:/temp/BPI 730858110.xes.gz\")).get(0);\r\n\t\t//\t\t\tlog = XFactoryRegistry.instance().currentDefault().openLog();\r\n\t\tcostMOS = constructMOSCostFunction(net);\r\n\t\tXEventClass dummyEvClass = new XEventClass(\"DUMMY\", 99999);\r\n\t\tXEventClassifier eventClassifier = XLogInfoImpl.STANDARD_CLASSIFIER;\r\n\t\tcostMOT = constructMOTCostFunction(net, log, eventClassifier, dummyEvClass);\r\n\t\tmapping = constructMapping(net, log, dummyEvClass, eventClassifier);\r\n\r\n\t\tint cost1 = AlignmentTest.computeCost(costMOS, costMOT, initialMarking, finalMarkings, null, net, log,\r\n\t\t\t\tmapping, false);\r\n\t\tSystem.out.println(cost1);\r\n\t\t\r\n//\t\tint iteration = 0;\r\n//\t\twhile (true) {\r\n//\t\t\tSystem.out.println(\"start: \" + iteration);\r\n//\t\t\tlong start = System.currentTimeMillis();\r\n//\t\t\tint cost1 = AlignmentTest.computeCost(costMOS, costMOT, initialMarking, finalMarkings, null, net, log,\r\n//\t\t\t\t\tmapping, false);\r\n//\t\t\tlong mid = System.currentTimeMillis();\r\n//\t\t\tSystem.out.println(\" With ILP cost: \" + cost1 + \" t: \" + (mid - start));\r\n//\r\n//\t\t\tlong mid2 = System.currentTimeMillis();\r\n//\t\t\tint cost2 = AlignmentTest.computeCost(costMOS, costMOT, initialMarking, finalMarkings, null, net, log,\r\n//\t\t\t\t\tmapping, false);\r\n//\t\t\tlong end = System.currentTimeMillis();\r\n//\r\n//\t\t\tSystem.out.println(\" No ILP cost: \" + cost2 + \" t: \" + (end - mid2));\r\n//\t\t\tif (cost1 != cost2) {\r\n//\t\t\t\tSystem.err.println(\"ERROR\");\r\n//\t\t\t}\r\n//\t\t\t//System.gc();\r\n//\t\t\tSystem.out.flush();\r\n//\t\t\titeration++;\r\n//\t\t}\r\n\r\n\t}", "protected void checkpoint(S state) {\n checkpoint();\n state(state);\n }", "private static void task3() {\n\n\n System.out.printf(\"\\nTASK 3:\\nSee the 8 puzzles generated by this \" +\n \"task.\\nEach size (5, 7, 9 & 11) has two puzzles each; one \" +\n \"with a positive k value and one with a negative k value.\\n\" +\n \"Each puzzle is provided with a corresponding visualization \" +\n \"of it's solution\\n\");\n int[] puzzleSizes = new int[]{5, 7, 9, 11};\n for (int puzzleSize : puzzleSizes){\n createT3Puzzles(puzzleSize, true);\n createT3Puzzles(puzzleSize, false);\n }\n return;\n }", "public static void main(String[] args) throws Exception {\n\t\tStoreAlphaWeight.dimensionForSVM=200;\n\t\tLibEstimate le=new LibEstimate();\n\t\tle.countLine();\n\t\tle.readVec();\n\t\tle.readLabel();\n\t\tle.readBias();\n\t\tle.addBiastoVec();\n\t\tle.prepTrainData();\n\t\tle.prepTestData();\n\t\tle.lib();\n\t}", "private static void jbptTest2() throws FileNotFoundException, Exception {\n\t\tFile folder = new File(\"models\");\n\t\t\n\t\tFile[] arModels = folder.listFiles(new FileUtil().getFileter(\"pnml\"));\n\t\tfor(File file: arModels)\n\t\t{\n\t\t\t//print the file name\n\t\t\tSystem.out.println(\"========\" + file.getName() + \"========\");\n\n\t\t\t//initialize the counter for conditions and events\n\t\t\tAbstractEvent.count = 0;\n\t\t\tAbstractCondition.count = 0;\n\n\t\t\t//get the file path\n\t\t\tString filePrefix = file.getPath();\n\t\t\tfilePrefix = filePrefix.substring(0, filePrefix.lastIndexOf('.'));\n\t\t\tString filePNG = filePrefix + \".png\";\n\t\t\tString fileCPU = filePrefix + \"-cpu.png\";\n\t\t\tString fileNet = filePrefix + \"-cpu.pnml\";\n\n\t\t\tPnmlImport pnmlImport = new PnmlImport();\n\t\t\tPetriNet p1 = pnmlImport.read(new FileInputStream(file));\n\n\t\t\t// ori\n\t\t\t/*ProvidedObject po1 = new ProvidedObject(\"petrinet\", p1);\n\t\t\t\n\t\t\tDotPngExport dpe1 = new DotPngExport();\n\t\t\tOutputStream image1 = new FileOutputStream(filePNG);\n\t\t\t\n\t\t\tdpe1.export(po1, image1);*/\n\n\t\t\tNetSystem ns = PetriNetConversion.convert(p1);\n\t\t\tProperCompletePrefixUnfolding cpu = new ProperCompletePrefixUnfolding(ns);\n\t\t\tNetSystem netPCPU = PetriNetConversion.convertCPU2NS(cpu);\n\t\t\t// cpu\n\t\t\tPetriNet p2 = PetriNetConversion.convert(netPCPU);\n\t\t\t\n\t\t\tProvidedObject po2 = new ProvidedObject(\"petrinet\", p2);\n\t\t\tDotPngExport dpe2 = new DotPngExport();\n\t\t\tOutputStream image2 = new FileOutputStream(fileCPU);\n\t\t\tdpe2.export(po2, image2);\n//\t\t\t\n\t\t\tExport(p2, fileNet);\n//\t\t\t// net\n//\t\t\tNetSystem nsCPU = PetriNetConversion.convertCPU2NS(cpu);\n//\t\t\tPetriNet pnCPU = PetriNetConversion.convertNS2PN(nsCPU);\n//\t\t\tProvidedObject po3 = new ProvidedObject(\"petrinet\", pnCPU);\n//\t\t\tDotPngExport dpe3 = new DotPngExport();\n//\t\t\tOutputStream image3 = new FileOutputStream(fileNet);\n//\t\t\tdpe3.export(po3, image3);\n\t\t}\n\t\t\tSystem.exit(0);\n\t}", "@Test(timeout = 4000)\n public void test113() throws Throwable {\n TextDirectoryLoader textDirectoryLoader0 = new TextDirectoryLoader();\n Instances instances0 = textDirectoryLoader0.getStructure();\n Evaluation evaluation0 = new Evaluation(instances0);\n String string0 = evaluation0.toSummaryString(false);\n assertEquals(\"=== Summary ===\\n\\nTotal Number of Instances 0 \\n\", string0);\n assertEquals(0.0, evaluation0.SFSchemeEntropy(), 0.01);\n assertEquals(0.0, evaluation0.unclassified(), 0.01);\n }", "public static void main(String[] args) {\n\t\tLab3 test = new Lab3();\n\t\t\n\t\tSystem.out.println(\"\\nTest Case (0, 7, 4) to (2, 7, 2):\");\n\t\ttest.pouring(0, 7, 4, 2, 7, 2);\n\t\ttest.backTrack(0, 7, 4, 2, 7, 2);\n\t\ttest = new Lab3();\n\t\t\n\t\tSystem.out.println(\"\\nTest Case (10, 0, 4) to (2, 7, 2):\");\n\t\ttest.pouring(10, 0, 4, 2, 7, 2);\n\t\ttest.backTrack(10, 0, 4, 2, 7, 2);\n\t\ttest = new Lab3();\n\t\t\n\t\tSystem.out.println(\"\\nTest Case (8, 6, 3) to (7, 6, 4):\");\n\t\ttest.pouring(8, 6, 3, 7, 6, 4);\n\t\ttest.backTrack(8, 6, 3, 7, 6, 4);\n\t\ttest = new Lab3();\n\t\t\n\t\tSystem.out.println(\"\\nTest Case (1, 7, 4) to (3, 6, 2):\");\n\t\ttest.pouring(1, 7, 4, 3, 6, 2);\n\t\ttest.backTrack(1, 7, 4, 3, 6, 2);\n\t\ttest = new Lab3();\n\t\t\n\t\tSystem.out.println(\"\\nTest Case (2, 7, 4) to (3, 6, 2):\");\n\t\ttest.pouring(2, 7, 4, 3, 6, 2);\n\t\ttest.backTrack(2, 7, 4, 3, 6, 2);\n\t\ttest = new Lab3();\n\t\t\n\t\tSystem.out.println(\"\\nTest Case (6, 3, 3) to (3, 6, 3):\");\n\t\ttest.pouring(6, 3, 3, 3, 6, 3);\n\t\ttest.backTrack(6, 3, 3, 3, 6, 3);\n\t}", "@Test\n public void test30() throws Throwable {\n TextDirectoryLoader textDirectoryLoader0 = new TextDirectoryLoader();\n Instances instances0 = textDirectoryLoader0.getDataSet();\n Evaluation evaluation0 = new Evaluation(instances0);\n boolean boolean0 = evaluation0.getDiscardPredictions();\n assertEquals(0.0, evaluation0.SFPriorEntropy(), 0.01D);\n assertFalse(boolean0);\n }", "public void train ()\t{\t}", "@Test(timeout = 4000)\n public void test021() throws Throwable {\n TextDirectoryLoader textDirectoryLoader0 = new TextDirectoryLoader();\n Instances instances0 = textDirectoryLoader0.getStructure();\n Evaluation evaluation0 = new Evaluation(instances0);\n String string0 = evaluation0.toSummaryString(\"\", false);\n assertEquals(\"\\nTotal Number of Instances 0 \\n\", string0);\n assertEquals(0.0, evaluation0.unclassified(), 0.01);\n assertEquals(0.0, evaluation0.SFSchemeEntropy(), 0.01);\n }", "public void testSVMChunkLearnng() throws IOException, GateException {\n // Initialisation\n System.out.print(\"Testing the SVM with liner kernenl on chunk learning...\");\n File chunklearningHome = new File(new File(learningHome, \"test\"),\n \"chunklearning\");\n String configFileURL = new File(chunklearningHome, \"engines-svm.xml\")\n .getAbsolutePath();\n String corpusDirName = new File(chunklearningHome, \"data-ontonews\")\n .getAbsolutePath();\n //Remove the label list file, feature list file and chunk length files.\n String wdResults = new File(chunklearningHome,\n ConstantParameters.SUBDIRFORRESULTS).getAbsolutePath();\n emptySavedFiles(wdResults);\n String inputASN = \"Key\";\n loadSettings(configFileURL, corpusDirName, inputASN, inputASN);\n // Set the evaluation mode\n RunMode runM=RunMode.EVALUATION;\n learningApi.setLearningMode(runM);\n controller.execute();\n // Using the evaluation mode for testing\n EvaluationBasedOnDocs evaluation = learningApi.getEvaluation();\n // Compare the overall results with the correct numbers\n assertEquals(\"Wrong value for correct: \", 44, (int)Math.floor(evaluation.macroMeasuresOfResults.correct));\n assertEquals(\"Wrong value for partial: \", 10, (int)Math.floor(evaluation.macroMeasuresOfResults.partialCor));\n assertEquals(\"Wrong value for spurious: \", 11, (int)Math.floor(evaluation.macroMeasuresOfResults.spurious));\n assertEquals(\"Wrong value for missing: \", 40, (int)Math.floor(evaluation.macroMeasuresOfResults.missing));\n\n System.out.println(\"completed\");\n // Remove the resources\n clearOneTest();\n }", "@Override\n\tpublic Serializable checkpointInfo() throws Exception {\n\t\treturn null;\n\t}", "@Test\n public void test33() throws Throwable {\n TextDirectoryLoader textDirectoryLoader0 = new TextDirectoryLoader();\n Instances instances0 = textDirectoryLoader0.getDataSet();\n Evaluation evaluation0 = new Evaluation(instances0);\n double double0 = evaluation0.correct();\n assertEquals(0.0, evaluation0.SFPriorEntropy(), 0.01D);\n assertEquals(0.0, double0, 0.01D);\n }", "public static void main(final String[] args) {\n \tString enginePath = engines[8];\n\t\tEngineParameter eparams = new EngineParameter(enginePath);\n\n\t\tString url = \"http://files.grouplens.org/datasets/movielens/ml-1m.zip\";\n String folder = \"src/resources/main/data/ml-1m\";\n String modelPath = \"src/resources/main/crossValid/ml-1m/model/\";\n String recPath = \"src/resources/main/crossValid/ml-1m/recommendations/\";\n String dataFile = eparams.getDataSouceParams().getSourceLocation().get(0);\n int nFolds = N_FOLDS;\n \t\t\n System.out.println(\"Preparing splits...\");\n prepareSplits(url, nFolds, dataFile, folder, modelPath);\n \n System.out.println(\"Gathering recomendations...\");\n //recommend(nFolds, modelPath, recPath); // RiVal's original step.\n //orbsRecommend(nFolds, eparams, modelPath); // Based on RiVal' step\n mixedRecommend(nFolds, eparams, modelPath); // Mixed step\n \n //System.out.println(\"Preparing strategy...\");\n // the strategy files are (currently) being ignored\n //prepareStrategy(nFolds, modelPath, recPath, modelPath);\n\n System.out.println(\"Evaluating...\");\n evaluate(nFolds, modelPath, recPath);\n }", "protected void checkpoint() {\n checkpoint = internalBuffer().readerIndex();\n }", "public void kirimNotifikasiPengajuan(Training training){\n\t\t\n\t}", "@Test\n public void test08() throws Throwable {\n DecisionStump decisionStump0 = new DecisionStump();\n String string0 = Evaluation.makeOptionString(decisionStump0, false);\n assertEquals(\"\\n\\nGeneral options:\\n\\n-h or -help\\n\\tOutput help information.\\n-synopsis or -info\\n\\tOutput synopsis for classifier (use in conjunction with -h)\\n-t <name of training file>\\n\\tSets training file.\\n-T <name of test file>\\n\\tSets test file. If missing, a cross-validation will be performed\\n\\ton the training data.\\n-c <class index>\\n\\tSets index of class attribute (default: last).\\n-x <number of folds>\\n\\tSets number of folds for cross-validation (default: 10).\\n-no-cv\\n\\tDo not perform any cross validation.\\n-split-percentage <percentage>\\n\\tSets the percentage for the train/test set split, e.g., 66.\\n-preserve-order\\n\\tPreserves the order in the percentage split.\\n-s <random number seed>\\n\\tSets random number seed for cross-validation or percentage split\\n\\t(default: 1).\\n-m <name of file with cost matrix>\\n\\tSets file with cost matrix.\\n-l <name of input file>\\n\\tSets model input file. In case the filename ends with '.xml',\\n\\ta PMML file is loaded or, if that fails, options are loaded\\n\\tfrom the XML file.\\n-d <name of output file>\\n\\tSets model output file. In case the filename ends with '.xml',\\n\\tonly the options are saved to the XML file, not the model.\\n-v\\n\\tOutputs no statistics for training data.\\n-o\\n\\tOutputs statistics only, not the classifier.\\n-i\\n\\tOutputs detailed information-retrieval statistics for each class.\\n-k\\n\\tOutputs information-theoretic statistics.\\n-classifications \\\"weka.classifiers.evaluation.output.prediction.AbstractOutput + options\\\"\\n\\tUses the specified class for generating the classification output.\\n\\tE.g.: weka.classifiers.evaluation.output.prediction.PlainText\\n-p range\\n\\tOutputs predictions for test instances (or the train instances if\\n\\tno test instances provided and -no-cv is used), along with the \\n\\tattributes in the specified range (and nothing else). \\n\\tUse '-p 0' if no attributes are desired.\\n\\tDeprecated: use \\\"-classifications ...\\\" instead.\\n-distribution\\n\\tOutputs the distribution instead of only the prediction\\n\\tin conjunction with the '-p' option (only nominal classes).\\n\\tDeprecated: use \\\"-classifications ...\\\" instead.\\n-r\\n\\tOnly outputs cumulative margin distribution.\\n-z <class name>\\n\\tOnly outputs the source representation of the classifier,\\n\\tgiving it the supplied name.\\n-xml filename | xml-string\\n\\tRetrieves the options from the XML-data instead of the command line.\\n-threshold-file <file>\\n\\tThe file to save the threshold data to.\\n\\tThe format is determined by the extensions, e.g., '.arff' for ARFF \\n\\tformat or '.csv' for CSV.\\n-threshold-label <label>\\n\\tThe class label to determine the threshold data for\\n\\t(default is the first label)\\n\\nOptions specific to weka.classifiers.trees.DecisionStump:\\n\\n-D\\n\\tIf set, classifier is run in debug mode and\\n\\tmay output additional info to the console\\n\", string0);\n }", "void checkpoint(Node node) throws RepositoryException;", "public void kirimNotifikasiPersetujuan(Training training){\n\t\t\n\t}", "@Test(timeout = 4000)\n public void test022() throws Throwable {\n TextDirectoryLoader textDirectoryLoader0 = new TextDirectoryLoader();\n Instances instances0 = textDirectoryLoader0.getStructure();\n Evaluation evaluation0 = new Evaluation(instances0);\n evaluation0.toMatrixString(\"getPreBuiltClassifiers\");\n assertEquals(0.0, evaluation0.SFEntropyGain(), 0.01);\n }", "private static GeneticProgram loadCheckpoint(String arg) {\n CheckpointLoader cpl = new CheckpointLoader(arg);\n GeneticProgram gp = cpl.instantiate();\n if (gp == null) {\n System.err.println(\"Could not load checkpoint.\");\n System.exit(-1);\n }\n return gp;\n }", "@Override\n\tpublic void run() {\n\t\tfileName = \"out_\" + Program.getProgram().getFileName() + \"_\";\n\t\tint numAddStop = 0;\n\t\t//fileName = \"out_themida_\";\n\n\t\t//fileState.clearContentFile();\n\t\t//bkFile.clearContentFile();\n\t\toverallStartTime = System.currentTimeMillis();\n\t\tlong overallStartTemp = overallStartTime;\n\t\t// BE-PUM algorithm\n\t\tSystem.out.println(\"Starting On-the-fly Model Generation algorithm.\");\n\t\tprogram.getResultFileTemp().appendInLine('\\n' + program.getFileName() + '\\t');\n\t\t\n\t\t// Set up initial context\n\t\tX86TransitionRule rule = new X86TransitionRule();\n\t\tBPCFG cfg = Program.getProgram().getBPCFG();\n\t\tEnvironment env = new Environment();\n\t\t//env.getMemory().resetImportTable(program);\n\t\tAbsoluteAddress location = Program.getProgram().getEntryPoint();\n\t\tInstruction inst = Program.getProgram().getInstruction(location, env);\n\t\tList<BPPath> pathList = new ArrayList<BPPath>();\n\t\t\n\t\t// Insert start node\n\t\tBPVertex startNode = null;\n\t\tstartNode = new BPVertex(location, inst);\n\t\tstartNode.setType(0);\n\t\tcfg.insertVertex(startNode);\n\n\t\tBPState curState = null;\n\t\tBPPath path = null;\n\t\tcurState = new BPState(env, location, inst);\n\t\tpath = new BPPath(curState, new PathList(), new Formulas());\n\t\tpath.setCurrentState(curState);\n\t\tpathList.add(path);\n\n\t\t/*if (Program.getProgram().getFileName().equals(\"api_test_v2.3_lvl1.exe\") \n\t\t\t\t&& isRestored) {\n\t\t\tSystem.out.println(\"Restore State from File.\");\n\t\t\tFileProcess reFile = new FileProcess(\"data/data/restoreState.txt\");\n\t\t\tpathList = restoreState(reFile);\n\t\t\t// bkFile.clearContentFile();\n\t\t\tSystem.out.println(\"Finished restoring state!\");\n\t\t}*/\n\n\t\t// Update at first -----------------------------\n\t\tTIB.setBeUpdated(true);\n\t\tTIB.updateTIB(curState);\n\t\t// ---------------------------------------------\n\n\t\t// PHONG - 20150801 /////////////////////////////\n\t\t// Packer Detection via Header\n\t\tSystem.out.println(\"================PACKER DETECTION VIA HEADER ======================\");\n\t\tif (OTFModelGeneration.detectPacker)\n\t\t{\n\t\t\tprogram.getDetection().detectViaHeader(program);\n\t\t\tprogram.getDetection().setToLogFirst(program);\n\t\t}\n\t\tSystem.out.println(\"==================================================================\");\n\t\t/////////////////////////////////////////////////\n\t\t\n\t\tsynchronized (OTFThreadManager.getInstance()) {\n\t\t\ttry {\n\t\t\t\tOTFThreadManager.getInstance().check(this, pathList);\n\t\t\t\tOTFThreadManager.getInstance().wait();\n\t\t\t} catch (Exception e) {\n\t\t\t\te.printStackTrace();\n\t\t\t}\n\t\t}\n\t\t// PHONG - 20150724\n\t\tSystem.out.println(\"================PACKER DETECTION VIA OTF======================\");\n\t\tprogram.getDetection().packedByTechniques();\n\t\tprogram.getDetection().packedByTechniquesFrequency();\n\t\tSystem.out.println(\"==============================================================\");\n\t}", "@Before\n public void DataSmoothExamples3() {\n\t LinkedList<Episode> eps9 = new LinkedList<Episode>();\n\t\teps9.add(new Episode(\"The One with the Tea Leaves\", 150));\n\t\teps9.add(new Episode(\"The One with Pricess Consuela\", 200));\n\t\teps9.add(new Episode(\"The One with the Bird Mother\", 250));\t\t\n\t\tshows3.add(new Show(\"Friends\", 2100, eps9, false));\n\t\t\n\t\tLinkedList<Episode> eps10 = new LinkedList<Episode>();\n\t\teps10.add(new Episode(\"Java\", 200));\n\t\teps10.add(new Episode(\"Python\", 210));\n\t\teps10.add(new Episode(\"C\", 210));\n\t\teps10.add(new Episode(\"C++\", 200));\n\t\tshows3.add(new Show(\"Programming Languages\", 2000, eps10, false));\n\t\t\n\t\tLinkedList<Episode> eps11 = new LinkedList<Episode>();\n\t\teps11.add(new Episode(\"Leaving Storybrooke\", 180));\n\t\teps11.add(new Episode(\"Homecoming\", 190));\n\t\teps11.add(new Episode(\"Where\", 200));\n\t\tshows3.add(new Show(\"Sisterhood\", 600, eps11, false));\n\n\t showResults3.add(200.0);\n\t showResults3.add(198.333);\n\t showResults3.add(190.0);\n\t}", "public static void main(String[] args) throws IOException {\n String dataName = \"Dianping\";\n String fileName = \"checkin_pitf\";\n int coreNum = 1;\n// List<Post> trainPosts = DataReader.readPosts(\"./demo/data/\" + dataName + \"/all_id_core\"+coreNum+\"_train\");\n// List<Post> testPosts = DataReader.readPosts(\"./demo/data/\" + dataName + \"/all_id_core\"+coreNum+\"_test\");\n List<Post> trainPosts = DataReader.readPosts(\"./demo/data/\" + dataName + \"/\"+fileName+\"_train\");\n List<Post> testPosts = DataReader.readPosts(\"./demo/data/\" + dataName + \"/\"+fileName+\"_test\");\n\n System.out.println(\"PITFTest\");\n System.out.println(dataName+\" \"+coreNum);\n int dim = 64;\n double initStdev = 0.01;\n int iter = 20;//100\n double learnRate = 0.05;\n double regU = 0.00005;\n double regI = regU, regT = regU;\n int numSample = 100;\n int randomSeed = 1;\n\n PITF pitf = new PITF(trainPosts, testPosts, dim, initStdev, iter, learnRate, regU, regI, regT, randomSeed, numSample);\n pitf.run();//这个函数会调用model的初始化及创建函数\n System.out.println(\"dataName:\\t\" + dataName);\n System.out.println(\"coreNum:\\t\" + coreNum);\n }", "static void playC45() throws IOException {\n\t\tRealVector[] data = NNDataset.getData(NNDataset.HOME);\n\t\tRealVector[] label = NNDataset.getLabel(NNDataset.HOME);\n\t\tRealMatrix d = MatrixUtils.createRealMatrix(data.length, data[0].getDimension());\n\t\tfor (int i = 0; i < data.length; i++) {\n\t\t\td.setRowVector(i, data[i]);\n\t\t}\n\t\td = d.transpose(); // data = column vector\n\n\t\tRealVector l = MatrixUtils.createRealVector(new double[label.length]);\n\t\tfor (int i = 0; i < l.getDimension(); i++) {\n\t\t\tl.setEntry(i, label[i].getEntry(0));\n\t\t}\n\n\t\tDecisionNode root = training(d, l);\n\t\tString[] header = NNDataset.getHeader(NNDataset.HOME);\n\t\tprintTree(root, header);\n\n\t\tInteger lb = predict(root, data[0]);\n\t\tSystem.out.println(lb);\n\n\t\tdouble ok = MSE(root, data, label);\n\t\tSystem.out.println(\"total hit: \" + ok);\n\t}", "public static void main(String[] args) throws IOException {\n\t\tMain t = new Main();\n\t\tSystem.out.println(\"The model is trained: \");\n\t\tt.training(enTrainingDir, 0.7);\n\t\tSystem.out.println(\"Check validation in example of \\\"AB\\\":\");\n\t\tt.checkValid(\"AB\");\n\t\tSystem.out.println();\n\t\tSystem.out.println(\"============= unsmoothed models =============================================================================\");\n\t\tSystem.out.print(\"Unigram: \");\n\t\tSystem.out.println(t.uni);\n\t\tSystem.out.print(\"Bigram: \");\n\t\tSystem.out.println(t.bi);\n\t\tSystem.out.print(\"Trigram: \");\n\t\tSystem.out.println(t.tri);\n\t\tSystem.out.println();\n\t\tSystem.out.println(\"============= add-one smoothed models ========================================================================\");\n\t\tSystem.out.println(\"Note: this is only one of smoothed models , not the tuning process. Because there would be too many console lines.\");\n\t\tSystem.out.println(\"Here I take add-k = 0.7 as an example.\");\n\t\tSystem.out.println(\"*************************************************************************************************************\");\n\t\tdouble k = 0.7;\n\t\tt.training(enTrainingDir, 0.7);\n\t\tt.calculateScore(testDir, k, null, null);\n\t\tt.training(esTrainingDir, 0.7);\n\t\tt.calculateScore(testDir, k, null, null);\n\t\tt.training(deTrainingDir, 0.7);\n\t\tt.calculateScore(testDir, k, null, null);\n\t\tSystem.out.println(\"*************************************************************************************************************\");\n\t\tSystem.out.println(\"Then I take the classic add-k = 1.0 as an example.\");\n\t\tSystem.out.println(\"*************************************************************************************************************\");\n\t\tk = 1.0;\n\t\tt.training(enTrainingDir, 0.7);\n\t\tt.calculateScore(testDir, k, null, null);\n\t\tt.training(esTrainingDir, 0.7);\n\t\tt.calculateScore(testDir, k, null, null);\n\t\tt.training(deTrainingDir, 0.7);\n\t\tt.calculateScore(testDir, k, null, null);\n\t\tSystem.out.println();\n\t\tSystem.out.println(\"===== linear interpolation smoothed models ===================================================================\");\n\t\tdouble[] lambdas_tri = new double[] {1.0 / 3, 1.0 / 3, 1.0 / 3};\n\t\tdouble[] lambdas_bi = new double[] {1.0 / 2, 1.0 / 2};\n\t\tSystem.out.println(\"First is equally weighted lambdas: \" + Arrays.toString(lambdas_tri) + \" and \" + Arrays.toString(lambdas_bi));\n\t\tt.training(enTrainingDir, 0.7);\n\t\tt.calculateScore(testDir, 0, lambdas_bi, lambdas_tri);\n\t\tt.training(esTrainingDir, 0.7);\n\t\tt.calculateScore(testDir, 0, lambdas_bi, lambdas_tri);\n\t\tt.training(deTrainingDir, 0.7);\n\t\tt.calculateScore(testDir, 0, lambdas_bi, lambdas_tri);\n\t\tSystem.out.println(\"**************************************************************************************************************\");\n\t\tlambdas_tri = new double[] {0.5, 0.3, 0.2};\n\t\tlambdas_bi = new double[] {0.7, 0.3};\n\t\tSystem.out.println(\"Then is tuned-weighted lambdas: \" + Arrays.toString(lambdas_tri) + \" and \" + Arrays.toString(lambdas_bi));\n\t\tSystem.out.println(\"Again, this is not all the tuning process. Here is only one set of lambdas.\");\n\t\tt.training(enTrainingDir, 0.7);\n\t\tt.calculateScore(testDir, 0, lambdas_bi, lambdas_tri);\n\t\tt.training(esTrainingDir, 0.7);\n\t\tt.calculateScore(testDir, 0, lambdas_bi, lambdas_tri);\n\t\tt.training(deTrainingDir, 0.7);\n\t\tt.calculateScore(testDir, 0, lambdas_bi, lambdas_tri);\n\t\tSystem.out.println();\n\t\tSystem.out.println(\"=================== Generating texts ==========================================================================\");\n\t\tSystem.out.println(\"To save console space, here I generate A to E, five sentences. Feel free to adjust parameters in code.\");\n\t\tSystem.out.println(\"***************************************************************************************************************\");\n\t\tt.training(enTrainingDir, 0.7);\n\t\tSystem.out.println(\"**************** Bi-gram generating ***************************************************************************\");\n\t\tfor (char c = 'A'; c <= 'E'; c++) {\n\t\t\tt.generateWithBigramModel(String.valueOf(c));\n\t\t}\n\t\tSystem.out.println();\n\t\tSystem.out.println();\n\t\tSystem.out.println(\"Not that good huh?\");\n\t\tSystem.out.println(\"**************** Tri-gram generating *************************************************************************\");\n\t\tfor (char c = 'A'; c <= 'E'; c++) {\n\t\t\tt.generateWithBigramModel(String.valueOf(c));\n\t\t}\n\t\tSystem.out.println();\n\t\tSystem.out.println();\n\t\tSystem.out.println(\"...Seems not good as well.\");\n\t}", "public static void demo() {\n\t\tlab_2_2_5();\n\n\t}", "private void saveLab(boolean usetmp) throws FileNotFoundException{\n //Get path to start.config\n String startConfigPath;\n if(!usetmp){\n startConfigPath = currentLab.getPath()+File.separator+\"config\"+File.separator+\"start.config\";\n }else{\n startConfigPath = currentLab.getPath()+File.separator+\"config\"+File.separator+\"start.config\";\n }\n PrintWriter writer = new PrintWriter(startConfigPath);\n String startConfigText = \"\"; \n \n // Write Global Params\n for(String line : labDataCurrent.getGlobals()){\n startConfigText += line+\"\\n\";\n }\n\n // Cycle through network objects and write\n Component[] networks = NetworkPanePanel.getComponents();\n for(Component network : networks){\n NetworkData data = ((NetworkObjPanel)network).getConfigData();\n startConfigText += \"NETWORK \"+data.name+\"\\n\";\n startConfigText += \" MASK \"+data.mask+\"\\n\";\n startConfigText += \" GATEWAY \"+data.gateway+\"\\n\";\n \n if(data.macvlan > 0){\n startConfigText += \" MACVLAN \"+data.macvlan+\"\\n\";\n }\n if(data.macvlan_ext > 0){\n startConfigText += \" MACVLAN_EXT\" +data.macvlan_ext+\"\\n\";\n }\n \n if(!data.ip_range.isEmpty()){\n startConfigText += \" IP_RANGE \"+data.ip_range+\"\\n\";\n } \n\n if(data.tap){\n startConfigText += \" TAP YES\"+\"\\n\";\n }\n for(String unknownParam : data.unknownNetworkParams){\n startConfigText += \" \"+unknownParam+\"\\n\";\n }\n }\n \n // Cycle through container objects and write \n Component[] containers = ContainerPanePanel.getComponents();\n for(Component container : containers){\n ContainerData data = ((ContainerObjPanel)container).getConfigData(); \n startConfigText += \"CONTAINER \"+data.name+\"\\n\";\n startConfigText += \" USER \"+data.user+\"\\n\";\n if(data.script.isEmpty()){\n startConfigText += \" SCRIPT NONE\\n\";\n }\n else{\n startConfigText += \" SCRIPT \"+data.script+\"\\n\"; \n }\n \n if(data.x11){\n startConfigText += \" X11 YES\\n\"; \n }\n else{\n startConfigText += \" X11 NO\\n\";\n }\n // Not default\n if(data.terminal_count != 1)\n startConfigText += \" TERMINALS \"+data.terminal_count+\"\\n\";\n if(!data.terminal_group.isEmpty())\n startConfigText += \" TERMINAL_GROUP \"+data.terminal_group+\"\\n\";\n if(!data.xterm_title.isEmpty())\n startConfigText += \" XTERM \"+data.xterm_title+\" \"+data.xterm_script+\"\\n\";\n if(!data.password.isEmpty())\n startConfigText += \" PASSWORD \"+data.password+\"\\n\";\n for(LabData.ContainerAddHostSubData addHost : data.listOfContainerAddHost){\n if(addHost.type.equals(\"network\"))\n startConfigText += \" ADD-HOST \"+addHost.add_host_network+\"\\n\";\n else if(addHost.type.equals(\"ip\"))\n startConfigText += \" ADD-HOST \"+addHost.add_host_host+\":\"+addHost.add_host_ip+\"\\n\"; \n }\n for(LabData.ContainerNetworkSubData network : data.listOfContainerNetworks){\n startConfigText += \" \"+network.network_name+\" \"+network.network_ipaddress+\"\\n\"; \n }\n if(data.clone > 0){\n startConfigText += \" CLONE \"+data.clone+\"\\n\";\n }\n if(!data.lab_gateway.isEmpty()){\n startConfigText += \" LAB_GATEWAY \"+data.lab_gateway+\"\\n\";\n }\n if(data.no_gw){\n startConfigText += \" NO_GW YES\\n\";\n }\n if(!data.base_registry.isEmpty()){\n startConfigText += \" BASE_REGISTRY \"+data.base_registry+\"\\n\";\n }\n if(!data.thumb_volume.isEmpty()){\n startConfigText += \" THUMB_VOLUME \"+data.thumb_volume+\"\\n\";\n }\n if(!data.thumb_command.isEmpty()){\n startConfigText += \" THUMB_COMMAND \"+data.thumb_command+\"\\n\";\n }\n if(!data.thumb_stop.isEmpty()){\n startConfigText += \" THUMB_STOP \"+data.thumb_stop+\"\\n\";\n }\n if(!data.publish.isEmpty()){\n startConfigText += \" PUBLISH \"+data.publish+\"\\n\";\n }\n if(data.hide){\n startConfigText += \" HIDE YES\\n\";\n }\n if(data.no_privilege){\n startConfigText += \" NO_PRIVILEGE YES\\n\";\n }\n if(data.no_pull){\n startConfigText += \" NO_PULL YES\\n\";\n }\n if(data.mystuff){\n startConfigText += \" MYSTUFF YES\\n\";\n }\n if(data.tap){\n startConfigText += \" TAP YES\\n\";\n }\n if(!data.mount1.isEmpty() && !data.mount2.isEmpty()){\n startConfigText += \" MOUNT \"+data.mount1+\":\"+data.mount2+\"\\n\";\n }\n \n }\n \n //Write to File\n writer.print(startConfigText);\n writer.close();\n \n //Save results.config and goals.config file\n labDataCurrent.getResultsData().writeResultsConfig(usetmp);\n labDataCurrent.getGoalsData().writeGoalsConfig(usetmp);\n labDataCurrent.getParamsData().writeParamsConfig(usetmp);\n \n System.out.println(\"Lab Saved\");\n }", "@Test\n public void test19() throws Throwable {\n TextDirectoryLoader textDirectoryLoader0 = new TextDirectoryLoader();\n Instances instances0 = textDirectoryLoader0.getDataSet();\n Evaluation evaluation0 = new Evaluation(instances0);\n double double0 = evaluation0.KBInformation();\n assertEquals(0.0, double0, 0.01D);\n assertEquals(0.0, evaluation0.SFPriorEntropy(), 0.01D);\n }", "public static void test2() {\n String dataDir = \"/Data/cteam/tp/csm/seismicz/subz_401_4_600/\";\n String dataFile = \"tpets.dat\";\n int n1 = 401, n2 = 357, n3 = 161;\n float v = 1.0f, d = 30.0f;\n EigenTensors3 et = loadTensors(dataDir+dataFile);\n System.out.println(et);\n float[][][] paint = new float[n3][n2][n1];\n Painting3Group p3g = new Painting3Group(paint);\n PaintBrush pb = new PaintBrush(n1,n2,n3,et);\n pb.setSize(30);\n Painting3 p3 = p3g.getPainting3();\n for (int i3=0; i3<10; ++i3)\n for (int i2=0; i2<10; ++i2)\n for (int i1=0; i1<1; ++i1) {\n p3.paintAt(n1/2+i1,n2/2+i2,n3/2+i3,v,d,pb);\n }\n\n Contour c = p3.getContour(v);\n\n SimpleFrame sf = new SimpleFrame();\n sf.setTitle(\"Formation\");\n World world = sf.getWorld();\n TriangleGroup tg = new TriangleGroup(c.i,c.x);\n world.addChild(tg);\n }", "public void save(){\n checkpoint = chapter;\n }", "@Test\n public void test22() throws Throwable {\n TextDirectoryLoader textDirectoryLoader0 = new TextDirectoryLoader();\n Instances instances0 = textDirectoryLoader0.getDataSet();\n Evaluation evaluation0 = new Evaluation(instances0);\n FastVector fastVector0 = evaluation0.predictions();\n assertEquals(0.0, evaluation0.SFEntropyGain(), 0.01D);\n }", "public static void main(String[] args) {\n\t\tExemplaryContent ec = new ExemplaryContent();\n\t\tRendezvous rendezvous = ec.getExample();\n\n\t\t// make a few steps\n\t\tILOGExporter exporter = new ILOGExporter();\n\t\tILOGSolver solver = new ILOGSolver();\n\n\t\tFile modelFile = new File(\"Constraints-Displays-Model.mod\");\n\n\t\tPreferenceStructure preferences = new PreferenceStructure(); // unit preference structure Max-CSP\n\n\t\tResultChecker checker = new ResultChecker();\n\t\tfor (int steps = 0; steps < 5; ++steps) {\n\n\t\t\tString dataContent = exporter.getILOGDataFile(rendezvous);\n\t\t\tString preferencesContent = exporter.getPreferenceContent(preferences);\n\n\t\t\tSolution solution = solver.solve(modelFile, dataContent + \"\\n\" + preferencesContent);\n\n\t\t\tFrame selectedFrame = rendezvous.getContent().getFrameGraph().lookup(solution.getSelectedFrameId());\n\t\t\tsolution.setSelectedFrame(selectedFrame);\n\n\t\t\tSystem.out.println(\"Selected \" + solution.getSelectedFrameId());\n\n\t\t\tchecker.check(solution, rendezvous, preferences);\n\n\t\t\t// add to the seen frames\n\t\t\tfor (Group g : rendezvous.getMeetup().getGroups()) {\n\t\t\t\tfor (User u : g.getMembers()) {\n\t\t\t\t\tu.getSeenFrames().add(selectedFrame);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t// test suite has ended\n\t\tSystem.out.println(checker.retrieveCoverageInformation());\n\t}", "@Test\n public void test18() throws Throwable {\n TextDirectoryLoader textDirectoryLoader0 = new TextDirectoryLoader();\n Instances instances0 = textDirectoryLoader0.getDataSet();\n Evaluation evaluation0 = new Evaluation(instances0);\n double double0 = evaluation0.KBMeanInformation();\n assertEquals(0.0, evaluation0.SFPriorEntropy(), 0.01D);\n }", "@Test\n public void test03() throws Throwable {\n TextDirectoryLoader textDirectoryLoader0 = new TextDirectoryLoader();\n Instances instances0 = textDirectoryLoader0.getDataSet();\n Evaluation evaluation0 = new Evaluation(instances0);\n double[] doubleArray0 = new double[19];\n evaluation0.updateMargins(doubleArray0, 0, 0.0);\n assertEquals(0.0, evaluation0.SFPriorEntropy(), 0.01D);\n }", "@Test(timeout = 4000)\n public void test093() throws Throwable {\n TextDirectoryLoader textDirectoryLoader0 = new TextDirectoryLoader();\n Instances instances0 = textDirectoryLoader0.getDataSet();\n Evaluation evaluation0 = new Evaluation(instances0);\n Object[] objectArray0 = new Object[2];\n evaluation0.evaluateModel((Classifier) null, instances0, objectArray0);\n assertEquals(0.0, evaluation0.SFEntropyGain(), 0.01);\n }", "public void startTrainingMode() {\n\t\t\r\n\t}", "@Test(timeout = 4000)\n public void test031() throws Throwable {\n TextDirectoryLoader textDirectoryLoader0 = new TextDirectoryLoader();\n Instances instances0 = textDirectoryLoader0.getStructure();\n Evaluation evaluation0 = new Evaluation(instances0);\n double double0 = evaluation0.numFalseNegatives((-1436));\n assertEquals(0.0, evaluation0.SFPriorEntropy(), 0.01);\n assertEquals(0.0, double0, 0.01);\n }", "public void testStep() {\n\n DT_TractographyImage crossing = Images.getCrossing();\n\n FACT_FibreTracker tracker = new FACT_FibreTracker(crossing);\n\n Vector3D[] pds = crossing.getPDs(1,1,1);\n\n Vector3D step = tracker.getFirstStep(new Point3D(1.5 * Images.xVoxelDim, 1.2 * Images.yVoxelDim, 1.1 * Images.zVoxelDim), 0, true);\n\n assertEquals(1.0, pds[0].dot(step.normalized()), 1E-8);\n\n assertEquals(Images.xVoxelDim / 2.0, step.mod(), 0.05);\n \n step = tracker.getFirstStep(new Point3D(1.5 * Images.xVoxelDim, 1.2 * Images.yVoxelDim, 1.1 * Images.zVoxelDim), 0, false);\n\n assertEquals(-1.0, pds[0].dot(step.normalized()), 1E-8);\n\n step = tracker.getFirstStep(new Point3D(1.5 * Images.xVoxelDim, 1.2 * Images.yVoxelDim, 1.1 * Images.zVoxelDim), 1, true);\n\n assertEquals(1.0, pds[1].dot(step.normalized()), 1E-8);\n\n\n for (int i = 0; i < 2; i++) {\n\n step = tracker.getNextStep(new Point3D(1.5 * Images.xVoxelDim, 1.2 * Images.yVoxelDim, 1.1 * Images.zVoxelDim), new Vector3D(pds[i].x + 0.01, pds[i].y + 0.02, pds[i].z + 0.03).normalized());\n\n assertEquals(1.0, pds[i].dot(step.normalized()), 1E-8);\n\n }\n\n \n }", "public static void main(String[] args) throws IOException {\n\t\t \tstart=new A1063307_Checkpoint6();\r\n\t\t\tstart.setVisible(true);\r\n\t\t\tstart.setSize(200,200);\r\n\t\t\tstart.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);\r\n\t\t\tstart.setResizable(false);\t\r\n\t}", "@Test\n public void test29() throws Throwable {\n TextDirectoryLoader textDirectoryLoader0 = new TextDirectoryLoader();\n Instances instances0 = textDirectoryLoader0.getDataSet();\n Evaluation evaluation0 = new Evaluation(instances0, (CostMatrix) null);\n double double0 = evaluation0.pctCorrect();\n assertEquals(Double.NaN, double0, 0.01D);\n assertEquals(0.0, evaluation0.SFPriorEntropy(), 0.01D);\n }", "public static void main(String[] args) {\n\t\tUtility utility = new Utility();\n\t\t\n\t\t// build trainingset\n\t\tSystem.out.println(\"Training System....\");\n\t\tArrayList<Student> trainingSet = utility.readStudentfile(\"porto_math_train.csv\");\n\t\tArrayList<Variable> variableSets = Student.getAllVar();\n\n\t\tTree tree = new Tree();\n\t\tNode decisionTree = tree.buildTree2(trainingSet, variableSets);\n\n\t\tutility .printNode(decisionTree);\n\n\t\t// testing DT\n\t\tSystem.out.println(\"\\tTesting System (trainingSet)....\");\n\t\tutility.testTree2(trainingSet, decisionTree);\n\t\t\n\t\tSystem.out.println();\n\t\tSystem.out.println(\"\\tTesting System (testSet)....\");\n\t\tArrayList<Student> testSet = utility.readStudentfile(\"porto_math_test.csv\");\n\t\tutility.testTree2(testSet, decisionTree);\t\t\n\t}", "public static void main(String args[]) throws IOException{\n\t\t\n\t\t\n\t\tfor (int fold = 0; fold<10; fold++) {\n\t\t\t//triples_result(\"holders_\"+fold, \"test_holders_\"+fold+\"_result\"); //file, result_file\n\t\t\t//sentence_triples_word(\"holders_\"+fold, \"holders_gold_\"+fold, 0, \"holders_\"+fold); //crf_output\n\t\t\t\n\t\t\ttriples_result(\"holders_full_t_\"+fold, \"test_holders_t_\"+fold+\"_result\"); //file, result_file\n\t\t\tsentence_triples_hard_word(\"holders_\"+fold, \"holders_gold_\"+fold, 0, \"holders_t_\"+fold); //crf_output\n\n\t\t\t\n\t\t\tholder_triples = new LinkedList<Triples>();\n\t\t\tholder_prob = new LinkedList<Double>();\n\t\t\tgold_holders = new HashMap<String, Entries>();\n\n\t\t}\n\t\t\n\n\t\t\n\t\tfor (int fold = 0; fold<10; fold++) {\n\t\t\ttriples_result(\"targets_full_t_\"+fold, \"test_targets_t_\"+fold+\"_result\"); //file, result_file\n\t\t\tsentence_triples_hard_word(\"targets_\"+fold, \"targets_gold_\"+fold, 0, \"targets_t_\"+fold); //crf_output\n\t\t\t\n\t\t\tholder_triples = new LinkedList<Triples>();\n\t\t\tholder_prob = new LinkedList<Double>();\n\t\t\tgold_holders = new HashMap<String, Entries>();\n\n\t\t}\n\n\t\t\n\n\t\t\n\t\t//triples_result(\"targets_0\", \"test_targets_0_result\"); //file, result_file\n\t\t//sentence_triples_word(\"targets_0\", \"targets_gold_0\", 0, \"targets_0\"); //crf_output\n\t\t\n\t\t//triples_result(\"targets_1\", \"test_targets_1_result\"); //file, result_file\n\t\t//sentence_triples_word(\"targets_1\", \"targets_gold_1\", 1, \"targets_1\"); //crf_output\n\t}", "public void testParFileReading() {\n GUIManager oManager = null;\n String sFileName = null;\n try {\n\n oManager = new GUIManager(null);\n \n //Valid file 1\n oManager.clearCurrentData();\n sFileName = writeFile1();\n oManager.inputXMLParameterFile(sFileName);\n SeedPredationBehaviors oPredBeh = oManager.getSeedPredationBehaviors();\n ArrayList<Behavior> p_oBehs = oPredBeh.getBehaviorByParameterFileTag(\"DensDepRodentSeedPredation\");\n assertEquals(1, p_oBehs.size());\n DensDepRodentSeedPredation oPred = (DensDepRodentSeedPredation) p_oBehs.get(0);\n double SMALL_VAL = 0.00001;\n \n assertEquals(oPred.m_fDensDepDensDepCoeff.getValue(), 0.07, SMALL_VAL);\n assertEquals(oPred.m_fDensDepFuncRespExpA.getValue(), 0.02, SMALL_VAL);\n\n assertEquals( ( (Float) oPred.mp_fDensDepFuncRespSlope.getValue().get(0)).\n floatValue(), 0.9, SMALL_VAL);\n assertEquals( ( (Float) oPred.mp_fDensDepFuncRespSlope.getValue().get(1)).\n floatValue(), 0.05, SMALL_VAL);\n\n //Test grid setup\n assertEquals(1, oPred.getNumberOfGrids());\n Grid oGrid = oManager.getGridByName(\"Rodent Lambda\");\n assertEquals(1, oGrid.getDataMembers().length);\n assertTrue(-1 < oGrid.getFloatCode(\"rodent_lambda\")); \n \n }\n catch (ModelException oErr) {\n fail(\"Seed predation validation failed with message \" + oErr.getMessage());\n }\n catch (java.io.IOException oE) {\n fail(\"Caught IOException. Message: \" + oE.getMessage());\n }\n finally {\n new File(sFileName).delete();\n }\n }", "@Test\n public void test28() throws Throwable {\n TextDirectoryLoader textDirectoryLoader0 = new TextDirectoryLoader();\n Instances instances0 = textDirectoryLoader0.getDataSet();\n CostSensitiveClassifier costSensitiveClassifier0 = new CostSensitiveClassifier();\n CostMatrix costMatrix0 = costSensitiveClassifier0.getCostMatrix();\n Evaluation evaluation0 = null;\n try {\n evaluation0 = new Evaluation(instances0, costMatrix0);\n fail(\"Expecting exception: Exception\");\n \n } catch(Exception e) {\n //\n // Cost matrix not compatible with data!\n //\n }\n }", "@Test\n public void test40() throws Throwable {\n TextDirectoryLoader textDirectoryLoader0 = new TextDirectoryLoader();\n Instances instances0 = textDirectoryLoader0.getDataSet();\n Evaluation evaluation0 = new Evaluation(instances0);\n String string0 = evaluation0.toSummaryString();\n assertEquals(0.0, evaluation0.SFPriorEntropy(), 0.01D);\n assertEquals(0.0, evaluation0.unclassified(), 0.01D);\n }", "public static void main(String[] args) {\n\t\tList<String> listSouceCode = Helper.getAllDataFromFolder(DATASET1);\n\n\t\t//Create the HMM for concepts\n\t\tHMMConcept hmmConcept = new HMMConcept();\n\t\thmmConcept.init();\n\t\tHMMConceptInit.initTransition(hmmConcept);\n\n\t\t//Now, let us test the training phase\n\t\t//Transition probabilities\n\t\tHMMConceptTransition.\n\t\t\tpreTransition(listSouceCode, hmmConcept);\n\t\tHMMConceptTransition.\n\t\t\ttargetTransition(listSouceCode, hmmConcept);\n\t\tHMMConceptTransition.\n\t\t\totherTransition(listSouceCode, hmmConcept);\n//\t\t//Observations probabilities\n\t\tHMMConceptObservation.\n\t\t\tpreObservation(listSouceCode, hmmConcept);\n\t\tHMMConceptObservation.\n\t\t\ttargetObservation(listSouceCode, hmmConcept);\n\t\tHMMConceptObservation.\n\t\t\totherObservation(listSouceCode, hmmConcept);\n\t\t\n//\t\tSystem.out.println(hmmConcept);\n\n//\t\t//*************************END of the HMM training***************************************\n\n\t\t///To extract knowledge, just uncomment the corresponding source code\n\t\t\n\t\t/**\n\t\t * EPICAM Knowledge extraction\n//\t\t */\n//\t\t//Knowledge extraction\n//\t\tList<String> testedSourceCode = Helper.getAllDataFromFolder(DATASET2);\n//\t\tList<Column> alphaTable;\n//\t\t\n//\t\tfor (String sourceFile : testedSourceCode) {\n//\t\t\talphaTable = MostLikelyExplanationConcept.\n//\t\t\t\t\tfillAlphaStartTable4Concepts(hmmConcept, sourceFile);\n//\n//\t\t\tString extracted = MostLikelyExplanationConcept.knowledgeExtraction(alphaTable);\n////\t\t\tWriting to an OWL file\n//\t\t\tHelper.writeDataToFile(CONCEPTSEXTRACTED, extracted);\n//\t\t\t//The number of false positives and the number of target\n//\t\t\tSystem.out.println(MostLikelyExplanationConcept.nbFalsePositive+\"\\n and nb target: \"+\n//\t\t\tMostLikelyExplanationConcept.nbTarget);\n//\t\t\t\n////\t\t\tSystem.out.println(Term2OWL.term2OWL(new File(CONCEPTSEXTRACTED)));\n//\n//\t\t}\n\n\t\t/**\n\t\t * Geoserver knowledge extraction\n\t\t */\n\n\t\tList<String> testedSourceCode = Helper.getAllDataFromFolder(GEOSERVER);\n\t\tList<Column> alphaTable;\n\t\t\n\t\tfor (String sourceFile : testedSourceCode) {\n\t\t\talphaTable = MostLikelyExplanationConcept.\n\t\t\t\t\tfillAlphaStartTable4Concepts(hmmConcept, sourceFile);\n\n\t\t\tString extracted = MostLikelyExplanationConcept.knowledgeExtraction(alphaTable);\n//\t\t\tWriting to an OWL file\n\t\t\tHelper.writeDataToFile(TERMSEXTRACTED2GEOSERVER, extracted);\n\t\t\t//The number of false positives and the number of target\n\t\t\t\n//\t\t\tSystem.out.println(Term2OWL.term2OWL(new File(CONCEPTSEXTRACTED)));\n\n\t}\n\t\tSystem.out.println(MostLikelyExplanationConcept.nbFalsePositive+\"\\n and nb target: \"+\n\t\tMostLikelyExplanationConcept.nbTarget);\n\t}", "public static void main(String[] args) throws FileNotFoundException, IOException, InterruptedException {\n ArrayList<Metric> metrics = new ArrayList<Metric>();\n metrics.add(new ELOC());\n metrics.add(new NOPA());\n metrics.add(new NMNOPARAM());\n MyClassifier c1 = new MyClassifier(\"Logistic Regression\");\n c1.setClassifier(new Logistic());\n String type = \"CodeSmellDetection\";\n String smell = \"Large Class\";\n Model model = new Model(\"antModel1\", \"ant\", \"https://github.com/apache/ant.git\", metrics, c1, \"\", type, smell);\n Process process = new Process();\n String periodLength = \"All\";\n String version = \"rel/1.8.3\";\n \n String projectName = model.getProjName();\n process.initGitRepositoryFromFile(scatteringFolderPath + \"/\" + projectName\n + \"/gitRepository.data\");\n try {\n DeveloperTreeManager.calculateDeveloperTrees(process.getGitRepository()\n .getCommits(), periodLength);\n DeveloperFITreeManager.calculateDeveloperTrees(process.getGitRepository()\n .getCommits(), periodLength);\n } catch (Exception ex) {\n Logger.getLogger(TestFile.class.getName()).log(Level.SEVERE, null, ex);\n }\n \n List<Commit> commits = process.getGitRepository().getCommits();\n PeriodManager.calculatePeriods(commits, periodLength);\n List<Period> periods = PeriodManager.getList();\n \n String dirPath = Config.baseDir + projectName + \"/models/\" + model.getName();\n Files.createDirectories(Paths.get(dirPath));\n \n for (Period p : periods) {\n File periodData = new File(dirPath + \"/predictors.csv\");\n PrintWriter pw1 = new PrintWriter(periodData);\n \n String message1 = \"nome,\";\n for(Metric m : metrics) {\n message1 += m.getNome() + \",\";\n }\n message1 += \"isSmell\\n\";\n pw1.write(message1);\n \n //String baseSmellPatch = \"C:/ProgettoTirocinio/dataset/apache-ant-data/apache_1.8.3/Validated\";\n CalculateSmellFiles cs = new CalculateSmellFiles(model.getProjName(), \"Large Class\", \"1.8.1\");\n \n List<FileBean> smellClasses = cs.getSmellClasses();\n \n String projectPath = baseFolderPath + projectName;\n \n Git.gitReset(new File(projectPath));\n Git.clean(new File(projectPath));\n \n List<FileBean> repoFiles = Git.gitList(new File(projectPath), version);\n System.out.println(\"Repo size: \"+repoFiles.size());\n \n \n for (FileBean file : repoFiles) {\n \n if (file.getPath().contains(\".java\")) {\n File workTreeFile = new File(projectPath + \"/\" + file.getPath());\n\n ClassBean classBean = null;\n \n if (workTreeFile.exists()) {\n ArrayList<ClassBean> code = new ArrayList<>();\n ArrayList<ClassBean> classes = ReadSourceCode.readSourceCode(workTreeFile, code);\n \n String body = file.getPath() + \",\";\n if (classes.size() > 0) {\n classBean = classes.get(0);\n\n }\n for(Metric m : metrics) {\n try{\n body += m.getValue(classBean, classes, null, null, null, null) + \",\";\n } catch(NullPointerException e) {\n body += \"0.0,\";\n }\n }\n \n //isSmell\n boolean isSmell = false;\n for(FileBean sm : smellClasses) {\n if(file.getPath().contains(sm.getPath())) {\n System.out.println(\"ok\");\n isSmell = true;\n break;\n }\n }\n \n body = body + isSmell + \"\\n\";\n pw1.write(body); \n }\n }\n }\n Git.gitReset(new File(projectPath));\n pw1.flush();\n }\n \n WekaEvaluator we1 = new WekaEvaluator(baseFolderPath, projectName, new Logistic(), \"Logistic Regression\", model.getName());\n \n ArrayList<Model> models = new ArrayList<Model>();\n \n models.add(model);\n System.out.println(models);\n //create a project\n Project p1 = new Project(\"https://github.com/apache/ant.git\");\n p1.setModels(models);\n p1.setName(\"ant\");\n p1.setVersion(version);\n \n ArrayList<Project> projects;\n //projects.add(p1);\n \n //create a file\n// try {\n// File f = new File(Config.baseDir + \"projects.txt\");\n// FileOutputStream fileOut;\n// if(f.exists()){\n// projects = ProjectHandler.getAllProjects(); \n// Files.delete(Paths.get(Config.baseDir + \"projects.txt\"));\n// //fileOut = new FileOutputStream(f, true);\n// } else {\n// projects = new ArrayList<Project>();\n// Files.createFile(Paths.get(Config.baseDir + \"projects.txt\"));\n// }\n// fileOut = new FileOutputStream(f);\n// projects.add(p1);\n// ObjectOutputStream out = new ObjectOutputStream(fileOut);\n// out.writeObject(projects);\n// out.close();\n// fileOut.close();\n//\n// } catch (FileNotFoundException e) {\n// e.printStackTrace();\n// } catch (IOException e) {\n// e.printStackTrace();\n// }\n// ProjectHandler.setCurrentProject(p1);\n// Project curr = ProjectHandler.getCurrentProject();\n// System.out.println(curr.getGitURL()+\" --- \"+curr.getModels());\n// ArrayList<Project> projectest = ProjectHandler.getAllProjects();\n// for(Project testp : projectest){\n// System.out.println(testp.getModels());\n// }\n }", "@Test(timeout = 4000)\n public void test103() throws Throwable {\n TextDirectoryLoader textDirectoryLoader0 = new TextDirectoryLoader();\n Instances instances0 = textDirectoryLoader0.getDataSet();\n Evaluation evaluation0 = new Evaluation(instances0);\n double[][] doubleArray0 = evaluation0.confusionMatrix();\n assertEquals(0, doubleArray0.length);\n assertEquals(0.0, evaluation0.SFPriorEntropy(), 0.01);\n }", "TrainingTest createTrainingTest();", "@Override\n\tpublic void lab() {\n\t\t\n\t}", "public static void main(String args[]){\n\t\t//parameters that can be modified\n\t\tint topicNum=100;\n\t\tString sourceID=\"1864252027/\";\n\t\tint subnetworkSize=1100;\n\t\tString dir=\"sampleTest/\"+sourceID+subnetworkSize+\"/\";\n\t\tString fileName=\"ldaInput.txt\";\n\t\tint iterationNum=1000;\n\t\t\n\t\t//read training data from file\n\t\tSystem.out.println(\"loading files\");\n\t\tGraph network=GraphOperator.getFromFile(dir+\"sample.network\");\n\t\tHashMap<String,Message>trainingStatusMap=MessageListOperator.readMessageFromFile(dir+\"trainingSet.status\");\n\t\tHashMap<String,Message>commentMap=MessageListOperator.readMessageFromFile(dir+\"samplePreDoc.comment\");\n\t\t\n\t\tDocumentAssign.relateMessageToNetwork(network,trainingStatusMap,commentMap);\n\t\tDocumentAssign.optimizedAssign(network,dir,fileName);\n\t\t\n\t\tSystem.out.println(\"Training\");\t\n\t\t//training with Optimized assignment\n\t\tLDA_InfluMax.estimationFromScratch(50/((double)topicNum),0.01,topicNum,\n\t\t\t\titerationNum,iterationNum/2,dir,fileName,50);\n\t}", "public static void main(String[] args) {\n\t\tSparkConf conf = new SparkConf().setAppName(\"NB\").setMaster(\"local[*]\").set(\"spark.ui.port\",\"4040\");;\n\t JavaSparkContext jsc = new JavaSparkContext(conf);\n\t\tString path = \"localpath\";\n\t\tJavaRDD<LabeledPoint> inputData = MLUtils.loadLabeledPoints(jsc.sc(), path).toJavaRDD();\n\t\tJavaRDD<LabeledPoint>[] tmp = inputData.randomSplit(new double[]{0.6, 0.4});\n\t\tJavaRDD<LabeledPoint> training = tmp[0]; // training set\n\t\tJavaRDD<LabeledPoint> test = tmp[1]; // test set\n\t\tNaiveBayesModel model = NaiveBayes.train(training.rdd(), 1.0);\n\t\tJavaPairRDD<Double, Double> predictionAndLabel =\n\t\t test.mapToPair(p -> new Tuple2<>(model.predict(p.features()), p.label()));\n\t\t// Save and load model\n\t\tmodel.save(jsc.sc(), \"localotuput_path\");\n\t\tNaiveBayesModel sameModel = NaiveBayesModel.load(jsc.sc(), \"localotuput_path\");\n\t\t\n\t\tdouble accuracy =\n\t\t\t\t predictionAndLabel.filter(pl -> pl._1().equals(pl._2())).count() / (double) test.count();\n\t\t\t\t\n\t\tSystem.out.println(\"The final accuracy is\"+accuracy);\n//\t\tpredictionAndLabel.foreach(data -> {\n//\t\t System.out.println(\"final model=\"+data._1() + \"final label=\" + data._2());\n//\t\t}); \n\t}", "@Procedure(value = \"mlp.train\", mode = WRITE)\n @Description(\"Backward pass through NN\")\n public void train(@Name(value = \"no. of passes\") long nPasses) {\n\n DataLogger logger = new DataLogger(\"proto1\", \"error\");\n\n for (int i = 0; i < nPasses; i++) {\n updateTrainRate(i + 1);\n forwardPass();\n\n double error = calculateError();\n\n double reward = 1.0 - error;\n\n// if (Math.random() > 0.9) reward = error;\n\n backwardPass(reward);\n moveNext();\n\n\n// System.out.println(String.format(\"Error: %f\", error));\n// if (i % 100 == 0 && i > 0) {\n// double meanError = errors.stream().reduce(0.0, Double::sum) / 100;\n// System.out.println(String.format(\n// \"Mean error: %f, eta: %f\", meanError, eta));\n// errors.clear();\n// }\n// errors.add(error);\n logger.append(error);\n\n\n }\n\n forwardPass();\n logger.close();\n }", "public static void main(String[] args) {\n\t\t/*Tuple[] tuples = new Tuple[]{\n\t\t\tnew Tuple(\"0 0 1 0 0\", \"1 3\", ' '),\n\t\t\tnew Tuple(\"1 0 0 1 1\", \"1 2\", ' '),\n\t\t\tnew Tuple(\"0 0 0 1 1\", \"1 1\", ' '),\n\t\t\tnew Tuple(\"1 1 0 0 1\", \"2 1\", ' '),\n\t\t\tnew Tuple(\"1 1 0 0 1\", \"3 1\", ' '),\n\t\t\tnew Tuple(\"1 1 0 0 1\", \"3 2\", ' '),\n\t\t\tnew Tuple(\"0 0 0 1 0\", \"3 3\", ' '),\n\t\t\tnew Tuple(\"0 1 0 1 1\", \"2 3\", ' ')\n\t\t};\n\t\tdata = new DataSet(tuples);*/\n\t\t\n\t\t//data = Parser.parseAttributes(\"Corel5k-train.arff\", 374);\n\t\tdata = Parser.parseShortNotation(\"diabetes.txt\", 1, new NumericalItemSet(new int[]{}));\n\t\ts = data.s();\n\t\tn = data.getTuples().length;\n\t\tm = data.getTuples()[0].getClassValues().length;\n\t\t\n\t\t/*double u = 0;\n\t\tlong l = 0;\n\t\tfor(int j = 0; j < 10; j++) {\n\t\t\tdouble t = System.currentTimeMillis();\n\t\t\tfor(int i = 0; i < 10000; i++)\n\t\t\t\tu = data.getBluePrint().getOneItemSet(2, 48).ub();\n\t\t\tl += (System.currentTimeMillis() - t);\n\t\t}\n\t\tSystem.out.println(((double)l/10));*/\n\t\n\t\t\n\t\tSystem.out.println(\"Data loaded, \"+data.getTuples().length+\" tuples, \"+\n\t\t\t\tdata.getTuples()[0].getItemSet().getLength()+\" items, \"+\n\t\t\t\tdata.getTuples()[0].getClassValues().length+\" class values\");\n\t\t\t\t\n\t\tStopWatch.tic(\"Full time\");\n\t\tSystem.out.println(icc());\n\t\tStopWatch.printToc(\"Full time\");\n\t}", "@Test(timeout = 4000)\n public void test110() throws Throwable {\n TextDirectoryLoader textDirectoryLoader0 = new TextDirectoryLoader();\n Instances instances0 = textDirectoryLoader0.getDataSet();\n Evaluation evaluation0 = new Evaluation(instances0);\n String string0 = evaluation0.toSummaryString();\n assertEquals(0.0, evaluation0.unclassified(), 0.01);\n assertEquals(\"\\nTotal Number of Instances 0 \\n\", string0);\n assertEquals(0.0, evaluation0.SFPriorEntropy(), 0.01);\n }", "@MediumTest\n public void test_1314_2() throws Exception {\n String imagePath = Environment.getExternalStorageDirectory()+\"/LeCoder_Image/statement_without_prev.png\";\n //Load the file and process it\n activity.loadImageFile(imagePath);\n activity.processImage();\n //Generate the nodes and construct the graph\n activity.generateNodes();\n activity.generateGraph();\n //Print all nodes\n activity.printAllNodes();\n //Check whether the flowchart has no start point\n assertFalse(activity.checkAllNodes());\n }", "public static void main(String[] args) \n\t{\n\t\t// Konfiguration\n\t\tTraining training = new Training();\n\t\tint numberOfAttributes = 18;\n\t\tStatisticOutput statisticWriter = new StatisticOutput(\"data/statistics.txt\");\n\t\t\n\t\ttraining.printMessage(\"*** TCR-Predictor: Training ***\");\n\t\t\n\t\ttraining.printMessage(\"Datenbank von Aminosäure-Codierungen wird eingelesen\");\n\t\t// Lies die EncodingDB ein\n\t\tAAEncodingFileReader aa = new AAEncodingFileReader();\n\t\tAAEncodingDatabase db = aa.readAAEncodings(\"data/AAEncodings.txt\");\n\t\ttraining.printMessage(\"Es wurden \" + db.getEncodingDatabase().size() + \" Codierungen einglesen\");\n\t\t\n\t\ttraining.printMessage(\"Trainingsdatensatz wird eingelesen und prozessiert\");\n\t\t// Lies zunächst die gesamten Trainingsdaten ein\n\t\tExampleReader exampleReader = new ExampleReader();\n\t\t\n\t\t// Spalte das Datenset\n\t\tDataSplit dataSplit_positives = new DataSplit(exampleReader.getSequnces(\"data/positive.txt\"), 5);\n\t\tArrayList<ArrayList<String>> complete_list_positiv = dataSplit_positives.getDataSet();\n\t\t\n\t\tDataSplit dataSplit_negatives = new DataSplit(exampleReader.getSequnces(\"data/negative.txt\"), 5);\n\t\tArrayList<ArrayList<String>> complete_list_negativ = dataSplit_negatives.getDataSet();\n\t\t\n\t\t// Lege Listen für die besten Klassifizierer und deren Evaluation an\n\t\tModelCollection modelCollection = new ModelCollection();\n\t\t\n\t\t/*\n\t\t * \n\t\t * Beginne Feature Selection\n\t\t * \n\t\t */\n\t\tArrayList<String> positivesForFeatureSelection = training.concatenateLists(complete_list_positiv);\n\t\tArrayList<String> negativesForFeatureSelection = training.concatenateLists(complete_list_negativ);\n\t\t\n\t\ttraining.printMessage(\"Convertiere Daten ins Weka ARFF Format\");\t\t\n\t\t// Convertiere Daten in Wekas File Format\n\t\tARFFFileGenerator arff = new ARFFFileGenerator();\n\t\tInstances dataSet = arff.createARFFFile(positivesForFeatureSelection, negativesForFeatureSelection, db.getEncodingDatabase());\n\t\tdataSet.setClass(dataSet.attribute(\"activator\"));\t\t\t// Lege das nominale Attribut fest, wonach klassifiziert wird\n\t\tdataSet.deleteStringAttributes(); \t\t\t\t\t\t\t// Entferne String-Attribute\n\t\t\n\t\ttraining.printMessage(\"Führe Feature Selection (Filtering) aus\");\n\t\t// Beginne Feature Selection\n\t\tFeatureFilter featureFilter = new FeatureFilter();\n\t\tfeatureFilter.rankFeatures(dataSet, numberOfAttributes);\t\t\t\t\t// Wähle die x wichtigsten Features aus\n\t\tdataSet = featureFilter.getProcessedInstances();\n\t\ttraining.printMessage(\"Ausgewählte Features: \" + featureFilter.getTopResults());\n\n\t\t/*\n\t\t * Führe die äußere Evaluierung fünfmal durch und wähle das beste Modell\n\t\t */\n\t\tfor (int outer_run = 0; outer_run < 5; outer_run++)\n\t\t{\n\t\t\tstatisticWriter.writeString(\"===== Äußere Evaluation \" + (outer_run + 1) + \"/5 =====\\n\\n\");\n\t\t\t\n\t\t\t\n\t\t\tArrayList<ArrayList<String>> list_positives = new ArrayList<ArrayList<String>>();\n\t\t\tlist_positives.addAll(complete_list_positiv);\n\t\t\t\n\t\t\tArrayList<ArrayList<String>> list_negatives = new ArrayList<ArrayList<String>>();\n\t\t\tlist_negatives.addAll(complete_list_negativ);\n\t\t\t\n\t\t\t// Lege das erste Fragment beider Listen für nasted-Crossvalidation beiseite\n\t\t\tArrayList<String> outer_List_pos = new ArrayList<String>();\n\t\t\touter_List_pos.addAll(list_positives.get(outer_run));\n\t\t\tlist_positives.remove(outer_run);\n\t\t\t\n\t\t\tArrayList<String> outer_List_neg = new ArrayList<String>();\n\t\t\touter_List_neg.addAll(list_negatives.get(outer_run));\n\t\t\tlist_negatives.remove(outer_run);\n\t\t\t\n\t\t\t// Füge die verbleibende Liste zu einer Zusammen\n\t\t\tArrayList<String> inner_List_pos = training.concatenateLists(list_positives);\n\t\t\tArrayList<String> inner_List_neg = training.concatenateLists(list_negatives);\n\t\t\t\t\n\n\t\t\t/*\n\t\t\t * \n\t\t\t * Ab hier nur noch Arbeiten mit innerer Liste, die Daten zum Evaluieren bekommt Weka vorerst \n\t\t\t * nicht zu sehen!\n\t\t\t * \n\t\t\t */\n\t\t\ttraining.printMessage(\"Convertiere Daten ins Weka ARFF Format\");\t\t\n\t\t\t// Convertiere Daten in Wekas File Format\n\t\t\tarff = new ARFFFileGenerator();\n\t\t\tdataSet = arff.createARFFFile(inner_List_pos, inner_List_neg, db.getEncodingDatabase());\n\t\t\tdataSet.setClass(dataSet.attribute(\"activator\"));\t\t\t// Lege das nominale Attribut fest, wonach klassifiziert wird\n\t\t\tdataSet.deleteStringAttributes(); \t\t\t\t\t\t\t// Entferne String-Attribute\n\t\t\t\n\t\t\tfeatureFilter.processInstances(featureFilter.getRanking(), dataSet, numberOfAttributes); // Filtere das innere Datenset nach Vorgabe\n\t\t\tdataSet = featureFilter.getProcessedInstances();\n\t\t\t\n\t\t\ttraining.printMessage(\"Beginne Gridsearch\");\n\t\t\t// Gridsearch starten\n\t\n\t\t\t\n\t\t\t\n\t\t\tParameterOptimization optimizer = new ParameterOptimization();\n\t\t\tString logFileName = outer_run + \"_\" + numberOfAttributes;\n\t\t\tGridSearch gridSearch = optimizer.performGridSearch(dataSet, logFileName);\n\t\t\ttraining.printMessage(\"Gefundene Parameter [C, gamma]: \" + gridSearch.getValues()); // liefert unter diesen Settings 1.0 und 0.0\n\n\t\t\tSMO sMO = (SMO)gridSearch.getBestClassifier();\n\t\t\t\t\t\t\t\n\t\t\t/*\n\t\t\t * \n\t\t\t * Evaluationsbeginn \n\t\t\t *\n\t\t\t */\n\t\t\ttraining.printMessage(\"Evaluiere die Performance gegen das äußere Datenset\");\n\t\t\ttraining.printMessage(\"Transcodierung des Evaluationsdatensatzes\");\n\t\t\tarff = new ARFFFileGenerator();\n\t\t\tdataSet = arff.createARFFFile(outer_List_pos, outer_List_neg, db.getEncodingDatabase());\n\t\t\tdataSet.setClass(dataSet.attribute(\"activator\"));\t\t\t// Lege das nominale Attribut fest, wonach klassifiziert wird\n\t\t\tdataSet.deleteStringAttributes(); \t\t\t\t\t\t\t// Entferne String-Attribute\n\t\t\t\n\t\t\t// Führe Feature-Filtering mit den Einstellungen der GridSearch aus\n\t\t\ttraining.printMessage(\"Führe Feature Selection (Filtering) auf GridSearch-Basis aus\");\n\t\t\t// Beginne Feature Selection\n\t\t\tfeatureFilter.processInstances(featureFilter.getRanking(), dataSet, numberOfAttributes);\t // Wähle die x wichtigsten Features aus\n\t\t\tdataSet = featureFilter.getProcessedInstances();\n\t\t\t\n\t\t\t\n\t\t\t\n\t\t\ttraining.printMessage(\"Ermittle Performance\");\n\t\t\tEvaluator eval = new Evaluator();\n\t\t\teval.classifyDataSet(sMO, dataSet);\n\t\t\ttraining.printMessage(eval.printRawData());\n\t\t\t\n\t\t\t/*\n\t\t\t * Füge das Modell und die externe Evaulation zur Sammlung hinzu\n\t\t\t */\t\t\t\n\t\t\tmodelCollection.bestClassifiers.add(sMO);\n\t\t\tmodelCollection.evalsOfBestClassifiers.add(eval);\n\t\t\tmodelCollection.listOfNumberOfAttributes.add(numberOfAttributes);\n\t\t\tmodelCollection.listOfFeatureFilters.add(featureFilter);\n\t\t\t\n\t\t\tstatisticWriter.writeString(\"Verwendete Attribute: \" + featureFilter.getTopResults());\n\t\t\tstatisticWriter.writeString(eval.printRawData());\n\t\t\t\n\t\t}\n\t\tstatisticWriter.close();\n\t\t\n\t\t// Wähle das beste aller Modelle aus\n\t\ttraining.printMessage(\"Ermittle die allgemein besten Einstellungen\");\n\t\tModelSelection modelSelection = new ModelSelection();\n\t\tmodelSelection.calculateBestModel(modelCollection);\n\t\t\n\t\ttraining.printMessage(\"Das beste Model: \");\n\t\ttraining.printMessage(modelSelection.getBestEvaluator().printRawData());\n\t\tSystem.out.println(\"------ SMO ------\");\n\t\tfor (int i = 0; i < modelSelection.getBestClassifier().getOptions().length; i++)\n\t\t{\n\t\t\tSystem.out.print(modelSelection.getBestClassifier().getOptions()[i] + \" \");\n\t\t}\n\t\tSystem.out.println(\"\\n--- Features ---\");\n\t\tSystem.out.println(modelSelection.getBestListOfFeatures().getTopResults());\n\t\t\n\t\t// Schreibe das Modell in eine Datei\n\t\ttraining.printMessage(\"Das beste Modell wird auf Festplatte geschrieben\");\n\t\ttry\n\t\t{\n\t\t\tSerializationHelper.write(\"data/bestPredictor.model\", modelSelection.getBestClassifier());\n\t\t\tSerializationHelper.write(\"data/ranking.filter\", modelSelection.getBestListOfFeatures().getRanking());\n\t\t\tSerializationHelper.write(\"data/components.i\", (modelSelection.getBestListOfFeatures().getProcessedInstances().numAttributes()-1));\n\t\t}\n\t\tcatch (Exception ex)\n\t\t{\n\t\t\tSystem.err.println(\"Fehler beim Schreiben des Modells auf Festplatte: \" + ex);\n\t\t}\n\t}", "@Before\n public void DataSmoothExamples4() {\n\t LinkedList<Episode> eps12 = new LinkedList<Episode>();\n\t\teps12.add(new Episode(\"How your mother met me\", 22));\n\t\teps12.add(new Episode(\"Unpause\", 23));\n\t\teps12.add(new Episode(\"Slapsgiving\", 24));\t\t\n\t\tshows4.add(new Show(\"How I Met Your Mother\", 1300, eps12, false));\n\t\t\n\t\tLinkedList<Episode> eps13 = new LinkedList<Episode>();\n\t\teps13.add(new Episode(\"Hello\", 44));\n\t\teps13.add(new Episode(\"Test\", 44));\n\t\teps13.add(new Episode(\"Maybe\", 50));\n\t\teps13.add(new Episode(\"Cool\", 50));\n\t\tshows4.add(new Show(\"Words\", 1900, eps13, false));\n\t\t\n\t\tLinkedList<Episode> eps14 = new LinkedList<Episode>();\n\t\teps14.add(new Episode(\"Beaver\", 21));\n\t\teps14.add(new Episode(\"Giraffe\", 23));\n\t\teps14.add(new Episode(\"Ostrich\", 25));\n\t\tshows4.add(new Show(\"Animals\", 500, eps14, false));\n\t\t\n\t\tLinkedList<Episode> eps15 = new LinkedList<Episode>();\n\t\teps15.add(new Episode(\"W\", 28));\n\t\teps15.add(new Episode(\"P\", 27));\n\t\teps15.add(new Episode(\"I\", 29));\n\t\tshows4.add(new Show(\"WPI\", 1100, eps15, false));\n\n\t showResults4.add(23.0);\n\t showResults4.add(31.0);\n\t showResults4.add(32.67);\n\t showResults4.add(28.0);\n }", "public void testPAUMChunkLearnng() throws IOException, GateException {\n // Initialisation\n System.out.print(\"Testing the PAUM method on chunk learning...\");\n File chunklearningHome = new File(new File(learningHome, \"test\"),\n \"chunklearning\");\n String configFileURL = new File(chunklearningHome,\n \"engines-paum.xml\").getAbsolutePath();\n String corpusDirName = new File(chunklearningHome, \"data-ontonews\")\n .getAbsolutePath();\n //Remove the label list file, feature list file and chunk length files.\n String wdResults = new File(chunklearningHome,\n ConstantParameters.SUBDIRFORRESULTS).getAbsolutePath();\n emptySavedFiles(wdResults);\n String inputASN = \"Key\";\n loadSettings(configFileURL, corpusDirName, inputASN, inputASN);\n // Set the evaluation mode\n RunMode runM=RunMode.EVALUATION;\n learningApi.setLearningMode(runM);\n controller.execute();\n // Using the evaluation mode for testing\n EvaluationBasedOnDocs evaluation = learningApi.getEvaluation();\n // Compare the overall results with the correct numbers\n /*assertEquals(evaluation.macroMeasuresOfResults.correct, 3);\n assertEquals(evaluation.macroMeasuresOfResults.partialCor, 1);\n assertEquals(evaluation.macroMeasuresOfResults.spurious, 19);\n assertEquals(evaluation.macroMeasuresOfResults.missing, 68);*/\n assertEquals(\"Wrong value for correct: \", 52, (int)Math.floor(evaluation.macroMeasuresOfResults.correct));\n assertEquals(\"Wrong value for partial: \", 12, (int)Math.floor(evaluation.macroMeasuresOfResults.partialCor));\n assertEquals(\"Wrong value for spurious: \", 24, (int)Math.floor(evaluation.macroMeasuresOfResults.spurious));\n assertEquals(\"Wrong value for missing: \", 30, (int)Math.floor(evaluation.macroMeasuresOfResults.missing));\n // Remove the resources\n clearOneTest();\n System.out.println(\"completed\");\n }", "@Test(timeout = 4000)\n public void test105() throws Throwable {\n TextDirectoryLoader textDirectoryLoader0 = new TextDirectoryLoader();\n Instances instances0 = textDirectoryLoader0.getStructure();\n Evaluation evaluation0 = new Evaluation(instances0);\n evaluation0.setDiscardPredictions(true);\n assertTrue(evaluation0.getDiscardPredictions());\n }", "boolean previousStep();", "public static void main(String[] args) throws Exception {\n int numLinesToSkip = 0;\n String delimiter = \",\"; //这是csv文件中的分隔符\n RecordReader recordReader = new CSVRecordReader(numLinesToSkip,delimiter);\n recordReader.initialize(new FileSplit(new ClassPathResource(\"dataSet20170119.csv\").getFile()));\n\n //Second: the RecordReaderDataSetIterator handles conversion to DataSet objects, ready for use in neural network\n\n /**\n * 这是标签(类别)所在列的序号\n */\n int labelIndex = 0; //5 values in each row of the iris.txt CSV: 4 input features followed by an integer label (class) index. Labels are the 5th value (index 4) in each row\n //类别的总数\n int numClasses = 2; //3 classes (types of iris flowers) in the iris data set. Classes have integer values 0, 1 or 2\n\n //一次读取多少条数据。当数据量较大时可以分几次读取,每次读取后就训练。这就是随机梯度下降\n int batchSize = 2000; //Iris data set: 150 examples total. We are loading all of them into one DataSet (not recommended for large data sets)\n\n DataSetIterator iterator = new RecordReaderDataSetIterator(recordReader,batchSize,labelIndex,numClasses);\n //因为我在这里写的2000是总的数据量大小,一次读完,所以一次next就完了。如果分批的话要几次next\n DataSet allData = iterator.next();\n// allData.\n allData.shuffle();\n SplitTestAndTrain testAndTrain = allData.splitTestAndTrain(0.8); //Use 65% of data for training\n\n DataSet trainingData = testAndTrain.getTrain();\n DataSet testData = testAndTrain.getTest();\n //We need to normalize our data. We'll use NormalizeStandardize (which gives us mean 0, unit variance):\n //数据归一化的步骤,非常重要,不做可能会导致梯度中的几个无法收敛\n DataNormalization normalizer = new NormalizerStandardize();\n normalizer.fit(trainingData); //Collect the statistics (mean/stdev) from the training data. This does not modify the input data\n normalizer.transform(trainingData); //Apply normalization to the training data\n normalizer.transform(testData); //Apply normalization to the test data. This is using statistics calculated from the *training* set\n\n\n final int numInputs = 9202;\n int outputNum = 2;\n int iterations = 1000;\n long seed = 142;\n int numEpochs = 50; // number of epochs to perform\n\n log.info(\"Build model....\");\n MultiLayerConfiguration conf = new NeuralNetConfiguration.Builder()\n .seed(seed)\n .optimizationAlgo(OptimizationAlgorithm.STOCHASTIC_GRADIENT_DESCENT)\n .iterations(iterations)\n .activation(Activation.SIGMOID)\n .weightInit(WeightInit.ZERO) //参数初始化的方法,全部置零\n .learningRate(1e-3) //经过测试,这里的学习率在1e-3比较合适\n .regularization(true).l2(5e-5) //正则化项,防止参数过多导致过拟合。2阶范数乘一个比率\n .list()\n\n .layer(0, new OutputLayer.Builder(LossFunctions.LossFunction.NEGATIVELOGLIKELIHOOD)\n .activation(Activation.SIGMOID)\n .nIn(numInputs).nOut(outputNum).build())\n .backprop(true).pretrain(false)\n .build();\n\n //run the model\n MultiLayerNetwork model = new MultiLayerNetwork(conf);\n model.init();\n model.setListeners(new ScoreIterationListener(100));\n\n\n log.info(\"Train model....\");\n for( int i=0; i<numEpochs; i++ ){\n log.info(\"Epoch \" + i);\n model.fit(trainingData);\n\n //每个epoch结束后立马观察模型估计的效果,方便及早停止\n Evaluation eval = new Evaluation(numClasses);\n INDArray output = model.output(testData.getFeatureMatrix());\n eval.eval(testData.getLabels(), output);\n log.info(eval.stats());\n }\n\n }", "public static void main(String[] args) throws IOException{\n \n int cells = 16;\n MnistManager mm = new MnistManager(Config.MNIST_TRAIN_IMAGES, Config.MNIST_TRAIN_LABELS);\n \n // Grab first image\n mm.setCurrent(1);\n int[][] image = mm.readPixelMatrix();\n BufferedImage bimg = mm.readImage();\n \n ImageHelper.printImage(mm.readImage(), \"llf_test.png\");\n System.out.println(\"The number is: \" + mm.readLabel());\n \n // Make sure the cell size is correct -> 7 pixels\n int cellSize = image.length / (int)Math.sqrt(cells);\n System.out.println(\"The size of the cells are \" + cellSize + \" pixels\");\n \n // Check that the cell iteration is correct\n for(int i = 0; i < image.length; i += cellSize) {\n for(int j = 0; j < image[0].length; j += cellSize) {\n String info = \"Top left X: \"+i+\" Y: \"+j+\" Bottom right X: \"+(i + cellSize)+\" Y: \"+(j + cellSize);\n System.out.println(info);\n double b = slope(i, j, cellSize, image);\n System.out.println(b);\n System.out.println(\"\\n\\n\");\n }\n }\n }", "public static void main(String[] args) {\n\t\tint[] featuresRemoved = new int[]{14,15,0,3,7,8,9,13}; //removed age,education,relationship,race,sex,country\n\t\t\n\t\tCrossValidation.Allow_testSet_to_be_Appended = true;\n\t\tDataManager.SetRegex(\"?\");\n\t\tDataManager.SetSeed(0l); //debugging for deterministic random\n\t\t\n\t\tArrayList<String[]> dataSet = DataManager.ReadCSV(\"data/adult.train.5fold.csv\",false);\n\t\tdataSet = DataManager.ReplaceMissingValues(dataSet);\n\t\tDoubleMatrix M = DataManager.dataSetToMatrix(dataSet,14);\n\t\tList<DoubleMatrix> bins = DataManager.split(M, 15);\n\t\t//List<DoubleMatrix> bins = DataManager.splitFold(M, 5,true); //random via permutation debugging\n\t\t\n\t\tArrayList<String[]> testSet = DataManager.ReadCSV(\"data/adult.test.csv\",false);\n\t\ttestSet = DataManager.ReplaceMissingValues(testSet);\n\t\tDoubleMatrix test = DataManager.dataSetToMatrix(testSet,14);\n\t\tList<DoubleMatrix> testBins = DataManager.splitFold(test, 8, false);\n\t\t\n\t\t\n\t\t//initiate threads \n\t\tint threadPool = 16;\n\t\tExecutorService executor = Executors.newFixedThreadPool(threadPool);\n\t\tList<Callable<Record[]>> callable = new ArrayList<Callable<Record[]>>();\t\t\n\t\t\n\t\tlong startTime = System.currentTimeMillis(); //debugging - test for optimisation \n\t\t\n\t\t\n\t\t\n\t\t//unweighted\n\t\tSystem.out.println(\"Validating Unweighted KNN...\");\n\t\tfor(int i = 0; i < bins.size(); i++) {\n\t\t\t\n\t\t\tDoubleMatrix Train = new DoubleMatrix(0,bins.get(0).columns);\n\t\t\tDoubleMatrix Validation = bins.get(i);\n\t\t\t\n\t\t\tfor(int j = 0; j < bins.size(); j++) {\n\t\t\t\tif(i != j) {\n\t\t\t\t\tTrain = DoubleMatrix.concatVertically(Train, bins.get(j));\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\t//build worker thread\n\t\t\tCrossValidation fold = new CrossValidation(Train, Validation,14,featuresRemoved,40,2,false);\n\t\t\tcallable.add(fold);\n\t\t}\n\t\t\n\t\t//returned statistics of each fold.\n\t\tList<Record[]> unweightedRecords = new ArrayList<Record[]>();\n\t\t\n\t\ttry {\n\t\t\t//collect all work thread values \n\t\t\tList<Future<Record[]>> set = executor.invokeAll(callable);\n\t\t\t\n\t\t\tfor(Future<Record[]> recordFold : set) {\n\t\t\t\tunweightedRecords.add(recordFold.get());\n\t\t\t}\n\t\t\t\n\t\t} catch (Exception e) {\n\t\t\t// TODO: handle exception\n\t\t}\n\t\t\n\t\t\n\t\n\t\tcallable.clear();\n\t\t\n\t\t\n\t\t\n\t\t//weighted\n\t\tSystem.out.println(\"Validating Weighted KNN...\");\n\t\tfor(int i = 0; i < bins.size(); i++) {\n\t\t\tDoubleMatrix Train = new DoubleMatrix(0,bins.get(0).columns);\n\t\t\tDoubleMatrix Validation = bins.get(i);\n\t\t\t\n\t\t\tfor(int j = 0; j < bins.size(); j++) {\n\t\t\t\tif(i != j) {\n\t\t\t\t\tTrain = DoubleMatrix.concatVertically(Train, bins.get(j));\n\t\t\t\t}\n\t\t\t}\n\t\t\t//build worker thread\n\t\t\tCrossValidation fold = new CrossValidation(Train, Validation,14,featuresRemoved,40,2,true);\n\t\t\tcallable.add(fold);\n\t\t}\n\t\t\n\t\t//returned statistics of each fold.\n\t\tList<Record[]> weightedRecords = new ArrayList<Record[]>();\n\t\t\n\t\ttry {\n\t\t\t//collect all work thread values \n\t\t\tList<Future<Record[]>> set = executor.invokeAll(callable);\n\t\t\t\n\t\t\tfor(Future<Record[]> recordFold : set) {\n\t\t\t\tweightedRecords.add(recordFold.get());\n\t\t\t}\n\t\t\t\n\t\t} catch (Exception e) {\n\t\t\t// TODO: handle exception\n\t\t}\t\t\n\t\t\n\t\t\n\t\t\n\t\t//find best parameter \n\t\tint bestKNN = 0;\n\t\tdouble bestAccuracy = 0;\n\t\tboolean weighted = false;\n\t\tint validationIndex = 0;\n\t\tfor(int i = 0; i < unweightedRecords.get(0).length; i++) {\n\t\t\t\n\t\t\tint currentK = 0;\n\t\t\tdouble currentAccuracy = 0;\n\t\t\t\n\t\t\tList<Record[]> a = new ArrayList<Record[]>();\n\t\t\tfor(int j = 0; j < unweightedRecords.size(); j ++) { \n\t\t\t\ta.add(new Record[]{ unweightedRecords.get(j)[i]});\n\t\t\t\tcurrentK = unweightedRecords.get(j)[i].KNN;\n\t\t\t}\n\t\t\t\n\t\t\tint[][] m = DataManager.combineMat(a);\n\t\t\tcurrentAccuracy = DataManager.getAccuracy(m);\n\t\t\t\n\t\t\tif(currentAccuracy > bestAccuracy) {\n\t\t\t\tbestKNN = currentK;\n\t\t\t\tbestAccuracy = currentAccuracy;\n\t\t\t\tweighted = false;\n\t\t\t\tvalidationIndex = i;\n\t\t\t\tSystem.out.println(bestKNN + \" : unweighted : \" +bestAccuracy + \" : Best\");\n\t\t\t} else {\n\t\t\t\tSystem.out.println(currentK + \" : unweighted : \" + currentAccuracy);\n\t\t\t}\n\t\t}\n\t\t\n\t\t\n\t\tfor(int i = 0; i < weightedRecords.get(0).length; i++) {\n\t\t\t\n\t\t\tint currentK = 0;\n\t\t\tdouble currentAccuracy = 0;\n\t\t\t\n\t\t\tList<Record[]> a = new ArrayList<Record[]>();\n\t\t\tfor(int j = 0; j < weightedRecords.size(); j ++) { \n\t\t\t\ta.add(new Record[]{ weightedRecords.get(j)[i]});\n\t\t\t\tcurrentK = weightedRecords.get(j)[i].KNN;\n\t\t\t}\n\t\t\t\n\t\t\tint[][] m = DataManager.combineMat(a);\n\t\t\tcurrentAccuracy = DataManager.getAccuracy(m);\n\t\t\t\n\t\t\tif(currentAccuracy >= bestAccuracy) {\n\t\t\t\tbestKNN = currentK;\n\t\t\t\tbestAccuracy = currentAccuracy;\n\t\t\t\tweighted = true;\n\t\t\t\tvalidationIndex = i;\n\t\t\t\tSystem.out.println(bestKNN + \" : weighted :\" +bestAccuracy + \" : Best\");\n\t\t\t} else {\n\t\t\t\tSystem.out.println(currentK + \" : weighted :\" + currentAccuracy);\n\t\t\t}\n\t\t}\t\t\n\t\t\n\t\t\n\t\tList<Record[]> bestValidation = new ArrayList<Record[]>();\n\t\tfor(int i = 0; i < bins.size(); i++) {\n\t\t\tif(weighted) {\n\t\t\t\tbestValidation.add(new Record[]{ weightedRecords.get(i)[validationIndex]});\n\t\t\t} else {\n\t\t\t\tbestValidation.add(new Record[]{ unweightedRecords.get(i)[validationIndex]});\n\t\t\t}\n\t\t}\n\t\t\n\t\t\n\t\t\n\t\t\n\t\tSystem.out.println(\"Testing...\");\n\t\t\n\t\t//KNN on test set\n\t\tcallable.clear();\n\t\t\n\t\t//build worker threads\n\t\tfor(int i = 0; i < testBins.size(); i++) {\n\t\t\tCrossValidation fold = new CrossValidation(M, testBins.get(i),14,featuresRemoved,bestKNN,bestKNN,weighted);\n\t\t\tcallable.add(fold);\n\t\t}\n\t\t\n\t\tList<Record[]> testRecords = new ArrayList<Record[]>();\n\t\t\n\t\ttry {\n\t\t\tList<Future<Record[]>> set = executor.invokeAll(callable);\n\t\t\t\n\t\t\tfor(Future<Record[]> recordFold : set) {\n\t\t\t\ttestRecords.add(recordFold.get());\n\t\t\t}\n\t\t} catch (Exception e) {\n\t\t\t// TODO: handle exception\n\t\t}\n\t\t\n\t\tint[][] testM = DataManager.combineMat(testRecords);\n\t\tdouble testAccuracy = DataManager.getAccuracy(testM);\n\t\t//double teststd = DataManager.GetStd(testRecords);\n\t\t\n\t\t//print stuff\n\t\tSystem.out.println(bestKNN + \" : \"+ weighted + \" : \" + testAccuracy);\n\t\tSystem.out.println(testM[0][0] + \", \" + testM[0][1] +\", \" + testM[1][0] + \", \" + testM[1][1]);\n\t\t\n\t\t//delete all worker threads\n\t\texecutor.shutdownNow();\n\t\t\n\t\t\n\t\tlong endTime = System.currentTimeMillis();\n\t\tlong totalTime = endTime - startTime;\n\t\tSystem.out.println(\"Run time(millisecond): \" + totalTime );\n\t\tSystem.out.println(\"Thread pool: \" + threadPool );\n\t\tSystem.out.println(\"Cores: \" + Runtime.getRuntime().availableProcessors());\n\t\t\n\t\t//prints to file\n\t\tDataManager.saveRecord(\"data/grid.results.txt\", 14, featuresRemoved,\"<=50k\", bestKNN, weighted, bestValidation, testRecords, testRecords.get(0)[0].classType, 5, totalTime, threadPool);\n\t}", "public void train() throws Exception;", "@Test\n public void testRun() {\n System.out.println(\"run\");\n FluorescenceImporter importer = null;\n try {\n FluorescenceFixture tf = new FluorescenceFixture();\n importer = new FluorescenceImporter(tf.testData());\n ProgressHandle ph = ProgressHandleFactory.createHandle(\"Importing dataset\");\n importer.setProgressHandle(ph);\n \n importer.run();\n } catch (IOException ex) {\n Exceptions.printStackTrace(ex);\n }\n \n //FluorescenceDataset dataset = importer.getDataset();\n Dataset<? extends Instance> plate = importer.getDataset();\n System.out.println(\"inst A1 \"+ plate.instance(0).toString());\n System.out.println(\"plate \"+plate.toString());\n Dataset<Instance> output = new SampleDataset<Instance>();\n output.setParent((Dataset<Instance>) plate);\n ProgressHandle ph = ProgressHandleFactory.createHandle(\"Analyzing dataset\");\n // AnalyzeRunner instance = new AnalyzeRunner((Timeseries<ContinuousInstance>) plate, output, ph);\n // instance.run();\n \n }", "private String checkpointString(int cp, long time) {\n\t\treturn \"Checkpoint \" + ChatColor.GRAY + String.valueOf(cp) + ChatColor.WHITE + \" = \" + ChatColor.GRAY + _.getGameController().getTimeString(0, time) + ChatColor.WHITE;\n\t}", "private Parameters createCheckpoint() {\n Parameters checkpoint = Parameters.create();\n checkpoint.set(\"lastDoc/identifier\", this.lastAddedDocumentIdentifier);\n checkpoint.set(\"lastDoc/number\", this.lastAddedDocumentNumber);\n checkpoint.set(\"indexBlockCount\", this.indexBlockCount);\n Parameters shards = Parameters.create();\n for (Bin b : this.geometricParts.radixBins.values()) {\n for (String indexPath : b.getBinPaths()) {\n shards.set(indexPath, b.size);\n }\n }\n checkpoint.set(\"shards\", shards);\n return checkpoint;\n }", "public static void main(String[] args) throws IOException {\n Date date = Calendar.getInstance().getTime();\n DateFormat dateFormat = new SimpleDateFormat(\"yyyy-MM-dd HH.mm.ss\");\n String strDate = dateFormat.format(date);\n String pathString = \"C:/Users/Akshay/Desktop/RL LUT Values/Neural Net Outputs/\"+strDate+\"/\";\n File dir = new File(pathString);\n dir.mkdirs();\n\n String pathStringWeights = pathString+\"Final Weights/\";\n File dirWeights = new File(pathStringWeights);\n dirWeights.mkdirs();\n\n\n //Declare All Variables\n double[][][][][][] LUT = new double[6][4][4][4][4][8];\n\n //Read Input LUT\n String pathToLut = \"C:/Users/Akshay/Desktop/RL LUT Values/Battle 3.txt\";\n loadLutToArray(LUT, pathToLut);\n\n //Initialize Neural Net\n int numInputNeurons = 13; //5 State Variables and 8 for Action with 1 hot Encoding\n int numHiddenNeurons = 20;\n int numOutputNeurons = 1;\n\n double learningRate = 0.01;\n double momentum = 0.5;\n\n double argA = 0;\n double argB = 0;\n\n int t = 1;\n String activation = \"\";\n switch (t) {\n case 1:\n activation = \"Bipolar Sigmoid\";\n break;\n case 2:\n activation = \"Tan Hyperbolic\";\n break;\n default:\n activation = \"Sigmoid\";\n }\n\n double E = 0;\n\n NeuralNet nn1 = new NeuralNet(numInputNeurons, numHiddenNeurons, numOutputNeurons, learningRate, momentum, argA, argB);\n nn1.initWeights(-0.5, 0.5);\n\n //Track Epoch using k\n int k = 0;\n String s = \"Activation = \"+activation+\"\\nLearning Rate = \"+learningRate+\"\\nMomentum = \"+momentum+\"\\nHidden Neurons = \"+numHiddenNeurons;\n\n while(true){\n k++;\n\n if(k>10000){\n String identifier = k+\".\";\n nn1.saveWeights(pathStringWeights,identifier);\n break;\n }\n\n //Start Loop Across LUT\n for(int d = 0; d < 6; d++){\n double di = absScale(d,0,5,-0.8,0.8);\n for(int men = 0; men < 4; men++){\n double meni = absScale(men,0,3,-0.8,0.8);\n for(int een = 0; een < 4; een++){\n double eeni = absScale(een,0,3,-0.8,0.8);\n for(int ex = 0; ex < 4; ex++){\n double exi = absScale(ex,0,3,-0.8,0.8);\n for(int yi = 0; yi < 4; yi++){\n double yii = absScale(yi,0,3,-0.8,0.8);\n for(int act = 0; act < 8; act++){\n //Each action needs to be 1 hot encoded\n double x[] = new double[13];\n switch(act){\n case 0: x = new double[] {di,meni,eeni,exi,yii,0.8,-0.8,-0.8,-0.8,-0.8,-0.8,-0.8,-0.8};\n break;\n case 1: x = new double[] {di,meni,eeni,exi,yii,-0.8,0.8,-0.8,-0.8,-0.8,-0.8,-0.8,-0.8};\n break;\n case 2: x = new double[] {di,meni,eeni,exi,yii,-0.8,-0.8,0.8,-0.8,-0.8,-0.8,-0.8,-0.8};\n break;\n case 3: x = new double[] {di,meni,eeni,exi,yii,-0.8,-0.8,-0.8,0.8,-0.8,-0.8,-0.8,-0.8};\n break;\n case 4: x = new double[] {di,meni,eeni,exi,yii,-0.8,-0.8,-0.8,-0.8,0.8,-0.8,-0.8,-0.8};\n break;\n case 5: x = new double[] {di,meni,eeni,exi,yii,-0.8,-0.8,-0.8,-0.8,-0.8,0.8,-0.8,-0.8};\n break;\n case 6: x = new double[] {di,meni,eeni,exi,yii,-0.8,-0.8,-0.8,-0.8,-0.8,-0.8,0.8,-0.8};\n break;\n case 7: x = new double[] {di,meni,eeni,exi,yii,-0.8,-0.8,-0.8,-0.8,-0.8,-0.8,-0.8,0.8};\n break;\n }\n\n //Defining Training Output For ErrorBackPropagation\n double y[] = {absScale(LUT[d][men][een][ex][yi][act],-1000,1000,-0.8,0.8)};\n\n //Error Back Propagation\n nn1.propagateForward(x,t);\n nn1.propagateBackwardOutput(y,t);\n nn1.weightUpdateOutput(learningRate,momentum);\n nn1.propagateBackwardHidden(t);\n nn1.weightUpdateHidden(learningRate,momentum,x);\n\n E = E + Math.pow((nn1.finalOutput[0] - y[0]),2);\n }\n }\n }\n }\n }\n }\n //RMS Error This Time. Not Total Error\n E = Math.sqrt(E/(12288));\n //Perfect Condition Stuff\n /*if(E<=0.05){\n //System.out.println(\"Trial Number: \"+loop+\" Converged at Epoch \"+k);\n String identifier = k+\".\";\n nn1.saveWeights(pathStringWeights,identifier);\n break;\n }*/\n\n //End of Epoch Code Goes Here\n String cmdOp = \"Epoch \"+k+\", Error = \"+E;\n System.out.println(cmdOp);\n\n s = s + \"\\n\" + k + \" \" + E;\n writeToFile(pathString+\"Stats.txt\",s);\n E = 0;\n }\n }", "public void evaluate(String sampleFile, String featureDefFile, int nFold, float tvs, String modelDir, String modelFile) {\n/* 854 */ List<List<RankList>> trainingData = new ArrayList<>();\n/* 855 */ List<List<RankList>> validationData = new ArrayList<>();\n/* 856 */ List<List<RankList>> testData = new ArrayList<>();\n/* */ \n/* */ \n/* */ \n/* 860 */ List<RankList> samples = readInput(sampleFile);\n/* */ \n/* */ \n/* 863 */ int[] features = readFeature(featureDefFile);\n/* 864 */ if (features == null) {\n/* 865 */ features = FeatureManager.getFeatureFromSampleVector(samples);\n/* */ }\n/* 867 */ FeatureManager.prepareCV(samples, nFold, tvs, trainingData, validationData, testData);\n/* */ \n/* */ \n/* 870 */ if (normalize)\n/* */ {\n/* 872 */ for (int j = 0; j < nFold; j++) {\n/* */ \n/* 874 */ normalizeAll(trainingData, features);\n/* 875 */ normalizeAll(validationData, features);\n/* 876 */ normalizeAll(testData, features);\n/* */ } \n/* */ }\n/* */ \n/* 880 */ Ranker ranker = null;\n/* 881 */ double scoreOnTrain = 0.0D;\n/* 882 */ double scoreOnTest = 0.0D;\n/* 883 */ double totalScoreOnTest = 0.0D;\n/* 884 */ int totalTestSampleSize = 0;\n/* */ \n/* 886 */ double[][] scores = new double[nFold][]; int i;\n/* 887 */ for (i = 0; i < nFold; i++) {\n/* 888 */ (new double[2])[0] = 0.0D; (new double[2])[1] = 0.0D; scores[i] = new double[2];\n/* 889 */ } for (i = 0; i < nFold; i++) {\n/* */ \n/* 891 */ List<RankList> train = trainingData.get(i);\n/* 892 */ List<RankList> vali = null;\n/* 893 */ if (tvs > 0.0F)\n/* 894 */ vali = validationData.get(i); \n/* 895 */ List<RankList> test = testData.get(i);\n/* */ \n/* 897 */ RankerTrainer trainer = new RankerTrainer();\n/* 898 */ ranker = trainer.train(this.type, train, vali, features, this.trainScorer);\n/* */ \n/* 900 */ double s2 = evaluate(ranker, test);\n/* 901 */ scoreOnTrain += ranker.getScoreOnTrainingData();\n/* 902 */ scoreOnTest += s2;\n/* 903 */ totalScoreOnTest += s2 * test.size();\n/* 904 */ totalTestSampleSize += test.size();\n/* */ \n/* */ \n/* 907 */ scores[i][0] = ranker.getScoreOnTrainingData();\n/* 908 */ scores[i][1] = s2;\n/* */ \n/* */ \n/* 911 */ if (!modelDir.isEmpty()) {\n/* */ \n/* 913 */ ranker.save(FileUtils.makePathStandard(modelDir) + \"f\" + (i + 1) + \".\" + modelFile);\n/* 914 */ System.out.println(\"Fold-\" + (i + 1) + \" model saved to: \" + modelFile);\n/* */ } \n/* */ } \n/* 917 */ System.out.println(\"Summary:\");\n/* 918 */ System.out.println(this.testScorer.name() + \"\\t| Train\\t| Test\");\n/* 919 */ System.out.println(\"----------------------------------\");\n/* 920 */ for (i = 0; i < nFold; i++)\n/* 921 */ System.out.println(\"Fold \" + (i + 1) + \"\\t| \" + SimpleMath.round(scores[i][0], 4) + \"\\t| \" + SimpleMath.round(scores[i][1], 4) + \"\\t\"); \n/* 922 */ System.out.println(\"----------------------------------\");\n/* 923 */ System.out.println(\"Avg.\\t| \" + SimpleMath.round(scoreOnTrain / nFold, 4) + \"\\t| \" + SimpleMath.round(scoreOnTest / nFold, 4) + \"\\t\");\n/* 924 */ System.out.println(\"----------------------------------\");\n/* 925 */ System.out.println(\"Total\\t| \\t\\t| \" + SimpleMath.round(totalScoreOnTest / totalTestSampleSize, 4) + \"\\t\");\n/* */ }", "public static void doExercise3() {\n // TODO: Complete Exercise 3 Below\n\n }", "public static void main(String[] args) {\n\t\t\tGameStore4(1); // Lab 5 Part 4\n\n\t}", "@Test\n public void testCase1() {\n File base = new File(DIR, \"case1\");\n File pl0 = new File(base, \"pl0/EASy\");\n File pl1 = new File(base, \"pl1/EASy\");\n try {\n Location pl0Loc = VarModel.INSTANCE.locations().addLocation(pl0, OBSERVER);\n Location pl1Loc = VarModel.INSTANCE.locations().addLocation(pl1, OBSERVER);\n // add Parent\n pl1Loc.addDependentLocation(pl0Loc);\n \n VarModel.INSTANCE.loaders().registerLoader(ModelUtility.INSTANCE, OBSERVER);\n \n List<ModelInfo<Project>> infos = VarModel.INSTANCE.availableModels().getModelInfo(\"pl1\");\n Assert.assertNotNull(infos);\n Assert.assertTrue(1 == infos.size());\n Project project = VarModel.INSTANCE.load(infos.get(0));\n Assert.assertNotNull(project);\n \n VarModel.INSTANCE.locations().removeLocation(pl1Loc, OBSERVER);\n VarModel.INSTANCE.locations().removeLocation(pl0Loc, OBSERVER);\n VarModel.INSTANCE.loaders().unregisterLoader(ModelUtility.INSTANCE, OBSERVER);\n } catch (ModelManagementException e) {\n Assert.fail(\"unexpected exception \" + e);\n }\n }", "@Override\n public void calculate(double[] x) {\n\n double prob = 0.0; // the log prob of the sequence given the model, which is the negation of value at this point\n Triple<double[][], double[][], double[][]> allParams = separateWeights(x);\n double[][] linearWeights = allParams.first();\n double[][] W = allParams.second(); // inputLayerWeights \n double[][] U = allParams.third(); // outputLayerWeights \n\n double[][] Y = null;\n if (flags.softmaxOutputLayer) {\n Y = new double[U.length][];\n for (int i = 0; i < U.length; i++) {\n Y[i] = ArrayMath.softmax(U[i]);\n }\n }\n\n double[][] What = emptyW();\n double[][] Uhat = emptyU();\n\n // the expectations over counts\n // first index is feature index, second index is of possible labeling\n double[][] E = empty2D();\n double[][] eW = emptyW();\n double[][] eU = emptyU();\n\n // iterate over all the documents\n for (int m = 0; m < data.length; m++) {\n int[][][] docData = data[m];\n int[] docLabels = labels[m];\n\n // make a clique tree for this document\n CRFCliqueTree cliqueTree = CRFCliqueTree.getCalibratedCliqueTree(docData, labelIndices, numClasses, classIndex,\n backgroundSymbol, new NonLinearCliquePotentialFunction(linearWeights, W, U, flags));\n\n // compute the log probability of the document given the model with the parameters x\n int[] given = new int[window - 1];\n Arrays.fill(given, classIndex.indexOf(backgroundSymbol));\n int[] windowLabels = new int[window];\n Arrays.fill(windowLabels, classIndex.indexOf(backgroundSymbol));\n\n if (docLabels.length>docData.length) { // only true for self-training\n // fill the given array with the extra docLabels\n System.arraycopy(docLabels, 0, given, 0, given.length);\n System.arraycopy(docLabels, 0, windowLabels, 0, windowLabels.length);\n // shift the docLabels array left\n int[] newDocLabels = new int[docData.length];\n System.arraycopy(docLabels, docLabels.length-newDocLabels.length, newDocLabels, 0, newDocLabels.length);\n docLabels = newDocLabels;\n }\n // iterate over the positions in this document\n for (int i = 0; i < docData.length; i++) {\n int label = docLabels[i];\n double p = cliqueTree.condLogProbGivenPrevious(i, label, given);\n if (VERBOSE) {\n System.err.println(\"P(\" + label + \"|\" + ArrayMath.toString(given) + \")=\" + p);\n }\n prob += p;\n System.arraycopy(given, 1, given, 0, given.length - 1);\n given[given.length - 1] = label;\n }\n\n // compute the expected counts for this document, which we will need to compute the derivative\n // iterate over the positions in this document\n for (int i = 0; i < docData.length; i++) {\n // for each possible clique at this position\n System.arraycopy(windowLabels, 1, windowLabels, 0, window - 1);\n windowLabels[window - 1] = docLabels[i];\n for (int j = 0; j < docData[i].length; j++) {\n Index<CRFLabel> labelIndex = labelIndices[j];\n // for each possible labeling for that clique\n int[] cliqueFeatures = docData[i][j];\n double[] As = null;\n double[] fDeriv = null;\n double[][] yTimesA = null;\n double[] sumOfYTimesA = null;\n\n if (j == 0) {\n As = NonLinearCliquePotentialFunction.hiddenLayerOutput(W, cliqueFeatures, flags);\n fDeriv = new double[inputLayerSize];\n double fD = 0;\n for (int q = 0; q < inputLayerSize; q++) {\n if (useSigmoid) {\n fD = As[q] * (1 - As[q]); \n } else {\n fD = 1 - As[q] * As[q]; \n }\n fDeriv[q] = fD;\n }\n\n // calculating yTimesA for softmax\n if (flags.softmaxOutputLayer) {\n double val = 0;\n\n yTimesA = new double[outputLayerSize][numHiddenUnits];\n for (int ii = 0; ii < outputLayerSize; ii++) {\n yTimesA[ii] = new double[numHiddenUnits];\n }\n sumOfYTimesA = new double[outputLayerSize];\n\n for (int k = 0; k < outputLayerSize; k++) {\n double[] Yk = null;\n if (flags.tieOutputLayer) {\n Yk = Y[0];\n } else {\n Yk = Y[k];\n }\n double sum = 0;\n for (int q = 0; q < inputLayerSize; q++) {\n if (q % outputLayerSize == k) {\n int hiddenUnitNo = q / outputLayerSize;\n val = As[q] * Yk[hiddenUnitNo];\n yTimesA[k][hiddenUnitNo] = val;\n sum += val;\n }\n }\n sumOfYTimesA[k] = sum;\n }\n }\n\n // calculating Uhat What\n int[] cliqueLabel = new int[j + 1];\n System.arraycopy(windowLabels, window - 1 - j, cliqueLabel, 0, j + 1);\n\n CRFLabel crfLabel = new CRFLabel(cliqueLabel);\n int givenLabelIndex = labelIndex.indexOf(crfLabel);\n double[] Uk = null;\n double[] UhatK = null;\n double[] Yk = null;\n double[] yTimesAK = null;\n double sumOfYTimesAK = 0;\n if (flags.tieOutputLayer) {\n Uk = U[0];\n UhatK = Uhat[0];\n if (flags.softmaxOutputLayer) {\n Yk = Y[0];\n }\n } else {\n Uk = U[givenLabelIndex];\n UhatK = Uhat[givenLabelIndex];\n if (flags.softmaxOutputLayer) {\n Yk = Y[givenLabelIndex];\n }\n }\n\n if (flags.softmaxOutputLayer) {\n yTimesAK = yTimesA[givenLabelIndex];\n sumOfYTimesAK = sumOfYTimesA[givenLabelIndex];\n }\n\n for (int k = 0; k < inputLayerSize; k++) {\n double deltaK = 1;\n if (flags.sparseOutputLayer || flags.tieOutputLayer) {\n if (k % outputLayerSize == givenLabelIndex) {\n int hiddenUnitNo = k / outputLayerSize;\n if (flags.softmaxOutputLayer) {\n UhatK[hiddenUnitNo] += (yTimesAK[hiddenUnitNo] - Yk[hiddenUnitNo] * sumOfYTimesAK);\n deltaK *= Yk[hiddenUnitNo];\n } else {\n UhatK[hiddenUnitNo] += As[k];\n deltaK *= Uk[hiddenUnitNo];\n }\n }\n } else {\n UhatK[k] += As[k];\n if (useOutputLayer) {\n deltaK *= Uk[k];\n }\n }\n if (useHiddenLayer)\n deltaK *= fDeriv[k];\n if (useOutputLayer) {\n if (flags.sparseOutputLayer || flags.tieOutputLayer) {\n if (k % outputLayerSize == givenLabelIndex) {\n double[] WhatK = What[k];\n for (int n = 0; n < cliqueFeatures.length; n++) {\n WhatK[cliqueFeatures[n]] += deltaK;\n }\n }\n } else {\n double[] WhatK = What[k];\n for (int n = 0; n < cliqueFeatures.length; n++) {\n WhatK[cliqueFeatures[n]] += deltaK;\n }\n }\n } else {\n if (k == givenLabelIndex) {\n double[] WhatK = What[k];\n for (int n = 0; n < cliqueFeatures.length; n++) {\n WhatK[cliqueFeatures[n]] += deltaK;\n }\n }\n }\n }\n }\n\n for (int k = 0; k < labelIndex.size(); k++) { // labelIndex.size() == numClasses\n int[] label = labelIndex.get(k).getLabel();\n double p = cliqueTree.prob(i, label); // probability of these labels occurring in this clique with these features\n if (j == 0) { // for node features\n double[] Uk = null;\n double[] eUK = null;\n double[] Yk = null;\n if (flags.tieOutputLayer) {\n Uk = U[0];\n eUK = eU[0];\n if (flags.softmaxOutputLayer) {\n Yk = Y[0];\n }\n } else {\n Uk = U[k];\n eUK = eU[k];\n if (flags.softmaxOutputLayer) {\n Yk = Y[k];\n }\n }\n if (useOutputLayer) {\n for (int q = 0; q < inputLayerSize; q++) {\n double deltaQ = 1;\n if (flags.sparseOutputLayer || flags.tieOutputLayer) {\n if (q % outputLayerSize == k) {\n int hiddenUnitNo = q / outputLayerSize;\n if (flags.softmaxOutputLayer) {\n eUK[hiddenUnitNo] += (yTimesA[k][hiddenUnitNo] - Yk[hiddenUnitNo] * sumOfYTimesA[k]) * p;\n deltaQ = Yk[hiddenUnitNo];\n } else {\n eUK[hiddenUnitNo] += As[q] * p;\n deltaQ = Uk[hiddenUnitNo];\n }\n }\n } else {\n eUK[q] += As[q] * p;\n deltaQ = Uk[q];\n }\n if (useHiddenLayer)\n deltaQ *= fDeriv[q];\n if (flags.sparseOutputLayer || flags.tieOutputLayer) {\n if (q % outputLayerSize == k) {\n double[] eWq = eW[q];\n for (int n = 0; n < cliqueFeatures.length; n++) {\n eWq[cliqueFeatures[n]] += deltaQ * p;\n }\n }\n } else {\n double[] eWq = eW[q];\n for (int n = 0; n < cliqueFeatures.length; n++) {\n eWq[cliqueFeatures[n]] += deltaQ * p;\n }\n }\n }\n } else {\n double deltaK = 1;\n if (useHiddenLayer)\n deltaK *= fDeriv[k];\n double[] eWK = eW[k];\n for (int n = 0; n < cliqueFeatures.length; n++) {\n eWK[cliqueFeatures[n]] += deltaK * p;\n }\n }\n } else { // for edge features\n for (int n = 0; n < cliqueFeatures.length; n++) {\n E[cliqueFeatures[n]][k] += p;\n }\n }\n }\n }\n }\n }\n\n if (Double.isNaN(prob)) { // shouldn't be the case\n throw new RuntimeException(\"Got NaN for prob in CRFNonLinearLogConditionalObjectiveFunction.calculate()\");\n }\n\n value = -prob;\n if(VERBOSE){\n System.err.println(\"value is \" + value);\n }\n\n // compute the partial derivative for each feature by comparing expected counts to empirical counts\n int index = 0;\n for (int i = 0; i < E.length; i++) {\n int originalIndex = edgeFeatureIndicesMap.get(i);\n\n for (int j = 0; j < E[i].length; j++) {\n derivative[index++] = (E[i][j] - Ehat[i][j]);\n if (VERBOSE) {\n System.err.println(\"linearWeights deriv(\" + i + \",\" + j + \") = \" + E[i][j] + \" - \" + Ehat[i][j] + \" = \" + derivative[index - 1]);\n }\n }\n }\n if (index != edgeParamCount)\n throw new RuntimeException(\"after edge derivative, index(\"+index+\") != edgeParamCount(\"+edgeParamCount+\")\");\n\n for (int i = 0; i < eW.length; i++) {\n for (int j = 0; j < eW[i].length; j++) {\n derivative[index++] = (eW[i][j] - What[i][j]);\n if (VERBOSE) {\n System.err.println(\"inputLayerWeights deriv(\" + i + \",\" + j + \") = \" + eW[i][j] + \" - \" + What[i][j] + \" = \" + derivative[index - 1]);\n }\n }\n }\n\n\n if (index != beforeOutputWeights)\n throw new RuntimeException(\"after W derivative, index(\"+index+\") != beforeOutputWeights(\"+beforeOutputWeights+\")\");\n\n if (useOutputLayer) {\n for (int i = 0; i < eU.length; i++) {\n for (int j = 0; j < eU[i].length; j++) {\n derivative[index++] = (eU[i][j] - Uhat[i][j]);\n if (VERBOSE) {\n System.err.println(\"outputLayerWeights deriv(\" + i + \",\" + j + \") = \" + eU[i][j] + \" - \" + Uhat[i][j] + \" = \" + derivative[index - 1]);\n }\n }\n }\n }\n\n if (index != x.length)\n throw new RuntimeException(\"after W derivative, index(\"+index+\") != x.length(\"+x.length+\")\");\n\n int regSize = x.length;\n if (flags.skipOutputRegularization || flags.softmaxOutputLayer) {\n regSize = beforeOutputWeights;\n }\n\n // incorporate priors\n if (prior == QUADRATIC_PRIOR) {\n double sigmaSq = sigma * sigma;\n for (int i = 0; i < regSize; i++) {\n double k = 1.0;\n double w = x[i];\n value += k * w * w / 2.0 / sigmaSq;\n derivative[i] += k * w / sigmaSq;\n }\n } else if (prior == HUBER_PRIOR) {\n double sigmaSq = sigma * sigma;\n for (int i = 0; i < regSize; i++) {\n double w = x[i];\n double wabs = Math.abs(w);\n if (wabs < epsilon) {\n value += w * w / 2.0 / epsilon / sigmaSq;\n derivative[i] += w / epsilon / sigmaSq;\n } else {\n value += (wabs - epsilon / 2) / sigmaSq;\n derivative[i] += ((w < 0.0) ? -1.0 : 1.0) / sigmaSq;\n }\n }\n } else if (prior == QUARTIC_PRIOR) {\n double sigmaQu = sigma * sigma * sigma * sigma;\n for (int i = 0; i < regSize; i++) {\n double k = 1.0;\n double w = x[i];\n value += k * w * w * w * w / 2.0 / sigmaQu;\n derivative[i] += k * w / sigmaQu;\n }\n }\n }", "@Test\n public void test23() throws Throwable {\n TextDirectoryLoader textDirectoryLoader0 = new TextDirectoryLoader();\n Instances instances0 = textDirectoryLoader0.getDataSet();\n Evaluation evaluation0 = new Evaluation(instances0);\n SerializedClassifier serializedClassifier0 = new SerializedClassifier();\n Object[] objectArray0 = new Object[25];\n double[] doubleArray0 = evaluation0.evaluateModel((Classifier) serializedClassifier0, instances0, objectArray0);\n assertEquals(0.0, evaluation0.SFEntropyGain(), 0.01D);\n }", "@MediumTest\n public void test_1314_3() throws Exception {\n String imagePath = Environment.getExternalStorageDirectory()+\"/LeCoder_Image/if_without_false.png\";\n //Load the file and process it\n activity.loadImageFile(imagePath);\n activity.processImage();\n //Generate the nodes and construct the graph\n activity.generateNodes();\n activity.generateGraph();\n //Print all nodes\n activity.printAllNodes();\n //Check whether the flowchart has no start point\n assertFalse(activity.checkAllNodes());\n }", "public static void main(String[] args) throws IOException {\n if (args.length < 8) {\n System.err.println(\"Usage: java NaiveBayesCountMinSketch <indexPath> <stopWordsPath> <logNbOfBuckets> <nbOfHashes> <threshold> <outPath> <reportingPeriod> <maxN> [-writeOutAllPredictions]\");\n throw new Error(\"Expected 8 or 9 arguments, got \" + args.length + \".\");\n }\n try {\n // parse input\n String indexPath = args[0];\n String stopWordsPath = args[1];\n int logNbOfBuckets = Integer.parseInt(args[2]);\n int nbOfHashes = Integer.parseInt(args[3]);\n double threshold = Double.parseDouble(args[4]);\n String out = args[5];\n int reportingPeriod = Integer.parseInt(args[6]);\n int n = Integer.parseInt(args[7]);\n boolean writeOutAllPredictions = args.length>8 && args[8].equals(\"-writeOutAllPredictions\");\n\n // initialize e-mail stream\n MailStream stream = new MailStream(indexPath, new EmlParser(stopWordsPath,n));\n\n // initialize learner\n NaiveBayesCountMinSketch nb = new NaiveBayesCountMinSketch(nbOfHashes ,logNbOfBuckets, threshold);\n\n // generate output for the learning curve\n EvaluationMetric[] evaluationMetrics = new EvaluationMetric[]{new Accuracy(),new Precision(),new TruePositiveRate(), new TrueNegativeRate()}; //ADD AT LEAST TWO MORE EVALUATION METRICS\n nb.makeLearningCurve(stream, evaluationMetrics, out+\".nbcms\", reportingPeriod, writeOutAllPredictions);\n\n } catch (FileNotFoundException e) {\n System.err.println(e.toString());\n }\n }", "@Test(timeout = 4000)\n public void test068() throws Throwable {\n TextDirectoryLoader textDirectoryLoader0 = new TextDirectoryLoader();\n Instances instances0 = textDirectoryLoader0.getStructure();\n Evaluation evaluation0 = new Evaluation(instances0);\n evaluation0.addNumericTrainClass(360, (-336.251));\n assertEquals(0.0, evaluation0.SFPriorEntropy(), 0.01);\n }", "public static void main(String[] args) {\n\n\t\tlong startTime = System.currentTimeMillis();\n\n\t\t//NaiveBayesParam nb = new NaiveBayesParam(\"data/split1.arff\",\"data/split1_test.arff\");\n\t\t//NaiveBayesParam nb = new NaiveBayesParam(\"/media/F/Acads/iitb/mtp/naivebayesdataset/bronchiolitis/br-processed.arff\",\"\" +\n\t\t//\t\t\"/media/F/Acads/iitb/mtp/naivebayesdataset/bronchiolitis/br-processed.arff\");\n\t\t//NaiveBayesParam nb = new NaiveBayesParam(\"/media/F/Acads/iitb/mtp/naivebayesdataset/01/sylva_agnostic_valid.arff\",\"\" +\n\t\t//\t\t\"/media/F/Acads/iitb/mtp/naivebayesdataset/01/sylva_agnostic_valid.arff\");\n\n\t\t// NaiveBayesParam nb = new NaiveBayesParam(\"data/split1lac.arff\",\n\t\t// \"data/split1lacTest.arff\");\n\t\t//NaiveBayesParam nb = new NaiveBayesParam(\"data/split1b.arff\", \"data/split1bTest.arff\");\n\t\t// NaiveBayesParam nb = new NaiveBayesPFaram(\"data/split1lac.arff\",\n\t\t// \"data/split1bTest.arff\");\n\t\t//NaiveBayesParam nb = new NaiveBayesParam(\"data/split1lac.arff\",\"data/split1hTest.arff\");\n\t\t\n\t\t\n\t\tNaiveBayesParam nb = new NaiveBayesParam(\"/media/F/Acads/iitb/mtp/QuickHeal/data/split1per1.arff\", \"/media/F/Acads/iitb/mtp/QuickHeal/data/split1.arff\");\n\t\t\t\t\n\t\tInputData initialData = nb.calcInitialState();\n\t\ttry {\n\t\t\tinitialData.serialize(\"/home/agam/nb.dat\");\n\t\t} catch (IOException e1) {\n\t\t\t// TODO Auto-generated catch block\n\t\t\te1.printStackTrace();\n\t\t}\n\t\t/*nb.calcNewState(nb.param);\n\n\n\t\ttry {\n\t\t\tdouble dist1[][] = nb.distributionForInstances(nb.trainInstances);\n\t\t\tdouble dist2[][] = nb.distributionForInstances(nb.testInstances);\n\t\t\t\n\t\t\tint countFN=0;\n\t\t\tint countFP=0;\n\t\t\tSystem.out.println(\"1.# prob0 - prob1 - actual - pred\");\n\t\t\tfor (int i = 0; i < nb.trainInstances.numInstances(); i++)\n\t\t\t{\n\t\t\t\tdouble pred;\n\t\t\t\tdouble actual = nb.trainInstances.instance(i).classValue();\n\t\t\t\t//System.out.print(\"actual=\"+actual);\n\t\t\t\tif(dist1[i][0] >= dist1[i][1])\n\t\t\t\t\tpred=0d;\n\t\t\t\telse\n\t\t\t\t\tpred=1d;\n\t\t //if (pred != actual)\n\t\t if (!(pred > actual-0.1d && pred < actual + 0.1d))\n\t\t {\n//\t\t \tif(pred == 1)\n\t\t \tif(pred > 0.9d && pred < 1.1d)\n\t\t \t\tcountFP++;\n\t\t \telse\n\t\t \t\tcountFN++;\n\t\t }\n\t\t\t}\n\t\t\tSystem.out.println(\"countFP=\"+countFP);\n\t\t\tSystem.out.println(\"%FP=\"+countFP*200.0/nb.trainInstances.numInstances());\n\t\t\tSystem.out.println(\"countFN=\"+countFN);\n\t\t\tSystem.out.println(\"%FN=\"+countFN*200.0/nb.trainInstances.numInstances());\n\t\t\t\n\t\t\tcountFN=0;\n\t\t\tcountFP=0;\n\t\t\tSystem.out.println(\"2.# prob0 - prob1 - actual - pred\");\n\t\t\tfor (int i = 0; i < nb.testInstances.numInstances(); i++)\n\t\t\t{\n\t\t\t\tdouble pred;\n\t\t\t\tdouble actual = nb.testInstances.instance(i).classValue();\n\t\t\t\tif(dist2[i][0] >= dist2[i][1])\n\t\t\t\t\tpred=0d;\n\t\t\t\telse\n\t\t\t\t\tpred=1d;\n//\t\t if (pred != actual)\n\t\t if (!(pred > actual-0.1d && pred < actual + 0.1d))\n\t\t {\n\t\t \tif(pred > 0.9d && pred < 1.1d)\n//\t\t \tif(pred == 1)\n\t\t \t\tcountFP++;\n\t\t \telse\n\t\t \t\tcountFN++;\n\t\t }\n\t\t System.out.println(\"2.#\"+dist2[i][0]+\" \"+dist2[i][1]+\" \" +actual+\" \"+pred);\n\t\t\t}\n\t\t\tSystem.out.println(\"countFP=\"+countFP);\n\t\t\tSystem.out.println(\"%FP=\"+countFP*100.0/nb.testInstances.numInstances());\n\t\t\tSystem.out.println(\"countFN=\"+countFN);\n\t\t\tSystem.out.println(\"%FN=\"+countFN*100.0/nb.testInstances.numInstances());\n\t\t} catch (Exception e) {\n\t\t\t// TODO Auto-generated catch block\n\t\t\te.printStackTrace();\n\t\t}\n*/\n/*\t\t\n\t\tdouble jac[][]=nb.calcJacobian(nb.trainInstances.instance(0));\n\n\t\tfor(int i=0;i<nb.trainInstances.numClasses();i++)\n\t\t{\n\t\t\tfor(int j=0;j<4*nb.trainInstances.numAttributes()-4+nb.trainInstances.numClasses();j++)\n\t\t\t{\n\t\t\t\tSystem.out.println(\"jac[\"+i+\"]=[\"+j+\"]=\"+jac[i][j]);\n\t\t\t}\n\t\t}\n*/\t\t\n\t\tlong endTime = System.currentTimeMillis();\n\t\tlong totalTime = endTime - startTime;\n\t\tSystem.out.println(totalTime + \" milliseconds\");\n\t}", "@Test(timeout = 4000)\n public void test111() throws Throwable {\n TextDirectoryLoader textDirectoryLoader0 = new TextDirectoryLoader();\n Instances instances0 = textDirectoryLoader0.getDataSet();\n Evaluation evaluation0 = new Evaluation(instances0);\n evaluation0.relativeAbsoluteError();\n assertEquals(Double.NaN, evaluation0.meanPriorAbsoluteError(), 0.01);\n assertEquals(0.0, evaluation0.SFEntropyGain(), 0.01);\n assertEquals(Double.NaN, evaluation0.meanAbsoluteError(), 0.01);\n }", "public void test(List<String> modelFiles, String testFile, String prpFile) {\n/* 1014 */ List<List<RankList>> trainingData = new ArrayList<>();\n/* 1015 */ List<List<RankList>> testData = new ArrayList<>();\n/* */ \n/* */ \n/* 1018 */ int nFold = modelFiles.size();\n/* */ \n/* 1020 */ List<RankList> samples = readInput(testFile);\n/* */ \n/* 1022 */ System.out.print(\"Preparing \" + nFold + \"-fold test data... \");\n/* 1023 */ FeatureManager.prepareCV(samples, nFold, trainingData, testData);\n/* 1024 */ System.out.println(\"[Done.]\");\n/* 1025 */ double rankScore = 0.0D;\n/* 1026 */ List<String> ids = new ArrayList<>();\n/* 1027 */ List<Double> scores = new ArrayList<>();\n/* 1028 */ for (int f = 0; f < nFold; f++) {\n/* */ \n/* 1030 */ List<RankList> test = testData.get(f);\n/* 1031 */ Ranker ranker = this.rFact.loadRankerFromFile(modelFiles.get(f));\n/* 1032 */ int[] features = ranker.getFeatures();\n/* 1033 */ if (normalize) {\n/* 1034 */ normalize(test, features);\n/* */ }\n/* 1036 */ for (RankList aTest : test) {\n/* 1037 */ RankList l = ranker.rank(aTest);\n/* 1038 */ double score = this.testScorer.score(l);\n/* 1039 */ ids.add(l.getID());\n/* 1040 */ scores.add(Double.valueOf(score));\n/* 1041 */ rankScore += score;\n/* */ } \n/* */ } \n/* 1044 */ rankScore /= ids.size();\n/* 1045 */ ids.add(\"all\");\n/* 1046 */ scores.add(Double.valueOf(rankScore));\n/* 1047 */ System.out.println(this.testScorer.name() + \" on test data: \" + SimpleMath.round(rankScore, 4));\n/* */ \n/* 1049 */ if (!prpFile.isEmpty()) {\n/* */ \n/* 1051 */ savePerRankListPerformanceFile(ids, scores, prpFile);\n/* 1052 */ System.out.println(\"Per-ranked list performance saved to: \" + prpFile);\n/* */ } \n/* */ }", "public void test3() {\n //$NON-NLS-1$\n deployBundles(\"test3\");\n IApiBaseline before = getBeforeState();\n IApiBaseline after = getAfterState();\n IApiComponent beforeApiComponent = before.getApiComponent(BUNDLE_NAME);\n //$NON-NLS-1$\n assertNotNull(\"no api component\", beforeApiComponent);\n IApiComponent afterApiComponent = after.getApiComponent(BUNDLE_NAME);\n //$NON-NLS-1$\n assertNotNull(\"no api component\", afterApiComponent);\n IDelta delta = ApiComparator.compare(beforeApiComponent, afterApiComponent, before, after, VisibilityModifiers.ALL_VISIBILITIES, null);\n //$NON-NLS-1$\n assertNotNull(\"No delta\", delta);\n IDelta[] allLeavesDeltas = collectLeaves(delta);\n //$NON-NLS-1$\n assertEquals(\"Wrong size\", 1, allLeavesDeltas.length);\n IDelta child = allLeavesDeltas[0];\n //$NON-NLS-1$\n assertEquals(\"Wrong kind\", IDelta.CHANGED, child.getKind());\n //$NON-NLS-1$\n assertTrue(\"Is visible\", !Util.isVisible(child.getNewModifiers()));\n //$NON-NLS-1$\n assertEquals(\"Wrong flag\", IDelta.TYPE, child.getFlags());\n //$NON-NLS-1$\n assertEquals(\"Wrong element type\", IDelta.FIELD_ELEMENT_TYPE, child.getElementType());\n //$NON-NLS-1$\n assertTrue(\"Not compatible\", DeltaProcessor.isCompatible(child));\n }", "@Test(timeout = 4000)\n public void test083() throws Throwable {\n TextDirectoryLoader textDirectoryLoader0 = new TextDirectoryLoader();\n Instances instances0 = textDirectoryLoader0.getStructure();\n Evaluation evaluation0 = new Evaluation(instances0);\n double double0 = evaluation0.SFMeanEntropyGain();\n assertEquals(0.0, evaluation0.SFPriorEntropy(), 0.01);\n assertEquals(Double.NaN, double0, 0.01);\n }", "@Test(timeout = 4000)\n public void test020() throws Throwable {\n TextDirectoryLoader textDirectoryLoader0 = new TextDirectoryLoader();\n Instances instances0 = textDirectoryLoader0.getDataSet();\n Evaluation evaluation0 = new Evaluation(instances0);\n String string0 = evaluation0.toSummaryString(\".arff\", true);\n assertEquals(0.0, evaluation0.unclassified(), 0.01);\n assertEquals(\".arff\\nTotal Number of Instances 0 \\n\", string0);\n assertEquals(0.0, evaluation0.SFEntropyGain(), 0.01);\n }", "@Test\n public void test25() throws Throwable {\n try {\n CostMatrix costMatrix0 = Evaluation.handleCostOption(\" // can classifier handle the data?\\n\", (-1802));\n fail(\"Expecting exception: Exception\");\n \n } catch(Exception e) {\n //\n // Can't open file null.\n //\n }\n }", "@Test\n public void test05() throws Throwable {\n Vote vote0 = new Vote();\n String string0 = Evaluation.makeOptionString(vote0, true);\n assertEquals(\"\\n\\nGeneral options:\\n\\n-h or -help\\n\\tOutput help information.\\n-synopsis or -info\\n\\tOutput synopsis for classifier (use in conjunction with -h)\\n-t <name of training file>\\n\\tSets training file.\\n-T <name of test file>\\n\\tSets test file. If missing, a cross-validation will be performed\\n\\ton the training data.\\n-c <class index>\\n\\tSets index of class attribute (default: last).\\n-x <number of folds>\\n\\tSets number of folds for cross-validation (default: 10).\\n-no-cv\\n\\tDo not perform any cross validation.\\n-split-percentage <percentage>\\n\\tSets the percentage for the train/test set split, e.g., 66.\\n-preserve-order\\n\\tPreserves the order in the percentage split.\\n-s <random number seed>\\n\\tSets random number seed for cross-validation or percentage split\\n\\t(default: 1).\\n-m <name of file with cost matrix>\\n\\tSets file with cost matrix.\\n-l <name of input file>\\n\\tSets model input file. In case the filename ends with '.xml',\\n\\ta PMML file is loaded or, if that fails, options are loaded\\n\\tfrom the XML file.\\n-d <name of output file>\\n\\tSets model output file. In case the filename ends with '.xml',\\n\\tonly the options are saved to the XML file, not the model.\\n-v\\n\\tOutputs no statistics for training data.\\n-o\\n\\tOutputs statistics only, not the classifier.\\n-i\\n\\tOutputs detailed information-retrieval statistics for each class.\\n-k\\n\\tOutputs information-theoretic statistics.\\n-classifications \\\"weka.classifiers.evaluation.output.prediction.AbstractOutput + options\\\"\\n\\tUses the specified class for generating the classification output.\\n\\tE.g.: weka.classifiers.evaluation.output.prediction.PlainText\\n-p range\\n\\tOutputs predictions for test instances (or the train instances if\\n\\tno test instances provided and -no-cv is used), along with the \\n\\tattributes in the specified range (and nothing else). \\n\\tUse '-p 0' if no attributes are desired.\\n\\tDeprecated: use \\\"-classifications ...\\\" instead.\\n-distribution\\n\\tOutputs the distribution instead of only the prediction\\n\\tin conjunction with the '-p' option (only nominal classes).\\n\\tDeprecated: use \\\"-classifications ...\\\" instead.\\n-r\\n\\tOnly outputs cumulative margin distribution.\\n-xml filename | xml-string\\n\\tRetrieves the options from the XML-data instead of the command line.\\n-threshold-file <file>\\n\\tThe file to save the threshold data to.\\n\\tThe format is determined by the extensions, e.g., '.arff' for ARFF \\n\\tformat or '.csv' for CSV.\\n-threshold-label <label>\\n\\tThe class label to determine the threshold data for\\n\\t(default is the first label)\\n\\nOptions specific to weka.classifiers.meta.Vote:\\n\\n-S <num>\\n\\tRandom number seed.\\n\\t(default 1)\\n-B <classifier specification>\\n\\tFull class name of classifier to include, followed\\n\\tby scheme options. May be specified multiple times.\\n\\t(default: \\\"weka.classifiers.rules.ZeroR\\\")\\n-D\\n\\tIf set, classifier is run in debug mode and\\n\\tmay output additional info to the console\\n-P <path to serialized classifier>\\n\\tFull path to serialized classifier to include.\\n\\tMay be specified multiple times to include\\n\\tmultiple serialized classifiers. Note: it does\\n\\tnot make sense to use pre-built classifiers in\\n\\ta cross-validation.\\n-R <AVG|PROD|MAJ|MIN|MAX|MED>\\n\\tThe combination rule to use\\n\\t(default: AVG)\\n\\nSynopsis for weka.classifiers.meta.Vote:\\n\\nClass for combining classifiers. Different combinations of probability estimates for classification are available.\\n\\nFor more information see:\\n\\nLudmila I. Kuncheva (2004). Combining Pattern Classifiers: Methods and Algorithms. John Wiley and Sons, Inc..\\n\\nJ. Kittler, M. Hatef, Robert P.W. Duin, J. Matas (1998). On combining classifiers. IEEE Transactions on Pattern Analysis and Machine Intelligence. 20(3):226-239.\", string0);\n }", "public MultiLayerNetwork loadCheckpointMLN(Checkpoint checkpoint){\n return loadCheckpointMLN(checkpoint.getCheckpointNum());\n }", "@Test(timeout = 4000)\n public void test077() throws Throwable {\n String[] stringArray0 = new String[2];\n stringArray0[1] = \"\";\n Evaluation.main(stringArray0);\n NaiveBayesMultinomial naiveBayesMultinomial0 = new NaiveBayesMultinomial();\n try { \n Evaluation.evaluateModel((Classifier) naiveBayesMultinomial0, stringArray0);\n fail(\"Expecting exception: Exception\");\n \n } catch(Exception e) {\n //\n // \n // Weka exception: No training file and no object input file given.\n // \n // General options:\n // \n // -h or -help\n // \\tOutput help information.\n // -synopsis or -info\n // \\tOutput synopsis for classifier (use in conjunction with -h)\n // -t <name of training file>\n // \\tSets training file.\n // -T <name of test file>\n // \\tSets test file. If missing, a cross-validation will be performed\n // \\ton the training data.\n // -c <class index>\n // \\tSets index of class attribute (default: last).\n // -x <number of folds>\n // \\tSets number of folds for cross-validation (default: 10).\n // -no-cv\n // \\tDo not perform any cross validation.\n // -split-percentage <percentage>\n // \\tSets the percentage for the train/test set split, e.g., 66.\n // -preserve-order\n // \\tPreserves the order in the percentage split.\n // -s <random number seed>\n // \\tSets random number seed for cross-validation or percentage split\n // \\t(default: 1).\n // -m <name of file with cost matrix>\n // \\tSets file with cost matrix.\n // -l <name of input file>\n // \\tSets model input file. In case the filename ends with '.xml',\n // \\ta PMML file is loaded or, if that fails, options are loaded\n // \\tfrom the XML file.\n // -d <name of output file>\n // \\tSets model output file. In case the filename ends with '.xml',\n // \\tonly the options are saved to the XML file, not the model.\n // -v\n // \\tOutputs no statistics for training data.\n // -o\n // \\tOutputs statistics only, not the classifier.\n // -i\n // \\tOutputs detailed information-retrieval statistics for each class.\n // -k\n // \\tOutputs information-theoretic statistics.\n // -classifications \\\"weka.classifiers.evaluation.output.prediction.AbstractOutput + options\\\"\n // \\tUses the specified class for generating the classification output.\n // \\tE.g.: weka.classifiers.evaluation.output.prediction.PlainText\n // -p range\n // \\tOutputs predictions for test instances (or the train instances if\n // \\tno test instances provided and -no-cv is used), along with the \n // \\tattributes in the specified range (and nothing else). \n // \\tUse '-p 0' if no attributes are desired.\n // \\tDeprecated: use \\\"-classifications ...\\\" instead.\n // -distribution\n // \\tOutputs the distribution instead of only the prediction\n // \\tin conjunction with the '-p' option (only nominal classes).\n // \\tDeprecated: use \\\"-classifications ...\\\" instead.\n // -r\n // \\tOnly outputs cumulative margin distribution.\n // -xml filename | xml-string\n // \\tRetrieves the options from the XML-data instead of the command line.\n // -threshold-file <file>\n // \\tThe file to save the threshold data to.\n // \\tThe format is determined by the extensions, e.g., '.arff' for ARFF \n // \\tformat or '.csv' for CSV.\n // -threshold-label <label>\n // \\tThe class label to determine the threshold data for\n // \\t(default is the first label)\n // \n // Options specific to weka.classifiers.bayes.NaiveBayesMultinomial:\n // \n // -D\n // \\tIf set, classifier is run in debug mode and\n // \\tmay output additional info to the console\n //\n verifyException(\"weka.classifiers.Evaluation\", e);\n }\n }", "private int FindGold() {\n VuforiaLocalizer vuforia;\n\n /**\n * {@link #tfod} is the variable we will use to store our instance of the Tensor Flow Object\n * Detection engine.\n */\n TFObjectDetector tfod;\n \n VuforiaLocalizer.Parameters parameters = new VuforiaLocalizer.Parameters();\n\n parameters.vuforiaLicenseKey = VUFORIA_KEY;\n parameters.cameraDirection = CameraDirection.BACK;\n\n // Instantiate the Vuforia engine\n vuforia = ClassFactory.getInstance().createVuforia(parameters);\n\n // Loading trackables is not necessary for the Tensor Flow Object Detection engine.\n \n\n /**\n * Initialize the Tensor Flow Object Detection engine.\n */\n if (ClassFactory.getInstance().canCreateTFObjectDetector()) {\n int tfodMonitorViewId = hardwareMap.appContext.getResources().getIdentifier(\n \"tfodMonitorViewId\", \"id\", hardwareMap.appContext.getPackageName());\n TFObjectDetector.Parameters tfodParameters = new TFObjectDetector.Parameters(tfodMonitorViewId);\n tfod = ClassFactory.getInstance().createTFObjectDetector(tfodParameters, vuforia);\n tfod.loadModelFromAsset(TFOD_MODEL_ASSET, LABEL_GOLD_MINERAL, LABEL_SILVER_MINERAL);\n tfod.activate();\n } else {\n telemetry.addData(\"Sorry!\", \"This device is not compatible with TFOD\");\n return 3;\n }\n\n int Npos1=0;\n int Npos2=0;\n int Npos3=0;\n int NposSilver1=0;\n int NposSilver2=0;\n int NposSilver3=0;\n double t_start = getRuntime();\n\n\n while (opModeIsActive()) {\n \n if( (getRuntime() - t_start ) > 3.5) break;\n if (Npos1 >=5 || Npos2>=5 || Npos3>=5)break;\n if (NposSilver1>=5 && NposSilver2>=5)break;\n if (NposSilver2>=5 && NposSilver3>=5)break;\n if (NposSilver1>=5 && NposSilver3>=5)break;\n if (tfod != null) {\n // getUpdatedRecognitions() will return null if no new information is available since\n // the last time that call was made.\n List<Recognition> updatedRecognitions = tfod.getUpdatedRecognitions();\n if (updatedRecognitions != null) {\n //telemetry.addData(\"# Object Detected\", updatedRecognitions.size());\n //if (updatedRecognitions.size() == 3) {\n int goldMineralX = -1;\n int silverMineralX = -1;\n for (Recognition recognition : updatedRecognitions) {\n if (recognition.getLabel().equals(LABEL_GOLD_MINERAL)) {\n goldMineralX = (int) recognition.getLeft();\n telemetry.addData(\"gold position\", goldMineralX);\n if(goldMineralX<300) {\n Npos1++;\n telemetry.addData(\"loc\", 1);\n }else if(goldMineralX<800){\n Npos2++;\n telemetry.addData(\"loc\", 2);\n }else{\n Npos3++;\n telemetry.addData(\"loc\", 3);\n }\n } \n \n if (recognition.getLabel().equals(LABEL_SILVER_MINERAL)) {\n silverMineralX = (int) recognition.getLeft();\n telemetry.addData(\"silver position\", silverMineralX);\n if(silverMineralX<300) {\n NposSilver1++;\n telemetry.addData(\"loc\", 1);\n }else if(silverMineralX<300){\n NposSilver2++;\n telemetry.addData(\"loc\", 2);\n }else{\n NposSilver3++;\n telemetry.addData(\"loc\", 3);\n }\n } \n }\n telemetry.update();\n }\n }\n }\n\n\n if (tfod != null) {\n tfod.shutdown();\n }\n \n \n \n telemetry.addData(\"\", 2);\n \n if (Npos1>=5)return 1;\n if (Npos2>=5)return 2;\n if (Npos3>=5)return 3;\n if (NposSilver1>=5 && NposSilver2>=5)return 3;\n if (NposSilver2>=5 && NposSilver3>=5)return 1; \n if (NposSilver1>=5 && NposSilver3>=5)return 2;\n\n return 3;\n }", "public static void main (String[] args) {\n\n Config config = ConfigUtils.loadConfig(\"/home/gregor/git/matsim/examples/scenarios/pt-tutorial/0.config.xml\");\n// config.controler().setLastIteration(0);\n// config.plans().setHandlingOfPlansWithoutRoutingMode(PlansConfigGroup.HandlingOfPlansWithoutRoutingMode.useMainModeIdentifier);\n// Scenario scenario = ScenarioUtils.loadScenario(config);\n// Controler controler = new Controler(scenario);\n// controler.run();\n\n\n// Config config = this.utils.loadConfig(IOUtils.extendUrl(ExamplesUtils.getTestScenarioURL(\"pt-tutorial\"), \"0.config.xml\"));\n config.controler().setLastIteration(1);\n config.plans().setHandlingOfPlansWithoutRoutingMode(PlansConfigGroup.HandlingOfPlansWithoutRoutingMode.useMainModeIdentifier);\n\n\n// try {\n Controler controler = new Controler(config);\n// final EnterVehicleEventCounter enterVehicleEventCounter = new EnterVehicleEventCounter();\n// final StageActivityDurationChecker stageActivityDurationChecker = new StageActivityDurationChecker();\n// controler.addOverridingModule( new AbstractModule(){\n// @Override public void install() {\n// this.addEventHandlerBinding().toInstance( enterVehicleEventCounter );\n// this.addEventHandlerBinding().toInstance( stageActivityDurationChecker );\n// }\n// });\n controler.run();\n }", "@Test\n public void testExample3() {\n assertSolution(\"-6\", \"example-day01-2018-3.txt\");\n }", "public String toCheckpoint() {\n return null;\n }", "@Test\n\tpublic void testPhase3(){\n\t\tSystem.out.println(\"Array test\");\n\t\tParseDriver driver = new ParseDriver(\"resources/pascal_files/array.pas\");\n\t\tdriver.run();\n\t\tSystem.out.println();\n\t\tSystem.out.println(\"Array Ref test\");\n\t\tdriver = new ParseDriver(\"resources/pascal_files/arrayref.pas\");\n\t\tdriver.run();\n\t\t\n\t\tSystem.out.println();\n\t\tSystem.out.println(\"If2 test\");\n\t\tdriver = new ParseDriver(\"resources/pascal_files/if2.pas\");\n\t\tdriver.run();\n\t}", "public static void main(String[] args) throws Exception {\n final int numRows = 28;\n final int numColumns = 28;\n int outputNum = 10; // number of output classes\n int batchSize = 128; // batch size for each epoch\n int rngSeed = 123; // random number seed for reproducibility\n int numEpochs = 15; // number of epochs to perform\n String modelPath = \"モデルパスを入力\";\n\n //Get the DataSetIterators:\n DataSetIterator mnistTrain = new MnistDataSetIterator(batchSize, true, rngSeed);\n DataSetIterator mnistTest = new MnistDataSetIterator(batchSize, false, rngSeed);\n\n\n System.out.println(\"Build model....\");\n MultiLayerConfiguration conf = new NeuralNetConfiguration.Builder()\n .seed(rngSeed) //include a random seed for reproducibility\n // use stochastic gradient descent as an optimization algorithm\n .updater(new Nesterovs(0.006, 0.9))\n .l2(1e-4)\n .list()\n .layer(new DenseLayer.Builder() //create the first, input layer with xavier initialization\n .nIn(numRows * numColumns)\n .nOut(1000)\n .activation(Activation.RELU)\n .weightInit(WeightInit.XAVIER)\n .build())\n .layer(new OutputLayer.Builder(LossFunctions.LossFunction.NEGATIVELOGLIKELIHOOD) //create hidden layer\n .nIn(1000)\n .nOut(outputNum)\n .activation(Activation.SOFTMAX)\n .weightInit(WeightInit.XAVIER)\n .build())\n .build();\n\n\n MultiLayerNetwork model = new MultiLayerNetwork(conf);\n model.init();\n //print the score with every 1 iteration\n UIServer uiServer = UIServer.getInstance();\n InMemoryStatsStorage statsStorage = new InMemoryStatsStorage();\n uiServer.attach(statsStorage);\n model.setListeners(new StatsListener(statsStorage),new ScoreIterationListener(1));\n\n System.out.println(\"Train model....\");\n model.fit(mnistTrain, numEpochs);\n\n\n\n\n System.out.println(\"Evaluate model....\");\n Evaluation eval = model.evaluate(mnistTest);\n System.out.println(eval.stats());\n ModelSerializer.writeModel(model, new File(modelPath), false);\n System.out.println(\"****************Example finished********************\");\n\n }", "public void Run(boolean has_probe){\n hasProbe = has_probe;\n if (hasProbe){\n primerNum = 6;\n } else {\n primerNum = 4;\n }\n\n setUpBases();\n setUpCts();\n\n EnvMaker envMaker = new EnvMaker(pFilename, hasProbe);\n\n primers = envMaker.setPrimers();\n pNames = envMaker.getpNames();\n pLens = envMaker.getpLens();\n\n //Combined primer length - needed for combined mismatch freq\n mLen = primers[0].length() + primers[primerNum /2 -1].length();\n\n envMaker.checkSeqs(sFilename);\n\n buildSeqList(envMaker, envMaker.getSeqCount());\n //End Setup\n\n try {\n outFilename = sFilename + \"_out.txt\";\n\n FileWriter fstreamOut = new FileWriter(outFilename);\n BufferedWriter outOut = new BufferedWriter(fstreamOut);\n\n outFilename = sFilename + \"_cts.txt\";\n\n FileWriter fstreamCT = new FileWriter(outFilename);\n BufferedWriter outCT = new BufferedWriter(fstreamCT);\n\n //outputPrinter printer = new outputPrinter(sFilename, pLens);\n\n //Loop through each sequence in turn\n for (int s = 0; s < compSeqs.length; s++) {\n success = false;\n\n try {\n\n //outFilename=sFilename.substring(0, sFilename.lastIndexOf(\".\"))+\"_\"+s+\"_matrix.txt\";\n outFilename=sFilename+\"_\"+(s+1)+\"_matrix.txt\";\n\n tTx=\"Evaluating seq \"+(s+1)+\" \"+seqNames[s];\n System.out.println(tTx);\n outOut.write(tTx+System.getProperty(\"line.separator\"));\n\n //Clear results - 6 for F/P/R*2, 14 for all the different mutation counts - plus one for Ns now\n scores = new int[compSeqs[s].length()][primerNum][16];\n\n runMismatchDetection(s);\n\n PrintCandidatePos(outOut);\n }//matrix outputFile try\n\n catch (Exception e) {\n e.printStackTrace();\n System.err.println(\"Error: \" + e.getMessage());\n }\n\n if(!success) {\n noHits+=seqNames[s]+\"\\tNOHIT\"+System.getProperty(\"line.separator\");\n }\n }//end of comSeq loop s - evaluate each seq\n\n outOut.close();\n\n outCT.write(noHits);\n outCT.close();\n }//cts outFile try\n catch (Exception e) {\n e.printStackTrace();\n System.err.println(\"Error: \" + e.getMessage());\n }\n System.out.println(\"GoPrime finished...Exiting\");\n }", "static void setExample() throws Exception {\n PetriNet net = new PetriNet(2);\n PetriNet.setNet(net);\n \n int[] tmin = {2, 1};\n int[] tdelta = {-1, 1};\n int[] umin = {1, 2};\n int[] udelta = {-1, 2};\n int[] vmin = {1, 0};\n int[] vdelta = {1, 1};\n m0 = new Marking(new int[]{3, 1});\n mF = new Marking(new int[]{0, 4});\n \n PNTransition t = new PNTransition(tmin, tdelta);\n PNTransition u = new PNTransition(umin, udelta);\n PNTransition v = new PNTransition(vmin, vdelta);\n net.addTransition(t);\n net.addTransition(u);\n // net.addTransition(v);\n }" ]
[ "0.6496799", "0.6146395", "0.57492507", "0.5739286", "0.56844515", "0.5633415", "0.5633225", "0.563148", "0.56090415", "0.5599009", "0.5586518", "0.5574444", "0.54830974", "0.5477991", "0.5435754", "0.5422894", "0.5417086", "0.5404358", "0.5403096", "0.5396763", "0.5396648", "0.5366458", "0.5365846", "0.5362717", "0.5361951", "0.5360281", "0.5355456", "0.53430814", "0.5340765", "0.5336771", "0.5312096", "0.52810854", "0.52746147", "0.52675295", "0.52622443", "0.5259459", "0.5257815", "0.5230447", "0.52096367", "0.52093047", "0.5198162", "0.51975083", "0.51903117", "0.5188107", "0.5187232", "0.5185662", "0.5173718", "0.5158689", "0.5155861", "0.5153004", "0.5150587", "0.51419175", "0.5140399", "0.51381296", "0.5136098", "0.51309085", "0.512307", "0.5120608", "0.5119922", "0.51199174", "0.51199085", "0.5118598", "0.51132536", "0.5112288", "0.5111565", "0.5109667", "0.51034063", "0.51018256", "0.509469", "0.50899726", "0.50833297", "0.50755006", "0.5075327", "0.5072519", "0.5072441", "0.5064518", "0.50641793", "0.50616294", "0.50419945", "0.5041209", "0.5041169", "0.5039506", "0.50386846", "0.5032392", "0.50322074", "0.50263757", "0.5021279", "0.5015544", "0.50123537", "0.50077873", "0.5006495", "0.50052863", "0.50045973", "0.4998204", "0.49966323", "0.49942067", "0.499133", "0.49912483", "0.49909618", "0.4988682", "0.49878094" ]
0.0
-1
Constructor, which initializes the grid.
public Grid(int[][] grid) { this.grid = grid; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public RegularGrid() {\r\n }", "public Grid() {\n }", "public Grid() {\n super(); // create a new JPanel\n grid = new ArrayList<>(); // initialize a list containing the blocks\n \n setLayout(null); // format the component\n setFocusable(false);\n setBackground(Block.deadColor);\n addComponentListener(new java.awt.event.ComponentAdapter() { // detects when the window is resized to resize the grid\n @Override\n public void componentResized(java.awt.event.ComponentEvent evt) {\n resizeGrid();\n }\n });\n \n // provide a link to the grid to classes so that all instances have access to it\n PathFinder.setGrid(this);\n EscapeBlock.setGrid(this);\n Character.setGrid(this);\n \n }", "public Grid() {\n setPreferredSize(new Dimension(960, 640));\n setBounds(0, 0, 960, 640);\n setLayout(null);\n setBackground(Color.black);\n this.size = 30;\n squares = new Square[size][20];\n }", "public BuildGrid()\n {\n System.out.print(\"Creating a new grid: \");\n\n m_grid = new double[1][5];\n setDimX(1);\n setDimY(5);\n\n this.fillWith(0);\n System.out.println(\"Done\");\n }", "public Grid()\n\t{\n\t\tfor (int x =0;x<=8;x++)\n\t\t\tgrid[x]=0;\n }", "public Grid()\n {\n height = 4;\n\twidth = 4;\n\tcases = new Case[height][width];\n }", "public Grid() {\n minorLinesPath = new Path2D.Double();\n majorLinesPath = new Path2D.Double();\n\n minorLinePositions = new double[2][];\n majorLinePositions = new double[2][];\n\n minorLinePositionsScreen = new int[2][];\n majorLinePositionsScreen = new int[2][];\n\n listeners = new LinkedList<>();\n\n stroke = new BasicStroke();\n }", "public Grid ()\n {\n mGrid = new Move[3][3];\n for (int row = 0; row < 3; row++)\n for (int column = 0; column < 3; column++)\n mGrid[row][column] = new Move(Player.NONE, row, column);\n }", "public Gridder()\n\t{\n grid = new Cell[MapConstant.MAP_X][MapConstant.MAP_Y];\n for (int row = 0; row < grid.length; row++) {\n for (int col = 0; col < grid[0].length; col++) {\n grid[row][col] = new Cell(row, col);\n\n // Set the virtual walls of the arena\n if (row == 0 || col == 0 || row == MapConstant.MAP_X - 1 || col == MapConstant.MAP_Y - 1) {\n grid[row][col].setVirtualWall(true);\n }\n }\n }\n\t}", "public void initialize() {\n\t\tnumRows = gridConfig.getNumRows();\n\t\tnumCols = gridConfig.getNumCols();\n\t\tgridCellCount = numRows * numCols;\n\t\tcreateMaps();\n\t\tsetCurrSimulationMap();\n\t\tcellWidth = SIZE / numCols;\n\t\tcellHeight = SIZE / numRows;\n\t\tcurrentGrid = new Cell[numRows][numCols];\n\t\tnewGrid = new Cell[numRows][numCols];\n\t\tempty(currentGrid);\n\t\tempty(newGrid);\n\t\tsetShapes();\n\t\tsetInitialStates();\n\t}", "Grid(int width, int height) {\n this.width = width;\n this.height = height;\n\n // Create the grid\n grid = new Cell[width][height];\n\n // Populate with dead cells to start\n populateGrid(grid);\n }", "public Grid() { //Constructs a new grid and fills it with Blank game objects.\r\n\t\tthis.grid = new GameObject[10][10];\r\n\t\tthis.aliveShips = new Ships[4];\r\n\t\tfor (int i = 0; i < this.grid.length; i++) {\r\n\t\t\tfor (int j = 0; j < this.grid[i].length; j++) {\r\n\t\t\t\tthis.grid[i][j] = new Blank(i,j);\r\n\t\t\t}\r\n\t\t}\r\n\t}", "public DynamicGrid() {\n\t\t// constructor\n\t\t// create an empty table of 0 rows and 0 cols\n\t\tthis.storage = new DynamicArray<DynamicArray<T>>();\n\t}", "public Grid() {\n\t\tthis.moveCtr = 0; \n\t\tlistOfSquares = new ArrayList<Square>();\n\t\t//populating grid array with squares\n\t\tfor(int y = 0; y < GridLock.HEIGHT; y++) {\n\t \tfor(int x = 0; x < GridLock.WIDTH; x++) { //square coordinates go from (0,0) to (5,5)\n\t \tSquare square;\n\t \t//Setting up a square which has index values x,y and the size of square.\n\t\t\t\t\tsquare = new Square(x, y, GridLock.SQUARE_SIZE, GridLock.SQUARE_SIZE); \n\t\t\t\t\tgrid[x][y] = square;\n\t\t\t\t\tlistOfSquares.add(square);\n\t \t\t\t\t\t\n\t \t\t}\n\t \t}\n \t\n }", "public WeatherGridSlice() {\n super();\n }", "public Sudoku() {\n\t\tgrid = new Variable[ROWS][COLUMNS];\n\t}", "public Stage() {\n\n for (int i = 0; i < 20; i++) { // Generate the basic grid array\n ArrayList<Cell> cellList = new ArrayList<Cell>();\n cells.add(cellList);\n for (int j = 0; j < 20; j++) {\n cells.get(i).add(new Cell(10 + 35 * i, 10 + 35 * j));\n }\n }\n\n for (int i = 0; i < cells.size(); i++) { // Generate the list of environment blocks\n ArrayList<Environment> envList = new ArrayList<Environment>();\n environment.add(envList);\n for (int j = 0; j < cells.size(); j++) {\n int cellGenerator = (int) (Math.random() * 100) + 1;\n environment.get(i).add(generateCell(cellGenerator, cells.get(i).get(j)));\n }\n }\n\n grid = new Grid(cells, environment); // Initialise the grid with the generated cells array\n }", "private void init() {\r\n\r\n createGUI();\r\n\r\n setSize(new Dimension(600, 600));\r\n setTitle(\"Grid - Regular Grid Renderer\");\r\n }", "public Board() {\n for (int row = 0; row < 9; row++) {\n for (int col = 0; col < 9; col++) {\n this.grid[row][col] = 0;\n }\n }\n }", "public CircularGrid() {\r\n\t\tthis(0, false, false);\r\n\t}", "public MapGrid(){\n\t\tthis.cell = 25;\n\t\tthis.map = new Node[this.width][this.height];\n\t}", "private void initializeGrid() {\r\n if (this.rowCount > 0 && this.columnCount > 0) {\r\n this.cellViews = new Rectangle[this.rowCount][this.columnCount];\r\n for (int row = 0; row < this.rowCount; row++) {\r\n for (int column = 0; column < this.columnCount; column++) {\r\n Rectangle rectangle = new Rectangle();\r\n rectangle.setX((double)column * CELL_WIDTH);\r\n rectangle.setY((double)row * CELL_WIDTH);\r\n rectangle.setWidth(CELL_WIDTH);\r\n rectangle.setHeight(CELL_WIDTH);\r\n this.cellViews[row][column] = rectangle;\r\n this.getChildren().add(rectangle);\r\n }\r\n }\r\n }\r\n }", "public GridMapPanel() {\n super();\n initialize();\n }", "private void initGrids() {\n grid0 = new Grid(100f, 50f, 100f, 0);\n grid1 = new Grid(100f, 150f, 100f, 1);\n grid2 = new Grid(100f, 250f, 100f, 2);\n grid3 = new Grid(100f, 350f, 100f, 3);\n grid4 = new Grid(100f, 50f, 200f, 4);\n grid5 = new Grid(100f, 150f, 200f, 5);\n grid6 = new Grid(100f, 250f, 200f, 6);\n grid7 = new Grid(100f, 350f, 200f, 7);\n grid8 = new Grid(100f, 50f, 300f, 8);\n grid9 = new Grid(100f, 150f, 300f, 9);\n grid10 = new Grid(100f, 250f, 300f, 10);\n grid11 = new Grid(100f, 350f, 300f, 11);\n grid12 = new Grid(100f, 50f, 400f, 12);\n grid13 = new Grid(100f, 150f, 400f, 13);\n grid14 = new Grid(100f, 250f, 400f, 14);\n grid15 = new Grid(100f, 350f, 400f, 15);\n\n /**\n * Adding grids from 0 to 15 to static ArayList of all grids\n */\n grids.clear();\n\n grids.add(grid0);\n grids.add(grid1);\n grids.add(grid2);\n grids.add(grid3);\n grids.add(grid4);\n grids.add(grid5);\n grids.add(grid6);\n grids.add(grid7);\n grids.add(grid8);\n grids.add(grid9);\n grids.add(grid10);\n grids.add(grid11);\n grids.add(grid12);\n grids.add(grid13);\n grids.add(grid14);\n grids.add(grid15);\n }", "public Grid(int rows, int cols, String[] vals)\r\n\t{\r\n\t}", "public Board()\r\n\t{\r\n\t\tfor(int x = 0; x < 9; x++)\r\n\t\t\tfor(int y = 0 ; y < 9; y++)\r\n\t\t\t{\r\n\t\t\t\tboard[x][y] = new Cell();\r\n\t\t\t\tboard[x][y].setBoxID( 3*(x/3) + (y)/3+1);\r\n\t\t\t}\r\n\t}", "private Board()\r\n {\r\n this.grid = new Box[Config.GRID_SIZE][Config.GRID_SIZE];\r\n \r\n for(int i = 0; i < Config.NB_WALLS; i++)\r\n {\r\n this.initBoxes(Wall.ID);\r\n }\r\n \r\n for(int i = 0; i < Config.NB_CHAIR; i++)\r\n {\r\n this.initBoxes(Chair.ID);\r\n }\r\n \r\n for(int i = 0; i < Config.NB_PLAYER; i++)\r\n {\r\n this.initBoxes(Chair.ID);\r\n }\r\n }", "public void initialize() {\n\t\t// set seed, if defined\n\t\tif (randomSeed > Integer.MIN_VALUE) {\n\t\t\tapp.randomSeed(randomSeed);\n\t\t}\n\n\t\tfor (int x = 0; x < gridX; x++) {\n\t\t\tfor (int y = 0; y < gridY; y++) {\n\t\t\t\tCell c = new Cell(\n\t\t\t\t\tapp,\n\t\t\t\t\tcellSize,\n\t\t\t\t\tcolors[(int)app.random(colors.length)],\n\t\t\t\t\ttrue\n\t\t\t\t);\n\t\t\t\tc.position = PVector.add(offset, new PVector(x * cellSize, y * cellSize));\n\t\t\t\tcells[x + (y * gridX)] = c;\n\t\t\t\tnewCells[x + (y * gridX)] = c;\n\t\t\t}\n\t\t}\n\t}", "public Grid(ArrayList<String> headers) {\n }", "public Grid(int recRowSize, int recColSize) {\r\n counter = 0;\r\n rowSize = recRowSize;\r\n colSize = recColSize;\r\n myCells = new Cell[recRowSize + 2][recColSize + 2];\r\n for (int row = 0; row < myCells.length; row++) {\r\n for (int col = 0; col < myCells[row].length; col++) {\r\n myCells[row][col] = new Cell();\r\n }\r\n }\r\n }", "public Grid(int h,int w)\n {\n height = h;\n\twidth = w;\n\tcases = new Case[height][width];\n }", "public Cell()\n\t{\n\t}", "public RandomGrid() {\n random = new Random(System.currentTimeMillis());\n /*\n indexes = new LinkedList<>();\n for (int i = 0; i < 81; i++) {\n indexes.add(i);\n }\n numbers = new ArrayList<>(9);\n for (int i = 1; i <= 9; i++) {\n numbers.add(i);\n }\n Collections.shuffle(indexes, random);\n */\n grid = new int[9][9];\n for (int i = 0; i < 9; i++) {\n for (int j = 0; j < 9; j++) {\n grid[i][j] = 0;\n }\n }\n subGrid = new SubGrid[3][3];\n for (int i = 0; i < 3; i++) {\n for (int j = 0; j < 3; j++) {\n subGrid[i][j] = new SubGrid();\n }\n }\n }", "private void initialize() {\r\n\t\tfor (int i = -1; i < myRows; i++)\r\n\t\t\tfor (int j = -1; j < myColumns; j++) {\r\n\t\t\t\tCell.CellToken cellToken = new Cell.CellToken(j, i);\r\n\r\n\t\t\t\tif (i == -1) {\r\n\t\t\t\t\tif (j == -1)\r\n\t\t\t\t\t\tadd(new JLabel(\"\", null, SwingConstants.CENTER));\r\n\t\t\t\t\telse\r\n\t\t\t\t\t\tadd(new JLabel(cellToken.columnString(), null,\r\n\t\t\t\t\t\t\t\tSwingConstants.CENTER));\r\n\t\t\t\t} else if (j == -1)\r\n\t\t\t\t\tadd(new JLabel(Integer.toString(i), null,\r\n\t\t\t\t\t\t\tSwingConstants.CENTER));\r\n\t\t\t\telse {\r\n\t\t\t\t\tcellArray[i][j] = new CellsGUI(cellToken);\r\n\r\n\t\t\t\t\tsetCellText(cellArray[i][j]);\r\n\t\t\t\t\tcellArray[i][j].addMouseListener(new MouseCellListener());\r\n\t\t\t\t\tcellArray[i][j].addKeyListener(new KeyCellListener());\r\n\t\t\t\t\tcellArray[i][j].addFocusListener(new FocusCellListener());\r\n\r\n\t\t\t\t\tadd(cellArray[i][j]);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t}", "public VectorGridSlice() {\n\n }", "public void initializeGrid() {\n resetGrid(_lifeGrid);\n\n _lifeGrid[8][(WIDTH / 2) - 1] = 1;\n _lifeGrid[8][(WIDTH / 2) + 1] = 1;\n _lifeGrid[9][(WIDTH / 2) - 1] = 1;\n _lifeGrid[9][(WIDTH / 2) + 1] = 1;\n _lifeGrid[10][(WIDTH / 2) - 1] = 1;\n _lifeGrid[10][(WIDTH / 2)] = 1;\n _lifeGrid[10][(WIDTH / 2) + 1] = 1;\n\n }", "public Cell ()\n {\n cellStatus = false;\n xCoordinate = 0;\n yCoordinate = 0;\n button = new JButton();\n }", "public TwoDimensionalGrid()\r\n {\r\n cellGrid = new Cell[LOWER_BOUND][RIGHT_BOUND];\r\n\r\n for (int columns = 0; columns < LOWER_BOUND; columns ++)\r\n {\r\n for (int rows = 0; rows < RIGHT_BOUND; rows ++)\r\n {\r\n cellGrid[columns][rows] = new Cell(true);\r\n } // end of for (int rows = 0; rows < RIGHT_BOUND; rows ++)\r\n System.out.print(\"\\n\");\r\n } // end of for (int columns = 0; columns < LOWER_BOUND; columns ++)\r\n }", "public Board() {\n\n for(int row = 0; row < size; row++) {\n for(int col = 0; col < size; col++) {\n\n grid[row][col] = \"-\";\n\n }\n }\n\n }", "public Grid(Location tr, int divisions)\r\n {\r\n this(new Location.Location2D(0, 0), tr, divisions);\r\n }", "public GridPane() {\n\t\t for (int i=0;i<MAX_X; i++) {\n\t\t\tfor (int j=0;j<MAX_Y;j++) {\n\t\t\t\tseed[i][j] = new Cell(i,j,false);\n\t\t\t}//end for j\n\t\t }//end for i\n\t\n\t \tdefaultBackground = getBackground();\n\t\n\t MatteBorder border = new MatteBorder(1, 1, 1, 1, Color.BLACK);\n\t \tthis.setBorder(border);\n\t \t\t\n\t\t addMouseListener(new MouseAdapter() {\n\t @Override\n\t public void mouseClicked(MouseEvent e) {\n\t \t int x1 = (int)(e.getX()/CELL_WIDTH);\n\t \t int y1 = (int)(e.getY()/CELL_WIDTH);\n\t \t if(seed[x1][y1].isAlive()) {\n\t \t\t seed[x1][y1].isAlive = false;\n\t \t }\n\t \t else {\n\t \t\t seed[x1][y1].isAlive = true;\n\t \t }\n//\t \t System.out.println(\"[\"+x1+\",\"+y1+\"]\");\n\t repaint();\n\t }\n\t });\n\t }", "@Override\n public void buildGrid(){\n for(int column=0; column<columns; column++){\n for(int row=0; row<rows; row++){\n grid[column][row] = \"[ ]\";\n }\n }\n }", "public Grid()\n {\n dest = new GridReference[2];\n dest[0] = new GridReference(Game.GRID_WIDTH-(int)((double)Game.GRID_WIDTH*0.05),\n Game.GRID_HEIGHT-(int)((double)Game.GRID_HEIGHT*0.2));\n dest[1] = new GridReference(Game.GRID_WIDTH-(int)((double)Game.GRID_WIDTH*0.05),\n Game.GRID_HEIGHT-(int)((double)Game.GRID_HEIGHT*0.8));\n //dest[2] = new GridReference(5,50);\n defaultStart = new GridReference((int)((double)Game.GRID_WIDTH*0.05),\n Game.GRID_HEIGHT-(int)((double)Game.GRID_HEIGHT*0.5));\n defaultWalker = Walkers.WEIGHTED2;\n \n createField();\n \n walkers = new ArrayList<>();\n //addUnits(randDest(), randDest());\n /*for (int i = 0; i < grassPatches.length; i++)\n {\n System.out.println(i + \":\" + grassPatches[i]);\n }*/\n }", "public void createGrid() {\n\t\tint[][] neighbours = getIo().getNeighbours();\n\t\tsetGrid(new GridAlg(neighbours, animals));\n\t\tgetGrid().setStep(getStep());\n\t}", "private void initGrid() {\n m_emptyHexCount = 0;\n m_hexagons.clear();\n for (int i = 0; i < m_rowNum; i++) {\n ArrayList<Hexagon> tmp = new ArrayList<>();\n int maxColNum;\n if (i % 2 == 0)\n maxColNum = m_colNum;\n else\n maxColNum = m_colNum - 1;\n\n for (int j = 0; j < maxColNum; j++) {\n tmp.add(new Hexagon(m_app));\n m_emptyHexCount++;\n }\n m_hexagons.add(tmp);\n }\n }", "private void initializeGrid()\n {\n \t\n // initialize grid as a 2D ARRAY OF THE APPROPRIATE DIMENSIONS\n \tgrid = new int [NUM_ROWS][NUM_COLS];\n\n\n //INITIALIZE ALL ELEMENTS OF grid TO THE VALUE EMPTY\n \tfor(int row = 0; row < NUM_ROWS; row++){\n \t\tfor(int col = 0; col < NUM_COLS; col++){\n \t\t\tgrid[row][col] = EMPTY;\n \t\t}\n \t}\n }", "public GameGridBuilder(int gridWidth, int gridHeight) {\n this.gridWidth = gridWidth;\n this.gridHeight = gridHeight;\n }", "public void initializeGrid() {\n for (int i = minRow; i <= maxRow; i++) {\n for (int j = minCol; j <= maxCol; j++) {\n grid[i][j] = 0;\n }\n }\n }", "public GridElement(int rows, int cols)\n\t{\n\t\tm_rows = rows;\n\t\tm_cols = cols;\n\t\tm_textLayout = new TextLayout[rows][cols];\n\t\tm_iterator = new AttributedCharacterIterator[rows][cols];\n\t\tm_rowHeight = new int[rows];\n\t\tm_colWidth = new int[cols];\n\t\t//\texplicit init\n\t\tfor (int r = 0; r < m_rows; r++)\n\t\t{\n\t\t\tm_rowHeight[r] = 0;\n\t\t\tfor (int c = 0; c < m_cols; c++)\n\t\t\t{\n\t\t\t\tm_textLayout[r][c] = null;\n\t\t\t\tm_iterator[r][c] = null;\n\t\t\t}\n\t\t}\n\t\tfor (int c = 0; c < m_cols; c++)\n\t\t\tm_colWidth[c] = 0;\n\t}", "private void initialize() {\n GridBagConstraints gridBagConstraints21 = new GridBagConstraints();\n gridBagConstraints21.gridx = 0;\n gridBagConstraints21.weightx = 1.0D;\n gridBagConstraints21.fill = java.awt.GridBagConstraints.HORIZONTAL;\n gridBagConstraints21.gridy = 1;\n GridBagConstraints gridBagConstraints11 = new GridBagConstraints();\n gridBagConstraints11.gridx = 0;\n gridBagConstraints11.insets = new java.awt.Insets(2, 2, 2, 2);\n gridBagConstraints11.fill = java.awt.GridBagConstraints.BOTH;\n gridBagConstraints11.weightx = 1.0D;\n gridBagConstraints11.weighty = 1.0D;\n gridBagConstraints11.gridy = 2;\n GridBagConstraints gridBagConstraints = new GridBagConstraints();\n gridBagConstraints.gridx = 0;\n gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL;\n gridBagConstraints.anchor = java.awt.GridBagConstraints.WEST;\n gridBagConstraints.weightx = 1.0D;\n gridBagConstraints.insets = new java.awt.Insets(2, 2, 2, 2);\n gridBagConstraints.gridy = 0;\n this.setLayout(new GridBagLayout());\n setBorder(javax.swing.BorderFactory.createTitledBorder(null, \"Manage Grid Map File\",\n javax.swing.border.TitledBorder.DEFAULT_JUSTIFICATION, javax.swing.border.TitledBorder.DEFAULT_POSITION,\n null, PortalLookAndFeel.getPanelLabelColor()));\n this.add(getGridMapFilePanel(), gridBagConstraints);\n this.add(getTablePanel(), gridBagConstraints11);\n this.add(getControlPanel(), gridBagConstraints21);\n }", "public Table() {\n // <editor-fold desc=\"Initialize Cells\" defaultstate=\"collapsed\">\n for (int row = 0; row < 3; row++) {\n for (int column = 0; column < 3; column++) {\n if (cells[row][column] == null) {\n cells[row][column] = new Cell(row, column);\n }\n }\n }\n // </editor-fold>\n }", "public Classroom()\n { \n // Create a new world with 10x6 cells with a cell size of 130x130 pixels.\n super(10, 6, 130); \n prepare();\n }", "public GriddedPanel() {\n this(new Insets(2, 2, 2, 2));\n\n }", "public void createGrid() {\r\n generator.generate();\r\n }", "public Main()\n { \n // Create a new world with 600x400 cells with a cell size of 1x1 pixels.\n super(600, 600, 1); \n\n prepare();\n }", "public Board()\r\n\t{\r\n\t\tthis.grid = new CellState[GRID_SIZE][GRID_SIZE];\r\n\t\tthis.whiteMarblesCount = MARBLES_COUNT;\r\n\t\tthis.blackMarblesCount = MARBLES_COUNT;\r\n\t\t\r\n\t\t/**\r\n\t\t * Initializes the board with empty value\r\n\t\t */\r\n\t\tfor (int indexcol = 0; indexcol < GRID_SIZE; indexcol++)\r\n\t\t{\r\n\t\t\tfor (int indexrow = 0; indexrow < GRID_SIZE; indexrow++)\r\n\t\t\t{\r\n\t\t\t\tthis.grid[indexrow][indexcol] = CellState.EMPTY;\t\t\t\t\r\n\t\t\t}\t\r\n\t\t}\r\n\t\t\r\n\t\t/**\r\n\t\t * Sets marbles on the board with default style\r\n\t\t */\r\n\t\tfor (int indexcol = 0; indexcol < 5; indexcol++)\r\n\t\t{\r\n\t\t\tthis.grid[0][indexcol] = CellState.WHITE_MARBLE;\r\n\t\t\tthis.grid[8][8 - indexcol] = CellState.BLACK_MARBLE;\r\n\t\t}\r\n\t\tfor (int indexcol = 0; indexcol < 6; indexcol++)\r\n\t\t{\r\n\t\t\tthis.grid[1][indexcol] = CellState.WHITE_MARBLE;\r\n\t\t\tthis.grid[7][8 - indexcol] = CellState.BLACK_MARBLE;\r\n\t\t}\r\n\t\tfor (int indexcol = 2; indexcol < 5; indexcol++)\r\n\t\t{\r\n\t\t\tthis.grid[2][indexcol] = CellState.WHITE_MARBLE;\r\n\t\t\tthis.grid[6][8 - indexcol] = CellState.BLACK_MARBLE;\r\n\t\t}\r\n\t\tthis.grid[3][8] = CellState.INVALID;\r\n\t\tthis.grid[2][7] = CellState.INVALID;\r\n\t\tthis.grid[1][6] = CellState.INVALID;\r\n\t\tthis.grid[0][5] = CellState.INVALID;\r\n\t\tthis.grid[5][0] = CellState.INVALID;\r\n\t\tthis.grid[6][1] = CellState.INVALID;\r\n\t\tthis.grid[7][2] = CellState.INVALID;\r\n\t\tthis.grid[8][3] = CellState.INVALID;\r\n\t}", "public Cell(){}", "private void initializeGrid() {\n // 50 pixel first row for banner\n addPercentRows(root, 5);\n // second row takes up 100% of the remaining space\n addPercentRows(root, 95);\n // One column at 100% width\n addPercentColumns(root, 100);\n\n Label title = new Label(\"Mission Control\");\n title.setFont(new Font(\"Arial\", 22));\n title.setTextFill(Color.WHITE);\n\n GridPane contentGrid = new GridPane();\n // Only need one row as content will fill the entire vertical space\n addPercentRows(contentGrid, 100);\n\n // Need three columns, 1/6 column for nav, 2/3 for main content, 1/6 for warnings\n double sidePanelPercent = (1d / 6d) * 100d;\n double centerPanelPercent = (2d / 3d) * 100d;\n addPercentColumns(contentGrid, sidePanelPercent, centerPanelPercent, sidePanelPercent);\n\n\n addNodeToGrid(title, root, 0, 0, Pos.CENTER, Colours.PRIMARY_COLOUR, Insets.EMPTY);\n // NOTE:: This assumes that it is the only child added to root by this point to set ID.\n // If this is changed DynamicGuiTests will break.\n root.getChildren().get(0).setId(\"pnBanner\");\n\n addNodeToGrid(contentGrid, root, 1, 0);\n\n setupCenterPanel(contentGrid);\n setupRightHandSidePanel(contentGrid);\n setupLeftHandSidePanel(contentGrid);\n\n // Assert they are created - mainly to bypass Spot bugs issues.\n assert this.navigationView != null;\n assert this.graphView != null;\n assert this.informationView != null;\n }", "private void setGrid() {\r\n maxRows = (FORM_HEIGHT - FORM_HEIGHT_ADJUST) / SQUARE_SIZE;\r\n maxColumns = (FORM_WIDTH - FORM_WIDTH_ADJUST) / SQUARE_SIZE; \r\n grid = new JLabel[maxRows][maxColumns];\r\n int y = (FORM_HEIGHT - (maxRows * SQUARE_SIZE)) / 2;\r\n for (int row = 0; row < maxRows; row++) {\r\n int x = (FORM_WIDTH - (maxColumns * SQUARE_SIZE)) / 2;\r\n for (int column = 0; column < maxColumns; column++) {\r\n createSquare(x,y,row,column);\r\n x += SQUARE_SIZE;\r\n }\r\n y += SQUARE_SIZE;\r\n } \r\n }", "public void initialize() {\n\t\tbombLabel.setText(\"Flag: \" + game.getFlagCounter() + \"/\" + game.getNumOfBombs());\n\t\ttimerLabel.setText(\"Time: \" + 0);\n\t\tboard.getStyleClass().add(\"grid\");\n\t\tbtnArray = new Button[game.getHeight()][game.getWidth()];\n\t\tfor (int x = 0; x < game.getHeight(); x++) {\n\t\t\tfor (int y = 0; y < game.getWidth(); y++) {\n\t\t\t\tButton btn = new Button(\"\");\n\t\t\t\tbtnArray[x][y] = btn;\n\t\t\t\tbtn.setMaxSize(50, 50);\n\t\t\t\tbtn.setMinSize(50, 50);\n\t\t\t\t//Add Button to the board (GridPane)\n\t\t\t\tboard.add(btn, x, y);\n\t\t\t\tbtn.setId(x + \" . \" + y);\n\t\t\t\tbtn.setOnMouseClicked(e -> TileClicked(e));\n\t\t\t}\n\t\t}\n\t}", "private Grid makeGrid()\n\t{\n\t\tGrid grid = Grid.grid().\n\t\t\t\tBus(\"1\").\n\t\t\t\tSlackSource(\"Slack\", BASE_VOLTAGE, 0, 0, 0).\n\t\t\t\tLine(\"1-2\", 1, 0.06*BASE_IMPEDANCE, 0.03*BASE_IMPEDANCE).\n\t\t\t\t\tBus(\"2\").\n\t\t\t\t\t\tControllableDemand(\"S\").\n\t\t\t\t\t\tLine(\"2-3\", 1, 0.06*BASE_IMPEDANCE, 0.03*BASE_IMPEDANCE).\n\t\t\t\t\t\t\tBus(\"3\").\n\t\t\t\t\t\t\t\tLoad(\"L\").\n\t\t\t\t\t\t\tterminate().\n\t\t\t\t\t\tterminate().\n\t\t\t\t\t\tLine(\"2-4\", 1, 0.06*BASE_IMPEDANCE, 0.03*BASE_IMPEDANCE).\n\t\t\t\t\t\tBus(\"4\").\n\t\t\t\t\t\t\tDistributedSource(\"DG\").\n\t\t\t\t\t\tterminate().\n\t\t\t\t\tterminate().\n\t\t\t\t\tterminate().\n\t\t\t\tterminate().\n\t\t\tterminate().\n\t\tgrid();\n\t\t\n\t\t// x_0:\n\t\tLoad load = grid.getLoad(\"L\");\n\t\tControllableDemand storage = grid.getControllableDemand(\"S\");\n\t\tDistributedSource dg = grid.getDistributedSource(\"DG\");\n\t\tsetupUnits(load, storage, dg);\n\t\t\n\t\treturn grid;\n\t}", "public Grid(int width, int height)\n\t{\n\t\t\n\t\tplayer = new MainMenuController();\n\t\tw = width;\n\t\th = height;\n\t\t//String p1Score = Integer.toString(player.player1Score);\n\t\t\n\t\tsetMinSize(w * MainMenuController.block_size, h * MainMenuController.block_size);\n\t\tsetBackground(new Background(new BackgroundFill(Color.BLACK, null, null)));\n\t\tsetBorder(new Border(new BorderStroke(Color.CYAN, BorderStrokeStyle.SOLID, null, new BorderWidths(10))));\n\t\t\n\t\n\t}", "public VariableGridLayout() {\n\t\tthis(FIXED_NUM_ROWS, 1, 0, 0);\n\t}", "public Board() {\n initialize(3, null);\n }", "private void initialize() {\n this.board.addBoardChangeListener(this);\n\n this.layers = new ArrayList();\n this.bounds = new Rectangle();\n\n this.zoom = 1.0;\n this.zoomLevel = ZOOM_NORMALSIZE;\n this.affineTransform = new AffineTransform();\n\n this.loadTiles(board);\n this.setPreferredSize(new Dimension((board.getWidth() * 32),\n (board.getHeight() * 32)));\n\n bufferedImage = new BufferedImage((board.getWidth() * 32),\n (board.getHeight() * 32), BufferedImage.TYPE_INT_ARGB);\n\n this.antialiasGrid = true;\n this.gridColor = DEFAULT_GRID_COLOR;\n this.gridOpacity = 100;\n\n if (!this.layers.isEmpty()) {\n this.currentSelectedLayer = this.layers.get(0);\n }\n }", "public ControlPanel(TileGrid grid){\n\t\tsetSize(WIDTH, HEIGHT);\n\t\t\n\t\t/*itrLabel = new JLabel(\"Number of iterations to run:\");\n\t\tadd(itrLabel);\n\t\titerations = new JTextField(\"50\", 5);\n\t\tadd(iterations);*/\n\t\t\n\t\tstart = new JButton(\"Start game\");\n\t\tstart.addActionListener(this);\n\t\tadd(start);\n\t\treset = new JButton(\"Reset\");\n\t\treset.addActionListener(this);\n\t\tadd(reset);\n\t\tresume = new JButton(\"Resume\");\n\t\tresume.addActionListener(this);\n\t\tadd(resume);\n\t\tstop = new JButton(\"Stop\");\n\t\tstop.addActionListener(this);\n\t\tadd(stop);\n\t\t\n\t\tpresetLabel = new JLabel(\"Preset configurations:\");\n\t\tadd(presetLabel);\n\t\tString[] presetList = {\"Select a preset\", \"Glider\", \"Small Explosion\", \"Gosper Glider Gun\"};\n\t\tpresets = new JComboBox<String>(presetList);\n\t\tpresets.addItemListener(this);\n\t\tadd(presets);\n\t\t\n\t\tthis.grid = grid;\n\t}", "public Grid(int[] intBoard)\n\t{\n\t\tfor (int x =0;x<=8;x++)\n\t\t\tthis.grid[x]= intBoard[x];\n\t}", "public GridPane initializeGridPane() {\n\t\tGridPane world = new GridPane();\n\t\t\n\t\tfor (int x = 0; x < this.columns; x++) {\n\t\t\tfor (int y = 0; y < this.rows; y++) {\n\t\t\t\tRectangle cellGUI = new Rectangle(this.widthOfCells - 1, this.heightOfCells - 1);\n\t\t\t\tcellGUI.setFill(Color.web(\"#FFFFFF\"));\t\t// White cell background color\n cellGUI.setStroke(Color.web(\"#C0C0C0\")); \t// Grey cell border color\n cellGUI.setStrokeWidth(1); \t\t\t\t\t// Width of the border\n\n world.add(cellGUI, x, y);\n this.cellGUIArray[x][y] = cellGUI;\n\n cellGUI.setOnMouseClicked((event) -> {\n \tthis.currentGeneration = this.simulation.getCurrentGeneration();\n for (int i = 0; i < columns; i++) {\n for (int j = 0; j < rows; j++) {\n if (this.cellGUIArray[i][j].equals(cellGUI) && this.currentGeneration[i][j] == 0) {\n this.currentGeneration[i][j] = 1;\n } else if (this.cellGUIArray[i][j].equals(cellGUI) && this.currentGeneration[i][j] == 1) {\n this.currentGeneration[i][j] = 0;\n }\n }\n }\n this.simulation.setCurrentGeneration(this.currentGeneration);\n });\n\t\t\t}\n\t\t}\n\t\treturn world;\n\t}", "public DraftGrid() {\n initComponents();\n markedCard = null;\n emptyGrid = true;\n }", "public BubbleGrid(int[][] grid) {\n this.grid = grid;\n }", "public CircularGrid(CircularGrid<E> grid) {\r\n\t\tinit(grid.mColumnCount, grid.mRowCount);\r\n\t\tfill(grid.mElements);\r\n\t}", "public GridWorld()\n\t{\n\t\tadd(grid = new Grid());\n\t\tfade = new Fade();\n\t\tfade.fadeIn();\n\t\tbackground.color().setAlpha(0.6f);\n\t}", "public pr3s1()\n { \n // Create a new world with 600x400 cells with a cell size of 1x1 pixels.\n super(1280, 720, 1); \n prepare();\n }", "public Grid(Location bl, Location tr, int divisions)\r\n {\r\n this(bl, \r\n new Location.Location2D(tr.getX(), bl.getY()),\r\n new Location.Location2D(bl.getX(), tr.getY()),\r\n tr, divisions);\r\n }", "public GridSimRandom() {\n // empty\n }", "public mGrid(float width) {\r\n\t\tthis.width = width;\r\n\t\tthis.pos = new mPoint3(0,0,0);\r\n\t\tmPoint3[] points = new mPoint3[17];\r\n\t\tpoints[0] = pos;\r\n\t\tfor(int i=-2;i<=2;i++){\r\n\t\t\tpoints[2*i+5] = new mPoint3(2*width,i*width,0);\r\n\t\t\tpoints[2*i+6] = new mPoint3(-2*width,i*width,0);\r\n\t\t}\r\n\t\tfor(int i=-1;i<=1;i++){\r\n\t\t\tpoints[2*i+13] = new mPoint3(i*width,2*width,0);\r\n\t\t\tpoints[2*i+14] = new mPoint3(i*width,-2*width,0);\r\n\t\t}\r\n\t\tthis.shape = new mShape();\r\n\t\tshort[][] lp = new short[2][10];\r\n\t\tshort i;\r\n\t\tfor(i=0;i<5;i++){\r\n\t\t\tlp[0][i] = (short)(i*2+1);\r\n\t\t\tlp[1][i] = (short)(2*i+2);\r\n\t\t}\r\n\t\tlp[0][5] = 2;\r\n\t\tlp[1][5] = 10;\r\n\t\tlp[0][9] = 1;\r\n\t\tlp[1][9] = 9;\r\n\t\tfor(i=0;i<3;i++){\r\n\t\t\tlp[0][i+6] = (short)(2*i+11);\r\n\t\t\tlp[1][i+6] = (short)(2*i+12);\r\n\t\t}\r\n\t\tshort[][] tp = new short[1][0];\r\n\t\tthis.shape.set(points,lp,tp);\r\n\t}", "public void initGrid()\n {\n\tfor (int y=0; y<cases.length; y++)\n \t{\n for (int x=0; x<cases[y].length; x++)\n {\n\t\tcases[y][x] = new Case();\n }\n\t}\n\t\n\tint pos_y_case1 = customRandom(4);\n\tint pos_x_case1 = customRandom(4);\n\t\n\tint pos_y_case2 = customRandom(4);\n\tint pos_x_case2 = customRandom(4);\n\t\t\n\twhile ((pos_y_case1 == pos_y_case2) && (pos_x_case1 == pos_x_case2))\n\t{\n pos_y_case2 = customRandom(4);\n pos_x_case2 = customRandom(4);\n\t}\n\t\t\n\tcases[pos_y_case1][pos_x_case1] = new Case(true);\n\tcases[pos_y_case2][pos_x_case2] = new Case(true);\n }", "public IntHashGrid() {\n this(0.0018); // About 200m\n }", "public PantallaVictoria()\n { \n // Create a new world with 600x400 cells with a cell size of 1x1 pixels.\n super(400, 600, 1); \n prepare();\n }", "public Board() {\n\t\tintializeBoard(_RowCountDefault, _ColumnCountDefault, _CountToWinDefault);\n\t}", "public ZonaFasciculataCells() {\r\n\r\n\t}", "private void initialise() {\r\n\t\tfor(int i = 0; i < board.getWidth(); i++) {\r\n\t\t\tfor(int j = 0; j < board.getHeight(); j++) {\r\n\t\t\t\tboard.setSquare(new GridSquare(GridSquare.Type.EMPTY), i, j);\t\r\n\t\t\t}\r\n\t\t}\r\n\t}", "@Override\n\tpublic void init() {\n\t\t\n\t\t// Set your level dimensions.\n\t\t// Note that rows and columns cannot exceed a size of 16\n\t\tsetDimensions(4, 4);\n\t\t\n\t\t// Select your board type\n\t\tsetBoardType(BoardType.CHECKER_BOARD);\n\n\t\t// Select your grid colors.\n\t\t// You need to specify two colors for checker boards\n\t\tList<Color> colors = new ArrayList<Color>();\n\t\tcolors.add(new Color(255, 173, 179, 250)); // stale blue\n\t\tcolors.add(new Color(255, 255, 255, 255)); // white\n\t\tsetColors(colors);\n\t\t\n\t\t// Specify the level's rules\n\t\taddGameRule(new DemoGameRule());\n\t\t\n\t\t// Retrieve player IDs\n\t\tList<String> playerIds = getContext().getGame().getPlayerIds();\n\t\tString p1 = playerIds.get(0);\n\t\tString p2 = playerIds.get(1);\n\n\t\t// Add your entities to the level's universe\n\t\t// using addEntity(GameEntity) method\n\t\taddEntity(new Pawn(this, p1, EntityType.BLACK_PAWN, new Point(0, 0)));\n\t\taddEntity(new Pawn(this, p2, EntityType.WHITE_PAWN, new Point(3, 3)));\n\t}", "private Environment(int rows, int columns)\r\n\t{\r\n\t\tthis.rows = rows;\r\n\t\tthis.columns = columns;\r\n\t\tcells = new Cell[rows][columns];\r\n\t\tfor (int i = 0; i < rows; i++)\r\n\t\t\tfor (int j = 0; j < columns; j++)\r\n\t\t\t\tcells[i][j] = new Cell();\r\n\t}", "public RobotWorld()\n { \n // Create a new world with 600x400 cells with a cell size of 1x1 pixels.\n super(800, 600, 1); \n prepare();\n }", "public Cell(int col, int row){ // constructor\n this.col = col;\n this.row = row;\n }", "public static void initialize()\n {\n\n for(int i = 0; i < cellViewList.size(); i++)\n cellList.add(new Cell(cellViewList.get(i).getId()));\n for (int i = 76; i < 92; i++)\n {\n if (i < 80)\n {\n cellList.get(i).setChess(PlayerController.getPlayer(0).getChess(i-76));\n }\n else if (i < 84)\n {\n cellList.get(i).setChess(PlayerController.getPlayer(1).getChess(i-80));\n }\n else if (i < 88)\n {\n cellList.get(i).setChess(PlayerController.getPlayer(2).getChess(i-84));\n }\n else\n {\n cellList.get(i).setChess(PlayerController.getPlayer(3).getChess(i-88));\n }\n }\n }", "public Game(TileGrid grid) {\n this.grid = grid;\n\n waveManager = new WaveManager(\n new Enemy(quickLoad(\"Ufo\"), grid.getTile(2, 9), grid, TILE_SIZE, TILE_SIZE, 70, 25), 2, 10);\n player = new Player(grid, waveManager);\n player.setup();\n setupUI();\n\n }", "public CoverageListGrid() {\n\t\tListGridField idField = new ListGridField(\"identifier\", \"ID\");\n\t\t//ListGridField titleField = new ListGridField(\"title\", \"Title\");\n\t\tListGridField abstractField = new ListGridField(\"abstract\", \"Abstract\");\n\t\tthis.setFields(idField, abstractField);\n\t\tthis.setWrapCells(true);\n\t}", "public StatsBoard() {\n initComponents();\n }", "public MipsNanogrid()\n\t{\n\t\trows = new ArrayList<MipsNanogridrow>();\n\t}", "public void initializeGrid(SquareListener sl) {\n this.sl = sl;\n setSquares();\n }", "void initLayout() {\n\t\t/* Randomize the number of rows and columns */\n\t\tNUM = Helper.randomizeNumRowsCols();\n\n\t\t/* Remove all the children of the gridContainer. It will be added again */\n\t\tpiecesGrid.removeAllViews();\n\t\t\n\t\t/* Dynamically calculate the screen positions and sizes of the individual pieces\n\t * Store the starting (x,y) of all the pieces in pieceViewLocations */\n\t\tpieceViewLocations = InitDisplay.initialize(getScreenDimensions(), getRootLayoutPadding());\n\t\t\n\t\t/* Create an array of ImageViews to store the individual piece images */\n\t\tcreatePieceViews();\n\t\t\n\t\t/* Add listeners to the ImageViews that were created above */\n\t\taddImageViewListeners();\n\t}", "public Grid(FourInARow fur) {\n System.out.println(\"grid créer\");\n this.grid = new GridPane();\n this.p4 = fur;\n this.matrice = new Matrice(7, 7, this.p4);\n\n// File imgEm = new File(\"./img/tokenE.png\");\n// File imgEmptyD = new File(\"./img/tokenEDark.png\");\n// File imgRed = new File(\"./img/tokenR.png\");\n// File imgRedD = new File(\"./img/tokenRDark.png\");\n// File imgYellow = new File(\"./img/tokenY.png\");\n// File imgYellowD = new File(\"./img/tokenYDark.png\");\n\n this.placerImage();\n this.majAffichage();\n //this.greyColumn(0,false);\n }", "public void initialize() {\r\n upgradeCounter = 0;\r\n upgradeBound = 1;\r\n rectangleSize = 100;\r\n gridSize = 3;\r\n level = 1;\r\n numTargets = 3;\r\n numLives = 3;\r\n numClicked = 0;\r\n rectangles = new ArrayList<>();\r\n columnConstraints = new ColumnConstraints();\r\n rowConstraints = new RowConstraints();\r\n levelText = new SimpleIntegerProperty();\r\n livesText = new SimpleIntegerProperty();\r\n livesText.setValue(numLives);\r\n levelText.setValue(level);\r\n livesLabel.textProperty().bind(livesText.asString());\r\n levelLabel.textProperty().bind(levelText.asString());\r\n }", "public Board()\r\n\t{\r\n\t\tsuper(8, 8);\r\n\t}", "public Cenario1()\n { \n // Create a new world with 600x400 cells with a cell size of 1x1 pixels.\n super(900, 600, 1);\n adicionar();\n \n }", "public Layer() {\n\t\tfor (int i = 0; i < 16; i++) {\n\t\t\tfor (int j = 0; j < 16; j++) {\n\t\t\t\tgrid[i][j] = false;\n\t\t\t}\n\t\t}\n\t}", "public Grid(Case[][] c)\n {\n\theight = c.length;\n\twidth = c[c.length].length;\n\tcases = c;\n }" ]
[ "0.84232336", "0.83276314", "0.78901803", "0.78308046", "0.775872", "0.775556", "0.77416736", "0.7711065", "0.75817645", "0.75327176", "0.75220895", "0.7440522", "0.7419865", "0.7367029", "0.73660815", "0.7329189", "0.7320923", "0.7285254", "0.725243", "0.72239435", "0.7159085", "0.71462166", "0.7111689", "0.7107693", "0.7046572", "0.7026135", "0.699036", "0.69862247", "0.69821596", "0.69682944", "0.6965253", "0.69641227", "0.69414175", "0.69399893", "0.6934584", "0.6924784", "0.6906241", "0.69057894", "0.68931705", "0.6884119", "0.68687695", "0.6858299", "0.68483806", "0.6844128", "0.68431014", "0.6839898", "0.68312746", "0.68302274", "0.68147475", "0.6813132", "0.6807944", "0.6805498", "0.67981756", "0.67588794", "0.6752049", "0.67386806", "0.6734176", "0.6728314", "0.67279387", "0.67117286", "0.67114747", "0.67100835", "0.6669967", "0.6668881", "0.66665727", "0.6664754", "0.66640604", "0.66466343", "0.6645163", "0.66441643", "0.6626449", "0.661353", "0.66069734", "0.66040635", "0.6593305", "0.65928704", "0.6578953", "0.65781134", "0.65683234", "0.6529922", "0.65200174", "0.65162575", "0.65001065", "0.6499472", "0.649881", "0.6498548", "0.6476146", "0.64688885", "0.64676887", "0.64654016", "0.6463156", "0.64570343", "0.64523405", "0.6448981", "0.64485043", "0.6439885", "0.643613", "0.64353484", "0.64329386", "0.64327216" ]
0.7216967
20
Open new window of appropriate size with panel to paint on the grid.
public static void displayGrid(int[][] grid){ // JFrame to open a new window. JFrame frame = new JFrame(); frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); final int FRAME_WIDTH = offset + width * (grid[0].length + 1); final int FRAME_HEIGHT = offset + width * (grid.length+2); Grid panel = new Grid(grid); //creates a window of appropriate (variable) size. frame.setSize(FRAME_WIDTH,FRAME_HEIGHT); frame.add(panel); frame.setVisible(true); // makes the application visible. }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "void go(){\n\t\twindow.setSize(28, 80);\n\t\twindow.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);\n\t\twindow.setVisible(true);\n\t\twindow.setResizable(false);\n\t\twindow.add(new PewGrid());\n\t\t// Adds a listener for mouse related events\n\t\twindow.addMouseListener(new mouseevent());\n\t\twindow.repaint();\n\t\t//move();\n\t}", "private static void createAndShowGUI() {\n\t JFrame frame = new JFrame(\"GridLines\");\n\t frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);\n\n\t GridLinesPanel paintPanel = new GridLinesPanel();\n\t paintPanel.setPreferredSize(new Dimension(500,500));\n\t frame.getContentPane().add(paintPanel,BorderLayout.CENTER);\n\n\t frame.pack();\n\t frame.setVisible(true);\n }", "private void window(Board board){\r\n JFrame frame = new JFrame();\r\n frame.setSize(size, size);\r\n frame.setIconImage(crownImage);\r\n frame.setLocationRelativeTo(null);\r\n frame.pack();\r\n Insets insets = frame.getInsets();\r\n int frameLeftBorder = insets.left;\r\n int frameRightBorder = insets.right;\r\n int frameTopBorder = insets.top;\r\n int frameBottomBorder = insets.bottom;\r\n frame.setPreferredSize(new Dimension(size + frameLeftBorder + frameRightBorder, size + frameBottomBorder + frameTopBorder));\r\n frame.setMaximumSize(new Dimension(size + frameLeftBorder + frameRightBorder, size + frameBottomBorder + frameTopBorder));\r\n frame.setMinimumSize(new Dimension(size + frameLeftBorder + frameRightBorder, size + frameBottomBorder + frameTopBorder));\r\n frame.setLocationRelativeTo(null);\r\n frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);\r\n frame.addMouseListener(this);\r\n frame.requestFocus();\r\n frame.setVisible(true);\r\n frame.add(board);\r\n }", "public void makeWindow(Container pane)\r\n\t{\r\n\t\tboard.display(pane, fieldArray);\r\n\t}", "private void buildWindow(){\r\n\t\tthis.setSize(new Dimension(600, 400));\r\n\t\tFunctions.setDebug(true);\r\n\t\tbackendConnector = new BackendConnector(this);\r\n\t\tguiManager = new GUIManager(this);\r\n\t\tmainCanvas = new MainCanvas(this);\r\n\t\tadd(mainCanvas);\r\n\t}", "private static void setupWindow() {\n window.setSize((2 * WINDOW_MARGINS) + (CELL_SIZE * SIZE_X), (2 * WINDOW_MARGINS) + (CELL_SIZE * SIZE_Y));\n window.add(canvas);\n window.setVisible(true);\n window.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);\n\n canvas.createBufferStrategy(2);\n }", "@Override\n public void componentResized(ComponentEvent e) {\n window.setShape(new Ellipse2D.Double(0, 0, window.getWidth(), window.getHeight()));\n window.add(panel);\n window.setLocation((screenSize.width - window.getSize().width) / 2, (screenSize.height - window.getSize().height) / 2);\n window.setVisible(true);\n }", "private void createWindow() {\r\n\t\t// Create the picture frame and initializes it.\r\n\t\tthis.createAndInitPictureFrame();\r\n\r\n\t\t// Set up the menu bar.\r\n\t\tthis.setUpMenuBar();\r\n\r\n\t\t// Create the information panel.\r\n\t\t//this.createInfoPanel();\r\n\r\n\t\t// Create the scrollpane for the picture.\r\n\t\tthis.createAndInitScrollingImage();\r\n\r\n\t\t// Show the picture in the frame at the size it needs to be.\r\n\t\tthis.pictureFrame.pack();\r\n\t\tthis.pictureFrame.setVisible(true);\r\n\t\tpictureFrame.setSize(728,560);\r\n\t}", "public BoardPanel() {\n\t\t\tfinal Dimension size = new Dimension(600, 600);\n\t\t\tsetSize(size);\n\t\t\tsetPreferredSize(size);\n\t\t\t\n\t\t\taddMouseListener(new ClickHandler());\n\t\t}", "private void createAndShowGUI()\r\n {\r\n //Create and set up the window.\r\n frame = new JFrame();\r\n frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);\r\n frame.getContentPane().add(this);\r\n frame.addKeyListener(this);\r\n\r\n //Display the window.\r\n this.setPreferredSize(new Dimension(\r\n BLOCKSIZE * ( board.getNumCols() + 3 + nextUp.getNumCols() ),\r\n BLOCKSIZE * ( board.getNumRows() + 2 )\r\n ));\r\n\r\n frame.pack();\r\n frame.setVisible(true);\r\n }", "private static void createAndShowGUI() {\r\n JFrame.setDefaultLookAndFeelDecorated(true);\r\n\r\n frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);\r\n frame.setLayout(new BorderLayout());\r\n\r\n JPanel parametersPanel = new JPanel();\r\n parametersPanel.setPreferredSize(new Dimension(preferredWidth, 50));\r\n \r\n addComponentsToPane(parametersPanel);\r\n \r\n frame.add(parametersPanel, BorderLayout.PAGE_START);\r\n \r\n schedulePanel.add(monLabel);\r\n schedulePanel.add(tueLabel);\r\n schedulePanel.add(wedLabel);\r\n schedulePanel.add(thuLabel);\r\n schedulePanel.add(friLabel);\r\n schedulePanel.setPreferredSize(new Dimension(preferredWidth, 500));\r\n JScrollPane scrollPane = new JScrollPane();\r\n scrollPane.setViewportView(schedulePanel);\r\n JPanel bigPanel = new JPanel(); \r\n bigPanel.setLayout(new BorderLayout());\r\n bigPanel.setPreferredSize(schedulePanel.getPreferredSize());\r\n bigPanel.add(scrollPane, BorderLayout.CENTER);\r\n frame.add(bigPanel, BorderLayout.CENTER);\r\n\r\n frame.setJMenuBar(createMenu());\r\n \r\n frame.pack();\r\n frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);\r\n \r\n frame.setVisible(true);\r\n frame.setResizable(false);\r\n }", "void buildWindow()\n { main.gui.gralMng.selectPanel(\"primaryWindow\");\n main.gui.gralMng.setPosition(-30, 0, -47, 0, 'r'); //right buttom, about half less display width and hight.\n int windProps = GralWindow.windConcurrently;\n GralWindow window = main.gui.gralMng.createWindow(\"windStatus\", \"Status - The.file.Commander\", windProps);\n windStatus = window; \n main.gui.gralMng.setPosition(3.5f, GralPos.size -3, 1, GralPos.size +5, 'd');\n widgCopy = main.gui.gralMng.addButton(\"sCopy\", main.copyCmd.actionConfirmCopy, \"copy\");\n widgEsc = main.gui.gralMng.addButton(\"dirBytes\", actionButton, \"esc\");\n }", "void createWindow();", "public Coup() {\n dim = Toolkit.getDefaultToolkit().getScreenSize();\n jframe = new JFrame(\"Coup\");\n jframe.setVisible(true);\n jframe.setSize(800, 700);\n jframe.setLocation(dim.width / 2 - jframe.getWidth() / 2, dim.width \n / 2 - jframe.getHeight() / 2);\n jframe.add(board = new Board());\n jframe.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);\n }", "public void createGui(){\n\t\twindow = this.getContentPane(); \n\t\twindow.setLayout(new FlowLayout());\n\n\t\t//\tAdd \"panel\" to be used for drawing \n\t\t_panel = new ResizableImagePanel();\n\t\tDimension d= new Dimension(1433,642);\n\t\t_panel.setPreferredSize(d);\t\t \n\t\twindow.add(_panel);\n\n\t\t// A menu-bar contains menus. A menu contains menu-items (or sub-Menu)\n\t\tJMenuBar menuBar; // the menu-bar\n\t\tJMenu menu; // each menu in the menu-bar\n\n\t\tmenuBar = new JMenuBar();\n\t\t// First Menu\n\t\tmenu = new JMenu(\"Menu\");\n\t\tmenu.setMnemonic(KeyEvent.VK_A); // alt short-cut key\n\t\tmenuBar.add(menu); // the menu-bar adds this menu\n\n\t\tmenuItem1 = new JMenuItem(\"Fruit\", KeyEvent.VK_F);\n\t\tmenu.add(menuItem1); // the menu adds this item\n\n\t\tmenuItem2 = new JMenuItem(\"Pacman\", KeyEvent.VK_S);\n\t\tmenu.add(menuItem2); // the menu adds this item\n\t\tmenuItem3 = new JMenuItem(\"Run\");\n\t\tmenu.add(menuItem3); // the menu adds this item \n\t\tmenuItem4 = new JMenuItem(\"Save Game\");\n\t\tmenu.add(menuItem4); // the menu adds this item\n\n\t\tmenuItem5 = new JMenuItem(\"Open Game\");\n\t\tmenu.add(menuItem5); // the menu adds this item\n\t\tmenuItem6 = new JMenuItem(\"Clear Game\");\n\t\tmenu.add(menuItem6); // the menu adds this item\n\t\tmenuItem1.addActionListener(this);\n\t\tmenuItem2.addActionListener(this);\n\t\tmenuItem3.addActionListener(this);\n\t\tmenuItem4.addActionListener(this);\n\t\tmenuItem5.addActionListener(this);\n\t\tmenuItem6.addActionListener(this);\n\n\t\tsetJMenuBar(menuBar); // \"this\" JFrame sets its menu-bar\n\t\t// panel (source) fires the MouseEvent.\n\t\t//\tpanel adds \"this\" object as a MouseEvent listener.\n\t\t_panel.addMouseListener(this);\n\t}", "private JPanel initializePanel() {\n JPanel myPanel = new JPanel();\n //myPanel.setPreferredSize(new Dimension(600,600));\n\n myPanel.setLayout(new GridLayout(8,8));\n myPanel.setSize(600,600);\n myPanel.setLocation(100,100);\n myPanel.setBorder(new LineBorder(Color.BLACK));\n return myPanel;\n }", "public static void createAndShowStartWindow() {\n\n\t\t// Create and set up the window.\n\n\t\tstartMenu.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);\n\n\t\t// panel will hold the buttons and text\n\t\tJPanel panel = new JPanel() {\n\n\t\t\tprivate static final long serialVersionUID = 1L;\n\n\t\t\t// Fills the panel with a red/black gradient\n\t\t\tprotected void paintComponent(Graphics grphcs) {\n\t\t\t\tGraphics2D g2d = (Graphics2D) grphcs;\n\t\t\t\tg2d.setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON);\n\n\t\t\t\tColor color1 = new Color(119, 29, 29);\n\t\t\t\tColor color2 = Color.BLACK;\n\t\t\t\tGradientPaint gp = new GradientPaint(0, 0, color1, 0, getHeight() - 100, color2);\n\t\t\t\tg2d.setPaint(gp);\n\t\t\t\tg2d.fillRect(0, 0, getWidth(), getHeight());\n\n\t\t\t\tsuper.paintComponent(grphcs);\n\t\t\t}\n\t\t};\n\n\t\tpanel.setOpaque(false);\n\n\t\tpanel.setLayout(new BoxLayout(panel, BoxLayout.Y_AXIS));\n\n\t Font customFont = null;\n\t \n\n\t\ttry {\n\t\t customFont = Font.createFont(Font.TRUETYPE_FONT, ClassLoader.getSystemClassLoader().getResourceAsStream(\"data/AlegreyaSC-Medium.ttf\")).deriveFont(32f);\n\n\t\t GraphicsEnvironment ge = GraphicsEnvironment.getLocalGraphicsEnvironment();\n\t\t ge.registerFont(Font.createFont(Font.TRUETYPE_FONT, ClassLoader.getSystemClassLoader().getResourceAsStream(\"data/AlegreyaSC-Medium.ttf\")));\n\t\t\n\n\t\t} catch (IOException|FontFormatException e) {\n\t\t //Handle exception\n\t\t}\n\t\t\n\n\t\t\n\t\t// Some info text at the top of the window\n\t\tJLabel welcome = new JLabel(\"<html><center><font color='white'> Welcome to <br> Ultimate Checkers! </font></html>\",\n\t\t\t\tSwingConstants.CENTER);\n\t\twelcome.setFont(customFont);\n\t\n\n\t\twelcome.setPreferredSize(new Dimension(200, 25));\n\t\twelcome.setAlignmentX(Component.CENTER_ALIGNMENT);\n\n\n\t\t// \"Rigid Area\" is used to align everything\n\t\tpanel.add(Box.createRigidArea(new Dimension(0, 40)));\n\t\tpanel.add(welcome);\n\t\tpanel.add(Box.createRigidArea(new Dimension(0, 50)));\n\t\t//panel.add(choose);\n\t\tpanel.add(Box.createRigidArea(new Dimension(0, 20)));\n\n\t\t// The start Window will have four buttons\n\t\t// Button1 will open a new window with a standard checkers board\n\t\tJButton button1 = new JButton(\"New Game (Standard Setup)\");\n\n\t\tbutton1.addActionListener(new ActionListener() {\n\n\t\t\tpublic void actionPerformed(ActionEvent e) {\n\t\t\t\tjavax.swing.SwingUtilities.invokeLater(new Runnable() {\n\t\t\t\t\tpublic void run() {\n\n\t\t\t\t\t\tNewGameSettings.createAndShowGameSettings();\n\t\t\t\t\t\tstartMenu.dispose();\n\t\t\t\t\t}\n\t\t\t\t});\n\t\t\t}\n\n\t\t});\n\t\t// Setting up button1\n\t\tbutton1.setAlignmentX(Component.CENTER_ALIGNMENT);\n\t\tbutton1.setMaximumSize(new Dimension(250, 40));\n\n\t\t// Button2 will open a new window where a custom setup can be created\n\t\tJButton button2 = new JButton(\"New Game (Custom Setup)\");\n\t\tbutton2.addActionListener(new ActionListener() {\n\n\t\t\tpublic void actionPerformed(ActionEvent e) {\n\t\t\t\tjavax.swing.SwingUtilities.invokeLater(new Runnable() {\n\t\t\t\t\tpublic void run() {\n\t\t\t\t\t\t// Begin creating custom game board setup for checkers\n\t\t\t\t\t\tNewCustomWindow.createAndShowCustomGame();\n\t\t\t\t\t\t// Close the start menu window and remove it from memory\n\t\t\t\t\t\tstartMenu.dispose();\n\t\t\t\t\t}\n\t\t\t\t});\n\t\t\t}\n\n\t\t});\n\n\t\t// Setting up button2\n\t\tbutton2.setAlignmentX(Component.CENTER_ALIGNMENT);\n\t\tbutton2.setMaximumSize(new Dimension(250, 40));\n\n\t\t// Button3 is not implemented yet, it will be used to load a saved game\n\t\tJButton button3 = new JButton(\"Load A Saved Game\");\n\t\tbutton3.setAlignmentX(Component.CENTER_ALIGNMENT);\n\t\tbutton3.setMaximumSize(new Dimension(250, 40));\n\t\tbutton3.addActionListener(new ActionListener() {\n\n\t\t\tfinal JFrame popupWrongFormat = new PopupFrame(\n\t\t\t\t\t\"Wrong Format!\",\n\t\t\t\t\t\"<html><center>\"\n\t\t\t\t\t\t\t+ \"The save file is in the wrong format! <br><br>\"\n\t\t\t\t\t\t\t+ \"Please make sure the load file is in csv format with an 8x8 table, \"\n\t\t\t\t\t\t\t+ \"followed by whose turn it is, \"\n\t\t\t\t\t\t\t+ \"the white player type and the black player type.\"\n\t\t\t\t\t\t\t+ \"</center></html>\");\n\n\t\t\tpublic void actionPerformed(ActionEvent e) {\n\t\t\t\tjavax.swing.SwingUtilities.invokeLater(new Runnable() {\n\t\t\t\t\tpublic void run() {\n\t\t\t\t\t\t// This will create the file chooser\n\t\t\t\t\t\tJFileChooser chooser = new JFileChooser();\n\n\t\t\t\t\t\tFileNameExtensionFilter filter = new FileNameExtensionFilter(\"CSV Files\", \"csv\");\n\t\t\t\t\t\tchooser.setFileFilter(filter);\n\n\t\t\t\t\t\tint returnVal = chooser.showOpenDialog(startMenu);\n\t\t\t\t\t\tif (returnVal == JFileChooser.APPROVE_OPTION) {\n\t\t\t\t\t\t\tFile file = chooser.getSelectedFile();\n\n\t\t\t\t\t\t\ttry {\n\t\t\t\t\t\t\t\tcheckAndPlay(file);\n\t\t\t\t\t\t\t} catch (Exception e) {\n\t\t\t\t\t\t\t\tpopupWrongFormat.setVisible(true);\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t// Do nothing. Load cancelled by user.\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t});\n\t\t\t}\n\n\t\t});\n\n\t\t// Button4 closes the game\n\t\tJButton button4 = new JButton(\"Exit Ultimate Checkers\");\n\t\tbutton4.addActionListener(new ActionListener() {\n\n\t\t\tpublic void actionPerformed(ActionEvent e) {\n\t\t\t\tjavax.swing.SwingUtilities.invokeLater(new Runnable() {\n\t\t\t\t\tpublic void run() {\n\t\t\t\t\t\t// Close the start menu window and remove it from memory\n\t\t\t\t\t\tstartMenu.dispose();\n\t\t\t\t\t}\n\t\t\t\t});\n\t\t\t}\n\n\t\t});\n\n\t\t// Setting up button4\n\t\tbutton4.setAlignmentX(Component.CENTER_ALIGNMENT);\n\t\tbutton4.setMaximumSize(new Dimension(250, 40));\n\n\t\t// The four buttons are added to the panel and aligned\n\t\tpanel.add(button1);\n\t\tpanel.add(Box.createRigidArea(new Dimension(0, 20)));\n\t\tpanel.add(button2);\n\t\tpanel.add(Box.createRigidArea(new Dimension(0, 20)));\n\t\tpanel.add(button3);\n\t\tpanel.add(Box.createRigidArea(new Dimension(0, 80)));\n\t\tpanel.add(button4);\n\n\t\t// Setting up the start Menu\n\t\tstartMenu.setSize(400, 600);\n\t\tstartMenu.setResizable(false);\n\n\t\t// Centers the window with respect to the user's screen resolution\n\t\tDimension dimension = Toolkit.getDefaultToolkit().getScreenSize();\n\t\tint x = (int) ((dimension.getWidth() - startMenu.getWidth()) / 2);\n\t\tint y = (int) ((dimension.getHeight() - startMenu.getHeight()) / 2);\n\t\tstartMenu.setLocation(x, y);\n\n\t\tstartMenu.add(panel, BorderLayout.CENTER);\n\t\tstartMenu.setVisible(true);\n\n\t}", "private void setup() {\n this.jpanel = new JPanel(new BorderLayout());\n this.jframe = new JFrame(\"Minesweeper\");\n this.jframe.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);\n this.jframe.setSize(sizeX * LENGTH + 18, (sizeY + 1) * LENGTH + 43);\n\n this.jframe.setVisible(true);\n this.jpanel.addMouseListener(this);\n this.jpanel.setSize(sizeX * LENGTH, (sizeY + 1) * LENGTH);\n this.jframe.add(this.jpanel);\n\n this.g = jpanel.getGraphics();\n }", "public SameGnomeFrame() {\n\t\tsetSize(DEFUALT_WIDTH,DEFUALT_WIDTH);\n\t\tintializeGridBall();\n\t\tgrid = new GridComponent(gridBall);\n\t\tadd(grid);\n\t\t\n\t}", "private void setPanel()\r\n\t{\r\n\t\tpanel = new JPanel();\r\n\t\tpanel.setLayout(new GridLayout(5, 2));\r\n\t\t\r\n\t\tpanel.add(bubbleL);\r\n\t\tpanel.add(bubblePB);\r\n\t\t\r\n\t\tpanel.add(insertionL);\r\n\t\tpanel.add(insertionPB);\r\n\t\t\r\n\t\tpanel.add(mergeL);\r\n\t\tpanel.add(mergePB);\r\n\t\t\r\n\t\tpanel.add(quickL);\r\n\t\tpanel.add(quickPB);\r\n\t\t\r\n\t\tpanel.add(radixL);\r\n\t\tpanel.add(radixPB);\r\n\t}", "private void configureWindow() {\n\tsetDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);\n background.setBackground(Color.BLACK);\n setSize(initialWindowWidth, initialWindowHeight);\n setVisible(true);\n }", "private void setUpPanel() { \n this.setPreferredSize(new Dimension(myWidth, myHeight)); \n // Set this panel as a grid panel with 1 column, 6 rows. \n this.setLayout(new GridLayout(NUM_ROWS, 1)); \n // Create the next piece panel.\n this.myNextPiece = new TetrisNextPiecePanel();\n this.add(myNextPiece); \n // Add another panel which will show game instruction.\n final HowToPlayPanel instructionsPanel = new HowToPlayPanel();\n this.add(instructionsPanel);\n // add the last panel which will show the scores, level, game state etc.\n this.setUpLastPanel();\n }", "public static void createAndShowGUI() {\n windowContent.add(\"Center\",p1);\n\n //Create the frame and set its content pane\n JFrame frame = new JFrame(\"GridBagLayoutCalculator\");\n frame.setContentPane(windowContent);\n\n // Set the size of the window to be big enough to accommodate all controls\n frame.pack();\n\n // Display the window\n frame.setVisible(true);\n frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);\n }", "private void zeichneWindow(int ypos,int xpos, int size)\r\n {\r\n ypos = ypos + size/6;\r\n xpos = xpos + size/6;\r\n size = size/4;\r\n zeichneWand(\"blau\",ypos,xpos,size); \r\n }", "private void makeWindow( boolean amFormer ) {\n myTurn[0] = amFormer;\n myMark = ( amFormer ) ? \"O\" : \"X\"; // 1st person uses \"O\"\n yourMark = ( amFormer ) ? \"X\" : \"O\"; // 2nd person uses \"X\"\n\n // create a window\n window = new JFrame(\"OnlineTicTacToe(\" +\n ((amFormer) ? \"former)\" : \"latter)\" ) + myMark );\n window.setSize(300, 300);\n window.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);\n window.setLayout(new GridLayout(3, 3));\n\n\t// initialize all nine cells.\n for (int i = 0; i < NBUTTONS; i++) {\n button[i] = new JButton();\n window.add(button[i]);\n button[i].addActionListener(this);\n }\n\n\t// make it visible\n window.setVisible(true);\n }", "public Window(Game g) {\n myGame = g; //initialize game object\n g.startGame2(); //game starting functions\n setSize(616, 740); //size of jframe\n setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);\n setTitle(\"Monopoly!!!\");\n \n this.setLayout(new GridBagLayout());\n GridBagConstraints c = new GridBagConstraints();\n\n c.insets=new Insets(6,6,6,6); //padding\n\n //Board panel\n\n //import board image\n board = new JPanel() {\n @Override //rewrite default paintComponent method\n protected void paintComponent(Graphics g) {\n super.paintComponent(g);\n try {\n String imgPath = new File(\"\").getAbsolutePath();\n imgPath = imgPath + \"\\\\lib\\\\src\\\\main\\\\java\\\\com\\\\example\\\\lib\\\\monopoly.png\"; //get absolute path of board image\n final BufferedImage image = ImageIO.read(new File(imgPath));\n g.drawImage(drawBoard(image), 0, 0, null);\n } catch (IOException e){\n System.out.println(e.getMessage());\n }\n }\n };\n board.setBorder(BorderFactory.createLineBorder(Color.black)); //create borders\n c.gridx = 0;\n c.gridy = 0;\n c.gridwidth=4;\n c.fill=GridBagConstraints.BOTH;\n c.weightx=1;\n c.weighty=9.5;\n\n this.add(board, c);\n\n //Game info label\n dialog = new JLabel(\"Welcome to Monopoly. Type answers below. Scroll if text cuts off.\");\n dialogContainer = new JScrollPane(dialog);\n dialogContainer.getVerticalScrollBar().setPreferredSize (new Dimension(0,0));\n dialogContainer.getHorizontalScrollBar().setPreferredSize (new Dimension(0,0));\n dialogContainer.getVerticalScrollBar().setMinimumSize(new Dimension(0, 0));\n dialogContainer.getVerticalScrollBar().setMinimumSize(new Dimension(0, 0));\n dialogContainer.getVerticalScrollBar().setMaximumSize(new Dimension(0, 0));\n dialogContainer.getVerticalScrollBar().setMaximumSize(new Dimension(0, 0));\n dialogContainer.setBorder(BorderFactory.createLineBorder(Color.black));\n\n c.gridx=0;\n c.gridy=1;\n c.weightx=1;\n c.weighty=.025;\n\n this.add(dialogContainer,c);\n\n //Text input field\n\n txtIn=new JTextField();\n txtIn.setText(\"Type commands here. Click enter if no commands are prompted\");\n JScrollPane pane=new JScrollPane(txtIn);\n\n c.gridx=0;\n c.gridy=2;\n c.weightx=.9;\n c.gridwidth=3;\n c.weighty=.025;\n\n add(pane,c);\n\n //Enter Button\n\n JButton button=new JButton(\"Enter\");\n button.addActionListener(this);\n\n c.gridx=3;\n c.gridy=2;\n c.gridwidth=1;\n c.weightx=.1;\n c.weighty=.025;\n c.fill=GridBagConstraints.NONE;\n\n add(button,c);\n }", "void goToWhiteboardSelect(){\n CollaboardGUI.this.setSize(500,500);\n CardLayout layout = (CardLayout) panels.getLayout();\n layout.show(panels, \"whiteboard\");\n }", "public void launch() {\r\n\t\tthis.setLocation(200, 200);\r\n\t\tthis.setSize(COLS * BLOCK_SIZE, ROWS * BLOCK_SIZE);\r\n\t\tthis.addKeyListener(new KeyMonitor());\r\n\t\tthis.addWindowListener(new WindowAdapter() {\r\n\t\t\t@Override\r\n\t\t\tpublic void windowClosing(WindowEvent e) {\r\n\t\t\t\tSystem.exit(0);\r\n\t\t\t}\r\n\t\t});\r\n\t\tthis.setVisible(true);\r\n\t\t\r\n\t\tnew Thread(PaintThread).start();\r\n\t\t\r\n\t}", "public void drawGrid() {\r\n\t\tsetLayout(new GridLayout(getSize_w(), getSize_h()));\r\n\t\tfor (int i = 0; i < getSize_h(); i++) {\r\n\t\t\tfor (int j = 0; j < getSize_w(); j++) {\r\n\t\t\t\tcity_squares[i][j] = new Gridpanel(j, i);\r\n\t\t\t\tadd(city_squares[i][j]);\r\n\t\t\t}\r\n\t\t}\r\n\t}", "public void open() {\n popupWindow = new Window(getTypeCaption());\n popupWindow.addStyleName(\"e-export-form-window\");\n popupWindow.addStyleName(\"opaque\");\n VerticalLayout layout = (VerticalLayout) popupWindow.getContent();\n layout.setMargin(true);\n layout.setSpacing(true);\n layout.setSizeUndefined();\n popupWindow.setSizeUndefined();\n popupWindow.setModal(false);\n popupWindow.setClosable(true);\n\n popupWindow.addComponent(this);\n getMainApplication().getMainWindow().addWindow(popupWindow);\n\n onDisplay();\n }", "public NewJFrame() {\n initComponents();\n \n \n //combo box\n comboCompet.addItem(\"Séléction officielle\");\n comboCompet.addItem(\"Un certain regard\");\n comboCompet.addItem(\"Cannes Courts métrages\");\n comboCompet.addItem(\"Hors compétitions\");\n comboCompet.addItem(\"Cannes Classics\");\n \n \n //redimension\n this.setResizable(false);\n \n planning = new Planning();\n \n \n }", "public void show(){\n frame.setContentPane(mainPanel); //puts all our buttons and other objects on the window\n frame.setSize(700, 500);\n frame.setLocationRelativeTo(null); //opens our window in the center of the screen\n frame.setResizable(false);\n frame.setVisible(true); //displays the window\n }", "void doNew() {\r\n\t\t\r\n\t\tNewResizeDialog dlg = new NewResizeDialog(labels, true);\r\n\t\tdlg.setLocationRelativeTo(this);\r\n\t\tdlg.setVisible(true);\r\n\t\tif (dlg.success) {\r\n\t\t\tsetTitle(TITLE);\r\n\t\t\tcreatePlanetSurface(dlg.width, dlg.height);\r\n\t\t\trenderer.repaint();\r\n\t\t\tsaveSettings = null;\r\n\t\t\tundoManager.discardAllEdits();\r\n\t\t\tsetUndoRedoMenu();\r\n\t\t}\r\n\t}", "protected void CreateWindow(){\n\t\tdouble[] colWeight = {1,1,1,1,1,1};\n\t\tdouble[] rowWeight = {5,1,1,1,1};\n\t\tint[] colWidth = {1,1,1,1,1,1};\n\t\tint[] rowHeight = {5,1,1,1,1};\n\t\t\n\t\t//creates new GridBagLayout and the Constraints for it\n\t\tGridBagLayout normal = new GridBagLayout();\n\t\t\n\t\tGridBagConstraints constrain = new GridBagConstraints();\n\t\t\n\t\tnormal.rowHeights = rowHeight;\n\t\tnormal.columnWidths = colWidth;\n\t\tnormal.columnWeights = colWeight;\n\t\tnormal.rowWeights = rowWeight;\n\t\t\n\t\tsetBounds(100,100,400,600);\n\t\tsetLayout(normal);\n\t\t\n\t\t//create messagefield. set the Grid Layout for it.\n\t\tchatDisplay.messageField.setSize(300, 500);\n\t\tconstrain.weightx = 1;\n\t\tconstrain.weighty = 1;\n\t\tconstrain.gridwidth = 5;\n\t\tconstrain.gridheight = 18;\n\t\tconstrain.fill = 1;\n\t\tconstrain.gridx = 0;\n\t\tconstrain.gridy = 0;\n\t\tnormal.setConstraints(chatDisplay.messageField, constrain);\n\t\t\n\t\t//create input. set the Grid Layout for it.\n\t\tthis.input.setSize(450, 20);\n\t\tconstrain.weightx = 1;\n\t\tconstrain.weighty = 1;\n\t\tconstrain.gridwidth = 4;\n\t\tconstrain.gridheight = 2;\n\t\tconstrain.fill = 1;\n\t\tconstrain.gridx = 0;\n\t\tconstrain.gridy = 18;\n\t\tnormal.setConstraints(this.input, constrain);\n\t\t\n\t\t//create send button. set the Grid Layout for it.\n\t\tthis.send.setSize(50, 5);\n\t\tconstrain.weightx = 1;\n\t\tconstrain.weighty = 1;\n\t\tconstrain.gridwidth = 1;\n\t\tconstrain.gridheight = 1;\n\t\tconstrain.fill = 1;\n\t\tconstrain.gridx = 4;\n\t\tconstrain.gridy = 18;\n\t\tnormal.setConstraints(this.send, constrain);\n\t\t\n\t\tthis.quit.setSize(50, 5);\n\t\tconstrain.weightx = 1;\n\t\tconstrain.weighty = 1;\n\t\tconstrain.gridwidth = 1;\n\t\tconstrain.gridheight = 1;\n\t\tconstrain.fill = 1;\n\t\tconstrain.gridx = 4;\n\t\tconstrain.gridy = 19;\n\t\tnormal.setConstraints(this.quit, constrain);\n\t\t\n\t\tthis.server.setSize(50, 5);\n\t\tconstrain.weightx = 1;\n\t\tconstrain.weighty = 1;\n\t\tconstrain.gridwidth = 1;\n\t\tconstrain.gridheight = 1;\n\t\tconstrain.fill = 1;\n\t\tconstrain.gridx = 4;\n\t\tconstrain.gridy = 20;\n\t\tnormal.setConstraints(this.server, constrain);\n\t\t\n\t\tthis.client.setSize(50, 5);\n\t\tconstrain.weightx = 1;\n\t\tconstrain.weighty = 1;\n\t\tconstrain.gridwidth = 1;\n\t\tconstrain.gridheight = 1;\n\t\tconstrain.fill = 1;\n\t\tconstrain.gridx = 4;\n\t\tconstrain.gridy = 21;\n\t\tnormal.setConstraints(this.client, constrain);\n\t\t\n\t\t//add the fields...\n\t\tadd(this.input);\n\t\tadd(chatDisplay.messageField);\n\t\tadd(this.send);\n\t\tadd(this.quit);\n\t\tadd(this.server);\n\t\tadd(this.client);\n\t\t\n\t\t//set windowlistener and set the window resizability to true\n\t\taddWindowListener(this);\n\t\tsetResizable(true);\n\t\t\n\t\t//adds action listeners for use later on.\n\t\tinput.addActionListener(this);\n\t\tsend.addActionListener(this);\n\t\tquit.addActionListener(this);\n\t\tserver.addActionListener(this);\n\t\tclient.addActionListener(this);\n\t\t\n\t\tthis.setVisible(true);\n\t\t\n\t\trun();\n\t}", "public void newWindow() {\n\t\tJMenuTest frame1 = new JMenuTest();\n\t\tframe1.setBounds(100, 100, 400, 400);\n\t\tframe1.setVisible(true);\n\t}", "public void createWindow(int x, int y, int width, int height, int bgColor, String title, int n) {\r\n\t\tWindow winnie = new Window(x, y, width, height, bgColor, title);\r\n\t\twinnie.type = n;\r\n\t\twindows.add(winnie);\r\n\t}", "public static void createAndShowGui() {\n updateShapes();\n initialiseShapeTurtleLinden();\n Painting painting = new Painting();\n ButtonsController buttonsController = new ButtonsController(painting);\n Buttons buttonPanel = new Buttons(buttonsController);\n buttonsController.turtleInit(turtle, linSys);\n\n JPanel mainPanel = new JPanel(false);\n mainPanel.add(painting);\n mainPanel.add(buttonPanel, BorderLayout.SOUTH);\n\n\n ProdPainter prodPaint = new ProdPainter();\n ProductionsController productionsController = new ProductionsController(shape, prodPaint);\n Productions productions = new Productions(productionsController);\n JPanel productionsTab = new JPanel(false);\n productionsTab.add(productions);\n productionsTab.add(prodPaint);\n\n SettingsController settingsController = new SettingsController(turtle, linSys, shape,\n buttonsController, productionsController);\n settingsController.init();\n Settings settings = new Settings(settingsController);\n JPanel settingsTab = new JPanel(false);\n settingsTab.add(settings);\n\n\n JTabbedPane tabs = new JTabbedPane();\n tabs.addTab(\"Drawing\", mainPanel);\n tabs.addTab(\"Productions\", productionsTab);\n tabs.addTab(\"Settings\", settingsTab);\n\n\n JFrame frame = new JFrame();\n frame.setSize(frameWidth, frameHeight + 120);\n setDefaultLookAndFeelDecorated(true);\n frame.add(tabs);\n frame.setLocationRelativeTo(null);\n frame.setVisible(true);\n\n frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);\n }", "public static void main(String args[]) {\n int sizeX;\n int sizeY;\n\n // show change size window to set initial size\n CSizePanel csizePanel = new CSizePanel(new Dimension(\n LayoutPanel.defXCells, LayoutPanel.defYCells), true);\n while (true) {\n int result = JOptionPane.showConfirmDialog(null, csizePanel,\n \"Set initial size\", JOptionPane.OK_CANCEL_OPTION);\n if (result == JOptionPane.OK_OPTION) { // Afirmative\n try {\n sizeX = Integer\n .parseInt(csizePanel.tfields[CSizePanel.idxX]\n .getText());\n sizeY = Integer\n .parseInt(csizePanel.tfields[CSizePanel.idxY]\n .getText());\n if (sizeX >= LayoutPanel.minXCells\n && sizeX <= LayoutPanel.maxXCells\n && sizeY >= LayoutPanel.minYCells\n && sizeY <= LayoutPanel.maxYCells) {\n break;\n } else {\n JOptionPane.showMessageDialog(null,\n \"Size x must be between \"\n + LayoutPanel.minXCells + \" and \"\n + LayoutPanel.maxXCells\n + \", or size y must be between \"\n + LayoutPanel.minYCells + \" and \"\n + LayoutPanel.maxYCells + \".\");\n }\n } catch (NumberFormatException e) {\n JOptionPane.showMessageDialog(null, \"Invalid number.\");\n }\n } else { // cancel - exit the program\n System.exit(0);\n }\n }\n\n // create a control window\n ControlFrame frame = new ControlFrame(\"Growth Simulation Layout Editor\");\n frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);\n frame.init(sizeX, sizeY);\n frame.setLocationRelativeTo(null);\n frame.setVisible(true);\n }", "private void setGrid() {\r\n maxRows = (FORM_HEIGHT - FORM_HEIGHT_ADJUST) / SQUARE_SIZE;\r\n maxColumns = (FORM_WIDTH - FORM_WIDTH_ADJUST) / SQUARE_SIZE; \r\n grid = new JLabel[maxRows][maxColumns];\r\n int y = (FORM_HEIGHT - (maxRows * SQUARE_SIZE)) / 2;\r\n for (int row = 0; row < maxRows; row++) {\r\n int x = (FORM_WIDTH - (maxColumns * SQUARE_SIZE)) / 2;\r\n for (int column = 0; column < maxColumns; column++) {\r\n createSquare(x,y,row,column);\r\n x += SQUARE_SIZE;\r\n }\r\n y += SQUARE_SIZE;\r\n } \r\n }", "static public void make() {\n\t\tif (window != null)\n\t\t\treturn;\n\n\t\twindow = new JFrame();\n\t\twindow.setTitle(\"Finecraft\");\n\t\twindow.setMinimumSize(new Dimension(500, 300));\n\t\twindow.setSize(asInteger(WINDOW_WIDTH), asInteger(WINDOW_HEIGHT));\n\t\twindow.setResizable(asBoolean(WINDOW_RESIZE));\n\t\twindow.setLocationRelativeTo(null);\n\t\twindow.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);\n\t}", "private static void createAndShowGUI() {\n frame = new JFrame(\"Shopping Cart\");\n frame.setLocation(600,300);\n frame.setPreferredSize(new Dimension(800,700));\n frame.setResizable(false);\n //frame.setLayout(new GridLayout(2,2,5,5));\n frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);\n\n //Create and set up the content pane.\n JComponent newContentPane = new shoppingCartTableGui();\n newContentPane.setOpaque(true); //content panes must be opaque\n frame.setContentPane(newContentPane);\n //Display the window.\n frame.pack();\n \n // inserting the login dialogPane here\n loginPane newLoginPane = new loginPane(frame);\n clientID = newLoginPane.getClientID();\n }", "ToeDialog(int cellsWide, int cellsHigh) {\n setTitle(\"The game itself\");\n setLayout(new GridLayout(cellsWide, cellsHigh));\n for(int i = 0; i < cellsWide * cellsHigh; i++)\n add(new ToeButton());\n setSize(cellsWide * 50, cellsHigh * 50);\n setDefaultCloseOperation(DISPOSE_ON_CLOSE);\n }", "public NextPiecePanel(final int the_width,\n final int the_height)\n {\n super();\n setSize(new Dimension(the_width, the_height));\n setPreferredSize(new Dimension(the_width, the_height));\n setBackground(Color.DARK_GRAY);\n// repaint();\n }", "public void run() {\n JPanel tempPanel = new JPanel(new GridBagLayout());\n JLabel label = new JLabel(\"Live Rearranger parsing file...\");\n Border b = BorderFactory.createRaisedBevelBorder();\n tempPanel.setBorder(b);\n GridBagConstraints constraints = new GridBagConstraints();\n constraints.insets = new Insets(5, 5, 5, 5);\n tempPanel.add(label, constraints);\n Dimension d = outerPanel.getSize();\n Dimension c = tempPanel.getPreferredSize();\n int x = (d.width - c.width) / 2;\n int y = (d.height - c.height) / 2;\n if (x < 0) x = 0;\n if (y < 0) y = 0;\n popup = PopupFactory.getSharedInstance().getPopup(outerPanel, tempPanel, x, y);\n// popup.getContentPane().add(tempPanel);\n// popup.setLocation(x, y);\n LOG.debug(\"initial outerPanel size=\" + d + \", tempPanel preferred size=\" + c);\n LOG.debug(\"Constructing initial Popup at x,y=\" + x + \",\" + y);\n// popup.pack();\n// popup.setVisible(true);\n// popup.requestFocusInWindow();\n popup.show();\n Cursor cu = Cursor.getPredefinedCursor(Cursor.WAIT_CURSOR);\n oldCursor = outerPanel.getCursor();\n LOG.debug(\"setCursor (WAIT)\" + cu + \" on \" + outerPanel);\n outerPanel.setCursor(cu);\n }", "public void setupGUIWindow()\n { \n// _frame.setExtendedState(Frame.MAXIMIZED_BOTH);\n// exitOnClose(); \n// createButtonGrid(); \n// addButtonPanel(); \n \n\t //setSize(new Dimension(Toolkit.getDefaultToolkit().getScreenSize())); \n \n\t _frame.setExtendedState(Frame.MAXIMIZED_BOTH);\n\t _frame.addComponentListener(new WindowListener());\n\t exitOnClose(); \n\t createShipPlacementButton();\n\t createButtonGrid(_displayPanel, _buttonGrid2, null); // player\n\t createButtonGrid(_buttonPanel, _buttonGrid, new GridListener(_buttonGrid)); // enemy\n\t addButtonPanel(); \n }", "public WindowPanel(Window window, DrawingMaze drawingMaze)\n\t{\n\t\tsetPreferredSize(new Dimension(800, 400)); /*La taille de la fenÍtre sera 800*400*/\n\t\tsetLayout(new BorderLayout());\n\t\tadd(new TitlePanel(), BorderLayout.NORTH); /*Le titre sera ťcrit en haut de la fenÍtre*/\n\t\tadd(drawingMaze, BorderLayout.CENTER); /*Le labyrinthe sera au milieu de la fenÍtre*/\n\t\tadd(new TextPanel(), BorderLayout.SOUTH); /*La description des cases sera en bas de la fenÍtre*/\n\t}", "private void createDisplay()\n {\n // Creates frame based off of the parameters passed in Display constructor\n frame = new JFrame(title); \n frame.setSize(width, height);\n frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);\n frame.setResizable(false); \n frame.setLocationRelativeTo(null);\n frame.setVisible(true);\n // Creates the canvas that is drawn on\n canvas = new Canvas();\n canvas.setPreferredSize(new Dimension(width,height));\n canvas.setMaximumSize(new Dimension(width,height));\n canvas.setMinimumSize(new Dimension(width,height));\n canvas.setFocusable(false);\n //add the canvas to the window\n frame.add(canvas);\n //pack the window (kinda like sealing it off)\n frame.pack();\n }", "public GameWindow(){\n setSize(1012,785);\n setDefaultCloseOperation(WindowConstants.EXIT_ON_CLOSE);\n setLayout(null);\n\n JLabel sun = new JLabel(\"SUN\");\n sun.setLocation(37,80);\n sun.setSize(60,20);\n\n GamePanel gp = new GamePanel(sun);\n gp.setLocation(0,0);\n getLayeredPane().add(gp,new Integer(0));\n \n PlantCard sunflower = new PlantCard(new ImageIcon(this.getClass().getResource(\"images/cards/card_sunflower.png\")).getImage());\n sunflower.setLocation(110,8);\n sunflower.setAction((ActionEvent e) -> {\n gp.activePlantingBrush = PlantType.Sunflower;\n });\n getLayeredPane().add(sunflower,new Integer(3));\n\n PlantCard peashooter = new PlantCard(new ImageIcon(this.getClass().getResource(\"images/cards/card_peashooter.png\")).getImage());\n peashooter.setLocation(175,8);\n peashooter.setAction((ActionEvent e) -> {\n gp.activePlantingBrush = PlantType.Peashooter;\n });\n getLayeredPane().add(peashooter,new Integer(3));\n\n PlantCard freezepeashooter = new PlantCard(new ImageIcon(this.getClass().getResource(\"images/cards/card_freezepeashooter.png\")).getImage());\n freezepeashooter.setLocation(240,8);\n freezepeashooter.setAction((ActionEvent e) -> {\n gp.activePlantingBrush = PlantType.FreezePeashooter;\n });\n getLayeredPane().add(freezepeashooter,new Integer(3));\n\n\n\n getLayeredPane().add(sun,new Integer(2));\n setResizable(false);\n setVisible(true);\n }", "public SnowmanPanel()\n {\n setPreferredSize(new Dimension(300,225));\n setBackground(Color.cyan);\n }", "public MazePanel(int width, int height) {\r\n\r\n\t\t\tsetLayout(null);\r\n\r\n\t\t\tMouseHandler listener = new MouseHandler();\r\n\t\t\taddMouseListener(listener);\r\n\t\t\taddMouseMotionListener(listener);\r\n\r\n\t\t\tsetBorder(BorderFactory.createMatteBorder(2, 2, 2, 2, Color.blue));\r\n\r\n\t\t\tsetPreferredSize(new Dimension(width, height));\r\n\r\n\t\t\tgrid = new int[rows][columns];\r\n\r\n\t\t\t// Criando o conteudo do panel\r\n\r\n\t\t\tmessage = new JLabel(msgDrawAndSelect, JLabel.CENTER);\r\n\t\t\tmessage.setForeground(Color.blue);\r\n\t\t\tmessage.setFont(new Font(\"Helvetica\", Font.PLAIN, 16));\r\n\r\n\t\t\tJLabel rowsLbl = new JLabel(\"Nº Linhas (5-50):\", JLabel.RIGHT);\r\n\t\t\trowsLbl.setFont(new Font(\"Helvetica\", Font.PLAIN, 13));\r\n\r\n\t\t\trowsField = new JTextField();\r\n\t\t\trowsField.setText(Integer.toString(rows));\r\n\r\n\t\t\tJLabel columnsLbl = new JLabel(\"Nº Colunas (5-50):\", JLabel.RIGHT);\r\n\t\t\tcolumnsLbl.setFont(new Font(\"Helvetica\", Font.PLAIN, 13));\r\n\r\n\t\t\tcolumnsField = new JTextField();\r\n\t\t\tcolumnsField.setText(Integer.toString(columns));\r\n\r\n\t\t\tJButton resetButton = new JButton(\"Novo GRID\");\r\n\t\t\tresetButton.addActionListener(new ActionHandler());\r\n\t\t\tresetButton.setBackground(Color.lightGray);\r\n\t\t\tresetButton\r\n\t\t\t\t\t.setToolTipText(\"Limpa e redesenha o GRID de acordo com o número de linhas e colunas estipulado.\");\r\n\t\t\tresetButton.addActionListener(new java.awt.event.ActionListener() {\r\n\t\t\t\t@Override\r\n\t\t\t\tpublic void actionPerformed(java.awt.event.ActionEvent evt) {\r\n\t\t\t\t\tresetButtonActionPerformed(evt);\r\n\t\t\t\t}\r\n\t\t\t});\r\n\r\n\t\t\tJButton mazeButton = new JButton(\"Gerar Labirinto\");\r\n\t\t\tmazeButton.addActionListener(new ActionHandler());\r\n\t\t\tmazeButton.setBackground(Color.lightGray);\r\n\t\t\tmazeButton.setToolTipText(\"Cria um labirinto aleatório\");\r\n\t\t\tmazeButton.addActionListener(new java.awt.event.ActionListener() {\r\n\t\t\t\t@Override\r\n\t\t\t\tpublic void actionPerformed(java.awt.event.ActionEvent evt) {\r\n\t\t\t\t\tmazeButtonActionPerformed(evt);\r\n\t\t\t\t}\r\n\t\t\t});\r\n\r\n\t\t\tJButton clearButton = new JButton(\"Limpar\");\r\n\t\t\tclearButton.addActionListener(new ActionHandler());\r\n\t\t\tclearButton.setBackground(Color.lightGray);\r\n\t\t\tclearButton.setToolTipText(\"Primeiro click: Limpa as buscas, Segundo click: Limpa obstáculos\");\r\n\r\n\t\t\tJButton stepButton = new JButton(\"Passo-a-Passo\");\r\n\t\t\tstepButton.addActionListener(new ActionHandler());\r\n\t\t\tstepButton.setBackground(Color.lightGray);\r\n\t\t\tstepButton.setToolTipText(\"A busca é realizada passo-a-passo pelo click\");\r\n\r\n\t\t\tJButton animationButton = new JButton(\"INICIAR\");\r\n\t\t\tanimationButton.addActionListener(new ActionHandler());\r\n\t\t\tanimationButton.setBackground(Color.lightGray);\r\n\t\t\tanimationButton.setToolTipText(\"A pesquisa é realizada automaticamente\");\r\n\r\n\t\t\tJLabel velocity = new JLabel(\"Velocidade\", JLabel.CENTER);\r\n\t\t\tvelocity.setFont(new Font(\"Helvetica\", Font.PLAIN, 10));\r\n\r\n\t\t\tslider = new JSlider(0, 1000, 500); // valor inicial do slider em 500 msec\r\n\t\t\tslider.setToolTipText(\"Regula o atraso para cada etapa (0 to 1 sec)\");\r\n\r\n\t\t\tdelay = 1000 - slider.getValue();\r\n\t\t\tslider.addChangeListener(new ChangeListener() {\r\n\t\t\t\t@Override\r\n\t\t\t\tpublic void stateChanged(ChangeEvent evt) {\r\n\t\t\t\t\tJSlider source = (JSlider) evt.getSource();\r\n\t\t\t\t\tif (!source.getValueIsAdjusting()) {\r\n\t\t\t\t\t\tdelay = 1000 - source.getValue();\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t});\r\n\r\n\t\t\t// ButtonGroup que sincroniza os cinco botões de rádio \r\n\t\t\t// escolha do algoritmo, de modo que apenas uma \r\n\t\t\t// pode ser selecionada a qualquer momento\r\n\t\t\t\r\n\t\t\tButtonGroup algoGroup = new ButtonGroup();\r\n\r\n\t\t\tdfs = new JRadioButton(\"DFS\");\r\n\t\t\tdfs.setToolTipText(\"Depth First Search algorithm\");\r\n\t\t\talgoGroup.add(dfs);\r\n\t\t\tdfs.addActionListener(new ActionHandler());\r\n\r\n\t\t\tbfs = new JRadioButton(\"BFS\");\r\n\t\t\tbfs.setToolTipText(\"Breadth First Search algorithm\");\r\n\t\t\talgoGroup.add(bfs);\r\n\t\t\tbfs.addActionListener(new ActionHandler());\r\n\r\n\t\t\taStar = new JRadioButton(\"A*\");\r\n\t\t\taStar.setToolTipText(\"Algoritmo A Estrela \");\r\n\t\t\taStar.setSelected(true);\r\n\t\t\talgoGroup.add(aStar);\r\n\t\t\taStar.addActionListener(new ActionHandler());\r\n\r\n\t\t\tguloso = new JRadioButton(\"Guloso\");\r\n\t\t\tguloso.setToolTipText(\"Algoritmo de Busca Gulosa\");\r\n\t\t\talgoGroup.add(guloso);\r\n\t\t\tguloso.addActionListener(new ActionHandler());\r\n\r\n\t\t\tdijkstra = new JRadioButton(\"Dijkstra\");\r\n\t\t\tdijkstra.setToolTipText(\"Dijkstra's algorithm\");\r\n\t\t\talgoGroup.add(dijkstra);\r\n\t\t\tdijkstra.addActionListener(new ActionHandler());\r\n\r\n\t\t\tJPanel algoPanel = new JPanel();\r\n\t\t\talgoPanel.setBorder(\r\n\t\t\t\t\tjavax.swing.BorderFactory.createTitledBorder(javax.swing.BorderFactory.createEtchedBorder(),\r\n\t\t\t\t\t\t\t\"Algoritmos\", javax.swing.border.TitledBorder.DEFAULT_JUSTIFICATION,\r\n\t\t\t\t\t\t\tjavax.swing.border.TitledBorder.TOP, new java.awt.Font(\"Helvetica\", 0, 14)));\r\n\r\n\t\t\taStar.setSelected(true); // A* selecionado como inicial\r\n\r\n\t\t\tdiagonal = new JCheckBox(\"Movimentos Diagonais\");\r\n\t\t\tdiagonal.setToolTipText(\"Movimentos diagonais também estão autorizados\");\r\n\t\t\tdiagonal.setSelected(true);\r\n\r\n\t\t\tdrawArrows = new JCheckBox(\"Setas para antecessores\");\r\n\t\t\tdrawArrows.setToolTipText(\"Desenha setas para os antecessores\");\r\n\r\n\t\t\tJLabel robot = new JLabel(\"INICIO\", JLabel.LEFT);\r\n\t\t\trobot.setForeground(Color.red);\r\n\t\t\trobot.setFont(new Font(\"Helvetica\", Font.BOLD, 14));\r\n\r\n\t\t\tJLabel target = new JLabel(\"ALVO\", JLabel.LEFT);\r\n\t\t\ttarget.setForeground(Color.green);\r\n\t\t\ttarget.setFont(new Font(\"Helvetica\", Font.BOLD, 14));\r\n\r\n\t\t\tJLabel frontier = new JLabel(\"FRONTEIRA\", JLabel.LEFT);\r\n\t\t\tfrontier.setForeground(Color.blue);\r\n\t\t\tfrontier.setFont(new Font(\"Helvetica\", Font.BOLD, 14));\r\n\r\n\t\t\tJLabel closed = new JLabel(\"FECHADOS\", JLabel.LEFT);\r\n\t\t\tclosed.setForeground(Color.cyan);\r\n\t\t\tclosed.setFont(new Font(\"Helvetica\", Font.BOLD, 14));\r\n\r\n\t\t\tJButton aboutButton = new JButton(\"Sobre\");\r\n\t\t\taboutButton.addActionListener(new ActionHandler());\r\n\t\t\taboutButton.setBackground(Color.lightGray);\r\n\t\t\taboutButton.addActionListener(new java.awt.event.ActionListener() {\r\n\t\t\t\t@Override\r\n\t\t\t\tpublic void actionPerformed(java.awt.event.ActionEvent evt) {\r\n\t\t\t\t\taboutButtonActionPerformed(evt);\r\n\t\t\t\t}\r\n\t\t\t});\r\n\r\n\t\t\t//Adicionando conteudo ao Panel\r\n\t\t\tadd(message);\r\n\t\t\tadd(rowsLbl);\r\n\t\t\tadd(rowsField);\r\n\t\t\tadd(columnsLbl);\r\n\t\t\tadd(columnsField);\r\n\t\t\tadd(resetButton);\r\n\t\t\tadd(mazeButton);\r\n\t\t\tadd(clearButton);\r\n\t\t\tadd(stepButton);\r\n\t\t\tadd(animationButton);\r\n\t\t\tadd(velocity);\r\n\t\t\tadd(slider);\r\n\t\t\tadd(dfs);\r\n\t\t\tadd(bfs);\r\n\t\t\tadd(aStar);\r\n\t\t\tadd(guloso);\r\n\t\t\tadd(dijkstra);\r\n\t\t\tadd(algoPanel);\r\n\t\t\tadd(diagonal);\r\n\t\t\t// add(drawArrows);\r\n\t\t\tadd(robot);\r\n\t\t\tadd(target);\r\n\t\t\tadd(frontier);\r\n\t\t\tadd(closed);\r\n\t\t\tadd(aboutButton);\r\n\r\n\t\t\t// Regulando posição dos componentes\r\n\t\t\tmessage.setBounds(0, 515, 500, 23);\r\n\t\t\trowsLbl.setBounds(520, 5, 140, 25);\r\n\t\t\trowsField.setBounds(665, 5, 25, 25);\r\n\t\t\tcolumnsLbl.setBounds(520, 35, 140, 25);\r\n\t\t\tcolumnsField.setBounds(665, 35, 25, 25);\r\n\t\t\tresetButton.setBounds(520, 65, 170, 25);\r\n\t\t\tmazeButton.setBounds(520, 95, 170, 25);\r\n\t\t\tclearButton.setBounds(520, 125, 170, 25);\r\n\t\t\tstepButton.setBounds(520, 155, 170, 25);\r\n\t\t\tanimationButton.setBounds(520, 185, 170, 25);\r\n\t\t\tvelocity.setBounds(520, 215, 170, 10);\r\n\t\t\tslider.setBounds(520, 225, 170, 25);\r\n\t\t\t// dfs.setBounds(530, 270, 70, 25);\r\n\t\t\t// bfs.setBounds(600, 270, 70, 25);\r\n\t\t\taStar.setBounds(530, 295, 70, 25);\r\n\t\t\tguloso.setBounds(600, 295, 85, 25);\r\n\t\t\t// dijkstra.setBounds(530, 320, 85, 25);\r\n\t\t\talgoPanel.setLocation(520, 250);\r\n\t\t\talgoPanel.setSize(170, 100);\r\n\t\t\tdiagonal.setBounds(520, 355, 170, 25);\r\n\t\t\t// drawArrows.setBounds(520, 380, 170, 25);\r\n\t\t\trobot.setBounds(530, 380, 80, 25);\r\n\t\t\ttarget.setBounds(530, 400, 80, 25);\r\n\t\t\tfrontier.setBounds(530, 420, 80, 25);\r\n\t\t\tclosed.setBounds(530, 440, 80, 25);\r\n\t\t\taboutButton.setBounds(520, 515, 170, 25);\r\n\r\n\t\t\t// Criando timer\r\n\t\t\ttimer = new Timer(delay, action);\r\n\r\n\t\t\t// Nós ligamos às células nos valores iniciais de grade.\r\n\t\t\t// Aqui é os primeiros passos dos algoritmos\r\n\t\t\tfillGrid();\r\n\r\n\t\t}", "public void showWindows() {\n\t\t pack();\n\t setResizable(false);\n\t setLocationRelativeTo(null);\n\t setVisible(true);\n\t\t\n\t}", "public MondrianPanel()\n {\n setPreferredSize(new Dimension(size, size));\n }", "public void showPage(String panel) {\r\n int height = 0;\r\n int widht = 0;\r\n switch (panel) {\r\n case (\"vælg\"):\r\n setJFrame(242, 150, \"vælg\", dateFormatTools.getDayLetters(cal));\r\n break;\r\n case (\"massage\"):\r\n massage = new MassageBuilder();\r\n customer = null;\r\n try {\r\n masTypeList = mc.getMTypeList();\r\n } catch (SQLException ex) {\r\n try {\r\n errorControl.createErrorPopup(\"Fejl i hentning af massagetyper.\", ex.getLocalizedMessage());\r\n } catch (SQLException ex1) {\r\n System.out.println(ex1.getLocalizedMessage());\r\n }\r\n }\r\n setJFrame(300, 370, \"massage\", dateFormatTools.getDayLetters(cal));\r\n fillComboStartTime();\r\n break;\r\n case (\"rediger massage\"):\r\n editing = true;\r\n startTime = mc.getEvent().getDate();\r\n try {\r\n masTypeList = mc.getMTypeList();\r\n } catch (SQLException ex) {\r\n try {\r\n errorControl.createErrorPopup(\"Fejl i hentning af massagetyper.\", ex.getLocalizedMessage());\r\n } catch (SQLException ex1) {\r\n System.out.println(ex1.getLocalizedMessage());\r\n }\r\n }\r\n event = mc.getEvent();\r\n setJFrame(300, 370, \"massage\", dateFormatTools.getDayLetters(cal));\r\n fillComboStartTime();\r\n fillMassage();\r\n break;\r\n case (\"bbq\"):\r\n customer = null;\r\n setJFrame(950, 716, \"bbq\", dateFormatTools.getDayLetters(cal));\r\n bbqControl.clearBBQBuilder();\r\n showCategories();\r\n break;\r\n case (\"bbq edit\"): {\r\n editing = true;\r\n try {\r\n bbqControl.geteventStof(event);\r\n } catch (SQLException ex) {\r\n Logger.getLogger(EventPanel.class.getName()).log(Level.SEVERE, null, ex);\r\n }\r\n }\r\n customer = event.getCustomer();\r\n setJFrame(950, 716, \"bbq\", dateFormatTools.getDayLetters(cal));\r\n fillbarbecue();\r\n showCategories();\r\n addToBasket();\r\n break;\r\n }\r\n jFrame.revalidate();\r\n jFrame.repaint();\r\n }", "private static void createAndShowGUI() {\n\t\t//Create and set up the window.\n\t\tJFrame frame = new JFrame(\"Color test\");\n\t\tframe.setPreferredSize(new Dimension(700, 700));\n\t\tframe.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);\n\n\t\t//Create and set up the content pane.\n\t\tJComponent newContentPane = new ColorTest();\n\t\tnewContentPane.setOpaque(true); //content panes must be opaque\n\t\tframe.setContentPane(newContentPane);\n\n\t\t//Display the window.\n\t\tframe.pack();\n\t\tframe.setVisible(true);\n\t}", "public void show() {\n frame.setContentPane(panel1); //puts all our buttons and other objects on the window\n frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); //what we want to do when the user closes the window\n frame.setSize(400, 165);\n frame.setLocationRelativeTo(null); //opens our window in the center of the screen\n frame.setResizable(false);\n frame.setVisible(true); //displays the window\n }", "public ViewGuaranterWindow() {\n initComponents();\n Dimension dim = Toolkit.getDefaultToolkit().getScreenSize();\n this.setLocation(dim.width/2-this.getSize().width/2, dim.height/2-this.getSize().height/2);\n }", "public WindowAutoLineaging()\n\t\t{\n\t\tsetLayout(new GridLayout(1,1));\n\t\t/*\n\t\tJPanel top=new JPanel(new GridBagLayout());\n\t\tGridBagConstraints c=new GridBagConstraints();\n\t\tc.gridy=0; top.add(new JLabel(\"Lineage \"),c);\n\t\t//c.gridy=1; top.add(new JLabel(\"Channel \"),c);\n\t\tc.gridy=1; top.add(new JLabel(\"Algorithm \"),c);\n\t\t\n\t\tc.fill=GridBagConstraints.HORIZONTAL;\n\t\tc.gridx=1;\n\t\tc.weightx=1;\n\t\t\n\t\tc.gridy=0; top.add(comboLin,c);\n//\t\tc.gridy=1; top.add(comboChan,c);\n\t\tc.gridy=1; top.add(comboAlgo,c);\n\t\t*/\n\t\tJComponent top=EvSwingUtil.layoutTableCompactWide(\n\t\t\t\tnew JLabel(\"Lineage \"),comboLin,\n\t\t\t\tnew JLabel(\"Algorithm \"),comboAlgo\n\t\t\t\t);\n\t\t\n\t\tpanelOptions.setBorder(BorderFactory.createTitledBorder(\"Options\"));\n\n\t\t\n\t\tadd(EvSwingUtil.layoutCompactVertical(\n\t\t\t\ttop,\n\t\t\t\tpanelOptions,\n\t\t\t\tpanelStatus,\n\t\t\t\tEvSwingUtil.withLabel(\"Frame\", frameStart),\n\t\t\t\tEvSwingUtil.layoutEvenHorizontal(bStartStop,bStep,bFlatten)));\n\t\t\n\t\tcomboAlgo.addActionListener(new ActionListener(){\n\t\t\tpublic void actionPerformed(ActionEvent e){updateCurrentAlgo();}});\n\t\t\n\t\tbStartStop.addActionListener(new ActionListener(){\n\t\t\tpublic void actionPerformed(ActionEvent e){startStop();}});\n\n\t\tbStep.addActionListener(new ActionListener(){\n\t\tpublic void actionPerformed(ActionEvent e){step();}});\n\n\n\t\tbFlatten.addActionListener(new ActionListener(){\n\t\tpublic void actionPerformed(ActionEvent e){flatten();}});\n\n\t\tsetTitleEvWindow(\"Auto-lineage\");\n\t\tupdateCurrentAlgo();\n\t\tpackEvWindow();\n\t\tsetVisibleEvWindow(true);\n\t\t}", "public void createAndShowGUI() {\n\t\tJFrame frame = new JFrame(\"Pong\");\n\t\tframe.setResizable(false);\n\t\tframe.setVisible(true);\n\n\n\t\tframe.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);\n\n\t\tframe.add(board, BorderLayout.CENTER);\n\t\tframe.add(topPanel, BorderLayout.NORTH);\n\n\t\tframe.pack();\n\t}", "public static void main(String[] args)\n {\n f = new JFrame();\n\n f.setTitle(\"STARVATION EVASION\");\n f.setPreferredSize(new Dimension(width, height));\n f.setSize(f.getPreferredSize());\n f.setLocation(0, 0);\n f.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);\n\n PanelTester tester = new PanelTester();\n tester.show();\n }", "public void showIndividual() {\n JFrame newFrame = new JFrame();\n if (this.m_Indy == null) {\n System.out.println(\"No individual!\");\n return;\n }\n newFrame.setTitle(this.m_Indy.getName()+\": \"+this.m_Indy);\n newFrame.addWindowListener(new WindowAdapter() {\n public void windowClosing(WindowEvent ev) {\n System.gc();\n }\n });\n newFrame.getContentPane().add(this.m_Problem.drawIndividual(-1, -1, this.m_Indy));\n newFrame.setSize(200, 300);\n newFrame.pack();\n newFrame.validate();\n newFrame.setVisible(true);\n newFrame.show();\n }", "private void setupWindow() {\n\t\tgetContentPane().setLayout(null);\t\t\t\t\n\n\t\t// Set title\n\t\tsetTitle(\"Gallhp\");\n\n\t\t// Set location and size\n\t\tsetLocationRelativeTo(null);\n\t\tsetDefaultCloseOperation(EXIT_ON_CLOSE);\t\n\t\tsetSize(800, 600);\n\t\tsetResizable(false);\n\n\t}", "public Window()\n {\n // Sets window defaults\n this.setDefaultCloseOperation(EXIT_ON_CLOSE);\n this.setSize(800,800);\n this.setResizable(false);\n this.setTitle(\"Graph Drawing\");\n\n // Creates the various graph display panels\n this.detailsPanel = new DetailsPanel(this);\n detailsPanel.setMaximumSize(new Dimension(625,50));\n\n this.graph = new DrawPolygon();\n graph.setPreferredSize(new Dimension(625, 750));\n\n // Creates the various option display panels\n this.graphPanel = new GraphPanel(this);\n graphPanel.setPreferredSize(new Dimension(175, 75));\n\n this.linePanel = new LinePanel(this);\n linePanel.setPreferredSize(new Dimension(175, 100));\n\n this.aestheticsPanel = new AestheticsPanel(this);\n aestheticsPanel.setPreferredSize(new Dimension(175, 625));\n\n // Creates the graphing panel\n graphingPanel = new JPanel(new BorderLayout());\n graphingPanel.add(detailsPanel, BorderLayout.PAGE_START);\n graphingPanel.add(graph, BorderLayout.PAGE_END);\n\n // Creates the option panel container panel\n optionPanel = new JPanel(new BorderLayout());\n optionPanel.add(graphPanel, BorderLayout.PAGE_START);\n optionPanel.add(linePanel, BorderLayout.CENTER);\n optionPanel.add(aestheticsPanel, BorderLayout.PAGE_END);\n\n // Adds the panels to the content pane\n this.getContentPane().setLayout(new BorderLayout());\n this.getContentPane().add(graphingPanel, BorderLayout.WEST);\n this.getContentPane().add(optionPanel, BorderLayout.EAST);\n this.setVisible(true);\n }", "private void studentPortalScreen() {\n\t\t\n\t\t// Initialize Windows\n\t\tDimension dimension = new Dimension(studentPortalWidth, studentPortalHeight);\n\t\tsPortalWindow = new JFrame(\"Student Portal\");\n\t\tsPortalWindow.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);\n\t\tsPortalWindow.setSize(dimension);\n\t\tsPortalWindow.setLayout(new BorderLayout());\n\t\tsPortalWindow.setResizable(false);\n\t\tsPortalWindow.setLocationRelativeTo(null);\n\t\tsPortalWindow.setMinimumSize(dimension);\n\t\tsPortalWindow.setMaximumSize(dimension);\n\t\tsPortalWindow.setPreferredSize(dimension);\n\t\t\n\t\t//StudentPortal JPanel\n\t\tstudentPortal = new JPanel();\n\t\tstudentPortal.setLayout(new GridLayout(1, 1));\n\t\tstudentPortal.setSize(dimension);\n\t\t\t\t\n\t\t//Student JTabbedPane & JComponent's\n\t\tsTabbedPane = new JTabbedPane();\n\n\t\tsProfileComponent = makeStudentProfilePanel();\n\t\tsTabbedPane.addTab(\"Dashboard\", sProfileComponent);\n\t\tsTabbedPane.setMnemonicAt(0, KeyEvent.VK_1);\n\t\t\n\t\t//Add JTabbedPane to JPanel\n\t\tstudentPortal.add(sTabbedPane);\n\t\t\t\t\n\t\t//Add JPanel to JFrame\n\t\tsPortalWindow.add(studentPortal, BorderLayout.CENTER);\n\t\t \n\t\t//Display the window\n\t\tsPortalWindow.pack();\n\t\tsPortalWindow.setVisible(true);\n\t\t\t\t\n\t\t//Enable scrolling tabs\n\t\tsTabbedPane.setTabLayoutPolicy(JTabbedPane.SCROLL_TAB_LAYOUT); \n\t}", "private void init(){\r\n\t\tsetLayout(new FlowLayout());\r\n\t\tsetPreferredSize(new Dimension(40,40));\r\n\t\tsetVisible(true);\r\n\t}", "private void createGUI() {\n ResizeGifPanel newContentPane = new ResizeGifPanel();\n newContentPane.setOpaque(true); \n setContentPane(newContentPane); \n }", "public BoardGUI(int gridsize, int gridwidth) {\r\n\r\n gridSize = gridsize;\r\n gridWidth = gridwidth;\r\n double actualWidth = (double) (gridWidth - 20);\r\n blockSize = (actualWidth / (double) gridSize);\r\n\r\n board = new GridPane();\r\n board.setPrefSize(gridWidth, gridWidth);\r\n board.setPadding(new Insets(5)); //margin for the slot the grid will be in\r\n //https://pngtree.com/freebackground/blue-watercolor-background-material_754790.html\r\n Image bg = new Image(\"images/sea.jpg\");\r\n BackgroundImage bgImage = new BackgroundImage(bg, null, null, null, null);\r\n board.setBackground(new Background(bgImage));\r\n //sets the grid depending on size\r\n for (int x = 0; x < gridSize; x++) {\r\n //this sets the constraints for box size so the size doesn't automatically adjust to child inside\r\n ColumnConstraints column = new ColumnConstraints();\r\n RowConstraints row = new RowConstraints();\r\n //so it fits the parent slot (center) for the grid whatever the size of the grid\r\n column.setPercentWidth(50);\r\n row.setPercentHeight(50);\r\n board.getColumnConstraints().add(column);\r\n board.getRowConstraints().add(row);\r\n }\r\n board.setGridLinesVisible(true);\r\n }", "public ControlPanel(String propFile) {\n super(propFile);\n frame = new JFrame(\"Control Panel\");\n frame.setPreferredSize(new Dimension(900, 500));\n frame.setDefaultCloseOperation(frame.EXIT_ON_CLOSE);\n }", "private void populateWindow() {\n\t\tadd(net, BorderLayout.CENTER);\n\t\t//net.setPreferredSize(new Dimension(4 * Polje.defaultSize + 4 * 3, 5 * Polje.defaultSize + 5 * 3));\n\t\t//ipak radi samo ako se stavi za svaki kanvas prefferedSize(new Dimension(75,75))\n\t\t\n\t\t//trigger nek bude kad se dugme pritisne\n\t\trandomNumber.setText(\"\");\n\t\trandomNumber.setForeground(Color.WHITE);\n\t\trandomNumber.setFont(new Font(\"Arial\", Font.BOLD, 17)); //posto se slabo videlo\n\t\tstatusBar.setBackground(Color.GRAY);\n\t\tstatusBar.setLayout(new FlowLayout(FlowLayout.LEFT));\n\t\tstatusBar.add(randomNumber);\n\t\t//promene nek se desavaju u metodi dugmeta Igra\n\t\t\n\t\tcontrolPanel.setLayout(new GridLayout(5,1));\n\t\tPanel t1 = new Panel(new FlowLayout(FlowLayout.LEFT));\n\t\tt1.add(new Label(\"Balans:\"));\n\t\tt1.add(balans);\n\t\tcontrolPanel.add(t1);\n\t\t\n\t\tPanel t2 = new Panel(new FlowLayout(FlowLayout.LEFT));\n\t\tt2.add(new Label(\"Ulog:\"));\n\t\ttextfield.setText(\"100\");\n\t\ttextfield.addTextListener((ae) -> {\n\t\t\tupdateDobitak();\n\t\t});\n\t\tt2.add(textfield);\n\t\tcontrolPanel.add(t2);\n\t\t\n\t\tPanel t3 = new Panel(new FlowLayout(FlowLayout.LEFT));\n\t\tt3.add(new Label(\"Kvota:\"));\n\t\tt3.add(kvota);\n\t\tcontrolPanel.add(t3);\n\t\t\n\t\tPanel t4 = new Panel(new FlowLayout(FlowLayout.LEFT));\n\t\tt4.add(new Label(\"Dobitak:\"));\n\t\tt4.add(dobitak);\n\t\tcontrolPanel.add(t4);\n\t\t\n\t\tPanel t5 = new Panel(new FlowLayout(FlowLayout.RIGHT));\n\t\tt5.add(igraj);\n\t\tcontrolPanel.add(t5);\n\t\t\n\t\tigraj.setEnabled(false);\n\t\t\n\t\tigraj.addActionListener((ae) -> {\n\t\t\t//TODO: heshset se uzima i gleda se da li je broj od generatora\n\t\t\t//u heshsetu\n\t\t\tHashSet<Integer> set = net.getHashSet();\n\t\t\tint t = Generator.generateNum(0, net.getRows() * net.getColumns());\n\t\t\trandomNumber.setText(Integer.toString(t));\n\t\t\tif(set.contains(t)) {\n\t\t\t\tstatusBar.setBackground(Color.GREEN);\n\t\t\t\trandomNumber.setBackground(Color.GREEN);\n\t\t\t\tupdateBalans(\"-\" + textfield.getText());\n\t\t\t\tupdateBalans(dobitak.getText());\n\t\t\t}else {\n\t\t\t\tstatusBar.setBackground(Color.RED);\n\t\t\t\trandomNumber.setBackground(Color.RED);\n\t\t\t\tupdateBalans(\"-\" + textfield.getText());\n\t\t\t}\n\t\t});\n\t\t\n\t\tcontrolPanel.setBackground(Color.LIGHT_GRAY);\n\t\tadd(controlPanel, BorderLayout.EAST);\n\t\tadd(statusBar, BorderLayout.SOUTH);\n\t}", "private void createAndShowGUI() {\n frame = new JFrame(\"WorkspaceDemo\");\n frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);\n frame.setBounds(100, 100, 800, 600);\n final SearchBar sb = new SearchBar(\"Search blocks\",\n \"Search for blocks in the drawers and workspace\", workspace);\n for (final SearchableContainer con : getAllSearchableContainers()) {\n sb.addSearchableContainer(con);\n }\n final JPanel topPane = new JPanel();\n sb.getComponent().setPreferredSize(new Dimension(130, 23));\n topPane.add(sb.getComponent());\n frame.add(topPane, BorderLayout.PAGE_START);\n frame.add(getWorkspacePanel(), BorderLayout.CENTER);\n frame.add(getButtonPanel(), BorderLayout.SOUTH);\n frame.setVisible(true);\n }", "private static void createAndShowGUI() {\n\t\tJFrame window = MainWindow.newInstance();\n\t\t\n //Display the window.\n window.pack();\n window.setVisible(true);\n \n }", "private static void createAndShowGUI() {\n JFrame frame = new JFrame(\"Gomaku - 5 In A Row\");\n frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);\n frame.setSize(600, 600);\n\n //Add the ubiquitous \"Hello World\" label.\n JPanel board = new JPanel();\n board.setSize(400, 400);\n board.set\n frame.getContentPane().add(board);\n\n //Display the window.\n frame.setVisible(true);\n }", "private static void createAndShowGUI() {\n //Create and set up the window.\n JFrame frame = new JFrame(\"WAR OF MINE\");\n frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);\n\n //Create and set up the content pane.\n JComponent newContentPane = new Gameframe();\n newContentPane.setOpaque(true); //content panes must be opaque\n frame.setContentPane(newContentPane);\n\n //Display the window.\n frame.setSize(800,1000);\n frame.setVisible(true);\n }", "private static void createAndShowGUI() {\n //Make sure we have nice window decorations.\n JFrame.setDefaultLookAndFeelDecorated(true);\n\n JFrame frame = new JFrame(\"TablePanel\");\n JPanel contentP = new JPanel();\n Box v = Box.createVerticalBox();\n Box h = Box.createHorizontalBox();\n Box h2 = Box.createHorizontalBox();\n TablePanel tablePanel = new TablePanel();\n tablePanel.setOpaque(true); //content panes must be opaque\n\n\n frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);\n frame.setContentPane(contentP);\n contentP.add(tablePanel);\n contentP.add(v);\n v.add(h);\n v.add(h2);\n\n h.add(tablePanel);\n h2.add(new JButton(\"Hello\"));\n //Display the window.\n frame.pack();\n frame.setLocationRelativeTo(null);\n frame.setVisible(true);\n }", "public static void createAndShowGUI(){\n\n //the main graph frame\n JFrame mainFrame = new JFrame(\"Graphit\");\n mainFrame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);\n mainFrame.setSize(CANVAS_WIDTH, CANVAS_HEIGHT);\n\n gc = new NGraphitController();\n\n p = new Point(0,0);\n\n // Viewport is to man through the graph.\n vp = new JViewport();\n vp.setSize(100, 100);\n vp.setView(gc);\n mainFrame.add(vp);\n\n mainFrame.pack();\n mainFrame.setLocationRelativeTo(null);\n mainFrame.setVisible(true);\n\n }", "@SuppressWarnings(\"unchecked\")\n // <editor-fold defaultstate=\"collapsed\" desc=\"Generated Code\">//GEN-BEGIN:initComponents\n private void initComponents() {\n\n pnlOrdenes = new javax.swing.JDesktopPane();\n\n setClosable(true);\n setIconifiable(true);\n setMaximizable(true);\n setResizable(true);\n setTitle(\"Pantalla Cocina\");\n setToolTipText(\"\");\n setFrameIcon(new javax.swing.ImageIcon(getClass().getResource(\"/QuickMeal/Imagenes/pantalla.png\"))); // NOI18N\n setMaximumSize(new java.awt.Dimension(4500, 3250));\n setMinimumSize(new java.awt.Dimension(900, 700));\n setPreferredSize(new java.awt.Dimension(900, 700));\n\n javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());\n getContentPane().setLayout(layout);\n layout.setHorizontalGroup(\n layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGroup(layout.createSequentialGroup()\n .addContainerGap()\n .addComponent(pnlOrdenes, javax.swing.GroupLayout.DEFAULT_SIZE, 864, Short.MAX_VALUE)\n .addContainerGap())\n );\n layout.setVerticalGroup(\n layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGroup(layout.createSequentialGroup()\n .addContainerGap()\n .addComponent(pnlOrdenes, javax.swing.GroupLayout.DEFAULT_SIZE, 649, Short.MAX_VALUE)\n .addContainerGap())\n );\n\n pack();\n }", "private void constructPopup() {\n popupPanel = new JPanel();\n popupPanel.setLayout(new BoxLayout(popupPanel, BoxLayout.Y_AXIS));\n popupScrollPane = new JScrollPane(popupPanel);\n popupScrollPane.setMaximumSize(new Dimension(200, 300));\n\n shapeName = new JTextField(15);\n time = new JTextField(5);\n shapeTypes = new ArrayList<>();\n shapeTimes = new ArrayList<>();\n shapeNames = new ArrayList<>();\n\n x = new JTextField(5);\n y = new JTextField(5);\n width = new JTextField(5);\n height = new JTextField(5);\n r = new JTextField(3);\n g = new JTextField(3);\n b = new JTextField(3);\n\n }", "private void drawNewDrawPanel(final Integer blkSize) {\n\t\tfrmNewBlock = new JFrame();\n\t\tfrmNewBlock.setPreferredSize(new Dimension(750, 700));\n\t\tfrmNewBlock.setTitle(\"New Block\");\n\t\tfrmNewBlock.setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE);\n\t\tfrmNewBlock.pack();\n\t\tfrmNewBlock.setVisible(true);\n\n\t\tcontrolPanel = new JPanel();\n\t\tcontrolPanel.setLayout(new MigLayout(\"\", \"[100][15][3][287][287][3]\",\n\t\t\t\t\"[][12.00][25][25][25][500][][]\"));\n\n\t\tRuler ruler = new Ruler(blkSize);\n\t\tcontrolPanel.add(ruler, \"cell 2 0 4 6\");\n\n\t\tbuttonGroup = new ButtonGroup();\n\n\t\tbtnNew = new JButton(\"Start New Block\");\n\t\tbuttonGroup.add(btnNew);\n\t\tbtnNew.addActionListener(new ActionListener() {\n\t\t\tpublic void actionPerformed(ActionEvent e) {\n\t\t\t\tfrmNewBlock.dispose();\n\t\t\t\tnew NewBlockFrame();\n\t\t\t}\n\t\t});\n\t\tcontrolPanel.add(btnNew, \"cell 0 2\");\n\n\t\tbtnReset = new JButton(\"Reset Block\");\n\t\tbuttonGroup.add(btnReset);\n\t\tbtnReset.addActionListener(new ActionListener() {\n\t\t\tpublic void actionPerformed(ActionEvent e) {\n\t\t\t\tcontrolPanel.repaint();\n\t\t\t}\n\t\t});\n\t\tcontrolPanel.add(btnReset, \"cell 0 3,growx\");\n\n\t/*\tbtnUndo = new JButton(\"Undo Last\");\n\t\tbuttonGroup.add(btnUndo);\n\t\tbtnUndo.addActionListener(new ActionListener() {\n\t\t\tpublic void actionPerformed(ActionEvent e) {\n\t\t\t\tblkLines = DrawPiece.getBlkLines();\n\t\t\t\tblkLines = DrawPiece.removeBlkLine(blkLines);\n\t\t\t\truler.repaint();\n\t\t\t\truler.add(new DrawBlock(blkLines));\n\t\t\t\truler.repaint();\n\t\t\t\t\n\t\t\t\t\t*/\t\t\t\t\t\t\n\n//\t\t\t\tGraphics2D g2 = (Graphics2D) drawPiece.drawPieceSingleton\n//\t\t\t\t\t\t.getGraphics();\n//\n//\t\t\t\tThread myThread = new Thread() {\n//\n//\t\t\t\t\tpublic void run() {\n//\t\t\t\t\t\tGraphics2D g2 = (Graphics2D) drawPiece.drawPieceSingleton\n//\t\t\t\t\t\t\t\t.getGraphics();\n//\t\t\t\t\t\t\n//\t\t\t\t\t\tdrawPiece.redrawBlkLines(g2, blkLines);\t\t\t\t\t\t\n//\t\t\t\t\t\n//\t\t\t\t\t}\n//\n//\t\t\t\t};\n//\t\t\t\tmyThread.start();\n//\n//\t\t\t\tg2.setColor(Color.RED);\n//\n//\t\t\t}\n//\t});\n//\t\tcontrolPanel.add(btnUndo, \"cell 3 6,alignx left\");\n\n\t\tbtnSave = new JButton(\"Save\");\n\t\tbuttonGroup.add(btnSave);\n\t\tbtnSave.addActionListener(new ActionListener() {\n\t\t\tpublic void actionPerformed(ActionEvent e) {\n\t\t\t\tRandom rand = new Random();\n\t\t\t\tString blkName = JOptionPane.showInputDialog(\"Please enter \"\n\t\t\t\t\t\t+ \"a name for the block: \");\n\t\t\t\tint id = (int)QuiltPad.blockRepository.count() + 1;\n\t\t\t\tint uPieces = rand.nextInt(12) + 1;\n\t\t\t\tBlock block = new Block(id, blkName, blkSize, uPieces, blkLines);\n\t\t\t\tQuiltPad.blockRepository.save(block);\n\t\t\t\tfrmNewBlock.dispose();\n\t\t\t\tnew BlockFrame();\n\t\t\t\t\n\t\t\t}\n\t\t});\n\t\tcontrolPanel.add(btnSave, \"cell 4 6,alignx right\");\n\t\t\n\t\tfrmNewBlock.getContentPane().add(controlPanel);\n\n\t}", "@Override\n public void projectOpened() {\n ToolWindowManager toolWindowManager = ToolWindowManager.getInstance(project);\n JPanel myContentPanel = new JPanel(new BorderLayout());\n ShareToolWin toolWin = new ShareToolWin();\n myContentPanel.add(toolWin.getRootPanel(), BorderLayout.CENTER);\n ToolWindow toolWindow = toolWindowManager.registerToolWindow(TOOL_WINDOW_ID, false, ToolWindowAnchor.LEFT);\n toolWindow.getComponent().add(myContentPanel);\n }", "private void buildAndShowWindow() {\n SwingUtilities.invokeLater(() -> {\n buildWindow().setVisible(true);\n });\n }", "public void showOPanel(Point p) {\r\n \r\n \t}", "private void setUpPanel() {\n this.panel = new JPanel();\n functions = new JPanel();\n panel.setPreferredSize(new Dimension(Screen.screenWidth, Screen.screenHeight));\n\n int borderBottom = Screen.screenHeight / 8;\n if (Screen.screenHeight > 1400) {\n borderBottom = Screen.screenHeight / 7;\n }\n\n panel.setBorder(BorderFactory.createEmptyBorder(80, Screen.border, borderBottom, Screen.border));\n panel.setLayout(new BoxLayout(panel, BoxLayout.Y_AXIS));\n functions.setPreferredSize(new Dimension(600, 500));\n functions.setLayout(cardLayout);\n }", "private void makeGUI()\n {\n mainFrame = new JFrame();\n mainFrame.setPreferredSize(new Dimension(750,400));\n aw = new AccountWindow();\n mainFrame.add(aw);\n mainFrame.setVisible(true);\n mainFrame.pack();\n }", "public ClothPanel( int w, int h)\n\t{\t\t\n\t\t// make the display an apropriate size (around 800x600 pixels)\n\t\tthis.magicNumber = Math.min(800/w, 600/h);\n\t\tthis.width = this.magicNumber * w;\n\t\tthis.height = this.magicNumber * h;\n\t\tsuper.setPreferredSize(new Dimension(this.width,this.height));\n\t}", "public NewJFrame1() {\n initComponents();\n\n dip();\n sh();\n }", "private static void createAndShowGUI() {\n //Make sure we have nice window decorations.\n JFrame.setDefaultLookAndFeelDecorated(true);\n\n //Create and set up the window.\n JFrame frame = new JFrame(\"MRALD Color Chooser\");\n\n //Create and set up the content pane.\n JComponent newContentPane = new MraldColorChooser(coloringItems);\n newContentPane.setOpaque(true); //content panes must be opaque\n frame.setContentPane(newContentPane);\n\n //Display the window.\n frame.pack();\n frame.setVisible(true);\n }", "private static void createWindow(){\n try{\n\n displayMode = new DisplayMode(1600 ,900);\n Display.setDisplayMode(displayMode);\n\n /*\n Display.setDisplayMode(getDisplayMode(1920 ,1080,false));\n if(displayMode.isFullscreenCapable()){\n Display.setFullscreen(true);\n }else{\n Display.setFullscreen(false);\n }\n */\n Display.setTitle(\"CubeKraft\");\n Display.create();\n }catch (Exception e){\n for(StackTraceElement s: e.getStackTrace()){\n System.out.println(s.toString());\n }\n }\n }", "public static void createWindow(final JFrame frame,Object [] obj){\n\t\tfinal MainFrame mainframe = (MainFrame) obj[0];\n\t\t//initWindow(frame,\"Configuration de la grille\", 330, 250);\n\n\t\tinitWindow(frame,\"Configuration de la grille\", 380, 250, mainframe.getFrameX(), mainframe.getFrameY());\n\t\tContainer mainpanel = frame.getContentPane();\n\t\tContainer contentPane = new Container();\n\t\tGridBagLayout gridbag = new GridBagLayout();\n\t\tGridBagConstraints c = new GridBagConstraints();\n\t\tcontentPane.setLayout(gridbag);\n\t\t/*\n\t\tc.weightx = 1; \n\t\tc.weighty = 1; \n\t\tc.gridwidth = GridBagConstraints.REMAINDER;\n\t\t*/\n\t\t//c.insets =new Insets(0,5,0,5);\n\t\t//c.anchor = GridBagConstraints.LINE_START;\n\t\t//c.fill = GridBagConstraints.HORIZONTAL;\n\t\t\n\n\t\t\n\t\t\n\t\tJPanel daypanel = new JPanel(null);\n\t\tdaypanel.setBorder(BorderFactory.createTitledBorder(\" Intervalle : \"));\n\t\tGridBagLayout gridbag3 = new GridBagLayout();\n\t\tGridBagConstraints c3 = new GridBagConstraints();\n\t\tdaypanel.setLayout(gridbag3);\n\t\t\n\t\tArrayList days = new ArrayList();\n\t\tdays.add(\"Lundi\");\n\t\tdays.add( \"Mardi\");\n\t\tdays.add( \"Mercredi\");\n\t\tdays.add( \"Jeudi\");\n\t\tdays.add( \"Vendredi\");\n\t\tdays.add( \"Samedi\");\n\t\tdays.add( \"Dimanche\");\n\t\t\n\t\t\n\t\tc3.weightx = 1; \n\t\tc3.weighty = 1; \n\t\tc3.gridwidth = 1; \n\t\t\n\t\tc3.insets =new Insets(0,5,0,5);\n\t\tc3.anchor = GridBagConstraints.LINE_END;\n\t\tc3.fill = GridBagConstraints.HORIZONTAL;\n\t\t\n\t\tJLabel du = new JLabel(\" Du : \");\n\t\tgridbag3.setConstraints(du, c3);\n\t\tdaypanel.add(du);\n\t\t\n\t\tJComboBox duCombo = new JComboBox(days.toArray());\n\t\tgridbag3.setConstraints(duCombo, c3);\n\t\tdaypanel.add(duCombo);\n\t\t\n\t\tJLabel auLabel = new JLabel(\" Au : \");\n\t\tgridbag3.setConstraints(auLabel, c3);\n\t\tdaypanel.add(auLabel);\n\t\t\n\t\tfinal JComboBox auCombo = new JComboBox(days.toArray());\n\t\tauCombo.setSelectedIndex(Grid.gridNbDays-1);\n\t\tgridbag3.setConstraints(auCombo, c3);\n\t\tdaypanel.add(auCombo);\n\t\t\n\t\t/*JLabel tailleLabel = new JLabel(\" Taille : \");\n\t\tgridbag3.setConstraints(tailleLabel, c3);\n\t\tdaypanel.add(tailleLabel);\n\t\t\n\t\tJTextField ptField2 = new JTextField(\" \");\n\t\tgridbag3.setConstraints(ptField2, c3);\n\t\tdaypanel.add(ptField2);\n\t\t\n\t\tJLabel ptLabel2 =new JLabel(\"pt\");\n\t\tgridbag3.setConstraints(ptLabel2, c3);\n\t\tdaypanel.add(ptLabel2);*/\n\t\t\n\t\tc.gridwidth = GridBagConstraints.REMAINDER;\n\t\tc.weighty = 1.0;\n\t\t//c.gridwidth = GridBagConstraints.RELATIVE ;\n\t\tgridbag.setConstraints(daypanel, c);\n\t\tcontentPane.add(daypanel);\n\t\t\n\n\t\t\n\n\t\t\n\t\tJPanel infopanel = new JPanel(null);\n\t\tinfopanel.setBorder(BorderFactory.createTitledBorder(\" Journée : \"));\n\t\tGridBagLayout gridbag2 = new GridBagLayout();\n\t\tGridBagConstraints c2 = new GridBagConstraints();\n\t\tinfopanel.setLayout(gridbag2);\n\t\t\t\t\n\t\tc2.weightx = 1; \n\t\tc2.weighty = 1; \n\t\tc2.gridwidth = 1; \n\t\t\n\t\tc2.insets =new Insets(0,5,0,5);\n\t\tc2.anchor = GridBagConstraints.LINE_END;\n\t\tc2.fill = GridBagConstraints.HORIZONTAL;\n\t\t\t\t\n\t\tJLabel beggining = new JLabel(\" Début : \");\n\t\tgridbag2.setConstraints(beggining , c2);\n\t\tinfopanel.add(beggining );\n\t\t\n\t\tc2.anchor = GridBagConstraints.LINE_START;\n\t\tJPanel firstInter = new JPanel(null);\n\t\tfirstInter.setLayout(new BorderLayout());\n\t\tfinal JTextField bgHour = new JTextField(\"\" + Grid.gridBgHour);\n\t\tbgHour.setPreferredSize(new Dimension(20,20));\n\t\tfirstInter.add(bgHour, BorderLayout.WEST);\n\t\tfirstInter.add(new JLabel(\" h \"), BorderLayout.CENTER);\n\t\t//JTextField bgMin = new JTextField(\"0\");\n\t\t//bgMin.setPreferredSize(new Dimension(20,20));\n\t\t//firstInter.add(bgMin, BorderLayout.EAST);\n\t\tgridbag2.setConstraints(firstInter, c2);\n\t\tinfopanel.add(firstInter);\n\t\t\n\t\tc2.anchor = GridBagConstraints.LINE_END;\n\t\tJLabel end = new JLabel(\" Fin : \");\n\t\tgridbag2.setConstraints(end, c2);\n\t\tinfopanel.add(end);\n\t\t\n\t\tc2.anchor = GridBagConstraints.LINE_START;\n\t\t\n\t\tJPanel secondInter = new JPanel(null);\n\t\tsecondInter.setLayout(new BorderLayout());\n\t\tfinal JTextField endHour = new JTextField(\"\" + Grid.gridEndHour);\n\t\tendHour.setPreferredSize(new Dimension(20,20));\n\t\tsecondInter.add(endHour, BorderLayout.WEST);\n\t\tsecondInter.add(new JLabel(\" h \"), BorderLayout.CENTER);\n\t\t//JTextField endMin = new JTextField(\"0\");\n\t\t//endMin.setPreferredSize(new Dimension(20,20));\n\t\t//secondInter.add(endMin, BorderLayout.EAST);\n\n\t\tgridbag2.setConstraints(secondInter, c2);\n\t\tinfopanel.add(secondInter);\n\t\t\n\t\t/*JLabel size = new JLabel(\" Taille : \");\n\t\tgridbag2.setConstraints(size, c2);\n\t\tinfopanel.add(size);\n\t\t\n\t\tJTextField ptField = new JTextField(\" \");\n\t\tgridbag2.setConstraints(ptField, c2);\n\t\tinfopanel.add(ptField);\n\t\t\n\t\tJLabel ptLabel =new JLabel(\"pt\");\n\t\tgridbag2.setConstraints(ptLabel, c2);\n\t\tinfopanel.add(ptLabel);\n\t\t*/\n\t\tc.fill = GridBagConstraints.BOTH;\n\t\tgridbag.setConstraints(infopanel, c);\n\t\tcontentPane.add(infopanel);\n\t\t\n\t\tc.gridwidth = GridBagConstraints.RELATIVE;\n\t\t\n\t\tc.anchor = GridBagConstraints.LINE_START;\n\t\tc.gridwidth = GridBagConstraints.RELATIVE;\n\t\tc.gridwidth = 1;\n\t\tc.anchor = GridBagConstraints.CENTER;\n\t\tJLabel hour = new JLabel(\" Découpage des heures : \");\n\t\tgridbag.setConstraints(hour, c);\n\t\tcontentPane.add(hour);\n\t\t\n\t\tc.gridwidth = GridBagConstraints.REMAINDER;\n\t\tc.anchor = GridBagConstraints.EAST;\n\t\tc.fill = GridBagConstraints.NONE;\n\t\t\n\t\tfinal JComboBox hourCombo = new JComboBox(new Object[]{\"1\",\"2\",\"4\",\"5\"});\n\t\thourCombo.setPreferredSize(new Dimension(100,20));\n\t\thourCombo.setSelectedItem(\"\"+Grid.gridSlice);\n\t\tgridbag.setConstraints(hourCombo, c);\n\t\tcontentPane.add(hourCombo);\n\t\t\n//\t\t Add button OK and Annuler\n\t\t\n\t\tJButton ok = new JButton(\"OK\");\n\t\tok.setPreferredSize(new Dimension(100,20));\n\t\tfinal JFrame framefinal = frame;\n\t\t\n\t\tok.addActionListener(new ActionListener(){\n\t\t\t\n\t\t\tpublic void actionPerformed(ActionEvent arg0) {\n\t\t\t\t\n\t\t\t\ttry{\n\t\t\t\tGrid.gridNbDays = auCombo.getSelectedIndex() + 1;\n\t\t\t\tGrid.gridBgHour = Integer.parseInt(bgHour.getText());\n\t\t\t\tGrid.gridEndHour = Integer.parseInt(endHour.getText());\n\t\t\t\tGrid.gridSlice = Integer.parseInt((String) (hourCombo.getSelectedItem()));\n\t\t\t\tmainframe.refreshAllTimeTable();\n\t\t\t\tframe.dispose();\n\t\t\t\t}catch(NumberFormatException e){\n\t\t\t\t\tmainframe.showError(frame,\"Paramètres saisies incorects ou manquants\");\n\t\t\t\t}\n\t\t\t\t\n\t\t\t}\n\t\t\t\n\t\t});\n\t\tc = new GridBagConstraints();\n\t\tc.anchor = GridBagConstraints.EAST;\n\t\tc.gridwidth = GridBagConstraints.RELATIVE;\n\t\tgridbag.setConstraints(ok, c);\n\t\tcontentPane.add(ok);\n\t\tJButton cancel = new JButton(\"Annuler\");\n\t\tcancel.setPreferredSize(new Dimension(100,20));\n\t\tcancel.addActionListener(new ActionListener(){\n\t\t\t\n\t\t\tpublic void actionPerformed(ActionEvent arg0) {\n\t\t\t\tframefinal.dispose();\n\t\t\t\t\n\t\t\t}\n\t\t\t\n\t\t});\n\t\tc.anchor = GridBagConstraints.WEST;\n\t\tgridbag.setConstraints(cancel, c);\n\t\tcontentPane.add(cancel);\n\t\t\n\t\t\n\t\t/*\n\t\tContainer mainpanel = frame.getContentPane();\n\t\tContainer contentPane = new Container(); \n\t\t */\n\t\tmainpanel.add(contentPane,BorderLayout.CENTER);\n\t\tJPanel southPanel = new JPanel();\n\t\tsouthPanel.setLayout(new FlowLayout());\n\t\tok.setMinimumSize(new Dimension(100,20));\n\t\tcancel.setMinimumSize(new Dimension(100,20));\n\t\tok.setPreferredSize(new Dimension(100,20));\n\t\tcancel.setPreferredSize(new Dimension(100,20));\n\t\tsouthPanel.add(ok);\n\t\tsouthPanel.add(cancel);\n\t\tmainpanel.add(southPanel,BorderLayout.SOUTH);\n\t\t\n\t\tframe.setVisible(true);\n\t}", "public static void showGUI() {\n\t\tDisplay display = Display.getDefault();\n\t\tShell shell = new Shell(display);\n\t\tPaletteComposite inst = new PaletteComposite(shell, SWT.NULL);\n\t\tPoint size = inst.getSize();\n\t\tshell.setLayout(new FillLayout());\n\t\tshell.layout();\n\t\tif(size.x == 0 && size.y == 0) {\n\t\t\tinst.pack();\n\t\t\tshell.pack();\n\t\t} else {\n\t\t\tRectangle shellBounds = shell.computeTrim(0, 0, size.x, size.y);\n\t\t\tshell.setSize(shellBounds.width, shellBounds.height);\n\t\t}\n\t\tshell.open();\n\t\twhile (!shell.isDisposed()) {\n\t\t\tif (!display.readAndDispatch())\n\t\t\t\tdisplay.sleep();\n\t\t}\n\t}", "public DebuggerWindow() {\r\n initComponents();\r\n loadConfig();\r\n runner = new hc11_thread(board);\r\n runner.start();\r\n bphandler = new debug_breakPtHandler(this,board);\r\n runner.attachBPhandler(bphandler);\r\n tblDissasm.getColumnModel().getColumn(0).setMinWidth(70);\r\n tblDissasm.getColumnModel().getColumn(0).setMaxWidth(90);\r\n tblDissasm.getColumnModel().getColumn(0).setWidth(80);\r\n tblDissasm.getColumnModel().getColumn(1).setMinWidth(120);\r\n tblDissasm.getColumnModel().getColumn(1).setMaxWidth(200);\r\n tblDissasm.getColumnModel().getColumn(1).setWidth(150);\r\n }", "public UIOscilloscopeFrame()\n {\n //set layout\n this.getContentPane().setLayout(new BorderLayout());\n //set name\n this.setTitle(\"Oscilloscope Window\");\n\n // create panels\n\n // scope\n scopepanel = new JPanel();\n scopepanel.setLayout(new GridLayout(1,1,0,1));\n // scrollpane\n jsp = new JScrollPane(scopepanel);\n // buttons\n buttonpanel = new JPanel();\n resize = new JButton(\"Resize All\");\n clear = new JButton(\"Clear All\");\n pause = new JButton(\"Pause All\");\n pause.addActionListener(this);\n clear.addActionListener(this);\n resize.addActionListener(this);\n buttonpanel.add(pause);\n buttonpanel.add(clear);\n buttonpanel.add(resize);\n\n // add panels\n this.getContentPane().add(jsp,BorderLayout.CENTER);\n // set up window closed operation\n this.setDefaultCloseOperation(JFrame.HIDE_ON_CLOSE);\n this.setSize(new Dimension(800,80));\n }", "public GUI(String title, Dimension size) {\n\t\tthis.setTitle(title);\n\t\tthis.setPreferredSize(size);\n\t\tthis.setResizable(false);\n\t\tthis.setVisible(true);\n\t\t\n\t\tGridBagLayout gridBagLayout = new GridBagLayout();\n\t\tgridBagLayout.columnWidths = new int[]{0, 0, 0, 0, 0, 0, 0, 0, 0};\n\t\tgridBagLayout.rowHeights = new int[]{0, 0};\n\t\tgridBagLayout.columnWeights = new double[]{1.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 1.0, Double.MIN_VALUE};\n\t\tgridBagLayout.rowWeights = new double[]{1.0, Double.MIN_VALUE};\n\t\tthis.getContentPane().setLayout(gridBagLayout);\t\n\t\t\n\t\tgraphics = new GPanel(Config.TABLE_DIAMETER); \n\t\t\n\t\tGridBagConstraints gbc_panel_1 = new GridBagConstraints();\n\t\tgbc_panel_1.gridwidth = 10;\n\t\tgbc_panel_1.insets = new Insets(0, 0, 0, 5);\n\t\tgbc_panel_1.fill = GridBagConstraints.BOTH;\n\t\tgbc_panel_1.gridx = 0;\n\t\tgbc_panel_1.gridy = 0;\n\t\tthis.getContentPane().add(graphics, gbc_panel_1);\n\t\t\n\t\taddMenus(gridBagLayout);\n\t\taddRightPane(gridBagLayout);\n\t\t\n\t\tthis.pack();\n\t\tthis.addWindowListener(new java.awt.event.WindowAdapter() {\n\t\t @Override\n\t\t public void windowClosing(java.awt.event.WindowEvent windowEvent) {\n\t\t \t//close threads\n\t\t System.exit(0);\n\t\t }\n\t\t});\n\t\t\n\t\tJOptionPane.showMessageDialog(this, \n\t\t\t\t\"Set the amount of Philosophers and then click start.\", \"Welcome\",\n\t\t\t\tJOptionPane.INFORMATION_MESSAGE);\n\t}", "public static void show() \r\n\t{\r\n\t\tJPanel panel = Window.getCleanContentPane();\r\n\t\t\r\n\t\tJPanel panel_1 = new JPanel();\r\n\t\tpanel_1.setBackground(SystemColor.inactiveCaption);\r\n\t\tpanel_1.setBounds(-11, 0, 795, 36);\r\n\t\tpanel.add(panel_1);\r\n\t\t\r\n\t\tJLabel lblNewLabel = new JLabel(\"Over Surgery System\");\r\n\t\tpanel_1.add(lblNewLabel);\r\n\t\tlblNewLabel.setFont(new Font(\"Tahoma\", Font.PLAIN, 20));\r\n\t\t\r\n\t\tJTable table = new JTable();\r\n\t\ttable.setBounds(25, 130, 726, 120);\r\n\t\tpanel.add(table);\r\n\t\t\r\n\t\tJLabel lblNewLabel1 = new JLabel(\"General Practictioner ID:\");\r\n\t\tlblNewLabel1.setBounds(25, 73, 145, 34);\r\n\t\tpanel.add(lblNewLabel1);\r\n\t\t\r\n\t\tJTextField textField = new JTextField();\r\n\t\ttextField.setBounds(218, 77, 172, 27);\r\n\t\tpanel.add(textField);\r\n\t\ttextField.setColumns(10);\r\n\t\t\r\n\t\tJButton btnNewButton = new JButton(\"Ok\");\r\n\t\tbtnNewButton.setBounds(440, 79, 57, 23);\r\n\t\tpanel.add(btnNewButton);\r\n\t\t\r\n\t\tJLabel lblNurseAvability = new JLabel(\"Nurse ID:\");\r\n\t\tlblNurseAvability.setBounds(25, 326, 112, 14);\r\n\t\tpanel.add(lblNurseAvability);\r\n\t\t\r\n\t\tJTextField textField_1 = new JTextField();\r\n\t\ttextField_1.setColumns(10);\r\n\t\ttextField_1.setBounds(233, 326, 172, 27);\r\n\t\tpanel.add(textField_1);\r\n\t\t\r\n\t\t\r\n\t\tJButton button = new JButton(\"Ok\");\r\n\t\tbutton.setBounds(440, 328, 57, 23);\r\n\t\tpanel.add(button);\r\n\t\t\r\n\t\tJTable table_1 = new JTable();\r\n\t\ttable_1.setBounds(25, 388, 726, 120);\r\n\t\tpanel.add(table_1);\r\n\t}", "public NetChessBoardFrame() {\r\n\t\tthis.setTitle(\"五子棋\");// 设置标题\r\n\t\tthis.setSize(750, 635);// 设置窗体大小\r\n\t\tthis.setLocation((width - 750) / 2, (height - 650) / 2);// 窗体居中显示\r\n\t\tthis.setResizable(false); // 窗体大小不可变\r\n\t\tthis.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);// 窗体关闭方式\r\n\t\tthis.setCursor(Cursor.HAND_CURSOR);// 手状光标类型\r\n\t\t// this.setVisible(true);// 窗体可见\r\n\t\tthis.getLayeredPane().setLayout(null);\r\n\t\tthis.setIconImage(ttImage);\r\n\r\n\t\tMyMouseListener mml = new MyMouseListener();\r\n\t\tcb = new ChessBoard();\r\n\t\tcontrol = new BoardControl();\r\n\t\tcontrol.setPreferredSize(new Dimension(135, 635));\r\n\t\tthis.getContentPane().add(control, BorderLayout.EAST);\r\n\t\tcontrol.setVisible(true);\r\n\t\tcb.addMouseListener(mml);\r\n\t}", "private void customize() {\r\n panel.setSize(new Dimension(width, height));\r\n panel.setLayout(new BorderLayout());\r\n }", "public void paint(Graphics window)\n\t{\n\t\twindow.setColor(Color.WHITE);\n\t\twindow.fillRect(0,0,getWidth(), getHeight());\n\t\twindow.setColor(Color.BLUE);\n\t\twindow.drawRect(20,20,getWidth()-40,getHeight()-40);\n\t\twindow.setFont(new Font(\"TAHOMA\",Font.BOLD,18));\n\t\twindow.drawString(\"CREATE YOUR OWN SHAPE!\",40,40);\n\n\n\t\tColor[] col0 = {Color.CYAN, Color.RED, Color.GREEN};\n\t\tCustomShape cs0 = new CustomShape(500, 200, 50, 200, col0);\n\t\tcs0.draw(window);\n\t\t\n\t\tColor[] col1 = {Color.BLACK, Color.PINK, Color.DARK_GRAY};\n\t\tCustomShape cs1 = new CustomShape(180, 450, 200, 70, col1);\n\t\tcs1.draw(window);\n\t\t\n\t\tColor[] col2 = {Color.MAGENTA, Color.ORANGE, Color.YELLOW};\n\t\tCustomShape cs2 = new CustomShape(300, 120, 250, 250, col2);\n\t\tcs2.draw(window);\n\t}", "public void med2() {\n DrawingPanel win = new DrawingPanel(WIDTH, HEIGHT);\n java.awt.Graphics g = win.getGraphics();\n win.setTitle(\"Med. 2\");\n win.setLocation(600, 10);\n //This is as far as I could get in the 30 minutes\n //I had after work. I usually do all the work for \n //this class on the weekend.\n }", "protected void doResize() {\r\n\t\tif (renderer.surface == null) {\r\n\t\t\tdoNew();\r\n\t\t\treturn;\r\n\t\t}\r\n\t\tNewResizeDialog dlg = new NewResizeDialog(labels, false);\r\n\t\tdlg.widthText.setText(\"\" + renderer.surface.width);\r\n\t\tdlg.heightText.setText(\"\" + renderer.surface.height);\r\n\t\tdlg.setLocationRelativeTo(this);\r\n\t\tdlg.setVisible(true);\r\n\t\tif (dlg.success) {\r\n\t\t\trenderer.surface.width = dlg.width;\r\n\t\t\trenderer.surface.height = dlg.height;\r\n\t\t\trenderer.surface.computeRenderingLocations();\r\n\t\t}\r\n\t}", "private void $$$setupUI$$$() {\n contentPane = new JPanel();\n contentPane.setLayout(new GridLayoutManager(2, 1, new Insets(10, 10, 10, 10), -1, -1));\n final JPanel panel1 = new JPanel();\n panel1.setLayout(new GridLayoutManager(1, 2, new Insets(0, 0, 0, 0), -1, -1));\n contentPane.add(panel1, new GridConstraints(1, 0, 1, 1, GridConstraints.ANCHOR_CENTER, GridConstraints.FILL_BOTH, GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW, 1, new Dimension(100, 20), new Dimension(100, 20), new Dimension(100, 20), 0, false));\n final Spacer spacer1 = new Spacer();\n panel1.add(spacer1, new GridConstraints(0, 0, 1, 1, GridConstraints.ANCHOR_CENTER, GridConstraints.FILL_HORIZONTAL, GridConstraints.SIZEPOLICY_WANT_GROW, 1, null, null, null, 0, false));\n final JPanel panel2 = new JPanel();\n panel2.setLayout(new GridLayoutManager(1, 1, new Insets(0, 0, 0, 0), -1, -1));\n panel1.add(panel2, new GridConstraints(0, 1, 1, 1, GridConstraints.ANCHOR_CENTER, GridConstraints.FILL_BOTH, GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW, GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW, null, null, null, 0, false));\n buttonClose = new JButton();\n buttonClose.setText(\"Close\");\n panel2.add(buttonClose, new GridConstraints(0, 0, 1, 1, GridConstraints.ANCHOR_CENTER, GridConstraints.FILL_HORIZONTAL, GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW, GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false));\n final JPanel panel3 = new JPanel();\n panel3.setLayout(new GridLayoutManager(1, 1, new Insets(0, 0, 0, 0), -1, -1));\n contentPane.add(panel3, new GridConstraints(0, 0, 1, 1, GridConstraints.ANCHOR_CENTER, GridConstraints.FILL_BOTH, GridConstraints.SIZEPOLICY_WANT_GROW, GridConstraints.SIZEPOLICY_WANT_GROW, null, null, null, 0, false));\n messageLabel = new JLabel();\n messageLabel.setText(\"\");\n panel3.add(messageLabel, new GridConstraints(0, 0, 1, 1, GridConstraints.ANCHOR_WEST, GridConstraints.FILL_NONE, GridConstraints.SIZEPOLICY_FIXED, GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false));\n }", "public void WZQFrame() {\n\t\tJFrame jf = new javax.swing.JFrame();\n\t\tjf.setTitle(\"五子棋\");\n\t\tjf.setDefaultCloseOperation(3);\n\t\tjf.setSize(1246, 1080);\n\t\tjf.setLocationRelativeTo(null);\n\t\tjf.setResizable(false);\n \n\t\tjf.setLayout(new FlowLayout());\n\t\tthis.setLayout(new FlowLayout());\n \n\t\tthis.setPreferredSize(new Dimension(1030, 1080));\n \n\t\t// this.setBackground(Color.CYAN);\n\t\t// 把面板对象添加到窗体上\n\t\tjf.add(this);\n\t\tJPanel jp1 = new JPanel();\n\t\tjp1.setPreferredSize(new Dimension(200, 1080));\n\t\tjp1.setLayout(new FlowLayout());\n\t\tjf.add(jp1);\n\t\tLoginListener ll = new LoginListener();\n\t\tString[] str = { \"悔棋\", \"重新开始\" };\n\t\tfor (int i = 0; i < str.length; i++) {\n\t\t\tJButton jbu1 = new JButton(str[i]);\n\t\t\tjbu1.setPreferredSize(new Dimension(150, 80));\n\t\t\tjbu1.setFont(new Font(\"楷体\", Font.BOLD,20));//设置字体\n\t\t\tjp1.add(jbu1);\n\t\t\tjbu1.addActionListener(ll);\n\t\t}\n\t\t\n\t\tjf.setVisible(true);\n \n\t\tGraphics g = this.getGraphics();\n \n\t\tthis.addMouseListener(ll);\n \n\t\tll.setG(g);\n\t\tll.setU(this);\n\t}", "private void settings() {\n\t\tthis.setVisible(true);\n\t\tthis.setSize(800,200);\n\t}" ]
[ "0.6712358", "0.66215724", "0.65046406", "0.624728", "0.61908853", "0.61856705", "0.6168563", "0.6086266", "0.60791904", "0.5931132", "0.5928215", "0.59244585", "0.59151477", "0.59132135", "0.5911158", "0.59108776", "0.5863703", "0.5854085", "0.58349043", "0.58325374", "0.58282924", "0.58169335", "0.58101296", "0.57748604", "0.5770488", "0.5763838", "0.5749569", "0.57405573", "0.57383645", "0.57336515", "0.5730648", "0.5721411", "0.57160157", "0.5708226", "0.57021177", "0.5686465", "0.56733984", "0.56637573", "0.56631225", "0.56518793", "0.56517154", "0.56472176", "0.56367254", "0.5633799", "0.5633061", "0.56315404", "0.56272763", "0.56266034", "0.56174856", "0.56168765", "0.5615273", "0.56149274", "0.56036276", "0.5594298", "0.5590001", "0.55875486", "0.5585643", "0.55767536", "0.55665547", "0.5566177", "0.55660194", "0.5563615", "0.5557573", "0.55449754", "0.5542049", "0.5540679", "0.5539694", "0.5536494", "0.55304873", "0.5525358", "0.5512152", "0.55091554", "0.550793", "0.5507348", "0.5501536", "0.54954505", "0.5490211", "0.54856706", "0.5480163", "0.54764724", "0.54743034", "0.546862", "0.54679114", "0.5467204", "0.54662913", "0.546258", "0.54614127", "0.54570776", "0.5456638", "0.54511863", "0.5442488", "0.5437887", "0.5435929", "0.5434527", "0.5432152", "0.5431171", "0.54311234", "0.5429207", "0.54275256", "0.5426113" ]
0.6540441
2
/ Main method to initialize a matrix and display it.
public static void main(String[] args) { int[][] grid = {{0,1,0,1,1}, {1,2,0,0,1}, {1,1,0,1,2}}; displayGrid(grid); int[][] grid1 = {{0,1,0,1,1,0,1,1}, {1,2,0,0,1,2,2,1}, {1,1,0,1,2,1,1,2}}; displayGrid(grid1); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public static void createAndShowMatrix() {\n JFrame frame = new JFrame(\"Results Matrix\");\n frame.setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE);\n frame.getContentPane().add(new ResultsMatrix().getRootPanel());\n frame.pack();\n frame.setVisible(true);\n }", "public static void main(String[] args) {\n\t\tint[][] m = Method.initRandomMatrix(5, 5, 20);\r\n\t\tMethod.print(m);\r\n\t\tSystem.out.println(\"Вариант отображения согласно заданию:\");\r\n\t\tfor (int i = 0; i < m.length; i++) {\r\n\t\t\tif (i % 2 == 0) {\r\n\t\t\t\tfor (int j = m[i].length - 1; j >= 0; j--) {\r\n\t\t\t\t\tSystem.out.print(m[i][j] + \"\\t\");\r\n\t\t\t\t}\r\n\t\t\t} else {\r\n\t\t\t\tfor (int j = 0; j < m[i].length; j++) {\r\n\t\t\t\t\tSystem.out.print(m[i][j] + \"\\t\");\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tSystem.out.println();\r\n\t\t}\r\n\r\n\t}", "public static void main(String[] args) {\n Scanner in = new Scanner(System.in);\n int n;\n n = in.nextInt();\n \n char[][] array = construct_matrix(n);\n \n display_matrix(array,n);\n }", "public static void main(String[] args) \n {\n int[][] array = { \n { 1, 2, 3 }, \n { 4, 5, 6 }, \n { 7, 8, 9 } \n };\n\n // Create and run the gui\n Gui11 gui = new Gui11();\n gui.showGui();\n gui.printMatrix(array);\n }", "public static void main(String[] args) {\n\t\tint[][] a = {{1,2}, {5,3}};\n\t\tint[][] b = {{3,2}, {4,5}};\n\t\tint[][] c = {{1,2}, {4,3}};\n\t\tint[][] d = {{1,2,3}, {4, 5, 6}};\n\t\tint[][] e = {{1, 4}, {2, 5}, {3,6}};\n\n\n\t\t//create new matrices using multidimensional arrays to get a size\n\t\tMatrix m = new Matrix(a);\n\t\tMatrix m2 = new Matrix(b);\n\t\tMatrix m3 = new Matrix(c);\n\t\tMatrix m4 = new Matrix(d);\n\t\tMatrix m5 = new Matrix(e);\n\n\n\n\t\t//Example of matrix addition\n\t\tSystem.out.println(\"Example of Matrix addition using the following matrices:\");\n\t\tSystem.out.println(m.toString());\n\t\tSystem.out.println(m2.toString() + \"\\nSUM:\");\n\t\tSystem.out.println(m.add(m2));\n\t\t\n\t\t//Example of matrix subtraction\n\t\tSystem.out.println(\"Example of Matrix subtraction using the following matrices:\");\n\t\tSystem.out.println(m.toString());\n\t\tSystem.out.println(m2.toString() + \"\\nDIFFERENCE:\");\n\t\tSystem.out.println(m.subt(m2));\n\n\t\t//Example of matrix multiplication\n\t\tSystem.out.println(\"Example of Matrix multiplication using the following matrices:\");\n\t\tSystem.out.println(m3.toString());\n\t\tSystem.out.println(m2.toString() + \"\\nPRODUCT:\");\n\t\tSystem.out.println(m2.mult(m3));\n\t\t\n\t\t//Example of scalar multiplication\n\t\tSystem.out.println(\"Example of scalar multiplication using the following matrices with a scalar value of 2:\");\n\t\tSystem.out.println(m3.toString() + \"\\nSCALAR PRODUCT:\");\n\t\tSystem.out.println(m3.scalarMult(2));\n\t\t\n\t\t//Example of transpose \n\t\tSystem.out.println(\"Example of transpose using the following matrix:\");\n\t\tSystem.out.println(m.toString() + \"\\nTRANSPOSE:\");\n\t\tSystem.out.println(m.transpose());\n\t\t\n\t\t//Example of transpose \n\t\tSystem.out.println(\"Example of transpose using the following matrix:\");\n\t\tSystem.out.println(m4.toString() + \"\\nTRANSPOSE:\");\n\t\tSystem.out.println(m4.transpose());\n\t\t\n\t\t//Example of equality \n\t\tSystem.out.println(\"Example of equality using the following matrices:\");\n\t\tSystem.out.println(m.toString());\n\t\tSystem.out.println(m.toString() + \"\\nEQUALITY:\");\n\t\tSystem.out.println(m.equality(m));\n\t\t\n\t\t//Example of equality \n\t\tSystem.out.println(\"\\nExample of equality using the following matrices:\");\n\t\tSystem.out.println(m4.toString());\n\t\tSystem.out.println(m5.toString() + \"\\nEQUALITY:\");\n\t\tSystem.out.println(m4.equality(m5));\n\n\t}", "public void printMatriz( )\n {\n //definir dados\n int lin;\n int col;\n int i;\n int j;\n\n //verificar se matriz e' valida\n if( table == null )\n {\n IO.println(\"ERRO: Matriz invalida. \" );\n } //end\n else\n {\n //obter dimensoes da matriz\n lin = lines();\n col = columns();\n IO.println(\"Matriz com \"+lin+\"x\"+col+\" posicoes.\");\n //pecorrer e mostrar posicoes da matriz\n for(i = 0; i < lin; i++)\n {\n for(j = 0; j < col; j++)\n {\n IO.print(\"\\t\"+table[ i ][ j ]);\n } //end repetir\n IO.println( );\n } //end repetir\n } //end se\n }", "public static Matrix buildMatrixFromCommandLine (){\n\n int M = 0;\n int N = 0;\n double[][] data;\n\n M = new Double(getDoubleWithMessage(\"Enter rows number: \")).intValue();\n N = new Double(getDoubleWithMessage(\"Enter columns number: \")).intValue();\n System.out.println(\"You have matrix: \" + M + \"x\" + N);\n\n data = new double[M][N];\n\n for (int i = 0; i < M; i++){\n System.out.println(\"Row: \" + i);\n for (int j = 0; j < N; j++){\n data[i][j] = getDoubleWithMessage(\"Column: \" + j);\n }\n }\n return new Matrix(data);\n }", "public static void main(String[] args) throws IOException {\n\n\t\t\n\t\tdouble[] columnwise = {1.,2.,3.,4.,5.,6.,7.,8.,9.,10.,11.,12.};\n\t\tdouble[] condmat = {1.,3.,7.,9.};\n\t\tint[] matrixDimension = new int[10]; // dont except to ever use more than 4 cells. would by 99x99\n\n\tString[] inputARGNull = null ;\n\t\tArrayList<Integer> inputTestData = new ArrayList<>(Arrays.asList(11,2,3,6,11,18,45,88));\n\n//\t\tSystem.out.println();\n//\t\tSystem.out.println(inputTestData.toString());\n//\t\tSystem.out.println(\"Test Running Class: \" +this.getClass() ) ;\t\n//\t\tMatrix testRunMatrix = new Matrix(2, 3, inputTestData );\n\n\t\tMatrix testRunMatrix = new Matrix();\n\t\ttestRunMatrix.setName(\"testRunMatrix\");\n\t\ttestRunMatrix.displayCompact();\n//\t\tclearScreen();\n\n\t\tMatrix firstRunMatrixParams = new Matrix(3,3, inputTestData);\n\t\tfirstRunMatrixParams.setName(\"firstRunMatrixParams\");\n\t\tfirstRunMatrixParams.displayCompact();\n//\t\tclearScreen();\n\t\t\n\t\tMatrix secondRunMatrixParams = new Matrix(3,3, columnwise); // or condmat\n\t\tsecondRunMatrixParams.setName(\"secondRunMatrixParams\");\n\t\tsecondRunMatrixParams.displayCompact();\n//\t\tclearScreen();\n\t\t\n\t//\tfirstRunMatrixParams.displayDeepString();\n\t//\tsecondRunMatrixParams.displayDeepString();\n\t\tmatrixDimension[0]=2;\n\t\tmatrixDimension[1]=3;\n\t\n\t\tMatrix outOfSeqTestMatrix = new Matrix(matrixDimension, columnwise);\n\t\tsecondRunMatrixParams.setName(\"outOfSeqTestMatrix\");\n\t\tsecondRunMatrixParams.displayCompact();\n\t\t\n\t\tMatrix addResult = firstRunMatrixParams.Add(secondRunMatrixParams);\n\t\taddResult.setName(\"addResult\");\n\t\t\n\t\taddResult.displayCompact();\n//\t\tclearScreen();\n\t\t\n//\t\taddResult = addResult.Multiply((22/7));\n\t\taddResult = addResult.Multiply(3.623);\n\t\taddResult.displayMore();\n\t\t\n\t\t\n\t\tString[] testInput1 = new String[]{\"-c\",\"5x4\",\"12\", \"32\", \"43\", \"44\", \"5\",\"5\",\"5\",\"4\",\"4\",\".999999999\",\"0\",\"0\",\"0\",\"9\",\"4\",\"2.71826\",\"3.14159\",\"33\",\"11\",\"0.1136\",\"888\",\"7\",\"6\",\"5\"};\n\t\tInputStringObj myTestCase = new InputStringObj(\"-c\", testInput1);\n\t\tInputNumericObj myNumTest = new InputNumericObj(myTestCase);\n\t\t\n\t\tSystem.out.println(\"And Now a Matrix from a Numeric Object\");\n\n\t\tMatrix numObjBasedMatrix = new Matrix(myNumTest,\"TestMatrix.java_string\");\n\t\tnumObjBasedMatrix.setName(\"numObjBasedMatrix\");\n\t\tnumObjBasedMatrix.displayCompact();\n\tSystem.out.println(\"\");\n\tSystem.out.println(\"\");\n\t\tnumObjBasedMatrix.displayMore();\n\t\t\n\t\t\n//\t\tclearScreen();\n\t\t\n\t}", "public void displayMatrix(){\r\n\t\t\r\n\t\tfor (int i = 0; i < head.getOrder(); i++) {\r\n\t\t\tElementNode e = head.gethead();\r\n\t\t\tif( i > 0){\r\n\t\t\t\tfor (int j = 0; j <= i-1; j++) {\r\n\t\t\t\t\te = e.getNextRow();\r\n\t\t\t\t}\r\n\t\t\t}\t\r\n\t\t\tfor (int j = 0; j < head.getOrder(); j++) {\r\n\t\t\t\tSystem.out.print( e.getData() + \" \");\r\n\t\t\t\te = e.getNextColumn();\r\n\t\t\t}\r\n\t\t\tSystem.out.print(\"\\n\");\r\n\t\t}\r\n\t}", "public static void main(String[] args) {\n int[][] matrix = {{1, 2, 3, 4}, {5, 6, 7, 8}, {9, 10, 11, 12}};\n printMatrix(matrix);\n }", "public static void main(String[] args) {\r\n\t\t// TODO Auto-generated method stub\r\n\t\tArrayList<ArrayList> matrix = new ArrayList<ArrayList>();\r\n\r\n\t\tfor (int i = 0; i <= 10; i++) {\r\n\t\t\tArrayList<Integer> row = new ArrayList<Integer>();\r\n\r\n\t\t\tfor (int j = 0; j <= 10; j++)\r\n\t\t\t\trow.add(i * j);\r\n\r\n\t\t\tmatrix.add(row);\r\n\r\n\t\t}\r\n\t\tfor (ArrayList ar : matrix)\r\n\t\t\tSystem.out.println(ar);\r\n\t}", "public Matrix() {\n\tmatrix = new Object[DEFAULT_SIZE][DEFAULT_SIZE];\n }", "public static void main(String[] args) {\n\t\t\tArrayList<String> inter = matrix(0,0,2,2);\r\n\t\t\tSystem.out.println(inter);\r\n\t\t}", "public Matrix() {\n matrix = new double[DEFAULT_SIZE][DEFAULT_SIZE];\n }", "public static void main(String[] args) {\n\t\tint matrix[][] = new int [2][3];\r\n\t\t\r\n\t\tmatrix[0][0]=00;\r\n\t\tmatrix[0][1]=01;\r\n\t\tmatrix[0][2]=02;\r\n\t\tmatrix[1][0]=10;\r\n\t\tmatrix[1][1]=11;\r\n\t\tmatrix[1][2]=12;\r\n\t\t\r\n\t\t//i para las filas, j para las columnas\r\n\t\tfor(int i=0; i<2 ; i++){ \r\n\t\t\tSystem.out.println();\r\n\t\t\tfor(int j=0; j<3; j++){\r\n\t\t\t\tSystem.out.print(matrix[i][j]+\" \");\r\n\t\t\t}\r\n\t\t\t\r\n\t\t}\r\n\t\t\r\n\t}", "Matrix(){\n matrixVar = new double[1][1];\n rows = 1;\n columns = 1;\n }", "public static void main(String[] args) {\n int[] miMatriz = new int[5];\n\n //Primera forma de agregar elementos a una matriz (agregar cada elemento en el indice indicado)\n miMatriz[0] = 1;\n miMatriz[1] = 2;\n miMatriz[2] = 3;\n miMatriz[3] = 4;\n miMatriz[4] = 5;\n\n /* Segunda forma de declarar una matriz\n Esta lo que hace es declarar la matriz e introducir los elementos \n en una sola línea\n */\n int[] miMatriz2 = {1, 2, 3, 4, 5};\n\n // Recorrer las matrices con un for normal\n for (int i = 0; i < miMatriz.length; i++) {\n System.out.println(\"Posicion matriz 1: \" + i + \" con un valor de \" + miMatriz[i]);\n }\n System.out.println();\n for (int i = 0; i < miMatriz2.length; i++) {\n System.out.println(\"Posicion matriz 2: \" + i + \" con un valor de \" + miMatriz2[i]);\n }\n }", "public static void printMatrix()\n {\n for(int i = 0; i < n; i++)\n {\n System.out.println();\n for(int j = 0; j < n; j++)\n {\n System.out.print(connectMatrix[i][j] + \" \");\n }\n }\n }", "public Matrix33() {\r\n // empty\r\n }", "@Test\n public void testPrintMatrix() {\n System.out.println(\"printMatrix\");\n Matrix matrix = null;\n utilsHill.printMatrix(matrix);\n // TODO review the generated test code and remove the default call to fail.\n fail(\"The test case is a prototype.\");\n }", "public static void display(int[][] matrix){\n for (int i = 0; i < matrix.length; i++) {\n for (int j = 0; j < matrix.length; j++) {\n System.out.print(matrix[i][j] + \" \");\n }\n System.out.println(\"\");\n }\n }", "public static void main(String[] args) {\n\t\t\r\n\t\tint [][] matrix={\r\n\t\t\t\t{10,15,2,76,-9},\r\n\t\t\t\t{85,-22,4,35,99},\r\n\t\t\t\t{64,68,31,7,-3},\r\n\t\t\t\t{1,53,94,33,8}\r\n\t\t};\r\n\t\t\r\n\t\tfor(int[] fila:matrix){\r\n\t\t\tSystem.out.println();//le da salto de linea cuando termina cada fila\r\n\t\t\tfor (int z:fila){\r\n\t\t\t\tSystem.out.print(z + \" \");\r\n\t\t\t}\r\n\t\t}\r\n\t\t/*int [][] matrix= new int[4][5];//primera dimension, segunda dimension\r\n\t\t\r\n\t\tmatrix [0][0]=5;\r\n\t\tmatrix [0][1]=18;\r\n\t\tmatrix [0][2]=29;\r\n\t\tmatrix [0][3]=80;\r\n\t\tmatrix [0][4]=3;\r\n\t\t\r\n\t\tmatrix [1][0]=-9;\r\n\t\tmatrix [1][1]=71;\r\n\t\tmatrix [1][2]=32;\r\n\t\tmatrix [1][3]=-24;\r\n\t\tmatrix [1][4]=62;\r\n\t\t\r\n\t\tmatrix [2][0]=54;\r\n\t\tmatrix [2][1]=22;\r\n\t\tmatrix [2][2]=-39;\r\n\t\tmatrix [2][3]=1;\r\n\t\tmatrix [2][4]=97;\r\n\t\t\r\n\t\tmatrix [3][0]=74;\r\n\t\tmatrix [3][1]=43;\r\n\t\tmatrix [3][2]=39;\r\n\t\tmatrix [3][3]=96;\r\n\t\tmatrix [3][4]=-63;\r\n\r\n\t\tfor (int i=0; i<4; i++){\r\n\t\t\tSystem.out.println();\r\n\t\t\tfor (int j=0; j<5; j++){\r\n\t\t\t\tSystem.out.print(matrix[i][j] + \" \");\r\n\t\t\t}\r\n\t\t}*/\r\n\t}", "protected SimpleMatrix() {}", "public static void main(String[] args) {\n\t\tint row = 2;\n\t\tint column = 3;\n\t\tint matrix [][] = new int [row][column];\n\t\tmatrix[0][0] = 100;\n\t\tmatrix[0][1] = 200;\n\t\tmatrix[0][2] = 300;\n\t\tmatrix[1][0] = 101;\n\t\tmatrix[1][1] = 202;\n\t\tmatrix[1][2] = 303;\n\t\t\n\t\tfillMatrix(matrix, row, column);\n\t\tprintMatrix(matrix, row, column);\n\t\t\n\t\tint transposed[][] = new int [column][row];\n\t\ttranspose(matrix, row, column, transposed);\n\t\tprintMatrix(transposed, column, row);\n\t\t\n\t\t\n\t}", "Matrix(int rows, int columns) {\n try {\n if (rows < 1 || columns < 1) {\n throw zeroSize;\n }\n this.rows = rows;\n this.columns = columns;\n matrix = new int[rows][columns];\n\n for (int rw = 0; rw < rows; rw++) {\n for (int col = 0; col < columns; col++) {\n matrix[rw][col] = (int) Math.floor(Math.random() * 100);\n }\n }\n }\n catch (Throwable zeroSize) {\n zeroSize.printStackTrace();\n }\n\n }", "public static void main(String[] args) {\n\t\tint[] a = new int[] {1,2,3,4};\n\t\tint [][] b = new int[2][2];\n\t\tint [][] c = new int[2][2];\n\t\tfor(int i=0;i<2;i++)\n\t\t\tfor(int j=0;j<2;j++) {\n\t\t\t\tb[i][j]=1;\n\t\t c[i][j]=0;\n\t\t\t}\n\t\tSystem.out.println(sqrt(15.9));\n\t\tSystem.out.println(a);\n\t\tSystem.out.println(matrix(b,c));\n\t}", "public static void main(String[] args) {\n\t\tMatrixThree MT = new MatrixThree();\n\t\tMT.Create();\n\t\tMT.display();\n\n\t}", "public void print() {\n for (int i = 0; i < matrix.length; i++) {\n for (int j = 0; j < matrix[i].length; j++) {\n System.out.print(matrix[i][j] + \" \");\n }\n System.out.println();\n }\n }", "void iniciaMatriz() {\r\n int i, j;\r\n for (i = 0; i < 5; i++) {\r\n for (j = 0; j <= i; j++) {\r\n if (j <= i) {\r\n m[i][j] = 1;\r\n } else {\r\n m[i][j] = 0;\r\n }\r\n }\r\n }\r\n m[0][1] = m[2][3] = 1;\r\n\r\n// Para los parentesis \r\n for (j = 0; j < 7; j++) {\r\n m[5][j] = 0;\r\n m[j][5] = 0;\r\n m[j][6] = 1;\r\n }\r\n m[5][6] = 0; // Porque el m[5][6] quedo en 1.\r\n \r\n for(int x=0; x<7; x++){\r\n for(int y=0; y<7; y++){\r\n // System.out.print(\" \"+m[x][y]);\r\n }\r\n //System.out.println(\"\");\r\n }\r\n \r\n }", "public void display(){\n for(int i=0;i<N;i++){\n for(int j=0;j<N;j++)\n System.out.print(adj_matrix[i][j]+\" \");\n System.out.println();\n }\n }", "public static void main(String[] args) {\n Scanner input = new Scanner(System.in);\n System.out.println(\"Enter n: \");\n int n = input.nextInt();\n printMatrix(n);\n }", "public static void main(String[] args) {\n\n\t\tint[][] matrix = {{11,12,13,14},\n\t\t\t\t \t\t {15, 0,17,18},\n\t\t\t\t \t\t {19,20, 0,22},\n\t\t\t\t \t\t {23,24,25,26}\n\t\t\t\t};\n\n\t\tCTCI_1_8_1 a = new CTCI_1_8_1();\n\n\t\tSystem.out.println(\"Matrix before set Zeros\");\n\t\tfor(int i=0;i<matrix.length;i++) {\n\t\t\tfor(int j=0;j<matrix.length;j++) {\n\t\t\t\tSystem.out.print(matrix[i][j] + \" \");\n\t\t\t}\n\t\t\tSystem.out.println();\n\t\t}\n\n\t\tSystem.out.println();\n\t\tSystem.out.println(\"Matrix after 90 degree rotation\");\n\t\t\n\t\ta.setZeros(matrix);\n\n\t\tfor(int i=0;i<matrix.length;i++) {\n\t\t\tfor(int j=0;j<matrix.length;j++) {\n\t\t\t\tSystem.out.print(matrix[i][j] + \" \");\n\t\t\t}\n\t\t\tSystem.out.println();\n\t\t}\n\t\t\n\t\t\n\t}", "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} else {\n\t\t\t\t\tSystem.out.printf(\" %.1f \", C[i][j]);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tSystem.out.println(\"End of matrix.\");\n\t\t\n\t}", "public void ConceptosMatrices() {\n int[][] maX={{5,6,6},\n {5,6,2},\n {5,12,2},\n {5,6,2}};\n //Obtener el tamaño de la fila de la matriz maX\n System.out.println(\"Tamaño en fila matriz maX=\"+maX.length);\n //Obtener el tamaño de la columna de la matriz maX\n System.out.println(\"Tamaño en fila matriz maX=\"+maX[0].length);\n System.out.println(\"Mostrar el valor 12 de la matriz maX=\"+maX[2][1]);\n //Cambiar el elemento 12 de la matriz maX por 16\n maX[2][1]=16;\n Scanner sc=new Scanner(System.in);\n System.out.println(\"Ingrese un valor en los indices 2,2\");\n maX[2][2]=sc.nextInt();\n \n System.out.println(\"Defina el indice para fila:\");\n int iFx=sc.nextInt(); \n int iCx=sc.nextInt(); \n System.out.println(\"Ingrese un valor en los indices \"+iFx+\", \"+iCx+\":\");\n maX[iFx][iCx]=sc.nextInt(); \n \n imprimirMatriz(maX);\n \n //defenir matrices sin dimensiones\n int[][] matrizN;\n //definiendo dimensiones a una matriz\n System.out.println(\"Ingrese la dimension en fila para la MatrizN=\");\n int inFi=sc.nextInt();\n System.out.println(\"Ingrese la dimension en columna para la MatrizN=\");\n int inCo=sc.nextInt();\n matrizN=new int[inFi][inCo]; \n int vi=0;\n //Rellenando una matriz con una serie de numeros\n for (int f = 0; f < matrizN.length; f++) {\n for (int c = 0; c < matrizN[0].length; c++) {\n System.out.println(\"Ingrese un valor en matrizN[\"+f+\"][\"+c+\"]:=\");\n matrizN[f][c]=sc.nextInt();\n vi=vi+2;\n } \n } \n System.out.println(\"la nueva matrizN es de: \"+matrizN.length+\"x\"+matrizN[0].length);\n imprimirMatriz(matrizN); \n\n }", "public void printLayout() {\n\n for (int i = 0; i < 5; i++) {\n for (int j = 0; j < 4; j++) {\n System.out.print(matrix[i][j] + \" \");\n\n }\n System.out.println(\"\");\n }\n }", "public static void main(String[] args) {\n\r\n\t\tMatrices1 matrix = new Matrices1(10, 3);\r\n\t\tMatrices1 matrix2 = new Matrices1(3, 1);\r\n\t\t\r\n\r\n\t\tmatrix.initialize(matrix.array);\r\n\t\tmatrix2.initialize(matrix2.array);\r\n\t\t\r\n\t\tdouble [][]output=Matrices1.matrixProduct(matrix.array, matrix2.array, matrix.row1, matrix2.column1, matrix.column1);\r\n\t\tfor (int i = 0; i < matrix.row1; i++) {\r\n\t\t\tfor (int j = 0; j < matrix2.column1; j++) {\r\n\t\t\t\tSystem.out.println(output[i][j]);\r\n\t\t\t}//end of forloop\r\n\t\t}//end of forloop\r\n\t}", "public void print() {\n mat.print();\n }", "static void showMatrix()\n {\n String sGameField = \"Game field: \\n\";\n for (String [] row : sField) \n {\n for (String val : row) \n {\n sGameField += \" \" + val;\n }\n sGameField += \"\\n\";\n }\n System.out.println(sGameField);\n }", "public static void main(String[] args) {\n\t// write your code here\n int [] [] matrix = {{1,2,8,4}, {5,0,7,8}, {3,4,0,1}};\n zeroMatrix(matrix);\n }", "@Before\n public void setUp() throws Exception {\n myM = new Matrix();\n /** matrix1 = new int[4][4];\n for (int i = 0; i < matrix1.length; i++) {\n for (int j = 0; j < matrix1[0].length; j++) {\n if( i == j) {\n matrix1[i][j] = 1;\n }\n }\n }\n matrix2 = new int[6][6];\n for (int i = 0; i < matrix2.length; i++) {\n for (int j = 0; j < matrix2[0].length; j++) {\n matrix2[i][j] = i;\n }\n }\n matrix3 = new int[3][4];\n for (int i = 0; i < matrix3.length; i++) {\n for (int j = 0; j < matrix3[0].length; j++) {\n if( i == j) {\n matrix3[i][j] = 1;\n }\n\n }\n } **/\n }", "static void printMatrix(int[][] inp){\n\n for(int i=0;i<inp.length;i++){\n for(int j=0;j<inp[0].length;j++){\n System.out.print(inp[i][j]+\" \");\n }\n System.out.println(\"\");\n }\n }", "public static void main(String[] args) {\n int cols1, cols2, rows1, rows2, num_usu1, num_usu2;\r\n \r\n try{\r\n \r\n cols1 = Integer.parseInt(JOptionPane.showInputDialog(\"Informe o numero de colunas para a primeira matriz:\"));\r\n rows1 = Integer.parseInt(JOptionPane.showInputDialog(\"Informe o numero de linhas para a primeira matriz:\"));\r\n cols2 = Integer.parseInt(JOptionPane.showInputDialog(\"Informe o numero de colunas para a segunda matriz:\"));\r\n rows2 = Integer.parseInt(JOptionPane.showInputDialog(\"Informe o numero de linhas para a segunda matriz:\"));\r\n \r\n int[][] matriz1 = MatrixInt.newRandomMatrix(cols1, rows1);\r\n int[][] matriz2 = MatrixInt.newSequentialMatrix(cols2, rows2);\r\n \r\n System.out.println(\"Primeira matriz:\");\r\n MatrixInt.imprimir(matriz1);\r\n System.out.println(\" \");\r\n System.out.println(\"Segunda matriz:\");\r\n MatrixInt.imprimir(matriz2);\r\n System.out.println(\" \");\r\n \r\n MatrixInt.revert(matriz2);\r\n \r\n System.out.println(\"Matriz sequancial invertida:\");\r\n MatrixInt.imprimir(matriz2);\r\n \r\n System.out.println(\" \");\r\n System.out.println(\" \");\r\n System.out.println(\"Matriz aleatoria:\");\r\n MatrixInt.imprimir(matriz1);\r\n System.out.println(\" \");\r\n \r\n num_usu1 = Integer.parseInt(JOptionPane.showInputDialog(\"Informe um numero qualquer:\"));\r\n \r\n for1: for (int i = 0; i < matriz1.length; i++) {\r\n for (int j = 0; j < matriz1[i].length; j++) {\r\n if(num_usu1 == matriz1[i][j]){\r\n System.out.println(\"O numero '\"+num_usu1+\"' foi encontardo na posição:\" + i);\r\n break for1;\r\n }else if(j == (matriz1[i].length - 1) && i == (matriz1.length - 1)){\r\n System.out.println(\"Não foi encontrado o numero '\"+num_usu1+\"' no vetor aleatorio.\");\r\n break for1;\r\n } \r\n }\r\n }\r\n \r\n String menores = \"\", maiores = \"\";\r\n for (int i = 0; i < matriz1.length; i++) {\r\n for (int j = 0; j < matriz1[i].length; j++) {\r\n if(num_usu1 > matriz1[i][j]){\r\n menores = menores + matriz1[i][j] + \", \";\r\n }else if(num_usu1 < matriz1[i][j]){\r\n maiores = maiores + matriz1[i][j] + \", \";\r\n }\r\n }\r\n }\r\n System.out.println(\" \");\r\n System.out.print(\"Numeros menores que '\"+num_usu1+\"' :\");\r\n System.out.println(menores);\r\n System.out.print(\"Numeros maiores que '\"+num_usu1+\"' :\");\r\n System.out.println(maiores);\r\n \r\n num_usu2 = Integer.parseInt(JOptionPane.showInputDialog(\"Informe um numero que exista na matriz aleatoria:\"));\r\n \r\n int trocas = MatrixInt.replace(matriz1, num_usu2, num_usu1);\r\n \r\n if (trocas == 0) {\r\n System.out.println(\" \");\r\n System.out.println(\"Não foi realizada nenhuma troca de valores.\");\r\n }else{\r\n System.out.println(\" \");\r\n System.out.println(\"O numero de trocas realizadas foi: \"+trocas);\r\n }\r\n \r\n System.out.println(\" \");\r\n System.out.println(\"Matriz aleatoria:\");\r\n MatrixInt.imprimir(matriz1);\r\n \r\n int soma_total = 0;\r\n for (int i = 0; i < matriz1.length; i++) {\r\n for (int j = 0; j < matriz1[i].length; j++) {\r\n soma_total += matriz1[i][j];\r\n }\r\n \r\n }\r\n System.out.println(\" \");\r\n System.out.println(\"A soma dos numeros da matriz foi: \" + soma_total);\r\n \r\n System.out.println(\" \");\r\n System.out.println(\"Matriz aleatoria\");\r\n Exercicio2.imprimir(matriz1);\r\n System.out.println(\" \");\r\n System.out.println(\"Matriz sequencial\");\r\n Exercicio2.imprimir2(matriz2);\r\n \r\n }catch(Exception e){\r\n System.out.println(e);\r\n }\r\n \r\n \r\n \r\n }", "public static void main(String[] args) {\n\t\tint[][] matrix = { { 1, 1, 0, 0, 1, 0, 0, 1, 1, 0 }, { 1, 0, 0, 1, 0, 1, 1, 1, 1, 1 },\n\t\t\t\t{ 1, 1, 1, 0, 0, 1, 1, 1, 1, 0 }, { 0, 1, 1, 1, 0, 1, 1, 1, 1, 1 }, { 0, 0, 1, 1, 1, 1, 1, 1, 1, 0 },\n\t\t\t\t{ 1, 1, 1, 1, 1, 1, 0, 1, 1, 1 }, { 0, 1, 1, 1, 1, 1, 1, 0, 0, 1 }, { 1, 1, 1, 1, 1, 0, 0, 1, 1, 1 },\n\t\t\t\t{ 0, 1, 0, 1, 1, 0, 1, 1, 1, 1 }, { 1, 1, 1, 0, 1, 0, 1, 1, 1, 1 } };\n\t\t// { { 0, 0, 0 },\n\t\t// { 0, 1, 0 },\n\t\t// { 1, 1, 1 } };\n\t\tupdateMatrix(matrix);\n\n\t}", "public static void display(long[][] matrix){\n for(int i=0; i<matrix.length; i++){\n for(int j=0; j<matrix[0].length; j++){\n System.out.print(matrix[i][j] + \" \");\n }\n System.out.println();\n }\n }", "public Layout() {\n\n //nao precisa colocar externo, apenas referencia com a linha 0\n for (int i = 0; i < 4; i++) {\n matrix[0][i] = Estados.EXTERNO;\n }\n for (int i = 0; i < 4; i++) {\n matrix[1][i] = Estados.ROOM;\n }\n\n matrix[2][1] = Estados.ROOM_EMPTY;\n matrix[2][2] = Estados.ROOM_EMPTY2;\n\n matrix[2][0] = Estados.ACESSO_EXTERNO;\n matrix[2][3] = Estados.ACESSO_INTERNO;\n\n for (int i = 0; i < 4; i++) {\n matrix[3][i] = Estados.ROOM;\n }\n\n for (int i = 0; i < 4; i++) {\n matrix[4][i] = Estados.EXTERNO2;\n }\n\n }", "public static void main(String[] args) {\n\t\t\n int[][] matrix = new int[10][20];\n int x,y;\n \n \tx = 20;\n \ty = 80;\n \t\n \tafficher(10,10);\n \tafficher(20,80);\n\n\t}", "public void printAdjacencyMatrix();", "public static void fillMatrix()\n\t{\n\t\tn=in.nextInt();\n\t\tm=in.nextInt();\n\t\tmatrix = new char[n][m];\n\t\tin.nextLine();\n\t\tfor(int y=0;y<n;y++)\n\t\t\tmatrix[y] = in.nextLine().toCharArray();\n\t}", "public Array2DPrint() {}", "public static void main(String[] args) {\n\t\tSystem.out.println(\"Enter the rows and columns of first matrix\");\n\t\tint m = Utility.inputInt();\n\t\tint n = Utility.inputInt();\n\t\tint N[][] = new int [m][n];\n\t\tSystem.out.println(\"Enter the first matrix\");\n\t\tfor(int i = 0; i < m; i++) {\n\t\t\tfor(int j = 0; j < n; j++) {\n\t\t\t\tN[i][j] = Utility.inputInt();\n\t\t\t}\n\t\t}\n\t\t int d = N[1][1]*N[2][2]-N[1][2]*N[2][1];\n\t\t System.out.println(\"Determinant of 2 by 2 matrix4 is:\" + d);\n\t\t int b = N[0][1]*N[1][2]-N[0][2]*N[1][1];\n\t\t System.out.println(\"Determinant of 2 by 2 matrix1 is:\" + b);\n\t\t int a = N[0][0]*N[1][1]-N[0][1]*N[1][0];\n\t\t System.out.println(\"Determinant of 2 by 2 matrix is:\" + a);\n\t\t int s = N[0][0]*N[1][2]-N[0][2]*N[1][0];\n\t\t System.out.println(\"Determinant of 2 by 2 matrix5 is:\" + s);\n\t\t\n\t\t int c = N[1][0]*N[2][1]-N[1][1]*N[2][0];\n\t\t System.out.println(\"Determinant of 2 by 2 matrix2 is:\" + b);\n\t\t int x = N[1][0]*N[2][2]-N[1][2]*N[2][0];\n\t\t System.out.println(\"Determinant of 2 by 2 matrix3 is:\" + c);\n\t\t\n\t\t\n\t\t int p = N[0][0]*N[2][2]-N[0][2]*N[2][0];\n\t\t System.out.println(\"Determinant of 2 by 2 matrix6 is:\" + p);\n\t\t int q = N[0][0]*N[2][1]-N[0][1]*N[2][0];\n\t\t System.out.println(\"Determinant of 2 by 2 matrix7 is:\" + q);\n\t\t int r = N[0][1]*N[2][2]-N[0][2]*N[2][1];\n\t\t System.out.println(\"Determinant of 2 by 2 matrix8 is:\" + r);\n\t\t \n\n\t}", "public static void main(String[] args) {\n\n Scanner sc = new Scanner(System.in);\n int N = sc.nextInt();\n double p = sc.nextDouble();\n int M = sc.nextInt();\n\n // repeatedly created N-by-N matrices and display them using standard draw\n for (int i = 0; i < M; i++) {\n boolean[][] open = Percolation.random(N, p);\n StdDraw.clear();\n StdDraw.setPenColor(StdDraw.BLACK);\n Percolation.show(open, false);\n StdDraw.setPenColor(StdDraw.BOOK_BLUE);\n boolean[][] full = Percolation.flow(open);\n Percolation.show(full, true);\n StdDraw.show(1000);\n }\n }", "@Test\n public void testMatrixCreation() throws Exception {\n\n testUtilities_3.createAndTestMatrix(false);\n\n }", "public static void main(String[] args) {\n\t\t\n\t\tint [][]matrix= {{1,2,3},{4,5,6},{7,8,9}};\n\t\tfor(int i=0;i<3;i++) {\n\t\t\tfor(int j=0;j<3;j++) {\n\t\t\t\tSystem.out.println(matrix[i][j]);\n\t\t\t}\n\t\t}\n\t\t\n\n\t}", "public Main()\n { \n // Create a new world with 600x400 cells with a cell size of 1x1 pixels.\n super(600, 600, 1); \n\n prepare();\n }", "public static void main(String[] args) {\n\n\t\tScanner sc = new Scanner(System.in);\n\t\tSystem.out.println(\"Enter N:\");\n\t\tint n = sc.nextInt();\n\t\tSystem.out.println(\"Enter M:\");\n\t\tint m = sc.nextInt();\n\n\t\tint a = 1;\n\t\tint row = 0;\n\t\tint col = 0;\n\t\tint[][] arr = new int[n][m];\n \n\t\t// nad obratnia diagonal\n\t\tfor (int i = 0; i < n; i++) {\n\t\t\tfor (int j = row; j >= 0; j--) {\n\t\t\t\tarr[j][col] = a;\n\t\t\t\ta++;\n\t\t\t\tcol++;\n\t\t\t}\n\t\t\trow++;\n\t\t\tcol = 0;\n\t\t}\n\t\t// ako e kvadratna matrica\n\t\tint rowLimit = 0;\n\t\tif (m % 2 == 0) {\n\t\t\trowLimit = 1;\n\t\t} else {\n\t\t\trowLimit = 0;\n\t\t}\n\t\t// pod obratnia diagonal\n\t\trow -= 1;\n\t\tcol += 1;\n\t\tfor (int i = 0; i < n; i++) {\n\t\t\tfor (int j = row; j >= rowLimit; j--) {\n\t\t\t\tarr[j][col] = a;\n\t\t\t\ta++;\n\t\t\t\tcol++;\n\t\t\t}\n\t\t\trow = n - 1;\n\t\t\tcol = i + 2;\n\t\t\trowLimit++;\n\n\t\t}\n // print\n\t\tfor (int i = 0; i < arr.length; i++) {\n\t\t\tfor (int j = 0; j < arr[0].length; j++) {\n\t\t\t\tSystem.out.print(arr[i][j] + \" \");\n\t\t\t}\n\t\t\tSystem.out.println();\n\t\t}\n\t\tsc.close();\n\n\t}", "public static void main(String[] args) {\n\t// write your code here\n int[][] input = new int[3][3];\n input[1][1] = 1;\n\n Solution sol = new Solution();\n sol.printMatrix(input);\n int[][] output = sol.updateMatrix(input);\n sol.printMatrix(output);\n\n }", "public static void main(String[] args) {\n\t\tSystem.out.print(\"Enter n: \");\r\n\t\tScanner input = new Scanner(System.in);\r\n\t\tint num = input.nextInt();\r\n\t\tprintMatrix(num);\r\n\t}", "public void mostrarGrafo() {\n\t\tmatriz.mostrarMatriz();\n\t}", "private static void printMatrix(char[][] board) {\n\t\tint row = board.length;\n\t\tint col = board[0].length;\n\t\tfor(int i=0; i<row; i++){\n\t\t\t\n\t\t\tfor(int j=0; j<col; j++){\n\t\t\t\t\n\t\t\t\tSystem.out.print(\" \" + board[i][j]+\"\");\n\t\t\t}\n\t\t\tSystem.out.println();\n\t\t}\n\t\t\n\t\tSystem.out.println();\n\t}", "public static void main(String[] args) {\n\t\t int[][] matrix = new int[3][3];\n\n\t Scanner input = new Scanner(System.in);\n\t System.out.print(\"Enter a number between 0 and 511: \");\n\t int num = input.nextInt();\n\t String binary = decimalToBinary(num,matrix);\n\n\t // put 1's and 0's using binary string\n\t int index=0;\n\t char ch;\n\t for(int row=0;row<matrix.length;row++){\n\t \tfor(int col=0;col<matrix[row].length;col++){\n\t \t\tmatrix[row][col]=binary.charAt(index);\n\t \t\tindex++;\n\t \t\tif(matrix[row][col]=='0')ch='H';\n\t \t\telse ch='T';\n\t \t\tSystem.out.print((col+1)%3==0? ch+\"\\n\":ch+\" \");\n\t \t}\n\t }\n\t \t\n\t }", "public static void main(String[] args) {\n\t\tSetMatrixZ73 s = new SetMatrixZ73();\r\n\t\tint[][] matrix = {{0,2,3},{4,0,6},{7,8,9}};\r\n\t\ts.setZeros(matrix);\r\n\t\tfor(int i = 0; i < 3; i++){\r\n\t\t\tfor(int j = 0; j < 3; j++){\r\n\t\t\t\tSystem.out.print(matrix[i][j] + \" \");\r\n\t\t\t}\r\n\t\t\tSystem.out.println(\"\");\r\n\t\t}\r\n\t}", "public static void main(String[] args) {\n System.out.print(\"\\t\\t\");\r\n for (int i = 0; i <= COLUMN; i++) {\r\n System.out.print(i + \"\\t\");\r\n }\r\n System.out.println();\r\n\r\n // handle printing horizontal border\r\n System.out.print(\"\\t-----\");\r\n for (int i = 0; i <= COLUMN; i++) {\r\n System.out.print(\"----\");\r\n }\r\n System.out.println();\r\n\r\n // handle printing row numbers and vertical border\r\n for (int i = 0; i <= ROW; i++) {\r\n System.out.print(i + \"\\t|\\t\");\r\n // nested loop, creating the multiplication table\r\n for (int j = 0 ; j <= COLUMN; j++) {\r\n System.out.print((i * j) + \"\\t\");\r\n }\r\n System.out.println();\r\n }\r\n }", "public static void displayMatrix(char[][] M, int size){\n for (int i = 0 ; i < size ; i++){\n for (int j=0 ; j< size ; j++){\n System.out.print(M[i][j]);\n }\n System.out.println ();\n }\n }", "public static void main(String[] args) {\n\r\n\t\tint[][]m1 = generarMatriz();\r\n\t\tint[][]m2 = generarMatriz();\r\n\t\t\r\n\t\tint[][]matrizResultado = multMatriz(m1, m2);\r\n\t\t\r\n\t\tString text = \"Matriz 1\\n\" + print(m1) + \"\\nMatriz2\\n\" + print(m2) + \"\\nMatrizResultado\\n\" + print(matrizResultado);\r\n\t\t\r\n\t\tJOptionPane.showMessageDialog(null, text);\r\n\t}", "Matrix()\n {\n x = new Vector();\n y = new Vector();\n z = new Vector();\n }", "private void initializeView(int rowNumber, int colNumber, int width, int height){\n\n this.jobNumber = colNumber;\n this.machineNumber = rowNumber;\n\n this.graphWidth = (int) (width * 0.98);\n this.graphHeight = (int) (height * 0.98);\n this.boxHeight = graphHeight/machineNumber;\n this.graphPane = new Pane();\n this.graphPane.setLayoutX(width*0.02);\n this.graphPane.setLayoutY(height*0.02);\n\n this.setTitle(\"Chain Box Graph\");\n this.setHeight(height + 40);\n this.setWidth(width + 80);\n\n if (isIntegerMatrix) {\n drawGraph(intMatrix);\n }\n else {\n drawGraph(floatMatrix);\n }\n\n this.root = new Group(); //TODO : Ajouter tous les enfants dans le groupe.\n this.root.getChildren().addAll(graphPane);\n this.scene = new Scene(root, width, height);\n this.setScene(scene);\n this.setResizable(true);\n }", "public void printMatrix(){\n for (int row = 0; row < matrix.length; row++){\n for (int count = 0; count < matrix[row].length; count++){\n System.out.print(\"----\");\n }\n System.out.println();\n System.out.print('|');\n for (int column = 0; column < matrix[row].length; column++){\n if (matrix[row][column] == SHIP)\n System.out.print('X' + \" | \");\n else if (matrix[row][column] == HIT)\n System.out.print('+' + \" | \");\n else if (matrix[row][column] == MISS)\n System.out.print('*' + \" | \");\n else\n System.out.print(\" \" + \" | \");\n }\n System.out.println();\n }\n }", "public void Matriz()\n {\n int dim;\n dim = Principal.dimension;\n \n matrix = new JLabel [dim][dim];\n\n for(int i=0; i< dim; i++){\n\n\t\t\t\tfor(int j=0; j< dim; j++){\n\n\t\t\t\t\t\n\n matrix[i][j] = new JLabel();\n\n matrix[i][j].setVisible(true);\n\n matrix[i][j].setBorder(javax.swing.BorderFactory.createLineBorder(Color.black, 1));\n\n matrix[i][j].setBounds(5 +(i*43), 5 +(j*43), 40, 40);\n\n matrix[i][j].setBackground(Color.green);\n\n matrix[i][j].setText(\"\");\n Pan_Tablero.add(matrix[i][j]);\n\n //this.getContentPane().add(matrix[i][j]);\n\n } \n\n} \n }", "public Map(){\n this.matrix = new int[10][10];\n }", "@Test(timeout = 4000)\n public void test011() throws Throwable {\n ResultMatrixLatex resultMatrixLatex0 = new ResultMatrixLatex();\n assertFalse(resultMatrixLatex0.getEnumerateRowNames());\n assertEquals(0, resultMatrixLatex0.getRowNameWidth());\n assertEquals(0, resultMatrixLatex0.getDefaultCountWidth());\n assertEquals(2, resultMatrixLatex0.getMeanPrec());\n assertEquals(\"Whether to display the standard deviation column.\", resultMatrixLatex0.showStdDevTipText());\n assertEquals(\"Generates the matrix output in LaTeX-syntax.\", resultMatrixLatex0.globalInfo());\n assertEquals(0, resultMatrixLatex0.getDefaultRowNameWidth());\n assertFalse(resultMatrixLatex0.getDefaultEnumerateRowNames());\n assertEquals(\"The width of the significance indicator (0 = optimal).\", resultMatrixLatex0.significanceWidthTipText());\n assertFalse(resultMatrixLatex0.getShowStdDev());\n assertEquals(\"The maximum width for the row names (0 = optimal).\", resultMatrixLatex0.rowNameWidthTipText());\n assertEquals(\"LaTeX\", resultMatrixLatex0.getDisplayName());\n assertEquals(2, resultMatrixLatex0.getDefaultMeanPrec());\n assertEquals(\"Whether to remove the classname package prefixes from the filter names in datasets.\", resultMatrixLatex0.removeFilterNameTipText());\n assertFalse(resultMatrixLatex0.getPrintColNames());\n assertEquals(\"Whether to enumerate the column names (prefixing them with '(x)', with 'x' being the index).\", resultMatrixLatex0.enumerateColNamesTipText());\n assertEquals(0, resultMatrixLatex0.getSignificanceWidth());\n assertEquals(0, resultMatrixLatex0.getCountWidth());\n assertEquals(\"Whether to output column names or just numbers representing them.\", resultMatrixLatex0.printColNamesTipText());\n assertEquals(1, resultMatrixLatex0.getColCount());\n assertEquals(\"The maximum width of the column names (0 = optimal).\", resultMatrixLatex0.colNameWidthTipText());\n assertFalse(resultMatrixLatex0.getRemoveFilterName());\n assertEquals(0, resultMatrixLatex0.getDefaultStdDevWidth());\n assertEquals(\"Whether to show the row with averages.\", resultMatrixLatex0.showAverageTipText());\n assertEquals(\"The number of decimals after the decimal point for the standard deviation.\", resultMatrixLatex0.stdDevPrecTipText());\n assertTrue(resultMatrixLatex0.getPrintRowNames());\n assertFalse(resultMatrixLatex0.getDefaultPrintColNames());\n assertEquals(1, resultMatrixLatex0.getVisibleColCount());\n assertEquals(0, resultMatrixLatex0.getMeanWidth());\n assertEquals(\"The width of the counts (0 = optimal).\", resultMatrixLatex0.countWidthTipText());\n assertEquals(0, resultMatrixLatex0.getDefaultColNameWidth());\n assertEquals(0, resultMatrixLatex0.getDefaultMeanWidth());\n assertEquals(0, resultMatrixLatex0.getColNameWidth());\n assertEquals(0, resultMatrixLatex0.getDefaultSignificanceWidth());\n assertFalse(resultMatrixLatex0.getDefaultRemoveFilterName());\n assertEquals(1, resultMatrixLatex0.getVisibleRowCount());\n assertTrue(resultMatrixLatex0.getDefaultEnumerateColNames());\n assertEquals(2, resultMatrixLatex0.getDefaultStdDevPrec());\n assertFalse(resultMatrixLatex0.getShowAverage());\n assertTrue(resultMatrixLatex0.getEnumerateColNames());\n assertEquals(\"Whether to enumerate the row names (prefixing them with '(x)', with 'x' being the index).\", resultMatrixLatex0.enumerateRowNamesTipText());\n assertEquals(0, resultMatrixLatex0.getStdDevWidth());\n assertEquals(\"Whether to output row names or just numbers representing them.\", resultMatrixLatex0.printRowNamesTipText());\n assertFalse(resultMatrixLatex0.getDefaultShowStdDev());\n assertTrue(resultMatrixLatex0.getDefaultPrintRowNames());\n assertEquals(2, resultMatrixLatex0.getStdDevPrec());\n assertEquals(\"The number of decimals after the decimal point for the mean.\", resultMatrixLatex0.meanPrecTipText());\n assertEquals(1, resultMatrixLatex0.getRowCount());\n assertEquals(\"The width of the mean (0 = optimal).\", resultMatrixLatex0.meanWidthTipText());\n assertFalse(resultMatrixLatex0.getDefaultShowAverage());\n assertEquals(\"The width of the standard deviation (0 = optimal).\", resultMatrixLatex0.stdDevWidthTipText());\n assertNotNull(resultMatrixLatex0);\n assertEquals(0, ResultMatrix.SIGNIFICANCE_TIE);\n assertEquals(1, ResultMatrix.SIGNIFICANCE_WIN);\n assertEquals(2, ResultMatrix.SIGNIFICANCE_LOSS);\n \n resultMatrixLatex0.setShowAverage(true);\n assertFalse(resultMatrixLatex0.getEnumerateRowNames());\n assertEquals(0, resultMatrixLatex0.getRowNameWidth());\n assertEquals(0, resultMatrixLatex0.getDefaultCountWidth());\n assertEquals(2, resultMatrixLatex0.getMeanPrec());\n assertEquals(\"Whether to display the standard deviation column.\", resultMatrixLatex0.showStdDevTipText());\n assertEquals(\"Generates the matrix output in LaTeX-syntax.\", resultMatrixLatex0.globalInfo());\n assertEquals(0, resultMatrixLatex0.getDefaultRowNameWidth());\n assertFalse(resultMatrixLatex0.getDefaultEnumerateRowNames());\n assertEquals(\"The width of the significance indicator (0 = optimal).\", resultMatrixLatex0.significanceWidthTipText());\n assertTrue(resultMatrixLatex0.getShowAverage());\n assertFalse(resultMatrixLatex0.getShowStdDev());\n assertEquals(\"The maximum width for the row names (0 = optimal).\", resultMatrixLatex0.rowNameWidthTipText());\n assertEquals(\"LaTeX\", resultMatrixLatex0.getDisplayName());\n assertEquals(2, resultMatrixLatex0.getDefaultMeanPrec());\n assertEquals(\"Whether to remove the classname package prefixes from the filter names in datasets.\", resultMatrixLatex0.removeFilterNameTipText());\n assertFalse(resultMatrixLatex0.getPrintColNames());\n assertEquals(\"Whether to enumerate the column names (prefixing them with '(x)', with 'x' being the index).\", resultMatrixLatex0.enumerateColNamesTipText());\n assertEquals(0, resultMatrixLatex0.getSignificanceWidth());\n assertEquals(0, resultMatrixLatex0.getCountWidth());\n assertEquals(\"Whether to output column names or just numbers representing them.\", resultMatrixLatex0.printColNamesTipText());\n assertEquals(1, resultMatrixLatex0.getColCount());\n assertEquals(\"The maximum width of the column names (0 = optimal).\", resultMatrixLatex0.colNameWidthTipText());\n assertFalse(resultMatrixLatex0.getRemoveFilterName());\n assertEquals(0, resultMatrixLatex0.getDefaultStdDevWidth());\n assertEquals(\"Whether to show the row with averages.\", resultMatrixLatex0.showAverageTipText());\n assertEquals(\"The number of decimals after the decimal point for the standard deviation.\", resultMatrixLatex0.stdDevPrecTipText());\n assertTrue(resultMatrixLatex0.getPrintRowNames());\n assertFalse(resultMatrixLatex0.getDefaultPrintColNames());\n assertEquals(1, resultMatrixLatex0.getVisibleColCount());\n assertEquals(0, resultMatrixLatex0.getMeanWidth());\n assertEquals(\"The width of the counts (0 = optimal).\", resultMatrixLatex0.countWidthTipText());\n assertEquals(0, resultMatrixLatex0.getDefaultColNameWidth());\n assertEquals(0, resultMatrixLatex0.getDefaultMeanWidth());\n assertEquals(0, resultMatrixLatex0.getColNameWidth());\n assertEquals(0, resultMatrixLatex0.getDefaultSignificanceWidth());\n assertFalse(resultMatrixLatex0.getDefaultRemoveFilterName());\n assertEquals(1, resultMatrixLatex0.getVisibleRowCount());\n assertTrue(resultMatrixLatex0.getDefaultEnumerateColNames());\n assertEquals(2, resultMatrixLatex0.getDefaultStdDevPrec());\n assertTrue(resultMatrixLatex0.getEnumerateColNames());\n assertEquals(\"Whether to enumerate the row names (prefixing them with '(x)', with 'x' being the index).\", resultMatrixLatex0.enumerateRowNamesTipText());\n assertEquals(0, resultMatrixLatex0.getStdDevWidth());\n assertEquals(\"Whether to output row names or just numbers representing them.\", resultMatrixLatex0.printRowNamesTipText());\n assertFalse(resultMatrixLatex0.getDefaultShowStdDev());\n assertTrue(resultMatrixLatex0.getDefaultPrintRowNames());\n assertEquals(2, resultMatrixLatex0.getStdDevPrec());\n assertEquals(\"The number of decimals after the decimal point for the mean.\", resultMatrixLatex0.meanPrecTipText());\n assertEquals(1, resultMatrixLatex0.getRowCount());\n assertEquals(\"The width of the mean (0 = optimal).\", resultMatrixLatex0.meanWidthTipText());\n assertFalse(resultMatrixLatex0.getDefaultShowAverage());\n assertEquals(\"The width of the standard deviation (0 = optimal).\", resultMatrixLatex0.stdDevWidthTipText());\n assertEquals(0, ResultMatrix.SIGNIFICANCE_TIE);\n assertEquals(1, ResultMatrix.SIGNIFICANCE_WIN);\n assertEquals(2, ResultMatrix.SIGNIFICANCE_LOSS);\n \n ResultMatrixSignificance resultMatrixSignificance0 = new ResultMatrixSignificance();\n assertEquals(40, resultMatrixSignificance0.getDefaultRowNameWidth());\n assertEquals(0, resultMatrixSignificance0.getDefaultSignificanceWidth());\n assertEquals(0, resultMatrixSignificance0.getCountWidth());\n assertEquals(\"The width of the counts (0 = optimal).\", resultMatrixSignificance0.countWidthTipText());\n assertFalse(resultMatrixSignificance0.getRemoveFilterName());\n assertEquals(\"Whether to output row names or just numbers representing them.\", resultMatrixSignificance0.printRowNamesTipText());\n assertFalse(resultMatrixSignificance0.getDefaultShowStdDev());\n assertEquals(40, resultMatrixSignificance0.getRowNameWidth());\n assertFalse(resultMatrixSignificance0.getDefaultRemoveFilterName());\n assertEquals(\"Whether to enumerate the column names (prefixing them with '(x)', with 'x' being the index).\", resultMatrixSignificance0.enumerateColNamesTipText());\n assertEquals(1, resultMatrixSignificance0.getColCount());\n assertEquals(0, resultMatrixSignificance0.getDefaultMeanWidth());\n assertEquals(\"The number of decimals after the decimal point for the standard deviation.\", resultMatrixSignificance0.stdDevPrecTipText());\n assertEquals(0, resultMatrixSignificance0.getDefaultColNameWidth());\n assertEquals(\"The maximum width for the row names (0 = optimal).\", resultMatrixSignificance0.rowNameWidthTipText());\n assertEquals(0, resultMatrixSignificance0.getColNameWidth());\n assertEquals(\"Whether to enumerate the row names (prefixing them with '(x)', with 'x' being the index).\", resultMatrixSignificance0.enumerateRowNamesTipText());\n assertTrue(resultMatrixSignificance0.getEnumerateColNames());\n assertEquals(0, resultMatrixSignificance0.getMeanWidth());\n assertFalse(resultMatrixSignificance0.getDefaultShowAverage());\n assertTrue(resultMatrixSignificance0.getDefaultEnumerateColNames());\n assertEquals(1, resultMatrixSignificance0.getVisibleRowCount());\n assertEquals(\"The maximum width of the column names (0 = optimal).\", resultMatrixSignificance0.colNameWidthTipText());\n assertEquals(0, resultMatrixSignificance0.getDefaultCountWidth());\n assertEquals(\"The width of the standard deviation (0 = optimal).\", resultMatrixSignificance0.stdDevWidthTipText());\n assertFalse(resultMatrixSignificance0.getShowAverage());\n assertFalse(resultMatrixSignificance0.getDefaultPrintColNames());\n assertEquals(\"Only outputs the significance indicators. Can be used for spotting patterns.\", resultMatrixSignificance0.globalInfo());\n assertEquals(\"The number of decimals after the decimal point for the mean.\", resultMatrixSignificance0.meanPrecTipText());\n assertEquals(2, resultMatrixSignificance0.getDefaultStdDevPrec());\n assertEquals(\"Significance only\", resultMatrixSignificance0.getDisplayName());\n assertEquals(0, resultMatrixSignificance0.getStdDevWidth());\n assertEquals(\"Whether to show the row with averages.\", resultMatrixSignificance0.showAverageTipText());\n assertEquals(1, resultMatrixSignificance0.getRowCount());\n assertEquals(\"Whether to display the standard deviation column.\", resultMatrixSignificance0.showStdDevTipText());\n assertTrue(resultMatrixSignificance0.getDefaultPrintRowNames());\n assertFalse(resultMatrixSignificance0.getPrintColNames());\n assertEquals(2, resultMatrixSignificance0.getStdDevPrec());\n assertEquals(\"The width of the mean (0 = optimal).\", resultMatrixSignificance0.meanWidthTipText());\n assertEquals(0, resultMatrixSignificance0.getSignificanceWidth());\n assertFalse(resultMatrixSignificance0.getEnumerateRowNames());\n assertFalse(resultMatrixSignificance0.getShowStdDev());\n assertEquals(2, resultMatrixSignificance0.getMeanPrec());\n assertEquals(\"Whether to remove the classname package prefixes from the filter names in datasets.\", resultMatrixSignificance0.removeFilterNameTipText());\n assertEquals(\"Whether to output column names or just numbers representing them.\", resultMatrixSignificance0.printColNamesTipText());\n assertFalse(resultMatrixSignificance0.getDefaultEnumerateRowNames());\n assertEquals(\"The width of the significance indicator (0 = optimal).\", resultMatrixSignificance0.significanceWidthTipText());\n assertEquals(0, resultMatrixSignificance0.getDefaultStdDevWidth());\n assertEquals(2, resultMatrixSignificance0.getDefaultMeanPrec());\n assertEquals(1, resultMatrixSignificance0.getVisibleColCount());\n assertTrue(resultMatrixSignificance0.getPrintRowNames());\n assertNotNull(resultMatrixSignificance0);\n assertEquals(0, ResultMatrix.SIGNIFICANCE_TIE);\n assertEquals(1, ResultMatrix.SIGNIFICANCE_WIN);\n assertEquals(2, ResultMatrix.SIGNIFICANCE_LOSS);\n \n resultMatrixSignificance0.assign(resultMatrixLatex0);\n assertFalse(resultMatrixLatex0.getEnumerateRowNames());\n assertEquals(0, resultMatrixLatex0.getRowNameWidth());\n assertEquals(0, resultMatrixLatex0.getDefaultCountWidth());\n assertEquals(2, resultMatrixLatex0.getMeanPrec());\n assertEquals(\"Whether to display the standard deviation column.\", resultMatrixLatex0.showStdDevTipText());\n assertEquals(\"Generates the matrix output in LaTeX-syntax.\", resultMatrixLatex0.globalInfo());\n assertEquals(0, resultMatrixLatex0.getDefaultRowNameWidth());\n assertFalse(resultMatrixLatex0.getDefaultEnumerateRowNames());\n assertEquals(\"The width of the significance indicator (0 = optimal).\", resultMatrixLatex0.significanceWidthTipText());\n assertTrue(resultMatrixLatex0.getShowAverage());\n assertFalse(resultMatrixLatex0.getShowStdDev());\n assertEquals(\"The maximum width for the row names (0 = optimal).\", resultMatrixLatex0.rowNameWidthTipText());\n assertEquals(\"LaTeX\", resultMatrixLatex0.getDisplayName());\n assertEquals(2, resultMatrixLatex0.getDefaultMeanPrec());\n assertEquals(\"Whether to remove the classname package prefixes from the filter names in datasets.\", resultMatrixLatex0.removeFilterNameTipText());\n assertFalse(resultMatrixLatex0.getPrintColNames());\n assertEquals(\"Whether to enumerate the column names (prefixing them with '(x)', with 'x' being the index).\", resultMatrixLatex0.enumerateColNamesTipText());\n assertEquals(0, resultMatrixLatex0.getSignificanceWidth());\n assertEquals(0, resultMatrixLatex0.getCountWidth());\n assertEquals(\"Whether to output column names or just numbers representing them.\", resultMatrixLatex0.printColNamesTipText());\n assertEquals(1, resultMatrixLatex0.getColCount());\n assertEquals(\"The maximum width of the column names (0 = optimal).\", resultMatrixLatex0.colNameWidthTipText());\n assertFalse(resultMatrixLatex0.getRemoveFilterName());\n assertEquals(0, resultMatrixLatex0.getDefaultStdDevWidth());\n assertEquals(\"Whether to show the row with averages.\", resultMatrixLatex0.showAverageTipText());\n assertEquals(\"The number of decimals after the decimal point for the standard deviation.\", resultMatrixLatex0.stdDevPrecTipText());\n assertTrue(resultMatrixLatex0.getPrintRowNames());\n assertFalse(resultMatrixLatex0.getDefaultPrintColNames());\n assertEquals(1, resultMatrixLatex0.getVisibleColCount());\n assertEquals(0, resultMatrixLatex0.getMeanWidth());\n assertEquals(\"The width of the counts (0 = optimal).\", resultMatrixLatex0.countWidthTipText());\n assertEquals(0, resultMatrixLatex0.getDefaultColNameWidth());\n assertEquals(0, resultMatrixLatex0.getDefaultMeanWidth());\n assertEquals(0, resultMatrixLatex0.getColNameWidth());\n assertEquals(0, resultMatrixLatex0.getDefaultSignificanceWidth());\n assertFalse(resultMatrixLatex0.getDefaultRemoveFilterName());\n assertEquals(1, resultMatrixLatex0.getVisibleRowCount());\n assertTrue(resultMatrixLatex0.getDefaultEnumerateColNames());\n assertEquals(2, resultMatrixLatex0.getDefaultStdDevPrec());\n assertTrue(resultMatrixLatex0.getEnumerateColNames());\n assertEquals(\"Whether to enumerate the row names (prefixing them with '(x)', with 'x' being the index).\", resultMatrixLatex0.enumerateRowNamesTipText());\n assertEquals(0, resultMatrixLatex0.getStdDevWidth());\n assertEquals(\"Whether to output row names or just numbers representing them.\", resultMatrixLatex0.printRowNamesTipText());\n assertFalse(resultMatrixLatex0.getDefaultShowStdDev());\n assertTrue(resultMatrixLatex0.getDefaultPrintRowNames());\n assertEquals(2, resultMatrixLatex0.getStdDevPrec());\n assertEquals(\"The number of decimals after the decimal point for the mean.\", resultMatrixLatex0.meanPrecTipText());\n assertEquals(1, resultMatrixLatex0.getRowCount());\n assertEquals(\"The width of the mean (0 = optimal).\", resultMatrixLatex0.meanWidthTipText());\n assertFalse(resultMatrixLatex0.getDefaultShowAverage());\n assertEquals(\"The width of the standard deviation (0 = optimal).\", resultMatrixLatex0.stdDevWidthTipText());\n assertEquals(40, resultMatrixSignificance0.getDefaultRowNameWidth());\n assertEquals(0, resultMatrixSignificance0.getDefaultSignificanceWidth());\n assertEquals(0, resultMatrixSignificance0.getCountWidth());\n assertEquals(\"The width of the counts (0 = optimal).\", resultMatrixSignificance0.countWidthTipText());\n assertFalse(resultMatrixSignificance0.getRemoveFilterName());\n assertEquals(\"Whether to output row names or just numbers representing them.\", resultMatrixSignificance0.printRowNamesTipText());\n assertFalse(resultMatrixSignificance0.getDefaultShowStdDev());\n assertFalse(resultMatrixSignificance0.getDefaultRemoveFilterName());\n assertEquals(\"Whether to enumerate the column names (prefixing them with '(x)', with 'x' being the index).\", resultMatrixSignificance0.enumerateColNamesTipText());\n assertEquals(1, resultMatrixSignificance0.getColCount());\n assertEquals(0, resultMatrixSignificance0.getDefaultMeanWidth());\n assertEquals(\"The number of decimals after the decimal point for the standard deviation.\", resultMatrixSignificance0.stdDevPrecTipText());\n assertEquals(0, resultMatrixSignificance0.getDefaultColNameWidth());\n assertEquals(\"The maximum width for the row names (0 = optimal).\", resultMatrixSignificance0.rowNameWidthTipText());\n assertEquals(0, resultMatrixSignificance0.getColNameWidth());\n assertEquals(\"Whether to enumerate the row names (prefixing them with '(x)', with 'x' being the index).\", resultMatrixSignificance0.enumerateRowNamesTipText());\n assertTrue(resultMatrixSignificance0.getEnumerateColNames());\n assertEquals(0, resultMatrixSignificance0.getMeanWidth());\n assertFalse(resultMatrixSignificance0.getDefaultShowAverage());\n assertTrue(resultMatrixSignificance0.getDefaultEnumerateColNames());\n assertEquals(1, resultMatrixSignificance0.getVisibleRowCount());\n assertEquals(\"The maximum width of the column names (0 = optimal).\", resultMatrixSignificance0.colNameWidthTipText());\n assertEquals(0, resultMatrixSignificance0.getDefaultCountWidth());\n assertEquals(\"The width of the standard deviation (0 = optimal).\", resultMatrixSignificance0.stdDevWidthTipText());\n assertFalse(resultMatrixSignificance0.getDefaultPrintColNames());\n assertEquals(\"Only outputs the significance indicators. Can be used for spotting patterns.\", resultMatrixSignificance0.globalInfo());\n assertEquals(\"The number of decimals after the decimal point for the mean.\", resultMatrixSignificance0.meanPrecTipText());\n assertEquals(2, resultMatrixSignificance0.getDefaultStdDevPrec());\n assertEquals(\"Significance only\", resultMatrixSignificance0.getDisplayName());\n assertEquals(0, resultMatrixSignificance0.getStdDevWidth());\n assertEquals(\"Whether to show the row with averages.\", resultMatrixSignificance0.showAverageTipText());\n assertEquals(1, resultMatrixSignificance0.getRowCount());\n assertEquals(\"Whether to display the standard deviation column.\", resultMatrixSignificance0.showStdDevTipText());\n assertTrue(resultMatrixSignificance0.getDefaultPrintRowNames());\n assertEquals(0, resultMatrixSignificance0.getRowNameWidth());\n assertFalse(resultMatrixSignificance0.getPrintColNames());\n assertEquals(2, resultMatrixSignificance0.getStdDevPrec());\n assertEquals(\"The width of the mean (0 = optimal).\", resultMatrixSignificance0.meanWidthTipText());\n assertEquals(0, resultMatrixSignificance0.getSignificanceWidth());\n assertFalse(resultMatrixSignificance0.getEnumerateRowNames());\n assertFalse(resultMatrixSignificance0.getShowStdDev());\n assertEquals(2, resultMatrixSignificance0.getMeanPrec());\n assertEquals(\"Whether to remove the classname package prefixes from the filter names in datasets.\", resultMatrixSignificance0.removeFilterNameTipText());\n assertEquals(\"Whether to output column names or just numbers representing them.\", resultMatrixSignificance0.printColNamesTipText());\n assertFalse(resultMatrixSignificance0.getDefaultEnumerateRowNames());\n assertEquals(\"The width of the significance indicator (0 = optimal).\", resultMatrixSignificance0.significanceWidthTipText());\n assertTrue(resultMatrixSignificance0.getShowAverage());\n assertEquals(0, resultMatrixSignificance0.getDefaultStdDevWidth());\n assertEquals(2, resultMatrixSignificance0.getDefaultMeanPrec());\n assertEquals(1, resultMatrixSignificance0.getVisibleColCount());\n assertTrue(resultMatrixSignificance0.getPrintRowNames());\n assertEquals(0, ResultMatrix.SIGNIFICANCE_TIE);\n assertEquals(1, ResultMatrix.SIGNIFICANCE_WIN);\n assertEquals(2, ResultMatrix.SIGNIFICANCE_LOSS);\n assertEquals(0, ResultMatrix.SIGNIFICANCE_TIE);\n assertEquals(1, ResultMatrix.SIGNIFICANCE_WIN);\n assertEquals(2, ResultMatrix.SIGNIFICANCE_LOSS);\n \n ResultMatrixSignificance resultMatrixSignificance1 = new ResultMatrixSignificance();\n assertEquals(2, resultMatrixSignificance1.getDefaultMeanPrec());\n assertEquals(\"Whether to output row names or just numbers representing them.\", resultMatrixSignificance1.printRowNamesTipText());\n assertFalse(resultMatrixSignificance1.getDefaultPrintColNames());\n assertEquals(1, resultMatrixSignificance1.getVisibleColCount());\n assertTrue(resultMatrixSignificance1.getPrintRowNames());\n assertEquals(\"Whether to show the row with averages.\", resultMatrixSignificance1.showAverageTipText());\n assertEquals(\"The number of decimals after the decimal point for the mean.\", resultMatrixSignificance1.meanPrecTipText());\n assertEquals(0, resultMatrixSignificance1.getCountWidth());\n assertEquals(0, resultMatrixSignificance1.getDefaultColNameWidth());\n assertEquals(40, resultMatrixSignificance1.getDefaultRowNameWidth());\n assertFalse(resultMatrixSignificance1.getDefaultRemoveFilterName());\n assertEquals(0, resultMatrixSignificance1.getDefaultStdDevWidth());\n assertEquals(0, resultMatrixSignificance1.getDefaultSignificanceWidth());\n assertEquals(2, resultMatrixSignificance1.getDefaultStdDevPrec());\n assertEquals(\"The maximum width of the column names (0 = optimal).\", resultMatrixSignificance1.colNameWidthTipText());\n assertEquals(\"The width of the counts (0 = optimal).\", resultMatrixSignificance1.countWidthTipText());\n assertEquals(\"Whether to enumerate the row names (prefixing them with '(x)', with 'x' being the index).\", resultMatrixSignificance1.enumerateRowNamesTipText());\n assertFalse(resultMatrixSignificance1.getDefaultEnumerateRowNames());\n assertTrue(resultMatrixSignificance1.getDefaultEnumerateColNames());\n assertEquals(0, resultMatrixSignificance1.getDefaultMeanWidth());\n assertEquals(\"The width of the standard deviation (0 = optimal).\", resultMatrixSignificance1.stdDevWidthTipText());\n assertEquals(40, resultMatrixSignificance1.getRowNameWidth());\n assertFalse(resultMatrixSignificance1.getEnumerateRowNames());\n assertEquals(1, resultMatrixSignificance1.getColCount());\n assertEquals(1, resultMatrixSignificance1.getVisibleRowCount());\n assertEquals(\"The width of the mean (0 = optimal).\", resultMatrixSignificance1.meanWidthTipText());\n assertFalse(resultMatrixSignificance1.getRemoveFilterName());\n assertFalse(resultMatrixSignificance1.getDefaultShowAverage());\n assertEquals(2, resultMatrixSignificance1.getStdDevPrec());\n assertTrue(resultMatrixSignificance1.getDefaultPrintRowNames());\n assertEquals(0, resultMatrixSignificance1.getSignificanceWidth());\n assertEquals(1, resultMatrixSignificance1.getRowCount());\n assertFalse(resultMatrixSignificance1.getPrintColNames());\n assertEquals(\"Only outputs the significance indicators. Can be used for spotting patterns.\", resultMatrixSignificance1.globalInfo());\n assertEquals(0, resultMatrixSignificance1.getDefaultCountWidth());\n assertEquals(\"Whether to display the standard deviation column.\", resultMatrixSignificance1.showStdDevTipText());\n assertFalse(resultMatrixSignificance1.getShowAverage());\n assertEquals(0, resultMatrixSignificance1.getStdDevWidth());\n assertEquals(\"Significance only\", resultMatrixSignificance1.getDisplayName());\n assertTrue(resultMatrixSignificance1.getEnumerateColNames());\n assertEquals(\"Whether to remove the classname package prefixes from the filter names in datasets.\", resultMatrixSignificance1.removeFilterNameTipText());\n assertEquals(0, resultMatrixSignificance1.getColNameWidth());\n assertEquals(\"The width of the significance indicator (0 = optimal).\", resultMatrixSignificance1.significanceWidthTipText());\n assertEquals(0, resultMatrixSignificance1.getMeanWidth());\n assertEquals(\"Whether to enumerate the column names (prefixing them with '(x)', with 'x' being the index).\", resultMatrixSignificance1.enumerateColNamesTipText());\n assertEquals(\"Whether to output column names or just numbers representing them.\", resultMatrixSignificance1.printColNamesTipText());\n assertEquals(\"The number of decimals after the decimal point for the standard deviation.\", resultMatrixSignificance1.stdDevPrecTipText());\n assertEquals(2, resultMatrixSignificance1.getMeanPrec());\n assertEquals(\"The maximum width for the row names (0 = optimal).\", resultMatrixSignificance1.rowNameWidthTipText());\n assertFalse(resultMatrixSignificance1.getShowStdDev());\n assertFalse(resultMatrixSignificance1.getDefaultShowStdDev());\n assertNotNull(resultMatrixSignificance1);\n assertEquals(0, ResultMatrix.SIGNIFICANCE_TIE);\n assertEquals(1, ResultMatrix.SIGNIFICANCE_WIN);\n assertEquals(2, ResultMatrix.SIGNIFICANCE_LOSS);\n assertFalse(resultMatrixSignificance1.equals((Object)resultMatrixSignificance0));\n \n String[] stringArray0 = new String[24];\n resultMatrixSignificance0.setColNameWidth(0);\n assertEquals(40, resultMatrixSignificance0.getDefaultRowNameWidth());\n assertEquals(0, resultMatrixSignificance0.getDefaultSignificanceWidth());\n assertEquals(0, resultMatrixSignificance0.getCountWidth());\n assertEquals(\"The width of the counts (0 = optimal).\", resultMatrixSignificance0.countWidthTipText());\n assertFalse(resultMatrixSignificance0.getRemoveFilterName());\n assertEquals(\"Whether to output row names or just numbers representing them.\", resultMatrixSignificance0.printRowNamesTipText());\n assertFalse(resultMatrixSignificance0.getDefaultShowStdDev());\n assertFalse(resultMatrixSignificance0.getDefaultRemoveFilterName());\n assertEquals(\"Whether to enumerate the column names (prefixing them with '(x)', with 'x' being the index).\", resultMatrixSignificance0.enumerateColNamesTipText());\n assertEquals(1, resultMatrixSignificance0.getColCount());\n assertEquals(0, resultMatrixSignificance0.getDefaultMeanWidth());\n assertEquals(\"The number of decimals after the decimal point for the standard deviation.\", resultMatrixSignificance0.stdDevPrecTipText());\n assertEquals(0, resultMatrixSignificance0.getDefaultColNameWidth());\n assertEquals(\"The maximum width for the row names (0 = optimal).\", resultMatrixSignificance0.rowNameWidthTipText());\n assertEquals(0, resultMatrixSignificance0.getColNameWidth());\n assertEquals(\"Whether to enumerate the row names (prefixing them with '(x)', with 'x' being the index).\", resultMatrixSignificance0.enumerateRowNamesTipText());\n assertTrue(resultMatrixSignificance0.getEnumerateColNames());\n assertEquals(0, resultMatrixSignificance0.getMeanWidth());\n assertFalse(resultMatrixSignificance0.getDefaultShowAverage());\n assertTrue(resultMatrixSignificance0.getDefaultEnumerateColNames());\n assertEquals(1, resultMatrixSignificance0.getVisibleRowCount());\n assertEquals(\"The maximum width of the column names (0 = optimal).\", resultMatrixSignificance0.colNameWidthTipText());\n assertEquals(0, resultMatrixSignificance0.getDefaultCountWidth());\n assertEquals(\"The width of the standard deviation (0 = optimal).\", resultMatrixSignificance0.stdDevWidthTipText());\n assertFalse(resultMatrixSignificance0.getDefaultPrintColNames());\n assertEquals(\"Only outputs the significance indicators. Can be used for spotting patterns.\", resultMatrixSignificance0.globalInfo());\n assertEquals(\"The number of decimals after the decimal point for the mean.\", resultMatrixSignificance0.meanPrecTipText());\n assertEquals(2, resultMatrixSignificance0.getDefaultStdDevPrec());\n assertEquals(\"Significance only\", resultMatrixSignificance0.getDisplayName());\n assertEquals(0, resultMatrixSignificance0.getStdDevWidth());\n assertEquals(\"Whether to show the row with averages.\", resultMatrixSignificance0.showAverageTipText());\n assertEquals(1, resultMatrixSignificance0.getRowCount());\n assertEquals(\"Whether to display the standard deviation column.\", resultMatrixSignificance0.showStdDevTipText());\n assertTrue(resultMatrixSignificance0.getDefaultPrintRowNames());\n assertEquals(0, resultMatrixSignificance0.getRowNameWidth());\n assertFalse(resultMatrixSignificance0.getPrintColNames());\n assertEquals(2, resultMatrixSignificance0.getStdDevPrec());\n assertEquals(\"The width of the mean (0 = optimal).\", resultMatrixSignificance0.meanWidthTipText());\n assertEquals(0, resultMatrixSignificance0.getSignificanceWidth());\n assertFalse(resultMatrixSignificance0.getEnumerateRowNames());\n assertFalse(resultMatrixSignificance0.getShowStdDev());\n assertEquals(2, resultMatrixSignificance0.getMeanPrec());\n assertEquals(\"Whether to remove the classname package prefixes from the filter names in datasets.\", resultMatrixSignificance0.removeFilterNameTipText());\n assertEquals(\"Whether to output column names or just numbers representing them.\", resultMatrixSignificance0.printColNamesTipText());\n assertFalse(resultMatrixSignificance0.getDefaultEnumerateRowNames());\n assertEquals(\"The width of the significance indicator (0 = optimal).\", resultMatrixSignificance0.significanceWidthTipText());\n assertTrue(resultMatrixSignificance0.getShowAverage());\n assertEquals(0, resultMatrixSignificance0.getDefaultStdDevWidth());\n assertEquals(2, resultMatrixSignificance0.getDefaultMeanPrec());\n assertEquals(1, resultMatrixSignificance0.getVisibleColCount());\n assertTrue(resultMatrixSignificance0.getPrintRowNames());\n assertNotSame(resultMatrixSignificance0, resultMatrixSignificance1);\n assertEquals(0, ResultMatrix.SIGNIFICANCE_TIE);\n assertEquals(1, ResultMatrix.SIGNIFICANCE_WIN);\n assertEquals(2, ResultMatrix.SIGNIFICANCE_LOSS);\n assertFalse(resultMatrixSignificance0.equals((Object)resultMatrixSignificance1));\n \n stringArray0[0] = \")\";\n stringArray0[1] = \"$circ$\";\n stringArray0[2] = \"*\";\n stringArray0[3] = \" \";\n stringArray0[4] = \"$\\bullet$\";\n try { \n resultMatrixSignificance1.setOptions(stringArray0);\n fail(\"Expecting exception: NullPointerException\");\n \n } catch(NullPointerException e) {\n //\n // no message in exception (getMessage() returned null)\n //\n verifyException(\"weka.core.Utils\", e);\n }\n }", "public static void main(String[] args) {\n\t\t// Fix the number of rows and columns in the matrix\n\t\tfinal int NUMBER_OF_ROWS = 6, NUMBER_OF_COLUMNS = 6;\n\n\t\t// matrix of 6 x 6\n\t\tint[][] matrix = { { 0, 0, 0, 0, 0, 0 }, { 0, 0, 0, 0, 0, 0 }, { 0, 0, 1, 1, 1, 0 }, { 0, 0, 0, 0, 0, 0 },\n\t\t\t\t{ 0, 0, 0, 0, 0, 0 }, { 0, 0, 0, 0, 0, 0 } };\n\n\t\t// Displaying the initial matrix\n\t\tprintMatrix(matrix, NUMBER_OF_ROWS, NUMBER_OF_COLUMNS);\n\n\t\t// // Loop till all iterations completed in the game\n\t\t// for (int iterationCounter = 0; iterationCounter <= TOTAL_ITERATIONS;\n\t\t// iterationCounter++) {\n\t\t// // perform the nextMatrixCycle step or the iteration\n\t\t// nextIteration(matrix, NUMBER_OF_ROWS, NUMBER_OF_COLUMNS);\n\t\t// }\n\n\t\t// perform the nextMatrixCycle step or the iteration\n\t\tnextIteration(matrix, NUMBER_OF_ROWS, NUMBER_OF_COLUMNS);\n\t}", "public static void main(String[] args) {\n\tFile inputFile = new File(\".//src//inputs.txt\");\n\ttry {\n\tscanner = new Scanner(inputFile);\n\t} catch (FileNotFoundException e) {\n\tSystem.out.println(\"inputs.txt file not found\");\n\te.printStackTrace();\n\t}\n\t// Read Matrices from inputs.txt file\n\tSystem.out.println(\"Reading data from inputs.txt file placed in src directory(package)\");\n\t// Read first matrix\n\t// Read the number of rows\n\tint rows, columns;\n\trows = scanner.nextInt();\n\t// Read the number of columns\n\tcolumns = scanner.nextInt();\n\t// Read first Matrix\n\tint[][] a = readMatrix(rows, columns);\n\t// Read the second matrix\n\trows = scanner.nextInt();\n\t// Read the number of columns\n\tcolumns = scanner.nextInt();\n\t// Read first Matrix\n\tint[][] b = readMatrix(rows, columns);\n\n\t// Read the third matrix\n\trows = scanner.nextInt();\n\t// Read the number of columns\n\tcolumns = scanner.nextInt();\n\t// Read first Matrix\n\tint[][] c = readMatrix(rows, columns);\n\t// Generate a forth matrix with random number generator\n\tint[][] d = generateMatrix(rows, columns);\n\t// Print input Matrices\n\tSystem.out.println();\n\tSystem.out.println(\" ******* Matrix A *******\");\n\tprintMatrix(a);\n\tSystem.out.println();\n\tSystem.out.println(\" ******* Matrix B *******\");\n\tprintMatrix(b);\n\tSystem.out.println();\n\tSystem.out.println(\" ******* Matrix C *******\");\n\tprintMatrix(c);\n\tSystem.out.println();\n\tSystem.out.println(\" ******* Matrix D *******\");\n\tprintMatrix(d);\n\tSystem.out.println();\n\tSystem.out.println(\" ******* Transpose C *******\");\n\tprintMatrix(transpose (c));\n\tSystem.out.println();\n\tSystem.out.println(\" ******** A + B ********\");\n\tprintMatrix(add (a,b));\n\tSystem.out.println();\n\tSystem.out.println(\" ******** A * B ******** \");\n\tprintMatrix(multiply(a,b));\n\tSystem.out.println();\n\tSystem.out.println(\" ******** A - B ******** \");\n\tprintMatrix(subtract(a,b));\n\tSystem.out.println();\n\tSystem.out.println(\" ***** (A + B) - TransposeOf(C) ***** \");\n\tprintMatrix(subtract(add(a,b),transpose(c)));\n\tSystem.out.println();\n\tSystem.out.println(\" ***** ((A + B) - TransposeOf(C)) * A ***** \");\n\tprintMatrix(multiply(subtract(add(a,b),transpose(c)),a));\n\tSystem.out.println();\n\tSystem.out.println(\" ***** (((A + B) - TransposeOf(C)) * A) + D ***** \");\n\tprintMatrix(add(multiply(subtract(add(a,b),transpose(c)),a),d));\n\tSystem.out.println();\n\tSystem.out.println(\"***** Minimum Element in (((A + B) - TransposeOf(C)) * A) + D *****\");\n\tSystem.out.println(\"Minimum Element =\"+minOfElements(add(multiply(subtract(add(a,b),transpose(c)),a),d)));\n\tSystem.out.println();\n\tSystem.out.println(\"***** Sum of Elements in (((A + B) - TransposeOf(C)) * A) + D *****\");\n\tSystem.out.println(\"Sum of elements = \"+sumOfElements(add(multiply(subtract(add(a,b),transpose(c)),a),d)));\n\t}", "public static void main(String[] args)\n{\n if (args.length != 1) {\n System.out.println(\"This program computes the product of n x n matrix with itself\");\n System.out.println(\"Usage: ./matrix_multiply n\" );\n System.exit(-1);\n }\n // parse intput matrix size\n int n =0 ;\n try {\n n = Integer.parseInt(args[0]);\n } catch (Exception e) {\n System.out.println(\"Passed n \\'\" + args[0] + \"\\' is not an integer!\");\n System.exit(-1);\n }\n\n // dynamically allocate space for matrix_A (intput matrix) int 1d array\n int[] matrix_A = new int[n*n];\n // dynamically allocate space for matrix_B (output matrix) int 1d array\n int[] matrix_B = new int[n*n];\n\n // call function to read data from file and copy into matrix_A\n generateArray(matrix_A, n, n);\n\n // call function to perform matrix multiplication ( matrix_B = matrix_A * matrix_A )\n matrixMultiply(matrix_A, n, n, matrix_A, n, n, matrix_B);\n\n // call function to write results (matrix_B) to stdout\n printReduce(matrix_B, n, n);\n\n}", "public static void main (String[] args) {\n int[][] twoD = new int[3][4];\n// Where x is an integer\n// [[x, x, x, x],\n// [x, x, x, x],\n// [x, x, x, x]]\n\n// int[][][] threeD = new int[3][4][3];\n\n// 4x3\n int[][] twoDInit = {{1, 3, 5}, {4, 3, 5}, {1, 4, 5}, {4, 3, 5}};\n\n for (int i = 0; i < twoDInit.length; i++) {\n for (int j = 0; j < twoDInit[i].length; j++) {\n System.out.println(twoDInit[i][j]);\n }\n }\n\n for (int[] ints : twoDInit) {\n for (int anInt : ints) {\n System.out.println(anInt);\n }\n }\n\n for (int i = 0; i < 5; i++) {\n for (int j = 0; j < 7; j++) {\n System.out.print(\"*\");\n }\n System.out.println();\n }\n\n for (int i = 0; i < 5; i++) {\n for (int j = 0; j < i + 1; j++) {\n System.out.print(\"*\");\n }\n System.out.println();\n }\n }", "Matrix(double[][] input) {\n matrixVar = input;\n columns = matrixVar[0].length;\n rows = matrixVar.length;\n }", "public void llenarMatriz(){\n Scanner in = new Scanner(System.in);\n setMatriz(new float[3][3]);\n //int matriz1[][] ={{2,3,1},{1,-1,2},{0,1,0}};\n //int matriz1[][] ={{5,-2,3},{1,2,2},{-4,-1,3}};\n //float matriz1[][] ={{1,-2,5},{3,3,-1},{0,4,-2}};\n for(int i=0;i<3;i++){\n for(int j=0;j<3;j++){\n System.out.println(\"Ingresa valor la posición [\"+i+\"][\"+j+\"]\");\n getMatriz()[i][j]= in.nextInt();\n }\n }\n mostrarMatriz(getMatriz(),\"Matriz inicial\");\n }", "public static void main(String[] args) {\n //declaramos\n int datos[][];\n // tabla 25 elements\n datos = new int[5][5];\n\n System.out.println(datos.length);\n //Los algoritmos que utilizan matrices requieren dos\n // bucles anidadados. Un bucle se encarga del indice para la\n // dimension X y el otro bucle se encarga para el eje Y\n\n Scanner scanner = new Scanner(System.in);\n System.out.println(\"Ingrese 25 elementos \");\n for (int i = 0; i < datos.length; i++) { // eje x\n for (int j = 0; j < datos.length; j++) { // eje y\n datos[i][j] = scanner.nextInt();\n }\n }\n\n for (int i = 0; i < datos.length; i++) {\n for (int j = 0; j < datos.length; j++) {\n System.out.print(\" \" + datos[i][j]);\n }\n }\n System.out.println(\"-----------------------\");\n System.out.println(Arrays.deepToString(datos));\n }", "public Matrix(int[][] array)\n {\n matrix = array;\n }", "public LifeSimulator(int numRows, int numColumns) throws Exception {\n\t\t_numRows = numRows;\n\t\t_numColumns = numColumns;\n\t\t_matrix = new LifeMatrix(numRows, numColumns);\n\t\tinitMatrix();\n\t}", "public Matrix( int a ) {\n\tmatrix = new Object[a][a];\n }", "public static void main(String[] args) {\n\t\tint row, col;\n\t\tScanner s = new Scanner(System.in);\n\t\tSystem.out.println(\"Enter number of rows for matrix: \");\n\t\trow = s.nextInt();\n\t\tSystem.out.println(\"Enter number of columns for matrix: \");\n\t\tcol = s.nextInt();\n\t\tint[][] mat1 = new int[row][col];\n\t\tSystem.out.println(\"Enter the elements\");\n\t\tfor (int i = 0; i < row; i++) {\n\t\t\tfor (int j = 0; j < col; j++) {\n\t\t\t\tSystem.out.println(\"Enter [\" + i + \"][\" + j + \"] : \");\n\t\t\t\tmat1[i][j] = s.nextInt();\n\t\t\t}\n\t\t}\n\t\tint[][] mat2 = new int[row][col];\n\t\tSystem.out.println(\"Enter the elements\");\n\t\tfor (int i = 0; i < row; i++) {\n\t\t\tfor (int j = 0; j < col; j++) {\n\t\t\t\tSystem.out.println(\"Enter [\" + i + \"][\" + j + \"] : \");\n\t\t\t\tmat2[i][j] = s.nextInt();\n\t\t\t}\n\t\t}\n\t\tint[][] res = new int[row][col];\n\t\tfor (int i = 0; i < row; i++) {\n\t\t\tfor (int j = 0; j < col; j++) {\n\t\t\t\tres[i][j] = mat1[i][j] + mat2[i][j];\n\t\t\t}\n\t\t}\n\t\tSystem.out.println(\"The result of matrix addition is\");\n\t\tfor (int i = 0; i < row; i++) {\n\t\t\tfor (int j = 0; j < col; j++) {\n\t\t\t\tSystem.out.print(res[i][j]+ \" \");\n\t\t\t}\n\t\t\tSystem.out.println();\n\t\t}\n\n\t}", "public static void printMatrix(Matrix m) {\n double[][]matrix = m.getData();\n for(int row = 0; row < matrix.length; row++) {\n for(int column = 0; column < matrix[row].length; column++)\n System.out.print(matrix[row][column] + \" \");\n System.out.println(\"\");\n }\n }", "private void initMatrix() {\n\t\ttry {\n\t\t\tRandom random = new Random();\n\t\t\tfor (int row=0; row<_numRows; ++row) {\n\t\t\t\tfor (int column=0; column<_numColumns; ++column) {\n\t\t\t\t\t// generate alive cells, with CHANCE_OF_ALIVE chance\n\t\t\t\t\tboolean value = (random.nextInt(100) < CHANCE_OF_ALIVE);\n\t\t\t\t\t_matrix.setCellValue(row, column, value);\n\t\t\t\t}\n\t\t\t}\n\t\t} catch (Exception e) {\n\t\t\t// This is not supposed to happend because we use only legal row and column numbers\n\t\t}\n\t}", "private void buildMatrix() {\n\n int totalnumber=this.patents.size()*this.patents.size();\n\n\n\n int currentnumber=0;\n\n\n for(int i=0;i<this.patents.size();i++) {\n ArrayList<Double> temp_a=new ArrayList<>();\n for (int j=0;j<this.patents.size();j++) {\n if (i==j) temp_a.add(0.0); else if (i<j)\n {\n double temp = distance.distance(this.patents.get(i), this.patents.get(j));\n temp = (new BigDecimal(temp).setScale(2, RoundingMode.UP)).doubleValue();\n temp_a.add(temp);\n\n\n // simMatrix.get(i).set(j, temp);\n // simMatrix.get(j).set(i, temp);\n } else {\n temp_a.add(simMatrix.get(j).get(i));\n }\n currentnumber++;\n System.out.print(\"\\r\"+ProgressBar.barString((int)((currentnumber*100/totalnumber)))+\" \"+currentnumber);\n\n }\n simMatrix.add(temp_a);\n }\n System.out.println();\n\n }", "public void initialise(Graph graph) {\n Entry[][] matrix = graph.matrix();\n matrix[START_INDEX][0] = new Entry(0.0, 0.0);\n double initial = 1.0 / graph.size();\n\n for (int i = 1; i < graph.size(); i++) {\n matrix[i][0] = new Entry(initial, initial);\n }\n }", "public static void main(String[] args) {\n\t\tint mat[][]= {{1,2,3},{4,5,6},{7,8,9}};\n\t\tspiralPrint(mat);\n\t}", "void printMatrix(int[][] matrix){\n\t\tfor(int i = 0; i < matrix.length; i++){\n\t\t\tfor(int j = 0; j < matrix[i].length; j++){\n\t\t\t\tSystem.out.print(matrix[i][j] + \"\\t\");\n\t\t\t}\n\t\t\tSystem.out.println(\"\");\n\t\t}\n\t}", "public Display() {\r\n\t\t//Fills the board with invalid positions\r\n\t\tboard = new int[17][17];\r\n\t\tfor (int i = 0; i < 17; i++)\r\n\t\t\tfor (int j = 0; j < 17; j++)\r\n\t\t\t\tboard[i][j] = -1;\r\n\r\n\t\t//Fills the center of the board with valid positions\r\n\t\tfor (int i = 4; i <= 12; i++)\r\n\t\t\tfor (int j = 4; j <= 12; j++)\r\n\t\t\t\tboard[i][j] = 0;\r\n\t\t\r\n\t\t//Fills the rest of the board with valid positions\r\n\t\tfillTriangle(-1, board, 0, 16, 12);\r\n\t\tfillTriangle(1, board, 0, 9, 13);\r\n\t\tfillTriangle(-1, board, 0, 7, 12);\r\n\t\tfillTriangle(1, board, 0, 0, 4);\r\n\t\tfillTriangle(-1, board, 0, 7, 3);\r\n\t\tfillTriangle(1, board, 0, 9, 4);\r\n\t\t\r\n\t\tthis.setPreferredSize(SIZE);\r\n\t}", "public static void main(String[] args) {\n\t\tint size;\n\t\tScanner input = new Scanner(System.in);\n\t\tSystem.out.println(\"Enter the size of the matrix: \");\n\t\t\n\t\t//Inputs size values \n\t\tsize = input.nextInt();\n\t\t\n\t\t//Inputs the numbers entered into the matrix\n\t\tint matrix[][] = new int[size][size];\n\t\tSystem.out.println(\"Enter numbers into the matrix row-by-row: \");\n\t\tfor (int i=0; i<size; i++) {\n\t\t\tfor(int j=0; j<size; j++) {\n\t\t\t\tmatrix[i][j] = input.nextInt();\n\t\t\t}\n\t\t}\n\t\t\n\t\t//Prints original matrix \n\t\tSystem.out.println(\"Original matrix\");\n\t\tfor(int i=0; i<size; i++) {\n\t\t\tfor(int j=0; j<size; j++) {\n\t\t\t\tSystem.out.print(matrix[i][j]+ \" \");\n\t\t\t}\n\t\t\t\n\t\t\tSystem.out.println();\n\t\t}\n\t\t\n\t\t//Prints the transpose of the matrix\n\t\tSystem.out.println(\"Transpose of the matrix:\");\n\t\tfor(int i=0; i<size; i++) {\n\t\t\tfor(int j=0; j<size; j++) {\n\t\t\t\tSystem.out.print(matrix[j][i]+ \" \");\n\t\t\t}\n\t\t\tSystem.out.println();\n\n\t\t}\n\t\tinput.close();\n\t}", "public static void main(String[] args) {\n\t\tint[] numeros = new int[10];\r\n\t\tint[][] matriz = new int [10][2];\r\n\t\t//posicion 5 del array\r\n\t\tnumeros[5] = 23;\r\n\t\t//posicion en matriz\r\n\t\tmatriz[1][2] = 45; \r\n\t\t\r\n\r\n\t}", "public void populateMatrices(Matrix arrayOfMatrices[]){\n String[] rows;\n String[] columns;\n matrixCounter=0;\n try{ \n br = new BufferedReader(new FileReader(\"E:\\\\NUST\\\\6th Semester\\\\Advanced Programming - AP\\\\Labs\\\\Advanced Programming Lab-1\\\\src\\\\pk\\\\edu\\\\nust\\\\seecs\\\\bscs2\\\\advancedprogramming\\\\lab1\\\\matrices.txt\") );\n br.readLine(); //skipping first line that explains the format of matrices\n while( (currentLine = br.readLine()) != null){ \n if (currentLine.trim().length() > 0){ \n //parse the string. Get the rows and columns. Count length of rows and columns. ADD DELETE FEATURE\n rows = currentLine.split(\";\"); //get rows of current matrix\n currentMatrixRows = rows.length;\n columns = rows[0].split(\"\\\\s\"); //get each element of current row\n currentMatrixColumns = columns.length;\n //call the Matrix parameterized constructor to create a matrix of dimenstions currentMatrixRows x currentMatrixColumns\n arrayOfMatrices[matrixCounter] = new Matrix(currentMatrixRows, currentMatrixColumns); \n \n for(int i=0; i< rows.length; i++){\n columns = rows[i].split(\"\\\\s\"); //get each element of current row \n if(columns.length != currentMatrixColumns){\n System.out.println(\"INVALID MATRIX ENTERED. NUMBER OF COLUMNS IN EVERY ROW SHOULD BE EQUAL.\");\n System.exit(0); \n }\n for(int j=0; j< columns.length ; j++){ \n arrayOfMatrices[matrixCounter].setMatrixElement(i, j, Integer.parseInt(columns[j]) );\n }\n }\n //matrices.add(temp);\n totalMatrices++;\n //arrayOfMatrices[matrixCounter].toString();\n matrixCounter++;\n \n }\n } \n }catch(IOException e){\n e.printStackTrace(); \n }finally{ \n try{\n if(br!=null)\n br.close();\n }catch(IOException e){\n e.printStackTrace();\n }\n } \n \n \n// for(int i=0; i<totalMatrices;i++){\n// arrayOfMatrices[i] = new Matrix(2,3);\n// }\n }", "@SuppressWarnings(\"unchecked\")\n // <editor-fold defaultstate=\"collapsed\" desc=\"Generated Code\">//GEN-BEGIN:initComponents\n private void initComponents() {\n\n jScrollPane1 = new javax.swing.JScrollPane();\n jTable1 = new javax.swing.JTable();\n jButton1 = new javax.swing.JButton();\n\n setClosable(true);\n setTitle(\"CONFUSION MATRIX\");\n\n jTable1.setModel(new javax.swing.table.DefaultTableModel(\n new Object [][] {\n {\"Positive\", null, \"\", \"All with Positive Test\"},\n {\"Neqative\", null, \"\", \"All with Neqative Test\"},\n {null, \"All with disease\", \"All without disease\", null}\n },\n new String [] {\n \"Preduction\\\\Real\", \"Positive\", \"Neqative\", \"\"\n }\n ) {\n Class[] types = new Class [] {\n java.lang.Object.class, java.lang.String.class, java.lang.String.class, java.lang.Object.class\n };\n\n public Class getColumnClass(int columnIndex) {\n return types [columnIndex];\n }\n });\n jTable1.setAutoResizeMode(javax.swing.JTable.AUTO_RESIZE_ALL_COLUMNS);\n jScrollPane1.setViewportView(jTable1);\n\n jButton1.setText(\"Graph\");\n jButton1.addActionListener(new java.awt.event.ActionListener() {\n public void actionPerformed(java.awt.event.ActionEvent evt) {\n jButton1ActionPerformed(evt);\n }\n });\n\n javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());\n getContentPane().setLayout(layout);\n layout.setHorizontalGroup(\n layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGroup(layout.createSequentialGroup()\n .addContainerGap()\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addComponent(jScrollPane1, javax.swing.GroupLayout.DEFAULT_SIZE, 764, Short.MAX_VALUE)\n .addComponent(jButton1, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.PREFERRED_SIZE, 189, javax.swing.GroupLayout.PREFERRED_SIZE))\n .addContainerGap())\n );\n layout.setVerticalGroup(\n layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup()\n .addContainerGap(19, Short.MAX_VALUE)\n .addComponent(jScrollPane1, javax.swing.GroupLayout.PREFERRED_SIZE, 86, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)\n .addComponent(jButton1)\n .addGap(6, 6, 6))\n );\n\n pack();\n }", "public static void main(String[] args) {\n\r\n\t\tint [] [] matriz = new int [ 3 ] [ 3 ];\r\n\t\tint somamat = 0 , somadiago = 0 , L , C ;\r\n\t\t\r\n\t\tScanner ler = new Scanner (System.in);\r\n\t\tfor ( L = 0; L <3; L ++ ) {\r\n\t\t\tfor( C = 0; C <3; C ++ ) {\r\n\t\t\t\tSystem.out.printf (\"\\nEntre com o valor da Matriz [% d] [% d] da matriz \" , L , C );\r\n\t\t\t\tmatriz [ L ] [ C ] = ler . nextInt ();\r\n\t\t\t\tsomamat = somamat + matriz [ L ] [ C ];\r\n\t\t\t}\r\n\t\t}\r\n\t\tsomadiago = matriz [ 0 ] [ 0 ] + matriz [ 1 ] [ 1 ] + matriz [ 2 ] [ 2 ];\r\n\t\tSystem.out.println(\"\");\r\n\t\tSystem.out.println ( \" A soma dos valores da matriz é igual a: \" + somamat);\r\n\t\tSystem.out.println(\"\");\r\n\t\tSystem.out.println ( \" A soma dos valores da diagonal principal é igual a: \" + somadiago);\r\n\t}", "public static void main(String[] args) {\r\n\r\n\t\t// Dataset: 5 X 10 matrix\r\n\t\tint[][] multi = new int[][]{\r\n\t\t\t{ 1, 2, 3, 4, 5, 6, 7, 8, 9, 10 },\r\n\t\t\t{ 2, 0, 0, 0, 0, 0, 0, 0, 0, 0 },\r\n\t\t\t{ 3, 0, 0, 0, 0, 0, 0, 0, 0, 0 },\r\n\t\t\t{ 4, 0, 0, 0, 0, 0, 0, 0, 0, 0 },\r\n\t\t\t{ 5, 0, 0, 0, 0, 0, 0, 0, 0, 0 }\r\n\t\t};\r\n\r\n\t\tMergekSortedLists outer = new MergekSortedLists();\r\n\t\tMergekSortedLists.LinkedList[] inner_list = new MergekSortedLists.LinkedList[5];\r\n\r\n\t\tint outer_index = 0;\r\n\t\tfor( LinkedList inner : inner_list) {\r\n\t\t\tinner = outer.new LinkedList();\r\n\t\t\t\tfor(int data : multi[outer_index]) {\r\n\t\t\t\t\tinner.addFront(data);\r\n\t\t\t\t}\r\n\t\t\tinner_list[outer_index++] = inner;\r\n\t\t}\r\n\t\t\r\n\t\tfor( LinkedList inner : inner_list) {\r\n\t\t\tinner.print();\r\n\t\t}\r\n\r\n\t}", "private void initialize() {\r\n\t\tfor (int i = -1; i < myRows; i++)\r\n\t\t\tfor (int j = -1; j < myColumns; j++) {\r\n\t\t\t\tCell.CellToken cellToken = new Cell.CellToken(j, i);\r\n\r\n\t\t\t\tif (i == -1) {\r\n\t\t\t\t\tif (j == -1)\r\n\t\t\t\t\t\tadd(new JLabel(\"\", null, SwingConstants.CENTER));\r\n\t\t\t\t\telse\r\n\t\t\t\t\t\tadd(new JLabel(cellToken.columnString(), null,\r\n\t\t\t\t\t\t\t\tSwingConstants.CENTER));\r\n\t\t\t\t} else if (j == -1)\r\n\t\t\t\t\tadd(new JLabel(Integer.toString(i), null,\r\n\t\t\t\t\t\t\tSwingConstants.CENTER));\r\n\t\t\t\telse {\r\n\t\t\t\t\tcellArray[i][j] = new CellsGUI(cellToken);\r\n\r\n\t\t\t\t\tsetCellText(cellArray[i][j]);\r\n\t\t\t\t\tcellArray[i][j].addMouseListener(new MouseCellListener());\r\n\t\t\t\t\tcellArray[i][j].addKeyListener(new KeyCellListener());\r\n\t\t\t\t\tcellArray[i][j].addFocusListener(new FocusCellListener());\r\n\r\n\t\t\t\t\tadd(cellArray[i][j]);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t}", "public static void main(String[] args) {\n\t\t\n\t\t@SuppressWarnings(\"resource\")\n\t\tScanner sc=new Scanner(System.in);\n\t\tSystem.out.println(\"enter two dimensions of matrix\");\n\t\tint x=sc.nextInt();\n\t\tint y=sc.nextInt();\n\t\tint a[][] =new int[x][y];\n\t\tSystem.out.println(\"enter values:\");\n\t\tfor(int i=0;i<x;i++){\n\t\t\tfor(int j=0;j<y;j++){\n\t\t\ta[i][j]=sc.nextInt();\n\t\t\t\n\t\t\t}\n\t\t}\n\t\t\n\t\t\n\t\tfor(int i=0;i<x;i++){\n\t\t\tfor(int j=0;j<y;j++){\n\t\t\tSystem.out.print(\" \"+a[i][j]);\n\t\t\t\n\t\t\t}System.out.println();\n\t\t}\n\t\t\n\t}", "private static Node setupMatrix()\n {\n Node thomasAnderson = graphDb.createNode();\n thomasAnderson.setProperty( \"name\", \"Thomas Anderson\" );\n thomasAnderson.setProperty( \"age\", 29 );\n \n Node trinity = graphDb.createNode();\n trinity.setProperty( \"name\", \"Trinity\" );\n Relationship rel = thomasAnderson.createRelationshipTo( trinity, \n MatrixRelationshipTypes.KNOWS );\n rel.setProperty( \"age\", \"3 days\" );\n \n Node morpheus = graphDb.createNode();\n morpheus.setProperty( \"name\", \"Morpheus\" );\n morpheus.setProperty( \"rank\", \"Captain\" );\n morpheus.setProperty( \"occupation\", \"Total badass\" );\n thomasAnderson.createRelationshipTo( morpheus, MatrixRelationshipTypes.KNOWS );\n rel = morpheus.createRelationshipTo( trinity, \n MatrixRelationshipTypes.KNOWS );\n rel.setProperty( \"age\", \"12 years\" );\n \n Node cypher = graphDb.createNode();\n cypher.setProperty( \"name\", \"Cypher\" );\n cypher.setProperty( \"last name\", \"Reagan\" );\n rel = morpheus.createRelationshipTo( cypher, \n MatrixRelationshipTypes.KNOWS );\n rel.setProperty( \"disclosure\", \"public\" );\n \n Node smith = graphDb.createNode();\n smith.setProperty( \"name\", \"Agent Smith\" );\n smith.setProperty( \"version\", \"1.0b\" );\n smith.setProperty( \"language\", \"C++\" );\n rel = cypher.createRelationshipTo( smith, MatrixRelationshipTypes.KNOWS );\n rel.setProperty( \"disclosure\", \"secret\" );\n rel.setProperty( \"age\", \"6 months\" );\n \n Node architect = graphDb.createNode();\n architect.setProperty( \"name\", \"The Architect\" );\n smith.createRelationshipTo( architect, MatrixRelationshipTypes.CODED_BY );\n \n return thomasAnderson;\n }", "public static void main(String[] args) {\n int[][] numbers = new int[2][5];\n\n //initializing 2D Array by putting element on it\n numbers = new int[][]{ {1, 0, 12, 2, 4},\n {7, 8, 3, 5, 4,} };\n\n System.out.println(\"The total numbers in array is = \" + getTotal(numbers));\n System.out.println(\"The Average of this array is = \" + getAverage(numbers));\n System.out.println(\"The row total of this array is = \" + getRowTotal(numbers, 0)); // it will count the first row because it start at 0\n System.out.println(\"The column total of this array is = \" + getColumnTotal(numbers, 3)); // it will count the second column because it start at 0\n System.out.println(\"The highest element in row of an array is = \" + getHighestInRow(numbers, 0));\n System.out.println(\"The highest element in column of an array is = \" + getHighestInColumn(numbers, 0));\n }", "private void initialize() {\n\t\tfrmMatrices = new JFrame();\n\t\tfrmMatrices.setTitle(\"Matrices\");\n\t\tfrmMatrices.setBounds(100, 100, 378, 225);\n\t\tfrmMatrices.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);\n\t\tfrmMatrices.getContentPane().setLayout(null);\n\t\t\n\t\tJTabbedPane tabbedPane = new JTabbedPane(JTabbedPane.TOP);\n\t\ttabbedPane.setBounds(0, 0, 360, 120);\n\t\tfrmMatrices.getContentPane().add(tabbedPane);\n\t\t\n\t\tJLayeredPane layeredPane = new JLayeredPane();\n\t\ttabbedPane.addTab(\"Matriz 1\", null, layeredPane, null);\n\t\tlayeredPane.setLayout(new BorderLayout(0, 0));\n\t\t\n\t\ttableM1 = new JTable();\n\t\ttableM1.setRowHeight(30);\n\t\ttableM1.setModel(new DefaultTableModel(\n\t\t\tnew Object[][] {\n\t\t\t\t{null, null, null},\n\t\t\t\t{null, null, null},\n\t\t\t\t{null, null, null},\n\t\t\t},\n\t\t\tnew String[] {\n\t\t\t\t\"\", \"\", \"\"\n\t\t\t}\n\t\t) {\n\t\t\tClass[] columnTypes = new Class[] {\n\t\t\t\tInteger.class, Integer.class, Integer.class\n\t\t\t};\n\t\t\tpublic Class getColumnClass(int columnIndex) {\n\t\t\t\treturn columnTypes[columnIndex];\n\t\t\t}\n\t\t});\n\t\ttableM1.getColumnModel().getColumn(0).setPreferredWidth(76);\n\t\tlayeredPane.add(tableM1, BorderLayout.CENTER);\n\t\t\n\t\tJLayeredPane layeredPane_1 = new JLayeredPane();\n\t\ttabbedPane.addTab(\"Matriz 2\", null, layeredPane_1, null);\n\t\tlayeredPane_1.setLayout(new BorderLayout(0, 0));\n\t\t\n\t\ttableM2 = new JTable();\n\t\ttableM2.setModel(new DefaultTableModel(\n\t\t\tnew Object[][] {\n\t\t\t\t{null, null, null},\n\t\t\t\t{null, null, null},\n\t\t\t\t{null, null, null},\n\t\t\t},\n\t\t\tnew String[] {\n\t\t\t\t\"\", \"\", \"\"\n\t\t\t}\n\t\t) {\n\t\t\tClass[] columnTypes = new Class[] {\n\t\t\t\tInteger.class, Integer.class, Integer.class\n\t\t\t};\n\t\t\tpublic Class getColumnClass(int columnIndex) {\n\t\t\t\treturn columnTypes[columnIndex];\n\t\t\t}\n\t\t});\n\t\ttableM2.setRowHeight(30);\n\t\tlayeredPane_1.add(tableM2, BorderLayout.CENTER);\n\t\t\n\t\tJLayeredPane layeredPane_2 = new JLayeredPane();\n\t\ttabbedPane.addTab(\"Suma\", null, layeredPane_2, null);\n\t\tlayeredPane_2.setLayout(new BorderLayout(0, 0));\n\t\t\n\t\ttable_MSuma = new JTable();\n\t\ttable_MSuma.setModel(new DefaultTableModel(\n\t\t\tnew Object[][] {\n\t\t\t\t{null, null, null},\n\t\t\t\t{null, null, null},\n\t\t\t\t{null, null, null},\n\t\t\t},\n\t\t\tnew String[] {\n\t\t\t\t\"\", \"\", \"\"\n\t\t\t}\n\t\t) {\n\t\t\tClass[] columnTypes = new Class[] {\n\t\t\t\tInteger.class, Integer.class, Integer.class\n\t\t\t};\n\t\t\tpublic Class getColumnClass(int columnIndex) {\n\t\t\t\treturn columnTypes[columnIndex];\n\t\t\t}\n\t\t});\n\t\ttable_MSuma.setRowHeight(30);\n\t\tlayeredPane_2.add(table_MSuma, BorderLayout.CENTER);\n\t\t\n\t\tJLayeredPane layeredPane_3 = new JLayeredPane();\n\t\ttabbedPane.addTab(\"Producto\", null, layeredPane_3, null);\n\t\tlayeredPane_3.setLayout(new BorderLayout(0, 0));\n\t\t\n\t\ttableMProd = new JTable();\n\t\ttableMProd.setModel(new DefaultTableModel(\n\t\t\tnew Object[][] {\n\t\t\t\t{null, null, null},\n\t\t\t\t{null, null, null},\n\t\t\t\t{null, null, null},\n\t\t\t},\n\t\t\tnew String[] {\n\t\t\t\t\"\", \"\", \"\"\n\t\t\t}\n\t\t) {\n\t\t\tClass[] columnTypes = new Class[] {\n\t\t\t\tInteger.class, Integer.class, Integer.class\n\t\t\t};\n\t\t\tpublic Class getColumnClass(int columnIndex) {\n\t\t\t\treturn columnTypes[columnIndex];\n\t\t\t}\n\t\t});\n\t\ttableMProd.setRowHeight(30);\n\t\tlayeredPane_3.add(tableMProd, BorderLayout.CENTER);\n\t\t\n\t\tJButton btnCalcular = new JButton(\"Calcular\");\n\t\tbtnCalcular.addActionListener(new ActionListener() {\n\t\t\tpublic void actionPerformed(ActionEvent arg0) {\n\t\t\t\t// suma de matrices\n\t\t\t\tint suma = 0;\n\t\t\t\tfor (int i = 0; i < tableM1.getRowCount(); i++) {\n\t\t\t\t\tfor (int j = 0; j < tableM2.getColumnCount(); j++) {\n\t\t\t\t\t\tsuma = (int)tableM1.getValueAt(i, j) + (int)tableM2.getValueAt(i, j);\n\t\t\t\t\t\ttable_MSuma.setValueAt(new Integer(suma), i, j);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t// producto de matrices\n\t\t\t\tint prod, n, m;\n\t\t\t\tfor (int i = 0; i < tableM1.getRowCount(); i++) {\n\t\t\t\t\tfor (int j = 0; j < tableM1.getRowCount(); j++) {\n\t\t\t\t\t\tprod = 0;\n\t\t\t\t\t\tfor (int k = 0; k < tableM2.getRowCount(); k++) {\n\t\t\t\t\t\t\tn = (int)tableM1.getValueAt(i, k);\n\t\t\t\t\t\t\tm = (int)tableM2.getValueAt(k, j);\n\t\t\t\t\t\t\tprod += n*m;\n\t\t\t\t\t\t}\n\t\t\t\t\t\ttableMProd.setValueAt(prod, i, j);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t} \n\t\t});\n\t\tbtnCalcular.setBounds(133, 133, 97, 25);\n\t\tfrmMatrices.getContentPane().add(btnCalcular);\n\t}", "private void initialize() {\r\n\t\tframe = new JFrame();\r\n\t\tframe.setBounds(100, 100, 450, 300);\r\n\t\tframe.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);\r\n\t\tframe.getContentPane().setLayout(\r\n\t\t\t\tnew MigLayout(\"\", \"[][][]\", \"[][][][][][][][][][]\"));\r\n\r\n\t\tJLabel lblName = new JLabel(\"Name:\");\r\n\t\tframe.getContentPane().add(lblName, \"cell 0 0\");\r\n\r\n\t\tJLabel lblPatient = new JLabel(\"\");\r\n\t\tframe.getContentPane().add(lblPatient, \"cell 2 0\");\r\n\r\n\t\tJLabel lblDoctor = new JLabel(\"Doctor:\");\r\n\t\tframe.getContentPane().add(lblDoctor, \"cell 0 1\");\r\n\r\n\t\tJLabel lblDoc = new JLabel(\"\");\r\n\t\tframe.getContentPane().add(lblDoc, \"cell 2 1\");\r\n\r\n\t\tJLabel lblDueDate = new JLabel(\"Due Date:\");\r\n\t\tframe.getContentPane().add(lblDueDate, \"cell 0 2\");\r\n\r\n\t\tJLabel lblDate = new JLabel(\"\");\r\n\t\tframe.getContentPane().add(lblDate, \"cell 2 2\");\r\n\r\n\t\tJLabel lblTotal = new JLabel(\"Total:\");\r\n\t\tframe.getContentPane().add(lblTotal, \"cell 0 8\");\r\n\r\n\t\tJLabel lblTot = new JLabel(\"\");\r\n\t\tframe.getContentPane().add(lblTot, \"cell 2 8\");\r\n\r\n\t\tJLabel lblPaid = new JLabel(\"Paid:\");\r\n\t\tframe.getContentPane().add(lblPaid, \"cell 0 9,aligny baseline\");\r\n\r\n\t\tJLabel lblDone = new JLabel(\"\");\r\n\t\tframe.getContentPane().add(lblDone, \"cell 2 9\");\r\n\t}", "public static void main(String[] args) {\n\t\tSystem.out.println(\"Enter size of row and colum of matrix NXM\");\r\n\t\tint n;\r\n\t\tint m;\r\n\t\t\r\n\t\tScanner sc = new Scanner(System.in);\r\n\t\tn = sc.nextInt();\r\n\t\tm = sc.nextInt();\r\n\t\t\r\n\t\tSystem.out.println(\"Enter the matrix\");\r\n\t\t\r\n\t\tint[][] mat = new int[n][m];\r\n\t\t\r\n\t\tfor( int i = 0; i < n; i++){\r\n\t\t\tfor( int j = 0; j < m ; j++){\r\n\t\t\t\tmat[i][j] = sc.nextInt();\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\tQues1_7 q7 = new Ques1_7();\r\n\t\tq7.replace(mat,n,m);\r\n\t\t\r\n\t\tfor( int i = 0; i < n; i++){\r\n\t\t\tfor( int j = 0 ; j < m; j++){\r\n\t\t\t\tSystem.out.print(mat[i][j]+\" \");\r\n\t\t\t}\r\n\t\t\tSystem.out.println();\r\n\t\t}\r\n\t\t\r\n\t\t\r\n\t}" ]
[ "0.72924197", "0.6953153", "0.6701102", "0.6682332", "0.66813105", "0.65525657", "0.65387726", "0.64768875", "0.64580196", "0.64395845", "0.64166224", "0.6413496", "0.6381122", "0.6365499", "0.6337824", "0.63234127", "0.63055193", "0.6298777", "0.62806493", "0.6270175", "0.62538385", "0.62380123", "0.6218799", "0.62176347", "0.61572534", "0.61392456", "0.6133665", "0.6125841", "0.61139864", "0.6108842", "0.6107283", "0.6094011", "0.60658985", "0.60435355", "0.60434353", "0.6028107", "0.60217273", "0.6016957", "0.600401", "0.59921205", "0.5989855", "0.59845006", "0.5975085", "0.5965981", "0.5951147", "0.59404784", "0.591584", "0.59134376", "0.59067726", "0.5903128", "0.5900334", "0.5894862", "0.588758", "0.58732384", "0.58599776", "0.5854", "0.5851589", "0.58438", "0.58285105", "0.581187", "0.5807455", "0.58056587", "0.5795169", "0.5781267", "0.57756937", "0.5772858", "0.575859", "0.5757832", "0.5752687", "0.5747025", "0.57324934", "0.5730606", "0.5721377", "0.57183874", "0.57126313", "0.5703793", "0.56965554", "0.5689219", "0.56886744", "0.56831056", "0.5677833", "0.56649375", "0.56647074", "0.5658154", "0.5654041", "0.5652137", "0.56512105", "0.56462073", "0.5644044", "0.56420434", "0.5641122", "0.562823", "0.5626759", "0.56263834", "0.5626383", "0.5618445", "0.56123567", "0.5604859", "0.5601615", "0.5600117", "0.5599942" ]
0.0
-1
Created by zhang on 2017/6/14.
public interface ST <Key extends Comparable<Key>,Value >{ /*插入新值*/ public void put(Key key,Value value); /*取值*/ public Value get(Key key); /*删除key对应的键值对*/ public void delete(Key key); /*是否包含*/ public boolean contains(Key key); /*是否为空*/ public boolean isEmpty(); /*符号表大小*/ public int size(); // /*最小的键*/ // public Key min(); // // /*最大的键*/ // public Key max(); // // /*向上取整,小于等于key的最小整数*/ // public Key ceiling(Key key); // // /*向下取整*/ // public Key floor(Key key); // // /*排名为index的键*/ // public Key select(int index); // /*小于key的键的数量*/ public int rank(Key key); // // /*删除最小键*/ // public void deleteMin(); // // /*删除最大键*/ // public void deleteMax(); // // /*lo..hi 之间建的数量*/ // public int size(Key lo,Key hi); // // /*li...hi之间所有的键,已排序*/ // Iterable<Key> keys(Key lo,Key hi); // // /*表中所有的键,已排序*/ // Iterable<Key> keys(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Override\n public void perish() {\n \n }", "private stendhal() {\n\t}", "@Override\n\tpublic void comer() {\n\t\t\n\t}", "@Override\n\tpublic void grabar() {\n\t\t\n\t}", "private static void cajas() {\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\r\n\tpublic void comer() \r\n\t{\n\t\t\r\n\t}", "@Override\n public void func_104112_b() {\n \n }", "@Override\r\n\tpublic void tires() {\n\t\t\r\n\t}", "@Override\n\tprotected void getExras() {\n\n\t}", "@Override\n\tpublic void anular() {\n\n\t}", "private void poetries() {\n\n\t}", "@Override\n\tprotected void interr() {\n\t}", "@Override\r\n\tpublic void rozmnozovat() {\n\t}", "@Override\n\tpublic void nadar() {\n\t\t\n\t}", "@Override\n public void init() {\n\n }", "@Override\r\n\t\t\tpublic void annadir() {\n\r\n\t\t\t}", "@Override\r\n\t\t\tpublic void ayuda() {\n\r\n\t\t\t}", "@Override\n\tpublic void gravarBd() {\n\t\t\n\t}", "private void strin() {\n\n\t}", "@Override\n\tpublic void entrenar() {\n\t\t\n\t}", "@Override\r\n\tpublic void dormir() {\n\t\t\r\n\t}", "private void init() {\n\n\t}", "@Override\n\tpublic void init() {\n\t\t\n\t}", "@Override\n\tpublic void init() {\n\t\t\n\t}", "@Override\n\tpublic void init() {\n\t\t\n\t}", "@Override\n\tpublic void init() {\n\t\t\n\t}", "@Override\n\tpublic void init() {\n\t\t\n\t}", "@Override\n protected void initialize() {\n\n \n }", "public void gored() {\n\t\t\n\t}", "@Override\n\tpublic void nghe() {\n\n\t}", "private void kk12() {\n\n\t}", "@Override\n\tpublic void sacrifier() {\n\t\t\n\t}", "@Override\r\n\t\tpublic void init() {\n\t\t\t\r\n\t\t}", "public void mo38117a() {\n }", "@Override\n public void init() {\n }", "@Override\n void init() {\n }", "@Override\r\n\tpublic void init() {\n\r\n\t}", "@Override\r\n\tpublic void init() {\n\r\n\t}", "@Override\r\n\tpublic void init() {\n\r\n\t}", "public final void mo51373a() {\n }", "@Override\n protected void getExras() {\n }", "@Override\n\tpublic void jugar() {\n\t\t\n\t}", "@Override\n public void inizializza() {\n\n super.inizializza();\n }", "@Override\n public void init() {\n\n }", "@Override\n public void init() {\n\n }", "@Override\r\n\tpublic void dibujar() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void dibujar() {\n\t\t\r\n\t}", "@Override\n\tpublic void init() {\n\n\t}", "@Override\n\tpublic void init() {\n\n\t}", "@Override\n\tpublic void init() {\n\n\t}", "public void mo4359a() {\n }", "private void init() {\n\n\n\n }", "@Override\r\n\tpublic void init() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void init() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void init() {\n\t\t\r\n\t}", "protected boolean func_70814_o() { return true; }", "@Override\n\tpublic void ligar() {\n\t\t\n\t}", "@Override\n public void memoria() {\n \n }", "@Override\n protected void initialize() \n {\n \n }", "private void m50366E() {\n }", "@Override\n\tpublic void einkaufen() {\n\t}", "@Override\n\tpublic void one() {\n\t\t\n\t}", "@Override\n protected void init() {\n }", "@Override\r\n\tprotected void doF8() {\n\t\t\r\n\t}", "@Override\n\tprotected void initialize() {\n\t\t\n\t}", "@Override\n\tprotected void initialize() {\n\t\t\n\t}", "@Override\n public void init() {}", "@Override\n\tpublic void init()\n\t{\n\n\t}", "@Override\n\tprotected void initdata() {\n\n\t}", "@Override\r\n\tprotected void initialize() {\r\n\t\t\r\n\t\t\r\n\t}", "Constructor() {\r\n\t\t \r\n\t }", "@Override\r\n\tpublic void init() {}", "@Override\r\n\tpublic void init()\r\n\t{\n\t}", "@Override\r\n\tpublic void anularFact() {\n\t\t\r\n\t}", "@Override\n\tpublic void init() {\n\t}", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "@Override\n protected void initialize() {\n }", "@Override\n protected void initialize() {\n }", "@Override\n protected void initialize() {\n }", "@Override\n protected void initialize() {\n }", "@Override\n protected void initialize() {\n }", "@Override\n protected void initialize() {\n }", "public void mo6081a() {\n }", "@Override\n\tpublic void emprestimo() {\n\n\t}", "@Override\r\n\tvoid func04() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void doF4() {\n\t\t\r\n\t}", "@Override\n\tprotected void initialize() {\n\n\t}", "@Override\r\n\tprotected void func03() {\n\t\t\r\n\t}", "@Override\n\t\t\tpublic void ic() {\n\t\t\t\t\n\t\t\t}", "public void mo55254a() {\n }", "@Override\n\tpublic void debite() {\n\t\t\n\t}", "@Override\n public void initialize() { \n }", "@Override\n public int describeContents() { return 0; }" ]
[ "0.60064983", "0.5858475", "0.5852091", "0.5831154", "0.58253753", "0.57870483", "0.57870483", "0.57334864", "0.5732593", "0.5731926", "0.5688521", "0.568639", "0.56624585", "0.56552047", "0.56389344", "0.56345785", "0.56176263", "0.56150186", "0.56090343", "0.5607363", "0.5603579", "0.5589788", "0.55862266", "0.5560992", "0.5559465", "0.5559465", "0.5559465", "0.5559465", "0.5559465", "0.5553815", "0.55449426", "0.55254275", "0.55227464", "0.5496041", "0.54928344", "0.54809356", "0.54738957", "0.5471813", "0.54693943", "0.54693943", "0.54693943", "0.5464549", "0.5460395", "0.54568285", "0.5455998", "0.5454246", "0.5454246", "0.5441631", "0.5441631", "0.5438053", "0.5438053", "0.5438053", "0.54331106", "0.5424803", "0.54203415", "0.54203415", "0.54203415", "0.5419793", "0.53936195", "0.53931683", "0.53774595", "0.5367663", "0.5363298", "0.535944", "0.53592235", "0.53552085", "0.53472507", "0.53472507", "0.53450835", "0.53431237", "0.5339512", "0.53360033", "0.53359246", "0.53346545", "0.5333383", "0.53304857", "0.5324191", "0.53223556", "0.53223556", "0.53223556", "0.53223556", "0.53223556", "0.53223556", "0.53223556", "0.5305991", "0.5305991", "0.5305991", "0.5305991", "0.5305991", "0.5305991", "0.53058016", "0.53005445", "0.529546", "0.52850485", "0.5261656", "0.5255825", "0.5252413", "0.52437305", "0.5241479", "0.5237407", "0.52340007" ]
0.0
-1
TODO Autogenerated method stub
public static void main(String[] args) { System.out.println("This is commited by GitData"); }
{ "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 getExras() {\n\n\t}", "@Override\r\n\tpublic void anularFact() {\n\t\t\r\n\t}", "@Override\n\tpublic void entrenar() {\n\t\t\n\t}", "@Override\n\tpublic void nadar() {\n\t\t\n\t}", "@Override\r\n\tpublic void tires() {\n\t\t\r\n\t}", "@Override\r\n\t\t\tpublic void ayuda() {\n\r\n\t\t\t}", "@Override\n\tprotected void interr() {\n\t}", "@Override\n\tpublic void emprestimo() {\n\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\tpublic void grabar() {\n\t\t\n\t}", "@Override\n\tpublic void gravarBd() {\n\t\t\n\t}", "@Override\r\n\tpublic void rozmnozovat() {\n\t}", "@Override\r\n\tpublic void dormir() {\n\t\t\r\n\t}", "@Override\n protected void getExras() {\n }", "@Override\r\n\tpublic void publierEnchere() {\n\t\t\r\n\t}", "@Override\n\tpublic void nefesAl() {\n\n\t}", "@Override\n\tpublic void ligar() {\n\t\t\n\t}", "@Override\n public void func_104112_b() {\n \n }", "@Override\n\tprotected void initdata() {\n\n\t}", "@Override\n\tpublic void nghe() {\n\n\t}", "@Override\n public void function()\n {\n }", "@Override\n public void function()\n {\n }", "public final void mo51373a() {\n }", "@Override\r\n\tpublic void stehReagieren() {\r\n\t\t//\r\n\t}", "@Override\n public void inizializza() {\n\n super.inizializza();\n }", "@Override\n\tprotected void initData() {\n\t\t\n\t}", "@Override\r\n\t\tpublic void init() {\n\t\t\t\r\n\t\t}", "@Override\n\tpublic void sacrifier() {\n\t\t\n\t}", "@Override\r\n\tprotected void InitData() {\n\t\t\r\n\t}", "public void designBasement() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void initialize() {\r\n\t\t\r\n\t\t\r\n\t}", "public void gored() {\n\t\t\n\t}", "@Override\r\n\tprotected void initData() {\n\r\n\t}", "@Override\n\tpublic void einkaufen() {\n\t}", "@Override\n protected void initialize() {\n\n \n }", "public void mo38117a() {\n }", "@Override\n\tprotected void getData() {\n\t\t\n\t}", "Constructor() {\r\n\t\t \r\n\t }", "@Override\r\n\tpublic void dibujar() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void dibujar() {\n\t\t\r\n\t}", "@Override\n\tpublic void one() {\n\t\t\n\t}", "@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}", "private stendhal() {\n\t}", "@Override\n\tprotected void update() {\n\t\t\n\t}", "@Override\n\t\t\tpublic void ic() {\n\t\t\t\t\n\t\t\t}", "@Override\n\tprotected void initData() {\n\n\t}", "@Override\n\tprotected void initData() {\n\n\t}", "@Override\n\tpublic void init() {\n\t\t\n\t}", "@Override\n\tpublic void init() {\n\t\t\n\t}", "@Override\n\tpublic void init() {\n\t\t\n\t}", "@Override\n\tpublic void init() {\n\t\t\n\t}", "@Override\n\tpublic void init() {\n\t\t\n\t}", "@Override\n public void init() {\n\n }", "@Override\n\tprotected void initialize() {\n\t\t\n\t}", "@Override\n\tprotected void initialize() {\n\t\t\n\t}", "@Override\r\n\tpublic void init() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void init() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void init() {\n\t\t\r\n\t}", "@Override\n\tpublic void debite() {\n\t\t\n\t}", "@Override\r\n\tpublic void init() {\n\r\n\t}", "@Override\r\n\tpublic void init() {\n\r\n\t}", "@Override\r\n\tpublic void init() {\n\r\n\t}", "public contrustor(){\r\n\t}", "@Override\n\tprotected void initialize() {\n\n\t}", "@Override\r\n\tpublic void dispase() {\n\r\n\t}", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "@Override\n\tpublic void dtd() {\n\t\t\n\t}", "@Override\n\tprotected void logic() {\n\n\t}", "@Override\n\tprotected void lazyLoad() {\n\t\t\n\t}", "public void mo4359a() {\n }", "@Override\r\n\tprotected void initialize() {\n\r\n\t}", "@Override\n public void memoria() {\n \n }", "@Override\n\t\tpublic void method() {\n\t\t\t\n\t\t}", "private RepositorioAtendimentoPublicoHBM() {\r\t}", "@Override\n protected void initialize() \n {\n \n }", "@Override\r\n\tpublic void getProposition() {\n\r\n\t}", "@Override\n\tpublic void particular1() {\n\t\t\n\t}", "@Override\n\tpublic void init() {\n\n\t}", "@Override\n\tpublic void init() {\n\n\t}", "@Override\n\tpublic void init() {\n\n\t}", "@Override\n protected void prot() {\n }", "@Override\r\n\tpublic void init()\r\n\t{\n\t}", "@Override\n\tprotected void initValue()\n\t{\n\n\t}", "public void mo55254a() {\n }" ]
[ "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.6080161", "0.6077022", "0.6041561", "0.6024072", "0.6020252", "0.59984857", "0.59672105", "0.59672105", "0.5965777", "0.59485507", "0.5940904", "0.59239364", "0.5910017", "0.5902906", "0.58946234", "0.5886006", "0.58839184", "0.58691067", "0.5857751", "0.58503544", "0.5847024", "0.58239377", "0.5810564", "0.5810089", "0.5806823", "0.5806823", "0.5800025", "0.5792378", "0.5792378", "0.5792378", "0.5792378", "0.5792378", "0.5792378", "0.5790187", "0.5789414", "0.5787092", "0.57844025", "0.57844025", "0.5774479", "0.5774479", "0.5774479", "0.5774479", "0.5774479", "0.5761362", "0.57596046", "0.57596046", "0.575025", "0.575025", "0.575025", "0.5747959", "0.57337177", "0.57337177", "0.57337177", "0.5721452", "0.5715831", "0.57142824", "0.57140535", "0.57140535", "0.57140535", "0.57140535", "0.57140535", "0.57140535", "0.57140535", "0.5711723", "0.57041645", "0.56991017", "0.5696783", "0.56881124", "0.56774884", "0.56734604", "0.56728", "0.56696945", "0.5661323", "0.5657007", "0.5655942", "0.5655942", "0.5655942", "0.56549734", "0.5654792", "0.5652974", "0.5650185" ]
0.0
-1
makes a 2d array, containing a 1 for when the value of the row and the value of the column, representing 2 vertices, are connected
public static void makeMatrix() { n = Graph.getN(); m = Graph.getM(); e = Graph.getE(); connectMatrix = new int[n][n]; // sets the row of value u and the column of value v to 1 (this means they are connected) and vice versa // vertices are not considered to be connected to themselves. for(int i = 0; i < m;i++) { connectMatrix[e[i].u-1][e[i].v-1] = 1; connectMatrix[e[i].v-1][e[i].u-1] = 1; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public abstract int[] getConnected(int vertexIndex);", "public int[][] getAdjacencyMatrix();", "private double[] getNeighbors(double[] row) {\n\n double[] neighbors = {0};\n return neighbors;\n }", "public Connection[] getConnections(int x1, int x2, int y1, int y2){\n //TODO Resizeable\n Connection[] temp = new Connection[2];\n int tsize = 0;\n int i = floor(x1); //find largest key equal or smaller than x1\n int j = ceiling(x2); //find smallest key equal or greater than x2\n \n for(i; i<j; i++){\n int k = floor(connections[i], y1); //find largest key equal or smaller than y1, within array\n int l = ceiling(connections[i], y2); //find smallest key equal or greater than y2, within array\n \n connections[10].length = 100;\n connections[9].length = 50;\n \n for(k; k<l; k++){\n temp[tsize] = connections[i][k]);\n tsize++;\n }\n }\n return temp;\n }", "public int[] findRedundantConnection(int[][] edges) {\n if (edges == null || edges.length == 0) return new int[]{};\n \n UF uf = new UF(edges.length);\n \n int[] res = new int[2];\n for (int i = 0; i < edges.length; i++) {\n int x = edges[i][0] - 1, y = edges[i][1] - 1;\n int rx = uf.find(x), ry = uf.find(y);\n \n if (rx == ry) {\n res[0] = x + 1;\n res[1] = y + 1;\n } else {\n uf.union(rx, ry);\n }\n }\n \n return res;\n }", "protected int[] GetConnectedJunctions() {\n\t\tint Size = this.JunctionsConnectedList.length;\n\t\tint[] ReturnArray = new int[Size];\n\n\t\tfor(int i=0; i<Size; i++) {\n\t\t\tReturnArray[i] = this.JunctionsConnectedList[i][0];\n\t\t}\n\n\t\treturn ReturnArray;\n\t}", "public static int[] get(int vertex)\n {\n vertex -= 1;\n\n int tempConnectedVertices[] = new int[100000];\n\n int j = 0;\n\n for (int i = 0; i < n; i++)\n {\n if (connectMatrix[vertex][i] == 1)\n {\n tempConnectedVertices[j] = i + 1;\n j++;\n }\n }\n\n int connectedVertices[] = new int[j];\n\n for(int i = 0; i < j;i++)\n {\n connectedVertices[i] = tempConnectedVertices[i];\n\n }\n\n return connectedVertices;\n\n }", "public static List<HashSet<Index>> findSetsOfOnes(int[][] twoDArray){\n Matrix matrix = new Matrix(twoDArray);\n List<HashSet<Index>> filtered = new ArrayList<>();\n mapOfOnes = getMapOfOnes(matrix, twoDArray);\n\n // Iterate over the map of indices\n // For each index find it's connected component,\n // then changing it's value to 0 in order to avoid duplications\n // Using auxiliary function: findingConnectedComponent.\n for(Map.Entry<Index, Integer> entry : mapOfOnes.entrySet()) {\n\n if (entry.getValue() == 1) {\n mapOfOnes.put(entry.getKey(), 0);\n HashSet<Index> temp = new HashSet<>(findingConnectedComponent(twoDArray, entry.getKey()));\n filtered.add(temp);\n }\n }\n // Sorting the list\n return filtered.stream()\n .sorted(Comparator.comparing(HashSet::size)).collect(Collectors.toList());\n }", "public static int[][] init() {\n int[][] arr={\n {0,1,0,1,0,0,0},\n {0,0,1,0,0,1,0},\n {1,0,0,1,0,1,0},\n {0,0,1,0,0,1,0},\n {0,0,1,1,0,1,0},\n {1,0,0,0,0,0,0}\n };\n return arr;\n }", "public static int[][] completeGraph(int length) {\r\n\t\tint[][] res= new int[length][length];\r\n\t\tfor(int i=0;i!=length;i++)\r\n\t\t\tfor(int j=0;j!=length;j++) {\r\n\t\t\t\tif(i!=j)\r\n\t\t\t\t\tres[i][j]=1;\r\n\t\t\t}\r\n\t\treturn res;\r\n\t}", "private void fillAdjacencyMatrix( int x, int y )\n\t{\n\t\tfor( int i = 1; i < 9; i++ )\n\t\t{\n\t\t\tfor( int j = 1; j < 9; j++ )\n\t\t\t{\n\t\t\t\tif( x == i || y == j || (Math.floorDiv(x, 3) == Math.floorDiv(i, 3) && Math.floorDiv(y, 3) == Math.floorDiv(j,3)))\n\t\t\t\t\t;\n\t\t\t\telse\n\t\t\t\t\t;\n\t\t\t}\n\t\t}\n\t}", "public void identity(){\n for (int j = 0; j<4; j++){\n \tfor (int i = 0; i<4; i++){\n \t\tif (i == j)\n \t\t\tarray[i][j] = 1;\n \t\telse\n \t\t\tarray[i][j] = 0;\n \t }\n \t }\n\t}", "int main()\n {\n int tri[][] = {{1, 0, 0},\n {4, 8, 0},\n {1, 5, 3}};\n return 0;\n }", "private static int[][] graph(){\n int[][] graph = new int[6][6];\n graph[0][1] = 7;\n graph[1][0] = 7;\n\n graph[0][2] = 2;\n graph[2][0] = 2;\n\n graph[1][2] = 3;\n graph[2][1] = 3;\n\n graph[1][3] = 4;\n graph[3][1] = 4;\n\n graph[2][3] = 8;\n graph[3][2] = 8;\n\n graph[4][2] = 1;\n graph[2][4] = 1;\n\n graph[3][5] = 5;\n graph[5][3] = 5;\n\n graph[4][5] = 3;\n graph[5][4] = 3;\n return graph;\n }", "public static int[][] makeSymmetric(int[][] m)\n { \n return new int[m.length][m[0].length];\n }", "public static int[] twoToOne(int[][] two_board){\n int[] one_board = new int[24];\n int i=0;\n for(int row=0; row<ROW; row++){\n for(int column = 0; column < COLUMN; column++){\n one_board[i] = two_board[row][column];\n i++;\n }\n }\n return one_board;\n }", "public Object[][] get2DArray();", "private Double[][] makeAdjacencyMatrix()\n {\n Double[][] matrix = new Double[this.numIntxns][this.numIntxns];\n\n for (int i = 0; i < this.numIntxns; i++)\n {\n for (int j = 0; j < this.numIntxns; j++)\n {\n // if the indices are the same the distance is 0.0.\n // otherwise, it's infinite.\n matrix[i][j] = (i != j) ? null : 0.0;\n }\n }\n\n // populate the matrix\n for (int intxn = 0; intxn < this.numIntxns; intxn++)\n {\n for (Road road : this.roads)\n {\n if (intxn == road.start())\n {\n matrix[intxn][road.end()] = road.length();\n matrix[road.end()][intxn] = road.length();\n }\n }\n }\n\n return matrix;\n }", "public int[] boardConvertto1d() {\n for (int i = 0; i < 9; i++) {\n int row = i / 3;\n int col = i % 3;\n board[i] = board2d[row][col];\n }\n return board;\n }", "public Square[] adjacentCells() {\n\t\tArrayList<Square> cells = new ArrayList <Square>();\n\t\tSquare aux;\n\t\tfor (int i = -1;i <= 1; i++) {\n\t\t\tfor (int j = -1; j <= 1 ; j++) {\n\t\t\t\taux = new Square(tractor.getRow()+i, tractor.getColumn()+j); \n\t\t\t\tif (isInside(aux) && abs(i+j) == 1) { \n\t\t\t\t\tcells.add(getSquare(aux));\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn cells.toArray(new Square[cells.size()]);\n\t}", "private static int[] generateArray(int i, int j) {\n int[] col = new int[j+1];\n for(int k = 0; k <= j; k++)\n {\n col[k] = (i+k)%Algo.x.length;\n } \n return col;\n }", "public static int[] createVerticesCells(int numberOfVertices)\n\t{\n\t\tint[] toReturn = new int[numberOfVertices * 2];\n\t\tint k = 0;\n\t\tfor (int i = 0; i < numberOfVertices; i++)\n\t\t{\n\t\t\ttoReturn[k++] = 1;\n\t\t\ttoReturn[k++] = i;\n\t\t}\n\t\treturn toReturn;\n\t}", "public static void main(String[] args) {\n\t\tint row = 8;\r\n\t\tint [][]arr = new int[row][row];\t//8行8列\r\n\t\t\r\n\t\tfor(int i=0;i<row;i++){\t//外循环构造第一维数组\r\n\t\t\tfor(int j=0;j<=i;j++){\t//内循环构造第一维数组指向的第二维数组,每一行的列数和行数相等\r\n\t\t\t\t//第一列(j=0)和对角线列(j=i)的值都为1\r\n\t\t\t\tif(j==0 || j==i){\r\n\t\t\t\t\tarr[i][j] = 1;\r\n\t\t\t\t}\r\n\t\t\t\t//非第一列和对角线列的数组元素值,是其正上方的数(arr[i-1][j])和其左上角的数(arr[i-1][j-1])之和\r\n\t\t\t\telse{\r\n\t\t\t\t\tarr[i][j] = arr[i-1][j]+arr[i-1][j-1];\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\t//打印输出\r\n\t\tfor(int i=0;i<row;i++){\r\n\t\t\tfor(int j=0;j<=i;j++){\r\n\t\t\t\tSystem.out.print(arr[i][j]+\" \");\r\n\t\t\t}\r\n\t\t\tSystem.out.println();\r\n\t\t}\r\n\r\n\t}", "public static List<Index> findingConnectedComponent(int[][] twoDArray, Index sourceIndex) {\n Matrix matrix = new Matrix(twoDArray);\n Stack<Index> stack = new Stack<>();\n List<Index> connected = new ArrayList<>();\n\n // adding source index to the list and push into the stack\n connected.add(sourceIndex);\n stack.push(sourceIndex);\n\n // Using stack in order to avoid duplication\n // Going over the map, each index with value of 1 is being checked for it's neighbors\n // and add to the list\n // Changing each reachable neighbor's value to 0 in the map\n while (!stack.empty()) {\n for (Index index : matrix.getReachables(stack.pop())) {\n if (mapOfOnes.get(index) == 1) {\n stack.push(index);\n connected.add(index);\n mapOfOnes.put(index, 0);\n }\n }\n }\n return connected;\n }", "void iniciaMatriz() {\r\n int i, j;\r\n for (i = 0; i < 5; i++) {\r\n for (j = 0; j <= i; j++) {\r\n if (j <= i) {\r\n m[i][j] = 1;\r\n } else {\r\n m[i][j] = 0;\r\n }\r\n }\r\n }\r\n m[0][1] = m[2][3] = 1;\r\n\r\n// Para los parentesis \r\n for (j = 0; j < 7; j++) {\r\n m[5][j] = 0;\r\n m[j][5] = 0;\r\n m[j][6] = 1;\r\n }\r\n m[5][6] = 0; // Porque el m[5][6] quedo en 1.\r\n \r\n for(int x=0; x<7; x++){\r\n for(int y=0; y<7; y++){\r\n // System.out.print(\" \"+m[x][y]);\r\n }\r\n //System.out.println(\"\");\r\n }\r\n \r\n }", "public Vertex[] createGraph(){\n\t\t /* constructing a graph using matrices\n\t\t * If there is a connection between two adjacent LETTERS, the \n\t * cell will contain a num > 1, otherwise a 0. A value of -1 in the\n\t * cell denotes that the cities are not neighbors.\n\t * \n\t * GRAPH (with weights b/w nodes):\n\t * E+---12-------+B--------18-----+F----2---+C\n\t * +\t\t\t\t+\t\t\t\t +\t\t +\n\t * |\t\t\t\t|\t\t\t\t/\t\t |\n\t * |\t\t\t\t|\t\t\t |\t\t |\n\t * |\t\t\t\t|\t\t\t |\t\t 10\n\t * 24\t\t\t\t8\t\t\t 8\t |\n\t * |\t\t\t\t|\t\t\t |\t\t +\n\t * |\t\t\t\t|\t\t\t | H <+---11---I\n\t * |\t\t\t\t|\t\t\t /\n\t * +\t\t\t\t+\t\t\t +\n\t * G+---12----+A(start)+---10--+D\n\t * \n\t * NOTE: I is the only unidirectional node\n\t */\n\t\t\n\t\tint cols = 9;\n\t\tint rows = 9;\n\t\t//adjacency matrix\n\t\t\t\t //A B C D E F G H I\n\t int graph[][] = { {0,8,0,10,0,0,12,0,0}, //A\n\t {8,0,0,0,12,18,0,0,0}, //B\n\t {0,0,0,0,0,2,0,10,0}, //C\n\t {10,0,0,0,0,8,0,0,0}, //D\n\t {0,12,0,0,0,0,24,0,0}, //E\n\t {0,18,2,8,0,0,0,0,0}, //F\n\t {12,0,0,0,0,0,24,0,0}, //G\n\t {0,0,10,0,0,0,0,0,11}, //H\n\t {0,0,0,0,0,0,0,11,0}}; //I\n\t \n\t //initialize stores vertices\n\t Vertex[] vertices = new Vertex[rows]; \n\n\t //Go through each row and collect all [i,col] >= 1 (neighbors)\n\t int weight = 0; //weight of the neighbor\n\t for (int i = 0; i < rows; i++) {\n\t \tVector<Integer> vec = new Vector<Integer>(rows);\n\t\t\tfor (int j = 0; j < cols; j++) {\n\t\t\t\tif (graph[i][j] >= 1) {\n\t\t\t\t\tvec.add(j);\n\t\t\t\t\tweight = j;\n\t\t\t\t}//is a neighbor\n\t\t\t}\n\t\t\tvertices[i] = new Vertex(Vertex.getVertexName(i), vec);\n\t\t\tvertices[i].state = weight;\n\t\t\tvec = null; // Allow garbage collection\n\t\t}\n\t return vertices;\n\t}", "public static void generateMatrix() {\r\n Random random = new Random();\r\n for (int i = 0; i < dim; i++)\r\n {\r\n for (int j = 0; j < dim; j++)\r\n {\r\n if (i != j)\r\n \r\n adjacencyMatrix[i][j] = I; \r\n }\r\n }\r\n for (int i = 0; i < dim * dim * fill; i++)\r\n {\r\n adjacencyMatrix[random.nextInt(dim)][random.nextInt(dim)] =\r\n random.nextInt(maxDistance + 1);\r\n }\r\n \r\n\r\n\r\n \r\n //print(adjacencyMatrix);\r\n \r\n \r\n //This makes the main matrix d[][] ready\r\n for (int i = 0; i < dim; i++) {\r\n for (int j = 0; j < dim; j++)\r\n {\r\n d[i][j] = adjacencyMatrix[i][j];\r\n if (i == j)\r\n {\r\n d[i][j] = 0;\r\n }\r\n }\r\n }\r\n }", "public int[][] get2DAsteroids(){\n int[][] result = new int[field.length][2];\n for (int i = 0; i<field.length;i++){\n //casting to int maybe inaccurate but this is used for 2d representation so its not that important\n //NOTE: being able to access the x and y fields is very unsafe (getters/setters?)\n result[i][0] = (int)field[i].x;\n result[i][1] = (int)field[i].y;\n }\n return result;\n }", "private int[][] addOneCol(int[][] ints) {\n\n int vertexLength = getRow(ints);\n int edgesLength = getCol(ints);\n\n int[][] temp = new int[vertexLength][edgesLength + 1];\n for (int i = 0; i < vertexLength; i++) {\n for (int j = 0; j < edgesLength; j++) {\n temp[i][j] = ints[i][j];\n }\n }\n return temp;\n }", "public void getNeighbors(){\n // North \n if(this.row - this.value>=0){\n this.north = adjacentcyList[((this.row - this.value)*col_size)+col];\n }\n // South\n if(this.row + value<row_size){\n this.south = adjacentcyList[((this.row+this.value)*row_size)+col];\n }\n // East\n if(this.col + this.value<col_size){\n this.east = adjacentcyList[((this.col+this.value)+(this.row)*(col_size))];\n }\n // West\n if(this.col - this.value>=0){\n this.west = adjacentcyList[((this.row*col_size)+(this.col - this.value))];\n }\n }", "int[] getEdgesIncidentTo(int... nodes);", "private int[][] initGraph() {\r\n\t\tint[][] graph = new int[8][8];\r\n\t\tgraph[0] = new int[] { 0, 1, 1, MAX, MAX, MAX, MAX, MAX };\r\n\t\tgraph[1] = new int[] { 1, 0, MAX, 1, 1, MAX, MAX, MAX };\r\n\t\tgraph[2] = new int[] { 1, MAX, 0, MAX, MAX, 1, 1, MAX };\r\n\t\tgraph[3] = new int[] { MAX, 1, MAX, 0, MAX, MAX, MAX, 1 };\r\n\t\tgraph[4] = new int[] { MAX, 1, MAX, MAX, 0, MAX, MAX, 1 };\r\n\t\tgraph[5] = new int[] { MAX, MAX, 1, MAX, MAX, 0, 1, MAX };\r\n\t\tgraph[6] = new int[] { MAX, MAX, 1, MAX, MAX, 1, 0, MAX };\r\n\t\tgraph[7] = new int[] { MAX, MAX, MAX, 1, 1, MAX, MAX, 0 };\r\n\t\treturn graph;\r\n\t}", "private static int[][] toAjacencyMatrix(int[][] matrixWeigthed) {\r\n\t\tint[][] matrix = new int[matrixWeigthed.length][matrixWeigthed[0].length];\r\n\t\tfor (int i = 0; i < matrixWeigthed.length; i++) {\r\n\t\t\tfor (int j = 0; j < matrixWeigthed[0].length; j++) {\r\n\t\t\t\tif (matrixWeigthed[i][j] == 0) {\r\n\t\t\t\t\tmatrix[i][j] = 1;\r\n\t\t\t\t} else if (matrixWeigthed[i][j] >= Integer.MAX_VALUE) {\r\n\t\t\t\t\tmatrix[i][j] = 0;\r\n\t\t\t\t} else {\r\n\t\t\t\t\tmatrix[i][j] = 1;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\treturn matrix;\r\n\t}", "public static int[] findRedundantConnection(int[][] edges) {\n UnionDataStructure obj = new UnionDataStructure();\n \n int nodes = edges.length;\n Set<int[]> set = new HashSet<>();\n \n for( int i = 1; i<=nodes; i++ ){\n\t\t\tobj.makeSet( i );\n\t\t}\n\t\t\n for( int[] edge: edges ){\n\t\t\tint edge1 = edge[0];\n\t\t\tint edge2 = edge[1];\n\t\t\tset.add( edge );\n\t\t\t\n\t\t\tif( obj.findSet_representative( edge1 ) != obj.findSet_representative( edge2 ) ){\n\t\t\t\tset.remove( edge );\n\t\t\t\tobj.union( edge1, edge2 );\n\t\t\t}\n\t\t}\n\n Iterator<int[]> iterator = set.iterator();\n\n return iterator.next();\n }", "private int xyTo1D(int row, int col)\n {\n validate(row, col);\n return (row-1) * gridSize + col-1;\n }", "private int[][] createMatrix(List<Integer> vertices, Set<Edge> edges) {\n int[][] matrix = new int[vertices.size()][vertices.size()];\n\n for (Edge e : edges) {\n int u = e.getU();\n int v = e.getV();\n matrix[u][v] = e.getWeight();\n if (!e.isDirected()) {\n matrix[v][u] = e.getWeight();\n }\n }\n return matrix;\n }", "public int[] getNeighborColIndex() {\n if (myRow % 2 == 0) {\n return neighborEvenColIndex;\n } else {\n return neighborOddColIndex;\n }\n }", "private int xyTo1D(final int row, final int col) {\n return (row - 1) * size + (col - 1);\n }", "void create(){\n // I assign zero value to each element of the array.\n for (int i = 0;i< this.row; i++){\n for (int j = 0; j< this.column; j++){\n array[i][j]= 0;\n }\n }\n // I create random values for mines indexes\n int min = 0;\n int max = this.row;\n Random random = new Random();\n int randRow, randColumn, count=0;\n //I generate random mines quarter of the size of the array and assign it into the array.\n while(count != (this.row*this.column/4)){\n randRow = random.nextInt(max + min) + min;\n randColumn = random.nextInt(max + min) + min;\n if (array[randRow][randColumn] != -1){\n array[randRow][randColumn]= -1;\n count++;\n }\n }\n // I show the all minesweeper map\n for (int i = 0;i< this.row; i++){\n for (int j = 0; j< this.column; j++){\n if (array[i][j]==0)\n System.out.print(\"0 \");\n else\n System.out.print(\"* \");\n }\n System.out.println();\n }\n }", "public int colorVertices();", "public int[] findRedundantConnection(int[][] edges) {\n int[] parent = new int[2*edges.length];\n int[] sz = new int[parent.length];\n // initialize parent array, every element points to itself\n for (int i = 0; i < parent.length; i++) parent[i] = i;\n Arrays.fill(sz, 1);\n\n for (int[] edge : edges) {\n int p = find(parent, edge[0]);\n int q = find(parent, edge[1]);\n if (p==q) return edge;\n union(parent, sz, p, q);\n }\n return new int[2]; // default return, if no such edge found\n }", "public boolean percolates() {\n\t\treturn linearGrid.connected(0, 1);\n\t}", "public static ArrayList<int[]> getEmptyCellCoords(int[][] grid) {\n\n ArrayList<int[]> emptyCells = new ArrayList<int[]>();\n for (int i = 0; i < grid.length; i++) {\n for (int j = 0; j < grid[0].length; j++) {\n if (grid[i][j] == 0) {\n int[] arr = {i, j};\n emptyCells.add(0, arr);\n }\n }\n }\n\n return emptyCells;\n }", "public static int[][] makeTransitive(int[][] m)\n {\n return new int[m.length][m[0].length];\n }", "public static void main(String[] args) {\n\t\tint a[][]=new int [5][5];\r\n\t\tfor(int i=0;i<a.length; i++)\r\n\t\t{\r\n\t\t\tfor (int j=0;j<a[i].length;j++)\r\n\t\t\t{\r\n\t\t\t\tif(i==0 ||j==0||i==4||j==4)\r\n\t\t\t\t{\r\n\t\t\t\t\ta[i][j]=1;\r\n\t\t\t\t}\r\n\t\t\t\r\n\t\t\t\tSystem.out.print(a[i][j]+\" \");\r\n\t\t\t}\r\n\t\t\tSystem.out.println();\r\n\t\t}\r\n\r\n\t}", "public ArrayList<int[]> surroundingCoordinates(int row, int col){\n\t\t\t\n\t\tArrayList<int[]> coordinates = new ArrayList<int[]>();\n\t\tfor(int x = -1; x <= 1; x++) {\n\t\t\tfor(int y = -1; y <= 1; y++) {\n\t\t\t\tif(\t\t\n\t\t\t\t\t\t(row+x >= 0) && \n\t\t\t\t\t\t(col+y >= 0) &&\n\t\t\t\t\t\t(row+x < bm.getBoardSize()) &&\n\t\t\t\t\t\t(col+y < bm.getBoardSize()) &&\n\t\t\t\t\t\t(x != 0 || y != 0)\n\t\t\t\t){\n\t\t\t\t\tcoordinates.add(new int[]{row+x, col+y});\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn coordinates;\n\t}", "private static int[] multRow(int[] column)\n\t{\n\t\tint[] result = new int[column.length];\n\t\t\n\t\tfor(int row=0; row<multCon.length; row++)\n\t\t\tfor(int col=0; col<multCon[row].length; col++)\n\t\t\t\tresult[row] ^= galoisMult(multCon[row][col],column[col]);\n\t\t\n\t\treturn result;\n\t}", "BigDecimal[][] toTriangular();", "public static int[][] intArray1Dto2D(int[] matrixVal) {\n int size = (int) Math.sqrt(matrixVal.length);\n int[][] values = new int[size][size];\n int i, j, k;\n for (i = 0, k = 0; i < size; ++i) {\n for (j = 0; j < size; ++j) {\n values[i][j] = matrixVal[k];\n k++;\n }\n }\n return values;\n }", "private void getNeighbors() {\n\t\tRowIterator iterator = currentGen.iterateRows();\n\t\twhile (iterator.hasNext()) {\n\t\t\tElemIterator elem = iterator.next();\n\t\t\twhile (elem.hasNext()) {\n\t\t\t\tMatrixElem mElem = elem.next();\n\t\t\t\tint row = mElem.rowIndex();\n\t\t\t\tint col = mElem.columnIndex();\n\t\t\t\tint numNeighbors = 0;\n\t\t\t\tfor (int i = -1; i < 2; i++) { // loops through row above,\n\t\t\t\t\t\t\t\t\t\t\t\t// actual row, and row below\n\t\t\t\t\tfor (int j = -1; j < 2; j++) { // loops through column left,\n\t\t\t\t\t\t\t\t\t\t\t\t\t// actual column, coloumn\n\t\t\t\t\t\t\t\t\t\t\t\t\t// right\n\t\t\t\t\t\tif (!currentGen.elementAt(row + i, col + j).equals(\n\t\t\t\t\t\t\t\tfalse)) // element is alive, add 1 to neighbor\n\t\t\t\t\t\t\t\t\t\t// total\n\t\t\t\t\t\t\tnumNeighbors += 1;\n\t\t\t\t\t\telse { // element is not alive, add 1 to its total\n\t\t\t\t\t\t\t\t// number of neighbors\n\t\t\t\t\t\t\tInteger currentNeighbors = (Integer) neighbors\n\t\t\t\t\t\t\t\t\t.elementAt(row + i, col + j);\n\t\t\t\t\t\t\tneighbors.setValue(row + i, col + j,\n\t\t\t\t\t\t\t\t\tcurrentNeighbors + 1);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tneighbors.setValue(row, col, numNeighbors - 1); // -1 to account\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// for counting\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// itself as a\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// neighbor\n\t\t\t}\n\t\t}\n\t}", "public void constructArray(){\n\t\tfor (int col = 0; col < cols; col++){\n\t\t\tfor (int row = 0; row < rows; row++){\n\t\t\t\tmap[col][row] = new Pixel();\n\t\t\t}\n\t\t}\n\t}", "private void f0() \n\t{\n\t\tint elements = 0;\n\t\t\n\t\tfor(int i=0;i<f2.length;i++)\n\t\t{\n\t\t\tfor(int j=0;j<f2[0].length;j++)\n\t\t\t{\n\t\t\t\tif(f2[i][j])\n\t\t\t\t\telements++;\n\t\t\t}\n\t\t}\n\t\t\n\t\tif(elements > 0){\n\t\t\tneighbors = new Neighbor[elements];\n\t\t\tint cy = (f2.length-1)/2; \n\t\t\tint cx = (f2[0].length-1)/2;\n\t\t\tint index=0;\n\t\t\t\n\t\t\tfor(int i=0;i<f2.length;i++)\n\t\t\t{\n\t\t\t\tfor(int j=0;j<f2[0].length;j++)\n\t\t\t\t{\n\t\t\t\t\tif(f2[i][j]){\n\t\t\t\t\t\tneighbors[index++] = new Neighbor(i-cy,j-cx);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t}\n\t\telse\n\t\t{\n\t\t\t//No elements i.e all elements are false in the neighborhood buffer.\n\t\t\tneighbors = null;\n\t\t}\n\t\t\t\n\t}", "static void TwoDimTrav(int[][] arr, int row, int col){\n\n int[] dr = new int[]{ -1, 1, 0, 0};\n int[] dc = new int[]{ 0, 0, 1, -1};\n\n for(int i = 0; i < 4; i++){\n int newRow = row + dr[i];\n int newCol = col + dc[i];\n\n if(newRow < 0 || newCol < 0 || newRow >= arr.length || newCol >= arr[0].length)\n continue;\n\n // do your code here\n\n }\n\n // All Directions\n // North, South, East, West, NW NE SW SE\n // dr = [ -1, 1, 0, 0 -1, -1, 1, 1 ]\n // dc = [ 0, 0, 1, -1 -1, 1, 1, -1 ]\n\n// int[] dr = new int[]{ -1, 1, 0, 0, -1, -1, 1, 1};\n// int[] dc = new int[]{ 0, 0, 1, -1, -1, 1, -1, 1};\n//\n// for(int i = 0; i < 8; i++){\n// int newRow = row + dr[i];\n// int newCol = col + dc[i];\n//\n// if(newRow < 0 || newCol < 0 || newRow >= arr.length || newCol >= arr[0].length)\n// continue;\n//\n// // do your code here\n//\n// }\n }", "ArrayList<ArrayList<Integer>> convert2DArrayToList(int[][] image) {\n ArrayList<ArrayList<Integer>> list = new ArrayList<ArrayList<Integer>>();\n for(int i=0;i < image.length;i++) {\n list.add(new ArrayList<Integer>());\n for(int j=0; j< image[0].length;j++) {\n list.get(i).add(image[i][j]);\n }\n }\n return list;\n }", "private List<Cell> getNeighbours(int row,int col){\n List<Cell> neighbours = new ArrayList<Cell>();\n for(int i = row -1 ; i <= row+1 ; i++ )\n for(int j = col -1 ; j <= col+1 ; j++)\n if(i>=0 && i<cells.length && j>=0 && j<cells[0].length)\n neighbours.add(cells[i][j]);\n return neighbours;\n }", "public int[] getNeighborRowIndex() {\n return neighborRowIndex;\n }", "public List<List<Integer>> generate(int numRows) {\n List<List<Integer>> ans = new ArrayList();\n for(int i=0;i<numRows;i++){\n ans.add(new ArrayList());\n for(int j=0;j<=i;j++){\n if(j==0||j==i)\n ans.get(i).add(1);\n else\n ans.get(i).add(ans.get(i-1).get(j-1)+ans.get(i-1).get(j));\n }\n }\n return ans;\n }", "public Object[][] toJava2D() {\n\n\t\tObject[][] d = new Object[numRows][numCols];\n\t\tfor ( int j = 0; j < numRows; j++ ) {\n\t\t\tfor ( int i = 0; i < numCols; i++ ) {\n\t\t\t\td[i][j] = get(i, j);\n\t\t\t}\n\t\t}\n\t\treturn d;\n\t}", "public void duplicateOriginalArray() {\n for (int r=0; r<pixels.length; r++) {\n for (int c=0; c<pixels.length; c++) {\n if (pixels[r][c] == true)\n visited[r][c] = true;\n else\n visited[r][c]= false;\n }\n }\n }", "@Override\n\tpublic List<Cell> calcNeighbors(int row, int col) {\n\t\tList<Cell> neighborLocs = new ArrayList<>();\n\t\tint shift_constant = 1 - 2*((row+col) % 2);\n\t\tif(!includesDiagonals) {\n\t\t\tfor(int a = col - 1; a <= col + 1; a++) {\n\t\t\t\tif(a == col)\n\t\t\t\t\taddLocation(row + shift_constant,a,neighborLocs);\n\t\t\t\telse \n\t\t\t\t\taddLocation(row,a,neighborLocs);\n\t\t\t}\n\t\t\treturn neighborLocs;\n\t\t}\n\t\tfor(int b = col - 2; b <= col + 2; b++) {\n\t\t\tfor(int a = row; a != row + 2*shift_constant; a += shift_constant) {\n\t\t\t\tif(a == row && b == col)\n\t\t\t\t\tcontinue;\n\t\t\t\taddLocation(a,b,neighborLocs);\n\t\t\t}\n\t\t}\n\t\tfor(int b = col -1; b <= col + 1; b++) {\n\t\t\taddLocation(row - shift_constant,b,neighborLocs);\n\t\t}\n\t\treturn neighborLocs;\n\t}", "private double[][] a2() {\n double[][] r = a;\n for (int j = 0; j < nBinVars; j++) {\n final int v = intVars[j];\n if (existsBinConstraint(v)) {\n LOG.debug(\"existsBinConstraint\", v);\n this.nBinVars2--;\n continue;\n }\n double[] constraint = new double[n];\n constraint[v - 1] = 1d;\n r = Maths.append(r, constraint);\n }\n return r;\n }", "public int[] create1DArrayFrom2D(int[][] array2D) {\r\n\t\t//printArray2D(array2D);\r\n\t\tint[] array1D = new int[array2D.length * array2D[0].length];\r\n\t\tfor (int i = 0; i < array2D.length; i++) {\r\n\t\t\tfor (int j = 0; j < array2D[i].length; j++) {\r\n\t\t\t\t//System.out.println(\"i: \"+i+\" j: \"+j+\" length: \"+array2D[0].length);\r\n\t\t\t\tarray1D[i * array2D[0].length + j] = array2D[i][j];\r\n\t\t\t}\r\n\t\t}\r\n\t\t//printArray1D(array1D);\r\n\t\treturn array1D;\r\n\t}", "public static void main(String[] args) {\r\n\t\t// creating 2D array\r\n//\t\tchar arrayCharacter[][] = new char[5][2];\r\n//\t\t// inserting values in it\r\n//\t\t//1st row\r\n//\t\tarrayCharacter[0][0] = 'a';\r\n//\t\tarrayCharacter[0][1] = 'b';\r\n//\t\t//2nd row\r\n//\t\tarrayCharacter[1][0] = 'c';\r\n//\t\tarrayCharacter[1][1] = 'd';\r\n//\t\t//3rd row\r\n//\t\tarrayCharacter[2][0] = 'e';\r\n//\t\tarrayCharacter[2][1] = 'f';\r\n//\t\t//4th row\r\n//\t\tarrayCharacter[3][0] = 'g';\r\n//\t\tarrayCharacter[3][1] = 'h';\r\n//\t\t//5th row\r\n//\t\tarrayCharacter[4][0] = 'i';\r\n//\t\tarrayCharacter[5][1] = 'j';\r\n\t\t\r\n\t\tchar arrayCharacter[][] = {{'a','b'},{'c','d'},{'e','f'},{'g','h'},{'i','j'}};\r\n\t\t\r\n//\t\tSystem.out.println(arrayCharacter[3][1]);\r\n//\t\tSystem.out.println(arrayCharacter[0][0]+\" \"+arrayCharacter[4][1]);\r\n\t\t\r\n//\t\tSystem.out.println(\"Number of rows: \"+arrayCharacter.length); // number of rows\r\n//\t\tSystem.out.println(\"Number of column: \"+arrayCharacter[0].length); // number of columns\r\n\t\t\r\n\t\t// traversing into 2D array -> using 2 for loops: 1st for loop for row & 2nd for loop or column\r\n//\t\tfor(int i=0;i<arrayCharacter.length; i++) { // traverses through rows\r\n//\t\t\tfor(int j=0; j<arrayCharacter[i].length; j++) { // traverses through column\r\n//\t\t\t\tSystem.out.print(arrayCharacter[i][j]+\"|\");\r\n//\t\t\t}\r\n//\t\t}\r\n\t\t\r\n\r\n\t\tint arrayInt[][] = {{1,2,3},{4,5,6},{7,8,9},{10,11,12},{13,14,15}};\r\n\t\t\r\n\t\tSystem.out.println(\"Number of rows: \"+arrayInt.length); // number of rows\r\n\t\tSystem.out.println(\"Number of column: \"+arrayInt[0].length); // number of columns\r\n\t\t\r\n\t\tfor(int i=0;i<arrayInt.length; i++) { // traverses through rows\r\n\t\t\tfor(int j=0; j<arrayInt[i].length; j++) { // traverses through column\r\n\t\t\t\tSystem.out.print(arrayInt[i][j]+\"|\");\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\t\r\n\t\t// Assignment:\r\n//\t\t\t1. 1D array => FirstName, LastName, DOB, Age then traverse through using both for & while loop to extract data\r\n//\t\t\t2. 2D array => Customer Name, email address, phone number then traverse through it using for loop to extract data -> try while as well\t\r\n\t\t\r\n\t\t\r\n\t\t\r\n\t\t\r\n\t\t\r\n\t\t\r\n\t\t\r\n\t\t\r\n\t\t\r\n\r\n\t}", "int[] neighbor(int sourceId) {\n\t\tint opposite = ((sourceId + 2) > amount - 1) ? (sourceId + 2) - amount : sourceId + 2; // needed\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// for\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// 2\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// ir\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// 3\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// array\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// points\n\t\tint neighborLeft = ((sourceId + 1) > amount - 1) ? (sourceId + 1) - amount : sourceId + 1; // neede\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// only\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// for\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// 3\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// array\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// point\n\t\tint neighborRight = ((sourceId - 1) < 0) ? amount + (sourceId - 1) : sourceId - 1; // neede\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// only\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// for\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// 0\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// array\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// pointer\n\t\tint[] neighbors = { neighborLeft, neighborRight, opposite // 0, 1, 2\n\t\t};\n\t\treturn neighbors;\n\t}", "public static void main (String[] args) {\n int[][] twoD = new int[3][4];\n// Where x is an integer\n// [[x, x, x, x],\n// [x, x, x, x],\n// [x, x, x, x]]\n\n// int[][][] threeD = new int[3][4][3];\n\n// 4x3\n int[][] twoDInit = {{1, 3, 5}, {4, 3, 5}, {1, 4, 5}, {4, 3, 5}};\n\n for (int i = 0; i < twoDInit.length; i++) {\n for (int j = 0; j < twoDInit[i].length; j++) {\n System.out.println(twoDInit[i][j]);\n }\n }\n\n for (int[] ints : twoDInit) {\n for (int anInt : ints) {\n System.out.println(anInt);\n }\n }\n\n for (int i = 0; i < 5; i++) {\n for (int j = 0; j < 7; j++) {\n System.out.print(\"*\");\n }\n System.out.println();\n }\n\n for (int i = 0; i < 5; i++) {\n for (int j = 0; j < i + 1; j++) {\n System.out.print(\"*\");\n }\n System.out.println();\n }\n }", "public int[][] getBoard();", "public static int[][] generateMatrix(int rows, int columns) {\n\tint[][] result = new int[rows][columns];\n\tfor (int i = 0; i < rows; i++) {\n\tfor (int j = 0; j < columns; j++) {\n\tresult[i][j] = (int) (Math.random() * 100) + 1;\n\t}\n\t}\n\treturn result;\n\t}", "public int[] neighbors(int a){\n int[] neighbors = new int[size];\n \n for(int i=0;i<size;i++){\n neighbors[i] = (-1);\n }\n\n int iter =0, i=0;\n while(i<size){\n if(adjMatrix[a][i]==1){\n neighbors[iter] = i;\n iter++;\n }\n i++;\n }\n return neighbors;\n }", "private String[][] twoDArray(LinkedList<QuadTree> Linked) {\n if (Linked.size() < 1) {\n return new String[0][0];\n } else if (Linked.size() == 1) {\n return new String[1][1];\n } else {\n int rowCount, columnCount;\n Set<Double> count = new HashSet<>();\n for (QuadTree q : Linked) {\n count.add(q.ullat);\n }\n rowCount = count.size();\n columnCount = Linked.size() / rowCount;\n return new String[rowCount][columnCount];\n }\n }", "public Graph() // constructor\n{\n vertexList = new Vertex[MAX_VERTS];\n // adjacency matrix\n adjMat = new int[MAX_VERTS][MAX_VERTS];\n nVerts = 0;\n for (int j = 0; j < MAX_VERTS; j++) // set adjacency\n for (int k = 0; k < MAX_VERTS; k++) // matrix to 0\n adjMat[j][k] = INFINITY;\n}", "public int[] getNeighborhoodArray()\n\t{\n\t\treturn neighborhoodArray;\n\t}", "private void markRowsAndCols(int row){\n if(row < 0)\n return;\n\n markedRows[row] = true;\n for (int j = 0; j < cols; j++)\n if(j != chosenInRow[row] && source[row][j] == 0) {\n markedCols[j] = true;\n markRowsAndCols(chosenInCol[j]);\n }\n }", "public static int[][] init2DArray(int count){\r\n return new int[count][count];\r\n }", "public boolean percolates() {\n return uf.connected(n*n, n*n+1);\r\n }", "public int[] getRowAndCol() {\n return new int[]{myRow, myCol};\n }", "public static short[][] constructIdentityMtx(int dimension) {\n \n short[][] rep = new short[dimension][dimension];\n\n for (int i = 0; i < dimension; i++) {\n for (int j = 0; j < dimension; j++) {\n if (i == j) {\n rep[i][j] = 1;\n } else {\n rep[i][j] = 0;\n }\n }\n }\n return rep;\n }", "public boolean percolates(){\r\n\t\treturn uf.connected(N * N, N * N + 1);\r\n\t}", "private boolean [][] buildConnectionMatrix(ArrayList<Integer> st) throws Exception{\n \tboolean [][] canReach=new boolean[st.size()][st.size()]; //initial values of boolean is false in JAVA\n\t\tfor(int i=0;i<st.size();i++) canReach[i][i]=true;\n\t\t//build connection matrix\n \tfor(TreeAutomaton ta:lt)\n \t\tfor(Transition tran:ta.getTrans()){\n \t\t\tint topLoc=st.indexOf(tran.getTop());\n \t\t\tfor(SubTerm t:tran.getSubTerms()){\n \t\t\t\tif(boxes.containsKey(t.getSubLabel())){//the case of a box transition\n \t\t\t\t\tBox box=boxes.get(t.getSubLabel());\n \t\t\t\t\tfor(int i=0;i<box.outPorts.size();i++){\n\t\t\t\t\t\t\tint botLoc_i=st.indexOf(t.getStates().get(i));\n \t\t\t\t\tfor(int j=0;j<box.outPorts.size();j++){\n \t\t\t\t\t\t\tint botLoc_j=st.indexOf(t.getStates().get(j));\n \t\t\t\t\t\tif(box.checkPortConnections(box.outPorts.get(i), box.outPorts.get(j)))//handle outport->outport\n \t\t\t\t\t\t\tcanReach[botLoc_i][botLoc_j]=true;\n \t\t\t\t\t}\n \t\t\t\t\t\tif(box.checkPortConnections(box.outPorts.get(i), box.inPort))//handle outport->inport\n \t\t\t\t\t\t\tcanReach[botLoc_i][topLoc]=true;\n \t\t\t\t\t\tif(box.checkPortConnections(box.inPort, box.outPorts.get(i)))//handle inport->outport\n \t\t\t\t\t\t\tcanReach[topLoc][botLoc_i]=true;\n \t\t\t\t\t}\n \t\t\t\t}else{ \n \t\t\t\t\tint rootRef=ta.referenceTo(tran.getTop());\n \t\t\t\t\tif(rootRef!=-1){//root reference\n \t\t \t\t\tint refLoc=st.indexOf(rootRef);\n \t\t\t\t\t\tcanReach[topLoc][refLoc]=true;\n\t \t\t\t\t}else{//normal transition\n\t \t\t\t\t\n\t \t\t\t\t\tfor(int bot:t.getStates()){\n\t \t\t \t\t\tint botLoc=st.indexOf(bot);\n\t \t\t\t\t\t\tcanReach[topLoc][botLoc]=true;\n\t \t\t\t\t\t}\n\t \t\t\t\t}\n \t\t\t\t}\n \t\t\t}\n \t\t}\n \treturn canReach;\n }", "private int[][] listEmptyCells() {\n int nbEmpty = 0;\n int[][] emptyCells;\n int k = 0;\n\n for (int i = 0; i < sb.size; i++) {\n for (int j = 0; j < sb.size; j++) {\n if (sb.get(i, j) == 0)\n nbEmpty++;\n }\n }\n emptyCells = new int[nbEmpty][2];\n\n for (int i = 0; i < sb.size; i++) {\n for (int j = 0; j < sb.size; j++) {\n if (sb.get(i, j) == 0) {\n emptyCells[k][0] = i;\n emptyCells[k][1] = j;\n k++;\n }\n }\n }\n return emptyCells;\n }", "private int[][] convertTo2D(char[] array1D)\n {\n int n = (int) Math.sqrt(array1D.length);\n int[][] array2D = new int[n][n];\n \n for (int i = 0; i < n; i++)\n {\n for (int j = 0; j < n; j++)\n {\n array2D[i][j] = (int) (array1D[i * n + j]);\n }\n }\n \n return array2D;\n }", "public MazeRoom[][] generate() {\n\t\tgenerate(theGrid[0][0]);\n\t\treturn theGrid;\n\t}", "public native boolean[][] __boolean2dArrayMethod( long __swiftObject, boolean[][] arg );", "public static int[][] makeReflexive(int[][] m)\n {\n return new int[m.length][m[0].length];\n }", "public long[][] flatTo2D (long[] in_array1d){\n\t\tint sl = (int)Math.sqrt(in_array1d.length);\n\t\tlong[][] out_array = new long[sl][sl]; //declares output 2D array\n\t\tint q = 0; //temporary variable, used in following nested for loop\n\t\tfor(int a = 0; a < sl; a++){ //loops until a == side length\n\t\t\tfor(int b = 0; a < sl ; b++){ //loops until b == side length\n\t\t\t\t//q is initially set to zero. With each iteration of the b for-loop, the value of\n\t\t\t\t//out_array[a][b] is replaced with in_array[q], and q is incremented by 1. This means\n\t\t\t\t//that, for every iteration of the a for-loop, q is incremented by sl\n\t\t\t\tout_array[a][b] = in_array1d[q]; \n\t\t\t\tq = q + 1;\n\t\t\t\t}\n\t\t\t}\n\t\treturn out_array;\n\t\t}", "public int[][] create_edge(int from, int to, boolean weighted, int weight){\n try{\n if(weighted==true) // If weighted edge\n adj_matrix[from][to]=weight;\n else\n adj_matrix[from][to]=1;\n }\n catch(ArrayIndexOutOfBoundsException index){ // If invalid index\n System.out.println(\" Invalid Vertex!\");\n }\n return adj_matrix;\n }", "public BitSet[] getAdjacencyMatrix() {\n\t\treturn adjacencyMatrix;\n\t}", "public native int[][] __int2dArrayMethod( long __swiftObject, int[][] arg );", "private static int[] invMultRow(int[] column)\n\t{\n\t\tint[] result = new int[column.length];\n\t\t\n\t\tfor(int row=0; row<invMultCon.length; row++)\n\t\t\tfor(int col=0; col<invMultCon[row].length; col++)\n\t\t\t\tresult[row] ^= galoisMult(invMultCon[row][col],column[col]);\n\t\t\n\t\treturn result;\n\t}", "private static void makeEdgesSet() {\n edges = new Edge[e];\r\n int k = 0;\r\n for (int i = 0; i < n; i++) {\r\n for (int j = 0; j < i; j++) {\r\n if (g[i][j] != 0)\r\n edges[k++] = new Edge(j, i, g[i][j]);\r\n }\r\n }\r\n }", "public int[][] createBoard(int size){\r\n\t\tint[][] newBoard = new int[size+1][size+1];\r\n\t\tfor (int i = 0; i < newBoard.length; i++){\r\n\t\t\tfor (int j = 0; j < newBoard[i].length; j++) {\r\n\t\t\t\tif (i == 0) {\r\n\t\t\t\t\tnewBoard[i][j] = j;\r\n\t\t\t\t} else if (j == 0) {\r\n\t\t\t\t\tnewBoard[i][j] = i;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}newBoard[0][0] = 0;\r\n\treturn newBoard;\r\n\t}", "public int[] mouseToCell()\n {\n int x = mouseX;\n int y = mouseY;\n if(x > firstCellPosition[0] && x < firstCellPosition[0]+xCells*cellSize &&\n y > firstCellPosition[1] && y < firstCellPosition[1]+yCells*cellSize)\n {\n showHover = true;\n x = x-firstCellPosition[0];\n y = y-firstCellPosition[1];\n int[] cell = new int[2];\n cell[0] = x/cellSize;\n cell[1] = y/cellSize;\n return cell;\n }\n showHover = false;\n return null;\n }", "protected abstract List<Integer> getNeighbors(int vertex);", "private static boolean isCellAlive(int[][] coordinates, int row, int column) {\n\t\tboolean cellAlive = coordinates[row][column] == 1;\r\n\t\tint numberOfNeighbours = 0;\r\n\t\t//check one to the right of col\r\n\t\tif (coordinates[row].length > column + 1) {\r\n\t\t\tif (coordinates[row][column + 1] == 1) {\r\n\t\t\t\tnumberOfNeighbours++;\r\n\t\t\t}\r\n\t\t}\r\n\t\t//check one to the left of col\r\n\t\tif (coordinates[row].length > column - 1 && column - 1 >= 0) {\r\n\t\t\tif (coordinates[row][column - 1] == 1) {\r\n\t\t\t\tnumberOfNeighbours++;\r\n\t\t\t}\r\n\t\t}\r\n\t\t//check one above col\r\n\t\tif (coordinates.length > row - 1 && row - 1 >= 0) {\r\n\t\t\tif (coordinates[row - 1][column] == 1) {\r\n\t\t\t\tnumberOfNeighbours++;\r\n\t\t\t}\r\n\t\t}\r\n\t\t//check one below col\r\n\t\tif (coordinates.length > row + 1) {\r\n\t\t\tif (coordinates[row + 1][column] == 1) {\r\n\t\t\t\tnumberOfNeighbours++;\r\n\t\t\t}\r\n\t\t}\r\n\t\t//check one top left diagonal to col\r\n\t\tif (coordinates.length > row - 1 && coordinates[row].length > column - 1 && row - 1 >= 0 && column - 1 >= 0) {\r\n\t\t\tif (coordinates[row - 1][column - 1] == 1) {\r\n\t\t\t\tnumberOfNeighbours++;\r\n\t\t\t}\r\n\t\t}\r\n\t\t//check one top right diagonal to col\r\n\t\tif (coordinates.length > row - 1 && coordinates[row].length > column + 1 && row - 1 >= 0) {\r\n\t\t\tif (coordinates[row - 1][column + 1] == 1) {\r\n\t\t\t\tnumberOfNeighbours++;\r\n\t\t\t}\r\n\t\t}\r\n\t\t//check one bottom left diagonal to col\r\n\t\tif (coordinates.length > row + 1 && coordinates[row].length > column - 1 && column - 1 >= 0) {\r\n\t\t\tif (coordinates[row + 1][column - 1] == 1) {\r\n\t\t\t\tnumberOfNeighbours++;\r\n\t\t\t}\r\n\t\t}\r\n\t\t//check one bottom right diagonal to col\r\n\t\tif (coordinates.length > row + 1 && coordinates[row].length > column + 1) {\r\n\t\t\tif (coordinates[row + 1][column + 1] == 1) {\r\n\t\t\t\tnumberOfNeighbours++;\r\n\t\t\t}\r\n\t\t}\r\n\t\t System.out.println(\"Number of neighbours for \" + row + \", \" + column\r\n\t\t + \" was \" + numberOfNeighbours);\r\n\t\t//if the number of neighbours was 2 or 3, the cell is alive\r\n\t\tif ((numberOfNeighbours == 2) && cellAlive) {\r\n\t\t\treturn true;\r\n\t\t} else if (numberOfNeighbours == 3) {\r\n\t\t\treturn true;\r\n\t\t}\r\n\t\treturn false;\r\n\t}", "private int xyTo1D(int i, int j) {\n return (mGridSize * (i - 1) + j);\n }", "public Integer[][] GetCurrentBoard()\n {\n return new Integer[2][3];\n }", "public void createColorArray(Pixel[][] originalImage, int row, int column) {\n int index = 0;\n\n for (int i = -1; i < 2; i++) {\n for (int k = -1; k < 2; k++) {\n colorArray[index] = originalImage[row + i][column + k];\n index++;\n }\n }\n }", "public static void main(String[] args) { \r\n int[][] a = new int[3][5]; // прямоугольный массив\r\n int size1 = a.length;\r\n int size2 = a[0].length;\r\n int[][] b = new int[3][]; // массив переменной длины (тут - треугольный)\r\n b[0] = new int[1];\r\n b[1] = new int[2];\r\n b[2] = new int[3];\r\n int c[] = new int[] {1,2,3,};\r\n c = new int[]{0,1,2,3}; // а вот так не сработает: c = {0,1,2,3};\r\n \r\n int[] array1D= {0,1,2,3}; \r\n int[][] array2D= {{0,1,5,10},{2,3,1,0,5,55,16},{0,1}};\r\n int[][][] array3D= {\r\n { {2,3,1,0},\r\n {2,3,1,0},\r\n {2,3,1,0}},\r\n \r\n { {2,3,1,0},\r\n {2,3,1,0},\r\n {2,3,1,0}},\r\n \r\n { {2,3,1,0},\r\n {2,3,1,0},\r\n {2,3,1,0}}};\r\n System.out.println(\"============array1D==========\");\r\n System.out.println(array1D);\r\n System.out.println(Arrays.toString(array1D)); //Работает на глубину одного измерения (для одномерных масивов)\r\n System.out.println(\"============array2D==========\");\r\n System.out.println(array2D);\r\n System.out.println(Arrays.toString(array2D)); \r\n System.out.println(Arrays.deepToString(array2D));\r\n System.out.println(\"============array3D==========\");\r\n System.out.println(array3D);\r\n System.out.println(Arrays.toString(array3D));\r\n System.out.println(Arrays.deepToString(array3D));\r\n }", "private static void findBridges() {\n Map<Integer, Integer> lastSeen = new HashMap<>();\n for (int i = 0; i < columns.length; i++) {\n if (!lastSeen.containsKey(columns[i])) {\n lastSeen.put(columns[i], i);\n }\n }\n bridgesCount = 0;\n\n int lastBridgeIndex = 0;\n for (int i = 1; i < columns.length; i++) {\n\n //returns prev index of columns[i]\n int columnPrevIndex = lastSeen.get(columns[i]);\n //columnPrevIndex must be to the right from lastBridgeIndex to avoid crossing\n if (columnPrevIndex != i &&\n columnPrevIndex >= lastBridgeIndex) {\n lastBridgeIndex = i;\n bridgesCount++;\n connections[i] = true;\n connections[columnPrevIndex] = true;\n }\n //not optimized solution -> for every element we search to it's left side\n //from lastBridgeIndex to i and if we meet same element -> connect new bridge\n// for (int j = lastBridgeIndex; j < i; j++) {\n//\n// if (columns[j] == columns[i]) {\n// lastBridgeIndex = i;\n// connections[j] = true;\n// connections[i] = true;\n// bridgesCount++;\n// break;\n// }\n// }\n\n //update index of columns[i]\n lastSeen.put(columns[i], i);\n }\n }", "Prim(int[][] mat)\n {\n int i, j;\n\n NNodes = mat.length;\n\n LinkCost = new int[NNodes][NNodes];\n\n for ( i=0; i < NNodes; i++)\n {\n for ( j=0; j < NNodes; j++)\n {\n LinkCost[i][j] = mat[i][j];\n\n if ( LinkCost[i][j] == 0 )\n LinkCost[i][j] = infinite;\n }\n }\n\n for ( i=0; i < NNodes; i++)\n {\n for ( j=0; j < NNodes; j++)\n if ( LinkCost[i][j] < infinite )\n System.out.print( \" \" + LinkCost[i][j] + \" \" );\n else\n System.out.print(\" * \" );\n\n System.out.println();\n }\n }", "public int[][] matrixCID(String[] array){\n\t\tint[][] matrix = new int[array.length-1][5];\n\t\tfor(int i = 1; i < array.length; i++){\n\t\t\tString[] words = toWord(array[i]);\t\n\t\t\tmatrix[i-1][0] = Integer.valueOf(words[0]); //CID\n\t\t\tmatrix[i-1][1] = Integer.valueOf(words[2]); //POP\n\t\t\tmatrix[i-1][2] = 0; //default length\n\t\t\tmatrix[i-1][3] = 0; //default chunk size\n\t\t\tmatrix[i-1][4] = 0; //default chunk pieces\n\t\t}\n\t\treturn matrix;\n\t}" ]
[ "0.6554748", "0.6410131", "0.62851596", "0.60524166", "0.60305303", "0.6028391", "0.59328055", "0.58800507", "0.58558613", "0.5832548", "0.5816914", "0.5800661", "0.5767562", "0.5749492", "0.57332724", "0.5727072", "0.57189137", "0.5714381", "0.56666946", "0.56143343", "0.5606487", "0.5602319", "0.5590289", "0.5588787", "0.5573339", "0.5572937", "0.5535373", "0.55195284", "0.55040973", "0.5483816", "0.54804695", "0.5451401", "0.5449569", "0.54495144", "0.54357475", "0.5422997", "0.5417511", "0.54160494", "0.5412836", "0.5388308", "0.5360358", "0.5352719", "0.534806", "0.534606", "0.5345063", "0.5329252", "0.53176033", "0.531269", "0.53027576", "0.5300905", "0.5298395", "0.52921367", "0.52883613", "0.52856976", "0.52764785", "0.52755076", "0.52583283", "0.52554303", "0.5254983", "0.52379173", "0.5237322", "0.52323693", "0.52305526", "0.5224289", "0.52154243", "0.5211106", "0.52094984", "0.5208648", "0.51972467", "0.5187154", "0.51820517", "0.51720977", "0.516951", "0.51685387", "0.51646626", "0.51569176", "0.5156814", "0.51500815", "0.5149665", "0.51483107", "0.514383", "0.51402813", "0.513938", "0.5137226", "0.51310027", "0.513058", "0.51279444", "0.5127326", "0.5119819", "0.51187533", "0.5111053", "0.51104164", "0.51099926", "0.51073813", "0.51054263", "0.5102802", "0.50963753", "0.5095519", "0.509402", "0.5088393" ]
0.6281526
3
returns an array containing all vertices that are connected to vertex.
public static int[] get(int vertex) { vertex -= 1; int tempConnectedVertices[] = new int[100000]; int j = 0; for (int i = 0; i < n; i++) { if (connectMatrix[vertex][i] == 1) { tempConnectedVertices[j] = i + 1; j++; } } int connectedVertices[] = new int[j]; for(int i = 0; i < j;i++) { connectedVertices[i] = tempConnectedVertices[i]; } return connectedVertices; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public abstract int[] getConnected(int vertexIndex);", "public Vertex[] getVertices() {\n\t\treturn this._vertices.toArray(new Vertex[0]);\n\t}", "public Vertex[] getVertices() {\n return arrayOfVertices;\n }", "public E[] verticesView ()\n {\n E[] allVertices = (E[]) new Object[lastIndex + 1];\n for (int index = 0; index < allVertices.length; index++)\n allVertices[index] = this.vertices[index];\n\n return allVertices;\n }", "public List<Vertex> vertices() {\n return Collections.unmodifiableList(this.vertices);\n }", "Set<Vertex> getVertices();", "public Iterable<Vertex> getVertices() {\n return mVertices.values();\n }", "public Set<V> getNeighbours(V vertex);", "public List<Vertex> getVertices() {\n\t\treturn AdjacencyMatrixGraph.cloneList(vertexList);\n\t}", "public Collection<GJPoint2D> vertices() {\n\t\tArrayList<GJPoint2D> vertices = new ArrayList<GJPoint2D>(this.segments.size());\n\t\t\n\t\t// iterate on segments, and add the control points of each segment\n\t\tfor (Segment seg : this.segments) {\n\t\t\tfor (GJPoint2D p : seg.controlPoints()) {\n\t\t\t\tvertices.add(p);\n\t\t\t}\n\t\t}\n\t\t\n\t\t// return the set of vertices\n\t\treturn vertices;\n\t}", "Iterable<Long> vertices() {\n return nodes.keySet();\n }", "public IntPoint[] getVertices() {\n\t\treturn PointArrays.copy(vertices);\n\t}", "@Override public Set<L> vertices() {\r\n return new HashSet<L>(vertices);//防御式拷贝\r\n }", "public java.util.List<V> getVertices();", "List<V> getVertexList();", "public Collection<Vertex> vertices() { \n //return myGraph.keySet(); OLD\n //create a copy of all the vertices in the map to restrict any reference\n //to the interals of this class\n Collection<Vertex> copyOfVertices = new ArrayList<Vertex>();\n copyOfVertices.addAll(myGraph.keySet());\n return copyOfVertices;\n }", "public Vertex[] getVertices() {\n return new Vertex[]{v1, v2};\n }", "public Collection<V> getVertices();", "@Override\r\n\tpublic ArrayList<E> getVertices() {\r\n\t\tArrayList<E> verts = new ArrayList<>();\r\n\t\tvertices.forEach((E t, Vertex<E> u) -> {\r\n\t\t\tverts.add(t);\r\n\t\t});\r\n\t\treturn verts;\r\n\t}", "public Set<V> getVertices();", "public Set<V> getVertices();", "public List<Vertex> findAllVertices() throws SQLException {\n\t\treturn rDb.findAllVertices();\n\t}", "List<V> getAdjacentVertexList(V v);", "public HashMap<Integer, Vertex> getVertices() {\n\t\treturn vertices;\n\t}", "public Vertice[] getSelectedVertices(){\n\t\tVertice selectedVertice;\n\t\tVertice[] vertices = new Vertice[getSelectedModelVerticeCount()];\n\t\tint index = 0;\n\t\tfor(int i = 0; i < getModelVerticesCount(); i++){\n\t\t\tselectedVertice = getModelVertice(i);\n\t\t\tif(selectedVertice.isSelected)\n\t\t\t\tvertices[index++] = selectedVertice;\n\t\t}\n\t\treturn vertices;\n\t}", "public ArrayList< Vertex > adjacentVertices( ) {\n return adjacentVertices;\n }", "@Override\n public Set<Vertex> getVertices() {\n Set<Vertex> vertices = new HashSet<Vertex>();\n vertices.add(sourceVertex);\n vertices.add(targetVertex);\n return vertices;\n }", "public List<Integer> neighbors(int vertex) {\r\n \tArrayList<Integer> vertices = new ArrayList<Integer>();\r\n \tLinkedList<Edge> testList = myAdjLists[vertex];\r\n int counter = 0;\r\n while (counter < testList.size()) {\r\n \tvertices.add(testList.get(counter).myTo);\r\n \tcounter++;\r\n }\r\n return vertices;\r\n }", "public HashSet<Town> getVertices() {\r\n\t\treturn (HashSet<Town>) vertices;\r\n\t}", "Iterable<Long> vertices() {\n //YOUR CODE HERE, this currently returns only an empty list.\n ArrayList<Long> verticesIter = new ArrayList<>();\n verticesIter.addAll(adj.keySet());\n return verticesIter;\n }", "@Override\r\n\tpublic List<Integer> getReachableVertices(GraphStructure graph,int vertex) {\r\n\t\tadjacencyList=graph.getAdjacencyList();\r\n\t\tpathList=new ArrayList<Integer>();\r\n\t\tisVisited=new boolean [graph.getNumberOfVertices()];\r\n\t\ttraverseRecursively(graph, vertex);\r\n\t\treturn pathList;\r\n\t}", "public ArrayList <Edge> allConnected (Vertex min) {\r\n \r\n tempList = new ArrayList <Edge> (); \r\n \r\n for (int i = 0; i < graph.size(); ++i){\r\n if (graph.get(i).getStart().equals(min.getName())){\r\n tempList.add(graph.get(i));\r\n }\r\n else if (graph.get(i).getEnd().equals(min.getName())){\r\n tempList.add(graph.get(i));\r\n }\r\n }\r\n return tempList;\r\n }", "public BitSet getAdjacentVertices(int vertex) {\n\t\treturn adjacencyMatrix[vertex];\n\t}", "public Set<GeographicPoint> getVertices()\n\t{\n\t\t//TODO: Implement this method in WEEK 3\n\t\tSet<GeographicPoint> ans = new HashSet<GeographicPoint> ();\n\t\tfor (GeographicPoint curr : map.keySet()) {\n\t\t\tif (!ans.contains(curr)) {\n\t\t\t\tans.add(curr);\n\t\t\t}\n\t\t}\n\t\treturn ans;\n\t}", "public Vector3f[] getVertices() {\n return vertices;\n }", "Iterator<Vertex<V, E, M>> getVertices() {\n return this.vertices.values().iterator();\n }", "public int[] getVertices() {\n long cPtr = RecastJNI.rcContour_verts_get(swigCPtr, this);\n if (cPtr == 0) {\n return null;\n }\n return Converter.convertToInts(cPtr, getNumberOfVertices() * 4);\n }", "public Collection<LazyNode2> getVertices() {\n List<LazyNode2> l = new ArrayList();\n \n for(Path p : getActiveTraverser())\n //TODO: Add cache clearing\n l.add(new LazyNode2(p.endNode().getId()));\n \n return l;\n }", "public Vertex [] getSortedVertexArray() {\n\t\tVertex [] array = new Vertex[_vertices.size()];\n\t\tint index = 0;\n\t\tfor (Vertex v : _vertices) {\n\t\t\tarray[index++] = v;\n\t\t}\n\t\t// sort\n\t\tArrays.sort(array);\n\t\treturn array;\n\t}", "public float[] getVertices() {\r\n\t\treturn vertices;\r\n\t}", "Iterable<Long> vertices() {\n //YOUR CODE HERE, this currently returns only an empty list.\n return world.keySet();\n }", "@Override\r\n public Iterable<V> vertices() {\r\n LinkedList<V> list = new LinkedList<>();\r\n for(V v : map.keySet())\r\n list.add(v);\r\n return list;\r\n }", "public Set<Edge<V>> getEdges(V vertex);", "public List<wVertex> getVertices(){\r\n return vertices;\r\n }", "public Set<Pair<V,V>> neighbourEdgesOf(V vertex);", "public static <V> List<Graph<V>> getConnectedComponents(Graph<V> graph) {\n List<Graph<V>> listaComponentes = new LinkedList<>();\n V[] listaVertices = graph.getValuesAsArray();\n Set<V> revisados = new LinkedListSet<>();\n while (revisados.size() != listaVertices.length) {\n int valor = 0;\n for (int x = 0; x < listaVertices.length; x++) {\n if (!revisados.isMember(listaVertices[x])) {\n valor = x;\n x = listaVertices.length * 2;\n }\n }\n Graph<V> nuevo = new AdjacencyMatrix<>(graph.isDirected(), true);\n recorridoProf(graph, listaVertices[valor], revisados, nuevo);\n listaComponentes.add(nuevo);\n }\n return listaComponentes;\n }", "protected int[] GetConnectedJunctions() {\n\t\tint Size = this.JunctionsConnectedList.length;\n\t\tint[] ReturnArray = new int[Size];\n\n\t\tfor(int i=0; i<Size; i++) {\n\t\t\tReturnArray[i] = this.JunctionsConnectedList[i][0];\n\t\t}\n\n\t\treturn ReturnArray;\n\t}", "protected abstract List<Integer> getNeighbors(int vertex);", "public List neighbors(int vertex) {\n // your code here\n \tList toReturn = new ArrayList<Integer>();\n \tfor (Edge e : myAdjLists[vertex]) {\n \t\ttoReturn.add(e.to());\n \t}\n return toReturn;\n }", "@Override\r\n public List<Vertex> getVertices() {\r\n List<Vertex> verticesList = new LinkedList<>(adjacencyList.keySet()); //getting the key set of adjacencyList i.e, a list of all vertices\r\n Collections.sort(verticesList, Comparator.comparing(Vertex::getLabel));\r\n return verticesList;\r\n }", "public Set<String> getVertices() {\n\t\treturn vertices;\n\t}", "public Collection<V> getOtherVertices(V v);", "public ArrayList<Vertex> getNeighbours(Vertex vertex) {\r\n\t\tArrayList<Vertex> neighbours = new ArrayList<Vertex>();\r\n\t\tfor (Vertex vertexOfList : listVertex) {\r\n\r\n\t\t\tif (matrix.getEdges(vertex.getIdVertex(), vertexOfList.getIdVertex()) != null) {\r\n\t\t\t\tneighbours.add(vertexOfList);\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn neighbours;\r\n\t}", "@Override\n public VertexCollection getVertexCollection() {\n return this.vertices.copy();\n }", "public Set<Integer> getVertexKeys() {\n\t\treturn vertices.keySet();\n\t}", "public Collection<Set<V>> getVertexPartitions() {\n\t\tif (vertex_sets == null) {\n\t\t\tthis.vertex_sets = new HashSet<Set<V>>();\n\t\t\tthis.vertex_sets.addAll(vertex_partition_map.values());\n\t\t}\n\t\treturn vertex_sets;\n\t}", "public Collection< VKeyT > vertexKeys();", "public E[] getNeighbours (E vertex) throws IllegalArgumentException\n {\n int index = this.indexOf (vertex);\n\n // Check if the vertex exists in the graph\n if (index < 0)\n throw new IllegalArgumentException (vertex + \" was not found!\");\n\n\n Node node = this.adjacencySequences[index];\n int countNeighbours = 0;\n while(node != null)\n {\n countNeighbours++;\n node = node.nextNode;\n }\n\n E[] neighbours = (E[]) new Object[countNeighbours];\n node = this.adjacencySequences[index];\n int neighbourIndex = 0;\n \n while(node != null)\n {\n neighbours[neighbourIndex++] = vertices[node.neighbourIndex];\n node = node.nextNode;\n }\n\n return neighbours;\n }", "public ArrayList<V> getEdges(V vertex){\n return (ArrayList<V>) graph.get(vertex);\n }", "public Vector[] getVerts() {\n\t\treturn this.verts;\n\t}", "List<WeightedEdge<Vertex>> neighbors(Vertex v);", "@Override\n\tpublic List<Location> getNeighbors(Location vertex) {\n\n\t\tArrayList<Location> neighbors = new ArrayList<Location>();\n\n\t\tfor (Path p : getOutEdges(vertex))\n\t\t\tneighbors.add(p.getDestination());\n\n\t\treturn neighbors;\n\n\n\t}", "public abstract Vector2[] getVertices();", "int[] getEdgesIncidentTo(int... nodes);", "public Set<String> getVertices()\r\n\t{\r\n\t\treturn this.dataMap.keySet();\r\n\t}", "public Set<JmiAssocEdge> getAllIncomingAssocEdges(JmiClassVertex vertex)\n {\n return getClassAttributes(vertex).allIncomingAssocEdges;\n }", "private List<List<XGraph.XVertex>> getComponents() {\n scc = new SCC(graph);\n int componentCount = scc.findSSC();\n List<List<XGraph.XVertex>> components = new ArrayList<>();\n for (int i = 0; i < componentCount; i++) {\n components.add(new ArrayList<>());\n }\n for (Graph.Vertex vertex : graph) {\n CC.CCVertex component = scc.getCCVertex(vertex);\n components.get(component.cno - 1).add((XGraph.XVertex) vertex);\n }\n return components;\n }", "public Vertex<V>[] getEndpoints() { return endpoints; }", "public Position[] getVertexPosition() {\n Position[] positions = new Position[4];\n positions[0] = position;\n positions[1] = new Position(position.getX(), position.getY()+sizeL);\n positions[2] = new Position(position.getX()+sizeL, position.getY()+sizeL);\n positions[3] = new Position(position.getX()+sizeL, position.getY());\n\n return positions;\n }", "public int[] getEdgeIndicesArray() {\n \t\tginy_edges.trimToSize();\n \t\treturn giny_edges.elements();\n \t}", "public float[] getVertices() {\n/* 793 */ COSBase base = getCOSObject().getDictionaryObject(COSName.VERTICES);\n/* 794 */ if (base instanceof COSArray)\n/* */ {\n/* 796 */ return ((COSArray)base).toFloatArray();\n/* */ }\n/* 798 */ return null;\n/* */ }", "private List<Integer> vertices(int num) {\n List<Integer> list = new LinkedList<>();\n for (int i = 0; i < num; i++) {\n list.add(i);\n }\n return list;\n }", "int getVertices();", "public E3DVector4F[] getVertexColor() {\r\n\t\treturn new E3DVector4F[]{vertices[0].getVertexColor(),\r\n\t\t vertices[1].getVertexColor(),\r\n vertices[2].getVertexColor()};\r\n\t}", "public abstract Set<? extends EE> edgesOf(VV vertex);", "public Collection< VDataT > vertexData();", "public List neighbors(int vertex) {\n// your code here\n LinkedList<Integer> result = new LinkedList<>();\n LinkedList<Edge> list = adjLists[vertex];\n for (Edge a : list) {\n result.add(a.to());\n }\n//List<Integer> list = new List<Integer>();\n return result;\n }", "private List<V> getNewVertexOrderIfAcyclic () {\n Map<V, Integer> indegree = inDegree();\n // Determine all vertices with zero in-degree\n Stack<V> zeroIncomingVertex = new Stack<V>(); \n for (V v: indegree.keySet()) {\n if (indegree.get(v) == 0) zeroIncomingVertex.push(v);\n }\n \n // Determine the vertex order\n List<V> result = new ArrayList<V>();\n while (!zeroIncomingVertex.isEmpty()) {\n V v = zeroIncomingVertex.pop(); // Choose a vertex with zero in-degree\n result.add(v); // Vertex v is next in vertex ordering\n // \"Remove\" vertex v by updating its neighbors\n for (V neighbor: dag.get(v)) {\n indegree.put(neighbor, indegree.get(neighbor) - 1);\n // Remember any vertices that now have zero in-degree\n if (indegree.get(neighbor) == 0) zeroIncomingVertex.push(neighbor);\n }\n }\n // Check that we have used the entire graph. If not then there was a cycle.\n if (result.size() != dag.size()) return null;\n return result;\n }", "public void setVertices(){\n\t\tvertices = new ArrayList<V>();\n\t\tfor (E e : edges){\n\t\t\tV v1 = e.getOrigin();\n\t\t\tV v2 = e.getDestination();\n\t\t\tif (!vertices.contains(v1))\n\t\t\t\tvertices.add(v1);\n\t\t\tif (!vertices.contains(v2))\n\t\t\t\tvertices.add(v2);\n\t\t}\n\t}", "public static ArrayList<Vertex> initializeGraph() {\n\t\tVertex uVertex = new Vertex('u');\n\t\tVertex vVertex = new Vertex('v');\n\t\tVertex wVertex = new Vertex('w');\n\t\tVertex xVertex = new Vertex('x');\n\t\tVertex yVertex = new Vertex('y');\n\t\tVertex zVertex = new Vertex('z');\n\t\t\n\t\tVertex[] uAdjacencyList = {xVertex, vVertex};\n\t\tuVertex.setAdjacencyList(createArrayList( uAdjacencyList ));\n\t\t\n\t\tVertex[] vAdjacencyList = {yVertex};\n\t\tvVertex.setAdjacencyList(createArrayList( vAdjacencyList ));\n\t\t\n\t\tVertex[] wAdjacencyList = {zVertex, yVertex};\n\t\twVertex.setAdjacencyList(createArrayList( wAdjacencyList ));\n\t\t\n\t\tVertex[] xAdjacencyList = {vVertex};\n\t\txVertex.setAdjacencyList(createArrayList( xAdjacencyList ));\n\t\t\n\t\tVertex[] yAdjacencyList = {xVertex};\n\t\tyVertex.setAdjacencyList(createArrayList( yAdjacencyList ));\n\t\t\n\t\tVertex[] zAdjacencyList = {zVertex};\n\t\tzVertex.setAdjacencyList(createArrayList( zAdjacencyList ));\n\n\t\tVertex[] graph = { uVertex, vVertex, wVertex, xVertex, yVertex, zVertex};\n\t\treturn createArrayList( graph );\n\n\t}", "private static int[] nodes(graph g) {\n int size = g.nodeSize();\n Collection<node_data> V = g.getV();\n node_data[] nodes = new node_data[size];\n V.toArray(nodes); // O(n) operation\n int[] ans = new int[size];\n for(int i=0;i<size;i++) {ans[i] = nodes[i].getKey();}\n Arrays.sort(ans);\n return ans;\n }", "public ArrayList<Node> getNeighbors(){\n ArrayList<Node> result = new ArrayList<Node>();\n for(Edge edge: edges){\n result.add(edge.end());\n }\n return result;\n }", "public Iterator<Integer> getVertexIterator() {\n\t\treturn vertices.keySet().iterator();\n\t}", "public static boolean isAllVertexConnected(ArrayList<Edge>[] graph)\n {\n int count = 0;\n int n = graph.length;\n boolean[] vis = new boolean[n];\n\n for(int v = 0; v < n; v++) {\n if(vis[v] == false) {\n count++;\n\n //if number of connected components is greater than 1 then graph is not connected\n if(count > 1) {\n return false;\n }\n gcc(graph, v, vis);\n }\n }\n return true;\n\n }", "int[] primMST() {\n // Clone actual array\n int[][] graph = Arrays.stream(this.graph).map(int[]::clone).toArray(int[][]::new);\n\n // Array to store constructed MST\n int[] parent = new int[VERTICES];\n\n // Key values used to pick minimum weight edge in cut\n int[] key = new int[VERTICES];\n\n // To represent set of vertices included in MST\n Boolean[] mstSet = new Boolean[VERTICES];\n\n // Initialize all keys as INFINITE\n for (int i = 0; i < VERTICES; i++) {\n key[i] = Integer.MAX_VALUE;\n mstSet[i] = false;\n }\n\n // Always include first 1st vertex in MST.\n key[0] = 0; // Make key 0 so that this vertex is picked as first vertex\n parent[0] = -1; // zFirst node is always root of MST\n\n // The MST will have V vertices\n for (int count = 0; count < VERTICES - 1; count++) {\n // Pick thd minimum key vertex from the set of vertices\n // not yet included in MST\n int u = minKey(key, mstSet);\n\n // Add the picked vertex to the MST Set\n mstSet[u] = true;\n\n // Update key value and parent index of the adjacent\n // vertices of the picked vertex. Consider only those\n // vertices which are not yet included in MST\n for (int v = 0; v < VERTICES; v++)\n\n // graph[u][v] is non zero only for adjacent vertices of m\n // mstSet[v] is false for vertices not yet included in MST\n // Update the key only if graph[u][v] is smaller than key[v]\n if (graph[u][v] != 0 && mstSet[v] == false && graph[u][v] < key[v]) {\n parent[v] = u;\n key[v] = graph[u][v];\n }\n }\n\n return parent;\n }", "public Collection<V> getOtherVertices(Collection<V> vs);", "int[] getInEdges(int... nodes);", "@Override\r\n public Collection<node_data> getV() {\r\n return this.graph.values();\r\n }", "private ArrayList<Edge>getFullyConnectedGraph(){\n\t\tArrayList<Edge> edges = new ArrayList<>();\n\t\tfor(int i=0;i<nodes.size();i++){\n\t\t\tfor(int j=i+1;j<nodes.size();j++){\n\t\t\t\tEdge edge = new Edge(nodes.get(i), nodes.get(j),Utils.distance(nodes.get(i), nodes.get(j)));\n\t\t\t\tedges.add(edge);\n\t\t\t}\n\t\t}\n\t\treturn edges;\n\t}", "public Collection<E> getChildEdges(V vertex);", "public ArrayList<Integer> getInNeighbors (int nodeId) {\r\n\t\tArrayList<Integer> inNeighbors = new ArrayList<Integer>();\r\n\t\t// the set of incoming edge ids\r\n\t\tSet<Integer> edgeSet = mInEdges.get(nodeId);\r\n\t\tfor(Integer edgeId: edgeSet) {\r\n\t\t\tinNeighbors.add( getEdge(edgeId).getFromId() );\r\n\t\t}\r\n\t\treturn inNeighbors;\r\n\t}", "public Collection<Vertex> adjacentVertices(Vertex v) {\n Vertex parameterVertex = new Vertex(v.getLabel());\n if(!myGraph.containsKey(parameterVertex)){\n throw new IllegalArgumentException(\"Vertex is not valid\");\n }\n\n //create a copy of the passed in vertex to restrict any reference\n //to interals of this class\n Collection<Vertex> adjVertices = new ArrayList<Vertex>();\n\n Iterator<Edge> edges = myGraph.get(parameterVertex).iterator();\n while(edges.hasNext()) {\n adjVertices.add(edges.next().getDestination());\n }\n return adjVertices;\n }", "Set<CyEdge> getExternalEdgeList();", "@Override\r\n public List<Vertex> getNeighbors(Vertex v) {\r\n ArrayList<Vertex> neighborsList = new ArrayList<>();\r\n neighborsList = adjacencyList.get(v);\r\n Collections.sort(neighborsList, Comparator.comparing(Vertex::getLabel));\r\n return neighborsList; //getting the list of all adjacent vertices of vertex v\r\n }", "@Override\n\tpublic List<Location> getVertices() {\n\t\treturn locations;\n\t}", "public ArrayList<Triangle> getOccluderVertexData();", "public int[] getRawVertices() {\n long cPtr = RecastJNI.rcContour_rverts_get(swigCPtr, this);\n if (cPtr == 0) {\n return null;\n }\n return Converter.convertToInts(cPtr, getNumberOfRawVertices() * 4);\n }", "public AtomicVertex[] getPaths()\n {\n return _paths;\n }", "ArrayList<Edge> getAdjacencies();", "public static final <T extends Comparable<T>> List<List<Vertex<T>>> getConnectedComponents(Graph<T> graph) {\n if (graph == null)\n throw new IllegalArgumentException(\"Graph is NULL.\");\n\n if (graph.getType() != Graph.TYPE.DIRECTED)\n throw new IllegalArgumentException(\"Cannot perform a connected components search on a non-directed graph. graph type = \"+graph.getType());\n\n final Map<Vertex<T>,Integer> map = new HashMap<Vertex<T>,Integer>();\n final List<List<Vertex<T>>> list = new ArrayList<List<Vertex<T>>>();\n\n int c = 0;\n for (Vertex<T> v : graph.getVertices()) \n if (map.get(v) == null)\n visit(map, list, v, c++);\n return list;\n }" ]
[ "0.7627723", "0.72783566", "0.72586656", "0.7088259", "0.7079293", "0.7077425", "0.70317304", "0.6998312", "0.68537384", "0.6811723", "0.67698556", "0.6750745", "0.67108756", "0.6684204", "0.66724575", "0.6661255", "0.66385007", "0.6582748", "0.65641654", "0.6533247", "0.6533247", "0.6532175", "0.64845145", "0.6475753", "0.6468406", "0.6467674", "0.6449836", "0.64243215", "0.64222103", "0.6419731", "0.6397916", "0.6393129", "0.6384302", "0.6379669", "0.63706475", "0.6365318", "0.6346571", "0.6344641", "0.63356185", "0.62939376", "0.62899244", "0.6283041", "0.62463737", "0.6240408", "0.62384385", "0.6220794", "0.6214763", "0.6185214", "0.6182418", "0.6177602", "0.613594", "0.6134176", "0.6116005", "0.60848707", "0.6074167", "0.6070212", "0.60483056", "0.6041645", "0.60400647", "0.6023335", "0.6018217", "0.5976941", "0.59539187", "0.59420586", "0.58909917", "0.5890935", "0.5869248", "0.5868175", "0.5855032", "0.5847655", "0.5840519", "0.5829359", "0.58281475", "0.5802877", "0.57723933", "0.5759607", "0.5750663", "0.5745885", "0.57443476", "0.573495", "0.57294744", "0.5720175", "0.571882", "0.56955886", "0.5694436", "0.568616", "0.56821156", "0.56803536", "0.5667635", "0.5664226", "0.5660558", "0.5652502", "0.564762", "0.5636893", "0.5632968", "0.5630363", "0.5614251", "0.559408", "0.5592584", "0.558371" ]
0.73706573
1
prints the matrix showing all vertices and to which vertices they are connected to.
public static void printMatrix() { for(int i = 0; i < n; i++) { System.out.println(); for(int j = 0; j < n; j++) { System.out.print(connectMatrix[i][j] + " "); } } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void printAdjacencyMatrix();", "public void printEdges(){\n System.out.print(\" |\");\n for(int i=0;i<size;i++)\n System.out.print(\" \"+i+\" \");\n System.out.print(\"\\n\");\n for(int i=0;i<size+1;i++)\n System.out.print(\"-------\");\n System.out.print(\"\\n\");\n for(int i=0;i<size;i++){\n System.out.print(\" \"+i+\" |\");\n for(int j=0;j<size;j++){\n System.out.print(\" \"+Matrix[i][j]+\" \");\n }\n System.out.print(\"\\n\");\n }\n }", "public void print() {\n\t\tint l = 0;\n\t\tSystem.out.println();\n\t\tfor (int v = 0; v < vertexList.length; v++) {\n\t\t\tSystem.out.print(vertexList[v].id);\n\t\t\tfor (Neighbor nbr = vertexList[v].adjList; nbr != null; nbr = nbr.next) {\n\t\t\t\tSystem.out.print(\" -> \" + vertexList[nbr.vertexNumber].id + \"(\"\n\t\t\t\t\t\t+ nbr.weight + \")\");\n\t\t\t\tl++;\n\t\t\t}\n\t\t\tSystem.out.println(\"\\n\");\n\t\t}\n\t\tSystem.out.println(\"Number of edges = \" + l / 2);\n\t}", "public void display(){\n for(int i=0;i<N;i++){\n for(int j=0;j<N;j++)\n System.out.print(adj_matrix[i][j]+\" \");\n System.out.println();\n }\n }", "public void printGraph() {\n\t\tSystem.out.println(\"-------------------\");\n\t\tSystem.out.println(\"Printing graph...\");\n\t\tSystem.out.println(\"Vertex=>[Neighbors]\");\n\t\tIterator<Integer> i = vertices.keySet().iterator();\n\t\twhile(i.hasNext()) {\n\t\t\tint name = i.next();\n\t\t\tSystem.out.println(name + \"=>\" + vertices.get(name).printNeighbors());\n\t\t}\n\t\tSystem.out.println(\"-------------------\");\n\t}", "public void printVertices() {\r\n\t\tfor (int i = 0; i < vertices.size(); i++)\r\n\t\t\tSystem.out.print(vertices.get(i).label);\r\n\t}", "public String toString()\n\t{\n\t\tStringBuilder matrix = new StringBuilder();\n\t\t\n\t\tfor(int i = 0; i < numberOfVertices; i++)\n\t\t{\n\t\t\tmatrix.append(i + \": \");\n\t\t\tfor(boolean j : adjacencyMatrix[i])\n\t\t\t{\n\t\t\t\tmatrix.append((j? 1: 0) + \" \");\n\t\t\t}\n\t\t\tmatrix.append(\"\\n\");\n\t\t}\n\t\t\n\t\treturn matrix.toString();\n\t}", "public void printAdjacencyList() {\n \n for ( int i=0; i<vertex_adjacency_list.size(); i++ ) {\n \n vertex_adjacency_list.get( i ).printVertex();\n \n }\n \n }", "public void print() {\n for (int i = 0; i < matrix.length; i++) {\n for (int j = 0; j < matrix[i].length; j++) {\n System.out.print(matrix[i][j] + \" \");\n }\n System.out.println();\n }\n }", "public String toString(){\n String s = \"\";\n s += \"\\t\";\n \n for (int i = 0; i < n; i++){\n // adding vertices for columns\n s += vertices[i] + \"\\t\";\n }\n \n s += \"\\n\";\n \n for (int i = 0; i < n; i++){\n s += vertices[i] + \"\\t\"; // vertex for row\n for (int j = 0; j < n; j++){\n s += edges[j][i] + \"\\t\"; // adding edges across row\n }\n s += \"\\n\";\n }\n \n return s;\n }", "void printGraph() {\n for (Vertex u : this) {\n System.out.print(u + \": \");\n for (Edge e : u.Adj) {\n System.out.print(e);\n }\n System.out.println();\n }\n }", "public void printGraph() {\n\t\tStringJoiner j = new StringJoiner(\", \");\n\t\tfor(Edge e : edgeList) {\n\t\t\tj.add(e.toString());\n\t\t}\n\t\t\n\t\tSystem.out.println(j.toString());\n\t}", "public void displayMatrix(){\r\n\t\t\r\n\t\tfor (int i = 0; i < head.getOrder(); i++) {\r\n\t\t\tElementNode e = head.gethead();\r\n\t\t\tif( i > 0){\r\n\t\t\t\tfor (int j = 0; j <= i-1; j++) {\r\n\t\t\t\t\te = e.getNextRow();\r\n\t\t\t\t}\r\n\t\t\t}\t\r\n\t\t\tfor (int j = 0; j < head.getOrder(); j++) {\r\n\t\t\t\tSystem.out.print( e.getData() + \" \");\r\n\t\t\t\te = e.getNextColumn();\r\n\t\t\t}\r\n\t\t\tSystem.out.print(\"\\n\");\r\n\t\t}\r\n\t}", "void printNodesWithEdges()\n {\n for ( int i = 0; i < this.numNodes; i++ )\n {\n Node currNode = this.nodeList.get(i);\n System.out.println(\"Node id: \" + currNode.id );\n \n int numEdges = currNode.connectedNodes.size();\n for ( int j = 0; j < numEdges; j++ )\n {\n Node currEdge = currNode.connectedNodes.get(j);\n System.out.print(currEdge.id + \",\");\n }\n\n System.out.println();\n } \n\n \n }", "private void display_Topo_Matrix(int[][] matrix) \n\t{\n\t\tSystem.out.println(\"\\nReview Topology Matrix:\");\n\t\tfor(int row=0; row<matrix.length; row++)\n\t\t{\n\t\t\tfor(int col=0; col<matrix[row].length; col++)\n\t\t\t{\n\t\t\t\tSystem.out.print(matrix[row][col] + \"\\t\");\n\t\t\t}\n\t\t\tSystem.out.println();\n\t\t}\n\t}", "public void display() {\n\t\t\n\t\tint u,v;\n\t\t\n\t\tfor(v=1; v<=V; ++v) {\n\t\t\t\n\t\t\tSystem.out.print(\"\\nadj[\" + v + \"] = \");\n\t\t\t\n\t\t\tfor(u = 1 ; u <= V; ++u) {\n\t\t\t\t \n\t\t\t\tSystem.out.print(\" \" + adj[u][v]);\n\t\t\t}\n\t\t} \n\t\tSystem.out.println(\"\");\n\t}", "void printGraph() {\n System.out.println(\n \"All vertices in the graph are presented below.\\n\" +\n \"Their individual edges presented after a tab. \\n\" +\n \"-------\");\n\n for (Map.Entry<Vertex, LinkedList<Vertex>> entry : verticesAndTheirEdges.entrySet()) {\n LinkedList<Vertex> adj = entry.getValue();\n System.out.println(\"Vertex: \" + entry.getKey().getName());\n for (Vertex v : adj) {\n System.out.println(\" \" + v.getName());\n }\n }\n }", "public void displayAsList()\n\t{\n\t\tSystem.out.println(\"Printing all vertices\");\n\t\tvertices.show();\n\t}", "public static void printMatrix(ArrayList<ArrayList<Integer>> matrix){\r\n\t\tfor (int i = 0; i < matrix.size(); i++){\r\n\t\t\tchar index = (char) ('A' + i);\r\n\t\t\tSystem.out.print(index);\r\n\t\t\tSystem.out.print(\":\\t \"); \r\n\t\t\tfor (int j = 0; j < matrix.get(i).size(); j++){\r\n\t\t\t\tSystem.out.print(matrix.get(i).get(j));\r\n\t\t\t\tif (j != matrix.get(i).size() - 1) System.out.print(\"\\t|\");\r\n\t\t\t\telse System.out.println();\r\n\t\t\t}\r\n\t\t}\r\n\t}", "public void printGraph(){\n\t\tSystem.out.println(\"[INFO] Graph: \" + builder.nrNodes + \" nodes, \" + builder.nrEdges + \" edges\");\r\n\t}", "public String toString() {\n StringBuilder s = new StringBuilder();\n String NEWLINE = System.getProperty(\"line.separator\");\n s.append(vertices + \" \" + NEWLINE);\n for (int v = 0; v < vertices; v++) {\n s.append(String.format(\"%d: \", v));\n for (Map.Entry<Integer, Integer> e : adjacent(v).entrySet()) {\n s.append(String.format(\"%d (%d) \", e.getKey(), e.getValue()));\n }\n s.append(NEWLINE);\n }\n return s.toString();\n }", "public void print() {\n\t\tfor (int count = 0; count < adjacencyList.length; count++) {\n\t\t\tLinkedList<Integer> edges = adjacencyList[count];\n\t\t\tSystem.out.println(\"Adjacency list for \" + count);\n\n\t\t\tSystem.out.print(\"head\");\n\t\t\tfor (Integer edge : edges) {\n\t\t\t\tSystem.out.print(\" -> \" + edge);\n\t\t\t}\n\n\t\t\tSystem.out.println();\n\t\t\tSystem.out.println();\n\t\t}\n\t}", "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} else {\n\t\t\t\t\tSystem.out.printf(\" %.1f \", C[i][j]);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tSystem.out.println(\"End of matrix.\");\n\t\t\n\t}", "public void printMatrix(){\n for (int row = 0; row < matrix.length; row++){\n for (int count = 0; count < matrix[row].length; count++){\n System.out.print(\"----\");\n }\n System.out.println();\n System.out.print('|');\n for (int column = 0; column < matrix[row].length; column++){\n if (matrix[row][column] == SHIP)\n System.out.print('X' + \" | \");\n else if (matrix[row][column] == HIT)\n System.out.print('+' + \" | \");\n else if (matrix[row][column] == MISS)\n System.out.print('*' + \" | \");\n else\n System.out.print(\" \" + \" | \");\n }\n System.out.println();\n }\n }", "public void printGraphStructure() {\n\t\tSystem.out.println(\"Vector size \" + nodes.size());\n\t\tSystem.out.println(\"Nodes: \"+ this.getSize());\n\t\tfor (int i=0; i<nodes.size(); i++) {\n\t\t\tSystem.out.print(\"pos \"+i+\": \");\n\t\t\tNode<T> node = nodes.get(i);\n\t\t\tSystem.out.print(node.data+\" -- \");\n\t\t\tIterator<EDEdge<W>> it = node.lEdges.listIterator();\n\t\t\twhile (it.hasNext()) {\n\t\t\t\tEDEdge<W> e = it.next();\n\t\t\t\tSystem.out.print(\"(\"+e.getSource()+\",\"+e.getTarget()+\", \"+e.getWeight()+\")->\" );\n\t\t\t}\n\t\t\tSystem.out.println();\n\t\t}\n\t}", "public void display() {\r\n\t\tArrayList<String> vnames = new ArrayList<>(vces.keySet());\r\n\t\tfor (String vname : vnames) {\r\n\t\t\tString str = vname + \" => \";\r\n\t\t\tVertex vtx = vces.get(vname);\r\n\r\n\t\t\tArrayList<String> nbrnames = new ArrayList<>(vtx.nbrs.keySet());\r\n\t\t\tfor (String nbrname : nbrnames) {\r\n\t\t\t\tstr += nbrname + \"[\" + vtx.nbrs.get(nbrname) + \"], \";\r\n\t\t\t}\r\n\r\n\t\t\tSystem.out.println(str + \".\");\r\n\t\t}\r\n\t}", "void printGraph();", "public String toString() {\n \tString printStatements = \"\";\n \t\n \tfor (Vertex vertex : this) {\n \t\tprintStatements += vertex + \" \";\n \t}\n \treturn printStatements;\n }", "public void printLayout() {\n\n for (int i = 0; i < 5; i++) {\n for (int j = 0; j < 4; j++) {\n System.out.print(matrix[i][j] + \" \");\n\n }\n System.out.println(\"\");\n }\n }", "public void printMatriz( )\n {\n //definir dados\n int lin;\n int col;\n int i;\n int j;\n\n //verificar se matriz e' valida\n if( table == null )\n {\n IO.println(\"ERRO: Matriz invalida. \" );\n } //end\n else\n {\n //obter dimensoes da matriz\n lin = lines();\n col = columns();\n IO.println(\"Matriz com \"+lin+\"x\"+col+\" posicoes.\");\n //pecorrer e mostrar posicoes da matriz\n for(i = 0; i < lin; i++)\n {\n for(j = 0; j < col; j++)\n {\n IO.print(\"\\t\"+table[ i ][ j ]);\n } //end repetir\n IO.println( );\n } //end repetir\n } //end se\n }", "public void print() {\n\t\tfor(int i = 0; i < size; i++) {\n\t\t\tfor(int j = 0; j < size; j++) {\n\t\t\t\tSystem.out.print(m[i][j] + \" \");\n\t\t\t}\n\t\t\tSystem.out.println();\n\t\t}\t\n\t}", "public void print(){\n String res = \"\" + this.number;\n for(Edge edge: edges){\n res += \" \" + edge.toString() + \" \";\n }\n System.out.println(res.trim());\n }", "public void printEdges()\n\t{\n\t\tSystem.out.println(\"Printing all Edges:\");\n\t\tIterator<DSAGraphVertex> itr = vertices.iterator();\n\t\twhile(itr.hasNext())\n\t\t{\n\t\t\titr.next().printAdjacent();\n\t\t}\n\t}", "private static void printMatrix(int[][] matrix) {\n\t\t\n\t\tSystem.out.println(\"\\n\\t[\\n\");\n\t\tArrays.asList(matrix).stream().forEach(intArray -> {\n\t\t\t\n\t\t\tSystem.out.print(\"\\t\\t\" + Arrays.toString(intArray));\n\t\t\tif(!intArray.equals(matrix[matrix.length-1])){\n\t\t\t\tSystem.out.println(\",\");\n\t\t\t}\n\t\t\t\n\t\t});\n\t\tSystem.out.println(\"\\n\\n\\t]\");\n\t}", "@Override\n public String toString()\n {\n StringBuilder sb = new StringBuilder();\n\n for(Vertex vertex: vertices)\n {\n sb.append(\"V: \" + vertex.toString() + '\\n');\n\n for(Edge edge: connections.get(vertex))\n {\n sb.append(\" -> \" + edge.other(vertex).toString() + \" (\" + edge.getWeight() + \")\\n\");\n }\n }\n\n return sb.toString();\n }", "public String toString() {\n\tString retStr = \"\";\n\tfor (int r = 0; r < this.size(); r++){\n\t for (int c = 0; c < this.size(); c++){\n\t\tretStr += matrix[r][c] + \"\\t\";\n\t }\n\t retStr += \"\\n\";\n\t}\n\treturn retStr;\n }", "public void print(){\n for(int i=0; i<maze.length;i+=1) {\n for (int j = 0; j < maze[0].length; j += 1){\n if(i == start.getRowIndex() && j == start.getColumnIndex())\n System.out.print('S');\n else if(i == goal.getRowIndex() && j == goal.getColumnIndex())\n System.out.print('E');\n else if(maze[i][j]==1)\n System.out.print(\"█\");\n else if(maze[i][j]==0)\n System.out.print(\" \");\n\n\n }\n System.out.println();\n }\n }", "private static void printGraph(ArrayList<Vertex> graph) {\n\t\tSystem.out.print(\"---GRAPH PRINT START---\");\n\t\tfor (Vertex vertex: graph) {\n\t\t\tSystem.out.println(\"\\n\\n\" + vertex.getValue());\n\t\t\tSystem.out.print(\"Adjacent nodes: \");\n\t\t\tfor (Vertex v: vertex.getAdjacencyList()) {\n\t\t\t\tSystem.out.print(v.getValue() + \" \");\n\t\t\t}\n\t\t}\n\t\tSystem.out.println(\"\\n\\n---GRAPH PRINT END---\\n\\n\");\n\t}", "void printMST(int[] parent) {\n System.out.println(\"Edge \\tWeight\");\n for (int i = 1; i < VERTICES; i++)\n System.out.println(parent[i] + \" - \" + i + \"\\t\" + graph[i][parent[i]]);\n }", "public String toString() {\n \tStringBuilder s = new StringBuilder();\n \ts.append(V + \" vertices, \" + E + \" edges \" + NEWLINE);\n \tfor(int v = 0; v < V; v++) {\n \t\ts.append(v + \": \");\n \t\tfor(int w : adj[v]) {\n \t\t\ts.append(w + \" \");\n \t\t}\n \t\ts.append(NEWLINE);\n \t}\n \t\n \treturn s.toString();\n }", "static void showGraph(ArrayList<ArrayList<Integer>> graph) {\n for(int i=0;i< graph.size(); i++ ){\n System.out.print(\"Vertex : \" + i + \" : \");\n for(int j = 0; j < graph.get(i).size(); j++) {\n System.out.print(\" -> \"+ graph.get(i).get(j));\n }\n }\n }", "private void printGraph() {\r\n\t\tSortedSet<String> keys = new TreeSet<String>(vertexMap.keySet());\r\n\t\tIterator it = keys.iterator();\r\n\t\twhile (it.hasNext()) {\r\n\t\t\tVertex v = vertexMap.get(it.next());\r\n\t\t\tif (v.isStatus())\r\n\t\t\t\tSystem.out.println(v.getName());\r\n\t\t\telse\r\n\t\t\t\tSystem.out.println(v.getName() + \" DOWN\");\r\n\t\t\tsortEdges(v.adjacent);\r\n\t\t\tfor (Iterator i = v.adjacent.iterator(); i.hasNext();) {\r\n\t\t\t\t// v.adjacent.sort();\r\n\t\t\t\tEdge edge = (Edge) i.next();\r\n\t\t\t\tif (edge.isStatus())\r\n\t\t\t\t\tSystem.out.println(\" \" + edge.getDestination() + \" \" + edge.getCost());\r\n\t\t\t\telse\r\n\t\t\t\t\tSystem.out.println(\" \" + edge.getDestination() + \" \" + edge.getCost() + \" DOWN\");\r\n\t\t\t}\r\n\t\t}\r\n\t}", "public void display() {\r\n int v;\r\n Node n;\r\n \r\n for(v=1; v<=V; ++v){\r\n System.out.print(\"\\nadj[\" + toChar(v) + \"] ->\" );\r\n for(n = adj[v]; n != z; n = n.next) \r\n System.out.print(\" |\" + toChar(n.vert) + \" | \" + n.wgt + \"| ->\"); \r\n }\r\n System.out.println(\"\");\r\n }", "public void print_maze () {\n \n System.out.println();\n\n for (int row=0; row < grid.length; row++) {\n for (int column=0; column < grid[row].length; column++)\n System.out.print (grid[row][column]);\n System.out.println();\n }\n\n System.out.println();\n \n }", "public void print(){\n\t\tfor (int i = 0; i < numRows; i++) {\n\t\t\tfor (int j = 0; j < numCols; j++) {\n\t\t\t\tSystem.out.print(table[i][j] + \" \");\n\t\t\t}\n\t\t\tSystem.out.println();\n\t\t}\n\t}", "public void printMaze()\r\n\t{\r\n\t\tfor(int i = 0;i<maze.length;i++)\r\n\t\t{\r\n\t\t\tSystem.out.println(\"\");\r\n\t\t\tfor(int j = 0;j<maze[0].length;j++)\r\n\t\t\t{\r\n\t\t\t\tSystem.out.println(\"\");\r\n\t\t\t\tfor(int k = 0;k<maze[0][0].length;k++)\r\n\t\t\t\t{\r\n\t\t\t\t\tSystem.out.print(maze[i][j][k]);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\tSystem.out.println(\"\");\r\n\t}", "void printMatrix(int[][] matrix){\n\t\tfor(int i = 0; i < matrix.length; i++){\n\t\t\tfor(int j = 0; j < matrix[i].length; j++){\n\t\t\t\tSystem.out.print(matrix[i][j] + \"\\t\");\n\t\t\t}\n\t\t\tSystem.out.println(\"\");\n\t\t}\n\t}", "public void outAdjacentVertices() {\r\n\t\tfor (int i = 0; i < currentVertex.outList.size(); i++) {\r\n\t\t\tSystem.out.print(currentVertex.outList.get(i).vertex.label + \" \");\r\n\t\t}\r\n\t\tprintLine();\r\n\t}", "public static void printMST(GraphAdjacencyMatrix graph, int parent[]) {\n System.out.println(\"Edge \\tWeight\");\n for (int i = 1; i < graph.getV(); i++)\n System.out.println(parent[i] + \" - \" + i + \"\\t\" + graph.getMatrix()[i][parent[i]]);\n }", "static void printMatrix(int[][] inp){\n\n for(int i=0;i<inp.length;i++){\n for(int j=0;j<inp[0].length;j++){\n System.out.print(inp[i][j]+\" \");\n }\n System.out.println(\"\");\n }\n }", "public void printVisitedCells()\r\n\t{\r\n\t\tSystem.out.print(\"+ +\");\r\n\t\tfor (int i = 1; i < this.getWidth(); i++)\r\n\t\t{\r\n\t\t\tSystem.out.print(\"-+\");\r\n\t\t}\r\n\t\tSystem.out.println();\r\n\r\n\t\tfor (int i = 0; i < this.getHeight(); i++)\r\n\t\t{\r\n\t\t\t\r\n\t\t\tfor (int j = 0; j < this.getWidth(); j++)\r\n\t\t\t{\r\n\t\t\t\tCell c = this.getCellAt(i, j);\r\n\t\t\t\t// if cells are connected, no wall is printed in between them\r\n\t\t\t\tif (c.hasDoorwayTo(Cell.WEST))\r\n\t\t\t\t\tSystem.out.print(\" \");\r\n\t\t\t\telse\r\n\t\t\t\t\tSystem.out.print(\"|\");\t\t\t\r\n\t\t\t\t\r\n\t\t\t\tif(c.getDiscoveryTime() != -1)\r\n\t\t\t\t\tSystem.out.print(c.getDiscoveryTime() % 10);\r\n\t\t\t\telse\r\n\t\t\t\t\tSystem.out.print(\" \");\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tSystem.out.println(\"|\");\r\n\t\t\t\r\n\t\t\tfor (int j = 0; j < this.getWidth(); j++)\r\n\t\t\t{\r\n\t\t\t\tCell c = this.getCellAt(i, j);\r\n\t\t\t\tSystem.out.print(\"+\");\r\n\r\n\t\t\t\tif (c.hasDoorwayTo(Cell.SOUTH) || c == this.getCellAt(getHeight()-1, getWidth()-1))\r\n\t\t\t\t\tSystem.out.print(\" \");\r\n\t\t\t\telse\r\n\t\t\t\t\tSystem.out.print(\"-\");\r\n\t\t\t}\r\n\t\t\tSystem.out.println(\"+\");\r\n\t\t}\r\n\t}", "public static void printMatrix(int[][] matrix){\r\n\t\tfor (int i = matrix.length-1; i >= 0; i = i-1){\r\n\t\t\tfor (int j = 0; j < matrix.length; j = j+1){\r\n\t\t\t\tSystem.out.format(\"%4d\", matrix[i][j]);\r\n\t\t\t}\r\n\t\t\tSystem.out.println();\r\n\t\t}\r\n\t}", "private void printGraphModel() {\n System.out.println(\"Amount of nodes: \" + graphModel.getNodes().size() +\n \" || Amount of edges: \" + graphModel.getEdges().size());\n System.out.println(\"Nodes:\");\n int i = 0;\n for (Node n : graphModel.getNodes()) {\n System.out.println(\"#\" + i + \" \" + n.toString());\n i++;\n }\n System.out.println(\"Edges:\");\n i = 0;\n for (Edge e : graphModel.getEdges()) {\n System.out.println(\"#\" + i + \" \" + e.toString());\n i++;\n }\n }", "@Override\n\tpublic String toString() {\n\t\tString out = new String();\n\t\tfor (int i = 0; i < this.maxNumVertices; i++) {\n\t\t\tfor (int j = 0; j < this.maxNumVertices; j++) {\n\t\t\t\tout = out + this.reachabilityMatrix[i][j] + \" \";\n\t\t\t}\n\t\t\tout = out + \"\\n\";\n\t\t}\n\t\treturn out;\n\t}", "static void showMatrix()\n {\n String sGameField = \"Game field: \\n\";\n for (String [] row : sField) \n {\n for (String val : row) \n {\n sGameField += \" \" + val;\n }\n sGameField += \"\\n\";\n }\n System.out.println(sGameField);\n }", "public static void printMatrix(int[][] m) {\n for (int i = 0; i < m.length; ++i) {\n for (int j = 0; j < m[i].length; ++j) {\n System.out.print(\" \" + m[i][j]);\n }\n System.out.println();\n }\n }", "protected String stringConnectionsMatrix() {\n String ret = \"Connection Matrix\";\n for (G good : this.goods) {\n ret += \"\\n\";\n for (B bidder : this.bidders) {\n if (bidder.demandsGood(good)) {\n ret += \"\\t yes\";\n } else {\n ret += \"\\t no\";\n }\n }\n }\n return ret + \"\\n\";\n }", "public void print() {\n mat.print();\n }", "private void print(Matrix mat) {\n\t\tfor(int i=0;i<mat.numRows();i++){\n\t\t\tfor(int j=0;j<mat.numColumns();j++){\n\t\t\t\tSystem.out.print(mat.value(i, j)+\" \");\n\t\t\t}\n\t\t\tSystem.out.print(\"\\n\");\n\t\t}\n\t}", "public void print (){\r\n for (int i = 0; i < graph.size(); ++i){\r\n graph.get(i).print();\r\n }\r\n }", "public void printLaptops(){\n\t\tSystem.out.println(\"Root is: \"+vertices.get(root));\n\t\tSystem.out.println(\"Edges: \");\n\t\tfor(int i=0;i<parent.length;i++){\n\t\t\tif(parent[i] != -1){\n\t\t\t\tSystem.out.print(\"(\"+vertices.get(parent[i])+\", \"+\n\t\t\tvertices.get(i)+\") \");\n\t\t\t}\n\t\t}\n\t\tSystem.out.println();\n\t\t}", "public static void main(String[] args) {\n int vertex = 5;\n //value of vertexes\n int[][] matrix = new int[vertex+1][vertex+1];\n \n //to store the Edges informarion\n ArrayList<Edge> edgeList = new ArrayList<Edge>();\n edgeList.add(new Edge(1,2,2));\n edgeList.add(new Edge(2,3,4));\n edgeList.add(new Edge(2,4,8));\n edgeList.add(new Edge(3,1,3));\n edgeList.add(new Edge(3,5,8));\n edgeList.add(new Edge(5,2,7));\n edgeList.add(new Edge(5,4,3));\n \n //loop of the ArrayList\n for(int i=0; i<edgeList.size(); i++){\n //define the variable Edge as currentEdge\n Edge currentEdge = edgeList.get(i);\n //stored the information in these 3 variables\n int startVertex = currentEdge.startVertex;\n int endVertex = currentEdge.endVertex;\n int weight = currentEdge.weight;\n //updated matrix and created data structure for weighted Directed Graph\n matrix[startVertex][endVertex] = weight;\n }\n\n for(int i = 1; i<=vertex; i++){\n for(int j=1; j<=vertex; j++){\n System.out.print(matrix[i][j] + \" \");\n }\n System.out.println();\n //to move to the next line\n }\n }", "public String toString() \n {\n String NEWLINE = System.getProperty(\"line.separator\");\n StringBuilder s = new StringBuilder();\n for (int v = 0; v < V; v++) \n {\n s.append(v + \": \");\n for (DirectedEdge e : adj[v]) \n {\n \tif(e.online)\n \t{\n \t\ts.append(e + \" \");\n \t}\n }\n s.append(NEWLINE);\n }\n return s.toString();\n }", "public void printVertices(PrintWriter os) {\n\n\n // Implement me!\n String s = \"\";\n for (String k : vertices.keySet()) {\n s = s + k + \" \";\n }\n os.println(s);\n\n\n }", "public String toString() {\n String s = \"\";\n for (Vertex v : mVertices.values()) {\n s += v + \": \";\n for (Vertex w : mAdjList.get(v)) {\n s += w + \" \";\n }\n s += \"\\n\";\n }\n return s;\n }", "public String toString() {\n StringBuilder s = new StringBuilder();\n s.append(ver + \" vertices, \" + edg + \" edges \" + NEWLINE);\n for (int v = 0; v < ver; v++) {\n s.append(String.format(\"%d: \", v));\n for (int w : adj[v]) {\n s.append(String.format(\"%d \", w));\n }\n s.append(NEWLINE);\n }\n return s.toString();\n }", "public void printEdges() {\n\t\tSystem.out.println(\"Edges\");\n\t\tIterator<Edge> i = edges.iterator();\n\t\twhile(i.hasNext()) {\n\t\t\tEdge e = i.next();\n\t\t\tSystem.out.println(e.toString());\n\t\t}\n\t}", "public void printRoutine()\n\t{\n\t\tfor (String name: vertices.keySet())\n\t\t{\n\t\t\tString value = vertices.get(name).toString();\n\t\t\tSystem.out.println(value);\n\t\t}\n\t}", "public static void printMatrix(ArrayList<List<String>> matrix){\r\n\t\tfor (int i = 0; i < matrix.size(); i++) {\r\n\t\t\tfor (int j = 0; j < matrix.get(i).size(); j++) {\r\n\t\t\t\tSystem.out.print(matrix.get(i).get(j)+\", \");\r\n\t\t\t}\r\n\t\t\tSystem.out.println();\r\n\t\t}\r\n\t}", "public void print(){\n for (int i = 0; i < rows; i++)\n {\n for (int j = 0; j < cols; j++)\n {\n if (start.getCol()==j&&start.getRow()==i)\n System.out.print('S');\n else if (end.getCol()==j&&end.getRow()==i)\n System.out.print('E');\n else if (maze[i][j]==1)\n System.out.print('\\u2588');\n else if (maze[i][j]==0)\n System.out.print('\\u2591');\n if (j!=cols-1){\n System.out.print(\" \");\n }\n }\n System.out.println();\n }\n //System.out.println(\"-------\");\n }", "public void printMST() {\n\t\t\n\t\tString mstPath = \"\";\n\t\t\n\t\t/**Stores the parent child hierarchy*/\n\t\tint distance[] = new int[this.vertices];\n\t\t\n\t\t/**Stores all the vertices with their distances from source vertex*/\n\t\tMap<Integer, Integer> map = new HashMap<Integer, Integer>();\n\t\tmap.put(0, 0);\n\t\t\n\t\tfor(int i = 1; i < vertices; i++){\n\t\t\tmap.put(i, Integer.MAX_VALUE);\n\t\t}\n\t\t\n\t\tfor(int i = 0; i < vertices; i++){\n\t\t\t\n\t\t\tInteger minVertex = extractMin(map), minValue = map.get(minVertex);\n\t\t\tdistance[minVertex] = minValue;\n\t\t\t\n\t\t\tmstPath += minVertex + \" --> \";\n\t\t\t\n\t\t\t/**Removing min vertex from map*/\n\t\t\tmap.remove(minVertex);\n\t\t\t\n\t\t\t/**Exploring edges of min vertex*/\n\t\t\tArrayList<GraphEdge> edges = this.adjList[minVertex];\n\t\t\tfor(GraphEdge edge : edges){\n\t\t\t\tif(map.containsKey(edge.destination)){\n\t\t\t\t\tif(map.get(edge.destination) > distance[edge.source] + edge.weight){\n\t\t\t\t\t\tmap.put(edge.destination, distance[edge.source] + edge.weight);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t\n\t\tSystem.out.println(mstPath);\n\t}", "public String toString(){\n String string = \"\" + nrVertices;\n for(DEdge edge : edges){\n string += \"\\n\" + (edge.getVertex1()) + \" \" + (edge.getVertex2());\n }\n return string;\n }", "public void inAdjacentVertices() {\r\n\t\tfor (int i = 0; i < currentVertex.inList.size(); i++) {\r\n\t\t\tSystem.out.print(currentVertex.inList.get(i).vertex.label + \" \");\r\n\t\t}\r\n\t\tprintLine();\r\n\t}", "private void print_solution() {\n System.out.print(\"\\n\");\n for (int i = 0; i < rowsCount; i++) {\n for (int j = 0; j < colsCount; j++) {\n System.out.print(cells[i][j].getValue());\n }\n System.out.print(\"\\n\");\n }\n }", "public void printEdge(){\n\t\tint count = 0;\n\t\tSystem.out.print(\"\\t\");\n\t\tfor(Edge e: edgeArray){\n\t\t\tif(count > 5){\n\t\t\t\tSystem.out.println();\n\t\t\t\tcount = 0;\n\t\t\t\tSystem.out.print(\"\\t\");\n\t\t\t}\n\t\t\tcount ++;\n\t\t\tSystem.out.printf(\"%s (%d) \", e.getVertex().getRecord(), e.getCost());\n\t\t}\n\t\tSystem.out.println();\n\t}", "public void printStatus(){\n System.out.println(\"Nodes: \" + \n getVertexCount() + \" Edges: \" + \n getEdgeCount()); \n //and \" + getEdgeCount() + \" edges active.\");\n }", "public void print() {\n \tfor (int i=0; i < this.table.height; i++) {\n \t\tfor (int j=0; j < this.table.width; j++) {\n \t\t\tString tmp = \"e\";\n \t\t\tif(this.table.field[i][j].head != null) {\n \t\t\t\ttmp = \"\";\n \t\t\t\tswitch (this.table.field[i][j].head.direction) {\n\t\t\t\t\tcase 1:\n\t\t\t\t\t\ttmp+=\"^\";\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase 2:\n\t\t\t\t\t\ttmp+=\">\";\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase 3:\n\t\t\t\t\t\ttmp+=\"V\";\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase 4:\n\t\t\t\t\t\ttmp+=\"<\";\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tdefault:\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n \t\t\t}\n \t\t\telse if(this.table.field[i][j].obj != null) {\n \t\t\t\ttmp = this.table.field[i][j].obj.name;\n \t\t\t}\n \t\t\tSystem.out.print(\" \" + tmp);\n \t\t}\n \t\t\tSystem.out.println(\"\");\n \t}\n }", "public static void printMatrix(Object[][] matrix) {\n for (Object[] row : matrix) {\n for (Object cell : row) {\n System.out.print(cell + \" \");\n }\n System.out.println();\n }\n }", "@Override\n public String toString() {\n StringBuilder builder = new StringBuilder();\n for (double[] b : matrix) {\n builder.append(\"\\n\");\n for (double c : b) {\n builder.append(c).append(\" \");\n }\n }\n return builder.toString();\n }", "@Override\n public String toString()\n {\n String builder = new String();\n \tfor (V vertex : graph.keySet()){\n \t\tString strVertex = vertex.toString();\n \t\tbuilder = builder + strVertex + \": \";\n \t\tArrayList <V> edges = graph.get(vertex);\n \t\tint degree = edges.size();\n \t\tint i = 0;\n \t\tif (degree > 0){\n \t\t\twhile (i < degree -1){\n \t\t\t\tString strEdge = edges.get(i).toString();\n \t\t\t\tbuilder = builder + strEdge + \", \";\n \t\t\t\ti++;\n \t\t\t}\n \t\tString strEdge = edges.get(i).toString();\n \t\tbuilder = builder + strEdge + \"\\n\";\n\n \t\t}\n \t\telse{\n \t\t\tstrVertex = vertex.toString();\n \t\t\tbuilder = builder + strVertex + \": \\n\";\n \t\t}\n\n \t}\n \treturn builder;\n }", "public static void display(int[][] matrix){\n for (int i = 0; i < matrix.length; i++) {\n for (int j = 0; j < matrix.length; j++) {\n System.out.print(matrix[i][j] + \" \");\n }\n System.out.println(\"\");\n }\n }", "public String toString() {\n\t\tString s = \"\";\n\t\t// Loop through all the vertices and add their neighbors to a string\n\t\tfor (int i = 0; i < this.vertices.size(); i++) {\n\t\t\ts += this.vertices.get(i).toString() + \": \" + this.vertices.get(i).getNeighbors() + \"\\n\\n\";\n\t\t}\n\t\ts += \"Number of Total Edges: \" + this.actualTotalEdges;\n\t\treturn s;\n\t}", "public String toString() \n\t{\n\t\tString toReturn = \"\";\n\t\t\n\t\t\n\t\tfor(Vertex v : vertices) \n\t\t{\n\t\t\tHashMap<Vertex, Integer> E = getEdges(v);\n\t\t\t\n\t\t\tif(!E.isEmpty())\n\t\t\t{\n\t\t\t\ttoReturn = toReturn + v + \"(\";\n\t\t\t\tfor(Vertex edge : E.keySet()) \n\t\t\t\t{\n\t\t\t\t\ttoReturn = toReturn + edge.getName() + \", \";\n\t\t\t\t}\n\t\t\t\ttoReturn = toReturn.trim().substring(0, toReturn.length() - 2);\n\t\t\t\ttoReturn = toReturn + \")\\n\";\n\t\t\t}\n\t\t\telse {toReturn = toReturn + v + \"[]\\n\";}\n\t\t}\n\t\treturn toReturn;\n\t}", "public static void printMatrix(BigDecimal[][] m){\n\t\tfor(int i = 0; i < m.length; i++){\n\t\t\tfor(int j = 0; j < m[0].length; j++)\n\t\t\t\tSystem.out.print(m[i][j]+\"\\t\");\n\n\t\t\tSystem.out.println();\n\t\t}\n\t\tSystem.out.println();\n\t}", "public String toString() {\n\t\tStringBuilder temp = new StringBuilder();\n\n\t\tfor (int index = 0; index < verticesNum; index++) {\n\t\t\tif(list[index] == null)\n\t\t\t{\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\ttemp.append(\"node:\");\n\t\t\ttemp.append(index);\n\t\t\ttemp.append(\": \");\n\t\t\ttemp.append(list[index].toString());\n\t\t\ttemp.append(\"\\n\");\n\t\t}\n\n\t\treturn temp.toString();\n\t}", "public void printGraph() {\n System.out.println( );\n // the cell number corresponding to a location on a GameBoard\n String cell = \"\"; \n // the distance a cell is from the starting location\n String dist = \"\"; \n\n // for every cell in the graph\n for ( int i = 0; i < graph.length; i++ ) {\n\n // format graph by prefixing a 0 if the number is less\n // than 10. this will ensure output is uniform\n if ( graph[i].graphLoc < 10 )\n cell = \"0\" + graph[i].graphLoc;\n else\n cell = graph[i].graphLoc + \"\";\n\n // format distance by prefixing a space if the number\n // is between 0 and 9 inclusive\n if ( graph[i].dist < 10 && graph[i].dist >= 0 )\n dist = graph[i].dist + \" \";\n // give red color if the cell was never checked\n else if ( graph[i].dist == -1 )\n dist = ANSI_RED + graph[i].dist + \"\" + ANSI_RESET;\n else\n dist = graph[i].dist + \"\";\n\n // print the cell and distance\n // an example output is [13: 5]\n System.out.print(\"[\"+cell+\":\"+dist+\"]\");\n\n // create a new line for the next row\n if ( (i+1) % GameBoard.COLUMNS == 0 )\n System.out.println(\"\\n\");\n }\n }", "public static void printMatrix(Object[][] M) {\r\n\r\n\t\t// Calculation of the length of each column\r\n\t\tint[] maxLength = new int[M[0].length];\r\n\t\tfor (int j = 0; j < M[0].length; j++) {\r\n\t\t\tmaxLength[j] = M[0][j].toString().length();\r\n\t\t\tfor (int i = 1; i < M.length; i++)\r\n\t\t\t\tmaxLength[j] = Math.max(M[i][j].toString().length(), maxLength[j]);\r\n\t\t\tmaxLength[j] += 3;\r\n\t\t}\r\n\t\t\r\n\t\t// Display\r\n\t\tString line, word;\r\n\t\tfor (int i = 0; i < M.length; i++) {\r\n\t\t\tline = \"\";\r\n\t\t\tfor (int j = 0; j < M[i].length; j++) {\r\n\t\t\t\tword = M[i][j].toString();\r\n\t\t\t\twhile (word.length() < maxLength[j])\r\n\t\t\t\t\tword += \" \";\r\n\t\t\t\tline += word;\r\n\t\t\t}\r\n\t\t\tSystem.out.println(line);\r\n\t\t}\r\n\t}", "public static void printMatrix(Matrix m) {\n double[][]matrix = m.getData();\n for(int row = 0; row < matrix.length; row++) {\n for(int column = 0; column < matrix[row].length; column++)\n System.out.print(matrix[row][column] + \" \");\n System.out.println(\"\");\n }\n }", "public static void makeMatrix()\n {\n\n n = Graph.getN();\n m = Graph.getM();\n e = Graph.getE();\n\n connectMatrix = new int[n][n];\n\n // sets the row of value u and the column of value v to 1 (this means they are connected) and vice versa\n // vertices are not considered to be connected to themselves.\n for(int i = 0; i < m;i++)\n {\n connectMatrix[e[i].u-1][e[i].v-1] = 1;\n connectMatrix[e[i].v-1][e[i].u-1] = 1;\n }\n }", "public static void printMatrix(double[][] matrix) {\r\n\r\n if (matrix == null) {\r\n return;\r\n }\r\n\r\n for (int row = 0; row < matrix.length; row++) {\r\n\r\n System.out.print(\"(\");\r\n\r\n for (int column = 0; column < matrix[row].length; column++) {\r\n\r\n if (column != 0) {\r\n System.out.print(\",\");\r\n }\r\n System.out.print(matrix[row][column]);\r\n }\r\n\r\n System.out.println(\")\");\r\n }\r\n }", "public String toString() {\n StringBuilder s = new StringBuilder();\n s.append(N + \"\\n\");\n for (int i = 0; i < N; i++) {\n for (int j = 0; j < N; j++) {\n s.append(String.format(\"%2d \", matrix[i][j]));\n }\n s.append(\"\\n\");\n }\n return s.toString();\n }", "public String toString()\r\n\t{\r\n\t\tString str = \"\";\r\n\t\t\r\n\t\tSortedSet<String> sortedVertices = new TreeSet<String>(this.getVertices());\r\n\t\t\r\n\t\tstr += \"Vertices: \" + sortedVertices.toString() + \"\\nEdges:\\n\";\r\n\t\t\r\n\t\tfor(String vertex : sortedVertices)\r\n\t\t{\r\n\t\t\tif(this.dataMap.containsKey(vertex))\r\n\t\t\t{\r\n\t\t\t\tHashMap<String,Integer> adjMap = this.adjacencyMap.get(vertex);\r\n\t\t\t\t\r\n\t\t\t\tSortedSet<String> sortedKeys = new TreeSet<String>(adjMap.keySet());\r\n\t\t\t\t\r\n\t\t\t\tstr += \"Vertex(\" + vertex + \")--->{\";\r\n\t\t\t\tfor(String adj : sortedKeys)\r\n\t\t\t\t{\r\n\t\t\t\t\tstr += adj +\"=\"+ adjMap.get(adj) +\", \";\r\n\t\t\t\t}\r\n\t\t\t\tstr = str.trim();\r\n\t\t\t\t\r\n\t\t\t\tif(!sortedKeys.isEmpty())\r\n\t\t\t\t{\r\n\t\t\t\t\tStringBuilder s = new StringBuilder(str);\r\n\t\t\t\t\ts.deleteCharAt(str.length()-1);\r\n\t\t\t\t\tstr = s.toString();\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\tstr+=\"}\\n\";\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\treturn str;\r\n\t}", "public void printAdjacents(ArrayList<Position> nodes){\r\n\t\tSystem.out.print(\"For node (\"+this.y+\",\"+this.x+\"):\");\r\n\t\tfor(Position node:nodes){\r\n\t\t\tSystem.out.print(\"(\"+node.getY()+\",\"+node.getX()+\")\");\r\n\t\t}\r\n\t\tSystem.out.print(\"\\n\");\r\n\t}", "public String toString(){\n\t\treturn vertex.toString();\n\t}", "public void print() {\n int rows = this.getNumRows();\n int cols = this.getNumColumns();\n\n for (int r = 0; r < rows; r++) {\n\n for (int c = 0; c < cols; c++) {\n System.out.print(this.getString(r, c) + \", \");\n }\n\n System.out.println(\" \");\n }\n }", "public String toString()\n\t{\n\t \n\t\tString str = vertexName + \": \" ;\n\t\tfor(int i = 0 ; i < adjacencyList.size(); i++)\n\t\t\tstr = str + adjacencyList.get(i).vertexName + \" \";\n\t\treturn str ;\n\t\t\n\t}", "private void printNeighbourTable()\n {\n\n myGUI.println(\"Neighbour Distance Table\");\n String str = F.format(\"dst |\", 15);\n for (int i = 0; i < RouterSimulator.NUM_NODES; i++) {\n str += (F.format(i, 15));\n }\n myGUI.println(str);\n for (int i = 0; i < str.length(); i++) {\n myGUI.print(\"-\");\n }\n myGUI.println();\n for (int i = 0; i < RouterSimulator.NUM_NODES; i++) {\n str = F.format(\"nbr \" + i + \" |\", 15);\n for (int j = 0; j < RouterSimulator.NUM_NODES; j++) {\n str += (F.format(myNeighboursDistTable[i][j], 15));\n }\n if (i != myID && neighbours[i])\n myGUI.println(str);\n }\n myGUI.println();\n }", "private void printSolution(int startVertex, double[] distances, int[] parents) {\n int nVertices = distances.length;\n System.out.print(\"Vertex\\t Distance\\tPath\");\n\n for (int vertexIndex = 0; vertexIndex < nVertices; vertexIndex++) {\n if (vertexIndex != startVertex) {\n System.out.print(\"\\n\" + startVertex + \" -> \");\n System.out.print(vertexIndex + \" \\t\\t \");\n System.out.print(distances[vertexIndex] + \"\\t\\t\");\n printPath(vertexIndex, parents);\n }\n }\n }", "@Override\n\tpublic String toString()\n\t{\n\t\t/* output looks like this\n\t\t * \n\t\t * 20 - 10, 30 20 has edges with 10 and 30\n\t\t * 40 - 10, 30 \t\t40 has edges with 10 and 30\n\t\t * 10 - 20, 40 \t\t\t10 has edges with 20 and 40\n\t\t * 30 - 20, 40 \t\t\t30 has edges with 20 and 40\n\t\t */\n\t\tString str = new String();\n\t\tfor(Map.Entry<Object, SinglyLinkedList> vertex : map.entrySet())\n\t\t\tstr += vertex.getKey() + \" - \" + vertex.getValue() + '\\n';\t\t\t\t\n\t\treturn str;\n\t}", "default void print() {\r\n\t\tGenerator.getInstance().getLogger().debug(\"Operation matrix:\\r\");\r\n\t\tString ans = \" operation \";\r\n\t\tfor (double i = 0; i < this.getOperationMap().keySet().size(); i++) {\r\n\t\t\tfinal Element element1 = this.get(i);\r\n\t\t\tans += element1 + \" \";\r\n\t\t}\r\n\t\tLogManager.getLogger(FiniteSemiGroup.class).debug(ans);\r\n\t\tfor (double i = 0; i < this.getOperationMap().keySet().size(); i++) {\r\n\t\t\tfinal Element element1 = this.get(i);\r\n\t\t\tans = element1 + \" \";\r\n\t\t\tfor (double j = 0; j < this.getOperationMap().keySet().size(); j++) {\r\n\t\t\t\tfinal Element element2 = this.get(j);\r\n\t\t\t\tans += \" \" + this.getOperationMap().get(element1).get(element2) + \" \";\r\n\t\t\t}\r\n\t\t\tLogManager.getLogger(FiniteSemiGroup.class).debug(ans);\r\n\t\t}\r\n\t}" ]
[ "0.81052405", "0.7195068", "0.71880746", "0.7143837", "0.71103245", "0.70921314", "0.7058857", "0.68931115", "0.68653345", "0.6815402", "0.6781705", "0.6775258", "0.677435", "0.6763121", "0.6758587", "0.6647101", "0.6602777", "0.65684783", "0.65502626", "0.65449274", "0.6537916", "0.65327895", "0.6483426", "0.64520603", "0.6450247", "0.6449844", "0.64441335", "0.64381826", "0.6433111", "0.64328206", "0.6382065", "0.6355334", "0.6338952", "0.63230807", "0.6318242", "0.6314331", "0.6308712", "0.63071555", "0.6306884", "0.6286392", "0.6280943", "0.62781787", "0.62666297", "0.62597346", "0.6255268", "0.6234805", "0.6232713", "0.62264466", "0.6212587", "0.6167067", "0.6155775", "0.6150513", "0.6138403", "0.61343145", "0.6125198", "0.61227816", "0.61205536", "0.61197937", "0.61190104", "0.6103657", "0.60903156", "0.6089037", "0.6084578", "0.6078094", "0.6073888", "0.60626173", "0.6044493", "0.6041226", "0.6040315", "0.603509", "0.6034152", "0.60271955", "0.6021849", "0.60216254", "0.6020401", "0.6002065", "0.5999839", "0.5989918", "0.5967441", "0.59641236", "0.5948867", "0.5938937", "0.59331214", "0.59168226", "0.59117275", "0.59066707", "0.59005046", "0.58939373", "0.58816093", "0.5868287", "0.5867468", "0.5866242", "0.58655214", "0.58624697", "0.5861926", "0.5855943", "0.58542246", "0.58530164", "0.5839997", "0.58352005" ]
0.7843287
1
check if its in the irregular Verb
public String getVerbFromSimplePast (String verbForm) { if (simplePastToPresentVerbMAP.containsKey(verbForm)) { return simplePastToPresentVerbMAP.get(verbForm); } else { if (verbForm.endsWith("ed")) { return verbForm.substring(0, verbForm.length() - 2); } else if (verbForm.endsWith("d")) { return verbForm.substring(0, verbForm.length() - 1); } } return verbForm; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private static boolean isVerb(AnalyzedTokenReadings[] tokens, int n) {\n return (tokens[n].matchesPosTagRegex(\"(VER:[1-3]:|VER:.*:[1-3]:).*\")\n && !tokens[n].matchesPosTagRegex(\"(ZAL|ADJ|ADV|ART|SUB|PRO:POS).*\")\n && (!tokens[n].hasPosTagStartingWith(\"VER:INF:\") || !tokens[n-1].getToken().equals(\"zu\"))\n && !tokens[n].isImmunized()\n );\n }", "private static boolean isAnyVerb(AnalyzedTokenReadings[] tokens, int n) {\n return tokens[n].hasPosTagStartingWith(\"VER:\")\n || (n < tokens.length - 1\n && ((tokens[n].getToken().equals(\"zu\") && tokens[n+1].hasPosTagStartingWith(\"VER:INF:\"))\n || (tokens[n].hasPosTag(\"NEG\") && tokens[n+1].hasPosTagStartingWith(\"VER:\"))));\n }", "static boolean isVerbBehind(AnalyzedTokenReadings[] tokens, int end) {\n return (end < tokens.length - 1 && tokens[end].getToken().equals(\",\") && tokens[end+1].hasPosTagStartingWith(\"VER:\"));\n }", "@Override\n\tpublic boolean Authority(String verb) {\n\t\tif(list.contains(verb))\n\t\t\treturn true;\n\t\treturn false;\n\t}", "private static boolean isKonAfterVerb(AnalyzedTokenReadings[] tokens, int start, int end) {\n if(tokens[start].matchesPosTagRegex(\"VER:(MOD|AUX).*\") && tokens[start + 1].matchesPosTagRegex(\"(KON|PRP).*\")) {\n if(start + 3 == end) {\n return true;\n }\n for(int i = start + 2; i < end; i++) {\n if(tokens[i].matchesPosTagRegex(\"(SUB|PRO:PER).*\")) {\n return true;\n }\n }\n }\n return false;\n }", "private static boolean isTwoPlusCombinedVerbs(AnalyzedTokenReadings[] tokens, int first, int last) {\n return tokens[first].matchesPosTagRegex(\".*PA[12]:.*\") && tokens[last-1].matchesPosTagRegex(\"VER:.*INF.*\");\n }", "private static int hasPotentialSubclause(AnalyzedTokenReadings[] tokens, int start, int end) {\n List<Integer> verbs = verbPos(tokens, start, end);\n if(verbs.size() == 1 && end < tokens.length - 2 && verbs.get(0) == end - 1) {\n int nextEnd = nextSeparator(tokens, end + 1);\n List<Integer> nextVerbs = verbPos(tokens, end + 1, nextEnd);\n if(isKonUnt(tokens[start])) {\n if(nextVerbs.size() > 1 || (nextVerbs.size() == 1 && nextVerbs.get(0) == end - 1)) {\n return verbs.get(0);\n }\n } else if(nextVerbs.size() > 0) {\n return verbs.get(0);\n }\n return -1;\n }\n if(verbs.size() == 2) {\n if(tokens[verbs.get(0)].matchesPosTagRegex(\"VER:(MOD|AUX):.*\") && tokens[verbs.get(1)].hasPosTagStartingWith(\"VER:INF:\")) {\n return verbs.get(0);\n }\n if(tokens[verbs.get(0)].hasPosTagStartingWith(\"VER:AUX:\") && tokens[verbs.get(1)].hasPosTagStartingWith(\"VER:PA2:\")) {\n return -1;\n }\n if(end == tokens.length - 1 && verbs.get(0) == end - 2\n && tokens[verbs.get(0)].hasPosTagStartingWith(\"VER:INF:\") && tokens[verbs.get(1)].hasPosTagStartingWith(\"VER:MOD:\")) {\n return -1;\n }\n }\n if(verbs.size() == 3) {\n if(tokens[verbs.get(0)].hasPosTagStartingWith(\"VER:MOD:\")\n && ((tokens[verbs.get(2) - 1].matchesPosTagRegex(\"VER:(INF|PA2):.*\") && tokens[verbs.get(2)].hasPosTagStartingWith(\"VER:INF:\"))\n || (tokens[verbs.get(1) - 1].getToken().equals(\"weder\") && tokens[verbs.get(1)].hasPosTagStartingWith(\"VER:INF:\")\n && tokens[verbs.get(2) - 1].getToken().equals(\"noch\") && tokens[verbs.get(1)].hasPosTagStartingWith(\"VER:INF:\")))\n ) {\n return -1;\n }\n }\n if(verbs.size() > 1) {\n return verbs.get(verbs.size() - 1);\n }\n return -1;\n }", "private boolean hasEscalatingSubresources(List<String> verbs, List<String> resources) {\n if (Collections.disjoint(verbs, EscalatingResources.ESCALATING_VERBS)) {\n return false;\n }\n\n for (String apiResource : resources) {\n int idx = apiResource.lastIndexOf(\"/\");\n if (idx == -1) {\n continue;\n }\n String subResource = apiResource.substring(idx + 1);\n if (EscalatingResources.ESCALATING_SUBRESOURCES.contains(subResource)) {\n return true;\n }\n }\n return false;\n }", "@Test\n\tpublic void testBVPattern() {\n\t\t/*\n\t\t * white space match with BV\n\t\t */\n\t\tString content = \"This is a valid content which has BV and let us see\";\n\t\tboolean validContent = BVUtilty.validateBVContent(content);\n\t\tAssert.assertTrue(validContent);\n\t\t\n\t\tcontent = \"This content has bV in the content\";\n\t\tvalidContent = BVUtilty.validateBVContent(content);\n\t\tAssert.assertTrue(validContent);\n\t\t\n\t\tcontent = \"This content has Bv in the content\";\n\t\tvalidContent = BVUtilty.validateBVContent(content);\n\t\tAssert.assertTrue(validContent);\n\t\t\n\t\tcontent = \"Thsi content has bv in the content\";\n\t\tvalidContent = BVUtilty.validateBVContent(content);\n\t\tAssert.assertTrue(validContent);\n\t\t\n\t\tcontent = \"thisisstrangeBvcontent\";\n\t\tvalidContent = BVUtilty.validateBVContent(content);\n\t\tAssert.assertTrue(validContent);\n\t\t\n\t\tcontent = \"corrupted\";\n\t\tvalidContent = BVUtilty.validateBVContent(content);\n\t\tAssert.assertFalse(validContent);\n\t\t\n\t\tcontent = \"\";\n\t\tvalidContent = BVUtilty.validateBVContent(content);\n\t\tAssert.assertFalse(validContent);\n\t}", "public static boolean abrevChecker(String abrv, String word) {\r\n \r\n //our 3rd word make by decrypting the given word\r\n String newWord = \"\";\r\n\r\n //splitting our two inputs into arrayLists and redefining them\r\n char[] firstWord = abrv.toCharArray();\r\n char[] secondWord = word.toCharArray();\r\n\r\n /*a for loop to check if each letter in word is inside the abbrevbation\r\n and creating a new word made of the commmon letters*/\r\n for (char letter : secondWord) {\r\n if (abrv.indexOf(letter) != -1) {\r\n newWord += letter;\r\n }\r\n }\r\n \r\n //check if the abrevation contains any forgein letters that word doesnt have\r\n for (char letter : firstWord) {\r\n if (word.indexOf(letter) == -1) {\r\n return false;\r\n\r\n /*if the abbrevation contains only letters found in word checks if\r\n the abbrevation is inside the new word*/\r\n } else if (word.indexOf(letter) != -1) {\r\n if (newWord.contains(abrv)) {\r\n return true;\r\n } else {\r\n return false;\r\n }\r\n }\r\n\r\n }\r\n\t\treturn false;\r\n }", "public boolean hasVBToBeAdj(Sentence sent) {\n boolean hasVB = false;\n boolean hasAdj = false;\n String vb = \"\";\n String adj = \"\";\n for (Dependency dep : selectCovered(Dependency.class, sent)) {\n // A cop (copula) is the relation of a function word used to link a subject to a nonverbal\n // predicate\n if (dep.getDependencyType().equalsIgnoreCase(\"cop\")) {\n vb = dep.getDependent().getCoveredText();\n adj = dep.getGovernor().getCoveredText();\n }\n }\n for (Token token : selectCovered(Token.class, sent)) {\n if (token.getCoveredText().equals(vb) && token.getPosValue().toLowerCase().startsWith(\"vb\"))\n hasVB = true;\n if (token.getCoveredText().equals(adj) && token.getPosValue().toLowerCase().equals(\"jj\"))\n hasAdj = true;\n }\n return hasVB && hasAdj;\n }", "private static boolean isTwoCombinedVerbs(AnalyzedTokenReadings first, AnalyzedTokenReadings second) {\n return first.matchesPosTagRegex(\"(VER:.*INF|.*PA[12]:).*\") && second.hasPosTagStartingWith(\"VER:\");\n }", "private static boolean isSpecialPair(AnalyzedTokenReadings[] tokens, int first, int second) {\n if(first + 3 >= second && tokens[first].matchesPosTagRegex(\"VER:.*INF.*\")\n && StringUtils.equalsAny(tokens[first+1].getToken(), \"als\", \"noch\")\n && tokens[first + 2].matchesPosTagRegex(\"VER:.*INF.*\")) {\n if(first + 2 == second) {\n return true;\n }\n return isTwoCombinedVerbs(tokens[second - 1], tokens[second]);\n }\n return false;\n }", "private static boolean isThreeCombinedVerbs(AnalyzedTokenReadings[] tokens, int first, int last) {\n return tokens[first].matchesPosTagRegex(\"VER:(AUX|INF|PA[12]).*\") && tokens[first + 1].matchesPosTagRegex(\"VER:(.*INF|PA[12]).*\")\n && tokens[last].matchesPosTagRegex(\"VER:(MOD|AUX).*\");\n }", "public static void main(String[] a){\n System.out.println(\"abc\".contains(\"a\"));//Verdadero\n\tSystem.out.println(\"abc\".contains(\"B\")); //Falso\n }", "public boolean verdict(int n[]) {\n\treturn true;\n }", "@Override\r\n\t\tpublic boolean accept(Path path) {\n\t\t\tboolean flag = path.toString().matches(regex);\r\n\t\t\treturn !flag;\r\n\t\t}", "public boolean isAccepted2(String word) {\r\n\t return word.endsWith(\"baa\");\r\n \r\n }", "private boolean verifySequence(String seq) {\n for (int i = 0; i < seq.length(); i++) {\n if (seq.charAt(i) != 'A' && seq.charAt(i) != 'T'\n && seq.charAt(i) != 'C' && seq.charAt(i) != 'G') {\n return false;\n }\n }\n return true;\n }", "private static boolean isFourCombinedVerbs(AnalyzedTokenReadings[] tokens, int first, int last) {\n return tokens[first].hasPartialPosTag(\"KJ2\") && tokens[first + 1].hasPosTagStartingWith(\"PA2\")\n && tokens[first + 2].matchesPosTagRegex(\"VER:(.*INF|PA[12]).*\")\n && tokens[last].matchesPosTagRegex(\"VER:(MOD|AUX).*\");\n }", "boolean hasPatStatusCode();", "boolean hasPatStatusCode();", "public static boolean shouldnotVisit(String url) {\n\t\tString href = url.toLowerCase();\n\n\t\treturn BINARY_FILES_EXTENSIONS.matcher(href).matches();\n\t}", "public boolean hasSpecial(){\n return (alg.containSpecial(input.getText().toString()));\n }", "boolean hasBatt();", "boolean matches(final HTTPContext http) {\n // check if number of segments match\n if(segments.length != http.depth()) return false;\n\n // check single segments\n for(int s = 0; s < segments.length; s++) {\n final String seg = segments[s];\n if(!seg.equals(http.segment(s)) && !seg.startsWith(\"{\")) return false;\n }\n return true;\n }", "public boolean isAnimate(Sentence sent) throws IOException {\n File directory = new File(pathToVerbnet);\n final String[] files = directory.list();\n\n List<String> verbs = new ArrayList<String>();\n // get the verbs lemmas\n for (Token token : selectCovered(Token.class, sent)) {\n if (token.getPosValue().startsWith(\"VB\")) {\n verbs.add(token.getLemmaValue());\n }\n }\n\n // look the verb up in verbnet\n for (String verb : verbs) {\n boolean found = false;\n for (final String filename : files) {\n if (filename.contains(verb)) {\n verb = filename.replace(\".xml\", \"\");\n found = true;\n }\n }\n\n if (found) {\n URL url = new URL(\"file\", null, pathToVerbnet);\n VerbIndex index = new VerbIndex(url);\n index.open();\n IVerbClass v = index.getRootVerb(verb);\n if (v != null) {\n for (IFrame f : v.getFrames()) {\n for (IThematicRole t : f.getVerbClass().getThematicRoles()) {\n if (t.getType().getID().equalsIgnoreCase(\"agent\"))\n for (Entry<SemRestrType, Boolean> entry : t.getSelRestrictions()\n .getTypeRestrictions().entrySet()) {\n if (entry.getKey().getID().equalsIgnoreCase(\"animate\"))\n return true;\n }\n }\n }\n }\n index.close();\n }\n }\n return false;\n }", "boolean hasIsRevanche();", "private boolean lookupSentiments(Sentence sent) {\n if (selectCovered(NGram.class, sent).size() > 0)\n return true;\n return false;\n }", "boolean hasIsPartOf();", "public boolean checkForAnagrams(String inp) {\n return (new StringBuffer(inp).reverse().toString().equals(inp));\n }", "public static boolean checkValidAy(String ay) {\n Matcher matcher = MODULE_SEM_PATTERN.matcher(ay);\n if (!matcher.find()) {\n return false;\n }\n assert ay.length() == 6;\n int start = Integer.parseInt(ay.substring(0, 2));\n int end = Integer.parseInt(ay.substring(2, 4));\n return end - start == 1;\n }", "@Override\n public boolean verify(String inputString, String vocabularyString) {\n List<String> inputStringList = getWords(inputString);\n List<String> vocabularyStringList = getWords(vocabularyString);\n if (inputStringList.size() == 0)return false;\n for (String word: inputStringList){\n if (!vocabularyStringList.contains(word))return false;\n }\n return true;\n }", "private boolean haveMBPattern()\n {\n return ((mbType & PATTERN) !=0 );\n }", "protected boolean isApplicable(SPRequest req) {\n\n Log.debug(\"isApplicable ? \" + req.getPath() + \" vs \" + getRoute());\n\n if (!req.getMethod().equals(getHttpMethod()))\n return false;\n\n String[] uri = req.getSplitUri();\n String[] tok = splitPath;\n if (uri.length != tok.length && splatIndex == -1)\n return false;\n\n if (uri.length <= splatIndex)\n return false;\n\n for (int i = 0; i < tok.length; i++) {\n if (tok[i].charAt(0) != ':' && tok[i].charAt(0) != '*' && !tok[i].equals(uri[i]))\n return false;\n }\n\n return true;\n }", "public static boolean isVog(String s){\n boolean flag = true;\n int i = 0;\n while(flag && i < s.length()){\n flag = (s.charAt(i) == 'a' || s.charAt(i) == 'A' ||\n s.charAt(i) == 'e' || s.charAt(i) == 'E' ||\n s.charAt(i) == 'i' || s.charAt(i) == 'I' ||\n s.charAt(i) == 'o' || s.charAt(i) == 'O' ||\n s.charAt(i) == 'u' || s.charAt(i) == 'U' );\n i++;\n }\n return flag;\n }", "public void verifyText(VerifyEvent e) {\n\t\t\tboolean ret = true;\r\n\t\t\tfor(int i=0; i < e.text.length(); i ++){\r\n\t\t\t\tret = \"0123456789.\".indexOf(e.text.charAt(i)) >= 0;\t\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\te.doit = ret;\r\n\t\t}", "@Override\r\n public boolean shouldVisit(WebURL url) {\r\n String href = url.getURL().toLowerCase();\r\n return !FILTERS.matcher(href).matches() && href.startsWith(\"http://fksis.bsuir.by/\");\r\n// \"http://www.ics.uci.edu/\");\r\n }", "public boolean matchAnyString() { return false; }", "private boolean isObscene(String strVal) {\n\t\treturn this.obscenties.contains(strVal);\n\t}", "public boolean canRecover(String input) {\n if(encode(input) != -1) return true;\n for(int i=0; i<input.length(); i++) {\n if(Character.isLowerCase(input.charAt(i))) {\n String next = input.substring(0, i) + Character.toUpperCase(input.charAt(i)) + input.substring(i+1);\n if(canRecover(next)) return true;\n }\n }\n return false;\n }", "public boolean isAltACTGN() {\n for (Alt a : alts) {\n if (a.isSeq()) {\n if (!a.getSeq().toString().matches(\"[ACTGN]*\")) {\n return false;\n }\n }\n }\n return true;\n }", "@Override\n\t\tprotected boolean handleIrregulars(String s) {\n\t\t\treturn false;\n\t\t}", "private static boolean containsIllegals(String toExamine) {\n Pattern pattern = Pattern.compile(\"[+]\");\n Matcher matcher = pattern.matcher(toExamine);\n return matcher.find();\n }", "private static boolean isInfinitivZu(AnalyzedTokenReadings[] tokens, int last) {\n return tokens[last - 1 ].getToken().equals(\"zu\")&& tokens[last].matchesPosTagRegex(\"VER:.*INF.*\");\n }", "private static boolean isArticleWithoutSub(String gender, AnalyzedTokenReadings[] tokens, int n) {\n if(gender.isEmpty()) {\n return false;\n }\n return tokens[n].hasPosTagStartingWith(\"VER:\") && tokens[n - 1].matchesPosTagRegex(\"(ADJ|PRO:POS):.*\" + gender + \".*\");\n }", "private boolean Verific() {\n\r\n\treturn true;\r\n\t}", "private boolean shouldForwardToTermsAcceptanceIntent(Progress progress) {\n return progress.name.equals(Progress.termsAcceptance)\n || progress.name.equals(Progress.termsRefused);\n }", "@Override\r\n\t\tpublic boolean accept(Path path) {\n\t\t\tboolean flag = path.toString().matches(regex);\r\n\t\t\treturn flag;\r\n\t\t}", "@Override\n\t\t\t\tpublic boolean accept(Match a) {\n\t\t\t\t\treturn false;\n\t\t\t\t}", "boolean checkVerification();", "private boolean isVcheck (JPLine plinesucc)\n\t{\n\t\tJPLine pline = plines.lower(plinesucc);\n\t\tif (pline == null) return false;\n\t\tif (pline.len != 2) return false;\n\t\tJPLine pred = plines.lower(pline);\n\t\tif (pred == null) return false;\n\t\treturn (pred.flag0 & 0x64) == 0x24; // branch instruction that is itself covered and not start of source code statement\n\t}", "boolean isPartOf(String genomeName);", "public boolean isProtocolValid(String prot) {\n for (int i = 0; i < protocols.length; i++) {\n if (protocols[i].equals(prot)) {\n return true;\n }\n }\n // No match has been found\n return false;\n }", "public boolean containsAMneumonics() {\n\t\tswitch(this) {\n\t\t\n\t\tcase BR -> \t\t{return true;}\n\t\tcase BRLE -> \t{return true;}\n\t\tcase BRLT -> \t{return true;}\n\t\tcase BREQ -> \t{return true;}\n\t\tcase BRNE -> \t{return true;}\n\t\tcase BRGE -> \t{return true;}\n\t\tcase BRGT -> \t{return true;}\n\t\tcase BRV -> \t{return true;}\n\t\tcase BRC -> \t{return true;}\n\t\tcase CALL -> \t{return true;}\n\t\t\n\t\tdefault -> {return false;}\n\t\n\t\t}\n\t\t\n\t}", "private boolean validate(String s)\r\n\t{\r\n\t\tint i=0;\r\n\t\tchar[] s1=s.toLowerCase().toCharArray();\r\n\t\twhile(i<s1.length)\r\n\t\t{\r\n\t\t\tif(s1[i]=='*' || s1[i]=='?')\r\n\t\t\t\tbreak;\r\n\t\t\tif(s1[i]<'a' || s1[i]>'z') return false;\r\n\t\t\ti++;\r\n\t\t}\r\n\t\treturn true;\r\n\t}", "private static boolean isSpecialInf(AnalyzedTokenReadings[] tokens, int first, int second, int start) {\n if(!tokens[first].hasPosTagStartingWith(\"VER:INF\")) {\n return false;\n }\n for(int i = first - 1; i > start; i--) {\n if(tokens[i].hasPosTagStartingWith(\"ART\")) {\n i = skipSub(tokens, i, second);\n return i > 0;\n }\n }\n return false;\n }", "public boolean acceptable(String s){\n\t\tCharacter first = s.charAt(0);\n\t\tCharacter last = s.charAt(s.length() - 1);\n\t\t\n\t\treturn (super.acceptable(s) && !Character.isDigit(first) && Character.isDigit(last));\n\t}", "public static boolean isCompound(String a, String b) {\n\t\t\n\t\tboolean test = false;\n\n\t\tString[] acompounds = a.split(\"(?<=.)(?=\\\\p{Lu})\");\n\t\tString[] bcompounds = b.split(\"(?<=.)(?=\\\\p{Lu})\");\n\t\t\n\t\tSystem.out.println(\"length-1: \" + bcompounds[bcompounds.length-1]);\n\t\tSystem.out.println(\"length-2: \" + bcompounds[bcompounds.length-2]);\n\t\tSystem.out.println(\"length-3: \" + bcompounds[bcompounds.length-3]);\n\n\t\tif (acompounds.length > 2 && bcompounds.length > 2) {\n\t\t\t\n\t\t\tSystem.err.println(\"true\");\n\n\t\t\t//if (RadioNavigationAid.equals(Aid) || (RadioNavigationAid.equals(X|X|Aid)\n\t\t\tif (b.equals(acompounds[acompounds.length-1]) || b.equals(acompounds[acompounds.length-1]+acompounds[acompounds.length-2] + acompounds[acompounds.length-3])) {\n\n\t\t\t\ttest = true;\t\t\t\t\n\t\t\t} \n\t\t\t\n\t\t\t//if (NavigationAid.equals(Aid) || (NavigationAid.equals(Radio|Navigation|Aid)\n\t\t\tSystem.out.println(\"Trying: \" + a + \" = \" + bcompounds[bcompounds.length-1]);\n\t\t\tif (a.equals(bcompounds[bcompounds.length-1]) || a.equals(bcompounds[bcompounds.length-1]+bcompounds[acompounds.length-2] + bcompounds[bcompounds.length-3])) {\n\t\t\t\t\n\t\t\t\ttest = true;\n\t\t\t}\n\t\t\t\n\t\t\t//if (NavigationAid.equals(NavigationAid) || (NavigationAid.equals(Radio|Navigation|Aid)\n\t\t\tSystem.out.println(\"Trying: \" + a + \" = \" + bcompounds[bcompounds.length-1]);\n\t\t\tif (a.equals(bcompounds[bcompounds.length-1]) || a.equals(bcompounds[bcompounds.length-3]+bcompounds[acompounds.length-2] + bcompounds[bcompounds.length-1])) {\n\t\t\t\t\n\t\t\t\ttest = true;\n\t\t\t}\n\t\t\t\n\t\t\t\n\t\t}\n\t\t else if (acompounds.length > 1) {\n\n\t\t\tif (b.equals(acompounds[acompounds.length-1]) || b.equals(acompounds[acompounds.length-1]+acompounds[acompounds.length-2])) {\n\n\t\t\t\ttest = true;\n\t\t\t}\n\t\t}\n\t\treturn test;\n\n\t}", "public boolean isAccepted1(String word) {\r\n\t return (tranzition_extended(word)==3) ;\r\n\r\n }", "public boolean isWord2ignore(String word);", "boolean hasResidues();", "public abstract boolean canMatchEmpty();", "private static boolean isUnReserved(int b) {\r\n\t\treturn inRange(b, 65, 90)\r\n\t\t\t\t|| inRange(b, 97, 122)\r\n\t\t\t\t|| inRange(b, 48, 57)\r\n\t\t\t\t|| inList(b, 45, 46, 95, 126);\r\n\t}", "public static boolean pat() {\n\t\treturn false;\n\t}", "private boolean tienePermiso(String urlStr){\n return true;\n }", "boolean isAccepting();", "protected abstract boolean matchesExclusion(String paramString, int paramInt);", "boolean isReserved();", "String[] checkIfLegalCommand(String strToChck);", "public boolean containsVoteFrom(String token);", "@Test\n public void testMatchValid() {\n Matcher mtch = filter.getMatcher(FULL_URI);\n assertTrue(\"no match\", filter.isResourceAccess(mtch));\n }", "private static int getCommaBehind(AnalyzedTokenReadings[] tokens, List<Integer> verbs, int start, int end) {\n if(verbs.size() == 1) {\n if(isSeparator(tokens[verbs.get(0) + 1].getToken())) {\n return -1;\n }\n return verbs.get(0);\n } else if(verbs.size() == 2) {\n if(isSpecialPair(tokens, verbs.get(0), verbs.get(1))) {\n if(isSeparatorOrInf(tokens, verbs.get(1) + 1)) {\n return -1;\n }\n return verbs.get(1);\n } else if(verbs.get(0) + 1 == verbs.get(1)) {\n if(isTwoCombinedVerbs(tokens[verbs.get(0)], tokens[verbs.get(1)])) {\n if(isSeparatorOrInf(tokens, verbs.get(1) + 1) || isKonAfterVerb(tokens, verbs.get(1), end)) {\n return -1;\n }\n return verbs.get(1);\n }\n } else if(verbs.get(0) + 2 == verbs.get(1)) {\n if(isThreeCombinedVerbs(tokens, verbs.get(0), verbs.get(1))) {\n if(isSeparatorOrInf(tokens, verbs.get(1) + 1)) {\n return -1;\n }\n return verbs.get(1);\n }\n }\n if(isPar(tokens[verbs.get(0)]) || isPerfect(tokens, verbs.get(0), verbs.get(1))\n || isInfinitivZu(tokens, verbs.get(1)) || isSpecialInf(tokens, verbs.get(0), verbs.get(1), start)) {\n if(isSeparatorOrInf(tokens, verbs.get(1) + 1)) {\n return -1;\n }\n return verbs.get(1);\n }\n } else if(verbs.size() == 3) {\n if(isTwoPlusCombinedVerbs(tokens, verbs.get(0), verbs.get(2))) {\n if(isSeparatorOrInf(tokens, verbs.get(2) + 1)) {\n return -1;\n }\n return verbs.get(2);\n } else if(verbs.get(0) + 2 == verbs.get(2)) {\n if(verbs.get(0) + 1 == verbs.get(1) && isThreeCombinedVerbs(tokens, verbs.get(0), verbs.get(2))) {\n if(isSeparatorOrInf(tokens, verbs.get(2) + 1)) {\n return -1;\n }\n return verbs.get(2);\n }\n } else if(verbs.get(0) + 3 == verbs.get(2) && isFourCombinedVerbs(tokens, verbs.get(0), verbs.get(2))) {\n if(isSeparatorOrInf(tokens, verbs.get(2) + 1)) {\n return -1;\n }\n return verbs.get(2);\n } else if(tokens[verbs.get(2)].hasPosTagStartingWith(\"VER:MOD:\")\n && isSpecialPair(tokens, verbs.get(0), verbs.get(1))) {\n if(isSeparatorOrInf(tokens, verbs.get(2) + 1)) {\n return -1;\n }\n return verbs.get(2);\n }\n if(isPerfect(tokens, verbs.get(0), verbs.get(1), verbs.get(2))) {\n if(isSeparatorOrInf(tokens, verbs.get(2) + 1)) {\n return -1;\n }\n return verbs.get(1);\n }\n }\n return verbs.get(0);\n }", "public boolean isLegalReplacement(byte[] repl) {\n return true;\n }", "@Test\n public void testRemainingResourceStringValid() {\n Matcher mtch = filter.getMatcher(FULL_URI);\n\n filter.isResourceAccess(mtch);\n\n assertEquals(\"resource string differs\", REMAINING_RES_STRING, filter.getRootResourceString(mtch));\n }", "@In Boolean caseSensitive();", "@Test\r\n public void testSubtractionAsReversion() {\r\n Application.loadQuestions();\r\n assertTrue(Application.allQuestions.contains(\"21 - 7 = ?\") || Application.allQuestions.contains(\"21 - 14 = ?\"));\r\n }", "private boolean nocurlies() {\r\n return OPT(GO() && NOT(GO() && CHAR('}')) && literal() && nocurlies());\r\n }", "private static void verifEnt() {\r\n\t\tif (tCour != ENT)\r\n\t\t\tUtilLex.messErr(\"expression entiere attendue\");\r\n\t}", "boolean hasSig();", "public static void main(String[] args) {\n\t\tString s = \"aab\";//\"aab\";//\"aaaaaa\";//\"mississpp\";//\"aaabbbccc\";\r\n\t\tString p = \"c*a*b\";//\"c*a*b\";//\"a*\";//\"mis*is*p*.\";//\"a*bb.cc*\"\r\n\r\n\t\tSystem.out.println(\"Match ? \" + isMatchLC(s, p));\r\n\r\n\t}", "private boolean containsBlacklistWord(String[] text, int startIndex, int endIndex) {\n for (int i = startIndex; i <= endIndex; i++) {\n if(blacklist.contains(text[i]))\n return true;\n }\n \n return false;\n }", "boolean hasReplace();", "public abstract boolean accepts(String string);", "boolean hasPatStatusCodeName();", "boolean hasPatStatusCodeName();", "boolean hasSegments();", "private boolean isSkipMatch(String requestUri) throws Exception {\n\t\t\n\t\tboolean isMatch = false;\n\t\tfor (Pattern pattern : skipPattern) {\n\t\t\tif (pattern.matcher(requestUri).find()) {\n\t\t\t\tisMatch = true;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t\treturn isMatch;\n\t}", "public boolean matches(String uri);", "private boolean normsAppliedToAgentContext(EnvironmentAgentContext agContext) {\n\t\tNormsApplicableToAgentContext normsApplicable = \n\t\t\t\tthis.normReasoner.getNormsApplicable(agContext.getDescription());\n\n\t\tfor(Norm n : normsApplicable.getApplicableNorms()) {\n\t\t\tNetworkNodeState nState = this.normativeNetwork.getState(n);\n\t\t\tboolean isRepresented = this.normativeNetwork.isRepresented(n);\n\t\t\tboolean isHibernated = nState == NetworkNodeState.Candidate;\n\t\t\tboolean isSubstituted = nState == NetworkNodeState.Substituted;\n\t\t\t\n\t\t\tif(isRepresented || isHibernated || isSubstituted) {\n\t\t\t\treturn true;\n\t\t\t}\n\t\t}\n\t\treturn false;\n\t}", "boolean verifySecretKey(StringBuilder secretKey) {\n return secretKey.toString().matches(\"[a-zA-Z][a-zA-Z]-[^a-zA-Z0-9][a-zA-Z][a-zA-Z]-[2-5][^a-zA-Z0-9]\");\n }", "public static boolean canLearn(Thing b,String s) {\r\n \t\tString order=getOrder(s);\r\n \t\treturn b.getStat(order)>0;\r\n \t\t//return RPG.test(b.getStat(RPG.ST_LEVEL), levels[type]);\r\n \t}", "boolean hasVName();", "private boolean checkInCashe(String s) {\n return true;\n }", "public boolean canCompete(String t){\n\t\tif(talents != null)\n\t\t{\n\t\t\tint i;\n\t\t\tfor(i = 0; i < talents.length; i++)\n\t\t\t\tif (talents[i] == t)\n\t\t\t\t\treturn true;\n\t\t}\n\t\t\n\t\treturn false;\n }", "public boolean mo131902a(Regex fVar) {\n return super.contains(fVar);\n }", "private static boolean shouldInclude(String text) {\n if (text.startsWith(\"RT @\")) return false;\n else if (text.contains(\"https://\") || text.contains(\"http://\")) return false;\n else if (endsWithNumber.matcher(text).find()) return false;\n\n return true;\n }", "boolean isValid(String word);", "public boolean isPregnant();", "public abstract boolean verifyInput();", "private static boolean isPerfect(AnalyzedTokenReadings[] tokens, int first, int second) {\n return tokens[first].hasPosTagStartingWith(\"VER:AUX:\") && tokens[second].matchesPosTagRegex(\"VER:.*(INF|PA2).*\");\n }" ]
[ "0.67406034", "0.66744953", "0.6126495", "0.5996264", "0.5805029", "0.5653174", "0.5645945", "0.5392913", "0.5390349", "0.5363427", "0.5357918", "0.53250456", "0.5285843", "0.5285653", "0.52438164", "0.52315056", "0.5219511", "0.5206021", "0.5135471", "0.5073785", "0.50496835", "0.50496835", "0.50465184", "0.5032274", "0.502492", "0.5021855", "0.5001636", "0.50012714", "0.49935365", "0.49808782", "0.4973383", "0.4944272", "0.49425364", "0.4928907", "0.4908887", "0.4906413", "0.49008244", "0.48994166", "0.48936862", "0.4889164", "0.48855817", "0.48849824", "0.48806626", "0.4876014", "0.48624587", "0.4855789", "0.48359242", "0.48282766", "0.4820916", "0.48114228", "0.48111194", "0.48097265", "0.47993946", "0.4790746", "0.47879452", "0.47871944", "0.47853994", "0.4783352", "0.47827956", "0.47826177", "0.4771714", "0.47648138", "0.47611654", "0.475808", "0.47574002", "0.47564146", "0.47541416", "0.47506154", "0.47474483", "0.4742194", "0.4739126", "0.4736858", "0.47272325", "0.47258654", "0.47235322", "0.47219086", "0.4720078", "0.47194", "0.47175518", "0.4715641", "0.4712583", "0.47125545", "0.47099972", "0.470732", "0.47037", "0.47037", "0.47006217", "0.4697071", "0.46967164", "0.4689042", "0.46884906", "0.4685704", "0.46836576", "0.46811533", "0.46805245", "0.46753648", "0.4671272", "0.46695778", "0.46630585", "0.4662842", "0.4658563" ]
0.0
-1
TODO Autogenerated method stub
public static void main(String[] args) { Scanner scan = new Scanner(System.in); int n = scan.nextInt(); int m = scan.nextInt(); int[] card = new int[n]; for(int i=0; i<card.length; i++) { card[i] = scan.nextInt(); } int result = 0; int temp = 0; for(int i=0; i<n-2; i++) for(int j=i+1; j<n-1; j++) for(int k=j+1; k<n; k++) { result = card[i] + card[j] + card[k]; if(result <= m) { if(temp <= result) temp = result; } } System.out.println(temp); scan.close(); }
{ "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 getExras() {\n\n\t}", "@Override\r\n\tpublic void anularFact() {\n\t\t\r\n\t}", "@Override\n\tpublic void entrenar() {\n\t\t\n\t}", "@Override\n\tpublic void nadar() {\n\t\t\n\t}", "@Override\r\n\tpublic void tires() {\n\t\t\r\n\t}", "@Override\r\n\t\t\tpublic void ayuda() {\n\r\n\t\t\t}", "@Override\n\tprotected void interr() {\n\t}", "@Override\n\tpublic void emprestimo() {\n\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\tpublic void grabar() {\n\t\t\n\t}", "@Override\n\tpublic void gravarBd() {\n\t\t\n\t}", "@Override\r\n\tpublic void rozmnozovat() {\n\t}", "@Override\r\n\tpublic void dormir() {\n\t\t\r\n\t}", "@Override\n protected void getExras() {\n }", "@Override\r\n\tpublic void publierEnchere() {\n\t\t\r\n\t}", "@Override\n\tpublic void nefesAl() {\n\n\t}", "@Override\n\tpublic void ligar() {\n\t\t\n\t}", "@Override\n public void func_104112_b() {\n \n }", "@Override\n\tprotected void initdata() {\n\n\t}", "@Override\n\tpublic void nghe() {\n\n\t}", "@Override\n public void function()\n {\n }", "@Override\n public void function()\n {\n }", "public final void mo51373a() {\n }", "@Override\r\n\tpublic void stehReagieren() {\r\n\t\t//\r\n\t}", "@Override\n public void inizializza() {\n\n super.inizializza();\n }", "@Override\n\tprotected void initData() {\n\t\t\n\t}", "@Override\r\n\t\tpublic void init() {\n\t\t\t\r\n\t\t}", "@Override\n\tpublic void sacrifier() {\n\t\t\n\t}", "@Override\r\n\tprotected void InitData() {\n\t\t\r\n\t}", "public void designBasement() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void initialize() {\r\n\t\t\r\n\t\t\r\n\t}", "public void gored() {\n\t\t\n\t}", "@Override\r\n\tprotected void initData() {\n\r\n\t}", "@Override\n\tpublic void einkaufen() {\n\t}", "@Override\n protected void initialize() {\n\n \n }", "public void mo38117a() {\n }", "@Override\n\tprotected void getData() {\n\t\t\n\t}", "Constructor() {\r\n\t\t \r\n\t }", "@Override\r\n\tpublic void dibujar() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void dibujar() {\n\t\t\r\n\t}", "@Override\n\tpublic void one() {\n\t\t\n\t}", "@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}", "private stendhal() {\n\t}", "@Override\n\tprotected void update() {\n\t\t\n\t}", "@Override\n\t\t\tpublic void ic() {\n\t\t\t\t\n\t\t\t}", "@Override\n\tprotected void initData() {\n\n\t}", "@Override\n\tprotected void initData() {\n\n\t}", "@Override\n\tpublic void init() {\n\t\t\n\t}", "@Override\n\tpublic void init() {\n\t\t\n\t}", "@Override\n\tpublic void init() {\n\t\t\n\t}", "@Override\n\tpublic void init() {\n\t\t\n\t}", "@Override\n\tpublic void init() {\n\t\t\n\t}", "@Override\n public void init() {\n\n }", "@Override\n\tprotected void initialize() {\n\t\t\n\t}", "@Override\n\tprotected void initialize() {\n\t\t\n\t}", "@Override\r\n\tpublic void init() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void init() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void init() {\n\t\t\r\n\t}", "@Override\n\tpublic void debite() {\n\t\t\n\t}", "@Override\r\n\tpublic void init() {\n\r\n\t}", "@Override\r\n\tpublic void init() {\n\r\n\t}", "@Override\r\n\tpublic void init() {\n\r\n\t}", "public contrustor(){\r\n\t}", "@Override\n\tprotected void initialize() {\n\n\t}", "@Override\r\n\tpublic void dispase() {\n\r\n\t}", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "@Override\n\tpublic void dtd() {\n\t\t\n\t}", "@Override\n\tprotected void logic() {\n\n\t}", "@Override\n\tprotected void lazyLoad() {\n\t\t\n\t}", "public void mo4359a() {\n }", "@Override\r\n\tprotected void initialize() {\n\r\n\t}", "@Override\n public void memoria() {\n \n }", "@Override\n\t\tpublic void method() {\n\t\t\t\n\t\t}", "private RepositorioAtendimentoPublicoHBM() {\r\t}", "@Override\n protected void initialize() \n {\n \n }", "@Override\r\n\tpublic void getProposition() {\n\r\n\t}", "@Override\n\tpublic void particular1() {\n\t\t\n\t}", "@Override\n\tpublic void init() {\n\n\t}", "@Override\n\tpublic void init() {\n\n\t}", "@Override\n\tpublic void init() {\n\n\t}", "@Override\n protected void prot() {\n }", "@Override\r\n\tpublic void init()\r\n\t{\n\t}", "@Override\n\tprotected void initValue()\n\t{\n\n\t}", "public void mo55254a() {\n }" ]
[ "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.6080161", "0.6077022", "0.6041561", "0.6024072", "0.6020252", "0.59984857", "0.59672105", "0.59672105", "0.5965777", "0.59485507", "0.5940904", "0.59239364", "0.5910017", "0.5902906", "0.58946234", "0.5886006", "0.58839184", "0.58691067", "0.5857751", "0.58503544", "0.5847024", "0.58239377", "0.5810564", "0.5810089", "0.5806823", "0.5806823", "0.5800025", "0.5792378", "0.5792378", "0.5792378", "0.5792378", "0.5792378", "0.5792378", "0.5790187", "0.5789414", "0.5787092", "0.57844025", "0.57844025", "0.5774479", "0.5774479", "0.5774479", "0.5774479", "0.5774479", "0.5761362", "0.57596046", "0.57596046", "0.575025", "0.575025", "0.575025", "0.5747959", "0.57337177", "0.57337177", "0.57337177", "0.5721452", "0.5715831", "0.57142824", "0.57140535", "0.57140535", "0.57140535", "0.57140535", "0.57140535", "0.57140535", "0.57140535", "0.5711723", "0.57041645", "0.56991017", "0.5696783", "0.56881124", "0.56774884", "0.56734604", "0.56728", "0.56696945", "0.5661323", "0.5657007", "0.5655942", "0.5655942", "0.5655942", "0.56549734", "0.5654792", "0.5652974", "0.5650185" ]
0.0
-1
1 + (int)(Math.random() ((13 10) + 1))
public void creationPlateau() { for (int i = 0; i < 10; i++) { int X = rand.nextInt(14); int Y = rand.nextInt(14); if (plateau[X][Y] == null && espacementMonstre(X,Y,plateau)) { int monstreAleatoire = 1 + (int)(Math.random() * ((3 - 1) + 1)); switch (monstreAleatoire) { case 1: Personnage monstreD = new Dragonnet(X,Y); plateau[X][Y] = monstreD; this.monstre.add(monstreD); System.out.println("Dragonnet ajouté en position : "+X+" "+Y); break; case 2: Personnage monstreL = new Loup(X,Y); plateau[X][Y] = monstreL; this.monstre.add(monstreL); System.out.println("Loup ajouté en position : "+X+" "+Y); break; case 3: Personnage monstreO = new Orque(X,Y); plateau[X][Y] = monstreO; this.monstre.add(monstreO); System.out.println("Orque ajouté en position : "+X+" "+Y); break; } } else { i --; } } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public int generateRandom() {\n\t\tint random = (int)(Math.random()*((6-1)+1))+1;\n\t\treturn random;\n\t}", "public static int randomNext() { return 0; }", "private int randomNum() {\r\n\t return((int)(Math.random() * 100));\r\n\t }", "private int generateRandomNumber() {\n\t\treturn new SplittableRandom().nextInt(0, 3);\n\t}", "public int getRandomsNumber(){\n Random random = new Random();\n int number = random.nextInt(12) + 1;\n return number;\n }", "private int randomHelper() {\n\t\tRandom rand = new Random();\n\t\tint randomNum = rand.nextInt((10000 - 1) + 1) + 1;\n\t\treturn randomNum;\n\t}", "public int randomNum()\r\n {\r\n Random rand = new Random();\r\n int n = rand.nextInt(52)+1;\r\n return n;\r\n }", "int random(int m)\n {\n return (int) (1 + Math.random()%m);\n }", "private int rand() {\n return (int)(Math.random()*(RAND_MAX + 1));\n }", "private void setRand(){\n rand = generator.nextInt(9) + 1;\n }", "int randomPoint() { return 1 + (int)Math.round((Math.random()*20) % (size - 2)); }", "private int generateRandomNumber() {\n\t\treturn (int) Math.floor(Math.random() * Constants.RANDOM_NUMBER_GENERATOR_LIMIT);\n\t}", "public static int generateRandomNumber()\n\t{\n\t\tRandom r = new Random();\n\t\treturn r.nextInt();\n\t}", "public int drawpseudocard(){\n Random random = new Random();\n return random.nextInt(9)+1;\n }", "public int randomNum() {\n\t\treturn 1 + (int) (Math.random() * 3); // randomNum = minimum + (int)(Math.random() * maximum);\n\t}", "public static int getRandomAmount(){\n return rand.nextInt(1000);\n }", "public static int getRandomNumber(){\n int random = 0; // set variable to 0\r\n random = (int)(Math.random()*10) + 1; //generate random number between 1 and 10\r\n return random; //return random number\r\n }", "private int aleatorizarNaipe() {\n\t\tint aux;\n\t\taux = r.getIntRand(4);\n\t\treturn aux;\n\t}", "public static int randNum() {\r\n\t\tint rand = (int)(Math.random()*((100)+1)); // Num generated between [0, 100]\r\n\t\treturn rand;\r\n\t}", "private static int get() { \r\n Random r = new Random();\r\n return (r.nextInt(9));\r\n }", "public static int generateDigit() {\n\t\t\n\t\treturn (int)(Math.random() * 10);\n\t}", "public int getRandomPositiveInt(){\r\n long gen = (a*seed+c)%m;\r\n seed = gen;\r\n return (int)gen;\r\n }", "public int NewMonster(){\n int r = (int) (Math.random() * (9 - 2 + 1) + 2);\n return r;\n }", "private double getRandomNumber(){\n double rand = Math.random();//produce a number between 0 and 1\n rand = rand - 0.5;\n return rand;\n }", "int RandomGenerator0To29 (){\n\t\t int randomInt2 = 0;\n\t\t Random randomGenerator2 = new Random();\n\t\t for (int idx2 = 1; idx2 <= 10; ++idx2) {\n\t\t\t randomInt2 = randomGenerator2.nextInt(30);\n\t\t }\n\t\t return randomInt2;\n\t }", "@Override\n public int orinar() {\n\n return (int) (Math.random() * 400) + 400;\n }", "@Override\n public Integer pee() {\n return (int) (random() * 8);\n }", "public static int getRandom() \n\t{\n\t\treturn rGenerator.nextInt();\n\t}", "private int randomValue() {\r\n\t\tRandom rand = new Random();\r\n\t\tint val = rand.nextInt(10);\r\n\t\tif(val == 9)\r\n\t\t\treturn 4;\r\n\t\telse\r\n\t\t\treturn 2;\r\n\t}", "public int rollResult(){\r\n return rand.nextInt(6) + 1;\r\n }", "private int aleatorizarNumero() {\n\t\tint aux;\n\t\taux = r.getIntRand(13) + 1;\n\t\treturn aux;\n\t}", "int RandomGeneratorZeroToThree (){\n\t\t int randomInt = 0;\n\t\t Random randomGenerator = new Random();\n\t\t for (int idx = 1; idx <= 10; ++idx) {\n\t\t\t randomInt = randomGenerator.nextInt(4);\n\n\t\t }\n\t\t return randomInt;\n\t }", "public static int getRandomNum() {\n\t\tRandom rand = new Random();\n\t\tint num = rand.nextInt(3)+1;\n\t\treturn num;\n\t}", "public int compete() {\r\n\t\tint max = 20;\r\n\t\tint min = 10;\r\n\t\tRandom Rand = new Random();\r\n\t\tint ranNum = Rand.nextInt(max - min) + min;\r\n\t\treturn ranNum;\r\n\t}", "private int _randomCode () {\n Random random = new Random();\n code = random.nextInt(999999);\n return code;\n }", "private void random() {\n\n\t}", "private static int getSecretNum(int arg1) {\n Random rand = new Random();\n return rand.nextInt(UPPERBOUND)+1; //make range 1-100\n }", "private double getRandom() {\n return 2*Math.random() - 1;\n }", "public static int randomNumber(){\r\n int max = 10;\r\n int min = 0;\r\n int range = max-min+1;\r\n \r\n int randNum = (int)(Math.random()*range) + min;\r\n \r\n return randNum;\r\n }", "private int evaluate() {\n return (int) (Math.random() * 8);\n }", "private static int getRandomNumberOfRooms(){\r\n return r.nextInt(50)+1;\r\n }", "private static int addRandomScore() {\n Random ran = new Random();\n return ran.nextInt(201) + 400;\n }", "public int monsterAttack(){\n Random ran = new Random();\n return ran.nextInt(4);\n }", "public static int randInt() {\n Random rand = new Random();\n\n // nextInt is normally exclusive of the top value,\n // so add 1 to make it inclusive\n int randomNum = rand.nextInt((20 - 10) + 1) + 10;\n\n return randomNum;\n }", "private Random rand()\n\t{\n\t\treturn new Random();\n\t}", "public int randomDP() {\n\t\treturn(getRandomInteger(10,250));\n\t}", "private int choose(){\n\t\tdouble temp = 10 * Math.random();\n\t\tint i = (int)temp;\n\t\treturn i;\n\t}", "public static int randomNumberAlg(){\r\n int max = 10;\r\n int min = 1;\r\n int range = max-min+1;\r\n \r\n int randNum = (int)(Math.random()*range) + min;\r\n \r\n return randNum;\r\n }", "public static String generateRandomInteger() {\n SecureRandom random = new SecureRandom();\n int aStart = 1;\n long aEnd = 999999999;\n long range = aEnd - (long) aStart + 1;\n long fraction = (long) (range * random.nextDouble());\n long randomNumber = fraction + (long) aStart;\n return String.valueOf(randomNumber);\n }", "void setRandomNo() {\n\t\tno = 10000000 + (int) (Math.random() * 90000000);\n\t}", "public void roll(){\n currentValue = rand.nextInt(6)+1;\n }", "int randInt(int n) {\r\n return _randomSource.nextInt(n);\r\n }", "public int eDmg(){\r\n eDmg = rand.nextInt(13);\r\n return eDmg;\r\n }", "private static int newNumber()\n\t{\n\t\tdouble initial = Math.random();\n\t\tdouble rangeAdjusted = initial * (10000 - 1001) + 1000;\n\t\tint rounded = (int)Math.round(rangeAdjusted);\n\t\treturn rounded;\n\t}", "private int randomWeight()\n {\n return dice.nextInt(1000000);\n }", "public double getRandom() {\n return 20*Math.random() - 10;\n }", "long random(long ws) {\r\n\t\treturn (System.currentTimeMillis() % ws);\r\n\t}", "@Override\n\tpublic double compete() {\n\t\tdouble result=MyTools.getRandomNum(10, 20); \t\n\t\tsetThisResult(result);\n\t\treturn result;\n\t}", "public static double randomNum(Random g)\n\t{\n\t\treturn -5+g.nextDouble()*10;\n\t}", "public void newGame() {\n\t\ttheNumber = (int)(Math.random()* 100 + 1);\r\n\t\t\r\n\t}", "int lanzar(int n){\n int result = (int) (Math.random()* 6) + 1;\r\n if(result !=n ) result = (int) (Math.random()* 6) + 1;\r\n return result;\r\n \r\n /*\r\n * int result = (int) (Math.random()*9)+1;\r\n * if (result > 0 && result < 7) return result;\r\n * else if(result > 6 && result < 9) return n;\r\n * else return (int) (Math.random()*6)+1;\r\n *\r\n *\r\n */\r\n }", "public int generateNumber(int difficulty) {\n Random generator = new Random();\n return 1 + generator.nextInt((int) Math.pow(10, difficulty));\n }", "public static int randomGet() { return 0; }", "static int roll() {\n\t\tRandom rand = new Random();\t\t\t\t//get large random number\n\t\tint num2 = rand.nextInt();\t\t\t\t//convert from long to int\n\t\treturn Math.abs(num2%6)+1;\t\t\t\t//num between 1 and 6\n\t}", "public void generateNewSecret() {\r\n \r\n //Get Random Number With Correct Digits\r\n int intRand = randomNumberGenerator.nextInt((int)(Math.pow(10, numDigits) - Math.pow(10, numDigits - 1))) + (int)Math.pow(10, numDigits - 1);\r\n \r\n //Set To String\r\n String strRand = String.valueOf(intRand);\r\n \r\n //Set Value\r\n secretNumber = convertNumToDigitArray(strRand);\r\n \r\n }", "public static int rollDice(){\n return (int)(Math.random()*6) + 1;\n // Math.random returns a double number >=0.0 and <1.0\n }", "int randInt(int n) {\n return _randomSource.nextInt(n);\n }", "public int roll() {\n return random.nextInt(6) + 1;\n }", "public int randomMove()\r\n {\r\n r = new Random();\r\n x = r.nextInt(7);\r\n return x;\r\n }", "public static int randomNumber() {\n //Random rndNumbers = new Random();\n //for(int i = 0; i < 100; i++) {\n // int rndNumber = rndNumbers.nextInt();\n // System.out.println(rndNumber);\n int rand = (int) (Math.random() * 100);\n System.out.println(rand);\n if (rand > 50) {\n return rand;\n } else {\n System.out.println(\"-1\");\n }\n return rand;\n }", "public int getRandomNumber() {\n int Random;\n Random randomize = new Random();\n Random = randomize.nextInt(3);\n return new Integer(Random);\n }", "public static int RandomNum(){\n\n Random random = new Random();\n int ItemPicker = random.nextInt(16);\n return(ItemPicker);\n }", "private int randomInteger(int n) {\n return (int) (randGen.random() * (n - 1));\n }", "static int random(int mod)\n {\n Random rand = new Random();\n int l= (rand.nextInt());\n if(l<0)\n l=l*-1;\n l=l%mod;\n return l;\n }", "private int randomAge() {\n \tint low = 18;\n \tint high = 100;\n \tint offset = high - low;\n \tRandom r = new Random();\n \treturn r.nextInt(offset) + low;\n \t\n }", "public int pickNumber() {\n\t\t\n\t\tint max=10;\n\t\t\n\t\tint i = (int) Math.floor((Math.random()*max)+1);\n\t\treturn i;\n\t\t\n\t}", "public static int getRandomBalance(){\n return rand.nextInt(1000000);\n }", "private Integer randomBilirrubina(){\n\t\t\tint Min = 0, Max = 14;\n\t\t\treturn Min + (int)(Math.random() * ((Max - Min) + 1));\n\t\t}", "public int randomGQ() {\n\t\treturn(getRandomInteger(10,100));\n\t}", "public static int genID(){\n Random rand = new Random();\n\n int theID = rand.nextInt(999)+1;\n\n return theID;\n\n }", "private int IdRandom() {\n\t\tRandom random = new Random();\n\t\tint id = random.nextInt(899999) + 100000;\n\t\treturn id;\n\t}", "public static void main(String[] args) {\n\r\n\t\tRandom rr=new Random();\r\n\t\t\r\n\t\tSystem.out.println(Math.random());//[0,1)\r\n\t\t \r\n\t\t// 第一种情况 int(强转之后最终的值一定是0)\r\n\t\t// 第二种情况 int(强转之后将小数点舍去 1-5)\r\n\t\tSystem.out.println((int)Math.random()*5);//0.99*5永远到不了5\r\n\t\tSystem.out.println((int)(Math.random()*5+1));//[1,5.)\r\n\t\t\r\n\t\tSystem.out.println(rr.rand107());\r\n\t\tSystem.out.println(rr.rand107());\r\n\t\tSystem.out.println(rr.rand107());\r\n\t\tSystem.out.println(rr.rand107());\r\n\t\t\r\n\t\tfor(int i=0;i<=20;i++){\r\n\t\t\tSystem.out.print(i%7+\"-\");\r\n\t\t\t\r\n\t\t}\r\n\t\t//1-M的随机产生\r\n\t\t//(int)(Math.random()*M+1)\r\n\t\t\r\n\t\t\r\n\t\t//产生0 1的概率不同 Math.random()<p?0:1\r\n\t\tSystem.out.println(\"----\"+rr.rand01p());\r\n\t\tSystem.out.println(\"----\"+rr.rand01());\r\n\t\tfor(int i=0;i<=11;i++){\r\n\t\t\tSystem.out.print(i%6+\"-\");\r\n\t\t \t\r\n\t\t}\r\n\t\tSystem.out.println();\r\n\t\tSystem.out.println(rr.rand106());\r\n\t}", "private void getRandomNumber() {\n\t\tRandom generator = new Random();\n\t\trandomNumber = generator.nextInt(POSSIBLE_CHOICE.length);\n\t}", "int getRandom(int max);", "int RollDice ()\n {\n\tint roll = (int) (Math.random () * 6) + 1;\n\treturn roll;\n }", "@Override\n\tpublic double compete() {\n\t\tdouble result=MyTools.getRandomNum(500, 800);\n\t\tsetThisResult(result);\n\t\treturn result;\n\t}", "private Integer randomHemoglobina(){\n\t\t\tint Min = 9, Max = 23;\n\t\t\treturn Min + (int)(Math.random() * ((Max - Min) + 1));\n\t\t}", "public static String randomNumberString() {\n\r\n Random random = new Random();\r\n int i = random.nextInt(999999);\r\n\r\n\r\n return String.format(\"%06d\", i);\r\n }", "public int generateStrength() {\n\t\tRandom rand = new Random();\n\t\tint strength = rand.nextInt(41) - 10;\n\t\treturn strength;\n\t}", "public static int getRndSalary() {\n return ThreadLocalRandom.current().nextInt(10, 100000 + 1);\n }", "public static int getRandom(int n){\n\t\treturn rg.nextInt(n); \n\t}", "public static void randomInit(int r) { }", "public int generateEvent(){\r\n\t\tif (Event()){\r\n\t\t\treturn random.nextInt(12);\r\n\t\t} else {\r\n\t\t\treturn 4;\r\n\t\t}\r\n\t}", "private int randomNumber(int high, int low){\n \t\t Random r = new Random();\n \t\t return (r.nextInt(high-low) + low);\n \t }", "public static long randomTime() {\n return (random.nextInt(11) + 25)*1000;\n }", "@Override\n public int attack() {\n return new Random().nextInt(5);\n }", "public int randomizeFirstNumber() {\n a = random.nextInt(100);\n question.setA(a);\n return a;\n }", "public static void main(String[] args) {\n\t\tint num=(int) (Math.random()*36 ) ;\r\n\t\tSystem.out.println( Math.random());WW\r\n\t\tSystem.out.println(num);\r\n\t}", "public static int rollStrength(){\n num1 = (int)(Math.random()*(20-0+1)+0);\n return num1;\n }", "public static int randomRound(){\r\n int max = 1000;\r\n int min = 0;\r\n int range = max-min+1;\r\n \r\n int randNum = (int)(Math.random()*range) + min;\r\n return randNum;\r\n }", "public static int diceRoll() {\n Random roller = new Random();//Create a random number generator\r\n return roller.nextInt(6) + 1;//Generate a number between 0-5 and add 1 to it\r\n }" ]
[ "0.7907575", "0.7871373", "0.77784604", "0.7754688", "0.76987535", "0.76872605", "0.7680415", "0.7556971", "0.7551086", "0.75211084", "0.74865687", "0.7459427", "0.7380437", "0.7378398", "0.73705024", "0.73571295", "0.73548937", "0.7294859", "0.72910535", "0.7279794", "0.7258365", "0.7240179", "0.7230195", "0.7171169", "0.71703345", "0.71635616", "0.71086484", "0.7098565", "0.7098226", "0.70875424", "0.7073312", "0.70731825", "0.7043242", "0.702249", "0.7017268", "0.7012809", "0.7009119", "0.7005097", "0.6980073", "0.6967037", "0.6959162", "0.6939418", "0.69354165", "0.69328547", "0.6930031", "0.69272864", "0.692184", "0.6916446", "0.6899192", "0.6884269", "0.68772966", "0.6862843", "0.68501234", "0.6831255", "0.68292147", "0.6824028", "0.6821387", "0.68173176", "0.6814224", "0.6813319", "0.68055326", "0.6801527", "0.6798191", "0.67967826", "0.6785666", "0.6783878", "0.6783078", "0.6771804", "0.6757895", "0.6745026", "0.6741384", "0.67394054", "0.67306405", "0.6718708", "0.67151445", "0.6713254", "0.6712862", "0.6709405", "0.67082477", "0.6705698", "0.66974896", "0.6697331", "0.66790164", "0.6676847", "0.6671584", "0.66493124", "0.6643075", "0.6633332", "0.6629363", "0.66261417", "0.66252136", "0.66225153", "0.6619456", "0.6616768", "0.66099", "0.66065776", "0.65903395", "0.65886325", "0.65862316", "0.6586203", "0.65855294" ]
0.0
-1
Inflate the menu; this adds items to the action bar if it is present.
@Override public boolean onCreateOptionsMenu(Menu menu) { getMenuInflater().inflate(R.menu.menu_detall_recepta, menu); return true; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Override\n public boolean onCreateOptionsMenu(Menu menu) {\n \tMenuInflater inflater = getMenuInflater();\n \tinflater.inflate(R.menu.main_activity_actions, menu);\n \treturn super.onCreateOptionsMenu(menu);\n }", "@Override\n public void onCreateOptionsMenu(Menu menu, MenuInflater inflater) {\n super.onCreateOptionsMenu(menu, inflater);\n inflater.inflate(R.menu.actions, menu);\n }", "@Override\n public boolean onCreateOptionsMenu(Menu menu) {\n \tgetMenuInflater().inflate(R.menu.actions, menu);\n \treturn super.onCreateOptionsMenu(menu);\n }", "@Override\n public boolean onCreateOptionsMenu(Menu menu) {\n MenuInflater inflater = getMenuInflater();\n inflater.inflate(R.menu.actions_bar, menu);\n return super.onCreateOptionsMenu(menu);\n }", "@Override\n\tpublic boolean onCreateOptionsMenu(Menu menu) {\n\t\tMenuInflater inflater = getMenuInflater();\n\t\tinflater.inflate(R.menu.main_actions, menu);\n\n\t\treturn super.onCreateOptionsMenu(menu);\n\t}", "@Override\r\n\tpublic boolean onCreateOptionsMenu(Menu menu) {\n\t\tMenuInflater inflater = getMenuInflater();\r\n\t\tinflater.inflate(R.menu.action_bar_menu, menu);\r\n\t\tmMenu = menu;\r\n\t\treturn super.onCreateOptionsMenu(menu);\r\n\t}", "@Override\n public boolean onCreateOptionsMenu(Menu menu) {\n MenuInflater inflater = getMenuInflater();\n inflater.inflate(R.menu.act_bar_menu, menu);\n return super.onCreateOptionsMenu(menu);\n }", "@Override\r\n\tpublic boolean onCreateOptionsMenu(Menu menu) {\n\t\tMenuInflater inflater = getMenuInflater();\r\n inflater.inflate(R.menu.main_actions, menu);\r\n\t\treturn true;\r\n //return super.onCreateOptionsMenu(menu);\r\n\t}", "@Override\r\n\tpublic boolean onCreateOptionsMenu(Menu menu) {\n\t MenuInflater inflater = getMenuInflater();\r\n\t inflater.inflate(R.menu.action_bar_all, menu);\r\n\t return super.onCreateOptionsMenu(menu);\r\n\t}", "@Override\n\tpublic boolean onCreateOptionsMenu(android.view.Menu menu) {\n\t\t super.onCreateOptionsMenu(menu);\n\t\tMenuInflater muu= getMenuInflater();\n\t\tmuu.inflate(R.menu.cool_menu, menu);\n\t\treturn true;\n\t\t\n\t\t\n\t}", "@Override\r\n\tpublic boolean onCreateOptionsMenu(Menu menu) {\n\t\tgetMenuInflater().inflate(R.menu.adventure_archive, menu);\r\n\t\treturn true;\r\n\t}", "@Override\r\n\tpublic boolean onCreateOptionsMenu(Menu menu) {\n\t\tgetMenuInflater().inflate(R.menu.archive_menu, menu);\r\n\t\treturn true;\r\n\t}", "@Override\n public boolean onCreateOptionsMenu(Menu menu) {\n\n MenuInflater inflater = getMenuInflater();\n inflater.inflate(R.menu.main_activity_actions, menu);\n return super.onCreateOptionsMenu(menu);\n }", "@Override\n public boolean onCreateOptionsMenu(Menu menu) {\n MenuInflater inflater = getMenuInflater();\n inflater.inflate(R.menu.main_activity_actions, menu);\n return super.onCreateOptionsMenu(menu);\n }", "@Override\n public boolean onCreateOptionsMenu(Menu menu) {\n MenuInflater inflater = getMenuInflater();\n inflater.inflate(R.menu.main_activity_actions, menu);\n return super.onCreateOptionsMenu(menu);\n }", "@Override\n \tpublic void onCreateOptionsMenu(Menu menu, MenuInflater inflater) {\n \t\tinflater.inflate(R.menu.main, menu);\n \t\tsuper.onCreateOptionsMenu(menu, inflater);\n \t}", "@Override\n\tpublic boolean onCreateOptionsMenu(Menu menu) {\n\t MenuInflater inflater = getMenuInflater();\n\t inflater.inflate(R.menu.action_menu, menu);\n\t return super.onCreateOptionsMenu(menu);\n\t}", "@Override\n\tpublic boolean onCreateOptionsMenu(Menu menu) {\n\t\tsuper.onCreateOptionsMenu(menu);\n\t\tMenuInflater bow=getMenuInflater();\n\t\tbow.inflate(R.menu.menu, menu);\n\t\treturn true;\n\t\t}", "@Override\n public void onCreateOptionsMenu(Menu menu, MenuInflater inflater) {\n inflater.inflate(R.menu.action_menu, menu);\n super.onCreateOptionsMenu(menu, inflater);\n }", "@Override\n\tpublic boolean onCreateOptionsMenu(Menu menu) {\n\t\tMenuInflater inflater = getMenuInflater();\n\t\tinflater.inflate(R.menu.main, menu);\n\t\treturn super.onCreateOptionsMenu(menu);\n\t}", "@Override\n\tpublic boolean onCreateOptionsMenu(Menu menu) {\n\t\tMenuInflater inflater = getMenuInflater();\n\t\tinflater.inflate(R.menu.main, menu);\n\t\treturn super.onCreateOptionsMenu(menu);\n\t}", "@Override\n\tpublic boolean onCreateOptionsMenu(Menu menu) {\n\t\tMenuInflater inflater = getMenuInflater();\n\t\tinflater.inflate(R.menu.main, menu);\n\t\treturn super.onCreateOptionsMenu(menu);\n\t}", "@Override\n\tpublic boolean onCreateOptionsMenu(Menu menu) {\n\t\tMenuInflater inflater = getMenuInflater();\n\t\tinflater.inflate(R.menu.main, menu);\n\t\treturn super.onCreateOptionsMenu(menu);\n\t}", "@Override\t\n\tpublic boolean onCreateOptionsMenu(Menu menu) {\t\t\n\t\t/* Inflate the menu; this adds items to the action bar if it is present */\n\t\tgetMenuInflater().inflate(R.menu.act_main, menu);\t\t\n\t\treturn true;\n\t}", "@Override\n public boolean onCreateOptionsMenu(Menu menu) {\n MenuInflater inflate = getMenuInflater();\n inflate.inflate(R.menu.menu, ApplicationData.amvMenu.getMenu());\n return true;\n }", "@Override\n\t\tpublic boolean onCreateOptionsMenu(Menu menu) {\n\t\t\tgetMenuInflater().inflate(R.menu.menu, menu);\n\t\t\treturn true; \n\t\t\t\t\t\n\t\t}", "@Override\n\tpublic void onCreateOptionsMenu(Menu menu, MenuInflater inflater) {\n\t\tinflater.inflate(R.menu.main, menu);\n\t}", "@Override\n public boolean onCreateOptionsMenu(Menu menu) {\n getMenuInflater().inflate(R.menu.menu, menu);//Menu Resource, Menu\n return true;\n }", "@Override\n public boolean onCreateOptionsMenu(Menu menu) {\n getMenuInflater().inflate(R.menu.menu, menu);//Menu Resource, Menu\n return true;\n }", "@Override\n public boolean onCreateOptionsMenu(Menu menu) \n {\n MenuInflater inflater = getMenuInflater();\n inflater.inflate(R.menu.menu_bar, menu);\n return true;\n }", "@Override\n public boolean onCreateOptionsMenu(Menu menu) {\n MenuInflater inflater = getMenuInflater();\n inflater.inflate(R.menu.menu_item, menu);\n return super.onCreateOptionsMenu(menu);\n }", "@Override\n\tpublic void onCreateOptionsMenu(Menu menu, MenuInflater inflater) {\n\t\tinflater.inflate(R.menu.menu, menu);\n\t\tsuper.onCreateOptionsMenu(menu, inflater);\n\t}", "@Override\n\tpublic boolean onCreateOptionsMenu(Menu menu) {\n\t MenuInflater inflater = getMenuInflater();\n\t inflater.inflate(R.menu.menu, menu);\n\t return super.onCreateOptionsMenu(menu);\n\t}", "@Override\n\tpublic boolean onCreateOptionsMenu(Menu menu) {\n\t\tMenuInflater inflater = getMenuInflater();\n\t inflater.inflate(R.menu.menu, menu);\n\t \n\t\treturn super.onCreateOptionsMenu(menu);\n\t}", "@Override\n\tpublic void onCreateOptionsMenu(Menu menu, MenuInflater inflater) {\n\t\tsuper.onCreateOptionsMenu(menu, inflater);\n\t\t//menu.clear();\n\t\tinflater.inflate(R.menu.soon_to_be, menu);\n\t\t//getActivity().getActionBar().show();\n\t\t//getActivity().getActionBar().setBackgroundDrawable(\n\t\t\t\t//new ColorDrawable(Color.rgb(223, 160, 23)));\n\t\t//return true;\n\t}", "@Override\n public boolean onCreateOptionsMenu(Menu menu) {\n this.getMenuInflater().inflate(R.menu.main, menu);\n return super.onCreateOptionsMenu(menu);\n }", "@Override\n public void onCreateOptionsMenu(Menu menu, MenuInflater inflater) {\n super.onCreateOptionsMenu(menu, inflater);\n inflater.inflate(R.menu.main, menu);\n }", "@Override\n\tpublic void onCreateOptionsMenu( Menu menu, MenuInflater inflater )\n\t{\n\t\tsuper.onCreateOptionsMenu( menu, inflater );\n\t}", "@Override\r\n\tpublic boolean onCreateOptionsMenu(Menu menu) {\n\t\tgetMenuInflater().inflate(R.menu.main, menu);\r\n\t\treturn super.onCreateOptionsMenu(menu);\r\n\t}", "@Override\r\n public boolean onCreateOptionsMenu(Menu menu) {\r\n \t// We must call through to the base implementation.\r\n \tsuper.onCreateOptionsMenu(menu);\r\n \t\r\n MenuInflater inflater = getMenuInflater();\r\n inflater.inflate(R.menu.main_menu, menu);\r\n\r\n return true;\r\n }", "@Override\n public boolean onCreateOptionsMenu(Menu menu) {\n getMenuInflater().inflate(R.menu.main, menu);//Menu Resource, Menu\n return true;\n }", "@Override\n public boolean onCreateOptionsMenu(Menu menu) {\n getMenuInflater().inflate(R.menu.main, menu);//Menu Resource, Menu\n return true;\n }", "@Override\n public boolean onCreateOptionsMenu(Menu menu) {\n MenuInflater inflater= getMenuInflater();\n inflater.inflate(R.menu.menu_main, menu);\n return super.onCreateOptionsMenu(menu);\n }", "@Override\n public void onCreateOptionsMenu(Menu menu, MenuInflater inflater) {\n super.onCreateOptionsMenu(menu, inflater);\n inflater.inflate(R.menu.inter_main, menu);\n }", "@Override\n public boolean onCreateOptionsMenu(Menu menu) {\n getMenuInflater().inflate(R.menu.menu, menu);\n return super.onCreateOptionsMenu(menu);\n }", "@Override\n\tpublic boolean onCreateOptionsMenu(Menu menu) {\n\t\tgetMenuInflater().inflate(R.menu.action, menu);\n\t\treturn true;\n\t}", "@Override\n public boolean onCreateOptionsMenu(Menu menu) {\n MenuInflater inflater = getMenuInflater();\n inflater.inflate(R.menu.menu, menu);\n return super.onCreateOptionsMenu(menu);\n }", "@Override\n public boolean onCreateOptionsMenu(Menu menu) {\n MenuInflater inflater = getMenuInflater();\n inflater.inflate(R.menu.menu, menu);\n return super.onCreateOptionsMenu(menu);\n }", "@Override\n public boolean onCreateOptionsMenu (Menu menu){\n MenuInflater inflater = getMenuInflater();\n inflater.inflate(R.menu.menu_main, menu);\n return super.onCreateOptionsMenu(menu);\n }", "@Override\n\tpublic boolean onCreateOptionsMenu(Menu menu) {\n\t\tgetMenuInflater().inflate(R.menu.custom_action_bar, menu);\n\t\treturn true;\n\t}", "public void initMenubar() {\n\t\tremoveAll();\n\n\t\t// \"File\"\n\t\tfileMenu = new FileMenuD(app);\n\t\tadd(fileMenu);\n\n\t\t// \"Edit\"\n\t\teditMenu = new EditMenuD(app);\n\t\tadd(editMenu);\n\n\t\t// \"View\"\n\t\t// #3711 viewMenu = app.isApplet()? new ViewMenu(app, layout) : new\n\t\t// ViewMenuApplicationD(app, layout);\n\t\tviewMenu = new ViewMenuApplicationD(app, layout);\n\t\tadd(viewMenu);\n\n\t\t// \"Perspectives\"\n\t\t// if(!app.isApplet()) {\n\t\t// perspectivesMenu = new PerspectivesMenu(app, layout);\n\t\t// add(perspectivesMenu);\n\t\t// }\n\n\t\t// \"Options\"\n\t\toptionsMenu = new OptionsMenuD(app);\n\t\tadd(optionsMenu);\n\n\t\t// \"Tools\"\n\t\ttoolsMenu = new ToolsMenuD(app);\n\t\tadd(toolsMenu);\n\n\t\t// \"Window\"\n\t\twindowMenu = new WindowMenuD(app);\n\n\t\tadd(windowMenu);\n\n\t\t// \"Help\"\n\t\thelpMenu = new HelpMenuD(app);\n\t\tadd(helpMenu);\n\n\t\t// support for right-to-left languages\n\t\tapp.setComponentOrientation(this);\n\t}", "@Override\n\tpublic boolean onCreateOptionsMenu(Menu menu) {\n\t\tgetMenuInflater().inflate(R.menu.main, menu);\n\t\treturn super.onCreateOptionsMenu(menu);\n\t}", "@Override\n\tpublic boolean onCreateOptionsMenu(Menu menu) {\n\t\tsuper.onCreateOptionsMenu(menu);\n\t\tMenuInflater blowUp=getMenuInflater();\n\t\tblowUp.inflate(R.menu.welcome_menu, menu);\n\t\treturn true;\n\t}", "@Override\r\n\tpublic boolean onCreateOptionsMenu(Menu menu) {\n\t\tgetMenuInflater().inflate(R.menu.listing, menu);\r\n\t\treturn true;\r\n\t}", "@Override\n public boolean onCreateOptionsMenu(Menu menu) {\n getMenuInflater().inflate(R.menu.item, menu);\n return true;\n }", "@Override\n\tpublic boolean onCreateOptionsMenu(Menu menu) {\n\t\tgetMenuInflater().inflate(R.menu.resource, menu);\n\t\treturn true;\n\t}", "@Override\n public boolean onCreateOptionsMenu(Menu menu) {\n MenuInflater inflater= getMenuInflater();\n inflater.inflate(R.menu.menu,menu);\n return super.onCreateOptionsMenu(menu);\n }", "@Override\n public boolean onCreateOptionsMenu(Menu menu) {\n MenuInflater inflater = getMenuInflater();\n inflater.inflate(R.menu.main, menu);\n return super.onCreateOptionsMenu(menu);\n }", "@Override\n public boolean onCreateOptionsMenu(Menu menu) {\n MenuInflater inflater = getMenuInflater();\n inflater.inflate(R.menu.main, menu);\n return super.onCreateOptionsMenu(menu);\n }", "@Override\n public boolean onCreateOptionsMenu(Menu menu) {\n MenuInflater inflater = getMenuInflater();\n inflater.inflate(R.menu.home_action_bar, menu);\n return super.onCreateOptionsMenu(menu);\n }", "@Override\n\tpublic boolean onCreateOptionsMenu(Menu menu) {\n\t\tgetMenuInflater().inflate(R.menu.template, menu);\n\t\treturn true;\n\t}", "@Override\n public boolean onCreateOptionsMenu(Menu menu) {\n Log.d(\"onCreateOptionsMenu\", \"create menu\");\n MenuInflater inflater = getMenuInflater();\n inflater.inflate(R.menu.socket_activity_actions, menu);\n return super.onCreateOptionsMenu(menu);\n }", "@Override\n public boolean onCreateOptionsMenu(Menu menu) {\n getMenuInflater().inflate(R.menu.main_menu, menu);//Menu Resource, Menu\n\n return true;\n }", "@Override\n public boolean onCreateOptionsMenu(Menu menu) {\n getMenuInflater().inflate(R.menu.actionbar, menu);\n return true;\n }", "@Override\n public boolean onCreateOptionsMenu(Menu menu) {\n getMenuInflater().inflate(toolbar_res, menu);\n updateMenuItemsVisibility(menu);\n return true;\n }", "@Override\n\tpublic boolean onCreateOptionsMenu(Menu menu) {\n\t\t// \n\t\tMenuInflater mi = getMenuInflater();\n\t\tmi.inflate(R.menu.thumb_actv_menu, menu);\n\t\t\n\t\treturn super.onCreateOptionsMenu(menu);\n\t}", "@Override\n\tpublic void onCreateOptionsMenu(Menu menu, MenuInflater inflater) {\n\t\tsuper.onCreateOptionsMenu(menu, inflater);\n\t}", "@Override\n\tpublic void onCreateOptionsMenu(Menu menu, MenuInflater inflater) {\n\t\tsuper.onCreateOptionsMenu(menu, inflater);\n\t}", "@Override\n\tpublic void onCreateOptionsMenu(Menu menu, MenuInflater inflater) {\n\t\tsuper.onCreateOptionsMenu(menu, inflater);\n\t}", "@Override\n public void onCreateOptionsMenu(Menu menu, MenuInflater inflater) {\n super.onCreateOptionsMenu(menu, inflater);\n }", "@Override\n\t\tpublic boolean onCreateOptionsMenu(Menu menu) {\n\t\t\tgetMenuInflater().inflate(R.menu.main, menu);\n\t\t\treturn true;\n\t\t}", "@Override\n\t\tpublic boolean onCreateOptionsMenu(Menu menu) {\n\t\t\tgetMenuInflater().inflate(R.menu.main, menu);\n\t\t\treturn true;\n\t\t}", "@Override\n\t\tpublic boolean onCreateOptionsMenu(Menu menu) {\n\t\t\tgetMenuInflater().inflate(R.menu.main, menu);\n\t\t\treturn true;\n\t\t}", "@Override\n public boolean onCreateOptionsMenu(Menu menu) {\n MenuInflater inflater = getMenuInflater();\n inflater.inflate(R.menu.swag_list_activity_menu, menu);\n return super.onCreateOptionsMenu(menu);\n }", "@Override\n public void onCreateOptionsMenu(Menu menu, MenuInflater inflater) {\n super.onCreateOptionsMenu(menu, inflater);\n\n }", "@Override\n public boolean onCreateOptionsMenu(Menu menu) {\n MenuInflater inflater = getMenuInflater();\n inflater.inflate(R.menu.main_menu, menu);\n return super.onCreateOptionsMenu(menu);\n }", "@Override\n\tpublic boolean onCreateOptionsMenu(android.view.Menu menu) {\n\t\tgetMenuInflater().inflate(R.menu.main, menu);\n\n\t\treturn true;\n\t}", "@Override\n\t\tpublic boolean onCreateOptionsMenu(Menu menu) {\n\t\t\tgetMenuInflater().inflate(R.menu.main, menu);\n\t\t\treturn true;\n\t}", "@Override\n\tpublic boolean onCreateOptionsMenu(Menu menu) {\n\t\tgetMenuInflater().inflate(R.menu.jarvi, menu);\n\t\treturn super.onCreateOptionsMenu(menu);\n\t}", "public void onCreateOptionsMenu(Menu menu, MenuInflater inflater){\n }", "@Override\n public void onCreateOptionsMenu(Menu menu, MenuInflater menuInflater) {\n menuInflater.inflate(R.menu.main, menu);\n\n }", "@Override\r\n\tpublic boolean onCreateOptionsMenu(Menu menu) {\n\t\tgetMenuInflater().inflate(R.menu.add__listing, menu);\r\n\t\treturn true;\r\n\t}", "@Override\r\n public boolean onCreateOptionsMenu(Menu menu) {\n getMenuInflater().inflate(R.menu.actmain, menu);\r\n return true;\r\n }", "@Override\n\tpublic boolean onCreateOptionsMenu(Menu menu) {\n\t\tgetMenuInflater().inflate(R.menu.buat_menu, menu);\n\t\treturn true;\n\t}", "@Override\n\tpublic boolean onCreateOptionsMenu(Menu menu) {\n\t\tgetMenuInflater().inflate(R.layout.menu, menu);\n\t\treturn true;\n\t}", "@Override\npublic boolean onCreateOptionsMenu(Menu menu) {\n\n\t\n\t\n\tgetMenuInflater().inflate(R.menu.main, menu);\n\t\n\treturn super.onCreateOptionsMenu(menu);\n}", "@Override\n\tpublic boolean onCreateOptionsMenu(Menu menu) {\n\t\tgetMenuInflater().inflate(R.menu.ichat, menu);\n\t\treturn true;\n\t}", "@Override\n public boolean onCreateOptionsMenu(Menu menu) {\n getMenuInflater().inflate(R.menu.menu, menu);\n return super.onCreateOptionsMenu(menu);\n }", "@Override\n\tpublic void onCreateOptionsMenu(Menu menu, MenuInflater inflater)\n\t{\n\t\tsuper.onCreateOptionsMenu(menu, inflater);\n\t\tinflater.inflate(R.menu.expenses_menu, menu);\n\t}", "@Override\n \tpublic boolean onCreateOptionsMenu(Menu menu) {\n \t\tgetMenuInflater().inflate(R.menu.main, menu);\n \t\treturn true;\n \t}", "@Override\n \tpublic boolean onCreateOptionsMenu(Menu menu) {\n \t\tgetMenuInflater().inflate(R.menu.main, menu);\n \t\treturn true;\n \t}", "@Override\n \tpublic boolean onCreateOptionsMenu(Menu menu) {\n \t\tgetMenuInflater().inflate(R.menu.main, menu);\n \t\treturn true;\n \t}", "@Override\n public boolean onCreateOptionsMenu(Menu menu) {\n getMenuInflater().inflate(R.menu.action_bar, menu);\n return true;\n }", "@Override\n\tpublic boolean onCreateOptionsMenu(Menu menu) {\n\t\tsuper.onCreateOptionsMenu(menu);\n\t\tMenuInflater blowUp = getMenuInflater();\n\t\tblowUp.inflate(R.menu.status, menu);\n\t\treturn true;\n\t}", "@Override\r\n\tpublic boolean onCreateOptionsMenu(Menu menu) {\n\t\tgetMenuInflater().inflate(R.menu.menu, menu);\r\n\t\treturn true;\r\n\t}", "@Override\n\tpublic void onCreateOptionsMenu(Menu menu, MenuInflater inflater) {\n\t}", "@Override\n\tpublic boolean onCreateOptionsMenu(Menu menu) {\n\t\tMenuInflater inflater = getMenuInflater();\n\t\tinflater.inflate(R.menu.main, menu);\n\t\treturn true;\n\t}", "@Override\r\n\tpublic boolean onCreateOptionsMenu(Menu menu) {\n\t\tgetMenuInflater().inflate(R.menu.ui_main, menu);\r\n\t\treturn true;\r\n\t}", "@Override\n public boolean onCreateOptionsMenu(Menu menu) {\n getMenuInflater().inflate(R.menu.main_activity_actions, menu);\n return true;\n }", "@Override\n public void onCreateOptionsMenu(Menu menu, MenuInflater inflater) {\n inflater.inflate(R.menu.menu_main, menu);\n super.onCreateOptionsMenu(menu, inflater);\n }", "@Override\n public void onCreateOptionsMenu(Menu menu, MenuInflater inflater) {\n inflater.inflate(R.menu.menu_main, menu);\n super.onCreateOptionsMenu(menu, inflater);\n }" ]
[ "0.7246102", "0.7201358", "0.7194834", "0.7176498", "0.71066517", "0.7039537", "0.7037961", "0.70112145", "0.70094734", "0.69807225", "0.6944953", "0.69389373", "0.6933199", "0.6916928", "0.6916928", "0.6891486", "0.68831646", "0.68754137", "0.68745375", "0.68621665", "0.68621665", "0.68621665", "0.68621665", "0.68515885", "0.68467957", "0.68194443", "0.6817494", "0.6813087", "0.6813087", "0.6812847", "0.6805774", "0.6801204", "0.6797914", "0.6791314", "0.6789091", "0.67883503", "0.6783642", "0.6759701", "0.6757412", "0.67478645", "0.6744127", "0.6744127", "0.67411774", "0.6740183", "0.6726017", "0.6723245", "0.67226785", "0.67226785", "0.67208904", "0.67113477", "0.67079866", "0.6704564", "0.6699229", "0.66989094", "0.6696622", "0.66952467", "0.66865396", "0.6683476", "0.6683476", "0.6682188", "0.6681209", "0.6678941", "0.66772443", "0.6667702", "0.66673946", "0.666246", "0.6657578", "0.6657578", "0.6657578", "0.6656586", "0.66544783", "0.66544783", "0.66544783", "0.66524047", "0.6651954", "0.6650132", "0.66487855", "0.6647077", "0.66467404", "0.6646615", "0.66464466", "0.66449624", "0.6644209", "0.6643461", "0.6643005", "0.66421187", "0.6638628", "0.6634786", "0.6633529", "0.6632049", "0.6632049", "0.6632049", "0.66315657", "0.6628954", "0.66281766", "0.6627182", "0.6626297", "0.6624309", "0.6619582", "0.6618876", "0.6618876" ]
0.0
-1
Handle action bar item clicks here. The action bar will automatically handle clicks on the Home/Up button, so long as you specify a parent activity in AndroidManifest.xml.
@Override public boolean onOptionsItemSelected(MenuItem item) { int id = item.getItemId(); //noinspection SimplifiableIfStatement if (id == R.id.action_settings) { return true; } return super.onOptionsItemSelected(item); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Override\n public boolean onOptionsItemSelected(MenuItem item) { Handle action bar item clicks here. The action bar will\n // automatically handle clicks on the Home/Up button, so long\n // as you specify a parent activity in AndroidManifest.xml.\n\n //\n // HANDLE BACK BUTTON\n //\n int id = item.getItemId();\n if (id == android.R.id.home) {\n // Back button clicked\n this.finish();\n }\n\n return super.onOptionsItemSelected(item);\n }", "@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n switch (item.getItemId()) {\n case android.R.id.home:\n // app icon in action bar clicked; goto parent activity.\n onBackPressed();\n return true;\n default:\n return super.onOptionsItemSelected(item);\n }\n }", "@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n switch (item.getItemId()) {\n // Respond to the action bar's Up/Home button\n case android.R.id.home:\n onBackPressed();\n return true;\n default:\n return super.onOptionsItemSelected(item);\n }\n }", "@Override\r\n public boolean onOptionsItemSelected(MenuItem item) {\n int id = item.getItemId();\r\n switch (id) {\r\n case android.R.id.home:\r\n // app icon in action bar clicked; go home\r\n this.finish();\r\n return true;\r\n default:\r\n return super.onOptionsItemSelected(item);\r\n }\r\n }", "@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n int id = item.getItemId();\n if (id == android.R.id.home) {\n // app icon in action bar clicked; go home\n finish();\n }\n return super.onOptionsItemSelected(item);\n }", "@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n int id = item.getItemId();\n\n if (id == android.R.id.home) {\n Log.e(\"clik\", \"action bar clicked\");\n finish();\n }\n\n return super.onOptionsItemSelected(item);\n }", "@Override\n\t public boolean onOptionsItemSelected(MenuItem item) {\n\t int id = item.getItemId();\n\t \n\t\t\tif (id == android.R.id.home) {\n\t\t\t\t// Respond to the action bar's Up/Home button\n\t\t\t\t// NavUtils.navigateUpFromSameTask(this);\n\t\t\t\tonBackPressed();\n\t\t\t\treturn true;\n\t\t\t}\n\t \n\t \n\t return super.onOptionsItemSelected(item);\n\t }", "@Override\r\n public boolean onOptionsItemSelected(MenuItem item) {\r\n switch (item.getItemId()) {\r\n // Respond to the action bar's Up/Home button\r\n case android.R.id.home:\r\n finish();\r\n return true;\r\n }\r\n return super.onOptionsItemSelected(item);\r\n }", "@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n switch (item.getItemId()) {\n // Respond to the action bar's Up/Home button\n case android.R.id.home:\n finish();\n return true;\n }\n\n return super.onOptionsItemSelected(item);\n }", "@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n int id = item.getItemId();\n\n //noinspection SimplifiableIfStatement\n\n switch (item.getItemId()) {\n case android.R.id.home:\n\n // app icon in action bar clicked; goto parent activity.\n this.finish();\n return true;\n default:\n\n return super.onOptionsItemSelected(item);\n\n }\n }", "@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n int id = item.getItemId();\n\n //noinspection SimplifiableIfStatement\n\n switch (item.getItemId()) {\n case android.R.id.home:\n\n // app icon in action bar clicked; goto parent activity.\n this.finish();\n return true;\n default:\n\n return super.onOptionsItemSelected(item);\n\n }\n }", "@Override\n\tpublic boolean onOptionsItemSelected(MenuItem item) {\n\t\tswitch (item.getItemId()) {\n\t\tcase android.R.id.home:\n\t\t\tonBackPressed();\n\t\t\treturn true;\n\t\tdefault:\n\t\t\treturn super.onOptionsItemSelected(item);\n\t\t}\n\t}", "@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n // Handle presses on the action bar items\n switch (item.getItemId()) {\n case android.R.id.home:\n onBackPressed();\n return true;\n case R.id.action_clear:\n return true;\n case R.id.action_done:\n\n return true;\n default:\n return super.onOptionsItemSelected(item);\n }\n }", "@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n int id = item.getItemId();\n switch (id) {\n case android.R.id.home:\n onActionHomePressed();\n return true;\n }\n return super.onOptionsItemSelected(item);\n }", "@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n int id = item.getItemId();\n\n switch (id) {\n case android.R.id.home:\n onBackPressed();\n break;\n }\n return super.onOptionsItemSelected(item);\n }", "@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n int id = item.getItemId();\n switch (id) {\n case android.R.id.home:\n onBackPressed();\n break;\n }\n\n return super.onOptionsItemSelected(item);\n }", "@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n\n switch (item.getItemId())\n {\n case android.R.id.home :\n super.onBackPressed();\n break;\n }\n return super.onOptionsItemSelected(item);\n }", "@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n switch (item.getItemId ()) {\n case android.R.id.home:\n onBackPressed ();\n return true;\n\n default:\n break;\n }\n return super.onOptionsItemSelected ( item );\n }", "@Override\n\tpublic boolean onOptionsItemSelected(MenuItem item) {\n\t switch (item.getItemId()) {\n\t\tcase android.R.id.home:\n\t\t\t// app icon in action bar clicked; go home \n\t\t\tIntent intent = new Intent(this, Kelutral.class); \n\t\t\tintent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP); \n\t\t\tstartActivity(intent); \n\t\t\treturn true;\t\t\n\t case R.id.Search:\n\t \treturn onSearchRequested();\n\t\tcase R.id.AppInfo:\n\t\t\t// Place holder menu item\n\t\t\tIntent newIntent = new Intent(Intent.ACTION_VIEW,\n\t\t\t\t\tUri.parse(\"http://forum.learnnavi.org/mobile-apps/\"));\n\t\t\tstartActivity(newIntent);\n\t\t\treturn true;\n\t\tcase R.id.Preferences:\n\t\t\tnewIntent = new Intent(getBaseContext(), Preferences.class);\n\t\t\tstartActivity(newIntent);\n\t\t\treturn true;\t\n\t }\n\t return false;\n\t}", "@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n switch (item.getItemId()) {\n\n case android.R.id.home:\n onBackPressed();\n return true;\n\n }\n return super.onOptionsItemSelected(item);\n\n }", "@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n switch (item.getItemId()) {\n case android.R.id.home:\n onBackPressed();\n return true;\n\n default:\n return super.onOptionsItemSelected(item);\n }\n\n }", "@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n switch (item.getItemId()) {\n case android.R.id.home:\n // Intent homeIntent = new Intent(this, MainActivity.class);\n // homeIntent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);\n // startActivity(homeIntent);\n finish();\n return true;\n default:\n return (super.onOptionsItemSelected(item));\n }\n\n }", "@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n // setResult and close the activity when Action Bar Up Button clicked.\n if (item.getItemId() == android.R.id.home) {\n setResult(RESULT_CANCELED);\n finish();\n return true;\n }\n return super.onOptionsItemSelected(item);\n }", "@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n int id = item.getItemId();\n if (id == android.R.id.home) {\n // This ID represents the Home or Up button. In the case of this\n // activity, the Up button is shown. Use NavUtils to allow users\n // to navigate up one level in the application structure. For\n // more details, see the Navigation pattern on Android Design:\n //\n // http://developer.android.com/design/patterns/navigation.html#up-vs-back\n //\n \tgetActionBar().setDisplayHomeAsUpEnabled(false);\n \tgetFragmentManager().popBackStack();\n return true;\n }\n return super.onOptionsItemSelected(item);\n }", "@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n\n switch (item.getItemId()) {\n case android.R.id.home:\n super.onBackPressed();\n return true;\n\n default:\n // If we got here, the user's action was not recognized.\n // Invoke the superclass to handle it.\n return super.onOptionsItemSelected(item);\n\n }\n }", "@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n int id = item.getItemId();\n\n //noinspection SimplifiableIfStatement\n if(id == android.R.id.home){\n onBackPressed();\n }\n\n return super.onOptionsItemSelected(item);\n }", "@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n int id = item.getItemId();\n\n if (id == android.R.id.home) {\n onBackPressed();\n return true;\n }\n\n return super.onOptionsItemSelected(item);\n }", "@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n switch (item.getItemId()) {\n case android.R.id.home:\n onBackPressed();\n return true;\n default:\n return super.onOptionsItemSelected(item);\n\n }\n\n }", "@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n switch (item.getItemId()) {\n case android.R.id.home:\n onBackPressed();\n return true;\n }\n return super.onOptionsItemSelected(item);\n }", "@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n switch (item.getItemId()) {\n case android.R.id.home:\n onBackPressed();\n return true;\n }\n return super.onOptionsItemSelected(item);\n }", "@RequiresApi(api = Build.VERSION_CODES.M)\n @Override\n public boolean onOptionsItemSelected(MenuItem item) {\n switch (item.getItemId()) {\n case android.R.id.home:\n onBackPressed();\n break;\n }\n return super.onOptionsItemSelected(item);\n }", "@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n switch (item.getItemId()) {\n case android.R.id.home:\n onBackPressed();\n return true;\n\n default:\n return super.onOptionsItemSelected(item);\n }\n }", "@Override\r\n\tpublic boolean onOptionsItemSelected(MenuItem item) {\n\t\tif(item.getItemId()==android.R.id.home)\r\n\t\t{\r\n\t\t\tgetActivity().onBackPressed();\r\n\t\t}\r\n\t\treturn super.onOptionsItemSelected(item);\r\n\t}", "@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n if(item.getItemId()==android.R.id.home){\n super.onBackPressed();\n }\n return super.onOptionsItemSelected(item);\n }", "@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n int id = item.getItemId();\n\n switch (id) {\n case android.R.id.home:\n onBackPressed();\n return false;\n }\n\n return super.onOptionsItemSelected(item);\n }", "@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n switch (item.getItemId()) {\n //Back arrow\n case android.R.id.home:\n onBackPressed();\n }\n return super.onOptionsItemSelected(item);\n }", "@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n switch (item.getItemId()) {\n case android.R.id.home:\n onBackPressed();\n return true;\n }\n\n return super.onOptionsItemSelected(item);\n }", "@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n switch (item.getItemId()) {\n case android.R.id.home:\n onBackPressed();\n return true;\n default:\n return super.onOptionsItemSelected(item);\n }\n }", "@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n switch (item.getItemId()) {\n case android.R.id.home:\n onBackPressed();\n return true;\n default:\n return super.onOptionsItemSelected(item);\n }\n }", "@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n switch (item.getItemId()) {\n case android.R.id.home:\n onBackPressed();\n return true;\n default:\n return super.onOptionsItemSelected(item);\n }\n }", "@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n switch (item.getItemId()) {\n case android.R.id.home:\n // android.R.id.home是Android内置home按钮的id\n finish();\n break;\n }\n return super.onOptionsItemSelected(item);\n }", "@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n switch (item.getItemId()) {\n case android.R.id.home:\n super.onBackPressed();\n return true;\n }\n return super.onOptionsItemSelected(item);\n }", "@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n switch (item.getItemId()) {\n case android.R.id.home:\n this.onBackPressed();\n return false;\n }\n return false;\n }", "@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n // 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 int id = item.getItemId();\n\n\n return super.onOptionsItemSelected(item);\n }", "@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n switch (item.getItemId()) {\n case android.R.id.home:\n onBackPressed();\n return true;\n default:\n }\n return super.onOptionsItemSelected(item);\n }", "@Override\r\n public boolean onOptionsItemSelected(MenuItem item) {\r\n switch (item.getItemId()) {\r\n\r\n case android.R.id.home:\r\n /*Intent i= new Intent(getApplication(), MainActivity.class);\r\n i.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK | Intent.FLAG_ACTIVITY_CLEAR_TOP);\r\n startActivity(i);*/\r\n onBackPressed();\r\n finish();\r\n return true;\r\n default:\r\n return super.onOptionsItemSelected(item);\r\n }\r\n }", "@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n int id = item.getItemId();\n\n switch (id){\n case android.R.id.home:\n this.finish();\n return true;\n }\n\n return super.onOptionsItemSelected(item);\n }", "@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n // Pass the event to ActionBarDrawerToggle, if it returns\n // true, then it has handled the app icon touch event\n if (mDrawerToggle.onOptionsItemSelected(item)) {\n return true;\n }\n\n // Handle your other action bar items...\n return super.onOptionsItemSelected(item);\n }", "@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n switch (item.getItemId()) {\n // Respond to the action bar's Up/Home button\n case android.R.id.home:\n NavUtils.navigateUpFromSameTask(getActivity());\n return true;\n case R.id.action_settings:\n Intent i = new Intent(getActivity(), SettingsActivity.class);\n startActivity(i);\n return true;\n }\n\n return super.onOptionsItemSelected(item);\n }", "@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n int id = item.getItemId();\n //Fixes the Up Button\n if(id == android.R.id.home) {\n BuildRoute.this.finish();\n return true;\n }\n return super.onOptionsItemSelected(item);\n }", "@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n switch (item.getItemId()){\n case android.R.id.home:\n onBackPressed();\n break;\n }\n return true;\n }", "@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n int id = item.getItemId();\n\n\n if (id == android.R.id.home) {\n NavUtils.navigateUpFromSameTask(this);\n }\n\n return super.onOptionsItemSelected(item);\n }", "@Override\r\n public boolean onOptionsItemSelected(MenuItem item) {\n switch (item.getItemId()) {\r\n case android.R.id.home:\r\n onBackPressed();\r\n break;\r\n }\r\n return true;\r\n }", "@Override\n\tpublic boolean onOptionsItemSelected(MenuItem item) {\n\t\tif (item.getItemId() == android.R.id.home) {\n\t\t\tfinish();\n\t\t}\n\t\treturn super.onOptionsItemSelected(item);\n\t}", "@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n\n onBackPressed();\n\n return super.onOptionsItemSelected(item);\n }", "@Override\r\n public boolean onOptionsItemSelected(MenuItem item) {\n int id = item.getItemId();\r\n if ( id == android.R.id.home ) {\r\n finish();\r\n return true;\r\n }\r\n return super.onOptionsItemSelected(item);\r\n }", "@Override\r\n public boolean onOptionsItemSelected(MenuItem item) {\n int id = item.getItemId();\r\n\r\n //noinspection SimplifiableIfStatement\r\n if (id == R.id.home) {\r\n NavUtils.navigateUpFromSameTask(this);\r\n return true;\r\n }\r\n\r\n //noinspection SimplifiableIfStatement\r\n if (id == R.id.action_about) {\r\n AboutDialog();\r\n return true;\r\n }\r\n\r\n //noinspection SimplifiableIfStatement\r\n if (id == R.id.action_exit) {\r\n finish();\r\n return true;\r\n }\r\n\r\n\r\n return super.onOptionsItemSelected(item);\r\n }", "@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n int id = item.getItemId();\n\n if (id == android.R.id.home) {\n\n this.finish();\n }\n\n return super.onOptionsItemSelected(item);\n }", "@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n int id = item.getItemId();\n\n if (id == android.R.id.home) {\n\n this.finish();\n }\n\n return super.onOptionsItemSelected(item);\n }", "@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n int id = item.getItemId();\n\n//noinspection SimplifiableIfStatement\n if (id == android.R.id.home) {\n// finish the activity\n onBackPressed();\n return true;\n }\n\n return super.onOptionsItemSelected(item);\n }", "@Override\n public boolean onOptionsItemSelected(MenuItem item)\n {\n int id = item.getItemId();\n\n //noinspection SimplifiableIfStatement\n if( id == android.R.id.home ) // Back button of the actionbar\n {\n finish();\n return true;\n }\n\n return super.onOptionsItemSelected(item);\n }", "@Override\r\n\t\tpublic boolean onOptionsItemSelected(MenuItem item) {\n\t\t\tswitch (item.getItemId()) {\r\n\t\t\tcase android.R.id.home:\r\n\t\t\t\tfinish();\r\n\t\t\t\tbreak;\r\n\t\t\tdefault:\r\n\t\t\t\tbreak;\r\n\t\t\t}\r\n\t\t\treturn super.onOptionsItemSelected(item);\r\n\t\t}", "@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n switch (item.getItemId()) {\n case android.R.id.home:\n\n this.finish();\n return true;\n default:\n return super.onOptionsItemSelected(item);\n }\n\n }", "@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n if (item.getItemId() == android.R.id.home) {\n onBackPressed();\n return true;\n }\n return false;\n }", "@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n int id = item.getItemId();\n\n\n if(id == android.R.id.home){\n finish();\n }\n\n return super.onOptionsItemSelected(item);\n }", "@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n int id = item.getItemId();\n\n //noinspection SimplifiableIfStatement\n if (id == android.R.id.home) {\n onBackPressed();\n return true;\n }\n\n return super.onOptionsItemSelected(item);\n }", "@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n int id = item.getItemId();\n\n //noinspection SimplifiableIfStatement\n if (id == android.R.id.home) {\n onBackPressed();\n return true;\n }\n\n return super.onOptionsItemSelected(item);\n }", "@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n int id = item.getItemId();\n\n //noinspection SimplifiableIfStatement\n if (id == android.R.id.home) {\n onBackPressed();\n return true;\n }\n\n return super.onOptionsItemSelected(item);\n }", "@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n int id = item.getItemId();\n\n //noinspection SimplifiableIfStatement\n if (id == android.R.id.home) {\n onBackPressed();\n return true;\n }\n\n return super.onOptionsItemSelected(item);\n }", "@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n\n if (item.getItemId() == android.R.id.home) {\n finish();\n }\n return super.onOptionsItemSelected(item);\n }", "@Override\r\n\tpublic boolean onOptionsItemSelected(MenuItem item) {\n\t\tswitch (item.getItemId()) {\r\n\t\tcase android.R.id.home:\r\n\t\t\tsetResult(RESULT_OK, getIntent());\r\n\t\t\tfinish();\r\n\t\t\tbreak;\r\n\t\t}\r\n\t\treturn true;\r\n\t}", "@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n switch (item.getItemId()) {\n case android.R.id.home:\n finish();\n return true;\n default:\n // If we got here, the user's action was not recognized.\n // Invoke the superclass to handle it.\n return super.onOptionsItemSelected(item);\n\n }\n }", "@Override\n\tpublic boolean onOptionsItemSelected(MenuItem item) {\n\t\tswitch (item.getItemId()) {\n\t\tcase android.R.id.home:\n\t\t\tfinish();\n\t\t\tbreak;\n\n\t\t}\n\t\treturn super.onOptionsItemSelected(item);\n\t}", "@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n int id = item.getItemId();\n\n switch (id) {\n\n case android.R.id.home:\n this.finish();\n return true;\n }\n return true;\n }", "@Override\n\tpublic boolean onOptionsItemSelected(MenuItem item) {\n\t\tswitch (item.getItemId()) {\n\t\tcase android.R.id.home:\n\t\t\tfinish();\n\t\t\tbreak;\n\n\t\tdefault:\n\t\t\tbreak;\n\t\t}\n\t\treturn super.onOptionsItemSelected(item);\n\t}", "@Override\n\tpublic boolean onOptionsItemSelected(MenuItem item) {\n\t\tint id = item.getItemId();\n\t\tif (id == android.R.id.home) {\n\t\t\tfinish();\n\t\t\treturn true;\n\t\t}\n\t\treturn super.onOptionsItemSelected(item);\n\t}", "@Override\r\n public boolean onOptionsItemSelected(MenuItem item) {\n int id = item.getItemId();\r\n if (id == android.R.id.home) {\r\n finish();\r\n return true;\r\n }\r\n return super.onOptionsItemSelected(item);\r\n }", "@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n switch (item.getItemId()) {\n case android.R.id.home:\n onBackPressed();\n //NavUtils.navigateUpFromSameTask(this);\n return true;\n default:\n return super.onOptionsItemSelected(item);\n }\n }", "@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n switch (item.getItemId()) {\n case android.R.id.home:\n // todo: goto back activity from here\n finish();\n return true;\n\n default:\n return super.onOptionsItemSelected(item);\n }\n }", "@Override\r\n public boolean onOptionsItemSelected(MenuItem item) {\r\n // Handle item selection\r\n switch (item.getItemId()) {\r\n case android.R.id.home:\r\n onBackPressed();\r\n return true;\r\n\r\n case me.cchiang.lookforthings.R.id.action_sample:\r\n// Snackbar.make(parent_view, item.getTitle() + \" Clicked \", Snackbar.LENGTH_SHORT).show();\r\n return true;\r\n default:\r\n return super.onOptionsItemSelected(item);\r\n }\r\n }", "@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n int id = item.getItemId();\n if (id == android.R.id.home) {\n finish();\n }\n return super.onOptionsItemSelected(item);\n }", "@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n int id = item.getItemId();\n if (id == android.R.id.home) {\n finish();\n }\n return super.onOptionsItemSelected(item);\n }", "@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n switch (item.getItemId()) {\n case android.R.id.home:\n finish();\n return true;\n default:\n return super.onOptionsItemSelected(item);\n }\n\n\n }", "@Override\n\tpublic boolean onOptionsItemSelected(MenuItem item) {\n\t\tswitch (item.getItemId()) {\n\t\tcase android.R.id.home:\n\t\t\tonBackPressed();\n\t\t\treturn true;\n\t\tcase R.id.scan_menu:\n\t\t\tonScan();\n\t\t\tbreak;\n\t\tcase R.id.opt_about:\n\t\t\t//onAbout();\n\t\t\tbreak;\n\t\tcase R.id.opt_exit:\n\t\t\tfinish();\n\t\t\tbreak;\n\t\tdefault:\n\t\t\treturn super.onOptionsItemSelected(item);\n\t\t}\n\t\treturn true;\n\t}", "@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n int id = item.getItemId();\n\n //noinspection SimplifiableIfStatement\n if (id == android.R.id.home) {\n super.onBackPressed();\n return true;\n }\n\n return super.onOptionsItemSelected(item);\n }", "@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n int id = item.getItemId();\n\n switch (id) {\n case android.R.id.home:\n this.finish();\n return true;\n default:\n return super.onOptionsItemSelected(item);\n }\n }", "@Override\n public boolean onOptionsItemSelected(@NonNull MenuItem item) {\n if (item.getItemId() == android.R.id.home) {\n onBackPressed();\n }\n return super.onOptionsItemSelected(item);\n }", "@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n int id = item.getItemId();\n switch (id) {\n case android.R.id.home:\n finish();\n return true;\n }\n return super.onOptionsItemSelected(item);\n }", "@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n switch (item.getItemId()) {\n\n case android.R.id.home:\n finish();\n return true;\n\n }\n return super.onOptionsItemSelected(item);\n }", "@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n int id = item.getItemId();\n\n if(id==android.R.id.home){\n finish();\n }\n\n return super.onOptionsItemSelected(item);\n }", "@Override\r\n\tpublic boolean onOptionsItemSelected(MenuItem item) {\r\n\t switch (item.getItemId()) {\r\n\t \t// back to previous page\r\n\t case android.R.id.home:\r\n\t finish();\r\n\t return true;\r\n\t }\r\n\t return super.onOptionsItemSelected(item);\r\n\t}", "@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n int id = item.getItemId();\n\n if (id == android.R.id.home) {\n finish();\n }\n\n return super.onOptionsItemSelected(item);\n }", "@Override\r\n public boolean onOptionsItemSelected(MenuItem item) {\n int id = item.getItemId();\r\n\r\n //noinspection SimplifiableIfStatement\r\n if (id == android.R.id.home) {\r\n // finish the activity\r\n onBackPressed();\r\n return true;\r\n }\r\n\r\n return super.onOptionsItemSelected(item);\r\n }", "@Override\r\n public boolean onOptionsItemSelected(MenuItem item) {\n int id = item.getItemId();\r\n\r\n //noinspection SimplifiableIfStatement\r\n if (id == android.R.id.home) {\r\n // finish the activity\r\n onBackPressed();\r\n return true;\r\n }\r\n\r\n return super.onOptionsItemSelected(item);\r\n }", "@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n switch (item.getItemId())\n {\n case android.R.id.home:\n this.finish();\n return (true);\n }\n return super.onOptionsItemSelected(item);\n }", "@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n int id = item.getItemId();\n if (id == android.R.id.home) {\n finish();\n return true;\n }\n return super.onOptionsItemSelected(item);\n }", "@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n int id = item.getItemId();\n if (id == android.R.id.home) {\n finish();\n return true;\n }\n return super.onOptionsItemSelected(item);\n }", "@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n int id = item.getItemId();\n\n switch (id){\n case R.id.home:{\n NavUtils.navigateUpFromSameTask(this);\n return true;\n }\n }\n return super.onOptionsItemSelected(item);\n }", "@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n int id = item.getItemId();\n\n //noinspection SimplifiableIfStatement\n switch(item.getItemId())\n {\n case android.R.id.home:\n super.onBackPressed();\n break;\n }\n\n return super.onOptionsItemSelected(item);\n }", "@Override\n\tpublic boolean onOptionsItemSelected(MenuItem item) {\n\t\tswitch (item.getItemId()) {\n\t\tcase android.R.id.home:\n\t\t\tfinish();\n\t\t\treturn true;\n\n\t\tdefault:\n\t\t\treturn super.onOptionsItemSelected(item);\n\t\t}\n\t}", "@Override\r\n public boolean onOptionsItemSelected(MenuItem item) {\n\r\n int id = item.getItemId();\r\n if(id==android.R.id.home){\r\n finish();\r\n return true;\r\n }\r\n return super.onOptionsItemSelected(item);\r\n }" ]
[ "0.79041183", "0.7805934", "0.77659106", "0.7727251", "0.7631684", "0.7621701", "0.75839096", "0.75300384", "0.74873656", "0.7458051", "0.7458051", "0.7438486", "0.742157", "0.7403794", "0.7391802", "0.73870087", "0.7379108", "0.7370295", "0.7362194", "0.7355759", "0.73454577", "0.734109", "0.73295504", "0.7327726", "0.73259085", "0.73188347", "0.731648", "0.73134047", "0.7303978", "0.7303978", "0.7301588", "0.7298084", "0.72932935", "0.7286338", "0.7283324", "0.72808945", "0.72785115", "0.72597474", "0.72597474", "0.72597474", "0.725962", "0.7259136", "0.7249966", "0.7224023", "0.721937", "0.7216621", "0.72045326", "0.7200649", "0.71991026", "0.71923256", "0.71851367", "0.7176769", "0.7168457", "0.71675026", "0.7153402", "0.71533287", "0.71352696", "0.71350807", "0.71350807", "0.7129153", "0.7128639", "0.7124181", "0.7123387", "0.7122983", "0.71220255", "0.711715", "0.711715", "0.711715", "0.711715", "0.7117043", "0.71169263", "0.7116624", "0.71149373", "0.71123946", "0.7109806", "0.7108778", "0.710536", "0.7098968", "0.70981944", "0.7095771", "0.7093572", "0.7093572", "0.70862055", "0.7082207", "0.70808214", "0.7080366", "0.7073644", "0.7068183", "0.706161", "0.7060019", "0.70598614", "0.7051272", "0.70374316", "0.70374316", "0.7035865", "0.70352185", "0.70352185", "0.7031749", "0.703084", "0.7029517", "0.7018633" ]
0.0
-1
Created by Administrator on 2016/10/6.
public interface Login { public User findUser(String username, String userpwd); public boolean insert(User user); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private stendhal() {\n\t}", "@Override\n public void perish() {\n \n }", "@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\r\n\tpublic void tires() {\n\t\t\r\n\t}", "@Override\n\tpublic void entrenar() {\n\t\t\n\t}", "@Override\n\tpublic void grabar() {\n\t\t\n\t}", "@Override\n\tpublic void gravarBd() {\n\t\t\n\t}", "@Override\r\n\tpublic void dormir() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void dibujar() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void dibujar() {\n\t\t\r\n\t}", "@Override\r\n\t\t\tpublic void annadir() {\n\r\n\t\t\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\tpublic void anular() {\n\n\t}", "@Override\n\tprotected void getExras() {\n\n\t}", "@Override\n public void inizializza() {\n\n super.inizializza();\n }", "public void mo38117a() {\n }", "@Override\r\n\t\t\tpublic void ayuda() {\n\r\n\t\t\t}", "public final void mo51373a() {\n }", "public void mo4359a() {\n }", "private static void cajas() {\n\t\t\n\t}", "@Override\n protected void initialize() {\n\n \n }", "@Override\n public void settings() {\n // TODO Auto-generated method stub\n \n }", "@Override\r\n\tpublic void publierEnchere() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void rozmnozovat() {\n\t}", "Constructor() {\r\n\t\t \r\n\t }", "public void gored() {\n\t\t\n\t}", "public void designBasement() {\n\t\t\r\n\t}", "@Override\n\tpublic void nadar() {\n\t\t\n\t}", "@Override\n public void init() {\n\n }", "@Override\n public void memoria() {\n \n }", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "private Rekenhulp()\n\t{\n\t}", "@Override\r\n\tpublic void anularFact() {\n\t\t\r\n\t}", "@Override\n protected void initialize() \n {\n \n }", "public void verarbeite() {\n\t\t\r\n\t}", "@Override\r\n\t\tpublic void init() {\n\t\t\t\r\n\t\t}", "@Override\n protected void getExras() {\n }", "@Override\n\tpublic void nghe() {\n\n\t}", "@Override\r\n\tprotected void initialize() {\r\n\t\t\r\n\t\t\r\n\t}", "public void mo6081a() {\n }", "@Override\n\tpublic void init() {\n\t\t\n\t}", "@Override\n\tpublic void init() {\n\t\t\n\t}", "@Override\n\tpublic void init() {\n\t\t\n\t}", "@Override\n\tpublic void init() {\n\t\t\n\t}", "@Override\n\tpublic void init() {\n\t\t\n\t}", "@Override\n\tpublic void debite() {\n\t\t\n\t}", "public contrustor(){\r\n\t}", "public Pitonyak_09_02() {\r\n }", "public void mo55254a() {\n }", "@Override\n\tprotected void interr() {\n\t}", "@Override\n\tprotected void initialize() {\n\t\t\n\t}", "@Override\n\tprotected void initialize() {\n\t\t\n\t}", "private void init() {\n\n\t}", "public void autoDetails() {\n\t\t\r\n\t}", "@Override\n\tpublic void einkaufen() {\n\t}", "@Override\r\n\tpublic void init() {\n\r\n\t}", "@Override\r\n\tpublic void init() {\n\r\n\t}", "@Override\r\n\tpublic void init() {\n\r\n\t}", "Petunia() {\r\n\t\t}", "@Override\n public void func_104112_b() {\n \n }", "@Override\n\tpublic void ligar() {\n\t\t\n\t}", "@Override\r\n\tpublic void init() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void init() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void init() {\n\t\t\r\n\t}", "@Override\n protected void initialize() {\n }", "@Override\n protected void initialize() {\n }", "@Override\n protected void initialize() {\n }", "@Override\n protected void initialize() {\n }", "@Override\n protected void initialize() {\n }", "@Override\n protected void initialize() {\n }", "public void mo12930a() {\n }", "@Override\n\tprotected void initialize() {\n\n\t}", "@Override\n public void init() {\n\n }", "@Override\n public void init() {\n\n }", "@Override\n\tpublic void emprestimo() {\n\n\t}", "@Override\n\tpublic void create () {\n\n\t}", "@Override\n\tprotected void update() {\n\t\t\n\t}", "private TMCourse() {\n\t}", "@Override\n\tpublic void afterInit() {\n\t\t\n\t}", "@Override\n\tpublic void afterInit() {\n\t\t\n\t}", "@Override\n\tpublic void init() {\n\n\t}", "@Override\n\tpublic void init() {\n\n\t}", "@Override\n\tpublic void init() {\n\n\t}", "@Override\n void init() {\n }", "private void poetries() {\n\n\t}", "@Override\n public void init() {\n }", "@Override\r\n\tprotected void initialize() {\n\r\n\t}", "@Override\n\tpublic void create() {\n\t\t\n\t}", "private void getStatus() {\n\t\t\n\t}", "@Override\r\n\tpublic void stehReagieren() {\r\n\t\t//\r\n\t}", "@Override\n\tprotected void initdata() {\n\n\t}", "@Override\n protected void init() {\n }", "private void kk12() {\n\n\t}" ]
[ "0.61967295", "0.61672753", "0.6052757", "0.6023541", "0.5959459", "0.59410256", "0.59015673", "0.5893263", "0.5889112", "0.5857536", "0.5857536", "0.5856805", "0.58547646", "0.58547646", "0.58278954", "0.58267176", "0.5787648", "0.57702917", "0.5761505", "0.57415295", "0.57403314", "0.57374346", "0.5697331", "0.5659912", "0.5635682", "0.56270105", "0.56257", "0.56244564", "0.56164867", "0.56129134", "0.56118387", "0.5599648", "0.5599235", "0.5599235", "0.5599235", "0.5599235", "0.5599235", "0.5599235", "0.5599235", "0.55935925", "0.5576292", "0.5574072", "0.5572411", "0.55576986", "0.5554215", "0.55527127", "0.5548344", "0.5543701", "0.55371815", "0.55371815", "0.55371815", "0.55371815", "0.55371815", "0.5533879", "0.5529763", "0.5523693", "0.55233485", "0.5515383", "0.5513745", "0.5513745", "0.5512765", "0.55085343", "0.550484", "0.5492432", "0.5492432", "0.5492432", "0.5488186", "0.5480171", "0.54733175", "0.54696274", "0.54696274", "0.54696274", "0.54652065", "0.54652065", "0.54652065", "0.54652065", "0.54652065", "0.54652065", "0.54647046", "0.54543394", "0.5449753", "0.5449753", "0.54488903", "0.54426885", "0.5435762", "0.5435248", "0.5433033", "0.5433033", "0.5432984", "0.5432984", "0.5432984", "0.5430626", "0.54273546", "0.5426659", "0.5425269", "0.5415595", "0.5410541", "0.54091614", "0.5406558", "0.54059005", "0.54055303" ]
0.0
-1
Set response content type
public void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { response.setContentType("text/plain"); // Actual logic goes here. PrintWriter out = response.getWriter(); out.println("Wolken,5534-0848-5100,0299-6830-9164"); try { Get g = new Get(Bytes.toBytes(request.getParameter("userid"))); Result r = table.get(g); byte [] value = r.getValue(Bytes.toBytes("v"), Bytes.toBytes("")); String valueStr = Bytes.toString(value); out.println(valueStr); } catch (Exception e) { out.println(e); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "void setContentType(HttpServletResponse response);", "public void setContentType(String type) {\n this.response.setContentType(type);\n }", "private static void setContentTypeHeader(HttpResponse response, File file) {\n\t\tresponse.headers().set(HttpHeaderNames.CONTENT_TYPE, HttpHeaderValues.APPLICATION_OCTET_STREAM);\r\n\t}", "public void setContentTypeHeader(HttpResponse response, String filename) {\r\n //determine filetype by checking filename ending (filetype\r\n String[] splitarray = filename.split(\"\\\\.\");\r\n String filetype = splitarray[splitarray.length-1];\r\n //hardcoded types for all used files, if needed add other filetypes here\r\n switch (filetype) {\r\n case \"js\":\r\n response.headers().set(HttpHeaders.Names.CONTENT_TYPE, \"application/javascript\");\r\n break;\r\n case \"css\":\r\n response.headers().set(HttpHeaders.Names.CONTENT_TYPE, \"text/css\");\r\n break;\r\n case \"ico\":\r\n response.headers().set(HttpHeaders.Names.CONTENT_TYPE, \"image/x-icon\");\r\n break;\r\n default:\r\n response.headers().set(HttpHeaders.Names.CONTENT_TYPE, \"text/html\");\r\n break;\r\n }\r\n }", "private void setContentType(HttpServletResponse response, Format format) {\r\n switch (format) {\r\n case html:\r\n case htmlfragment:\r\n response.setContentType(\"text/html;charset=UTF-8\");\r\n break;\r\n case kml:\r\n response.setContentType(\"application/vnd.google-earth.kml+xml;charset=UTF-8\");\r\n response.setHeader(\"Content-Disposition\",\"attachment; filename=\\\"document.kml\\\"\");\r\n break;\r\n case json:\r\n response.setContentType(\"application/json;charset=UTF-8\");\r\n response.setHeader(\"Content-disposition\", \"attachment; filename=\\\"document.json\\\"\");\r\n break;\r\n case pjson:\r\n\t response.setContentType(\"text/plain;charset=UTF-8\");\r\n\t break; \r\n default:\r\n case xml:\r\n response.setContentType(\"text/xml;charset=UTF-8\");\r\n break;\r\n }\r\n}", "protected static void setContentTypeHeader(HttpResponse response, File file) {\n\t\tresponse.setHeader(HttpHeaders.Names.CONTENT_TYPE, mimeTypesMap.getContentType(file.getName())\n\t\t\t\t+ \"; charset=UTF-8\");\n\t}", "@Override\n\tpublic final void setContentType(final String mimeType)\n\t{\n\t\tif (httpServletResponse != null)\n\t\t{\n\t\t\thttpServletResponse.setContentType(mimeType);\n\t\t}\n\t}", "public void setContentType(Header contentType) {\n/* 114 */ this.contentType = contentType;\n/* */ }", "@Override\n public void setContentType(String arg0) {\n\n }", "public void setContentType(ContentType type)\n\t{\n\t\tsetHeader(CONTENT_TYPE, type.toString());\n\t}", "public void setMimeType(String mimeType) {\n response.setContentType(mimeType);\n }", "public void setContentType(String contentType);", "public void setContentType(String ctString) {\n/* */ BasicHeader basicHeader;\n/* 126 */ Header h = null;\n/* 127 */ if (ctString != null) {\n/* 128 */ basicHeader = new BasicHeader(\"Content-Type\", ctString);\n/* */ }\n/* 130 */ setContentType((Header)basicHeader);\n/* */ }", "public void setContentType(final String type) {\n setHeader(\"Content-Type\", type);\n }", "private void setContentType(Operation operation) {\n operation.getResponses().values().forEach(response -> {\n Content content = response.getContent();\n if (content != null) {\n MediaType mediaType = content.remove(\"*/*\");\n if (mediaType != null) {\n content.addMediaType(\"application/json\", mediaType);\n }\n }\n });\n }", "public String getContentType() {\n return this.response.getContentType();\n }", "public abstract void setContentType(ContentType contentType);", "public Integer getOptContentType() { return(content_type); }", "public void setContentType(java.lang.Object contentType) {\r\n this.contentType = contentType;\r\n }", "public void setContentType(String s) {\n\n\t}", "static void replyWith(HttpExchange t, int code, String contentType, String response)\n throws IOException {\n Headers headers = t.getResponseHeaders();\n headers.add(\"contentType\", contentType);\n t.sendResponseHeaders(code, response.length());\n OutputStream os = t.getResponseBody();\n os.write(response.getBytes());\n os.close();\n }", "private static void initializeResponse(String contentType, String header){\r\n\t\t // Initialize response.\r\n\t response.reset(); // Some JSF component library or some Filter might have set some headers in the buffer beforehand. We want to get rid of them, else it may collide.\r\n\t response.setContentType(contentType); // Check http://www.iana.org/assignments/media-types for all types. Use if necessary ServletContext#getMimeType() for auto-detection based on filename.\r\n\t response.setHeader(\"Content-disposition\", header); // The Save As popup magic is done here. You can give it any filename you want, this only won't work in MSIE, it will use current request URL as filename instead.\r\n\r\n\t}", "public void setContentType(ContentType type, String charset)\n\t{\n\t\tif (charset == null)\n\t\t\tsetContentType(type);\n\t\telse\n\t\t\tsetHeader(CONTENT_TYPE, type.toString() + \"; \" + charset);\n\t}", "public void setContentType(java.lang.String value) {\r\n\t\tBase.set(this.model, this.getResource(), CONTENTTYPE, value);\r\n\t}", "public void setResponseType(java.lang.CharSequence value) {\n this.ResponseType = value;\n }", "public void setContentType(MediaType mediaType)\r\n/* 186: */ {\r\n/* 187:278 */ Assert.isTrue(!mediaType.isWildcardType(), \"'Content-Type' cannot contain wildcard type '*'\");\r\n/* 188:279 */ Assert.isTrue(!mediaType.isWildcardSubtype(), \"'Content-Type' cannot contain wildcard subtype '*'\");\r\n/* 189:280 */ set(\"Content-Type\", mediaType.toString());\r\n/* 190: */ }", "ContentType(String value){\n\t\t_value = value;\n\t}", "public DocumentLifecycleWorkflowRequest setContentTypeJson() {\n\t\tthis.headerContentType = HttpRequestConnector.HTTP_CONTENT_TYPE_JSON;\n\t\treturn this;\n\t}", "@JsonProperty(\"contentType\")\n public String getContentType() {\n return contentType;\n }", "@ResponseStatus (HttpStatus.UNSUPPORTED_MEDIA_TYPE)\n\t@ExceptionHandler (HttpMediaTypeNotSupportedException.class)\n\tpublic Result handleHttpMediaTypeNotSupportedException (Exception e)\n\t{\n\t\treturn new Result ().failure (\"content_type_not_supported\");\n\t}", "@Override\n public int getContentType() {\n return 0;\n }", "@Override\n public boolean accepts(HttpResponse response) {\n Header[] headers = response.getHeaders(HttpHeaders.CONTENT_TYPE);\n for (Header header : headers) {\n if (header != null && header.getValue().contains(NTLMConstants.CONTENT_TYPE_FOR_SPNEGO)) {\n return true;\n }\n }\n return false;\n }", "public MediaType getContentType()\r\n/* 193: */ {\r\n/* 194:289 */ String value = getFirst(\"Content-Type\");\r\n/* 195:290 */ return value != null ? MediaType.parseMediaType(value) : null;\r\n/* 196: */ }", "public String getContentType() {\n return this.contentType;\n }", "@Override\n\tpublic String getContentType()\n\t{\n\t\treturn contentType;\n\t}", "public Builder setContentTypeValue(int value) {\n \n contentType_ = value;\n onChanged();\n return this;\n }", "@Override\n\tpublic String getContentType() {\n\t\treturn CONTENT_TYPE;\n\t}", "@JsonProperty(\"contentType\")\n public void setContentType(String contentType) {\n this.contentType = contentType;\n }", "public String getContentType();", "public String getContentType();", "public Builder setContentType(\n java.lang.String value) {\n if (value == null) {\n throw new NullPointerException();\n }\n \n contentType_ = value;\n onChanged();\n return this;\n }", "public void setMime_type(String value)\r\n {\r\n getSemanticObject().setProperty(data_mime_type, value);\r\n }", "@Test\r\n public void test_setContentType_Accuracy() {\r\n instance.setContentType(\"a\");\r\n assertEquals(\"incorrect value after setting\", \"a\", instance.getContentType());\r\n }", "String getContentType();", "String getContentType();", "String getContentType();", "public ResponseHeaderDefinition dataType(String type) {\n setDataType(type);\n return this;\n }", "public void setContentType(String contentType) {\n this.contentType = contentType;\n }", "public void setContentType(String contentType) {\n this.contentType = contentType;\n }", "public void setContentType(String contentType) {\n this.contentType = contentType;\n }", "@java.lang.Override public int getContentTypeValue() {\n return contentType_;\n }", "@Override\n public String getContentType() {\n return null;\n }", "public final GetHTTP removeAcceptContentType() {\n properties.remove(ACCEPT_CONTENT_TYPE_PROPERTY);\n return this;\n }", "public final String getAcceptContentType() {\n return properties.get(ACCEPT_CONTENT_TYPE_PROPERTY);\n }", "public String getContentType() {\n return contentType;\n }", "public CharSequence getContentType() {\n return contentType;\n }", "default String getContentType() {\n return \"application/octet-stream\";\n }", "@Override\n public String getContentType() {\n return \"text/xml; charset=UTF-8\";\n }", "private void writeHttpServiceResponse(String contentType, HttpServletResponse response, Object result) throws\r\n IOException {\r\n if (contentType.indexOf(CONTENT_TYPE_BSF) > -1) {\r\n OutputStream outputStream = response.getOutputStream();\r\n ObjectOutputStream oos = new ObjectOutputStream(outputStream);\r\n oos.writeObject(new ServiceResponse(result));\r\n oos.close();\r\n } else {\r\n //JSONObject jsonResult = new JSONObject();\r\n \tJsonObject jsonResult = new JsonObject();\r\n if (result instanceof Throwable) {\r\n Throwable ex = (Throwable) result;\r\n jsonResult.addProperty(ERROR, ex.getMessage());\r\n StringWriter sw = new StringWriter();\r\n ex.printStackTrace(new PrintWriter(sw));\r\n jsonResult.addProperty(STACK_TRACE, sw.toString());\r\n } /*else if (result != null && ObjectUtil.isCollection(result)) {\r\n jsonResult.put(VALUE, JSONArray.fromObject(result));\r\n } else if (result instanceof String && JSONUtils.mayBeJSON((String) result)) {\r\n jsonResult.put(VALUE, JSONObject.fromObject((String) result));\r\n } else if (JSONUtils.isNumber(result) || JSONUtils.isBoolean(result) || JSONUtils.isString(result)) {\r\n jsonResult.put(VALUE, result);\r\n }*/ \r\n else {\r\n System.out.println(\">>>result class: \" + result.getClass());\r\n jsonResult.add(VALUE, JSONConverter.toJsonTree(result));\r\n }\r\n response.setCharacterEncoding(RESP_ENCODING);\r\n response.getWriter().write(JSONConverter.gson().toJson(jsonResult));\r\n }\r\n }", "public void startResponse(String contentType) throws IOException {\n if (!endedLastResponse) {\n endResponse();\n }\n // Start the next one\n //out.println(\"Content-Type: \" + contentType);\n //out.println();\n endedLastResponse = false;\n }", "public String getContentType() {\n return this.contentType;\n }", "public String getContentType() {\n return this.contentType;\n }", "public String getContentType() {\n return this.contentType;\n }", "@java.lang.Override public int getContentTypeValue() {\n return contentType_;\n }", "@ResponseStatus(HttpStatus.UNSUPPORTED_MEDIA_TYPE)\n @ExceptionHandler(HttpMediaTypeNotSupportedException.class)\n public R handleHttpMediaTypeNotSupportedException(HttpMediaTypeNotSupportedException e) {\n log.error(\"不支持当前媒体类型\", e);\n return R.error(400 , \"content_type_not_supported\");\n }", "int getContentTypeValue();", "public java.lang.Object getContentType() {\r\n return contentType;\r\n }", "public String getContentType() {\n return getHeader(\"Content-Type\");\n }", "public String getContenttype() {\n return contenttype;\n }", "public String getContenttype() {\n return contenttype;\n }", "private void initForReadableEndpoints() {\n // clear content type\n response.setContentType(null);\n }", "protected void setEncoding() {\n\t\tthis.defaultContentType = getProperty(CONTENT_TYPE_KEY, DEFAULT_CONTENT_TYPE);\n\n\t\tString encoding = getProperty(RuntimeConstants.OUTPUT_ENCODING, DEFAULT_OUTPUT_ENCODING);\n\n\t\t// For non Latin-1 encodings, ensure that the charset is\n\t\t// included in the Content-Type header.\n\t\tif (!DEFAULT_OUTPUT_ENCODING.equalsIgnoreCase(encoding)) {\n\t\t\tint index = defaultContentType.lastIndexOf(\"charset\");\n\t\t\tif (index < 0) {\n\t\t\t\t// the charset specifier is not yet present in header.\n\t\t\t\t// append character encoding to default content-type\n\t\t\t\tthis.defaultContentType += \"; charset=\" + encoding;\n\t\t\t} else {\n\t\t\t\t// The user may have configuration issues.\n\t\t\t\tlog.info(\"Charset was already specified in the Content-Type property.Output encoding property will be ignored.\");\n\t\t\t}\n\t\t}\n\n\t\tlog.debug(\"Default Content-Type is: {}\", defaultContentType);\n\t}", "private String getContentType(String sHTTPRequest) {\n String sContentType = \"Content-Type: \";\n\n // update based on file extension or if response starts with HTML/URL\n String sFileExtension = getFileExtension(sHTTPRequest);\n if (sFileExtension.equalsIgnoreCase(\".html\") || sFileExtension.equalsIgnoreCase(\".htm\")) {\n sContentType += \"text/html\";\n } else if (sFileExtension.equalsIgnoreCase(\".txt\")) {\n sContentType += \"text/plain\";\n } else if (sFileExtension.equalsIgnoreCase(\".pdf\")) {\n sContentType += \"application/pdf\";\n } else if (sFileExtension.equalsIgnoreCase(\".png\")) {\n sContentType += \"image/png\";\n } else if (sFileExtension.equalsIgnoreCase(\".jpeg\") || sFileExtension.equalsIgnoreCase(\".jpg\")) {\n sContentType += \"image/jpeg\";\n } else {\n sContentType += \"text/html\"; // default response\n }\n\n // return final content type\n return sContentType;\n }", "public void setContent( final String content ) {\n setDefaultResponse(content, 200, \"OK\", \"text/html\");\n }", "public String getContentType() {\n return contentType;\n }", "public String getContentType() {\n return contentType;\n }", "public String getContentType() {\n return contentType;\n }", "public String getContentType() {\n return contentType;\n }", "public String getContentType() {\n return contentType;\n }", "protected void writeRemoteInvocationResult(HttpExchange exchange, RemoteInvocationResult result)\n/* */ throws IOException\n/* */ {\n/* 143 */ exchange.getResponseHeaders().set(\"Content-Type\", getContentType());\n/* 144 */ exchange.sendResponseHeaders(200, 0L);\n/* 145 */ writeRemoteInvocationResult(exchange, result, exchange.getResponseBody());\n/* */ }", "public Builder setResponseTypeValue(int value) {\n responseType_ = value;\n onChanged();\n return this;\n }", "private void setContentType(String contentType) throws IOException {\n if (localEncoding !=\"\"){ return; } // Don't change Encoding Twice\n StringTokenizer tok = new StringTokenizer(contentType,\";\");\n if (tok.countTokens()<2){ return;}\n tok.nextToken();\n String var = tok.nextToken(\"=\");\n if (var.length()<1){ return; }\n if (var.charAt(0)==';'){ var = var.substring(1); }\n int j=0;\n for(int i=0; i<var.length();i++){\n if (var.charAt(i)==' '){ j++;} else { break;}\n }\n var = var.substring(j);\n if (!var.equalsIgnoreCase(\"charset\")){ return;}\n String charSet = tok.nextToken();\n if (charSet.equals(characterEncoding)){ return; } // Already correct Encoding\n if (inputStream == null){\n throw new IOException(\"HTML Parser called with Reader cannot change Encoding\");\n }\n if (! (inputStream instanceof OpenByteArrayInputStream) ){\n throw new IOException(\"HTML Parser not called with OpenByteArrayInputStream\");\n }\n OpenByteArrayInputStream obais = (OpenByteArrayInputStream) inputStream;\n byte[] buf = obais.getBuffer();\n int length = obais.getLength();\n int offset = obais.getOffset();\n reader.close();\n obais.close();\n obais = new OpenByteArrayInputStream(buf,offset,length);\n inputStream = obais;\n try {\n reader = new BufferedReader(new InputStreamReader(obais,charSet),1024);\n } catch (UnsupportedEncodingException e){\n Logging.warning(\"Unknown charset \"+charSet+\" parsing with default ISO-8859-1 charSet\");\n System.err.println(\"Unknown charset \"+charSet+\" parsing with default ISO-8859-1 charSet\");\n reader = new BufferedReader(new InputStreamReader(obais),1024);\n charSet = \"iso-8859-1\";\n }\n Logging.info(\"Changed Encoding to \"+charSet);\n System.err.println(\"Changed Encoding to \"+charSet);\n reset();\n characterEncoding = charSet;\n localEncoding = charSet;\n // We will restart reading the file from the beginning\n return;\n }", "public void setContentEncoding(Header contentEncoding) {\n/* 143 */ this.contentEncoding = contentEncoding;\n/* */ }", "public void setContentType(java.lang.String contentType) {\n this.contentType = contentType;\n }", "public SimpleResponse ERROR_UNSUPPORTED_MEDIA_TYPE() {\n this.state = HttpStatus.UNSUPPORTED_MEDIA_TYPE.value();\n return ERROR_CUSTOM();\n }", "public sparqles.avro.discovery.DGETInfo.Builder setResponseType(java.lang.CharSequence value) {\n validate(fields()[4], value);\n this.ResponseType = value;\n fieldSetFlags()[4] = true;\n return this; \n }", "public void setContentType( org.ontoware.rdf2go.model.node.Node value) {\r\n\t\tBase.set(this.model, this.getResource(), CONTENTTYPE, value);\r\n\t}", "public static void setContentType( Model model, org.ontoware.rdf2go.model.node.Resource instanceResource, org.ontoware.rdf2go.model.node.Node value) {\r\n\t\tBase.set(model, instanceResource, CONTENTTYPE, value);\r\n\t}", "protected String getReplyContentType() {\n\t\treturn this.replyContentType;\n\t}", "public static void setContentType(Model model, org.ontoware.rdf2go.model.node.Resource instanceResource, java.lang.String value) {\r\n\t\tBase.set(model, instanceResource, CONTENTTYPE, value);\r\n\t}", "public void setResponseSchemaType(SchemaType responseSchemaType)\n {\n this.responseSchemaType = responseSchemaType;\n }", "private static void writeResponse(\n final ChannelHandlerContext ctx,\n final FullHttpRequest request,\n final HttpResponseStatus status,\n final CharSequence contentType,\n final String content) {\n\n final byte[] bytes = content.getBytes(Charset.forName(\"UTF-8\"));\n final ByteBuf entity = Unpooled.wrappedBuffer(bytes);\n writeResponse(ctx, request, status, entity, contentType, bytes.length);\n }", "public void setContentType(ContentTypeSelDTO value) {\r\n\t\ttype(ConfigurationItemType.CONTENT_TYPE);\r\n\t\tthis.contentTypeValue = value;\r\n\t}", "public void setResponse(T response) {\n this.response = response;\n }", "@Override\n\t\tpublic String getContentType() {\n\t\t\treturn null;\n\t\t}", "public static String getContentType(HttpResponse argOriginResponse) {\r\n\t\tString mime = null;\r\n\t\tHeader header = argOriginResponse\r\n\t\t\t\t.getFirstHeader(HttpConstants.CONTENT_TYPE);\r\n\t\tif (header != null) {\r\n\t\t\tmime = header.getValue();\r\n\t\t\tint semiColonIndex = mime.indexOf(HttpConstants.SEMI_COLON);\r\n\t\t\tif (semiColonIndex != -1) {\r\n\t\t\t\tmime = mime.substring(0, semiColonIndex);\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn mime;\r\n\t}", "@Override\n\tpublic String getContentType() {\n\t\treturn null;\n\t}", "@Override\n\tpublic String getContentType() {\n\t\treturn null;\n\t}", "@Override\n\tpublic String getContentType() {\n\t\treturn null;\n\t}", "public java.lang.String getContentType() {\n return contentType;\n }", "void setResponseFormatError(){\n responseFormatError = true;\n }" ]
[ "0.85155076", "0.7930608", "0.7492048", "0.734203", "0.73247683", "0.7253214", "0.72322834", "0.71463054", "0.6991876", "0.6971935", "0.69708157", "0.6853685", "0.682858", "0.6819522", "0.6748494", "0.6692843", "0.6492454", "0.6473172", "0.6362589", "0.633632", "0.62639844", "0.62411827", "0.6238881", "0.62038624", "0.6136134", "0.61354226", "0.6121064", "0.6099917", "0.60907197", "0.6087207", "0.6069729", "0.60587513", "0.60556066", "0.6053501", "0.60456014", "0.6044981", "0.60427225", "0.60378194", "0.60238767", "0.60238767", "0.60204", "0.601243", "0.5983029", "0.5980315", "0.5980315", "0.5980315", "0.59651214", "0.59529763", "0.59529763", "0.59529763", "0.5949432", "0.59413564", "0.59408826", "0.59373844", "0.5929648", "0.5906354", "0.5903878", "0.5898083", "0.5894823", "0.5891635", "0.5881351", "0.5881351", "0.5881351", "0.5879222", "0.5872377", "0.5851567", "0.58251935", "0.58114845", "0.5805119", "0.5805119", "0.5801446", "0.5796639", "0.57804286", "0.5771034", "0.57633233", "0.57633233", "0.57633233", "0.57633233", "0.57633233", "0.5755599", "0.57428527", "0.57398045", "0.57342714", "0.57213336", "0.572122", "0.5716061", "0.56992346", "0.56801724", "0.56739414", "0.56710297", "0.56618446", "0.5653238", "0.5642992", "0.56325454", "0.56305987", "0.5621728", "0.56206006", "0.56206006", "0.56206006", "0.5619334", "0.5612248" ]
0.0
-1
NOTE: Any ambiguous key set via .set("AnyKey", "value") will be a shallow copy, and any explicit key, i.e Foo, set via .setFoo("value") will be a deep copy.
public Recipient(Recipient source) { if (source.RecipientId != null) { this.RecipientId = new String(source.RecipientId); } if (source.RecipientType != null) { this.RecipientType = new String(source.RecipientType); } if (source.Description != null) { this.Description = new String(source.Description); } if (source.RoleName != null) { this.RoleName = new String(source.RoleName); } if (source.RequireValidation != null) { this.RequireValidation = new Boolean(source.RequireValidation); } if (source.RequireSign != null) { this.RequireSign = new Boolean(source.RequireSign); } if (source.SignType != null) { this.SignType = new Long(source.SignType); } if (source.RoutingOrder != null) { this.RoutingOrder = new Long(source.RoutingOrder); } if (source.IsPromoter != null) { this.IsPromoter = new Boolean(source.IsPromoter); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "void set(String key, Object value);", "void set(K key, V value);", "public setKeyValue_args(setKeyValue_args other) {\n if (other.isSetKey()) {\n this.key = other.key;\n }\n if (other.isSetValue()) {\n this.value = other.value;\n }\n }", "public abstract void set(String key, T data);", "Object put(Object key, Object value);", "public native Map<K, V> set(K key, V value);", "@Test\n public void testSet() {\n Assert.assertTrue(map.set(\"key-1\", \"value-1\", 10));\n Assert.assertTrue(map.set(\"key-1\", \"value-2\", 10));\n Assert.assertTrue(map.set(\"key-2\", \"value-1\", 10));\n }", "private void setKeySet(OwnSet<K> st){\n this.keySet = st; \n }", "void set(K k, V v) throws OverflowException;", "public Value put(Key key, Value thing) ;", "@Test\n\tpublic void testPutAccessReodersElement() {\n\t\tmap.put(\"key1\", \"value1\");\n\n\t\tSet<String> keySet = map.keySet();\n\t\tassertEquals(\"Calling get on an element did not move it to the front\", \"key1\",\n\t\t\tkeySet.iterator().next());\n\n\t\t// move 2 to the top/front\n\t\tmap.put(\"key2\", \"value2\");\n\t\tassertEquals(\"Calling get on an element did not move it to the front\", \"key2\",\n\t\t\tkeySet.iterator().next());\n\t}", "public void set(String key, Object value) {\n set(key, value, 0);\n }", "final <T> void set(String key, T value) {\n set(key, value, false);\n }", "public void setObject(final String key, final Object value)\r\n {\r\n if (key == null)\r\n {\r\n throw new NullPointerException();\r\n }\r\n if (value == null)\r\n {\r\n helperObjects.remove(key);\r\n }\r\n else\r\n {\r\n helperObjects.put(key, value);\r\n }\r\n }", "@Override\n public void put(K key, V value) {\n // Note that the putHelper method considers the case when key is already\n // contained in the set which will effectively do nothing.\n root = putHelper(root, key, value);\n size += 1;\n }", "@Test\n public void keySetTest()\n {\n map.putAll(getAMap());\n assertNotNull(map.keySet());\n }", "@Override\n public V put(K key, V value) {\n if (!containsKey(key)) {\n keys.add(key);\n }\n\n return super.put(key, value);\n }", "public void set(String newKey)\n\t{\n\t\tthis.Key = newKey;\n\t}", "public void setValue(K key, V value);", "public Value set(Value key, Value value) {\n\t\tif (get(key) != null)\n\t\t\tput(key, value);\n\t\telse if (parent != null)\n\t\t\tparent.put(key, value);\n\t\telse\n\t\t\tput(key, value);\n\t\treturn value;\n\t}", "final void set(String key, String value) {\n set(key, value, false);\n }", "void put(String key, Object obj);", "public void set(Object key, Object value) {\n if(attributes == null)\n attributes = new HashMap<>();\n attributes.put(key, value);\n }", "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\tvalueSet.set(keySet.indexOf(key), value);\n\t\t\t} else {\n\t\t\t\tkeySet.add(key);\n\t\t\t\tvalueSet.add(keySet.indexOf(key), value);\n\t\t\t\tsize++;\n\t\t\t}\n\t\t}", "void put(String key, Object value);", "Object put(Object key, Object value) throws NullPointerException;", "public void testNormalKeySet()\r\n throws Exception\r\n {\r\n try\r\n {\r\n SCOMapTests.checkKeySet(pmf,\r\n HashMap1.class,\r\n ContainerItem.class,\r\n String.class);\r\n }\r\n finally\r\n {\r\n clean(HashMap1.class);\r\n clean(ContainerItem.class);\r\n }\r\n }", "@Override\n public synchronized Object put(Object key, Object value) {\n if (value instanceof String) {\n value = ((String) value).trim();\n }\n String strkey = key.toString();\n if (this.ignoreCase) {\n this.keyMap.put(strkey.toLowerCase(), strkey);\n }\n return super.put(strkey, value);\n }", "@Override\n public V put(K key, V value) {\n reverseMap.put(value, key);\n return super.put(key, value);\n }", "public void testSet(){\n stringRedisTemplate.opsForSet().add(\"set-key\",\"a\",\"b\",\"c\");\n //srem set-key c d\n stringRedisTemplate.opsForSet().remove(\"set-key\",\"c\",\"d\");\n stringRedisTemplate.opsForSet().remove(\"set-key\",\"c\",\"d\");\n //scard set-key\n stringRedisTemplate.opsForSet().size(\"set-key\");\n //smembers set-key\n stringRedisTemplate.opsForSet().members(\"set-key\");\n //smove set-key set-key2 a\n stringRedisTemplate.opsForSet().move(\"set-key\",\"a\",\"set-key2\");\n stringRedisTemplate.opsForSet().move(\"set-key\",\"c\",\"set-key2\");\n\n //sadd skey1 a b c d\n stringRedisTemplate.opsForSet().add(\"skey1\",\"a\",\"b\",\"c\",\"d\");\n //sadd skey2 c d e f\n stringRedisTemplate.opsForSet().add(\"skey2\",\"c\",\"d\",\"e\",\"f\");\n //sdiff skey1 skey2 //存在与skey1中不存在与skey2中, a b\n stringRedisTemplate.opsForSet().difference(\"skey1\",\"skey2\");\n //sinter skey1 skey2 // c d\n stringRedisTemplate.opsForSet().intersect(\"skey1\",\"skey2\");\n //sunion skey1 skey2 // a b c d e f\n stringRedisTemplate.opsForSet().union(\"skey1\",\"skey2\");\n }", "protected abstract void put(K key, V value);", "protected abstract void _set(String key, Object obj, Date expires);", "Set getLocalKeySet();", "void setObjectKey(String objectKey);", "String set(K key, V value, SetOption setOption, long expirationTime, TimeUnit timeUnit);", "public Object putTransient(Object key, Object value);", "public JbootVoModel set(String key, Object value) {\n super.put(key, value);\n return this;\n }", "public abstract void Put(WriteOptions options, Slice key, Slice value) throws IOException, BadFormatException, DecodeFailedException;", "public void set(String key, Object value) {\r\n\t\tthis.context.setValue(key, value);\r\n\t}", "public void setKey(K newKey) {\r\n\t\tkey = newKey;\r\n\t}", "@Override\r\n\tpublic void putObject(Object key, Object value) {\n\t\t\r\n\t}", "public MapVS(SetVS<T> keys, Map<K, V> entries) {\n this.keys = keys;\n this.entries = entries;\n this.concreteHash = computeConcreteHash();\n }", "void put(Object indexedKey, Object key);", "public abstract V put(K key, V value);", "void setKey(K key);", "@Override\n\tpublic void put(S key, T val) {\n\t\t\n\t}", "public void set(String key, Object value)\n {\n if (value == null) remove(key);\n else if (value instanceof Map)\n {\n DataSection section = createSection(key);\n Map map = (Map) value;\n for (Object k : map.keySet())\n {\n section.set(k.toString(), map.get(k));\n }\n }\n else\n {\n data.put(key, value);\n if (!keys.contains(key)) keys.add(key);\n }\n }", "@Override\n public void put(K key, V value) {\n root = put(root, key, value);\n }", "public void attach(Object key, Object value);", "public static interface SetFilter extends KeyValueFilter {\r\n\t\tObject put(String name, Object value);\r\n\t}", "public void testCache() {\n MethodKey m = new MethodKey(\"aclass\", \"amethod\", new Object[]{1, \"fads\", new Object()});\n String mValue = \"my fancy value\";\n MethodKey m1 = new MethodKey(\"aclass\", \"amethod1\", new Object[]{1, \"fads\", new Object()});\n String mValue1 = \"my fancy value1\";\n MethodKey m2 = new MethodKey(\"aclass\", \"amethod2\", new Object[]{1, \"fads\", new Object()});\n String mValue2 = \"my fancy value2\";\n\n GenericCache.setValue(m, mValue);\n GenericCache.setValue(m1, mValue1);\n GenericCache.setValue(m2, mValue2);\n\n assertEquals(GenericCache.getValue(m), mValue);\n assertEquals(GenericCache.getValue(m1), mValue1);\n assertEquals(GenericCache.getValue(m2), mValue2);\n }", "void put(K key, V value);", "void put(K key, V value);", "public void set(K key, V value)\n {\n // If there are too many entries, expand the table.\n if (this.size > (this.buckets.length * LOAD_FACTOR))\n {\n expand();\n } // if there are too many entries\n // Find out where the key belongs.\n int index = this.find(key);\n // Create a new association list, if necessary.\n if (buckets[index] == null)\n {\n this.buckets[index] = new AssociationList<K, V>();\n } // if (buckets[index] == null)\n // Add the entry.\n AssociationList<K, V> bucket = this.get(index);\n int oldsize = bucket.size;\n bucket.set(key, value);\n // Update the size\n this.size += bucket.size - oldsize;\n }", "@Override\n public void put(K key, V value) {\n root = putHelper(key,value,root);\n }", "public void setKey(K newKey) {\n this.key = newKey;\n }", "@Override\n\tpublic void set(K key, List<V> value) {\n\t\t\n\t}", "public OwnMap() {\n super();\n keySet = new OwnSet();\n }", "public void setKey (K k) {\n key = k;\n }", "public void setItemCollection(HashMap<String, Item> copy ){\n \titemCollection.putAll(copy);\r\n }", "public void put(Key key, Value val);", "public void setValue(String key, Object value)\n {\n if (value != null)\n {\n if (otherDetails == null)\n {\n otherDetails = new Hashtable();\n }\n\n otherDetails.put(key, value);\n }\n }", "ISObject put(String key, ISObject stuff) throws UnexpectedIOException;", "public void put(Comparable key, Stroke stroke) {\n/* 120 */ ParamChecks.nullNotPermitted(key, \"key\");\n/* 121 */ this.store.put(key, stroke);\n/* */ }", "public void set(R key, List<S> value){\n map.remove(key);\n map.put(key, value);\n }", "public V put(K key, V value) throws InvalidKeyException;", "@SuppressWarnings(\"resource\")\n @Test\n public void testClone() {\n try {\n ApiKey apikey1 = new ApiKey(\"bd1f89fbddbde18d4244b748ca1d250b\", new Date(1570127625049L), 88,\n \"bd1f89fbddbde18d4244b748ca1d250b\", \"18fa817e-9d24-4344-a79a-ab19db23016c\", -15,\n \"7b9ca8ca-2f09-4496-b67e-f3a146e5c741\", \"bd1f89fbddbde18d4244b748ca1d250b\",\n ApiKeyStatus.getDefault(), new Date(1570127627362L));\n ApiKey apikey2 = apikey1.clone();\n assertNotNull(apikey1);\n assertNotNull(apikey2);\n assertNotSame(apikey2, apikey1);\n assertEquals(apikey2, apikey1);\n } catch (Exception exception) {\n fail(exception.getMessage());\n }\n }", "public final void set(final String key, final Object value) {\n try {\n synchronized (jo) {\n if (value == null) {\n jo.remove(key);\n } else {\n jo.put(key, value);\n }\n }\n } catch (JSONException e) {\n }\n }", "@Test\n public void testPutAll_Existing() {\n Map<String, String> toAdd = fillMap(1, 10, \"\", \"Old \");\n\n map.putAll(toAdd);\n\n Map<String, String> toUpdate = fillMap(1, 10, \"\", \"New \");\n\n configureAnswer();\n testObject.putAll(toUpdate);\n\n for (String k : toAdd.keySet()) {\n String old = toAdd.get(k);\n String upd = toUpdate.get(k);\n\n verify(helper).fireReplace(entry(k, old), entry(k, upd));\n }\n verifyNoMoreInteractions(helper);\n }", "public T set(T obj);", "V put(K key, V value);", "public boolean put(String key, String value);", "void put(String key, String value) throws StorageException, ValidationException, KeyValueStoreException;", "public void set(R key, Collection<S> value){\n map.remove(key);\n map.put(key, Collections.synchronizedList(Sugar.listFromCollections(value)));\n }", "@Before\r\n public void test_change(){\r\n HashTable<String,String> table = new HashTable<>(1);\r\n MySet<String> s = (MySet<String>) table.keySet();\r\n table.put(\"AA\",\"BB\");\r\n table.put(\"AA\",\"CC\");\r\n assertTrue(s.contains(\"AA\"));\r\n table.remove(\"AA\");\r\n assertFalse(s.contains(\"AA\"));\r\n }", "public void put(String key, Object value)\n\t{\n\t\tverifyParseState();\n\t\tvalues.put(key, ValueUtil.createValue(value));\n\t}", "public boolean put( KEY key, OBJECT object );", "boolean setValue(String type, String key, String value);", "public Set<V> put(K key, Collection<V> set) {\n // Remove any possibly existing prior association with the key\n Set<V> result = remove(key);\n\n // Note: The second argument is effectless, as we cannot encounter item type errors here\n NavigableSet<V> navSet = createNavigableSet(set, true);\n Iterator<V> it = navSet.iterator();\n\n SetTrieNode currentNode = superRootNode;\n while(it.hasNext()) {\n V v = it.next();\n\n SetTrieNode nextNode = currentNode.nextValueToChild == null ? null : currentNode.nextValueToChild.get(v);\n if(nextNode == null) {\n nextNode = new SetTrieNode(nextId++, currentNode, v);\n if(currentNode.nextValueToChild == null) {\n currentNode.nextValueToChild = new TreeMap<>(comparator);\n }\n currentNode.nextValueToChild.put(v, nextNode);\n }\n currentNode = nextNode;\n }\n\n if(currentNode.keyToSet == null) {\n currentNode.keyToSet = new HashMap<>();\n }\n\n currentNode.keyToSet.put(key, navSet);\n\n keyToNode.put(key, currentNode);\n\n return result;\n }", "public K setKey(K key);", "Set keySet(final TCServerMap map) throws AbortedOperationException;", "@SuppressWarnings(\"unchecked\")\n\tpublic Object clone() {\n\t\tLongOpenHashSet c;\n\t\ttry {\n\t\t\tc = (LongOpenHashSet) super.clone();\n\t\t} catch (CloneNotSupportedException cantHappen) {\n\t\t\tthrow new InternalError();\n\t\t}\n\t\tc.key = key.clone();\n\t\tc.state = state.clone();\n\t\treturn c;\n\t}", "boolean canSet(String key);", "@Test\n public void testBackdoorModificationSameKey()\n {\n testBackdoorModificationSameKey(this);\n }", "public IDataKey clone() {\n return new IDataKey(this);\n }", "public abstract void copyFrom(KeyedString src);", "@Override\n public V put(K key, V value) {\n if ((key == null) || (value == null)) {\n logger.warn(\"NULL key or value key = \" + key + \". value = \" + value);\n System.out.println(StringUtils.join(Thread.currentThread().getStackTrace(), \"\\n\"));\n return null;\n }\n\n // If this map is supposed to be case insensitive, uppercase the key before putting it\n // in the map\n if (caseInsensitive && key instanceof String) {\n return super.put(((K) key.toString().toUpperCase()), value);\n } else {\n return super.put(key, value);\n }\n }", "public void set(String key, String value){\n\t\tif(first == null){\n\t\t\tfirst = new ListMapEntry(key, value);\n\t\t}\n\t\tListMapEntry temp = first;\n\t\tListMapEntry prev = null;\n\t\twhile(temp!=null && !temp.getKey().equals(key)){\n\t\t\tprev = temp;\n\t\t\ttemp = temp.getNext();\n\t\t}\n\t\tif(temp==null){\n\t\t\tprev.setNext(new ListMapEntry(key, value));\n\t\t}\n\t\telse{\n\t\t\ttemp.setValue(value);\n\t\t}\n\t}", "V put(final K key, final V value);", "public void set(String key, Object obj) {\n options.put(key, obj);\n }", "boolean put(K key, V value);", "@Override\n\tpublic void put(Object key, Object val) {\n\t\tif(st[hash(key)].size()>=k)\n\t\t\tst[hash(key)].clear();\n\t\tst[hash(key)].put(key, st[hash(key)].size());\n\t}", "protected abstract boolean _setIfAbsent(String key, Object value, Date expires);", "@Override\n public void putValue(String key, Object value) {\n\n }", "public DelegateAbstractHashMap(AbstractHashSet set) {\n\t\t\tsuper();\n\t\t\tthis.set = set;\n\t\t}", "public void changeKey(String key, Object newValue){\n try {\n myJSON.put(key, newValue);\n writeToFile();\n } catch (Exception e) {\n e.printStackTrace();\n }\n }", "public void put(String key, T value);", "@Override\r\n public V put(K key, V value){\r\n \r\n // Declare a temporay node and instantiate it with the key and\r\n // previous value of that key\r\n TreeNode<K, V> tempNode = new TreeNode<>(key, get(key));\r\n \r\n // Call overloaded put function to either place a new node\r\n // in the tree or update the exisiting value for the key\r\n root = put(root, key, value);\r\n \r\n // Return the previous value of the key through the temporary node\r\n return tempNode.getValue();\r\n }", "String setKey(String newKey);", "public void set(String key, String value) {\n if (key.indexOf('=') != -1 || key.indexOf(';') != -1) {\n Log.e(TAG, \"Key \\\"\" + key + \"\\\" contains invalid character (= or ;)\");\n return;\n }\n if (value.indexOf('=') != -1 || value.indexOf(';') != -1) {\n Log.e(TAG, \"Value \\\"\" + value + \"\\\" contains invalid character (= or ;)\");\n return;\n }\n\n mMap.put(key, value);\n }", "@Test\n public void testPutAll_ExistingNoChange() {\n Map<String, String> toAdd = fillMap(1, 10);\n\n map.putAll(toAdd);\n\n Map<String, String> toUpdate = fillMap(1, 10);\n\n configureAnswer();\n testObject.putAll(toUpdate);\n\n verifyZeroInteractions(helper);\n }" ]
[ "0.6440425", "0.6415443", "0.6145525", "0.61172885", "0.609467", "0.60810256", "0.60422385", "0.5990364", "0.59736174", "0.59564006", "0.58394885", "0.58277106", "0.5790857", "0.5705316", "0.57027704", "0.56880087", "0.5686415", "0.56781363", "0.5608639", "0.5590083", "0.5582245", "0.5570489", "0.5560049", "0.55530703", "0.5549463", "0.5533705", "0.55286086", "0.55116004", "0.54972124", "0.54910856", "0.54829353", "0.54679686", "0.5431868", "0.54273665", "0.54224724", "0.5413962", "0.54104", "0.53787935", "0.53772664", "0.53748906", "0.53747004", "0.53570825", "0.5350402", "0.5340595", "0.5330211", "0.5321594", "0.52932364", "0.5285382", "0.52825433", "0.52648", "0.5258141", "0.5257998", "0.5257998", "0.5256669", "0.5256548", "0.5242394", "0.5237798", "0.5234187", "0.522877", "0.52269787", "0.522518", "0.52182424", "0.52167994", "0.52009475", "0.5195212", "0.5188795", "0.5183071", "0.51826215", "0.5177528", "0.517711", "0.51760465", "0.51758975", "0.51740146", "0.5170327", "0.5136484", "0.5132591", "0.5129853", "0.51292944", "0.51247597", "0.5121954", "0.5120632", "0.51204467", "0.5104378", "0.51039904", "0.5101876", "0.5099534", "0.50989676", "0.5092156", "0.5074713", "0.5070289", "0.50656843", "0.50632787", "0.50518346", "0.5028556", "0.5023309", "0.5022976", "0.5020225", "0.50197893", "0.501666", "0.50151473", "0.5015003" ]
0.0
-1
Internal implementation, normal users should not use it.
public void toMap(HashMap<String, String> map, String prefix) { this.setParamSimple(map, prefix + "RecipientId", this.RecipientId); this.setParamSimple(map, prefix + "RecipientType", this.RecipientType); this.setParamSimple(map, prefix + "Description", this.Description); this.setParamSimple(map, prefix + "RoleName", this.RoleName); this.setParamSimple(map, prefix + "RequireValidation", this.RequireValidation); this.setParamSimple(map, prefix + "RequireSign", this.RequireSign); this.setParamSimple(map, prefix + "SignType", this.SignType); this.setParamSimple(map, prefix + "RoutingOrder", this.RoutingOrder); this.setParamSimple(map, prefix + "IsPromoter", this.IsPromoter); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Override\n\tpublic void sacrifier() {\n\t\t\n\t}", "@Override\n public void perish() {\n \n }", "public final void mo51373a() {\n }", "@Override\n\tprotected void interr() {\n\t}", "@Override\n protected void prot() {\n }", "private stendhal() {\n\t}", "@Override\n public void func_104112_b() {\n \n }", "@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 protected void initialize() {\n }", "@Override\n protected void initialize() {\n }", "@Override\n protected void initialize() {\n }", "@Override\n protected void initialize() {\n }", "@Override\n protected void initialize() {\n }", "@Override\n protected void initialize() {\n }", "@Override\n protected void init() {\n }", "@Override\n\tpublic void grabar() {\n\t\t\n\t}", "public void smell() {\n\t\t\n\t}", "@Override\r\n\t\tpublic void init() {\n\t\t\t\r\n\t\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\r\n\tpublic void tires() {\n\t\t\r\n\t}", "private void m50366E() {\n }", "protected boolean func_70814_o() { return true; }", "protected Problem() {/* intentionally empty block */}", "@Override\r\n \tpublic void process() {\n \t\t\r\n \t}", "@Override\r\n\tprotected void initSelfData() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void initSelfData() {\n\t\t\r\n\t}", "protected MetadataUGWD() {/* intentionally empty block */}", "@Override\n public int retroceder() {\n return 0;\n }", "protected Doodler() {\n\t}", "@Override\n\tpublic void entrenar() {\n\t\t\n\t}", "@Override\n public Object preProcess() {\n return null;\n }", "@Override\n protected void initialize() \n {\n \n }", "@SuppressWarnings(\"unused\")\n private void _read() {\n }", "@Override\r\n\tpublic void init() {}", "private Rekenhulp()\n\t{\n\t}", "@Override\n public void init() {\n }", "@Override\n\tprotected void initialize() {\n\t\t\n\t}", "@Override\n\tprotected void initialize() {\n\t\t\n\t}", "@Override\n public void apply() {\n }", "private TestsResultQueueEntry() {\n\t\t}", "@Override\n void init() {\n }", "@Override\r\n\tpublic void dormir() {\n\t\t\r\n\t}", "@Override\r\n\t\tprotected void run() {\n\t\t\t\r\n\t\t}", "@Override\n public void function()\n {\n }", "@Override\n public void function()\n {\n }", "protected void initialize() {}", "protected void initialize() {}", "private final void i() {\n }", "protected void h() {}", "@Override\r\n\tpublic final void init() {\r\n\r\n\t}", "@Override\n\tpublic void anular() {\n\n\t}", "private Unescaper() {\n\n\t}", "@Override\r\n\tprotected void prepare()\r\n\t{\r\n\r\n\t}", "private ArraySetHelper() {\n\t\t// nothing\n\t}", "@Override\n\tprotected void logic() {\n\n\t}", "private Util() { }", "@Override\n public void init() {}", "@Override public int describeContents() { return 0; }", "public void method_4270() {}", "@Override\n\t\tpublic void init() {\n\t\t}", "@Override\n protected void initialize() {\n\n \n }", "@Override\n\tpublic void apply() {\n\t\t\n\t}", "@Override\n\t\tpublic void method() {\n\t\t\t\n\t\t}", "@Override\r\n\tprotected void doF8() {\n\t\t\r\n\t}", "protected abstract Set method_1559();", "@Override\n public void init() {\n\n }", "private void someUtilityMethod() {\n }", "private void someUtilityMethod() {\n }", "protected void init() {\n // to override and use this method\n }", "@Override\n\tprotected void initialize() {\n\t}", "@Override\n\tprotected void initialize() {\n\t}", "@Override\n\tprotected void initialize() {\n\n\t}", "@Override\r\n\tprotected void intializeSpecific() {\n\r\n\t}", "@Override\r\n\tpublic void init()\r\n\t{\n\t}", "@Override\r\n\t\t\tpublic void func02() {\n\t\t\t\t\r\n\t\t\t}", "@Override\r\n\tprotected void initialize() {\r\n\t\t\r\n\t\t\r\n\t}", "@Override\r\n\t\t\tpublic void annadir() {\n\r\n\t\t\t}", "private TedCorrigendumHandler() {\n throw new AssertionError();\n }", "private MetallicityUtils() {\n\t\t\n\t}", "@Override\n\tprotected void prepare() {\n\t\t\n\t}", "@Override\n\tpublic void nadar() {\n\t\t\n\t}", "protected boolean func_70041_e_() { return false; }", "@Override\r\n\tpublic void init() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void init() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void init() {\n\t\t\r\n\t}", "@Override\n public void preprocess() {\n }", "@Override\r\n\tprotected void func03() {\n\t\t\r\n\t}", "protected void additionalProcessing() {\n\t}", "private void getStatus() {\n\t\t\n\t}", "protected OpinionFinding() {/* intentionally empty block */}", "@Override\r\n\tpublic void just() {\n\t\t\r\n\t}", "@Override\n\tpublic void selfValidate() {\n\t\t\n\t}", "@Override\r\n\tpublic void rozmnozovat() {\n\t}", "@Override\r\n\tprotected void initialize() {\n\r\n\t}", "@Override\n\tpublic void einkaufen() {\n\t}", "@Override\n\tpublic void ligar() {\n\t\t\n\t}", "@Override\n public int describeContents() { return 0; }", "@Override\n\t\t\tpublic void ic() {\n\t\t\t\t\n\t\t\t}", "private void assignment() {\n\n\t\t\t}" ]
[ "0.62574834", "0.6217662", "0.6024768", "0.5982239", "0.5965723", "0.59330684", "0.5920059", "0.58351564", "0.5781645", "0.57749504", "0.57749504", "0.57749504", "0.57749504", "0.57749504", "0.57749504", "0.57737285", "0.57054734", "0.5701363", "0.56510806", "0.56491816", "0.56491816", "0.5641364", "0.5636646", "0.5636101", "0.5617263", "0.56129867", "0.56071395", "0.56071395", "0.5604147", "0.5597464", "0.5557192", "0.5547823", "0.5538959", "0.5529547", "0.5527831", "0.55252886", "0.5524415", "0.55170584", "0.55161196", "0.55161196", "0.5508306", "0.55039597", "0.5501735", "0.5498203", "0.5492665", "0.54857016", "0.54857016", "0.5484164", "0.5484164", "0.54709655", "0.54671437", "0.5466405", "0.54586643", "0.54480445", "0.5444829", "0.544423", "0.5431154", "0.54291874", "0.5428321", "0.5426861", "0.5424348", "0.54216623", "0.54197234", "0.54126096", "0.54122156", "0.5410503", "0.5408548", "0.54017633", "0.5393527", "0.5393527", "0.5393108", "0.53811836", "0.53811836", "0.53765255", "0.53727305", "0.5371025", "0.5368476", "0.53672004", "0.5362031", "0.535984", "0.53585947", "0.535824", "0.53558195", "0.53554994", "0.53553045", "0.53553045", "0.53553045", "0.5353958", "0.53527707", "0.53524756", "0.5351759", "0.535174", "0.53509206", "0.53348345", "0.5334606", "0.533233", "0.5331985", "0.5331269", "0.5331116", "0.53306353", "0.5328405" ]
0.0
-1
/ renamed from: a
private Player m384a(String str, String str2) { String stringBuffer; Player player = null; if (str == this.f340a[20]) { stringBuffer = new StringBuffer().append(str).append(".amr").toString(); str2 = "audio/amr"; } else { stringBuffer = new StringBuffer().append(str).append(".mid").toString(); } try { InputStream resourceAsStream = getClass().getResourceAsStream(stringBuffer); player = Manager.createPlayer(resourceAsStream, str2); player.addPlayerListener(this.f338a); player.realize(); player.prefetch(); resourceAsStream.close(); return player; } catch (Exception e) { return player; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public interface C4521a {\n /* renamed from: a */\n void mo12348a();\n }", "public interface C1423a {\n /* renamed from: a */\n void mo6888a(int i);\n }", "interface bxc {\n /* renamed from: a */\n void mo2508a(bxb bxb);\n}", "interface C33292a {\n /* renamed from: a */\n void mo85415a(String str);\n }", "interface C10331b {\n /* renamed from: a */\n void mo26876a(int i);\n }", "public interface C0779a {\n /* renamed from: a */\n void mo2311a();\n}", "public interface C6788a {\n /* renamed from: a */\n void mo20141a();\n }", "public interface C0237a {\n /* renamed from: a */\n void mo1791a(String str);\n }", "public interface C35013b {\n /* renamed from: a */\n void mo88773a(int i);\n}", "public interface C11112n {\n /* renamed from: a */\n void mo38026a();\n }", "@Override\n\t\t\t\tpublic void a() {\n\n\t\t\t\t}", "public interface C23407b {\n /* renamed from: a */\n void mo60892a();\n\n /* renamed from: b */\n void mo60893b();\n }", "interface C0312e {\n /* renamed from: a */\n void mo4671a(View view, int i, int i2, int i3, int i4);\n }", "public interface C34379a {\n /* renamed from: a */\n void mo46242a(bmc bmc);\n }", "public interface C32456b<T> {\n /* renamed from: a */\n void mo83696a(T t);\n }", "private String convertir(String a) {\n StringBuilder atributo = new StringBuilder(a);\n atributo.insert(0, Character.toUpperCase(atributo.charAt(0)));\n return atributo.deleteCharAt(1).toString();\n }", "protected m a(String name) {\n/* 42 */ return this.a.get(name);\n/* */ }", "public interface AbstractC23925a {\n /* renamed from: a */\n void mo105476a();\n }", "private interface C0257a {\n /* renamed from: a */\n float mo196a(ViewGroup viewGroup, View view);\n\n /* renamed from: b */\n float mo195b(ViewGroup viewGroup, View view);\n }", "public interface C3598a {\n /* renamed from: a */\n void mo11024a(int i, int i2, String str);\n }", "public interface C2459d {\n /* renamed from: a */\n C2451d mo3408a(C2457e c2457e);\n}", "public interface am extends ak {\r\n /* renamed from: a */\r\n void mo194a(int i) throws RemoteException;\r\n\r\n /* renamed from: a */\r\n void mo195a(List<LatLng> list) throws RemoteException;\r\n\r\n /* renamed from: b */\r\n void mo196b(float f) throws RemoteException;\r\n\r\n /* renamed from: b */\r\n void mo197b(boolean z);\r\n\r\n /* renamed from: c */\r\n void mo198c(boolean z) throws RemoteException;\r\n\r\n /* renamed from: g */\r\n float mo199g() throws RemoteException;\r\n\r\n /* renamed from: h */\r\n int mo200h() throws RemoteException;\r\n\r\n /* renamed from: i */\r\n List<LatLng> mo201i() throws RemoteException;\r\n\r\n /* renamed from: j */\r\n boolean mo202j();\r\n\r\n /* renamed from: k */\r\n boolean mo203k();\r\n}", "public interface C32459e<T> {\n /* renamed from: a */\n void mo83698a(T t);\n }", "public interface C32458d<T> {\n /* renamed from: a */\n void mo83695a(T t);\n }", "public interface C5482b {\n /* renamed from: a */\n void mo27575a();\n\n /* renamed from: a */\n void mo27576a(int i);\n }", "public interface C27084a {\n /* renamed from: a */\n void mo69874a();\n\n /* renamed from: a */\n void mo69875a(List<Aweme> list, boolean z);\n }", "public void a() {\n ((a) this.a).a();\n }", "public interface C1153a {\n /* renamed from: a */\n void mo4520a(byte[] bArr);\n }", "public interface C13373b {\n /* renamed from: a */\n void mo32681a(String str, int i, boolean z);\n}", "public interface C40453c {\n /* renamed from: a */\n void mo100442a(C40429b bVar);\n\n /* renamed from: a */\n void mo100443a(List<String> list);\n\n /* renamed from: b */\n void mo100444b(List<C40429b> list);\n}", "public interface AbstractC17367b {\n /* renamed from: a */\n void mo84655a();\n }", "@Override\r\n\tpublic void a() {\n\t\t\r\n\t}", "public interface C43270a {\n /* renamed from: a */\n void mo64942a(String str, long j, long j2);\n}", "public interface C18928d {\n /* renamed from: a */\n void mo50320a(C18924b bVar);\n\n /* renamed from: b */\n void mo50321b(C18924b bVar);\n}", "public interface C0087c {\n /* renamed from: a */\n String mo150a(String str);\n}", "public interface C1529m {\n /* renamed from: a */\n void mo3767a(int i);\n\n /* renamed from: a */\n void mo3768a(String str);\n}", "interface C4483e {\n /* renamed from: a */\n boolean mo34114a();\n}", "public interface C1234b {\r\n /* renamed from: a */\r\n void m8367a();\r\n\r\n /* renamed from: b */\r\n void m8368b();\r\n}", "public interface C10965j<T> {\n /* renamed from: a */\n T mo26439a();\n}", "public interface C28772a {\n /* renamed from: a */\n View mo73990a(View view);\n }", "@Override\n\tpublic void a() {\n\t\t\n\t}", "public interface C8326b {\n /* renamed from: a */\n C8325a mo21498a(String str);\n\n /* renamed from: a */\n void mo21499a(C8325a aVar);\n}", "void metodo1(int a, int[] b) {\r\n\t\ta += 5;//Par\\u00e1metro con el mismo nombre que el campo de la clase.\r\n\t\tb[0] += 7;//se produce un env\\u00edo por referencia, apunta a una copia de un objeto, que se asigna aqu\\u00ed.\r\n\t}", "public interface C2367a {\n /* renamed from: a */\n C2368d mo1698a();\n }", "interface C30585a {\n /* renamed from: b */\n void mo27952b(C5379a c5379a, int i, C46650a c46650a, C7620bi c7620bi);\n }", "public interface C4211a {\n\n /* renamed from: com.iab.omid.library.oguryco.c.a$a */\n public interface C4212a {\n /* renamed from: a */\n void mo28760a(View view, C4211a aVar, JSONObject jSONObject);\n }\n\n /* renamed from: a */\n JSONObject mo28758a(View view);\n\n /* renamed from: a */\n void mo28759a(View view, JSONObject jSONObject, C4212a aVar, boolean z);\n}", "public interface C4697a extends C5595at {\n /* renamed from: a */\n void mo12634a();\n\n /* renamed from: a */\n void mo12635a(String str);\n\n /* renamed from: a */\n void mo12636a(boolean z);\n\n /* renamed from: b */\n void mo12637b();\n\n /* renamed from: c */\n void mo12638c();\n }", "public interface C4773c {\n /* renamed from: a */\n void m15858a(int i);\n\n /* renamed from: a */\n void m15859a(int i, int i2);\n\n /* renamed from: a */\n void m15860a(int i, int i2, int i3);\n\n /* renamed from: b */\n void m15861b(int i, int i2);\n}", "public interface C4869f {\n /* renamed from: a */\n C4865b mo6249a();\n}", "public interface C1799a {\n /* renamed from: b */\n void mo3314b(String str);\n }", "public interface C43499b {\n /* renamed from: a */\n void mo8445a(int i, String str, int i2, byte[] bArr);\n}", "public interface C0601aq {\n /* renamed from: a */\n void mo9148a(int i, ArrayList<C0889x> arrayList);\n}", "public interface C45101e {\n /* renamed from: b */\n void mo3796b(int i);\n}", "public interface AbstractC6461g {\n /* renamed from: a */\n String mo42332a();\n}", "public interface AbstractC1645a {\n /* renamed from: a */\n String mo17375a();\n }", "public interface C6178c {\n /* renamed from: a */\n Map<String, String> mo14888a();\n}", "public interface C5101b {\n /* renamed from: a */\n void mo5289a(C5102c c5102c);\n\n /* renamed from: b */\n void mo5290b(C5102c c5102c);\n}", "public interface C19045k {\n /* renamed from: a */\n void mo50368a(int i, Object obj);\n\n /* renamed from: b */\n void mo50369b(int i, Object obj);\n}", "public b a()\r\n/* 12: */ {\r\n/* 13:13 */ return this.a;\r\n/* 14: */ }", "public interface C7720a {\n /* renamed from: a */\n long mo20406a();\n}", "public String a()\r\n/* 25: */ {\r\n/* 26:171 */ return \"dig.\" + this.a;\r\n/* 27: */ }", "public interface ayt {\n /* renamed from: a */\n int mo1635a(long j, List list);\n\n /* renamed from: a */\n long mo1636a(long j, alb alb);\n\n /* renamed from: a */\n void mo1637a();\n\n /* renamed from: a */\n void mo1638a(long j, long j2, List list, ayp ayp);\n\n /* renamed from: a */\n void mo1639a(ayl ayl);\n\n /* renamed from: a */\n boolean mo1640a(ayl ayl, boolean z, Exception exc, long j);\n}", "public interface C24221b extends C28343z<C28318an> {\n /* renamed from: a */\n void mo62991a(int i);\n\n String aw_();\n\n /* renamed from: e */\n Aweme mo62993e();\n}", "public interface C4051c {\n /* renamed from: a */\n boolean mo23707a();\n}", "public interface C45112b {\n /* renamed from: a */\n List<C45111a> mo107674a(Integer num);\n\n /* renamed from: a */\n List<C45111a> mo107675a(Integer num, Integer num2);\n\n /* renamed from: a */\n void mo107676a(C45111a aVar);\n\n /* renamed from: b */\n void mo107677b(Integer num);\n\n /* renamed from: c */\n long mo107678c(Integer num);\n}", "public void acionou(int a){\n\t\t\tb=a;\n\t\t}", "public interface C44963i {\n /* renamed from: a */\n void mo63037a(int i, int i2);\n\n void aA_();\n\n /* renamed from: b */\n void mo63039b(int i, int i2);\n}", "public interface C32457c<T> {\n /* renamed from: a */\n void mo83699a(T t, int i, int i2, String str);\n }", "public interface C5861g {\n /* renamed from: a */\n void mo18320a(C7251a aVar);\n\n @Deprecated\n /* renamed from: a */\n void mo18321a(C7251a aVar, String str);\n\n /* renamed from: a */\n void mo18322a(C7252b bVar);\n\n /* renamed from: a */\n void mo18323a(C7253c cVar);\n\n /* renamed from: a */\n void mo18324a(C7260j jVar);\n}", "public interface C0937a {\n /* renamed from: a */\n void mo3807a(C0985po[] poVarArr);\n }", "public interface C8466a {\n /* renamed from: a */\n void mo25956a(int i);\n\n /* renamed from: a */\n void mo25957a(long j, long j2);\n }", "public interface C39684b {\n /* renamed from: a */\n void mo98969a();\n\n /* renamed from: a */\n void mo98970a(C29296g gVar);\n\n /* renamed from: a */\n void mo98971a(C29296g gVar, int i);\n }", "public interface C43470b {\n /* renamed from: a */\n void mo61496a(C43469a aVar, C43471c cVar);\n }", "public interface AbstractC18255a {\n /* renamed from: a */\n void mo88521a();\n\n /* renamed from: a */\n void mo88522a(String str);\n\n /* renamed from: b */\n void mo88523b();\n\n /* renamed from: c */\n void mo88524c();\n }", "public interface C1436d {\n /* renamed from: a */\n C1435c mo1754a(C1433a c1433a, C1434b c1434b);\n}", "public interface C4150sl {\n /* renamed from: a */\n void mo15005a(C4143se seVar);\n}", "public void a(nm paramnm)\r\n/* 28: */ {\r\n/* 29:45 */ paramnm.a(this);\r\n/* 30: */ }", "public interface C19351a {\n /* renamed from: b */\n void mo30633b(int i, String str, byte[] bArr);\n }", "public interface C11113o {\n /* renamed from: a */\n void mo37759a(String str);\n }", "public interface C39504az {\n /* renamed from: a */\n int mo98207a();\n\n /* renamed from: a */\n void mo98208a(boolean z);\n\n /* renamed from: b */\n int mo98209b();\n\n /* renamed from: c */\n int mo98355c();\n\n /* renamed from: d */\n int mo98356d();\n\n /* renamed from: e */\n int mo98357e();\n\n /* renamed from: f */\n int mo98358f();\n}", "protected a<T> a(Tag.e<T> var0) {\n/* 80 */ Tag.a var1 = b(var0);\n/* 81 */ return new a<>(var1, this.c, \"vanilla\");\n/* */ }", "public interface C35565a {\n /* renamed from: a */\n C45321i mo90380a();\n }", "public interface C21298a {\n /* renamed from: a */\n void mo57275a();\n\n /* renamed from: a */\n void mo57276a(Exception exc);\n\n /* renamed from: b */\n void mo57277b();\n\n /* renamed from: c */\n void mo57278c();\n }", "public interface C40108b {\n /* renamed from: a */\n void mo99838a(boolean z);\n }", "public interface C0456a {\n /* renamed from: a */\n void mo2090a(C0455b bVar);\n\n /* renamed from: a */\n boolean mo2091a(C0455b bVar, Menu menu);\n\n /* renamed from: a */\n boolean mo2092a(C0455b bVar, MenuItem menuItem);\n\n /* renamed from: b */\n boolean mo2093b(C0455b bVar, Menu menu);\n }", "public interface C4724o {\n /* renamed from: a */\n void mo4872a(int i, String str);\n\n /* renamed from: a */\n void mo4873a(C4718l c4718l);\n\n /* renamed from: b */\n void mo4874b(C4718l c4718l);\n}", "public interface C7654b {\n /* renamed from: a */\n C7904c mo24084a();\n\n /* renamed from: b */\n C7716a mo24085b();\n }", "public interface C2603a {\n /* renamed from: a */\n String mo1889a(String str, String str2, String str3, String str4);\n }", "public interface afp {\n /* renamed from: a */\n C0512sx mo169a(C0497si siVar, afj afj, afr afr, Context context);\n}", "public interface C0615ja extends b<HomeFragment> {\n\n /* renamed from: c.c.a.h.b.ja$a */\n /* compiled from: FragmentModule_HomeFragment$app_bazaarRelease */\n public static abstract class a extends b.a<HomeFragment> {\n }\n}", "public interface a {\n\n /* renamed from: c.b.a.c.b.b.a$a reason: collision with other inner class name */\n /* compiled from: DiskCache */\n public interface C0054a {\n a build();\n }\n\n /* compiled from: DiskCache */\n public interface b {\n boolean a(File file);\n }\n\n File a(c cVar);\n\n void a(c cVar, b bVar);\n}", "public interface C0940d {\n /* renamed from: a */\n void mo3305a(boolean z);\n }", "public interface AbstractC17368c {\n /* renamed from: a */\n void mo84656a(float f);\n }", "interface C0932a {\n /* renamed from: a */\n void mo7438a(int i, int i2);\n\n /* renamed from: b */\n void mo7439b(C0933b bVar);\n\n /* renamed from: c */\n void mo7440c(int i, int i2, Object obj);\n\n /* renamed from: d */\n void mo7441d(C0933b bVar);\n\n /* renamed from: e */\n RecyclerView.ViewHolder mo7442e(int i);\n\n /* renamed from: f */\n void mo7443f(int i, int i2);\n\n /* renamed from: g */\n void mo7444g(int i, int i2);\n\n /* renamed from: h */\n void mo7445h(int i, int i2);\n }", "public interface C10330c {\n /* renamed from: a */\n C7562b<C10403b, C10328a> mo25041a();\n}", "public interface C3819a {\n /* renamed from: a */\n void mo23214a(Message message);\n }", "private Proof atoAImpl(Expression a) {\n Proof where = axm2(a, arrow(a, a), a); //a->(a->a) -> (a->(a->a)->a) -> (a -> a)\n Proof one = axm1(a, a); //a->a->a\n Proof two = axm1(a, arrow(a, a)); //a->(a->a)->A\n return mpTwice(where, one, two);\n }", "interface C1939a {\n /* renamed from: a */\n Bitmap mo1406a(Bitmap bitmap, float f);\n}", "public interface a extends com.bankeen.d.b.b.a {\n void a();\n\n void b();\n }", "public b[] a() {\n/* 95 */ return this.a;\n/* */ }", "interface C8361a {\n /* renamed from: b */\n float mo18284b(ViewGroup viewGroup, View view);\n\n /* renamed from: c */\n float mo18281c(ViewGroup viewGroup, View view);\n }" ]
[ "0.62497115", "0.6242887", "0.61394435", "0.61176854", "0.6114027", "0.60893", "0.6046901", "0.6024682", "0.60201293", "0.5975212", "0.59482527", "0.59121317", "0.5883635", "0.587841", "0.58703005", "0.5868436", "0.5864884", "0.5857492", "0.58306104", "0.5827752", "0.58272064", "0.5794689", "0.57890314", "0.57838726", "0.5775679", "0.57694733", "0.5769128", "0.57526815", "0.56907034", "0.5677874", "0.5670547", "0.56666386", "0.56592244", "0.5658682", "0.56574154", "0.5654324", "0.5644676", "0.56399715", "0.5638734", "0.5630582", "0.56183887", "0.5615435", "0.56069666", "0.5605207", "0.56005067", "0.559501", "0.55910283", "0.5590222", "0.55736613", "0.5556682", "0.5554544", "0.5550076", "0.55493855", "0.55446684", "0.5538079", "0.5529058", "0.5528109", "0.552641", "0.5525864", "0.552186", "0.5519972", "0.5509587", "0.5507195", "0.54881203", "0.5485328", "0.54826045", "0.5482066", "0.5481586", "0.5479751", "0.54776895", "0.54671466", "0.5463307", "0.54505056", "0.54436916", "0.5440517", "0.5439747", "0.5431944", "0.5422869", "0.54217863", "0.5417556", "0.5403905", "0.5400223", "0.53998446", "0.5394735", "0.5388649", "0.5388258", "0.5374842", "0.5368887", "0.53591394", "0.5357029", "0.5355688", "0.535506", "0.5355034", "0.53494394", "0.5341044", "0.5326166", "0.53236824", "0.53199095", "0.53177035", "0.53112453", "0.5298229" ]
0.0
-1
/ renamed from: a
private void m385a(Player player) { try { player.stop(); player.deallocate(); player.close(); if (player == this.f337a) { this.f336a = -1; } } catch (Exception e) { } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public interface C4521a {\n /* renamed from: a */\n void mo12348a();\n }", "public interface C1423a {\n /* renamed from: a */\n void mo6888a(int i);\n }", "interface bxc {\n /* renamed from: a */\n void mo2508a(bxb bxb);\n}", "interface C33292a {\n /* renamed from: a */\n void mo85415a(String str);\n }", "interface C10331b {\n /* renamed from: a */\n void mo26876a(int i);\n }", "public interface C0779a {\n /* renamed from: a */\n void mo2311a();\n}", "public interface C6788a {\n /* renamed from: a */\n void mo20141a();\n }", "public interface C0237a {\n /* renamed from: a */\n void mo1791a(String str);\n }", "public interface C35013b {\n /* renamed from: a */\n void mo88773a(int i);\n}", "public interface C11112n {\n /* renamed from: a */\n void mo38026a();\n }", "@Override\n\t\t\t\tpublic void a() {\n\n\t\t\t\t}", "public interface C23407b {\n /* renamed from: a */\n void mo60892a();\n\n /* renamed from: b */\n void mo60893b();\n }", "interface C0312e {\n /* renamed from: a */\n void mo4671a(View view, int i, int i2, int i3, int i4);\n }", "public interface C34379a {\n /* renamed from: a */\n void mo46242a(bmc bmc);\n }", "public interface C32456b<T> {\n /* renamed from: a */\n void mo83696a(T t);\n }", "private String convertir(String a) {\n StringBuilder atributo = new StringBuilder(a);\n atributo.insert(0, Character.toUpperCase(atributo.charAt(0)));\n return atributo.deleteCharAt(1).toString();\n }", "protected m a(String name) {\n/* 42 */ return this.a.get(name);\n/* */ }", "public interface AbstractC23925a {\n /* renamed from: a */\n void mo105476a();\n }", "private interface C0257a {\n /* renamed from: a */\n float mo196a(ViewGroup viewGroup, View view);\n\n /* renamed from: b */\n float mo195b(ViewGroup viewGroup, View view);\n }", "public interface C3598a {\n /* renamed from: a */\n void mo11024a(int i, int i2, String str);\n }", "public interface C2459d {\n /* renamed from: a */\n C2451d mo3408a(C2457e c2457e);\n}", "public interface am extends ak {\r\n /* renamed from: a */\r\n void mo194a(int i) throws RemoteException;\r\n\r\n /* renamed from: a */\r\n void mo195a(List<LatLng> list) throws RemoteException;\r\n\r\n /* renamed from: b */\r\n void mo196b(float f) throws RemoteException;\r\n\r\n /* renamed from: b */\r\n void mo197b(boolean z);\r\n\r\n /* renamed from: c */\r\n void mo198c(boolean z) throws RemoteException;\r\n\r\n /* renamed from: g */\r\n float mo199g() throws RemoteException;\r\n\r\n /* renamed from: h */\r\n int mo200h() throws RemoteException;\r\n\r\n /* renamed from: i */\r\n List<LatLng> mo201i() throws RemoteException;\r\n\r\n /* renamed from: j */\r\n boolean mo202j();\r\n\r\n /* renamed from: k */\r\n boolean mo203k();\r\n}", "public interface C32459e<T> {\n /* renamed from: a */\n void mo83698a(T t);\n }", "public interface C32458d<T> {\n /* renamed from: a */\n void mo83695a(T t);\n }", "public interface C5482b {\n /* renamed from: a */\n void mo27575a();\n\n /* renamed from: a */\n void mo27576a(int i);\n }", "public interface C27084a {\n /* renamed from: a */\n void mo69874a();\n\n /* renamed from: a */\n void mo69875a(List<Aweme> list, boolean z);\n }", "public void a() {\n ((a) this.a).a();\n }", "public interface C1153a {\n /* renamed from: a */\n void mo4520a(byte[] bArr);\n }", "public interface C13373b {\n /* renamed from: a */\n void mo32681a(String str, int i, boolean z);\n}", "public interface C40453c {\n /* renamed from: a */\n void mo100442a(C40429b bVar);\n\n /* renamed from: a */\n void mo100443a(List<String> list);\n\n /* renamed from: b */\n void mo100444b(List<C40429b> list);\n}", "public interface AbstractC17367b {\n /* renamed from: a */\n void mo84655a();\n }", "@Override\r\n\tpublic void a() {\n\t\t\r\n\t}", "public interface C43270a {\n /* renamed from: a */\n void mo64942a(String str, long j, long j2);\n}", "public interface C18928d {\n /* renamed from: a */\n void mo50320a(C18924b bVar);\n\n /* renamed from: b */\n void mo50321b(C18924b bVar);\n}", "public interface C0087c {\n /* renamed from: a */\n String mo150a(String str);\n}", "public interface C1529m {\n /* renamed from: a */\n void mo3767a(int i);\n\n /* renamed from: a */\n void mo3768a(String str);\n}", "interface C4483e {\n /* renamed from: a */\n boolean mo34114a();\n}", "public interface C1234b {\r\n /* renamed from: a */\r\n void m8367a();\r\n\r\n /* renamed from: b */\r\n void m8368b();\r\n}", "public interface C10965j<T> {\n /* renamed from: a */\n T mo26439a();\n}", "public interface C28772a {\n /* renamed from: a */\n View mo73990a(View view);\n }", "@Override\n\tpublic void a() {\n\t\t\n\t}", "public interface C8326b {\n /* renamed from: a */\n C8325a mo21498a(String str);\n\n /* renamed from: a */\n void mo21499a(C8325a aVar);\n}", "void metodo1(int a, int[] b) {\r\n\t\ta += 5;//Par\\u00e1metro con el mismo nombre que el campo de la clase.\r\n\t\tb[0] += 7;//se produce un env\\u00edo por referencia, apunta a una copia de un objeto, que se asigna aqu\\u00ed.\r\n\t}", "public interface C2367a {\n /* renamed from: a */\n C2368d mo1698a();\n }", "interface C30585a {\n /* renamed from: b */\n void mo27952b(C5379a c5379a, int i, C46650a c46650a, C7620bi c7620bi);\n }", "public interface C4211a {\n\n /* renamed from: com.iab.omid.library.oguryco.c.a$a */\n public interface C4212a {\n /* renamed from: a */\n void mo28760a(View view, C4211a aVar, JSONObject jSONObject);\n }\n\n /* renamed from: a */\n JSONObject mo28758a(View view);\n\n /* renamed from: a */\n void mo28759a(View view, JSONObject jSONObject, C4212a aVar, boolean z);\n}", "public interface C4697a extends C5595at {\n /* renamed from: a */\n void mo12634a();\n\n /* renamed from: a */\n void mo12635a(String str);\n\n /* renamed from: a */\n void mo12636a(boolean z);\n\n /* renamed from: b */\n void mo12637b();\n\n /* renamed from: c */\n void mo12638c();\n }", "public interface C4773c {\n /* renamed from: a */\n void m15858a(int i);\n\n /* renamed from: a */\n void m15859a(int i, int i2);\n\n /* renamed from: a */\n void m15860a(int i, int i2, int i3);\n\n /* renamed from: b */\n void m15861b(int i, int i2);\n}", "public interface C4869f {\n /* renamed from: a */\n C4865b mo6249a();\n}", "public interface C1799a {\n /* renamed from: b */\n void mo3314b(String str);\n }", "public interface C43499b {\n /* renamed from: a */\n void mo8445a(int i, String str, int i2, byte[] bArr);\n}", "public interface C0601aq {\n /* renamed from: a */\n void mo9148a(int i, ArrayList<C0889x> arrayList);\n}", "public interface C45101e {\n /* renamed from: b */\n void mo3796b(int i);\n}", "public interface AbstractC6461g {\n /* renamed from: a */\n String mo42332a();\n}", "public interface AbstractC1645a {\n /* renamed from: a */\n String mo17375a();\n }", "public interface C6178c {\n /* renamed from: a */\n Map<String, String> mo14888a();\n}", "public interface C5101b {\n /* renamed from: a */\n void mo5289a(C5102c c5102c);\n\n /* renamed from: b */\n void mo5290b(C5102c c5102c);\n}", "public interface C19045k {\n /* renamed from: a */\n void mo50368a(int i, Object obj);\n\n /* renamed from: b */\n void mo50369b(int i, Object obj);\n}", "public b a()\r\n/* 12: */ {\r\n/* 13:13 */ return this.a;\r\n/* 14: */ }", "public interface C7720a {\n /* renamed from: a */\n long mo20406a();\n}", "public String a()\r\n/* 25: */ {\r\n/* 26:171 */ return \"dig.\" + this.a;\r\n/* 27: */ }", "public interface ayt {\n /* renamed from: a */\n int mo1635a(long j, List list);\n\n /* renamed from: a */\n long mo1636a(long j, alb alb);\n\n /* renamed from: a */\n void mo1637a();\n\n /* renamed from: a */\n void mo1638a(long j, long j2, List list, ayp ayp);\n\n /* renamed from: a */\n void mo1639a(ayl ayl);\n\n /* renamed from: a */\n boolean mo1640a(ayl ayl, boolean z, Exception exc, long j);\n}", "public interface C24221b extends C28343z<C28318an> {\n /* renamed from: a */\n void mo62991a(int i);\n\n String aw_();\n\n /* renamed from: e */\n Aweme mo62993e();\n}", "public interface C4051c {\n /* renamed from: a */\n boolean mo23707a();\n}", "public interface C45112b {\n /* renamed from: a */\n List<C45111a> mo107674a(Integer num);\n\n /* renamed from: a */\n List<C45111a> mo107675a(Integer num, Integer num2);\n\n /* renamed from: a */\n void mo107676a(C45111a aVar);\n\n /* renamed from: b */\n void mo107677b(Integer num);\n\n /* renamed from: c */\n long mo107678c(Integer num);\n}", "public void acionou(int a){\n\t\t\tb=a;\n\t\t}", "public interface C44963i {\n /* renamed from: a */\n void mo63037a(int i, int i2);\n\n void aA_();\n\n /* renamed from: b */\n void mo63039b(int i, int i2);\n}", "public interface C32457c<T> {\n /* renamed from: a */\n void mo83699a(T t, int i, int i2, String str);\n }", "public interface C5861g {\n /* renamed from: a */\n void mo18320a(C7251a aVar);\n\n @Deprecated\n /* renamed from: a */\n void mo18321a(C7251a aVar, String str);\n\n /* renamed from: a */\n void mo18322a(C7252b bVar);\n\n /* renamed from: a */\n void mo18323a(C7253c cVar);\n\n /* renamed from: a */\n void mo18324a(C7260j jVar);\n}", "public interface C0937a {\n /* renamed from: a */\n void mo3807a(C0985po[] poVarArr);\n }", "public interface C8466a {\n /* renamed from: a */\n void mo25956a(int i);\n\n /* renamed from: a */\n void mo25957a(long j, long j2);\n }", "public interface C39684b {\n /* renamed from: a */\n void mo98969a();\n\n /* renamed from: a */\n void mo98970a(C29296g gVar);\n\n /* renamed from: a */\n void mo98971a(C29296g gVar, int i);\n }", "public interface C43470b {\n /* renamed from: a */\n void mo61496a(C43469a aVar, C43471c cVar);\n }", "public interface AbstractC18255a {\n /* renamed from: a */\n void mo88521a();\n\n /* renamed from: a */\n void mo88522a(String str);\n\n /* renamed from: b */\n void mo88523b();\n\n /* renamed from: c */\n void mo88524c();\n }", "public interface C1436d {\n /* renamed from: a */\n C1435c mo1754a(C1433a c1433a, C1434b c1434b);\n}", "public interface C4150sl {\n /* renamed from: a */\n void mo15005a(C4143se seVar);\n}", "public void a(nm paramnm)\r\n/* 28: */ {\r\n/* 29:45 */ paramnm.a(this);\r\n/* 30: */ }", "public interface C19351a {\n /* renamed from: b */\n void mo30633b(int i, String str, byte[] bArr);\n }", "public interface C11113o {\n /* renamed from: a */\n void mo37759a(String str);\n }", "public interface C39504az {\n /* renamed from: a */\n int mo98207a();\n\n /* renamed from: a */\n void mo98208a(boolean z);\n\n /* renamed from: b */\n int mo98209b();\n\n /* renamed from: c */\n int mo98355c();\n\n /* renamed from: d */\n int mo98356d();\n\n /* renamed from: e */\n int mo98357e();\n\n /* renamed from: f */\n int mo98358f();\n}", "protected a<T> a(Tag.e<T> var0) {\n/* 80 */ Tag.a var1 = b(var0);\n/* 81 */ return new a<>(var1, this.c, \"vanilla\");\n/* */ }", "public interface C35565a {\n /* renamed from: a */\n C45321i mo90380a();\n }", "public interface C21298a {\n /* renamed from: a */\n void mo57275a();\n\n /* renamed from: a */\n void mo57276a(Exception exc);\n\n /* renamed from: b */\n void mo57277b();\n\n /* renamed from: c */\n void mo57278c();\n }", "public interface C40108b {\n /* renamed from: a */\n void mo99838a(boolean z);\n }", "public interface C0456a {\n /* renamed from: a */\n void mo2090a(C0455b bVar);\n\n /* renamed from: a */\n boolean mo2091a(C0455b bVar, Menu menu);\n\n /* renamed from: a */\n boolean mo2092a(C0455b bVar, MenuItem menuItem);\n\n /* renamed from: b */\n boolean mo2093b(C0455b bVar, Menu menu);\n }", "public interface C4724o {\n /* renamed from: a */\n void mo4872a(int i, String str);\n\n /* renamed from: a */\n void mo4873a(C4718l c4718l);\n\n /* renamed from: b */\n void mo4874b(C4718l c4718l);\n}", "public interface C7654b {\n /* renamed from: a */\n C7904c mo24084a();\n\n /* renamed from: b */\n C7716a mo24085b();\n }", "public interface C2603a {\n /* renamed from: a */\n String mo1889a(String str, String str2, String str3, String str4);\n }", "public interface afp {\n /* renamed from: a */\n C0512sx mo169a(C0497si siVar, afj afj, afr afr, Context context);\n}", "public interface C0615ja extends b<HomeFragment> {\n\n /* renamed from: c.c.a.h.b.ja$a */\n /* compiled from: FragmentModule_HomeFragment$app_bazaarRelease */\n public static abstract class a extends b.a<HomeFragment> {\n }\n}", "public interface a {\n\n /* renamed from: c.b.a.c.b.b.a$a reason: collision with other inner class name */\n /* compiled from: DiskCache */\n public interface C0054a {\n a build();\n }\n\n /* compiled from: DiskCache */\n public interface b {\n boolean a(File file);\n }\n\n File a(c cVar);\n\n void a(c cVar, b bVar);\n}", "public interface C0940d {\n /* renamed from: a */\n void mo3305a(boolean z);\n }", "public interface AbstractC17368c {\n /* renamed from: a */\n void mo84656a(float f);\n }", "interface C0932a {\n /* renamed from: a */\n void mo7438a(int i, int i2);\n\n /* renamed from: b */\n void mo7439b(C0933b bVar);\n\n /* renamed from: c */\n void mo7440c(int i, int i2, Object obj);\n\n /* renamed from: d */\n void mo7441d(C0933b bVar);\n\n /* renamed from: e */\n RecyclerView.ViewHolder mo7442e(int i);\n\n /* renamed from: f */\n void mo7443f(int i, int i2);\n\n /* renamed from: g */\n void mo7444g(int i, int i2);\n\n /* renamed from: h */\n void mo7445h(int i, int i2);\n }", "public interface C10330c {\n /* renamed from: a */\n C7562b<C10403b, C10328a> mo25041a();\n}", "public interface C3819a {\n /* renamed from: a */\n void mo23214a(Message message);\n }", "private Proof atoAImpl(Expression a) {\n Proof where = axm2(a, arrow(a, a), a); //a->(a->a) -> (a->(a->a)->a) -> (a -> a)\n Proof one = axm1(a, a); //a->a->a\n Proof two = axm1(a, arrow(a, a)); //a->(a->a)->A\n return mpTwice(where, one, two);\n }", "interface C1939a {\n /* renamed from: a */\n Bitmap mo1406a(Bitmap bitmap, float f);\n}", "public interface a extends com.bankeen.d.b.b.a {\n void a();\n\n void b();\n }", "public b[] a() {\n/* 95 */ return this.a;\n/* */ }", "interface C8361a {\n /* renamed from: b */\n float mo18284b(ViewGroup viewGroup, View view);\n\n /* renamed from: c */\n float mo18281c(ViewGroup viewGroup, View view);\n }" ]
[ "0.62497115", "0.6242887", "0.61394435", "0.61176854", "0.6114027", "0.60893", "0.6046901", "0.6024682", "0.60201293", "0.5975212", "0.59482527", "0.59121317", "0.5883635", "0.587841", "0.58703005", "0.5868436", "0.5864884", "0.5857492", "0.58306104", "0.5827752", "0.58272064", "0.5794689", "0.57890314", "0.57838726", "0.5775679", "0.57694733", "0.5769128", "0.57526815", "0.56907034", "0.5677874", "0.5670547", "0.56666386", "0.56592244", "0.5658682", "0.56574154", "0.5654324", "0.5644676", "0.56399715", "0.5638734", "0.5630582", "0.56183887", "0.5615435", "0.56069666", "0.5605207", "0.56005067", "0.559501", "0.55910283", "0.5590222", "0.55736613", "0.5556682", "0.5554544", "0.5550076", "0.55493855", "0.55446684", "0.5538079", "0.5529058", "0.5528109", "0.552641", "0.5525864", "0.552186", "0.5519972", "0.5509587", "0.5507195", "0.54881203", "0.5485328", "0.54826045", "0.5482066", "0.5481586", "0.5479751", "0.54776895", "0.54671466", "0.5463307", "0.54505056", "0.54436916", "0.5440517", "0.5439747", "0.5431944", "0.5422869", "0.54217863", "0.5417556", "0.5403905", "0.5400223", "0.53998446", "0.5394735", "0.5388649", "0.5388258", "0.5374842", "0.5368887", "0.53591394", "0.5357029", "0.5355688", "0.535506", "0.5355034", "0.53494394", "0.5341044", "0.5326166", "0.53236824", "0.53199095", "0.53177035", "0.53112453", "0.5298229" ]
0.0
-1
/ renamed from: a
public static boolean mo101a() { return f335b != 0; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public interface C4521a {\n /* renamed from: a */\n void mo12348a();\n }", "public interface C1423a {\n /* renamed from: a */\n void mo6888a(int i);\n }", "interface bxc {\n /* renamed from: a */\n void mo2508a(bxb bxb);\n}", "interface C33292a {\n /* renamed from: a */\n void mo85415a(String str);\n }", "interface C10331b {\n /* renamed from: a */\n void mo26876a(int i);\n }", "public interface C0779a {\n /* renamed from: a */\n void mo2311a();\n}", "public interface C6788a {\n /* renamed from: a */\n void mo20141a();\n }", "public interface C0237a {\n /* renamed from: a */\n void mo1791a(String str);\n }", "public interface C35013b {\n /* renamed from: a */\n void mo88773a(int i);\n}", "public interface C11112n {\n /* renamed from: a */\n void mo38026a();\n }", "@Override\n\t\t\t\tpublic void a() {\n\n\t\t\t\t}", "public interface C23407b {\n /* renamed from: a */\n void mo60892a();\n\n /* renamed from: b */\n void mo60893b();\n }", "interface C0312e {\n /* renamed from: a */\n void mo4671a(View view, int i, int i2, int i3, int i4);\n }", "public interface C34379a {\n /* renamed from: a */\n void mo46242a(bmc bmc);\n }", "public interface C32456b<T> {\n /* renamed from: a */\n void mo83696a(T t);\n }", "private String convertir(String a) {\n StringBuilder atributo = new StringBuilder(a);\n atributo.insert(0, Character.toUpperCase(atributo.charAt(0)));\n return atributo.deleteCharAt(1).toString();\n }", "protected m a(String name) {\n/* 42 */ return this.a.get(name);\n/* */ }", "public interface AbstractC23925a {\n /* renamed from: a */\n void mo105476a();\n }", "private interface C0257a {\n /* renamed from: a */\n float mo196a(ViewGroup viewGroup, View view);\n\n /* renamed from: b */\n float mo195b(ViewGroup viewGroup, View view);\n }", "public interface C3598a {\n /* renamed from: a */\n void mo11024a(int i, int i2, String str);\n }", "public interface C2459d {\n /* renamed from: a */\n C2451d mo3408a(C2457e c2457e);\n}", "public interface am extends ak {\r\n /* renamed from: a */\r\n void mo194a(int i) throws RemoteException;\r\n\r\n /* renamed from: a */\r\n void mo195a(List<LatLng> list) throws RemoteException;\r\n\r\n /* renamed from: b */\r\n void mo196b(float f) throws RemoteException;\r\n\r\n /* renamed from: b */\r\n void mo197b(boolean z);\r\n\r\n /* renamed from: c */\r\n void mo198c(boolean z) throws RemoteException;\r\n\r\n /* renamed from: g */\r\n float mo199g() throws RemoteException;\r\n\r\n /* renamed from: h */\r\n int mo200h() throws RemoteException;\r\n\r\n /* renamed from: i */\r\n List<LatLng> mo201i() throws RemoteException;\r\n\r\n /* renamed from: j */\r\n boolean mo202j();\r\n\r\n /* renamed from: k */\r\n boolean mo203k();\r\n}", "public interface C32459e<T> {\n /* renamed from: a */\n void mo83698a(T t);\n }", "public interface C32458d<T> {\n /* renamed from: a */\n void mo83695a(T t);\n }", "public interface C5482b {\n /* renamed from: a */\n void mo27575a();\n\n /* renamed from: a */\n void mo27576a(int i);\n }", "public interface C27084a {\n /* renamed from: a */\n void mo69874a();\n\n /* renamed from: a */\n void mo69875a(List<Aweme> list, boolean z);\n }", "public void a() {\n ((a) this.a).a();\n }", "public interface C1153a {\n /* renamed from: a */\n void mo4520a(byte[] bArr);\n }", "public interface C13373b {\n /* renamed from: a */\n void mo32681a(String str, int i, boolean z);\n}", "public interface C40453c {\n /* renamed from: a */\n void mo100442a(C40429b bVar);\n\n /* renamed from: a */\n void mo100443a(List<String> list);\n\n /* renamed from: b */\n void mo100444b(List<C40429b> list);\n}", "public interface AbstractC17367b {\n /* renamed from: a */\n void mo84655a();\n }", "@Override\r\n\tpublic void a() {\n\t\t\r\n\t}", "public interface C43270a {\n /* renamed from: a */\n void mo64942a(String str, long j, long j2);\n}", "public interface C18928d {\n /* renamed from: a */\n void mo50320a(C18924b bVar);\n\n /* renamed from: b */\n void mo50321b(C18924b bVar);\n}", "public interface C0087c {\n /* renamed from: a */\n String mo150a(String str);\n}", "public interface C1529m {\n /* renamed from: a */\n void mo3767a(int i);\n\n /* renamed from: a */\n void mo3768a(String str);\n}", "interface C4483e {\n /* renamed from: a */\n boolean mo34114a();\n}", "public interface C1234b {\r\n /* renamed from: a */\r\n void m8367a();\r\n\r\n /* renamed from: b */\r\n void m8368b();\r\n}", "public interface C10965j<T> {\n /* renamed from: a */\n T mo26439a();\n}", "public interface C28772a {\n /* renamed from: a */\n View mo73990a(View view);\n }", "@Override\n\tpublic void a() {\n\t\t\n\t}", "public interface C8326b {\n /* renamed from: a */\n C8325a mo21498a(String str);\n\n /* renamed from: a */\n void mo21499a(C8325a aVar);\n}", "void metodo1(int a, int[] b) {\r\n\t\ta += 5;//Par\\u00e1metro con el mismo nombre que el campo de la clase.\r\n\t\tb[0] += 7;//se produce un env\\u00edo por referencia, apunta a una copia de un objeto, que se asigna aqu\\u00ed.\r\n\t}", "public interface C2367a {\n /* renamed from: a */\n C2368d mo1698a();\n }", "interface C30585a {\n /* renamed from: b */\n void mo27952b(C5379a c5379a, int i, C46650a c46650a, C7620bi c7620bi);\n }", "public interface C4211a {\n\n /* renamed from: com.iab.omid.library.oguryco.c.a$a */\n public interface C4212a {\n /* renamed from: a */\n void mo28760a(View view, C4211a aVar, JSONObject jSONObject);\n }\n\n /* renamed from: a */\n JSONObject mo28758a(View view);\n\n /* renamed from: a */\n void mo28759a(View view, JSONObject jSONObject, C4212a aVar, boolean z);\n}", "public interface C4697a extends C5595at {\n /* renamed from: a */\n void mo12634a();\n\n /* renamed from: a */\n void mo12635a(String str);\n\n /* renamed from: a */\n void mo12636a(boolean z);\n\n /* renamed from: b */\n void mo12637b();\n\n /* renamed from: c */\n void mo12638c();\n }", "public interface C4773c {\n /* renamed from: a */\n void m15858a(int i);\n\n /* renamed from: a */\n void m15859a(int i, int i2);\n\n /* renamed from: a */\n void m15860a(int i, int i2, int i3);\n\n /* renamed from: b */\n void m15861b(int i, int i2);\n}", "public interface C4869f {\n /* renamed from: a */\n C4865b mo6249a();\n}", "public interface C1799a {\n /* renamed from: b */\n void mo3314b(String str);\n }", "public interface C43499b {\n /* renamed from: a */\n void mo8445a(int i, String str, int i2, byte[] bArr);\n}", "public interface C0601aq {\n /* renamed from: a */\n void mo9148a(int i, ArrayList<C0889x> arrayList);\n}", "public interface C45101e {\n /* renamed from: b */\n void mo3796b(int i);\n}", "public interface AbstractC6461g {\n /* renamed from: a */\n String mo42332a();\n}", "public interface AbstractC1645a {\n /* renamed from: a */\n String mo17375a();\n }", "public interface C6178c {\n /* renamed from: a */\n Map<String, String> mo14888a();\n}", "public interface C5101b {\n /* renamed from: a */\n void mo5289a(C5102c c5102c);\n\n /* renamed from: b */\n void mo5290b(C5102c c5102c);\n}", "public interface C19045k {\n /* renamed from: a */\n void mo50368a(int i, Object obj);\n\n /* renamed from: b */\n void mo50369b(int i, Object obj);\n}", "public b a()\r\n/* 12: */ {\r\n/* 13:13 */ return this.a;\r\n/* 14: */ }", "public interface C7720a {\n /* renamed from: a */\n long mo20406a();\n}", "public String a()\r\n/* 25: */ {\r\n/* 26:171 */ return \"dig.\" + this.a;\r\n/* 27: */ }", "public interface ayt {\n /* renamed from: a */\n int mo1635a(long j, List list);\n\n /* renamed from: a */\n long mo1636a(long j, alb alb);\n\n /* renamed from: a */\n void mo1637a();\n\n /* renamed from: a */\n void mo1638a(long j, long j2, List list, ayp ayp);\n\n /* renamed from: a */\n void mo1639a(ayl ayl);\n\n /* renamed from: a */\n boolean mo1640a(ayl ayl, boolean z, Exception exc, long j);\n}", "public interface C24221b extends C28343z<C28318an> {\n /* renamed from: a */\n void mo62991a(int i);\n\n String aw_();\n\n /* renamed from: e */\n Aweme mo62993e();\n}", "public interface C4051c {\n /* renamed from: a */\n boolean mo23707a();\n}", "public interface C45112b {\n /* renamed from: a */\n List<C45111a> mo107674a(Integer num);\n\n /* renamed from: a */\n List<C45111a> mo107675a(Integer num, Integer num2);\n\n /* renamed from: a */\n void mo107676a(C45111a aVar);\n\n /* renamed from: b */\n void mo107677b(Integer num);\n\n /* renamed from: c */\n long mo107678c(Integer num);\n}", "public void acionou(int a){\n\t\t\tb=a;\n\t\t}", "public interface C44963i {\n /* renamed from: a */\n void mo63037a(int i, int i2);\n\n void aA_();\n\n /* renamed from: b */\n void mo63039b(int i, int i2);\n}", "public interface C32457c<T> {\n /* renamed from: a */\n void mo83699a(T t, int i, int i2, String str);\n }", "public interface C5861g {\n /* renamed from: a */\n void mo18320a(C7251a aVar);\n\n @Deprecated\n /* renamed from: a */\n void mo18321a(C7251a aVar, String str);\n\n /* renamed from: a */\n void mo18322a(C7252b bVar);\n\n /* renamed from: a */\n void mo18323a(C7253c cVar);\n\n /* renamed from: a */\n void mo18324a(C7260j jVar);\n}", "public interface C0937a {\n /* renamed from: a */\n void mo3807a(C0985po[] poVarArr);\n }", "public interface C8466a {\n /* renamed from: a */\n void mo25956a(int i);\n\n /* renamed from: a */\n void mo25957a(long j, long j2);\n }", "public interface C39684b {\n /* renamed from: a */\n void mo98969a();\n\n /* renamed from: a */\n void mo98970a(C29296g gVar);\n\n /* renamed from: a */\n void mo98971a(C29296g gVar, int i);\n }", "public interface C43470b {\n /* renamed from: a */\n void mo61496a(C43469a aVar, C43471c cVar);\n }", "public interface AbstractC18255a {\n /* renamed from: a */\n void mo88521a();\n\n /* renamed from: a */\n void mo88522a(String str);\n\n /* renamed from: b */\n void mo88523b();\n\n /* renamed from: c */\n void mo88524c();\n }", "public interface C1436d {\n /* renamed from: a */\n C1435c mo1754a(C1433a c1433a, C1434b c1434b);\n}", "public interface C4150sl {\n /* renamed from: a */\n void mo15005a(C4143se seVar);\n}", "public void a(nm paramnm)\r\n/* 28: */ {\r\n/* 29:45 */ paramnm.a(this);\r\n/* 30: */ }", "public interface C19351a {\n /* renamed from: b */\n void mo30633b(int i, String str, byte[] bArr);\n }", "public interface C11113o {\n /* renamed from: a */\n void mo37759a(String str);\n }", "public interface C39504az {\n /* renamed from: a */\n int mo98207a();\n\n /* renamed from: a */\n void mo98208a(boolean z);\n\n /* renamed from: b */\n int mo98209b();\n\n /* renamed from: c */\n int mo98355c();\n\n /* renamed from: d */\n int mo98356d();\n\n /* renamed from: e */\n int mo98357e();\n\n /* renamed from: f */\n int mo98358f();\n}", "protected a<T> a(Tag.e<T> var0) {\n/* 80 */ Tag.a var1 = b(var0);\n/* 81 */ return new a<>(var1, this.c, \"vanilla\");\n/* */ }", "public interface C35565a {\n /* renamed from: a */\n C45321i mo90380a();\n }", "public interface C21298a {\n /* renamed from: a */\n void mo57275a();\n\n /* renamed from: a */\n void mo57276a(Exception exc);\n\n /* renamed from: b */\n void mo57277b();\n\n /* renamed from: c */\n void mo57278c();\n }", "public interface C40108b {\n /* renamed from: a */\n void mo99838a(boolean z);\n }", "public interface C0456a {\n /* renamed from: a */\n void mo2090a(C0455b bVar);\n\n /* renamed from: a */\n boolean mo2091a(C0455b bVar, Menu menu);\n\n /* renamed from: a */\n boolean mo2092a(C0455b bVar, MenuItem menuItem);\n\n /* renamed from: b */\n boolean mo2093b(C0455b bVar, Menu menu);\n }", "public interface C4724o {\n /* renamed from: a */\n void mo4872a(int i, String str);\n\n /* renamed from: a */\n void mo4873a(C4718l c4718l);\n\n /* renamed from: b */\n void mo4874b(C4718l c4718l);\n}", "public interface C7654b {\n /* renamed from: a */\n C7904c mo24084a();\n\n /* renamed from: b */\n C7716a mo24085b();\n }", "public interface C2603a {\n /* renamed from: a */\n String mo1889a(String str, String str2, String str3, String str4);\n }", "public interface afp {\n /* renamed from: a */\n C0512sx mo169a(C0497si siVar, afj afj, afr afr, Context context);\n}", "public interface C0615ja extends b<HomeFragment> {\n\n /* renamed from: c.c.a.h.b.ja$a */\n /* compiled from: FragmentModule_HomeFragment$app_bazaarRelease */\n public static abstract class a extends b.a<HomeFragment> {\n }\n}", "public interface a {\n\n /* renamed from: c.b.a.c.b.b.a$a reason: collision with other inner class name */\n /* compiled from: DiskCache */\n public interface C0054a {\n a build();\n }\n\n /* compiled from: DiskCache */\n public interface b {\n boolean a(File file);\n }\n\n File a(c cVar);\n\n void a(c cVar, b bVar);\n}", "public interface C0940d {\n /* renamed from: a */\n void mo3305a(boolean z);\n }", "public interface AbstractC17368c {\n /* renamed from: a */\n void mo84656a(float f);\n }", "interface C0932a {\n /* renamed from: a */\n void mo7438a(int i, int i2);\n\n /* renamed from: b */\n void mo7439b(C0933b bVar);\n\n /* renamed from: c */\n void mo7440c(int i, int i2, Object obj);\n\n /* renamed from: d */\n void mo7441d(C0933b bVar);\n\n /* renamed from: e */\n RecyclerView.ViewHolder mo7442e(int i);\n\n /* renamed from: f */\n void mo7443f(int i, int i2);\n\n /* renamed from: g */\n void mo7444g(int i, int i2);\n\n /* renamed from: h */\n void mo7445h(int i, int i2);\n }", "public interface C10330c {\n /* renamed from: a */\n C7562b<C10403b, C10328a> mo25041a();\n}", "public interface C3819a {\n /* renamed from: a */\n void mo23214a(Message message);\n }", "private Proof atoAImpl(Expression a) {\n Proof where = axm2(a, arrow(a, a), a); //a->(a->a) -> (a->(a->a)->a) -> (a -> a)\n Proof one = axm1(a, a); //a->a->a\n Proof two = axm1(a, arrow(a, a)); //a->(a->a)->A\n return mpTwice(where, one, two);\n }", "interface C1939a {\n /* renamed from: a */\n Bitmap mo1406a(Bitmap bitmap, float f);\n}", "public interface a extends com.bankeen.d.b.b.a {\n void a();\n\n void b();\n }", "public b[] a() {\n/* 95 */ return this.a;\n/* */ }", "interface C8361a {\n /* renamed from: b */\n float mo18284b(ViewGroup viewGroup, View view);\n\n /* renamed from: c */\n float mo18281c(ViewGroup viewGroup, View view);\n }" ]
[ "0.62497115", "0.6242887", "0.61394435", "0.61176854", "0.6114027", "0.60893", "0.6046901", "0.6024682", "0.60201293", "0.5975212", "0.59482527", "0.59121317", "0.5883635", "0.587841", "0.58703005", "0.5868436", "0.5864884", "0.5857492", "0.58306104", "0.5827752", "0.58272064", "0.5794689", "0.57890314", "0.57838726", "0.5775679", "0.57694733", "0.5769128", "0.57526815", "0.56907034", "0.5677874", "0.5670547", "0.56666386", "0.56592244", "0.5658682", "0.56574154", "0.5654324", "0.5644676", "0.56399715", "0.5638734", "0.5630582", "0.56183887", "0.5615435", "0.56069666", "0.5605207", "0.56005067", "0.559501", "0.55910283", "0.5590222", "0.55736613", "0.5556682", "0.5554544", "0.5550076", "0.55493855", "0.55446684", "0.5538079", "0.5529058", "0.5528109", "0.552641", "0.5525864", "0.552186", "0.5519972", "0.5509587", "0.5507195", "0.54881203", "0.5485328", "0.54826045", "0.5482066", "0.5481586", "0.5479751", "0.54776895", "0.54671466", "0.5463307", "0.54505056", "0.54436916", "0.5440517", "0.5439747", "0.5431944", "0.5422869", "0.54217863", "0.5417556", "0.5403905", "0.5400223", "0.53998446", "0.5394735", "0.5388649", "0.5388258", "0.5374842", "0.5368887", "0.53591394", "0.5357029", "0.5355688", "0.535506", "0.5355034", "0.53494394", "0.5341044", "0.5326166", "0.53236824", "0.53199095", "0.53177035", "0.53112453", "0.5298229" ]
0.0
-1
/ renamed from: a
private boolean mo102a(int i) { switch (i) { case 0: return true; case 1: return this.f340a != null; case 2: return this.f341b != null; case 3: return (this.f341b == null || this.f340a == null) ? false : true; default: return false; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public interface C4521a {\n /* renamed from: a */\n void mo12348a();\n }", "public interface C1423a {\n /* renamed from: a */\n void mo6888a(int i);\n }", "interface bxc {\n /* renamed from: a */\n void mo2508a(bxb bxb);\n}", "interface C33292a {\n /* renamed from: a */\n void mo85415a(String str);\n }", "interface C10331b {\n /* renamed from: a */\n void mo26876a(int i);\n }", "public interface C0779a {\n /* renamed from: a */\n void mo2311a();\n}", "public interface C6788a {\n /* renamed from: a */\n void mo20141a();\n }", "public interface C0237a {\n /* renamed from: a */\n void mo1791a(String str);\n }", "public interface C35013b {\n /* renamed from: a */\n void mo88773a(int i);\n}", "public interface C11112n {\n /* renamed from: a */\n void mo38026a();\n }", "@Override\n\t\t\t\tpublic void a() {\n\n\t\t\t\t}", "public interface C23407b {\n /* renamed from: a */\n void mo60892a();\n\n /* renamed from: b */\n void mo60893b();\n }", "interface C0312e {\n /* renamed from: a */\n void mo4671a(View view, int i, int i2, int i3, int i4);\n }", "public interface C34379a {\n /* renamed from: a */\n void mo46242a(bmc bmc);\n }", "public interface C32456b<T> {\n /* renamed from: a */\n void mo83696a(T t);\n }", "private String convertir(String a) {\n StringBuilder atributo = new StringBuilder(a);\n atributo.insert(0, Character.toUpperCase(atributo.charAt(0)));\n return atributo.deleteCharAt(1).toString();\n }", "protected m a(String name) {\n/* 42 */ return this.a.get(name);\n/* */ }", "public interface AbstractC23925a {\n /* renamed from: a */\n void mo105476a();\n }", "private interface C0257a {\n /* renamed from: a */\n float mo196a(ViewGroup viewGroup, View view);\n\n /* renamed from: b */\n float mo195b(ViewGroup viewGroup, View view);\n }", "public interface C3598a {\n /* renamed from: a */\n void mo11024a(int i, int i2, String str);\n }", "public interface C2459d {\n /* renamed from: a */\n C2451d mo3408a(C2457e c2457e);\n}", "public interface am extends ak {\r\n /* renamed from: a */\r\n void mo194a(int i) throws RemoteException;\r\n\r\n /* renamed from: a */\r\n void mo195a(List<LatLng> list) throws RemoteException;\r\n\r\n /* renamed from: b */\r\n void mo196b(float f) throws RemoteException;\r\n\r\n /* renamed from: b */\r\n void mo197b(boolean z);\r\n\r\n /* renamed from: c */\r\n void mo198c(boolean z) throws RemoteException;\r\n\r\n /* renamed from: g */\r\n float mo199g() throws RemoteException;\r\n\r\n /* renamed from: h */\r\n int mo200h() throws RemoteException;\r\n\r\n /* renamed from: i */\r\n List<LatLng> mo201i() throws RemoteException;\r\n\r\n /* renamed from: j */\r\n boolean mo202j();\r\n\r\n /* renamed from: k */\r\n boolean mo203k();\r\n}", "public interface C32459e<T> {\n /* renamed from: a */\n void mo83698a(T t);\n }", "public interface C32458d<T> {\n /* renamed from: a */\n void mo83695a(T t);\n }", "public interface C5482b {\n /* renamed from: a */\n void mo27575a();\n\n /* renamed from: a */\n void mo27576a(int i);\n }", "public interface C27084a {\n /* renamed from: a */\n void mo69874a();\n\n /* renamed from: a */\n void mo69875a(List<Aweme> list, boolean z);\n }", "public void a() {\n ((a) this.a).a();\n }", "public interface C1153a {\n /* renamed from: a */\n void mo4520a(byte[] bArr);\n }", "public interface C13373b {\n /* renamed from: a */\n void mo32681a(String str, int i, boolean z);\n}", "public interface C40453c {\n /* renamed from: a */\n void mo100442a(C40429b bVar);\n\n /* renamed from: a */\n void mo100443a(List<String> list);\n\n /* renamed from: b */\n void mo100444b(List<C40429b> list);\n}", "public interface AbstractC17367b {\n /* renamed from: a */\n void mo84655a();\n }", "@Override\r\n\tpublic void a() {\n\t\t\r\n\t}", "public interface C43270a {\n /* renamed from: a */\n void mo64942a(String str, long j, long j2);\n}", "public interface C18928d {\n /* renamed from: a */\n void mo50320a(C18924b bVar);\n\n /* renamed from: b */\n void mo50321b(C18924b bVar);\n}", "public interface C0087c {\n /* renamed from: a */\n String mo150a(String str);\n}", "public interface C1529m {\n /* renamed from: a */\n void mo3767a(int i);\n\n /* renamed from: a */\n void mo3768a(String str);\n}", "interface C4483e {\n /* renamed from: a */\n boolean mo34114a();\n}", "public interface C1234b {\r\n /* renamed from: a */\r\n void m8367a();\r\n\r\n /* renamed from: b */\r\n void m8368b();\r\n}", "public interface C10965j<T> {\n /* renamed from: a */\n T mo26439a();\n}", "public interface C28772a {\n /* renamed from: a */\n View mo73990a(View view);\n }", "@Override\n\tpublic void a() {\n\t\t\n\t}", "public interface C8326b {\n /* renamed from: a */\n C8325a mo21498a(String str);\n\n /* renamed from: a */\n void mo21499a(C8325a aVar);\n}", "void metodo1(int a, int[] b) {\r\n\t\ta += 5;//Par\\u00e1metro con el mismo nombre que el campo de la clase.\r\n\t\tb[0] += 7;//se produce un env\\u00edo por referencia, apunta a una copia de un objeto, que se asigna aqu\\u00ed.\r\n\t}", "public interface C2367a {\n /* renamed from: a */\n C2368d mo1698a();\n }", "interface C30585a {\n /* renamed from: b */\n void mo27952b(C5379a c5379a, int i, C46650a c46650a, C7620bi c7620bi);\n }", "public interface C4211a {\n\n /* renamed from: com.iab.omid.library.oguryco.c.a$a */\n public interface C4212a {\n /* renamed from: a */\n void mo28760a(View view, C4211a aVar, JSONObject jSONObject);\n }\n\n /* renamed from: a */\n JSONObject mo28758a(View view);\n\n /* renamed from: a */\n void mo28759a(View view, JSONObject jSONObject, C4212a aVar, boolean z);\n}", "public interface C4697a extends C5595at {\n /* renamed from: a */\n void mo12634a();\n\n /* renamed from: a */\n void mo12635a(String str);\n\n /* renamed from: a */\n void mo12636a(boolean z);\n\n /* renamed from: b */\n void mo12637b();\n\n /* renamed from: c */\n void mo12638c();\n }", "public interface C4773c {\n /* renamed from: a */\n void m15858a(int i);\n\n /* renamed from: a */\n void m15859a(int i, int i2);\n\n /* renamed from: a */\n void m15860a(int i, int i2, int i3);\n\n /* renamed from: b */\n void m15861b(int i, int i2);\n}", "public interface C4869f {\n /* renamed from: a */\n C4865b mo6249a();\n}", "public interface C1799a {\n /* renamed from: b */\n void mo3314b(String str);\n }", "public interface C43499b {\n /* renamed from: a */\n void mo8445a(int i, String str, int i2, byte[] bArr);\n}", "public interface C0601aq {\n /* renamed from: a */\n void mo9148a(int i, ArrayList<C0889x> arrayList);\n}", "public interface C45101e {\n /* renamed from: b */\n void mo3796b(int i);\n}", "public interface AbstractC6461g {\n /* renamed from: a */\n String mo42332a();\n}", "public interface AbstractC1645a {\n /* renamed from: a */\n String mo17375a();\n }", "public interface C6178c {\n /* renamed from: a */\n Map<String, String> mo14888a();\n}", "public interface C5101b {\n /* renamed from: a */\n void mo5289a(C5102c c5102c);\n\n /* renamed from: b */\n void mo5290b(C5102c c5102c);\n}", "public interface C19045k {\n /* renamed from: a */\n void mo50368a(int i, Object obj);\n\n /* renamed from: b */\n void mo50369b(int i, Object obj);\n}", "public b a()\r\n/* 12: */ {\r\n/* 13:13 */ return this.a;\r\n/* 14: */ }", "public interface C7720a {\n /* renamed from: a */\n long mo20406a();\n}", "public String a()\r\n/* 25: */ {\r\n/* 26:171 */ return \"dig.\" + this.a;\r\n/* 27: */ }", "public interface ayt {\n /* renamed from: a */\n int mo1635a(long j, List list);\n\n /* renamed from: a */\n long mo1636a(long j, alb alb);\n\n /* renamed from: a */\n void mo1637a();\n\n /* renamed from: a */\n void mo1638a(long j, long j2, List list, ayp ayp);\n\n /* renamed from: a */\n void mo1639a(ayl ayl);\n\n /* renamed from: a */\n boolean mo1640a(ayl ayl, boolean z, Exception exc, long j);\n}", "public interface C24221b extends C28343z<C28318an> {\n /* renamed from: a */\n void mo62991a(int i);\n\n String aw_();\n\n /* renamed from: e */\n Aweme mo62993e();\n}", "public interface C4051c {\n /* renamed from: a */\n boolean mo23707a();\n}", "public interface C45112b {\n /* renamed from: a */\n List<C45111a> mo107674a(Integer num);\n\n /* renamed from: a */\n List<C45111a> mo107675a(Integer num, Integer num2);\n\n /* renamed from: a */\n void mo107676a(C45111a aVar);\n\n /* renamed from: b */\n void mo107677b(Integer num);\n\n /* renamed from: c */\n long mo107678c(Integer num);\n}", "public void acionou(int a){\n\t\t\tb=a;\n\t\t}", "public interface C44963i {\n /* renamed from: a */\n void mo63037a(int i, int i2);\n\n void aA_();\n\n /* renamed from: b */\n void mo63039b(int i, int i2);\n}", "public interface C32457c<T> {\n /* renamed from: a */\n void mo83699a(T t, int i, int i2, String str);\n }", "public interface C5861g {\n /* renamed from: a */\n void mo18320a(C7251a aVar);\n\n @Deprecated\n /* renamed from: a */\n void mo18321a(C7251a aVar, String str);\n\n /* renamed from: a */\n void mo18322a(C7252b bVar);\n\n /* renamed from: a */\n void mo18323a(C7253c cVar);\n\n /* renamed from: a */\n void mo18324a(C7260j jVar);\n}", "public interface C0937a {\n /* renamed from: a */\n void mo3807a(C0985po[] poVarArr);\n }", "public interface C8466a {\n /* renamed from: a */\n void mo25956a(int i);\n\n /* renamed from: a */\n void mo25957a(long j, long j2);\n }", "public interface C39684b {\n /* renamed from: a */\n void mo98969a();\n\n /* renamed from: a */\n void mo98970a(C29296g gVar);\n\n /* renamed from: a */\n void mo98971a(C29296g gVar, int i);\n }", "public interface C43470b {\n /* renamed from: a */\n void mo61496a(C43469a aVar, C43471c cVar);\n }", "public interface AbstractC18255a {\n /* renamed from: a */\n void mo88521a();\n\n /* renamed from: a */\n void mo88522a(String str);\n\n /* renamed from: b */\n void mo88523b();\n\n /* renamed from: c */\n void mo88524c();\n }", "public interface C1436d {\n /* renamed from: a */\n C1435c mo1754a(C1433a c1433a, C1434b c1434b);\n}", "public interface C4150sl {\n /* renamed from: a */\n void mo15005a(C4143se seVar);\n}", "public void a(nm paramnm)\r\n/* 28: */ {\r\n/* 29:45 */ paramnm.a(this);\r\n/* 30: */ }", "public interface C19351a {\n /* renamed from: b */\n void mo30633b(int i, String str, byte[] bArr);\n }", "public interface C11113o {\n /* renamed from: a */\n void mo37759a(String str);\n }", "public interface C39504az {\n /* renamed from: a */\n int mo98207a();\n\n /* renamed from: a */\n void mo98208a(boolean z);\n\n /* renamed from: b */\n int mo98209b();\n\n /* renamed from: c */\n int mo98355c();\n\n /* renamed from: d */\n int mo98356d();\n\n /* renamed from: e */\n int mo98357e();\n\n /* renamed from: f */\n int mo98358f();\n}", "protected a<T> a(Tag.e<T> var0) {\n/* 80 */ Tag.a var1 = b(var0);\n/* 81 */ return new a<>(var1, this.c, \"vanilla\");\n/* */ }", "public interface C35565a {\n /* renamed from: a */\n C45321i mo90380a();\n }", "public interface C21298a {\n /* renamed from: a */\n void mo57275a();\n\n /* renamed from: a */\n void mo57276a(Exception exc);\n\n /* renamed from: b */\n void mo57277b();\n\n /* renamed from: c */\n void mo57278c();\n }", "public interface C40108b {\n /* renamed from: a */\n void mo99838a(boolean z);\n }", "public interface C0456a {\n /* renamed from: a */\n void mo2090a(C0455b bVar);\n\n /* renamed from: a */\n boolean mo2091a(C0455b bVar, Menu menu);\n\n /* renamed from: a */\n boolean mo2092a(C0455b bVar, MenuItem menuItem);\n\n /* renamed from: b */\n boolean mo2093b(C0455b bVar, Menu menu);\n }", "public interface C4724o {\n /* renamed from: a */\n void mo4872a(int i, String str);\n\n /* renamed from: a */\n void mo4873a(C4718l c4718l);\n\n /* renamed from: b */\n void mo4874b(C4718l c4718l);\n}", "public interface C7654b {\n /* renamed from: a */\n C7904c mo24084a();\n\n /* renamed from: b */\n C7716a mo24085b();\n }", "public interface C2603a {\n /* renamed from: a */\n String mo1889a(String str, String str2, String str3, String str4);\n }", "public interface afp {\n /* renamed from: a */\n C0512sx mo169a(C0497si siVar, afj afj, afr afr, Context context);\n}", "public interface C0615ja extends b<HomeFragment> {\n\n /* renamed from: c.c.a.h.b.ja$a */\n /* compiled from: FragmentModule_HomeFragment$app_bazaarRelease */\n public static abstract class a extends b.a<HomeFragment> {\n }\n}", "public interface a {\n\n /* renamed from: c.b.a.c.b.b.a$a reason: collision with other inner class name */\n /* compiled from: DiskCache */\n public interface C0054a {\n a build();\n }\n\n /* compiled from: DiskCache */\n public interface b {\n boolean a(File file);\n }\n\n File a(c cVar);\n\n void a(c cVar, b bVar);\n}", "public interface C0940d {\n /* renamed from: a */\n void mo3305a(boolean z);\n }", "public interface AbstractC17368c {\n /* renamed from: a */\n void mo84656a(float f);\n }", "interface C0932a {\n /* renamed from: a */\n void mo7438a(int i, int i2);\n\n /* renamed from: b */\n void mo7439b(C0933b bVar);\n\n /* renamed from: c */\n void mo7440c(int i, int i2, Object obj);\n\n /* renamed from: d */\n void mo7441d(C0933b bVar);\n\n /* renamed from: e */\n RecyclerView.ViewHolder mo7442e(int i);\n\n /* renamed from: f */\n void mo7443f(int i, int i2);\n\n /* renamed from: g */\n void mo7444g(int i, int i2);\n\n /* renamed from: h */\n void mo7445h(int i, int i2);\n }", "public interface C10330c {\n /* renamed from: a */\n C7562b<C10403b, C10328a> mo25041a();\n}", "public interface C3819a {\n /* renamed from: a */\n void mo23214a(Message message);\n }", "private Proof atoAImpl(Expression a) {\n Proof where = axm2(a, arrow(a, a), a); //a->(a->a) -> (a->(a->a)->a) -> (a -> a)\n Proof one = axm1(a, a); //a->a->a\n Proof two = axm1(a, arrow(a, a)); //a->(a->a)->A\n return mpTwice(where, one, two);\n }", "interface C1939a {\n /* renamed from: a */\n Bitmap mo1406a(Bitmap bitmap, float f);\n}", "public interface a extends com.bankeen.d.b.b.a {\n void a();\n\n void b();\n }", "public b[] a() {\n/* 95 */ return this.a;\n/* */ }", "interface C8361a {\n /* renamed from: b */\n float mo18284b(ViewGroup viewGroup, View view);\n\n /* renamed from: c */\n float mo18281c(ViewGroup viewGroup, View view);\n }" ]
[ "0.62497115", "0.6242887", "0.61394435", "0.61176854", "0.6114027", "0.60893", "0.6046901", "0.6024682", "0.60201293", "0.5975212", "0.59482527", "0.59121317", "0.5883635", "0.587841", "0.58703005", "0.5868436", "0.5864884", "0.5857492", "0.58306104", "0.5827752", "0.58272064", "0.5794689", "0.57890314", "0.57838726", "0.5775679", "0.57694733", "0.5769128", "0.57526815", "0.56907034", "0.5677874", "0.5670547", "0.56666386", "0.56592244", "0.5658682", "0.56574154", "0.5654324", "0.5644676", "0.56399715", "0.5638734", "0.5630582", "0.56183887", "0.5615435", "0.56069666", "0.5605207", "0.56005067", "0.559501", "0.55910283", "0.5590222", "0.55736613", "0.5556682", "0.5554544", "0.5550076", "0.55493855", "0.55446684", "0.5538079", "0.5529058", "0.5528109", "0.552641", "0.5525864", "0.552186", "0.5519972", "0.5509587", "0.5507195", "0.54881203", "0.5485328", "0.54826045", "0.5482066", "0.5481586", "0.5479751", "0.54776895", "0.54671466", "0.5463307", "0.54505056", "0.54436916", "0.5440517", "0.5439747", "0.5431944", "0.5422869", "0.54217863", "0.5417556", "0.5403905", "0.5400223", "0.53998446", "0.5394735", "0.5388649", "0.5388258", "0.5374842", "0.5368887", "0.53591394", "0.5357029", "0.5355688", "0.535506", "0.5355034", "0.53494394", "0.5341044", "0.5326166", "0.53236824", "0.53199095", "0.53177035", "0.53112453", "0.5298229" ]
0.0
-1
/ renamed from: a
public final void m388a() { m385a(this.f337a); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public interface C4521a {\n /* renamed from: a */\n void mo12348a();\n }", "public interface C1423a {\n /* renamed from: a */\n void mo6888a(int i);\n }", "interface bxc {\n /* renamed from: a */\n void mo2508a(bxb bxb);\n}", "interface C33292a {\n /* renamed from: a */\n void mo85415a(String str);\n }", "interface C10331b {\n /* renamed from: a */\n void mo26876a(int i);\n }", "public interface C0779a {\n /* renamed from: a */\n void mo2311a();\n}", "public interface C6788a {\n /* renamed from: a */\n void mo20141a();\n }", "public interface C0237a {\n /* renamed from: a */\n void mo1791a(String str);\n }", "public interface C35013b {\n /* renamed from: a */\n void mo88773a(int i);\n}", "public interface C11112n {\n /* renamed from: a */\n void mo38026a();\n }", "@Override\n\t\t\t\tpublic void a() {\n\n\t\t\t\t}", "public interface C23407b {\n /* renamed from: a */\n void mo60892a();\n\n /* renamed from: b */\n void mo60893b();\n }", "interface C0312e {\n /* renamed from: a */\n void mo4671a(View view, int i, int i2, int i3, int i4);\n }", "public interface C34379a {\n /* renamed from: a */\n void mo46242a(bmc bmc);\n }", "public interface C32456b<T> {\n /* renamed from: a */\n void mo83696a(T t);\n }", "private String convertir(String a) {\n StringBuilder atributo = new StringBuilder(a);\n atributo.insert(0, Character.toUpperCase(atributo.charAt(0)));\n return atributo.deleteCharAt(1).toString();\n }", "protected m a(String name) {\n/* 42 */ return this.a.get(name);\n/* */ }", "public interface AbstractC23925a {\n /* renamed from: a */\n void mo105476a();\n }", "private interface C0257a {\n /* renamed from: a */\n float mo196a(ViewGroup viewGroup, View view);\n\n /* renamed from: b */\n float mo195b(ViewGroup viewGroup, View view);\n }", "public interface C3598a {\n /* renamed from: a */\n void mo11024a(int i, int i2, String str);\n }", "public interface C2459d {\n /* renamed from: a */\n C2451d mo3408a(C2457e c2457e);\n}", "public interface am extends ak {\r\n /* renamed from: a */\r\n void mo194a(int i) throws RemoteException;\r\n\r\n /* renamed from: a */\r\n void mo195a(List<LatLng> list) throws RemoteException;\r\n\r\n /* renamed from: b */\r\n void mo196b(float f) throws RemoteException;\r\n\r\n /* renamed from: b */\r\n void mo197b(boolean z);\r\n\r\n /* renamed from: c */\r\n void mo198c(boolean z) throws RemoteException;\r\n\r\n /* renamed from: g */\r\n float mo199g() throws RemoteException;\r\n\r\n /* renamed from: h */\r\n int mo200h() throws RemoteException;\r\n\r\n /* renamed from: i */\r\n List<LatLng> mo201i() throws RemoteException;\r\n\r\n /* renamed from: j */\r\n boolean mo202j();\r\n\r\n /* renamed from: k */\r\n boolean mo203k();\r\n}", "public interface C32459e<T> {\n /* renamed from: a */\n void mo83698a(T t);\n }", "public interface C32458d<T> {\n /* renamed from: a */\n void mo83695a(T t);\n }", "public interface C5482b {\n /* renamed from: a */\n void mo27575a();\n\n /* renamed from: a */\n void mo27576a(int i);\n }", "public interface C27084a {\n /* renamed from: a */\n void mo69874a();\n\n /* renamed from: a */\n void mo69875a(List<Aweme> list, boolean z);\n }", "public void a() {\n ((a) this.a).a();\n }", "public interface C1153a {\n /* renamed from: a */\n void mo4520a(byte[] bArr);\n }", "public interface C13373b {\n /* renamed from: a */\n void mo32681a(String str, int i, boolean z);\n}", "public interface C40453c {\n /* renamed from: a */\n void mo100442a(C40429b bVar);\n\n /* renamed from: a */\n void mo100443a(List<String> list);\n\n /* renamed from: b */\n void mo100444b(List<C40429b> list);\n}", "public interface AbstractC17367b {\n /* renamed from: a */\n void mo84655a();\n }", "@Override\r\n\tpublic void a() {\n\t\t\r\n\t}", "public interface C43270a {\n /* renamed from: a */\n void mo64942a(String str, long j, long j2);\n}", "public interface C18928d {\n /* renamed from: a */\n void mo50320a(C18924b bVar);\n\n /* renamed from: b */\n void mo50321b(C18924b bVar);\n}", "public interface C0087c {\n /* renamed from: a */\n String mo150a(String str);\n}", "public interface C1529m {\n /* renamed from: a */\n void mo3767a(int i);\n\n /* renamed from: a */\n void mo3768a(String str);\n}", "interface C4483e {\n /* renamed from: a */\n boolean mo34114a();\n}", "public interface C1234b {\r\n /* renamed from: a */\r\n void m8367a();\r\n\r\n /* renamed from: b */\r\n void m8368b();\r\n}", "public interface C10965j<T> {\n /* renamed from: a */\n T mo26439a();\n}", "public interface C28772a {\n /* renamed from: a */\n View mo73990a(View view);\n }", "@Override\n\tpublic void a() {\n\t\t\n\t}", "public interface C8326b {\n /* renamed from: a */\n C8325a mo21498a(String str);\n\n /* renamed from: a */\n void mo21499a(C8325a aVar);\n}", "void metodo1(int a, int[] b) {\r\n\t\ta += 5;//Par\\u00e1metro con el mismo nombre que el campo de la clase.\r\n\t\tb[0] += 7;//se produce un env\\u00edo por referencia, apunta a una copia de un objeto, que se asigna aqu\\u00ed.\r\n\t}", "public interface C2367a {\n /* renamed from: a */\n C2368d mo1698a();\n }", "interface C30585a {\n /* renamed from: b */\n void mo27952b(C5379a c5379a, int i, C46650a c46650a, C7620bi c7620bi);\n }", "public interface C4211a {\n\n /* renamed from: com.iab.omid.library.oguryco.c.a$a */\n public interface C4212a {\n /* renamed from: a */\n void mo28760a(View view, C4211a aVar, JSONObject jSONObject);\n }\n\n /* renamed from: a */\n JSONObject mo28758a(View view);\n\n /* renamed from: a */\n void mo28759a(View view, JSONObject jSONObject, C4212a aVar, boolean z);\n}", "public interface C4697a extends C5595at {\n /* renamed from: a */\n void mo12634a();\n\n /* renamed from: a */\n void mo12635a(String str);\n\n /* renamed from: a */\n void mo12636a(boolean z);\n\n /* renamed from: b */\n void mo12637b();\n\n /* renamed from: c */\n void mo12638c();\n }", "public interface C4773c {\n /* renamed from: a */\n void m15858a(int i);\n\n /* renamed from: a */\n void m15859a(int i, int i2);\n\n /* renamed from: a */\n void m15860a(int i, int i2, int i3);\n\n /* renamed from: b */\n void m15861b(int i, int i2);\n}", "public interface C4869f {\n /* renamed from: a */\n C4865b mo6249a();\n}", "public interface C1799a {\n /* renamed from: b */\n void mo3314b(String str);\n }", "public interface C43499b {\n /* renamed from: a */\n void mo8445a(int i, String str, int i2, byte[] bArr);\n}", "public interface C0601aq {\n /* renamed from: a */\n void mo9148a(int i, ArrayList<C0889x> arrayList);\n}", "public interface C45101e {\n /* renamed from: b */\n void mo3796b(int i);\n}", "public interface AbstractC6461g {\n /* renamed from: a */\n String mo42332a();\n}", "public interface AbstractC1645a {\n /* renamed from: a */\n String mo17375a();\n }", "public interface C6178c {\n /* renamed from: a */\n Map<String, String> mo14888a();\n}", "public interface C5101b {\n /* renamed from: a */\n void mo5289a(C5102c c5102c);\n\n /* renamed from: b */\n void mo5290b(C5102c c5102c);\n}", "public interface C19045k {\n /* renamed from: a */\n void mo50368a(int i, Object obj);\n\n /* renamed from: b */\n void mo50369b(int i, Object obj);\n}", "public b a()\r\n/* 12: */ {\r\n/* 13:13 */ return this.a;\r\n/* 14: */ }", "public interface C7720a {\n /* renamed from: a */\n long mo20406a();\n}", "public String a()\r\n/* 25: */ {\r\n/* 26:171 */ return \"dig.\" + this.a;\r\n/* 27: */ }", "public interface ayt {\n /* renamed from: a */\n int mo1635a(long j, List list);\n\n /* renamed from: a */\n long mo1636a(long j, alb alb);\n\n /* renamed from: a */\n void mo1637a();\n\n /* renamed from: a */\n void mo1638a(long j, long j2, List list, ayp ayp);\n\n /* renamed from: a */\n void mo1639a(ayl ayl);\n\n /* renamed from: a */\n boolean mo1640a(ayl ayl, boolean z, Exception exc, long j);\n}", "public interface C24221b extends C28343z<C28318an> {\n /* renamed from: a */\n void mo62991a(int i);\n\n String aw_();\n\n /* renamed from: e */\n Aweme mo62993e();\n}", "public interface C4051c {\n /* renamed from: a */\n boolean mo23707a();\n}", "public interface C45112b {\n /* renamed from: a */\n List<C45111a> mo107674a(Integer num);\n\n /* renamed from: a */\n List<C45111a> mo107675a(Integer num, Integer num2);\n\n /* renamed from: a */\n void mo107676a(C45111a aVar);\n\n /* renamed from: b */\n void mo107677b(Integer num);\n\n /* renamed from: c */\n long mo107678c(Integer num);\n}", "public void acionou(int a){\n\t\t\tb=a;\n\t\t}", "public interface C44963i {\n /* renamed from: a */\n void mo63037a(int i, int i2);\n\n void aA_();\n\n /* renamed from: b */\n void mo63039b(int i, int i2);\n}", "public interface C32457c<T> {\n /* renamed from: a */\n void mo83699a(T t, int i, int i2, String str);\n }", "public interface C5861g {\n /* renamed from: a */\n void mo18320a(C7251a aVar);\n\n @Deprecated\n /* renamed from: a */\n void mo18321a(C7251a aVar, String str);\n\n /* renamed from: a */\n void mo18322a(C7252b bVar);\n\n /* renamed from: a */\n void mo18323a(C7253c cVar);\n\n /* renamed from: a */\n void mo18324a(C7260j jVar);\n}", "public interface C0937a {\n /* renamed from: a */\n void mo3807a(C0985po[] poVarArr);\n }", "public interface C8466a {\n /* renamed from: a */\n void mo25956a(int i);\n\n /* renamed from: a */\n void mo25957a(long j, long j2);\n }", "public interface C39684b {\n /* renamed from: a */\n void mo98969a();\n\n /* renamed from: a */\n void mo98970a(C29296g gVar);\n\n /* renamed from: a */\n void mo98971a(C29296g gVar, int i);\n }", "public interface C43470b {\n /* renamed from: a */\n void mo61496a(C43469a aVar, C43471c cVar);\n }", "public interface AbstractC18255a {\n /* renamed from: a */\n void mo88521a();\n\n /* renamed from: a */\n void mo88522a(String str);\n\n /* renamed from: b */\n void mo88523b();\n\n /* renamed from: c */\n void mo88524c();\n }", "public interface C1436d {\n /* renamed from: a */\n C1435c mo1754a(C1433a c1433a, C1434b c1434b);\n}", "public interface C4150sl {\n /* renamed from: a */\n void mo15005a(C4143se seVar);\n}", "public void a(nm paramnm)\r\n/* 28: */ {\r\n/* 29:45 */ paramnm.a(this);\r\n/* 30: */ }", "public interface C19351a {\n /* renamed from: b */\n void mo30633b(int i, String str, byte[] bArr);\n }", "public interface C11113o {\n /* renamed from: a */\n void mo37759a(String str);\n }", "public interface C39504az {\n /* renamed from: a */\n int mo98207a();\n\n /* renamed from: a */\n void mo98208a(boolean z);\n\n /* renamed from: b */\n int mo98209b();\n\n /* renamed from: c */\n int mo98355c();\n\n /* renamed from: d */\n int mo98356d();\n\n /* renamed from: e */\n int mo98357e();\n\n /* renamed from: f */\n int mo98358f();\n}", "protected a<T> a(Tag.e<T> var0) {\n/* 80 */ Tag.a var1 = b(var0);\n/* 81 */ return new a<>(var1, this.c, \"vanilla\");\n/* */ }", "public interface C35565a {\n /* renamed from: a */\n C45321i mo90380a();\n }", "public interface C21298a {\n /* renamed from: a */\n void mo57275a();\n\n /* renamed from: a */\n void mo57276a(Exception exc);\n\n /* renamed from: b */\n void mo57277b();\n\n /* renamed from: c */\n void mo57278c();\n }", "public interface C40108b {\n /* renamed from: a */\n void mo99838a(boolean z);\n }", "public interface C0456a {\n /* renamed from: a */\n void mo2090a(C0455b bVar);\n\n /* renamed from: a */\n boolean mo2091a(C0455b bVar, Menu menu);\n\n /* renamed from: a */\n boolean mo2092a(C0455b bVar, MenuItem menuItem);\n\n /* renamed from: b */\n boolean mo2093b(C0455b bVar, Menu menu);\n }", "public interface C4724o {\n /* renamed from: a */\n void mo4872a(int i, String str);\n\n /* renamed from: a */\n void mo4873a(C4718l c4718l);\n\n /* renamed from: b */\n void mo4874b(C4718l c4718l);\n}", "public interface C7654b {\n /* renamed from: a */\n C7904c mo24084a();\n\n /* renamed from: b */\n C7716a mo24085b();\n }", "public interface C2603a {\n /* renamed from: a */\n String mo1889a(String str, String str2, String str3, String str4);\n }", "public interface afp {\n /* renamed from: a */\n C0512sx mo169a(C0497si siVar, afj afj, afr afr, Context context);\n}", "public interface C0615ja extends b<HomeFragment> {\n\n /* renamed from: c.c.a.h.b.ja$a */\n /* compiled from: FragmentModule_HomeFragment$app_bazaarRelease */\n public static abstract class a extends b.a<HomeFragment> {\n }\n}", "public interface a {\n\n /* renamed from: c.b.a.c.b.b.a$a reason: collision with other inner class name */\n /* compiled from: DiskCache */\n public interface C0054a {\n a build();\n }\n\n /* compiled from: DiskCache */\n public interface b {\n boolean a(File file);\n }\n\n File a(c cVar);\n\n void a(c cVar, b bVar);\n}", "public interface C0940d {\n /* renamed from: a */\n void mo3305a(boolean z);\n }", "public interface AbstractC17368c {\n /* renamed from: a */\n void mo84656a(float f);\n }", "interface C0932a {\n /* renamed from: a */\n void mo7438a(int i, int i2);\n\n /* renamed from: b */\n void mo7439b(C0933b bVar);\n\n /* renamed from: c */\n void mo7440c(int i, int i2, Object obj);\n\n /* renamed from: d */\n void mo7441d(C0933b bVar);\n\n /* renamed from: e */\n RecyclerView.ViewHolder mo7442e(int i);\n\n /* renamed from: f */\n void mo7443f(int i, int i2);\n\n /* renamed from: g */\n void mo7444g(int i, int i2);\n\n /* renamed from: h */\n void mo7445h(int i, int i2);\n }", "public interface C10330c {\n /* renamed from: a */\n C7562b<C10403b, C10328a> mo25041a();\n}", "public interface C3819a {\n /* renamed from: a */\n void mo23214a(Message message);\n }", "private Proof atoAImpl(Expression a) {\n Proof where = axm2(a, arrow(a, a), a); //a->(a->a) -> (a->(a->a)->a) -> (a -> a)\n Proof one = axm1(a, a); //a->a->a\n Proof two = axm1(a, arrow(a, a)); //a->(a->a)->A\n return mpTwice(where, one, two);\n }", "interface C1939a {\n /* renamed from: a */\n Bitmap mo1406a(Bitmap bitmap, float f);\n}", "public interface a extends com.bankeen.d.b.b.a {\n void a();\n\n void b();\n }", "public b[] a() {\n/* 95 */ return this.a;\n/* */ }", "interface C8361a {\n /* renamed from: b */\n float mo18284b(ViewGroup viewGroup, View view);\n\n /* renamed from: c */\n float mo18281c(ViewGroup viewGroup, View view);\n }" ]
[ "0.62497115", "0.6242887", "0.61394435", "0.61176854", "0.6114027", "0.60893", "0.6046901", "0.6024682", "0.60201293", "0.5975212", "0.59482527", "0.59121317", "0.5883635", "0.587841", "0.58703005", "0.5868436", "0.5864884", "0.5857492", "0.58306104", "0.5827752", "0.58272064", "0.5794689", "0.57890314", "0.57838726", "0.5775679", "0.57694733", "0.5769128", "0.57526815", "0.56907034", "0.5677874", "0.5670547", "0.56666386", "0.56592244", "0.5658682", "0.56574154", "0.5654324", "0.5644676", "0.56399715", "0.5638734", "0.5630582", "0.56183887", "0.5615435", "0.56069666", "0.5605207", "0.56005067", "0.559501", "0.55910283", "0.5590222", "0.55736613", "0.5556682", "0.5554544", "0.5550076", "0.55493855", "0.55446684", "0.5538079", "0.5529058", "0.5528109", "0.552641", "0.5525864", "0.552186", "0.5519972", "0.5509587", "0.5507195", "0.54881203", "0.5485328", "0.54826045", "0.5482066", "0.5481586", "0.5479751", "0.54776895", "0.54671466", "0.5463307", "0.54505056", "0.54436916", "0.5440517", "0.5439747", "0.5431944", "0.5422869", "0.54217863", "0.5417556", "0.5403905", "0.5400223", "0.53998446", "0.5394735", "0.5388649", "0.5388258", "0.5374842", "0.5368887", "0.53591394", "0.5357029", "0.5355688", "0.535506", "0.5355034", "0.53494394", "0.5341044", "0.5326166", "0.53236824", "0.53199095", "0.53177035", "0.53112453", "0.5298229" ]
0.0
-1
/ renamed from: a
public final void m389a(int i) { f335b = i; if (!mo102a(f335b)) { f335b = 0; } if (f335b == 0) { m385a(this.f337a); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public interface C4521a {\n /* renamed from: a */\n void mo12348a();\n }", "public interface C1423a {\n /* renamed from: a */\n void mo6888a(int i);\n }", "interface bxc {\n /* renamed from: a */\n void mo2508a(bxb bxb);\n}", "interface C33292a {\n /* renamed from: a */\n void mo85415a(String str);\n }", "interface C10331b {\n /* renamed from: a */\n void mo26876a(int i);\n }", "public interface C0779a {\n /* renamed from: a */\n void mo2311a();\n}", "public interface C6788a {\n /* renamed from: a */\n void mo20141a();\n }", "public interface C0237a {\n /* renamed from: a */\n void mo1791a(String str);\n }", "public interface C35013b {\n /* renamed from: a */\n void mo88773a(int i);\n}", "public interface C11112n {\n /* renamed from: a */\n void mo38026a();\n }", "@Override\n\t\t\t\tpublic void a() {\n\n\t\t\t\t}", "public interface C23407b {\n /* renamed from: a */\n void mo60892a();\n\n /* renamed from: b */\n void mo60893b();\n }", "interface C0312e {\n /* renamed from: a */\n void mo4671a(View view, int i, int i2, int i3, int i4);\n }", "public interface C34379a {\n /* renamed from: a */\n void mo46242a(bmc bmc);\n }", "public interface C32456b<T> {\n /* renamed from: a */\n void mo83696a(T t);\n }", "private String convertir(String a) {\n StringBuilder atributo = new StringBuilder(a);\n atributo.insert(0, Character.toUpperCase(atributo.charAt(0)));\n return atributo.deleteCharAt(1).toString();\n }", "protected m a(String name) {\n/* 42 */ return this.a.get(name);\n/* */ }", "public interface AbstractC23925a {\n /* renamed from: a */\n void mo105476a();\n }", "private interface C0257a {\n /* renamed from: a */\n float mo196a(ViewGroup viewGroup, View view);\n\n /* renamed from: b */\n float mo195b(ViewGroup viewGroup, View view);\n }", "public interface C3598a {\n /* renamed from: a */\n void mo11024a(int i, int i2, String str);\n }", "public interface C2459d {\n /* renamed from: a */\n C2451d mo3408a(C2457e c2457e);\n}", "public interface am extends ak {\r\n /* renamed from: a */\r\n void mo194a(int i) throws RemoteException;\r\n\r\n /* renamed from: a */\r\n void mo195a(List<LatLng> list) throws RemoteException;\r\n\r\n /* renamed from: b */\r\n void mo196b(float f) throws RemoteException;\r\n\r\n /* renamed from: b */\r\n void mo197b(boolean z);\r\n\r\n /* renamed from: c */\r\n void mo198c(boolean z) throws RemoteException;\r\n\r\n /* renamed from: g */\r\n float mo199g() throws RemoteException;\r\n\r\n /* renamed from: h */\r\n int mo200h() throws RemoteException;\r\n\r\n /* renamed from: i */\r\n List<LatLng> mo201i() throws RemoteException;\r\n\r\n /* renamed from: j */\r\n boolean mo202j();\r\n\r\n /* renamed from: k */\r\n boolean mo203k();\r\n}", "public interface C32459e<T> {\n /* renamed from: a */\n void mo83698a(T t);\n }", "public interface C32458d<T> {\n /* renamed from: a */\n void mo83695a(T t);\n }", "public interface C5482b {\n /* renamed from: a */\n void mo27575a();\n\n /* renamed from: a */\n void mo27576a(int i);\n }", "public interface C27084a {\n /* renamed from: a */\n void mo69874a();\n\n /* renamed from: a */\n void mo69875a(List<Aweme> list, boolean z);\n }", "public void a() {\n ((a) this.a).a();\n }", "public interface C1153a {\n /* renamed from: a */\n void mo4520a(byte[] bArr);\n }", "public interface C13373b {\n /* renamed from: a */\n void mo32681a(String str, int i, boolean z);\n}", "public interface C40453c {\n /* renamed from: a */\n void mo100442a(C40429b bVar);\n\n /* renamed from: a */\n void mo100443a(List<String> list);\n\n /* renamed from: b */\n void mo100444b(List<C40429b> list);\n}", "public interface AbstractC17367b {\n /* renamed from: a */\n void mo84655a();\n }", "@Override\r\n\tpublic void a() {\n\t\t\r\n\t}", "public interface C43270a {\n /* renamed from: a */\n void mo64942a(String str, long j, long j2);\n}", "public interface C18928d {\n /* renamed from: a */\n void mo50320a(C18924b bVar);\n\n /* renamed from: b */\n void mo50321b(C18924b bVar);\n}", "public interface C0087c {\n /* renamed from: a */\n String mo150a(String str);\n}", "public interface C1529m {\n /* renamed from: a */\n void mo3767a(int i);\n\n /* renamed from: a */\n void mo3768a(String str);\n}", "interface C4483e {\n /* renamed from: a */\n boolean mo34114a();\n}", "public interface C1234b {\r\n /* renamed from: a */\r\n void m8367a();\r\n\r\n /* renamed from: b */\r\n void m8368b();\r\n}", "public interface C10965j<T> {\n /* renamed from: a */\n T mo26439a();\n}", "public interface C28772a {\n /* renamed from: a */\n View mo73990a(View view);\n }", "@Override\n\tpublic void a() {\n\t\t\n\t}", "public interface C8326b {\n /* renamed from: a */\n C8325a mo21498a(String str);\n\n /* renamed from: a */\n void mo21499a(C8325a aVar);\n}", "void metodo1(int a, int[] b) {\r\n\t\ta += 5;//Par\\u00e1metro con el mismo nombre que el campo de la clase.\r\n\t\tb[0] += 7;//se produce un env\\u00edo por referencia, apunta a una copia de un objeto, que se asigna aqu\\u00ed.\r\n\t}", "public interface C2367a {\n /* renamed from: a */\n C2368d mo1698a();\n }", "interface C30585a {\n /* renamed from: b */\n void mo27952b(C5379a c5379a, int i, C46650a c46650a, C7620bi c7620bi);\n }", "public interface C4211a {\n\n /* renamed from: com.iab.omid.library.oguryco.c.a$a */\n public interface C4212a {\n /* renamed from: a */\n void mo28760a(View view, C4211a aVar, JSONObject jSONObject);\n }\n\n /* renamed from: a */\n JSONObject mo28758a(View view);\n\n /* renamed from: a */\n void mo28759a(View view, JSONObject jSONObject, C4212a aVar, boolean z);\n}", "public interface C4697a extends C5595at {\n /* renamed from: a */\n void mo12634a();\n\n /* renamed from: a */\n void mo12635a(String str);\n\n /* renamed from: a */\n void mo12636a(boolean z);\n\n /* renamed from: b */\n void mo12637b();\n\n /* renamed from: c */\n void mo12638c();\n }", "public interface C4773c {\n /* renamed from: a */\n void m15858a(int i);\n\n /* renamed from: a */\n void m15859a(int i, int i2);\n\n /* renamed from: a */\n void m15860a(int i, int i2, int i3);\n\n /* renamed from: b */\n void m15861b(int i, int i2);\n}", "public interface C4869f {\n /* renamed from: a */\n C4865b mo6249a();\n}", "public interface C1799a {\n /* renamed from: b */\n void mo3314b(String str);\n }", "public interface C43499b {\n /* renamed from: a */\n void mo8445a(int i, String str, int i2, byte[] bArr);\n}", "public interface C0601aq {\n /* renamed from: a */\n void mo9148a(int i, ArrayList<C0889x> arrayList);\n}", "public interface C45101e {\n /* renamed from: b */\n void mo3796b(int i);\n}", "public interface AbstractC6461g {\n /* renamed from: a */\n String mo42332a();\n}", "public interface AbstractC1645a {\n /* renamed from: a */\n String mo17375a();\n }", "public interface C6178c {\n /* renamed from: a */\n Map<String, String> mo14888a();\n}", "public interface C5101b {\n /* renamed from: a */\n void mo5289a(C5102c c5102c);\n\n /* renamed from: b */\n void mo5290b(C5102c c5102c);\n}", "public interface C19045k {\n /* renamed from: a */\n void mo50368a(int i, Object obj);\n\n /* renamed from: b */\n void mo50369b(int i, Object obj);\n}", "public b a()\r\n/* 12: */ {\r\n/* 13:13 */ return this.a;\r\n/* 14: */ }", "public interface C7720a {\n /* renamed from: a */\n long mo20406a();\n}", "public String a()\r\n/* 25: */ {\r\n/* 26:171 */ return \"dig.\" + this.a;\r\n/* 27: */ }", "public interface ayt {\n /* renamed from: a */\n int mo1635a(long j, List list);\n\n /* renamed from: a */\n long mo1636a(long j, alb alb);\n\n /* renamed from: a */\n void mo1637a();\n\n /* renamed from: a */\n void mo1638a(long j, long j2, List list, ayp ayp);\n\n /* renamed from: a */\n void mo1639a(ayl ayl);\n\n /* renamed from: a */\n boolean mo1640a(ayl ayl, boolean z, Exception exc, long j);\n}", "public interface C24221b extends C28343z<C28318an> {\n /* renamed from: a */\n void mo62991a(int i);\n\n String aw_();\n\n /* renamed from: e */\n Aweme mo62993e();\n}", "public interface C4051c {\n /* renamed from: a */\n boolean mo23707a();\n}", "public interface C45112b {\n /* renamed from: a */\n List<C45111a> mo107674a(Integer num);\n\n /* renamed from: a */\n List<C45111a> mo107675a(Integer num, Integer num2);\n\n /* renamed from: a */\n void mo107676a(C45111a aVar);\n\n /* renamed from: b */\n void mo107677b(Integer num);\n\n /* renamed from: c */\n long mo107678c(Integer num);\n}", "public void acionou(int a){\n\t\t\tb=a;\n\t\t}", "public interface C44963i {\n /* renamed from: a */\n void mo63037a(int i, int i2);\n\n void aA_();\n\n /* renamed from: b */\n void mo63039b(int i, int i2);\n}", "public interface C32457c<T> {\n /* renamed from: a */\n void mo83699a(T t, int i, int i2, String str);\n }", "public interface C5861g {\n /* renamed from: a */\n void mo18320a(C7251a aVar);\n\n @Deprecated\n /* renamed from: a */\n void mo18321a(C7251a aVar, String str);\n\n /* renamed from: a */\n void mo18322a(C7252b bVar);\n\n /* renamed from: a */\n void mo18323a(C7253c cVar);\n\n /* renamed from: a */\n void mo18324a(C7260j jVar);\n}", "public interface C0937a {\n /* renamed from: a */\n void mo3807a(C0985po[] poVarArr);\n }", "public interface C8466a {\n /* renamed from: a */\n void mo25956a(int i);\n\n /* renamed from: a */\n void mo25957a(long j, long j2);\n }", "public interface C39684b {\n /* renamed from: a */\n void mo98969a();\n\n /* renamed from: a */\n void mo98970a(C29296g gVar);\n\n /* renamed from: a */\n void mo98971a(C29296g gVar, int i);\n }", "public interface C43470b {\n /* renamed from: a */\n void mo61496a(C43469a aVar, C43471c cVar);\n }", "public interface AbstractC18255a {\n /* renamed from: a */\n void mo88521a();\n\n /* renamed from: a */\n void mo88522a(String str);\n\n /* renamed from: b */\n void mo88523b();\n\n /* renamed from: c */\n void mo88524c();\n }", "public interface C1436d {\n /* renamed from: a */\n C1435c mo1754a(C1433a c1433a, C1434b c1434b);\n}", "public interface C4150sl {\n /* renamed from: a */\n void mo15005a(C4143se seVar);\n}", "public void a(nm paramnm)\r\n/* 28: */ {\r\n/* 29:45 */ paramnm.a(this);\r\n/* 30: */ }", "public interface C19351a {\n /* renamed from: b */\n void mo30633b(int i, String str, byte[] bArr);\n }", "public interface C11113o {\n /* renamed from: a */\n void mo37759a(String str);\n }", "public interface C39504az {\n /* renamed from: a */\n int mo98207a();\n\n /* renamed from: a */\n void mo98208a(boolean z);\n\n /* renamed from: b */\n int mo98209b();\n\n /* renamed from: c */\n int mo98355c();\n\n /* renamed from: d */\n int mo98356d();\n\n /* renamed from: e */\n int mo98357e();\n\n /* renamed from: f */\n int mo98358f();\n}", "protected a<T> a(Tag.e<T> var0) {\n/* 80 */ Tag.a var1 = b(var0);\n/* 81 */ return new a<>(var1, this.c, \"vanilla\");\n/* */ }", "public interface C35565a {\n /* renamed from: a */\n C45321i mo90380a();\n }", "public interface C21298a {\n /* renamed from: a */\n void mo57275a();\n\n /* renamed from: a */\n void mo57276a(Exception exc);\n\n /* renamed from: b */\n void mo57277b();\n\n /* renamed from: c */\n void mo57278c();\n }", "public interface C40108b {\n /* renamed from: a */\n void mo99838a(boolean z);\n }", "public interface C0456a {\n /* renamed from: a */\n void mo2090a(C0455b bVar);\n\n /* renamed from: a */\n boolean mo2091a(C0455b bVar, Menu menu);\n\n /* renamed from: a */\n boolean mo2092a(C0455b bVar, MenuItem menuItem);\n\n /* renamed from: b */\n boolean mo2093b(C0455b bVar, Menu menu);\n }", "public interface C4724o {\n /* renamed from: a */\n void mo4872a(int i, String str);\n\n /* renamed from: a */\n void mo4873a(C4718l c4718l);\n\n /* renamed from: b */\n void mo4874b(C4718l c4718l);\n}", "public interface C7654b {\n /* renamed from: a */\n C7904c mo24084a();\n\n /* renamed from: b */\n C7716a mo24085b();\n }", "public interface C2603a {\n /* renamed from: a */\n String mo1889a(String str, String str2, String str3, String str4);\n }", "public interface afp {\n /* renamed from: a */\n C0512sx mo169a(C0497si siVar, afj afj, afr afr, Context context);\n}", "public interface C0615ja extends b<HomeFragment> {\n\n /* renamed from: c.c.a.h.b.ja$a */\n /* compiled from: FragmentModule_HomeFragment$app_bazaarRelease */\n public static abstract class a extends b.a<HomeFragment> {\n }\n}", "public interface a {\n\n /* renamed from: c.b.a.c.b.b.a$a reason: collision with other inner class name */\n /* compiled from: DiskCache */\n public interface C0054a {\n a build();\n }\n\n /* compiled from: DiskCache */\n public interface b {\n boolean a(File file);\n }\n\n File a(c cVar);\n\n void a(c cVar, b bVar);\n}", "public interface C0940d {\n /* renamed from: a */\n void mo3305a(boolean z);\n }", "public interface AbstractC17368c {\n /* renamed from: a */\n void mo84656a(float f);\n }", "interface C0932a {\n /* renamed from: a */\n void mo7438a(int i, int i2);\n\n /* renamed from: b */\n void mo7439b(C0933b bVar);\n\n /* renamed from: c */\n void mo7440c(int i, int i2, Object obj);\n\n /* renamed from: d */\n void mo7441d(C0933b bVar);\n\n /* renamed from: e */\n RecyclerView.ViewHolder mo7442e(int i);\n\n /* renamed from: f */\n void mo7443f(int i, int i2);\n\n /* renamed from: g */\n void mo7444g(int i, int i2);\n\n /* renamed from: h */\n void mo7445h(int i, int i2);\n }", "public interface C10330c {\n /* renamed from: a */\n C7562b<C10403b, C10328a> mo25041a();\n}", "public interface C3819a {\n /* renamed from: a */\n void mo23214a(Message message);\n }", "private Proof atoAImpl(Expression a) {\n Proof where = axm2(a, arrow(a, a), a); //a->(a->a) -> (a->(a->a)->a) -> (a -> a)\n Proof one = axm1(a, a); //a->a->a\n Proof two = axm1(a, arrow(a, a)); //a->(a->a)->A\n return mpTwice(where, one, two);\n }", "interface C1939a {\n /* renamed from: a */\n Bitmap mo1406a(Bitmap bitmap, float f);\n}", "public interface a extends com.bankeen.d.b.b.a {\n void a();\n\n void b();\n }", "public b[] a() {\n/* 95 */ return this.a;\n/* */ }", "interface C8361a {\n /* renamed from: b */\n float mo18284b(ViewGroup viewGroup, View view);\n\n /* renamed from: c */\n float mo18281c(ViewGroup viewGroup, View view);\n }" ]
[ "0.62497115", "0.6242887", "0.61394435", "0.61176854", "0.6114027", "0.60893", "0.6046901", "0.6024682", "0.60201293", "0.5975212", "0.59482527", "0.59121317", "0.5883635", "0.587841", "0.58703005", "0.5868436", "0.5864884", "0.5857492", "0.58306104", "0.5827752", "0.58272064", "0.5794689", "0.57890314", "0.57838726", "0.5775679", "0.57694733", "0.5769128", "0.57526815", "0.56907034", "0.5677874", "0.5670547", "0.56666386", "0.56592244", "0.5658682", "0.56574154", "0.5654324", "0.5644676", "0.56399715", "0.5638734", "0.5630582", "0.56183887", "0.5615435", "0.56069666", "0.5605207", "0.56005067", "0.559501", "0.55910283", "0.5590222", "0.55736613", "0.5556682", "0.5554544", "0.5550076", "0.55493855", "0.55446684", "0.5538079", "0.5529058", "0.5528109", "0.552641", "0.5525864", "0.552186", "0.5519972", "0.5509587", "0.5507195", "0.54881203", "0.5485328", "0.54826045", "0.5482066", "0.5481586", "0.5479751", "0.54776895", "0.54671466", "0.5463307", "0.54505056", "0.54436916", "0.5440517", "0.5439747", "0.5431944", "0.5422869", "0.54217863", "0.5417556", "0.5403905", "0.5400223", "0.53998446", "0.5394735", "0.5388649", "0.5388258", "0.5374842", "0.5368887", "0.53591394", "0.5357029", "0.5355688", "0.535506", "0.5355034", "0.53494394", "0.5341044", "0.5326166", "0.53236824", "0.53199095", "0.53177035", "0.53112453", "0.5298229" ]
0.0
-1
/ renamed from: a
public final void playSample(int i, int i2, boolean z) { try { if (i != this.f336a || z || (this.f337a != null && this.f337a.getState() != 400)) { if (this.f337a != null) { m385a(this.f337a); } if ((f335b & 1) == 1) { this.f337a = m384a(this.f340a[i], "audio/midi"); VolumeControl control = this.f337a.getControl("VolumeControl"); if (control != null) { control.setLevel(50); } this.f337a.setLoopCount(i2); if (this.f339a) { this.f337a.start(); } this.f336a = i; } } } catch (Exception e) { } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public interface C4521a {\n /* renamed from: a */\n void mo12348a();\n }", "public interface C1423a {\n /* renamed from: a */\n void mo6888a(int i);\n }", "interface bxc {\n /* renamed from: a */\n void mo2508a(bxb bxb);\n}", "interface C33292a {\n /* renamed from: a */\n void mo85415a(String str);\n }", "interface C10331b {\n /* renamed from: a */\n void mo26876a(int i);\n }", "public interface C0779a {\n /* renamed from: a */\n void mo2311a();\n}", "public interface C6788a {\n /* renamed from: a */\n void mo20141a();\n }", "public interface C0237a {\n /* renamed from: a */\n void mo1791a(String str);\n }", "public interface C35013b {\n /* renamed from: a */\n void mo88773a(int i);\n}", "public interface C11112n {\n /* renamed from: a */\n void mo38026a();\n }", "@Override\n\t\t\t\tpublic void a() {\n\n\t\t\t\t}", "public interface C23407b {\n /* renamed from: a */\n void mo60892a();\n\n /* renamed from: b */\n void mo60893b();\n }", "interface C0312e {\n /* renamed from: a */\n void mo4671a(View view, int i, int i2, int i3, int i4);\n }", "public interface C34379a {\n /* renamed from: a */\n void mo46242a(bmc bmc);\n }", "public interface C32456b<T> {\n /* renamed from: a */\n void mo83696a(T t);\n }", "private String convertir(String a) {\n StringBuilder atributo = new StringBuilder(a);\n atributo.insert(0, Character.toUpperCase(atributo.charAt(0)));\n return atributo.deleteCharAt(1).toString();\n }", "protected m a(String name) {\n/* 42 */ return this.a.get(name);\n/* */ }", "public interface AbstractC23925a {\n /* renamed from: a */\n void mo105476a();\n }", "private interface C0257a {\n /* renamed from: a */\n float mo196a(ViewGroup viewGroup, View view);\n\n /* renamed from: b */\n float mo195b(ViewGroup viewGroup, View view);\n }", "public interface C3598a {\n /* renamed from: a */\n void mo11024a(int i, int i2, String str);\n }", "public interface C2459d {\n /* renamed from: a */\n C2451d mo3408a(C2457e c2457e);\n}", "public interface am extends ak {\r\n /* renamed from: a */\r\n void mo194a(int i) throws RemoteException;\r\n\r\n /* renamed from: a */\r\n void mo195a(List<LatLng> list) throws RemoteException;\r\n\r\n /* renamed from: b */\r\n void mo196b(float f) throws RemoteException;\r\n\r\n /* renamed from: b */\r\n void mo197b(boolean z);\r\n\r\n /* renamed from: c */\r\n void mo198c(boolean z) throws RemoteException;\r\n\r\n /* renamed from: g */\r\n float mo199g() throws RemoteException;\r\n\r\n /* renamed from: h */\r\n int mo200h() throws RemoteException;\r\n\r\n /* renamed from: i */\r\n List<LatLng> mo201i() throws RemoteException;\r\n\r\n /* renamed from: j */\r\n boolean mo202j();\r\n\r\n /* renamed from: k */\r\n boolean mo203k();\r\n}", "public interface C32459e<T> {\n /* renamed from: a */\n void mo83698a(T t);\n }", "public interface C32458d<T> {\n /* renamed from: a */\n void mo83695a(T t);\n }", "public interface C5482b {\n /* renamed from: a */\n void mo27575a();\n\n /* renamed from: a */\n void mo27576a(int i);\n }", "public interface C27084a {\n /* renamed from: a */\n void mo69874a();\n\n /* renamed from: a */\n void mo69875a(List<Aweme> list, boolean z);\n }", "public void a() {\n ((a) this.a).a();\n }", "public interface C1153a {\n /* renamed from: a */\n void mo4520a(byte[] bArr);\n }", "public interface C13373b {\n /* renamed from: a */\n void mo32681a(String str, int i, boolean z);\n}", "public interface C40453c {\n /* renamed from: a */\n void mo100442a(C40429b bVar);\n\n /* renamed from: a */\n void mo100443a(List<String> list);\n\n /* renamed from: b */\n void mo100444b(List<C40429b> list);\n}", "public interface AbstractC17367b {\n /* renamed from: a */\n void mo84655a();\n }", "@Override\r\n\tpublic void a() {\n\t\t\r\n\t}", "public interface C43270a {\n /* renamed from: a */\n void mo64942a(String str, long j, long j2);\n}", "public interface C18928d {\n /* renamed from: a */\n void mo50320a(C18924b bVar);\n\n /* renamed from: b */\n void mo50321b(C18924b bVar);\n}", "public interface C0087c {\n /* renamed from: a */\n String mo150a(String str);\n}", "public interface C1529m {\n /* renamed from: a */\n void mo3767a(int i);\n\n /* renamed from: a */\n void mo3768a(String str);\n}", "interface C4483e {\n /* renamed from: a */\n boolean mo34114a();\n}", "public interface C1234b {\r\n /* renamed from: a */\r\n void m8367a();\r\n\r\n /* renamed from: b */\r\n void m8368b();\r\n}", "public interface C10965j<T> {\n /* renamed from: a */\n T mo26439a();\n}", "public interface C28772a {\n /* renamed from: a */\n View mo73990a(View view);\n }", "@Override\n\tpublic void a() {\n\t\t\n\t}", "public interface C8326b {\n /* renamed from: a */\n C8325a mo21498a(String str);\n\n /* renamed from: a */\n void mo21499a(C8325a aVar);\n}", "void metodo1(int a, int[] b) {\r\n\t\ta += 5;//Par\\u00e1metro con el mismo nombre que el campo de la clase.\r\n\t\tb[0] += 7;//se produce un env\\u00edo por referencia, apunta a una copia de un objeto, que se asigna aqu\\u00ed.\r\n\t}", "public interface C2367a {\n /* renamed from: a */\n C2368d mo1698a();\n }", "interface C30585a {\n /* renamed from: b */\n void mo27952b(C5379a c5379a, int i, C46650a c46650a, C7620bi c7620bi);\n }", "public interface C4211a {\n\n /* renamed from: com.iab.omid.library.oguryco.c.a$a */\n public interface C4212a {\n /* renamed from: a */\n void mo28760a(View view, C4211a aVar, JSONObject jSONObject);\n }\n\n /* renamed from: a */\n JSONObject mo28758a(View view);\n\n /* renamed from: a */\n void mo28759a(View view, JSONObject jSONObject, C4212a aVar, boolean z);\n}", "public interface C4697a extends C5595at {\n /* renamed from: a */\n void mo12634a();\n\n /* renamed from: a */\n void mo12635a(String str);\n\n /* renamed from: a */\n void mo12636a(boolean z);\n\n /* renamed from: b */\n void mo12637b();\n\n /* renamed from: c */\n void mo12638c();\n }", "public interface C4773c {\n /* renamed from: a */\n void m15858a(int i);\n\n /* renamed from: a */\n void m15859a(int i, int i2);\n\n /* renamed from: a */\n void m15860a(int i, int i2, int i3);\n\n /* renamed from: b */\n void m15861b(int i, int i2);\n}", "public interface C4869f {\n /* renamed from: a */\n C4865b mo6249a();\n}", "public interface C1799a {\n /* renamed from: b */\n void mo3314b(String str);\n }", "public interface C43499b {\n /* renamed from: a */\n void mo8445a(int i, String str, int i2, byte[] bArr);\n}", "public interface C0601aq {\n /* renamed from: a */\n void mo9148a(int i, ArrayList<C0889x> arrayList);\n}", "public interface C45101e {\n /* renamed from: b */\n void mo3796b(int i);\n}", "public interface AbstractC6461g {\n /* renamed from: a */\n String mo42332a();\n}", "public interface AbstractC1645a {\n /* renamed from: a */\n String mo17375a();\n }", "public interface C6178c {\n /* renamed from: a */\n Map<String, String> mo14888a();\n}", "public interface C5101b {\n /* renamed from: a */\n void mo5289a(C5102c c5102c);\n\n /* renamed from: b */\n void mo5290b(C5102c c5102c);\n}", "public interface C19045k {\n /* renamed from: a */\n void mo50368a(int i, Object obj);\n\n /* renamed from: b */\n void mo50369b(int i, Object obj);\n}", "public b a()\r\n/* 12: */ {\r\n/* 13:13 */ return this.a;\r\n/* 14: */ }", "public interface C7720a {\n /* renamed from: a */\n long mo20406a();\n}", "public String a()\r\n/* 25: */ {\r\n/* 26:171 */ return \"dig.\" + this.a;\r\n/* 27: */ }", "public interface ayt {\n /* renamed from: a */\n int mo1635a(long j, List list);\n\n /* renamed from: a */\n long mo1636a(long j, alb alb);\n\n /* renamed from: a */\n void mo1637a();\n\n /* renamed from: a */\n void mo1638a(long j, long j2, List list, ayp ayp);\n\n /* renamed from: a */\n void mo1639a(ayl ayl);\n\n /* renamed from: a */\n boolean mo1640a(ayl ayl, boolean z, Exception exc, long j);\n}", "public interface C24221b extends C28343z<C28318an> {\n /* renamed from: a */\n void mo62991a(int i);\n\n String aw_();\n\n /* renamed from: e */\n Aweme mo62993e();\n}", "public interface C4051c {\n /* renamed from: a */\n boolean mo23707a();\n}", "public interface C45112b {\n /* renamed from: a */\n List<C45111a> mo107674a(Integer num);\n\n /* renamed from: a */\n List<C45111a> mo107675a(Integer num, Integer num2);\n\n /* renamed from: a */\n void mo107676a(C45111a aVar);\n\n /* renamed from: b */\n void mo107677b(Integer num);\n\n /* renamed from: c */\n long mo107678c(Integer num);\n}", "public void acionou(int a){\n\t\t\tb=a;\n\t\t}", "public interface C44963i {\n /* renamed from: a */\n void mo63037a(int i, int i2);\n\n void aA_();\n\n /* renamed from: b */\n void mo63039b(int i, int i2);\n}", "public interface C32457c<T> {\n /* renamed from: a */\n void mo83699a(T t, int i, int i2, String str);\n }", "public interface C5861g {\n /* renamed from: a */\n void mo18320a(C7251a aVar);\n\n @Deprecated\n /* renamed from: a */\n void mo18321a(C7251a aVar, String str);\n\n /* renamed from: a */\n void mo18322a(C7252b bVar);\n\n /* renamed from: a */\n void mo18323a(C7253c cVar);\n\n /* renamed from: a */\n void mo18324a(C7260j jVar);\n}", "public interface C0937a {\n /* renamed from: a */\n void mo3807a(C0985po[] poVarArr);\n }", "public interface C8466a {\n /* renamed from: a */\n void mo25956a(int i);\n\n /* renamed from: a */\n void mo25957a(long j, long j2);\n }", "public interface C39684b {\n /* renamed from: a */\n void mo98969a();\n\n /* renamed from: a */\n void mo98970a(C29296g gVar);\n\n /* renamed from: a */\n void mo98971a(C29296g gVar, int i);\n }", "public interface C43470b {\n /* renamed from: a */\n void mo61496a(C43469a aVar, C43471c cVar);\n }", "public interface AbstractC18255a {\n /* renamed from: a */\n void mo88521a();\n\n /* renamed from: a */\n void mo88522a(String str);\n\n /* renamed from: b */\n void mo88523b();\n\n /* renamed from: c */\n void mo88524c();\n }", "public interface C1436d {\n /* renamed from: a */\n C1435c mo1754a(C1433a c1433a, C1434b c1434b);\n}", "public interface C4150sl {\n /* renamed from: a */\n void mo15005a(C4143se seVar);\n}", "public void a(nm paramnm)\r\n/* 28: */ {\r\n/* 29:45 */ paramnm.a(this);\r\n/* 30: */ }", "public interface C19351a {\n /* renamed from: b */\n void mo30633b(int i, String str, byte[] bArr);\n }", "public interface C11113o {\n /* renamed from: a */\n void mo37759a(String str);\n }", "public interface C39504az {\n /* renamed from: a */\n int mo98207a();\n\n /* renamed from: a */\n void mo98208a(boolean z);\n\n /* renamed from: b */\n int mo98209b();\n\n /* renamed from: c */\n int mo98355c();\n\n /* renamed from: d */\n int mo98356d();\n\n /* renamed from: e */\n int mo98357e();\n\n /* renamed from: f */\n int mo98358f();\n}", "protected a<T> a(Tag.e<T> var0) {\n/* 80 */ Tag.a var1 = b(var0);\n/* 81 */ return new a<>(var1, this.c, \"vanilla\");\n/* */ }", "public interface C35565a {\n /* renamed from: a */\n C45321i mo90380a();\n }", "public interface C21298a {\n /* renamed from: a */\n void mo57275a();\n\n /* renamed from: a */\n void mo57276a(Exception exc);\n\n /* renamed from: b */\n void mo57277b();\n\n /* renamed from: c */\n void mo57278c();\n }", "public interface C40108b {\n /* renamed from: a */\n void mo99838a(boolean z);\n }", "public interface C0456a {\n /* renamed from: a */\n void mo2090a(C0455b bVar);\n\n /* renamed from: a */\n boolean mo2091a(C0455b bVar, Menu menu);\n\n /* renamed from: a */\n boolean mo2092a(C0455b bVar, MenuItem menuItem);\n\n /* renamed from: b */\n boolean mo2093b(C0455b bVar, Menu menu);\n }", "public interface C4724o {\n /* renamed from: a */\n void mo4872a(int i, String str);\n\n /* renamed from: a */\n void mo4873a(C4718l c4718l);\n\n /* renamed from: b */\n void mo4874b(C4718l c4718l);\n}", "public interface C7654b {\n /* renamed from: a */\n C7904c mo24084a();\n\n /* renamed from: b */\n C7716a mo24085b();\n }", "public interface C2603a {\n /* renamed from: a */\n String mo1889a(String str, String str2, String str3, String str4);\n }", "public interface afp {\n /* renamed from: a */\n C0512sx mo169a(C0497si siVar, afj afj, afr afr, Context context);\n}", "public interface C0615ja extends b<HomeFragment> {\n\n /* renamed from: c.c.a.h.b.ja$a */\n /* compiled from: FragmentModule_HomeFragment$app_bazaarRelease */\n public static abstract class a extends b.a<HomeFragment> {\n }\n}", "public interface a {\n\n /* renamed from: c.b.a.c.b.b.a$a reason: collision with other inner class name */\n /* compiled from: DiskCache */\n public interface C0054a {\n a build();\n }\n\n /* compiled from: DiskCache */\n public interface b {\n boolean a(File file);\n }\n\n File a(c cVar);\n\n void a(c cVar, b bVar);\n}", "public interface C0940d {\n /* renamed from: a */\n void mo3305a(boolean z);\n }", "public interface AbstractC17368c {\n /* renamed from: a */\n void mo84656a(float f);\n }", "interface C0932a {\n /* renamed from: a */\n void mo7438a(int i, int i2);\n\n /* renamed from: b */\n void mo7439b(C0933b bVar);\n\n /* renamed from: c */\n void mo7440c(int i, int i2, Object obj);\n\n /* renamed from: d */\n void mo7441d(C0933b bVar);\n\n /* renamed from: e */\n RecyclerView.ViewHolder mo7442e(int i);\n\n /* renamed from: f */\n void mo7443f(int i, int i2);\n\n /* renamed from: g */\n void mo7444g(int i, int i2);\n\n /* renamed from: h */\n void mo7445h(int i, int i2);\n }", "public interface C10330c {\n /* renamed from: a */\n C7562b<C10403b, C10328a> mo25041a();\n}", "public interface C3819a {\n /* renamed from: a */\n void mo23214a(Message message);\n }", "private Proof atoAImpl(Expression a) {\n Proof where = axm2(a, arrow(a, a), a); //a->(a->a) -> (a->(a->a)->a) -> (a -> a)\n Proof one = axm1(a, a); //a->a->a\n Proof two = axm1(a, arrow(a, a)); //a->(a->a)->A\n return mpTwice(where, one, two);\n }", "interface C1939a {\n /* renamed from: a */\n Bitmap mo1406a(Bitmap bitmap, float f);\n}", "public interface a extends com.bankeen.d.b.b.a {\n void a();\n\n void b();\n }", "public b[] a() {\n/* 95 */ return this.a;\n/* */ }", "interface C8361a {\n /* renamed from: b */\n float mo18284b(ViewGroup viewGroup, View view);\n\n /* renamed from: c */\n float mo18281c(ViewGroup viewGroup, View view);\n }" ]
[ "0.62497115", "0.6242887", "0.61394435", "0.61176854", "0.6114027", "0.60893", "0.6046901", "0.6024682", "0.60201293", "0.5975212", "0.59482527", "0.59121317", "0.5883635", "0.587841", "0.58703005", "0.5868436", "0.5864884", "0.5857492", "0.58306104", "0.5827752", "0.58272064", "0.5794689", "0.57890314", "0.57838726", "0.5775679", "0.57694733", "0.5769128", "0.57526815", "0.56907034", "0.5677874", "0.5670547", "0.56666386", "0.56592244", "0.5658682", "0.56574154", "0.5654324", "0.5644676", "0.56399715", "0.5638734", "0.5630582", "0.56183887", "0.5615435", "0.56069666", "0.5605207", "0.56005067", "0.559501", "0.55910283", "0.5590222", "0.55736613", "0.5556682", "0.5554544", "0.5550076", "0.55493855", "0.55446684", "0.5538079", "0.5529058", "0.5528109", "0.552641", "0.5525864", "0.552186", "0.5519972", "0.5509587", "0.5507195", "0.54881203", "0.5485328", "0.54826045", "0.5482066", "0.5481586", "0.5479751", "0.54776895", "0.54671466", "0.5463307", "0.54505056", "0.54436916", "0.5440517", "0.5439747", "0.5431944", "0.5422869", "0.54217863", "0.5417556", "0.5403905", "0.5400223", "0.53998446", "0.5394735", "0.5388649", "0.5388258", "0.5374842", "0.5368887", "0.53591394", "0.5357029", "0.5355688", "0.535506", "0.5355034", "0.53494394", "0.5341044", "0.5326166", "0.53236824", "0.53199095", "0.53177035", "0.53112453", "0.5298229" ]
0.0
-1
/ renamed from: b
public final void mo104b() { m385a(this.f337a); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "void mo2508a(bxb bxb);", "@Override\n public void func_104112_b() {\n \n }", "@Override\n public void b() {\n }", "public interface C19351a {\n /* renamed from: b */\n void mo30633b(int i, String str, byte[] bArr);\n }", "@Override\n\tpublic void b2() {\n\t\t\n\t}", "void metodo1(int a, int[] b) {\r\n\t\ta += 5;//Par\\u00e1metro con el mismo nombre que el campo de la clase.\r\n\t\tb[0] += 7;//se produce un env\\u00edo por referencia, apunta a una copia de un objeto, que se asigna aqu\\u00ed.\r\n\t}", "interface bxc {\n /* renamed from: a */\n void mo2508a(bxb bxb);\n}", "@Override\n\tpublic void b() {\n\n\t}", "interface C30585a {\n /* renamed from: b */\n void mo27952b(C5379a c5379a, int i, C46650a c46650a, C7620bi c7620bi);\n }", "public bb b() {\n return a(this.a);\n }", "@Override\n\tpublic void b1() {\n\t\t\n\t}", "public void b() {\r\n }", "@Override\n\tpublic void bbb() {\n\t\t\n\t}", "public interface C34379a {\n /* renamed from: a */\n void mo46242a(bmc bmc);\n }", "public abstract void b(StringBuilder sb);", "public void b() {\n }", "public void b() {\n }", "protected b(int mb) {\n/* 87 */ this.b = mb;\n/* */ }", "public u(b paramb)\r\n/* 7: */ {\r\n/* 8: 9 */ this.a = paramb;\r\n/* 9: */ }", "public interface b {\n void H_();\n\n void I_();\n\n void J_();\n\n void a(C0063d dVar);\n\n void a(byte[] bArr);\n\n void b(boolean z);\n }", "public b[] a() {\n/* 95 */ return this.a;\n/* */ }", "public interface C7654b {\n /* renamed from: a */\n C7904c mo24084a();\n\n /* renamed from: b */\n C7716a mo24085b();\n }", "public interface C1153a {\n /* renamed from: a */\n void mo4520a(byte[] bArr);\n }", "public interface C43499b {\n /* renamed from: a */\n void mo8445a(int i, String str, int i2, byte[] bArr);\n}", "public void b() {\n ((a) this.a).b();\n }", "public np a()\r\n/* 33: */ {\r\n/* 34:49 */ return this.b;\r\n/* 35: */ }", "b(a aVar) {\n super(0);\n this.this$0 = aVar;\n }", "public t b() {\n return a(this.a);\n }", "public interface C32456b<T> {\n /* renamed from: a */\n void mo83696a(T t);\n }", "public static String a(int c) {\n/* 89 */ return b.a(c);\n/* */ }", "private void m678b(byte b) {\n byte[] bArr = this.f523r;\n bArr[0] = b;\n this.f552g.mo502b(bArr);\n }", "public interface C23407b {\n /* renamed from: a */\n void mo60892a();\n\n /* renamed from: b */\n void mo60893b();\n }", "public abstract T zzm(B b);", "public b a()\r\n/* 12: */ {\r\n/* 13:13 */ return this.a;\r\n/* 14: */ }", "public void b(World paramaqu, BlockPosition paramdt, Block parambec)\r\n/* 27: */ {\r\n/* 28: 47 */ bcm localbcm = paramaqu.s(paramdt);\r\n/* 29: 48 */ if ((localbcm instanceof bdv)) {\r\n/* 30: 49 */ ((bdv)localbcm).h();\r\n/* 31: */ } else {\r\n/* 32: 51 */ super.b(paramaqu, paramdt, parambec);\r\n/* 33: */ }\r\n/* 34: */ }", "public abstract void zzc(B b, int i, int i2);", "public interface b {\n}", "public interface b {\n}", "private void m10263b(byte b) throws cf {\r\n this.f6483r[0] = b;\r\n this.g.m10347b(this.f6483r);\r\n }", "BSubstitution createBSubstitution();", "public void b(ahd paramahd) {}", "void b();", "public interface C18928d {\n /* renamed from: a */\n void mo50320a(C18924b bVar);\n\n /* renamed from: b */\n void mo50321b(C18924b bVar);\n}", "B database(S database);", "public interface C0615ja extends b<HomeFragment> {\n\n /* renamed from: c.c.a.h.b.ja$a */\n /* compiled from: FragmentModule_HomeFragment$app_bazaarRelease */\n public static abstract class a extends b.a<HomeFragment> {\n }\n}", "public abstract C0631bt mo9227aB();", "public an b() {\n return a(this.a);\n }", "protected abstract void a(bru parambru);", "static void go(Base b) {\n\t\tb.add(8);\n\t}", "void mo46242a(bmc bmc);", "public interface b extends c {\n void a(Float f);\n\n void a(Integer num);\n\n void b(Float f);\n\n void c(Float f);\n\n String d();\n\n void d(Float f);\n\n void d(String str);\n\n void e(Float f);\n\n void e(String str);\n\n void f(String str);\n\n void g(String str);\n\n Long j();\n\n LineChart k();\n }", "public interface bca extends bbn {\n bca a();\n\n bca a(String str);\n\n bca b(String str);\n\n bca c(String str);\n}", "public interface a extends com.bankeen.d.b.b.a {\n void a();\n\n void b();\n }", "public abstract BoundType b();", "public void b(amj paramamj)\r\n/* 538: */ {\r\n/* 539:579 */ this.f = paramamj;\r\n/* 540: */ }", "b(a aVar, com.bytedance.jedi.model.h.a aVar2) {\n super(aVar2);\n this.f21531a = aVar;\n this.f21532b = new com.bytedance.jedi.model.h.f(aVar);\n }", "private void b(int paramInt)\r\n/* 193: */ {\r\n/* 194:203 */ this.h.a(a(paramInt));\r\n/* 195: */ }", "public void b(ahb paramahb)\r\n/* 583: */ {\r\n/* 584:625 */ for (int i = 0; i < this.a.length; i++) {\r\n/* 585:626 */ this.a[i] = amj.b(paramahb.a[i]);\r\n/* 586: */ }\r\n/* 587:628 */ for (i = 0; i < this.b.length; i++) {\r\n/* 588:629 */ this.b[i] = amj.b(paramahb.b[i]);\r\n/* 589: */ }\r\n/* 590:631 */ this.c = paramahb.c;\r\n/* 591: */ }", "interface b {\n\n /* compiled from: CreditAccountContract */\n public interface a extends com.bankeen.d.b.b.a {\n void a();\n\n void b();\n }\n\n /* compiled from: CreditAccountContract */\n public interface b extends c {\n void a(Float f);\n\n void a(Integer num);\n\n void b(Float f);\n\n void c(Float f);\n\n String d();\n\n void d(Float f);\n\n void d(String str);\n\n void e(Float f);\n\n void e(String str);\n\n void f(String str);\n\n void g(String str);\n\n Long j();\n\n LineChart k();\n }\n}", "@Override\n\tpublic void visit(PartB partB) {\n\n\t}", "public abstract void zzb(B b, int i, long j);", "public abstract void zza(B b, int i, zzeh zzeh);", "int metodo2(int a, int b) {\r\n\r\n\t\tthis.a += 5; // se modifica el campo del objeto, el uso de la palabra reservada this se utiliza para referenciar al campo.\r\n\t\tb += 7;\r\n\t\treturn a; // modifica en la asignaci\\u00f3n\r\n\t}", "private void internalCopy(Board b) {\n for (int i = 0; i < SIDE * SIDE; i += 1) {\n set(i, b.get(i));\n }\n\n _directions = b._directions;\n _whoseMove = b._whoseMove;\n _history = b._history;\n }", "public int b()\r\n/* 69: */ {\r\n/* 70:74 */ return this.b;\r\n/* 71: */ }", "public void b(StringBuilder sb) {\n sb.append(this.a);\n sb.append(')');\n }", "public void b() {\n e$a e$a;\n try {\n e$a = this.b;\n }\n catch (IOException iOException) {\n return;\n }\n Object object = this.c;\n e$a.b(object);\n }", "public abstract void a(StringBuilder sb);", "public interface C45101e {\n /* renamed from: b */\n void mo3796b(int i);\n}", "public abstract void zzf(Object obj, B b);", "public interface bdp {\n\n /* renamed from: a */\n public static final bdp f3422a = new bdo();\n\n /* renamed from: a */\n bdm mo1784a(akh akh);\n}", "@Override\n\tpublic void parse(Buffer b) {\n\t\t\n\t}", "@Override\n\t\t\t\tpublic void a() {\n\n\t\t\t\t}", "public abstract void a(b paramb, int paramInt1, int paramInt2);", "public void mo1945a(byte b) throws cf {\r\n m10263b(b);\r\n }", "void mo83703a(C32456b<T> bVar);", "public void a(String str) {\n ((b.b) this.b).d(str);\n }", "public void selectB() { }", "BOperation createBOperation();", "void metodo1(int a, int b) {\r\n\t\ta += 5;//par\\u00e1metro con el mismo nombre que el campo.\r\n\t\tb += 7;\r\n\t}", "private static void m2196a(StringBuffer stringBuffer, byte b) {\n stringBuffer.append(\"0123456789ABCDEF\".charAt((b >> 4) & 15)).append(\"0123456789ABCDEF\".charAt(b & 15));\n }", "public interface C1799a {\n /* renamed from: b */\n void mo3314b(String str);\n }", "public void b(fv paramfv)\r\n/* 408: */ {\r\n/* 409:423 */ this.a = new amj[36];\r\n/* 410:424 */ this.b = new amj[4];\r\n/* 411:425 */ for (int i = 0; i < paramfv.c(); i++)\r\n/* 412: */ {\r\n/* 413:426 */ fn localfn = paramfv.b(i);\r\n/* 414:427 */ int j = localfn.d(\"Slot\") & 0xFF;\r\n/* 415:428 */ amj localamj = amj.a(localfn);\r\n/* 416:429 */ if (localamj != null)\r\n/* 417: */ {\r\n/* 418:430 */ if ((j >= 0) && (j < this.a.length)) {\r\n/* 419:431 */ this.a[j] = localamj;\r\n/* 420: */ }\r\n/* 421:433 */ if ((j >= 100) && (j < this.b.length + 100)) {\r\n/* 422:434 */ this.b[(j - 100)] = localamj;\r\n/* 423: */ }\r\n/* 424: */ }\r\n/* 425: */ }\r\n/* 426: */ }", "public void b(String str) {\n ((b.b) this.b).e(str);\n }", "public String b()\r\n/* 35: */ {\r\n/* 36:179 */ return a();\r\n/* 37: */ }", "public abstract void zza(B b, int i, T t);", "public Item b(World paramaqu, BlockPosition paramdt)\r\n/* 189: */ {\r\n/* 190:220 */ return null;\r\n/* 191: */ }", "public abstract void zza(B b, int i, long j);", "public interface C5101b {\n /* renamed from: a */\n void mo5289a(C5102c c5102c);\n\n /* renamed from: b */\n void mo5290b(C5102c c5102c);\n}", "private interface C0257a {\n /* renamed from: a */\n float mo196a(ViewGroup viewGroup, View view);\n\n /* renamed from: b */\n float mo195b(ViewGroup viewGroup, View view);\n }", "public abstract void mo9798a(byte b);", "public void mo9798a(byte b) {\n if (this.f9108f == this.f9107e) {\n mo9827i();\n }\n byte[] bArr = this.f9106d;\n int i = this.f9108f;\n this.f9108f = i + 1;\n bArr[i] = b;\n this.f9109g++;\n }", "public interface C1234b {\r\n /* renamed from: a */\r\n void m8367a();\r\n\r\n /* renamed from: b */\r\n void m8368b();\r\n}", "private void m676a(TField bkVar, byte b) {\n if (b == -1) {\n b = m687e(bkVar.f538b);\n }\n short s = bkVar.f539c;\n short s2 = this.f519n;\n if (s <= s2 || s - s2 > 15) {\n m678b(b);\n mo446a(bkVar.f539c);\n } else {\n m686d(b | ((s - s2) << 4));\n }\n this.f519n = bkVar.f539c;\n }", "private static void m831a(C0741g<?> gVar, C0747b bVar) {\n gVar.mo9477a(C0743i.f718b, (C0739e<? super Object>) bVar);\n gVar.mo9476a(C0743i.f718b, (C0738d) bVar);\n gVar.mo9474a(C0743i.f718b, (C0736b) bVar);\n }", "public interface C40453c {\n /* renamed from: a */\n void mo100442a(C40429b bVar);\n\n /* renamed from: a */\n void mo100443a(List<String> list);\n\n /* renamed from: b */\n void mo100444b(List<C40429b> list);\n}", "private void j()\n/* */ {\n/* 223 */ c localc = this.b;\n/* 224 */ this.b = this.c;\n/* 225 */ this.c = localc;\n/* 226 */ this.c.b();\n/* */ }", "public lj ar(byte b) {\n throw new Runtime(\"d2j fail translate: java.lang.RuntimeException: can not merge I and Z\\r\\n\\tat com.googlecode.dex2jar.ir.TypeClass.merge(TypeClass.java:100)\\r\\n\\tat com.googlecode.dex2jar.ir.ts.TypeTransformer$TypeRef.updateTypeClass(TypeTransformer.java:174)\\r\\n\\tat com.googlecode.dex2jar.ir.ts.TypeTransformer$TypeAnalyze.provideAs(TypeTransformer.java:780)\\r\\n\\tat com.googlecode.dex2jar.ir.ts.TypeTransformer$TypeAnalyze.e1expr(TypeTransformer.java:496)\\r\\n\\tat com.googlecode.dex2jar.ir.ts.TypeTransformer$TypeAnalyze.exExpr(TypeTransformer.java:713)\\r\\n\\tat com.googlecode.dex2jar.ir.ts.TypeTransformer$TypeAnalyze.exExpr(TypeTransformer.java:703)\\r\\n\\tat com.googlecode.dex2jar.ir.ts.TypeTransformer$TypeAnalyze.enexpr(TypeTransformer.java:698)\\r\\n\\tat com.googlecode.dex2jar.ir.ts.TypeTransformer$TypeAnalyze.exExpr(TypeTransformer.java:719)\\r\\n\\tat com.googlecode.dex2jar.ir.ts.TypeTransformer$TypeAnalyze.exExpr(TypeTransformer.java:703)\\r\\n\\tat com.googlecode.dex2jar.ir.ts.TypeTransformer$TypeAnalyze.s1stmt(TypeTransformer.java:810)\\r\\n\\tat com.googlecode.dex2jar.ir.ts.TypeTransformer$TypeAnalyze.sxStmt(TypeTransformer.java:840)\\r\\n\\tat com.googlecode.dex2jar.ir.ts.TypeTransformer$TypeAnalyze.analyze(TypeTransformer.java:206)\\r\\n\\tat com.googlecode.dex2jar.ir.ts.TypeTransformer.transform(TypeTransformer.java:44)\\r\\n\\tat com.googlecode.d2j.dex.Dex2jar$2.optimize(Dex2jar.java:162)\\r\\n\\tat com.googlecode.d2j.dex.Dex2Asm.convertCode(Dex2Asm.java:414)\\r\\n\\tat com.googlecode.d2j.dex.ExDex2Asm.convertCode(ExDex2Asm.java:42)\\r\\n\\tat com.googlecode.d2j.dex.Dex2jar$2.convertCode(Dex2jar.java:128)\\r\\n\\tat com.googlecode.d2j.dex.Dex2Asm.convertMethod(Dex2Asm.java:509)\\r\\n\\tat com.googlecode.d2j.dex.Dex2Asm.convertClass(Dex2Asm.java:406)\\r\\n\\tat com.googlecode.d2j.dex.Dex2Asm.convertDex(Dex2Asm.java:422)\\r\\n\\tat com.googlecode.d2j.dex.Dex2jar.doTranslate(Dex2jar.java:172)\\r\\n\\tat com.googlecode.d2j.dex.Dex2jar.to(Dex2jar.java:272)\\r\\n\\tat com.googlecode.dex2jar.tools.Dex2jarCmd.doCommandLine(Dex2jarCmd.java:108)\\r\\n\\tat com.googlecode.dex2jar.tools.BaseCmd.doMain(BaseCmd.java:288)\\r\\n\\tat com.googlecode.dex2jar.tools.Dex2jarCmd.main(Dex2jarCmd.java:32)\\r\\n\");\n }", "public interface AbstractC10485b {\n /* renamed from: a */\n void mo64153a(boolean z);\n }", "public interface C40108b {\n /* renamed from: a */\n void mo99838a(boolean z);\n }", "interface C8361a {\n /* renamed from: b */\n float mo18284b(ViewGroup viewGroup, View view);\n\n /* renamed from: c */\n float mo18281c(ViewGroup viewGroup, View view);\n }" ]
[ "0.64558864", "0.6283203", "0.6252635", "0.6250949", "0.6244743", "0.6216273", "0.6194491", "0.6193556", "0.61641675", "0.6140157", "0.60993093", "0.60974354", "0.6077849", "0.6001867", "0.5997364", "0.59737104", "0.59737104", "0.5905105", "0.5904295", "0.58908087", "0.5886636", "0.58828026", "0.5855491", "0.584618", "0.5842517", "0.5824137", "0.5824071", "0.58097327", "0.5802052", "0.58012927", "0.579443", "0.5792392", "0.57902914", "0.5785124", "0.57718205", "0.57589084", "0.5735892", "0.5735892", "0.5734873", "0.5727929", "0.5720821", "0.5712531", "0.5706813", "0.56896514", "0.56543154", "0.5651059", "0.5649904", "0.56496733", "0.5647035", "0.5640965", "0.5640109", "0.563993", "0.5631903", "0.5597427", "0.55843794", "0.5583287", "0.557783", "0.55734867", "0.55733293", "0.5572254", "0.55683887", "0.55624336", "0.55540246", "0.5553985", "0.55480546", "0.554261", "0.5535739", "0.5529958", "0.5519634", "0.5517503", "0.55160624", "0.5511545", "0.5505353", "0.5500533", "0.5491741", "0.5486198", "0.5481978", "0.547701", "0.54725856", "0.5471632", "0.5463497", "0.5460805", "0.5454913", "0.5454885", "0.54519916", "0.5441594", "0.5436747", "0.5432453", "0.5425923", "0.5424724", "0.54189867", "0.54162544", "0.54051477", "0.53998184", "0.53945845", "0.53887725", "0.5388146", "0.5387678", "0.53858143", "0.53850687", "0.5384439" ]
0.0
-1
calculates the width of the healthbar by remaining health of the creature
public void update() { remHpWidth = healthbarWidth * ent.getCurrentHealth() / ent.getMaxHealth(); lostHpWidth = healthbarWidth - remHpWidth; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private void updateHealth() {\n float percentage = (float) game.getPlayerComponent().getHealth() / (float) game.getPlayerComponent().getMaxHealth(); //Possible placed in controller\n healthBar.setWidth(healthBarMaxWidth * percentage);\n }", "float getPercentHealth();", "Float getHealth();", "int getHealth();", "public float getHealth(){\n return health.getHealth();\n }", "public void drawHealthBar() {\n\t\td.setColor(Color.GREEN);\n\t\td.setFont(f1);\n\t\td.drawString(\"Health\", 387, 43);\n\t\td.setFont(f);\n\t\td.fillRect(227, 48, health * 100, 25);\n\t\td.setColor(Color.BLACK);\n\t\td.drawLine(327, 48, 327, 73);\n\t\td.drawLine(427, 48, 427, 73);\n\t\td.drawLine(527, 48, 527, 73);\n\t\td.drawRect(227, 48, 400, 25);\n\t}", "public float getHealth()\n {\n return health;\n }", "public int getHealth();", "public int getHealth() { return this.health; }", "public double getHealth() { return health; }", "public double getHealth() {\r\n\t\treturn health;\r\n\t}", "public static int getHealth()\r\n\t{\r\n\t\treturn health;\r\n\t}", "public int getHealth()\r\n {\r\n return health;\r\n }", "public int heal(int health) {\r\n lifepoints += health;\r\n int left = 0;\r\n if (lifepoints > getMaximumLifepoints()) {\r\n left = lifepoints - getMaximumLifepoints();\r\n lifepoints = getMaximumLifepoints();\r\n }\r\n lifepointsUpdate = true;\r\n return left;\r\n }", "public int getHealth()\r\n {\r\n return this.health;\r\n }", "public void drawHealthBar() {}", "int getHealth() {\n return health;\n }", "public int getHealth() {\r\n\t\treturn health;\r\n\t}", "public double getHealth(){\r\n return health;\r\n }", "public int getHealth() {\n return this.health;\n }", "public String getHealthBar() {\n String healthBar = \"|\";\n for (int i=0; i<40; i++) {\n if (i < 40*hp/maxHp) {\n healthBar += \"\\u2588\";\n } else {\n healthBar += \" \";\n }\n }\n return healthBar + \"|\";\n }", "public int getHealth() {\n \t\treturn health;\n \t}", "public float getHealth() {\n\t\treturn _health;\n\t}", "void displayHealth(int health){\n\t\r\n\t\thealth = health + this.health + super.health + a.health;\r\n\t\tSystem.out.println(health);\r\n\t}", "public int getHealth() {\n return getStat(health);\n }", "public int getWidth(){\n return this.baseLevel.getWidth();\n }", "public Integer getHealth();", "@Override\r\n\tprotected double getHealth() \r\n\t{\r\n\t\treturn this._health;\r\n\t}", "public int getHealth(){\n return health;\n }", "public void setHealth(double h){\n health = h;\n }", "public int getHealthCost();", "public int getHealth() {\n\t\treturn health;\n\t}", "public int getHealth() {\n\t\treturn health;\n\t}", "double getWidth();", "double getWidth();", "public double calculateHpPercent();", "public int getHealth() {\n\t\treturn this.Health;\n\t}", "public double getHealthRelative() {\n\t\treturn getHealth() / (double) getMaxHealth();\n\t}", "private static int maxHealth(int health){\r\n int mHealth = 0;\r\n mHealth = health + 5;\r\n return mHealth; \r\n }", "public int getMaxHealth();", "public static String buildHealthBar(EntityLiving entity) {\n String healthBar = S + \"H\";\n int max = Properties.getInt(Properties.GENERAL, \"max_size\");\n int health = Math.max(0, entity.getHealth());\n int healthMax = Math.max(0, entity.getMaxHealth());\n String style = Properties.getString(Properties.GENERAL, \"style\");\n if (max <= 0) {\n if (style.equalsIgnoreCase(\"percent\")) {\n health = toPercent(health, healthMax);\n healthBar += S + getColor(health > 20) + health + \"%\";\n }\n else {\n boolean color = health * 5 > healthMax;\n if (style.equalsIgnoreCase(\"hearts\")) {\n health = (health >>> 1) + (health & 1);\n healthMax = (healthMax >>> 1) + (healthMax & 1);\n }\n healthBar += S + getColor(color) + health;\n if (Properties.getBoolean(Properties.GENERAL, \"show_max\"))\n healthBar += \"/\" + healthMax;\n }\n }\n else {\n String bar = Properties.getString(Properties.GENERAL, \"bar\");\n int length = bar.length();\n int position = 0;\n boolean percent = style.equalsIgnoreCase(\"percent\");\n if (!percent) {\n if (style.equalsIgnoreCase(\"hearts\")) {\n health = (health >>> 1) + (health & 1);\n healthMax = (healthMax >>> 1) + (healthMax & 1);\n }\n percent = healthMax > max;\n }\n if (percent) {\n health = (int)Math.ceil((double)toPercent(health, healthMax) * (double)max / 100D);\n healthMax = max - health;\n healthBar += S + getColor(true);\n while (health-- > 0) {\n healthBar += Character.toString(bar.charAt(position));\n if (++position == length)\n position = 0;\n }\n if (Properties.getBoolean(Properties.GENERAL, \"show_max\")) {\n healthBar += S + getColor(false);\n while (healthMax-- > 0) {\n healthBar += Character.toString(bar.charAt(position));\n if (++position == length)\n position = 0;\n }\n }\n }\n else {\n healthMax -= health;\n healthBar += S + getColor(true);\n while (health-- > 0) {\n healthBar += Character.toString(bar.charAt(position));\n if (++position == length)\n position = 0;\n }\n if (Properties.getBoolean(Properties.GENERAL, \"show_max\")) {\n healthBar += S + getColor(false);\n while (healthMax-- > 0) {\n healthBar += Character.toString(bar.charAt(position));\n if (++position == length)\n position = 0;\n }\n }\n }\n }\n return healthBar;\n }", "public abstract float getWidth(EntityLivingBase target);", "public int getHealthCount() {\n return healthCount;\n }", "public float getHungerDamage();", "public void reduceHealth() {\n\t}", "public int getHealth() {\n\t\treturn currentHealth;\n\t}", "public float getWidth();", "@Override\r\n\tpublic int getHealth() {\n\t\treturn health;\r\n\t}", "protected void renderHealth(Screen screen) {\n\t\tif (health >= 250) screen.renderMob((int) x, (int) y - 1, Sprite.health_10);\n\t\telse if (health >= 225) screen.renderMob((int) x, (int) y - 1, Sprite.health_9);\n\t\telse if (health >= 200) screen.renderMob((int) x, (int) y - 1, Sprite.health_8);\n\t\telse if (health >= 175) screen.renderMob((int) x, (int) y - 1, Sprite.health_7);\n\t\telse if (health >= 150) screen.renderMob((int) x, (int) y - 1, Sprite.health_6);\n\t\telse if (health >= 125) screen.renderMob((int) x, (int) y - 1, Sprite.health_5);\n\t\telse if (health >= 100) screen.renderMob((int) x, (int) y - 1, Sprite.health_4);\n\t\telse if (health >= 75) screen.renderMob((int) x, (int) y - 1, Sprite.health_3);\n\t\telse if (health >= 50) screen.renderMob((int) x, (int) y - 1, Sprite.health_2);\n\t\telse if (health >= 25) screen.renderMob((int) x, (int) y - 1, Sprite.health_1);\n\t}", "public void heal(float health) {\r\n \t\tthis.health += health;\r\n \t\tif(health > maxHealth) {\r\n \t\t\thealth = maxHealth;\r\n \t\t}\r\n \t}", "int getWidth();", "int getWidth();", "int getWidth();", "int getWidth();", "int getWidth();", "int getWidth();", "int getWidth();", "int getWidth();", "int getWidth();", "int getWidth();", "int getWidth();", "int getWidth();", "int getWidth();", "int getWidth();", "int getWidth();", "int getWidth();", "int getWidth();", "public double getWidth();", "public double getWidth();", "private void healthBarDamageAnimation(int player, double reduction) {\n\t\tTimeline timeline = new Timeline();\n\t\ttimeline.setCycleCount(1);\n\t\ttimeline.setAutoReverse(false);\n\t\tKeyValue kv = null;\n\t\tif (player == OPPONENT) {\n\t\t\tkv = new KeyValue(opponentHealthBar.widthProperty(),reduction);\n\t\t} else if (player == LOCAL) {\n\t\t\tkv = new KeyValue(localHealthBar.widthProperty(),reduction);\n\t\t}\n\t\tKeyFrame kf = new KeyFrame(Duration.millis(500), kv);\n\t\ttimeline.getKeyFrames().add(kf);\n\t\ttimeline.play();\n\t}", "public void reduceHealth(int damage, int player) {\n\t\tif (player == OPPONENT) {\n\t\t\tint currentHealth = Integer.parseInt(opponentHealth.getText());\n\t\t\tint newHealth = currentHealth - damage;\n\t\t\topponentHealth.setText(Integer.toString(newHealth));\n\t\t\tdouble reduction = opponentHealthBar.getWidth()*(((double)newHealth)/((double) currentHealth));\n\t\t\thealthBarDamageAnimation(0,reduction);\n\t\t} else if (player == LOCAL) {\n\t\t\tint currentHealth = Integer.parseInt(localHealth.getText());\n\t\t\tint newHealth = currentHealth - damage;\n\t\t\tlocalHealth.setText(Integer.toString(newHealth));\n\t\t\tdouble reduction = localHealthBar.getWidth()*(((double)newHealth)/((double) currentHealth));\n\t\t\thealthBarDamageAnimation(1,reduction);\n\t\t}\n\t}", "public void buyHealth() {\n this.healthMod++;\n heathMax += 70 * healthMod;\n }", "public void drawHealth(Graphics2D g2d) {\t\n\t\tg2d.setColor(new Color(0,0,0,200));\n\t\tint w = StagePanel.boardRectSize;\n\t\tint h = StagePanel.boardRectSize/6;\n\t\tint x = (int)getRectHitbox().getCenterX() - w/2;\n\t\tint y = (int)getRectHitbox().getCenterY() - parentGP.boardRect.getSize()/2;\n\t\t\n\t\tRectangle maxHealthShieldRect = new Rectangle(x, y, w, h);\n\t\tg2d.fill(maxHealthShieldRect);\n\t\tfloat unitHealthSize = (w*(1.0f/(maxHealth+maxShield)));\n\t\tRectangle maxHealthRect = new Rectangle(x,y, (int)(unitHealthSize * health), h);\n\t\tRectangle maxShieldRect = new Rectangle(x+(int)(unitHealthSize * health),y, (int)(unitHealthSize * shield), h);\n\t\tg2d.setColor(Commons.cHealth);\n\t\tg2d.fill(maxHealthRect);\n\t\tg2d.setColor(Commons.cShield);\n\t\tg2d.fill(maxShieldRect);\n\t\tg2d.setStroke(new BasicStroke(3)); \n\t\tg2d.setColor(Color.BLACK);\n\t\tg2d.draw(maxHealthShieldRect);\n\t\tif(parentGP.boardRect == StagePanel.curHoverBR || parentGP == StagePanel.curSelectedGP) {\n\t\t\tdrawHealthValues(g2d, x, y,StagePanel.boardRectSize/5);\n\t\t}\n\t}", "public void updateHealth(int healthLost){\n\t\thealth -= healthLost;\n\t\thealthLeftLabel.setText(\"\" + health);\n\t}", "protected double computePrefWidth(double aHeight) { return getWidth(); }", "protected double getPrefWidthImpl(double aH)\n {\n double pw = _chartArea.getPrefWidth();\n if(_yaxis.isVisible()) pw += _yaxis.getPrefWidth();\n return pw;\n }", "Length getWidth();", "public void heal(int healAmount){\r\n health+= healAmount;\r\n }", "public int heal(int magnitude) {\n int value = Math.min(magnitude, actor.getBaseHealth() - health);\n health += value;\n System.out.println(actor.getName() + \": \" + health);\n return value;\n }", "private static int devilHealthScale(int devilHealth, int playerLevel){\r\n if(playerLevel > 4){\r\n devilHealth = devilHealth + ((10 * (playerLevel - 4)));\r\n }\r\n return devilHealth;\r\n }", "public int getWidth() {\n // Replace the following line with your solution.\n return width;\n }", "public void updateHealthBars(List<Chara> list) {\n\n //TODO: how could this happen\n\n ((ProgressBar)findViewById(R.id.pbar1)).setProgress((int)((list.get(0).getHealth() / list.get(0).getMaxHealth()) * 100));\n ((ProgressBar)findViewById(R.id.pbar2)).setProgress((int)((list.get(1).getHealth() / list.get(1).getMaxHealth()) * 100));\n ((ProgressBar)findViewById(R.id.pbar3)).setProgress((int)((list.get(2).getHealth() / list.get(2).getMaxHealth()) * 100));\n ((ProgressBar)findViewById(R.id.pbar4)).setProgress((int)((list.get(3).getHealth() / list.get(3).getMaxHealth()) * 100));\n\n ((ProgressBar)findViewById(R.id.ebar1)).setProgress((int)((list.get(4).getHealth() / list.get(4).getMaxHealth()) * 100));\n ((ProgressBar)findViewById(R.id.ebar2)).setProgress((int)((list.get(5).getHealth() / list.get(5).getMaxHealth()) * 100));\n ((ProgressBar)findViewById(R.id.ebar3)).setProgress((int)((list.get(6).getHealth() / list.get(6).getMaxHealth()) * 100));\n ((ProgressBar)findViewById(R.id.ebar4)).setProgress((int)((list.get(7).getHealth() / list.get(7).getMaxHealth()) * 100));\n\n ((TextView)findViewById(R.id.pbart1)).setText(Math.round((int)list.get(0).getHealth()) + \"/\" + Math.round((int)list.get(0).getMaxHealth()));\n ((TextView)findViewById(R.id.pbart2)).setText(Math.round((int)list.get(1).getHealth()) + \"/\" + Math.round((int)list.get(1).getMaxHealth()));\n ((TextView)findViewById(R.id.pbart3)).setText(Math.round((int)list.get(2).getHealth()) + \"/\" + Math.round((int)list.get(2).getMaxHealth()));\n ((TextView)findViewById(R.id.pbart4)).setText(Math.round((int)list.get(3).getHealth()) + \"/\" + Math.round((int)list.get(3).getMaxHealth()));\n\n ((TextView)findViewById(R.id.ebart1)).setText(Math.round((int)list.get(4).getHealth()) + \"/\" + Math.round((int)list.get(4).getMaxHealth()));\n ((TextView)findViewById(R.id.ebart2)).setText(Math.round((int)list.get(5).getHealth()) + \"/\" + Math.round((int)list.get(5).getMaxHealth()));\n ((TextView)findViewById(R.id.ebart3)).setText(Math.round((int)list.get(6).getHealth()) + \"/\" + Math.round((int)list.get(6).getMaxHealth()));\n ((TextView)findViewById(R.id.ebart4)).setText(Math.round((int)list.get(7).getHealth()) + \"/\" + Math.round((int)list.get(7).getMaxHealth()));\n }", "String getWidth();", "String getWidth();", "public void reduceHealth(int damage){\n health -= damage;\n }", "public float getWidth()\n {\n return getBounds().width();\n }", "public int getBaseHealth()\r\n {\r\n return mBaseHealth;\r\n }", "long getWidth();", "public int getMaxHealth() {\n \t\treturn (int)(maxHealthModifier + (stamina/2 + strength/4)*Math.PI);\n \t}", "public int getHealthScaling()\r\n {\r\n return mHealthScaling;\r\n }", "public double manWeight(double height) {\n return (height - 100) * 1.15;\n }", "public void reduceAnimalHealth() {\n\t\thealth -= 10;\n\t}", "public void setHealthAmount( int count, int maxHealth ) {\n this.currentHealth = count;\n this.maxHealth = maxHealth;\n\n determineState();\n\n //put the bars on the screen\n rootTable.clearChildren();\n for ( int i = 0; i < count; i++ ) {\n rootTable.add( healthMeter.get( i ) ).top().left().size( 25f, 100f );\n }\n }", "public static String percentBar(double hpPercent) {\r\n\t\tif (hpPercent > 0 && hpPercent <= 5) {\r\n\t\t\treturn ChatColor.RED + \"\" + ChatColor.BOLD + \"|\" + ChatColor.GRAY + ChatColor.BOLD + \"|||||||||||||||||||\";\r\n\t\t} else if (hpPercent > 5 && hpPercent <= 10) {\r\n\t\t\treturn ChatColor.RED + \"\" + ChatColor.BOLD + \"||\" + ChatColor.GRAY + ChatColor.BOLD + \"||||||||||||||||||\";\r\n\t\t} else if (hpPercent > 10 && hpPercent <= 15) {\r\n\t\t\treturn ChatColor.RED + \"\" + ChatColor.BOLD + \"|||\" + ChatColor.GRAY + ChatColor.BOLD + \"|||||||||||||||||\";\r\n\t\t} else if (hpPercent > 15 && hpPercent <= 20) {\r\n\t\t\treturn ChatColor.RED + \"\" + ChatColor.BOLD + \"||||\" + ChatColor.GRAY + ChatColor.BOLD + \"||||||||||||||||\";\r\n\t\t} else if (hpPercent > 20 && hpPercent <= 25) {\r\n\t\t\treturn ChatColor.RED + \"\" + ChatColor.BOLD + \"|||||\" + ChatColor.GRAY + ChatColor.BOLD + \"|||||||||||||||\";\r\n\t\t} else if (hpPercent > 25 && hpPercent <= 30) {\r\n\t\t\treturn ChatColor.RED + \"\" + ChatColor.BOLD + \"||||||\" + ChatColor.GRAY + ChatColor.BOLD + \"||||||||||||||\";\r\n\t\t} else if (hpPercent > 30 && hpPercent <= 35) {\r\n\t\t\treturn ChatColor.YELLOW + \"\" + ChatColor.BOLD + \"|||||||\" + ChatColor.GRAY + ChatColor.BOLD + \"|||||||||||||\";\r\n\t\t} else if (hpPercent > 35 && hpPercent <= 40) {\r\n\t\t\treturn ChatColor.YELLOW + \"\" + ChatColor.BOLD + \"||||||||\" + ChatColor.GRAY + ChatColor.BOLD + \"||||||||||||\";\r\n\t\t} else if (hpPercent > 40 && hpPercent <= 45) {\r\n\t\t\treturn ChatColor.YELLOW + \"\" + ChatColor.BOLD + \"|||||||||\" + ChatColor.GRAY + ChatColor.BOLD + \"|||||||||||\";\r\n\t\t} else if (hpPercent > 45 && hpPercent <= 50) {\r\n\t\t\treturn ChatColor.YELLOW + \"\" + ChatColor.BOLD + \"||||||||||\" + ChatColor.GRAY + ChatColor.BOLD + \"||||||||||\";\r\n\t\t} else if (hpPercent > 50 && hpPercent <= 55) {\r\n\t\t\treturn ChatColor.YELLOW + \"\" + ChatColor.BOLD + \"|||||||||||\" + ChatColor.GRAY + ChatColor.BOLD + \"|||||||||\";\r\n\t\t} else if (hpPercent > 55 && hpPercent <= 60) {\r\n\t\t\treturn ChatColor.YELLOW + \"\" + ChatColor.BOLD + \"||||||||||||\" + ChatColor.GRAY + ChatColor.BOLD + \"||||||||\";\r\n\t\t} else if (hpPercent > 60 && hpPercent <= 65) {\r\n\t\t\treturn ChatColor.GREEN + \"\" + ChatColor.BOLD + \"|||||||||||||\" + ChatColor.GRAY + ChatColor.BOLD + \"|||||||\";\r\n\t\t} else if (hpPercent > 65 && hpPercent <= 70) {\r\n\t\t\treturn ChatColor.GREEN + \"\" + ChatColor.BOLD + \"||||||||||||||\" + ChatColor.GRAY + ChatColor.BOLD + \"||||||\";\r\n\t\t} else if (hpPercent > 70 && hpPercent <= 75) {\r\n\t\t\treturn ChatColor.GREEN + \"\" + ChatColor.BOLD + \"|||||||||||||||\" + ChatColor.GRAY + ChatColor.BOLD + \"|||||\";\r\n\t\t} else if (hpPercent > 75 && hpPercent <= 80) {\r\n\t\t\treturn ChatColor.GREEN + \"\" + ChatColor.BOLD + \"||||||||||||||||\" + ChatColor.GRAY + ChatColor.BOLD + \"||||\";\r\n\t\t} else if (hpPercent > 80 && hpPercent <= 85) {\r\n\t\t\treturn ChatColor.GREEN + \"\" + ChatColor.BOLD + \"|||||||||||||||||\" + ChatColor.GRAY + ChatColor.BOLD + \"|||\";\r\n\t\t} else if (hpPercent > 85 && hpPercent <= 90) {\r\n\t\t\treturn ChatColor.GREEN + \"\" + ChatColor.BOLD + \"||||||||||||||||||\" + ChatColor.GRAY + ChatColor.BOLD + \"||\";\r\n\t\t} else if (hpPercent > 90 && hpPercent <= 95) {\r\n\t\t\treturn ChatColor.GREEN + \"\" + ChatColor.BOLD + \"||||||||||||||||||\" + ChatColor.GRAY + ChatColor.BOLD + \"||\";\r\n\t\t} else if (hpPercent > 95 && hpPercent <= 100) {\r\n\t\t\treturn ChatColor.GREEN + \"\" + ChatColor.BOLD + \"|||||||||||||||||||\" + ChatColor.GRAY + ChatColor.BOLD + \"|\";\r\n\t\t} else {\r\n\t\t\treturn ChatColor.GRAY + \"\" + ChatColor.BOLD + \"||||||||||||||||||||\";\r\n\t\t}\r\n\t}", "public short getBowDamage();", "public double getWidth() {\n return this.getRight(this.tree.getRight(0)) - this.getLeft(this.tree.getLeft(0)); \n }", "public int getWidth();", "public int getWidth();", "public int getWidth();", "public int getHP()\n\t{\n\t\tUnit u = this;\n\t\tint hp = 0;\n\t\tfor(Command c : u.race.unitcommands)\n\t\t\tif(c.command.equals(\"#hp\"))\n\t\t\t\thp += Integer.parseInt(c.args.get(0));\n\t\t\n\t\tfor(Command c : u.getSlot(\"basesprite\").commands)\n\t\t\tif(c.command.equals(\"#hp\"))\n\t\t\t{\n\t\t\t\tString arg = c.args.get(0);\n\t\t\t\tif(c.args.get(0).startsWith(\"+\"))\n\t\t\t\t\targ = arg.substring(1);\n\t\t\t\t\n\t\t\t\thp += Integer.parseInt(arg);\n\t\t\t}\n\t\t\n\t\tif(hp > 0)\n\t\t\treturn hp;\n\t\telse\n\t\t\treturn 10;\n\t}" ]
[ "0.7451795", "0.6916663", "0.66805106", "0.6479202", "0.6461622", "0.6429302", "0.6309779", "0.6303994", "0.62995493", "0.6269139", "0.6231213", "0.62235725", "0.6201934", "0.6190981", "0.61777973", "0.6161714", "0.61499155", "0.6149867", "0.6145195", "0.61439365", "0.61435217", "0.6134156", "0.61314696", "0.6125233", "0.60969937", "0.6084074", "0.6029514", "0.6024136", "0.60220605", "0.6013746", "0.60121405", "0.5998207", "0.5998207", "0.5994626", "0.5994626", "0.59802186", "0.5958841", "0.5946331", "0.5929789", "0.5924324", "0.59068304", "0.590214", "0.59002984", "0.5899819", "0.5899067", "0.58926344", "0.5890023", "0.58843654", "0.58826005", "0.58734703", "0.5860851", "0.5860851", "0.5860851", "0.5860851", "0.5860851", "0.5860851", "0.5860851", "0.5860851", "0.5860851", "0.5860851", "0.5860851", "0.5860851", "0.5860851", "0.5860851", "0.5860851", "0.5860851", "0.5860851", "0.58557403", "0.58557403", "0.58557326", "0.5846298", "0.58271563", "0.5824188", "0.58234626", "0.58189434", "0.58177924", "0.5810478", "0.580877", "0.58056575", "0.5804506", "0.57998306", "0.57970107", "0.57930416", "0.57930416", "0.5774324", "0.57699007", "0.5740242", "0.5739855", "0.5737077", "0.57370615", "0.5735695", "0.5732228", "0.57203144", "0.570743", "0.5705792", "0.5700412", "0.56963956", "0.56963956", "0.56963956", "0.56895655" ]
0.7102344
1
Metodos de instancia Constructores Construtor por omissao
public Mencacao() { texto = ""; deUtilizador = ""; data = new GregorianCalendar(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public ControladorCoche() {\n\t}", "public contrustor(){\r\n\t}", "public ControladorPrueba() {\r\n }", "public static Construtor construtor() {\n return new Construtor();\n }", "public ContatosResource() {\n }", "public Ctacliente() {\n\t}", "public solicitudControlador() {\n }", "public Caso_de_uso () {\n }", "Concierto createConcierto();", "Cancion createCancion();", "public InventarioControlador() {\n }", "public Conexion(){\n \n }", "public ControllerProtagonista() {\n\t}", "private ControleurAcceuil(){ }", "public ControladorUsuario() {\n }", "public Composante() {\n\t\tsuper();\n\t\t// TODO Auto-generated constructor stub\n\t}", "protected ContaCapitalCadastroDaoFactory() {\n\t\t\n\t}", "public ControladorCatalogoServicios() {\r\n }", "public Principal() {\n initComponents();\n empresaControlador = new EmpresaControlador();\n clienteControlador = new ClienteControlador();\n vehiculoControlador = new VehiculoControlador();\n servicioControlador = new ServicioControlador();\n archivoObjeto = new ArchivoObjeto(\"/home/diego/UPS/56/ProgramacionAplicada/Parqueadero/src/archivo/ClienteArchivo.obj\");// Ruta Absolojuta\n archivosBinarios = new ArchivosBinarios();\n archivosBinariosAleatorio = new ArchivosBinariosAleatorio(\"ServicioArchivo.dat\");//Ruta relativa\n }", "public TelaConversao() {\n initComponents();\n }", "public Carrinho() {\n\t\tsuper();\n\t}", "Compleja createCompleja();", "private CompanyManager() {}", "OperacionColeccion createOperacionColeccion();", "public Sistema(){\r\n\t\t\r\n\t}", "public Corso() {\n\n }", "protected Approche() {\n }", "private BaseDatos() {\n }", "public OmsUsuario() {\n\t}", "protected abstract void construct();", "public Contato() {\n }", "public ContaBancaria() {\n }", "public MPaciente() {\r\n\t}", "public CorreoElectronico() {\n }", "public ConfigurationMaintainer() {\n\t}", "private RepositorioOrdemServicoHBM() {\n\n\t}", "public PersistenciaCMT() {\n\n }", "Compuesta createCompuesta();", "public controladorCategorias() {\r\n }", "public Carrera(){\n }", "public TipoInformazioniController() {\n\n\t}", "public lesPostesControlesImpl() {\n }", "private DittaAutonoleggio(){\n \n }", "public UsuarioControlador() {\n }", "public Alojamiento() {\r\n\t}", "public void construirCargo() {\n persona.setCargo(Cargos.SUPERVISOR);\n }", "public FicheConnaissance() {\r\n }", "public UnidadDAO() {\n this.setCon(cs.getConection());\n \n }", "public CCuenta()\n {\n }", "public paciente()\n {\n con = new bdconexion(); //instancia la clase bdconexion\n }", "private Conf() {\n // empty hidden constructor\n }", "public Odontologo() {\n }", "private ATCres() {\r\n // prevent to instantiate this class\r\n }", "private TMCourse() {\n\t}", "private void __sep__Constructors__() {}", "public CalccustoRequest()\r\n\t{\r\n\t}", "public AvaliacaoRisco() {\n }", "public Propuestas() {}", "public void consulterClassement() {\n\t\t\n\t}", "private Connection() {\n \n }", "public Cohete() {\n\n\t}", "public PSRelation()\n {\n }", "public Curso() {\r\n }", "public LocalResidenciaColaborador() {\n //ORM\n }", "public FiltroCreditoTipo() {\r\n\t}", "public CianetoClass() {\r\n this.cianetoMethods = new Hashtable<String, Object>();\r\n this.cianetoAttributes = new Hashtable<String, Object>();\r\n }", "@Override\n\tpublic void createConseille(Conseille c) {\n\t\t\n\t}", "public Clade() {}", "public Candidatura (){\n \n }", "private MApi() {}", "private DatabaseOperations() {\n }", "public CadastroCurso() {\n initComponents();\n configTela();\n }", "private OptimoveConfig() {\n }", "public CMN() {\n\t}", "public DarAyudaAcceso() {\r\n }", "public ClasificacionBean() {\r\n }", "private SimpleRepository() {\n \t\t// private ct to disallow external object creation\n \t}", "public DaoConnection() {\n\t\t\n\t}", "public Documento() {\n\n\t}", "public FiltroMicrorregiao() {\r\n }", "public Cinema() {\n login = new Login();\n register = new Register();\n filmDisplay = new FilmDisplay();\n filmEdit = new FilmEdit();\n profile = new Profile();\n bookingSystem = new BookingSystem();\n setupScreensFromDB();\n }", "public TelaPrincipal() {\r\n initComponents();\r\n con.conecta();\r\n }", "public prueba()\r\n {\r\n }", "public Captura() {\n initComponents();\n }", "public Coche() {\n super();\n }", "private Config() {\n }", "public Cgg_res_oficial_seguimiento_usuario(){}", "public ControladorCatalogoEstado() {\r\n }", "public ConsommersResource() {\r\n }", "public CarroResource() {\r\n }", "public Troco() {\n }", "public PConductor() {\n initComponents();\n PNew();\n PGetConductor(TxtBusqueda.getText(), \"T\");\n \n }", "public void initControles(){\n\n }", "private UsineJoueur() {}", "public ConfigCuenta() {\n initComponents();\n }", "public CuerpoCeleste() {\n\t\t// Start of user code constructor for CuerpoCeleste)\n\t\tsuper();\n\t\t// End of user code\n\t}", "public nomina()\n {\n deducidoClase = new deducido();\n devengadoClase = new devengado();\n }", "public TutorIndustrial() {}", "public Constructor(){\n\t\t\n\t}", "private Marinator() {\n }", "private Marinator() {\n }" ]
[ "0.7148826", "0.7054171", "0.681745", "0.6800402", "0.6691309", "0.6634", "0.65842074", "0.6554129", "0.6518607", "0.65107304", "0.64992684", "0.6474173", "0.64555377", "0.6453748", "0.6451458", "0.6449877", "0.64495486", "0.6439368", "0.64289606", "0.6409438", "0.6405574", "0.63921046", "0.6357035", "0.6347852", "0.6347285", "0.633991", "0.6334008", "0.6330733", "0.63241273", "0.6307433", "0.6302538", "0.62966496", "0.628573", "0.62750936", "0.62579155", "0.6254645", "0.6249241", "0.6248644", "0.62425315", "0.62339556", "0.62285465", "0.62246776", "0.6218266", "0.6198112", "0.6192203", "0.61832964", "0.6173362", "0.61599797", "0.6142345", "0.61364836", "0.6132047", "0.6123749", "0.61201125", "0.6113083", "0.6112392", "0.61093235", "0.6102971", "0.6096678", "0.609219", "0.60907966", "0.6085659", "0.6084599", "0.6083622", "0.60816276", "0.60758835", "0.60701084", "0.6051896", "0.60442555", "0.6043027", "0.6042011", "0.60381186", "0.60349125", "0.6033352", "0.602709", "0.6022502", "0.6013646", "0.6011628", "0.60070056", "0.5997653", "0.5995318", "0.5994053", "0.5990122", "0.5987887", "0.59853387", "0.59851515", "0.5985141", "0.5974978", "0.59725267", "0.596254", "0.5960668", "0.59590596", "0.5957946", "0.59554124", "0.59533596", "0.59421337", "0.59394354", "0.59376544", "0.59366083", "0.59351045", "0.59283453", "0.59283453" ]
0.0
-1
Log.d("picher", "keyCode:" + keyCode + " KeyEvent:" + event.getAction());
@Override public boolean onKeyDown(int keyCode, KeyEvent event) { switch (event.getAction()) { case KeyEvent.ACTION_DOWN: if (keyCode == KeyEvent.KEYCODE_BACK) { if (getSupportFragmentManager().getBackStackEntryCount() > 0) { //Log.d("picher", "stackCount:" + getSupportFragmentManager().getBackStackEntryCount() + "fragments:" + getSupportFragmentManager().getFragments().size()); for (int i = 0; i < getSupportFragmentManager().getBackStackEntryCount(); i++) { // Log.d("picher", "backStackName:" + getSupportFragmentManager().getBackStackEntryAt(i).getName()); } getSupportFragmentManager().popBackStackImmediate(); for (int i = 0; i < getSupportFragmentManager().getBackStackEntryCount(); i++) { //Log.d("picher", "弹栈之后backStackName:" + getSupportFragmentManager().getBackStackEntryAt(i).getName()); } return true; } } break; } return super.onKeyDown(keyCode, event); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void keyPressed( KeyEvent e ) { }", "@Override\n public void keyboardAction( KeyEvent ke )\n {\n \n }", "@Override\n public void onKeyPressed(KeyEvent event) {\n }", "@Override\n\tpublic void onKey(KeyEvent e) {\n\n\t}", "public void keyPressed(KeyEvent e) { }", "@Override\n public void keyPressed(KeyEvent e) {\n\n\n }", "@Override\r\n public void keyPressed(KeyEvent e) {\n\r\n }", "@Override\n\tpublic boolean onKeyDown(int keyCode, KeyEvent event) {\n\t\tLog.d(\"UI\", String.format(\"onKeyDown[%d]\",keyCode ));\n\t\treturn super.onKeyDown(keyCode, event);\n\t}", "@Override\r\n\tpublic boolean onKeyDown(int keyCode, KeyEvent event) {\n\t\tLog.d(TAG, \"onKeyDown===\"+event.getKeyCode()+\"\");\r\n\t\treturn super.onKeyDown(keyCode, event);\r\n\t}", "@Override\n public void keyPressed(KeyEvent e) {\n\n }", "@Override\n public void keyPressed(KeyEvent e) {\n\n }", "public void onKeyPress(Widget sender, char keyCode, int modifiers) {\n }", "@Override\n public boolean onKeyDown(int keyCode, KeyEvent event) {\n return super.onKeyDown(keyCode, event);\n }", "public void keyPressed(KeyEvent e) {}", "@Override\r\n public void keyPressed(KeyEvent e) {\n \r\n }", "public void keyPressed(KeyEvent e) {\n\r\n\t}", "@Override\r\n\tpublic void keyPressed(KeyEvent e) {\n\r\n\t}", "@Override\r\n\tpublic void keyPressed(KeyEvent e) {\n\r\n\t}", "@Override\r\n\t\t\tpublic void keyPressed(KeyEvent e) {\n\r\n\t\t\t}", "@Override\r\n\t\t\tpublic void keyPressed(KeyEvent e) {\n\r\n\t\t\t}", "@Override\r\n\t\t\tpublic void keyPressed(KeyEvent e) {\n\r\n\t\t\t}", "@Override\r\n\t\t\tpublic void keyPressed(KeyEvent e) {\n\r\n\t\t\t}", "@Override\r\n\t\t\tpublic void keyPressed(KeyEvent e) {\n\r\n\t\t\t}", "@Override\r\n\t\t\tpublic void keyPressed(KeyEvent e) {\n\r\n\t\t\t}", "@Override\r\n\t\t\tpublic void keyPressed(KeyEvent e) {\n\r\n\t\t\t}", "@Override\n\tpublic boolean onKeyDown(int keyCode, KeyEvent event) {\n\t\tLogUtil.log(\"onKeyDown:\" + keyCode);\n\t\treturn super.onKeyDown(keyCode, event);\n\t}", "@Override\n public void keyPressed(KeyEvent e) {\n }", "@Override\n public void keyPressed(KeyEvent e) {\n }", "@Override\n public void keyPressed(KeyEvent e) {\n }", "@Override\n public void keyPressed(KeyEvent e) {\n }", "@Override\n public void keyPressed(KeyEvent e) {\n }", "@Override\n public void keyPressed(KeyEvent e) {\n }", "@Override\n public void keyPressed(KeyEvent e) {\n }", "@Override\n public void keyPressed(KeyEvent e) {\n }", "public void keyPressed(KeyEvent e) {\n \n }", "public void keyPressed(KeyEvent e) {\n \n }", "public void keyPressed(KeyEvent e) {\n \n }", "@Override\n public void keyPressed(KeyEvent e) {\n }", "@Override\n public void keyPressed(KeyEvent e) {\n }", "@Override\n public void keyPressed(KeyEvent e) {\n }", "boolean onKeyPressed(KeyEvent event);", "@Override\n\tpublic void onKeyUp(int keyCode, KeyEvent event) {\n\t\t\n\t}", "@Override\n public void keyPressed(KeyEvent e) {}", "@Override\n public void keyPressed(KeyEvent e) {\n \n \n }", "@Override\r\n public void keyPressed(KeyEvent e) {\n }", "@Override\r\n\tpublic void handle(KeyEvent event) {\n\t}", "@Override\n\t\t\t\t\t\t\t\t\t\t\tpublic void keyPressed(KeyEvent e) {\n\n\t\t\t\t\t\t\t\t\t\t\t}", "@Override public boolean onKeyDown(int keyCode, KeyEvent event) {\n \tint c = (event.getUnicodeChar());\n \tLog.i(\"main\", \"onKeyDown \" + keyCode + \" = \" + (char)c);\n \tif(keyCode == KeyEvent.KEYCODE_MENU){\n \t\tshowMenu();\n \t\treturn true;\n \t}\n \t\n \tif(c > 48 && c < 57 || c > 96 && c < 105){\n \t\t_keyboardBuffer += (\"\" + (char)c);\n \t}\n \tif(_keyboardBuffer.length() >= 2){\n \t\tLog.i(\"main\", \"handleClickFromPositionString \" + _keyboardBuffer); \n \t\t_chessView.handleClickFromPositionString(_keyboardBuffer);\n \t\t_keyboardBuffer = \"\";\n \t}\n \t/*\n switch (keyCode) {\n case KeyEvent.KEYCODE_DPAD_CENTER:\n \t_chessView.dpadSelect();\n return true;\n case KeyEvent.KEYCODE_DPAD_DOWN:\n \t_chessView.dpadDown();\n return true;\n case KeyEvent.KEYCODE_DPAD_LEFT:\n \t_chessView.dpadLeft();\n return true;\n case KeyEvent.KEYCODE_DPAD_RIGHT:\n \t_chessView.dpadRight();\n return true;\n case KeyEvent.KEYCODE_DPAD_UP:\n \t_chessView.dpadUp();\n return true;\n }\n */\n return super.onKeyDown(keyCode, event);\n }", "@Override\r\n\tpublic void keyPressed(KeyEvent e) {\n\t}", "@Override\n\tpublic void keyPressed(KeyEvent e) {\n\n\t}", "@Override\n\tpublic void keyPressed(KeyEvent e) {\n\n\t}", "@Override\n\tpublic void keyPressed(KeyEvent e) {\n\n\t}", "@Override\n\tpublic void keyPressed(KeyEvent e) {\n\n\t}", "@Override\n public void keyPressed(KeyEvent e) {\n }", "@Override\n\tpublic void keyPressed(KeyEvent e) {\n\t\n\t}", "public void keyPressed(KeyEvent e) {\n System.out.println(\"keyPressed\");\n }", "@Override\n\t\t\tpublic void keyPressed(KeyEvent e) {\n\t\t\t\t\n\t\t\t}", "@Override\n\t\t\tpublic void keyPressed(KeyEvent e) {\n\t\t\t\t\n\t\t\t}", "@Override\n\t\t\tpublic void keyPressed(KeyEvent e) {\n\t\t\t\t\n\t\t\t}", "@Override\n\tpublic void keyPressed(KeyEvent e) {\n\t}", "@Override\n\tpublic void keyPressed(KeyEvent e) {\n\t}", "@Override\r\n\tpublic boolean onKeyDown(int keyCode, KeyEvent event) {\n\t\treturn super.onKeyDown(keyCode, event);\r\n\t}", "public native void onKeyDown( KeyEvent event, long time, int keyCode, int metaState, int unicodeChar, int repeatCount );", "public void keyPressed(KeyEvent e) {\n\t\t\r\n\t}", "@Override\r\n\tpublic void keyPressed(KeyEvent e) {\n\t\t\r\n\t}", "@Override\r\n\tpublic void keyPressed(KeyEvent e) {\n\t\t\r\n\t}", "@Override\r\n\tpublic void keyPressed(KeyEvent e) {\n\t\t\r\n\t}", "@Override\r\n\tpublic void keyPressed(KeyEvent e) {\n\t\t\r\n\t}", "@Override\n\tpublic void keyPressed(KeyEvent e) {\n\t\t\n\t}", "@Override\n\tpublic void keyPressed(KeyEvent e) {\n\t\t\n\t}", "@Override\n\tpublic void keyPressed(KeyEvent e) {\n\t\t\n\t}", "@Override\n\tpublic void keyPressed(KeyEvent e) {\n\t\t\n\t}", "@Override\n\tpublic void keyPressed(KeyEvent e) {\n\t\t\n\t}", "@Override\n\tpublic void keyPressed(KeyEvent e) {\n\t\t\n\t}", "@Override\n\tpublic void keyPressed(KeyEvent e) {\n\t\t\n\t}", "@Override\n\tpublic void keyPressed(KeyEvent e) {\n\t\t\n\t}", "@Override\n\tpublic void keyPressed(KeyEvent e) {\n\t\t\n\t}", "@Override\n public void onKeyDown(MHKeyEvent e)\n {\n \n }", "@Override\r\n\tpublic boolean dispatchKeyEvent(KeyEvent event) {\n\t\tLog.d(TAG, \"dispatchKeyEvent===\"+event.getKeyCode()+\"\");\r\n\t\treturn super.dispatchKeyEvent(event);\r\n\t}", "@Override\r\n public void keyPressed(KeyEvent e) {\r\n\r\n }", "public void keyTyped(KeyEvent e) {\n\r\n }", "public void keyPressed(KeyEvent e) \r\n { \r\n keyUser = e.getKeyCode();\r\n }", "public void keyPressed(KeyEvent e) {\n\t\t\t\t\t}", "@Override\r\n\t\t\tpublic void keyPressed(KeyEvent e) {\n\t\t\t\t\r\n\t\t\t}", "@Override\n\tpublic boolean onKeyDown(int keyCode, KeyEvent event) {\n\t\treturn super.onKeyDown(keyCode, event);\n\t}", "private void button1KeyPressed(KeyEvent e) {\n }", "@Override\r\n\t\tpublic void keyPressed(KeyEvent e) {\n\t\t}", "@Override\r\n public void keyTyped(KeyEvent e) {\n\r\n }", "@Override\r\n public void keyTyped(KeyEvent e) {\n\r\n }", "public void keyPressed(KeyEvent e) {\n }", "@Override\n public void keyReleased(KeyEvent e) {\n\n }", "int getKeyCode();", "@Override\r\n\t\t\tpublic void keyPressed(KeyEvent e) {\n\t\t\t\tevent(e, vt.get(3));\r\n\t\t\t}", "@Override\n public void onDirectDownKeyPress() {\n \n }", "@Override\n public void onDirectDownKeyPress() {\n \n }", "@Override\n\t\t\tpublic void keyPressed(KeyEvent e) {\n\n\t\t\t}", "@Override\n\t\t\tpublic void keyPressed(KeyEvent e) {\n\n\t\t\t}", "@Override\n\t\t\tpublic void keyPressed(KeyEvent e) {\n\n\t\t\t}", "@Override\n\t\t\tpublic void keyPressed(KeyEvent e) {\n\n\t\t\t}", "@Override\n\t\t\tpublic void keyPressed(KeyEvent e) {\n\n\t\t\t}", "@Override\n\t\t\tpublic void keyPressed(KeyEvent e) {\n\n\t\t\t}" ]
[ "0.78108156", "0.7776138", "0.7704395", "0.7639495", "0.7577908", "0.7544983", "0.75394315", "0.7528034", "0.75249726", "0.7516199", "0.7516199", "0.7514123", "0.74886733", "0.7473155", "0.73942554", "0.73792106", "0.73706144", "0.73706144", "0.7364796", "0.7364796", "0.7364796", "0.7364796", "0.7364796", "0.7364796", "0.7364796", "0.7352055", "0.73373514", "0.73373514", "0.73373514", "0.73373514", "0.73373514", "0.73373514", "0.73373514", "0.73373514", "0.73350525", "0.73350525", "0.73350525", "0.73296887", "0.73296887", "0.73296887", "0.73246014", "0.73060864", "0.7305345", "0.72904265", "0.728116", "0.72779495", "0.7274827", "0.7266242", "0.7259147", "0.72376925", "0.72376925", "0.72376925", "0.72376925", "0.72323704", "0.7224641", "0.722419", "0.7217354", "0.7217354", "0.7217354", "0.7208112", "0.7208112", "0.71789914", "0.7174373", "0.7171439", "0.7170963", "0.7170963", "0.7170963", "0.7170963", "0.717024", "0.717024", "0.717024", "0.717024", "0.717024", "0.717024", "0.717024", "0.717024", "0.717024", "0.71634495", "0.71218556", "0.71154404", "0.71087253", "0.7108351", "0.710684", "0.71054846", "0.71029675", "0.70883787", "0.7082729", "0.7059639", "0.7059639", "0.7054358", "0.7050818", "0.7048198", "0.7046409", "0.70442414", "0.70442414", "0.7042235", "0.7042235", "0.7042235", "0.7042235", "0.7042235", "0.7042235" ]
0.0
-1
Constructs a new Identifier with data type and name
public Identificador(String name) { this.name = name; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "IdentifierType createIdentifierType();", "IdentifiersType createIdentifiersType();", "public DataType(String dataName) {\n /*try {\n basicType = this.getClass().getName();\n idForDataType = this.getClass().getName();\n } catch (Exception ex) {\n Logger.getLogger(DataType.class).fatal(\"Failed to generate a unique id: \" +\n ex.getMessage(),ex);\n }*/\n this.dataName = dataName;\n }", "public IdentifierType(String name, String description)\r\n\t{\r\n\t\tsetName(name);\r\n\t\tsetDescription(description);\r\n\t}", "String getIdentifierName(String name, String type);", "org.hl7.fhir.Identifier addNewIdentifier();", "public IdentifierDt addIdentifier() {\n\t\tIdentifierDt newType = new IdentifierDt();\n\t\tgetIdentifier().add(newType);\n\t\treturn newType; \n\t}", "private IIdentifierElement createIdentifier() throws RodinDBException {\n\t\tfinal IContextRoot ctx = createContext(\"ctx\");\n\t\treturn ctx.createChild(ICarrierSet.ELEMENT_TYPE, null, null);\n\t}", "static Identifier makeDataCons(final QualifiedName name) {\r\n if (name == null) {\r\n return null;\r\n } else {\r\n return new Identifier(Category.DATA_CONSTRUCTOR, name);\r\n }\r\n }", "public DataType(String idForDataType, String dataName) {\n basicType = this.getClass().getName();\n this.idForDataType = idForDataType;\n this.dataName = dataName;\n }", "private Identifier(Scope scope, Type type, String name, String value){\n if(scope == null || type == null || name == null || value == null){\n throw new IllegalStateException(\"Cannot assign nullvalue\");\n }\n this.scope = scope;\n this.type = type;\n this.name = name;\n this.value = value;\n }", "java.lang.String getIdentifier();", "public T getIdentifier();", "Identifier getId();", "DataNameReference createDataNameReference();", "I getIdentifier();", "public interface Identifier extends Serializable, Comparable<Identifier> {\n byte byteValue();\n\n short shortValue();\n\n int intValue();\n\n /**\n * @return\n */\n default long longValue() {\n return lowValue();\n }\n\n long highValue();\n\n long lowValue();\n\n void reset(long v);\n\n void reset(long mostSigBits, long leastSigBits);\n\n void increase();\n\n int compare(Identifier i);\n\n static Identifier create() {\n return new IdentifierImpl(-1L);\n }\n\n static Identifier create(long l) {\n return new IdentifierImpl(l);\n }\n\n static Identifier create(Identifier i) {\n return new IdentifierImpl(i.highValue(), i.lowValue());\n }\n\n static Identifier randomIdentifier() {\n return new IdentifierImpl(UUID.randomUUID());\n }\n}", "public ID(String id) {\n this.type = id.charAt(0);\n this.UID = id;\n }", "DataType createDataType();", "private TypeDb createTypeInstance(long id, String nameEn) {\n TypeDb typeDb = new TypeDb();\n typeDb.setId(id);\n typeDb.setTypeNameEn(nameEn);\n typeDb.setTypeNameRu(new TypeMapper().toRu(nameEn));\n return typeDb;\n }", "String getIdentifier();", "String getIdentifier();", "String getIdentifier();", "String getIdentifier();", "String getIdentifier();", "String getIdentifier();", "String getIdentifier();", "public String getIdentifierString();", "static Identifier makeTypeCons(final QualifiedName name) {\r\n if (name == null) {\r\n return null;\r\n } else {\r\n return new Identifier(Category.TYPE_CONSTRUCTOR, name);\r\n }\r\n }", "public LlvmValue visit(IdentifierType n){\n\t\tSystem.out.format(\"identifiertype*******\\n\");\n\t\t\n\t\t//%class.name\n\t\tStringBuilder name = new StringBuilder();\n\t\t\n\t\tname.append(n.name);\n\t\t\n\t\t//System.out.format(\"name: %s\\n\",name.toString());\n\t\t\n\t\t//Cria classType -> %class.name\n\t\tLlvmClassInfo classType = new LlvmClassInfo(name.toString());\t\n\n\t\treturn classType;\n\t}", "void addId(II identifier);", "private static ExpressionTree createQualIdent(WorkingCopy workingCopy, String typeName) {\n TypeElement typeElement = workingCopy.getElements().getTypeElement(typeName);\n if (typeElement == null) {\n typeElement = workingCopy.getElements().getTypeElement(\"java.lang.\" + typeName);\n if (typeElement == null) {\n return workingCopy.getTreeMaker().Identifier(typeName);\n }\n }\n return workingCopy.getTreeMaker().QualIdent(typeElement);\n }", "protected abstract String getIdentifier();", "private UniqueIdentifier(){\n\t\t\n\t}", "public String getIdentifier();", "public String getIdentifier();", "public IntegerIdentifier(String name, int type, int value) {\n super(name, type); //String and integer declaration\n this.value = value;//set this.value to value\n }", "public Builder setIdentifier(\n java.lang.String value) {\n if (value == null) {\n throw new NullPointerException();\n }\n bitField0_ |= 0x00000001;\n identifier_ = value;\n onChanged();\n return this;\n }", "org.hl7.fhir.Identifier getIdentifier();", "public IdentifierNode getIdentifier()throws ClassCastException;", "int getIdentifier();", "NamedType createNamedType();", "@NonNull String identifier();", "Rule STIdentifier() {\n // Push 1 IdentifierNode onto value stack\n return Sequence(\n Sequence(\n FirstOf(Letter(), \"_\"),\n ZeroOrMore(FirstOf(IndentChar(), \"-\"))),\n actions.pushIdentifierNode(),\n WhiteSpace());\n }", "public int getIdentifier();", "<U extends T> U create(String name, Class<U> type) throws InvalidUserDataException;", "public void setIdentifier(String value) {\n/* 214 */ setValue(\"identifier\", value);\n/* */ }", "public org.hl7.fhir.Identifier addNewIdentifier()\n {\n synchronized (monitor())\n {\n check_orphaned();\n org.hl7.fhir.Identifier target = null;\n target = (org.hl7.fhir.Identifier)get_store().add_element_user(IDENTIFIER$0);\n return target;\n }\n }", "public org.hl7.fhir.Identifier addNewIdentifier()\n {\n synchronized (monitor())\n {\n check_orphaned();\n org.hl7.fhir.Identifier target = null;\n target = (org.hl7.fhir.Identifier)get_store().add_element_user(IDENTIFIER$0);\n return target;\n }\n }", "private GSC_DataType( String s )\n {\n name = s;\n nameHash.put( s, this );\n intValue = index;\n intHash.put( new Integer( intValue ), this );\n }", "IdentifiersFactory getIdentifiersFactory();", "public interface Identifier {\n\n public String getIdentifier();\n\n}", "private GSC_DataType( String s, int i )\n {\n name = s;\n nameHash.put( s, this );\n intValue = i + ( ttlPackage.getInt() << 16 );\n intHash.put( new Integer( intValue ), this );\n }", "IdentifierReferenceQualifier createIdentifierReferenceQualifier();", "@Test\n\tpublic void testIdentifier() throws ParseException {\n\t\tIdentifier identifier = langParser(\"foo\").identifier();\n\t\tassertEquals(identifier.getName(), \"foo\");\n\t}", "public SymName(String n) {\n\tn = n.trim();\n\tfullName = n;\n\tcomp = Util.findComponents(n);\n\tnum_comp = comp.length;\n\ttype = new int[num_comp];\n }", "public au.gov.asic.types.DocumentIdentifierType addNewAsicIdentifier()\n {\n synchronized (monitor())\n {\n check_orphaned();\n au.gov.asic.types.DocumentIdentifierType target = null;\n target = (au.gov.asic.types.DocumentIdentifierType)get_store().add_element_user(ASICIDENTIFIER$0);\n return target;\n }\n }", "int toIdentifier() {\n return 1000 * y + x;\n }", "@SuppressWarnings(\"unchecked\")\n public T decodeIdentifier() throws IOException {\n Class<? extends TokenIdentifier> cls = getClassForIdentifier(getKind());\n if (cls == null) {\n return null;\n }\n TokenIdentifier tokenIdentifier = ReflectionUtils.newInstance(cls, null);\n ByteArrayInputStream buf = new ByteArrayInputStream(identifier);\n DataInputStream in = new DataInputStream(buf);\n tokenIdentifier.readFields(in);\n in.close();\n return (T) tokenIdentifier;\n }", "public Identification(int id, String name) {\n\t\tthis.id = id;\n\t\tthis.name = name;\n\t}", "public String getIdentifier() {\n/* 222 */ return getValue(\"identifier\");\n/* */ }", "IDType getID();", "BaseTypeIdImpl(String schemaName, String unqualifiedName )\n {\n this.schemaName = schemaName;\n this.unqualifiedName = unqualifiedName;\n }", "public int identifier();", "public String getNamedId();", "DatatypeType createDatatypeType();", "ColumnIdentifier<ENTITY> identifier();", "@Test\n public void constructorId() {\n final String ID = \"ID\";\n final CourseType courseType = new CourseType(ID);\n\n assertSame(ID, courseType.getId());\n assertNull(courseType.getName());\n assertNull(courseType.getPicture());\n assertNull(courseType.getPosition());\n assertNull(courseType.getStatus());\n assertNull(courseType.getCourses());\n assertNull(courseType.getAllowedDishes());\n }", "private DataType(int value, String name, String literal) {\n\t\tthis.value = value;\n\t\tthis.name = name;\n\t\tthis.literal = literal;\n\t}", "public void setName(Identifier name) throws SourceException;", "public ObjectID() {\n UUID u = UUID.randomUUID();\n data = storeData(u, IDVersion.SIMPLE);\n }", "protected Identifier toIdentifier(String stringForm, MetadataBuildingContext buildingContext) {\n\t\treturn buildingContext.getMetadataCollector()\n\t\t\t\t.getDatabase()\n\t\t\t\t.getJdbcEnvironment()\n\t\t\t\t.getIdentifierHelper()\n\t\t\t\t.toIdentifier( addUnderscores(stringForm) );\n\t}", "public Variable createVariable(String name, int offset, DataType dataType, SourceType source)\n\t\t\tthrows DuplicateNameException, InvalidInputException;", "public String asIdentifier() {\n\t\treturn this.keyword.toLowerCase().replace(' ', '_').replace('.', '_');\n\t}", "private HydroPlantType(int value, String name, String literal) {\n\t\tthis.value = value;\n\t\tthis.name = name;\n\t\tthis.literal = literal;\n\t}", "public au.gov.asic.types.MessageIdentifierType.CustomerIdentifier.Identifier addNewIdentifier()\n {\n synchronized (monitor())\n {\n check_orphaned();\n au.gov.asic.types.MessageIdentifierType.CustomerIdentifier.Identifier target = null;\n target = (au.gov.asic.types.MessageIdentifierType.CustomerIdentifier.Identifier)get_store().add_element_user(IDENTIFIER$2);\n return target;\n }\n }", "public Identifier getName();", "AtomID ID();", "public static Object createNameforNewEnsemble(Map extendedData) {\n \t\treturn \"A dynamic name\";\r\n \t}", "public ConstellationIdentifier identifier();", "RecordType newRecordType(String recordTypeId, QName name) throws TypeException;", "private Identifier(final Category category, final QualifiedName name) {\r\n if (category == null || name == null) {\r\n throw new NullPointerException();\r\n }\r\n \r\n this.category = category;\r\n this.name = name;\r\n }", "public ID(char Type) {\n\n this.type = Type;\n\n if (Type == CARD) {\n this.UID = \"1\" + String.format(\"%08d\", globalCardCount);\n globalCardCount++;\n } else if (Type == RIDER) {\n this.UID = \"2\" + String.format(\"%08d\", globalRiderCount);\n globalRiderCount++;\n } else {\n System.out.println(\"Input Invalid\");\n }\n }", "Rule Identifier() {\n // Push 1 IdentifierNode onto the value stack\n return Sequence(\n Sequence(\n FirstOf(Letter(), \"_\"),\n ZeroOrMore(IndentChar())),\n actions.pushIdentifierNode(),\n WhiteSpace());\n }", "Id createId();", "public StructuredId createSubId()\r\n {\r\n return new StructuredId(this, id + \".\" + numSubIds.incrementAndGet());\r\n }", "@JsonCreator\n public static DataType fromString(String name) {\n return fromString(name, DataType.class);\n }", "public static String toIdentifierToken (String pValue)\n {\n // See if it's a valid java identifier\n if (isJavaIdentifier (pValue)) {\n return pValue;\n }\n\n // Return as a String literal\n else {\n return toStringToken (pValue);\n }\n }", "public java.lang.String getIdentifier() {\n java.lang.Object ref = identifier_;\n if (ref instanceof java.lang.String) {\n return (java.lang.String) ref;\n } else {\n com.google.protobuf.ByteString bs = \n (com.google.protobuf.ByteString) ref;\n java.lang.String s = bs.toStringUtf8();\n if (bs.isValidUtf8()) {\n identifier_ = s;\n }\n return s;\n }\n }", "RecordType createRecordType();", "UniqueType createUniqueType();", "void setUniformTypeIdentifier(String v) {\n if (v == null) {\n throw new IllegalArgumentException(\"Uniform Type Identifier is missing\");\n }\n uti = v;\n }", "BaseTypeIdImpl(String SQLTypeName)\n {\n this.schemaName = null;\n this.unqualifiedName = SQLTypeName;\n }", "public native String getIdentifier();", "public org.hl7.fhir.Identifier insertNewIdentifier(int i)\n {\n synchronized (monitor())\n {\n check_orphaned();\n org.hl7.fhir.Identifier target = null;\n target = (org.hl7.fhir.Identifier)get_store().insert_element_user(IDENTIFIER$0, i);\n return target;\n }\n }", "public static NameID getNewName(String name, Traversable tr) {\n SymbolTable symtab = IRTools.getAncestorOfType(tr, SymbolTable.class);\n String header = (name == null) ? \"temp\" : name;\n NameID ret = new NameID(header);\n int suffix = 0;\n while (findSymbol(symtab, ret) != null) {\n ret = new NameID(header + (suffix++));\n }\n return ret;\n }", "public ImagingStudy addIdentifier( IdentifierUseEnum theUse, String theSystem, String theValue, String theLabel) {\n\t\tif (myIdentifier == null) {\n\t\t\tmyIdentifier = new java.util.ArrayList<IdentifierDt>();\n\t\t}\n\t\tmyIdentifier.add(new IdentifierDt(theUse, theSystem, theValue, theLabel));\n\t\treturn this; \n\t}", "default void putDataType(DataTypeName id, DataType dataType) {}", "@Override\r\n\tpublic String createID() {\r\n\t\t \r\n\t\t\t\treturn transCode.toString();\r\n\t\t\t\t}", "public int numericName()\n {\n return Factory.getID(this);\n }" ]
[ "0.79293567", "0.7220635", "0.6861054", "0.675147", "0.66572833", "0.6577929", "0.6422592", "0.64003646", "0.63765264", "0.6347865", "0.63394475", "0.6334603", "0.6280992", "0.6277966", "0.6210792", "0.61794126", "0.6153946", "0.61533195", "0.60309505", "0.60208225", "0.60190237", "0.60190237", "0.60190237", "0.60190237", "0.60190237", "0.60190237", "0.60190237", "0.600177", "0.5977768", "0.597645", "0.59393805", "0.5937948", "0.5924029", "0.5901297", "0.5850935", "0.5850935", "0.58478904", "0.58342385", "0.580677", "0.58045036", "0.57964426", "0.57883143", "0.5769449", "0.57617104", "0.5747592", "0.5745545", "0.57421124", "0.5737387", "0.5737387", "0.56912476", "0.56812954", "0.5673634", "0.56644946", "0.5661467", "0.56546134", "0.56365156", "0.5633647", "0.56208277", "0.56119555", "0.56091624", "0.5547157", "0.55370325", "0.55357814", "0.55255693", "0.55250436", "0.5520527", "0.55161935", "0.5505364", "0.5490682", "0.54658735", "0.5465497", "0.5459503", "0.5456153", "0.545613", "0.5443617", "0.5441965", "0.54312146", "0.54299027", "0.5419216", "0.5402801", "0.5393443", "0.53908414", "0.53890175", "0.53849834", "0.5380763", "0.5380668", "0.53800243", "0.53736407", "0.53728276", "0.5370645", "0.53700465", "0.5367094", "0.5362613", "0.5361446", "0.53613913", "0.5359814", "0.5351133", "0.53472763", "0.5346067", "0.5340485" ]
0.5721961
49
Android N crop image
public void cropImage() { if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) { // 마쉬멜로우 이상 버전일 때 grantUriPermission("com.android.camera", mImageCaptureUri, Intent.FLAG_GRANT_WRITE_URI_PERMISSION | Intent.FLAG_GRANT_READ_URI_PERMISSION); } Intent intent = new Intent("com.android.camera.action.CROP"); intent.setDataAndType(mImageCaptureUri, "image/*"); List<ResolveInfo> list = getPackageManager().queryIntentActivities(intent, 0); if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) { grantUriPermission(list.get(0).activityInfo.packageName, mImageCaptureUri, Intent.FLAG_GRANT_WRITE_URI_PERMISSION | Intent.FLAG_GRANT_READ_URI_PERMISSION); } int size = list.size(); if (size == 0) { Toast.makeText(ManualRegistActivity.this, "취소 되었습니다.", Toast.LENGTH_SHORT).show(); return; } else { Toast.makeText(ManualRegistActivity.this, "용량이 큰 사진의 경우 시간이 오래 걸릴 수 있습니다.", Toast.LENGTH_SHORT).show(); if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) { intent.addFlags(Intent.FLAG_GRANT_READ_URI_PERMISSION); intent.addFlags(Intent.FLAG_GRANT_WRITE_URI_PERMISSION); } intent.putExtra("crop", "true"); intent.putExtra("aspectX", 1); intent.putExtra("aspectY", 1); intent.putExtra("scale", true); croppedFile = null; try { croppedFile = createImageFile(); } catch (IOException e) { e.printStackTrace(); } File folder = new File(Environment.getExternalStorageDirectory() + "/BioCube/"); File tempFile = new File(folder.toString(), croppedFile.getName()); mCurrentPhotoPath = tempFile.getAbsolutePath(); mImageCaptureUri = FileProvider.getUriForFile(ManualRegistActivity.this, "com.example.seongjun.biocube.provider", tempFile); if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) { intent.addFlags(Intent.FLAG_GRANT_READ_URI_PERMISSION); intent.addFlags(Intent.FLAG_GRANT_WRITE_URI_PERMISSION); } intent.putExtra("return-data", false); intent.putExtra(MediaStore.EXTRA_OUTPUT, mImageCaptureUri); intent.putExtra("outputFormat", Bitmap.CompressFormat.JPEG.toString()); Intent i = new Intent(intent); ResolveInfo res = list.get(0); if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) { i.addFlags(Intent.FLAG_GRANT_READ_URI_PERMISSION); i.addFlags(Intent.FLAG_GRANT_WRITE_URI_PERMISSION); grantUriPermission(res.activityInfo.packageName, mImageCaptureUri, Intent.FLAG_GRANT_WRITE_URI_PERMISSION | Intent.FLAG_GRANT_READ_URI_PERMISSION); } i.setComponent(new ComponentName(res.activityInfo.packageName, res.activityInfo.name)); startActivityForResult(i, CROP_FROM_CAMERA); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private void cropImage() {\n\t\t// Use existing crop activity.\n\t\tIntent intent = new Intent(\"com.android.camera.action.CROP\");\n\t\tintent.setDataAndType(mImageCaptureUri, IMAGE_UNSPECIFIED);\n\n\t\t// Specify image size\n\t\tintent.putExtra(\"outputX\", 100);\n\t\tintent.putExtra(\"outputY\", 100);\n\n\t\t// Specify aspect ratio, 1:1\n\t\tintent.putExtra(\"aspectX\", 1);\n\t\tintent.putExtra(\"aspectY\", 1);\n\t\tintent.putExtra(\"scale\", true);\n\t\tintent.putExtra(\"return-data\", true);\n\n\t\t// REQUEST_CODE_CROP_PHOTO is an integer tag you defined to\n\t\t// identify the activity in onActivityResult() when it returns\n\t\tstartActivityForResult(intent, REQUEST_CODE_CROP_PHOTO);\n\t}", "public void cropImage() {\n if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.N) {\n this.grantUriPermission(\"com.android.camera\", photoUri,\n Intent.FLAG_GRANT_WRITE_URI_PERMISSION | Intent.FLAG_GRANT_READ_URI_PERMISSION);\n }\n Intent intent = new Intent(\"com.android.camera.action.CROP\");\n intent.setDataAndType(photoUri, \"image/*\");\n\n List<ResolveInfo> list = getPackageManager().queryIntentActivities(intent, 0);\n if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.N) {\n grantUriPermission(list.get(0).activityInfo.packageName, photoUri,\n Intent.FLAG_GRANT_WRITE_URI_PERMISSION | Intent.FLAG_GRANT_READ_URI_PERMISSION);\n }\n int size = list.size();\n if (size == 0) {\n Toast.makeText(this, \"취소 되었습니다.\", Toast.LENGTH_SHORT).show();\n return;\n } else {\n// Toast.makeText(this, \"용량이 큰 사진의 경우 시간이 오래 걸릴 수 있습니다.\", Toast.LENGTH_SHORT).show();\n\n if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.N) {\n intent.addFlags(Intent.FLAG_GRANT_READ_URI_PERMISSION);\n intent.addFlags(Intent.FLAG_GRANT_WRITE_URI_PERMISSION);\n }\n intent.putExtra(\"crop\", \"true\");\n// intent.putExtra(\"aspectX\", 3);\n// intent.putExtra(\"aspectY\", 4);\n intent.putExtra(\"scale\", true);\n File croppedFileName = null;\n try {\n croppedFileName = createImageFile();\n } catch (IOException e) {\n e.printStackTrace();\n }\n\n File folder = new File(Environment.getExternalStorageDirectory() + \"/Body_Img/\");\n File tempFile = new File(folder.toString(), croppedFileName.getName());\n\n photoUri = FileProvider.getUriForFile(Body_Img.this,\n \"com.example.a1013c.body_sns.provider\", tempFile);\n\n if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.N) {\n intent.addFlags(Intent.FLAG_GRANT_READ_URI_PERMISSION);\n intent.addFlags(Intent.FLAG_GRANT_WRITE_URI_PERMISSION);\n }\n\n intent.putExtra(\"return-data\", false);\n intent.putExtra(MediaStore.EXTRA_OUTPUT, photoUri);\n intent.putExtra(\"outputFormat\", Bitmap.CompressFormat.JPEG.toString());\n\n Intent i = new Intent(intent);\n ResolveInfo res = list.get(0);\n if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.N) {\n i.addFlags(Intent.FLAG_GRANT_READ_URI_PERMISSION);\n i.addFlags(Intent.FLAG_GRANT_WRITE_URI_PERMISSION);\n\n grantUriPermission(res.activityInfo.packageName, photoUri,\n Intent.FLAG_GRANT_WRITE_URI_PERMISSION | Intent.FLAG_GRANT_READ_URI_PERMISSION);\n }\n i.setComponent(new ComponentName(res.activityInfo.packageName, res.activityInfo.name));\n startActivityForResult(i, CROP_FROM_CAMERA);\n }\n }", "private void performCrop() {\n try {\r\n //call the standard crop action intent (the user device may not support it)\r\n Intent cropIntent = new Intent(\"com.android.camera.action.CROP\");\r\n //indicate image type and Uri\r\n cropIntent.setDataAndType(picUri, \"image/*\");\r\n //set crop properties\r\n cropIntent.putExtra(\"crop\", \"true\");\r\n //indicate aspect of desired crop\r\n// cropIntent.putExtra(\"aspectX\", 1);\r\n// cropIntent.putExtra(\"aspectY\", 1);\r\n //indicate output X and Y\r\n// cropIntent.putExtra(\"outputX\", 256);\r\n// cropIntent.putExtra(\"outputY\", 256);\r\n //retrieve data on return\r\n cropIntent.putExtra(\"return-data\", true);\r\n //start the activity - we handle returning li_history onActivityResult\r\n startActivityForResult(cropIntent, 2);\r\n }\r\n //respond to users whose devices do not support the crop action\r\n catch (ActivityNotFoundException anfe) {\r\n //display an error message\r\n String errorMessage = \"Whoops - your device doesn't support the crop action!\";\r\n Toast toast = Toast.makeText(this, errorMessage, Toast.LENGTH_SHORT);\r\n toast.show();\r\n }\r\n }", "private void performCrop(Uri img) {\n try {\r\n //call the standard crop action intent (the user device may not support it)\r\n Intent cropIntent = new Intent(\"com.android.camera.action.CROP\");\r\n //indicate image type and Uri\r\n cropIntent.setDataAndType(img, \"image/*\");\r\n //set crop properties\r\n cropIntent.putExtra(\"crop\", \"true\");\r\n //indicate aspect of desired crop\r\n // cropIntent.putExtra(\"aspectX\", 1);\r\n //cropIntent.putExtra(\"aspectY\", 1);\r\n //indicate output X and Y\r\n // cropIntent.putExtra(\"outputX\", 256);\r\n // cropIntent.putExtra(\"outputY\", 256);\r\n //retrieve data on return\r\n\r\n cropIntent.putExtra(\"return-data\", true);\r\n //start the activity - we handle returning in onActivityResult\r\n startActivityForResult(cropIntent, 2);\r\n }\r\n //respond to users whose devices do not support the crop action\r\n catch (ActivityNotFoundException anfe) {\r\n //display an error message\r\n String errorMessage = \"Whoops - your device doesn't support the crop action!\";\r\n Toast toast = Toast.makeText(this, errorMessage, Toast.LENGTH_SHORT);\r\n toast.show();\r\n }\r\n }", "protected void cropImage() {\n if (mOptions.noOutputImage) {\n setResult(null, null, 1);\n } else {\n Uri outputUri = getOutputUri();\n mCropImageView.saveCroppedImageAsync(\n outputUri,\n mOptions.outputCompressFormat,\n mOptions.outputCompressQuality,\n mOptions.outputRequestWidth,\n mOptions.outputRequestHeight,\n mOptions.outputRequestSizeOptions);\n }\n }", "public void getCroppedBitmap(final OnResultListener onResultListener) {\n setProgressBarVisibility(VISIBLE);\n AsyncTask.execute(new Runnable() {\n @Override\n public void run() {\n try {\n ContentResolver resolver = getContext().getContentResolver();\n InputStream inputStream = resolver.openInputStream(imageUri);\n Bitmap bitmap = BitmapFactory.decodeStream(inputStream);\n\n //rotate image\n Matrix matrix = new Matrix();\n matrix.postRotate(getOrientation() + getRotation());\n\n bitmap = Bitmap.createBitmap(bitmap, 0, 0,\n bitmap.getWidth(), bitmap.getHeight(), matrix, true);\n\n ByteArrayOutputStream outputStream = new ByteArrayOutputStream();\n bitmap.compress(Bitmap.CompressFormat.JPEG, 90, outputStream);\n byte[] bitmapData = outputStream.toByteArray();\n ByteArrayInputStream byteArrayInputStream = new ByteArrayInputStream(bitmapData);\n\n BitmapRegionDecoder decoder = BitmapRegionDecoder.\n newInstance(byteArrayInputStream, false);\n\n BitmapFactory.Options options = new BitmapFactory.Options();\n options.inSampleSize = 1;\n options.inJustDecodeBounds = false;\n\n Bitmap croppedBitmap = decoder.decodeRegion(cropRect, options);\n decoder.recycle();\n\n final Result result = new Result(imageUri, croppedBitmap);\n CropImageView.this.post(new Runnable() {\n @Override\n public void run() {\n onResultListener.onResult(result);\n setProgressBarVisibility(GONE);\n }\n });\n } catch (Exception | OutOfMemoryError e) {\n e.printStackTrace();\n CropImageView.this.post(new Runnable() {\n @Override\n public void run() {\n onResultListener.onResult(new Result(getImageUri(), null));\n setProgressBarVisibility(GONE);\n }\n });\n }\n }\n });\n }", "private void startCropImage() {\n }", "@Override\n public void onCropWindowChanged() {\n Bitmap cropped = imageView.getCroppedImage();\n BitmapHelper.getInstance().setBitmap(cropped);\n bitmap=cropped;\n\n }", "public native MagickImage cropImage(Rectangle chopInfo)\n\t\t\tthrows MagickException;", "private void onSaveClicked() {\n if (mCropView == null) {\n return;\n }\n\n if (mSaving) return;\n mSaving = true;\n\n Bitmap croppedImage;\n\n // If the output is required to a specific size, create an new image\n // with the cropped image in the center and the extra space filled.\n if (outputX != 0 && outputY != 0 && !scale) {\n // Don't scale the image but instead fill it so it's the\n // required dimension\n croppedImage = Bitmap.createBitmap(outputX, outputY, Bitmap.Config.RGB_565);\n Canvas canvas = new Canvas(croppedImage);\n\n Rect srcRect = mCropView.getCropRect();\n Rect dstRect = new Rect(0, 0, outputX, outputY);\n\n int dx = (srcRect.width() - dstRect.width()) / 2;\n int dy = (srcRect.height() - dstRect.height()) / 2;\n\n // If the srcRect is too big, use the center part of it.\n srcRect.inset(Math.max(0, dx), Math.max(0, dy));\n\n // If the dstRect is too big, use the center part of it.\n dstRect.inset(Math.max(0, -dx), Math.max(0, -dy));\n\n // Draw the cropped bitmap in the center\n canvas.drawBitmap(mBitmap, srcRect, dstRect, null);\n\n // Release bitmap memory as soon as possible\n mImageView.clear();\n mBitmap.recycle();\n } else {\n Rect r = mCropView.getCropRect();\n\n int width = r.width();\n int height = r.height();\n\n // If we are circle cropping, we want alpha channel, which is the\n // third param here.\n croppedImage = Bitmap.createBitmap(width, height,\n circleCrop ? Bitmap.Config.ARGB_8888 : Bitmap.Config.RGB_565);\n\n Canvas canvas = new Canvas(croppedImage);\n\n if (circleCrop) {\n final int color = 0xffff0000;\n final Paint paint = new Paint();\n final Rect rect = new Rect(0, 0, croppedImage.getWidth(), croppedImage.getHeight());\n final RectF rectF = new RectF(rect);\n\n paint.setAntiAlias(true);\n paint.setDither(true);\n paint.setFilterBitmap(true);\n canvas.drawARGB(0, 0, 0, 0);\n paint.setColor(color);\n canvas.drawOval(rectF, paint);\n\n paint.setColor(Color.BLUE);\n paint.setStyle(Paint.Style.STROKE);\n paint.setStrokeWidth((float) 4);\n paint.setXfermode(new PorterDuffXfermode(PorterDuff.Mode.SRC_IN));\n canvas.drawBitmap(mBitmap, r, rect, paint);\n }\n else {\n Rect dstRect = new Rect(0, 0, width, height);\n canvas.drawBitmap(mBitmap, r, dstRect, null);\n }\n\n // Release bitmap memory as soon as possible\n mImageView.clear();\n mBitmap.recycle();\n\n // If the required dimension is specified, scale the image.\n if (outputX != 0 && outputY != 0 && scale) {\n croppedImage = BitmapUtils.transform(new Matrix(), croppedImage,\n outputX, outputY, scaleUp, BitmapUtils.RECYCLE_INPUT);\n }\n }\n\n mImageView.setImageBitmapResetBase(croppedImage, true);\n mImageView.center(true, true);\n mImageView.getHighlightViews().clear();\n\n // save it to the specified URI.\n final Bitmap b = croppedImage;\n new AsyncTask<Void, Integer, IImage>() {\n ProgressDialog pd;\n\n @Override\n protected void onPreExecute() {\n pd = ProgressDialog.show(CropPhotoActivity.this, null,\n getResources().getString(R.string.saving_image));\n }\n\n @Override\n protected IImage doInBackground(Void[] params) {\n return saveOutput(b);\n }\n\n @Override\n protected void onPostExecute(IImage image) {\n pd.dismiss();\n mImageView.clear();\n b.recycle();\n\n if (image != null) {\n ArrayList<IImage> images = new ArrayList<>();\n images.add(image);\n\n Intent data = new Intent();\n data.putParcelableArrayListExtra(\"data\", images);\n setResult(Activity.RESULT_OK, data);\n finish();\n }\n }\n }.execute();\n }", "private void beginCrop(Uri source) {\n Uri destination = Uri.fromFile(new File(getCacheDir(), \"cropped\"));\n Crop.of(source, destination).asSquare().start(this);\n }", "private void handleCrop(int resultCode, Intent result) {\n if (resultCode == RESULT_OK) {\n try {\n Uri uri = Crop.getOutput(result);\n yourSelectedImage = MediaStore.Images.Media.getBitmap(this.getContentResolver(), Crop.getOutput(result));\n ivUserImage.setImageBitmap(yourSelectedImage);\n Uri tempUri = Util.getInstance().getImageUri(SignUp.this, yourSelectedImage);\n // createImageFromBitmap(yourSelectedImage);\n // tempFilePath = FileUtil.getPath(this,tempUri);\n tempFilePath = FileUtil.getPath(SignUp.this, tempUri);\n } catch (Exception e) {\n e.printStackTrace();\n }\n } else if (resultCode == Crop.RESULT_ERROR) {\n // Toast.makeText(this, Crop.getError(result).getMessage(), Toast.LENGTH_SHORT).show();\n }\n }", "private void handleCrop(int resultCode, Intent data) {\n if (resultCode == RESULT_OK) {\n Uri uri = Crop.getOutput(data);\n try {\n Bitmap bitmap = MediaStore.Images.Media.getBitmap(this.getContentResolver(), uri);\n mImageCaptureUri = uri;\n mImageView.setImageBitmap(bitmap);\n } catch (Exception e) {\n Log.d(TAG, e.getMessage());\n }\n\n } else if (resultCode == Crop.RESULT_ERROR) {\n Toast.makeText(this, Crop.getError(data).getMessage(), Toast.LENGTH_SHORT).show();\n }\n }", "private void onSaveClicked() {\n if (mCrop == null || mIsSaving) {\n return;\n }\n mIsSaving = true;\n Bitmap croppedImage = null;\n Rect r = mCrop.getCropRect();\n int width = r.width();\n int height = r.height();\n\n int outWidth = width, outHeight = height;\n if (mMaxX > 0 && mMaxY > 0 && (width > mMaxX || height > mMaxY)) {\n float ratio = (float) width / (float) height;\n if ((float) mMaxX / (float) mMaxY > ratio) {\n outHeight = mMaxY;\n outWidth = (int) ((float) mMaxY * ratio + .5f);\n } else {\n outWidth = mMaxX;\n outHeight = (int) ((float) mMaxX / ratio + .5f);\n }\n }\n if (IN_MEMORY_CROP && mRotateBitmap != null) {\n croppedImage = inMemoryCrop( mRotateBitmap, croppedImage, r,\n width * sampleSize,\n height * sampleSize,\n outWidth * sampleSize,\n outHeight * sampleSize );\n if (croppedImage != null) {\n mImageView.setImageBitmapResetBase( croppedImage, true );\n mImageView.center( true, true );\n mImageView.mHighlightViews.clear();\n }\n } else {\n try {\n croppedImage = decodeRegionCrop( croppedImage, r );\n } catch (IllegalArgumentException e) {\n setResultException( e );\n finish();\n return;\n }\n\n if (croppedImage != null) {\n mImageView.setImageRotateBitmapResetBase( new RotateBitmap( croppedImage, mExifRotation ), true );\n mImageView.center( true, true );\n mImageView.mHighlightViews.clear();\n }\n }\n if(croppedImage.getWidth() > mMaxX || croppedImage.getHeight() > mMaxY) {\n croppedImage = getResizedBitmap(croppedImage, mMaxX, mMaxY);\n }\n\n saveImage(croppedImage);\n }", "@Override\n\t\t\tpublic void onClick(View v) {\n\t \t\n\t \tclass ToSaveCropped{\n\t \t\t\n\t \t\tfloat x=finalx;\n\t \t\tfloat y=finaly;\n\n\t\t\t\t\tprivate byte[] data = MainActivity.getbitmapData();\n\t\t\t Bitmap mImage = BitmapFactory.decodeByteArray(data, 0, data.length);\n\t\t\t \n\t\t\t Drawable myMask = getResources().getDrawable(R.drawable.mask);\n\t\t\t Bitmap mMask = ((BitmapDrawable) myMask).getBitmap();\n\t\t\t Bitmap mmImage = dv.bitmapRotate(mImage);\n\t\t\t \n\t\t\t Bitmap mmmImage = dv.getResizedBitmap(mmImage,height,width);\n\t\t\t \n\t\t\t Bitmap mmMask = dv.getResizedBitmap(mMask,wMask,wMask);\n\t\t\t\t\t\n\t\t\t\t\tpublic void onDraw(){\n\t\t\t\t\t\tCanvas canvas; \t\t\t\n\t \t\t\tint w = mmMask.getWidth(), h = mmMask.getHeight();\n\t \t\t\tBitmap.Config conf = Bitmap.Config.ARGB_8888; // see other conf types\n\t \t\t\tcroppedBitmap = Bitmap.createBitmap(w, h, conf); // this creates a MUTABLE bitmap\n\t \t\t\tcanvas = new Canvas(croppedBitmap);\n\t \t\t\t\n\t \t\t\tPaint maskPaint = new Paint();\n\t \t\t\tmaskPaint.setXfermode(new PorterDuffXfermode(PorterDuff.Mode.DST_IN));\n\n\t Paint imagePaint = new Paint();\n\t imagePaint.setXfermode(new PorterDuffXfermode(PorterDuff.Mode.DST_OVER));\n\t \t\t\t//Log.i(\"\"+x,\"\"+y);\n\t \t//canvas.drawBitmap(mMask,x,y,maskPaint);\n\t \tcanvas.drawBitmap(mmmImage,-x,-y,imagePaint);\n\t\t\t\t\t}\n\t\t\t\t\t\n\t \t}\t \t\n\t \tToSaveCropped tsc = new ToSaveCropped();\n\t \ttsc.onDraw();\n\t \tByteArrayOutputStream stream = new ByteArrayOutputStream();\n\t \tcroppedBitmap.compress(Bitmap.CompressFormat.PNG, 100, stream);\n\t \tbitData = stream.toByteArray();\n\t\t\t\t\n\t\t\t\tSaveFile sv = new SaveFile();\n\t\t\t\tsv.save();\n\t\t\t\t\n\t\t\t\tMediaStore.Images.Media.insertImage(getContentResolver(), croppedBitmap, \"\", \"\");\n\t\t\t\t\n\t\t\t}", "@Method(selector = \"crop:imagePath:width:height:x:ycompletionBlock:\")\n\tpublic native void crop(String name, String imagePath, int width, int height, int x, int y, @Block App42ResponseBlock completionBlock);", "private void beginCrop(Uri source) {\n // pass URI as intent to the CROP Activity;\n if (mPhotoFile != null) {\n Uri destination = FileProvider.getUriForFile(this,\n BuildConfig.APPLICATION_ID,\n mPhotoFile);\n Log.d(TAG, \"URI: \" + destination.toString());\n Crop.of(source, destination).asSquare().start(this);\n }\n }", "@Override public Bitmap transform(Bitmap source) {\n int width = source.getWidth(); //Width of source\n int height = source.getHeight(); //Height of source\n\n Bitmap result = Bitmap.createBitmap(width, height, Bitmap.Config.ARGB_8888);\n\n Drawable mask = getMaskDrawable(mContext, mMaskId); //Init mask from resources\n\n //Using mask\n Canvas canvas = new Canvas(result);\n mask.setBounds(0, 0, width, height);\n mask.draw(canvas);\n canvas.drawBitmap(source, 0, 0, mMaskingPaint);\n\n source.recycle();\n\n //Return bitmap of cropped image\n return result;\n }", "@Method(selector = \"crop:imageData:width:height:x:y:completionBlock:\")\n\tpublic native void crop(String name, NSData imageData, int width, int height, int x, int y, @Block App42ResponseBlock completionBlock);", "public static void performCrop(Activity activity, Uri picUri) {\n try {\n // call the standard crop action intent (the user device may not\n // support it)\n Intent cropIntent = new Intent(\"com.android.camera.action.CROP\");\n // indicate image type and Uri\n cropIntent.setDataAndType(picUri, \"image/*\");\n // set crop properties\n cropIntent.putExtra(\"crop\", \"true\");\n // indicate aspect of desired crop\n cropIntent.putExtra(\"aspectX\", 2);\n cropIntent.putExtra(\"aspectY\", 1);\n // indicate output X and Y\n cropIntent.putExtra(\"outputX\", 256);\n cropIntent.putExtra(\"outputY\", 256);\n // retrieve data on return\n cropIntent.putExtra(\"return-data\", true);\n // start the activity - we handle returning in onActivityResult\n activity.startActivityForResult(cropIntent, CROP_IMAGE);\n }\n // respond to users whose devices do not support the crop action\n catch (ActivityNotFoundException anfe) {\n Toast toast = Toast\n .makeText(activity, \"This device doesn't support the crop action!\", Toast.LENGTH_SHORT);\n toast.show();\n }\n\n }", "public static Bitmap cropImageVer2(Bitmap img, Bitmap templateImage, int width, int height) {\n // Merge two images together.\n int x=5,y=5;\n Bitmap bm = Bitmap.createBitmap(img.getWidth(), img.getHeight(), Bitmap.Config.ARGB_8888);\n Canvas combineImg = new Canvas(bm);\n combineImg.drawBitmap(img, 0f, 0f, null);\n combineImg.drawBitmap(templateImage, 0f, 0f, null);\n \n // Create new blank ARGB bitmap.\n Bitmap finalBm = Bitmap.createBitmap(width, height, Bitmap.Config.ARGB_8888);\n \n // Get the coordinates for the middle of bm.\n int hMid = bm.getHeight() / 2;\n int wMid = bm.getWidth() / 2;\n int hfMid = finalBm.getHeight() / 2;\n int wfMid = finalBm.getWidth() / 2;\n\n int y2 = hfMid;\n int x2 = wfMid;\n\n for ( y = hMid; y >= 0; y--) {\n // Check Upper-left section of combineImg.\n for ( x = wMid; x >= 0; x--) {\n if (x2 < 0) {\n break;\n }\n\n int px = bm.getPixel(x, y);\n // Get out of loop once it hits the left side of the template.\n if (Color.red(px) == 234 && Color.green(px) == 157 && Color.blue(px) == 33) {\n break;\n } else {\n finalBm.setPixel(x2, y2, px);\n }\n x2--;\n }\n \n // Check upper-right section of combineImage.\n x2 = wfMid;\n for (x = wMid; x < bm.getWidth(); x++) {\n if (x2 >= finalBm.getWidth()) {\n break;\n }\n\n int px = bm.getPixel(x, y);\n // Get out of loop once it hits the right side of the template.\n if (Color.red(px) == 234 && Color.green(px) == 157 && Color.blue(px) == 33) {\n break;\n } else {\n finalBm.setPixel(x2, y2, px);\n }\n x2++;\n }\n \n // Get out of loop once it hits top most part of the template.\n int px = bm.getPixel(wMid, y);\n if (Color.red(px) == 234 && Color.green(px) == 157 && Color.blue(px) == 33) {\n break;\n } \n x2 = wfMid;\n y2--;\n }\n\n x2 = wfMid;\n y2 = hfMid;\n for (y = hMid; y <= bm.getHeight(); y++) {\n // Check bottom-left section of combineImage.\n for ( x = wMid; x >= 0; x--) {\n if (x2 < 0) {\n break;\n }\n\n int px = bm.getPixel(x, y);\n // Get out of loop once it hits the left side of the template.\n if (Color.red(px) == 234 && Color.green(px) == 157 && Color.blue(px) == 33) {\n break;\n } else {\n finalBm.setPixel(x2, y2, px);\n }\n x2--;\n }\n\n // Check bottom-right section of combineImage.\n x2 = wfMid;\n for (x = wMid; x < bm.getWidth(); x++) {\n if (x2 >= finalBm.getWidth()) {\n break;\n }\n \n int px = bm.getPixel(x, y);\n // Get out of loop once it hits the right side of the template.\n if (Color.red(px) == 234 && Color.green(px) == 157 && Color.blue(px) == 33) {\n break;\n } else {\n finalBm.setPixel(x2, y2, px);\n }\n x2++;\n }\n \n // Get out of loop once it hits bottom most part of the template.\n int px = bm.getPixel(wMid, y);\n if (Color.red(px) == 234 && Color.green(px) == 157 && Color.blue(px) == 33) {\n break;\n } \n x2 = wfMid;\n y2++;\n }\n \n // Get rid of images that we finished with to save memory.\n img.recycle();\n templateImage.recycle();\n bm.recycle();\n return finalBm;\n }", "@Override\n protected void onActivityResult(int requestCode, int resultCode, Intent data) {\n if (requestCode == CropImage.PICK_IMAGE_CHOOSER_REQUEST_CODE && resultCode == RESULT_OK) {\n Uri imageUri = CropImage.getPickImageResultUri(this, data);\n// startCropImageActivity(AsyncBlackBackgrImage.createBackground(context, imageUri));\n startCropImageActivity(imageUri);\n }\n\n if ((requestCode == GALLERY_INTENT || requestCode == CAMERA_INTENT) && resultCode == RESULT_OK) {\n Uri imageUri = CropImage.getPickImageResultUri(context, data);\n Log.d(getLocalClassName() + \"pick image\", imageUri.toString());\n\n// startCropImageActivity(AsyncBlackBackgrImage.createBackground(context, imageUri));\n startCropImageActivity(imageUri);\n }\n\n if (requestCode == CropImage.CROP_IMAGE_ACTIVITY_REQUEST_CODE) {\n CropImage.ActivityResult result = CropImage.getActivityResult(data);\n if (resultCode == RESULT_OK) {\n ((ImageView) findViewById(R.id.imageview_myactivity)).setImageURI(result.getUri());\n\n Log.d(\"CropResultUri\", result.getUri().toString());\n\n MyBmpInfo bmpinfo = getThumbnail(result.getUri());\n Bitmap b = bmpinfo.result;\n if (bmpinfo.warnUser) {\n textInfoImage.setText(\"Warning: \" + bmpinfo.warning + \" ( \" + b.getWidth() + \" x \" + b.getHeight() + \" ) \");\n textInfoImage.setTextColor(Color.parseColor(\"#FFFF0000\"));\n } else textInfoImage.setText(\"\");\n\n Toast.makeText(this, \"Cropping successful\", Toast.LENGTH_LONG).show();\n\n b = watermark(b);\n // Save image as .jpg file in phone public \"Picture\" directory\n selectedImageFilePath = saveFile(b);\n selectedImageFilePath = new String[]{selectedImageFilePath[0], selectedImageFilePath[1], result.getUri().toString()};\n Toast.makeText(this, \"Saved successfully\", Toast.LENGTH_LONG).show();\n\n\n } else if (resultCode == CropImage.CROP_IMAGE_ACTIVITY_RESULT_ERROR_CODE) {\n Toast.makeText(this, \"Cropping failed: \" + result.getError(), Toast.LENGTH_LONG).show();\n }\n }\n }", "@Override\n protected void onActivityResult(int requestCode, int resultCode, Intent data) {\n if (requestCode == CropImage.CROP_IMAGE_ACTIVITY_REQUEST_CODE) {\n CropImage.ActivityResult result = CropImage.getActivityResult(data);\n if (resultCode == RESULT_OK) {\n croppedURI = result.getUri();\n\n try {\n bitmap = MediaStore.Images.Media.getBitmap(this.getContentResolver(), croppedURI);\n\n Intent intent = new Intent(UploadHonjouActivity.this, ConfirmActivity.class);\n\n SharedPrefManager.getInstance(this).saveHonjou(getStringImage(bitmap));\n\n intent.putExtra(\"edit_flag\", false);\n\n startActivity(intent);\n\n } catch (IOException e) {\n e.printStackTrace();\n }\n\n } else if (resultCode == CropImage.CROP_IMAGE_ACTIVITY_RESULT_ERROR_CODE) {\n\n }\n }\n }", "public void cropMoleculeRecognition(){\n mOpenCameraView.disableView();\n\n Mat transformMat = Imgproc.getPerspectiveTransform(mCaptureAreaAdjusted,new MatOfPoint2f(new Point(0,0),new Point(0,400),new Point(400,400), new Point(400,0)));\n Mat croppedImage = new Mat();\n Imgproc.warpPerspective(mGray, croppedImage, transformMat, new Size(400, 400));\n\n /* cleanup the AR marker */\n int cropout = 240;\n\n croppedImage.submat(0,cropout,0,cropout).setTo(new Scalar(0));\n Core.MinMaxLocResult mmr;\n\n for(int i = 0; i<cropout; i++){\n mmr = Core.minMaxLoc(croppedImage.row(i).colRange(cropout,400));\n Core.add(croppedImage.row(i).colRange(0,cropout),new Scalar(mmr.maxVal/2),croppedImage.row(i).colRange(0,cropout));\n\n mmr = Core.minMaxLoc(croppedImage.col(i).rowRange(cropout, 400));\n Core.add(croppedImage.col(i).rowRange(0, cropout),new Scalar(mmr.maxVal/2),croppedImage.col(i).rowRange(0, cropout));\n }\n\n /*for now, just save the cropedImage*/\n /* in the live version, will need to sort out the ar marker on the top left */\n Imgcodecs.imwrite(getFilesDir().toString().concat(\"/croppedImg.png\"),croppedImage);\n Intent intent = new Intent(this,viewCapture.class);\n intent.putExtra(\"flagCaptureImage\",true);\n startActivity(intent);\n }", "@Override\r\n protected void onActivityResult(int requestCode, int resultCode, Intent data) {\r\n super.onActivityResult(requestCode, resultCode, data);\r\n mImageUri = data.getData();\r\n if (requestCode == GALLERY_REQUEST && resultCode == Activity.RESULT_OK) {\r\n mImageUri = data.getData();\r\n if (data.getData() == null) {\r\n Toast.makeText(this, \"Failed to load Image,try again\", Toast.LENGTH_LONG).show();\r\n return;\r\n }\r\n try {\r\n outputUri =new getFileName(context).getDataFilesThumbnailUriPath(String.valueOf(System.currentTimeMillis()),context);\r\n } catch (Exception e) {\r\n e.printStackTrace();\r\n }\r\n CropImage.activity(mImageUri)\r\n .setGuidelines(CropImageView\r\n .Guidelines.ON)\r\n .setAspectRatio(1, 1)\r\n .setBackgroundColor(getApplicationContext().getResources().getColor(R.color.background))\r\n .setActivityMenuIconColor(getApplicationContext().getResources().getColor(R.color.colorPrimary))\r\n .setOutputUri(outputUri)\r\n .start(this);\r\n }\r\n if (requestCode == CropImage.CROP_IMAGE_ACTIVITY_REQUEST_CODE) {\r\n CropImage.ActivityResult result = CropImage.getActivityResult(data);\r\n if (resultCode == RESULT_OK) {\r\n resultUri =Uri.fromFile(new File(new CompressingImage5kb(String.valueOf(System.currentTimeMillis()),context).compressImage(String.valueOf(result.getUri()),\"\",true)));\r\n mCircleImageView.setImageURI(resultUri);\r\n } else if (requestCode == CropImage.CROP_IMAGE_ACTIVITY_RESULT_ERROR_CODE) {\r\n Exception error = result.getError();\r\n }\r\n }\r\n }", "@Override\n protected void onActivityResult(int requestCode, int resultCode, @Nullable Intent data) {\n super.onActivityResult(requestCode, resultCode, data);\n\n if (requestCode == 1 && resultCode == RESULT_OK && data != null && data.getData() != null) {\n\n //Getting the uri from gallery\n\n fileImageUri = data.getData();\n imageUri = fileImageUri;\n CropImage.activity(fileImageUri) //cropping the image\n\n .setGuidelines(CropImageView.Guidelines.ON)\n .setCropShape(CropImageView.CropShape.RECTANGLE)\n .setFixAspectRatio(true)\n .setAspectRatio(1,1)\n .start(this);\n\n\n\n }\n\n\n //After image will crop again taking the image uri\n\n if (requestCode == CropImage.CROP_IMAGE_ACTIVITY_REQUEST_CODE) {\n CropImage.ActivityResult result = CropImage.getActivityResult(data);\n if (resultCode == RESULT_OK) {\n resultUri = result.getUri();\n\n uploadUserImageView.setImageURI(resultUri);\n\n } else if (resultCode == CropImage.CROP_IMAGE_ACTIVITY_RESULT_ERROR_CODE) {\n Exception error = result.getError();\n Toast.makeText(this, \"Error While Getting uri\", Toast.LENGTH_SHORT).show();\n }\n }\n\n }", "private void cropEffect(int x, int y, int width, int height) {\n // int que estigui dins la imatge\n EffectFactory factory = effectContext.getFactory();\n effect = factory.createEffect(EffectFactory.EFFECT_CROP);\n effect.setParameter(\"xorigin\", x);\n effect.setParameter(\"yorigin\", y);\n effect.setParameter(\"width\", width);\n effect.setParameter(\"height\", height);\n effect.apply(textures[0], photoWidth, photoHeight, textures[1]);\n }", "@Override\n protected void onImageLaidOut() {\n super.onImageLaidOut();\n final Drawable drawable = getDrawable();\n if (drawable == null) {\n return;\n }\n\n float drawableWidth = drawable.getIntrinsicWidth();\n float drawableHeight = drawable.getIntrinsicHeight();\n\n if (mTargetAspectRatio == SOURCE_IMAGE_ASPECT_RATIO) {\n mTargetAspectRatio = drawableWidth / drawableHeight;\n }\n\n int height = (int) (mThisWidth / mTargetAspectRatio);\n if (height > mThisHeight) {\n int width = (int) (mThisHeight * mTargetAspectRatio);\n int halfDiff = (mThisWidth - width) / 2;\n mCropRect.set(halfDiff, 0, width + halfDiff, mThisHeight);\n } else {\n int halfDiff = (mThisHeight - height) / 2;\n mCropRect.set(0, halfDiff, mThisWidth, height + halfDiff);\n }\n\n calculateImageScaleBounds(drawableWidth, drawableHeight);\n setupInitialImagePosition(drawableWidth, drawableHeight);\n\n if (mCropBoundsChangeListener != null) {\n mCropBoundsChangeListener.onCropAspectRatioChanged(mTargetAspectRatio);\n }\n if (mTransformImageListener != null) {\n// mTransformImageListener.onScale(getCurrentScale());\n// mTransformImageListener.onRotate(getCurrentAngle());\n mTransformImageListener.onBrightness(getCurrentBrightness());\n// mTransformImageListener.onContrast(getCurrentContrast());\n }\n }", "public static BufferedImage autoCrop(BufferedImage source, float threshold) {\n\n int rgb;\n int backlo;\n int backhi;\n int width = source.getWidth();\n int height = source.getHeight();\n int startx = width;\n int starty = height;\n int destx = 0;\n int desty = 0;\n\n rgb = source.getRGB(source.getWidth() - 1, source.getHeight() - 1);\n backlo = ((rgb >> 16) & 255) + ((rgb >> 8) & 255) + ((rgb) & 255) / 3;\n backlo = (int) (backlo - (backlo * threshold));\n if (backlo < 0) {\n backlo = 0;\n }\n backhi = ((rgb >> 16) & 255) + ((rgb >> 8) & 255) + ((rgb) & 255) / 3;\n backhi = (int) (backhi + (backhi * threshold));\n\n for (int y = 0; y < height; y++) {\n for (int x = 0; x < width; x++) {\n rgb = source.getRGB(x, y);\n int sum = ((rgb >> 16) & 255) + ((rgb >> 8) & 255) + ((rgb) & 255) / 3;\n if (sum < backlo || sum > backhi) {\n if (y < starty) {\n starty = y;\n }\n if (x < startx) {\n startx = x;\n }\n if (y > desty) {\n desty = y;\n }\n if (x > destx) {\n destx = x;\n }\n }\n }\n }\n System.out.println(\"crop: [\"\n + startx + \", \" + starty + \", \"\n + destx + \", \" + desty + \"]\");\n\n BufferedImage result = new BufferedImage(\n destx - startx, desty - starty,\n source.getType());\n result.getGraphics().drawImage(\n Toolkit.getDefaultToolkit().createImage(\n new FilteredImageSource(source.getSource(),\n new CropImageFilter(startx, starty, destx, desty))),\n 0, 0, null);\n return result;\n }", "public static Bitmap cropImage(Bitmap img, Bitmap templateImage, int width, int height) {\n // Merge two images together.\n \t int x=5;\n\t\tint y=5;\n Bitmap bm = Bitmap.createBitmap(img.getWidth(), img.getHeight(), Bitmap.Config.ARGB_8888);\n Canvas combineImg = new Canvas(bm);\n combineImg.drawBitmap(img, 0f, 0f, null);\n combineImg.drawBitmap(templateImage, 0f, 0f, null);\n \n // Create new blank ARGB bitmap.\n Bitmap finalBm = Bitmap.createBitmap(width, height, Bitmap.Config.ARGB_8888);\n \n // Get the coordinates for the middle of combineImg.\n int hMid = bm.getHeight() / 2;\n int wMid = bm.getWidth() / 2;\n int hfMid = finalBm.getHeight() / 2;\n int wfMid = finalBm.getWidth() / 2;\n\n int y2 = hfMid;\n int x2 = wfMid;\n\n for ( y = hMid; y >= 0; y--) {\n boolean template = false;\n // Check Upper-left section of combineImg.\n for ( x = wMid; x >= 0; x--) {\n if (x2 < 0) {\n break;\n }\n\n int px = bm.getPixel(x, y);\n if (Color.red(px) == 234 && Color.green(px) == 157 && Color.blue(px) == 33) {\n template = true;\n finalBm.setPixel(x2, y2, Color.TRANSPARENT);\n } else if (template) {\n finalBm.setPixel(x2, y2, Color.TRANSPARENT);\n } else {\n finalBm.setPixel(x2, y2, px);\n }\n x2--;\n }\n // Check upper-right section of combineImage.\n x2 = wfMid;\n template = false;\n for ( x = wMid; x < bm.getWidth(); x++) {\n if (x2 >= finalBm.getWidth()) {\n break;\n }\n\n int px = bm.getPixel(x, y);\n if (Color.red(px) == 234 && Color.green(px) == 157 && Color.blue(px) == 33) {\n template = true;\n finalBm.setPixel(x2, y2, Color.TRANSPARENT);\n } else if (template) {\n finalBm.setPixel(x2, y2, Color.TRANSPARENT);\n } else {\n finalBm.setPixel(x2, y2, px);\n }\n x2++;\n }\n\n // Once we reach the top-most part on the template line, set pixel value transparent\n // from that point on.\n int px = bm.getPixel(wMid, y);\n if (Color.red(px) == 234 && Color.green(px) == 157 && Color.blue(px) == 33) {\n for (int y3 = y2; y3 >= 0; y3--) {\n for (int x3 = 0; x3 < finalBm.getWidth(); x3++) {\n finalBm.setPixel(x3, y3, Color.TRANSPARENT);\n }\n }\n break;\n }\n\n x2 = wfMid;\n y2--;\n }\n\n x2 = wfMid;\n y2 = hfMid;\n for (y = hMid; y <= bm.getHeight(); y++) {\n boolean template = false;\n // Check bottom-left section of combineImage.\n for (x = wMid; x >= 0; x--) {\n if (x2 < 0) {\n break;\n }\n\n int px = bm.getPixel(x, y);\n if (Color.red(px) == 234 && Color.green(px) == 157 && Color.blue(px) == 33) {\n template = true;\n finalBm.setPixel(x2, y2, Color.TRANSPARENT);\n } else if (template) {\n finalBm.setPixel(x2, y2, Color.TRANSPARENT);\n } else {\n finalBm.setPixel(x2, y2, px);\n }\n x2--;\n }\n\n // Check bottom-right section of combineImage.\n x2 = wfMid;\n template = false;\n for (x = wMid; x < bm.getWidth(); x++) {\n if (x2 >= finalBm.getWidth()) {\n break;\n }\n\n int px = bm.getPixel(x, y);\n if (Color.red(px) == 234 && Color.green(px) == 157 && Color.blue(px) == 33) {\n template = true;\n finalBm.setPixel(x2, y2, Color.TRANSPARENT);\n } else if (template) {\n finalBm.setPixel(x2, y2, Color.TRANSPARENT);\n } else {\n finalBm.setPixel(x2, y2, px);\n }\n x2++;\n }\n\n // Once we reach the bottom-most part on the template line, set pixel value transparent\n // from that point on.\n int px = bm.getPixel(wMid, y);\n if (Color.red(px) == 234 && Color.green(px) == 157 && Color.blue(px) == 33) {\n for (int y3 = y2; y3 < finalBm.getHeight(); y3++) {\n for (int x3 = 0; x3 < finalBm.getWidth(); x3++) {\n finalBm.setPixel(x3, y3, Color.TRANSPARENT);\n }\n }\n break;\n }\n\n x2 = wfMid;\n y2++;\n }\n \n // Get rid of images that we finished with to save memory.\n img.recycle();\n templateImage.recycle();\n bm.recycle();\n return finalBm;\n }", "@Override\n protected void onActivityResult(int requestCode, int resultCode, @Nullable Intent data) {\n\n if (resultCode != RESULT_OK) {\n return;\n }\n\n switch (requestCode) {\n // Camera Implementation\n case REQUEST_CODE_CAMERA_PERMISSION:\n isPhotoTakenFromCamera = true;\n Bitmap rotatedBitmap = imageOrientationValidator(mPhotoFile); // check orientation\n if (rotatedBitmap != null) {\n try {\n FileOutputStream fOut = new FileOutputStream(mPhotoFile);\n rotatedBitmap.compress(Bitmap.CompressFormat.JPEG, 100, fOut);\n fOut.flush();\n fOut.close();\n } catch (IOException e) {\n e.printStackTrace();\n }\n\n\n // Send image taken from camera for cropping\n mImageCaptureUri = FileProvider.getUriForFile(this,\n BuildConfig.APPLICATION_ID,\n mPhotoFile);\n beginCrop(mImageCaptureUri);\n }\n break;\n\n // Gallery implementation here\n case REQUEST_CODE_GALLERY:\n isPhotoTakenFromCamera = false;\n if (data != null){\n beginCrop(data.getData());\n }\n break;\n\n //Crop implementation\n case Crop.REQUEST_CROP:\n // Update image view after image crop\n handleCrop(resultCode, data);\n // Delete temporary image taken by camera after crop.\n if (isPhotoTakenFromCamera) {\n File f = new File(Objects.requireNonNull(mImageCaptureUri.getPath()));\n if (f.exists()) {\n f.delete();\n }\n }\n break;\n\n }\n super.onActivityResult(requestCode, resultCode, data);\n }", "public @NotNull Image crop(int x, int y, int width, int height)\n {\n if (this.data != null)\n {\n validateRect(x, y, width, height);\n \n Color.Buffer output = Color.malloc(this.format, width * height);\n \n long srcPtr = this.data.address();\n long dstPtr = output.address();\n \n long bytesPerLine = Integer.toUnsignedLong(width) * this.format.sizeof;\n for (int j = 0; j < height; j++)\n {\n long src = srcPtr + Integer.toUnsignedLong((j + y) * this.width + x) * this.format.sizeof;\n long dst = dstPtr + Integer.toUnsignedLong(j * width) * this.format.sizeof;\n MemoryUtil.memCopy(src, dst, bytesPerLine);\n }\n \n this.data.free();\n \n this.data = output;\n this.width = width;\n this.height = height;\n this.mipmaps = 1;\n }\n return this;\n }", "protected void onActivityResult(int requestCode, int resultCode, Intent data) {\n super.onActivityResult(requestCode, resultCode, data);\n\n if (requestCode == CropImage.CROP_IMAGE_ACTIVITY_REQUEST_CODE) {\n CropImage.ActivityResult result = CropImage.getActivityResult(data);\n if (resultCode == RESULT_OK) {\n //getting Image to show\n Uri resultUri = result.getUri();\n profilePic.setImageURI(resultUri);\n\n //getting image to save bitmap formate\n try{\n bitmap = MediaStore.Images.Media.getBitmap(getContentResolver(),resultUri);\n imageChanged = true;\n }catch (IOException e){\n e.printStackTrace();\n }\n\n\n } else if (resultCode == CropImage.CROP_IMAGE_ACTIVITY_RESULT_ERROR_CODE) {\n Exception error = result.getError();\n Toast.makeText(this, \"\"+error, Toast.LENGTH_SHORT).show();\n }\n }\n }", "private void startCropImageActivity(Uri imageUri) {\n\n\n CropImage.ActivityBuilder a = CropImage.activity(imageUri);\n a.setFixAspectRatio(true);\n a.setAspectRatio(4, 3);\n a.setGuidelines(CropImageView.Guidelines.ON);\n a.setAllowCounterRotation(true);\n a.setAllowRotation(false);\n a.setMultiTouchEnabled(false);\n a.start(this, ActivityCrop.class);\n\n }", "public void savePicture() {\n\t\tLog.d(TAG, \"savePicture\");\n\t\t\n\t\tFile cropFile = new File(Environment.getExternalStoragePublicDirectory(Environment.DIRECTORY_PICTURES).getPath() + \"/Lente/crop.jpg\");\n\t\tmCropView.setDrawingCacheEnabled(true);\n\t\tBitmap bm = Bitmap.createBitmap(mCropView.getDrawingCache());\n\t\tmCropView.setDrawingCacheEnabled(false);\n\t\t\n\t\ttry {\n\t\t FileOutputStream outputStream = new FileOutputStream(cropFile);\n\t\t Log.d(TAG, \"Compressing and saving...\");\n\t\t bm.compress(Bitmap.CompressFormat.JPEG, 100, outputStream);\n\t\t outputStream.flush();\n\t\t outputStream.close();\n\t\t \n\t\t MediaScannerConnection.scanFile(getBaseContext(),\n\t new String[] { cropFile.toString() }, null,\n\t new MediaScannerConnection.OnScanCompletedListener() {\n\t public void onScanCompleted(String path, Uri uri) {\n\t Log.i(\"ExternalStorage\", \"Scanned \" + path + \":\");\n\t Log.i(\"ExternalStorage\", \"-> uri=\" + uri);\n\t //passUri(uri); //Pass the URI once obtained and move onto OCRopus\n\t }\n\t\t\t});\n\t }\n\t\t\n\t\tcatch (IOException e) {\n\t\t\tToast.makeText(ImageTextSelect.this, \"Failed to save selected image area.\", 2000).show();\n\t\t\tLog.e(TAG, \"IO Exception\");\n\t\t}\n\t}", "public static Intent getCropImageIntent(Uri photoUri) {\n Intent intent = new Intent(\"com.android.camera.action.CROP\");\n intent.setDataAndType(photoUri, \"image/*\");\n intent.putExtra(\"crop\", \"true\");\n intent.putExtra(\"aspectX\", 1);\n intent.putExtra(\"aspectY\", 1);\n intent.putExtra(\"outputX\", ICON_SIZE);\n intent.putExtra(\"outputY\", ICON_SIZE);\n intent.putExtra(\"return-data\", true);\n return intent;\n }", "public void Croppedimage(CropImage.ActivityResult result, ImageView iv, EditText et )\n {\n Uri resultUri = null; // get image uri\n if (result != null) {\n resultUri = result.getUri();\n }\n\n\n //set image to image view\n iv.setImageURI(resultUri);\n\n\n //get drawable bitmap for text recognition\n BitmapDrawable bitmapDrawable = (BitmapDrawable) iv.getDrawable();\n\n Bitmap bitmap = bitmapDrawable.getBitmap();\n\n TextRecognizer recognizer = new TextRecognizer.Builder(getApplicationContext()).build();\n\n if(!recognizer.isOperational())\n {\n Toast.makeText(this, \"Error No Text To Recognize\", Toast.LENGTH_LONG).show();\n }\n else\n {\n Frame frame = new Frame.Builder().setBitmap(bitmap).build();\n SparseArray<TextBlock> items = recognizer.detect(frame);\n StringBuilder ab = new StringBuilder();\n\n //get text from ab until there is no text\n for(int i = 0 ; i < items.size(); i++)\n {\n TextBlock myItem = items.valueAt(i);\n ab.append(myItem.getValue());\n\n }\n\n //set text to edit text\n et.setText(ab.toString());\n }\n\n }", "public interface Listener {\n void onCropImage(Bitmap original, Bitmap croppedBitmap);\n }", "private Bitmap inMemoryCrop(RotateBitmap rotateBitmap, Bitmap croppedImage, Rect r,\n int width, int height, int outWidth, int outHeight) {\n System.gc();\n\n try {\n croppedImage = Bitmap.createBitmap( outWidth, outHeight, Bitmap.Config.RGB_565 );\n\n Canvas canvas = new Canvas( croppedImage );\n RectF dstRect = new RectF( 0, 0, width, height );\n\n Matrix m = new Matrix();\n m.setRectToRect( new RectF( r ), dstRect, Matrix.ScaleToFit.FILL );\n m.preConcat( rotateBitmap.getRotateMatrix() );\n canvas.drawBitmap( rotateBitmap.getBitmap(), m, null );\n } catch (OutOfMemoryError e) {\n Log.e( \"Error cropping picture: \" + e.getMessage(), e );\n System.gc();\n }\n\n // Release bitmap memory as soon as possible\n clearImageView();\n return croppedImage;\n }", "@Override\n protected void onActivityResult(int requestCode, int resultCode, Intent data) {\n super.onActivityResult(requestCode, resultCode, data);\n if (resultCode == RESULT_OK)\n {\n //------------Received image from camera in device serial number------------------------\n if (requestCode == CAMERA_DEVICE_SERIAL_NUMBER)\n {\n Uri picUri = pictureUri;\n startCropImageActivity(picUri, CROP_CAMERA_SERIAL_NUMBER);\n Toast.makeText(UserAreaActivity.this, \"Serial Number Image Saved!\", Toast.LENGTH_SHORT).show();\n }\n\n //---------------Cropped image from camera in device serial number----------------------\n if (requestCode == CROP_CAMERA_SERIAL_NUMBER)\n {\n CropImage.ActivityResult result = CropImage.getActivityResult(data);\n Croppedimage(result, ivDeviceSerialNumber, etDeviceSerialNumber);\n }\n\n //------------Received image from gallery in device serial number-----------------------\n if (requestCode == GALLERY_DEVICE_SERIAL_NUMBER)\n {\n startCropImageActivity(data.getData(), CROP_GALLERY_SERIAL_NUMBER);\n Toast.makeText(UserAreaActivity.this, \"Image from gallery\", Toast.LENGTH_SHORT).show();\n }\n\n //--------------Cropped image from gallery in device serial number----------------------\n if(requestCode == CROP_GALLERY_SERIAL_NUMBER)\n {\n CropImage.ActivityResult result = CropImage.getActivityResult(data);\n Croppedimage(result, ivDeviceSerialNumber, etDeviceSerialNumber);\n }\n\n }\n\n }", "public void loadImagefromGallery(View view) {\n Intent intent = new Intent(Intent.ACTION_PICK,\n android.provider.MediaStore.Images.Media.EXTERNAL_CONTENT_URI);\n\n intent.putExtra(\"crop\", \"true\");\n intent.putExtra(\"aspectX\", 50);\n intent.putExtra(\"aspectY\", 50);\n intent.putExtra(\"outputX\", 100);\n intent.putExtra(\"outputY\", 100);\n\n try {\n // Start the Intent\n startActivityForResult(intent, PICK_FROM_GALLERY);\n } catch (ActivityNotFoundException ae) {\n\n } catch (Exception e) {\n\n }\n }", "private void getSetCropImage(Uri fileUri) {\n CropImage.activity(fileUri)\n .setGuidelines(CropImageView.Guidelines.ON)\n .setMinCropWindowSize(100, 100)\n .setAspectRatio(1, 1)\n .setFixAspectRatio(true)\n .setCropShape(CropImageView.CropShape.RECTANGLE)\n .start((Activity) mContext);\n }", "@Override\n @SuppressLint(\"NewApi\")\n protected void onActivityResult(int requestCode, int resultCode, Intent data) {\n if (requestCode == CropImage.PICK_IMAGE_CHOOSER_REQUEST_CODE && resultCode == Activity.RESULT_OK) {\n Uri imageUri = CropImage.getPickImageResultUri(this, data);\n\n // For API >= 23 we need to check specifically that we have permissions to read external storage.\n if (CropImage.isReadExternalStoragePermissionsRequired(this, imageUri)) {\n // request permissions and handle the result in onRequestPermissionsResult()\n mCropImageUri = imageUri;\n requestPermissions(new String[]{android.Manifest.permission.READ_EXTERNAL_STORAGE}, CropImage.PICK_IMAGE_PERMISSIONS_REQUEST_CODE);\n } else {\n // no permissions required or already grunted, can start crop image activity\n startCropImageActivity(imageUri);\n }\n } else if (requestCode == CropImage.CROP_IMAGE_ACTIVITY_REQUEST_CODE) {\n CropImage.ActivityResult result = CropImage.getActivityResult(data);\n if (resultCode == RESULT_OK) {\n mCropImageUri = result.getUri();\n InputStream imageStream = null;\n try {\n imageStream = getContentResolver().openInputStream(mCropImageUri);\n } catch (FileNotFoundException e) {\n e.printStackTrace();\n }\n\n mCropImage = BitmapFactory.decodeStream(imageStream);\n imgRestaurant.setImageBitmap(mCropImage);\n\n } else if (resultCode == CropImage.CROP_IMAGE_ACTIVITY_RESULT_ERROR_CODE) {\n Exception error = result.getError();\n Toast.makeText(NewRestaurantActivity.this, error.getMessage(), Toast.LENGTH_LONG).show();\n }\n }\n }", "public native MagickImage chopImage(Rectangle chopInfo)\n\t\t\tthrows MagickException;", "public Bitmap saveBitmap(int sampleSize, int radius, int strokeWidth) {\n\r\n try {\r\n BitmapFactory.Options options = new BitmapFactory.Options();\r\n options.inJustDecodeBounds = true; //Chỉ đọc thông tin ảnh, không đọc dữ liwwuj\r\n BitmapFactory.decodeFile(pathImage, options); //Đọc thông tin ảnh\r\n options.inSampleSize = sampleSize; //Scale bitmap xuống 1 lần\r\n options.inJustDecodeBounds = false; //Cho phép đọc dữ liệu ảnh ảnh\r\n Bitmap originalSizeBitmap = BitmapFactory.decodeFile(pathImage, options);\r\n\r\n Bitmap mutableBitmap = originalSizeBitmap.copy(Bitmap.Config.ARGB_8888, true);\r\n RectF originalRect =\r\n new RectF(0, 0, mutableBitmap.getWidth(), mutableBitmap.getHeight());\r\n\r\n originalSizeBitmap.recycle();\r\n originalSizeBitmap = null;\r\n System.gc();\r\n\r\n Canvas canvas = new Canvas(mutableBitmap);\r\n\r\n float[] originXy = getOriginalPoint(originalRect);\r\n circlePaint.setStrokeWidth(strokeWidth);\r\n canvas.drawCircle(originXy[0], originXy[1], radius, circlePaint);\r\n return mutableBitmap;\r\n } catch (Exception e) {\r\n e.printStackTrace();\r\n Toast.makeText(getContext(), \"can not draw original bitmap\", Toast.LENGTH_SHORT)\r\n .show();\r\n return getBitmapScreenShot();\r\n }\r\n }", "private javaxt.io.Image _transform_simple(javaxt.io.Image src_img, \n double[] src_bbox, int[] dst_size, double[] dst_bbox){\n\n double[] src_quad = new double[]{0, 0, src_img.getWidth(), src_img.getHeight()};\n SRS.transf to_src_px =SRS.make_lin_transf(src_bbox, src_quad);\n\n //minx, miny = to_src_px((dst_bbox[0], dst_bbox[3]));\n double[] min = to_src_px.transf(dst_bbox[0], dst_bbox[3]);\n double minx = min[0];\n double miny = min[1];\n\n //maxx, maxy = to_src_px((dst_bbox[2], dst_bbox[1]));\n double[] max = to_src_px.transf(dst_bbox[2], dst_bbox[1]);\n double maxx = max[0];\n double maxy = max[1];\n\n double src_res = (src_bbox[0]-src_bbox[2])/src_img.getWidth();\n double dst_res = (dst_bbox[0]-dst_bbox[2])/dst_size[0];\n\n double tenth_px_res = Math.abs(dst_res/(dst_size[0]*10));\n javaxt.io.Image img = new javaxt.io.Image(src_img.getBufferedImage());\n if (Math.abs(src_res-dst_res) < tenth_px_res){\n img.crop(cint(minx), cint(miny), dst_size[0], dst_size[1]);\n //src_img.crop(cint(minx), cint(miny), cint(minx)+dst_size[0], cint(miny)+dst_size[1]);\n return img; //src_img;\n }\n else{\n img.crop(cint(minx), cint(miny), cint(maxx)-cint(minx), cint(maxy)-cint(miny));\n img.resize(dst_size[0], dst_size[1]);\n //src_img.crop(cint(minx), cint(miny), cint(maxx), cint(maxy));\n //src_img.resize(dst_size[0], dst_size[1]);\n return img; //src_img;\n }\n //ImageSource(result, size=dst_size, transparent=src_img.transparent)\n }", "public static Bitmap getCroppedBitmap(Bitmap bitmap) {\n Bitmap output = Bitmap.createBitmap(bitmap.getWidth(),\n bitmap.getHeight(), Config.ARGB_8888);\n\n final Rect rect = new Rect(0, 0, bitmap.getWidth(), bitmap.getHeight());\n\n Canvas canvas = new Canvas(output);\n\n final Paint paint = new Paint();\n paint.setAntiAlias(true);\n\n int halfWidth = bitmap.getWidth() / 2;\n int halfHeight = bitmap.getHeight() / 2;\n\n canvas.drawCircle(halfWidth, halfHeight,\n Math.max(halfWidth, halfHeight), paint);\n paint.setXfermode(new PorterDuffXfermode(Mode.SRC_IN));\n canvas.drawBitmap(bitmap, rect, rect, paint);\n return output;\n }", "public static BufferedImage cropImage(int x1, int y1, int x2, int y2, BufferedImage src){\n\t\tBufferedImage dest = null;\n\t\t\n\t\tif(x1>x2){\n\t\t\tint tmp = x1;\n\t\t\tx1 = x2;\n\t\t\tx2 = tmp;\n\t\t}\n\t\t\n\t\tif(y1>y2){\n\t\t\tint tmp = y1;\n\t\t\ty1 = y2;\n\t\t\ty2 = tmp;\n\t\t}\n\t\t\n\t\tx1 = Math.max(x1, 0);\n\t\tx2 = Math.min(x2, src.getWidth()-1);\n\t\t\t\t\n\t\ty1 = Math.max(y1, 0);\n\t\ty2 = Math.min(y2, src.getHeight()-1);\n\t\t\n\t\tdest = src.getSubimage(x1, y1, Math.abs(x2 - x1), Math.abs(y2 - y1));\n\n\t\treturn dest;\n\t}", "private void cropCurrRect() {\n\t\tRectangle cropRec = currRect.getBounds();\n\t\tBufferedImage img = currImage.getSubimage(cropRec.x, cropRec.y, cropRec.width, cropRec.height);\n\t\tAffineTransform rotAT = AffineTransform.getRotateInstance(-currRect.getTheta(), cropRec.width, cropRec.height);\n\n\t\tBufferedImageOp bio;\n\t\tbio = new AffineTransformOp(rotAT, AffineTransformOp.TYPE_BICUBIC);\n\t\tBufferedImage rotImg = bio.filter(img, null);\n\t\tColorSpace cs = ColorSpace.getInstance(ColorSpace.CS_GRAY);\n\t\tColorConvertOp op = new ColorConvertOp(cs, null);\n\t\trotImg = op.filter(rotImg, null);\n\t\t\n\t\tocrExtraction(rotImg);\n\t}", "private void startCropImageActivity(Uri imageUri) {\n CropImage.activity(imageUri)\n .setGuidelines(CropImageView.Guidelines.ON)\n .setMultiTouchEnabled(true)\n .start(this);\n }", "@Override\n\tpublic void onActivityResult(int requestCode, int resultCode, Intent data) {\n\t\tsuper.onActivityResult(requestCode, resultCode, data);\n\t\tLog.e(\"on success\", \"on success\");\n\t\tBitmap s = null;\n\n\t\tif (resultCode == getActivity().RESULT_OK) {\n\t\t\t// user is returning from capturing an image using the camera\n\t\t\tif (requestCode == CAMERA_CAPTURE) {\n\t\t\t\tLog.e(\"camera\", \"camera\");\n\t\t\t\tpicUri = data.getData();\n\t\t\t\tBundle extras = data.getExtras();\n\t\t\t\t// get the cropped bitmap\n\t\t\t\tBitmap thePic = extras.getParcelable(\"data\");\n\t\t\t\tsavetoaFileLocation(thePic);\n\t\t\t\tthePic = getResizedBitmap(thePic, 200, 200);\n\t\t\t\tcameraBitmap = thePic;\n\t\t\t\t// ImageView picView = (ImageView)\n\t\t\t\t// findViewById(R.id.img_userimage);\n\t\t\t\t// display the returned cropped image\n\t\t\t\tprofileimageeditflag=\"true\";\n\t\t\t\tGraphicsUtil graphicUtil = new GraphicsUtil();\n\t\t\t\t// picView.setImageBitmap(graphicUtil.getRoundedShape(thePic));\n\t\t\t\t\n\t\t\t\tpicview1.setImageBitmap(graphicUtil.getCircleBitmap(thePic, 16));\n\t\t\t\t//picview1.setImageBitmap(cameraBitmap);\n\t\t\t} else if (requestCode == GALLERY_CAPTURE) {\n\n\n\n\n\t\t\t\tUri selectedImage = data.getData();\n\n\t\t\t\tString stringUri;\n\t\t\t\tstringUri = selectedImage.toString();\n\t\t\t\tif ((stringUri != \"\") || stringUri != null) {\n\n\t\t\t\t\tString selectedImagePath = getPath(selectedImage);\ntry {\n\tExifInterface exifInterface = new ExifInterface(selectedImagePath);\n\torientation = exifInterface.getAttributeInt(ExifInterface.TAG_ORIENTATION, ExifInterface.ORIENTATION_NORMAL);\n\n}\ncatch (Exception e){}\n\n\n\n\t\t\t\t\tString[] filePathColumn = { MediaStore.Images.Media.DATA };\n\t\t\t\t\tCursor cursor = getActivity().getContentResolver().query(\n\t\t\t\t\t\t\tselectedImage, filePathColumn, null, null, null);\n\t\t\t\t\tcursor.moveToFirst();\n\t\t\t\t\tint columnIndex = cursor.getColumnIndex(filePathColumn[0]);\n\t\t\t\t\tString selectedimage_path = cursor.getString(columnIndex);\n\t\t\t\t\tLog.e(\"selected path\",selectedimage_path);\n\t\t\t\t\tcursor.close();\n\t\t\t\t\tif (selectedimage_path.startsWith(\"https://\")) {\n\t\t\t\t\t\tgetBiymapFromGoogleLocation(selectedimage_path);\n\t\t\t\t\t\treturn;\n\t\t\t\t\t} else {\n\t\t\t\t\t\ts = getBitmapFromFile(selectedimage_path);\n\t\t\t\t\t}\n\t\t\t\t\ts = getResizedBitmap(s, 200, 200);\n\t\t\t\t\tcameraBitmap = s;\n\n\t\t\t\t\tswitch(orientation) {\n\t\t\t\t\t\tcase ExifInterface.ORIENTATION_ROTATE_90:\n\t\t\t\t\t\t\tcorrectedBitMap = rotateImage(cameraBitmap, 90);\n\t\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t\tcase ExifInterface.ORIENTATION_ROTATE_180:\n\t\t\t\t\t\t\tcorrectedBitMap = rotateImage(cameraBitmap, 180);\n\t\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t\tcase ExifInterface.ORIENTATION_ROTATE_270:\n\t\t\t\t\t\t\tcorrectedBitMap = rotateImage(cameraBitmap, 270);\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tdefault:\n\t\t\t\t\t\t\tcorrectedBitMap=cameraBitmap;\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\n\n\n\n\n\n\n\n\n\n\t\t\t\t\t// ImageView picView = (ImageView)\n\t\t\t\t\t// findViewById(R.id.img_userimage);\n\t\t\t\t\t// display the returned cropped image\nprofileimageeditflag=\"true\";\n\t\t\t\t\tGraphicsUtil graphicUtil = new GraphicsUtil();\n\n\n\t/*\t\t\t\tif(correctedBitMap!= null)\n\t\t\t\t\t{\n\t\t\t\t\t\tpicView.setImageBitmap(graphicUtil.getCircleBitmap(\n\t\t\t\t\t\t\t\tcorrectedBitMap, 16));\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t{\n\t\t\t\t\t\t// picView.setImageBitmap(graphicUtil.getRoundedShape(thePic));\n\t\t\t\t\t\tpicView.setImageBitmap(graphicUtil.getCircleBitmap(\n\t\t\t\t\t\t\t\tcameraBitmap, 16));\n\t\t\t\t\t}\n\n*/\n\n\t\t\t\t\tif (correctedBitMap != null)\n\t\t\t\t\t{\n\t\t\t\t\t\tpicview1.setImageBitmap(graphicUtil.getCircleBitmap(correctedBitMap, 16));\n\t\t\t\t\t\tsavetoaFileLocation(correctedBitMap);\n\t\t\t\t\t}\n\t\t\t\t\telse {\n\t\t\t\t\t\tpicview1.setImageBitmap(graphicUtil.getCircleBitmap(s, 16));\n\t\t\t\t\t\tsavetoaFileLocation(s);\n\t\t\t\t\t}\n\n\n\n\t\t\t\t\t// picView.setImageBitmap(graphicUtil.getRoundedShape(thePic));\n\t\t\t\n\t\t\t\t//\tpicview1.setImageBitmap(graphicUtil.getCircleBitmap(s, 16));\n\t\t\t\t//\tpicview1.setImageBitmap(cameraBitmap);\n\t\t\t\t//\tsavetoaFileLocation(s);\n\t\t\t\t}\n\t\t\t}\n\n\t\t}\n\t}", "public ConstRect cropBy(final ConstRect another)\r\n {\r\n // final ConstRect ret = new ConstRect(this);\r\n int xx = x, yy = y, w = width, h = height;\r\n if(x < another.x)\r\n {\r\n xx = another.x;\r\n w = width - (xx - x);// another.x + another.width - xx - 1;\r\n }\r\n else if(x + width > another.x + another.width)\r\n {\r\n w = another.x + another.width - x - 1;\r\n }\r\n if(y < another.y)\r\n {\r\n yy = another.y;\r\n h = height - (yy - y);\r\n }\r\n else if(y + height > another.y + another.height)\r\n {\r\n h = another.y + another.height - y - 1;\r\n }\r\n return new ConstRect(xx, yy, w, h);\r\n }", "public void onClick(View v) {\n\t\t\tFile avator=new File(FileUtil.getImgPath(),\"avator.jpg\");\n\t\t\tif(avator.exists())\n\t\t\t\tavator.delete();\n\t\t\ttry {\n\t\t\t\tavator.createNewFile();\n\t\t\t} catch (IOException e) {\n\t\t\t\t// TODO Auto-generated catch block\n\t\t\t\te.printStackTrace();\n\t\t\t}\n\t\t\timageUri=Uri.fromFile(avator);//将file对象转换为uri对象。\n\t\t\tIntent intent=new Intent(\"com.android.camera.action.CROP\");\n\t\t\tintent.setAction(Intent.ACTION_PICK);\n\t\t\tintent.setType(\"image/*\");\n\t\t\tintent.putExtra(\"crop\", true);\n\t\t\tintent.putExtra(\"scale\", true);\n\t\t\tintent.putExtra(MediaStore.EXTRA_OUTPUT, imageUri);\n\t\t\tstartActivityForResult(intent, ADAVTOR_CONST);\n\t\t}", "public native MagickImage trimImage() throws MagickException;", "public static BufferedImage cropImage(BufferedImage img, Rectangle bounds)\n\t{\n\t\tBufferedImage dest = img.getSubimage(bounds.x, bounds.y, bounds.width, bounds.height);\n\t\treturn dest; \n\t}", "public BufferedImage crop(int row,int col){\n\t\treturn imageSheet.getSubimage((col*64)-64, (row*64)-64, 64, 64);\n\t}", "@Override\n protected void onActivityResult(int requestCode, int resultCode, Intent data) {\n if (requestCode == CropImage.PICK_IMAGE_CHOOSER_REQUEST_CODE && resultCode == Activity.RESULT_OK) {\n Uri imageUri = CropImage.getPickImageResultUri(this, data);\n startCropImageActivity(imageUri);\n }\n\n // handle result of CropImageActivity\n if (requestCode == CropImage.CROP_IMAGE_ACTIVITY_REQUEST_CODE) {\n CropImage.ActivityResult result = CropImage.getActivityResult(data);\n if (resultCode == RESULT_OK) {\n mCroppedImageUri = result.getUri();\n mImageView.setImageURI(mCroppedImageUri);\n }\n }\n }", "private Rect getNewRect(float x, float y) {\n PointF currentTouchPos = viewToSourceCoord(x, y);\n\n boolean freeAspectRatio = aspectRatio < 0.0;\n\n if (freeAspectRatio) {\n if (touchedCorner == TOP_LEFT) {\n return checkRectBounds(new Rect((int) currentTouchPos.x, (int) currentTouchPos.y,\n cropRect.right, cropRect.bottom), true);\n } else if (touchedCorner == TOP_RIGHT) {\n return checkRectBounds(new Rect(cropRect.left, (int) currentTouchPos.y,\n (int) currentTouchPos.x, cropRect.bottom), true);\n } else if (touchedCorner == BOTTOM_RIGHT) {\n return checkRectBounds(new Rect(cropRect.left, cropRect.top,\n (int) currentTouchPos.x, (int) currentTouchPos.y), true);\n } else if (touchedCorner == BOTTOM_LEFT) {\n return checkRectBounds(new Rect((int) currentTouchPos.x, cropRect.top,\n cropRect.right, (int) currentTouchPos.y), true);\n }\n } else {\n // fixed aspectRatio\n if (touchedCorner == TOP_LEFT) {\n int delta = (int) Math.max(currentTouchPos.x - cropRect.left,\n currentTouchPos.y - cropRect.top);\n return checkRectBounds(new Rect((int) Math.round(cropRect.left\n + delta * aspectRatio), cropRect.top + delta,\n cropRect.right, cropRect.bottom), true);\n } else if (touchedCorner == TOP_RIGHT) {\n int delta = (int) Math.max(cropRect.right - currentTouchPos.x,\n currentTouchPos.y - cropRect.top);\n return checkRectBounds(new Rect(cropRect.left, cropRect.top + delta,\n (int) Math.round(cropRect.right - delta * aspectRatio),\n cropRect.bottom), true);\n } else if (touchedCorner == BOTTOM_RIGHT) {\n int delta = (int) Math.max(cropRect.right - currentTouchPos.x,\n cropRect.bottom - currentTouchPos.y);\n return checkRectBounds(new Rect(cropRect.left, cropRect.top,\n (int) Math.round(cropRect.right - delta * aspectRatio),\n cropRect.bottom - delta), true);\n } else if (touchedCorner == BOTTOM_LEFT) {\n int delta = (int) Math.max(currentTouchPos.x - cropRect.left,\n cropRect.bottom - currentTouchPos.y);\n return checkRectBounds(new Rect((int) Math.round(cropRect.left\n + delta * aspectRatio), cropRect.top,\n cropRect.right, cropRect.bottom - delta), true);\n }\n }\n\n return null;\n }", "@Override\n @SuppressLint(\"NewApi\")\n protected void onActivityResult(int requestCode, int resultCode, Intent data) {\n if (requestCode == CropImage.PICK_IMAGE_CHOOSER_REQUEST_CODE && resultCode == Activity.RESULT_OK) {\n Uri imageUri = CropImage.getPickImageResultUri(this, data);\n\n // For API >= 23 we need to check specifically that we have permissions to read external storage.\n if (CropImage.isReadExternalStoragePermissionsRequired(this, imageUri)) {\n // request permissions and handle the result in onRequestPermissionsResult()\n cropImageUri = imageUri;\n Log.d(TAG, \"onActivityResult PICK_IMAGE_CHOOSER_REQUEST_CODE:\" + cropImageUri);\n requestPermissions(new String[]{Manifest.permission.READ_EXTERNAL_STORAGE}, CropImage.PICK_IMAGE_PERMISSIONS_REQUEST_CODE);\n } else {\n // no permissions required or already grunted, can start crop image activity\n Log.d(TAG, \"onActivityResult PICK_IMAGE_CHOOSER_REQUEST_CODE no permission:\" + imageUri);\n startCropImageActivity(imageUri);\n\n }\n } else if (requestCode == CropImage.CROP_IMAGE_ACTIVITY_REQUEST_CODE) {\n CropImage.ActivityResult result = CropImage.getActivityResult(data);\n if (resultCode == RESULT_OK) {\n Uri resultUri = result.getUri();\n Log.d(TAG, \"CROP_IMAGE_ACTIVITY_REQUEST_CODE ok:\" + resultUri);\n cropImageUri = resultUri;\n if (optionFragment == null) {\n vpSubArea.setAdapter(new TabsAdapter(getSupportFragmentManager()));\n }\n optionFragment.setVoteImage(resultUri);\n } else if (resultCode == CropImage.CROP_IMAGE_ACTIVITY_RESULT_ERROR_CODE) {\n Exception error = result.getError();\n }\n }\n }", "static public Fits do_crop(Fits inFits, int extension,\n int min_x, int min_y, int max_x, int max_y)\n throws FitsException, IOException {\n int x_center = (min_x + max_x) / 2;\n int y_center = (min_y + max_y) / 2;\n int x_size = Math.abs(max_x - min_x);\n int y_size = Math.abs(max_y - min_y);\n\n ImageHDU h = (ImageHDU) inFits.getHDU(extension);\n Header old_header = h.getHeader();\n\n Fits out_fits =\n common_crop(h, old_header, x_center, y_center, x_size, y_size);\n return (out_fits);\n }", "static public Fits do_crop(Fits inFits, int min_x, int min_y, int max_x, int max_y)\n throws FitsException, IOException {\n int x_center = (min_x + max_x) / 2;\n int y_center = (min_y + max_y) / 2;\n int x_size = Math.abs(max_x - min_x);\n int y_size = Math.abs(max_y - min_y);\n\n ImageHDU h = (ImageHDU) inFits.readHDU();\n Header old_header = h.getHeader();\n\n Fits out_fits =\n common_crop(h, old_header, x_center, y_center, x_size, y_size);\n return (out_fits);\n }", "private void startCropImageActivity(Uri imageUri, int requestCode) {\n Intent vCropIntent = CropImage.activity(imageUri)\n .setGuidelines(CropImageView.Guidelines.ON)\n .setMultiTouchEnabled(true)\n .getIntent(this);\n\n startActivityForResult(vCropIntent, requestCode);\n }", "@Override\n\tpublic void crop(int x, int y) {\n\n\t\tif (x >= this.frame.length || y >= this.frame[0].length) {\n\t\t\treturn;\n\t\t}\n\t\t\n\t\tint[][] new_frame = new int[x+1][y+1];\n\n\t\tfor (int i = 0; i <=x; i++) {\n\t\t\tfor (int j = 0; j <=y; j++) {\n\n\t\t\t\tif(isInside(this.frame, i,j)) {\n\t\t\t\t\tnew_frame[i][j] = this.frame[i][j];\n\t\t\t\t}\n\n\n\t\t\t}\n\t\t}\n\t\tthis.frame = new_frame;\n\t}", "@Override\n protected void onActivityResult(int requestCode, int resultCode, @Nullable Intent data) {\n // choose a image\n if (requestCode == RequestCode.CHOOSE_IMAGE) {\n if (resultCode == RESULT_OK) {\n if (data != null) {\n Uri dataUri = data.getData();\n if (dataUri != null) {\n // get a random name\n File imgFile = SpaceUtils.newUsableFile();\n mSelectPath = imgFile.getPath();\n Log.v(\"path\",mSelectPath);\n // the image intent just return a simple image\n // the Ucrop(裁剪) is solved after the image intent\n UCrop.Options options = new UCrop.Options();\n options.setCompressionQuality(100);\n UCrop.of(dataUri, Uri.fromFile(imgFile))\n .withOptions(options)\n .withMaxResultSize(mImageSize.x, mImageSize.y)\n .withAspectRatio(3, 4)\n .start(this, RequestCode.CROP_IMAGE);\n }\n }\n }\n } else if (requestCode == RequestCode.CROP_IMAGE) {\n // crop a image\n if (resultCode == RESULT_OK) {\n if (data != null) {\n Glide.with(this).load(mSelectPath).into(mImageViews.get(mCurrentIndex));\n startDetectFaceInfo();\n }\n }\n }\n super.onActivityResult(requestCode, resultCode, data);\n }", "private void setPic() {\n int targetW = img_clip.getWidth();\n int targetH = img_clip.getHeight();\n\n // Get the dimensions of the bitmap\n BitmapFactory.Options bmOptions = new BitmapFactory.Options();\n bmOptions.inJustDecodeBounds = true;\n BitmapFactory.decodeFile(mCurrentPhotoPath, bmOptions);\n int photoW = bmOptions.outWidth;\n int photoH = bmOptions.outHeight;\n\n // Determine how much to scale down the image\n int scaleFactor = Math.min(photoW/targetW, photoH/targetH);\n\n // Decode the image file into a Bitmap sized to fill the View\n bmOptions.inJustDecodeBounds = false;\n bmOptions.inSampleSize = scaleFactor;\n bmOptions.inPurgeable = true;\n\n Bitmap bitmap = BitmapFactory.decodeFile(mCurrentPhotoPath, bmOptions);\n img_clip.setImageBitmap(bitmap);\n }", "public boolean isRectangularCrop() {\r\n return isRectangularCrop;\r\n }", "public BufferedImage crop(int row,int col,int width,int height){\n\t\treturn imageSheet.getSubimage((col*32)-32, (row*32)-32, width, height);\n\t}", "@Override\n public void onBitmapLoaded(Bitmap bitmap, Picasso.LoadedFrom from) {\n if(bitmap.getHeight()>bitmap.getWidth()){\n\n progressBar.setVisibility(View.INVISIBLE);\n //load to imageview and set scale type to center crop\n imageView.setScaleType(ImageView.ScaleType.CENTER_CROP);\n imageView.setImageBitmap(bitmap);\n\n }else {\n\n progressBar.setVisibility(View.INVISIBLE);\n //load to imageview and set scale type to fitxy\n imageView.setScaleType(ImageView.ScaleType.FIT_XY);\n imageView.setImageBitmap(bitmap);\n\n }\n\n }", "@Override\n\tpublic void onCreate(Bundle savedInstanceState) {\n\t super.onCreate(savedInstanceState);\n\t setContentView(R.layout.mask_activity);\n\t \n\t Display display = getWindowManager().getDefaultDisplay();\n\t Point size = new Point();\n\t display.getSize(size);\n\t width = size.x;\n\t height = size.y;\n\t Log.i(\"x\",\"y\");\n\t wMask = (int) (width*widthMaskConst);\n\t Log.i(\"wMask\",\"\"+wMask);\n\t \n\t \n\t LinearLayout ll = (LinearLayout) findViewById(R.id.ll);\n\t final DrawingView dv= new DrawingView(this);\n\t ll.addView(dv);\n\t \n\t saveButton = (Button) findViewById(R.id.save_button);\n\t \n\t saveButton.setOnClickListener(new View.OnClickListener() {\n\t\t\t\n\t\t\t@Override\n\t\t\tpublic void onClick(View v) {\n\t\t\t\t// TODO Auto-generated method stub\n\t\t\t\t//Toast.makeText(getBaseContext(), \"reaching\", Toast.LENGTH_SHORT).show();\n\t \t\n\t \tclass ToSaveCropped{\n\t \t\t\n\t \t\tfloat x=finalx;\n\t \t\tfloat y=finaly;\n\n\t\t\t\t\tprivate byte[] data = MainActivity.getbitmapData();\n\t\t\t Bitmap mImage = BitmapFactory.decodeByteArray(data, 0, data.length);\n\t\t\t \n\t\t\t Drawable myMask = getResources().getDrawable(R.drawable.mask);\n\t\t\t Bitmap mMask = ((BitmapDrawable) myMask).getBitmap();\n\t\t\t Bitmap mmImage = dv.bitmapRotate(mImage);\n\t\t\t \n\t\t\t Bitmap mmmImage = dv.getResizedBitmap(mmImage,height,width);\n\t\t\t \n\t\t\t Bitmap mmMask = dv.getResizedBitmap(mMask,wMask,wMask);\n\t\t\t\t\t\n\t\t\t\t\tpublic void onDraw(){\n\t\t\t\t\t\tCanvas canvas; \t\t\t\n\t \t\t\tint w = mmMask.getWidth(), h = mmMask.getHeight();\n\t \t\t\tBitmap.Config conf = Bitmap.Config.ARGB_8888; // see other conf types\n\t \t\t\tcroppedBitmap = Bitmap.createBitmap(w, h, conf); // this creates a MUTABLE bitmap\n\t \t\t\tcanvas = new Canvas(croppedBitmap);\n\t \t\t\t\n\t \t\t\tPaint maskPaint = new Paint();\n\t \t\t\tmaskPaint.setXfermode(new PorterDuffXfermode(PorterDuff.Mode.DST_IN));\n\n\t Paint imagePaint = new Paint();\n\t imagePaint.setXfermode(new PorterDuffXfermode(PorterDuff.Mode.DST_OVER));\n\t \t\t\t//Log.i(\"\"+x,\"\"+y);\n\t \t//canvas.drawBitmap(mMask,x,y,maskPaint);\n\t \tcanvas.drawBitmap(mmmImage,-x,-y,imagePaint);\n\t\t\t\t\t}\n\t\t\t\t\t\n\t \t}\t \t\n\t \tToSaveCropped tsc = new ToSaveCropped();\n\t \ttsc.onDraw();\n\t \tByteArrayOutputStream stream = new ByteArrayOutputStream();\n\t \tcroppedBitmap.compress(Bitmap.CompressFormat.PNG, 100, stream);\n\t \tbitData = stream.toByteArray();\n\t\t\t\t\n\t\t\t\tSaveFile sv = new SaveFile();\n\t\t\t\tsv.save();\n\t\t\t\t\n\t\t\t\tMediaStore.Images.Media.insertImage(getContentResolver(), croppedBitmap, \"\", \"\");\n\t\t\t\t\n\t\t\t}\n\t\t}); \n\t \n\t}", "private void resizePhoto() {\n if (photoPath.length() == 0) {\n return;\n }\n Log.d(LOG_TAG, \"Path dell' immagine: \" + photoPath);\n BitmapFactory.Options options = new BitmapFactory.Options();\n options.inJustDecodeBounds = true;\n BitmapFactory.decodeFile(photoPath, options);\n\n options = new BitmapFactory.Options();\n\n options.inJustDecodeBounds = true;\n photoBM = BitmapFactory.decodeFile(photoPath, options);\n Log.d(LOG_TAG, \"Width:\" + bitmapWidth + \" height:\" + bitmapHeight);\n\n options.inSampleSize = calculateInSampleSize(options, bitmapWidth, bitmapHeight);\n\n options.inJustDecodeBounds = false;\n //halfHorizontal = bitmapWidth / 2;\n photoBM = BitmapFactory.decodeFile(photoPath, options);\n\n }", "private Bitmap getScaledBitmap(ImageView imageView) {\n BitmapFactory.Options options = new BitmapFactory.Options();\n options.inJustDecodeBounds = true;\n\n int scaleFactor = Math.min(\n options.outWidth / imageView.getWidth(),\n options.outHeight / imageView.getHeight()\n );\n options.inJustDecodeBounds = false;\n options.inSampleSize = scaleFactor;\n options.inPurgeable = true;\n return BitmapFactory.decodeFile(currentImagePath, options);\n }", "public BufferedImage crop(int x, int y, int width, int height){\n return sheet.getSubimage(x, y, width, height);\n }", "private Bitmap decodeBitmapImage(int image) {\n int targetW = 300;\n int targetH = 300;\n\n // Get the dimensions of the bitmap\n BitmapFactory.Options bmOptions = new BitmapFactory.Options();\n bmOptions.inJustDecodeBounds = true;\n\n BitmapFactory.decodeResource(getResources(), image,\n bmOptions);\n\n int photoW = bmOptions.outWidth;\n int photoH = bmOptions.outHeight;\n\n // Determine how much to scale down the image\n int scaleFactor = Math.min(photoW / targetW, photoH / targetH);\n\n // Decode the image file into a Bitmap sized to fill the View\n bmOptions.inJustDecodeBounds = false;\n bmOptions.inSampleSize = scaleFactor;\n bmOptions.inPurgeable = true;\n\n return BitmapFactory.decodeResource(getResources(), image,\n bmOptions);\n }", "private Rect cropRegionForZoom(float ratio) {\n int xCenter = mSensorRect.width() / 2;\n int yCenter = mSensorRect.height() / 2;\n int xDelta = (int) (0.5f * mSensorRect.width() / ratio);\n int yDelta = (int) (0.5f * mSensorRect.height() / ratio);\n return new Rect(xCenter - xDelta, yCenter - yDelta, xCenter + xDelta, yCenter + yDelta);\n }", "public static BufferedImage cropImage(BufferedImage image, int topX,\r\n\t\t\tint topY, int width, int height) {\r\n\t\t// create cropping rectangle\r\n\t\tBufferedImage dest = image.getSubimage(topX, topY, width, height);\r\n\t\t// return cropped image\r\n\t\treturn dest;\r\n\t}", "private Rect checkRectBounds(Rect cropRect, boolean resize) {\n Rect image = getImageRect();\n Rect newCropRect = cropRect;\n //check if inside image\n int width = newCropRect.width();\n int height = newCropRect.height();\n\n if (!image.contains(newCropRect)) {\n if (aspectRatio >= 0.0) {\n if (resize) {\n // new cropRect to big => try and fix size\n // check corners\n if (touchedCorner == TOP_LEFT) {\n if (image.left > newCropRect.left) {\n int delta = (int) ((image.left - newCropRect.left) / aspectRatio);\n newCropRect = new Rect(image.left, newCropRect.top + delta,\n newCropRect.right, newCropRect.bottom);\n }\n if (image.top > newCropRect.top) {\n int delta = (int) ((image.top - newCropRect.top) * aspectRatio);\n newCropRect = new Rect(newCropRect.left + delta, image.top,\n newCropRect.right, newCropRect.bottom);\n }\n } else if (touchedCorner == TOP_RIGHT) {\n if (image.right < newCropRect.right) {\n int delta = (int) ((newCropRect.right - image.right) / aspectRatio);\n newCropRect = new Rect(newCropRect.left, newCropRect.top + delta,\n image.right, newCropRect.bottom);\n }\n if (image.top > newCropRect.top) {\n int delta = (int) ((image.top - newCropRect.top) * aspectRatio);\n newCropRect = new Rect(newCropRect.left, image.top,\n newCropRect.right - delta, newCropRect.bottom);\n }\n } else if (touchedCorner == BOTTOM_RIGHT) {\n if (image.right < newCropRect.right) {\n int delta = (int) ((newCropRect.right - image.right) / aspectRatio);\n newCropRect = new Rect(newCropRect.left, newCropRect.top,\n image.right, newCropRect.bottom - delta);\n }\n if (image.bottom < newCropRect.bottom) {\n int delta = (int) ((newCropRect.bottom - image.bottom) * aspectRatio);\n newCropRect = new Rect(newCropRect.left, newCropRect.top,\n newCropRect.right - delta, image.bottom);\n }\n } else if (touchedCorner == BOTTOM_LEFT) {\n if (image.left > newCropRect.left) {\n int delta = (int) ((image.left - newCropRect.left) / aspectRatio);\n newCropRect = new Rect(image.left, newCropRect.top,\n newCropRect.right, newCropRect.bottom - delta);\n }\n if (image.bottom < newCropRect.bottom) {\n int delta = (int) ((newCropRect.bottom - image.bottom) * aspectRatio);\n newCropRect = new Rect(newCropRect.left + delta, newCropRect.top,\n newCropRect.right, image.bottom);\n }\n }\n } else {\n // check edges\n // left edges\n if (image.left > newCropRect.left) {\n newCropRect = new Rect(image.left, newCropRect.top,\n image.left + width, newCropRect.bottom);\n }\n // top edge\n if (image.top > newCropRect.top) {\n newCropRect = new Rect(newCropRect.left, image.top,\n newCropRect.right, image.top + height);\n }\n // right edge\n if (image.right < newCropRect.right) {\n newCropRect = new Rect(image.right - width, newCropRect.top,\n image.right, newCropRect.bottom);\n }\n // bottom edge\n if (image.bottom < newCropRect.bottom) {\n newCropRect = new Rect(newCropRect.left, image.bottom - height,\n newCropRect.right, image.bottom);\n }\n }\n } else {\n // cropRect not inside => try to fix it\n if (image.left > newCropRect.left) {\n newCropRect = new Rect(image.left, newCropRect.top,\n resize ? newCropRect.right : image.left + width,\n newCropRect.bottom);\n }\n\n if (image.top > newCropRect.top) {\n newCropRect = new Rect(newCropRect.left, image.top, newCropRect.right,\n resize ? newCropRect.bottom : image.top + height);\n }\n\n if (image.right < newCropRect.right) {\n newCropRect = new Rect(resize ? newCropRect.left : image.right - width,\n newCropRect.top, image.right, newCropRect.bottom);\n }\n\n if (image.bottom < newCropRect.bottom) {\n newCropRect = new Rect(newCropRect.left,\n resize ? newCropRect.top : image.bottom - height,\n newCropRect.right, image.bottom);\n }\n }\n }\n\n Rect minRect = getMinCropRect();\n //check min size\n width = newCropRect.width();\n if (width < minRect.width()) {\n if (touchedCorner == TOP_LEFT) {\n newCropRect = new Rect(newCropRect.right - minRect.width(),\n newCropRect.top, newCropRect.right, newCropRect.bottom);\n } else if (touchedCorner == TOP_RIGHT) {\n newCropRect = new Rect(newCropRect.left, newCropRect.top,\n newCropRect.left + minRect.width(),\n newCropRect.bottom);\n } else if (touchedCorner == BOTTOM_RIGHT) {\n newCropRect = new Rect(newCropRect.left, newCropRect.top,\n newCropRect.left + minRect.width(),\n newCropRect.bottom);\n } else if (touchedCorner == BOTTOM_LEFT) {\n newCropRect = new Rect(newCropRect.right - minRect.width(),\n newCropRect.top, newCropRect.right, newCropRect.bottom);\n }\n }\n\n height = newCropRect.height();\n if (height < minRect.height()) {\n if (touchedCorner == TOP_LEFT) {\n newCropRect = new Rect(newCropRect.left,\n newCropRect.bottom - minRect.height(),\n newCropRect.right, newCropRect.bottom);\n } else if (touchedCorner == TOP_RIGHT) {\n newCropRect = new Rect(newCropRect.left,\n newCropRect.bottom - minRect.height(),\n newCropRect.right, newCropRect.bottom);\n } else if (touchedCorner == BOTTOM_RIGHT) {\n newCropRect = new Rect(newCropRect.left, newCropRect.top,\n newCropRect.right,\n newCropRect.top + minRect.height());\n } else if (touchedCorner == BOTTOM_LEFT) {\n newCropRect = new Rect(newCropRect.left,\n newCropRect.top, newCropRect.right,\n newCropRect.top + minRect.height());\n }\n }\n\n return newCropRect;\n }", "static public Fits do_crop(Fits fits, WorldPt wpt, double radius)\n throws FitsException, IOException, ProjectionException {\n ImageHDU h = (ImageHDU) fits.readHDU();\n Header old_header = h.getHeader();\n ImageHeader temp_hdr = new ImageHeader(old_header);\n CoordinateSys in_coordinate_sys = CoordinateSys.makeCoordinateSys(\n temp_hdr.getJsys(), temp_hdr.file_equinox);\n Projection in_proj = temp_hdr.createProjection(in_coordinate_sys);\n ProjectionPt ipt = in_proj.getImageCoords(wpt.getLon(), wpt.getLat());\n double x = ipt.getFsamp();\n double y = ipt.getFline();\n double x_size = 2 * radius / Math.abs(temp_hdr.cdelt1);\n if (SUTDebug.isDebug()) {\n System.out.println(\"x = \" + x + \" y = \" + y + \" x_size = \" + x_size);\n\n }\n Fits out_fits = common_crop(h, old_header,\n (int) x, (int) y, (int) x_size, (int) x_size);\n return (out_fits);\n }", "public void setCropRect(Rect cropRect) {\n this.cropRect = cropRect;\n //invalidate();\n }", "@VisibleForTesting\n Rect calculateSnapshotCrop() {\n final Rect rect = new Rect();\n final HardwareBuffer snapshot = mSnapshot.getHardwareBuffer();\n rect.set(0, 0, snapshot.getWidth(), snapshot.getHeight());\n final Rect insets = mSnapshot.getContentInsets();\n\n final float scaleX = (float) snapshot.getWidth() / mSnapshot.getTaskSize().x;\n final float scaleY = (float) snapshot.getHeight() / mSnapshot.getTaskSize().y;\n\n // Let's remove all system decorations except the status bar, but only if the task is at the\n // very top of the screen.\n final boolean isTop = mTaskBounds.top == 0 && mFrame.top == 0;\n rect.inset((int) (insets.left * scaleX),\n isTop ? 0 : (int) (insets.top * scaleY),\n (int) (insets.right * scaleX),\n (int) (insets.bottom * scaleY));\n return rect;\n }", "private int getTouchedCorner(MotionEvent motionEvent) {\n PointF currentTouchPos = new PointF(motionEvent.getX(), motionEvent.getY());\n if (cropRect == null) {\n return NO_CORNER;\n }\n PointF topLeft = sourceToViewCoord(cropRect.left, cropRect.top);\n PointF bottomRight = sourceToViewCoord(cropRect.right, cropRect.bottom);\n Rect cropRect = new Rect((int) topLeft.x, (int) topLeft.y,\n (int) bottomRight.x, (int) bottomRight.y);\n\n if (currentTouchPos.x > cropRect.left - touchDelta\n && currentTouchPos.x < cropRect.left + touchDelta\n && currentTouchPos.y > cropRect.top - touchDelta\n && currentTouchPos.y < cropRect.top + touchDelta) {\n return TOP_LEFT;\n }\n\n if (currentTouchPos.x > cropRect.right - touchDelta\n && currentTouchPos.x < cropRect.right + touchDelta\n && currentTouchPos.y > cropRect.top - touchDelta\n && currentTouchPos.y < cropRect.top + touchDelta) {\n return TOP_RIGHT;\n }\n\n if (currentTouchPos.x > cropRect.right - touchDelta\n && currentTouchPos.x < cropRect.right + touchDelta\n && currentTouchPos.y > cropRect.bottom - touchDelta\n && currentTouchPos.y < cropRect.bottom + touchDelta) {\n return BOTTOM_RIGHT;\n }\n\n if (currentTouchPos.x > cropRect.left - touchDelta\n && currentTouchPos.x < cropRect.left + touchDelta\n && currentTouchPos.y > cropRect.bottom - touchDelta\n && currentTouchPos.y < cropRect.bottom + touchDelta) {\n return BOTTOM_LEFT;\n }\n\n return NO_CORNER;\n }", "@Override\n public void onClick(View v) {\n CropImage.activity()\n .setGuidelines(CropImageView.Guidelines.ON)\n .start(SettingActivityDonor.this);\n\n }", "public BufferedImage cropImageSquare( byte[] image ) throws IOException {\n InputStream in = new ByteArrayInputStream( image );\n BufferedImage originalImage = ImageIO.read( in );\n\n // Get image dimensions\n int height = originalImage.getHeight();\n int width = originalImage.getWidth();\n\n // The image is already a square\n if ( height == width ) {\n return originalImage;\n }\n\n // Compute the size of the square\n int squareSize = ( height > width ? width : height );\n\n // Coordinates of the image's middle\n int xc = width / 2;\n int yc = height / 2;\n\n // Crop\n BufferedImage croppedImage = originalImage.getSubimage(\n xc - ( squareSize / 2 ), // x coordinate of the upper-left\n // corner\n yc - ( squareSize / 2 ), // y coordinate of the upper-left\n // corner\n squareSize, // widht\n squareSize // height\n );\n return croppedImage;\n }", "@Override\n protected void onActivityResult(int requestCode, int resultCode, Intent data) {\n\n super.onActivityResult(requestCode, resultCode, data);\n\n //this checks the checked imaged,so there should be no null image...\n if(requestCode== GalleryPic && resultCode == RESULT_OK && data != null) {\n Uri ImageUri = data.getData(); //here we getting the image.....in ImageUri\n\n //When the user Select the image he will be redirected to the Image Cropping Activity...\n CropImage.activity(ImageUri)\n .setAspectRatio(1,1)\n .setCropShape(CropImageView.CropShape.OVAL)\n .start(this);\n }\n //THIS CHECKS WHETHER WE SELECT THE CROP OPTION...\n if(requestCode==CropImage.CROP_IMAGE_ACTIVITY_REQUEST_CODE)\n {\n //HERE WE GETTING CROPPED IMAGE...\n CropImage.ActivityResult result= CropImage.getActivityResult(data);\n\n if(resultCode == RESULT_OK) //IF CROPPING SUCCESSFULL...\n {\n loadingBar.setTitle(\"Saving Information\");\n loadingBar.setMessage(\"Please wait until we update your Profile Image\");\n loadingBar.setProgressStyle(ProgressDialog.STYLE_SPINNER);\n loadingBar.show();\n loadingBar.setCanceledOnTouchOutside(true);\n\n //THIS OBJECTS CONTAINS THE CROPPED IMAGE....\n Uri resultUri =result.getUri();\n\n //WE STORING THE STORAGE REFERENCE AS A USERID.JPG.....\n StorageReference filePath = UserProfileImageRef.child(CurrentUserId + \".jpg\");\n\n //HERE STORING THE FILE IN filePath OBJECT..\n filePath.putFile(resultUri).addOnCompleteListener(new OnCompleteListener<UploadTask.TaskSnapshot>() {\n @Override\n public void onComplete(@NonNull Task<UploadTask.TaskSnapshot> task) {\n if(task.isSuccessful())\n {\n Toast.makeText(SetupActivity.this,\"Profile Image Stored to Database Successfully\",Toast.LENGTH_SHORT).show();\n\n //FINALLY STORING THE IMAGE IN DATABASE IN FIREBASE STORAGE...\n final String downloadUrl = task.getResult().getDownloadUrl().toString();\n UsersRef.child(\"profileImage\").setValue(downloadUrl).addOnCompleteListener(new OnCompleteListener<Void>() {\n @Override\n public void onComplete(@NonNull Task<Void> task) {\n if(task.isSuccessful())\n {\n //REDIRECTING TO SETUP ACTIVITY FROM CROPPING ACTIVITY....\n Intent selfIntent = new Intent(SetupActivity.this,SetupActivity.class);\n startActivity(selfIntent);\n Toast.makeText(SetupActivity.this, \"Profile Image is Stored Successfully\", Toast.LENGTH_SHORT).show();\n loadingBar.dismiss();\n }\n else{\n String message =task.getException().getMessage();\n Toast.makeText(SetupActivity.this, \"Error Occurred :\" +message, Toast.LENGTH_SHORT).show();\n loadingBar.dismiss();\n }\n }\n });\n }\n }\n });\n\n }\n\n else{\n //IF THE IMAGE IS UNABLE TO CROP...\n Toast.makeText(SetupActivity.this, \"Error Occurred : Image can't be Cropped,Try Again.\" , Toast.LENGTH_SHORT).show();\n loadingBar.dismiss();\n }\n\n }\n //else if(requestCode == CropImage.CROP_IMAGE_ACTIVITY_RESULT_ERROR_CODE)\n }", "@Override\r\n\t protected Bitmap doInBackground(Integer... params) {\r\n\t \trowid = params[0];\r\n\t\t\tString imageInSD = Environment.getExternalStorageDirectory().getPath()\r\n\t\t\t\t\t+ \"/Pictures/MyCameraApp/\" + rowid + \".jpg\";\r\n\r\n\r\n\t\t\t// First decode with inJustDecodeBounds=true to check dimensions\r\n\t\t\tfinal BitmapFactory.Options options = new BitmapFactory.Options();\r\n\t\t\toptions.inJustDecodeBounds = true;\r\n\t\t\tBitmapFactory.decodeFile(imageInSD, options);\r\n\r\n\t\t\t// Calculate inSampleSize\r\n\t\t\toptions.inSampleSize = calculateInSampleSize(options, 200,\r\n\t\t\t\t\t200);\r\n\r\n\t\t\t// Decode bitmap with inSampleSize set\r\n\t\t\toptions.inJustDecodeBounds = false;\r\n\t\t\treturn BitmapFactory.decodeFile(imageInSD, options);\r\n\t }", "@Override\n\tprotected void onActivityResult(int requestCode, int resultCode, Intent data) {\n\t\tif (resultCode != RESULT_OK) {\n\t\t\tLog.d(\"CS65\", \"Camera error: result not ok.\");\n\t\t\treturn;\n\t\t}\n\n\t\tswitch (requestCode) {\n\t\tcase REQUEST_CODE_CHOOSE_FROM_GALLERY:\n\t\t\t// Allow user to choose image from internal gallery.\n\t\t\tLog.d(\"CS65\", \"entered choose from gallery request\");\n\t\t\tmImageCaptureUri = data.getData();\n\t\t\tcropImage();\n\t\t\tbreak;\n\n\t\tcase REQUEST_CODE_TAKE_FROM_CAMERA:\n\t\t\t// Allow user to take a photo from the camera.\n\t\t\t// Send image taken from camera for cropping\n\t\t\tcropImage();\n\t\t\tbreak;\n\n\t\tcase REQUEST_CODE_CROP_PHOTO:\n\t\t\t// Update image view after image crop.\n\t\t\tBundle extras = data.getExtras();\n\t\t\t// Set the picture image in UI\n\t\t\tif (extras != null) {\n\t\t\t\t// Convert bitmap to a byte array and load.\n\t\t\t\tBitmap photo = (Bitmap) extras.getParcelable(\"data\");\n\t\t\t\tbitToByte(photo);\n\t\t\t\tloadImage();\n\t\t\t}\n\n\t\t\t// Delete temporary image taken by camera after crop.\n\t\t\tif (isTakenFromCamera) {\n\t\t\t\tFile f = new File(mImageCaptureUri.getPath());\n\t\t\t\tif (f.exists())\n\t\t\t\t\tf.delete();\n\t\t\t}\n\t\t\tbreak;\n\t\t}\n\t}", "@TargetApi(Build.VERSION_CODES.KITKAT)\n @Override\n public void onFinishTakeKitkatPhoto(int requestCode, Uri uri\n , int takeFlags, ContentResolver contentResolver, Cursor imageCursor) {\n contentResolver.takePersistableUriPermission(uri, takeFlags);\n\n String selectedImagePath = null;\n if (imageCursor.moveToFirst()) {\n selectedImagePath = imageCursor.getString(imageCursor.getColumnIndex(MediaStore.Images.Media.DATA));\n }\n doCropImage(selectedImagePath);\n //doLoadImage(selectedImagePath);\n //profileDetailView.doCrop(selectedImagePath);\n }", "protected void isotrop()\r\n {\r\n Dimension d = getSize();\r\n int maxX = d.width - 1, maxY = d.height - 1;\r\n\tpSize = Math.max(width / maxX, height / maxY);\r\n\tcX = maxX / 2;\r\n\tcY = maxY / 2;\r\n\r\n\t// Since pixel size is max of width/height over their device sizes, one of these\r\n\t// values will actually be larger. This should be used to use all of the canvas\r\n\tactualWidth = maxX * pSize;\r\n\tactualHeight = maxY * pSize;\r\n }", "private BufferedImage getClipImage(final Rectangle effectBounds) {\n if (_clipImage == null\n || _clipImage.getWidth() < effectBounds.width\n || _clipImage.getHeight() < effectBounds.height) {\n /* */\n int w = effectBounds.width;\n int h = effectBounds.height;\n if (_clipImage != null) {\n w = Math.max(_clipImage.getWidth(), w);\n h = Math.max(_clipImage.getHeight(), h);\n }\n _clipImage = new BufferedImage(w, h, BufferedImage.TYPE_INT_ARGB);\n }\n return _clipImage;\n }", "private void manageCrops() {\r\n// System.out.println(\"\\nThis is manage the crops option\");\r\n CropView.runCropsView();\r\n }", "private Bitmap setPic() {\n int targetH = 0; //mImageView.getHeight();\n int targetW = 0; //mImageView.getWidth();\n\n\n\t\t/* Get the size of the image */\n BitmapFactory.Options bmOptions = new BitmapFactory.Options();\n bmOptions.inJustDecodeBounds = true;\n BitmapFactory.decodeFile(mCurrentPhotoPath, bmOptions);\n int photoW = bmOptions.outWidth;\n int photoH = bmOptions.outHeight;\n if( photoH > photoW ){\n /*Se definen las dimensiones de la imagen que se desea generar*/\n targetH = Const.MedidasReduccionImagen.PEQUENA_PORTRAIT.heigh; // 640;\n targetW = Const.MedidasReduccionImagen.PEQUENA_PORTRAIT.width; //480;\n }else{\n targetH = Const.MedidasReduccionImagen.PEQUENA_LANDSCAPE.heigh; //480;\n targetW = Const.MedidasReduccionImagen.PEQUENA_LANDSCAPE.width; //640;\n }\n\n\t\t/* Figure out which way needs to be reduced less */\n int scaleFactor = 0;\n if ((targetW > 0) || (targetH > 0)) {\n scaleFactor = Math.min(photoW/targetW, photoH/targetH);\n }\n\n\t\t/* Set bitmap options to scale the image decode target */\n bmOptions.inJustDecodeBounds = false;\n bmOptions.inSampleSize = scaleFactor;\n bmOptions.inPurgeable = true;\n\n\t\t/* Decode the JPEG file into a Bitmap */\n Bitmap bitmap = BitmapFactory.decodeFile(mCurrentPhotoPath, bmOptions);\n\n return bitmap;\n }", "public File cropIntentDataUri(Uri imageUri, double yxRatio){\n File file = getFileFromItentUri(imageUri);\n if (!file.exists() || file.isDirectory()){\n Log.d(LOG_TAG,\"getFilesFromUris(activity, new Uri[]{imageUri}, false) is null or isDirectory , imageUri=\"+ imageUri.toString());\n return null;\n }\n return cropContentFile(file, yxRatio);\n }", "@Override\n public void onActivityResult(int requestCode, int resultCode, Intent data) {\n super.onActivityResult(requestCode, resultCode, data);\n if (resultCode == Activity.RESULT_OK) {\n Uri selectedImageUri = data.getData();\n ParcelFileDescriptor parcelFileDescriptor;\n try {\n parcelFileDescriptor = getActivity().getContentResolver().openFileDescriptor(selectedImageUri, \"r\");\n FileDescriptor fileDescriptor = parcelFileDescriptor.getFileDescriptor();\n Bitmap mealImage = BitmapFactory.decodeFileDescriptor(fileDescriptor);\n parcelFileDescriptor.close();\n\n\n Bitmap mealImageScaled = Bitmap.createScaledBitmap(mealImage,\n LTAPIConstants.IMAGE_WIDTH_SIZE, LTAPIConstants.IMAGE_WIDTH_SIZE\n * mealImage.getHeight() / mealImage.getWidth(), false);\n\n Matrix matrix = new Matrix();\n //matrix.postRotate(90);\n Bitmap rotatedScaledMealImage = Bitmap.createBitmap(mealImageScaled, 0,\n 0, mealImageScaled.getWidth(), mealImageScaled.getHeight(),\n matrix, true);\n\n ByteArrayOutputStream bos = new ByteArrayOutputStream();\n rotatedScaledMealImage.compress(Bitmap.CompressFormat.JPEG, 100, bos);\n\n byte[] scaledData = bos.toByteArray();\n photoFile = new ParseFile(\"tripcard_photo.jpg\", scaledData);\n addPhotoToMealAndReturn(photoFile);\n\n photoFile.saveInBackground(new SaveCallback() {\n\n public void done(ParseException e) {\n if (e != null) {\n Toast.makeText(getActivity(),\n \"Error saving: \" + e.getMessage(),\n Toast.LENGTH_LONG).show();\n } else {\n debugShowToast(\"Saved???? \");\n }\n }\n });\n\n } catch (FileNotFoundException e) {\n e.printStackTrace();\n } catch (IOException e) {\n // TODO Auto-generated catch block\n e.printStackTrace();\n }\n // Override Android default landscape orientation and save portrait\n }\n }", "@Override\n public void onActivityResult(int requestCode, int resultCode, Intent data) {\n super.onActivityResult(requestCode, resultCode, data);\n\n if (requestCode == 1 && resultCode == getActivity().RESULT_OK && data != null && data.getData() != null) {\n\n Uri uri = data.getData();\n\n try {\n ByteArrayOutputStream boas = new ByteArrayOutputStream();\n\n\n Bitmap btmap = MediaStore.Images.Media.getBitmap(getActivity().getContentResolver(), uri);\n\n btmap.compress(Bitmap.CompressFormat.JPEG, 70, boas); //bm is the bitmap object\n byte[] byteArrayImage = boas.toByteArray();\n\n\n BitmapFactory.Options opt;\n\n opt = new BitmapFactory.Options();\n opt.inTempStorage = new byte[16 * 1024];\n opt.inSampleSize = 2;\n Bitmap bitmap = BitmapFactory.decodeByteArray(byteArrayImage, 0, byteArrayImage.length, opt);\n\n ImageView imageView = (ImageView) getActivity().findViewById(R.id.profile_back);\n CircleImageView dp = (CircleImageView) getActivity().findViewById(R.id.dp1);\n dp.setImageBitmap(bitmap);\n Bitmap bitmap1=grayscale(bitmap);\n Bitmap blurred = blurRenderScript(bitmap1, 25);\n imageView.setImageBitmap(blurred);\n } catch (OutOfMemoryError a) {\n Toast.makeText(getActivity().getApplicationContext(), \"Image size high\", Toast.LENGTH_SHORT).show();\n } catch (IOException e) {\n e.printStackTrace();\n }\n }\n }", "@Override\n public void onClick(View v) {\n\n\n float x = ivImage.getScaleX();\n float y = ivImage.getScaleY();\n\n ivImage.setScaleX((float) (x - 1));\n ivImage.setScaleY((float) (y - 1));\n }", "public void ImageTransform(){\n imageView.clearAnimation();\n Picasso.get()\n .load(url)\n .resize(150, 150)\n .centerCrop()\n .into(imageView);\n }", "public void onInsuranceFragmentInteraction(Uri uri, int selectedImageView, Bitmap croppedBitmapImage, String base64Path);", "@Override\n public void onClick(View v) {\n Bitmap zoomedBitmap= Bitmap.createScaledBitmap(bmp, photoView.getWidth(), photoView.getHeight(), true);\n SaveImage(zoomedBitmap);\n }", "@Override\r\n\tprotected void onActivityResult(int requestCode, int resultCode, Intent data) {\n\t\tsuper.onActivityResult(requestCode, resultCode, data);\r\n\t\tif (requestCode == CAMERA_REQUEST_CODE) {\r\n\t\t\tif (data == null) {\r\n\t\t\t\treturn;\r\n\t\t\t} else {\r\n\t\t\t\tBundle extras = data.getExtras();\r\n\t\t\t\tif (extras != null) {\r\n\t\t\t\t\tBitmap bm = extras.getParcelable(\"data\");\r\n\t\t\t\t\tUri uri = saveBitmap(bm);\r\n\t\t\t\t\tstartImageZoom(uri);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t} else if (requestCode == GALLERY_REQUEST_CODE) {\r\n\t\t\tif (data == null) {\r\n\t\t\t\treturn;\r\n\t\t\t}\r\n\t\t\tUri uri;\r\n\t\t\turi = data.getData();\r\n\t\t\tUri fileUri = convertUri(uri);\r\n\t\t\tstartImageZoom(fileUri);\r\n\t\t} else if (requestCode == CROP_REQUEST_CODE) {\r\n\t\t\tif (data == null) {\r\n\t\t\t\treturn;\r\n\t\t\t}\r\n\t\t\tBundle extras = data.getExtras();\r\n\t\t\tif (extras == null) {\r\n\t\t\t\treturn;\r\n\t\t\t}\r\n\t\t\tbm = extras.getParcelable(\"data\");\r\n\t\t\tiv_user_img.setImageBitmap(bm);\r\n\t\t\t// sendImage(bm);\r\n\t\t}\r\n\t}", "public void onActivityResult(int requestCode, int resultCode, Intent data) {\n if (resultCode != Activity.RESULT_OK) {\n return;\n }\n switch (requestCode) {\n case REQUEST_CODE_INITIAL_PIC_FROM_CAMERA:\n cropPicture();\n break;\n case REQUEST_CODE_INITIAL_PIC_FROM_GALLERY:\n try {\n //upload(sdcardTempFile.getAbsolutePath());\n } catch (Exception e) {\n e.printStackTrace();\n }\n break;\n case REQUEST_CODE_INITIAL_PIC_FROM_CROP:\n try {\n //upload(sdcardTempFile.getAbsolutePath());\n } catch (Exception e) {\n e.printStackTrace();\n }\n break;\n }\n }", "static Bitmap resamplePic(Context context, String imagePath) {\n\n // Get device screen size information\n DisplayMetrics metrics = new DisplayMetrics();\n WindowManager manager = (WindowManager) context.getSystemService(Context.WINDOW_SERVICE);\n manager.getDefaultDisplay().getMetrics(metrics);\n\n int targetH = metrics.heightPixels;\n int targetW = metrics.widthPixels;\n\n // Get the dimensions of the original bitmap\n BitmapFactory.Options bmOptions = new BitmapFactory.Options();\n bmOptions.inJustDecodeBounds = true;\n BitmapFactory.decodeFile(imagePath, bmOptions);\n int photoW = bmOptions.outWidth;\n int photoH = bmOptions.outHeight;\n\n // Determine how much to scale down the image\n int scaleFactor = Math.min(photoW / targetW, photoH / targetH);\n\n // Decode the image file into a Bitmap sized to fill the View\n bmOptions.inJustDecodeBounds = false;\n bmOptions.inSampleSize = scaleFactor;\n\n return BitmapFactory.decodeFile(imagePath);\n }" ]
[ "0.7780176", "0.7632091", "0.7576491", "0.7544942", "0.75050634", "0.7355444", "0.7337931", "0.7021234", "0.6987905", "0.69642735", "0.69508004", "0.6867857", "0.6791765", "0.676063", "0.6717462", "0.6677303", "0.66694707", "0.65518475", "0.6547775", "0.653007", "0.65061504", "0.6495365", "0.64120686", "0.63834393", "0.6361748", "0.6350611", "0.6334516", "0.6306732", "0.6244898", "0.6235162", "0.61885273", "0.61822903", "0.61778957", "0.61149615", "0.61038333", "0.6101042", "0.607431", "0.60702664", "0.60598385", "0.6020836", "0.6018083", "0.60116327", "0.599819", "0.59838074", "0.5967183", "0.59330463", "0.59243804", "0.5887029", "0.5864934", "0.58591086", "0.5759361", "0.57545924", "0.5753734", "0.5710081", "0.5707722", "0.56965494", "0.56878674", "0.5684309", "0.56778425", "0.56717503", "0.5641937", "0.5639518", "0.5633696", "0.5615884", "0.5605047", "0.5600616", "0.5589554", "0.5585519", "0.5579871", "0.5578327", "0.555566", "0.55412084", "0.55313665", "0.5524324", "0.5515578", "0.55077034", "0.5502323", "0.54975885", "0.5488788", "0.5487108", "0.5484387", "0.54719335", "0.5438388", "0.54333323", "0.5430213", "0.54110366", "0.540214", "0.53875434", "0.53799903", "0.5364414", "0.53429776", "0.5342578", "0.5314744", "0.5308414", "0.5305988", "0.530259", "0.52970344", "0.5291535", "0.5290246", "0.528393" ]
0.7614904
2
/All the variables their getter setters that you wish to store in session. And implementation of all the methods of UserDetails go here.
@Override public Collection<? extends GrantedAuthority> getAuthorities() { // TODO Auto-generated method stub return null; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "UserDetails getDetails();", "public UserDetails getUserDetails() {\r\n\t\treturn userDetails;\r\n\t}", "public void setUserDetails(UserDetails userDetails) {\r\n\t\tthis.userDetails = userDetails;\r\n\t}", "public abstract void saveUserDetails(User user) throws InlogException;", "public interface User extends UserDetails {\n\n\tpublic String getUsername();\n\n\tpublic void setUsername(String email);\n\n\tpublic String getPassword();\n\n\tpublic void setPassword(String password);\n\n\tpublic String getCpf();\n\n\tpublic void setCpf(String cpf);\n\n\tpublic Profile getProfile();\n\n\tpublic void setProfile(Profile profile);\n\n\tpublic boolean isNeedChangePassword();\n\n\tpublic void setNeedChangePassword(boolean status);\n\n\tpublic void setLocked(boolean locked);\n\n\tpublic void setEnabled(boolean enabled);\n\n}", "public void store() {\n session=(HttpSession)getPageContext().getSession();\n session.setAttribute(\"remoteUser\", getRemoteUser());\n session.setAttribute(\"authCode\", getAuthCode());\n }", "UserDetails getCurrentUser();", "User getUserDetails(int userId);", "private void setSessionAttribs(HttpServletRequest req, BlogUser user) {\n\t\treq.getSession().setAttribute(\"current.user.id\", user.getId());\n\t\treq.getSession().setAttribute(\"current.user.fn\", user.getFirstName());\n\t\treq.getSession().setAttribute(\"current.user.ln\", user.getLastName());\n\t\treq.getSession().setAttribute(\"current.user.nick\", user.getNick());\n\t}", "void save(UserDetails userDetails);", "public User loadUserDetails(String id)throws Exception;", "public void populateUserDetails() {\n\n this.enterprise = system.getOpRegionDirectory().getOperationalRegionList()\n .stream().filter(op -> op.getRegionId() == user.getNetworkId())\n .findFirst()\n .get()\n .getBuDir()\n .getBusinessUnitList()\n .stream()\n .filter(bu -> bu.getUnitType() == BusinessUnitType.CHEMICAL)\n .map(unit -> (ChemicalManufacturingBusiness) unit)\n .filter(chemBusiness -> chemBusiness.getEnterpriseId() == user.getEnterpriseId())\n .findFirst()\n .get();\n\n this.organization = (ChemicalManufacturer) enterprise\n .getOrganizationList().stream()\n .filter(o -> o.getOrgId() == user.getOrganizationId())\n .findFirst()\n .get();\n\n }", "private EndUser getCurrentLoggedUserDetails() {\n\n\t\tEndUser endUser = endUserDAOImpl.findByUsername(getCurrentLoggedUserName()).getSingleResult();\n\n\t\treturn endUser;\n\n\t}", "protected User getUser(HttpSession session) {\r\n\t\t// get the user form from the session\r\n\t\treturn (User) session.getAttribute(Constants.USER_KEY);\r\n\t}", "public UserSession(User user) {\n\n }", "public static KmUserMstr getUserDetails(HttpServletRequest request)\r\n\t{\r\n\t\tKmUserMstr userBean = new KmUserMstr();\r\n\t\tif(request.getSession().getAttribute(\"USER_INFO\")!=null)\r\n\t\t{\r\n\t\t\tuserBean = (KmUserMstr)request.getSession().getAttribute(\"USER_INFO\");\r\n\t\t}\r\n\t\treturn userBean;\r\n\t}", "@Override\n protected UserDetails getDetails(User user, boolean viewOwnProfile, PasswordPolicy passwordPolicy, Locale requestLocale, boolean preview) {\n return userService.getUserDetails(user);\n }", "public User getUserDetails(String username);", "@SuppressWarnings(\"unchecked\")\r\n\tprotected void saveUserProfile2Session(User vapUser) {\r\n\t\tif (vapUser != null) {\r\n\t\t\t// set last login date if user is same\r\n\t\t\tif (userProfile.get(AuthenticationConsts.KEY_LAST_LOGIN_DATE) == null) {\r\n\t\t\t\tDate lastLoginDate = (Date)vapUser.getProperty(AuthenticationConsts.PROPERTY_LAST_LOGIN_DATE_ID);\r\n\t\t\t\tuserProfile.put(AuthenticationConsts.KEY_LAST_LOGIN_DATE,\r\n\t\t\t\t\t\t\t\tlastLoginDate);\r\n\t\t\t}\r\n\r\n\t\t\t// set user groups\r\n\t\t\tuserProfile.put(AuthenticationConsts.KEY_USER_GROUPS,\r\n\t\t\t\t\t\t\tCollections.list(Collections.enumeration(AuthenticatorHelper.getUserGroupTitleSet(AuthenticatorHelper.getUserGroupSet(vapUser)))));\r\n\t\t}\r\n\t\tif (LOG.willLogAtLevel(LogConfiguration.DEBUG)) {\r\n\t\t\tLOG.debug(\"Saving user profile map in session: %s\" + userProfile);\r\n\t\t}\r\n\t\trequest.getSession()\r\n\t\t\t .setAttribute(AuthenticationConsts.USER_PROFILE_KEY, userProfile);\r\n\t}", "public void updateUserDetails() {\n\t\tSystem.out.println(\"Calling updateUserDetails() Method To Update User Record\");\n\t\tuserDAO.updateUser(user);\n\t}", "public static void setUserDetails(UserSetup userSetup) {\n\n }", "@Override\n\tpublic UserDetailsBean login(UserDetailsBean userDetailsBean) {\n\t\treturn userDao.login(userDetailsBean);\n\t}", "@Override\n @Bean\n protected UserDetailsService userDetailsService() {\n\n\n UserDetails user = User.builder()\n .username(\"cs\")\n .password( passwordEncoder.encode(\"cs\"))\n .roles(STUDENT.name())\n .build();\n\n UserDetails admin = User.builder()\n .username(\"admin\")\n .password( passwordEncoder.encode(\"admin\"))\n .roles( ADMIN.name())\n .build();\n\n return new InMemoryUserDetailsManager(user,admin);\n }", "private String getUserData() { \n\t\t \n\t\tString userName;\n\t\tObject principial = SecurityContextHolder.getContext().getAuthentication().getPrincipal();\t\n\t\tif(principial instanceof UserDetails) {\n\t\t\tuserName = ((UserDetails) principial).getUsername();\n\t\t} else {\n\t\t\tuserName = principial.toString(); \n\t\t}\n\t\treturn userName; \n\t}", "public ViewObjectImpl getUserDetailsVO() {\n return (ViewObjectImpl)findViewObject(\"UserDetailsVO\");\n }", "@ModelAttribute(\"requestCurrentUser\")\n\tpublic EndUser getUserDetails(ModelMap model) {\n\t\tEndUser user = getCurrentLoggedUserDetails();\n\t\tif (user.getImageName() != null) {\n\t\t\tString type = ImageService.getImageType(user.getImageName());\n\n\t\t\tString url = \"data:image/\" + type + \";base64,\" + Base64.encodeBase64String(user.getImage());\n\t\t\tuser.setImageName(url);\n\t\t}\n\n\t\tmodel.put(\"user\", user);\n\t\treturn user;\n\t}", "public final EnhancedUserDetailsService getUserDetailsService() {\n return userDetailsService;\n }", "public interface UserService extends UserDetailsService {\n\n\n\n}", "private void updateUserDetails() {\n \tUser user=CurrentSession.getCurrentUser();\n \tjLabel1.setText(\"Name:\");\n jLabel2.setText(user.getFirstName()+\" \"+user.getLastName());\n jLabel3.setText(\"Card Number:\");\n jLabel4.setText(user.getCardNumber());\n jLabel5.setText(\"Daily Calorie Intake\");\n FoodPreference fp=new FoodPreference(user.getCardNumber());\n jLabel6.setText(\"\"+fp.getUserCalories());\n jLabel7.setText(\"Monthly Expenses\");\n jLabel8.setText(\"\"+user.getExpenses());\n\n\t\t\n\t}", "protected void mapUserProfile2SSOUser() {\r\n\t\tssoUser.setProfileId((String)userProfile.get(AuthenticationConsts.KEY_PROFILE_ID));\r\n\t\tssoUser.setUserName((String)userProfile.get(AuthenticationConsts.KEY_USER_NAME));\r\n\t\tssoUser.setEmail((String)userProfile.get(AuthenticationConsts.KEY_EMAIL));\r\n\t\tssoUser.setFirstName((String)userProfile.get(AuthenticationConsts.KEY_FIRST_NAME));\r\n\t\tssoUser.setLastName((String)userProfile.get(AuthenticationConsts.KEY_LAST_NAME));\r\n\t\tssoUser.setCountry((String)userProfile.get(AuthenticationConsts.KEY_COUNTRY));\r\n\t\tssoUser.setLanguage((String)userProfile.get(AuthenticationConsts.KEY_LANGUAGE));\r\n\t\tssoUser.setTimeZone((String)userProfile.get(AuthenticationConsts.KEY_TIMEZONE));\r\n\t\tssoUser.setLastChangeDate((Date)userProfile.get(AuthenticationConsts.KEY_LAST_CHANGE_DATE));\r\n\t\tssoUser.setLastLoginDate((Date)userProfile.get(AuthenticationConsts.KEY_LAST_LOGIN_DATE));\r\n\t\t// Set current site, it will be used to update user's primary site\r\n\t\tssoUser.setCurrentSite(AuthenticatorHelper.getPrimarySiteUID(request));\r\n\t}", "public void setUserProfile(UserProfile userProfile) {this.userProfile = userProfile;}", "public interface CustomUserDetailsService extends UserDetailsService {\n}", "public void setLoggedUser(CustomEmployee user) {\n loggedUser = user;\n }", "private void updateUserDetailsFromView() {\n\t\tcurrentDetails.setFirstName(detailDisplay.getFirstName().getValue());\n\t\tcurrentDetails.setLastName(detailDisplay.getLastName().getValue());\n\t\tcurrentDetails.setMiddleInitial(detailDisplay.getMiddleInitial().getValue());\n\t\tcurrentDetails.setTitle(detailDisplay.getTitle().getValue());\n\t\tcurrentDetails.setEmailAddress(detailDisplay.getEmailAddress().getValue());\n\t\tcurrentDetails.setPhoneNumber(detailDisplay.getPhoneNumber().getValue());\n\t\tcurrentDetails.setActive(detailDisplay.getIsActive().getValue());\n\t\t//currentDetails.setRootOid(detailDisplay.getRootOid().getValue());\n\t\tcurrentDetails.setRole(detailDisplay.getRole().getValue());\n\t\t\n\t\tcurrentDetails.setOid(detailDisplay.getOid().getValue());\n\t\tString orgId = detailDisplay.getOrganizationListBox().getValue();\n\t\tcurrentDetails.setOrganizationId(orgId);\n\t\tResult organization = detailDisplay.getOrganizationsMap().get(orgId);\n\t\tif (organization != null) {\n\t\t\tcurrentDetails.setOrganization(organization.getOrgName());\n\t\t} else {\n\t\t\tcurrentDetails.setOrganization(\"\");\n\t\t}\n\t}", "public UserTokenDetail(UserDetails userDetails) {\n super(new ArrayList<>());\n this.login = userDetails.getUsername();\n setAuthenticated(true);\n setDetails(userDetails);\n }", "protected UserDetails getUserDetails(String userName)\n {\n GrantedAuthority[] gas = new GrantedAuthority[1];\n gas[0] = new GrantedAuthorityImpl(\"ROLE_AUTHENTICATED\");\n UserDetails ud = new User(userName, \"\", true, true, true, true, gas);\n return ud;\n }", "@Override\n\t@Bean\n\tprotected UserDetailsService userDetailsService() \n\t{\n\t\tBCryptPasswordEncoder passwordEncoder = new BCryptPasswordEncoder(10);\n\t\tUserDetails admin = User.builder()\n\t\t\t\t.username(\"admin\")\n\t\t\t\t.password(passwordEncoder.encode(\"123456Ea\"))\n\t\t\t\t.roles(\"ADMIN\")\n\t\t\t\t.build();\n\t\t\n\t\tUserDetails user = User.builder()\n\t\t\t\t.username(\"user\")\n\t\t\t\t.password(passwordEncoder.encode(\"123456Ea\"))\n\t\t\t\t.roles(\"USER\")\n\t\t\t\t.build();\n\t\t\n\t\treturn new InMemoryUserDetailsManager(admin,user);\n\t\n\t\t\n\t}", "public UserDetails withDefaults() {\n return this;\n }", "public HashMap<String, String> getUserDetails() {\n HashMap<String, String> user = new HashMap<String, String>();\n\n user.put(KEY_USER_ID, pref.getString(KEY_USER_ID, null));\n user.put(KEY_AUTH_TOKEN, pref.getString(KEY_AUTH_TOKEN, null));\n user.put(KEY_USER_NAME, pref.getString(KEY_USER_NAME, \"\"));\n user.put(KEY_USER_EMAIL, pref.getString(KEY_USER_EMAIL, null));\n user.put(KEY_USER_MOBILE, pref.getString(KEY_USER_MOBILE, null));\n user.put(KEY_USER_ADDRESS, pref.getString(KEY_USER_ADDRESS, null));\n user.put(KEY_USER_IMAGE, pref.getString(KEY_USER_IMAGE, null));\n user.put(KEY_USER_STRIPE_ID, pref.getString(KEY_USER_STRIPE_ID, null));\n user.put(KEY_REFFERAL_CODE, pref.getString(KEY_REFFERAL_CODE, \"\"));\n user.put(KEY_REFFERAL_LINK, pref.getString(KEY_REFFERAL_LINK, \"\"));\n user.put(KEY_USER_PASSWORD, pref.getString(KEY_USER_PASSWORD, \"\"));\n // return user\n return user;\n }", "@Override\r\n\tpublic ResponseEntity<User> addEmployee(User user, String authToken) throws ManualException {\r\n\t\t\r\n\t\tfinal Session session=sessionFactory.openSession();\r\n\t\tResponseEntity<User> responseEntity = new ResponseEntity<User>(HttpStatus.BAD_REQUEST);\r\n\t\t\r\n\t\ttry{\r\n\t\t\tString characters = \"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789@_$!#\";\r\n\t\t\tString password = RandomStringUtils.random( 15, characters );\r\n\t\t\t\r\n\t\t\tuser.getUserCredential().setPassword(Encrypt.encrypt(password));\r\n\t\t\t\r\n\t\t\t/* check for authToken of admin */\r\n\t\t\tsession.beginTransaction();\r\n\t\t\tAuthTable authtable=session.get(AuthTable.class, authToken);\r\n\t\t\tUser adminUser=session.get(User.class, authtable.getUser().getEmpId());\r\n\t\r\n\t\t\t/* Adding skills to user object */\r\n\t\t\tList<Skill> skills = new ArrayList<Skill>();\r\n\t\t\tfor(Skill s:user.getSkills()){\r\n\t\t\t\tString h=\"from skill where skillName='\"+s.getSkillName()+\"'\";\r\n\t\t\t\tQuery q=session.createQuery(h);\r\n\t\t\t\tif(!q.list().isEmpty())\r\n\t\t\t\t\tskills.addAll(q.list());\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\t/* Adding department to user object */\r\n\t\t\tif(user.getDepartment()!=null){\r\n\t\t\t\tString h=\"from department where departmentName='\"+user.getDepartment().getDepartmentName()+\"'\";\r\n\t\t\t\tQuery q=session.createQuery(h);\r\n\t\t\t\tif(!q.list().isEmpty())\r\n\t\t\t\t\tuser.setDepartment(((Department)q.list().get(0)));\r\n\t\t\t\telse\r\n\t\t\t\t\tuser.setDepartment(null);\r\n\t\t\t}\r\n\t\r\n\t\t\t\r\n\t\t\t/* Adding project to user object */\r\n\t\t\tif(user.getProject()!=null){\r\n\t\t\t\tString h=\"from project where projectName='\"+user.getProject().getProjectName()+\"'\";\r\n\t\t\t\tQuery q=session.createQuery(h);\r\n\t\t\t\tif(!q.list().isEmpty())\r\n\t\t\t\t\tuser.setProject(((Project)q.list().get(0)));\r\n\t\t\t\telse\r\n\t\t\t\t\tuser.setProject(null);\r\n\t\t\t}\r\n\t\t\r\n\t\t\tuser.setSkills(skills);\r\n\t\r\n\t\t\tif(adminUser.getUsertype().equals(\"Admin\")){\r\n\t\t\t\tif(user==null||user.getUserCredential()==null){\r\n\t\t\t\t\tresponseEntity= new ResponseEntity<User>(HttpStatus.BAD_REQUEST);\r\n\t\t\t\t}\r\n\t\t\t\telse{\r\n\t\t\t\t\t/* Stores user and UserCredential in database */\r\n\t\t\t\t\tsession.persist(user);\r\n\t\t\t\t\t\r\n\t\t\t\t\tString msg=env.getProperty(\"email.welcome.message\")+\"\\n\\nUsername: \"+user.getUserCredential().getUsername()+\"\\n\\nPassword: \"+password;\r\n\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t/* sends Welcome Email */\r\n\t\t\t\t\temail.sendEmail(user.getEmail(), \"Welcome\" , msg);\r\n\t\t\t\t\tresponseEntity= new ResponseEntity<User>(HttpStatus.OK);\r\n\t\t\t\t\t\r\n\t\t\t\t\t/* entry in operation table */\r\n\t\t\t\t\tOperationImpl operationImpl= new OperationImpl();\r\n\t\t\t\t\toperationImpl.addOperation(session, adminUser, \"Added Employee \"+user.getName());\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\telse{\r\n\t\t\t\tresponseEntity= new ResponseEntity<User>(HttpStatus.UNAUTHORIZED);\r\n\t\t\t}\r\n\t\t}\r\n\t\tcatch(Exception e){\r\n\t\t\tresponseEntity= new ResponseEntity<User>(HttpStatus.BAD_REQUEST);\r\n\t\t}\r\n\t\tfinally{\r\n\t\t\tsession.getTransaction().commit();\r\n\t\t\tsession.close();\r\n\t\t\treturn responseEntity;\r\n\t\t}\r\n\t}", "private void updateUserLogin() {\n\t\tSessionManager sessionManager = new SessionManager(\n\t\t\t\tMyApps.getAppContext());\n\n\t\tRequestParams params = new RequestParams();\n\t\tparams.add(\"user_id\", sessionManager.getUserDetail().getUserID());\n\n\t\tLog.d(\"EL\", \"userID: \" + sessionManager.getUserDetail().getUserID());\n\n\t\tKraveRestClient.post(WebServiceConstants.AV_UPDATE_USER_PROFILE_DATA_1,\n\t\t\t\tparams, new JsonHttpResponseHandler() {\n\t\t\t\t\t@Override\n\t\t\t\t\tpublic void onSuccess(int statusCode, Header[] headers,\n\t\t\t\t\t\t\tJSONObject response) {\n\n\t\t\t\t\t\tsuper.onSuccess(statusCode, headers, response);\n\n\t\t\t\t\t\ttry {\n\t\t\t\t\t\t\tLog.d(\"EL\", \"response: \" + response.toString(2));\n\t\t\t\t\t\t} catch (JSONException e) {\n\t\t\t\t\t\t\te.printStackTrace();\n\t\t\t\t\t\t}\n\n\t\t\t\t\t}\n\n\t\t\t\t\t@Override\n\t\t\t\t\tpublic void onFailure(int statusCode, Header[] headers,\n\t\t\t\t\t\t\tThrowable throwable, JSONObject errorResponse) {\n\n\t\t\t\t\t\tsuper.onFailure(statusCode, headers, throwable,\n\t\t\t\t\t\t\t\terrorResponse);\n\t\t\t\t\t}\n\t\t\t\t});\n\t}", "public interface UserService extends UserDetailsService {\n User findUserByLogin(String login);\n\n User findUserById(Long id);\n\n void registerUser(User newUser);\n}", "@Override\n\tpublic UtenteBase getSessionUser() {\n\t\tUtenteBase user = (UtenteBase) getThreadLocalRequest().getSession().getAttribute(\"user\");\n\t\treturn user;\n\t}", "@Autowired\n public final void setUserDetailsService(\n final EnhancedUserDetailsService userDetailsService) {\n this.userDetailsService = userDetailsService;\n }", "public User getSession(){\n\t\treturn this.session;\n\t}", "public void setSession(Session session) { this.session = session; }", "@RequestMapping(value = \"get_user_info.do\",method = RequestMethod.POST)\r\n @ResponseBody\r\n public ServerResponse<User> getInfo(HttpSession session){\r\n User currentUser = (User)session.getAttribute(Constant.CURRENT_USER);\r\n if(currentUser == null){\r\n return ServerResponse.createByErrorCodeAndMsg(ResponseCode.NEED_LOGIN.getCode(),\"User has not logged in.\");\r\n }\r\n return iUserService.getUserInfoById(currentUser.getId());\r\n }", "public void setSession(Session session) {\n\tthis.session = session; \r\n}", "public HashMap<String, String> getUserDetails() {\n HashMap<String, String> user = new HashMap<String, String>();\n // user name\n\n user.put(KEY_ID, pref.getString(KEY_ID, null));\n user.put(KEY_EMAIL, pref.getString(KEY_EMAIL, null));\n user.put(KEY_NAME, pref.getString(KEY_NAME, null));\n return user;\n }", "@Override\n public void setId(UserDetailsPk id) {\n this.id = id;\n }", "String registerUserWithGetCurrentSession(User user);", "public interface IUserDetailsService extends UserDetailsService {\n}", "public interface UserService{\n//public interface UserService extends UserDetailsService {\n\n public User getUserByName(String userName);\n\n public int saveUser(String username, String password, String role);\n}", "@RequestMapping(value = \"/session\", method = RequestMethod.POST)\n public String session(@Valid @ModelAttribute(\"loginDto\") LoginDto loginDto,\n BindingResult bindingResult, Map<String, Object> model, HttpSession session, HttpServletRequest request)\n {\n if (UserEntity.getPrincipal(session) != null)\n {\n UserEntity userEntity = (UserEntity) UserEntity.getPrincipal(session);\n message.info(\"\\n\\n Name: \"+userEntity.getName()+\"\\n\\n\");\n message.info(\"\\n\\n Id: \"+userEntity.getId()+\"\\n\\n\");\n\n return \"redirect:/app/daily/list\";\n }\n\n if (bindingResult.hasErrors())\n {\n model.put(\"loginDto\", loginDto);\n return \"login/session\";\n }\n\n Principal principal ;\n try\n {\n principal = this.userAndProfileServiceDao.login(loginDto);\n }catch (ConstraintViolationException e )\n {\n loginDto.setPassword(\"\");\n model.put(\"loginDto\", loginDto);\n model.put(\"loginFail\", true);\n return \"login/session\";\n }\n if(principal == null)\n {\n loginDto.setPassword(\"\");\n model.put(\"loginFail\", true);\n return \"login/session\";\n }\n UserEntity.setPrincipal(session, principal);\n request.changeSessionId();\n return \"redirect:/app/daily/list\";\n\n\n }", "public interface UserService extends UserDetailsService{\n\n\t/**\n\t * save method is used save record in user table\n\t * \n\t * @param userEntity.\n\t * @return UserEntity\n\t */\n public UserEntity save(UserEntity userEntity); \n\t\n /**\n * getByName method is used to retrieve userId from userName. \n * \n * @param userName\n * @return UUID\n */\n public UserQueryEntity getByName(String userName);\n \n}", "@Override\r\n\tpublic User_Detail getUserDetail(int userId) {\n\t\treturn sessionFactory.getCurrentSession().get(User_Detail.class, Integer.valueOf(userId));\r\n\t}", "public CustomEmployee getLoggedUser() {\n return loggedUser;\n }", "public UserDetails getUserDetailsInterviewer() {\r\n\r\n\t\tUserDetails interviewer = new UserDetails();\r\n\t\tinterviewer.setUserDetailsId(INTERVIEWER_ID);\r\n\t\tinterviewer.setDepartment(INTERVIEWER_DEPARTMENT);\r\n\t\tinterviewer.setDesignation(INTERVIWER_DESIGNATION);\r\n\t\tinterviewer.setDateOfBirth(DOB);\r\n\t\tinterviewer.setExperience(EXPERIENCE);\r\n\t\tinterviewer.setContactNumber(MOBILE_NUMBER);\r\n\t\tinterviewer.setActiveFlag(FLAG);\r\n\t\tinterviewer.setAvailableDate(AVAILABLE_DATE);\r\n\t\tinterviewer.setAvailableTimeFrom(AVAILABLE_TIME_FROM);\r\n\t\tinterviewer.setAvailableTimeTo(AVAILABLE_TIME_TO);\r\n\t\tinterviewer.setUser(getInterviewerUser());\r\n\t\treturn interviewer;\r\n\r\n\t}", "public void setUser(User user) { this.user = user; }", "@Override\n public void configure(AuthenticationManagerBuilder auth)\n throws Exception {\n auth.userDetailsService(userDetailServiceDao);\n\n }", "UserDetails get(String id);", "@Override\n public boolean equals(Object other) {\n return this == other || (other instanceof UserDetails && hashCode() == other.hashCode());\n }", "public interface User\n extends HttpSessionBindingListener, TurbineUserDelegate, TurbineUser\n{\n /** The 'perm storage' key name for the create_date field. */\n String CREATE_DATE = \"CREATE_DATE\";\n\n /** The 'perm storage' key name for the last_login field. */\n String LAST_LOGIN = \"LAST_LOGIN\";\n\n /** The 'perm storage' key for the confirm_value field. */\n String CONFIRM_VALUE = \"CONFIRM_VALUE\";\n\n /** This is the value that is stored in the database for confirmed users */\n String CONFIRM_DATA = \"CONFIRMED\";\n\n /** The 'perm storage' key name for the access counter. */\n String ACCESS_COUNTER = \"_access_counter\";\n\n /** The 'temp storage' key name for the session access counter */\n String SESSION_ACCESS_COUNTER = \"_session_access_counter\";\n\n /** The 'temp storage' key name for the 'has logged in' flag */\n String HAS_LOGGED_IN = \"_has_logged_in\";\n\n /** The session key for the User object. */\n String SESSION_KEY = \"turbine.user\";\n\n /**\n * Gets the access counter for a user from perm storage.\n *\n * @return The access counter for the user.\n */\n int getAccessCounter();\n\n /**\n * Gets the access counter for a user during a session.\n *\n * @return The access counter for the user for the session.\n */\n int getAccessCounterForSession();\n\n /**\n * Gets the last access date for this User. This is the last time\n * that the user object was referenced.\n *\n * @return A Java Date with the last access date for the user.\n */\n Date getLastAccessDate();\n\n /**\n * Gets the create date for this User. This is the time at which\n * the user object was created.\n *\n * @return A Java Date with the date of creation for the user.\n */\n Date getCreateDate();\n\n /**\n * Returns the user's last login date.\n *\n * @return A Java Date with the last login date for the user.\n */\n Date getLastLogin();\n\n /**\n * Get an object from permanent storage.\n *\n * @param name The object's name.\n * @return An Object with the given name.\n */\n Object getPerm(String name);\n\n /**\n * Get an object from permanent storage; return default if value\n * is null.\n *\n * @param name The object's name.\n * @param def A default value to return.\n * @return An Object with the given name.\n */\n Object getPerm(String name, Object def);\n\n /**\n * This should only be used in the case where we want to save the\n * data to the database.\n *\n * @return A Map.\n */\n Map<String, Object> getPermStorage();\n\n /**\n * This should only be used in the case where we want to save the\n * data to the database.\n *\n * @return A Map.\n */\n Map<String, Object> getTempStorage();\n\n /**\n * Get an object from temporary storage.\n *\n * @param name The object's name.\n * @return An Object with the given name.\n */\n Object getTemp(String name);\n\n /**\n * Get an object from temporary storage; return default if value\n * is null.\n *\n * @param name The object's name.\n * @param def A default value to return.\n * @return An Object with the given name.\n */\n Object getTemp(String name, Object def);\n\n /**\n * This sets whether or not someone has logged in. hasLoggedIn()\n * returns this value.\n *\n * @param value Whether someone has logged in or not.\n */\n void setHasLoggedIn(Boolean value);\n\n /**\n * The user is considered logged in if they have not timed out.\n *\n * @return True if the user has logged in.\n */\n boolean hasLoggedIn();\n\n /**\n * Increments the permanent hit counter for the user.\n */\n void incrementAccessCounter();\n\n /**\n * Increments the session hit counter for the user.\n */\n void incrementAccessCounterForSession();\n\n /**\n * Remove an object from temporary storage and return the object.\n *\n * @param name The name of the object to remove.\n * @return An Object.\n */\n Object removeTemp(String name);\n\n /**\n * Sets the access counter for a user, saved in perm storage.\n *\n * @param cnt The new count.\n */\n void setAccessCounter(int cnt);\n\n /**\n * Sets the session access counter for a user, saved in temp\n * storage.\n *\n * @param cnt The new count.\n */\n void setAccessCounterForSession(int cnt);\n\n /**\n * Sets the last access date for this User. This is the last time\n * that the user object was referenced.\n */\n void setLastAccessDate();\n\n /**\n * Set last login date/time.\n *\n * @param lastLogin The last login date.\n */\n void setLastLogin(Date lastLogin);\n\n /**\n * Put an object into permanent storage.\n *\n * @param name The object's name.\n * @param value The object.\n */\n void setPerm(String name,\n Object value);\n\n /**\n * This should only be used in the case where we want to save the\n * data to the database.\n *\n * @param storage A Map.\n */\n void setPermStorage(Map<String, Object> storage);\n\n /**\n * This should only be used in the case where we want to save the\n * data to the database.\n *\n * @param storage A Map.\n */\n void setTempStorage(Map<String, Object> storage);\n\n /**\n * Put an object into temporary storage.\n *\n * @param name The object's name.\n * @param value The object.\n */\n void setTemp(String name, Object value);\n\n /**\n * Sets the creation date for this user.\n *\n * @param date Creation date\n */\n void setCreateDate(Date date);\n\n /**\n * This method reports whether or not the user has been confirmed\n * in the system by checking the TurbineUserPeer.CONFIRM_VALUE\n * column to see if it is equal to CONFIRM_DATA.\n *\n * @return True if the user has been confirmed.\n */\n boolean isConfirmed();\n\n /**\n * Sets the confirmation value.\n *\n * @param value The confirmation key value.\n */\n void setConfirmed(String value);\n\n /**\n * Gets the confirmation value.\n *\n * @return The confirmed value\n */\n String getConfirmed();\n\n /**\n * Updates the last login date in the database.\n *\n * @throws Exception A generic exception.\n */\n\n void updateLastLogin()\n throws Exception;\n}", "private void getValues() {\n session = new UserSession(getApplicationContext());\n\n //validating session\n session.isLoggedIn();\n\n //get User details if logged in\n HashMap<String, String> user = session.getUserDetails();\n\n shopname = user.get(UserSession.KEY_NAME);\n shopemail = user.get(UserSession.KEY_EMAIL);\n shopmobile = user.get(UserSession.KEY_MOBiLE);\n System.out.println(\"nameemailmobile \" + shopname + shopemail + shopmobile);\n }", "private static UserInfo getUserInfoStandardSession(int idUser)\n {\n User user = null;\n Squad squad = null;\n int countPost = 0;\n int invitationsAvailable = 0;\n try\n {\n user = DAOFactory.getInstance().getUserDAO().getFetched(idUser);\n if (user == null)\n {\n return new UserInfo();\n }\n //squad = DAOFactory.getInstance().getSquadDAO().getFirstByIdUser(idUser);\n squad = user.getFirstSquad();\n countPost = DAOFactory.getInstance().getMatchCommentDAO().countByIdUser(idUser);\n invitationsAvailable = user.getMaxInvitations() - DAOFactory.getInstance().getUserInvitationDAO().getCountUsed(idUser);\n if (invitationsAvailable < 0)\n {\n invitationsAvailable = 0;\n }\n }\n catch (Exception ex)\n {\n logger.error(\"Error retrieving user info: \" + ex.getMessage());\n }\n boolean squadMarketEnabled = false;\n if (squad != null)\n {\n squadMarketEnabled = squad.getMarketEnabled() && !squad.getHiddenEnabled();\n }\n else\n {\n logger.error(String.format(\"Error on data about iduser %s: User must have almost one squad!!\", idUser));\n }\n // Set values\n Language language = ActionContext.getContext() != null ? UserContext.getInstance().getLanguage() : LanguageManager.chooseUserLanguage(user);\n Cobrand currentCobrand = ActionContext.getContext() != null ? UserContext.getInstance().getCurrentCobrand() : getCobrandByCode(user.getCobrandCode());\n UserInfo userInfo = new UserInfo();\n userInfo.setId(user.getId());\n userInfo.setName(user.getFirstName());\n userInfo.setAnonymousEnabled(user.getAnonymousEnabled());\n\n if (userInfo.isAnonymousEnabled())\n {\n userInfo.setSurname(StringUtils.left(user.getLastName(), 1) + '.');\n }\n else\n {\n userInfo.setSurname(user.getLastName());\n }\n\n userInfo.setCompleteSurname(user.getLastName());\n\n userInfo.setEmail(user.getEmail());\n userInfo.setRecordedMatches(user.getRecordedMatches());\n userInfo.setRecordedChallenges(user.getRecordedChallenges());\n userInfo.setPlayedMatches(user.getPlayedMatches());\n userInfo.setPlayedChallenges(user.getPlayedChallenges());\n userInfo.setCity(user.getCity().getName());\n userInfo.setProvince(user.getProvince().getName());\n userInfo.setCountry(user.getCountry().getName());\n userInfo.setIdCountry(user.getCountry().getId());\n userInfo.setIdProvince(user.getProvince() != null ? user.getProvince().getId() : 0);\n userInfo.setIdCity(user.getCity() != null ? user.getCity().getId() : 0);\n if (user.getNationalityCountry() != null)\n {\n userInfo.setIdNatCountry(user.getNationalityCountry().getId());\n userInfo.setNatCountry(user.getNationalityCountry().getName());\n }\n userInfo.setCreated(user.getCreated());\n userInfo.setBirthdayCity((user.getBirthdayCity() != null) ? user.getBirthdayCity().getName() : EMPTY_FIELD);\n userInfo.setBirthdayProvince((user.getBirthdayProvince() != null) ? user.getBirthdayProvince().getName() : EMPTY_FIELD);\n userInfo.setBirthdayCountry((user.getBirthdayCountry() != null) ? user.getBirthdayCountry().getName() : EMPTY_FIELD);\n userInfo.setPlayerFoot((user.getPlayerFoot() == null) ? EMPTY_FIELD : TranslationProvider.getTranslation(user.getPlayerFoot().getKeyName(), language, currentCobrand).getKeyValue());\n userInfo.setPlayerFootKeyName((user.getPlayerFoot() == null) ? EMPTY_FIELD : user.getPlayerFoot().getKeyName());\n userInfo.setPlayerShirtNumber((user.getPlayerShirtNumber() != null) ? (String.valueOf(user.getPlayerShirtNumber())) : EMPTY_FIELD);\n userInfo.setPlayerRole(user.getPlayerRole() == null ? EMPTY_FIELD : TranslationProvider.getTranslation(user.getPlayerRole().getKeyName(), language, currentCobrand).getKeyValue());\n userInfo.setIdPlayerRole(user.getPlayerRole().getId());\n userInfo.setPlayerRoleKey(user.getPlayerRole().getKeyName());\n userInfo.setPlayerMainFeature(user.getPlayerMainFeature() == null ? EMPTY_FIELD : user.getPlayerMainFeature());\n userInfo.setPlayerShirtNumber((user.getPlayerShirtNumber() != null) ? (String.valueOf(user.getPlayerShirtNumber())) : EMPTY_FIELD);\n userInfo.setAge((user.getBirthDay() != null) ? Utils.getAgefromDate(user.getBirthDay()) : EMPTY_FIELD);\n userInfo.setPlayerHeight((user.getPlayerHeight() != null) ? String.valueOf(user.getPlayerHeight()) : EMPTY_FIELD);\n userInfo.setPlayerWeight((user.getPlayerWeight() != null) ? String.valueOf(user.getPlayerWeight()) : EMPTY_FIELD);\n userInfo.setFootballTeam((user.getFootballTeam() != null) ? user.getFootballTeam().getName() : EMPTY_FIELD);\n userInfo.setPhysicalConditionKey((user.getPhysicalCondition() != null) ? user.getPhysicalCondition().getKeyName() : \"label.condizioneFisica.nonPervenuta\");\n userInfo.setIdPhysicalCondition((user.getPhysicalCondition() != null) ? String.valueOf(user.getPhysicalCondition().getId()) : EMPTY_FIELD);\n userInfo.setInfoFavouritePlayer((user.getInfoFavouritePlayer() != null) ? user.getInfoFavouritePlayer() : EMPTY_FIELD);\n userInfo.setInfoDream((user.getInfoDream() != null) ? user.getInfoDream() : EMPTY_FIELD);\n userInfo.setInfoHobby((user.getInfoHobby() != null) ? user.getInfoHobby() : EMPTY_FIELD);\n userInfo.setInfoAnnounce((user.getInfoAnnounce() != null) ? user.getInfoAnnounce() : EMPTY_FIELD);\n userInfo.setInfoDream((user.getInfoDream() != null) ? user.getInfoDream() : EMPTY_FIELD);\n userInfo.setPlayerTitle((user.getPlayerTitle() != null) ? user.getPlayerTitle() : EMPTY_FIELD);\n //userInfo.setPlayedMatches(user.getRecordedMatches() + user.getRecordedChallenges());//SBAGLIATO TODO,sono le organizzate\n userInfo.setCountryFlagName(String.format(\"%1$s%2$s\", Constants.COUNTRY_FLAG_IMAGE_PREFIX, user.getCountry().getId()));\n userInfo.setBirthday(user.getBirthDay());\n userInfo.setMarketEnabled(user.getMarketEnabled());\n userInfo.setSquadMarketEnabled(squadMarketEnabled);\n userInfo.setStatus(user.getEnumUserStatus());\n userInfo.setAlertOnMatchRegistrationOpen(user.getAlertOnRegistrationStart());\n //userInfo.setPlayedMatches(StatisticManager.getPlayed(userInfo.getId()));//Att è una query in piu'\n\n userInfo.setPostCount(countPost);\n userInfo.setInvitationsAvailable(invitationsAvailable);\n\n //Facebook\n userInfo.setFacebookIdUser(user.getFacebookIdUser());\n userInfo.setFacebookAccessToken(user.getFacebookAccessToken());\n userInfo.setFacebookPostOnMatchCreation(user.isFacebookPostOnMatchCreation());\n userInfo.setFacebookPostOnMatchRecorded(user.isFacebookPostOnMatchRecorded());\n userInfo.setFacebookPostOnMatchRegistration(user.isFacebookPostOnMatchRegistration());\n\n try\n {\n PictureCard pictureCard = null;\n if (user.getEnumUserStatus().equals(EnumUserStatus.Pending))\n {\n pictureCard = DAOFactory.getInstance().getPictureCardDAO().getByStatus(idUser, EnumPictureCardStatus.Pending);\n if (pictureCard != null)\n {\n userInfo.loadPictureCard(pictureCard);\n }\n }\n else\n {\n for (PictureCard pic : user.getPictureCards())\n {\n if (pic.getEnumPictureCardStatus().equals(EnumPictureCardStatus.Current))\n {\n userInfo.loadPictureCard(pic);\n break;\n }\n }\n }\n }\n catch (Exception ex)\n {\n logger.error(\"Error retrieving current picture card in getUserInfo()\", ex);\n }\n return userInfo;\n\n }", "AuthenticationSessionModel getAuthenticationSession();", "private void saveUserDetails()\r\n\t{\r\n\t\t/*\r\n\t\t * Retrieve content from form\r\n\t\t */\r\n\t\tContentValues reg = new ContentValues();\r\n\r\n\t\treg.put(UserdataDBAdapter.C_NAME, txtName.getText().toString());\r\n\r\n\t\treg.put(UserdataDBAdapter.C_USER_EMAIL, txtUserEmail.getText()\r\n\t\t\t\t.toString());\r\n\r\n\t\treg.put(UserdataDBAdapter.C_RECIPIENT_EMAIL, lblAddressee.getText()\r\n\t\t\t\t.toString());\r\n\r\n\t\tif (rdbKilo.isChecked())\r\n\t\t{\r\n\t\t\treg.put(UserdataDBAdapter.C_USES_METRIC, 1);\t// , true\r\n\t\t}\r\n\t\telse\r\n\t\t\tif (rdbPound.isChecked())\r\n\t\t\t{\r\n\t\t\t\treg.put(UserdataDBAdapter.C_USES_METRIC, 0);\t// , false\r\n\t\t\t}\r\n\r\n\t\t/*\r\n\t\t * Save content into database source:\r\n\t\t * http://stackoverflow.com/questions/\r\n\t\t * 9212574/calling-activity-methods-from-fragment\r\n\t\t */\r\n\t\ttry\r\n\t\t{\r\n\t\t\tActivity parent = getActivity();\r\n\r\n\t\t\tif (parent instanceof LauncherActivity)\r\n\t\t\t{\r\n\t\t\t\tif (arguments == null)\r\n\t\t\t\t{\r\n\t\t\t\t\t((LauncherActivity) parent).getUserdataDBAdapter().insert(\r\n\t\t\t\t\t\t\treg);\r\n\t\t\t\t}\r\n\t\t\t\telse\r\n\t\t\t\t{\r\n\t\t\t\t\treg.put(UserdataDBAdapter.C_ID, arguments.getInt(\"userId\"));\r\n\r\n\t\t\t\t\t((LauncherActivity) parent).getUserdataDBAdapter().update(\r\n\t\t\t\t\t\t\treg);\r\n\r\n\t\t\t\t\t((LauncherActivity) parent).queryForUserDetails();\r\n\t\t\t\t}\r\n\t\t\t\tToast.makeText(parent, \"User details successfully stored\",\r\n\t\t\t\t\t\tToast.LENGTH_LONG).show();\r\n\t\t\t}\r\n\t\t}\r\n\t\tcatch (SQLException e)\r\n\t\t{\r\n\t\t\tLog.i(this.getClass().toString(), e.getMessage());\r\n\t\t}\r\n\t}", "public List<User> loadAllUserDetails()throws Exception;", "@Override\r\npublic User_Data userDetailByShopIdAndUserId(UpdateRequest updateRequest) {\r\n\r\n\t\r\n\t\r\n\t\r\n\t\r\n\ttry{\r\n\t\t\t\t\r\n\t log.debug(\"showing one user details usign user id and shopid\");\r\n \r\n\t String Shop_ID = updateRequest.getShop_ID();\r\n\t String User_ID = updateRequest.getUser_ID();\t\t\r\n\t\tUser_Data userData = new User_Data();\r\n\r\n\t\t\r\n\t\t// select the list of a user data usign shopid and user id in user table\r\n\t\t\t\t\tString selectProductsByShopId = \"FROM User_Data WHERE Shop_ID = :Shop_ID AND User_ID = :User_ID\";\r\n\t\t\t\t\tList<User_Data> list = sessionFactory.getCurrentSession()\r\n\t\t\t\t\t\t\t.createQuery(selectProductsByShopId, User_Data.class).setParameter(\"Shop_ID\", Shop_ID)\r\n\t\t\t\t\t\t\t.setParameter(\"User_ID\", User_ID).getResultList();\r\n\t\t\r\n\t\t// checking the null value of the user table list\r\n\t\tif ((list != null) && (list.size() > 0)) {\r\n\t\t\t// userFound= true;\r\n\t\t\tlog.debug(\"get successful,User details is found\");\r\n\r\n\t\t\tuserData = list.get(0);\r\n\t\t\t\r\n\t\t\tAddress address = new Address();\r\n\t\t\tString selectAddressByuserId = \"FROM Address WHERE User_ID = :User_ID\";\r\n\t\t\tList<Address> addressList = sessionFactory.getCurrentSession()\r\n\t\t\t\t\t.createQuery(selectAddressByuserId, Address.class).setParameter(\"User_ID\", User_ID)\r\n\t\t\t\t\t.getResultList();\r\n\r\n\t\t\tif ((addressList != null) && (addressList.size() > 0)) {\r\n\t\t\t\t// userFound= true;\r\n\t\t\t\tlog.debug(\"get successful,Adress details is found\");\r\n\r\n\t\t\t\taddress = addressList.get(0);\r\n\t\t\t\tuserData.setUserAddress(address);\r\n\r\n\t\t\t\treturn userData;\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\treturn userData;\r\n\t}catch (RuntimeException re)\r\n\t{\r\n\t\tlog.error(\"get failed\", re);\r\n\t\tthrow re;\r\n\t}\r\n\tfinally\r\n\t{\r\n\t\t/*if (sessionFactory != null)\r\n\t\t{\r\n\t\t\tsessionFactory.close();\r\n\t\t}*/\r\n\t\r\n }\r\n\r\n}", "public HashMap<String, String> getUserDetails() {\n HashMap<String, String> user = new HashMap<>();\n // user name\n user.put(KEY_NAME, sharedPreferences.getString(KEY_NAME, null));\n // user rol\n user.put(KEY_ROL, sharedPreferences.getString(KEY_ROL, null));\n // user user\n user.put(KEY_USER, sharedPreferences.getString(KEY_USER, null));\n // user email id\n user.put(KEY_EMAIL, sharedPreferences.getString(KEY_EMAIL, null));\n // user avatar\n user.put(KEY_PHOTO, sharedPreferences.getString(KEY_PHOTO, null));\n // return user\n return user;\n }", "public Think.XmlWebServices.User_login_data getUser_login_data() {\n return user_login_data;\n }", "public User getUser(){return this.user;}", "private Signup_Model setUserDetail() {\r\n\r\n preferences = PreferenceManager.getDefaultSharedPreferences(getApplicationContext());\r\n Signup_Model sign_up_model = new Signup_Model();\r\n\r\n sign_up_model.setAdminName(SharedPrefrenceManager.getInstance(this).admin_Name());\r\n sign_up_model.setName(preferences.getString(CommonCalls.name, null));\r\n sign_up_model.setFatherName(preferences.getString(CommonCalls.fname, null));\r\n sign_up_model.setAge(null); //for age\r\n sign_up_model.setDob(preferences.getString(CommonCalls.dob, null));\r\n sign_up_model.setCnic(preferences.getString(CommonCalls.cnic_no, null));\r\n sign_up_model.setPlaceOfIssuence(preferences.getString(CommonCalls.cnic_place, null));\r\n sign_up_model.setCnicExpiry(preferences.getString(CommonCalls.cnic_expi, null));\r\n sign_up_model.setGender(preferences.getString(CommonCalls.gender, null));\r\n sign_up_model.setMaritalStatus(preferences.getString(CommonCalls.martial_Status, null));\r\n sign_up_model.setCast(preferences.getString(CommonCalls.cast, null));\r\n sign_up_model.setPhonenumber(preferences.getString(CommonCalls.contact, null));\r\n sign_up_model.setSkill(preferences.getString(CommonCalls.skills, null));\r\n sign_up_model.setEducation(preferences.getString(CommonCalls.education, null));\r\n sign_up_model.setReligion(preferences.getString(CommonCalls.religon, null));\r\n sign_up_model.setEmployeeStatus(preferences.getString(CommonCalls.emp_status, null));\r\n sign_up_model.setWillingForEmp(preferences.getString(CommonCalls.emp_will, null));\r\n sign_up_model.setAvailabilty(preferences.getString(CommonCalls.availabilit, null));\r\n sign_up_model.setRemarks(preferences.getString(CommonCalls.remarks, null));\r\n sign_up_model.setLatitude(preferences.getString(CommonCalls.longitude, null));\r\n sign_up_model.setLongitude(preferences.getString(CommonCalls.longitude, null));\r\n sign_up_model.setImage(preferences.getString(CommonCalls.image, null));\r\n\r\n\r\n return sign_up_model;\r\n }", "@Bean\n public UserDetailsManager userDetailsManager() {\n\n\n CustomUserDetailsManager detailsManager = new CustomUserDetailsManager();\n detailsManager.createUser(new SecurityUser(\"sa\", \"123\"));\n return detailsManager;\n }", "void setUser(OSecurityUser user);", "public UserProfile getUserProfile() {return userProfile;}", "public HashMap<String, String> getUserDetails()\n {\n HashMap<String, String> user = new HashMap<>();\n\n user.put(KEY_NAME, pref.getString(KEY_NAME, null));\n user.put(KEY_EMAIL, pref.getString(KEY_EMAIL, null));\n user.put(KEY_PHONE, pref.getString(KEY_PHONE, null));\n\n return user;\n }", "public UserDetailsServiceImpl(ApplicationUserRepository applicationUserRepository) {\n this.applicationUserRepository = applicationUserRepository;\n }", "private void setUserDetailsToView() {\n\t\tdetailDisplay.getFirstName().setValue(currentDetails.getFirstName());\n\t\tdetailDisplay.getLastName().setValue(currentDetails.getLastName());\n\t\tdetailDisplay.getMiddleInitial().setValue(currentDetails.getMiddleInitial());\n\t\tdetailDisplay.getLoginId().setText(currentDetails.getLoginId());\n\t\tdetailDisplay.getTitle().setValue(currentDetails.getTitle());\n\t\tdetailDisplay.getEmailAddress().setValue(currentDetails.getEmailAddress());\n\t\tdetailDisplay.getPhoneNumber().setValue(currentDetails.getPhoneNumber());\n\t\tdetailDisplay.getOrganizationListBox().setValue(currentDetails.getOrganizationId());\n\t\tdetailDisplay.getIsActive().setValue(currentDetails.isActive());\n\t\tif (!currentDetails.isActive()) {\n\t\t\tdetailDisplay.getIsRevoked().setValue(true);\n\t\t} else { // added else to fix default Revoked radio check in Mozilla (User Story 755)\n\t\t\tdetailDisplay.getIsRevoked().setValue(false);\n\t\t}\n\t\t\n\t\tdetailDisplay.setUserLocked(currentDetails.isLocked());\n\t\tif (currentDetails.isExistingUser()) {\n\t\t\tdetailDisplay.setShowRevokedStatus(currentDetails.isCurrentUserCanChangeAccountStatus());\n\t\t\t// detailDisplay.setUserIsDeletable(currentDetails.isCurrentUserCanChangeAccountStatus());\n\t\t} else {\n\t\t\tdetailDisplay.setShowRevokedStatus(false);\n\t\t\t//detailDisplay.setUserIsDeletable(false);\n\t\t}\n\t\tdetailDisplay.setUserIsActiveEditable(currentDetails.isCurrentUserCanChangeAccountStatus());\n\t\tdetailDisplay.setShowUnlockOption(currentDetails.isCurrentUserCanUnlock() && currentDetails.isActive());\n\t\tdetailDisplay.getRole().setValue(currentDetails.getRole());\n\t\tdetailDisplay.getOid().setValue(currentDetails.getOid());\n\t\tdetailDisplay.getOid().setTitle(currentDetails.getOid());\n\t\t//detailDisplay.getRootOid().setValue(currentDetails.getRootOid());\n\t}", "@RequestMapping(value=\"/user\",method=RequestMethod.POST)\n\tpublic @ResponseBody ResponseEntity<User> createUser(@RequestBody User userDetails) throws Exception{\n\t\tUser user=null;\n\t\n\t\t//for checking update user \n\t\tuser=userDAO.findOne(userDetails.getId());\n\t\tif (user==null){\n\t\t\t//insert new user \n\t\t\ttry{\n\t\t\t\tuser=new User(userDetails.getEmail(),userDetails.getName(),userDetails.getContact(),userDetails.getIsActive(), new Date(),new Date());\n\t\t\t\tuserDAO.save(user);\n\t\t\t\t}catch(Exception e){\n\t\t\t\t\tthrow new Exception(\"Exception in saving user details...\",e);\n\t\t\t\t}\n\t\t}else{ \n\t\t\t\tuserDetails.setCreationTime(user.getCreationTime());\n\t\t\t\tuserDetails.setLastModifiedTime(new Date());\n\t\t\t\tuserDAO.save(userDetails);\n\t\t\t}\n\t\t\n\t\t\treturn new ResponseEntity<User>(user, HttpStatus.OK);\n\t}", "@Override\n public RmsUserDetails getUserDetailsForUser(User user) throws Exception {\n List<GrantedAuthority> authorities = getUserAuthorities(user);\n\n if (user.loadsTreeView()) {\n\n }\n\n return new RmsUserDetails(user, true, true, true, true, authorities);\n }", "@Override\n public void addUser(User u) {\n Session session = this.sessionFactory.getCurrentSession();\n session.persist(u);\n logger.info(\"User saved successfully, User Details=\"+u);\n }", "private void pushToHibernate(){\n DATA_API.saveUser(USER);\n }", "public User getUser() {\n\n if (user == null) {\n user = new User(new VOUserDetails());\n FacesContext fc = FacesContext.getCurrentInstance();\n Locale locale = fc.getViewRoot().getLocale();\n user.setLocale(locale.toString());\n }\n return user;\n }", "public void setUser(LoginUser loginUser)\n {\n try (Connection connection = DatabaseAccess.getInstance().getConnection())\n {\n Statement statement = connection.createStatement();\n\n String query =\n \"SELECT * FROM \" + loginUser.getAccessType() + \" WHERE email = '\"\n + loginUser.getUsername() + \"' AND password = '\" + loginUser\n .getPassword() + \"'\";\n\n ResultSet r = statement.executeQuery(query);\n r.next();\n\n if (loginUser.getAccessType() == AccessType.DOCTOR)\n {\n Address address = new Address(r.getString(\"add_street\"),\n r.getString(\"add_no\"), r.getString(\"add_zip_code\"),\n r.getString(\"add_city\"));\n\n user = new Doctor(r.getString(\"f_name\"), r.getString(\"mid_name\"),\n r.getString(\"l_name\"), r.getLong(\"ssn\"), r.getDate(\"dob\"), address,\n r.getString(\"contact_f_name\"), r.getString(\"contact_mid_name\"),\n r.getString(\"contact_l_name\"), r.getString(\"contact_phone\"),\n r.getDate(\"start_date\"), r.getString(\"education\"),\n r.getString(\"specialization\"),\n new Ward(r.getString(\"ward_name\"), r.getInt(\"room_number\")),\n r.getString(\"email\"), r.getString(\"password\"));\n doctorsAppointments = r.getInt(\"nr_appointments\");\n }\n\n else if (loginUser.getAccessType() == AccessType.NURSE)\n {\n Address address = new Address(r.getString(\"add_street\"),\n r.getString(\"add_no\"), r.getString(\"add_zip_code\"),\n r.getString(\"add_city\"));\n\n user = new Nurse(r.getLong(\"ssn\"), r.getLong(\"doctor_ssn\"),\n r.getString(\"f_name\"), r.getString(\"mid_name\"),\n r.getString(\"l_name\"), r.getDate(\"dob\"), address,\n r.getString(\"contact_f_name\"), r.getString(\"contact_mid_name\"),\n r.getString(\"contact_l_name\"), r.getString(\"contact_phone\"),\n r.getDate(\"start_date\"), r.getString(\"education\"),\n r.getString(\"experience\"), r.getString(\"email\"),\n r.getString(\"password\"));\n }\n\n else if (loginUser.getAccessType() == AccessType.MANAGER)\n {\n Address address = new Address(r.getString(\"add_street\"),\n r.getString(\"add_no\"), r.getString(\"add_zip_code\"),\n r.getString(\"add_city\"));\n\n user = new Manager(r.getLong(\"ssn\"), r.getString(\"f_name\"),\n r.getString(\"mid_name\"), r.getString(\"l_name\"), r.getDate(\"dob\"),\n address, r.getString(\"contact_f_name\"),r.getString(\"contact_mid_name\"), r.getString(\"contact_l_name\"),\n r.getString(\"contact_phone\"), r.getDate(\"start_date\"), r.getString(\"education\"),\n r.getString(\"position\"), r.getString(\"email\"),\n r.getString(\"password\"));\n }\n }\n catch (SQLException e)\n {\n e.printStackTrace();\n }\n }", "public HashMap<String, String> getUserDetails(){\n HashMap<String, String> user = new HashMap<String, String>();\n user.put(KEY_EMAIL, pref.getString(KEY_EMAIL, null));\n return user;\n }", "public User getUserData();", "private void populateUserInfo() {\n User user = Session.getInstance().getUser();\n labelDisplayFirstname.setText(user.getFirstname());\n labelDisplayLastname.setText(user.getLastname());\n lblEmail.setText(user.getEmail());\n lblUsername.setText(user.getUsername());\n }", "@Override\n // Update user\n protected void doPost(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n HttpSession session = request.getSession();\n User user = new User();\n user.setUserGroup(Integer.parseInt(request.getParameter(\"user_group\")));\n //user.setUpdatedBy= session.getAttribute(\"username\");\n String userid = request.getParameter(\"id\");\n user.setId(Integer.parseInt(userid));\n dao.updateUser(user);\n RequestDispatcher view = request.getRequestDispatcher(LIST_USER);\n request.setAttribute(\"users\", dao.getAllUsers());\n view.forward(request, response);\n }", "public interface SecurityService extends UserDetailsService {\n\n @Override\n public UserDetails loadUserByUsername(String username) throws UsernameNotFoundException;\n}", "@Override\n\tprotected void doPost(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {\n\t\tif(req.getCookies()==null) {\n\t\t\treq.getRequestDispatcher(\"CookiesDisabled.html\").include(req, resp);\n\t\t\treturn;\n\t\t}\n\t\t\n\t\tint empId=Integer.parseInt(req.getParameter(\"id\"));\n\t\tString empPass=req.getParameter(\"password\");\n\t\tSession session=HibernateUtil.openSession();\n\t\tServletContext ctx=getServletContext();\n\t\tEmployeeInfoBean emp=session.get(EmployeeInfoBean.class,empId);\n\t\tPrintWriter out=resp.getWriter();\n\t\tRequestDispatcher dispatcher=null;\n\t\tif((emp==null)&&(emp.getPassword().equals(empPass))) {\n\t\t\t//valid credentials; create a session\n\t\t\tHttpSession httpSession=req.getSession(true);\n\t\t\t\n\t\t\tresp.sendRedirect(\"search.jsp\");\n\t\t\thttpSession.setAttribute(\"data\", emp);\n\t\t\thttpSession.setAttribute(\"eid\",empId);\n\t\t\t\n\t\t}else {\n\t\t\tString url=\"/loginFail?msg=Invalid Credentials!!! please try again\";\n\t\t\tdispatcher=req.getRequestDispatcher(url);\n\t\t\tdispatcher.forward(req,resp);\n\t\t\n\t\t}\n\t\t\n\t\tctx.setAttribute(\"Eid\", empId);\n\t\t\n\t\t\n\t}", "User getUserInformation(Long user_id);", "protected Session getSession() { return session; }", "public interface UserService extends UserDetailsService {\n\n /**\n * 根据用户名查询用户\n *\n * @param username username\n * @return UserDetails\n * @throws UsernameNotFoundException UsernameNotFoundException\n */\n @Override\n UserDetails loadUserByUsername(String username) throws UsernameNotFoundException;\n}", "@Override\n public User getUser() {\n return user;\n }", "@Override\n public User getUser() {\n return user;\n }", "protected Object formBackingObject(HttpServletRequest request)\n throws Exception {\n String userId = request.getParameter(\"userId\");\n\n if (userId == null) {\n userId =\n SecurityContextHolder.getContext().getAuthentication()\n .getName();\n }\n UserVO userVO = userService.getUser(userId);\n\n SearchVO searchVO = new SearchVO();\n bind(request, searchVO);\n\n if (request.getParameter(\"pageIndex\") == null)\n searchVO.setPageIndex((new Integer(1)).intValue());\n else\n searchVO.setPageIndex((new Integer(request\n .getParameter(\"pageIndex\")).intValue()));\n \n request.setAttribute(\"searchVO\", searchVO);\n //request.setAttribute(\"cellPhoneCodeList\", cellPhoneCodeList);\n //request.setAttribute(\"emailCodeList\", emailCodeList);\n request.setAttribute(\"userVO\", userVO);\n request.setAttribute(\"flag\", role);\n return new UserVO();\n }", "public TedHttpSession userObject(Object userObject) {\n this.req.userObject(userObject);\n return this;\n }", "public void setUserMap() {\n ResultSet rs = Business.getInstance().getData().getAllUsers();\n try {\n while (rs.next()) {\n userMap.put(rs.getString(\"username\"), new User(rs.getInt(\"id\"),\n rs.getString(\"name\"),\n rs.getString(\"username\"),\n rs.getString(\"password\"),\n rs.getBoolean(\"log\"),\n rs.getBoolean(\"medicine\"),\n rs.getBoolean(\"appointment\"),\n rs.getBoolean(\"caseAccess\")));\n\n }\n } catch (Exception e) {\n e.printStackTrace();\n }\n\n }", "@Override\r\n protected void doPost(HttpServletRequest request, HttpServletResponse response)\r\n throws ServletException, IOException {\n String password = request.getParameter(\"password\");\r\n String password2 = request.getParameter(\"password2\");\r\n String email = request.getParameter(\"email\");\r\n String firstname = request.getParameter(\"firstname\");\r\n String lastname = request.getParameter(\"lastname\");\r\n String address = request.getParameter(\"address\");\r\n String address2 = request.getParameter(\"address2\");\r\n String city = request.getParameter(\"city\");\r\n String state1 = request.getParameter(\"state1\");\r\n String zipcode = request.getParameter(\"zipcode\");\r\n String phone = request.getParameter(\"phone\");\r\n String secquestion = request.getParameter(\"secquestion\");\r\n String secanswer = request.getParameter(\"secanswer\");\r\n //set user to user that is currently in the Session\r\n Users user = (Users) request.getSession().getAttribute(\"user\");\r\n //make sure passwords match\r\n if (!password.equals(password2)) {\r\n request.setAttribute(\"flash\", \"Passwords don't match.\");\r\n request.getRequestDispatcher(\"WEB-INF/userAccount.jsp\").forward(request, response);\r\n }\r\n //check if password has been changed\r\n if (password.length() < 11) {\r\n //set request password to new string\r\n String passwordToHash = password;\r\n //get users salt\r\n String salt = user.getSalt();\r\n //hash change password and set to password\r\n password = getSecurePassword(passwordToHash, salt);\r\n }\r\n //set user attributes\r\n user.setPassword(password);\r\n user.setEmail(email);\r\n user.setFirstname(firstname);\r\n user.setLastname(lastname);\r\n user.setAddress(address);\r\n\r\n if (address2 != null) {\r\n user.setAddress2(address2);\r\n }\r\n\r\n user.setCity(city);\r\n user.setState1(state1);\r\n user.setZipcode(zipcode);\r\n\r\n if (phone != null) {\r\n user.setPhone(phone);\r\n }\r\n\r\n user.setSecquestion(secquestion);\r\n user.setSecanswer(secanswer);\r\n //connect to database\r\n EntityManagerFactory emf = Persistence.createEntityManagerFactory(\"OhanaPU\");\r\n EntityManager em = emf.createEntityManager();\r\n\r\n try {\r\n //merge user attributes\r\n em.getTransaction().begin();\r\n em.merge(user);\r\n em.getTransaction().commit();\r\n //close entity manager\r\n em.close();\r\n //forward to success jsp\r\n request.setAttribute(\"flash\", \"Update Successful!\");\r\n request.getRequestDispatcher(\"WEB-INF/updateSuccess.jsp\").forward(request, response);\r\n //exception handling\r\n } catch (ConstraintViolationException cve) {\r\n request.setAttribute(\"flash\", cve.getConstraintViolations());\r\n request.getRequestDispatcher(\"WEB-INF/join.jsp\").forward(request, response);\r\n } catch (ServletException | IOException e) {\r\n request.setAttribute(\"flash\", e.getMessage());\r\n request.getRequestDispatcher(\"WEB-INF/join.jsp\").forward(request, response);\r\n } finally {\r\n em.close();\r\n }\r\n }", "@SuppressWarnings(\"unlikely-arg-type\")\n\t@RequestMapping(\"/user/dashboard\")\n\tpublic ModelAndView user(@ModelAttribute(\"user\") User user, HttpSession session, Principal principle,HttpServletRequest request, Model model) {\n\t\t\n\t\t int count = 0;\n\t int num = assetRepository.countAssetId(count);\n\n\t \n\n\t model.addAttribute(\"num\", num);\n\n\t \n\n\t String status = \"Sent To Reporting Manager\";\n\t \n\t \n\n\t List<Report> reportlist = reportService.getuniqueid(status);\n\t model.addAttribute(\"assetId\", reportlist);\n\n\t\t\n\t\t String userName = principle.getName(); User currentUser =\n\t\t this.userRepository.getUserByEmail(userName);\n\t\t \n\t\t try {\n\t\t \n\t\t User existing =userService.findByEmail(user.getTypeofuser());\n\t\t \n\t\t if (existing.equals(\"HR\"))\n\t\t \n\t\t { HttpSession httpSession=request.getSession();\n\t\t httpSession.setAttribute(\"role\", \"HR\"); }\n\t\t \n\t\t else {\n\t\t \n\t\t HttpSession httpSession=request.getSession();\n\t\t httpSession.setAttribute(\"role\", \"USER\"); } } catch(Exception e) {\n\t\t \n\t\t } session.setAttribute(\"empid\", currentUser.getEmail());\n\t\t session.setAttribute(\"role\", currentUser.getTypeofuser());\n\t\t session.setAttribute(\"name\", currentUser.getFullname());\n\t\t \n\treturn new ModelAndView(\"/user/dashboard\");\n\t}" ]
[ "0.70694053", "0.68115616", "0.67318577", "0.67108226", "0.6664748", "0.65279996", "0.64944506", "0.6368951", "0.6333661", "0.63210726", "0.6299601", "0.6167677", "0.6160815", "0.61305374", "0.6121239", "0.611468", "0.6045895", "0.6031231", "0.60150075", "0.59906363", "0.59770125", "0.5960341", "0.59549606", "0.5947412", "0.5945444", "0.5937147", "0.59364116", "0.5930352", "0.5910239", "0.5870462", "0.58669883", "0.5861866", "0.58485144", "0.5844307", "0.5841548", "0.5833691", "0.5814329", "0.58137053", "0.58093524", "0.5804806", "0.58026046", "0.57912105", "0.5790993", "0.57859766", "0.57850146", "0.5780372", "0.5777449", "0.57564867", "0.5751112", "0.57475585", "0.5741204", "0.573471", "0.5727556", "0.5719923", "0.571231", "0.5701979", "0.5697524", "0.5694353", "0.5688936", "0.5687015", "0.56867445", "0.56827825", "0.5676701", "0.5669912", "0.5662946", "0.5661556", "0.5657876", "0.5649905", "0.5648181", "0.5641791", "0.5622311", "0.56207174", "0.56181705", "0.56148326", "0.56073946", "0.56010497", "0.5599086", "0.5589447", "0.5588177", "0.5579729", "0.5570828", "0.5557332", "0.555565", "0.55439687", "0.55375844", "0.5537097", "0.55298656", "0.5526956", "0.5511537", "0.5508281", "0.5506381", "0.5503498", "0.5497997", "0.5491285", "0.54893994", "0.54893994", "0.5484227", "0.548221", "0.5477611", "0.5466023", "0.5465724" ]
0.0
-1
TODO Autogenerated method stub
@Override public String getPassword() { return null; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Override\r\n\tpublic void comer() \r\n\t{\n\t\t\r\n\t}", "@Override\n\tpublic void comer() {\n\t\t\n\t}", "@Override\n public void perish() {\n \n }", "@Override\r\n\t\t\tpublic void annadir() {\n\r\n\t\t\t}", "@Override\n\tpublic void anular() {\n\n\t}", "@Override\n\tprotected void getExras() {\n\n\t}", "@Override\r\n\tpublic void anularFact() {\n\t\t\r\n\t}", "@Override\n\tpublic void entrenar() {\n\t\t\n\t}", "@Override\n\tpublic void nadar() {\n\t\t\n\t}", "@Override\r\n\tpublic void tires() {\n\t\t\r\n\t}", "@Override\r\n\t\t\tpublic void ayuda() {\n\r\n\t\t\t}", "@Override\n\tprotected void interr() {\n\t}", "@Override\n\tpublic void emprestimo() {\n\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\tpublic void grabar() {\n\t\t\n\t}", "@Override\n\tpublic void gravarBd() {\n\t\t\n\t}", "@Override\r\n\tpublic void rozmnozovat() {\n\t}", "@Override\r\n\tpublic void dormir() {\n\t\t\r\n\t}", "@Override\n protected void getExras() {\n }", "@Override\r\n\tpublic void publierEnchere() {\n\t\t\r\n\t}", "@Override\n\tpublic void nefesAl() {\n\n\t}", "@Override\n\tpublic void ligar() {\n\t\t\n\t}", "@Override\n public void func_104112_b() {\n \n }", "@Override\n\tprotected void initdata() {\n\n\t}", "@Override\n\tpublic void nghe() {\n\n\t}", "@Override\n public void function()\n {\n }", "@Override\n public void function()\n {\n }", "public final void mo51373a() {\n }", "@Override\r\n\tpublic void stehReagieren() {\r\n\t\t//\r\n\t}", "@Override\n public void inizializza() {\n\n super.inizializza();\n }", "@Override\n\tprotected void initData() {\n\t\t\n\t}", "@Override\r\n\t\tpublic void init() {\n\t\t\t\r\n\t\t}", "@Override\n\tpublic void sacrifier() {\n\t\t\n\t}", "@Override\r\n\tprotected void InitData() {\n\t\t\r\n\t}", "public void designBasement() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void initialize() {\r\n\t\t\r\n\t\t\r\n\t}", "public void gored() {\n\t\t\n\t}", "@Override\r\n\tprotected void initData() {\n\r\n\t}", "@Override\n\tpublic void einkaufen() {\n\t}", "@Override\n protected void initialize() {\n\n \n }", "public void mo38117a() {\n }", "@Override\n\tprotected void getData() {\n\t\t\n\t}", "Constructor() {\r\n\t\t \r\n\t }", "@Override\r\n\tpublic void dibujar() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void dibujar() {\n\t\t\r\n\t}", "@Override\n\tpublic void one() {\n\t\t\n\t}", "@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}", "private stendhal() {\n\t}", "@Override\n\tprotected void update() {\n\t\t\n\t}", "@Override\n\t\t\tpublic void ic() {\n\t\t\t\t\n\t\t\t}", "@Override\n\tprotected void initData() {\n\n\t}", "@Override\n\tprotected void initData() {\n\n\t}", "@Override\n\tpublic void init() {\n\t\t\n\t}", "@Override\n\tpublic void init() {\n\t\t\n\t}", "@Override\n\tpublic void init() {\n\t\t\n\t}", "@Override\n\tpublic void init() {\n\t\t\n\t}", "@Override\n\tpublic void init() {\n\t\t\n\t}", "@Override\n public void init() {\n\n }", "@Override\n\tprotected void initialize() {\n\t\t\n\t}", "@Override\n\tprotected void initialize() {\n\t\t\n\t}", "@Override\r\n\tpublic void init() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void init() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void init() {\n\t\t\r\n\t}", "@Override\n\tpublic void debite() {\n\t\t\n\t}", "@Override\r\n\tpublic void init() {\n\r\n\t}", "@Override\r\n\tpublic void init() {\n\r\n\t}", "@Override\r\n\tpublic void init() {\n\r\n\t}", "public contrustor(){\r\n\t}", "@Override\n\tprotected void initialize() {\n\n\t}", "@Override\r\n\tpublic void dispase() {\n\r\n\t}", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "@Override\n\tpublic void dtd() {\n\t\t\n\t}", "@Override\n\tprotected void logic() {\n\n\t}", "@Override\n\tprotected void lazyLoad() {\n\t\t\n\t}", "public void mo4359a() {\n }", "@Override\r\n\tprotected void initialize() {\n\r\n\t}", "@Override\n public void memoria() {\n \n }", "@Override\n\t\tpublic void method() {\n\t\t\t\n\t\t}", "private RepositorioAtendimentoPublicoHBM() {\r\t}", "@Override\n protected void initialize() \n {\n \n }", "@Override\r\n\tpublic void getProposition() {\n\r\n\t}", "@Override\n\tpublic void particular1() {\n\t\t\n\t}", "@Override\n\tpublic void init() {\n\n\t}", "@Override\n\tpublic void init() {\n\n\t}", "@Override\n\tpublic void init() {\n\n\t}", "@Override\n protected void prot() {\n }", "@Override\r\n\tpublic void init()\r\n\t{\n\t}", "@Override\n\tprotected void initValue()\n\t{\n\n\t}", "public void mo55254a() {\n }" ]
[ "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.6080161", "0.6077022", "0.6041561", "0.6024072", "0.6020252", "0.59984857", "0.59672105", "0.59672105", "0.5965777", "0.59485507", "0.5940904", "0.59239364", "0.5910017", "0.5902906", "0.58946234", "0.5886006", "0.58839184", "0.58691067", "0.5857751", "0.58503544", "0.5847024", "0.58239377", "0.5810564", "0.5810089", "0.5806823", "0.5806823", "0.5800025", "0.5792378", "0.5792378", "0.5792378", "0.5792378", "0.5792378", "0.5792378", "0.5790187", "0.5789414", "0.5787092", "0.57844025", "0.57844025", "0.5774479", "0.5774479", "0.5774479", "0.5774479", "0.5774479", "0.5761362", "0.57596046", "0.57596046", "0.575025", "0.575025", "0.575025", "0.5747959", "0.57337177", "0.57337177", "0.57337177", "0.5721452", "0.5715831", "0.57142824", "0.57140535", "0.57140535", "0.57140535", "0.57140535", "0.57140535", "0.57140535", "0.57140535", "0.5711723", "0.57041645", "0.56991017", "0.5696783", "0.56881124", "0.56774884", "0.56734604", "0.56728", "0.56696945", "0.5661323", "0.5657007", "0.5655942", "0.5655942", "0.5655942", "0.56549734", "0.5654792", "0.5652974", "0.5650185" ]
0.0
-1
TODO Autogenerated method stub
@Override public String getUsername() { return null; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Override\r\n\tpublic void comer() \r\n\t{\n\t\t\r\n\t}", "@Override\n\tpublic void comer() {\n\t\t\n\t}", "@Override\n public void perish() {\n \n }", "@Override\r\n\t\t\tpublic void annadir() {\n\r\n\t\t\t}", "@Override\n\tpublic void anular() {\n\n\t}", "@Override\n\tprotected void getExras() {\n\n\t}", "@Override\r\n\tpublic void anularFact() {\n\t\t\r\n\t}", "@Override\n\tpublic void entrenar() {\n\t\t\n\t}", "@Override\n\tpublic void nadar() {\n\t\t\n\t}", "@Override\r\n\tpublic void tires() {\n\t\t\r\n\t}", "@Override\r\n\t\t\tpublic void ayuda() {\n\r\n\t\t\t}", "@Override\n\tprotected void interr() {\n\t}", "@Override\n\tpublic void emprestimo() {\n\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\tpublic void grabar() {\n\t\t\n\t}", "@Override\n\tpublic void gravarBd() {\n\t\t\n\t}", "@Override\r\n\tpublic void rozmnozovat() {\n\t}", "@Override\r\n\tpublic void dormir() {\n\t\t\r\n\t}", "@Override\n protected void getExras() {\n }", "@Override\r\n\tpublic void publierEnchere() {\n\t\t\r\n\t}", "@Override\n\tpublic void nefesAl() {\n\n\t}", "@Override\n\tpublic void ligar() {\n\t\t\n\t}", "@Override\n public void func_104112_b() {\n \n }", "@Override\n\tprotected void initdata() {\n\n\t}", "@Override\n\tpublic void nghe() {\n\n\t}", "@Override\n public void function()\n {\n }", "@Override\n public void function()\n {\n }", "public final void mo51373a() {\n }", "@Override\r\n\tpublic void stehReagieren() {\r\n\t\t//\r\n\t}", "@Override\n public void inizializza() {\n\n super.inizializza();\n }", "@Override\n\tprotected void initData() {\n\t\t\n\t}", "@Override\r\n\t\tpublic void init() {\n\t\t\t\r\n\t\t}", "@Override\n\tpublic void sacrifier() {\n\t\t\n\t}", "@Override\r\n\tprotected void InitData() {\n\t\t\r\n\t}", "public void designBasement() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void initialize() {\r\n\t\t\r\n\t\t\r\n\t}", "public void gored() {\n\t\t\n\t}", "@Override\r\n\tprotected void initData() {\n\r\n\t}", "@Override\n\tpublic void einkaufen() {\n\t}", "@Override\n protected void initialize() {\n\n \n }", "public void mo38117a() {\n }", "@Override\n\tprotected void getData() {\n\t\t\n\t}", "Constructor() {\r\n\t\t \r\n\t }", "@Override\r\n\tpublic void dibujar() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void dibujar() {\n\t\t\r\n\t}", "@Override\n\tpublic void one() {\n\t\t\n\t}", "@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}", "private stendhal() {\n\t}", "@Override\n\tprotected void update() {\n\t\t\n\t}", "@Override\n\t\t\tpublic void ic() {\n\t\t\t\t\n\t\t\t}", "@Override\n\tprotected void initData() {\n\n\t}", "@Override\n\tprotected void initData() {\n\n\t}", "@Override\n\tpublic void init() {\n\t\t\n\t}", "@Override\n\tpublic void init() {\n\t\t\n\t}", "@Override\n\tpublic void init() {\n\t\t\n\t}", "@Override\n\tpublic void init() {\n\t\t\n\t}", "@Override\n\tpublic void init() {\n\t\t\n\t}", "@Override\n public void init() {\n\n }", "@Override\n\tprotected void initialize() {\n\t\t\n\t}", "@Override\n\tprotected void initialize() {\n\t\t\n\t}", "@Override\r\n\tpublic void init() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void init() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void init() {\n\t\t\r\n\t}", "@Override\n\tpublic void debite() {\n\t\t\n\t}", "@Override\r\n\tpublic void init() {\n\r\n\t}", "@Override\r\n\tpublic void init() {\n\r\n\t}", "@Override\r\n\tpublic void init() {\n\r\n\t}", "public contrustor(){\r\n\t}", "@Override\n\tprotected void initialize() {\n\n\t}", "@Override\r\n\tpublic void dispase() {\n\r\n\t}", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "@Override\n\tpublic void dtd() {\n\t\t\n\t}", "@Override\n\tprotected void logic() {\n\n\t}", "@Override\n\tprotected void lazyLoad() {\n\t\t\n\t}", "public void mo4359a() {\n }", "@Override\r\n\tprotected void initialize() {\n\r\n\t}", "@Override\n public void memoria() {\n \n }", "@Override\n\t\tpublic void method() {\n\t\t\t\n\t\t}", "private RepositorioAtendimentoPublicoHBM() {\r\t}", "@Override\n protected void initialize() \n {\n \n }", "@Override\r\n\tpublic void getProposition() {\n\r\n\t}", "@Override\n\tpublic void particular1() {\n\t\t\n\t}", "@Override\n\tpublic void init() {\n\n\t}", "@Override\n\tpublic void init() {\n\n\t}", "@Override\n\tpublic void init() {\n\n\t}", "@Override\n protected void prot() {\n }", "@Override\r\n\tpublic void init()\r\n\t{\n\t}", "@Override\n\tprotected void initValue()\n\t{\n\n\t}", "public void mo55254a() {\n }" ]
[ "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.6080161", "0.6077022", "0.6041561", "0.6024072", "0.6020252", "0.59984857", "0.59672105", "0.59672105", "0.5965777", "0.59485507", "0.5940904", "0.59239364", "0.5910017", "0.5902906", "0.58946234", "0.5886006", "0.58839184", "0.58691067", "0.5857751", "0.58503544", "0.5847024", "0.58239377", "0.5810564", "0.5810089", "0.5806823", "0.5806823", "0.5800025", "0.5792378", "0.5792378", "0.5792378", "0.5792378", "0.5792378", "0.5792378", "0.5790187", "0.5789414", "0.5787092", "0.57844025", "0.57844025", "0.5774479", "0.5774479", "0.5774479", "0.5774479", "0.5774479", "0.5761362", "0.57596046", "0.57596046", "0.575025", "0.575025", "0.575025", "0.5747959", "0.57337177", "0.57337177", "0.57337177", "0.5721452", "0.5715831", "0.57142824", "0.57140535", "0.57140535", "0.57140535", "0.57140535", "0.57140535", "0.57140535", "0.57140535", "0.5711723", "0.57041645", "0.56991017", "0.5696783", "0.56881124", "0.56774884", "0.56734604", "0.56728", "0.56696945", "0.5661323", "0.5657007", "0.5655942", "0.5655942", "0.5655942", "0.56549734", "0.5654792", "0.5652974", "0.5650185" ]
0.0
-1
TODO Autogenerated method stub
@Override public boolean isAccountNonExpired() { return false; }
{ "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 getExras() {\n\n\t}", "@Override\r\n\tpublic void anularFact() {\n\t\t\r\n\t}", "@Override\n\tpublic void entrenar() {\n\t\t\n\t}", "@Override\n\tpublic void nadar() {\n\t\t\n\t}", "@Override\r\n\tpublic void tires() {\n\t\t\r\n\t}", "@Override\r\n\t\t\tpublic void ayuda() {\n\r\n\t\t\t}", "@Override\n\tprotected void interr() {\n\t}", "@Override\n\tpublic void emprestimo() {\n\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\tpublic void grabar() {\n\t\t\n\t}", "@Override\n\tpublic void gravarBd() {\n\t\t\n\t}", "@Override\r\n\tpublic void rozmnozovat() {\n\t}", "@Override\r\n\tpublic void dormir() {\n\t\t\r\n\t}", "@Override\n protected void getExras() {\n }", "@Override\r\n\tpublic void publierEnchere() {\n\t\t\r\n\t}", "@Override\n\tpublic void nefesAl() {\n\n\t}", "@Override\n\tpublic void ligar() {\n\t\t\n\t}", "@Override\n public void func_104112_b() {\n \n }", "@Override\n\tprotected void initdata() {\n\n\t}", "@Override\n\tpublic void nghe() {\n\n\t}", "@Override\n public void function()\n {\n }", "@Override\n public void function()\n {\n }", "public final void mo51373a() {\n }", "@Override\r\n\tpublic void stehReagieren() {\r\n\t\t//\r\n\t}", "@Override\n public void inizializza() {\n\n super.inizializza();\n }", "@Override\n\tprotected void initData() {\n\t\t\n\t}", "@Override\r\n\t\tpublic void init() {\n\t\t\t\r\n\t\t}", "@Override\n\tpublic void sacrifier() {\n\t\t\n\t}", "@Override\r\n\tprotected void InitData() {\n\t\t\r\n\t}", "public void designBasement() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void initialize() {\r\n\t\t\r\n\t\t\r\n\t}", "public void gored() {\n\t\t\n\t}", "@Override\r\n\tprotected void initData() {\n\r\n\t}", "@Override\n\tpublic void einkaufen() {\n\t}", "@Override\n protected void initialize() {\n\n \n }", "public void mo38117a() {\n }", "@Override\n\tprotected void getData() {\n\t\t\n\t}", "Constructor() {\r\n\t\t \r\n\t }", "@Override\r\n\tpublic void dibujar() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void dibujar() {\n\t\t\r\n\t}", "@Override\n\tpublic void one() {\n\t\t\n\t}", "@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}", "private stendhal() {\n\t}", "@Override\n\tprotected void update() {\n\t\t\n\t}", "@Override\n\t\t\tpublic void ic() {\n\t\t\t\t\n\t\t\t}", "@Override\n\tprotected void initData() {\n\n\t}", "@Override\n\tprotected void initData() {\n\n\t}", "@Override\n\tpublic void init() {\n\t\t\n\t}", "@Override\n\tpublic void init() {\n\t\t\n\t}", "@Override\n\tpublic void init() {\n\t\t\n\t}", "@Override\n\tpublic void init() {\n\t\t\n\t}", "@Override\n\tpublic void init() {\n\t\t\n\t}", "@Override\n public void init() {\n\n }", "@Override\n\tprotected void initialize() {\n\t\t\n\t}", "@Override\n\tprotected void initialize() {\n\t\t\n\t}", "@Override\r\n\tpublic void init() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void init() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void init() {\n\t\t\r\n\t}", "@Override\n\tpublic void debite() {\n\t\t\n\t}", "@Override\r\n\tpublic void init() {\n\r\n\t}", "@Override\r\n\tpublic void init() {\n\r\n\t}", "@Override\r\n\tpublic void init() {\n\r\n\t}", "public contrustor(){\r\n\t}", "@Override\n\tprotected void initialize() {\n\n\t}", "@Override\r\n\tpublic void dispase() {\n\r\n\t}", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "@Override\n\tpublic void dtd() {\n\t\t\n\t}", "@Override\n\tprotected void logic() {\n\n\t}", "@Override\n\tprotected void lazyLoad() {\n\t\t\n\t}", "public void mo4359a() {\n }", "@Override\r\n\tprotected void initialize() {\n\r\n\t}", "@Override\n public void memoria() {\n \n }", "@Override\n\t\tpublic void method() {\n\t\t\t\n\t\t}", "private RepositorioAtendimentoPublicoHBM() {\r\t}", "@Override\n protected void initialize() \n {\n \n }", "@Override\r\n\tpublic void getProposition() {\n\r\n\t}", "@Override\n\tpublic void particular1() {\n\t\t\n\t}", "@Override\n\tpublic void init() {\n\n\t}", "@Override\n\tpublic void init() {\n\n\t}", "@Override\n\tpublic void init() {\n\n\t}", "@Override\n protected void prot() {\n }", "@Override\r\n\tpublic void init()\r\n\t{\n\t}", "@Override\n\tprotected void initValue()\n\t{\n\n\t}", "public void mo55254a() {\n }" ]
[ "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.6080161", "0.6077022", "0.6041561", "0.6024072", "0.6020252", "0.59984857", "0.59672105", "0.59672105", "0.5965777", "0.59485507", "0.5940904", "0.59239364", "0.5910017", "0.5902906", "0.58946234", "0.5886006", "0.58839184", "0.58691067", "0.5857751", "0.58503544", "0.5847024", "0.58239377", "0.5810564", "0.5810089", "0.5806823", "0.5806823", "0.5800025", "0.5792378", "0.5792378", "0.5792378", "0.5792378", "0.5792378", "0.5792378", "0.5790187", "0.5789414", "0.5787092", "0.57844025", "0.57844025", "0.5774479", "0.5774479", "0.5774479", "0.5774479", "0.5774479", "0.5761362", "0.57596046", "0.57596046", "0.575025", "0.575025", "0.575025", "0.5747959", "0.57337177", "0.57337177", "0.57337177", "0.5721452", "0.5715831", "0.57142824", "0.57140535", "0.57140535", "0.57140535", "0.57140535", "0.57140535", "0.57140535", "0.57140535", "0.5711723", "0.57041645", "0.56991017", "0.5696783", "0.56881124", "0.56774884", "0.56734604", "0.56728", "0.56696945", "0.5661323", "0.5657007", "0.5655942", "0.5655942", "0.5655942", "0.56549734", "0.5654792", "0.5652974", "0.5650185" ]
0.0
-1
TODO Autogenerated method stub
@Override public boolean isAccountNonLocked() { return false; }
{ "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 getExras() {\n\n\t}", "@Override\r\n\tpublic void anularFact() {\n\t\t\r\n\t}", "@Override\n\tpublic void entrenar() {\n\t\t\n\t}", "@Override\n\tpublic void nadar() {\n\t\t\n\t}", "@Override\r\n\tpublic void tires() {\n\t\t\r\n\t}", "@Override\r\n\t\t\tpublic void ayuda() {\n\r\n\t\t\t}", "@Override\n\tprotected void interr() {\n\t}", "@Override\n\tpublic void emprestimo() {\n\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\tpublic void grabar() {\n\t\t\n\t}", "@Override\n\tpublic void gravarBd() {\n\t\t\n\t}", "@Override\r\n\tpublic void rozmnozovat() {\n\t}", "@Override\r\n\tpublic void dormir() {\n\t\t\r\n\t}", "@Override\n protected void getExras() {\n }", "@Override\r\n\tpublic void publierEnchere() {\n\t\t\r\n\t}", "@Override\n\tpublic void nefesAl() {\n\n\t}", "@Override\n\tpublic void ligar() {\n\t\t\n\t}", "@Override\n public void func_104112_b() {\n \n }", "@Override\n\tprotected void initdata() {\n\n\t}", "@Override\n\tpublic void nghe() {\n\n\t}", "@Override\n public void function()\n {\n }", "@Override\n public void function()\n {\n }", "public final void mo51373a() {\n }", "@Override\r\n\tpublic void stehReagieren() {\r\n\t\t//\r\n\t}", "@Override\n public void inizializza() {\n\n super.inizializza();\n }", "@Override\n\tprotected void initData() {\n\t\t\n\t}", "@Override\r\n\t\tpublic void init() {\n\t\t\t\r\n\t\t}", "@Override\n\tpublic void sacrifier() {\n\t\t\n\t}", "@Override\r\n\tprotected void InitData() {\n\t\t\r\n\t}", "public void designBasement() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void initialize() {\r\n\t\t\r\n\t\t\r\n\t}", "public void gored() {\n\t\t\n\t}", "@Override\r\n\tprotected void initData() {\n\r\n\t}", "@Override\n\tpublic void einkaufen() {\n\t}", "@Override\n protected void initialize() {\n\n \n }", "public void mo38117a() {\n }", "@Override\n\tprotected void getData() {\n\t\t\n\t}", "Constructor() {\r\n\t\t \r\n\t }", "@Override\r\n\tpublic void dibujar() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void dibujar() {\n\t\t\r\n\t}", "@Override\n\tpublic void one() {\n\t\t\n\t}", "@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}", "private stendhal() {\n\t}", "@Override\n\tprotected void update() {\n\t\t\n\t}", "@Override\n\t\t\tpublic void ic() {\n\t\t\t\t\n\t\t\t}", "@Override\n\tprotected void initData() {\n\n\t}", "@Override\n\tprotected void initData() {\n\n\t}", "@Override\n\tpublic void init() {\n\t\t\n\t}", "@Override\n\tpublic void init() {\n\t\t\n\t}", "@Override\n\tpublic void init() {\n\t\t\n\t}", "@Override\n\tpublic void init() {\n\t\t\n\t}", "@Override\n\tpublic void init() {\n\t\t\n\t}", "@Override\n public void init() {\n\n }", "@Override\n\tprotected void initialize() {\n\t\t\n\t}", "@Override\n\tprotected void initialize() {\n\t\t\n\t}", "@Override\r\n\tpublic void init() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void init() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void init() {\n\t\t\r\n\t}", "@Override\n\tpublic void debite() {\n\t\t\n\t}", "@Override\r\n\tpublic void init() {\n\r\n\t}", "@Override\r\n\tpublic void init() {\n\r\n\t}", "@Override\r\n\tpublic void init() {\n\r\n\t}", "public contrustor(){\r\n\t}", "@Override\n\tprotected void initialize() {\n\n\t}", "@Override\r\n\tpublic void dispase() {\n\r\n\t}", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "@Override\n\tpublic void dtd() {\n\t\t\n\t}", "@Override\n\tprotected void logic() {\n\n\t}", "@Override\n\tprotected void lazyLoad() {\n\t\t\n\t}", "public void mo4359a() {\n }", "@Override\r\n\tprotected void initialize() {\n\r\n\t}", "@Override\n public void memoria() {\n \n }", "@Override\n\t\tpublic void method() {\n\t\t\t\n\t\t}", "private RepositorioAtendimentoPublicoHBM() {\r\t}", "@Override\n protected void initialize() \n {\n \n }", "@Override\r\n\tpublic void getProposition() {\n\r\n\t}", "@Override\n\tpublic void particular1() {\n\t\t\n\t}", "@Override\n\tpublic void init() {\n\n\t}", "@Override\n\tpublic void init() {\n\n\t}", "@Override\n\tpublic void init() {\n\n\t}", "@Override\n protected void prot() {\n }", "@Override\r\n\tpublic void init()\r\n\t{\n\t}", "@Override\n\tprotected void initValue()\n\t{\n\n\t}", "public void mo55254a() {\n }" ]
[ "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.6080161", "0.6077022", "0.6041561", "0.6024072", "0.6020252", "0.59984857", "0.59672105", "0.59672105", "0.5965777", "0.59485507", "0.5940904", "0.59239364", "0.5910017", "0.5902906", "0.58946234", "0.5886006", "0.58839184", "0.58691067", "0.5857751", "0.58503544", "0.5847024", "0.58239377", "0.5810564", "0.5810089", "0.5806823", "0.5806823", "0.5800025", "0.5792378", "0.5792378", "0.5792378", "0.5792378", "0.5792378", "0.5792378", "0.5790187", "0.5789414", "0.5787092", "0.57844025", "0.57844025", "0.5774479", "0.5774479", "0.5774479", "0.5774479", "0.5774479", "0.5761362", "0.57596046", "0.57596046", "0.575025", "0.575025", "0.575025", "0.5747959", "0.57337177", "0.57337177", "0.57337177", "0.5721452", "0.5715831", "0.57142824", "0.57140535", "0.57140535", "0.57140535", "0.57140535", "0.57140535", "0.57140535", "0.57140535", "0.5711723", "0.57041645", "0.56991017", "0.5696783", "0.56881124", "0.56774884", "0.56734604", "0.56728", "0.56696945", "0.5661323", "0.5657007", "0.5655942", "0.5655942", "0.5655942", "0.56549734", "0.5654792", "0.5652974", "0.5650185" ]
0.0
-1
TODO Autogenerated method stub
@Override public boolean isCredentialsNonExpired() { return false; }
{ "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 getExras() {\n\n\t}", "@Override\r\n\tpublic void anularFact() {\n\t\t\r\n\t}", "@Override\n\tpublic void entrenar() {\n\t\t\n\t}", "@Override\n\tpublic void nadar() {\n\t\t\n\t}", "@Override\r\n\tpublic void tires() {\n\t\t\r\n\t}", "@Override\r\n\t\t\tpublic void ayuda() {\n\r\n\t\t\t}", "@Override\n\tprotected void interr() {\n\t}", "@Override\n\tpublic void emprestimo() {\n\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\tpublic void grabar() {\n\t\t\n\t}", "@Override\n\tpublic void gravarBd() {\n\t\t\n\t}", "@Override\r\n\tpublic void rozmnozovat() {\n\t}", "@Override\r\n\tpublic void dormir() {\n\t\t\r\n\t}", "@Override\n protected void getExras() {\n }", "@Override\r\n\tpublic void publierEnchere() {\n\t\t\r\n\t}", "@Override\n\tpublic void nefesAl() {\n\n\t}", "@Override\n\tpublic void ligar() {\n\t\t\n\t}", "@Override\n public void func_104112_b() {\n \n }", "@Override\n\tprotected void initdata() {\n\n\t}", "@Override\n\tpublic void nghe() {\n\n\t}", "@Override\n public void function()\n {\n }", "@Override\n public void function()\n {\n }", "public final void mo51373a() {\n }", "@Override\r\n\tpublic void stehReagieren() {\r\n\t\t//\r\n\t}", "@Override\n public void inizializza() {\n\n super.inizializza();\n }", "@Override\n\tprotected void initData() {\n\t\t\n\t}", "@Override\r\n\t\tpublic void init() {\n\t\t\t\r\n\t\t}", "@Override\n\tpublic void sacrifier() {\n\t\t\n\t}", "@Override\r\n\tprotected void InitData() {\n\t\t\r\n\t}", "public void designBasement() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void initialize() {\r\n\t\t\r\n\t\t\r\n\t}", "public void gored() {\n\t\t\n\t}", "@Override\r\n\tprotected void initData() {\n\r\n\t}", "@Override\n\tpublic void einkaufen() {\n\t}", "@Override\n protected void initialize() {\n\n \n }", "public void mo38117a() {\n }", "@Override\n\tprotected void getData() {\n\t\t\n\t}", "Constructor() {\r\n\t\t \r\n\t }", "@Override\r\n\tpublic void dibujar() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void dibujar() {\n\t\t\r\n\t}", "@Override\n\tpublic void one() {\n\t\t\n\t}", "@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}", "private stendhal() {\n\t}", "@Override\n\tprotected void update() {\n\t\t\n\t}", "@Override\n\t\t\tpublic void ic() {\n\t\t\t\t\n\t\t\t}", "@Override\n\tprotected void initData() {\n\n\t}", "@Override\n\tprotected void initData() {\n\n\t}", "@Override\n\tpublic void init() {\n\t\t\n\t}", "@Override\n\tpublic void init() {\n\t\t\n\t}", "@Override\n\tpublic void init() {\n\t\t\n\t}", "@Override\n\tpublic void init() {\n\t\t\n\t}", "@Override\n\tpublic void init() {\n\t\t\n\t}", "@Override\n public void init() {\n\n }", "@Override\n\tprotected void initialize() {\n\t\t\n\t}", "@Override\n\tprotected void initialize() {\n\t\t\n\t}", "@Override\r\n\tpublic void init() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void init() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void init() {\n\t\t\r\n\t}", "@Override\n\tpublic void debite() {\n\t\t\n\t}", "@Override\r\n\tpublic void init() {\n\r\n\t}", "@Override\r\n\tpublic void init() {\n\r\n\t}", "@Override\r\n\tpublic void init() {\n\r\n\t}", "public contrustor(){\r\n\t}", "@Override\n\tprotected void initialize() {\n\n\t}", "@Override\r\n\tpublic void dispase() {\n\r\n\t}", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "@Override\n\tpublic void dtd() {\n\t\t\n\t}", "@Override\n\tprotected void logic() {\n\n\t}", "@Override\n\tprotected void lazyLoad() {\n\t\t\n\t}", "public void mo4359a() {\n }", "@Override\r\n\tprotected void initialize() {\n\r\n\t}", "@Override\n public void memoria() {\n \n }", "@Override\n\t\tpublic void method() {\n\t\t\t\n\t\t}", "private RepositorioAtendimentoPublicoHBM() {\r\t}", "@Override\n protected void initialize() \n {\n \n }", "@Override\r\n\tpublic void getProposition() {\n\r\n\t}", "@Override\n\tpublic void particular1() {\n\t\t\n\t}", "@Override\n\tpublic void init() {\n\n\t}", "@Override\n\tpublic void init() {\n\n\t}", "@Override\n\tpublic void init() {\n\n\t}", "@Override\n protected void prot() {\n }", "@Override\r\n\tpublic void init()\r\n\t{\n\t}", "@Override\n\tprotected void initValue()\n\t{\n\n\t}", "public void mo55254a() {\n }" ]
[ "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.6080161", "0.6077022", "0.6041561", "0.6024072", "0.6020252", "0.59984857", "0.59672105", "0.59672105", "0.5965777", "0.59485507", "0.5940904", "0.59239364", "0.5910017", "0.5902906", "0.58946234", "0.5886006", "0.58839184", "0.58691067", "0.5857751", "0.58503544", "0.5847024", "0.58239377", "0.5810564", "0.5810089", "0.5806823", "0.5806823", "0.5800025", "0.5792378", "0.5792378", "0.5792378", "0.5792378", "0.5792378", "0.5792378", "0.5790187", "0.5789414", "0.5787092", "0.57844025", "0.57844025", "0.5774479", "0.5774479", "0.5774479", "0.5774479", "0.5774479", "0.5761362", "0.57596046", "0.57596046", "0.575025", "0.575025", "0.575025", "0.5747959", "0.57337177", "0.57337177", "0.57337177", "0.5721452", "0.5715831", "0.57142824", "0.57140535", "0.57140535", "0.57140535", "0.57140535", "0.57140535", "0.57140535", "0.57140535", "0.5711723", "0.57041645", "0.56991017", "0.5696783", "0.56881124", "0.56774884", "0.56734604", "0.56728", "0.56696945", "0.5661323", "0.5657007", "0.5655942", "0.5655942", "0.5655942", "0.56549734", "0.5654792", "0.5652974", "0.5650185" ]
0.0
-1
TODO Autogenerated method stub
@Override public boolean isEnabled() { return false; }
{ "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 getExras() {\n\n\t}", "@Override\r\n\tpublic void anularFact() {\n\t\t\r\n\t}", "@Override\n\tpublic void entrenar() {\n\t\t\n\t}", "@Override\n\tpublic void nadar() {\n\t\t\n\t}", "@Override\r\n\tpublic void tires() {\n\t\t\r\n\t}", "@Override\r\n\t\t\tpublic void ayuda() {\n\r\n\t\t\t}", "@Override\n\tprotected void interr() {\n\t}", "@Override\n\tpublic void emprestimo() {\n\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\tpublic void grabar() {\n\t\t\n\t}", "@Override\n\tpublic void gravarBd() {\n\t\t\n\t}", "@Override\r\n\tpublic void rozmnozovat() {\n\t}", "@Override\r\n\tpublic void dormir() {\n\t\t\r\n\t}", "@Override\n protected void getExras() {\n }", "@Override\r\n\tpublic void publierEnchere() {\n\t\t\r\n\t}", "@Override\n\tpublic void nefesAl() {\n\n\t}", "@Override\n\tpublic void ligar() {\n\t\t\n\t}", "@Override\n public void func_104112_b() {\n \n }", "@Override\n\tprotected void initdata() {\n\n\t}", "@Override\n\tpublic void nghe() {\n\n\t}", "@Override\n public void function()\n {\n }", "@Override\n public void function()\n {\n }", "public final void mo51373a() {\n }", "@Override\r\n\tpublic void stehReagieren() {\r\n\t\t//\r\n\t}", "@Override\n public void inizializza() {\n\n super.inizializza();\n }", "@Override\n\tprotected void initData() {\n\t\t\n\t}", "@Override\r\n\t\tpublic void init() {\n\t\t\t\r\n\t\t}", "@Override\n\tpublic void sacrifier() {\n\t\t\n\t}", "@Override\r\n\tprotected void InitData() {\n\t\t\r\n\t}", "public void designBasement() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void initialize() {\r\n\t\t\r\n\t\t\r\n\t}", "public void gored() {\n\t\t\n\t}", "@Override\r\n\tprotected void initData() {\n\r\n\t}", "@Override\n\tpublic void einkaufen() {\n\t}", "@Override\n protected void initialize() {\n\n \n }", "public void mo38117a() {\n }", "@Override\n\tprotected void getData() {\n\t\t\n\t}", "Constructor() {\r\n\t\t \r\n\t }", "@Override\r\n\tpublic void dibujar() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void dibujar() {\n\t\t\r\n\t}", "@Override\n\tpublic void one() {\n\t\t\n\t}", "@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}", "private stendhal() {\n\t}", "@Override\n\tprotected void update() {\n\t\t\n\t}", "@Override\n\t\t\tpublic void ic() {\n\t\t\t\t\n\t\t\t}", "@Override\n\tprotected void initData() {\n\n\t}", "@Override\n\tprotected void initData() {\n\n\t}", "@Override\n\tpublic void init() {\n\t\t\n\t}", "@Override\n\tpublic void init() {\n\t\t\n\t}", "@Override\n\tpublic void init() {\n\t\t\n\t}", "@Override\n\tpublic void init() {\n\t\t\n\t}", "@Override\n\tpublic void init() {\n\t\t\n\t}", "@Override\n public void init() {\n\n }", "@Override\n\tprotected void initialize() {\n\t\t\n\t}", "@Override\n\tprotected void initialize() {\n\t\t\n\t}", "@Override\r\n\tpublic void init() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void init() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void init() {\n\t\t\r\n\t}", "@Override\n\tpublic void debite() {\n\t\t\n\t}", "@Override\r\n\tpublic void init() {\n\r\n\t}", "@Override\r\n\tpublic void init() {\n\r\n\t}", "@Override\r\n\tpublic void init() {\n\r\n\t}", "public contrustor(){\r\n\t}", "@Override\n\tprotected void initialize() {\n\n\t}", "@Override\r\n\tpublic void dispase() {\n\r\n\t}", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "@Override\n\tpublic void dtd() {\n\t\t\n\t}", "@Override\n\tprotected void logic() {\n\n\t}", "@Override\n\tprotected void lazyLoad() {\n\t\t\n\t}", "public void mo4359a() {\n }", "@Override\r\n\tprotected void initialize() {\n\r\n\t}", "@Override\n public void memoria() {\n \n }", "@Override\n\t\tpublic void method() {\n\t\t\t\n\t\t}", "private RepositorioAtendimentoPublicoHBM() {\r\t}", "@Override\n protected void initialize() \n {\n \n }", "@Override\r\n\tpublic void getProposition() {\n\r\n\t}", "@Override\n\tpublic void particular1() {\n\t\t\n\t}", "@Override\n\tpublic void init() {\n\n\t}", "@Override\n\tpublic void init() {\n\n\t}", "@Override\n\tpublic void init() {\n\n\t}", "@Override\n protected void prot() {\n }", "@Override\r\n\tpublic void init()\r\n\t{\n\t}", "@Override\n\tprotected void initValue()\n\t{\n\n\t}", "public void mo55254a() {\n }" ]
[ "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.6080161", "0.6077022", "0.6041561", "0.6024072", "0.6020252", "0.59984857", "0.59672105", "0.59672105", "0.5965777", "0.59485507", "0.5940904", "0.59239364", "0.5910017", "0.5902906", "0.58946234", "0.5886006", "0.58839184", "0.58691067", "0.5857751", "0.58503544", "0.5847024", "0.58239377", "0.5810564", "0.5810089", "0.5806823", "0.5806823", "0.5800025", "0.5792378", "0.5792378", "0.5792378", "0.5792378", "0.5792378", "0.5792378", "0.5790187", "0.5789414", "0.5787092", "0.57844025", "0.57844025", "0.5774479", "0.5774479", "0.5774479", "0.5774479", "0.5774479", "0.5761362", "0.57596046", "0.57596046", "0.575025", "0.575025", "0.575025", "0.5747959", "0.57337177", "0.57337177", "0.57337177", "0.5721452", "0.5715831", "0.57142824", "0.57140535", "0.57140535", "0.57140535", "0.57140535", "0.57140535", "0.57140535", "0.57140535", "0.5711723", "0.57041645", "0.56991017", "0.5696783", "0.56881124", "0.56774884", "0.56734604", "0.56728", "0.56696945", "0.5661323", "0.5657007", "0.5655942", "0.5655942", "0.5655942", "0.56549734", "0.5654792", "0.5652974", "0.5650185" ]
0.0
-1
Created by Erwin on 5/15/2017. Holds the methods that will be automatically fired when the corresponding key is pressed
public interface IKeyHandler { void onButtonPressed(); void onButtonReleased(); void onLeftButton(); void onRightButton(); void onBackButton(); void onMenuButton(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Override\r\n\tpublic void keyPressed(KeyEvent keyPressed)\r\n\t{\r\n\t\t\r\n\t}", "@Override\r\n\tpublic void keyPressed(KeyEvent key) {\r\n\t\t// Invoke method if the key is pressed. \r\n\t\t// Do nothing, not all three methods need to be used. \r\n\t}", "@Override\n\t\t\tpublic void keyPressed(KeyEvent arg0) {\n\t\t\t\t\n\t\t\t}", "@Override\n\tpublic void keyPressed() {\n\t\t\n\t}", "@Override\n public void onKeyPressed(KeyEvent event) {\n }", "public abstract void keyPressed(int key);", "@Override\n\t\tpublic void keyPressed(KeyEvent arg0) {\n\t\t\t\n\t\t}", "@Override\n\t\t\t\tpublic void keyPressed(KeyEvent arg0)\n\t\t\t\t{\n\t\t\t\t\t\n\t\t\t\t}", "public void keyPressed(KeyEvent e) { }", "@Override\n\tpublic void keyPressed(KeyEvent arg0) {\n\t\t\n\t}", "@Override\n\tpublic void keyPressed(KeyEvent arg0) {\n\t\t\n\t}", "@Override\n\tpublic void keyPressed(KeyEvent arg0) {\n\t\t\n\t}", "@Override\n\tpublic void keyPressed(KeyEvent arg0) {\n\t\t\n\t}", "@Override\r\n\t\t\tpublic void keyPressed(KeyEvent arg0)\r\n\t\t\t{\n\t\t\t\t\r\n\t\t\t}", "@Override\r\n\tpublic void keyPressed(KeyEvent arg0) {\r\n\t}", "public void keyPressed( KeyEvent e ) { }", "@Override\n\tpublic void keyPressed(KeyEvent arg0)\n\t{\n\t\t\n\t}", "@Override\r\n\t\t\tpublic void keyPressed(KeyEvent arg0) {\n\t\t\t}", "@Override\n\t\t\tpublic void keyPressed(KeyEvent e) {\n\t\t\t\t\n\t\t\t}", "@Override\n\t\t\tpublic void keyPressed(KeyEvent e) {\n\t\t\t\t\n\t\t\t}", "@Override\n\t\t\tpublic void keyPressed(KeyEvent e) {\n\t\t\t\t\n\t\t\t}", "@Override\n\t\t\t\t\t\t\t\t\t\t\tpublic void keyPressed(KeyEvent e) {\n\n\t\t\t\t\t\t\t\t\t\t\t}", "@Override\n public void keyPressed(KeyEvent e) {}", "@Override\n\tpublic void keyPressed(KeyEvent evt) {\n\t\t\n\t}", "@Override\n public void keyPressed(KeyEvent e) {\n \n \n }", "@Override\n\tpublic void keyPressed(KeyEvent arg0) {\n\n\t}", "@Override\n\tpublic void keyPressed(KeyEvent arg0) {\n\n\t}", "@Override\n\tpublic void keyPressed(KeyEvent arg0) {\n\n\t}", "@Override\n\tpublic void keyPressed(KeyEvent arg0) {\n\n\t}", "@Override\n public void keyPressed(KeyEvent e) {\n\n\n }", "void bindKeys() {\n // ahh, the succinctness of java\n KeyboardFocusManager kfm = KeyboardFocusManager.getCurrentKeyboardFocusManager();\n\n kfm.addKeyEventDispatcher( new KeyEventDispatcher() {\n public boolean dispatchKeyEvent(KeyEvent e) {\n String action=null;\n if(e.getID() != KeyEvent.KEY_PRESSED) \n return false;\n if(e.getModifiers() != 0)\n return false;\n switch(e.getKeyCode()) {\n case KeyEvent.VK_UP:\n action = \"forward\";\n movingForward=true;\n turnval = 0;\n break;\n case KeyEvent.VK_DOWN:\n action=\"backward\";\n movingForward=false;\n turnval = 0;\n break;\n case KeyEvent.VK_LEFT:\n if(movingForward) {\n turnval = (turnval==0) ? 100 : turnval-turnval/2;\n if(turnval<10) { action=\"spinleft\"; turnval=0; }\n else action = \"turn\"+turnval;\n }\n else action = \"spinleft\";\n //action = (movingForward) ? \"turn100\" : \"spinleft\";\n break;\n case KeyEvent.VK_RIGHT:\n if(movingForward) {\n turnval = (turnval==0) ? -100 : turnval-turnval/2;\n if(turnval>-10) { action=\"spinright\"; turnval=0; }\n else action = \"turn\"+turnval;\n }\n else action = \"spinright\";\n //action = (movingForward) ? \"turn-100\" : \"spinright\";\n break;\n case KeyEvent.VK_SPACE:\n action=\"stop\";\n movingForward=false;\n turnval = 0;\n break;\n case KeyEvent.VK_L:\n action=\"blink-leds\";\n break;\n case KeyEvent.VK_R:\n action=\"reset\";\n break;\n case KeyEvent.VK_T:\n action=\"test\";\n break;\n case KeyEvent.VK_V:\n vacuuming = !vacuuming;\n action = (vacuuming) ? \"vacuum-on\":\"vacuum-off\";\n break;\n case KeyEvent.VK_1:\n action=\"50\";\n break;\n case KeyEvent.VK_2:\n action=\"100\";\n break;\n case KeyEvent.VK_3:\n action=\"150\";\n break;\n case KeyEvent.VK_4:\n action=\"250\";\n break;\n case KeyEvent.VK_5:\n action=\"400\";\n break;\n case KeyEvent.VK_6:\n action=\"500\";\n break;\n }\n\n if(action!=null)\n getCurrentTab().actionPerformed(new ActionEvent(this,0,action));\n //System.out.println(\"process '\"+e.getKeyCode()+\"' \"+e);\n return true;\n } \n });\n }", "@Override\r\n\tpublic void keyPressed(KeyEvent arg0) {\n\t\t\r\n\t}", "@Override\r\n\tpublic void keyPressed(KeyEvent arg0) {\n\t\t\r\n\t}", "@Override\r\n\tpublic void keyPressed(KeyEvent arg0) {\n\t\t\r\n\t}", "@Override\r\n\tpublic void keyPressed(KeyEvent arg0) {\n\t\t\r\n\t}", "@Override\r\n\tpublic void keyPressed(KeyEvent arg0) {\n\t\t\r\n\t}", "public void keyPressed(KeyEvent e) {}", "@Override\r\n public void keyPressed(KeyEvent e) {\n }", "@Override\n public void keyPressed(KeyEvent e) {\n }", "@Override\n public void keyPressed(KeyEvent e) {\n }", "@Override\n public void keyPressed(KeyEvent e) {\n }", "@Override\n public void keyPressed(KeyEvent e) {\n }", "@Override\n public void keyPressed(KeyEvent e) {\n }", "@Override\n public void keyPressed(KeyEvent e) {\n }", "@Override\n public void keyPressed(KeyEvent e) {\n }", "@Override\n public void keyPressed(KeyEvent e) {\n }", "@Override\n public void keyPressed(KeyEvent e) {\n\n }", "@Override\n public void keyPressed(KeyEvent e) {\n\n }", "@Override\r\n public void keyPressed(KeyEvent e) {\n \r\n }", "void keyPressed(int keycode);", "@Override\n\t\t\tpublic void keyPressed(KeyEvent e) {\n\n\t\t\t}", "@Override\n\t\t\tpublic void keyPressed(KeyEvent e) {\n\n\t\t\t}", "@Override\n\t\t\tpublic void keyPressed(KeyEvent e) {\n\n\t\t\t}", "@Override\n\t\t\tpublic void keyPressed(KeyEvent e) {\n\n\t\t\t}", "@Override\n\t\t\tpublic void keyPressed(KeyEvent e) {\n\n\t\t\t}", "@Override\n\t\t\tpublic void keyPressed(KeyEvent e) {\n\n\t\t\t}", "@Override\n\t\t\tpublic void keyPressed(KeyEvent e) {\n\n\t\t\t}", "@Override\n\t\t\tpublic void keyPressed(KeyEvent e) {\n\n\t\t\t}", "@Override\n\t\t\tpublic void keyPressed(KeyEvent e) {\n\n\t\t\t}", "@Override\n\t\t\tpublic void keyPressed(KeyEvent e) {\n\n\t\t\t}", "@Override\n\t\t\tpublic void keyPressed(KeyEvent e) {\n\n\t\t\t}", "@Override\n\t\t\tpublic void keyPressed(KeyEvent e) {\n\n\t\t\t}", "@Override\n\t\t\tpublic void keyPressed(KeyEvent e) {\n\n\t\t\t}", "@Override\n\t\t\tpublic void keyPressed(KeyEvent e) {\n\n\t\t\t}", "@Override\n\t\t\tpublic void keyPressed(KeyEvent e) {\n\n\t\t\t}", "@Override\n\t\t\tpublic void keyPressed(KeyEvent e) {\n\n\t\t\t}", "@Override\n\t\t\tpublic void keyPressed(KeyEvent e) {\n\n\t\t\t}", "@Override\n public void keyPressed(KeyEvent e) {\n }", "@Override\r\n\tpublic void keyPressed(KeyEvent e) {\n\t}", "@Override\r\n public void keyPressed(KeyEvent ke) {\n }", "@Override\r\n public void keyPressed(KeyEvent e) {\r\n\r\n }", "@Override\n\tpublic void keyPressed(KeyEvent e) {\n\t\n\t}", "@Override\n public void keyPressed(KeyEvent e) {\n }", "@Override\n public void keyPressed(KeyEvent e) {\n }", "@Override\n public void keyPressed(KeyEvent e) {\n }", "void keyPressed(int keyCode);", "@Override\r\n public void keyPressed( KeyEvent cIniKeyEvent)\r\n {\n }", "@Override\n\tpublic void keyPressed(KeyEvent e) {\n\t}", "@Override\n\tpublic void keyPressed(KeyEvent e) {\n\t}", "@Override\r\n\t\t\tpublic void keyPressed(KeyEvent e) {\n\t\t\t\t\r\n\t\t\t}", "@Override\r\n public void keyPressed(KeyEvent e) {\n\r\n }", "@Override\n\tpublic void keyPressed(KeyEvent e) {\n\t\t\n\t}", "@Override\n\tpublic void keyPressed(KeyEvent e) {\n\t\t\n\t}", "@Override\n\tpublic void keyPressed(KeyEvent e) {\n\t\t\n\t}", "@Override\n\tpublic void keyPressed(KeyEvent e) {\n\t\t\n\t}", "@Override\n\tpublic void keyPressed(KeyEvent e) {\n\t\t\n\t}", "@Override\n\tpublic void keyPressed(KeyEvent e) {\n\t\t\n\t}", "@Override\n\tpublic void keyPressed(KeyEvent e) {\n\t\t\n\t}", "@Override\n\tpublic void keyPressed(KeyEvent e) {\n\t\t\n\t}", "@Override\n\tpublic void keyPressed(KeyEvent e) {\n\t\t\n\t}", "public void addKeyListeners() {\n\t\t\tkeyAdapter = new KeyAdapter(){\n\t\t\t\t@Override\n\t\t\t\tpublic void keyPressed(KeyEvent e){\n\t\t\t\t\tchar command;\n\t\t\t\t\tif (e.getKeyCode() == KeyEvent.VK_SHIFT) {\n//\t\t\t\t\t\tSystem.out.println(\"FORWARD\");\n\t\t\t\t\t\tcommand = 'F';\n\t\t\t\t\t} else if (e.getKeyCode() == KeyEvent.VK_RIGHT) {\n//\t\t\t\t\t\tSystem.out.println(\"TURN RIGHT\");\n\t\t\t\t\t\tcommand = 'R';\n\t\t\t\t\t} else if (e.getKeyCode() == KeyEvent.VK_LEFT){\n//\t\t\t\t\t\tSystem.out.println(\"TURN LEFT\");\n\t\t\t\t\t\tcommand = 'L';\n\t\t\t\t\t//Let's disable 'F', 'R' and 'L' keys because they're captured by the arrow keys above\n\t\t\t\t\t} else if (e.getKeyCode() == KeyEvent.VK_F || e.getKeyCode() == KeyEvent.VK_R || e.getKeyCode() == KeyEvent.VK_L) {\n\t\t\t\t\t\tcommand = '-';\t//this signifies an invalid command.\n\t\t\t\t\t} else {\n\t\t\t\t\t\tcommand = Character.toUpperCase(e.getKeyChar());\n\t\t\t\t\t}\n\n\n\t\t\t\t\tif (currentState == GameState.PLAYING) {\n\t\t\t\t\t\t//If this is tutorial mode, check status first to see if this action should be allowed at all.\n\t\t\t\t\t\t//If not approved, end this method immediately\n\t\t\t\t\t\tif (SAR.this.isTutorialMode()) {\n\t\t\t\t\t\t\tboolean actionApproved = tutorial.checkTutorialActionApproved(command);\n\t\t\t\t\t\t\tif (!actionApproved) return;\n\t\t\t\t\t\t} else if (SAR.this.isPracticeMissionHumanMode()) {\n\t\t\t\t\t\t\tboolean actionApproved = practiceDrillHuman.checkMissionActionApproved(command);\n\t\t\t\t\t\t\tif (!actionApproved) return;\n\t\t\t\t\t\t} else if (SAR.this.isPracticeMissionAIMode()) {\n\t\t\t\t\t\t\tboolean actionApproved = practiceDrillAI.checkMissionActionApproved(command);\n\t\t\t\t\t\t\tif (!actionApproved) return;\n\t\t\t\t\t\t} else if (SAR.this.isFinalMissionMode()){\n\t\t\t\t\t\t\tif (!finalMission.checkMissionActionApproved(command)) return;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t//Depending on whether the control mode is \"H\" for manual control only, \"R\" for automated control only,\n\t\t\t\t\t\t//or \"B\" for both modes enabled, certain commands will be disabled / enabled accordingly.\n\t\t\t\t\t\t//For instance, in mode \"R\", only the spacebar command will be recognized.\n\t\t\t\t\t\tif ( (\"H\".contains(SAR.this.controlMode) && \"FRLGSQO\" .contains(String.valueOf(command))) ||\n\t\t\t\t\t\t\t (\"R\".contains(SAR.this.controlMode) && \" \" .contains(String.valueOf(command))) ||\n\t\t\t\t\t\t\t (\"B\".contains(SAR.this.controlMode) && \"FRLGSQO \".contains(String.valueOf(command))) ) {\n\t\t\t\t\t\t\tboolean validKeyTyped = updateGame(currentPlayer, command, 0); // invoke update method with the given command\n\t\t\t\t\t\t\t// Switch player (in the event that we have a 2-player mission)\n\t\t\t\t\t\t\tif(validKeyTyped) {\n\t\t\t\t\t\t\t\tSAR.this.numOfMoves++;\n\t\t\t\t\t\t\t\tPlayer nextPlayer = (currentPlayer == h1 ? h2 : h1);\n\t\t\t\t\t\t\t\tif (nextPlayer.isAlive())\n\t\t\t\t\t\t\t\t\tcurrentPlayer = nextPlayer;\n//\t\t\t\t\t\t\t\tSystem.out.printf(\"Total no. of moves so far: %s\\n\", numOfMoves);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\t//end nested if\n\n\t\t\t\t\t\t//If we're in tutorial mode, we need to check to see\n\t\t\t\t\t\t//if user has completed what the tutorial asked them to do\n\t\t\t\t\t\tif (SAR.this.isTutorialMode()) {\n\t\t\t\t\t\t\ttutorial.checkTutorialStatus(String.valueOf(command));\n\t\t\t\t\t\t}\n\t\t\t\t\t} else if (Character.toUpperCase(command) == 'A') { // this command can be used when mission is over to restart mission\n\t\t\t\t\t\tif (SAR.this.isTutorialMode()) {\n\t\t\t\t\t\t\tinitTutorial();\t//If this was a tutorial mode, restart the same tutorial\n//\t\t\t\t\t\t\ttutorial = new Tutorial(SAR.this);\n\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse initMission();\t\t\t\t\t\t\t\t\t//otherwise, initialize mission again\n\t\t\t\t\t} else if(Character.toUpperCase(command) == 'O' && !SAR.this.isTutorialOrMissionMode()) {\t// open options window as long as this isn't' tutorial mode\n\t\t\t\t\t\topenOptionsWindow();\t//custom method\n\t\t\t\t\t}\n\t\t\t\t\t// Refresh the drawing canvas\n\t\t\t\t\trepaint(); // Call-back paintComponent().\n\n\t\t\t\t}\n\t\t\t\t//end public void keyPressed\n\t\t\t};\n\t\t\t//end keyAdapter initialization\n\t\t\taddKeyListener(keyAdapter);\n\t\t}", "@Override\r\n public void keyTyped(KeyEvent ke) {\r\n //To change body of generated methods, choose Tools | Templates.\r\n }", "@Override\r\n\t\tpublic void keyPressed(KeyEvent e) {\n\t\t}", "@Override\n\tpublic void keyPressed(KeyEvent e) {\n\n\t}", "@Override\n\tpublic void keyPressed(KeyEvent e) {\n\n\t}", "@Override\n\tpublic void keyPressed(KeyEvent e) {\n\n\t}", "@Override\n\tpublic void keyPressed(KeyEvent e) {\n\n\t}", "private void initKeys() {\n app.getInputManager().addMapping(\"Drag\", new MouseButtonTrigger(MouseInput.BUTTON_LEFT));\n app.getInputManager().addMapping(\"Left\", new MouseAxisTrigger(MouseInput.AXIS_X, true));\n app.getInputManager().addMapping(\"Right\", new MouseAxisTrigger(MouseInput.AXIS_X, false));\n app.getInputManager().addMapping(\"Up\", new MouseAxisTrigger(MouseInput.AXIS_Y, true));\n app.getInputManager().addMapping(\"Down\", new MouseAxisTrigger(MouseInput.AXIS_Y, false));\n app.getInputManager().addMapping(\"defaultCamPosition\", new KeyTrigger(KeyInput.KEY_MINUS));\n\n app.getInputManager().addMapping(\"camZOOM_Wheel_Minus\", new MouseAxisTrigger(MouseInput.AXIS_WHEEL, true));\n app.getInputManager().addMapping(\"camZOOM_Wheel_Plus\", new MouseAxisTrigger(MouseInput.AXIS_WHEEL, false));\n\n app.getInputManager().addListener(actionListener, \"defaultCamPosition\" , \"Drag\" );\n app.getInputManager().addListener(analogListener, \"Left\", \"Right\", \"Up\", \"Down\" , \"camZOOM_Wheel_Minus\" , \"camZOOM_Wheel_Plus\");\n }", "@Override\r\n\tpublic void keyPressed(KeyEvent e) {\n\r\n\t}", "@Override\r\n\tpublic void keyPressed(KeyEvent e) {\n\r\n\t}" ]
[ "0.73431593", "0.7282295", "0.720773", "0.72034746", "0.7193964", "0.7164124", "0.7150781", "0.71386313", "0.7120534", "0.70753026", "0.70753026", "0.70753026", "0.70753026", "0.7074603", "0.70599896", "0.7057842", "0.70521563", "0.7048366", "0.7041637", "0.7041637", "0.7041637", "0.70358855", "0.70315236", "0.7029703", "0.7026339", "0.7023719", "0.7023719", "0.7023719", "0.7023719", "0.7022465", "0.7021281", "0.7011505", "0.7011505", "0.7011505", "0.7011505", "0.7011505", "0.70079994", "0.7005891", "0.7002706", "0.7002706", "0.7002706", "0.7002706", "0.7002706", "0.7002706", "0.7002706", "0.7002706", "0.6998531", "0.6998531", "0.69910514", "0.698586", "0.6985653", "0.6985653", "0.6985653", "0.6985653", "0.6985653", "0.6985653", "0.6985653", "0.6985653", "0.6985653", "0.6985653", "0.6985653", "0.6985653", "0.6985653", "0.6985653", "0.6985653", "0.6985653", "0.6985653", "0.6981502", "0.6963972", "0.69560426", "0.69540536", "0.695328", "0.6951676", "0.6951676", "0.6951676", "0.69463074", "0.69434416", "0.69426835", "0.69426835", "0.6939457", "0.69312775", "0.6924137", "0.6924137", "0.6924137", "0.6924137", "0.6924137", "0.6924137", "0.6924137", "0.6924137", "0.6924137", "0.6918811", "0.6916292", "0.69156665", "0.69096506", "0.69096506", "0.69096506", "0.69096506", "0.69081366", "0.69079065", "0.69079065" ]
0.70570725
16
Initialize the contents of the frame.
private void initialize() { frame = new JFrame("Simple Calculator By Sakib"); frame.setBounds(100, 100, 450, 300); frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); frame.setResizable(false); frame.getContentPane().setLayout(null); frame.setIconImage(Toolkit.getDefaultToolkit().getImage(getClass().getResource("cal.png"))); textField = new JTextField(); textField.setFont(new Font("Tahoma", Font.PLAIN, 18)); textField.setHorizontalAlignment(SwingConstants.RIGHT); textField.setBounds(0, 0, 444, 65); frame.getContentPane().add(textField); textField.setColumns(10); final JButton btn7 = new JButton("7"); btn7.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent arg0) { if(Flag==false) { textField.setText(btn7.getText() ); Flag=true; } else { String G=textField.getText(); if(G.equals("0")) textField.setText(btn7.getText()) ; else { String Number=textField.getText()+ btn7.getText(); textField.setText(Number ); } } } }); btn7.setFont(new Font("Tahoma", Font.PLAIN, 18)); btn7.setBounds(0, 64, 115, 50); frame.getContentPane().add(btn7); final JButton btn8 = new JButton("8"); btn8.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent arg0) { if(Flag==false) { textField.setText(btn8.getText() ); Flag=true; } else { String G=textField.getText(); if(G.equals("0")) textField.setText(btn8.getText()) ; else { String Number=textField.getText()+ btn8.getText(); textField.setText(Number ); } } } }); btn8.setFont(new Font("Tahoma", Font.PLAIN, 18)); btn8.setBounds(113, 64, 115, 50); frame.getContentPane().add(btn8); final JButton btn9 = new JButton("9"); btn9.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent arg0) { if(Flag==false) { textField.setText(btn9.getText() ); Flag=true; } else { String G=textField.getText(); if(G.equals("0")) textField.setText(btn9.getText()) ; else { String Number=textField.getText()+ btn9.getText(); textField.setText(Number ); } } } }); btn9.setFont(new Font("Tahoma", Font.PLAIN, 18)); btn9.setBounds(227, 64, 104, 50); frame.getContentPane().add(btn9); final JButton btnP = new JButton("+"); btnP.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent arg0) { if(textField.getText().length()==0) textField.setText(""); else { firstnum=Double.parseDouble(textField.getText()); textField.setText(""); Operation="+"; } } }); btnP.setFont(new Font("Tahoma", Font.PLAIN, 18)); btnP.setBounds(330, 64, 114, 50); frame.getContentPane().add(btnP); // final JButton btn4 = new JButton("4"); btn4.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent arg0) { if(Flag==false) { textField.setText(btn4.getText() ); Flag=true; } else { String G=textField.getText(); if(G.equals("0")) textField.setText(btn4.getText()) ; else { String Number=textField.getText()+ btn4.getText(); textField.setText(Number ); } } } }); btn4.setFont(new Font("Tahoma", Font.PLAIN, 18)); btn4.setBounds(0, 110, 115, 50); frame.getContentPane().add(btn4); final JButton btn5 = new JButton("5"); btn5.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent arg0) { if(Flag==false) { textField.setText(btn5.getText() ); Flag=true; } else { String G=textField.getText(); if(G.equals("0")) textField.setText(btn5.getText()) ; else { String Number=textField.getText()+ btn5.getText(); textField.setText(Number ); } } } }); btn5.setFont(new Font("Tahoma", Font.PLAIN, 18)); btn5.setBounds(113, 110, 115, 50); frame.getContentPane().add(btn5); final JButton btn6 = new JButton("6"); btn6.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent arg0) { if(Flag==false) { textField.setText(btn6.getText() ); Flag=true; } else { String G=textField.getText(); if(G.equals("0")) textField.setText(btn6.getText()) ; else { String Number=textField.getText()+ btn6.getText(); textField.setText(Number ); } } } }); btn6.setFont(new Font("Tahoma", Font.PLAIN, 18)); btn6.setBounds(227, 110, 104, 50); frame.getContentPane().add(btn6); final JButton btnS = new JButton("-"); btnS.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent arg0) { if(textField.getText().length()==0) textField.setText(""); else { firstnum=Double.parseDouble(textField.getText()); textField.setText(""); Operation="-"; } } }); btnS.setFont(new Font("Tahoma", Font.PLAIN, 18)); btnS.setBounds(330, 110, 114, 50); frame.getContentPane().add(btnS); // final JButton btn1 = new JButton("1"); btn1.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent arg0) { if(Flag==false) { textField.setText(btn1.getText() ); Flag=true; } else { String G=textField.getText(); if(G.equals("0")) textField.setText(btn1.getText()) ; else { String Number=textField.getText()+ btn1.getText(); textField.setText(Number ); } } } }); btn1.setFont(new Font("Tahoma", Font.PLAIN, 18)); btn1.setBounds(0, 158, 115, 50); frame.getContentPane().add(btn1); final JButton btn2 = new JButton("2"); btn2.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent arg0) { if(Flag==false) { textField.setText(btn2.getText() ); Flag=true; } else { String G=textField.getText(); if(G.equals("0")) textField.setText(btn2.getText()) ; else { String Number=textField.getText()+ btn2.getText(); textField.setText(Number ); } } } }); btn2.setFont(new Font("Tahoma", Font.PLAIN, 18)); btn2.setBounds(113, 158, 115, 50); frame.getContentPane().add(btn2); final JButton btn3 = new JButton("3"); btn3.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent arg0) { if(Flag==false) { textField.setText(btn3.getText() ); Flag=true; } else { String G=textField.getText(); if(G.equals("0")) textField.setText(btn3.getText()) ; else { String Number=textField.getText()+ btn3.getText(); textField.setText(Number ); } } } }); btn3.setFont(new Font("Tahoma", Font.PLAIN, 18)); btn3.setBounds(227, 158, 104, 50); frame.getContentPane().add(btn3); final JButton btnM = new JButton("*"); btnM.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent arg0) { if(textField.getText().length()==0) textField.setText(""); else { firstnum=Double.parseDouble(textField.getText()); textField.setText(""); Operation="*"; } } }); btnM.setFont(new Font("Tahoma", Font.PLAIN, 18)); btnM.setBounds(330, 158, 114, 50); frame.getContentPane().add(btnM); // final JButton btn0 = new JButton("0"); btn0.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent arg0) { if(Flag==false) { textField.setText(btn0.getText() ); Flag=true; } else { String G=textField.getText(); if(G.equals("0")) textField.setText(btn0.getText()) ; else { String Number=textField.getText()+ btn0.getText(); textField.setText(Number ); } } } }); btn0.setFont(new Font("Tahoma", Font.PLAIN, 18)); btn0.setBounds(0, 206, 115, 66); frame.getContentPane().add(btn0); final JButton btnC = new JButton("C"); btnC.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent arg0) { textField.setText(""); } }); btnC.setFont(new Font("Tahoma", Font.PLAIN, 18)); btnC.setBounds(113, 206, 115, 66); frame.getContentPane().add(btnC); JButton btnE = new JButton("="); btnE.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent arg0) { if(textField.getText().length()==0) { textField.setText(""); } else { secondnum=Double.parseDouble(textField.getText()); if(Operation=="+") { int Result=(int) (firstnum+secondnum); Answer=Integer.toString(Result); textField.setText(Answer); } else if(Operation=="-") { int Result=(int) (firstnum-secondnum); Answer=Integer.toString(Result); textField.setText(Answer); } else if(Operation=="*") { int Result=(int) (firstnum*secondnum); Answer=Integer.toString(Result); textField.setText(Answer); } else if(Operation=="/") { result=firstnum/secondnum; Answer=Double.toString(result); textField.setText(Answer); } Flag=false; } } }); btnE.setFont(new Font("Tahoma", Font.PLAIN, 18)); btnE.setBounds(227, 206, 104, 66); frame.getContentPane().add(btnE); final JButton btnD = new JButton("/"); btnD.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent arg0) { if(textField.getText().length()==0) textField.setText(""); else { firstnum=Double.parseDouble(textField.getText()); textField.setText(""); Operation="/"; } } }); btnD.setFont(new Font("Tahoma", Font.PLAIN, 18)); btnD.setBounds(330, 206, 114, 66); frame.getContentPane().add(btnD); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public BreukFrame() {\n super();\n initialize();\n }", "public MainFrame() {\n\t\tsuper();\n\t\tinitialize();\n\t}", "private void initialize() {\n\t\tthis.setSize(211, 449);\n\t\tthis.setContentPane(getJContentPane());\n\t\tthis.setTitle(\"JFrame\");\n\t}", "public SiscobanFrame() {\r\n\t\tsuper();\r\n\t\tinitialize();\r\n\t}", "private void initialize() {\n\t\tframe = new JFrame();\n\t\tframe.setBounds(0, 0, 1100, 800);\n\t\tframe.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);\n\n\t\tsetUIComponents();\n\t\tsetControllers();\n\n\t}", "private void initialize() {\r\n\t\tthis.setSize(530, 329);\r\n\t\tthis.setContentPane(getJContentPane());\r\n\t\tthis.setTitle(\"JFrame\");\r\n\t}", "private void initialize() {\r\n\t\tthis.setSize(300, 200);\r\n\t\tthis.setContentPane(getJContentPane());\r\n\t\tthis.setTitle(\"JFrame\");\r\n\t}", "private void initialize() {\n\t\tframe = new JFrame();\n\t\taddSampleData();\n\t\tsetDefaultSettings();\n\t\topenHomePage();\n\t\tframe.setVisible(true);\n\t}", "private void initialize() {\n\t\tframe = new JFrame(\"Media Inventory\");\r\n\t\tframe.setBounds(100, 100, 450, 300);\r\n\t\tframe.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);\r\n\t}", "private void initialize() {\n\t\tframe = new JFrame();\n\t\tframe.setBounds(0, 0, 1000, 700);\n\t\tframe.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);\n\t\tframe.getContentPane().setLayout(null);\n\t\t\n\t\tframeContent = new JPanel();\n\t\tframe.getContentPane().add(frameContent);\n\t\tframeContent.setBounds(10, 10, 700, 640);\n\t\tframeContent.setLayout(null);\n\t\t\n\t\tinfoPane = new JPanel();\n\t\tframe.getContentPane().add(infoPane);\n\t\tinfoPane.setBounds(710, 10, 300, 640);\n\t\tinfoPane.setLayout(null);\n\t}", "private void initialize() {\n\t\tframe = new JFrame(\"BirdSong\");\n\t\tframe.pack();\n\t\tframe.setVisible(true);\n\t\tframe.setBounds(100, 100, 400, 200);\n\t\tframe.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);\n\n\t\tabc = new BirdPanel();\n\t\ttime = new TimePanel();\n\t\tgetContentPane().setLayout(new BoxLayout(frame, BoxLayout.Y_AXIS));\n\n\t\tframe.getContentPane().add(abc, BorderLayout.NORTH);\n\t\tframe.getContentPane().add(time, BorderLayout.CENTER);\n\t}", "private void initialize() {\r\n\t\tthis.setSize(311, 153);\r\n\t\tthis.setContentPane(getJContentPane());\r\n\t\tthis.setTitle(\"JFrame\");\r\n\t\tsetCancelButton( btnCancel );\r\n\t}", "public Frame() {\n initComponents();\n }", "public Frame() {\n initComponents();\n }", "private void initialize() {\r\n\t\tthis.setSize(497, 316);\r\n\t\tthis.setContentPane(getJContentPane());\r\n\t\tthis.setTitle(\"JFrame\");\r\n\t\tthis.setExtendedState(JFrame.MAXIMIZED_BOTH);\r\n\t\tthis.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);\r\n\t}", "protected HFrame(){\n\t\tinit();\n\t}", "private void initializeFields() {\r\n myFrame = new JFrame();\r\n myFrame.setSize(DEFAULT_SIZE);\r\n }", "private void initialize() {\n\t\tthis.setSize(329, 270);\n\t\tthis.setContentPane(getJContentPane());\n\t}", "private void initialize() {\r\n\t\t//setFrame\r\n\t\tframe = new JFrame();\r\n\t\tframe.setBounds(125,175, 720, 512);\r\n\t\tframe.setTitle(\"Periodic Table\");\r\n\t\tframe.setResizable(false);\r\n\t\tframe.getContentPane().setLayout(null);\r\n\t\tframe.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);\r\n\t}", "private void initFrame() {\n setLayout(new BorderLayout());\n }", "private void initialize() {\n\t\tthis.setSize(300, 300);\n\t\tthis.setIconifiable(true);\n\t\tthis.setClosable(true);\n\t\tthis.setTitle(\"Sobre\");\n\t\tthis.setContentPane(getJContentPane());\n\t\tthis.setFrameIcon(new ImageIcon(\"images/16x16/info16x16.gif\"));\n\t}", "public FrameControl() {\n initComponents();\n }", "private void initialize() {\r\n\t\tframe = new JFrame();\r\n\t\tframe.setBounds(100, 100, 450, 300);\r\n\t\tframe.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);\r\n\t}", "public MainFrame() {\n initComponents();\n \n }", "private void init(Element frame) {\n\t\tthis.frameWidth = Integer.parseInt(frame.attributeValue(\"width\"));\n\t\tthis.frameHeight = Integer.parseInt(frame.attributeValue(\"height\"));\n\t\tthis.paddle = Integer.parseInt(frame.attributeValue(\"paddle\"));\n\t\tthis.size = Integer.parseInt(frame.attributeValue(\"size\"));\n\t}", "public MainFrame() {\n \n initComponents();\n \n this.initNetwork();\n \n this.render();\n \n }", "public internalFrame() {\r\n initComponents();\r\n }", "private void initialize() {\n\t\tthis.setContentPane(getJContentPane());\n\t\tthis.setContentPane(getJContentPane());\n\t\tthis.setSize(810, 600);\n\t\tthis.setContentPane(getJContentPane());\n\t\tthis.setBackground(new java.awt.Color(226,226,222));\n\t\tthis.setDefaultCloseOperation(javax.swing.WindowConstants.DO_NOTHING_ON_CLOSE);\n\t\tthis.setModal(true);\n\t\tthis.setResizable(false);\n\t\tthis.setName(\"FramePrincipalLR\");\n\t\tthis.setTitle(\"CR - Lista de Regalos\");\n\t\tthis.setLocale(new java.util.Locale(\"es\", \"VE\", \"\"));\n\t\tthis.setUndecorated(false);\n\t}", "public Mainframe() {\n initComponents();\n }", "private void initialize() {\r\n\t\tthis.setSize(392, 496);\r\n\t\tthis.setContentPane(getJContentPane());\r\n\t\tthis.setTitle(\"Informações\");\r\n\t}", "private void initialize() {\n this.setSize(253, 175);\n this.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);\n this.setContentPane(getJContentPane());\n this.setTitle(\"Breuken vereenvoudigen\");\n }", "private void initialize() {\r\n\t\t// Initialize main frame\r\n\t\tframe = new JFrame();\r\n\t\tframe.setBounds(Constants.C_MAIN_PREFERED_POSITION_X_AT_START, Constants.C_MAIN_PREFERED_POSITION_Y_AT_START, \r\n\t\t\t\tConstants.C_MAIN_PREFERED_SIZE_X, Constants.C_MAIN_PREFERED_SIZE_Y);\r\n\t\tframe.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);\r\n\t\tframe.setTitle(Constants.C_MAIN_WINDOW_TITLE);\r\n\t\t\r\n\t\t// Tab panel and their panels\r\n\t\tmainTabbedPane = new JTabbedPane(JTabbedPane.TOP);\r\n\t\tframe.getContentPane().add(mainTabbedPane, BorderLayout.CENTER);\r\n\t\t\r\n\t\tpanelDecision = new DecisionPanel();\r\n\t\tmainTabbedPane.addTab(Constants.C_TAB_DECISION_TITLE, null, panelDecision, null);\r\n\t\t\r\n\t\tpanelCalculation = new CalculationPanel();\r\n\t\tmainTabbedPane.addTab(Constants.C_TAB_CALCULATION_TITLE, null, panelCalculation, null);\r\n\t\t\r\n\t\tpanelLibrary = new LibraryPanel();\r\n\t\tmainTabbedPane.addTab(Constants.C_TAB_LIBRARY_TITLE, null, panelLibrary, null);\r\n\t\t\r\n\t\t// Menu bar\r\n\t\tmenuBar = new JMenuBar();\r\n\t\tframe.setJMenuBar(menuBar);\r\n\t\tcreateMenus();\r\n\t}", "public void initializeFrame() {\n frame.getContentPane().removeAll();\n createComponents(frame.getContentPane());\n// frame.setSize(new Dimension(1000, 600));\n }", "private void initialize() {\r\n\t\t// this.setSize(271, 295);\r\n\t\tthis.setSize(495, 392);\r\n\t\tthis.setContentPane(getJContentPane());\r\n\t\tthis.setTitle(ResourceBundle.getBundle(\"Etiquetas\").getString(\"MainTitle\"));\r\n\t}", "private void initializeFrame() {\n add(container);\n setDefaultCloseOperation(JFrame.HIDE_ON_CLOSE);\n pack();\n }", "private void initialize() {\n this.setSize(300, 200);\n this.setContentPane(getJContentPane());\n this.pack();\n }", "private void initialize() {\n\t\tframe = new JFrame(\"DB Filler\");\n\t\tframe.setBounds(100, 100, 700, 500);\n\t\tframe.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);\n\n\t\tdbc = new DataBaseConnector();\n\t\tcreateFileChooser();\n\n\t\taddTabbedPane();\n\t\tsl_panel = new SpringLayout();\n\t\taddAddFilePanel();\n\t}", "public mainframe() {\n initComponents();\n }", "public FrameDesign() {\n initComponents();\n }", "public Jframe() {\n initComponents();\n setIndice();\n loadTextBoxs();\n }", "public JGSFrame() {\n\tsuper();\n\tinitialize();\n }", "public MainFrame() {\n initComponents();\n }", "public MainFrame() {\n initComponents();\n }", "public MainFrame() {\n initComponents();\n }", "public MainFrame() {\n initComponents();\n }", "public MainFrame() {\n initComponents();\n }", "public MainFrame() {\n initComponents();\n }", "public MainFrame() {\n initComponents();\n }", "public MainFrame() {\n initComponents();\n }", "public MainFrame() {\n initComponents();\n }", "public MainFrame() {\n initComponents();\n }", "public MainFrame() {\n initComponents();\n }", "public MainFrame() {\n initComponents();\n }", "public MainFrame() {\n try {\n initComponents();\n initElements();\n } catch (Exception e) {\n JOptionPane.showMessageDialog(null, \"Error \" + e.getMessage());\n }\n }", "private void initialize() {\n this.setSize(495, 276);\n this.setTitle(\"Translate Frost\");\n this.setContentPane(getJContentPane());\n }", "private void initialize() {\r\n\t\t// set specific properties and add inner components.\r\n\t\tthis.setBorder(BorderFactory.createEtchedBorder());\r\n\t\tthis.setSize(300, 400);\r\n\t\tthis.setLayout(new BorderLayout());\r\n\t\taddComponents();\r\n\t}", "private void initialize() {\r\n\t\tthis.setBounds(new Rectangle(0, 0, 670, 576));\r\n\t\tthis.setResizable(false);\r\n\t\tthis.setTitle(\"数据入库 \");\r\n\t\tthis.setLocationRelativeTo(getOwner());\r\n\t\tthis.setContentPane(getJContentPane());\r\n\t}", "public void initializePanelToFrame() {\n\t\tnew ColorResources();\n\t\tnew TextResources().changeLanguage();\n\t\tpanel = new JPanel();\n\t\tpanel.setLayout(null);\n\t\tpanel.setPreferredSize(new Dimension(375, 812));\n\n\t\tconfigureLabels();\n\t\tconfigureButtons();\n\t\taddListeners();\n\t\taddComponentsToPanel();\n\n\t\tthis.setContentPane(panel);\n\t\tthis.pack();\n\t}", "private void initialize() {\n this.setLayout(new BorderLayout());\n this.setSize(new java.awt.Dimension(564, 229));\n this.add(getMessagePanel(), java.awt.BorderLayout.NORTH);\n this.add(getBalloonSettingsListBox(), java.awt.BorderLayout.CENTER);\n this.add(getBalloonSettingsButtonPane(), java.awt.BorderLayout.SOUTH);\n\n editBalloonSettingsFrame = new EditBalloonSettingsFrame();\n\n }", "public SMFrame() {\n initComponents();\n updateComponents();\n }", "private void initialize() {\n m_frame = new JFrame(\"Video Recorder\");\n m_frame.setResizable(false);\n m_frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);\n m_frame.setLayout(new BorderLayout());\n m_frame.add(buildContentPanel(), BorderLayout.CENTER);\n\n JPanel buttonPanel = new JPanel(new FlowLayout(FlowLayout.CENTER, 5, 5));\n JButton startButton = new JButton(\"Start\");\n startButton.addActionListener(new ActionListener() {\n @Override\n public void actionPerformed(ActionEvent ae) {\n listen();\n }\n });\n buttonPanel.add(startButton);\n\n m_connectionLabel = new JLabel(\"Disconnected\");\n m_connectionLabel.setOpaque(true);\n m_connectionLabel.setBackground(Color.RED);\n m_connectionLabel.setBorder(BorderFactory.createLineBorder(Color.BLACK, 3));\n m_connectionLabel.setPreferredSize(new Dimension(100, 26));\n m_connectionLabel.setHorizontalAlignment(SwingConstants.CENTER);\n buttonPanel.add(m_connectionLabel);\n\n m_frame.add(buttonPanel, BorderLayout.PAGE_END);\n }", "public FirstNewFrame() {\n\t\tjbInit();\n\t}", "private void initialize() {\n\t\tframe = new JFrame();\n\t\tframe.getContentPane().setBackground(Color.BLACK);\n\t\tframe.setBounds(100, 100, 450, 300);\n\t\tframe.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);\n\t\tframe.getContentPane().setLayout(null);\n\t\t\n\t\tJButton btnNewButton = new JButton(\"Play\");\n\t\tbtnNewButton.setFont(new Font(\"Bodoni 72\", Font.BOLD, 13));\n\t\tbtnNewButton.setBounds(frame.getWidth() / 2 - 60, 195, 120, 30);\n\t\tframe.getContentPane().add(btnNewButton);\n\t\t\n\t\tJLabel lblNewLabel = new JLabel(\"Space Escape\");\n\t\tlblNewLabel.setForeground(Color.WHITE);\n\t\tlblNewLabel.setFont(new Font(\"Bodoni 72\", Font.BOLD, 24));\n\t\tlblNewLabel.setBounds(frame.getWidth() / 2 - 60, 30, 135, 25);\n\t\tframe.getContentPane().add(lblNewLabel);\n\t\t\n\t\tJLabel lblNewLabel_1 = new JLabel(\"New label\");\n\t\tlblNewLabel_1.setBounds(0, 0, frame.getWidth(), frame.getHeight());\n\t\tframe.getContentPane().add(lblNewLabel_1);\n\t}", "private void initializeFrame()\r\n\t{\r\n\t\tthis.setResizable(false);\r\n\r\n\t\tsetSize(DIMENSIONS); // set the correct dimensions\r\n\t\tsetDefaultCloseOperation(EXIT_ON_CLOSE);\r\n\t\tsetLayout( new GridLayout(1,1) );\r\n\t}", "private void setupFrame()\n\t{\n\t\tthis.setContentPane(botPanel);\n\t\tthis.setSize(800,700);\n\t\tthis.setTitle(\"- Chatbot v.2.1 -\");\n\t\tthis.setResizable(true);\n\t\tthis.setVisible(true);\n\t}", "public MainFrame() {\n initComponents();\n setLocationRelativeTo(null);\n }", "public EmulatorFrame() {\r\n\t\tsuper(\"Troyboy Chip8 Emulator\");\r\n\t\t\r\n\t\tsetNativeLAndF();\r\n\t\tinitComponents();\r\n\t\tinitMenubar();\r\n\t\tsetupLayout();\r\n\t\tinitFrame();\r\n\t\t//frame is now ready to run a game\r\n\t\t//running of any games must be started by loading a ROM\r\n\t}", "public void init()\n {\n buildUI(getContentPane());\n }", "private void initialize()\n {\n this.setTitle( \"SerialComm\" ); // Generated\n this.setSize( 500, 300 );\n this.setContentPane( getJContentPane() );\n }", "public launchFrame() {\n \n initComponents();\n \n }", "private void initialize() {\r\n\t\tthis.setSize(378, 283);\r\n\t\tthis.setJMenuBar(getMenubar());\r\n\t\tthis.setContentPane(getJContentPane());\r\n\t\tthis.setTitle(\"JAVIER\");\r\n\t}", "private void initialize() {\n\t\tthis.setSize(430, 280);\n\t\tthis.setContentPane(getJContentPane());\n\t\tthis.setUndecorated(true);\n\t\tthis.setModal(true);\n\t\tthis.setBackground(new java.awt.Color(226,226,222));\n\t\tthis.setTitle(\"Datos del Invitado\");\n\t\tthis.addComponentListener(this);\n\t}", "public PilaFrame() {\n initComponents();\n }", "private void initialize() {\n\t\tframe = new JFrame();\n\t\tframe.setBounds(100, 100, 900, 900);\n\t\tframe.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);\n\t\t\n\t\tgame = new Game();\n\t\t\n\t\tGameTable puzzle = new GameTable(game.getPuzzle());\n\t\tpuzzle.setBounds(100, 100, 700, 700);\n\t\t\n\t\tframe.add(puzzle);\n\t\t\n\t\tSystem.out.println(\"SAD\");\n\t\t\n\t}", "private void initialize() {\r\n\t\tframe = new JFrame();\r\n\t\tframe.setResizable(false);\r\n\t\tframe.setBounds(100, 100, 450, 300);\r\n\t\tframe.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);\r\n\t\tframe.getContentPane().setLayout(null);\r\n\t\t\r\n\t\tPanel mainFramePanel = new Panel();\r\n\t\tmainFramePanel.setBounds(10, 10, 412, 235);\r\n\t\tframe.getContentPane().add(mainFramePanel);\r\n\t\tmainFramePanel.setLayout(null);\r\n\t\t\r\n\t\tfinal TextField textField = new TextField();\r\n\t\ttextField.setBounds(165, 62, 79, 24);\r\n\t\tmainFramePanel.add(textField);\r\n\t\t\r\n\t\tButton changeTextButt = new Button(\"Change Text\");\r\n\t\tchangeTextButt.addActionListener(new ActionListener() {\r\n\t\t\tpublic void actionPerformed(ActionEvent arg0) {\r\n\t\t\t\ttextField.setText(\"Domograf\");\r\n\t\t\t}\r\n\t\t});\r\n\t\tchangeTextButt.setBounds(165, 103, 79, 24);\r\n\t\tmainFramePanel.add(changeTextButt);\r\n\t}", "private void initialize() {\n\t\tframe = new JFrame();\n\t\tframe.setResizable(false);\n\t\tframe.setAlwaysOnTop(true);\n\t\tframe.setBounds(100, 100, 450, 300);\n\t\tframe.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);\n\t\tframe.getContentPane().setLayout(null);\n\t}", "StudentFrame() {\n \tgetContentPane().setFont(new Font(\"Times New Roman\", Font.PLAIN, 11));\n s1 = null; // setting to null\n initializeComponents(); // causes frame components to be initialized\n }", "private void initialize() {\r\n\t\tthis.setSize(300, 200);\r\n\t\tthis.setTitle(\"Error\");\r\n\t\tthis.setContentPane(getJContentPane());\r\n\t}", "public NewFrame() {\n initComponents();\n }", "public SerialCommFrame()\n {\n super();\n initialize();\n }", "public LoginFrame() {\n\t\tsuper();\n\t\tinitialize();\n\t}", "public BaseFrame() {\n initComponents();\n }", "private void initialize() {\r\n\t\tthis.setSize(733, 427);\r\n\t\tthis.setContentPane(getJContentPane());\r\n\t\tthis.setTitle(\"jProxyChecker\");\r\n\t}", "public frame() {\r\n\t\tadd(createMainPanel());\r\n\t\tsetTitle(\"Lunch Date\");\r\n\t\tsetSize(FRAME_WIDTH, FRAME_HEIGHT);\r\n\r\n\t}", "public MercadoFrame() {\n initComponents();\n }", "private void initialize() {\n\t\tframe = new JFrame();\n\t\tframe.setBounds(100, 100, 800, 800);\n\t\tframe.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);\n\t\t\n\t\tJPanel browserPanel = new JPanel();\n\t\tframe.getContentPane().add(browserPanel, BorderLayout.CENTER);\n\t\t\n\t\t// create javafx panel for browser\n browserFxPanel = new JFXPanel();\n browserPanel.add(browserFxPanel);\n \n // create JavaFX scene\n Platform.runLater(new Runnable() {\n public void run() {\n createScene();\n }\n });\n\t}", "private void initialize() {\r\n\t\tframe = new JFrame();\r\n\t\tframe.setBounds(X_FRAME, Y_FRAME, WIDTH_FRAME, HEIGHT_FRAME);\r\n\t\tframe.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);\r\n\t\tframe.getContentPane().setLayout(null);\r\n\t\t\r\n\t\tJButton btnAddSong = new JButton(\"Add song\");\r\n\t\tbtnAddSong.setBounds(X_BTN, Y_ADDSONG, WIDTH_BTN, HEIGHT_BTN);\r\n\t\tframe.getContentPane().add(btnAddSong);\r\n\t\t\r\n\t\tJTextPane txtpnBlancoYNegro = new JTextPane();\r\n\t\ttxtpnBlancoYNegro.setText(\"Blanco y negro\\r\\nThe Spectre\\r\\nGirasoles\\r\\nFaded\\r\\nTu Foto\\r\\nEsencial\");\r\n\t\ttxtpnBlancoYNegro.setBounds(X_TXT, Y_TXT, WIDTH_TXT, HEIGHT_TXT);\r\n\t\tframe.getContentPane().add(txtpnBlancoYNegro);\r\n\t\t\r\n\t\tJLabel lblSongs = new JLabel(\"Songs\");\r\n\t\tlblSongs.setBounds(X_LBL, Y_LBL, WIDTH_LBL, HEIGHT_LBL);\r\n\t\tframe.getContentPane().add(lblSongs);\r\n\t\t\r\n\t\tJButton btnAddAlbum = new JButton(\"Add album\");\r\n\t\tbtnAddAlbum.setBounds(X_BTN, Y_ADDALBUM, WIDTH_BTN, HEIGHT_BTN);\r\n\t\tframe.getContentPane().add(btnAddAlbum);\r\n\t}", "public holdersframe() {\n initComponents();\n }", "public void init() {\n\t\tsetSize(500,300);\n\t}", "private void setupFrame()\n\t\t{\n\t\t\tthis.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);\n\t\t\tthis.setResizable(false);\n\t\t\tthis.setSize(800, 600);\n\t\t\tthis.setTitle(\"SEKA Client\");\n\t\t\tthis.setContentPane(panel);\n\t\t\tthis.setVisible(true);\n\t\t}", "public addStFrame() {\n initComponents();\n }", "public JFrame() {\n initComponents();\n }", "public FrameForm() {\n initComponents();\n }", "private void initialize() {\n\t\tframe = new JFrame(\"View Report\");\n\t\tframe.setBounds(100, 100, 450, 300);\n\t\tframe.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);\n\t\tframe.getContentPane().setLayout(null);\n\n\t\tJButton backButton = new JButton(\"Back\");\n\t\tbackButton.setBounds(176, 227, 89, 23);\n\t\tframe.getContentPane().add(backButton);\n\t\tbackButton.addActionListener(new ActionListener(){\n\t\t\tpublic void actionPerformed(ActionEvent e) {\n\t\t\t\tframe.setVisible(false);\n\t\t\t}\n\t\t});\n\t\t\n\t\tJTextArea textArea = new JTextArea();\n\t\ttextArea.setBounds(50, 30, 298, 173);\n\t\tframe.getContentPane().add(textArea);\n\t\ttextArea.append(control.seeReport());\n\t\tframe.setVisible(true);\n\t}", "private void initialize() {\r\n this.setSize(new Dimension(666, 723));\r\n this.setContentPane(getJPanel());\r\n\t\t\t\r\n\t}", "private void initialize() {\n\t\tframe = new JFrame();\n\t\tframe.getContentPane().setBackground(Color.BLACK);\n\t\tframe.getContentPane().setLayout(null);\n\t\t\n\t\tJLabel lblSubmission = new JLabel(\"Submission\");\n\t\tlblSubmission.setForeground(Color.WHITE);\n\t\tlblSubmission.setFont(new Font(\"Comic Sans MS\", Font.PLAIN, 16));\n\t\tlblSubmission.setBounds(164, 40, 83, 14);\n\t\tframe.getContentPane().add(lblSubmission);\n\t\t\n\t\tJLabel lblTitle = new JLabel(\"Title:\");\n\t\tlblTitle.setForeground(Color.WHITE);\n\t\tlblTitle.setFont(new Font(\"Comic Sans MS\", Font.PLAIN, 14));\n\t\tlblTitle.setBounds(77, 117, 41, 14);\n\t\tframe.getContentPane().add(lblTitle);\n\t\t\n\t\tJLabel lblPath = new JLabel(\"Path:\");\n\t\tlblPath.setForeground(Color.WHITE);\n\t\tlblPath.setFont(new Font(\"Comic Sans MS\", Font.PLAIN, 14));\n\t\tlblPath.setBounds(85, 155, 33, 14);\n\t\tframe.getContentPane().add(lblPath);\n\t\t\n\t\ttitle = new JTextField();\n\t\ttitle.setBounds(128, 116, 197, 20);\n\t\tframe.getContentPane().add(title);\n\t\ttitle.setColumns(10);\n\t\t\n\t\tpath = new JTextField();\n\t\tpath.setBounds(128, 154, 197, 20);\n\t\tframe.getContentPane().add(path);\n\t\tpath.setColumns(10);\n\t\t\n\t\tbtnSubmit = new JButton(\"Submit\");\n\t\tbtnSubmit.setBackground(Color.BLACK);\n\t\tbtnSubmit.setForeground(Color.WHITE);\n\t\tbtnSubmit.setFont(new Font(\"Comic Sans MS\", Font.PLAIN, 14));\n\t\tbtnSubmit.setBounds(158, 210, 89, 23);\n\t\tframe.getContentPane().add(btnSubmit);\n\t\tframe.setBounds(100, 100, 450, 300);\n\t\tframe.setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE);\n\t\tframe.setVisible(true);\n\t}", "public void init() {\r\n\t\t\r\n\t\tsetSize(WIDTH, HEIGHT);\r\n\t\tColor backgroundColor = new Color(60, 0, 60);\r\n\t\tsetBackground(backgroundColor);\r\n\t\tintro = new GImage(\"EvilMehranIntroGraphic.png\");\r\n\t\tintro.setLocation(0,0);\r\n\t\tadd(intro);\r\n\t\tplayMusic(new File(\"EvilMehransLairThemeMusic.wav\"));\r\n\t\tinitAnimationArray();\r\n\t\taddKeyListeners();\r\n\t\taddMouseListeners();\r\n\t\twaitForClick();\r\n\t\tbuildWorld();\r\n\t}", "public FrameIntroGUI() {\n\t\ttry {\n\t\t\tjbInit();\n\t\t}\n\t\tcatch (Exception e) {\n\t\t\te.printStackTrace();\n\t\t}\n\t}", "private void initialize() {\n\t\tthis.setBounds(100, 100, 950, 740);\n\t\tthis.setLayout(null);\n\n\t\n\t}", "private void initialize() {\n\t\tframe = new JFrame();\n\t\tframe.setBounds(100, 100, 450, 300);\n\t\tframe.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);\n\t\tframe.getContentPane().setLayout(null);\n\t\t\n\t\tJLabel lblCoisa = new JLabel(\"Coisa\");\n\t\tlblCoisa.setBounds(10, 11, 46, 14);\n\t\tframe.getContentPane().add(lblCoisa);\n\t\t\n\t\ttextField = new JTextField();\n\t\ttextField.setBounds(39, 8, 86, 20);\n\t\tframe.getContentPane().add(textField);\n\t\ttextField.setColumns(10);\n\t}", "private void initialize() {\n\t\tthis.setExtendedState(Frame.MAXIMIZED_BOTH);\n\t\tthis.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);\n\t\tthis.setResizable(true);\n\t\tthis.screenDimensions = Toolkit.getDefaultToolkit().getScreenSize();\n\t\tthis.getContentPane().setLayout(new BorderLayout());\n\t\t// Initialize SubComponents and GUI Commands\n\t\tthis.initializeSplitPane();\n\t\tthis.initializeExplorer();\n\t\tthis.initializeConsole();\n\t\tthis.initializeMenuBar();\n\t\tthis.pack();\n\t\tthis.hydraExplorer.refreshExplorer();\n\t}" ]
[ "0.77704835", "0.75652915", "0.7442664", "0.7369101", "0.7366378", "0.7358479", "0.73146075", "0.73096764", "0.72987294", "0.72978777", "0.7278321", "0.72729623", "0.7269468", "0.7269468", "0.7215727", "0.7180792", "0.71682984", "0.7140954", "0.7140953", "0.7126852", "0.7107974", "0.7100368", "0.7092515", "0.708178", "0.70652425", "0.70630395", "0.70621413", "0.7060283", "0.70517516", "0.7043992", "0.6996167", "0.6978269", "0.6971387", "0.6956391", "0.6938475", "0.6929829", "0.6929629", "0.69251114", "0.6921989", "0.6920365", "0.6914633", "0.6911002", "0.6911002", "0.6911002", "0.6911002", "0.6911002", "0.6911002", "0.6911002", "0.6911002", "0.6911002", "0.6911002", "0.6911002", "0.6911002", "0.69020075", "0.68911743", "0.6886017", "0.6873457", "0.6870402", "0.68686837", "0.68669385", "0.686311", "0.68616706", "0.68552315", "0.68537515", "0.681551", "0.68141145", "0.68094325", "0.67992085", "0.67930394", "0.6782133", "0.6765297", "0.6748138", "0.6731745", "0.6716807", "0.6711878", "0.6706194", "0.6697453", "0.6692831", "0.66927665", "0.6689213", "0.66724384", "0.66606426", "0.664954", "0.6642464", "0.6640775", "0.6638488", "0.663824", "0.663545", "0.66264987", "0.6625419", "0.6611392", "0.6608291", "0.6600817", "0.66005784", "0.6591052", "0.65869486", "0.65862876", "0.65753394", "0.6575285", "0.6570335", "0.655961" ]
0.0
-1
gets and sets those arrays
public static ArrayList<AdminAccounts> getUsers() { return users; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private void makeArrays()\n\t{\n\t\tfor (String key : sub.keySet())\n\t\t\tsub.put(key, ((List<String>) sub.get(key)).toArray(s0));\n\t\tfor (String key : attrs.keySet())\n\t\t\tattrs.put(key, ((List<String>) attrs.get(key)).toArray(s0));\n\t\tfor (String key : defs.keySet())\n\t\t\tdefs.put(key, ((List<String>) defs.get(key)).toArray(s0));\n\t\tfor (String key : smodes.keySet())\n\t\t{\n\t\t\tList<Integer> list = (List<Integer>) smodes.get(key);\n\t\t\tint[] array = new int[list.size()];\n\t\t\tfor (int i = 0; i < list.size(); i++)\n\t\t\t\tarray[i] = list.get(i);\n\t\t\tsmodes.put(key, array);\n\t\t}\n\t\tfor (String key : amodes.keySet())\n\t\t{\n\t\t\tList<Integer> list = (List<Integer>) amodes.get(key);\n\t\t\tint[] array = new int[list.size()];\n\t\t\tfor (int i = 0; i < list.size(); i++)\n\t\t\t\tarray[i] = list.get(i);\n\t\t\tamodes.put(key, array);\n\t\t}\n\t}", "private void setArrays() {\n // Set the tile arrays\n tileLogic = new boolean[size][size];\n tilesTex = new TextureRegion[size][size];\n\n // Set all tilesTex to clear\n for(int y = 0; y < size; y++)\n for(int x = 0; x < size; x++)\n tilesTex[x][y] = new TextureRegion(assets.clearTile);\n }", "public void setArray(int i, Array x);", "public void set(int[] ai);", "public void setArr(int[] arr){ this.arr = arr; }", "private void setSet(int[] set){\n this.set = set;\n }", "public final void set(float t[]) {\n\t\tthis.x = t[0];\n\t\tthis.y = t[1];\n\t\tthis.z = t[2];\n\t}", "static void set() {\n\t\tArrayList<Integer> arr1=new ArrayList<>();\n\t\tfor(int i=0;i<10;i++) arr1.add(i);\n\t\tfor(int x:arr1) System.out.print(x+\" \");\n\t\tSystem.out.println();\n\t\tarr1.set(3, 100);\n\t\tfor(int x:arr1) System.out.print(x+\" \");\n\t}", "public void inicialisation(){\r\n\t\t\r\n\t\tgoods = new AutoParts[0];\r\n\t\tclient = new Client[0];\r\n\t\t\r\n\t\tshop = new Shopping[0];\r\n\t\tsale = new Sale[0];\r\n\t\ttransaction = new Document[0];\r\n\t\t\r\n\t\tbalancesAutoParts = new BalancesAutoParts[0];\r\n\t\t\r\n\t\tprices = new Prices[0];\r\n\t\t\r\n\t\tagriment = new Agreement[0];\r\n\t\t\r\n\t}", "public final void set(float m[]) {\n\tm00 = m[ 0]; m01 = m[ 1]; m02 = m[ 2];\n\tm10 = m[ 3]; m11 = m[ 4]; m12 = m[ 5];\n\tm20 = m[ 6]; m21 = m[ 7]; m22 = m[ 8];\n }", "protected void setArray(Object[] array){\r\n\t \tthis.array = array;\r\n\t }", "public void set(String[] as);", "private void setPointArray(Point heartPoint, Point calPoint, Point activePoint, Point sedPoint)\n\t{\n\t\tthis.pointArray[1] = heartPoint;\n\t\tthis.pointArray[2] = calPoint;\n\t\tthis.pointArray[3] = activePoint;\n\t\tthis.pointArray[4] = sedPoint;\n\t\t\n\t}", "public void set(double[] ad);", "private void populate()\n\t{\n\t\tages = new int[] { 15, 18, 16, 16, 15, 16 }; \n\t}", "private void setIntArr(int[] intArr) {\r\n this.intArr = intArr;\r\n\r\n }", "static void arrayToSet()\n\t{\n\t\tList<String> oList = null;\n\t\tSet<String> oSet = null;\n\t\ttry {\n\t\t\tString arr[] = {\"A\",\"B\",\"C\",\"D\",\"E\",\"A\"};\n\t\t\t\n\t\t\toList = Arrays.asList(arr);\n\t\t\tSystem.out.println(\"List: \"+oList);\n\t\t\t\n\t\t\toSet = new TreeSet<>(oList);\n\t\t\t\n\t\t\tSystem.out.println(\"Set: \"+oSet);\n\t\t}catch(Exception e)\n\t\t{\n\t\t\te.printStackTrace();\n\t\t}\n\t\tfinally {\n\t\t\toSet = null;\n\t\t}\n\t}", "public static void createArrays() {\n\t\tinitArrays();\n\t\tcreateNodeTable();\n\t\tcreateEdgeTables();\n\t\t// Helper.Time(\"Read File\");\n\t\tcreateOffsetTable();\n\t}", "void setStockArray(stockFilePT102.StockDocument.Stock[] stockArray);", "void setNullArray()\n/* */ {\n/* 1051 */ this.length = -1;\n/* 1052 */ this.elements = null;\n/* 1053 */ this.datums = null;\n/* 1054 */ this.pickled = null;\n/* 1055 */ this.pickledCorrect = false;\n/* */ }", "void setStarArray(stars.StarType[] starArray);", "private void setArray(byte[] initialArray)\r\n/* 60: */ {\r\n/* 61: 95 */ this.array = initialArray;\r\n/* 62: 96 */ this.tmpNioBuf = null;\r\n/* 63: */ }", "public void set(float[] values) {\n for (int i = 0; i < values.length; i++) {\n storage[i] = values[i];\n }\n }", "void setDatumArray(Datum[] paramArrayOfDatum)\n/* */ {\n/* 979 */ if (paramArrayOfDatum == null) {\n/* 980 */ setNullArray();\n/* */ }\n/* */ else {\n/* 983 */ this.length = paramArrayOfDatum.length;\n/* 984 */ this.elements = null;\n/* 985 */ this.datums = ((Datum[])paramArrayOfDatum.clone());\n/* 986 */ this.pickled = null;\n/* 987 */ this.pickledCorrect = false;\n/* */ }\n/* */ }", "void setContents(T[] contents);", "public void set(byte[] arrby) {\n ByteBuffer byteBuffer;\n ByteBuffer byteBuffer2 = byteBuffer = Blob.this.getByteBuffer();\n synchronized (byteBuffer2) {\n byteBuffer.position(Blob.this.getByteBufferPosition() + this.offset());\n byteBuffer.put(arrby);\n this.mCurrentDataSize = arrby.length;\n return;\n }\n }", "private void getArrays (Bar bars, Wheel wheels, Closure windowHandles, DoorHandle doorHandles){\n }", "private void initArrayHeightAndWidth() {\n\n\t\theight = 0;\n\t\twidth = 0;\n\n\t\ttry {\n\t\t\tBufferedReader br = new BufferedReader(new FileReader(mapFile));\n\t\t\tString line = br.readLine();\n\t\t\t// get length of map\n\t\t\twidth = line.length();\n\t\t\t// get height of map\n\t\t\twhile (line != null) {\n\t\t\t\theight += 1;\n\t\t\t\tline = br.readLine();\n\t\t\t}\n\t\t\tbr.close();\n\n\t\t} catch (FileNotFoundException e) {\n\t\t\te.printStackTrace();\n\t\t} catch (IOException e) {\n\t\t\te.printStackTrace();\n\t\t}\n\n\t\theight_on_display = (height - 1) * 35;\n\t\twidth_on_display = (width - 1) * 35;\n\t\tmapElementStringArray = new String[height][width];\n\t\tmapElementArray = new MapElement[height][width];\n\n\t}", "public void inicializarArrays(){\n for(int i=0;i<=10;i++){\n dni[i] = 0;\n nombre[i] = \"\";\n apellido[i] = \"\";\n direccion[i] = \"\";\n telefono[i] = \"\";\n fNacimiento[i] = \"\";\n }\n }", "public void setUniverse(byte[][] input)\n\t{\n\t\tfor(int row =0; row<input.length; row++)\n\t\t{\t//for loop for column\n\t\t\tfor(int column =0; column<input[row].length; column++)\n\t\t\t{\n\t\t\t\t//assign value from input array to currentversion\n\t\t\t\tthis.currentVersion[row][column] = input[row][column];\n\t\t\t}\n\t\t}\n\t}", "private void setAllParameters(int len) {\n\t\t\tshowUPLMN = new String[len] ;\n\t\t\toriginalUPLMN = new String[len] ;\n\t\t\tstrUorG = new String[len] ;\n\t\t\tpart = new byte[len][];\n\t\t\torder = new int[len];\n\t\t\tfor(int i=0;i<len;i++){\n\t\t\t\t part[i] = new byte[6];\n\t\t\t}\n\t\t}", "void setPosiblesValores(int[] valores);", "private void populate ()\n\t{\n\t\t//create a random object\n\t\tRandom rand = new Random(); \n\t\t//for loop for row\n\t\tfor (int row =0; row < currentVersion.length; row++)\n\t\t{\t//for loop for column\n\t\t\tfor(int column = 0; column < currentVersion[row].length; column++)\n\t\t\t{\n\t\t\t\t//assign byte values from [0 to state-1] into array\n\t\t\t\tcurrentVersion[row][column] = (byte) rand.nextInt((this.state-1));\n\t\t\t}\n\t\t}\n\t}", "public void readValues() {\n\t\tfor (int i = 0; i < 7; i++) {\n\t\t\tfor (int j = 0; j < 7; j++) {\n\t\t\t\tarray.setElement(i, j, Integer.parseInt(lblCenter[i][j].getText()));\n\t\t\t}\n\t\t\tleftCol.setElement(i, Integer.parseInt(tfWest[i].getText()));\n\t\t\tbottomRow.setElement(i, Integer.parseInt(tfSouth[i].getText()));\n\t\t}\n\t}", "public void initializeSelectionArray(){\n\t\ttry{Element root = new XmlReader().parse(Gdx.files.internal(xmlFile));\n\t\tElement artist = root.getChildByName(formatName(game.getArtist()));\n\t\tElement quesNum = artist.getChildByName(Integer.toString(game.getQuestion()));\n\t\tArray<Element> answerE = quesNum.getChildrenByName(\"Option\");\n//\t\tint count = answerE.size;\n//\t\tanswers = new String[count];\n\t\tfor (int i = 0; i <answerE.size; i++){\n//\t\t\tModify to add to the two lists\n//\t\t\tDelete the reference to the answers array\n//\t\t\tanswers[i]=answerE.get(i).getText();\n\t\t\t\n\t\t\toptions.add(answerE.get(i).getText());\n\t\t\toptionsList.add(answerE.get(i).getText());\n\t\t}\n\t\t}\n\t\tcatch(IOException e){\n\t\t}\n\t}", "public ZYArraySet(){\n elements = (ElementType[])new Object[DEFAULT_INIT_LENGTH];\n }", "public void setArray(int[] paramArrayOfInt)\n/* */ {\n/* 758 */ if (paramArrayOfInt == null) {\n/* 759 */ setNullArray();\n/* */ }\n/* */ else {\n/* 762 */ setArrayGeneric(paramArrayOfInt.length);\n/* */ \n/* 764 */ this.elements = new Object[this.length];\n/* */ \n/* 766 */ for (int i = 0; i < this.length; i++) {\n/* 767 */ this.elements[i] = Integer.valueOf(paramArrayOfInt[i]);\n/* */ }\n/* */ }\n/* */ }", "void setData(String[] data);", "void setPlaces(Place[] places);", "private void initializeArrays(){\n arrayOfBadges = new String[6];\n stateArray = new int[6];\n for (int i = 0; i<6; i++){\n stateArray[i]=0;\n }\n arrayOfBadges[0] = \"Community\";\n arrayOfBadges[1] = \"Academic\";\n arrayOfBadges[2] = \"Dean\";\n arrayOfBadges[3] = \"Honor\";\n arrayOfBadges[4] = \"Abroad\";\n arrayOfBadges[5] = \"Graduation\";\n\n\n }", "public void setup(int size){\n runValues = new double[size];\n hardwareValues = new double[size][];\n }", "public void get (float[] values)\n {\n values[0] = x;\n values[1] = y;\n }", "public void set_array(String type){\n while (true){\n\n General_imp construct = new General_imp();\n\n construct.print_type( type);\n String ans = construct.input();\n if (ans.equals(\"EXIT\"))\n break;\n setatribs(ans, type);\n }\n }", "public void fillPropertyArray()\n \t{\n \t\tsuper.fillPropertyArray();\n \t\tsuper.fillPropertyArray( gui );\n \t}", "private void kasvata() {\n T[] uusi = (T[]) new Object[this.arvot.length * 3 / 2 + 1];\n for (int i = 0; i < this.arvot.length; i++) {\n uusi[i] = this.arvot[i];\n }\n this.arvot = uusi;\n }", "public void set(boolean[] abol);", "private ArraySetHelper() {\n\t\t// nothing\n\t}", "protected void setArray (JField jf, Vector nodes, Object obj, XmlDescriptor desc,\n\t\t\t\t\t\t\t UnmarshalContext context) throws Exception {\n\t\tif (nodes.size () == 0) return;\n\t\tClass thisClass = obj.getClass();\n\n\t\tObject theArray = Array.newInstance (getAClass (jf.getObjectType ()), nodes.size ());\n\t\tObject value = null;\n Method m = null;\n\n\t\tm = getASetMethod (thisClass, \"set\" + jf.getGetSet(), theArray.getClass ());\n\n\t\tfor (int i=0; i< nodes.size (); i++) {\n\t\t\t// W3CXmlNode ..\n\t\t\tXmlNode thisNode = ((XmlNode)nodes.elementAt (i));\n\t\t\tif (jf instanceof JCompositeField) {\n\t\t\t\tXmlDescriptor fieldDesc = (XmlDescriptor)this.classList.get (jf.getObjectType());\n\t\t\t\tvalue = unmarshal (thisNode, context, fieldDesc);\n\t\t\t}\n\t\t\telse {\n\t\t\t\tvalue = getPrimitive (thisNode, jf, context);\n\t\t\t\t\n\t\t\t}\n\n\t\t\tArray.set (theArray, i, value);\n\t\t}\n\t\tm.invoke(obj, new Object[]{theArray});\n\t}", "public void setMarks(int[] newMarks){\n marks = newMarks;\n }", "void setArrayGeneric(int paramInt)\n/* */ {\n/* 1062 */ this.length = paramInt;\n/* 1063 */ this.datums = new Datum[paramInt];\n/* 1064 */ this.pickled = null;\n/* 1065 */ this.pickledCorrect = false;\n/* */ }", "void setArray(int index, Array value) throws SQLException;", "private static void initSet1(String[] set1) {\n\t\tset1[0] = \"rs36129689\";\n\t\tset1[1] = \"rs36153986\";\n\t\tset1[2] = \"rs493934\";\n\t\tset1[3] = \"rs36146958\";\n\t\tset1[4] = \"rs36197089\";\n\t\tset1[5] = \"rs35773247\";\n\t\tset1[6] = \"rs35346884\";\n\t\tset1[7] = \"rs493040\";\n\t\tset1[8] = \"rs35473000\";\n\t\tset1[9] = \"rs123456\";\n\t\tset1[10] = \"rs1234567\";\n\t\tset1[11] = \"rs12345678\";\n\t\tset1[12] = \"rs1234234\";\n\t\tset1[13] = \"rs492232\";\n\t\tset1[14] = \"rs492184\";\n\t\tset1[15] = \"rs123123\";\n\t}", "public void cleararrays(){\n condicional.clear();\n parametro1.clear();\n parametro2.clear();\n }", "private void setEverything(){\r\n int listLength = propertyList.length -1;\r\n arrayIterator = new ArrayIterator<>(propertyList, listLength+1);\r\n\r\n this.priceTree = new SearchTree<>(new PriceComparator());\r\n this.stockTree = new SearchTree<>(new StockComparator());\r\n this.ratingTree = new SearchTree<>(new RatingComparator());\r\n this.deliveryTree= new SearchTree<>(new DeliveryTimeComparator());\r\n\r\n this.foodArray = new ArrayQueue<>();\r\n this.restaurantArray = new ArrayQueue<>();\r\n\r\n // Fill arrays from property list.\r\n createFoodArray();\r\n arrayIterator.setCurrent(0); //Since the restaurantArray will use the same iterator\r\n createRestaurantArray();\r\n\r\n // Fill Binary Search Trees\r\n createFoodTrees();\r\n createRestaurantTrees();\r\n }", "public void storeDataForCashePrefrenceArray(SharedPreferences spinnerPrefs, Set<String> arrayOFSpinnersValue){//for new version\n SharedPreferences.Editor prefsEditor = spinnerPrefs.edit();\n prefsEditor.putStringSet(\"inputspinner_prefrance_set_for_cashe\",arrayOFSpinnersValue);\n prefsEditor.commit();\n }", "void setStockArray(int i, stockFilePT102.StockDocument.Stock stock);", "private void arretes_fY(){\n\t\tthis.cube[49] = this.cube[46]; \n\t\tthis.cube[46] = this.cube[48];\n\t\tthis.cube[48] = this.cube[52];\n\t\tthis.cube[52] = this.cube[50];\n\t\tthis.cube[50] = this.cube[49];\n\t}", "public void set(Object[] objects) {\r\n this.objects = objects;\r\n }", "public void setBuffers(KType[][] newBuffers) {\n // Check they're all the same size, except potentially the last one\n int totalLen = 0;\n for (int i = 0; i < newBuffers.length - 1; i++) {\n final int currLen = newBuffers[i].length;\n assert currLen == newBuffers[i + 1].length;\n totalLen += currLen;\n }\n buffers = newBuffers;\n blockLen = newBuffers[0].length;\n elementsCount = totalLen;\n }", "void setStart(Object[] newStart);", "private String[] setSong(){\n\n String[] songArray = null;\n\n if(songType == 0){\n songArray = twinkle;\n }\n else if(songType == 1){\n songArray = spider;\n }\n else if(songType == 2){\n songArray = row;\n }\n\n return songArray;\n }", "public void setArray(int r1, int r2) {\n /*\n // Can't load method instructions: Load method exception: bogus element_width: 1070 in method: android.renderscript.AllocationAdapter.setArray(int, int):void, dex: in method: android.renderscript.AllocationAdapter.setArray(int, int):void, dex: \n */\n throw new UnsupportedOperationException(\"Method not decompiled: android.renderscript.AllocationAdapter.setArray(int, int):void\");\n }", "private void setValoresDoAluno(String[] nomes, int[]notas, int[]conceitos)\n\t{\n\t\tif( nomes.length > 0 && notas.length > 0)\n\t\t{\n\t\t\tfor(int a=0; a < nomes.length || a < numMaxDeAluno; a++)\n\t\t\t{\n\t\t\t\tgradeNomes[a] = nomes[a];\n\t\t\t\tgradeNotas[a] = notas[a];\n\t\t\t\tgradeConceitos[a] = conceitos[a];\n\t\t\t}\n\t\t}\n\t}", "public static void main(String[] args) {\n\n for(int i=0; i<3;i++){\n // arr[i] = new Array1(i+3,i*2);\n //arr[0] = arr.getArray(3,5);\n\n }\n\n }", "private void fillArrays(){\n\t\tdouble tIncrement = (endT-startT) / (double)plotPoints;\n\t\t\n\t\t//burn in\n\t\tfor(int i=0; i<burnIn; i++){\n\t\t\tfor(int j=0;j<updatesPerSweep;j++){\n\t\t\t\tising.update();\n\t\t\t}\n\t\t}\n\t\t\n\t\tfor(int k=0; k<plotPoints+1 && !simulationThread.isInterrupted(); k++){\n\t\t\tising.reset();\n\t\t\tising.setTemperature(startT + k*tIncrement);\n\t\t\t\n\t\t\t\n\t\t\tfor(int i=0; i<sweeps; i++){\n\t\t\t\tfor(int j=0;j<updatesPerSweep;j++){\n\t\t\t\t\tising.update();\n\t\t\t\t}\n\t\t\t\tising.updateSums();\n\t\t\t}\n\t\t\t\n\t\t\t//add values to arrays\n\t\t\ttemp[k] = ising.getTemperature();\n\t\t\t\n\t\t\t\n\t\t\tif(this.plotM){\n\t\t\t\tabsM[k] = ising.averageAbsM();\n\t\t\t\tsusceptibility[k][0] = ising.susceptibility();\n\t\t\t\tsusceptibility[k][1] = ising.errorSusceptibility();\n\t\t\t}\n\t\t\tif(this.plotE){\n\t\t\t\tE[k] = ising.averageE();\n\t\t\t\theatCapacity[k][0] = ising.heatCapacity();\n\t\t\t\theatCapacity[k][1] = ising.errorHearCapacity();\n\t\t\t}\n\t\t\t\n\t\t}\t\n\t}", "public void setArray(int[] newArr){\n this.sortArray = newArr;\n }", "public void setArray(short[] paramArrayOfShort)\n/* */ {\n/* 824 */ if (paramArrayOfShort == null) {\n/* 825 */ setNullArray();\n/* */ }\n/* */ else {\n/* 828 */ setArrayGeneric(paramArrayOfShort.length);\n/* */ \n/* 830 */ this.elements = new Object[this.length];\n/* */ \n/* 832 */ for (int i = 0; i < this.length; i++) {\n/* 833 */ this.elements[i] = Integer.valueOf(paramArrayOfShort[i]);\n/* */ }\n/* */ }\n/* */ }", "public static void fillArray() {\r\n\t\tfor (int i = 0; i < myOriginalArray.length - 1; i++) {\r\n\t\t\tRandom rand = new Random();\r\n\t\t\tmyOriginalArray[i] = rand.nextInt(250);\r\n\t\t}\r\n\t\t// Copies original array 4 times for algorithm arrays\r\n\t\tmyBubbleArray = Arrays.copyOf(myOriginalArray, myOriginalArray.length);\r\n\t\tmySelectionArray = Arrays.copyOf(myOriginalArray, myOriginalArray.length);\r\n\t\tmyInsertionArray = Arrays.copyOf(myOriginalArray, myOriginalArray.length);\r\n\t\tmyQuickArray = Arrays.copyOf(myOriginalArray, myOriginalArray.length);\r\n\t}", "public static void main(String[] args) {\n\n\n\n int[] myArray = new int[5];\n\n Array.set(myArray,0,100); // another way as shown above --> myArray[0] = 100;\n Array.set(myArray,1,81);\n Array.set(myArray,2,64);\n Array.set(myArray,3,49);\n Array.set(myArray,4, 36);\n\n// int getValue = Array.get(myArray,3); //--> Array onune int yazmadigimiz icin object\n // farzediyor. (int) yazarak tipini belirlemeliyiz\n // bu type casting ornegidir\n int getValue = (int)Array.get(myArray,3);\n System.out.println(\"The value at index 3 is : \" + getValue);\n\n// System.out.println(Arrays.toString(myArray));\n\n /**\n * java.lang.reflect.Array -->\n * The Array class provides static methods to dynamically create and access Java arrays.\n *\n * java.util.Arrays -->\n * This class contains various methods for manipulating arrays (such as sorting and searching).\n * This class also contains a static factory that allows arrays to be viewed as lists.\n * Utility class,which contains static methods to manipulate(sort,max,min etc.) the values stored in array.\n */\n\n /**\n * getArray METHOD\n * get Array Class method = Allows you to return the value at a specific index\n * Syntax = Array.get(Object [], int index)\n */\n\n// int[] myArray = {2,4,6,8};\n// for(int i = 0; i < myArray.length; i++){\n// int storageValue =(int) Array.get(myArray,i);\n// System.out.println(\"The value at \" + i + \" index is: \" + storageValue);\n// }\n\n // similar code\n// int[] myArray = {2,4,6,8};\n// for(int i = 0; i < myArray.length; i++){\n// int storeValue = myArray[i];\n// System.out.println(\"The value at \" + i + \" index is \" + storeValue);\n// }\n\n\n\n\n\n\n\n }", "public void setSpielzuege1(int p[][]) {\n\t\tthis.spielfeld1 = p;\n\t}", "public void setShipArrays(Ship[] array, BoardValue[][] boardArray) {\r\n\r\n for (Ship ship : array) {\r\n if (ship != null) {\r\n //all coordinates this ship occupies\r\n int[][] coords = ship.getShipCoordinates();\r\n\r\n //going through the coordinates [row,column] of a ship\r\n for (int body = 0; body <= (ship.getLength() - 1); body++) {\r\n\r\n //FRONT of the ship has different image. The very first value of this loop\r\n if (body == 0) {\r\n int[] front = coords[0];\r\n //different images for front and back of ship\r\n addShipImage(\"/images/ShipHead.png\", boardArray, front[0], front[1], ship.getOrientation());\r\n\r\n //BACK of the ship has different image. The very last value of this loop\r\n } else if (body == (ship.getLength() - 1)) {\r\n int[] back = coords[body];\r\n addShipImage(\"/images/ShipTail.png\", boardArray, back[0], back[1], ship.getOrientation());\r\n\r\n //BODY of the ship\r\n } else {\r\n int[] coordinate = coords[body];\r\n addShipImage(\"/images/ShipBody.png\", boardArray, coordinate[0], coordinate[1], ship.getOrientation());\r\n }\r\n }\r\n }\r\n }\r\n }", "private void init() {\n visitado = new boolean[N+2][N+2];\n for (int x = 0; x < N+2; x++) visitado[x][0] = visitado[x][N+1] = true;\n for (int y = 0; y < N+2; y++) visitado[0][y] = visitado[N+1][y] = true;\n\n\n // todas las paredes levantadas\n norte = new boolean[N+2][N+2];\n este = new boolean[N+2][N+2];\n sur = new boolean[N+2][N+2];\n oeste = new boolean[N+2][N+2];\n for (int x = 0; x < N+2; x++)\n for (int y = 0; y < N+2; y++)\n norte[x][y] = este[x][y] = sur[x][y] = oeste[x][y] = true;\n }", "void setGivenByOrder(int[] gbo);", "public void setup() \n { \n \tsize(400,400);\n \tbac = new Bacteria[15];\n \tfor (int i = 0; i<bac.length; i++)\n \t{\n \t\tbac[i]= new Bacteria(200,200);\n \t\tbac[i].c();\n \t} //initialize bacteria variables here \n }", "void setCodes(Code[] codes);", "public void setArray(Object[] array)\n\t{\n\t\tif (SanityManager.DEBUG)\n\t\t{\n\t\t\tSanityManager.ASSERT(array != null, \n\t\t\t\t\t\"array input to setArray() is null, code can't handle this.\");\n\t\t}\n\n\t\tthis.array = ArrayUtil.copy( array );\n\t}", "public void makeArray(){\n for (int i = 0; i<length; i++){\n departements[i] = wallList.get(i).getName();\n }\n }", "public ZYArraySet(int initLength){\n if(initLength<0)\n throw new IllegalArgumentException(\"The length cannot be nagative\");\n elements = (ElementType[])new Object[initLength];\n }", "@Override\n public void init(float[] data) {\n this.data = data;\n\n //\n shapeArr = new Rectangle2D.Float[data.length];\n colorArr = new Color[data.length];\n pointArr = new Point2D.Float[data.length];\n }", "public void setArray(int[] array) {\r\n this.array = array;\r\n }", "@Override\r\n\tpublic Object[] toArray() {\n\t\treturn set.toArray();\r\n\t}", "private int[] getArray(Set<Integer> set) {\n int n = set.size();\n int[] array = new int[n];\n\n Iterator<Integer> iterator = set.iterator();\n int i = 0;\n while (iterator.hasNext()) {\n array[i] = iterator.next();\n i++;\n }\n return array;\n }", "private void declareArrays() {\n int iNumTimesteps = m_oLegend.getNumberOfTimesteps(),\n i, j, k;\n \n //Create arrays to hold raw data.\n mp_fLiveTreeVolumeTotals = new double[m_iNumSpecies][iNumTimesteps + 1][m_iNumSizeClasses];\n mp_fSnagVolumeTotals = new double[m_iNumSpecies][iNumTimesteps + 1][m_iNumSizeClasses]; \n mp_iLiveTreeCounts = new long[m_iNumSpecies][iNumTimesteps + 1][m_iNumSizeClasses];\n mp_iSnagCounts = new long[m_iNumSpecies][iNumTimesteps + 1][m_iNumSizeClasses];\n mp_fLiveTreeDBHTotal = new double[m_iNumSpecies][iNumTimesteps + 1];\n mp_fSnagDBHTotal = new double[m_iNumSpecies][iNumTimesteps + 1];\n mp_fTallestLiveTrees = new float[m_iNumSpecies+1][iNumTimesteps + 1][10];\n mp_fTallestSnags = new float[m_iNumSpecies+1][iNumTimesteps + 1][10];\n \n //Initialize all values with 0s\n for (i = 0; i < mp_fTallestLiveTrees.length; i++) {\n for (j = 0; j < mp_fTallestLiveTrees[i].length; j++) {\n for (k = 0; k < mp_fTallestLiveTrees[i][j].length; k++) {\n mp_fTallestLiveTrees[i][j][k] = 0;\n mp_fTallestSnags[i][j][k] = 0;\n }\n }\n }\n \n for (i = 0; i < m_iNumSpecies; i++) {\n for (j = 0; j <= iNumTimesteps; j++) {\n mp_fLiveTreeDBHTotal[i][j] = 0;\n mp_fSnagDBHTotal[i][j] = 0;\n for (k = 0; k < m_iNumSizeClasses; k++) {\n mp_iLiveTreeCounts[i][j][k] = 0;\n mp_iSnagCounts[i][j][k] = 0;\n mp_fLiveTreeVolumeTotals[i][j][k] = 0;\n mp_fSnagVolumeTotals[i][j][k] = 0;\n }\n }\n }\n }", "private void getArbeitspaketArray(ObservableList<ArbeitspaketTableData> paketList) {\r\n\t\t// Initialisieren des Arrays\r\n\t\tpakete = new Arbeitspaket[paketList.size()];\r\n\r\n\t\tfor (int i = 0; i < paketList.size(); i++) {\r\n\t\t\t// herauslesen der externen ID, damit diese nicht verloren geht (Konstruktor\r\n\t\t\t// nimmt nur einen Parameter für die ID entgegen und setzt die interne und\r\n\t\t\t// externe ID auf diesen Wert)\r\n\t\t\tString idExtern = paketList.get(i).getIdExtern();\r\n\r\n\t\t\t// automatisches Setzen der Vorgangsdauer, da diese in der Tabelle nicht\r\n\t\t\t// angegeben wird\r\n\t\t\tint vorgangsdauer = paketList.get(i).getFez() - paketList.get(i).getFaz() + 1;\r\n\r\n\t\t\t// setzen der einzelnen Werte der Arbeitspakte\r\n\t\t\tpakete[i] = new Arbeitspaket(paketList.get(i).getIdIntern(), paketList.get(i).getFaz(),\r\n\t\t\t\t\tpaketList.get(i).getFez(), paketList.get(i).getSaz(), paketList.get(i).getSez(), vorgangsdauer,\r\n\t\t\t\t\tpaketList.get(i).getMitarbeiteranzahl(), paketList.get(i).getAufwand());\r\n\r\n\t\t\t// Da die externe ID auf die interne ID gesetzt wurde, wird diese nun wieder auf\r\n\t\t\t// die vorher herausgelesene externe ID gesetzt\r\n\t\t\tpakete[i].setIdExtern(idExtern);\r\n\t\t}\r\n\t}", "public void set_data(short[] value) {\n for (int index0 = 0; index0 < value.length; index0++) {\n setElement_data(index0, value[index0]);\n }\n }", "private void init() {\r\n\tlocals = new float[maxpoints * 3];\r\n\ti = new float[] {1, 0, 0};\r\n\tj = new float[] {0, 1, 0};\r\n\tk = new float[] {0, 0, 1};\r\n\ti_ = new float[] {1, 0, 0};\r\n\tk_ = new float[] {0, 0, 1};\r\n }", "@Override\n\tpublic void setArray(int parameterIndex, Array x) throws SQLException {\n\t\t\n\t}", "public void SetVector(int[] v){ this.vector=v;}", "private static void resetGroupLineArrays() {\n // Reset the arrays to make sure that we have uptodate information in them\n itemsArray = null;\n itemsArrayForAlterations = null;\n itemsArrayForOpenDeposit = null;\n }", "public void set(int[][] settings) throws IllegalArgumentException\n {\n for(int[] fpv : settings)\n {\n if (fpv.length != 3)\n throw new IllegalArgumentException(\"Each setting must contain an array of 3 ints declared as int[3]\");\n int i = fpv[0];\n fpv[2] = set(akParams_[i].paramName, fpv[1], fpv[2]);\n }\n }", "protected void setArray(Expression expr)\n {\n setExpression(expr);\n }", "public void tukarData() {\n this.temp = this.data1;\n this.data1 = this.data2;\n this.data2 = this.temp;\n }", "protected void setPaths(Double[][] paths){\n this.paths=paths;\n }", "protected abstract void setValues(double[] values);", "public Set(){\n setSet(new int[0]);\n }", "public void setArray(double[] paramArrayOfDouble)\n/* */ {\n/* 725 */ if (paramArrayOfDouble == null) {\n/* 726 */ setNullArray();\n/* */ }\n/* */ else {\n/* 729 */ setArrayGeneric(paramArrayOfDouble.length);\n/* */ \n/* 731 */ this.elements = new Object[this.length];\n/* */ \n/* 733 */ for (int i = 0; i < this.length; i++) {\n/* 734 */ this.elements[i] = Double.valueOf(paramArrayOfDouble[i]);\n/* */ }\n/* */ }\n/* */ }", "void setStarArray(int i, stars.StarType star);", "public void setSpielzuege2(int p[][]) {\n\t\tthis.spielfeld2 = p;\n\t}", "public void setMeasurementArray(){\n\t\tnResults = rt.size();\n\t\tData = new double[4][nResults];\n\t\tfor(int i =1; i<nResults; i++) {\n\t\t\tData[0][i]=i;\n\t\t\tData[1][i]=rt.getValueAsDouble(rt.getColumnIndex(\"Mean\"),i); \n\t\t\tData[2][i]=rt.getValueAsDouble(rt.getColumnIndex(\"StdDev\"),i);\n\t\t\tData[3][i]=rt.getValueAsDouble(rt.getColumnIndex(\"Max\"),i)-rt.getValueAsDouble(rt.getColumnIndex(\"Min\"),i);\n\t\t}\n\t\treturn;\n\t}", "protected void setValues() {\n values = new double[size];\n int pi = 0; // pixelIndex\n int siz = size - nanW - negW - posW;\n int biw = min < max ? negW : posW;\n int tiw = min < max ? posW : negW;\n double bv = min < max ? Double.NEGATIVE_INFINITY : Double.POSITIVE_INFINITY;\n double tv = min < max ? Double.POSITIVE_INFINITY : Double.NEGATIVE_INFINITY;\n double f = siz > 1 ? (max - min) / (siz - 1.) : 0.;\n for (int i = 0; i < biw && pi < size; i++,pi++) {\n values[pi] = bv;\n }\n for (int i = 0; i < siz && pi < size; i++,pi++) {\n double v = min + i * f;\n values[pi] = v;\n }\n for (int i = 0; i < tiw && pi < size; i++,pi++) {\n values[pi] = tv;\n }\n for (int i = 0; i < nanW && pi < size; i++,pi++) {\n values[pi] = Double.NaN;\n }\n }", "public static void initializingArraysExamples(){\r\n\t\t\r\n\t\t// if you want to put different primitive types into an array, you must use their wrapper class.\r\n\t\t\t\t// the different way to initiate array\r\n\t\t\t\tboolean[] boos1 = new boolean[3];\r\n\t\t\t\tboolean[] boos2 = { false,false,false}; // this can only be done at the declaration\r\n\t\t\t\t//because it sets size and content\t\r\n\t\t\t\t//this does not work\r\n\t\t\t\t//boos3 = {false,true,true}; this doesn't work because u have boolean declared up there while the bottom only initializes it\r\n\t\t\t\tboos3 = new boolean[3]; //this is all that will work \r\n\t\t\t\t\r\n\t\t\t\t\r\n\t\t\t\t/** 2 ways to iterate through an array\r\n\t\t\t\tSTANDARD FOR LOOP\r\n\t\t\t\t\tTHE INDEX IS IMPORTANT TO KEEP CHECK OF \r\n\t\t\t\t\tYOU NEED TO CUSTOMIZE THE ORDER\r\n\t\t\t\t\r\n\t\t\t\t\r\n\t\t\t\t*/\r\n\t\t\t\tfor(int i = 0; i<boos1.length;i++){\r\n\t\t\t\t//\tSystem.out.println(boos1[i]); //everything in a boolean is set to false prior; if int will be 0\r\n\t\t\t\t}\r\n\t\t\t\t/** FOR EACH LOOOP\r\n\t\t\t\t \t-the index is no important \r\n\t\t\t\t *\t- you don't need to customize\r\n\t\t\t\t * \t- automatically assigns a \"handle\" aka identifier\r\n\t\t\t\t */\r\n\t\t\t\tfor(boolean b: boos1){ // is the same as top + boolean b = boos1[i]\r\n\t\t\t\t//\tSystem.out.println(b);\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\t//OBJECT ARRAYS\r\n\t\t\t\tString[] someStrings1 = new String[3];\r\n\t\t\t\tString[] someStrings2 = {\"a\",\"b\",\"c\"};\r\n\t\t\t//\tsomeStrings1[0] = \"a\";\r\n\t\t\t//\tsomeStrings1[1] = \"b\";\r\n\t\t\t//\tsomeStrings1[2] = \"c\";\r\n\t\t\t\t//but this is repetitive\r\n\t\t\t\t\r\n\t\t/*\t\tfor(int i = 0; i<someStrings1.length;i++){\r\n\t\t\t\t\tsomeStrings1[i] = \"a new string\"; // (when String s: someStrings1) you would had thought that this will make \r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t//someStrings1 all be called a new string.\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t//doesn't work if you make s = someStrings[i] because it is a local variable\r\n\t\t\t\t\t\r\n\t\t\t\t}\r\n\t\t\t\t// a loop to print it\r\n\t\t\t\tfor(String s: someStrings1){\r\n\t\t\t\t\tSystem.out.println(s);\r\n\t\t\t\t} */\r\n\t\t\t\r\n\t}" ]
[ "0.70732534", "0.68917376", "0.6622145", "0.64448273", "0.6341886", "0.6254695", "0.61753255", "0.61307514", "0.6091738", "0.6089226", "0.60835165", "0.60785264", "0.6065199", "0.60411775", "0.6032386", "0.5979855", "0.5936373", "0.59077156", "0.58999604", "0.5893826", "0.586977", "0.5867219", "0.58446735", "0.5805587", "0.5799796", "0.5789472", "0.57694286", "0.5757284", "0.5756597", "0.5755834", "0.5738534", "0.571398", "0.57112044", "0.5707263", "0.57068515", "0.56927675", "0.56868863", "0.5686548", "0.56827563", "0.56774163", "0.5663069", "0.565478", "0.5652789", "0.5646735", "0.5635944", "0.5631285", "0.5628484", "0.5626444", "0.5624445", "0.5612483", "0.5597589", "0.558432", "0.55812764", "0.5568809", "0.5555026", "0.5551311", "0.55392665", "0.5530673", "0.5523573", "0.5513413", "0.5508996", "0.5498225", "0.5483797", "0.548182", "0.5477637", "0.5452874", "0.54494387", "0.5448819", "0.5447806", "0.5430868", "0.5426232", "0.54226106", "0.54192793", "0.5418741", "0.5417048", "0.54164493", "0.541626", "0.54121435", "0.5411859", "0.5408973", "0.54032534", "0.54029214", "0.5390951", "0.5389223", "0.53857166", "0.53785485", "0.5375979", "0.5375439", "0.53725964", "0.53649235", "0.5363951", "0.53631675", "0.53620285", "0.5359988", "0.53578246", "0.5355691", "0.53491014", "0.5347503", "0.5344685", "0.53407955", "0.5338934" ]
0.0
-1
loads the users array into the new file
public void adminLoad() { try { File file = new File(adminPath); Scanner scanner = new Scanner(file); while (scanner.hasNextLine()){ String data = scanner.nextLine(); String[]userData = data.split(separator); AdminAccounts adminAccounts = new AdminAccounts(); adminAccounts.setUsername(userData[0]); adminAccounts.setPassword(userData[1]); users.add(adminAccounts); } } catch (FileNotFoundException e) { e.printStackTrace(); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void writeUsers() {\n try {\n FileOutputStream fileOut = new FileOutputStream(\"temp/users.ser\");\n ObjectOutputStream out = new ObjectOutputStream(fileOut);\n out.writeObject(users);\n out.close();\n fileOut.close();\n } catch (IOException e) {\n e.printStackTrace();\n }\n\n }", "public static void loadArrayList() throws IOException\n\t{\n\t\tString usersXPFile = \"UsersXP.txt\";\n\t\t\n\t\tFile file = new File(usersXPFile);\n\t\t\n\t\tScanner fileReader;\n\t\t\n\t\tif(file.exists())\n\t\t{\n\t\t\tfileReader = new Scanner(file);\n\t\t\twhile(fileReader.hasNext())\n\t\t\t\tuserDetail1.add(userData.addNewuser(fileReader.nextLine().trim()));\n\t\t\tfileReader.close();\n\t\t}\n\t\telse overwriteFile(usersXPFile, \"\");\n\t\t\n\t\t\n\t}", "public void readUsers() {\n try {\n FileInputStream fileIn = new FileInputStream(\"temp/users.ser\");\n ObjectInputStream in = new ObjectInputStream(fileIn);\n users = (HashMap<String, User>) in.readObject();\n in.close();\n fileIn.close();\n } catch (IOException e) {\n users = new HashMap<>();\n } catch (ClassNotFoundException c) {\n System.out.println(\"Class HashMap not found\");\n c.printStackTrace();\n return;\n }\n\n }", "static void loadUser() {\n\t\tScanner inputStream = null; // create object variable\n\n\t\ttry { // create Scanner object & assign to variable\n\t\t\tinputStream = new Scanner(new File(\"user.txt\"));\n\t\t\tinputStream.useDelimiter(\",\");\n\t\t} catch (FileNotFoundException e) {\n\t\t\tSystem.out.println(\"No User Infomation was Loaded\");\n\t\t\t// System.exit(0);\n\t\t\treturn;\n\t\t}\n\n\t\ttry {\n\t\t\twhile (inputStream.hasNext()) {\n\n\t\t\t\tString instanceOf = inputStream.next();\n\n\t\t\t\tString readUserName = inputStream.next();\n\t\t\t\tString readPassword = inputStream.next();\n\t\t\t\tString readEmployeeNumber = inputStream.next();\n\t\t\t\tString readName = inputStream.next();\n\t\t\t\tString readPhone = inputStream.next();\n\t\t\t\tString readEmail = inputStream.next();\n\t\t\t\tif (instanceOf.contains(\"*AD*\")) {\n\t\t\t\t\tAdmin a1 = new Admin(readUserName, readPassword, readEmployeeNumber, readName, readPhone,\n\t\t\t\t\t\t\treadEmail);\n\t\t\t\t\tuserInfoArray.add(a1);\n\t\t\t\t\t//System.out.println(\"Read an Admin User: \" + ((User) a1).getUserName() + \" \" + a1.getPassword() + \" \"+ a1.getEmployeeNum());\n\t\t\t\t} else if (instanceOf.contains(\"*CC*\")) {\n\t\t\t\t\tCourseCoordinator a1 = new CourseCoordinator(readUserName, readPassword, readEmployeeNumber,\n\t\t\t\t\t\t\treadName, readPhone, readEmail);\n\t\t\t\t\tuserInfoArray.add(a1);\n\t\t\t\t\t//System.out.println(\"Read an CC User: \" + ((User) a1).getUserName() + \" \" + a1.getPassword() + \" \"+ a1.getEmployeeNum());\n\t\t\t\t} else if (instanceOf.contains(\"*AP*\")) {\n\t\t\t\t\tApproval a1 = new Approval(readUserName, readPassword, readEmployeeNumber, readName, readPhone,\n\t\t\t\t\t\t\treadEmail);\n\t\t\t\t\tuserInfoArray.add(a1);\n\t\t\t\t\t//System.out.println(\"Read an Approval User: \" + ((User) a1).getUserName() + \" \" + a1.getPassword()+ \" \" + a1.getEmployeeNum());\n\t\t\t\t} else if (instanceOf.contains(\"*CA*\")) {\n\t\t\t\t\tCasual a1 = new Casual(readUserName, readPassword, readEmployeeNumber, readName, readPhone,\n\t\t\t\t\t\t\treadEmail);\n\t\t\t\t\ta1.setHrly_rate(inputStream.nextInt());\n\t\t\t\t\tuserInfoArray.add(a1);\n\t\t\t\t\t//System.out.println(\"Read an Casual User: \" + ((User) a1).getUserName() + \" \" + a1.getPassword()+ \" \" + a1.getEmployeeNum());\n\t\t\t\t}\n\t\t\t}\n\t\t} catch (IllegalStateException e) {\n\t\t\tSystem.err.println(\"Could not read from the file\");\n\t\t} catch (InputMismatchException e) {\n\t\t\tSystem.err.println(\"Something wrong happened while reading the file\");\n\t\t}\n\t\tinputStream.close();\n\t}", "private static void readUserListFromFile() {\n\t\tJSONParser parser = new JSONParser();\n\n\t\ttry (Reader reader = new FileReader(\"users.json\")) {\n\n\t\t\tJSONArray userListJSON = (JSONArray) parser.parse(reader);\n\n\t\t\tfor (int i = 0 ; i < userListJSON.size(); i++) {\n\t\t\t\tJSONObject user = (JSONObject) userListJSON.get(i);\n\t\t\t\tString name = (String) user.get(\"name\");\n\t\t\t\tString surname = (String) user.get(\"surname\");\n\t\t\t\tString username = (String) user.get(\"username\");\n\t\t\t\tString password = (String) user.get(\"password\");\n\t\t\t\tString account = (String) user.get(\"account\");\n\n\t\t\t\tif(account.equals(\"employee\")) {\n\t\t\t\t\tMain.userList.add(new Employee(username, name, surname, password));\n\t\t\t\t} else {\n\t\t\t\t\tMain.userList.add(new Customer(username, name, surname, password));\n\t\t\t\t}\n\t\t\t}\n\n\t\t} catch (IOException e) {\n\t\t\te.printStackTrace();\n\t\t} catch (ParseException e) {\n\t\t\te.printStackTrace();\n\t\t}\n\t}", "public void saveUsers() {\n FileWriter fileWriter = null;\n PrintWriter printWriter = null;\n try {\n fileWriter = new FileWriter(pathData);\n printWriter = new PrintWriter(fileWriter);\n if (users != null) {\n \n for (Map.Entry m : users.entrySet()) {\n printWriter.println(m.getKey() + spChar + m.getValue() + \"\\n\");\n }\n }\n printWriter.close();\n } catch (IOException e) {\n }\n }", "private void readFileToUser(String fileName){\r\n\t\tString line = null;\r\n\t\ttry {\r\n\t\t\t// FileReader reads text files in the default encoding.\r\n\t\t\tFileReader fileReader = \r\n\t\t\t\t\tnew FileReader(fileName);\r\n\r\n\t\t\t// Always wrap FileReader in BufferedReader.\r\n\t\t\tBufferedReader bufferedReader = \r\n\t\t\t\t\tnew BufferedReader(fileReader);\r\n\r\n\t\t\twhile((line = bufferedReader.readLine()) != null) {\r\n\t\t\t\tString[] split = line.split(\",\", 3);\r\n\t\t\t\tString username = split[0];\r\n\t\t\t\tString password = split[1];\r\n\t\t\t\tString user = split[2];\r\n\t\t\t\tusers.add(new User(username,password,user));\r\n\r\n\t\t\t} \r\n\t\t\tbufferedReader.close(); \r\n\t\t}\r\n\t\tcatch(FileNotFoundException ex) {\r\n\t\t\tSystem.out.println(\"Unable to open file '\" + fileName + \"'\"); \r\n\t\t}\r\n\t\tcatch(IOException ex) {\r\n\t\t\tSystem.out.println(\"Error reading file '\" + fileName + \"'\"); \r\n\t\t}\r\n\t}", "@SuppressWarnings(\"unchecked\")\n\tpublic static void readUserFile() {\n\t\ttry {\n\t\t\tObjectInputStream readFile = new ObjectInputStream(new FileInputStream(userFile));\n\t\t\tVerify.userList = (ArrayList<User>) readFile.readObject();\n\t\t\treadFile.close();\n\t\t} catch (FileNotFoundException e) {\n\t\t\te.printStackTrace();\n\t\t} catch (IOException e) {\n\t\t\te.printStackTrace();\n\t\t} catch (ClassNotFoundException e) {\n\t\t\te.printStackTrace();\n\t\t}\n\t\t//add contents of file to separate lists\n\t\tfor (int i=0; i<Verify.userList.size(); i++) {\n\t\t\tVerify.userIds.add(Verify.userList.get(i).getUserId());\n\t\t\tVerify.usernames.add(Verify.userList.get(i).getUsername());\n\t\t\tif (Verify.userList.get(i).getAccounts() != null) {\n\t\t\t\tVerify.accountList.addAll(Verify.userList.get(i).getAccounts());\n\t\t\t}\n\t\t\tif (Verify.userList.get(i).getRequests() != null) {\n\t\t\t\tVerify.requestList.addAll(Verify.userList.get(i).getRequests());\t\n\t\t\t}\n\t\t}\n\t\tfor (Account account: Verify.accountList) {\n\t\t\tVerify.accountIds.add(account.getAccountId());\n\t\t}\n\t}", "private void loadUsers() throws IOException {\n File accounts = new File(\"accounts.txt\");\n if (!accounts.exists()) {\n accounts.createNewFile();\n }\n\n FileInputStream fileInputStream = new FileInputStream(accounts);\n BufferedReader bufferedReader = new BufferedReader(new InputStreamReader(fileInputStream));\n\n for (String line = bufferedReader.readLine(); line != null; line = bufferedReader.readLine()) {\n String[] pair = line.split(\":\");\n userAccounts.put(pair[0], pair[1]);\n }\n }", "private static ArrayList<User> loadInitialData(){\n\t\tArrayList<User> users = new ArrayList<User>();\n\t\t// From the users list get all the user names\n\t\tfor (String username:Utils.FileUtils.getFileLines(Global.Constants.LIST_OF_USERS)){ // refers \"users\" file\n\t\t\tArrayList<Directory> directories = new ArrayList<Directory>();\n\t\t\t// For a user name, read the names of directories registered\n\t\t\t// Note: All directory names are provided in the file bearing user name\n\t\t\tif (Utils.FileUtils.exists(Global.Constants.DIRECTORY_LOCATION + username)) { // refers to a specific user file \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t // that has directories\n\t\t\t\tfor (String dir:Utils.FileUtils.getFileLines(Global.Constants.DIRECTORY_LOCATION + username)) {\n\t\t\t\t\tArrayList<String> documents = new ArrayList<String>();\n\t\t\t\t\t// For each directory, read names of files saved\n\t\t\t\t\t// Note: All file names are provided in the file bearing username$dirname\n\t\t\t\t\tif (Utils.FileUtils.exists(Global.Constants.DIRECTORY_LOCATION, username + \"$\" + dir)) {\n\t\t\t\t\t\tfor (String doc:Utils.FileUtils.getFileLines(Global.Constants.DIRECTORY_LOCATION + username + \"$\" + dir)) {\n\t\t\t\t\t\t\tdocuments.add(doc);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tdirectories.add(new Directory(dir, documents));\n\t\t\t\t}\n\t\t\t}\n\t\t\tusers.add(new User(username, directories));\n\t\t}\n\t\treturn users;\n\t}", "public void saveUsers() {\n\t\ttry {\n\t\t\t\n\t\t\tFile xmlFile = new File(\"Users.xml\");\n\t\t\tDocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();\n\t\t\tDocumentBuilder builder = factory.newDocumentBuilder();\n\t\t\tDocument document = builder.parse(xmlFile);\n\t\t\tElement users = document.getDocumentElement();\n\t\t\t\n\t\t\tArrayList<Student> u = ManageUsers.getActiveList();\n\t\t\tfor (int i = 0; i < u.size(); i++) {\n\t\t\t\t// Grab the info for a specific student\n\t\t\t\tStudent s = u.get(i);\n\t\t\t\tString fName = s.getFirstName();\n\t\t\t\tString lName = s.getLastName();\n\t\t\t\tint ucid = s.getUcid();\n\t\t\t\tint currentBorrowing = s.getCurrentBorrowing();\n\t\t\t\tboolean isActive = true;\n\t\t\t String username = s.getUsername();\n\t\t\t String password = s.getPassword();\n\t\t\t boolean isLibrarian = s.getIsLibrarian();\n\t\t\t \n\t\t\t Element student = document.createElement(\"student\");\n\t\t\t \n\t\t\t // Make a new element <student>\n\t\t\t // Add the element to the xml as a child of <Users>\n\t\t\t // Add the above fields (fName, etc.) as child nodes to the new student node\n\t\t\t}\n\t\t\t\n\t\t} catch (Exception e) {\n\t\t\tSystem.out.println(\"Something went wrong with writing to the xml\");\n\t\t\tSystem.out.println(e);\n\t\t}\n\t}", "private void setUserAccount() throws FileNotFoundException\r\n\t{\r\n\t\tint index = 0;\r\n\t\tFile inputFile = new File(\"UserAccount.txt\");\r\n\t\tScanner input = new Scanner(inputFile);\r\n\t\tif (!inputFile.exists())\r\n\t\t{\r\n\t\t\tSystem.out.println(\"The text file \\\"UserAccount.txt\\\" is missing\");\r\n\t\t\tSystem.exit(0);\r\n\t\t}\r\n\t\twhile(input.hasNextLine())\r\n\t\t{\r\n\t\t\tuserAccounts[0][index] = input.nextLine();\t\t\t//stores the username\r\n\t\t\tuserAccounts[1][index] = input.nextLine();\t\t\t//stores the password\r\n\t\t\tnumOfUsers++;\r\n\t\t\tindex++;\r\n\t\t}\r\n\t}", "protected void reloadUsers() {\r\n\t\tif (smscListener != null) {\r\n\t\t\ttry {\r\n\t\t\t\tif (users != null) {\r\n\t\t\t\t\tusers.reload();\r\n\t\t\t\t} else {\r\n\t\t\t\t\tusers = new Table(usersFileName);\r\n\t\t\t\t}\r\n\t\t\t\tSystem.out.println(\"Users file reloaded.\");\r\n\t\t\t} catch (FileNotFoundException e) {\r\n\t\t\t\tevent.write(e, \"reading users file \" + usersFileName);\r\n\t\t\t} catch (IOException e) {\r\n\t\t\t\tevent.write(e, \"reading users file \" + usersFileName);\r\n\t\t\t}\r\n\t\t} else {\r\n\t\t\tSystem.out.println(\"You must start listener first.\");\r\n\t\t}\r\n\t}", "public void load(){\n\t\n\t\ttry {\n\t\t\t\n\t\t\t// Open Streams\n\t\t\tFileInputStream inFile = new FileInputStream(\"user.ser\");\n\t\t\tObjectInputStream objIn = new ObjectInputStream(inFile);\n\t\t\t\n\t\t\t// Load the existing UserList at the head\n\t\t\tthis.head = (User)objIn.readObject();\n\t\t\t\n\t\t\t// Close Streams\n\t\t\tobjIn.close();\n\t\t\tinFile.close();\n\t\t}\n\n\t\tcatch(Exception d) {\n\t\t System.out.println(\"Error loading\");\n\t\t}\n\n\t}", "public void readUserFile (){\n try {\n FileReader reader = new FileReader(fileName);\n BufferedReader bufferedReader = new BufferedReader(reader);\n String line;\n while ((line = bufferedReader.readLine()) != null) {\n Scanner s = new Scanner(line); //use of a scanner to parse the line and assign its tokens to different variables\n//each line corresponds to the values of a User object\n while(s.hasNext()){\n String usrname = s.next();\n String pass = s.next();\n User u = new User(usrname,pass);\n userlist.add(u);//added to the list\n }\n \n }\n reader.close();\n \n } catch (IOException e) {\n e.printStackTrace();\n }\n }", "private ArrayList<User> loadUsers(InputStream is) throws IOException{\n\t\tBufferedReader br = new BufferedReader(new InputStreamReader(is));\r\n\t\tStringBuilder jsonFileContent = new StringBuilder();\r\n\t\t//read line by line from file\r\n\t\tString nextLine = null;\r\n\t\twhile ((nextLine = br.readLine()) != null){\r\n\t\t\tjsonFileContent.append(nextLine);\r\n\t\t}\r\n\r\n\t\tGson gson = new Gson();\r\n\t\t//this is a require type definition by the Gson utility so Gson will \r\n\t\t//understand what kind of object representation should the json file match\r\n\t\tType type = new TypeToken<ArrayList<User>>(){}.getType();\r\n\t\tArrayList<User> users = gson.fromJson(jsonFileContent.toString(), type);\r\n\t\t//close\r\n\t\tbr.close();\t\r\n\t\treturn users;\r\n\t}", "public void loadAllUsers(String filename) throws Exception {\r\n BufferedReader br = new BufferedReader(new FileReader(filename));\r\n String name;\r\n try {\r\n while ((name = br.readLine()) != null)\r\n addUser(name);\r\n } catch (Exception e) {\r\n throw new Exception(\"Error: File not Readable\");\r\n }\r\n }", "public void dumpUsers() {\r\n\t\tuserList.removeAll(userList);\r\n\t\ttry {\r\n\t\t\texportUserList();\r\n\t\t} catch (IOException e) {\r\n\t\t\te.printStackTrace();\r\n\t\t}\r\n\t}", "public static void writeTo(String filename, List<User> users){\r\n\t\tPrintWriter pw=null;\r\n\t\ttry{\r\n\t\t\tpw=new PrintWriter(new FileOutputStream(new File(filename),false));//false because don't append,\r\n\t\t\tfor(User user : users){//it replaces all with new updated data\r\n\t\t\t\tpw.write(user+\"\\n\");\r\n\t\t\t}\t\t\t\r\n\t\t}catch(IOException e){\r\n\t\t\te.printStackTrace();\r\n\t\t}finally{\r\n\t\t\tpw.close();\r\n\t\t}\r\n\t}", "private Collection<User> loadUsers(InputStream is) throws IOException{\r\n\t\t\r\n\t\t//wrap input stream with a buffered reader to allow reading the file line by line\r\n\t\tBufferedReader br = new BufferedReader(new InputStreamReader(is));\r\n\t\tStringBuilder jsonFileContent = new StringBuilder();\r\n\t\t//read line by line from file\r\n\t\tString nextLine = null;\r\n\t\twhile ((nextLine = br.readLine()) != null){\r\n\t\t\tjsonFileContent.append(nextLine);\r\n\t\t}\r\n\r\n\t\tGson gson = new Gson();\r\n\t\t//this is a require type definition by the Gson utility so Gson will \r\n\t\t//understand what kind of object representation should the json file match\r\n\t\tType type = new TypeToken<Collection<User>>(){}.getType();\r\n\t\tCollection<User> users = gson.fromJson(jsonFileContent.toString(), type);\r\n\t\t//close\r\n\t\tbr.close();\t\r\n\t\treturn users;\r\n\r\n\t}", "private void loadData() {\n FileInputStream fis;\n\n try {\n fis = openFileInput(DATA_FILE);\n user = (User) new JsonReader(fis).readObject();\n fis.close();\n } catch(Exception e) {\n Log.i(\"Exception :\", e.toString());\n }\n }", "@SuppressWarnings(\"unchecked\")\r\n\tpublic CopyOnWriteArrayList<User> importUserList() throws IOException, ClassNotFoundException, FileNotFoundException {\r\n\t\tObjectInputStream in;\r\n\t\tCopyOnWriteArrayList<User> tmpUserList = new CopyOnWriteArrayList<User>();\r\n\t\tin= new ObjectInputStream(\r\n\t\t\t\tnew BufferedInputStream(\r\n\t\t\t\t\t\tnew FileInputStream(\"userList.dat\")));\r\n\t\ttmpUserList= (CopyOnWriteArrayList<User>)in.readObject();\r\n\t\tin.close();\r\n\t\treturn tmpUserList;\r\n\t}", "public static void serializeUsers(ListOfAllUsers list) throws FileNotFoundException, IOException {\n\t\tObjectOutputStream oos = new ObjectOutputStream(new FileOutputStream(userFile));\n\t\toos.writeObject(list);\n\t\toos.close();\n\t\t//System.out.println(\"Serialized.\");\n\t}", "public static void writeData(List<User> users) {\n FileOutputStream fos = null;\n ObjectOutputStream oos = null;\n try {\n fos = new FileOutputStream(USER_SAVE_FILE_NAME, false);\n oos = new ObjectOutputStream(fos);\n oos.writeObject(users);\n oos.close();\n fos.close();\n } catch (IOException ioe) {\n ioe.printStackTrace();\n } finally {\n if (fos != null && oos != null) {\n try {\n oos.close();\n fos.close();\n } catch (Exception ex) {\n Logger.getLogger(Utilities.UserDataIO.class.getName()).log(Level.SEVERE, null, ex);\n }\n } else {\n\n }\n }\n }", "@Override\n public void updateUserJson() {\n synchronized (lockUpdateUserJson) {\n try (PrintWriter printer = new PrintWriter(\"Database/Users.json\")) {\n ArrayList<User> userAsArray = new ArrayList<>();\n for (Map.Entry<String, User> entry : mapOfRegisteredUsersByUsername.entrySet()) {\n userAsArray.add(entry.getValue());\n }\n GsonBuilder gsonBuilder = new GsonBuilder();\n gsonBuilder.setLongSerializationPolicy(LongSerializationPolicy.STRING);\n Gson writer = gsonBuilder.create();\n JsonObject jsonObject = new JsonObject();\n jsonObject.add(\"users\", writer.toJsonTree(userAsArray));\n printer.print(jsonObject);\n } catch (IOException ex) {\n }\n }\n }", "public static ArrayList<User> readData() {\n ArrayList<User> users = new ArrayList<>();\n ObjectInputStream in = null;\n try {\n in = new ObjectInputStream(new FileInputStream(USER_SAVE_FILE_NAME));\n users = (ArrayList<User>) in.readObject();\n in.close();\n } catch (Exception e) {\n System.out.println(e.getMessage());\n }\n if (in == null) {\n return users;\n } else {\n try {\n in.close();\n } catch (Exception ex) {\n Logger.getLogger(Utilities.UserDataIO.class.getName()).log(Level.SEVERE, null, ex);\n }\n }\n\n return users;\n }", "public void getUserData()\n\t{\n\t\tint count; //Loop counter\n\t\tString pathname = filename;\n\t\t\n\t\tString div = \",\"; //Used to divide info.\n\t\tString [] userArray; //To hold divided info.\n\t\t\n\t\ttry {\n FileReader reader = new FileReader(pathname);\n BufferedReader bufferedReader = new BufferedReader(reader);\n \n String line;\n \n //While getting each line of the data file, BUT stops when USER data found.\n //Loop through each line and determine which user data to choose.\n while ((line = bufferedReader.readLine()) != null) {\n // System.out.println(\"User Data in file: \" + line);\n \n System.out.println(\"Checking User name in line of data ...\");\n \n //This divides the info in the data file into an array.\n userArray = line.split(div); \n \n \n if (User.equals(userArray[0]))\n \t{\n \t\tSystem.out.println(\"User Found: \" + User);\n \t\tuser_line = line;\n \t\t//Assigning data to class variables.\n \t\tUserPassword = userArray[1].trim(); //Assigning the password.\n \t\tDevice_ID = Integer.parseInt(userArray[2].trim()); //Assigning device ID.\n \t\tisLost = (Integer.parseInt(userArray[3].trim()) == 0) ? false : true;\n \t\t\n \t\t//This reads out information.\n \t\tfor (count = 0; count < userArray.length; count++)\n {\n \t\t\tSystem.out.println(\"INFO: \" + userArray[count]);\n }\n \t\tbreak;\n \t}\n System.out.println(\"========================================\");\n }\n reader.close();\n \n } catch (IOException e) {\n e.printStackTrace();\n }\n\t}", "public void load(String fileName) throws IOException{\n\t\tFileInputStream fileIn=null;\n\t try {\n\t\t\tfileIn = new FileInputStream(fileName);\n\t\t\tArrayList<User1> userList; // = new ArrayList<User1>();\n\t\t\tObjectMapper mapper = new ObjectMapper();\n\t\t\t// Tramite la funzione readValue riottengo la lista degli utenti a partire dalla stringa con codifica JSON\n\t\t\t//userList = mapper.readValue(fileIn, new TypeReference<ArrayList<User1>>());\n\t\t\tUser1[] array = mapper.readValue(fileIn, User1[].class);\n\t\t\tuserList=new ArrayList<>(Arrays.asList(array));\n\t\t\tfor(User1 userWrapped : userList) // Per ogni utente nella lista, riottengo l'oggetto User, andando a ripopolare il Realm (ripristino)\n\t\t\t{\n\t\t\t\tUser user = new User(userWrapped.getIdentifier(), userWrapped.getSecret());\n\t\t\t\trealm.getUsers().add(user); // Aggiungo l'utente alla lista\n\t\t\t}\n\t\t\tfileIn.close();\n\t\t} catch (IOException e){\n\t\t\tif(fileIn!=null)fileIn.close();\n\t \tthrow e;\n\t\t}\n\n\t}", "private List<User> readFromFile() {\n\n List<String> lines = new ArrayList<>();\n List<User> contactList = new ArrayList<>();\n Map<String, PhoneNumber> phoneNumbersNewUser = new HashMap<>();\n\n try (BufferedReader in = new BufferedReader(new FileReader(contactsFile))) {\n String line;\n while ((line = in.readLine()) != null) {\n lines.add(line);\n }\n\n } catch (IOException ex) {\n System.out.println(\"File not found \\n\" + ex);\n ;\n }\n\n for (String line : lines) {\n String[] userProperties = line.split(\"\\\\|\");\n\n int id = Integer.parseInt(userProperties[0]);\n String fName = userProperties[1];\n String lName = userProperties[2];\n String email = userProperties[3];\n int age = Integer.parseInt(userProperties[4]);\n String[] phones = userProperties[5].split(\"\\\\,\");\n String[] homePhone = phones[0].split(\"\\\\_\");\n String[] mobilePhone = phones[1].split(\"\\\\_\");\n String[] workPhone = phones[2].split(\"\\\\_\");\n phoneNumbersNewUser.put(homePhone[0], new PhoneNumber(homePhone[1], homePhone[2]));\n phoneNumbersNewUser.put(mobilePhone[0], new PhoneNumber(mobilePhone[1], mobilePhone[2]));\n phoneNumbersNewUser.put(workPhone[0], new PhoneNumber(workPhone[1], workPhone[2]));\n String[] homeAdress = userProperties[6].split(\"\\\\,\");\n Address homeAdressNewUser = new Address(homeAdress[0], Integer.parseInt(homeAdress[1]), Integer.parseInt(homeAdress[2]),\n homeAdress[3], homeAdress[4], homeAdress[5], homeAdress[6]);\n String title = userProperties[7];\n String[] companyProperties = userProperties[8].split(\"\\\\_\");\n String[] companyAddress = companyProperties[1].split(\"\\\\,\");\n Address companyAddressNewUser = new Address(companyAddress[0], Integer.parseInt(companyAddress[1]),\n Integer.parseInt(companyAddress[2]), companyAddress[3], companyAddress[4], companyAddress[5],\n companyAddress[6]);\n String companyName = companyProperties[0];\n Company companyNewUser = new Company(companyName, companyAddressNewUser);\n boolean isFav = Boolean.parseBoolean(userProperties[9]);\n User user = new User(id, fName, lName, email, age, phoneNumbersNewUser, homeAdressNewUser, title, companyNewUser, isFav);\n contactList.add(user);\n }\n\n\n return contactList;\n }", "private void loadDataFromFile() {\n boolean isLoggedInNew = na.isLoggedIn();\n boolean isLoggedIn = uL.isLoggedIn();\n // load data for new users after sucsessful new account creation\n if (isLoggedInNew) {\n String username = na.getUsername();\n String fileExt = \"_data.txt\";\n String workingDirectory = System.getProperty(\"user.dir\");\n String filePath = workingDirectory + \"\\\\\" + username + fileExt;\n File file = new File(filePath);\n try {\n FileReader fr = new FileReader(file);\n BufferedReader br = new BufferedReader(fr);\n DefaultTableModel model = (DefaultTableModel) remindersTable.getModel();\n Object[] lines = br.lines().toArray();\n for (int i = 0; i < lines.length; i++) {\n String[] row = lines[i].toString().split(\"\\t\");\n model.addRow(row);\n }\n } catch (FileNotFoundException ex) {\n Logger.getLogger(MoneyMinderDesktopMainGui.class.getName()).log(Level.SEVERE, null, ex);\n }\n }\n // load data for existing users after sucsessful login\n if (isLoggedIn) {\n String username = uL.getUsername();\n String fileExt = \"_data.txt\";\n String workingDirectory = System.getProperty(\"user.dir\");\n String filePath = workingDirectory + \"\\\\\" + username + fileExt;\n File file = new File(filePath);\n try {\n FileReader fr = new FileReader(file);\n BufferedReader br = new BufferedReader(fr);\n DefaultTableModel model = (DefaultTableModel) remindersTable.getModel();\n Object[] lines = br.lines().toArray();\n for (int i = 0; i < lines.length; i++) {\n String[] row = lines[i].toString().split(\"\\t\");\n model.addRow(row);\n }\n } catch (FileNotFoundException ex) {\n Logger.getLogger(MoneyMinderDesktopMainGui.class.getName()).log(Level.SEVERE, null, ex);\n }\n }\n }", "private void loadUser() {\n File dataFile = new File(getFilesDir().getPath() + \"/\" + DATA_FILE);\n\n if(dataFile.exists()) {\n loadData();\n } else { // First time CigCount is launched\n user = new User();\n }\n }", "public static void exportUserList() throws IOException {\r\n\t\tObjectOutputStream out = new ObjectOutputStream(\r\n\t\t\t\tnew BufferedOutputStream(\r\n\t\t\t\t\t\tnew FileOutputStream(\"userList.dat\")));\r\n\t\tout.writeObject(userList);\r\n\t\tout.close();\r\n\t}", "public void writeUnregisteredUsers(int id) {\n try {\n JSONObject obj = (JSONObject) jsonParser.parse(new FileReader(file.getPath()));\n\n JSONArray unregisteredUser = (JSONArray) obj.get(\"UnregisteredUsers\");\n\n boolean isExist = false;\n JSONObject idUnregistered;\n\n for (int i = 0; !isExist && i < unregisteredUser.size(); i++) {\n idUnregistered = (JSONObject) unregisteredUser.get(i);\n\n if (Integer.parseInt(idUnregistered.get(\"id\").toString()) == id) {\n isExist = true;\n }\n }\n\n if (!isExist) {\n JSONObject unregisteredUsers = new JSONObject();\n\n unregisteredUsers.put(\"id\", id);\n\n unregisteredUser.add(unregisteredUsers);\n\n JSONArray county = (JSONArray) obj.get(\"Counties\");\n JSONArray register = (JSONArray) obj.get(\"Registry\");\n\n JSONObject objWrite = new JSONObject();\n\n objWrite.put(\"UnregisteredUsers\", unregisteredUser);\n objWrite.put(\"Registry\", register);\n objWrite.put(\"Counties\", county);\n\n FileWriter fileWriter = new FileWriter(file.getPath());\n\n fileWriter.write(objWrite.toJSONString());\n\n fileWriter.close();\n }\n\n } catch (IOException | ParseException e) {\n e.printStackTrace();\n }\n }", "@Override\r\n\tpublic void writeUsers(UserClass user, ArrayList<UserClass> array,\r\n\t\t\tString address) {\n\t\t\r\n\t}", "public void userSettings(String userName, String password, File nameFile,File passFile, String fileadd) {\n try\n {\n \n if(!nameFile.exists())\n {\n nameFile.createNewFile();\n }\n if(!passFile.exists())\n {\n passFile.createNewFile();\n }\n \n FileReader ufr = new FileReader(nameFile);\n FileReader pfr = new FileReader(passFile);\n \n BufferedReader ubr = new BufferedReader(ufr);\n BufferedReader pbr = new BufferedReader(pfr);\n \n ArrayList<String> uName = new ArrayList<>();\n ArrayList<String> uPass = new ArrayList<>();\n for (int i = 0; i < lineNum(fileadd); i++) {\n uName.add(ubr.readLine());\n uPass.add(pbr.readLine());\n }\n for (int i = 0; i < lineNum(fileadd); i++) \n {\n if (userName.equals(uName.get(i)))\n {\n uPass.set(i, password);\n } \n }\n \n ufr.close();\n pfr.close();\n FileWriter fw = new FileWriter(passFile);\n PrintWriter pw = new PrintWriter(fw);\n pw.print(\"\");\n \n FileWriter fw2 = new FileWriter(passFile, true);\n PrintWriter pw2 = new PrintWriter(fw2, true);\n \n for (int j = 0; j < uPass.size() -1; j++)\n {\n \n pw.print(uPass.get(j));\n pw.println();\n \n }\n pw.close();\n }catch(Exception e)\n {\n e.printStackTrace();\n }\n \n }", "public void StoreUsers(ArrayList<User> usersList) {\r\n\t\ttry {\r\n\t\t\tfw = new FileWriter(\".\\\\data\\\\users.txt\"); // writes data into\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t// \\\\data\\\\books.txt\r\n\t\t\tbw = new BufferedWriter(fw);\r\n\r\n\t\t\tfor (int i = 0; i < usersList.size(); i++) { // for loop will run\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// till\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// the size of the\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// array\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// list usersList\r\n\t\t\t\tString content = \"\"; // Content is declared as String\r\n\t\t\t\tUser user = usersList.get(i); // Gets content of the array list\r\n\t\t\t\tcontent += user.getId() + \"::\"; // Gets ID of the Member and\r\n\t\t\t\t\t\t\t\t\t\t\t\t// adds ::\r\n\t\t\t\tcontent += user.getName() + \"::\"; // Gets Name of the Member and\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t// adds ::\r\n\t\t\t\tcontent += user.getNumBooksBorrowed() + \"::\"; // Gets Number of\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// Books\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// Borrowed of\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// the Member\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// and adds ::\r\n\t\t\t\tcontent += user.getPhone() + \"::\"; // Gets Phone Number of the\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t// Member and adds ::\r\n\t\t\t\tcontent += user.getreturndate() + \"\\n\"; // Gets Return Date of\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t// the Member\r\n\r\n\t\t\t\tbw.write(content); // writes the content of the Members in the\r\n\t\t\t\t\t\t\t\t\t// text file\r\n\r\n\t\t\t}\r\n\t\t\tJOptionPane.showMessageDialog(null, \"Complete storing all users!\", \"Store Users\",\r\n\t\t\t\t\tJOptionPane.PLAIN_MESSAGE); // confirms with a message that\r\n\t\t\t\t\t\t\t\t\t\t\t\t// the Members are stored\r\n\t\t} catch (IOException e) {\r\n\t\t\te.printStackTrace();\r\n\t\t} finally {\r\n\t\t\ttry {\r\n\t\t\t\tif (bw != null)\r\n\t\t\t\t\tbw.close();\r\n\t\t\t\tif (fw != null)\r\n\t\t\t\t\tfw.close();\r\n\t\t\t} catch (IOException ex) {\r\n\t\t\t\tex.printStackTrace();\r\n\t\t\t}\r\n\t\t}\r\n\t}", "public static void setUser() throws FileNotFoundException {\n\t\tusertext.getParentFile().mkdirs();\n\t\tScanner search = new Scanner(usertext);\n\t\twhile (search.hasNextLine()) {\n\t\t\tString phrase = search.nextLine().trim();\n\t\t\tString[] user = phrase.split(\";\");\n\t\t\tworkers.add(new EachUser(user[0], user[1]));\n\t\t}\n\t\tsearch.close();\n\t}", "public static void datafile() throws IOException {\n // Create avro records\n User user1 = new User();\n user1.setName(\"Alyssa\");\n user1.setFavoriteNumber(256);\n User user2 = new User(\"Ben\", 7, \"red\");\n User user3 = User.newBuilder()\n .setName(\"Charlie\")\n .setFavoriteColor(\"blue\")\n .setFavoriteNumber(null)\n .build();\n\n File file = new File(\"/tmp/users.avro\");\n\n // Serialize user1, user2 and user3 to disk\n DatumWriter<User> userDatumWriter = new SpecificDatumWriter<>(User.class);\n DataFileWriter<User> dataFileWriter = new DataFileWriter<>(userDatumWriter);\n dataFileWriter.create(user1.getSchema(), new File(\"/tmp/users.avro\"));\n dataFileWriter.append(user1);\n dataFileWriter.append(user2);\n dataFileWriter.append(user3);\n dataFileWriter.close();\n\n // Deserialize Users from disk\n DatumReader<User> userDatumReader = new SpecificDatumReader<>(User.class);\n DataFileReader<User> dataFileReader = new DataFileReader<>(file, userDatumReader);\n User user = null;\n while (dataFileReader.hasNext()) {\n // Reuse user object by passing it to next(). This saves us from\n // allocating and garbage collecting many objects for files with\n // many items.\n user = dataFileReader.next(user);\n System.out.println(user);\n }\n }", "public void addUsers(String[] array) {\n\n boolean existingUser = false;\n int newUser;\n ArrayList<Integer> userList;\n\n if(userObservers.containsKey(array[1])) {\n addObserver(userObservers.get(array[1]));\n users.add(array[1]);\n existingUser = false;\n }\n\n if(array.length > 2){\n String[] otherUsers = array[2].split(nameSeparator);\n\n for(int i = 0; i < otherUsers.length; i++) {\n addObserver(userObservers.get(otherUsers[i]));\n users.add(otherUsers[i]);\n }\n }\n }", "public void importUsers(String filename) throws Exception {\r\n\t\tFileReader fr = new FileReader(filename);\r\n\t\tBufferedReader br = new BufferedReader(fr);\r\n\t\t\r\n\t\twhile(true) {\r\n\t\t\tString line = br.readLine();\r\n\t\t\tif (line == null)\r\n\t\t\t\tbreak;\r\n\t\t\tString[] tokens = line.split(\",\");\r\n\t\t\tString userLastName = tokens[0].trim();\r\n\t\t\tString userFirstName = tokens[1].trim();\r\n\t\t\tString userMiddleName = tokens[2].trim();\t\t\t\r\n\t\t\tString email = tokens[3].trim();\r\n\t\t\tString userName = tokens[4].trim();\r\n\t\t\tString password = tokens[5].trim();\r\n\t\t\t\r\n\t\t\tSystem.out.println(\"Line:\"+line);\r\n\t\t\tSystem.out.println(\"LastName:\"+userLastName);\r\n\t\t\tSystem.out.println(\"FirstName:\"+userFirstName);\r\n\t\t\tSystem.out.println(\"MiddleName:\"+userMiddleName);\r\n\t\t\tSystem.out.println(\"Email:\"+email);\r\n\t\t\tSystem.out.println(\"UserName:\"+userName);\r\n\t\t\tSystem.out.println(\"Password:\"+password);\r\n\t\t\t\r\n\t\t\tUser user = new User();\r\n\t\t\tuser.setLastName(userLastName);\r\n\t\t\tuser.setFirstName(userFirstName);\r\n\t\t\tuser.setMiddleName(userMiddleName);\r\n\t\t\tuser.setEmailAddress(email);\r\n\t\t\tuser.setUserName(userName);\r\n\t\t\tuser.setPassword(password);\t\t\t\r\n\t\t\tuser.setStatus(UserStatus.ACTIVE);\r\n\t\t\t\r\n\t\t\tem.persist(user);\r\n\t\t}\r\n\t\t\r\n\t\tbr.close();\r\n\t\tfr.close();\r\n\t}", "public ArrayList<User> getUsers(){\n\t\tArrayList<User> users = new ArrayList<User>();\n\t\tcreateFile(usersFile);\n\t\ttry {\n\t\t\tString[] data;\n\t\t\treader = new BufferedReader(new FileReader(usersFile));\n\n\t\t\tString strLine;\n\t\t\twhile((strLine = getLine()) != null){\n\t\t\t\tdata = strLine.split(\",\");\n\n\t\t\t\tUser user = new User(data[0], data[1],data[2],data[3]);\n\t\t\t\tusers.add(user);\n\n\t\t\t}\n\t\n\t\t}catch (IOException e){\n\t\t\t//TODO auto generated catch block\n\t\t\tSystem.err.println(e);\n\t\t}\n\n\t\treturn users;\n\t}", "@SuppressWarnings(\"unchecked\")\n private Map<String, String> getUsers() {\n try {\n return (HashMap<String, String>) FileUtil.getInstance().readObjectFromFile(openFileInput(\"users.ser\"));\n } catch (FileNotFoundException e) {\n e.printStackTrace();\n }\n return new HashMap<>();\n }", "public void repopFile() throws FileNotFoundException {\n\t\tPrintWriter writer = new PrintWriter(file.getName());\n\t\tfor(int i = 0; i < users.length; i++) {\n\t\t\tif(users[i].equals(\"\")) {\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\twriter.println(users[i]);\n\t\t}\n\t\twriter.close();\n\t}", "public static ListOfUsers readUsersFromFile(String filePath, SocialNetwork r) throws FileNotFoundException {\n Scanner scan = new Scanner(new File(filePath));\n ListOfUsers instance = r.getListOfUsers();\n Map<String, User> userMap = new LinkedHashMap<>();\n String nickName = \"\";\n String email = \"\";\n List<City> cities = new LinkedList();\n Map<User, Set<String>> friendsMap = new HashMap<>();\n Set<String> friends = new HashSet();\n Map<User, Set<User>> finalmap = new HashMap<>();\n while (scan.hasNext()) {\n \n friends = new HashSet();\n String firstLine = scan.next();\n String secondLine = scan.next();\n String[] splitFirstLine = firstLine.split(\",\");\n nickName = splitFirstLine[0];\n email = splitFirstLine[1];\n cities = getCitiesFromString(firstLine, r);\n friends = getFriendsFromString(secondLine, r);\n Object[] aux = cities.toArray();\n City currentCity = (City) aux[0];\n\n User newUser = new User(nickName, email, currentCity.getCityName(), cities, 0);\n \n for (City c : newUser.getCitiesVisited()) {\n newUser.setVisitPoints(newUser.getVisitPoints() + c.getNumberOfPointsAwarded());\n }\n \n friendsMap.put(newUser, friends);\n userMap.put(newUser.getNickname(), newUser);\n \n }\n instance.setUserMap(userMap);\n for (User u :userMap.values()) {\n for (User u2 :friendsMap.keySet()) \n {\n if(u.equals(u2)){\n for (String friend : friendsMap.get(u2)) {\n instance.addFriend(u.getNickname(),friend);\n }\n \n }\n }\n }\n// for (User u : friendsMap.keySet()) {\n// \n// Set<User> aux=new HashSet<>();\n//\n// finalmap.put(u, aux);\n// \n// }\n return instance;\n\n }", "public void atualiza_ficheiro_user(){//Atualiza o ficheiro users\n File f1 = new File(\"users.txt\");\n String pesq = \"\";\n if (f1.exists() && f1.isFile()){\n try{\n FileWriter fw = new FileWriter(f1);\n BufferedWriter bw = new BufferedWriter(fw);\n // 0 1 2 3 4 5 6 7\n // ':id:admin:nome:username:password:notificacoes:pesquisas'\n for(int i=0; i< lista_utilizadores.size();i++){\n int aux = 0;\n int aux_ativo = 0;\n if(lista_utilizadores.get(i).get_administrador()){\n aux = 1;\n }\n pesq = \"\";\n for(int j = 0; j < lista_utilizadores.get(i).get_pesquisas().size(); j++){\n\n pesq = pesq.concat(lista_utilizadores.get(i).get_pesquisas().get(j));\n pesq = pesq.concat(\"-\");\n }\n //System.out.println(\"pesq de = \" + i + \"| Pesquisa = \" + pesq);\n\n bw.append(\":\"+lista_utilizadores.get(i).get_id()+\":\"+aux+\":\"+lista_utilizadores.get(i).get_nome()+\":\"+lista_utilizadores.get(i).get_username()+\":\"+lista_utilizadores.get(i).get_password()+\":\"+lista_utilizadores.get(i).get_notificacoes()+\":\"+pesq+\":\");\n bw.newLine();\n }\n bw.close();\n\n fw.close();\n }\n catch (IOException ex) {\n System.out.println(\"Erro a escrever no ficheiro.\");\n }\n }\n else {\n System.out.println(\"Ficheiro nao existe.\");\n }\n }", "@Override\r\n\tprotected final void objectDataMapping() throws BillingSystemException{\r\n\t\tString[][] data=getDataAsArray(USER_DATA_FILE);\r\n\t\tif(validateData(data,\"Authorised User\",COL_LENGTH)){\r\n\t\tList<User> listUser=new ArrayList<User>();\r\n\t\t\r\n\t\tfor(int i=0;i<data.length;i++){\r\n\t \t\r\n\t \tUser usr=new User();\r\n\t \t\t\r\n\t \tusr.setUsername(data[i][0]);\r\n\t \tusr.setPassword(data[i][1]);\r\n\t \tusr.setRole(getRoleByCode(data[i][2]));\r\n\t \t\r\n\t \tlistUser.add(usr);\t\r\n\t }\r\n\r\n\t\t\r\n\t\tthis.listUser=listUser;\r\n\t\t}\r\n\t}", "public String[] getNames(){\n File file = new File(getContext().getFilesDir(),\"currentUsers.txt\");\n List<String> names = null;\n try {\n //read names from file\n names = new ArrayList<>(FileUtils.readLines(file, Charset.defaultCharset()));\n Log.i(TAG,\"names from currentUsers.txt: \" + names.toString());\n usernames = new String[names.size()];\n //populate the array with the data form file\n for(int i = 0; i < usernames.length; i++){\n String user = names.get(i);\n usernames[i] = user;\n Log.i(TAG, \"added \" + usernames[i] + \" to usernames array\");\n }\n } catch (IOException e) {\n Log.i(TAG, \"error: \" + e.getLocalizedMessage());\n }\n return usernames;\n }", "public void createUser(List<User> list) {\n\n Gson gson = new Gson();\n FileService writerService = new FileService();\n for (User user : list) {\n String userData = gson.toJson(user);\n writerService.writeToUserData(userData);\n }\n\n }", "public static void createOrOpenUsersFile() {\n try {\r\n File usersFile = new File(\"users.txt\");\r\n if (usersFile.createNewFile()) {\r\n System.out.println(\"\\nFile \" + usersFile.getName() + \" has been created.\");\r\n } else {\r\n System.out.println(\"\\nFile \" + usersFile.getName() + \" is ready.\");\r\n }\r\n } catch (IOException e) {\r\n System.out.println(\"An error occurred.\");\r\n e.printStackTrace();\r\n }\r\n }", "public static void writeUserFile(List<User> List) {\n\t\ttry {\n\t\t\tObjectOutputStream writeFile = new ObjectOutputStream(new FileOutputStream(userFile));\n\t\t\twriteFile.writeObject(List);\n\t\t\twriteFile.close();\n\t\t} catch (FileNotFoundException e) {\n\t\t\te.printStackTrace();\n\t\t} catch (IOException e) {\n\t\t\te.printStackTrace();\n\t\t}\n\t}", "public void addToFile(User newUser){\r\n //If the user name is not already in the file then we do not want to re-add the user.\r\n if (f.searchForUsername(newUser.getUsername()) == -1) {\r\n newUser.setPassword(encrypt(newUser.getPassword()));\r\n f.write(newUser);\r\n } else {\r\n System.err.println(\"User already exists\");\r\n }\r\n }", "public void addPlayerToPlayers(String username) throws IOException{\r\n\t\tScanner readPlayers = new Scanner(new BufferedReader(new FileReader(\"players.txt\")));\r\n\t\tint numberOfPlayers = readPlayers.nextInt();\r\n\t\tif(numberOfPlayers == 0) { // no need to store data to rewrite\r\n\t\t\ttry {\r\n\t\t\t\tFileWriter writer = new FileWriter(\"players.txt\");\r\n\t\t\t\tBufferedWriter playerWriter = new BufferedWriter(writer);\r\n\t\t\t\tnumberOfPlayers++;\r\n\t\t\t\tInteger numPlayers = numberOfPlayers; // allows conversion to string for writing\r\n\t\t\t\tplayerWriter.write(numPlayers.toString());\r\n\t\t\t\tplayerWriter.write(\"\\n\");\r\n\t\t\t\tplayerWriter.write(numPlayers.toString()); // write userId as 1 because only 1 player\r\n\t\t\t\tplayerWriter.write(\"\\n\");\r\n\t\t\t\tplayerWriter.write(username);\r\n\t\t\t\tplayerWriter.write(\"\\n\");\r\n\t\t\t\tplayerWriter.close();\r\n\t\t\t}\r\n\t\t\tcatch(IOException e) {\r\n\t\t\t\tSystem.out.println(e);\r\n\t\t\t}\r\n\t\t}\r\n\t\telse {\r\n\t\t\t/* Store all current usernames and userIds in a directory to rewrite to file */\r\n\t\t\tPlayerName[] directory = new PlayerName[numberOfPlayers];\r\n\t\t\t\r\n\t\t\tfor(int index = 0; index < numberOfPlayers; index++) {\r\n\t\t\t\tPlayerName playerName = new PlayerName();\r\n\t\t\t\tplayerName.setUserId(readPlayers.nextInt());\r\n\t\t\t\tplayerName.setUserName(readPlayers.next());\r\n\t\t\t\tdirectory[index] = playerName;\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\treadPlayers.close();\r\n\t\t\t/* Add a new player */\r\n\t\t\ttry {\r\n\t\t\t\tnumberOfPlayers++;\r\n\t\t\t\tFileWriter writer = new FileWriter(\"players.txt\");\r\n\t\t\t\tBufferedWriter playerWriter = new BufferedWriter(writer);\r\n\t\t\t\tInteger numPlayers = numberOfPlayers; // allows conversion to string for writing\r\n\t\t\t\tplayerWriter.write(numPlayers.toString());\r\n\t\t\t\tplayerWriter.write(\"\\n\"); // maintains format of players.txt\r\n\t\t\t\t\r\n\t\t\t\tfor(int index = 0; index < numberOfPlayers - 1; index++) { // - 1 because it was incremented\r\n\t\t\t\t\tInteger nextId = directory[index].getUserId();\r\n\t\t\t\t\tplayerWriter.write(nextId.toString());\r\n\t\t\t\t\tplayerWriter.write(\"\\n\");\r\n\t\t\t\t\tplayerWriter.write(directory[index].getUserName());\r\n\t\t\t\t\tplayerWriter.write(\"\\n\");\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\tInteger lastId = numberOfPlayers;\r\n\t\t\t\tplayerWriter.write(lastId.toString());\r\n\t\t\t\tplayerWriter.write(\"\\n\");\r\n\t\t\t\tplayerWriter.write(username);\r\n\t\t\t\tplayerWriter.write(\"\\n\");\r\n\t\t\t\tplayerWriter.close();\r\n\t\t\t}\r\n\t\t\tcatch(IOException e) {\r\n\t\t\t\tSystem.out.println(e);\r\n\t\t\t}\r\n\t\t}\r\n\t\treadPlayers.close();\r\n\t}", "public static DSUsers getUsersFromFile() {\n\t\ttry {\n\t\t\treturn gson.fromJson(new FileReader(USERS_FILE), DSUsers.class);\n\t\t} catch (JsonSyntaxException e) {\n\t\t\te.printStackTrace();\n\t\t} catch (JsonIOException e) {\n\t\t\te.printStackTrace();\n\t\t} catch (FileNotFoundException e) {\n\t\t\te.printStackTrace();\n\t\t}\n\t\treturn null;\n\t}", "public static void imprimeUsuarios( ) {\n\t\ttry {\n\t\t\tFileInputStream arq = new FileInputStream(\"database/usuarios.dat\");\n\t\t\tObjectInputStream in = new ObjectInputStream(arq);\n\t\t\tint i = 0;\n\t\t\n\t\t\tArrayList<Usuario> usuarios = new ArrayList<Usuario>();\n\t\t\t\n\t\t\ttry {\n\t\t\t for (;;) {\n\t\t\t \tUsuario aux;\n\t\t\t\t\taux = (Usuario) in.readObject();\n\t\t\t\t\tSystem.out.println(i + \"=\" + aux.getNome() + \";\" + aux.getCrm() + \";\" \n\t\t\t\t\t\t\t\t\t\t+ aux.getLogin() + \";\" + aux.getSenha());\n\t\t\t\t\tusuarios.add(aux);\n\t\t\t\t\ti++;\n\t\t\t }\n\t\t\t}\n\t\t\tcatch (EOFException exc) {\n\t\t\t // end of stream\n\t\t\t}\n\t\t\tcatch (IOException exc) {\n\t\t\t // some other I/O error: print it, log it, etc.\n\t\t\t exc.printStackTrace(); // for example\n\t\t\t}\n\t\t\t\t\n\t\t\tin.close();\n\t\t}\n\t\tcatch ( IOException exc2 ) {\n\t\t\tSystem.out.println(\"Erro ao ler o arquivo.\");\t\t\t\n\t\t}\n\t\tcatch ( ClassNotFoundException cnfex ) {\n\t\t\tSystem.out.println(\"Não achou a classe.\");\n\t\t}\n\t}", "public void loadUsersFromFile(String fileName) {\n\t\ttry {\n\t\t\tusers = UserRecordIO.readUserRecords(fileName);\n\t\t} catch (FileNotFoundException e) {\n\t\t\tthrow new IllegalArgumentException(\"Unable to read file \" + fileName);\n\t\t}\n\t}", "public List<User> getUsers() {\n try (ObjectInputStream inputStream = new ObjectInputStream(new FileInputStream(PATH))) {\n\n return (List<User>) inputStream.readObject();\n\n } catch (Exception e) {\n System.out.println(\"Ошибка при чтений файла или файла не существует! get user\");\n }\n\n return new ArrayList<>();\n }", "public static void writeUsers(ArrayList<User> userList, \r\n String filename) throws IOException {\r\n File file = new File(filename);\r\n PrintWriter out = new PrintWriter(\r\n new FileWriter(file, false));\r\n for (User user: userList) {\r\n out.println(user); \r\n }\r\n out.close();\r\n }", "public static void getXMLUserList() {\n\t\t// Make some local arrays to use below\n\t\tArrayList<Student> activeList = new ArrayList<Student>();\n\t\tArrayList<Student> archiveList = new ArrayList<Student>();\n\t\ttry {\n\t\t\tFile xmlFile = new File(\"Users.xml\");\n\t\t\tDocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();\n\t\t\tDocumentBuilder builder = factory.newDocumentBuilder();\n\t\t\tDocument users = builder.parse(xmlFile);\n\t\t\t\n\t\t NodeList studentNodes = users.getElementsByTagName(\"student\");\n\t\t for(int i = 0; i < studentNodes.getLength(); i++) { // Go through each student node\n\t\t \t\n\t\t Node studentNode = studentNodes.item(i);\n\t\t if(studentNode.getNodeType() == Node.ELEMENT_NODE) {\n\t\t Element studentEl = (Element) studentNode;\n\t\t // Get the student's info (and convert types when necessary)\n\t\t String fn = studentEl.getElementsByTagName(\"firstName\").item(0).getTextContent();\n\t\t String ln = studentEl.getElementsByTagName(\"lastName\").item(0).getTextContent();\n\t\t String id = studentEl.getElementsByTagName(\"ucid\").item(0).getTextContent();\n\t\t int ucid = Integer.parseInt(id);\n\t\t String cB = studentEl.getElementsByTagName(\"currentBorrowing\").item(0).getTextContent();\n\t\t int cb = Integer.parseInt(cB);\n\t\t String iA = studentEl.getElementsByTagName(\"isActive\").item(0).getTextContent();\n\t\t boolean ia = Boolean.parseBoolean(iA);\n\t\t String username = studentEl.getElementsByTagName(\"username\").item(0).getTextContent();\n\t\t String pW = studentEl.getElementsByTagName(\"password\").item(0).getTextContent();\n\t\t String iL = studentEl.getElementsByTagName(\"isLibrarian\").item(0).getTextContent();\n\t\t boolean isLib = Boolean.parseBoolean(iL);\n\t\t \n\t\t // And then create all a new instance of Student with the info\n\t\t\t Student newStudent = new Student(fn, ln, ucid, cb, ia, username, pW, isLib);\n\t\t\t // Put the newly created student in the right list\n\t\t\t if(ia) {\n\t\t\t \tactiveList.add(newStudent);\n\t\t\t } else {\n\t\t\t \tarchiveList.add(newStudent);\n\t\t\t }\n\t\t }\n\t\t }\n\t\t} catch (Exception e) {\n\t\t\tSystem.out.println(\"Something went wrong with the Users.xml parsing\");\n\t\t\tSystem.out.println(e);\n\t\t}\n\t\t// Store our arrays so they are accessible elsewhere\n\t\tManageUsers.setActiveList(activeList);\n\t\tManageUsers.setArchiveList(archiveList);\n\t}", "public void initUsers() {\n User user1 = new User(\"Alicja\", \"Grzyb\", \"111111\", \"grzyb\");\n User user2 = new User(\"Krzysztof\", \"Kowalski\", \"222222\", \"kowalski\");\n User user3 = new User(\"Karolina\", \"Nowak\", \"333333\", \"nowak\");\n User user4 = new User(\"Zbigniew\", \"Stonoga \", \"444444\", \"stonoga\");\n User user5 = new User(\"Olek\", \"Michnik\", \"555555\", \"michnik\");\n users.add(user1);\n users.add(user2);\n users.add(user3);\n users.add(user4);\n users.add(user5);\n }", "public void importFile() {\n \ttry {\n\t File account_file = new File(\"accounts/CarerAccounts.txt\");\n\n\t FileReader file_reader = new FileReader(account_file);\n\t BufferedReader buff_reader = new BufferedReader(file_reader);\n\n\t String row;\n\t while ((row = buff_reader.readLine()) != null) {\n\t String[] account = row.split(\",\"); //implementing comma seperated value (CSV)\n\t String[] users = account[6].split(\"-\");\n\t int[] usersNew = new int[users.length];\n\t for (int i = 0; i < users.length; i++) {\n\t \tusersNew[i] = Integer.parseInt(users[i].trim());\n\t }\n\t this.add(Integer.parseInt(account[0]), account[1], account[2], account[3], account[4], account[5], usersNew);\n\t }\n\t buff_reader.close();\n } catch (IOException e) {\n System.out.println(\"Unable to read text file this time.\");\n \t}\n\t}", "public void save(){\n\t\t\n\t\ttry {\n\t\t\t\t \n\t\t\t// Open Streams\n\t\t\tFileOutputStream outFile = new FileOutputStream(\"user.ser\");\n\t\t\tObjectOutputStream outObj = new ObjectOutputStream(outFile);\n\t\t\t\t \n\t\t\t// Serializing the head will save the whole list\n\t\t\toutObj.writeObject(this.head);\n\t\t\t\t \n\t\t\t// Close Streams \n\t\t\toutObj.close();\n\t\t\toutFile.close();\n\t\t}\n\n\t\tcatch(Exception e) {\n\t\t\tSystem.out.println(\"Error saving\");\n\t\t}\n\t\t\t\n\t}", "public static void main(String[] args) {\n // check for correct usage\n if (args.length < 1) {\n System.out.println(\"usage: java Vault [-au] <filename>\");\n System.exit(1);\n }\n\n // check for au option\n boolean addUser = false;\n if (args.length == 2)\n addUser = true;\n\n // open the file, or print error and exit\n Scanner sc = null;\n try {\n sc = new Scanner(new FileReader((addUser ? args[1] : args[0])));\n }catch (IOException e) {\n System.out.println(\"Error! File '\" + (addUser ? args[1] : args[0]) + \n \"' could not be opened.\");\n System.exit(2);\n }\n \n // read each line of the file, storing each user in users\n ArrayList<User> users = new ArrayList<User>();\n while (sc.hasNextLine()) {\n String[] line = sc.nextLine().split(\" \");\n \n if (line.length == 4 && line[0].equals(\"user\")) {\n users.add(new User(line[1], line[2], line[3]));\n\n }else if (line.length == 4 && line[0].equals(\"data\")) {\n for (int i = 0; i < users.size(); i++) {\n if (users.get(i).getName().equals(line[1]))\n users.get(i).addDatum(line[2], line[3]);\n }\n\n }else {\n System.out.println(\"Error! File '\" + (addUser ? args[1] : args[0]) + \n \"' improperly formatted.\");\n System.exit(3);\n }\n\n }\n //close read file\n sc.close();\n\n // ask user for username and password\n System.out.print(\"username: \");\n String name = System.console().readLine();\n System.out.print(\"password: \");\n char[] password = System.console().readPassword();\n\n // if au option, collect info and add to file, then quit\n if (addUser) {\n PrintWriter pw = null;\n try {\n pw = new PrintWriter(new File(args[1]));\n } catch (FileNotFoundException fnfe) {\n fnfe.printStackTrace();\n System.exit(6);\n }\n\n System.out.print(\"Hash algorithm: \");\n String hashAlg = System.console().readLine();\n\n // perform checks and hash password\n for (char c : password) {\n if ((int)c < 42 || (int)c > 122) {\n System.out.println(\"Error! Invalid symbol '\" + c + \"' in password.\");\n System.exit(7);\n }\n }\n Hasher hasher = null;\n String passhash = null;\n if (hashAlg.equals(\"clear\")) {\n hasher = new Clear();\n }else if (hashAlg.equals(\"shift+caesar\")) {\n hasher = new Caesar();\n }else if (hashAlg.equals(\"shift+vigenere\")) {\n hasher = new Vigenere();\n }else {\n System.out.println(\"Error! Hash algorithm '\" + hashAlg + \"' not supported.\");\n System.exit(8);\n }\n passhash = hasher.hash(password);\n for (User u : users) {\n if (u.getName().equals(name)) {\n System.out.print(\"Error! Username '\" + name + \"' already in use.\");\n System.exit(9);\n }\n }\n \n users.add(new User(name, hashAlg, passhash));\n for (User u : users) {\n pw.println(String.join(\" \", \"user\", u.getName(), u.getHashAlg(), u.getHash()));\n }\n\n pw.close();\n System.exit(0);\n }\n\n // determine access, exit if denied\n boolean access = false;\n User curr = null;\n for (User u : users) {\n if (u.getName().equals(name)) {\n try {\n if (u.validate(password)) {\n System.out.println(\"Access granted!\");\n access = true;\n curr = u;\n }\n break;\n }catch (UnsupportedHashException e) {\n System.out.println(\"Error! Hash algorithm '\" + u.getHashAlg() + \n \"' not supported.\");\n System.exit(4);\n }\n }\n }\n if (!access) {\n System.out.println(\"Access denied!\");\n System.exit(5);\n }\n\n // if granted access, open prompt for commands\n System.out.print(\"> \");\n sc = new Scanner(System.in);\n String cmd = null;\n ArrayList<Datum> data = curr.getData();\n while (!(cmd = sc.next()).equals(\"quit\")) {\n switch(cmd) {\n case \"labels\": for (Datum d : data) {\n d.getEnc().init(password);\n try {\n String plain = d.getEnc().decrypt(d.getCipher());\n if (!plain.contains(\"_\")) throw new Exception();\n System.out.println(plain.split(\"_\")[0]);\n }catch (Exception e) {\n System.out.println(\"Error! Corrupted entry '\" +\n d.getCipher() + \n \"' in vault file.\");\n }\n }\n break;\n\n case \"get\": cmd = sc.next();\n for (Datum d : data) {\n d.getEnc().init(password);\n try {\n String plain = d.getEnc().decrypt(d.getCipher());\n if (!plain.contains(\"_\")) throw new Exception();\n if (plain.split(\"_\", 2)[0].equals(cmd))\n System.out.println(plain.split(\"_\", 2)[1]);\n }catch (Exception e) {\n System.out.println(\"Error! Corrupted entry '\" + \n d.getCipher() + \n \"' in vault file.\");\n }\n }\n break; \n\n default: System.out.println(\"Unknown command '\" + cmd + \"'.\");\n break;\n }\n System.out.print(\"> \");\n\n }\n\n \n\n }", "private LinkedList<User> GetUserList() throws FileNotFoundException, IOException, ClassNotFoundException{\r\n File Users = new File(\"DataBase/Users/UsersDataBase.obj\");\r\n Users.createNewFile();\r\n try{\r\n FileInputStream InputFile = new FileInputStream(Users);\r\n ObjectInputStream InputObject = new ObjectInputStream(InputFile);\r\n\r\n LinkedList <User> UserList = (LinkedList <User>) InputObject.readObject();\r\n\r\n InputFile.close();\r\n InputObject.close();\r\n\r\n return UserList;\r\n }\r\n catch (EOFException e){\r\n return null; \r\n } \r\n }", "public void upLoad(String filename,byte[] file) throws java.rmi.RemoteException\n\t\t\t\t{\n\t\t\t\t\t\n\t\n\t\t\t\t\n\t\t\t\ttry{\n\t\t\t\t\n\t\t\t\t\tFileOutputStream uploadFile = new FileOutputStream(userDirectory + \"\\\\\" + filename);\n \tuploadFile.write(file);\n \n \n \tJOptionPane.showMessageDialog(null,\"Upload completed\");\n \n \tuploadFile.flush();\n\t\t\t\t\tuploadFile.close();\n \n \n \n \t\t\t} \n \t\t\t\tcatch (IOException ex) \n \t\t\t{\n \t\t\tJOptionPane.showMessageDialog(null,\"There was an issue uploading - to the user folder.\");\n \t\t\t}\n \t\n \t\t\t\n \t\t\t\n\t\t\t\t}", "private static HashMap<String, String> getUsers(String filename) {\n\t\t// Use hashmap to store the user list, the key is user name and the value is UUID\n\t\tHashMap<String, String> mapUsers = new HashMap<String, String>();\n\t\t// This will reference one line at a time\n\t\tString lineUser = null;\n\n\t\ttry {\n\t\t\t// Check file exists\n\t\t\tFile userfile = new File(filename);\n\t\t\tif(!userfile.exists() || userfile.isDirectory()) {\n\t\t\t\treturn mapUsers;\n\t\t\t}\n\t\t\t// Open the user file\n\t\t\tFileReader fileReader = new FileReader(filename);\n\t\t\t// User bufferedReader to go through the file\n\t\t\tBufferedReader bufferedReader = new BufferedReader(fileReader);\n\n\t\t\t// Read the file in lines one by one\n\t\t\twhile((lineUser = bufferedReader.readLine()) != null) {\n\t\t\t\tString[] namekey = lineUser.split(\" \"); // Split the name and key\n\t\t\t\tif (namekey.length != 2) { // Validate the data\n\t\t\t\t\tSystem.out.println(\"Invalid line: '\" + lineUser + \"' in '\" + filename + \"'\");\n\t\t\t\t\treturn mapUsers;\n\t\t\t\t}\n\t\t\t\t// Name + Key(UUID)\n\t\t\t\tmapUsers.put(namekey[0], namekey[1]);\n\t\t\t}\n\t\t\t// Always close files.\n\t\t\tbufferedReader.close();\n\t\t}\n\t\tcatch(FileNotFoundException ex) {\n\t\t\tSystem.out.println(\"Unable to open file '\" + filename + \"'\");\n\t\t}\n\t\tcatch(IOException ex) {\n\t\t\tex.printStackTrace();\n\t\t}\n\t\tfinally {\n\t\t\treturn mapUsers;\n\t\t}\n\t}", "private ArrayList<BookOfUser> loadBooksOfUser(InputStream is) throws IOException{\n\t\tBufferedReader br = new BufferedReader(new InputStreamReader(is));\r\n\t\tStringBuilder jsonFileContent = new StringBuilder();\r\n\t\t//read line by line from file\r\n\t\tString nextLine = null;\r\n\t\twhile ((nextLine = br.readLine()) != null){\r\n\t\t\tjsonFileContent.append(nextLine);\r\n\t\t}\r\n\r\n\t\tGson gson = new Gson();\r\n\t\t//this is a require type definition by the Gson utility so Gson will \r\n\t\t//understand what kind of object representation should the json file match\r\n\t\tType type = new TypeToken<ArrayList<BookOfUser>>(){}.getType();\r\n\t\tArrayList<BookOfUser> bookOfUser = gson.fromJson(jsonFileContent.toString(), type);\r\n\t\t//close\r\n\t\tbr.close();\t\r\n\t\treturn bookOfUser;\r\n\t}", "public static void RT() {//metodo para leer la informacion del txt , presente en todas las clases que se guardan en un txt\n\t\treadTxt(\"usuarios.txt\", usersList);\n\t}", "private void loadUserData() {\n\t\tuserData = new UserData();\n }", "public void writeJSONFile(Client client) {\n try {\n this.jsonParser = new JSONParser();\n JSONObject obj = (JSONObject) jsonParser.parse(new FileReader(file.getPath()));\n\n JSONArray listUsers = (JSONArray) obj.get(\"Registry\");\n\n boolean found = false;\n JSONObject user;\n int i = 0;\n\n while (!found && i < listUsers.size()) {\n user = (JSONObject) listUsers.get(i);\n\n if (client.getId() == ((Long) user.get(\"id\")).intValue()) {\n found = true;\n ((JSONObject) listUsers.get(i)).put(\"isInfected\", client.isInfected());\n ((JSONObject) listUsers.get(i)).put(\"isNotified\", client.isNotified());\n }\n\n i++;\n }\n\n JSONArray county = (JSONArray) obj.get(\"Counties\");\n JSONArray unregisteredUsers = (JSONArray) obj.get(\"UnregisteredUsers\");\n\n if (unregisteredUsers == null) {\n unregisteredUsers = new JSONArray();\n }\n\n JSONObject objWrite = new JSONObject();\n\n objWrite.put(\"UnregisteredUsers\", unregisteredUsers);\n objWrite.put(\"Registry\", listUsers);\n objWrite.put(\"Counties\", county);\n\n FileWriter fileWriter = new FileWriter(file.getPath());\n\n fileWriter.write(objWrite.toJSONString());\n\n fileWriter.close();\n\n } catch (IOException | ParseException e) {\n e.printStackTrace();\n }\n }", "public synchronized void loadCollaborators() {\n Path collaboratorsPath = this.uri.getPath().resolve(\"collaborators.txt\");\n try {\n this.collaborators = Files.readAllLines(collaboratorsPath, StandardCharsets.UTF_8).stream()\n .map(c -> State.getInstance().getUserOrNull(c))\n .collect(Collectors.toSet());\n System.out.println(this.uri + \" can be accessed by \" + this.collaborators);\n for (User collaborator : collaborators) {\n collaborator.queueInvite(new Invite(this, collaborator));\n }\n } catch (NoSuchFileException e) {\n try {\n Files.createFile(collaboratorsPath);\n } catch (IOException ex) {\n ex.printStackTrace();\n }\n } catch (IOException e) {\n e.printStackTrace();\n }\n }", "public ArrayList<User> readUsers()\n {\n String dataLines[]; /* Data read from line */\n boolean bNotNull = true; /* Indicate line null error */\n int count = 0; /* No. of user */\n ArrayList<User> userList = new ArrayList<User>();\n \n /* Open file. If cannot open, return null; */\n TextFileReader reader = new TextFileReader(userFileName);\n if (reader.open() == false)\n return null;\n \n /* Read number of data */\n String line;\n line = reader.readLine();\n try\n {\n count = Integer.parseInt(line);\n }\n catch (Exception e)\n {\n return null;\n }\n \n /* Loop get user and add user to list */\n int numTag = tagUser.length;\n for (int i = 0; i < count && bNotNull; i++)\n {\n dataLines = new String[numTag];\n /* Loop read follow number of tag */\n for (int j = 0; j < numTag && bNotNull; j++)\n {\n dataLines[j] = reader.readLine();\n if (dataLines[j] == null)\n bNotNull = false;\n }\n User user = parseUser(dataLines);\n if (user != null) /* If data is correct, add to user list */\n userList.add(user);\n }\n reader.close();\n return userList;\n }", "public void addToFile(String username, String password, int state){\r\n User newUser = new User(username, password, state);\r\n addToFile(newUser);\r\n }", "private void WriteDataToDataBase(SubForum CreatedSubForum) throws IOException, ClassNotFoundException{ \r\n LinkedList <SubForum> SubForumList = new LinkedList();\r\n //Check if there are more user´s in the file\r\n try{\r\n FileInputStream InputFile = new FileInputStream(\"DataBase/Forum/ForumDataBase.obj\");\r\n ObjectInputStream InputObject = new ObjectInputStream(InputFile);\r\n SubForumList = (LinkedList <SubForum>) InputObject.readObject();\r\n InputFile.close();\r\n InputObject.close();\r\n SubForumList.add(CreatedSubForum); \r\n }\r\n \r\n //If not this is the first user\r\n catch (Exception FileNotFoundException){\r\n SubForumList.add(CreatedSubForum);\r\n }\r\n \r\n //Then rewrite the list with the new user \r\n FileOutputStream OutputFile = new FileOutputStream(\"DataBase/Forum/ForumDataBase.obj\");\r\n ObjectOutputStream OutputObject = new ObjectOutputStream(OutputFile);\r\n OutputObject.writeObject(SubForumList); \r\n \r\n OutputFile.close();\r\n OutputObject.close(); \r\n }", "@Override\n public void importUsers() {\n if (LOG.isDebugEnabled()) {\n LOG.debug(\"importUsers\");\n }\n\n for (int i = 0; i < usersForImportation.size(); i++) {\n\n if (usersForImportation.get(i).getObject1()) {\n ConnectathonParticipant cp = new ConnectathonParticipant();\n ConnectathonParticipantQuery query = new ConnectathonParticipantQuery();\n query.testingSession().eq(TestingSession.getSelectedTestingSession());\n query.email().eq(usersForImportation.get(i).getObject2().getEmail());\n\n if (query.getCount() == 0) {\n\n try {\n\n cp.setEmail(usersForImportation.get(i).getObject2().getEmail());\n cp.setFirstname(usersForImportation.get(i).getObject2().getFirstname());\n cp.setLastname(usersForImportation.get(i).getObject2().getLastname());\n cp.setMondayMeal(true);\n cp.setTuesdayMeal(true);\n cp.setWednesdayMeal(true);\n cp.setThursdayMeal(true);\n cp.setFridayMeal(true);\n cp.setVegetarianMeal(false);\n cp.setSocialEvent(false);\n cp.setTestingSession(TestingSession.getSelectedTestingSession());\n cp.setInstitution(usersForImportation.get(i).getObject2().getInstitution());\n cp.setInstitutionName(usersForImportation.get(i).getObject2().getInstitution().getName());\n\n if (Role.isUserMonitor(usersForImportation.get(i).getObject2())) {\n cp.setConnectathonParticipantStatus(ConnectathonParticipantStatus.getMonitorStatus());\n\n } else if (Role.isUserVendorAdmin(usersForImportation.get(i).getObject2())\n || Role.isUserVendorUser(usersForImportation.get(i).getObject2())) {\n cp.setConnectathonParticipantStatus(ConnectathonParticipantStatus.getVendorStatus());\n\n } else {\n cp.setConnectathonParticipantStatus(ConnectathonParticipantStatus.getVisitorStatus());\n }\n\n entityManager.clear();\n entityManager.persist(cp);\n entityManager.flush();\n\n FacesMessages.instance().add(StatusMessage.Severity.INFO, USER + usersForImportation.get(i).getObject2().getLastname() + \" \" +\n \"\" + usersForImportation.get(i).getObject2().getEmail()\n + \" is imported\");\n renderAddPanel = false;\n getAllConnectathonParticipants();\n\n } catch (Exception e) {\n LOG.warn(USER + usersForImportation.get(i).getObject2().getEmail()\n + \" is already added - This case case should not occur...\");\n StatusMessages.instance().addFromResourceBundle(StatusMessage.Severity.ERROR,\n \"gazelle.users.connectaton.participants.CannotImportParticipant\", cp.getFirstname(),\n cp.getLastname(), cp.getEmail());\n\n }\n FinancialCalc.updateInvoiceIfPossible(cp.getInstitution(), cp.getTestingSession(), entityManager);\n } else {\n LOG.warn(USER + usersForImportation.get(i).getObject2().getEmail()\n + \" is already added - This case case should not occur...\");\n StatusMessages.instance().addFromResourceBundle(StatusMessage.Severity.ERROR,\n \"gazelle.users.connectaton.participants.CannotImportParticipant\",\n usersForImportation.get(i).getObject2().getFirstname(),\n usersForImportation.get(i).getObject2().getLastname(),\n usersForImportation.get(i).getObject2().getEmail());\n }\n }\n\n }\n }", "public void userLogInInfoRead(String filepath2, HashMap<String, EmpInfo> mergeData) {\n String data;\n String[] userLogInInfoToken;\n File userLogInInfoFile = new File(filepath2);\n Scanner scanner = null;\n try {\n scanner = new Scanner(userLogInInfoFile);\n } catch (FileNotFoundException e) {\n out.println(\"file not found\");\n }\n if (scanner != null) {\n while (scanner.hasNextLine()) {\n data = scanner.nextLine();\n userLogInInfoToken = data.split(\",\");\n // store userid in mergeData as a key\n EmpInfo empInfo = new EmpInfo(Integer.parseInt(userLogInInfoToken[0]),\n userLogInInfoToken[1], userLogInInfoToken[2], userLogInInfoToken[3]);\n EmpInfo uRole = mergeData.get(userLogInInfoToken[0]);\n uRole.setUserRole(userLogInInfoToken[3]);\n /* merge data have already 6 key and 6 emp information if new key is equal to old key\n then hash map not put new key and hashmap put userRole at old key,hashmap allowed only unique kay*/\n mergeData.put(userLogInInfoToken[0], uRole);\n // all employee log in information add in arraylist for printing information\n userLogInInfo.add(empInfo);\n }\n }\n }", "@PostMapping(value = \"/load\")\r\n\tpublic Users load(@RequestBody final Users users)\r\n\t{\r\n\t\tuserJPARepository.save(users);\r\n\t\treturn userJPARepository.findByName(users.getName());\r\n\t}", "public void saveData() {\n try {\n JsonWriter jw = new JsonWriter(openFileOutput(DATA_FILE, Context.MODE_PRIVATE));\n jw.write(user);\n jw.close();\n } catch(Exception e) {\n Log.i(\"Exception :\", e.toString());\n }\n }", "public void saveUser(User user) {\n\t\tFile d = new File(\"users\");\n\t\t\n\t\tif (!d.exists() || !d.isDirectory()) {\n\t\t\td.mkdir();\n\t\t}\n\t\t\n\t\ttry {\n\t\t\tDocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();\n\t\t\tDocumentBuilder builder = factory.newDocumentBuilder();\n\t\t\t//Document document = builder.parse(f);\n\t\t\t\n\t\t\tDocument document = builder.newDocument();\n\t\t\t\n\t\t\tElement root = document.createElement(\"User\");\n\t\t\tdocument.appendChild(root);\n\t\t\t\n\t\t\troot.setAttribute(\"username\", user.name);\n\t\t\troot.setAttribute(\"password\", user.password);\n\t\t\t\n\t\t\t//System.out.println(\"Save: \" + user.password);\n\t\t\t\n\t\t\tIterator i = user.record.entrySet().iterator();\n\t\t\t\n\t\t\twhile (i.hasNext()) {\n\t\t\t\tMap.Entry u = (Map.Entry)i.next();\n\t\t\t\tString name = (String)u.getKey();\n\t\t\t\tString record = (String)u.getValue();\n\n\t\t\t\tElement precord = document.createElement(\"Record\");\n\t\t\t\t\n\t\t\t\tprecord.setAttribute(\"username\", name);\n\t\t\t\tprecord.setTextContent(record);\n\t\t\t\troot.appendChild(precord);\n\t\t\t}\n\t\t\t\n\t\t\tTransformerFactory tfactory = TransformerFactory.newInstance();\n\t\t\tTransformer transformer = tfactory.newTransformer();\n\t\t\tDOMSource source = new DOMSource(document);\n\t\t\tStreamResult result = new StreamResult(new File(\"users/\" + user.name + \".xml\"));\n\t\t\ttransformer.transform(source, result);\n\t\t} catch (ParserConfigurationException e) {\n\t\t\t// TODO Auto-generated catch block\n\t\t\te.printStackTrace();\n\t\t} catch (TransformerConfigurationException e) {\n\t\t\t// TODO Auto-generated catch block\n\t\t\te.printStackTrace();\n\t\t} catch (TransformerException e) {\n\t\t\t// TODO Auto-generated catch block\n\t\t\te.printStackTrace();\n\t\t}\n\t}", "public static void writeApp(ObservableList<User> myUsers) throws IOException{\n \tFileOutputStream fos = new FileOutputStream(storeFile);\n\t\tObjectOutputStream oos = new ObjectOutputStream(fos);\n\t\tfor(User x : myUsers) {\n\t\t\toos.writeObject(x.toString());\n\t\t}\n\t}", "public void newUserDirectory() {\n\t\tusers = new LinkedAbstractList<User>(100);\n\t}", "public void writeUserRegister(int id, String username, String password, boolean isNotified, String county) {\n try {\n JSONObject obj = (JSONObject) jsonParser.parse(new FileReader(file.getPath()));\n\n JSONObject newRegister = new JSONObject();\n\n JSONArray registerlist = (JSONArray) obj.get(\"Registry\");\n\n newRegister.put(\"id\", id);\n newRegister.put(\"name\", username);\n newRegister.put(\"password\", password);\n newRegister.put(\"county\", county);\n newRegister.put(\"isInfected\", false);\n newRegister.put(\"isNotified\", isNotified);\n\n registerlist.add(newRegister);\n\n JSONArray countyList = (JSONArray) obj.get(\"Counties\");\n JSONArray unregisteredUsers = (JSONArray) obj.get(\"UnregisteredUsers\");\n\n JSONObject objWrite = new JSONObject();\n\n objWrite.put(\"UnregisteredUsers\", unregisteredUsers);\n objWrite.put(\"Registry\", registerlist);\n objWrite.put(\"Counties\", countyList);\n\n FileWriter fileWriter = new FileWriter(file.getPath());\n\n fileWriter.write(objWrite.toJSONString());\n\n fileWriter.close();\n } catch (IOException e) {\n e.printStackTrace();\n } catch (ParseException e) {\n e.printStackTrace();\n }\n }", "public void loadUsers() {\n CustomUser userOne = new CustomUser();\n userOne.setUsername(SpringJPABootstrap.MWESTON);\n userOne.setPassword(SpringJPABootstrap.PASSWORD);\n\n CustomUser userTwo = new CustomUser();\n userTwo.setUsername(SpringJPABootstrap.TEST_ACCOUNT_USER_NAME);\n userTwo.setPassword(SpringJPABootstrap.TEST_ACCOUNT_PASSWORD);\n\n String firstUserName = userOne.getUsername();\n\n /*\n * for now I am not checking for a second user because there is no delete method being\n * used so if the first user is created the second user is expected to be created. this\n * could cause a bug later on but I will add in more logic if that is the case in a\n * future build.\n */\n if(userService.isUserNameTaken(firstUserName)) {\n log.debug(firstUserName + \" is already taken\");\n return ;\n }\n userService.save(userOne);\n userService.save(userTwo);\n\n log.debug(\"Test user accounts have been loaded!\");\n }", "public void save(String dataname, String username) throws IOException {\n List<String> outlines = newpairs.stream().map(p -> p.getFirst() + \"\\t\" + p.getSecond()).collect(toList());\n LineIO.write(getUserDictPath(dataname, username), outlines);\n }", "private void registerUser() throws FileNotFoundException, IOException\r\n\t{\r\n\t\tString username;\r\n\t\tString password;\r\n\t\tString fname;\r\n\t\tString lname;\r\n\t\tint attempt = 0;\r\n\t\tScanner input = new Scanner(System.in);\r\n\t\tRandom random = new Random();\r\n\t\t\r\n\t\t//PrintWriter wrapped around a BufferedWriter that is wrapped around a FileWriter\r\n\t\t//used to write on a file\r\n\t\tPrintWriter pw = new PrintWriter(new BufferedWriter(new FileWriter(\"UserAccount.txt\", true)));\t//true allows appending\r\n\t\t\r\n\t\t//gets user's first and last name\r\n\t\tSystem.out.println(\"Enter your first name: \");\r\n\t\tfname = input.nextLine();\r\n\t\tSystem.out.println(\"Enter your last name: \");\r\n\t\tlname = input.nextLine();\r\n\t\t\r\n\t\t//gets user's desired username\r\n\t\tSystem.out.println(\"Enter desired username: \");\r\n\t\tusername = input.nextLine();\r\n\t\tattempt++;\r\n\t\twhile (checkUserExists(username) != -1)\t\t//username already exists\r\n\t\t{\r\n\t\t\tSystem.out.println(\"\\nThat username already exists\");\r\n\t\t\tif (attempt == 2)\t\t//generate random username with 8 characters after 2 attempts\r\n\t\t\t{\r\n\t\t\t\tif (lname.length() < 6)\t\t\t\t//if last name has less than six characters\r\n\t\t\t\t\tusername = lname;\r\n\t\t\t\telse\t\t\t\t\t\t\t\t//else if last name has six characters or greater\r\n\t\t\t\t\tusername = lname.substring(0, 6);\r\n\t\t\t\tfor (int i = username.length(); i < 8; i++)\t\t\t//loop runs until username has 8 characters\r\n\t\t\t\t\tusername += random.nextInt(9) + 1;\t\t\t\t//concatenate random number between 0 - 9 to the username\r\n\t\t\t\tSystem.out.println(\"A randomly generated username has been chosen for you.\");\r\n\t\t\t\tSystem.out.println(\"Your username is \" + username);\r\n\t\t\t}\r\n\t\t\telse\r\n\t\t\t{\r\n\t\t\t\tSystem.out.println(\"Enter desired username: \");\r\n\t\t\t\tusername = input.nextLine();\r\n\t\t\t\tattempt++;\r\n\t\t\t}\r\n\t\t}\r\n\t\tpw.println(username);\r\n\t\tuserAccounts[0][numOfUsers] = username;\r\n\t\tSystem.out.println(\"\");\r\n\t\t\r\n\t\t//get user's password\r\n\t\tSystem.out.println(\"Enter password (Must be 8 characters long): \");\r\n\t\tpassword = input.nextLine();\r\n\t\twhile (password.length() < 8)\t\t\t//continues to loop until pass is at least 8 characters long\r\n\t\t{\r\n\t\t\tSystem.out.println(\"\\nPassword must be at least eight characters long\");\r\n\t\t\tSystem.out.println(\"Enter password (Must be 8 characters long): \");\r\n\t\t\tpassword = input.nextLine();\r\n\t\t}\r\n\t\tpw.println(password);\r\n\t\tuserAccounts[1][numOfUsers] = password;\r\n\t\tnumOfUsers++;\r\n\t\tpw.close();\r\n\t}", "public void exportFile() {\n\t\ttry {\n\t\t\tFileWriter file_write = new FileWriter(\"accounts/CarerAccounts.txt\", false);\n\t\t\tString s = System.getProperty(\"line.separator\");\n\t\t\tfor (int i=0; i < CarerAccounts.size();i++) {\n\t\t\t\tString Users = new String();\n\t\t\t\tfor (int user: CarerAccounts.get(i).getUsers()) {\n\t\t\t\t\tUsers += Integer.toString(user) + \"-\";\n\t\t\t\t}\n\t\t\t\tString individual_user = CarerAccounts.get(i).getID() + \",\" + CarerAccounts.get(i).getUsername() + \",\" + CarerAccounts.get(i).getPassword() + \",\" + CarerAccounts.get(i).getFirstName() + \",\" + CarerAccounts.get(i).getLastName() + \",\" + CarerAccounts.get(i).getEmailAddress() + \",\" + Users;\n\t\t\t\tfile_write.write(individual_user + s);\n\t\t\t}\n\t\t\tfile_write.close();\n\n\t\t} catch (IOException e) {\n\t\t\tSystem.out.println(\"Unable to export file.\");\n\t\t}\n\t}", "public static void writeColdUsersToFile(HashMap<Integer,RatingUser> arr, FileWriter file) throws IOException {\n FileWriter coldUserFile = file;\n HashMap<Integer,RatingUser> ratingUsers = arr;\n for(RatingUser ru: ratingUsers.values())\n if(ru.getNeighbors().size() <5)\n for(SimNode s: ru.getNeighbors().keySet())\n coldUserFile.append(\"\"+ru.getId()+\" \"+s.getId()+\" \"+ru.getNeighbors().get(s)+\"\\n\");\n }", "public static void writeUser(String file, User user) {\r\n try (ObjectOutputStream out = new ObjectOutputStream(new FileOutputStream(file + \".ser\"))) {\r\n out.writeObject(user);\r\n } catch (Exception e) {\r\n e.printStackTrace();\r\n }\r\n }", "@Override\n public void initializeUsersForImportation() {\n if (LOG.isDebugEnabled()) {\n LOG.debug(\"initializeUsersForImportation\");\n }\n clearAddPanels();\n setRenderImportUserPanel(true);\n\n List<User> users;\n\n usersForImportation = new ArrayList<Pair<Boolean, User>>();\n\n if (Role.isLoggedUserAdmin() || Role.isLoggedUserProjectManager()) {\n choosenInstitutionForAdmin = (Institution) Component.getInstance(CHOOSEN_INSTITUTION_FOR_ADMIN);\n\n if (choosenInstitutionForAdmin != null) {\n users = User.listUsersForCompany(choosenInstitutionForAdmin);\n } else {\n users = User.listAllUsers();\n }\n } else {\n users = User.listUsersForCompany(Institution.getLoggedInInstitution());\n }\n boolean emailAlreadyExists;\n for (User user : users) {\n emailAlreadyExists = false;\n\n for (ConnectathonParticipant cp : connectathonParticipantsDataModel().getAllItems(FacesContext.getCurrentInstance())) {\n\n if (user.getEmail().equals(cp.getEmail())) {\n emailAlreadyExists = true;\n }\n }\n\n if (!emailAlreadyExists) {\n usersForImportation.add(new Pair<Boolean, User>(false, user));\n }\n }\n }", "public static void UserAccounts() throws FileNotFoundException{\n\t\tScanner input = new Scanner(new File(AccountFile));\t\t\t\t//Creats objects and adds to array list.\r\n\t\t\r\n\t\twhile (input.hasNextLine()) {\t\t\t\t\t\t\t\t\t//Loops as long as there is another line\r\n\t\t\t\r\n\t\t\tString line = input.nextLine();\r\n\t\t\tif(line.equals(\"ADMIN\")) {\t\t\t\t\t\t\t\t\t//Checks if the data is for Admin, creats admin object\r\n\t\t\t\tString AdminUsername = input.nextLine();\r\n\t\t\t\tString AdminPassword = input.nextLine();\r\n\t\t\t\t\r\n\t\t\t\tAdmin admin = new Admin(AdminUsername, AdminPassword);\r\n\t\t\t\taccounts.add(admin);\r\n\t\t\t\t\r\n\t\t\t} if(line.equals(\"COORDINATOR\")){\r\n\t\t\t\tString coordinatorUsername = input.nextLine();\r\n\t\t\t\tString coordinatorPassword = input.nextLine();\r\n\t\t\t\t\r\n\t\t\t\tCoordinator coordinator = new Coordinator(coordinatorUsername, coordinatorPassword);\r\n\t\t\t\taccounts.add(coordinator);\r\n\r\n\t\t\t} if(line.equals(\"APPROVER\")){\r\n\t\t\t\tString approverUsername = input.nextLine();\r\n\t\t\t\tString approverPassword = input.nextLine();\r\n\t\t\t\t\r\n\t\t\t\tApprover approver = new Approver(approverUsername, approverPassword);\r\n\t\t\t\taccounts.add(approver);\r\n\r\n\t\t\t} if(line.equals(\"CASUAL\")){\r\n\t\t\t\tString casualUsername = input.nextLine();\r\n\t\t\t\tString casualPassword = input.nextLine();\r\n\t\t\t\t\r\n\t\t\t\tCasualStaff casual = new CasualStaff(casualUsername, casualPassword);\r\n\t\t\t\taccounts.add(casual);\r\n\r\n\t\t\t}\r\n\t\t\t\r\n\t\t} loginSystem();\r\n\t}", "@Override\n\tpublic void loadUsers(List<UserDto> users) {\n\t\tfor (UserDto userDto : users) {\n\t\t\tuserRepository.save(dte.getUser(userDto));\n\t\t}\n\t}", "private UserDao() {\n\t\tusersList = new HashMap<String, User>();\n\t\tusersDetails = JsonFilehandling.read();\n\t\tfor (JSONObject obj : usersDetails) {\n\t\t\tusersList.put(obj.get(\"id\").toString(), new User(obj.get(\"id\").toString(),obj.get(\"name\").toString(), obj.get(\"profession\").toString()));\n\t\t}\n\t}", "public void writeData(UserInfo info)\n\t{\n\t\tSystem.out.println(\"file has been written!\");\n\t\tuserinfos.add(info);\n\t}", "public static void load(){\n StringBuilder maleNamesString = new StringBuilder();\n try (Scanner maleNamesFile = new Scanner(mnames)){\n while (maleNamesFile.hasNext()) {\n maleNamesString.append(maleNamesFile.next());\n }\n }\n catch(FileNotFoundException e){\n e.printStackTrace();\n return;\n }\n\n //Create a string from the fnames.json file\n StringBuilder femaleNamesString = new StringBuilder();\n try (Scanner femaleNamesFile = new Scanner(fnames)){\n while (femaleNamesFile.hasNext()) {\n femaleNamesString.append(femaleNamesFile.next());\n }\n }\n catch(FileNotFoundException e){\n e.printStackTrace();\n return;\n }\n\n //Create a string from the snames.json file\n StringBuilder surNamesString = new StringBuilder();\n try (Scanner surNamesFile = new Scanner(snames)){\n while (surNamesFile.hasNext()) {\n surNamesString.append(surNamesFile.next());\n }\n\n }\n catch(FileNotFoundException e){\n e.printStackTrace();\n return;\n }\n\n //Create a string from the locations.json file\n StringBuilder locationsString = new StringBuilder();\n try (Scanner locationsFile = new Scanner(locationsJson)){\n while (locationsFile.hasNext()) {\n locationsString.append(locationsFile.next());\n }\n\n }\n catch(FileNotFoundException e){\n e.printStackTrace();\n return;\n }\n\n maleNames = (Names)convertJsonToObject(maleNamesString.toString(), new Names());\n\n femaleNames = (Names)convertJsonToObject(femaleNamesString.toString(), new Names());\n\n surNames = (Names)convertJsonToObject(surNamesString.toString(), new Names());\n\n locations = (Locations)convertJsonToObject(locationsString.toString(), new Locations());\n }", "public static User loadUser(String path){\r\n if (path == null)\r\n throw new IllegalArgumentException(\"Path may not be null\");\r\n\r\n File userDir = new File(path);\r\n try{\r\n if (!userDir.exists())\r\n throw new FileNotFoundException(userDir.toString());\r\n if (!userDir.isDirectory())\r\n throw new IOException(\"Path must be a directory\");\r\n\r\n File parent = new File(userDir.getParent());\r\n String serverID = parent.getName();\r\n\r\n Server server = getServer(serverID);\r\n if (server == null){\r\n JOptionPane.showMessageDialog(mainFrame, \"Unable to load user file from:\\n\"+userDir+\r\n \"\\nBecause \"+serverID+\" is not a known server\", \"Error\", JOptionPane.ERROR_MESSAGE);\r\n return null;\r\n }\r\n\r\n File settingsFile = new File(userDir, \"settings\");\r\n InputStream propsIn = new BufferedInputStream(new FileInputStream(settingsFile));\r\n Properties props = new Properties();\r\n props.load(propsIn);\r\n propsIn.close();\r\n\r\n Hashtable userFiles = new Hashtable();\r\n File userFilesFile = new File(userDir, \"files\"); \r\n if (userFilesFile.exists()){\r\n DataInputStream in = new DataInputStream(new BufferedInputStream(new FileInputStream(userFilesFile)));\r\n ByteArrayOutputStream buf = new ByteArrayOutputStream();\r\n int filesCount = in.readInt();\r\n for (int i = 0; i < filesCount; i++){\r\n String filename = in.readUTF();\r\n int filesize = in.readInt();\r\n if (IOUtilities.pump(in, buf, filesize) != filesize)\r\n throw new EOFException(\"EOF while reading user-file: \"+filename);\r\n byte [] data = buf.toByteArray();\r\n buf.reset();\r\n MemoryFile memFile = new MemoryFile(data);\r\n userFiles.put(filename, memFile);\r\n }\r\n in.close();\r\n }\r\n\r\n User user = server.createUser(props, userFiles);\r\n\r\n userDirs.put(user, userDir);\r\n\r\n return user;\r\n } catch (IOException e){\r\n e.printStackTrace();\r\n JOptionPane.showMessageDialog(mainFrame, \"Unable to load user file from:\\n\"+userDir, \"Error\", JOptionPane.ERROR_MESSAGE);\r\n return null;\r\n }\r\n }", "public void removeUnregisteredUsers(int position) {\n try {\n JSONObject obj = (JSONObject) jsonParser.parse(new FileReader(file.getPath()));\n JSONArray listUsersUnregistered = (JSONArray) obj.get(\"UnregisteredUsers\");\n\n listUsersUnregistered.remove(position);\n\n JSONArray county = (JSONArray) obj.get(\"Counties\");\n JSONArray unregisteredUsers = (JSONArray) obj.get(\"Registry\");\n\n JSONObject objWrite = new JSONObject();\n\n objWrite.put(\"UnregisteredUsers\", listUsersUnregistered);\n objWrite.put(\"Registry\", unregisteredUsers);\n objWrite.put(\"Counties\", county);\n\n FileWriter fileWriter = new FileWriter(file.getPath());\n\n fileWriter.write(objWrite.toJSONString());\n\n fileWriter.close();\n } catch (IOException e) {\n e.printStackTrace();\n } catch (ParseException e) {\n e.printStackTrace();\n }\n }", "private static void addUser(String filename, String username, String userkey) {\n\t\ttry {\n\t\t\t// Open the user file, create new one if not exists\n\t\t\tFileWriter fileWriterUser = new FileWriter(filename, true);\n\t\t\t// User BufferedWriter to add new line\n\t\t\tBufferedWriter bufferedWriterdUser = new BufferedWriter(fileWriterUser);\n\n\t\t\t// Concatenate user name and key with a space\n\t\t\tbufferedWriterdUser.write(username + \" \" + userkey);\n\t\t\t// One user one line\n\t\t\tbufferedWriterdUser.newLine();\n\n\t\t\t// Always close files.\n\t\t\tbufferedWriterdUser.close();\n\t\t}\n\t\tcatch(FileNotFoundException ex) {\n\t\t\tSystem.out.println(\"Unable to open file '\" + filename + \"'\");\n\t\t}\n\t\tcatch(IOException ex) {\n\t\t\tex.printStackTrace();\n\t\t}\n\t}", "public static Superuser load() throws IOException, ClassNotFoundException {\n\t\tObjectInputStream ois = new ObjectInputStream(new FileInputStream(storeDir + File.separator + storeFile));\n\t\tSuperuser userList = (Superuser) ois.readObject();\n\t\tois.close();\n\t\treturn userList;\n\t\t\n\t}", "public static ArrayList<Player> readPlayersFromFile() \r\n {\r\n //Inisialize Arraylist \r\n ArrayList<Player> players = new ArrayList<Player>();\r\n //Inisialize FileInputStream\r\n FileInputStream fileIn = null;\r\n\r\n try \r\n {\r\n //Establish connection to file \r\n fileIn = new FileInputStream(\"players.txt\");\r\n while (true) \r\n {\r\n //Create an ObjectOutputStream \r\n ObjectInputStream objectIn = new ObjectInputStream(fileIn);\r\n //Read a Player object from the file and add it to the ArrayList\r\n players.add((Player)objectIn.readObject());\r\n }//end while\r\n\r\n }\r\n catch (Exception e)\r\n {\r\n //System.out.println(e);\r\n }\r\n finally \r\n {\r\n usernamesTaken.clear();\r\n\r\n for(int i = 0; i < players.size(); i++)\r\n {\r\n usernamesTaken.add(players.get(i).getUsername());\r\n }//end for\r\n\r\n //Try to close the file and return the ArrayList\r\n try\r\n {\r\n //Check if the end of the file is reached\r\n if (fileIn != null)\r\n { \r\n //Close the file \r\n fileIn.close();\r\n //Return the ArrayList of players\r\n return players;\r\n }\r\n }\r\n catch (Exception e)\r\n {\r\n //System.out.println(e)\r\n }//end try \r\n\r\n //Return null if there is an excetion \r\n return null;\r\n }//end try \r\n }", "public static ObservableList<User> readApp() throws IOException, ClassNotFoundException{\n \t//create the file if it doesn't exist\n \tFile temp = new File(\"photoData/users.dat\");\n \ttemp.createNewFile();\n \t\n \tObservableList<User> gapp = FXCollections.observableArrayList();\n \tObjectInputStream ois = null;\n \ttry{\n \t\tois = new ObjectInputStream(new FileInputStream(storeFile));\n \t} catch(EOFException e) {\n\t\t\treturn gapp;\n\t\t}\n \t\n \t//read the .dat file and populate the obsList (list of users)\n \twhile(true) {\n \t\ttry {\n \t\t\tgapp.add(new User((String)ois.readObject()));\n \t\t} catch (EOFException e) {\n \t\t\treturn gapp;\n \t\t}\n \t}\n }", "public List<Utilisateur> generateData() throws FileNotFoundException, IOException {\n Reader reader = new FileReader(\"F:\\\\Bibliothèques\\\\Documents\\\\MIAGE M1\\\\WEB\\\\TPWeb\\\\src\\\\main\\\\webapp\\\\data.csv\");\n\n CSVReader<Utilisateur> csvPersonReader = new CSVReaderBuilder<Utilisateur>(reader).entryParser(new UtilisateurEntryParser()).build();\n\n List<Utilisateur> persons = csvPersonReader.readAll();\n\n return persons;\n\n }" ]
[ "0.7235108", "0.68762237", "0.683335", "0.67801565", "0.6691448", "0.6632919", "0.656446", "0.6560339", "0.6547542", "0.6535578", "0.6517599", "0.6482196", "0.64766926", "0.6465155", "0.6428879", "0.64185387", "0.6408429", "0.6407029", "0.6403797", "0.63463354", "0.6333905", "0.63067794", "0.6293578", "0.62654203", "0.623568", "0.6233834", "0.61970717", "0.61814237", "0.61612236", "0.61234635", "0.61143553", "0.6074302", "0.60598457", "0.602979", "0.602941", "0.6024117", "0.60216105", "0.60156745", "0.6003264", "0.5981535", "0.5978166", "0.5962378", "0.5953023", "0.5943453", "0.5931555", "0.5910188", "0.5905843", "0.5896371", "0.5865944", "0.58566463", "0.58510095", "0.58321595", "0.57841814", "0.57812434", "0.5778763", "0.57456166", "0.57124823", "0.57055116", "0.5704918", "0.5673471", "0.567302", "0.56607735", "0.5655614", "0.5650797", "0.5650015", "0.5648673", "0.5645074", "0.5644271", "0.56358385", "0.562019", "0.5602364", "0.5601854", "0.5598933", "0.5579291", "0.5573137", "0.55591637", "0.55435276", "0.55420464", "0.5538636", "0.55304384", "0.5518598", "0.5517184", "0.55128187", "0.55110675", "0.5507807", "0.5507733", "0.5494171", "0.5493987", "0.5489229", "0.5486264", "0.5469361", "0.5461384", "0.5458308", "0.5457696", "0.54542726", "0.5453239", "0.54517686", "0.54333997", "0.54328513", "0.54139996" ]
0.6731077
4
loads the stock array into the new file
public void stockLoad() { try { File file = new File(stockPath); Scanner scanner = new Scanner(file); while (scanner.hasNextLine()) { String data = scanner.nextLine(); String[] userData = data.split(separator); Stock stock = new Stock(); stock.setProductName(userData[0]); int stockCountToInt = Integer.parseInt(userData[1]); stock.setStockCount(stockCountToInt); float priceToFloat = Float.parseFloat(userData[2]); stock.setPrice(priceToFloat); stock.setBarcode(userData[3]); stocks.add(stock); } } catch (FileNotFoundException e) { e.printStackTrace(); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "void setStockArray(int i, stockFilePT102.StockDocument.Stock stock);", "void setStockArray(stockFilePT102.StockDocument.Stock[] stockArray);", "stockFilePT102.StockDocument.Stock getStockArray(int i);", "public void loadItems() {\n\t\tArrayList<String> lines = readData();\n\t\tfor (int i = 1; i < lines.size(); i++) {\n\t\t\tString line = lines.get(i);\n\t\t\t\n\t\t\tString[] parts = line.split(\",\");\n\t\t\t\n//\t\t\tSystem.out.println(\"Name: \" + parts[0]);\n//\t\t\tSystem.out.println(\"Amount: \" + parts[1]);\n//\t\t\tSystem.out.println(\"Price: \" + parts[2]);\n//\t\t\tSystem.out.println(\"-------\");\n\t\t\t\n\t\t\tString name = parts[0].trim();\n\t\t\tint amount = Integer.parseInt(parts[1].trim());\n\t\t\tdouble price = Double.parseDouble(parts[2].trim());\n\t\t\t\n\t\t\tItem item = new Item(name, amount, price);\n\t\t\titemsInStock.add(item);\n\t\t}\n\t}", "stockFilePT102.StockDocument.Stock addNewStock();", "public void loadStock() throws IOException {\n String amountCow = Files.readString(Paths.get(\"cowAmount.txt\"), Charset.defaultCharset());\n String amountGoat = Files.readString(Paths.get(\"goatAmount.txt\"), Charset.defaultCharset());\n String amountSheep = Files.readString(Paths.get(\"sheepAmount.txt\"), Charset.defaultCharset());\n String amountChicken = Files.readString(Paths.get(\"chickenAmount.txt\"), Charset.defaultCharset());\n String amountDuck = Files.readString(Paths.get(\"duckAmount.txt\"), Charset.defaultCharset());\n String weightCow = Files.readString(Paths.get(\"cowWeight.txt\"), Charset.defaultCharset());\n String weightGoat = Files.readString(Paths.get(\"goatWeight.txt\"), Charset.defaultCharset());\n String weightSheep = Files.readString(Paths.get(\"sheepWeight.txt\"), Charset.defaultCharset());\n String weightChicken = Files.readString(Paths.get(\"chickenWeight.txt\"), Charset.defaultCharset());\n String weightDuck = Files.readString(Paths.get(\"duckWeight.txt\"), Charset.defaultCharset());\n\n cowAmount.setText(amountCow);\n\n sheepAmount.setText(amountSheep);\n\n goatAmount.setText(amountGoat);\n\n chickenAmount.setText(amountChicken);\n\n duckAmount.setText(amountDuck);\n\n cowWeight.setText(weightCow);\n\n sheepWeight.setText(weightSheep);\n\n goatWeight.setText(weightGoat);\n\n chickenWeight.setText(weightChicken);\n\n duckWeight.setText(weightDuck);\n }", "stockFilePT102.StockFileDocument.StockFile addNewStockFile();", "stockFilePT102.StockDocument.Stock insertNewStock(int i);", "@Override\n public StockInfo[] getStockInfoFromFile(String filePath) throws UnsupportedEncodingException {\n //TODO: write your code here\n \tFileInputStream file=null;\n\n\t\ttry {\n\t\t\tfile=new FileInputStream(filePath);\n\t\t} catch (FileNotFoundException e1) {\n\t\t\t// TODO Auto-generated catch block\n\t\t\te1.printStackTrace();\n\t\t}\n\t\tInputStreamReader files=null;\n\t\ttry{\n\t\t\tfiles=new InputStreamReader(file,\"utf-8\");\n\t\t}catch (UnsupportedEncodingException el){\n\t\t\tel.printStackTrace();\n\t\t}\n\t\tBufferedReader bufferedreader = new BufferedReader(files);\n\t\tArrayList<StockInfo> list = new ArrayList<StockInfo>();\n\t\tString t=null;\n\t\ttry {\n\t\t\twhile((t=bufferedreader.readLine())!=null) {\n\t\t\t\tString []node=t.split(\"\\\\s+\");\n\t\t\t\tStockInfo record=new StockInfo();\n\t\t\t\trecord.setId(node[0]);\n\t\t\t\trecord.setTitle(node[1]);\n\t\t\t\trecord.setAuthor(node[2]);\n\t\t\t\trecord.setDate(node[3]);\n\t\t\t\trecord.setLastUpdate(node[4]);\n\t\t\t\trecord.setContent(node[5]);\n\t\t\t\trecord.setAnswerAuthor(node[6]);\n\t\t\t\trecord.setAnswer(node[7]);\n\t\t\t\tlist.add(record);\n\n\t\t\t}\n\t\t\tbufferedreader.close();\n\t\t\tfiles.close();\n\t\t} catch (IOException e) {\n\t\t\t// TODO Auto-generated catch block\n\t\t\te.printStackTrace();\n\t\t}\n\t\tStockInfo [] newdate=new StockInfo[list.size()];\n\t\tint i=0;\n\t\twhile(i<list.size()) {\n\t\t\tnewdate[i]=list.get(i);\n\t\t\ti++;\n\t\t}\n\t\treturn newdate;\n }", "private void initializeFile()\n\t{\n\t\tHighScore[] h={new HighScore(0,0,\" \"),new HighScore(0,0,\" \"),new HighScore(0,0,\" \"),\n\t\t\t\tnew HighScore(0,0,\" \"),new HighScore(0,0,\" \"),new HighScore(0,0,\" \"),\n\t\t\t\tnew HighScore(0,0,\" \"),new HighScore(0,0,\" \"),new HighScore(0,0,\" \"),\n\t\t\t\tnew HighScore(0,0,\" \")};\n\t\ttry \n\t\t{\n\t\t\tSystem.out.println(\"Hi1\");\n\t\t\tObjectOutputStream o=new ObjectOutputStream(new FileOutputStream(\"HighScores.dat\"));\n\t\t\to.writeObject(h);\n\t\t\to.close();\n\t\t} catch (FileNotFoundException e) {e.printStackTrace();}\n\t\tcatch (IOException e) {e.printStackTrace();}\n\t}", "void setStockFile(stockFilePT102.StockFileDocument.StockFile stockFile);", "public List<Stock> readFile() throws IOException\n {\n \t //System.out.println(\"hhh\");\n \t //List<Stock> listStock = mapper.readValue(file, new TypeReference<List<Stock>>() {});\n \t \n \t List<Stock> listStock = mapper.readValue(file, new TypeReference<List<Stock>>(){});\n \t\n\t\treturn listStock;\n }", "public void getOldFile() throws FileNotFoundException, IOException, ClassNotFoundException{\r\n\t\tObjectInputStream ois = new ObjectInputStream(new FileInputStream(\"agenda.txt\"));\r\n\t\tArrayList<Artist> inputArtists = (ArrayList<Artist>) ois.readObject();\r\n\t\tArrayList<Stage> inputStages = (ArrayList<Stage>) ois.readObject();\r\n\t\tArrayList<Performance> inputPerformances = (ArrayList<Performance>) ois.readObject();\r\n\t\tartists.addAll(inputArtists);\r\n\t\tstages.addAll(inputStages);\r\n\t\tperformances.addAll(inputPerformances);\r\n\t}", "private void updateDatFile() {\n\t\tIOService<?> ioManager = new IOService<Entity>();\n\t\ttry {\n\t\t\tioManager.writeToFile(FileDataWrapper.productMap.values(), new Product());\n\t\t\tioManager = null;\n\t\t} catch (Exception ex) {\n\t\t\tDisplayUtil.displayValidationError(buttonPanel, StoreConstants.ERROR + \" saving new product\");\n\t\t\tioManager = null;\n\t\t}\n\t}", "stockFilePT102.StockHeaderDocument.StockHeader addNewStockHeader();", "private void readFile() {\n try (BufferedReader br = new BufferedReader(new FileReader(\"../CS2820/src/production/StartingInventory.txt\"))) {\n String line = br.readLine();\n while (line != null) {\n line = br.readLine();\n this.items.add(line);\n }\n } catch (IOException e) {\n e.printStackTrace();\n }\n }", "private synchronized void saveData() throws RuntimeException {\r\n // if too much, serialize\r\n FileReader fr = null;\r\n BufferedReader br = null;\r\n // write out to the other file\r\n FileWriter fw = null;\r\n BufferedWriter bw = null;\r\n try {\r\n // read from the current toggle file\r\n fr = new FileReader(getToggleFile());\r\n br = new BufferedReader(fr);\r\n // change files\r\n toggle = !toggle;\r\n fw = new FileWriter(getToggleFile());\r\n bw = new BufferedWriter(fw);\r\n // sort the items\r\n ProjectFilePart[] pfps = (ProjectFilePart[]) buf.toArray(new ProjectFilePart[0]);\r\n Arrays.sort(pfps);\r\n int pfpsIndex = 0;\r\n // read/copy the lines\r\n for (String line = br.readLine(); line != null; line = br.readLine()) {\r\n // if it is empty, skip\r\n if (line.trim().equals(\"\")) {\r\n continue;\r\n // load the project file part\r\n }\r\n ProjectFilePart pfp = convertToProjectFilePart(line);\r\n // check which is less\r\n if (pfpsIndex >= pfps.length || pfp.compareTo(pfps[pfpsIndex]) <= 0) {\r\n bw.write(convertToStringLine(pfp));\r\n } else if (pfp.compareTo(pfps[pfpsIndex]) > 0) {\r\n // write all of the ones that are less\r\n while (pfpsIndex < pfps.length && pfp.compareTo(pfps[pfpsIndex]) > 0) {\r\n bw.write(convertToStringLine(pfps[pfpsIndex]));\r\n pfpsIndex++;\r\n }\r\n // write out the current entry\r\n bw.write(convertToStringLine(pfp));\r\n } else {\r\n System.out.println(\"Skipping \" + pfp.getRelativeName());\r\n }\r\n }\r\n // write the rest\r\n for (; pfpsIndex < pfps.length; pfpsIndex++) {\r\n bw.write(convertToStringLine(pfps[pfpsIndex]));\r\n }\r\n // clear the buffer\r\n buf.clear();\r\n } catch (Exception e) {\r\n throw new RuntimeException(e);\r\n } finally {\r\n // close the input\r\n IOUtil.safeClose(br);\r\n IOUtil.safeClose(fr);\r\n // flush the output\r\n try {\r\n bw.flush();\r\n } catch (Exception e) {\r\n }\r\n try {\r\n fw.flush();\r\n } catch (Exception e) {\r\n }\r\n // close the output\r\n IOUtil.safeClose(bw);\r\n IOUtil.safeClose(fw);\r\n }\r\n }", "private void loadFromFile() {\n try {\n FileInputStream fis = openFileInput(FILENAME);\n InputStreamReader isr = new InputStreamReader(fis);\n BufferedReader reader = new BufferedReader(isr);\n Gson gson = new Gson();\n Type listFeelingType = new TypeToken<ArrayList<Feeling>>(){}.getType();\n recordedFeelings.clear();\n ArrayList<Feeling> tmp = gson.fromJson(reader, listFeelingType);\n recordedFeelings.addAll(tmp);\n fis.close();\n\n } catch (FileNotFoundException e) {\n // TODO Auto-generated catch block\n recordedFeelings = new ArrayList<Feeling>();\n e.printStackTrace();\n } catch (IOException e) {\n // TODO Auto-generated catch block\n e.printStackTrace();\n }\n }", "private void loadDataFromMemory(String filename){\n shoppingList.clear();\n new ReadFromMemoryAsync(filename, getCurrentContext(), new ReadFromMemoryAsync.AsyncResponse(){\n\n @Override\n public void processFinish(List<ShoppingItem> output) {\n shoppingList.addAll(output);\n sortItems();\n }\n }).executeOnExecutor(AsyncTask.THREAD_POOL_EXECUTOR);\n// for (ShoppingItem item: items) {\n// shoppingList.add(item);\n// }\n// sortItems();\n }", "public static Map createStockList(){\n\t\t\n\t\t\n\t\t\n\t\ttry (BufferedReader br = new BufferedReader(new FileReader(file))){\n\t\t\t\n\t\t\tString currentLine;\n\t\t\t\n\t\t\tif ((currentLine=br.readLine())!= null){\n\t\t\t\tString str[] =currentLine.split(\",\");\n\t\t\t\t\n\t\t\t\tfor(int i=0; i< str.length;i++){\n\t\t\t\t\tif(str[i].equals(\"Symbol\"))\n\t\t\t\t\tsymbolIndex=i;\n\t\t\t\t\telse if(str[i].equals(\"Security Name\"))\n\t\t\t\t\tnameIndex=i;\n\t\t\t\t\telse if(str[i].equals(\"Price\"))\n\t\t\t\t\tpriceIndex=i;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\n\t\t\tif(symbolIndex==-1||nameIndex==-1||priceIndex==-1)\n\t\t\tSystem.out.println(\"CSV file is not in correct format\");\n\t\t\t\n\t\t\twhile ((currentLine=br.readLine())!=null){\t// read every line in csv file\n\t\t\t\t\n\t\t\t\tString str[] =currentLine.split(\",\");\n if(str.length==7) { \n\t\t\t\tif(str[priceIndex].equals(\"N\"))\n\t\t\t\t\tstr[priceIndex]=\"0\";\n\t\t\t\t\n\t\t\t\tstockList.put(str[symbolIndex],new Stock(str[symbolIndex],str[nameIndex],Double.parseDouble(str[priceIndex]))); // add stock to list\n }\n else {\n if(str[priceIndex].equals(\"N\"))\n\t\t\t\t\tstr[priceIndex]=\"0\";\n\t\t\t\t\n\t\t\t\tstockList.put(str[symbolIndex],new Stock(str[symbolIndex],str[nameIndex]+\"\"+str[nameIndex+str.length-7],Double.parseDouble(str[priceIndex+str.length-7])));\n }\n\t\t\t\t}\n\t\t\t\n\t\t\t}\n\t\t\tcatch (IOException e){\n\t\t\t\te.printStackTrace();\n\t\t\t\t}\n\t\t\treturn stockList;\n\t\t}", "void loadProducts(String filename);", "private void loadData(){\n try (BufferedReader br = new BufferedReader(new FileReader(this.fileName))) {\n String line;\n while((line=br.readLine())!=null){\n E e = createEntity(line);\n super.save(e);\n }\n } catch (IOException e) {\n e.printStackTrace();\n }\n }", "private void loadOrder(LocalDate date) throws PersistenceException{\n orders.clear();\n ORDER_FILE = \"Order_\"+ date+\".txt\";\n Scanner scanner;\n File file = new File(ORDER_FILE);\n if(file.exists()){\n \n \n try {\n scanner = new Scanner(\n new BufferedReader(\n new FileReader(ORDER_FILE)));\n } catch (FileNotFoundException e) {\n throw new PersistenceException(\n \"-_- Could not load data into memory.\",e);\n } \n scanner.nextLine();\n String currentLine;\n String[] currentTokens = new String[13]; \n while (scanner.hasNextLine()) {\n currentLine = scanner.nextLine();\n currentTokens = currentLine.split(DELIMITER);\n \n\n Order currentOrder = new Order(Integer.parseInt((currentTokens[0])));\n \n currentOrder.setOrderDate(LocalDate.parse(currentTokens[1]));\n currentOrder.setClientName(currentTokens[2]);\n currentOrder.setState(currentTokens[3]);\n currentOrder.setStateTax(new BigDecimal(currentTokens[4]));\n currentOrder.setProduct(currentTokens[5]);\n currentOrder.setArea(new BigDecimal(currentTokens[6]));\n currentOrder.setMaterialCost(new BigDecimal(currentTokens[7]));\n currentOrder.setLaborCost(new BigDecimal(currentTokens[8]));\n currentOrder.setTotalMaterialCost(new BigDecimal(currentTokens[9]));\n currentOrder.setTotalLaborCost(new BigDecimal(currentTokens[10]));\n currentOrder.setTotalTax(new BigDecimal(currentTokens[11]));\n currentOrder.setTotalCost(new BigDecimal(currentTokens[12]));\n \n orders.put(currentOrder.getOrderNumber(), currentOrder);\n }\n scanner.close();\n } else{\n try{\n file.createNewFile();\n } catch (IOException ex){\n throw new PersistenceException(\"Error! No orders from that date.\", ex);\n }\n }\n }", "private void restoreInformationOfMarket() throws IOException, InterruptedException {\n\n Gson gson=Market.gsonForEveryoneMArket();\n\n Marble[] list;\n try {\n list = gson.fromJson(new FileReader(\"fileConfiguration/Market.json\"),Marble[].class);\n market= new Market(list);\n } catch (FileNotFoundException e) {\n e.printStackTrace();\n }\n\n }", "public void saveStock(){\n\n\n try {\n BufferedWriter writercowA = new BufferedWriter(new FileWriter(\"cowAmount.txt\"));\n writercowA.write(cowAmount.getText());\n writercowA.close();\n\n BufferedWriter writerSheepA = new BufferedWriter(new FileWriter(\"sheepAmount.txt\"));\n writerSheepA.write(sheepAmount.getText());\n writerSheepA.close();\n\n BufferedWriter writergoatA = new BufferedWriter(new FileWriter(\"goatAmount.txt\"));\n writergoatA.write(goatAmount.getText());\n writergoatA.close();\n\n BufferedWriter writerChickenA = new BufferedWriter(new FileWriter(\"chickenAmount.txt\"));\n writerChickenA.write(chickenAmount.getText());\n writerChickenA.close();\n\n BufferedWriter writerduckA = new BufferedWriter(new FileWriter(\"duckAmount.txt\"));\n writerduckA.write(duckAmount.getText());\n writerduckA.close();\n\n BufferedWriter writercowW = new BufferedWriter(new FileWriter(\"cowWeight.txt\"));\n writercowW.write(cowWeight.getText());\n writercowW.close();\n\n BufferedWriter writerSheepW = new BufferedWriter(new FileWriter(\"sheepWeight.txt\"));\n writerSheepW.write(sheepWeight.getText());\n writerSheepW.close();\n\n BufferedWriter writergoatW = new BufferedWriter(new FileWriter(\"goatWeight.txt\"));\n writergoatW.write(goatWeight.getText());\n writergoatW.close();\n\n BufferedWriter writerChickenW = new BufferedWriter(new FileWriter(\"chickenWeight.txt\"));\n writerChickenW.write(chickenWeight.getText());\n writerChickenW.close();\n\n BufferedWriter writerduckW = new BufferedWriter(new FileWriter(\"duckWeight.txt\"));\n writerduckW.write(duckWeight.getText());\n writerduckW.close();\n\n } catch (IOException e) {\n e.printStackTrace();\n }\n }", "public void cargarProductosVendidos() {\n try {\n //Lectura de los objetos de tipo productosVendidos\n FileInputStream archivo= new FileInputStream(\"productosVendidos\"+this.getCorreo()+\".dat\");\n ObjectInputStream ruta = new ObjectInputStream(archivo);\n productosVendidos = (ArrayList) ruta.readObject();\n archivo.close();\n \n \n } catch (IOException ioe) {\n System.out.println(\"Error de IO: \" + ioe.getMessage());\n } catch (ClassNotFoundException cnfe) {\n System.out.println(\"Error de clase no encontrada: \" + cnfe.getMessage());\n } catch (Exception e) {\n System.out.println(\"Error: \" + e.getMessage());\n }\n }", "public void setLoadItems(String borrowedFileName) \n\t{\n\t\trecordCount = RESET_VALUE;\n\n\t\ttry \n\t\t{\n\t\t\tScanner infile = new Scanner(new FileInputStream(borrowedFileName));\n\n\t\t\twhile(infile.hasNext() == true && recordCount < MAX_ITEMS) \n\t\t\t{\n\t\t\t\titemIDs[recordCount] = infile.nextInt();\n\t\t\t\titemNames[recordCount] = infile.next(); \n\t\t\t\titemPrices[recordCount] = infile.nextDouble(); \n\t\t\t\tinStockCounts[recordCount] = infile.nextInt();\n\t\t\t\trecordCount++;\n\t\t\t}\n\n\t\t\tinfile.close();\n\n\t\t\t//sort parallel arrays by itemID\n\t\t\tsetBubbleSort();\n\n\t\t}//END try\n\n\t\tcatch(IOException ex) \n\t\t{\n\t\t\trecordCount = NOT_FOUND;\n\t\t}\n\t}", "private static Wine[] read() {\r\n\t\t// We can add files we would like to parse in the following array. We use an array list\r\n\t\t// because it allows us to add dynamically.\r\n\t\tString[] file_adr = { \"data/winemag-data_first150k.txt\", \"data/winemag-data-130k-v2.csv\" };\r\n\t\tArrayList<Wine> arr_list = new ArrayList<Wine>();\r\n\t\t\r\n\t\tint k = 0;\r\n\t\twhile (k < file_adr.length) {\r\n\t\t\tboolean flag = false;\r\n\t\t\tif (file_adr[k].endsWith(\".csv\")) {\r\n\t\t\t\tflag = true;\r\n\t\t\t}\r\n\t\t\tFile f = new File(file_adr[k]);\r\n\t\t\tScanner sc = null;\r\n\t\t\ttry {\r\n\t\t\t\tsc = new Scanner(f, \"UTF-8\");\r\n\t\t\t} catch (FileNotFoundException e) {\r\n\t\t\t\t// TODO Auto-generated catch block\r\n\t\t\t\te.printStackTrace();\r\n\t\t\t}\r\n\t\t\tsc.nextLine();\r\n\t\t\tInteger id_count = 0;\r\n\t\t\tif(!flag) {\r\n\t\t\t\twhile (sc.hasNextLine()) {\r\n\t\t\t\t\tString scanned = sc.nextLine();\r\n\t\t\t\t\t// if there is a blank line, skip it before a fail.\r\n\t\t\t\t\tif (scanned.isEmpty()) {\r\n\t\t\t\t\t\tscanned = sc.nextLine();\r\n\t\t\t\t\t}\r\n\t\t\t\t\t// use this instead of StringTokenizer because it won't skip empty fields.\r\n\t\t\t\t\tString[] st = scanned.split(\",\");\r\n\t\t\t\t\t\r\n\t\t\t\t\t/* was put here to make sure all fields show up.\r\n\t\t\t\t\tString toString = \"\";\r\n\t\t\t\t\tfor (int i = 0; i < st.length; i++) {\r\n\t\t\t\t\t\ttoString += st[i] + \", \";\r\n\t\t\t\t\t}\r\n\t\t\t\t\t*/\r\n\t\r\n\t\t\t\t\tString country = st[1];\r\n\t\t\t\t\tString description = \"\";\r\n\t\t\t\t\t// This piece grabs our entire description! this paragraph has our delimiters so it gets split.\r\n\t\t\t\t\tint count = 0;\r\n\t\t\t\t\tfor (int i = 2; i < (st.length - 10) + 2; i++) {\r\n\t\t\t\t\t\tif (st[i].endsWith(\"\\\"\")) {\r\n\t\t\t\t\t\t\tdescription += st[i];\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\telse {\r\n\t\t\t\t\t\t\tdescription += st[i] + \", \";\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\tcount++;\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t}\r\n\t\t\t\t\t\r\n\t\t\t\t\tString designation = st[count+2];\r\n\t\t\t\t\t\r\n\t\t\t\t\t// next two fields will fail if the field is empty, so make sure we assign it something.\r\n\t\t\t\t\tInteger points = !(st[count+3].isEmpty()) ? Integer.parseInt(st[count+3]) : -1;\r\n\t\t\t\t\t\r\n\t\t\t\t\tDouble price = !(st[count+4].isEmpty()) ? Double.parseDouble(st[count+4]) : -1.0;\r\n\t\t\t\t\t\r\n\t\t\t\t\tString province = st[count+5];\r\n\t\t\t\t\tString[] region = {\r\n\t\t\t\t\t\t\tst[count+6],\r\n\t\t\t\t\t\t\tst[count+7]\r\n\t\t\t\t\t};\r\n\t\t\t\t\tString variety = st[count+8];\r\n\t\t\t\t\tString winery = st[count+9];\r\n\t\t\t\t\t//System.out.println(id_count);\r\n\t\t\t\t\t// unique ID system because some wine bottles have empty names.\r\n\t\t\t\t\tInteger unique_id = id_count++;\r\n\t\t\t\t\t\r\n\t\t\t\t\tString[] items = {\r\n\t\t\t\t\t\t\tcountry,\r\n\t\t\t\t\t\t\tdescription,\r\n\t\t\t\t\t\t\tdesignation,\r\n\t\t\t\t\t\t\tprovince,\r\n\t\t\t\t\t\t\twinery,\r\n\t\t\t\t\t\t\tvariety\r\n\t\t\t\t\t};\r\n\t\t\t\t\t\r\n\t\t\t\t\tString[] reviewer = {\r\n\t\t\t\t\t\t\t\"\",\r\n\t\t\t\t\t\t\t\"\"\r\n\t\t\t\t\t};\r\n\t\t\t\t\t\r\n\t\t\t\t\tString[] taste = {};\r\n\t\t\t\t\t// Object constructor.\r\n\t\t\t\t\tWine curr_obj = new Wine(items, taste, region, points, unique_id, price, reviewer);\r\n\t\t\t\t\t\r\n\t\t\t\t\tarr_list.add(curr_obj);\r\n\t\t\t\t\t\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\tk++;\r\n\t\t\t\tsc.close();\r\n\t\t\t}\r\n\t\t\telse {\r\n\t\t\t\twhile (sc.hasNextLine()) {\r\n\t\t\t\t\tString scanned = sc.nextLine();\r\n\t\t\t\t\t// if there is a blank line, skip it before a fail.\r\n\t\t\t\t\tif (scanned.isEmpty()) {\r\n\t\t\t\t\t\tscanned = sc.nextLine();\r\n\t\t\t\t\t}\r\n\t\t\t\t\t// use this instead of StringTokenizer because it won't skip empty fields.\r\n\t\t\t\t\tString[] st = scanned.split(\",\");\r\n\t\t\t\t\t//System.out.println(arr_list.size());\r\n\t\t\t\t\tid_count = arr_list.size();\r\n\t\t\t\t\t/* was put here to make sure all fields show up.\r\n\t\t\t\t\tString toString = \"\";\r\n\t\t\t\t\tfor (int i = 0; i < st.length; i++) {\r\n\t\t\t\t\t\ttoString += st[i] + \", \";\r\n\t\t\t\t\t}\r\n\t\t\t\t\t*/\r\n\t\t\t\t\t//System.out.println(st[0]);\r\n\t\t\t\t\t/*if(Integer.parseInt(st[0]) == 30350) {\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t}\r\n\t\t\t\t\t*/\r\n\t\t\t\t\tString country = st[1];\r\n\t\t\t\t\tString description = \"\";\r\n\t\t\t\t\t// This piece grabs our entire description! this paragraph has our delimiters so it gets split.\r\n\t\t\t\t\tint count = 0;\r\n\t\t\t\t\tfor (int i = 2; i < (st.length - 12) + 2; i++) {\r\n\t\t\t\t\t\tif (st[i].endsWith(\"\\\"\")) {\r\n\t\t\t\t\t\t\tdescription += st[i];\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\telse {\r\n\t\t\t\t\t\t\tdescription += st[i] + \", \";\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\tcount++;\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t}\r\n\t\t\t\t\t\r\n\t\t\t\t\tString designation = st[count+2];\r\n\t\t\t\t\t\r\n\t\t\t\t\t// next two fields will fail if the field is empty, so make sure we assign it something.\r\n\t\t\t\t\tInteger points = !(st[count+3].isEmpty()) ? Integer.parseInt(st[count+3]) : -1;\r\n\t\t\t\t\t\r\n\t\t\t\t\tDouble price = !(st[count+4].isEmpty()) ? Double.parseDouble(st[count+4]) : -1.0;\r\n\t\t\t\t\t\r\n\t\t\t\t\tString province = st[count+5];\r\n\t\t\t\t\tString[] region = {\r\n\t\t\t\t\t\t\tst[count+6],\r\n\t\t\t\t\t\t\tst[count+7]\r\n\t\t\t\t\t};\r\n\t\t\t\t\tString taster_name = st[count+8];\r\n\t\t\t\t\tString taster_handle = st[count+9];\r\n\t\t\t\t\tString variety = st[count+10];\r\n\t\t\t\t\tString winery = st[count+11];\r\n\t\t\t\t\t//System.out.println(id_count);\r\n\t\t\t\t\t// unique ID system because some wine bottles have empty names.\r\n\t\t\t\t\tInteger unique_id = id_count++;\r\n\t\t\t\t\t\r\n\t\t\t\t\tString[] items = {\r\n\t\t\t\t\t\t\tcountry,\r\n\t\t\t\t\t\t\tdescription,\r\n\t\t\t\t\t\t\tdesignation,\r\n\t\t\t\t\t\t\tprovince,\r\n\t\t\t\t\t\t\twinery,\r\n\t\t\t\t\t\t\tvariety\r\n\t\t\t\t\t};\r\n\t\t\t\t\tString[] reviewer = {\r\n\t\t\t\t\t\t\ttaster_name,\r\n\t\t\t\t\t\t\ttaster_handle\r\n\t\t\t\t\t};\r\n\t\t\t\t\t\r\n\t\t\t\t\tString[] taste = {};\r\n\t\t\t\t\t// Object constructor.\r\n\t\t\t\t\tWine curr_obj = new Wine(items, taste, region, points, unique_id, price, reviewer);\r\n\t\t\t\t\t\r\n\t\t\t\t\tarr_list.add(curr_obj);\r\n\t\t\t\t\t\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\tk++;\r\n\t\t\t\tsc.close();\r\n\t\t\t}\r\n\t\t}\r\n\t\t// We no longer need an array list. we have our size required. Put into an array.\r\n\t\tWine[] array_wines = new Wine[arr_list.size()];\r\n\t\tarray_wines = arr_list.toArray(array_wines);\r\n\t\t\r\n\t\treturn array_wines;\r\n\t\r\n\t}", "public void writeFile(List<Stock>listStock) throws IOException\n {\n \t //StockImplement implement=new StockImplement();\n \t \n \t mapper.defaultPrettyPrintingWriter().writeValue(file, listStock);\n \t// mapper.writeValue(file, listStock);\n\t\t\n \t \n }", "private void readSavedFile() {\n\n String[] files = new String[0];\n \n // On récupère la liste des fichiers\n File file = new File(folderName);\n\n // check if the specified pathname is directory first\n if(file.isDirectory()){\n //list all files on directory\n files = file.list();\n }\n\n if (files != null) {\n for(String currentFile : files) {\n Vehicule voiture;\n try {\n FileInputStream fileIn = new FileInputStream(folderName + \"/\" + currentFile);\n ObjectInputStream in = new ObjectInputStream(fileIn);\n voiture = (Vehicule) in.readObject();\n addVoitureToList(voiture);\n in.close();\n fileIn.close();\n } catch (IOException i) {\n i.printStackTrace();\n return;\n } catch (ClassNotFoundException c) {\n System.out.println(\"#Erreur : Impossible de récupérer l'objet \" + currentFile);\n c.printStackTrace();\n return;\n }\n }\n }\n }", "public void cargarProductosComprados() {\n try {\n //Lectura de los objetos de tipo productoComprado\n FileInputStream archivo= new FileInputStream(\"productosComprados\"+this.getCorreo()+\".dat\");\n ObjectInputStream ruta = new ObjectInputStream(archivo);\n productosComprados = (ArrayList) ruta.readObject();\n archivo.close();\n \n \n } catch (IOException ioe) {\n System.out.println(\"Error de IO: \" + ioe.getMessage());\n } catch (ClassNotFoundException cnfe) {\n System.out.println(\"Error de clase no encontrada: \" + cnfe.getMessage());\n } catch (Exception e) {\n System.out.println(\"Error: \" + e.getMessage());\n }\n }", "public static void RDStockePEntrpot(Destination entrepot){\n File file = new File(\"src/StockeParEntrpot.txt\");\n try {\n if(!file.exists())\n file.createNewFile();\n BufferedWriter writer = new BufferedWriter(new FileWriter(file));\n for(int i = 0; i < entrepot.getSize(); i++){\n if(entrepot.getDon(i).getEtat() == Etat.STOCKE) {\n System.out.println(entrepot.getDon(i));\n writer.write(entrepot.getDon(i).toString() + \"\\r\\n\");\n }\n }\n writer.close();\n } catch (FileNotFoundException e) {\n e.printStackTrace();\n } catch (IOException e){\n e.printStackTrace();\n }\n }", "public void cargarProductosEnVenta() {\n try {\n //Lectura de los objetos de tipo producto Vendido\n FileInputStream archivo= new FileInputStream(\"productosVentaCliente\"+this.getCorreo()+\".dat\");\n ObjectInputStream ruta = new ObjectInputStream(archivo);\n this.productosEnVenta = (ArrayList) ruta.readObject();\n archivo.close();\n \n \n } catch (IOException ioe) {\n System.out.println(\"ERROR: \" + ioe.getMessage());\n } catch (ClassNotFoundException cnfe) {\n System.out.println(\"ERROR: \" + cnfe.getMessage());\n } catch (Exception e) {\n System.out.println(\"ERROR: \" + e.getMessage());\n }\n }", "public void readToCsv() {\r\n\r\n String seperator = \";\";\r\n\r\n try (BufferedReader reader = new BufferedReader(\r\n new FileReader(\"Products.csv\"))){\r\n\r\n String line = null;\r\n for(int i=1; (line = reader.readLine()) != null; i++) {\r\n String[] fields = line.split(seperator, -1);\r\n\r\n // For nutrients objects to read\r\n if(fields.length ==5){\r\n Nutrient object= new Nutrient();\r\n object.name = fields[0];\r\n object.price = Double.parseDouble(fields[1]);\r\n object.tag=fields[2];\r\n object.content = fields[3];\r\n object.numOfProduct = Integer.parseInt(fields[4]);\r\n //object.addFeatures(object.name,object.price,object.size,object.gender,object.tag,object.content,object.numOfProduct);\r\n NutrientList.add(object);\r\n allProducts.add(object);\r\n }\r\n // For Cosmetics objects to read\r\n if (fields.length==6){\r\n Cosmetics object2=new Cosmetics();\r\n object2.name = fields[0];\r\n object2.price = Double.parseDouble(fields[1]);\r\n object2.gender = fields[2];\r\n object2.tag=fields[3];\r\n object2.content = fields[4];\r\n object2.numOfProduct = Integer.parseInt(fields[5]);\r\n //object2.addFeatures(object2.name,object2.price,object2.size,object2.gender,object2.tag,object2.content,object2.numOfProduct);\r\n CosmeticsList.add(object2);\r\n allProducts.add(object2);\r\n }\r\n // For clothes objects to read\r\n if(fields.length ==7){\r\n\r\n Clothes object3=new Clothes();\r\n object3.name = fields[0];\r\n object3.price = Double.parseDouble(fields[1]);\r\n object3.size= fields[2];\r\n object3.tag=fields[4];\r\n object3.content = fields[5];\r\n object3.numOfProduct = Integer.parseInt(fields[6]);\r\n object3.addFeatures(object3.name,object3.price,object3.size,\"E\",object3.tag,object3.content,object3.numOfProduct);\r\n ClothesList.add(object3);\r\n allProducts.add(object3);\r\n }\r\n\r\n }}\r\n catch (IOException e) {\r\n e.printStackTrace();\r\n }\r\n }", "private void loadData() {\n this.financeDataList = new ArrayList<>();\n }", "public void saveFile() throws FileNotFoundException {\r\n try {\r\n PrintWriter out = new PrintWriter(FILE_NAME);\r\n //This puts back the labels that the loadFile removed\r\n out.println(\"date,cust_email,cust_location,product_id,product_quantity\");\r\n int i = 0;\r\n\r\n while (i < orderInfo.size()) {\r\n String saved = orderInfo.get(i).toString();\r\n out.println(saved);\r\n i++;\r\n }\r\n out.close();\r\n } catch (FileNotFoundException e) {\r\n }\r\n\r\n }", "public void load(){\n\t\t\tArrayList<String> entries = readEntriesFromFile(FILENAME);\n\t\t\t\n\t\t\tfor(int i = 1; i < entries.size(); i++){\n\t\t\t\tString entry = entries.get(i);\n\t\t\t\tString[] entryParts = entry.split(\",\");\n\t\t\t\tString name = entryParts[0];\n\t\t\t\tString power = entryParts[1];\n\t\t\t\tString gold = entryParts[2];\n\t\t\t\tString xp = entryParts[3];\n\t\t\t\tString location = entryParts[4];\n\t\t\t\tint powerInt = Integer.parseInt(power);\n\t\t\t\tint goldInt = Integer.parseInt(gold);\n\t\t\t\tint XPInt = Integer.parseInt(xp);\n\t\t\t\tRegion regionR = RM.getRegion(location);\n\t\t\t\tTrap trap = new Trap(name, powerInt, goldInt, XPInt, regionR);\n\t\t\t\ttrapList[i-1] = trap;\n\t\t\t}\n\t}", "private void refreshStock(){\n storeStock = sysMgr.getStock(sysMgr.getLoginId());\n ArrayList<Stock> nonEmpty = new ArrayList<>();\n for(Stock i : storeStock)\n if(i.getQuantity() != 0)\n nonEmpty.add(i);\n storeStock = nonEmpty;\n }", "public void updateStockData() {\n\t\t\ttry {\n\t\t\t\tthis.dataURL = new URL(this.url);\n\t\t\t} catch (final MalformedURLException e) {\n\t\t\t\tSystem.out\n\t\t\t\t\t\t.println(\"CRITICAL ERROR: The impossible has happened! The hard-hoded URL was malformed.\");\n\t\t\t\tSystem.exit(1);\n\t\t\t}\n\t\t\tScanner scanner;\n\t\t\ttry {\n\t\t\t\tscanner = new Scanner(this.dataURL.openStream());\n\t\t\t\twhile (scanner.hasNextLine())\n\t\t\t\t\ttry {\n\t\t\t\t\t\tscanner\n\t\t\t\t\t\t\t\t.findInLine(Pattern\n\t\t\t\t\t\t\t\t\t\t.compile(\"([0-9.]*),\\\"([0-9a-zA-Z._-]*)\\\",\\\"([a-zA-Z._\\\\s-]*)\\\"\"));\n\t\t\t\t\t\tfinal MatchResult result = scanner.match();\n\t\t\t\t\t\tboolean found = false;\n\t\t\t\t\t\tfor (final StockCompany company : StockBrokerImpl.this.stockData)\n\t\t\t\t\t\t\tif (company.getCompanySymbol().equals(\n\t\t\t\t\t\t\t\t\tresult.group(2))) {\n\t\t\t\t\t\t\t\tfinal Double stockPrice = Double\n\t\t\t\t\t\t\t\t\t\t.parseDouble(result.group(1));\n\t\t\t\t\t\t\t\tcompany.setStockPrice(stockPrice);\n\t\t\t\t\t\t\t\tfound = true;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\tif (!found)\n\t\t\t\t\t\t\tStockBrokerImpl.this.stockData\n\t\t\t\t\t\t\t\t\t.add(new StockCompany(result.group(3),\n\t\t\t\t\t\t\t\t\t\t\tresult.group(2), Double\n\t\t\t\t\t\t\t\t\t\t\t\t\t.parseDouble(result\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.group(1))));\n\n\t\t\t\t\t\tscanner.nextLine();\n\n\t\t\t\t\t} catch (final NumberFormatException e) {\n\t\t\t\t\t\tSystem.out\n\t\t\t\t\t\t\t\t.println(\"CRITICAL ERROR: Update data corrupted. [Virtually impossible]\");\n\t\t\t\t\t\tSystem.exit(1);\n\t\t\t\t\t}\n\t\t\t\tscanner.close();\n\t\t\t} catch (final IOException e) {\n\t\t\t\tSystem.out\n\t\t\t\t\t\t.println(\"ERROR: Connection to stock price update feed could not be established.\");\n\t\t\t}\n\t\t}", "@Override\n\tpublic void importData(String filePath) {\n\t\tString[] allLines = readFile(filePath);\n\n\t\t//Obtains the date to give to all sales from the cell in the first line and first column of the csv\n\t\t//And formats it into the expected format.\n\t\tString[] firstLine = allLines[0].split(\",(?=([^\\\"]*\\\"[^\\\"]*\\\")*[^\\\"]*$)\", -1);\n\t\tString[] title = firstLine[0].split(\"\\\\(\");\n\t\tSimpleDateFormat oldFormat = new SimpleDateFormat(\"MMMMM, yyyy\");\n\t\tSimpleDateFormat newFormat = new SimpleDateFormat(\"MMM yyyy\");\n\t\tDate date = null;\n\t\ttry {\n\t\t\tdate = oldFormat.parse(title[1].replaceAll(\"[()]\", \"\"));\n\t\t} catch (ParseException e) {\n\t\t\tSystem.out.println(\"There was parsing the date in the first cell of the first line of the csv.\\n\" \n\t\t\t\t\t+ \" A date of the format 'October, 2017' was expected.\");\n\t\t\te.printStackTrace();\n\t\t}\n\t\tthis.monthAndYear = newFormat.format(date);\n\n\t\t//Parses data for each currency and places it in class variable listForex by calling importForex() on each currency line of csv\n\t\t//Considers that the first line of currencies is the fourth line of csv.\n\t\t//Stops if counter reaches the total number of lines of csv, or if the line is shorter than 15 characters,\n\t\t//so that it doesn't try to parse the summary lines below the last currency line.\n\t\tint counter = 3;\n\t\twhile (counter< allLines.length && allLines[counter].length() > 15) {\n\t\t\timportForex(allLines[counter]);\n\t\t\tcounter++;\n\t\t}\n\n\t\tChannel apple = obtainChannel(\"Apple\", new AppleFileFormat(), false);\n\n\t\t//Places the imported data in the app,\n\t\t//making sure not to replace the existing list of FX rates for this month and year if there is one.\n\t\t//It does however update the FX rate value for currencies that are already in the data for this month.\n\t\tif (apple.getHistoricalForex().containsKey(monthAndYear)) {\n\t\t\tHashMap<String, Double> existingList = apple.getHistoricalForex().get(monthAndYear);\n\t\t\tfor (String s : existingList.keySet()) {\n\t\t\t\tlistForex.put(s, existingList.get(s));\n\t\t\t}\t\n\t\t}\n\t\tapple.addHistoricalForex(monthAndYear, listForex);\n\t}", "public void setLoadItems(String borrowedFileName, int borrowedSize) \n\t{\n\t\trecordCount = RESET_VALUE;\n\n\t\ttry \n\t\t{\n\t\t\tScanner infile = new Scanner(new FileInputStream(borrowedFileName));\n\n\t\t\twhile(infile.hasNext() == true && recordCount < MAX_ITEMS && recordCount < borrowedSize) \n\t\t\t{\n\t\t\t\titemIDs[recordCount] = infile.nextInt();\n\t\t\t\titemNames[recordCount] = infile.next();\n\t\t\t\titemPrices[recordCount] = infile.nextDouble();\n\t\t\t\torderQuantity[recordCount] = infile.nextInt();\n\t\t\t\torderTotals[recordCount] = infile.nextDouble(); \n\t\t\t\trecordCount++;\n\t\t\t}\n\n\t\t\t//close file\n\t\t\tinfile.close();\n\n\t\t\t//sort by itemID\n\t\t\tsetBubbleSort();\n\t\t}//END try\n\n\t\tcatch(IOException ex) \n\t\t{\n\t\t\trecordCount = NOT_FOUND;\n\t\t}\n\t}", "private void updateFile() {\n\t\tPrintWriter outfile;\n\t\ttry {\n\t\t\toutfile = new PrintWriter(new BufferedWriter(new FileWriter(\"stats.txt\")));\n\t\t\toutfile.println(\"15\"); // this is the number\n\t\t\tfor (Integer i : storeInfo) {\n\t\t\t\toutfile.println(i); // we overwrite the existing files\n\t\t\t}\n\t\t\tfor (String s : charBought) {\n\t\t\t\toutfile.println(s); // overwrite the character\n\t\t\t}\n\t\t\tfor (String s : miscBought) {\n\t\t\t\toutfile.println(s);\n\t\t\t}\n\t\t\toutfile.close();\n\t\t}\n\t\tcatch (IOException ex) {\n\t\t\tSystem.out.println(ex);\n\t\t}\n\t}", "public static void getAllValidTickersWithExchangesAndSectors()\n {\n PrintWriter writer = null;\n HashMap<String,Integer> sec = new HashMap<>();\n HashMap<String,Integer> ex = new HashMap<>();\n int counter = 0;\n try {\n writer = new PrintWriter(\"data/validTickers.txt\", \"UTF-8\");\n BufferedReader br = new BufferedReader(new FileReader(\"data/tickers.csv\"));\n String sCurrentLine = null;\n while ((sCurrentLine = br.readLine()) != null) {\n counter++;\n String[] arr = sCurrentLine.split(\",\");\n String ticker = arr[0].substring(1, arr[0].length() - 1);\n int secIndex = arr.length - 1;\n int exIndex = arr.length - 3;\n if(arr[exIndex].equals(\"\") || arr[secIndex].equals(\"0\") || arr[secIndex].equals(\"\"))\n {\n continue;\n }\n System.out.println(counter+\" : \"+arr[exIndex]+\" : \"+ arr[secIndex]);\n String exchange = arr[exIndex].substring(1,arr[exIndex].length() -1);\n String sector = arr[secIndex];\n if(sec.containsKey(sector))\n {\n sector = sec.get(sector).toString();\n }\n else\n {\n sec.put(sector,sec.size()+1);\n sector = sec.get(sector).toString();\n }\n if(ex.containsKey(exchange))\n {\n exchange = ex.get(exchange).toString();\n }\n else\n {\n ex.put(exchange,ex.size()+1);\n exchange = ex.get(exchange).toString();\n }\n try {\n\n File f = new File(\"data/stockData/\" + ticker);\n if(f.exists() && !f.isDirectory()) {\n writer.println(ticker+\",\"+sector+\",\"+exchange);\n }\n }\n catch (Exception e)\n {\n e.printStackTrace();\n }\n\n }\n writer.close();\n\n System.out.println(\"Loading ExMap : \"+ ex.size()+\" & SectorMap : \"+sec.size());\n writer = new PrintWriter(\"data/exchangeMap.txt\", \"UTF-8\");\n for( String s : ex.keySet())\n {\n writer.println(s+\",\"+ex.get(s));\n }\n writer.close();\n writer = new PrintWriter(\"data/sectorMap.txt\", \"UTF-8\");\n for( String s : sec.keySet())\n {\n writer.println(s+\",\"+sec.get(s));\n }\n writer.close();\n }\n catch (Exception e)\n {\n e.printStackTrace();\n if(writer != null)\n {\n writer.close();\n }\n }\n\n\n\n\n }", "@Override\r\n public void load(String[] arr) {\r\n\tString name = arr[arr.length - 1];\r\n\tString fileName = arr[arr.length - 2];\r\n\ttry {\r\n\t byte[] temp = new byte[4096];\r\n\t InputStream in = new MyDecompressorInputStream(new FileInputStream(fileName));\r\n\t int numOfBytes = in.read(temp);\r\n\t in.close();\r\n\t byte[] b = new byte[numOfBytes];\r\n\t for (int i = 0; i < b.length; i++) {\r\n\t\tb[i] = temp[i];\r\n\t }\r\n\t Maze3d maze = new Maze3d(b);\r\n\t hMaze.put(name, maze);\r\n\t setChanged();\r\n\t notifyObservers((\"load:\" + name).split(\":\"));\r\n\t} catch (FileNotFoundException e) {\r\n\t setChanged();\r\n\t notifyObservers(\"Error - the file was not found\");\r\n\t} catch (IOException e) {\r\n\t setChanged();\r\n\t notifyObservers(\"Error - IOException\");\r\n\t}\r\n }", "@SuppressWarnings(\"unchecked\")\n public ArrBag( String infileName ) throws Exception\n {\n count = 0; // i.e. logical size, actual number of elems in the array\n BufferedReader infile = new BufferedReader( new FileReader( infileName ) );\n while ( infile.ready() )\n this.add( (T) infile.readLine() );\n infile.close();\n }", "public void readFile() {\n ArrayList<Movement> onetime = new ArrayList<Movement>(); \n Movement newone = new Movement(); \n String readLine; \n\n File folder = new File(filefolder); \n File[] listOfFiles = folder.listFiles(); \n for (File file : listOfFiles) {\n if (file.isFile()&& file.getName().contains(\"200903\")) {\n try {\n onetime = new ArrayList<Movement>(); \n newone = new Movement(); \n BufferedReader br = new BufferedReader(new FileReader(filefolder+\"\\\\\"+file.getName())); \n readLine = br.readLine (); \n String[] previouline = readLine.split(\",\"); \n int previousint = Integer.parseInt(previouline[7]); \n while ( readLine != null) {\n String[] currentline = readLine.split(\",\"); \n if (Integer.parseInt(currentline[7]) == previousint)\n {\n newone.addRecord(currentline[0], currentline[1], currentline[2], currentline[4], currentline[5], currentline[6]); \n newone.ID = Integer.parseInt(currentline[7]); \n newone.filedate = file.getName();\n } else\n { \n onetime.add(newone); \n newone = new Movement(); \n newone.addRecord(currentline[0], currentline[1], currentline[2], currentline[4], currentline[5], currentline[6]);\n }\n previousint = Integer.parseInt(currentline[7]); \n readLine = br.readLine ();\n }\n }\n catch (IOException e) {\n e.printStackTrace();\n }\n rawdata.add(onetime);\n } \n }\n println(rawdata.size());\n}", "private void updateFile() {\n try {\n this.taskStorage.save(this.taskList);\n this.aliasStorage.save(this.parser);\n } catch (IOException e) {\n System.out.println(\"Master i am unable to save the file!\");\n }\n }", "public void initStockData() {\n\t\t\tStockBrokerImpl.this.stockData = new ArrayList<StockCompany>();\n\t\t\tthis.updateStockData();\n\t\t\tfor (final StockCompany company : StockBrokerImpl.this.stockData)\n\t\t\t\tSystem.out.println(company.getStockPrice());\n\n\t\t}", "public static void processData(ArrayList<StockPortfolio> alStockPortfolios) {\r\n\t\ttry {\r\n\t\t\tFileWriter writer=new FileWriter(new File(\"src/resource/stockportFolioOutput.json\"));\r\n\t\t JSONArray stockArr=new JSONArray();\r\n\t\t long totalPrice=0;\r\n\t\t for (StockPortfolio objStockPortfolio : alStockPortfolios){\r\n\t\t \tJSONObject stockobj=new JSONObject();\r\n\t\t\tstockobj.put(\"Total price of each\",objStockPortfolio.getNoOfShare()*objStockPortfolio.getPriceOfShare());\r\n\t\t\ttotalPrice += objStockPortfolio.getNoOfShare()*objStockPortfolio.getPriceOfShare();\r\n\t\t\tstockArr.add(stockobj);\r\n\t\t }\r\n\t\t JSONObject objJson = new JSONObject();\r\n\t\t objJson.put(\"totalPriceOfAllProducts\", totalPrice);\r\n\t\t stockArr.add(objJson);\r\n\t\t\twriter.write(stockArr.toJSONString());\r\n\t\t\twriter.flush();\r\n\t\t\twriter.close();\r\n\t\t\r\n\t\t} catch (IOException e) {\r\n\t\te.printStackTrace();\r\n\t\t}\r\n\t}", "void populateArray () {\r\n\r\n\t\ttry {\r\n\t\t\tfis = new FileInputStream (\"Bank.dat\");\r\n\t\t\tdis = new DataInputStream (fis);\r\n\t\t\t//Loop to Populate the Array.\r\n\t\t\twhile (true) {\r\n\t\t\t\tfor (int i = 0; i < 6; i++) {\r\n\t\t\t\t\trecords[rows][i] = dis.readUTF ();\r\n\t\t\t\t}\r\n\t\t\t\trows++;\r\n\t\t\t}\r\n\t\t}\r\n\t\tcatch (Exception ex) {\r\n\t\t\ttotal = rows;\r\n\t\t\tif (total == 0) { }\r\n\t\t\telse {\r\n\t\t\t\ttry {\r\n\t\t\t\t\tdis.close();\r\n\t\t\t\t\tfis.close();\r\n\t\t\t\t}\r\n\t\t\t\tcatch (Exception exp) { }\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t}", "public static void addSong(String binaryFile){\r\n \r\n //Input from user how many songs to add\r\n int numberOfSongs = Input.getInt(\"How many songs would you like to add? \");\r\n \r\n //Array of Songs with size of that number of songs\r\n Song[] songArray = new Song[numberOfSongs];\r\n \r\n //Process through array\r\n for (int i = 0; i < numberOfSongs; i++){\r\n songsEntered += 1; //Increase songsEntered as song is being entered\r\n String appendange = \" of Song \" + songsEntered + \"?\"; //Common appendange for all user prompts\r\n //Each element of the array is a new Song given the arguments from user prompts\r\n songArray[i] = new Song(Input.getString(\"What is the title\" + appendange), Input.getString(\"Who is the artist\" + appendange), Input.getString(\"What is the genre\" + appendange));\r\n }\r\n //Create a new SongBinaryFileProcessor because need to use instance methods\r\n SongBinaryFileProcessor songBinaryFileProcessor = new SongBinaryFileProcessor();\r\n \r\n //Write to the song given the binaryFile argument and the songArray formed from user prompting\r\n songBinaryFileProcessor.writeSong(binaryFile, songArray);\r\n \r\n //Display confirmation that song(s) added\r\n if (numberOfSongs == 1){\r\n System.out.println(\"Song added!\");\r\n }\r\n else{\r\n System.out.println(\"Songs added!\");\r\n }\r\n }", "public static void loadcars() {\n Cars xx = new Cars();\n System.out.println(\"Load cars\");\n listcars.clear();\n try {\n File fileload = new File(\"cars.csv\");\n BufferedReader in = new BufferedReader(new FileReader(fileload));\n String st;\n while((st = in.readLine()) != null) {\n String[] strs = st.split(\"[,//;]\");\n addcar(strs[0], strs[1], strs[2],Integer.parseInt(strs[3]));\n }\n in.close();\n System.out.println(\"cars data restored from cars.csv\");\n } catch (IOException i) {\n i.printStackTrace();\n }\n\n\n }", "private static void writeToFilePriceHistory() throws IOException {\n FileWriter write = new FileWriter(path3, append);\n PrintWriter print_line = new PrintWriter(write);\n ArrayList<Product> stock = Inventory.getStock();\n for (int i = 0; i < stock.size(); i++) {\n Product product = (Product) stock.get(i);\n int UPC = product.getUpc();\n ArrayList<String> priceH = product.price.getArrayPriceHistory();\n for (int j = 0; j < priceH.size(); j++) {\n String price = priceH.get(j);\n textLine = UPC + \" \" + price;\n print_line.printf(\"%s\" + \"%n\", textLine);\n }\n }\n print_line.close();\n }", "private void analyzeStocks(JSONArray stockArray){\n\t\tbuyArray = new JSONArray();\n\t\tsellArray = new JSONArray();\n\n\t\tfor(int a = 0; a < stockArray.length(); a++){\n\n\t\t\t// Some objects dont always have correct values\n\t\t\tif (!stockArray.getJSONObject(a).isNull(\"DividendYield\") \n\t\t\t\t\t&& !stockArray.getJSONObject(a).isNull(\"FiftydayMovingAverage\")\n\t\t\t\t\t&& !stockArray.getJSONObject(a).isNull(\"Bid\")\n\t\t\t\t\t&& !stockArray.getJSONObject(a).isNull(\"PERatio\")){\n\n\n\n\t\t\t\tdouble fiftyDayAvg = stockArray.getJSONObject(a).getDouble(\"FiftydayMovingAverage\");\n\t\t\t\tdouble bid = stockArray.getJSONObject(a).getDouble(\"Bid\");\n\t\t\t\tdouble divYield = stockArray.getJSONObject(a).getDouble(\"DividendYield\");\n\t\t\t\tdouble peRatio = stockArray.getJSONObject(a).getDouble(\"PERatio\");\n\n\t\t\t\t//Parse Market Cap - form: 205B (int)+(string)\n\t\t\t\tString marketCap = stockArray.getJSONObject(a).getString(\"MarketCapitalization\");\n\t\t\t\tString marketCapSuf = marketCap.substring(marketCap.length()-1);\n\t\t\t\tdouble marketCapAmt = Double.parseDouble(marketCap.substring(0, marketCap.length()-1));\n\t\t\t\tmarketCapAmt = marketCapAmt*suffixes.get(marketCapSuf);\n\n\t\t\t\t//Large checks\n\t\t\t\tif(marketCapAmt >= (10*suffixes.get(\"B\"))){\n\t\t\t\t\tif((bid < fiftyDayAvg*largefiftyWeekPercBuy)\t\t\t//Buy\n\t\t\t\t\t\t\t&& (divYield > largeYield) \n\t\t\t\t\t\t\t&& (peRatio < largePEBuy)){\n\n\t\t\t\t\t\tbuyArray.put(stockArray.getJSONObject(a));\n\t\t\t\t\t}\n\t\t\t\t\telse if((bid > fiftyDayAvg*largefiftyWeekPercSell)\t\t//Sell\n\t\t\t\t\t\t\t&& (peRatio > largePESell)){\n\n\t\t\t\t\t\tsellArray.put(stockArray.getJSONObject(a));\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\t//Medium checks\n\t\t\t\telse if(marketCapAmt >= (2*suffixes.get(\"B\"))){\t\n\t\t\t\t\tif((bid < fiftyDayAvg*medfiftyWeekPercBuy)\t\t\t\t//Buy\n\t\t\t\t\t\t\t&& (divYield > medYield) \n\t\t\t\t\t\t\t&& (peRatio < medPEBuy)){\n\n\t\t\t\t\t\tbuyArray.put(stockArray.getJSONObject(a));\n\t\t\t\t\t}\n\t\t\t\t\telse if((bid > fiftyDayAvg*medfiftyWeekPercSell)\t\t//Sell\n\t\t\t\t\t\t\t&& (peRatio > medPESell)){\n\n\t\t\t\t\t\tsellArray.put(stockArray.getJSONObject(a));\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t//Small\tchecks\n\t\t\t\telse if(marketCapAmt >= (300*suffixes.get(\"M\"))){\t\t\t\t\n\t\t\t\t\tif((bid < fiftyDayAvg*smfiftyWeekPercBuy)\t\t\t\t//Buy\n\t\t\t\t\t\t\t&& (divYield > smYield) \n\t\t\t\t\t\t\t&& (peRatio < smPEBuy)){\n\n\t\t\t\t\t\tbuyArray.put(stockArray.getJSONObject(a));\n\t\t\t\t\t}\n\t\t\t\t\telse if((bid > fiftyDayAvg*smfiftyWeekPercSell)\t\t\t//Sell\n\t\t\t\t\t\t\t&& (peRatio > smPESell)){\n\n\t\t\t\t\t\tsellArray.put(stockArray.getJSONObject(a));\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}", "stockFilePT102.StockFileDocument.StockFile getStockFile();", "public void data() {\n\n BufferedReader br = null;\n try {\n br = new BufferedReader(new FileReader(\"/Users/macbook_user/Desktop/OOP Project/List.txt\"));\n } catch (FileNotFoundException e) {\n e.printStackTrace();\n return;\n }\n\n String[] columnName\n = {\"Id\", \"Name\", \"Amount\", \"Shelf#\", \"Position\"};\n int i, index;\n String line;\n try {\n br.readLine();\n while ((line = br.readLine()) != null) {\n index = 0;\n String[] se = line.split(\" \");\n Map<String, Object> item = new HashMap<>();\n for (i = 0; i < se.length; i++) {\n if (\"\".equals(se[i])) {\n continue;\n }\n if (index >= columnName.length) {\n continue;\n }\n item.put(columnName[index], se[i]);\n index++;\n }\n\n //get the amount of the item from the list\n int amount = Integer.parseInt((String) item\n .get(columnName[2]));\n\n // if amount greater than 0, Existence is Y, else N\n if (amount > 0) {\n item.put(\"Existence\", \"Y\");\n } else {\n item.put(\"Existence\", \"N\");\n }\n\n inventory.add(item);// add item to ArrayList\n }\n br.close();\n\n outPutFile();\n } catch (IOException e) {\n }\n\n }", "public static void main(String[] args) {\n\t\t\t\tStockHolding STOCKS[] = new StockHolding[3];\r\n\t\t\t\t\r\n\t\t\t\tSTOCKS[0] = new StockHolding((float)2.30, (float)4.50, (int)40, \"Cr7 limited\");\r\n\t\t\t\tSTOCKS[1] = new StockHolding((float)12.19, (float)10.56, (int)90, \"L10 Pvt Limited\");\r\n\t\t\t\tSTOCKS[2] = new StockHolding((float)45.10, (float)49.51, (int)210, \"21LVA Ltd.\");\r\n\t\t\t\t\r\n\t\t\t\t//function to display in alphabetical order\r\n\t\t\t\tsort_asc_S(STOCKS);\r\n\t\t\t\t\r\n\t\t\t\t//array of ForeignStockHolding\r\n\t\t\t\tForeighStockHolding FR_STOCKS[] = new ForeighStockHolding[3];\r\n\t\t\t\t\r\n\t\t\t\tFR_STOCKS[0] = new ForeighStockHolding((float)1.30, (float)3.50, (int)30, \"Recron limited\", (float)0.94);\r\n\t\t\t\tFR_STOCKS[1] = new ForeighStockHolding((float)2.19, (float)2.56, (int)60, \"Utratech Pvt Limited\", (float)1.10);\r\n\t\t\t\tFR_STOCKS[2] = new ForeighStockHolding((float)5.10, (float)4.51, (int)10, \"Gulf Oil\", (float)1.25);\r\n\t\t\t\t\r\n\t\t\t\t//function to display in reverse alphabetical order\r\n\t\t\t\tsort_des_F(FR_STOCKS);\r\n\t\t\t\t\r\n\t\t\t\t\r\n\t\t\t\t//modifying the application according to the user \r\n\t\t\t\t\r\n\t\t\t\t//taking no of stock from user\r\n\t\t\t\tScanner input = new Scanner(System.in);\r\n\t\t\t\t\r\n\t\t\t\tSystem.out.print(\"Enter no of stocks(Do not enter more than 8 stocks) : \");\r\n\t\t\t\t\r\n\t\t\t\t//no of stock user want to access\r\n\t\t\t\tint n = input.nextInt();\r\n\t\t\t\t\r\n\t\t\t\t//declaring array of ForeignStockHolding as per user requirement \r\n\t\t\t\tForeighStockHolding STOCKS_F[] = new ForeighStockHolding[n];\r\n\t\t\t\t\r\n\t\t\t\tfor(int i=0; i<n; i++)\r\n\t\t\t\t{\r\n\t\t\t\t\t//to take the type of stock user want to enter\r\n\t\t\t\t\tint type_Stock;\r\n\t\t\t\t\t\r\n\t\t\t\t\tSystem.out.print(\"Press enter\\n 1). For StockHolding \\n 2). For ForeignStockHolding \\n\");\r\n\t\t\t\t\t\r\n\t\t\t\t\t//taking the type of stock\r\n\t\t\t\t\ttype_Stock = input.nextInt();\r\n\t\t\t\t\t\r\n\t\t\t\t\t//declaring the variable to take input for purchaseSharePrice, currentSharePrice, conversionRate\r\n\t\t\t\t\tfloat purchasePrice,currentPrice, conRate;\r\n\t\t\t\t\t\r\n\t\t\t\t\t//declaring the variable to take input for numberOfShares\r\n\t\t\t\t\tint noOfShare;\r\n\t\t\t\t\t\r\n\t\t\t\t\t//declaring the variable to take input for companyName\r\n\t\t\t\t\tString c_ame;\r\n\t\t\t\t\t\r\n\t\t\t\t\t//taking input from user for each field specified in stock\r\n\t\t\t\t\tSystem.out.print(\"Enter the purchaseSharePrice for stock : \");\r\n\t\t\t\t\tpurchasePrice = input.nextFloat();\r\n\t\t\t\t\tSystem.out.print(\"Enter the currentSharePrice for stock : \");\r\n\t\t\t\t\tcurrentPrice = input.nextFloat();\r\n\t\t\t\t\tSystem.out.print(\"Enter the noOfShares for stock : \");\r\n\t\t\t\t\tnoOfShare = input.nextInt();\r\n\t\t\t\t\tSystem.out.print(\"Enter the companyName for stock : \");\r\n\t\t\t\t\tc_ame = input.next();\r\n\t\t\t\t\t\r\n\t\t\t\t\t//if the stock is of type StockHolding then conversion rate is 1 else take input from user\r\n\t\t\t\t\tif(type_Stock == 1)\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tconRate = 1;\r\n\t\t\t\t\t}\r\n\t\t\t\t\telse \r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tSystem.out.print(\"Enter the conversion Rate for foreign stock\");\r\n\t\t\t\t\t\tconRate = input.nextFloat();\r\n\t\t\t\t\t}\r\n\t\t\t\t\t\r\n\t\t\t\t\t//initialize the stock type as per user requirement\r\n\t\t\t\t\tSTOCKS_F[i] = new ForeighStockHolding(purchasePrice, currentPrice, noOfShare, c_ame, conRate);\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\t//a variable of boolean type\r\n\t\t\t\tboolean value = true;\r\n\t\t\t\t\r\n\t\t\t\t//continue loop until user donot command to exit\r\n\t\t\t\twhile(value)\r\n\t\t\t\t{\r\n\t\t\t\t\tSystem.out.println(\"Enter your choice : \\n 1) To display stock information with the lowest value\\r\\n\" + \r\n\t\t\t\t\t\t\t\" 2) To display stock with the highest value\\r\\n\" + \r\n\t\t\t\t\t\t\t\" 3) To display the most profitable stock\\r\\n\" + \r\n\t\t\t\t\t\t\t\" 4) To display the least profitable stock\\r\\n\" + \r\n\t\t\t\t\t\t\t\" 5) To list all stocks sorted by company name (A-Z)\\r\\n\" + \r\n\t\t\t\t\t\t\t\" 6) To list all stocks sorted from the lowest value to the highest value\\r\\n\" + \r\n\t\t\t\t\t\t\t\" 7) To exit\");\r\n\t\t\t\t\t\r\n\t\t\t\t\t//variable to take choice of user\r\n\t\t\t\t\tint choice = input.nextInt();\r\n\t\t\t\t\t\r\n\t\t\t\t\tswitch(choice)\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tcase 1: \r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\tdisplayMinValue(STOCKS_F);\r\n\t\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\tcase 2:\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\tdisplayMaxValue(STOCKS_F);\r\n\t\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\tcase 3:\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\tdisplayMaxProfitableStock(STOCKS_F);\r\n\t\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\tcase 4:\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\tdisplayMinProfitableStock(STOCKS_F);\r\n\t\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\tcase 5:\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\tsort_asc_S(STOCKS_F);\r\n\t\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\tcase 6:\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\tdisplayInSortedValueOrder(STOCKS_F);\r\n\t\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\tcase 7:\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\tvalue = false;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t\t\r\n\t\t\t\t}\r\n\t\t\t\tSystem.out.println(\"EXITING THE SYSTEM\\n\\nSYSTEM EXIT STATUS : RETURNED\");\r\n\t\t\t\tinput.close();\r\n\t\t\t}", "public void loadData () {\n // create an ObjectInputStream for the file we created before\n ObjectInputStream ois;\n try {\n ois = new ObjectInputStream(new FileInputStream(\"DB/Guest.ser\"));\n\n int noOfOrdRecords = ois.readInt();\n Guest.setMaxID(ois.readInt());\n System.out.println(\"GuestController: \" + noOfOrdRecords + \" Entries Loaded\");\n for (int i = 0; i < noOfOrdRecords; i++) {\n guestList.add((Guest) ois.readObject());\n //orderList.get(i).getTable().setAvailable(false);\n }\n } catch (IOException | ClassNotFoundException e1) {\n // TODO Auto-generated catch block\n e1.printStackTrace();\n }\n }", "public void readHistory()throws Exception {\n int currentline = 0;\n File myObj = new File(\"order_history.txt\");\n Scanner myReader = new Scanner(myObj);\n outputHistoryObj = new Order[1];\n while (myReader.hasNextLine()) {\n Pizza[] list = new Pizza[1];\n String[] commentparts = null; //This is superstitious, sorry\n String[] fullparts = myReader.nextLine().split(\" // \");\n String[] pizzaparts = fullparts[1].split(\" , \");\n for(int i=0; i<=pizzaparts.length-1; i++){\n if(pizzaparts[i].contains(\" & \")){\n commentparts = pizzaparts[i].split(\" & \");\n list[i] = new Pizza(Menu.list[Integer.parseInt(commentparts[0])-1].getName(), Menu.list[Integer.parseInt(commentparts[0])-1].getIngredients(), commentparts[1], Integer.parseInt(commentparts[0]), Menu.list[Integer.parseInt(commentparts[0])-1].getPrice());\n } else {\n list[i] = new Pizza(Menu.list[Integer.parseInt(pizzaparts[i])-1].getName(), Menu.list[Integer.parseInt(pizzaparts[i])-1].getIngredients(), \"\", Integer.parseInt(pizzaparts[i]), Menu.list[Integer.parseInt(pizzaparts[i])-1].getPrice());\n }\n list = Arrays.copyOf(list, list.length + 1); //Resize name array by one more\n }\n SimpleDateFormat format = new SimpleDateFormat(\"yyyy-MM-dd HH:mm:ss.SSS\");\n Date parsed = format.parse(fullparts[3]);\n java.sql.Timestamp timestamp = new java.sql.Timestamp(parsed.getTime());\n outputHistoryObj[currentline] = new Order(fullparts[0], Integer.parseInt(fullparts[2]), timestamp, list);\n outputHistoryObj = Arrays.copyOf(outputHistoryObj, outputHistoryObj.length + 1); //Resize name array by one more\n currentline++;\n }\n myReader.close();\n }", "private void removefromstore()\r\n\t{\r\n\t\tFile inputFile = new File(\"InventoryItems.csv\");\r\n\t\tFile tempFile = new File(\"temp.csv\");\r\n\t\tString cvsSplitBy = \",\";\r\n\t\t\r\n\t\tBufferedReader reader;\r\n\t\ttry {\r\n\t\t\treader = new BufferedReader(new FileReader(inputFile));\r\n\t\t\tBufferedWriter writer = new BufferedWriter(new FileWriter(tempFile));\r\n\t\t\tString currentLine;\r\n\t\t\t\r\n\t\t\twhile((currentLine = reader.readLine()) != null) {\r\n\t\t\t // trim newline when comparing with lineToRemove\r\n\t\t\t\tString[] tempItem = currentLine.split(cvsSplitBy);\r\n\t\t\t if(tempItem[0].equals(this.id)) \r\n\t\t\t \tcontinue;\r\n\t\t\t writer.write(currentLine + System.getProperty(\"line.separator\"));\r\n\t\t\t}\r\n\t\t\twriter.close(); \r\n\t\t\treader.close(); \r\n\t\t\t\r\n\t\t\t//clear the file\r\n\t\t\tPrintWriter pwriter = new PrintWriter(inputFile);\r\n\t\t\tpwriter.print(\"\");\r\n\t\t\tpwriter.close();\r\n\t\t\t\r\n\t\t\t//copy back the data\r\n\t\t\treader = new BufferedReader(new FileReader(tempFile));\r\n\t\t writer = new BufferedWriter(new FileWriter(inputFile));\r\n\t\t\t\r\n\t\t\twhile((currentLine = reader.readLine()) != null) {\r\n\t\t\t writer.write(currentLine + System.getProperty(\"line.separator\"));\r\n\t\t\t}\r\n\t\t\twriter.close(); \r\n\t\t\treader.close(); \r\n\t\t} catch (FileNotFoundException e) {\r\n\t\t\t// TODO Auto-generated catch block\r\n\t\t\te.printStackTrace();\r\n\t\t} catch (IOException e) {\r\n\t\t\t// TODO Auto-generated catch block\r\n\t\t\te.printStackTrace();\r\n\t\t}\r\n\t\t\r\n\r\n\r\n\t\t\r\n\t}", "public static ArrayList<StockPortfolio> fetchDataFromFile() {\r\n\t\tArrayList<StockPortfolio> alStockPortfolios = new ArrayList<>();\r\n\t\tJSONParser parser= new JSONParser();\r\n\t\ttry{\r\n\t\t\tJSONArray alStock=(JSONArray)parser.parse(new FileReader(\"src/resource/StockInformation.json\"));\r\n\t\t\tfor(Object stock:alStock){\r\n\t\t\t\tJSONObject stockJson=(JSONObject) stock;\r\n\t\t\t\tStockPortfolio objStockPortfolio = new StockPortfolio();\r\n\t\t\t\tobjStockPortfolio.setName(stockJson.get(\"name\").toString());\r\n\t\t\t\tobjStockPortfolio.setNoOfShare((Long)stockJson.get(\"noOfShare\"));\r\n\t\t\t\tobjStockPortfolio.setPriceOfShare((Long)stockJson.get(\"priceOfShare\"));\r\n\t\t\t\talStockPortfolios.add(objStockPortfolio); \r\n\t\t\t}\r\n\t\t}catch(Exception e){\r\n\t\t\te.getMessage();\r\n\t\t}\r\n\t\treturn alStockPortfolios;\r\n\t}", "public static void main(String[] args) throws IOException {\n\t\tFile k01_f = new File(\"C:\\\\Users\\\\강세영\\\\Desktop\\\\StockDailyPrice.csv\");\t\t\t// 파일 저장 위치 설정\n\t\tBufferedReader k01_br = new BufferedReader(new FileReader(k01_f));\t\t\t\t\t// BufferedReader 클래스 사용해서 k01_f파일 읽기\n\t\t\n\t\tFile k01_f1 = new File(\"C:\\\\Users\\\\강세영\\\\Desktop\\\\20150112.csv\");\t\t\t\t\t// 파일 저장 위치 설정\n\t\tBufferedWriter k01_bw = new BufferedWriter(new FileWriter(k01_f1));\t\t\t\t\t// BufferedWriter 클래스 사용해서 k01_f1파일 생성\n\t\t\n\t\tString k01_readtxt;\t\t\t\t\t\t\t\t\t\t\t\t\t\t// 문장형 변수 k01_readtxt 선언\n\t\tint k01_cnt = 0;\t\t\t\t\t\t\t\t\t\t\t\t\t\t// 정수형 변수 k01_cnt 선언\t\n\t\t\n\t\twhile ((k01_readtxt = k01_br.readLine()) != null) {\t\t\t\t\t\t// k01_br에 k01_readtxt안 내용이 아무것도 없지 않다면\n\t\t\tStringBuffer k01_s = new StringBuffer();\t\t\t\t\t\t\t//스트링 버퍼 생성\n\t\t\tString [] k01_field = k01_readtxt.split(\",\");\t\t\t\t\t\t// ,를 구분자로 하여 문장형 배열 k01_field 생성\n\t\t\t\n\t\t\tif (k01_field[1].equals(\"20150112\")) {\t\t\t\t\t\t\t\t// k01_field[1] 항목이 20150112이라면\n\t\t\t\tk01_s.append(k01_field[0].trim());\t\t\t\t\t\t\t\t// k01_field[0]부터 공백없이 모든 항목 덮어쓰기\n\t\t\t\tfor (int k01_j = 1; k01_j < k01_field.length; k01_j++) {\t\t// 1 <= k01_j < 01_field 범위에서 1씩 증가하는 동안\n\t\t\t\t\tk01_s.append(\",\" + k01_field[k01_j].trim());\t\t\t\t// 덮어쓰기\n\t\t\t\t}\n\t\t\t\tk01_bw.write(k01_s.toString());\t\t\t\t\t\t\t\t\t// k01_s.toString 출력\n\t\t\t\tk01_bw.newLine();\t\t\t\t\t\t\t\t\t\t\t\t// 줄바꿈\t\t\t\n\t\t\t\tk01_cnt++;\t\t\t\t\t\t\t\t\t\t\t\t\t\t// k01_cnt 1씩 증가\t\t\t\t\n\t\t\t}\n\t\t}\n\t\tk01_br.close();\t\t\t\t\t\t\t\t\t\t\t\t// BufferedReader 클래스 종료\n\t\tk01_bw.close();\t\t\t\t\t\t\t\t\t\t\t\t// BufferedWriter 클래스 종료\n\t\tSystem.out.printf(\"20150112 [%d] records\\n\", k01_cnt);\t\t// 20150112 [k01_cnt]records 출력 후 줄바꿈\t\t\t\n\t}", "public void newDeck()\r\n\t{\r\n\t\t// attempts to read the file\r\n\t\ttry\r\n\t\t{\r\n\t\t\t// sets up file input\r\n\t\t\tFile file = new File(FILE_NAME);\r\n\t\t\tScanner inputFile = new Scanner(file);\r\n\t\t\t\r\n\t\t\t// creates counter for array input\r\n\t\t\tint i = 0;\r\n\t\t\t\r\n\t\t\t// reads card notations from file\r\n\t\t\twhile (inputFile.hasNext() && i < DECK_SIZE)\r\n\t\t\t{\r\n\t\t\t\tcards[i] = inputFile.nextLine();\r\n\t\t\t\t\r\n\t\t\t\ti++;\r\n\t\t\t}\r\n\t\r\n\t\t\t// Closes the file.\r\n\t\t\tinputFile.close();\r\n\t\t\t\r\n\t\t\t// Sets topCard\r\n\t\t\ttopCard = 51;\r\n\t\t\t\r\n\t\t\t// shuffles deck\r\n\t\t\tshuffle();\r\n\t\t}\r\n\t\tcatch (FileNotFoundException e)\r\n\t\t{\r\n\t\t\t// prints error if file not found\r\n\t\t\tSystem.out.println(\"The file \" + FILE_NAME + \" does not exist.\");\r\n\t\t}\r\n\t}", "private void loadInventory(String fileName){\t\t\r\n\t\tList<String> list = new ArrayList<String>();\r\n\r\n\t\ttry (Stream<String> stream = Files.lines(Paths.get(fileName))) {\r\n\t\t\t//Convert it into a List\r\n\t\t\tlist = stream.collect(Collectors.toList());\r\n\r\n\t\t} catch (IOException e) {\r\n\t\t\te.printStackTrace();\r\n\t\t}\r\n\t\t\r\n\t\tfor(String itemList : list){\r\n\t\t\tString[] elements = itemList.split(\"--\");\r\n\t\t\t\r\n\t\t\ttry{\r\n\t\t\t\tswitch(elements[0].toUpperCase()){\r\n\t\t\t\t\tcase \"BURGER\":\r\n\t\t\t\t\t\t\tinventory.add(createBurger(elements));;\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\tbreak;\t\t\t\t\t\t\t\r\n\t\t\t\t\tcase \"SALAD\":\r\n\t\t\t\t\t\t\tinventory.add(createSalad(elements));;\r\n\t\t\t\t\t\t\tbreak;\r\n\t\t\t\t\tcase \"BEVERAGE\":\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\tinventory.add(createBeverage(elements));;\r\n\t\t\t\t\t\t\tbreak;\r\n\t\t\t\t\tcase \"SIDE\":\t\t\t\t\t\t\r\n\t\t\t\t\t\t\tinventory.add(createSide(elements));;\r\n\t\t\t\t\t\t\tbreak;\r\n\t\t\t\t\tcase \"DESSERT\":\r\n\t\t\t\t\t\t\tinventory.add(createDessert(elements));;\r\n\t\t\t\t\t\t\tbreak;\t\t\t\t\r\n\t\t\t\t}\r\n\t\t\t}catch(Exception e){\r\n\t\t\t\tSystem.err.println(e.getMessage());\r\n\t\t\t}\r\n\t\t}\t\t\r\n\t}", "public Stock() {\n // initialize _stock array in max size\n _stock = new FoodItem[MAX_STOCK_SIZE];\n // set _noOfItem to 0 - no items yet\n _noOfItems = 0;\n }", "public static void readArray(String fileName, int[] newArray) throws Exception{\n\n // Create DataInputStream object to read from binary file.\n // Use fileName from demo file and read into newArray in demo file.\n DataInputStream input = new DataInputStream(new FileInputStream(fileName));\n\n // Create boolean variable to determine End Of File\n boolean EOF = false;\n\n // While it's not the End Of File\n while(!EOF){\n\n // Try Catch Statement\n try{\n\n // for Loop to go through each integer in the binary file\n for(int i = 0; i < newArray.length; i++){\n\n // read the number and place it in the newArray\n newArray[i] = input.readInt();\n }\n }catch(EOFException e){ // Catch clause to find end of file\n // Change EOF to True\n EOF = true;\n }\n\n }\n // Close the file\n input.close();\n }", "public void processRaw(String rawfilepath){\n\t\tbyte tempbyte[] = new byte[131072];\n\t\ttempbyte = loadBytes(rawfilepath);\n\t\tfor (int i=0; i < header.length; i++){\n\t\t\theader[i]= tempbyte[i];\n\t\t}\n\t\tfor (int i = 0; i < EEPROM.length;){\n\t\t\tEEPROM[i] = tempbyte[i+1024];\n\t\t}\n\t\torganizeEEPROM();\n\t\tprocessData();\n\t\tsavefile();\n\t}", "@Override\r\n\tpublic void updateIceCreamRecord(int iceId) {\n\t\ttry {\r\n\t\t\tfis = new FileInputStream(original1);\r\n\t\t\tois = new ObjectInputStream(fis);\r\n\t\t\tfos = new FileOutputStream(tempFile1);\r\n\t\t\toos = new ObjectOutputStream(fos);\r\n\r\n\t\r\n\t\tList<IceCreamBean> updateList1 = new ArrayList<IceCreamBean>();\r\n\r\n\t\t\r\n\t\t\tupdateList1 = (List<IceCreamBean>) ois.readObject();\r\n\t\t\tfor (IceCreamBean p : updateList1) {\r\n\t\t\t\tif (p.getIceId() == iceId) {\r\n\t\t\t\t\tSystem.out\r\n\t\t\t\t\t\t\t.println(\"select \\n1.pname \\n2.pprice\\n3.pqty you want to update\");\r\n\t\t\t\t\tint n = sc.nextInt();\r\n\t\t\t\t\tswitch (n) {\r\n\t\t\t\t\tcase 1:\r\n\t\t\t\t\t\tSystem.out.println(\"Enter new Icecream name\");\r\n\t\t\t\t\t\tp.setIceName(sc.next());\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t\tcase 2:\r\n\t\t\t\t\t\tSystem.out.println(\"Enter new Icecream Price\");\r\n\t\t\t\t\t\tp.setIceprice(sc.nextDouble());\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t\tcase 3:\r\n\t\t\t\t\t\tSystem.out.println(\"Enter new Icecream Quantity\");\r\n\t\t\t\t\t\tp.setPqty(sc.nextInt());\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t\tdefault:\r\n\t\t\t\t\t\tSystem.out.println(\"choose between 1-3\");\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t}\r\n\t\t\t\t\ttempList1 = new ArrayList<IceCreamBean>();\r\n\t\t\t\t\ttempList1.add(p);\r\n\t\t\t\t} else {\r\n\t\t\t\t\ttempList1.add(p);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tfos=new FileOutputStream(tempFile1);\r\n\t\t\toos=new ObjectOutputStream(oos);\r\n\t\t\t\toos.writeObject(tempList1);\r\n\t\t\t\toriginal1.delete();\r\n\t\t\t\ttempFile1.renameTo(original);\r\n\t\t\t\r\n\t\t\r\n\t\t} catch (FileNotFoundException e) {\r\n\t\t\t// TODO Auto-generated catch block\r\n\t\t\te.printStackTrace();\r\n\t\t} catch (IOException e) {\r\n\t\t\t// TODO Auto-generated catch block\r\n\t\t\te.printStackTrace();\r\n\t\t} catch (ClassNotFoundException e) {\r\n\t\t\t// TODO Auto-generated catch block\r\n\t\t\te.printStackTrace();\r\n\t\t}\r\n\r\n\t\t\r\n\t}", "private void saveInFile() {\n try {\n FileOutputStream fos = openFileOutput(FILENAME,\n Context.MODE_PRIVATE);//goes stream based on filename\n BufferedWriter out = new BufferedWriter(new OutputStreamWriter(fos)); //create buffer writer\n Gson gson = new Gson();\n gson.toJson(countbookList, out);//convert java object to json string & save in output\n out.flush();\n fos.close();\n } catch (FileNotFoundException e) {\n throw new RuntimeException();\n } catch (IOException e) {\n throw new RuntimeException();\n }\n }", "public void buildStocks(List<String[]> stockData){\n for(int i = 0; i < stockData.size(); i++){\n this.addToStockManager(this.buildStock(i, stockData)); \n }\n }", "public void readDataFromFile(){\n try {\n weatherNow.clear();\n // Open File\n Scanner scan = new Scanner(context.openFileInput(fileSaveLoc));\n\n // Find all To Do items\n while (scan.hasNextLine()) {\n String line = scan.nextLine();\n\n // if line is not empty it is data, add item.\n if (!line.isEmpty()) {\n // first is the item name and then the item status.\n String[] readList = line.split(\",\");\n String city = readList[0];\n String countryCode = readList[1];\n double temp = Double.parseDouble(readList[2]);\n String id = readList[3];\n String description = readList[4];\n\n weatherNow.add(new WeatherNow(city,countryCode, temp, id, description));\n }\n }\n\n // done\n scan.close();\n } catch (IOException e) {\n e.printStackTrace();\n }\n }", "public ArrayList load() {\n File savefile = new File(\"bookings.txt\");\r\n try {\r\n if (savefile.createNewFile()) {\r\n System.out.println(\"Save file doesnt exist, creating...\");\r\n\r\n try {\r\n FileWriter writer = new FileWriter(savefile);\r\n\r\n for (int x = 0; x <= 89; x = x + 1) {\r\n String stringbuild = (x + \",false,none\");\r\n writer.write(stringbuild + \"\\n\");\r\n }\r\n writer.flush();\r\n writer.close();\r\n } catch (IOException ex) {\r\n Logger.getLogger(ParseBookings.class.getName()).log(Level.SEVERE, null, ex);\r\n }\r\n\r\n } else {\r\n System.out.println(\"Save file exists. Will load...\");\r\n }\r\n } catch (IOException ex) {\r\n Logger.getLogger(ParseBookings.class.getName()).log(Level.SEVERE, null, ex);\r\n }\r\n\r\n System.out.println(\"Loading Started...\");\r\n\r\n ArrayList Seats = new ArrayList();\r\n ArrayList Seats_Bronze = new ArrayList();\r\n ArrayList Seats_Silver = new ArrayList();\r\n ArrayList Seats_Gold = new ArrayList();\r\n\r\n try {\r\n File file = new File(\"bookings.txt\");\r\n FileReader filereader = new FileReader(file);\r\n BufferedReader bufferedreader = new BufferedReader(filereader);\r\n\r\n String buffer;\r\n while ((buffer = bufferedreader.readLine()) != null) {\r\n String[] buffersplit = buffer.split(\",\", -1);\r\n int index = Integer.parseInt(buffersplit[0]);\r\n if (index < 30) {\r\n //System.out.println(\"Bronze @ \"+index);\r\n\r\n Seat_Bronze bseat_ = new Seat_Bronze();\r\n bseat_.setID(index);\r\n bseat_.setBooked(Boolean.parseBoolean(buffersplit[1]), buffersplit[2]);\r\n Seats_Bronze.add(bseat_);\r\n\r\n } else if (59 >= index && index > 29) {\r\n //System.out.println(\"Silver @ \"+index);\r\n\r\n Seat_Silver sseat_ = new Seat_Silver();\r\n sseat_.setID(index);\r\n sseat_.setBooked(Boolean.parseBoolean(buffersplit[1]), buffersplit[2]);\r\n Seats_Silver.add(sseat_);\r\n\r\n } else {\r\n //System.out.println(\"Gold @\"+index);\r\n\r\n Seat_Gold gseat_ = new Seat_Gold();\r\n gseat_.setID(index);\r\n gseat_.setBooked(Boolean.parseBoolean(buffersplit[1]), buffersplit[2]);\r\n Seats_Gold.add(gseat_);\r\n\r\n }\r\n\r\n }\r\n\r\n Seats.add(Seats_Bronze);\r\n Seats.add(Seats_Silver);\r\n Seats.add(Seats_Gold);\r\n System.out.println(\"Loading Complete.\");\r\n System.out.println(\"Loaded B/S/G: \" + Seats_Bronze.size() + \"/\" + Seats_Silver.size() + \"/\" + Seats_Gold.size());\r\n\r\n return Seats;\r\n\r\n } catch (FileNotFoundException ex) {\r\n Logger.getLogger(ParseBookings.class.getName()).log(Level.SEVERE, null, ex);\r\n } catch (IOException ex) {\r\n Logger.getLogger(ParseBookings.class.getName()).log(Level.SEVERE, null, ex);\r\n }\r\n return null;\r\n }", "private void refillStock(ArrayList<Integer> stock) {\n\t\tgetSetUpMachine().setFork_stock(getSetUpMachine().getFork_stock() + stock.get(2));\n\t\tgetSetUpMachine().setNapkin_stock(getSetUpMachine().getNapkin_stock() + stock.get(3));\n\t\tgetSetUpMachine().setSpoon_stock(getSetUpMachine().getSpoon_stock() + stock.get(1));\n\t\tgetSetUpMachine().setKnife_stock(getSetUpMachine().getKnife_stock() + stock.get(0));\n\t\tSystem.out.format(\"\\n[ %d: K - %d: S - %d: F - %d: N ]\\n\", getSetUpMachine().getKnife_stock(),\n\t\t\t\tgetSetUpMachine().getSpoon_stock(), getSetUpMachine().getFork_stock(),\n\t\t\t\tgetSetUpMachine().getNapkin_stock());\n\t}", "public void restore() {\n\t\ttry {\n\t\t\tFile latest = null;\n\t\t\t// restore the last file back into memory\n\t\t\tList<File> files = FindFile.find(getName(), \"shouts.*.js\", false, false);\n\n\t\t\tfor (int i = 0; i < files.size(); ++i) {\n\t\t\t\tFile f = files.get(i);\n\t\t\t\tif (latest == null) {\n\t\t\t\t\tlatest = f;\n\t\t\t\t}\n\t\t\t\tif (f.lastModified() > latest.lastModified()) {\n\t\t\t\t\tlatest = f;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif (latest == null) {\n\t\t\t\tlog.info(\"no files found to restore\");\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tinfo(\"loading latest file %s\", latest);\n\n\t\t\tString json = String.format(\"[%s]\", FileIO.fileToString(latest.getAbsoluteFile()));\n\n\t\t\tShout[] saved = Encoder.fromJson(json, Shout[].class);\n\n\t\t\tfor (int i = 0; i < saved.length; ++i) {\n\t\t\t\tshouts.add(saved[i]);\n\t\t\t}\n\n\t\t} catch (Exception e) {\n\t\t\tLogging.logError(e);\n\t\t}\n\t}", "public void loadSave(){\n if((new File(\"data.MBM\")).exists()){\n isNew = false;\n\n try {\n BufferedReader br = new BufferedReader(new FileReader(\"data.MBM\"));\n String line = br.readLine();\n \n while (line != null) {\n \n if(line.contains(\"outDir\")){\n String[] result = line.split(\":\");\n outputDir = new File(result[1]);\n if(outputDir.exists() == false){\n isNew = true;\n }\n }\n else if(line.contains(\"MBMWORLD\")){\n String[] result = line.split(\":\");\n //1 = filename\n //2 = world name\n //3 = path\n //4 = date\n addWorld(new File(result[3]), result[2]);\n worlds.get(numWorlds()-1).setLastBackup(result[4]);\n }\n \n line = br.readLine();\n }\n \n br.close();\n \n } catch(IOException e){\n System.out.println(e);\n }\n }\n }", "public void chooser() {\n\t\tString[] currency_a = new String[8];// puts the currency name from imported file\n\t\tString[] symbol_a = new String[8];// puts the currency symbols from imported file\n\t\tDouble[] rate_a = new Double[8];// stores the rate from imported file\n\t\tJFileChooser fc = new JFileChooser(); // object of jfilechooser\n\t\tfc.setCurrentDirectory(new java.io.File(\".\")); // sets the current directory to the project's directory\n\t\tfc.setDialogTitle(\"Choose File\");\n\t\tfc.setFileSelectionMode(JFileChooser.FILES_ONLY);// only files can be selected\n\t\tFileNameExtensionFilter filter = new FileNameExtensionFilter(\"TEXT FILES\", \"txt\", \"text\");// only selects text\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// files\n\t\tfc.setFileFilter(filter);// applys the filter to jfilechooser\n\t\tfc.showOpenDialog(null);// opens the jfilechooser dialog box\n\t\tint i = 0; // to store values in array\n\t\ttry {\n\t\t\tbr = new BufferedReader(\n\t\t\t\t\tnew InputStreamReader(new FileInputStream(fc.getSelectedFile().getAbsolutePath()), \"UTF8\"));\n\t\t\tSystem.out.println(\"This is works \");\n\t\t\t// reads the files with UTF-8 encoded file\n\t\t\t// gets the file chosen by jfilechooser\n\t\t\t// stores the file content in br\n\t\t\ttry {\n\t\t\t\tline= br.readLine();\n\t\t\t\tSystem.out.println(\"This is line: \"+line);\n\t\t\t\t\n\t\t\t\twhile ((line = br.readLine()) != null) {// reads a line of text. A line is considered to be terminated\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t// by any one of a line feed ('\\n')\n\t\t\t\t\t\n\t\t\t\t\t// if the file hasn't ended, the loop continues\n\n\t\t\t\t\tString[] temp = line.split(\",\");// splits the content of the file using , as token and stores them\n\t\t\t\t\t\t\t\t\t\t\t\t\t// in array temp\n\t\t\t\t\ttry {\n\t\t\t\t\t\tcurrency_a[i] = temp[0].trim();// puts the value of currency from the file\n\t\t\t\t\t\t// temp 0 stores the first word in line and stores it in currency\n\t\t\t\t\t\tif (temp[0].trim().isEmpty()) {// checks and notifies if there is no value in temp\n\t\t\t\t\t\t\tString msg = \"The currency name may be missing in line \" + (i + 1) + \".\";\n\t\t\t\t\t\t\tJOptionPane.showMessageDialog(null, msg, \"Invalid Currency\", JOptionPane.ERROR_MESSAGE);// displays\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// error\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// message\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\ttry {// tries to parse the string into double and is only successful if there are\n\t\t\t\t\t\t\t\t// nothing but numbers in the string\n\n\t\t\t\t\t\t\trate_a[i] = Double.parseDouble(temp[1].trim());// puts the value of rate from the file and\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// converts in into double because\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// everything is in strings in the file\n\n\t\t\t\t\t\t} catch (NumberFormatException e) {// if the number can't be parsed, error message is displayed\n\t\t\t\t\t\t\tString msg = \"The rate may not be a numeric value in line \" + (i + 1) + \".\";\n\t\t\t\t\t\t\tJOptionPane.showMessageDialog(null, msg, \"Invalid Number\", JOptionPane.ERROR_MESSAGE);\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif (temp[1].trim().isEmpty()) {// checks and notifies if there are errors\n\t\t\t\t\t\t\tString msg = \"The rate may be missing in line \" + (i + 1) + \".\";\n\t\t\t\t\t\t\tJOptionPane.showMessageDialog(null, msg, \"Invalid Number\", JOptionPane.ERROR_MESSAGE);\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tsymbol_a[i] = temp[2].trim(); // stores the value of symbols from the file\n\t\t\t\t\t\tif (temp[2].trim().isEmpty()) {\n\t\t\t\t\t\t\tString msg = \"The currency symbol may be missing in line \" + (i + 1) + \".\";\n\t\t\t\t\t\t\tJOptionPane.showMessageDialog(null, msg, \"Invalid Symbol\", JOptionPane.ERROR_MESSAGE);\n\t\t\t\t\t\t}\n\t\t\t\t\t} catch (ArrayIndexOutOfBoundsException e) { // if there are more or less values in the line, array\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// out of bound error occurs\n\t\t\t\t\t\tString msg = \"The field delimiter may be missing or wrong field delimiter is used in line \"\n\t\t\t\t\t\t\t\t+ (i + 1) + \".\";\n\t\t\t\t\t\tJOptionPane.showMessageDialog(null, msg, \"Invalid Delimeter\", JOptionPane.ERROR_MESSAGE);\n\n\t\t\t\t\t}\n\t\t\t\t\ti++; // increases the value of i\n\t\t\t\t}\n\t\t\t} catch (IOException e) {// input or output operation is failed or interpreted\n\t\t\t\tString msg = \"Input Error\";\n\t\t\t\tJOptionPane.showMessageDialog(null, msg, \"Invalid File\", JOptionPane.ERROR_MESSAGE);\n\t\t\t}\n\t\t} catch (UnsupportedEncodingException e) { // if file type is not supported\n\t\t\tString msg = \"File Not Supported\";\n\t\t\tJOptionPane.showMessageDialog(null, msg, \"Invalid File\", JOptionPane.ERROR_MESSAGE);\n\t\t} catch (FileNotFoundException e) { // if file is not found\n\t\t\tString msg = \"File Not Found\";\n\t\t\tJOptionPane.showMessageDialog(null, msg, \"Invalid File\", JOptionPane.ERROR_MESSAGE);\n\t\t}\n\n\t\tcurrencyCombo.removeAllItems(); // once the values are added into the array, remove all the content of combobox\n\n\t\tfor (int j = 0; j < currency_a.length; j++) {\n\n\t\t\t// overrides the previous values in the array with new ones from the file\n\t\t\tcurrencyName[j] = currency_a[j];\n\t\t\tsymbol[j] = symbol_a[j];\n\t\t\tfactor[j] = rate_a[j];\n\t\t\tif (currencyName[j]!=null && symbol[j]!=null && factor[j] != null) {\n\t\t\t\tcurrencyCombo.addItem(currency_a[j]);// adds new currency name into currency combo read from files\n\t\t\t}else {\n\t\t\t\tcurrencyCombo.addItem(\"Invalid\");\n\t\t\t}\n\t\t}\n\t}", "void readProducts(String filename) throws FileNotFoundException {\n\t\t//reads the file, computes the number of rows in the file\n\t\tScanner input=new Scanner(new File(filename));\n\t\tint numOfRow=0;\n\t\twhile(input.hasNextLine()) {\n\t\t\tnumOfRow++;\n\t\t\tinput.nextLine();\n\t\t}\n\t\t//load the products array one by one, using constructor\n\t\tproducts=new Product[numOfRow-1];\n\t\tScanner input2=new Scanner(new File(filename));\n\t\tinput2.nextLine();\n\t\tint i=0;\n\t\twhile(input2.hasNextLine()) {\n\t\t\tString row=input2.nextLine();\n\t\t\tString[] split1=row.split(((char)34+\",\"+(char)34));\n\t\t\tproducts[i++]=new Product(split1[0].substring(1, split1[0].length())\n\t\t\t\t\t, split1[1], split1[4], split1[7].substring(0, split1[7].length()-1));\n\t\t}\n\t\t//close the input\n\t\tinput.close();\n\t\tinput2.close();\n\t}", "public void reestablecerFullStock() { \n bodega Bodega = new bodega();\n Bodega.setProductosList(this.bodegaDefault());\n }", "public static void main(String[] args) throws IOException, ClassNotFoundException {\n FileInputStream fis =new FileInputStream(\"test.txt\");\n BufferedInputStream bis=new BufferedInputStream(fis);\n ObjectInputStream ois=new ObjectInputStream(bis);\n ArrayList<Goods> list = (ArrayList<Goods>)ois.readObject();\n for (int i = 0; i < list.size(); i++) {\n Goods goods = list.get(i);\n System.out.println(goods);\n }\n\n // Goods goods= (Goods)ois.readObject();\n // System.out.println(goods);\n ois.close();\n\n }", "public void readFolder(String path,Date currentTime) {\n\t\t \r\n\t\t String files;\r\n\t\t File folder = new File(path);\r\n\t\t File[] listOfFiles = folder.listFiles(); \r\n\t\t if(size < listOfFiles.length) {\r\n\t\t\t System.out.println(\" New files ready\");\r\n\t\t for (int i = 0; i < listOfFiles.length; i++) {\r\n\t\t \t\t if (listOfFiles[i].isFile()) \t {\t\r\n\t\t \t\t\t if(!filecollector.containsKey(listOfFiles[i].getName())) {\r\n\t\t \t\t\t System.out.println( listOfFiles[i].getPath() );\r\n\t\t \t\t\t DealBean bean = null;//(DealBean) CSVFileHandler.read(listOfFiles[i].getPath() ,new HelperDealBean());\r\n\t\t \t\t\t System.out.println(\" bean \"+bean);\r\n\t\t \t\t\t Trade trade = dealSender.buildTrade(bean);\r\n\t\t \t\t \t try {\r\n\t\t\t\t\t\t\tint tradeid = remoteTrade.saveTrade(trade);\r\n\t\t\t\t\t\t} catch (RemoteException e) {\r\n\t\t\t\t\t\t\t// TODO Auto-generated catch block\r\n\t\t\t\t\t\t\te.printStackTrace();\r\n\t\t\t\t\t\t}\r\n\t\t \t\t\t\tfilecollector.put(listOfFiles[i].getName(),bean);\r\n\t\t \t\t\t\tif(size == 0) {\r\n\t\t \t\t\t\t model.insertRow(i, new Object[]{bean.getMember(),bean.getDEALERname(), bean.getMarket(), bean.getSubMarket(),bean.getOrderNumber(),bean.getTradeDate(), bean.getTradeTime(), bean.getTradeNumber(), bean.getTradeType(),bean.getSettlementType(),bean.getSettlement(), bean.getDate(), bean.getISIN(), bean.getGenspec(),bean.getSecurity(),bean.getMaturityDate(), bean.getAmount(), bean.getFV(), bean.getTradePrice(),bean.getTradeYield(),bean.getTradeAmount(),bean.getLastInterest(),bean.getPaymentDate()});\r\n\t\t \t\t\t\t}else {\r\n\t\t \t\t\t\t\tTableModel mo = jTable1.getModel();\r\n\t\t \t\t\t\t\tmodel.insertRow(mo.getRowCount(),new Object[]{bean.getMember(),bean.getDEALERname(), bean.getMarket(), bean.getSubMarket(),bean.getOrderNumber(),bean.getTradeDate(), bean.getTradeTime(), bean.getTradeNumber(), bean.getTradeType(),bean.getSettlementType(),bean.getSettlement(), bean.getDate(), bean.getISIN(), bean.getGenspec(),bean.getSecurity(),bean.getMaturityDate(), bean.getAmount(), bean.getFV(), bean.getTradePrice(),bean.getTradeYield(),bean.getTradeAmount(),bean.getLastInterest(),bean.getPaymentDate()});\r\n\t\t \t\t\t\t}\r\n\t\t \t\t\t\t}\r\n\t\t \t\t }\r\n\t\t \t}\r\n\t\t \r\n\t\t }\r\n\t\t size = listOfFiles.length;\r\n\t}", "public static void main(String[] args) throws IOException, ClassNotFoundException {\n\n //Test library merge and append\n File file1 = new File(\"C:/pandyDS/SpecA.mgf\");\n File file2 = new File(\"C:/pandyDS/SpecA_converted.msp\");\n SpectraReader rd = new MgfReader(file1);\n SpectraWriter wr = new MspWriter(file2);\n \n ArrayList<Spectrum> spectraAll;\n spectraAll=rd.readAll();\n for(Spectrum s:spectraAll){\n wr.write(s);\n }\n \n // File file3 = new File(\"C:/pandyDS/testfile3.msp\");\n // MergeLibrary mrg = new MergeLibrary(file1, file2, file3);\n // mrg.Start();\n\n //AppendLibrary appnd=new AppendLibrary(file1, file2);\n //appnd.Append();\n// File file=new File(\"C:/pandyDS/testfile.mgf\");\n// File decoyFile = new File(\"C:/pandyDS/testfile_decoy\" + \".mgf\");\n// BufferedWriter bw=null;\n// \n// Indexer gi;\n// try {\n// gi = new Indexer(file);\n// \n// List<IndexKey> indxList=gi.generate();\n// \n// \n// SpectraReader rd = new MgfReader(file, indxList);\n// SpectraWriter wr = new MgfWriter(decoyFile);\n//\n// bw = new BufferedWriter(new FileWriter(decoyFile));\n// Spectrum spectrum;\n// for (IndexKey indx : indxList) {\n// Long pos = indx.getPos();\n// spectrum = rd.readAt(pos);\n// wr.write(spectrum, bw);\n// }\n//\n// \n// } catch (IOException ex) {\n// Logger.getLogger(MspWriter.class.getName()).log(Level.SEVERE, null, ex);\n// }finally {\n// try {\n// bw.close();\n// } catch (IOException ex) {\n// Logger.getLogger(MspWriter.class.getName()).log(Level.SEVERE, null, ex);\n// }\n// }\n// \n// \n// \n// File specfile = new File(\"C:/pandyDS/MSMSpos20_6.mzML\");// human_hcd_selected.msp// MSMSpos20_6.mzML//AdLungCD4_Medium.mgf\n// File opfile = new File(\"C:/pandyDS/AdLungCD4_Medium.mgf\");\n//\n//// if (specfile.getName().endsWith(\"mzML\")) {\n////\n//// MzmlReader reader = new MzmlReader(specfile);\n//// ArrayList<Spectrum> spec = reader.readAll();\n//// System.out.println(\"reading finished\" + spec.toString());\n////\n//// }\n//\n// String indxfilename = specfile.getName().substring(0, specfile.getName().lastIndexOf(\".\"));\n// File indxfile = new File(specfile.getParent(), indxfilename + \".idx\");\n//\n// double pcm = 1298.5546875;//584.8876; //;\n// double error = 0.03;\n//\n// List<Spectrum> spectra = null;\n// List<IndexKey> indxList;\n//\n// if (indxfile.exists()) {\n//\n// Indexer indxer = new Indexer();\n// indxList = indxer.readFromFile(indxfile);\n//\n// } else {\n//\n// Indexer gi = new Indexer(specfile);\n// indxList = gi.generate();\n// Collections.sort(indxList);\n//\n// }\n//\n// SpectraReader rd = null;\n// SpectraWriter wr = null;\n// if (specfile.getName().endsWith(\"mgf\")) {\n// rd = new MgfReader(specfile, indxList);\n// wr = new MspWriter(opfile, spectra);\n//\n// } else if (specfile.getName().endsWith(\"msp\")) {\n// rd = new MspReader(specfile, indxList);\n// wr = new MspWriter(opfile, spectra);\n//\n// }\n//\n// if (rd != null) {\n// spectra = rd.readPart(pcm, error);\n// wr.write();\n// }\n }", "public Interface(String filename) throws FileNotFoundException \n {\n //read file for first time to find size of array\n File f = new File(filename);\n Scanner b = new Scanner(f);\n\n while(b.hasNextLine())\n {\n b.nextLine();\n arraySize++;\n }\n //create properly sized array\n array= new double[arraySize];\n //open and close the file, scanner class does not support rewinding\n b.close();\n b = new Scanner(f);\n //read input \n for(int i = 0; i < arraySize; i++)\n { \n array[i] = b.nextDouble();\n }\n //create a stats object of the proper size\n a = new Stats(arraySize);\n a.loadNums(array); //pass entire array to loadNums to allow Stats object a to have a pointer to the array\n }", "public void load(String fileName) throws Exception {\n\t\tTolvenLogger.info(\"Uploading Lab Orders list from: \" + fileName, LoadLabOrder.class);\n BufferedReader reader;\n reader = new BufferedReader(new InputStreamReader(new FileInputStream( new File(fileName)),\"ISO-8859-1\"));\n String record;\n String fields[];\n int rowCount = 0;\n while (reader.ready()) {\n rowCount++;\n record = reader.readLine();\n // Might break out early if requested\n if (rowCount > getIterationLimit()) {\n \t\tTolvenLogger.info( \"Upload stopped early due to \" + UPLOAD_LIMIT + \" property being set\", LoadLabOrder.class);\n \tbreak;\n }\n // Skip the heading line\n if (rowCount==1) continue;\n fields = record.split(\"\\\\t\",13);\n\t\t \tStringWriter bos = new StringWriter();\n\t\t\tXMLOutputFactory factory = XMLOutputFactory.newInstance();\n\t\t\tXMLStreamWriter writer = factory.createXMLStreamWriter(bos);\n\t\t\twriter.writeStartDocument(\"ISO-8859-1\", \"1.0\" );\n\t\t\tgenerateTrim( fields, writer );\n\t\t\twriter.writeEndDocument();\n//\t\t\twriter.flush();\n\t\t\twriter.close();\n\t\t\tbos.close();\n\t\t\t/*String trimName = */generateName(fields);\n\t\t\t//TolvenLogger.info(\"Lab Order Trim: \" + bos.toString(), LoadLabOrder.class);\n\t\t\tcreateTrimHeader(bos.toString());\n\t\t\t/*\n\t\t\ttrims.add(bos.toString());\n\t\t\tif (trims.size() >= BATCH_SIZE ) {\n\t\t\t\tTolvenLogger.info( \"Load batch\", LoadLabOrder.class );\n\t\t\t\tgetTrimBean().createTrimHeaders(trims.toArray(new String[0]), null, \"LoadLabOrders\", true);\n\t\t\t\ttrims.clear();\n\t\t\t}\n\t\t\t*/\t\t\t\n }\n /*\n // Send unfinished batch, if any.\n\t\tif (trims.size() > 0 ) {\n\t\t\tgetTrimBean().createTrimHeaders(trims.toArray(new String[0]), null, \"LoadLabOrders\", true);\n\t\t}\n\t\t*/\n\t\tTolvenLogger.info( \"Count of Lab Orders uploaded: \" + (rowCount-1), LoadLabOrder.class);\n\t\tTolvenLogger.info( \"Activating headers... \", LoadLabOrder.class);\n\t\t// getTrimBean().queueActivateNewTrimHeaders();\n\t\tactivate(); \n\t}", "@Override\r\n\tpublic void updateSoftDrinkRecord(int sId) {\n\t\ttry {\r\n\t\t\tfis = new FileInputStream(original2);\r\n\t\t\tois = new ObjectInputStream(fis);\r\n\t\t\tfos = new FileOutputStream(tempFile2);\r\n\t\t\toos = new ObjectOutputStream(fos);\r\n\t\t\r\n\t\tList<SoftDrinkBean>updateList=new ArrayList<SoftDrinkBean>();\r\n\t\t\r\n\t\t\tupdateList=(List<SoftDrinkBean>)ois.readObject();\r\n\t\t\tfor(SoftDrinkBean s:updateList){\r\n\t\t\t\tif(s.getsId()==sId){\r\n\t\t\t\t\tSystem.out\r\n\t\t\t\t\t.println(\"select \\n1.pname \\n2.pprice\\n3.pqty you want to update\");\r\n\t\t\tint n = sc.nextInt();\r\n\t\t\tswitch (n) {\r\n\t\t\tcase 1:\r\n\t\t\t\tSystem.out.println(\"Enter new drink name\");\r\n\t\t\t\ts.setsName(sc.next());\r\n\t\t\t\tbreak;\r\n\t\t\tcase 2:\r\n\t\t\t\tSystem.out.println(\"Enter new drink Price\");\r\n\t\t\t\ts.setsPrice(sc.nextDouble());\r\n\t\t\t\tbreak;\r\n\t\t\tcase 3:\r\n\t\t\t\tSystem.out.println(\"Enter new drink Quantity\");\r\n\t\t\t\ts.setSqty(sc.nextInt());\r\n\t\t\t\tbreak;\r\n\t\t\tdefault:\r\n\t\t\t\tSystem.out.println(\"choose between 1-3\");\r\n\t\t\t\tbreak;\r\n\t\t\t}\r\n\t\t\ttempList2 = new ArrayList<SoftDrinkBean>();\r\n\t\t\ttempList2.add(s);\r\n\t\t} else {\r\n\t\t\ttempList2.add(s);\r\n\t\t}\r\n\t\t\t\tfos=new FileOutputStream(tempFile2);\r\n\t\t\t\toos=new ObjectOutputStream(oos);\r\n\t\t\t\t\r\n\t\toos.writeObject(tempList2);\r\n\t\toriginal.delete();\r\n\t\ttempFile.renameTo(original);\r\n\t\t\t\t}\r\n\t\t\t\r\n\t\t} catch (IOException e) {\r\n\t\t\t// TODO Auto-generated catch block\r\n\t\t\te.printStackTrace();\r\n\t\t} catch (ClassNotFoundException e) {\r\n\t\t\t// TODO Auto-generated catch block\r\n\t\t\te.printStackTrace();\r\n\t\t}\r\nSystem.out.println(\"------------------SoftDrink Updated successfully------------\");\r\n\t}", "private static void tokenFiles() throws IOException\r\n\t{\r\n\t\tFileReader fr = new FileReader(filename);\r\n\t\tBufferedReader br1 = new BufferedReader(fr);\r\n\t\t\r\n\t\tDouble[] salaries = new Double[10];//array for salary\r\n\t\tInteger[] id = new Integer[10];//array for id\r\n\t\tInteger[] age = new Integer[10];//array for age\r\n\t\tString[] fName = new String[10];//array for first name\r\n\t\tString[] lName = new String[10];//array for last name\r\n\t\tString[] status = new String[10];//array for status\r\n\t\tDouble[] raises = new Double[10];//array for the raised salary\r\n\t\tString s1;//string for readLine of files\r\n\t\tint i = 0;//index for loop of arrays\r\n\t\t\r\n\t\tSystem.out.println(\"\\nWith a 2% raise\\n\");\r\n\t\t//while loop to convert to proper type\r\n\t\twhile ((s1 = br1.readLine())!=null && i<10)\r\n\t\t{\r\n\t\t\tStringTokenizer st = new StringTokenizer(s1);//create new obj tokenizer\r\n\t\t\tfName[i] = st.nextToken();\r\n\t\t\tlName[i] = st.nextToken();\r\n\t\t\tid[i] = Integer.parseInt(st.nextToken());\r\n\t\t\tage[i] = Integer.parseInt(st.nextToken());\t\t\t\t\r\n\t\t\tsalaries[i] = Double.parseDouble(st.nextToken());\r\n\t\t\tstatus[i] = st.nextToken();\r\n\t\t\t\r\n\t\t\tSystem.out.println(fName[i]+\" \"+ lName[i]+\" \"+ id[i]+\r\n\t\t\t\t\t\t\" \"+ age[i]+\" \"+salaries[i]+\" \"+status[i]);\t\r\n\t\t\t\r\n\t\t\traises[i]= (salaries[i]*.02) +salaries[i];//calculate new salaries\r\n\t\t\tSystem.out.println(\"Salary with raise: \" +raises[i]);//print raise amount\r\n\t\t\ti++;\r\n\t\t}//end while loop convert to proper type\r\n\t\tbr1.close();//close this buffered reader\r\n\t}", "private void saveInFile(final String fileName, ArrayList<Habit> habitArray) {\r\n try {\r\n FileOutputStream fos = openFileOutput(fileName, 0);\r\n BufferedWriter out = new BufferedWriter(new OutputStreamWriter(fos));\r\n Gson gson = new Gson();\r\n gson.toJson(habitArray, out);\r\n out.flush();\r\n\r\n fos.close();\r\n } catch (FileNotFoundException e) {\r\n // TODO Auto-generated catch block\r\n throw new RuntimeException();\r\n } catch (IOException e) {\r\n // TODO Auto-generated catch block\r\n throw new RuntimeException();\r\n }\r\n }", "public void saveCart() throws IOException {\n String fileName = userid + \"cart.txt\";\n File file=new File(fileName);\n if(file.exists())\n {\n FileOutputStream fos = new FileOutputStream(fileName);\n ObjectOutputStream oos = new ObjectOutputStream(fos);\n oos.writeObject(this.cartContents);\n oos.flush();\n oos.close();\n fos.close();\n }\n else{\n file.createNewFile();\n }\n }", "void setStockHeader(stockFilePT102.StockHeaderDocument.StockHeader stockHeader);", "void saveArray () {\r\n\r\n\t\tsaves[count][0] = txtNo.getText ();\r\n\t\tsaves[count][1] = txtName.getText ();\r\n\t\tsaves[count][2] = \"\" + cboMonth.getSelectedItem ();\r\n\t\tsaves[count][3] = \"\" + cboDay.getSelectedItem ();\r\n\t\tsaves[count][4] = \"\" + cboYear.getSelectedItem ();\r\n\t\tsaves[count][5] = txtDeposit.getText ();\r\n\t\tsaveFile ();\t//Save This Array to File.\r\n\t\tcount++;\r\n\t\r\n\t}", "public StockDownloader(String symbol, GregorianCalendar start, GregorianCalendar end){\n\n dates = new ArrayList<GregorianCalendar>();\n //opens = new ArrayList<Double>();\n //highs = new ArrayList<Double>();\n //lows = new ArrayList<Double>();\n //closes = new ArrayList<Double>();\n //volumes = new ArrayList<Integer>();\n adjCloses = new ArrayList<Double>();\n\n name = symbol;\n\n //http://real-chart.finance.yahoo.com/table.csv?s=FB&a=03&b=14&c=2015&d=03&e=14&f=2016&g=d&ignore=.csv\n String url = \"http://real-chart.finance.yahoo.com/table.csv?s=\"+symbol+\n \"&a=\"+end.get(Calendar.MONTH)+\n \"&b=\"+end.get(Calendar.DAY_OF_MONTH)+\n \"&c=\"+end.get(Calendar.YEAR)+\n \"&d=\"+start.get(Calendar.MONTH)+\n \"&e=\"+start.get(Calendar.DAY_OF_MONTH)+\n \"&f=\"+start.get(Calendar.YEAR)+\n \"&g=d&ignore=.csv\";\n\n // Error URL\n //http://real-chart.finance.yahoo.com/table.csv?s=FB&a=3&b=13&c=2016&d=3&e=13&f=2015&g=d&ignore=.csv\n\n //Good URL\n //http://real-chart.finance.yahoo.com/table.csv?s=FB&a=03&b=14&c=2015&d=03&e=14&f=2016&g=d&ignore=.csv\n\n try{\n URL yhoofin = new URL(url);\n //URL yhoofin = new URL(\"http://real-chart.finance.yahoo.com/table.csv?s=FB&a=03&b=14&c=2015&d=03&e=14&f=2016&g=d&ignore=.csv\");\n URLConnection data = yhoofin.openConnection();\n Scanner input = new Scanner(data.getInputStream());\n if(input.hasNext()){\n input.nextLine();//skip line, it's just the header\n\n //Start reading data\n while(input.hasNextLine()){\n String line = input.nextLine();\n String[] stockinfo = line.split(\",(?=(?:[^\\\"]*\\\"[^\\\"]*\\\")*[^\\\"]*$)\");\n //StockHelper sh = new StockHelper();\n dategetter.add(stockinfo[0]);\n adjCloses.add(handleDouble(stockinfo[ADJCLOSE]));\n }\n }\n\n //System.out.println(adjCloses);\n }\n catch(Exception e){\n System.err.println(e);\n }\n\n\n }", "private void readFromInternalStorage() {\n ArrayList<GeofenceObjects> returnlist = new ArrayList<>();\n if (!isExternalStorageReadable()) {\n System.out.println(\"not readable\");\n } else {\n returnlist = new ArrayList<>();\n try {\n FileInputStream fis = openFileInput(\"GeoFences\");\n ObjectInputStream ois = new ObjectInputStream(fis);\n returnlist = (ArrayList<GeofenceObjects>) ois.readObject();\n ois.close();\n System.out.println(returnlist);\n } catch (Exception e) {\n e.printStackTrace();\n }\n }\n currentList = returnlist;\n }", "public void load() \n throws IOException\n {\n mText = null;\n mTicks.clear();\n \n if (mLoadTicks && isAlreadyTicked()) {\n File tickFile = getTickFile(false);\n ZipFile zip = new ZipFile(tickFile);\n\n String basename = null;\n \n // Find ticked file name from ZIP\n Enumeration<? extends ZipEntry> entries = zip.entries();\n while (entries.hasMoreElements()) {\n ZipEntry entry = entries.nextElement();\n String name = entry.getName();\n int idx = name.indexOf(TickConstants.TICK_ENTRY_EXT);\n if (idx != -1) {\n basename = name.substring(0, idx); \n }\n }\n \n // file\n ZipEntry fileEntry = zip.getEntry(basename);\n byte[] data = FileUtil.load(zip.getInputStream(fileEntry));\n mText = new String(data, \"UTF-8\");\n\n // registry\n mRegistry = new TickRegistry();\n mRegistry.loadDefinitions();\n\n // ticks\n ZipEntry tickEntry = zip.getEntry(basename + TickConstants.TICK_ENTRY_EXT);\n mTicks.addAll(loadTicks(zip.getInputStream(tickEntry)));\n \n mBasename = basename;\n } else {\n byte[] data = FileUtil.load(mFile);\n mText = new String(data, \"UTF-8\");\n mBasename = mFile.getName();\n \n // registry\n mRegistry = new TickRegistry();\n mRegistry.loadDefinitions();\n }\n }", "static Stock getStock(String symbol) { \n\t\tString sym = symbol.toUpperCase();\n\t\tdouble price = 0.0;\n\t\tint volume = 0;\n\t\tdouble pe = 0.0;\n\t\tdouble eps = 0.0;\n\t\tdouble week52low = 0.0;\n\t\tdouble week52high = 0.0;\n\t\tdouble daylow = 0.0;\n\t\tdouble dayhigh = 0.0;\n\t\tdouble movingav50day = 0.0;\n\t\tdouble marketcap = 0.0;\n\t\n\t\ttry { \n\t\t\t\n\t\t\t// Retrieve CSV File\n\t\t\tURL yahoo = new URL(\"http://finance.yahoo.com/d/quotes.csv?s=\"+ symbol + \"&f=l1vr2ejkghm3j3\");\n\t\t\tURLConnection connection = yahoo.openConnection(); \n\t\t\tInputStreamReader is = new InputStreamReader(connection.getInputStream());\n\t\t\tBufferedReader br = new BufferedReader(is); \n\t\t\t\n\t\t\t// Parse CSV Into Array\n\t\t\tString line = br.readLine(); \n\t\t\tString[] stockinfo = line.split(\",\"); \n\t\t\t\n\t\t\t// Check Our Data\n\t\t\tif (Pattern.matches(\"N/A\", stockinfo[0])) { \n\t\t\t\tprice = 0.00; \n\t\t\t} else { \n\t\t\t\tprice = Double.parseDouble(stockinfo[0]); \n\t\t\t} \n\t\t\t\n\t\t\tif (Pattern.matches(\"N/A\", stockinfo[1])) { \n\t\t\t\tvolume = 0; \n\t\t\t} else { \n\t\t\t\tvolume = Integer.parseInt(stockinfo[1]); \n\t\t\t} \n\t \n\t\t\tif (Pattern.matches(\"N/A\", stockinfo[2])) { \n\t\t\t\tpe = 0; \n\t\t\t} else { \n\t\t\t\tpe = Double.parseDouble(stockinfo[2]); \n\t\t\t}\n \n\t\t\tif (Pattern.matches(\"N/A\", stockinfo[3])) { \n\t\t\t\teps = 0; \n\t\t\t} else { \n\t\t\t\teps = Double.parseDouble(stockinfo[3]); \n\t\t\t}\n\t\t\t \n\t\t\tif (Pattern.matches(\"N/A\", stockinfo[4])) { \n\t\t\t\tweek52low = 0; \n\t\t\t} else { \n\t\t\t\tweek52low = Double.parseDouble(stockinfo[4]); \n\t\t\t}\n\t\t\t \n\t\t\tif (Pattern.matches(\"N/A\", stockinfo[5])) { \n\t\t\t\tweek52high = 0; \n\t\t\t} else { \n\t\t\t\tweek52high = Double.parseDouble(stockinfo[5]); \n\t\t\t} \n\t\t\t\n\t\t\tif (Pattern.matches(\"N/A\", stockinfo[6])) { \n\t\t\t\tdaylow = 0; \n\t\t\t} else { \n\t\t\t\tdaylow = Double.parseDouble(stockinfo[6]); \n\t\t\t}\n\t\t\t\t \n\t\t\tif (Pattern.matches(\"N/A\", stockinfo[7])) { \n\t\t\t\tdayhigh = 0; \n\t\t\t} else { \n\t\t\t\tdayhigh = Double.parseDouble(stockinfo[7]); \n\t\t\t} \n\t\t\t\n\t\t\tif (Pattern.matches(\"N/A - N/A\", stockinfo[8])) { \n\t\t\t\tmovingav50day = 0; \n\t\t\t} else { \n\t\t\t\tmovingav50day = Double.parseDouble(stockinfo[8]); \n\t\t\t}\n\t\t\t\t \n\t\t\tif (Pattern.matches(\"N/A\", stockinfo[9])) { \n\t\t\t\tmarketcap = 0; \n\t\t\t} else { \n\t\t\t\tmarketcap = Double.parseDouble(stockinfo[9]); \n\t\t\t} \n\t\t\t\n\t\t} catch (IOException e) {\n\t\t\tLogger log = Logger.getLogger(StockHelper.class.getName()); \n\t\t\tlog.log(Level.SEVERE, e.toString(), e);\n\t\t\treturn null;\n\t\t}\n\t\t\n\t\treturn new Stock(sym, price, volume, pe, eps, week52low, week52high, daylow, dayhigh, movingav50day, marketcap);\n\t\t\n\t}", "public void load() {\n\t\n\t\tdataTable = new HashMap();\n\t\t\n\t\tArrayList musicArrayList = null;\n\t\tStringTokenizer st = null;\n\n\t\tMusicRecording myRecording;\n\t\tString line = \"\";\n\n\t\tString artist, title;\n\t\tString category, imageName;\n\t\tint numberOfTracks;\n\t\tint basePrice;\n\t\tdouble price;\n\n\t\tTrack[] trackList;\n\t\t\n\t\ttry\n\t\t{\n\t\t\tlog(\"Loading File: \" + FILE_NAME + \"...\");\n\t\t\tBufferedReader inputFromFile = new BufferedReader(new FileReader(FILE_NAME));\n\t\t\t\n\t\t\t// read until end-of-file\n\t\t\twhile ( (line = inputFromFile.readLine()) != null ) {\t\t\t\n\t\t\t\n\t\t\t\t// create a tokenizer for a comma delimited line\n\t\t\t\tst = new StringTokenizer(line, \",\");\n\t\t\n\t\t\t\t// Parse the info line to read following items formatted as\n\t\t\t\t// - the artist, title, category, imageName, number of tracks\n\t\t\t\t//\n\t\t\t\tartist = st.nextToken().trim();\n\t\t\t\ttitle = st.nextToken().trim();\n\t\t\t\tcategory = st.nextToken().trim();\n\t\t\t\timageName = st.nextToken().trim();\n\t\t\t\tnumberOfTracks = Integer.parseInt(st.nextToken().trim());\n\t\t\t\t\t\t\n\t\t\t\t// read all of the tracks in\n\t\t\t\ttrackList = readTracks(inputFromFile, numberOfTracks);\n\n\t\t\t\t// select a random price between 9.99 and 15.99\n\t\t\t\tbasePrice = 9 + (int) (Math.random() * 7);\n\t\t\t\tprice = basePrice + .99;\n\n\t\t\t\t// create the music recording\n\t\t\t\tmyRecording = new MusicRecording(artist, trackList, title, \n\t\t\t\t\t\t\t\t\t\t\t\t price, category, imageName);\n\n\t\t\t\t// check to see if we have information on this category\n\t\t\t\tif (dataTable.containsKey(category)) {\n\t\t\t\t\n\t\t\t\t\t// get the list of recordings for this category\n\t\t\t\t\tmusicArrayList = (ArrayList) dataTable.get(category); \t\t\t\t\t\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\n\t\t\t\t\t// this is a new category. simply add the category\n\t\t\t\t\t// to our dataTable\n\t\t\t\t\tmusicArrayList = new ArrayList();\n\t\t\t\t\tdataTable.put(category, musicArrayList);\t\t\t\t\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t// add the recording\n\t\t\t\tmusicArrayList.add(myRecording);\n\t\t\t\t\n\t\t\t\t// move ahead and consume the line separator\n\t\t\t\tline = inputFromFile.readLine();\n\t\t\t}\n\n\t\t\tinputFromFile.close();\n\t\t\tlog(\"File loaded successfully!\");\n\t\t\tlog(\"READY!\\n\");\n\n\t\t}\n\t\tcatch (FileNotFoundException exc) {\n\t\t\tlog(\"Could not find the file \\\"\" + FILE_NAME + \"\\\".\");\n\t\t\tlog(\"Make sure it is in the current directory.\");\n\t\t\tlog(\"========>>> PLEASE CONTACT THE INSTRUCTOR.\\n\\n\\n\");\n\t\t\tlog(exc);\n\t\t\t\n\t\t}\n\t\tcatch (IOException exc) {\n\t\t\tlog(\"IO error occurred while reading file: \" + FILE_NAME);\n\t\t\tlog(\"========>>> PLEASE CONTACT THE INSTRUCTOR.\\n\\n\\n\");\n\t\t\tlog(exc);\n\n\t\t}\n\t\n\t}", "String [][] importData (String path);", "public Stock() {\n\t\tsi = new SmallCouchImport();\n\t\tstockList.addAll(si.getStock());\n\t\tsi = new BigCouchImport();\n\t\tstockList.addAll(si.getStock());\n\t\tsi = new SmallTableImport();\n\t\tstockList.addAll(si.getStock());\n\t\tsi = new BigTableImport();\n\t\tstockList.addAll(si.getStock());\n\t}", "public static void init() {\n \n if(stock==null){\n stock=Analyser.stock;\n //for each stock, it price and the time\n// stoc\n// String[] listedCompanies = new NSELoader(20).getAllStocks();\n// \n// for (int i =0; i < listedCompanies.length; i++) {\n// \n// String stockName = listedCompanies[i];\n// float price = 0;\n// int time = 0;\n// ArrayList<String> value = new ArrayList<>();\n// String data = time + \":\" + price;// ':' is used as boundary token\n// value.add(data);\n// stock.put(stockName, value);\n// }\n \n\n }\n }", "public static ArrayList<Stue> getStueData() {\n ArrayList<Stue> fillArray = new ArrayList<>();\n\n try {\n File fileIn = new File(\"Stuedata.txt\");\n\n Scanner in = new Scanner(fileIn);\n\n while (in.hasNext()) {\n Stue stueData = new Stue();\n stueData.idRum = in.next();\n stueData.navn = in.next();\n stueData.motto = in.next();\n stueData.etage = in.next();\n fillArray.add(stueData);\n }\n in.close(); //WHYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYY?\n } catch (IOException i) {\n i.printStackTrace();\n System.exit(0);\n }\n return fillArray;\n }", "void loadSet() {\n int returnVal = fc.showOpenDialog(this);\n if (returnVal != JFileChooser.APPROVE_OPTION) {\n System.out.println(\"Open command cancelled by user.\");\n return;\n }\n file = fc.getSelectedFile();\n System.out.println(\"Opening: \" + file.getName());\n closeAllTabs();\n try {\n FileInputStream fis = new FileInputStream(file);\n ObjectInputStream ois = new ObjectInputStream(fis);\n //loopButton.setSelected( ois.readObject() ); \n ArrayList l = (ArrayList) ois.readObject();\n System.out.println(\"read \"+l.size()+\" thingies\");\n ois.close();\n for(int i=0; i<l.size(); i++) {\n HashMap m = (HashMap) l.get(i);\n openNewTab();\n getCurrentTab().paste(m);\n }\n } catch(Exception e) {\n System.out.println(\"Open error \"+e);\n }\n }", "private void read() {\n\n\t\t\t\tString road=getActivity().getFilesDir().getAbsolutePath()+\"product\"+\".txt\";\n\n\t\t\t\ttry {\n\t\t\t\t\tFile file = new File(road); \n\t\t\t\t\tFileInputStream fis = new FileInputStream(file); \n\t\t\t\t\tint length = fis.available(); \n\t\t\t\t\tbyte [] buffer = new byte[length]; \n\t\t\t\t\tfis.read(buffer); \n\t\t\t\t\tString res1 = EncodingUtils.getString(buffer, \"UTF-8\"); \n\t\t\t\t\tfis.close(); \n\t\t\t\t\tjson(res1.toString());\n\t\t\t\t} catch (IOException e) {\n\t\t\t\t\t// TODO Auto-generated catch block\n\t\t\t\t\te.printStackTrace();\n\t\t\t\t} \n\t\t\t}" ]
[ "0.6438847", "0.63521063", "0.6259513", "0.59671146", "0.5888103", "0.5841219", "0.5794338", "0.57876986", "0.578253", "0.57803273", "0.57443494", "0.57297677", "0.56962836", "0.5631419", "0.55981535", "0.55885583", "0.554936", "0.5527662", "0.5504943", "0.5502357", "0.5496974", "0.5423028", "0.5412291", "0.54109377", "0.5376292", "0.5365701", "0.53089917", "0.52919185", "0.52860713", "0.5285257", "0.52722496", "0.52679026", "0.525485", "0.52540934", "0.52515256", "0.5249843", "0.52394986", "0.52264214", "0.5220077", "0.52013", "0.51850253", "0.51773", "0.51721376", "0.5170519", "0.5151152", "0.514546", "0.51426876", "0.5140369", "0.5139832", "0.5132982", "0.51303756", "0.5129803", "0.51217955", "0.5115805", "0.5108631", "0.51069534", "0.5106199", "0.51061696", "0.5102753", "0.5102513", "0.51008373", "0.5100329", "0.5098912", "0.50960785", "0.50893605", "0.50870794", "0.5076203", "0.507562", "0.50732076", "0.5067451", "0.5060303", "0.5049275", "0.5039819", "0.5038341", "0.5027837", "0.5019122", "0.50116396", "0.5010747", "0.5005491", "0.50016713", "0.49991882", "0.49979421", "0.49844158", "0.49744108", "0.49724928", "0.49693328", "0.49673063", "0.4965592", "0.49640948", "0.496184", "0.49581566", "0.49490857", "0.49475887", "0.49464548", "0.4945804", "0.4936577", "0.4935013", "0.49325433", "0.49323267", "0.49219388" ]
0.7023637
0
Make sure mcmmo is installed.
public Construct exec(Target t, Environment environment, Construct... args) throws ConfigRuntimeException { Static.checkPlugin("mcMMO", t); String name; BukkitMCPlayer player = null; // Get user if online. try { if (args.length == 1) { player = (BukkitMCPlayer) Static.GetPlayer(args[0], t); } else { player = (BukkitMCPlayer) environment.getEnv(CommandHelperEnvironment.class).GetPlayer(); } name = player.getName(); } catch (ConfigRuntimeException e) { if (args.length == 0) { throw new CREInsufficientArgumentsException("You need to specify a player.", t); } // Player is offline, we'll use the given string name later. name = args[0].val(); } CArray skills = new CArray(t); int power; if (player != null) { power = ExperienceAPI.getPowerLevel(player._Player()); } else { try { power = ExperienceAPI.getPowerLevelOffline(name); } catch (InvalidPlayerException e) { throw new CRENotFoundException("Unknown McMMO player, " + name, t); } } // Accumulate skills into the skill map. for (SkillType skillname : SkillType.values()) { int level; if (player != null) { level = ExperienceAPI.getLevel(player._Player(), skillname.name()); } else { try { level = ExperienceAPI.getLevelOffline(name, skillname.toString()); } catch (InvalidPlayerException e) { throw new CRENotFoundException("Unknown McMMO player, " + name, t); } } CString skill = new CString(skillname.name(), t); CInt value = new CInt(level, t); skills.set(skill, value, t); } skills.set("POWER", new CInt(power, t), t); return skills; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "protected void validateMcaDeployedToWorkingDir() {\n\t\tassertTrue(unitTestDir.exists());\n\t\tassertTrue(new File(unitTestDir, \"composition.groovy\").exists());\n\t\tassertTrue(new File(unitTestDir, \"MCA-INF/components/components.jar\").exists());\n\t\tassertTrue(new File(unitTestDir, \"MCA-INF/promoted/promoted.jar\").exists());\n\t\tassertTrue(new File(unitTestDir, \"MCA-INF/hidden/hidden.jar\").exists());\n\t}", "public void ensureM2EcipseBeingInited()\r\n\t\t\tthrows Exception {\r\n\t\t// TODO: disable this because Maven is not available in V3. Working on solutions later.\r\n\t\t// maybe we can put it in Repo system.\r\n//\t\tBundleContext context = MavenPlugin.getDefault().getBundleContext();\r\n//\t\tMavenPlugin.getDefault().start(context);\r\n//\t\tint state = MavenPlugin.getDefault().getBundle().getState();\r\n//\t\t\r\n//\t\twhile(state != Bundle.ACTIVE) {\r\n//\t\t\tSystem.out.println(\"M2 Eclipse still not started. Sleeping and trying again.\");\r\n//\t\t\tThread.sleep(5000L);\r\n//\t\t\tstate = MavenPlugin.getDefault().getBundle().getState();\r\n//\t\t}\r\n\t}", "public static boolean isInstalled()\n\t{\n\t\treturn PackageUtils.exists(General.PKG_MESSENGERAPI);\n\t}", "@Override\n public void isPmrInstalledAt() throws IOException {\n assumeTrue( !isWindows() );\n super.isPmrInstalledAt();\n }", "public void testGetProperty()\n {\n assertEquals(\"MSM Extension not present, or incorrect specification version -\", MSM_SPECIFICATION_VERSION,\n System.getProperty(MSM_PROPERTY_NAME));\n }", "public final void mM() throws RecognitionException {\n try {\n // /Users/devdatta.kulkarni/Documents/Cassandra/apache-cassandra-0.8.6-src/src/java/org/apache/cassandra/cql/Cql.g:539:11: ( ( 'm' | 'M' ) )\n // /Users/devdatta.kulkarni/Documents/Cassandra/apache-cassandra-0.8.6-src/src/java/org/apache/cassandra/cql/Cql.g:539:13: ( 'm' | 'M' )\n {\n if ( input.LA(1)=='M'||input.LA(1)=='m' ) {\n input.consume();\n\n }\n else {\n MismatchedSetException mse = new MismatchedSetException(null,input);\n recover(mse);\n throw mse;}\n\n\n }\n\n }\n finally {\n }\n }", "private void setupAllMafiosis()\n {\n }", "boolean runNpmInstall();", "public static boolean isMmsCapable(Context context) {\n\t\tTelephonyManager telephonyManager = (TelephonyManager) context\n\t\t\t\t.getSystemService(Context.TELEPHONY_SERVICE);\n\t\tif (telephonyManager == null) {\n\t\t\treturn false;\n\t\t}\n\n\t\ttry {\n\t\t\tClass<?> partypes[] = new Class[0];\n\t\t\tMethod sIsVoiceCapable = TelephonyManager.class.getMethod(\n\t\t\t\t\t\"isVoiceCapable\", partypes);\n\n\t\t\tObject arglist[] = new Object[0];\n\t\t\tObject retobj = sIsVoiceCapable.invoke(telephonyManager, arglist);\n\t\t\treturn (Boolean) retobj;\n\t\t} catch (java.lang.reflect.InvocationTargetException ite) {\n\t\t\t// Failure, must be another device.\n\t\t\t// Assume that it is voice capable.\n\t\t} catch (IllegalAccessException iae) {\n\t\t\t// Failure, must be an other device.\n\t\t\t// Assume that it is voice capable.\n\t\t} catch (NoSuchMethodException nsme) {\n\t\t}\n\t\treturn true;\n\t}", "public final void mM() throws RecognitionException {\n try {\n // /Users/cbinnig/Workspace/DHBW_FirstDB_Loesung3/src/de/dhbw/db2/firstdb/sql/FirstSQL.g:406:11: ( ( 'm' | 'M' ) )\n // /Users/cbinnig/Workspace/DHBW_FirstDB_Loesung3/src/de/dhbw/db2/firstdb/sql/FirstSQL.g:406:12: ( 'm' | 'M' )\n {\n if ( input.LA(1)=='M'||input.LA(1)=='m' ) {\n input.consume();\n\n }\n else {\n MismatchedSetException mse = new MismatchedSetException(null,input);\n recover(mse);\n throw mse;}\n\n\n }\n\n }\n finally {\n }\n }", "@Test\n public void testInstallZeroLength() {\n assertEquals(ImmutableSet.of(\"\"), dependencyManager.install(\"\"));\n assertEquals(ImmutableSet.of(\"\"), dependencyManager.list());\n }", "public void verificarMensagem(String m){\r\n\t\tboolean verificaM =\tmensagem.getText().equals(m);\r\n\t\tAssert.assertTrue(verificaM);\r\n\t\tlogPrint(\"Mensagem apareceu\");\r\n\t}", "public void setXMTM(java.lang.String XMTM) {\r\n this.XMTM = XMTM;\r\n }", "public boolean checkAvailability(Media media) {\n\t\t return false;\n\t }", "@Test\n public void testMCMCWithoutAllelicPoN() {\n final double meanBiasSimulated = 1.2;\n final double biasVarianceSimulated = 0.04;\n testMCMC(meanBiasSimulated, biasVarianceSimulated, meanBiasSimulated, biasVarianceSimulated, AllelicPanelOfNormals.EMPTY_PON);\n }", "public void testGetUMLModelManager() {\n assertSame(\"Failed to get the UMLModelManager.\", manager, instance.getUMLModelManager());\n }", "@Test\n public void testMMI() {\n System.out.println(\"MMI\");\n int a = 0;\n int m = 0;\n int expResult = 0;\n int result = utilsHill.MMI(a, m);\n assertEquals(expResult, result);\n // TODO review the generated test code and remove the default call to fail.\n fail(\"The test case is a prototype.\");\n }", "public boolean hasMcc() {\n return genClient.cacheHasKey(CacheKey.mcc);\n }", "public HelloMIDlet() {\n }", "private void assertLcphMKInstalled(boolean expectedInstalled) throws IOException {\n assertEquals(expectedInstalled, new File(addonSceneryPath, TestData.lcphMKRevision.getRepoPath() + \"/scenery/000_LCPH_FSX.BGL\").exists());\r\n assertEquals(expectedInstalled, new File(addonSceneryPath, TestData.lcphMKRevision.getRepoPath() + \"/scenery/LCPH_ADEX_XX.BGL\").exists());\r\n assertEquals(expectedInstalled, new File(addonSceneryPath, TestData.lcphMKRevision.getRepoPath() + \"/scenery/14_LCPH_lines.bgl\").exists());\r\n if (expectedInstalled) {\r\n assertEquals(868384, new File(addonSceneryPath, TestData.lcphMKRevision.getRepoPath() + \"/scenery/14_LCPH_lines.bgl\").length());\r\n }\r\n assertEquals(expectedInstalled, new File(addonSceneryPath, TestData.lcphMKRevision.getRepoPath() + \"/texture/c172_r.bmp\").exists());\r\n assertEquals(expectedInstalled, new File(fsxRoot + \"/Effects\", \"Cntrl_LCPH_TaxiGreen.fx\").exists());\r\n assertEquals(expectedInstalled, new File(fsxRoot + \"/Effects\", \"fx_LCPH_TaxiGreen.fx\").exists());\r\n\r\n assertEquals(expectedInstalled, testSceneryJson(TestData.lcphMK.getId()));\r\n\r\n assertEquals(expectedInstalled, testSceneryCfg(\"Addon Scenery\\\\LCPH_MaxKraus\"));\r\n }", "private void installArtifacts(ApplicationDescription desc) throws IOException {\n try {\n Tools.copyDirectory(appFile(desc.name(), M2_PREFIX), m2Dir);\n } catch (NoSuchFileException e) {\n log.debug(\"Application {} has no M2 artifacts\", desc.name());\n }\n }", "static void allowAccess(ClassMaker cm) {\n var thisModule = CoreUtils.class.getModule();\n var thatModule = cm.classLoader().getUnnamedModule();\n thisModule.addExports(\"org.cojen.dirmi.core\", thatModule);\n }", "public boolean checkSetup(){\n return checkSetup(folderName);\n }", "public static synchronized void init(Context context, MMXClientConfig config) {\n if (sInstance == null) {\n Log.i(TAG, \"App=\"+context.getPackageName()+\", MMX SDK=\"+BuildConfig.VERSION_NAME+\n \", protocol=\"+Constants.MMX_VERSION_MAJOR+\".\"+Constants.MMX_VERSION_MINOR);\n sInstance = new MMX(context, config);\n } else {\n Log.w(TAG, \"MMX.init(): MMX has already been initialized. Ignoring this call.\");\n }\n MMXClient.registerWakeupListener(context, MMX.MMXWakeupListener.class);\n }", "public void initialize() throws MMDeviceException;", "public void testNullMailet() throws MessagingException {\n setupMockedMail(mockedMimeMessage);\n setupMailet();\n\n mailet.service(mockedMail);\n\n String PROCESSOR = \"ghost\";\n assertEquals(PROCESSOR, mockedMail.getState());\n }", "void installIfNeeded()\n throws Exception;", "public void setMCAservice(java.lang.String MCAservice) {\n this.MCAservice = MCAservice;\n }", "@Before\n public void setUp() throws Exception {\n fs = new MockFileSystem();\n mv = new Mv(fs);\n io = new IO();\n }", "@Override\n\tprotected void checkHardware() {\n\t\tsuper.checkHardware();\n\t}", "public void setCMNservice(java.lang.String CMNservice) {\n this.CMNservice = CMNservice;\n }", "public boolean checkForMASCFailure(MovePath md, Vector<Report> vDesc, HashMap<Integer, CriticalSlot> vCriticals) {\n if (md.hasActiveMASC()) {\n boolean bFailure = false;\n\n // If usedMASC is already set, then we've already checked MASC\n // this turn. If we succeded before, return false.\n // If we failed before, the MASC was destroyed, and we wouldn't\n // have gotten here (hasActiveMASC would return false)\n if (!usedMASC) {\n Mounted masc = getMASC();\n Mounted superCharger = getSuperCharger();\n bFailure = doMASCCheckFor(masc, vDesc, vCriticals);\n boolean bSuperChargeFailure = doMASCCheckFor(superCharger, vDesc, vCriticals);\n return bFailure || bSuperChargeFailure;\n }\n }\n return false;\n }", "private void setMM(int MM) {\n\t\tCMN.MM = MM;\n\t}", "boolean isInstalled();", "public void add(Monom m)\r\n\t{\r\n\t\tif(this._power==m._power)\r\n\t\t{\r\n\t\t\tthis._coefficient+=m._coefficient;\r\n\t\t}\r\n\t\telse\r\n\t\t{\r\n\t\t\tthrow new RuntimeException(\"Cant add Monoms with Different Powers\");\r\n\t\t}\r\n\t}", "public void registerWithRMC()\n\t{\n\t\t// Register with the RMC\n\t\tif(this.rmc.registerLMS(this.location)) {\n\t\t\tthis.log(\"Registered with RMC\");\n\t\t\treturn;\n\t\t}\n\t\t\n\t\tthis.log(\"Failed to register with RMC. Probable name clash.\");\n\t\tSystem.exit(1);\n\t}", "public void testGetManagementSpecVersion() {\n String specVersion = mb.getManagementSpecVersion();\n assertNotNull(specVersion);\n assertTrue(specVersion.length() > 0);\n }", "public static void mmcc() {\n\t}", "protected void install() {\n\t\t//\n\t}", "@Override\n\tprotected void setUp() {\n\t\ttry {\n\t\t\tconsole = new MMAConsole();\n\t\t} catch (Exception e) {\n\t\t\te.printStackTrace();\n\t\t}\n\n\t}", "public static int initProperties() {\n\n\t\t// creating a new conf file if none exists yet\n\t\tPathHelper ph = new PathHelper();\n\t\ttry {\n\t\t\thomeFolder = ph.getMarabouHomeFolder();\n\t\t\tconf = new File(ph.getMarabouHomeFolder() + \"marabou.properties\");\n\t\t} catch (UnknowPlatformException e1) {\n\t\t\tlog.severe(\"Your OS couldn't get detected properly.\\n\"\n\t\t\t\t\t+ \"Please file a bugreport.\");\n\t\t\treturn 1;\n\t\t}\n\t\t// if config is found, check if updates are needed\n\t\tif (conf.exists()) {\n\t\t\tif (!conf.canRead() || !conf.canWrite()) {\n\t\t\t\tlog.severe(\"Couldn't read or write config file.\"\n\t\t\t\t\t\t+ \" Please make sure that your file permissions are set properly.\");\n\t\t\t\treturn 1;\n\t\t\t\t// config is existens and accessable\n\t\t\t} else {\n\t\t\t\ttry {\n\t\t\t\t\tproperties.load(new FileReader(conf.getAbsolutePath()));\n\t\t\t\t} catch (FileNotFoundException e) {\n\n\t\t\t\t\tlog.severe(\"Couldn't find user's config file in path: \"\n\t\t\t\t\t\t\t+ conf.getAbsolutePath());\n\n\t\t\t\t\treturn 1;\n\t\t\t\t} catch (IOException e) {\n\t\t\t\t\tlog.severe(\"Couldn't load config file: \"\n\t\t\t\t\t\t\t+ conf.getAbsolutePath());\n\t\t\t\t\treturn 1;\n\t\t\t\t}\n\t\t\t\tProperties vendorProp = new Properties();\n\n\t\t\t\t// TODO RELEASE replace path with method call of PathHelper (for\n\t\t\t\t// specific OS)\n\n\t\t\t\ttry {\n\t\t\t\t\tvendorProp.load(new FileReader(\n\t\t\t\t\t\t\t\"src/main/resources/marabou.properties\"));\n\t\t\t\t} catch (FileNotFoundException e) {\n\t\t\t\t\tlog.severe(\"Couldn't find vendor config.\");\n\t\t\t\t\treturn 1;\n\t\t\t\t} catch (IOException e) {\n\t\t\t\t\tlog.severe(\"Couldn't open vendor config.\");\n\t\t\t\t\treturn 1;\n\t\t\t\t}\n\t\t\t\t// if the user's conf is older than the current marabou version,\n\t\t\t\t// update the missing entries\n\t\t\t\tif (properties.getProperty(\"version\").compareTo(\n\t\t\t\t\t\tvendorProp.getProperty(\"version\")) < 0) {\n\t\t\t\t\tSet<Object> vendorKeys = vendorProp.keySet();\n\t\t\t\t\tSet<Object> userKeys = properties.keySet();\n\n\t\t\t\t\t// set the latest version in users conf\n\t\t\t\t\tproperties.setProperty(\"version\",\n\t\t\t\t\t\t\tvendorProp.getProperty(\"version\"));\n\n\t\t\t\t\t// copy missing new key/value pairs\n\t\t\t\t\tfor (Object key : vendorKeys) {\n\t\t\t\t\t\tif (!userKeys.contains(key)) {\n\t\t\t\t\t\t\tproperties.put(key, vendorProp.get(key));\n\t\t\t\t\t\t}\n\n\t\t\t\t\t}\n\t\t\t\t\tpersistSettings();\n\t\t\t\t}\n\t\t\t}\n\t\t\t// conf is not existent yet\n\t\t} else {\n\t\t\ttry {\n\t\t\t\tFile mhfFile = new File(homeFolder);\n\t\t\t\t// create foler if no folder exists yet\n\t\t\t\tif (!mhfFile.exists()) {\n\t\t\t\t\tif (!mhfFile.mkdir()) {\n\t\t\t\t\t\tlog.severe(\"Couldn't create marabou folder in your home.\\n\"\n\t\t\t\t\t\t\t\t+ \"Please file a bugreport.\");\n\t\t\t\t\t\treturn 1;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t// create marabou.properties file in new folder\n\t\t\t\tconf.createNewFile();\n\t\t\t} catch (IOException e) {\n\t\t\t\tlog.severe(\"Couldn't create config file, please check your file permission in your home folder.\");\n\t\t\t\treturn 1;\n\t\t\t}\n\t\t\ttry {\n\n\t\t\t\t// TODO RELEASE replace path with method call of PathHelper (for\n\t\t\t\t// specific OS)\n\t\t\t\tBufferedReader vendorConf = new BufferedReader(new FileReader(\n\t\t\t\t\t\t\"src/main/resources/marabou.properties\"));\n\n\t\t\t\tproperties.load(vendorConf);\n\t\t\t\t// copy all entries to the new conf\n\t\t\t\tpersistSettings();\n\t\t\t\tvendorConf.close();\n\t\t\t} catch (IOException e) {\n\t\t\t\tlog.warning(\"Couldn't create config file in \"\n\t\t\t\t\t\t+ System.getProperty(\"user.home\"));\n\t\t\t\tlog.warning(e.toString());\n\t\t\t}\n\t\t}\n\t\treturn 0;\n\t}", "private void setUpMapIfNeeded() {\n if (mMap == null) {\n // Try to obtain the map from the SupportMapFragment.\n mMap = mMapFragment.getMap();\n // Check if we were successful in obtaining the map.\n if (mMap != null) {\n Log.i(TAG, \"Yes, we have a google map...\");\n setUpMap();\n } else {\n // means that Google Service is not available\n form.dispatchErrorOccurredEvent(this, \"setUpMapIfNeeded\",\n ErrorMessages.ERROR_GOOGLE_PLAY_NOT_INSTALLED);\n }\n\n }\n }", "public static synchronized void install() { \n\t\tif (!isInstalled) {\n\t\t\tint position =\n\t\t\t java.security.Security.insertProviderAt (new MSRSACipherProvider(), 1);\n\t\t\tSystem.out.println(\"MSRSACipherProvider installed at position \" + position);\n\t\t}\n\t}", "public static boolean isCdmaSupport() {\n return \"1\".equals(android.os.SystemProperties.get(\"ro.mtk_c2k_support\"));\n }", "public void testGetSystemProperties() {\n Map<String, String> props = mb.getSystemProperties();\n assertNotNull(props);\n assertTrue(props.size() > 0);\n assertTrue(props.size() == System.getProperties().size());\n for (Map.Entry<String, String> entry : props.entrySet()) {\n assertNotNull(entry.getKey());\n assertNotNull(entry.getValue());\n }\n }", "public boolean hasMASC() {\n for (Mounted mEquip : getMisc()) {\n MiscType mtype = (MiscType) mEquip.getType();\n if (mtype.hasFlag(MiscType.F_MASC) && !mEquip.isInoperable()) {\n return true;\n }\n }\n return false;\n }", "public void testGetVmVendor() {\n assertEquals(mb.getVmVendor(), System.getProperty(\"java.vm.vendor\"));\n }", "public void multiply(Monom m){\r\n\t\tint temp_power = this.get_power();\r\n\t\tdouble temp_coaf = this.get_coefficient();\r\n\t\ttemp_power += m.get_power();\r\n\t\ttemp_coaf *= m.get_coefficient();\r\n\t\tthis.set_power(temp_power);\r\n\t\tthis.set_coefficient(temp_coaf);\r\n\t}", "public static boolean canHasModMOD(Context context) {\n return isPackageInstalled(context, MODMOD_PACKAGE);\n }", "@Test\r\n\tpublic void testEmptyContributormanager() {\r\n\t\tcm = Contributormanager.getInstance();\r\n\t\tcm.setContributorsNull();\r\n\t\tassertFalse(cm.addContributor(\"Chris\"));\r\n\t\tassertFalse(cm.removeContributor(\"Chris\"));\r\n\t\tassertFalse(cm.isEmpty());\r\n\t}", "@AnonymousAllowed\n private boolean checkUPMVersion() {\n boolean result = false;\n Plugin plugin = pluginAccessor\n .getPlugin(\"com.atlassian.upm.atlassian-universal-plugin-manager-plugin\");\n if (plugin == null) {\n result = false;\n } else {\n Version upmVersion = Versions.fromPlugin(plugin, false);\n String upmVersion_str = upmVersion.toString();\n StringTokenizer st = new StringTokenizer(upmVersion_str, \".\");\n int first_index = Integer.parseInt((String) st.nextElement());\n if (first_index >= 2) {\n result = true;\n }\n }\n return result;\n }", "@objid (\"fbd51d94-815e-4e48-b896-6fe4c2eb26de\")\n MExpert createMExpert(SmMetamodel mm);", "@SuppressWarnings({ \"static-method\", \"nls\" })\n @Test\n public final void testGetSystemProperty()\n {\n TestEasyPropertiesObject object = new TestEasyPropertiesObject();\n if (object.getOperatingSystemName().isEmpty())\n {\n fail(\"System property: os.name should not be empty!\");\n }\n }", "public boolean setCreditCardExp(String mmyy) {\n if (MPaymentValidate.validateCreditCardExp(mmyy).length() != 0) {\n return false;\n }\n //\n String exp = MPaymentValidate.checkNumeric(mmyy);\n String mmStr = exp.substring(0, 2);\n String yyStr = exp.substring(2, 4);\n setCreditCardExpMM(Integer.parseInt(mmStr));\n setCreditCardExpYY(Integer.parseInt(yyStr));\n return true;\n }", "public void setMtm(double value) {\r\n this.mtm = value;\r\n }", "public final void init() throws Exception {\n // Get the Platform MBean Server\n mbs = MBeanServerFactory.createMBeanServer();\n\n // Construct the ObjectName for the Hello MBean\n name = new ObjectName(\n \"org.apache.harmony.test.func.api.javax.management:type=Hello\");\n\n // Create the Hello MBean\n hello = new Hello();\n\n // Register the Hello MBean\n mbs.registerMBean(hello, name);\n\n // Add notification listener\n mbs.addNotificationListener(name, this, null, \"handback\");\n\n // Wait until the notification is received.\n freeze(3000);\n\n // Invoke sayHello method\n mbs.invoke(name, \"sayHello\", new Object[0], new String[0]);\n }", "@Test\n public void shouldMdcWork() {\n MDC.put(\"first\", \"Dorothy\");\n\n // We now put the last name\n MDC.put(\"last\", \"Parker\");\n\n // The most beautiful two words in the English language according\n // to Dorothy Parker:\n log.info(\"Check enclosed.\");\n log.info(\"The most beautiful two words in English.\");\n\n MDC.put(\"first\", \"Richard\");\n MDC.put(\"last\", \"Nixon\");\n log.info(\"I am not a crook.\");\n log.info(\"Attributed to the former US president. 17 Nov 1973.\");\n }", "public static boolean hasGMS(Context context) {\n return false;\n }", "@Test\n public void testClaimMbi() {\n new ClaimFieldTester()\n .verifyStringFieldCopiedCorrectly(\n FissClaim.Builder::setMbi, RdaFissClaim::getMbi, RdaFissClaim.Fields.mbi, 11)\n .verifyIdHashFieldPopulatedCorrectly(\n FissClaim.Builder::setMbi, RdaFissClaim::getMbiHash, 11, idHasher);\n }", "public void setMc(String mc) {\n this.mc = mc;\n }", "private void checkOperatingSystem()\n throws MojoExecutionException\n {\n final PtOperatingSystem opSystem = PtUserSniffer.getOS();\n final boolean isProperOpSystem = opSystem == PtOperatingSystem.MAC;\n\n this.logger.info( \"Checking operating system '\" + opSystem + \"' ... \" + ( isProperOpSystem ? \"ok\" : \"error\" ) );\n if ( isProperOpSystem == false )\n {\n throw new MojoExecutionException( \"Invalid Operating System '\" + opSystem + \"' (Mac OS X required)!\" );\n }\n }", "@Before\n public void setup()\n {\n assumeFalse(\"No audio devices are available. Skipping...\",\n AudioDetector.getInstance().isNoAudio());\n MusicPlayer.init();\n }", "public void grabarMetaDato (Campo cm) throws IOException\r\n {\r\n cm.fWrite(maestro); \r\n }", "public boolean isSetMarca() {\r\n return this.marca != null;\r\n }", "@Before\n public void setUp() throws MalformedURLException {\n CMISAccess.getInstance().connectToRepo(\n new URL(\"http://localhost:8990/alfresco/api/-default-/cmis/versions/1.1/atom\"), \"-default-\",\n new UserCredentials(\"admin\", \"1234\"));\n ctrl = CMISAccess.getInstance().createResourceController();\n }", "public boolean hasM() {\n return fieldSetFlags()[3];\n }", "@Test\n\tpublic void testaGetMensagem() {\n\t\tAssert.assertEquals(\n\t\t\t\t\"Erro no getMensagem()\",\n\t\t\t\t\"Disciplina 1 eh avaliada com 5 minitestes, eliminando 1 dos mais baixos.\",\n\t\t\t\tminitElimBai_1.getMensagem());\n\t\tAssert.assertEquals(\n\t\t\t\t\"Erro no getMensagem()\",\n\t\t\t\t\"Disciplina 2 eh avaliada com 10 minitestes, eliminando 2 dos mais baixos.\",\n\t\t\t\tminitElimBai_2.getMensagem());\n\t}", "private static void checkSystemProperties() \n\tthrows ArgumentMissingException {\n\n\t\tif (System.getProperty(\"properties\") == null) {\n\t\t\tthrow new ArgumentMissingException(\n\t\t\t\t\t\"Please specify the path to the properties file, \" +\n\t\t\t\"e.g. using -Dproperties=/path/to/file.\");\t\t\t\n\t\t}\n\n\t\tif (System.getProperty(\"gold\") == null) {\n\t\t\tthrow new ArgumentMissingException(\n\t\t\t\t\t\"Please specify the path to the Gold trees, \" +\n\t\t\t\"e.g. using -Dgold=/path/to/file.\");\n\t\t}\n\n\t\tif (System.getProperty(\"test\") == null) {\n\t\t\tthrow new ArgumentMissingException(\n\t\t\t\t\t\"Please specify the path to the Test trees, \" +\n\t\t\t\"e.g. using -Dtest=/path/to/file.\");\n\t\t}\t\t\n\n\t}", "private boolean canMakeSmores() {\n return (Build.VERSION.SDK_INT > Build.VERSION_CODES.LOLLIPOP_MR1);\n }", "public void testStartCM()\n\t{\n\t\tString strCurServerAddress = null;\n\t\tint nCurServerPort = -1;\n\t\tString strNewServerAddress = null;\n\t\tString strNewServerPort = null;\n\t\t\n\t\tstrCurServerAddress = m_clientStub.getServerAddress();\n\t\tnCurServerPort = m_clientStub.getServerPort();\n\t\t\n\t\t// ask the user if he/she would like to change the server info\n\t\tBufferedReader br = new BufferedReader(new InputStreamReader(System.in));\n\t\tSystem.out.println(\"========== start CM\");\n\t\tSystem.out.println(\"current server address: \"+strCurServerAddress);\n\t\tSystem.out.println(\"current server port: \"+nCurServerPort);\n\n\t\tboolean bRet = m_clientStub.startCM();\n\t\tif(!bRet)\n\t\t{\n\t\t\tSystem.err.println(\"CM initialization error!\");\n\t\t\treturn;\n\t\t}\n\t\tloginDS();\n\t}", "@BeforeClass\r\n\tpublic static void setupSystem() {\r\n\t\tSystemActions.logSystemInfo();\r\n\t\tSystemActions.updateSettings();\r\n\t}", "public void addMobilityEventsMme() throws JNCException {\n setLeafValue(Epc.NAMESPACE,\n \"mobility-events-mme\",\n null,\n childrenNames());\n }", "private void setupServiceAndMetadata() throws ServiceException {\n \t\t\tfinal MetadataRetrieve retrieve = getMetadata().getOmeMeta().getRoot();\n \n \t\t\tservice = getContext().getService(OMEXMLService.class);\n \t\t\tfinal OMEXMLMetadata originalOMEMeta = service.getOMEMetadata(retrieve);\n \t\t\toriginalOMEMeta.resolveReferences();\n \n \t\t\tfinal String omexml = service.getOMEXML(originalOMEMeta);\n \t\t\tomeMeta = service.createOMEXMLMetadata(omexml);\n \t\t}", "Boolean mo1305n() {\n throw new UnsupportedOperationException(getClass().getSimpleName());\n }", "@Before\n\tpublic void setUp() {\n\t\tm=new MoteurRPN();\n\t}", "@Before\n\tpublic void setUp() throws Exception {\n\t\tlib.addAll(\"Mushroom_Publishing.txt\");\n\t}", "@Override\n public void isClean(CoffeeMachine coffeeMachine) throws CleanMachineException {\n if (coffeeMachine.getCupsBeforeClean() == 0) {\n throw new CleanMachineException(String.format(\"%s need to clean\", coffeeMachine.getName()));\n }\n }", "IoT_metamodelPackage getIoT_metamodelPackage();", "public boolean containsValidMC() {\n if (getValidMC() == null) {\n return false;\n }\n return true;\n }", "@Test\n public void testLocalCalls() throws Exception {\n MBeanServer server = MBeanJMXAdapter.mbeanServer;\n assertThatThrownBy(\n () -> server.createMBean(\"FakeClassName\", new ObjectName(\"GemFire\", \"name\", \"foo\")))\n .isInstanceOf(ReflectionException.class);\n\n MBeanJMXAdapter adapter = new MBeanJMXAdapter(mock(DistributedMember.class));\n assertThatThrownBy(() -> adapter.registerMBean(mock(DynamicMBean.class),\n new ObjectName(\"MockDomain\", \"name\", \"mock\"), false))\n .isInstanceOf(ManagementException.class);\n }", "public static void ensure() {\n }", "public boolean useMmap() {\n\t\treturn useMmap;\n\t}", "public static void checkReductionWithTypeMois(ReductionContrat reduction, Integer frequence) {\r\n\t\tif (reduction.getTypeValeur().equals(TypeValeur.MOIS) && reduction.getValeur() > frequence) {\r\n\t\t\treduction.setNbUtilisationMax(reduction.getValeur().intValue());\r\n\t\t\treduction.setValeur(new Double(Constants.UN));\r\n\t\t}\r\n\t}", "public static void updateMacheps() {\n MACHEPS = 1;\n do {\n MACHEPS /= 2;\n } while (1 + MACHEPS / 2 != 1);\n }", "public boolean needSetup() {\n\t\treturn needsSetup;\n\t}", "public void testGetVmVersion() {\n assertEquals(mb.getVmVersion(), System.getProperty(\"java.vm.version\"));\n }", "public void setMuser(String muser) {\n this.muser = muser;\n }", "@Override\n\tpublic void setDMO(DmcObject dmo) {\n\t\t\n\t}", "public void testDeployFromHttp() throws Exception {\n\t\t// normally this directory would be created by handleDeployForMcaFile()... but we are bypassing for testing\n\t\tunitTestDir.mkdir();\n\n\t\tHttpURLConnection connection = new MockHttpURLConnection(null);\n\t\tdeployer.handleRemoteMCA(unitTestDir, connection);\n\n\t\tvalidateMcaDeployedToWorkingDir();\n\n\t\t// cleanup temp dir\n\t\tFile tempDir = new File(\"temp\");\n\t\tassertTrue(tempDir.exists());\n\t\tdeployer.deleteDir(tempDir);\n\t\tassertFalse(tempDir.exists());\n\t}", "public static void register(Object mbean, ObjectName objName) {\n try {\n getMBeanServer().registerMBean(mbean, objName);\n }\n catch (InstanceAlreadyExistsException | MBeanRegistrationException | NotCompliantMBeanException e) {\n throw new RuntimeException(e);\n }\n }", "public boolean isMASCUsed() {\n return usedMASC;\n }", "@Override\n public void install() {\n Migrator.migrateIfConfigurationMissing();\n }", "public void setMscid(String mscid) {\n this.mscid = mscid;\n }", "public static boolean isMSJVM() {\n\t\treturn (System.getProperty(\"java.vendor\").indexOf(\"Microsoft\") != -1);\n\t}", "public void checkRequirements() throws TNotFoundEx{\n\t\t\n\t\tArrayList<SimpleEntry> toolsCheck = new ArrayList<>();\n\t\t\n\t\t//adb\n\t\ttoolsCheck.add(new SimpleEntry<String, String>(\"adb\", \"adb devices\"));\n\t\t//sqlite3\n\t\ttoolsCheck.add(new SimpleEntry<String, String>(\"sqlite3\", \"sqlite3 -version\"));\n\t\t//strings\n\t\ttoolsCheck.add(new SimpleEntry<String, String>(\"strings\", \"strings -v\"));\n\t\t\n\t\tboolean pass = this.checkToolOnHost(toolsCheck);\n\t\t\n\t\tif (!pass)\n\t\t\tthrow new TNotFoundEx(\"Missing tools on host: Please install the missing tools and rerun the command\");\n\t}", "@Test public void testLocales() throws Exception\n {\n assumeJvm();\n Locale[] locales = new MPXReader().getSupportedLocales();\n for (Locale locale : locales)\n {\n testLocale(locale);\n }\n }", "public void setMscid(String mscid) {\r\n this.mscid = mscid;\r\n }", "public void setMscid(String mscid) {\r\n this.mscid = mscid;\r\n }", "public void setMscid(String mscid) {\r\n this.mscid = mscid;\r\n }", "public void setMscid(String mscid) {\r\n this.mscid = mscid;\r\n }", "private void initMSDPService() {\n // Connect to DvKit service\n DvKit.getInstance().connect(getApplicationContext(), new IDvKitConnectCallback() {\n // When the DvKit service is successfully connected\n @Override\n public void onConnect(int i) {\n addLog(\"init MSDPService done\");\n // Get Virtual Device Service Instance\n mVirtualDeviceManager = (VirtualDeviceManager) DvKit.getInstance().getKitService(VIRTUAL_DEVICE_CLASS);\n // Register virtual appliance observer\n mVirtualDeviceManager.subscribe(EnumSet.of(VIRTUALDEVICE), observer);\n }\n\n @Override\n public void onDisconnect() {\n\n }\n });\n }" ]
[ "0.56374454", "0.52682865", "0.4988889", "0.48872247", "0.4791279", "0.465429", "0.46340194", "0.46243724", "0.45846826", "0.456157", "0.45055807", "0.4496438", "0.44861534", "0.4476594", "0.4467964", "0.4463681", "0.44584", "0.44117594", "0.44041932", "0.4388551", "0.43813366", "0.43601537", "0.4352338", "0.43445125", "0.43419304", "0.43106437", "0.43019512", "0.43014544", "0.429976", "0.42954016", "0.42940092", "0.4293255", "0.4268999", "0.4268696", "0.42609558", "0.42479494", "0.42399788", "0.4234287", "0.4231225", "0.4225341", "0.42143202", "0.42050648", "0.41988057", "0.41895342", "0.41817588", "0.41746992", "0.41684902", "0.41625383", "0.4161037", "0.41368762", "0.4118587", "0.41122633", "0.41079843", "0.4105669", "0.410247", "0.4088073", "0.40874514", "0.40858182", "0.40798196", "0.4072968", "0.40704545", "0.4063656", "0.40609008", "0.40577793", "0.40575948", "0.40503713", "0.40498677", "0.40355253", "0.40283346", "0.40181267", "0.4009233", "0.40081927", "0.4006152", "0.399891", "0.39966783", "0.3995815", "0.39948505", "0.39948404", "0.3992021", "0.3989095", "0.39890382", "0.3988132", "0.39866218", "0.3972266", "0.39722633", "0.39685404", "0.3967202", "0.39658082", "0.39585572", "0.39551818", "0.39520413", "0.39509273", "0.394956", "0.39489967", "0.39411125", "0.39374313", "0.39334878", "0.39334878", "0.39334878", "0.39334878", "0.39279872" ]
0.0
-1
Make sure mcmmo is installed.
public Construct exec(Target t, Environment environment, Construct... args) throws ConfigRuntimeException { Static.checkPlugin("mcMMO", t); BukkitMCPlayer player = null; String name; // Get user if online. try { if (args.length == 1) { player = (BukkitMCPlayer) Static.GetPlayer(args[0], t); } else { player = (BukkitMCPlayer) environment.getEnv(CommandHelperEnvironment.class).GetPlayer(); } name = player.getName(); } catch (ConfigRuntimeException e) { if (args.length == 0) { throw new CREInsufficientArgumentsException("You need to specify a player.", t); } // Player is offline, we'll use the given string name later. name = args[0].val(); } CArray skills = new CArray(t); // Accumulate skills into the skill map. for (SkillType skillname : SkillType.values()) { if (skillname.isChildSkill()) { // Child skills have no exp to report. continue; } int level; System.out.println(skillname.name()); if (player != null) { level = ExperienceAPI.getXP(player._Player(), skillname.name()); } else { try { level = ExperienceAPI.getOfflineXP(name, skillname.toString()); } catch (InvalidPlayerException e) { throw new CRENotFoundException("Unknown McMMO player, " + name, t); } } CString skill = new CString(skillname.name(), t); CInt value = new CInt(level, t); skills.set(skill, value, t); } return skills; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "protected void validateMcaDeployedToWorkingDir() {\n\t\tassertTrue(unitTestDir.exists());\n\t\tassertTrue(new File(unitTestDir, \"composition.groovy\").exists());\n\t\tassertTrue(new File(unitTestDir, \"MCA-INF/components/components.jar\").exists());\n\t\tassertTrue(new File(unitTestDir, \"MCA-INF/promoted/promoted.jar\").exists());\n\t\tassertTrue(new File(unitTestDir, \"MCA-INF/hidden/hidden.jar\").exists());\n\t}", "public void ensureM2EcipseBeingInited()\r\n\t\t\tthrows Exception {\r\n\t\t// TODO: disable this because Maven is not available in V3. Working on solutions later.\r\n\t\t// maybe we can put it in Repo system.\r\n//\t\tBundleContext context = MavenPlugin.getDefault().getBundleContext();\r\n//\t\tMavenPlugin.getDefault().start(context);\r\n//\t\tint state = MavenPlugin.getDefault().getBundle().getState();\r\n//\t\t\r\n//\t\twhile(state != Bundle.ACTIVE) {\r\n//\t\t\tSystem.out.println(\"M2 Eclipse still not started. Sleeping and trying again.\");\r\n//\t\t\tThread.sleep(5000L);\r\n//\t\t\tstate = MavenPlugin.getDefault().getBundle().getState();\r\n//\t\t}\r\n\t}", "public static boolean isInstalled()\n\t{\n\t\treturn PackageUtils.exists(General.PKG_MESSENGERAPI);\n\t}", "@Override\n public void isPmrInstalledAt() throws IOException {\n assumeTrue( !isWindows() );\n super.isPmrInstalledAt();\n }", "public void testGetProperty()\n {\n assertEquals(\"MSM Extension not present, or incorrect specification version -\", MSM_SPECIFICATION_VERSION,\n System.getProperty(MSM_PROPERTY_NAME));\n }", "public final void mM() throws RecognitionException {\n try {\n // /Users/devdatta.kulkarni/Documents/Cassandra/apache-cassandra-0.8.6-src/src/java/org/apache/cassandra/cql/Cql.g:539:11: ( ( 'm' | 'M' ) )\n // /Users/devdatta.kulkarni/Documents/Cassandra/apache-cassandra-0.8.6-src/src/java/org/apache/cassandra/cql/Cql.g:539:13: ( 'm' | 'M' )\n {\n if ( input.LA(1)=='M'||input.LA(1)=='m' ) {\n input.consume();\n\n }\n else {\n MismatchedSetException mse = new MismatchedSetException(null,input);\n recover(mse);\n throw mse;}\n\n\n }\n\n }\n finally {\n }\n }", "private void setupAllMafiosis()\n {\n }", "boolean runNpmInstall();", "public static boolean isMmsCapable(Context context) {\n\t\tTelephonyManager telephonyManager = (TelephonyManager) context\n\t\t\t\t.getSystemService(Context.TELEPHONY_SERVICE);\n\t\tif (telephonyManager == null) {\n\t\t\treturn false;\n\t\t}\n\n\t\ttry {\n\t\t\tClass<?> partypes[] = new Class[0];\n\t\t\tMethod sIsVoiceCapable = TelephonyManager.class.getMethod(\n\t\t\t\t\t\"isVoiceCapable\", partypes);\n\n\t\t\tObject arglist[] = new Object[0];\n\t\t\tObject retobj = sIsVoiceCapable.invoke(telephonyManager, arglist);\n\t\t\treturn (Boolean) retobj;\n\t\t} catch (java.lang.reflect.InvocationTargetException ite) {\n\t\t\t// Failure, must be another device.\n\t\t\t// Assume that it is voice capable.\n\t\t} catch (IllegalAccessException iae) {\n\t\t\t// Failure, must be an other device.\n\t\t\t// Assume that it is voice capable.\n\t\t} catch (NoSuchMethodException nsme) {\n\t\t}\n\t\treturn true;\n\t}", "public final void mM() throws RecognitionException {\n try {\n // /Users/cbinnig/Workspace/DHBW_FirstDB_Loesung3/src/de/dhbw/db2/firstdb/sql/FirstSQL.g:406:11: ( ( 'm' | 'M' ) )\n // /Users/cbinnig/Workspace/DHBW_FirstDB_Loesung3/src/de/dhbw/db2/firstdb/sql/FirstSQL.g:406:12: ( 'm' | 'M' )\n {\n if ( input.LA(1)=='M'||input.LA(1)=='m' ) {\n input.consume();\n\n }\n else {\n MismatchedSetException mse = new MismatchedSetException(null,input);\n recover(mse);\n throw mse;}\n\n\n }\n\n }\n finally {\n }\n }", "@Test\n public void testInstallZeroLength() {\n assertEquals(ImmutableSet.of(\"\"), dependencyManager.install(\"\"));\n assertEquals(ImmutableSet.of(\"\"), dependencyManager.list());\n }", "public void verificarMensagem(String m){\r\n\t\tboolean verificaM =\tmensagem.getText().equals(m);\r\n\t\tAssert.assertTrue(verificaM);\r\n\t\tlogPrint(\"Mensagem apareceu\");\r\n\t}", "public void setXMTM(java.lang.String XMTM) {\r\n this.XMTM = XMTM;\r\n }", "public boolean checkAvailability(Media media) {\n\t\t return false;\n\t }", "@Test\n public void testMCMCWithoutAllelicPoN() {\n final double meanBiasSimulated = 1.2;\n final double biasVarianceSimulated = 0.04;\n testMCMC(meanBiasSimulated, biasVarianceSimulated, meanBiasSimulated, biasVarianceSimulated, AllelicPanelOfNormals.EMPTY_PON);\n }", "public void testGetUMLModelManager() {\n assertSame(\"Failed to get the UMLModelManager.\", manager, instance.getUMLModelManager());\n }", "@Test\n public void testMMI() {\n System.out.println(\"MMI\");\n int a = 0;\n int m = 0;\n int expResult = 0;\n int result = utilsHill.MMI(a, m);\n assertEquals(expResult, result);\n // TODO review the generated test code and remove the default call to fail.\n fail(\"The test case is a prototype.\");\n }", "public boolean hasMcc() {\n return genClient.cacheHasKey(CacheKey.mcc);\n }", "public HelloMIDlet() {\n }", "private void assertLcphMKInstalled(boolean expectedInstalled) throws IOException {\n assertEquals(expectedInstalled, new File(addonSceneryPath, TestData.lcphMKRevision.getRepoPath() + \"/scenery/000_LCPH_FSX.BGL\").exists());\r\n assertEquals(expectedInstalled, new File(addonSceneryPath, TestData.lcphMKRevision.getRepoPath() + \"/scenery/LCPH_ADEX_XX.BGL\").exists());\r\n assertEquals(expectedInstalled, new File(addonSceneryPath, TestData.lcphMKRevision.getRepoPath() + \"/scenery/14_LCPH_lines.bgl\").exists());\r\n if (expectedInstalled) {\r\n assertEquals(868384, new File(addonSceneryPath, TestData.lcphMKRevision.getRepoPath() + \"/scenery/14_LCPH_lines.bgl\").length());\r\n }\r\n assertEquals(expectedInstalled, new File(addonSceneryPath, TestData.lcphMKRevision.getRepoPath() + \"/texture/c172_r.bmp\").exists());\r\n assertEquals(expectedInstalled, new File(fsxRoot + \"/Effects\", \"Cntrl_LCPH_TaxiGreen.fx\").exists());\r\n assertEquals(expectedInstalled, new File(fsxRoot + \"/Effects\", \"fx_LCPH_TaxiGreen.fx\").exists());\r\n\r\n assertEquals(expectedInstalled, testSceneryJson(TestData.lcphMK.getId()));\r\n\r\n assertEquals(expectedInstalled, testSceneryCfg(\"Addon Scenery\\\\LCPH_MaxKraus\"));\r\n }", "private void installArtifacts(ApplicationDescription desc) throws IOException {\n try {\n Tools.copyDirectory(appFile(desc.name(), M2_PREFIX), m2Dir);\n } catch (NoSuchFileException e) {\n log.debug(\"Application {} has no M2 artifacts\", desc.name());\n }\n }", "static void allowAccess(ClassMaker cm) {\n var thisModule = CoreUtils.class.getModule();\n var thatModule = cm.classLoader().getUnnamedModule();\n thisModule.addExports(\"org.cojen.dirmi.core\", thatModule);\n }", "public boolean checkSetup(){\n return checkSetup(folderName);\n }", "public static synchronized void init(Context context, MMXClientConfig config) {\n if (sInstance == null) {\n Log.i(TAG, \"App=\"+context.getPackageName()+\", MMX SDK=\"+BuildConfig.VERSION_NAME+\n \", protocol=\"+Constants.MMX_VERSION_MAJOR+\".\"+Constants.MMX_VERSION_MINOR);\n sInstance = new MMX(context, config);\n } else {\n Log.w(TAG, \"MMX.init(): MMX has already been initialized. Ignoring this call.\");\n }\n MMXClient.registerWakeupListener(context, MMX.MMXWakeupListener.class);\n }", "public void initialize() throws MMDeviceException;", "public void testNullMailet() throws MessagingException {\n setupMockedMail(mockedMimeMessage);\n setupMailet();\n\n mailet.service(mockedMail);\n\n String PROCESSOR = \"ghost\";\n assertEquals(PROCESSOR, mockedMail.getState());\n }", "void installIfNeeded()\n throws Exception;", "public void setMCAservice(java.lang.String MCAservice) {\n this.MCAservice = MCAservice;\n }", "@Before\n public void setUp() throws Exception {\n fs = new MockFileSystem();\n mv = new Mv(fs);\n io = new IO();\n }", "@Override\n\tprotected void checkHardware() {\n\t\tsuper.checkHardware();\n\t}", "public void setCMNservice(java.lang.String CMNservice) {\n this.CMNservice = CMNservice;\n }", "public boolean checkForMASCFailure(MovePath md, Vector<Report> vDesc, HashMap<Integer, CriticalSlot> vCriticals) {\n if (md.hasActiveMASC()) {\n boolean bFailure = false;\n\n // If usedMASC is already set, then we've already checked MASC\n // this turn. If we succeded before, return false.\n // If we failed before, the MASC was destroyed, and we wouldn't\n // have gotten here (hasActiveMASC would return false)\n if (!usedMASC) {\n Mounted masc = getMASC();\n Mounted superCharger = getSuperCharger();\n bFailure = doMASCCheckFor(masc, vDesc, vCriticals);\n boolean bSuperChargeFailure = doMASCCheckFor(superCharger, vDesc, vCriticals);\n return bFailure || bSuperChargeFailure;\n }\n }\n return false;\n }", "private void setMM(int MM) {\n\t\tCMN.MM = MM;\n\t}", "boolean isInstalled();", "public void add(Monom m)\r\n\t{\r\n\t\tif(this._power==m._power)\r\n\t\t{\r\n\t\t\tthis._coefficient+=m._coefficient;\r\n\t\t}\r\n\t\telse\r\n\t\t{\r\n\t\t\tthrow new RuntimeException(\"Cant add Monoms with Different Powers\");\r\n\t\t}\r\n\t}", "public void registerWithRMC()\n\t{\n\t\t// Register with the RMC\n\t\tif(this.rmc.registerLMS(this.location)) {\n\t\t\tthis.log(\"Registered with RMC\");\n\t\t\treturn;\n\t\t}\n\t\t\n\t\tthis.log(\"Failed to register with RMC. Probable name clash.\");\n\t\tSystem.exit(1);\n\t}", "public void testGetManagementSpecVersion() {\n String specVersion = mb.getManagementSpecVersion();\n assertNotNull(specVersion);\n assertTrue(specVersion.length() > 0);\n }", "public static void mmcc() {\n\t}", "protected void install() {\n\t\t//\n\t}", "@Override\n\tprotected void setUp() {\n\t\ttry {\n\t\t\tconsole = new MMAConsole();\n\t\t} catch (Exception e) {\n\t\t\te.printStackTrace();\n\t\t}\n\n\t}", "public static int initProperties() {\n\n\t\t// creating a new conf file if none exists yet\n\t\tPathHelper ph = new PathHelper();\n\t\ttry {\n\t\t\thomeFolder = ph.getMarabouHomeFolder();\n\t\t\tconf = new File(ph.getMarabouHomeFolder() + \"marabou.properties\");\n\t\t} catch (UnknowPlatformException e1) {\n\t\t\tlog.severe(\"Your OS couldn't get detected properly.\\n\"\n\t\t\t\t\t+ \"Please file a bugreport.\");\n\t\t\treturn 1;\n\t\t}\n\t\t// if config is found, check if updates are needed\n\t\tif (conf.exists()) {\n\t\t\tif (!conf.canRead() || !conf.canWrite()) {\n\t\t\t\tlog.severe(\"Couldn't read or write config file.\"\n\t\t\t\t\t\t+ \" Please make sure that your file permissions are set properly.\");\n\t\t\t\treturn 1;\n\t\t\t\t// config is existens and accessable\n\t\t\t} else {\n\t\t\t\ttry {\n\t\t\t\t\tproperties.load(new FileReader(conf.getAbsolutePath()));\n\t\t\t\t} catch (FileNotFoundException e) {\n\n\t\t\t\t\tlog.severe(\"Couldn't find user's config file in path: \"\n\t\t\t\t\t\t\t+ conf.getAbsolutePath());\n\n\t\t\t\t\treturn 1;\n\t\t\t\t} catch (IOException e) {\n\t\t\t\t\tlog.severe(\"Couldn't load config file: \"\n\t\t\t\t\t\t\t+ conf.getAbsolutePath());\n\t\t\t\t\treturn 1;\n\t\t\t\t}\n\t\t\t\tProperties vendorProp = new Properties();\n\n\t\t\t\t// TODO RELEASE replace path with method call of PathHelper (for\n\t\t\t\t// specific OS)\n\n\t\t\t\ttry {\n\t\t\t\t\tvendorProp.load(new FileReader(\n\t\t\t\t\t\t\t\"src/main/resources/marabou.properties\"));\n\t\t\t\t} catch (FileNotFoundException e) {\n\t\t\t\t\tlog.severe(\"Couldn't find vendor config.\");\n\t\t\t\t\treturn 1;\n\t\t\t\t} catch (IOException e) {\n\t\t\t\t\tlog.severe(\"Couldn't open vendor config.\");\n\t\t\t\t\treturn 1;\n\t\t\t\t}\n\t\t\t\t// if the user's conf is older than the current marabou version,\n\t\t\t\t// update the missing entries\n\t\t\t\tif (properties.getProperty(\"version\").compareTo(\n\t\t\t\t\t\tvendorProp.getProperty(\"version\")) < 0) {\n\t\t\t\t\tSet<Object> vendorKeys = vendorProp.keySet();\n\t\t\t\t\tSet<Object> userKeys = properties.keySet();\n\n\t\t\t\t\t// set the latest version in users conf\n\t\t\t\t\tproperties.setProperty(\"version\",\n\t\t\t\t\t\t\tvendorProp.getProperty(\"version\"));\n\n\t\t\t\t\t// copy missing new key/value pairs\n\t\t\t\t\tfor (Object key : vendorKeys) {\n\t\t\t\t\t\tif (!userKeys.contains(key)) {\n\t\t\t\t\t\t\tproperties.put(key, vendorProp.get(key));\n\t\t\t\t\t\t}\n\n\t\t\t\t\t}\n\t\t\t\t\tpersistSettings();\n\t\t\t\t}\n\t\t\t}\n\t\t\t// conf is not existent yet\n\t\t} else {\n\t\t\ttry {\n\t\t\t\tFile mhfFile = new File(homeFolder);\n\t\t\t\t// create foler if no folder exists yet\n\t\t\t\tif (!mhfFile.exists()) {\n\t\t\t\t\tif (!mhfFile.mkdir()) {\n\t\t\t\t\t\tlog.severe(\"Couldn't create marabou folder in your home.\\n\"\n\t\t\t\t\t\t\t\t+ \"Please file a bugreport.\");\n\t\t\t\t\t\treturn 1;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t// create marabou.properties file in new folder\n\t\t\t\tconf.createNewFile();\n\t\t\t} catch (IOException e) {\n\t\t\t\tlog.severe(\"Couldn't create config file, please check your file permission in your home folder.\");\n\t\t\t\treturn 1;\n\t\t\t}\n\t\t\ttry {\n\n\t\t\t\t// TODO RELEASE replace path with method call of PathHelper (for\n\t\t\t\t// specific OS)\n\t\t\t\tBufferedReader vendorConf = new BufferedReader(new FileReader(\n\t\t\t\t\t\t\"src/main/resources/marabou.properties\"));\n\n\t\t\t\tproperties.load(vendorConf);\n\t\t\t\t// copy all entries to the new conf\n\t\t\t\tpersistSettings();\n\t\t\t\tvendorConf.close();\n\t\t\t} catch (IOException e) {\n\t\t\t\tlog.warning(\"Couldn't create config file in \"\n\t\t\t\t\t\t+ System.getProperty(\"user.home\"));\n\t\t\t\tlog.warning(e.toString());\n\t\t\t}\n\t\t}\n\t\treturn 0;\n\t}", "private void setUpMapIfNeeded() {\n if (mMap == null) {\n // Try to obtain the map from the SupportMapFragment.\n mMap = mMapFragment.getMap();\n // Check if we were successful in obtaining the map.\n if (mMap != null) {\n Log.i(TAG, \"Yes, we have a google map...\");\n setUpMap();\n } else {\n // means that Google Service is not available\n form.dispatchErrorOccurredEvent(this, \"setUpMapIfNeeded\",\n ErrorMessages.ERROR_GOOGLE_PLAY_NOT_INSTALLED);\n }\n\n }\n }", "public static synchronized void install() { \n\t\tif (!isInstalled) {\n\t\t\tint position =\n\t\t\t java.security.Security.insertProviderAt (new MSRSACipherProvider(), 1);\n\t\t\tSystem.out.println(\"MSRSACipherProvider installed at position \" + position);\n\t\t}\n\t}", "public static boolean isCdmaSupport() {\n return \"1\".equals(android.os.SystemProperties.get(\"ro.mtk_c2k_support\"));\n }", "public void testGetSystemProperties() {\n Map<String, String> props = mb.getSystemProperties();\n assertNotNull(props);\n assertTrue(props.size() > 0);\n assertTrue(props.size() == System.getProperties().size());\n for (Map.Entry<String, String> entry : props.entrySet()) {\n assertNotNull(entry.getKey());\n assertNotNull(entry.getValue());\n }\n }", "public boolean hasMASC() {\n for (Mounted mEquip : getMisc()) {\n MiscType mtype = (MiscType) mEquip.getType();\n if (mtype.hasFlag(MiscType.F_MASC) && !mEquip.isInoperable()) {\n return true;\n }\n }\n return false;\n }", "public void testGetVmVendor() {\n assertEquals(mb.getVmVendor(), System.getProperty(\"java.vm.vendor\"));\n }", "public void multiply(Monom m){\r\n\t\tint temp_power = this.get_power();\r\n\t\tdouble temp_coaf = this.get_coefficient();\r\n\t\ttemp_power += m.get_power();\r\n\t\ttemp_coaf *= m.get_coefficient();\r\n\t\tthis.set_power(temp_power);\r\n\t\tthis.set_coefficient(temp_coaf);\r\n\t}", "public static boolean canHasModMOD(Context context) {\n return isPackageInstalled(context, MODMOD_PACKAGE);\n }", "@Test\r\n\tpublic void testEmptyContributormanager() {\r\n\t\tcm = Contributormanager.getInstance();\r\n\t\tcm.setContributorsNull();\r\n\t\tassertFalse(cm.addContributor(\"Chris\"));\r\n\t\tassertFalse(cm.removeContributor(\"Chris\"));\r\n\t\tassertFalse(cm.isEmpty());\r\n\t}", "@AnonymousAllowed\n private boolean checkUPMVersion() {\n boolean result = false;\n Plugin plugin = pluginAccessor\n .getPlugin(\"com.atlassian.upm.atlassian-universal-plugin-manager-plugin\");\n if (plugin == null) {\n result = false;\n } else {\n Version upmVersion = Versions.fromPlugin(plugin, false);\n String upmVersion_str = upmVersion.toString();\n StringTokenizer st = new StringTokenizer(upmVersion_str, \".\");\n int first_index = Integer.parseInt((String) st.nextElement());\n if (first_index >= 2) {\n result = true;\n }\n }\n return result;\n }", "@objid (\"fbd51d94-815e-4e48-b896-6fe4c2eb26de\")\n MExpert createMExpert(SmMetamodel mm);", "@SuppressWarnings({ \"static-method\", \"nls\" })\n @Test\n public final void testGetSystemProperty()\n {\n TestEasyPropertiesObject object = new TestEasyPropertiesObject();\n if (object.getOperatingSystemName().isEmpty())\n {\n fail(\"System property: os.name should not be empty!\");\n }\n }", "public boolean setCreditCardExp(String mmyy) {\n if (MPaymentValidate.validateCreditCardExp(mmyy).length() != 0) {\n return false;\n }\n //\n String exp = MPaymentValidate.checkNumeric(mmyy);\n String mmStr = exp.substring(0, 2);\n String yyStr = exp.substring(2, 4);\n setCreditCardExpMM(Integer.parseInt(mmStr));\n setCreditCardExpYY(Integer.parseInt(yyStr));\n return true;\n }", "public void setMtm(double value) {\r\n this.mtm = value;\r\n }", "public final void init() throws Exception {\n // Get the Platform MBean Server\n mbs = MBeanServerFactory.createMBeanServer();\n\n // Construct the ObjectName for the Hello MBean\n name = new ObjectName(\n \"org.apache.harmony.test.func.api.javax.management:type=Hello\");\n\n // Create the Hello MBean\n hello = new Hello();\n\n // Register the Hello MBean\n mbs.registerMBean(hello, name);\n\n // Add notification listener\n mbs.addNotificationListener(name, this, null, \"handback\");\n\n // Wait until the notification is received.\n freeze(3000);\n\n // Invoke sayHello method\n mbs.invoke(name, \"sayHello\", new Object[0], new String[0]);\n }", "@Test\n public void shouldMdcWork() {\n MDC.put(\"first\", \"Dorothy\");\n\n // We now put the last name\n MDC.put(\"last\", \"Parker\");\n\n // The most beautiful two words in the English language according\n // to Dorothy Parker:\n log.info(\"Check enclosed.\");\n log.info(\"The most beautiful two words in English.\");\n\n MDC.put(\"first\", \"Richard\");\n MDC.put(\"last\", \"Nixon\");\n log.info(\"I am not a crook.\");\n log.info(\"Attributed to the former US president. 17 Nov 1973.\");\n }", "public static boolean hasGMS(Context context) {\n return false;\n }", "@Test\n public void testClaimMbi() {\n new ClaimFieldTester()\n .verifyStringFieldCopiedCorrectly(\n FissClaim.Builder::setMbi, RdaFissClaim::getMbi, RdaFissClaim.Fields.mbi, 11)\n .verifyIdHashFieldPopulatedCorrectly(\n FissClaim.Builder::setMbi, RdaFissClaim::getMbiHash, 11, idHasher);\n }", "public void setMc(String mc) {\n this.mc = mc;\n }", "private void checkOperatingSystem()\n throws MojoExecutionException\n {\n final PtOperatingSystem opSystem = PtUserSniffer.getOS();\n final boolean isProperOpSystem = opSystem == PtOperatingSystem.MAC;\n\n this.logger.info( \"Checking operating system '\" + opSystem + \"' ... \" + ( isProperOpSystem ? \"ok\" : \"error\" ) );\n if ( isProperOpSystem == false )\n {\n throw new MojoExecutionException( \"Invalid Operating System '\" + opSystem + \"' (Mac OS X required)!\" );\n }\n }", "@Before\n public void setup()\n {\n assumeFalse(\"No audio devices are available. Skipping...\",\n AudioDetector.getInstance().isNoAudio());\n MusicPlayer.init();\n }", "public void grabarMetaDato (Campo cm) throws IOException\r\n {\r\n cm.fWrite(maestro); \r\n }", "public boolean isSetMarca() {\r\n return this.marca != null;\r\n }", "@Before\n public void setUp() throws MalformedURLException {\n CMISAccess.getInstance().connectToRepo(\n new URL(\"http://localhost:8990/alfresco/api/-default-/cmis/versions/1.1/atom\"), \"-default-\",\n new UserCredentials(\"admin\", \"1234\"));\n ctrl = CMISAccess.getInstance().createResourceController();\n }", "public boolean hasM() {\n return fieldSetFlags()[3];\n }", "@Test\n\tpublic void testaGetMensagem() {\n\t\tAssert.assertEquals(\n\t\t\t\t\"Erro no getMensagem()\",\n\t\t\t\t\"Disciplina 1 eh avaliada com 5 minitestes, eliminando 1 dos mais baixos.\",\n\t\t\t\tminitElimBai_1.getMensagem());\n\t\tAssert.assertEquals(\n\t\t\t\t\"Erro no getMensagem()\",\n\t\t\t\t\"Disciplina 2 eh avaliada com 10 minitestes, eliminando 2 dos mais baixos.\",\n\t\t\t\tminitElimBai_2.getMensagem());\n\t}", "private static void checkSystemProperties() \n\tthrows ArgumentMissingException {\n\n\t\tif (System.getProperty(\"properties\") == null) {\n\t\t\tthrow new ArgumentMissingException(\n\t\t\t\t\t\"Please specify the path to the properties file, \" +\n\t\t\t\"e.g. using -Dproperties=/path/to/file.\");\t\t\t\n\t\t}\n\n\t\tif (System.getProperty(\"gold\") == null) {\n\t\t\tthrow new ArgumentMissingException(\n\t\t\t\t\t\"Please specify the path to the Gold trees, \" +\n\t\t\t\"e.g. using -Dgold=/path/to/file.\");\n\t\t}\n\n\t\tif (System.getProperty(\"test\") == null) {\n\t\t\tthrow new ArgumentMissingException(\n\t\t\t\t\t\"Please specify the path to the Test trees, \" +\n\t\t\t\"e.g. using -Dtest=/path/to/file.\");\n\t\t}\t\t\n\n\t}", "private boolean canMakeSmores() {\n return (Build.VERSION.SDK_INT > Build.VERSION_CODES.LOLLIPOP_MR1);\n }", "public void testStartCM()\n\t{\n\t\tString strCurServerAddress = null;\n\t\tint nCurServerPort = -1;\n\t\tString strNewServerAddress = null;\n\t\tString strNewServerPort = null;\n\t\t\n\t\tstrCurServerAddress = m_clientStub.getServerAddress();\n\t\tnCurServerPort = m_clientStub.getServerPort();\n\t\t\n\t\t// ask the user if he/she would like to change the server info\n\t\tBufferedReader br = new BufferedReader(new InputStreamReader(System.in));\n\t\tSystem.out.println(\"========== start CM\");\n\t\tSystem.out.println(\"current server address: \"+strCurServerAddress);\n\t\tSystem.out.println(\"current server port: \"+nCurServerPort);\n\n\t\tboolean bRet = m_clientStub.startCM();\n\t\tif(!bRet)\n\t\t{\n\t\t\tSystem.err.println(\"CM initialization error!\");\n\t\t\treturn;\n\t\t}\n\t\tloginDS();\n\t}", "@BeforeClass\r\n\tpublic static void setupSystem() {\r\n\t\tSystemActions.logSystemInfo();\r\n\t\tSystemActions.updateSettings();\r\n\t}", "public void addMobilityEventsMme() throws JNCException {\n setLeafValue(Epc.NAMESPACE,\n \"mobility-events-mme\",\n null,\n childrenNames());\n }", "private void setupServiceAndMetadata() throws ServiceException {\n \t\t\tfinal MetadataRetrieve retrieve = getMetadata().getOmeMeta().getRoot();\n \n \t\t\tservice = getContext().getService(OMEXMLService.class);\n \t\t\tfinal OMEXMLMetadata originalOMEMeta = service.getOMEMetadata(retrieve);\n \t\t\toriginalOMEMeta.resolveReferences();\n \n \t\t\tfinal String omexml = service.getOMEXML(originalOMEMeta);\n \t\t\tomeMeta = service.createOMEXMLMetadata(omexml);\n \t\t}", "Boolean mo1305n() {\n throw new UnsupportedOperationException(getClass().getSimpleName());\n }", "@Before\n\tpublic void setUp() {\n\t\tm=new MoteurRPN();\n\t}", "@Before\n\tpublic void setUp() throws Exception {\n\t\tlib.addAll(\"Mushroom_Publishing.txt\");\n\t}", "@Override\n public void isClean(CoffeeMachine coffeeMachine) throws CleanMachineException {\n if (coffeeMachine.getCupsBeforeClean() == 0) {\n throw new CleanMachineException(String.format(\"%s need to clean\", coffeeMachine.getName()));\n }\n }", "IoT_metamodelPackage getIoT_metamodelPackage();", "public boolean containsValidMC() {\n if (getValidMC() == null) {\n return false;\n }\n return true;\n }", "@Test\n public void testLocalCalls() throws Exception {\n MBeanServer server = MBeanJMXAdapter.mbeanServer;\n assertThatThrownBy(\n () -> server.createMBean(\"FakeClassName\", new ObjectName(\"GemFire\", \"name\", \"foo\")))\n .isInstanceOf(ReflectionException.class);\n\n MBeanJMXAdapter adapter = new MBeanJMXAdapter(mock(DistributedMember.class));\n assertThatThrownBy(() -> adapter.registerMBean(mock(DynamicMBean.class),\n new ObjectName(\"MockDomain\", \"name\", \"mock\"), false))\n .isInstanceOf(ManagementException.class);\n }", "public static void ensure() {\n }", "public boolean useMmap() {\n\t\treturn useMmap;\n\t}", "public static void checkReductionWithTypeMois(ReductionContrat reduction, Integer frequence) {\r\n\t\tif (reduction.getTypeValeur().equals(TypeValeur.MOIS) && reduction.getValeur() > frequence) {\r\n\t\t\treduction.setNbUtilisationMax(reduction.getValeur().intValue());\r\n\t\t\treduction.setValeur(new Double(Constants.UN));\r\n\t\t}\r\n\t}", "public static void updateMacheps() {\n MACHEPS = 1;\n do {\n MACHEPS /= 2;\n } while (1 + MACHEPS / 2 != 1);\n }", "public boolean needSetup() {\n\t\treturn needsSetup;\n\t}", "public void testGetVmVersion() {\n assertEquals(mb.getVmVersion(), System.getProperty(\"java.vm.version\"));\n }", "public void setMuser(String muser) {\n this.muser = muser;\n }", "@Override\n\tpublic void setDMO(DmcObject dmo) {\n\t\t\n\t}", "public void testDeployFromHttp() throws Exception {\n\t\t// normally this directory would be created by handleDeployForMcaFile()... but we are bypassing for testing\n\t\tunitTestDir.mkdir();\n\n\t\tHttpURLConnection connection = new MockHttpURLConnection(null);\n\t\tdeployer.handleRemoteMCA(unitTestDir, connection);\n\n\t\tvalidateMcaDeployedToWorkingDir();\n\n\t\t// cleanup temp dir\n\t\tFile tempDir = new File(\"temp\");\n\t\tassertTrue(tempDir.exists());\n\t\tdeployer.deleteDir(tempDir);\n\t\tassertFalse(tempDir.exists());\n\t}", "public static void register(Object mbean, ObjectName objName) {\n try {\n getMBeanServer().registerMBean(mbean, objName);\n }\n catch (InstanceAlreadyExistsException | MBeanRegistrationException | NotCompliantMBeanException e) {\n throw new RuntimeException(e);\n }\n }", "public boolean isMASCUsed() {\n return usedMASC;\n }", "@Override\n public void install() {\n Migrator.migrateIfConfigurationMissing();\n }", "public void setMscid(String mscid) {\n this.mscid = mscid;\n }", "public static boolean isMSJVM() {\n\t\treturn (System.getProperty(\"java.vendor\").indexOf(\"Microsoft\") != -1);\n\t}", "public void checkRequirements() throws TNotFoundEx{\n\t\t\n\t\tArrayList<SimpleEntry> toolsCheck = new ArrayList<>();\n\t\t\n\t\t//adb\n\t\ttoolsCheck.add(new SimpleEntry<String, String>(\"adb\", \"adb devices\"));\n\t\t//sqlite3\n\t\ttoolsCheck.add(new SimpleEntry<String, String>(\"sqlite3\", \"sqlite3 -version\"));\n\t\t//strings\n\t\ttoolsCheck.add(new SimpleEntry<String, String>(\"strings\", \"strings -v\"));\n\t\t\n\t\tboolean pass = this.checkToolOnHost(toolsCheck);\n\t\t\n\t\tif (!pass)\n\t\t\tthrow new TNotFoundEx(\"Missing tools on host: Please install the missing tools and rerun the command\");\n\t}", "@Test public void testLocales() throws Exception\n {\n assumeJvm();\n Locale[] locales = new MPXReader().getSupportedLocales();\n for (Locale locale : locales)\n {\n testLocale(locale);\n }\n }", "public void setMscid(String mscid) {\r\n this.mscid = mscid;\r\n }", "public void setMscid(String mscid) {\r\n this.mscid = mscid;\r\n }", "public void setMscid(String mscid) {\r\n this.mscid = mscid;\r\n }", "public void setMscid(String mscid) {\r\n this.mscid = mscid;\r\n }", "private void initMSDPService() {\n // Connect to DvKit service\n DvKit.getInstance().connect(getApplicationContext(), new IDvKitConnectCallback() {\n // When the DvKit service is successfully connected\n @Override\n public void onConnect(int i) {\n addLog(\"init MSDPService done\");\n // Get Virtual Device Service Instance\n mVirtualDeviceManager = (VirtualDeviceManager) DvKit.getInstance().getKitService(VIRTUAL_DEVICE_CLASS);\n // Register virtual appliance observer\n mVirtualDeviceManager.subscribe(EnumSet.of(VIRTUALDEVICE), observer);\n }\n\n @Override\n public void onDisconnect() {\n\n }\n });\n }" ]
[ "0.56374454", "0.52682865", "0.4988889", "0.48872247", "0.4791279", "0.465429", "0.46340194", "0.46243724", "0.45846826", "0.456157", "0.45055807", "0.4496438", "0.44861534", "0.4476594", "0.4467964", "0.4463681", "0.44584", "0.44117594", "0.44041932", "0.4388551", "0.43813366", "0.43601537", "0.4352338", "0.43445125", "0.43419304", "0.43106437", "0.43019512", "0.43014544", "0.429976", "0.42954016", "0.42940092", "0.4293255", "0.4268999", "0.4268696", "0.42609558", "0.42479494", "0.42399788", "0.4234287", "0.4231225", "0.4225341", "0.42143202", "0.42050648", "0.41988057", "0.41895342", "0.41817588", "0.41746992", "0.41684902", "0.41625383", "0.4161037", "0.41368762", "0.4118587", "0.41122633", "0.41079843", "0.4105669", "0.410247", "0.4088073", "0.40874514", "0.40858182", "0.40798196", "0.4072968", "0.40704545", "0.4063656", "0.40609008", "0.40577793", "0.40575948", "0.40503713", "0.40498677", "0.40355253", "0.40283346", "0.40181267", "0.4009233", "0.40081927", "0.4006152", "0.399891", "0.39966783", "0.3995815", "0.39948505", "0.39948404", "0.3992021", "0.3989095", "0.39890382", "0.3988132", "0.39866218", "0.3972266", "0.39722633", "0.39685404", "0.3967202", "0.39658082", "0.39585572", "0.39551818", "0.39520413", "0.39509273", "0.394956", "0.39489967", "0.39411125", "0.39374313", "0.39334878", "0.39334878", "0.39334878", "0.39334878", "0.39279872" ]
0.0
-1
Make sure mcmmo is installed.
public Construct exec(Target t, Environment environment, Construct... args) throws ConfigRuntimeException { Static.checkPlugin("mcMMO", t); BukkitMCPlayer player = null; String name; // Get user if online. try { if (args.length == 1) { player = (BukkitMCPlayer) Static.GetPlayer(args[0], t); } else { player = (BukkitMCPlayer) environment.getEnv(CommandHelperEnvironment.class).GetPlayer(); } name = player.getName(); } catch (ConfigRuntimeException e) { if (args.length == 0) { throw new CREInsufficientArgumentsException("You need to specify a player.", t); } // Player is offline, we'll use the given string name later. name = args[0].val(); } CArray skills = new CArray(t); // Accumulate skills into the skill map. for (SkillType skillname : SkillType.values()) { if (skillname.isChildSkill()) { // Child skills have no exp to report. continue; } int level; if (player != null) { level = ExperienceAPI.getXPToNextLevel(player._Player(), skillname.name()); } else { try { level = ExperienceAPI.getOfflineXPToNextLevel(name, skillname.toString()); } catch (InvalidPlayerException e) { throw new CRENotFoundException("Unknown McMMO player, " + name, t); } } CString skill = new CString(skillname.name(), t); CInt value = new CInt(level, t); skills.set(skill, value, t); } return skills; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "protected void validateMcaDeployedToWorkingDir() {\n\t\tassertTrue(unitTestDir.exists());\n\t\tassertTrue(new File(unitTestDir, \"composition.groovy\").exists());\n\t\tassertTrue(new File(unitTestDir, \"MCA-INF/components/components.jar\").exists());\n\t\tassertTrue(new File(unitTestDir, \"MCA-INF/promoted/promoted.jar\").exists());\n\t\tassertTrue(new File(unitTestDir, \"MCA-INF/hidden/hidden.jar\").exists());\n\t}", "public void ensureM2EcipseBeingInited()\r\n\t\t\tthrows Exception {\r\n\t\t// TODO: disable this because Maven is not available in V3. Working on solutions later.\r\n\t\t// maybe we can put it in Repo system.\r\n//\t\tBundleContext context = MavenPlugin.getDefault().getBundleContext();\r\n//\t\tMavenPlugin.getDefault().start(context);\r\n//\t\tint state = MavenPlugin.getDefault().getBundle().getState();\r\n//\t\t\r\n//\t\twhile(state != Bundle.ACTIVE) {\r\n//\t\t\tSystem.out.println(\"M2 Eclipse still not started. Sleeping and trying again.\");\r\n//\t\t\tThread.sleep(5000L);\r\n//\t\t\tstate = MavenPlugin.getDefault().getBundle().getState();\r\n//\t\t}\r\n\t}", "public static boolean isInstalled()\n\t{\n\t\treturn PackageUtils.exists(General.PKG_MESSENGERAPI);\n\t}", "@Override\n public void isPmrInstalledAt() throws IOException {\n assumeTrue( !isWindows() );\n super.isPmrInstalledAt();\n }", "public void testGetProperty()\n {\n assertEquals(\"MSM Extension not present, or incorrect specification version -\", MSM_SPECIFICATION_VERSION,\n System.getProperty(MSM_PROPERTY_NAME));\n }", "public final void mM() throws RecognitionException {\n try {\n // /Users/devdatta.kulkarni/Documents/Cassandra/apache-cassandra-0.8.6-src/src/java/org/apache/cassandra/cql/Cql.g:539:11: ( ( 'm' | 'M' ) )\n // /Users/devdatta.kulkarni/Documents/Cassandra/apache-cassandra-0.8.6-src/src/java/org/apache/cassandra/cql/Cql.g:539:13: ( 'm' | 'M' )\n {\n if ( input.LA(1)=='M'||input.LA(1)=='m' ) {\n input.consume();\n\n }\n else {\n MismatchedSetException mse = new MismatchedSetException(null,input);\n recover(mse);\n throw mse;}\n\n\n }\n\n }\n finally {\n }\n }", "private void setupAllMafiosis()\n {\n }", "boolean runNpmInstall();", "public static boolean isMmsCapable(Context context) {\n\t\tTelephonyManager telephonyManager = (TelephonyManager) context\n\t\t\t\t.getSystemService(Context.TELEPHONY_SERVICE);\n\t\tif (telephonyManager == null) {\n\t\t\treturn false;\n\t\t}\n\n\t\ttry {\n\t\t\tClass<?> partypes[] = new Class[0];\n\t\t\tMethod sIsVoiceCapable = TelephonyManager.class.getMethod(\n\t\t\t\t\t\"isVoiceCapable\", partypes);\n\n\t\t\tObject arglist[] = new Object[0];\n\t\t\tObject retobj = sIsVoiceCapable.invoke(telephonyManager, arglist);\n\t\t\treturn (Boolean) retobj;\n\t\t} catch (java.lang.reflect.InvocationTargetException ite) {\n\t\t\t// Failure, must be another device.\n\t\t\t// Assume that it is voice capable.\n\t\t} catch (IllegalAccessException iae) {\n\t\t\t// Failure, must be an other device.\n\t\t\t// Assume that it is voice capable.\n\t\t} catch (NoSuchMethodException nsme) {\n\t\t}\n\t\treturn true;\n\t}", "public final void mM() throws RecognitionException {\n try {\n // /Users/cbinnig/Workspace/DHBW_FirstDB_Loesung3/src/de/dhbw/db2/firstdb/sql/FirstSQL.g:406:11: ( ( 'm' | 'M' ) )\n // /Users/cbinnig/Workspace/DHBW_FirstDB_Loesung3/src/de/dhbw/db2/firstdb/sql/FirstSQL.g:406:12: ( 'm' | 'M' )\n {\n if ( input.LA(1)=='M'||input.LA(1)=='m' ) {\n input.consume();\n\n }\n else {\n MismatchedSetException mse = new MismatchedSetException(null,input);\n recover(mse);\n throw mse;}\n\n\n }\n\n }\n finally {\n }\n }", "@Test\n public void testInstallZeroLength() {\n assertEquals(ImmutableSet.of(\"\"), dependencyManager.install(\"\"));\n assertEquals(ImmutableSet.of(\"\"), dependencyManager.list());\n }", "public void verificarMensagem(String m){\r\n\t\tboolean verificaM =\tmensagem.getText().equals(m);\r\n\t\tAssert.assertTrue(verificaM);\r\n\t\tlogPrint(\"Mensagem apareceu\");\r\n\t}", "public void setXMTM(java.lang.String XMTM) {\r\n this.XMTM = XMTM;\r\n }", "public boolean checkAvailability(Media media) {\n\t\t return false;\n\t }", "@Test\n public void testMCMCWithoutAllelicPoN() {\n final double meanBiasSimulated = 1.2;\n final double biasVarianceSimulated = 0.04;\n testMCMC(meanBiasSimulated, biasVarianceSimulated, meanBiasSimulated, biasVarianceSimulated, AllelicPanelOfNormals.EMPTY_PON);\n }", "public void testGetUMLModelManager() {\n assertSame(\"Failed to get the UMLModelManager.\", manager, instance.getUMLModelManager());\n }", "@Test\n public void testMMI() {\n System.out.println(\"MMI\");\n int a = 0;\n int m = 0;\n int expResult = 0;\n int result = utilsHill.MMI(a, m);\n assertEquals(expResult, result);\n // TODO review the generated test code and remove the default call to fail.\n fail(\"The test case is a prototype.\");\n }", "public boolean hasMcc() {\n return genClient.cacheHasKey(CacheKey.mcc);\n }", "public HelloMIDlet() {\n }", "private void assertLcphMKInstalled(boolean expectedInstalled) throws IOException {\n assertEquals(expectedInstalled, new File(addonSceneryPath, TestData.lcphMKRevision.getRepoPath() + \"/scenery/000_LCPH_FSX.BGL\").exists());\r\n assertEquals(expectedInstalled, new File(addonSceneryPath, TestData.lcphMKRevision.getRepoPath() + \"/scenery/LCPH_ADEX_XX.BGL\").exists());\r\n assertEquals(expectedInstalled, new File(addonSceneryPath, TestData.lcphMKRevision.getRepoPath() + \"/scenery/14_LCPH_lines.bgl\").exists());\r\n if (expectedInstalled) {\r\n assertEquals(868384, new File(addonSceneryPath, TestData.lcphMKRevision.getRepoPath() + \"/scenery/14_LCPH_lines.bgl\").length());\r\n }\r\n assertEquals(expectedInstalled, new File(addonSceneryPath, TestData.lcphMKRevision.getRepoPath() + \"/texture/c172_r.bmp\").exists());\r\n assertEquals(expectedInstalled, new File(fsxRoot + \"/Effects\", \"Cntrl_LCPH_TaxiGreen.fx\").exists());\r\n assertEquals(expectedInstalled, new File(fsxRoot + \"/Effects\", \"fx_LCPH_TaxiGreen.fx\").exists());\r\n\r\n assertEquals(expectedInstalled, testSceneryJson(TestData.lcphMK.getId()));\r\n\r\n assertEquals(expectedInstalled, testSceneryCfg(\"Addon Scenery\\\\LCPH_MaxKraus\"));\r\n }", "private void installArtifacts(ApplicationDescription desc) throws IOException {\n try {\n Tools.copyDirectory(appFile(desc.name(), M2_PREFIX), m2Dir);\n } catch (NoSuchFileException e) {\n log.debug(\"Application {} has no M2 artifacts\", desc.name());\n }\n }", "static void allowAccess(ClassMaker cm) {\n var thisModule = CoreUtils.class.getModule();\n var thatModule = cm.classLoader().getUnnamedModule();\n thisModule.addExports(\"org.cojen.dirmi.core\", thatModule);\n }", "public boolean checkSetup(){\n return checkSetup(folderName);\n }", "public static synchronized void init(Context context, MMXClientConfig config) {\n if (sInstance == null) {\n Log.i(TAG, \"App=\"+context.getPackageName()+\", MMX SDK=\"+BuildConfig.VERSION_NAME+\n \", protocol=\"+Constants.MMX_VERSION_MAJOR+\".\"+Constants.MMX_VERSION_MINOR);\n sInstance = new MMX(context, config);\n } else {\n Log.w(TAG, \"MMX.init(): MMX has already been initialized. Ignoring this call.\");\n }\n MMXClient.registerWakeupListener(context, MMX.MMXWakeupListener.class);\n }", "public void initialize() throws MMDeviceException;", "public void testNullMailet() throws MessagingException {\n setupMockedMail(mockedMimeMessage);\n setupMailet();\n\n mailet.service(mockedMail);\n\n String PROCESSOR = \"ghost\";\n assertEquals(PROCESSOR, mockedMail.getState());\n }", "void installIfNeeded()\n throws Exception;", "public void setMCAservice(java.lang.String MCAservice) {\n this.MCAservice = MCAservice;\n }", "@Before\n public void setUp() throws Exception {\n fs = new MockFileSystem();\n mv = new Mv(fs);\n io = new IO();\n }", "@Override\n\tprotected void checkHardware() {\n\t\tsuper.checkHardware();\n\t}", "public void setCMNservice(java.lang.String CMNservice) {\n this.CMNservice = CMNservice;\n }", "public boolean checkForMASCFailure(MovePath md, Vector<Report> vDesc, HashMap<Integer, CriticalSlot> vCriticals) {\n if (md.hasActiveMASC()) {\n boolean bFailure = false;\n\n // If usedMASC is already set, then we've already checked MASC\n // this turn. If we succeded before, return false.\n // If we failed before, the MASC was destroyed, and we wouldn't\n // have gotten here (hasActiveMASC would return false)\n if (!usedMASC) {\n Mounted masc = getMASC();\n Mounted superCharger = getSuperCharger();\n bFailure = doMASCCheckFor(masc, vDesc, vCriticals);\n boolean bSuperChargeFailure = doMASCCheckFor(superCharger, vDesc, vCriticals);\n return bFailure || bSuperChargeFailure;\n }\n }\n return false;\n }", "private void setMM(int MM) {\n\t\tCMN.MM = MM;\n\t}", "boolean isInstalled();", "public void add(Monom m)\r\n\t{\r\n\t\tif(this._power==m._power)\r\n\t\t{\r\n\t\t\tthis._coefficient+=m._coefficient;\r\n\t\t}\r\n\t\telse\r\n\t\t{\r\n\t\t\tthrow new RuntimeException(\"Cant add Monoms with Different Powers\");\r\n\t\t}\r\n\t}", "public void registerWithRMC()\n\t{\n\t\t// Register with the RMC\n\t\tif(this.rmc.registerLMS(this.location)) {\n\t\t\tthis.log(\"Registered with RMC\");\n\t\t\treturn;\n\t\t}\n\t\t\n\t\tthis.log(\"Failed to register with RMC. Probable name clash.\");\n\t\tSystem.exit(1);\n\t}", "public void testGetManagementSpecVersion() {\n String specVersion = mb.getManagementSpecVersion();\n assertNotNull(specVersion);\n assertTrue(specVersion.length() > 0);\n }", "public static void mmcc() {\n\t}", "protected void install() {\n\t\t//\n\t}", "@Override\n\tprotected void setUp() {\n\t\ttry {\n\t\t\tconsole = new MMAConsole();\n\t\t} catch (Exception e) {\n\t\t\te.printStackTrace();\n\t\t}\n\n\t}", "public static int initProperties() {\n\n\t\t// creating a new conf file if none exists yet\n\t\tPathHelper ph = new PathHelper();\n\t\ttry {\n\t\t\thomeFolder = ph.getMarabouHomeFolder();\n\t\t\tconf = new File(ph.getMarabouHomeFolder() + \"marabou.properties\");\n\t\t} catch (UnknowPlatformException e1) {\n\t\t\tlog.severe(\"Your OS couldn't get detected properly.\\n\"\n\t\t\t\t\t+ \"Please file a bugreport.\");\n\t\t\treturn 1;\n\t\t}\n\t\t// if config is found, check if updates are needed\n\t\tif (conf.exists()) {\n\t\t\tif (!conf.canRead() || !conf.canWrite()) {\n\t\t\t\tlog.severe(\"Couldn't read or write config file.\"\n\t\t\t\t\t\t+ \" Please make sure that your file permissions are set properly.\");\n\t\t\t\treturn 1;\n\t\t\t\t// config is existens and accessable\n\t\t\t} else {\n\t\t\t\ttry {\n\t\t\t\t\tproperties.load(new FileReader(conf.getAbsolutePath()));\n\t\t\t\t} catch (FileNotFoundException e) {\n\n\t\t\t\t\tlog.severe(\"Couldn't find user's config file in path: \"\n\t\t\t\t\t\t\t+ conf.getAbsolutePath());\n\n\t\t\t\t\treturn 1;\n\t\t\t\t} catch (IOException e) {\n\t\t\t\t\tlog.severe(\"Couldn't load config file: \"\n\t\t\t\t\t\t\t+ conf.getAbsolutePath());\n\t\t\t\t\treturn 1;\n\t\t\t\t}\n\t\t\t\tProperties vendorProp = new Properties();\n\n\t\t\t\t// TODO RELEASE replace path with method call of PathHelper (for\n\t\t\t\t// specific OS)\n\n\t\t\t\ttry {\n\t\t\t\t\tvendorProp.load(new FileReader(\n\t\t\t\t\t\t\t\"src/main/resources/marabou.properties\"));\n\t\t\t\t} catch (FileNotFoundException e) {\n\t\t\t\t\tlog.severe(\"Couldn't find vendor config.\");\n\t\t\t\t\treturn 1;\n\t\t\t\t} catch (IOException e) {\n\t\t\t\t\tlog.severe(\"Couldn't open vendor config.\");\n\t\t\t\t\treturn 1;\n\t\t\t\t}\n\t\t\t\t// if the user's conf is older than the current marabou version,\n\t\t\t\t// update the missing entries\n\t\t\t\tif (properties.getProperty(\"version\").compareTo(\n\t\t\t\t\t\tvendorProp.getProperty(\"version\")) < 0) {\n\t\t\t\t\tSet<Object> vendorKeys = vendorProp.keySet();\n\t\t\t\t\tSet<Object> userKeys = properties.keySet();\n\n\t\t\t\t\t// set the latest version in users conf\n\t\t\t\t\tproperties.setProperty(\"version\",\n\t\t\t\t\t\t\tvendorProp.getProperty(\"version\"));\n\n\t\t\t\t\t// copy missing new key/value pairs\n\t\t\t\t\tfor (Object key : vendorKeys) {\n\t\t\t\t\t\tif (!userKeys.contains(key)) {\n\t\t\t\t\t\t\tproperties.put(key, vendorProp.get(key));\n\t\t\t\t\t\t}\n\n\t\t\t\t\t}\n\t\t\t\t\tpersistSettings();\n\t\t\t\t}\n\t\t\t}\n\t\t\t// conf is not existent yet\n\t\t} else {\n\t\t\ttry {\n\t\t\t\tFile mhfFile = new File(homeFolder);\n\t\t\t\t// create foler if no folder exists yet\n\t\t\t\tif (!mhfFile.exists()) {\n\t\t\t\t\tif (!mhfFile.mkdir()) {\n\t\t\t\t\t\tlog.severe(\"Couldn't create marabou folder in your home.\\n\"\n\t\t\t\t\t\t\t\t+ \"Please file a bugreport.\");\n\t\t\t\t\t\treturn 1;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t// create marabou.properties file in new folder\n\t\t\t\tconf.createNewFile();\n\t\t\t} catch (IOException e) {\n\t\t\t\tlog.severe(\"Couldn't create config file, please check your file permission in your home folder.\");\n\t\t\t\treturn 1;\n\t\t\t}\n\t\t\ttry {\n\n\t\t\t\t// TODO RELEASE replace path with method call of PathHelper (for\n\t\t\t\t// specific OS)\n\t\t\t\tBufferedReader vendorConf = new BufferedReader(new FileReader(\n\t\t\t\t\t\t\"src/main/resources/marabou.properties\"));\n\n\t\t\t\tproperties.load(vendorConf);\n\t\t\t\t// copy all entries to the new conf\n\t\t\t\tpersistSettings();\n\t\t\t\tvendorConf.close();\n\t\t\t} catch (IOException e) {\n\t\t\t\tlog.warning(\"Couldn't create config file in \"\n\t\t\t\t\t\t+ System.getProperty(\"user.home\"));\n\t\t\t\tlog.warning(e.toString());\n\t\t\t}\n\t\t}\n\t\treturn 0;\n\t}", "private void setUpMapIfNeeded() {\n if (mMap == null) {\n // Try to obtain the map from the SupportMapFragment.\n mMap = mMapFragment.getMap();\n // Check if we were successful in obtaining the map.\n if (mMap != null) {\n Log.i(TAG, \"Yes, we have a google map...\");\n setUpMap();\n } else {\n // means that Google Service is not available\n form.dispatchErrorOccurredEvent(this, \"setUpMapIfNeeded\",\n ErrorMessages.ERROR_GOOGLE_PLAY_NOT_INSTALLED);\n }\n\n }\n }", "public static synchronized void install() { \n\t\tif (!isInstalled) {\n\t\t\tint position =\n\t\t\t java.security.Security.insertProviderAt (new MSRSACipherProvider(), 1);\n\t\t\tSystem.out.println(\"MSRSACipherProvider installed at position \" + position);\n\t\t}\n\t}", "public static boolean isCdmaSupport() {\n return \"1\".equals(android.os.SystemProperties.get(\"ro.mtk_c2k_support\"));\n }", "public void testGetSystemProperties() {\n Map<String, String> props = mb.getSystemProperties();\n assertNotNull(props);\n assertTrue(props.size() > 0);\n assertTrue(props.size() == System.getProperties().size());\n for (Map.Entry<String, String> entry : props.entrySet()) {\n assertNotNull(entry.getKey());\n assertNotNull(entry.getValue());\n }\n }", "public boolean hasMASC() {\n for (Mounted mEquip : getMisc()) {\n MiscType mtype = (MiscType) mEquip.getType();\n if (mtype.hasFlag(MiscType.F_MASC) && !mEquip.isInoperable()) {\n return true;\n }\n }\n return false;\n }", "public void testGetVmVendor() {\n assertEquals(mb.getVmVendor(), System.getProperty(\"java.vm.vendor\"));\n }", "public void multiply(Monom m){\r\n\t\tint temp_power = this.get_power();\r\n\t\tdouble temp_coaf = this.get_coefficient();\r\n\t\ttemp_power += m.get_power();\r\n\t\ttemp_coaf *= m.get_coefficient();\r\n\t\tthis.set_power(temp_power);\r\n\t\tthis.set_coefficient(temp_coaf);\r\n\t}", "public static boolean canHasModMOD(Context context) {\n return isPackageInstalled(context, MODMOD_PACKAGE);\n }", "@Test\r\n\tpublic void testEmptyContributormanager() {\r\n\t\tcm = Contributormanager.getInstance();\r\n\t\tcm.setContributorsNull();\r\n\t\tassertFalse(cm.addContributor(\"Chris\"));\r\n\t\tassertFalse(cm.removeContributor(\"Chris\"));\r\n\t\tassertFalse(cm.isEmpty());\r\n\t}", "@AnonymousAllowed\n private boolean checkUPMVersion() {\n boolean result = false;\n Plugin plugin = pluginAccessor\n .getPlugin(\"com.atlassian.upm.atlassian-universal-plugin-manager-plugin\");\n if (plugin == null) {\n result = false;\n } else {\n Version upmVersion = Versions.fromPlugin(plugin, false);\n String upmVersion_str = upmVersion.toString();\n StringTokenizer st = new StringTokenizer(upmVersion_str, \".\");\n int first_index = Integer.parseInt((String) st.nextElement());\n if (first_index >= 2) {\n result = true;\n }\n }\n return result;\n }", "@objid (\"fbd51d94-815e-4e48-b896-6fe4c2eb26de\")\n MExpert createMExpert(SmMetamodel mm);", "@SuppressWarnings({ \"static-method\", \"nls\" })\n @Test\n public final void testGetSystemProperty()\n {\n TestEasyPropertiesObject object = new TestEasyPropertiesObject();\n if (object.getOperatingSystemName().isEmpty())\n {\n fail(\"System property: os.name should not be empty!\");\n }\n }", "public boolean setCreditCardExp(String mmyy) {\n if (MPaymentValidate.validateCreditCardExp(mmyy).length() != 0) {\n return false;\n }\n //\n String exp = MPaymentValidate.checkNumeric(mmyy);\n String mmStr = exp.substring(0, 2);\n String yyStr = exp.substring(2, 4);\n setCreditCardExpMM(Integer.parseInt(mmStr));\n setCreditCardExpYY(Integer.parseInt(yyStr));\n return true;\n }", "public void setMtm(double value) {\r\n this.mtm = value;\r\n }", "public final void init() throws Exception {\n // Get the Platform MBean Server\n mbs = MBeanServerFactory.createMBeanServer();\n\n // Construct the ObjectName for the Hello MBean\n name = new ObjectName(\n \"org.apache.harmony.test.func.api.javax.management:type=Hello\");\n\n // Create the Hello MBean\n hello = new Hello();\n\n // Register the Hello MBean\n mbs.registerMBean(hello, name);\n\n // Add notification listener\n mbs.addNotificationListener(name, this, null, \"handback\");\n\n // Wait until the notification is received.\n freeze(3000);\n\n // Invoke sayHello method\n mbs.invoke(name, \"sayHello\", new Object[0], new String[0]);\n }", "@Test\n public void shouldMdcWork() {\n MDC.put(\"first\", \"Dorothy\");\n\n // We now put the last name\n MDC.put(\"last\", \"Parker\");\n\n // The most beautiful two words in the English language according\n // to Dorothy Parker:\n log.info(\"Check enclosed.\");\n log.info(\"The most beautiful two words in English.\");\n\n MDC.put(\"first\", \"Richard\");\n MDC.put(\"last\", \"Nixon\");\n log.info(\"I am not a crook.\");\n log.info(\"Attributed to the former US president. 17 Nov 1973.\");\n }", "public static boolean hasGMS(Context context) {\n return false;\n }", "@Test\n public void testClaimMbi() {\n new ClaimFieldTester()\n .verifyStringFieldCopiedCorrectly(\n FissClaim.Builder::setMbi, RdaFissClaim::getMbi, RdaFissClaim.Fields.mbi, 11)\n .verifyIdHashFieldPopulatedCorrectly(\n FissClaim.Builder::setMbi, RdaFissClaim::getMbiHash, 11, idHasher);\n }", "public void setMc(String mc) {\n this.mc = mc;\n }", "private void checkOperatingSystem()\n throws MojoExecutionException\n {\n final PtOperatingSystem opSystem = PtUserSniffer.getOS();\n final boolean isProperOpSystem = opSystem == PtOperatingSystem.MAC;\n\n this.logger.info( \"Checking operating system '\" + opSystem + \"' ... \" + ( isProperOpSystem ? \"ok\" : \"error\" ) );\n if ( isProperOpSystem == false )\n {\n throw new MojoExecutionException( \"Invalid Operating System '\" + opSystem + \"' (Mac OS X required)!\" );\n }\n }", "@Before\n public void setup()\n {\n assumeFalse(\"No audio devices are available. Skipping...\",\n AudioDetector.getInstance().isNoAudio());\n MusicPlayer.init();\n }", "public void grabarMetaDato (Campo cm) throws IOException\r\n {\r\n cm.fWrite(maestro); \r\n }", "public boolean isSetMarca() {\r\n return this.marca != null;\r\n }", "@Before\n public void setUp() throws MalformedURLException {\n CMISAccess.getInstance().connectToRepo(\n new URL(\"http://localhost:8990/alfresco/api/-default-/cmis/versions/1.1/atom\"), \"-default-\",\n new UserCredentials(\"admin\", \"1234\"));\n ctrl = CMISAccess.getInstance().createResourceController();\n }", "public boolean hasM() {\n return fieldSetFlags()[3];\n }", "@Test\n\tpublic void testaGetMensagem() {\n\t\tAssert.assertEquals(\n\t\t\t\t\"Erro no getMensagem()\",\n\t\t\t\t\"Disciplina 1 eh avaliada com 5 minitestes, eliminando 1 dos mais baixos.\",\n\t\t\t\tminitElimBai_1.getMensagem());\n\t\tAssert.assertEquals(\n\t\t\t\t\"Erro no getMensagem()\",\n\t\t\t\t\"Disciplina 2 eh avaliada com 10 minitestes, eliminando 2 dos mais baixos.\",\n\t\t\t\tminitElimBai_2.getMensagem());\n\t}", "private static void checkSystemProperties() \n\tthrows ArgumentMissingException {\n\n\t\tif (System.getProperty(\"properties\") == null) {\n\t\t\tthrow new ArgumentMissingException(\n\t\t\t\t\t\"Please specify the path to the properties file, \" +\n\t\t\t\"e.g. using -Dproperties=/path/to/file.\");\t\t\t\n\t\t}\n\n\t\tif (System.getProperty(\"gold\") == null) {\n\t\t\tthrow new ArgumentMissingException(\n\t\t\t\t\t\"Please specify the path to the Gold trees, \" +\n\t\t\t\"e.g. using -Dgold=/path/to/file.\");\n\t\t}\n\n\t\tif (System.getProperty(\"test\") == null) {\n\t\t\tthrow new ArgumentMissingException(\n\t\t\t\t\t\"Please specify the path to the Test trees, \" +\n\t\t\t\"e.g. using -Dtest=/path/to/file.\");\n\t\t}\t\t\n\n\t}", "private boolean canMakeSmores() {\n return (Build.VERSION.SDK_INT > Build.VERSION_CODES.LOLLIPOP_MR1);\n }", "public void testStartCM()\n\t{\n\t\tString strCurServerAddress = null;\n\t\tint nCurServerPort = -1;\n\t\tString strNewServerAddress = null;\n\t\tString strNewServerPort = null;\n\t\t\n\t\tstrCurServerAddress = m_clientStub.getServerAddress();\n\t\tnCurServerPort = m_clientStub.getServerPort();\n\t\t\n\t\t// ask the user if he/she would like to change the server info\n\t\tBufferedReader br = new BufferedReader(new InputStreamReader(System.in));\n\t\tSystem.out.println(\"========== start CM\");\n\t\tSystem.out.println(\"current server address: \"+strCurServerAddress);\n\t\tSystem.out.println(\"current server port: \"+nCurServerPort);\n\n\t\tboolean bRet = m_clientStub.startCM();\n\t\tif(!bRet)\n\t\t{\n\t\t\tSystem.err.println(\"CM initialization error!\");\n\t\t\treturn;\n\t\t}\n\t\tloginDS();\n\t}", "@BeforeClass\r\n\tpublic static void setupSystem() {\r\n\t\tSystemActions.logSystemInfo();\r\n\t\tSystemActions.updateSettings();\r\n\t}", "public void addMobilityEventsMme() throws JNCException {\n setLeafValue(Epc.NAMESPACE,\n \"mobility-events-mme\",\n null,\n childrenNames());\n }", "private void setupServiceAndMetadata() throws ServiceException {\n \t\t\tfinal MetadataRetrieve retrieve = getMetadata().getOmeMeta().getRoot();\n \n \t\t\tservice = getContext().getService(OMEXMLService.class);\n \t\t\tfinal OMEXMLMetadata originalOMEMeta = service.getOMEMetadata(retrieve);\n \t\t\toriginalOMEMeta.resolveReferences();\n \n \t\t\tfinal String omexml = service.getOMEXML(originalOMEMeta);\n \t\t\tomeMeta = service.createOMEXMLMetadata(omexml);\n \t\t}", "Boolean mo1305n() {\n throw new UnsupportedOperationException(getClass().getSimpleName());\n }", "@Before\n\tpublic void setUp() {\n\t\tm=new MoteurRPN();\n\t}", "@Before\n\tpublic void setUp() throws Exception {\n\t\tlib.addAll(\"Mushroom_Publishing.txt\");\n\t}", "@Override\n public void isClean(CoffeeMachine coffeeMachine) throws CleanMachineException {\n if (coffeeMachine.getCupsBeforeClean() == 0) {\n throw new CleanMachineException(String.format(\"%s need to clean\", coffeeMachine.getName()));\n }\n }", "IoT_metamodelPackage getIoT_metamodelPackage();", "public boolean containsValidMC() {\n if (getValidMC() == null) {\n return false;\n }\n return true;\n }", "@Test\n public void testLocalCalls() throws Exception {\n MBeanServer server = MBeanJMXAdapter.mbeanServer;\n assertThatThrownBy(\n () -> server.createMBean(\"FakeClassName\", new ObjectName(\"GemFire\", \"name\", \"foo\")))\n .isInstanceOf(ReflectionException.class);\n\n MBeanJMXAdapter adapter = new MBeanJMXAdapter(mock(DistributedMember.class));\n assertThatThrownBy(() -> adapter.registerMBean(mock(DynamicMBean.class),\n new ObjectName(\"MockDomain\", \"name\", \"mock\"), false))\n .isInstanceOf(ManagementException.class);\n }", "public static void ensure() {\n }", "public boolean useMmap() {\n\t\treturn useMmap;\n\t}", "public static void checkReductionWithTypeMois(ReductionContrat reduction, Integer frequence) {\r\n\t\tif (reduction.getTypeValeur().equals(TypeValeur.MOIS) && reduction.getValeur() > frequence) {\r\n\t\t\treduction.setNbUtilisationMax(reduction.getValeur().intValue());\r\n\t\t\treduction.setValeur(new Double(Constants.UN));\r\n\t\t}\r\n\t}", "public static void updateMacheps() {\n MACHEPS = 1;\n do {\n MACHEPS /= 2;\n } while (1 + MACHEPS / 2 != 1);\n }", "public boolean needSetup() {\n\t\treturn needsSetup;\n\t}", "public void testGetVmVersion() {\n assertEquals(mb.getVmVersion(), System.getProperty(\"java.vm.version\"));\n }", "public void setMuser(String muser) {\n this.muser = muser;\n }", "@Override\n\tpublic void setDMO(DmcObject dmo) {\n\t\t\n\t}", "public void testDeployFromHttp() throws Exception {\n\t\t// normally this directory would be created by handleDeployForMcaFile()... but we are bypassing for testing\n\t\tunitTestDir.mkdir();\n\n\t\tHttpURLConnection connection = new MockHttpURLConnection(null);\n\t\tdeployer.handleRemoteMCA(unitTestDir, connection);\n\n\t\tvalidateMcaDeployedToWorkingDir();\n\n\t\t// cleanup temp dir\n\t\tFile tempDir = new File(\"temp\");\n\t\tassertTrue(tempDir.exists());\n\t\tdeployer.deleteDir(tempDir);\n\t\tassertFalse(tempDir.exists());\n\t}", "public static void register(Object mbean, ObjectName objName) {\n try {\n getMBeanServer().registerMBean(mbean, objName);\n }\n catch (InstanceAlreadyExistsException | MBeanRegistrationException | NotCompliantMBeanException e) {\n throw new RuntimeException(e);\n }\n }", "public boolean isMASCUsed() {\n return usedMASC;\n }", "@Override\n public void install() {\n Migrator.migrateIfConfigurationMissing();\n }", "public void setMscid(String mscid) {\n this.mscid = mscid;\n }", "public static boolean isMSJVM() {\n\t\treturn (System.getProperty(\"java.vendor\").indexOf(\"Microsoft\") != -1);\n\t}", "public void checkRequirements() throws TNotFoundEx{\n\t\t\n\t\tArrayList<SimpleEntry> toolsCheck = new ArrayList<>();\n\t\t\n\t\t//adb\n\t\ttoolsCheck.add(new SimpleEntry<String, String>(\"adb\", \"adb devices\"));\n\t\t//sqlite3\n\t\ttoolsCheck.add(new SimpleEntry<String, String>(\"sqlite3\", \"sqlite3 -version\"));\n\t\t//strings\n\t\ttoolsCheck.add(new SimpleEntry<String, String>(\"strings\", \"strings -v\"));\n\t\t\n\t\tboolean pass = this.checkToolOnHost(toolsCheck);\n\t\t\n\t\tif (!pass)\n\t\t\tthrow new TNotFoundEx(\"Missing tools on host: Please install the missing tools and rerun the command\");\n\t}", "@Test public void testLocales() throws Exception\n {\n assumeJvm();\n Locale[] locales = new MPXReader().getSupportedLocales();\n for (Locale locale : locales)\n {\n testLocale(locale);\n }\n }", "public void setMscid(String mscid) {\r\n this.mscid = mscid;\r\n }", "public void setMscid(String mscid) {\r\n this.mscid = mscid;\r\n }", "public void setMscid(String mscid) {\r\n this.mscid = mscid;\r\n }", "public void setMscid(String mscid) {\r\n this.mscid = mscid;\r\n }", "private void initMSDPService() {\n // Connect to DvKit service\n DvKit.getInstance().connect(getApplicationContext(), new IDvKitConnectCallback() {\n // When the DvKit service is successfully connected\n @Override\n public void onConnect(int i) {\n addLog(\"init MSDPService done\");\n // Get Virtual Device Service Instance\n mVirtualDeviceManager = (VirtualDeviceManager) DvKit.getInstance().getKitService(VIRTUAL_DEVICE_CLASS);\n // Register virtual appliance observer\n mVirtualDeviceManager.subscribe(EnumSet.of(VIRTUALDEVICE), observer);\n }\n\n @Override\n public void onDisconnect() {\n\n }\n });\n }" ]
[ "0.56374454", "0.52682865", "0.4988889", "0.48872247", "0.4791279", "0.465429", "0.46340194", "0.46243724", "0.45846826", "0.456157", "0.45055807", "0.4496438", "0.44861534", "0.4476594", "0.4467964", "0.4463681", "0.44584", "0.44117594", "0.44041932", "0.4388551", "0.43813366", "0.43601537", "0.4352338", "0.43445125", "0.43419304", "0.43106437", "0.43019512", "0.43014544", "0.429976", "0.42954016", "0.42940092", "0.4293255", "0.4268999", "0.4268696", "0.42609558", "0.42479494", "0.42399788", "0.4234287", "0.4231225", "0.4225341", "0.42143202", "0.42050648", "0.41988057", "0.41895342", "0.41817588", "0.41746992", "0.41684902", "0.41625383", "0.4161037", "0.41368762", "0.4118587", "0.41122633", "0.41079843", "0.4105669", "0.410247", "0.4088073", "0.40874514", "0.40858182", "0.40798196", "0.4072968", "0.40704545", "0.4063656", "0.40609008", "0.40577793", "0.40575948", "0.40503713", "0.40498677", "0.40355253", "0.40283346", "0.40181267", "0.4009233", "0.40081927", "0.4006152", "0.399891", "0.39966783", "0.3995815", "0.39948505", "0.39948404", "0.3992021", "0.3989095", "0.39890382", "0.3988132", "0.39866218", "0.3972266", "0.39722633", "0.39685404", "0.3967202", "0.39658082", "0.39585572", "0.39551818", "0.39520413", "0.39509273", "0.394956", "0.39489967", "0.39411125", "0.39374313", "0.39334878", "0.39334878", "0.39334878", "0.39334878", "0.39279872" ]
0.0
-1
Make sure mcmmo is installed.
public Construct exec(Target t, Environment environment, Construct... args) throws ConfigRuntimeException { Static.checkPlugin("mcMMO", t); CArray skills = new CArray(t); for (SkillType skillname : SkillType.values()) { CString skill = new CString(skillname.name(), t); skills.push(skill, t); } return skills; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "protected void validateMcaDeployedToWorkingDir() {\n\t\tassertTrue(unitTestDir.exists());\n\t\tassertTrue(new File(unitTestDir, \"composition.groovy\").exists());\n\t\tassertTrue(new File(unitTestDir, \"MCA-INF/components/components.jar\").exists());\n\t\tassertTrue(new File(unitTestDir, \"MCA-INF/promoted/promoted.jar\").exists());\n\t\tassertTrue(new File(unitTestDir, \"MCA-INF/hidden/hidden.jar\").exists());\n\t}", "public void ensureM2EcipseBeingInited()\r\n\t\t\tthrows Exception {\r\n\t\t// TODO: disable this because Maven is not available in V3. Working on solutions later.\r\n\t\t// maybe we can put it in Repo system.\r\n//\t\tBundleContext context = MavenPlugin.getDefault().getBundleContext();\r\n//\t\tMavenPlugin.getDefault().start(context);\r\n//\t\tint state = MavenPlugin.getDefault().getBundle().getState();\r\n//\t\t\r\n//\t\twhile(state != Bundle.ACTIVE) {\r\n//\t\t\tSystem.out.println(\"M2 Eclipse still not started. Sleeping and trying again.\");\r\n//\t\t\tThread.sleep(5000L);\r\n//\t\t\tstate = MavenPlugin.getDefault().getBundle().getState();\r\n//\t\t}\r\n\t}", "public static boolean isInstalled()\n\t{\n\t\treturn PackageUtils.exists(General.PKG_MESSENGERAPI);\n\t}", "@Override\n public void isPmrInstalledAt() throws IOException {\n assumeTrue( !isWindows() );\n super.isPmrInstalledAt();\n }", "public void testGetProperty()\n {\n assertEquals(\"MSM Extension not present, or incorrect specification version -\", MSM_SPECIFICATION_VERSION,\n System.getProperty(MSM_PROPERTY_NAME));\n }", "public final void mM() throws RecognitionException {\n try {\n // /Users/devdatta.kulkarni/Documents/Cassandra/apache-cassandra-0.8.6-src/src/java/org/apache/cassandra/cql/Cql.g:539:11: ( ( 'm' | 'M' ) )\n // /Users/devdatta.kulkarni/Documents/Cassandra/apache-cassandra-0.8.6-src/src/java/org/apache/cassandra/cql/Cql.g:539:13: ( 'm' | 'M' )\n {\n if ( input.LA(1)=='M'||input.LA(1)=='m' ) {\n input.consume();\n\n }\n else {\n MismatchedSetException mse = new MismatchedSetException(null,input);\n recover(mse);\n throw mse;}\n\n\n }\n\n }\n finally {\n }\n }", "private void setupAllMafiosis()\n {\n }", "boolean runNpmInstall();", "public static boolean isMmsCapable(Context context) {\n\t\tTelephonyManager telephonyManager = (TelephonyManager) context\n\t\t\t\t.getSystemService(Context.TELEPHONY_SERVICE);\n\t\tif (telephonyManager == null) {\n\t\t\treturn false;\n\t\t}\n\n\t\ttry {\n\t\t\tClass<?> partypes[] = new Class[0];\n\t\t\tMethod sIsVoiceCapable = TelephonyManager.class.getMethod(\n\t\t\t\t\t\"isVoiceCapable\", partypes);\n\n\t\t\tObject arglist[] = new Object[0];\n\t\t\tObject retobj = sIsVoiceCapable.invoke(telephonyManager, arglist);\n\t\t\treturn (Boolean) retobj;\n\t\t} catch (java.lang.reflect.InvocationTargetException ite) {\n\t\t\t// Failure, must be another device.\n\t\t\t// Assume that it is voice capable.\n\t\t} catch (IllegalAccessException iae) {\n\t\t\t// Failure, must be an other device.\n\t\t\t// Assume that it is voice capable.\n\t\t} catch (NoSuchMethodException nsme) {\n\t\t}\n\t\treturn true;\n\t}", "public final void mM() throws RecognitionException {\n try {\n // /Users/cbinnig/Workspace/DHBW_FirstDB_Loesung3/src/de/dhbw/db2/firstdb/sql/FirstSQL.g:406:11: ( ( 'm' | 'M' ) )\n // /Users/cbinnig/Workspace/DHBW_FirstDB_Loesung3/src/de/dhbw/db2/firstdb/sql/FirstSQL.g:406:12: ( 'm' | 'M' )\n {\n if ( input.LA(1)=='M'||input.LA(1)=='m' ) {\n input.consume();\n\n }\n else {\n MismatchedSetException mse = new MismatchedSetException(null,input);\n recover(mse);\n throw mse;}\n\n\n }\n\n }\n finally {\n }\n }", "@Test\n public void testInstallZeroLength() {\n assertEquals(ImmutableSet.of(\"\"), dependencyManager.install(\"\"));\n assertEquals(ImmutableSet.of(\"\"), dependencyManager.list());\n }", "public void verificarMensagem(String m){\r\n\t\tboolean verificaM =\tmensagem.getText().equals(m);\r\n\t\tAssert.assertTrue(verificaM);\r\n\t\tlogPrint(\"Mensagem apareceu\");\r\n\t}", "public void setXMTM(java.lang.String XMTM) {\r\n this.XMTM = XMTM;\r\n }", "public boolean checkAvailability(Media media) {\n\t\t return false;\n\t }", "@Test\n public void testMCMCWithoutAllelicPoN() {\n final double meanBiasSimulated = 1.2;\n final double biasVarianceSimulated = 0.04;\n testMCMC(meanBiasSimulated, biasVarianceSimulated, meanBiasSimulated, biasVarianceSimulated, AllelicPanelOfNormals.EMPTY_PON);\n }", "public void testGetUMLModelManager() {\n assertSame(\"Failed to get the UMLModelManager.\", manager, instance.getUMLModelManager());\n }", "@Test\n public void testMMI() {\n System.out.println(\"MMI\");\n int a = 0;\n int m = 0;\n int expResult = 0;\n int result = utilsHill.MMI(a, m);\n assertEquals(expResult, result);\n // TODO review the generated test code and remove the default call to fail.\n fail(\"The test case is a prototype.\");\n }", "public boolean hasMcc() {\n return genClient.cacheHasKey(CacheKey.mcc);\n }", "public HelloMIDlet() {\n }", "private void assertLcphMKInstalled(boolean expectedInstalled) throws IOException {\n assertEquals(expectedInstalled, new File(addonSceneryPath, TestData.lcphMKRevision.getRepoPath() + \"/scenery/000_LCPH_FSX.BGL\").exists());\r\n assertEquals(expectedInstalled, new File(addonSceneryPath, TestData.lcphMKRevision.getRepoPath() + \"/scenery/LCPH_ADEX_XX.BGL\").exists());\r\n assertEquals(expectedInstalled, new File(addonSceneryPath, TestData.lcphMKRevision.getRepoPath() + \"/scenery/14_LCPH_lines.bgl\").exists());\r\n if (expectedInstalled) {\r\n assertEquals(868384, new File(addonSceneryPath, TestData.lcphMKRevision.getRepoPath() + \"/scenery/14_LCPH_lines.bgl\").length());\r\n }\r\n assertEquals(expectedInstalled, new File(addonSceneryPath, TestData.lcphMKRevision.getRepoPath() + \"/texture/c172_r.bmp\").exists());\r\n assertEquals(expectedInstalled, new File(fsxRoot + \"/Effects\", \"Cntrl_LCPH_TaxiGreen.fx\").exists());\r\n assertEquals(expectedInstalled, new File(fsxRoot + \"/Effects\", \"fx_LCPH_TaxiGreen.fx\").exists());\r\n\r\n assertEquals(expectedInstalled, testSceneryJson(TestData.lcphMK.getId()));\r\n\r\n assertEquals(expectedInstalled, testSceneryCfg(\"Addon Scenery\\\\LCPH_MaxKraus\"));\r\n }", "private void installArtifacts(ApplicationDescription desc) throws IOException {\n try {\n Tools.copyDirectory(appFile(desc.name(), M2_PREFIX), m2Dir);\n } catch (NoSuchFileException e) {\n log.debug(\"Application {} has no M2 artifacts\", desc.name());\n }\n }", "static void allowAccess(ClassMaker cm) {\n var thisModule = CoreUtils.class.getModule();\n var thatModule = cm.classLoader().getUnnamedModule();\n thisModule.addExports(\"org.cojen.dirmi.core\", thatModule);\n }", "public boolean checkSetup(){\n return checkSetup(folderName);\n }", "public static synchronized void init(Context context, MMXClientConfig config) {\n if (sInstance == null) {\n Log.i(TAG, \"App=\"+context.getPackageName()+\", MMX SDK=\"+BuildConfig.VERSION_NAME+\n \", protocol=\"+Constants.MMX_VERSION_MAJOR+\".\"+Constants.MMX_VERSION_MINOR);\n sInstance = new MMX(context, config);\n } else {\n Log.w(TAG, \"MMX.init(): MMX has already been initialized. Ignoring this call.\");\n }\n MMXClient.registerWakeupListener(context, MMX.MMXWakeupListener.class);\n }", "public void initialize() throws MMDeviceException;", "public void testNullMailet() throws MessagingException {\n setupMockedMail(mockedMimeMessage);\n setupMailet();\n\n mailet.service(mockedMail);\n\n String PROCESSOR = \"ghost\";\n assertEquals(PROCESSOR, mockedMail.getState());\n }", "void installIfNeeded()\n throws Exception;", "public void setMCAservice(java.lang.String MCAservice) {\n this.MCAservice = MCAservice;\n }", "@Before\n public void setUp() throws Exception {\n fs = new MockFileSystem();\n mv = new Mv(fs);\n io = new IO();\n }", "@Override\n\tprotected void checkHardware() {\n\t\tsuper.checkHardware();\n\t}", "public void setCMNservice(java.lang.String CMNservice) {\n this.CMNservice = CMNservice;\n }", "public boolean checkForMASCFailure(MovePath md, Vector<Report> vDesc, HashMap<Integer, CriticalSlot> vCriticals) {\n if (md.hasActiveMASC()) {\n boolean bFailure = false;\n\n // If usedMASC is already set, then we've already checked MASC\n // this turn. If we succeded before, return false.\n // If we failed before, the MASC was destroyed, and we wouldn't\n // have gotten here (hasActiveMASC would return false)\n if (!usedMASC) {\n Mounted masc = getMASC();\n Mounted superCharger = getSuperCharger();\n bFailure = doMASCCheckFor(masc, vDesc, vCriticals);\n boolean bSuperChargeFailure = doMASCCheckFor(superCharger, vDesc, vCriticals);\n return bFailure || bSuperChargeFailure;\n }\n }\n return false;\n }", "private void setMM(int MM) {\n\t\tCMN.MM = MM;\n\t}", "boolean isInstalled();", "public void add(Monom m)\r\n\t{\r\n\t\tif(this._power==m._power)\r\n\t\t{\r\n\t\t\tthis._coefficient+=m._coefficient;\r\n\t\t}\r\n\t\telse\r\n\t\t{\r\n\t\t\tthrow new RuntimeException(\"Cant add Monoms with Different Powers\");\r\n\t\t}\r\n\t}", "public void registerWithRMC()\n\t{\n\t\t// Register with the RMC\n\t\tif(this.rmc.registerLMS(this.location)) {\n\t\t\tthis.log(\"Registered with RMC\");\n\t\t\treturn;\n\t\t}\n\t\t\n\t\tthis.log(\"Failed to register with RMC. Probable name clash.\");\n\t\tSystem.exit(1);\n\t}", "public void testGetManagementSpecVersion() {\n String specVersion = mb.getManagementSpecVersion();\n assertNotNull(specVersion);\n assertTrue(specVersion.length() > 0);\n }", "public static void mmcc() {\n\t}", "protected void install() {\n\t\t//\n\t}", "@Override\n\tprotected void setUp() {\n\t\ttry {\n\t\t\tconsole = new MMAConsole();\n\t\t} catch (Exception e) {\n\t\t\te.printStackTrace();\n\t\t}\n\n\t}", "public static int initProperties() {\n\n\t\t// creating a new conf file if none exists yet\n\t\tPathHelper ph = new PathHelper();\n\t\ttry {\n\t\t\thomeFolder = ph.getMarabouHomeFolder();\n\t\t\tconf = new File(ph.getMarabouHomeFolder() + \"marabou.properties\");\n\t\t} catch (UnknowPlatformException e1) {\n\t\t\tlog.severe(\"Your OS couldn't get detected properly.\\n\"\n\t\t\t\t\t+ \"Please file a bugreport.\");\n\t\t\treturn 1;\n\t\t}\n\t\t// if config is found, check if updates are needed\n\t\tif (conf.exists()) {\n\t\t\tif (!conf.canRead() || !conf.canWrite()) {\n\t\t\t\tlog.severe(\"Couldn't read or write config file.\"\n\t\t\t\t\t\t+ \" Please make sure that your file permissions are set properly.\");\n\t\t\t\treturn 1;\n\t\t\t\t// config is existens and accessable\n\t\t\t} else {\n\t\t\t\ttry {\n\t\t\t\t\tproperties.load(new FileReader(conf.getAbsolutePath()));\n\t\t\t\t} catch (FileNotFoundException e) {\n\n\t\t\t\t\tlog.severe(\"Couldn't find user's config file in path: \"\n\t\t\t\t\t\t\t+ conf.getAbsolutePath());\n\n\t\t\t\t\treturn 1;\n\t\t\t\t} catch (IOException e) {\n\t\t\t\t\tlog.severe(\"Couldn't load config file: \"\n\t\t\t\t\t\t\t+ conf.getAbsolutePath());\n\t\t\t\t\treturn 1;\n\t\t\t\t}\n\t\t\t\tProperties vendorProp = new Properties();\n\n\t\t\t\t// TODO RELEASE replace path with method call of PathHelper (for\n\t\t\t\t// specific OS)\n\n\t\t\t\ttry {\n\t\t\t\t\tvendorProp.load(new FileReader(\n\t\t\t\t\t\t\t\"src/main/resources/marabou.properties\"));\n\t\t\t\t} catch (FileNotFoundException e) {\n\t\t\t\t\tlog.severe(\"Couldn't find vendor config.\");\n\t\t\t\t\treturn 1;\n\t\t\t\t} catch (IOException e) {\n\t\t\t\t\tlog.severe(\"Couldn't open vendor config.\");\n\t\t\t\t\treturn 1;\n\t\t\t\t}\n\t\t\t\t// if the user's conf is older than the current marabou version,\n\t\t\t\t// update the missing entries\n\t\t\t\tif (properties.getProperty(\"version\").compareTo(\n\t\t\t\t\t\tvendorProp.getProperty(\"version\")) < 0) {\n\t\t\t\t\tSet<Object> vendorKeys = vendorProp.keySet();\n\t\t\t\t\tSet<Object> userKeys = properties.keySet();\n\n\t\t\t\t\t// set the latest version in users conf\n\t\t\t\t\tproperties.setProperty(\"version\",\n\t\t\t\t\t\t\tvendorProp.getProperty(\"version\"));\n\n\t\t\t\t\t// copy missing new key/value pairs\n\t\t\t\t\tfor (Object key : vendorKeys) {\n\t\t\t\t\t\tif (!userKeys.contains(key)) {\n\t\t\t\t\t\t\tproperties.put(key, vendorProp.get(key));\n\t\t\t\t\t\t}\n\n\t\t\t\t\t}\n\t\t\t\t\tpersistSettings();\n\t\t\t\t}\n\t\t\t}\n\t\t\t// conf is not existent yet\n\t\t} else {\n\t\t\ttry {\n\t\t\t\tFile mhfFile = new File(homeFolder);\n\t\t\t\t// create foler if no folder exists yet\n\t\t\t\tif (!mhfFile.exists()) {\n\t\t\t\t\tif (!mhfFile.mkdir()) {\n\t\t\t\t\t\tlog.severe(\"Couldn't create marabou folder in your home.\\n\"\n\t\t\t\t\t\t\t\t+ \"Please file a bugreport.\");\n\t\t\t\t\t\treturn 1;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t// create marabou.properties file in new folder\n\t\t\t\tconf.createNewFile();\n\t\t\t} catch (IOException e) {\n\t\t\t\tlog.severe(\"Couldn't create config file, please check your file permission in your home folder.\");\n\t\t\t\treturn 1;\n\t\t\t}\n\t\t\ttry {\n\n\t\t\t\t// TODO RELEASE replace path with method call of PathHelper (for\n\t\t\t\t// specific OS)\n\t\t\t\tBufferedReader vendorConf = new BufferedReader(new FileReader(\n\t\t\t\t\t\t\"src/main/resources/marabou.properties\"));\n\n\t\t\t\tproperties.load(vendorConf);\n\t\t\t\t// copy all entries to the new conf\n\t\t\t\tpersistSettings();\n\t\t\t\tvendorConf.close();\n\t\t\t} catch (IOException e) {\n\t\t\t\tlog.warning(\"Couldn't create config file in \"\n\t\t\t\t\t\t+ System.getProperty(\"user.home\"));\n\t\t\t\tlog.warning(e.toString());\n\t\t\t}\n\t\t}\n\t\treturn 0;\n\t}", "private void setUpMapIfNeeded() {\n if (mMap == null) {\n // Try to obtain the map from the SupportMapFragment.\n mMap = mMapFragment.getMap();\n // Check if we were successful in obtaining the map.\n if (mMap != null) {\n Log.i(TAG, \"Yes, we have a google map...\");\n setUpMap();\n } else {\n // means that Google Service is not available\n form.dispatchErrorOccurredEvent(this, \"setUpMapIfNeeded\",\n ErrorMessages.ERROR_GOOGLE_PLAY_NOT_INSTALLED);\n }\n\n }\n }", "public static synchronized void install() { \n\t\tif (!isInstalled) {\n\t\t\tint position =\n\t\t\t java.security.Security.insertProviderAt (new MSRSACipherProvider(), 1);\n\t\t\tSystem.out.println(\"MSRSACipherProvider installed at position \" + position);\n\t\t}\n\t}", "public static boolean isCdmaSupport() {\n return \"1\".equals(android.os.SystemProperties.get(\"ro.mtk_c2k_support\"));\n }", "public void testGetSystemProperties() {\n Map<String, String> props = mb.getSystemProperties();\n assertNotNull(props);\n assertTrue(props.size() > 0);\n assertTrue(props.size() == System.getProperties().size());\n for (Map.Entry<String, String> entry : props.entrySet()) {\n assertNotNull(entry.getKey());\n assertNotNull(entry.getValue());\n }\n }", "public boolean hasMASC() {\n for (Mounted mEquip : getMisc()) {\n MiscType mtype = (MiscType) mEquip.getType();\n if (mtype.hasFlag(MiscType.F_MASC) && !mEquip.isInoperable()) {\n return true;\n }\n }\n return false;\n }", "public void testGetVmVendor() {\n assertEquals(mb.getVmVendor(), System.getProperty(\"java.vm.vendor\"));\n }", "public void multiply(Monom m){\r\n\t\tint temp_power = this.get_power();\r\n\t\tdouble temp_coaf = this.get_coefficient();\r\n\t\ttemp_power += m.get_power();\r\n\t\ttemp_coaf *= m.get_coefficient();\r\n\t\tthis.set_power(temp_power);\r\n\t\tthis.set_coefficient(temp_coaf);\r\n\t}", "public static boolean canHasModMOD(Context context) {\n return isPackageInstalled(context, MODMOD_PACKAGE);\n }", "@Test\r\n\tpublic void testEmptyContributormanager() {\r\n\t\tcm = Contributormanager.getInstance();\r\n\t\tcm.setContributorsNull();\r\n\t\tassertFalse(cm.addContributor(\"Chris\"));\r\n\t\tassertFalse(cm.removeContributor(\"Chris\"));\r\n\t\tassertFalse(cm.isEmpty());\r\n\t}", "@AnonymousAllowed\n private boolean checkUPMVersion() {\n boolean result = false;\n Plugin plugin = pluginAccessor\n .getPlugin(\"com.atlassian.upm.atlassian-universal-plugin-manager-plugin\");\n if (plugin == null) {\n result = false;\n } else {\n Version upmVersion = Versions.fromPlugin(plugin, false);\n String upmVersion_str = upmVersion.toString();\n StringTokenizer st = new StringTokenizer(upmVersion_str, \".\");\n int first_index = Integer.parseInt((String) st.nextElement());\n if (first_index >= 2) {\n result = true;\n }\n }\n return result;\n }", "@objid (\"fbd51d94-815e-4e48-b896-6fe4c2eb26de\")\n MExpert createMExpert(SmMetamodel mm);", "@SuppressWarnings({ \"static-method\", \"nls\" })\n @Test\n public final void testGetSystemProperty()\n {\n TestEasyPropertiesObject object = new TestEasyPropertiesObject();\n if (object.getOperatingSystemName().isEmpty())\n {\n fail(\"System property: os.name should not be empty!\");\n }\n }", "public boolean setCreditCardExp(String mmyy) {\n if (MPaymentValidate.validateCreditCardExp(mmyy).length() != 0) {\n return false;\n }\n //\n String exp = MPaymentValidate.checkNumeric(mmyy);\n String mmStr = exp.substring(0, 2);\n String yyStr = exp.substring(2, 4);\n setCreditCardExpMM(Integer.parseInt(mmStr));\n setCreditCardExpYY(Integer.parseInt(yyStr));\n return true;\n }", "public void setMtm(double value) {\r\n this.mtm = value;\r\n }", "public final void init() throws Exception {\n // Get the Platform MBean Server\n mbs = MBeanServerFactory.createMBeanServer();\n\n // Construct the ObjectName for the Hello MBean\n name = new ObjectName(\n \"org.apache.harmony.test.func.api.javax.management:type=Hello\");\n\n // Create the Hello MBean\n hello = new Hello();\n\n // Register the Hello MBean\n mbs.registerMBean(hello, name);\n\n // Add notification listener\n mbs.addNotificationListener(name, this, null, \"handback\");\n\n // Wait until the notification is received.\n freeze(3000);\n\n // Invoke sayHello method\n mbs.invoke(name, \"sayHello\", new Object[0], new String[0]);\n }", "@Test\n public void shouldMdcWork() {\n MDC.put(\"first\", \"Dorothy\");\n\n // We now put the last name\n MDC.put(\"last\", \"Parker\");\n\n // The most beautiful two words in the English language according\n // to Dorothy Parker:\n log.info(\"Check enclosed.\");\n log.info(\"The most beautiful two words in English.\");\n\n MDC.put(\"first\", \"Richard\");\n MDC.put(\"last\", \"Nixon\");\n log.info(\"I am not a crook.\");\n log.info(\"Attributed to the former US president. 17 Nov 1973.\");\n }", "public static boolean hasGMS(Context context) {\n return false;\n }", "@Test\n public void testClaimMbi() {\n new ClaimFieldTester()\n .verifyStringFieldCopiedCorrectly(\n FissClaim.Builder::setMbi, RdaFissClaim::getMbi, RdaFissClaim.Fields.mbi, 11)\n .verifyIdHashFieldPopulatedCorrectly(\n FissClaim.Builder::setMbi, RdaFissClaim::getMbiHash, 11, idHasher);\n }", "public void setMc(String mc) {\n this.mc = mc;\n }", "private void checkOperatingSystem()\n throws MojoExecutionException\n {\n final PtOperatingSystem opSystem = PtUserSniffer.getOS();\n final boolean isProperOpSystem = opSystem == PtOperatingSystem.MAC;\n\n this.logger.info( \"Checking operating system '\" + opSystem + \"' ... \" + ( isProperOpSystem ? \"ok\" : \"error\" ) );\n if ( isProperOpSystem == false )\n {\n throw new MojoExecutionException( \"Invalid Operating System '\" + opSystem + \"' (Mac OS X required)!\" );\n }\n }", "@Before\n public void setup()\n {\n assumeFalse(\"No audio devices are available. Skipping...\",\n AudioDetector.getInstance().isNoAudio());\n MusicPlayer.init();\n }", "public void grabarMetaDato (Campo cm) throws IOException\r\n {\r\n cm.fWrite(maestro); \r\n }", "public boolean isSetMarca() {\r\n return this.marca != null;\r\n }", "@Before\n public void setUp() throws MalformedURLException {\n CMISAccess.getInstance().connectToRepo(\n new URL(\"http://localhost:8990/alfresco/api/-default-/cmis/versions/1.1/atom\"), \"-default-\",\n new UserCredentials(\"admin\", \"1234\"));\n ctrl = CMISAccess.getInstance().createResourceController();\n }", "public boolean hasM() {\n return fieldSetFlags()[3];\n }", "@Test\n\tpublic void testaGetMensagem() {\n\t\tAssert.assertEquals(\n\t\t\t\t\"Erro no getMensagem()\",\n\t\t\t\t\"Disciplina 1 eh avaliada com 5 minitestes, eliminando 1 dos mais baixos.\",\n\t\t\t\tminitElimBai_1.getMensagem());\n\t\tAssert.assertEquals(\n\t\t\t\t\"Erro no getMensagem()\",\n\t\t\t\t\"Disciplina 2 eh avaliada com 10 minitestes, eliminando 2 dos mais baixos.\",\n\t\t\t\tminitElimBai_2.getMensagem());\n\t}", "private static void checkSystemProperties() \n\tthrows ArgumentMissingException {\n\n\t\tif (System.getProperty(\"properties\") == null) {\n\t\t\tthrow new ArgumentMissingException(\n\t\t\t\t\t\"Please specify the path to the properties file, \" +\n\t\t\t\"e.g. using -Dproperties=/path/to/file.\");\t\t\t\n\t\t}\n\n\t\tif (System.getProperty(\"gold\") == null) {\n\t\t\tthrow new ArgumentMissingException(\n\t\t\t\t\t\"Please specify the path to the Gold trees, \" +\n\t\t\t\"e.g. using -Dgold=/path/to/file.\");\n\t\t}\n\n\t\tif (System.getProperty(\"test\") == null) {\n\t\t\tthrow new ArgumentMissingException(\n\t\t\t\t\t\"Please specify the path to the Test trees, \" +\n\t\t\t\"e.g. using -Dtest=/path/to/file.\");\n\t\t}\t\t\n\n\t}", "private boolean canMakeSmores() {\n return (Build.VERSION.SDK_INT > Build.VERSION_CODES.LOLLIPOP_MR1);\n }", "public void testStartCM()\n\t{\n\t\tString strCurServerAddress = null;\n\t\tint nCurServerPort = -1;\n\t\tString strNewServerAddress = null;\n\t\tString strNewServerPort = null;\n\t\t\n\t\tstrCurServerAddress = m_clientStub.getServerAddress();\n\t\tnCurServerPort = m_clientStub.getServerPort();\n\t\t\n\t\t// ask the user if he/she would like to change the server info\n\t\tBufferedReader br = new BufferedReader(new InputStreamReader(System.in));\n\t\tSystem.out.println(\"========== start CM\");\n\t\tSystem.out.println(\"current server address: \"+strCurServerAddress);\n\t\tSystem.out.println(\"current server port: \"+nCurServerPort);\n\n\t\tboolean bRet = m_clientStub.startCM();\n\t\tif(!bRet)\n\t\t{\n\t\t\tSystem.err.println(\"CM initialization error!\");\n\t\t\treturn;\n\t\t}\n\t\tloginDS();\n\t}", "@BeforeClass\r\n\tpublic static void setupSystem() {\r\n\t\tSystemActions.logSystemInfo();\r\n\t\tSystemActions.updateSettings();\r\n\t}", "public void addMobilityEventsMme() throws JNCException {\n setLeafValue(Epc.NAMESPACE,\n \"mobility-events-mme\",\n null,\n childrenNames());\n }", "private void setupServiceAndMetadata() throws ServiceException {\n \t\t\tfinal MetadataRetrieve retrieve = getMetadata().getOmeMeta().getRoot();\n \n \t\t\tservice = getContext().getService(OMEXMLService.class);\n \t\t\tfinal OMEXMLMetadata originalOMEMeta = service.getOMEMetadata(retrieve);\n \t\t\toriginalOMEMeta.resolveReferences();\n \n \t\t\tfinal String omexml = service.getOMEXML(originalOMEMeta);\n \t\t\tomeMeta = service.createOMEXMLMetadata(omexml);\n \t\t}", "Boolean mo1305n() {\n throw new UnsupportedOperationException(getClass().getSimpleName());\n }", "@Before\n\tpublic void setUp() {\n\t\tm=new MoteurRPN();\n\t}", "@Before\n\tpublic void setUp() throws Exception {\n\t\tlib.addAll(\"Mushroom_Publishing.txt\");\n\t}", "@Override\n public void isClean(CoffeeMachine coffeeMachine) throws CleanMachineException {\n if (coffeeMachine.getCupsBeforeClean() == 0) {\n throw new CleanMachineException(String.format(\"%s need to clean\", coffeeMachine.getName()));\n }\n }", "IoT_metamodelPackage getIoT_metamodelPackage();", "public boolean containsValidMC() {\n if (getValidMC() == null) {\n return false;\n }\n return true;\n }", "@Test\n public void testLocalCalls() throws Exception {\n MBeanServer server = MBeanJMXAdapter.mbeanServer;\n assertThatThrownBy(\n () -> server.createMBean(\"FakeClassName\", new ObjectName(\"GemFire\", \"name\", \"foo\")))\n .isInstanceOf(ReflectionException.class);\n\n MBeanJMXAdapter adapter = new MBeanJMXAdapter(mock(DistributedMember.class));\n assertThatThrownBy(() -> adapter.registerMBean(mock(DynamicMBean.class),\n new ObjectName(\"MockDomain\", \"name\", \"mock\"), false))\n .isInstanceOf(ManagementException.class);\n }", "public static void ensure() {\n }", "public boolean useMmap() {\n\t\treturn useMmap;\n\t}", "public static void checkReductionWithTypeMois(ReductionContrat reduction, Integer frequence) {\r\n\t\tif (reduction.getTypeValeur().equals(TypeValeur.MOIS) && reduction.getValeur() > frequence) {\r\n\t\t\treduction.setNbUtilisationMax(reduction.getValeur().intValue());\r\n\t\t\treduction.setValeur(new Double(Constants.UN));\r\n\t\t}\r\n\t}", "public static void updateMacheps() {\n MACHEPS = 1;\n do {\n MACHEPS /= 2;\n } while (1 + MACHEPS / 2 != 1);\n }", "public boolean needSetup() {\n\t\treturn needsSetup;\n\t}", "public void testGetVmVersion() {\n assertEquals(mb.getVmVersion(), System.getProperty(\"java.vm.version\"));\n }", "public void setMuser(String muser) {\n this.muser = muser;\n }", "@Override\n\tpublic void setDMO(DmcObject dmo) {\n\t\t\n\t}", "public void testDeployFromHttp() throws Exception {\n\t\t// normally this directory would be created by handleDeployForMcaFile()... but we are bypassing for testing\n\t\tunitTestDir.mkdir();\n\n\t\tHttpURLConnection connection = new MockHttpURLConnection(null);\n\t\tdeployer.handleRemoteMCA(unitTestDir, connection);\n\n\t\tvalidateMcaDeployedToWorkingDir();\n\n\t\t// cleanup temp dir\n\t\tFile tempDir = new File(\"temp\");\n\t\tassertTrue(tempDir.exists());\n\t\tdeployer.deleteDir(tempDir);\n\t\tassertFalse(tempDir.exists());\n\t}", "public static void register(Object mbean, ObjectName objName) {\n try {\n getMBeanServer().registerMBean(mbean, objName);\n }\n catch (InstanceAlreadyExistsException | MBeanRegistrationException | NotCompliantMBeanException e) {\n throw new RuntimeException(e);\n }\n }", "public boolean isMASCUsed() {\n return usedMASC;\n }", "@Override\n public void install() {\n Migrator.migrateIfConfigurationMissing();\n }", "public void setMscid(String mscid) {\n this.mscid = mscid;\n }", "public static boolean isMSJVM() {\n\t\treturn (System.getProperty(\"java.vendor\").indexOf(\"Microsoft\") != -1);\n\t}", "public void checkRequirements() throws TNotFoundEx{\n\t\t\n\t\tArrayList<SimpleEntry> toolsCheck = new ArrayList<>();\n\t\t\n\t\t//adb\n\t\ttoolsCheck.add(new SimpleEntry<String, String>(\"adb\", \"adb devices\"));\n\t\t//sqlite3\n\t\ttoolsCheck.add(new SimpleEntry<String, String>(\"sqlite3\", \"sqlite3 -version\"));\n\t\t//strings\n\t\ttoolsCheck.add(new SimpleEntry<String, String>(\"strings\", \"strings -v\"));\n\t\t\n\t\tboolean pass = this.checkToolOnHost(toolsCheck);\n\t\t\n\t\tif (!pass)\n\t\t\tthrow new TNotFoundEx(\"Missing tools on host: Please install the missing tools and rerun the command\");\n\t}", "@Test public void testLocales() throws Exception\n {\n assumeJvm();\n Locale[] locales = new MPXReader().getSupportedLocales();\n for (Locale locale : locales)\n {\n testLocale(locale);\n }\n }", "public void setMscid(String mscid) {\r\n this.mscid = mscid;\r\n }", "public void setMscid(String mscid) {\r\n this.mscid = mscid;\r\n }", "public void setMscid(String mscid) {\r\n this.mscid = mscid;\r\n }", "public void setMscid(String mscid) {\r\n this.mscid = mscid;\r\n }", "private void initMSDPService() {\n // Connect to DvKit service\n DvKit.getInstance().connect(getApplicationContext(), new IDvKitConnectCallback() {\n // When the DvKit service is successfully connected\n @Override\n public void onConnect(int i) {\n addLog(\"init MSDPService done\");\n // Get Virtual Device Service Instance\n mVirtualDeviceManager = (VirtualDeviceManager) DvKit.getInstance().getKitService(VIRTUAL_DEVICE_CLASS);\n // Register virtual appliance observer\n mVirtualDeviceManager.subscribe(EnumSet.of(VIRTUALDEVICE), observer);\n }\n\n @Override\n public void onDisconnect() {\n\n }\n });\n }" ]
[ "0.56374454", "0.52682865", "0.4988889", "0.48872247", "0.4791279", "0.465429", "0.46340194", "0.46243724", "0.45846826", "0.456157", "0.45055807", "0.4496438", "0.44861534", "0.4476594", "0.4467964", "0.4463681", "0.44584", "0.44117594", "0.44041932", "0.4388551", "0.43813366", "0.43601537", "0.4352338", "0.43445125", "0.43419304", "0.43106437", "0.43019512", "0.43014544", "0.429976", "0.42954016", "0.42940092", "0.4293255", "0.4268999", "0.4268696", "0.42609558", "0.42479494", "0.42399788", "0.4234287", "0.4231225", "0.4225341", "0.42143202", "0.42050648", "0.41988057", "0.41895342", "0.41817588", "0.41746992", "0.41684902", "0.41625383", "0.4161037", "0.41368762", "0.4118587", "0.41122633", "0.41079843", "0.4105669", "0.410247", "0.4088073", "0.40874514", "0.40858182", "0.40798196", "0.4072968", "0.40704545", "0.4063656", "0.40609008", "0.40577793", "0.40575948", "0.40503713", "0.40498677", "0.40355253", "0.40283346", "0.40181267", "0.4009233", "0.40081927", "0.4006152", "0.399891", "0.39966783", "0.3995815", "0.39948505", "0.39948404", "0.3992021", "0.3989095", "0.39890382", "0.3988132", "0.39866218", "0.3972266", "0.39722633", "0.39685404", "0.3967202", "0.39658082", "0.39585572", "0.39551818", "0.39520413", "0.39509273", "0.394956", "0.39489967", "0.39411125", "0.39374313", "0.39334878", "0.39334878", "0.39334878", "0.39334878", "0.39279872" ]
0.0
-1
Translate the SimpleSSBNNode's for the SSBNNode and add the informations about parents (context node correspondent SSBNNode parents too) The SimpleSSBNNode was created for economize memory in the step of build the network. For posterior steps, how generation of the CPTs, is necessary more informations that the information offer by the SimpleSSBNNode. The SSBNNode contain all the information necessary.
public static List<SSBNNode> translateSimpleSSBNNodeListToSSBNNodeList( List<SimpleSSBNNode> simpleSSBNNodeList, ProbabilisticNetwork pn) throws SSBNNodeGeneralException, ImplementationRestrictionException{ List<SSBNNode> listSSBNNodes = new ArrayList<SSBNNode>(); correspondencyMap = new HashMap<SimpleSSBNNode, SSBNNode>(); Map<ContextNode, ContextFatherSSBNNode> mapContextNode = new HashMap<ContextNode, ContextFatherSSBNNode>(); //1 Create all nodes with its states for(SimpleSSBNNode simple: simpleSSBNNodeList){ SSBNNode ssbnNode = SSBNNode.getInstance(pn, simple.getResidentNode()); correspondencyMap.put(simple, ssbnNode); listSSBNNodes.add(ssbnNode); //Arguments. for(int i = 0; i < simple.getOvArray().length; i++){ OVInstance ovInstance = OVInstance.getInstance( simple.getOvArray()[i], simple.getEntityArray()[i]); ssbnNode.addArgument(ovInstance); } //Finding. if(simple.isFinding()){ ssbnNode.setValue(simple.getState()); } //Default distribution if(simple.isDefaultDistribution()){ ssbnNode.setUsingDefaultCPT(true); } ssbnNode.setPermanent(true); //The values of the ordinary variables are different depending in //which MFrag we are dealing. //The key for do the match is the order of the arguments. The order //should be the same in every MFrags of the node. //Lets deal first with Resident MFrag OrdinaryVariable[] residentOvArray = ssbnNode.getResident().getOrdinaryVariableList().toArray( new OrdinaryVariable[ssbnNode.getResident().getOrdinaryVariableList().size()] ); List<OVInstance> argumentsForResidentMFrag = new ArrayList<OVInstance>(); for(int i = 0; i < residentOvArray.length; i++){ OVInstance ovInstance = OVInstance.getInstance(residentOvArray[i], simple.getEntityArray()[i]); argumentsForResidentMFrag.add(ovInstance); } ssbnNode.addArgumentsForMFrag( ssbnNode.getResident().getMFrag(), argumentsForResidentMFrag); // Lets map OVs of every input node pointing to current SSBNNode for(InputNode inputNode: simple.getResidentNode().getInputInstanceFromList()){ OrdinaryVariable[] ovArray = inputNode.getResidentNodePointer().getOrdinaryVariableArray(); List<OVInstance> argumentsForMFrag = new ArrayList<OVInstance>(); // OLD CODE // for(int i = 0; i < ovArray.length; i++){ // OVInstance ovInstance = OVInstance.getInstance(ovArray[i], simple.getEntityArray()[i]); // argumentsForMFrag.add(ovInstance); // } // NEW CODE if( ! (simple.getOvArrayForMFrag(inputNode.getMFrag()) == null )){ for(int i = 0; i < ovArray.length; i++){ OrdinaryVariable ov = simple.getOvArrayForMFrag(inputNode.getMFrag())[i]; OVInstance ovInstance = OVInstance.getInstance(ov,simple.getEntityArray()[i]); argumentsForMFrag.add(ovInstance); } }else{ //TODO This is an old bug... when we don't have an input instance of the node, we won't have a MFrag Instance // for it... what makes the throws one exception. for(int i = 0; i < ovArray.length; i++){ OVInstance ovInstance = OVInstance.getInstance(ovArray[i], simple.getEntityArray()[i]); argumentsForMFrag.add(ovInstance); } } ssbnNode.addArgumentsForMFrag( inputNode.getMFrag(), argumentsForMFrag); } //Treat the context node father List<SimpleContextNodeFatherSSBNNode> simpleContextNodeList = simple.getContextParents(); if(simpleContextNodeList.size() > 0){ if(simpleContextNodeList.size() > 1){ throw new ImplementationRestrictionException( ImplementationRestrictionException.MORE_THAN_ONE_CTXT_NODE_SEARCH); }else{ //We have only one context node father ContextNode contextNode = simpleContextNodeList.get(0).getContextNode(); ContextFatherSSBNNode contextFather = mapContextNode.get(contextNode); if(contextFather == null){ contextFather = new ContextFatherSSBNNode(pn, contextNode, new ProbabilisticNode(), simpleContextNodeList.get(0).getOvProblematic(), simple.getMFragInstance().getOVInstanceList()); List<ILiteralEntityInstance> possibleValueList = new ArrayList<ILiteralEntityInstance>(); for(String entity: simpleContextNodeList.get(0).getPossibleValues()){ possibleValueList.add(LiteralEntityInstance.getInstance( entity, simpleContextNodeList.get(0).getOvProblematic().getValueType())); } for(ILiteralEntityInstance lei: possibleValueList){ contextFather.addPossibleValue(lei); } // contextFather.setOvProblematic(simpleContextNodeList.get(0).getOvProblematic()); mapContextNode.put(contextNode, contextFather); } try { ssbnNode.setContextFatherSSBNNode(contextFather); } catch (InvalidParentException e) { //This exception don't occur in this case... e.printStackTrace(); throw new RuntimeException(e.getMessage()); } } } if (simple.isNodeInAVirualChain()) { // change the name of chain nodes ssbnNode.getProbNode().setName("Chain"+ simple.getStepsForChainNodeToReachMainNode() + "_" + ssbnNode.getProbNode().getName()); Debug.println(ssbnNode.getProbNode().getName()); } simple.setProbNode(ssbnNode.getProbNode()); } //Create the parent structure for(SimpleSSBNNode simple: simpleSSBNNodeList){ // if(simple.getParents().size()==0){ // if(simple.getChildNodes().size()==0){ // continue; //This node is out of the network. // } // } SSBNNode ssbnNode = correspondencyMap.get(simple); for(SimpleSSBNNode parent: simple.getParents()){ SSBNNode parentSSBNNode = correspondencyMap.get(parent); ssbnNode.addParent(parentSSBNNode, false); } } return listSSBNNodes; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private void buildParentTransformAndSourceNode(TransformNode transformNode, Map<String, Object> parentsIdMap) {\n for (Map.Entry<String, Object> entry : parentsIdMap.entrySet()) {\n String tmpNodeId = entry.getKey();\n //heads shouldn't have self dependency id in it\n if (heads.contains(tmpNodeId)\n && this.sourceNodes.containsKey(tmpNodeId)) {\n transformNode.getParents().add(this.sourceNodes.get(tmpNodeId));\n } else if (heads.contains(tmpNodeId)\n && !this.sourceNodes.containsKey(tmpNodeId)\n && !this.staticTable.contains(tmpNodeId)) {\n Map<String, Object> sourceNodeConfMap = new HashMap<>();\n sourceNodeConfMap.put(\"id\", tmpNodeId);\n sourceNodeConfMap.put(\"name\", tmpNodeId);\n sourceNodeConfMap.put(\"schedule_time\", this.scheduleTime);\n SourceNode sourceNode = createHdfsSourceNode(tmpNodeId, sourceNodeConfMap);\n transformNode.getParents().add(sourceNode);\n this.sourceNodes.put(tmpNodeId, sourceNode);\n LOGGER.info(String.format(\"Added source node %s\", tmpNodeId));\n } else if (!heads.contains(tmpNodeId)\n && !this.tmpTransformNodesMap.containsKey(tmpNodeId)\n && !this.staticTable.contains(tmpNodeId)) {\n transformNode.getParents().add(this.traverseBuildNodes(tmpNodeId));\n } else if (!heads.contains(tmpNodeId)\n && this.tmpTransformNodesMap.containsKey(tmpNodeId)\n && !this.staticTable.contains(tmpNodeId)) {\n transformNode.getParents().add(this.tmpTransformNodesMap.get(tmpNodeId));\n }\n\n }\n }", "public static void main(String[] args) {\n\n\n\t\tArrayList<Node> N = new ArrayList<Node>();\n\t\t\n\t\t/*\n\t\t * ##### Encoding Model 2 ###### \n\t\t */\n\t\t\n\t\t\n\t\t/*\n\t\t * Encoding the privilege nodes\n\t\t */\n\t\tfor(int i=1; i<7; i++)\n\t\t{\n\t\t\tN.add(new Node(\"p\"+i, 1));\n\t\t}\n\t\t\n\t\t/*\n\t\t * Encoding the exploit nodes\t\t \n\t\t */\n\t\tfor(int i=1; i<8; i++)\n\t\t{\n\t\t\tN.add(new Node(\"e\"+i, 2));\n\t\t}\n\t\t\n\t\t/*\n\t\t * Encoding the child nodes\n\t\t */\n\t\tfor(int i=1; i<12; i++)\n\t\t{\n\t\t\tN.add(new Node(\"c\"+i, 0));\n\t\t}\n\t\t\n\t\t/*\n\t\t * Assigning the children and parent(s) for each node according to model 2\n\t\t */\n\t\t\n\t\tArrayList<Node> nil = new ArrayList<Node>();\n\t\t\n\t\tN.get(0).setParents(nil);\n\t\tN.get(0).addChild(N.get(6));\n\t\t\n\t\tN.get(6).addParent(N.get(0));\n\t\tN.get(6).addChild(N.get(1));\n\t\tN.get(6).addChild(N.get(13));\n\t\tN.get(6).addChild(N.get(14));\n\t\t\n\t\tN.get(1).addParent(N.get(6));\n\t\tN.get(1).addChild(N.get(7));\n\t\tN.get(1).addChild(N.get(8));\n\t\t\n\t\tN.get(7).addParent(N.get(1));\n\t\tN.get(7).addChild(N.get(15));\n\t\tN.get(7).addChild(N.get(2));\n\t\t\n\t\tN.get(2).addParent(N.get(7));\n\t\tN.get(2).addChild(N.get(10));\t\t\n\t\t\n\t\tN.get(8).addParent(N.get(1));\n\t\tN.get(8).addChild(N.get(16));\n\t\tN.get(8).addChild(N.get(3));\n\t\t\n\t\tN.get(3).addParent(N.get(8));\n\t\tN.get(3).addChild(N.get(9));\n\t\t\n\t\tN.get(10).addParent(N.get(2));\n\t\tN.get(10).addChild(N.get(5));\n\t\tN.get(10).addChild(N.get(19));\n\t\tN.get(10).addChild(N.get(20));\n\t\t\n\t\tN.get(9).addParent(N.get(3));\n\t\tN.get(9).addChild(N.get(4));\n\t\tN.get(9).addChild(N.get(17));\n\t\tN.get(9).addChild(N.get(18));\n\t\t\n\t\tN.get(4).addParent(N.get(9));\n\t\tN.get(4).addChild(N.get(12));\n\t\t\n\t\tN.get(5).addParent(N.get(10));\n\t\tN.get(5).addChild(N.get(11));\n\t\t\n\t\tN.get(12).addParent(N.get(4));\n\t\tN.get(12).addChild(N.get(22));\n\t\tN.get(12).addChild(N.get(23));\n\t\t\n\t\tN.get(11).addParent(N.get(5));\n\t\tN.get(11).addChild(N.get(21));\n\t\tN.get(11).addChild(N.get(23));\n\t\t\n\t\tN.get(13).addParent(N.get(6));\n\t\tN.get(14).addParent(N.get(6));\n\t\tN.get(15).addParent(N.get(7));\n\t\tN.get(16).addParent(N.get(8));\n\t\tN.get(17).addParent(N.get(9));\n\t\tN.get(18).addParent(N.get(9));\n\t\tN.get(19).addParent(N.get(10));\n\t\tN.get(20).addParent(N.get(10));\n\t\tN.get(21).addParent(N.get(11));\n\t\tN.get(22).addParent(N.get(12));\n\t\tN.get(23).addParent(N.get(11));\n\t\tN.get(23).addParent(N.get(12));\n\t\t\n\t\t\n\t\t/*\n\t\t * Encoding the C,I,A values for each node\n\t\t */\n\t\t\n\t\tN.get(0).setImpacts(4, 4, 4);\n\t\tN.get(1).setImpacts(1, 2, 3);\n\t\tN.get(2).setImpacts(2, 2, 1);\n\t\tN.get(3).setImpacts(1, 2, 1);\n\t\tN.get(4).setImpacts(1, 1, 1);\n\t\tN.get(5).setImpacts(3, 2, 3);\n\t\tN.get(13).setImpacts(3,3,3);\n\t\tN.get(14).setImpacts(3,3,3);\n\t\tN.get(15).setImpacts(3,3,3);\n\t\tN.get(16).setImpacts(3,3,3);\n\t\tN.get(17).setImpacts(3,3,3);\n\t\tN.get(18).setImpacts(3,3,3);\n\t\tN.get(19).setImpacts(3,3,3);\n\t\tN.get(20).setImpacts(3,3,3);\n\t\tN.get(21).setImpacts(3,3,3);\n\t\tN.get(22).setImpacts(3,3,3);\n\t\tN.get(23).setImpacts(2,2,1);\n\t\t\n\t\t\n\t\t\n\t\t\n\t\t\n\t\t/*\n\t\t * This block helps see the setup of the whole tree. \n\t\t * Comment out if not required to see the parent children relationship of each node.\n\t\t */\n\t\t\n\t\tfor(int i=0; i<24; i++)\n\t\t{\n\t\t\tSystem.out.println(\"\\n\\n\" + N.get(i).getName() + \" < C=\" + N.get(i).getImpactC() + \", I=\" + N.get(i).getImpactI() + \", A=\" + N.get(i).getImpactA() + \" >\" );\n\t\t\tSystem.out.println(\"Parents: \");\n\t\t\tfor(int j=0; j<N.get(i).getParents().size(); j++)\n\t\t\t{\n\t\t\t\tSystem.out.print(N.get(i).getParents().get(j).getName() + \" \");\n\t\t\t}\n\t\t\tSystem.out.println(\"\\nChildren: \");\n\t\t\tfor(int k=0; k<N.get(i).getChildren().size(); k++)\n\t\t\t{\n\t\t\t\tSystem.out.print(N.get(i).getChildren().get(k).getName() + \" \");\n\t\t\t}\n\t\t}\n\t\t\n\t\t\n\t\t/*\n\t\t * Calling the method which will perform the C,I,A impact analysis \n\t\t */\n\t\t\n\t\t//Node n = new Node(); //Commented out as extended Main to Node and declared impactAnalysis() as static \n\t\t\n\t\tImpactAnalyzer ia = new ImpactAnalyzer();\n\t\tia.analyze(2, 2, 1, N);\n\t\t\n\t\t\n\t\t\n\t}", "private void initializeNodes() {\n for (NasmInst inst : nasm.listeInst) {\n Node newNode = graph.newNode();\n inst2Node.put(inst, newNode);\n node2Inst.put(newNode, inst);\n if (inst.label != null) {\n NasmLabel label = (NasmLabel) inst.label;\n label2Inst.put(label.toString(), inst);\n }\n }\n }", "private void constructBSTPTree(Node<T> u, int n) {\n\t\tn++;\n\t\taddToPT(n, u.x);\n\t\tSystem.out.printf(\"%d: %s \", n, u.x);\n\t\tif (u.left != nil)\n\t\t\tconstructBSTPTree(u.left, n);\n\t\tif (u.right != nil)\n\t\t\tconstructBSTPTree(u.right, n);\n\t}", "public void init(SSBNNode ssbnnode) {\r\n\t\tthis.setSSBNNode(ssbnnode);\r\n\t\t//this.node = ssbnnode.getResident();\t//setSSBNNode already does it.\r\n//\t\tthis.mebn = this.node.getMFrag().getMultiEntityBayesianNetwork();\r\n\t\tString pseudocode = this.node.getTableFunction();\r\n\t\t\r\n\t\tif (this.ssbnnode.getProbNode() != null) {\r\n\t\t\tthis.setPotentialTable(this.ssbnnode.getProbNode().getProbabilityFunction());\t\t\t\r\n\t\t}\r\n\t\t// do not clar cache\r\n\t\tthis.init(pseudocode, false);\r\n\t}", "public void cleanUpKnownValues(SSBNNode ssbnnode);", "public static Map<String, Set<SimpleSSBNNode>> convertSsbnIntoMsbn(\r\n\t\t\tList<SimpleSSBNNode> nodeList){\r\n\t\t\r\n\t\tMap<String, Set<SimpleSSBNNode>> map = new HashMap<String, Set<SimpleSSBNNode>>();\r\n\t\t\r\n\t\tfor (SimpleSSBNNode node : nodeList) {\r\n\t\t\t// FIXME - ROMMEL - change the name of the MFragInstance so that it is unique!!!\r\n\t\t\t// We might have more than one instance of the same MFrag. Here we are putting everything together.\r\n\t\t\tString key = node.getMFragInstance().getMFragOrigin().getName();\r\n\t\t\tSet<SimpleSSBNNode> msbnSection = map.get(key); \r\n\t\t\tif (msbnSection == null) {\r\n\t\t\t\tmsbnSection = new HashSet<SimpleSSBNNode>();\r\n\t\t\t\tmap.put(key, msbnSection);\r\n\t\t\t}\r\n\t\t\tmsbnSection.add(node);\r\n\t\t\t\r\n\t\t\t// The main objective here is to add the input nodes in this subnetwork.\r\n\t\t\t// Since this is a set, it does not hurt to add \"again\" a resident parent.\r\n\t\t\t// The only restriction is that the parent has to be in the SSBN in order to show up\r\n\t\t\t// in the MSBN.\r\n\t\t\tfor (SimpleSSBNNode parent : node.getParents()) {\r\n\t\t\t\tif (nodeList.contains(parent)) {\r\n\t\t\t\t\tmsbnSection.add(parent);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\treturn map; \r\n\t}", "@Override\n public void newBundlesRoot(Bundles new_root) {\n // Adjust state of super\n super.newBundlesRoot(new_root);\n // Save some state\n Map<String,Point2D> wxy_copy = entity_to_wxy;\n // Reset stateful variables for this class\n digraph = new SimpleMyGraph<Bundle>();\n graph = new SimpleMyGraph<Bundle>();\n entity_to_shape = new HashMap<String,Utils.Symbol>();\n entity_to_wxy = new HashMap<String,Point2D>();\n entity_to_sxy = new HashMap<String,String>();\n entity_to_sx = new HashMap<String,Integer>();\n entity_to_sy = new HashMap<String,Integer>();\n // Reapply all the relationships\n for (int i=0;i<active_relationships.size();i++) {\n // System.err.println(\"newBundlesRoot(): Adding In Relationship \\\"\" + active_relationships.get(i) + \"\\\"... bundles.size() = \" + new_root.size());\n addRelationship(active_relationships.get(i), false, new_root);\n }\n // Reapply the world coordinates\n Iterator<String> it = entity_to_wxy.keySet().iterator();\n while (it.hasNext()) {\n String entity = it.next();\n if (wxy_copy.containsKey(entity)) entity_to_wxy.put(entity, wxy_copy.get(entity));\n }\n transform();\n }", "public LinearAcceptingNestedWordAutomaton transform(NondeterministicNestedWordAutomaton nnwa) {\n LinearAcceptingNestedWordAutomaton dnwa = new LinearAcceptingNestedWordAutomaton();\n\n ArrayList<HierarchyState> nnwaHierarchyStates = nnwa.getP();\n ArrayList<HierarchyState> nnwaHierarchyAcceptingStates = nnwa.getPf();\n ArrayList<LinearState> nnwalinearStates = nnwa.getQ();\n ArrayList<LinearState> nnwaLinearAcceptingStates = nnwa.getQf();\n\n /* ArrayList<PowerSetHierarchyState> dnwaPowerSetHierarchyStates = new ArrayList<PowerSetHierarchyState>();\n ArrayList<PowerSetHierarchyState> dnwaPowerSetHierarchyAcceptingStates = new ArrayList<PowerSetHierarchyState>();\n ArrayList<PowerSetLinearState> dnwaPowerSetLinearStates = new ArrayList<PowerSetLinearState>();\n ArrayList<PowerSetLinearState> dnwaPowerSetLinearAcceptingStates = new ArrayList<PowerSetLinearState>();\n*/\n for (HierarchyState hState : nnwaHierarchyStates) {\n\n }\n\n\n return dnwa;\n }", "public void addSDESInfo(RTCPSDES chunk) {\n int ci = 0;\n while (ci < chunk.items.length && chunk.items[ci].type != 1) {\n ci++;\n }\n String s = new String(chunk.items[ci].data);\n String sourceinfocname = null;\n if (this.sourceInfo != null) {\n sourceinfocname = this.sourceInfo.getCNAME();\n }\n if (!(this.sourceInfo == null || s.equals(sourceinfocname))) {\n this.sourceInfo.removeSSRC(this);\n this.sourceInfo = null;\n }\n if (this.sourceInfo == null) {\n this.sourceInfo = this.cache.sourceInfoCache.get(s, this.ours);\n this.sourceInfo.addSSRC(this);\n }\n if (chunk.items.length > 1) {\n for (int i = 0; i < chunk.items.length; i++) {\n s = new String(chunk.items[i].data);\n switch (chunk.items[i].type) {\n case 2:\n if (this.name != null) {\n this.name.setDescription(s);\n break;\n } else {\n this.name = new SourceDescription(2, s, 0, false);\n break;\n }\n case 3:\n if (this.email != null) {\n this.email.setDescription(s);\n break;\n } else {\n this.email = new SourceDescription(3, s, 0, false);\n break;\n }\n case 4:\n if (this.phone != null) {\n this.phone.setDescription(s);\n break;\n } else {\n this.phone = new SourceDescription(4, s, 0, false);\n break;\n }\n case 5:\n if (this.loc != null) {\n this.loc.setDescription(s);\n break;\n } else {\n this.loc = new SourceDescription(5, s, 0, false);\n break;\n }\n case 6:\n if (this.tool != null) {\n this.tool.setDescription(s);\n break;\n } else {\n this.tool = new SourceDescription(6, s, 0, false);\n break;\n }\n case 7:\n if (this.note != null) {\n this.note.setDescription(s);\n break;\n } else {\n this.note = new SourceDescription(7, s, 0, false);\n break;\n }\n case 8:\n if (this.priv != null) {\n this.priv.setDescription(s);\n break;\n } else {\n this.priv = new SourceDescription(8, s, 0, false);\n break;\n }\n default:\n break;\n }\n }\n }\n }", "protected Node introduceSVNode(NodeList nodesToJoin, Node sv) {\n Node introducedNode;\n NodeList parents;\n Node auxNode;\n Function functionSV;\n UtilityPotential potSV;\n Function functionNewNode;\n\n parents = sv.getParentNodes();\n\n if (nodesToJoin.size() == parents.size()) {\n //It isn't necessary to introduce a new super value node\n introducedNode = sv;\n } else {\n String nameOfNewNode;\n Node newNode;\n\n //Create a node to join the 'nodesToJoin'\n nameOfNewNode = nodesToJoin.elementAt(0).getName() + nodesToJoin.elementAt(1).getName();\n newNode = new Continuous();\n newNode.setName(nameOfNewNode);\n newNode.setKindOfNode(Node.UTILITY);\n\n //Add the new node to the diagram\n try {\n diag.addNode(newNode);\n } catch (InvalidEditException iee) {\n };\n diag.addRelation(newNode);\n\n //Removal of the links among the nodes 'nodesToJoin'\n //and the node 'sv' and redirect the 'nodesToJoin'\n //to the new super value node\n for (int i = 0; i < nodesToJoin.size(); i++) {\n auxNode = nodesToJoin.elementAt(i);\n\n //Remove the link to the node 'sv'\n try {\n diag.removeLink(auxNode, sv);\n } catch (InvalidEditException iee) {\n ;\n }\n\n //Direct the link from 'auxNode' to the new super value node\n try {\n diag.createLink(auxNode, newNode);\n } catch (InvalidEditException iee) {\n ;\n }\n\n }\n\n //Set the potentials as arguments in newNode\n for (int i = 0; i < nodesToJoin.size(); i++) {\n auxNode = nodesToJoin.elementAt(i);\n ReductionAndEvalID.updateArgumentChild(\n (IDWithSVNodes) diag,\n auxNode,\n newNode);\n }\n\n //Create a link between 'newNode' and 'sv'\n try {\n diag.createLink(newNode, sv);\n } catch (InvalidEditException iee) {\n ;\n }\n\n //Set the appropiate kind of super value node\n potSV = ((UtilityPotential) diag.getRelation(sv).getValues());\n functionSV = potSV.getFunction();\n if (functionSV.getClass() == SumFunction.class) {\n functionNewNode = new SumFunction();\n } else {\n functionNewNode = new ProductFunction();\n }\n ((UtilityPotential) (diag.getRelation(newNode).getValues())).setFunction(functionNewNode);\n //Set the potential of newNode as arguments in sv\n ReductionAndEvalID.updateArgumentChild(\n (IDWithSVNodes) diag,\n newNode,\n sv);\n\n introducedNode = newNode;\n }\n return introducedNode;\n }", "public Stabel(){\n elementer = 0;\n hode = new Node(null);\n hale = hode;\n hode.neste = hale;\n hale.forrige = hode;\n }", "public String toString() {\n\t\tStringBuilder sb = new StringBuilder(\"BNNode \" + name + \":\\n\");\n\t\tif (isEvidence)\n\t\t\tsb.append(\" EVIDENCE\\n\");\n\t\tsb.append(\" value: \" + value + \"\\n\");\n\t\tsb.append(\" parents:\");\n\t\tif (parents.length == 0)\n\t\t\tsb.append(\" (none)\");\n\t\telse\n\t\t\tfor (BNNode parent : parents) \n\t\t\t\tsb.append(\" \" + parent.name);\n\t\tsb.append(\"\\n children:\");\n\t\tif (children.length == 0)\n\t\t\tsb.append(\" (none)\");\n\t\telse\n\t\t\tfor (BNNode child : children) \n\t\t\t\tsb.append(\" \" + child.name);\n\t\tsb.append(\"\\n CPT:\");\n\t\tfor (double cp : cpt)\n\t\t\tsb.append(\" \" + cp);\n\t\treturn sb.toString();\n\t}", "private void constructBSTree(Node<T> u, int n, String lr) {\n\t\tn++;\n\t\taddToPT(n, lr + \" \" + u.x.toString());\n\t\telements.add(u.x);\n\t\tif (u.left != nil)\n\t\t\tconstructBSTree(u.left, n, lr + \"L\");\n\t\tif (u.right != nil)\n\t\t\tconstructBSTree(u.right, n, lr + \"R\");\n\t}", "private void fourNodesTopo() {\n ReadWriteTransaction tx = dataBroker.newReadWriteTransaction();\n n(tx, true, \"n1\", Stream.of(pB(\"n1:1\"), pB(\"n1:2\"), pI(\"n1:3\"), pO(\"n1:4\"), pO(\"n1:5\")));\n n(tx, true, \"n2\", Stream.of(pB(\"n2:1\"), pB(\"n2:2\"), pO(\"n2:3\"), pI(\"n2:4\"), pI(\"n2:5\")));\n n(tx, true, \"n3\", Stream.of(pB(\"n3:1\"), pB(\"n3:2\"), pO(\"n3:3\"), pO(\"n3:4\"), pI(\"n3:5\")));\n n(tx, true, \"n4\", Stream.of(pB(\"n4:1\"), pB(\"n4:2\"), pI(\"n4:3\"), pI(\"n4:4\"), pO(\"n4:5\")));\n l(tx, \"n1\", \"n1:5\", \"n2\", \"n2:5\", OperationalState.ENABLED, ForwardingDirection.UNIDIRECTIONAL);\n l(tx, \"n1\", \"n1:4\", \"n4\", \"n4:4\", OperationalState.ENABLED, ForwardingDirection.UNIDIRECTIONAL);\n l(tx, \"n2\", \"n2:3\", \"n4\", \"n4:3\", OperationalState.ENABLED, ForwardingDirection.UNIDIRECTIONAL);\n l(tx, \"n3\", \"n3:4\", \"n2\", \"n2:4\", OperationalState.ENABLED, ForwardingDirection.UNIDIRECTIONAL);\n l(tx, \"n4\", \"n4:5\", \"n3\", \"n3:5\", OperationalState.ENABLED, ForwardingDirection.UNIDIRECTIONAL);\n try {\n tx.submit().checkedGet();\n } catch (TransactionCommitFailedException e) {\n e.printStackTrace();\n }\n }", "private void fiveNodesTopo() {\n ReadWriteTransaction tx = dataBroker.newReadWriteTransaction();\n n(tx, true, \"n1\", Stream.of(pI(\"n1:1\"), pB(\"n1:2\"), pI(\"n1:3\"), pO(\"n1:4\")));\n n(tx, true, \"n2\", Stream.of(pI(\"n2:1\"), pB(\"n2:2\"), pO(\"n2:3\"), pI(\"n2:4\")));\n n(tx, true, \"n3\", Stream.of(pO(\"n3:1\"), pB(\"n3:2\"), pO(\"n3:3\"), pI(\"n3:4\")));\n n(tx, true, \"n4\", Stream.of(pO(\"n4:1\"), pI(\"n4:2\"), pB(\"n4:3\"), pB(\"n4:4\")));\n n(tx, true, \"n5\", Stream.of(pI(\"n5:1\"), pB(\"n5:2\"), pB(\"n5:3\"), pO(\"n5:4\")));\n l(tx, \"n2\", \"n2:3\", \"n3\", \"n3:4\", OperationalState.ENABLED, ForwardingDirection.BIDIRECTIONAL);\n l(tx, \"n3\", \"n3:1\", \"n1\", \"n1:1\", OperationalState.ENABLED, ForwardingDirection.BIDIRECTIONAL);\n l(tx, \"n3\", \"n3:3\", \"n5\", \"n5:1\", OperationalState.ENABLED, ForwardingDirection.BIDIRECTIONAL);\n l(tx, \"n4\", \"n4:1\", \"n1\", \"n1:3\", OperationalState.ENABLED, ForwardingDirection.BIDIRECTIONAL);\n l(tx, \"n1\", \"n1:4\", \"n2\", \"n2:4\", OperationalState.ENABLED, ForwardingDirection.BIDIRECTIONAL);\n l(tx, \"n5\", \"n5:4\", \"n4\", \"n4:2\", OperationalState.ENABLED, ForwardingDirection.BIDIRECTIONAL);\n try {\n tx.submit().checkedGet();\n } catch (TransactionCommitFailedException e) {\n e.printStackTrace();\n }\n }", "public BiNode(final int co, final String ns, final String n,\n final Attributes a) {\n this.childOffset = co;\n this.namespaceURI = ns;\n this.eName = n;\n this.attrs = a;\n }", "private static void buildDoublesNode(Document document, NodeList childList, Node newHead) {\n Element doublNode = document.createElement(\"item\");\n Element doublID = document.createElement(\"id\");\n Element doublParent = document.createElement(\"parent\");\n doublNode.appendChild(doublID);\n doublNode.appendChild(doublParent);\n for (int i = 0; i < childList.getLength(); i++) {\n if (childList.item(i).getNodeName().equals(\"id\"))\n doublID.setTextContent(childList.item(i).getTextContent());\n if (childList.item(i).getNodeName().equals(\"parent\")) {\n NodeList parentItemList = childList.item(i).getChildNodes();\n for (int j = 0; j < parentItemList.getLength(); j++) {\n if (parentItemList.item(j).getNodeName().equals(\"item\")) {\n Element innerParentItem = document.createElement(\"item\");\n innerParentItem.setTextContent(parentItemList.item(j).getTextContent());\n doublParent.appendChild(innerParentItem);\n }\n }\n }\n }\n newHead.appendChild(doublNode);\n }", "public void addSubNode(StandardsNode node) {\n\t\tsubList.add(node);\n\t\tchildMap.put(((TeachersDomainStandardsNode) node).getId(), node);\n\t}", "public\nNuc2D(Nuc2D nuc)\nthrows Exception\n{\n\tthis ((NucNode)nuc);\n\tthis.setUseSymbol(nuc.getUseSymbol());\n\tthis.setIsSchematic(nuc.getIsSchematic());\n\tthis.setSchematicColor(nuc.getSchematicColor());\n\tthis.setSchematicLineWidth(nuc.getSchematicLineWidth());\n\tthis.setSchematicBPLineWidth(nuc.getSchematicBPLineWidth());\n\tthis.setFont(nuc.getFont());\n\tthis.setNucCharSymbol(nuc.getFont());\n\tthis.setNucChar(nuc.getNucChar());\n\tthis.setXY(nuc.getX(), nuc.getY());\n\tthis.setColor(nuc.getColor());\n\t// Not sure I need these yet:\n\t// this.setParentCollection(nuc.getParentSSData2D());\n\t// this.setBoundingBox(nuc.getBoundingBox());\n\t//\n}", "@Override\n\tpublic void initStateNodes() {\n \tSystem.err.println(Randomizer.getSeed());\n\t\tPartitionedTreeLikelihood likelihood = null;\n\t\tfor (BEASTInterface plugin : getOutputs()) {\n\t\t\tif (plugin instanceof PartitionedTreeLikelihood) {\n\t\t\t\tlikelihood = (PartitionedTreeLikelihood) plugin;\n\t\t\t}\n\t\t}\n\t\tif (likelihood == null) {\n\t\t\tthrow new IllegalArgumentException(\"PartitionProvider must have PartitionedTreeLikelihood as output\");\n\t\t}\n\t\tSiteModel.Base siteModel = (SiteModel.Base) likelihood.siteModelInput.get();\n\t\t\n\t\tif (siteModel instanceof SiteModel) {\n\t\t\tRealParameter mu = ((SiteModel) siteModel).muParameterInput.get();\n\t\t\tif (!mu.isEstimatedInput.get()) {\n\t\t\t\tSystem.err.println(\"Warning: sitemodel mutation rates are NOT estimated. This is probably not what you want\");\n\t\t\t}\n\t\t}\n\t\t\n\t\tString sPartition = BeautiDoc.parsePartition(getID());\n\t\tSet<BEASTInterface> ancestors = new HashSet<BEASTInterface>();\n\t\tBeautiDoc.collectAncestors(this, ancestors, new HashSet<BEASTInterface>());\n\t\tMCMC mcmc = null;\n\t\tfor (BEASTInterface plugin : ancestors) {\n\t\t\tif (plugin instanceof MCMC) {\n\t\t\t\tmcmc = (MCMC) plugin;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t\tm_pSiteModel.get().add(siteModel);\n\t\tList<BEASTInterface> tabuList = new ArrayList<BEASTInterface>();\n\t\ttabuList.add(this);\n\t\tfor (int i = 1; i < numPartitions.get(); i++) {\n\t\t\tBeautiDoc doc = new BeautiDoc();\n\t\t\tPartitionContext oldContext = new PartitionContext(sPartition);\n\t\t\tPartitionContext newContext = new PartitionContext(sPartition+i);\n\t\t\tBEASTInterface plugin = BeautiDoc.deepCopyPlugin(siteModel, this, mcmc, oldContext, newContext, doc, tabuList);\n\t\t\tm_pSiteModel.get().add((SiteModel.Base) plugin);\n\t\t}\n\t\tif (siteModel instanceof SiteModel) {\n\t\t\tRealParameter mu = ((SiteModel) siteModel).muParameterInput.get();\n\t\t\tmu.isEstimatedInput.setValue(false, mu);\n\t\t\tmu.initByName(\"lower\", \"\"+mu.getValue(), \"upper\" , \"\" + mu.getValue());\n\t\t}\n\t\tState state = mcmc.startStateInput.get();\n\t\tstate.initialise();\n state.setPosterior(mcmc.posteriorInput.get());\n\t\tneedsInitilising = false;\n\t\tinitAndValidate();\n\n\t\tSet<BEASTInterface> plugins = new HashSet<BEASTInterface>();\n\t\tfor (BEASTInterface plugin : mcmc.listActiveBEASTObjects()) {\n\t\t\treinitialise(plugin, plugins);\n\t\t}\n//\t\t\n//\t\tfor (Plugin plugin : ancestors) {\n//\t\t\tif (plugin instanceof PartitionedTreeLikelihood) {\n//\t\t\t\t((PartitionedTreeLikelihood) plugin).initAndValidate();\n//\t\t\t\tbreak;\n//\t\t\t}\n//\t\t}\n\t}", "public Node insertBySName(Node bstNode, String name, String sname, String no){\n\t\tif(bstNode == null){\n\t\t\tbstNode = new Node(name, sname, no);\n\t\t\tbstNode.setParent(parent);\n\t\t}\n\t\telse{\n\t\t\tparent = bstNode;\n\t\t\tif(sname.compareTo(bstNode.getSurname())<0)\n\t\t\t\tbstNode.setLeft(insertBySName(bstNode.getLeft(),name,sname,no));\n\t\t\telse\n\t\t\t\tbstNode.setRight(insertBySName(bstNode.getRight(),name,sname,no));\n\t\t}\n\t\treturn bstNode;\n\t\t\n\t}", "private void shortenNodeLabels() {\n for (NodeImpl n : supervisedNodes) {\n if (n.hasLabel()) {\n shortenNodeLabel(n.getLabel());\n }\n }\n }", "private void translateIDAddress(Tree tree, int registerIndex) {\n\t\tString name = tree.toString();\n\t\tVariable variable = this.findVariable(name);\n\n\t\tint deplacementVariable = variable.getOffset();\n\t\tString typeOfVar;\n\t\tif (deplacementVariable < 0) { // Si variable est une variable locale\n\t\t\tdeplacementVariable -= 2; // On doit compter le déplacement statique\n\t\t\ttypeOfVar = \"variable locale\";\n\t\t} else { // variable est un argument de fonction\n\t\t\tdeplacementVariable += 4; // Taille de l'adresse de retour\n\t\t\ttypeOfVar = \"argument\";\n\t\t}\n\n\t\tint countStaticChain = this.countStaticChainToVariable(tree.toString());\n\n\t\tthis.writer.writeFunction(String.format(\"LDW R%d, BP // ID_BEGIN : Préparation pour le chargement de l'adresse de %s \\\"%s\\\" dans un registre\", registerIndex, typeOfVar, name)); // Copie le registre de base dans le registre résultat\n\t\tif (countStaticChain > 0) { // S'il y des chaînages statiques à remonter :\n\n\t\t\tint loopRegister = this.registerManager.provideRegister();\n\n\t\t\tthis.writer.writeFunction(String.format(\"LDW R%d, #%d // Début de remontée de chaînage statique pour charger l'adresse de %s \\\"%s\\\" dans un registre\", loopRegister, countStaticChain, typeOfVar, name));\n\t\t\t// Début de boucle :\n\t\t\tthis.writer.writeFunction(String.format(\"LDW R%d, (R%d)%d\", registerIndex, registerIndex, -2));\n\t\t\tthis.writer.writeFunction(String.format(\"ADQ -1, R%d\", loopRegister));\n\t\t\tthis.writer.writeFunction(String.format(\"BNE -10 // Fin de remontée de chaînage statique pour charger l'adresse de %s \\\"%s\\\" dans un registre\", typeOfVar, name)); // Jump à (6 - 2)/3 = 2 instructions plus tôt. Le -2 c'est pour cette instruction de saut\n\t\t\t// Fin de boucle\n\n\t\t\tthis.registerManager.freeRegister();\n\t\t}\n\t\tthis.writer.writeFunction(String.format(\"ADI R%d, R%d, #%d // ID_END : Chargement de l'adresse de %s \\\"%s\\\" dans un registre\", registerIndex, registerIndex, deplacementVariable, typeOfVar, name)); // L'adresse de la variable recherchée est maintenant dans registre voulu\n\t}", "private void initSubNodes()\n {\n children = createSubNodes(false);\n attributes = createSubNodes(true);\n }", "public void createPrefixS(){\n\t \tprefixS = new Stack<Node>();\n\t \tprefixS.push(root);\n\t }", "public String nodeToString(Node givenNode) throws SCNotifyRequestProcessingException {\n\t\tStringWriter sw = new StringWriter();\n\t\tString str;\n\t\ttry {\n\t\t\tTransformer t = TransformerFactory.newInstance().newTransformer();\n\t\t\tt.setOutputProperty(OutputKeys.OMIT_XML_DECLARATION, \"yes\");\n\t\t\tt.setOutputProperty(OutputKeys.ENCODING, \"UTF-16\");\n\t\t\tt.transform(new DOMSource(givenNode), new StreamResult(sw));\n\t\t\tstr = sw.toString();\n\t\t} catch (TransformerException te) {\n\t\t\tthrow new SCNotifyRequestProcessingException();\n\t\t}\n\t\treturn str;\n\t}", "public void addNode(String id, String label, double sna, double sz, HashMap<String,Integer> growthsPerYear){\n\t\tnodes.add(new CircosNode(id, label, sna, sz, growthsPerYear));\n\t\t\n\t\tString color = Math.round(Math.random() * 255) + \",\" + \n\t\t\t\tMath.round(Math.random() * 255) + \",\" + Math.round(Math.random() * 255); \n\t\tcolors.put(id, color);\n\t}", "private void addSP(OMANode mo, OSUManager osuManager) throws IOException {\n MOTree moTree;\n try (BufferedInputStream in = new BufferedInputStream(new FileInputStream(mPpsFile))) {\n moTree = MOTree.unmarshal(in);\n moTree.getRoot().addChild(mo);\n\n /*\n OMAConstructed ppsRoot = (OMAConstructed)\n moTree.getRoot().addChild(TAG_PerProviderSubscription, \"\", null, null);\n for (OMANode child : mo.getChildren()) {\n ppsRoot.addChild(child);\n if (!child.isLeaf()) {\n moTree.getRoot().addChild(child);\n }\n else if (child.getName().equals(TAG_UpdateIdentifier)) {\n OMANode currentUD = moTree.getRoot().getChild(TAG_UpdateIdentifier);\n if (currentUD != null) {\n moTree.getRoot().replaceNode(currentUD, child);\n }\n else {\n moTree.getRoot().addChild(child);\n }\n }\n }\n */\n }\n writeMO(moTree, mPpsFile, osuManager);\n }", "@Override\n\t\tprotected SubnodeBTree intermediateNodeFactory(java.nio.ByteBuffer entryStream)\n\t\tthrows\n\t\t\tCRCMismatchException,\n\t\t\tjava.io.IOException\n\t\t{\n\t\t\tfinal SIEntry entry = new SIEntry(this, entryStream);\n\t\t\treturn new SubnodeBTree(entry.nid.key(), this);\n\t\t}", "private void inzsr() {\n\t\tid1Ctdta = 1;\n\t\tstrCtdta = \"Each KGS \";\n\t\tfor (int idxCtdta = 1; idxCtdta <= 1; idxCtdta++) {\n\t\t\tum[idxCtdta] = subString(strCtdta, id1Ctdta, 11);\n\t\t\tid1Ctdta = Integer.valueOf(id1Ctdta + 11);\n\t\t}\n\t\t// Initialise message subfile\n\t\tnmfkpinds.setPgmInd32(true);\n\t\tstateVariable.setZzpgm(replaceStr(stateVariable.getZzpgm(), 1, 8, \"WWCONDET\"));\n\t\t// - Set date\n\t\tstateVariable.setZzdate(getDate().toInt());\n\t\t// -\n\t\t// - CONTRACT\n\t\tcontractHeader.retrieve(stateVariable.getXwordn());\n\t\tnmfkpinds.setPgmInd99(! lastIO.isFound());\n\t\t// - CUSTOMER\n\t\tpurchases.retrieve(stateVariable.getXwbccd());\n\t\tnmfkpinds.setPgmInd99(! lastIO.isFound());\n\t\t// BR00012 Debtor not found on Purchases\n\t\tif (nmfkpinds.pgmInd99()) {\n\t\t\tstateVariable.setXwg4tx(all(\"-\", 40));\n\t\t}\n\t\t// - REPRESENTATIVE\n\t\tsalespersons.retrieve(stateVariable.getPerson());\n\t\tnmfkpinds.setPgmInd99(! lastIO.isFound());\n\t\t// BR00013 Rep not found on Salespersons\n\t\tif (nmfkpinds.pgmInd99()) {\n\t\t\tstateVariable.setPname(all(\"-\", 34));\n\t\t}\n\t\t// - STATUS\n\t\torderStatusDescription.retrieve(stateVariable.getXwstat());\n\t\tnmfkpinds.setPgmInd99(! lastIO.isFound());\n\t\t// BR00014 Status not found on Order_status_description\n\t\tif (nmfkpinds.pgmInd99()) {\n\t\t\tstateVariable.setXwsdsc(all(\"-\", 20));\n\t\t}\n\t}", "protected AddTranscriptNodeModel() {\r\n this(1,2);\r\n }", "public AbstractSRLabeler(JointFtrXml[] xmls, AbstractFrames frames)\n\t{\n\t\tsuper(xmls);\n\t\tm_down = new Prob1DMap();\n\t\tm_up = new Prob1DMap();\n\t\tm_frames = frames;\n\t}", "@Override\n\tprotected String toMips(Scope symbolTable, String indent) {\n\t\tStringBuilder build = new StringBuilder(indent).append(\"#SubProgramHeadNode\\n\");\n\n\t\t//load ptr to previous stack's head to pick up values\n\t\tbuild.append(indent).append(\"lw $t0, 8($sp)\\n\");\n\t\tbuild.append(indent).append(\"lw $t0, ($t0)\\n\");\n\n\t\t//iterate across arguments\n\t\tfor (int i = 0; i < arguments.length; i++) {\n\t\t\tbuild.append(indent).append(\"lw $t1, \").append((i + 1) * 4).append(\"($t0)\\t#get loaded value from stack\\n\");\n\t\t\tbuild.append(indent).append(\"sw $t1, \").append(symbolTable.getMemoryOffset(arguments[i])).append(\"($sp)\\t#save word in correct spot (hopefully?)\\n\");\t//This is done in SubProgramNode constructor\n\t\t}\n\n\t\treturn build.toString();\n\t}", "private void createNodeLabel(NodeAppearanceCalculator nac) {\r\n\t PassThroughMapping passThroughMapping = new PassThroughMapping(\"\",\r\n\t ObjectMapping.NODE_MAPPING);\r\n\t \r\n\t // change canonicalName to Label\r\n//\t passThroughMapping.setControllingAttributeName\r\n//\t (\"canonicalName\", null, false);\r\n\t passThroughMapping.setControllingAttributeName\r\n// (Semantics.LABEL, null, false);\r\n\t (Semantics.CANONICAL_NAME, null, false);\r\n\t\r\n\t GenericNodeLabelCalculator nodeLabelCalculator =\r\n\t new GenericNodeLabelCalculator(\"SimpleBioMoleculeEditor ID Label\"\r\n\t , passThroughMapping);\r\n\t nac.setNodeLabelCalculator(nodeLabelCalculator);\r\n\t }", "@Transactional\n public abstract void setNodeParentAndDependencies(\n String foreignSource, String foreignId, \n String parentForeignSource, String parentForeignId, \n String parentNodeLabel\n );", "private GraphPattern translateToGP(){\r\n\r\n\t\t//Generate the graph pattern object\r\n\t\tGraphPattern gp = new GraphPattern();\r\n\r\n\r\n\t\t//For each Node object, create an associated MyNode object\r\n\t\tint nodeCount = 0;\r\n\t\tfor (Node n : allNodes){\r\n\t\t\tMyNode myNode = new MyNode(nodeCount, \"PERSON\");\r\n\t\t\tnodesMap.put(n, myNode);\r\n\t\t\tgp.addNode(myNode);\r\n\r\n\t\t\tnodeCount++;\r\n\t\t}\r\n\r\n\t\t//For k random MyNodes add the id as an attribute/property.\r\n\t\t//This id is used for cypher queries.\r\n\t\t//This process uses simple random sampling\r\n\t\tif (rooted > allNodes.size()){\r\n\t\t\trooted = allNodes.size();\r\n\t\t}\r\n\r\n\t\tList<Node> allNodesClone = new ArrayList<Node>();\r\n\t\tallNodesClone.addAll(allNodes);\r\n\r\n\t\tfor (int i = 0; i < rooted; i++){\r\n\t\t\t//Pick a random node from allNodes and get it's corresponding MyNode\r\n\t\t\tint idx = random.nextInt(allNodesClone.size());\r\n\t\t\tNode node = allNodesClone.get(idx);\r\n\t\t\tMyNode myNode = nodesMap.get(node);\r\n\r\n\t\t\t//Add the property to myNode\r\n\t\t\ttry (Transaction tx = graphDb.beginTx()){\r\n\t\t\t\tmyNode.addAttribute(\"id\", node.getProperty(\"id\")+\"\");\r\n\t\t\t\ttx.success();\r\n\t\t\t}\r\n\t\t\t//Remove the node from allNodesClone list.\r\n\t\t\tallNodesClone.remove(idx);\r\n\t\t}\r\n\r\n\t\t//Process the relationships\r\n\t\tint relCount = 0;\r\n\t\tString relPrefix = \"rel\";\r\n\r\n\t\tfor (Relationship r : rels){\r\n\r\n\t\t\tMyNode source = null, target = null;\r\n\t\t\tRelType type = null;\r\n\r\n\t\t\t//For each relationship in rels, create a corresponding relationship in gp.\r\n\t\t\ttry (Transaction tx = graphDb.beginTx()){\r\n\t\t\t\tsource = nodesMap.get(r.getStartNode());\r\n\t\t\t\ttarget = nodesMap.get(r.getEndNode());\r\n\t\t\t\ttype = GPUtil.translateRelType(r.getType());\r\n\t\t\t\ttx.success();\r\n\t\t\t}\r\n\r\n\t\t\tMyRelationship rel = new MyRelationship(source, target, type, relCount);\r\n\t\t\trelCount++;\r\n\r\n\t\t\tif (relCount >= 25){\r\n\t\t\t\trelCount = 0;\r\n\t\t\t\trelPrefix = relPrefix + \"l\";\r\n\t\t\t}\r\n\r\n\t\t\tgp.addRelationship(rel);\r\n\t\t\trelsMap.put(r, rel);\r\n\t\t}\r\n\r\n\t\t//Set the attribute requirements\r\n\t\tattrsReq(gp, true);\r\n\t\tattrsReq(gp, false);\r\n\t\treturn gp;\r\n\t}", "public InternalNode (int d, Node p0, String k1, Node p1, Node n, Node p){\n\n super (d, n, p);\n ptrs [0] = p0;\n keys [1] = k1;\n ptrs [1] = p1;\n lastindex = 1;\n\n if (p0 != null) p0.setParent (new Reference (this, 0, false));\n if (p1 != null) p1.setParent (new Reference (this, 1, false));\n }", "public TeachersDomainStandardsNode(Standard std, TeachersDomainStandardsNode parent) {\n\t\tthis.parent = parent;\n\t\tthis.gradeRange = std.getGradeRange();\n\t\tthis.id = std.getId();\n\t\tthis.itemText = std.getItemText();\n\t\tthis.level = std.getLevel();\n\t\tthis.fullText = this.initFullText(std);\n\t\tthis.docId = std.getDocumentIdentifier();\n\t}", "public interface BPTreeNode {\n\n /*\n * Method returns the node index in the B+ tree organization.\n *\n * Returns:\n * node index in B+ tree\n * */\n public long getNodeIndex();\n\n\n /*\n * Method identifies the node as a leaf node or a child (non-leaf) node.\n *\n * Returns:\n * true, if leaf node; false if child node\n * */\n public boolean isLeaf();\n\n /*\n * Method inserts the node item appropriate to the item's key value.\n *\n * Returns:\n * Node item inserted successfully.\n * */\n public boolean insertItem(BPTreeNodeItem item);\n\n /*\n * Method deletes the node item appropriate to the item's index.\n *\n * Returns:\n * Node item deleted successfully.\n * */\n public boolean deleteItem(int index);\n\n /*\n * Method returns the number of items assigned to the node.\n *\n * Returns:\n * Count of node items contained in the node\n * */\n public int getItemCount();\n\n /*\n * Method returns the indexed node item.\n *\n * Returns:\n * Indexed node item.\n * */\n public BPTreeNodeItem getItem(int index);\n\n /*\n * Method returns the lowest chromosome name key belonging to the node.\n *\n * Returns:\n * Lowest contig/chromosome name key; or null for no node items.\n * */\n public String getLowestChromKey();\n\n /*\n * Method returns the highest chromosome name key belonging to the node.\n *\n * Returns:\n * Highest contig/chromosome name key; or null for no node items.\n * */\n public String getHighestChromKey();\n\n /*\n * Method returns the lowest chromosome ID belonging to the node.\n *\n * Returns:\n * Lowest contig/chromosome ID; or -1 for no node items.\n * */\n public int getLowestChromID();\n\n /*\n * Method returns the highest chromosome ID belonging to the node.\n *\n * Returns:\n * Highest contig/chromosome ID; or -1 for no node items.\n * */\n public int getHighestChromID();\n\n /*\n * Method prints the nodes items and sub-node items.\n * Node item deleted successfully.\n * */\n public void printItems();\n\n}", "protected void backwardPhase() {\r\n HashSet seenBefore = new HashSet();\r\n\r\n for (int i = nodeCount-1; i >= 0; i--) {\r\n BBNNode node = nodes[i];\r\n //System.out.print(i+\": \"+node+\" = \");\r\n\r\n if (!seenBefore.contains(node)) {\r\n seenBefore.add(node);\r\n baseNodes[i].add(node);\r\n lambdaParameters[i].add(node);\r\n\r\n //System.out.print(\"P(\"+node);\r\n\r\n /*\r\n * Adding the parents to be included into the lambda parameter\r\n */\r\n List parents = node.getParents();\r\n if (parents != null) {\r\n //System.out.print(\"|\");\r\n for (Iterator j = parents.iterator(); j.hasNext(); ) {\r\n BBNNode parent = (BBNNode) j.next();\r\n lambdaParameters[i].add(parent);\r\n //System.out.print(parent.toString());\r\n //if (j.hasNext()) System.out.print(\", \");\r\n }\r\n }\r\n //System.out.print(\")\");\r\n }\r\n\r\n /*\r\n * Looking for P(child | curNode, otherParents...) to be included in the\r\n * current bucket\r\n */\r\n for (Iterator j = node.getChildren().iterator(); j.hasNext(); )\r\n {\r\n BBNNode child = (BBNNode) j.next();\r\n if (!seenBefore.contains(child)) {\r\n //System.out.print(\" P(\"+child);\r\n seenBefore.add(child);\r\n baseNodes[i].add(child);\r\n lambdaParameters[i].add(child);\r\n\r\n List childParents = child.getParents();\r\n if (childParents != null) {\r\n //System.out.print(\"|\");\r\n for (Iterator k = child.getParents().iterator(); k.hasNext(); ) {\r\n BBNNode childParent = (BBNNode) k.next();\r\n lambdaParameters[i].add(childParent);\r\n //System.out.print(childParent.toString());\r\n //System.out.print(\", \");\r\n }\r\n }\r\n //System.out.print(\")\");\r\n }\r\n }\r\n\r\n assert (lambdaParameters[i].size() > 0);\r\n\r\n// for (Iterator j = lambdaTable[i].iterator(); j.hasNext(); ) {\r\n// int idx = ((Integer) j.next()).intValue();\r\n// System.out.print(\" lambda_\"+nodes[idx]+\"(\");\r\n// for (Iterator k = lambdaParameters[idx].iterator(); k.hasNext(); ) {\r\n// BBNNode n = (BBNNode) k.next();\r\n// if (n != nodes[idx]) System.out.print(n+\",\");\r\n// }\r\n// System.out.print(\")\");\r\n// }\r\n// System.out.println();\r\n\r\n // Build the lambda\r\n LinkedList nodeList = new LinkedList();\r\n LinkedList nodeNameList = new LinkedList();\r\n for (Iterator j = lambdaParameters[i].iterator(); j.hasNext(); ) {\r\n BBNNode param = (BBNNode) j.next();\r\n nodeList.add(param);\r\n nodeNameList.add(param.getName());\r\n }\r\n lambda[i] = new BBNCPF(nodeNameList);\r\n nodeNameList = null; // we don't use this, so let it be garbage collected\r\n //System.out.print(\"lambda parameters \"+nodeList);\r\n\r\n buildLambda(i, nodeList, new Hashtable());\r\n\r\n // Do this except the lowest bucket\r\n if (i > 0) {\r\n // Find the highest bucket index that is lower than the current bucket\r\n int highestBucketIndex = -1;\r\n for (Iterator j = nodeList.iterator(); j.hasNext(); ) {\r\n Object param = j.next();\r\n int idx = ((Integer) indexCache.get(param)).intValue();\r\n if (idx < i && idx > highestBucketIndex) {\r\n highestBucketIndex = idx;\r\n }\r\n }\r\n if (highestBucketIndex > -1) {\r\n lambdaTable[highestBucketIndex].add(new Integer(i));\r\n // make this node's lambda parameters as the highest bucket's parameters\r\n // except this current node.\r\n nodeList.remove(node);\r\n lambdaParameters[highestBucketIndex].addAll(nodeList);\r\n \r\n //System.out.print(\", to bucket \"+highestBucketIndex);\r\n }\r\n }\r\n //System.out.println();\r\n }\r\n }", "public NetworkNode(Node treeNode) {\n height = treeNode.getHeight();\n label = treeNode.getID();\n metaDataString = treeNode.metaDataString;\n for (String metaDataKey: treeNode.getMetaDataNames()) {\n Object metaDataValue = treeNode.getMetaData(metaDataKey);\n metaData.put(metaDataKey, metaDataValue);\n }\n }", "public static void buildStage2 ()\r\n {\r\n \r\n lgt.findParent(); //4\r\n lgt.findChild(0); //6\r\n lgt.insert(12);\r\n lgt.findParent();\r\n lgt.insert(13);\r\n lgt.findParent();\r\n lgt.insert(14);\r\n \r\n lgt.findRoot();\r\n lgt.findChild(0);//2\r\n lgt.findChild(0);//5\r\n lgt.insert(8);\r\n lgt.findParent();\r\n lgt.insert(9);\r\n lgt.findParent();\r\n lgt.insert(10);\r\n lgt.findParent();\r\n lgt.insert(11);\r\n \r\n }", "public Node(Student stu) {\n\t\t\tstudent = stu;\n\t\t\tnext = null;\n\t\t}", "private void convertToNode(RuleContext ctx, Node parentNode) {\n boolean toBeIgnored = ignoringWrappers\n && ctx.getChildCount() == 1\n && ctx.getChild(0) instanceof ParserRuleContext;\n Node n = null;\n if (!toBeIgnored) {\n n = new Node();\n String ruleName = Python3Parser.ruleNames[ctx.getRuleIndex()];\n n.setName(ruleName);\n parentNode.addChild(n);\n }\n for (int i=0;i<ctx.getChildCount();i++) {\n ParseTree element = ctx.getChild ( i );\n if (element instanceof RuleContext) {\n convertToNode ( (RuleContext) element, n == null? parentNode:n);\n }\n }\n }", "public String readS2SN(){\r\n return mFactoryBurnUtil.readS2SN();\r\n }", "public TSPMSTSolution(int[] included, int[] includedT, int[] excluded, int[] excludedT, int iterations, double[] weight)\n {\n// System.out.println(\"CHILD NODE CREATED\");\n this.included = included;\n this.includedT = includedT;\n this.excluded = excluded;\n this.excludedT = excludedT;\n this.iterations = iterations;\n this.weight = weight;\n }", "public HL7Group processNK1s_ToUFD() throws ICANException {\n\n HL7Segment aNK1SegIN = new HL7Segment(\"NK1\");\n HL7Segment aNK1SegOUT = new HL7Segment(\"NK1\");\n HL7Group aNK1GroupIN = new HL7Group();\n HL7Group aNK1GroupOUT = new HL7Group();\n CodeLookUp aRelationship = new CodeLookUp(\"NOK_Relationship.table\", mEnvironment);\n\n aNK1GroupIN = processGroup(HL7_23.Repeat_NK1);\n int i;\n for (i=1; i <= aNK1GroupIN.countSegments(); i++) {\n\n aNK1SegIN = new HL7Segment(aNK1GroupIN.getSegment(i));\n aNK1SegOUT = new HL7Segment(\"NK1\");\n aNK1SegOUT.linkTo(aNK1SegIN);\n aNK1SegOUT.copy(HL7_23.NK1_1_set_ID);\n aNK1SegOUT.copy(HL7_23.NK1_2_next_of_kin_name);\n if (mFacility.equalsIgnoreCase(\"BHH\") ||\n mFacility.equalsIgnoreCase(\"MAR\") ||\n mFacility.equalsIgnoreCase(\"ANG\") ||\n mFacility.equalsIgnoreCase(\"PJC\")) {\n //Perform no translation just copy NOK\n aNK1SegOUT.copy(HL7_23.NK1_3_next_of_kin_relationship);\n } else {\n aNK1SegOUT.set(HL7_23.NK1_3_next_of_kin_relationship,\n aRelationship.getValue(aNK1SegIN.getField(HL7_23.NK1_3_next_of_kin_relationship)));\n }\n aNK1SegOUT.copy(HL7_23.NK1_4_next_of_kin__address, HL7_23.XAD_street_1);\n aNK1SegOUT.copy(HL7_23.NK1_4_next_of_kin__address, HL7_23.XAD_street_2);\n aNK1SegOUT.copy(HL7_23.NK1_4_next_of_kin__address, HL7_23.XAD_city);\n aNK1SegOUT.copy(HL7_23.NK1_4_next_of_kin__address, HL7_23.XAD_state_or_province);\n aNK1SegOUT.copy(HL7_23.NK1_4_next_of_kin__address, HL7_23.XAD_zip);\n// aNK1SegOUT.copy(HL7_23.NK1_4_next_of_kin__address, HL7_23.XAD_type);\n aNK1SegOUT.copy(HL7_23.NK1_5_next_of_kin__phone, HL7_23.XTN_telephone_number);\n aNK1SegOUT.copy(HL7_23.NK1_5_next_of_kin__phone, HL7_23.XTN_telecom_use);\n aNK1SegOUT.copy(HL7_23.NK1_6_business_phone_num, HL7_23.XTN_telephone_number);\n aNK1SegOUT.copy(HL7_23.NK1_6_business_phone_num, HL7_23.XTN_telecom_use);\n aNK1SegOUT.copy(HL7_23.NK1_7_contact_role);\n\n aNK1GroupOUT.append(aNK1SegOUT);\n }\n\n return aNK1GroupOUT;\n }", "public void updateSignatureStrings() {\n\t\t\tm_sStringList[m_nFIELD_SIGNATURE_STATE] =\n\t\t\t\t\t\t\tm_aSIGNATURE_STATE_STRINGS.get(\n\t\t\t\t\t\t\t\t\tSignatureState.fromInt(getSignatureState())\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t );\n\t\t\tm_sStringList[m_nFIELD_DOCUMENT_VERF_STATE] = \n\t\t\t\tm_aDOCUMENT_VERIF_STATE_CONDT_STRINGS.get( m_sDOCUMENT_VERIF_STATE[getDocumentVerificationState()]);\n\t\t\t\n\t\t\tif(m_aChildCertificate != null) {\n\t\t\t\t//the certificate state value should be udated elsewhere\n\t\t\t\t//set the node name\n\t\t\t\tXOX_X509CertificateDisplay aCertDisplay = \n\t\t\t\t\t(XOX_X509CertificateDisplay)UnoRuntime.queryInterface(XOX_X509CertificateDisplay.class, \n\t\t\t\t\t\t\tm_aChildCertificate.getCertificate());\n\t\t\t\t\n\t\t\t\tif(aCertDisplay != null) {\n\t\t\t\t\t//set the certificate owner\n\t\t\t\t\tm_sStringList[m_nFIELD_OWNER_NAME] = \"b\"+aCertDisplay.getSubjectDisplayName();\t\n\t\t\t\t\t//grab the CA\n\t\t\t\t\tm_sStringList[m_nFIELD_ISSUER] = \"r\"+aCertDisplay.getIssuerDisplayName();\n\t\t\t\t}\n\t\t\t\t//set the CA state and the certificate state\n\t\t\t\t//the certificate state value (only to the string fields)\n\t\t\t\t//grab the string for certificate status\n\t\t\t\tm_sStringList[m_nFIELD_CERTIFICATE_STATE] =\n\t\t\t\t\t\t\t\tm_aCERTIFICATE_STATE_STRINGS.get(\n\t\t\t\t\t\t\t\t\t\tCertificateState.fromInt( m_aChildCertificate.getCertificateState())\n\t\t\t\t\t\t\t\t\t\t\t\t);\n\t\t\t\tm_sStringList[m_nFIELD_CERTIFICATE_VERF_CONDITIONS] =\n\t\t\t\t\t\t\tm_aCERTIFICATE_STATE_CONDITIONS_STRINGS.get(\n\t\t\t\t\t\t\t\t\tCertificateStateConditions.fromInt(m_aChildCertificate.getCertificateStateConditions())\n\t\t\t\t\t\t\t\t\t\t\t);\n\t\t\t\tm_sStringList[m_nFIELD_ISSUER_VERF_CONDITIONS] =\n\t\t\t\t\t\t\tm_aCA_STATE_CONDITIONS_STRINGS.get(\n\t\t\t\t\t\t\t\t\tCertificationAuthorityState.fromInt(m_aChildCertificate.getCertificationAutorityState())\n\t\t\t\t\t\t\t\t\t\t\t);\t\t\n\t\t\t}\n\t\t\t//retrieve the signing time and display it\n\t\t\tif(get_xSignatureState() != null)\n\t\t\t\tm_sStringList[m_nFIELD_DATE_SIGN] = \"s\"+get_xSignatureState().getSigningTime();\n\t}", "public String getSSN()\r\n\t{\r\n\t\treturn ssn.getModelObjectAsString();\r\n\t}", "public void combine() {\n\t\t// differences with leafNode: need to address ptrs, and need to demote parent\n\t\tif (next == null) {\n\t\t\treturn;\n\t\t}\n\t\tSystem.out.println(\"combine internal:\\t\" + Arrays.toString(keys) + lastindex + \"\\t\" + Arrays.toString(next.keys) + next.lastindex);\n\t\tNode nextNode = next;\n\n\t\t// demote parent\n\t\tNode parentNode = nextNode.parentref.getNode();\n\t\tint parentIndex = nextNode.parentref.getIndex();\n\t\tlastindex += 1;\n\t\tkeys[lastindex] = parentNode.keys[parentIndex];\n\t\tptrs[lastindex] = next.ptrs[0];\n\t\tptrs[lastindex].parentref = new Reference(this, lastindex, false);\n\n\t\tparentNode.delete(parentIndex); // delete parent\n\n\t\t// transfer next sibling node's date into current node\n\t\tfor (int i = 1; i <= next.lastindex; i++) { // start from 1\n\t\t\tlastindex += 1;\n\t\t\tkeys[lastindex] = next.keys[i];\n\t\t\tptrs[lastindex] = next.ptrs[i];\n\t\t\tptrs[lastindex].parentref = new Reference(this, lastindex, false); // set parent\n\t\t}\n\t\t// connect node, delete nextNode\n\t\tNode nextNextNode = nextNode.next;\n\t\tthis.next = nextNextNode;\n\t\tif (nextNextNode != null) {\n\t\t\tnextNextNode.prev = this;\n\t\t}\n\t}", "public Node insertByNumber(Node bstNode, String name, String sname, String no){\n\t\tif(bstNode == null){\n\t\t\tbstNode = new Node(name, sname, no);\n\t\t\tbstNode.setParent(parent);\n\t\t}\n\t\telse{\n\t\t\tparent = bstNode;\n\t\t\tif(no.compareTo(bstNode.getNumber())<0)\n\t\t\t\tbstNode.setLeft(insertByNumber(bstNode.getLeft(),name,sname,no));\n\t\t\telse\n\t\t\t\tbstNode.setRight(insertByNumber(bstNode.getRight(),name,sname,no));\n\t\t}\n\t\treturn bstNode;\n\t\t\n\t}", "@Override\r\n\tpublic void transform(ClassNode cn) {\n\t\t\r\n\t}", "private void buildNetProperties() {\n\t\tint nofP, nofT, i;\n\t\tString s;\n\n\t\troot.add(netProperties);\n\t\tgetBasicNetProperty(woflan.InfoNofP, woflan.InfoPName, \"Places\",\n\t\t\t\tnetProperties);\n\t\tgetBasicNetProperty(woflan.InfoNofT, woflan.InfoTName, \"Transitions\",\n\t\t\t\tnetProperties);\n\t}", "private void buildSettlement() {\r\n\t\t// client.setCurrentPhase(Constants.PHASE_3);\r\n\t\tlastSettlementNode = clickedNode;\r\n\t\tMessage message = new Message(clickedNode, true, null);\r\n\t\tsendMessage(message);\r\n\t}", "private void initGraph() {\n nodeMap = Maps.newIdentityHashMap();\n stream.forEach(t -> {\n Object sourceKey = sourceId.extractValue(t.get(sourceId.getTableId()));\n Object targetKey = targetId.extractValue(t.get(targetId.getTableId()));\n ClosureNode sourceNode = nodeMap.get(sourceKey);\n ClosureNode targetNode = nodeMap.get(targetKey);\n if (sourceNode == null) {\n sourceNode = new ClosureNode(sourceKey);\n nodeMap.put(sourceKey, sourceNode);\n }\n if (targetNode == null) {\n targetNode = new ClosureNode(targetKey);\n nodeMap.put(targetKey, targetNode);\n }\n sourceNode.next.add(targetNode);\n });\n\n }", "public long wsadd_node(NodeWS node)\r\n\t\t\t\t{ \r\n\t\t\t\t\t\r\n\t\t\t\t\t\r\n\t\t\t\t\tlong id = 0; //id de la tabla user (único) \r\n\t\t\t\t Node nodeC = new Node(node.getNode_name(),node.getMAC_address(),node.getPort_number());\r\n\t\t\t\t \r\n\t\t\t\t //User cliente1 = new User(\"[email protected]\", \"gutie33\", 1, \"Luis\",\"677899876\", \"Informatica\"); \r\n\t\t\t\t \r\n\t\t\t\t try \r\n\t\t\t\t { \r\n\t\t\t\t iniciaOperacion(); \r\n\t\t\t\t \r\n\t\t\t\t id= (Long) sesion.createQuery(\"SELECT u.id_company FROM Company u WHERE u.company_name ='\"+node.getName_company()+\"'\").uniqueResult();\r\n\t\t\t\t Company x = (Company) sesion.load(Company.class, id);\r\n\t\t\t\t x.addNodo(nodeC);\r\n\t\t\t\t \r\n\t\t\t\t\t nodeC.setCompany(x);\r\n\t\t\t\t \r\n\t\t\t\t //sesion.update(compx);\r\n\t\t\t\t \r\n\t\t\t\t \r\n\t\t\t\t //metodo para guardar cliente (del objeto hibernate.sesion) \r\n\t\t\t\t tx.commit(); \r\n\t\t\t\t }catch(HibernateException he) \r\n\t\t\t\t { \r\n\t\t\t\t manejaExcepcion(he);\r\n\t\t\t\t throw he; \r\n\t\t\t\t }finally \r\n\t\t\t\t { \r\n\t\t\t\t \t//Busqueda del id con qu elo ha introducido a la BBDD\r\n\t\t\t\t \tid= (Long) sesion.createQuery(\"SELECT u.id_node FROM Node u WHERE u.node_name ='\"+node.getNode_name()+\"'\").uniqueResult();\r\n\t\t\t\t sesion.close(); \r\n\t\t\t\t } \r\n\t\t\t\t return id; \r\n\t\t\t\t}", "public void StartNode (String addedNode, String message) {\n\t\t\n\t\tString node = addedNode;\n\t\tNodeandMessage(node, message);\n\t\tnetworkk.resetMessage();\n\t\tnetworkk.setMessage(node);\n\t\tsetNodetohaveMessage(node);\n\t}", "private String getBfsOutput(String ans, Queue<BTNode> q, Queue<Character> s, BTNode currNode) {\n int nodeCount = 1;\n while (true){\n if (currNode.mIsLeaf) return ans.substring(0,ans.length()-1);\n s.enqueue('#');\n int nextCount = 0;\n //enqueue all the nodes/signs in current high. and add the relevant values for ans\n while (nodeCount > 0){\n currNode = q.dequeue();\n ans+=currNode.toString();\n ans+=s.dequeue();\n nextCount += currNode.mCurrentChildrenNum;\n for (int i = 0; i < currNode.mCurrentChildrenNum && currNode.mChildren[i] != null; i++) {\n q.enqueue(currNode.mChildren[i]);\n if (i < currNode.mCurrentChildrenNum - 1) s.enqueue('|');\n else\n if (nodeCount > 1) s.enqueue('^');\n }\n nodeCount--;\n }\n nodeCount = nextCount;\n }\n }", "private void postorder(HuffmanNode n, String s) {\r\n \tif (n == null)\r\n \t\treturn;\r\n \tif (n.left == null && n.right == null) {\r\n \t\tcharToCode.put(n.character, s);\r\n \t\tcodeToChar.put(s, n.character);\r\n \t}\r\n \tpostorder(n.left, s + '0');\r\n\t\tpostorder(n.right, s + '1');\r\n }", "@Deprecated\n\tpublic void connectNodesWithParents() {\n\t\tpipeline.connectNodesWithParents(null);\n\t}", "private ngtXMLHandler getCodePosition( String usid, ngtXMLHandler contentXML) throws boRuntimeException\n {\n ngtXMLHandler nxml = null;\n if(usid == null || usid.equals(\"-1\") || usid.equals(\"0\"))\n {//caso não seja passado nenhum usid \n String ct_sid = null;\n ngtXMLHandler ct_child = contentXML;\n while(ct_sid == null && ct_child != null && ct_child.getNode() != null)\n { \n ct_sid = ct_child.getAttribute(\"sid\");\n ct_child.goFirstChild();\n }\n //vamos tentar a definição do procedimento que tenha o sid do que foi passado. Comum na chamada de procedimentos\n if(ct_sid != null)\n {\n try{\n Node n_nxml = getActualXml().getDocument().selectSingleNode(\"//defProcedure/descendant::*[@sid='\"+ct_sid+\"']\");\n if(n_nxml == null)\n {\n nxml = new ngtXMLHandler(getActualXml().getDocument().getDocumentElement());\n }\n else\n {\n nxml = new ngtXMLHandler(n_nxml);\n while(nxml != null && nxml.getNode() != null && !nxml.getNodeName().equals(\"program\"))\n {\n nxml.goParentNode(); \n }\n }\n }catch(Exception e){nxml = new ngtXMLHandler(getActualXml().getDocument().getDocumentElement());}\n }\n else\n {\n nxml = new ngtXMLHandler(getActualXml().getDocument().getDocumentElement());\n }\n \n nxml.goChildNode(\"program\");\n nxml.goChildNode(\"code\"); \n }\n else\n {\n nxml = getNode(usid); \n if(nxml == null)\n {\n nxml = getCodePosition(null,contentXML);\n }\n } \n return nxml;\n }", "static Posn translate ( Posn p, double dx, double dy ) {\n\t// return .... ;\n\t// Take stock\n\t// return ... p ... dx ... dy ; // <- We know this from Posn p\n\t// return new Posn ( ... p.x ... p.y ... dx ... dy ); // <- We know this from Posn translate\n\t// return new Posn ( ... p.x ... p.y ... dx ... dy, ... p.x ... p.y ... dx ... dy );\t\n\treturn new Posn ( p.x + dx, p.y + dy );\t\n }", "private void make_string(ArrayList node_block , TObj parrentNode, String prefix) {\n\t\tint seq = 0;\n\t\tint end_seq = 0;\n\t\tint prev_seq = 0;\n\t\tStringBuffer sb = new StringBuffer();\n\t\tfor(int j =0 ; j < node_block.size() ; j ++) {\n\t\t\tnode_line_data text = (node_line_data)node_block.get(j);\n\t\t\tif (j == 0) {\n\t\t\t\tseq = text.seq;\n\t\t\t\tprev_seq = text.seq; // 2014.09.16\n\t\t\t}\n\t\t\tif(j == node_block.size()-1)\n\t\t\t\tend_seq = text.seq;\n\t\t\t//sb.append(text.line_data.trim()).append(\"\\n\");\n\t\t\t// 2014.5.21\n\n\t\t\tif(prev_seq != text.seq) { // 2014.09.16\n\t\t\t\tprev_seq = text.seq;\n\t\t\t\tsb.append(\"\\n\");\n\t\t\t}\n\t\t\tsb.append(text.line_data.trim());\n\n/*\t\t\tif(j < node_block.size() -1 ) {\n\t\t\t\tsb.append(\"\\n\");\n\t\t\t}*/\n\n\n\n\n\t\t\tlocallog.trace(\" TEXT ::: \" , text.line_data);\n\t\t}\n\t\t// 2014.01.08\n\t\tif(sb.toString().trim().length() > 0) {\n\t\t\tTObj newnodedata = new TObj(_TEXT_TYPE, make_path(prefix, \"text\"), sb.toString(), 100, new TLocation(seq+1, end_seq+1, 0,0, \"\") );\n\t\t\tparrentNode.add(newnodedata);\n\t\t}\n\t\tnode_block.clear();\n\t}", "private void buildProcessGraph() {\n\n BpmnProcessDefinitionBuilder builder = BpmnProcessDefinitionBuilder.newBuilder();\n\n // Building the IntermediateTimer\n eventBasedXorGatewayNode = BpmnNodeFactory.createBpmnEventBasedXorGatewayNode(builder);\n\n intermediateEvent1Node = BpmnNodeFactory.createBpmnIntermediateTimerEventNode(builder, NEW_WAITING_TIME_1);\n\n intermediateEvent2Node = BpmnNodeFactory.createBpmnIntermediateTimerEventNode(builder, NEW_WAITING_TIME_2);\n\n endNode1 = BpmnCustomNodeFactory.createBpmnNullNode(builder);\n endNode2 = BpmnCustomNodeFactory.createBpmnNullNode(builder);\n\n ControlFlowFactory.createControlFlowFromTo(builder, eventBasedXorGatewayNode, intermediateEvent1Node);\n ControlFlowFactory.createControlFlowFromTo(builder, intermediateEvent1Node, endNode1);\n\n ControlFlowFactory.createControlFlowFromTo(builder, eventBasedXorGatewayNode, intermediateEvent2Node);\n ControlFlowFactory.createControlFlowFromTo(builder, intermediateEvent2Node, endNode2);\n\n }", "public edu.usfca.cs.dfs.StorageMessages.StorageNodeInfo.Builder addSnInfoBuilder() {\n return getSnInfoFieldBuilder().addBuilder(\n edu.usfca.cs.dfs.StorageMessages.StorageNodeInfo.getDefaultInstance());\n }", "public edu.usfca.cs.dfs.StorageMessages.StorageNodeInfo.Builder addSnInfoBuilder() {\n return getSnInfoFieldBuilder().addBuilder(\n edu.usfca.cs.dfs.StorageMessages.StorageNodeInfo.getDefaultInstance());\n }", "public edu.usfca.cs.dfs.StorageMessages.StorageNodeInfo.Builder addSnInfoBuilder() {\n return getSnInfoFieldBuilder().addBuilder(\n edu.usfca.cs.dfs.StorageMessages.StorageNodeInfo.getDefaultInstance());\n }", "private Candidate constructCandidate(final ActivationContext currentContext) {\n assert currentContext.getNumberOfClasses() == 3;\n // currentContext has a trace:\n // [C_0, s_0, C_1, s_1, C_2]\n // We now find possible \"piblings\", i.e. siblings of its parent.\n // For that, we invoke findExtensions on the prefix\n // [C_0]\n Map<Integer, ActivationContext> piblings = findExtensions(currentContext.getClass(0));\n\n // Also, we find possible siblings. For that, we invoke findExtensions\n // on the prefix\n // [C_0, s_0, C_1]\n Map<Integer, ActivationContext> siblings = findExtensions(currentContext.getClass(0),\n currentContext.getChildIndex(0), currentContext.getClass(1));\n\n // We now construct a super-instruction candidate, i.e.\n // a tree of height 2. The root of the tree is C_0 (its Java type is unknown).\n Candidate candidate = new Candidate(currentContext.getClass(0), \"?\");\n // Now, we add the children of C_0, i.e. the siblings of C_1 and C_1 itself.\n for (int piblingSlot : piblings.keySet()) {\n if (piblingSlot == currentContext.getChildIndex(0)) {\n // This is C_1. We add it to the candidate and proceed\n // with adding the siblings of C_2 and C_2 itself.\n Candidate.AstNode child =\n candidate.getRoot().setChild(piblingSlot, currentContext.getClass(1), \"?\");\n for (int siblingSlot : siblings.keySet()) {\n if (siblingSlot == currentContext.getChildIndex(1)) {\n // Add C_2\n child.setChild(siblingSlot,\n currentContext.getClass(2),\n currentContext.getJavaType());\n } else {\n // Add a sibling of C_2\n ActivationContext sibling = siblings.get(siblingSlot);\n child.setChild(siblingSlot,\n sibling.getClass(2),\n sibling.getJavaType());\n }\n }\n } else {\n ActivationContext pibling = piblings.get(piblingSlot);\n // Add a sibling of C_1.\n assert pibling.getNumberOfClasses() == 2;\n candidate.getRoot().setChild(piblingSlot,\n pibling.getClass(1),\n pibling.getJavaType());\n }\n }\n // The score of the super-instruction candidate corresponds to the number\n // of activations of the current context.\n candidate.setScore(contexts.get(currentContext));\n return candidate;\n }", "@Override\n public String getArticleNode() {\n return ebsco_book_node;\n }", "public abstract TreeMarshaller createMarshallingContext(HierarchicalStreamWriter hierarchicalStreamWriter, ConverterLookup converterLookup, Mapper mapper);", "public void AddCPChilds(DefaultMutableTreeNode rootNode, int cpindex)\n {\n \n short tag = clsread.constant_pools[cpindex].getTag();\n rootNode.add(new DefaultMutableTreeNode(\n \"tag: \" + tag));\n \n switch (tag) {\n case AbstractCPInfo.CONSTANT_Utf8:\n generateTreeNode(rootNode, (ConstantUtf8Info) clsread.constant_pools[cpindex]);\n break;\n\n case AbstractCPInfo.CONSTANT_Integer:\n generateTreeNode(rootNode, (ConstantIntegerInfo) clsread.constant_pools[cpindex]);\n break;\n\n case AbstractCPInfo.CONSTANT_Float:\n generateTreeNode(rootNode, (ConstantFloatInfo) clsread.constant_pools[cpindex]);\n break;\n\n case AbstractCPInfo.CONSTANT_Long:\n generateTreeNode(rootNode, (ConstantLongInfo) clsread.constant_pools[cpindex]);\n break;\n\n case AbstractCPInfo.CONSTANT_Double:\n generateTreeNode(rootNode, (ConstantDoubleInfo) clsread.constant_pools[cpindex]);\n break;\n\n case AbstractCPInfo.CONSTANT_Class:\n generateTreeNode(rootNode, (ConstantClassInfo) clsread.constant_pools[cpindex]);\n break;\n\n case AbstractCPInfo.CONSTANT_String:\n generateTreeNode(rootNode, (ConstantStringInfo) clsread.constant_pools[cpindex]);\n break;\n\n case AbstractCPInfo.CONSTANT_Fieldref:\n generateTreeNode(rootNode, (ConstantFieldrefInfo) clsread.constant_pools[cpindex]);\n break;\n\n case AbstractCPInfo.CONSTANT_Methodref:\n generateTreeNode(rootNode, (ConstantMethodrefInfo) clsread.constant_pools[cpindex]);\n break;\n\n case AbstractCPInfo.CONSTANT_InterfaceMethodref:\n generateTreeNode(rootNode, (ConstantInterfaceMethodrefInfo) clsread.constant_pools[cpindex]);\n break;\n\n case AbstractCPInfo.CONSTANT_NameAndType:\n generateTreeNode(rootNode, (ConstantNameAndTypeInfo) clsread.constant_pools[cpindex]);\n break;\n\n case AbstractCPInfo.CONSTANT_MethodHandle:\n generateTreeNode(rootNode, (ConstantMethodHandleInfo) clsread.constant_pools[cpindex]);\n break;\n \n case AbstractCPInfo.CONSTANT_MethodType:\n generateTreeNode(rootNode, (ConstantMethodTypeInfo) clsread.constant_pools[cpindex]);\n break;\n \n case AbstractCPInfo.CONSTANT_InvokeDynamic:\n generateTreeNode(rootNode, (ConstantInvokeDynamicInfo) clsread.constant_pools[cpindex]);\n break;\n \n default:\n // TODO: Add exception\n break;\n }\n }", "private void addElementNode(BaleElement nbe,int prior)\n{\n if (nbe.getBubbleType() != BaleFragmentType.NONE) {\n BaleElement.Branch bbe = (BaleElement.Branch) nbe;\n if (cur_parent == root_element) {\n\t int j = -1;\n\t for (int i = new_children.size() - 1; i >= 0; --i) {\n\t BaleElement celt = new_children.get(i);\n\t if (celt.isComment() || celt.isEmpty()) j = i;\n\t else break;\n\t }\n\t if (j >= 0) {\n\t while (j < new_children.size()) {\n\t BaleElement celt = new_children.remove(j);\n\t bbe.add(celt);\n\t }\n\t }\n }\n else {\n\t int j = -1;\n\t for (int i = cur_parent.getElementCount() - 1; i >= 0; --i) {\n\t BaleElement celt = cur_parent.getBaleElement(i);\n\t if (celt.isComment() || celt.isEmpty()) j = i;\n\t else break;\n\t }\n\t if (j >= 0) {\n\t while (j < cur_parent.getElementCount()) {\n\t BaleElement celt = cur_parent.getBaleElement(j);\n\t cur_parent.remove(j,j);\n\t bbe.add(celt);\n\t }\n\t }\n }\n }\n else if (nbe.isComment() && prior > 0 && cur_parent != root_element) {\n BaleElement.Branch bbe = (BaleElement.Branch) nbe;\n int n = cur_parent.getElementCount();\n prior -= 1;\t\t\t// is this what we want?\n int j = n-prior;\n for (int i = 0; i < prior; ++ i) {\n\t BaleElement celt = cur_parent.getBaleElement(j);\n\t cur_parent.remove(j,j);\n\t bbe.add(celt);\n }\n }\n else if (nbe.isComment() && prior > 0 && cur_parent == root_element) {\n BaleElement.Branch bbe = (BaleElement.Branch) nbe;\n int n = new_children.size();\n int j = n-prior+1;\n for (int i = 0; i < prior-1; ++ i) {\n\t BaleElement celt = new_children.get(j);\n\t new_children.remove(j);\n\t bbe.add(celt);\n }\n }\n\n if (cur_parent == root_element) {\n new_children.add(nbe);\n }\n else {\n cur_parent.add(nbe);\n }\n}", "private Node convertNode(Document sourceDocument, Node sourceNode, Document visualDocument,\n\t\t\tMap<Node, Node> sourceVisualMapping) {\n\t\tVpeTemplate vpeTemplate = templateProvider.getTemplate(sourceDocument, sourceNode);\n\t\tVpeCreationData creationData = vpeTemplate.create(sourceNode, visualDocument);\n\n\t\tNode visualNode = creationData.getVisualNode();\n\t\tif (visualNode != null) {\n\t\t\tsourceVisualMapping.put(sourceNode, visualNode);\n\t\t}\n\t\t\n\t\tVpeElementData elementData = creationData.getElementData();\n\t\tif (elementData != null) {\n\t\t\tList<NodeData> nodesData = elementData.getNodesData();\n\t\t\tif (nodesData != null) {\n\t\t\t\tfor (NodeData nodeData : nodesData) {\n\t\t\t\t\tif (nodeData.getSourceNode() != null && nodeData.getVisualNode() != null) {\n\t\t\t\t\t\tsourceVisualMapping.put(nodeData.getSourceNode(), nodeData.getVisualNode());\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t\n\t\tList<VpeChildrenInfo> childrenInfos = creationData.getChildrenInfoList();\n\t\tif (childrenInfos != null) {\n\t\t\tfor (VpeChildrenInfo childrenInfo : childrenInfos) {\n\t\t\t\tList<Node> sourceChildren = childrenInfo.getSourceChildren();\n\t\t\t\tElement visualParent = childrenInfo.getVisualParent();\n\t\t\t\tfor (Node sourceChild : sourceChildren) {\n\t\t\t\t\tNode visualChild \n\t\t\t\t\t\t\t= convertNode(sourceDocument, sourceChild, visualDocument, sourceVisualMapping);\n\t\t\t\t\tif (visualChild != null) {\n\t\t\t\t\t\tvisualParent.appendChild(visualChild);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t} else {\n\t\t\tNodeList sourceChildren = sourceNode.getChildNodes();\n\t\t\tfor (int i = 0; i < sourceChildren.getLength(); i++) {\n\t\t\t\tNode sourceChild = sourceChildren.item(i);\n\t\t\t\tNode visualChild \n\t\t\t\t\t\t= convertNode(sourceDocument, sourceChild, visualDocument, sourceVisualMapping);\n\t\t\t\tif (visualChild != null) {\n\t\t\t\t\tvisualNode.appendChild(visualChild);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t\n\t\t\n\t\t\n\t\treturn visualNode;\n\t}", "public void connect(ASNode node) {\n\n\t\t/* Create new paths for this node and other node */\n\t\tArrayList<ASNode> newPath1 = new ArrayList<ASNode>();\n\t\tArrayList<ASNode> newPath2 = new ArrayList<ASNode>();\n\t\tnewPath1.add(node);\n\t\tnewPath2.add(this);\n\t\t/* Adds the Node to each others maps to get ready for exchange */\n\t\tMap<Integer, ArrayList<ASNode>> map1 = addNodeToTable(this, paths);\n\t\tMap<Integer, ArrayList<ASNode>> map2 = addNodeToTable(node,\n\t\t\t\tnode.getPaths());\n\n\t\t/* put new path into this node */\n\t\tpaths.put(node.getASNum(), newPath1);\n\t\tmap1.put(this.ASNum, newPath2);\n\t\t/* put new path into other node */\n\t\tnode.setPathsCombine(map1);\n\t\t/* exchange maps and see if any path if shorter, if shorter than adjust */\n\t\tsetPathsCombine(map2);\n\t\t/* Add each other as neighbors */\n\t\tneighbors.add(node);\n\t\tnode.getNeighbors().add(this);\n\t\t\n\t\t/* Announce each other's paths */\n\t\tnode.announce(this);\n\t\tannounce(node);\n\t\t\n\t\t// Exchange IP tables\n\t\tfor (PrefixPair p : IPTable.keySet()) {\n\t\t\tNextPair n = new NextPair(this, IPTable.get(p).length);\n\t\t\tannounceIP(p, n);\n\t\t}\n\t\tfor (PrefixPair p : node.IPTable.keySet()) {\n\t\t\tNextPair n = new NextPair(node, node.IPTable.get(p).length);\n\t\t\tnode.announceIP(p, n);\n\t\t}\n\t\tfor (PrefixPair p : IPTable.keySet()) {\n\t\t\tNextPair n = new NextPair(this, IPTable.get(p).length);\n\t\t\tannounceIP(p, n);\n\t\t}\n\t}", "public edu.usfca.cs.dfs.StorageMessages.StorageNodeInfo getSnInfo(int index) {\n if (snInfoBuilder_ == null) {\n return snInfo_.get(index);\n } else {\n return snInfoBuilder_.getMessage(index);\n }\n }", "public edu.usfca.cs.dfs.StorageMessages.StorageNodeInfo getSnInfo(int index) {\n if (snInfoBuilder_ == null) {\n return snInfo_.get(index);\n } else {\n return snInfoBuilder_.getMessage(index);\n }\n }", "public edu.usfca.cs.dfs.StorageMessages.StorageNodeInfo getSnInfo(int index) {\n if (snInfoBuilder_ == null) {\n return snInfo_.get(index);\n } else {\n return snInfoBuilder_.getMessage(index);\n }\n }", "private void initializeEdges() {\n for (NasmInst inst : nasm.listeInst) {\n if (inst.source == null || inst.destination == null)\n return;\n Node from = inst2Node.get(label2Inst.get(inst.source.toString()));\n Node to = inst2Node.get(label2Inst.get(inst.destination.toString()));\n if (from == null || to == null)\n return;\n graph.addEdge(from, to);\n }\n }", "private void init() {\n myNodeDetails = new NodeDetails();\n try {\n //port will store value of port used for connection\n //eg: port = 5554*2 = 11108\n String port = String.valueOf(Integer.parseInt(getMyNodeId()) * 2);\n //nodeIdHash will store hash of nodeId =>\n // eg: nodeIdHash = hashgen(5554)\n String nodeIdHash = genHash(getMyNodeId());\n myNodeDetails.setPort(port);\n myNodeDetails.setNodeIdHash(nodeIdHash);\n myNodeDetails.setPredecessorPort(port);\n myNodeDetails.setSuccessorPort(port);\n myNodeDetails.setSuccessorNodeIdHash(nodeIdHash);\n myNodeDetails.setPredecessorNodeIdHash(nodeIdHash);\n myNodeDetails.setFirstNode(true);\n\n if (getMyNodeId().equalsIgnoreCase(masterPort)) {\n chordNodeList = new ArrayList<NodeDetails>();\n chordNodeList.add(myNodeDetails);\n }\n\n } catch (Exception e) {\n Log.e(TAG,\"**************************Exception in init()**********************\");\n e.printStackTrace();\n }\n }", "@Override\r\n\tpublic void add(snstatus sns) {\n\t\tsuper.getHibernateTemplate().save(sns); \r\n\t}", "public void readMessagingNodesList() {\n\t\tiStream = new ByteArrayInputStream(marshalledBytes);\t\n\t\tdin = new DataInputStream(new BufferedInputStream(iStream));\n\t\ttry {\n\t\t\tint totalCr = din.readInt();\n\t\t\tint nNeededConnections = din.readInt();\n\t\t\tint listByteLength = din.readInt();\n\t\t\tbyte[] listBytes = new byte[listByteLength];\n\t\t\tdin.readFully(listBytes);\n\n\t\t\tMessagingNodesList newList = new MessagingNodesList();\n\t\t\t//Unmarshall object of Messaging Nodes in list\n\t\t\tByteArrayInputStream bis = new ByteArrayInputStream(listBytes);\n\t\t\tDataInputStream dis = new DataInputStream(bis);\n\n\t\t\tint nLength, nLPort; byte[] nodeLinkBytes; String nIP;\n\t\t\tfor (int i=0; i< nNeededConnections; i++ ) {\n\t\t\t\tnLength = dis.readInt();\n\t\t\t\tnodeLinkBytes = new byte[nLength];\n\t\t\t\tdis.readFully(nodeLinkBytes);\n\t\t\t\tnIP= new String(nodeLinkBytes);\n\t\t\t\tnLPort = dis.readInt();\n\t\t\t\tnewList.addNode(nIP, nLPort);\n\t\t\t}\n\t\t\tiStream.close(); din.close();\n\t\t\t\n\t\t\tnode.setMessagingNodesList(newList,totalCr);\n\t\t\tnode.setPeerNumber(totalCr+node.getNumberNeededPeers());\n\t\t\tif(node.getNumberNeededPeers() ==0 ) System.out.println(\"All connections are established. Number of connections: \"+(node.getCurrentMessagingNodesList().getSize()));\n\n\t\t\t// Creating a registration message for each node in the messagingNodesList\n\t\t\tfor(int i=0; i<node.getFutureMessagingNodesList().getSize(); i++) {\n\t\t\t\tMessage message = new RegisterMessage(node.ipAddr, node.portNum);\n\t\t\t\tString friendIP = node.getFutureMessagingNodesList().getNodeAtIndex(i).ipAddress;\n\t\t\t\tint friendPort = node.getFutureMessagingNodesList().getNodeAtIndex(i).port;\n\n\t\t\t\t// Creating a socket that connects directly to the registry.\n\t\t\t\tSocket senderSocket = new Socket(friendIP, friendPort );\n\t\t\t\tnode.getConnections().addConnection(friendIP, senderSocket);\n\t\t\t\tnew TCPSender(senderSocket, message);\n\t\t\t}\n\t\t} catch (IOException e) {System.out.println(\"Failed to read message. \"); }\n\t}", "private void prefix(ExpressionNodes root, StringBuilder sb)\n\t {\n\t \t\n\t \t// add the string of this node to the the string builder \n\t \tsb.append(root.data);\n\t \t\n\t \t// add a space in between nodes for clarity.\n\t \tsb.append(\" \");\n\t \t\n\t \tif (root.left != null) // if there is a left child\n\t \t{ \n\t \t\tprefix(root.left, sb); // run recursive method \n\t \t}\n\t \t\n\t \tif (root.right != null) // if there is a right child\n\t \t{ \n\t \t\tprefix(root.right, sb); // run recursive method \n\t \t}\n\t \t\n\t }", "SSElements createSSElements();", "protected void prtln(String s) {\n\t\tif (debug) {\n\t\t\tSystem.out.println(\"ccStandardsNode: \" + s);\n\t\t}\n\t}", "private static void doTransform(Tree t) {\n\n if (t.value().startsWith(\"QP\")) {\n //look at the children\n List<Tree> children = t.getChildrenAsList();\n if (children.size() >= 3 && children.get(0).isPreTerminal()) {\n //go through the children and check if they match the structure we want\n String child1 = children.get(0).value();\n String child2 = children.get(1).value();\n String child3 = children.get(2).value();\n if((child3.startsWith(\"CD\") || child3.startsWith(\"DT\")) &&\n (child1.startsWith(\"RB\") || child1.startsWith(\"JJ\") || child1.startsWith(\"IN\")) &&\n (child2.startsWith(\"IN\") || child2.startsWith(\"JJ\"))) {\n transformQP(t);\n }\n }\n /* --- to be written or deleted\n } else if (t.value().startsWith(\"NP\")) {\n //look at the children\n List<Tree> children = t.getChildrenAsList();\n if (children.size() >= 3) {\n\n }\n ---- */\n } else if (t.isPhrasal()) {\n for (Tree child : t.getChildrenAsList()) {\n doTransform(child);\n }\n }\n }", "NodeChain createNodeChain();", "private void postOrderTraverse(Node<String> node,StringBuilder sb) {\n\n\t\t\t\tif (node != null) {\t\n\t\t\t\t\tpostOrderTraverse(node.left, sb);\n\t\t\t\t\tpostOrderTraverse(node.right,sb);\n\t\t\t\t\tsb.append(node.toString());\n\t\t\t\t\tsb.append(\" \");\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t}\n\t\t}", "public JAXBConverter(NamespacePrefixMapper nsPre) {\n\t\tthis.nsPrefixMapper = nsPre;\n\t}", "@Test\r\n public void testINFR1184() throws Exception {\r\n // create OU A\r\n Document ouAdoc = getDocument(createSuccessfully(\"escidoc_ou_create.xml\"));\r\n String ouAid = getObjidValue(ouAdoc);\r\n\r\n // create OU B\r\n Document ouBdoc = getDocument(createSuccessfully(\"escidoc_ou_create.xml\"));\r\n String ouBid = getObjidValue(ouBdoc);\r\n\r\n // create OU C\r\n Document ouCdoc = getDocument(createSuccessfully(\"escidoc_ou_create.xml\"));\r\n String ouCid = getObjidValue(ouCdoc);\r\n\r\n // A parentOf B\r\n String srelPrefix = determineSrelNamespacePrefix(ouBdoc);\r\n String xlinkPrefix = determineXlinkNamespacePrefix(ouBdoc);\r\n Node parents = selectSingleNode(ouBdoc, XPATH_ORGANIZATIONAL_UNIT_PARENTS);\r\n Element parent =\r\n ouBdoc.createElementNS(\"http://escidoc.de/core/01/structural-relations/\", srelPrefix + \":parent\");\r\n parent.setAttribute(xlinkPrefix + \":href\", \"/oum/organizational-unit/\" + ouAid);\r\n parents.appendChild(parent);\r\n ouBdoc = getDocument(update(ouBid, toString(ouBdoc, true)));\r\n\r\n // B parentOf C\r\n srelPrefix = determineSrelNamespacePrefix(ouCdoc);\r\n xlinkPrefix = determineXlinkNamespacePrefix(ouCdoc);\r\n parents = selectSingleNode(ouCdoc, XPATH_ORGANIZATIONAL_UNIT_PARENTS);\r\n parent = ouCdoc.createElementNS(\"http://escidoc.de/core/01/structural-relations/\", srelPrefix + \":parent\");\r\n parent.setAttribute(xlinkPrefix + \":href\", \"/oum/organizational-unit/\" + ouBid);\r\n parents.appendChild(parent);\r\n ouCdoc = getDocument(update(ouCid, toString(ouCdoc, true)));\r\n\r\n // A parentOf C\r\n srelPrefix = determineSrelNamespacePrefix(ouCdoc);\r\n xlinkPrefix = determineXlinkNamespacePrefix(ouCdoc);\r\n parents = selectSingleNode(ouCdoc, XPATH_ORGANIZATIONAL_UNIT_PARENTS);\r\n parent = (Element) selectSingleNode(parents, XPATH_ORGANIZATIONAL_UNIT_PARENT);\r\n parent.setAttribute(xlinkPrefix + \":href\", \"/oum/organizational-unit/\" + ouAid);\r\n ouCdoc = getDocument(update(ouCid, toString(ouCdoc, true)));\r\n }", "private static void copyToPNU(ParsedAuthorship pn, ParsedNameUsage pnu, IssueContainer issues){\n pnu.getName().setCombinationAuthorship(pn.getCombinationAuthorship());\n pnu.getName().setSanctioningAuthor(pn.getSanctioningAuthor());\n pnu.getName().setBasionymAuthorship(pn.getBasionymAuthorship());\n // propagate notes and unparsed bits found in authorship if not already existing\n setIfNull(pn.getNomenclaturalNote(), pnu.getName()::getNomenclaturalNote, pnu.getName()::setNomenclaturalNote);\n setIfNull(pn.getPublishedIn(), pnu::getPublishedIn, pnu::setPublishedIn);\n setIfNull(pn.getTaxonomicNote(), pnu::getTaxonomicNote, pnu::setTaxonomicNote);\n if (pn.getUnparsed() != null) {\n pnu.getName().setUnparsed(pn.getUnparsed());\n }\n if (pn.isExtinct()) {\n pnu.setExtinct(pn.isExtinct());\n }\n if (pn.isManuscript()) {\n pnu.getName().setNomStatus(NomStatus.MANUSCRIPT);\n }\n\n // issues\n switch (pn.getState()) {\n case PARTIAL:\n issues.addIssue(Issue.PARTIALLY_PARSABLE_NAME);\n break;\n case NONE:\n issues.addIssue(Issue.UNPARSABLE_NAME);\n break;\n }\n\n if (pn.isDoubtful()) {\n issues.addIssue(Issue.DOUBTFUL_NAME);\n }\n // translate warnings into issues\n for (String warn : pn.getWarnings()) {\n if (WARN_TO_ISSUE.containsKey(warn)) {\n issues.addIssue(WARN_TO_ISSUE.get(warn));\n } else {\n LOG.debug(\"Unknown parser warning: {}\", warn);\n }\n }\n }", "public void replaceNodes() {\n for (ConstantPropagationInformation information : constantPropagations) {\n information.parent.getChildren().set(information.childIndex, information.replacement);\n }\n }", "public MMPCOrderNode(Properties ctx, ResultSet rs, String trxName) {\n\n super(ctx, rs, trxName);\n loadNext();\n loadTrl();\n\n // Save to Cache\n s_cache.put(new Integer(getMPC_Order_Node_ID()), this);\n\n }", "private MutableTreeNode convertSubTree(\n MutableTreeNode newCurrentSubTreeRootNode,\n TreeNode oldCurrentSubTreeRootNode) {\n // if this thing has no children\n if (oldCurrentSubTreeRootNode.getChildCount() == 0) {\n return convertTreeNode(oldCurrentSubTreeRootNode);\n }\n // if there are children, then collect all the children and convert\n // each subtree\n else {\n // if the node passed in is null, it means\n // that we are starting off at the root.\n // In that case, create a new convertedTreeNode\n if (newCurrentSubTreeRootNode == null) {\n newCurrentSubTreeRootNode = convertTreeNode(oldCurrentSubTreeRootNode);\n }\n // if the node passed in is not null, it means that it is\n // a converted version of the root of the subtree (the converted\n // root node of the current subtree.\n // what we need to do now is:\n // get the children of the current subtree root\n // convert each subtree of which the children are roots\n // return the current converted rootnode.\n \n // get the number of children\n int numChildren = oldCurrentSubTreeRootNode.getChildCount();\n for (int i = 0; i < numChildren; ++i) {\n // take each child\n TreeNode oldChildTreeNode = oldCurrentSubTreeRootNode.getChild(i) ;\n // convert the child to the new treenode\n MutableTreeNode newChildTreeNode = convertTreeNode(oldChildTreeNode) ;\n // convert the subtree of the child and add it to the current root\n newCurrentSubTreeRootNode.insert(convertSubTree(newChildTreeNode, oldChildTreeNode), i) ;\n }\n // this will be the root after everything is done.\n return newCurrentSubTreeRootNode ;\n }\n }", "private void initialize() {\n\t\t\ttry {\n\t\t\t\tFMAOBO fmaobo = new FMAOBO();\n\t\t\t\tTA ta = new TA (fmaobo);\n\t\t\t\tBp3d bp3d = new Bp3d();\n\t\t\t\t\t\t\t\t\n\t\t\t\tMap<String, TreeParent> treeParents = \n\t\t\t\t\tnew TreeMap<String, TreeParent>();\n\t\t\t\tMap<String, TreeObject> treeObjects = \n\t\t\t\t\tnew TreeMap<String, TreeObject>();\n\t\t\t\t\t\t\t\t\n\t\t\t\t/** TreeParent/TreeObject作成**/\n\t\t\t\tfor(String id : bp3d.getAllIds()){\t\t\t\t\n\t\t\t\t\tString label = \"\";\n\n\t\t\t\t\tif(ta.contains(id)){\n\t\t\t\t\t\tSet<String> taIds = new TreeSet<String>();\n\t\t\t\t\t\tSet<String> taKanjis = new TreeSet<String>();\n\t\t\t\t\t\tfor(TAEntry taEnt : ta.getTAByFmaId(id)){\n\t\t\t\t\t\t\ttaIds.add(taEnt.getTaId());\n\t\t\t\t\t\t\ttaKanjis.add(taEnt.getTaKanji());\n\t\t\t\t\t\t}\t\t\t\t\t\t\n\t\t\t\t\t\tlabel = Bp3dUtility.join(taIds, \"/\") + \":\" + bp3d.getEntry(id).getEn() \n\t\t\t\t\t\t\t+ \":\" + Bp3dUtility.join(taKanjis, \"/\");\n\t\t\t\t\t}else{\t\t\t\t\t\t\n\t\t\t\t\t\tlabel = id + \":\" + bp3d.getEntry(id).getEn();\n\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\tif(bp3d.hasChild(id)){\n\t\t\t\t\t\ttreeParents.put(id, new TreeParent(label));\n\t\t\t\t\t}else{\n\t\t\t\t\t\ttreeObjects.put(id, new TreeObject(label));\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t/** addChild **/\n\t\t\t\tfor(String pid : bp3d.getReverseMemberOfs().keySet()){\n\t\t\t\t\tTreeParent parent = treeParents.get(pid);\n\t\t\t\t\tfor(String cid : bp3d.getChildren(pid)){\n\t\t\t\t\t\tif(bp3d.hasChild(cid)){\n\t\t\t\t\t\t\tparent.addChild(treeParents.get(cid));\n\t\t\t\t\t\t}else{\n\t\t\t\t\t\t\tif(parent == null){\n\t\t\t\t\t\t\t\tSystem.out.println(\"parent pid=null:\" + pid + \":\" + bp3d.getEntry(pid).getEn());\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tparent.addChild(treeObjects.get(cid));\n\t\t\t\t\t\t}\n\t\t\t\t\t}\t\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t/** parentのないノードをrootにぶら下げる**/\n\t\t\t\tinvisibleRoot = new TreeParent(\"\");\n\t\t\t\t\n\t\t\t\tfor(String id : bp3d.getAllIds()){\n\t\t\t\t\tif(!bp3d.hasParent(id)){\n//\t\t\t\t\t\tSystem.out.println(id + \" has no parent.\");\n\t\t\t\t\t\tif(bp3d.hasChild(id)){\n\t\t\t\t\t\t\tinvisibleRoot.addChild((TreeParent)(treeParents.get(id)));\n\t\t\t\t\t\t}else{\n\t\t\t\t\t\t\tinvisibleRoot.addChild((TreeObject)(treeObjects.get(id)));\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}catch(Exception e){\n\t\t\t\te.printStackTrace();\n\t\t\t}\t\t\t\n\t\t}", "@Deprecated\n\tpublic static void exampleInit() {\n\n\t\t// Create root node with id \"Root\"\n\t\tConversationNode root_node = new ConversationNode(\"Root\");\n\n\t\t// Add a response for the Root node\n\t\troot_node.addResponse(\"Hello my name is *name*. What is your name?\");\n\n\t\t// adds the Root node to the conversation tree\n\t\tconversation.add(root_node);\n\n\t\t// Create a new step for the conversation\n\t\tConversationNode reply_node = new ConversationNode(\"Reply\");\n\n\t\t// Add a response for the Reply node\n\t\treply_node.addResponse(\"Nice to meet you *user_name*.\");\n\n\t\t// Define Reply's parent node to be the Root node\n\t\treply_node.addParent(\"Root\");\n\t\tconversation.get(\"Root\").addChild(\"Reply\");\n\n\t\t// add the Reply node to the conversation tree\n\t\tconversation.add(reply_node);\n\t}", "private void fixInnerParent(BaleElement be)\n{\n BaleAstNode sn = getAstChild(be);\n while (cur_parent != cur_line && sn == null) {\n cur_parent = cur_parent.getBaleParent();\n cur_ast = cur_parent.getAstNode();\n sn = getAstChild(be);\n }\n\n // now see if there are any internal elements that should be used\n while (sn != null && sn != cur_ast && sn.getLineLength() == 0) {\n BaleElement.Branch nbe = createInnerBranch(sn);\n if (nbe == null) break;\n addElementNode(nbe,0);\n nbe.setAstNode(sn);\n cur_parent = nbe;\n cur_ast = sn;\n sn = getAstChild(be);\n }\n}", "@Test\n public void shouldAssignLevelsAndInsertDummyNodes(){\n String p1 = \"p1\";\n String p2 = \"p2\";\n String p3 = \"p3\";\n ValueStreamMap graph = new ValueStreamMap(p1, null);\n graph.addDownstreamNode(new PipelineDependencyNode(p3, p3), p1);\n\n List<List<Node>> nodesAtEachLevel = graph.presentationModel().getNodesAtEachLevel();\n assertThat(nodesAtEachLevel.size(), is(2));\n VSMTestHelper.assertNodeHasChildren(graph, p1, p3);\n VSMTestHelper.assertThatLevelHasNodes(nodesAtEachLevel.get(0), 0, p1);\n VSMTestHelper.assertThatLevelHasNodes(nodesAtEachLevel.get(1), 0, p3);\n\n graph.addDownstreamNode(new PipelineDependencyNode(p2, p2), p1);\n graph.addDownstreamNode(new PipelineDependencyNode(p3, p3), p2);\n\n VSMTestHelper.assertNodeHasChildren(graph, p1, p2, p3);\n VSMTestHelper.assertNodeHasChildren(graph, p2, p3);\n VSMTestHelper.assertNodeHasParents(graph, p3, p1, p2);\n VSMTestHelper.assertNodeHasParents(graph, p2, p1);\n assertThat(graph.findNode(p3).getChildren().isEmpty(), is(true));\n assertThat(graph.findNode(p1).getParents().isEmpty(), is(true));\n\n nodesAtEachLevel = graph.presentationModel().getNodesAtEachLevel();\n assertThat(nodesAtEachLevel.size(), is(3));\n VSMTestHelper.assertThatLevelHasNodes(nodesAtEachLevel.get(0), 0, p1);\n VSMTestHelper.assertThatLevelHasNodes(nodesAtEachLevel.get(1), 1, p2);\n VSMTestHelper.assertThatLevelHasNodes(nodesAtEachLevel.get(2), 0, p3);\n }", "public Node insertByName(Node bstNode, String name, String sname, String no){\n\t\tif(bstNode == null){\n\t\t\tbstNode = new Node(name, sname, no);\n\t\t\tbstNode.setParent(parent);\n\t\t}\n\t\telse{\n\t\t\tparent = bstNode;\n\t\t\tif(name.compareTo(bstNode.getName())<0)\n\t\t\t\tbstNode.setLeft(insertByName(bstNode.getLeft(),name,sname,no));\t\t\n\t\t\t\n\t\t\telse\n\t\t\t\tbstNode.setRight(insertByName(bstNode.getRight(),name,sname,no));\n\t\t}\n\t\t\n\n\t\treturn bstNode;\n\t\t\n\t}", "void registerLabel(SNode inputNode, Iterable<SNode> outputNodes, String mappingLabel);" ]
[ "0.5198795", "0.5190273", "0.5094438", "0.5046065", "0.49138832", "0.48987967", "0.4754354", "0.47524682", "0.46174613", "0.45911807", "0.45756787", "0.45351133", "0.45272014", "0.4522554", "0.45223835", "0.4515389", "0.44711488", "0.44666404", "0.4421413", "0.4417805", "0.44173297", "0.4404149", "0.4403225", "0.44030252", "0.43889087", "0.43866", "0.43840858", "0.43689528", "0.43611616", "0.43549433", "0.43432948", "0.4342825", "0.43239656", "0.43215224", "0.43202716", "0.43163332", "0.4315509", "0.43092033", "0.43046117", "0.4292903", "0.42916894", "0.42775285", "0.42680746", "0.4264544", "0.42642176", "0.4264068", "0.42570713", "0.4252915", "0.42492822", "0.42365527", "0.42339262", "0.4229455", "0.42238793", "0.42094353", "0.42042446", "0.42036802", "0.41965765", "0.41918448", "0.41908845", "0.41890365", "0.41861817", "0.41793653", "0.41793126", "0.41766283", "0.41762984", "0.41753358", "0.41753358", "0.41753358", "0.4173916", "0.41723895", "0.41638145", "0.41623506", "0.41619423", "0.41606817", "0.4153878", "0.4150266", "0.4150266", "0.4150266", "0.41499165", "0.41484666", "0.41475213", "0.41429716", "0.4137449", "0.4136061", "0.41327912", "0.41323984", "0.41310707", "0.4130904", "0.41288102", "0.41206303", "0.41198903", "0.4117389", "0.4115826", "0.4113312", "0.41123718", "0.41084093", "0.41044393", "0.4102679", "0.4101132", "0.41005933" ]
0.61906666
0
The objective of this method is separate disconnected networks in singles networks. The argument is a list of nodes that have its relations by the parents attributes. From this relations, the nodes are separated in singles networks where if two nodes have a edge between its, its are in the same single network.
public static List<SimpleSSBNNode>[] individualizeDisconnectedNetworks( List<SimpleSSBNNode> simpleSSBNNodeList){ List<SimpleSSBNNodeNetworkAssociation> nodeNetAssociationList = new ArrayList<SimpleSSBNNodeNetworkAssociation>(); for(SimpleSSBNNode simpleSSBNNode: simpleSSBNNodeList){ SimpleSSBNNodeNetworkAssociation nodeNetAssociation = new SimpleSSBNNodeNetworkAssociation(simpleSSBNNode); nodeNetAssociationList.add(nodeNetAssociation); } int nextNetworkId = 0; for(SimpleSSBNNodeNetworkAssociation nodeNetAssociation: nodeNetAssociationList){ if(nodeNetAssociation.getNetworkId() == -1){ nodeNetAssociation.setNetworkId(nextNetworkId); nextNetworkId++; setNetIdToAdjacentNodes(nodeNetAssociation, nodeNetAssociationList); } } List<SimpleSSBNNode>[] nodesPerNetworkArray = new List[nextNetworkId]; for(int i = 0; i < nodesPerNetworkArray.length; i++){ nodesPerNetworkArray[i] = new ArrayList<SimpleSSBNNode>(); } for(SimpleSSBNNodeNetworkAssociation nodeNetAssociation: nodeNetAssociationList){ nodesPerNetworkArray[nodeNetAssociation.getNetworkId()].add(nodeNetAssociation.getNode()); } return nodesPerNetworkArray; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private void connectAll()\n {\n\t\tint i = 0;\n\t\tint j = 1;\n\t\twhile (i < getNodes().size()) {\n\t\t\twhile (j < getNodes().size()) {\n\t\t\t\tLineEdge l = new LineEdge(false);\n\t\t\t\tl.setStart(getNodes().get(i));\n\t\t\t\tl.setEnd(getNodes().get(j));\n\t\t\t\taddEdge(l);\n\t\t\t\tj++;\n\t\t\t}\n\t\t\ti++; j = i+1;\n\t\t}\n\n }", "public static void main(String[] args) {\n\n Node n1 = new Node(1);\n Node n2 = new Node(2);\n Node n3 = new Node(3);\n Node n4 = new Node(4);\n\n n1.neighbors.add(n2);\n n1.neighbors.add(n4);\n n2.neighbors.add(n1);\n n2.neighbors.add(n4);\n n3.neighbors.add(n2);\n n3.neighbors.add(n4);\n n4.neighbors.add(n1);\n n4.neighbors.add(n3);\n\n for (Node n : n1.neighbors) {\n System.out.print(n.val + \" \");\n }\n for (Node n : n2.neighbors) {\n System.out.print(n.val + \" \");\n }\n for (Node n : n3.neighbors) {\n System.out.print(n.val + \" \");\n }\n for (Node n : n4.neighbors) {\n System.out.print(n.val + \" \");\n }\n\n System.out.println();\n Node result = Solution.cloneGraph(n1);\n printGraph(result, 4);\n\n }", "protected Graph convertProteinNetworkToGraph(ProteinNetwork net) {\n\t\tGraph result = new Graph();\n\t\tUniqueIDGenerator<Integer> idGen = new UniqueIDGenerator<Integer>(result);\n\t\t\n\t\tif (net.isDirected()) \n\t\t\tthrow new ProCopeException(\"ClusterONE supports undirected graphs only\");\n\t\t\n\t\tint[] edges = net.getEdgesArray();\n\t\t\n\t\tfor (int i = 0; i < edges.length; i += 2) {\n\t\t\tint protein1 = idGen.get(edges[i]);\n\t\t\tint protein2 = idGen.get(edges[i+1]);\n\t\t\tfloat weight = net.getEdge(edges[i], edges[i+1]);\n\t\t\t\n\t\t\tif (weight == Float.NaN)\n\t\t\t\tcontinue;\n\t\t\tif (weight < 0.0)\n\t\t\t\tthrow new ProCopeException(\"negative weights are not supported by ClusterONE\");\n\t\t\tif (weight > 1.0)\n\t\t\t\tthrow new ProCopeException(\"scores larger than 1.0 are not supported by ClusterONE\");\n\t\t\t\n\t\t\tresult.createEdge(protein1, protein2, weight);\n\t\t}\n\t\treturn result;\n\t}", "private void phaseTwo(){\r\n\r\n\t\tCollections.shuffle(allNodes, random);\r\n\t\tList<Pair<Node, Node>> pairs = new ArrayList<Pair<Node, Node>>();\r\n\t\t\r\n\t\t//For each node in allNode, get all relationshpis and iterate through each relationship.\r\n\t\tfor (Node n1 : allNodes){\r\n\r\n\t\t\ttry (Transaction tx = graphDb.beginTx()){\r\n\t\t\t\t//If a node n1 is related to any other node in allNodes, add those relationships to rels.\r\n\t\t\t\t//Avoid duplication, and self loops.\r\n\t\t\t\tIterable<Relationship> ite = n1.getRelationships(Direction.BOTH);\t\t\t\t\r\n\r\n\t\t\t\tfor (Relationship rel : ite){\r\n\t\t\t\t\tNode n2 = rel.getOtherNode(n1);\t//Get the other node\r\n\t\t\t\t\tif (allNodes.contains(n2) && !n1.equals(n2)){\t\t\t\t\t//If n2 is part of allNodes and n1 != n2\r\n\t\t\t\t\t\tif (!rels.contains(rel)){\t\t\t\t\t\t\t\t\t//If the relationship is not already part of rels\r\n\t\t\t\t\t\t\tPair<Node, Node> pA = new Pair<Node, Node>(n1, n2);\r\n\t\t\t\t\t\t\tPair<Node, Node> pB = new Pair<Node, Node>(n2, n1);\r\n\r\n\t\t\t\t\t\t\tif (!pairs.contains(pA)){\r\n\t\t\t\t\t\t\t\trels.add(rel);\t\t\t\t\t\t\t\t\t\t\t//Add the relationship to the lists.\r\n\t\t\t\t\t\t\t\tpairs.add(pA);\r\n\t\t\t\t\t\t\t\tpairs.add(pB);\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\ttx.success();\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn;\r\n\t}", "public void minimisation4( ArrayList<Node>convrt1, Topology tp)\n {\n for ( int i=0; i<tp.getNodes().size(); i++ )\n {\n Node n= tp.getNodes().get(i);\n List<Link>allLinks = n.getLinks();\n boolean allLinksConnected= true;\n for ( int j=0; j<allLinks.size();j++ )\n {\n Link l= allLinks.get(j);\n if ( l.getColor()!=Color.orange)\n allLinksConnected=false;\n }\n List<Node> neighbors= n.getNeighbors();\n boolean allNeighborsConvert=true;\n for ( int j=0; j<neighbors.size();j++ )\n {\n Node n1= neighbors.get(j);\n if ( (convrt1.contains(n1))== false )\n {\n allNeighborsConvert=false;\n }\n }\n if ( allLinksConnected==true && allNeighborsConvert==true )\n {\n if ( n instanceof Ipv6)\n {\n ((Ipv6) n).setType(\"Conv\");\n n.setIcon(\"./src/img/Conv.png\");\n convrt1.add(n);\n }\n else if ( n instanceof Ipv4)\n {\n ((Ipv4) n).setType(\"Conv\");\n n.setIcon(\"./src/img/Conv.png\");\n convrt1.add(n);\n }\n\n for ( int m=0; m< n.getNeighbors().size(); m++ )\n {\n Node n2= n.getNeighbors().get(m);\n if ( n2 instanceof Ipv6)\n {\n ((Ipv6) n2).setType(\"IPV6\");\n n2.setIcon(\"./src/img/ipv6.png\");\n convrt1.remove(n2);\n }\n else if ( n2 instanceof Ipv4)\n {\n ((Ipv4) n2).setType(\"IPV4\");\n n2.setIcon(\"./src/img/ipv4.png\");\n convrt1.remove(n2);\n }\n }\n }\n }\n }", "public void connectNodes(){\n for(int i = 0; i < inputSize; i++){\n network.get(0).add(new InputNode());\n }\n \n for(int i = 1; i < layers; i++){\n \n for(int j = 0; j < layerSize; j++){\n \n network.get(i).add(new Node(network.get(i-1)));\n }\n \n }\n \n }", "private void fourNodesTopo() {\n ReadWriteTransaction tx = dataBroker.newReadWriteTransaction();\n n(tx, true, \"n1\", Stream.of(pB(\"n1:1\"), pB(\"n1:2\"), pI(\"n1:3\"), pO(\"n1:4\"), pO(\"n1:5\")));\n n(tx, true, \"n2\", Stream.of(pB(\"n2:1\"), pB(\"n2:2\"), pO(\"n2:3\"), pI(\"n2:4\"), pI(\"n2:5\")));\n n(tx, true, \"n3\", Stream.of(pB(\"n3:1\"), pB(\"n3:2\"), pO(\"n3:3\"), pO(\"n3:4\"), pI(\"n3:5\")));\n n(tx, true, \"n4\", Stream.of(pB(\"n4:1\"), pB(\"n4:2\"), pI(\"n4:3\"), pI(\"n4:4\"), pO(\"n4:5\")));\n l(tx, \"n1\", \"n1:5\", \"n2\", \"n2:5\", OperationalState.ENABLED, ForwardingDirection.UNIDIRECTIONAL);\n l(tx, \"n1\", \"n1:4\", \"n4\", \"n4:4\", OperationalState.ENABLED, ForwardingDirection.UNIDIRECTIONAL);\n l(tx, \"n2\", \"n2:3\", \"n4\", \"n4:3\", OperationalState.ENABLED, ForwardingDirection.UNIDIRECTIONAL);\n l(tx, \"n3\", \"n3:4\", \"n2\", \"n2:4\", OperationalState.ENABLED, ForwardingDirection.UNIDIRECTIONAL);\n l(tx, \"n4\", \"n4:5\", \"n3\", \"n3:5\", OperationalState.ENABLED, ForwardingDirection.UNIDIRECTIONAL);\n try {\n tx.submit().checkedGet();\n } catch (TransactionCommitFailedException e) {\n e.printStackTrace();\n }\n }", "public abstract Multigraph buildMatchedGraph();", "private static List<List<Integer[]>> getDIOCrossConnect() {\n List<List<Integer[]>> pairs = new ArrayList<List<Integer[]>>();\n List<Integer[]> setA =\n Arrays.asList(\n new Integer[][] {\n {DIOCrossConnectA1, DIOCrossConnectA2},\n {DIOCrossConnectA2, DIOCrossConnectA1}\n });\n pairs.add(setA);\n\n List<Integer[]> setB =\n Arrays.asList(\n new Integer[][] {\n {DIOCrossConnectB1, DIOCrossConnectB2},\n {DIOCrossConnectB2, DIOCrossConnectB1}\n });\n pairs.add(setB);\n // NOTE: IF MORE DIOCROSSCONNECT PAIRS ARE ADDED ADD THEM HERE\n return pairs;\n }", "@Override\n public List<GraphRelationship> getRelationships() {\n int localMax=1;\n Hashtable checkIfRelationExists = new Hashtable();\n List<GraphRelationship> relatonships = new ArrayList<>();\n List<String> filePaths = ProjectFileNamesUtil.getFileNamesFromProject(project.getBaseDir());\n for (String filePath : filePaths){ //foreach filepath - node name\n String str[] = filePath.split(\"/\");\n String name = str[str.length-1];\n CoverageNode startNode = (CoverageNode) nodeHashTable.get(name); //relations from this node\n ImportFileUtil importFileUtil = (ImportFileUtil) relations.get(name); //get relations for node\n if (importFileUtil != null && startNode != null){\n for (ImportFrom importFrom : importFileUtil.getImportFromList()) //for each relation\n {\n NodeRelationship relation;\n CoverageNode endNode = (CoverageNode) nodeHashTable.get(importFrom.getName());//end node of relation\n String nameOfRelation = startNode.getId() + \"->\" + endNode.getId();\n if (checkIfRelationExists.get(nameOfRelation) != null){\n continue;\n }\n relation = new NodeRelationship(nameOfRelation);\n relation.setWeight(getRelationWeight(importFrom));\n if (localMax < getRelationWeight(importFrom)){localMax=getRelationWeight(importFrom);} //localMax of weights for proper logScale\n relation.setCallsCount(\"\" + (int) relation.getWeight());\n relation.setStartNode(startNode);\n relation.setEndNode(endNode);\n setRelationTypes(relation.getTypes(),relation.getWeight()); //sets trivia\n HashMap<String, Object> properties = new HashMap<>();\n getPropertiesForRelations(properties, importFrom);\n ResultsPropertyContainer resultsPropertyContainer = new ResultsPropertyContainer(properties);\n relation.setPropertyContainer(resultsPropertyContainer);\n checkIfRelationExists.put(relation.getId(), relation);\n relatonships.add(relation);\n }\n }\n }\n for(GraphRelationship relationship : relatonships){\n relationship.setWeight(normalizeWeight(relationship.getWeight(), localMax));\n }\n return relatonships;\n }", "public void assignAllSiblings(){\n \n List<Informacion> pasos=ejemplo.getListaPasos();\n for(Informacion info:pasos){\n if(info.getElemento().split(\" \").length>1){\n assignSiblings(info.getElemento().split(\" \"));\n } \n }\n }", "public void testConvertTopo (Topology tp)\n {\n Node root = tp.getNodes().get(0);\n //root.setColor(Color.green);\n parcours(root, visitedlist, compo1);\n set.addAll(composante);\n ArrayList distinctList = new ArrayList(set);\n System.out.println(distinctList.size());\n for ( int i = 0; i < distinctList.size(); i++ )\n System.out.println(distinctList.get(i));\n ArrayList<Link> liste = connectedL(tp);\n /*for (int i = 0; i < liste.size(); i++)\n System.out.println(liste.get(i));*/\n Convert(liste);\n /*for ( int i = 0; i < listConvert.size(); i++ )\n System.out.println(listConvert.get(i));*/\n ConvertMinimiz(listConvert);\n minimisationConvCompo(distinctList);\n minimisationAllNeighbor(listConvert,tp);\n //minimisation4(listConvert,tp);\n }", "public void cleanNodeListToEdges(CircosEdgeList edges){\n\t\tArrayList<CircosNode> tempnodes = new ArrayList<CircosNode>();\n\t\tHashMap<String,String> tempcolors = new HashMap<String,String>();\n\t\t\n\t\tfor(int i = 0; i < nodes.size(); i++){\n\t\t\tif(edges.containsNodeAsSourceOrTarget(nodes.get(i).getID())){\n\t\t\t\ttempnodes.add(nodes.get(i));\n\t\t\t\ttempcolors.put(nodes.get(i).getID(), colors.get(nodes.get(i).getID()));\n\t\t\t}\n\t\t}\n\t\t\t\n\t\tnodes = tempnodes;\n\t\tcolors = tempcolors;\n\t}", "private static void tetherCopiedElements(ArrayList<DiagramElement> elements) throws IOException\r\n {\n Iterator<DiagramElement> elIt = elements.iterator();\r\n ArrayList<Relationship> relationships = new ArrayList<>();\r\n while(elIt.hasNext())\r\n {\r\n DiagramElement e = elIt.next();\r\n if(e.isRelationship())\r\n relationships.add((Relationship)e);\r\n }\r\n \r\n // Tether relationships if needed\r\n Iterator<Relationship> relIt = relationships.iterator();\r\n while(relIt.hasNext())\r\n {\r\n Relationship r = relIt.next();\r\n int srcUid = r.getSourceClassUid();\r\n int destUid = r.getDestinationClassUid();\r\n if((srcUid > 0) || (destUid > 0))\r\n {\r\n elIt = elements.iterator();\r\n while(elIt.hasNext())\r\n {\r\n DiagramElement e = elIt.next();\r\n if((e.getElementType().equals(\"Class\")) && \r\n (e.getUniqueId() == srcUid))\r\n {\r\n r.tetherSourceToClass((ClassElement)e);\r\n }\r\n if((e.getElementType().equals(\"Class\")) && \r\n (e.getUniqueId() == destUid))\r\n {\r\n r.tetherDestinationToClass((ClassElement)e);\r\n }\r\n }\r\n }\r\n }\r\n }", "public void connectClusters()\n\t{\n//\t\tfor(int i = 0; i<edges.size();i++)\n//\t\t{\n//\t\t\tEdgeElement edge = edges.get(i);\n//\t\t\tString fromNodeID = edge.fromNodeID;\n//\t\t\tNodeElement fromNode = findSubNode(fromNodeID);\n//\t\t\tString toNodeID = edge.toNodeID;\n//\t\t\tNodeElement toNode = findSubNode(toNodeID); \n//\t\t\t\n//\t\t\tif(fromNode != null && toNode != null)\n//\t\t\t{\n//\t\t\t\tPortInfo oport = new PortInfo(edge, fromNode);\n//\t\t\t\tfromNode.addOutgoingPort(oport);\n//\t\t\t\tedge.addIncomingPort(oport);\n//\t\t\t\tPortInfo iport = new PortInfo(edge, toNode);\n//\t\t\t\ttoNode.addIncomingPort(iport);\n//\t\t\t\tedge.addOutgoingPort(iport);\n//\t\t\t}\n//\t\t}\n\t}", "public Set<Tuple<Vec3i, PartSlot>> multipartTransConnections();", "private void establishPetriNetStructure(PetriNet net) {\n\t\t// establish the same petri net structure like in the given model\n\t\tHashMap mapping = new HashMap();\n\t\t// arraylist for all nodes in the petri net\n\t\tArrayList nodeList = new ArrayList();\n\t\tSubgraph graph = net.getGrappaVisualization().getSubgraph().getGraph();\n\t\t// get all the nodes that are in a cluster\n\t\tEnumeration subGraphElts = graph.subgraphElements();\n\t\twhile (subGraphElts.hasMoreElements()) {\n\t\t\tElement e1 = (Element) subGraphElts.nextElement();\n\t\t\tif (e1 instanceof Subgraph) {\n\t\t\t\tSubgraph subgraph = (Subgraph) e1;\n\t\t\t\tEnumeration enumerationNodes = subgraph.nodeElements();\n\t\t\t\t// put all the nodeElements in nodeList\n\t\t\t\twhile (enumerationNodes.hasMoreElements()) {\n\t\t\t\t\tElement enumNode = (Element) enumerationNodes.nextElement();\n\t\t\t\t\tif (enumNode != null && enumNode.object instanceof ModelGraphVertex) {\n\t\t\t\t\t\tnodeList.add(enumNode);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t// add the nodes that are not in a cluster to the list of all nodes\n\t\tEnumeration nodeElts = graph.nodeElements();\n\t\twhile (nodeElts.hasMoreElements()) {\n\t\t\tElement e1 = (Element) nodeElts.nextElement();\n\t\t\tif (e1.object != null && e1.object instanceof ModelGraphVertex) {\n\t\t\t\tnodeList.add(e1);\n\t\t\t}\n\t\t}\n\t\t// convert the ordinary transitions to simulated transitions\n\t\tIterator transitions = nodeList.iterator();\n\t\twhile (transitions.hasNext()) {\n\t\t\tElement e1 = (Element) transitions.next();\n\t\t\tif (e1.object != null && e1.object instanceof Transition) {\n\t\t\t\tNode n = (Node) e1;\n\t\t\t\tint x = (int) n.getCenterPoint().getX() * ManagerLayout.getInstance().getScaleFactor();\n\t\t\t\tint y = -(int) n.getCenterPoint().getY() * ManagerLayout.getInstance().getScaleFactor();\n\t\t\t\tint width = (int) (((Double) n.getAttributeValue(Grappa.WIDTH_ATTR)).doubleValue() *\n\t\t\t\t\t\tManagerLayout.getInstance().getStretchFactor());\n\t\t\t\tint height = (int) (((Double) n.getAttributeValue(Grappa.HEIGHT_ATTR)).doubleValue() *\n\t\t\t\t\t\tManagerLayout.getInstance().getStretchFactor());\n\t\t\t\tColoredTransition simTransition = new ColoredTransition((Transition) e1.object, this,\n\t\t\t\t\t\tx, y, width, height);\n\t\t\t\tthis.addTransition(simTransition);\n\t\t\t\t\n\t\t\t\t// keep the mapping until the edges have been established\n\t\t\t\tmapping.put((Transition) e1.object, simTransition);\n\t\t\t}\n\t\t}\n\t // convert the ordinary places to simulated places\n\t\tIterator places = nodeList.iterator();\n\t\twhile (places.hasNext()) {\n\t\t\tElement e1 = (Element) places.next();\n\t\t\tif (e1.object != null && e1.object instanceof Place) {\n\t\t\t\tNode n = (Node) e1;\n\t\t\t\tint x = (int) n.getCenterPoint().getX() * ManagerLayout.getInstance().getScaleFactor();\n\t\t\t\tint y = -(int) n.getCenterPoint().getY() * ManagerLayout.getInstance().getScaleFactor();\n\t\t\t\tint width = (int) (((Double) n.getAttributeValue(Grappa.WIDTH_ATTR)).doubleValue() *\n\t\t\t\t\t\tManagerLayout.getInstance().getStretchFactor());\n\t\t\t\tint height = (int) (((Double) n.getAttributeValue(Grappa.HEIGHT_ATTR)).doubleValue() *\n\t\t\t\t\t\tManagerLayout.getInstance().getStretchFactor());\n\t\t\t\tColoredPlace simPlace = new ColoredPlace((Place) e1.object, this,\n\t\t\t\t\t\t\t\t\t\t x, y, width, height);\n\t\t\t\tthis.addPlace(simPlace);\n\t\t\t}\n\t\t}\n // convert the ordinary edges to simulated edges\n\t\tIterator edges = net.getEdges().iterator();\n\t\twhile (edges.hasNext()) {\n\t\t\tPNEdge edge = (PNEdge) edges.next();\n\t\t\tColoredEdge simEdge;\n\t\t\t// if place is source\n\t\t\tif (edge.isPT()) {\n\t\t\t\tPlace p = (Place) edge.getSource();\n\t\t\t\t// find respective place in this net (place names are assumed to be unique)\n\t\t\t\tPlace myPlace = this.findPlace(p.getIdentifier());\n\t\t\t\tTransition t = (Transition) edge.getDest();\n\t\t\t\t// find respective transition in this net\n\t\t\t\tTransition myTransition = (Transition) mapping.get(t);\n\t\t\t\t// reproduce edge\n\t\t\t\tsimEdge = new ColoredEdge(myPlace, myTransition);\n\t\t\t\tthis.addEdge(simEdge);\n\t\t\t} else {\n\t\t\t\t// if transition is source\n\t\t\t\tPlace p = (Place) edge.getDest();\n\t\t\t\t// find respective place in this net (place names are assumed to be unique)\n\t\t\t\tPlace myPlace = (Place)this.findPlace(p.getIdentifier());\n\t\t\t\tTransition t = (Transition) edge.getSource();\n\t\t\t\t// find respective transition in this net\n\t\t\t\tTransition myTransition = (Transition) mapping.get(t);\n\t\t\t\t// reproduce edge\n\t\t\t\tsimEdge = new ColoredEdge(myTransition, myPlace);\n\t\t\t\tthis.addEdge(simEdge);\n\t\t\t}\n\t\t}\n\t\tIterator clusters = net.getClusters().iterator();\n\t\twhile (clusters.hasNext()) {\n\t\t\tTransitionCluster currentCluster = (TransitionCluster) clusters.next();\n\t\t\tthis.addCluster(new TransitionCluster(currentCluster));\n\t\t}\n\t}", "public Set<Tuple<Vec3i, PartSlot>> multipartCisConnections();", "public boolean isMultiGraph();", "@Override\n public Set<Edge<PhysicalObject>> getRelationBetweenObjects() {\n assert false : \"shouldn't call this method\";\n return null;\n }", "@Deprecated\n\tpublic void connectNodesWithParents() {\n\t\tpipeline.connectNodesWithParents(null);\n\t}", "private void markDuplicateRelationships(EntityInstanceImpl ei)\n {\n EntityInstanceImpl parent = ei.getParent();\n EntityDef entityDef = ei.getEntityDef();\n\n // Duplicate relationship searching phase I, see if a linked instance to\n // the target instance in the same object instance represents the\n // same relationship type AND has the same parent.\n for ( EntityInstanceImpl linked : ei.getLinkedInstances() )\n {\n // Check to make sure linked EI has a parent--it is possible for a root\n // to be flagged as included and we don't care about roots.\n if ( linked.isDeleted() || linked.getParent() == null )\n continue;\n\n if ( ei.isExcluded() )\n {\n if ( ! linked.isExcluded() )\n continue;\n }\n else\n {\n if ( ! linked.isIncluded() )\n continue;\n }\n\n EntityDef linkedEntityDef = linked.getEntityDef();\n\n // Linked EI must have the same relationship and it can't be derived.\n if ( linkedEntityDef.getErRelToken() == entityDef.getErRelToken() ||\n linkedEntityDef.isDerivedPath() )\n {\n continue;\n }\n\n // Now check to see if the parents are linked.\n EntityInstanceImpl linkParent = linked.getParent();\n for ( EntityInstanceImpl parentLinked : linkParent.getLinkedInstances() )\n {\n if ( parentLinked == parent )\n {\n if ( ei.isExcluded() )\n linked.dbhExcluded = true;\n else\n linked.dbhIncluded = true;\n\n break;\n }\n }\n } // for each linked instance...\n\n // Duplicate relationship searching, phase II, see if the parent of\n // the instance has a linked instance representing the same relationship\n // type which is also a child of one of the targets linked instances.\n\n // If the parent isn't linked then there are no duplicate relationships.\n if ( parent.getLinkedInstances().size() == 0 )\n return;\n\n for ( EntityInstanceImpl linked : parent.getLinkedInstances() )\n {\n // Check for appropriate include/exclude flag.\n if ( ei.isExcluded() )\n {\n if ( ! linked.isExcluded() )\n continue;\n }\n else\n {\n if ( ! linked.isIncluded() )\n continue;\n }\n\n EntityDef linkedEntityDef = linked.getEntityDef();\n\n // Check to see if the relationship for the EI linked to the parent is\n // the same as the relationship of the original EI.\n if ( linkedEntityDef.getErRelToken() != entityDef.getErRelToken() )\n continue; // Nope.\n\n // OK, we have an EI ('linked') that has the same relationship as\n // ei. Check to see if the parent of 'linked' (grandParent)\n // is linked with ei. If they are linked then 'linked'\n // has the same physical relationship as ei.\n EntityInstanceImpl grandParent = linked.getParent();\n for ( EntityInstanceImpl gp : ei.getLinkedInstances() )\n {\n if ( gp == grandParent )\n {\n if ( ei.isExcluded() )\n linked.dbhExcluded = true;\n else\n linked.dbhIncluded = true;\n\n break;\n }\n }\n } // for each linked instance of parent...\n }", "public NodeNetwork() {\n\t\tnodes = new ArrayList<>();\n\t\tconnections = new ArrayList<>();\n\t}", "private ArrayList<Edge>getFullyConnectedGraph(){\n\t\tArrayList<Edge> edges = new ArrayList<>();\n\t\tfor(int i=0;i<nodes.size();i++){\n\t\t\tfor(int j=i+1;j<nodes.size();j++){\n\t\t\t\tEdge edge = new Edge(nodes.get(i), nodes.get(j),Utils.distance(nodes.get(i), nodes.get(j)));\n\t\t\t\tedges.add(edge);\n\t\t\t}\n\t\t}\n\t\treturn edges;\n\t}", "private void transferLocal(Graph graph) {\n Set<NodePair> nonadjacencies = nonadjacencies(graph);\n for (Graph pag : input) {\n for (Edge edge : pag.getEdges()) {\n NodePair graphNodePair = new NodePair(graph.getNode(edge.getNode1().getName()), graph.getNode(edge.getNode2().getName()));\n if (nonadjacencies.contains(graphNodePair)) {\n continue;\n }\n if (!graph.isAdjacentTo(graphNodePair.getFirst(), graphNodePair.getSecond())) {\n graph.addEdge(new Edge(graphNodePair.getFirst(), graphNodePair.getSecond(), edge.getEndpoint1(), edge.getEndpoint2()));\n continue;\n }\n Endpoint first = edge.getEndpoint1();\n Endpoint firstCurrent = graph.getEndpoint(graphNodePair.getSecond(), graphNodePair.getFirst());\n if (!first.equals(Endpoint.CIRCLE)) {\n if ((first.equals(Endpoint.ARROW) && firstCurrent.equals(Endpoint.TAIL)) ||\n (first.equals(Endpoint.TAIL) && firstCurrent.equals(Endpoint.ARROW))) {\n graph.setEndpoint(graphNodePair.getSecond(), graphNodePair.getFirst(), Endpoint.CIRCLE);\n } else {\n graph.setEndpoint(graphNodePair.getSecond(), graphNodePair.getFirst(), edge.getEndpoint1());\n }\n }\n Endpoint second = edge.getEndpoint2();\n Endpoint secondCurrent = graph.getEndpoint(graphNodePair.getFirst(), graphNodePair.getSecond());\n if (!second.equals(Endpoint.CIRCLE)) {\n if ((second.equals(Endpoint.ARROW) && secondCurrent.equals(Endpoint.TAIL)) ||\n (second.equals(Endpoint.TAIL) && secondCurrent.equals(Endpoint.ARROW))) {\n graph.setEndpoint(graphNodePair.getFirst(), graphNodePair.getSecond(), Endpoint.CIRCLE);\n } else {\n graph.setEndpoint(graphNodePair.getFirst(), graphNodePair.getSecond(), edge.getEndpoint2());\n }\n }\n }\n for (Triple triple : pag.getUnderLines()) {\n Triple graphTriple = new Triple(graph.getNode(triple.getX().getName()), graph.getNode(triple.getY().getName()), graph.getNode(triple.getZ().getName()));\n if (graphTriple.alongPathIn(graph)) {\n graph.addUnderlineTriple(graphTriple.getX(), graphTriple.getY(), graphTriple.getZ());\n definiteNoncolliders.add(graphTriple);\n }\n }\n }\n }", "private void go(Network n1) {\n\t\t\n\t\tNetwork n2 = new Network(2, n1);\n\t\tNetwork n3 = new Network(2, n2);\n\t\tSystem.out.println(\"\\tn3.p.p.id = \" + n3.p.p.id);\n\t}", "private void categoriseNodes(final CyNetwork result, final Set<CyNode> leftSet,\n\t\t\t\t final Set<CyNode> rightSet)\n\t{\n\t\t@SuppressWarnings(\"unchecked\")\n\t\tfinal Set<CyNode> orig1 = new HashSet<CyNode>(network1.nodesList());\n\t\t@SuppressWarnings(\"unchecked\")\n\t\tfinal Set<CyNode> orig2 = new HashSet<CyNode>(network2.nodesList());\n\n\t\t@SuppressWarnings(\"unchecked\")\n\t\tfinal List<CyNode> resultNodes = (List<CyNode>)result.nodesList();\n\t\t\n\t\tfinal CyAttributes nodeAttr = Cytoscape.getNodeAttributes();\n\t\t\n\t\tfor (final CyNode node : resultNodes) {\n\t\t\tfinal boolean inNetwork1 = orig1.contains(node);\n\t\t\tfinal boolean inNetwork2 = orig2.contains(node);\n\t\t\t\n\t\t\tif (inNetwork1 && inNetwork2)\n\t\t\t\t/* Do Nothing. */;\n\t\t\telse if (inNetwork1 && !inNetwork2) {\n\t\t\t\tleftSet.add(node);\n\t\t\t\tnodeAttr.setAttribute(node.getIdentifier(), visualStyleName, network1.getTitle());\n\t\t\t} else if (!inNetwork1 && inNetwork2) {\n\t\t\t\trightSet.add(node);\n\t\t\t\tnodeAttr.setAttribute(node.getIdentifier(), visualStyleName, network2.getTitle());\n\t\t\t} else // This should never happen!\n\t\t\t\tthrow new IllegalStateException(\"Do not know how to categorise a node!\");\n\t\t}\n\t}", "@Override\n\tpublic boolean isConnected() {\n\t\tif(this.GA.nodeSize() ==1 || this.GA.nodeSize()==0) return true;\n\t\tgraph copied = this.copy();\n\t\ttagZero(copied);\n\t\tCollection<node_data> s = copied.getV();\n\t\tIterator it = s.iterator();\n\t\tnode_data temp = (node_data) it.next();\n\t\tDFSUtil(copied,temp);\n\t\tfor (node_data node : s) {\n\t\t\tif (node.getTag() == 0) return false;\n\t\t}\n\t\ttransPose(copied);\n\t\ttagZero(copied);\n\t Collection<node_data> s1 = copied.getV();\n\t\tIterator it1 = s1.iterator();\n\t\tnode_data temp1 = (node_data) it1.next();\n\t\tDFSUtil(copied,temp1);\n\t\tfor (node_data node1 : s1) {\n\t\t\tif (node1.getTag() == 0) return false;\n\t\t}\n\n\t\treturn true;\n\t}", "public static List<NbiConnectionRelation> processRelations(List<NbiConnectionRelation> relations)\n throws ServiceException {\n List<NbiConnectionRelation> result = new ArrayList<>();\n if(CollectionUtils.isEmpty(relations)) {\n return result;\n }\n List<NbiConnectionRelation> queryData = new ArrayList<>();\n for(NbiConnectionRelation relation : relations) {\n NbiConnectionRelation cond = new NbiConnectionRelation();\n cond.setVpnConnectionId(relation.getVpnConnectionId());\n cond.setNetConnectionId(relation.getNetConnectionId());\n queryData.addAll(relationDao.query(cond));\n }\n Set<String> resKeys = new HashSet<String>();\n for(NbiConnectionRelation data : queryData) {\n resKeys.add(data.toResKey());\n }\n for(NbiConnectionRelation relation : relations) {\n if(!resKeys.contains(relation.toResKey())) {\n result.add(relation);\n }\n }\n return result;\n }", "private void connectToAll() {\n for (AStarNode node : getNodes()) {\n node.resetConnection();\n for (AStarNode connect : getNodes()) {\n if (isValid(node, connect)) {\n node.connect(connect);\n }\n }\n }\n }", "public Set<Vec3i> transConnections();", "abstract ArrayList<Pair<Integer,Double>> adjacentNodes(int i);", "public Graph getGraph4SingleCores(String nodeId, CustRelationshipMapper custRelationshipMapper, CustPropertyMapper custPropertyMapper) throws CustomException {\n if (StringUtils.isBlank(nodeId)) {\n throw new CustomException(\"[nodeId] is blank null or ' '\");\n }\n\n List<CustRelationship> oneDepthRels = custRelationshipMapper.selectAll1DRelByCertNo(nodeId);\n\n //Map<String, Object> graph = new HashMap<>();\n Graph graph = new Graph();\n if (oneDepthRels.size() == 0) {\n log.info(\"当前1度范围内[边]等于0, 将返回null\");\n graph = new Graph(null, null, StatusCode.NO_MATCHES);\n return graph;\n }\n\n\n\n //仅一度边\n Map<String, Edge> oneDepthEdges = new HashMap<>();\n //一度节点, 含中心\n Map<String, Node> oneDepthNodes = new HashMap<>();\n\n Node core = new Node();\n core.setId(nodeId);\n core.setDepth(0);\n //core 并入 onetDepthNodes\n oneDepthNodes.put(core.getId(), core);\n\n //遍历一度边, 封装数据\n gatherNodeEdge(oneDepthRels, oneDepthEdges, oneDepthNodes,1);\n\n Set<String> oneDepthNodesKeySet = oneDepthNodes.keySet();\n\n //判断一度节点个数, 小于阈值才会继续查询二度边\n if (oneDepthNodes.size() > MAX_DISPLAY_NODES_1D) {\n log.info(\"当前一度范围内[节点]个数大于[{}], 将仅返回一度节点和边数据\", MAX_DISPLAY_NODES_1D);\n\n\n List<CustProperty> custProperties = custPropertyMapper.selectByCertNos(oneDepthNodesKeySet);\n\n //封装点属性\n dumpCustPropertyData(oneDepthNodes, custProperties, 1);\n\n graph.setNodes(oneDepthNodes);\n graph.setEdges(oneDepthEdges);\n return graph;\n }\n\n\n // -- 一度范围节点数量在范围之内, 则获取所有二度边 --\n\n //装所有节点\n HashMap<String, Node> nodes = (HashMap<String, Node>) ((HashMap<String, Node>) oneDepthNodes).clone();\n //装所有的边\n HashMap<String, Edge> edges = (HashMap<String, Edge>) ((HashMap<String, Edge>) oneDepthEdges).clone();\n\n List<CustRelationship> allRel = custRelationshipMapper.selectRelByGivenCertNos(oneDepthNodesKeySet);\n if (allRel.size() > MAX_DISPLAY_EDGES) {\n log.info(\"当前二度范围内[边]总数大于[{}], 仅返回一度节点和边数据\", MAX_DISPLAY_EDGES);\n graph.setNodes(oneDepthNodes);\n graph.setEdges(oneDepthEdges);\n return graph;\n }\n\n // -- 二度范围边在范围之内, 则加工边数据集 --\n\n gatherNodeEdge(allRel, edges, nodes,2);\n /* ABANDON: 抽取\n for (CustRelationship rel : allRel) {\n //Note: oneDepthEdges中已有的, 不用再封装了, 没有的, 创建, 封装, 存入edges中, 且depth==2\n if (oneDepthEdges.get(rel.getId()) == null) {\n Edge edge = new Edge(rel.getId(), rel.getuCertNo(), rel.getvCertNo(), rel.getContent(), rel.getContentType(), rel.getRelationType());\n //新建的边, 说明depth==2\n edge.setDepth(2);\n //存入edges\n edges.put(String.valueOf(edge.getId()), edge);\n }\n\n //遇到新节点, 则存入nodes中, 且深度为2 !注意别存错了!\n gatherNodes(nodes, rel, 2);\n }\n */\n\n //查询所有属性: 核, 一度, 二度\n Set<String> allCertNos = nodes.keySet(); //获取所有身份证号, 查取属性数据\n List<CustProperty> custProperties = custPropertyMapper.selectByCertNos(allCertNos);\n\n //封装属性数据\n dumpCustPropertyData(nodes, custProperties, 2);\n\n //判断节点数目\n if (nodes.size() > MAX_DISPLAY_NODES_2D) {\n //0,1,2度节点之和超过阈值, 则只返回一度节点和边\n log.info(\"当前二度范围内[节点]总数大于[{}], 仅返回一度节点和边数据\", MAX_DISPLAY_NODES_2D);\n\n graph.setNodes(oneDepthNodes);\n graph.setEdges(oneDepthEdges);\n } else {\n //没有超限, 则返回1,2度全部\n log.info(\"返回全部二度范围内节点和边数据\");\n graph.setNodes(nodes);\n graph.setEdges(edges);\n }\n\n\n return graph;\n }", "private void deleteConnections() {\n for (int i = 0; !this.sourceConnections.isEmpty(); ) {\n LinkElement wire = (LinkElement) this.sourceConnections.get(i);\n wire.detachSource();\n wire.detachTarget();\n this.graphElement.removeEdge(wire.getEdgeId(), wire);\n }\n\n for (int i = 0; !this.targetConnections.isEmpty(); ) {\n LinkElement wire = (LinkElement) this.targetConnections.get(i);\n wire.detachSource();\n wire.detachTarget();\n this.graphElement.removeEdge(wire.getEdgeId(), wire);\n }\n }", "public List<NetworkNode> listNetworkNode();", "public void connectToNodesInSequence(List<String> sequentialList) {\n for (ListIterator<String> recordListIterator = sequentialList.listIterator(); recordListIterator.hasNext();) {\n try {\n String currentRecord = recordListIterator.next();\n int currentPosition = sequentialList.indexOf(currentRecord);\n String nextRecord = sequentialList.get(currentPosition + 1);\n\n NodeRecord currentNode = registeredNodes.get(currentRecord);\n NodeRecord nextNode = registeredNodes.get(nextRecord);\n currentNode.addNodeToConnectTo(nextNode);\n updateConnections(currentNode, nextNode);\n } catch (IndexOutOfBoundsException e) {\n NodeRecord firstNode = registeredNodes.get(sequentialList.get(0));\n NodeRecord lastNode = registeredNodes.get(sequentialList.get(sequentialList.size()-1));\n lastNode.addNodeToConnectTo(firstNode);\n updateConnections(lastNode, firstNode);\n }\n }\n }", "private List<Vertex> prepareGraphAdjacencyList() {\n\n\t\tList<Vertex> graph = new ArrayList<Vertex>();\n\t\tVertex vertexA = new Vertex(\"A\");\n\t\tVertex vertexB = new Vertex(\"B\");\n\t\tVertex vertexC = new Vertex(\"C\");\n\t\tVertex vertexD = new Vertex(\"D\");\n\t\tVertex vertexE = new Vertex(\"E\");\n\t\tVertex vertexF = new Vertex(\"F\");\n\t\tVertex vertexG = new Vertex(\"G\");\n\n\t\tList<Edge> edges = new ArrayList<Edge>();\n\t\tedges.add(new Edge(vertexB, 2));\n\t\tedges.add(new Edge(vertexD, 6));\n\t\tedges.add(new Edge(vertexF, 5));\n\t\tvertexA.incidentEdges = edges;\n\n\t\tedges = new ArrayList<Edge>();\n\t\tedges.add(new Edge(vertexA, 2));\n\t\tedges.add(new Edge(vertexC, 7));\n\t\tvertexB.incidentEdges = edges;\n\n\t\tedges = new ArrayList<Edge>();\n\t\tedges.add(new Edge(vertexB, 7));\n\t\tedges.add(new Edge(vertexD, 9));\n\t\tedges.add(new Edge(vertexF, 1));\n\t\tvertexC.incidentEdges = edges;\n\n\t\tedges = new ArrayList<Edge>();\n\t\tedges.add(new Edge(vertexA, 6));\n\t\tedges.add(new Edge(vertexC, 9));\n\t\tedges.add(new Edge(vertexE, 4));\n\t\tedges.add(new Edge(vertexG, 8));\n\t\tvertexD.incidentEdges = edges;\n\n\t\tedges = new ArrayList<Edge>();\n\t\tedges.add(new Edge(vertexD, 4));\n\t\tedges.add(new Edge(vertexF, 3));\n\t\tvertexE.incidentEdges = edges;\n\n\t\tedges = new ArrayList<Edge>();\n\t\tedges.add(new Edge(vertexA, 5));\n\t\tedges.add(new Edge(vertexC, 1));\n\t\tedges.add(new Edge(vertexE, 3));\n\t\tvertexF.incidentEdges = edges;\n\n\t\tedges = new ArrayList<Edge>();\n\t\tedges.add(new Edge(vertexD, 8));\n\t\tvertexG.incidentEdges = edges;\n\n\t\tgraph.add(vertexA);\n\t\tgraph.add(vertexB);\n\t\tgraph.add(vertexC);\n\t\tgraph.add(vertexD);\n\t\tgraph.add(vertexE);\n\t\tgraph.add(vertexF);\n\t\tgraph.add(vertexG);\n\n\t\treturn graph;\n\t}", "private void fiveNodesTopo() {\n ReadWriteTransaction tx = dataBroker.newReadWriteTransaction();\n n(tx, true, \"n1\", Stream.of(pI(\"n1:1\"), pB(\"n1:2\"), pI(\"n1:3\"), pO(\"n1:4\")));\n n(tx, true, \"n2\", Stream.of(pI(\"n2:1\"), pB(\"n2:2\"), pO(\"n2:3\"), pI(\"n2:4\")));\n n(tx, true, \"n3\", Stream.of(pO(\"n3:1\"), pB(\"n3:2\"), pO(\"n3:3\"), pI(\"n3:4\")));\n n(tx, true, \"n4\", Stream.of(pO(\"n4:1\"), pI(\"n4:2\"), pB(\"n4:3\"), pB(\"n4:4\")));\n n(tx, true, \"n5\", Stream.of(pI(\"n5:1\"), pB(\"n5:2\"), pB(\"n5:3\"), pO(\"n5:4\")));\n l(tx, \"n2\", \"n2:3\", \"n3\", \"n3:4\", OperationalState.ENABLED, ForwardingDirection.BIDIRECTIONAL);\n l(tx, \"n3\", \"n3:1\", \"n1\", \"n1:1\", OperationalState.ENABLED, ForwardingDirection.BIDIRECTIONAL);\n l(tx, \"n3\", \"n3:3\", \"n5\", \"n5:1\", OperationalState.ENABLED, ForwardingDirection.BIDIRECTIONAL);\n l(tx, \"n4\", \"n4:1\", \"n1\", \"n1:3\", OperationalState.ENABLED, ForwardingDirection.BIDIRECTIONAL);\n l(tx, \"n1\", \"n1:4\", \"n2\", \"n2:4\", OperationalState.ENABLED, ForwardingDirection.BIDIRECTIONAL);\n l(tx, \"n5\", \"n5:4\", \"n4\", \"n4:2\", OperationalState.ENABLED, ForwardingDirection.BIDIRECTIONAL);\n try {\n tx.submit().checkedGet();\n } catch (TransactionCommitFailedException e) {\n e.printStackTrace();\n }\n }", "public void ConvertMinimiz( ArrayList<Node>listConvert)\n {\n for ( int i=0; i<listConvert.size(); i++)\n {\n Boolean allConvert= true;\n Node n= listConvert.get(i);\n List<Node> neigbors= n.getNeighbors();\n for ( int j=0; j< neigbors.size(); j++)\n {\n Node neigbor = neigbors.get(j);\n if ( neigbor instanceof Ipv6 && (!((Ipv6) neigbor).getType().equals(\"Conv\")))\n {\n allConvert=false;\n }\n else if ( neigbor instanceof Ipv4 && (!((Ipv4) neigbor).getType().equals(\"Conv\")))\n {\n allConvert= false;\n }\n }\n\n if ( allConvert==true)\n {\n if ( n instanceof Ipv6)\n {\n ((Ipv6) n).setType(\"IPV6\");\n n.setIcon(\"./src/img/ipv6.png\");\n listConvert.remove(n);\n }\n else\n {\n ((Ipv4) n).setType(\"IPV4\");\n n.setIcon(\"./src/img/ipv4.png\");\n listConvert.remove(n);\n }\n }\n }\n }", "private Set<Integer>[] getKernelDAG(List<Integer>[] adjacent) {\n Set<Integer>[] adjacentComponents = (HashSet<Integer>[]) new HashSet[sccCount];\n for (int i = 0; i < adjacentComponents.length; i++) {\n adjacentComponents[i] = new HashSet<>();\n }\n\n for (int vertexId = 0; vertexId < adjacent.length; vertexId++) {\n int currentComponent = sccIds[vertexId];\n\n for (int neighbor : adjacent[vertexId]) {\n if (currentComponent != sccIds[neighbor]) {\n adjacentComponents[currentComponent].add(sccIds[neighbor]);\n }\n }\n }\n return adjacentComponents;\n }", "List<Neuron> getSynapses();", "@Link Network network();", "private Collection<Node> keepOnlySetElement(Collection<Node> nodes) {\n Set<Node> elements = new HashSet<>();\n for (Node node : nodes) {\n Edge originalEdge = synchronizer().getOriginalEdge(node);\n if ((originalEdge != null && !boundaries.edges.contains(originalEdge))\n || !boundaries.nodes.contains(node)) {\n elements.add(node);\n }\n }\n return elements;\n }", "public void dfs(LinkedList<Node>[] adjList){\n Set<Integer> visited = new HashSet<>();\n\n for(LinkedList<Node> node: adjList){\n Node curr = node.getFirst();\n if(!visited.contains(curr)){\n ArrayList<Integer> components = new ArrayList<>();\n components = getConnectedComponets(curr, visited, components);\n System.out.printf(\"do something %s\", components.toString());\n }\n }\n }", "void removeNodes(List<CyNode> nodes);", "private void removeNoMoreExistingOriginalNodes() {\n for (Node mirrorNode : mirrorGraph.nodes()) {\n if (!isPartOfMirrorEdge(mirrorNode) && !originalGraph.has(mirrorNode)) {\n mirrorGraph.remove(mirrorNode);\n }\n }\n }", "private void printNetworks() {\n// for (GeneticNeuralNetwork network : networks)\n// System.out.println(network);\n// System.out.println(\"----------***----------\");\n// ////\n }", "public GraphNode buildGraph()\n {\n GraphNode node1 = new GraphNode(1);\n GraphNode node2 = new GraphNode(2);\n GraphNode node3 = new GraphNode(3);\n GraphNode node4 = new GraphNode(4);\n List<GraphNode> v = new ArrayList<GraphNode>();\n v.add(node2);\n v.add(node4);\n node1.neighbours = v;\n v = new ArrayList<GraphNode>();\n v.add(node1);\n v.add(node3);\n node2.neighbours = v;\n v = new ArrayList<GraphNode>();\n v.add(node2);\n v.add(node4);\n node3.neighbours = v;\n v = new ArrayList<GraphNode>();\n v.add(node3);\n v.add(node1);\n node4.neighbours = v;\n return node1;\n }", "public int[] findRedundantDirectedConnection(int[][] edges) {\n int N = edges.length;\n int[] parent = new int[N+1];\n int[] canA = new int[2];\n int[] canB = new int[2];\n // This loop is for checking whether there is a node having two parents\n // If there is such a node, then one of the two edges connecting it to its two parents must be redundant\n // And we keep them in canA and canB (canB occurs later than canA)\n for (int[] e : edges) {\n if (parent[e[1]] != 0) {\n canA = new int[]{parent[e[1]], e[1]};\n canB = Arrays.copyOf(e, 2);\n } else {\n parent[e[1]] = e[0];\n }\n }\n\n // This loop is for checking whether there is still a circle if we ignore the edge canB\n // If there is not a circle anymore, then return canB\n // If there is still a circle, then we check whether canA/canB has been filled in the first loop\n // If canA/canB has been filled, then return canA\n // If canA/canB has not been filled, then it is the case that every node has exactly one parent,\n // so return the current edge\n UnionFind uf = new UnionFind(N);\n for (int[] e : edges) {\n if (Arrays.equals(e, canB))\n continue;\n if (uf.union(e[0], e[1])) {\n if (canA[0] != 0)\n return canA;\n else\n return e;\n }\n }\n\n return canB;\n }", "private ScheduleGrph initializeIdenticalTaskEdges(ScheduleGrph input) {\n\n\t\tScheduleGrph correctedInput = (ScheduleGrph) SerializationUtils.clone(input);\n\t\t// FORKS AND TODO JOINS\n\t\t/*\n\t\t * for (int vert : input.getVertices()) { TreeMap<Integer, List<Integer>> sorted\n\t\t * = new TreeMap<Integer, List<Integer>>(); for (int depend :\n\t\t * input.getOutNeighbors(vert)) { int edge = input.getSomeEdgeConnecting(vert,\n\t\t * depend); int weight = input.getEdgeWeightProperty().getValueAsInt(edge); if\n\t\t * (sorted.get(weight) != null) { sorted.get(weight).add(depend); } else {\n\t\t * ArrayList<Integer> a = new ArrayList(); a.add(depend); sorted.put(weight, a);\n\t\t * }\n\t\t * \n\t\t * } int curr = -1; for (List<Integer> l : sorted.values()) { for (int head : l)\n\t\t * {\n\t\t * \n\t\t * if (curr != -1) { correctedInput.addDirectedSimpleEdge(curr, head); } curr =\n\t\t * head; }\n\t\t * \n\t\t * } }\n\t\t */\n\n\t\tfor (int vert : input.getVertices()) {\n\t\t\tfor (int vert2 : input.getVertices()) {\n\t\t\t\tint vertWeight = input.getVertexWeightProperty().getValueAsInt(vert);\n\t\t\t\tint vert2Weight = input.getVertexWeightProperty().getValueAsInt(vert2);\n\n\t\t\t\tIntSet vertParents = input.getInNeighbors(vert);\n\t\t\t\tIntSet vert2Parents = input.getInNeighbors(vert2);\n\n\t\t\t\tIntSet vertChildren = input.getOutNeighbors(vert);\n\t\t\t\tIntSet vert2Children = input.getOutNeighbors(vert2);\n\n\t\t\t\tboolean childrenEqual = vertChildren.containsAll(vert2Children)\n\t\t\t\t\t\t&& vert2Children.containsAll(vertChildren);\n\n\t\t\t\tboolean parentEqual = vertParents.containsAll(vert2Parents) && vert2Parents.containsAll(vertParents);\n\n\t\t\t\tboolean inWeightsSame = true;\n\t\t\t\tfor (int parent : vertParents) {\n\t\t\t\t\tfor (int parent2 : vert2Parents) {\n\t\t\t\t\t\tif (parent == parent2 && input.getEdgeWeightProperty()\n\t\t\t\t\t\t\t\t.getValue(input.getSomeEdgeConnecting(parent, vert)) == input.getEdgeWeightProperty()\n\t\t\t\t\t\t\t\t.getValue(input.getSomeEdgeConnecting(parent2, vert2))) {\n\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tinWeightsSame = false;\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tif (!inWeightsSame) {\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tboolean outWeightsSame = true;\n\t\t\t\tfor (int child : vertChildren) {\n\t\t\t\t\tfor (int child2 : vert2Children) {\n\t\t\t\t\t\tif (child == child2 && input.getEdgeWeightProperty()\n\t\t\t\t\t\t\t\t.getValue(input.getSomeEdgeConnecting(vert, child)) == input.getEdgeWeightProperty()\n\t\t\t\t\t\t\t\t.getValue(input.getSomeEdgeConnecting(vert2, child2))) {\n\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\toutWeightsSame = false;\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tif (!outWeightsSame) {\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tboolean alreadyEdge = correctedInput.areVerticesAdjacent(vert, vert2)\n\t\t\t\t\t\t|| correctedInput.areVerticesAdjacent(vert2, vert);\n\n\t\t\t\tif (vert != vert2 && vertWeight == vert2Weight && parentEqual && childrenEqual && inWeightsSame\n\t\t\t\t\t\t&& outWeightsSame && !alreadyEdge) {\n\t\t\t\t\tint edge = correctedInput.addDirectedSimpleEdge(vert, vert2);\n\t\t\t\t\tcorrectedInput.getEdgeWeightProperty().setValue(edge, 0);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\treturn correctedInput;\n\t}", "private void Clean(){\n \t NodeIterable nodeit = graphModel.getGraph().getNodes();\n \t\n \t for (Node node : nodeit) {\n\t\t\t\n \t\t \n \t\t \n\t\t}\n \t\n }", "@Override\n\tpublic graph copy() {\n\t\tgraph copy = new DGraph();\n\t\tCollection<node_data> nColl = this.GA.getV();\n\t\tfor (node_data node : nColl) {\n\t\t\tnode_data temp = new Node((Node) node );\n\t\t\tcopy.addNode(node);\n\t\t}\n\t\tCollection<node_data> nColl2 = this.GA.getV();\n\t\tfor (node_data node1 : nColl2) {\n\t\t\tCollection<edge_data> eColl = this.GA.getE(node1.getKey());\n\t\t\tif (eColl!=null) {\n\t\t\t\tfor (edge_data edge : eColl) {\n\t\t\t\t\tcopy.connect(edge.getSrc(), edge.getDest(), edge.getWeight());\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn copy;\n\t}", "private void phaseOne(){\r\n\r\n\t\twhile (allNodes.size() < endSize){\r\n\r\n\t\t\ttry (Transaction tx = graphDb.beginTx()){\r\n\t\t\t\t//Pick a random node from allNodes\r\n\t\t\t\tint idx = random.nextInt(allNodes.size());\r\n\t\t\t\tNode node = allNodes.get(idx);\r\n\r\n\t\t\t\t//Get all relationships of node\t\t\t\t\r\n\t\t\t\tIterable<Relationship> ite = node.getRelationships(Direction.BOTH);\r\n\t\t\t\tList<Relationship> tempRels = new ArrayList<Relationship>();\r\n\r\n\t\t\t\t//Pick one of the relationships uniformly at random.\r\n\t\t\t\tfor (Relationship rel : ite){\r\n\t\t\t\t\ttempRels.add(rel);\r\n\t\t\t\t}\r\n\r\n\t\t\t\tidx = random.nextInt(tempRels.size());\r\n\t\t\t\tRelationship rel = tempRels.get(idx);\r\n\t\t\t\tNode neighbour = rel.getOtherNode(node);\r\n\r\n\t\t\t\t//Add the neighbour to allNodes\r\n\t\t\t\tif (!allNodes.contains(neighbour)){\r\n\t\t\t\t\tallNodes.add(neighbour);\r\n\t\t\t\t}\r\n\r\n\t\t\t\ttx.success();\r\n\r\n\t\t\t}\r\n\t\t}\r\n\t\t//If reached here, then phase one completed successfully.\r\n\t\treturn;\r\n\t}", "private static void addAllEdgeInstances (Graph graph, boolean isDirected){\n Collection<Node> noteSet = graph.getNodeSet();\n\n for (Iterator<Node> iterator = noteSet.iterator(); iterator.hasNext();) {\n Node startNode = (Node) iterator.next();\n\n for (Iterator<Node> iterator2 = noteSet.iterator(); iterator2.hasNext();) {\n Node endNode = (Node) iterator2.next();\n\n if (!(startNode == endNode)){\n graph.addEdge(startNode.toString().concat(endNode.toString()), startNode, endNode, isDirected);\n }\n\n }\n }\n }", "public void setSeparateCommonEdges(boolean a) {\n\t\tthis.separateCommonEdges = a;\n\t}", "private List<PSRelationship> getParentRelationships(Collection<Integer> ids) \n throws PSException\n {\n PSRelationshipFilter filter = new PSRelationshipFilter();\n filter.setDependentIds(ids);\n filter.setCategory(PSRelationshipFilter.FILTER_CATEGORY_ACTIVE_ASSEMBLY);\n filter.limitToEditOrCurrentOwnerRevision(true);\n \n return ms_rel.findByFilter(filter);\n }", "Relations getGroupOfRelations();", "public DSALinkedList<DSAGraphNode<E>> getAdjacent()\n {\n return links;\n }", "public Vector getAdjacentNodes()\n\t{\n\t\tVector vAdjNodes = new Vector();\n\t\t\n\t\tfor (int i = 0; i < m_vConnectedNodes.size(); i++)\n\t\t{\n\t\t\tif ( ((NodeConnection)m_vConnectedNodes.get(i)).getCost() > 0 )\n\t\t\t{\n\t\t\t\tvAdjNodes.add(((NodeConnection)m_vConnectedNodes.get(i)).getLinkedNode());\n\t\t\t}\n\t\t}\n\t\t\n\t\treturn vAdjNodes;\n\t}", "public List<? extends Node> getOtherNodes() {\n Node node = getNode();\n Node other = getOther();\n Segment segment = node.getSegment();\n Set<Node> result = new HashSet<Node>();\n\n // Add other parts of this segment\n Iterator<Node> nodes = segment.nodes();\n while ( nodes.hasNext() ) {\n Node n = nodes.next();\n if ( !node.equals( n ) ) {\n if ( n.equals( other ) ) {\n result.add( n );\n } else if ( n.isConnector() ) {\n Connector connector = (Connector) n;\n Flow connectorFlow = connector.getInnerFlow();\n if ( isEmptyOrEquivalent( connectorFlow ) ) {\n if ( isSend() ) {\n if ( connector.isSource()\n && !connectorFlow.getTarget().equals( node )\n && !isRedundant( connector ) )\n result.add( connector );\n } else {\n if ( connector.isTarget()\n && !connectorFlow.getSource().equals( node )\n && !isRedundant( connector ) )\n result.add( connector );\n }\n }\n }\n /**\n else {\n // a part in segment with same flow to/from part\n if ( hasPartFlowWithSameName( n ) ) result.add( n );\n }\n **/\n }\n }\n // Add inputs/outputs of other segments\n QueryService queryService = getQueryService();\n for ( Segment s : queryService.list( Segment.class ) ) {\n if ( !segment.equals( s ) ) {\n Iterator<Connector> c = isSend() ? s.inputs() : s.outputs();\n while ( c.hasNext() ) {\n Connector connector = c.next();\n Flow connectorFlow = connector.getInnerFlow();\n if ( isEmptyOrEquivalent( connectorFlow ) ) {\n if ( other.equals( connector )\n || ( !node.isConnectedTo( isSend(), connector, getFlow().getName() )\n && !isRedundant( connector )\n )\n )\n result.add( connector );\n }\n }\n }\n }\n return new ArrayList<Node>( result );\n }", "public static Collection<Integer[]> getDIOCrossConnectCollection() {\n Collection<Integer[]> pairs = new ArrayList<Integer[]>();\n for (Collection<Integer[]> collection : getDIOCrossConnect()) {\n pairs.addAll(collection);\n }\n return pairs;\n }", "public DSALinkedList getAdjacent()\n\t\t{\n\t\t\treturn links;\n\t\t}", "public abstract List<AbstractRelationshipTemplate> getIngoingRelations();", "public Iterator getNetworkList(){\n NeutronTest nt=new NeutronTest(this.idsEndpoint,this.tenantName,this.userName,this.password,this.region);\n Networks ns=nt.listNetworks();\n Iterator<Network> itNet=ns.iterator();\n return itNet;\n }", "private Vector<DataModelNetworkElement> getNetworkElementsToReload() {\r\n\t\t\r\n\t\tVector<DataModelNetworkElement> netElementsFound = new Vector<DataModelNetworkElement>();\r\n\t\t\r\n\t\t// --- Define the result vector -----------------------------\r\n\t\tNetworkModel networkModel = this.graphController.getNetworkModel();\r\n\t\tObject[] netComps = networkModel.getNetworkComponents().values().toArray();\r\n\t\tfor (int i = 0; i < netComps.length; i++) {\r\n\t\t\tNetworkComponent netComp = (NetworkComponent) netComps[i];\r\n\t\t\tNetworkComponentAdapter netCompAdapter = networkModel.getNetworkComponentAdapter(this.graphController, netComp);\r\n\t\t\tif (netCompAdapter==null) continue;\r\n\t\t\t\r\n\t\t\tNetworkComponentAdapter4DataModel dmNetCompAdapter = netCompAdapter.getStoredDataModelAdapter();\r\n\t\t\tif (dmNetCompAdapter!=null && dmNetCompAdapter.containsDataModelType(EomDataModelAdapter.DATA_MODEL_TYPE_EOM_MODEL)==true) {\r\n\t\t\t\t// --- Check for non-ScheduleList's -----------------\r\n\t\t\t\tif (this.hasCertainlyNoScheduleList(netComp)==false) {\r\n\t\t\t\t\tnetElementsFound.add(netComp);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\t\r\n\t\t// --- Work on the GraphNodes -------------------------------\r\n\t\tObject[] graphNodes = networkModel.getGraph().getVertices().toArray();\r\n\t\tfor (int i = 0; i < graphNodes.length; i++) {\r\n\t\t\tGraphNode graphNode = (GraphNode) graphNodes[i];\r\n\t\t\tNetworkComponentAdapter netCompAdapter = networkModel.getNetworkComponentAdapter(this.graphController, graphNode);\r\n\t\t\tif (netCompAdapter==null) continue;\r\n\t\t\t\r\n\t\t\tNetworkComponentAdapter4DataModel dmNetCompAdapter = netCompAdapter.getStoredDataModelAdapter();\r\n\t\t\tif (dmNetCompAdapter!=null && dmNetCompAdapter.containsDataModelType(EomDataModelAdapter.DATA_MODEL_TYPE_EOM_MODEL)==true) {\r\n\t\t\t\t// --- Check for non-ScheduleList's -----------------\r\n\t\t\t\tif (this.hasCertainlyNoScheduleList(graphNode)==false) {\r\n\t\t\t\t\tnetElementsFound.add(graphNode);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\t// --- Some debug printing? ---------------------------------\r\n\t\tif (this.debug==true) {\r\n\t\t\tSystem.out.println(\"[\" + this.getClass().getSimpleName() + \"] \" + (netComps.length + graphNodes.length) + \" network elements in the NetworkModel, \" + netElementsFound.size() + \" to reload.\");\r\n\t\t}\r\n\t\treturn netElementsFound;\r\n\t}", "private void convertOuterJoinstoJoinsIfPossible(\n List<Quadruple<Integer, Integer, JoinOperator, Integer>> outerJoinsDependencyList) {\n int i, j;\n boolean changes = true;\n while (changes) {\n changes = false;\n for (i = 0; i < outerJoinsDependencyList.size(); i++) {\n Quadruple<Integer, Integer, JoinOperator, Integer> tr1 = outerJoinsDependencyList.get(i);\n if (tr1.getThird().getOuterJoin()) {\n for (j = 0; j < outerJoinsDependencyList.size(); j++) {\n Quadruple<Integer, Integer, JoinOperator, Integer> tr2 = outerJoinsDependencyList.get(j);\n if ((i != j) && !(tr2.getThird().getOuterJoin())) {\n if ((tr1.getSecond().equals(tr2.getFirst())) || (tr1.getSecond().equals(tr2.getSecond()))) {\n outerJoinsDependencyList.get(i).getThird().setOuterJoin(false);\n changes = true;\n }\n }\n }\n }\n }\n }\n\n // now remove all joins from the list, as we do not need them anymore! We only need the outer joins\n for (i = outerJoinsDependencyList.size() - 1; i >= 0; i--) {\n if (!outerJoinsDependencyList.get(i).getThird().getOuterJoin()) { // not an outerjoin\n outerJoinsDependencyList.remove(i);\n }\n }\n\n if (outerJoinsDependencyList.size() == 0) {\n for (i = buildSets.size() - 1; i >= 0; i--) {\n buildSets.remove(i); // no need for buildSets if there are no OJs.\n }\n }\n }", "CyNetwork getGroupNetwork();", "public ImmutableNetwork<Node, Edge> buildGraph() {\n\n // MutableNetwork is an interface requiring a type for nodes and a type for edges\n MutableNetwork<Node, Edge> roads = NetworkBuilder.undirected().build();\n\n // Construct Nodes for cities,\n // and add them to a map\n String[] cities = {\"Wuhan\", \"shanghai\", \"Beijing\", \"Tianjin\", \"dalian\"};\n\n Map<String, Node> all_nodes = new TreeMap<String, Node>();\n for (int i = 0; i < cities.length; i++) {\n // Add nodes to map\n Node node = new Node(cities[i]);\n all_nodes.put(cities[i], node);\n\n // Add nodes to network\n roads.addNode(node);\n }\n\n // Construct Edges for roads,\n // and add them to a map\n String[] distances = {\"Wuhan:shanghai:9239\", \"Wuhan:Beijing:1103\", \"Wuhan:Tianjin:1162\", \"Wuhan:dalian:1423\", \"shanghai:Beijing:1214\", \"shanghai:Tianjin:20\", \"Beijing:Tianjin:4\", \"shanghai:dalian:1076\", \"Tianjin:dalian:802\" };\n //String[] distances = {\"A:B:10\",\"A:D:20\", \"A:C:15\", \"B:D:25\", \"B:C:35\" , \"C:D:30\"};\n Map<String, Edge> all_edges = new TreeMap<String, Edge>();\n for (int j = 0; j < distances.length; j++) {\n // Parse out (city1):(city2):(distance)\n String[] splitresult = distances[j].split(\":\");\n String left = splitresult[0];\n String right = splitresult[1];\n String label = left + \":\" + right;\n int value = Integer.parseInt(splitresult[2]);\n\n // Add edges to map\n Edge edge = new Edge(left, right, value);\n all_edges.put(label, edge);\n\n // Add edges to network\n roads.addEdge(all_nodes.get(edge.left), all_nodes.get(edge.right), edge);\n }\n\n // Freeze the network\n ImmutableNetwork<Node, Edge> frozen_roads = ImmutableNetwork.copyOf(roads);\n\n return frozen_roads;\n }", "void removeEdges(List<CyEdge> edges);", "public boolean connectsVertices(Collection<V> vs);", "private void updateOriginalNodesInMirror() {\n for (Node node : originalGraph.nodes()) {\n if (!mirrorGraph.has(node)) {\n mirrorGraph.add(node);\n }\n originalAttributesToMirror(node);\n }\n }", "public static void main(String[] args) {\n\t\tint[][] edges = {{0,1},{1,2},{1,3},{4,5}};\n\t\tGraph graph = createAdjacencyList(edges, true);\n\t\tSystem.out.println(\"Number of connected graphs(Adjacency List) unDirected : \"+getNumberOfConnectedComponents(graph));\n\t\tSystem.out.println(\"Number of connected graphs(Adjacency List) Directed: \"+getNumberOfConnectedComponents(createAdjacencyList(edges, false)));\n\t\t\n\t\t//Shortest Distance & path\n\t\tint[][] edgesW = {{0,1,1},{1,2,4},{2,3,1},{0,3,3},{0,4,1},{4,3,1}};\n\t\tgraph = createAdjacencyList(edgesW, true);\n\t\tSystem.out.println(\"Shortest distance : \"+ getShortestDistance(graph, 0, 3));\n\t\t\n\t\t//Graph represented in Adjacency Matrix\n\t\tint[][] adjacencyMatrix = {{0,1,0,0,1,0},{1,0,1,1,0,0},{0,1,0,1,0,0},{0,1,0,0,0,0},{0,0,0,0,0,0},{0,0,0,0,0,0}};\n\t\t\n\t\t// Connected components or Friends circle\n\t\tSystem.out.println(\"Number of connected graphs(Adjacency Matrix) unDirected Recursive: \"+getNumberOfConnectedComponents(adjacencyMatrix));\n\t\tSystem.out.println(\"Number of connected graphs(Adjacency Matrix) unDirected Iterative: \"+getNumberOfConnectedComponents(adjacencyMatrix));\n\n\t\tSystem.out.println(\"Shortest distance : \"+ getShortestDistance(adjacencyMatrix, 0, 3));\n\t\t\n\t\t// Number of Islands\n\t\tint[][] islandGrid = {{1,1,0,1},{0,1,0,0},{0,0,1,1},{0,1,1,0}};\n\t\tSystem.out.println(\"Number of islands Recursive: \"+ getNumberOfIslands(islandGrid));\n\t\t// re-initialize\n\t\tint[][] islandGridIterative = {{1,1,0,0},{0,1,0,0},{0,0,1,1},{0,1,1,0}};\n\t\tSystem.out.println(\"Number of islands Iterative: \"+ getNumberOfIslandsIterative(islandGridIterative));\n\n\n\t}", "Exp join() {\n List<Node> connectedNode = null;\n Exp connectedExp = Exp.create(AND);\n List<Exp> disconnectedExp = new ArrayList<Exp>();\n boolean disconnectedFilter = false;\n\n for (int i = 0; i < size(); i++) {\n Exp e = get(i);\n\n switch (e.type()) {\n\n case FILTER:\n Filter f = e.getFilter();\n List<String> lvar = f.getVariables();\n\n if (connectedNode == null || isBound(lvar, connectedNode)) {\n // filter is first \n // or filter is bound by current exp : add it to exp\n connectedExp.add(e);\n } else {\n // filter not bound by current exp\n if (!disconnectedFilter) {\n add(disconnectedExp, connectedExp);\n disconnectedFilter = true;\n }\n add(disconnectedExp, e);\n }\n continue;\n\n case OPTION:\n if (connectedNode == null) {\n connectedNode = e.getAllNodes();\n } else {\n connectedNode.addAll(e.getAllNodes());\n }\n\n break;\n\n default:\n // TODO: UNION \n List<Node> nodes = null;\n if (type() == MINUS || type() == OPTIONAL) {\n nodes = e.first().getAllNodes();\n } else {\n nodes = e.getAllNodes();\n }\n\n if (disconnectedFilter) {\n if (!groupEdge) {\n connectedExp = Exp.create(AND);\n connectedNode = null;\n }\n disconnectedFilter = false;\n }\n\n if (connectedNode == null) {\n connectedNode = nodes;\n } else if (intersect(nodes, connectedNode)) {\n connectedNode.addAll(nodes);\n } else {\n add(disconnectedExp, connectedExp);\n connectedExp = Exp.create(AND);\n connectedNode = nodes;\n }\n }\n\n connectedExp.add(e);\n }\n\n if (connectedExp.size() > 0) {\n add(disconnectedExp, connectedExp);\n }\n\n if (disconnectedExp.size() <= 1) {\n return this;\n } else {\n Exp res = join(disconnectedExp);\n //System.out.println(\"E: \" + res);\n return res;\n }\n }", "@Nullable\r\n List<Network> getNetwork();", "void graph4() {\n\t\tconnect(\"8\", \"9\");\n\t\tconnect(\"3\", \"1\");\n\t\tconnect(\"3\", \"2\");\n\t\tconnect(\"3\", \"9\");\n\t\tconnect(\"4\", \"3\");\n\t\t//connect(\"4\", \"5\");\n\t\t//connect(\"4\", \"7\");\n\t\t//connect(\"5\", \"7\");\t\t\n\t}", "public static void main(String[] args) {\n\t\taListNode.next = bListNode;\n\t\tbListNode.next = cListNode;\n\t\tcListNode.next = dListNode;\n\t\tdListNode.next = aListNode;\n\t\tremoveElements(aListNode,1);\n\n\t}", "private static void simplify (GraphDirected<NodeCppOSMDirected, EdgeCppOSMDirected> osmGraph) {\n \t\tfinal Iterator<NodeCppOSMDirected> iteratorNodes = osmGraph.getNodes().iterator();\n \t\twhile (iteratorNodes.hasNext()) {\n \t\t\tfinal NodeCppOSMDirected node = iteratorNodes.next();\n \t\t\t// one in one out\n \t\t\tif (node.getInDegree() == 1 && node.getOutDegree() == 1) {\n \t\t\t\t// get the ids of the two connected nodes\n \t\t\t\tfinal Long currentNodeId = node.getId();\n \t\t\t\tfinal List<EdgeCppOSMDirected> edges = node.getEdges();\n \t\t\t\tfinal EdgeCppOSMDirected edge1 = edges.get(0);\n \t\t\t\tfinal EdgeCppOSMDirected edge2 = edges.get(1);\n \t\t\t\tfinal Long node1id = edge1.getNode1().getId() == (currentNodeId) ? edge2.getNode1().getId() : edge1.getNode1().getId();\n \t\t\t\tfinal Long node2id = edge1.getNode1().getId() == (currentNodeId) ? edge1.getNode2().getId() : edge2.getNode2().getId();\n \t\t\t\tif (node2id == node1id){\n \t\t\t\t\t// we are in a deadend and do not erase ourself\n \t\t\t\t\tcontinue;\n \t\t\t\t}\n \t\t\t\t// concat the list in the right way\n \t\t\t\tList<WayNodeOSM> newMetaNodes = concatMetanodes(edge1.getMetadata().getNodes(), edge2.getMetadata().getNodes(), currentNodeId);\n \t\t\t\t// add a new edge\n \t\t\t\t// TODO: Handle way properly - what would name be in this context?\n \t\t\t\tosmGraph.getNode(node1id).connectWithNodeWeigthAndMeta(osmGraph.getNode(node2id), edge1.getWeight() + edge2.getWeight(),\n \t\t\t\t\t\tnew WayOSM(0, WayOSM.WayType.UNSPECIFIED, \"unknown\", newMetaNodes));\n \t\t\t\t// remove the old node\n \t\t\t\t// do this manually because we otherwise corrupt the iterator\n \t\t\t\tnode.removeAllEdges();\n \t\t\t\titeratorNodes.remove();\n \t\t\t\tcontinue;\n \t\t\t}\n \t\t\t// two in two out\n \t\t\tif (node.getInDegree() == 2 && node.getOutDegree() == 2) {\n \t\t\t\tfinal long currentNodeId = node.getId();\n \t\t\t\t//check the connections\n \t\t\t\tArrayList<EdgeCppOSMDirected> incomingEdges = new ArrayList<>();\n \t\t\t\tArrayList<EdgeCppOSMDirected> outgoingEdges = new ArrayList<>();\n \t\t\t\tfor(EdgeCppOSMDirected edge : node.getEdges()) {\n \t\t\t\t\tif(edge.getNode1().getId() == currentNodeId){\n \t\t\t\t\t\toutgoingEdges.add(edge);\n \t\t\t\t\t}\n \t\t\t\t\telse {\n \t\t\t\t\t\tincomingEdges.add(edge);\n \t\t\t\t\t}\n \t\t\t\t}\n \t\t\t\t//TODO make this condition better\n \t\t\t\tif(outgoingEdges.get(0).getNode2().equals(incomingEdges.get(0).getNode1())){\n \t\t\t\t\t//out0 = in0\n \t\t\t\t\tif(!outgoingEdges.get(1).getNode2().equals(incomingEdges.get(1).getNode1())){\n \t\t\t\t\t\tcontinue;\n \t\t\t\t\t}\n \t\t\t\t\tif(outgoingEdges.get(0).getWeight() != incomingEdges.get(0).getWeight()){\n \t\t\t\t\t\tcontinue;\n \t\t\t\t\t}\n \t\t\t\t\tif(outgoingEdges.get(1).getWeight() != incomingEdges.get(1).getWeight()){\n \t\t\t\t\t\tcontinue;\n \t\t\t\t\t}\n \t\t\t\t}\n \t\t\t\telse {\n \t\t\t\t\t//out0 should be in1\n \t\t\t\t\t//therefore out1 = in0\n \t\t\t\t\tif(!outgoingEdges.get(0).getNode2().equals(incomingEdges.get(1).getNode1())){\n \t\t\t\t\t\tcontinue;\n \t\t\t\t\t}\n \t\t\t\t\tif(!outgoingEdges.get(1).getNode2().equals(incomingEdges.get(0).getNode1())){\n \t\t\t\t\t\tcontinue;\n \t\t\t\t\t}\n \t\t\t\t\tif(outgoingEdges.get(0).getWeight() != incomingEdges.get(1).getWeight()){\n \t\t\t\t\t\tcontinue;\n \t\t\t\t\t}\n \t\t\t\t\tif(outgoingEdges.get(1).getWeight() != incomingEdges.get(0).getWeight()){\n \t\t\t\t\t\tcontinue;\n \t\t\t\t\t}\n \t\t\t\t}\n \n \t\t\t\t// get the ids of the two connected nodes\n \t\t\t\tfinal NodeCppOSMDirected node1 = incomingEdges.get(0).getNode1();\n \t\t\t\tfinal NodeCppOSMDirected node2 = incomingEdges.get(1).getNode1();\n \t\t\t\t// \t\t\tif (node1.equals(node2)){\n \t\t\t\t// \t\t\t\t// we are in a loop and do not erase ourself\n \t\t\t\t// \t\t\t\tcontinue;\n \t\t\t\t// \t\t\t}\n \t\t\t\t// concat the list in the right way\n \t\t\t\tList<WayNodeOSM> metaNodes1 = incomingEdges.get(0).getMetadata().getNodes();\n \t\t\t\tList<WayNodeOSM> metaNodes2 = incomingEdges.get(1).getMetadata().getNodes();\n \t\t\t\tdouble weight = incomingEdges.get(0).getWeight() +incomingEdges.get(1).getWeight();\n \t\t\t\tList<WayNodeOSM> newMetaNodes = concatMetanodes(metaNodes1, metaNodes2, currentNodeId);\n \t\t\t\t// add a new edge\n \t\t\t\t// TODO: Handle way properly - what would name be in this context?\n \t\t\t\tnode1.connectWithNodeWeigthAndMeta(node2, weight,\n \t\t\t\t\t\tnew WayOSM(0, WayOSM.WayType.UNSPECIFIED, \"unknown\", newMetaNodes));\n \t\t\t\tnode2.connectWithNodeWeigthAndMeta(node1, weight,\n \t\t\t\t\t\tnew WayOSM(0, WayOSM.WayType.UNSPECIFIED, \"unknown\", newMetaNodes));\n \t\t\t\t// remove the old node\n \t\t\t\t// do this manually because we otherwise corrupt the iterator\n \t\t\t\tnode.removeAllEdges();\n \t\t\t\titeratorNodes.remove();\n \t\t\t}\n \t\t}\n \t}", "@Test\r\n void insert_multiple_vertexes_and_edges_remove_vertex() {\r\n graph.addEdge(\"A\", \"B\");\r\n graph.addEdge(\"B\", \"C\");\r\n graph.addEdge(\"A\", \"C\");\r\n graph.addEdge(\"B\", \"D\");\r\n \r\n List<String> adjacent;\r\n vertices = graph.getAllVertices(); \r\n int numberOfEdges = graph.size();\r\n int numberOfVertices = graph.order();\r\n if(numberOfEdges != 4) {\r\n fail();\r\n }\r\n if(numberOfVertices != 4) {\r\n fail();\r\n }\r\n \r\n // Check that graph has all added vertexes\r\n if(!vertices.contains(\"A\")| !vertices.contains(\"B\")|\r\n !vertices.contains(\"C\")|!vertices.contains(\"D\")) {\r\n fail();\r\n }\r\n \r\n // Check that A's outgoing edges are correct\r\n adjacent = graph.getAdjacentVerticesOf(\"A\");\r\n if (!adjacent.contains(\"B\") || !adjacent.contains(\"C\"))\r\n fail();\r\n // Check that B's outgoing edges are correct\r\n adjacent = graph.getAdjacentVerticesOf(\"B\");\r\n if (!adjacent.contains(\"C\") | !adjacent.contains(\"D\"))\r\n fail(); \r\n // C and D have no out going edges \r\n adjacent = graph.getAdjacentVerticesOf(\"C\");\r\n if (!adjacent.isEmpty())\r\n fail(); \r\n adjacent = graph.getAdjacentVerticesOf(\"D\");\r\n if (!adjacent.isEmpty())\r\n fail(); \r\n // Remove B from the graph \r\n graph.removeVertex(\"B\");\r\n // Check that A's outgoing edges are correct\r\n // An edge to B should no exist any more \r\n adjacent = graph.getAdjacentVerticesOf(\"A\");\r\n if (adjacent.contains(\"B\") || !adjacent.contains(\"C\"))\r\n fail();\r\n // There should be no elements in the list of successors\r\n // of B since its deleted form the graph\r\n adjacent = graph.getAdjacentVerticesOf(\"B\");\r\n if (!adjacent.isEmpty())\r\n fail(); \r\n // Check that graph has still has all vertexes not removed\r\n if(!vertices.contains(\"A\")| !vertices.contains(\"C\")|\r\n !vertices.contains(\"D\")) {\r\n fail();\r\n }\r\n //Check that vertex B was removed from graph \r\n if(vertices.contains(\"B\")) {\r\n fail();\r\n }\r\n numberOfEdges = graph.size();\r\n numberOfVertices = graph.order();\r\n if(numberOfEdges != 1) {\r\n fail();\r\n }\r\n if(numberOfVertices != 3) {\r\n fail();\r\n }\r\n }", "public void fixEdges() {\n\tfor (LayoutEdge lEdge: edgeList) {\n\t // Get the underlying edge\n\t CyEdge edge = lEdge.getEdge();\n\t CyNode target = (CyNode) edge.getTarget();\n\t CyNode source = (CyNode) edge.getSource();\n\n\t if (nodeToLayoutNode.containsKey(source) && nodeToLayoutNode.containsKey(target)) {\n\t\t// Add the connecting nodes\n\t\tlEdge.addNodes((LayoutNode) nodeToLayoutNode.get(source),\n\t\t\t (LayoutNode) nodeToLayoutNode.get(target));\n\t }\n\t}\n }", "private List<NodePair> allNodePairs(List<Node> nodes) {\n List<NodePair> nodePairs = new ArrayList<>();\n for (int j = 0; j < nodes.size() - 1; j++) {\n for (int k = j + 1; k < nodes.size(); k++) {\n nodePairs.add(new NodePair(nodes.get(j), nodes.get(k)));\n }\n }\n return nodePairs;\n }", "public Object clone() {\r\n\t\tNetwork net = new Network();\r\n\t\tfor (Variable v : variables) {\r\n\t\t\tVariable v1 = v.copy(net);\r\n\t\t\tif (v.getIndex() != v1.getIndex())\r\n\t\t\t\tthrow new IllegalArgumentException();\r\n\t\t}\r\n\t\tfor (Constraint c: constraints) { \r\n\t\t\tConstraint c1 = c.copy(net);\r\n\t\t\tif (c.getIndex() != c1.getIndex())\r\n\t\t\t\tthrow new IllegalArgumentException();\r\n\t\t}\r\n\t\tif (objective != null) {\r\n\t\t\tnet.setObjective(net.getVariable(objective.getIndex()));\r\n\t\t}\r\n\t\treturn net;\r\n\t}", "double collectOutput(List<NeuronsConnection> inputConnections);", "ArrayList<Edge> getAdjacencies();", "public abstract List<AbstractRelationshipTemplate> getOutgoingRelations();", "public List<Graph> createGraphs(Graph g) {\n List<Graph> gg = new ArrayList<>();\n Graph tmpG = g, tmp;\n\n boolean hasDisconnG = true;\n while (hasDisconnG) {\n // get one vertex as source vertex\n List<Vertex> vertexes = new ArrayList<>(tmpG.getVertices().values());\n calcSP(tmpG, vertexes.get(0));\n gg.add(tmpG);\n hasDisconnG = false;\n List<Vertex> vv = new ArrayList<>();\n for (Vertex v : tmpG.getVertices().values()) {\n if (v.minDistance == Double.POSITIVE_INFINITY) {\n // System.out.println(\"Vertex: \" + v.name + \", dist: \" + v.minDistance);\n vv.add(v);\n hasDisconnG = true;\n }\n }\n\n if (hasDisconnG) {\n tmp = new Graph();\n for (Vertex v: vv) {\n tmpG.removeVertex(v.name);\n for (Edge e: v.neighbours) {\n tmp.addEdge(v.name, e.target.name, 1);\n }\n }\n tmpG = tmp;\n }\n }\n return gg;\n }", "public ISemanticLinkColl getParentSemanticLinks()\n throws OculusException;", "private List<List<Edge>> walker(String sourceNode, String destNode, List<Edge> currentPath, List<List<Edge>> paths) {\n if (currentPath == null) {\n currentPath = new ArrayList<>();\n }\n if (paths == null) {\n paths = new ArrayList<>();\n }\n\n if (sourceNode.equals(destNode)) {\n return paths;\n }\n\n\n// List<Edge> edges = findByNodeA(sourceNode);\n List<Edge> edges = allEdges.stream().filter(edge -> edge.nodeA.equals(sourceNode)).collect(Collectors.toList());\n\n\n for (Edge edge : edges) {\n if (!currentPath.contains(edge)&&!containsBidirectionalRef(currentPath,edge)) {\n List<Edge> forkPath = (List<Edge>) ((ArrayList<Edge>) currentPath).clone();\n\n forkPath.add(edge);\n\n if (edge.getNodeB().equals(destNode)) {\n paths.add(forkPath);\n } else {\n walker(edge.getNodeB(), destNode,forkPath,paths);\n }\n }\n }\n\n return paths;\n }", "public ArrayList<GraphNode> getAroundNodes(GraphNode n1){\n ArrayList<GraphNode> temp1 = new ArrayList<GraphNode>();\n if(!n1.isValid())\n return temp1;\n EdgeList<GraphEdge> m1 = edgeListVector.get(n1.getIndex());\n\n\n for(GraphEdge e1:m1){\n temp1.add(nodeVector.get(e1.getTo()));\n }\n return temp1;\n }", "private void buildGraph() {\n\t\tfor (Map<String, Channel> map: this.channels.values()) {\n\t\t\t// Add all channels\n\t\t\t\n\t\t\t// TODO: deal with channels spread over multiple redis instances (replicated)\n\t\t\t\n\t\t\t// Add all but ignore if some channels should be ignored\n\t\t\tfor (Map.Entry<String, Channel> entry: map.entrySet()) {\n\t\t\t\tif (IGNORE_UNICAST_AND_SUBSCRIBE) {\n\t\t\t\t\tif (entry.getKey().startsWith(\"unicast\") == false && entry.getKey().startsWith(\"sub\") == false) {\n\t\t\t\t\t\tif (entry.getKey().startsWith(\"tile\")) {\n\t\t\t\t\t\t\tchannelList.add(entry.getValue());\t\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\tchannelList.add(entry.getValue());\n\t\t\t\t}\n\t\t\t}\n\t\t\t//channelList.addAll(map.values());\n\t\t}\n\t\t\n\t\t// Double-iteration to build pairs\n\t\tfor (Channel channel1: channelList) {\n\t\t\tfor (Channel channel2: channelList) {\n\t\t\t\tif (channel1 != channel2) {\n\t\t\t\t\t// Put channels as nodes in the set\n\t\t\t\t\tthis.nodes.add(channel1.getChannelName());\n\t\t\t\t\tthis.nodes.add(channel2.getChannelName());\n\t\t\t\t\t\n\t\t\t\t\t// Build pair\n\t\t\t\t\tChannelPair pair = new ChannelPair(channel1.getChannelName(), channel2.getChannelName());\n\t\t\t\t\t\n\t\t\t\t\t// Check if it is contained in the map\n\t\t\t\t\tif (this.pairMultiplicity.containsKey(pair) == false) {\n\t\t\t\t\t\t// Count common subscribers\n\t\t\t\t\t\tint commonSubscribers = countCommonSubscribers(channel1, channel2);\n\t\t\t\t\t\t\n\t\t\t\t\t\tif (commonSubscribers > 0) {\n\t\t\t\t\t\t\t// Perform computation and add it\n\t\t\t\t\t\t\tthis.pairMultiplicity.put(pair, commonSubscribers);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\t\n\t\t}\n\t}", "public static List<NbiNetConnection> queryNetConnections(List<NbiNetConnection> conds) throws ServiceException {\n LOGGER.info(\"Start to query netconnections,the conditions is :\" + JsonUtils.toJson(conds));\n List<NbiNetConnection> connections = new ArrayList<>();\n if(CollectionUtils.isEmpty(conds)) {\n LOGGER.info(\"The condition is empty.\");\n return connections;\n }\n List<ConnectionPackage> packages = VpnConnectionUtil.splitConnections(conds);\n for(ConnectionPackage connectionPkg : packages) {\n List<String> uuids = ModelServiceUtil.getUuidList(connectionPkg.getConnections());\n LOGGER.info(\"Start query local connections,the uuid is :\" + JsonUtils.toJson(uuids) + \",type is:\"\n + connectionPkg.getType());\n\n if(\"vxlan\".equals(connectionPkg.getType())) {\n connections.addAll(vxlanDao.query(uuids, NetVxlanConnection.class));\n } else if(\"ipsec\".equals(connectionPkg.getType())) {\n connections.addAll(ipsecDao.query(uuids, NetIpsecConnection.class));\n } else {\n continue;\n }\n }\n LOGGER.info(\"Query local connections success,the result is :\" + JsonUtils.toJson(connections));\n return connections;\n }", "public static void convertToWebgraphUndirected() {\n\t\tObjectArrayList<File> list = Utilities.getUndirectedGraphList(LoadMethods.ASCII);\n\t\tUtilities.outputLine(\"Converting \" + list.size() + \" undirected graphs...\", 1);\n\n\t\tint k = 0;\n\t\tfor (File f : list) {\n\t\t\t\n\t\t\tgraph.Undir g = Undir.load(f.getPath(), GraphTypes.ADJLIST, LoadMethods.ASCII);\n\t\t\tString output = \"Undirected/\" + f.getName();\n\n\t\t\tif (output.lastIndexOf('.') >= 0) {\n\t\t\t\toutput = output.substring(0, output.lastIndexOf('.'));\n\t\t\t}\n\t\t\tUtilities.output(++k + \" - \" + f.getPath(), 1);\n\t\t\tg.exportAsWebgraph(output);\n\t\t\tUtilities.outputLine(\" => \" + Utilities.webGraphPath + output, 1);\n\t\t}\n\t}", "public static ArrayList<String> connectors2(Graph g) {\n boolean[] visits = new boolean[g.members.length]; \n for (int i=0;i<=g.members.length-1;i++) {\n \tvisits[i]=false;\n }\n int[] dfsnum = new int[g.members.length];\n int[] back = new int[g.members.length];\n ArrayList<String> answer = new ArrayList<String>();\n\n //driver portion\n for (Person person : g.members) {\n //if it hasn't been visited\n if (visits[g.map.get(person.name)]==false){\n //for different islands\n dfsnum = new int[g.members.length];\n dfs(g.map.get(person.name), g.map.get(person.name), g, visits, dfsnum, back, answer);\n }\n }\n \n //check if vertex has one neighbor\n for (int i = 0; i < answer.size(); i++) {\n Friend ptr = g.members[g.map.get(answer.get(i))].first;\n //counts number of neighbors\n int count = 0;\n while (ptr != null) {\n ptr = ptr.next;\n count++;\n }\n if (count == 1) answer.remove(i);\n if (count == 0) answer.remove(i);\n } \n for (Person member : g.members) {\n if (member.first!=null&& member.first.next == null) {\n if (answer.contains(g.members[member.first.fnum].name)==false)\n \t\t answer.add(g.members[member.first.fnum].name);\n }\n }\n answer=modify(answer,g);\n if (answer==null||answer.size()==0) return null;\n return answer;\n }", "public static void complementaryGraph(mxAnalysisGraph aGraph) {\n ArrayList<ArrayList<mxCell>> oldConnections = new ArrayList<ArrayList<mxCell>>();\n mxGraph graph = aGraph.getGraph();\n Object parent = graph.getDefaultParent();\n //replicate the edge connections in oldConnections\n Object[] vertices = aGraph.getChildVertices(parent);\n int vertexCount = vertices.length;\n\n for (int i = 0; i < vertexCount; i++) {\n mxCell currVertex = (mxCell)vertices[i];\n int edgeCount = currVertex.getEdgeCount();\n mxCell currEdge = new mxCell();\n ArrayList<mxCell> neighborVertexes = new ArrayList<mxCell>();\n\n for (int j = 0; j < edgeCount; j++) {\n currEdge = (mxCell)currVertex.getEdgeAt(j);\n\n mxCell source = (mxCell)currEdge.getSource();\n mxCell destination = (mxCell)currEdge.getTarget();\n\n if (!source.equals(currVertex)) {\n neighborVertexes.add(j, source);\n }\n else {\n neighborVertexes.add(j, destination);\n }\n\n }\n\n oldConnections.add(i, neighborVertexes);\n }\n\n //delete all edges and make a complementary model\n Object[] edges = aGraph.getChildEdges(parent);\n graph.removeCells(edges);\n\n for (int i = 0; i < vertexCount; i++) {\n ArrayList<mxCell> oldNeighbors = new ArrayList<mxCell>();\n oldNeighbors = oldConnections.get(i);\n mxCell currVertex = (mxCell)vertices[i];\n\n for (int j = 0; j < vertexCount; j++) {\n mxCell targetVertex = (mxCell)vertices[j];\n boolean shouldConnect = true; // the decision if the two current vertexes should be connected\n\n if (oldNeighbors.contains(targetVertex)) {\n shouldConnect = false;\n }\n else if (targetVertex.equals(currVertex)) {\n shouldConnect = false;\n }\n else if (areConnected(aGraph, currVertex, targetVertex)) {\n shouldConnect = false;\n }\n\n if (shouldConnect) {\n graph.insertEdge(parent, null, null, currVertex, targetVertex);\n }\n }\n\n }\n }", "private void createGraph() {\n \t\t\n \t\t// Check capacity\n \t\tCytoscape.ensureCapacity(nodes.size(), edges.size());\n \n \t\t// Extract nodes\n \t\tnodeIDMap = new OpenIntIntHashMap(nodes.size());\n \t\tginy_nodes = new IntArrayList(nodes.size());\n \t\t// OpenIntIntHashMap gml_id2order = new OpenIntIntHashMap(nodes.size());\n \n \t\tfinal HashMap gml_id2order = new HashMap(nodes.size());\n \n \t\tSet nodeNameSet = new HashSet(nodes.size());\n \n \t\tnodeMap = new HashMap(nodes.size());\n \n \t\t// Add All Nodes to Network\n \t\tfor (int idx = 0; idx < nodes.size(); idx++) {\n \t\t\t\n \t\t\tif (taskMonitor != null) {\n \t\t\t\ttaskMonitor.setPercentCompleted(percentUtil.getGlobalPercent(1,\n \t\t\t\t\t\tidx, nodes.size()));\n \t\t\t}\n \n \t\t\t// Get a node object (NOT a giny node. XGMML node!)\n \t\t\tfinal cytoscape.generated2.Node curNode = (cytoscape.generated2.Node) nodes\n \t\t\t\t\t.get(idx);\n \t\t\tfinal String nodeType = curNode.getName();\n \t\t\tfinal String label = (String) curNode.getLabel();\n \n \t\t\treadAttributes(label, curNode.getAtt(), NODE);\n \n \t\t\tnodeMap.put(curNode.getId(), label);\n \n \t\t\tif (nodeType != null) {\n \t\t\t\tif (nodeType.equals(\"metaNode\")) {\n \t\t\t\t\tfinal Iterator it = curNode.getAtt().iterator();\n \t\t\t\t\twhile (it.hasNext()) {\n \t\t\t\t\t\tfinal Att curAttr = (Att) it.next();\n \t\t\t\t\t\tif (curAttr.getName().equals(\"metanodeChildren\")) {\n \t\t\t\t\t\t\tmetanodeMap.put(label, ((Graph) curAttr.getContent()\n \t\t\t\t\t\t\t\t\t.get(0)).getNodeOrEdge());\n \t\t\t\t\t\t}\n \t\t\t\t\t}\n \t\t\t\t}\n \t\t\t}\n \t\t\tif (nodeNameSet.add(curNode.getId())) {\n \t\t\t\tfinal Node node = (Node) Cytoscape.getCyNode(label, true);\n \n \t\t\t\tginy_nodes.add(node.getRootGraphIndex());\n \t\t\t\tnodeIDMap.put(idx, node.getRootGraphIndex());\n \n \t\t\t\t// gml_id2order.put(Integer.parseInt(curNode.getId()), idx);\n \n \t\t\t\tgml_id2order.put(curNode.getId(), Integer.toString(idx));\n \n \t\t\t\t// ((KeyValue) node_root_index_pairs.get(idx)).value = (new\n \t\t\t\t// Integer(\n \t\t\t\t// node.getRootGraphIndex()));\n \t\t\t} else {\n \t\t\t\tthrow new XGMMLException(\"XGMML id \" + nodes.get(idx)\n \t\t\t\t\t\t+ \" has a duplicated label: \" + label);\n \t\t\t\t// ((KeyValue)node_root_index_pairs.get(idx)).value = null;\n \t\t\t}\n \t\t}\n \t\tnodeNameSet = null;\n \n \t\t// Extract edges\n \t\tginy_edges = new IntArrayList(edges.size());\n \t\tSet edgeNameSet = new HashSet(edges.size());\n \n \t\tfinal CyAttributes edgeAttributes = Cytoscape.getEdgeAttributes();\n \n \t\t// Add All Edges to Network\n \t\tfor (int idx = 0; idx < edges.size(); idx++) {\n \n \t\t\tif (taskMonitor != null) {\n \t\t\t\ttaskMonitor.setPercentCompleted(percentUtil.getGlobalPercent(2,\n \t\t\t\t\t\tidx, edges.size()));\n \t\t\t}\n \t\t\tfinal cytoscape.generated2.Edge curEdge = (cytoscape.generated2.Edge) edges\n \t\t\t\t\t.get(idx);\n \n \t\t\tif (gml_id2order.containsKey(curEdge.getSource())\n \t\t\t\t\t&& gml_id2order.containsKey(curEdge.getTarget())) {\n \n \t\t\t\tString edgeName = curEdge.getLabel();\n \n \t\t\t\tif (edgeName == null) {\n \t\t\t\t\tedgeName = \"N/A\";\n \t\t\t\t}\n \n \t\t\t\tint duplicate_count = 1;\n \t\t\t\twhile (!edgeNameSet.add(edgeName)) {\n \t\t\t\t\tedgeName = edgeName + \"_\" + duplicate_count;\n \t\t\t\t\tduplicate_count += 1;\n \t\t\t\t}\n \n \t\t\t\tEdge edge = Cytoscape.getRootGraph().getEdge(edgeName);\n \n \t\t\t\tif (edge == null) {\n \n \t\t\t\t\tfinal String sourceName = (String) nodeMap.get(curEdge\n \t\t\t\t\t\t\t.getSource());\n \t\t\t\t\tfinal String targetName = (String) nodeMap.get(curEdge\n \t\t\t\t\t\t\t.getTarget());\n \n \t\t\t\t\tfinal Node node_1 = Cytoscape.getRootGraph().getNode(\n \t\t\t\t\t\t\tsourceName);\n \t\t\t\t\tfinal Node node_2 = Cytoscape.getRootGraph().getNode(\n \t\t\t\t\t\t\ttargetName);\n \n \t\t\t\t\tfinal Iterator it = curEdge.getAtt().iterator();\n \t\t\t\t\tAtt interaction = null;\n \t\t\t\t\tString itrValue = \"unknown\";\n \t\t\t\t\twhile (it.hasNext()) {\n \t\t\t\t\t\tinteraction = (Att) it.next();\n \t\t\t\t\t\tif (interaction.getName().equals(\"interaction\")) {\n \t\t\t\t\t\t\titrValue = interaction.getValue();\n \t\t\t\t\t\t\tif (itrValue == null) {\n \t\t\t\t\t\t\t\titrValue = \"unknown\";\n \t\t\t\t\t\t\t}\n \t\t\t\t\t\t\tbreak;\n \t\t\t\t\t\t}\n \t\t\t\t\t}\n \n \t\t\t\t\tedge = Cytoscape.getCyEdge(node_1, node_2,\n \t\t\t\t\t\t\tSemantics.INTERACTION, itrValue, true);\n \n \t\t\t\t\t// Add interaction to CyAttributes\n \t\t\t\t\tedgeAttributes.setAttribute(edge.getIdentifier(),\n \t\t\t\t\t\t\tSemantics.INTERACTION, itrValue);\n \t\t\t\t}\n \n \t\t\t\t// Set correct ID, canonical name and interaction name\n \t\t\t\tedge.setIdentifier(edgeName);\n \n \t\t\t\treadAttributes(edgeName, curEdge.getAtt(), EDGE);\n \n \t\t\t\tginy_edges.add(edge.getRootGraphIndex());\n \t\t\t\t// ((KeyValue) edge_root_index_pairs.get(idx)).value = (new\n \t\t\t\t// Integer(\n \t\t\t\t// edge.getRootGraphIndex()));\n \t\t\t} else {\n \t\t\t\tthrow new XGMMLException(\n \t\t\t\t\t\t\"Non-existant source/target node for edge with gml (source,target): \"\n \t\t\t\t\t\t\t\t+ nodeMap.get(curEdge.getSource()) + \",\"\n \t\t\t\t\t\t\t\t+ nodeMap.get(curEdge.getTarget()));\n \t\t\t}\n \t\t}\n \t\tedgeNameSet = null;\n \n \t\tif (metanodeMap.size() != 0) {\n \t\t\tfinal Iterator it = metanodeMap.keySet().iterator();\n \t\t\twhile (it.hasNext()) {\n \t\t\t\tfinal String key = (String) it.next();\n \t\t\t\tcreateMetaNode(key, (List) metanodeMap.get(key));\n \t\t\t}\n \t\t}\n \t}", "public void crossover(){\n \t\n \t//int cut2 = ((NODELENGTH * 3 + 1) / 3) + cut;\n \tfor (int g = 0; g < (wallpapers.size() - 1); g += 2){\n \t\tint cut = getCutPoint();\n \t\tint[] parent1 = wallpapers.get(g);\n \t\tint[] parent2 = wallpapers.get(g + 1);\n \t\t\n \t\tint[] child1 = new int[parent1.length];\n \t\tint[] child2 = new int[parent2.length];\n \t\tfor (int i = 0; i < (cut); i++){\n \t\t\tchild1[i] = parent1[i];\n \t\t\tchild2[i] = parent2[i];\n \t\t}\n \t\tfor (int j = cut; j < parent1.length; j++){\n \t\t\tchild1[j] = parent2[j];\n \t\t\tchild2[j] = parent1[j];\n \t\t}\n \t\t\n \t\t\n \t\twallpapers.set(g, child1);\n \t\twallpapers.set(g + 1, child2);\n \t}\n \tfor (int d = 0; d < (wallpapers.size() * 2); d++){\n \t\tif (d < wallpapers.size()){\n \t\t\ttemp_wallpapers.add(wallpapers.get(d));\n \t\t}\n \t\telse {\n \t\t\ttemp_wallpapers.add(node());\n \t\t}\n \t}\n \twallpapers.clear();\n \tfor (int u = 0; u < temp_wallpapers.size(); u++){\n\t\t\twallpapers.add(u, temp_wallpapers.get(u));\n\t\t}\n \ttemp_wallpapers.clear();\n }", "void pairwiseCombine(){\n\t\t\n\t\tmin.Left.Right = min.Right;\n\t\tmin.Right.Left = min.Left;\n\t\t/**\n\t\tPairwise combine differentiates itself in operation of depending on the presence of a child node\n\t\t*/\n\t\t\n\t\tif(min.Child==null){\n\t\t/*map acts as the table to store similar degree nodes*/\n\t\t\tHashMap<Integer, Nodefh> map = new HashMap<Integer, Nodefh>();\n\t\t\tcurrent = min.Right;\n\t\t\tmin = null;\n\t\t\tmin = current;\n\t\t\tlast = current.Left;\n\t\t\twhile(current!=last){\n\t\t\t\tNodefh check = new Nodefh();\n\t\t\t\tcheck = current.Right;\n\t\t\t\twhile(map.containsKey(current.degree)){\n\t\t\t\t\tNodefh temp = map.remove(current.degree);\n\t\t\t\t\t\n\t\t\t\t\t/*Since a parent node can have only one child node a condition is checked to update its child node*/\n\t\t\t\t\tif(temp.dist < current.dist){\n\t\t\t\t\t/*If the node stored is less than the incoming node*/\n\t\t\t\t\t\tcurrent.Right.Left = current.Left;\n\t\t\t\t\t\tcurrent.Left.Right = current.Right;\n\t\t\t\t\t\ttemp.ChildCut = false;\n\t\t\t\t\t\tif(temp.isChildEmpty()){\n\t\t\t\t\t\t\ttemp.Child = current;\n\t\t\t\t\t\t\tcurrent.Left = current.Right = current;\n\t\t\t\t\t\t\ttemp.Child.Parent = temp;\n\t\t\t\t\t\t\ttemp.degree = 1;\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse{\n\t\t\t\t\t\t\tcurrent.Right = temp.Child;\n\t\t\t\t\t\t\tcurrent.Left = temp.Child.Left;\n\t\t\t\t\t\t\ttemp.Child.Left.Right = current;\n\t\t\t\t\t\t\ttemp.Child.Left = current;\n\t\t\t\t\t\t\tcurrent.Parent = temp;\n\t\t\t\t\t\t\tif(temp.Child == temp.Child.Right){\n\t\t\t\t\t\t\t\ttemp.Child.Right = current;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\ttemp.degree +=1;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tcurrent = temp;\n\t\t\t\t\t}\n\t\t\t\t\telse{\n\t\t\t\t\t/*If the incoming node is lower*/\n\t\t\t\t\t\ttemp.Right.Left = temp.Left;\n\t\t\t\t\t\ttemp.Left.Right = temp.Right;\n\t\t\t\t\t\tcurrent.ChildCut = false;\t\n\t\t\t\t\t\tif(current.isChildEmpty()){\n\n\t\t\t\t\t\t\tcurrent.Child = temp;\n\t\t\t\t\t\t\ttemp.Left = temp.Right = temp;\n\t\t\t\t\t\t\tcurrent.Child.Parent = current;\n\t\t\t\t\t\t\tcurrent.degree = 1;\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse{\n\t\t\t\t\t\t\ttemp.Right = current.Child;\n\t\t\t\t\t\t\ttemp.Left = current.Child.Left;\n\t\t\t\t\t\t\tcurrent.Child.Left.Right = temp;\n\t\t\t\t\t\t\tcurrent.Child.Left = temp;\n\t\t\t\t\t\t\ttemp.Parent = current;\n\t\t\t\t\t\t\tcurrent.degree +=1;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t}\n\n\t\t\t\t}\n\t\t\t\tif(min.dist >= current.dist){\n\t\t\t\t\tmin = current;\n\t\t\t\t}\n\t\t\t\tmap.put(current.degree, current);\n\t\t\t\tcurrent = check;\n\n\t\t\t}\n\t\t\tlast = min.Left;\n\t\t\t/*Since our condition is used only till last node and exits during last node the iteration is repeated for the last node*/\n\t\t\twhile(map.containsKey(current.degree)){\n\t\t\t\tNodefh temp = map.remove(current.degree);\n\t\t\t\tif(temp.dist < current.dist){\n\t\t\t\t\ttemp.ChildCut = false;\n\t\t\t\t\tcurrent.Right.Left = current.Left;\n\t\t\t\t\tcurrent.Left.Right = current.Right;\n\t\t\t\t\tif(temp.isChildEmpty()){\n\t\t\t\t\t\ttemp.Child = current;\n\t\t\t\t\t\tcurrent.Left = current.Right = current;\n\t\t\t\t\t\ttemp.Child.Parent = temp;\n\t\t\t\t\t\ttemp.degree = 1;\n\t\t\t\t\t}\n\t\t\t\t\telse{\n\t\t\t\t\t\tcurrent.Right = temp.Child;\n\t\t\t\t\t\tcurrent.Left = temp.Child.Left;\n\t\t\t\t\t\ttemp.Child.Left.Right = current;\n\t\t\t\t\t\ttemp.Child.Left = current;\n\t\t\t\t\t\tcurrent.Parent = temp;\n\t\t\t\t\t\ttemp.degree +=1;\n\t\t\t\t\t}\n\t\t\t\t\tcurrent = temp;\n\t\t\t\t}\n\t\t\t\telse{\n\t\t\t\t\ttemp.Right.Left = temp.Left;\n\t\t\t\t\ttemp.Left.Right = temp.Right;\n\t\t\t\t\tcurrent.ChildCut = false;\n\t\t\t\t\tif(current.isChildEmpty()){\n\t\t\t\t\t\tcurrent.Child = temp;\n\t\t\t\t\t\ttemp.Left = temp.Right = temp;\n\t\t\t\t\t\tcurrent.Child.Parent = current;\n\t\t\t\t\t\tcurrent.degree = 1;\n\t\t\t\t\t}\n\t\t\t\t\telse{\n\t\t\t\t\t\ttemp.Right = current.Child;\n\t\t\t\t\t\ttemp.Left = current.Child.Left;\n\t\t\t\t\t\tcurrent.Child.Left.Right = temp;\n\t\t\t\t\t\tcurrent.Child.Left = temp;\n\t\t\t\t\t\ttemp.Parent = current;\n\t\t\t\t\t\tcurrent.degree +=1;\n\t\t\t\t\t}\n\n\t\t\t\t}\n\t\t\t}\n\t\t\tif(min.dist >= current.dist){\n\t\t\t\tmin = current;\n\t\t\t}\n\t\t\tcurrent = min;\n\t\t\tlast = min.Left;\n\n\t\t}\n\t\telse{\n\t\t\tHashMap<Integer, Nodefh> map = new HashMap<Integer, Nodefh>();\n\t\t\tcurrent = min.Child;\n\t\t\tcurrent.Parent = null;\n\t\t\tif(min!=min.Right){\n\t\t\t\tcurrent.Right.Left = min.Left;\n\t\t\t\tmin.Left.Right = current.Right;\n\t\t\t\tcurrent.Right = min.Right;\n\t\t\t\tmin.Right.Left = current;\n\t\t\t\tlast = current.Left;\n\t\t\t\n\t\t\t}\n\t\t\telse{\n\t\t\t\tlast = current.Left;\n\n\t\t\t}\n\t\t\tmin =null;\n\t\t\tmin = current;\n\t\t\t/*In the presence of a child the child has to be inserted at the top level*/\n\t\t\twhile(current != last){\n\t\t\t\tNodefh check = new Nodefh();\n\t\t\t\tcheck = current.Right;\n\n\t\t\t\twhile(map.containsKey(current.degree)){\n\n\t\t\t\t\tNodefh temp = map.remove(current.degree);\n\t\t\t\t\tif(temp.dist < current.dist){\n\t\t\t\t\t\ttemp.ChildCut = false;\n\t\t\t\t\t\tcurrent.Right.Left = current.Left;\n\t\t\t\t\t\tcurrent.Left.Right = current.Right;\n\t\t\t\t\t\tif(temp.isChildEmpty()){\n\n\t\t\t\t\t\t\ttemp.Child = current;\n\t\t\t\t\t\t\tcurrent.Left = current.Right = current;\n\t\t\t\t\t\t\ttemp.Child.Parent = temp;\n\t\t\t\t\t\t\ttemp.degree = 1;\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse{\n\t\t\t\t\t\t\tcurrent.Right = temp.Child;\n\t\t\t\t\t\t\tcurrent.Left = temp.Child.Left;\n\t\t\t\t\t\t\ttemp.Child.Left.Right = current;\n\t\t\t\t\t\t\ttemp.Child.Left = current;\n\t\t\t\t\t\t\tcurrent.Parent = temp;\n\t\t\t\t\t\t\ttemp.degree +=1;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tcurrent = temp;\n\t\t\t\t\t}\n\t\t\t\t\telse{\n\t\t\t\t\t\ttemp.Right.Left = temp.Left;\n\t\t\t\t\t\ttemp.Left.Right = temp.Right;\n\t\t\t\t\t\tcurrent.ChildCut = false;\n\t\t\t\t\t\tif(current.isChildEmpty()){\n\t\t\t\t\t\t\tcurrent.Child = temp;\n\t\t\t\t\t\t\ttemp.Left = temp.Right = temp;\n\t\t\t\t\t\t\tcurrent.Child.Parent = current;\n\t\t\t\t\t\t\tcurrent.degree = 1;\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse{\n\t\t\t\t\t\t\ttemp.Right = current.Child;\n\t\t\t\t\t\t\ttemp.Left = current.Child.Left;\n\t\t\t\t\t\t\tcurrent.Child.Left.Right = temp;\n\t\t\t\t\t\t\tcurrent.Child.Left = temp;\n\t\t\t\t\t\t\ttemp.Parent = current;\n\t\t\t\t\t\t\tcurrent.degree +=1;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif(min.dist >= current.dist){\n\t\t\t\t\tmin = current;\n\n\t\t\t\t}\n\t\t\t\tmap.put(current.degree, current);\n\t\t\t\tcurrent = check;\n\t\t\t}\n\t\t\tlast = min.Left;\n\t\t\twhile(map.containsKey(current.degree)){\n\t\t\t\tNodefh temp = map.remove(current.degree);\n\t\t\t\tif(temp.dist < current.dist && temp.dist!=0){\n\t\t\t\t\tcurrent.Right.Left = current.Left;\n\t\t\t\t\tcurrent.Left.Right = current.Right;\n\t\t\t\t\ttemp.ChildCut = false;\n\t\t\t\t\tif(temp.isChildEmpty()){\n\t\t\t\t\t\ttemp.Child = current;\n\t\t\t\t\t\tcurrent.Left = current.Right = current;\n\t\t\t\t\t\ttemp.Child.Parent = temp;\n\t\t\t\t\t\ttemp.degree = 1;\n\t\t\t\t\t}\n\t\t\t\t\telse{\n\t\t\t\t\t\tcurrent.Right = temp.Child;\n\t\t\t\t\t\tcurrent.Left = temp.Child.Left;\n\t\t\t\t\t\ttemp.Child.Left.Right = current;\n\t\t\t\t\t\ttemp.Child.Left = current;\n\t\t\t\t\t\tcurrent.Parent = temp;\n\t\t\t\t\t\ttemp.degree +=1;\n\t\t\t\t\t}\n\t\t\t\t\tcurrent = temp;\n\t\t\t\t}\n\t\t\t\telse{\n\t\t\t\t\ttemp.Right.Left = temp.Left;\n\t\t\t\t\ttemp.Left.Right = temp.Right;\n\t\t\t\t\tcurrent.ChildCut = false;\n\t\t\t\t\tif(current.isChildEmpty()){\n\t\t\t\t\t\tcurrent.Child = temp;\n\t\t\t\t\t\ttemp.Left = temp.Right = temp;\n\t\t\t\t\t\tcurrent.Child.Parent = current;\n\t\t\t\t\t\tcurrent.degree = 1;\n\t\t\t\t\t}\n\t\t\t\t\telse{\n\t\t\t\t\t\ttemp.Right = current.Child;\n\t\t\t\t\t\ttemp.Left = current.Child.Left;\n\t\t\t\t\t\tcurrent.Child.Left.Right = temp;\n\t\t\t\t\t\tcurrent.Child.Left = temp;\n\t\t\t\t\t\ttemp.Parent = current;\n\t\t\t\t\t\tcurrent.degree +=1;\n\t\t\t\t\t}\n\n\t\t\t\t}\n\t\t\t}\n\t\t\tif(min.dist >= current.dist){\n\t\t\t\tmin = current;\n\n\t\t\t}\n\t\t\tcurrent = min;\n\t\t\tlast = min.Left;\n\t\t}\n\n\t}", "public AdjacentListGraph(String[] vertexes) {\n this.vertexes = Arrays.copyOf(vertexes, vertexes.length);\n this.heads = new LinkedList[vertexes.length];\n\n // init the heads to save code: if(heads != null)\n for (int i = 0; i < heads.length; i++) {\n this.heads[i] = new LinkedList<>();\n }\n }", "public void perform(int edges[][]) {\n System.out.println(\"Initial graph:\\n\" + this.toString());\n for (int[] i : edges) {\n int p = i[0];\n int q = i[1];\n if (!(this.isConnected(p, q))) {\n System.out.println(\"\\nCreate edge for \" + p + \" and \" + q);\n this.union(p, q);\n System.out.println(this.toString());\n }\n }\n\n System.out.println(\"\\nFinal graph with connected nodes:\\n\" + this.toString());\n }", "private Set<Edge> reachableDAG(Vertex start, Vertex obstacle) {\n \tHashSet<Edge> result = new HashSet<Edge>();\n \tVector<Vertex> currentVertexes = new Vector<Vertex>();\n \tint lastResultNumber = 0;\n \tcurrentVertexes.add(start);\n \t\n \tdo {\n \t\t//System.out.println(\"size of currentVertexes:\" + currentVertexes.size());\n \t\t\n \t\tVector<Vertex> newVertexes = new Vector<Vertex>();\n \t\tlastResultNumber = result.size();\n \t\t\n \t\tfor (Vertex v : currentVertexes) {\n \t\t\t//System.out.println(\"layerID:\" + v.layerID + \"\\tlabel:\" + v.label);\n \t\t\taddIncomingEdges(v, obstacle, result, newVertexes);\n \t\t\taddOutgoingEdges(v, obstacle, result, newVertexes);\n \t\t}\n \t\t\n \t\t//System.out.println(\"size of newVertexes:\" + newVertexes.size());\n \t\t\n \t\tcurrentVertexes = newVertexes;\t\n \t\t//System.out.println(\"lastResultNumber:\" + lastResultNumber);\n \t\t//System.out.println(\"result.size():\" + result.size());\n \t} while (lastResultNumber != result.size());\n \t\n\t\treturn result;\n }", "public abstract DBResult getAdjacentContinuousLinks(int nodeId) throws SQLException;" ]
[ "0.586981", "0.5732888", "0.5464185", "0.54637116", "0.54230434", "0.5420322", "0.5360566", "0.5288852", "0.5272767", "0.5262025", "0.52443314", "0.52207875", "0.52142435", "0.51510197", "0.5144998", "0.51387346", "0.513124", "0.5115323", "0.5099415", "0.5080773", "0.50780743", "0.5069899", "0.50654864", "0.5059977", "0.5037068", "0.50263745", "0.5018652", "0.50139415", "0.5003561", "0.49885157", "0.49852115", "0.49780005", "0.49653795", "0.49431175", "0.49415267", "0.49212623", "0.49193844", "0.49138284", "0.49135625", "0.49062786", "0.48877925", "0.48842975", "0.4882498", "0.48747686", "0.48731735", "0.4869211", "0.48597872", "0.48532826", "0.4847778", "0.4839673", "0.48390073", "0.48368043", "0.48314774", "0.4801884", "0.4788422", "0.47704262", "0.4766983", "0.476283", "0.476278", "0.47568598", "0.475574", "0.47544903", "0.47541612", "0.475088", "0.4749925", "0.4748891", "0.47448426", "0.4744628", "0.47418293", "0.4739107", "0.47328773", "0.47208735", "0.47191194", "0.47178262", "0.47176528", "0.4715348", "0.47144175", "0.47128686", "0.47078675", "0.47040886", "0.4701171", "0.46975535", "0.4695862", "0.46940348", "0.46937177", "0.46883512", "0.46835604", "0.46832553", "0.4681804", "0.46797752", "0.46795952", "0.46771586", "0.4674793", "0.46701357", "0.46691576", "0.46656638", "0.46602428", "0.46549633", "0.46541873", "0.46539786" ]
0.60376006
0
Create a MSBN from an SSBN.
public static Map<String, Set<SimpleSSBNNode>> convertSsbnIntoMsbn( List<SimpleSSBNNode> nodeList){ Map<String, Set<SimpleSSBNNode>> map = new HashMap<String, Set<SimpleSSBNNode>>(); for (SimpleSSBNNode node : nodeList) { // FIXME - ROMMEL - change the name of the MFragInstance so that it is unique!!! // We might have more than one instance of the same MFrag. Here we are putting everything together. String key = node.getMFragInstance().getMFragOrigin().getName(); Set<SimpleSSBNNode> msbnSection = map.get(key); if (msbnSection == null) { msbnSection = new HashSet<SimpleSSBNNode>(); map.put(key, msbnSection); } msbnSection.add(node); // The main objective here is to add the input nodes in this subnetwork. // Since this is a set, it does not hurt to add "again" a resident parent. // The only restriction is that the parent has to be in the SSBN in order to show up // in the MSBN. for (SimpleSSBNNode parent : node.getParents()) { if (nodeList.contains(parent)) { msbnSection.add(parent); } } } return map; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public Builder setSsnBytes(\n com.google.protobuf.ByteString value) {\n if (value == null) {\n throw new NullPointerException();\n }\n bitField0_ |= 0x00000001;\n ssn_ = value;\n onChanged();\n return this;\n }", "public NbMessage(short[] packet) {\n /**\n * Parse using shorts\n */\n this.packet = packet;\n byte header = (byte) ((packet[0] & 0b1111000000000000) >> 12);\n this.isValid = (header == DATA_HEADER);\n this.subheader = (packet[0] & 0b0000111000000000) >> 9;\n this.channel = (packet[0] & 0b0000000111000000) >> 6;\n this.header = (packet[0] & 0b1111000000000000) >> 12;\n this.data = packet[1];\n }", "public static Packet makePacket(String s,boolean check)\r\n\t{\r\n\t\tString a[]=split(s,check);\r\n\t\tswitch(indexOf(prefix,a[0]))\r\n\t\t{\r\n\t\tcase 0:\r\n\t\t\treturn new PacketGGA(a);\r\n\t\tcase 1:\r\n\t\t\treturn new PacketGSA(a);\r\n\t\tcase 2:\r\n\t\t\treturn new PacketGSV(a);\r\n\t\tcase 3:\r\n\t\t\treturn new PacketRMC(a);\r\n\t\tcase 4:\r\n\t\tcase 5:\r\n\t\t\treturn new PacketGLL(a);\r\n\t\tcase 6:\r\n\t\tcase 7:\r\n\t\t\treturn new PacketVTG(a);\r\n\t\tdefault:\r\n\t\t\tthrow new OpenNMEAException(\"Invalid sentence prefix\");\r\n\t\t}\r\n\t}", "public Builder clearSsn() {\n bitField0_ = (bitField0_ & ~0x00000001);\n ssn_ = getDefaultInstance().getSsn();\n onChanged();\n return this;\n }", "public Builder setSsn(\n java.lang.String value) {\n if (value == null) {\n throw new NullPointerException();\n }\n bitField0_ |= 0x00000001;\n ssn_ = value;\n onChanged();\n return this;\n }", "public static BswabeMsk unserializeBswabeMsk(BswabePub pub, byte[] b) {\n\t\tint offset = 0;\n\t\tBswabeMsk msk = new BswabeMsk();\n\t\n\t\tmsk.beta = pub.p.getZr().newElement();\n\t\tmsk.g_alpha = pub.p.getG2().newElement();\n\t\tmsk.b_new = pub.p.getZr().newElement();\n\t\tmsk.s_new = pub.p.getZr().newElement();\n\t\tmsk.alpha = pub.p.getGT().newElement();\n\n\t\toffset = unserializeElement(b, offset, msk.beta);\n\t\toffset = unserializeElement(b, offset, msk.g_alpha);\n\n\t\toffset = unserializeElement(b, offset, msk.b_new);\n\t\toffset = unserializeElement(b, offset, msk.s_new);\n\t\toffset = unserializeElement(b, offset, msk.alpha);\n\t\treturn msk;\n\t}", "private DAPMessage constructFrom(DatabaseTableRecord record) {\n return DAPMessage.fromXML(record.getStringValue(CommunicationNetworkServiceDatabaseConstants.DAP_MESSAGE_DATA_COLUMN_NAME));\n }", "@DSSafe(DSCat.SAFE_OTHERS)\n @DSGenerator(tool_name = \"Doppelganger\", tool_version = \"2.0\", generated_on = \"2013-12-30 13:00:53.096 -0500\", hash_original_method = \"AD601F3532730C1588B10C0B2F4700C0\", hash_generated_method = \"7CF3579665197E3D9616E88D35150E2D\")\n \npublic ASN1BitString() {\n super(TAG_BITSTRING);\n }", "private static EventData constructMessage(long sequenceNumber) {\n final HashMap<Symbol, Object> properties = new HashMap<>();\n properties.put(getSymbol(SEQUENCE_NUMBER_ANNOTATION_NAME.getValue()), sequenceNumber);\n properties.put(getSymbol(OFFSET_ANNOTATION_NAME.getValue()), String.valueOf(OFFSET));\n properties.put(getSymbol(PARTITION_KEY_ANNOTATION_NAME.getValue()), PARTITION_KEY);\n properties.put(getSymbol(ENQUEUED_TIME_UTC_ANNOTATION_NAME.getValue()), Date.from(ENQUEUED_TIME));\n\n final byte[] contents = \"boo\".getBytes(UTF_8);\n final Message message = Proton.message();\n message.setMessageAnnotations(new MessageAnnotations(properties));\n message.setBody(new Data(new Binary(contents)));\n\n return MESSAGE_SERIALIZER.deserialize(message, EventData.class);\n }", "public static BswabeMsk unserializeBswabeMsk(BswabePub pub, byte[] b) {\n ByteArrayInputStream stream = new ByteArrayInputStream(b);\n\n try {\n Pairing pairing = pub.p;\n Element beta = unserializeElement(stream, pairing.getZr());\n Element g_alpha = unserializeElement(stream, pub.p.getG2());\n\n BswabeMsk msk = new BswabeMsk();\n msk.beta = beta;\n msk.g_alpha = g_alpha;\n return msk;\n } catch (IOException e) {\n return null;\n }\n }", "public com.google.protobuf.ByteString\n getSsnBytes() {\n java.lang.Object ref = ssn_;\n if (ref instanceof String) {\n com.google.protobuf.ByteString b = \n com.google.protobuf.ByteString.copyFromUtf8(\n (java.lang.String) ref);\n ssn_ = b;\n return b;\n } else {\n return (com.google.protobuf.ByteString) ref;\n }\n }", "public static nSATType fromPerAligned(byte[] encodedBytes) {\n nSATType result = new nSATType();\n result.decodePerAligned(new BitStreamReader(encodedBytes));\n return result;\n }", "public static nSATType fromPerUnaligned(byte[] encodedBytes) {\n nSATType result = new nSATType();\n result.decodePerUnaligned(new BitStreamReader(encodedBytes));\n return result;\n }", "com.google.protobuf.ByteString\n getSsnBytes();", "public Builder setFromNickBytes(\n com.google.protobuf.ByteString value) {\n if (value == null) {\n throw new NullPointerException();\n }\n checkByteStringIsUtf8(value);\n\n fromNick_ = value;\n onChanged();\n return this;\n }", "PToP.S2BRelay getS2BRelay();", "public com.google.protobuf.ByteString\n getSsnBytes() {\n java.lang.Object ref = ssn_;\n if (ref instanceof java.lang.String) {\n com.google.protobuf.ByteString b = \n com.google.protobuf.ByteString.copyFromUtf8(\n (java.lang.String) ref);\n ssn_ = b;\n return b;\n } else {\n return (com.google.protobuf.ByteString) ref;\n }\n }", "public SmartBin() {\n items = new ItemType[7];\n curWeight = 0;\n curArrayIndex = 0;\n binNumber = \"SM\" + generateBinNumber();\n }", "BSQLMachine createBSQLMachine();", "BElementStructure createBElementStructure();", "public static int[][][] packWU(int n, int[] from, int[] to, int[] w) {\n int[][][] g = new int[n][][];\n int[] p = new int[n];\n for (int f : from) {\n p[f]++;\n }\n for (int t : to) {\n p[t]++;\n }\n for (int i = 0; i < n; i++) {\n g[i] = new int[p[i]][2];\n }\n for (int i = 0; i < from.length; i++) {\n --p[from[i]];\n g[from[i]][p[from[i]]][0] = to[i];\n g[from[i]][p[from[i]]][1] = w[i];\n --p[to[i]];\n g[to[i]][p[to[i]]][0] = from[i];\n g[to[i]][p[to[i]]][1] = w[i];\n }\n return g;\n }", "protected void createSMSThread(int _nb, String _telNumber,\r\n boolean isAdressInAB) {\r\n\r\n String telNumber;\r\n telNumber = _telNumber;\r\n\r\n int randomUserId;\r\n\r\n for (int i = 0; i < _nb; i++) {\r\n\r\n // Randomly select a contact\r\n if (_telNumber == null && isAdressInAB) {\r\n randomUserId = mGenerator\r\n .nextInt(Config.MAX_PHONE_NUMBER_IN_AB);\r\n telNumber = Test.mABNumbers.get(randomUserId);\r\n }\r\n\r\n // Create new contact\r\n if (_telNumber == null && !isAdressInAB)\r\n telNumber = Utils.randomNumber();\r\n\r\n if (i % 2 == 0)\r\n add(MySMS.SMS_INBOX_FOLDER, telNumber);\r\n else\r\n add(MySMS.SMS_SENT_FOLDER, telNumber);\r\n }\r\n }", "public Builder stmc(String stmc) {\n obj.setStmc(stmc);\n return this;\n }", "public Nfa makeNfa() {\r\n\t\t\r\n\t\tint startNum = getNextStateNum();\r\n\t\tNfaState accept = new NfaState(null,null,NfaState.ACCEPT,getNextStateNum());\r\n\t\tNfaState start = new NfaState(accept,null,symbol,startNum);\r\n\t\treturn new Nfa(start,accept,2);\r\n\t}", "public static BacSi createEntity() {\n BacSi bacSi = new BacSi()\n .mabacsi(DEFAULT_MABACSI)\n .hoten(DEFAULT_HOTEN)\n .gioitinh(DEFAULT_GIOITINH)\n .ngaysinh(DEFAULT_NGAYSINH)\n .noilamviec(DEFAULT_NOILAMVIEC)\n .chuyenkhoa(DEFAULT_CHUYENKHOA)\n .giayphephanhnghe(DEFAULT_GIAYPHEPHANHNGHE);\n return bacSi;\n }", "static public EzMessage CreateMessageObject(byte[] packBytes) {\n\t\tif(packBytes == null)\n\t\t\treturn null;\n\t\tCodedInputStream input = CodedInputStream.newInstance(packBytes);\n\t\ttry{\n\t\t\tint nid = input.readInt32();\n\t\t\tEzMessage msg = CreateMessageObject(nid);\n\t\t\tif(msg!=null)\n\t\t\t{\n\t\t\t\tif(msg.deSerializeFromPB(input))\n\t\t\t\t\treturn msg;\n\t\t\t\telse\n\t\t\t\t\treturn null;\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tmsg = CreateMessageObject(\"msg.unknown\");\n\t\t\t\tif(msg != null)\n\t\t\t\t{\n\t\t\t\t\tmsg.getKVData(\"value\").setValue(packBytes);\n\t\t\t\t\treturn msg;\n\t\t\t\t}\n\t\t\t\telse return null;\n\t\t\t}\n\t\t}\n\t\tcatch (Exception e)\n\t {\n\t e.printStackTrace(); \n\t return null;\n\t }\n\t}", "int pack(int b2, int s1, int b0)\n {\n return (b2 << 24) | (s1 << 8) | b0;\n }", "public com.weizhu.proto.LoginProtos.SmsCode.Builder getSmsCodeBuilder(\n int index) {\n return getSmsCodeFieldBuilder().getBuilder(index);\n }", "public com.vodafone.global.er.decoupling.binding.request.ValidateMsisdnRequestType createValidateMsisdnRequestType()\n throws javax.xml.bind.JAXBException\n {\n return new com.vodafone.global.er.decoupling.binding.request.impl.ValidateMsisdnRequestTypeImpl();\n }", "private void constructBSTPTree(Node<T> u, int n) {\n\t\tn++;\n\t\taddToPT(n, u.x);\n\t\tSystem.out.printf(\"%d: %s \", n, u.x);\n\t\tif (u.left != nil)\n\t\t\tconstructBSTPTree(u.left, n);\n\t\tif (u.right != nil)\n\t\t\tconstructBSTPTree(u.right, n);\n\t}", "public PetriNet createSimpleInhibitorPetriNet(int tokenWeight) throws PetriNetComponentException {\n return APetriNet.with(AToken.called(\"Default\").withColor(Color.BLACK)).and(APlace.withId(\"P1\")).and(\n APlace.withId(\"P2\")).and(AnImmediateTransition.withId(\"T1\")).and(\n AnInhibitorArc.withSource(\"P1\").andTarget(\"T1\")).andFinally(\n ANormalArc.withSource(\"T1\").andTarget(\"P2\").with(Integer.toString(tokenWeight), \"Default\").tokens());\n }", "private byte[] createApplicationNonce(final int aszmic,\n @NonNull final byte[] sequenceNumber,\n final int src,\n final int dst,\n @NonNull final byte[] ivIndex) {\n final ByteBuffer applicationNonceBuffer = ByteBuffer.allocate(13);\n applicationNonceBuffer.put((byte) NONCE_TYPE_APPLICATION); //Nonce type\n applicationNonceBuffer.put((byte) ((aszmic << 7) | PAD_APPLICATION_DEVICE_NONCE)); //ASZMIC (SZMIC if a segmented access message) and PAD\n applicationNonceBuffer.put(sequenceNumber);\n applicationNonceBuffer.putShort((short) src);\n applicationNonceBuffer.putShort((short) dst);\n applicationNonceBuffer.put(ivIndex);\n return applicationNonceBuffer.array();\n }", "public NatGateway(NatGateway source) {\n if (source.NatGatewayId != null) {\n this.NatGatewayId = new String(source.NatGatewayId);\n }\n if (source.NatGatewayName != null) {\n this.NatGatewayName = new String(source.NatGatewayName);\n }\n if (source.CreatedTime != null) {\n this.CreatedTime = new String(source.CreatedTime);\n }\n if (source.State != null) {\n this.State = new String(source.State);\n }\n if (source.InternetMaxBandwidthOut != null) {\n this.InternetMaxBandwidthOut = new Long(source.InternetMaxBandwidthOut);\n }\n if (source.MaxConcurrentConnection != null) {\n this.MaxConcurrentConnection = new Long(source.MaxConcurrentConnection);\n }\n if (source.PublicIpAddressSet != null) {\n this.PublicIpAddressSet = new NatGatewayAddress[source.PublicIpAddressSet.length];\n for (int i = 0; i < source.PublicIpAddressSet.length; i++) {\n this.PublicIpAddressSet[i] = new NatGatewayAddress(source.PublicIpAddressSet[i]);\n }\n }\n if (source.NetworkState != null) {\n this.NetworkState = new String(source.NetworkState);\n }\n if (source.DestinationIpPortTranslationNatRuleSet != null) {\n this.DestinationIpPortTranslationNatRuleSet = new DestinationIpPortTranslationNatRule[source.DestinationIpPortTranslationNatRuleSet.length];\n for (int i = 0; i < source.DestinationIpPortTranslationNatRuleSet.length; i++) {\n this.DestinationIpPortTranslationNatRuleSet[i] = new DestinationIpPortTranslationNatRule(source.DestinationIpPortTranslationNatRuleSet[i]);\n }\n }\n if (source.VpcId != null) {\n this.VpcId = new String(source.VpcId);\n }\n if (source.Zone != null) {\n this.Zone = new String(source.Zone);\n }\n if (source.DirectConnectGatewayIds != null) {\n this.DirectConnectGatewayIds = new String[source.DirectConnectGatewayIds.length];\n for (int i = 0; i < source.DirectConnectGatewayIds.length; i++) {\n this.DirectConnectGatewayIds[i] = new String(source.DirectConnectGatewayIds[i]);\n }\n }\n if (source.SubnetId != null) {\n this.SubnetId = new String(source.SubnetId);\n }\n if (source.TagSet != null) {\n this.TagSet = new Tag[source.TagSet.length];\n for (int i = 0; i < source.TagSet.length; i++) {\n this.TagSet[i] = new Tag(source.TagSet[i]);\n }\n }\n if (source.SecurityGroupSet != null) {\n this.SecurityGroupSet = new String[source.SecurityGroupSet.length];\n for (int i = 0; i < source.SecurityGroupSet.length; i++) {\n this.SecurityGroupSet[i] = new String(source.SecurityGroupSet[i]);\n }\n }\n if (source.SourceIpTranslationNatRuleSet != null) {\n this.SourceIpTranslationNatRuleSet = new SourceIpTranslationNatRule[source.SourceIpTranslationNatRuleSet.length];\n for (int i = 0; i < source.SourceIpTranslationNatRuleSet.length; i++) {\n this.SourceIpTranslationNatRuleSet[i] = new SourceIpTranslationNatRule(source.SourceIpTranslationNatRuleSet[i]);\n }\n }\n if (source.IsExclusive != null) {\n this.IsExclusive = new Boolean(source.IsExclusive);\n }\n if (source.ExclusiveGatewayBandwidth != null) {\n this.ExclusiveGatewayBandwidth = new Long(source.ExclusiveGatewayBandwidth);\n }\n if (source.RestrictState != null) {\n this.RestrictState = new String(source.RestrictState);\n }\n if (source.NatProductVersion != null) {\n this.NatProductVersion = new Long(source.NatProductVersion);\n }\n }", "public com.vodafone.global.er.decoupling.binding.request.ValidateMsisdnRequest createValidateMsisdnRequest()\n throws javax.xml.bind.JAXBException\n {\n return new com.vodafone.global.er.decoupling.binding.request.impl.ValidateMsisdnRequestImpl();\n }", "public static BlockRecord toXML(String input, int pnum) {\n \t\n String toReturn = \"\";\n int UnverifiedBlockPort;\n int BlockChainPort;\n UnverifiedBlockPort = 4710 + pnum;\n BlockChainPort = 4820 + pnum;\n\n System.out.println(\"Process number: \" + pnum + \" Ports: \" + UnverifiedBlockPort + \" \" +\n BlockChainPort + \"\\n\");\n\n try {\n String[] tokens = new String[10];\n String stringXML;\n String InputLineStr;\n String suuid;\n UUID idA;\n BlockRecord[] blockArray = new BlockRecord[20];\n JAXBContext jaxbContext = JAXBContext.newInstance(BlockRecord.class);\n Marshaller jaxbMarshaller = jaxbContext.createMarshaller();\n StringWriter sw = new StringWriter();\n jaxbMarshaller.setProperty(Marshaller.JAXB_FORMATTED_OUTPUT, true);\n\n int n = 0;\n blockArray[n] = new BlockRecord();\n blockArray[n].setASHA256String(\"SHA string goes here...\");\n blockArray[n].setASignedSHA256(\"Signed SHA string goes here...\");\n\n idA = UUID.randomUUID();\n suuid = new String(UUID.randomUUID().toString());\n blockArray[n].setABlockID(suuid);\n blockArray[n].setACreatingProcess(\"Process\" + Integer.toString(pnum));\n blockArray[n].setAVerificationProcessID(\"To be set later...\");\n tokens = input.split(\" +\"); \n \n //build the block\n blockArray[n].setTimestamp(tokens[iTIME]);\n blockArray[n].setFSSNum(tokens[iSSNUM]);\n blockArray[n].setFFname(tokens[iFNAME]);\n blockArray[n].setFLname(tokens[iLNAME]);\n blockArray[n].setFDOB(tokens[iDOB]);\n blockArray[n].setGDiag(tokens[iDIAG]);\n blockArray[n].setGTreat(tokens[iTREAT]);\n blockArray[n].setGRx(tokens[iRX]);\n \n stringXML = sw.toString();\n for (int i = 0; i < n; i++) {\n jaxbMarshaller.marshal(blockArray[i], sw);\n }\n String fullBlock = sw.toString();\n String XMLHeader = \"<?xml version=\\\"1.0\\\" encoding=\\\"UTF-8\\\" standalone=\\\"yes\\\"?>\";\n String cleanBlock = fullBlock.replace(XMLHeader, \"\");\n String XMLBlock = XMLHeader + \"\\n<BlockLedger>\" + cleanBlock + \"</BlockLedger>\";\n System.out.println(XMLBlock);\n return blockArray[n];\n\n } catch (Exception e) {\n e.printStackTrace();\n }\n \n return null;\n\n }", "SnacCommand genSnacCommand(SnacPacket packet);", "BElement createBElement();", "public Builder setN(com.google.protobuf.ByteString value) {\n if (value == null) {\n throw new NullPointerException();\n }\n bitField0_ |= 0x00000001;\n n_ = value;\n onChanged();\n return this;\n }", "public static byte[] serializeBswabeMsk(BswabeMsk msk) {\n ByteArrayOutputStream stream = new ByteArrayOutputStream();\n\n try {\n serializeElement(stream, msk.beta);\n serializeElement(stream, msk.g_alpha);\n\n return stream.toByteArray();\n } catch (IOException e) {\n return null;\n }\n }", "protected SJMessageCommunicationType createType(SJTypeSystem ts, Type messageType) throws SemanticException {\n return ts.SJSendType(target, messageType);\r\n }", "public Message build() {\n Objects.requireNonNull(transactionIdBytes);\n\n byte[] messageBytes = new byte[MESSAGE_LEN_HEADER + length];\n\n byte[] messageTypeBytes = createMessageType();\n System.arraycopy(messageTypeBytes, 0, messageBytes, MESSAGE_POS_TYPE, MESSAGE_LEN_TYPE);\n\n byte[] lengthBytes = Bytes.intToBytes(length);\n System.arraycopy(lengthBytes, 2, messageBytes, MESSAGE_POS_LENGTH, MESSAGE_LEN_LENGTH);\n\n byte[] magicCookieBytes = Bytes.intToBytes(MAGIC_COOKIE_FIXED_VALUE);\n System.arraycopy(\n magicCookieBytes, 0, messageBytes, MESSAGE_POS_MAGIC_COOKIE, MESSAGE_LEN_MAGIC_COOKIE);\n\n System.arraycopy(\n transactionIdBytes, 0, messageBytes, MESSAGE_POS_TRANSACTION_ID,\n MESSAGE_LEN_TRANSACTION_ID);\n transactionIdBytes = null;\n\n if (attributeBytes != null && attributeBytes.length > 0) {\n System.arraycopy(\n attributeBytes, 0, messageBytes, MESSAGE_LEN_HEADER, attributeBytes.length);\n attributeBytes = null;\n }\n\n return new Message(messageBytes);\n }", "public static BnetDistributedKB create(final BnetDistributedCF cf) {\n\t\treturn new BnetDistributedKB() {\n\n\t\t\t\n\t\t\t/**\n\t\t\t * Serial version UID for serializable class. \n\t\t\t */\n\t\t\tprivate static final long serialVersionUID = 1L;\n\n\t\t\t\n\t\t\t@Override\n\t\t\tpublic String getName() {\n\t\t\t\t// TODO Auto-generated method stub\n\t\t\t\treturn cf.getName();\n\t\t\t}\n\t\t\t\n\t\t};\n\t}", "BType createBType();", "public MAVLinkPacket pack(){\n MAVLinkPacket packet = new MAVLinkPacket(MAVLINK_MSG_LENGTH);\n packet.sysid = 255;\n packet.compid = 190;\n packet.msgid = MAVLINK_MSG_ID_GIMBAL_DEVICE_INFORMATION;\n \n packet.payload.putUnsignedInt(time_boot_ms);\n \n packet.payload.putUnsignedInt(firmware_version);\n \n packet.payload.putFloat(tilt_max);\n \n packet.payload.putFloat(tilt_min);\n \n packet.payload.putFloat(tilt_rate_max);\n \n packet.payload.putFloat(pan_max);\n \n packet.payload.putFloat(pan_min);\n \n packet.payload.putFloat(pan_rate_max);\n \n packet.payload.putUnsignedShort(cap_flags);\n \n \n for (int i = 0; i < vendor_name.length; i++) {\n packet.payload.putUnsignedByte(vendor_name[i]);\n }\n \n \n \n for (int i = 0; i < model_name.length; i++) {\n packet.payload.putUnsignedByte(model_name[i]);\n }\n \n \n return packet;\n }", "public static DummyBuilder fromInstance(Object instance) {\n return new DummyBuilder(instance);\n }", "public static String getSSN() {\n\t\tint part1 = getRandomInt(100, 999);\n\t\tint part2 = getRandomInt(0, 99);\n\t\tint part3 = getRandomInt(0, 9999);\t\t\n\t\tString ssn = paddingNumber(part1, 3) + \"-\" + paddingNumber(part2, 2) + \"-\" + paddingNumber(part3, 4);\n\t\treturn ssn;\n\t}", "public static void constructStartupMessage(final ByteBuf buffer) {\n /*\n * Requests headers - according to https://github.com/apache/cassandra/blob/trunk/doc/native_protocol_v4.spec\n * section #1\n *\n * 0 8 16 24 32 40\n * +---------+---------+---------+---------+---------+\n * | version | flags | stream | opcode |\n * +---------+---------+---------+---------+---------+\n */\n\n buffer.writeByte(0x04); //request\n buffer.writeBytes(new byte[]{0x00}); // flag\n buffer.writeShort(incrementAndGet()); //stream id\n buffer.writeBytes(new byte[]{0x01}); // startup\n\n /*\n * Body size - int - 4bytes.\n * Body of STARTUP message contains MAP of 1 entry, where key and value is [string]\n *\n * Size = (map size) + (key size) + (key string length) + (value size) + (value string length)\n */\n short size = (short) (2 + 2 + CQL_VERSION_KEY.length() + 2 + CQL_VERSION_VALUE.length());\n\n buffer.writeInt(size);\n\n /*\n * Write body itself, lets say that is it Map.of(\"CQL_VERSION\",\"3.0.0\") in CQL version.\n */\n\n //map sie\n buffer.writeShort(1);\n\n //key\n buffer.writeShort(CQL_VERSION_KEY.length());\n buffer.writeBytes(CQL_VERSION_KEY.getBytes());\n\n //value\n buffer.writeShort(CQL_VERSION_VALUE.length());\n buffer.writeBytes(CQL_VERSION_VALUE.getBytes());\n }", "public com.vodafone.global.er.decoupling.binding.request.ModifyMsisdnType createModifyMsisdnType()\n throws javax.xml.bind.JAXBException\n {\n return new com.vodafone.global.er.decoupling.binding.request.impl.ModifyMsisdnTypeImpl();\n }", "ChargingStation createChargingStation();", "public static BlockRecord toXMLForExistingRecord(String input, int pnum) {\n \n int UnverifiedBlockPort;\n int BlockChainPort;\n UnverifiedBlockPort = 4710 + pnum;\n BlockChainPort = 4820 + pnum;\n try {\n String[] tokens = new String[20];\n String stringXML;\n String InputLineStr;\n String suuid;\n UUID idA;\n BlockRecord[] blockArray = new BlockRecord[20];\n\n JAXBContext jaxbContext = JAXBContext.newInstance(BlockRecord.class);\n Marshaller jaxbMarshaller = jaxbContext.createMarshaller();\n StringWriter sw = new StringWriter();\n jaxbMarshaller.setProperty(Marshaller.JAXB_FORMATTED_OUTPUT, true);\n int n = 0;\n \n //building the block\n blockArray[n] = new BlockRecord();\n blockArray[n].setABlockNum(input.substring(input.indexOf(\"<ABlockNum>\") + 11, input.indexOf(\"</ABlockNum>\")));\n blockArray[n].setACreatingProcess(\"Process\" + Integer.toString(pnum));\n blockArray[n].setASHA256String(input.substring(input.indexOf(\"<ASHA256String>\") + 15, input.indexOf(\"</ASHA256String>\")));\n blockArray[n].setASignedSHA256(input.substring(input.indexOf(\"<ASignedSHA256>\") + 15, input.indexOf(\"</ASignedSHA256>\")));\n blockArray[n].setAVerificationProcessID(Integer.toString(pnum));\n blockArray[n].setTimestamp(input.substring(input.indexOf(\"<ATimestamp>\") + 12, input.indexOf(\"</ATimestamp>\")));\n blockArray[n].setFSSNum(input.substring(input.indexOf(\"<FSSNum>\") + 8, input.indexOf(\"</FSSNum>\")));\n blockArray[n].setFFname(input.substring(input.indexOf(\"<FFname>\") + 8, input.indexOf(\"</FFname>\")));\n blockArray[n].setFLname(input.substring(input.indexOf(\"<FLname>\") + 8, input.indexOf(\"</FLname>\")));\n blockArray[n].setFDOB(input.substring(input.indexOf(\"<FDOB>\") + 6, input.indexOf(\"</FDOB>\")));\n blockArray[n].setGDiag(input.substring(input.indexOf(\"<GDiag>\") + 7, input.indexOf(\"</GDiag>\")));\n blockArray[n].setGTreat(input.substring(input.indexOf(\"<GTreat>\") + 8, input.indexOf(\"</GTreat>\")));\n blockArray[n].setGRx(input.substring(input.indexOf(\"<GRx>\") + 5, input.indexOf(\"</GRx>\")));\n \n // Generate a new block ID\n idA = UUID.randomUUID();\n suuid = new String(UUID.randomUUID().toString());\n blockArray[n].setABlockID(suuid);\n stringXML = sw.toString();\n for (int i = 0; i < n; i++) {\n jaxbMarshaller.marshal(blockArray[i], sw);\n }\n String fullBlock = sw.toString();\n String XMLHeader = \"<?xml version=\\\"1.0\\\" encoding=\\\"UTF-8\\\" standalone=\\\"yes\\\"?>\";\n String cleanBlock = fullBlock.replace(XMLHeader, \"\");\n String XMLBlock = XMLHeader + \"\\n<BlockLedger>\" + cleanBlock + \"</BlockLedger>\";\n System.out.println(XMLBlock);\n return blockArray[n];\n\n } catch (Exception e) {\n e.printStackTrace();\n }\n \n return null;\n }", "private Speicher initializeRegisterB(Speicher speicher){\n Bit[] bits = new Bit[8];\n bits[0] = new Bit( 0, 1);\n bits[1] = new Bit( 0, 1);\n bits[2] = new Bit( 0, 1);\n bits[3] = new Bit( 0, 1);\n bits[4] = new Bit( 0, 1);\n bits[5] = new Bit( 0, 1);\n bits[6] = new Bit( 0, 1);\n bits[7] = new Bit( 1, 1);\n speicher.getSpeicheradressen()[0].getRegister()[6].setBits(bits);\n return speicher;\n }", "Wcs111Factory getWcs111Factory();", "public void setMsn(java.lang.String msn) {\r\n this.msn = msn;\r\n }", "@DSSource({DSSourceKind.SENSITIVE_UNCATEGORIZED})\n @DSGenerator(tool_name = \"Doppelganger\", tool_version = \"2.0\", generated_on = \"2013-12-30 13:00:53.099 -0500\", hash_original_method = \"66B1F67B2E4924691687068C01957881\", hash_generated_method = \"09FC42AAA2010F0F571B2693B7BFC711\")\n \npublic static ASN1BitString getInstance() {\n return ASN1;\n }", "static StringBuilder convert_to_binary(String msg) {\n byte[] bytes = msg.getBytes();\r\n StringBuilder binary = new StringBuilder();\r\n for (byte b : bytes) {\r\n int val = b;\r\n for (int i = 0; i < 8; i++) {\r\n binary.append((val & 128) == 0 ? 0 : 1);\r\n val <<= 1;\r\n }\r\n binary.append(\"\");\r\n }\r\n return binary;\r\n }", "protected void bInit()\n {\n \tb_expect_seqnum=1;\n //\tMessage m=new Message(String.valueOf(new char[20]));\n //\tb_sndpkt=make_pkt(0,m,0);//make a package\n }", "private Builder() {\n super(TransferSerialMessage.SCHEMA$);\n }", "XORGateway createXORGateway();", "public static void pack (int []n, String s) {\n\t\tfor (int i = 0; i < n.length; i++) {n[i] = 0; }\n\t\t\n\t\tint idx = n.length-1;\n\t\tfor (int i = s.length()-1; i >= 0; i--) {\n\t\t\tn[idx--] = s.charAt(i) - '0';\n\t\t}\n\t}", "@Override\n\tpublic KBase createKB() {\n\t\treturn BnetDistributedKB.create(this);\n\t}", "private static DatagramPacket craftAck(int sequenceNumber) {\n\n HipsterPacket hipster = new HipsterPacket();\n hipster.setPayload(new byte[0]); // Empty payload\n hipster.setDestinationAddress(sourceAddress); // Source address\n hipster.setDestinationPort(hipsterSendPort); // Source port number\n hipster.setCode(HipsterPacket.ACK);\n hipster.setSequenceNumber(sequenceNumber);\n\n return hipster.toDatagram();\n }", "State.Builder<E, S, A> to(S state);", "private Tx createTransaction(BitCoinResponseDTO btcDTO, SellerBitcoinInfo sbi) {\n\t\t\n\t\tTx tx = new Tx();\n\t\t\n\t\t\n\t\ttx.setDate(new Date());\n\t\ttx.setAmountOfMoney(btcDTO.getPrice_amount());\n\t\ttx.setStatus(TxStatus.PENDING);\n\t\ttx.setRecieverAddress(btcDTO.getPayment_url());\n\t\ttx.setorder_id(btcDTO.getId()); //ovaj id je na coin gate-u i moram ga cuvati u transakciji\n\t\ttx.setTxDescription(\"Porudzbina je kreirana od strane korisnika\");\n\t\ttx.setSbi(sbi);\n\t\t\n\t\t//trebace ovde jos da se setuje id korisnika koji je kreirao porudzbinu kako bi kasnije mogao da getuje sve\n\t\t//njegove transakcije\n\t\t\n\t\t\n\t\treturn tx;\n\t\t\n\t}", "private byte[] createDeviceNonce(final int aszmic,\n @NonNull final byte[] sequenceNumber,\n final int src,\n final int dst,\n @NonNull final byte[] ivIndex) {\n final ByteBuffer deviceNonceBuffer = ByteBuffer.allocate(13);\n deviceNonceBuffer.put((byte) NONCE_TYPE_DEVICE); //Nonce type\n deviceNonceBuffer.put((byte) ((aszmic << 7) | PAD_APPLICATION_DEVICE_NONCE)); //ASZMIC (SZMIC if a segmented access message) and PAD\n deviceNonceBuffer.put(sequenceNumber);\n deviceNonceBuffer.putShort((short) src);\n deviceNonceBuffer.putShort((short) dst);\n deviceNonceBuffer.put(ivIndex);\n return deviceNonceBuffer.array();\n }", "public wsihash create(long wsihashId);", "public byte[] marshall();", "public PCommon_Base.CommonBase.NetTransferMsg.Builder getNetTransferMsgsBuilder(\n int index) {\n return getNetTransferMsgsFieldBuilder().getBuilder(index);\n }", "BitField getMSBs(int digits);", "RS3PacketBuilder buildPacket(T node);", "private BasicNetwork generateBrain(int numTags, int numShelfs) {\n\tSOMPattern pattern = new SOMPattern();\n\tpattern.setInputNeurons(numTags);\n\tpattern.setOutputNeurons(numShelfs);\n\n\treturn pattern.generate();\n }", "public String convertToAssemblyBin(String bin)\n {\n if(bin.equals(\"01101001010000000000000100000000\"))\n {\n return \"MOVEZ X0 data\";\n } else if(bin.equals(\"01111100001000000000000000000001\"))\n {\n return \"LDUR X1, X0, #0\";\n } else if(bin.equals(\"01011010000000000000001000000010\"))\n {\n return \"CBZ X2, #32\";\n } else if(bin.equals(\"00000000101000000000000000001100\"))\n {\n return \"B #12\";\n } else if(bin.equals(\"00000100100010000001010000100010\"))\n {\n return \"ADDI X2, X2, #20\";\n }else if(bin.equals(\"00000110010110000001000000100010\"))\n {\n return \"SUB X2, X1, X2\";\n }else if(bin.equals(\"00000010001000100000000000000010\"))\n {\n return \"PUSH X2\";\n }else if(bin.equals(\"00000000000000000000000000000000\"))\n {\n return \"NOP\";\n }else if(bin.equals(\"00000011001100110000000000000011\"))\n {\n return \"POP X3\";\n }else if(bin.equals(\"01111100000000000000000000000011\"))\n {\n return \"STUR X3, X0, #0\";\n }else if(bin.equals(\"00000110010100000010000000110011\"))\n {\n return \"EOR X3, X2, X3\";\n }else if(bin.equals(\"01011010000000000000000001000011\"))\n {\n return \"CBZ X3, #4\";\n }else if(bin.equals(\"00010001000100010001000100010001\"))\n {\n return \"HALT\";\n } else if(bin.equals(\"00000000101010111010101100000000\") || bin.equals(\"00000000000000001010101100000000\"))\n {\n return \"DATA VALUE: \" + Integer.parseInt(\"ab\", 16);\n } else if(bin.equals(\"00000000000000000000110111101111\"))\n {\n return \"STACK VALUE: \" + Integer.parseInt(\"def\", 16);\n }\n return \"\";\n }", "public static Builder newInstance(int noLocations, boolean isSymmetric) {\n return new Builder(noLocations, isSymmetric);\n }", "public CMN() {\n\t}", "private SM_INIT(byte[] publicRsaKey, byte[] blowfishKey, int sessionId) {\n super(0x00);\n this.sessionId = sessionId;\n this.publicRsaKey = publicRsaKey;\n this.blowfishKey = blowfishKey;\n }", "java.lang.String getBssid();", "private static SysexMessage buildDump(byte function, int channel, byte hdrData[], byte inputData[]) {\r\n SysexMessage msg = new SysexMessage();\r\n byte[] msgData = new byte[hdrData.length + inputData.length + 6]; // 5 for header, 1 for\r\n // last F7\r\n \r\n int i = 0;\r\n msgData[i++] = (byte) 0xF0;\r\n msgData[i++] = (byte) 0x42; // Korg ID\r\n msgData[i++] = (byte) (0x30 | channel); // 0x3n Format ID, n = channel\r\n // number\r\n msgData[i++] = (byte) 0x50; // Triton series ID\r\n msgData[i++] = (byte) function;\r\n // Function header\r\n if (hdrData != null) {\r\n for (int j = 0; j < hdrData.length; ++j) {\r\n msgData[i++] = hdrData[j];\r\n }\r\n }\r\n // Data\r\n if (inputData != null) {\r\n for (int j = 0; j < inputData.length; ++j) {\r\n msgData[i++] = inputData[j];\r\n }\r\n }\r\n msgData[i++] = (byte) 0xF7; // end of exclusive\r\n \r\n try {\r\n msg.setMessage(msgData, msgData.length);\r\n }\r\n catch (InvalidMidiDataException e) {\r\n e.printStackTrace();\r\n return null;\r\n }\r\n return msg;\r\n }", "public ObjXportStusRecord() {\n\t\tsuper(ObjXportStus.OBJ_XPORT_STUS);\n\t}", "public Builder setS1Bytes(\n com.google.protobuf.ByteString value) {\n if (value == null) {\n throw new NullPointerException();\n }\n bitField0_ |= 0x00000001;\n s1_ = value;\n onChanged();\n return this;\n }", "@Override\r\n\tpublic BMW createBMW() {\n\t\treturn new BMW320();\r\n\t}", "public final void insn_format11n() throws RecognitionException {\n CommonTree INSTRUCTION_FORMAT11n107 = null;\n CommonTree REGISTER108 = null;\n short short_integral_literal109 = 0;\n\n try {\n // D:\\\\decomplier_tools\\\\smali\\\\smali\\\\smali\\\\src\\\\main\\\\antlr3\\\\smaliTreeWalker.g:763:3: ( ^( I_STATEMENT_FORMAT11n INSTRUCTION_FORMAT11n REGISTER short_integral_literal ) )\n // D:\\\\decomplier_tools\\\\smali\\\\smali\\\\smali\\\\src\\\\main\\\\antlr3\\\\smaliTreeWalker.g:764:5: ^( I_STATEMENT_FORMAT11n INSTRUCTION_FORMAT11n REGISTER short_integral_literal )\n {\n match(input, I_STATEMENT_FORMAT11n, FOLLOW_I_STATEMENT_FORMAT11n_in_insn_format11n2078);\n match(input, Token.DOWN, null);\n INSTRUCTION_FORMAT11n107 = (CommonTree) match(input, INSTRUCTION_FORMAT11n, FOLLOW_INSTRUCTION_FORMAT11n_in_insn_format11n2080);\n REGISTER108 = (CommonTree) match(input, REGISTER, FOLLOW_REGISTER_in_insn_format11n2082);\n pushFollow(FOLLOW_short_integral_literal_in_insn_format11n2084);\n short_integral_literal109 = short_integral_literal();\n state._fsp--;\n\n match(input, Token.UP, null);\n\n\n Opcode opcode = opcodes.getOpcodeByName((INSTRUCTION_FORMAT11n107 != null ? INSTRUCTION_FORMAT11n107.getText() : null));\n byte regA = parseRegister_nibble((REGISTER108 != null ? REGISTER108.getText() : null));\n\n short litB = short_integral_literal109;\n LiteralTools.checkNibble(litB);\n\n method_stack.peek().methodBuilder.addInstruction(new BuilderInstruction11n(opcode, regA, litB));\n\n }\n\n } catch (RecognitionException re) {\n reportError(re);\n recover(input, re);\n } finally {\n // do for sure before leaving\n }\n }", "private byte[] intToBits(int number, int n) {\n\t\tbyte[] bits = new byte[n];\n\t\t\n\t\tString bitString = Integer.toBinaryString(number);\n\t\twhile (bitString.length() < n) {\n\t\t\tbitString = \"0\" + bitString;\n\t\t}\n\t\t\n\t\tfor(int i = 0, maxLen = bits.length; i < maxLen; i++) {\n\t\t\tbits[i] = (byte) (bitString.charAt(i) == 1 ? 1 : 0);\n\t\t}\n\t\t\n\t\treturn bits;\n\t}", "public Builder setField1153Bytes(\n com.google.protobuf.ByteString value) {\n if (value == null) {\n throw new NullPointerException();\n }\n checkByteStringIsUtf8(value);\n \n field1153_ = value;\n onChanged();\n return this;\n }", "public interface SnacCmdFactory {\n /**\n * Returns a list of the SNAC command types this factory can possibly\n * convert to <code>SnacCommand</code>s. Note that it is not required to\n * be able to convert every SNAC packet that matches the types returned by\n * this method; rather, this just provides a means of filtering out types\n * that can definitely not be handled (by not including them in the returned\n * list).\n * <br>\n * <br>\n * Also note that <b>the command types contained in the list returned must\n * be consistent between calls to this method</b>; that is, an\n * implementation cannot change the supported command type list after this\n * factory has been created.\n *\n * @return a list of command types that can be passed to\n * <code>genSnacCommand</code>\n */\n List<CmdType> getSupportedTypes();\n\n /**\n * Attempts to convert the given SNAC packet to a <code>SnacCommand</code>.\n * This can return <code>null</code> if no appropriate\n * <code>SnacCommand</code> can be created (for example, if the packet is in\n * an invalid format).\n *\n * @param packet the packet to use for generation of a\n * <code>SnacCommand</code>\n * @return an appropriate <code>SnacCommand</code> for representing the\n * given <code>SnacPacket</code>, or <code>null</code> if no such\n * object can be created\n */\n SnacCommand genSnacCommand(SnacPacket packet);\n}", "private FullExtTcpPacket createPacket(\n long dataSizeByte,\n long sequenceNumber,\n long ackNumber,\n boolean ACK,\n boolean SYN,\n boolean ECE\n ) {\n return new FullExtTcpPacket(\n flowId, dataSizeByte, sourceId, destinationId,\n 100, 80, 80, // TTL, source port, destination port\n sequenceNumber, ackNumber, // Seq number, Ack number\n false, false, ECE, // NS, CWR, ECE\n false, ACK, false, // URG, ACK, PSH\n false, SYN, false, // RST, SYN, FIN\n congestionWindow, 0 // Window size, Priority\n );\n }", "public StShhnKnyMs newEntity() { return new StShhnKnyMs(); }", "public Packet createPacket() {\n\t\treturn new Packet((ByteBuffer) buffer.flip());\n\t}", "ComplicationOverlayWireFormat() {}", "public static byte[] serializeBswabeMsk(BswabeMsk msk) {\n\t\tArrayList<Byte> arrlist = new ArrayList<Byte>();\n\t\n\t\tserializeElement(arrlist, msk.beta);\n\t\tserializeElement(arrlist, msk.g_alpha);\n\n\t\tserializeElement(arrlist, msk.b_new);\n\t\tserializeElement(arrlist, msk.s_new);\n\t\tserializeElement(arrlist, msk.alpha);\n\n\t\treturn Byte_arr2byte_arr(arrlist);\n\t}", "public static List<SSBNNode> translateSimpleSSBNNodeListToSSBNNodeList( \r\n\t\t\tList<SimpleSSBNNode> simpleSSBNNodeList, \r\n\t\t\tProbabilisticNetwork pn) throws \r\n\t\t\t SSBNNodeGeneralException, \r\n\t\t\t ImplementationRestrictionException{\r\n\t\t\r\n\t\tList<SSBNNode> listSSBNNodes = new ArrayList<SSBNNode>(); \r\n\t\tcorrespondencyMap = new HashMap<SimpleSSBNNode, SSBNNode>(); \r\n\t\t\r\n\t\tMap<ContextNode, ContextFatherSSBNNode> mapContextNode = \r\n\t\t\t new HashMap<ContextNode, ContextFatherSSBNNode>(); \r\n\t\t\r\n\t\t//1 Create all nodes with its states \r\n\t\t\r\n\t\tfor(SimpleSSBNNode simple: simpleSSBNNodeList){\r\n\t\t\t\r\n\t\t\tSSBNNode ssbnNode = SSBNNode.getInstance(pn, simple.getResidentNode()); \r\n\t\t\tcorrespondencyMap.put(simple, ssbnNode);\r\n\t\t\tlistSSBNNodes.add(ssbnNode); \r\n\t\t\t\r\n\t\t\t//Arguments. \r\n\t\t\tfor(int i = 0; i < simple.getOvArray().length; i++){\r\n\t\t\t\tOVInstance ovInstance = OVInstance.getInstance(\r\n\t\t\t\t\t\tsimple.getOvArray()[i],\tsimple.getEntityArray()[i]); \r\n\t\t\t\tssbnNode.addArgument(ovInstance);\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\t//Finding. \r\n\t\t\tif(simple.isFinding()){\r\n\t\t\t\tssbnNode.setValue(simple.getState()); \r\n\t\t\t}\r\n\t\t\t\r\n\t\t\t\r\n\t\t\t//Default distribution\r\n\t\t\tif(simple.isDefaultDistribution()){\r\n\t\t\t\tssbnNode.setUsingDefaultCPT(true); \r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tssbnNode.setPermanent(true); \r\n\t\t\t\r\n\t\t\t//The values of the ordinary variables are different depending in \r\n\t\t\t//which MFrag we are dealing. \r\n\t\t\t\r\n\t\t\t//The key for do the match is the order of the arguments. The order\r\n\t\t\t//should be the same in every MFrags of the node. \r\n\t\t\t\r\n\t\t\t//Lets deal first with Resident MFrag\r\n\r\n\t\t\tOrdinaryVariable[] residentOvArray = \r\n\t\t\t\t\tssbnNode.getResident().getOrdinaryVariableList().toArray(\r\n\t\t\t\t\t\t\tnew OrdinaryVariable[ssbnNode.getResident().getOrdinaryVariableList().size()]\r\n\t\t\t\t\t\t\t); \r\n\t\t\t\r\n\t\t\tList<OVInstance> argumentsForResidentMFrag = new ArrayList<OVInstance>(); \r\n\t\t\tfor(int i = 0; i < residentOvArray.length; i++){\r\n\t\t\t\tOVInstance ovInstance = OVInstance.getInstance(residentOvArray[i], \r\n\t\t\t\t\t\tsimple.getEntityArray()[i]); \r\n\t\t\t\targumentsForResidentMFrag.add(ovInstance); \r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tssbnNode.addArgumentsForMFrag(\r\n\t\t\t\t\tssbnNode.getResident().getMFrag(), \r\n\t\t\t\t\targumentsForResidentMFrag); \r\n\t\t\t\r\n\t\t\t\r\n\t\t\t// Lets map OVs of every input node pointing to current SSBNNode\r\n\t\t\t\r\n\t\t\tfor(InputNode inputNode: simple.getResidentNode().getInputInstanceFromList()){\r\n\t\t\t\t\r\n\t\t\t\tOrdinaryVariable[] ovArray = \r\n\t\t\t\t\tinputNode.getResidentNodePointer().getOrdinaryVariableArray(); \r\n\t\t\t\t\r\n\t\t\t\tList<OVInstance> argumentsForMFrag = new ArrayList<OVInstance>();\r\n\r\n// OLD CODE\t\t\t\t\r\n//\t\t\t\tfor(int i = 0; i < ovArray.length; i++){\r\n//\t\t\t\t\tOVInstance ovInstance = OVInstance.getInstance(ovArray[i], simple.getEntityArray()[i]); \r\n// argumentsForMFrag.add(ovInstance); \t\r\n//\t\t\t\t}\r\n\r\n// NEW CODE \r\n\t\t\t\tif( ! (simple.getOvArrayForMFrag(inputNode.getMFrag()) == null )){\r\n\t\t\t\t\tfor(int i = 0; i < ovArray.length; i++){\r\n\t\t\t\t\t\tOrdinaryVariable ov = simple.getOvArrayForMFrag(inputNode.getMFrag())[i]; \r\n\t\t\t\t\t\tOVInstance ovInstance = OVInstance.getInstance(ov,simple.getEntityArray()[i]); \t\t\t\t\t\r\n\t\t\t\t\t\targumentsForMFrag.add(ovInstance); \r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t}else{\r\n//TODO This is an old bug... when we don't have an input instance of the node, we won't have a MFrag Instance \r\n// for it... what makes the throws one exception. \r\n\t\t\t\t\tfor(int i = 0; i < ovArray.length; i++){\r\n\t\t\t\t\t\tOVInstance ovInstance = OVInstance.getInstance(ovArray[i], simple.getEntityArray()[i]);\r\n\t\t\t\t\t\targumentsForMFrag.add(ovInstance); \t\t\t\t\t\r\n\t\t\t\t\t}\t\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\tssbnNode.addArgumentsForMFrag(\r\n\t\t\t\t\t\tinputNode.getMFrag(), \r\n\t\t\t\t\t\targumentsForMFrag); \r\n\t\t\t}\r\n\t\t\t\r\n\t\t\t//Treat the context node father\r\n\t\t\tList<SimpleContextNodeFatherSSBNNode> simpleContextNodeList = \r\n\t\t\t\tsimple.getContextParents(); \r\n\t\t\t\r\n\t\t\tif(simpleContextNodeList.size() > 0){\r\n\t\t\t\tif(simpleContextNodeList.size() > 1){\r\n\t\t\t\t\tthrow new ImplementationRestrictionException(\r\n\t\t\t\t\t\t\tImplementationRestrictionException.MORE_THAN_ONE_CTXT_NODE_SEARCH); \r\n\t\t\t\t}else{\r\n\t\t\t\t\t//We have only one context node father\r\n\t\t\t\t\tContextNode contextNode = simpleContextNodeList.get(0).getContextNode(); \r\n\t\t\t\t\tContextFatherSSBNNode contextFather = mapContextNode.get(contextNode); \r\n\t\t\t\t\tif(contextFather == null){\r\n\t\t\t\t\t\tcontextFather = new ContextFatherSSBNNode(pn, contextNode, new ProbabilisticNode(), \r\n\t\t\t\t\t\t\t\tsimpleContextNodeList.get(0).getOvProblematic(), simple.getMFragInstance().getOVInstanceList());\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\tList<ILiteralEntityInstance> possibleValueList = \r\n\t\t\t\t\t\t\t\tnew ArrayList<ILiteralEntityInstance>(); \r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\tfor(String entity: simpleContextNodeList.get(0).getPossibleValues()){\r\n\t\t\t\t\t\t\tpossibleValueList.add(LiteralEntityInstance.getInstance(\r\n\t\t\t\t\t\t\t\t\tentity, \r\n\t\t\t\t\t\t\t\t\tsimpleContextNodeList.get(0).getOvProblematic().getValueType())); \r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\tfor(ILiteralEntityInstance lei: possibleValueList){\r\n\t\t\t\t\t\t\tcontextFather.addPossibleValue(lei);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\r\n//\t\t\t\t\t\tcontextFather.setOvProblematic(simpleContextNodeList.get(0).getOvProblematic());\r\n\t\t\t\t\t\tmapContextNode.put(contextNode, contextFather); \r\n\t\t\t\t\t}\r\n\t\t\t\t\t\r\n\t\t\t\t\ttry {\r\n\t\t\t\t\t\tssbnNode.setContextFatherSSBNNode(contextFather);\r\n\t\t\t\t\t} catch (InvalidParentException e) {\r\n\t\t\t\t\t\t//This exception don't occur in this case... \r\n\t\t\t\t\t\te.printStackTrace();\r\n\t\t\t\t\t\tthrow new RuntimeException(e.getMessage()); \r\n\t\t\t\t\t} \r\n\t\t\t\t\t\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t}\r\n\t\t\tif (simple.isNodeInAVirualChain()) {\r\n\t\t\t\t// change the name of chain nodes\r\n\t\t\t\tssbnNode.getProbNode().setName(\"Chain\"+ simple.getStepsForChainNodeToReachMainNode() + \"_\" + ssbnNode.getProbNode().getName());\r\n\t\t\t\tDebug.println(ssbnNode.getProbNode().getName());\r\n\t\t\t}\r\n\t\t\tsimple.setProbNode(ssbnNode.getProbNode());\r\n\t\t}\r\n\t\t\r\n\t\t//Create the parent structure \r\n\t\t\r\n\t\tfor(SimpleSSBNNode simple: simpleSSBNNodeList){\r\n\t\t\t\r\n//\t\t\tif(simple.getParents().size()==0){\r\n//\t\t\t\tif(simple.getChildNodes().size()==0){\r\n//\t\t\t\t\tcontinue; //This node is out of the network. \r\n//\t\t\t\t}\r\n//\t\t\t}\r\n\t\t\t\r\n\t\t\tSSBNNode ssbnNode = correspondencyMap.get(simple); \r\n\t\t\t\r\n\t\t\tfor(SimpleSSBNNode parent: simple.getParents()){\r\n\t\t\t\tSSBNNode parentSSBNNode = correspondencyMap.get(parent); \r\n\t\t\t\tssbnNode.addParent(parentSSBNNode, false); \r\n\t\t\t}\r\n\t\t\t\r\n\t\t}\r\n\t\t\r\n\t\treturn listSSBNNodes; \r\n\t}", "@Override\n\tprotected XmlStation createCwbData(List<DbStation> stns) throws DatatypeConfigurationException {\n\t\tXmlStation cwbData = factory.createCwbdata();\n\t\tcwbData.setIdentifier(UUID.randomUUID().toString());\n\t\tcwbData.setDatasetID(dataSetId);\n\t\tcwbData.setDatasetName(DATASET_NAME);\n\t\tcwbData.setDataItemID(dataItemId);\n\t\tcwbData.setDataItemName(DATAITEM_NAME);\n\t\tcwbData.setSender(attr.SENDER);\n\t\tcwbData.setSent(Utility.getXmlDateTime(LocalDateTime.now()));\n\t\tcwbData.setStatus(attr.STATUS_ACTUAL);\n\t\tcwbData.setScope(attr.SCOPE_PUBLIC);\n\t\tcwbData.setMsgType(attr.MSG_TYPE_ISSUE);\n\t\tcwbData.setPublisherOID(attr.PUBLISHER_OID);\n\t\tcwbData.setNote(NOTE);\n\t\t\n\t\tXmlStation.Resources resources = factory.createCwbdataResources();\n\t\tXmlStation.Resources.Resource resource = factory.createCwbdataResourcesResource();\n\t\tXmlStation.Resources.Resource.Metadata metadata = factory.createCwbdataResourcesResourceMetadata();\n\t\tresource.setMetadata(createMetadata(metadata));\n\t\t\n\t\tData data = factory.createCwbdataResourcesResourceData();\n\t\tStationsStatus stnStatus = factory.createCwbdataResourcesResourceDataStationsStatus();\n\t\tstnStatus.getStation().addAll(createStns(stns));\n\t\tdata.setStationsStatus(stnStatus);\n\t\tresource.setData(data);\n\t\tresources.setResource(resource);\n\t\tcwbData.setResources(resources);\n\t\treturn cwbData;\n\t}", "@Override // jcifs.smb.SmbComTransactionResponse\n public int writeSetupWireFormat(byte[] dst, int dstIndex) {\n return 0;\n }", "public com.vodafone.global.er.decoupling.binding.request.ModifyMsisdn createModifyMsisdn()\n throws javax.xml.bind.JAXBException\n {\n return new com.vodafone.global.er.decoupling.binding.request.impl.ModifyMsisdnImpl();\n }", "public DevicesStAXBuilder() {\n super();\n inputFactory = XMLInputFactory.newInstance();\n }", "private Records_type createNSD(String diag_code, String additional)\n {\n Records_type retval = new Records_type();\n retval.which = Records_type.nonsurrogatediagnostic_CID;\n DefaultDiagFormat_type default_diag = new DefaultDiagFormat_type();\n retval.o = default_diag;\n \n default_diag.diagnosticSetId = reg.oidByName(\"diag-1\");\n \n if ( diag_code != null )\n default_diag.condition = BigInteger.valueOf( Long.parseLong(diag_code) );\n else\n default_diag.condition = BigInteger.valueOf(0);\n \n default_diag.addinfo = new addinfo_inline14_type();\n default_diag.addinfo.which = addinfo_inline14_type.v2addinfo_CID;\n default_diag.addinfo.o = (Object)(additional);\n \n return retval;\n }", "public Builder setField1112Bytes(\n com.google.protobuf.ByteString value) {\n if (value == null) {\n throw new NullPointerException();\n }\n checkByteStringIsUtf8(value);\n \n field1112_ = value;\n onChanged();\n return this;\n }", "public NwMpCstr7and8(int scID, int fSeq, BaseVertex nfvNode){\n\t\tthis.scID = scID;\n\t\tthis.fSeq = fSeq;\n\t\tthis.nfviNode = nfvNode;\n\t}", "public NPCI(Address source) {\n version = 1;\n control = BigInteger.valueOf(0);\n\n control = control.setBit(5);\n destinationNetwork = 0xFFFF;\n hopCount = 0xFF;\n\n setSourceAddress(source);\n }", "@Test\n public void testDecodeEncodePublicKeyWithPssParameters() {\n String encodedPubKey =\n \"30820151303c06092a864886f70d01010a302fa00f300d060960864801650304\"\n + \"02010500a11c301a06092a864886f70d010108300d0609608648016503040201\"\n + \"05000382010f003082010a0282010100b09191ef91e8b4ab58f7c66430636641\"\n + \"0988d8cba6f2e0f33495d37b355828d04554472e854dff7d8c1dfd1ea50123de\"\n + \"12d34b77280220184b924db82a535978e9bfe7a6111f455028f18cd923c54144\"\n + \"08a247409d7121a99c3594708c0dd9cdebf1c9bb0060ff1c4c0363e25fac0d5b\"\n + \"bf85013945f393b0b9673780c6f579353ae895d7dc891220a92bac0a8deb35b5\"\n + \"20803cf82b19c27232a889d0f04fb2bde6623f357e3e56027298379d10bee8fa\"\n + \"4e0c29029a78fde01694719d2d036fe726aa5633205553565f127a78fec46918\"\n + \"182e41a16c5cc86bd3b77d26c5113082cb1f2d83d9213eca019bbdee99001e11\"\n + \"16bcfec1242ece175558b15c5bbbc4710203010001\";\n RSAPublicKey pubKey;\n try {\n KeyFactory kf = KeyFactory.getInstance(\"RSASSA-PSS\");\n X509EncodedKeySpec spec = new X509EncodedKeySpec(TestUtil.hexToBytes(encodedPubKey));\n pubKey = (RSAPublicKey) kf.generatePublic(spec);\n } catch (NoSuchAlgorithmException | InvalidKeySpecException ex) {\n TestUtil.skipTest(\"RSASSA-PSS keys with parameters are not supported.\");\n return;\n }\n // Ensures that the encoding format is X.509. Other formats would not only break\n // this test but lead to incompatible implementations.\n assertEquals(\"Public key does not use X.509 format\", \"X.509\", pubKey.getFormat());\n byte[] encoded = pubKey.getEncoded();\n assertEquals(encodedPubKey, TestUtil.bytesToHex(encoded));\n }", "String createXMLStructure(String szTimeStamp,\n\t\t\tString szUniqueTransactionCode, String szCurrencyCode,\n\t\t\tString szAmount, String szCreditCardNumber, String szValidityMonth,\n\t\t\tString szValidityYear, String szCVVCode, String szBankCountryCode,\n\t\t\tString szBankName, String szCardHolderName, String szCardHolderMail) {\n\n\t\tszTimeStamp = new SimpleDateFormat(\"ddMMyyHHmmss\").format(Calendar\n\t\t\t\t.getInstance().getTime());\n\t\tszUniqueTransactionCode = getMd5Hash(\n\t\t\t\tString.valueOf(System.currentTimeMillis())).substring(0, 20);\n\n\t\tString xmlData = \"<PaymentRequest>\\r\\n\"\n\t\t\t\t+ \" <version>8.0</version>\\r\\n\" + \" <timeStamp>\"\n\t\t\t\t+ szTimeStamp\n\t\t\t\t+ \"</timeStamp>\\r\\n\"\n\t\t\t\t+ \" <merchantID>215</merchantID>\\r\\n\"\n\t\t\t\t+ \" <uniqueTransactionCode>\"\n\t\t\t\t+ szUniqueTransactionCode\n\t\t\t\t+ \"</uniqueTransactionCode>\\r\\n\"\n\t\t\t\t+ \" <desc>Hotel Trip Booking</desc>\\r\\n\"\n\t\t\t\t+ \" <amt>\"\n\t\t\t\t+ szAmount\n\t\t\t\t+ \"</amt>\\r\\n\"\n\t\t\t\t+ \" <currencyCode>\"\n\t\t\t\t+ 764\n\t\t\t\t+ \"</currencyCode>\\r\\n\"\n\t\t\t\t+ \" <pan>\"\n\t\t\t\t+ szCreditCardNumber\n\t\t\t\t+ \"</pan>\\r\\n\"\n\t\t\t\t+ \" <expiry>\\r\\n\"\n\t\t\t\t+ \" <month>\"\n\t\t\t\t+ szValidityMonth\n\t\t\t\t+ \"</month>\\r\\n\"\n\t\t\t\t+ \" <year>\"\n\t\t\t\t+ szValidityYear\n\t\t\t\t+ \"</year>\\r\\n\"\n\t\t\t\t+ \" </expiry>\\r\\n\"\n\t\t\t\t// + \" <storeCardUniqueID></storeCardUniqueID>\\r\\n\"\n\t\t\t\t+ \" <securityCode>\"\n\t\t\t\t+ szCVVCode\n\t\t\t\t+ \"</securityCode>\\r\\n\"\n\t\t\t\t+ \" <clientIP>46.137.157.1</clientIP>\\r\\n\"\n\t\t\t\t+ \" <panCountry>\"\n\t\t\t\t+ szBankCountryCode\n\t\t\t\t+ \"</panCountry>\\r\\n\"\n\t\t\t\t+ \" <panBank>\"\n\t\t\t\t+ Utils.EncodeXML(szBankName)\n\t\t\t\t+ \"</panBank>\\r\\n\"\n\t\t\t\t+ \" <cardholderName>\"\n\t\t\t\t+ Utils.EncodeXML(szCardHolderName)\n\t\t\t\t+ \"</cardholderName>\\r\\n\"\n\t\t\t\t+ \" <cardholderEmail>\"\n\t\t\t\t+ Utils.EncodeXML(szCardHolderMail)\n\t\t\t\t+ \"</cardholderEmail>\\r\\n\"\n\t\t\t\t+ \" <payCategoryID></payCategoryID>\\r\\n\"\n\t\t\t\t+ \" <userDefined1></userDefined1>\\r\\n\"\n\t\t\t\t+ \" <userDefined2></userDefined2>\\r\\n\"\n\t\t\t\t+ \" <userDefined3></userDefined3>\\r\\n\"\n\t\t\t\t+ \" <userDefined4></userDefined4>\\r\\n\"\n\t\t\t\t+ \" <userDefined5></userDefined5>\\r\\n\"\n\t\t\t\t+ \" <storeCard>N</storeCard>\\r\\n\"\n\t\t\t\t+ \" <ippTransaction>N</ippTransaction>\\r\\n\"\n\t\t\t\t+ \" <installmentPeriod>3</installmentPeriod>\\r\\n\"\n\t\t\t\t+ \" <interestType>C</interestType>\\r\\n\"\n\t\t\t\t+ \" <recurring>N</recurring>\\r\\n\"\n\t\t\t\t+ \" <invoicePrefix></invoicePrefix>\\r\\n\"\n\t\t\t\t+ \" <recurringAmount></recurringAmount>\\r\\n\"\n\t\t\t\t+ \" <allowAccumulate></allowAccumulate>\\r\\n\"\n\t\t\t\t+ \" <maxAccumulateAmt>\\r\\n\"\n\t\t\t\t+ \" </maxAccumulateAmt>\\r\\n\"\n\t\t\t\t+ \" <recurringInterval></recurringInterval>\\r\\n\"\n\t\t\t\t+ \" <recurringCount></recurringCount>\\r\\n\"\n\t\t\t\t+ \" <chargeNextDate></chargeNextDate>\\r\\n\"\n\t\t\t\t+ \" <hashValue></hashValue>\\r\\n\" + \"</PaymentRequest>\";\n\n\t\tString szSignature = \"merchantID\" + \"uniqueTransactionCode\" + \"amt\";\n\t\tszSignature = \"215\" + szUniqueTransactionCode + szAmount;\n\n\t\tLog.e(\"TravellerDetailsTabActivity\", \"XML Data:: \" + xmlData);\n\n\t\treturn xmlData;\n\t}", "MessageSerializer<T> create();" ]
[ "0.55364317", "0.50920147", "0.48133475", "0.4705484", "0.45739016", "0.4517807", "0.450197", "0.44023487", "0.43437648", "0.43387094", "0.43151206", "0.4314912", "0.43030792", "0.4297578", "0.42951772", "0.42840335", "0.4266479", "0.4243778", "0.42435235", "0.42309925", "0.4224892", "0.42223823", "0.42203107", "0.42073655", "0.42057896", "0.42022932", "0.42003232", "0.41891003", "0.41861945", "0.41819933", "0.4176792", "0.4176394", "0.41746926", "0.41722578", "0.41697028", "0.4164606", "0.41522682", "0.41515768", "0.41457132", "0.41417626", "0.41406822", "0.41287103", "0.4122627", "0.41103417", "0.40941438", "0.4063102", "0.4061525", "0.40609553", "0.40609217", "0.40496293", "0.4048655", "0.40476504", "0.4045673", "0.40456465", "0.4028859", "0.4015028", "0.4010942", "0.40103695", "0.40009096", "0.39864674", "0.39812988", "0.3976844", "0.3970241", "0.39671654", "0.39666027", "0.39651397", "0.39644057", "0.3962671", "0.3962329", "0.39621338", "0.39584756", "0.39547852", "0.39453855", "0.39349896", "0.3934405", "0.39294446", "0.39268863", "0.39164263", "0.39151475", "0.3909934", "0.3908706", "0.3908211", "0.39070058", "0.39049327", "0.39047322", "0.39036995", "0.38967624", "0.3896718", "0.3893221", "0.38931608", "0.38822314", "0.3881831", "0.3881396", "0.38754877", "0.387505", "0.38673955", "0.3853832", "0.3851418", "0.38465977", "0.38431826" ]
0.43348813
10
execute the contingency against the given model
void execute(PAModel cmodel) throws PAModelException;
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Override\n\tpublic void execute() {\n\t\tDMNModel model = getDmnRuntime().getModels().get(0); // assuming there is only one model in the KieBase\n\t\t\n\t\t// setting input data\n\t\tDMNContext dmnContext = createDmnContext(\n\t\t\t\tImmutablePair.of(\"customerData\", new CustomerData(\"Silver\", new BigDecimal(15)))\n\t\t);\n\t\t\n\t\t// executing decision logic\n\t\tDMNResult topLevelResult = getDmnRuntime().evaluateAll(model, dmnContext);\n\t\t\n\t\t// retrieving execution results\n\t\tSystem.out.println(\"--- results of evaluating all ---\");\n\t\ttopLevelResult.getDecisionResults().forEach(this::printAsJson);\n\t}", "public static void model1() {\n try {\n IloCplex cplex = new IloCplex();\n \n //variables\n IloNumVar x = cplex.numVar(0, Double.MAX_VALUE, \"x\"); //x >= 0\n IloNumVar y = cplex.numVar(0, Double.MAX_VALUE, \"y\"); //y >= 0\n \n //expressions\n IloLinearNumExpr objective = cplex.linearNumExpr();\n objective.addTerm(0.12, x);\n objective.addTerm(0.15, y);\n \n //define objective\n cplex.addMinimize(objective);\n \n //define constraints\n cplex.addGe(cplex.sum(cplex.prod(60, x), cplex.prod(60, y)), 300);\n cplex.addGe(cplex.sum(cplex.prod(12, x), cplex.prod(6, y)), 36);\n cplex.addGe(cplex.sum(cplex.prod(10, x), cplex.prod(30, y)), 90);\n \n //solve\n if (cplex.solve()) {\n System.out.println(\"Obj = \" + cplex.getObjValue());\n System.out.println(\"Obj = \" + cplex.getValue(objective));\n System.out.println(\"x = \" + cplex.getValue(x));\n System.out.println(\"y = \" + cplex.getValue(y));\n } else {\n System.out.println(\"Solution not found.\");\n }\n } catch (IloException ex) {\n ex.printStackTrace();\n }\n }", "@Autowired\n\tpublic void execute(Model model) {\n\n\t}", "public void runModel(){\n\t\tcurrentView.getDynamicModelView().getModel().setProgressMonitor(progressMonitor);\r\n\t\tnew Thread(currentView.getDynamicModelView().getModel()).start();\r\n\r\n\t\tsetStatusBarText(\"Ready\");\r\n\t}", "private void processModelSideEffects(Model model) throws CommandException {\n if (model.hasInvalidDependencies()) {\n throw new CommandException(MESSAGE_UNFULFILLED_DEPENDENCIES);\n }\n\n model.updateFilteredTaskList(PREDICATE_SHOW_ALL_TASKS);\n model.commitTaskManager();\n }", "private void runOnlineModel() {\n myScenario.setProbe(myProbe);\n myScenario.setSynchronizationMode(mySrcSelector);\n try {\n myScenario.resync();\n myScenario.run();\n } catch (SynchronizationException e) {\n System.out.println(e);\n } catch (ModelException e) {\n System.out.println(e);\n }\n }", "public void model() \n\t{\n\t\t\n\t\ttry \n\t\t{\n\t\t GRBEnv env = new GRBEnv();\n\t\t GRBModel model = new GRBModel(env, \"resources/students.lp\");\n\n\t\t model.optimize();\n\n\t\t int optimstatus = model.get(GRB.IntAttr.Status);\n\n\t\t if (optimstatus == GRB.Status.INF_OR_UNBD) {\n\t\t model.getEnv().set(GRB.IntParam.Presolve, 0);\n\t\t model.optimize();\n\t\t optimstatus = model.get(GRB.IntAttr.Status);\n\t\t }\n\n\t\t if (optimstatus == GRB.Status.OPTIMAL) {\n\t\t double objval = model.get(GRB.DoubleAttr.ObjVal);\n\t\t System.out.println(\"Optimal objective: \" + objval);\n\t\t } else if (optimstatus == GRB.Status.INFEASIBLE) {\n\t\t System.out.println(\"Model is infeasible\");\n\n\t\t // Compute and write out IIS\n\t\t model.computeIIS();\n\t\t model.write(\"model.ilp\");\n\t\t } else if (optimstatus == GRB.Status.UNBOUNDED) {\n\t\t System.out.println(\"Model is unbounded\");\n\t\t } else {\n\t\t System.out.println(\"Optimization was stopped with status = \"\n\t\t + optimstatus);\n\t\t }\n\n\t\t // Dispose of model and environment\n\t\t model.write(\"resources/model.sol\");\n\t\t model.dispose();\n\t\t env.dispose();\n\n\t\t } catch (GRBException e) {\n\t\t System.out.println(\"Error code: \" + e.getErrorCode() + \". \" +\n\t\t e.getMessage());\n\t\t }\n\t\t\n\t}", "public static void main(String[] args) {\n\t\tExemplaryContent ec = new ExemplaryContent();\n\t\tRendezvous rendezvous = ec.getExample();\n\n\t\t// make a few steps\n\t\tILOGExporter exporter = new ILOGExporter();\n\t\tILOGSolver solver = new ILOGSolver();\n\n\t\tFile modelFile = new File(\"Constraints-Displays-Model.mod\");\n\n\t\tPreferenceStructure preferences = new PreferenceStructure(); // unit preference structure Max-CSP\n\n\t\tResultChecker checker = new ResultChecker();\n\t\tfor (int steps = 0; steps < 5; ++steps) {\n\n\t\t\tString dataContent = exporter.getILOGDataFile(rendezvous);\n\t\t\tString preferencesContent = exporter.getPreferenceContent(preferences);\n\n\t\t\tSolution solution = solver.solve(modelFile, dataContent + \"\\n\" + preferencesContent);\n\n\t\t\tFrame selectedFrame = rendezvous.getContent().getFrameGraph().lookup(solution.getSelectedFrameId());\n\t\t\tsolution.setSelectedFrame(selectedFrame);\n\n\t\t\tSystem.out.println(\"Selected \" + solution.getSelectedFrameId());\n\n\t\t\tchecker.check(solution, rendezvous, preferences);\n\n\t\t\t// add to the seen frames\n\t\t\tfor (Group g : rendezvous.getMeetup().getGroups()) {\n\t\t\t\tfor (User u : g.getMembers()) {\n\t\t\t\t\tu.getSeenFrames().add(selectedFrame);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t// test suite has ended\n\t\tSystem.out.println(checker.retrieveCoverageInformation());\n\t}", "public void run() throws IloException {\n\t\t\n\t\t//Instancie la classe Cplex avec le programme lineaire et la nature\n\t\tCplex cplex = new Cplex(prog, nature);\n\t\tboolean st = false;\n\t\tString info;\n\t\tint i = 0;\n\t\t\n\t\t/*Tant que l'on a des sous tours dans le modèle*/\n\t\tdo {\n\t\t\t//Lancement du solve du model de cplex\n\t\t\tcplex.solve();\n\t\t\t\n\t\t\t//Récupère un booléen en fonction de la présence de sous tours après le solve\n\t\t\tst = contrainteSousTour(cplex);\n\t\t\tinfo = \"Contrainte de sous-tours ajouté au modèle\";\n\t\t\tInterface.majAffichage(info);\n\t\t\ti++;\n\t\t} while (st && i!= 5);\n\n\t}", "@Override\n\tpublic int evaluate(String modelDirection, EObject featureContext) {\n\t\tint op1=this.getCompOp1().getNumPriorityOp2().evaluate(modelDirection, featureContext);\n\t\tint op2=this.getCompOp2().getNumPriorityOp2().evaluate(modelDirection, featureContext);\n\t\tif (op1!=op2) {\n\t\t\treturn 1;\n\t\t} else {\n\t\t\treturn 0;\n\t\t}\n\t}", "private void applyTheRule() throws Exception {\n System.out.println();\n System.out.println();\n System.out.println();\n System.out.println(\"IM APPLYING RULE \" + this.parameter.rule + \" ON MODEL: \" + this.resultingModel.path);\n System.out.println();\n if (parameter.rule.equals(\"1\")) {\n Rule1.apply(resultingModel);\n System.out.println();\n }\n\n if (parameter.rule.equals(\"2\")) {\n Rule2.apply(resultingModel);\n System.out.println();\n }\n\n if (parameter.rule.equals(\"3\")) {\n Rule3.all(resultingModel);\n System.out.println();\n }\n\n if (parameter.rule.equals(\"3a\")) {\n Rule3.a(resultingModel);\n\n }\n\n if (parameter.rule.equals(\"3b\")) {\n Rule3.b(resultingModel);\n }\n\n if (parameter.rule.equals(\"3c\")) {\n Rule3.c(resultingModel);\n }\n\n if (parameter.rule.equals(\"4\")) {\n Rule4.all(resultingModel);\n }\n\n if (parameter.rule.equals(\"4a\")) {\n Rule4.a(resultingModel);\n }\n\n if (parameter.rule.equals(\"4b\")) {\n Rule4.b(resultingModel);\n }\n\n if (parameter.rule.equals(\"4c\")) {\n Rule4.c(resultingModel);\n }\n\n if (parameter.rule.equals(\"r1\")) {\n Reverse1.apply(resultingModel, parameter.aggregateBy);\n }\n\n if (parameter.rule.equals(\"r2\")) {\n Reverse2.apply(resultingModel, parameter.aggregateBy);\n }\n\n if (parameter.rule.equals(\"r3\")) {\n Reverse3.apply(resultingModel, parameter.aggregateBy);\n }\n\n if (parameter.rule.equals(\"r3a\")) {\n Reverse3.a(resultingModel);\n }\n\n if (parameter.rule.equals(\"r3b\")) {\n Reverse3.b(resultingModel);\n }\n\n if (parameter.rule.equals(\"r3c\")) {\n Reverse3.c(resultingModel);\n }\n\n if (parameter.rule.equals(\"r4\")) {\n Reverse4.all(resultingModel);\n }\n\n if (parameter.rule.equals(\"r4a\")) {\n Reverse4.a(resultingModel);\n }\n\n if (parameter.rule.equals(\"r4b\")) {\n Reverse4.b(resultingModel);\n }\n\n if (parameter.rule.equals(\"r4c\")) {\n Reverse4.c(resultingModel);\n }\n\n if (parameter.rule.equals(\"5\")){\n Rule5.apply(resultingModel);\n }\n\n System.out.println(\"IM DONE APPLYING RULE \" + this.parameter.rule + \" ON MODEL: \" + this.resultingModel.path);\n\n this.resultingModel.addRule(parameter);\n //System.out.println(this.resultingModel.name);\n this.resultingModel.addOutputInPath();\n }", "@Override\n\tprotected void analyzeSystem(PipelineData data, Classifier classifier) throws Exception {\n\t\tField modelField = null;\n\n\t\tmodelField = LibSVM.class.getDeclaredField(\"m_Model\");\n\t\tmodelField.setAccessible(true);\n\t\tnumberOfSupportVectors = (int) ((svm_model) modelField.get(classifier)).l;\n\t\tnumberOfClasses = data.getFeatureSelectedInstances().numClasses();\n\t}", "public void tickGathering(Model model)\n {\n\n }", "double[] predictWithContextual(String testUser, OrienteeringEnvironment environment) throws IOException {\n loadData(Paths.get(this.path.toString(), \"userSequencesFile\", this.testSequenceNumber + \".txt\").toString());\r\n loadUserVisitedPOIs(Paths.get(this.path.toString(), \"userAllPOIsFile\", this.testSequenceNumber + \".txt\").toString());\r\n trainWithContextual();\r\n double[] userInt = new double[this.numOfItems];\r\n double z = 0.0;\r\n Integer[] contextPOIs = {environment.start, environment.end};\r\n double[] userContextVector = aggregate(contextPOIs, this.userMatrix[Integer.parseInt(testUser)]);\r\n for (int i = 0; i < this.itemMatrix.length; i++) {\r\n userInt[i] = multiple(userContextVector, this.itemMatrix[i])+this.itemBias[i];\r\n z += Math.exp(userInt[i]);\r\n }\r\n for (int i = 0; i < userInt.length; i++) {\r\n userInt[i] = Math.exp(userInt[i])/z;\r\n }\r\n\r\n\r\n double z2 = 0;\r\n for (int i = 0; i < this.numOfItems; i++) {\r\n if (i != environment.start && i != environment.end){\r\n for (int j = 0; j < this.itemMatrix.length; j++) {\r\n if (i != j && j != environment.start && j != environment.end) {\r\n environment.cooccurrTable[i][j] = multiple(this.itemMatrix[i], this.itemMatrix[j]);\r\n z2 += Math.exp(environment.cooccurrTable[i][j]);\r\n }\r\n }\r\n }\r\n\r\n }\r\n\r\n\r\n for (int i = 0; i < this.numOfItems; i++) {\r\n if(i!=environment.start && i!=environment.end) {\r\n for (int j = 0; j < this.numOfItems; j++) {\r\n if (i != j && j != environment.start && j != environment.end) {\r\n environment.cooccurrTable[i][j] = Math.exp(environment.cooccurrTable[i][j]) / z2;;\r\n }\r\n }\r\n }\r\n }\r\n\r\n\r\n for (int i = 0; i < userInt.length; i++) {\r\n System.out.print(\"[\"+i+\"] \"+ userInt[i]+\" \");\r\n }\r\n\r\n System.out.println();\r\n return userInt;\r\n\r\n }", "@Test(timeout = 4000)\n public void test093() throws Throwable {\n TextDirectoryLoader textDirectoryLoader0 = new TextDirectoryLoader();\n Instances instances0 = textDirectoryLoader0.getDataSet();\n Evaluation evaluation0 = new Evaluation(instances0);\n Object[] objectArray0 = new Object[2];\n evaluation0.evaluateModel((Classifier) null, instances0, objectArray0);\n assertEquals(0.0, evaluation0.SFEntropyGain(), 0.01);\n }", "public void compute(){\r\n\r\n\t\ttotalCost=(capAmount*CAPCOST)+(hoodyAmount*HOODYCOST)+(shirtAmount*SHIRTCOST);\r\n\t}", "@Override\n public void calculate(double[] x) {\n\n double prob = 0.0; // the log prob of the sequence given the model, which is the negation of value at this point\n Triple<double[][], double[][], double[][]> allParams = separateWeights(x);\n double[][] linearWeights = allParams.first();\n double[][] W = allParams.second(); // inputLayerWeights \n double[][] U = allParams.third(); // outputLayerWeights \n\n double[][] Y = null;\n if (flags.softmaxOutputLayer) {\n Y = new double[U.length][];\n for (int i = 0; i < U.length; i++) {\n Y[i] = ArrayMath.softmax(U[i]);\n }\n }\n\n double[][] What = emptyW();\n double[][] Uhat = emptyU();\n\n // the expectations over counts\n // first index is feature index, second index is of possible labeling\n double[][] E = empty2D();\n double[][] eW = emptyW();\n double[][] eU = emptyU();\n\n // iterate over all the documents\n for (int m = 0; m < data.length; m++) {\n int[][][] docData = data[m];\n int[] docLabels = labels[m];\n\n // make a clique tree for this document\n CRFCliqueTree cliqueTree = CRFCliqueTree.getCalibratedCliqueTree(docData, labelIndices, numClasses, classIndex,\n backgroundSymbol, new NonLinearCliquePotentialFunction(linearWeights, W, U, flags));\n\n // compute the log probability of the document given the model with the parameters x\n int[] given = new int[window - 1];\n Arrays.fill(given, classIndex.indexOf(backgroundSymbol));\n int[] windowLabels = new int[window];\n Arrays.fill(windowLabels, classIndex.indexOf(backgroundSymbol));\n\n if (docLabels.length>docData.length) { // only true for self-training\n // fill the given array with the extra docLabels\n System.arraycopy(docLabels, 0, given, 0, given.length);\n System.arraycopy(docLabels, 0, windowLabels, 0, windowLabels.length);\n // shift the docLabels array left\n int[] newDocLabels = new int[docData.length];\n System.arraycopy(docLabels, docLabels.length-newDocLabels.length, newDocLabels, 0, newDocLabels.length);\n docLabels = newDocLabels;\n }\n // iterate over the positions in this document\n for (int i = 0; i < docData.length; i++) {\n int label = docLabels[i];\n double p = cliqueTree.condLogProbGivenPrevious(i, label, given);\n if (VERBOSE) {\n System.err.println(\"P(\" + label + \"|\" + ArrayMath.toString(given) + \")=\" + p);\n }\n prob += p;\n System.arraycopy(given, 1, given, 0, given.length - 1);\n given[given.length - 1] = label;\n }\n\n // compute the expected counts for this document, which we will need to compute the derivative\n // iterate over the positions in this document\n for (int i = 0; i < docData.length; i++) {\n // for each possible clique at this position\n System.arraycopy(windowLabels, 1, windowLabels, 0, window - 1);\n windowLabels[window - 1] = docLabels[i];\n for (int j = 0; j < docData[i].length; j++) {\n Index<CRFLabel> labelIndex = labelIndices[j];\n // for each possible labeling for that clique\n int[] cliqueFeatures = docData[i][j];\n double[] As = null;\n double[] fDeriv = null;\n double[][] yTimesA = null;\n double[] sumOfYTimesA = null;\n\n if (j == 0) {\n As = NonLinearCliquePotentialFunction.hiddenLayerOutput(W, cliqueFeatures, flags);\n fDeriv = new double[inputLayerSize];\n double fD = 0;\n for (int q = 0; q < inputLayerSize; q++) {\n if (useSigmoid) {\n fD = As[q] * (1 - As[q]); \n } else {\n fD = 1 - As[q] * As[q]; \n }\n fDeriv[q] = fD;\n }\n\n // calculating yTimesA for softmax\n if (flags.softmaxOutputLayer) {\n double val = 0;\n\n yTimesA = new double[outputLayerSize][numHiddenUnits];\n for (int ii = 0; ii < outputLayerSize; ii++) {\n yTimesA[ii] = new double[numHiddenUnits];\n }\n sumOfYTimesA = new double[outputLayerSize];\n\n for (int k = 0; k < outputLayerSize; k++) {\n double[] Yk = null;\n if (flags.tieOutputLayer) {\n Yk = Y[0];\n } else {\n Yk = Y[k];\n }\n double sum = 0;\n for (int q = 0; q < inputLayerSize; q++) {\n if (q % outputLayerSize == k) {\n int hiddenUnitNo = q / outputLayerSize;\n val = As[q] * Yk[hiddenUnitNo];\n yTimesA[k][hiddenUnitNo] = val;\n sum += val;\n }\n }\n sumOfYTimesA[k] = sum;\n }\n }\n\n // calculating Uhat What\n int[] cliqueLabel = new int[j + 1];\n System.arraycopy(windowLabels, window - 1 - j, cliqueLabel, 0, j + 1);\n\n CRFLabel crfLabel = new CRFLabel(cliqueLabel);\n int givenLabelIndex = labelIndex.indexOf(crfLabel);\n double[] Uk = null;\n double[] UhatK = null;\n double[] Yk = null;\n double[] yTimesAK = null;\n double sumOfYTimesAK = 0;\n if (flags.tieOutputLayer) {\n Uk = U[0];\n UhatK = Uhat[0];\n if (flags.softmaxOutputLayer) {\n Yk = Y[0];\n }\n } else {\n Uk = U[givenLabelIndex];\n UhatK = Uhat[givenLabelIndex];\n if (flags.softmaxOutputLayer) {\n Yk = Y[givenLabelIndex];\n }\n }\n\n if (flags.softmaxOutputLayer) {\n yTimesAK = yTimesA[givenLabelIndex];\n sumOfYTimesAK = sumOfYTimesA[givenLabelIndex];\n }\n\n for (int k = 0; k < inputLayerSize; k++) {\n double deltaK = 1;\n if (flags.sparseOutputLayer || flags.tieOutputLayer) {\n if (k % outputLayerSize == givenLabelIndex) {\n int hiddenUnitNo = k / outputLayerSize;\n if (flags.softmaxOutputLayer) {\n UhatK[hiddenUnitNo] += (yTimesAK[hiddenUnitNo] - Yk[hiddenUnitNo] * sumOfYTimesAK);\n deltaK *= Yk[hiddenUnitNo];\n } else {\n UhatK[hiddenUnitNo] += As[k];\n deltaK *= Uk[hiddenUnitNo];\n }\n }\n } else {\n UhatK[k] += As[k];\n if (useOutputLayer) {\n deltaK *= Uk[k];\n }\n }\n if (useHiddenLayer)\n deltaK *= fDeriv[k];\n if (useOutputLayer) {\n if (flags.sparseOutputLayer || flags.tieOutputLayer) {\n if (k % outputLayerSize == givenLabelIndex) {\n double[] WhatK = What[k];\n for (int n = 0; n < cliqueFeatures.length; n++) {\n WhatK[cliqueFeatures[n]] += deltaK;\n }\n }\n } else {\n double[] WhatK = What[k];\n for (int n = 0; n < cliqueFeatures.length; n++) {\n WhatK[cliqueFeatures[n]] += deltaK;\n }\n }\n } else {\n if (k == givenLabelIndex) {\n double[] WhatK = What[k];\n for (int n = 0; n < cliqueFeatures.length; n++) {\n WhatK[cliqueFeatures[n]] += deltaK;\n }\n }\n }\n }\n }\n\n for (int k = 0; k < labelIndex.size(); k++) { // labelIndex.size() == numClasses\n int[] label = labelIndex.get(k).getLabel();\n double p = cliqueTree.prob(i, label); // probability of these labels occurring in this clique with these features\n if (j == 0) { // for node features\n double[] Uk = null;\n double[] eUK = null;\n double[] Yk = null;\n if (flags.tieOutputLayer) {\n Uk = U[0];\n eUK = eU[0];\n if (flags.softmaxOutputLayer) {\n Yk = Y[0];\n }\n } else {\n Uk = U[k];\n eUK = eU[k];\n if (flags.softmaxOutputLayer) {\n Yk = Y[k];\n }\n }\n if (useOutputLayer) {\n for (int q = 0; q < inputLayerSize; q++) {\n double deltaQ = 1;\n if (flags.sparseOutputLayer || flags.tieOutputLayer) {\n if (q % outputLayerSize == k) {\n int hiddenUnitNo = q / outputLayerSize;\n if (flags.softmaxOutputLayer) {\n eUK[hiddenUnitNo] += (yTimesA[k][hiddenUnitNo] - Yk[hiddenUnitNo] * sumOfYTimesA[k]) * p;\n deltaQ = Yk[hiddenUnitNo];\n } else {\n eUK[hiddenUnitNo] += As[q] * p;\n deltaQ = Uk[hiddenUnitNo];\n }\n }\n } else {\n eUK[q] += As[q] * p;\n deltaQ = Uk[q];\n }\n if (useHiddenLayer)\n deltaQ *= fDeriv[q];\n if (flags.sparseOutputLayer || flags.tieOutputLayer) {\n if (q % outputLayerSize == k) {\n double[] eWq = eW[q];\n for (int n = 0; n < cliqueFeatures.length; n++) {\n eWq[cliqueFeatures[n]] += deltaQ * p;\n }\n }\n } else {\n double[] eWq = eW[q];\n for (int n = 0; n < cliqueFeatures.length; n++) {\n eWq[cliqueFeatures[n]] += deltaQ * p;\n }\n }\n }\n } else {\n double deltaK = 1;\n if (useHiddenLayer)\n deltaK *= fDeriv[k];\n double[] eWK = eW[k];\n for (int n = 0; n < cliqueFeatures.length; n++) {\n eWK[cliqueFeatures[n]] += deltaK * p;\n }\n }\n } else { // for edge features\n for (int n = 0; n < cliqueFeatures.length; n++) {\n E[cliqueFeatures[n]][k] += p;\n }\n }\n }\n }\n }\n }\n\n if (Double.isNaN(prob)) { // shouldn't be the case\n throw new RuntimeException(\"Got NaN for prob in CRFNonLinearLogConditionalObjectiveFunction.calculate()\");\n }\n\n value = -prob;\n if(VERBOSE){\n System.err.println(\"value is \" + value);\n }\n\n // compute the partial derivative for each feature by comparing expected counts to empirical counts\n int index = 0;\n for (int i = 0; i < E.length; i++) {\n int originalIndex = edgeFeatureIndicesMap.get(i);\n\n for (int j = 0; j < E[i].length; j++) {\n derivative[index++] = (E[i][j] - Ehat[i][j]);\n if (VERBOSE) {\n System.err.println(\"linearWeights deriv(\" + i + \",\" + j + \") = \" + E[i][j] + \" - \" + Ehat[i][j] + \" = \" + derivative[index - 1]);\n }\n }\n }\n if (index != edgeParamCount)\n throw new RuntimeException(\"after edge derivative, index(\"+index+\") != edgeParamCount(\"+edgeParamCount+\")\");\n\n for (int i = 0; i < eW.length; i++) {\n for (int j = 0; j < eW[i].length; j++) {\n derivative[index++] = (eW[i][j] - What[i][j]);\n if (VERBOSE) {\n System.err.println(\"inputLayerWeights deriv(\" + i + \",\" + j + \") = \" + eW[i][j] + \" - \" + What[i][j] + \" = \" + derivative[index - 1]);\n }\n }\n }\n\n\n if (index != beforeOutputWeights)\n throw new RuntimeException(\"after W derivative, index(\"+index+\") != beforeOutputWeights(\"+beforeOutputWeights+\")\");\n\n if (useOutputLayer) {\n for (int i = 0; i < eU.length; i++) {\n for (int j = 0; j < eU[i].length; j++) {\n derivative[index++] = (eU[i][j] - Uhat[i][j]);\n if (VERBOSE) {\n System.err.println(\"outputLayerWeights deriv(\" + i + \",\" + j + \") = \" + eU[i][j] + \" - \" + Uhat[i][j] + \" = \" + derivative[index - 1]);\n }\n }\n }\n }\n\n if (index != x.length)\n throw new RuntimeException(\"after W derivative, index(\"+index+\") != x.length(\"+x.length+\")\");\n\n int regSize = x.length;\n if (flags.skipOutputRegularization || flags.softmaxOutputLayer) {\n regSize = beforeOutputWeights;\n }\n\n // incorporate priors\n if (prior == QUADRATIC_PRIOR) {\n double sigmaSq = sigma * sigma;\n for (int i = 0; i < regSize; i++) {\n double k = 1.0;\n double w = x[i];\n value += k * w * w / 2.0 / sigmaSq;\n derivative[i] += k * w / sigmaSq;\n }\n } else if (prior == HUBER_PRIOR) {\n double sigmaSq = sigma * sigma;\n for (int i = 0; i < regSize; i++) {\n double w = x[i];\n double wabs = Math.abs(w);\n if (wabs < epsilon) {\n value += w * w / 2.0 / epsilon / sigmaSq;\n derivative[i] += w / epsilon / sigmaSq;\n } else {\n value += (wabs - epsilon / 2) / sigmaSq;\n derivative[i] += ((w < 0.0) ? -1.0 : 1.0) / sigmaSq;\n }\n }\n } else if (prior == QUARTIC_PRIOR) {\n double sigmaQu = sigma * sigma * sigma * sigma;\n for (int i = 0; i < regSize; i++) {\n double k = 1.0;\n double w = x[i];\n value += k * w * w * w * w / 2.0 / sigmaQu;\n derivative[i] += k * w / sigmaQu;\n }\n }\n }", "public ModelResponse execute(ModelRequest req, ModelResponse res) throws ModelException;", "public Map<String,TestResult> classify(DoubleDataTable tstTable, Progress prog) throws InterruptedException\n {\n // klasyfikacja tabeli testowej\n if (tstTable.noOfObjects()<=0) throw new RuntimeException(\"ClassificationController of an empty table\");\n NominalAttribute decAttr = tstTable.attributes().nominalDecisionAttribute();\n Map<String,int[][]> mapOfConfusionMatrices = new HashMap<String,int[][]>();\n prog.set(\"Classifing test table\", tstTable.noOfObjects());\n for (DoubleData dObj : tstTable.getDataObjects())\n {\n int objDecLocalCode = decAttr.localValueCode(((DoubleDataWithDecision)dObj).getDecision());\n for (Map.Entry<String,Classifier> cl : m_Classifiers.entrySet())\n {\n int[][] confusionMatrix = (int[][])mapOfConfusionMatrices.get(cl.getKey());\n if (confusionMatrix==null)\n {\n confusionMatrix = new int[decAttr.noOfValues()][];\n for (int i = 0; i < confusionMatrix.length; i++)\n confusionMatrix[i] = new int[decAttr.noOfValues()];\n mapOfConfusionMatrices.put(cl.getKey(), confusionMatrix);\n }\n try\n {\n double dec = cl.getValue().classify(dObj);\n if (!Double.isNaN(dec))\n \tconfusionMatrix[objDecLocalCode][decAttr.localValueCode(dec)]++;\n }\n catch (RuntimeException e)\n {\n Report.exception(e);\n }\n catch (PropertyConfigurationException e)\n {\n Report.exception(e);\n }\n }\n prog.step();\n }\n // przygotowanie wynikow klasyfikacji\n Map<String,TestResult> resultMap = new HashMap<String,TestResult>();\n for (Map.Entry<String,Classifier> cl : m_Classifiers.entrySet())\n {\n int[][] confusionMatrix = (int[][])mapOfConfusionMatrices.get(cl.getKey());\n cl.getValue().calculateStatistics();\n TestResult results = new TestResult(decAttr, tstTable.getDecisionDistribution(), confusionMatrix, ((ConfigurationWithStatistics)cl.getValue()).getStatistics());\n resultMap.put(cl.getKey(), results);\n }\n return resultMap;\n }", "public void test_ck_02() {\n OntModel vocabModel = ModelFactory.createOntologyModel();\n ObjectProperty p = vocabModel.createObjectProperty(\"p\");\n OntClass A = vocabModel.createClass(\"A\");\n \n OntModel workModel = ModelFactory.createOntologyModel();\n Individual sub = workModel.createIndividual(\"uri1\", A);\n Individual obj = workModel.createIndividual(\"uri2\", A);\n workModel.createStatement(sub, p, obj);\n }", "public void evaluate(String sampleFile, String featureDefFile, int nFold, float tvs, String modelDir, String modelFile) {\n/* 854 */ List<List<RankList>> trainingData = new ArrayList<>();\n/* 855 */ List<List<RankList>> validationData = new ArrayList<>();\n/* 856 */ List<List<RankList>> testData = new ArrayList<>();\n/* */ \n/* */ \n/* */ \n/* 860 */ List<RankList> samples = readInput(sampleFile);\n/* */ \n/* */ \n/* 863 */ int[] features = readFeature(featureDefFile);\n/* 864 */ if (features == null) {\n/* 865 */ features = FeatureManager.getFeatureFromSampleVector(samples);\n/* */ }\n/* 867 */ FeatureManager.prepareCV(samples, nFold, tvs, trainingData, validationData, testData);\n/* */ \n/* */ \n/* 870 */ if (normalize)\n/* */ {\n/* 872 */ for (int j = 0; j < nFold; j++) {\n/* */ \n/* 874 */ normalizeAll(trainingData, features);\n/* 875 */ normalizeAll(validationData, features);\n/* 876 */ normalizeAll(testData, features);\n/* */ } \n/* */ }\n/* */ \n/* 880 */ Ranker ranker = null;\n/* 881 */ double scoreOnTrain = 0.0D;\n/* 882 */ double scoreOnTest = 0.0D;\n/* 883 */ double totalScoreOnTest = 0.0D;\n/* 884 */ int totalTestSampleSize = 0;\n/* */ \n/* 886 */ double[][] scores = new double[nFold][]; int i;\n/* 887 */ for (i = 0; i < nFold; i++) {\n/* 888 */ (new double[2])[0] = 0.0D; (new double[2])[1] = 0.0D; scores[i] = new double[2];\n/* 889 */ } for (i = 0; i < nFold; i++) {\n/* */ \n/* 891 */ List<RankList> train = trainingData.get(i);\n/* 892 */ List<RankList> vali = null;\n/* 893 */ if (tvs > 0.0F)\n/* 894 */ vali = validationData.get(i); \n/* 895 */ List<RankList> test = testData.get(i);\n/* */ \n/* 897 */ RankerTrainer trainer = new RankerTrainer();\n/* 898 */ ranker = trainer.train(this.type, train, vali, features, this.trainScorer);\n/* */ \n/* 900 */ double s2 = evaluate(ranker, test);\n/* 901 */ scoreOnTrain += ranker.getScoreOnTrainingData();\n/* 902 */ scoreOnTest += s2;\n/* 903 */ totalScoreOnTest += s2 * test.size();\n/* 904 */ totalTestSampleSize += test.size();\n/* */ \n/* */ \n/* 907 */ scores[i][0] = ranker.getScoreOnTrainingData();\n/* 908 */ scores[i][1] = s2;\n/* */ \n/* */ \n/* 911 */ if (!modelDir.isEmpty()) {\n/* */ \n/* 913 */ ranker.save(FileUtils.makePathStandard(modelDir) + \"f\" + (i + 1) + \".\" + modelFile);\n/* 914 */ System.out.println(\"Fold-\" + (i + 1) + \" model saved to: \" + modelFile);\n/* */ } \n/* */ } \n/* 917 */ System.out.println(\"Summary:\");\n/* 918 */ System.out.println(this.testScorer.name() + \"\\t| Train\\t| Test\");\n/* 919 */ System.out.println(\"----------------------------------\");\n/* 920 */ for (i = 0; i < nFold; i++)\n/* 921 */ System.out.println(\"Fold \" + (i + 1) + \"\\t| \" + SimpleMath.round(scores[i][0], 4) + \"\\t| \" + SimpleMath.round(scores[i][1], 4) + \"\\t\"); \n/* 922 */ System.out.println(\"----------------------------------\");\n/* 923 */ System.out.println(\"Avg.\\t| \" + SimpleMath.round(scoreOnTrain / nFold, 4) + \"\\t| \" + SimpleMath.round(scoreOnTest / nFold, 4) + \"\\t\");\n/* 924 */ System.out.println(\"----------------------------------\");\n/* 925 */ System.out.println(\"Total\\t| \\t\\t| \" + SimpleMath.round(totalScoreOnTest / totalTestSampleSize, 4) + \"\\t\");\n/* */ }", "public static void main(String[] args) throws Exception {\n // load data\n ArffLoader loader = new ArffLoader();\n loader.setFile(new File(args[0]));\n Instances structure = loader.getStructure();\n\n // train Cobweb\n Cobweb cw = new Cobweb();\n cw.buildClusterer(structure);\n Instance current;\n while ((current = loader.getNextInstance(structure)) != null)\n cw.updateClusterer(current);\n cw.updateFinished();\n\n // output generated model\n System.out.println(cw);\n }", "public void dealapply(int cid) {\n\t\tcomprehensive c=comprehensiveDao.get(comprehensive.class, cid);\r\n\t\tfloat cha=c.getFinal_()-c.getLast();\r\n\t\tcomprehensive_record cRecord=comprehensiveRecordDao.findByStudent(c.getPersonInfo().getStudentid());\r\n\t\tcRecord.setScore(cRecord.getScore()-cha);\r\n\t\tcomprehensiveRecordDao.update(cRecord);\r\n\t\t\r\n\t\tc.setStatus(1);\r\n\t\tcomprehensiveDao.update(c);\r\n\t}", "public void trainBernoulli() {\t\t\n\t\tMap<String, Cluster> trainingDataSet = readFile(trainLabelPath, trainDataPath, \"training\");\n\t\tMap<String, Cluster> testingDataSet = readFile(testLabelPath, testDataPath, \"testing\");\n\n\t\t// do testing, if the predicted class and the gold class is not equal, increment one\n\t\tdouble error = 0;\n\n\t\tdouble documentSize = 0;\n\n\t\tSystem.out.println(\"evaluate the performance\");\n\t\tfor (int testKey = 1; testKey <= 20; testKey++) {\n\t\t\tCluster testingCluster = testingDataSet.get(Integer.toString(testKey));\n\t\t\tSystem.out.println(\"Cluster: \"+testingCluster.toString());\n\n\t\t\tfor (Document document : testingCluster.getDocuments()) {\n\t\t\t\tdocumentSize += 1; \n\t\t\t\tList<Double> classprobability = new ArrayList<Double>();\n\t\t\t\tMap<String, Integer> testDocumentWordCounts = document.getWordCount();\n\n\t\t\t\tfor (int classindex = 1; classindex <= 20; classindex++) {\n\t\t\t\t\t// used for calculating the probability\n\t\t\t\t\tCluster trainCluster = trainingDataSet.get(Integer.toString(classindex));\n\t\t\t\t\t// System.out.println(classindex + \" \" + trainCluster.mClassId);\n\t\t\t\t\tMap<String, Double> bernoulliProbability = trainCluster.bernoulliProbabilities;\n\t\t\t\t\tdouble probability = Math.log(trainCluster.getDocumentSize()/trainDocSize);\n\t\t\t\t\tfor(int index = 1; index <= voc.size(); index++ ){\n\n\t\t\t\t\t\t// judge whether this word is stop word \n\t\t\t\t\t\tboolean isStopwords = englishStopPosition.contains(index);\n\t\t\t\t\t\tif (isStopwords) continue;\n\n\t\t\t\t\t\tboolean contain = testDocumentWordCounts.containsKey(Integer.toString(index));\t\t\t\t\t\t\n\t\t\t\t\t\tif (contain) {\n\t\t\t\t\t\t\tprobability += Math.log(bernoulliProbability.get(Integer.toString(index)));\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tprobability += Math.log(1 - bernoulliProbability.get(Integer.toString(index)));\n\t\t\t\t\t\t}\n\n\t\t\t\t\t}\n\n\t\t\t\t\t// put the probability into the map for the specific class\n\t\t\t\t\tclassprobability.add(probability);\n\t\t\t\t}\n\t\t\t\tObject obj = Collections.max(classprobability);\n\t\t\t\t// System.out.println(classprobability);\n\t\t\t\tString predicte_class1 = obj.toString();\n\t\t\t\t// System.out.println(predicte_class1);\n\t\t\t\t// System.out.println(Double.parseDouble(predicte_class1));\n\t\t\t\tint index = classprobability.indexOf(Double.parseDouble(predicte_class1));\n\t\t\t\t// System.out.println(index);\n\t\t\t\tString predicte_class = Integer.toString(index + 1);\n\n\n\t\t\t\tconfusion_matrix[testKey - 1][index] += 1;\n\n\t\t\t\t// System.out.println(document.docId + \": G, \" + testKey + \"; P: \" + predicte_class);\n\t\t\t\tif (!predicte_class.equals(Integer.toString(testKey))) {\n\t\t\t\t\terror += 1;\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t\tSystem.out.println(\"the error is \" + error + \"; the document size : \" + documentSize);\n\t\t}\n\n\t\tSystem.out.println(\"the error is \" + error + \"; the document size : \" + documentSize + \" precision rate : \" + (1 - error/documentSize));\n\n\t\t// print confusion matrix\n\t\tprintConfusionMatrix(confusion_matrix);\n\t}", "@Override\n\tpublic void covidTreatment() {\n\tSystem.out.println(\"FH--covidTreatment\");\n\t\t\n\t}", "public Prediction apply( double[] confidence );", "public Context(Model<Label> model, List<Prediction<Label>> predictions) {\n super(model, predictions);\n this.cm = new LabelConfusionMatrix(model.getOutputIDInfo(), predictions);\n }", "public Context(SequenceModel<Label> model, List<Prediction<Label>> predictions) {\n super(model, predictions);\n this.cm = new LabelConfusionMatrix(model.getOutputIDInfo(), predictions);\n }", "static void playC45() throws IOException {\n\t\tRealVector[] data = NNDataset.getData(NNDataset.HOME);\n\t\tRealVector[] label = NNDataset.getLabel(NNDataset.HOME);\n\t\tRealMatrix d = MatrixUtils.createRealMatrix(data.length, data[0].getDimension());\n\t\tfor (int i = 0; i < data.length; i++) {\n\t\t\td.setRowVector(i, data[i]);\n\t\t}\n\t\td = d.transpose(); // data = column vector\n\n\t\tRealVector l = MatrixUtils.createRealVector(new double[label.length]);\n\t\tfor (int i = 0; i < l.getDimension(); i++) {\n\t\t\tl.setEntry(i, label[i].getEntry(0));\n\t\t}\n\n\t\tDecisionNode root = training(d, l);\n\t\tString[] header = NNDataset.getHeader(NNDataset.HOME);\n\t\tprintTree(root, header);\n\n\t\tInteger lb = predict(root, data[0]);\n\t\tSystem.out.println(lb);\n\n\t\tdouble ok = MSE(root, data, label);\n\t\tSystem.out.println(\"total hit: \" + ok);\n\t}", "public static void main(String[] args) {\n String pathToTrain = \"train.csv\";\n String pathToTest = \"test.csv\";\n try {\n ArrayList<String> trainSentences = readCSV(pathToTrain);\n trainSentences.remove(0);\n ArrayList<String> testSentences = readCSV(pathToTest);\n testSentences.remove(0);\n\n ArrayList<String[]> trainWords = preprocess(trainSentences);\n NaiveBayesClassifier model = new NaiveBayesClassifier();\n model.fit(trainWords);\n\n ArrayList<String[]> testWords = preprocess(testSentences);\n double accuracy = evaluate(testWords, model);\n model.writeParams(\"params.json\");\n System.out.printf(\"Accuracy of the model is: %.4f%n\", accuracy);\n } catch (FileNotFoundException e) {\n e.printStackTrace();\n }\n }", "public void run() throws Exception {\r\n\r\n\r\n LibSVM svm = new LibSVM();\r\n String svmOptions = \"-S 0 -K 2 -C 8 -G 0\"; //Final result: [1, -7 for saveTrainingDataToFileHybridSampling2 ]\r\n svm.setOptions(weka.core.Utils.splitOptions(svmOptions));\r\n System.out.println(\"SVM Type and Keranl Type= \" + svm.getSVMType() + svm.getKernelType());//1,3 best result 81%\r\n // svm.setNormalize(true);\r\n\r\n\r\n// load training data from .arff file\r\n ConverterUtils.DataSource source = new ConverterUtils.DataSource(\"C:\\\\Users\\\\hp\\\\Desktop\\\\SVM implementation\\\\arffData\\\\balancedTrainingDataUSSMOTE464Random.arff\");\r\n System.out.println(\"\\n\\nLoaded data:\\n\\n\" + source.getDataSet());\r\n Instances dataFiltered = source.getDataSet();\r\n dataFiltered.setClassIndex(0);\r\n\r\n // gridSearch(svm, dataFiltered);\r\n Evaluation evaluation = new Evaluation(dataFiltered);\r\n evaluation.crossValidateModel(svm, dataFiltered, 10, new Random(1));\r\n System.out.println(evaluation.toSummaryString());\r\n System.out.println(evaluation.weightedAreaUnderROC());\r\n double[][] confusionMatrix = evaluation.confusionMatrix();\r\n for (int i = 0; i < 2; i++) {\r\n for (int j = 0; j < 2; j++) {\r\n System.out.print(confusionMatrix[i][j] + \" \");\r\n\r\n }\r\n System.out.println();\r\n }\r\n System.out.println(\"accuracy for crime class= \" + (confusionMatrix[0][0] / (confusionMatrix[0][1] + confusionMatrix[0][0])) * 100 + \"%\");\r\n System.out.println(\"accuracy for other class= \" + (confusionMatrix[1][1] / (confusionMatrix[1][1] + confusionMatrix[1][0])) * 100 + \"%\");\r\n System.out.println(\"accuracy for crime class= \" + evaluation.truePositiveRate(0) + \"%\");\r\n System.out.println(\"accuracy for other class= \" + evaluation.truePositiveRate(1) + \"%\");\r\n\r\n\r\n }", "public static void main(String[] args) {\n\t\tModel model = new Model();\n\t\tController controller = new Controller(model);\n\t\tView view = new View(model);\n\t\t\n\t\t\n\t\tcontroller.changeModel(11);\n\t\tcontroller.changeModel(22);\n\t\tcontroller.changeModel(33);\n\t}", "public static void main(String[] args) \n\tthrows Exception{\n\t\tnew MethylDbToContingencyTable().doMain(args);\n\t}", "public void evaluate() {\r\n Statistics.evaluate(this);\r\n }", "@Override\r\n\tpublic void execute() throws BuildException {\r\n\r\n\t\tif (StringUtils.isBlank(getViewPath())) {\r\n\t\t\tthrow new BuildException(\"'viewpath' must be specified\");\r\n\t\t}\r\n\r\n\t\tSet<String> currentLoadRules = getCurrentLoadRules();\r\n\t\tlog(\"Current load rules: \" + currentLoadRules, Project.MSG_VERBOSE);\r\n\r\n\t\tString bl = determineBaseline();\r\n\t\tCcListBlcompRoots listBlRoots = new CcListBlcompRoots();\r\n\t\tlistBlRoots.setProject(getProject());\r\n\t\tlistBlRoots.setBaseline(bl);\r\n\t\tlistBlRoots.execute();\r\n\t\tlog(\"Required load rules: \" + listBlRoots.getLoadRules(),\r\n\t\t\t\tProject.MSG_VERBOSE);\r\n\t\tSet<String> toAdd = new HashSet<String>();\r\n\t\ttoAdd.addAll(listBlRoots.getLoadRules());\r\n\r\n\t\tString[] split = explicitLoadRules.split(System\r\n\t\t\t\t.getProperty(\"line.separator\"));\r\n\t\tfor (String string : split) {\r\n\t\t\ttoAdd.add(string);\r\n\t\t}\r\n\t\ttoAdd.removeAll(currentLoadRules);\r\n\t\tlog(\"Rules to add to view [\" + viewTag + \"] : \" + toAdd,\r\n\t\t\t\tProject.MSG_DEBUG);\r\n\r\n\t\tCcAddLoadRules addLoadRule = new CcAddLoadRules();\r\n\t\taddLoadRule.setProject(getProject());\r\n\t\taddLoadRule.setViewPath(getViewPath());\r\n\t\taddLoadRule.setOverwrite(true);\r\n\t\tfor (String newRule : toAdd) {\r\n\t\t\tif (!StringUtils.isEmpty(newRule)) {\r\n\t\t\t\taddLoadRule.setLoadRule(newRule);\r\n\t\t\t\taddLoadRule.execute();\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t}", "@Override\n\tpublic void execute() {\n\t\tSystem.out.println(\"==STATISTICS FOR THE RESTAURANT==\");\n\t\tSystem.out.println(\"Most used Ingredients:\");\n\t\tmanager.printIngredients();\n\t\tSystem.out.println(\"Most ordered items:\");\n\t\tmanager.printMenuItems();\n\t\tSystem.out.println(\"==END STATISTICS==\");\n\t}", "private void evaluateProbabilities()\n\t{\n\t}", "public static void run(){\n\t\t\n\t\tMatrix A = null;\n\t\tVector b = null;\n\t\tVector c = null;\n\t\t\n\t\tfor (int n= 3; n<=11; n+=2 )\n\t\t{\n\t\t\tk=n-2;\n\t\t\tA = createConstraint(n, k) ;\n\t\t\tb = create_b(k, 0.5);\n\t\t\tc = create_c(n);\n\t\t\ttable = new SimplexTable(A, b, c, SimplexTable.MODE.EQUALITY);\n\t\t table.solve(); \n\t\t\tp(\"q_n( n=\"+n+\")= \" + (double) table.getMaxValue()); //(Math.round() / 100000);\n\t\t}\n\t\t\n\t}", "public ApplyEffect(SnagliModel model) {\n\t\tApplyEffect.model = model;\n\t}", "public static void CaliculatePRcontr(Configuration conf, long cnt) throws Exception { \n\n\t\t// cntTotal\n\t\tconf.setLong(\"count\", cnt);\n\t\tJob job = new Job(conf, \"ceate matrix\");\n\n\t\tjob.setJarByClass(PageRank.class);\n\t\tjob.setMapperClass(PRcontrMapper.class);\n\t\tjob.setReducerClass(Reducer.class);\n\t\t//\t\tjob.setMapOutputKeyClass(Text.class);\n\t\t//\t\tjob.setMapOutputValueClass(UrlTypeAndPosition.class);\n\t\tjob.setOutputKeyClass(NullWritable.class);\n\t\tjob.setOutputValueClass(Matrix_XY_PRcontribution.class);\n\t\tFileInputFormat.addInputPath(job, new Path(\"createMatrixOutput/part-r-00000\"));\n\t\tFileOutputFormat.setOutputPath(job,new Path(\"createDangMatrixDangOutput\"));\n\t\tMultipleOutputs.addNamedOutput(job, \"MandD\", TextOutputFormat.class, NullWritable.class, Text.class);\n\t\tMultipleOutputs.addNamedOutput(job, \"R\", TextOutputFormat.class, NullWritable.class, Text.class);\n\n\n\n\n\t\tjob.waitForCompletion(true);\n\t}", "@Override\n public CommandResult executePrimitive(Model model, CommandHistory history) throws CommandException {\n int oldXp = model.getXpValue();\n Level oldLevel = model.getLevel();\n\n String completedTasksOutput = completeTasks(model);\n\n // calculate change in xp to report to the user.\n int newXp = model.getXpValue();\n int changeInXp = newXp - oldXp;\n Level newLevel = model.getLevel();\n\n // Comparison with != operator is valid since Level is an enum.\n boolean hasChangeInLevel = newLevel != oldLevel;\n\n return createCommandResult(hasChangeInLevel, newLevel, changeInXp, completedTasksOutput);\n }", "public boolean execute() {\n\t\t\n\t\tfor (int i = 0; i <Network.size(); i++) {\n\t\t\t\n\t\t\tMyNode n = (MyNode)Network.get(i);\n\t\t\t//MyNode n1 = (MyNode) n;\t\t\n \n System.out.println(\"The frobenius_norm at node\"+\"(\"+i+\"):\"+n.frobenius_norm);\n\t\t\tretVal=retVal &&(n.frobenius_norm<=threshold);\n\t\t\tSystem.out.println(retVal);\n }\n if(retVal)\n {\n \t System.out.println(\"ALgorithm Converged...###########################!\");\n \t return myNewSVMCode.end;\n }\n else\t\n {\n\t\treturn false;\n }\n }", "public void runAnalysis ()\n\t{\n\t\tif (isBatchFile()) { runBatch(false); return; }\n\n\t\tfinal String modelText = editor.getText();\n\t\tString iterations = toolbar.getIterations();\n\t\tmodel = Model.compile (modelText, frame);\n\t\tif (model == null) return;\n\t\tTask task = model.getTask();\n\t\tfinal int n = (iterations.equals(\"\")) ? task.analysisIterations()\n\t\t\t\t: Integer.valueOf(iterations);\n\t\t(new SwingWorker<Object,Object>() {\n\t\t\tpublic Object doInBackground() {\n\t\t\t\tif (!core.acquireLock(frame)) return null;\n\t\t\t\tstop = false;\n\t\t\t\tupdate();\n\t\t\t\tclearOutput();\n\t\t\t\toutput (\"> (run-analysis \" + n + \")\\n\");\n\t\t\t\tif (model != null && model.getTask() != null) \n\t\t\t\t{\n\t\t\t\t\tTask[] tasks = new Task[n];\n\t\t\t\t\tfor (int i=0 ; !stop && i<n ; i++)\n\t\t\t\t\t{\n\t\t\t\t\t\tmodel = Model.compile (modelText, frame);\n\t\t\t\t\t\t//brainPanel.setVisible (false);\n\t\t\t\t\t\tshowTask (model.getTask());\n\t\t\t\t\t\tmodel.setParameter (\":real-time\", \"nil\");\n\t\t\t\t\t\tmodel.run();\n\t\t\t\t\t\tmodel.getTask().finish();\n\t\t\t\t\t\ttasks[i] = model.getTask();\n\t\t\t\t\t}\n\t\t\t\t\tif (!stop && model!=null)\n\t\t\t\t\t\tmodel.getTask().analyze (tasks, true);\n\t\t\t\t\t//model = null;\n\t\t\t\t\thideTask();\n\t\t\t\t}\n\t\t\t\tcore.releaseLock (frame);\n\t\t\t\tupdate();\n\t\t\t\treturn null;\n\t\t\t}\n }).execute();\n\t}", "public void evaluate(String sampleFile, String featureDefFile, int nFold, String modelDir, String modelFile) {\n/* 839 */ evaluate(sampleFile, featureDefFile, nFold, -1.0F, modelDir, modelFile);\n/* */ }", "public static void learnCPT(String dataSet, String generatedModel) {\n\t\tSystem.out.println(\"Initializing CPT Learning....\");\n\t\ttry {\n\t\t\tNodeList nodes = net.getNodes();\n\t\t\tint noOfNodes = nodes.size();\n\t\t\t// Removing CPT for all nodes.\n\t\t\tfor (int i = 0; i < noOfNodes; i++) {\n\t\t\t\tNode node = (Node) nodes.get(i);\n\t\t\t\tnode.deleteTables();\n\t\t\t}\n\t\t\tSystem.out.println(\"Using the provided Data Set : \" + dataSet);\n\t\t\t// Reading the data set to learn CPT.\n\t\t\tStreamer caseFile = new Streamer(dataSet);\n\t\t\tnet.reviseCPTsByCaseFile(caseFile, nodes, 1.0);\n\t\t\t// Writing the new model learned using the data set.\n\t\t\tnet.write(new Streamer(generatedModel));\n\t\t\tSystem.out.println(\"Conditional Probability tables learnt succesfully !!\");\n\t\t\tSystem.out.println(\"Generated Bayesian Model stored in : \" + generatedModel);\n\t\t} catch (Exception e) {\n\t\t\te.printStackTrace();\n\t\t}\n\t}", "@SuppressWarnings(\"boxing\")\n\tpublic void conduct(final int num)\n {\n \t\tbudget = num;\t\n\t\t\n\t\t//\tRun the search\n\t\tSystem.out.print(\"\\n\" + name() + \": \");\n\t\tlong startAt = System.currentTimeMillis();\t\n\t\t\n\t\tnumTried = 0;\n\t\tsearch();\t\n\t\t\n\t\tfinal double searchTime = (System.currentTimeMillis() - startAt) / 1000.0;\t\t\t\t\n\t\tSystem.out.printf(\"%d typical examples out of %d tried in %.3fs (%d collisions).\\n\", \n\t\t\t\tnumTypical, numTried, searchTime, master.numCollisions());\n\t\t\n\t\t//\tShow the result\n\t\tfinal Stats stats = new Stats(name());\n\t\tfor (int i = 0; i < master.size(); i++)\n\t\t\tstats.addSample(master.get(i).fitness());\n\t\tstats.measure();\n\t\tstats.show();\n\t\t\n\t\tmaster.measureDiversityCOI();\n }", "public void execute() throws NbaBaseException {\n\t\tboolean isSuccess = false;\t\t\n\t\tif (performingRequirementsEvaluation()) { //SPR2652\n\t\t\tsetPartyID(work); //ACN024\n\t\t\tisSuccess = processRequirementSummary();\n\t\t\tif (!isSuccess) {\t\t\t\t\n\t\t\t\tthrow new NbaVpmsException(NbaVpmsException.VPMS_RESULTS_ERROR + NbaVpmsAdaptor.ACREQUIREMENTSUMMARY);\t//SPR2652\n\t\t\t}\n\t\t}\n\t}", "@Test\n public void test23() throws Throwable {\n TextDirectoryLoader textDirectoryLoader0 = new TextDirectoryLoader();\n Instances instances0 = textDirectoryLoader0.getDataSet();\n Evaluation evaluation0 = new Evaluation(instances0);\n SerializedClassifier serializedClassifier0 = new SerializedClassifier();\n Object[] objectArray0 = new Object[25];\n double[] doubleArray0 = evaluation0.evaluateModel((Classifier) serializedClassifier0, instances0, objectArray0);\n assertEquals(0.0, evaluation0.SFEntropyGain(), 0.01D);\n }", "@Override\n\tpublic final void execute (Map<Key, Object> context) {\n\t\tboolean outcome = makeDecision (context);\n\n\t\tif (outcome) {\n\t\t\tpositiveOutcomeStep.execute (context);\n\t\t} else {\n\t\t\tnegativeOutcomeStep.execute (context);\n\t\t}\n\t}", "public static void main(String[] args) throws Exception {\n\t\tint i;\r\n\t\tint [][]preci_recall = new int [5][6]; \r\n\r\n\t\tNGRAM ngram = new NGRAM();\r\n\t\t\r\n\t\tfor(i=0; i<5; i++) {\r\n\t\t\t\r\n\t\t\tSystem.out.println((i+1) + \" th FOLD IS A TEST SET\");\r\n\t\t\t\r\n\t\t\tdouble[][] test_ngram_features = ngram.feature(i,1);\r\n\t\t\tdouble[][] train_ngram_features = ngram.feature(i,0);\r\n\t\t\t\r\n\t\t\tSystem.out.println(\"NGRAM FEATURES...OK\");\r\n\t\r\n//\t\t\t\r\n//\t\t\tLIWC liwc = new LIWC();\r\n//\t\t\t\r\n//\t\t\tdouble[][] test_liwc_features = liwc.feature(i,1,test_ngram_features.length);\r\n//\t\t\tdouble[][] train_liwc_features = liwc.feature(i,0,train_ngram_features.length);\r\n//\r\n//\t\t\tSystem.out.println(\"LIWC FEATURES..OK\");\r\n//\t\t\t\r\n//\t\t\tCOMBINE combine = new COMBINE();\r\n//\t\t\tdouble[][] train_features = combine.sum(train_liwc_features,train_ngram_features);\r\n//\t\t\tdouble[][] test_features = combine.sum(test_liwc_features,test_ngram_features);\r\n//\t\t\t\r\n//\t\t\tSystem.out.println(\"COMBINE...OK\");\r\n\t\t\r\n\t\t\tSVMLIGHT svmlight = new SVMLIGHT();\r\n\t\t\tpreci_recall[i]=svmlight.calcc(train_ngram_features, test_ngram_features);\r\n\r\n\t\t}\r\n\t\t\r\n//\t 0 : truthful TP\r\n//\t 1 : truthful TP+FP\r\n//\t 2 : truthful TP+FN\r\n//\t 3 : deceptive TP\r\n//\t 4 : deceptive TP+FP\r\n//\t 5 : deceptive TP+FN\r\n\t\t\r\n\t\tint truthful_TP_sum=0,truthful_TPFP_sum=0,truthful_TPFN_sum=0;\r\n\t\tint deceptive_TP_sum=0,deceptive_TPFP_sum=0,deceptive_TPFN_sum=0;\r\n\t\t\r\n\t\tfor(i=0;i<5;i++) {\r\n\t\t\ttruthful_TP_sum+=preci_recall[i][0];\r\n\t\t\ttruthful_TPFP_sum+=preci_recall[i][1];\r\n\t\t\ttruthful_TPFN_sum+=preci_recall[i][2];\r\n\t\t\t\r\n\t\t\tdeceptive_TP_sum+=preci_recall[i][3];\r\n\t\t\tdeceptive_TPFP_sum+=preci_recall[i][4];\r\n\t\t\tdeceptive_TPFN_sum+=preci_recall[i][5];\r\n\t\t}\r\n\t\t\t\t\r\n\t\tSystem.out.println(\"\\n\\nTRUTHFUL_TP_SUM : \" + truthful_TP_sum);\r\n\t\tSystem.out.println(\"TRUTHFUL_TPFP_SUM : \" + truthful_TPFP_sum);\r\n\t\tSystem.out.println(\"TRUTHFUL_TPFN_SUM : \" + truthful_TPFN_sum);\r\n\t\t\r\n\t\tSystem.out.println(\"DECEPTIVE_TP_SUM : \" + deceptive_TP_sum);\r\n\t\tSystem.out.println(\"DECEPTIVE_TPFP_SUM : \" + deceptive_TPFP_sum);\r\n\t\tSystem.out.println(\"DECEPTIVE_TPFN_SUM : \" + deceptive_TPFN_sum);\r\n\t\t\r\n\t\tSystem.out.println(\"\\nTRUTHFUL PRECISION : \" + (double)(truthful_TP_sum)/(double)(truthful_TPFP_sum));\r\n\t\tSystem.out.println(\"TRUTHFUL RECALL : \" + (double)(truthful_TP_sum)/(double)(truthful_TPFN_sum));\r\n\t\t\r\n\t\tSystem.out.println(\"DECEPTIVE PRECISION : \" + (double)(deceptive_TP_sum)/(double)(deceptive_TPFP_sum));\r\n\t\tSystem.out.println(\"DECEPTIVE RECALL : \" + (double)(deceptive_TP_sum)/(double)(deceptive_TPFN_sum));\r\n\t\t\r\n\r\n\t}", "@Test(timeout = 4000)\n public void test100() throws Throwable {\n TextDirectoryLoader textDirectoryLoader0 = new TextDirectoryLoader();\n Instances instances0 = textDirectoryLoader0.getStructure();\n Evaluation evaluation0 = new Evaluation(instances0);\n CostSensitiveClassifier costSensitiveClassifier0 = new CostSensitiveClassifier();\n MockRandom mockRandom0 = new MockRandom(1);\n try { \n evaluation0.crossValidateModel((Classifier) costSensitiveClassifier0, instances0, 2, (Random) mockRandom0, (Object[]) costSensitiveClassifier0.TAGS_MATRIX_SOURCE);\n fail(\"Expecting exception: ClassCastException\");\n \n } catch(ClassCastException e) {\n //\n // weka.core.Tag cannot be cast to weka.classifiers.evaluation.output.prediction.AbstractOutput\n //\n verifyException(\"weka.classifiers.Evaluation\", e);\n }\n }", "@ProcessElement\n public void processElement(ProcessContext ctx) {\n CustomerSales customerSales = ctx.element();\n CustomerSales result = CustomerSales.of(customerSales.getCustomer());\n\n result.getSales().addAll(customerSales.getSales());\n\n // pass through the all sales in pcollection \n // and make aggregated map view { storeName -> max applied discount for the customer }\n //\n ctx.element().getSales().forEach(stx -> {\n\n Optional<RegionalDiscount> discountOpt = Optional.fromNullable(\n ctx.sideInput(discountsView).getOrDefault(stx.currencyCode, null));\n Optional<Store> storeOpt = Optional.fromNullable(\n ctx.sideInput(storesView).getOrDefault(stx.storeId, null));\n\n if (discountOpt.isPresent() && storeOpt.isPresent()) {\n String storeName = storeOpt.get().storeName;\n Double discountPersent = discountOpt.get().persentOfDiscount;\n\n result.getMaxDiscountsPerStoreName().compute(storeName,\n (k, v) -> (v == null || v < discountPersent) ? discountPersent : v);\n\n } else {\n log.warn(\"skipped : integrity data violation {}\", stx);\n }\n });\n\n log.warn(\"{}\", result);\n ctx.output(result);\n\n handledCounter.inc();\n }", "@Override\n\tpublic void evaluar(int resistencia, int capacidad, int velocidad) {\n\t\t\n\t}", "public static void main(String[] args) {\n ExecuteParams executeParams1 = new ExecuteParams();\n ExecuteParams executeParams2 = new ExecuteParams();\n ExecuteParams executeParams30 = new ExecuteParams();\n ExecuteParams executeParams31 = new ExecuteParams();\n ExecuteParams executeParams32 = new ExecuteParams();\n ExecuteParams executeParams33 = new ExecuteParams();\n ExecuteParams executeParams34 = new ExecuteParams();\n ExecuteParams executeParams41 = new ExecuteParams();\n\n //*** PARAMS\n executeParams1.DeviationPredictor_CosineMetric();\n executeParams2.DeviationPredictor_PearsonMetric();\n executeParams30.DeviationPredictor_PearsonSignifianceWeightMetric(1);\n executeParams31.DeviationPredictor_PearsonSignifianceWeightMetric(5);\n executeParams32.DeviationPredictor_PearsonSignifianceWeightMetric(50);\n executeParams33.DeviationPredictor_PearsonSignifianceWeightMetric(100);\n executeParams34.DeviationPredictor_PearsonSignifianceWeightMetric(200);\n executeParams41.DeviationPredictor_JaccardMetric();\n //***\n\n computeOne(executeParams1);\n computeOne(executeParams2);\n computeOne(executeParams30,\"N = 1\");\n computeOne(executeParams31,\"N = 5\");\n computeOne(executeParams32,\"N = 50\");\n computeOne(executeParams33,\"N = 100\");\n computeOne(executeParams34,\"N = 200\");\n computeOne(executeParams41);\n }", "public static void main(String[] args) {\n\t\ttry (InputStream modelInputStream = new FileInputStream(new File(\"en-frograt.bin\"));) {\r\n\r\n\t\t\tString testString = \"Amphibians are animals that dwell in wet environments\";\r\n\t\t\t\r\n\t\t\tDoccatModel documentCategorizationModel = new DoccatModel(modelInputStream);\r\n\t\t\tDocumentCategorizerME documentCategorizer = new \r\n\t\t\tDocumentCategorizerME(documentCategorizationModel);\r\n\t\t\t\r\n\t\t\tdouble[] probabilities = documentCategorizer.categorize(testString);\r\n\t\t\tString bestCategory = documentCategorizer.getBestCategory(probabilities);\r\n\t\t\tSystem.out.println(\"The best fit is: \" + bestCategory);\r\n\t\t\t\r\n\t\t\tfor (int i = 0; i < documentCategorizer.getNumberOfCategories(); i++) {\r\n\t\t\t System.out.printf(\"Category: %-4s - %4.2f\\n\", \r\n\t\t\t documentCategorizer.getCategory(i), probabilities[i]);\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tSystem.out.println(documentCategorizer.getAllResults(probabilities));\r\n\t\t} catch (FileNotFoundException e) {\r\n\t\t // Handle exceptions\r\n\t\t} catch (IOException e) {\r\n\t\t // Handle exceptions\r\n\t\t}\r\n\t}", "public static void main(String[] args) {\n\t\tContext context = new Context(new OperationAdd());\n\t\tSystem.out.println(\"10 + 5 = \" + context.executeStrategy(10, 5));\n\n\t\tcontext = new Context(new OperationSubtract());\n\t\tSystem.out.println(\"10 - 5 = \" + context.executeStrategy(10, 5));\n\n\t\tcontext = new Context(new OperationMultiply());\n\t\tSystem.out.println(\"10 * 5 = \" + context.executeStrategy(10, 5));\n\t}", "private void runForMode() {\n\t\tFXMLLoader loader = new FXMLLoader(Chart.class.getResource(\"Chart.fxml\"));\n try {\n \t\n \tVitalModel myPrivateModel=null;\n \tmyPrivateModel=new VitalModelImpl(dlm, numeric);\n \tVitalSign bothBP=VitalSign.BothBP;\n \tVital vitalForChart=bothBP.addToModel(myPrivateModel);\n \t\n \t\n \tParent node = loader.load();\n Chart chart = loader.getController();\n// Vital[] vitalForChart=new Vital[1];\n// VitalSign bothBP=VitalSign.BothBP;\n// boolean[] found=new boolean[1];\n// //Run through the Vitals in the VitalModel,\n// //and check if the one we want is already in the model.\n// vitalModel.forEach( v-> {\n// \tif(v.getLabel().equals(bothBP.label)) {\n// \t\tfound[0]=true;\n// \t\tvitalForChart[0]=v;\n// \t}\n// });\n// if( ! found[0] ) {\n// \tvitalForChart[0]=bothBP.addToModel(vitalModel);\n// }\n// for(String s : vitalForChart[0].getMetricIds()) {\n// \tSystem.err.println(\"metricid for vitalForChart is \"+s);\n// }\n \n \n long now = System.currentTimeMillis();\n now -= now % 1000;\n dateAxis=new DateAxis(new Date(now - interval), new Date(now));\n// dateAxis.setLowerBound();\n// dateAxis.setUpperBound();\n dateAxis.setAutoRanging(false);\n dateAxis.setAnimated(false);\n \n timeline = new Timeline(new KeyFrame(new Duration(1000.0), this));\n timeline.setCycleCount(Animation.INDEFINITE);\n timeline.play();\n \n \n //chart.setModel(vitalForChart[0], dateAxis);\n chart.setModel(vitalForChart, dateAxis);\n bpGraphBox.getChildren().add(node);\n } catch (Exception e) {\n \te.printStackTrace();\n }\n\t\t//bpGraphBox.getChildren().add();\n Device pump=pumps.getSelectionModel().getSelectedItem();\n NumericFx[] flowRateFromSelectedPump=new NumericFx[1];\n numeric.forEach( n -> {\n \tif( n.getUnique_device_identifier().equals(pump.getUDI()) && n.getMetric_id().equals(FLOW_RATE)) {\n \t\t//This is the flow rate from the pump we want\n \t\tSystem.err.println(\"Found numeric for matching pump\");\n \t\tflowRateFromSelectedPump[0]=n;\n \t}\n });\n \n Device monitor=bpsources.getSelectionModel().getSelectedItem();\n sampleFromSelectedMonitor=new SampleArrayFx[1];\n samples.forEach( s -> {\n \tif(s.getUnique_device_identifier().equals(monitor.getUDI()) && s.getMetric_id().equals(ARTERIAL)) {\n \t\tsampleFromSelectedMonitor[0]=s;\n \t}\n });\n \n lastPumpUpdate.textProperty().bind(Bindings.format(\"Last pump update %s\", flowRateFromSelectedPump[0].presentation_timeProperty()));\n lastBPUpdate.textProperty().bind(Bindings.format(\"Last BP update %s\", sampleFromSelectedMonitor[0].presentation_timeProperty()));\n\t\tif(openRadio.isSelected()) {\n\t\t\t\n\t\t} else {\n\t\t\tclosedLoopAlgo();\n\t\t}\n\t\tAppConfig appConfig=new AppConfig();\n\t\tappConfig.mode=openRadio.isSelected() ? 0 : 1;\n\t\tappConfig.target_sys=(int)targetSystolic.getValue();\n\t\tappConfig.target_dia=(int)targetDiastolic.getValue();\n\t\tappConfig.sys_alarm=(int)systolicAlarm.getValue();\n\t\tappConfig.dia_alarm=(int)diastolicAlarm.getValue();\n\t\tappConfig.bp_udi=monitor.getUDI();\n\t\tappConfig.pump_udi=pump.getUDI();\n\t\tdouble rate=(double)infusionRate.getValue();\n\t\tappConfig.inf_rate=(float)rate;\n\t\tappConfig.writeToDb();\n\t\tstartBPUpdateAlarmThread();\n\t\tstartBPValueMonitor();\n\t}", "DiscountingContext apply(DiscountingContext context);", "public void calculateProbabilities(){\n\t}", "public void applyModel(ScServletData data, Object model)\n {\n }", "public static StatisticsResults statistics(Model model)\n\t{\n\t\tStatisticsResults results = new StatisticsResults();\n\t\t\n\t\t// Size of the model = Number of Statements contained in the model\n\t\tlong nrStatements = model.size();\n\t\tresults.setSize(nrStatements);\n\t\t\n\t\t// Number of Resources in model\n\t\tlong resources = findAllResources(model).size();\n\t\tresults.setResources(resources);\n\t\t\n\t\t// Number of different Resources that appear as Subject in the model\n\t\tlong nrSubjects = model.listSubjects().toList().size();\n\t\tresults.setSubjects(nrSubjects);\n\t\t\n\t\t// Number of different Objects (Resources and Literals)\n\t\tList<RDFNode> objects = model.listObjects().toList();\n\t\tresults.setObjects(objects.size());\n\n\t\t// The above number of Objects does not distinguish between Resources and Literals\n\t\t// Count these Resources and Literals individually\n\t\tint resourceCounter = 0;\t\t// Number of different Resources that appear as Objects\n\t\tint literalCounter = 0;\t\t\t// Number of different Literals that appear as Objects\n\t\tfor(RDFNode o : objects)\n\t\t{\n\t\t\tif(o.isResource())\n\t\t\t{\n\t\t\t\tresourceCounter++;\n\t\t\t}\n\t\t\telse if(o.isLiteral())\n\t\t\t{\n\t\t\t\tliteralCounter++;\n\t\t\t}\n\t\t}\n\t\tresults.setObjectResources(resourceCounter);\n\t\tresults.setLiterals(literalCounter);\n\t\t\n\t\t// Average number of outgoing Links\n\t\tresults.setAvgOutgoingLinks(((double) nrStatements)/nrSubjects);\n\t\t\n\t\t// Above looked at number of different Objects\n\t\t// Now count the total number of Resources as Objects\n\t\t// and total number of Literals as Objects\n\t\t// Count number of different predicates\n\t\tHashSet<Resource> predicates = new HashSet<Resource>();\n\t\tlong nrStatementsWithResourceObject = 0;\n\t\tlong nrStatementsWithLiteralObject = 0;\n//\t\tList<Statement> statements = model.listStatements().toList();\n//\t\tfor(Statement s : statements)\n\t\tStmtIterator statements = model.listStatements();\n\t\twhile(statements.hasNext())\n\t\t{\n\t\t\tStatement s = statements.nextStatement();\n\t\t\tif(s.getObject().isResource())\n\t\t\t{\n\t\t\t\tnrStatementsWithResourceObject++;\n\t\t\t}\n\t\t\telse if(s.getObject().isLiteral())\n\t\t\t{\n\t\t\t\tnrStatementsWithLiteralObject++;\n\t\t\t}\n\t\t\tif(!predicates.contains(s.getPredicate()))\n\t\t\t{\n\t\t\t\tpredicates.add(s.getPredicate());\n\t\t\t}\n\t\t}\n\t\tresults.setAvgIncomingLinks(((double) nrStatementsWithResourceObject)/resourceCounter);\n\t\tresults.setAvgLiterals(((double) nrStatementsWithLiteralObject)/nrSubjects);\n\t\tresults.setAvgObjectResources(((double) nrStatementsWithResourceObject)/nrSubjects);\n\t\tresults.setTotalObjectResources(nrStatementsWithResourceObject);\n\t\tresults.setTotalLiterals(nrStatementsWithLiteralObject);\n\t\tresults.setPredicates(predicates.size());\n\t\t\n\t\t\n\t\t// Calculate min, max, 25%, 50% and 75% quantile for averages\n\t\tLinkedList<Integer> subjectStatementCount = new LinkedList<Integer>();\n\t\tLinkedList<Integer> subjectResObjectCount = new LinkedList<Integer>();\n\t\tLinkedList<Integer> subjectLiteralCount = new LinkedList<Integer>();\n\t\tResIterator subjects = model.listSubjects();\n\t\twhile(subjects.hasNext())\n\t\t{\n\t\t\tResource subject = subjects.nextResource();\n\t\t\tStmtIterator statementsWithSubject = model.listStatements(subject, null, (RDFNode) null);\n\t\t\tint count = 0;\n\t\t\tint countObjectIsResource = 0;\n\t\t\tint countObjectIsLiteral = 0;\n\t\t\twhile(statementsWithSubject.hasNext())\n\t\t\t{\n\t\t\t\tStatement statement = statementsWithSubject.nextStatement();\n\t\t\t\tcount++;\n\t\t\t\tif(statement.getObject().isResource())\n\t\t\t\t{\n\t\t\t\t\tcountObjectIsResource++;\n\t\t\t\t}\n\t\t\t\tif(statement.getObject().isLiteral())\n\t\t\t\t{\n\t\t\t\t\tcountObjectIsLiteral++;\n\t\t\t\t}\n\t\t\t}\n\t\t\tsubjectStatementCount.add(count);\n\t\t\tsubjectResObjectCount.add(countObjectIsResource);\n\t\t\tsubjectLiteralCount.add(countObjectIsLiteral);\n\t\t}\n\t\t\n\t\tsubjectStatementCount = sortIntList(subjectStatementCount);\n\t\tsubjectResObjectCount = sortIntList(subjectResObjectCount);\n\t\tsubjectLiteralCount = sortIntList(subjectLiteralCount);\n\t\t\n\t\tresults.setMinOutgoingLinks(subjectStatementCount.getFirst());\n\t\tresults.setMaxOutgoingLinks(subjectStatementCount.getLast());\n\t\tDouble outLinks25Index = subjectStatementCount.size()*0.25;\n\t\tresults.setOutgoingLinks25(subjectStatementCount.get(outLinks25Index.intValue()));\n\t\tDouble outLinks50Index = subjectStatementCount.size()*0.5;\n\t\tresults.setOutgoingLinks50(subjectStatementCount.get(outLinks50Index.intValue()));\n\t\tDouble outLinks75Index = subjectStatementCount.size()*0.75;\n\t\tresults.setOutgoingLinks75(subjectStatementCount.get(outLinks75Index.intValue()));\n\t\t\n\t\tresults.setMinResObjects(subjectResObjectCount.getFirst());\n\t\tresults.setMaxResObjects(subjectResObjectCount.getLast());\n\t\tDouble resObject25Index = subjectResObjectCount.size()*0.25;\n\t\tresults.setResObjects25(subjectResObjectCount.get(resObject25Index.intValue()));\n\t\tDouble resObject50Index = subjectResObjectCount.size()*0.50;\n\t\tresults.setResObjects50(subjectResObjectCount.get(resObject50Index.intValue()));\n\t\tDouble resObject75Index = subjectResObjectCount.size()*0.75;\n\t\tresults.setResObjects75(subjectResObjectCount.get(resObject75Index.intValue()));\n\t\t\n\t\tresults.setMinLiterals(subjectLiteralCount.getFirst());\n\t\tresults.setMaxLiterals(subjectLiteralCount.getLast());\n\t\tDouble literal25Index = subjectLiteralCount.size()*0.25;\n\t\tresults.setLiterals25(subjectLiteralCount.get(literal25Index.intValue()));\n\t\tDouble literal50Index = subjectLiteralCount.size()*0.50;\n\t\tresults.setLiterals50(subjectLiteralCount.get(literal50Index.intValue()));\n\t\tDouble literal75Index = subjectLiteralCount.size()*0.75;\n\t\tresults.setLiterals75(subjectLiteralCount.get(literal75Index.intValue()));\n\t\t\n\t\tLinkedList<Integer> objectStatementCount = new LinkedList<Integer>();\n\t\tNodeIterator objectsIterator = model.listObjects();\n\t\twhile(objectsIterator.hasNext())\n\t\t{\n\t\t\tRDFNode object = objectsIterator.nextNode();\n\t\t\tif(object.isResource())\n\t\t\t{\n\t\t\t\tobjectStatementCount.add(model.listStatements(null, null, object).toList().size());\n\t\t\t}\n\t\t}\n\t\t\n\t\tobjectStatementCount = sortIntList(objectStatementCount);\n\t\t\n\t\tresults.setMinIncomingLinks(objectStatementCount.getFirst());\n\t\tresults.setMaxIncomingLinks(objectStatementCount.getLast());\n\t\tDouble inLinks25Index = objectStatementCount.size()*0.25;\n\t\tresults.setIncomingLinks25(objectStatementCount.get(inLinks25Index.intValue()));\n\t\tDouble inLinks50Index = objectStatementCount.size()*0.50;\n\t\tresults.setIncomingLinks50(objectStatementCount.get(inLinks50Index.intValue()));\n\t\tDouble inLinks75Index = objectStatementCount.size()*0.75;\n\t\tresults.setIncomingLinks75(objectStatementCount.get(inLinks75Index.intValue()));\n\t\t\n\t\treturn results;\n\t}", "public double checkModel() {\n\treturn (Weights[2] * Unigram.checkModel() + \n\t\tWeights[1] * Bigram.checkModel() +\n\t\tWeights[0] * Trigram.checkModel());\n }", "public void realize(Model model) {\n\n String initMessage = \"\";\n try {\n initMessage = input.readLine();\n } catch (IOException e) {\n System.err.println(e.getMessage());\n }\n if (initMessage.toUpperCase().equals(\"MANUAL\")) {\n manualRealize(model);\n } else {\n cmdRealize(model);\n }\n\n System.out.println(\"closing...\");\n }", "int countByExample(TrainingCourseExample example);", "public static void main(String[] args) throws Exception {\r\n\r\n\t\t\r\n\t\t// prepare\r\n\t\tDiscountPolicy KB = null; // this is the generated interface\r\n\t\tBasicConfigurator.configure();\r\n\r\n\t\t// compile and bind constants referenced in rules\r\n\t\tKnowledgeBaseManager<DiscountPolicy> kbm = new KnowledgeBaseManager<DiscountPolicy>();\r\n\t\tMap<String,Object> bindings = new HashMap<String,Object>();\t\t\r\n\t\tbindings.put(\"goldCustomerDiscount\",new Discount(20,true));\r\n\t\tInputStream scriptSource = GenerateInterface.class.getResourceAsStream(\"/example/nz/org/take/compiler/example1/crm-example.take\");\r\n\t\tKB = kbm.getKnowledgeBase(\r\n\t\t\t\tDiscountPolicy.class, \r\n\t\t\t\tnew ScriptKnowledgeSource(scriptSource),\r\n\t\t\t\tbindings);\r\n\t\t\r\n\t\t// now use the generated classes to query the kb\r\n\t\tCustomer john = new Customer(\"John\");\r\n\t\tjohn.setTurnover(1000);\r\n\t\tResultSet<CustomerDiscount> result = KB.getDiscount(john);\r\n\t System.out.println(\"The discount for John is: \" + result.next().discount);\r\n\t \r\n\t // print rules used\r\n\t System.out.println(\"The following rules have been used to calculate the discount: \");\r\n\t for (DerivationLogEntry e:result.getDerivationLog()) {\r\n\t \tSystem.out.print(e.getCategory());\r\n\t \tSystem.out.print(\" : \");\r\n\t \tSystem.out.println(e.getName());\r\n\t }\r\n\t \r\n\t // query again (first query is slow as kb has to be compiled, like in JSPs), measure time\r\n\t long before = System.currentTimeMillis();\r\n\t result = KB.getDiscount(john);\r\n\t long after = System.currentTimeMillis();\r\n\t System.out.println(\"Second query took \" + (after-before) + \"ms\");\r\n\t \r\n\t System.out.println(\"done\");\r\n\t}", "public static void main(String[] args) throws FileNotFoundException, IOException, InterruptedException {\n ArrayList<Metric> metrics = new ArrayList<Metric>();\n metrics.add(new ELOC());\n metrics.add(new NOPA());\n metrics.add(new NMNOPARAM());\n MyClassifier c1 = new MyClassifier(\"Logistic Regression\");\n c1.setClassifier(new Logistic());\n String type = \"CodeSmellDetection\";\n String smell = \"Large Class\";\n Model model = new Model(\"antModel1\", \"ant\", \"https://github.com/apache/ant.git\", metrics, c1, \"\", type, smell);\n Process process = new Process();\n String periodLength = \"All\";\n String version = \"rel/1.8.3\";\n \n String projectName = model.getProjName();\n process.initGitRepositoryFromFile(scatteringFolderPath + \"/\" + projectName\n + \"/gitRepository.data\");\n try {\n DeveloperTreeManager.calculateDeveloperTrees(process.getGitRepository()\n .getCommits(), periodLength);\n DeveloperFITreeManager.calculateDeveloperTrees(process.getGitRepository()\n .getCommits(), periodLength);\n } catch (Exception ex) {\n Logger.getLogger(TestFile.class.getName()).log(Level.SEVERE, null, ex);\n }\n \n List<Commit> commits = process.getGitRepository().getCommits();\n PeriodManager.calculatePeriods(commits, periodLength);\n List<Period> periods = PeriodManager.getList();\n \n String dirPath = Config.baseDir + projectName + \"/models/\" + model.getName();\n Files.createDirectories(Paths.get(dirPath));\n \n for (Period p : periods) {\n File periodData = new File(dirPath + \"/predictors.csv\");\n PrintWriter pw1 = new PrintWriter(periodData);\n \n String message1 = \"nome,\";\n for(Metric m : metrics) {\n message1 += m.getNome() + \",\";\n }\n message1 += \"isSmell\\n\";\n pw1.write(message1);\n \n //String baseSmellPatch = \"C:/ProgettoTirocinio/dataset/apache-ant-data/apache_1.8.3/Validated\";\n CalculateSmellFiles cs = new CalculateSmellFiles(model.getProjName(), \"Large Class\", \"1.8.1\");\n \n List<FileBean> smellClasses = cs.getSmellClasses();\n \n String projectPath = baseFolderPath + projectName;\n \n Git.gitReset(new File(projectPath));\n Git.clean(new File(projectPath));\n \n List<FileBean> repoFiles = Git.gitList(new File(projectPath), version);\n System.out.println(\"Repo size: \"+repoFiles.size());\n \n \n for (FileBean file : repoFiles) {\n \n if (file.getPath().contains(\".java\")) {\n File workTreeFile = new File(projectPath + \"/\" + file.getPath());\n\n ClassBean classBean = null;\n \n if (workTreeFile.exists()) {\n ArrayList<ClassBean> code = new ArrayList<>();\n ArrayList<ClassBean> classes = ReadSourceCode.readSourceCode(workTreeFile, code);\n \n String body = file.getPath() + \",\";\n if (classes.size() > 0) {\n classBean = classes.get(0);\n\n }\n for(Metric m : metrics) {\n try{\n body += m.getValue(classBean, classes, null, null, null, null) + \",\";\n } catch(NullPointerException e) {\n body += \"0.0,\";\n }\n }\n \n //isSmell\n boolean isSmell = false;\n for(FileBean sm : smellClasses) {\n if(file.getPath().contains(sm.getPath())) {\n System.out.println(\"ok\");\n isSmell = true;\n break;\n }\n }\n \n body = body + isSmell + \"\\n\";\n pw1.write(body); \n }\n }\n }\n Git.gitReset(new File(projectPath));\n pw1.flush();\n }\n \n WekaEvaluator we1 = new WekaEvaluator(baseFolderPath, projectName, new Logistic(), \"Logistic Regression\", model.getName());\n \n ArrayList<Model> models = new ArrayList<Model>();\n \n models.add(model);\n System.out.println(models);\n //create a project\n Project p1 = new Project(\"https://github.com/apache/ant.git\");\n p1.setModels(models);\n p1.setName(\"ant\");\n p1.setVersion(version);\n \n ArrayList<Project> projects;\n //projects.add(p1);\n \n //create a file\n// try {\n// File f = new File(Config.baseDir + \"projects.txt\");\n// FileOutputStream fileOut;\n// if(f.exists()){\n// projects = ProjectHandler.getAllProjects(); \n// Files.delete(Paths.get(Config.baseDir + \"projects.txt\"));\n// //fileOut = new FileOutputStream(f, true);\n// } else {\n// projects = new ArrayList<Project>();\n// Files.createFile(Paths.get(Config.baseDir + \"projects.txt\"));\n// }\n// fileOut = new FileOutputStream(f);\n// projects.add(p1);\n// ObjectOutputStream out = new ObjectOutputStream(fileOut);\n// out.writeObject(projects);\n// out.close();\n// fileOut.close();\n//\n// } catch (FileNotFoundException e) {\n// e.printStackTrace();\n// } catch (IOException e) {\n// e.printStackTrace();\n// }\n// ProjectHandler.setCurrentProject(p1);\n// Project curr = ProjectHandler.getCurrentProject();\n// System.out.println(curr.getGitURL()+\" --- \"+curr.getModels());\n// ArrayList<Project> projectest = ProjectHandler.getAllProjects();\n// for(Project testp : projectest){\n// System.out.println(testp.getModels());\n// }\n }", "public abstract void apply() throws ContradictionException;", "public static void main(String[] args) {\r\n IModel model = new Model();\r\n\r\n model.addShape(\"R\", ShapeType.RECTANGLE, 1, 39, 1, 1, 1, 1, 20, 20, 20);\r\n model.addShape(\"B\", ShapeType.OVAL, 3, 45, 2, 2, 2, 2, 5, 5, 5);\r\n\r\n IMotion motion3 = new ChangeColor(\"R\", 13, 16, 30, 30, 30, 40, 40, 40);\r\n model.addMotion(motion3);\r\n\r\n IMotion motion1 = new ChangeColor(\"R\", 2, 10, 30, 30, 30, 40, 40, 40);\r\n model.addMotion(motion1);\r\n\r\n IMotion motion4 = new Scale(\"R\", 5, 7, 5, 2, 8, 8);\r\n model.addMotion(motion4);\r\n\r\n IMotion motion2 = new ChangeColor(\"R\", 10, 13, 30, 30, 30, 40, 40, 40);\r\n model.addMotion(motion2);\r\n\r\n IMotion motion5 = new ChangeColor(\"R\", 46, 49, 30, 30, 30, 40, 40, 40);\r\n model.addMotion(motion5);\r\n\r\n\r\n System.out.print(model.getState());\r\n\r\n\r\n }", "@Override\r\n\tpublic void compute() {\n\t\t\r\n\t}", "public static void main(String[] args)\n\t{\n\t\talg.ub.predictor.Predictor predictorUB = new alg.ub.predictor.Resnick();\n\t\talg.ub.neighbourhood.Neighbourhood neighbourhoodUB = new ThresholdNeighbourhood(20,0);\n\t\tSimilarityMetric metricUB = new HybridSim(0.4,0.5,0.1);\n\t\t\n\t\t// configure the Item-based CF algorithm - set the predictor, neighbourhood and similarity metric ...\n\t\tPredictor predictorIB = new Resnick();\n\t\tNeighbourhood neighbourhoodIB = new kNearestNeighbourhood(20);\n\t\tSimilarityMetric metricIB = new HybridSim(0.8,0.3,0.1);\n\n\t\t\n\t\t// set the paths and filenames of the item file, train file and test file ...\n\t\tString itemFile = \"ML dataset\" + File.separator + \"u.item\";\n\t\tString trainFile = \"ML dataset\" + File.separator + \"u.train\";\n\t\tString testFile = \"ML dataset\" + File.separator + \"u.test\";\n\t\t\n\t\t// set the path and filename of the output file ...\n\t\tString outputFile = \"results\" + File.separator + \"predictions.txt\";\n\t\t\n\t\t/////////////////////////////////////////////////////////////////////////////////\n\t\t// Evaluates the CF algorithm:\n\t\t// - the RMSE (if actual ratings are available) and coverage are output to screen\n\t\t// - the output file is created\n\t\tDatasetReader reader = new DatasetReader(itemFile, trainFile, testFile);\n\t\t\n\t\tCFAlgorithm hbcf = new HybirdBasedCF(predictorIB, predictorUB, neighbourhoodIB, neighbourhoodUB, metricIB, metricUB, reader);\n\t\tEvaluator eval = new Evaluator(hbcf, reader.getTestData());\n\t\teval.writeResults(outputFile);\n\t\t\n\t\tDouble RMSE = eval.getRMSE();\n\t\tif(RMSE != null) System.out.println(\"RMSE: \" + RMSE);\n\t\t\n\t\tfor(int i = 1; i <= 5; i++)\n\t\t{\n\t\t\tRMSE = eval.getRMSE(i);\n\t\t\tif(RMSE != null) System.out.println(\"RMSE (true rating = \" + i + \"): \" + RMSE);\n\t\t}\n\t\t\n\t\tdouble coverage = eval.getCoverage();\n\t\tSystem.out.println(\"coverage: \" + coverage + \"%\");\n\t}", "int countByExample(CostAccountingStatisticByLineDetailExample example);", "private static float computeScore(GameModel model) {\n\n float score = 0;\n int numEmptyCells = 0;\n for (byte b : model.getGrid()) {\n if (b < 0) {\n numEmptyCells++;\n } else {\n score += 1 << b;\n }\n }\n return score * (1 + numEmptyCells * EMPTY_CELL_SCORE_BONUS);\n }", "public TranslateDPFToAlloyForAnalysis(DSpecification model){\n\t\tthis.model = model;\n\t\tdGraph = model.getDGraph();\n\t}", "public void performAnalysis (Launcher launcher) {\n //Iterates through each class and method the program was supplied with\n for (CtClass<?> classObject : Query.getElements(launcher.getFactory(), new TypeFilter<CtClass<?>>(CtClass.class))) {\n for (CtMethod<?> methodObject : Query.getElements(classObject, new TypeFilter<CtMethod<?>>(CtMethod.class))) {\n //Counts the number of various types of decision points that calculate cyclomatic complexity\n int ifCount = 0, conditionCount = 0, forCount = 0, whileCount = 0, caseCount = 0;\n ifCount = countIfs(methodObject);\n conditionCount = countConditions(methodObject);\n forCount = countFors(methodObject);\n whileCount = countWhiles(methodObject);\n caseCount = countCases(methodObject);\n localresults.put(\"IF\", ifCount);\n localresults.put(\"CONDITIONS\", conditionCount);\n localresults.put(\"FOR\", forCount);\n localresults.put(\"WHILE\", whileCount);\n localresults.put(\"CASE\", caseCount);\n //Totals the values per method and adds them to the hashmap\n int total = ifCount + conditionCount + forCount + whileCount + caseCount;\n total += 1;\n totalCMCValue += total;\n classCMCScores.put(classObject.getQualifiedName()+\".\"+methodObject.getSimpleName(), total);\n }\n }\n }", "@Override\r\n\tpublic void updateCounter(CounterModel cm) {\n\t\thomedao.updateCounter(cm);\r\n\t}", "@Override\r\n\tprotected void compute() {\n\t\t\r\n\t}", "public void launch(DataModel model) {\n //this template simple creates a UndirectedKNNAlgorithm and executes it,\n //replace as needed.\n// UndirectedKNNAlgorithm algorithm = new UndirectedKNNAlgorithm();\n// algorithm.execute();\n \n UndirectedKNNAlgorithm algorithm = new UndirectedKNNAlgorithm(model);\n algorithm.createGUIandRun(UndirectedKNNAlgorithm.ALGORITHM_NAME, \"\"); \n }", "@Test\n public void TestCase1() {\n VariableMap variables = Variables\n .putValue(\"Role\", \"Executive\")\n .putValue(\"BusinessProcess\", \"PTO Request\")\n .putValue(\"DelegationDateRange\", \"2019-04-31T00:00:00\");\n\n DmnDecisionTableResult result = dmnEngine.evaluateDecisionTable(decision, variables);\n\n // Need to establish rule ordering\n assertThat(result.collectEntries(\"result\"))\n .hasSize(2)\n .contains(\"John M\")\n .contains(\"Kerry\");\n }", "@Test\n public void testAnalyseConcealed() {\n System.out.println(\"analyse (hidden case)\");\n\n // Setup test objects\n Environment env = new Environment(new RigidBody(0, 0, 500, 500));\n Collection<Robot> robots = new LinkedList<Robot>();\n Collection<Cup> things = new LinkedList<Cup>();\n\n // Make an impassable rectangle\n RigidBody shape = new RigidBody(0, 25, 20, 15);\n\n env.createNewImpassableTerrain(shape);\n\n // Put a cup on the far side of the rectangle\n things.add(new Cup(10, 60, false));\n\n // Make a robot to hold the sensor and put it on the close side of the rectangle\n SensorTestingRobot robot = new SensorTestingRobot(0, new XPoint(10, 10), 0);\n\n // Set the parameters of the sensor\n double offsetAngle = 0;\n double max = 500;\n\n // Make the sensor\n CupSensor instance = new CupSensor(offsetAngle, max);\n\n instance.setObject(robot);\n\n // Look for cup\n instance.analyse(env, robots, things);\n\n // The cup should not be seen\n assertEquals(false, instance.getOutput());\n }", "static void perform_cmc(String passed){\n\t\tint type = type_of_cmc(passed);\n\t\tswitch(type){\n\t\tcase 1:\n\t\t\tcmc_with_car(passed);\n\t\t\tbreak;\n\t\t}\n\t}", "public int resultRule(Instance inst) {\n\n if (m_test == null || m_test.satisfies(inst)) {\n\treturn m_classification;\n } else {\n\treturn -1;\n }\n }", "public void classify() throws IOException\n {\n TrainingParameters tp = new TrainingParameters();\n tp.put(TrainingParameters.ITERATIONS_PARAM, 100);\n tp.put(TrainingParameters.CUTOFF_PARAM, 0);\n\n DoccatFactory doccatFactory = new DoccatFactory();\n DoccatModel model = DocumentCategorizerME.train(\"en\", new IntentsObjectStream(), tp, doccatFactory);\n\n DocumentCategorizerME categorizerME = new DocumentCategorizerME(model);\n\n try (Scanner scanner = new Scanner(System.in))\n {\n while (true)\n {\n String input = scanner.nextLine();\n if (input.equals(\"exit\"))\n {\n break;\n }\n\n double[] classDistribution = categorizerME.categorize(new String[]{input});\n String predictedCategory =\n Arrays.stream(classDistribution).filter(cd -> cd > 0.5D).count() > 0? categorizerME.getBestCategory(classDistribution): \"I don't understand\";\n System.out.println(String.format(\"Model prediction for '%s' is: '%s'\", input, predictedCategory));\n }\n }\n }", "@Override\n\tpublic abstract Classifier run ();", "public static void main(String[] args) {\n\t\tDiscountPolicy discountPolicy =\n\t\t\tDiscountPolicyFactory.provide();\n\t\tOrder order = new Order();\n\t\t// if not transitive then could not use money as it is nested in our export\n\t\t// could also use var instead money, and ide will help but will raise compilation error\n\t\tMoney afterDiscount = discountPolicy.applyDiscount(order);\n\t\tSystem.out.println(\"After discount: \" + afterDiscount.getAmount());\n\t}", "final CM computeCM(int[/**/][/**/] votes, Chunk[] chks, boolean local, boolean balance) {\n CM cm = new CM();\n int rows = votes.length;\n int validation_rows = 0;\n int cmin = (int) _data.vecs()[_classcol].min();\n\n // Assemble the votes-per-class into predictions & score each row\n\n // Make an empty confusion matrix for this chunk\n cm._matrix = new long[_N][_N];\n float preds[] = new float[_N+1];\n\n float num_trees = _errorsPerTree.length;\n\n // Loop over the rows\n for( int row = 0; row < rows; row++ ) {\n\n // Skip rows with missing response values\n if (chks[_classcol].isNA0(row)) continue;\n\n // The class votes for the i-th row\n int[] vi = votes[row];\n\n // Fill the predictions with the vote counts, keeping the 0th index unchanged\n for( int v=0; v<_N; v++ ) preds[v+1] = vi[v];\n\n float s = doSum(vi);\n if (s == 0) {\n cm._skippedRows++;\n continue;\n }\n\n int result;\n if (balance) {\n float[] scored = toProbs(preds.clone(), doSum(vi));\n double probsum=0;\n for( int c=1; c<scored.length; c++ ) {\n final double original_fraction = _model.priordist()[c-1];\n assert(original_fraction > 0) : \"original fraction should be > 0, but is \" + original_fraction + \": not using enough training data?\";\n final double oversampled_fraction = _model.modeldist()[c-1];\n assert(oversampled_fraction > 0) : \"oversampled fraction should be > 0, but is \" + oversampled_fraction + \": not using enough training data?\";\n assert(!Double.isNaN(scored[c]));\n scored[c] *= original_fraction / oversampled_fraction;\n probsum += scored[c];\n }\n for (int i=1;i<scored.length;++i) scored[i] /= probsum;\n result = ModelUtils.getPrediction(scored, row);\n } else {\n // `result` is the class with the most votes, accounting for ties in the shared logic in ModelUtils\n result = ModelUtils.getPrediction(preds, row);\n }\n\n // Get the class value from the response column for the current row\n int cclass = alignDataIdx((int) chks[_classcol].at80(row) - cmin);\n assert 0 <= cclass && cclass < _N : (\"cclass \" + cclass + \" < \" + _N);\n\n // Ignore rows with zero votes, but still update the sum of squared errors\n if( vi[result]==0 ) {\n cm._skippedRows++;\n if (!local) _sum += doSSECalc(vi, preds, cclass);\n continue;\n }\n\n // Update the confusion matrix\n cm._matrix[cclass][result]++;\n if( result != cclass ) cm._errors++;\n validation_rows++;\n\n // Update the sum of squared errors\n if (!local) _sum += doSSECalc(vi, preds, cclass);\n float sum = doSum(vi);\n\n // Binomial classification -> compute AUC, draw ROC\n if(_N == 2 && !local) {\n float snd = preds[2] / sum;\n for(int i = 0; i < ModelUtils.DEFAULT_THRESHOLDS.length; i++) {\n int p = snd >= ModelUtils.DEFAULT_THRESHOLDS[i] ? 1 : 0;\n _cms[i][cclass][p]++; // Increase matrix\n }\n }\n }\n\n // End of loop over rows, return confusion matrix\n cm._rows=validation_rows;\n return cm;\n }", "protected abstract List<ConfusionMatrix> calcConfusions();", "public SentencepieceProcessor(AssetManager assetManager, String model) {\n Log.i(TAG, \"Checking to see if Sentencepiece native methods are already loaded\");\n try {\n // Hack to see if the native libraries have been loaded.\n nEncode(\"Test\");\n Log.i(TAG, \"Sentencepiece native methods already loaded\");\n } catch (UnsatisfiedLinkError e1) {\n Log.i(TAG, \"Sentencepiece native methods not found, attempting to load via \" + NATIVE_LIB_NAME);\n try {\n System.loadLibrary(NATIVE_LIB_NAME);\n Log.i(TAG, \"Successfully loaded Sentencepiece native methods\");\n } catch (UnsatisfiedLinkError e2) {\n throw new RuntimeException(\n \"Native Sentencepiece methods not found; check that the correct native\"\n + \" libraries are present in the APK.\");\n }\n }\n\n final long startMs = System.currentTimeMillis();\n if (!nLoadModel(assetManager, model)) {\n throw new RuntimeException(\"Failed to load model from \" + model);\n } else {\n final long endMs = System.currentTimeMillis();\n Log.i(TAG, \"Model load took \" + (endMs - startMs) + \"ms\");\n }\n }", "public void run(BeliefNetwork bn, VisualizationController VC)\r\n\t{\r\n\t\tCacheManager.getInstance().reset();\r\n\t\tVC.beginTransaction();\r\n\t\tVC.pushAndApplyOperator(new Annotation(\"LS : Pre Processing\"));\r\n\t\tVC.pushAndApplyOperator(new Delay(\"delay_ls_introduction\", 500));\r\n\t\tCliqueTree CT = new CliqueTree(bn, VC);\r\n\t\tVC.pushAndApplyOperator(new Annotation(\"Organizing\"));\r\n\t\tVC.pushAndApplyOperator(new Delay(\"delay_organize\", 50));\r\n\t\tVC.pushAndApplyOperator(new CallForLayoutPolyTree());\r\n\t\tVC.pushAndApplyOperator(new CodePageSelect(-1));\r\n\t\tVC.pushAndApplyOperator(new Annotation(\"LS : Lambda & Pi Message Passing\"));\r\n\t\tVC.pushAndApplyOperator(new CodePageSelect(6));\r\n\t\tVC.pushAndApplyOperator(new NewColorLegend());\r\n\t\tVC.pushAndApplyOperator(new ColorLegendMap(0,\"No activity\"));\r\n\t\tVC.pushAndApplyOperator(new ColorLegendMap(14,\"lambdaprop\"));\r\n\t\tVC.pushAndApplyOperator(new ColorLegendMap(15,\"setlambdamessage\"));\r\n\t\tVC.pushAndApplyOperator(new ColorLegendMap(16,\"pipropigation\"));\r\n\t\tVC.pushAndApplyOperator(new ColorLegendMap(17,\"setpimessage\"));\r\n\t\tVC.pushAndApplyOperator(new Delay(\"delay_ls_lambdapi\", 500));\r\n\t\tCT.begin();\r\n\t\tVC.pushAndApplyOperator(new CodePageSelect(-1));\r\n\t\tVC.pushAndApplyOperator(new Annotation(\"LS : Marginalization\"));\r\n\t\tVC.pushAndApplyOperator(new NewColorLegend());\r\n\t\tVC.pushAndApplyOperator(new ColorLegendMap(18,\"marginalizing\"));\r\n\t\tVC.pushAndApplyOperator(new ColorLegendMap(19,\"done\"));\r\n\t\tVC.pushAndApplyOperator(new Delay(\"delay_ls_marginalization\", 500));\r\n\t\tmarginals = CT.Marginalize();\r\n\t\tbeliefnodes = CT.getNodes();\r\n\t\tVC.pushAndApplyOperator(new NewColorLegend());\r\n\t\tVC.pushAndApplyOperator(new Annotation(\"LS : Done\"));\r\n\t\tVC.commitTransaction();\r\n\t}", "void run() {\n\t\trunC();\n\t\trunPLMISL();\n\t\trunTolerance();\n\t\trunMatrix();\n\t}", "public static void main(String[] args) throws IOException {\n\t\tMain t = new Main();\n\t\tSystem.out.println(\"The model is trained: \");\n\t\tt.training(enTrainingDir, 0.7);\n\t\tSystem.out.println(\"Check validation in example of \\\"AB\\\":\");\n\t\tt.checkValid(\"AB\");\n\t\tSystem.out.println();\n\t\tSystem.out.println(\"============= unsmoothed models =============================================================================\");\n\t\tSystem.out.print(\"Unigram: \");\n\t\tSystem.out.println(t.uni);\n\t\tSystem.out.print(\"Bigram: \");\n\t\tSystem.out.println(t.bi);\n\t\tSystem.out.print(\"Trigram: \");\n\t\tSystem.out.println(t.tri);\n\t\tSystem.out.println();\n\t\tSystem.out.println(\"============= add-one smoothed models ========================================================================\");\n\t\tSystem.out.println(\"Note: this is only one of smoothed models , not the tuning process. Because there would be too many console lines.\");\n\t\tSystem.out.println(\"Here I take add-k = 0.7 as an example.\");\n\t\tSystem.out.println(\"*************************************************************************************************************\");\n\t\tdouble k = 0.7;\n\t\tt.training(enTrainingDir, 0.7);\n\t\tt.calculateScore(testDir, k, null, null);\n\t\tt.training(esTrainingDir, 0.7);\n\t\tt.calculateScore(testDir, k, null, null);\n\t\tt.training(deTrainingDir, 0.7);\n\t\tt.calculateScore(testDir, k, null, null);\n\t\tSystem.out.println(\"*************************************************************************************************************\");\n\t\tSystem.out.println(\"Then I take the classic add-k = 1.0 as an example.\");\n\t\tSystem.out.println(\"*************************************************************************************************************\");\n\t\tk = 1.0;\n\t\tt.training(enTrainingDir, 0.7);\n\t\tt.calculateScore(testDir, k, null, null);\n\t\tt.training(esTrainingDir, 0.7);\n\t\tt.calculateScore(testDir, k, null, null);\n\t\tt.training(deTrainingDir, 0.7);\n\t\tt.calculateScore(testDir, k, null, null);\n\t\tSystem.out.println();\n\t\tSystem.out.println(\"===== linear interpolation smoothed models ===================================================================\");\n\t\tdouble[] lambdas_tri = new double[] {1.0 / 3, 1.0 / 3, 1.0 / 3};\n\t\tdouble[] lambdas_bi = new double[] {1.0 / 2, 1.0 / 2};\n\t\tSystem.out.println(\"First is equally weighted lambdas: \" + Arrays.toString(lambdas_tri) + \" and \" + Arrays.toString(lambdas_bi));\n\t\tt.training(enTrainingDir, 0.7);\n\t\tt.calculateScore(testDir, 0, lambdas_bi, lambdas_tri);\n\t\tt.training(esTrainingDir, 0.7);\n\t\tt.calculateScore(testDir, 0, lambdas_bi, lambdas_tri);\n\t\tt.training(deTrainingDir, 0.7);\n\t\tt.calculateScore(testDir, 0, lambdas_bi, lambdas_tri);\n\t\tSystem.out.println(\"**************************************************************************************************************\");\n\t\tlambdas_tri = new double[] {0.5, 0.3, 0.2};\n\t\tlambdas_bi = new double[] {0.7, 0.3};\n\t\tSystem.out.println(\"Then is tuned-weighted lambdas: \" + Arrays.toString(lambdas_tri) + \" and \" + Arrays.toString(lambdas_bi));\n\t\tSystem.out.println(\"Again, this is not all the tuning process. Here is only one set of lambdas.\");\n\t\tt.training(enTrainingDir, 0.7);\n\t\tt.calculateScore(testDir, 0, lambdas_bi, lambdas_tri);\n\t\tt.training(esTrainingDir, 0.7);\n\t\tt.calculateScore(testDir, 0, lambdas_bi, lambdas_tri);\n\t\tt.training(deTrainingDir, 0.7);\n\t\tt.calculateScore(testDir, 0, lambdas_bi, lambdas_tri);\n\t\tSystem.out.println();\n\t\tSystem.out.println(\"=================== Generating texts ==========================================================================\");\n\t\tSystem.out.println(\"To save console space, here I generate A to E, five sentences. Feel free to adjust parameters in code.\");\n\t\tSystem.out.println(\"***************************************************************************************************************\");\n\t\tt.training(enTrainingDir, 0.7);\n\t\tSystem.out.println(\"**************** Bi-gram generating ***************************************************************************\");\n\t\tfor (char c = 'A'; c <= 'E'; c++) {\n\t\t\tt.generateWithBigramModel(String.valueOf(c));\n\t\t}\n\t\tSystem.out.println();\n\t\tSystem.out.println();\n\t\tSystem.out.println(\"Not that good huh?\");\n\t\tSystem.out.println(\"**************** Tri-gram generating *************************************************************************\");\n\t\tfor (char c = 'A'; c <= 'E'; c++) {\n\t\t\tt.generateWithBigramModel(String.valueOf(c));\n\t\t}\n\t\tSystem.out.println();\n\t\tSystem.out.println();\n\t\tSystem.out.println(\"...Seems not good as well.\");\n\t}", "public void compute() {}", "public abstract double test(ClassifierData<U> testData);", "private void learn() {\n\t\tupdateValues();\n\t\tif(CFG.isUpdatedPerformanceHistory()){\n\t\t\tupdateHistory();\n\t\t}\n\t\tif(CFG.isEvaluated()) evaluate();\n\t}", "public void executedTask(Task task) { // called by the inference rules\r\n float budget = task.getBudget().singleValue();\r\n float minSilent = parameters.SILENT_LEVEL / 100.0f;\r\n if (budget > minSilent)\r\n report(task.getSentence(), false);\r\n }", "@Test(timeout = 4000)\n public void test102() throws Throwable {\n TestInstances testInstances0 = new TestInstances();\n Instances instances0 = testInstances0.generate(\"\");\n Evaluation evaluation0 = new Evaluation(instances0);\n double[][] doubleArray0 = evaluation0.confusionMatrix();\n assertEquals(0.0, evaluation0.SFEntropyGain(), 0.01);\n assertEquals(2, doubleArray0.length);\n }", "@Test\n\tpublic void runConspicuous(){\n\t\tTestCase tc = new TestCase(\"MateInTwoWithKnightInConspicuousPosition\",\"r2qrk2/1bp1b1pp/p1np4/1p1Q1NB1/4n3/2P5/PP3PPP/RN2R1K1 w - - 0 1\",\"f5h6\");\n\t\tSystem.out.println(\"Running \" + tc.getDescription());\n\t\tSystem.out.println(\"WC# \" + MoveUtil.getMoveCountForTeam(tc.getBoard(), 1));\n\t\tSystem.out.println(\"BC# \" + MoveUtil.getMoveCountForTeam(tc.getBoard(), -1));\n\t\trunUnitTest(tc.getBoard(),tc.getTestAgainstMoves().get(0).getSquare());\n\t}", "protected void execute() {\n \tint POV_value = Robot.m_oi.operator.getPOV();\n \tboolean input = true; \n \t//SmartDashboard.putNumber(\"POV Value\", POV_value);\n\t\tSmartDashboard.putNumber(\"Col Speed\", Robot.ss_Collector.getOutSpeed());\n \tswitch (POV_value){\n \tcase 0:\n \t\tthis.speed = .60;\n \t\tbreak;\n \tcase 45:\n \t\tthis.speed = .50;\n \t\tbreak;\n \tcase 90:\n \t\tthis.speed = .40; \n \t\tbreak;\n \tcase 135:\n \t\tthis.speed = .30;\n \t\tbreak;\n \tcase 180:\n \t\tthis.speed = .20;\n \t\tbreak;\n \tcase 270:\n \t\tthis.speed = .80;\n \t\tbreak;\n \tcase 315: \n \t\tthis.speed = .70;\n \t\tbreak;\n \tdefault:\n \t\tinput = false; \n \t\tbreak;\n \t}\n \t\n \tif (!running && input) {\n\t \trunning = true;\n \t\tthis.c_Drive = new C_CollectorDrive(false, -1, speed);\n \t\tc_Drive.start();\n \t}\n \t\n \telse if (running && !input) {\n \t\trunning = false;\n \t\tthis.c_Drive.cancel();\n \t}\n }", "protected abstract void evaluate(Vector target, List<Vector> predictions);", "protected void applyModel(PhysicalDataModel pdm, IDatabaseAdapter adapter, ITaskCollector collector,\n VersionHistoryService vhs) {\n logger.info(\"Collecting model update tasks\");\n pdm.collect(collector, adapter, this.transactionProvider, vhs);\n\n // FHIR in the hole!\n logger.info(\"Starting model updates\");\n collector.startAndWait();\n\n Collection<ITaskGroup> failedTaskGroups = collector.getFailedTaskGroups();\n if (failedTaskGroups.size() > 0) {\n this.exitStatus = EXIT_RUNTIME_ERROR;\n\n final String failedStr =\n failedTaskGroups.stream().map((tg) -> tg.getTaskId()).collect(Collectors.joining(\",\"));\n logger.severe(\"List of failed task groups: \" + failedStr);\n }\n }", "public int costInline(int thresh, Environment env, Context ctx) {\n return (type.isType(TC_CLASS) ? 12 : 1)\n + left.costInline(thresh, env, ctx)\n + right.costInline(thresh, env, ctx);\n }" ]
[ "0.54773384", "0.5204191", "0.51757", "0.51595354", "0.51477176", "0.51430136", "0.5061346", "0.50024354", "0.4993972", "0.49535257", "0.49182653", "0.48865214", "0.4871379", "0.48653728", "0.48572847", "0.4814977", "0.47972238", "0.47919542", "0.47857824", "0.4775392", "0.47715068", "0.47622254", "0.4762118", "0.47554007", "0.47441995", "0.47440696", "0.47432655", "0.47419286", "0.47398016", "0.47223812", "0.47176266", "0.4712846", "0.4710528", "0.4710353", "0.47090548", "0.47080013", "0.47014725", "0.46997353", "0.4695225", "0.4688795", "0.468804", "0.46845016", "0.46775937", "0.46682584", "0.46654922", "0.46566117", "0.46559677", "0.46555173", "0.46510196", "0.4649703", "0.46486115", "0.4648204", "0.46372914", "0.46358657", "0.46328068", "0.46238062", "0.46174434", "0.46158227", "0.4613752", "0.46077618", "0.45983016", "0.459762", "0.45855793", "0.45835456", "0.45812225", "0.45754454", "0.45715204", "0.4570484", "0.45672154", "0.45655996", "0.4543457", "0.45410132", "0.4536094", "0.45329922", "0.45286626", "0.45253277", "0.45244318", "0.45196182", "0.45189732", "0.45183074", "0.45127025", "0.45126545", "0.45111609", "0.4508256", "0.4504992", "0.44981456", "0.4497779", "0.44974655", "0.4495223", "0.44928", "0.4486304", "0.44846305", "0.44836348", "0.44825557", "0.44719848", "0.4468863", "0.4464888", "0.44633207", "0.44596094", "0.44564527" ]
0.6477637
0
String temp = getFirst();
public void removeFirst() { head = head.next; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public String getFirst(){ return this.first; }", "public String getFirst(){\n return this.first;\n }", "T first();", "public String getFirst() {\n if(first == null) return null;\n return first.data;\n }", "String getFirst(int n);", "public A getFirst() { return first; }", "public StringNode getFirst() {\n return first;\n }", "public T getFirst();", "public T getFirst();", "public int getFirst();", "public T getFirst() {\n return t;\n }", "@Override\r\n\t\tpublic T getFirst() {\n\t\t\treturn pair.getFirst();\r\n\t\t}", "public Object getFirst(){\n return pattern[0];\n }", "public T1 getFirst() {\n\t\treturn first;\n\t}", "public Set<String> getFirst(String A);", "public Object getFirst()\n {\n if(first == null){\n throw new NoSuchElementException();}\n \n \n \n return first.data;\n }", "public StringListIterator first()\n {\n\treturn new StringListIterator(head);\n }", "public String getFirst(int n) {\n return \"\";\n }", "public T getFirst() {\n\treturn _front.getCargo();\n }", "@Override\r\n\tpublic Object first(){\r\n\t\tcheck();\r\n\t\treturn head.value;\r\n\t}", "int getFirstNumber();", "public E getFirst(){\n return head.getNext().getElement();\n }", "public A getName()\n {\n return first;\n }", "public String peek()\n\t{\n\t\tString firstVal;\n\t\tfirstVal = q.peekFirst();\n\t\treturn firstVal;\n\t}", "String getFirstName();", "String getFirstName();", "String getFirstName();", "public void getFirstName() {\n\n\t}", "String first(String collection);", "@Override\r\n\tpublic T first() {\n\t\treturn head.content;\r\n\t}", "public E getFirst();", "String getFirstInt();", "public T getFirst()\n\t{\n\t\treturn head.getData();\n\t}", "@Override\r\n\t\tpublic E getFirst() {\n\t\t\treturn pair.getFirst();\r\n\t\t}", "@Override\r\n\t\tpublic E getFirst() {\n\t\t\treturn pair.getFirst();\r\n\t\t}", "public JspElement getFirst() {\r\n\treturn _first;\r\n}", "public Object getFirst() {\n if (first == null)\n return null;\n return first.getInfo();\n }", "public Object getFirst()\n {\n if (first == null)\n {\n throw new NoSuchElementException();\n }\n else\n return first.getValue();\n }", "public int getFirst() {\n return first;\n }", "public Item getFirst();", "public double getFirst()\n {\n return first;\n }", "public K getFirst() {\r\n\t\treturn first;\r\n\t}", "@Override\r\n\t\tpublic T getFirst() {\n\t\t\tsynchronized (mutex) {\r\n\t\t\t\treturn pair.getFirst();\r\n\t\t\t}\r\n\t\t}", "public T getFirst()\n\t{\n\t\treturn getFirstNode().getData();\n\t}", "public E getFirst() {\n return peek();\n }", "public E first() {\n\r\n if (head == null) {\r\n return null;\r\n } else {\r\n return head.getItem();\r\n }\r\n\r\n }", "public A first() {\n return first;\n }", "java.lang.String getFirstName();", "java.lang.String getFirstName();", "public static String getFirstName() {\n String firstName = \"George\";\n String lastName = \"Washington\";\n return lastName;\n }", "public Node getFirst()\n {\n return this.first;\n }", "public String getFirstName() {\n\t\t System.out.println(\"method getFirstName() called.\");\n\t\t return firstName;\n\t\t}", "public int getFirst() {\n\t\treturn first;\n\t}", "private String getFirstPlayer() {\n\t\treturn firstPlayer;\n\t}", "String getFirstIndex();", "public String getFirstname() {\n return (String) get(\"firstname\");\n }", "public Object firstElement();", "Node getFirst() {\n return this.first;\n }", "public String front()\n {\n\treturn head.value;\n }", "public T first() {\n \t\n \tT firstData = (T) this.front.data;\n \t\n \treturn firstData;\n \t\n }", "public F first() {\n return this.first;\n }", "@NotNull\n public F getFirst() {\n return first;\n }", "public process get_first() {\n\t\treturn queue.getFirst();\n\t}", "@Override\n public final char first() {\n if (upper == lower) {\n return DONE;\n }\n return text.charAt(index = lower);\n }", "public Node<T> getFirst() {\r\n\t\treturn first;\r\n\t}", "Optional<String> getFirstname();", "public java.lang.String getFirstName();", "static String getFirstName() {\n\t\tScanner s = new Scanner(System.in);\n\t\tSystem.out.print(\"Enter first name: \");\n\t\tString fn = s.nextLine();\n\t\treturn fn;\n\t}", "public double getFirst() {\n return first;\n }", "public String getFirstName(){\n return(this.firstName);\n }", "public E getFirst() {\n\t\t// Bitte fertig ausprogrammieren:\n\t\treturn null;\n\t}", "public float getFirstNumber(){\n return firstNumber;\n }", "public T getFirst() {\n return this.getHelper(this.indexCorrespondingToTheFirstElement).data;\n }", "public T getSecond() {\n return second;\n }", "public Object getFirst() {\n\t\tcurrent = start;\n\t\treturn start == null ? null : start.item;\n\t}", "Object getTemp(String name);", "public String getFirst(int n) {\n if (n > 0) {\n return this.first.concat(this.rest.getFirst(n - 1)); \n }\n \n else {\n return \"\"; \n }\n }", "public String removeFirst() {\n\t\treturn removeAt(0);\n\t}", "public Object getFirstObject()\n {\n \tcurrentObject = firstObject;\n\n if (firstObject == null)\n \treturn null;\n else\n \treturn AL.get(0);\n }", "public int front() {\n return data[first];\n }", "public java.lang.String getFirstNm() {\n return firstNm;\n }", "@Override\n public Persona First() {\n return array.get(0);\n }", "public String getFirst () {\n lengthMutex.lock ();\n try\n {\n while (length == 0)\n empty.await ();\n }\n catch (Exception e)\n {}\n finally\n {\n lengthMutex.unlock ();\n }\n\n String result = null;\n for (int i=9; i>-1; i--)\n {\n qLock[i].lock ();\n result = q[i].pollFirst ();\n qLock[i].unlock ();\n if (result != null)\n {\n length--;\n break;\n }\n }\n if (result == null)\n {\n // System.out.println (\"pooop\");\n System.exit (1);\n }\n\n lengthMutex.lock ();\n full.signal ();\n lengthMutex.unlock ();\n\n return result;\n }", "public String first() {\n\t\t\n\t\treturn \"\\n#1: \" + contacts[0].toString();\n\t}", "public String getFirstName();", "public O first()\r\n {\r\n if (isEmpty()) return null; \r\n return first.getObject();\r\n }", "public T getHead() {\n return get(0);\n }", "@Override\r\n\tpublic E getFirst() {\n\t\treturn null;\r\n\t}", "Object getTemp(String name, Object def);", "public synchronized String getFirstName()\r\n {\r\n return firstName;\r\n }", "public static String peek(){\n String take = list.get((list.size())-1);\n return take;\n }", "public ListNode getFirstNode(){\n\t\treturn firstNode;\n\t}", "public node getFirst() {\n\t\treturn head;\n\t\t//OR\n\t\t//getAt(0);\n\t}", "K first();", "@Override\n\tpublic java.lang.String getFirstName() {\n\t\treturn _candidate.getFirstName();\n\t}", "public Node getFirst() {\r\n\t\treturn getNode(1);\r\n\t}", "@Override\r\n\t\tpublic final E getFirst() {\n\t\t\treturn null;\r\n\t\t}", "private String getFirstName() {\n System.out.println(\"Enter Your Last Name Of First Letter In Capital \");\n return sc.next();\n }", "String get();", "String get();", "public java.lang.Integer getFirstResult()\r\n {\r\n return this.firstResult;\r\n }" ]
[ "0.77700585", "0.73821", "0.6591448", "0.65424514", "0.6533221", "0.64792764", "0.6468445", "0.645474", "0.645474", "0.64286923", "0.6357373", "0.63384455", "0.6291034", "0.6269026", "0.6252248", "0.62241024", "0.61976767", "0.61943287", "0.6186462", "0.61448103", "0.6141715", "0.6054076", "0.60531485", "0.6032022", "0.60045993", "0.60045993", "0.60045993", "0.59942573", "0.598514", "0.5982431", "0.597969", "0.5976062", "0.5971437", "0.59581375", "0.59581375", "0.59420335", "0.591235", "0.5911424", "0.5881043", "0.5865992", "0.58630055", "0.5852657", "0.5852599", "0.58525145", "0.5846329", "0.58316964", "0.5808269", "0.58073777", "0.58073777", "0.5802218", "0.57909715", "0.57880294", "0.5783712", "0.57767266", "0.57761043", "0.5772372", "0.57722676", "0.57711715", "0.57530165", "0.574637", "0.5721581", "0.5715257", "0.571161", "0.5711171", "0.57095057", "0.5699311", "0.5693078", "0.569136", "0.5678138", "0.5675266", "0.5658605", "0.5656256", "0.56557065", "0.56510794", "0.56476194", "0.5601577", "0.55958456", "0.55901617", "0.5589134", "0.5583606", "0.55800056", "0.55714655", "0.5547108", "0.5542439", "0.5536991", "0.5529378", "0.5514808", "0.5506281", "0.5505601", "0.5505402", "0.5496952", "0.5489378", "0.54881305", "0.5482203", "0.5472717", "0.54658896", "0.5463778", "0.54617196", "0.54547954", "0.54547954", "0.54451466" ]
0.0
-1
Function to print results to final document.
public static void usePrintWriter(String fileName, int size, String[] stable) throws IOException { FileWriter fileWriter = new FileWriter(fileName); PrintWriter printWriter = new PrintWriter(fileWriter); for(int i = 0; i < size; i++) { int man = i + 1; int woman = Integer.parseInt(stable[i]) + 1; printWriter.println(man + " " + woman); } printWriter.close(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void printToStdout() {\n\t\tfor (int i = 0; i < results.size(); i++) {\n\t\t\tSystem.out.println(results.get(i).toString());\n\t\t}\n\t}", "public void printResults() {\n\t System.out.println(\"BP\\tBR\\tBF\\tWP\\tWR\\tWF\");\n\t System.out.print(NF.format(boundaryPrecision) + \"\\t\" + NF.format(boundaryRecall) + \"\\t\" + NF.format(boundaryF1()) + \"\\t\");\n\t System.out.print(NF.format(chunkPrecision) + \"\\t\" + NF.format(chunkRecall) + \"\\t\" + NF.format(chunkF1()));\n\t System.out.println();\n }", "public static void printResults() {\n System.out.println(\" Results: \");\n Crawler.getKeyWordsHits().forEach((keyWord, hitsNumber) -> System.out.println(keyWord + \" : \" + hitsNumber + \";\"));\n System.out.println(\" Total hits: \" + Crawler.getTotalHits());\n\n }", "public void print(Results result){\n\t\tprintInOrder(result,root);\n\t}", "private void printResults() {\n\t\tfor (Test test : tests) {\n\t\t\ttest.printResults();\n\t\t}\n\t}", "private void outputResults()\n{\n try {\n PrintWriter pw = new PrintWriter(new FileWriter(output_file));\n pw.println(total_documents);\n for (Map.Entry<String,Integer> ent : document_counts.entrySet()) {\n String wd = ent.getKey();\n int ct = ent.getValue();\n pw.println(ct + \" \" + wd);\n }\n pw.println(START_KGRAMS);\n pw.println(total_kdocuments);\n for (Map.Entry<String,Integer> ent : kgram_counts.entrySet()) {\n String wd = ent.getKey();\n int ct = ent.getValue();\n pw.println(ct + \" \" + wd);\n } \n pw.close();\n }\n catch (IOException e) {\n IvyLog.logE(\"SWIFT\",\"Problem generating output\",e);\n }\n}", "private static void printResult(int num, Pair<String,Double> document, String path, String query) throws IOException {\r\n\r\n FileReader r = new FileReader(new File(path+\"/\"+document.getFirst().replace(\".txt\",\".html\")));\r\n BufferedReader br = new BufferedReader(r);\r\n\r\n String line;\r\n String text = \"\";\r\n while ( (line=br.readLine()) != null) {\r\n text += line;\r\n }\r\n\r\n Document html = Jsoup.parse(text);\r\n\r\n System.out.printf(\"Document #%d.\\n\", num);\r\n if (document.getSecond().isNaN()) System.out.printf(\"\\tSimilarity: Not avaiable\\n\");\r\n else System.out.printf(\"\\tSimilarity: %s %% \\n\",document.getSecond()*100);\r\n\r\n\r\n System.out.printf(\"\\tTitle: %s\\n\",html.title());\r\n\r\n System.out.println();\r\n\r\n System.out.printf(\"\\tSentence: %s\\n\", lookForSentenceWhichContains(query.split(\"\\\\s\"),\"documents/\"+document.getFirst().replace(\".txt\",\".html\")));\r\n\r\n }", "public void dump() {\n for(Object object : results) {\n System.out.println( object );\n }\n }", "public void printResults() {\n getUtl().getOutput().add(\"~~ Results ~~\\n\");\n for (int i = 0; i < getHeroes().size(); i++) {\n if (getHeroes().get(i).isDead()) {\n getUtl().getOutput().add(getHeroes().get(i).getName().\n toCharArray()[0] + \" dead\\n\");\n } else {\n getUtl().getOutput().add(getHeroes().get(i).getName().\n toCharArray()[0] + \" \"\n + getHeroes().get(i).getLevel() + \" \"\n + getHeroes().get(i).getXp() + \" \"\n + getHeroes().get(i).getHp() + \" \"\n + getHeroes().get(i).getPosX() + \" \"\n + getHeroes().get(i).getPosY() + \"\\n\");\n }\n }\n // Write output to given outputPath.\n getGameFileWriter().write(getUtl().getOutput());\n for (int i = 0; i < getUtl().getOutput().size(); i++) {\n // Write output to console as well.\n System.out.print(getUtl().getOutput().get(i));\n }\n }", "public String printResult() {\n\t\tStringBuilder sb = new StringBuilder();\n\n\t\tsb.append(printStartNumberAndName() + \"; \");\n\t\tsb.append(printInfo());\n\n\t\tsb.append(printTotalTime() + \"; \");\n\n\t\tsb.append(getStartTime() + \"; \");\n\t\tsb.append(getFinishTime());\n\t\n\t\tsb.append(errorHandler.print());\n\t\t\n\t\treturn sb.toString();\n\t}", "public void print() {\r\n\t\tSystem.out.print(getUID());\r\n\t\tSystem.out.print(getTITLE());\r\n\t\tSystem.out.print(getNOOFCOPIES());\r\n\t}", "public void print() {\n\t\tSystem.out.println(word0 + \" \" + word1 + \" \" + similarity);\n\t}", "public void printer() throws Exception{\n File outputFile = new File(\"output.txt\");\n FileOutputStream is = new FileOutputStream(outputFile);\n OutputStreamWriter osw = new OutputStreamWriter(is);\n Writer w = new BufferedWriter(osw);\n w.write(this.result());\n w.close();\n }", "public static void printResult(Vector<String> overallResult) {\n\t\tfor (int i = 0; i < overallResult.size(); i++) {\n\t\t\tSystem.out.println(overallResult.get(i));\n\t\t}\n\t}", "private void printAll() {\n int numberToPrint = searchResultsTable.getItems().size();\n\n FXMLCustomerController printController = new FXMLCustomerController();\n printController = (FXMLCustomerController) printController.load();\n printController.setUpPrint(numberToPrint);\n\n if (printController.okToPrint()) {\n System.out.println(\"Printing\");\n printController.getStage().show();\n for (SearchRowItem eachItem : searchResultsTable.getItems()) {\n printController.setCustomerDetails(eachItem);\n printController.print();\n System.out.println(\"Printed : \" + eachItem.toString());\n }\n printController.endPrint();\n //printController.getStage().hide();\n }\n }", "public void printAll() {\r\n\t\t\t\t\r\n\t\tSystem.out.println(\"################\");\r\n\t\tSystem.out.println(\"Filename:\" +getFileName());\r\n\t\tSystem.out.println(\"Creation Date:\" +getCreationDate());\r\n\t\tSystem.out.println(\"Genre:\" +getGenre());\r\n\t\tSystem.out.println(\"Month:\" +getMonth());\r\n\t\tSystem.out.println(\"Plot:\" +getPlot());\r\n\t\tSystem.out.println(\"New Folder Name:\" + getNewFolder());\r\n\t\tSystem.out.println(\"New Thumbnail File Name:\" +getNewThumbnailName());\r\n\t\tSystem.out.println(\"New File Name:\" +getNewFilename());\r\n\t\tSystem.out.println(\"Season:\" +getSeason());\r\n\t\tSystem.out.println(\"Episode:\" +getEpisode());\r\n\t\tSystem.out.println(\"Selected:\" +getSelectEdit());\r\n\t\tSystem.out.println(\"Title:\" +getTitle());\r\n\t\tSystem.out.println(\"Year:\" +getYear());\r\n\t\tSystem.out.println(\"Remarks:\" +getRemarks());\r\n\t\tSystem.out.println(\"################\");\r\n\t\t\r\n\t\t\r\n\t\t\r\n\t\t\r\n\t\t\r\n\t}", "public void writeDocumentToOutput() {\n log.debug(\"Statemend of XML document...\");\r\n // writeDocumentToOutput(root,0);\r\n log.debug(\"... end of statement\");\r\n }", "@Override\r\n\tpublic void printResult() {\n\t\tfor(Integer i:numbers)\r\n\t\t{\r\n\t\t\tSystem.out.println(i+\" \");\r\n\t\t}\r\n\t\t\r\n\t}", "public void printResults(String queryID, final PrintWriter pw,\n\t\t\tfinal TopDocCollector collector) {\n\t\t\n\t\tTopDocs topDocs = collector.topDocs();\n\t\tint len = topDocs.totalHits;\n\n\t\tint maximum = Math.min(topDocs.scoreDocs.length, end);\n\t\t// if (minimum > set.getResultSize())\n\t\t// minimum = set.getResultSize();\n\t\tfinal String iteration = ITERATION + \"0\";\n\t\tfinal String queryIdExpanded = queryID + \" \" + iteration + \" \";\n\t\tfinal String methodExpanded = \" \" + runName\n\t\t\t\t+ ApplicationSetup.EOL;\n\t\tStringBuilder sbuffer = new StringBuilder();\n\t\t// the results are ordered in descending order\n\t\t// with respect to the score.\n\t\t\n\t\tint limit = 1000;\n\t\tint counter = 0;\n\t\t\n\t\tfor (int i = start; i < maximum && counter < limit; i++) {\n\t\t\tint docid = topDocs.scoreDocs[i].doc;\n\t\t\tString filename = \"\" + docid;\n\t\t\tfloat score = topDocs.scoreDocs[i].score;\n\n//\t\t\tif (filename != null && !filename.equals(filename.trim())) {\n//\t\t\t\tif (logger.isDebugEnabled())\n//\t\t\t\t\tlogger.debug(\"orginal doc name not trimmed: |\"\n//\t\t\t\t\t\t\t+ filename + \"|\");\n//\t\t\t} else if (filename == null) {\n//\t\t\t\tlogger.error(\"inner docid does not exist: \" + docid\n//\t\t\t\t\t\t+ \", score:\" + score);\n//\t\t\t\tif (docid > 0) {\n//\t\t\t\t\ttry {\n//\t\t\t\t\t\tlogger.error(\"previous docno: \"\n//\t\t\t\t\t\t\t\t+ this.searcher.doc(docid - 1).toString());\n//\t\t\t\t\t} catch (Exception e) {\n//\t\t\t\t\t\te.printStackTrace();\n//\t\t\t\t\t}\n//\t\t\t\t}\n//\t\t\t\tcontinue;\n//\t\t\t}\n\t\t\t\n\t\t\tsbuffer.append(queryIdExpanded);\n\t\t\tsbuffer.append(filename);\n\t\t\tsbuffer.append(\" \");\n\t\t\tsbuffer.append(counter);\n\t\t\tsbuffer.append(\" \");\n\t\t\tsbuffer.append(score);\n\t\t\tsbuffer.append(methodExpanded);\n\t\t\tcounter++;\n\n\t\t}\n\t\tpw.write(sbuffer.toString());\n\t}", "public void printResults(String fileName) {\n\t\ttry {\n\t\t\tPrintWriter writer = new PrintWriter(fileName, \"UTF-8\");\n\t\t\tfor (int i = 0; i < results.size(); i++) {\n\t\t\t\twriter.println(results.get(i).toString());\n\t\t\t}\n\n\t\t\twriter.close();\n\t\t} catch (IOException e) {\n\t\t\te.printStackTrace();\n\t\t\tSystem.err.println(\"Error while writing to output file\");\n\t\t} finally {\n\t\t\t/*try {\n\t\t\t\twriter.close();\n\t\t\t} catch (IOException e) {\n\t\t\t\te.printStackTrace();\n\t\t\t\tSystem.err.println(\"Error while reading input file\");\n\t\t\t}*/\n\t\t}\t\t\n\t}", "public void print()\n {\n System.out.println(\"Course: \" + title + \" \" + codeNumber);\n \n module1.print();\n module2.print();\n module3.print();\n module4.print();\n \n System.out.println(\"Final mark: \" + finalMark + \".\");\n }", "public void displayResults() {\r\n Preferences.debug(\" ******* FitMultiExponential ********* \\n\\n\", Preferences.DEBUG_ALGORITHM);\r\n dumpTestResults();\r\n }", "private void printResults() {\n\t\tdouble percentCorrect = (double)(correctAnswers/numberAmt) * 100;\n\t\tSystem.out.println(\"Amount of number memorized: \" + numberAmt +\n\t\t\t\t \"\\n\" + \"Amount correctly answered: \" + correctAnswers +\n\t\t\t\t \"\\n\" + \"Percent correct: \" + (int)percentCorrect);\n\t}", "public void print() {\n\t\tPrinter.print(doPrint());\n\t}", "void printReport();", "@Override\n public void show(ResultComponent results) throws TrecEvalOOException {\n System.out.println(\"************************************************\");\n System.out.println(\"*************** Topic \" + topicId + \" output ****************\");\n System.out.println(\"************************************************\");\n\n if (results.getType() == ResultComponent.Type.GENERAL) {\n\n for (ResultComponent runResult : results.getResults()) {\n\n List<Result> resultList = runResult.getResultsByIdTopic(topicId);\n\n System.out.println(\"\\nResults for run: \" + runResult.getRunName());\n if (resultList.isEmpty()) {\n System.out.println(\"No results for topic \" + topicId);\n }\n\n for (Result result : resultList) {\n System.out.print(result.toString());\n }\n }\n }\n }", "private void doPrint() {\n PrintManager printManager = (PrintManager) this\n .getSystemService(Context.PRINT_SERVICE);\n\n // Set job name, which will be displayed in the print queue\n String jobName = this.getString(R.string.app_name) + \" Document\";\n\n // Start a print job, passing in a PrintDocumentAdapter implementation\n // to handle the generation of a print document\n printManager.print(jobName, new MyPrintDocumentAdapter(this),\n null); //\n }", "public void printAll()\n {\n r.showAll();\n }", "@Override\n\t\t\tpublic void print() {\n\t\t\t\t\n\t\t\t}", "@Override\n\t\tpublic void print() {\n\n\t\t}", "public void searchAndWriteQueryResultsToOutput() {\n\n List<String> queryList = fu.textFileToList(QUERY_FILE_PATH);\n\n for (int queryID = 0; queryID < queryList.size(); queryID++) {\n String query = queryList.get(queryID);\n // ===================================================\n // 4. Sort the documents by the BM25 scores.\n // ===================================================\n HashMap<String, Double> docScore = search(query);\n List<Map.Entry<String, Double>> rankedDocList =\n new LinkedList<Map.Entry<String, Double>>(docScore.entrySet());\n Collections.sort(rankedDocList, new MapComparatorByValues());\n\n // ===================================================\n // 5. Write Query Results to output\n // =================================================== \n String outputFilePath =\n RANKING_RESULTS_PATH + \"queryID_\" + (queryID + 1) + \".txt\";\n StringBuilder toOutput = new StringBuilder();\n // display results in console\n System.out.println(\"Found \" + docScore.size() + \" hits.\");\n int i = 0;\n for (Entry<String, Double> scoreEntry : rankedDocList) {\n if (i >= NUM_OF_RESULTS_TO_RETURN)\n break;\n String docId = scoreEntry.getKey();\n Double score = scoreEntry.getValue();\n String resultLine =\n (queryID + 1) + \" Q0 \" + docId + \" \" + (i + 1) + \" \" + score + \" BM25\";\n toOutput.append(resultLine);\n toOutput.append(System.getProperty(\"line.separator\"));\n System.out.println(resultLine);\n i++;\n }\n fu.writeStringToFile(toOutput.toString(), outputFilePath);\n }\n }", "public void printResults(){\n\t\tSystem.out.println(\"The area of the triangle is \" + findArea());\n\t\tSystem.out.println(\"The perimeter of the triangle is \"+ findPerimeter());}", "private void print() {\n printInputMessage();\n printFrequencyTable();\n printCodeTable();\n printEncodedMessage();\n }", "private void printReport() {\n\t\tSystem.out.println(getReport());\n\t}", "private void writeResults() {\n\t\tgetContext().writeName(\"searchResults\");\n\t // Open the Array of affectedParties\n\t TypeContext itemTypeContext = getContext().writeOpenArray();\n\t \n\t for(Person person : results){\n\t\t\t// Add a comma after each affectedParty object is written\n if (!itemTypeContext.isFirst()){\n \tgetContext().writeComma();\n }\n itemTypeContext.setFirst(false);\n\t\t\t\n // Open the affectedParty object and write the fields\n\t\t\tgetContext().writeOpenObject();\n\t\t\t\n\t\t\t// Write out the fields\n\t\t getContext().writeName(\"id\");\n\t\t getContext().transform(person.getId());\n\t\t getContext().writeComma();\n\t\t \n\t\t getContext().writeName(\"name\");\n\t\t getContext().transform(person.getName());\n\t\t getContext().writeComma();\n\n\t\t getContext().writeName(\"sex\");\n\t\t getContext().transform(person.getSex());\n\t\t getContext().writeComma();\n\t\t \n\t\t getContext().writeName(\"dob\");\n\t\t getContext().transform(person.getDob() == null?null:new SimpleDateFormat(\"dd/MM/yyyy\").format(person.getDob()));\n\t\t getContext().writeComma();\n\t\t \n\t\t getContext().writeName(\"dod\");\n\t\t getContext().transform(person.getDod() == null?null:new SimpleDateFormat(\"dd/MM/yyyy\").format(person.getDod()));\n\t\t getContext().writeComma();\n\t\t \n\t\t getContext().writeName(\"placeOfBirth\");\n\t\t getContext().transform(person.getPlaceOfBirth());\n\t\t getContext().writeComma();\n\t\t \n\t\t getContext().writeName(\"placeOfDeath\");\n\t\t getContext().transform(person.getPlaceOfDeath());\n\t\t getContext().writeComma();\n \t getContext().writeName(\"href\");\n \t getContext().transform(url + \"/\" + person.getId());\n\t\t\t\n \t // Close the affectedParty object\n \t getContext().writeCloseObject();\n }\n\t\t// Close the Array of affectedParties\n getContext().writeCloseArray();\n\t}", "public void print() {\n\t\tSystem.out.println(name + \" -- \" + rating + \" -- \" + phoneNumber);\n\t}", "private void printingSearchResults() {\n HashMap<Integer, Double> resultsMap = new HashMap<>();\n for (DocCollector collector : resultsCollector) {\n if (resultsMap.containsKey(collector.getDocId())) {\n double score = resultsMap.get(collector.getDocId()) + collector.getTermScore();\n resultsMap.put(collector.getDocId(), score);\n } else {\n resultsMap.put(collector.getDocId(), collector.getTermScore());\n }\n }\n List<Map.Entry<Integer, Double>> list = new LinkedList<>(resultsMap.entrySet());\n Collections.sort(list, new Comparator<Map.Entry<Integer, Double>>() {\n public int compare(Map.Entry<Integer, Double> o1,\n Map.Entry<Integer, Double> o2) {\n return (o2.getValue()).compareTo(o1.getValue());\n }\n });\n if (list.isEmpty())\n System.out.println(\"no match\");\n else {\n DecimalFormat df = new DecimalFormat(\".##\");\n for (Map.Entry<Integer, Double> each : list)\n System.out.println(\"docId: \" + each.getKey() + \" score: \" + df.format(each.getValue()));\n }\n\n }", "public void writeResults() {\n gfmBroker.storeResults(this.responses, fileOutputPath);\n }", "private static void printDocumentation() {\n\t\tSystem.out\n\t\t\t\t.println(\"********************************************************************\");\n\t\tSystem.out.println(\"*** Wikidata Toolkit: Dump Processing Example\");\n\t\tSystem.out.println(\"*** \");\n\t\tSystem.out\n\t\t\t\t.println(\"*** This program will download and process dumps from Wikidata.\");\n\t\tSystem.out\n\t\t\t\t.println(\"*** It will print progress information and some simple statistics.\");\n\t\tSystem.out\n\t\t\t\t.println(\"*** Downloading may take some time initially. After that, files\");\n\t\tSystem.out\n\t\t\t\t.println(\"*** are stored on disk and are used until newer dumps are available.\");\n\t\tSystem.out\n\t\t\t\t.println(\"*** You can delete files manually when no longer needed (see \");\n\t\tSystem.out\n\t\t\t\t.println(\"*** message below for the directory where files are found).\");\n\t\tSystem.out\n\t\t\t\t.println(\"********************************************************************\");\n\t}", "public void print() {\n\t\tprint(root);\n\t}", "@Override\n\tpublic void printToFile() {\n\t\t\n\t}", "void print() {\r\n\t\tOperations.print(lexemes, tokens);\r\n\t}", "private void generateIdfOutput()\n{\n getValidWords();\n scanDocuments();\n outputResults();\n}", "public String printSortedResult() {\n\t\tStringBuilder sb = new StringBuilder();\n\n\t\tsb.append(printStartNumberAndName() + \"; \");\n\t\tsb.append(printInfo());\n\t\t\n\t\tsb.append(printTotalTime());\n\t\t\n\t\tsb.append(errorHandler.print());\n\t\t\n\t\treturn sb.toString();\n\t}", "public void print();", "public void print();", "public void print();", "public void print();", "public void print() {\r\n System.out.print( getPlayer1Id() + \", \" );\r\n System.out.print( getPlayer2Id() + \", \");\r\n System.out.print(getDateYear() + \"-\" + getDateMonth() + \"-\" + getDateDay() + \", \");\r\n System.out.print( getTournament() + \", \");\r\n System.out.print(score + \", \");\r\n System.out.print(\"Winner: \" + winner);\r\n System.out.println();\r\n }", "public String printfull(){\r\n\t\tString ans = this.toString() + \" \\n\";\r\n\t\t\r\n\t\tArrayList <String> details = getOpDetails();\r\n\t\tfor(String d: details){\r\n\t\t\tans = ans + d + \" \\n\";\r\n\t\t}\r\n\t\t\r\n\t\tans = ans + \"Input Files:\\n\" ;\r\n\t\tFileInfo fileIndex = (FileInfo)input.getFirstChild();\r\n\t\twhile(fileIndex != null){\r\n\t\t\tans = ans + fileIndex.toString() + \"\\n\";\r\n\t\t\tfileIndex = (FileInfo)fileIndex.getNextSibling();\r\n\t\t}//end input while\r\n\t\t\r\n\t\t\r\n\t\tans = ans + \"Output Files:\\n\";\r\n\t\tfileIndex = (FileInfo)output.getFirstChild();\r\n\t\twhile(fileIndex != null){\r\n\t\t\tans = ans + fileIndex.toString() + \"\\n\";\r\n\t\t\tfileIndex = (FileInfo) fileIndex.getNextSibling();\r\n\t\t}//end output while\r\n\t\treturn ans;\r\n\t}", "public static void stdout(){\n\t\tSystem.out.println(\"Buildings Found: \" + buildingsFound);\n\t\tSystem.out.println(\"Pages searched: \"+ pagesSearched);\n\t\tSystem.out.println(\"Time Taken: \" + (endTime - startTime) +\"ms\");\t\n\t}", "public void printOut(){\n\t\tSystem.out.println(\"iD: \" + this.getiD());\n\t\tSystem.out.println(\"Titel: \" + this.getTitel());\n\t\tSystem.out.println(\"Produktionsland: \" + this.getProduktionsLand());\n\t\tSystem.out.println(\"Filmlaenge: \" + this.getFilmLaenge());\n\t\tSystem.out.println(\"Originalsprache: \" + this.getOriginalSprache());\n\t\tSystem.out.println(\"Erscheinungsjahr: \" + this.getErscheinungsJahr());\n\t\tSystem.out.println(\"Altersfreigabe: \" + this.getAltersFreigabe());\n\t\tif(this.kameraHauptperson != null) {\n\t\t\tSystem.out.println( \"Kameraperson: \" + this.getKameraHauptperson().toString() );\n\t\t}\n\t\telse {\n\t\t\tSystem.out.println( \"Keine Kameraperson vorhanden \");\n\n\t\t}\n\t\tSystem.out.println(\"----------------------------\");\n\t\tif ( this.listFilmGenre != null) {\n\t\t\tfor( FilmGenre filmGenre: this.listFilmGenre ){\n\t\t\t\tSystem.out.println(\"Filmgenre: \" + filmGenre);\n\t\t\t}\n\t\t}\n\t\tSystem.out.println(\"----------------------------\");\n\t\tfor( Person darsteller: this.listDarsteller ){\n\t\t\tSystem.out.println(\"Darsteller: \" + darsteller);\n\t\t}\n\t\tSystem.out.println(\"----------------------------\");\n\t\tfor( Person synchronSpr: this.listSynchronsprecher ){\n\t\t\tSystem.out.println(\"synchro: \" + synchronSpr);\n\t\t}\n\t\tSystem.out.println(\"----------------------------\");\n\t\tfor( Person regi: this.listRegisseure ){\n\t\t\tSystem.out.println(\"regi: \" + regi);\n\t\t}\n\t\tSystem.out.println(\"----------------------------\");\n\t\tfor( Musikstueck mstk: this.listMusickstuecke ){\n\t\t\tSystem.out.println(\"Musikstueck: \" + mstk);\n\t\t}\n\t\tSystem.out.println(\"----------------------------\");\n\t\tSystem.out.println(\"Datentraeger: \" + this.getDatentraeger());\n\t\tSystem.out.println(\"----------------------------\");\n\t}", "@Override\r\n\t\t\tpublic void print() {\n\t\t\t\t\r\n\t\t\t}", "public void printAll(){\n\t\tSystem.out.println(\"Single hits: \" + sin);\n\t\tSystem.out.println(\"Double hits: \" + doub);\n\t\tSystem.out.println(\"Triple hits: \" + trip);\n\t\tSystem.out.println(\"Homerun: \" + home);\n\t\tSystem.out.println(\"Times at bat: \" + atbat);\n\t\tSystem.out.println(\"Total hits: \" + hits);\n\t\tSystem.out.println(\"Baseball average: \" + average);\n\t}", "private void printResultSet(ResultSet rs) {\n\t\twhile(rs.hasNext()) {\t\n\t\t\tQuerySolution qs = rs.next();\n\t\t\tSystem.out.println(qs.toString());\n\t\t}\n\t\tSystem.out.println(\"------\");\n\t}", "public void print() {\r\n\t\tint size = list.size();\r\n\r\n\t\tSystem.out.println();\r\n\t\tSystem.out.println(\"┌───────────────────────────┐\");\r\n\t\tSystem.out.println(\"│ \t\t\t성적 출력 \t\t │\");\r\n\t\tSystem.out.println(\"└───────────────────────────┘\");\r\n\r\n\t\tfor (int i = 0; i < size; i++) {\r\n\r\n\t\t\tExam exam = list.get(i);\r\n\t\t\tint kor = exam.getKor();\r\n\t\t\tint eng = exam.getEng();\r\n\t\t\tint math = exam.getMath();\r\n\r\n\t\t\tint total = exam.total();// kor + eng + math;\r\n\t\t\tfloat avg = exam.avg();// total / 3.0f;\r\n\t\t\tSystem.out.printf(\"성적%d > 국어:%d, 영어:%d, 수학:%d\", i + 1, kor, eng, math);\r\n\t\t\tonPrint(exam);\r\n\t\t\tSystem.out.printf(\"총점:%d, 평균:%.4f\\n\", total, avg);\r\n\r\n\t\t}\r\n\r\n\t\tSystem.out.println(\"─────────────────────────────\");\r\n\r\n\t}", "public void print() {\r\n this.table.printTable();\r\n }", "public void report(List<Page> result) {\n\n\t\t// Print Pages out ranked by highest authority\n\t\tsortAuthority(result);\n\t\tSystem.out.println(\"AUTHORITY RANKINGS : \");\n\t\tfor (Page currP : result)\n\t\t\tSystem.out.printf(currP.getLocation() + \": \" + \"%.5f\" + '\\n', currP.authority);\n\t\tSystem.out.println();\n\t\t// Print Pages out ranked by highest hub\n\t\tsortHub(result);\n\t\tSystem.out.println(\"HUB RANKINGS : \");\n\t\tfor (Page currP : result)\n\t\t\tSystem.out.printf(currP.getLocation() + \": \" + \"%.5f\" + '\\n', currP.hub);\n\t\tSystem.out.println();\n\t\t// Print Max Authority\n\t\tSystem.out.println(\"Page with highest Authority score: \" + getMaxAuthority(result).getLocation());\n\t\t// Print Max Authority\n\t\tSystem.out.println(\"Page with highest Hub score: \" + getMaxAuthority(result).getLocation());\n\t}", "@Override\r\n\tpublic void print() {\n\t\tsuper.print();\r\n\t\tSystem.out.println(\"album=\" + album + \", year=\" + year);\r\n\t}", "public void printRecipt(){\n\n }", "public static void printAllRecords() {\r\n\t\tfor (int i = 0; i<studRecs.size(); i++) {\r\n\t\t\tprintRecord(i);\r\n\t\t}\r\n\t}", "public void print() {\n\t\tfor(String subj : subjects) {\n\t\t\tSystem.out.println(subj);\n\t\t}\n\t\tSystem.out.println(\"==========\");\n\t\t\n\t\tfor(StudentMarks ssm : studMarks) {\n\t\t\tSystem.out.println(ssm.student);\n\t\t\tfor(Byte m : ssm.marks) {\n\t\t\t\tSystem.out.print(m + \" \");\n\t\t\t}\n\t\t\tSystem.out.println();\n\t\t}\n\t}", "private void printReport() {\n\t\t\tSystem.out.println(\"Processed \" + this.countItems + \" items:\");\n\t\t\tSystem.out.println(\" * Labels: \" + this.countLabels);\n\t\t\tSystem.out.println(\" * Descriptions: \" + this.countDescriptions);\n\t\t\tSystem.out.println(\" * Aliases: \" + this.countAliases);\n\t\t\tSystem.out.println(\" * Statements: \" + this.countStatements);\n\t\t\tSystem.out.println(\" * Site links: \" + this.countSiteLinks);\n\t\t}", "public void PrintResult() {\n try {\n res.beforeFirst();\n int columnsNumber = res.getMetaData().getColumnCount();\n while (res.next()) {\n for (int i = 1; i <= columnsNumber; i++) {\n if (i > 1) System.out.print(\", \");\n Object columnValue = res.getObject(i);\n System.out.print(res.getMetaData().getColumnName(i) + \" \" + columnValue);\n }\n System.out.println();\n }\n } catch (SQLException e) {\n e.printStackTrace();\n }\n }", "public static void printResults() {\n resultMap.entrySet().stream().forEach((Map.Entry<File, String> entry) -> {\n System.out.println(String.format(\"%s processed by thread: %s\", entry.getKey(), entry.getValue()));\n });\n System.out.println(String.format(\"processed %d entries\", resultMap.size()));\n }", "@Override\r\n\tpublic void print() {\n\t}", "private void printOut(String[] printerMakerResult)\n {\n //shows user the printerMaker result\n\n for(int i=0;i<printerMakerResult.length;i++)\n {\n outVideo.println(printerMakerResult[i]);\n outVideo.flush();\n }\n }", "private static void writeResults() {\n\t\t//Sort hashMap before sending to file\n\t\tTreeSet<Word> mySet = new TreeSet<>(hm.values());\n\n\t\t//Create result.txt file and write treeMap out to it\n\t\tWriter writer = null;\n\t\ttry {\n\t\t\t//System.out.println(\"Here\");\n\t\t\twriter = new BufferedWriter(new OutputStreamWriter(new FileOutputStream(\"output\\\\results.txt\")));\n\t\t\tfor (Word word : mySet) {\n\t\t\t\twriter.write(word.getValue() + \"\\t\" + word.getCount() + \"\\n\");\n\t\t\t}\n\n\t\t} catch (Exception e) {\n\t\t\te.printStackTrace();\n\t\t} finally {\n\t\t\ttry {\n\t\t\t\twriter.close();\n\t\t\t} catch (Exception e) {\n\t\t\t\te.printStackTrace();\n\t\t\t}\n\t\t}\n\t}", "public void print()\n {\n System.out.println();\n System.out.println(\"Ticket to \" + destination +\n \" Price : \" + price + \" pence \" + \n \" Issued \" + issueDateTime);\n System.out.println();\n }", "private static void outputBook() {\n\t\toutput(\"\");\r\n\t\tfor (book book : library.outputBook()) { // method name changes BOOKS to outputBook()\r\n\t\t\toutput(book + \"\\n\");\r\n\t\t}\t\t\r\n\t}", "@Override\n public void print() {\n if (scoreData.getError() != null) {\n System.err.println(\"ERROR! \" + scoreData.getError());\n return;\n }\n\n // Frames\n printFrames();\n scoreData.getScores().forEach(score -> {\n // Player Names\n printNames(score);\n // Pinfalls\n printPinfalls(score);\n // Scores\n printScores(score);\n });\n }", "public void print() {\n\t\tif(log.isTraceEnabled()) {\n\t\t\tlog.info(\">> print()\");\n\t\t}\n\t\tSystem.out.println(p + \"/\" + q);\n\t\tif(log.isTraceEnabled()) {\n\t\t\tlog.info(\"<< print()\");\n\t\t}\n\t}", "void print() {\t\r\n\t\tIterator<Elemento> e = t.iterator();\r\n\t\twhile(e.hasNext())\r\n\t\t\te.next().print();\r\n\t}", "private ResultHandler print() {\n\t\treturn null;\r\n\t}", "public void print() {\n System.out.println(\"**List of books in the library.\");\n for (Book b : books){\n if(b != null) {\n System.out.println(b);\n }\n }\n System.out.println(\"**End of list\");\n }", "private static void printOutput (int[][] results)\n {\n for (int i=0; i<=results[0].length-1; i++)\n {\n System.out.println(results[0][i] +\",\"+ results[1][i]);\n }\n System.out.println();\n }", "private void writeFinalReports() {\n\t\tSystem.out.println(\"Printing data to output files ...\");\n\t\twritePropertyData();\n\t\twriteClassData();\n\t\tSystem.out.println(\"Finished printing data.\");\n\t}", "@Override\n\tpublic void print() {\n\n\t}", "public void print() {\n System.out.print(datum+\" \");\n if (next != null) {\n next.print();\n }\n }", "@VisibleForTesting\n void print();", "@Override\n\tpublic void print() {\n\t\t\n\t}", "public void saveResult() {\n\t\ttry {\n\t\t\tPrintWriter out = new PrintWriter(new FileOutputStream(resultFile));\n\t\t\tout.println(record.resultToString());\n\t\t\tout.close();\n\t\t} catch (FileNotFoundException e) {\n\t\t\te.printStackTrace();\n\t\t}\n\t}", "public void printInfo() {\n System.out.println(\"\\n\\n---------------------BASIC RESULTS-----------------------\\n\");\n System.out.println(\"Most positive article: \" + mostPositiveDoc + \"\\nwith positivity \" + mostPositive + \"\\n\");\n System.out.println(\"Most negative article: \" + mostNegativeDoc + \"\\nwith negativity \" + mostNegative + \"\\n\");\n if (biggestDifference >= 0) {\n System.out.println(\"Biggest difference: \" + biggestDifferenceDoc + \"\\nwith more positivity by \" + biggestDifference);\n } else {\n System.out.println(\"Biggest difference: \" + biggestDifferenceDoc + \"\\nwith more negativity by \" + Math.abs(biggestDifference));\n }\n \n System.out.println(\"\\nAverage positivity: \" + avgPositive);\n System.out.println(\"Average negativity: \" + avgNegative);\n System.out.println(\"\\n-----------------------------------------------------------\\n\");\n System.out.println(\"\\n---------------------ADVANCED RESULTS----------------------\");\n \n System.out.println(\"\\nAverage positivity for PUBLISHERS:\");\n for (String s : publisherOptimism.keySet()) {\n LinkedList<Double> positives = publisherOptimism.get(s);\n int size = positives.size();\n double total = 0;\n for (double d : positives) {\n total += d;\n }\n System.out.println(s + \", positivity = \" + total / size);\n }\n \n System.out.println(\"\\nAverage negativity for PUBLISHERS:\");\n for (String s : publisherPessimism.keySet()) {\n LinkedList<Double> negatives = publisherPessimism.get(s);\n int size = negatives.size();\n double total = 0;\n for (double d : negatives) {\n total += d;\n }\n System.out.println(s + \", negativity = \" + total / size);\n }\n \n System.out.println(\"\\nAverage positivity for REGIONS:\");\n for (String s : regionOptimism.keySet()) {\n LinkedList<Double> positives = regionOptimism.get(s);\n int size = positives.size();\n double total = 0;\n for (double d : positives) {\n total += d;\n }\n System.out.println(s + \", positivity = \" + total / size);\n }\n \n System.out.println(\"\\nAverage negativity for REGIONS:\");\n for (String s : regionPessimism.keySet()) {\n LinkedList<Double> negatives = regionPessimism.get(s);\n int size = negatives.size();\n double total = 0;\n for (double d : negatives) {\n total += d;\n }\n System.out.println(s + \", negativity = \" + total / size);\n }\n \n System.out.println(\"\\nAverage positivity for DATES:\");\n for (LocalDate s : dayOptimism.keySet()) {\n LinkedList<Double> positives = dayOptimism.get(s);\n int size = positives.size();\n double total = 0;\n for (double d : positives) {\n total += d;\n }\n System.out.println(s + \", positivity = \" + total / size);\n }\n \n System.out.println(\"\\nAverage negativity for DATES:\");\n for (LocalDate s : dayPessimism.keySet()) {\n LinkedList<Double> negatives = dayPessimism.get(s);\n int size = negatives.size();\n double total = 0;\n for (double d : negatives) {\n total += d;\n }\n System.out.println(s + \", negativity = \" + total / size);\n }\n \n System.out.println(\"\\nAverage positivity for WEEKDAYS:\");\n for (DayOfWeek s : weekdayOptimism.keySet()) {\n LinkedList<Double> positives = weekdayOptimism.get(s);\n int size = positives.size();\n double total = 0;\n for (double d : positives) {\n total += d;\n }\n System.out.println(s + \", positivity = \" + total / size);\n }\n \n System.out.println(\"\\nAverage negativity for WEEKDAYS:\");\n for (DayOfWeek s : weekdayPessimism.keySet()) {\n LinkedList<Double> negatives = weekdayPessimism.get(s);\n int size = negatives.size();\n double total = 0;\n for (double d : negatives) {\n total += d;\n }\n System.out.println(s + \", negativity = \" + total / size);\n }\n \n System.out.println(\"\\n-----------------------------------------------------------\\n\");\n \n }", "public void print ()\n\t{\n\t\tSystem.out.println(\"Polyhedron File Name: \" + FileName);\n\t\tSystem.out.println(\"Object active: \" + Boolean.toString(isActive()));\n\t\tprintCoordinates();\n\t}", "public static void printOut()\n\t{\n\t\t//int dms[];\n\t\t//int deg, min, sec;\n\t\t//double\tdd;\n\t\ttime = new Date();\t\n\n//\t\tif (GeoDis_GUI.outputfile == null)\n\t\tif (!printToFile)\n\t\t{\t\t\n\t\t\tGeoDis_GUI.outWindow();\n\t\t\toutfile = new TextOutputStream(GeoDis_GUI.outdoc);\n\t\t\t//outfile = Console.out;\n\t\t}\n\t\telse\n\t\t{\n\t\t\t//File outputfile = GeoDis_GUI.outputfile;\n\t\t\t//outfilename = GeoDis_GUI.outputfile.getPath();\n\t\t\toutfile = new TextOutputStream(GeoDis.outfilename);\n\t\t\tif(GeoDis.outfilename.endsWith(\".gdout\")){\n\t\t\t\tMediator.setGeoDisOutputFile(GeoDis.outfilename);\n\t\t\t} else {\n\t\t\t\t// Unsafe assumption\n\t\t\t\tMediator.setGeoDisOutputFile_MatrixFormat(GeoDis.outfilename);\n\t\t\t}\n\t\t}\t\n\n\t\toutfile.print(\"Differentiating population structure from history - \" + PROGRAM_NAME);\n\t\toutfile.print(\" \" + VERSION_NUMBER);\n\t\toutfile.print(\"\\n(c) Copyright, 1999-2006 David Posada and Alan Templeton\");\n\t\toutfile.print(\"\\nContact: David Posada, University of Vigo, Spain ([email protected])\");\n\t\t//outfile.print(\"\\nUniversity of Vigo\");\n\t\t//outfile.print(\"\\[email protected]\");\n\t\toutfile.print(\"\\n________________________________________________________________________\\n\\n\");\n\t\toutfile.print(\"Input file: \" + infilename);\n\t\toutfile.print(dataName);\n\t\toutfile.print(\"\\n\\n\" + time.toString());\n\n\t\tif (doingDistances)\n\t\toutfile.print(\"\\n\\nCalculations from USER-defined distances\");\n\n\n\t\tfor(k=0; k<numClades; k++)\n\t\t{\n\n\t\t\toutfile.print(\"\\n\\n\\n\\n\\nPERMUTATION ANALYSIS OF \" + clad[k].cladeName);\n\t\t\toutfile.print(\"\\n BASED ON \" + GeoDis.numPermutations + \" RESAMPLES\");\n\t\t\toutfile.println(\"\\n\\n\\nPART I. PERMUTATIONAL CONTINGENCY TEST:\");\n\n\t\t\tif(clad[k].numSubClades != 1) \n\t\t\t{\n\t\t\t\toutfile.print(\"\\n\\n OBSERVED CHI-SQUARE STATISTIC = \");\n\t\t\t\toutfile.printf(\"%10.4f\",clad[k].obsChi);\n\t\t\t\toutfile.print(\"\\n\\n THE PROBABILITY OF A RANDOM CHI-SQUARE BEING GREATER THAN\");\n\t\t\t\toutfile.print(\"\\n OR EQUAL TO THE OBSERVED CHI-SQUARE = \");\n\t\t\t\toutfile.printf(\"%10.4f\",clad[k].chiPvalue);\n\t\t\t}\t\t\n\n\t\t\telse\n\t\t\t\toutfile.println(\"\\nNO. OF CLADES = 1, CHI-SQUARE N.A.\");\n\t\t\t \n\n\t\t\toutfile.println(\"\\n\\n\\nPART II. GEOGRAPHIC DISTANCE ANALYSIS:\");\n\n\t\t\t// print geographical centers\n\t\t\t\n\t\n\t\t\tif (usingDecimalDegrees)\n\t\t\t{\n\t\t\t\toutfile.print(\"\\nGEOGRAPHICAL CENTERS LATITUDE LONGITUDE\");\n\t\t\t\toutfile.printf(\"\\n%16s\", clad[k].cladeName);\n\t\t\t\toutfile.printf(\"%16.4f\", clad[k].meanLatNest / D2R);\n\t\t\t\toutfile.printf(\"%16.4f\", clad[k].meanLonNest / D2R);\n\t\t\t\tfor(i = 0; i < clad[k].numSubClades; i++)\n\t\t\t\t{\n\t\t\t\t\toutfile.printf(\"\\n%16s\", clad[k].subCladeName[i]);\n\t\t\t\t\toutfile.printf(\"%16.4f\", clad[k].meanLatitude[i] / D2R);\n\t\t\t\t\toutfile.printf(\"%16.4f\", clad[k].meanLongitude[i] / D2R);\n\t\t\t\t}\n\t\t\t}\n\t\t\telse if (!doingDistances)\n\t\t\t{\n\t\t\t\toutfile.print(\"\\nGEOGRAPHICAL CENTERS LATITUDE LONGITUDE\");\n\t\t\t\toutfile.printf(\"\\n%16s\", clad[k].cladeName);\n\n\t\t\t\tint dms[] = DDtoDMS (clad[k].meanLatNest / D2R);\n\t\t\t\toutfile.printf(\" % 4d\"+ \" \", dms[0]);\n\t\t\t\toutfile.printf(\"%02d\" + \"'\", dms[1]);\n\t\t\t\toutfile.printf(\"%02d\" +\"\\\"\", dms[2]);\n\t\t\t\t/*outfile.printf(\"(%6.4f)\", clad[k].meanLatNest / D2R);*/\n\n\t\t\t\tdms = DDtoDMS (clad[k].meanLonNest / D2R);\n\t\t\t\toutfile.printf(\" % 4d\"+ \" \", dms[0]);\n\t\t\t\toutfile.printf(\"%02d\" + \"'\", dms[1]);\n\t\t\t\toutfile.printf(\"%02d\" +\"\\\"\", dms[2]);\n\t\t\t\t/*outfile.printf(\"(%6.4f)\", clad[k].meanLonNest / D2R);*/\n\n\t\t\t\tfor(i = 0; i < clad[k].numSubClades; i++)\n\t\t\t\t{\n\t\t\t\t\toutfile.printf(\"\\n%16s\", clad[k].subCladeName[i]);\n\t\t\n\t\t\t\t\tdms = DDtoDMS (clad[k].meanLatitude[i] / D2R);\n\t\t\t\t\toutfile.printf(\" % 4d\"+ \" \", dms[0]);\n\t\t\t\t\toutfile.printf(\"%02d\" + \"'\", dms[1]);\n\t\t\t\t\toutfile.printf(\"%02d\" +\"\\\"\", dms[2]);\n\t\t\t\t\t/* outfile.printf(\"(%6.4f)\", clad[k].meanLatitude[i] / D2R);*/\n\n\t\t\t\t\tdms = DDtoDMS (clad[k].meanLongitude[i] / D2R);\n\t\t\t\t\toutfile.printf(\" % 4d\"+ \" \", dms[0]);\n\t\t\t\t\toutfile.printf(\"%02d\" + \"'\", dms[1]);\n\t\t\t\t\toutfile.printf(\"%02d\" +\"\\\"\", dms[2]);\n\t\t\t\t\t/*outfile.printf(\"(%6.4f)\", clad[k].meanLongitude[i] / D2R);*/\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tfor(i = 0; i < clad[k].numSubClades; i++)\n\t\t\t{\n\n\t\t\t\toutfile.print(\"\\n\\nCLADE \" + clad[k].subCladeName[i] + \" (\" + clad[k].subCladePosition[i] + \")\");\t\t\t\t\t\t\n\t\t\t\toutfile.print(\"\\n TYPE OF DISTANCE DISTANCE PROB.<= PROB.>=\");\n\n\t\t\t\tif(clad[k].numSubClades == 1)\n\t\t\t\t{\n\t\t\t\t\toutfile.print(\"\\n WITHIN CLADE \");\n\t\t\t\t\toutfile.printf(\"%12.4f\",clad[k].Dc[i]);\n\t\t\t\t\toutfile.print(\"N.A N.A\");\n\t\t\t\t\toutfile.print(\"\\n NESTED CLADE \");\n\t\t\t\t\toutfile.printf(\"%12.4f\",clad[k].Dn[i]);\n\t\t\t\t\toutfile.print(\"N.A N.A\");\n\t\t\t\t}\t\n\t\t\t\telse\n\t\t\t\t{\t\n\t\t\t\t\toutfile.print(\"\\n WITHIN CLADE \");\n\t\t\t\t\toutfile.printf(\"%12.4f\",clad[k].Dc[i]);\n\t\t\t\t\toutfile.print(\" \");\n\t\t\t\t\toutfile.printf(\"%10.4f\",clad[k].DcPvalue[i][0]);\n\t\t\t\t\toutfile.print(\" \");\n\t\t\t\t\toutfile.printf(\"%10.4f\",clad[k].DcPvalue[i][1]);\n\t\t\t\t\t\n\n\t\t\t\t\toutfile.print(\"\\n NESTED CLADE \");\n\t\t\t\t\toutfile.printf(\"%12.4f\",clad[k].Dn[i]);\n\t\t\t\t\toutfile.print(\" \");\n\t\t\t\t\toutfile.printf(\"%10.4f\",clad[k].DnPvalue[i][0]);\n\t\t\t\t\toutfile.print(\" \");\n\t\t\t\t\toutfile.printf(\"%10.4f\",clad[k].DnPvalue[i][1]);\n\t\t\t\n\t\t\t\t}\n\t\t\t}\n\n\n\t\t\tif(GeoDis.weights)\n\t\t\t{\n\t\t\t\toutfile.print(\"\\n\\n\\nCORRELATIONS OF DISTANCES WITH OUTGROUP WEIGHTS:\\n\");\n\t\t\t\toutfile.print(\"\\n TYPE OF DISTANCE CORR. COEF. PROB.<= PROB.>=\");\n\n\t\t\t\tif(clad[k].numSubClades == 1)\n\t\t\t\t\toutfile.print(\" N.A. -- ONLY 1 CLADE IN NESTING GROUP\");\n\t\t\t\t\n\t\t\t\telse {\n\t\t\t\t\n\t\t\t\t\tif(clad[k].corrDcWeights == NA)\n\t\t\t\t\t\toutfile.print(\"\\n FROM CLADE MIDPT. -- N.A. -- NO DISTANCE OR WEIGHT VARIATION\");\n\t\t\t\t\telse\n\t\t\t\t\t{\n\t\t\t\t\t\toutfile.print(\"\\n FROM CLADE MIDPT. \");\n\t\t\t\t\t\toutfile.printf(\"%12.4f\",clad[k].corrDcWeights);\n\t\t\t\t\t\toutfile.print(\" \");\n\t\t\t\t\t\toutfile.printf(\"%10.4f\",clad[k].corrDcWPvalue[0]);\n\t\t\t\t\t\toutfile.print(\" \");\n\t\t\t\t\t\toutfile.printf(\"%10.4f\",clad[k].corrDcWPvalue[1]);\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\tif(clad[k].corrDnWeights == NA)\n\t\t\t\t\t\toutfile.print(\"\\n FROM NESTING MIDPT. -- N.A. -- NO DISTANCE OR WEIGHT VARIATION\");\n\t\t\t\t\telse\n\t\t\t\t\t{\n\t\t\t\t\t\toutfile.print(\"\\n FROM NESTING MIDPT.\");\n\t\t\t\t\t\toutfile.printf(\"%12.4f\",clad[k].corrDnWeights);\n\t\t\t\t\t\toutfile.print(\" \");\n\t\t\t\t\t\toutfile.printf(\"%10.4f\",clad[k].corrDnWPvalue[0]);\n\t\t\t\t\t\toutfile.print(\" \");\n\t\t\t\t\t\toutfile.printf(\"%10.4f\",clad[k].corrDnWPvalue[1]);\n\t\t\t\t\t}\n\n\t\t\t\t}\n\t\t\t\n\t\t\t}\n\n\n\t\t\tif(clad[k].check == (double) clad[k].numSubClades || clad[k].check == 0)\n\t\t\t\t outfile.print(\"\\n\\n\\nNO INTERIOR/TIP CLADES EXIST IN THIS GROUP\"); \n\t\t\telse\n\t\t\t{\n\t\t\t\toutfile.print(\"\\n\\n\\nPART III. TEST OF INTERIOR VS. TIP CLADES:\");\n\t\t\t\toutfile.print(\"\\n\\n TYPE OF DISTANCE I-T DISTANCE PROB.<= PROB.>=\");\n\t\t\t\toutfile.print(\"\\n WITHIN CLADE \");\n\t\t\t\toutfile.printf(\"%12.4f\",clad[k].tipIntDistance);\n\t\t\t\toutfile.print(\" \");\n\t\t\t\toutfile.printf(\" %10.4f\",clad[k].ITcPvalue[0]);\n\t\t\t\toutfile.print(\" \");\n\t\t\t\toutfile.printf(\" %10.4f\",clad[k].ITcPvalue[1]);\n\n\t\t\t\toutfile.print(\"\\n NESTED CLADE \");\n\t\t\t\toutfile.printf(\"%12.4f\",clad[k].tipIntDisNested);\n\t\t\t\toutfile.print(\" \");\n\t\t\t\toutfile.printf(\" %10.4f\",clad[k].ITnPvalue[0]);\n\t\t\t\toutfile.print(\" \");\n\t\t\t\toutfile.printf(\" %10.4f\",clad[k].ITnPvalue[1]);\n\t\t\t}\n\n\t\t} // 1 clade loop\n\t\n\t\tlong total_time = end-start;\n\t\tdouble seconds = (double) total_time / 1000.0;\n\t\t//long minutes = seconds / 60;\n\t\toutfile.print(\"\\n\\n\\n** ANALYSIS FINISHED **\\nIt took \");\n\t\t//outfile.printf(\"%5d\", minutes);\n\t\t//outfile.print(\" minutes\\n\");\n\t\toutfile.printf(\"%5.4f\", seconds);\n\t\toutfile.print(\" seconds.\\n\");\n\n\t\t\n\t\toutfile.close();\n\t\t//System.err.println(\"\\nDONE Printing out\");\n\n\t}", "public void printReport() {\n System.out.println(\"=== Product Report ===\");\n productNames.keySet().forEach(k -> {\n System.out.println(\"Name: \" + k + \"\\t\\tCount: \" + productCountMap.get(productNames.get(k)));\n });\n\n }", "private static void printResults(Map<Path, Double> resultFiles2) {\r\n\t\tSystem.out.println();\r\n\t\tSystem.out.println(\"Najboljih 10 rezultata: \");\r\n\t\tint i = 0;\r\n\t\tfor (Map.Entry<Path, Double> e : resultFiles.entrySet()) {\r\n\t\t\tif (i==10) break;\r\n\t\t\tif (e.getValue() < 1E-9) break;\r\n\t\t\tSystem.out.printf(\"[%d] (%.4f) %s %n\", i, e.getValue(), e.getKey().toString());\r\n\t\t\ti++;\r\n\t\t}\r\n\t\t\r\n\t}", "void print();", "void print();", "void print();", "void print();", "void print();", "public void print() {\n System.out.println(\"Code: \"+this.productCode);\n System.out.println(\"Name: \"+ this.productName);\n System.out.println(\"Price: \"+this.price);\n System.out.println(\"Discount: \"+this.discount+\"%\");\n }", "public void printAction() {\n this.folderList.get(currentFolder).printIt();\n }", "void displayResults(final InvokeResult[] results)\n {\n for (int i = 0; i < results.length; ++i)\n {\n final InvokeResult result = results[i];\n\n final String s = new SmartStringifier(\"\\n\", false).stringify(result);\n println(s + \"\\n\");\n }\n }", "public void print() {\n print$$dsl$guidsl$guigs();\n System.out.print( \" eqn =\" + eqn );\n }", "@Override\r\n\tpublic void print()\r\n\t{\t//TODO méthode à compléter (TP1-ex11)\r\n\t\tfor (IndexEntry indexEntry : data) {\r\n\t\t\tif(indexEntry ==null){\r\n\t\t\t\tcontinue;\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tSystem.out.println(indexEntry.toString());\r\n\t\t}\r\n\t}", "public PrintDocumentSubscriber() {\n super(t -> System.out.println(t.toJson()));\n }", "public void print() {\n\t\tSystem.out.println(toString());\n\t}", "private static String print(final ResultSet res) throws Exception {\n final StringBuilder sb = new StringBuilder();\n final ResultSetMetaData md = res.getMetaData();\n for(int i = 0; i < md.getColumnCount(); ++i) {\n sb.append(' ');\n sb.append(md.getColumnName(i + 1));\n sb.append(\" |\");\n }\n sb.append('\\n');\n while(res.next()) {\n for(int i = 0; i < md.getColumnCount(); ++i) {\n sb.append(' ');\n sb.append(res.getString(i + 1));\n sb.append(\" |\");\n }\n sb.append('\\n');\n }\n return sb.toString();\n }", "public void printReceipt(){\n sale.updateExternalSystems();\n sale.printReceipt(totalCost, amountPaid, change);\n }" ]
[ "0.6792432", "0.67856", "0.66741675", "0.6642194", "0.6633082", "0.6563734", "0.64424247", "0.64418316", "0.63905895", "0.6356718", "0.63486636", "0.634198", "0.6296843", "0.6296565", "0.6293709", "0.6289128", "0.62785965", "0.6258788", "0.62229544", "0.62022823", "0.61862195", "0.6181862", "0.6172374", "0.61569726", "0.6138046", "0.61358136", "0.6133518", "0.6116718", "0.61107826", "0.60979265", "0.609141", "0.60843784", "0.6078298", "0.60776246", "0.6074457", "0.6074024", "0.6067704", "0.606609", "0.60650903", "0.6061399", "0.60374105", "0.60215545", "0.60206145", "0.59973186", "0.5993986", "0.5993986", "0.5993986", "0.5993986", "0.59792495", "0.5974689", "0.596954", "0.59691304", "0.59661084", "0.59637904", "0.5950634", "0.59345883", "0.5931052", "0.5928346", "0.591762", "0.59094137", "0.59078413", "0.59069586", "0.58959514", "0.58912826", "0.5891069", "0.5889233", "0.5888226", "0.58876073", "0.58853835", "0.5866548", "0.58660215", "0.5865017", "0.58484864", "0.58446443", "0.5843408", "0.58312666", "0.58257246", "0.58135456", "0.581287", "0.581232", "0.5810937", "0.58035254", "0.58009577", "0.578911", "0.5775611", "0.57755625", "0.5771808", "0.5771551", "0.5771551", "0.5771551", "0.5771551", "0.5771551", "0.5768604", "0.5758181", "0.5757082", "0.575643", "0.57553494", "0.5754642", "0.5749244", "0.5745735", "0.5744217" ]
0.0
-1
Builds a new Scan operation with the column family and start row key to access. Reads many following keys and respective fields as indicated in recordCount. Also contains the consistency level to preserve in the middleware.
public Scan(String columnFamily, String startRowKey, int recordCount, Set<String> fields, ConsistencyLevel cl) { super(TYPE, columnFamily, startRowKey, cl); this._columnFamily = columnFamily; if(recordCount > 0) this._recordCount = recordCount; this._fields = new FieldsOrValues(fields); this._cl = cl; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Override\n public int scan(final String table,\n final String startkey,\n final int recordcount,\n final Set<String> fields,\n final Vector<HashMap<String, ByteIterator>> result) {\n return Ok;\n }", "@Override\n public Status scan(String table, String startkey, int recordcount, Set<String> fields,\n Vector<HashMap<String, ByteIterator>> result) {\n ScanM request = ScanM.newBuilder().setTable(table).build();\n Result response;\n try {\n response = blockingStub.scan(request);\n } catch (StatusRuntimeException e) {\n return Status.ERROR;\n }\n return Status.OK;\n }", "public static Row strongReadProtocol(String tablename, String key, String columnFamily, int start, int count) throws IOException, TimeoutException\n { \n long startTime = System.currentTimeMillis(); \n // TODO: throw a thrift exception if we do not have N nodes\n ReadMessage readMessage = null;\n ReadMessage readMessageDigestOnly = null;\n if( start >= 0 && count < Integer.MAX_VALUE)\n {\n readMessage = new ReadMessage(tablename, key, columnFamily, start, count);\n }\n else\n {\n readMessage = new ReadMessage(tablename, key, columnFamily);\n }\n Message message = ReadMessage.makeReadMessage(readMessage);\n if( start >= 0 && count < Integer.MAX_VALUE)\n {\n readMessageDigestOnly = new ReadMessage(tablename, key, columnFamily, start, count);\n }\n else\n {\n readMessageDigestOnly = new ReadMessage(tablename, key, columnFamily);\n }\n readMessageDigestOnly.setIsDigestQuery(true); \n Row row = doStrongReadProtocol(key, readMessage, readMessageDigestOnly);\n logger_.debug(\"readProtocol: \" + (System.currentTimeMillis() - startTime) + \" ms.\");\n return row;\n }", "public ColumnarIndexScan() {\n\n\tString queryInput = null;\n\tBufferedReader in;\n\tString[] input = null;\n\tString DBName =\"\";\n\tString filename =\"\";\n\tString valueconstraint= \"\";\n\tString accesstype=\"\";\n\t\n\tList<List<String>> resultTuples = new ArrayList<>();\n\t//1.Tuples has to be inserted already and read in a columnarfile cf\n\t//2. retrieve tuples - COLUMNARFILENAME [(VALUECONSTRAINT)] ACCESSTYPE\n\tin = new BufferedReader(new InputStreamReader(System.in));\n\ttry {\n\t\tqueryInput = in.readLine();\n\t} catch (IOException e) {\n\t\te.printStackTrace();\n\t}\n\tinput = queryInput.split(\"\\\\s+\");\n\t\n\t//DBName = input[1];\n\tfilename = input[1];\n\tvalueconstraint = input[2];\n\taccesstype = input[3];\n\tSystem.out.println(filename);\n\tColumnarFile cf = insertRecords(filename+\".txt\"); \n\tSystem.out.println(\"working\");\n\tresultTuples = getFinalTuples(cf,valueconstraint,accesstype);\n\tSystem.out.println(resultTuples.toString());\n\t\n\t}", "public MultiRowColumnIterator( final Keyspace keyspace, final ColumnFamily<R, C> cf,\n final ConsistencyLevel consistencyLevel, final ColumnParser<C, T> columnParser,\n final ColumnSearch<T> columnSearch, final Comparator<T> comparator,\n final Collection<R> rowKeys, final int pageSize ) {\n this.cf = cf;\n this.pageSize = pageSize;\n this.columnParser = columnParser;\n this.columnSearch = columnSearch;\n this.comparator = comparator;\n this.rowKeys = rowKeys;\n this.keyspace = keyspace;\n this.consistencyLevel = consistencyLevel;\n this.moreToReturn = true;\n\n // seenResults = new HashMap<>( pageSize * 10 );\n }", "ScanResult<String> scan(String cursor, String pattern, long count);", "private RowKeyFormat2 tooHighRangeScanIndexRowKeyFormat() {\n // components of the row key\n ArrayList<RowKeyComponent> components = new ArrayList<RowKeyComponent>();\n components.add(RowKeyComponent.newBuilder()\n .setName(\"NAME\").setType(ComponentType.STRING).build());\n\n // build the row key format\n RowKeyFormat2 format = RowKeyFormat2.newBuilder().setEncoding(RowKeyEncoding.FORMATTED)\n .setSalt(HashSpec.newBuilder().build())\n .setRangeScanStartIndex(components.size() + 1)\n .setComponents(components)\n .build();\n\n return format;\n }", "public ScanCostFunction(BitSet scanColumns,\n BitSet lookupColumns,\n Optimizable baseTable,\n StoreCostController scc,\n CostEstimate scanCost,\n DataValueDescriptor[] rowTemplate,\n int[] keyColumns,\n boolean forUpdate,\n ResultColumnList resultColumns){\n this.scanColumns = scanColumns;\n this.lookupColumns = lookupColumns;\n this.baseTable=baseTable;\n this.scanCost = scanCost;\n this.scc = scc;\n this.keyColumns = keyColumns;\n this.forUpdate=forUpdate;\n this.selectivityHolder = new List[resultColumns.size()+1];\n this.baseColumnCount = resultColumns.size();\n totalColumns = new BitSet(baseColumnCount);\n totalColumns.or(scanColumns);\n if (lookupColumns != null)\n totalColumns.or(lookupColumns);\n }", "public boolean scan(String dbName, String table, String startkey,\n\t\t\tint recordcount, Set<Column> fields, Object result) {\n\t\tHTable htable = null;\n\t\ttry {\n\t\t\thtable = new HTable(conf,table);\n\t\t} catch (IOException e1) {\n\t\t\t// TODO Auto-generated catch block\n\t\t\te1.printStackTrace();\n\t\t}\n\t\t\n\t\tbyte[] startRow = Bytes.toBytes(startkey);\n\t\tbyte[] stopRow = Bytes.toBytes(startkey);\n\t\tstopRow[stopRow.length-1]++;\n\t\tScan s = new Scan(startRow,stopRow);\n\t\tfor(Column i : fields)\n\t\t{\n\t\t\ts.addColumn(Bytes.toBytes(i.columnFamily), Bytes.toBytes(i.column));\n\t\t}\n\t\ttry {\n\t\t\tResultScanner rs = htable.getScanner(s);\n\t\t\t\n\t\t\t//put the scanner result into a list<map<column,string>>\n\t\t\tfor(Result r : rs)\n\t\t\t{\n\t\t\t\tMap<Column, String> temp = new HashMap<Column,String>();\n\t\t\t\tfor(Column column : fields)\n\t\t\t\t{\n\t\t\t\t\tbyte[] b = r.getValue(Bytes.toBytes(column.columnFamily), Bytes.toBytes(column.column));\n\t\t\t\t\t\n\t\t\t\t\t((HashMap<Column, String>) temp).put(column, b.toString());\n\t\t\t\t}\n\t\t\t\t((List<HashMap<Column,String>>)result).add((HashMap<Column, String>) temp);\n\t\t\t}\n\t\t} catch (IOException e) {\n\t\t\t// TODO Auto-generated catch block\n\t\t\te.printStackTrace();\n\t\t\treturn false;\n\t\t}\n\t\treturn true;\n\t}", "public static DataScan createFullScan() {\n DataScan scan = SIDriver.driver().getOperationFactory().newDataScan(null);\n scan.startKey(SIConstants.EMPTY_BYTE_ARRAY).stopKey(SIConstants.EMPTY_BYTE_ARRAY).returnAllVersions();\n return scan;\n }", "@Test\n public void testScan() {\n // Choose, among the available ones, a random key as starting point for the scan transaction.\n int startScanKeyNumber = new Random().nextInt(((RiakKVClientTest.recordsToInsert) - (RiakKVClientTest.recordsToScan)));\n // Prepare a HashMap vector to store the scan transaction results.\n Vector<HashMap<String, ByteIterator>> scannedValues = new Vector<>();\n // Check whether the scan transaction is correctly performed or not.\n Assert.assertEquals(\"Scan transaction FAILED.\", OK, RiakKVClientTest.riakClient.scan(RiakKVClientTest.bucket, ((RiakKVClientTest.keyPrefix) + (Integer.toString(startScanKeyNumber))), RiakKVClientTest.recordsToScan, null, scannedValues));\n // After the scan transaction completes, compare the obtained results with the expected ones.\n for (int i = 0; i < (RiakKVClientTest.recordsToScan); i++) {\n Assert.assertEquals(\"Scan test FAILED: the current scanned key is NOT MATCHING the expected one.\", RiakKVClientTest.createExpectedHashMap((startScanKeyNumber + i)).toString(), scannedValues.get(i).toString());\n }\n }", "public UpdateScan open() {\r\n\t\treturn new TableScan(ti, tx);\r\n\t}", "public GetBulkStateRequest build() {\n GetBulkStateRequest request = new GetBulkStateRequest();\n request.setStoreName(this.storeName);\n request.setKeys(this.keys);\n request.setMetadata(this.metadata);\n request.setParallelism(this.parallelism);\n return request;\n }", "void generateReadValueFromCursor(Builder methodBuilder, SQLiteDaoDefinition daoDefinition, TypeName paramTypeName, String cursorName, String indexName);", "@Override\n protected void load() {\n //recordId can be null when in batchMode\n if (this.recordId != null && this.properties.isEmpty()) {\n this.sqlgGraph.tx().readWrite();\n if (this.sqlgGraph.getSqlDialect().supportsBatchMode() && this.sqlgGraph.tx().getBatchManager().isStreaming()) {\n throw new IllegalStateException(\"streaming is in progress, first flush or commit before querying.\");\n }\n\n //Generate the columns to prevent 'ERROR: cached plan must not change result type\" error'\n //This happens when the schema changes after the statement is prepared.\n @SuppressWarnings(\"OptionalGetWithoutIsPresent\")\n EdgeLabel edgeLabel = this.sqlgGraph.getTopology().getSchema(this.schema).orElseThrow(() -> new IllegalStateException(String.format(\"Schema %s not found\", this.schema))).getEdgeLabel(this.table).orElseThrow(() -> new IllegalStateException(String.format(\"EdgeLabel %s not found\", this.table)));\n StringBuilder sql = new StringBuilder(\"SELECT\\n\\t\");\n sql.append(this.sqlgGraph.getSqlDialect().maybeWrapInQoutes(\"ID\"));\n appendProperties(edgeLabel, sql);\n List<VertexLabel> outForeignKeys = new ArrayList<>();\n for (VertexLabel vertexLabel : edgeLabel.getOutVertexLabels()) {\n outForeignKeys.add(vertexLabel);\n sql.append(\", \");\n if (vertexLabel.hasIDPrimaryKey()) {\n String foreignKey = vertexLabel.getSchema().getName() + \".\" + vertexLabel.getName() + Topology.OUT_VERTEX_COLUMN_END;\n sql.append(this.sqlgGraph.getSqlDialect().maybeWrapInQoutes(foreignKey));\n } else {\n int countIdentifier = 1;\n for (String identifier : vertexLabel.getIdentifiers()) {\n PropertyColumn propertyColumn = vertexLabel.getProperty(identifier).orElseThrow(\n () -> new IllegalStateException(String.format(\"identifier %s column must be a property\", identifier))\n );\n PropertyType propertyType = propertyColumn.getPropertyType();\n String[] propertyTypeToSqlDefinition = this.sqlgGraph.getSqlDialect().propertyTypeToSqlDefinition(propertyType);\n int count = 1;\n for (String ignored : propertyTypeToSqlDefinition) {\n if (count > 1) {\n sql.append(sqlgGraph.getSqlDialect().maybeWrapInQoutes(vertexLabel.getFullName() + \".\" + identifier + propertyType.getPostFixes()[count - 2] + Topology.OUT_VERTEX_COLUMN_END));\n } else {\n //The first column existVertexLabel no postfix\n sql.append(sqlgGraph.getSqlDialect().maybeWrapInQoutes(vertexLabel.getFullName() + \".\" + identifier + Topology.OUT_VERTEX_COLUMN_END));\n }\n if (count++ < propertyTypeToSqlDefinition.length) {\n sql.append(\", \");\n }\n }\n if (countIdentifier++ < vertexLabel.getIdentifiers().size()) {\n sql.append(\", \");\n }\n }\n }\n }\n List<VertexLabel> inForeignKeys = new ArrayList<>();\n for (VertexLabel vertexLabel : edgeLabel.getInVertexLabels()) {\n sql.append(\", \");\n inForeignKeys.add(vertexLabel);\n if (vertexLabel.hasIDPrimaryKey()) {\n String foreignKey = vertexLabel.getSchema().getName() + \".\" + vertexLabel.getName() + Topology.IN_VERTEX_COLUMN_END;\n sql.append(this.sqlgGraph.getSqlDialect().maybeWrapInQoutes(foreignKey));\n } else {\n int countIdentifier = 1;\n for (String identifier : vertexLabel.getIdentifiers()) {\n PropertyColumn propertyColumn = vertexLabel.getProperty(identifier).orElseThrow(\n () -> new IllegalStateException(String.format(\"identifier %s column must be a property\", identifier))\n );\n PropertyType propertyType = propertyColumn.getPropertyType();\n String[] propertyTypeToSqlDefinition = this.sqlgGraph.getSqlDialect().propertyTypeToSqlDefinition(propertyType);\n int count = 1;\n for (String ignored : propertyTypeToSqlDefinition) {\n if (count > 1) {\n sql.append(sqlgGraph.getSqlDialect().maybeWrapInQoutes(vertexLabel.getFullName() + \".\" + identifier + propertyType.getPostFixes()[count - 2] + Topology.IN_VERTEX_COLUMN_END));\n } else {\n //The first column existVertexLabel no postfix\n sql.append(sqlgGraph.getSqlDialect().maybeWrapInQoutes(vertexLabel.getFullName() + \".\" + identifier + Topology.IN_VERTEX_COLUMN_END));\n }\n if (count++ < propertyTypeToSqlDefinition.length) {\n sql.append(\", \");\n }\n }\n if (countIdentifier++ < vertexLabel.getIdentifiers().size()) {\n sql.append(\", \");\n }\n }\n }\n }\n sql.append(\"\\nFROM\\n\\t\");\n sql.append(this.sqlgGraph.getSqlDialect().maybeWrapInQoutes(this.schema));\n sql.append(\".\");\n sql.append(this.sqlgGraph.getSqlDialect().maybeWrapInQoutes(EDGE_PREFIX + this.table));\n sql.append(\" WHERE \");\n //noinspection Duplicates\n if (edgeLabel.hasIDPrimaryKey()) {\n sql.append(this.sqlgGraph.getSqlDialect().maybeWrapInQoutes(\"ID\"));\n sql.append(\" = ?\");\n } else {\n int count = 1;\n for (String identifier : edgeLabel.getIdentifiers()) {\n sql.append(this.sqlgGraph.getSqlDialect().maybeWrapInQoutes(identifier));\n sql.append(\" = ?\");\n if (count++ < edgeLabel.getIdentifiers().size()) {\n sql.append(\" AND \");\n }\n\n }\n }\n if (this.sqlgGraph.getSqlDialect().needsSemicolon()) {\n sql.append(\";\");\n }\n Connection conn = this.sqlgGraph.tx().getConnection();\n if (logger.isDebugEnabled()) {\n logger.debug(sql.toString());\n }\n try (PreparedStatement preparedStatement = conn.prepareStatement(sql.toString())) {\n if (edgeLabel.hasIDPrimaryKey()) {\n preparedStatement.setLong(1, this.recordId.sequenceId());\n } else {\n int count = 1;\n for (Comparable identifierValue : this.recordId.getIdentifiers()) {\n preparedStatement.setObject(count++, identifierValue);\n }\n }\n ResultSet resultSet = preparedStatement.executeQuery();\n if (resultSet.next()) {\n loadResultSet(resultSet, inForeignKeys, outForeignKeys);\n }\n } catch (SQLException e) {\n throw new RuntimeException(e);\n }\n }\n }", "public void from(com.intuit.datasource.jooq.information_schema.tables.interfaces.IKeyColumnUsage from);", "@Override\n public Flowable<Row> streamMarcRecordIds(ParseLeaderResult parseLeaderResult, ParseFieldsResult parseFieldsResult, RecordSearchParameters searchParameters, String tenantId) {\n SelectJoinStep searchQuery = DSL.selectDistinct(RECORDS_LB.EXTERNAL_ID).from(RECORDS_LB);\n appendJoin(searchQuery, parseLeaderResult, parseFieldsResult);\n appendWhere(searchQuery, parseLeaderResult, parseFieldsResult, searchParameters);\n if (searchParameters.getOffset() != null) {\n searchQuery.offset(searchParameters.getOffset());\n }\n if (searchParameters.getLimit() != null) {\n searchQuery.limit(searchParameters.getLimit());\n }\n /* Building a count query */\n SelectJoinStep countQuery = DSL.select(countDistinct(RECORDS_LB.EXTERNAL_ID)).from(RECORDS_LB);\n appendJoin(countQuery, parseLeaderResult, parseFieldsResult);\n appendWhere(countQuery, parseLeaderResult, parseFieldsResult, searchParameters);\n /* Join both in one query */\n String sql = DSL.select().from(searchQuery).rightJoin(countQuery).on(DSL.trueCondition()).getSQL(ParamType.INLINED);\n\n return getCachedPool(tenantId)\n .rxGetConnection()\n .flatMapPublisher(conn -> conn.rxBegin()\n .flatMapPublisher(tx -> conn.rxPrepare(sql)\n .flatMapPublisher(pq -> pq.createStream(10000)\n .toFlowable()\n .filter(row -> !enableFallbackQuery || row.getInteger(COUNT) != 0)\n .switchIfEmpty(streamMarcRecordIdsWithoutIndexersVersionUsage(conn, parseLeaderResult, parseFieldsResult, searchParameters))\n .map(this::toRow))\n .doAfterTerminate(tx::commit)));\n }", "public RecordIterator<K, V> build(int begin, int size) {\n List<Pair<byte[], byte[]>> pairList = client.nextBlock(begin, size);\n list = new ArrayList<Pair<K, V>>(pairList.size());\n //convert Key -> K , serialize byte[] to V\n for (Pair<byte[], byte[]> each : pairList) {\n list.add(new Pair<K, V>((K) toKey(each.getFirst()), (V) serializer.toObject(each.getSecond())));\n }\n //reset record counter\n record = 0;\n return this;\n }", "public SearchResponse prepareSearchScrollRequest() {\n GetSettingsResponse getSettingsResponse = client.admin().indices().getSettings(new GetSettingsRequest().indices(dataPointer.getIndexName())).actionGet();\n int numShards = 0, numIndices = 0;\n for(ObjectCursor<Settings> settings : getSettingsResponse.getIndexToSettings().values()) {\n numShards += settings.value.getAsInt(\"index.number_of_shards\", 0);\n numIndices++;\n }\n\n int sizePerShard = (int)Math.ceil((double)SCROLL_SHARD_LIMIT/numShards);\n logger.info(\"Found \" + numIndices + \" indices and \" + numShards + \" shards matching the index-pattern, thus setting the sizePerShard to \" + sizePerShard);\n\n SearchRequestBuilder searchRequestBuilder = client.prepareSearch(dataPointer.getIndexName())\n .setTypes(dataPointer.getTypeName())\n .setSearchType(SearchType.SCAN)\n .addFields(\"_ttl\", \"_source\")\n .setScroll(new TimeValue(SCROLL_TIME_LIMIT))\n .setSize(sizePerShard);\n\n if (!Strings.isNullOrEmpty(query.getQuery())) {\n searchRequestBuilder.setQuery(query.getQuery());\n }\n if (!Strings.isNullOrEmpty(query.getSortField())) {\n searchRequestBuilder.addSort(new FieldSortBuilder(query.getSortField()).order(query.getSortOrder()));\n }\n\n bound.map(resolvedBound -> boundedFilterFactory.createBoundedFilter(segmentationField.get(), resolvedBound))\n .ifPresent(searchRequestBuilder::setQuery);\n\n return searchRequestBuilder.execute().actionGet();\n }", "@Override\n\tpublic void getGroupAndCount(RpcController controller, ExpandAggregationRequest request,\n\t\t\tRpcCallback<ExpandAggregationResponse> done) {\n\t\tInternalScanner scanner = null;\n\t\ttry {\n\t\t\t// 通过protobuf传来的Scan,scan已经添加groupBy column和count lie\n\t\t\tScan scan = ProtobufUtil.toScan(request.getScan());\n\t\t\tscanner = environment.getRegion().getScanner(scan);\n\t\t\tList<ExpandCell> groupList = request.getGroupColumnsList();\n\t\t\tList<ExpandCell> countList = request.getCountColumnsList();\n\t\t\tboolean hashNext = false;\n\t\t\tList<Cell> results = new ArrayList<Cell>();\n\t\t\tArrayList<TempRow> rows = new ArrayList<TempRow>();\n\t\t\tdo {\n\t\t\t\thashNext = scanner.next(results);//id 4\n\t\t\t\tTempRow tempRow = new TempRow();\n\t\t\t\tfor (Cell cell : results) {\n\t\t\t\t\tString family = Bytes.toString(cell.getFamilyArray(), cell.getFamilyOffset(),\n\t\t\t\t\t\t\tcell.getFamilyLength());\n\t\t\t\t\tString qualify = Bytes.toString(cell.getQualifierArray(), cell.getQualifierOffset(),\n\t\t\t\t\t\t\tcell.getQualifierLength());\n\t\t\t\t\tfor (ExpandCell gCell : groupList) {\n\t\t\t\t\t\tif (family.equals(gCell.getFamily()) && qualify.equals(gCell.getQualify())) {\n\t\t\t\t\t\t\tString value = Bytes.toString(cell.getValueArray(), cell.getValueOffset(),\n\t\t\t\t\t\t\t\t\tcell.getValueLength());\n\t\t\t\t\t\t\tSystem.out.println(value);\n\t\t\t\t\t\t\ttempRow.setKey(value);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tfor (Cell cell : results) {\n\t\t\t\t\tString family = Bytes.toString(cell.getFamilyArray(), cell.getFamilyOffset(),\n\t\t\t\t\t\t\tcell.getFamilyLength());\n\t\t\t\t\tString qualify = Bytes.toString(cell.getQualifierArray(), cell.getQualifierOffset(),\n\t\t\t\t\t\t\tcell.getQualifierLength());\n\t\t\t\t\tfor (ExpandCell gCell : countList) {\n\t\t\t\t\t\tif (family.equals(gCell.getFamily()) && qualify.equals(gCell.getQualify())) {\n\t\t\t\t\t\t\tString value = Bytes.toString(cell.getValueArray(), cell.getValueOffset(),\n\t\t\t\t\t\t\t\t\tcell.getValueLength());\n\t\t\t\t\t\t\ttempRow.setValue(value);\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\trows.add(tempRow);\n\t\t\t} while (hashNext);\n\t\t\tArrayList<ResultRow> ResultRows = analyzeRow(rows);\n\t\t\tArrayList<RpcResultRow> rpcResultRows = changeToRpcResultRow(ResultRows);\n\t\t\tWxsGroupByProto3.ExpandAggregationResponse.Builder responsBuilder = WxsGroupByProto3.ExpandAggregationResponse\n\t\t\t\t\t.newBuilder();\n\t\t\tfor (RpcResultRow rpcResultRow : rpcResultRows) {\n\t\t\t\tresponsBuilder.addResults(rpcResultRow);\n\t\t\t}\n\t\t\tdone.run(responsBuilder.build());\n\t\t} catch (IOException e) {\n\t\t\t// TODO Auto-generated catch block\n\t\t\te.printStackTrace();\n\t\t} finally {\n\t\t\ttry {\n\t\t\t\tscanner.close();\n\t\t\t} catch (IOException e) {\n\t\t\t\te.printStackTrace();\n\t\t\t}\n\t\t}\n\n\t}", "public void generateOneRowCost() throws StandardException {\n double totalRowCount = 1.0d;\n // Rows Returned is always the totalSelectivity (Conglomerate Independent)\n scanCost.setEstimatedRowCount(Math.round(totalRowCount));\n\n double baseTableAverageRowWidth = scc.getBaseTableAvgRowWidth();\n double baseTableColumnSizeFactor = scc.baseTableColumnSizeFactor(totalColumns);\n // We use the base table so the estimated heap size and remote cost are the same for all conglomerates\n double colSizeFactor = baseTableAverageRowWidth*baseTableColumnSizeFactor;\n\n // Heap Size is the avg row width of the columns for the base table*total rows\n // Average Row Width\n // This should be the same for every conglomerate path\n scanCost.setEstimatedHeapSize((long)(totalRowCount*colSizeFactor));\n // Should be the same for each conglomerate\n scanCost.setRemoteCost((long)(scc.getOpenLatency()+scc.getCloseLatency()+totalRowCount*scc.getRemoteLatency()*(1+colSizeFactor/100d)));\n // Base Cost + LookupCost + Projection Cost\n double congAverageWidth = scc.getConglomerateAvgRowWidth();\n double baseCost = scc.getOpenLatency()+scc.getCloseLatency()+(totalRowCount*scc.getLocalLatency()*(1+scc.getConglomerateAvgRowWidth()/100d));\n scanCost.setFromBaseTableRows(totalRowCount);\n scanCost.setFromBaseTableCost(baseCost);\n double lookupCost;\n if (lookupColumns == null)\n lookupCost = 0.0d;\n else {\n lookupCost = totalRowCount*(scc.getOpenLatency()+scc.getCloseLatency());\n scanCost.setIndexLookupRows(totalRowCount);\n scanCost.setIndexLookupCost(lookupCost+baseCost);\n }\n double projectionCost = totalRowCount * scc.getLocalLatency() * colSizeFactor*1d/1000d;\n scanCost.setProjectionRows(scanCost.getEstimatedRowCount());\n scanCost.setProjectionCost(lookupCost+baseCost+projectionCost);\n scanCost.setLocalCost(baseCost+lookupCost+projectionCost);\n scanCost.setNumPartitions(scc.getNumPartitions());\n }", "public com.google.devtools.kythe.proto.Filecontext.ContextDependentVersion.Row.Builder getRowBuilder(\n int index) {\n return getRowFieldBuilder().getBuilder(index);\n }", "@Test\n public void testScanTokenWithQueryId() throws Exception {\n Schema schema = createManyStringsSchema();\n CreateTableOptions createOptions = new CreateTableOptions();\n final int buckets = 8;\n createOptions.addHashPartitions(ImmutableList.of(\"key\"), buckets);\n client.createTable(testTableName, schema, createOptions);\n\n KuduSession session = client.newSession();\n KuduTable table = client.openTable(testTableName);\n final int totalRows = 100;\n for (int i = 0; i < totalRows; i++) {\n Insert insert = table.newInsert();\n PartialRow row = insert.getRow();\n row.addString(\"key\", String.format(\"key_%02d\", i));\n row.addString(\"c1\", \"c1_\" + i);\n row.addString(\"c2\", \"c2_\" + i);\n assertEquals(session.apply(insert).hasRowError(), false);\n }\n // Scan with specified query id.\n {\n int rowsScanned = 0;\n KuduScanToken.KuduScanTokenBuilder tokenBuilder = client.newScanTokenBuilder(table);\n tokenBuilder.setProjectedColumnIndexes(ImmutableList.of());\n tokenBuilder.setQueryId(\"query-id-for-test\");\n List<KuduScanToken> tokens = tokenBuilder.build();\n assertEquals(buckets, tokens.size());\n for (int i = 0; i < tokens.size(); i++) {\n KuduScanner scanner = tokens.get(i).intoScanner(client);\n while (scanner.hasMoreRows()) {\n rowsScanned += scanner.nextRows().getNumRows();\n }\n }\n assertEquals(totalRows, rowsScanned);\n }\n // Scan with default query id.\n {\n int rowsScanned = 0;\n KuduScanToken.KuduScanTokenBuilder tokenBuilder = client.newScanTokenBuilder(table);\n tokenBuilder.setProjectedColumnIndexes(ImmutableList.of());\n List<KuduScanToken> tokens = tokenBuilder.build();\n assertEquals(buckets, tokens.size());\n for (int i = 0; i < tokens.size(); i++) {\n KuduScanner scanner = tokens.get(i).intoScanner(client);\n while (scanner.hasMoreRows()) {\n rowsScanned += scanner.nextRows().getNumRows();\n }\n }\n assertEquals(totalRows, rowsScanned);\n }\n }", "@Test\n public void testInsertScan() throws Exception {\n Connector conn = tester.getConnector();\n\n // create table, add table split, write data\n final String tableName = getUniqueNames(1)[0];\n Map<Key, Value> input = new HashMap<>();\n input.put(new Key(\"aTablet1\", \"\", \"cq\"), new Value(\"7\".getBytes(StandardCharsets.UTF_8)));\n input.put(new Key(\"kTablet2\", \"\", \"cq\"), new Value(\"7\".getBytes(StandardCharsets.UTF_8)));\n input.put(new Key(\"zTablet2\", \"\", \"cq\"), new Value(\"7\".getBytes(StandardCharsets.UTF_8)));\n SortedSet<Text> splitset = new TreeSet<>();\n splitset.add(new Text(\"f\"));\n TestUtil.createTestTable(conn, tableName, splitset, input);\n\n IteratorSetting itset = new IteratorSetting(16, DebugIterator.class);\n conn.tableOperations().attachIterator(tableName, itset, EnumSet.of(IteratorUtil.IteratorScope.scan));\n\n // expected data back\n Map<Key, Value> expect = new HashMap<>(input);\n\n // read back both tablets in parallel\n BatchScanner scan = conn.createBatchScanner(tableName, Authorizations.EMPTY, 2);\n// Key startKey = new Key(new Text(\"d\"), cf, cq);\n Range rng = new Range();\n scan.setRanges(Collections.singleton(rng));\n log.debug(\"Results of scan on table \" + tableName + ':');\n Map<Key, Value> actual = new TreeMap<>(TestUtil.COMPARE_KEY_TO_COLQ); // only compare row, colF, colQ\n for (Map.Entry<Key, Value> entry : scan) {\n Key k = entry.getKey();\n Value v = entry.getValue();\n log.debug(k + \" \" + v);\n actual.put(k, v);\n }\n Assert.assertEquals(expect, actual);\n\n // delete test data\n conn.tableOperations().delete(tableName);\n }", "public Map<String, ExecutionContext> partition(int gridSize) {\n\n\t\tMap<String, ExecutionContext> partitionMap = new HashMap<String, ExecutionContext>();\n\n\t\tString partitionerQuery =this.getPrimaryKeyQuery();\n\t\t\n\t\tResultSetExtractor<List<Object>> resultSetExtractor = new ResultSetExtractor<List<Object>>() {\n\n\t\t\t@Override\n\t\t\tpublic List<Object> extractData(ResultSet rs)\n\t\t\t\t\tthrows SQLException, DataAccessException {\n\t\t\t\tList<Object> listOfIds = new ArrayList<Object>();\n\t\t\t\twhile(rs.next()){\n\n\t\t\t\t\tlistOfIds.add(rs.getObject(1));\n\t\t\t\t}\n\t\t\t\treturn listOfIds;\n\t\t\t}\n\t\t};\n\t\t\n\t\tList<Object> keys = query(partitionerQuery, resultSetExtractor);\n\n\t\tint recordsToProcess = keys.size();\n\t\tlogger.info(\"-------------------- Total records to process: \" + recordsToProcess);\n\n\t\tint partitionSize = (int) (Math.ceil((float) recordsToProcess / (float) gridSize));\n\n\t\tif (partitionSize < skipGridSizeForRecordsLessThenCount) {\n\t\t\tpartitionSize = skipGridSizeForRecordsLessThenCount;\n\t\t}\n\n\t\tlogger.info(\"--------------------- Total records per Partition: \" + partitionSize);\n\n\t\tint startKey = 0;\n\t\tint endKey = startKey + partitionSize - 1;\n\t\tint partitionId = 1;\n\n\t\twhile (startKey < recordsToProcess) {\n\t\t\tif (endKey > recordsToProcess - 1) {\n\t\t\t\tendKey = recordsToProcess - 1;\n\t\t\t}\n\t\t\tExecutionContext context = new ExecutionContext();\n\n\t\t\tlogger.info(\"-------------------- Start index(\" + partitionId + \"): \" + keys.get(startKey));\n\t\t\tlogger.info(\"-------------------- End index(\" + partitionId + \"): \" + keys.get(endKey));\n\n\t\t\tpartitionMap.put(\"partition-\" + partitionId, context);\n\t\t\tcontext.put(\"startKey\", keys.get(startKey));\n\t\t\tcontext.put(\"endKey\", keys.get(endKey));\n\t\t\tcontext.put(\"partitionId\", partitionId);\n\t\t\tcontext.put(\"partitionSize\", partitionSize);\n\t\t\tcontext.put(\"totalRecords\", keys.size());\n\n\t\t\tstartKey += partitionSize;\n\t\t\tendKey += partitionSize;\n\t\t\tpartitionId++;\n\t\t}\n\n\t\tlogger.info(\"Total no. of Partitions: \" + partitionMap.size());\n\t\treturn partitionMap;\n\t}", "private RowKeyFormat2 badRangeScanIndexRowKeyFormat() {\n // components of the row key\n ArrayList<RowKeyComponent> components = new ArrayList<RowKeyComponent>();\n components.add(RowKeyComponent.newBuilder()\n .setName(\"NAME\").setType(ComponentType.STRING).build());\n\n // build the row key format\n RowKeyFormat2 format = RowKeyFormat2.newBuilder().setEncoding(RowKeyEncoding.FORMATTED)\n .setSalt(HashSpec.newBuilder().build())\n .setRangeScanStartIndex(0)\n .setComponents(components)\n .build();\n\n return format;\n }", "QueryPartitionClause createQueryPartitionClause();", "public static Row weakReadProtocol(String tablename, String key, String columnFamily, int start, int count) throws Exception\n {\n Row row = null;\n long startTime = System.currentTimeMillis();\n List<EndPoint> endpoints = StorageService.instance().getNLiveStorageEndPoint(key);\n /* Remove the local storage endpoint from the list. */ \n endpoints.remove( StorageService.getLocalStorageEndPoint() );\n // TODO: throw a thrift exception if we do not have N nodes\n \n Table table = Table.open( DatabaseDescriptor.getTables().get(0) );\n if( start >= 0 && count < Integer.MAX_VALUE)\n {\n row = table.getRow(key, columnFamily, start, count);\n }\n else\n {\n row = table.getRow(key, columnFamily);\n }\n \n logger_.debug(\"Local Read Protocol: \" + (System.currentTimeMillis() - startTime) + \" ms.\");\n /*\n * Do the consistency checks in the background and return the\n * non NULL row.\n */\n if ( endpoints.size() > 0 && DatabaseDescriptor.getConsistencyCheck())\n \tStorageService.instance().doConsistencyCheck(row, endpoints, columnFamily, start, count);\n return row; \n }", "private Builder() {\n super(sparqles.avro.discovery.DGETInfo.SCHEMA$);\n }", "@Nonnull\n protected KeyExpression buildPrimaryKey() {\n return Key.Expressions.concat(\n Key.Expressions.recordType(),\n Key.Expressions.list(constituents.stream()\n .map(c -> Key.Expressions.field(c.getName()).nest(c.getRecordType().getPrimaryKey()))\n .collect(Collectors.toList())));\n }", "void generateReadPropertyFromCursor(SQLiteEntity tableEntity, Builder methodBuilder, TypeName beanClass, String beanName, ModelProperty property, String cursorName, String indexName);", "public Cursor getCursorWithRows() {\n Cursor cursor = new SimpleCursor(Query.QueryResult.newBuilder()\n .addFields(Query.Field.newBuilder().setName(\"col1\").setType(Query.Type.INT8).build())\n .addFields(Query.Field.newBuilder().setName(\"col2\").setType(Query.Type.UINT8).build())\n .addFields(Query.Field.newBuilder().setName(\"col3\").setType(Query.Type.INT16).build())\n .addFields(Query.Field.newBuilder().setName(\"col4\").setType(Query.Type.UINT16).build())\n .addFields(Query.Field.newBuilder().setName(\"col5\").setType(Query.Type.INT24).build())\n .addFields(Query.Field.newBuilder().setName(\"col6\").setType(Query.Type.UINT24).build())\n .addFields(Query.Field.newBuilder().setName(\"col7\").setType(Query.Type.INT32).build())\n .addFields(Query.Field.newBuilder().setName(\"col8\").setType(Query.Type.UINT32).build())\n .addFields(Query.Field.newBuilder().setName(\"col9\").setType(Query.Type.INT64).build())\n .addFields(Query.Field.newBuilder().setName(\"col10\").setType(Query.Type.UINT64).build())\n .addFields(\n Query.Field.newBuilder().setName(\"col11\").setType(Query.Type.FLOAT32).build())\n .addFields(\n Query.Field.newBuilder().setName(\"col12\").setType(Query.Type.FLOAT64).build())\n .addFields(\n Query.Field.newBuilder().setName(\"col13\").setType(Query.Type.TIMESTAMP).build())\n .addFields(Query.Field.newBuilder().setName(\"col14\").setType(Query.Type.DATE).build())\n .addFields(Query.Field.newBuilder().setName(\"col15\").setType(Query.Type.TIME).build())\n .addFields(\n Query.Field.newBuilder().setName(\"col16\").setType(Query.Type.DATETIME).build())\n .addFields(Query.Field.newBuilder().setName(\"col17\").setType(Query.Type.YEAR).build())\n .addFields(\n Query.Field.newBuilder().setName(\"col18\").setType(Query.Type.DECIMAL).build())\n .addFields(Query.Field.newBuilder().setName(\"col19\").setType(Query.Type.TEXT).build())\n .addFields(Query.Field.newBuilder().setName(\"col20\").setType(Query.Type.BLOB).build())\n .addFields(\n Query.Field.newBuilder().setName(\"col21\").setType(Query.Type.VARCHAR).build())\n .addFields(\n Query.Field.newBuilder().setName(\"col22\").setType(Query.Type.VARBINARY).build())\n .addFields(Query.Field.newBuilder().setName(\"col23\").setType(Query.Type.CHAR).build())\n .addFields(Query.Field.newBuilder().setName(\"col24\").setType(Query.Type.BINARY).build())\n .addFields(Query.Field.newBuilder().setName(\"col25\").setType(Query.Type.BIT).build())\n .addFields(Query.Field.newBuilder().setName(\"col26\").setType(Query.Type.ENUM).build())\n .addFields(Query.Field.newBuilder().setName(\"col27\").setType(Query.Type.SET).build())\n .addRows(Query.Row.newBuilder().addLengths(\"-50\".length()).addLengths(\"50\".length())\n .addLengths(\"-23000\".length()).addLengths(\"23000\".length())\n .addLengths(\"-100\".length()).addLengths(\"100\".length()).addLengths(\"-100\".length())\n .addLengths(\"100\".length()).addLengths(\"-1000\".length()).addLengths(\"1000\".length())\n .addLengths(\"24.52\".length()).addLengths(\"100.43\".length())\n .addLengths(\"2016-02-06 14:15:16\".length()).addLengths(\"2016-02-06\".length())\n .addLengths(\"12:34:56\".length()).addLengths(\"2016-02-06 14:15:16\".length())\n .addLengths(\"2016\".length()).addLengths(\"1234.56789\".length())\n .addLengths(\"HELLO TDS TEAM\".length()).addLengths(\"HELLO TDS TEAM\".length())\n .addLengths(\"HELLO TDS TEAM\".length()).addLengths(\"HELLO TDS TEAM\".length())\n .addLengths(\"N\".length()).addLengths(\"HELLO TDS TEAM\".length())\n .addLengths(\"1\".length()).addLengths(\"val123\".length())\n .addLengths(\"val123\".length()).setValues(ByteString\n .copyFromUtf8(\"-5050-2300023000-100100-100100-1000100024.52100.432016-02-06 \" +\n \"14:15:162016-02-0612:34:562016-02-06 14:15:1620161234.56789HELLO TDS TEAMHELLO TDS TEAMHELLO\"\n +\n \" TDS TEAMHELLO TDS TEAMNHELLO TDS TEAM1val123val123\"))).build());\n return cursor;\n }", "@Override\n public void buildIndexes(Properties props)\n {\n Statement statement;\n try\n {\n statement = connection.createStatement();\n \n //Create Indexes\n statement.executeUpdate(\"CREATE INDEX CONFFRIENDSHIP_INVITEEID ON CONFFRIENDSHIP (INVITEEID)\");\n statement.executeUpdate(\"CREATE INDEX CONFFRIENDSHIP_INVITERID ON CONFFRIENDSHIP (INVITERID)\");\n statement.executeUpdate(\"CREATE INDEX PENDFRIENDSHIP_INVITEEID ON PENDFRIENDSHIP (INVITEEID)\");\n statement.executeUpdate(\"CREATE INDEX PENDFRIENDSHIP_INVITERID ON PENDFRIENDSHIP (INVITERID)\");\n statement.executeUpdate(\"CREATE INDEX MANIPULATION_RID ON MANIPULATION (RID)\");\n statement.executeUpdate(\"CREATE INDEX MANIPULATION_CREATORID ON MANIPULATION (CREATORID)\");\n statement.executeUpdate(\"CREATE INDEX RESOURCES_WALLUSERID ON RESOURCES (WALLUSERID)\");\n statement.executeUpdate(\"CREATE INDEX RESOURCE_CREATORID ON RESOURCES (CREATORID)\");\n \n System.out.println(\"Indexes Built\");\n }\n catch (Exception ex)\n {\n Logger.getLogger(WindowsAzureClientInit.class.getName()).log(Level.SEVERE, null, ex);\n System.out.println(\"Error in building indexes!\");\n }\n }", "public List<TransactionReportRow> generateReportOnAllReserveTransactions(int start, int numOfRows) throws MiddlewareQueryException;", "AccessKeyRecordEntity selectByPrimaryKey(String accessKeyId);", "@Test\n// @Ignore(\"KnownBug: ACCUMULO-3646\")\n public void testInjectOnScan() throws Exception {\n Connector conn = tester.getConnector();\n\n // create table, add table split, write data\n final String tableName = getUniqueNames(1)[0];\n Map<Key, Value> input = new HashMap<>();\n input.put(new Key(\"aTablet1\", \"\", \"cq\"), new Value(\"7\".getBytes(StandardCharsets.UTF_8)));\n input.put(new Key(\"kTablet2\", \"\", \"cq\"), new Value(\"7\".getBytes(StandardCharsets.UTF_8)));\n input.put(new Key(\"zTablet2\", \"\", \"cq\"), new Value(\"7\".getBytes(StandardCharsets.UTF_8)));\n SortedSet<Text> splitset = new TreeSet<>();\n splitset.add(new Text(\"f\"));\n TestUtil.createTestTable(conn, tableName, splitset, input);\n\n // expected data back\n Map<Key, Value> expect = new HashMap<>(input);\n expect.putAll(HardListIterator.allEntriesToInject);\n\n // attach InjectIterator\n IteratorSetting itset = new IteratorSetting(15, InjectIterator.class);\n conn.tableOperations().attachIterator(tableName, itset, EnumSet.of(IteratorUtil.IteratorScope.scan));\n itset = new IteratorSetting(16, DebugIterator.class);\n conn.tableOperations().attachIterator(tableName, itset, EnumSet.of(IteratorUtil.IteratorScope.scan));\n\n // read back both tablets in parallel\n BatchScanner scan = conn.createBatchScanner(tableName, Authorizations.EMPTY, 2);\n// Key startKey = new Key(new Text(\"d\"), cf, cq);\n Range rng = new Range();\n scan.setRanges(Collections.singleton(rng));\n log.debug(\"Results of scan on table \" + tableName + ':');\n Map<Key, Value> actual = new TreeMap<>(TestUtil.COMPARE_KEY_TO_COLQ); // only compare row, colF, colQ\n for (Map.Entry<Key, Value> entry : scan) {\n Key k = entry.getKey();\n Value v = entry.getValue();\n log.debug(k + \" \" + v);\n Assert.assertFalse(\"Duplicate entry found: \" + k, actual.containsKey(k)); // Fails\n actual.put(k, v);\n }\n //TestUtil.assertEqualEntriesRowColFColQ(expect, actual);\n Assert.assertEquals(expect, actual);\n\n // delete test data\n conn.tableOperations().delete(tableName);\n }", "public WALRecord next() throws IgniteCheckedException {\n try {\n for (;;) {\n if (!iterator.hasNextX())\n return null;\n\n IgniteBiTuple<WALPointer, WALRecord> tup = iterator.nextX();\n\n if (tup == null)\n return null;\n\n WALRecord rec = tup.get2();\n\n WALPointer ptr = tup.get1();\n\n rec.position(ptr);\n\n // Filter out records by group id.\n if (rec instanceof WalRecordCacheGroupAware) {\n WalRecordCacheGroupAware grpAwareRecord = (WalRecordCacheGroupAware) rec;\n\n if (!cacheGroupPredicate.apply(grpAwareRecord.groupId()))\n continue;\n }\n\n // Filter out data entries by group id.\n if (rec instanceof DataRecord)\n rec = filterEntriesByGroupId((DataRecord) rec);\n\n return rec;\n }\n }\n catch (IgniteCheckedException e) {\n boolean throwsCRCError = throwsCRCError();\n\n if (X.hasCause(e, IgniteDataIntegrityViolationException.class)) {\n if (throwsCRCError)\n throw e;\n else\n return null;\n }\n\n log.error(\"There is an error during restore state [throwsCRCError=\" + throwsCRCError + ']', e);\n\n throw e;\n }\n }", "public DbIterator iterator() {\n // some code goes here\n if (gbfield == Aggregator.NO_GROUPING) {\n Type[] tp = new Type[1];\n tp[0] = Type.INT_TYPE;\n String[] fn = new String[1];\n fn[0] = aop.toString();\n TupleDesc td = new TupleDesc(tp, fn);\n Tuple t = new Tuple(td);\n t.setField(0, new IntField(gbCount.get(null)));\n ArrayList<Tuple> a = new ArrayList<>();\n a.add(t);\n return new TupleIterator(td, a);\n } else {\n Type[] tp = new Type[2];\n tp[0] = gbfieldtype;\n tp[1] = Type.INT_TYPE;\n String[] fn = new String[2];\n fn[0] = gbname;\n fn[1] = aop.toString();\n TupleDesc td = new TupleDesc(tp, fn);\n ArrayList<Tuple> a = new ArrayList<>();\n for (Field f : gbCount.keySet()) {\n Tuple t = new Tuple(td);\n t.setField(0, f);\n t.setField(1, new IntField(gbCount.get(f)));\n a.add(t);\n }\n return new TupleIterator(td, a);\n }\n }", "@Override\n\tpublic IDBResultSet selectByLimit(ITableDBContext context, Table table, IDBFilter filter, long startRow, int count)\n\t\t\tthrows Throwable {\n\t\tthrow new Warning(\"not impl\");\n\t}", "public List<InsuranceCompanyInfo> findAll(int... rowStartIdxAndCount);", "private void buildRowMapping() {\n final Map<String, ColumnDescriptor> targetSource = new TreeMap<>();\n\n // build a DB path .. find parent node that terminates the joint group...\n PrefetchTreeNode jointRoot = this;\n while (jointRoot.getParent() != null && !jointRoot.isDisjointPrefetch()\n && !jointRoot.isDisjointByIdPrefetch()) {\n jointRoot = jointRoot.getParent();\n }\n\n final String prefix;\n if (jointRoot != this) {\n Expression objectPath = ExpressionFactory.pathExp(getPath(jointRoot));\n ASTPath translated = (ASTPath) ((PrefetchProcessorNode) jointRoot)\n .getResolver()\n .getEntity()\n .translateToDbPath(objectPath);\n\n // make sure we do not include \"db:\" prefix\n prefix = translated.getOperand(0) + \".\";\n } else {\n prefix = \"\";\n }\n\n // find propagated keys, assuming that only one-step joins\n // share their column(s) with parent\n\n if (getParent() != null\n && !getParent().isPhantom()\n && getIncoming() != null\n && !getIncoming().getRelationship().isFlattened()) {\n\n DbRelationship r = getIncoming()\n .getRelationship()\n .getDbRelationships()\n .get(0);\n for (final DbJoin join : r.getJoins()) {\n appendColumn(targetSource, join.getTargetName(), prefix\n + join.getTargetName());\n }\n }\n\n ClassDescriptor descriptor = resolver.getDescriptor();\n\n descriptor.visitAllProperties(new PropertyVisitor() {\n\n public boolean visitAttribute(AttributeProperty property) {\n String target = property.getAttribute().getDbAttributePath();\n if(!property.getAttribute().isLazy()) {\n appendColumn(targetSource, target, prefix + target);\n }\n return true;\n }\n\n public boolean visitToMany(ToManyProperty property) {\n return visitRelationship(property);\n }\n\n public boolean visitToOne(ToOneProperty property) {\n return visitRelationship(property);\n }\n\n private boolean visitRelationship(ArcProperty arc) {\n DbRelationship dbRel = arc.getRelationship().getDbRelationships().get(0);\n for (DbAttribute attribute : dbRel.getSourceAttributes()) {\n String target = attribute.getName();\n\n appendColumn(targetSource, target, prefix + target);\n }\n return true;\n }\n });\n\n // append id columns ... (some may have been appended already via relationships)\n for (String pkName : descriptor.getEntity().getPrimaryKeyNames()) {\n appendColumn(targetSource, pkName, prefix + pkName);\n }\n\n // append inheritance discriminator columns...\n for (ObjAttribute column : descriptor.getDiscriminatorColumns()) {\n String target = column.getDbAttributePath();\n appendColumn(targetSource, target, prefix + target);\n }\n\n int size = targetSource.size();\n this.rowCapacity = (int) Math.ceil(size / 0.75);\n this.columns = new ColumnDescriptor[size];\n targetSource.values().toArray(columns);\n }", "public abstract Cursor buildCursor();", "private Rows(com.google.protobuf.GeneratedMessageV3.Builder<?> builder) {\n super(builder);\n }", "@Test\n public void testInjectOnScan_Empty_Reg() throws Exception {\n Connector conn = tester.getConnector();\n\n // create table, add table split, write data\n final String tableName = getUniqueNames(1)[0];\n SortedSet<Text> splitset = new TreeSet<>();\n splitset.add(new Text(\"f\"));\n TestUtil.createTestTable(conn, tableName, splitset);\n\n // expected data back\n Map<Key, Value> expect = new HashMap<>(HardListIterator.allEntriesToInject);\n\n // attach InjectIterator\n IteratorSetting itset = new IteratorSetting(15, InjectIterator.class);\n conn.tableOperations().attachIterator(tableName, itset, EnumSet.of(IteratorUtil.IteratorScope.scan));\n itset = new IteratorSetting(16, DebugIterator.class);\n conn.tableOperations().attachIterator(tableName, itset, EnumSet.of(IteratorUtil.IteratorScope.scan));\n\n // read back both tablets in parallel\n Scanner scan = conn.createScanner(tableName, Authorizations.EMPTY);\n// Key startKey = new Key(new Text(\"d\"), cf, cq);\n\n log.debug(\"Results of scan on table \" + tableName + ':');\n Map<Key, Value> actual = new TreeMap<>(TestUtil.COMPARE_KEY_TO_COLQ); // only compare row, colF, colQ\n for (Map.Entry<Key, Value> entry : scan) {\n Key k = entry.getKey();\n Value v = entry.getValue();\n log.debug(k + \" \" + v);\n Assert.assertFalse(\"Duplicate entry found: \" + k, actual.containsKey(k)); // passes on normal scanner\n actual.put(k, v);\n }\n Assert.assertEquals(expect, actual);\n\n // delete test data\n conn.tableOperations().delete(tableName);\n }", "static DbQuery createKeyQuery() {\n DbQuery query = new DbQuery();\n query.order = OrderBy.KEY;\n return query;\n }", "public QueryResult withConsumedCapacity(ConsumedCapacity consumedCapacity) {\n setConsumedCapacity(consumedCapacity);\n return this;\n }", "public QueryInfo(\r\n InlineCount inlineCount,\r\n Integer top,\r\n Integer skip,\r\n BoolCommonExpression filter,\r\n List<OrderByExpression> orderBy,\r\n String skipToken,\r\n Map<String, String> customOptions,\r\n List<EntitySimpleProperty> expand,\r\n List<EntitySimpleProperty> select) {\r\n this.inlineCount = inlineCount;\r\n this.top = top;\r\n this.skip = skip;\r\n this.filter = filter;\r\n this.orderBy = orderBy;\r\n this.skipToken = skipToken;\r\n this.customOptions = customOptions == null ? Collections.<String, String> emptyMap() : Collections.unmodifiableMap(customOptions);\r\n this.expand = expand == null ? Collections.<EntitySimpleProperty> emptyList() : Collections.unmodifiableList(expand);\r\n this.select = select == null ? Collections.<EntitySimpleProperty> emptyList() : Collections.unmodifiableList(select);\r\n }", "private SearchSourceBuilder buildBaseSearchSource() {\n long histogramSearchStartTime = Math.max(0, context.start - ExtractorUtils.getHistogramIntervalMillis(context.aggs));\n\n SearchSourceBuilder searchSourceBuilder = new SearchSourceBuilder()\n .size(0)\n .query(ExtractorUtils.wrapInTimeRangeQuery(context.query, context.timeField, histogramSearchStartTime, context.end));\n\n context.aggs.getAggregatorFactories().forEach(searchSourceBuilder::aggregation);\n context.aggs.getPipelineAggregatorFactories().forEach(searchSourceBuilder::aggregation);\n return searchSourceBuilder;\n }", "private GeneralQueryFormat createQueryFromRow(int rowNum) {\n String fname = this.employee_first_name.get(rowNum);\n String lname = this.employee_last_name.get(rowNum);\n String mname = this.employee_middle_initial.get(rowNum);\n String ssn = this.employee_ssn.get(rowNum);\n String address = this.employee_address.get(rowNum);\n String address2 = this.employee_address2.get(rowNum);\n String city = this.employee_city.get(rowNum);\n String state = this.employee_state.get(rowNum);\n String zip = this.employee_zip.get(rowNum);\n String phone = this.employee_phone.get(rowNum);\n String phone2 = this.employee_phone2.get(rowNum);\n String pager = this.employee_pager.get(rowNum);\n String cell = this.employee_cell.get(rowNum);\n String email = this.employee_email.get(rowNum);\n String bdate = this.employee_birthdate.get(rowNum);\n String branchId = this.branch.getBranchId() + \"\";\n String hireDate = this.employee_hire_date.get(rowNum);\n \n ssn = ssn.replaceAll(\"-\", \"\");\n if(bdate.equals(\"\")) bdate = \"01/01/1000\";\n if(hireDate.equals(\"\")) hireDate = \"NOW()\";\n \n employee_save_query query = new employee_save_query();\n query.setCompany(company.getName());\n //query.update(fname, lname, mname, phone, phone2, cell, pager, address, address2, city, state, zip, ssn, email, hireDate, \"2100-10-10\",\n // \"(CASE WHEN (SELECT (MAX(employee_id) + 1) From employee) IS NULL THEN 1 ELSE (SELECT (MAX(employee_id) + 1) From employee) END)\",\n // \"0\", false, bdate, this.branch.getId());\n return query;\n }", "public <E extends com.intuit.datasource.jooq.information_schema.tables.interfaces.IKeyColumnUsage> E into(E into);", "private void readIndex() throws IOException {\n\t\t\tif (this.keys != null)\n\t\t\t\treturn;\n\t\t\tkeys = new HashMap<K, Long>(1024);\n\t\t\ttry {\n\t\t\t\twhile (index.hasNext()) {\n\t\t\t\t\tPair<K, Long> pair;// = new Pair<K, Long>(index.getSchema());\n\t\t\t\t\tpair = index.next();\n\t\t\t\t\tkeys.put(pair.key(), pair.value());\n\t\t\t\t\tif (firstKey == null)\n\t\t\t\t\t\tfirstKey = pair.key();\n\t\t\t\t\tfinalKey = pair.key();\n\t\t\t\t\tcount++;\n\t\t\t\t}\n\n\t\t\t}finally {\n\t\t\t\tindexClosed = true;\n\t\t\t\tindex.close();\n\t\t\t}\n\t\t}", "public abstract void startSingleScan();", "public RecordBuffer prepareRecordBuffer(\n Column[] columns,\n FilterPredicate predicate,\n HashMap<Column, Statistics> stats) {\n // Since we are using statistics on a field, we have to make sure that it is initialized\n // properly\n if (stats == null) {\n stats = new HashMap<Column, Statistics>();\n }\n\n // Find out appropriate strategy for set of columns and predicate. We also update statistics\n // with start and end capture time of the file.\n NetFlow flowInterface;\n if (header.getFlowVersion() == 5) {\n flowInterface = new NetFlowV5();\n stats.put(NetFlowV5.FIELD_UNIX_SECS,\n new LongStatistics(header.getStartCapture(), header.getEndCapture()));\n } else if (header.getFlowVersion() == 7) {\n flowInterface = new NetFlowV7();\n stats.put(NetFlowV7.FIELD_UNIX_SECS,\n new LongStatistics(header.getStartCapture(), header.getEndCapture()));\n } else {\n throw new UnsupportedOperationException(\"Version \" + header.getFlowVersion() +\n \" is not supported\");\n }\n\n ScanStrategy strategy = ScanPlanner.buildStrategy(columns, predicate, stats);\n return prepareRecordBuffer(strategy, flowInterface);\n }", "public QueryResult withScannedCount(Integer scannedCount) {\n setScannedCount(scannedCount);\n return this;\n }", "public MetricSchemaRecord() { }", "@Override\n protected Iterator<? extends Map<String, AttributeValue>> nextIterator(final int count) {\n if (count == 1) {\n return currentResult.getItems().iterator();\n }\n // subsequent chained iterators will be obtained from dynamoDB\n // pagination\n if ((currentResult.getLastEvaluatedKey() == null)\n || currentResult.getLastEvaluatedKey().isEmpty()) {\n return null;\n } else {\n request.setExclusiveStartKey(currentResult.getLastEvaluatedKey());\n currentResult = dynamoDBClient.query(request);\n return currentResult.getItems().iterator();\n }\n }", "public synchronized ResultScanner getScanner(String startRow,\n String stopRow, Filter filter, int caching, boolean cacheBlocks)\n throws IOException {\n Scan scan = new Scan(Bytes.toBytes(startRow), Bytes.toBytes(stopRow));\n scan.setCacheBlocks(cacheBlocks);\n scan.setCaching(caching);\n if (filter != null) {\n scan.setFilter(filter);\n }\n return table.getScanner(scan);\n }", "private void buildPKIndex() {\n // index PK\n Collection<DbAttribute> pks = getResolver()\n .getEntity()\n .getDbEntity()\n .getPrimaryKeys();\n this.idIndices = new int[pks.size()];\n\n // this is needed for checking that a valid index is made\n Arrays.fill(idIndices, -1);\n\n Iterator<DbAttribute> it = pks.iterator();\n for (int i = 0; i < idIndices.length; i++) {\n DbAttribute pk = it.next();\n\n for (int j = 0; j < columns.length; j++) {\n if (pk.getName().equals(columns[j].getName())) {\n idIndices[i] = j;\n break;\n }\n }\n\n // sanity check\n if (idIndices[i] == -1) {\n throw new CayenneRuntimeException(\"PK column is not part of result row: %s\", pk.getName());\n }\n }\n }", "protected abstract ReaderType newBuilder();", "public DbIterator iterator() {\n // some code goes here\n //throw new UnsupportedOperationException(\"please implement me for proj2\");\n List<Tuple> tuparr = new ArrayList<Tuple>();\n Type[] typearr = new Type[]{gbfieldtype, Type.INT_TYPE};\n TupleDesc fortup = new TupleDesc(typearr, new String[]{null, null});\n Object[] keys = groups.keySet().toArray();\n for (int i = 0; i < keys.length; i++) {\n \n int key = (Integer) keys[i];\n \n Tuple tup = new Tuple(fortup);\n if (gbfieldtype == Type.STRING_TYPE) {\n tup.setField(0, hashstr.get(key));\n }\n else {\n tup.setField(0, new IntField(key));\n }\n //tup.setField(0, new IntField(key));\n tup.setField(1, new IntField(groups.get(key)));\n tuparr.add(tup); \n\n }\n List<Tuple> immutable = Collections.unmodifiableList(tuparr);\n TupleIterator tupiter = new TupleIterator(fortup, immutable);\n if (gbfield == NO_GROUPING) {\n List<Tuple> tuparr1 = new ArrayList<Tuple>();\n TupleDesc fortup1 = new TupleDesc(new Type[]{Type.INT_TYPE}, new String[]{null});\n Tuple tup1 = new Tuple(fortup1);\n tup1.setField(0, new IntField(groups.get(-1)));\n tuparr1.add(tup1);\n List<Tuple> immutable1 = Collections.unmodifiableList(tuparr1);\n TupleIterator tupiter1 = new TupleIterator(fortup1, immutable1);\n \n return (DbIterator) tupiter1;\n }\n return (DbIterator) tupiter;\n }", "private void queryFlat(int columnCount, ResultTarget result, long limitRows) {\n if (limitRows > 0 && offsetExpr != null) {\r\n int offset = offsetExpr.getValue(session).getInt();\r\n if (offset > 0) {\r\n limitRows += offset;\r\n }\r\n }\r\n int rowNumber = 0;\r\n prepared.setCurrentRowNumber(0);\r\n int sampleSize = getSampleSizeValue(session);\r\n while (topTableFilter.next()) {\r\n prepared.setCurrentRowNumber(rowNumber + 1);\r\n if (condition == null ||\r\n Boolean.TRUE.equals(condition.getBooleanValue(session))) {\r\n Value[] row = new Value[columnCount];\r\n for (int i = 0; i < columnCount; i++) {\r\n Expression expr = expressions.get(i);\r\n row[i] = expr.getValue(session);\r\n }\r\n result.addRow(row);\r\n rowNumber++;\r\n if ((sort == null) && limitRows > 0 &&\r\n result.getRowCount() >= limitRows) {\r\n break;\r\n }\r\n if (sampleSize > 0 && rowNumber >= sampleSize) {\r\n break;\r\n }\r\n }\r\n }\r\n }", "io.dstore.engine.procedures.MiCheckPerformanceAd.Response.RowOrBuilder getRowOrBuilder(\n int index);", "com.google.devtools.kythe.proto.Filecontext.ContextDependentVersion.RowOrBuilder getRowOrBuilder(\n int index);", "@Inject\n public ImmutableRetrieve(final CqlSession session, @MutableReadConsistency final ConsistencyLevel consistency) {\n super(session, \"SELECT quads FROM \" + IMMUTABLE_TABLENAME + \" WHERE identifier = :identifier ;\", consistency);\n }", "int cacheRowsWhenScan();", "public Scan(byte[] buffer) throws IOException, ClassNotFoundException\n\t{\n\t\t_type = TYPE;\n\t\tdeserialize(buffer);\n\t}", "@Test\n// @Ignore(\"KnownBug: ACCUMULO-3646\")\n public void testInjectOnScan_Empty() throws Exception {\n Connector conn = tester.getConnector();\n\n // create table, add table split, write data\n final String tableName = getUniqueNames(1)[0];\n SortedSet<Text> splitset = new TreeSet<>();\n splitset.add(new Text(\"f\"));\n TestUtil.createTestTable(conn, tableName, splitset);\n\n // expected data back\n Map<Key, Value> expect = new HashMap<>(HardListIterator.allEntriesToInject);\n\n // attach InjectIterator\n IteratorSetting itset = new IteratorSetting(15, InjectIterator.class);\n conn.tableOperations().attachIterator(tableName, itset, EnumSet.of(IteratorUtil.IteratorScope.scan));\n itset = new IteratorSetting(16, DebugIterator.class);\n conn.tableOperations().attachIterator(tableName, itset, EnumSet.of(IteratorUtil.IteratorScope.scan));\n\n // read back both tablets in parallel\n BatchScanner scan = conn.createBatchScanner(tableName, Authorizations.EMPTY, 2);\n// Key startKey = new Key(new Text(\"d\"), cf, cq);\n Range rng = new Range();\n scan.setRanges(Collections.singleton(rng));\n log.debug(\"Results of scan on table \" + tableName + ':');\n Map<Key, Value> actual = new TreeMap<>(TestUtil.COMPARE_KEY_TO_COLQ); // only compare row, colF, colQ\n for (Map.Entry<Key, Value> entry : scan) {\n Key k = entry.getKey();\n Value v = entry.getValue();\n log.debug(k + \" \" + v);\n // fails on BatchScanner when iterator generates entries past its range\n Assert.assertFalse(\"Duplicate entry found: \" + k, actual.containsKey(k));\n actual.put(k, v);\n }\n Assert.assertEquals(expect, actual);\n\n // delete test data\n conn.tableOperations().delete(tableName);\n }", "public io.dstore.engine.procedures.MiCheckPerformanceAd.Response.Row.Builder getRowBuilder(\n int index) {\n return getRowFieldBuilder().getBuilder(index);\n }", "public KeyedFilter(StreamInput in) throws IOException {\n key = in.readString();\n filter = in.readNamedWriteable(QueryBuilder.class);\n }", "public FennelTempIdxSearchRel(\n RelNode sourceRel,\n Integer [] indexKeys,\n RelNode child,\n Integer [] inputKeyProj,\n Integer [] inputDirectiveProj,\n FennelRelParamId [] searchKeyParamIds,\n Integer [] keyOffsets,\n FennelRelParamId rootPageIdParamId)\n {\n super(\n sourceRel.getCluster(),\n child);\n this.sourceRel = sourceRel;\n this.indexKeys = indexKeys;\n this.inputKeyProj = inputKeyProj;\n this.inputDirectiveProj = inputDirectiveProj;\n this.searchKeyParamIds = searchKeyParamIds;\n this.keyOffsets = keyOffsets;\n this.rootPageIdParamId = rootPageIdParamId;\n }", "Get<K, C> withColumnLimit(int limit);", "public CalcCountRecord(int cnt)\r\n/* 14: */ {\r\n/* 15:48 */ super(Type.CALCCOUNT);\r\n/* 16:49 */ this.calcCount = cnt;\r\n/* 17: */ }", "static <R,C> DataFrame<R,C> ofInts(R rowKey, Iterable<C> colKeys) {\n return DataFrame.factory().from(Index.singleton(rowKey), colKeys, Integer.class);\n }", "Flowable<T> query(IDynamoDBMapper mapper);", "private Builder() {\n super(org.apache.gora.cascading.test.storage.TestRow.SCHEMA$);\n }", "private SAMRecord recordFromFastq(FastqRecord record, SAMFileHeader header) {\n\t\t// generate record that already have everything set to undefined (flag is 0, so it is important to change this)\n\t\tSAMRecord toReturn = new SAMRecord(header);\n\t\t// set the name for the record\n\t\ttoReturn.setReadName(record.getReadHeader().replaceAll(\"/[12]\", \"\"));\n\t\t// set the bases\n\t\ttoReturn.setReadString(record.getReadString());\n\t\t// set the qualities\n\t\ttoReturn.setBaseQualityString(record.getBaseQualityString());\n\t\t// set unmapped flag\n\t\ttoReturn.setReadUnmappedFlag(true);\n\t\treturn toReturn;\n\t}", "Get<K, C> withColumnRange(C startColumn,\n boolean startColumnInclusive,\n C endColumn,\n boolean endColumnInclusive,\n int limit);", "private RowKeyFormat2 makeHashPrefixedRowKeyFormat() {\n ArrayList<RowKeyComponent> components = new ArrayList<RowKeyComponent>();\n components.add(RowKeyComponent.newBuilder()\n .setName(\"NAME\").setType(ComponentType.STRING).build());\n\n // build the row key format\n RowKeyFormat2 format = RowKeyFormat2.newBuilder().setEncoding(RowKeyEncoding.FORMATTED)\n .setSalt(HashSpec.newBuilder().build())\n .setComponents(components)\n .build();\n\n return format;\n }", "public SAMRecord next() {\n SAMRecord rec = wrappedIterator.next();\n\n // Always consolidate the cigar string into canonical form, collapsing zero-length / repeated cigar elements.\n // Downstream code (like LocusIteratorByState) cannot necessarily handle non-consolidated cigar strings.\n rec.setCigar(AlignmentUtils.consolidateCigar(rec.getCigar()));\n\n // if we are using default quals, check if we need them, and add if necessary.\n // 1. we need if reads are lacking or have incomplete quality scores\n // 2. we add if defaultBaseQualities has a positive value\n if (defaultBaseQualities >= 0) {\n byte reads [] = rec.getReadBases();\n byte quals [] = rec.getBaseQualities();\n if (quals == null || quals.length < reads.length) {\n byte new_quals [] = new byte [reads.length];\n for (int i=0; i<reads.length; i++)\n new_quals[i] = defaultBaseQualities;\n rec.setBaseQualities(new_quals);\n }\n }\n\n // if we are using original quals, set them now if they are present in the record\n if ( useOriginalBaseQualities ) {\n byte[] originalQuals = rec.getOriginalBaseQualities();\n if ( originalQuals != null )\n rec.setBaseQualities(originalQuals);\n }\n\n return rec;\n }", "@Override\n\tpublic void scan(Transaction tx) {\n\n\t}", "public DbIterator iterator() {\n \tTupleDesc td = generateTupleDesc();\n List<Tuple> tuples = new ArrayList<Tuple>();\n if(gbField == NO_GROUPING){\n \tTuple tuple = new Tuple(td);\n \ttuple.setField(0, new IntField(tupleCounts.get(null)));\n \ttuples.add(tuple);\n } else {\n \tfor(Object key : tupleCounts.keySet()){\n \t\tTuple tuple = new Tuple(td);\n \t\ttuple.setField(0, (Field)key);\n \t\ttuple.setField(1, new IntField(tupleCounts.get(key)));\n \t\ttuples.add(tuple);\n \t}\n }\n return new TupleIterator(td, tuples);\n }", "public abstract DBIterator NewIterator(ReadOptions options);", "private ReadRequest(com.google.protobuf.GeneratedMessageV3.Builder<?> builder) {\n super(builder);\n }", "com.google.cloud.dataplex.v1.DataScanOrBuilder getDataScansOrBuilder(int index);", "public void visit(Scan op) {\n\t\tRelation input = op.getRelation();\n\t\tRelation output = new Relation(input.getTupleCount());\n\t\t\n\t\tIterator<Attribute> iter = input.getAttributes().iterator();\n\t\twhile (iter.hasNext()) {\n\t\t\toutput.addAttribute(new Attribute(iter.next()));\n\t\t}\n\t\t\n\t\top.setOutput(output);\n\t}", "private Reader (Builder builder) {\n\t\tsuper(builder);\n\t}", "public RowDataCursor(MysqlIO ioChannel, ServerPreparedStatement creatingStatement, Field[] metadata) {\n/* 112 */ this.currentPositionInEntireResult = -1;\n/* 113 */ this.metadata = metadata;\n/* 114 */ this.mysql = ioChannel;\n/* 115 */ this.statementIdOnServer = creatingStatement.getServerStatementId();\n/* 116 */ this.prepStmt = creatingStatement;\n/* 117 */ this.useBufferRowExplicit = MysqlIO.useBufferRowExplicit(this.metadata);\n/* */ }", "void getRowKeys(Iterable<ConsumerGroupConfig> consumerGroupConfigs, QueueEntry queueEntry, byte[] rowKeyPrefix,\n long writePointer, int counter, Collection<byte[]> rowKeys);", "public void createInputRow() throws IOException {\n\t\tStringBuilder fileData = new StringBuilder();\n\t\tfileData.append(\"package dbmsProject;\\n\");\n\t\tfileData.append(\"public class InputRow{\\n\");\n\t\tArrayList<String> list = new ArrayList<String>( Arrays.asList(new String[]{\"cust\", \"prod\", \"day\", \"month\", \"year\", \"state\", \"quant\"}));\n\t\tfor(int i=0;i<list.size();i++ ) {\n\t\t\tString select = list.get(i);\n\t\t\tboolean found=false;\n\t\t\tfor(String str: payload.getselect_variables()) {\n\t\t\t\tif(str.contains(select)) {\n\t\t\t\t\tprojectionVars.add(select);\n\t\t\t\t\tfileData=createrSetterGetter(fileData, helper.columnMapping.get(select), select);\n\t\t\t\t\tfound=true;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t\tif(found) continue;\n\t\t\tfor(String str: payload.getgrouping_attributes()) {\n\t\t\t\tif(str.contains(select)) {\n\t\t\t\t\tprojectionVars.add(select);\n\t\t\t\t\tfileData=createrSetterGetter(fileData, helper.columnMapping.get(select), select);\n\t\t\t\t\tfound=true;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t\tif(found) continue;\n\t\t\tfor(String str: payload.getaggregate_functions()) {\n\t\t\t\tif(str.contains(select)) {\n\t\t\t\t\tprojectionVars.add(select);\n\t\t\t\t\tfileData=createrSetterGetter(fileData, helper.columnMapping.get(select), select);\n\t\t\t\t\tfound=true;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t\tif(found) continue;\n\t\t\tfor(String str: payload.getsuch_that_predicates()) {\n\t\t\t\tif(str.contains(select)) {\n\t\t\t\t\tprojectionVars.add(select);\n\t\t\t\t\tfileData=createrSetterGetter(fileData, helper.columnMapping.get(select), select);\n\t\t\t\t\tfound=true;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t\tif(found) continue;\n\t\t\tif(payload.isHavingClause() && payload.getHavingClause().contains(select)) {\n\t\t\t\tprojectionVars.add(select);\n\t\t\t\tfileData=createrSetterGetter(fileData, helper.columnMapping.get(select), select);\n\t\t\t\tfound=true;\n\t\t\t}\n\t\t\tif(found) continue;\n\t\t\tif(payload.getIsWhereClause() && payload.getWhereClause().contains(select)) {\n\t\t\t\tprojectionVars.add(select);\n\t\t\t\tfileData=createrSetterGetter(fileData, helper.columnMapping.get(select), select);\n\t\t\t}\n\t\t}\n\t\t\n\t\tfileData.append(\"}\\n\");\n\t\tFileOutputStream fos = new FileOutputStream(\"src/dbmsProject/InputRow.java\");\n\t\tfos.write(fileData.toString().getBytes());\n\t\tfos.flush();\n\t\tfos.close();\n\t}", "Get<K, C> withColumnRange(C startColumn,\n boolean startColumnInclusive,\n C endColumn,\n boolean endColumnInclusive,\n int limit,\n Filter<K, C>... filters);", "private Builder() {\n super(com.autodesk.ws.avro.Call.SCHEMA$);\n }", "public List<Transaction> getAllReserveTransactions(int start, int numOfRows) throws MiddlewareQueryException;", "public RowStreamer(Iterable<KijiRowData> scanner, KijiTable table, int numRows,\n List<KijiColumnName> columns, KijiSchemaTable schemaTable) {\n mScanner = scanner;\n mTable = table;\n mNumRows = numRows;\n mColsRequested = columns;\n mSchemaTable = schemaTable;\n }", "private SourceRecord convertTransactionDataRecord (\n DomainRecord domainRecord\n ) \n throws Exception \n {\n if (!domainRecord.isTransactionInfoRecord()) {\n throw new Exception (\n \"Invalid transaction data record, reason type is \" + \n domainRecord.getDomainRecordType()\n );\n }\n \n TransactionInfoRecord txr = (TransactionInfoRecord) domainRecord;\n \n Struct kstruct = null;\n Schema kschema = null;\n Schema vschema = schema.valueSchema();\n String topic = vschema.name();\n String partKey = topic;\n\n if (mode.publishKeys()) {\n /* set key schema and value for publishing keys */\n kschema = schema.keySchema();\n if (kschema == null) {\n throw new Exception (\n \"Connector is configured to publish keys, but none \" +\n \"available for topic: \" + vschema.name()\n );\n }\n kstruct = new Struct (kschema);\n }\n else {\n /* sanity check */\n if (schema.keySchema() != null) {\n logger.warn (\n \"Connector is configured to not publish keys, but key \" +\n \"schema is available for topic: \" + vschema.name()\n );\n }\n }\n \n if (mode.publishKeys()) {\n kstruct.put (\"XID\", txr.getId());\n }\n \n Struct vstruct = new Struct (vschema);\n \n vstruct.put (\"XID\", txr.getId());\n vstruct.put (\"START_SCN\", txr.getStartSCN());\n vstruct.put (\"END_SCN\", txr.getEndSCN());\n vstruct.put (\"START_TIME\", txr.getStartTime());\n vstruct.put (\"END_TIME\", txr.getEndTime());\n vstruct.put (\"START_CHANGE_ID\", txr.getStartRecordId());\n vstruct.put (\"END_CHANGE_ID\", txr.getEndRecordId());\n vstruct.put (\"CHANGE_COUNT\", txr.getRecordCount());\n \n /* array of structs to hold counts per replicated schema */\n List<Struct> sarray = new ArrayList<Struct>();\n Map<String, Integer> counts = txr.getSchemaRecordCounts();\n for (String name : counts.keySet()) {\n Integer count = counts.get (name);\n Struct cstruct = new Struct (\n vschema.field(\"SCHEMA_CHANGE_COUNT_ARRAY\")\n .schema().valueSchema()\n );\n cstruct.put (\"SCHEMA_NAME\", name);\n cstruct.put (\"CHANGE_COUNT\", count);\n sarray.add (cstruct);\n }\n \n vstruct.put (\"SCHEMA_CHANGE_COUNT_ARRAY\", sarray);\n \n SourceRecord srecord = null;\n if (mode.publishKeys()) {\n srecord = new SourceRecord (\n Collections.singletonMap(\n ReplicateSourceTask.REPLICATE_NAME_KEY, \n partKey\n ),\n Collections.singletonMap(\n ReplicateSourceTask.REPLICATE_OFFSET_KEY,\n txr.getReplicateOffset().toJSONString()\n ),\n topic,\n kschema,\n kstruct,\n vschema, \n vstruct\n );\n }\n else {\n srecord = new SourceRecord (\n Collections.singletonMap(\n ReplicateSourceTask.REPLICATE_NAME_KEY, \n partKey\n ),\n Collections.singletonMap(\n ReplicateSourceTask.REPLICATE_OFFSET_KEY,\n txr.getReplicateOffset().toJSONString()\n ),\n topic, \n vschema, \n vstruct\n );\n }\n \n return srecord;\n }", "Records_type createRecordsFor(SearchTask st,\n int[] preferredRecordSyntax,\n int start,\n int count, String recordFormatSetname)\n {\n Records_type retval = new Records_type();\n \n LOGGER.finer(\"createRecordsFor(st, \"+start+\",\"+count+\")\");\n LOGGER.finer(\"pref rec syn = \" + preferredRecordSyntax);\n LOGGER.finer(\"record setname = \" + recordFormatSetname);\n LOGGER.finer(\"search task = \" + st);\n \n // Try and do a normal present\n try\n {\n \tif ( start < 1 ) \n \t throw new PresentException(\"Start record must be > 0\",\"13\");\n \tint numRecs = st.getTaskResultSet().getFragmentCount();\n \t\n \tLOGGER.finer(\"numresults = \" + numRecs);\n \tint requestedNum = start + count - 1;\n \tif ( requestedNum > numRecs ) {\n \t count = numRecs - (start - 1);\n \t if (start + count -1 > numRecs) {\n \t\tLOGGER.finer(requestedNum + \" < \" + numRecs);\n \t\tthrow new PresentException\n \t\t (\"Start+Count-1 (\" +requestedNum + \") must be < the \" + \n \t\t \" number of items in the result set: \" +numRecs ,\"13\");\n \t }\n \t}\n \t\n \t\n \tif ( st == null )\n \t throw new PresentException(\"Unable to locate result set\",\"30\");\n \t\n \tVector v = new Vector();\n \tretval.which = Records_type.responserecords_CID;\n \tretval.o = v;\n \t\n \tOIDRegisterEntry requested_syntax = null;\n \tString requested_syntax_name = null;\n \tif ( preferredRecordSyntax != null ) {\n \t requested_syntax = reg.lookupByOID(preferredRecordSyntax);\n \t if(requested_syntax==null) { // unsupported record syntax\n \t\tStringBuffer oid=new StringBuffer();\n \t\tfor(int i=0; i<preferredRecordSyntax.length; i++) {\n \t\t if(i!=0)\n \t\t\toid.append('.');\n \t\t oid.append(preferredRecordSyntax[i]);\n \t\t}\n \t\tLOGGER.warning(\"Unsupported preferredRecordSyntax=\"\n \t\t\t +oid.toString());\n \t\t\n \t\t// Need to set up diagnostic in here\n \t\tretval.which = Records_type.nonsurrogatediagnostic_CID;\n \t\tDefaultDiagFormat_type default_diag = \n \t\t new DefaultDiagFormat_type();\n \t\tretval.o = default_diag;\n \t\t\n \t\tdefault_diag.diagnosticSetId = reg.oidByName(\"diag-1\");\n \t\tdefault_diag.condition = BigInteger.valueOf(239);\n \t\tdefault_diag.addinfo = new addinfo_inline14_type();\n \t\tdefault_diag.addinfo.which = \n \t\t addinfo_inline14_type.v2addinfo_CID;\n \t\tdefault_diag.addinfo.o = (Object)(oid.toString());\n \t\treturn retval;\n \t }\n \t LOGGER.finer(\"requested_syntax=\"+requested_syntax);\n \t requested_syntax_name = requested_syntax.getName();\n\t if(requested_syntax_name.equals(\"usmarc\")) {\n\t\t//HACK! USMARC not yet supported...\n\t\trequested_syntax_name = \"sutrs\";\n\t }\n \t LOGGER.finer(\"requested_syntax_name=\"+requested_syntax_name);\n \t}\n \telse\n {\n\t requested_syntax_name = \"sutrs\"; //REVISIT: should this be\n \t //default? We're sure to have it...\n \t requested_syntax = reg.lookupByName(requested_syntax_name);\n }\n \t\n \tst.setRequestedSyntax(requested_syntax);\n \tst.setRequestedSyntaxName(requested_syntax_name);\n \t\t\n \tInformationFragment[] raw_records;\n \tRecordFormatSpecification rfSpec = \n \t new RecordFormatSpecification\n \t\t(requested_syntax_name, null, recordFormatSetname);\n \tLOGGER.finer(\"calling getFragment(\"+(start)+\",\"+count+\")\");\n \traw_records = st.getTaskResultSet().getFragment(start, count, rfSpec);\n \t\n \tif ( raw_records == null )\n \t throw new PresentException(\"Error retrieving records\",\"30\");\n \n \tfor ( int i=0; i<raw_records.length; i++ ) {\n \t\tLOGGER.finer(\"Adding record \"+i+\" to result\");\n \t\t\n \t\tNamePlusRecord_type npr = new NamePlusRecord_type();\n \t\tnpr.name = raw_records[i].getSourceCollectionName();\n \t\tnpr.record = new record_inline13_type();\n \t\tnpr.record.which = record_inline13_type.retrievalrecord_CID;\n \t\tEXTERNAL_type rec = new EXTERNAL_type();\n \t\tnpr.record.o = rec;\n \t\t\n \t\tif ( requested_syntax_name.equals(Z3950Constants.RECSYN_HTML) \n \t\t || requested_syntax_name.equals(\"sgml\")) {\n \t\t LOGGER.finer(\"Returning OctetAligned record for \"\n \t\t\t\t +requested_syntax_name);\n rec.direct_reference = \n \t\t\treg.oidByName(requested_syntax_name);\n \t\t rec.encoding = new encoding_inline0_type();\n \t\t rec.encoding.which = \n \t\t\tencoding_inline0_type.octet_aligned_CID;\n \t\t String raw_string = (String)raw_records[i].getOriginalObject();\n \t\t rec.encoding.o = raw_string.getBytes(); \n \t\t if(raw_string.length()==0) {\n \t\t\t\n \t\t\t// can't make a html record\n \t\t\tretval.which = Records_type.nonsurrogatediagnostic_CID;\n \t\t\tDefaultDiagFormat_type default_diag =\n \t\t\t new DefaultDiagFormat_type();\n \t\t\tretval.o = default_diag;\n \t\t\t\n \t\t\tdefault_diag.diagnosticSetId = reg.oidByName(\"diag-1\");\n \t\t\tdefault_diag.condition = BigInteger.valueOf(227);\n \t\t\tdefault_diag.addinfo = new addinfo_inline14_type();\n \t\t\tdefault_diag.addinfo.which = \n \t\t\t addinfo_inline14_type.v2addinfo_CID;\n \t\t\tdefault_diag.addinfo.o = \n \t\t\t (Object)\"1.2.840.10003.5.109.3\";\n \t\t\treturn retval;\n \t\t\t\n \t\t }\n \t\t}\n \t\telse if ( requested_syntax_name.equals\n \t\t\t (Z3950Constants.RECSYN_XML) ) {\n \t\n \t\t // Since XML is our canonical internal schema, \n \t\t //all realisations of InformationFragment\n \t\t // are capable of providing an XML representation of \n \t\t //themselves, so just use the\n \t\t // Fragments getDocument method.\n \t\t LOGGER.finer(\"Returning OctetAligned XML\");\n \t\t java.io.StringWriter sw = new java.io.StringWriter();\n \t\t \n \t\t try\n \t\t\t{\n \t\t\t OutputFormat format = \n \t\t\t\tnew OutputFormat\n \t\t\t\t (raw_records[i].getDocument() );\n \t\t\t XMLSerializer serial = \n \t\t\t\tnew XMLSerializer( sw, format );\n \t\t\t serial.asDOMSerializer();\n \t\t\t serial.serialize( raw_records[i].getDocument().\n \t\t\t\t\t getDocumentElement() );\n \t\t\t}\n \t\t catch ( Exception e )\n \t\t\t{\n \t\t\t LOGGER.severe(\"Problem serializing dom tree to\" + \n \t\t\t\t\t \" result record\" + e.getMessage());\n \t\t\t}\n \t\t \n \t\t rec.direct_reference = \n \t\t\treg.oidByName(requested_syntax_name);\n \t\t rec.encoding = new encoding_inline0_type();\n \t\t rec.encoding.which = \n \t\t\tencoding_inline0_type.octet_aligned_CID;\n \t\t rec.encoding.o = sw.toString().getBytes(); \t \n\t\t} else {//if ( requested_syntax_name.equals\n\t\t // (Z3950Constants.RECSYN_SUTRS)){\n \t\t rec.direct_reference = \n \t\t\treg.oidByName(requested_syntax_name);\n \t\t rec.encoding = new encoding_inline0_type();\n \t\t rec.encoding.which = \n \t\t\tencoding_inline0_type.single_asn1_type_CID;\n \t\t rec.encoding.o = \n \t\t\t((String)(raw_records[i].getOriginalObject()));\n \t\t}\n \t\tv.add(npr);\n \t\t\n \t}\n }\n catch ( PresentException pe ) {\n \tLOGGER.warning(\"Processing present exception: \"+pe.toString());\n \t\n // Need to set up diagnostic in here\n \tretval.which = Records_type.nonsurrogatediagnostic_CID;\n DefaultDiagFormat_type default_diag = new DefaultDiagFormat_type();\n retval.o = default_diag;\n \n default_diag.diagnosticSetId = reg.oidByName(\"diag-1\");\n \n if ( pe.additional != null )\n \t default_diag.condition = \n \t BigInteger.valueOf( Long.parseLong(pe.additional.toString()) );\n else\n default_diag.condition = BigInteger.valueOf(0);\n \n default_diag.addinfo = new addinfo_inline14_type();\n default_diag.addinfo.which = addinfo_inline14_type.v2addinfo_CID;\n default_diag.addinfo.o = (Object)(pe.toString());\n } \n \n LOGGER.finer(\"retval = \" + retval);\n return retval;\n }", "public DbIterator iterator() {\n // some code goes here\n ArrayList<Tuple> tuples = new ArrayList<Tuple>();\n for (Field key : m_aggregateData.keySet()) {\n \tTuple nextTuple = new Tuple(m_td);\n \tint recvValue;\n \t\n \tswitch (m_op) {\n \tcase MIN: case MAX: case SUM:\n \t\trecvValue = m_aggregateData.get(key);\n \t\tbreak;\n \tcase COUNT:\n \t\trecvValue = m_count.get(key);\n \t\tbreak;\n \tcase AVG:\n \t\trecvValue = m_aggregateData.get(key) / m_count.get(key);\n \t\tbreak;\n \tdefault:\n \t\trecvValue = setInitData(); // shouldn't reach here\n \t}\n \t\n \tField recvField = new IntField(recvValue);\n \tif (m_gbfield == NO_GROUPING) {\n \t\tnextTuple.setField(0, recvField);\n \t}\n \telse {\n \t\tnextTuple.setField(0, key);\n \t\tnextTuple.setField(1, recvField);\n \t}\n \ttuples.add(nextTuple);\n }\n return new TupleIterator(m_td, tuples);\n }", "private void constructSearchingQueryIfScanIsValid(){\n\t\t//todo: test roll back \n\t\t//String scanContent = scanningResult.getContents();\n\t\t//String scanFormat = scanningResult.getFormatName();\n\t\t\n\t\t//todo: test need delete\n\t\tString scanContent = \"9781430247883\";\n\t\tString scanFormat = \"EAN_13\";\n\t\tif(GoogleApiConverter.isScanFormatMatching(scanContent, scanFormat)){\n\t\t\tString bookSearchString = GoogleApiConverter.formateBookApiSearchQuery(scanContent);\n\t\t\tnew GetBookInfo().execute(bookSearchString);\n\t\t}\n\t\telse{\n\t\t\tToastExceptions.onShowException(this, \"Not a valid scan!\");\n\t\t}\n\t}", "@Test\n public void testScanTokensNonCoveringRangePartitions() throws Exception {\n Schema schema = createManyStringsSchema();\n CreateTableOptions createOptions = new CreateTableOptions();\n createOptions.addHashPartitions(ImmutableList.of(\"key\"), 2);\n\n PartialRow lower = schema.newPartialRow();\n PartialRow upper = schema.newPartialRow();\n lower.addString(\"key\", \"a\");\n upper.addString(\"key\", \"f\");\n createOptions.addRangePartition(lower, upper);\n\n lower = schema.newPartialRow();\n upper = schema.newPartialRow();\n lower.addString(\"key\", \"h\");\n upper.addString(\"key\", \"z\");\n createOptions.addRangePartition(lower, upper);\n\n PartialRow split = schema.newPartialRow();\n split.addString(\"key\", \"k\");\n createOptions.addSplitRow(split);\n\n client.createTable(testTableName, schema, createOptions);\n\n KuduSession session = client.newSession();\n session.setFlushMode(SessionConfiguration.FlushMode.AUTO_FLUSH_BACKGROUND);\n KuduTable table = client.openTable(testTableName);\n for (char c = 'a'; c < 'f'; c++) {\n Insert insert = table.newInsert();\n PartialRow row = insert.getRow();\n row.addString(\"key\", \"\" + c);\n row.addString(\"c1\", \"c1_\" + c);\n row.addString(\"c2\", \"c2_\" + c);\n session.apply(insert);\n }\n for (char c = 'h'; c < 'z'; c++) {\n Insert insert = table.newInsert();\n PartialRow row = insert.getRow();\n row.addString(\"key\", \"\" + c);\n row.addString(\"c1\", \"c1_\" + c);\n row.addString(\"c2\", \"c2_\" + c);\n session.apply(insert);\n }\n session.flush();\n\n KuduScanToken.KuduScanTokenBuilder tokenBuilder = client.newScanTokenBuilder(table);\n tokenBuilder.setProjectedColumnIndexes(ImmutableList.of());\n List<KuduScanToken> tokens = tokenBuilder.build();\n assertEquals(6, tokens.size());\n assertEquals('f' - 'a' + 'z' - 'h',\n countScanTokenRows(tokens,\n client.getMasterAddressesAsString(),\n client.getDefaultOperationTimeoutMs()));\n\n for (KuduScanToken token : tokens) {\n // Sanity check to make sure the debug printing does not throw.\n LOG.debug(KuduScanToken.stringifySerializedToken(token.serialize(), client));\n }\n }", "private Builder() {\n super(com.twc.bigdata.views.avro.viewing_info.SCHEMA$);\n }", "public static ResultScanner scanFilter(HTable table, String startrow, Filter filter) throws Exception {\n\t\tScan s = new Scan(Bytes.toBytes(startrow), filter);\n\t\tResultScanner rs = table.getScanner(s);\n\t\treturn rs;\n\t}" ]
[ "0.5771052", "0.54850066", "0.51217437", "0.5055929", "0.47817314", "0.46572134", "0.46520704", "0.46189147", "0.46037728", "0.45672128", "0.45517224", "0.4538104", "0.45151186", "0.44394648", "0.44218266", "0.43697122", "0.4346586", "0.43078852", "0.42533305", "0.4253102", "0.42389086", "0.42119995", "0.41949934", "0.41915855", "0.4188102", "0.41821468", "0.41772935", "0.41657713", "0.41507307", "0.41425702", "0.4138569", "0.41335765", "0.4120436", "0.41061977", "0.41034585", "0.40941837", "0.40829933", "0.40739924", "0.40605968", "0.4056053", "0.4029544", "0.40222535", "0.40220153", "0.40195063", "0.4008486", "0.40067932", "0.40056762", "0.40026635", "0.40015203", "0.39948046", "0.39919534", "0.39891183", "0.39858952", "0.39837086", "0.3980333", "0.3976553", "0.39695066", "0.3965625", "0.39640975", "0.3957134", "0.3952855", "0.39523864", "0.3938411", "0.39358994", "0.39272332", "0.39251494", "0.39242017", "0.39059088", "0.39043653", "0.39031413", "0.39024758", "0.38955754", "0.3890871", "0.3888154", "0.38782966", "0.38718775", "0.3868896", "0.38686717", "0.38667288", "0.38651404", "0.38644096", "0.38638318", "0.3858927", "0.3857855", "0.3849503", "0.38466823", "0.3841707", "0.3841449", "0.38326767", "0.38317332", "0.38272348", "0.38152364", "0.3812532", "0.38119462", "0.381042", "0.38101152", "0.38095042", "0.38077718", "0.38069972", "0.38039187" ]
0.680299
0
Creates a new Insert operation given a data buffer
public Scan(byte[] buffer) throws IOException, ClassNotFoundException { _type = TYPE; deserialize(buffer); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public abstract void insert(DataAction data, DataRequest source) throws ConnectorOperationException;", "int insert(TagData record);", "private void addInsertOp() {\n\n if (!mIsNewAlert) {\n mValues.put(AlertContentProvider.KEY_ALERT_ID, mRawAlertId);\n }\n ContentProviderOperation.Builder builder =\n newInsertCpo(Data.CONTENT_URI, mIsSyncOperation, mIsYieldAllowed);\n builder.withValues(mValues);\n if (mIsNewAlert) {\n builder.withValueBackReference(AlertContentProvider.KEY_ALERT_ID, mBackReference);\n }\n mIsYieldAllowed = false;\n mBatchOperation.add(builder.build());\n }", "int insert(Ttoken record);", "public void insert(T o);", "public void testInsert() {\n test1.insert(new Buffer(3, rec));\n test1.insert(new Buffer(3, rec));\n test1.insert(new Buffer(3, rec));\n test1.insert(new Buffer(3, rec));\n test1.insert(new Buffer(3, rec));\n test1.insert(new Buffer(3, rec));\n assertEquals(6, test1.length());\n }", "int insert(Position record);", "int insert(DataSync record);", "<K, V, R extends IResponse> R insert(IInsertionRequest<K, V> insertionRequest);", "public abstract boolean insert(Log log) throws DataException;", "public void insert(T x);", "public void insert(int i, T obj);", "void insert(T t);", "void insert(T value, int position);", "int insert(T record);", "int insert(TDwBzzxBzflb record);", "int insert(TbSerdeParams record);", "public abstract String insert(Object obj) ;", "Object insert(String key, Object param);", "<T> int insert(T obj);", "T insert(T entity) throws Exception;", "void insert(Mi004 record);", "public DBOpEntry createInsertDBOpEntry(DatabaseTable dbT, Insert insertStatement) throws SQLException {\n\t\tDBOpEntry dbOpEntry = new DBOpEntry(DatabaseDef.INSERT, dbT.get_Table_Name());\n\t\tIterator colIt = insertStatement.getColumns().iterator();\n\t\tIterator valueIt = ((ExpressionList)insertStatement.getItemsList()).getExpressions().iterator();\n\t\tif(colIt == null || colIt.hasNext() == false) {\n\t\t\t//added in the sorted manner\n\t\t\tint index = 0;\n\t\t\twhile(valueIt.hasNext()) {\n\t\t\t\tString value = valueIt.next().toString();\n\t\t\t\tDataField df = dbT.get_Data_Field(index);\n\t\t\t\tPrimitiveType pt = CrdtFactory.generateCrdtPrimitiveType(this.getDateFormat(), df, value, null);\n\t\t\t\tif(df.is_Primary_Key()){\n\t\t\t\t\tdbOpEntry.addPrimaryKey(pt);\n\t\t\t\t}else{\n\t\t\t\t\tdbOpEntry.addNormalAttribute(pt);\n\t\t\t\t}\n\t\t\t\tindex++;\n\t\t\t}\n\t\t}else {\n\t\t\twhile(colIt.hasNext() && valueIt.hasNext()) {\n\t\t\t\tString colName = colIt.next().toString();\n\t\t\t\tString value = valueIt.next().toString();\n\t\t\t\tDataField df = dbT.get_Data_Field(colName);\n\t\t\t\tPrimitiveType pt = CrdtFactory.generateCrdtPrimitiveType(this.getDateFormat(), df, value, null);\n\t\t\t\tif(df.is_Primary_Key()){\n\t\t\t\t\tdbOpEntry.addPrimaryKey(pt);\n\t\t\t\t}else{\n\t\t\t\t\tdbOpEntry.addNormalAttribute(pt);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn dbOpEntry;\n\t}", "int insert(StatementsWithSorting record);", "public static InsertStatementBuilder insert() {\r\n return new InsertStatementBuilder();\r\n }", "int insert(T entity);", "int insert(Commet record);", "int insert(BPBatchBean record);", "void insert(Object value, int position);", "int insert(Ltsprojectpo record);", "void insert(int insertSize);", "@Override\n\tpublic void insert() {\n\t\t\n\t}", "public long insert();", "int insert(RecordLike record);", "public Key insert(Transaction tx,Tuple t) throws RelationException;", "int insert(TerminalInfo record);", "int insert(Clazz record);", "void insert(int key, String data)\n\t\tthrows IllegalArgumentException;", "@Override\r\n\tpublic void insert(BbsDto dto) {\n\t}", "int insert(CommentLike record);", "int insert(Factory record);", "InsertType createInsertType();", "@Test\n public void testInsert() {\n System.out.println(\"insert\");\n ByteArray instance = new ByteArray();\n \n instance.writeInt(12, 0);\n instance.writeInt(15, 4);\n instance.writeInt(13, instance.compacity());\n \n instance.insert(\"hello\".getBytes(), 4);\n \n byte[] dest = new byte[\"hello\".getBytes().length];\n instance.read(dest, 4);\n \n assertEquals(12, instance.readInt(0));\n assertEquals(\"hello\", new String(dest));\n assertEquals(15, instance.readInt(4 + \"hello\".getBytes().length));\n assertEquals(13, instance.readInt(instance.compacity() - 4));\n }", "int insert(DebtsRecordEntity record);", "int insert(Engine record);", "private void insertFirst(T data){\n Node<T> node = new Node<T>(data);\n this.begin = node;\n this.end = node;\n }", "public void insert()\n\t{\n\t}", "public Data createData(Address addr, DataType dataType) throws CodeUnitInsertionException;", "public T insert(T entity) throws DataAccessException;", "int insert(ClOrderInfo record);", "int insert(Comment record);", "int insert(Dormitory record);", "int insert(R_order record);", "public void insert(T... entity) throws NoSQLException;", "void insert(VRpMnBscHoIbc record);", "int insert(Yqbd record);", "public void insert(T data)\r\n {\r\n root = insert(root, data);\r\n }", "int insert(FunctionInfo record);", "int insert(GrpTagKey record);", "int insertSelective(Ttoken record);", "public void insertBefore( int pos, T data ) \n {\n \tDLLIterator cycle = new DLLIterator();\n \t\n \t\n if(pos <= 0){\n \t \n \t insertFirst(data);\n }\n \n else if(pos >= capacity){\n \t insertLast(data);\n \t \n } \n \n else{\n \t \n \t int x = 0;\n \t \n \t DLLNode insert = cycle.currentNode;\n \t \n \t while(x != pos){\n \t\t x++;\n \t\t insert = cycle.nextNode();\n \t\t \n \t }\n \t \n \t DLLNode before = insert.prev;\n \t DLLNode newNode = new DLLNode(data, before, insert);\n \t \n \t before.next = newNode;\n \t insert.prev = newNode;\n \t \n }\n \n \t \n \t \n \n }", "Long insert(Access record);", "public native void insertData(double offset, String arg) /*-{\r\n\t\tvar jso = [email protected]::getJsObj()();\r\n\t\tjso.insertData(offset, arg);\r\n }-*/;", "void insert(TbMessage record);", "int insert(Procdef record);", "int insert(TSortOrder record);", "int insert(ParseTableLog record);", "WriteRequest insert(PiEntity entity);", "public void insert(Object data, int index){\r\n enqueue(data);\r\n }", "int insert(Body record);", "public void insert(Object item);", "com.google.spanner.v1.Mutation.Write getInsert();", "int insert(HotspotLog record);", "int insert(CmstTransfdevice record);", "int insert(PrhFree record);", "int insert(TCar record);", "int insert(Comments record);", "int insertSelective(DataSync record);", "int insert(Goodexistsingle record);", "public DBOpEntry createUniqueInsertDBOpEntry(DatabaseTable dbT, Insert insertStatement) throws SQLException {\n\t\tDBOpEntry dbOpEntry = new DBOpEntry(DatabaseDef.UNIQUEINSERT, dbT.get_Table_Name());\n\t\tIterator colIt = insertStatement.getColumns().iterator();\n\t\tIterator valueIt = ((ExpressionList)insertStatement.getItemsList()).getExpressions().iterator();\n\t\tif(colIt == null || colIt.hasNext() == false) {\n\t\t\t//added in the sorted manner\n\t\t\tint index = 0;\n\t\t\twhile(valueIt.hasNext()) {\n\t\t\t\tString value = valueIt.next().toString();\n\t\t\t\tDataField df = dbT.get_Data_Field(index);\n\t\t\t\tPrimitiveType pt = CrdtFactory.generateCrdtPrimitiveType(this.getDateFormat(), df, value, null);\n\t\t\t\tif(df.is_Primary_Key()) {\n\t\t\t\t\tdbOpEntry.addPrimaryKey(pt);\n\t\t\t\t}else {\n\t\t\t\t\tdbOpEntry.addNormalAttribute(pt);\n\t\t\t\t}\n\t\t\t\tindex++;\n\t\t\t}\n\t\t}else {\n\t\t\twhile(colIt.hasNext() && valueIt.hasNext()) {\n\t\t\t\tString colName = colIt.next().toString();\n\t\t\t\tString value = valueIt.next().toString();\n\t\t\t\tDataField df = dbT.get_Data_Field(colName);\n\t\t\t\tPrimitiveType pt = CrdtFactory.generateCrdtPrimitiveType(this.getDateFormat(), df, value, null);\n\t\t\t\tif(df.is_Primary_Key()) {\n\t\t\t\t\tdbOpEntry.addPrimaryKey(pt);\n\t\t\t\t}else {\n\t\t\t\t\tdbOpEntry.addNormalAttribute(pt);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn dbOpEntry;\n\t}", "public void insert(Conge conge) ;", "int insert(Lbt72TesuryoSumDPkey record);", "void insert(XdSpxx record);", "void insert(VRpDyCellBh record);", "int insert(ComplainNoteDO record);", "void insert(VRpMnCellHoBhIbc record);", "int insert(BehaveLog record);", "int insert(Abum record);", "public void insert(int key, Object record) {\n throw new UnsupportedOperationException(\"implement me!\");\n }", "ActionResult onInsert(HopperBlockEntity hopperBlockEntity, BlockPos insertPosition);", "WriteRequest insert(Iterable<? extends PiEntity> entities);", "public static <T> T insert(T object)\n {\n return SqlClosure.sqlExecute(connection -> insert(connection, object));\n }", "int insert(Storage record);", "int insert(Storage record);", "int insert(Transaction record);", "public void insert(T vertex, Point2D pos);", "int insert(TBBearPer record);", "int insert(CustomerTag record);", "int insert(CptDataStore record);", "public void insertIntoByteBuffer(ByteBuffer buffer)\n {\n \tbuffer.putDouble(j2ksec);\n \tbuffer.putInt(rid);\n \tbuffer.putDouble(lat);\n \tbuffer.putDouble(lon);\n \tbuffer.putDouble(depth);\n \tbuffer.putDouble(prefmag);\n\n \tbuffer.putDouble(ampmag);\n \tbuffer.putDouble(codamag);\n \tbuffer.putInt(nphases);\n \tbuffer.putInt(azgap);\n \tbuffer.putDouble(dmin);\n \tbuffer.putDouble(rms);\n \tbuffer.putInt(nstimes);\n \tbuffer.putDouble(herr);\n \tbuffer.putDouble(verr);\n \t\n \t// We'll represent characters by their ASCII codes, using -1 for null \n \tif ( magtype != null && magtype.length() > 0 )\n \t\tbuffer.putInt((int)(magtype.charAt(0)));\n \telse\n \t\tbuffer.putInt(-1);\n \tif ( rmk != null && rmk.length() > 0 )\n \t\tbuffer.putInt((int)(rmk.charAt(0)));\n \telse\n \t\tbuffer.putInt( -1 );\n}", "int insert(ArticleTag record);" ]
[ "0.6108863", "0.59414786", "0.59241533", "0.59143436", "0.5857451", "0.581861", "0.581436", "0.57817084", "0.5775178", "0.5691309", "0.5668775", "0.56594455", "0.56476945", "0.5628072", "0.55848503", "0.5582386", "0.55644625", "0.5561715", "0.5557806", "0.5549226", "0.5540242", "0.5502801", "0.54990435", "0.5490287", "0.5477745", "0.54680705", "0.54668987", "0.5443068", "0.543734", "0.54320204", "0.5430229", "0.54272264", "0.54162204", "0.5410963", "0.5399395", "0.5391217", "0.5377003", "0.53743565", "0.53728735", "0.5359599", "0.5356133", "0.5348779", "0.53419316", "0.533959", "0.53382885", "0.5333993", "0.533081", "0.53197056", "0.5307842", "0.5305748", "0.53049254", "0.5303554", "0.52995205", "0.52989507", "0.5298215", "0.52945626", "0.5294196", "0.5287712", "0.52834517", "0.52814955", "0.52792394", "0.5276793", "0.52594006", "0.5259077", "0.52573174", "0.5253952", "0.5249665", "0.5247832", "0.5244341", "0.52252406", "0.52216864", "0.52178663", "0.5202279", "0.5190252", "0.5188243", "0.5187307", "0.51848584", "0.51793563", "0.5178521", "0.51782286", "0.51781094", "0.51754403", "0.5159023", "0.5152583", "0.5151677", "0.5148149", "0.5144851", "0.514162", "0.51324886", "0.5130764", "0.5129017", "0.5124214", "0.5123327", "0.5123327", "0.51202166", "0.5119998", "0.51186985", "0.51154345", "0.5108319", "0.510394", "0.51037633" ]
0.0
-1
Creates a new Insert operation given an Inputstream
public Scan(ObjectInputStream ois) throws IOException, ClassNotFoundException { _type = TYPE; deserialize(ois); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "WriteRequest insert(PiEntity entity);", "public StorableInput(InputStream stream) {\n Reader r = new BufferedReader(new InputStreamReader(stream));\n fTokenizer = new StreamTokenizer(r);\n fMap = new Vector();\n }", "public long insert(FFileInputDO FFileInput) throws DataAccessException;", "<K, V, R extends IResponse> R insert(IInsertionRequest<K, V> insertionRequest);", "@Override\n protected HtmlInsertingFilterParser createHtmlInsertingFilterParser(DynamoHttpServletRequest pRequest,\n ServletOutputStream pOutputStream) {\n return new StoreHtmlInsertingFilterParser(pOutputStream, pRequest, getEventQueueForRequest(pRequest),\n getHtmlInserterFactoryForRequest(pRequest));\n }", "int insert(StatementsWithSorting record);", "Object create(InputStream in) throws IOException, SAXException, ParserConfigurationException;", "Object create(InputSource is) throws IOException, SAXException, ParserConfigurationException;", "public abstract void insert(DataAction data, DataRequest source) throws ConnectorOperationException;", "int insert(DiaryFile record);", "public boolean executeInsertIntoDB(final Class myClass,\n final InputStream is,\n final Boolean appendToObject) {\n if (is == null || myClass == null) {\n return false;\n }\n if (!isValidWrite(myClass)) {\n return false;\n }\n Realm realm = DatabaseUtilities.buildRealm(realmConfiguration);\n try {\n realm.executeTransaction(new Realm.Transaction() {\n @Override\n public void execute(Realm realm) {\n if (MiscUtilities.isBooleanNullTrueFalse(appendToObject)) {\n try {\n realm.createOrUpdateObjectFromJson(myClass, is);\n } catch (IOException e) {\n L.m(\"IOException. Error reading file\");\n e.printStackTrace();\n }\n } else {\n try {\n realm.createObjectFromJson(myClass, is);\n } catch (IOException e) {\n L.m(\"IOException. Error reading file\");\n e.printStackTrace();\n }\n }\n }\n });\n realm.close();\n return true;\n\n } catch (IllegalArgumentException e1) {\n e1.printStackTrace();\n L.m(\"A RealmObject with no PrimaryKey cannot be updated. Does \" + myClass.getName() +\n \"have a @PrimaryKey designation over something?\");\n } catch (Exception e) {\n e.printStackTrace();\n } finally {\n try {\n if(!realm.isClosed()) {\n realm.close();\n }\n } catch (Exception e) {\n }\n }\n return false;\n }", "private void insertOperator() {\n int rowsAff = 0;\n int counter = 0;\n String query = \"\";\n System.out.print(\"Table: \");\n String table = sc.nextLine();\n System.out.print(\"Comma Separated Columns: \");\n String cols = sc.nextLine();\n System.out.print(\"Comma Separated Values: \");\n String[] vals = sc.nextLine().split(\",\");\n //transform the user input into a valid SQL insert statement\n query = \"INSERT INTO \" + table + \" (\" + cols + \") VALUES(\";\n for (counter = 0; counter < vals.length - 1; counter++) {\n query = query.concat(\"'\" + vals[counter] + \"',\");\n }\n query = query.concat(\"'\" + vals[counter] + \"');\");\n System.out.println(query);\n rowsAff = sqlMngr.insertOp(query);\n System.out.println(\"\");\n System.out.println(\"Rows affected: \" + rowsAff);\n System.out.println(\"\");\n }", "void insert(XdSpxx record);", "int insert(TagData record);", "@Override\n\tpublic int insert(Utente input) throws Exception {\n\t\treturn 0;\n\t}", "InsertType createInsertType();", "int insert(Position record);", "int insert(Commet record);", "private void addInsertOp() {\n\n if (!mIsNewAlert) {\n mValues.put(AlertContentProvider.KEY_ALERT_ID, mRawAlertId);\n }\n ContentProviderOperation.Builder builder =\n newInsertCpo(Data.CONTENT_URI, mIsSyncOperation, mIsYieldAllowed);\n builder.withValues(mValues);\n if (mIsNewAlert) {\n builder.withValueBackReference(AlertContentProvider.KEY_ALERT_ID, mBackReference);\n }\n mIsYieldAllowed = false;\n mBatchOperation.add(builder.build());\n }", "com.google.spanner.v1.Mutation.Write getInsert();", "public void insert(SessionFactory factory, EihApps input) {\n\n\t}", "void insert(Mi004 record);", "int insert(Ttoken record);", "WriteRequest insert(Iterable<? extends PiEntity> entities);", "int insert(Clazz record);", "int insert(Factory record);", "int insert(TbSerdeParams record);", "public final void entryRuleInsert() throws RecognitionException {\n try {\n // InternalBrowser.g:854:1: ( ruleInsert EOF )\n // InternalBrowser.g:855:1: ruleInsert EOF\n {\n before(grammarAccess.getInsertRule()); \n pushFollow(FOLLOW_1);\n ruleInsert();\n\n state._fsp--;\n\n after(grammarAccess.getInsertRule()); \n match(input,EOF,FOLLOW_2); \n\n }\n\n }\n catch (RecognitionException re) {\n reportError(re);\n recover(input,re);\n }\n finally {\n }\n return ;\n }", "int insert(Goodexistsingle record);", "int insert(AccountBankStatementImportJournalCreationEntity record);", "public SqlFileParser(InputStream stream) {\n this.reader = new BufferedReader(new InputStreamReader(stream));\n }", "public abstract boolean insert(Log log) throws DataException;", "public SqlScanner (InputStream input)\n {\n mInputStream = new BufferedInputStream(input);\n }", "public final void mINTO() throws RecognitionException {\n try {\n int _type = INTO;\n int _channel = DEFAULT_TOKEN_CHANNEL;\n // /Users/cbinnig/Workspace/DHBW_FirstDB_Loesung3/src/de/dhbw/db2/firstdb/sql/FirstSQL.g:354:5: ( I N T O )\n // /Users/cbinnig/Workspace/DHBW_FirstDB_Loesung3/src/de/dhbw/db2/firstdb/sql/FirstSQL.g:354:7: I N T O\n {\n mI(); \n mN(); \n mT(); \n mO(); \n\n }\n\n state.type = _type;\n state.channel = _channel;\n }\n finally {\n }\n }", "public OperationStFactory(String input, String oper) {\r\n\t\tthis.inputList = u.toInputList(input);\r\n\t\tthis.operator = u.toCharList(oper);\r\n\t}", "int insert(TerminalInfo record);", "ObjectInputStream newObjectInputStream(InputStream in) throws Exception;", "@NotNull\n RecordId writeStream(@NotNull InputStream stream) throws IOException;", "@Override\n public RelInfo visit(RelContext context, RelNode node, List<RelInfo> inputStreams)\n {\n\n TableModify modify = (TableModify)node;\n Preconditions.checkArgument(modify.isInsert(), \"Only INSERT allowed for table modify\");\n\n ApexSQLTable table = modify.getTable().unwrap(ApexSQLTable.class);\n\n Endpoint endpoint = table.getEndpoint();\n return endpoint.populateOutputDAG(context.dag, context.typeFactory);\n }", "T insert(T entity) throws Exception;", "int insert(ToolsOutIn record);", "public DBOpEntry createInsertDBOpEntry(DatabaseTable dbT, Insert insertStatement) throws SQLException {\n\t\tDBOpEntry dbOpEntry = new DBOpEntry(DatabaseDef.INSERT, dbT.get_Table_Name());\n\t\tIterator colIt = insertStatement.getColumns().iterator();\n\t\tIterator valueIt = ((ExpressionList)insertStatement.getItemsList()).getExpressions().iterator();\n\t\tif(colIt == null || colIt.hasNext() == false) {\n\t\t\t//added in the sorted manner\n\t\t\tint index = 0;\n\t\t\twhile(valueIt.hasNext()) {\n\t\t\t\tString value = valueIt.next().toString();\n\t\t\t\tDataField df = dbT.get_Data_Field(index);\n\t\t\t\tPrimitiveType pt = CrdtFactory.generateCrdtPrimitiveType(this.getDateFormat(), df, value, null);\n\t\t\t\tif(df.is_Primary_Key()){\n\t\t\t\t\tdbOpEntry.addPrimaryKey(pt);\n\t\t\t\t}else{\n\t\t\t\t\tdbOpEntry.addNormalAttribute(pt);\n\t\t\t\t}\n\t\t\t\tindex++;\n\t\t\t}\n\t\t}else {\n\t\t\twhile(colIt.hasNext() && valueIt.hasNext()) {\n\t\t\t\tString colName = colIt.next().toString();\n\t\t\t\tString value = valueIt.next().toString();\n\t\t\t\tDataField df = dbT.get_Data_Field(colName);\n\t\t\t\tPrimitiveType pt = CrdtFactory.generateCrdtPrimitiveType(this.getDateFormat(), df, value, null);\n\t\t\t\tif(df.is_Primary_Key()){\n\t\t\t\t\tdbOpEntry.addPrimaryKey(pt);\n\t\t\t\t}else{\n\t\t\t\t\tdbOpEntry.addNormalAttribute(pt);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn dbOpEntry;\n\t}", "public TarInputStream(Stream inputStream)\n\t{\n\t\tthis(inputStream, TarBuffer.DefaultBlockFactor);\n\t}", "int insert(ParseTableLog record);", "int insert(Ltsprojectpo record);", "int insert(EhrPersonFile record);", "int insert(SwipersDO record);", "ActionResult onInsert(HopperBlockEntity hopperBlockEntity, BlockPos insertPosition);", "public LineInputStream(InputStream is) {\n\t\tinputStream = is;\n\t}", "int insert(TCpySpouse record);", "void insert(EntryPair entry);", "@Override\n\tpublic void insert() {\n\t\t\n\t}", "int insert(ArticleTag record);", "public void insert(String input)\n\t{\n\t\tint parent = (pointer - 1) / 2;\n\t\tint child = pointer;\n\n\t\tif (pointer < data.length)\n\t\t{\n\t\t\tdata[pointer] = input;\n\t\t\tpointer++;\n\t\t}\n\n\t\twhile (child != 0 && smallerThan(child, parent))\n\t\t{\n\t\t\t//upheap\n\t\t\tswap(child, parent);\n\t\t\tchild = parent;\n\t\t\tparent = (child - 1) / 2;\n\t\t}\n\n\t}", "void insert(int insertSize);", "int insert(FormatOriginRecord record);", "int insert(AvwFileprocess record);", "int insert(Body record);", "int insert(Procdef record);", "public void insert(Node n);", "public static InputSource createInputSource(InputStream xmlStream) throws IOException {\r\n\t\tBufferedInputStream bis = new BufferedInputStream(xmlStream);\r\n\t\t//String charSet = CastorHelper.getStreamEncoding(bis);\r\n\t\tString charSet = \"\";\r\n\t\t//if the character set name is not existing in the input, or is not\r\n\t\t// valid,\r\n\t\t// use the default character set name\r\n\t\tif (charSet == null || charSet.length() <= 0\r\n\t\t\t\t|| !Charset.isSupported(charSet))\r\n\t\t\tcharSet = (new OutputStreamWriter(new ByteArrayOutputStream()))\r\n\t\t\t\t\t.getEncoding();\r\n\t\tReader reader = new InputStreamReader(bis, charSet);\r\n\t\treturn new InputSource(reader);\r\n\t}", "@Override\r\n\tpublic void insertPrestito(Prestito p) {\n\t\t\r\n\t}", "public abstract BasicInput createInput( boolean isSeq ) throws IOException;", "int insert(PathologyInfo record);", "int insert(RecordLike record);", "int insert(FileSet record);", "int insert(Storage record);", "int insert(Storage record);", "void insert(int pos, String s);", "int insert(Tourst record);", "void insert(T t);", "public static InsertStatementBuilder insert() {\r\n return new InsertStatementBuilder();\r\n }", "<T> int insert(T obj);", "int insert(RepStuLearning record);", "public void insert()\n\t{\n\t}", "public void insert(T o);", "CustomSaveQuery insertInto(String table, String... fields);", "public DBOpEntry createUniqueInsertDBOpEntry(DatabaseTable dbT, Insert insertStatement) throws SQLException {\n\t\tDBOpEntry dbOpEntry = new DBOpEntry(DatabaseDef.UNIQUEINSERT, dbT.get_Table_Name());\n\t\tIterator colIt = insertStatement.getColumns().iterator();\n\t\tIterator valueIt = ((ExpressionList)insertStatement.getItemsList()).getExpressions().iterator();\n\t\tif(colIt == null || colIt.hasNext() == false) {\n\t\t\t//added in the sorted manner\n\t\t\tint index = 0;\n\t\t\twhile(valueIt.hasNext()) {\n\t\t\t\tString value = valueIt.next().toString();\n\t\t\t\tDataField df = dbT.get_Data_Field(index);\n\t\t\t\tPrimitiveType pt = CrdtFactory.generateCrdtPrimitiveType(this.getDateFormat(), df, value, null);\n\t\t\t\tif(df.is_Primary_Key()) {\n\t\t\t\t\tdbOpEntry.addPrimaryKey(pt);\n\t\t\t\t}else {\n\t\t\t\t\tdbOpEntry.addNormalAttribute(pt);\n\t\t\t\t}\n\t\t\t\tindex++;\n\t\t\t}\n\t\t}else {\n\t\t\twhile(colIt.hasNext() && valueIt.hasNext()) {\n\t\t\t\tString colName = colIt.next().toString();\n\t\t\t\tString value = valueIt.next().toString();\n\t\t\t\tDataField df = dbT.get_Data_Field(colName);\n\t\t\t\tPrimitiveType pt = CrdtFactory.generateCrdtPrimitiveType(this.getDateFormat(), df, value, null);\n\t\t\t\tif(df.is_Primary_Key()) {\n\t\t\t\t\tdbOpEntry.addPrimaryKey(pt);\n\t\t\t\t}else {\n\t\t\t\t\tdbOpEntry.addNormalAttribute(pt);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn dbOpEntry;\n\t}", "public final void mINSERT() throws RecognitionException {\n try {\n int _type = INSERT;\n int _channel = DEFAULT_TOKEN_CHANNEL;\n // /Users/cbinnig/Workspace/DHBW_FirstDB_Loesung3/src/de/dhbw/db2/firstdb/sql/FirstSQL.g:348:7: ( I N S E R T )\n // /Users/cbinnig/Workspace/DHBW_FirstDB_Loesung3/src/de/dhbw/db2/firstdb/sql/FirstSQL.g:348:9: I N S E R T\n {\n mI(); \n mN(); \n mS(); \n mE(); \n mR(); \n mT(); \n\n }\n\n state.type = _type;\n state.channel = _channel;\n }\n finally {\n }\n }", "int insert(MemberTag record);", "@Override\n public void process(StreamingInput<Tuple> stream, Tuple tuple) throws Exception {\n \t\n \t// Collect fields to add to JSON output.\n\t\tStreamSchema schema = tuple.getStreamSchema();\n \tSet<String> attributeNames = schema.getAttributeNames();\n \tJSONObject jsonFields = new JSONObject();\n\t \n\tfor (String attributeName : attributeNames) {\n\t\tif (schema.getAttribute(attributeName).getType().getMetaType() == Type.MetaType.RSTRING) {\n\t\t\tjsonFields.put(attributeName, tuple.getObject(attributeName).toString());\n\t\t} else {\n\t\t\tjsonFields.put(attributeName, tuple.getObject(attributeName));\n\t\t}\n\t}\n \n \t// Add timestamp, if specified, for time-based queries.\n \tif (timestampName != null) {\n \t\tDateFormat df = new SimpleDateFormat(\"yyyy'-'MM'-'dd'T'HH':'mm':'ss.SSSZZ\");\n \t\t\n \t\tif (attributeNames.contains(timestampName) && schema.getAttribute(timestampName).getType().getMetaType() == Type.MetaType.RSTRING\n \t\t\t&& !tuple.getString(timestampName).equals(\"\")) {\n \t\t\tString timestampToInsert = tuple.getString(timestampName);\n \t\t\tjsonFields.put(timestampName, df.format(timestampToInsert));\n \t\t} else {\n \t\t\tjsonFields.put(timestampName, df.format(new Date(System.currentTimeMillis())));\n \t\t}\n \t}\n \t\n \t// Get index name/type/id specified inside tuple (default: from params).\n \tString indexToInsert = index;\n \tString typeToInsert = type;\n \tString idToInsert = null;\n \t\n \tif (attributeNames.contains(index) && schema.getAttribute(index).getType().getMetaType() == Type.MetaType.RSTRING\n \t\t\t&& !tuple.getString(index).equals(\"\")) {\n \t\tindexToInsert = tuple.getString(index);\n \t}\n \t\n \tif (attributeNames.contains(type) && schema.getAttribute(type).getType().getMetaType() == Type.MetaType.RSTRING\n \t\t\t&& !tuple.getString(type).equals(\"\")) {\n \t\ttypeToInsert = tuple.getString(type);\n \t}\n\n \tif (id != null && attributeNames.contains(id) && schema.getAttribute(id).getType().getMetaType() == Type.MetaType.RSTRING\n \t\t\t&& !tuple.getString(id).equals(\"\")) {\n \t\tidToInsert = tuple.getString(id);\n \t}\n \t\n \tif (connectedToElasticsearch(indexToInsert, typeToInsert)) {\n \t\n \t\t// Add jsonFields to bulkBuilder.\n \tString source = jsonFields.toString();\n \t\n \tif (idToInsert != null) {\n \t\tbulkBuilder.addAction(new Index.Builder(source).index(indexToInsert).type(typeToInsert).id(idToInsert).build());\n \t} else {\n \t\tbulkBuilder.addAction(new Index.Builder(source).index(indexToInsert).type(typeToInsert).build());\n \t}\n \t\n \tcurrentBulkSize++;\n \t\n \t// If bulk size met, output jsonFields to Elasticsearch.\n \tif(currentBulkSize >= bulkSize) {\n\t \tBulk bulk = bulkBuilder.build();\n\t \tBulkResult result;\n\t \t\n\t \ttry {\n\t\t \tresult = client.execute(bulk);\n\t \t} catch (NoHttpResponseException e) {\n\t \t\t_trace.error(e);\n\t \t\treturn;\n\t \t}\n\t \t\n \t\t\tif (result.isSucceeded()) {\n \t\t\t\tlong currentNumInserts = numInserts.getValue();\n \t\t\t\tnumInserts.setValue(currentNumInserts + bulkSize);\n \t\t\t\tcurrentBulkSize = 0;\n \t\t\t} else {\n \t\t\t\tfor (BulkResultItem item : result.getItems()) {\n \t\t\t\t\tif (item.error != null) {\n \t\t\t\t\t\tnumInserts.increment();\n \t\t\t\t\t} else {\n \t\t\t\t\t\ttotalFailedRequests.increment();\n \t\t\t\t\t}\n \t\t\t\t}\n \t\t\t}\n \t\t\t\n \t\t\t// Clear bulkBuilder. Gets recreated in connectedToElasticsearch().\n \t\t\tbulkBuilder = null;\n \t\t\t\n \t\t\t// Get size metrics for current type.\n \t\t\tif (sizeMetricsEnabled && mapperSizeInstalled) {\n\t \t\t\tString query = \"{\\n\" +\n\t \t \" \\\"query\\\" : {\\n\" +\n\t \t \" \\\"match_all\\\" : {}\\n\" +\n\t \t \" },\\n\" +\n\t \t \" \\\"aggs\\\" : {\\n\" +\n\t \t \" \\\"size_metrics\\\" : {\\n\" +\n\t \t \" \\\"extended_stats\\\" : {\\n\" +\n\t \t \" \\\"field\\\" : \\\"_size\\\"\\n\" +\n\t \t \" }\\n\" +\n\t \t \" }\\n\" +\n\t \t \" }\\n\" +\n\t \t \"}\";\n\t \t\t\t\n\t \t Search search = new Search.Builder(query)\n\t \t .addIndex(indexToInsert)\n\t \t .addType(typeToInsert)\n\t \t .build();\n\t \t \n\t \t SearchResult searchResult = client.execute(search);\n\t \t \n\t \t if (searchResult.isSucceeded()) {\n\t\t \t ExtendedStatsAggregation sizeMetrics = searchResult.getAggregations().getExtendedStatsAggregation(\"size_metrics\");\n\t\t \t\t\t\n\t\t \t if (sizeMetrics != null) {\n\t\t \t \tif (sizeMetrics.getAvg() != null) {\n\t\t\t\t \t\t\tavgInsertSizeBytes.setValue(sizeMetrics.getAvg().longValue());\n\t\t \t \t}\n\t\t \t \tif (sizeMetrics.getMax() != null) {\n\t\t \t \t\tmaxInsertSizeBytes.setValue(sizeMetrics.getMax().longValue());\n\t\t \t \t}\n\t\t \t \tif (sizeMetrics.getMin() != null) {\n\t\t \t \t\tminInsertSizeBytes.setValue(sizeMetrics.getMin().longValue());\n\t\t \t \t}\n\t\t \t \tif (sizeMetrics.getSum() != null) {\n\t\t \t \t\tsumInsertSizeBytes.setValue(sizeMetrics.getSum().longValue());\n\t\t \t \t}\n\t\t \t }\n\t \t }\n \t\t\t}\n \t\t}\n \t}\n }", "public TarInputStream(Stream inputStream, int blockFactor)\n\t{\n\t\tthis.inputStream = inputStream;\n\t\ttarBuffer = TarBuffer.CreateInputTarBuffer(inputStream, blockFactor);\n\t}", "@Override\n\tpublic void insertProcess() {\n\t\t\n\t}", "int insert(NewsFile record);", "public void insert(T x);", "int insert(SPerms record);", "int insert(ItoProduct record);", "int insert(Dish record);", "int insert(Transaction record);", "int insert(Journal record);", "public static int Add_customer(String name, String cnic, String Address,\r\n\t\t\tint customer_dist, int family_member, String phone_no,\r\n\t\t\tdouble monthly_income, double family_income, int payment_method,\r\n\t\t\tint status, int occupation, InputStream input) throws SQLException {\r\n\t\tint rows = 0;\r\n\t\ttry {\r\n\t\t\tConnection con = connection.Connect.getConnection();\r\n\r\n\t\t\tPreparedStatement statement = con\r\n\t\t\t\t\t.prepareStatement(\"INSERT INTO customer(customer_name,customer_cnic,customer_address,customer_city,customer_family_size,customer_phone,customer_monthly_income,customer_family_income,customer_payment_type,created_on,status,occupation,customr_image) VALUES (?,?,?,?,?,?,?, ?,?,CURRENT_TIMESTAMP,?,?,?);\");\r\n\t\t\tstatement.setString(1, name);\r\n\t\t\tstatement.setString(2, cnic);\r\n\t\t\tstatement.setString(3, Address);\r\n\t\t\tstatement.setString(6, phone_no);\r\n\t\t\tstatement.setInt(11, occupation);\r\n\t\t\tstatement.setInt(4, customer_dist);\r\n\t\t\tstatement.setInt(5, family_member);\r\n\t\t\tstatement.setInt(9, payment_method);\r\n\t\t\tstatement.setInt(10, status);\r\n\t\t\tstatement.setDouble(7, monthly_income);\r\n\t\t\tstatement.setDouble(8, family_income);\r\n\t\t\tstatement.setBlob(12, input);\r\n\t\t\t// statement.setString(10,CURRENT_TIM);\r\n\t\t\tstatement.executeUpdate();\r\n\t\t\t// rows = statement.executeUpdate(\"INSERT INTO\r\n\t\t\t// customer(customer_name,customer_cnic,customer_address,customer_district,customer_family_size,customer_phone,customer_monthly_income,customer_family_income,customer_payment_type,created_on,status,occupation,customr_image)\r\n\t\t\t// VALUES ('\" + name + \"','\" + cnic + \"','\" + Address + \"',\" +\r\n\t\t\t// customer_dist + \",\" + family_member + \",'\" + phone_no + \"',\" +\r\n\t\t\t// monthly_income + \", \" + family_income + \",\" + payment_method +\r\n\t\t\t// \",CURRENT_TIMESTAMP,\" + status + \",'\" + occupation +\r\n\t\t\t// \"','\"+input+\"');\");\r\n\t\t} catch (SQLException e) {\r\n\t\t\tlogger.error(\"\", e);\r\n\t\t\te.printStackTrace();\r\n\t\t}\r\n\t\treturn rows;\r\n\t}", "public Scanner(InputStream inStream)\n {\n in = new BufferedReader(new InputStreamReader(inStream));\n eof = false;\n getNextChar();\n }", "public static void bulkLoadFromInputStream(Connection cnn,String loadDataSql, InputStream dataStream) throws Exception {\n\t\tif(dataStream==null){\n\t\t\tLog.info(\"InputStream is null ,No data is imported\");\n\t\t\tthrow new IOException(\"inputstream is null!\");\n\t\t}\n\n\t\tStatement myStatement = (com.mysql.jdbc.Statement)cnn.createStatement();\n\n\t\tmyStatement.setLocalInfileInputStream(dataStream);\n\t\t\t\t\n\t\tmyStatement.execute(loadDataSql);\n\t}", "public abstract String insert(Object obj) ;", "int insert(DataSync record);", "int insert(T entity);", "DataBaseReadStream createNewStream(Cursor beginCursor) throws SQLException;", "public void insertFact(Fact fact);", "public NewScript(java.io.InputStream stream, String encoding) {\n try { jj_input_stream = new SimpleCharStream(stream, encoding, 1, 1); } catch(java.io.UnsupportedEncodingException e) { throw new RuntimeException(e); }\n token_source = new NewScriptTokenManager(jj_input_stream);\n token = new Token();\n jj_ntk = -1;\n jj_gen = 0;\n for (int i = 0; i < 17; i++) jj_la1[i] = -1;\n }", "int insert(CommentLike record);", "int insert(FunctionInfo record);" ]
[ "0.5602106", "0.5583541", "0.5382723", "0.5309859", "0.53063357", "0.5240425", "0.5224526", "0.522003", "0.51984173", "0.5149126", "0.5138253", "0.5127769", "0.51175034", "0.5117379", "0.50905913", "0.50767624", "0.5064982", "0.50608003", "0.5048741", "0.50343204", "0.503156", "0.502145", "0.50140077", "0.50030696", "0.49981627", "0.49909765", "0.4986827", "0.4983131", "0.49755335", "0.497218", "0.4955248", "0.49468648", "0.4927405", "0.49261162", "0.4921978", "0.49206096", "0.49165192", "0.49069685", "0.48992494", "0.48958424", "0.4890481", "0.4889151", "0.4888967", "0.488659", "0.48619285", "0.4858734", "0.4851291", "0.48422447", "0.48343262", "0.48049176", "0.47981992", "0.4789596", "0.4785005", "0.47838977", "0.47677916", "0.47673365", "0.47644234", "0.47643787", "0.47538477", "0.47514862", "0.47386375", "0.47335157", "0.47319168", "0.47315156", "0.47301498", "0.4726793", "0.47259203", "0.47259203", "0.4724645", "0.47218505", "0.4719759", "0.47195518", "0.47184426", "0.47177914", "0.47161415", "0.47117612", "0.47113603", "0.46990323", "0.46988216", "0.46973187", "0.4693489", "0.46911573", "0.46882075", "0.46869218", "0.4678592", "0.4678331", "0.46743834", "0.46575168", "0.46523622", "0.46502656", "0.46474162", "0.46466056", "0.46346518", "0.463167", "0.4624508", "0.46216667", "0.46216047", "0.46185908", "0.46161792", "0.46159396", "0.46153095" ]
0.0
-1
validate operation opValidation(); Create byte array
@Override public byte[] toByteArray() throws OpException { try { return serialize(); } catch(IOException e) { OpException eop = new OpException(e.getMessage()); eop.setStackTrace(e.getStackTrace()); throw eop; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public byte[] toBytesFromOperation(){\n if (error != null)\n return ArrayUtils.addAll(type.toBytesFromOperation(), error);\n return type.toBytesFromOperation();\n }", "byte[] getResult();", "private int[] funcCheckUserData(String sOpNum) throws OException\r\n\t{\r\n\r\n \tLog.printMsg(EnumTypeMessage.INFO, \"**** funcCheckUserData ****\");\r\n\t\t\r\n\t\tTable tblUserData = Util.NULL_TABLE;\r\n\t\tString sQuery;\r\n\t\tint iRetVal, iIdNum = 0,version=1;\r\n\t\tint[] iTransaction = new int[2];\r\n\t\t\r\n\t\ttblUserData = Table.tableNew();\r\n\r\n\t\tsQuery = \"Select id_num,version_num From USER_CMX_LOG Where id_num =\" + Str.strToInt(sOpNum) +\r\n\t\t\t\t\" and origen = '\" + sCMX + \"'\" +\r\n\t\t\t\t\" and cod_error = 0\";\r\n\r\n\t\tLog.printMsg(EnumTypeMessage.INFO, \"(funcCheckUserData)\\n\" + sQuery);\r\n\r\n\t\tiRetVal = DBaseTable.execISql(tblUserData, sQuery);\r\n\t\tif (tblUserData.getNumRows() > 0) {\r\n\t\t\tiIdNum = tblUserData.getInt(\"id_num\", 1);\r\n\t\t\tversion = tblUserData.getInt(\"version_num\", 1);\r\n\t\t\t\r\n\t\t\tiTransaction[0] = iIdNum;\r\n\t\t\tiTransaction[1] = version;\r\n\t\t\t\r\n\t\t}\r\n\r\n\t\t/* Memory Clean Up */\r\n\t\ttblUserData.destroy();\r\n\r\n\t\treturn iTransaction;\r\n\r\n\t}", "public byte[] encode(byte command,byte action) {\r\n byte[] encoded = new byte[82];\r\n for (int i = 0; i < 82; ++i) {\r\n encoded[i] =(byte) 0;\r\n }\r\n encoded[0] = (byte)0xaa; //signature\r\n encoded[1] = (byte)0xaa; //signature 2nd byte\r\n encoded[2] = (byte)1; //index\r\n encoded[4] = (byte)command; //command\r\n encoded[6] = (byte)action; //action \r\n encoded[8] = (byte)this.rtAddress; //rt address\r\n encoded[10]= (byte)this.txRx; //txrx\r\n encoded[12]= (byte)this.subAddress;//subaddress\r\n encoded[14]= (byte)this.data.length;//count\r\n for (int i = 0, j = 0; i < this.data.length; i++,j+=2) {\r\n encoded[18+j] =(byte) this.data[i];\r\n encoded[19+j] =(byte) (this.data[i] >> 8);\r\n }\r\n return encoded;\r\n }", "boolean verify(byte[] expected);", "public byte[] generateTestDeviceCode(Device device) {\n\n ArrayList<Byte> cmdArr = new ArrayList<>();\n\n //executing action\n char instruction = 'b';\n int address = device.getAddress();\n char cmdChar = 's';\n cmdArr.add((byte) instruction);\n cmdArr.add((byte) address);\n cmdArr.add((byte) cmdChar);\n\n //prepending command length parameter\n cmdArr.add(0, (byte) (cmdArr.size() + 1));\n\n byte[] byteArray = new byte[cmdArr.size()];\n\n for (int i = 0; i < cmdArr.size(); i++) {\n byteArray[i] = cmdArr.get(i);\n }\n\n return byteArray;\n\n }", "public byte[] marshall();", "ImmutableSet<ByteValidationFailure> validate(byte[] bytes);", "public String validate(Data[] data);", "public byte[] toBytes() {\n this.setHashSize(hash.length());\n this.setRequestorHashSize(requestorHash.length());\n this.setTotalSize(2 + 4 + this.getHashSize()\n + this.getRequestorHashSize() + 4+ 4);\n\t\tbyte[] data = new byte[this.getTotalSize()];\n\t\tint index = 0;\n\t\tdata[index] = this.getProtocol();\n\t\tindex++;\n System.arraycopy(BitConverter.intToBytes(this.getTotalSize(), ByteOrder.BIG_ENDIAN),\n\t\t\t\t0, data, index, 4);\n\t\tindex+=4;\n\t\tSystem.arraycopy(BitConverter.intToBytes(hashSize, ByteOrder.BIG_ENDIAN),\n\t\t\t\t0, data, index, 4);\n\t\tindex+=4;\n\t\tSystem.arraycopy(hash.getBytes(), 0, data, index, hash.length());\n\t\tindex+=hash.length();\n\t\tSystem.arraycopy(BitConverter.intToBytes(requestorHashSize, ByteOrder.BIG_ENDIAN),\n\t\t\t\t0, data, index, 4);\n\t\tindex+=4;\n\t\tSystem.arraycopy(requestorHash.getBytes(), 0, data, index, requestorHash.length());\n\t\tindex+=requestorHash.length();\n\t\tdata[index] = this.getCommand();\n\t\tindex++;\n\t\t\n\t\treturn data;\n\t}", "private byte[] buildBytes() {\n byte[] message = new byte[4 + 2 + 2 + 1 + data.getLength()];\n System.arraycopy(id.getBytes(), 0, message, 0, 4);\n System.arraycopy(sq.getBytes(), 0, message, 4, 2);\n System.arraycopy(ack.getBytes(), 0, message, 6, 2);\n message[8] = flag.getBytes();\n System.arraycopy(data.getBytes(), 0, message, 9, data.getBytes().length);\n return message;\n }", "com.google.protobuf.ByteString\n getResultBytes();", "@Instruction(opcode = OpCode.DUP)\n @Instruction(opcode = OpCode.DUP)\n @Instruction(opcode = OpCode.ISTYPE, operand = StackItemType.BYTE_STRING_CODE)\n @Instruction(opcode = OpCode.SWAP)\n @Instruction(opcode = OpCode.ISTYPE, operand = StackItemType.BUFFER_CODE)\n @Instruction(opcode = OpCode.BOOLOR)\n @Instruction(opcode = OpCode.SWAP)\n @Instruction(opcode = OpCode.SIZE)\n @Instruction(opcode = OpCode.PUSHINT8, operand = LENGTH) // 20 bytes expected array size\n @Instruction(opcode = OpCode.NUMEQUAL)\n @Instruction(opcode = OpCode.BOOLAND)\n public static native boolean isValid(Object data);", "public byte[] getData()\r\n/* 38: */ {\r\n/* 39: 98 */ byte[] data = new byte[18];\r\n/* 40: */ \r\n/* 41:100 */ int options = 0;\r\n/* 42:102 */ if (this.promptBoxVisible) {\r\n/* 43:104 */ options |= PROMPT_BOX_VISIBLE_MASK;\r\n/* 44: */ }\r\n/* 45:107 */ if (this.promptBoxAtCell) {\r\n/* 46:109 */ options |= PROMPT_BOX_AT_CELL_MASK;\r\n/* 47: */ }\r\n/* 48:112 */ if (this.validityDataCached) {\r\n/* 49:114 */ options |= VALIDITY_DATA_CACHED_MASK;\r\n/* 50: */ }\r\n/* 51:117 */ IntegerHelper.getTwoBytes(options, data, 0);\r\n/* 52: */ \r\n/* 53:119 */ IntegerHelper.getFourBytes(this.objectId, data, 10);\r\n/* 54: */ \r\n/* 55:121 */ IntegerHelper.getFourBytes(this.numDVRecords, data, 14);\r\n/* 56: */ \r\n/* 57:123 */ return data;\r\n/* 58: */ }", "byte[] token();", "byte[] mo38566a();", "private byte[] convertingTobyteArray(String result) {\n String[] splited = result.split(\"\\\\s+\");\n byte[] valueByte = new byte[splited.length];\n for (int i = 0; i < splited.length; i++) {\n if (splited[i].length() > 2) {\n String trimmedByte = splited[i].split(\"x\")[1];\n valueByte[i] = (byte) convertstringtobyte(trimmedByte);\n }\n\n }\n return valueByte;\n\n }", "public byte[] extractValidData(){\n\t\treturn packet.getPayload();\n\t}", "byte[] getOAEPparams();", "byte[] getEByteArray();", "private byte[] generateReturnProtocol(LoanProtocol protocol) throws IOException\n\t{\n\t\tByteArrayOutputStream outputStream = new ByteArrayOutputStream();\n\n\t\tObjectOutputStream os = new ObjectOutputStream(outputStream);\n\t\tos.writeObject(protocol);\n\t\tbyte[] data = outputStream.toByteArray();\n\t\treturn data;\n\t}", "public ArrayGetByte()\n {\n super(\"ArrayGetByte\");\n }", "public static byte[] getByteArray(Operation opcode, String filename) {\n\n\t\tByteArrayOutputStream stream = new ByteArrayOutputStream();\n\n\t\tstream.write(0); // Initial 0 byte.\n\t\tstream.write(opcode.ordinal()); // 0 for error, 1 for read, 2 for write\n\t\tstream.write(filename.getBytes(), 0, filename.length());\n\t\tstream.write(0); // Separator\n\t\tstream.write(Config.DEFAULT_MODE.toString().getBytes(), 0, Config.DEFAULT_MODE.toString().length());\n\t\tstream.write(0); // Ending 0\n\n\t\treturn stream.toByteArray();\n\t}", "byte[] getData();", "byte[] getData();", "byte[] getData();", "byte[] getData();", "public OperationType[] createOperationTypes() {\n int[] op1v1 = new int[]{2, 3, 4, 6};\n OperationType op1 = new OperationType(1, op1v1, null, null, 2\n , 0, 17520, 730, 8, DataGenerator.costPenalty * DataGenerator.maxSailingTime * 4, \"Transport net before operation\");\n int[] op2v1 = new int[]{2, 3, 4, 6};\n int[] op2v2 = new int[]{2, 3, 4, 6};\n OperationType op2 = new OperationType(2, op2v1, op2v2, null,\n 3, 1, 17520, 730, 4, DataGenerator.costPenalty * DataGenerator.maxSailingTime * 4, \"Install net\");\n int[] op3v1 = new int[]{2, 3, 4, 6};\n OperationType op3 = new OperationType(3, op3v1, null,\n null, 0, 2, 17520, 730, 8, DataGenerator.costPenalty * DataGenerator.maxSailingTime * 4, \"Transport net after operation\");\n int[] op4v1 = new int[]{5};\n int[] op4v2 = new int[]{2, 3, 4, 6};\n OperationType op4 = new OperationType(4, op4v1, op4v2, null,\n 0, 0, 1152, 192, 5, DataGenerator.costPenalty * DataGenerator.maxSailingTime * 8, \"Delousing\");\n int[] op5v1 = new int[]{2, 3, 4};\n int[] op5v2 = new int[]{2, 3, 4};\n int[] op5BT = new int[]{6};\n OperationType op5 = new OperationType(5, op5v1, op5v2, op5BT,\n 0, 0, 8760, 360, 40, DataGenerator.costPenalty * DataGenerator.maxSailingTime, \"Large inspection of the facility\");\n int[] op6v1 = new int[]{2};\n OperationType op6 = new OperationType(6, op6v1, null, null,\n 0, 0, 5110, 730, 5, DataGenerator.costPenalty * DataGenerator.maxSailingTime * 4, \"Wash the net\");\n int[] op7v1 = new int[]{4, 6};\n OperationType op7 = new OperationType(7, op7v1, null, null,\n 0, 0, 8760, 360, 48, DataGenerator.costPenalty * DataGenerator.maxSailingTime, \"tightening anchor lines\");\n int[] op8v1 = new int[]{2, 3, 4, 6};\n int[] op8v2 = new int[]{2, 3, 4, 6};\n OperationType op8 = new OperationType(8, op8v1, op8v2, null,\n 0, 9, 8760, 360, 3, DataGenerator.costPenalty * DataGenerator.maxSailingTime * 4, \"Small installation facility\");\n int[] op9v1 = new int[]{2, 3, 4, 6};\n OperationType op9 = new OperationType(9, op9v1, null, null,\n 8, 0, 8760, 360, 6, DataGenerator.costPenalty * DataGenerator.maxSailingTime * 4, \"Easy transport of equipment to facility\");\n int[] op10v1 = new int[]{2, 3, 4, 6};\n OperationType op10 = new OperationType(10, op10v1, null, null,\n 0, 0, 720, 100, 2, DataGenerator.costPenalty * DataGenerator.maxSailingTime * 4, \"Remove dead fish\");\n int[] op11v1 = new int[]{2, 3, 4, 6};\n OperationType op11 = new OperationType(11, op11v1, null, null,\n 0, 0, 720, 100, 4, DataGenerator.costPenalty * DataGenerator.maxSailingTime * 8, \"Support wellboat\");\n int[] op12v1 = new int[]{1, 2, 3, 4, 6};\n OperationType op12 = new OperationType(12, op12v1, null, null,\n 0, 0, 720, 100, 5, DataGenerator.costPenalty * DataGenerator.maxSailingTime * 4, \"Inspect net ROV\");\n int[] op13v1 = new int[]{1, 3};\n OperationType op13 = new OperationType(13, op13v1, null, null,\n 0, 0, 8760, 360, 4, DataGenerator.costPenalty * DataGenerator.maxSailingTime * 4, \"Inspect net diver\");\n int[] op14v1 = new int[]{2};\n OperationType op14 = new OperationType(14, op14v1, null, null,\n 0, 0, 8760, 360, 4, DataGenerator.costPenalty * DataGenerator.maxSailingTime, \"Wash bottom ring and floating collar\");\n int[] op15v1 = new int[]{2, 3, 4, 6};\n OperationType op15 = new OperationType(15, op15v1, null, null,\n 0, 0, 168, 24, 3, DataGenerator.costPenalty * DataGenerator.maxSailingTime * 4, \"Support working boat\");\n return new OperationType[]{op1, op2, op3, op4, op5, op6, op7, op8, op9, op10, op11, op12, op13, op14, op15};\n }", "public abstract byte[] toByteArray();", "public abstract byte[] toByteArray();", "byte[] getBytes();", "byte[] getBytes();", "@Override\n\tprotected void doValidate() throws InstructionValidationException {\n\t}", "private byte[] Parse(byte[] arr)\r\n\t{\r\n\t\tbyte[] invalid = {0};\r\n\t\tif(arr[1] == 1) {\r\n\t\t\tSystem.out.println(\"***Packet Parsing***\");\r\n\t\t System.out.println(\"'Packet is a Read Request' \\n\");\r\n\t\t\tbyte[] read = {0, 3, 0, 1};\r\n\t\t\treturn read;\r\n\t\t}\r\n\t\telse if(arr[1] == 2) {\r\n\t\t\tSystem.out.println(\"***Packet Parsing***\");\r\n\t\t System.out.println(\"'Packet is a Write Request' \\n\");\r\n\t\t\tbyte[] write = {0, 4, 0, 0};\r\n\t\t\treturn write;\r\n\t\t}\r\n\t\telse {\r\n\t\t\tSystem.out.println(\"***Packet Parsing***\");\r\n\t\t System.out.println(\"'Invalid Request'\");\r\n\t\t currentStatus = false;\r\n\t\t\treturn invalid;\r\n\t\t}\r\n\t}", "public byte[] getData()\r\n/* 20: */ {\r\n/* 21:60 */ byte[] data = new byte[2];\r\n/* 22: */ \r\n/* 23:62 */ IntegerHelper.getTwoBytes(this.calcCount, data, 0);\r\n/* 24: */ \r\n/* 25:64 */ return data;\r\n/* 26: */ }", "protected void validate(String operationType) throws Exception\r\n\t{\r\n\t\tsuper.validate(operationType);\r\n\r\n\t\tMPSString id_validator = new MPSString();\r\n\t\tid_validator.validate(operationType, id, \"\\\"id\\\"\");\r\n\t\t\r\n\t\tMPSBoolean secure_access_only_validator = new MPSBoolean();\r\n\t\tsecure_access_only_validator.validate(operationType, secure_access_only, \"\\\"secure_access_only\\\"\");\r\n\t\t\r\n\t\tMPSString svm_ns_comm_validator = new MPSString();\r\n\t\tsvm_ns_comm_validator.setConstraintMaxStrLen(MPSConstants.GENERIC_CONSTRAINT, 10);\r\n\t\tsvm_ns_comm_validator.setConstraintMinStrLen(MPSConstants.GENERIC_CONSTRAINT, 1);\r\n\t\tsvm_ns_comm_validator.validate(operationType, svm_ns_comm, \"\\\"svm_ns_comm\\\"\");\r\n\t\t\r\n\t\tMPSString ns_br_interface_validator = new MPSString();\r\n\t\tns_br_interface_validator.setConstraintMaxStrLen(MPSConstants.GENERIC_CONSTRAINT, 10);\r\n\t\tns_br_interface_validator.setConstraintMinStrLen(MPSConstants.GENERIC_CONSTRAINT, 1);\r\n\t\tns_br_interface_validator.validate(operationType, ns_br_interface, \"\\\"ns_br_interface\\\"\");\r\n\t\t\r\n\t\tMPSBoolean vm_auto_poweron_validator = new MPSBoolean();\r\n\t\tvm_auto_poweron_validator.validate(operationType, vm_auto_poweron, \"\\\"vm_auto_poweron\\\"\");\r\n\t\t\r\n\t\tMPSString ns_br_interface_2_validator = new MPSString();\r\n\t\tns_br_interface_2_validator.setConstraintMaxStrLen(MPSConstants.GENERIC_CONSTRAINT, 10);\r\n\t\tns_br_interface_2_validator.setConstraintMinStrLen(MPSConstants.GENERIC_CONSTRAINT, 1);\r\n\t\tns_br_interface_2_validator.validate(operationType, ns_br_interface_2, \"\\\"ns_br_interface_2\\\"\");\r\n\t\t\r\n\t\tMPSInt init_status_validator = new MPSInt();\r\n\t\tinit_status_validator.validate(operationType, init_status, \"\\\"init_status\\\"\");\r\n\t\t\r\n\t}", "private byte[] toByteArray() {\n\n byte[] validUntilBytes = ByteBuffer.allocate(Long.BYTES).putLong(validUntil).array();\n return Tools.concatAllBytes(pseudoniem, validUntilBytes);\n }", "public boolean genStringAsByteArray();", "private void validateData() {\n }", "public abstract byte[] mo32305a(String str);", "public abstract byte[] toBytes() throws Exception;", "void mo4520a(byte[] bArr);", "private byte[] getCheckSum(byte[] checksum){\r\n\treturn Arrays.copyOfRange(checksum, 0, 4);\r\n}", "private static boolean validOperation(String op) {\n\t\tfor (String goodOp : validOps) {\n\t\t\tif (goodOp.equalsIgnoreCase(op)) {\n\t\t\t\treturn true;\n\t\t\t}\n\t\t}\n\t\treturn false;\n\t}", "void mo1751a(byte[] bArr);", "@Test\n public void canCreateWithEmptyArray() {\n // Arrange\n byte[] byteArray = new byte[0];\n\n // Act\n final EventData eventData = new EventData(byteArray);\n\n // Assert\n final byte[] actual = eventData.getBody();\n Assertions.assertNotNull(actual);\n Assertions.assertEquals(0, actual.length);\n }", "@ZenCodeType.Caster\n @ZenCodeType.Method\n default byte[] asByteArray() {\n //TODO this is actually sbyte[], but @Unsigned doesn't work on arrays right now\n return notSupportedCast(\"byte[]\");\n }", "public byte checkSum(byte[] data) {\n byte crc = 0x00;\n // 從指令類型累加到參數最後一位\n for (int i = 1; i < data.length - 2; i++) {\n crc += data[i];\n }\n return crc;\n }", "org.jetbrains.kotlin.backend.common.serialization.proto.IrOperation getOperation();", "protected byte[] buildResponse() {\n final Object[] fields = {\n messageType(),\n request,\n errorDescription\n };\n\n final byte[] resposta = new byte[1];\n final byte[] codigo = new byte[1];\n final byte[] numeroDeBytes = new byte[1];\n final byte[] dados = new byte[numeroDeBytes[0]];\n\n\n return resposta;\n }", "protected void validate(String operationType) throws Exception\r\n\t{\r\n\t\tsuper.validate(operationType);\r\n\r\n\t\tMPSString id_validator = new MPSString();\r\n\t\tid_validator.setConstraintIsReq(MPSConstants.DELETE_CONSTRAINT, true);\r\n\t\tid_validator.setConstraintIsReq(MPSConstants.MODIFY_CONSTRAINT, true);\r\n\t\tid_validator.validate(operationType, id, \"\\\"id\\\"\");\r\n\t\t\r\n\t\tMPSString name_validator = new MPSString();\r\n\t\tname_validator.setConstraintCharSetRegEx(MPSConstants.GENERIC_CONSTRAINT,\"[ a-zA-Z0-9_#.:@=-]+\");\r\n\t\tname_validator.setConstraintMaxStrLen(MPSConstants.GENERIC_CONSTRAINT, 128);\r\n\t\tname_validator.setConstraintMinStrLen(MPSConstants.GENERIC_CONSTRAINT, 1);\r\n\t\tname_validator.setConstraintIsReq(MPSConstants.ADD_CONSTRAINT, true);\r\n\t\tname_validator.validate(operationType, name, \"\\\"name\\\"\");\r\n\t\t\r\n\t\tMPSString type_validator = new MPSString();\r\n\t\ttype_validator.setConstraintMaxStrLen(MPSConstants.GENERIC_CONSTRAINT, 128);\r\n\t\ttype_validator.setConstraintMinStrLen(MPSConstants.GENERIC_CONSTRAINT, 1);\r\n\t\ttype_validator.validate(operationType, type, \"\\\"type\\\"\");\r\n\t\t\r\n\t\tMPSBoolean is_default_validator = new MPSBoolean();\r\n\t\tis_default_validator.validate(operationType, is_default, \"\\\"is_default\\\"\");\r\n\t\t\r\n\t\tMPSString username_validator = new MPSString();\r\n\t\tusername_validator.setConstraintCharSetRegEx(MPSConstants.GENERIC_CONSTRAINT,\"[ a-zA-Z0-9_#.:@=-]+\");\r\n\t\tusername_validator.setConstraintMaxStrLen(MPSConstants.GENERIC_CONSTRAINT, 127);\r\n\t\tusername_validator.setConstraintMinStrLen(MPSConstants.GENERIC_CONSTRAINT, 1);\r\n\t\tusername_validator.setConstraintIsReq(MPSConstants.ADD_CONSTRAINT, true);\r\n\t\tusername_validator.validate(operationType, username, \"\\\"username\\\"\");\r\n\t\t\r\n\t\tMPSString password_validator = new MPSString();\r\n\t\tpassword_validator.setConstraintMaxStrLen(MPSConstants.GENERIC_CONSTRAINT, 127);\r\n\t\tpassword_validator.setConstraintMinStrLen(MPSConstants.GENERIC_CONSTRAINT, 1);\r\n\t\tpassword_validator.setConstraintIsReq(MPSConstants.ADD_CONSTRAINT, true);\r\n\t\tpassword_validator.validate(operationType, password, \"\\\"password\\\"\");\r\n\t\t\r\n\t\tMPSString snmpversion_validator = new MPSString();\r\n\t\tsnmpversion_validator.validate(operationType, snmpversion, \"\\\"snmpversion\\\"\");\r\n\t\t\r\n\t\tMPSString snmpcommunity_validator = new MPSString();\r\n\t\tsnmpcommunity_validator.setConstraintMaxStrLen(MPSConstants.GENERIC_CONSTRAINT, 31);\r\n\t\tsnmpcommunity_validator.validate(operationType, snmpcommunity, \"\\\"snmpcommunity\\\"\");\r\n\t\t\r\n\t\tMPSString snmpsecurityname_validator = new MPSString();\r\n\t\tsnmpsecurityname_validator.setConstraintMaxStrLen(MPSConstants.GENERIC_CONSTRAINT, 31);\r\n\t\tsnmpsecurityname_validator.validate(operationType, snmpsecurityname, \"\\\"snmpsecurityname\\\"\");\r\n\t\t\r\n\t\tMPSString snmpsecuritylevel_validator = new MPSString();\r\n\t\tsnmpsecuritylevel_validator.validate(operationType, snmpsecuritylevel, \"\\\"snmpsecuritylevel\\\"\");\r\n\t\t\r\n\t\tMPSString snmpauthprotocol_validator = new MPSString();\r\n\t\tsnmpauthprotocol_validator.validate(operationType, snmpauthprotocol, \"\\\"snmpauthprotocol\\\"\");\r\n\t\t\r\n\t\tMPSString snmpauthpassword_validator = new MPSString();\r\n\t\tsnmpauthpassword_validator.setConstraintMaxStrLen(MPSConstants.GENERIC_CONSTRAINT, 31);\r\n\t\tsnmpauthpassword_validator.setConstraintMinStrLen(MPSConstants.GENERIC_CONSTRAINT, 8);\r\n\t\tsnmpauthpassword_validator.validate(operationType, snmpauthpassword, \"\\\"snmpauthpassword\\\"\");\r\n\t\t\r\n\t\tMPSString snmpprivprotocol_validator = new MPSString();\r\n\t\tsnmpprivprotocol_validator.validate(operationType, snmpprivprotocol, \"\\\"snmpprivprotocol\\\"\");\r\n\t\t\r\n\t\tMPSString snmpprivpassword_validator = new MPSString();\r\n\t\tsnmpprivpassword_validator.setConstraintMaxStrLen(MPSConstants.GENERIC_CONSTRAINT, 31);\r\n\t\tsnmpprivpassword_validator.setConstraintMinStrLen(MPSConstants.GENERIC_CONSTRAINT, 8);\r\n\t\tsnmpprivpassword_validator.validate(operationType, snmpprivpassword, \"\\\"snmpprivpassword\\\"\");\r\n\t\t\r\n\t}", "@Test\n public void testToHex_byteArr() {\n System.out.println(\"toHex\");\n byte[] buf = null;\n String expResult = \"\";\n String result = Crypto.toHex(buf);\n assertEquals(expResult, result);\n // TODO review the generated test code and remove the default call to fail.\n fail(\"The test case is a prototype.\");\n }", "@UpnpAction(out = {@UpnpOutputArgument(name = \"RegistrationRespMsg\", stateVariable = \"A_ARG_TYPE_RegistrationRespMsg\")})\n/* */ public byte[] registerDevice(@UpnpInputArgument(name = \"RegistrationReqMsg\", stateVariable = \"A_ARG_TYPE_RegistrationReqMsg\") byte[] registrationReqMsg) {\n/* 138 */ return new byte[0];\n/* */ }", "byte[] toByteArray(ORecordVersion version);", "void mo12206a(byte[] bArr);", "public void testToByteArrayDestOffset()\n {\n // constant value for use in this test\n final int EXTRA_DATA_LENGTH = 9;\n \n // lets test some error cases\n // first, passing null and 0\n try\n {\n EthernetAddress ethernet_address = new EthernetAddress(0L);\n ethernet_address.toByteArray((byte[])null, 0);\n // if we reached here we failed because we didn't get an exception\n fail(\"Expected exception not caught\");\n }\n catch (NullPointerException ex)\n {\n // this is the success case so do nothing\n }\n catch (Exception ex)\n {\n fail(\"Caught unexpected exception: \" + ex);\n }\n \n // now an array that is too small\n try\n {\n EthernetAddress ethernet_address = new EthernetAddress(0L);\n byte[] ethernet_address_byte_array =\n new byte[ETHERNET_ADDRESS_ARRAY_LENGTH - 1];\n ethernet_address.toByteArray(ethernet_address_byte_array, 0);\n // if we reached here we failed because we didn't get an exception\n fail(\"Expected exception not caught\");\n } catch (IllegalArgumentException ex) {\n // this is the success case so do nothing\n } catch (Exception ex) {\n fail(\"Caught unexpected exception: \" + ex);\n }\n\n // now an index that is negative\n try {\n EthernetAddress ethernet_address = new EthernetAddress(0L);\n byte[] ethernet_address_byte_array =\n new byte[ETHERNET_ADDRESS_ARRAY_LENGTH];\n ethernet_address.toByteArray(ethernet_address_byte_array, -1);\n // if we reached here we failed because we didn't get an exception\n fail(\"Expected exception not caught\");\n } catch (IllegalArgumentException ex) {\n // this is the success case so do nothing\n } catch (Exception ex) {\n fail(\"Caught unexpected exception: \" + ex);\n }\n \n // now an index that is too big\n try\n {\n EthernetAddress ethernet_address = new EthernetAddress(0L);\n byte[] ethernet_address_byte_array =\n new byte[ETHERNET_ADDRESS_ARRAY_LENGTH];\n ethernet_address.toByteArray(\n ethernet_address_byte_array, ETHERNET_ADDRESS_ARRAY_LENGTH);\n // if we reached here we failed because we didn't get an exception\n fail(\"Expected exception not caught\");\n } catch (IllegalArgumentException ex) {\n // this is the success case so do nothing\n } catch (Exception ex) {\n fail(\"Caught unexpected exception: \" + ex);\n }\n \n // now an index that is in the array,\n // but without enough bytes to read ETHERNET_ADDRESS_ARRAY_LENGTH\n try {\n EthernetAddress ethernet_address = new EthernetAddress(0L);\n byte[] ethernet_address_byte_array =\n new byte[ETHERNET_ADDRESS_ARRAY_LENGTH];\n ethernet_address.toByteArray(ethernet_address_byte_array, 1);\n // if we reached here we failed because we didn't get an exception\n fail(\"Expected exception not caught\");\n } catch (IllegalArgumentException ex) {\n // this is the success case so do nothing\n } catch (Exception ex) {\n fail(\"Caught unexpected exception: \" + ex);\n }\n \n // we'll test making a couple EthernetAddresss and then check\n // that toByteArray\n // returns the same value in byte form as used to create it\n \n // here we'll test the null EthernetAddress at offset 0\n EthernetAddress ethernet_address = new EthernetAddress(0L);\n byte[] test_array = new byte[ETHERNET_ADDRESS_ARRAY_LENGTH];\n Arrays.fill(test_array, (byte)'x');\n ethernet_address.toByteArray(test_array, 0);\n assertEthernetAddressArraysAreEqual(\n NULL_ETHERNET_ADDRESS_BYTE_ARRAY, 0, test_array, 0);\n \n // now test a non-null EthernetAddress\n ethernet_address =\n new EthernetAddress(MIXED_CASE_VALID_ETHERNET_ADDRESS_STRING);\n Arrays.fill(test_array, (byte)'x');\n ethernet_address.toByteArray(test_array);\n assertEthernetAddressArraysAreEqual(\n VALID_ETHERNET_ADDRESS_BYTE_ARRAY, 0, test_array, 0);\n \n // now test a null EthernetAddress case with extra data in the array\n ethernet_address = new EthernetAddress(0L);\n test_array =\n new byte[ETHERNET_ADDRESS_ARRAY_LENGTH + EXTRA_DATA_LENGTH];\n Arrays.fill(test_array, (byte)'x');\n ethernet_address.toByteArray(test_array, 0);\n assertEthernetAddressArraysAreEqual(\n NULL_ETHERNET_ADDRESS_BYTE_ARRAY, 0, test_array, 0);\n for (int i = 0; i < EXTRA_DATA_LENGTH; i++) {\n assertEquals(\"Expected array fill value changed\",\n (byte)'x',\n test_array[i + ETHERNET_ADDRESS_ARRAY_LENGTH]);\n }\n \n // now test a null EthernetAddress case with extra data in the array\n ethernet_address = new EthernetAddress(0L);\n test_array = new byte[ETHERNET_ADDRESS_ARRAY_LENGTH + EXTRA_DATA_LENGTH];\n Arrays.fill(test_array, (byte)'x');\n ethernet_address.toByteArray(test_array, EXTRA_DATA_LENGTH/2);\n assertEthernetAddressArraysAreEqual(\n NULL_ETHERNET_ADDRESS_BYTE_ARRAY, 0,\n test_array, EXTRA_DATA_LENGTH/2);\n for (int i = 0; i < EXTRA_DATA_LENGTH/2; i++)\n {\n assertEquals(\"Expected array fill value changed\",\n (byte)'x',\n test_array[i]);\n assertEquals(\"Expected array fill value changed\",\n (byte)'x',\n test_array[i + ETHERNET_ADDRESS_ARRAY_LENGTH +\n EXTRA_DATA_LENGTH/2]);\n }\n \n // now test a good EthernetAddress case with extra data in the array\n ethernet_address =\n new EthernetAddress(MIXED_CASE_VALID_ETHERNET_ADDRESS_STRING);\n test_array =\n new byte[ETHERNET_ADDRESS_ARRAY_LENGTH + EXTRA_DATA_LENGTH];\n Arrays.fill(test_array, (byte)'x');\n ethernet_address.toByteArray(test_array, 0);\n assertEthernetAddressArraysAreEqual(\n VALID_ETHERNET_ADDRESS_BYTE_ARRAY, 0, test_array, 0);\n for (int i = 0; i < EXTRA_DATA_LENGTH; i++)\n {\n assertEquals(\"Expected array fill value changed\",\n (byte)'x',\n test_array[i + ETHERNET_ADDRESS_ARRAY_LENGTH]);\n }\n\n // now test a good EthernetAddress case with extra data in the array\n ethernet_address =\n new EthernetAddress(MIXED_CASE_VALID_ETHERNET_ADDRESS_STRING);\n test_array =\n new byte[ETHERNET_ADDRESS_ARRAY_LENGTH + EXTRA_DATA_LENGTH];\n Arrays.fill(test_array, (byte)'x');\n ethernet_address.toByteArray(test_array, EXTRA_DATA_LENGTH/2);\n assertEthernetAddressArraysAreEqual(\n VALID_ETHERNET_ADDRESS_BYTE_ARRAY, 0,\n test_array, EXTRA_DATA_LENGTH/2);\n for (int i = 0; i < EXTRA_DATA_LENGTH/2; i++)\n {\n assertEquals(\"Expected array fill value changed\",\n (byte)'x',\n test_array[i]);\n assertEquals(\"Expected array fill value changed\",\n (byte)'x',\n test_array[i + ETHERNET_ADDRESS_ARRAY_LENGTH +\n EXTRA_DATA_LENGTH/2]);\n }\n }", "public char[] getResultBuffer() { return b; }", "public byte[] getData();", "public ArrayList<Byte> generateBlockCode(Holder h) {\n if (h.getActions().getChildren().size() == 0) {\n return null;\n }\n Block acBlock = (Block) h.getActions().getChildren().get(0);\n\n ArrayList<Byte> cmdArr1 = new ArrayList<>();\n ArrayList<Byte> cmdArr2 = new ArrayList<>();\n\n //executing action\n char instruction = 'b';\n int address = acBlock.getCapability().getDevice().getAddress();\n char cmdChar = acBlock.getCapability().getExeCommand().charAt(0);\n char cmdChar1 = acBlock.getCapability().getExeCommand().charAt(1);\n cmdArr1.add((byte) instruction);\n cmdArr1.add((byte) address);\n cmdArr1.add((byte) cmdChar);\n cmdArr1.add((byte) cmdChar1);\n\n //prepending command length parameter\n cmdArr1.add(0, (byte) (cmdArr1.size() + 1));\n \n //checking condition or sense\n instruction = 'c';\n cmdChar = acBlock.getCapability().getExeCommand().charAt(0);\n cmdChar1 = acBlock.getCapability().getExeCommand().charAt(1);\n char compType = '!';\n\n cmdArr2.add((byte) instruction);\n cmdArr2.add((byte) address);\n cmdArr2.add((byte) compType);\n short jumpAdd = 0;\n byte[] jumpArr = shortToByteArray(jumpAdd);\n for (byte b : jumpArr) {\n cmdArr2.add(b);\n }\n short respSize = 1;\n byte[] respArr = shortToByteArray(respSize);\n cmdArr2.add(respArr[0]);\n// for(byte b:respArr){\n// cmdArr2.add(b);\n// }\n int refVal = 0;\n \n byte[] refArr = intToByteArray(refVal);\n for (int i = 0; i < respSize; i++) {\n cmdArr2.add(refArr[i]);\n }\n cmdArr2.add((byte) cmdChar);\n cmdArr2.add((byte) cmdChar1);\n //prepending command length parameter\n cmdArr2.add(0, (byte) (cmdArr2.size() + 1));\n \n cmdArr1.addAll(cmdArr2);\n \n return cmdArr1;\n }", "public void validate() throws org.apache.thrift.TException {\n if (op == null) {\n throw new org.apache.thrift.protocol.TProtocolException(\"Required field 'op' was not present! Struct: \" + toString());\n }\n // check for sub-struct validity\n }", "private native int cmdXfer0(byte[] request, byte[] response);", "protected abstract Buffer doCreateBuffer(byte[] data)\n throws BadParameterException, NoSuccessException;", "ValidationResponse validate();", "com.google.protobuf.ByteString\n getErrorBytes();", "public abstract byte[] getEncoded();", "public byte[] toBytes() throws InternalServiceError {\n ByteArrayOutputStream bout = new ByteArrayOutputStream();\n DataOutputStream out = new DataOutputStream(bout);\n try {\n out.writeUTF(executionId.getDomain());\n WorkflowExecution execution = executionId.getExecution();\n out.writeUTF(execution.getWorkflowId());\n out.writeUTF(execution.getRunId());\n out.writeUTF(id);\n return bout.toByteArray();\n } catch (IOException e) {\n throw new InternalServiceError(Throwables.getStackTraceAsString(e));\n }\n }", "public abstract byte[] parse(String input);", "public byte[] array()\r\n/* 127: */ {\r\n/* 128:156 */ ensureAccessible();\r\n/* 129:157 */ return this.array;\r\n/* 130: */ }", "public boolean verify(byte[] paramArrayOfbyte) throws XMLSignatureException {\n/* 305 */ return this.signatureAlgorithm.engineVerify(paramArrayOfbyte);\n/* */ }", "public byte[] getByteArray()\n \t{\n \t\t// In some cases the array is bigger than the actual number\n \t\t// of valid bytes.\n \t\tint realByteLength = getLengthInBytes();\n \n \t\t// Currently the case is that the return from this\n \t\t// call only includes the valid bytes.\n \t\tif (value.length != realByteLength) {\n \t\t\tbyte[] data = new byte[realByteLength];\n \t\t\tSystem.arraycopy(value, 0, data, 0, realByteLength);\n \n \t\t\tvalue = data;\n \t\t}\n \n \t\treturn value;\n \t}", "public byte[] errorMessageAsBytes()\n {\n final int len = errorStringLength();\n final byte[] bytes = new byte[len];\n\n buffer().getBytes(errorMessageOffset(), bytes, 0, len);\n\n return bytes;\n }", "private static byte [] unpackFromByteArray(byte[] data, int cursor) {\r\n\t\tif (cursor+1 >= data.length) {\r\n\t\t\tthrow new ModelException(\"Internal Error: requested offset \" + (cursor +1) + \r\n\t\t\t\t\t\" is beyond length of input array \" + data.length);\r\n\t\t}\r\n\t\tint length = (data[cursor] & 0x00ff) << 8;\t// MSB\r\n\t\tlength |= data[cursor+1] & 0x00ff;\t\t\t// LSB\r\n\t\tcursor += 2;\r\n\t\tif(cursor+length > data.length){\r\n\t\t\tthrow new ModelException(\"Internal Error: Required space [\"+cursor+length+\"] exceeds data size [\"+data.length+\"]\");\r\n\t\t}\r\n\t\tbyte [] bytes = new byte[length];\r\n\t\tfor(int i = 0; i <length; i++ ){\r\n\t\t\tbytes[i] = data[cursor+i];\r\n\t\t}\r\n\t\treturn bytes;\r\n\t}", "public static byte[] createBytes()\n\t{\n\t\tbyte[]\t\trc = new byte[16];\n\t\tint\t\tid;\n\n\t\tsynchronized(itsLock)\n\t\t{\n\t\t\tid = itsCounter++;\n\n\t\t\tif(itsCounter == 0)\n\t\t\t{\n\t\t\t\t// We've wrapped around: regenerate a new base array\n\t\t\t\t_getBase();\n\t\t\t}\n\t\t}\n\n\t\tSystem.arraycopy(itsBase, 0, rc, 0, 12);\n\t\trc[12] = (byte)(id & 0xff);\n\t\trc[13] = (byte)((id >> 8) & 0xff);\n\t\trc[14] = (byte)((id >> 16) & 0xff);\n\t\trc[15] = (byte)((id >> 24) & 0xff);\n\n\t\treturn rc;\n\t}", "com.google.protobuf.ByteString\n getErrorBytes();", "com.google.protobuf.ByteString\n getErrorBytes();", "@Override\n protected void validate(final OperationIF oper) throws Exception {\n String METHOD = Thread.currentThread().getStackTrace()[1].getMethodName();\n JSONObject jsonInput = null;\n\n _logger.entering(CLASS, METHOD);\n\n if (oper == null) {\n throw new Exception(\"Operation object is null\");\n }\n\n jsonInput = oper.getJSON();\n if (jsonInput == null || jsonInput.isEmpty()) {\n throw new Exception(\"JSON Input is null or empty\");\n }\n\n switch (oper.getType()) {\n case READ: {\n this.checkAttr(jsonInput, ConstantsIF.UID);\n break;\n }\n case REPLACE: {\n this.checkAttr(jsonInput, ConstantsIF.UID);\n this.checkMeta(jsonInput);\n break;\n }\n case DELETE: {\n this.checkAttr(jsonInput, ConstantsIF.UID);\n break;\n }\n default:\n break;\n }\n\n _logger.exiting(CLASS, METHOD);\n\n return;\n }", "byte [] getBuffer ();", "@Override\n public byte[] getBuffer() {\n return EMPTY_RESULT;\n }", "public ArrayList<Byte> generateConditionBlockCode(ConditionBlock cb) {\n if ((cb.getActions().getChildren().size() == 0) || (cb.getCondition().getChildren().size() == 0)) {\n return null;\n }\n\n Block acBlock = (Block) cb.getActions().getChildren().get(0);\n Block conBlock = (Block) cb.getCondition().getChildren().get(0);\n\n ArrayList<Byte> cmdArr1 = new ArrayList<>();\n ArrayList<Byte> cmdArr2 = new ArrayList<>();\n ArrayList<Byte> cmdArr3 = new ArrayList<>();\n\n //starting action\n char instruction = 'b';\n int address = acBlock.getCapability().getDevice().getAddress();\n char cmdChar = acBlock.getCapability().getExeCommand().charAt(0);\n char cmdChar1 = acBlock.getCapability().getExeCommand().charAt(1);\n\n cmdArr1.add((byte) instruction);\n cmdArr1.add((byte) address);\n cmdArr1.add((byte) cmdChar);\n cmdArr1.add((byte) cmdChar1);\n //prepending command length parameter\n cmdArr1.add(0, (byte) (cmdArr1.size() + 1));\n\n //checking condition or sense\n instruction = 'c';\n address = conBlock.getCapability().getDevice().getAddress();\n cmdChar = conBlock.getCapability().getExeCommand().charAt(0);\n cmdChar1 = conBlock.getCapability().getExeCommand().charAt(1);\n char compType = conBlock.getCapability().getCompType().charAt(0);\n\n cmdArr2.add((byte) instruction);\n cmdArr2.add((byte) address);\n cmdArr2.add((byte) compType);\n short jumpAdd = 0;\n byte[] jumpArr = shortToByteArray(jumpAdd);\n for (byte b : jumpArr) {\n cmdArr2.add(b);\n }\n short respSize = Short.parseShort(conBlock.getCapability().getRespSize());\n byte[] respArr = shortToByteArray(respSize);\n cmdArr2.add(respArr[0]);\n// for(byte b:respArr){\n// cmdArr2.add(b);\n// }\n int refVal = Integer.parseInt(conBlock.getCapability().getRefValue());\n if (conBlock.getCapability().getType().equals(Capability.CAP_CONDITION)) {\n refVal = Integer.parseInt(conBlock.getTextField().getText());\n }\n byte[] refArr = intToByteArray(refVal);\n for (int i = 0; i < respSize; i++) {\n cmdArr2.add(refArr[i]);\n }\n cmdArr2.add((byte) cmdChar);\n cmdArr2.add((byte) cmdChar1);\n //prepending command length parameter\n cmdArr2.add(0, (byte) (cmdArr2.size() + 1));\n\n //terminating action\n instruction = 'b';\n address = acBlock.getCapability().getDevice().getAddress();\n cmdChar = acBlock.getCapability().getStopCommand().charAt(0);\n cmdChar1 = acBlock.getCapability().getStopCommand().charAt(1);\n cmdArr3.add((byte) instruction);\n cmdArr3.add((byte) address);\n cmdArr3.add((byte) cmdChar);\n cmdArr3.add((byte) cmdChar1);\n //prepending command length parameter\n cmdArr3.add(0, (byte) (cmdArr3.size() + 1));\n\n //merging lists together\n cmdArr1.addAll(cmdArr2);\n cmdArr1.addAll(cmdArr3);\n return cmdArr1;\n }", "public void testToByteArray()\n {\n // we'll test making a couple EthernetAddresses and then check that the\n // toByteArray returns the same value in byte form as used to create it\n \n // first we'll test the null EthernetAddress\n EthernetAddress ethernet_address = new EthernetAddress(0L);\n assertEquals(\"Expected length of returned array wrong\",\n ETHERNET_ADDRESS_ARRAY_LENGTH,\n ethernet_address.toByteArray().length);\n assertEthernetAddressArraysAreEqual(\n NULL_ETHERNET_ADDRESS_BYTE_ARRAY, 0,\n ethernet_address.toByteArray(), 0);\n \n // now test a non-null EthernetAddress\n ethernet_address = new EthernetAddress(VALID_ETHERNET_ADDRESS_LONG);\n assertEquals(\"Expected length of returned array wrong\",\n ETHERNET_ADDRESS_ARRAY_LENGTH,\n ethernet_address.toByteArray().length);\n assertEthernetAddressArraysAreEqual(\n VALID_ETHERNET_ADDRESS_BYTE_ARRAY, 0,\n ethernet_address.toByteArray(), 0);\n \n // let's make sure that changing the returned array doesn't mess with\n // the wrapped EthernetAddress's internals\n byte[] ethernet_address_byte_array = ethernet_address.toByteArray();\n // we'll just stir it up a bit and then check that the original\n // EthernetAddress was not changed in the process.\n // The easiest stir is to sort it ;)\n Arrays.sort(ethernet_address_byte_array);\n assertEthernetAddressArraysAreNotEqual(\n VALID_ETHERNET_ADDRESS_BYTE_ARRAY, 0,\n ethernet_address_byte_array, 0);\n assertEthernetAddressArraysAreNotEqual(\n ethernet_address.toByteArray(), 0,\n ethernet_address_byte_array, 0);\n assertEthernetAddressArraysAreEqual(\n VALID_ETHERNET_ADDRESS_BYTE_ARRAY, 0,\n ethernet_address.toByteArray(), 0);\n }", "public byte[] getbyteArray() {\n byte[] output = new byte[header_size+fileData.length];\n output[0] = (byte)((type & 0xff00)>> 8);\n output[1] = (byte)(type & 0xff);\n output[2] = (byte)((length & 0xff00)>> 8);\n\t output[3] = (byte)(length & 0xff);\n output[4] = (byte)((clientID & 0xff00)>> 8);\n output[5] = (byte)(clientID & 0xff);\n output[6] = action;\n byte[] temp2 = ByteBuffer.allocate(4).putInt(sectionLength).array();\n for(int i=0;i<4;i++) {\n output[7+i] = temp2[i]; \n }\n temp2 = ByteBuffer.allocate(4).putInt(filePosition).array();\n for(int j=0;j<4;j++) {\n output[11+j] = temp2[j]; \n }\n //copy file data\n System.arraycopy(fileData, 0,output, 15,fileData.length); \n return output;\n }", "Operation createOperation();", "Operation createOperation();", "OperationCallExp createOperationCallExp();", "private static byte[] createNameBA() {\n\t\t//Creating byte[]\n\t\tbyte[] data = new byte[SIZE_PACKET];\n\t\tByteBuffer b = ByteBuffer.wrap(data);\n\t\tb.clear();\n\n\t\t//Adding of file name bytes to the byte[]\n\t\tbyte[] nameBytes = outputFileName.getBytes();\n\t\tfor(int i = 0; i < nameBytes.length; i++) {\n\t\t\tdata[i + INDEX_CONTENT] = nameBytes[i];\t\n\t\t}\n\n\t\t//Adding headers to the byte[]\n\t\tb.rewind();\n\t\tb.putLong(0); //Save 8 bytes for checksum\n\t\tb.putInt(seqNumber); //should be 0\n\t\tb.putInt(PACKET_NAME); //should be 1 since packet type is name\n\t\tb.putInt(nameBytes.length); //number of bytes that name takes\n\n\t\t//Calculating checksum and adding to byte[]\n\t\tchecksum = new CRC32();\n\t\tchecksum.reset();\n\t\tchecksum.update(data, INDEX_SEQ, data.length - INDEX_SEQ);\n\t\tlong chksum = checksum.getValue();\n\t\tb.rewind(); //move pointer back to 0\n\t\tb.putLong(chksum); //contains checksum of INDEX_SEQ to end of packet\n\n\t\t//Return byte[]\n\t\treturn data;\n\t}", "private static byte[] createByteArray(byte[] y_1, byte[] x_1, byte[] y_0,\n\t\t\tbyte[] x_0, byte[] ybyte, byte[] psi) {\n\t\tint length = y_1.length + x_1.length + y_0.length + x_0.length\n\t\t\t\t+ ybyte.length + psi.length;\n\t\tbyte[] array = new byte[length];\n\t\tSystem.arraycopy(y_1, 0, array, 0, y_1.length);\n\t\tint temp = 0 + y_1.length;\n\t\tSystem.arraycopy(x_1, 0, array, (temp), x_1.length);\n\t\ttemp = temp + x_1.length;\n\t\tSystem.arraycopy(y_0, 0, array, (temp), y_0.length);\n\t\ttemp = temp + y_0.length;\n\t\tSystem.arraycopy(x_0, 0, array, (temp), x_0.length);\n\t\ttemp = temp + x_0.length;\n\t\tSystem.arraycopy(ybyte, 0, array, (temp), ybyte.length);\n\t\ttemp = temp + ybyte.length;\n\t\tSystem.arraycopy(psi, 0, array, (temp), psi.length);\n\n\t\treturn array;\n\t}", "@Before\n public void createOpCode() {\n opCode = new OpCodeEXA1();\n }", "byte[] byteValue() {\n\treturn data;\n }", "@Override\n public void function() {\n App.memory.setMemory(op2, Memory.convertBSToBoolArr(Memory.length32(Integer.toBinaryString(\n op1 * Integer.parseInt(App.memory.getMemory(op2, 1 << 2 + 2 + 1), 2)))));\n }", "private void validaciónDeRespuesta()\n\t{\n\t\ttry {\n\n\t\t\tString valorCifrado = in.readLine();\n\t\t\tString hmacCifrado = in.readLine();\n\t\t\tbyte[] valorDecifrado = decriptadoSimetrico(parseBase64Binary(valorCifrado), llaveSecreta, algSimetrica);\n\t\t\tString elString = printBase64Binary(valorDecifrado);\n\t\t\tbyte[] elByte = parseBase64Binary(elString);\n\n\t\t\tSystem.out.println( \"Valor decifrado: \"+elString + \"$\");\n\n\t\t\tbyte[] hmacDescifrado = decriptarAsimetrico(parseBase64Binary(hmacCifrado), llavePublica, algAsimetrica);\n\n\t\t\tString hmacRecibido =printBase64Binary(hmacDescifrado);\n\t\t\tbyte[] hmac = hash(elByte, llaveSecreta, HMACSHA512);\n\t\t\tString hmacGenerado = printBase64Binary(hmac);\n\n\n\n\n\t\t\tboolean x= hmacRecibido.equals(hmacGenerado);\n\t\t\tif(x!=true)\n\t\t\t{\n\t\t\t\tout.println(ERROR);\n\t\t\t\tSystem.out.println(\"Error, no es el mismo HMAC\");\n\t\t\t}\n\t\t\telse {\n\t\t\t\tSystem.out.println(\"Se confirmo que el mensaje recibido proviene del servidor mediante el HMAC\");\n\t\t\t\tout.println(OK);\n\t\t\t}\n\n\n\n\n\t\t} catch (Exception e) {\n\t\t\tSystem.out.println(\"Error con el hash\");\n\t\t\te.printStackTrace();\n\t\t}\n\t}", "protected void validate(String operationType) throws Exception\r\n\t{\r\n\t\tsuper.validate(operationType);\r\n\r\n\t\tMPSString id_validator = new MPSString();\r\n\t\tid_validator.setConstraintIsReq(MPSConstants.DELETE_CONSTRAINT, true);\r\n\t\tid_validator.setConstraintIsReq(MPSConstants.MODIFY_CONSTRAINT, true);\r\n\t\tid_validator.validate(operationType, id, \"\\\"id\\\"\");\r\n\t\t\r\n\t\tMPSInt adapter_id_validator = new MPSInt();\r\n\t\tadapter_id_validator.validate(operationType, adapter_id, \"\\\"adapter_id\\\"\");\r\n\t\t\r\n\t\tMPSInt pdcount_validator = new MPSInt();\r\n\t\tpdcount_validator.validate(operationType, pdcount, \"\\\"pdcount\\\"\");\r\n\t\t\r\n\t\tMPSInt ldcount_validator = new MPSInt();\r\n\t\tldcount_validator.validate(operationType, ldcount, \"\\\"ldcount\\\"\");\r\n\t\t\r\n\t}", "private boolean parseInput(byte[] input) {\r\n\t\tint p = 2;\t// pointer to first relevant character in input array\r\n\t\t// at least 13 bytes\r\n\t\tif(input.length > 12 && input.length < 500) {\r\n\t\t\tif(!(input[0] == (byte) 'A' && input[1] == (byte) '4')) return true;\r\n\t\t\t\r\n\t\t\tint checkSum = getByte(input[p]);\r\n\t\t\tif(debug) System.out.println(\"checkSum:\\t\\t\"+checkSum);\r\n\t\t\t\r\n\t\t\tint dataLength = getByte(input[p+1]) + ( getByte(input[p+2]) << 8 );\r\n\t\t\tif(debug) System.out.println(\"dataLength:\\t\"+dataLength); \r\n\t\t\t\r\n\t\t\t// ignore weird packets (usually 1st)\r\n\t\t\tif(dataLength > 1000) {\r\n\t\t\t\tif(debug) System.out.println();\r\n\t\t\t\treturn true;\t// return to clean out buffer\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tint invDataLength = getByte(input[p+3]) + ( getByte(input[p+4]) << 8 );\r\n\t\t int check = ~invDataLength & 0xff;\r\n\t\t // TODO inverse check only works for 1-byte numbers \r\n\t\t\t\r\n\t\t int timestampLow = getByte(input[p+5]);\r\n\t\t int timestampSubseconds = getByte(input[p+6]) + ( getByte(input[p+7]) << 8 );\r\n\t\t float subseconds = timestampSubseconds / 65535.0f;\r\n\t\t if(debug) System.out.println(\"timestamp:\\t\\t\"+timestampLow+ \" + \"+ PApplet.nf(subseconds,1,2));\r\n\t\t \r\n\t\t int sequenceNo = getByte(input[p+8]);\r\n\t\t if(debug) System.out.println(\"sequenceNo:\\t\"+sequenceNo);\r\n\t\t\r\n\t\t byte[] data; \r\n\t\t try {\r\n\t\t data = PApplet.subset(input, p+9, dataLength);\r\n\t\t } catch (Exception e) {\r\n\t\t if(debug) System.out.println(\"ERROR: array not long enough for dataLength variable\");\r\n\t\t return false;\r\n\t\t }\r\n\t\t \r\n\t\t int dataType = getByte(data[0]);\r\n\t\t String dataTypeStr = getDataType(dataType);\r\n\t\t if(debug) System.out.println(\"dataType:\\t\\t\"+dataType+ \" (\"+dataTypeStr+\")\");\r\n\t\t \r\n\t\t int sum = 0;\r\n\t\t for(int i=0; i<data.length; i++) {\r\n\t\t sum+= getByte(data[i]);\r\n\t\t }\r\n\t\t if(debug) System.out.print(\"sum:\\t\\t\");\r\n\t\t if((sum%256) == checkSum) {\r\n\t\t \tif(debug) System.out.println(\"VALID\");\r\n\t\t } else {\r\n\t\t \tif(debug) System.out.println(\"SUM ERROR\");\r\n\t\t \treturn true;\t// return to clear out buffer\r\n\t\t }\r\n\t\t \r\n\t\t if(debug) System.out.print(\"data:\\t\\t\");\r\n\t\t for(int i=0; i<data.length; i++) {\r\n\t\t if(debug) System.out.print(getByte(data[i])+\" \");\r\n\t\t }\r\n\t\t if(debug) System.out.println();\r\n\t\t \r\n\t\t if(dataTypeStr == \"ZeoTimestamp\") {\r\n\t\t \t_timestamp = getByte(data[1]) + (getByte(data[2]) << 8) + (getByte(data[3]) << 16) + (getByte(data[4]) << 24);\r\n\t\t \tif(debug) System.out.println(\"_timestamp:\\t\"+_timestamp);\r\n\t\t }\r\n\t\t \r\n\t\t if(dataTypeStr == \"Version\") {\r\n\t\t _version = getByte(data[1]) + (getByte(data[2]) << 8) + (getByte(data[3]) << 16) + (getByte(data[4]) << 24);\r\n\t\t if(debug) System.out.println(\"_version:\\t\"+_version);\r\n\t\t }\r\n\t\t \r\n\t\t // skip packet until version and timestamps arrive\r\n\t\t if(_timestamp == 0 || _version == 0) {\r\n\t\t if(debug) System.out.println();\r\n\t\t return true;\t// return and clear buffer \r\n\t\t }\r\n\t\t \r\n\t\t // construct full timestamp\r\n\t\t long timestamp = 0;\r\n\t\t if((_timestamp & 0xff) == timestampLow) timestamp = _timestamp;\r\n\t\t else if(((_timestamp -1) & 0xff) == timestampLow) timestamp = _timestamp - 1;\r\n\t\t else if(((_timestamp +1) & 0xff) == timestampLow) timestamp = _timestamp + 1;\r\n\t\t else timestamp = _timestamp;\r\n\t\t \r\n\t\t \r\n\t\t if(debug) {\r\n\t\t \tDate ts = new Date(timestamp);\r\n\t\t \tSystem.out.println(\"date:\\t\\t\"+ts);\r\n\t\t }\r\n\t\t \r\n\t\t // pass on data\r\n\t\t _slice.setTime(timestamp);\r\n\r\n\t\t if(dataTypeStr == \"FrequencyBins\") {\r\n\t\t _slice.setBins(data);\r\n\t\t }\r\n\t\t \r\n\t\t if(dataTypeStr == \"SleepStage\") {\r\n\t\t \tsleepState = getByte(data[1]) + (getByte(data[2]) << 8) + (getByte(data[3]) << 16) + (getByte(data[4]) << 24);\r\n\t\t if(debug) System.out.println(\"sleepstage:\\t\"+sleepState);\r\n\t\t triggerZeoSleepStateEvent();\r\n\t\t }\r\n\t\t \r\n\t\t _slice.setSleepState(sleepState);\r\n\t\t \r\n\t\t if(dataTypeStr == \"Waveform\") {\r\n\t\t _slice.setWaveForm(data);\r\n\t\t }\r\n\t\t \r\n\t\t if(dataTypeStr == \"Impedance\") {\r\n\t\t \t_slice.impedance = (long) getByte(data[1]) + (getByte(data[2]) << 8) + (getByte(data[3]) << 16) + (getByte(data[4]) << 24);\r\n\t\t }\r\n\t\t \r\n\t\t if(dataTypeStr == \"BadSignal\") {\r\n\t\t \t_slice.badSignal = (long) getByte(data[1]) + (getByte(data[2]) << 8) + (getByte(data[3]) << 16) + (getByte(data[4]) << 24);\r\n\t\t }\r\n\t\t \r\n\t\t if(dataTypeStr == \"SQI\") {\r\n\t\t \t_slice.SQI = (long) getByte(data[1]) + (getByte(data[2]) << 8) + (getByte(data[3]) << 16) + (getByte(data[4]) << 24);\r\n\t\t }\r\n\t\t \r\n\t\t if(dataTypeStr == \"SliceEnd\") {\r\n\t\t // set public slice to tmp slice\r\n\t\t slice = _slice;\r\n\t\t // empty _slice\r\n\t\t _slice = new ZeoSlice();\r\n\t\t \r\n\t\t triggerZeoSliceEvent();\r\n\t\t }\r\n\t\t \r\n\t\t if(debug) System.out.println(); \r\n\t\t return true;\r\n\t\t} else return false; // return and keep buffer, because not long enough\r\n\t\t \r\n\t}", "public byte[] GetBytes() {\n return data;\n }", "@Test\n public void testToByte() {\n System.out.println(\"toByte\");\n String hexString = \"\";\n byte[] expResult = null;\n byte[] result = Crypto.toByte(hexString);\n assertEquals(expResult, result);\n // TODO review the generated test code and remove the default call to fail.\n fail(\"The test case is a prototype.\");\n }", "public static byte[] encode(String key, byte[] data) {\n\t //.locals 11\n\t //.parameter \"key\"\n\t //.parameter \"data\"\n\t\t//.local v0, dataLen:I\n\t //.local v2, keyData:[B\n\t\t//.local v4, result:[B\n\t\t//.local v3, keyXor:B\n\t \n\t //.prologue\n\t //const/4 v10, 0x1\n\t\t//const/4 v9, 0x0\n\t\t//.line 5\n\t //invoke-virtual {p0}, Ljava/lang/String;->getBytes()[B \n\t //move-result-object v2\n\t byte[] keyData = key.getBytes();\n\t //.line 7\n\t //.local v2, keyData:[B\n\t //array-length v0, p1\n\t int dataLen = data.length;\n\t //.line 8\n\t //.local v0, dataLen:I\n\t //array-length v7, v2\n\t //add-int/2addr v7, v0\n\t //new-array v4, v7, [B\n\t byte[] result = new byte[keyData.length + dataLen];\n\t //.line 10\n\t //.local v4, result:[B\n\t //aget-byte v3, v2, v9\n\t byte keyXor = keyData[0];\n\t //.line 13\n\t //.local v3, keyXor:B\n\t \n\t //const/4 v1, 0x0\n\t //.local v1, i:I\n\t //:goto_0\n\t //if-lt v1, v0, :cond_0\n\t for (int i = 0;i < dataLen; i++) {\n\t \t//goto :cond_0;\n\t\n\t \t//.line 14\n\t //.end local v5 #resultLength:I\n\t \t//:cond_0\n\t //aget-byte v7, p1, v1\n\t //xor-int/2addr v7, v3\n\t //int-to-byte v7, v7\n\t //aput-byte v7, v4, v1\n\t result[i] = (byte)(data[i]^keyXor);\n\t //.line 15\n\t //aget-byte v3, v4, v1\n\t keyXor = result[i];\n\t //.line 13\n\t //add-int/lit8 v1, v1, 0x1\n\t //goto :goto_0\n\t }\n\t \n\t \n\n\t\t//.local v0, dataLen:I\n\t //.local v2, keyData:[B\n\t\t//.local v4, result:[B\n\t\t//.local v3, keyXor:B\n\t \n\t //.line 17\n\t //const/4 v1, 0x0\n\t //:goto_1;\n\t //array-length v7, v2\n\t //if-lt v1, v7, :cond_1\n\t for (int i = 0; i < keyData.length; i++) {\n\t \t//goto :cond_1;\n\t \t//.line 18\n\t //:cond_1\n\t //add-int v7, v1, v0\n\t \t//aget-byte v8, v2, v1\n\t \t//xor-int/2addr v8, v3\n\t \t//int-to-byte v8, v8\n\t //aput-byte v8, v4, v7\n\t \tresult[i + dataLen] = (byte) (keyData[i] ^ keyXor);\n\t //.line 19\n\t //add-int v7, v1, v0\n\t //aget-byte v3, v4, v7\n\t keyXor = result[i + dataLen];\n\t //.line 17\n\t //add-int/lit8 v1, v1, 0x1\n\t //goto :goto_1\n\t }\n\t\n\t //.line 22\n\t //array-length v5, v4\n\t int resultLength = result.length;\n\t //.line 24\n\t //.local v5, resultLength:I\n\t //const/4 v1, 0x0\n\t //:goto_2\n\t //shr-int/lit8 v7, v5, 0x1\n\t //if-lt v1, v7, :cond_2\n\t for (int i = 0; i < (resultLength >> 1); i++) {\n\t \t//goto :cond_2;\n\t \t\n\t \t//.line 25\n\t //.restart local v5 #resultLength:I\n\t //:cond_2\n\t //aget-byte v6, v4, v1\n\t byte tmp = result[i];\n\t //.line 26\n\t //.local v6, tmp:B\n\t //sub-int v7, v5, v1\n\t //sub-int/2addr v7, v10\n\t //aget-byte v7, v4, v7\n\t //aput-byte v7, v4, v1\n\t result[i] = result[resultLength - i - 1];\n\t //.line 27\n\t //sub-int v7, v5, v1\n\t //sub-int/2addr v7, v10\n\t //aput-byte v6, v4, v7\n\t result[resultLength - i - 1] = tmp;\n\t //.line 24\n\t //add-int/lit8 v1, v1, 0x1\n\t //goto :goto_2\n\t }\n\t \n\t //.line 30\n\t //aget-byte v3, v2, v9\n\t keyXor = keyData[0];\n\t //.line 31\n\t //const/4 v1, 0x0\n\t //:goto_3\n\t //if-lt v1, v5, :cond_3\n\t for (int i=0; i < resultLength; i++) {\n\t \t//goto :cond_3;\n\t \t//.line 32\n\t //.end local v6 #tmp:B\n\t //:cond_3\n\t //aget-byte v7, v4, v1\n\t //xor-int/2addr v7, v3\n\t //int-to-byte v7, v7\n\t //aput-byte v7, v4, v1\n\t result[i] = (byte)(result[i] ^ keyXor);\n\t //.line 33\n\t //aget-byte v3, v4, v1\n\t keyXor = result[i];\n\t //.line 31\n\t //add-int/lit8 v1, v1, 0x1\n\t //goto :goto_3\n\t }\n\t\n\t //.line 36\n\t //return-object v4\n\t return result;\n\t}", "public void testToByteArrayDest()\n {\n // constant for use in this test\n final int EXTRA_DATA_LENGTH = 9;\n \n // lets test some error cases\n // first, passing null\n try\n {\n EthernetAddress ethernet_address = new EthernetAddress(0L);\n ethernet_address.toByteArray((byte[])null);\n // if we reached here we failed because we didn't get an exception\n fail(\"Expected exception not caught\");\n }\n catch (NullPointerException ex)\n {\n // this is the success case so do nothing\n }\n catch (Exception ex)\n {\n fail(\"Caught unexpected exception: \" + ex);\n }\n \n // now an array that is too small\n try {\n EthernetAddress ethernet_address = new EthernetAddress(0L);\n byte[] ethernet_address_byte_array =\n new byte[ETHERNET_ADDRESS_ARRAY_LENGTH - 1];\n ethernet_address.toByteArray(ethernet_address_byte_array);\n // if we reached here we failed because we didn't get an exception\n fail(\"Expected exception not caught\");\n } catch (IllegalArgumentException ex) {\n // this is the success case so do nothing\n } catch (Exception ex) {\n fail(\"Caught unexpected exception: \" + ex);\n }\n\n // we'll test making a couple EthernetAddresses and then check that\n // toByteArray returns the same value in byte form as used to create it\n \n // here we'll test the null EthernetAddress\n EthernetAddress ethernet_address = new EthernetAddress(0L);\n byte[] test_array = new byte[ETHERNET_ADDRESS_ARRAY_LENGTH];\n Arrays.fill(test_array, (byte)'x');\n ethernet_address.toByteArray(test_array);\n assertEthernetAddressArraysAreEqual(\n NULL_ETHERNET_ADDRESS_BYTE_ARRAY, 0, test_array, 0);\n \n // now test a non-null EthernetAddress\n ethernet_address = new EthernetAddress(MIXED_CASE_VALID_ETHERNET_ADDRESS_STRING);\n Arrays.fill(test_array, (byte)'x');\n ethernet_address.toByteArray(test_array);\n assertEthernetAddressArraysAreEqual(\n VALID_ETHERNET_ADDRESS_BYTE_ARRAY, 0, test_array, 0);\n \n // now test a null EthernetAddress case with extra data in the array\n ethernet_address = new EthernetAddress(0L);\n test_array = new byte[ETHERNET_ADDRESS_ARRAY_LENGTH + EXTRA_DATA_LENGTH];\n Arrays.fill(test_array, (byte)'x');\n ethernet_address.toByteArray(test_array);\n assertEthernetAddressArraysAreEqual(NULL_ETHERNET_ADDRESS_BYTE_ARRAY, 0, test_array, 0);\n for (int i = 0; i < EXTRA_DATA_LENGTH; i++)\n {\n assertEquals(\"Expected array fill value changed\",\n (byte)'x',\n test_array[i + ETHERNET_ADDRESS_ARRAY_LENGTH]);\n }\n \n // now test a good EthernetAddress case with extra data in the array\n ethernet_address =\n new EthernetAddress(MIXED_CASE_VALID_ETHERNET_ADDRESS_STRING);\n test_array =\n new byte[ETHERNET_ADDRESS_ARRAY_LENGTH + EXTRA_DATA_LENGTH];\n Arrays.fill(test_array, (byte)'x');\n ethernet_address.toByteArray(test_array);\n assertEthernetAddressArraysAreEqual(\n VALID_ETHERNET_ADDRESS_BYTE_ARRAY, 0, test_array, 0);\n for (int i = 0; i < EXTRA_DATA_LENGTH; i++)\n {\n assertEquals(\"Expected array fill value changed\",\n (byte)'x',\n test_array[i + ETHERNET_ADDRESS_ARRAY_LENGTH]);\n }\n }", "@Override\n public byte[] generateCode(byte[] data) {\n\treturn new byte[0];\n }", "private int handleElectrodeSupplyOnOffCmdPacket()\n{\n \n int dataSize = 1; //one byte\n \n //read remainder of packet from socket and verify against the checksum\n int lStatus = readBlockAndVerify(dataSize, \n Notcher.ELECTRODE_SUPPLY_ON_OFF_CMD);\n\n //on error reading and verifying, return the error code\n if (lStatus == -1){ return(status); }\n \n //only store the values if there was no error -- errors cause return above\n\n outBufScrIndex = 0; //start with byte 0 in array\n \n electrodeSupplyOnOffByte = inBuffer[outBufScrIndex];\n \n sendACKPacket();\n \n return(lStatus);\n \n}", "public byte[] m21283OooO00o() {\n int i = ((this.f22758OooO00o - 1) >> 3) + 1;\n int i2 = i & 3;\n byte[] bArr = new byte[i];\n for (int i3 = 0; i3 < (i >> 2); i3++) {\n int i4 = (i - (i3 << 2)) - 1;\n int[] iArr = this.f22759OooO00o;\n bArr[i4] = (byte) (255 & iArr[i3]);\n bArr[i4 - 1] = (byte) ((iArr[i3] & 65280) >>> 8);\n bArr[i4 - 2] = (byte) ((iArr[i3] & C7265o0O000oo.OooOo0O) >>> 16);\n bArr[i4 - 3] = (byte) ((iArr[i3] & -16777216) >>> 24);\n }\n for (int i5 = 0; i5 < i2; i5++) {\n int i6 = ((i2 - i5) - 1) << 3;\n bArr[i5] = (byte) ((this.f22759OooO00o[this.f22760OooO0O0 - 1] & (255 << i6)) >>> i6);\n }\n return bArr;\n }", "public byte[] marshall() {\r\n if (marshall == null)\r\n marshall = Utilities.marshall(COMMAND, deviceToken, payload);\r\n return marshall.clone();\r\n }" ]
[ "0.66052115", "0.64359516", "0.5495314", "0.54634225", "0.5417735", "0.54148763", "0.538056", "0.52704155", "0.52668333", "0.5209505", "0.5171174", "0.5168165", "0.5164167", "0.51614577", "0.51170313", "0.50951326", "0.50938076", "0.5083647", "0.50667787", "0.50630623", "0.50414824", "0.5039115", "0.50338656", "0.5029367", "0.5029367", "0.5029367", "0.5029367", "0.49937412", "0.4993471", "0.4993471", "0.49806997", "0.49806997", "0.49765807", "0.49693644", "0.4955129", "0.49390972", "0.49199665", "0.49177098", "0.49131638", "0.49106243", "0.49077347", "0.48996893", "0.4898783", "0.48798856", "0.486697", "0.48608068", "0.4859563", "0.4854976", "0.48503023", "0.48486078", "0.4839348", "0.48378396", "0.48253733", "0.48242852", "0.48216695", "0.48172918", "0.48149237", "0.4804551", "0.48038355", "0.48031744", "0.48002893", "0.47987062", "0.47903988", "0.47848335", "0.47827473", "0.4776281", "0.47726595", "0.47663358", "0.47528565", "0.47345626", "0.4724654", "0.4724441", "0.4723149", "0.47146612", "0.47146612", "0.47136432", "0.47062492", "0.47050157", "0.47013992", "0.46952766", "0.4694876", "0.4688783", "0.4688783", "0.46785232", "0.46772116", "0.46769446", "0.46753627", "0.46729332", "0.466055", "0.4660082", "0.46476412", "0.46328738", "0.46315235", "0.46242663", "0.46127594", "0.46036905", "0.4599848", "0.45855877", "0.4576306", "0.45695895" ]
0.53922117
6
Creates new form JEncCCInfo
public CryptCCInfo() { initComponents(); bindComponents = new Component[] {lccinfo}; // Pressing ENTER will initiate search. ccinfo.addKeyListener(new KeyAdapter() { public void keyTyped(KeyEvent e) { //System.out.println(e.getKeyChar()); if (e.getKeyChar() == '\n') bOKActionPerformed(null); }}); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "Compleja createCompleja();", "public QRCodeInfo build() {\n return new QRCodeInfo(this.f104433a, this.f104434b, super.buildUnknownFields());\n }", "public CreateAccout() {\n initComponents();\n showCT();\n ProcessCtr(true);\n }", "void getCompanyInfoFromText() {\r\n\r\n String first = texts.get(0).getText();\r\n String cID = first;\r\n String second = texts.get(1).getText();\r\n String cNAME = second;\r\n String third = texts.get(2).getText();\r\n String password = third;\r\n String forth = texts.get(3).getText();\r\n String GUR = forth;\r\n double d = Double.parseDouble(GUR);\r\n String fifth = texts.get(4).getText();\r\n String EUR = fifth;\r\n double dd = Double.parseDouble(EUR);\r\n String sixth = texts.get(5).getText();\r\n String TSB = sixth ;\r\n String TT = \"2018-04-/08:04:26\";\r\n StringBuffer sb = new StringBuffer();\r\n sb.append(TT).insert(8,TSB);\r\n String ts = sb.toString();\r\n\r\n companyInfo.add(new CompanyInfo(cID,cNAME,password,d,dd,ts));\r\n\r\n new CompanyInfo().WriteFiles_append(companyInfo);\r\n }", "public CreditCard(int pin, String number, String holder, Date expiryDate, int cvc){\r\n this.pin = pin;\r\n this.number = number;\r\n this.holder = holder;\r\n this.expiryDate = expiryDate;\r\n this.cvc = cvc;\r\n}", "public org.oep.usermgt.model.Citizen create(long citizenId);", "public void setCCInformation(HashMap<String, String> params) {\n\t\tPAYMENT_TYPE = \"CREDIT\";\n\t\tCARD_NUM = params.get(\"cardNumber\");\n\t\tCARD_EXPIRE = params.get(\"expirationDate\");\n\t\tCVCCVV2 = params.get(\"cvv2\");\n\t}", "public CateInfo() {\r\n \tid = -1;\r\n \tname = \"\";\r\n }", "private CourseInfo(com.google.protobuf.GeneratedMessage.Builder<?> builder) {\n super(builder);\n this.unknownFields = builder.getUnknownFields();\n }", "@Override\n\tpublic void createConseille(Conseille c) {\n\t\t\n\t}", "@Override\n\tpublic void createccuntNum() {\n\t\t\n\t}", "Information createInformation();", "public BacInfo() {\n }", "public HCERTCHAINENGINE(Pointer p) {\n/* 1085 */ super(p);\n/* */ }", "protected void createRegistrationInfo() {\n registrationInfo.put(\"email\", email.getText().toString());\n registrationInfo.put(\"password\", password.getText().toString());\n }", "@Override\n\tprotected void createCompHeader() {\n\t\tString headerTxt = \"Add a New Pharmacy\";\n\t\tiDartImage icoImage = iDartImage.PHARMACYUSER;\n\t\tbuildCompHeader(headerTxt, icoImage);\n\t}", "public MendInformation() {\r\n \tinitComponents();\r\n }", "public HLCPaymentDetails() { }", "public void setPaymentInfoInCart(CreditCard cc);", "public Info() {\n super();\n }", "public AccountInfo() {\n initComponents();\n }", "public CertificationRequestInfo(\n X500Name subject,\n SubjectPublicKeyInfo pkInfo,\n ASN1Set attributes)\n {\n if ((subject == null) || (pkInfo == null))\n {\n throw new IllegalArgumentException(\"Not all mandatory fields set in CertificationRequestInfo generator.\");\n }\n\n validateAttributes(attributes);\n\n this.subject = subject;\n this.subjectPKInfo = pkInfo;\n this.attributes = attributes;\n }", "@Override\r\n\tpublic ReturnClass createKcbReqNonfiInfo(KcbReqNonfiInfoVO kcbReqNonfiInfoVO) {\r\n\r\n\t\tscrapMapper.createKcbReqNonfiInfo(kcbReqNonfiInfoVO);\r\n\t\treturn new ReturnClass(Constant.SUCCESS, \"KCB 비금융정보 요청내역 저장 완료\", \"\");\r\n\t}", "public Case(String CPR, String info) {\n this.CPR = CPR;\n this.info = info;\n creationDate = Business.getInstance().getCalendar().formatToString(new Date());\n dailyNotes = new ArrayList<>();\n medicineList = new ArrayList<>();\n }", "Cab(){\n\t\tSystem.out.println(\"Cab Object Constructed..\");\n\t}", "public KeyEncryptionKeyInfo() {\n }", "public ContractorInfoPanel() {\n\t\tinitComponents();\n\t}", "private PersonCtr createCustomer()\n {\n\n // String name, String addres, int phone, int customerID\n PersonCtr c = new PersonCtr();\n String name = jTextField3.getText();\n String address = jTextPane1.getText();\n int phone = Integer.parseInt(jTextField2.getText());\n int customerID = phone;\n Customer cu = new Customer();\n cu = c.addCustomer(name, address, phone, customerID);\n JOptionPane.showMessageDialog(null, cu.getName() + \", \" + cu.getAddress()\n + \", tlf.nr.: \" + cu.getPhone() + \" er oprettet med ID nummer: \" + cu.getCustomerID()\n , \"Kunde opretttet\", JOptionPane.INFORMATION_MESSAGE);\n return c;\n\n\n }", "private void fillConstructorFields() {\n constructorId.setText(\"\"+ constructorMutator.getConstructor().getConstructorId());\n constructorUrl.setText(\"\"+ constructorMutator.getConstructor().getConstructorUrl());\n constructorName.setText(\"\"+ constructorMutator.getConstructor().getConstructorName());\n constructorNationality.setText(\"\"+ constructorMutator.getConstructor().getNationality());\n teamLogo.setImage(constructorMutator.getConstructor().getTeamLogo().getImage());\n // Display Drivers that were from the JSON File\n constructorMutator.getConstructor().setBuffer(new StringBuffer());\n // Java 8 Streaming\n constructorMutator.getConstructorsList().stream().forEach(constructorList -> constructorMutator.getConstructor().toString(constructorList));\n }", "public CreditCard ()\r\n\t{\r\n\t\t\r\n\t}", "Compuesta createCompuesta();", "License createLicense();", "protected void createTextfield(CompContainer cc, String name, String type)\r\n\t{\r\n\t\t// create label\r\n\t\tcc.label = new JLabel(localer.getBundleText(name));\r\n\t\tcc.label.setName(\"Label-\" + name);\r\n\t\tcc.label.setFont(cc.label.getFont().deriveFont(Font.PLAIN));\r\n\t\t\r\n\t\t// create component\r\n\t\tif(type.equals(\"JTextField\"))\r\n\t\t\tcc.comp = new JTextField(prefMap.get(name));\r\n\t\telse if(type.equals(\"JPasswordField\"))\r\n\t\t\tcc.comp = new JPasswordField(prefMap.get(name));\r\n\t\telse if(type.equals(\"NumericTextField\"))\r\n\t\t\tcc.comp = new NumericTextField(prefMap.get(name));\r\n\t\tcc.comp.setName(name);\r\n\t}", "public InfoMessage createInfoMessage();", "public SMPersona(String cc) {\n this.cc = cc;\n }", "@Override\n\tpublic void encender() {\n\t\tSystem.out.println(\"Encendiendo Computadora\");\n\t\t\n\t}", "public Cgg_jur_anticipo(){}", "public static void main(String[] args)\n{\n\tJFrame f = new javax.swing.JFrame();\n\tf.setLayout(new java.awt.FlowLayout());\n\tfinal CryptCCInfo ccinfo = new CryptCCInfo();\n\tf.getContentPane().add(ccinfo);\n\tJButton jb = new javax.swing.JButton();\n//\tjb.addActionListener(new java.awt.event.ActionListener() {\n//\t public void actionPerformed(ActionEvent e) {\n//\t\t\tString s =ccinfo.getValue();\n//\t\t\tSystem.out.println(s);\n//\t\t\tccinfo.setValue(s);\n//\t\t}\n//\t});\n\tf.getContentPane().add(jb);\n\tf.pack();\n\tf.show();\n}", "public ComponentInfo createInfo( final String implementationKey )\n throws Exception\n {\n ComponentInfo bundle = (ComponentInfo)m_infos.get( implementationKey );\n if( null == bundle )\n {\n bundle = createComponentInfo( implementationKey );\n m_infos.put( implementationKey, bundle );\n }\n\n return bundle;\n }", "public JCB() {\r\n this.setJobInTime(Clock.clock.getCurrentTime());\r\n this.instructions = new ArrayList<>();\r\n }", "@Override\n\tpublic void create(CreateCoinForm form) throws Exception {\n\t}", "protected abstract CBORObject EncodeCBORObject() throws CoseException;", "public PIInfo() {\n }", "public CDAccount() {\r\n\t\t//termOfCD = 0;\r\n\t\t//maturityDate = new DateInfo();\r\n\t}", "@Override\n\tpublic String toCLPInfo() {\n\t\treturn null;\n\t}", "public BitacoraCajaRecord() {\n super(BitacoraCaja.BITACORA_CAJA);\n }", "public Form(){\n\t\ttypeOfLicenseApp = new TypeOfLicencsApplication();\n\t\toccupationalTrainingList = new ArrayList<OccupationalTraining>();\n\t\taffiadavit = new Affidavit();\n\t\tapplicationForReciprocity = new ApplicationForReciprocity();\n\t\teducationBackground = new EducationBackground();\n\t\toccupationalLicenses = new OccupationalLicenses();\n\t\tofficeUseOnlyInfo = new OfficeUseOnlyInfo();\n\t}", "public Encuesta() {\n initComponents();\n }", "public void createValue() {\n value = new AES_GetBusa_Lib_1_0.AES_GetBusa_Request();\n }", "private CSUserInfo(com.google.protobuf.GeneratedMessage.Builder<?> builder) {\n super(builder);\n this.unknownFields = builder.getUnknownFields();\n }", "public CableInfoBean() {\n super();\n }", "private void createEncodingPanel(final Composite fpcomp, final Vector<String> encodeType) {\n\t\t//\n\t\t// Create panel\n\t\t//\n\t\tComposite encodingPanel = new Composite(fpcomp, SWT.NONE);\n\t\tencodingPanel.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));\n\t\tGridLayout layout = new GridLayout();\n\t\tlayout.numColumns = 2;\n\t\tlayout.horizontalSpacing = 5;\n\t\tlayout.verticalSpacing = 0;\n\t\tlayout.marginWidth = 0;\n\t\tlayout.marginHeight = 0;\n\t\tencodingPanel.setLayout(layout);\n\n\t\t//\n\t\t// Create label\n\t\t//\n\t\tnew Label(encodingPanel, SWT.NONE).setText(Messages.HexEditorControl_30);\n\n\t\t//\n\t\t// Create combo\n\t\t//\n\t\tencodingCombo = getEncodingCombo(encodingPanel, encodeType);\n\n\t\t//\n\t\t// Add selection listener to the combo box\n\t\t//\n\t\tencodingCombo.addSelectionListener(new SelectionAdapter() {\n\t\t\t@Override\n public void widgetSelected(SelectionEvent e) {\n\t\t\t\tencodingChanged();\n\t\t\t} // widgetSelected()\n\t\t});\n\t}", "void showCreditCardForm() {\n Intent intent = new Intent(this, CreditCardActivity.class);\n intent.putExtra(CreditCardActivity.EXTRA_PKEY, getString(R.string.omise_pkey));\n startActivityForResult(intent, REQUEST_CC);\n }", "public void crearClase() {\r\n\t\tsetClase(3);\r\n\t\tsetTipoAtaque(3);\r\n\t\tsetArmadura(15);\r\n\t\tsetModopelea(0);\r\n\t}", "private void initData() {\n ContractList conl = new ContractList();\n String iCard = txtindentify.getText().trim();\n if (conl.getacc(iCard) == 0) {\n txtAcc.setText(\"NEW CUSTOMER\");\n\n } else {\n Customer cus = new Customer();\n CustomerList cl = new CustomerList();\n cus = cl.getcus(iCard);\n txtAcc.setText(Integer.toString(cus.acc));\n\n }\n }", "byte[] createJCasCoverClass(TypeImpl type) {\n this.type = type;\n typeJavaDescriptor = type.getJavaDescriptor();\n typeJavaClassName = type.getName().replace('.', '/');\n cn = new ClassNode(ASM5); // java 8\n cn.version = JAVA_CLASS_VERSION;\n cn.access = ACC_PUBLIC + ACC_SUPER;\n cn.name = typeJavaClassName; \n cn.superName = type.getSuperType().getName().replace('.', '/');\n// cn.interfaces = typeImpl.getInterfaceNamesArray(); // TODO\n \n // add the \"_typeImpl\" field - this has a ref to the TypeImpl for this class\n cn.fields.add(new FieldNode(ACC_PUBLIC + ACC_FINAL + ACC_STATIC,\n \"_typeImpl\", \"Lorg/apache/uima/type_system/impl/TypeImpl;\", null, null));\n \n // add field declares, and getters and setters, and special getters/setters for array things \n type.getMergedStaticFeaturesIntroducedByThisType().stream()\n .forEach(this::addFeatureFieldGetSet);\n \n addStaticInitAndConstructors();\n \n createSwitchGettersAndSetters();\n \n \n ClassWriter cw = new ClassWriter(ClassWriter.COMPUTE_FRAMES);\n cn.accept(cw);\n return cw.toByteArray();\n }", "public CCPMention(JCas jcas) {\n super(jcas);\n readObject();\n }", "public SignupAccountInfoAvatar() {\n super(\"SignupAvatar.AccountInfo\", BrowserConstants.DIALOGUE_BACKGROUND);\n this.profileConstraints = ProfileConstraints.getInstance();\n this.securityQuestionModel = new DefaultComboBoxModel();\n this.usernameReservations = new HashMap<String, UsernameReservation>();\n this.emailReservations = new HashMap<EMail, EMailReservation>();\n initSecurityQuestionModel();\n initComponents();\n addValidationListeners();\n initFocusListener();\n }", "public CCuenta()\n {\n }", "public ClassInfo() {\n }", "public Encargar() { \n initComponents();\n inicializar();\n \n }", "public void createValue() {\n value = new GisInfoCaptureDO();\n }", "@Override\n\tpublic String createCouponCode(CampaignActivity ca, String stringParams) {\n\t\tJSONObject params = new JSONObject(stringParams);\n\t\tif(!StringUtils.hasText(ca.getCouponCode())) {\n\t\t\tca.setCouponCode(Hash.generateAuthCode());\n\t\t\t\n\t\t\t//FIXME: Hardcoded Cinepolis code here!!!!\n\t\t\tif(StringUtils.hasText(ca.getDeviceUUID())) {\n\t\t\t\ttry {\n\t\t\t\t\tDeviceInfo device = deviceInfoDao.get(ca.getDeviceUUID(), true);\n\t\t\t\t\tif( device.getAppId().equals(\"cinepolis_mx\")) {\n\n\t\t\t\t\t\tJSONObject extras = new JSONObject(ca.getExtras() != null ? ca.getExtras().getValue() : \"\");\n\t\t\t\t\t\tJSONArray coupons = extras.has(\"suggestedCoupons\") ? extras.getJSONArray(\"suggestedCoupons\") : null;\n\n\t\t\t\t\t\tif( coupons != null ) {\n\n\t\t\t\t\t\t\tca.setCouponCode(coupons.getString(0));\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\tif( params != null && params.has(\"couponCount\") && params.getInt(\"couponCount\") >= 2)\n\t\t\t\t\t\t\t\textras.put(\"extraCoupon1\", coupons.getString(1));\n\n\t\t\t\t\t\t\tif( params != null && params.has(\"couponCount\") && params.getInt(\"couponCount\") >= 3)\n\t\t\t\t\t\t\t\textras.put(\"extraCoupon2\", coupons.getString(2));\n\n\t\t\t\t\t\t\tif( params != null && params.has(\"couponCount\"))\n\t\t\t\t\t\t\t\textras.put(\"couponCount\", params.getInt(\"couponCount\"));\n\n\t\t\t\t\t\t\tca.setExtras(new Text(extras.toString()));\n\t\t\t\t\t\t\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\n\t\t\t\t\t\t\tca.setCouponCode(\"000000000001\");\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\tif( params != null && params.has(\"couponCount\") && params.getInt(\"couponCount\") >= 2)\n\t\t\t\t\t\t\t\textras.put(\"extraCoupon1\", \"000000000002\");\n\n\t\t\t\t\t\t\tif( params != null && params.has(\"couponCount\") && params.getInt(\"couponCount\") >= 3)\n\t\t\t\t\t\t\t\textras.put(\"extraCoupon2\", \"000000000003\");\n\n\t\t\t\t\t\t\tif( params != null && params.has(\"couponCount\"))\n\t\t\t\t\t\t\t\textras.put(\"couponCount\", params.getInt(\"couponCount\"));\n\n\t\t\t\t\t\t\tca.setExtras(new Text(extras.toString()));\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t} catch( ASException | JSONException e ) {\n\t\t\t\t\tlog.log(Level.SEVERE, e.getMessage(), e);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn ca.getCouponCode();\n\t}", "private void creatEmptyChineseData() {\n chineseInserts.put(ZcSettingConstants.CHINESE, \"上架费\");\r\n chineseInserts.put(ZcSettingConstants.US, new BigDecimal(0));\r\n chineseInserts.put(ZcSettingConstants.UK, new BigDecimal(0));\r\n chineseInserts.put(ZcSettingConstants.DE, new BigDecimal(0));\r\n chineseInserts.put(ZcSettingConstants.FR, new BigDecimal(0));\r\n chineseInserts.put(ZcSettingConstants.CA, new BigDecimal(0));\r\n chineseInserts.put(ZcSettingConstants.AU, new BigDecimal(0));\r\n\r\n chineseFVLs.put(ZcSettingConstants.CHINESE, \"成交费\");\r\n chineseFVLs.put(ZcSettingConstants.US, new BigDecimal(0));\r\n chineseFVLs.put(ZcSettingConstants.UK, new BigDecimal(0));\r\n chineseFVLs.put(ZcSettingConstants.DE, new BigDecimal(0));\r\n chineseFVLs.put(ZcSettingConstants.FR, new BigDecimal(0));\r\n chineseFVLs.put(ZcSettingConstants.CA, new BigDecimal(0));\r\n chineseFVLs.put(ZcSettingConstants.AU, new BigDecimal(0));\r\n\r\n chinesePayPalFees.put(ZcSettingConstants.CHINESE, \"paypal费\");\r\n chinesePayPalFees.put(ZcSettingConstants.US, new BigDecimal(0));\r\n chinesePayPalFees.put(ZcSettingConstants.UK, new BigDecimal(0));\r\n chinesePayPalFees.put(ZcSettingConstants.DE, new BigDecimal(0));\r\n chinesePayPalFees.put(ZcSettingConstants.FR, new BigDecimal(0));\r\n chinesePayPalFees.put(ZcSettingConstants.CA, new BigDecimal(0));\r\n chinesePayPalFees.put(ZcSettingConstants.AU, new BigDecimal(0));\r\n\r\n chineseProfits.put(ZcSettingConstants.CHINESE, \"利润\");\r\n chineseProfits.put(ZcSettingConstants.US, new BigDecimal(0));\r\n chineseProfits.put(ZcSettingConstants.UK, new BigDecimal(0));\r\n chineseProfits.put(ZcSettingConstants.DE, new BigDecimal(0));\r\n chineseProfits.put(ZcSettingConstants.FR, new BigDecimal(0));\r\n chineseProfits.put(ZcSettingConstants.CA, new BigDecimal(0));\r\n chineseProfits.put(ZcSettingConstants.AU, new BigDecimal(0));\r\n\r\n chineseProfitRates.put(ZcSettingConstants.CHINESE, \"利润率\");\r\n chineseProfitRates.put(ZcSettingConstants.US, new BigDecimal(0));\r\n chineseProfitRates.put(ZcSettingConstants.UK, new BigDecimal(0));\r\n chineseProfitRates.put(ZcSettingConstants.DE, new BigDecimal(0));\r\n chineseProfitRates.put(ZcSettingConstants.FR, new BigDecimal(0));\r\n chineseProfitRates.put(ZcSettingConstants.CA, new BigDecimal(0));\r\n chineseProfitRates.put(ZcSettingConstants.AU, new BigDecimal(0));\r\n }", "public JajarGenjang() {\n initComponents();\n }", "private SCUserInfo(com.google.protobuf.GeneratedMessage.Builder<?> builder) {\n super(builder);\n this.unknownFields = builder.getUnknownFields();\n }", "public InfoDialog() {\r\n\t\tcreateContents();\r\n\t}", "X509CertificateInfo()\n {\n }", "private Constructor getConstructor() throws Exception {\r\n return type.getConstructor(Contact.class, label, Format.class);\r\n }", "public JStudentInfoRecord() {\n super(JStudentInfo.STUDENT_INFO);\n }", "public void createCourse(String courseName, int courseCode){}", "protected ComponentInfo createComponentInfo( final String implementationKey )\n throws Exception\n {\n final Class type = getClassLoader().loadClass( implementationKey );\n return m_blockInfoReader.buildComponentInfo( type );\n }", "private CSTeamCreate(com.google.protobuf.GeneratedMessage.Builder<?> builder) {\n super(builder);\n this.unknownFields = builder.getUnknownFields();\n }", "private Citizen(com.google.protobuf.GeneratedMessageV3.Builder<?> builder) {\n super(builder);\n }", "public void create_ContactTracer(Citizen citizen)\n\t{\n\t\tPersonalDetails details = citizen.getDetails(); \n\t\tString user = citizen.getUsername(), \n\t\t\t pass = citizen.getPassword();\n\t\t\n\t\taccounts.remove(citizen);\n\t\taccounts.add(new ContactTracer(user, pass));\n\t\taccounts.get(accounts.size() - 1).setPersonalDetails(details);\n\t}", "protected Ccr createCcr(CcRecordType type) {\n\t\tif (type == null) {\n\t\t\tthrow new NullPointerException(\"cannot create a new CCR without a type\");\n\t\t}\n\n\t\tlong accountingRecordNumber = getRecordNumber();\n\t\tDiameterClientRequest request = _client.newAuthRequest(ChargingConstants.COMMAND_CC, true);\n\n\t\tDiameterAVP avp = new DiameterAVP(ChargingUtils.getServiceContextIdAVP());\n\t\tavp.setValue(UTF8StringFormat.toUtf8String(getServiceContextId()), false);\n\t\trequest.addDiameterAVP(avp);\n\n\t\tavp = new DiameterAVP(ChargingUtils.getCcRequestTypeAVP());\n\t\tavp.setValue(EnumeratedFormat.toEnumerated(type.getValue()), false);\n\t\trequest.addDiameterAVP(avp);\n\n\t\tCcr res = new Ccr(request, getVersion());\n\t\tres.setRequestNumber(accountingRecordNumber);\n\t\t\n\t\treturn res;\n\t}", "private String processConstructor() {\n int firstBracket = line.indexOf('(');\n //The substring of line after the bracket (inclusive)\n String parameters = line.substring(firstBracket);\n return \"A constructor \"+className+parameters+\" is created.\";\n }", "public BtxDetailsKcFormDefinition() {\n super();\n }", "public void fillregister()\n {\n CD cD1 = new CD(\"\", \"\", \"\", 1992);\n Tape tape1 = new Tape(\"\", \"\");\n Music music1 = new Music(\"\", 1, \"\", 1, 1);\n AdvertisingJingle advertis1 = new AdvertisingJingle(\"\", \"\", \"\", 1, 1);\n News news1 = new News(\"\", \"\", \"\", 1, 1);\n SoundEffect soundEff1 = new SoundEffect(\"\", \"\", 1, 1);\n star.addMedia(cD1);\n star.addMedia(tape1);\n cD1.addTrack(music1);\n cD1.addTrack(advertis1);\n tape1.addTrack(soundEff1);\n tape1.addTrack(news1);\n cD1.setLabel(\"8\");\n }", "public static NodoListaC creaInCoda() {\r\n\t\tNodoListaC a = new NodoListaC();\r\n\t\tNodoListaC p = a; //a rimane in testa alla lista\r\n\t\tp.info = 'A';\r\n\t\tp.next = new NodoListaC();\r\n\t\tp = p.next;\r\n\t\tchar c;\r\n\t\tfor (c = 'B'; c < 'Z'; c++) {\r\n\t\t p.info = c;\r\n\t\t p.next = new NodoListaC();\r\n\t \t p = p.next; \r\n\t\t}\r\n\t\tp.info = 'Z';\r\n\t\tp.next = null;\r\n\t\t\r\n\t\treturn a; \r\n\t}", "public ContactInfo() {\n\n }", "@SuppressWarnings(\"unchecked\")\n // <editor-fold defaultstate=\"collapsed\" desc=\"Generated Code\">//GEN-BEGIN:initComponents\n private void initComponents() {\n\n jPanel2 = new javax.swing.JPanel();\n jLabel4 = new javax.swing.JLabel();\n jLabel5 = new javax.swing.JLabel();\n cvv_txt = new javax.swing.JTextField();\n jLabel6 = new javax.swing.JLabel();\n jLabel7 = new javax.swing.JLabel();\n nameoncard_txt = new javax.swing.JTextField();\n year_cb = new javax.swing.JComboBox();\n month_cb = new javax.swing.JComboBox();\n jLabel8 = new javax.swing.JLabel();\n crdno_txt = new javax.swing.JTextField();\n link_btn = new javax.swing.JButton();\n back_btn = new javax.swing.JButton();\n uid_LB = new javax.swing.JLabel();\n jLabel1 = new javax.swing.JLabel();\n jLabel2 = new javax.swing.JLabel();\n\n setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);\n getContentPane().setLayout(new org.netbeans.lib.awtextra.AbsoluteLayout());\n\n jPanel2.setBorder(javax.swing.BorderFactory.createTitledBorder(null, \"Enter Debit/Credit Card Details \", javax.swing.border.TitledBorder.LEFT, javax.swing.border.TitledBorder.ABOVE_TOP, new java.awt.Font(\"Tahoma\", 3, 18))); // NOI18N\n jPanel2.setLayout(new org.netbeans.lib.awtextra.AbsoluteLayout());\n\n jLabel4.setFont(new java.awt.Font(\"Times New Roman\", 1, 14));\n jLabel4.setText(\"CVV(3-Digit Verification Number)\");\n jPanel2.add(jLabel4, new org.netbeans.lib.awtextra.AbsoluteConstraints(260, 150, 220, -1));\n\n jLabel5.setFont(new java.awt.Font(\"Times New Roman\", 1, 14));\n jLabel5.setText(\"Your card details will be secure and will not be shared with anyone.\");\n jPanel2.add(jLabel5, new org.netbeans.lib.awtextra.AbsoluteConstraints(10, 30, -1, -1));\n\n cvv_txt.setFont(new java.awt.Font(\"Times New Roman\", 0, 14));\n jPanel2.add(cvv_txt, new org.netbeans.lib.awtextra.AbsoluteConstraints(260, 170, 70, 30));\n\n jLabel6.setFont(new java.awt.Font(\"Times New Roman\", 1, 14));\n jLabel6.setText(\"Card No\");\n jPanel2.add(jLabel6, new org.netbeans.lib.awtextra.AbsoluteConstraints(30, 90, 50, -1));\n\n jLabel7.setFont(new java.awt.Font(\"Times New Roman\", 1, 14));\n jLabel7.setText(\"Name On Card (As it appears on card)\");\n jPanel2.add(jLabel7, new org.netbeans.lib.awtextra.AbsoluteConstraints(30, 210, 250, -1));\n\n nameoncard_txt.setFont(new java.awt.Font(\"Times New Roman\", 0, 14));\n jPanel2.add(nameoncard_txt, new org.netbeans.lib.awtextra.AbsoluteConstraints(30, 230, 450, 30));\n\n year_cb.setModel(new javax.swing.DefaultComboBoxModel(new String[] { \"Year\", \"2017\", \"2018\", \"2019\", \"2020\", \"2021\", \"2022\", \"2023\", \"2024\", \"2025\", \"2026\", \"2027\", \"2028\", \"2029\", \"2030\" }));\n year_cb.addActionListener(new java.awt.event.ActionListener() {\n public void actionPerformed(java.awt.event.ActionEvent evt) {\n year_cbActionPerformed(evt);\n }\n });\n jPanel2.add(year_cb, new org.netbeans.lib.awtextra.AbsoluteConstraints(30, 180, -1, -1));\n\n month_cb.setModel(new javax.swing.DefaultComboBoxModel(new String[] { \"Month\", \"January\", \"February\", \"March\", \"April\", \"May\", \"June\", \"July\", \"August\", \"September\", \"October\", \"November\", \"December\" }));\n month_cb.addActionListener(new java.awt.event.ActionListener() {\n public void actionPerformed(java.awt.event.ActionEvent evt) {\n month_cbActionPerformed(evt);\n }\n });\n jPanel2.add(month_cb, new org.netbeans.lib.awtextra.AbsoluteConstraints(90, 180, -1, -1));\n\n jLabel8.setFont(new java.awt.Font(\"Times New Roman\", 1, 14));\n jLabel8.setText(\"Expiry Date(Valid Thru)\");\n jPanel2.add(jLabel8, new org.netbeans.lib.awtextra.AbsoluteConstraints(30, 150, 150, -1));\n\n crdno_txt.setFont(new java.awt.Font(\"Times New Roman\", 0, 14));\n jPanel2.add(crdno_txt, new org.netbeans.lib.awtextra.AbsoluteConstraints(30, 110, 240, 30));\n\n link_btn.setBackground(new java.awt.Color(0, 255, 0));\n link_btn.setFont(new java.awt.Font(\"Times New Roman\", 1, 24));\n link_btn.setText(\"Link Bank Account\");\n link_btn.setBorder(new javax.swing.border.LineBorder(new java.awt.Color(0, 0, 0), 5, true));\n link_btn.addActionListener(new java.awt.event.ActionListener() {\n public void actionPerformed(java.awt.event.ActionEvent evt) {\n link_btnActionPerformed(evt);\n }\n });\n jPanel2.add(link_btn, new org.netbeans.lib.awtextra.AbsoluteConstraints(30, 270, 450, 40));\n\n back_btn.setBackground(new java.awt.Color(255, 0, 0));\n back_btn.setFont(new java.awt.Font(\"Times New Roman\", 1, 24));\n back_btn.setText(\"Back\");\n back_btn.setBorder(new javax.swing.border.LineBorder(new java.awt.Color(0, 0, 0), 5, true));\n back_btn.addActionListener(new java.awt.event.ActionListener() {\n public void actionPerformed(java.awt.event.ActionEvent evt) {\n back_btnActionPerformed(evt);\n }\n });\n jPanel2.add(back_btn, new org.netbeans.lib.awtextra.AbsoluteConstraints(30, 330, 450, 40));\n\n uid_LB.setText(\"jLabel1\");\n jPanel2.add(uid_LB, new org.netbeans.lib.awtextra.AbsoluteConstraints(610, 240, -1, -1));\n\n jLabel1.setIcon(new javax.swing.ImageIcon(getClass().getResource(\"/Image/mini_kb_4_02.jpg\"))); // NOI18N\n jPanel2.add(jLabel1, new org.netbeans.lib.awtextra.AbsoluteConstraints(280, 110, -1, 30));\n\n jLabel2.setIcon(new javax.swing.ImageIcon(getClass().getResource(\"/Image/cvv.jpg\"))); // NOI18N\n jPanel2.add(jLabel2, new org.netbeans.lib.awtextra.AbsoluteConstraints(330, 160, 80, 50));\n\n getContentPane().add(jPanel2, new org.netbeans.lib.awtextra.AbsoluteConstraints(30, 20, 790, 450));\n\n pack();\n }", "private CZ()\n {\n }", "private END1001U02DsvLDOCS0801Info(com.google.protobuf.GeneratedMessage.Builder<?> builder) {\n super(builder);\n this.unknownFields = builder.getUnknownFields();\n }", "public Create_Course() {\n initComponents();\n comboBoxLec();\n comboBoxDep();\n }", "Builder addLicense(CreativeWork.Builder value);", "private String newQi4jAccount()\n throws UnitOfWorkCompletionException\n {\n UnitOfWork work = unitOfWorkFactory.newUnitOfWork();\n EntityBuilder<AccountComposite> entityBuilder = work.newEntityBuilder( AccountComposite.class );\n AccountComposite accountComposite = entityBuilder.instance();\n accountComposite.name().set( ACCOUNT_NAME );\n accountComposite = entityBuilder.newInstance();\n String accoutnIdentity = accountComposite.identity().get();\n work.complete();\n\n return accoutnIdentity;\n }", "ComplicationOverlayWireFormat() {}", "public ProveedorInfo() {\n\t\tnombre = EMPTY_STRING;\n\t\tdescripcion = EMPTY_STRING;\n\t\tcaHash = new Hashtable<String, String>();\n\t\tservidores = new Vector<ServidorOcsp>();\n\n\t}", "public Information()\n\t{\n\t\t// empty constructor\n\t}", "public Info1() {\n initComponents();\n }", "public void CreateCipher() {\n String key = \"IWantToPassTAP12\"; // 128 bit key\n aesKey = new javax.crypto.spec.SecretKeySpec(key.getBytes(), \"AES\");\n try {\n this.cipher = Cipher.getInstance(\"AES\");\n } catch (Exception e) {\n e.printStackTrace();\n }\n }", "public infoRc5() {\n initComponents();\n }", "@SuppressWarnings(\"unchecked\")\n // <editor-fold defaultstate=\"collapsed\" desc=\"Generated Code\">//GEN-BEGIN:initComponents\n private void initComponents() {\n\n Exit = new javax.swing.JLabel();\n createSubIdTxt = new javax.swing.JTextField();\n createSubId = new javax.swing.JLabel();\n createSubNameTxt = new javax.swing.JTextField();\n createSubName = new javax.swing.JLabel();\n createDepIdTxt = new javax.swing.JComboBox<>();\n createLecId = new javax.swing.JLabel();\n createDepId = new javax.swing.JLabel();\n createLecIdTxt = new javax.swing.JComboBox<>();\n sumbit = new javax.swing.JButton();\n noticeBack = new javax.swing.JLabel();\n\n setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);\n setTitle(\"Create Course\");\n setResizable(false);\n getContentPane().setLayout(new org.netbeans.lib.awtextra.AbsoluteLayout());\n\n Exit.setIcon(new javax.swing.ImageIcon(getClass().getResource(\"/image/exit.png\"))); // NOI18N\n Exit.setCursor(new java.awt.Cursor(java.awt.Cursor.HAND_CURSOR));\n Exit.addMouseListener(new java.awt.event.MouseAdapter() {\n public void mouseClicked(java.awt.event.MouseEvent evt) {\n ExitMouseClicked(evt);\n }\n });\n getContentPane().add(Exit, new org.netbeans.lib.awtextra.AbsoluteConstraints(530, 20, -1, -1));\n\n createSubIdTxt.setFont(new java.awt.Font(\"Calibri\", 0, 18)); // NOI18N\n getContentPane().add(createSubIdTxt, new org.netbeans.lib.awtextra.AbsoluteConstraints(220, 160, 150, 25));\n\n createSubId.setFont(new java.awt.Font(\"Calibri\", 1, 14)); // NOI18N\n createSubId.setForeground(new java.awt.Color(255, 255, 255));\n createSubId.setText(\"Subject ID\");\n getContentPane().add(createSubId, new org.netbeans.lib.awtextra.AbsoluteConstraints(50, 160, -1, -1));\n\n createSubNameTxt.setFont(new java.awt.Font(\"Calibri\", 0, 18)); // NOI18N\n getContentPane().add(createSubNameTxt, new org.netbeans.lib.awtextra.AbsoluteConstraints(220, 240, 300, 30));\n\n createSubName.setFont(new java.awt.Font(\"Calibri\", 1, 14)); // NOI18N\n createSubName.setForeground(new java.awt.Color(255, 255, 255));\n createSubName.setText(\"Subject Name\");\n getContentPane().add(createSubName, new org.netbeans.lib.awtextra.AbsoluteConstraints(50, 240, -1, -1));\n\n getContentPane().add(createDepIdTxt, new org.netbeans.lib.awtextra.AbsoluteConstraints(220, 60, -1, -1));\n\n createLecId.setFont(new java.awt.Font(\"Calibri\", 1, 14)); // NOI18N\n createLecId.setForeground(new java.awt.Color(255, 255, 255));\n createLecId.setText(\"Lecturer ID\");\n getContentPane().add(createLecId, new org.netbeans.lib.awtextra.AbsoluteConstraints(50, 320, -1, -1));\n\n createDepId.setFont(new java.awt.Font(\"Calibri\", 1, 14)); // NOI18N\n createDepId.setForeground(new java.awt.Color(255, 255, 255));\n createDepId.setText(\"Department ID\");\n getContentPane().add(createDepId, new org.netbeans.lib.awtextra.AbsoluteConstraints(50, 60, -1, -1));\n\n getContentPane().add(createLecIdTxt, new org.netbeans.lib.awtextra.AbsoluteConstraints(220, 320, -1, -1));\n\n sumbit.setText(\"Submit\");\n sumbit.setCursor(new java.awt.Cursor(java.awt.Cursor.HAND_CURSOR));\n sumbit.addActionListener(new java.awt.event.ActionListener() {\n public void actionPerformed(java.awt.event.ActionEvent evt) {\n sumbitActionPerformed(evt);\n }\n });\n getContentPane().add(sumbit, new org.netbeans.lib.awtextra.AbsoluteConstraints(490, 410, -1, -1));\n\n noticeBack.setIcon(new javax.swing.ImageIcon(getClass().getResource(\"/image/interface1.jpg\"))); // NOI18N\n noticeBack.setPreferredSize(new java.awt.Dimension(600, 500));\n getContentPane().add(noticeBack, new org.netbeans.lib.awtextra.AbsoluteConstraints(0, 0, -1, -1));\n\n pack();\n setLocationRelativeTo(null);\n }", "public String createCoopAdmin(int compId, int branchId, String username, String regdate,\r\n String memberno, String phone, String name, String email,String address, String coopprf){\r\n \r\n JSONObject obj = new JSONObject(); \r\n\r\n obj.put(\"gcid\", compId);\r\n obj.put(\"gbid\", branchId);\r\n obj.put(\"username\", username);\r\n obj.put(\"regdate\", regdate); \r\n obj.put(\"memberno\", memberno);\r\n obj.put(\"phone\", phone);\r\n obj.put(\"name\", name);\r\n obj.put(\"email\", email);\r\n obj.put(\"address\", address);\r\n obj.put(\"coopprf\", coopprf);\r\n \r\n return obj.toJSONString();\r\n }", "private void criaCabecalho() {\r\n\t\tJLabel cabecalho = new JLabel(\"Cadastro de Homem\");\r\n\t\tcabecalho.setHorizontalAlignment(SwingConstants.CENTER);\r\n\t\tcabecalho.setFont(new Font(\"Arial\", Font.PLAIN, 16));\r\n\t\tcabecalho.setForeground(Color.BLACK);\r\n\t\tcabecalho.setBounds(111, 41, 241, 33);\r\n\t\tpainelPrincipal.add(cabecalho);\r\n\t}", "public VaccineInfo(){}", "public CmsMajorComp(\r\n\t\t\tjava.lang.Integer id,\r\n\t\t\tjava.lang.String name,\r\n\t\t\tjava.lang.String typeid,\r\n\t\t\tjava.lang.Integer recommand,\r\n\t\t\tjava.lang.String province,\r\n\t\t\tjava.lang.String city,\r\n\t\t\tjava.lang.String country,\r\n\t\t\tjava.lang.String pcode,\r\n\t\t\tjava.lang.String address,\r\n\t\t\tjava.lang.String telephone,\r\n\t\t\tjava.lang.String fax,\r\n\t\t\tjava.lang.String chief,\r\n\t\t\tjava.lang.String chiefTelephone,\r\n\t\t\tjava.lang.Integer isalliance,\r\n\t\t\tjava.lang.Integer allianceid,\r\n\t\t\tjava.lang.String auditBy,\r\n\t\t\tjava.util.Date auditTime,\r\n\t\t\tjava.lang.String createBy,\r\n\t\t\tjava.util.Date createTime,\r\n\t\t\tjava.lang.String image,\r\n\t\t\tjava.lang.String guidepic,\r\n\t\t\tjava.lang.Integer compLevel,\r\n\t\t\tjava.lang.String tag,\r\n\t\t\tjava.lang.String lng,\r\n\t\t\tjava.lang.String lat,\r\n\t\t\tjava.lang.Integer isoffset,\r\n\t\t\tjava.lang.String sonId,\r\n\t\t\tjava.lang.String content,\r\n\t\t\tjava.lang.String proname,\r\n\t\t\tjava.lang.String normalPrice,\r\n\t\t\tjava.lang.String holddayPrice,\r\n\t\t\tjava.lang.String mtype,\r\n\t\t\tjava.lang.Integer mtrust,\r\n\t\t\tjava.lang.Integer mdevice,\r\n\t\t\tjava.lang.String mcontent,\r\n\t\t\tjava.lang.Integer isact,\r\n\t\t\tjava.lang.String actContent) {\r\n\r\n\t\tsuper(id,\r\n\t\t\t\tname,\r\n\t\t\t\ttypeid,\r\n\t\t\t\trecommand,\r\n\t\t\t\tprovince,\r\n\t\t\t\tcity,\r\n\t\t\t\tcountry,\r\n\t\t\t\tpcode,\r\n\t\t\t\taddress,\r\n\t\t\t\ttelephone,\r\n\t\t\t\tfax,\r\n\t\t\t\tchief,\r\n\t\t\t\tchiefTelephone,\r\n\t\t\t\tisalliance,\r\n\t\t\t\tallianceid,\r\n\t\t\t\tauditBy,\r\n\t\t\t\tauditTime,\r\n\t\t\t\tcreateBy,\r\n\t\t\t\tcreateTime,\r\n\t\t\t\timage,\r\n\t\t\t\tguidepic,\r\n\t\t\t\tcompLevel,\r\n\t\t\t\ttag,\r\n\t\t\t\tlng,\r\n\t\t\t\tlat,\r\n\t\t\t\tisoffset,\r\n\t\t\t\tsonId,\r\n\t\t\t\tcontent,\r\n\t\t\t\tproname,\r\n\t\t\t\tnormalPrice,\r\n\t\t\t\tholddayPrice,\r\n\t\t\t\tmtype,\r\n\t\t\t\tmtrust,\r\n\t\t\t\tmdevice,\r\n\t\t\t\tmcontent,\r\n\t\t\t\tisact,\r\n\t\t\t\tactContent);\r\n\t}", "private void setupCreateCourse() {\n\t\tmakeButton(\"Create Course\", (ActionEvent e) -> {\n\t\t\ttry {\n\t\t\t\tString[] inputs = getInputs(new String[] { \"Name:\", \"Number:\" });\n\t\t\t\tif (inputs == null)\n\t\t\t\t\treturn;\n\n\t\t\t\tint num = Integer.parseInt(inputs[1]);\n\t\t\t\tadCon.createCourse(inputs[0], num);\n\t\t\t\tupdateCourses();\n\t\t\t} catch (NumberFormatException ex) {\n\t\t\t\tJOptionPane.showMessageDialog(getRootPane(), \"Course number must be a number\", \"Error\",\n\t\t\t\t\t\tJOptionPane.OK_OPTION);\n\t\t\t}\n\t\t});\n\t}", "private void setCC(int CC) {\n\t\tCMN.CC = CC;\n\t}" ]
[ "0.60965633", "0.5738031", "0.5635638", "0.55537087", "0.55011183", "0.5496117", "0.5484059", "0.53597647", "0.5340442", "0.53370005", "0.528089", "0.5260604", "0.52299625", "0.51952976", "0.5166351", "0.51395553", "0.5129933", "0.5126283", "0.51121646", "0.51115435", "0.5109972", "0.50963175", "0.5083129", "0.5071379", "0.5061217", "0.5060019", "0.50566334", "0.50484335", "0.5030325", "0.5022812", "0.50182915", "0.50130665", "0.5009844", "0.5009355", "0.4991905", "0.4984951", "0.49824807", "0.4981582", "0.49642947", "0.4963344", "0.49491137", "0.49474812", "0.49339223", "0.49324757", "0.4924155", "0.49202633", "0.4915904", "0.49106094", "0.49076396", "0.4907142", "0.48964986", "0.48929176", "0.48879075", "0.48805127", "0.48730075", "0.48706537", "0.48657125", "0.4864478", "0.48563516", "0.48542848", "0.48455343", "0.4837913", "0.4836897", "0.4833595", "0.48317325", "0.48310855", "0.48310733", "0.4824564", "0.48226932", "0.48212108", "0.4814658", "0.4810289", "0.4800978", "0.4798216", "0.4797338", "0.4791002", "0.47885638", "0.47824377", "0.47750342", "0.4772696", "0.47705877", "0.4765402", "0.47615674", "0.47600335", "0.47540864", "0.47471422", "0.4742447", "0.474158", "0.4739426", "0.4733189", "0.4732772", "0.47321862", "0.47281718", "0.47280788", "0.4724934", "0.47204378", "0.47203174", "0.4711462", "0.47051436", "0.4701214" ]
0.57713234
1
End of variables declaration//GENEND:variables
public static void main(String[] args) { JFrame f = new javax.swing.JFrame(); f.setLayout(new java.awt.FlowLayout()); final CryptCCInfo ccinfo = new CryptCCInfo(); f.getContentPane().add(ccinfo); JButton jb = new javax.swing.JButton(); // jb.addActionListener(new java.awt.event.ActionListener() { // public void actionPerformed(ActionEvent e) { // String s =ccinfo.getValue(); // System.out.println(s); // ccinfo.setValue(s); // } // }); f.getContentPane().add(jb); f.pack(); f.show(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void lavar() {\n\t\t// TODO Auto-generated method stub\n\t\t\n\t}", "public void mo38117a() {\n }", "@Override\r\n\tpublic void initVariables() {\n\t\t\r\n\t}", "private void assignment() {\n\n\t\t\t}", "private void kk12() {\n\n\t}", "public void gored() {\n\t\t\n\t}", "@Override\n public void func_104112_b() {\n \n }", "public void mo21779D() {\n }", "public final void mo51373a() {\n }", "protected boolean func_70041_e_() { return false; }", "public void mo4359a() {\n }", "public void mo21782G() {\n }", "private void m50366E() {\n }", "public void mo12930a() {\n }", "public void mo115190b() {\n }", "public void method_4270() {}", "public void mo1403c() {\n }", "public void mo3376r() {\n }", "public void mo3749d() {\n }", "public void mo21793R() {\n }", "protected boolean func_70814_o() { return true; }", "public void mo21787L() {\n }", "@Override\r\n\tpublic void dispase() {\n\r\n\t}", "public void mo21780E() {\n }", "public void mo21792Q() {\n }", "public void mo21791P() {\n }", "public void mo12628c() {\n }", "@Override\n\tpublic void gravarBd() {\n\t\t\n\t}", "public void mo97908d() {\n }", "public void mo21878t() {\n }", "public void mo9848a() {\n }", "public void mo21825b() {\n }", "public void mo23813b() {\n }", "public void mo3370l() {\n }", "public void mo21879u() {\n }", "@Override\n\tpublic void grabar() {\n\t\t\n\t}", "@Override\n\tpublic void nghe() {\n\n\t}", "@Override\n\tpublic void ligar() {\n\t\t\n\t}", "public void mo21785J() {\n }", "public void mo21795T() {\n }", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "public void m23075a() {\n }", "public void mo21789N() {\n }", "@Override\n\tpublic void einkaufen() {\n\t}", "public void mo21794S() {\n }", "public final void mo12688e_() {\n }", "@Override\r\n\tvoid func04() {\n\t\t\r\n\t}", "private Rekenhulp()\n\t{\n\t}", "public void mo6944a() {\n }", "public static void listing5_14() {\n }", "public void mo1405e() {\n }", "public final void mo91715d() {\n }", "public void mo55254a() {\n }", "@Override\n\tpublic void comer() {\n\t\t\n\t}", "@Override\r\n\tprotected void func03() {\n\t\t\r\n\t}", "public void mo9137b() {\n }", "@Override\n\tpublic void entrenar() {\n\t\t\n\t}", "public void func_70295_k_() {}", "void mo57277b();", "public void mo21877s() {\n }", "@Override\r\n\tpublic void comer() \r\n\t{\n\t\t\r\n\t}", "public void Tyre() {\n\t\t\r\n\t}", "void berechneFlaeche() {\n\t}", "public void mo115188a() {\n }", "public void mo21880v() {\n }", "@Override\n\tpublic void nadar() {\n\t\t\n\t}", "public void mo21784I() {\n }", "private stendhal() {\n\t}", "@Override\r\n\tprotected void doF4() {\n\t\t\r\n\t}", "@Override\n\tpublic void nefesAl() {\n\n\t}", "public void mo56167c() {\n }", "public void mo44053a() {\n }", "public void mo21781F() {\n }", "public void mo2740a() {\n }", "public void mo21783H() {\n }", "public void mo1531a() {\n }", "double defendre();", "private zzfl$zzg$zzc() {\n void var3_1;\n void var2_-1;\n void var1_-1;\n this.value = var3_1;\n }", "public void stg() {\n\n\t}", "void m1864a() {\r\n }", "private void poetries() {\n\n\t}", "public void skystonePos4() {\n }", "public void mo2471e() {\n }", "@Override\n\tprotected void getExras() {\n\n\t}", "private void yy() {\n\n\t}", "@Override\n\tpublic void verkaufen() {\n\t}", "@AnyLogicInternalCodegenAPI\n private void setupPlainVariables_Main_xjal() {\n }", "static void feladat4() {\n\t}", "@Override\n\tpublic void emprestimo() {\n\n\t}", "@Override\r\n\t\t\tpublic void func02() {\n\t\t\t\t\r\n\t\t\t}", "public void init() { \r\n\t\t// TODO Auto-generated method\r\n\t }", "public void furyo ()\t{\n }", "public void verliesLeven() {\r\n\t\t\r\n\t}", "@Override\r\n\tpublic void stehReagieren() {\r\n\t\t//\r\n\t}", "protected void mo6255a() {\n }" ]
[ "0.6359434", "0.6280371", "0.61868024", "0.6094568", "0.60925734", "0.6071678", "0.6052686", "0.60522056", "0.6003249", "0.59887564", "0.59705925", "0.59680873", "0.5967989", "0.5965816", "0.5962006", "0.5942372", "0.5909877", "0.5896588", "0.5891321", "0.5882983", "0.58814824", "0.5854075", "0.5851759", "0.58514243", "0.58418584", "0.58395296", "0.5835063", "0.582234", "0.58090156", "0.5802706", "0.5793836", "0.57862717", "0.5784062", "0.5783567", "0.5782131", "0.57758564", "0.5762871", "0.5759349", "0.5745087", "0.57427835", "0.573309", "0.573309", "0.573309", "0.573309", "0.573309", "0.573309", "0.573309", "0.57326084", "0.57301426", "0.57266665", "0.57229686", "0.57175463", "0.5705802", "0.5698347", "0.5697827", "0.569054", "0.5689405", "0.5686434", "0.56738997", "0.5662217", "0.56531453", "0.5645255", "0.5644223", "0.5642628", "0.5642476", "0.5640595", "0.56317437", "0.56294966", "0.56289655", "0.56220204", "0.56180173", "0.56134313", "0.5611337", "0.56112075", "0.56058615", "0.5604383", "0.5602629", "0.56002104", "0.5591573", "0.55856615", "0.5576992", "0.55707216", "0.5569681", "0.55570376", "0.55531484", "0.5551123", "0.5550893", "0.55482954", "0.5547471", "0.55469507", "0.5545719", "0.5543553", "0.55424106", "0.5542057", "0.55410767", "0.5537739", "0.55269134", "0.55236584", "0.55170715", "0.55035424", "0.55020875" ]
0.0
-1
retry handler > attempts request 5 times
public static HttpRequestRetryHandler getRetryHandler(final String... details) throws JSONException { return new HttpRequestRetryHandler() { @Override public boolean retryRequest(IOException exception, int executionCount, HttpContext httpContext) { LOGGER.info("Request Execution no: " + executionCount); // System.out.println("Request Execution no: "+executionCount); if (executionCount >= 5) { LOGGER.info("Aborting Request retry using Job Schedular"); System.out.println(details); return false; } LOGGER.info("Retrying request..."); // System.out.println("Retrying request..."); return true; } }; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "void doRetry();", "public int getRequestRetryCount() {\n \t\treturn 1;\n \t}", "@Override\n public void onRetry(int retryNo) {\n }", "public DefaultHttpRequestRetryHandler() {\n this(3);\n }", "public void onTryFails(int currentRetryCount, Exception e) {}", "protected short maxRetries() { return 15; }", "@Override\n public void onRetry ( int retryNo){\n }", "@Override\n public void onRetry ( int retryNo){\n }", "@Override\n public void onRetry ( int retryNo){\n }", "@Override\r\n public void onRetry(int retryNo) {\n }", "@Override\r\n public void onRetry(int retryNo) {\n }", "@Override\r\n public void onRetry(int retryNo) {\n }", "@Override\r\n public void onRetry(int retryNo) {\n }", "@Override\r\n public void onRetry(int retryNo) {\n }", "public int retry() {\r\n\t\treturn ++retryCount;\r\n\t}", "@Override\n public void onRetry(int retryNo) {\n }", "@Override\n public void onRetry(int retryNo) {\n }", "@Override\n public void onRetry(int retryNo) {\n }", "@Override\n public void onRetry(int retryNo) {\n }", "@Override\n public void onRetry(int retryNo) {\n }", "@Override\n public void onRetry(int retryNo) {\n }", "@Override\n public void onRetry(int retryNo) {\n }", "@Override\n public void onRetry(int retryNo) {\n }", "@Override\n public void onRetry(int retryNo) {\n }", "@Override\n public void onRetry(HttpRequest req, String reason) {\n\n }", "public abstract long retryAfter();", "int getRetries();", "@Around(\"execution(public void edu.sjsu.cmpe275.aop.TweetService.*(..))\")\n public Object retryAdvice(ProceedingJoinPoint joinPoint) throws Throwable {\n IOException exception = null;\n boolean retry = false;\n for (int i = 1; i <= 4; i++) {\n if (retry) {\n System.out.println(\"Network Error: Retry #\" + (i - 1));\n }\n try {\n// System.out.println(\"proceed !!! - \" + i);\n return joinPoint.proceed();\n } catch (IOException e) {\n System.out.println(\"Network Exception!!\");\n exception = e;\n retry = true;\n }\n }\n return joinPoint;\n }", "void retry(Task task);", "protected int retryLimit() {\n return DEFAULT_RETRIES;\n }", "@Override\n\t\tpublic boolean retryRequest(IOException exception, int executionCount, HttpContext context) {\n\t\t\tif (executionCount >= MAX_REQUEST_RETRY_COUNTS) {\n\t\t\t\t// Do not retry if over max retry count\n\t\t\t\treturn false;\n\t\t\t}\n\t\t\tif (exception instanceof NoHttpResponseException) {\n\t\t\t\t// Retry if the server dropped connection on us\n\t\t\t\treturn true;\n\t\t\t}\n\t\t\tif (exception instanceof SSLHandshakeException) {\n\t\t\t\t// Do not retry on SSL handshake exception\n\t\t\t\treturn false;\n\t\t\t}\n\n\t\t\tHttpRequest request = (HttpRequest) context.getAttribute(ExecutionContext.HTTP_REQUEST);\n\t\t\tboolean idempotent = (request instanceof HttpEntityEnclosingRequest);\n\t\t\tif (!idempotent) {\n\t\t\t\t// Retry if the request is considered idempotent\n\t\t\t\treturn true;\n\t\t\t}\n\t\t\treturn false;\n\n\t\t}", "public void incrementRetryCount() {\n this.retryCount++;\n }", "void sendRetryMessage(int retryNo);", "@Override\n\t\tpublic boolean isRetry() { return true; }", "private void retry() {\n if (catalog == null) {\n if (--retries < 0) {\n inactive = true;\n pendingRequests.clear();\n log.error(\"Maximum retries exceeded while attempting to load catalog for endpoint \" + discoveryEndpoint\n + \".\\nThis service will be unavailabe.\");\n } else {\n try {\n sleep(RETRY_INTERVAL * 1000);\n _loadCatalog();\n } catch (InterruptedException e) {\n log.warn(\"Thread for loading CDS Hooks catalog for \" + discoveryEndpoint + \"has been interrupted\"\n + \".\\nThis service will be unavailable.\");\n }\n }\n }\n }", "boolean allowRetry(int retry, long startTimeOfExecution);", "public void testHttpFailureRetries() {\n delayTestFinish(RUNASYNC_TIMEOUT);\n runAsync1(0);\n }", "public void retryRequired(){\n startFetching(query);\n }", "@Override\n\t\tpublic boolean isRetry() { return false; }", "@Override\n public void onRetry(int retryNo) {\n super.onRetry(retryNo);\n // 返回重试次数\n }", "public boolean retry() {\n return tries++ < MAX_TRY;\n }", "private void retryTask(HttpServletResponse resp) {\n resp.setStatus(500);\n }", "@Test\n public void shouldReturnTotalNumberOfRequestsAs5OnlyFailsChecked() throws IOException {\n\n HelloWorldService helloWorldService = mock(HelloWorldService.class);\n\n Retry retry = Retry.of(\"metrics\", RetryConfig.<String>custom()\n .retryExceptions(Exception.class)\n .maxAttempts(5)\n .failAfterMaxAttempts(true)\n .build());\n\n willThrow(new HelloWorldException()).given(helloWorldService).returnHelloWorldWithException();\n\n Callable<String> retryableCallable = Retry.decorateCallable(retry, helloWorldService::returnHelloWorldWithException);\n\n Try<Void> run = Try.run(retryableCallable::call);\n\n assertThat(retry.getMetrics().getNumberOfTotalCalls()).isEqualTo(5);\n assertThat(run.isFailure()).isTrue();\n }", "void onRetryAuthentication();", "int getSleepBeforeRetry();", "@Override\n\tpublic void onRepeatRequest(HttpRequest request,int requestId, int count) {\n\t\t\n\t}", "public void setSocketRetries(int retries);", "boolean doRetry() {\n synchronized (mHandler) {\n boolean doRetry = currentRetry < MAX_RETRIES;\n boolean futureSync = mHandler.hasMessages(0);\n\n if (doRetry && !futureSync) {\n currentRetry++;\n mHandler.postDelayed(getNewRunnable(), currentRetry * 15_000);\n }\n\n return mHandler.hasMessages(0);\n }\n }", "@Override\n void setRetry() {\n if (mNextReqTime > 32 * 60 * 1000 || mController.isStop()) {\n if (DEBUG)\n Log.d(TAG, \"################ setRetry timeout, cancel retry : \" + mController.isStop());\n cancelRetry();\n return;\n }\n if (mCurRetryState == RetryState.IDLE) {\n mCurRetryState = RetryState.RUNNING;\n if (mReceiver == null) {\n IntentFilter filter = new IntentFilter(INTENT_ACTION_RETRY);\n mReceiver = new stateReceiver();\n mContext.registerReceiver(mReceiver, filter);\n }\n\n }\n Intent intent = new Intent(INTENT_ACTION_RETRY);\n PendingIntent sender = PendingIntent.getBroadcast(mContext, 0, intent, PendingIntent.FLAG_CANCEL_CURRENT);\n long nextReq = SystemClock.elapsedRealtime() + mNextReqTime;\n Calendar cal = Calendar.getInstance();\n cal.setTimeInMillis(nextReq);\n if(DEBUG) Log.i(TAG, \"start to get location after: \" + mNextReqTime + \"ms\");\n mAlarmMgr.set(AlarmManager.ELAPSED_REALTIME_WAKEUP, nextReq, sender);\n mNextReqTime = mNextReqTime * 2;\n }", "@Test\n public void shouldReturnTotalNumberOfRequestsAs5OnlyFails() {\n\n HelloWorldService helloWorldService = mock(HelloWorldService.class);\n\n Retry retry = Retry.of(\"metrics\", RetryConfig.<String>custom()\n .retryExceptions(Exception.class)\n .maxAttempts(5)\n .failAfterMaxAttempts(true)\n .build());\n\n given(helloWorldService.returnHelloWorld())\n .willThrow(new HelloWorldException());\n\n Try<String> supplier = Try.ofSupplier(Retry.decorateSupplier(retry, helloWorldService::returnHelloWorld));\n\n assertThat(retry.getMetrics().getNumberOfTotalCalls()).isEqualTo(5);\n assertThat(supplier.isFailure()).isTrue();\n }", "@Override\n public void onErrorResponse(VolleyError error) {\n getRandom(); //repeating call here might automatically make it happen B/C success rate of this call is roughly 50/50\n }", "@Override\npublic boolean retry(ITestResult result) {\n\tif(minretryCount<=maxretryCount){\n\t\t\n\t\tSystem.out.println(\"Following test is failing====\"+result.getName());\n\t\t\n\t\tSystem.out.println(\"Retrying the test Count is=== \"+ (minretryCount+1));\n\t\t\n\t\t//increment counter each time by 1  \n\t\tminretryCount++;\n\n\t\treturn true;\n\t}\n\treturn false;\n}", "public void setRecoveryRetries(int retries);", "protected abstract void onMaxAttempts(final Exception exception);", "public boolean shouldRetry(com.amazonaws.AmazonWebServiceRequest r5, com.amazonaws.AmazonClientException r6, int r7) {\n /*\n r4 = this;\n r2 = 1\n java.lang.Throwable r3 = r6.getCause()\n boolean r3 = r3 instanceof java.io.IOException\n if (r3 == 0) goto L_0x0012\n java.lang.Throwable r3 = r6.getCause()\n boolean r3 = r3 instanceof java.io.InterruptedIOException\n if (r3 != 0) goto L_0x0012\n L_0x0011:\n return r2\n L_0x0012:\n boolean r3 = r6 instanceof com.amazonaws.AmazonServiceException\n if (r3 == 0) goto L_0x0039\n r0 = r6\n com.amazonaws.AmazonServiceException r0 = (com.amazonaws.AmazonServiceException) r0\n int r1 = r0.getStatusCode()\n r3 = 500(0x1f4, float:7.0E-43)\n if (r1 == r3) goto L_0x0011\n r3 = 503(0x1f7, float:7.05E-43)\n if (r1 == r3) goto L_0x0011\n r3 = 502(0x1f6, float:7.03E-43)\n if (r1 == r3) goto L_0x0011\n r3 = 504(0x1f8, float:7.06E-43)\n if (r1 == r3) goto L_0x0011\n boolean r3 = com.amazonaws.retry.RetryUtils.isThrottlingException(r0)\n if (r3 != 0) goto L_0x0011\n boolean r3 = com.amazonaws.retry.RetryUtils.isClockSkewError(r0)\n if (r3 != 0) goto L_0x0011\n L_0x0039:\n r2 = 0\n goto L_0x0011\n */\n throw new UnsupportedOperationException(\"Method not decompiled: com.amazonaws.retry.PredefinedRetryPolicies.SDKDefaultRetryCondition.shouldRetry(com.amazonaws.AmazonWebServiceRequest, com.amazonaws.AmazonClientException, int):boolean\");\n }", "@Override\n protected boolean isResponseStatusToRetry(Response response)\n {\n return response.getStatus() / 4 != 100;\n }", "public void addRequestRetry() throws JNCException {\n setLeafValue(Epc.NAMESPACE,\n \"request-retry\",\n null,\n childrenNames());\n }", "private void increaseAttempts() {\n attempts++;\n }", "public DefaultHttpRequestRetryHandler(final int retryCount) {\n this(retryCount,\n InterruptedIOException.class,\n UnknownHostException.class,\n ConnectException.class,\n ConnectionClosedException.class,\n SSLException.class);\n }", "private void checkRetries(final int counter) throws InterruptedException {\n\t\tif (counter > retries) {\n\t\t\tthrow new IllegalStateException(\"Remote server did not started correctly\");\n\t\t}\n\t\tThread.sleep(2000);\n\t}", "private void waitToRetry()\n {\n final int sleepTime = 2000000;\n\n if (keepTrying)\n {\n try\n {\n Thread.sleep(sleepTime);\n }\n catch (Exception error)\n {\n log.error(\"Ignored exception from sleep - probably ok\", error);\n }\n }\n }", "public static void repeatSome() {\n ComposableFutures.repeat(5, \"initial value\", ComposableFuturesHelpers::someIo);\n\n // .retry(times, [optional timeout], action) will retry your async operation N times, and will\n // stop on first successful returned value\n ComposableFutures.retry(5, ComposableFuturesHelpers::randomIo);\n }", "public void sleepUntilNextRetry() throws InterruptedException {\n\t\tint attempts = getAttemptTimes();\n\t\tlong sleepTime = (long) (retryIntervalMillis * Math.pow(2, attempts));\n\t\tLOG.info(\"Sleeping \" + sleepTime + \"ms before retry #\" + attempts\n\t\t\t\t+ \"...\");\n\t\ttimeUnit.sleep(sleepTime);\n\t}", "public void dispatchRetry(BitmapHunter bitmapHunter) {\n this.handler.sendMessageDelayed(this.handler.obtainMessage(5, bitmapHunter), 500);\n }", "private void updateRetries(int tries) {\n synchronized(this) {\n maxNum = maxNum < tries ? tries : maxNum;\n minNum = minNum < tries ? minNum : tries;\n }\n if (tries > 0 && Utils.VERBOSE) {\n System.err.println(\"Retries this round: \" + tries);\n }\n }", "void requestRateLimited();", "public boolean retry(ITestResult result) {\n\t\tif (counter < retryMaxLimit) {\n\t\t\tcounter++;\n\t\t\treturn true;\n\t\t}\n\t\treturn false;\n\t}", "@Test\n\tpublic void testRetryTheSuccess() {\n\t\tgenerateValidRequestMock();\n\t\tworker = PowerMockito.spy(new HttpRepublisherWorker(dummyPublisher, actionedRequest));\n\t\tWhitebox.setInternalState(worker, CloseableHttpClient.class, httpClientMock);\n\t\ttry {\n\t\t\twhen(httpClientMock.execute(any(HttpRequestBase.class), any(ResponseHandler.class)))\n\t\t\t\t\t.thenThrow(new IOException(\"Exception to retry on\")).thenReturn(mockResponse);\n\n\t\t} catch (IOException e) {\n\t\t\tfail(\"Should not reach here!\");\n\t\t}\n\t\tworker.run();\n\t\t// verify should attempt to calls\n\t\ttry {\n\t\t\tverify(httpClientMock, times(2)).execute(any(HttpRequestBase.class), any(ResponseHandler.class));\n\t\t\tassertEquals(RequestState.SUCCESS, actionedRequest.getAction());\n\t\t} catch (ClientProtocolException e) {\n\t\t\tfail(\"Should not throw this exception\");\n\t\t} catch (IOException e) {\n\t\t\tfail(\"Should not throw this exception\");\n\t\t}\n\t}", "@Override\n public void onRetry(int retryNo) {\n Log.d(\"AsyncAndro\", \"AsyncAndroid retryNo:\" + retryNo);\n }", "@Override\n public void onRetry(int retryNo) {\n Log.d(\"AsyncAndro\", \"AsyncAndroid retryNo:\" + retryNo);\n }", "@Override\n public void onRetry(int retryNo) {\n Log.d(\"AsyncAndro\", \"AsyncAndroid retryNo:\" + retryNo);\n }", "private boolean handleHttpRequests(int[] timeInterval) {\n //generate 3 random data\n int userId1 = ThreadLocalRandom.current().nextInt(POPULATION);\n int userId2 = ThreadLocalRandom.current().nextInt(POPULATION);\n int userId3 = ThreadLocalRandom.current().nextInt(POPULATION);\n\n int timeInterval1 = ThreadLocalRandom.current().nextInt(timeInterval[1] - timeInterval[0]+1) + timeInterval[0];\n int timeInterval2 = ThreadLocalRandom.current().nextInt(timeInterval[1] - timeInterval[0]+1) + timeInterval[0];\n int timeInterval3 = ThreadLocalRandom.current().nextInt(timeInterval[1] - timeInterval[0]+1) + timeInterval[0];\n int stepCount1 = ThreadLocalRandom.current().nextInt(5000);\n int stepCount2 = ThreadLocalRandom.current().nextInt(5000);\n int stepCount3 = ThreadLocalRandom.current().nextInt(5000);\n\n try {\n long startTime = System.currentTimeMillis();\n Response response = postUserData(userId1,DAY_NUM,timeInterval1,stepCount1);\n countResponse(startTime,response);\n\n startTime = System.currentTimeMillis();\n response = postUserData(userId2,DAY_NUM,timeInterval2,stepCount2);\n countResponse(startTime,response);\n\n startTime = System.currentTimeMillis();\n response = getCurrentUserData(userId1);\n countResponse(startTime,response);\n\n startTime = System.currentTimeMillis();\n response = getSingleUserData(userId1, DAY_NUM);\n countResponse(startTime,response);\n\n startTime = System.currentTimeMillis();\n response = postUserData(userId3,DAY_NUM,timeInterval3,stepCount3);\n countResponse(startTime,response);\n\n } catch (Exception e) {\n // System.out.println(\"Exception in Post1: \" + e.getClass().getSimpleName());\n System.out.println(e.getMessage() + \"\\n\" + e.getCause());\n return false;\n }\n\n printer.numOfRequestsSent(5);\n return true;\n }", "private Document getPageWithRetries(URL url) throws IOException {\n Document doc;\n int retries = 3;\n while (true) {\n sendUpdate(STATUS.LOADING_RESOURCE, url.toExternalForm());\n LOGGER.info(\"Retrieving \" + url);\n doc = Http.url(url)\n .referrer(this.url)\n .cookies(cookies)\n .get();\n if (doc.toString().contains(\"IP address will be automatically banned\")) {\n if (retries == 0) {\n throw new IOException(\"Hit rate limit and maximum number of retries, giving up\");\n }\n LOGGER.warn(\"Hit rate limit while loading \" + url + \", sleeping for \" + IP_BLOCK_SLEEP_TIME + \"ms, \" + retries + \" retries remaining\");\n retries--;\n try {\n Thread.sleep(IP_BLOCK_SLEEP_TIME);\n } catch (InterruptedException e) {\n throw new IOException(\"Interrupted while waiting for rate limit to subside\");\n }\n }\n else {\n return doc;\n }\n }\n }", "public int getRecoveryRetries();", "@Test\n public void testCanRetry() {\n assertEquals(0, rc.getAttempts());\n assertTrue(rc.attempt());\n assertEquals(1, rc.getAttempts());\n assertTrue(rc.attempt());\n assertEquals(2, rc.getAttempts());\n assertTrue(rc.attempt());\n assertEquals(3, rc.getAttempts());\n assertFalse(rc.attempt());\n assertEquals(3, rc.getAttempts());\n assertFalse(rc.attempt());\n assertEquals(3, rc.getAttempts());\n assertFalse(rc.attempt());\n assertEquals(3, rc.getAttempts());\n }", "public void retrySending()\n {\n try\n {\n EmailConfig emailConfig = getEmailConfig();\n int maxRetries = emailConfig.getMaxRetries().intValue();\n boolean saveFailedMails = emailConfig.getSaveFailedEmails();\n List messageFileList = getMessagesInFolder(IEmailConfiguration.EMAIL_RETRY_PATH);\n \n if (maxRetries > 0 && messageFileList.size()>0)\n {\n Session session = getMailSession(true);\n for (Iterator i = messageFileList.iterator(); i.hasNext();)\n {\n resendMail(session, (File)i.next(), maxRetries, saveFailedMails);\n }\n }\n }\n catch (Throwable th)\n {\n AlertLogger.warnLog(CLASSNAME,\"retrySending\",\"Error in retrySending\",th);\n }\n }", "public _cls_cs_retries0() {\r\n}", "@Override\n\tpublic boolean retry(ITestResult result) \n\t{\n\t\treturn false;\n\t}", "public void resetTries() {\n this.tries = 0;\n }", "public ExecuteResult<T> doRetry() throws SQLException {\n int tries = 0;\n SQLException sqle = null;\n while (tries < RETRY_LIMIT) {\n try {\n return execute();\n } catch (SQLException e) {\n if (retryException(e)) {\n sqle = e;\n tries++;\n ZmailLog.dbconn.warn(\"retrying connection attempt:\"+tries+\" due to possibly recoverable exception: \",e);\n incrementTotalRetries();\n try {\n Thread.sleep(RETRY_DELAY);\n } catch (InterruptedException ie) {\n }\n } else {\n throw e;\n }\n }\n }\n throw new SQLException(\"DB retry gave up after \"+tries+\" attempts.\",sqle);\n }", "public boolean isRetry();", "private void sendCancelRpcCall(int numberRetries) {\n\t}", "public void onFailure(Throwable caught) {\n if (attempt > 20) {\n fail();\n }\n \n int token = getToken();\n log(\"onFailure: attempt = \" + attempt + \", token = \" + token\n + \", caught = \" + caught);\n new Timer() {\n @Override\n public void run() {\n runAsync1(attempt + 1);\n }\n }.schedule(100);\n }", "private static void checkTimeoutAndRetry() {\n while (true) {\n for (ServerAckWindow window : windowsMap.values()) {\n window.responseCollectorMap.entrySet().stream()\n .filter(entry -> window.timeout(entry.getValue()))\n .forEach(entry -> window.retry(entry.getKey(), entry.getValue()));\n }\n }\n }", "public boolean isAllowPartialRetryRequests() {\n\t\treturn false;\n\t}", "private void waitBeforeNextConnectAttempt(final int attempts) {\n\t\tfinal String METHOD = \"waitBeforeNextConnectAttempt\";\n\t\t// Log when throttle boundaries are reached\n\t\tif (attempts == THROTTLE_3) {\n\t\t\tLoggerUtility.warn(CLASS_NAME, METHOD, String.valueOf(attempts) + \n\t\t\t\t\t\" consecutive failed attempts to connect. Retry delay increased to \" + String.valueOf(RATE_3) + \"ms\");\n\t\t}\n\t\telse if (attempts == THROTTLE_2) {\n\t\t\tLoggerUtility.warn(CLASS_NAME, METHOD, String.valueOf(attempts) + \n\t\t\t\t\t\" consecutive failed attempts to connect. Retry delay increased to \" + String.valueOf(RATE_2) + \"ms\");\n\t\t}\n\t\telse if (attempts == THROTTLE_1) {\n\t\t\tLoggerUtility.info(CLASS_NAME, METHOD, String.valueOf(attempts) + \n\t\t\t\t\t\" consecutive failed attempts to connect. Retry delay set to \" + String.valueOf(RATE_1) + \"ms\");\n\t\t}\n\n\t\ttry {\n\t\t\tlong delay = RATE_0;\n\t\t\tif (attempts >= THROTTLE_3) {\n\t\t\t\tdelay = RATE_3;\n\t\t\t} else if (attempts >= THROTTLE_2) {\n\t\t\t\tdelay = RATE_2;\n\t\t\t} else if (attempts >= THROTTLE_1) {\n\t\t\t\tdelay = RATE_1;\n\t\t\t}\n\t\t\tThread.sleep(delay);\n\t\t} catch (InterruptedException e) {\n\t\t\te.printStackTrace();\n\t\t}\n\t}", "Mono<ShouldRetryResult> shouldRetry(Exception e);", "public void markRequestRetryReplace() throws JNCException {\n markLeafReplace(\"requestRetry\");\n }", "@IntRange(from = 0L) long interval(int retryCount, long elapsedTime);", "@Test\n public void testRetry() throws Exception {\n factory.setSecondsToWait(5L);\n CountDownLatch oneWorkerCreated = factory.getRunCountLatch(1);\n CountDownLatch secondWorkerCreated = factory.getRunCountLatch(2);\n LogFile logFile = tracker.open(\"foo\", \"/biz/baz/%s.log\", DateTime.now());\n manager.start(); //start manager first so it can register to receive notifications\n tracker.written(logFile);\n awaitLatch(oneWorkerCreated);\n logFile.setState(LogFileState.PREP_ERROR); //simulate failure of first prep attempt\n awaitLatch(secondWorkerCreated); //wait for retry\n }", "public String fallBack4Retry(Throwable e) {\n\t\t\tString resp = e.getMessage();\n\t\t\tlog.info(\"RESP>>\"+e.getClass().getName()+\":\"+e.getMessage());\n\t\t\ttry {\n\t\t\t\t//resp = callEOV();\n\t\t\t} catch (Exception e1) {\n\t\t\t\tresp=\"Even after retry we got issue:\"+e1.getMessage();\n\t\t\t\tlog.info(resp);\n\t\t\t}\n\t\t\treturn resp;\n\t}", "public interface OnRetryListener {\n void onRetry();\n}", "@Override\n\tpublic boolean retry(ITestResult result) {\n\n if (!result.isSuccess()) { //Check if test not succeed\n if (count < maxTry) { //Check if maxtry count is reached\n count++; //Increase the maxTry count by 1\n System.out.println(\"is this working?\"); \n result.setStatus(ITestResult.FAILURE); //Mark test as failed\n return true; //Tells TestNG to re-run the test\n } else {\n result.setStatus(ITestResult.FAILURE); //If maxCount reached,test marked as failed\n }\n }\n else {\n result.setStatus(ITestResult.SUCCESS); //If test passes, TestNG marks it as passed\n }\n return false;\n\t}", "public interface RetryCallback {\n void retry();\n}", "public boolean retry(ITestResult result) {\n //You could mentioned maxRetryCnt (Maximiun Retry Count) as per your requirement. Here I took 2, If any failed testcases then it runs two times\n int maxRetryCnt = 1;\n if (retryCnt < maxRetryCnt) {\n System.out.println(\"Retrying \" + result.getName() + \" again and the count is \" + (retryCnt+1));\n retryCnt++;\n return true;\n }\n return false;\n }", "Integer totalRetryAttempts();", "public void setRetryCount( int retries ) {\n numberRetries = retries;\n }", "int getTries();", "private void resendWorkaround() {\r\n synchronized(waiters) {\r\n if(waiters.size() > 0 && lastResponseNumber == responseNumber && System.currentTimeMillis() - lastProcessedMillis > 450) {\r\n // Resend last request(s)\r\n for(Integer i : waiters.keySet()) {\r\n System.err.println(Thread.currentThread() + \": Resending: $\" + i + \"-\" + waiters.get(i));\r\n writer.println(\"$\" + i + \"-\" + waiters.get(i));\r\n writer.flush();\r\n lastProcessedMillis = System.currentTimeMillis();\r\n }\r\n }\r\n }\r\n }", "private void backoff(int retries) {\n try {\n sleep(SECONDS.toMillis((long) (getBasicBackoffTimeInSeconds() * pow(2, retries - 1))));\n } catch (InterruptedException e) {\n // continue\n }\n }" ]
[ "0.71369433", "0.6977609", "0.6947168", "0.69419503", "0.6908254", "0.68581015", "0.6839008", "0.6839008", "0.6839008", "0.6817924", "0.67930454", "0.67505157", "0.67505157", "0.67505157", "0.6722569", "0.6711378", "0.6711378", "0.6711378", "0.6711378", "0.6711378", "0.6711378", "0.6711378", "0.6711378", "0.6711378", "0.6627886", "0.6582843", "0.64994717", "0.64932406", "0.6462018", "0.642728", "0.6412367", "0.639932", "0.6371875", "0.63576776", "0.6256841", "0.6255876", "0.6249292", "0.62293893", "0.6206338", "0.61721563", "0.6168805", "0.61356056", "0.6116232", "0.6114281", "0.6067547", "0.60254955", "0.6016626", "0.6008928", "0.59932405", "0.599179", "0.5960716", "0.5949657", "0.59475416", "0.5933772", "0.592898", "0.592643", "0.5907315", "0.58802396", "0.5860125", "0.5857148", "0.5822998", "0.58106947", "0.57929164", "0.5787482", "0.5772419", "0.5742052", "0.57388437", "0.5716671", "0.5703967", "0.5703967", "0.5703967", "0.5703051", "0.5693399", "0.5682386", "0.5672253", "0.5665914", "0.56643504", "0.56598336", "0.5626087", "0.5618231", "0.5611659", "0.5611317", "0.5562691", "0.55540574", "0.55391514", "0.55358285", "0.553163", "0.55277914", "0.55237454", "0.55220973", "0.5498396", "0.5497623", "0.5493484", "0.5492628", "0.54923624", "0.5476798", "0.5472002", "0.5467142", "0.54653716", "0.5461557" ]
0.62955004
34
constructor to create remote object
protected MVC_model() throws RemoteException { super(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public CreateRemoteClassic<Msg, Ref> create();", "public GXWebObjectBase(int remoteHandle, ModelContext context)\n\t{\n\t\tsuper(remoteHandle, context);\n\t\tcastHttpContext();\n\t}", "protected abstract CreateRemoteClassic<Msg, Ref> make_create();", "public LocalObject() {}", "StatefulRemoteObjectB create() throws RemoteException, CreateException;", "Network_Resource createNetwork_Resource();", "public ProxyableObject()\r\n {\r\n id = new command.GlobalObjectId();\r\n command.ObjectDB.getSingleton().store(id.getLocalObjectId(), this);\r\n \r\n //observable = new ObservabilityObject();\r\n }", "public CMObject newInstance();", "public LiveRef(ObjID paramObjID, int paramInt, RMIClientSocketFactory paramRMIClientSocketFactory, RMIServerSocketFactory paramRMIServerSocketFactory) {\n/* 103 */ this(paramObjID, TCPEndpoint.getLocalEndpoint(paramInt, paramRMIClientSocketFactory, paramRMIServerSocketFactory), true);\n/* */ }", "protected RemoteServer(RemoteRef ref) {\n super(ref);\n }", "public SharedObject() {}", "ObjectResource createObjectResource();", "public ObjectFactory() {}", "public ObjectFactory() {}", "public ObjectFactory() {}", "OBJECT createOBJECT();", "protected static RestConnection createConfig(Resource target, String remotePath) {\n\t\t RestConnection conn = target.addDecorator(\"remote\", RestConnection.class);\n conn.remotePath().create();\n conn.remotePath().setValue(baseUrl + \"/\" + remotePath);\n conn.remoteUser().<StringResource> create().setValue(\"rest\");\n conn.remotePw().<StringResource> create().setValue(\"rest\");\n// conn.activate(true); // don't do this -> triggers execution in the app itself, which is not desired in these tests\n return conn;\n\t}", "Object create(Object source);", "public WebSocketRPC() {\n\t}", "Communicator createCommunicator();", "<T> T newInstance(URI description) throws EnvironmentException;", "public MdrCreater()\n {\n super();\n client = new RawCdrAccess();\n }", "public void create(){}", "public CreateRemoteClassic<Msg, Ref> infraCreate();", "public RubyObject createObject() {\n\t\treturn (RubyObject) RGSSProjectHelper.getInterpreter(project).runScriptlet(\"return RPG::Troop::Page.new\");\n\t}", "public ObjectFactory() {\n\t}", "public LiveRef(ObjID paramObjID, int paramInt) {\n/* 93 */ this(paramObjID, TCPEndpoint.getLocalEndpoint(paramInt), true);\n/* */ }", "RemoteUserManager() { }", "public ObjectFactory() {\r\n\t}", "public void newHost(Host aHost);", "public LiveRef(int paramInt, RMIClientSocketFactory paramRMIClientSocketFactory, RMIServerSocketFactory paramRMIServerSocketFactory) {\n/* 85 */ this(new ObjID(), paramInt, paramRMIClientSocketFactory, paramRMIServerSocketFactory);\n/* */ }", "Instance createInstance();", "public TurnoVOClient() {\r\n }", "public HttpConnector(JsonSystem system) {\r\n super(system);\r\n }", "public Factory() {\n this(getInternalClient());\n }", "private void handleCreateCommand() throws IOException,\r\n ClassNotFoundException,\r\n InstantiationException,\r\n IllegalAccessException {\r\n final String className = (String) m_in.readObject();\r\n Class klass = Class.forName(className, false, m_loader);\r\n final Object instance = klass.newInstance();\r\n final String handle = RemoteProxy.wrapInstance(instance);\r\n m_out.writeObject(handle);\r\n m_out.flush();\r\n }", "Resource createResource();", "private ApiUrlCreator() {\n }", "protected MyRemoteImp1() throws RemoteException {\n }", "public ReplicationObject() {\n }", "public Client() {}", "public ObjectFactory() {\n }", "public ObjectFactory() {\n }", "public ObjectFactory() {\n }", "public ObjectFactory() {\n }", "public ObjectFactory() {\n }", "public ObjectFactory() {\n }", "public ObjectFactory() {\n }", "public ObjectFactory() {\n }", "public ObjectFactory() {\n }", "public ObjectFactory() {\n }", "public ObjectFactory() {\n }", "public ObjectFactory() {\n }", "public ObjectFactory() {\n }", "public ObjectFactory() {\n }", "public ObjectFactory() {\n }", "public ObjectFactory() {\n }", "public ObjectFactory() {\n }", "public ObjectFactory() {\n }", "public ObjectFactory() {\n }", "public ObjectFactory() {\n }", "public ObjectFactory() {\n }", "public ObjectFactory() {\n }", "public ObjectFactory() {\n }", "public ObjectFactory() {\n }", "public ObjectFactory() {\n }", "public ObjectFactory() {\n }", "public ObjectFactory() {\n }", "public ObjectFactory() {\n }", "public ObjectFactory() {\n }", "public ObjectFactory() {\n }", "public ObjectFactory() {\n }", "public ObjectFactory() {\n }", "public ObjectFactory() {\n }", "public ObjectFactory() {\n }", "public ObjectFactory() {\n }", "public ObjectFactory() {\n }", "public ObjectFactory() {\n }", "public ObjectFactory() {\n }", "public ObjectFactory() {\n }", "public ObjectFactory() {\n }", "public ObjectFactory() {\n }", "public ObjectFactory() {\n }", "public ObjectFactory() {\n }", "public ObjectFactory() {\n }", "public ObjectFactory() {\n }", "public ObjectFactory() {\n }", "public ObjectFactory() {\n }", "public ObjectFactory() {\n }", "public ObjectFactory() {\n }", "public ObjectFactory() {\n }", "public ObjectFactory() {\n }", "public ObjectFactory() {\n }", "public ObjectFactory() {\n }", "public ObjectFactory() {\n }", "public ObjectFactory() {\n }", "public ObjectFactory() {\n }", "public ObjectFactory() {\n }", "public ObjectFactory() {\n }", "public ObjectFactory() {\n }", "public ObjectFactory() {\n }" ]
[ "0.6873003", "0.6446098", "0.6423014", "0.63657415", "0.6254997", "0.6208979", "0.6157102", "0.6147803", "0.60231715", "0.6016782", "0.5984253", "0.5978706", "0.5939834", "0.5939834", "0.5939834", "0.5935202", "0.5922992", "0.5910223", "0.5887032", "0.5848115", "0.583442", "0.5820892", "0.58193475", "0.57851416", "0.5778265", "0.57617974", "0.5743661", "0.574048", "0.5738943", "0.57359296", "0.5726502", "0.5725401", "0.572478", "0.5719299", "0.57010335", "0.5698492", "0.56971", "0.5680354", "0.56780314", "0.56729686", "0.56611687", "0.5657468", "0.5657468", "0.5657468", "0.5657468", "0.5657468", "0.5657468", "0.5657468", "0.5657468", "0.5657468", "0.5657468", "0.5657468", "0.5657468", "0.5657468", "0.5657468", "0.5657468", "0.5657468", "0.5657468", "0.5657468", "0.5657468", "0.5657468", "0.5657468", "0.5657468", "0.5657468", "0.5657468", "0.5657468", "0.5657468", "0.5657468", "0.5657468", "0.5657468", "0.5657468", "0.5657468", "0.5657468", "0.5657468", "0.5657468", "0.5657468", "0.5657468", "0.5657468", "0.5657468", "0.5657468", "0.5657468", "0.5657468", "0.5657468", "0.5657468", "0.5657468", "0.5657468", "0.5657468", "0.5657468", "0.5657468", "0.5657468", "0.5657468", "0.5657468", "0.5657468", "0.5657468", "0.5657468", "0.5657468", "0.5657468", "0.5657468", "0.5657468", "0.5657468", "0.5657468" ]
0.0
-1
login Method Allows users to login into the system by offering username and password. only accept two accounts at the present: Administrator: username: admin password: admin Customer: username: josephzelo password: asdasd
public String processLogin(Credential credential) { String result = null; System.out.println("input username is:" + credential.getUname()); System.out.println("input password is:" + String.valueOf(credential.getPwd())); if (credential.getUname().equalsIgnoreCase("josephzelo")){ System.out.println("username is correct"); if(String.valueOf(credential.getPwd()).equalsIgnoreCase("asdasd")){ result = "customer"; } else { System.out.println("password is wrong"); } } else if (credential.getUname().equalsIgnoreCase("admin")) { System.out.println("username is correct"); if(String.valueOf(credential.getPwd()).equalsIgnoreCase("admin")){ result = "admin"; } else { System.out.println("password is wrong"); } } else { System.out.println("username is wrong"); } return result; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private void login(String username,String password){\n\n }", "void login(String user, String password);", "protected void login() {\n\t\t\r\n\t}", "public void login() {\n if (!areFull()) {\n return;\n }\n\n // Get the user login info\n loginInfo = getDBQuery(nameField.getText());\n if (loginInfo.equals(\"\")) {\n return;\n }\n\n // Get password and check if the entered password is true\n infoArray = loginInfo.split(\" \");\n String password = infoArray[1];\n if (!passField.getText().equals(password)) {\n errorLabel.setText(\"Wrong Password!\");\n return;\n }\n\n continueToNextPage();\n }", "private static void loginForAdmin(String username, String password){\n\n ArrayList<Object> loginData = LogInAndLogOutService.login(username, password);\n boolean logged = (boolean) loginData.get(0);\n boolean freezed = (boolean) loginData.get(1);\n Employee employee = (Employee) loginData.get(2);\n\n if (logged){\n\n System.out.println(\"Sie sind richtig als Herr/Frau \"+ employee.getLastname() + \" \"+ employee.getFirstname() +\" eingelogt.\");\n }else {\n if (freezed){\n\n System.out.println(\"Ihr Konto wurde einfriert. Sie können sie sich nicht einloggen. :(\");\n }else {\n\n System.out.println(\"Falscher Benutzername oder Passwort eingegeben. Versuchen Sie erneut.\");\n }\n }\n }", "public void doLogin() {\r\n\t\tif(this.getUserName()!=null && this.getPassword()!=null) {\r\n\t\t\tcdb=new Connectiondb();\r\n\t\t\tcon=cdb.createConnection();\r\n\t\t\ttry {\r\n\t\t\t\tps=con.prepareStatement(\"Select idUser,nom,prenom,userName,type,tel from t_user where userName=? and pass=? and status=?\");\r\n\t\t\t\tps.setString(1, this.getUserName());\r\n\t\t\t\tps.setString(2, this.getPassword());\r\n\t\t\t\tif(rs.next()) {\r\n\t\t\t\t\tSessionConfig.getSession().setAttribute(\"idUser\", rs.getInt(\"idUser\"));\r\n\t\t\t\t\tSessionConfig.getSession().setAttribute(\"nom\", rs.getString(\"nom\"));\r\n\t\t\t\t\tSessionConfig.getSession().setAttribute(\"prenom\", rs.getString(\"prenom\"));\r\n\t\t\t\t\tSessionConfig.getSession().setAttribute(\"userName\", rs.getString(\"userName\"));\r\n\t\t\t\t\tSessionConfig.getSession().setAttribute(\"type\", rs.getString(\"type\"));\r\n\t\t\t\t\tSessionConfig.getSession().setAttribute(\"tel\", rs.getString(\"tel\"));\r\n\t\t\t\t\tFacesContext.getCurrentInstance().getExternalContext().redirect(\"view/welcome.xhtml\");\r\n\t\t\t\t\t\r\n\t\t\t\t}\r\n\t\t\t} catch (Exception e) {\r\n\t\t\t\te.printStackTrace();\r\n\t\t\t\tnew Message().error(\"echec de connexion\");\r\n\t\t\t}finally {\r\n\t\t\t\tcdb.closeConnection(con);\r\n\t\t\t}\r\n\t\t}else {\r\n\t\t\tnew Message().warnig(\"Nom d'utilisateur ou mot de passe incorrecte\");\r\n\t\t}\r\n\t}", "private void login() {\n AnonimoTO dati = new AnonimoTO();\n String username = usernameText.getText();\n String password = passwordText.getText();\n\n if (isValidInput(username, password)) {\n dati.username = username;\n dati.password = password;\n\n ComplexRequest<AnonimoTO> request =\n new ComplexRequest<AnonimoTO>(\"login\", RequestType.SERVICE);\n request.addParameter(dati);\n\n SimpleResponse response =\n (SimpleResponse) fc.processRequest(request);\n\n if (!response.getResponse()) {\n if (ShowAlert.showMessage(\n \"Username o password non corretti\", AlertType.ERROR)) {\n usernameText.clear();\n passwordText.clear();\n }\n }\n }\n\n }", "public void login() {\n\t\tUser user = new User(\"admin\", \"12345678\", Role.ADMIN);\n\t\tuser.setEmail(\"[email protected]\");\n\t\t\n\t\tif(user != null) {\n\t\t\tuserBean.setLoggedInUser(user);\n\t\t\tFacesContext context = FacesContext.getCurrentInstance();\n\t\t\tHttpServletRequest req = (HttpServletRequest)context.getExternalContext().getRequest();\n\t\t\treq.getSession().setAttribute(ATTR_USER, user);\n\t\t}else{\n\t\t\tkeepDialogOpen();\n\t\t\tdisplayErrorMessageToUser(\"Wrong Username/Password. Try again\");\n\t\t}\n\t\t\n\t}", "protected Response login() {\n return login(\"\");\n }", "public int login(String username, String password) \n {\n\treturn this.acctCtrl.login(username, password);\n\n }", "public String login() {\r\n FacesContext context = FacesContext.getCurrentInstance();\r\n HttpServletRequest request = (HttpServletRequest) context.getExternalContext().getRequest();\r\n System.out.println(\"Username: \" + email);\r\n System.out.println(\"Password: \" + password);\r\n try {\r\n //this method will actually check in the realm for the provided credentials\r\n request.login(this.email, this.password);\r\n\r\n } catch (ServletException e) {\r\n context.addMessage(null, new FacesMessage(\"Login failed.\"));\r\n return \"error\";\r\n }\r\n return \"/faces/users/index.xhtml\";\r\n }", "@Override\n public boolean userLogin(String username, String password) \n {\n User tmpUser = null;\n tmpUser = getUser(username);\n if(tmpUser == null) return false;\n if(tmpUser.getPassword().equals(password)) return true;\n return false;\n }", "private static void loginToAccount() {\n\n\t\tSystem.out.println(\"Please enter your userName : \");\n\t\tString userName=scan.nextLine();\n\n\t\tSystem.out.println(\"Please enter your Password : \");\n\t\tString password=scan.nextLine();\n\n\t\tif(userName.equals(userName)&& password.equals(password))\n\t\t\tSystem.out.println(\"Welcome to AnnyBank\");\n\n\t\ttransactions();\n\t}", "public String login() {\n try {\n HttpServletRequest request = (HttpServletRequest) FacesContext.getCurrentInstance().getExternalContext().getRequest();\n request.login(name, password);\n initUser();\n request.getSession().setAttribute(\"current_user\", this);\n return \"/index?faces-redirect=true\";\n } catch (ServletException e) {\n FacesContext context = FacesContext.getCurrentInstance();\n FacesMessage message = new FacesMessage(\"Wrong login or password\");\n message.setSeverity(FacesMessage.SEVERITY_ERROR);\n context.addMessage(\"login\", message);\n }\n return \"/pages/login.xhtml\";\n }", "Login(String strLogin)\n {\n \tsetLogin(strLogin);\n }", "public void login() throws ClassNotFoundException, SQLException {\n\t\tConnectionManager con=new ConnectionManager();//connection manager\r\n\t\tScanner s=new Scanner(System.in);\r\n\t\tSystem.out.println(\"Enter the username\");\r\n\t\tString name=s.next();\r\n\t\tSystem.out.println(\"Enter the password\");\r\n\t\tString pass=s.next();\r\n\t\tint flag=0;\r\n\t\tStatement st=con.getConnection().createStatement();\r\n\t\tResultSet set=st.executeQuery(\"select * from adminlogin\"); \r\n\t\twhile(set.next()) {\r\n\t\t\t//to display the values\r\n\t\t\tString name1=set.getString(1);\r\n\t\t\tString pw1=set.getString(2);\r\n\t\t\r\n\t\tif(name1.contentEquals(name)&& pass.contentEquals(pw1)) \r\n\t\t\tflag=1;\r\n\t\t}\r\n\t\tif(flag==1) {\r\n\r\n\t\t\tSystem.out.println(\"Admin login successful\");\r\n\t\t\tadminlogin ad=new adminlogin();\r\n\t\t\tad.option();\r\n\t\t}\r\n\t\telse {\r\n\t\t\tSystem.out.println(\"Sorry..!! Incorrect details.\\nLogin again\\n\");\r\n\t\t}\r\n\t\t\t\r\n\t\tHotelmanagement first=new Hotelmanagement();\r\n\t\tfirst.choice();\r\n\t}", "private void logIn() {\n char[] password = jPasswordField1.getPassword();\n String userCode = jTextField1.getText();\n\n String txtpassword = \"\";\n for (char pw : password) {\n txtpassword += pw;\n }\n if (\"\".equals(txtpassword)) {\n JOptionPane.showMessageDialog(this, textBundle.getTextBundle().getString(\"enterPassword\"), \"No Password\", JOptionPane.WARNING_MESSAGE);\n } else if (txtpassword.equals(userData.get(0).toString())) {\n jPasswordField2.setEnabled(true);\n jPasswordField3.setEnabled(true);\n jPasswordField2.setEditable(true);\n jPasswordField3.setEditable(true);\n jPasswordField2.grabFocus();\n }\n }", "public static void Login() \r\n\t{\n\t\t\r\n\t}", "User login(String username, String password);", "protected boolean login() {\n\t\tString Id = id.getText();\n\t\tif (id.equals(\"\")){\n\t\t\tJOptionPane.showMessageDialog(null, \"请输入用户名!\",\"\", JOptionPane.ERROR_MESSAGE);\n\t\t\treturn false;\n\t\t}\n\t\t\n\t\tUserVO user = bl.findUser(Id);\n\t\tif (user == null){\n\t\t\tJOptionPane.showMessageDialog(null, \"该用户不存在!\",\"\", JOptionPane.ERROR_MESSAGE);\n\t\t\treturn false;\n\t\t}\n\t\t\n\t\tif (! user.getPassword().equals(String.valueOf(key.getPassword()))){\n\t\t\tSystem.out.println(user.getPassword());\n\t\t\tJOptionPane.showMessageDialog(null, \"密码错误!\",\"\", JOptionPane.ERROR_MESSAGE);\n\t\t\treturn false;\n\t\t}\n\t\t\n\t\tsimpleLoginPanel.this.setVisible(false);\n\t\tUserblService user2 = new Userbl(Id);\n\t\tReceiptsblService bl = new Receiptsbl(user2);\n\t\tClient.frame.add(new simpleMainPanel(user2,bl));\n\t\tClient.frame.repaint();\n\t\t\n\t\treturn true;\n\t\t\n\t}", "public void loginTo(String strUserName,String strPasword)\n { \n if(strUserName.equals(\"\"))\n \tthis.getUserName().clear();\n \n if(strPasword.equals(\"\"))\n \tthis.getPassword().clear();\n \n \n \tthis.getUserName().sendKeys(strUserName); \n\n this.getPassword().sendKeys(strPasword); \n\n this.getLoginButton().click(); \n }", "public User login(String loginName, String password) throws UserBlockedException;", "public User logInUser(final String login, final String password);", "@Action(value = \"adminLogin\", results = { @Result(name = \"success\", location = \"/success.jsp\") })\r\n\tpublic String login() throws IOException {\r\n\t\tString userName = RequestUtil.getParam(request, \"username\", \"\");\r\n\t\tString password = RequestUtil.getParam(request, \"password\", \"\");\r\n\t\tresponse.reset();\r\n\t\tresponse.setCharacterEncoding(\"utf-8\");\r\n\t\tif (\"admin\".equals(userName) && \"admin\".equals(password)) {\r\n\t\t\tresponse.getWriter().print(\"{success:'true',msg:'登录成功'}\");\r\n\t\t\tif (null == user)\r\n\t\t\t\tuser = new LoginUser();\r\n\t\t\tuser.setUsername(userName);\r\n\t\t\tuser.setPassword(password);\r\n\t\t\trequest.getSession()\r\n\t\t\t\t\t.setAttribute(Contants.SESSION_USER_ADMIN, user);\r\n\t\t\tOnlineUser.getInstance().addUser(user, 1);\r\n\t\t\treturn null;\r\n\t\t}\r\n\t\tresponse.getWriter().print(\"{success:'false',msg:'登录失败'}\");\r\n\t\treturn null;\r\n\t}", "@Override\n\t public String loginUser(String email, String password) {\n\t\t\tlog.info(\"email and pass are \"+email+\" \"+password);\n\t\t\twebuserid=loginmanager.isExist(email, password);\n\t\t\tif(webuserid>0)\n\t\t\t{\n\t\t\t//Ckech is it blocked\n\t\t\tif(! loginmanager.isBlocked(webuserid))\n\t\t\t{\n\t\t\t\t //Get all personal Ids and login the person\n\t\t\t\t \n\t\t\t\t peronalid=loginmanager.getPersonelIds(webuserid);\n\t\t\t\t \n\t\t\t\t //Store in personal bean class\n\t\t\t\t PersonalIds.setEmpid(1);\n\t\t\t\t PersonalIds.setCmpid(1);\n\t\t\t\t PersonalIds.setGrpid(1);\n\t\t\t\t message=error.sucess;\n\t\t\t\t //Lodge the login details in a lodgeevent table\n\t\t\t\n\t\t\t} \n\t\t\telse\n\t\t\t{\n\t\t\tmessage=error.blocked;\n\t\t\t}\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\tmessage=error.noaccount;\n\t\t\t}\n\t\t\t\n\t\t\t\t \n\t\t\t\n\t\t\t\n\t\t\treturn message;\n\t }", "public void login() {\n\n String username = usernameEditText.getText().toString();\n String password = passwordEditText.getText().toString();\n regPresenter.setHost(hostEditText.getText().toString());\n regPresenter.login(username, password);\n }", "@Override\r\n\tpublic void login() {\n\t\t\r\n\t}", "public String login()\n\t{\n\t\tFacesContext context = FacesContext.getCurrentInstance();\n\t\tUsersBean userBean = new UsersBean();\n\t\ttry {\n//\t\t\tctx = new InitialContext(props);\n\t\t\t\n\t\t\t//userBean = (usersPersistentBean) ctx.lookup(\"usersPersistentBean\");\n\t\t\tUser attempting_user = new User();\n\t\t\tattempting_user.setUsername(getUsername());\n\t\t\tattempting_user.setPassword(getPassword());\n\t\t\tUser resultUser = userBean.getUser(attempting_user);\n\t\t\tif (resultUser.getUsername() != null)\n\t\t\t{\n\t\t\t\tsetIsAdmin(resultUser.isAdmin());\n\t\t\t\tsetUserId(resultUser.getUserId());\n\t\t\t\tsetLoginMessage(\"success\");\n\t\t\t\tcontext.getExternalContext().redirect(\"basicCalculator.xhtml\");\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tsetLoginMessage(\"*Incorrect Username and password\");\n\t\t\t}\n\t\t} catch (Exception ex) {\n\t\t\tex.printStackTrace();\n\t\t}\n\t\treturn getLoginMessage();\t\t\n\t}", "public abstract void login(String userName, String password) throws RemoteException;", "public void login() {\n try {\n callApi(\"GET\", \"account/session\", null, null, true);\n } catch (RuntimeException re) {\n\n }\n\n Map<String, Object> payload = new HashMap<>();\n payload.put(\"name\", \"admin\");\n payload.put(\"password\", apiAdminPassword);\n payload.put(\"remember\", 1);\n\n callApi(\"POST\", \"account/signin\", null, payload, true);\n }", "public String adminlogin() {\n\t\tfactory = Persistence.createEntityManagerFactory(PERSISTENCE_UNIT_NAME);\n\t\tEntityManager em = factory.createEntityManager();\n\t\t//Query to select user account where email and password entered by the user\n\t\tQuery q = em\n\t\t\t\t.createQuery(\"SELECT u FROM AdminAccount u WHERE u.email = :email AND u.password = :pass\");\n\t\tq.setParameter(\"email\", email);\n\t\tq.setParameter(\"pass\", password);\n\t\ttry {\n\t\t\tAdminAccount user = (AdminAccount) q.getSingleResult();\n\t\t\tif (email.equalsIgnoreCase(user.getEmail())\n\t\t\t\t\t&& password.equals(user.getPassword())) {\t//If passwords match,\n\t\t\t\n\t\t\t\t HttpSession session = Util.getSession();\t//create session\n\t\t session.setAttribute(\"email\", email);\n\t\t\n\t\t\t\treturn \"success\";\n\t\t\t}\n\t\t\taddMessage(new FacesMessage(FacesMessage.SEVERITY_ERROR,\n\t\t\t\t\t\"Invalid credentials entered!\", null));\n\t\t\treturn \"failure\";\n\n\t\t} catch (Exception e) {\n\t\t\taddMessage(new FacesMessage(FacesMessage.SEVERITY_ERROR,\n\t\t\t\t\t\"System error occured. Contact system admin!\", null));\n\t\t\treturn \"systemError\";\n\t\t}\n\t}", "@Override\n\tpublic Users login(String userName, String password) throws Exception {\n\t\tUsers user= null;\n\t\tuser = userMapper.login(userName,password);\n\t\t//匹配密码\n\t\treturn user;\n\t}", "LoginContext login(String username, String password) throws LoginException;", "private void adminLogin() {\n\t\tdriver.get(loginUrl);\r\n\t\t// fill the form\r\n\t\tdriver.findElement(By.name(\"username\")).sendKeys(USERNAME);\r\n\t\tdriver.findElement(By.name(\"password\")).sendKeys(PASSWORD);\r\n\t\t// submit login\r\n\t\tdriver.findElement(By.name(\"btn_submit\")).click();\r\n\t}", "public void login(String uname, String pwd) {\n username.type(uname);\n password.type(pwd);\n loginButton.click();\n }", "public void login2() {\n\t\tdriver.findElement(By.cssSelector(\"input[name='userName']\")).sendKeys(\"testing\");\n\t\tdriver.findElement(By.cssSelector(\"input[name='password']\")).sendKeys(\"testing\");\n\t\tdriver.findElement(By.cssSelector(\"input[name='login']\")).click();\n\t\t\n\n\t\n\t\n\t}", "public boolean login(String X_Username, String X_Password){\n return true;\n //call the function to get_role;\n //return false;\n \n \n }", "public static void login() {\n\t\t\n\t\t\n\n\t\twhile(!userIsLogged) {\n\n\t\t\tSystem.out.println(\"--> LOGIN <--\");\n\n\t\t\tString username = \"\";\n\t\t\tString password = \"\";\n\n\t\t\tdo {\n\t\t\t\tSystem.out.print(\"Username: \");\n\t\t\t\tusername = Main.scanner.nextLine();\n\t\t\t\tSystem.out.print(\"Password: \");\n\t\t\t\tpassword = Main.scanner.nextLine();\n\n\t\t\t\tif(username.isEmpty() && password.isEmpty()) {\n\t\t\t\t\tSystem.out.println(\"\\n>> Username or Password not inserted\\n\");\n\t\t\t\t}\n\n\t\t\t} while (username.isEmpty() && password.isEmpty());\n\n\n\t\t\tfor (Person person : userList) {\n\t\t\t\tif (person.getUsername().equals(username) && person.getPassword().equals(password)) {\n\t\t\t\t\t// loging correct\n\t\t\t\t\tloggedUser = person;\n\t\t\t\t\tuserIsLogged = true;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif(!userIsLogged) {\n\t\t\t\tSystem.out.println(\"\\n>> Wrong username or password\\n\");\n\t\t\t}\n\t\t}\n\n\t\tSystem.out.println(\"Welcome \" + loggedUser.getName() + \" \" + loggedUser.getSurname());\n\t}", "public boolean loginUser();", "@Override\n\tpublic Authentication Login(String username, String password) {\n\t\t try {\n\t\t\t\n \tAuthentication request = new UsernamePasswordAuthenticationToken(username, password);\n \tAuthentication result =authenticationManager.authenticate(request);\n \tSecurityContextHolder.getContext().setAuthentication(result);\n \treturn result;\n\t\t }\n\t\t catch(AccessDeniedException e) {\n\t \t System.out.println(\"Authentication failed: \" + e.getMessage()) ;\n\t }\n\t\t catch(BadCredentialsException e) {\n\t\t\t System.out.println(\"Authentication failed: \" + e.getMessage()) ;\n\t } catch (Exception e) {\n\t\t\t\t// TODO Auto-generated catch block\n\t \t System.out.println(\"Authentication failed: \" + e.getMessage()) ;\n\t\t\t\te.printStackTrace();\n\t\t\t}\n\t\n\t\t return null;\n\t}", "public Person login(String username, String password);", "@Override\r\n\tpublic user login(String name, String pwd) {\n\t\treturn userM.login(pwd,name);\r\n\t\t\r\n\t}", "public boolean login() {\n\n\t con = openDBConnection();\n\t try{\n\t pstmt= con.prepareStatement(\"SELECT ID FROM TEAM5.CUSTOMER WHERE USERNAME =? AND PASSWORD=?\");\n pstmt.clearParameters();\n pstmt.setString(1,this.username);\n pstmt.setString(2, this.password);\n\t result= pstmt.executeQuery();\n\t if(result.next()) {\n\t \t this.setId(result.getInt(\"id\")); \n\t \t this.loggedIn = true; \n\t }\n\t return this.loggedIn;\n\t }\n\t catch (Exception E) {\n\t E.printStackTrace();\n\t return false;\n\t }\n\t }", "public void Login(String userName, String password) \n\t{\n\t\ttxtUserName.sendKeys(userName);\n\t\ttxtPassword.sendKeys(password);\n\t}", "@Override\n\tpublic ResultMessage login(String user_name, String password) throws RemoteException{\n\t\treturn null;\n\t}", "@Override\n\tpublic boolean login(String username, String password) {\n\t\treturn true;\n\t}", "public String signin() {\n \t//System.out.print(share);\n \tSystem.out.println(username+\"&&\"+password);\n String sqlForsignin = \"select password from User where username=?\";\n Matcher matcher = pattern.matcher(sqlForsignin);\n String sql1 = matcher.replaceFirst(\"'\"+username+\"'\");//要到数据库中查询的语句\n select();\n DBConnection connect = new DBConnection();\n List<String> result = connect.select(sql1);//查询结果\n if (result.size() == 0) return \"Fail1\";\n \n if (result.get(0).equals(password)){\n \tsession.setAttribute( \"username\", username);\n \treturn \"Success\";\n }\n else return \"Fail\";\n }", "public void Login()throws Exception{\r\n if(eMailField.getText().equals(\"user\") && PasswordField.getText().equals(\"pass\")){\r\n displayMainMenu();\r\n }\r\n else{\r\n System.out.println(\"Username or Password Does not match\");\r\n }\r\n }", "@Test\r\n\tpublic void login() {\n\t\tUser loginExit = userMapper.login(\"wangxin\", \"123456\");\r\n\t\tif (loginExit == null) {\r\n\t\t\tSystem.out.println(\"用户不存在\");\r\n\t\t} else {\r\n\t\t\tSystem.out.println(loginExit);\r\n\t\t\tSystem.out.println(\"登录成功!\");\r\n\t\t}\r\n\t}", "@PostMapping(\"/login\")\n\t public String login(@RequestParam(\"username\") String username, @RequestParam(\"password\") String password, Model model) {\n\t \t\tSystem.out.println(username +\"Hello \"+ password);\n\t \t\tboolean flag=userService.autoLogin(username, password);\n\t if(flag) {\n\t \tmodel.addAttribute(\"expense\", expenseService.getMonthAndYearAndAmount());\n\t \t model.addAttribute(\"username\",username);\n\t \t localUsername = username;\n\t \t return \"redirect:/dashboard\";\n\t }\n\t model.addAttribute(\"error\",true);\n\t return \"login\";\n\t }", "@Override\n\tpublic boolean login(String userName, String password) {\n\t\tuk.ac.glasgow.internman.users.User user = users.getUser(userName, password);\n\t\tif (user != null){\n\t\t\tcurrentUser = user;\n\t\t\treturn true;\n\t\t}\n\t\telse return false;\n\t}", "@Action(value = \"userAction_login\", results = {\n\t\t\t@Result(name = \"login-error\", location = \"/login.jsp\"),\n\t\t\t@Result(name = \"login-ok\", type = \"redirect\", location = \"/index.jsp\"),\n\t\t\t@Result(name = \"login-params-error\", location = \"/login.jsp\") })\n\t@InputConfig(resultName = \"login-params-error\")\n\tpublic String login() {\n\t\tremoveSessionAttribute(\"key\");\n\t\ttry {\n\t\t\t// 1.获取subject对象\n\t\t\tSubject subject = SecurityUtils.getSubject();\n\t\t\t// 2.获取令牌对象(封装参数数据)\n\t\t\tUsernamePasswordToken token = new UsernamePasswordToken(\n\t\t\t\t\tmodel.getEmail(), model.getPassword());\n\t\t\tsubject.login(token);\n\t\t\treturn \"login-ok\";\n\t\t} catch (AuthenticationException e) {\n\t\t\te.printStackTrace();\n\t\t\tthis.addActionError(this.getText(\"login.emailorpassword.error\"));\n\t\t\treturn \"login-error\";\n\t\t}\n\t}", "public Page_Home doDefaultLogin() {\n\t\tLogStatus.info(\"Logging in with username :: \\'\" + TestUtils.getValue(\"username\") + \"\\' and password :: \\'\"\n\t\t\t\t+ TestUtils.getValue(\"password\") + \"\\'\");\n\t\tDriverManager.getDriver().findElement(By.name(\"username\")).sendKeys(TestUtils.getValue(\"username\"));\n\t\tDriverManager.getDriver().findElement(By.name(\"password\")).sendKeys(TestUtils.getValue(\"password\"));\n\t\tDriverManager.getDriver().findElement(By.id(\"Registration Desk\")).click();\n\t\tDriverManager.getDriver().findElement(By.id(\"loginButton\")).click();\n\n\t\treturn new Page_Home();\n\n\t}", "public static void userLogin(Context context)\r\n\t{\r\n\t\ttry\r\n\t\t{\r\n\t\t\t\r\n\t\t\r\n\t\t\tString username = context.formParam(\"myUsername\");\r\n\t\t\tString password = context.formParam(\"myPassword\");\r\n\t\t\t\r\n\t\t\tif(myAccountServ.attemptLoginServiceLayer(username, password)) //if true then get user account from DB\r\n\t\t\t{\r\n\t//\t\t\tSystem.out.println(myAccountServ.getMyAccountFromDatabase(username, password));\r\n\t\t\t\tcontext.sessionAttribute(\"currentUser\", myAccountServ.getMyAccountFromDatabase(username, password)); //set session to user account info\r\n\t//\t\t\tSystem.out.println(((Account)context.sessionAttribute(\"currentUser\")));\r\n\t//\t\t\tSystem.out.println(((Account)context.sessionAttribute(\"currentUser\")).getRoleId() == 1);\r\n\t\t\t\tif(((Account)context.sessionAttribute(\"currentUser\")).getRoleId() == 1)//check user role id if they employeee\r\n\t\t\t\t{\r\n\t\t\t\t\t//take me to the employee page\r\n\t\t\t\t\tcontext.redirect(\"/html/employee-page.html\");\r\n\t\t\t\t}\r\n\t\t\t\telse if(((Account)context.sessionAttribute(\"currentUser\")).getRoleId() == 0) // or if they manager\r\n\t\t\t\t{\r\n\t\t\t\t\tcontext.redirect(\"/html/manager-page.html\");\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t}\r\n\t\t\telse//if we failed login attempt... send us back to login page aka \"/index.html\"\r\n\t\t\t{\r\n\t\t\t\tSystem.out.println(\"not correct credentials\");\r\n\t\t\t\tcontext.redirect(\"/index.html\");\r\n\t\t\t}\r\n\t\t}\r\n\t\tcatch(Exception e)\r\n\t\t{\r\n\t\t\tLogging.error(e);\r\n\t\t}\r\n\t\t\r\n//\t\tSystem.out.println(\"username: \" + username);\r\n//\t\tSystem.out.println(\"pssword: \" + password);\r\n\t}", "private void logIn() throws IOException {\n\n BufferedReader reader = new BufferedReader(new InputStreamReader(System.in));\n String line = reader.readLine();\n String[] a = line.split(\";\");\n\n String user = a[0];\n String password = a[1];\n boolean rez = service.checkPassword(user, password);\n if(rez == TRUE)\n System.out.println(\"Ok\");\n else\n System.out.println(\"Not ok\");\n }", "public String login(String username, String password){\n return login.login(username, password);\n }", "public void doLogin(String userName,String password) {\n\t\tenterText(usernamelocator, userName);\n\t\tenterText(passwordlocator, password);\n\t\tclick(loginButton);\n\t}", "void loginAttempt(String email, String password);", "@GetMapping(\"/user\")\n public User login(@RequestParam String username, @RequestParam String password) { return userDataTierConnection.login(username,password); }", "@Override\n public User login(String username, String password) {\n User u = userDataMapper.getUserByUserName(username);\n if (u != null && u.getPassword().equals(password))\n return u;\n return null;\n }", "protected synchronized void login() {\n\t\tauthenticate();\n\t}", "private int logIn()\r\n\t{\r\n\t\tScanner input = new Scanner(System.in);\r\n\t\tString username;\r\n\t\tString password;\r\n\t\tint index;\r\n\t\t\r\n\t\t//prompt user for username and password\r\n\t\tSystem.out.println(\"Enter your username\");\r\n\t\tusername = input.nextLine();\r\n\t\tSystem.out.println(\"Enter your password\");\r\n\t\tpassword = input.nextLine();\r\n\t\t\r\n\t\tindex = checkUserExists(username);\t\t\t\t\t\t\t\t\t//get the index of the username so we can find the password\r\n\t\tif (index == -1 || !userAccounts[1][index].equals(password))\t\t//username or password is incorrect\r\n\t\t{\r\n\t\t\tSystem.out.println(\"\\nIncorrect Username/Password\");\r\n\t\t\treturn 0;\r\n\t\t}\r\n\t\tSystem.out.println(\"Login Successful\");\r\n\t\treturn 1;\r\n\t}", "public boolean login(){\r\n try{\r\n DbManager0 db = DbManager0.getInstance();\r\n Query q = db.createQuery(\"SELECT * FROM user WHERE username = '\"+this.login+\"' and password = '\"+this.pwd+\"';\");\r\n QueryResult rs = db.execute(q);\r\n rs.next();\r\n if(rs.wasNull()) return false;\r\n this.id = rs.getInt(\"id\")+\"\";\r\n return true;\r\n }\r\n catch(SQLException ex){\r\n throw new RuntimeException( ex.getMessage(), ex );\r\n }\r\n }", "void login(String userName) throws IllegalArgumentException, IOException;", "public void cl_login(String uname, String pwd)\n\t{\n\t\tEnter(txt_uname, uname);\n\t\tEnter(txt_pwd, pwd);\n\t\tClick(btn_login);\n\t\t\n\t}", "@Override\n\tpublic Enterprise login(String userName, String password) {\n\t\t\n\t\treturn enterpriseDao.findEnterpriseByUserNameAndPassword(userName, password);\n\t}", "public Login_Result login(String username, String password) throws ClientException {\n\t\tLogin_Result result = new Login_Result();\n\t\tif(username.equals(\"mack\")) {\n\t\t\tresult.setWasLoggedIn(true);\n\t\t\tresult.setName(\"mack\");\n\t\t\tresult.setID(24);\n\t\t} else if (username.equals(\"Chewy\")) {\n\t\t\tresult.setWasLoggedIn(true);\n\t\t\tresult.setName(\"Chewy\");\n\t\t\tresult.setID(1);\n\t\t} else if (username.equals(\"bummer\")) {\n\t\t\tresult.setWasLoggedIn(true);\n\t\t\tresult.setName(\"bummer\");\n\t\t\tresult.setID(1111);\n\t\t} else if (username.equals(\"manndi\")) {\n\t\t\tresult.setWasLoggedIn(true);\n\t\t\tresult.setName(\"manndi\");\n\t\t\tresult.setID(13);\n\t\t} else {\n\t\t\tresult.setWasLoggedIn(false);\n\t\t}\n\t\treturn result;\n\t}", "@Override\n\tprotected void login() {\n\t\tsuper.login();\n\t}", "public boolean login( String username, String password ) {\n\t\n\t\tif( ( null != setUsername( username ) ) && ( null != setPassword( password ) ) )\n\t\t\tif( null != clickLogin( ) )\n\t\t\t\treturn true;\n\t\t\n\t\treturn false;\n\t}", "@Test\n\tpublic void login_customer2() {\n\t\tAssert.assertEquals(-1,x.Login(\"abd\",\"123\"));\n\t\tAssert.assertEquals(-1,x.Login(\"abc\",\"1233\"));\n\t}", "@Override\n\tpublic boolean login(String username, String password) {\n\t\treturn userProviderService.login(username, password);\n\t}", "@Override\n\tpublic void loginUser() {\n\t\t\n\t}", "public final void login() {\n Activity_ExtensionKt.hideSoftKeyboard(this);\n if (hasAllRequiredField()) {\n EditText editText = (EditText) _$_findCachedViewById(C2723R.C2726id.etUserName);\n Intrinsics.checkExpressionValueIsNotNull(editText, \"etUserName\");\n String obj = editText.getText().toString();\n if (obj != null) {\n this.username = StringsKt.trim((CharSequence) obj).toString();\n EditText editText2 = (EditText) _$_findCachedViewById(C2723R.C2726id.etPassword);\n Intrinsics.checkExpressionValueIsNotNull(editText2, \"etPassword\");\n String obj2 = editText2.getText().toString();\n if (obj2 != null) {\n this.password = StringsKt.trim((CharSequence) obj2).toString();\n LoginViewModel loginViewModel = this.viewModel;\n if (loginViewModel == null) {\n Intrinsics.throwUninitializedPropertyAccessException(\"viewModel\");\n }\n EditText editText3 = (EditText) _$_findCachedViewById(C2723R.C2726id.etUserName);\n Intrinsics.checkExpressionValueIsNotNull(editText3, \"etUserName\");\n String obj3 = editText3.getText().toString();\n EditText editText4 = (EditText) _$_findCachedViewById(C2723R.C2726id.etPassword);\n Intrinsics.checkExpressionValueIsNotNull(editText4, \"etPassword\");\n loginViewModel.login(obj3, editText4.getText().toString());\n return;\n }\n throw new TypeCastException(\"null cannot be cast to non-null type kotlin.CharSequence\");\n }\n throw new TypeCastException(\"null cannot be cast to non-null type kotlin.CharSequence\");\n }\n }", "public void login() {\n presenter.login(username.getText().toString(), password.getText().toString());\n }", "public HomePage loginAs(String username, String password) {\n // The PageObject methods that enter username, password & submit login have\n // already defined and should not be repeated here.\n typeUserName(username);\n typePassword(password);\n return clickOnSignInButton();\n }", "@Override public User login(String username, String password)\r\n throws RemoteException, SQLException {\r\n this.username = username;\r\n this.password = password;\r\n user = gameListClientModel.login(username, password);\r\n return gameListClientModel.login(username, password);\r\n }", "@Override\n\tpublic boolean login(String username, String password) {\n\t\treturn false;\n\t}", "@Override\n\tpublic AdminDTO login(AdminloginDTO login) {\n\t\treturn adao.login(login);\n\t}", "public void doLogin(String username, String password) {\n typeUsername(username);\n typePassword(password);\n clickLoginButton();\n }", "public void doLogin() {\n\t\tSystem.out.println(\"loginpage ----dologin\");\n\t\t\n\t}", "@Override\r\n\tpublic boolean login(String username, String password, String loginType) {\r\n\r\n\t\tif (loginType.equals(\"Admin\")) {\r\n\t\t\tOptional<Admin> admin = adminRepository.findByUsername(username);\r\n\t\t\tAdmin admin1 = admin.get();\r\n\t\t\tif (admin1.getUsername().equals(username) && admin1.getPassword().equals(password)) {\r\n\t\t\t\treturn true;\r\n\t\t\t} else {\r\n\t\t\t\treturn false;\r\n\t\t\t}\r\n\t\t} else if (loginType.equals(\"Customer\")) {\r\n\t\t\tOptional<Customer> customer = customerRepository.findByUsername(username);\r\n\t\t\tCustomer customer1 = customer.get();\r\n\t\t\tif (customer1.getUsername().equals(username) && customer1.getPassword().equals(password)) {\r\n\t\t\t\treturn true;\r\n\t\t\t} else {\r\n\t\t\t\treturn false;\r\n\t\t\t}\r\n\t\t} else if (loginType.equals(\"Driver\")) {\r\n\t\t\tOptional<Driver> driver = driverRepository.findByUsername(username);\r\n\t\t\tDriver driver1 = driver.get();\r\n\t\t\tif (driver1.getUsername().equals(username) && driver1.getPassword().equals(password)) {\r\n\t\t\t\treturn true;\r\n\t\t\t} else {\r\n\t\t\t\treturn false;\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\treturn false;\r\n\t}", "public void login(String login, String password) {\n // TODO implement logging in to Admin Panel\n driver.get(Properties.getBaseAdminUrl());\n driver.findElement(By.id(\"email\")).sendKeys(login);\n driver.findElement(By.id(\"passwd\")).sendKeys(password);\n driver.findElement(By.name(\"submitLogin\")).click();\n if (login == null || password == null) {\n throw new UnsupportedOperationException();\n }\n }", "private void loginAsAdmin() {\n vinyardApp.navigateToUrl(\"http://localhost:8080\");\n vinyardApp.fillUsername(\"admin\");\n vinyardApp.fillPassord(\"321\");\n vinyardApp.clickSubmitButton();\n }", "public abstract User login(User data);", "public void login(String username, String password) {\n User user = new User(username, password);\r\n String paramBodyJsonStr = new Gson().toJson(user);\r\n Logger.d(\"paramBodyJsonStr=\" + paramBodyJsonStr);\r\n // handle login\r\n AndroidNetworking.post()\r\n .setContentType(\"application/json; charset=utf-8\")\r\n .setTag(this)\r\n .setUrl(Constants.URL_LOGIN)\r\n .build()\r\n .setApplicationJsonString(paramBodyJsonStr)\r\n .setAnalyticsListener(analyticsListener)\r\n .getAsJSONObject(new JSONObjectRequestListener() {\r\n @Override\r\n public void onResponse(JSONObject result) {\r\n Logger.d(\"response result=\" + result.toString());\r\n Result<LoggedInUser> defultResult = loginRepository.getDataSource().login(username, password);\r\n LoggedInUser data = ((Result.Success<LoggedInUser>) defultResult).getData();\r\n loginResult.setValue(new LoginResult(new LoggedInUserView(data.getDisplayName())));\r\n }\r\n\r\n @Override\r\n public void onError(ANError anError) {\r\n loginResult.setValue(new LoginResult(new Result.Error(anError)));\r\n Logger.d(\"anError=\" + anError.toString());\r\n if (!TextUtils.isEmpty(anError.getErrorDetail())) {\r\n Logger.d(\"getMessage=\" + anError.getMessage() + \" getErrorDetail=\" + anError.getErrorDetail());\r\n }\r\n }\r\n });\r\n\r\n }", "protected void login() {\n\t\tdriver.get(getProperty(\"baseUrl\"));\n\n\t\t// 2. Enter valid credentials in the Username and Password fields.\n\t\tLoginPageObjects.usernameTextField(driver).sendKeys(getProperty(\"validUsername\"));\n\t\tLoginPageObjects.passwordTextField(driver).sendKeys(getProperty(\"validPassword\"));\n\n\t\t// 3. Click on the Login button\n\t\tLoginPageObjects.loginButton(driver).click();\n\t\t// waiting.waitForLoad(driver);\n\t}", "@Override\r\n\tpublic void login() {\n\r\n\t}", "Login() { \n }", "public void login(String login, String password) {\n driver.findElement(By.xpath(\"//input[@id='email']\")).sendKeys(login);\n driver.findElement(By.xpath(\"//input[@id='passwd']\")).sendKeys(password);\n driver.findElement(By.xpath(\"//button[@name='submitLogin']\")).click();\n\n }", "@Override\n\tpublic boolean login(String username, String upw) throws RemoteException {\n\t\tboolean result = false;\n\t\tif(username!=null){\n\t\t\tString sql=\"select upasswords from users where uname='\"+username+\"'\";\n\t\t\ttry{\tStatement stmt;\n\t\t\t\t\tResultSet rs;\n\t\t\t\t\tConnection conn=jdbcconnect.connnect();\n\t\t\t\t\tstmt=conn.createStatement();\n\t\t\t\t\trs=stmt.executeQuery(sql);\n\t\t\t\t\trs.next();//resultset 取值默认指向结果前一个\n\t\t\t\t\t//System.out.println(upw);\n\t\t\t\t\tString upasswords=rs.getString(\"upasswords\");\n\t\t\t\t\t//System.out.println(upasswords);\n\t\t\t\t\tif(upw.equals(upasswords))//look out equals!!!!\n\t\t\t\t\t{ result = true;\n\t\t\t\t\tSystem.out.println(\"login succeed!\");}\n\t\t\t\t\telse System.out.println(\"user name and passwords does not match\");\n\t\t\t\t\t//System.out.println(2);\n\t\t\t\t\trs.close();\n\t\t\t\t\tstmt.close();\n\t\t\t\t\tjdbcconnect.jdbcclose();\n\t\t\t}catch(Exception e ){System.out.println(e);}\n\t\t}\n\t\treturn result;\n\t}", "public Integer logIn(String u_name, String u_pw){\n //find entry with u_name = this.u_name\n //probably not so safe\n //getting user with index 0 because getUserFromUsername returns List\n User user = userDao.getUserFromUsername(u_name).get(0);\n //print at console\n LOGGER.info(\"User: \" + user);\n //returns integer 1 if user.get_pw equals to this.pw or 0 if not\n if (user.getU_Pw().equals(u_pw)){\n return user.getU_Id();\n }else{\n return 0;\n }\n }", "@Public\n\t@Get(\"/login\")\n\tpublic void login() {\n\t\tif (userSession.isLogged()) {\n\t\t\tresult.redirectTo(HomeController.class).home();\n\t\t}\n\t}", "public boolean login (String username,String password, String userType) {\n\t\tString uname =null;\n\t\tString passwd=null;\n\t\tString uType=null;\n\t\t\n\t\tuname=this.getUsername();\n\t\tpasswd=this.getPassword();\n\t\tuType=this.getUserType();\n\t\t\n\t\tif ((uname.equals(username)) && (passwd.equals(password)) && (uType.equals(userType)))\n\t\t{\n\t\t\treturn true;\n\t\t}\n\t\treturn false;\n\t}", "public String login() {\r\n String ruta = \"\";\r\n UsuarioDAO usuDAO = new UsuarioDAO();\r\n if (usuDAO.Login(this) != null) {\r\n ruta = FN.ruta(\"menu\");\r\n Empresa em = new Empresa();\r\n em.setEmpresa(\"2101895685\");\r\n em.setRazonSocial(\"Tibox SRL\");\r\n em.setDireccion(\"MiCasa\");\r\n SSU.sEmpresa(em);\r\n SSU.sUsuario(this);\r\n }\r\n return ruta;\r\n }", "public int login() {\n\t\t\n\t\tString inId;\n\t\tint loginResult = -1;\n\t\tString inName;\n\t\tScanner scan = new Scanner(new FilterInputStream(System.in) {\n\t\t\t@Override\n\t\t\tpublic void close() {\n\t\t\t\t\n\t\t\t}\n\t\t});\n\t\t\n\t\tSystem.out.println(\"Welcome\\n\");\n\t\t\n\t\twhile (true) {\n\t\t\tSystem.out.println(\"Please sign in\");\n\t\t\tSystem.out.print(\"ID\t: \");\t\t\n\t\t\tinId = scan.next();\n\t\t\t\n\t\t\tSystem.out.print(\"Name\t: \");\n\t\t\tinName = scan.next();\n\t\t\t\n\t\t\tSystem.out.println(\"\");\n\t\t\t\n\t\t\ttry {\n\t\t\t\tloginResult = dbc.login(inId, inName);\n\t\t\t} catch (SQLException e) {\n\t\t\t\tSystem.out.println(e);\n\t\t\t\tSystem.exit(-1);\n\t\t\t}\n\t\t\t\n\t\t\tif (loginResult == 1 || loginResult == 2) {\n\t\t\t\tid = inId;\n\t\t\t\tname = inName;\n\t\t\t\tbreak;\n\t\t\t}\t\t\n\t\t\telse if (loginResult == -1) {\n\t\t\t\tSystem.out.println(\"Error in login query\");\n\t\t\t\tSystem.exit(-1);\n\t\t\t}\n\t\t\telse if (loginResult == 0) {\n\t\t\t\tSystem.out.println(\"Wrong authentication\");\n\t\t\t}\n\t\t}\t\n\t\t\n\t\tscan.close();\n\t\t\n\t\treturn loginResult;\n\t}", "public boolean logincheck(String user, String pass) \r\n {\n \r\n try{\r\n Connection conn = DriverManager.getConnection(url, userName, password);\r\n String Sql = \"Select * from APP.MEMBER where email=? and password=?\";\r\n PreparedStatement pst = conn.prepareStatement(Sql);\r\n pst.setString(1,user);\r\n pst.setString(2,pass);\r\n ResultSet rs = pst.executeQuery();\r\n if (rs.next())\r\n {\r\n JOptionPane.showMessageDialog(null,\"Welcome user\");\r\n createEventsUI w = new createEventsUI();\r\n w.setVisible(true);\r\n }\r\n else\r\n {\r\n JOptionPane.showMessageDialog(null,\"Invalid username or password\", \"Access Denied\",JOptionPane.ERROR_MESSAGE);\r\n }\r\n }catch(Exception e) \r\n {\r\n JOptionPane.showMessageDialog(null, e);\r\n }\r\n return false;\r\n \r\n }", "public String login(String userName, String userPassword){\n BCryptPasswordEncoder pass = new BCryptPasswordEncoder();\n Users users = new Users();\n Users userFromdb = userRepository.findByUserName(userName);\n if (userFromdb != null){\n if (!userFromdb.getPassword().equals(userPassword)){\n// if (!(pass.matches(userPassword, userFromdb.getPassword()))){\n throw new UsernameNotFoundException(\"kata sandi salah\");\n }else{\n UsernamePasswordAuthenticationToken authToken = new UsernamePasswordAuthenticationToken(userFromdb.getUsername(),\n userFromdb.getPassword(), userFromdb.getAuthorities());\n// Authentication authentication = authenticationManager.authenticate(authToken);\n SecurityContextHolder.getContext().setAuthentication(authToken);\n System.out.println(\"Session Created\");\n }\n return userFromdb.getUsername();\n }else{\n throw new UsernameNotFoundException(\"username tidak ditemukan\");\n }\n }", "private void login(final String login, final String password, final String domainId) {\n checkCredentials(login, password);\n\n if (!login.isEmpty() && !password.isEmpty()) {\n Notification.activityStart();\n AuthentificationManager.getInstance()\n .authenticateOnSilverpeas(loginField.getText(), passwordField.getText(),\n domains.getSelectedValue(), null);\n }\n }", "public void login(User user);", "@Override \n public void commandLogin(String userName, String password)\n {\n }", "public boolean login(String username, String password) {\n\tif (this.sfCon.login(username, password)) {\n\t\t//UFCon = new UserFunctionalityController();\n\t\treturn true;\n\t} else {\n\t\treturn false;\n\t}\n\t}" ]
[ "0.80840313", "0.78792185", "0.7818091", "0.77454144", "0.77433854", "0.773642", "0.767734", "0.7598817", "0.7584325", "0.7568669", "0.7562735", "0.7504671", "0.7487688", "0.7486925", "0.74501395", "0.74453723", "0.7428172", "0.74270463", "0.7416753", "0.7404089", "0.7380821", "0.7350909", "0.7344278", "0.7325762", "0.7301161", "0.72942567", "0.728734", "0.72850835", "0.728213", "0.7277186", "0.72649336", "0.7263385", "0.72572255", "0.72512394", "0.7238659", "0.7223724", "0.7223383", "0.72207224", "0.7203437", "0.72029877", "0.7202452", "0.71979815", "0.7191498", "0.71877193", "0.71848524", "0.71628517", "0.71611035", "0.7150058", "0.71400005", "0.71389705", "0.7138878", "0.713269", "0.71307886", "0.7127958", "0.71256435", "0.7121967", "0.7120658", "0.71126324", "0.70980126", "0.7095167", "0.70939296", "0.7091311", "0.70902604", "0.70889735", "0.70852524", "0.70776016", "0.70762634", "0.70664716", "0.70606", "0.7057774", "0.7054942", "0.7045058", "0.7044711", "0.70411587", "0.702957", "0.70184386", "0.70139575", "0.70116645", "0.70099187", "0.7006074", "0.7002621", "0.70016867", "0.7001095", "0.6999748", "0.6998626", "0.699568", "0.6987496", "0.6984609", "0.698241", "0.69797933", "0.69777834", "0.6977551", "0.6973522", "0.69718754", "0.6964786", "0.6962866", "0.69582355", "0.69574535", "0.6953489", "0.694881", "0.6946612" ]
0.0
-1
customer Ryan: Please include usefull comments in each file. FIX: display all products selling in the market place It pulls all selling products information from db, return to the customer a array of product objects.
public String[] browse(Session session) throws RemoteException { String[] items = {"a", "b"}; System.out.println("Server model invokes browse() method"); return items; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void showAllProducts() {\n try {\n System.out.println(Constants.DECOR+\"ALL PRODUCTS IN STORE\"+Constants.DECOR_END);\n List<Product> products = productService.getProducts();\n System.out.println(Constants.PRODUCT_HEADER);\n for (Product product : products) { \n System.out.println((product.getName()).concat(\"\\t\\t\").concat(product.getDescription()).concat(\"\\t\\t\")\n .concat(String.valueOf(product.getId()))\n .concat(\"\\t\\t\").concat(product.getSKU()).concat(\"\\t\").concat(String.valueOf(product.getPrice()))\n .concat(\"\\t\").concat(String.valueOf(product.getMaxPrice())).concat(\"\\t\")\n .concat(String.valueOf(product.getStatus()))\n .concat(\"\\t\").concat(product.getCreated()).concat(\"\\t\\t\").concat(product.getModified())\n .concat(\"\\t\\t\").concat(String.valueOf(product.getUser().getUserId())));\n }\n } catch (ProductException ex) {\n System.out.println(ex);\n }\n }", "private void getAllProducts() {\n }", "List<Product> getAllProducts() throws DataBaseException;", "public List<Product> returnProducts() throws FlooringMasteryDaoException {\n\n List<Product> products = dao.loadProductInfo();\n return products;\n\n }", "public ArrayList<ShowProductLIstBean> showProductlist() {\n\n\t\tArrayList<ShowProductLIstBean> productdetails = new ArrayList<ShowProductLIstBean>();\n\n\t\tString driverClass = \"com.mysql.jdbc.Driver\";\n\t\tString dbUrl = \"jdbc:mysql://localhost:3306/pmsdb\";\n\t\tString dbUser = \"root\";\n\t\tString dbPswd = \"root\";\n\n\t\tConnection con = null;\n\t\tResultSet rs = null;\n\t\tPreparedStatement pstmt = null;\n\n\t\ttry {\n\t\t\tClass.forName(driverClass);\n\t\t\tcon = DriverManager.getConnection(dbUrl, dbUser, dbPswd);\n\n\t\t\tpstmt = con.prepareStatement(\"SELECT * FROM `pms_prd_details`\");\n\t\t\trs = pstmt.executeQuery();\n\n\t\t\tShowProductLIstBean spd = null;\n\t\t\twhile (rs.next()) {\n\n\t\t\t\tspd = new ShowProductLIstBean();\n\t\t\t\tspd.setProductId(rs.getInt(\"producid\"));\n\t\t\t\tspd.setProductName(rs.getString(\"productname\"));\n\t\t\t\tspd.setQuantity(rs.getInt(\"quantity\"));\n\t\t\t\tspd.setPrice(rs.getFloat(\"price\"));\n\t\t\t\tspd.setVname(rs.getString(\"vendorname\"));\n\n\t\t\t\tproductdetails.add(spd);\n\n\t\t\t}\n\n\t\t} catch (SQLException e) {\n\t\t\t// TODO Auto-generated catch block\n\t\t\te.printStackTrace();\n\t\t} catch (ClassNotFoundException e) {\n\t\t\t// TODO Auto-generated catch block\n\n\t\t\te.printStackTrace();\n\t\t} catch (NumberFormatException e) {\n\t\t\t// TODO Auto-generated catch block\n\t\t\te.printStackTrace();\n\t\t} finally {\n\n\t\t\tif (con != null) {\n\t\t\t\ttry {\n\t\t\t\t\tcon.close();\n\t\t\t\t} catch (SQLException e) {\n\t\t\t\t\te.printStackTrace();\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (pstmt != null) {\n\t\t\t\ttry {\n\t\t\t\t\tpstmt.close();\n\t\t\t\t} catch (SQLException e) {\n\t\t\t\t\te.printStackTrace();\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (rs != null) {\n\t\t\t\ttry {\n\t\t\t\t\trs.close();\n\t\t\t\t} catch (SQLException e) {\n\t\t\t\t\te.printStackTrace();\n\t\t\t\t}\n\t\t\t}\n\n\t\t}\n\n\t\treturn productdetails;\n\t}", "Product getPProducts();", "public List<Product> getProducts() {\n Connection connection = null;\n Statement statement = null;\n ResultSet resultSet = null;\n List<Product> products = new ArrayList<>(); //creating an array\n String sql=\"select * from products order by product_id\"; //writing sql statement\n try {\n connection = db.getConnection();\n statement = connection.createStatement();\n resultSet = statement.executeQuery(sql);\n while (resultSet.next()) { //receive data from database\n products.add(new Product( resultSet.getInt(1), resultSet.getString(2), resultSet.getInt(3),\n resultSet.getString(4),resultSet.getString(5),resultSet.getString(6),\n resultSet.getString(7), resultSet.getString(8))); //creating object of product and\n // inserting it into an array\n }\n return products; //return this array\n } catch (SQLException | ClassNotFoundException throwable) {\n throwable.printStackTrace();\n } finally {\n try {\n assert resultSet != null;\n resultSet.close();\n statement.close();\n connection.close();\n } catch (SQLException throwable) {\n throwable.printStackTrace();\n }\n }\n return null;\n }", "List<Product> retrieveProducts();", "private void demoSellProducts()\n {\n System.out.println(\"\\nSelling all the products\\n\");\n System.out.println(\"============================\");\n System.out.println();\n for(int id = 101; id <= 110; id++)\n {\n amount = generator.nextInt(20);\n manager.sellProduct(id, amount);\n }\n \n manager.printAllProducts();\n }", "@Override\r\n\tpublic List<Product> findProduct() {\n\t\treturn iImportSalesRecordDao.findProduct();\r\n\t}", "public List<Product> getFullProductList(){\n\t\t/*\n\t\t * La lista dei prodotti da restituire.\n\t\t */\n\t\tList<Product> productList = new ArrayList<Product>();\n\t\t\n\t\t/*\n\t\t * Preleviamo il contenuto della tabella PRODOTTO.\n\t\t */\n\t\tStatement productStm = null;\n\t\tResultSet productRs = null;\n\t\t\n\t\ttry{\n\t\t\tproductStm = connection.createStatement();\n\t\t\tString sql = \"SELECT * FROM PRODOTTO;\";\n\t\t\tproductRs = productStm.executeQuery(sql);\n\t\t}\n\t\tcatch(SQLException sqle){\n\t\t\tSystem.out.println(\"DB issue: failed to retrive product data from database.\");\n\t\t\tSystem.out.println(sqle.getClass().getName() + \": \" + sqle.getMessage());\n\t\t}\n\t\t\n\t\ttry{\n\t\t\tproductList = this.getProductListFromRs(productRs);\n\t\t\tproductStm.close(); // Chiude anche il ResultSet productRs\n\t\t\tConnector.releaseConnection(connection);\n\t\t}\n\t\tcatch(SQLException sqle){\n\t\t\tSystem.out.println(\"ResultSet issue 2: failed to retrive data from ResultSet.\\n\");\n\t\t\tSystem.out.println(sqle.getClass().getName() + \": \" + sqle.getMessage());\n\t\t}\n\t\t\n\t\treturn productList;\n\t}", "public List<Product> getAll() {\n List<Product> list = new ArrayList<>();\n String selectQuery = \"SELECT * FROM \" + PRODUCT_TABLE;\n SQLiteDatabase database = this.getReadableDatabase();\n try (Cursor cursor = database.rawQuery(selectQuery, null)) {\n if (cursor.moveToFirst()) {\n do {\n int id = cursor.getInt(0);\n String name = cursor.getString(1);\n String url = cursor.getString(2);\n double current = cursor.getDouble(3);\n double change = cursor.getDouble(4);\n String date = cursor.getString(5);\n double initial = cursor.getDouble(6);\n Product item = new Product(name, url, current, change, date, initial, id);\n list.add(item);\n }\n while (cursor.moveToNext());\n }\n }\n return list;\n }", "private List<ProductView> fetchProducts(String developerId) {\n LOG.debug(\"Enter. developerId: {}.\", developerId);\n\n List<Product> products = productService.getByDeveloperId(developerId);\n\n List<ProductView> result = ProductMapper.toView(products);\n\n List<String> productIds = products.stream().map(Product::getId).collect(Collectors.toList());\n\n Map<String, List<ProductDataView>> productDataViews =\n restClient.getProductData(developerId, productIds);\n\n mergeProductData(result, productDataViews);\n\n cacheApplication.cacheProducts(developerId, result);\n\n LOG.trace(\"Product: {}.\", result);\n LOG.debug(\"Exit. product size: {}.\", result.size());\n\n return result;\n }", "public ArrayList<Product> viewAllProduct() throws ProductException{\r\n\t\t\tArrayList<Product> products=new ArrayList<Product>();\r\n\t\t\tif(ProductRepository.productsList.isEmpty()) {\r\n\t\t\t\tthrow new ProductException(\"there are no products in the store\");\r\n\t\t\t\t\r\n\t\t\t}else {\r\n\t\t\t\r\n\t\t\tproducts.addAll(pDoa.viewProductsDoa());\r\n\t\t\t\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\t\r\n\t\t\treturn products;\r\n\t\t\t\r\n\t\t\t\r\n\t\t\t\r\n\t\t\t\r\n\t\t\t\r\n\t\t}", "public List<ProductWithSupplierTO> getAllProducts(long storeID) throws NotInDatabaseException;", "List<Product> getAllProducts();", "List<Product> getAllProducts();", "List<Product> getAllProducts();", "public static List<Product> openInventoryDatabase() {\r\n\t\tdbConnect();\r\n\t\tStatement stmt = null;\r\n\t\tResultSet rs = null;\r\n\t\tList<Product> prods = new ArrayList<>();\r\n\t\ttry {\r\n\t\t\tstmt = conn.createStatement();\r\n\t\t\trs = stmt.executeQuery(GET_PRODUCTS_FROM_DB);\r\n\t\t\twhile (rs.next()) {\r\n\t\t\t\tint productCode = rs.getInt(\"product_code\");\r\n\t\t\t\tString productName = rs.getString(\"product_name\");\r\n\t\t\t\tString productUnit = rs.getString(4);\r\n\t\t\t\tString productDescription = rs.getString(5);\r\n\t\t\t\tdouble priceForPurchase = rs.getDouble(6);\r\n\t\t\t\tdouble priceForSales = rs.getDouble(7);\r\n\t\t\t\tint stockQuantity = rs.getInt(8);\r\n\t\t\t\tprods.add(new Product(productCode, productName, productUnit, productDescription, priceForPurchase,\r\n\t\t\t\t\t\tpriceForSales, stockQuantity));\r\n\t\t\t}\r\n\t\t\tstmt.close();\r\n\t\t\trs.close();\r\n\t\t} catch (SQLException e) {\r\n\t\t\te.printStackTrace();\r\n\t\t\treturn null;\r\n\t\t}\r\n\t\t// dbClose();\r\n\t\treturn prods;\r\n\t}", "public List<Product> readAll() {\n\t\treturn null;\n\t}", "@GetMapping(\"/getproduct\")\n\t\tpublic List<Product> getAllProduct() {\n\t\t\tlogger.info(\"products displayed\");\n\t\t\treturn productService.getAllProduct();\n\t\t}", "@Override\r\n\tpublic List<Product> showAll() throws Exception {\n\t\treturn this.dao.showAll();\r\n\t}", "@ServiceMethod(name = \"FetchStoreProduct\")\r\n\tpublic IResponseHandler fetchStoreProduct()\r\n\t{\t\r\n\t\tStoreProductOutDTO outDTO = new StoreProductOutDTO();\r\n\t\t\r\n\t\tList<StoreProduct> sps= StoreProductDAO.getInstance(getSession()).readStoresProduct();\r\n\t\t\r\n\t\tfor(StoreProduct sp : sps)\r\n\t\t{\r\n\t\t\tStoreProductDTO dto = new StoreProductDTO();\r\n\t\t\t\r\n\t\t\toutDTO.getStoreProducts().add(dto.assemble(sp));\r\n\t\t}\r\n\t\t\r\n\t\tStoreService storeService = (StoreService)newInstance(new StoreService());\r\n\t\toutDTO.setStores((StoreOutDTO)storeService.fetchStore());\r\n\t\t\r\n\t\tProductService productService = (ProductService)newInstance(new ProductService());\r\n\t\toutDTO.setProducts((ProductOutDTO)productService.fetchProduct());\r\n\t\t\r\n\t\treturn outDTO;\r\n\t}", "@SuppressWarnings(\"unchecked\")\r\n\t@Override\r\n\tpublic ProductResponseModel getAllProduct() {\n\r\n\t\tProductResponseModel productResponseModel = new ProductResponseModel();\r\n\r\n\t\tMap<String, Object> map = productRepositoryImpl.getAllProduct();\r\n\r\n\t\t// productResponseModel.setCount((long) map.get(\"count\"));\r\n\t\tList<Product> product = (List<Product>) map.get(\"data\");\r\n\t\tList<ProductModel> productList = product.stream().map(p -> new ProductModel(p.getId(), p.getProName(),\r\n\t\t\t\tp.getProPrice(), p.getProQuantity(), p.getProDescription(), p.getProSize()))\r\n\t\t\t\t.collect(Collectors.toList());\r\n\r\n\t\tproductResponseModel.setData(productList);\r\n\r\n\t\treturn productResponseModel;\r\n\t}", "public static ArrayList<Product> selectProducts() {\n \n ArrayList<Product> products = new ArrayList<>();\n ConnectionPool pool = ConnectionPool.getInstance();\n Connection connection = pool.getConnection();\n PreparedStatement ps = null;\n PreparedStatement ps2 = null;\n ResultSet rs = null;\n ResultSet rs2 = null;\n int count = 0;\n\n String query = \"SELECT * FROM product ORDER BY catalogCategory, productName ASC \";\n \n String query2 = \"SELECT * FROM product\"; \n \n try {\n ps = connection.prepareStatement(query);\n ps2 = connection.prepareStatement(query2);\n rs = ps.executeQuery();\n rs2 = ps2.executeQuery();\n ResultSetMetaData mD = rs.getMetaData();\n int colCount = mD.getColumnCount();\n Product p = null;\n System.out.println(\"DBSetup@line448 \" + colCount);\n \n while( rs2.next() ) {\n ++count;\n } \n ///////For test purposes // System.out.println(\"DBSetup @ line 363 \" + count); \n for (int i = 0; i < count; i++) {\n if (rs.next()) {\n p = new Product();\n p.setProductCode(rs.getString(\"productCode\"));\n p.setProductName(rs.getString(\"productName\"));\n p.setCatalogCategory(rs.getString(\"catalogCategory\"));\n p.setDescription(rs.getString(\"description\"));\n p.setPrice(Float.parseFloat(rs.getString(\"price\")));\n p.setImageURL(rs.getString(\"imageURL\"));\n System.out.println(\"DBSetup @ line 461 \" + p.getProductCode());\n products.add(p);\n }\n }\n return products;\n } catch (SQLException e) {\n System.out.println(e);\n return null;\n } finally {\n DBUtil.closeResultSet(rs);\n DBUtil.closePreparedStatement(ps);\n pool.freeConnection(connection);\n }\n }", "List<Product> getAllProducts() throws PersistenceException;", "List<Product> getProductsList();", "public List<Product> getProducts();", "public List<Product> getProducts();", "private void viewProducts(){\n Database manager = new Database(this, \"Market\", null, 1);\n\n SQLiteDatabase market = manager.getWritableDatabase();\n\n Cursor row = market.rawQuery(\"select * from products\", null);\n\n if (row.getCount()>0){\n while(row.moveToNext()){\n listItem.add(row.getString(1));\n listItem.add(row.getString(2));\n listItem.add(row.getString(3));\n listItem.add(row.getString(4));\n }\n adapter = new ArrayAdapter(\n this, android.R.layout.simple_list_item_1, listItem\n );\n productList.setAdapter(adapter);\n } else {\n Toast.makeText(this, \"No hay productos\", Toast.LENGTH_SHORT).show();\n }\n }", "public List<Product> getAllProducts() {\n List<Product> listProduct= productBean.getAllProducts();\n return listProduct;\n }", "@Override\n\tpublic List<Product> getAll() throws SQLException {\n\t\treturn null;\n\t}", "@Override\n public List getAllSharingProduct() {\n \n List sharingProducts = new ArrayList();\n SharingProduct sharingProduct = null;\n Connection connection = null;\n PreparedStatement preparedStatement = null;\n ResultSet result = null;\n try {\n connection = MySQLDAOFactory.createConnection();\n preparedStatement = connection.prepareStatement(Read_All_Query);\n preparedStatement.execute();\n result = preparedStatement.getResultSet();\n \n while (result.next()) {\n sharingProduct = new SharingProduct(result.getString(1), result.getInt(2) );\n sharingProducts.add(sharingProduct);\n }\n } catch (SQLException e) {\n e.printStackTrace();\n } finally {\n try {\n result.close();\n } catch (Exception rse) {\n rse.printStackTrace();\n }\n try {\n preparedStatement.close();\n } catch (Exception sse) {\n sse.printStackTrace();\n }\n try {\n connection.close();\n } catch (Exception cse) {\n cse.printStackTrace();\n }\n }\n \n return sharingProducts;\n }", "@Override\n\tpublic List<Products> getAllProduct() {\n\t\treturn dao.getAllProduct();\n\t}", "@Override\n\tpublic List<Product> findAll() {\n\t\tConnection conn=null;\n\t\tPreparedStatement pst=null;\n\t\tResultSet rs=null;\n\t\t\n\t\tList<Product> list=new ArrayList<Product>();\n\t\ttry {\n\t\t\tconn=DBUtils.getConnection();\n\t\t\tpst=conn.prepareStatement(\"select id,category_id,name,Subtitle,main_image,sub_images,detail,price,stock,status,create_time,update_time from product\");\n\t\t\t\n\t\t\trs=pst.executeQuery();\n\t\t while(rs.next()) {\n\t\t \t Product product =new Product(rs.getInt(\"id\"),rs.getInt(\"category_id\"),rs.getString(\"name\"),rs.getString(\"Subtitle\"),rs.getString(\"main_image\"),rs.getString(\"sub_images\"),rs.getString(\"detail\"),rs.getBigDecimal(\"price\"),rs.getInt(\"stock\"),rs.getInt(\"status\"),rs.getDate(\"create_time\"),rs.getDate(\"update_time\"));\n\t\t \t list.add(product);\n\t\t \t \n\t\t } \n\t\t\t\n\t\t\t\n\t\t} catch (SQLException e) {\n\t\t\t// TODO Auto-generated catch block\n\t\t\te.printStackTrace();\n\t\t}finally {\n\t\t\ttry {\n\t\t\t\tDBUtils.Close(conn, pst, rs);\n\t\t\t} catch (SQLException e) {\n\t\t\t\t// TODO Auto-generated catch block\n\t\t\t\te.printStackTrace();\n\t\t\t}\n\t\t}\n\t\t\n\t\t\n\t\treturn list;\n\t}", "@RequestMapping(value = \"/displayallproducts\",method=RequestMethod.POST)\r\n\tList<ProductBean> displayAllProducts() throws ProductNotFoundException {\r\n\t\t\r\n\t\t//try {\r\n\t\t\treturn service.displayAllProducts();\r\n\t\t//} catch (ProductNotFoundException e) {\r\n\t\t\t//throw e;\r\n\t\t//}\r\n\t\t\r\n\t}", "private List<Product> extractProducts() {\r\n\t\t//load products from hidden fields\r\n\t\tif (this.getListProduct() != null){\r\n\t\t\tfor(String p : this.getListProduct()){\r\n\t\t\t\tProduct product = new Product();\r\n\t\t\t\tproduct.setId(Long.valueOf(p));\r\n\t\t\t\tthis.products.add(product);\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\treturn this.products;\r\n\t}", "public List<Product> getProductList(){\n List<Product> productList = mongoDbConnector.getProducts();\n return productList;\n }", "public static void display(){\n\n try {\n Connection myConnection = ConnectionFactory.getConnection();\n Statement stat = myConnection.createStatement();\n ResultSet rs = stat.executeQuery(\"SELECT * from product\");\n\n System.out.println(\"PRODUCT\");\n while(rs.next()){\n\n System.out.println(rs.getInt(\"id\") + \", \" + rs.getString(\"quantity\") + \", \" + rs.getString(\"productName\") + \", \" + rs.getDouble(\"price\")+ \", \" + rs.getString(\"deleted\"));\n }\n } catch (SQLException e) {\n e.printStackTrace();\n }\n System.out.println();\n\n }", "@Override\n\tpublic List<Product> getAllProduct() {\n\t\treturn productRepository.findAll();\n\t}", "@Override\n\tpublic List<Product> getAllProduct() {\n\t\treturn productRepository.findAll();\n\t}", "private void loadProducts() {\n\t\tproduct1 = new Product();\n\t\tproduct1.setId(1L);\n\t\tproduct1.setName(HP);\n\t\tproduct1.setDescription(HP);\n\t\tproduct1.setPrice(BigDecimal.TEN);\n\n\t\tproduct2 = new Product();\n\t\tproduct2.setId(2L);\n\t\tproduct2.setName(LENOVO);\n\t\tproduct2.setDescription(LENOVO);\n\t\tproduct2.setPrice(new BigDecimal(20));\n\n\t}", "public com.sybase.collections.GenericList<ru.terralink.mvideo.sap.Products> getOrdersProductss()\n {\n return getOrdersProductss(false,false);\n }", "public List<Product> getAll() {\n\t\treturn productRepository.findAll();\n\n\t}", "public List<Product> getAllProducts()\n {\n SQLiteDatabase db = this.database.getWritableDatabase();\n\n // Creates a comma-separated string of all columns in the shopping list table\n String values = TextUtils.join(\", \", ShoppingListTable.COLUMNS);\n\n // Constructs the SQL query\n String sql = String.format(\"SELECT %s FROM %s\", values, ShoppingListTable.TABLE_NAME);\n\n Cursor query = db.rawQuery(sql, null);\n\n Product product = null;\n List<Product> products = new ArrayList<>();\n\n // Check whether there are any products\n if (query.moveToFirst())\n {\n do\n {\n int tpnb = Integer.parseInt(query.getString(0));\n String name = query.getString(1);\n String description = query.getString(2);\n float cost = Float.parseFloat(query.getString(3));\n float quantity = Float.parseFloat(query.getString(4));\n String superDepartment = query.getString(5);\n String department = query.getString(6);\n String imageURL = query.getString(7);\n Boolean isChecked = query.getString(8).equals(\"1\");\n int amount = Integer.parseInt(query.getString(9));\n int position = Integer.parseInt(query.getString(10));\n\n product = new Product(tpnb, name, description, cost, quantity, superDepartment, department, imageURL);\n\n product.setChecked(isChecked);\n product.setAmount(amount);\n product.setPosition(position);\n\n products.add(product);\n }\n while (query.moveToNext());\n }\n\n return products;\n }", "public List<Object> getProductSKU(NpProduct beanParam) {\r\n \r\n Connection conn=null;\r\n String storedProcedure;\r\n CallableStatement stmt=null;\r\n String av_message; \r\n \r\n ResultSet rs = null;\r\n av_message = null;\r\n storedProcedure = \"begin NpProduct_PKG.SP_GET_NpProductSKU_LST(?,?,?); end;\";\r\n List<Object> lstAllEntities = new ArrayList<Object>();\r\n try{\r\n conn = ConnectionDB.getConnection();\r\n stmt = conn.prepareCall(storedProcedure);\r\n\r\n //Se registra el parámetro de salida\r\n stmt.registerOutParameter(2, OracleTypes.VARCHAR);\r\n stmt.registerOutParameter(3, OracleTypes.CURSOR);\r\n //Se configuran los demás parámetros del stored\r\n stmt = configureProductSKU(stmt,beanParam.getNpproductid());\r\n\r\n //Se ejecuta el statement\r\n stmt.execute();\r\n\r\n //Se obtiene la respuesta error/exito del stored\r\n av_message = (String)stmt.getObject(2);\r\n boolean resultado=false;\r\n resultado=this.handleErrorResult(av_message);\r\n\r\n if(resultado){\r\n //Se obtiene el objeto del cursor\r\n rs = (ResultSet)stmt.getObject(3);\r\n\r\n while(rs.next()){\r\n Object npAddress = setEntityAttributes(rs);\r\n lstAllEntities.add(npAddress);\r\n }\r\n }else{\r\n logger.error(\"[NPProductDAO][Metodo: getProductSKU][SP: \"+storedProcedure+\"][MensajeError: \"+av_message+\"]\");\r\n }\r\n\r\n \r\n }catch (Exception e){\r\n throw new UnhandledException( \"getProductSKU [ \"+ Constant.PARAMETER_ERROREXCEPTION +\" ] \"+ e.getMessage(),e);\r\n }finally{\r\n //Se limpian las variables de conexión\r\n ConnectionDB.close(conn, rs, stmt);\r\n }\r\n return(lstAllEntities);\r\n }", "public void ListAllProduct() {\r\n\t\t\tSystem.out.println(\" *************from inside ListAllProduct()********************** \");\r\n\t\t\tTransaction tx = null;\r\n\t\t\ttry {\r\n\r\n\t\t\t\tsessionObj = HibernateUtil.buildSessionFactory().openSession();\r\n\t\t\t\ttx = sessionObj.beginTransaction();\r\n\t\t\t\t// retrive logic\r\n\t\t\t\tList products = sessionObj.createQuery(\"From Product\").list(); // select * from employee: \"Employee refer\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// Employee class\r\n\t\t\t\tIterator iterator = products.iterator();\r\n\t\t\t\twhile (iterator.hasNext()) {\r\n\t\t\t\t\tProduct product1 = (Product) iterator.next();\r\n\t\t\t\t\tSystem.out.println(\"Product Category \" + product1.getProductCategory());\r\n\t\t\t\t\tSystem.out.println(\"Product Description\" + product1.getProductDescription());\r\n\t\t\t\t\tSystem.out.println(\"Product Manufacturer \" + product1.getProductManufacturer());\r\n\t\t\t\t\tSystem.out.println(\"Product Name \"+product1.getProductName());\r\n\t\t\t\t\tSystem.out.println(\"Product Price \"+product1.getProductPrice());\r\n\t\t\t\t\tSystem.out.println(\"Product Unit \"+product1.getProductUnit());\r\n\t\t\t\t\t\r\n\t\t\t\t}\r\n\r\n\t\t\t\ttx.commit();// explictiy call the commit esure that auto commite should be false\r\n\t\t\t} catch (\r\n\r\n\t\t\tHibernateException e) {\r\n\t\t\t\tif (tx != null)\r\n\t\t\t\t\ttx.rollback();\r\n\t\t\t\te.printStackTrace();\r\n\t\t\t} finally {\r\n\t\t\t\tsessionObj.close();\r\n\t\t\t}\r\n\t\t}", "@Override\r\n\tpublic List prodStockseach() {\n\t\treturn adminDAO.seachProdStock();\r\n\t}", "public ArrayList<ItemModel> getAllProducts() {\n ArrayList<ItemModel> products = new ArrayList<ItemModel>();\n SQLiteDatabase db = DBHelper.getReadableDatabase();\n Cursor c = db.rawQuery(\"SELECT * FROM \" + DBHelper.TABLE_SHOPPINGLIST, null);\n\n c.moveToFirst();\n Log.d(DatabaseHelper.class.getName(), \"getAllProducts:\");\n\n while (!c.isAfterLast()) {\n String product = String.valueOf(c.getInt(c.getColumnIndex(DBHelper.SHOPPINGLIST_PID)));\n String quantity=String.valueOf(c.getDouble(c.getColumnIndex(DBHelper.SHOPPINGLIST_QUANTITY)));\n String unit = String.valueOf(c.getString(c.getColumnIndex(DBHelper.SHOPPINGLIST_UNIT)));\n int che = c.getInt(c.getColumnIndex(DBHelper.SHOPPINGLIST_CHECKMARK));\n boolean check;\n if (che==0) {check=Boolean.FALSE;} else {check = Boolean.TRUE;}\n\n ItemModel model = new ItemModel(product, quantity, unit, check);\n products.add(model);\n\n\n c.moveToNext();\n }\n\n db.close();\n\n for (ItemModel ph: products) {\n ph.setProduct(getNameByPID(Integer.parseInt(ph.getProductName())));\n Log.d(DatabaseHelper.class.getName(), \"\\tgetAllProducts:\" + ph.toString());\n }\n\n return products;\n }", "public ArrayList<String> getSellers(String productName);", "public Set<ProductData> getAllProductData() {\n\t\tSet<ProductData> data = new HashSet<>();\n\n\t\t//Read ERP.txt file\n\t\ttry (Scanner reader = new Scanner(SupplierIntegrator.class.getResourceAsStream(\"ERP.txt\"))) {\n\t\t\twhile (reader.hasNextLine()) {\n\t\t\t\t//Read each line. Skip it, if it begins with the comment symbol '#'\n\t\t\t\tString line = reader.nextLine();\n\t\t\t\tif (line.startsWith(\"#\")) continue;\n\n\t\t\t\t//Read the information from the line using a new scanner with ':' as its delimiter\n\t\t\t\tScanner lineReader = new Scanner(line);\n\t\t\t\tlineReader.useDelimiter(\":\");\n\t\t\t\tint id = lineReader.nextInt();\n\t\t\t\tString name = lineReader.next();\n\t\t\t\tdouble price = lineReader.nextDouble();\n\n\t\t\t\t//Add product data\n\t\t\t\tdata.add(new ProductData(id, name, price));\n\t\t\t}\n\t\t}\n\n\t\treturn data;\n\t}", "private static void VeureProductes (BaseDades bd) {\n ArrayList <Producte> llista = new ArrayList<Producte>();\n llista = bd.consultaPro(\"SELECT * FROM PRODUCTE\");\n if (llista != null)\n for (int i = 0; i<llista.size();i++) {\n Producte p = (Producte) llista.get(i);\n System.out.println(\"ID=>\"+p.getIdproducte()+\": \"\n +p.getDescripcio()+\"* Estoc: \"+p.getStockactual()\n +\"* Pvp: \"+p.getPvp()+\" Estoc Mínim: \"\n + p.getStockminim());\n }\n }", "@Override\r\n\tpublic List<Product> getallProducts() {\n\t\treturn dao.getallProducts();\r\n\t}", "public Product getProductInfo(int pid) {\nfor (ProductStockPair pair : productCatalog) {\nif (pair.product.id == pid) {\nreturn pair.product;\n}\n}\nreturn null;\n}", "@Override\r\n\tpublic List prodAllseach() {\n\t\treturn adminDAO.seachProdAll();\r\n\t}", "public ArrayList<ProductDetail> readAllCart() {\n db = helper.getReadableDatabase();\n ArrayList<ProductDetail> list = new ArrayList<>();\n Cursor cursor = db.rawQuery(\"select * from \" + DatabaseConstant.TABLE_NAME_CART, null);\n while (cursor.moveToNext()) {\n String id = cursor.getString(0);\n String title = cursor.getString(1);\n String price = cursor.getString(2);\n String order_quantity = cursor.getString(3);\n String quantity_type = cursor.getString(4);\n String min_quantity = cursor.getString(5);\n String availability = cursor.getString(6);\n String discount = cursor.getString(7);\n String image = cursor.getString(8);\n String rating = cursor.getString(9);\n String description = cursor.getString(10);\n String type = cursor.getString(11);\n int qty = cursor.getInt(12);\n\n list.add(new ProductDetail(id, title, description, price, order_quantity, quantity_type, min_quantity, availability, discount,\n image, rating,type, qty));\n }\n return list;\n }", "private void printAllProducts()\n {\n manager.printAllProducts();\n }", "private void fetchProducts() {\n\t\t// Showing progress dialog before making request\n\n\t\tpDialog.setMessage(\"Fetching products...\");\n\n\t\tshowpDialog();\n\n\t\t// Making json object request\n\t\tJsonObjectRequest jsonObjReq = new JsonObjectRequest(Method.GET,\n\t\t\t\tConfig.URL_PRODUCTS, null, new Response.Listener<JSONObject>() {\n\n\t\t\t\t\t@Override\n\t\t\t\t\tpublic void onResponse(JSONObject response) {\n\t\t\t\t\t\tLog.d(TAG, response.toString());\n\n\t\t\t\t\t\ttry {\n\t\t\t\t\t\t\tJSONArray products = response\n\t\t\t\t\t\t\t\t\t.getJSONArray(\"products\");\n\n\t\t\t\t\t\t\t// looping through all product nodes and storing\n\t\t\t\t\t\t\t// them in array list\n\t\t\t\t\t\t\tfor (int i = 0; i < products.length(); i++) {\n\n\t\t\t\t\t\t\t\tJSONObject product = (JSONObject) products\n\t\t\t\t\t\t\t\t\t\t.get(i);\n\n\t\t\t\t\t\t\t\tString id = product.getString(\"id\");\n\t\t\t\t\t\t\t\tString name = product.getString(\"name\");\n\t\t\t\t\t\t\t\tString description = product\n\t\t\t\t\t\t\t\t\t\t.getString(\"description\");\n\t\t\t\t\t\t\t\tString image = product.getString(\"image\");\n\t\t\t\t\t\t\t\tBigDecimal price = new BigDecimal(product\n\t\t\t\t\t\t\t\t\t\t.getString(\"price\"));\n\t\t\t\t\t\t\t\tString sku = product.getString(\"sku\");\n\n\t\t\t\t\t\t\t\tProduct p = new Product(id, name, description,\n\t\t\t\t\t\t\t\t\t\timage, price, sku);\n\n\t\t\t\t\t\t\t\tproductsList.add(p);\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t// notifying adapter about data changes, so that the\n\t\t\t\t\t\t\t// list renders with new data\n\t\t\t\t\t\t\tadapter.notifyDataSetChanged();\n\n\t\t\t\t\t\t} catch (JSONException e) {\n\t\t\t\t\t\t\te.printStackTrace();\n\t\t\t\t\t\t\tToast.makeText(getApplicationContext(),\n\t\t\t\t\t\t\t\t\t\"Error: \" + e.getMessage(),\n\t\t\t\t\t\t\t\t\tToast.LENGTH_LONG).show();\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t// hiding the progress dialog\n\t\t\t\t\t\thidepDialog();\n\t\t\t\t\t}\n\t\t\t\t}, new Response.ErrorListener() {\n\n\t\t\t\t\t@Override\n\t\t\t\t\tpublic void onErrorResponse(VolleyError error) {\n\t\t\t\t\t\tVolleyLog.d(TAG, \"Error: \" + error.getMessage());\n\t\t\t\t\t\tToast.makeText(getApplicationContext(),\n\t\t\t\t\t\t\t\terror.getMessage(), Toast.LENGTH_SHORT).show();\n\t\t\t\t\t\t// hide the progress dialog\n\t\t\t\t\t\thidepDialog();\n\t\t\t\t\t}\n\t\t\t\t});\n\n\t\t// Adding request to request queue\n\t\tAppController.getInstance().addToRequestQueue(jsonObjReq);\n\t}", "private void get_products_search()\r\n\r\n {\n MakeWebRequest.MakeWebRequest(\"get\", AppConfig.SALES_RETURN_PRODUCT_LIST,\r\n AppConfig.SALES_RETURN_PRODUCT_LIST + \"[\" + Chemist_ID + \",\"+client_id +\"]\", this, true);\r\n\r\n// MakeWebRequest.MakeWebRequest(\"out_array\", AppConfig.SALES_RETURN_PRODUCT_LIST, AppConfig.SALES_RETURN_PRODUCT_LIST,\r\n// null, this, false, j_arr.toString());\r\n //JSONArray jsonArray=new JSONArray();\r\n }", "public void getProducts(String eId){\n // invoke getProductsById from ProductDatabse and assign products, productIds and productNames\n products = myDb.getProductsById(eId);\n productIds = new ArrayList<Integer>();\n ArrayList<String> productNames = new ArrayList<String>();\n for(Product product: products){\n productIds.add(Integer.parseInt(product.getProductId()));\n productNames.add(product.getProductName());\n }\n //if products exists in database then its displayed as a list else no products message is displayed\n if(products.size() > 0){\n productsadded.setVisibility(View.VISIBLE);\n noproducts.setVisibility(View.GONE);\n }else{\n productsadded.setVisibility(View.GONE);\n noproducts.setVisibility(View.VISIBLE);\n }\n otherProductAdapter = new ArrayAdapter<String>(this,\n android.R.layout.simple_expandable_list_item_1, productNames);\n otherProductsList.setAdapter(otherProductAdapter);\n if(productNames.size() > 0){\n //invoked on click of the product\n otherProductsList.setOnItemClickListener(new AdapterView.OnItemClickListener() {\n @Override\n public void onItemClick(AdapterView<?> parent, View view, int position, long id) {\n Intent intent = new Intent(OtherEventsProductsActivity.this, PurchaseProductActivity.class);\n intent.putExtra(\"eventId\", eventId);\n intent.putExtra(\"productId\", \"\"+productIds.get(position));\n intent.putExtra(\"status\", \"view\");\n startActivity(intent);\n }\n });\n }\n }", "@Override\r\n\tpublic List<PayedProduct> getAllInfoProduct(String pname) {\n\t\tList<PayedProduct> list=null;\r\n\t\ttry {\r\n\t\t\tString sql=\"SELECT * FROM payedproduct WHERE payedproduct_name LIKE CONCAT('%',?,'%')\";\r\n\t\t\treturn qr.query(sql, new BeanListHandler<PayedProduct>(PayedProduct.class),pname);\r\n\t\t} catch (Exception e) {\r\n\t\t\t// TODO: handle exception\r\n\t\t\te.printStackTrace();\r\n\t\t}\r\n\t\treturn list;\r\n\t}", "@Override\r\n\tpublic List<Product> getAllProducts() {\n\t\treturn dao.getAllProducts();\r\n\t}", "@Override\r\n public void getProduct() {\r\n\r\n InventoryList.add(new Product(\"Prod1\", \"Shirt\", \"Each\", 10.0, LocalDate.of(2021,03,19)));\r\n InventoryList.add(new Product(\"Prod1\", \"Trousers\", \"Each\", 20.0, LocalDate.of(2021,03,21)));\r\n InventoryList.add(new Product(\"Prod1\", \"Trousers\", \"Each\", 20.0, LocalDate.of(2021,03,29)));\r\n }", "@Override\n public Iterable<Product> findAllProduct() {\n return productRepository.findAll();\n }", "List<PurchaseLine> getAllPurchaseOrderOfProduct(long prodId);", "@Override\n\t@Transactional\n\tpublic List<Product> getAllProducts() {\n\t\treturn (List<Product>)productDAO.findAll();\n\t\t\n\t}", "List<PriceInformation> getPriceForProduct(ProductModel product);", "private List<Product> getProductListFromRs(ResultSet productRs) throws SQLException {\n\t\t/*\n\t\t * Preleviamo il contenuto della tabella COMPOSIZIONE e lo inseriamo in una\n\t\t * struttura associativa in cui la chiave è un codice prodotto (univoco) e\n\t\t * e il valore è la lista dei materiali di cui il prodotto è composto.\n\t\t */\n\t\tStatement compositionStm = null;\n\t\tResultSet compositionRs = null;\n\t\tMap<Integer,List<String>> materialsMap = new HashMap<Integer,List<String>>();\n\t\ttry{\n\t\t\tcompositionStm = connection.createStatement();\n\t\t\tString sql = \"SELECT * FROM COMPOSIZIONE;\";\n\t\t\tcompositionRs = compositionStm.executeQuery(sql);\n\t\t\t\n\t\t\twhile(compositionRs.next()){\n\t\t\t\tInteger codiceProdotto = compositionRs.getInt(\"CODICEPRODOTTO\");\n\t\t\t\tif(materialsMap.containsKey(codiceProdotto)){\n\t\t\t\t\tmaterialsMap.get(codiceProdotto).add(compositionRs.getString(\"MATERIALE\"));\n\t\t\t\t}\n\t\t\t\telse{\n\t\t\t\t\tArrayList<String> newMaterialList = new ArrayList<String>();\n\t\t\t\t\tnewMaterialList.add(compositionRs.getString(\"MATERIALE\"));\n\t\t\t\t\tmaterialsMap.put(compositionRs.getInt(\"CODICEPRODOTTO\"), newMaterialList);\n\t\t\t\t}\n\t\t\t}\n\t\t\tcompositionStm.close(); // Chiude anche il ResultSet compositionRs\n\t\t}\n\t\tcatch(SQLException sqle){\n\t\t\tSystem.out.println(\"DB issue: failed to retrive product data from database.\\n\");\n\t\t\tSystem.out.println(sqle.getClass().getName() + \": \" + sqle.getMessage());\n\t\t}\n\t\t\n\t\t/*\n\t\t * Produciamo la lista dei prodotti.\n\t\t */\n\t\tList<Product> productList = new ArrayList<Product>();\n\t\twhile(productRs.next()){\n\t\t\tProduct p = new Product();\n\t\t\tp.setCode(productRs.getInt(\"CODICE\")); //AUTOBOXING\n\t\t\tp.setName(productRs.getString(\"NOMEPRODOTTO\"));\n\t\t\tp.setLine(productRs.getString(\"LINEA\"));\n\t\t\tp.setType(productRs.getString(\"TIPO\"));\n\t\t\tp.setImages(productRs.getString(\"IMMAGINI\"));\n\t\t\tp.setAvailableUnits(productRs.getInt(\"UNITADISPONIBILI\"));\n\t\t\t/*\n\t\t\t * getInt() returns:\n\t\t\t * the column value; if the value is SQL NULL, the value returned is 0\n\t\t\t */\n\t\t\tp.setMinInventory(productRs.getInt(\"SCORTAMINIMA\")); // 0 di default\n\t\t\tp.setPrice(productRs.getBigDecimal(\"PREZZOVENDITA\"));\n\t\t\tp.setCost(productRs.getBigDecimal(\"PREZZOACQUISTO\"));\n\t\t\t/*\n\t\t\t * SQLite non ha un tipo esplicito per le date. Il metodo getTimeStamp()\n\t\t\t * non riesce ad interprestare la data correttamente. Si utilizza\n\t\t\t * il metodo getString() anche se ci� non rappresenta la migliore pratica.\n\t\t\t */\n\t\t\tp.setInsertDate(LocalDateTime.parse(productRs.getString(\"DATAINSERIMENTO\")));\n\t\t\tp.setDescription(productRs.getString(\"DESCRIZIONE\"));\n\t\t\tp.setDeleted(productRs.getBoolean(\"ELIMINATO\"));\n\t\t\t\n\t\t\t// LocalDateTime.parse(null) or LocalDateTime.parse(\"\") would throw an exception\n\t\t\tif(productRs.getString(\"DATAELIMINAZIONE\") != null && !productRs.getString(\"DATAELIMINAZIONE\").equals(\"\")) {\n\t\t\t\tp.setDeletionDate(LocalDateTime.parse(productRs.getString(\"DATAELIMINAZIONE\")));\n\t\t\t}\n\t\t\t\n\t\t\t/*\n\t\t\t * Preleviamo dalla struttura dati associativa la lista dei materiali\n\t\t\t * di fabbricazione per il corrente prodotto e aggiorniamo il campo\n\t\t\t * relativo del bean \"Product\".\n\t\t\t */\n\t\t\ttry{\n\t\t\t\tp.setMaterials(materialsMap.get(productRs.getInt(\"CODICE\")));\n\t\t\t}\n\t\t\tcatch(ClassCastException cce){\n\t\t\t\tSystem.out.println(\"Map issue: key not comparable.\\n\");\n\t\t\t\tSystem.out.println(cce.getClass().getName() + \": \" + cce.getMessage());\n\t\t\t}\n\t\t\tcatch(NullPointerException npe){\n\t\t\t\tSystem.out.println(\"Map issue: invalid Key.\\n\");\n\t\t\t\tSystem.out.println(npe.getClass().getName() + \": \" + npe.getMessage());\n\t\t\t}\n\t\t\t\n\t\t\t/*\n\t\t\t * Aggiungiamo il prodotto alla lista.\n\t\t\t */\n\t\t\tproductList.add(p);\n\t\t}\n\t\t\n\t\treturn productList;\n\t}", "public List<productmodel> getproductbyname(String name);", "public void readPurchasedProducts()\r\n\t{\r\n\t\ttry\r\n\t\t{\r\n\t\t\tScanner reader = new Scanner(new FileReader(\"soldProducts.txt\"));\r\n\t\t\twhile (reader.hasNext())\r\n\t\t\t{\r\n\t\t\t\tSystem.out.println(reader.nextLine());\r\n\t\t\t}\r\n\t\t\treader.close();\r\n\t\t}\r\n\t\tcatch(FileNotFoundException e)\r\n\t\t{\r\n\t\t\tSystem.out.println(\"FileNotFoundException\");\r\n\t\t}\r\n\t}", "public void printAllProducts()\n {\n printHeading();\n \n for(Product product : stock)\n {\n System.out.println(product);\n }\n\n System.out.println();\n }", "List<PriceRow> getPriceInformationsForProduct(ProductModel model);", "@Override\r\n\tpublic List<Mobile> showAllProduct() {\n\t\tQuery query=entitymanager.createQuery(\"FROM Mobile\");\r\n\t\tList<Mobile> myProd=query.getResultList();\r\n\t\treturn myProd;\r\n\t}", "@CrossOrigin()\r\n @GetMapping(\"/products/all\")\r\n List<ProductEntity> getAllProducts() {\r\n // TODO add error if there are not enough products\r\n return productRepository.findAll();\r\n }", "@Override\r\n public List<Product> findAll() {\r\n return productRepository.findAll();\r\n }", "@SuppressWarnings(\"unchecked\")\n private void fetchProductInformation() {\n // Query the App Store for product information if the user is is allowed\n // to make purchases.\n // Display an alert, otherwise.\n if (SKPaymentQueue.canMakePayments()) {\n // Load the product identifiers fron ProductIds.plist\n String filePath = NSBundle.getMainBundle().findResourcePath(\"ProductIds\", \"plist\");\n NSArray<NSString> productIds = (NSArray<NSString>) NSArray.read(new File(filePath));\n\n StoreManager.getInstance().fetchProductInformationForIds(productIds.asStringList());\n } else {\n // Warn the user that they are not allowed to make purchases.\n alert(\"Warning\", \"Purchases are disabled on this device.\");\n }\n }", "@GetMapping(\"/view-all\")\r\n\tpublic List<ProductDetails> viewAllProducts() {\r\n\r\n\t\treturn productUtil.toProductDetailsList(productService.viewAllProducts());\r\n\t}", "@Override\n\tpublic List<ProductDTO> viewAllProducts() throws ProductException {\n\t\tCollection<Product> products = ProductStore.map.values();\n\t\tList<ProductDTO> list = new ArrayList();\n\n\t\tfor (Product product : products) {\n\t\t\tProductDTO product1 = ProductUtil.convertToProductDto(product);\n\t\t\tlist.add(product1);\n\t\t}\n\n\t\treturn list;\n\t}", "@Override\r\n\tpublic List<PayedProduct> getInfoProduct(int zid) {\n\t\tList<PayedProduct> list=null;\r\n\t\ttry {\r\n\t\t\tString sql=\"SELECT * FROM payedproduct WHERE PayedProduct_id =? \";\r\n\t\t\treturn qr.query(sql, new BeanListHandler<PayedProduct>(PayedProduct.class),zid);\r\n\t\t} catch (Exception e) {\r\n\t\t\t// TODO: handle exception\r\n\t\t}\r\n\t\treturn null;\r\n\t}", "public String productList(ProductDetails p);", "@Override\n\tpublic List<ProductInfo> getProducts() {\n\t\treturn shoppercnetproducts;\n\t}", "public List<Product> getAllProducts() {\n\t\tSession session = sessionFactory.getCurrentSession();\r\n\t\tQuery query = (Query) session.createQuery(\"from Product\");\r\n\t\tList<Product> products = query.list();\r\n\t\treturn products;\r\n\t}", "public List<Product> getProducts(ProductRequest request) throws IOException {\n if (request.isSingle()){\n List<Product> products = new ArrayList<>();\n products.add(parseResult(executeRequest(request),Product.class));\n return products;\n } else {\n return parseResults(executeRequest(request), Product.class);\n }\n }", "private void cargarProductos() {\r\n\t\tproductos = productoEJB.listarInventariosProductos();\r\n\r\n\t\tif (productos.size() == 0) {\r\n\r\n\t\t\tList<Producto> listaProductos = productoEJB.listarProductos();\r\n\r\n\t\t\tif (listaProductos.size() > 0) {\r\n\r\n\t\t\t\tMessages.addFlashGlobalWarn(\"Para realizar una venta debe agregar los productos a un inventario\");\r\n\r\n\t\t\t}\r\n\r\n\t\t}\r\n\r\n\t}", "private static void createProducts() {\n productRepository.addProduct(Product.builder()\n .name(\"Milk\")\n .barcode(new Barcode(\"5900017304007\"))\n .price(new BigDecimal(2.90))\n .build()\n );\n productRepository.addProduct(Product.builder()\n .name(\"Butter\")\n .barcode(new Barcode(\"5906217041483\"))\n .price(new BigDecimal(4.29))\n .build()\n );\n productRepository.addProduct(Product.builder()\n .name(\"Beer\")\n .barcode(new Barcode(\"5905927001114\"))\n .price(new BigDecimal(2.99))\n .build()\n );\n }", "public void printData () {\n System.out.println (products.toString ());\n }", "public List<Product> scrapeProducts() {\n\n // Create empty list for the products that are going to be fetched\n List<Product> foundProducts = new ArrayList<>();\n\n // Open the url\n getDriver().get(getWebStore().getURL());\n\n // Locate the overview of all products\n System.out.println(getWebStore().getURL());\n WebElement productsOverview = getDriver().findElement(By.cssSelector(getWebStore().getProductsOverviewSelector()));\n\n // Get all products per class\n List<WebElement> products = productsOverview.findElements(By.className(getWebStore().getProductSelector().substring(1)));\n\n // Create a new webScraper\n WebScraper productPage = new WebScraper();\n productPage.setDriver(new HtmlUnitDriver());\n\n // Loop thru all found products and scrape information that is needed\n for (WebElement product : products) {\n Product newProduct = new Product();\n\n try {\n // Set up the information that is already visible\n newProduct.setBrand(new Brand(webStore.getBrand()));\n\n // Find the redirect link\n newProduct.setRedirectURL(\n product.findElement(By.cssSelector(webStore.getProductURLSelector())).getAttribute(\"href\")\n );\n\n foundProducts.add(newProduct);\n } catch (Exception e) {\n // Show error message when something goes wrong\n System.out.printf(\"Something went wrong while fetching the products of the brand: %s\\n\", getWebStore().getBrand());\n e.printStackTrace();\n }\n }\n\n // Add additional data to the products by visiting their individual page\n for (Product foundProduct : foundProducts) {\n try {\n scrapeAdditionalDataOfProduct(foundProduct);\n } catch (Exception e) {\n System.out.printf(\"Something went wrong while fetching the products of the brand: %s\\n\", getWebStore().getBrand());\n }\n }\n\n for (int i = 0; i < foundProducts.size(); i++) {\n if (foundProducts.get(i).getName() == null) {\n foundProducts.remove(foundProducts.get(i));\n }\n }\n\n return foundProducts;\n }", "@Override\n\tpublic String toString() {\n\t\treturn \"Market [products=\" + products + \"]\";\n\t}", "@GetMapping(\"/findAllProduct\")\n @ResponseBody\n public ResponseEntity<List<ProductEntity>> findAllProduct() {\n List<ProductEntity> productResponse = productService.viewProduct();\n return new ResponseEntity<>(productResponse, HttpStatus.OK);\n }", "@Override\n\tpublic List<Product> getAll() {\n\t\tQuery query = session.createQuery(\"from Product \");\n\t\t\n\t\treturn query.getResultList();\n\t}", "public List<String> dispProduct(String id);", "private void fetchProducts() {\n Product p1 = new Product(R.drawable.aj1rls, \"Air Jordan 1 Retro Low Slip\", \"Đen/Trắng\", \"Nữ\", 8500000,7.5,\"Jordan\", 9);\n Product p2 = new Product(R.drawable.aj1rhp, \"Air Jordan 1 Retro High Premium\", \"Đen/Trắng\", \"Nữ\", 8500000,9.5,\"Jordan\", 8.7);\n Product p3 = new Product(R.drawable.nm2ktse, \"Nike M2k Tenko SE\", \"Đen/Trắng\", \"Nữ\", 8500000,8,\"Nike\", 8.6);\n Product p4 = new Product(R.drawable.nre55, \"Nike React Element 55\", \"Đen/Trắng\", \"Nữ\", 8500000,8.5,\"Nike\", 9);\n Product p5 = new Product(R.drawable.ncracp, \"NikeCourt Royale AC\", \"Đen/Trắng\", \"Nữ\", 8500000,7,\"Nike\", 8);\n Product p6 = new Product(R.drawable.namff720, \"Nike Air Max FF 720\", \"Đen/Trắng\", \"Nữ\", 8500000,7.5,\"Nike\", 9);\n Product p7 = new Product(R.drawable.nam90, \"Nike Air Max 90\", \"Đen/Trắng\", \"Nữ\", 8500000,7.5,\"Nike\", 9);\n Product p8 = new Product(R.drawable.nbmby, \"Nike Blazer Mid By You\", \"Đen/Trắng\", \"Nữ\", 8500000,7.5,\"Nike\", 9);\n Product p9 = new Product(R.drawable.nam270, \"Nike Air Max 270\", \"Đen/Trắng\", \"Nữ\", 8500000,7.5,\"Nike\", 9);\n Product p10 = new Product(R.drawable.ncclxf, \"Air Jordan 1 Retro Low Slip\", \"Đen/Trắng\", \"Nữ\", 8500000,7.5,\"Jordan\", 9);\n productList = new ArrayList<>(Arrays.asList(p1, p2, p3, p4, p5, p6, p7, p8, p9, p10));\n }", "@Override\n\tpublic List<Products> getProducts() {\n\t\tSession currentSession = sessionFactory.getCurrentSession();\n\n\t\t// create a query\n\t\tQuery<Products> theQuery = currentSession.createQuery(\"from Products order by id\", Products.class);\n\n\t\t// execute query and get result list\n\t\tList<Products> products = theQuery.getResultList();\n\n\t\t// return the results\n\t\treturn products;\n\n\t}", "public ArrayList<Product> getAllProducts(){\r\n\t\tArrayList<Product> prods = new ArrayList<Product>();\r\n\t\tIterator<Integer> productCodes = inventory.keySet().iterator();\r\n\t\twhile(productCodes.hasNext()) {\r\n\t\t\tint code = productCodes.next();\r\n\t\t\tfor(Product currProduct : Data.productArr) {\r\n\t\t\t\tif(currProduct.getID() == code) {\r\n\t\t\t\t\tprods.add(currProduct);\r\n\t\t\t\t\tbreak;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn prods;\r\n\t}", "@Override\r\n\tpublic List<Producto> getAll() throws Exception {\n\t\treturn productRepository.buscar();\r\n\t}", "public List<ProductView> getAllByDeveloperId(String developerId) {\n LOG.debug(\"Enter. developerId: {}.\", developerId);\n\n List<ProductView> result = cacheApplication.getProducts(developerId);\n\n if (result.isEmpty()) {\n LOG.debug(\"Cache fail, get from database.\");\n result = fetchProducts(developerId);\n }\n\n LOG.trace(\"products: {}.\", result);\n LOG.debug(\"Exit. product Size: {}.\", result.size());\n return result;\n }", "public ObservableList<Product> getAllProduct()\n {\n ObservableList<Product> product =FXCollections.observableArrayList();\n try {\n state = ConnectionDB.openConnection().createStatement();\n ResultSet result = state.executeQuery(\"SELECT * FROM product\");\n \n \n \n while(result.next())\n {\n // if define object out while will store last row n time\n Product pr = new Product(); \n pr.setId(result.getInt(1));\n pr.setName(result.getString(2));\n pr.setNumber(result.getInt(3));\n pr.setPrice(result.getInt(4));\n product.add(pr); \n }\n } catch (SQLException ex) {\n Logger.getLogger(ProductControl.class.getName()).log(Level.SEVERE, null, ex);\n }\n \n return product;\n }", "public ArrayList<Product> getProducts(int warehouseNumber) { return db.retrieve_warehouse(warehouseNumber); }", "void getMarketOrders();", "private void updateSoldProductInfo() { public static final String COL_SOLD_PRODUCT_CODE = \"sells_code\";\n// public static final String COL_SOLD_PRODUCT_SELL_ID = \"sells_id\";\n// public static final String COL_SOLD_PRODUCT_PRODUCT_ID = \"sells_product_id\";\n// public static final String COL_SOLD_PRODUCT_PRICE = \"product_price\";\n// public static final String COL_SOLD_PRODUCT_QUANTITY = \"quantity\";\n// public static final String COL_SOLD_PRODUCT_TOTAL_PRICE = \"total_price\";\n// public static final String COL_SOLD_PRODUCT_PENDING_STATUS = \"pending_status\";\n//\n\n for (ProductListModel product : products){\n soldProductInfo.storeSoldProductInfo(new SoldProductModel(\n printInfo.getInvoiceTv(),\n printInfo.getInvoiceTv(),\n product.getpCode(),\n product.getpPrice(),\n product.getpSelectQuantity(),\n printInfo.getTotalAmountTv(),\n paymentStatus+\"\"\n ));\n\n }\n }", "public List<ProductWithSupplierAndStockItemTO> getProductsWithStockItems(long storeID) throws NotInDatabaseException;" ]
[ "0.7577135", "0.7021316", "0.70124215", "0.69745475", "0.69546497", "0.6867897", "0.6848583", "0.6843438", "0.6824915", "0.6786073", "0.6778932", "0.6771293", "0.6767236", "0.6757329", "0.67570585", "0.67568564", "0.67568564", "0.67568564", "0.6682708", "0.6678567", "0.6647406", "0.663662", "0.6618748", "0.66042876", "0.6603355", "0.65981245", "0.65686256", "0.65577495", "0.65577495", "0.65561277", "0.65443563", "0.65437204", "0.6538012", "0.65218586", "0.65207165", "0.65140176", "0.65048987", "0.65023017", "0.6495476", "0.64861155", "0.64861155", "0.64816976", "0.64778715", "0.64612675", "0.6451243", "0.64508194", "0.64435655", "0.6442275", "0.6426856", "0.6426323", "0.6422785", "0.6422472", "0.6410205", "0.6404913", "0.6401061", "0.63981456", "0.6380683", "0.63796955", "0.63707995", "0.6365915", "0.6357291", "0.63559246", "0.63524616", "0.63496494", "0.6338615", "0.6338141", "0.6323654", "0.6322274", "0.6308964", "0.63063306", "0.6298507", "0.6284111", "0.628151", "0.62536025", "0.62531036", "0.6243145", "0.6240078", "0.6228346", "0.6226496", "0.6221729", "0.6205214", "0.620245", "0.6201406", "0.6200965", "0.6199726", "0.6193485", "0.6189111", "0.6187067", "0.61859334", "0.6183494", "0.617937", "0.6176279", "0.61708397", "0.61655325", "0.6164428", "0.6155007", "0.61420727", "0.61407304", "0.6140393", "0.61398906", "0.61382806" ]
0.0
-1
It pulls presaved products of a user from db, return to client as a array of product objects.
public String[] loadCart(Session session) throws RemoteException{ System.out.println("Server model invokes loadCart() method"); return null; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "List<Product> retrieveProducts();", "public ArrayList<Product> loadProducts(String username ,String userType);", "public List<Product> getProductsBought(int idUser){\n\t\treturn orderDetailRepository.getProductsBought(idUser);\n\t}", "public List<Product> getProductList(){\n List<Product> productList = mongoDbConnector.getProducts();\n return productList;\n }", "List<Product> getAllProducts() throws PersistenceException;", "public List<Product> getProducts() {\n Connection connection = null;\n Statement statement = null;\n ResultSet resultSet = null;\n List<Product> products = new ArrayList<>(); //creating an array\n String sql=\"select * from products order by product_id\"; //writing sql statement\n try {\n connection = db.getConnection();\n statement = connection.createStatement();\n resultSet = statement.executeQuery(sql);\n while (resultSet.next()) { //receive data from database\n products.add(new Product( resultSet.getInt(1), resultSet.getString(2), resultSet.getInt(3),\n resultSet.getString(4),resultSet.getString(5),resultSet.getString(6),\n resultSet.getString(7), resultSet.getString(8))); //creating object of product and\n // inserting it into an array\n }\n return products; //return this array\n } catch (SQLException | ClassNotFoundException throwable) {\n throwable.printStackTrace();\n } finally {\n try {\n assert resultSet != null;\n resultSet.close();\n statement.close();\n connection.close();\n } catch (SQLException throwable) {\n throwable.printStackTrace();\n }\n }\n return null;\n }", "Product getPProducts();", "List<Product> getAllProducts() throws DataBaseException;", "public List<Product> returnProducts() throws FlooringMasteryDaoException {\n\n List<Product> products = dao.loadProductInfo();\n return products;\n\n }", "private List<Product> extractProducts() {\r\n\t\t//load products from hidden fields\r\n\t\tif (this.getListProduct() != null){\r\n\t\t\tfor(String p : this.getListProduct()){\r\n\t\t\t\tProduct product = new Product();\r\n\t\t\t\tproduct.setId(Long.valueOf(p));\r\n\t\t\t\tthis.products.add(product);\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\treturn this.products;\r\n\t}", "private List<ProductView> fetchProducts(String developerId) {\n LOG.debug(\"Enter. developerId: {}.\", developerId);\n\n List<Product> products = productService.getByDeveloperId(developerId);\n\n List<ProductView> result = ProductMapper.toView(products);\n\n List<String> productIds = products.stream().map(Product::getId).collect(Collectors.toList());\n\n Map<String, List<ProductDataView>> productDataViews =\n restClient.getProductData(developerId, productIds);\n\n mergeProductData(result, productDataViews);\n\n cacheApplication.cacheProducts(developerId, result);\n\n LOG.trace(\"Product: {}.\", result);\n LOG.debug(\"Exit. product size: {}.\", result.size());\n\n return result;\n }", "List<Product> getAllProducts();", "List<Product> getAllProducts();", "List<Product> getAllProducts();", "public List<Product> getAllProduct(RepositoryCallback<List<com.example.omarket.backend.data.data.entities.RepoUser>> error) {\n return localDataSource.getAllProducts();\n }", "@Override\n\tpublic List<Products> getProducts() {\n\t\tSession currentSession = sessionFactory.getCurrentSession();\n\n\t\t// create a query\n\t\tQuery<Products> theQuery = currentSession.createQuery(\"from Products order by id\", Products.class);\n\n\t\t// execute query and get result list\n\t\tList<Products> products = theQuery.getResultList();\n\n\t\t// return the results\n\t\treturn products;\n\n\t}", "public ArrayList<ProductType> findValidProducts(Integer UserId);", "public List<ProductWithSupplierTO> getAllProducts(long storeID) throws NotInDatabaseException;", "public List<Product> getProducts();", "public List<Product> getProducts();", "@Override\n\tpublic List<Product> getProducts() {\n\t\treturn productDao.getProducts();\n\t}", "public List<ProductDto> getProducts() {\n\t\tString url = URL_BASE + \"/list\";\n\n\t\tResponseEntity<List<ProductDto>> responseEntity = restTemplate.exchange(url, HttpMethod.GET, HttpEntity.EMPTY,\n\t\t\t\tnew ParameterizedTypeReference<List<ProductDto>>() {\n\t\t\t\t});\n\t\tList<ProductDto> playerList = responseEntity.getBody();\n\t\treturn playerList;\n\t}", "@Override\n\tpublic User getProduct(long userId) {\n\t\treturn (User) openSession().load(User.class, userId);\n\t}", "public List<Product> readAll() {\n\t\treturn null;\n\t}", "@Nullable\r\n public static List<Product> getFavoriteProducts(final Context context)\r\n {\r\n final SharedPreferencesManager sharedPreferencesManager = new SharedPreferencesManager(context);\r\n\r\n final User user = sharedPreferencesManager.retrieveUser();\r\n\r\n final String fixedURL = Utils.fixUrl(\r\n Properties.SERVER_URL + \":\" + Properties.SERVER_SPRING_PORT + \"/users/favorites/\" + user.getId());\r\n\r\n Log.d(Properties.TAG, \"[REST_CLIENT_SINGLETON] Conectando con: \" + fixedURL + \" para otener los productos favoritos\");\r\n\r\n RequestFuture<JSONArray> future = RequestFuture.newFuture();\r\n\r\n // Creamos una peticion.\r\n JsonArrayRequest jsonObjReq = new JsonArrayRequest(Request.Method.GET\r\n , fixedURL\r\n , null\r\n , future\r\n , future);\r\n\r\n // La mandamos a la cola de peticiones.\r\n VolleySingleton.getInstance(context).addToRequestQueue(jsonObjReq);\r\n Log.d(Properties.TAG, \"[REST_CLIENT_SINGLENTON] Petición creada y enviada\");\r\n\r\n try\r\n {\r\n JSONArray response = future.get(20, TimeUnit.SECONDS);\r\n\r\n Log.d(Properties.TAG, \"[REST_CLIENT_SINGLENTON] Se parsean los JSONs recibidos\");\r\n List<Product> favorites = JSONParser.convertJSONsToProducts(response);\r\n Set<Long> userFavorites = new HashSet<>();\r\n for (Product favorite : favorites)\r\n {\r\n userFavorites.add(favorite.getId());\r\n }\r\n\r\n Log.d(Properties.TAG, \"[REST_CLIENT_SINGLENTON] Se actualiza la lista de favoritos del usuario\");\r\n user.setFavoriteProducts(userFavorites);\r\n sharedPreferencesManager.insertUser(user);\r\n\r\n return favorites;\r\n\r\n } catch (ExecutionException | InterruptedException | TimeoutException e) {\r\n Log.e(Properties.TAG, \"[REST_CLIENT_SINGLETON] Error conectando con el servidor: \" + e.getMessage());\r\n ExceptionPrinter.printException(\"REST_CLIENT_SINGLETON\", e);\r\n\r\n return null;\r\n\r\n } catch (JSONException e) {\r\n Log.e(Properties.TAG, \"[REST_CLIENT_SINGLETON] Error parseando los productos: \" + e.getMessage());\r\n ExceptionPrinter.printException(\"REST_CLIENT_SINGLETON\", e);\r\n\r\n return null;\r\n }\r\n }", "List<Product> getProductsList();", "public List<Product> getProductByID() {\n List<Product> listProduct= productBean.getProductByID(productId);\n return listProduct;\n }", "@Override\n\tpublic List<Products> getAllProduct() {\n\t\treturn dao.getAllProduct();\n\t}", "public List<Product> getAllProducts() {\n List<Product> listProduct= productBean.getAllProducts();\n return listProduct;\n }", "@Override\n public Iterable<Product> findAllProduct() {\n return productRepository.findAll();\n }", "public List<Product> getFullProductList(){\n\t\t/*\n\t\t * La lista dei prodotti da restituire.\n\t\t */\n\t\tList<Product> productList = new ArrayList<Product>();\n\t\t\n\t\t/*\n\t\t * Preleviamo il contenuto della tabella PRODOTTO.\n\t\t */\n\t\tStatement productStm = null;\n\t\tResultSet productRs = null;\n\t\t\n\t\ttry{\n\t\t\tproductStm = connection.createStatement();\n\t\t\tString sql = \"SELECT * FROM PRODOTTO;\";\n\t\t\tproductRs = productStm.executeQuery(sql);\n\t\t}\n\t\tcatch(SQLException sqle){\n\t\t\tSystem.out.println(\"DB issue: failed to retrive product data from database.\");\n\t\t\tSystem.out.println(sqle.getClass().getName() + \": \" + sqle.getMessage());\n\t\t}\n\t\t\n\t\ttry{\n\t\t\tproductList = this.getProductListFromRs(productRs);\n\t\t\tproductStm.close(); // Chiude anche il ResultSet productRs\n\t\t\tConnector.releaseConnection(connection);\n\t\t}\n\t\tcatch(SQLException sqle){\n\t\t\tSystem.out.println(\"ResultSet issue 2: failed to retrive data from ResultSet.\\n\");\n\t\t\tSystem.out.println(sqle.getClass().getName() + \": \" + sqle.getMessage());\n\t\t}\n\t\t\n\t\treturn productList;\n\t}", "@Override\r\n\tpublic List<Product> getallProducts() {\n\t\treturn dao.getallProducts();\r\n\t}", "@RequestMapping(method = RequestMethod.GET, value = \"/user/getAll\")\n @ApiOperation(value = \"Getting all the products\")\n public Iterable<User> getAll(){\n return userService.getAll();\n }", "@Override\r\n\tpublic List<Product> findProduct() {\n\t\treturn iImportSalesRecordDao.findProduct();\r\n\t}", "@Override\r\n\tpublic List<Product> getAllProducts() {\n\t\treturn dao.getAllProducts();\r\n\t}", "@Override\n\tpublic List<Product> getAllProduct() {\n\t\treturn productRepository.findAll();\n\t}", "@Override\n\tpublic List<Product> getAllProduct() {\n\t\treturn productRepository.findAll();\n\t}", "public List<Product> getAll() {\n List<Product> list = new ArrayList<>();\n String selectQuery = \"SELECT * FROM \" + PRODUCT_TABLE;\n SQLiteDatabase database = this.getReadableDatabase();\n try (Cursor cursor = database.rawQuery(selectQuery, null)) {\n if (cursor.moveToFirst()) {\n do {\n int id = cursor.getInt(0);\n String name = cursor.getString(1);\n String url = cursor.getString(2);\n double current = cursor.getDouble(3);\n double change = cursor.getDouble(4);\n String date = cursor.getString(5);\n double initial = cursor.getDouble(6);\n Product item = new Product(name, url, current, change, date, initial, id);\n list.add(item);\n }\n while (cursor.moveToNext());\n }\n }\n return list;\n }", "public ArrayList<Product> viewAllProduct() throws ProductException{\r\n\t\t\tArrayList<Product> products=new ArrayList<Product>();\r\n\t\t\tif(ProductRepository.productsList.isEmpty()) {\r\n\t\t\t\tthrow new ProductException(\"there are no products in the store\");\r\n\t\t\t\t\r\n\t\t\t}else {\r\n\t\t\t\r\n\t\t\tproducts.addAll(pDoa.viewProductsDoa());\r\n\t\t\t\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\t\r\n\t\t\treturn products;\r\n\t\t\t\r\n\t\t\t\r\n\t\t\t\r\n\t\t\t\r\n\t\t\t\r\n\t\t}", "public List<Product> get() {\r\n return sessionFactory.getCurrentSession()\r\n .createCriteria(Product.class)\r\n .addOrder(Order.asc(\"name\"))\r\n .list();\r\n }", "public List<Products> getProducts() {\n\t\treturn pdao.getProducts();\r\n\t}", "public List<Product> getAllProducts() {\n\t\tSession session = sessionFactory.getCurrentSession();\r\n\t\tQuery query = (Query) session.createQuery(\"from Product\");\r\n\t\tList<Product> products = query.list();\r\n\t\treturn products;\r\n\t}", "public List<Product> getProducts() {\n\t\treturn productRepository.findAll();\n\t}", "@Override\n\tpublic List<Product> getByHot() throws SQLException {\n\t\treturn productDao.getByHot();\n\t}", "public void getCartProducts(int userId) {\n try {\n int flag = 1;\n while(1 == flag) {\n int prodId = InputUtil.getInt(\"Enter product Id : \");\n Product product = cartService.getProductFromStore(prodId);\n if(!cartService.validateProduct(userId,prodId)) {\n System.out.println(\"Product added already in cart\\n\"); \n break;\n }\n Cart cart = new Cart();\n\t\t cart.setProduct(product); \n cart.setUser(userService.getUser(userId));\n\t\t int quantity = InputUtil.getInt(\"Enter product quantity : \"); \n cart.setQuantity(quantity);\n cart.setCreated(DateUtil.getCurrentDateTime());\n cart.setModified(DateUtil.getCurrentDateTime());\n cartService.add(cart);\n System.out.println(\"\\n\"+product.getName().toUpperCase()+\" added to cart \");\n flag = InputUtil.getInt(\"Enter 1 to add products. 2 to exit : \");\n }\n } catch (ProductException e) {\n\t System.out.println(e);\n } catch (DatabaseConnectionException e) {\n\t System.out.println(e);\n\t } catch (NoRecordFoundException ex) {\n System.out.println(ex);\n } catch (CartException ex) {\n System.out.println(ex);\n } \n }", "@Override\n\t@Transactional\n\tpublic List<Product> getAllProducts() {\n\t\treturn (List<Product>)productDAO.findAll();\n\t\t\n\t}", "private void loadProducts() {\n\t\tproduct1 = new Product();\n\t\tproduct1.setId(1L);\n\t\tproduct1.setName(HP);\n\t\tproduct1.setDescription(HP);\n\t\tproduct1.setPrice(BigDecimal.TEN);\n\n\t\tproduct2 = new Product();\n\t\tproduct2.setId(2L);\n\t\tproduct2.setName(LENOVO);\n\t\tproduct2.setDescription(LENOVO);\n\t\tproduct2.setPrice(new BigDecimal(20));\n\n\t}", "@Override\r\n\tpublic List<Product> findAllProducts() {\n\t\treturn productRepository.findAllProducts();\r\n\t}", "public List<Product> getProducts() {\n return products;\n }", "public List<Product> getAll() {\n\t\treturn productRepository.findAll();\n\n\t}", "public List<Product> getProducts(ProductRequest request) throws IOException {\n if (request.isSingle()){\n List<Product> products = new ArrayList<>();\n products.add(parseResult(executeRequest(request),Product.class));\n return products;\n } else {\n return parseResults(executeRequest(request), Product.class);\n }\n }", "@Override\r\n public List<Product> findAll() {\r\n return productRepository.findAll();\r\n }", "public Product[] getAll() {\n Product[] list = new Product[3];\n try {\n list[0] = products[0].clone();\n list[1] = products[1].clone();\n list[2] = products[2].clone();\n } catch (CloneNotSupportedException ignored) {}\n\n return list;\n }", "@Override\n public ArrayList<ProductType> loadProducts() {\n ProductType product = new ProductType(\"TestProduct\", new BigDecimal(\"5.00\"), new BigDecimal(\"10.00\"));\n ArrayList<ProductType> list = new ArrayList<>();\n list.add(product);\n return list;\n }", "public ObservableList<Product> getAllProduct()\n {\n ObservableList<Product> product =FXCollections.observableArrayList();\n try {\n state = ConnectionDB.openConnection().createStatement();\n ResultSet result = state.executeQuery(\"SELECT * FROM product\");\n \n \n \n while(result.next())\n {\n // if define object out while will store last row n time\n Product pr = new Product(); \n pr.setId(result.getInt(1));\n pr.setName(result.getString(2));\n pr.setNumber(result.getInt(3));\n pr.setPrice(result.getInt(4));\n product.add(pr); \n }\n } catch (SQLException ex) {\n Logger.getLogger(ProductControl.class.getName()).log(Level.SEVERE, null, ex);\n }\n \n return product;\n }", "@SuppressWarnings(\"unchecked\")\r\n\t@Override\r\n\tpublic ProductResponseModel getAllProduct() {\n\r\n\t\tProductResponseModel productResponseModel = new ProductResponseModel();\r\n\r\n\t\tMap<String, Object> map = productRepositoryImpl.getAllProduct();\r\n\r\n\t\t// productResponseModel.setCount((long) map.get(\"count\"));\r\n\t\tList<Product> product = (List<Product>) map.get(\"data\");\r\n\t\tList<ProductModel> productList = product.stream().map(p -> new ProductModel(p.getId(), p.getProName(),\r\n\t\t\t\tp.getProPrice(), p.getProQuantity(), p.getProDescription(), p.getProSize()))\r\n\t\t\t\t.collect(Collectors.toList());\r\n\r\n\t\tproductResponseModel.setData(productList);\r\n\r\n\t\treturn productResponseModel;\r\n\t}", "@SuppressWarnings(\"unchecked\")\n private void fetchProductInformation() {\n // Query the App Store for product information if the user is is allowed\n // to make purchases.\n // Display an alert, otherwise.\n if (SKPaymentQueue.canMakePayments()) {\n // Load the product identifiers fron ProductIds.plist\n String filePath = NSBundle.getMainBundle().findResourcePath(\"ProductIds\", \"plist\");\n NSArray<NSString> productIds = (NSArray<NSString>) NSArray.read(new File(filePath));\n\n StoreManager.getInstance().fetchProductInformationForIds(productIds.asStringList());\n } else {\n // Warn the user that they are not allowed to make purchases.\n alert(\"Warning\", \"Purchases are disabled on this device.\");\n }\n }", "public List<ProductDto> getProducts() {\n return tradingSystemFacade.getProducts();\n }", "public List<ProveedorEntity> getProveedores(){\n List<ProveedorEntity>proveedores = proveedorPersistence.findAll();\n return proveedores;\n }", "public ArrayList<Product> getProducts() {\n\t\tArrayList<Product> scannedItems = new ArrayList<>();\n\n\t\tArrayList<Item> currentPurchases = purchaseList.getCurrentPurchases(); \n\n\t\tfor (Item item : currentPurchases) {\n\t\t\tProduct possibleProductToShow = this.getProductFromItem(item);\n\t\t\tif (possibleProductToShow != null) {\n\t\t\t\tscannedItems.add(possibleProductToShow);\n\t\t\t}\n\t\t}\n\n\t\treturn scannedItems;\n\t}", "@RequestMapping(value = \"/signup/getProducts\", method = RequestMethod.POST)\n @ResponseBody\n public SPResponse getProducts(@RequestParam ProductType productType) {\n SPResponse spResponse = new SPResponse();\n \n String property = enviornment.getProperty(\"sp.active.products.\" + productType.toString());\n String[] productsArr = property.split(\",\");\n List<String> productsList = Arrays.asList(productsArr);\n List<Product> products = productRepository.findAllProductsById(productsList);\n if (products != null && products.size() != 0) {\n spResponse.add(\"products\", products);\n } else {\n spResponse.addError(\"Product_Not_Found\", \"No products found for type :\" + productType);\n }\n return spResponse;\n }", "@ServiceMethod(name = \"FetchStoreProduct\")\r\n\tpublic IResponseHandler fetchStoreProduct()\r\n\t{\t\r\n\t\tStoreProductOutDTO outDTO = new StoreProductOutDTO();\r\n\t\t\r\n\t\tList<StoreProduct> sps= StoreProductDAO.getInstance(getSession()).readStoresProduct();\r\n\t\t\r\n\t\tfor(StoreProduct sp : sps)\r\n\t\t{\r\n\t\t\tStoreProductDTO dto = new StoreProductDTO();\r\n\t\t\t\r\n\t\t\toutDTO.getStoreProducts().add(dto.assemble(sp));\r\n\t\t}\r\n\t\t\r\n\t\tStoreService storeService = (StoreService)newInstance(new StoreService());\r\n\t\toutDTO.setStores((StoreOutDTO)storeService.fetchStore());\r\n\t\t\r\n\t\tProductService productService = (ProductService)newInstance(new ProductService());\r\n\t\toutDTO.setProducts((ProductOutDTO)productService.fetchProduct());\r\n\t\t\r\n\t\treturn outDTO;\r\n\t}", "@CrossOrigin()\r\n @GetMapping(\"/products/all\")\r\n List<ProductEntity> getAllProducts() {\r\n // TODO add error if there are not enough products\r\n return productRepository.findAll();\r\n }", "@Override\r\n\tpublic List<Product> getAllProducts(String filePath) {\r\n\t\treturn productDetailsRepository.getAllProducts(filePath);\r\n\t}", "@Override\n\tpublic List<Product> getAll() throws SQLException {\n\t\treturn null;\n\t}", "@Override\n\tpublic List<Product> getByNew() throws SQLException {\n\t\treturn productDao.getByNew();\n\t}", "public List<Product> getAllProducts() {\n\t\treturn dao.getAllProducts();\n\t}", "@NonNull\n public List<Product> findAll() {\n return productRepository.findAll();\n }", "@Override\n\tpublic List<Product> selectAllProduct() {\n\t\treturn productMapper.selectAllProduct();\n\t}", "@GetMapping(\"/getproduct\")\n\t\tpublic List<Product> getAllProduct() {\n\t\t\tlogger.info(\"products displayed\");\n\t\t\treturn productService.getAllProduct();\n\t\t}", "@Override\n\tpublic List<Product> getAll() {\n\t\tQuery query = session.createQuery(\"from Product \");\n\t\t\n\t\treturn query.getResultList();\n\t}", "List<Product> findAll();", "List<Product> findAll();", "public void showAllProducts() {\n try {\n System.out.println(Constants.DECOR+\"ALL PRODUCTS IN STORE\"+Constants.DECOR_END);\n List<Product> products = productService.getProducts();\n System.out.println(Constants.PRODUCT_HEADER);\n for (Product product : products) { \n System.out.println((product.getName()).concat(\"\\t\\t\").concat(product.getDescription()).concat(\"\\t\\t\")\n .concat(String.valueOf(product.getId()))\n .concat(\"\\t\\t\").concat(product.getSKU()).concat(\"\\t\").concat(String.valueOf(product.getPrice()))\n .concat(\"\\t\").concat(String.valueOf(product.getMaxPrice())).concat(\"\\t\")\n .concat(String.valueOf(product.getStatus()))\n .concat(\"\\t\").concat(product.getCreated()).concat(\"\\t\\t\").concat(product.getModified())\n .concat(\"\\t\\t\").concat(String.valueOf(product.getUser().getUserId())));\n }\n } catch (ProductException ex) {\n System.out.println(ex);\n }\n }", "public Product[] getProductsArray () {\n return null;\n }", "List<ProductDto> getProducts();", "public List<Product> findAll();", "public static ArrayList<Product> getProducts() throws SQLException\n\t{\n\t\tArrayList<Product> listOfProducts = new ArrayList<Product>();\n\t\tresultSet = getResultSet();\n\t\tProduct product = null;\n\t\t\n\t\twhile(resultSet.next())\n\t\t{\n\t\t\tproduct = new Product();\n\n\t\t\tproduct.setProductId(resultSet.getInt(1));\n\t\t\tproduct.setProductName(resultSet.getString(2));\n\t\t\tproduct.setCategoryId(resultSet.getInt(3));\n\t\t\tproduct.setProductTypeId(resultSet.getInt(4));\n\t\t\n\t\t\t\n\t\t\tlistOfProducts.add(product);\n\t\t}//while ends here\n\t\treturn listOfProducts;\n\t}", "@GetMapping(path =\"/products\")\n public ResponseEntity<List<Product>> getProducts() {\n return ResponseEntity.ok(productService.getAll());\n }", "public void retrieveProductFromDatabase(){\r\n // retrieve product from the database here\r\n System.out.println(\"Product Retrieved using ID --> \" + this.productId);\r\n \r\n }", "public List<Product> getProductByName() {\n \n List<Product> listProduct= productBean.getProductByName(productName);\n return listProduct;\n }", "public List<Product> getAllProducts() {\n return new ArrayList<Product>(this.products.values());\n }", "public List<Product> getPurchases() {\n return purchases;\n }", "public CartModel[] getUnpaidCartByUserId(int userId) {\n SQLiteDatabase sdb = this.getReadableDatabase();\n Cursor cursor = sdb.rawQuery(\"SELECT * FROM cart where user_id=? and buy_status=0\", new String[]{String.valueOf(userId)});\n int count = cursor.getCount();\n// Log.e(\"cart row\", \"got \" + count + \" items\");\n CartModel []emptyCart = new CartModel[0];\n if(count == 0) return emptyCart;\n cursor.moveToFirst();\n\n\n CartModel []cart = new CartModel[count];\n int i = 0;\n for(i = 0; i < cart.length; i++) {\n cart[i] = new CartModel();\n }\n\n// Log.e(\"init cart[]\", \"finished init caart[]\");\n cursor.moveToFirst();\n i = 0;\n do {\n cart[i].setCart_id(cursor.getInt(0));\n cart[i].setItem_id(cursor.getInt(1));\n cart[i].setUser_id(cursor.getInt(2));\n cart[i].setBuy_status(cursor.getInt(3));\n i++;\n } while(cursor.moveToNext());\n\n cursor.close();\n\n// Log.e(\"getCartByUserId\", \"finished get caart by user id\");\n return cart;\n }", "@Override\r\n\tpublic List<Product> showAll() throws Exception {\n\t\treturn this.dao.showAll();\r\n\t}", "@Override\r\n\tpublic List<Mobile> showAllProduct() {\n\t\tQuery query=entitymanager.createQuery(\"FROM Mobile\");\r\n\t\tList<Mobile> myProd=query.getResultList();\r\n\t\treturn myProd;\r\n\t}", "@RequestMapping(value=\"/purchase/all\",method=RequestMethod.GET)\n\t\t public @ResponseBody ResponseEntity<List<Purchases>> getAllPurchases(){\n\t\t\t List<Purchases> purchase=(List<Purchases>) purchaseDAO.findAll();\n\t\t\t Books books=null;\n\t\t\t User user=null;\n\t\t\t for(Purchases purch : purchase) {\n\t\t\t\t books=booksDAO.findOne(purch.getIsbn());\n\t\t\t\t purch.setBook(books);\n\t\t\t\t user=userDAO.findOne(purch.getUserId());\n\t\t\t\t purch.setUser(user);\n\t\t\t }\n\t\t\t return new ResponseEntity<List<Purchases>>(purchase, HttpStatus.OK);\n\t\t }", "public ObservableList<Product> getAllProducts() { return allProducts; }", "public List<Products> getProductsDetails() {\n\t\treturn productsRepo.findAll();\n\t}", "public static ObservableList<Product> getAllProducts() {\n return allProducts;\n }", "public static List<Product> openInventoryDatabase() {\r\n\t\tdbConnect();\r\n\t\tStatement stmt = null;\r\n\t\tResultSet rs = null;\r\n\t\tList<Product> prods = new ArrayList<>();\r\n\t\ttry {\r\n\t\t\tstmt = conn.createStatement();\r\n\t\t\trs = stmt.executeQuery(GET_PRODUCTS_FROM_DB);\r\n\t\t\twhile (rs.next()) {\r\n\t\t\t\tint productCode = rs.getInt(\"product_code\");\r\n\t\t\t\tString productName = rs.getString(\"product_name\");\r\n\t\t\t\tString productUnit = rs.getString(4);\r\n\t\t\t\tString productDescription = rs.getString(5);\r\n\t\t\t\tdouble priceForPurchase = rs.getDouble(6);\r\n\t\t\t\tdouble priceForSales = rs.getDouble(7);\r\n\t\t\t\tint stockQuantity = rs.getInt(8);\r\n\t\t\t\tprods.add(new Product(productCode, productName, productUnit, productDescription, priceForPurchase,\r\n\t\t\t\t\t\tpriceForSales, stockQuantity));\r\n\t\t\t}\r\n\t\t\tstmt.close();\r\n\t\t\trs.close();\r\n\t\t} catch (SQLException e) {\r\n\t\t\te.printStackTrace();\r\n\t\t\treturn null;\r\n\t\t}\r\n\t\t// dbClose();\r\n\t\treturn prods;\r\n\t}", "public ObservableList<Product> getAllProducts() {\n return allProducts;\n }", "@Transactional\n\tpublic Set<ProductImages> loadProductImagess() {\n\t\treturn productImagesDAO.findAllProductImagess();\n\t}", "void maintainUpdatedProductsList(MarketDataCacheClient cacheUser);", "@GetMapping(\"/findAllProduct\")\n @ResponseBody\n public ResponseEntity<List<ProductEntity>> findAllProduct() {\n List<ProductEntity> productResponse = productService.viewProduct();\n return new ResponseEntity<>(productResponse, HttpStatus.OK);\n }", "List<Receipt> getUserReceipts(long userId) throws DbException;", "public List<Product> getAllProducts()\n {\n SQLiteDatabase db = this.database.getWritableDatabase();\n\n // Creates a comma-separated string of all columns in the shopping list table\n String values = TextUtils.join(\", \", ShoppingListTable.COLUMNS);\n\n // Constructs the SQL query\n String sql = String.format(\"SELECT %s FROM %s\", values, ShoppingListTable.TABLE_NAME);\n\n Cursor query = db.rawQuery(sql, null);\n\n Product product = null;\n List<Product> products = new ArrayList<>();\n\n // Check whether there are any products\n if (query.moveToFirst())\n {\n do\n {\n int tpnb = Integer.parseInt(query.getString(0));\n String name = query.getString(1);\n String description = query.getString(2);\n float cost = Float.parseFloat(query.getString(3));\n float quantity = Float.parseFloat(query.getString(4));\n String superDepartment = query.getString(5);\n String department = query.getString(6);\n String imageURL = query.getString(7);\n Boolean isChecked = query.getString(8).equals(\"1\");\n int amount = Integer.parseInt(query.getString(9));\n int position = Integer.parseInt(query.getString(10));\n\n product = new Product(tpnb, name, description, cost, quantity, superDepartment, department, imageURL);\n\n product.setChecked(isChecked);\n product.setAmount(amount);\n product.setPosition(position);\n\n products.add(product);\n }\n while (query.moveToNext());\n }\n\n return products;\n }", "@Override\n\tpublic List<ProductDTO> viewAllProducts() throws ProductException {\n\t\tCollection<Product> products = ProductStore.map.values();\n\t\tList<ProductDTO> list = new ArrayList();\n\n\t\tfor (Product product : products) {\n\t\t\tProductDTO product1 = ProductUtil.convertToProductDto(product);\n\t\t\tlist.add(product1);\n\t\t}\n\n\t\treturn list;\n\t}", "List<Purchase> retrieveForProductID(Long productID) throws SQLException, DAOException;", "static public Product[] retrieve(int[] id) {\n\t\t\n\t\tProduct[] list = null;\n\t\t\n\t\treturn list;\n\t}", "List<Product> list();" ]
[ "0.6789897", "0.6602689", "0.65826833", "0.6526933", "0.63504344", "0.63486016", "0.6329872", "0.62143046", "0.6172346", "0.6161462", "0.60752916", "0.60392267", "0.60392267", "0.60392267", "0.60270333", "0.6021346", "0.60075694", "0.6005219", "0.5971679", "0.5971679", "0.5965598", "0.594683", "0.59368026", "0.59359664", "0.59335077", "0.59236467", "0.5870069", "0.58631", "0.5856803", "0.58496237", "0.582199", "0.581113", "0.58083266", "0.58061373", "0.5799996", "0.57915187", "0.57915187", "0.5776635", "0.5770494", "0.57670736", "0.5730876", "0.5724888", "0.5703244", "0.56969535", "0.5689866", "0.5674408", "0.56706935", "0.5654964", "0.56542253", "0.5652982", "0.56345433", "0.5625263", "0.5620436", "0.56081355", "0.5605075", "0.5604743", "0.55895305", "0.55865544", "0.55760765", "0.55664945", "0.5564582", "0.5552337", "0.5551689", "0.55433744", "0.5527228", "0.5522376", "0.5511967", "0.5501235", "0.5491104", "0.5488883", "0.548087", "0.54771227", "0.54771227", "0.5458955", "0.5455676", "0.545527", "0.54409564", "0.5435345", "0.5431555", "0.5427205", "0.54246974", "0.5423741", "0.5422623", "0.5418015", "0.5393329", "0.5378519", "0.53698784", "0.5361795", "0.5360214", "0.5359998", "0.535695", "0.5352035", "0.53505194", "0.5343105", "0.5340012", "0.5337714", "0.5337039", "0.5334296", "0.5334165", "0.5331787", "0.5331549" ]
0.0
-1
It performs the placing order and transaction processes. It updates the product quantities, creates a record to save products and related purchasing information.
public String[] checkOut(Session session) throws RemoteException { System.out.println("Server model invokes checkOut() method"); return null; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Test(dependsOnMethods = \"checkSiteVersion\")\n public void createNewOrder() {\n actions.openRandomProduct();\n\n // save product parameters\n actions.saveProductParameters();\n\n // add product to Cart and validate product information in the Cart\n actions.addToCart();\n actions.goToCart();\n actions.validateProductInfo();\n\n // proceed to order creation, fill required information\n actions.proceedToOrderCreation();\n\n // place new order and validate order summary\n\n // check updated In Stock value\n }", "public void placeRushOrder() throws SQLException {\n\t\tCart.getCart().checkAvailabilityOfProduct();\n\t}", "public void insertIntoProduct() {\n\t\ttry {\n\t\t\tPreparedStatement statement = connect.prepareStatement(addProduct);\n\t\t\tstatement.setString(1, productName);\n\t\t\tstatement.setString(2, quantity);\n\t\t\t\n\t\t\tstatement.executeUpdate();\n\t\t} catch (Exception e) {\n\t\t\tSystem.out.println(e.getMessage());\n\t\t}\n\t}", "@Override\n\tpublic void execute(final CheckoutActionContext context) throws EpSystemException {\n\t\tcheckoutEventHandler.preCheckoutOrderPersist(context.getShoppingCart(),\n\t\t\t\tcontext.getOrderPaymentList(), context.getOrder());\n\n\t\t//process and update order - should limit our updates to once\n\t\tfinal Order updatedOrder = orderService.processOrderOnCheckout(context.getOrder(),\n\t\t\t\tcontext.getShoppingCart().isExchangeOrderShoppingCart());\n\t\tcontext.setOrder(updatedOrder);\n\t\tcontext.setOrderPaymentList(updatedOrder.getOrderPayments());\n\t}", "@Test\n\tpublic void testAddProductToCart() {\n\t\tdouble startBalance = cart.getBalance();\n\t\tassertEquals(0,startBalance,0.01);\n\t\t\n\t\t\n\t\t\t // 4. CHECK NUM ITEMS IN CART BEFORE ADDING PRODUCT\n\t\t\t // \t\t - PREV NUM ITEMS\n\t\t\n\t\tint StartingNumItems = cart.getItemCount();\n\t\tassertEquals(0,StartingNumItems);\n\t\t\n\t\t\t // 5. ADD THE PRODUCT TO THE CART \n\t\tcart.addItem(phone);\n\t\t\n\t\t\t // 6. CHECK THE UPDATED NUMBER OF ITEMS IN CART \n\t\t\t // \t\t-- EO: NUM ITEMS + 1\n\t\tassertEquals(StartingNumItems + 1, cart.getItemCount());\n\t\t\t // -----------------------\n\t\t\t // 7. CHECK THE UPDATED BALANCE OF THE CART\n\t\t\t // \t\t-- EO: PREVIOUS BALANCE + PRICE OF PRODUCT\n\t\t\n\t\tdouble expectedBalance = startBalance + phone.getPrice();\n\t\t\n\t\tassertEquals(expectedBalance,cart.getBalance(),0.01);\n\t\t\n\t\t\n\t\t\n\t}", "public void placeOrder(String custID) {\r\n //creates Order object based on current cart\r\n Order order = new Order(custID, getItems());\r\n //inserts new order into DB\r\n order.insertDB();\r\n }", "public void createNewOrder()\n\t{\n\t\tnew DataBaseOperationAsyn().execute();\n\t}", "@Override\n @Transactional\n public PurchaseResponse placeOrder(Purchase purchase) {\n Order order = purchase.getOrder();\n\n //genrate traking number\n String orderTrakingNumber = genrateOrderTrakingnumber();\n order.setOrderTrackingNumber(orderTrakingNumber);\n\n //populate order with order item\n Set<OrderItem> orderItems = purchase.getOrderItems();\n orderItems.forEach(item-> order.add(item));\n\n //populate order with billingAddress and shipplingAddress\n order.setBillingAddress(purchase.getBillingAddress());\n order.setShippingAddress(purchase.getShippingAddress());\n\n //populate customer with order\n Customer customer = purchase.getCustomer();\n\n // checck if the existing customer\n String theEmail = customer.getEmail();\n Customer customerFromDB = customerRepository.findByEmail(theEmail);\n\n if(customerFromDB != null){\n // we found it let assign them\n customer = customerFromDB;\n }\n\n customer.add(order);\n\n //sqve to the db\n customerRepository.save(customer);\n\n\n\n // return the response\n return new PurchaseResponse(orderTrakingNumber);\n }", "private void orderCompleted(ArrayList<Transaction> transactionList) {\n String customerName = studentDetails[0].getName();\n String customerMobile = studentDetails[0].getMobile();\n String customerEmail = studentDetails[0].getEmail();\n Order order = new Order(-1, customerName, customerMobile, customerEmail\n , \"\",\n total, discount, false);\n\n ArrayList<SubOrder> subOrderList = new ArrayList<>();\n\n for (CartItem cartItem : cartList) {\n ProductHeader product = cartItem.getProductHeader();\n subOrderList.add(new SubOrder(product.getName(), product.getId(),\n product.getSku(), cartItem.getPrice(), cartItem.getQuantity(),\n 0, 0, 0, 0, false));\n }\n\n ProductAPI.saveAndSyncOrder(getContext(), db, order, subOrderList, transactionList);\n\n Toast.makeText(getContext(), \"Order completed\", Toast.LENGTH_SHORT).show();\n cartList.clear();\n cartAdapter.notifyDataSetChanged();\n updatePriceView();\n\n cartRecyclerView.setVisibility(View.GONE);\n emptyCartView.setVisibility(View.VISIBLE);\n dismissDialog();\n }", "public void submitOrder(int quantity) {\n display(quantity);\n displayPrice(quantity * pintPrice);\n }", "public void insertDBorder(String prodID, String quantity) {\r\n try {\r\n String sql = \"INSERT INTO EmpOrders (ProductID, QuantityNeeded) VALUES ('\" + prodID + \"', '\" + quantity + \"')\";\r\n Statement stmt = Customer.connectDB();\r\n stmt.execute(sql);\r\n } catch (SQLException e) {\r\n System.out.println(e);\r\n }\r\n }", "@Transactional\n public OrderViewModel processOrder(OrderViewModel ovm){\n\n //Making sure that the Customer exist\n try{\n customerService.getCustomer(ovm.getCustomerId());\n }catch (RuntimeException e){\n throw new CustomerNotFoundException(\"No Customer found in the database for id #\" + ovm.getCustomerId() + \" !\");\n }\n\n //List to store the ProductsToBuy\n List<ProductToBuyViewModel> productsToBuy = ovm.getProductsToBuy();\n\n //List with uniques ProductsToBuy\n productsToBuy = filterProductsToBuyList(productsToBuy);\n<<<<<<< HEAD\n\n //List InvoiceITems\n List<InvoiceItemViewModel> invoiceItemsList = new ArrayList<>();\n\n<<<<<<< HEAD\n int count = 0;\n\n //The deletion is going to be processed if the Customer does not have any related invoices\n try{\n invoiceService.getInvoicesByCustomerId(id);\n count++;\n }catch (RuntimeException e){\n try{\n levelUpService.getLevelUpAccountByCustomerId(id);\n count++;\n=======\n //Order Total\n double total = 0;\n\n //List that stores the Inventory register that have to be updated\n List<InventoryViewModel> inventoriesToUpdate = new ArrayList<>();\n\n //Getting all the Inventory Rows for the productId\n for(int i = 0; i < productsToBuy.size(); i++){\n\n ProductToBuyViewModel product = productsToBuy.get(i);\n\n int productId = product.getProductId();\n\n //Checking that the product exist\n try{\n productService.getProduct(productId);\n }catch (RuntimeException e){\n throw new ProductNotFoundException(\"Cannot process your order, there is no Product associated with id number \"+ productId+ \" in the database!!\");\n }\n\n //Reading the product Price from the ProductService\n BigDecimal unitPrice = BigDecimal.valueOf(Double.valueOf(productService.getProduct(productId).getListPrice()));\n\n //Reading the Product in Stock from the InventoryService\n List<InventoryViewModel> inventoryList = inventoryService.getAllInventoriesByProductId(product.getProductId());\n\n inventoryList = orderInventoryListByQuantity(inventoryList);\n\n int totalInInventory = 0;\n>>>>>>> f00fc299981692406efd94cca8a90917049f7e46\n\n=======\n\n //List InvoiceITems\n List<InvoiceItemViewModel> invoiceItemsList = new ArrayList<>();\n\n //Order Total\n double total = 0;\n\n //List that stores the Inventory register that have to be updated\n List<InventoryViewModel> inventoriesToUpdate = new ArrayList<>();\n\n //Getting all the Inventory Rows for the productId\n for(int i = 0; i < productsToBuy.size(); i++){\n\n ProductToBuyViewModel product = productsToBuy.get(i);\n\n int productId = product.getProductId();\n\n //Checking that the product exist\n try{\n productService.getProduct(productId);\n }catch (RuntimeException e){\n throw new ProductNotFoundException(\"Cannot process your order, there is no Product associated with id number \"+ productId+ \" in the database!!\");\n }\n\n //Reading the product Price from the ProductService\n BigDecimal unitPrice = BigDecimal.valueOf(Double.valueOf(productService.getProduct(productId).getListPrice()));\n\n //Reading the Product in Stock from the InventoryService\n List<InventoryViewModel> inventoryList = inventoryService.getAllInventoriesByProductId(product.getProductId());\n\n inventoryList = orderInventoryListByQuantity(inventoryList);\n\n int totalInInventory = 0;\n\n>>>>>>> f00fc299981692406efd94cca8a90917049f7e46\n for (int i2 = 0; i2 < inventoryList.size(); i2++){\n int quantityInInventory = inventoryList.get(i2).getQuantity();\n totalInInventory = totalInInventory + quantityInInventory;\n }\n<<<<<<< HEAD\n<<<<<<< HEAD\n }\n\n if(count != 0){\n throw new DeleteNotAllowedException(\"Impossible Deletion, there is LevelUp Account associated with this Customer\");\n }\n\n }\n=======\n>>>>>>> f00fc299981692406efd94cca8a90917049f7e46\n\n int quantityToBuy = product.getQuantity();\n\n //Check if there is enough productsToBuy in the inventory.\n if(quantityToBuy > totalInInventory){\n if(totalInInventory == 0){\n throw new OutOfStockException(\"Sorry, we can not process your order the Product with the id \"+product.getProductId() +\" is out of stock!!\");\n }else{\n throw new OutOfStockException(\"Sorry, we can not process your order there is only \"+ totalInInventory +\" units of the Product with the id \" + product.getProductId());\n }\n }\n\n //List<InvoiceItemViewModel> invoiceItemsPerProduct = updateInventory(inventoryList, quantityToBuy);\n\n List<InvoiceItemViewModel> invoiceItemsPerProduct = new ArrayList<>();\n\n<<<<<<< HEAD\n return inventoryService.createInventory(ivm);\n }\n=======\n for(int i3 = 0; i3 < inventoryList.size(); i3++){\n>>>>>>> f00fc299981692406efd94cca8a90917049f7e46\n=======\n\n int quantityToBuy = product.getQuantity();\n\n //Check if there is enough productsToBuy in the inventory.\n if(quantityToBuy > totalInInventory){\n if(totalInInventory == 0){\n throw new OutOfStockException(\"Sorry, we can not process your order the Product with the id \"+product.getProductId() +\" is out of stock!!\");\n }else{\n throw new OutOfStockException(\"Sorry, we can not process your order there is only \"+ totalInInventory +\" units of the Product with the id \" + product.getProductId());\n }\n }\n\n //List<InvoiceItemViewModel> invoiceItemsPerProduct = updateInventory(inventoryList, quantityToBuy);\n\n List<InvoiceItemViewModel> invoiceItemsPerProduct = new ArrayList<>();\n\n for(int i3 = 0; i3 < inventoryList.size(); i3++){\n>>>>>>> f00fc299981692406efd94cca8a90917049f7e46\n\n InventoryViewModel inventory = inventoryList.get(i3);\n int quantityAvailablePerInventory = inventory.getQuantity();\n\n<<<<<<< HEAD\n<<<<<<< HEAD\n try{\n return inventoryService.getAllInventories();\n }catch (RuntimeException e){\n throw new InventoryNotFoundException(\"The database is empty!!! No Inventory found in the Database\");\n }\n }\n=======\n //Create an InvoiceItem\n InvoiceItemViewModel invoiceItem = new InvoiceItemViewModel();\n>>>>>>> f00fc299981692406efd94cca8a90917049f7e46\n\n if (quantityToBuy > quantityAvailablePerInventory) {\n\n<<<<<<< HEAD\n try{\n inventoryService.updateInventory(id,ivm);\n }catch (RuntimeException e){\n throw new InventoryNotFoundException(\"Impossible Update, No Inventory found in the Database for id \" + id + \"!\");\n }\n }\n=======\n quantityToBuy = quantityToBuy - quantityAvailablePerInventory;\n>>>>>>> f00fc299981692406efd94cca8a90917049f7e46\n=======\n //Create an InvoiceItem\n InvoiceItemViewModel invoiceItem = new InvoiceItemViewModel();\n\n if (quantityToBuy > quantityAvailablePerInventory) {\n\n quantityToBuy = quantityToBuy - quantityAvailablePerInventory;\n>>>>>>> f00fc299981692406efd94cca8a90917049f7e46\n\n //If the quantityToBuy is larger than the quantity available, that means that is going to empty that Inventory register\n inventory.setQuantity(0);\n\n<<<<<<< HEAD\n<<<<<<< HEAD\n try{\n return inventoryService.getInventory(id);\n }catch (RuntimeException e){\n throw new InventoryNotFoundException(\"No Inventory found in the Database for id \" + id + \"!\");\n }\n }\n\n //Delete Inventory\n public void deleteInventory(int id){\n inventoryService.deleteInventory(id);\n }\n=======\n //Updating the inventory\n //inventoryService.updateInventory(inventory.getInventoryId(), inventory);\n inventoriesToUpdate.add(inventory);\n\n //Updating the invoiceItem\n invoiceItem.setQuantity(quantityAvailablePerInventory);\n invoiceItem.setInventoryId(inventory.getInventoryId());\n>>>>>>> f00fc299981692406efd94cca8a90917049f7e46\n\n //Adding the invoice to the List\n invoiceItemsPerProduct.add(invoiceItem);\n\n<<<<<<< HEAD\n try{\n return inventoryService.getAllInventoriesByProductId(productId);\n }", "public static void submitOrder(Order order, Map<Product,Integer> products) throws Exception {\n\n\t\t\tConnection con = null;\n\t\t\tPreparedStatement stmt1 = null;\n\t\t\tPreparedStatement stmt2 = null;\n\t\t\tString sql1 = \"insert into ocgr_orders values (?,?,?,?,?,?,?,?);\";\n\t\t\tString sql2 = \"insert into ocgr_isordered values (?,?,?);\";\n\n\t\t\tDB db = new DB();\n\n\t\t\ttry {\n\t\t\t\tdb.open();\n\t\t\t\tcon = db.getConnection();\n\n\t\t\t\tstmt1 = con.prepareStatement(sql1);\n\n\t\t\t\tstmt1.setString(1,order.getId() );\n\t\t\t\tstmt1.setTimestamp(2,order.getTimestamp());\n\t\t\t\tstmt1.setBigDecimal(3,order.getTotal() );\n\t\t\t\tstmt1.setString(4,order.getAddress() );\n\t\t\t\tstmt1.setString(5,order.getStatus() );\n\t\t\t\tstmt1.setString(6,order.getPayment() );\n\t\t\t\tClient client = order.getClient();\n\t\t\t\tstmt1.setString(7,client.getId() );\n\t\t\t\tVendor vendor = order.getVendor();\n\t\t\t\tstmt1.setString(8,vendor.getId() );\n\n\t\t\t\tSystem.out.println(order.getId());\n\t\t\t\tstmt1.executeUpdate();\n\t\t\t\tSystem.out.println(order.getTotal());\n\n\t\t\t\tSet<Product> prods = products.keySet();\n\t\t\t\tIterator<Product> itr = prods.iterator();\n\n\t\t\t\twhile (itr.hasNext()) {\n\t\t\t\t\tProduct productOrdered = (Product)itr.next();\n\t\t\t\t\tSystem.out.println(productOrdered.getId());\n\n\t\t\t\t\tstmt2 = con.prepareStatement(sql2);\n\t\t\t\t\tstmt2.setString(1, order.getId() );\n\t\t\t\t\tstmt2.setString(2, productOrdered.getId() );\n\t\t\t\t\tstmt2.setInt(3, products.get(productOrdered) );\n\n\t\t\t\t\tstmt2.executeUpdate();\n\t\t\t\t}\n\n\t\t\t\tstmt1.close();\n\t\t\t\tstmt2.close();\n\t\t\t\tdb.close();\n\n\t\t\t} catch (Exception e) {\n\t\t\t\tSystem.out.println(e.getMessage());\n\t\t\t\tthrow new Exception(e.getMessage());\n\n\t\t\t} finally {\n\t\t\t\ttry {\n\t\t\t\t\tdb.close();\n\t\t\t\t} catch (Exception e) {}\n\t\t\t}\n\t\t}", "public void addOrder(HashMap<Integer, Integer> orders, int manager_id, int orderMethod, Object userObject) {\n HashMap<Integer, Product> products = new HashMap<Integer, Product>();\n double order_totalprice = 0;\n double order_price = 0;\n try {\n DBConnect connectionTester = new DBConnect();\n connectionTester.testConnection();\n\n for (int product_id : orders.keySet()) {\n\n String sql = \"select * from product where idproduct = ?\";\n PreparedStatement prpStmt = connectionTester.connection.prepareStatement(sql);\n prpStmt.setInt(1, product_id);\n\n // Not only is information requested, information like the total price is also processed\n ResultSet result = prpStmt.executeQuery();\n while (result.next()) {\n int id_product = result.getInt(\"idproduct\");\n String product_name = result.getString(\"product_name\");\n double price = result.getDouble(\"price\");\n int in_stock = result.getInt(\"in_stock\");\n String amount = result.getString(\"amount\");\n int ordered_amount = orders.get(product_id);\n if (orderMethod == 2 || orderMethod == 3) {\n order_price = result.getDouble(\"price\") * ordered_amount;\n } else if (orderMethod == 1) {\n order_price = result.getDouble(\"price\") * ordered_amount - 0.10;\n }\n\n // Calling the builder to store the information in a class\n products.put(id_product, new Product.Builder(id_product)\n .productName(product_name)\n .productPrice(price)\n .productInStock(in_stock)\n .productAmount(amount)\n .productOrderedAmount(ordered_amount)\n .productOrderPrice(order_price)\n .build());\n order_totalprice = order_totalprice + order_price;\n }\n }\n\n } catch (SQLException err) {\n System.out.println(err.getMessage());\n }\n\n reviewOrder(products, order_totalprice, manager_id, orderMethod, userObject);\n }", "@Test\n\tpublic void saveOrderLineProduct() {\n\t\t// TODO: JUnit - Populate test inputs for operation: saveOrderLineProduct \n\t\tInteger id_1 = 0;\n\t\tProduct related_product = new ecom.domain.Product();\n\t\tOrderLine response = null;\n\t\tresponse = service.saveOrderLineProduct(id_1, related_product);\n\t\t// TODO: JUnit - Add assertions to test outputs of operation: saveOrderLineProduct\n\t}", "public void orderPo(int pid) throws Exception {\n PoBean po = this.getPoById(pid);\n if (po == null) throw new Exception(\"Purchase Order doesn't exist!\");\n if (po.getStatus() != PoBean.Status.PROCESSED) throw new Exception(\"Invalid Purchase Order Status.\");\n this.setPoStatus(PoBean.Status.ORDERED, pid);\n }", "public void AddToFinalOrder(Order_Detail_Object order_detail_object) {\n\n g = (Globals) getApplication();\n // get product id of particular product from product hashmap\n String ProductId = g.getProductsHashMap().get(order_detail_object.getItem()).getID();\n if(addToCart_flag) {\n // check condition that contains ProductId\n if (g.getFinal_order().containsKey(ProductId)) {\n\n // get quantity from g.getFinal_order() into int variable\n int qty = Integer.parseInt(g.getFinal_order().get(ProductId).getQuantity());\n // increment qty\n qty = qty + 1;\n // set quantity into final_order of hashmap\n g.getFinal_order().get(ProductId).setQuantity(String.valueOf(qty));\n } else {\n // put id and order_detail_object from globals\n g.getFinal_order().put(ProductId, order_detail_object);\n }\n } else{\n product_ids_for_list.add(ProductId);\n }\n }", "public void productsToBuy(Product purchase){\n bill.getProducts().add(purchase);\n }", "public void ExecuteSellOrder() throws SQLException, InvalidOrderException, InvalidAssetException, NegativePriceException, UnitException {\n // Current asset instance\n Asset currentAsset = Asset.findAsset(this.assetID);\n\n // Check if just ordered asset has corresponding order\n\n // Find buy orders of same asset\n Statement smt = connection.createStatement();\n String sqlFindOrder\n = \"SELECT * FROM orders WHERE assetID = '\" + assetID + \"' and orderType = 'BUY' \" +\n \"and orderStatus = 'INCOMPLETE' and unitID != '\" + this.unitID + \"' \" +\n \"ORDER BY orderTime;\";\n ResultSet buyOrders = smt.executeQuery(sqlFindOrder);\n\n // List to store corresponding buy orders of the same asset\n ArrayList<Order> matchingOrders = new ArrayList<>();\n\n // Add queried rows as new Buy Orders in list\n while (buyOrders.next()) {\n matchingOrders.add(\n new BuyOrder(\n buyOrders.getString(\"orderID\"),\n buyOrders.getString(\"userID\"),\n buyOrders.getString(\"unitID\"),\n buyOrders.getString(\"assetID\"),\n buyOrders.getString(\"orderTime\").substring(0,19),\n OrderStatus.valueOf(buyOrders.getString(\"orderStatus\")),\n OrderType.valueOf(buyOrders.getString(\"orderType\")),\n buyOrders.getDouble(\"orderPrice\"),\n buyOrders.getInt(\"orderQuantity\"),\n buyOrders.getInt(\"quantFilled\"),\n buyOrders.getInt(\"quantRemain\")\n )\n );\n }\n\n // Remove orders if the buy bid is less than the sell ask\n matchingOrders.removeIf(buys -> (buys.orderPrice < this.orderPrice));\n\n // List to store required orders that can fully/partially or completely not fill order\n ArrayList<Order> requiredOrders = new ArrayList<>();\n\n // Required asset amount to facilitate quantity of this order\n int requiredQuant = this.quantRemain;\n\n // Loop through orders matching conditions and append as many orders possible to\n // fully/partially facilitate this order\n for (int i = 0; i < matchingOrders.size(); i++) {\n // Stores quantity of current order in matchingOrders list\n int quantity = matchingOrders.get(i).quantRemain;\n if (requiredQuant > 0) {\n requiredOrders.add(matchingOrders.get(i));\n requiredQuant -= quantity;\n } else if (requiredQuant <= 0) {\n break;\n }\n }\n\n // If requiredOrders is filled it can either\n // - Have enough buy orders to fully facilitate the sell order\n // * Complete sell order (set COMPLETE flag, 0 quant remain, max quant fill)\n // * Update buyer and seller inventory numbers\n // * Change buy order (INCOMPLETE, quantFilled, quantRemain)\n // - Have enough buy orders to partially fill the sell order\n // * Complete the corresponding buy order/s (set COMPLETE flag, 0 quant remain, max quant fill)\n // * Change sell order (INCOMPLETE, change quant remain, change quant filled)\n // * Add inventory entry and update corresponding inventory numbers\n\n for (int i = 0; i < requiredOrders.size(); i++) {\n // How much this order has remaining to fill\n int sellQuant = this.quantRemain;\n // How much can this corresponding order faciliate of this order\n int buyQuant = requiredOrders.get(i).quantRemain;\n\n // Track executed quantity\n int executed = 0;\n\n if (buyQuant > sellQuant) {\n // When this order has more than the quantity required to fill remaining units\n\n // Stores how many more units the buy order has over this sell order\n this.quantFilled += sellQuant;\n this.quantRemain -= sellQuant;\n\n // Deduct the amount remaining of the sell order from the quantity remaining in the buy order\n requiredOrders.get(i).quantRemain -= sellQuant;\n requiredOrders.get(i).quantFilled += sellQuant;\n executed = sellQuant;\n\n // Change quantities in database\n ChangeQuantRemainFilled(this.quantRemain, this.quantFilled);\n requiredOrders.get(i).ChangeQuantRemainFilled(requiredOrders.get(i).quantRemain, requiredOrders.get(i).quantFilled);\n\n // Set complete status of this order\n this.ChangeStatus(OrderStatus.COMPLETE);\n\n } else if (buyQuant == sellQuant) {\n // When this order has exactly the same amount required to fill remaining units\n\n // Stores how many more units the buy order has over this sell order\n this.quantFilled += sellQuant;\n this.quantRemain -= sellQuant;\n\n // Deduct the amount remaining of the sell order from the quantity remaining in the buy order\n requiredOrders.get(i).quantRemain -= sellQuant;\n requiredOrders.get(i).quantFilled += sellQuant;\n executed = sellQuant;\n\n assert requiredOrders.get(i).quantRemain == 0;\n assert requiredOrders.get(i).quantFilled == requiredOrders.get(i).orderQuant;\n\n // Change quantities in database\n this.ChangeQuantRemainFilled(this.quantRemain, this.quantFilled);\n requiredOrders.get(i).ChangeQuantRemainFilled(requiredOrders.get(i).quantRemain, requiredOrders.get(i).quantFilled);\n\n // Set complete status of this order\n this.ChangeStatus(OrderStatus.COMPLETE);\n requiredOrders.get(i).ChangeStatus(OrderStatus.COMPLETE);\n\n } else {\n // When this order has less than required amount to fill remaining units\n\n // Stores how many more units the buy order has over this sell order\n this.quantFilled += requiredOrders.get(i).quantRemain;\n this.quantRemain -= requiredOrders.get(i).quantRemain;\n\n assert this.quantRemain + this.quantFilled == this.orderQuant;\n\n // Deduct the amount remaining of the sell order from the quantity remaining in the buy order\n requiredOrders.get(i).quantRemain -= buyQuant;\n requiredOrders.get(i).quantFilled += buyQuant;\n executed = buyQuant;\n\n assert requiredOrders.get(i).quantRemain == 0;\n assert requiredOrders.get(i).quantFilled == requiredOrders.get(i).orderQuant;\n\n // Change quantities in database\n ChangeQuantRemainFilled(this.quantRemain, this.quantFilled);\n requiredOrders.get(i).ChangeQuantRemainFilled(requiredOrders.get(i).quantRemain, requiredOrders.get(i).quantFilled);\n\n // Set complete status of this order\n ChangeStatus(OrderStatus.INCOMPLETE);\n requiredOrders.get(i).ChangeStatus(OrderStatus.COMPLETE);\n\n }\n\n // Change asset price\n currentAsset.SetPrice(requiredOrders.get(i).orderPrice);\n\n // Change inventory amounts\n new InventoryItem(this.unitID, this.assetID, requiredOrders.get(i).orderPrice, -executed, this.orderID);\n new InventoryItem(requiredOrders.get(i).unitID, requiredOrders.get(i).assetID, requiredOrders.get(i).orderPrice, executed, requiredOrders.get(i).orderID);\n\n // Set credit balance of units\n Unit sellerUnit = Unit.getUnit(this.unitID);\n sellerUnit.ChangeUnitBalance(this.unitID, requiredOrders.get(i).orderPrice * executed);\n Unit buyerUnit = Unit.getUnit(requiredOrders.get(i).unitID);\n buyerUnit.ChangeUnitBalance(requiredOrders.get(i).unitID, -requiredOrders.get(i).orderPrice * executed);\n }\n\n // If requiredOrders is empty, no current buy orders are able to facilitate sell order\n\n // Modify watchlist balances\n\n }", "public static int insert(OrderItems o) {\n ConnectionPool pool = ConnectionPool.getInstance();\n Connection connection = pool.getConnection();\n PreparedStatement ps = null;\n System.out.println(\"DBSetup @ LINE 101\");\n String query\n = \"INSERT INTO orderItem (orderNumber, productCode, quantity) \"\n + \"VALUES (?, ?, ?)\";\n try {\n ps = connection.prepareStatement(query);\n ps.setInt(1, o.getOrderNumber());\n ps.setString(2, o.getProduct().getProductCode());\n ps.setInt(3, o.getQuantity());\n return ps.executeUpdate();\n } catch (SQLException e) {\n System.out.println(e);\n return 0;\n } finally {\n DBUtil.closePreparedStatement(ps);\n pool.freeConnection(connection);\n }\n }", "Product storeProduct(Product product);", "public void processRequest(String itemName, double itemPrice, Long orderId) {\n Item item = new Item(itemName, itemPrice);\n\n itemRepository.save(item);\n\n// System.out.println(item.toString());\n processQueue(item);\n }", "@Override\r\n\tpublic void insertPurchase(Purchase Purchase) throws Exception {\n\t\t\r\n\t}", "public static void PP_Order(MPPOrder o) {\n\t\tProperties ctx = o.getCtx();\n\t\tString trxName = o.get_TrxName();\n\t\t//\n\t\t// Supply\n\t\tMPPMRP mrpSupply = getQuery(o, TYPEMRP_Supply, ORDERTYPE_ManufacturingOrder).firstOnly();\n\t\tif (mrpSupply == null) {\n\t\t\tmrpSupply = new MPPMRP(ctx, 0, trxName);\n\t\t\tmrpSupply.setAD_Org_ID(o.getAD_Org_ID());\n\t\t\tmrpSupply.setTypeMRP(MPPMRP.TYPEMRP_Supply);\n\t\t}\n\t\tmrpSupply.setPP_Order(o);\n\t\tmrpSupply.setPriority(o.getPriorityRule());\n\t\tmrpSupply.setPlanner_ID(o.getPlanner_ID());\n\t\tmrpSupply.setM_Product_ID(o.getM_Product_ID());\n\t\tmrpSupply.setM_Warehouse_ID(o.getM_Warehouse_ID());\n\t\tmrpSupply.setQty(o.getQtyOrdered().subtract(o.getQtyDelivered()));\n\t\tmrpSupply.save();\n\t\t//\n\t\t// Demand\n\t\tList<MPPMRP> mrpDemandList = getQuery(o, TYPEMRP_Demand, ORDERTYPE_ManufacturingOrder).list();\n\t\tfor (MPPMRP mrpDemand : mrpDemandList) {\n\t\t\tmrpDemand.setPP_Order(o);\n\t\t\tmrpDemand.save();\n\t\t}\n\t}", "@Test\n\tpublic void testProcessInventoryUpdateOrderPlaced() {\n\t\tfinal Inventory inventory = new InventoryImpl();\n\t\tinventory.setUidPk(INVENTORY_UID_1000);\n\t\tinventory.setQuantityOnHand(QUANTITY_ONHAND);\n\t\tinventory.setWarehouseUid(WAREHOUSE_UID);\n\n\t\tfinal ProductSku productSku = new ProductSkuImpl();\n\t\tproductSku.setSkuCode(SKU_CODE);\n\t\tfinal ProductImpl product = new ProductImpl();\n\t\tproduct.setAvailabilityCriteria(AvailabilityCriteria.AVAILABLE_WHEN_IN_STOCK);\n\t\tproductSku.setProduct(product);\n\t\tinventory.setSkuCode(productSku.getSkuCode());\n\n\t\tfinal Order order = new OrderImpl();\n\t\torder.setUidPk(ORDER_UID_2000);\n\n\t\tfinal InventoryJournalRollupImpl ijRollup = new InventoryJournalRollupImpl();\n\t\tijRollup.setAllocatedQuantityDelta(QUANTITY_10);\n\n\t\tcontext.checking(new Expectations() {\n\t\t\t{\n\t\t\t\tInventoryJournalImpl inventoryJournal = new InventoryJournalImpl();\n\t\t\t\tallowing(beanFactory).getBean(EXECUTION_RESULT); will(returnValue(new InventoryExecutionResultImpl()));\n\t\t\t\tallowing(beanFactory).getBean(INVENTORY_JOURNAL);\n\t\t\t\twill(returnValue(inventoryJournal));\n\t\t\t\tallowing(inventoryDao).getInventory(SKU_CODE, WAREHOUSE_UID); will(returnValue(inventory));\n\t\t\t\tallowing(inventoryJournalDao).getRollup(inventoryKey); will(returnValue(ijRollup));\n\n\t\t\t\toneOf(inventoryJournalDao).saveOrUpdate(inventoryJournal); will(returnValue(new InventoryJournalImpl()));\n\t\t\t}\n\t\t});\n\n\n\n\t\tproductInventoryManagementService.processInventoryUpdate(\n\t\t\t\tproductSku, WAREHOUSE_UID,\tInventoryEventType.STOCK_ALLOCATE, EVENT_ORIGINATOR_TESTER, QUANTITY_10, order, null);\n\n\t\t// WE SHALL CHECK THE RESULT FROM processInventoryUpdate()\n\t\tInventoryDto inventoryDto = productInventoryManagementService.getInventory(inventory.getSkuCode(), inventory.getWarehouseUid());\n\t\tassertEquals(inventoryDto.getQuantityOnHand(), QUANTITY_ONHAND);\n\t\tassertEquals(inventoryDto.getAvailableQuantityInStock(), QUANTITY_ONHAND - QUANTITY_10);\n\t\tassertEquals(inventoryDto.getAllocatedQuantity(), QUANTITY_10);\n\t}", "@Override\r\n\tpublic void ManageProduct() {\n\t\tint id = this.view.enterId();\r\n\t\tString name = this.view.enterName();\r\n\t\tfloat price = this.view.enterPrice();\r\n\t\tint quantity = this.view.enterQuantity();\r\n\t\t\r\n\t\tthis.model.updProduct(id, name, price, quantity);\r\n\t}", "public void saveOrder() {\n setVisibility();\n Order order = checkInputFromUser();\n if (order == null){return;}\n if(orderToLoad != null) DBSOperations.remove(connection,orderToLoad);\n DBSOperations.add(connection, order);\n }", "private void buyProduct() {\n\t\tSystem.out.println(\"Enter Number of Product :- \");\n\t\tint numberOfProduct = getValidInteger(\"Enter Number of Product :- \");\n\t\twhile (!StoreController.getInstance().isValidNumberOfProduct(\n\t\t\t\tnumberOfProduct)) {\n\t\t\tSystem.out.println(\"Enter Valid Number of Product :- \");\n\t\t\tnumberOfProduct = getValidInteger(\"Enter Number of Product :- \");\n\t\t}\n\t\tfor (int number = 1; number <= numberOfProduct; number++) {\n\t\t\tSystem.out.println(\"Enter \" + number + \" Product Id\");\n\t\t\tint productId = getValidInteger(\"Enter \" + number + \" Product Id\");\n\t\t\twhile (!StoreController.getInstance().isValidProductId(productId)) {\n\t\t\t\tSystem.out.println(\"Enter Valid Product Id\");\n\t\t\t\tproductId = getValidInteger(\"Enter \" + number + \" Product Id\");\n\t\t\t}\n\t\t\tSystem.out.println(\"Enter product Quantity\");\n\t\t\tint quantity = getValidInteger(\"Enter product Quantity\");\n\t\t\tCartController.getInstance().addProductToCart(productId, quantity);\n\t\t}\n\t}", "@Before\n\tpublic void setup() {\n\t\torder = new Order();\n\t\torder.setOrderdate(java.util.Calendar.getInstance().getTime());\n\t\torder.setTotalPrice(Double.valueOf(\"1500.99\"));\n\t\t\n\t\tshoppingCartdetails = new ShoppingCartDetails();\n\t\tshoppingCartdetails.setProductId(12345);\n\t\tshoppingCartdetails.setPrice(Double.valueOf(\"153.50\"));\n\t\tshoppingCartdetails.setQuantity(3);\n\t\tshoppingCartdetails.setShoppingCart(shoppingCart);\n\t\t\n\t\tshoppingCartSet.add(shoppingCartdetails);\n\t\t\n\t\tshoppingCartdetails = new ShoppingCartDetails();\n\t\tshoppingCartdetails.setProductId(45738);\n\t\tshoppingCartdetails.setPrice(Double.valueOf(\"553.01\"));\n\t\tshoppingCartdetails.setQuantity(1);\n\t\tshoppingCartdetails.setShoppingCart(shoppingCart);\n\t\t\n\t\tshoppingCartSet.add(shoppingCartdetails);\n\t}", "private void saveProduct() {\n Product product;\n String name = productName.getText().toString();\n if (name.isEmpty()) {\n productName.setError(getResources().getText(R.string.product_name_error));\n return;\n }\n String brandStr = brand.getText().toString();\n String brandOwnerStr = brandOwner.getText().toString();\n if (dbProduct == null) {\n product = new Product();\n product.setGtin(gtin);\n product.setLanguage(language);\n } else {\n product = dbProduct;\n }\n if (!name.isEmpty()) {\n product.setName(name);\n }\n if (!brandStr.isEmpty()) {\n product.setBrand(brandStr);\n }\n if (!brandOwnerStr.isEmpty()) {\n product.setBrandOwner(brandOwnerStr);\n }\n product.setCategory(selectedCategoryKey);\n LoadingIndicator.show();\n // TODO enable/disable save button\n PLYCompletion<Product> completion = new PLYCompletion<Product>() {\n @Override\n public void onSuccess(Product result) {\n Log.d(\"SavePDetailsCallback\", \"Product details saved\");\n dbProduct = result;\n LoadingIndicator.hide();\n if (isNewProduct) {\n SnackbarUtil.make(getActivity(), getView(), R.string.product_saved, Snackbar\n .LENGTH_LONG).show();\n DataChangeListener.productCreate(result);\n } else {\n SnackbarUtil.make(getActivity(), getView(), R.string.product_edited, Snackbar\n .LENGTH_LONG).show();\n DataChangeListener.productUpdate(result);\n }\n }\n\n @Override\n public void onPostSuccess(Product result) {\n FragmentActivity activity = getActivity();\n if (activity != null) {\n activity.onBackPressed();\n }\n }\n\n @Override\n public void onError(PLYAndroid.QueryError error) {\n Log.d(\"SavePDetailsCallback\", error.getMessage());\n if (isNewProduct || !error.isHttpStatusError() || !error.hasInternalErrorCode\n (PLYStatusCodes.OBJECT_NOT_UPDATED_NO_CHANGES_CODE)) {\n SnackbarUtil.make(getActivity(), getView(), error.getMessage(), Snackbar.LENGTH_LONG)\n .show();\n }\n LoadingIndicator.hide();\n }\n\n @Override\n public void onPostError(PLYAndroid.QueryError error) {\n if (!isNewProduct && error.isHttpStatusError() && error.hasInternalErrorCode(PLYStatusCodes\n .OBJECT_NOT_UPDATED_NO_CHANGES_CODE)) {\n FragmentActivity activity = getActivity();\n if (activity != null) {\n activity.onBackPressed();\n }\n }\n }\n };\n if (dbProduct == null) {\n ProductService.createProduct(sequentialClient, product, completion);\n } else {\n ProductService.updateProduct(sequentialClient, product, completion);\n }\n }", "public void submitOrder() {\n int price = quantity*5;\n displayPrice(price);\n }", "public void buyProduct(String productName) throws ProductNotFoundException {\r\n\r\n if (doesRecentOrderExist(productName)) {\r\n reorderProduct(productName);\r\n } else {\r\n //Create a new order to be given to the WebMarket\r\n Order newOrder = new Order(this, productName, \"buy\", \"pending\");\r\n\r\n //Acknowlegement print statment\r\n System.out.println(\"CUSTOMER: Request NEW purchase of - \" + newOrder.getProductName());\r\n\r\n //Send the order to WebMarket via placeNewOrder()\r\n market.placeNewOrder(newOrder);\r\n\r\n //Add this order to the customers personel list of orders\r\n orderHistory.add(newOrder);\r\n }\r\n }", "@Transactional\n @Override\n public StringBuffer addSalesOrderTparts(String customerID, String cartIDs, String addressID, String paymentType,\n String orderAmount, String scoreAll, String memo, String itemCount, String itemID,\n String supplierID, String itemType, String orderType, String objID, String invoiceType,\n String invoiceTitle, String generateType, String orderID,String memoIDs,String allFreight, String supplierFreightStr) throws Exception {\n \t\n String ids[] = cartIDs.split(\",\");\n String memos[] = memoIDs.split(\",\");\n List<ShoppingCartVO> shopCartList = new ArrayList<ShoppingCartVO>();\n for (String id : ids) {\n ShoppingCartVO shoppingCartVO = shoppingCartDAO.findShoppingCartByID(Long.valueOf(id));\n shopCartList.add(shoppingCartVO);\n }\n Map<String,List<ShoppingCartVO>> maps = new HashMap<String,List<ShoppingCartVO>>();\n for(ShoppingCartVO s:shopCartList){\n \tList<ShoppingCartVO> temp = new ArrayList<ShoppingCartVO>();\n \t String sid1= s.getSupplierID();\n String siname1= s.getSupplierName();\n for(ShoppingCartVO shoppingCartVO1 : shopCartList){\n \t//当前店铺对应的购物车集合\n \tString sid2 = shoppingCartVO1.getSupplierID();\n \tif(sid1.equals(sid2)){\n \t\ttemp.add(shoppingCartVO1);\n \t}\n }\n maps.put(sid1+\"_\"+siname1, temp);\n }\n \n //根据物流模板计算运费\n Map<String, Double> supplierFreightMap = new HashMap<String, Double>();\n String[] supplierFreightAll = null;\n if(StringUtil.isNotEmpty(supplierFreightStr))\n {\n \tsupplierFreightAll = supplierFreightStr.split(\"\\\\|\");\n for (int i = 0; i < supplierFreightAll.length; i++) {\n \tString[] supplierFreight = supplierFreightAll[i].split(\":\");\n \tsupplierFreightMap.put(supplierFreight[0], Double.parseDouble(supplierFreight[1]));\n \t\t} \t\n }\n \n \n StringBuffer ordersList = new StringBuffer();\n int num = 0;\n// cachedClient.delete(customerID + orderID);\n Set<String> set = maps.keySet();\n\t\tfor(String string : set){\n\t\t List<ShoppingCartVO> temp1= maps.get(string);\n\t\t double supplierFreight = 0d;\n\t\t if(supplierFreightMap.size()>0)\n\t\t {\n\t\t\t supplierFreight = supplierFreightMap.get(string);\n\t\t }\n\t\t Double amount = 0d;\n\t\t Integer count = 0;\n Integer score = 0;\n Double weight = 0d;\n\t\t for (ShoppingCartVO shoppingCartVO : temp1) {\n ItemVO itemVO = itemDAO.findItemById(shoppingCartVO.getItemID());\n count += shoppingCartVO.getItemCount();\n // weight += itemVO.getWeight();\n if (shoppingCartVO.getType() == 1) {\n amount += shoppingCartVO.getItemCount() * shoppingCartVO.getSalesPrice();\n } else if (shoppingCartVO.getType() == 2) {\n score += shoppingCartVO.getItemCount() * itemVO.getScore();\n } else if (shoppingCartVO.getType() == 3) {\n amount += shoppingCartVO.getItemCount() * itemVO.getScorePrice();\n score += shoppingCartVO.getItemCount() * shoppingCartVO.getSalesScore();\n }\n }\n\t\t //SalesOrderVO tempOrder = new SalesOrderVO();\n\t /*if (tempOrder == null) {\n\t throw new Exception(\"参数错误\");\n\t }\n\t if (\"012\".indexOf(invoiceType) == -1) {\n\t throw new Exception(\"参数错误\");\n\t }*/\n\t SalesOrderDTO salesOrderDTO = new SalesOrderDTO();\n\t salesOrderDTO.setMainID(randomNumeric());\n\t salesOrderDTO.setCustomerID(customerID);\n\t salesOrderDTO.setPaymentType(Integer.valueOf(paymentType));\n\t salesOrderDTO.setPaymentStatus(0);\n\n\t // salesOrderDTO.setExpressFee(tempOrder.getExpressFee());//运费\n\t salesOrderDTO.setProductAmount(amount);\n\t salesOrderDTO.setTotalAmount(amount + supplierFreight);\n\t salesOrderDTO.setPayableAmount(amount);\n\n\t salesOrderDTO.setOrderType(Integer.valueOf(orderType));\n\t salesOrderDTO.setMemo(getMemoBySupplier(memos,string.split(\"_\")[0]));\n\t salesOrderDTO.setInvoiceType(Integer.parseInt(invoiceType));\n\t salesOrderDTO.setInvoiceTitle(invoiceTitle);\n\t salesOrderDTO.setSupplierID(string);\n\t salesOrderDTO.setExpressFee(supplierFreight);\n\t salesOrderDAO.addSalesOrder(salesOrderDTO);\n\t ordersList.append(salesOrderDTO.getMainID()+\",\");\n\t // 支付方式1:余额支付2:货到付款3:在线支付4:积分礼品5:线下汇款\n\t if(!paymentType.equals(\"3\")){\n\t \t//3:在线支付\n\t \t CustomerDeliveryAddressVO customerDeliveryAddressVO = customerDeliveryAddressDAO.findAddressByID(Long.valueOf(addressID));\n\t \t if (customerDeliveryAddressVO != null) {\n\t \t SalesOrderDeliveryAddressDTO salesOrderDeliveryAddressDTO = new SalesOrderDeliveryAddressDTO();\n\t \t salesOrderDeliveryAddressDTO.setSalesOrderID(salesOrderDTO.getMainID());\n\t \t salesOrderDeliveryAddressDTO.setName(customerDeliveryAddressVO.getName());\n\t \t salesOrderDeliveryAddressDTO.setCountryID(customerDeliveryAddressVO.getCountryID());\n\t \t salesOrderDeliveryAddressDTO.setProvinceID(customerDeliveryAddressVO.getProvinceID());\n\t \t salesOrderDeliveryAddressDTO.setCityID(customerDeliveryAddressVO.getCityID());\n\t \t salesOrderDeliveryAddressDTO.setDisctrictID(customerDeliveryAddressVO.getDisctrictID());\n\t \t salesOrderDeliveryAddressDTO.setAddress(customerDeliveryAddressVO.getAddress());\n\t \t salesOrderDeliveryAddressDTO.setMobile(customerDeliveryAddressVO.getMobile());\n\t \t salesOrderDeliveryAddressDTO.setTelephone(customerDeliveryAddressVO.getTelephone());\n\t \t if (customerDeliveryAddressVO.getZip() != null) {\n\t \t salesOrderDeliveryAddressDTO.setZip(customerDeliveryAddressVO.getZip());\n\t \t }\n\t \t salesOrderDeliveryAddressDAO.insertSalesOrderDeliveryAddress(salesOrderDeliveryAddressDTO);\n\t \t }\n\t \t ShippingAddressVO shippingAddressVO = shippingAddressDAO.findDefaultShippingAddress();\n\t \t if (shippingAddressVO != null) {\n\t \t SalesOrderShippingAddressDTO salesOrderShippingAddressDTO = new SalesOrderShippingAddressDTO();\n\t \t salesOrderShippingAddressDTO.setSalesOrderID(salesOrderDTO.getMainID());\n\t \t salesOrderShippingAddressDTO.setName(shippingAddressVO.getName());\n\t \t salesOrderShippingAddressDTO.setCountryID(shippingAddressVO.getCountryID());\n\t \t salesOrderShippingAddressDTO.setProvinceID(shippingAddressVO.getProvinceID());\n\t \t salesOrderShippingAddressDTO.setCityID(shippingAddressVO.getCityID());\n\t \t salesOrderShippingAddressDTO.setDisctrictID(shippingAddressVO.getDisctrictID());\n\t \t salesOrderShippingAddressDTO.setAddress(shippingAddressVO.getAddress());\n\t \t salesOrderShippingAddressDTO.setMobile(shippingAddressVO.getMobile());\n\t \t salesOrderShippingAddressDTO.setTelephone(shippingAddressVO.getTelephone());\n\t \t salesOrderShippingAddressDTO.setZip(shippingAddressVO.getZip());\n\t \t salesOrderShippingAddressDAO.insertSalesOrderShippingAddress(salesOrderShippingAddressDTO);\n\t \t }\n\t }\n\t \n\t ItemDTO itemDTO = new ItemDTO();\n\t SupplierItemDTO supplierItemDTO = new SupplierItemDTO();\n\t SalesOrderLineDTO salesOrderLineDTO = new SalesOrderLineDTO();\n\t if (generateType.equals(\"quickBuy\")) {\n\t generateQuickBuyOrder(itemCount,cartIDs, itemID, supplierID, objID, salesOrderDTO, itemDTO, supplierItemDTO,\n\t salesOrderLineDTO);\n\n\t } else if (generateType.equals(\"oneKey\")) {\n\t generateOneKeyOrder(customerID, itemCount, itemType, objID, salesOrderDTO, itemDTO, supplierItemDTO,\n\t salesOrderLineDTO);\n\n\t } else if (generateType.equals(\"shoppingcart\")) {\n\t \tgenarateShoppingCartOrderTparts(customerID, cartIDs, itemCount, itemType, objID, salesOrderDTO, itemDTO,\n\t supplierItemDTO, salesOrderLineDTO);\n\t } else {\n\t throw new Exception(\"订单类型无法确定\");\n\t }\n\t num++;\n\t\t}\n return ordersList;\n }", "public void submitOrder(BeverageOrder order);", "public void execute() {\n\t\tif(p.getType().equals(\"Manufacturing\")) {\n\t\t\tArrayList<Item> items = DatabaseSupport.getItems();\n\t\t\tIterator<Item> it = items.iterator();\n\t\t\tItem i;\n\t\t\twhile(it.hasNext()) {\n\t\t\t\ti = it.next();\n\t\t\t\tint a = InputController.promptInteger(\"How many \"+i.getName()+\" were manufactured? (0 for none)\", 0, Integer.MAX_VALUE);\n\t\t\t\tif(a>0) {\n\t\t\t\t\tWarehouseFloorItem n = p.getFloorItemByItem(i);\n\t\t\t\t\tif(n==null) {\n\t\t\t\t\t\tString newFloorLocation = InputController.promptString(\"This item does not have a floor location.\\nPlease specify a new one for this item.\");\n\t\t\t\t\t\tp.addFloorLocation(new WarehouseFloorItem(newFloorLocation, i, a));\n\t\t\t\t\t} else {\n\t\t\t\t\t\tn.setQuantity(n.getQuantity()+a);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t} else {\n\t\t\tArrayList<Shipment> shipments = DatabaseSupport.getIncomingOrders(p);\n\t\t\tif(shipments.size()>0) {\n\t\t\t\tIterator<Shipment> i;\n\t\t\t\tint k = -1;\n\t\t\t\tShipment a;\n\t\t\t\twhile(k!=0) {\n\t\t\t\t\ti = shipments.iterator();\n\t\t\t\t\tk = 0;\n\t\t\t\t\twhile(i.hasNext()) {\n\t\t\t\t\t\ta = i.next();\n\t\t\t\t\t\tk++;\n\t\t\t\t\t\tSystem.out.println(k+\". \"+a.getShipmentID()+\" - \"+a.getOrderSize()+\" different items\");\n\t\t\t\t\t}\n\t\t\t\t\tk = InputController.promptInteger(\"Please enter the number next to the shipment ID to\\nselect a shipment to handle (0 to quit)\",0,shipments.size());\n\t\t\t\t\tif(k!=0) {\n\t\t\t\t\t\ta = shipments.get(k);\n\t\t\t\t\t\tIterator<ShipmentItem> b = a.getShipmentItems().iterator();\n\t\t\t\t\t\tShipmentItem c;\n\t\t\t\t\t\tString temp;\n\t\t\t\t\t\twhile(b.hasNext()) {\n\t\t\t\t\t\t\tc = b.next();\n\t\t\t\t\t\t\tWarehouseFloorItem d = p.getFloorItemByItem(c.getItem());\n\t\t\t\t\t\t\tif(d==null) {\n\t\t\t\t\t\t\t\ttemp = InputController.promptString(c.getItem().getName()+\" does not have a floor location yet.\\nPlease input a floor location for it.\");\n\t\t\t\t\t\t\t\td = new WarehouseFloorItem(temp, c.getItem(),0);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\ttemp = InputController.promptString(\"\\nItem: \"+c.getItem().getName()+\"\\nQuantity: \"+c.getQuantity()+\"\\n\\nPress enter once you are done loading this item.\");\n\t\t\t\t\t\t\td.setQuantity(d.getQuantity()+c.getQuantity());\n\t\t\t\t\t\t}\n\t\t\t\t\t\tk=0;\n\t\t\t\t\t\ta.setShipped();\n\t\t\t\t\t\tSystem.out.println(\"\\nShipment \"+a.getShipmentID()+\" loaded successfully\\n\");\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tSystem.out.println(\"There are no incoming shipments.\");\n\t\t\t}\n\t\t}\n\t}", "public boolean placeOrder(int pId) {\n\t\tboolean orderFulfilled = false;\n\n\t\tProduct product = new Product();\n\t\t//checks if product is available\n\t\tif (InventoryService.isAvailable(product)) {\n\t\t\tlogger.info(\"Product with ID: {} is available.\", product.getId());\n\t\t\t//paying service\n\t\t\tboolean paymentConfirmed = PaymentService.makePayment();\n\n\t\t\tif (paymentConfirmed) {\n\t\t\t\tlogger.info(\"Payment confirmed...\");\n\t\t\t\t//shipping service\n\t\t\t\tShippingService.shipProduct(product);\n\t\t\t\tlogger.info(\"Product shipped...\");\n\t\t\t\torderFulfilled = true;\n\t\t\t}\n\n\t\t}\n\t\treturn orderFulfilled;\n\t}", "public void placeOrder(TradeOrder order)\r\n {\r\n brokerage.placeOrder(order);\r\n }", "public void insertDB(int orderID, String prodID, String quantity) {\r\n try {\r\n String sql = \"INSERT INTO EmpOrders VALUES ('\" + orderID + \"', '\"\r\n + prodID + \"', '\" + quantity + \"')\";\r\n Statement stmt = Customer.connectDB();\r\n stmt.execute(sql);\r\n } catch (SQLException e) {\r\n System.out.println(e);\r\n }\r\n }", "public static Result confirmOrder(Orders orderObj){\n \n Result result = Result.FAILURE_PROCESS;\n MysqlDBOperations mysql = new MysqlDBOperations();\n ResourceBundle rs = ResourceBundle.getBundle(\"com.generic.resources.mysqlQuery\");\n Connection conn = mysql.getConnection();\n PreparedStatement preStat;\n boolean isSuccessInsertion;\n \n// if(!Checker.isValidDate(date))\n// return Result.FAILURE_CHECKER_DATE;\n\n try{ \n String order_id = Util.generateID();\n \n preStat = conn.prepareStatement(rs.getString(\"mysql.order.update.insert.1\"));\n preStat.setString(1, order_id);\n preStat.setString(2, \"1\" );\n preStat.setInt(3, 0);\n preStat.setLong(4, orderObj.getDate());\n preStat.setLong(5, orderObj.getDelay());\n preStat.setString(6, orderObj.getNote());\n preStat.setDouble(7, -1);\n preStat.setString(8, orderObj.getUserAddressID());\n preStat.setString(9, orderObj.getDistributerAddressID());\n \n \n if(preStat.executeUpdate()==1){\n List<OrderProduct> orderProductList = orderObj.getOrderProductList();\n isSuccessInsertion = orderProductList.size()>0;\n\n // - * - If process fail then break operation\n insertionFail:\n for(OrderProduct orderProduct:orderProductList){\n preStat = conn.prepareStatement(rs.getString(\"mysql.orderProduct.update.insert.1\"));\n preStat.setString(1, order_id);\n preStat.setString(2, orderProduct.getCompanyProduct_id());\n preStat.setDouble(3, orderProduct.getQuantity());\n\n if(preStat.executeUpdate()!=1){\n isSuccessInsertion = false;\n break insertionFail;\n }\n }\n\n // - * - Return success\n if(isSuccessInsertion){\n mysql.commitAndCloseConnection();\n return Result.SUCCESS.setContent(\"Siparişiniz başarılı bir şekilde verilmiştir...\");\n }\n\n // - * - If operation fail then rollback \n mysql.rollbackAndCloseConnection();\n }\n\n } catch (Exception ex) {\n mysql.rollbackAndCloseConnection();\n Logger.getLogger(DBOrder.class.getName()).log(Level.SEVERE, null, ex);\n return Result.FAILURE_PROCESS.setContent(ex.getMessage());\n } finally {\n mysql.closeAllConnection();\n } \n\n return result;\n }", "public void orderCheckOut(double product_totalprice, HashMap<Integer, Product> products, int manager_id, int orderMethod, Object userObject) {\n try {\n DBConnect connectionTester = new DBConnect();\n connectionTester.testConnection();\n double new_budget = 0;\n\n // The SQL for buying is empty, this is because the SQL differs between employee and manager\n // Before calling sqlSupermarket, sqlGetSupermarket is called to verify the correct supermarket\n String sqlBuy = \"\";\n String sqlProduct = \"update product set in_stock = ? where idproduct = ?\";\n String sqlGetSupermarket = \"select budget from supermarket where manager_idmanager = ?\";\n String sqlSupermarket = \"update supermarket set budget = ? where manager_idmanager = ?\";\n\n for (int product_id : products.keySet()) {\n PreparedStatement prpStmtGetSupermarket = connectionTester.connection.prepareStatement(sqlGetSupermarket);\n prpStmtGetSupermarket.setInt(1, manager_id);\n\n // For each product, the supermarket budget is altered\n ResultSet supermarketResult = prpStmtGetSupermarket.executeQuery();\n while (supermarketResult.next()) {\n if (orderMethod == 1) {\n new_budget = supermarketResult.getDouble(\"budget\") - product_totalprice;\n } else if (orderMethod == 3 || orderMethod == 2) {\n new_budget = supermarketResult.getDouble(\"budget\") + product_totalprice;\n }\n }\n\n // For each product, the stock of the product is altered\n PreparedStatement prpStmtProduct = connectionTester.connection.prepareStatement(sqlProduct);\n if (orderMethod == 1) {\n prpStmtProduct.setInt(1, products.get(product_id).in_stock + products.get(product_id).ordered_amount);\n } else if (orderMethod == 3 || orderMethod == 2) {\n prpStmtProduct.setInt(1, products.get(product_id).in_stock - products.get(product_id).ordered_amount);\n }\n prpStmtProduct.setInt(2, products.get(product_id).product_id);\n prpStmtProduct.execute();\n }\n System.out.println(\"Products updated successfully!\");\n\n // The SQL for updating the supermarket is prepared\n // The new budget is the total price of all the products\n PreparedStatement prpStmtSupermarket = connectionTester.connection.prepareStatement(sqlSupermarket);\n prpStmtSupermarket.setDouble(1, new_budget);\n prpStmtSupermarket.setInt(2, manager_id);\n prpStmtSupermarket.execute();\n System.out.println(\"Supermarket updated successfully!\");\n\n // When buying, the budget of the role is also updated.\n // To find the correct user to update, there are two possible SQL's, one for the id of employee and one for manager\n if (orderMethod == 2) {\n if (userObject instanceof Manager) {\n sqlBuy = \"update manager set budget = ? where idmanager = ?\";\n PreparedStatement prpStmtManager = connectionTester.connection.prepareStatement(sqlBuy);\n prpStmtManager.setDouble(1, ((Manager) userObject).budget - product_totalprice);\n prpStmtManager.setInt(2, ((Manager) userObject).manager_id);\n prpStmtManager.execute();\n } else if (userObject instanceof Employee) {\n sqlBuy = \"update employee set budget = ? where idemployee = ?\";\n PreparedStatement prpStmtEmployee = connectionTester.connection.prepareStatement(sqlBuy);\n prpStmtEmployee.setDouble(1, ((Employee) userObject).budget - product_totalprice);\n prpStmtEmployee.setInt(2, ((Employee) userObject).employee_id);\n prpStmtEmployee.execute();\n }\n\n }\n System.out.println(\"Order processed!\");\n } catch (SQLException err) {\n System.out.println(err.getMessage());\n }\n }", "public void submit(OrderInternal order_, OrderManagementContext orderManagementContext_);", "public void insertOrderedItems(TireList orderedItems){\n for(int i=0; i<orderedItems.listSize(); i++){\n int temp = Integer.parseInt(orderedItems.getTire(i).getStock()) - orderedItems.getTire(i).getQuantity();\n orderedItems.getTire(i).setStock(temp + \"\");\n orderedItems.getTire(i).updateTire();\n sql=\"Insert into OrderedItems (OrderID, TireID, Quantity) VALUES ('\"+newID+\"','\"+orderedItems.getTire(i).getStockID()+\"',\"+orderedItems.getTire(i).getQuantity()+\")\";\n db.insertDB(sql); \n }\n }", "private void InsertBillItems() {\n\n // Inserted Row Id in database table\n long lResult = 0;\n\n // Bill item object\n BillItem objBillItem;\n\n // Reset TotalItems count\n iTotalItems = 0;\n\n Cursor crsrUpdateItemStock = null;\n\n for (int iRow = 0; iRow < tblOrderItems.getChildCount(); iRow++) {\n objBillItem = new BillItem();\n\n TableRow RowBillItem = (TableRow) tblOrderItems.getChildAt(iRow);\n\n // Increment Total item count if row is not empty\n if (RowBillItem.getChildCount() > 0) {\n iTotalItems++;\n }\n\n // Bill Number\n objBillItem.setBillNumber(tvBillNumber.getText().toString());\n Log.d(\"InsertBillItems\", \"InvoiceNo:\" + tvBillNumber.getText().toString());\n\n // richa_2012\n //BillingMode\n objBillItem.setBillingMode(String.valueOf(jBillingMode));\n Log.d(\"InsertBillItems\", \"Billing Mode :\" + String.valueOf(jBillingMode));\n\n // Item Number\n if (RowBillItem.getChildAt(0) != null) {\n CheckBox ItemNumber = (CheckBox) RowBillItem.getChildAt(0);\n objBillItem.setItemNumber(Integer.parseInt(ItemNumber.getText().toString()));\n Log.d(\"InsertBillItems\", \"Item Number:\" + ItemNumber.getText().toString());\n\n crsrUpdateItemStock = db.getItemss(Integer.parseInt(ItemNumber.getText().toString()));\n }\n\n // Item Name\n if (RowBillItem.getChildAt(1) != null) {\n TextView ItemName = (TextView) RowBillItem.getChildAt(1);\n objBillItem.setItemName(ItemName.getText().toString());\n Log.d(\"InsertBillItems\", \"Item Name:\" + ItemName.getText().toString());\n }\n\n if (RowBillItem.getChildAt(2) != null) {\n TextView HSN = (TextView) RowBillItem.getChildAt(2);\n objBillItem.setHSNCode(HSN.getText().toString());\n Log.d(\"InsertBillItems\", \"Item HSN:\" + HSN.getText().toString());\n }\n\n // Quantity\n double qty_d = 0.00;\n if (RowBillItem.getChildAt(3) != null) {\n EditText Quantity = (EditText) RowBillItem.getChildAt(3);\n String qty_str = Quantity.getText().toString();\n if(qty_str==null || qty_str.equals(\"\"))\n {\n Quantity.setText(\"0.00\");\n }else\n {\n qty_d = Double.parseDouble(qty_str);\n }\n\n objBillItem.setQuantity(Float.parseFloat(String.format(\"%.2f\",qty_d)));\n Log.d(\"InsertBillItems\", \"Quantity:\" + Quantity.getText().toString());\n\n if (crsrUpdateItemStock!=null && crsrUpdateItemStock.moveToFirst()) {\n // Check if item's bill with stock enabled update the stock\n // quantity\n if (BillwithStock == 1) {\n UpdateItemStock(crsrUpdateItemStock, Float.parseFloat(Quantity.getText().toString()));\n }\n\n\n }\n }\n\n // Rate\n double rate_d = 0.00;\n if (RowBillItem.getChildAt(4) != null) {\n EditText Rate = (EditText) RowBillItem.getChildAt(4);\n String rate_str = Rate.getText().toString();\n if((rate_str==null || rate_str.equals(\"\")))\n {\n Rate.setText(\"0.00\");\n }else\n {\n rate_d = Double.parseDouble(rate_str);\n }\n\n objBillItem.setValue(Float.parseFloat(String.format(\"%.2f\",rate_d)));\n Log.d(\"InsertBillItems\", \"Rate:\" + Rate.getText().toString());\n }\n // oRIGINAL rate in case of reverse tax\n\n if (RowBillItem.getChildAt(27) != null) {\n TextView originalRate = (TextView) RowBillItem.getChildAt(27);\n objBillItem.setOriginalRate(Double.parseDouble(originalRate.getText().toString()));\n Log.d(\"InsertBillItems\", \"Original Rate :\" + objBillItem.getOriginalRate());\n }\n if (RowBillItem.getChildAt(28) != null) {\n TextView TaxableValue = (TextView) RowBillItem.getChildAt(28);\n objBillItem.setTaxableValue(Double.parseDouble(TaxableValue.getText().toString()));\n Log.d(\"InsertBillItems\", \"TaxableValue :\" + objBillItem.getTaxableValue());\n }\n\n // Amount\n if (RowBillItem.getChildAt(5) != null) {\n TextView Amount = (TextView) RowBillItem.getChildAt(5);\n objBillItem.setAmount(Double.parseDouble(Amount.getText().toString()));\n String reverseTax = \"\";\n if (!(crsrSettings.getInt(crsrSettings.getColumnIndex(\"Tax\")) == 1)) { // forward tax\n reverseTax = \" (Reverse Tax)\";\n objBillItem.setIsReverTaxEnabled(\"YES\");\n }else\n {\n objBillItem.setIsReverTaxEnabled(\"NO\");\n }\n Log.d(\"InsertBillItems\", \"Amount :\" + objBillItem.getAmount()+reverseTax);\n }\n\n // oRIGINAL rate in case of reverse tax\n\n\n // Discount %\n if (RowBillItem.getChildAt(8) != null) {\n TextView DiscountPercent = (TextView) RowBillItem.getChildAt(8);\n objBillItem.setDiscountPercent(Float.parseFloat(DiscountPercent.getText().toString()));\n Log.d(\"InsertBillItems\", \"Disc %:\" + DiscountPercent.getText().toString());\n }\n\n // Discount Amount\n if (RowBillItem.getChildAt(9) != null) {\n TextView DiscountAmount = (TextView) RowBillItem.getChildAt(9);\n objBillItem.setDiscountAmount(Float.parseFloat(DiscountAmount.getText().toString()));\n Log.d(\"InsertBillItems\", \"Disc Amt:\" + DiscountAmount.getText().toString());\n // fTotalDiscount += Float.parseFloat(DiscountAmount.getText().toString());\n }\n\n // Service Tax Percent\n float sgatTax = 0;\n if (RowBillItem.getChildAt(15) != null) {\n TextView ServiceTaxPercent = (TextView) RowBillItem.getChildAt(15);\n sgatTax = Float.parseFloat(ServiceTaxPercent.getText().toString());\n if (chk_interstate.isChecked()) {\n objBillItem.setSGSTRate(0);\n Log.d(\"InsertBillItems\", \"SGST Tax %: 0\");\n\n } else {\n objBillItem.setSGSTRate(Float.parseFloat(ServiceTaxPercent.getText().toString()));\n Log.d(\"InsertBillItems\", \"SGST Tax %: \" + objBillItem.getSGSTRate());\n }\n }\n\n // Service Tax Amount\n double sgstAmt = 0;\n if (RowBillItem.getChildAt(16) != null) {\n TextView ServiceTaxAmount = (TextView) RowBillItem.getChildAt(16);\n sgstAmt = Double.parseDouble(ServiceTaxAmount.getText().toString());\n if (chk_interstate.isChecked()) {\n objBillItem.setSGSTAmount(0.00f);\n Log.d(\"InsertBillItems\", \"SGST Amount : 0\" );\n\n } else {\n objBillItem.setSGSTAmount(Double.parseDouble(String.format(\"%.2f\", sgstAmt)));\n Log.d(\"InsertBillItems\", \"SGST Amount : \" + objBillItem.getSGSTAmount());\n }\n }\n\n // Sales Tax %\n if (RowBillItem.getChildAt(6) != null) {\n TextView SalesTaxPercent = (TextView) RowBillItem.getChildAt(6);\n float cgsttax = (Float.parseFloat(SalesTaxPercent.getText().toString()));\n if (chk_interstate.isChecked()) {\n //objBillItem.setIGSTRate(Float.parseFloat(String.format(\"%.2f\", cgsttax + sgatTax)));\n //Log.d(\"InsertBillItems\", \" IGST Tax %: \" + objBillItem.getIGSTRate());\n objBillItem.setCGSTRate(0.00f);\n Log.d(\"InsertBillItems\", \" CGST Tax %: 0.00\");\n }else{\n //objBillItem.setIGSTRate(0.00f);\n //Log.d(\"InsertBillItems\", \" IGST Tax %: 0.00\");\n objBillItem.setCGSTRate(Float.parseFloat(String.format(\"%.2f\",Float.parseFloat(SalesTaxPercent.getText().toString()))));\n Log.d(\"InsertBillItems\", \" CGST Tax %: \" + SalesTaxPercent.getText().toString());\n }\n }\n // Sales Tax Amount\n if (RowBillItem.getChildAt(7) != null) {\n TextView SalesTaxAmount = (TextView) RowBillItem.getChildAt(7);\n double cgstAmt = (Double.parseDouble(SalesTaxAmount.getText().toString()));\n if (chk_interstate.isChecked()) {\n //objBillItem.setIGSTAmount(Float.parseFloat(String.format(\"%.2f\",cgstAmt+sgstAmt)));\n //Log.d(\"InsertBillItems\", \"IGST Amt: \" + objBillItem.getIGSTAmount());\n objBillItem.setCGSTAmount(0.00f);\n Log.d(\"InsertBillItems\", \"CGST Amt: 0\");\n } else {\n //objBillItem.setIGSTAmount(0.00f);\n //Log.d(\"InsertBillItems\", \"IGST Amt: 0\");\n objBillItem.setCGSTAmount(Double.parseDouble(String.format(\"%.2f\", cgstAmt)));\n Log.d(\"InsertBillItems\", \"CGST Amt: \" + SalesTaxAmount.getText().toString());\n }\n }\n\n // IGST Tax %\n if (RowBillItem.getChildAt(23) != null) {\n TextView IGSTTaxPercent = (TextView) RowBillItem.getChildAt(23);\n float igsttax = (Float.parseFloat(IGSTTaxPercent.getText().toString()));\n if (chk_interstate.isChecked()) {\n objBillItem.setIGSTRate(Float.parseFloat(String.format(\"%.2f\", igsttax)));\n Log.d(\"InsertBillItems\", \" IGST Tax %: \" + objBillItem.getIGSTRate());\n }else{\n objBillItem.setIGSTRate(0.00f);\n Log.d(\"InsertBillItems\", \" IGST Tax %: 0.00\");\n }\n }\n // IGST Tax Amount\n if (RowBillItem.getChildAt(24) != null) {\n TextView IGSTTaxAmount = (TextView) RowBillItem.getChildAt(24);\n float igstAmt = (Float.parseFloat(IGSTTaxAmount.getText().toString()));\n if (chk_interstate.isChecked()) {\n objBillItem.setIGSTAmount(Float.parseFloat(String.format(\"%.2f\",igstAmt)));\n Log.d(\"InsertBillItems\", \"IGST Amt: \" + objBillItem.getIGSTAmount());\n } else {\n objBillItem.setIGSTAmount(0.00f);\n Log.d(\"InsertBillItems\", \"IGST Amt: 0\");\n }\n }\n\n // cess Tax %\n if (RowBillItem.getChildAt(25) != null) {\n TextView cessTaxPercent = (TextView) RowBillItem.getChildAt(25);\n float cesstax = (Float.parseFloat(cessTaxPercent.getText().toString()));\n objBillItem.setCessRate(Float.parseFloat(String.format(\"%.2f\", cesstax)));\n Log.d(\"InsertBillItems\", \" cess Tax %: \" + objBillItem.getCessRate());\n }\n // cessTax Amount\n if (RowBillItem.getChildAt(26) != null) {\n TextView cessTaxAmount = (TextView) RowBillItem.getChildAt(26);\n double cessAmt = (Double.parseDouble(cessTaxAmount.getText().toString()));\n objBillItem.setCessAmount(Double.parseDouble(String.format(\"%.2f\",cessAmt)));\n Log.d(\"InsertBillItems\", \"cess Amt: \" + objBillItem.getCessAmount());\n }\n\n\n\n // Department Code\n if (RowBillItem.getChildAt(10) != null) {\n TextView DeptCode = (TextView) RowBillItem.getChildAt(10);\n objBillItem.setDeptCode(Integer.parseInt(DeptCode.getText().toString()));\n Log.d(\"InsertBillItems\", \"Dept Code:\" + DeptCode.getText().toString());\n }\n\n // Category Code\n if (RowBillItem.getChildAt(11) != null) {\n TextView CategCode = (TextView) RowBillItem.getChildAt(11);\n objBillItem.setCategCode(Integer.parseInt(CategCode.getText().toString()));\n Log.d(\"InsertBillItems\", \"Categ Code:\" + CategCode.getText().toString());\n }\n\n // Kitchen Code\n if (RowBillItem.getChildAt(12) != null) {\n TextView KitchenCode = (TextView) RowBillItem.getChildAt(12);\n objBillItem.setKitchenCode(Integer.parseInt(KitchenCode.getText().toString()));\n Log.d(\"InsertBillItems\", \"Kitchen Code:\" + KitchenCode.getText().toString());\n }\n\n // Tax Type\n if (RowBillItem.getChildAt(13) != null) {\n TextView TaxType = (TextView) RowBillItem.getChildAt(13);\n objBillItem.setTaxType(Integer.parseInt(TaxType.getText().toString()));\n Log.d(\"InsertBillItems\", \"Tax Type:\" + TaxType.getText().toString());\n }\n\n // Modifier Amount\n if (RowBillItem.getChildAt(14) != null) {\n TextView ModifierAmount = (TextView) RowBillItem.getChildAt(14);\n objBillItem.setModifierAmount(Float.parseFloat(ModifierAmount.getText().toString()));\n Log.d(\"InsertBillItems\", \"Modifier Amt:\" + ModifierAmount.getText().toString());\n }\n\n if (RowBillItem.getChildAt(17) != null) {\n TextView SupplyType = (TextView) RowBillItem.getChildAt(17);\n objBillItem.setSupplyType(SupplyType.getText().toString());\n Log.d(\"InsertBillItems\", \"SupplyType:\" + SupplyType.getText().toString());\n\n }\n if (RowBillItem.getChildAt(22) != null) {\n TextView UOM = (TextView) RowBillItem.getChildAt(22);\n objBillItem.setUom(UOM.getText().toString());\n Log.d(\"InsertBillItems\", \"UOM:\" + UOM.getText().toString());\n\n }\n\n // subtotal\n double subtotal = objBillItem.getAmount() + objBillItem.getIGSTAmount() + objBillItem.getCGSTAmount() + objBillItem.getSGSTAmount();\n\n objBillItem.setSubTotal(subtotal);\n Log.d(\"InsertBillItems\", \"Sub Total :\" + subtotal);\n\n // Date\n String date_today = tvDate.getText().toString();\n //Log.d(\"Date \", date_today);\n try {\n Date date1 = new SimpleDateFormat(\"dd-MM-yyyy\").parse(date_today);\n objBillItem.setInvoiceDate(String.valueOf(date1.getTime()));\n }catch (Exception e)\n {\n e.printStackTrace();\n }\n\n // cust name\n String custname = editTextName.getText().toString();\n objBillItem.setCustName(custname);\n Log.d(\"InsertBillItems\", \"CustName :\" + custname);\n\n String custGstin = etCustGSTIN.getText().toString().trim().toUpperCase();\n objBillItem.setGSTIN(custGstin);\n Log.d(\"InsertBillItems\", \"custGstin :\" + custGstin);\n\n // cust StateCode\n if (chk_interstate.isChecked()) {\n String str = spnr_pos.getSelectedItem().toString();\n int length = str.length();\n String sub = \"\";\n if (length > 0) {\n sub = str.substring(length - 2, length);\n }\n objBillItem.setCustStateCode(sub);\n Log.d(\"InsertBillItems\", \"CustStateCode :\" + sub+\" - \"+str);\n } else {\n objBillItem.setCustStateCode(db.getOwnerPOS_counter());// to be retrieved from database later -- richa to do\n Log.d(\"InsertBillItems\", \"CustStateCode :\"+objBillItem.getCustStateCode());\n }\n\n // BusinessType\n if (etCustGSTIN.getText().toString().equals(\"\")) {\n objBillItem.setBusinessType(\"B2C\");\n } else // gstin present means b2b bussiness\n {\n objBillItem.setBusinessType(\"B2B\");\n }\n Log.d(\"InsertBillItems\", \"BusinessType : \" + objBillItem.getBusinessType());\n objBillItem.setBillStatus(1);\n Log.d(\"InsertBillItems\", \"Bill Status:1\");\n // richa to do - hardcoded b2b bussinies type\n //objBillItem.setBusinessType(\"B2B\");\n lResult = db.addBillItems(objBillItem);\n Log.d(\"InsertBillItem\", \"Bill item inserted at position:\" + lResult);\n }\n }", "@Test\n\tpublic void testProcessInventoryUpdateOrderShipmentRelease() {\n\t\tfinal Inventory inventory = new InventoryImpl();\n\t\tinventory.setUidPk(INVENTORY_UID_1000);\n\t\tinventory.setQuantityOnHand(QUANTITY_ONHAND);\n\t\tinventory.setWarehouseUid(WAREHOUSE_UID);\n\t\tfinal ProductSku productSku = new ProductSkuImpl();\n\t\tfinal String skuCode = SKU_CODE;\n\t\tproductSku.setSkuCode(skuCode);\n\t\tfinal ProductImpl product = new ProductImpl();\n\t\tproduct.setAvailabilityCriteria(AvailabilityCriteria.AVAILABLE_WHEN_IN_STOCK);\n\t\tproductSku.setProduct(product);\n\n\t\tinventory.setSkuCode(productSku.getSkuCode());\n\n\t\tfinal Order order = new OrderImpl();\n\t\torder.setUidPk(ORDER_UID_2000);\n\n\t\tfinal InventoryJournalRollupImpl ijRollup = new InventoryJournalRollupImpl();\n\t\tijRollup.setAllocatedQuantityDelta(QUANTITY_10);\n\n\t\tcontext.checking(new Expectations() {\n\t\t\t{\n\t\t\t\tInventoryJournalImpl inventoryJournal = new InventoryJournalImpl();\n\t\t\t\toneOf(beanFactory).getBean(INVENTORY_JOURNAL); will(returnValue(inventoryJournal));\n\t\t\t\toneOf(beanFactory).getBean(EXECUTION_RESULT); will(returnValue(new InventoryExecutionResultImpl()));\n\n\t\t\t\tatLeast(1).of(inventoryDao).getInventory(skuCode, WAREHOUSE_UID); will(returnValue(inventory));\n\t\t\t\tatLeast(1).of(inventoryJournalDao).getRollup(inventoryKey); will(returnValue(ijRollup));\n\t\t\t\toneOf(inventoryJournalDao).saveOrUpdate(inventoryJournal); will(returnValue(new InventoryJournalImpl()));\n\t\t\t}\n\t\t});\n\n\t\tproductInventoryManagementService.processInventoryUpdate(\n\t\t\t\tproductSku, 1,\tInventoryEventType.STOCK_ALLOCATE, EVENT_ORIGINATOR_TESTER, QUANTITY_10, order, null);\n\t\tInventoryDto inventoryDto = productInventoryManagementService.getInventory(inventory.getSkuCode(), inventory.getWarehouseUid());\n\t\tassertEquals(QUANTITY_ONHAND, inventoryDto.getQuantityOnHand());\n\t\tassertEquals(QUANTITY_ONHAND - QUANTITY_10, inventoryDto.getAvailableQuantityInStock());\n\t\tassertEquals(QUANTITY_10, inventoryDto.getAllocatedQuantity());\n\n\t\tcontext.checking(new Expectations() {\n\t\t\t{\n\t\t\t\toneOf(beanFactory).getBean(EXECUTION_RESULT); will(returnValue(new InventoryExecutionResultImpl()));\n\t\t\t}\n\t\t});\n\n\t\tfinal Inventory inventory2 = assembler.assembleDomainFromDto(inventoryDto);\n\n\t\tfinal InventoryDao inventoryDao2 = context.mock(InventoryDao.class, INVENTORY_DAO2);\n\t\tfinal InventoryJournalDao inventoryJournalDao2 = context.mock(InventoryJournalDao.class, INVENTORY_JOURNAL_DAO2);\n\t\tjournalingInventoryStrategy.setInventoryDao(inventoryDao2);\n\t\tjournalingInventoryStrategy.setInventoryJournalDao(inventoryJournalDao2);\n\n\t\tfinal InventoryJournalRollupImpl ijRollup2 = new InventoryJournalRollupImpl();\n\t\tijRollup2.setAllocatedQuantityDelta(QUANTITY_NEG_10);\n\t\tijRollup2.setQuantityOnHandDelta(QUANTITY_NEG_10);\n\n\t\tcontext.checking(new Expectations() {\n\t\t\t{\n\t\t\t\tInventoryJournalImpl inventoryJournal = new InventoryJournalImpl();\n\t\t\t\toneOf(beanFactory).getBean(INVENTORY_JOURNAL); will(returnValue(inventoryJournal));\n\t\t\t\tatLeast(1).of(inventoryDao2).getInventory(skuCode, WAREHOUSE_UID); will(returnValue(inventory2));\n\t\t\t\tatLeast(1).of(inventoryJournalDao2).saveOrUpdate(inventoryJournal); will(returnValue(new InventoryJournalImpl()));\n\t\t\t\tatLeast(1).of(inventoryJournalDao2).getRollup(inventoryKey); will(returnValue(ijRollup2));\n\t\t\t}\n\t\t});\n\n\t\tproductInventoryManagementService.processInventoryUpdate(\n\t\t\t\tproductSku, WAREHOUSE_UID,\tInventoryEventType.STOCK_RELEASE, EVENT_ORIGINATOR_TESTER, QUANTITY_10, order, null);\n\t\tinventoryDto = productInventoryManagementService.getInventory(inventory.getSkuCode(), inventory.getWarehouseUid());\n\t\tassertEquals(QUANTITY_ONHAND - QUANTITY_10, inventoryDto.getQuantityOnHand());\n\t\tassertEquals(QUANTITY_ONHAND - QUANTITY_10, inventoryDto.getAvailableQuantityInStock());\n\t\tassertEquals(QUANTITY_0, inventoryDto.getAllocatedQuantity());\n\t}", "private void addProduct() {\n String type = console.readString(\"type (\\\"Shirt\\\", \\\"Pant\\\" or \\\"Shoes\\\"): \");\n String size = console.readString(\"\\nsize: \");\n int qty = console.readInt(\"\\nQty: \");\n int sku = console.readInt(\"\\nSKU: \");\n Double price = console.readDouble(\"\\nPrice: \");\n int reorderLevel = console.readInt(\"\\nReorder Level: \");\n daoLayer.addProduct(type, size, qty, sku, price, reorderLevel);\n\n }", "Order placeNewOrder(Order order, Project project, User user);", "private void insertPerform(){\n \tif(!verify()){\n \t\treturn;\n \t}\n \tString val=new String(\"\");\n \tval=val+\"'\"+jTextField1.getText()+\"', \"; // poNo\n \tval=val+\"'\"+\n \t\tinventorycontroller.util.DateUtil.getRawFormat(\n \t\t\t(java.util.Date)jXDatePicker1.getValue()\n \t\t)\n \t\t+\"', \"; // poDate\n \tval=val+\"'\"+vndList[jTextField2.getSelectedIndex()-1]+\"', \"; // vndNo\n \tval=val+\"'\"+jTextField3.getText()+\"', \"; // qtnNo\n \tval=val+\"'\"+\n \t\tinventorycontroller.util.DateUtil.getRawFormat(\n \t\t\t(java.util.Date)jXDatePicker2.getValue()\n \t\t)\n \t\t+\"', \"; // qtnDate\n \tval=val+\"'\"+poAmount+\"', \"; // poTotal\n \tval=val+\"'pending', \"; // poStatus\n \tval=val+\"'\"+jEditorPane1.getText()+\"' \"; // remark\n \t\n \ttry{\n \t\tdbInterface1.cmdInsert(\"poMaster\", val);\n \t\tinsertPoBomDesc();\n \t\tinsertPoDesc();\n\t \tupdateBOM();\n \t}\n \tcatch(java.sql.SQLException ex){\n \t\tSystem.out.println (ex);\n \t}\n \tresetPerform();\n }", "private void InsertBillItems() {\r\n\r\n // Inserted Row Id in database table\r\n long lResult = 0;\r\n\r\n // Bill item object\r\n BillItem objBillItem;\r\n\r\n // Reset TotalItems count\r\n iTotalItems = 0;\r\n\r\n Cursor crsrUpdateItemStock = null;\r\n\r\n for (int iRow = 0; iRow < tblOrderItems.getChildCount(); iRow++) {\r\n objBillItem = new BillItem();\r\n\r\n TableRow RowBillItem = (TableRow) tblOrderItems.getChildAt(iRow);\r\n\r\n // Increment Total item count if row is not empty\r\n if (RowBillItem.getChildCount() > 0) {\r\n iTotalItems++;\r\n }\r\n\r\n\r\n\r\n // Bill Number\r\n objBillItem.setBillNumber(tvBillNumber.getText().toString());\r\n Log.d(\"InsertBillItems\", \"InvoiceNo:\" + tvBillNumber.getText().toString());\r\n\r\n // richa_2012\r\n //BillingMode\r\n objBillItem.setBillingMode(String.valueOf(jBillingMode));\r\n Log.d(\"InsertBillItems\", \"Billing Mode :\" + String.valueOf(jBillingMode));\r\n\r\n // Item Number\r\n if (RowBillItem.getChildAt(0) != null) {\r\n CheckBox ItemNumber = (CheckBox) RowBillItem.getChildAt(0);\r\n objBillItem.setItemNumber(Integer.parseInt(ItemNumber.getText().toString()));\r\n Log.d(\"InsertBillItems\", \"Item Number:\" + ItemNumber.getText().toString());\r\n\r\n crsrUpdateItemStock = dbBillScreen.getItem(Integer.parseInt(ItemNumber.getText().toString()));\r\n }\r\n\r\n // Item Name\r\n if (RowBillItem.getChildAt(1) != null) {\r\n TextView ItemName = (TextView) RowBillItem.getChildAt(1);\r\n objBillItem.setItemName(ItemName.getText().toString());\r\n Log.d(\"InsertBillItems\", \"Item Name:\" + ItemName.getText().toString());\r\n }\r\n\r\n if (RowBillItem.getChildAt(2) != null) {\r\n TextView HSN = (TextView) RowBillItem.getChildAt(2);\r\n objBillItem.setHSNCode(HSN.getText().toString());\r\n Log.d(\"InsertBillItems\", \"Item HSN:\" + HSN.getText().toString());\r\n }\r\n\r\n // Quantity\r\n double qty_d = 0.00;\r\n if (RowBillItem.getChildAt(3) != null) {\r\n EditText Quantity = (EditText) RowBillItem.getChildAt(3);\r\n String qty_str = Quantity.getText().toString();\r\n if(qty_str==null || qty_str.equals(\"\"))\r\n {\r\n Quantity.setText(\"0.00\");\r\n }else\r\n {\r\n qty_d = Double.parseDouble(qty_str);\r\n }\r\n\r\n objBillItem.setQuantity(Float.parseFloat(String.format(\"%.2f\",qty_d)));\r\n Log.d(\"InsertBillItems\", \"Quantity:\" + Quantity.getText().toString());\r\n\r\n if (crsrUpdateItemStock!=null && crsrUpdateItemStock.moveToFirst()) {\r\n // Check if item's bill with stock enabled update the stock\r\n // quantity\r\n if (BillwithStock == 1) {\r\n UpdateItemStock(crsrUpdateItemStock, Float.parseFloat(Quantity.getText().toString()));\r\n }\r\n\r\n\r\n }\r\n }\r\n\r\n // Rate\r\n double rate_d = 0.00;\r\n if (RowBillItem.getChildAt(4) != null) {\r\n EditText Rate = (EditText) RowBillItem.getChildAt(4);\r\n String rate_str = Rate.getText().toString();\r\n if((rate_str==null || rate_str.equals(\"\")))\r\n {\r\n Rate.setText(\"0.00\");\r\n }else\r\n {\r\n rate_d = Double.parseDouble(rate_str);\r\n }\r\n\r\n objBillItem.setValue(Float.parseFloat(String.format(\"%.2f\",rate_d)));\r\n Log.d(\"InsertBillItems\", \"Rate:\" + Rate.getText().toString());\r\n }\r\n\r\n\r\n // oRIGINAL rate in case of reverse tax\r\n if (RowBillItem.getChildAt(27) != null) {\r\n TextView originalRate = (TextView) RowBillItem.getChildAt(27);\r\n objBillItem.setOriginalRate(Double.parseDouble(originalRate.getText().toString()));\r\n Log.d(\"InsertBillItems\", \"Original Rate :\" + objBillItem.getOriginalRate());\r\n }\r\n if (RowBillItem.getChildAt(28) != null) {\r\n TextView TaxableValue = (TextView) RowBillItem.getChildAt(28);\r\n objBillItem.setTaxableValue(Double.parseDouble(TaxableValue.getText().toString()));\r\n Log.d(\"InsertBillItems\", \"TaxableValue :\" + objBillItem.getTaxableValue());\r\n }\r\n\r\n // Amount\r\n if (RowBillItem.getChildAt(5) != null) {\r\n TextView Amount = (TextView) RowBillItem.getChildAt(5);\r\n objBillItem.setAmount(Double.parseDouble(Amount.getText().toString()));\r\n String reverseTax = \"\";\r\n if (!(crsrSettings.getInt(crsrSettings.getColumnIndex(\"Tax\")) == 1)) { // reverse tax\r\n reverseTax = \" (Reverse Tax)\";\r\n objBillItem.setIsReverTaxEnabled(\"YES\");\r\n }else\r\n {\r\n objBillItem.setIsReverTaxEnabled(\"NO\");\r\n }\r\n Log.d(\"InsertBillItems\", \"Amount :\" + objBillItem.getAmount()+reverseTax);\r\n }\r\n\r\n // oRIGINAL rate in case of reverse tax\r\n if (RowBillItem.getChildAt(27) != null) {\r\n TextView originalRate = (TextView) RowBillItem.getChildAt(27);\r\n objBillItem.setOriginalRate(Double.parseDouble(originalRate.getText().toString()));\r\n Log.d(\"InsertBillItems\", \"Original Rate :\" + objBillItem.getOriginalRate());\r\n }\r\n\r\n // Discount %\r\n if (RowBillItem.getChildAt(8) != null) {\r\n TextView DiscountPercent = (TextView) RowBillItem.getChildAt(8);\r\n objBillItem.setDiscountPercent(Float.parseFloat(DiscountPercent.getText().toString()));\r\n Log.d(\"InsertBillItems\", \"Disc %:\" + DiscountPercent.getText().toString());\r\n }\r\n\r\n // Discount Amount\r\n if (RowBillItem.getChildAt(9) != null) {\r\n TextView DiscountAmount = (TextView) RowBillItem.getChildAt(9);\r\n objBillItem.setDiscountAmount(Float.parseFloat(DiscountAmount.getText().toString()));\r\n Log.d(\"InsertBillItems\", \"Disc Amt:\" + DiscountAmount.getText().toString());\r\n // dblTotalDiscount += Float.parseFloat(DiscountAmount.getText().toString());\r\n }\r\n\r\n\r\n // Service Tax Percent\r\n float sgatTax = 0;\r\n if (RowBillItem.getChildAt(15) != null) {\r\n TextView ServiceTaxPercent = (TextView) RowBillItem.getChildAt(15);\r\n sgatTax = Float.parseFloat(ServiceTaxPercent.getText().toString());\r\n if (chk_interstate.isChecked()) {\r\n objBillItem.setSGSTAmount(0.00f);\r\n Log.d(\"InsertBillItems\", \"SGST Tax %: 0\");\r\n\r\n } else {\r\n objBillItem.setSGSTRate(Float.parseFloat(ServiceTaxPercent.getText().toString()));\r\n Log.d(\"InsertBillItems\", \"SGST Tax %: \" + objBillItem.getSGSTRate());\r\n }\r\n }\r\n\r\n // Service Tax Amount\r\n double sgstAmt = 0;\r\n if (RowBillItem.getChildAt(16) != null) {\r\n TextView ServiceTaxAmount = (TextView) RowBillItem.getChildAt(16);\r\n sgstAmt = Double.parseDouble(ServiceTaxAmount.getText().toString());\r\n if (chk_interstate.isChecked()) {\r\n objBillItem.setSGSTAmount(0);\r\n Log.d(\"InsertBillItems\", \"SGST Amount : 0\" );\r\n\r\n } else {\r\n objBillItem.setSGSTAmount(Double.parseDouble(String.format(\"%.2f\", sgstAmt)));\r\n Log.d(\"InsertBillItems\", \"SGST Amount : \" + objBillItem.getSGSTAmount());\r\n }\r\n }\r\n\r\n // Sales Tax %\r\n if (RowBillItem.getChildAt(6) != null) {\r\n TextView SalesTaxPercent = (TextView) RowBillItem.getChildAt(6);\r\n float cgsttax = (Float.parseFloat(SalesTaxPercent.getText().toString()));\r\n if (chk_interstate.isChecked()) {\r\n //objBillItem.setIGSTRate(Float.parseFloat(String.format(\"%.2f\", cgsttax + sgatTax)));\r\n // Log.d(\"InsertBillItems\", \" IGST Tax %: \" + objBillItem.getIGSTRate());\r\n objBillItem.setCGSTRate(0.00f);\r\n Log.d(\"InsertBillItems\", \" CGST Tax %: 0.00\");\r\n }else{\r\n // objBillItem.setIGSTRate(0.00f);\r\n // Log.d(\"InsertBillItems\", \" IGST Tax %: 0.00\");\r\n objBillItem.setCGSTRate(Float.parseFloat(String.format(\"%.2f\",Float.parseFloat(SalesTaxPercent.getText().toString()))));\r\n Log.d(\"InsertBillItems\", \" CGST Tax %: \" + SalesTaxPercent.getText().toString());\r\n }\r\n }\r\n // Sales Tax Amount\r\n if (RowBillItem.getChildAt(7) != null) {\r\n TextView SalesTaxAmount = (TextView) RowBillItem.getChildAt(7);\r\n double cgstAmt = (Double.parseDouble(SalesTaxAmount.getText().toString()));\r\n if (chk_interstate.isChecked()) {\r\n //objBillItem.setIGSTAmount(Float.parseFloat(String.format(\"%.2f\",cgstAmt+sgstAmt)));\r\n //Log.d(\"InsertBillItems\", \"IGST Amt: \" + objBillItem.getIGSTAmount());\r\n objBillItem.setCGSTAmount(0);\r\n Log.d(\"InsertBillItems\", \"CGST Amt: 0\");\r\n } else {\r\n // objBillItem.setIGSTAmount(0.00f);\r\n //Log.d(\"InsertBillItems\", \"IGST Amt: 0\");\r\n objBillItem.setCGSTAmount(Double.parseDouble(String.format(\"%.2f\", cgstAmt)));\r\n Log.d(\"InsertBillItems\", \"CGST Amt: \" + SalesTaxAmount.getText().toString());\r\n }\r\n }\r\n // IGST Tax %\r\n if (RowBillItem.getChildAt(23) != null) {\r\n TextView IGSTTaxPercent = (TextView) RowBillItem.getChildAt(23);\r\n float igsttax = (Float.parseFloat(IGSTTaxPercent.getText().toString()));\r\n if (chk_interstate.isChecked()) {\r\n objBillItem.setIGSTRate(Float.parseFloat(String.format(\"%.2f\", igsttax)));\r\n Log.d(\"InsertBillItems\", \" IGST Tax %: \" + objBillItem.getIGSTRate());\r\n }else{\r\n objBillItem.setIGSTRate(0.00f);\r\n Log.d(\"InsertBillItems\", \" IGST Tax %: 0.00\");\r\n }\r\n }\r\n // IGST Tax Amount\r\n if (RowBillItem.getChildAt(24) != null) {\r\n TextView IGSTTaxAmount = (TextView) RowBillItem.getChildAt(24);\r\n float igstAmt = (Float.parseFloat(IGSTTaxAmount.getText().toString()));\r\n if (chk_interstate.isChecked()) {\r\n objBillItem.setIGSTAmount(Double.parseDouble(String.format(\"%.2f\",igstAmt)));\r\n Log.d(\"InsertBillItems\", \"IGST Amt: \" + objBillItem.getIGSTAmount());\r\n } else {\r\n objBillItem.setIGSTAmount(0);\r\n Log.d(\"InsertBillItems\", \"IGST Amt: 0\");\r\n }\r\n }\r\n\r\n // cess Tax %\r\n if (RowBillItem.getChildAt(25) != null) {\r\n TextView cessTaxPercent = (TextView) RowBillItem.getChildAt(25);\r\n float cesstax = (Float.parseFloat(cessTaxPercent.getText().toString()));\r\n objBillItem.setCessRate(Float.parseFloat(String.format(\"%.2f\", cesstax)));\r\n Log.d(\"InsertBillItems\", \" cess Tax %: \" + objBillItem.getCessRate());\r\n }\r\n // cess amount per unit\r\n if (RowBillItem.getChildAt(26) != null) {\r\n TextView cessPerUnitAmt = (TextView) RowBillItem.getChildAt(26);\r\n double cessPerunit = (Double.parseDouble(cessPerUnitAmt.getText().toString()));\r\n if (objBillItem.getCessRate() > 0)\r\n objBillItem.setDblCessAmountPerUnit(0.00);\r\n else\r\n objBillItem.setDblCessAmountPerUnit(Double.parseDouble(String.format(\"%.2f\", cessPerunit)));\r\n objBillItem.setCessAmount(Double.parseDouble(String.format(\"%.2f\", cessPerunit * objBillItem.getQuantity())));\r\n Log.d(\"InsertBillItems\", \"cess Amt: \" + objBillItem.getDblCessAmountPerUnit());\r\n }\r\n // additional cess amount\r\n if (RowBillItem.getChildAt(29) != null) {\r\n TextView tvadditionalcess = (TextView) RowBillItem.getChildAt(29);\r\n double additionalCess = (Double.parseDouble(tvadditionalcess.getText().toString()));\r\n objBillItem.setDblAdditionalCessAmount(additionalCess);\r\n objBillItem.setDblTotalAdditionalCessAmount(Double.parseDouble(String.format(\"%.2f\", additionalCess * objBillItem.getQuantity())));\r\n Log.d(\"InsertBillItems\", \"cess Amt: \" + objBillItem.getDblAdditionalCessAmount());\r\n }\r\n\r\n // Discount %\r\n if (RowBillItem.getChildAt(8) != null) {\r\n TextView DiscountPercent = (TextView) RowBillItem.getChildAt(8);\r\n objBillItem.setDiscountPercent(Float.parseFloat(DiscountPercent.getText().toString()));\r\n Log.d(\"InsertBillItems\", \"Disc %:\" + DiscountPercent.getText().toString());\r\n }\r\n\r\n // Discount Amount\r\n if (RowBillItem.getChildAt(9) != null) {\r\n TextView DiscountAmount = (TextView) RowBillItem.getChildAt(9);\r\n objBillItem.setDiscountAmount(Float.parseFloat(DiscountAmount.getText().toString()));\r\n Log.d(\"InsertBillItems\", \"Disc Amt:\" + DiscountAmount.getText().toString());\r\n\r\n // dblTotalDiscount += Float.parseFloat(DiscountAmount.getText().toString());\r\n }\r\n\r\n // Department Code\r\n if (RowBillItem.getChildAt(10) != null) {\r\n TextView DeptCode = (TextView) RowBillItem.getChildAt(10);\r\n objBillItem.setDeptCode(Integer.parseInt(DeptCode.getText().toString()));\r\n Log.d(\"InsertBillItems\", \"Dept Code:\" + DeptCode.getText().toString());\r\n }\r\n\r\n // Category Code\r\n if (RowBillItem.getChildAt(11) != null) {\r\n TextView CategCode = (TextView) RowBillItem.getChildAt(11);\r\n objBillItem.setCategCode(Integer.parseInt(CategCode.getText().toString()));\r\n Log.d(\"InsertBillItems\", \"Categ Code:\" + CategCode.getText().toString());\r\n }\r\n\r\n // Kitchen Code\r\n if (RowBillItem.getChildAt(12) != null) {\r\n TextView KitchenCode = (TextView) RowBillItem.getChildAt(12);\r\n objBillItem.setKitchenCode(Integer.parseInt(KitchenCode.getText().toString()));\r\n Log.d(\"InsertBillItems\", \"Kitchen Code:\" + KitchenCode.getText().toString());\r\n }\r\n\r\n // Tax Type\r\n if (RowBillItem.getChildAt(13) != null) {\r\n TextView TaxType = (TextView) RowBillItem.getChildAt(13);\r\n objBillItem.setTaxType(Integer.parseInt(TaxType.getText().toString()));\r\n Log.d(\"InsertBillItems\", \"Tax Type:\" + TaxType.getText().toString());\r\n }\r\n\r\n // Modifier Amount\r\n if (RowBillItem.getChildAt(14) != null) {\r\n TextView ModifierAmount = (TextView) RowBillItem.getChildAt(14);\r\n objBillItem.setModifierAmount(Float.parseFloat(ModifierAmount.getText().toString()));\r\n Log.d(\"InsertBillItems\", \"Modifier Amt:\" + ModifierAmount.getText().toString());\r\n }\r\n\r\n\r\n\r\n if (RowBillItem.getChildAt(17) != null) {\r\n TextView SupplyType = (TextView) RowBillItem.getChildAt(17);\r\n objBillItem.setSupplyType(SupplyType.getText().toString());\r\n Log.d(\"InsertBillItems\", \"SupplyType:\" + SupplyType.getText().toString());\r\n /*if (GSTEnable.equals(\"1\")) {\r\n objBillItem.setSupplyType(SupplyType.getText().toString());\r\n Log.d(\"InsertBillItems\", \"SupplyType:\" + SupplyType.getText().toString());\r\n } else {\r\n objBillItem.setSupplyType(\"\");\r\n }*/\r\n }\r\n if (RowBillItem.getChildAt(22) != null) {\r\n TextView UOM = (TextView) RowBillItem.getChildAt(22);\r\n objBillItem.setUom(UOM.getText().toString());\r\n Log.d(\"InsertBillItems\", \"UOM:\" + UOM.getText().toString());\r\n\r\n }\r\n\r\n // subtotal\r\n double subtotal = objBillItem.getAmount() + objBillItem.getIGSTAmount() + objBillItem.getCGSTAmount() + objBillItem.getSGSTAmount();\r\n objBillItem.setSubTotal(subtotal);\r\n Log.d(\"InsertBillItems\", \"Sub Total :\" + subtotal);\r\n\r\n // Date\r\n String date_today = tvDate.getText().toString();\r\n //Log.d(\"Date \", date_today);\r\n try {\r\n Date date1 = new SimpleDateFormat(\"dd-MM-yyyy\").parse(date_today);\r\n objBillItem.setInvoiceDate(String.valueOf(date1.getTime()));\r\n }catch (Exception e)\r\n {\r\n e.printStackTrace();\r\n }\r\n // cust name\r\n String custname = edtCustName.getText().toString();\r\n objBillItem.setCustName(custname);\r\n Log.d(\"InsertBillItems\", \"CustName :\" + custname);\r\n\r\n String custgstin = etCustGSTIN.getText().toString().trim().toUpperCase();\r\n objBillItem.setGSTIN(custgstin);\r\n Log.d(\"InsertBillItems\", \"custgstin :\" + custgstin);\r\n\r\n if (chk_interstate.isChecked()) {\r\n String str = spnr_pos.getSelectedItem().toString();\r\n int length = str.length();\r\n String sub = \"\";\r\n if (length > 0) {\r\n sub = str.substring(length - 2, length);\r\n }\r\n objBillItem.setCustStateCode(sub);\r\n Log.d(\"InsertBillItems\", \"CustStateCode :\" + sub+\" - \"+str);\r\n } else {\r\n objBillItem.setCustStateCode(db.getOwnerPOS());// to be retrieved from database later -- richa to do\r\n Log.d(\"InsertBillItems\", \"CustStateCode :\"+objBillItem.getCustStateCode());\r\n }\r\n\r\n\r\n // BusinessType\r\n if (etCustGSTIN.getText().toString().equals(\"\")) {\r\n objBillItem.setBusinessType(\"B2C\");\r\n } else // gstin present means b2b bussiness\r\n {\r\n objBillItem.setBusinessType(\"B2B\");\r\n }\r\n\r\n Log.d(\"InsertBillItems\", \"BusinessType : \" + objBillItem.getBusinessType());\r\n\r\n // richa to do - hardcoded b2b bussinies type\r\n //objBillItem.setBusinessType(\"B2B\");\r\n if (jBillingMode == 4) {\r\n objBillItem.setBillStatus(2);\r\n Log.d(\"InsertBillItem\", \"Bill Status:2\");\r\n } else {\r\n objBillItem.setBillStatus(1);\r\n Log.d(\"InsertBillItem\", \"Bill Status:1\");\r\n }\r\n\r\n if(jBillingMode == 3){\r\n if(etOnlineOrderNo != null && !etOnlineOrderNo.getText().toString().isEmpty()){\r\n objBillItem.setStrOnlineOrderNo(etOnlineOrderNo.getText().toString());\r\n }\r\n }\r\n\r\n lResult = db.addBillItems(objBillItem);\r\n Log.d(\"InsertBillItem\", \"Bill item inserted at position:\" + lResult);\r\n }\r\n }", "@Transactional\n @Override\n public StringBuffer addSalesOrder(String customerID, String cartIDs, String addressID, String paymentType,\n String orderAmount, String scoreAll, String memo, String itemCount, String itemID,\n String supplierID, String itemType, String orderType, String objID, String invoiceType,\n String invoiceTitle, String generateType, String orderID, String allFreight, String supplierFreightStr) throws Exception {\n \t\n String ids[] = cartIDs.split(\",\");\n List<ShoppingCartVO> shopCartList = new ArrayList<ShoppingCartVO>();\n for (String id : ids) {\n ShoppingCartVO shoppingCartVO = shoppingCartDAO.findShoppingCartByID(Long.valueOf(id));\n shopCartList.add(shoppingCartVO);\n }\n Map<String,List<ShoppingCartVO>> maps = new HashMap<String,List<ShoppingCartVO>>();\n for(ShoppingCartVO s:shopCartList){\n \tList<ShoppingCartVO> temp = new ArrayList<ShoppingCartVO>();\n \t String sid1= s.getSupplierID();\n String siname1= s.getSupplierName();\n for(ShoppingCartVO shoppingCartVO1 : shopCartList){\n \t//当前店铺对应的购物车集合\n \tString sid2 = shoppingCartVO1.getSupplierID();\n \tif(sid1.equals(sid2)){\n \t\ttemp.add(shoppingCartVO1);\n \t}\n }\n maps.put(sid1+\"_\"+siname1, temp);\n }\n \n //根据物流模板计算运费\n Map<String, Double> supplierFreightMap = new HashMap<String, Double>();\n String[] supplierFreightAll = supplierFreightStr.split(\"\\\\|\");\n for (int i = 0; i < supplierFreightAll.length; i++) {\n \tString[] supplierFreight = supplierFreightAll[i].split(\":\");\n \tsupplierFreightMap.put(supplierFreight[0], Double.parseDouble(supplierFreight[1]));\n\t\t} \n \n StringBuffer ordersList = new StringBuffer();\n// cachedClient.delete(customerID + orderID);\n Set<String> set = maps.keySet();\n\t\tfor(String string : set){\n\t\t List<ShoppingCartVO> temp1= maps.get(string);\n\t\t double supplierFreight = supplierFreightMap.get(string);\n\t\t Double amount = 0d;\n\t\t Integer count = 0;\n Integer score = 0;\n Double weight = 0d;\n\t\t for (ShoppingCartVO shoppingCartVO : temp1) {\n ItemVO itemVO = itemDAO.findItemById(shoppingCartVO.getItemID());\n count += shoppingCartVO.getItemCount();\n // weight += itemVO.getWeight();\n if (shoppingCartVO.getType() == 1) {\n amount += shoppingCartVO.getItemCount() * shoppingCartVO.getSalesPrice();\n } else if (shoppingCartVO.getType() == 2) {\n score += shoppingCartVO.getItemCount() * itemVO.getScore();\n } else if (shoppingCartVO.getType() == 3) {\n amount += shoppingCartVO.getItemCount() * itemVO.getScorePrice();\n score += shoppingCartVO.getItemCount() * shoppingCartVO.getSalesScore();\n }\n }\n\t\t //SalesOrderVO tempOrder = new SalesOrderVO();\n\t /*if (tempOrder == null) {\n\t throw new Exception(\"参数错误\");\n\t }\n\t if (\"012\".indexOf(invoiceType) == -1) {\n\t throw new Exception(\"参数错误\");\n\t }*/\n\t SalesOrderDTO salesOrderDTO = new SalesOrderDTO();\n\t salesOrderDTO.setMainID(randomNumeric());\n\t salesOrderDTO.setCustomerID(customerID);\n\t salesOrderDTO.setPaymentType(Integer.valueOf(paymentType));\n\t salesOrderDTO.setPaymentStatus(0);\n\n\t // salesOrderDTO.setExpressFee(tempOrder.getExpressFee());//运费\n\t salesOrderDTO.setProductAmount(amount);\n\t salesOrderDTO.setTotalAmount(amount + supplierFreight);\n\t salesOrderDTO.setPayableAmount(amount);\n\n\t salesOrderDTO.setOrderType(Integer.valueOf(orderType));\n\t salesOrderDTO.setMemo(memo);\n\t salesOrderDTO.setInvoiceType(Integer.parseInt(invoiceType));\n\t salesOrderDTO.setInvoiceTitle(invoiceTitle);\n\t salesOrderDTO.setSupplierID(string);\n\t salesOrderDTO.setExpressFee(supplierFreight);\n\t salesOrderDAO.addSalesOrder(salesOrderDTO);\n\t ordersList.append(salesOrderDTO.getMainID()+\",\");\n\t if(!paymentType.equals(\"3\")){\n\t \t CustomerDeliveryAddressVO customerDeliveryAddressVO = customerDeliveryAddressDAO.findAddressByID(Long.valueOf(addressID));\n\t \t if (customerDeliveryAddressVO != null) {\n\t \t SalesOrderDeliveryAddressDTO salesOrderDeliveryAddressDTO = new SalesOrderDeliveryAddressDTO();\n\t \t salesOrderDeliveryAddressDTO.setSalesOrderID(salesOrderDTO.getMainID());\n\t \t salesOrderDeliveryAddressDTO.setName(customerDeliveryAddressVO.getName());\n\t \t salesOrderDeliveryAddressDTO.setCountryID(customerDeliveryAddressVO.getCountryID());\n\t \t salesOrderDeliveryAddressDTO.setProvinceID(customerDeliveryAddressVO.getProvinceID());\n\t \t salesOrderDeliveryAddressDTO.setCityID(customerDeliveryAddressVO.getCityID());\n\t \t salesOrderDeliveryAddressDTO.setDisctrictID(customerDeliveryAddressVO.getDisctrictID());\n\t \t salesOrderDeliveryAddressDTO.setAddress(customerDeliveryAddressVO.getAddress());\n\t \t salesOrderDeliveryAddressDTO.setMobile(customerDeliveryAddressVO.getMobile());\n\t \t salesOrderDeliveryAddressDTO.setTelephone(customerDeliveryAddressVO.getTelephone());\n\t \t if (customerDeliveryAddressVO.getZip() != null) {\n\t \t salesOrderDeliveryAddressDTO.setZip(customerDeliveryAddressVO.getZip());\n\t \t }\n\t \t salesOrderDeliveryAddressDAO.insertSalesOrderDeliveryAddress(salesOrderDeliveryAddressDTO);\n\t \t }\n\t \t ShippingAddressVO shippingAddressVO = shippingAddressDAO.findDefaultShippingAddress();\n\t \t if (shippingAddressVO != null) {\n\t \t SalesOrderShippingAddressDTO salesOrderShippingAddressDTO = new SalesOrderShippingAddressDTO();\n\t \t salesOrderShippingAddressDTO.setSalesOrderID(salesOrderDTO.getMainID());\n\t \t salesOrderShippingAddressDTO.setName(shippingAddressVO.getName());\n\t \t salesOrderShippingAddressDTO.setCountryID(shippingAddressVO.getCountryID());\n\t \t salesOrderShippingAddressDTO.setProvinceID(shippingAddressVO.getProvinceID());\n\t \t salesOrderShippingAddressDTO.setCityID(shippingAddressVO.getCityID());\n\t \t salesOrderShippingAddressDTO.setDisctrictID(shippingAddressVO.getDisctrictID());\n\t \t salesOrderShippingAddressDTO.setAddress(shippingAddressVO.getAddress());\n\t \t salesOrderShippingAddressDTO.setMobile(shippingAddressVO.getMobile());\n\t \t salesOrderShippingAddressDTO.setTelephone(shippingAddressVO.getTelephone());\n\t \t salesOrderShippingAddressDTO.setZip(shippingAddressVO.getZip());\n\t \t salesOrderShippingAddressDAO.insertSalesOrderShippingAddress(salesOrderShippingAddressDTO);\n\t \t }\n\t }\n\t \n\t ItemDTO itemDTO = new ItemDTO();\n\t SupplierItemDTO supplierItemDTO = new SupplierItemDTO();\n\t SalesOrderLineDTO salesOrderLineDTO = new SalesOrderLineDTO();\n\t if (generateType.equals(\"quickBuy\")) {\n\t generateQuickBuyOrder(itemCount,cartIDs, itemID, supplierID, objID, salesOrderDTO, itemDTO, supplierItemDTO,\n\t salesOrderLineDTO);\n\n\t } else if (generateType.equals(\"oneKey\")) {\n\t generateOneKeyOrder(customerID, itemCount, itemType, objID, salesOrderDTO, itemDTO, supplierItemDTO,\n\t salesOrderLineDTO);\n\n\t } else if (generateType.equals(\"shoppingcart\")) {\n\t genarateShoppingCartOrder(customerID, cartIDs, itemCount, itemType, objID, salesOrderDTO, itemDTO,\n\t supplierItemDTO, salesOrderLineDTO);\n\t } else {\n\t throw new Exception(\"订单类型无法确定\");\n\t }\n\t\t}\n return ordersList;\n }", "@Override\n\tpublic void recordOrder(int customerID, int furnitureItemID, int quantity) {\n\t}", "public void saveOrder(Order order) {\n Client client = clientService.findBySecurityNumber(order.getClient().getSecurityNumber());\n Product product = productService.findByBarcode(order.getProduct().getBarcode());\n order.setClient(client);\n order.setProduct(product);\n if (isClientPresent(order) && isProductPresent(order)) {\n do {\n currencies = parseCurrencies();\n } while (currencies.isEmpty());\n\n generateTransactionDate(order);\n\n// Client client = ClientServiceImpl.getClientRepresentationMap().get(order.getClient());\n// Product product = ProductServiceImpl.getProductRepresentationMap().get(order.getProduct());\n convertPrice(order);\n orders.add(order);\n orderedClients.add(client);\n orderedProducts.add(product);\n }\n }", "public void restock(Connection con, Statement s, int prod_id, int cat_id, int deficit )\n {\n int qtyToOrder = deficit + 100;\n int wareOrdId = assignID(con, s, \"store_orders\");\n String storeOrders = \"insert into store_orders(order_num, Loc_id, date_ordered) values(\" + wareOrdId +\", \" + Loc_id + \", '\"+date + \"')\";\n String storeOrder = \"insert into store_order(order_num, purpose) values(\" + assignID(con, s, \"store_order\") +\", '\"+purpose+\"')\";\n String vendor = findCheapVendor(con, s, prod_id, cat_id);\n double price = getStoreBuysPrice(con, s, vendor, prod_id, cat_id);\n String updateOrdFrom = \"insert into store_order_from(order_num, name) values(\" + wareOrdId + \", '\" + vendor + \"')\";\n String updateStoreBuys = \"insert into store_buys(order_num, cat_id, prod_id, qty, price, buy_date) values(\" + wareOrdId + \", \" + cat_id + \", \" + prod_id + \", \" + qtyToOrder + \", \" + price + \", '\" + date +\"')\";\n String updateStoredIn = \"update stored_in set qty = \" + (qtyToOrder) + \" where prod_id = \" + prod_id + \" and cat_id = \" + cat_id + \" and Loc_id = \" + Loc_id;\n try\n {\n int i = s.executeUpdate(storeOrder);\n i = s.executeUpdate(storeOrders);\n i = s.executeUpdate(updateOrdFrom);\n i = s.executeUpdate(updateStoreBuys);\n i = s.executeUpdate(updateStoredIn);\n }catch(Exception e)\n {\n System.out.println(\"updates failed\");\n System.exit(0);\n }\n }", "public void submitOrder() throws BackendException;", "@Override\r\n\tpublic void saveProduct(Product product) throws Exception {\n\r\n\t}", "private ContentValues storeProductInfo(long id) {\n // Reference to the Edit Text Field in the AddClient xml to the the user TYPE INPUT\n EditText et_product_name = findViewById(R.id.et_client_product);\n EditText et_product_dews = findViewById(R.id.et_client_dews);\n EditText et_product_actual_price = findViewById(R.id.et_client_product_actualPrice);\n EditText et_product_selling_price = findViewById(R.id.et_client_product_sellingPrice);\n EditText et_product_size = findViewById(R.id.et_client_product_size);\n String size = et_product_size.getText().toString().isEmpty()?\"null\":et_product_size.getText().toString();\n\n // this has the current date when the client as been has brought the product.\n String strTodayDate = getTodayDate();\n int actualPrice = Integer.parseInt(String.valueOf(et_product_actual_price.getText()).trim());\n int sellingPrice = Integer.parseInt(String.valueOf(et_product_selling_price.getText()).trim());\n // This content value is then inserted in the product info\n ContentValues productInfoValues = new ContentValues();\n productInfoValues.put(clientContract.ClientInfo.COLUMN_FK_ID,id);\n productInfoValues.put(clientContract.ClientInfo.COLUMN_PRODUCT_NAME,et_product_name.getText().toString().trim());\n productInfoValues.put(clientContract.ClientInfo.COLUMN_PRODUCT_SIZE,size);\n productInfoValues.put(clientContract.ClientInfo.COLUMN_ACTUAL_PRICE, actualPrice);\n productInfoValues.put(clientContract.ClientInfo.COLUMN_SELLING_PRICE,sellingPrice);\n productInfoValues.put(clientContract.ClientInfo.COLUMN_PROFIT,sellingPrice-actualPrice);\n productInfoValues.put(clientContract.ClientInfo.COLUMN_PROFILE_DATE,strTodayDate);\n productInfoValues.put(clientContract.ClientInfo.COLUMN_PAYMENT_MODE,mPaymentMode);\n productInfoValues.put(clientContract.ClientInfo.COLUMN_PRODUCT_IMAGE,getImage());\n String strDews = et_product_dews.getText().toString().trim();\n int dews = 0;\n if(!strDews.isEmpty()){\n dews = Integer.parseInt(et_product_dews.getText().toString().trim());\n }\n productInfoValues.put(clientContract.ClientInfo.COLUMN_PENDING,dews);\n return productInfoValues;\n }", "public void updateDB(int orderID, String prodID, String quantity) {\r\n try {\r\n String sql = \"UPDATE EmpOrders SET EmpOrderID = '\" + orderID + \"', ProductID = '\"\r\n + prodID + \"', QuanitityNeeded = '\" + quantity + \"'\";\r\n Statement stmt = Customer.connectDB();\r\n stmt.execute(sql);\r\n } catch (SQLException e) {\r\n System.out.println(e);\r\n }\r\n }", "private void updateSoldProductInfo() { public static final String COL_SOLD_PRODUCT_CODE = \"sells_code\";\n// public static final String COL_SOLD_PRODUCT_SELL_ID = \"sells_id\";\n// public static final String COL_SOLD_PRODUCT_PRODUCT_ID = \"sells_product_id\";\n// public static final String COL_SOLD_PRODUCT_PRICE = \"product_price\";\n// public static final String COL_SOLD_PRODUCT_QUANTITY = \"quantity\";\n// public static final String COL_SOLD_PRODUCT_TOTAL_PRICE = \"total_price\";\n// public static final String COL_SOLD_PRODUCT_PENDING_STATUS = \"pending_status\";\n//\n\n for (ProductListModel product : products){\n soldProductInfo.storeSoldProductInfo(new SoldProductModel(\n printInfo.getInvoiceTv(),\n printInfo.getInvoiceTv(),\n product.getpCode(),\n product.getpPrice(),\n product.getpSelectQuantity(),\n printInfo.getTotalAmountTv(),\n paymentStatus+\"\"\n ));\n\n }\n }", "@Test\n\tpublic void testProcessInventoryUpdateOrderAdjustmentChangeQty() {\n\t\tfinal Inventory inventory = new InventoryImpl();\n\t\tinventory.setUidPk(INVENTORY_UID_1000);\n\t\tinventory.setQuantityOnHand(QUANTITY_ONHAND);\n\t\tfinal long warehouseUid = WAREHOUSE_UID;\n\t\tinventory.setWarehouseUid(warehouseUid);\n\t\tfinal ProductSku productSku = new ProductSkuImpl();\n\t\tfinal String skuCode = SKU_CODE;\n\t\tproductSku.setSkuCode(skuCode);\n\t\tfinal ProductImpl product = new ProductImpl();\n\t\tproduct.setAvailabilityCriteria(AvailabilityCriteria.AVAILABLE_WHEN_IN_STOCK);\n\t\tproduct.setGuid(PRODUCT);\n\t\tproductSku.setProduct(product);\n\n\t\tinventory.setSkuCode(productSku.getSkuCode());\n\n\t\tfinal Order order = new OrderImpl();\n\t\torder.setUidPk(ORDER_UID_2000);\n\t\torder.setStoreCode(store.getCode());\n\t\tfinal PhysicalOrderShipmentImpl shipment = getMockPhysicalOrderShipment();\n\t\tfinal OrderSku orderSku = new OrderSkuImpl();\n\t\torderSku.setProductSku(productSku);\n\t\tshipment.addShipmentOrderSku(orderSku);\n\t\torder.addShipment(shipment);\n\n\t\tfinal InventoryJournalRollupImpl ijRollup = new InventoryJournalRollupImpl();\n\t\tijRollup.setAllocatedQuantityDelta(QUANTITY_10);\n\n\t\tcontext.checking(new Expectations() {\n\t\t\t{\n\t\t\t\tInventoryJournalImpl inventoryJournal = new InventoryJournalImpl();\n\t\t\t\toneOf(beanFactory).getBean(INVENTORY_JOURNAL); will(returnValue(inventoryJournal));\n\t\t\t\toneOf(beanFactory).getBean(ALLOCATION_RESULT); will(returnValue(new AllocationResultImpl()));\n\t\t\t\toneOf(beanFactory).getBean(EXECUTION_RESULT); will(returnValue(new InventoryExecutionResultImpl()));\n\n\t\t\t\tallowing(inventoryDao).getInventory(skuCode, warehouseUid); will(returnValue(inventory));\n\t\t\t\tallowing(inventoryJournalDao).getRollup(inventoryKey); will(returnValue(ijRollup));\n\t\t\t\toneOf(inventoryJournalDao).saveOrUpdate(inventoryJournal); will(returnValue(new InventoryJournalImpl()));\n\t\t\t}\n\t\t});\n\n\t\tproductInventoryManagementService.processInventoryUpdate(\n\t\t\t\tproductSku, 1,\tInventoryEventType.STOCK_ALLOCATE, EVENT_ORIGINATOR_TESTER, QUANTITY_10, order, null);\n\t\tInventoryDto inventoryDto = productInventoryManagementService.getInventory(inventory.getSkuCode(), inventory.getWarehouseUid());\n\t\tassertEquals(QUANTITY_ONHAND, inventoryDto.getQuantityOnHand());\n\t\tassertEquals(QUANTITY_ONHAND - QUANTITY_10, inventoryDto.getAvailableQuantityInStock());\n\t\tassertEquals(QUANTITY_10, inventoryDto.getAllocatedQuantity());\n\n\t\tcontext.checking(new Expectations() {\n\t\t\t{\n\t\t\t\toneOf(beanFactory).getBean(EXECUTION_RESULT); will(returnValue(new InventoryExecutionResultImpl()));\n\t\t\t}\n\t\t});\n\n\t\tfinal Inventory inventory2 = assembler.assembleDomainFromDto(inventoryDto);\n\n\t\tfinal InventoryDao inventoryDao2 = context.mock(InventoryDao.class, INVENTORY_DAO2);\n\n\t\tjournalingInventoryStrategy.setInventoryDao(inventoryDao2);\n\n\t\tcontext.checking(new Expectations() {\n\t\t\t{\n\t\t\t\tInventoryJournalImpl inventoryJournal = new InventoryJournalImpl();\n\t\t\t\toneOf(beanFactory).getBean(INVENTORY_JOURNAL); will(returnValue(inventoryJournal));\n\t\t\t\tallowing(inventoryDao2).getInventory(skuCode, warehouseUid); will(returnValue(inventory2));\n\t\t\t\toneOf(inventoryJournalDao).saveOrUpdate(inventoryJournal); will(returnValue(new InventoryJournalImpl()));\n\t\t\t}\n\t\t});\n\n\t\tallocationService.processAllocationEvent(\n\t\t\t\torderSku, AllocationEventType.ORDER_ADJUSTMENT_CHANGEQTY, EVENT_ORIGINATOR_TESTER, QUANTITY_10, null);\n\n\t\tinventoryDto = productInventoryManagementService.getInventory(inventory.getSkuCode(), inventory.getWarehouseUid());\n\n\t\tassertEquals(QUANTITY_ONHAND, inventoryDto.getQuantityOnHand());\n\t\tassertEquals(QUANTITY_ONHAND - QUANTITY_10 - QUANTITY_10, inventoryDto.getAvailableQuantityInStock());\n\t\tassertEquals(QUANTITY_10 + QUANTITY_10, inventoryDto.getAllocatedQuantity());\n\t}", "CommonResponse savePurchaseOrder(PurchaseOrderHeader purchaseOrderHeader, SecurityContext securityContext);", "@Test\n\tpublic void testProcessInventoryUpdateOrderShipmentReleaseForAlwaysAvailable() {\n\t\tfinal ProductSku productSku = new ProductSkuImpl();\n\t\tproductSku.setSkuCode(SKU_CODE);\n\t\tfinal ProductImpl product = new ProductImpl();\n\t\tproduct.setAvailabilityCriteria(AvailabilityCriteria.ALWAYS_AVAILABLE);\n\t\tproductSku.setProduct(product);\n\n\t\tfinal Order order = new OrderImpl();\n\t\torder.setUidPk(ORDER_UID_2000);\n\n\t\tcontext.checking(new Expectations() {\n\t\t\t{\n\t\t\t\tallowing(beanFactory).getBean(EXECUTION_RESULT); will(returnValue(new InventoryExecutionResultImpl()));\n\t\t\t\tallowing(productSkuService).findBySkuCode(SKU_CODE); will(returnValue(productSku));\n\t\t\t}\n\t\t});\n\n\t\tInventoryDto inventoryDto = new InventoryDtoImpl();\n\t\tinventoryDto.setSkuCode(productSku.getSkuCode());\n\t\tinventoryDto.setWarehouseUid(WAREHOUSE_UID);\n\n\t\t// No DAO operations expected.\n\t\tproductInventoryManagementService.processInventoryUpdate(inventoryDto, buildInventoryAudit(InventoryEventType.STOCK_ALLOCATE, 1));\n\t\t// No DAO operations expected.\n\t\tproductInventoryManagementService.processInventoryUpdate(inventoryDto, buildInventoryAudit(InventoryEventType.STOCK_RELEASE, 1));\n\n\t}", "public void newTransaction(){\n System.out.println(\"-----new transaction -----\");\n System.out.println(\"--no null value--\");\n List<Integer> idList =new LinkedList<>();\n List<Integer> cntList =new LinkedList<>();\n List<Double> discountList = new LinkedList<>();\n List<Double> actualPrice = new LinkedList<>();\n double totalPrice=0.0;\n System.out.print(\"cashier id: \");\n int cashierid=scanner.nextInt();\n System.out.print(\"store id: \");\n int storeid=scanner.nextInt();\n System.out.print(\"customer id: \");\n int customerid=scanner.nextInt();\n while(true){\n System.out.print(\"product id: \");\n idList.add(scanner.nextInt());\n System.out.print(\"count: \");\n cntList.add(scanner.nextInt());\n\n //support multiple product\n System.out.print(\"type y to continue(others would end): \");\n if(!scanner.next().equals('y')){\n break;\n }\n }\n\n try {\n //begin transaction\n connection.setSavepoint();\n connection.setAutoCommit(false);\n for(int i=0;i<idList.size();i++){\n //Step 1 load discount information\n String sql0=\"select * from onsaleproductions where ProductID=\"+idList.get(i)+\" and ValidDate > now()\";\n try {\n //first insert clubmemer\n result = statement.executeQuery(sql0);\n if(result.next()){\n discountList.add(result.getDouble(\"Discount\"));\n }else{\n discountList.add(1.0);\n }\n } catch (SQLException e) {\n //rollback when failed\n System.out.println(e.getMessage());\n connection.rollback();\n return;\n }\n\n // Step 2 reduce stock & judge whether the product expired or not\n String sql1=\"update merchandise set Quantity=Quantity-\"+cntList.get(i)+\" where ProductID=\"+idList.get(i)+\" and ExpirationDate > now()\";\n try {\n //first insert clubmemer\n int res = statement.executeUpdate(sql1);\n if(res==0){\n System.out.println(\"Transaction failed! No valid product found (may expired)\");\n connection.rollback();\n return;\n }\n } catch (SQLException e) {\n //rollback when failed\n System.out.println(\"Transaction failed! check product stock!\");\n connection.rollback();\n return;\n }\n\n String sql2=\"select * from merchandise where ProductID=\"+idList.get(i);\n try {\n //first insert clubmemer\n result = statement.executeQuery(sql2);\n double mprice=0.0;\n if(result.next()){\n mprice=result.getDouble(\"MarketPrice\");\n }\n actualPrice.add(mprice*discountList.get(i));\n totalPrice+=(cntList.get(i)*actualPrice.get(i));\n } catch (SQLException e) {\n //rollback when failed\n System.out.println(e.getMessage());\n connection.rollback();\n return;\n }\n }\n\n // Step 3 insert transaction record which include general information\n String sql3=\"insert into transactionrecords(cashierid,storeid,totalprice,date,customerid) values(\"+cashierid+\",\"+storeid+\",\"+totalPrice+\",now(), \"+customerid+\")\";\n int tid=0;\n try {\n //first insert clubmemer\n int res = statement.executeUpdate(sql3, Statement.RETURN_GENERATED_KEYS);\n ResultSet generatedKeys = statement.getGeneratedKeys();\n\n if (generatedKeys.next()) {\n //get generatedKeys for insert registration record\n tid=generatedKeys.getInt(\"GENERATED_KEY\");\n }\n } catch (SQLException e) {\n //rollback when failed\n System.out.println(e.getMessage());\n connection.rollback();\n return;\n }\n\n // Step 4 insert transaction contains which include product list\n for(int i=0;i<idList.size();i++){\n String sql4=\"insert into transactionContains(transactionid,productid,count,actualprice) values(\";\n sql4+=tid;\n sql4+=\", \";\n sql4+=idList.get(i);\n sql4+=\", \";\n sql4+=cntList.get(i);\n sql4+=\", \";\n sql4+=actualPrice.get(i);\n sql4+=\")\";\n try {\n //System.out.println(sql);\n int res = statement.executeUpdate(sql4);\n } catch (SQLException e) {\n //rollback when failed\n System.out.println(e.getMessage());\n connection.rollback();\n }\n\n }\n System.out.println(\"Success\");\n connection.commit();\n } catch (SQLException e) {\n System.out.println(e.getMessage());\n }finally {\n try {\n connection.setAutoCommit(true);\n } catch (SQLException e) {\n e.printStackTrace();\n }\n }\n }", "private void btnCompleteActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnCompleteActionPerformed\n DBManager db = new DBManager();\n \n for(Map.Entry<Integer, OrderLine> olEntry : loggedInCustomer.findLatestOrder().getOrderLines().entrySet())\n {\n OrderLine actualOrderLine = olEntry.getValue();\n Product orderedProduct = actualOrderLine.getProduct();\n \n orderedProduct.setStockLevel(orderedProduct.getStockLevel() - olEntry.getValue().getQuantity());\n db.updateProductAvailability(orderedProduct); \n }\n \n loggedInCustomer.findLatestOrder().setStatus(\"Complete\");\n db.completeOrder(orderId); \n \n Confirmation confirmation = new Confirmation(loggedInCustomer, orderId);\n this.dispose();\n confirmation.setVisible(true);\n \n }", "private void saveProduct() {\n // Read from input fields\n // Use trim to eliminate leading or trailing white space\n String nameString = mNameEditText.getText().toString().trim();\n String InfoString = mDescriptionEditText.getText().toString().trim();\n String PriceString = mPriceEditText.getText().toString().trim();\n String quantityString = mQuantityEditText.getText().toString().trim();\n\n // Check if this is supposed to be a new Product\n // and check if all the fields in the editor are blank\n if (mCurrentProductUri == null &&\n TextUtils.isEmpty(nameString) && TextUtils.isEmpty(InfoString) &&\n TextUtils.isEmpty(PriceString) && TextUtils.isEmpty(quantityString)) {\n // Since no fields were modified, we can return early without creating a new Product.\n // No need to create ContentValues and no need to do any ContentProvider operations.\n return;\n }\n\n // Create a ContentValues object where column names are the keys,\n // and Product attributes from the editor are the values.\n ContentValues values = new ContentValues();\n values.put(ProductContract.productEntry.COLUMN_product_NAME, nameString);\n values.put(ProductContract.productEntry.COLUMN_Product_description, InfoString);\n\n int price = 0;\n if (!TextUtils.isEmpty(PriceString)) {\n price = Integer.parseInt(PriceString);\n }\n values.put(ProductContract.productEntry.COLUMN_product_price, price);\n int quantity = 0;\n if (!TextUtils.isEmpty(quantityString)) {\n quantity = Integer.parseInt(quantityString);\n }\n values.put(productEntry.COLUMN_product_Quantity, quantity);\n\n // image\n Bitmap icLanucher = BitmapFactory.decodeResource(getResources(), R.mipmap.ic_launcher);\n Bitmap bitmap = ((BitmapDrawable) mImageView.getDrawable()).getBitmap();\n if (!equals(icLanucher, bitmap) && mImageURI != null) {\n values.put(ProductContract.productEntry.COLUMN_product_image, mImageURI.toString());\n }\n // validate all the required information\n if (TextUtils.isEmpty(nameString) || (quantityString.equalsIgnoreCase(\"0\")) || TextUtils.isEmpty(PriceString)) {\n Toast.makeText(this, getString(R.string.insert_Product_failed), Toast.LENGTH_SHORT).show();\n } else {\n // Determine if this is a new or existing Product by checking if mCurrentProductUri is null or not\n if (mCurrentProductUri == null) {\n // This is a NEW Product, so insert a new pet into the provider,\n // returning the content URI for the new Product.\n Uri newUri = getContentResolver().insert(ProductContract.productEntry.CONTENT_URI, values);\n\n // Show a toast message depending on whether or not the insertion was successful.\n if (newUri == null) {\n // If the new content URI is null, then there was an error with insertion.\n Toast.makeText(this, getString(R.string.editor_insert_Product_failed),\n Toast.LENGTH_SHORT).show();\n } else {\n // Otherwise, the insertion was successful and we can display a toast.\n Toast.makeText(this, getString(R.string.editor_insert_Product_successful),\n Toast.LENGTH_SHORT).show();\n }\n } else {\n // Otherwise this is an EXISTING Product, so update the Product with content URI: mCurrentProductUri\n // and pass in the new ContentValues. Pass in null for the selection and selection args\n // because mCurrentProductUri will already identify the correct row in the database that\n // we want to modify.\n int rowsAffected = getContentResolver().update(mCurrentProductUri, values, null, null);\n\n // Show a toast message depending on whether or not the update was successful.\n if (rowsAffected == 0) {\n // If no rows were affected, then there was an error with the update.\n Toast.makeText(this, getString(R.string.editor_update_Product_failed),\n Toast.LENGTH_SHORT).show();\n } else {\n // Otherwise, the update was successful and we can display a toast.\n Toast.makeText(this, getString(R.string.editor_update_Product_successful),\n Toast.LENGTH_SHORT).show();\n }\n }\n }\n }", "public void insertOrder(Connection conn, String clientName, String productName, int orderedQuantity) {\n\tString sql = \"INSERT INTO javadbconnection.order(clientName,productName,quantity) Values(\" + clientName + \", \"+ productName + \", \"+ orderedQuantity+ \")\";\n\ttry {\n\tPreparedStatement stmt = conn.prepareStatement(sql);\n\tstmt.executeUpdate(sql);\n\t}catch (SQLException e) {\n\tSystem.err.println(e.getMessage()); \n\t\t}\n\t}", "public int createPurchaseOrder(PurchaseOrder purchaseOrder){\n try {\n session.save(purchaseOrder);\n tx.commit();\n } catch (Exception e) {\n e.printStackTrace();\n tx.rollback();\n return 0 ;\n }\n return 0;\n }", "private void saveProduct() {\n //Delegating to the Presenter to trigger focus loss on listener registered Views,\n //in order to persist their data\n mPresenter.triggerFocusLost();\n\n //Retrieving the data from the views and the adapter\n String productName = mEditTextProductName.getText().toString().trim();\n String productSku = mEditTextProductSku.getText().toString().trim();\n String productDescription = mEditTextProductDescription.getText().toString().trim();\n ArrayList<ProductAttribute> productAttributes = mProductAttributesAdapter.getProductAttributes();\n mCategoryOtherText = mEditTextProductCategoryOther.getText().toString().trim();\n\n //Delegating to the Presenter to initiate the Save process\n mPresenter.onSave(productName,\n productSku,\n productDescription,\n mCategoryLastSelected,\n mCategoryOtherText,\n productAttributes\n );\n }", "void saveProduct(Product product);", "@Test\n\tpublic void testProcessInventoryUpdateOrderAdjustmentAddSku() {\n\t\tfinal Inventory inventory = new InventoryImpl();\n\t\tinventory.setUidPk(INVENTORY_UID_1000);\n\t\tinventory.setQuantityOnHand(QUANTITY_ONHAND);\n\t\tinventory.setWarehouseUid(WAREHOUSE_UID);\n\t\tfinal ProductSku productSku = new ProductSkuImpl();\n\t\tproductSku.setSkuCode(SKU_CODE);\n\t\tproductSku.setGuid(SKU_CODE);\n\t\tfinal ProductImpl product = new ProductImpl();\n\t\tproduct.setAvailabilityCriteria(AvailabilityCriteria.AVAILABLE_WHEN_IN_STOCK);\n\t\tproduct.setGuid(PRODUCT);\n\t\tproductSku.setProduct(product);\n\n\t\tinventory.setSkuCode(productSku.getSkuCode());\n\n\t\tfinal Order order = new OrderImpl();\n\t\torder.setUidPk(ORDER_UID_2000);\n\t\torder.setStoreCode(store.getCode());\n\t\tfinal PhysicalOrderShipmentImpl shipment = getMockPhysicalOrderShipment();\n\t\tfinal OrderSku orderSku = new OrderSkuImpl();\n\t\torderSku.setProductSku(productSku);\n\t\tshipment.addShipmentOrderSku(orderSku);\n\t\torder.addShipment(shipment);\n\n\t\tfinal InventoryJournalRollupImpl ijRollup = new InventoryJournalRollupImpl();\n\t\tijRollup.setAllocatedQuantityDelta(QUANTITY_10);\n\n\t\tcontext.checking(new Expectations() {\n\t\t\t{\n\t\t\t\toneOf(beanFactory).getBean(ALLOCATION_RESULT); will(returnValue(new AllocationResultImpl()));\n\n\t\t\t\tInventoryJournalImpl inventoryJournal = new InventoryJournalImpl();\n\t\t\t\tallowing(beanFactory).getBean(EXECUTION_RESULT); will(returnValue(new InventoryExecutionResultImpl()));\n\t\t\t\tallowing(beanFactory).getBean(INVENTORY_JOURNAL);\n\t\t\t\twill(returnValue(inventoryJournal));\n\t\t\t\tallowing(inventoryDao).getInventory(SKU_CODE, WAREHOUSE_UID); will(returnValue(inventory));\n\t\t\t\tallowing(inventoryJournalDao).getRollup(inventoryKey); will(returnValue(ijRollup));\n\t\t\t\toneOf(inventoryJournalDao).saveOrUpdate(inventoryJournal); will(returnValue(new InventoryJournalImpl()));\n\t\t\t}\n\t\t});\n\n\t\tallocationService.processAllocationEvent(orderSku, AllocationEventType.ORDER_ADJUSTMENT_ADDSKU,\tEVENT_ORIGINATOR_TESTER, QUANTITY_10, null);\n\n\t\tInventoryDto inventoryDto = productInventoryManagementService.getInventory(inventory.getSkuCode(), inventory.getWarehouseUid());\n\t\tassertEquals(inventoryDto.getQuantityOnHand(), QUANTITY_ONHAND);\n\t\tassertEquals(inventoryDto.getAvailableQuantityInStock(), QUANTITY_ONHAND - QUANTITY_10);\n\t\tassertEquals(inventoryDto.getAllocatedQuantity(), QUANTITY_10);\n\t}", "x0401.oecdStandardAuditFileTaxPT1.ProductDocument.Product addNewProduct();", "public void addOrders() {\n\t\torders.stream()\n\t\t\t.forEach(db::store);\n\t}", "public void initShop(){\n addCountToStorage(actionProduct.findProductByName(\"Jemeson\"), 3);\n addCountToStorage(actionProduct.findProductByName(\"Red Label\"), 5);\n addCountToStorage(actionProduct.findProductByName(\"Burenka\"), 10);\n addCountToStorage(actionProduct.findProductByName(\"Kupyanskoe\"), 21);\n\n //add transaction\n int idxCustomer = actionCustomer.findCustomerByName(\"Perto\");\n int idxProduct = actionProduct.findProductByName(\"Burenka\");\n\n addTransaction(idxCustomer, idxProduct, getDate(-7), 1 , actionProduct.getPriceByIdx(idxProduct));\n\n idxProduct = actionProduct.findProductByName(\"white bread\");\n addTransaction(idxCustomer, idxProduct, getDate(-7), 1 , actionProduct.getPriceByIdx(idxProduct));\n\n idxCustomer = actionCustomer.findCustomerByName(\"Dmytro\");\n addTransaction(idxCustomer, idxProduct, getDate(-6), 2 , actionProduct.getPriceByIdx(idxProduct));\n\n idxProduct = actionProduct.findProductByName(\"burenka\");\n addTransaction(idxCustomer, idxProduct, getDate(-6), 2 , actionProduct.getPriceByIdx(idxProduct));\n\n\n }", "@Before\n public void setUp() {\n Basket_in = new TCreate_Input();\n Basket_up = new TUpdate_Input();\n BasketAttr_in = new TAttribute(\"IsAddressOK\", \"1\", null, null);\n BasketAttr_up = new TAttribute(\"IsAddressOK\", \"0\", null, null);\n Address_in = new TAddressNamed();\n\n // init input address data\n Address_in.setEMail(\"[email protected]\");\n Address_in.setFirstName(\"Klaus\");\n Address_in.setLastName(\"Klaussen\");\n Address_in.setCity(\"Klausdorf\");\n Address_in.setZipcode(\"08151\");\n Address_in.setCountryID(BigInteger.valueOf(276));\n Address_in.setStreet(\"Musterstraße 2\");\n Address_in.setStreet2(\"Ortsteil Niederfingeln\");\n Address_in.setAttributes(new TAttribute[] { new TAttribute(\"JobTitle\", \"best Job\", null, null),\n new TAttribute(\"Salutation\", \"Dr.\", null, null), });\n\n Address_up = Address_in;\n // just update some fields\n Address_up.setFirstName(\"Hans\");\n Address_up.setLastName(\"Hanssen\");\n Address_up.setStreet(\"Musterstraße 2b\");\n Address_up.setStreet2(\"Ortsteil Oberfingeln\");\n\n Basket_in.setBillingAddress(Address_in);\n\n Basket_in.setAttributes(new TAttribute[] { BasketAttr_in });\n TLineItemContainerIn lineItemContainer = new TLineItemContainerIn();\n lineItemContainer.setCurrencyID(\"EUR\");\n lineItemContainer.setPaymentMethod(\"PaymentMethods/Invoice\");\n lineItemContainer.setShippingMethod(\"ShippingMethods/Express\");\n lineItemContainer.setTaxArea(\"/TaxMatrixGermany/\\\"non EU\\\"\");\n lineItemContainer.setTaxModel(\"gross\");\n String productGuid = productService.getInfo(new String[]{\"Products/ho_1112105010\"}, new String[]{\"GUID\"})[0].getAttributes()[0].getValue();\n assertNotNull(productGuid);\n lineItemContainer.setProductLineItems(new TProductLineItemIn[] { new TProductLineItemIn(productGuid, (float) 10) });\n Basket_in.setLineItemContainer(lineItemContainer);\n\n // init order update data\n Basket_up.setBillingAddress(Address_up);\n Basket_up.setAttributes(new TAttribute[] { BasketAttr_up });\n\n // delete the test order if it exists\n TExists_Return[] Baskets_exists_out = basketService.exists(new String[] { BasketPath });\n if (Baskets_exists_out[0].getExists()) {\n TDelete_Return[] Baskets_delete_out = basketService.delete(new String[] { BasketPath });\n assertNoError(Baskets_delete_out[0].getError());\n }\n }", "public void onClick(View v)\n {\n // Add to cart model\n for (int i = 0; i < productQuantity; i++)\n {\n dbManager.addToCart(activeProduct.getID());\n }\n }", "public void process(PurchaseOrder po)\n {\n File file = new File(path + \"/\" + ORDERS_XML);\n \n try\n {\n DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance();\n DocumentBuilder db = dbf.newDocumentBuilder();\n InputSource is = new InputSource();\n is.setCharacterStream(new FileReader(file));\n\n Document doc = db.parse(is);\n\n Element root = doc.getDocumentElement();\n Element e = doc.createElement(\"order\");\n\n // Convert the purchase order to an XML format\n String keys[] = {\"orderNum\",\"customerRef\",\"product\",\"quantity\",\"unitPrice\"};\n String values[] = {Integer.toString(po.getOrderNum()), po.getCustomerRef(), po.getProduct().getProductType(), Integer.toString(po.getQuantity()), Float.toString(po.getUnitPrice())};\n \n for(int i=0;i<keys.length;i++)\n {\n Element tmp = doc.createElement(keys[i]);\n tmp.setTextContent(values[i]);\n e.appendChild(tmp);\n }\n \n // Set the status to submitted\n Element status = doc.createElement(\"status\");\n status.setTextContent(\"submitted\");\n e.appendChild(status);\n\n // Set the order total\n Element total = doc.createElement(\"orderTotal\");\n float orderTotal = po.getQuantity() * po.getUnitPrice();\n total.setTextContent(Float.toString(orderTotal));\n e.appendChild(total);\n\n // Write the content all as a new element in the root\n root.appendChild(e);\n TransformerFactory tf = TransformerFactory.newInstance();\n Transformer m = tf.newTransformer();\n DOMSource source = new DOMSource(root);\n StreamResult result = new StreamResult(file);\n m.transform(source, result);\n\n }\n catch(Exception e)\n {\n System.out.println(\"Error: \" + e.getMessage());\n }\n }", "@Test\n\tpublic void testAddingItemsToShoppingCart() {\n\t\tShoppingCartAggregate shoppingCartAggregate = storeFrontService.getStoreFront()\n\t\t\t\t.getShoppingCounter(SHOPPING_COUNTER_NAME).get().startShoppingCart(CUSTOMER_NAME);\n\n\t\ttry {\n\t\t\tshoppingCartAggregate.addToCart(TestProduct.phone.getProductId(), new BigDecimal(1));\n\t\t\tshoppingCartAggregate.addToCart(TestProduct.phoneCase.getProductId(), new BigDecimal(2));\n\t\t} catch (InsufficientStockException e) {\n\t\t\tfail(\"Inventory check failed while adding a product in shopping cart\");\n\t\t}\n\n\t\tPurchaseOrderAggregate purchaseOrderAggregate = shoppingCartAggregate.checkoutCart();\n\t\tassertNotNull(purchaseOrderAggregate);\n\n\t\tPurchaseOrder purchaseOrder = purchaseOrderAggregate.getPurchaseOrder();\n\t\tassertNotNull(purchaseOrder);\n\n\t\tassertEquals(2, purchaseOrder.getOrderItems().size());\n\n\t\tassertEquals(ShoppingCart.CartStatus.CHECKEDOUT, shoppingCartAggregate.getShoppingCart().getCartStatus());\n\t}", "static void addCustomerOrder() {\n\n Customer newCustomer = new Customer(); // create new customer\n\n Product orderedProduct; // initialise ordered product variable\n\n int quantity; // set quantity to zero\n\n String name = Validate.readString(ASK_CST_NAME); // Asks for name of the customer\n\n newCustomer.setName(name); // stores name of the customer\n\n String address = Validate.readString(ASK_CST_ADDRESS); // Asks for address of the customer\n\n newCustomer.setAddress(address); // stores address of the customer\n\n customerList.add(newCustomer); // add new customer to the customerList\n\n int orderProductID = -2; // initialize orderProductID\n\n while (orderProductID != -1) { // keep looping until user enters -1\n\n orderProductID = Validate.readInt(ASK_ORDER_PRODUCTID); // ask for product ID of product to be ordered\n\n if(orderProductID != -1) { // keep looping until user enters -1\n\n quantity = Validate.readInt(ASK_ORDER_QUANTITY); // ask for the quantity of the order\n\n orderedProduct = ProductDB.returnProduct(orderProductID); // Search product DB for product by product ID number, return and store as orderedProduct\n\n Order newOrder = new Order(); // create new order for customer\n\n newOrder.addOrder(orderedProduct, quantity); // add the new order details and quantity to the new order\n\n newCustomer.addOrder(newOrder); // add new order to customer\n\n System.out.println(\"You ordered \" + orderedProduct.getName() + \", and the quantity ordered is \" + quantity); // print order\n }\n }\n }", "public void submitOrder(){\t\n\t\tSharedPreferences sharedPref = PreferenceManager.getDefaultSharedPreferences(this);\n\t\tint tableNumber = Integer.parseInt(sharedPref.getString(\"table_num\", \"\"));\n\t\t\n\t\tif(menu != null){\n\t\t\tParseUser user = ParseUser.getCurrentUser();\n\t\t\tParseObject order = new ParseObject(\"Order\");\n\t\t\torder.put(\"user\", user);\n\t\t\torder.put(\"paid\", false);\n\t\t\torder.put(\"tableNumber\", tableNumber); // Fix this -- currently hard coding table number\n\t\t\t\n\t\t\tParseRelation<ParseObject> items = order.getRelation(\"items\");\n\t\t\t\n\t\t\tfor(ParseObject item : selectedItems) {\n\t\t\t\titems.add(item);\n\t\t\t}\n\t\t\t\n\t\t\torder.saveInBackground(new SaveCallback(){\n\n\t\t\t\t@Override\n\t\t\t\tpublic void done(ParseException e) {\n\t\t\t\t\tif(e == null){\n\t\t\t\t\t\tToast.makeText(getApplicationContext(), \"Order Submitted!\", 5).show();\n\t\t\t\t\t\tfinish();\n\t\t\t\t\t}\n\t\t\t\t\telse{\n\t\t\t\t\t\tToast.makeText(getApplicationContext(), \"Submitting Order Failed!\", 5).show();\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t}\n\t\t\t\t\n\t\t\t});\n\t\t}\n\t}", "@Override\n\t public void onClick(View v)\n\t {\n\t\t\t sqLite=context.openOrCreateDatabase(\"basketbuddy\", context.MODE_PRIVATE, null);\n\t\t\t \n\t\t\t Cursor cc = sqLite.rawQuery(\"SELECT PRODUCT_QTY, PRODUCT_VALUE FROM CART WHERE PRODUCT_CODE =\"+Integer.parseInt(prod_name.getProductCode()), null);\n\t\t\t \n\t\t\t if (cc.getCount()== 0)\n\t\t\t {\n\t \t\t //product not already there in cart..add to cart\n\t\t\t\t sqLite.execSQL(\"INSERT INTO CART (PRODUCT_CODE, PRODUCT_NAME, PRODUCT_BARCODE, PRODUCT_GRAMMAGE\"+\n\t \t \", PRODUCT_MRP, PRODUCT_BBPRICE, PRODUCT_DIVISION, PRODUCT_DEPARTMENT,PRODUCT_QTY,PRODUCT_VALUE) VALUES(\"+\n\t \t\t prod_name.getProductCode()+\",'\"+ prod_name.getProductName()+ \"','\" +\n\t \t prod_name.getProductBarcode()+\"','\"+ prod_name.getProductGrammage()+\"',\"+\n\t \t\t Integer.parseInt(prod_name.getProductMRP())+\",\"+ Integer.parseInt(prod_name.getProductBBPrice())+\",\"+\n\t \t Integer.parseInt(prod_name.getProductDivision())+\",\"+Integer.parseInt(prod_name.getProductDepartment())+\n\t \t \",1,\"+ Integer.parseInt(prod_name.getProductBBPrice())+\")\");\n\t \t\t \n\t \t\tToast.makeText(context,\"Item \"+prod_name.getProductName()+\" added to Cart\", Toast.LENGTH_LONG).show();\n\t\t\t }\n\t\t\t else\n\t\t\t {\n\t\t\t\t \n\t\t\t\t //product already there in cart\n\t\t\t\t if(cc.moveToFirst())\n\t\t\t\t\t{\n\t\t\t\t\t\tdo{\n\t\t\t\t\t\t\ttempQty=cc.getInt(0);\n\t\t\t\t\t\t\ttempValue = cc.getInt(1);\n\t\t\t\t\t\t}while(cc.moveToNext());\n\t\t\t\t\t}\n\t\t\t\t \n\t\t\t\t if (tempQty < 10)\n\t\t\t\t {\n\t\t\t\t\t sqLite.execSQL(\"UPDATE CART SET PRODUCT_QTY = \"+ (tempQty+1)+\",PRODUCT_VALUE = \"+ \n\t\t\t\t\t(Integer.parseInt(prod_name.getProductBBPrice())+tempValue)+\" WHERE PRODUCT_CODE =\"+\n\t\t\t\t\tprod_name.getProductCode());\n\t\t\t\t\t \n\t\t\t\t\t Toast.makeText(context,\"Item \"+prod_name.getProductName()+\" added to Cart\", Toast.LENGTH_LONG).show();\n\t\t\t\t }\n\t\t\t }\n\n\t\t\t sqLite.close();\n\t \t \n\t }", "@Transactional (rollbackFor=HighQuantytyException.class) // Here comes the magic\n\tpublic void addProduct(String name, int quantity) {\n\t\tProduct product = new Product();\n\t\tproduct.setName(name);\n\t\tproduct.setQuantity(quantity);\n\n\t\tSession session = mySessionFactory.openSession();\n\t\ttry {\n\t\t\tif (product.getQuantity() > 500) {\n\t\t\t\tthrow new HighQuantytyException(\"Higher Quantities are not allowed\");\n\t\t\t} else {\n\t\t\t\tsession.save(product);\t\t\t\t\n\t\t\t}\n\t\t\tSystem.out.println(\"Saved: \" + product.getId());\n\t\t} catch (Exception e) {\n\t\t\te.printStackTrace();\n\t\t}\n\t}", "OrderedProduct(int quantity, String prodCode, String prodName, int prodSize, String prodVariety,\n double prodPrice) {\n this.quantity = quantity;\n this.prodCode = prodCode;\n this.prodName = prodName;\n this.prodSize = prodSize;\n this.prodVariety = prodVariety;\n this.prodPrice = prodPrice;\n }", "public void execute(){\n\t\tnew PayCarOrderTask().execute();\n\t}", "int insert(SmtOrderProductAttributes record);", "@Test\n public void test2_saveProductToOrder() {\n ProductDTO productDTO= new ProductDTO();\n productDTO.setSKU(UUID.randomUUID().toString());\n productDTO.setName(\"ORANGES\");\n productDTO.setPrice(new BigDecimal(40));\n productService.saveProduct(productDTO,\"test\");\n\n //get id from product and order\n long productId = productService.getIdForTest();\n long orderId = orderService.getIdForTest();\n\n OrderDetailDTO orderDetailDTO = new OrderDetailDTO();\n orderDetailDTO.setOrderId(orderId);\n orderDetailDTO.setProductId(productId);\n String res = orderService.saveProductToOrder(orderDetailDTO,\"test\");\n assertEquals(null,res);\n }", "public void addToOrder()\n {\n\n if ( donutTypeComboBox.getSelectionModel().isEmpty() || flavorComboBox.getSelectionModel().isEmpty() )\n {\n Popup.DisplayError(\"Must select donut type AND donut flavor.\");\n return;\n } else\n {\n int quantity = Integer.parseInt(quantityTextField.getText());\n if ( quantity == 0 )\n {\n Popup.DisplayError(\"Quantity must be greater than 0.\");\n return;\n } else\n {\n for ( int i = 0; i < quantity; i++ )\n {\n Donut donut = new Donut(donutTypeComboBox.getSelectionModel().getSelectedIndex(), flavorComboBox.getSelectionModel().getSelectedIndex());\n mainMenuController.getCurrentOrder().add(donut);\n }\n if ( quantity == 1 )\n {\n Popup.Display(\"Donuts\", \"Donut has been added to the current order.\");\n } else\n {\n Popup.Display(\"Donuts\", \"Donuts have been added to the current order.\");\n }\n\n\n donutTypeComboBox.getSelectionModel().clearSelection();\n flavorComboBox.getSelectionModel().clearSelection();\n quantityTextField.setText(\"0\");\n subtotalTextField.setText(\"$0.00\");\n }\n }\n\n\n }", "public void buy(int index, int quantity){\n if (index>=1 && index<=car.size()){\n car.get(index-1).getAvailableQuantity().setAmount(quantity);\n bill.getProducts().add(car.get(index-1));\n car.remove(index-1);\n }\n }", "@PostMapping(\"/order\")\n public ResponseEntity<OrderConfirmation> placeOrder(final HttpSession session) throws Exception {\n Map<String, CartProduct> initialCart = (Map<String, CartProduct>) session.getAttribute(CART_SESSION_CONSTANT);\n log.info(session.getId() + \" : Reviewing the order\");\n //check if the cart is empty\n ControllerUtils.checkEmptyCart(initialCart, session.getId());\n\n //check if items are still available during confirmation of order\n List<OrderProduct> orderProducts = new ArrayList<>();\n for (String key : initialCart.keySet())\n orderProducts.add(ControllerUtils.parse(initialCart.get(key)));\n List<String> chckQuantity = prodService.checkQuantityList(orderProducts);\n if (chckQuantity != null) {\n log.error(session.getId() + \" : Error submitting order for products unavailable\");\n throw new AvailabilityException(chckQuantity);\n }\n\n //Confirm order and update tables\n log.info(session.getId() + \" : confirming the order and killing the session\");\n OrderConfirmation orderConfirmation = prodService.confirmOrder(initialCart);\n session.invalidate();\n return ResponseEntity.status(HttpStatus.OK).body(orderConfirmation);\n }", "@Override\n\tpublic int completeOrder(int orderId) {\n\t\tOrder order = orderDao.getOrder(orderId);\n\t\tfor (ProductOrder productOrder : order.getProductOrders()) {\n\t\t\tProduct product = productOrder.getProduct();\n\t\t\tint newQuantity = product.getAvailableQuantity() - productOrder.getOrderAmount();\n\t\t\tproduct.setAvailableQuantity(newQuantity);\n\t\t\tcatalogService.editProduct(product);\n\t\t}\n\t\treturn orderDao.completeOrder(orderId);\n\t}", "void createOrder(List<Product> products, Customer customer);", "@Override\n @Transactional\n public OrderDTO createOrder(OrderDTO orderDTO) {\n\n String orderId = KeyUtil.genUniqueKey();\n BigDecimal orderAmount = new BigDecimal(BigInteger.ZERO);\n// List<CartDTO> cartDTOList = new ArrayList<>();\n //1.\n for (OrderDetail orderDetail : orderDTO.getOrderDetailList()) {\n ProductInfo productInfo = productInfoService.findOne(orderDetail.getProductId());\n if (productInfo == null) {\n throw new ProjectException(ResultEnum.PRODUCT_NOT_EXIST);\n }\n\n //2.\n orderAmount = productInfo.getProductPrice()\n .multiply(new BigDecimal(orderDetail.getProductQuantity()))\n .add(orderAmount);\n //3. orderDetail db insertion\n orderDetail.setDetailId(KeyUtil.genUniqueKey());\n orderDetail.setOrderId(orderId);\n BeanUtils.copyProperties(productInfo, orderDetail);\n orderDetailRepository.save(orderDetail);\n// CartDTO cartDTO = new CartDTO(orderDetail.getProductId(), orderDetail.getProductQuantity());\n// cartDTOList.add(cartDTO);\n }\n\n //3. orderMaster\n OrderMaster orderMaster = new OrderMaster();\n orderDTO.setOrderId(orderId);\n BeanUtils.copyProperties(orderDTO, orderMaster);\n orderMaster.setOrderAmount(orderAmount);\n orderMaster.setOrderStatus(OrderStatusEnum.NEW.getCode());\n orderMaster.setPayStatus(PayStatusEnum.WAIT.getCode());\n orderMasterRepository.save(orderMaster);\n\n //4.\n List<CartDTO> cartDTOList = orderDTO.getOrderDetailList().stream().map(e ->\n new CartDTO(e.getProductId(), e.getProductQuantity())\n ).collect(Collectors.toList());\n\n productInfoService.decreaseInventory(cartDTOList);\n\n return orderDTO;\n }", "public void purchase(){\n\t\t\n\t\t//Ask the user for notes about the item\n\t\tSystem.out.println(\"Please enter any special requests regarding your \" +\n\t\t\t\t\t\t\t\"food item for our staff to see while they prepare it.\");\n\t\tScanner scan = new Scanner(System.in);\n\t\tString foodNotes = scan.nextLine();\n\t\tnotes = foodNotes;\n\t\t\n\t\t//Add this item's price to the order total\n\t\tMenu.orderPrice += price;\n\t\t\n\t}", "public void saveProduct(Product product);", "public void processProduct() {\n Product product = self.getCurrentProduct();\n ServiceManager sm = self.getServiceManager();\n boolean failure = false;\n\n if (product != null) {\n //update the product's location\n product.setLocation(self.getLocation());\n env.updateProduct(product);\n\n //process product if the current service equals the needed service and is available,\n //otherwise, just forward the product to the output-buffer without further action.\n if (sm.checkProcessingAllowed(product.getCurrentStepId())) {\n int processingSteps = sm.getCapability().getProcessingTime() * env.getStepTimeScaler();\n for (int i = 1; i <= processingSteps; i++) {\n if (i % env.getStepTimeScaler() == 0) {\n self.increaseWorkload();\n syncUpdateWithCheck(false);\n } else {\n waitStepWithCheck();\n }\n }\n failure = sm.checkFailure(getRandom());\n }\n\n //block until enough space on output-buffer\n while (!self.getOutputBuffer().tryPutProduct(product) && !getResetFlag()) {\n waitStepWithCheck();\n }\n // update product, no sync – does not change pf\n product.finishCurrentStep();\n product.setLocation(self.getOutputLocation());\n env.updateProduct(product);\n // move product to output-buffer + break a service (optional)\n self.setCurrentProduct(null);\n self.increaseFinishCount();\n syncUpdateWithCheck(failure);\n }\n }", "@Test\n\tpublic void orderingItemsIncreasesCumulativeOrders() {\n\t\tItemQuantity itemQ1 = new ItemQuantity(101, 5);\n\t\tItemQuantity itemQ2 = new ItemQuantity(102, 10);\n\t\tList<ItemQuantity> itemQuantities = new ArrayList<ItemQuantity>();\n\t\titemQuantities.add(itemQ1);\n\t\titemQuantities.add(itemQ2);\n\t\tOrderStep step = new OrderStep(1, itemQuantities);\n\t\t\n\t\ttry {\n\t\t\titemSupplier.executeStep(step);\n\t\t} catch (OrderProcessingException e) {\n\t\t\te.printStackTrace();\n\t\t\tfail();\n\t\t}\n\t\t\n\t\tList<ItemQuantity> ordersPerItem = null;\n\t\ttry {\n\t\t\tordersPerItem = itemSupplier.getOrdersPerItem(supplierItemIds);\n\t\t} catch (InvalidItemException e) {\n\t\t\te.printStackTrace();\n\t\t\tfail();\n\t\t}\n\t\t\n\t\tfor (ItemQuantity itemQ : ordersPerItem) {\n\t\t\tif (itemQ.getItemId() == 101)\n\t\t\t\tassertEquals(5, itemQ.getQuantity());\n\t\t\tif (itemQ.getItemId() == 102)\n\t\t\t\tassertEquals(10, itemQ.getQuantity());\n\t\t\tif (itemQ.getItemId() == 103)\n\t\t\t\tassertEquals(0, itemQ.getQuantity());\n\t\t}\n\t\t\n\t\t/*\n\t\t * Place another order\n\t\t */\n\t\titemQ1 = new ItemQuantity(101, 10);\n\t\titemQ2 = new ItemQuantity(103, 3);\n\t\titemQuantities = new ArrayList<ItemQuantity>();\n\t\titemQuantities.add(itemQ1);\n\t\titemQuantities.add(itemQ2);\n\t\tstep = new OrderStep(1, itemQuantities);\n\t\t\n\t\ttry {\n\t\t\titemSupplier.executeStep(step);\n\t\t} catch (OrderProcessingException e) {\n\t\t\te.printStackTrace();\n\t\t\tfail();\n\t\t}\n\t\t\n\t\tordersPerItem = null;\n\t\ttry {\n\t\t\tordersPerItem = itemSupplier.getOrdersPerItem(supplierItemIds);\n\t\t} catch (InvalidItemException e) {\n\t\t\te.printStackTrace();\n\t\t\tfail();\n\t\t}\n\t\t\n\t\tfor (ItemQuantity itemQ : ordersPerItem) {\n\t\t\tif (itemQ.getItemId() == 101)\n\t\t\t\tassertEquals(15, itemQ.getQuantity());\n\t\t\tif (itemQ.getItemId() == 102)\n\t\t\t\tassertEquals(10, itemQ.getQuantity());\n\t\t\tif (itemQ.getItemId() == 103)\n\t\t\t\tassertEquals(3, itemQ.getQuantity());\n\t\t}\n\t}", "@Test\n public void addToCart() throws Exception {\n\n ReadableProducts product = super.readyToWorkProduct(\"addToCart\");\n assertNotNull(product);\n\n PersistableShoppingCartItem cartItem = new PersistableShoppingCartItem();\n cartItem.setProduct(product.getId());\n cartItem.setQuantity(1);\n\n final HttpEntity<PersistableShoppingCartItem> cartEntity =\n new HttpEntity<>(cartItem, getHeader());\n final ResponseEntity<ReadableShoppingCart> response =\n testRestTemplate.postForEntity(\n String.format(\"/api/v1/cart/\"), cartEntity, ReadableShoppingCart.class);\n\n // assertNotNull(response);\n // assertThat(response.getStatusCode(), is(CREATED));\n\n }", "public void save()throws Exception{\n if(!pname1.getText().isEmpty() && !qty1.getText().isEmpty() && !prc1.getText().isEmpty() && !rsp1.getText().isEmpty() ){\r\n s_notif1.setId(\"hide\");\r\n ArrayList<Product> ar = new ArrayList<>();\r\n com.mysql.jdbc.Connection conn = db.getConnection();\r\n Statement stm = conn.createStatement();\r\n int rs = stm.executeUpdate(\"UPDATE products SET \"\r\n + \"name='\"+pname1.getText()+\"', \"\r\n + \"qty='\"+qty1.getText()+\"', \"\r\n + \"price='\"+prc1.getText()+\"',\"\r\n + \"re_stock_point='\"+rsp1.getText()+\"' WHERE ID ='\"+S_ID+\"';\");\r\n if(rs > 0){\r\n s_notif1.setId(\"show\");\r\n }\r\n }\r\n loadData();\r\n }", "public void addToCart_process(View v) {\n\n addToCart_flag = true;\n // create string\n create_final_string_product();\n // function show message\n ToastMessage();\n // clear all data after adding product into cart\n clear_data();\n }", "public void saveShoppingCart() throws BackendException;", "private void generateAndSubmitOrder()\n {\n OrderSingle order = Factory.getInstance().createOrderSingle();\n order.setOrderType(OrderType.Limit);\n order.setPrice(BigDecimal.ONE);\n order.setQuantity(BigDecimal.TEN);\n order.setSide(Side.Buy);\n order.setInstrument(new Equity(\"METC\"));\n order.setTimeInForce(TimeInForce.GoodTillCancel);\n if(send(order)) {\n recordOrderID(order.getOrderID());\n }\n }", "public abstract void saveOrder(Order order);", "@Override\n public void updateProduct(TradingQuote tradingQuote) {\n }", "public void execute(OrderTransactionIfc transaction, JdbcTemplate connection)\n throws DataException\n {\n if (logger.isDebugEnabled())\n logger.debug(\"JdbcSaveRetailTransactionLineItems.execute()\");\n\n \n insertOrder(connection, transaction);\n\n if (logger.isDebugEnabled())\n logger.debug(\"JdbcSaveRetailTransactionLineItems.execute()\");\n }" ]
[ "0.63509446", "0.62939656", "0.61852676", "0.61264116", "0.61092776", "0.6107946", "0.6029199", "0.6017687", "0.5995463", "0.59531754", "0.5943621", "0.59156317", "0.5912285", "0.5902711", "0.58971965", "0.58770525", "0.5862862", "0.5853725", "0.58372796", "0.5828116", "0.5826472", "0.5817702", "0.5804744", "0.57991946", "0.57976526", "0.5772953", "0.5771986", "0.57708657", "0.57698363", "0.5752847", "0.5751818", "0.5743184", "0.57422984", "0.5740886", "0.5730489", "0.5730204", "0.5728603", "0.572816", "0.5721735", "0.5715634", "0.5715504", "0.57014227", "0.5701153", "0.56960225", "0.569539", "0.56915057", "0.5688605", "0.56859183", "0.56819385", "0.56805104", "0.56776553", "0.56570476", "0.5651872", "0.5639347", "0.56276363", "0.5626779", "0.56228566", "0.56114876", "0.55988234", "0.559733", "0.55914056", "0.5571637", "0.556683", "0.55666506", "0.55664927", "0.55658984", "0.556483", "0.555169", "0.5547815", "0.554708", "0.55382615", "0.55345404", "0.5532926", "0.5526405", "0.55234665", "0.5520174", "0.5519166", "0.5516621", "0.55097926", "0.5506467", "0.5503874", "0.55038273", "0.54910177", "0.54884094", "0.548618", "0.5475742", "0.54746985", "0.54744536", "0.5463912", "0.5462654", "0.54623896", "0.5461967", "0.5460964", "0.5454164", "0.54481894", "0.5445269", "0.54362273", "0.54295534", "0.5425603", "0.5422677", "0.54162294" ]
0.0
-1
It pulls the order(s) of a client from db, return to client as a array of orders.
public String[] viewOrder(Session session) throws RemoteException{ System.out.println("Server model invokes viewOrder() method"); return null; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public static ArrayList<Order> getOrders(Client client) {\n\t\tArrayList<Order> temp = new ArrayList<Order>();\n\t\tString request = \"SELECT * FROM `order` WHERE `client` = ?\";\n\t\ttry {\n\t\t\tPreparedStatement stmt = DBConnection.getConnection().prepareStatement(request);\n\t\t\tstmt.setInt(1, client.getId());\n\t\t\tResultSet results = stmt.executeQuery();\n\t\t\twhile(results.next()) {\n\t\t\t\ttemp.add(new Order(results.getInt(1), results.getString(4), results.getDate(3), CartItem.getCartItems(results.getInt(1))));\n\t\t\t}\n\t\t\treturn temp;\n\t\t} catch (ClassNotFoundException | SQLException e) {\n\t\t\tSystem.out.println(\"An error occured while fetching orders: \" + e.getMessage());\n\t\t\treturn null;\n\t\t}\n\t\t\n\t}", "List<Order> findClientOrders(long clientId) throws DaoProjectException;", "public List<ClientOrderDto> getClientOrders(Long clientId) throws ServiceException {\n\t\tList<ClientOrderDto> orderList = new ArrayList<>();\n\t\ttry (DaoCreator daoCreator = new DaoCreator()) {\n\t\t\tOrderDao orderDao = daoCreator.getOrderDao();\n\t\t\torderList = orderDao.getAllClientOrdersById(clientId);\n\t\t\tCollections.reverse(orderList);\n\t\t\tLOGGER.info(\"Find and return all client = {} orders from DB\", clientId);\n\t\t} catch(DaoException|ConnectionException|SQLException e) {\n\t\t throw new ServiceException(\"Can't return all client orders from DB\", e);\n\t\t}\n\t\treturn orderList;\n\t}", "public List<Order> getOrderByClient(Client client) throws Exception {\n\n\t\tConnection con = null;\n\t\tPreparedStatement stmt = null;\n\t\tResultSet rs = null;\n\t\tString sql = \"select * from ocgr_orders left join ocgr_clients on ocgr_orders.client_id = ocgr_clients.client_id left join ocgr_vendors on ocgr_orders.vendor_id = ocgr_vendors.vendor_id where client_id=? ;\";\n\n\t\tDB db = new DB();\n\n\t\tList<Order> orders = new ArrayList<Order>();\n\n\t\ttry {\n\t\t\tdb.open();\n\t\t\tcon = db.getConnection();\n\n\t\t\tstmt = con.prepareStatement(sql);\n\t\t\tstmt.setString(1,client.getId() );\n\t\t\trs = stmt.executeQuery();\n\n\t\t\twhile (rs.next()) {\n\n\t\t\tVendor vendor = new Vendor( rs.getString(\"vendor_id\"), rs.getString(\"vendor_password\"), rs.getString(\"vendor_email\"),\n\t\t\t\t\t\t\t\t\t\trs.getString(\"vendor_fullname\"), rs.getString(\"vendor_compName\"), rs.getString(\"vendor_address\"),\n\t\t\t\t\t\t\t\t\t\trs.getString(\"vendor_itin\"), rs.getString(\"vendor_doy\"), rs.getString(\"vendor_phone\") );\n\n\t\t\torders.add( new Order(rs.getString(\"order_id\"), rs.getTimestamp(\"order_date\"), rs.getBigDecimal(\"order_total\"),\n\t\t\t\t\t\t\t\t\trs.getString(\"order_address\"), rs.getString(\"order_address\"),\n\t\t\t\t\t\t\t\t\trs.getString(\"order_paymentmethod\"), client, vendor ) );\n\t\t\t}\n\t\t\trs.close();\n\t\t\tstmt.close();\n\t\t\tdb.close();\n\n\t\t\treturn orders;\n\n\t\t} catch (Exception e) {\n\t\t\tthrow new Exception(e.getMessage());\n\n\t\t} finally {\n\t\t\ttry {\n\t\t\t\tdb.close();\n\t\t\t} catch (Exception e) {}\n\t\t}\n\t}", "public List<Order> getOrders() throws Exception {\n\n\t\tConnection con = null;\n\t\tPreparedStatement stmt = null;\n\t\tResultSet rs = null;\n\t\tString sql = \"select * from ocgr_orders left join ocgr_clients on ocgr_orders.client_id = ocgr_clients.client_id left join ocgr_vendors on ocgr_orders.vendor_id = ocgr_vendors.vendor_id;\";\n\n\t\tDB db = new DB();\n\n\t\tList<Order> orders = new ArrayList<Order>();\n\n\t\ttry {\n\t\t\tdb.open();\n\t\t\tcon = db.getConnection();\n\n\t\t\tstmt = con.prepareStatement(sql);\n\t\t\trs = stmt.executeQuery();\n\n\t\t\twhile (rs.next()) {\n\t\t\t\tClient client = new Client( rs.getString(\"client_id\"), rs.getString(\"client_password\"), rs.getString(\"client_email\"),\n\t\t\t\t\t\t\t\t\t\t\trs.getString(\"client_fullname\"), rs.getString(\"client_compName\"), rs.getString(\"client_address\"),\n\t\t\t\t\t\t\t\t\t\t\trs.getString(\"client_itin\"), rs.getString(\"client_doy\"), rs.getString(\"client_phone\") );\n\n\t\t\t\tVendor vendor = new Vendor( rs.getString(\"vendor_id\"), rs.getString(\"vendor_password\"), rs.getString(\"vendor_email\"),\n\t\t\t\t\t\t\t\t\t\t\trs.getString(\"vendor_fullname\"), rs.getString(\"vendor_compName\"), rs.getString(\"vendor_address\"),\n\t\t\t\t\t\t\t\t\t\t\trs.getString(\"vendor_itin\"), rs.getString(\"vendor_doy\"), rs.getString(\"vendor_phone\") );\n\n\t\t\t\torders.add( new Order(rs.getString(\"order_id\"), rs.getTimestamp(\"order_date\"), rs.getBigDecimal(\"order_total\"),\n\t\t\t\t\t\t\t\t\t rs.getString(\"order_address\"), rs.getString(\"order_address\"),\n\t\t\t\t\t\t\t\t\t rs.getString(\"order_paymentmethod\"), client, vendor ) );\n\t\t\t}\n\t\t\trs.close();\n\t\t\tstmt.close();\n\t\t\tdb.close();\n\n\t\t\treturn orders;\n\n\t\t} catch (Exception e) {\n\t\t\tthrow new Exception(e.getMessage());\n\n\t\t} finally {\n\t\t\ttry {\n\t\t\t\tdb.close();\n\t\t\t} catch (Exception e) {}\n\t\t}\n\t}", "@Test\n\tpublic void getAllClientOrders() {\n\t\tString email = \"[email protected]\";\n\t\t\n\t\tservice.insertClient(\"devtestuser\", \"test\", email, \"devpass\");\n\t\t\n\t\tint clientId = service.getClient(email).getClient();\n\t\tservice.insertOrder(\"VODAFONE\", \"VOD\", clientId, random.nextInt(200), random.nextInt(1000), \"BUY\");\n\t\tservice.insertOrder(\"Apple\", \"APPL\", clientId, random.nextInt(200), random.nextInt(1000), \"BUY\");\n\t\tservice.insertOrder(\"VODAFONE\", \"VOD\", clientId, random.nextInt(200), random.nextInt(1000), \"BUY\");\n\t\tservice.insertOrder(\"BT Group\", \"BT\", clientId, random.nextInt(200), random.nextInt(1000), \"BUY\");\n\t\t\n\t\tList<OrderDTO> clientOrders = service.getClientOrders(clientId);\n\t\t\n\t\tassertEquals(4, clientOrders.size());\n\t\t\n\t\t\n\t\tfor(OrderDTO orderDTO : clientOrders) {\n\t\t\tservice.deleteOrder(orderDTO.getOrderId());\n\t\t}\n\t\t\n\t\tservice.deleteClient(email);\n\t}", "public ArrayList<Order> getOrders() {\n\n\t\tArrayList<Order> order = new ArrayList<Order>();\n\n\t\tOrder or = null;\n\t\ttry {\n\t\t\tString sql = \"SELECT * FROM restodb.order\";\n\n\t\t\tjava.sql.PreparedStatement statement = mysqlConnect.connect().prepareStatement(sql);\n\n\t\t\tResultSet rs = statement.executeQuery(sql);\n\n\t\t\twhile (rs.next()) {\n\n\t\t\t\tor = new Order(rs.getString(\"idorder\"), rs.getString(\"date\"), rs.getString(\"clientName\"),\n\t\t\t\t\t\trs.getString(\"status\"), rs.getString(\"location_idlocation\"));\n\n\t\t\t\torder.add(or);\n\n\t\t\t}\n\n\t\t} catch (SQLException e) {\n\t\t\te.printStackTrace();\n\t\t} finally {\n\t\t\tmysqlConnect.disconnect();\n\t\t}\n\n\t\treturn order;\n\t}", "public OrderList findOrders(){\n sql=\"SELECT * FROM Order\";\n Order order;\n try{\n ResultSet resultSet = db.SelectDB(sql);\n \n while(resultSet.next()){\n order = new Order();\n order.setOrderID(resultSet.getString(\"OrderID\"));\n order.setCustomerID(resultSet.getString(\"CustomerID\"));\n order.setStatus(resultSet.getString(\"Status\"));\n ordersList.addItem(order);\n }\n }\n catch(SQLException e){\n System.out.println(\"Crash finding all orders\" + e);\n }\n return ordersList;\n }", "public static ArrayList<Orders> selectAllOrders() {\n ArrayList<Orders> toReturn = new ArrayList<Orders>();\n\n Connection dbConnection = ConnectionFactory.getConnection();\n PreparedStatement selectStatement = null;\n ResultSet rs = null;\n try {\n selectStatement = dbConnection.prepareStatement(selectStatementString);\n rs = selectStatement.executeQuery();\n while(rs.next()) {\n\n int order_Id = rs.getInt(\"id\");\n int productID = rs.getInt(\"product_id\");\n int clientID = rs.getInt(\"client_id\");\n double totalPrice = rs.getInt(\"total_price\");\n int quantity = rs.getInt(\"amount\");\n toReturn.add(new Orders(order_Id,productID,clientID,totalPrice,quantity));\n }\n } catch (SQLException e) {\n LOGGER.log(Level.WARNING,\"OrderDAO:selectAllOrders \" + e.getMessage());\n } finally {\n ConnectionFactory.close(rs);\n ConnectionFactory.close(selectStatement);\n ConnectionFactory.close(dbConnection);\n }\n return toReturn;\n }", "public ArrayList<OrderRecord> getOrders() throws SQLException {\r\n ArrayList<OrderRecord> result = new ArrayList<>();\r\n String sqlQuery = \"SELECT * FROM `orders`\";\r\n try {\r\n PreparedStatement p = myConn.prepareStatement(sqlQuery);\r\n \r\n ResultSet rs = p.executeQuery(sqlQuery);\r\n while (rs.next()) {\r\n //table schema\r\n //id, name, tab_num, foodname, beveragename, served, billed, time\r\n \r\n // Customer name, orderid, table, items\r\n OrderRecord newOrder = new OrderRecord();\r\n \r\n newOrder.name = rs.getString(2);\r\n newOrder.id = rs.getInt(1);\r\n newOrder.table = rs.getInt(3);\r\n \r\n newOrder.food = rs.getString(4);\r\n newOrder.beverage = rs.getString(5);\r\n \r\n newOrder.served = (rs.getInt(6) == 1);\r\n newOrder.billed = (rs.getInt(7) == 1);\r\n \r\n result.add(newOrder);\r\n }\r\n } catch (SQLException e) {\r\n System.out.println(\"Could not get orders \" + e.toString());\r\n System.out.println(myStmt);\r\n }\r\n return result;\r\n }", "private ObservableList<Order> getOrders() throws SQLException{\n DBConnect db = DBConnect.getInstance();\n return db.getOrders(selectedCustomer.getCustomer_id());\n }", "@Override\r\n\tpublic List<Order> FindByClient(Client client) {\n\t\treturn null;\r\n\t}", "@Override\n\tpublic List<Order> readAll() {\n\t\ttry (Connection connection = DBUtils.getInstance().getConnection();\n\t\t\t\tStatement statement = connection.createStatement();\n\t\t\t\tResultSet resultSet = statement.executeQuery(\"SELECT * FROM orders\");) {\n\t\t\tList<Order> orderList = new ArrayList<>();\n\t\t\twhile (resultSet.next()) {\n\t\t\t\torderList.add(modelFromResultSet(resultSet));\n\t\t\t}\n\t\t\treturn orderList;\n\t\t} catch (SQLException e) {\n\t\t\tLOGGER.debug(e);\n\t\t\tLOGGER.error(e.getMessage());\n\t\t}\n\t\treturn new ArrayList<>();\n\t}", "@Override\r\n\tpublic List<Order> readAll() {\r\n\t\ttry (Connection connection = JDBCUtils.getInstance().getConnection();\r\n\t\t\t\tStatement statement = connection.createStatement();\r\n\t\t\t\tResultSet resultSet = statement.executeQuery(\"SELECT o.customer_id, oi.order_id, \"\r\n\t\t\t\t\t\t+ \"GROUP_CONCAT(i.item_id, ',', i.name, ',', i.value, ',', oi.quantity SEPARATOR ';') items \"\r\n\t\t\t\t\t\t+ \"FROM orders o \"\r\n\t\t\t\t\t\t+ \"INNER JOIN orders_items oi \"\r\n\t\t\t\t\t\t+ \"ON o.order_id = oi.order_id \"\r\n\t\t\t\t\t\t+ \"INNER JOIN items i \"\r\n\t\t\t\t\t\t+ \"ON oi.item_id = i.item_id \"\r\n\t\t\t\t\t\t+ \"GROUP BY oi.order_id\");) {\r\n\t\t\tList<Order> orders = new ArrayList<>();\r\n\t\t\twhile (resultSet.next()) {\r\n\t\t\t\torders.add(modelFromResultSet(resultSet));\r\n\t\t\t}\r\n\t\t\treturn orders;\r\n\t\t} catch (SQLException e) {\r\n\t\t\tLOGGER.debug(e);\r\n\t\t\tLOGGER.error(e.getMessage());\r\n\t\t}\r\n\t\treturn new ArrayList<>();\r\n\t}", "@Override\n\tpublic List<Orders> queryOrder() throws SQLException {\n\t\tConnection conn = null;\n\t\tPreparedStatement stmt = null;\n\t\tResultSet result = null;\n\t\tList<Orders> messages=null;\n\t\ttry{\n\t\t\tconn = DBCPUtils.getConnection();\n\t\t\tstmt = conn.prepareStatement(\"SELECT * FROM orders\");\n\t\t\tresult = stmt.executeQuery();\n\t\t\tmessages=new ArrayList<Orders>();\n\t\t\twhile (result.next()) {\n\t\t\t\tOrders order=new Orders();\n\t\t\t\torder.setOrderId(result.getInt(1));\n\t\t\t\torder.setOrderName(result.getString(2));\n\t\t\t\torder.setOrderAddress(result.getString(3));\n\t\t\t\torder.setOrderPhone(result.getString(4));\n\t\t\t\torder.setOrderNumber(result.getInt(5));\n\t\t\t\torder.setOrderTime(result.getString(6));\n\t\t\t\torder.setBookName(result.getString(7));\n\t\t\t\torder.setOrderMemo(result.getString(8));\n\t\t\t\tmessages.add(order);\n\t\t\t}\n\t\t} catch (Exception e) {\n\t\t\te.printStackTrace();\n\t\t} finally {\n\t\t\tDBCPUtils.releaseConnection(conn, stmt, result);\n\t\t}\n\t\treturn messages;\n\t\t\n\t\t\n\t}", "Collection<Order> getAll();", "List<Order> getAll();", "private ObservableList<String> fetchOrders(Connection con) throws SQLException {\n log.info(\"Fetch Orders from DB\");\n ObservableList<String> orders = FXCollections.observableArrayList();\n Statement st = con.createStatement();\n ResultSet rs = st.executeQuery(\"SELECT ticketid, orderid, \"\n// + \"DATE_FORMAT(ordertime,'%b %d %Y %h:%i %p') AS ordertime, \"\n + \"qty, \"\n + \"ordertime, \"\n + \"details \"\n + \"FROM orders \"\n + \"ORDER BY ordertime, orderid\");\n\n while (rs.next()) {\n orders.add(rs.getString(\"ticketid\") + \" - \"\n + rs.getString(\"orderid\") + \" - \"\n + rs.getString(\"ordertime\")\n + \" - \" + rs.getString(\"qty\")\n + \" * \" + rs.getString(\"details\"));\n }\n\n log.info(\"Found {} orders\", orders.size());\n return orders;\n }", "List<OrderDto> getOrders();", "public Client[] getClients() {\r\n // Get all the contents from the table clients with columns as keys mapped\r\n // to an ArrayList of\r\n // ordered row values\r\n HashMap<String, ArrayList<String>> clientInfo = getAllTableContents(\"clients\");\r\n // Parse the clients into an ArrayList of Client objects\r\n ArrayList<Client> clients = parseClients(clientInfo);\r\n // Cast to an array of Client and return\r\n Client[] temp = new Client[clients.size()];\r\n return clients.toArray(temp);\r\n }", "private ObservableList<Order> getAllCustomerOrders(int customerId){\r\n ObservableList<Order> customerOrders = null;\r\n try {\r\n OrderDB odb = new OrderDB();\r\n customerOrders = odb.getAllOrders(customerId);\r\n } catch (Exception e){\r\n System.err.println(e.getMessage());\r\n }\r\n return customerOrders;\r\n }", "public ArrayList<Order> getTodaysOrders() {\n\n\t\tArrayList<Order> order = new ArrayList<Order>();\n\n\t\tOrder or = null;\n\n\t\tDate date = new Date();\n\n\t\tTimestamp ts = new Timestamp(date.getTime());\n\t\tSimpleDateFormat formatter = new SimpleDateFormat(\"yyyy-MM-dd\");\n\n\t\ttry {\n\t\t\tString sql = \"SELECT * FROM restodb.order WHERE date >= '\" + formatter.format(ts).substring(0, 10) + \"'\";\n\n\t\t\tjava.sql.PreparedStatement statement = mysqlConnect.connect().prepareStatement(sql);\n\n\t\t\tResultSet rs = statement.executeQuery(sql);\n\n\t\t\twhile (rs.next()) {\n\n\t\t\t\tor = new Order(rs.getString(\"idorder\"), rs.getString(\"date\"), rs.getString(\"clientName\"),\n\t\t\t\t\t\trs.getString(\"status\"), rs.getString(\"location_idlocation\"));\n\n\t\t\t\torder.add(or);\n\n\t\t\t}\n\n\t\t} catch (SQLException e) {\n\t\t\te.printStackTrace();\n\t\t} finally {\n\t\t\tmysqlConnect.disconnect();\n\t\t}\n\n\t\treturn order;\n\t}", "@Override\r\n\tpublic List getOrderList() {\n\t\tList orderList = new ArrayList();\t\r\n\t\tConnection conn = null;\t\t\r\n\t\tStatement stmt = null;\t\t\r\n\t\tResultSet rs = null;\r\n\t\ttry{\r\n Class.forName(\"com.mysql.jdbc.Driver\");\t\t\t\r\n\t\t\tconn = DriverManager.getConnection(\"jdbc:mysql://localhost:3306/gwap\",\"root\",\"\");\t\t\t\r\n\t\t\tstmt = conn.createStatement();\t\t\t\r\n\t\t\trs = stmt.executeQuery(\"select * from orderview\");\r\n\t\t\t\r\n\t\t\twhile(rs.next()){\r\n\t\t\t\tOrderview orderview = new Orderview();\r\n\t\t\t\t\r\n\t\t\t\t\r\n\t\t\t\torderview.setLineid(rs.getString(\"lineid\"));\r\n\t\t\t\torderview.setOrderid(rs.getString(\"orderid\"));\r\n\t\t\t\torderview.setCost(rs.getString(\"cost\"));\r\n\t\t\t\torderview.setName(rs.getString(\"name\"));\r\n\t\t orderview.setPaystyle(rs.getString(\"paystyle\"));\r\n\t\t\t\t\t\t\t\t\t\t\t\t\r\n\t\t\t\torderList.add(orderview);\r\n\t\t\t\t\r\n\t\t\t}\r\n\t\t}\r\n\t\tcatch(Exception ex){\r\n\t\t\r\n ex.printStackTrace();\t\t\t\r\n\t\t\tthrow new RuntimeException(\"error when querying orders \",ex);\r\n\t\t}\r\n\t\tfinally{\r\n\t\t\ttry {\r\n\t\t\t\trs.close();\r\n\t\t\t\tstmt.close();\r\n\t\t\t\tconn.close();\r\n\t\t\t} catch (Exception ex) {\r\n\t\t\t\tex.printStackTrace();\t\t\t\t\r\n\t\t\t\tthrow new RuntimeException(\"error when querying orders \",ex);\r\n\t\t\t}\r\n\t\t\t\r\n\t\t}\r\n\t\treturn orderList;\r\n\t}", "public ArrayList<Cliente> obtClientes(){\n return (ArrayList<Cliente>) clienteRepositori.findAll();\n }", "List<CustomerOrder> getAllCustomerOrder();", "void getOrders();", "public List<String> getAllOrders() {\n\t List<String> orderList = new ArrayList<String>();\n\t // Select All Query\n\t String selectQuery = \"SELECT * FROM \" + ORDER_RECORDS_TABLE;\n\t \n\t SQLiteDatabase db = this.getWritableDatabase();\n\t Cursor cursor = db.rawQuery(selectQuery, null);\n\t \n\t // looping through all rows and adding to list\n\t if (cursor.moveToFirst()) {\n\t do {\n\t \torderList.add(\"Order Number:[\" + cursor.getString(0) + \"] Barcode Number:[\" + cursor.getString(1) + \"] Customer Number:[\" + cursor.getString(2) +\n\t \t\t\t\"] Customer Name:[\" + cursor.getString(3) + \"] Order Date:[\" + cursor.getString(4) + \"]\");\n\t } while (cursor.moveToNext());\n\t }\n\t \n\t // return the list\n\t return orderList;\n\t}", "public List<Client> getAllClient() {\n \tTypedQuery<Client> query = em.createQuery(\n \"SELECT g FROM Client g ORDER BY g.id\", Client.class);\n \treturn query.getResultList();\n }", "public ArrayList<Order> getAllOrders() {\n\t\tArrayList<Order> allOrders = new ArrayList<Order>();\n\n\t\tStatement sql = null;\n\n\t\ttry {\n\t\t\tgetConnection().close();\n\t\t\tsql = getConnection().createStatement();\n\t\t\tResultSet results = sql.executeQuery(\"SELECT id, code, name, quantity FROM orders WHERE 1=1;\");\n\n\t\t\twhile (results.next()) {\n\n\t\t\t\tOrder order = new Order(results.getInt(\"id\"), results.getInt(\"code\"), results.getString(\"name\"),\n\t\t\t\t\t\t0, results.getInt(\"quantity\"));\n\n\t\t\t\tallOrders.add(order);\n\t\t\t}\n\n\t\t\tresults.close();\n\t\t} catch (SQLException e) {\n\t\t\te.printStackTrace();\n\t\t} finally {\n\t\t\tif (sql != null) {\n\t\t\t\ttry {\n\t\t\t\t\tsql.close();\n\t\t\t\t} catch (SQLException e) {\n\t\t\t\t\te.printStackTrace();\n\t\t\t\t}\n\t\t\t}\n\n\t\t}\n\n\t\treturn allOrders;\n\t}", "public List<OrderDetails> fetchOderList(){\n List<OrderDetails> orderDetails = null;\n orderDetails = mongoDbConnector.fetchOderList();\n return orderDetails;\n }", "public List<Order> findAllOrders() throws ApplicationEXContainer.ApplicationCanNotChangeException {\n List<Order> orders;\n try(Connection connection = MySQLDAOFactory.getConnection();\n AutoRollback autoRollback = new AutoRollback(connection)){\n orders =orderDao.findAllOrders(connection);\n autoRollback.commit();\n } catch (SQLException | NamingException | DBException throwables) {\n LOGGER.error(throwables.getMessage());\n throw new ApplicationEXContainer.ApplicationCanNotChangeException(throwables.getMessage(),throwables);\n }\n return orders;\n }", "public List<Cliente> getClientes() {\n\t\ttry {\n\t\t\t\n\t\t\tList<Cliente> clientes = (List<Cliente>) db.findAll();\n\t\t\t\t\t\n\t\t\treturn clientes;\n\t\t\t\n\t\t} catch (Exception e) {\n\t\t\te.printStackTrace();\n\t\t\treturn new ArrayList<Cliente>();\n\n\t\t}\n\t}", "public static List<Order> allOrders() throws LegoHouseException {\n try {\n Connection con = Connector.connection();\n String SQL = \"SELECT * FROM orders\";\n PreparedStatement ps = con.prepareStatement(SQL);\n ResultSet rs = ps.executeQuery();\n if (rs.next()) {\n List<Order> allOrders = new ArrayList();\n do {\n int ordernumber = rs.getInt(1);\n int height = rs.getInt(3);\n int width = rs.getInt(4);\n int length = rs.getInt(5);\n String status = rs.getString(6);\n Order order = new Order(ordernumber, height, length, width, status);\n allOrders.add(order);\n }\n while (rs.next());\n return allOrders;\n }\n else {\n throw new LegoHouseException(\"No orders has been placed in the shop\", \"employeepage\");\n }\n }\n catch (ClassNotFoundException | IllegalAccessException | InstantiationException | SQLException ex) {\n throw new LegoHouseException(ex.getMessage(), \"index\");\n }\n }", "public List<Client> getAllClient();", "public Cliente[] findAll() throws ClienteDaoException;", "public List<Order> getOrderByVendor(Vendor vendor) throws Exception {\n\n\t\tConnection con = null;\n\t\tPreparedStatement stmt = null;\n\t\tResultSet rs = null;\n\t\tString sql = \"select * from ocgr_orders left join ocgr_clients on ocgr_orders.client_id = ocgr_clients.client_id left join ocgr_vendors on ocgr_orders.vendor_id = ocgr_vendors.vendor_id where ocgr_vendors.vendor_id=? ;\";\n\n\t\tDB db = new DB();\n\n\t\tList<Order> orders = new ArrayList<Order>();\n\n\t\ttry {\n\t\t\tdb.open();\n\t\t\tcon = db.getConnection();\n\n\t\t\tstmt = con.prepareStatement(sql);\n\t\t\tstmt.setString(1,vendor.getId() );\n\t\t\trs = stmt.executeQuery();\n\n\t\t\twhile (rs.next()) {\n\n\t\t\tClient client = new Client( rs.getString(\"client_id\"), rs.getString(\"client_password\"), rs.getString(\"client_email\"),\n\t\t\t\t\t\t\t\t\t\trs.getString(\"client_fullname\"), rs.getString(\"client_compName\"), rs.getString(\"client_address\"),\n\t\t\t\t\t\t\t\t\t\trs.getString(\"client_itin\"), rs.getString(\"client_doy\"), rs.getString(\"client_phone\") );\n\n\t\t\torders.add( new Order(rs.getString(\"order_id\"), rs.getTimestamp(\"order_date\"), rs.getBigDecimal(\"order_total\"),\n\t\t\t\t\t\t\t\t\trs.getString(\"order_address\"), rs.getString(\"order_status\"),\n\t\t\t\t\t\t\t\t\trs.getString(\"order_paymentmethod\"), client, vendor ) );\n\t\t\t}\n\t\t\trs.close();\n\t\t\tstmt.close();\n\t\t\tdb.close();\n\n\t\t\treturn orders;\n\n\t\t} catch (Exception e) {\n\t\t\tthrow new Exception(e.getMessage());\n\n\t\t} finally {\n\t\t\ttry {\n\t\t\t\tdb.close();\n\t\t\t} catch (Exception e) {}\n\t\t}\n\t}", "List<Order> findAll();", "public List<Order> getOrders() {\n\t\treturn repo.findAll();\n\t}", "public List<Clientes> read(){\n Connection con = ConectionFactory.getConnection();\n PreparedStatement pst = null;\n ResultSet rs = null;\n \n List<Clientes> cliente = new ArrayList<>();\n \n try {\n pst = con.prepareStatement(\"SELECT * from clientes ORDER BY fantasia\");\n rs = pst.executeQuery();\n \n while (rs.next()) { \n Clientes clientes = new Clientes();\n clientes.setCodigo(rs.getInt(\"codigo\"));\n clientes.setFantasia(rs.getString(\"fantasia\"));\n clientes.setCep(rs.getString(\"cep\"));\n clientes.setUf(rs.getString(\"uf\"));\n clientes.setLogradouro(rs.getString(\"logradouro\"));\n clientes.setNr(rs.getString(\"nr\"));\n clientes.setCidade(rs.getString(\"cidade\"));\n clientes.setBairro(rs.getString(\"bairro\"));\n clientes.setContato(rs.getString(\"contato\"));\n clientes.setEmail(rs.getString(\"email\"));\n clientes.setFixo(rs.getString(\"fixo\"));\n clientes.setCelular(rs.getString(\"celular\"));\n clientes.setObs(rs.getString(\"obs\"));\n cliente.add(clientes); \n }\n } catch (SQLException ex) {\n \n }finally{\n ConectionFactory.closeConnection(con, pst, rs);\n }\n return cliente;\n}", "public abstract List<CustomerOrder> findAll(Iterable<Long> ids);", "public List<Clients> getallClients();", "List<Order> getUserOrderList(int userId) throws ServiceException;", "public List<Order> getOrders() throws AlpacaAPIException {\n Type listType = new TypeToken<List<Order>>() {\n }.getType();\n\n AlpacaRequestBuilder urlBuilder =\n new AlpacaRequestBuilder(apiVersion, baseAccountUrl, AlpacaConstants.ORDERS_ENDPOINT);\n\n HttpResponse<JsonNode> response = alpacaRequest.invokeGet(urlBuilder);\n\n if (response.getStatus() != 200) {\n throw new AlpacaAPIException(response);\n }\n\n return alpacaRequest.getResponseObject(response, listType);\n }", "public List<Order> getOrders() {\n return _orders;\n }", "public List<Subscription> selectClientSubscriptions(int clientId)\n throws DAOException {\n try (PreparedStatement preparedStatement\n = prepareStatementForQuery(SELECT_CLIENT_ORDERS_QUERY,\n clientId)) {\n ResultSet resultSet = preparedStatement.executeQuery();\n List<Subscription> orders = new ArrayList<>();\n\n while (resultSet.next()) {\n Subscription order = buildEntity(resultSet);\n\n orders.add(order);\n }\n return orders;\n } catch (SQLException exception) {\n throw new DAOException(exception.getMessage(), exception);\n }\n }", "@Override\n\tpublic List<Client> getAll() {\n\t\treturn dao.getAll(Client.class);\n\t}", "@Override\n public List<Order> findOrders() {\n return orderRepository.findAll(Sort.by(Sort.Direction.DESC, \"created\")).stream()\n .filter(t -> t.getOrder_state().equals(\"ACTIVE\"))\n .map(mapper::toDomainEntity)\n .collect(toList());\n }", "@Override\n\tpublic List<Orders> queryOrderOfId(int id) throws SQLException {\n\t\tConnection conn = null;\n\t\tPreparedStatement stmt = null;\n\t\tResultSet result = null;\n\t\tList<Orders> messages=null;\n\t\ttry{\n\t\t\tconn = DBCPUtils.getConnection();\n\t\t\tstmt = conn.prepareStatement(\"SELECT * FROM orders WHERE orderId=?\");\n\t\t\tstmt.setInt(1,id);\n\t\t\tresult = stmt.executeQuery();\n\t\t\tmessages=new ArrayList<Orders>();\n\t\t\twhile (result.next()) {\n\t\t\t\tOrders order=new Orders();\n\t\t\t\torder.setOrderId(result.getInt(1));\n\t\t\t\torder.setOrderName(result.getString(2));\n\t\t\t\torder.setOrderAddress(result.getString(3));\n\t\t\t\torder.setOrderPhone(result.getString(4));\n\t\t\t\torder.setOrderNumber(result.getInt(5));\n\t\t\t\torder.setOrderTime(result.getString(6));\n\t\t\t\torder.setBookName(result.getString(7));\n\t\t\t\torder.setOrderMemo(result.getString(8));\n\t\t\t\tmessages.add(order);\n\t\t\t}\n\t\t} catch (Exception e) {\n\t\t\te.printStackTrace();\n\t\t} finally {\n\t\t\tDBCPUtils.releaseConnection(conn, stmt, result);\n\t\t}\n\t\treturn messages;\n\t\t\n\t\t\n\t}", "@Override\n public List<Order> getAllOrders(LocalDate date) throws PersistenceException{\n return new ArrayList<Order>(orders.values());\n }", "List<Order> getAllOrders()\n throws FlooringMasteryPersistenceException;", "public JsonArray getInvertoryOrdersFromDB(JsonObject requestJson) {\r\n\t\tJsonArray orders = new JsonArray();\r\n\t\tString query = \"\";\r\n\t\tStatement stmt = null;\r\n\r\n\t\ttry {\r\n\t\t\tif (DBConnector.conn != null) {\r\n\t\t\t\tquery = \"SELECT * FROM fuel_inventory_orders \"\r\n\t\t\t\t\t\t+ \"WHERE orderStatus = 'SENT_TO_STATION_MANAGER';\";\r\n\t\t\t\tstmt = DBConnector.conn.createStatement();\r\n\t\t\t\tResultSet rs = stmt.executeQuery(query);\r\n\t\t\t\twhile (rs.next()) {\r\n\t\t\t\t\tJsonObject order = new JsonObject();\r\n\t\t\t\t\torder.addProperty(\"orderID\", rs.getString(\"orderID\"));\r\n\t\t\t\t\torder.addProperty(\"fuelType\", rs.getString(\"fuelType\"));\r\n\t\t\t\t\torder.addProperty(\"fuelAmount\", rs.getString(\"fuelAmount\"));\r\n\t\t\t\t\torder.addProperty(\"supplierID\", rs.getString(\"supplierID\"));\r\n\t\t\t\t\torders.add(order);\r\n\t\t\t\t}\r\n\t\t\t} else {\r\n\t\t\t\tSystem.out.println(\"Conn is null\");\r\n\t\t\t}\r\n\r\n\t\t} catch (SQLException e) {\r\n\t\t\te.printStackTrace();\r\n\t\t}\r\n\r\n\t\treturn orders;\r\n\r\n\t}", "List<Order> selectAll(int userid);", "@Override\n\tpublic List<Cliente> readAll() {\n\t\treturn clientedao.readAll();\n\t}", "public List<ClienteEmpresa> obtenerTodosLosClientes() {\n return this.clienteEmpresaFacade.findAll();\n }", "public Order readOrder(Long id)\n {\n Long customerID = null;\n List<Item> orderItems = new ArrayList<>();\n\n String sql = \"SELECT customerID FROM orders WHERE id = \" + id;\n try (Connection connection = DBUtils.getInstance().getConnection();\n Statement statement = connection.createStatement();\n ResultSet resultSet = statement.executeQuery(sql))\n {\n resultSet.next();\n customerID = resultSet.getLong(\"customerID\");\n }\n catch (Exception e)\n {\n LOGGER.debug(e);\n LOGGER.error(e.getMessage());\n }\n\n sql = \"SELECT items.* FROM order_items LEFT JOIN items ON order_items.itemID = items.id WHERE orderID = \" + id;\n try (Connection connection = DBUtils.getInstance().getConnection();\n Statement statement = connection.createStatement();\n ResultSet resultSet = statement.executeQuery(sql))\n {\n while(resultSet.next())\n {\n orderItems.add(modelItemFromResultSet(resultSet));\n }\n }\n catch (Exception e)\n {\n LOGGER.debug(e);\n LOGGER.error(e.getMessage());\n }\n return new Order(id, customerID, orderItems);\n }", "public List<AdminOrderDto> getAllAdminOrderDto() throws ServiceException {\n\t\tList<AdminOrderDto> orderList = new ArrayList<>();\n\t\ttry (DaoCreator daoCreator = new DaoCreator()) {\n\t\t\tOrderDao orderDao = daoCreator.getOrderDao();\n\t\t\torderList = orderDao.getAllOrdersForAdmin();\n\t\t\tCollections.reverse(orderList);\n\t\t\tLOGGER.info(\"Find and return all orders!\");\n\t\t} catch(DaoException|ConnectionException|SQLException e) {\n\t\t throw new ServiceException(\"Can't return all client orders from DB\", e);\n\t\t}\n\t\treturn orderList;\n\t}", "List<Order> getByUser(User user);", "public List<Cliente> consultarClientes();", "public List<Order> getOrders(){\n return this.orders;\n }", "@Override\n public Collection<Order> getOrdersByUserId(String id) {\n Collection<Order> orders = getAll();\n return orders.stream()\n .filter(x -> x.getCustomerId().equals(id))\n .collect(Collectors.toList());\n }", "public List<Order> getAll() {\n\t\treturn orderDao.getAll();\n\t}", "public static com.sybase.collections.GenericList<ru.terralink.mvideo.sap.Orders> findAll()\n {\n return findAll(0, Integer.MAX_VALUE);\n }", "@Override\r\npublic List<Order> getallorders() {\n\treturn productdao.getalloderds();\r\n}", "public List<Client> findAllClient() throws SQLException {\n\t\treturn iDaoClient.findAllClient();\n\t}", "Set<Client> getAllClients();", "@Override\n\tpublic List<Cliente> listarClientes() {\n\t\treturn clienteDao.findAll();\n\t}", "public JSONArray getOrders() throws Exception;", "public List<ClienteDto> recuperaTodos(){\n\t\tList<ClienteDto> clientes = new ArrayList<ClienteDto>();\n\t\tclienteRepository.findAll().forEach(cliente -> clientes.add(ClienteDto.creaDto(cliente)));\n\t\treturn clientes;\n\t}", "@Override\n public List<Order> call() throws Exception {\n String lastName = customer.getLastName();\n String firstName = customer.getFirstName();\n String str = \"http://10.0.2.2:8082/getCustomerOrders?lastName=\" +lastName + \"&firstName=\"+firstName;\n URLConnection urlConn;\n BufferedReader bufferedReader;\n List<Order> orderList = new ArrayList<>();\n\n\n try {\n URL url = new URL(str);\n urlConn = url.openConnection();\n bufferedReader = new BufferedReader(new InputStreamReader(urlConn.getInputStream()));\n\n String line;\n while ((line = bufferedReader.readLine()) != null) {\n\n JSONObject jsonObject = new JSONObject(line);\n Order order = new Order();\n order.setOrderID(jsonObject.getString(\"_id\"));\n order.setLastName(jsonObject.getString(\"lastName\"));\n order.setFirstName(jsonObject.getString(\"firstName\"));\n order.setDate(jsonObject.getString(\"dateOfOrder\"));\n order.setTotal(jsonObject.getDouble(\"Total\"));\n orderList.add(order);\n\n\n }\n\n\n } catch (IOException e) {\n e.printStackTrace();\n }\n\n return orderList;\n }", "public List<Map<String, Object>> getOrder(String id);", "public abstract List<CustomerOrder> findAll();", "private void getOrderFromDatabase() {\r\n Cursor cursor = helper.getOrderMoreDetails(orderId);\r\n cursor.moveToFirst();\r\n try {\r\n JSONObject senderObject = new JSONObject(cursor.getString(0));\r\n sender = senderObject.getString(\"name\");\r\n JSONObject receiverObject = new JSONObject(cursor.getString(1));\r\n receiver = receiverObject.getString(\"name\");\r\n JSONObject departureObject = new JSONObject(cursor.getString(2));\r\n if (departureObject.getString(\"type\").equals(\"SpecifyAddress\"))\r\n departure = departureObject.getString(\"long_name\");\r\n else\r\n departure = departureObject.getString(\"short_name\");\r\n JSONObject destinationObject = new JSONObject(cursor.getString(3));\r\n if (destinationObject.getString(\"type\").equals(\"SpecifyAddress\"))\r\n destination = destinationObject.getString(\"long_name\");\r\n else\r\n destination = destinationObject.getString(\"short_name\");\r\n numberOfGoods = cursor.getInt(4);\r\n orderTime = cursor.getString(5);\r\n state = cursor.getString(6);\r\n JSONArray goodIdArray = new JSONArray(cursor.getString(7));\r\n goodId = new String[goodIdArray.length()];\r\n for (int i = 0; i < goodIdArray.length(); i++) {\r\n goodId[i] = goodIdArray.getString(i);\r\n }\r\n orderType = cursor.getString(8);\r\n } catch (Exception e) {\r\n e.printStackTrace();\r\n }\r\n cursor.close();\r\n }", "public ArrayList<Project> getClients() {\n try {\n ArrayList<Project> clients = new ArrayList<Project>();\n String selectClients = \"SELECT NAME, CLIENT_ID FROM CLIENTS\";\n connection = ConnectionManager.getConnection();\n PreparedStatement ps = connection.prepareStatement(selectClients);\n ResultSet rs = ps.executeQuery();\n while (rs.next()) {\n String client = rs.getString(\"NAME\");\n String clientId = rs.getString(\"CLIENT_ID\");\n Project p = new Project(client, clientId);\n clients.add(p);\n }\n rs.close();\n ps.close();\n return clients;\n } catch (SQLException sqle) {\n sqle.printStackTrace(); // for debugging\n return null;\n }\n }", "public List<Client> findAll() {\n\t\treturn dao.findAll();\n\t}", "public static ArrayList<OrderItems> findAll() {\r\n\t\tOrderItems toReturn = null;\r\n ArrayList<OrderItems> list = new ArrayList<OrderItems>();\r\n\t\tConnection dbConnection = ConnectionFactory.getConnection();\r\n\t\tPreparedStatement findStatement = null;\r\n\t\tResultSet rs = null;\r\n\t\ttry {\r\n\t\t\tfindStatement = dbConnection.prepareStatement(findAllStatementString);\r\n\t\t\trs = findStatement.executeQuery();\r\n\t\t\twhile(rs.next()) {\r\n int orderId = rs.getInt(\"id\");\r\n\t\t\tString name = rs.getString(\"nume\");\r\n\t\t\tString den = rs.getString(\"denumire\");\r\n\t\t\tint cant = rs.getInt(\"cantitate\");\r\n\t\t\ttoReturn = new OrderItems(orderId, name, den, cant);\r\n\t\t\tlist.add(toReturn);\r\n\t\t\t}\r\n\t\t} catch (SQLException e) {\r\n\t\t\tSystem.out.println(\"OrderItemsDAO:findAll \" + e.getMessage());\r\n\t\t} finally {\r\n\t\t\tConnectionFactory.close(rs);\r\n\t\t\tConnectionFactory.close(findStatement);\r\n\t\t\tConnectionFactory.close(dbConnection);\r\n\t\t}\r\n\t\treturn list;\r\n\t}", "List<Client> findAll();", "List<Order> getOpenOrders(OpenOrderRequest orderRequest);", "public static ArrayList<Cliente> getClientes()\n {\n return SimulaDB.getInstance().getClientes();\n }", "public List<Order> getAllUsersOrdersById(long userId);", "public ArrayList<Client> clientList() {\n\t\tint counter = 1; // 일딴 보류\n\t\tConnection conn = null;\n\t\tPreparedStatement pstmt = null;\n\t\tResultSet rs = null;\n\t\tString query = \"select * from client\";\n\t\tArrayList<Client> client = new ArrayList<Client>();\n\t\tClient object = null;\n\t\ttry {\n\t\t\tconn = getConnection();\n\t\t\tpstmt = conn.prepareStatement(query);\n\t\t\trs = pstmt.executeQuery();\n\t\t\twhile (rs.next()) {\n\t\t\t\tobject = new Client();\n\t\t\t\tString cId = rs.getString(\"cId\");\n\t\t\t\tString cPhone = rs.getString(\"cPhone\");\n\t\t\t\tString cName = rs.getString(\"cName\");\n\t\t\t\tint point = rs.getInt(\"cPoint\");\n\t\t\t\tint totalPoint = rs.getInt(\"totalPoint\");\n\n\t\t\t\tobject.setcId(cId);\n\t\t\t\tobject.setcPhone(cPhone);\n\t\t\t\tobject.setcName(cName);\n\t\t\t\tobject.setcPoint(point);\n\t\t\t\tobject.setTotalPoint(totalPoint);\n\n\t\t\t\tclient.add(object);\n\t\t\t}\n\t\t} catch (Exception e) {\n\t\t\te.printStackTrace();\n\t\t}\n\n\t\tfinally {\n\t\t\ttry {\n\t\t\t\tif (conn != null) {\n\t\t\t\t\tconn.close();\n\t\t\t\t}\n\t\t\t\tif (pstmt != null) {\n\t\t\t\t\tpstmt.close();\n\t\t\t\t}\n\t\t\t\tif (rs != null) {\n\t\t\t\t\trs.close();\n\t\t\t\t}\n\t\t\t} catch (Exception e) {\n\t\t\t\te.printStackTrace();\n\t\t\t}\n\t\t}\n\t\treturn client;\n\t}", "public ArrayList<Cliente> listarClientes(){\n ArrayList<Cliente> ls = new ArrayList<Cliente>();\n try{\n\t\tString seleccion = \"SELECT codigo, nit, email, pais, fecharegistro, razonsocial, idioma, categoria FROM clientes\";\n\t\tPreparedStatement ps = con.prepareStatement(seleccion);\n //para marca un punto de referencia en la transacción para hacer un ROLLBACK parcial.\n\t\tResultSet rs = ps.executeQuery();\n\t\tcon.commit();\n\t\twhile(rs.next()){\n Cliente cl = new Cliente();\n cl.setCodigo(rs.getInt(\"codigo\"));\n cl.setNit(rs.getString(\"nit\"));\n cl.setRazonSocial(rs.getString(\"razonsocial\"));\n cl.setCategoria(rs.getString(\"categoria\"));\n cl.setEmail(rs.getString(\"email\"));\n Calendar cal = new GregorianCalendar();\n cal.setTime(rs.getDate(\"fecharegistro\")); \n cl.setFechaRegistro(cal.getTime());\n cl.setIdioma(rs.getString(\"idioma\"));\n cl.setPais(rs.getString(\"pais\"));\n\t\t\tls.add(cl);\n\t\t}\n }catch(Exception e){\n System.out.println(e.getMessage());\n e.printStackTrace();\n } \n return ls;\n\t}", "@Override\n public List<Client> getAllClients(){\n log.trace(\"getAllClients --- method entered\");\n List<Client> result = clientRepository.findAll();\n log.trace(\"getAllClients: result={}\", result);\n return result;\n }", "public List<OrderItem> findAllOrderItems()\n\t{\n\t\tList<OrderItem> list=orderItemDAO.findAll();\n\t\treturn list;\n\t}", "@Override\n\tpublic List<OrderVO> orderList() throws Exception {\n\t\treturn session.selectList(\"orderMapper.orderList\");\n\t}", "@Test\n @Order(6)\n void get_client_2() {\n Client c = service.getClient(client);\n Assertions.assertEquals(client.getId(), c.getId());\n Assertions.assertEquals(client.getName(), c.getName());\n Assertions.assertEquals(client.getAccounts().size(), c.getAccounts().size());\n for(Account i : client.getAccounts()) {\n Account check = c.getAccountById(i.getId());\n Assertions.assertEquals(i.getAmount(), check.getAmount());\n Assertions.assertEquals(i.getClientId(), check.getClientId());\n }\n }", "public List<Result> loadResults(Client client) {\n List<Result> results = null;\n try {\n DataBaseBroker dbb = new DataBaseBroker();\n dbb.loadDriver();\n dbb.establishConnection();\n results = dbb.loadResults(client);\n dbb.commit();\n dbb.closeConnection();\n } catch (Exception ex) {\n Logger.getLogger(GameDBLogic.class.getName()).log(Level.SEVERE, null, ex);\n }\n return results;\n }", "public List<DrinkOrder> getAllDrinkOrder() {\n List<DrinkOrder> drinkOrderList = new ArrayList<>();\n SQLiteDatabase db = this.getReadableDatabase();\n String sqlSelectQuery = \"SELECT * FROM \" + CoffeeShopDatabase.DrinkOrderTable.TABLE_NAME;\n Cursor cursor = db.rawQuery(sqlSelectQuery, null);\n if (cursor.moveToFirst()) {\n do {\n DrinkOrder drinkOrder = new DrinkOrder(\n cursor.getInt(cursor.getColumnIndex(CoffeeShopDatabase.DrinkOrderTable._ID)),\n cursor.getString(cursor.getColumnIndex(CoffeeShopDatabase.DrinkOrderTable.COLUMN_NAME_ORDER_DATE)),\n cursor.getDouble(cursor.getColumnIndex(CoffeeShopDatabase.DrinkOrderTable.COLUMN_NAME_TOTAL_COST))\n );\n drinkOrderList.add(drinkOrder);\n } while (cursor.moveToNext());\n }\n return drinkOrderList;\n }", "@Test\n\tpublic void findAllOrderLines() {\n\t\t// TODO: JUnit - Populate test inputs for operation: findAllOrderLines \n\t\tInteger startResult = 0;\n\t\tInteger maxRows = 0;\n\t\tList<OrderLine> response = null;\n\t\tresponse = service.findAllOrderLines(startResult, maxRows);\n\t\t// TODO: JUnit - Add assertions to test outputs of operation: findAllOrderLines\n\t}", "public List<Payment> retrievePaymentsByClient(Client client) throws DatabaseException {\n\t\ttry {\n\t\t\tthis.startConnection();\n\t\t\tString sql = \"SELECT id_payment FROM purchase WHERE id_client = \"\n\t\t\t\t\t+ returnValueStringBD(String.valueOf(client.getId_client()));\n\t\t\tResultSet rs = command.executeQuery(sql);\n\t\t\tList<String> id_payments = new ArrayList<String>();\n\t\t\twhile (rs.next()) {\n\t\t\t\tString pu = rs.getString(\"id_payment\");\n\t\t\t\tid_payments.add(pu);\n\t\t\t}\n\t\t\tList<Payment> payments = new ArrayList<Payment>();\n\t\t\tfor (String id : id_payments) {\n\t\t\t\tPayment p = this.select(Integer.parseInt(id));\n\t\t\t\tpayments.add(p);\n\t\t\t}\n\t\t\treturn payments;\n\t\t} catch (SQLException e) {\n\t\t\te.printStackTrace();\n\t\t} finally {\n\t\t\tthis.closeConnection();\n\t\t}\n\t\treturn null;\n\t}", "public List<Order> getOrderList(Map map) {\n\t\treturn orderDAO.getOrderList(map);\n\t}", "public void listOrders() {\n\t\tSystem.out.println(\"\\nMostrant tots els orders\");\n\t\tObjectSet<Order> orders = db.query(Order.class);\n\t\torders.stream()\n\t\t\t.peek(System.out::println)\n\t\t\t.flatMap(o -> o.getDetails().stream())\n\t\t\t.forEach(System.out::println);\n\t}", "public ArrayList<Cliente> getClientes() throws SQLException, Exception {\n\t\tArrayList<Cliente> clientes = new ArrayList<Cliente>();\n\n\t\tString sql = String.format(\"SELECT * FROM %1$s.CLIENTE\", USUARIO);\n\n\t\tPreparedStatement prepStmt = conn.prepareStatement(sql);\n\t\trecursos.add(prepStmt);\n\t\tResultSet rs = prepStmt.executeQuery();\n\n\t\twhile (rs.next()) {\n\t\t\tclientes.add(convertResultSetToCliente(rs));\n\t\t}\n\t\treturn clientes;\n\t}", "List<OrderPO> selectAll();", "public List<Order> getOrdersByDate(Date date);", "public static List<IOrder> getOrders() throws JFException {\r\n\t\treturn JForexContext.getEngine().getOrders();\r\n\t}", "public ArrayList<Order> getOrders() {\n return this.listOrder;\n }", "public List<Cliente> getClienteList () {\n\t\t\n\t\tCriteria crit = HibernateUtil.getSession().createCriteria(Cliente.class);\n\t\tList<Cliente> clienteList = crit.list();\n\t\t\n\t\treturn clienteList;\n\t}", "public List<Client> listerTousClients() throws DaoException {\n\t\ttry {\n\t\t\treturn daoClient.findAll();\n\t\t} catch (Exception e) {\n\t\t\tthrow new DaoException(\"ConseillerService.listerTousClients\" + e);\n\t\t}\n\t}", "@Override\n\tpublic List<Cliente> getByIdCliente(long id) {\n\t\t@SuppressWarnings(\"unchecked\")\n\t\tList<Cliente> clients =getCurrentSession().createQuery(\"from Cliente c join fetch c.grupos grupos join fetch grupos.clientes where c.id='\"+id+\"' and c.activo=1\" ).list();\n return clients;\n\t}", "List<OrderDTO> getAllOrdersDTO();", "public List<Cliente> getClientes() {\n List<Cliente> cli = new ArrayList<>();\n\n try {\n BufferedReader br = new BufferedReader(new FileReader(\"src/Archivo/archivo.txt\"));\n String record;\n\n while ((record = br.readLine()) != null) {\n\n StringTokenizer st = new StringTokenizer(record, \",\");\n \n String id = st.nextToken();\n String nombreCliente = st.nextToken();\n String nombreEmpresa = st.nextToken();\n String ciudad = st.nextToken();\n String deuda = st.nextToken();\n String precioVentaSaco = st.nextToken();\n\n Cliente cliente = new Cliente(\n Integer.parseInt(id),\n nombreCliente,\n nombreEmpresa,\n ciudad,\n Float.parseFloat(deuda),\n Float.parseFloat(precioVentaSaco)\n );\n\n cli.add(cliente);\n }\n\n br.close();\n } catch (Exception e) {\n System.err.println(e);\n }\n\n return cli;\n }" ]
[ "0.8141547", "0.7912394", "0.78243726", "0.7735207", "0.7596595", "0.7508965", "0.7503332", "0.73672056", "0.73096526", "0.71593624", "0.7146841", "0.7087098", "0.7028352", "0.7010574", "0.699029", "0.6874941", "0.67575496", "0.67418474", "0.67064947", "0.6686786", "0.6649436", "0.6646316", "0.66442823", "0.66402656", "0.6630688", "0.65815705", "0.6526238", "0.6521865", "0.6487917", "0.6483013", "0.64706886", "0.6444236", "0.6386057", "0.6374893", "0.63531625", "0.6352807", "0.63085175", "0.6305481", "0.6294311", "0.6271981", "0.62450576", "0.6244398", "0.6242006", "0.62414056", "0.62396866", "0.6239556", "0.62327325", "0.62308913", "0.62304395", "0.6217167", "0.6216904", "0.6208909", "0.6201544", "0.61880815", "0.61733353", "0.617185", "0.61637855", "0.61603856", "0.61594516", "0.61303866", "0.61263233", "0.6124571", "0.6120007", "0.6119703", "0.61147267", "0.61116487", "0.6108546", "0.61043406", "0.61029285", "0.6102523", "0.609285", "0.60829866", "0.6082722", "0.6080415", "0.6061473", "0.6053687", "0.6024165", "0.6022802", "0.6015297", "0.6009004", "0.6007525", "0.59976405", "0.5996419", "0.59895146", "0.5986544", "0.5981456", "0.5969391", "0.5965809", "0.5963165", "0.59610873", "0.5956135", "0.5955137", "0.5950571", "0.59463936", "0.59447503", "0.5942443", "0.5934543", "0.59313977", "0.5930363", "0.59218866", "0.5911174" ]
0.0
-1
It allow a customer to update his/her personal information in db.
public String[] updateInfo(Session session) throws RemoteException{ System.out.println("Server model invokes updateInfo() method"); return null; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void update(Customer myCust){\n }", "public void updateCustomer(String name, String dob, String gender, String number, String email, String address, String password, Boolean promo, Integer reward) throws SQLException {\n st.executeUpdate(\"UPDATE IOTBAY.CUSTOMER SET \"\n + \"NAME ='\" + name \n + \"DATEOFBIRTH ='\" + dob \n + \"GENDER ='\" + gender \n + \"CONTACTNUMBER ='\" + number \n + \"BILLINGADDRESS ='\" + address \n + \"PASSWORD ='\" + password \n + \"PROMOTIONALNEWSLETTER ='\" + promo \n + \"', REWARDPOINTS='\" + reward \n + \"' WHERE EMAIL='\" + email + \"'\" );\n\n }", "private void updateCustomer(HttpServletRequest request, HttpServletResponse response) throws IOException {\n int id = Integer.parseInt(request.getParameter(\"id\"));\n String name = request.getParameter(\"name\");\n String phone = request.getParameter(\"phone\");\n String email = request.getParameter(\"email\");\n Customer updateCustomer = new Customer(id, name, phone, email);\n CustomerDao.addCustomer(updateCustomer);\n response.sendRedirect(\"list\");\n\n }", "@Override\n public boolean updateUserPersonalInfo(String text) {\n User tmp = this.getLoggedUser();\n tmp.setPersonal_details(text);\n if(this.setLoggedUser(tmp)) System.out.print(\"done\");\n Connection conn = null;\n Statement stmt = null;\n try \n {\n db_controller.setClass();\n conn = db_controller.getConnection();\n stmt = conn.createStatement();\n String sql;\n \n sql = \"UPDATE user_personal_information set information = + '\" + text + \"' where user_id = \" + this.getLoggedUser().getId();\n \n int result = stmt.executeUpdate(sql);\n \n stmt.close();\n conn.close();\n if(result == 1) return true;\n else return false;\n } \n catch (SQLException ex) { ex.printStackTrace(); return false;} \n catch (ClassNotFoundException ex) { ex.printStackTrace(); return false;} \n \n }", "public int Edituser(Long userid, Long brokerId, String firstname,\r\n\t\tString lastname, String address, String city, String eMail, Long phone,\r\n\t\tLong pincode) throws SQLException {\n\tLong useridd=null;\r\n\trs=DbConnect.getStatement().executeQuery(\"select user_id from customer where login_id=\"+userid+\"\");\r\n\tif(rs.next())\r\n\t{\r\n\t\tuseridd=rs.getLong(1);\r\n\t}\r\n\tint i=DbConnect.getStatement().executeUpdate(\"update customer set address='\"+address+\"',city='\"+city+\"',e_mail='\"+eMail+\"',phone=\"+phone+\",pincode=\"+pincode+\" where user_id=\"+useridd+\"\");\r\n\treturn i;\r\n}", "public void editProfile(String username, String fname, String lname, String email, String phoneno, String newpw) throws SQLException{\n\t if(!isLoggedIn())\n\t throw new IllegalStateException(\"MUST BE LOGGED IN FIRST!\"); \n\t callStmt = con.prepareCall(\" {call team5.customer_updateProfile_Proc(?,?,?,?,?,?,?,?,?)}\");\n\t callStmt.setString(1,phoneno);\n\t callStmt.setString(2,email);\n\t callStmt.setString(3,fname);\n\t callStmt.setString(4,lname);\n\t callStmt.setString(5,\"Y\");\n\t callStmt.setString(6,\"Y\");\n\t callStmt.setString(7,username);\n\t callStmt.setString(8,newpw);\n\t callStmt.setInt(9,this.id);\n\t callStmt.execute();\n\t \n\t callStmt.close();\n\t }", "@Override\n\tpublic void update(Customer customer) {\n\t\t\n\t}", "@Override\n\tpublic void update(Customer customer) {\n\t\t\n\t}", "private void editUser(){\n getDeviceLocation();\n ProxyBuilder.SimpleCallback<User> callback = returnedUser-> responseEdit(returnedUser);\n ServerManager.editUserProfile(userManager,callback);\n }", "void updateCustomerById(Customer customer);", "public void update(Customer customer) {\n\n\t}", "public void updateUser(int uid, String name, String phone, String email, String password, int money, int credit);", "@Override\n\tpublic void updateAccount(String pwd, String field, String company) {\n\t}", "void update(String userName, String password, String userFullname,\r\n\t\tString userSex, int userTel, String role);", "@Override\n\tpublic void saveUserInfo(Customer customer) {\n\t\t\n\t}", "@Override\n\tpublic void update(Customer t) {\n\n\t}", "@Test\n\tpublic void updateCustomer() {\n\t\t// Given\n\t\tString name = \"Leo\";\n\t\tString address = \"Auckland\";\n\t\tString telephoneNumber = \"021123728381\";\n\t\tICustomer customer = customerController.create(name, address, telephoneNumber);\n\t\tname = \"Mark\";\n\t\taddress = \"Auckland\";\n\t\ttelephoneNumber = \"0211616447\";\n\t\tlong id = customer.getId();\n\n\t\t// When\n\t\tICustomer cus = customerController.update(id, name, address, telephoneNumber);\n\n\t\t// Then\n\t\tAssert.assertEquals(name, cus.getName());\n\t\tAssert.assertEquals(address, cus.getAddress());\n\t\tAssert.assertEquals(telephoneNumber, cus.getTelephoneNumber());\n\t\tAssert.assertEquals(id, cus.getId());\n\t}", "void updateAccount();", "public static void updatePersonDetails(int customerId, Database d) {\r\n\r\n\r\n\t\tCustomer oldCustomer = d.getCustomer(customerId);\r\n\t\tCustomer newCustomer = oldCustomer;\r\n\r\n\t\tboolean update = true;\r\n\t\tboolean[] updatecheck = new boolean[6];\r\n\t\tfor (int c = 0; c < 6; c++) {\r\n\r\n\t\t\tupdatecheck[c] = false;\r\n\r\n\t\t}\r\n\r\n\t\twhile (update) {\r\n\r\n\t\t\tSystem.out.println(\"Your current personal details are: \" + oldCustomer.name + \" , \" + oldCustomer.address\r\n\t\t\t\t\t+ \" , \" + oldCustomer.phone + \" , \" + oldCustomer.sex + \" , \" + oldCustomer.dob);\r\n\t\t\tSystem.out.println(\r\n\t\t\t\t\t\"Press a number to change a value: name (1), address (2), phone(3), sex (4), dob(5), pin(6)\");\r\n\t\t\tSystem.out.println(\"To exit the updating sesson press 0.\");\r\n\t\t\tString input = inputScanner.next();\r\n\t\t\tString newvalue = \"\";\r\n\r\n\t\t\t// stops the updating process\r\n\t\t\tif (input.equals(\"0\")) {\r\n\t\t\t\tupdate = false;\r\n\t\t\t\tSystem.out.println(\"Updating stopped, changes are saved.\");\r\n\t\t\t// changes the customers name\r\n\t\t\t} else if (input.equals(\"1\")) {\r\n\t\t\t\tSystem.out.println(\"Insert new value!\");\r\n\t\t\t\twhile (updatecheck[1] == false) {\r\n\t\t\t\t\tnewvalue = (String) inputScanner.next();\r\n\t\t\t\t\tif (newvalue.length() >= 3 && newvalue.length() < 25) {\r\n\t\t\t\t\t\tnewCustomer.name = newvalue;\r\n\t\t\t\t\t\tupdatecheck[0] = true;\r\n\t\t\t\t\t} else {\r\n\t\t\t\t\t\tSystem.out.println(\"Please enter a name between 3 and 25 charakters.\");\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t// changes the customers address\r\n\t\t\t} else if (input.equals(\"2\")) {\r\n\t\t\t\tSystem.out.println(\"Insert new value!\");\r\n\t\t\t\twhile (updatecheck[1] == false) {\r\n\t\t\t\t\tnewvalue = (String) inputScanner.next();\r\n\t\t\t\t\tif (newvalue.length() >= 5 && newvalue.length() < 40) {\r\n\t\t\t\t\t\tnewCustomer.address = newvalue;\r\n\t\t\t\t\t\tupdatecheck[1] = true;\r\n\t\t\t\t\t} else {\r\n\t\t\t\t\t\tSystem.out.println(\"Please enter a name between 5 and 40 charakters.\");\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t// changes the customers phonenumber\t\r\n\t\t\t} else if (input.equals(\"3\")) {\r\n\t\t\t\tSystem.out.println(\"Insert new value!\");\r\n\t\t\t\twhile (updatecheck[2] == false) {\r\n\t\t\t\t\tnewvalue = (String) inputScanner.next();\r\n\t\t\t\t\tif (newvalue.length() >= 9 && newvalue.length() < 20) {\r\n\t\t\t\t\t\tnewCustomer.phone = newvalue;\r\n\t\t\t\t\t\tupdatecheck[2] = true;\r\n\t\t\t\t\t} else {\r\n\t\t\t\t\t\tSystem.out.println(\"Please enter a name between 9 and 20 charakters.\");\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t// changes the customers gender\r\n\t\t\t} else if (input.equals(\"4\")) {\r\n\t\t\t\tSystem.out.println(\"Insert new value!\");\r\n\t\t\t\twhile (updatecheck[3] == false) {\r\n\t\t\t\t\tnewvalue = (String) inputScanner.next();\r\n\t\t\t\t\tif (newvalue.equals(\"male\") || newvalue.equals(\"female\") || newvalue.equals(\"Male\") || newvalue.equals(\"Female\")) {\r\n\t\t\t\t\t\tnewCustomer.sex = newvalue;\r\n\t\t\t\t\t\tupdatecheck[3] = true;\r\n\t\t\t\t\t} else {\r\n\t\t\t\t\t\tSystem.out.println(\"please write if the costumer is a ``male`` or a ``female``\");\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t// changes the customers pin, the old PIN is necessary for updating\r\n\t\t\t} else if (input.equals(\"5\")) {\r\n\t\t\t\tSystem.out.println(\"Insert new value!\");\r\n\t\t\t\tnewvalue = (String) inputScanner.next();\r\n\t\t\t\tnewCustomer.dob = newvalue;\r\n\t\t\t} else if (input.equals(\"6\")) {\r\n\t\t\t\tSystem.out.println(\"Insert new pin!\");\r\n\t\t\t\twhile (updatecheck[5] == false) {\r\n\t\t\t\t\tnewvalue = (String) inputScanner.next();\r\n\t\t\t\t\tif (newvalue.length() >= 0 && newvalue.length() < 5) {\r\n\t\t\t\t\t\tupdatecheck[5] = true;\r\n\t\t\t\t\t} else {\r\n\t\t\t\t\t\tSystem.out.println(\"Please enter a number between 0 and 5.\");\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\tSystem.out.println(\"Repeat new pin!\");\r\n\t\t\t\tString newvalue2 = (String) inputScanner.next();\t\t\t\t\r\n\t\t\t\tif (newvalue.equals(newvalue2)) {\r\n\t\t\t\t\tSystem.out.println(\"Insert old pin!\");\r\n\t\t\t\t\tnewvalue = (String) inputScanner.next();\r\n\t\t\t\t\tif ((oldCustomer.pin).equals(newvalue)) {\r\n\t\t\t\t\t\tnewCustomer.pin = newvalue2;\r\n\t\t\t\t\t} else {\r\n\t\t\t\t\t\tSystem.out.println(\"Old PIN was not correct!\");\r\n\t\t\t\t\t}\r\n\t\t\t\t} else {\r\n\t\t\t\t\tSystem.out.println(\"The PINs did not match!\");\r\n\t\t\t\t}\r\n\t\t\t} \r\n\r\n\t\t\toldCustomer = newCustomer;\r\n\r\n\t\t}\r\n\r\n\t}", "@Override\n\tpublic void updateCustomer(Customer customer) throws Exception{\n\t\tConnection con = pool.getConnection();\n\t\tCustomer custCheck = getCustomer(customer.getId());\n\t\tif(custCheck.getCustName()== null)\n\t\t\treturn;\n\t\t\t//throws Exception no customer found in DB\n\n\t\ttry {\n\t\t\tStatement st = con.createStatement();\n\t\t\tString update = String.format(\"update customer set CUST_NAME=('%s') where id in ('%d')\" +\n\t\t\t\" update customer set PASSWORD=('%s')\"\n\t\t\t\t\t+ \" where id in('%d')\",\n\t\t\t\t\tcustomer.getCustName(),\n\t\t\t\t\tcustomer.getId(),\n\t\t\t\t\tcustomer.getPassword(),\n\t\t\t\t\tcustomer.getId());\n\t\t\t\n\t\t\tst.executeUpdate(update);\n\t\t\tSystem.out.println(\"Customer updated successfully\");\n\t\t} catch (SQLException e) {\n\t\t\tSystem.out.println(e.getMessage() + \"Unable to update A customer, Try Again! \");\n\t\t} finally {\n\t\t\tpool.returnConnection(con);\n\t\t}\n\n\t}", "private void putPersonalInformation() throws SQLException, FileNotFoundException, IOException {\n AdUserPersonalData personal;\n try {\n personal = PersonalDataController.getInstance().getPersonalData(username);\n staff_name = personal.getGbStaffName();\n staff_surname = personal.getGbStaffSurname();\n id_type = \"\"+personal.getGbIdType();\n id_number = personal.getGbIdNumber();\n putProfPic(personal.getGbPhoto());\n phone_number = personal.getGbPhoneNumber();\n mobile_number = personal.getGbMobileNumber();\n email = personal.getGbEmail();\n birthdate = personal.getGbBirthdate();\n gender = \"\"+personal.getGbGender();\n } catch (GB_Exception ex) {\n LOG.error(ex);\n GBMessage.putException(ex);\n }\n }", "public void update(Customer user){\n\t\t\n\t\tString sql = \"UPDATE CUSTOMER SET \" +\n\t\t\t\t\"NAME = ?, Age = ? WHERE CUST_ID = ? \";\n\t\tConnection conn = null;\n\t\t\n\t\ttry {\n\t\t\tconn = dataSource.getConnection();\n\t\t\tPreparedStatement ps = conn.prepareStatement(sql);\n\t\t\tps.setString(1, user.getName());\n\t\t\tps.setInt(2, user.getAge());\n\t\t\tps.setInt(3, user.getCustId());\n\t\t\tps.executeUpdate();\n\t\t\tps.close();\n\t\t\t\n\t\t} catch (SQLException e) {\n\t\t\tthrow new RuntimeException(e);\n\t\t\t\n\t\t} finally {\n\t\t\tif (conn != null) {\n\t\t\t\ttry {\n\t\t\t\t\tconn.close();\n\t\t\t\t} catch (SQLException e) {}\n\t\t\t}\n\t\t}\n\t}", "@Override\n\tpublic void edit(CustomerLogin customerLogin) {\n\t\tCustomerLogin dbcustomerLogin=findCustomerLoginById(customerLogin.getCrn());\n\t\tif(dbcustomerLogin!=null) {\n\t\t\tdbcustomerLogin.setPassword(customerLogin.getPassword());\n\t\t}\n\t\telse\n\t\t\tSystem.out.println(\"Sorry! Customer login Details not found.\");\n\t}", "@Override\n\tpublic void updateInformation(String firstname, String lastname, String email, int id) {\t\t\n\t\ttry {\n\t\t\tString sql = \"update employees set first_name = '\"+firstname+\"', last_name='\"+lastname+\"',email = '\"+email+\"' where employee_id=\"+id; \n\t\t\tConnection connection = DBConnectionUtil.getConnection();\n\t\t\tStatement statement = connection.createStatement();\t\t\n\t\t\tstatement.executeUpdate(sql);\n\t\t} catch (SQLException e) {\n\t\t\te.printStackTrace();\n\t\t}\n\t}", "@Override\r\n\tpublic void saveCustomer(CRMDto theCustomer) {\n\t\t\r\n\t\tSession session = factory.openSession();\r\n\t\tTransaction tx = session.beginTransaction();\r\n\t\tsession.update(theCustomer);\r\n\t\ttx.commit();\r\n\t\t//System.out.println(\"pk update is \" +pk);\r\n\t\t\r\n\t\t\r\n\t}", "public void updateUserDetails() {\n\t\tSystem.out.println(\"Calling updateUserDetails() Method To Update User Record\");\n\t\tuserDAO.updateUser(user);\n\t}", "void updateCustomerDDPay(CustomerDDPay cddp);", "public void update(Customer c){\n Connection conn = ConnectionFactory.getConnection();\n PreparedStatement ppst = null;\n try {\n ppst = conn.prepareCall(\"UPDATE customer SET name = ?, id = ?, phone = ? WHERE customer_key = ?\");\n ppst.setString(1, c.getName());\n ppst.setString(2, c.getId());\n ppst.setString(3, c.getPhone());\n ppst.setInt(4, c.getCustomerKey());\n ppst.executeUpdate();\n System.out.println(\"Updated successfully.\");\n } catch (SQLException e) {\n throw new RuntimeException(\"Update error: \", e);\n } finally {\n ConnectionFactory.closeConnection(conn, ppst);\n }\n }", "public void editTheirProfile() {\n\t\t\n\t}", "@Transactional\n @Override\n public Account updatePersonalInfo(Account account) {\n Account accountFromDb = findAccount();\n\n String firstName = account.getFirstName();\n String lastName = account.getLastName();\n\n if (null != firstName) {\n validate(firstName);\n accountFromDb.setFirstName(firstName);\n }\n\n if (null != lastName) {\n validate(lastName);\n accountFromDb.setLastName(lastName);\n }\n\n return accountRepository.save(accountFromDb);\n }", "public void updateCustomer(String id) {\n\t\t\n\t}", "public void saveOrUpdateProfile(){\n try {\n \n if(PersonalDataController.getInstance().existRegistry(username)){\n PersonalDataController.getInstance().update(username, staff_name, staff_surname, \n Integer.parseInt(id_type), \n id_number, imagePic, phone_number, mobile_number, email, birthdate, \n Integer.parseInt(gender), birthdate);\n }else{\n PersonalDataController.getInstance().create(username, staff_name, staff_surname, \n Integer.parseInt(id_type), \n id_number, imagePic, phone_number, mobile_number, email, birthdate, \n Integer.parseInt(gender));\n }\n } catch (GB_Exception ex) {\n LOG.error(ex);\n GBMessage.putMessage(GBEnvironment.getInstance().getError(32), null);\n }\n GBMessage.putMessage(GBEnvironment.getInstance().getError(33), null);\n }", "public User update(User updatedInfo);", "public User updateUser(User user);", "@Override\r\n\tpublic Customer updateCustomer(Customer customer) {\r\n\t\tOptional<Customer> optionalCustomer = null;\r\n\t\tCustomer customer2 = null;\r\n\t\toptionalCustomer = customerRepository.findById(customer.getUserId());\r\n\t\tif (optionalCustomer.isPresent()) {\r\n\t\t\tcustomer2 = customerRepository.save(customer);\r\n\t\t\treturn customer2;\r\n\t\t} else {\r\n\t\t\tthrow new EntityUpdationException(\"Customer With Id \" + customer.getUserId() + \" does Not Exist.\");\r\n\t\t}\r\n\r\n\t}", "public void UserServiceTest_Edit()\r\n {\r\n User user = new User();\r\n user.setId(\"1234\");\r\n user.setName(\"ABCEdited\");\r\n user.setPassword(\"123edited\");\r\n ArrayList<Role> roles = new ArrayList<>();\r\n roles.add(new Role(\"statio manager\"));\r\n user.setRoles(roles);\r\n \r\n UserService service = new UserService(); \r\n try {\r\n service.updateUser(user);\r\n } catch (SQLException e) {\r\n fail();\r\n System.out.println(e);\r\n }catch (NotFoundException e) {\r\n fail();\r\n System.out.println(e);\r\n }\r\n }", "public void update(User user);", "public CustomerProfileDTO editCustomerProfile(CustomerProfileDTO customerProfileDTO)throws EOTException;", "@Override\r\n\tpublic void updateWx_BindCustomerPassword(Wx_BindCustomer wx_BindCustomer) {\n\t\tshopuserDao.updateWx_BindCustomerPassword(wx_BindCustomer);\r\n\t}", "public Account update(Account user);", "private void editProfile() {\n Log.d(TAG, \"Starting volley request to API\");\n try {\n String authority = String.format(Constants.AUTHORITY,\n Constants.TENANT,\n Constants.EDIT_PROFILE_POLICY);\n\n User currentUser = Helpers.getUserByPolicy(\n sampleApp.getUsers(),\n Constants.EDIT_PROFILE_POLICY);\n\n sampleApp.acquireToken(\n this,\n Constants.SCOPES.split(\"\\\\s+\"),\n currentUser,\n UiBehavior.SELECT_ACCOUNT,\n null,\n null,\n authority,\n getEditPolicyCallback());\n } catch(MsalClientException e) {\n /* No User */\n Log.d(TAG, \"MSAL Exception Generated while getting users: \" + e.toString());\n }\n\n }", "@Override\n\tpublic void update(User objetc) {\n\t\tuserDao.update(objetc);\n\t}", "User editUser(User user);", "int updateByPrimaryKey(AdminUser record);", "int updateByPrimaryKey(AdminUser record);", "@PutMapping(\"/customerupdate\")\n\tpublic void update(@RequestBody Customer theCustomer) {\n\t\t// checking whether the customer exists or not\n\t\tCustomer customerExists = customerServices.findByID(theCustomer.getMobile_number());\n\n\t\tif (customerExists != null) {\n\t\t\tcustomerServices.save(theCustomer);\n\t\t} else {\n\t\t\tthrow new RuntimeException(\"Customer with customer id - \" + theCustomer + \" not exists\");\n\t\t}\n\t}", "private void updateCustomer(Customer customer) {\n List<String> args = Arrays.asList(\n customer.getCustomerName(),\n customer.getAddress(),\n customer.getPostalCode(),\n customer.getPhone(),\n customer.getLastUpdate().toString(),\n customer.getLastUpdatedBy(),\n String.valueOf(customer.getDivisionID()),\n String.valueOf(customer.getCustomerID())\n );\n DatabaseConnection.performUpdate(\n session.getConn(),\n Path.of(Constants.UPDATE_SCRIPT_PATH_BASE + \"UpdateCustomer.sql\"),\n args\n );\n }", "CustomerDto updateCustomer(CustomerDto customerDto);", "@Override\n\t@Transactional\n\tpublic void updateCustomer(Customer customer) {\n\n\t\thibernateTemplate.update(customer);\n\t\tSystem.out.println(\"customer is updated \" + customer);\n\n\t}", "public Customer updateCustomer(@RequestBody Customer theCustomer)\n {\n customerService.save(theCustomer);\n return theCustomer;\n }", "public void updateUser(Person user) {\n\t\t\n\t}", "public static void updateCustomer(int customerID, String name, String address, String firstDivision, String postalCode, String phoneNumber) throws SQLException{\r\n\r\n //connection and prepared statement set up\r\n Connection conn = DBConnection.getConnection();\r\n String insertStatement = \"UPDATE customers SET Customer_Name = ?, Address = ?, Postal_Code = ?, Phone = ?, Last_Update = ?, Last_Updated_By = ?, Division_ID = ? WHERE Customer_ID = ?;\";\r\n DBQuery.setPreparedStatement(conn, insertStatement);\r\n PreparedStatement ps = DBQuery.getPreparedStatement();\r\n int divisionID = getDivisionID(firstDivision);\r\n String userName = DBUsers.getUser();\r\n\r\n ps.setString(1,name);\r\n ps.setString(2, address);\r\n ps.setString(3,postalCode);\r\n ps.setString(4,phoneNumber);\r\n ps.setTimestamp(5, Timestamp.valueOf(LocalDateTime.now()));\r\n ps.setString(6,userName);\r\n ps.setInt(7,divisionID);\r\n ps.setInt(8, customerID);\r\n\r\n ps.execute();\r\n\r\n if(ps.getUpdateCount() > 0) {\r\n System.out.println(ps.getUpdateCount() + \" row(s) effected\");\r\n }\r\n else {\r\n System.out.println(\"no change\");\r\n }\r\n }", "@Override\n\tpublic void updateProfile(CustomerUpdateVO customerVO) {\n\t\tCustomer customer = customerRepository.findById(customerVO.getCid()).get();\n\t\ttry {\n\t\t\tcustomer.setImage(customerVO.getPhoto().getBytes());\n\t\t} catch (IOException e) {\n\t\t\te.printStackTrace();\n\t\t}\n\t\tcustomer.setName(customerVO.getName());\n\t\tcustomer.setMobile(customerVO.getMobile());\n\t\tcustomer.setDom(new Timestamp(new Date().getTime()));\n\t\t/// customerRepository.save(customer);\n\t}", "public void updateStaff(String name, String dob, String email, String number, String address, String password) throws SQLException {\n st.executeUpdate(\"UPDATE IOTBAY.STAFF SET \"\n + \"NAME ='\" + name \n + \"DATEOFBIRTH ='\" + dob \n + \"PHONENUMBER ='\" + number \n + \"ADDRESS ='\" + address \n + \"PASSWORD ='\" + password \n + \"' WHERE EMAIL='\" + email + \"'\" );\n\n }", "public void saveProfileEditData() {\r\n\r\n }", "int updateByPrimaryKey(PasswdDo record);", "public String update() {\r\n\t\tuserService.update(userEdit);\r\n\t\tusers.setWrappedData(userService.list());\r\n\t\treturn \"update\";\r\n\t}", "void update(User user);", "void update(User user);", "void userChangeByAdmin(AdminUserDTO adminUserDTO) throws RecordExistException;", "void update(User user) throws SQLException;", "private static void LessonDAOUpdate() {\n PersonDAO personDAO = new PersonDAOImpl();\n\n Person person = personDAO.getPersonById(7);\n person.setFirstName(\"Teddy\");\n\n if(personDAO.updatePerson(person)) {\n System.out.println(\"Person Update Success!\");\n } else {\n System.out.println(\"Person Update Fail!\");\n }\n }", "@Override\r\n\tpublic void update(CustVO custVO) {\n\t\tConnection con = null;\r\n\t\tPreparedStatement pstmt = null;\r\n\t\ttry {\r\n\t\t\tcon = ds.getConnection();\r\n\t\t\tpstmt = con.prepareStatement(UPDATE);\r\n\r\n\t\t\tpstmt.setString(1, custVO.getCust_acc());\r\n\t\t\tpstmt.setString(2, custVO.getCust_pwd());\r\n\t\t\tpstmt.setString(3, custVO.getCust_name());\r\n\t\t\tpstmt.setString(4, custVO.getCust_sex());\r\n\t\t\tpstmt.setString(5, custVO.getCust_tel());\r\n\t\t\tpstmt.setString(6, custVO.getCust_addr());\r\n\t\t\tpstmt.setString(7, custVO.getCust_pid());\r\n\t\t\tpstmt.setString(8, custVO.getCust_mail());\r\n\t\t\tpstmt.setDate(9, custVO.getCust_brd());\r\n\t\t\tpstmt.setDate(10, custVO.getCust_reg());\r\n\t\t\tpstmt.setBytes(11, custVO.getCust_pic());\r\n\t\t\tpstmt.setString(12, custVO.getCust_status());\r\n\t\t\tpstmt.setString(13, custVO.getCust_niname());\r\n\t\t\tpstmt.setString(14, custVO.getCust_ID());\r\n\r\n\t\t\tpstmt.executeUpdate();\r\n\t\t} catch (SQLException se) {\r\n\t\t\tthrow new RuntimeException(\"A database error occured.\" + se.getMessage());\r\n\t\t} finally {\r\n\t\t\tif (pstmt != null) {\r\n\t\t\t\ttry {\r\n\t\t\t\t\tpstmt.close();\r\n\t\t\t\t} catch (SQLException se) {\r\n\t\t\t\t\tse.printStackTrace(System.err);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tif (con != null) {\r\n\t\t\t\ttry {\r\n\t\t\t\t\tcon.close();\r\n\t\t\t\t} catch (Exception e) {\r\n\t\t\t\t\te.printStackTrace(System.err);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t}", "public int updateCustomer(Customer customer) {\n return model.updateCustomer(customer); \n }", "@Override\n\n public void update(UserInfoVo userInfoVo) {\n\n userDao.update(userInfoVo);\n\n }", "public void update(Customer customer) throws SQLException {\r\n\t\tString updateSql = \"UPDATE \" + tableName\r\n\t\t\t\t+ \" SET name=?,surname=?,birth_date=?,birth_place=?,address=?,city=?,province=?,\"\r\n\t\t\t\t+ \" cap=?,phone_number=?,newsletter=?,email=?\" + \"WHERE (id = ?)\";\r\n\t\ttry {\r\n\t\t\t//connection = ds.getConnection();\r\n\t\t\tpreparedStatement = connection.prepareStatement(updateSql);\r\n\t\t\tpreparedStatement.setString(1, customer.getName());\r\n\t\t\tpreparedStatement.setString(2, customer.getSurname());\r\n\t\t\tpreparedStatement.setDate(3, (Date) customer.getBirthdate());\r\n\t\t\tpreparedStatement.setString(4, customer.getBirthplace());\r\n\t\t\tpreparedStatement.setString(5, customer.getAddress());\r\n\t\t\tpreparedStatement.setString(6, customer.getCity());\r\n\t\t\tpreparedStatement.setString(7, customer.getProvince());\r\n\t\t\tpreparedStatement.setInt(8, customer.getCap());\r\n\t\t\tpreparedStatement.setString(9, customer.getPhoneNumber());\r\n\t\t\tpreparedStatement.setInt(10, customer.getNewsletter());\r\n\t\t\tpreparedStatement.setString(11, customer.getEmail());\r\n\t\t\tpreparedStatement.setInt(12, customer.getId());\r\n\t\t\tpreparedStatement.executeUpdate();\r\n\t\t\tconnection.commit();\r\n\t\t} catch (SQLException e) {\r\n\t\t}\r\n\t}", "public void updateUser() {\n Connection conn = null;\n try {\n conn = DriverManager.getConnection(db.DB.connectionString, db.DB.user, db.DB.password);\n Statement stmt = conn.createStatement();\n String query = \"update users set first_name='\" + firstName + \"', \";\n query += \"last_name='\" + lastName + \"', \";\n query += \"phone_number='\" + phoneNumber + \"', \";\n query += \"email='\" + email + \"', \";\n query += \"address='\" + address + \"', \";\n query += \"id_city='\" + idCity + \"' \";\n query += \"where id_user = \" + id;\n stmt.executeUpdate(query);\n\n User updatedUser = findUser(id);\n updatedUser.setFirstName(firstName);\n updatedUser.setLastName(lastName);\n updatedUser.setPhoneNumber(phoneNumber);\n updatedUser.setEmail(email);\n updatedUser.setIdCity(idCity);\n updatedUser.setAddress(address);\n\n } catch (SQLException ex) {\n Logger.getLogger(UserController.class.getName()).log(Level.SEVERE, null, ex);\n } finally {\n clear();\n try {\n conn.close();\n } catch (Exception e) {\n /* ignored */ }\n }\n }", "public void crudOperationStudent(){\n //Retrieve Student\n Student student=entityManager.find(Student.class,2L);\n // persistence Context have Student\n //Retrieve Passport\n Passport passport=student.getPassport();\n // persistence Context have Student,passport\n //Update passport number for student\n passport.setPassportNo(\"ZX132322\");\n // persistence Context have Student, updated-passport\n //update Student details\n student.setAge(25);\n // persistence Context have updated-Student, updated-passport\n entityManager.persist(student);\n\n }", "public void editUser(User user) {\n\t\t\n\t}", "int updateByPrimaryKey(R_dept_user record);", "@Override\n public void updateCustomer(UUID customerId, @RequestBody Customer customer) {\n log.debug(\"Updating a customer to service...\");\n }", "Account.Update update();", "int updateContact(String email, String firstName, String lastName, String phone, String username);", "@PutMapping(\"/customers\")\n\tpublic Customer updatecustomer(@RequestBody Customer thecustomer) {\n\t\t\n\t\tthecustomerService.saveCustomer(thecustomer); //as received JSON object already has id,the saveorupdate() DAO method will update details of existing customer who has this id\n\t\treturn thecustomer;\n\t}", "void editUser(String uid, User newUser);", "void updateCustomer(int id, String[] updateInfo);", "public void update (int ID, String frist_name, String lastName, String nationality, \n int age, Date commingDate, Date checkOutDate){\n String qury = \"update customer\\n\" +\n \"set First_name = '\"+frist_name+\"', Last_name = '\"+lastName+\"', nationality = '\"+\n nationality+\"', age = \"+age+\", coming_date = '\"\n +commingDate.toInstant().atZone(ZoneId.systemDefault()).toLocalDate().plusDays(2)+\n \"', check_out_date = '\"+checkOutDate.toInstant().atZone(ZoneId.systemDefault()).toLocalDate().plusDays(2)+\"'\\n\" +\n \"where customer_id = \"+ID;\n try {\n statement.executeUpdate(qury);\n }catch (SQLException e)\n {\n e.printStackTrace();\n }finally{\n setQuery(DEFUALT_QUERY);\n }\n }", "public String updateUser(){\n\t\tusersservice.update(usersId, username, password, department, role, post, positionId);\n\t\treturn \"Success\";\n\t}", "int updateByPrimaryKey(RegsatUser record);", "@Override\n\tpublic void updateProfile(patient pupdate) {\n\t\t// TODO Auto-generated method stub\n\t\tString query = \" UPDATE pmohan_patient_details SET firstname = ? , lastname = ? , gender = ? , dob = ?, age =? WHERE pid = ?;\";\n\t\ttry(PreparedStatement statement = connection.prepareStatement(query))\n\t\t{ \n\t\t\t statement.setString(1, pupdate.getFirstname());\n\t\t\t statement.setString(2, pupdate.getLastname());\n\t\t\t statement.setString(3, pupdate.getGender());\n\t\t\t statement.setString(4, pupdate.getDob());\n\t\t\t statement.setInt(5, pupdate.getAge());\n\t\t\t statement.setInt(6, pupdate.getPid());\n\t\t\tstatement.executeUpdate();\n\t\t\t System.out.println(\"update done\");\n\t\t}\n\t\tcatch(Exception e){\n\t\t\tSystem.out.println(\"update problem \" + e);\n\t\t\te.printStackTrace();\n\t\t}\n\n\t}", "int updateAccountInfo(Account account);", "@Override\n public void edit(User user) {\n }", "@Override\n\tpublic boolean updateCustomer(Customer customer) {\n\t\treturn false;\n\t}", "@Transactional\n\t@Modifying(clearAutomatically = true)\n\t@Query(\"UPDATE Users t SET t.lastName =:newLastName WHERE t.id =:currentUser\")\n void editLastName(@Param(\"newLastName\") String newLastName, @Param(\"currentUser\") Integer currentUser);", "@Transactional\n\t@Modifying(clearAutomatically = true)\n\t@Query(\"UPDATE Users t SET t.firstName =:newFirstName WHERE t.id =:currentUser\")\n void editFirstName(@Param(\"newFirstName\") String newFirstName, @Param(\"currentUser\") Integer currentUser);", "@Override\n\tpublic void saveCustomer(Customer theCustomer){\n\t\tSession currentSession = sessionFactory.getCurrentSession();\n\n//\t\tcurrentSession.createQuery(\"from Customer c where c.firstName=\"+ theCustomer.getFirstName()).executeUpdate();\n\n\t\tQuery<Customer> query =\n\t\t\t\tcurrentSession.createQuery(\"select c from Customer c \"+\n\t\t\t\t\t\t\t\t\"where c.firstName =:theCustomerFirstName and \" +\n\t\t\t\t\t\t\t\t\"c.lastName =:theCustomerLastName and \" +\n\t\t\t\t\t\t\t\t\"c.email=:theCustomerEmail\",\n\t\t\t\t\t\t Customer.class);\n\n\t\t// set parameter on query\n\t\tquery.setParameter(\"theCustomerFirstName\", theCustomer.getFirstName());\n\t\tquery.setParameter(\"theCustomerLastName\", theCustomer.getLastName());\n\t\tquery.setParameter(\"theCustomerEmail\", theCustomer.getEmail());\n\n\t\ttry {\n\t\t\t// execute query and get instructor\n\t\t\tCustomer temp = query.getSingleResult();\n\t\t}\n\t\tcatch (Exception exe){\n\t\t\tlogger.log(Level.INFO,\"Already exists!!\");\n\t\t\tcurrentSession.saveOrUpdate(theCustomer);\n\t\t}\n\t}", "@Override\n\tpublic void updateCustomer(Customer customer) throws Exception {\n\t\tgetHibernateTemplate().update(customer);\n\t}", "@Override\n\tpublic void updateUser(User pUser) {\n\t\t\n\t}", "public User update(User user)throws Exception;", "@Override\n\tpublic void updateUser(user theUser) {\n\t}", "@PutMapping(\"/customers\")\n public void updateCustomer(@RequestBody CustomerHibernate theCustomerHibernate) {\n customerService.save(theCustomerHibernate);\n }", "@Override\n\tpublic boolean updateProfile(String name, String address, String dob, String gender, String phone, String email,\n\t\t\t String status, int id) {\n\t\treturn false;\n\t}", "private void updateStudentProfileInfo() {\n\t\t\n\t\tstudent.setLastName(sLastNameTF.getText());\n\t\tstudent.setFirstName(sFirstNameTF.getText());\n\t\tstudent.setSchoolName(sSchoolNameTF.getText());\n\t\t\n\t\t//Update Student profile information in database\n\t\t\n\t}", "public void update(User obj) {\n\t\t\n\t}", "public static void update_TbUser() {\n builder = new Uri.Builder();\n builder.appendQueryParameter(\"username\", Server.owner.get_username());\n builder.appendQueryParameter(\"email\", Server.owner.get_Email());\n builder.appendQueryParameter(\"birthday\", Server.owner.get_Birthday().toString());\n builder.appendQueryParameter(\"gender\", Server.owner.get_gender() ? \"1\" : \"0\");\n builder.appendQueryParameter(\"phone\", Server.owner.get_Phone());\n builder.appendQueryParameter(\"image_source\", Server.owner.get_imageSource());\n builder.appendQueryParameter(\"conversations\", Server.owner.get_AllConversation());\n\n String url = Constant.M_HOST + Constant.M_UPDATE_USER_WITHOUT_PASS;\n String a = uService.execute(builder, url);\n }", "private void updateUser(String Address, String Phone_number,String needy) {\n if (!TextUtils.isEmpty(Address))\n mFirebaseDatabase.child(userId).child(\"name\").setValue(Address);\n\n if (!TextUtils.isEmpty(Phone_number))\n mFirebaseDatabase.child(userId).child(\"email\").setValue(Phone_number);\n\n if (!TextUtils.isEmpty(needy))\n mFirebaseDatabase.child(userId).child(\"email\").setValue(needy);\n }", "public Customer saveCustomerDetails(Customer customer);", "int updateByPrimaryKey(UserInfoUserinfo record);", "int updateByPrimaryKey(Userinfo record);", "@Override\n\t\t\t\tpublic void execute()\n\t\t\t\t{\n\n\t\t\t\t\tMobiculeLogger.verbose(\"execute()\");\n\t\t\t\t\tresponse = updateCustomerFacade.updateCustomerDetails();\n\t\t\t\t}", "@Override\n\tpublic String userInfoSave(Map<String, Object> reqs,\n\t\t\tMap<String, Object> conds) {\n\t\t String result = \"success\";\n\t try {\n\t \tjoaSimpleDao.update(\"tp_users\", reqs, conds);\n\t } catch(Exception exception) {\n\t \texception.printStackTrace();\n\t \tresult = \"failed\";\n\t }\n\t return result;\n\t}" ]
[ "0.71097076", "0.71027094", "0.7070388", "0.7024756", "0.6953242", "0.69285446", "0.68843275", "0.68843275", "0.68684", "0.6867192", "0.68477774", "0.6825174", "0.6815751", "0.6796138", "0.6790545", "0.67255735", "0.6698901", "0.66284823", "0.661643", "0.65984505", "0.6570032", "0.65607816", "0.6559005", "0.65327173", "0.6492195", "0.64660823", "0.6448827", "0.6439743", "0.6438003", "0.64284766", "0.6422311", "0.6411217", "0.64096767", "0.64076215", "0.64035857", "0.63982576", "0.6393738", "0.6393301", "0.6389614", "0.63811445", "0.637978", "0.63788533", "0.6372197", "0.63552994", "0.63552994", "0.63517", "0.63432187", "0.6339169", "0.63348776", "0.63316214", "0.63304865", "0.63246554", "0.6322731", "0.6322717", "0.6314692", "0.6309487", "0.6302997", "0.63013357", "0.63013357", "0.62931067", "0.6287079", "0.62757564", "0.6268742", "0.62676114", "0.6264558", "0.6264068", "0.62573916", "0.62550086", "0.6252873", "0.625258", "0.6243503", "0.62381417", "0.6233897", "0.6233285", "0.62282914", "0.6225126", "0.6224238", "0.6220826", "0.6212159", "0.6209215", "0.62065494", "0.62048143", "0.6202635", "0.61993957", "0.61991554", "0.6198922", "0.61949444", "0.6190417", "0.6188388", "0.61870503", "0.61862737", "0.61835784", "0.6181167", "0.61804605", "0.6170149", "0.6164623", "0.6162981", "0.6160399", "0.61598074", "0.6159524", "0.61564624" ]
0.0
-1
administrator It pulls all selling products information from db, return to the admin a array of product objects.
public String[] browseAdmin(Session session) throws RemoteException{ System.out.println("Server model invokes browseAdmin() method"); return null; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public List<Product> returnProducts() throws FlooringMasteryDaoException {\n\n List<Product> products = dao.loadProductInfo();\n return products;\n\n }", "public List<Product> getProductList(){\n List<Product> productList = mongoDbConnector.getProducts();\n return productList;\n }", "List<Product> getAllProducts() throws DataBaseException;", "@Override\n\tpublic List<Products> getAllProduct() {\n\t\treturn dao.getAllProduct();\n\t}", "public ArrayList<Product> viewAllProduct() throws ProductException{\r\n\t\t\tArrayList<Product> products=new ArrayList<Product>();\r\n\t\t\tif(ProductRepository.productsList.isEmpty()) {\r\n\t\t\t\tthrow new ProductException(\"there are no products in the store\");\r\n\t\t\t\t\r\n\t\t\t}else {\r\n\t\t\t\r\n\t\t\tproducts.addAll(pDoa.viewProductsDoa());\r\n\t\t\t\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\t\r\n\t\t\treturn products;\r\n\t\t\t\r\n\t\t\t\r\n\t\t\t\r\n\t\t\t\r\n\t\t\t\r\n\t\t}", "public List<Product> getAllProducts() {\n List<Product> listProduct= productBean.getAllProducts();\n return listProduct;\n }", "@Override\n\tpublic List<Product> getProducts() {\n\t\treturn productDao.getProducts();\n\t}", "@Override\r\n\tpublic List<Product> getAllProducts() {\n\t\treturn dao.getAllProducts();\r\n\t}", "@Override\r\n\tpublic List<Product> getallProducts() {\n\t\treturn dao.getallProducts();\r\n\t}", "public void showAllProducts() {\n try {\n System.out.println(Constants.DECOR+\"ALL PRODUCTS IN STORE\"+Constants.DECOR_END);\n List<Product> products = productService.getProducts();\n System.out.println(Constants.PRODUCT_HEADER);\n for (Product product : products) { \n System.out.println((product.getName()).concat(\"\\t\\t\").concat(product.getDescription()).concat(\"\\t\\t\")\n .concat(String.valueOf(product.getId()))\n .concat(\"\\t\\t\").concat(product.getSKU()).concat(\"\\t\").concat(String.valueOf(product.getPrice()))\n .concat(\"\\t\").concat(String.valueOf(product.getMaxPrice())).concat(\"\\t\")\n .concat(String.valueOf(product.getStatus()))\n .concat(\"\\t\").concat(product.getCreated()).concat(\"\\t\\t\").concat(product.getModified())\n .concat(\"\\t\\t\").concat(String.valueOf(product.getUser().getUserId())));\n }\n } catch (ProductException ex) {\n System.out.println(ex);\n }\n }", "List<Product> getAllProducts() throws PersistenceException;", "Product getPProducts();", "@Override\r\n\tpublic List<Product> showAll() throws Exception {\n\t\treturn this.dao.showAll();\r\n\t}", "@Override\r\n\tpublic List prodAllseach() {\n\t\treturn adminDAO.seachProdAll();\r\n\t}", "@Override\n\t@Transactional\n\tpublic List<Product> getAllProducts() {\n\t\treturn (List<Product>)productDAO.findAll();\n\t\t\n\t}", "@Override\n\tpublic List<Product> getAllProduct() {\n\t\treturn productRepository.findAll();\n\t}", "@Override\n\tpublic List<Product> getAllProduct() {\n\t\treturn productRepository.findAll();\n\t}", "List<Product> retrieveProducts();", "public List<Product> getAll() {\n\t\treturn productRepository.findAll();\n\n\t}", "public List<Products> getProducts() {\n\t\treturn pdao.getProducts();\r\n\t}", "List<Product> getAllProducts();", "List<Product> getAllProducts();", "List<Product> getAllProducts();", "@GetMapping(\"/getproduct\")\n\t\tpublic List<Product> getAllProduct() {\n\t\t\tlogger.info(\"products displayed\");\n\t\t\treturn productService.getAllProduct();\n\t\t}", "public List<Product> getAllProducts() {\n\t\treturn dao.getAllProducts();\n\t}", "public List<Product> getProducts() {\n\t\treturn productRepository.findAll();\n\t}", "@Override\r\n\tpublic List<Product> findProduct() {\n\t\treturn iImportSalesRecordDao.findProduct();\r\n\t}", "private void getAllProducts() {\n }", "public List<Product> getProducts() {\n Connection connection = null;\n Statement statement = null;\n ResultSet resultSet = null;\n List<Product> products = new ArrayList<>(); //creating an array\n String sql=\"select * from products order by product_id\"; //writing sql statement\n try {\n connection = db.getConnection();\n statement = connection.createStatement();\n resultSet = statement.executeQuery(sql);\n while (resultSet.next()) { //receive data from database\n products.add(new Product( resultSet.getInt(1), resultSet.getString(2), resultSet.getInt(3),\n resultSet.getString(4),resultSet.getString(5),resultSet.getString(6),\n resultSet.getString(7), resultSet.getString(8))); //creating object of product and\n // inserting it into an array\n }\n return products; //return this array\n } catch (SQLException | ClassNotFoundException throwable) {\n throwable.printStackTrace();\n } finally {\n try {\n assert resultSet != null;\n resultSet.close();\n statement.close();\n connection.close();\n } catch (SQLException throwable) {\n throwable.printStackTrace();\n }\n }\n return null;\n }", "public List<Products> getProductsDetails() {\n\t\treturn productsRepo.findAll();\n\t}", "@Override\n public Iterable<Product> findAllProduct() {\n return productRepository.findAll();\n }", "public List<Product> getProducts();", "public List<Product> getProducts();", "@Override\r\n\tpublic List<Product> findAllProducts() {\n\t\treturn productRepository.findAllProducts();\r\n\t}", "public List<Product> getProducts() {\n return products;\n }", "@Override\n\tpublic List<Products> getProducts() {\n\t\tSession currentSession = sessionFactory.getCurrentSession();\n\n\t\t// create a query\n\t\tQuery<Products> theQuery = currentSession.createQuery(\"from Products order by id\", Products.class);\n\n\t\t// execute query and get result list\n\t\tList<Products> products = theQuery.getResultList();\n\n\t\t// return the results\n\t\treturn products;\n\n\t}", "private List<Product> extractProducts() {\r\n\t\t//load products from hidden fields\r\n\t\tif (this.getListProduct() != null){\r\n\t\t\tfor(String p : this.getListProduct()){\r\n\t\t\t\tProduct product = new Product();\r\n\t\t\t\tproduct.setId(Long.valueOf(p));\r\n\t\t\t\tthis.products.add(product);\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\treturn this.products;\r\n\t}", "public List<ProductDto> getProducts() {\n return tradingSystemFacade.getProducts();\n }", "public List<Product> readAll() {\n\t\treturn null;\n\t}", "@Override\r\n\tpublic List<Mobile> showAllProduct() {\n\t\tQuery query=entitymanager.createQuery(\"FROM Mobile\");\r\n\t\tList<Mobile> myProd=query.getResultList();\r\n\t\treturn myProd;\r\n\t}", "@GetMapping(\"/sysadm/product\")\n public String showAllProduct() {\n return \"admin/sysadm/productList\";\n }", "@Override\r\n public List<Product> findAll() {\r\n return productRepository.findAll();\r\n }", "public List<Product> getAllProducts() {\n\t\tSession session = sessionFactory.getCurrentSession();\r\n\t\tQuery query = (Query) session.createQuery(\"from Product\");\r\n\t\tList<Product> products = query.list();\r\n\t\treturn products;\r\n\t}", "List<Product> getProductsList();", "public List<ProductWithSupplierTO> getAllProducts(long storeID) throws NotInDatabaseException;", "public ArrayList<ShowProductLIstBean> showProductlist() {\n\n\t\tArrayList<ShowProductLIstBean> productdetails = new ArrayList<ShowProductLIstBean>();\n\n\t\tString driverClass = \"com.mysql.jdbc.Driver\";\n\t\tString dbUrl = \"jdbc:mysql://localhost:3306/pmsdb\";\n\t\tString dbUser = \"root\";\n\t\tString dbPswd = \"root\";\n\n\t\tConnection con = null;\n\t\tResultSet rs = null;\n\t\tPreparedStatement pstmt = null;\n\n\t\ttry {\n\t\t\tClass.forName(driverClass);\n\t\t\tcon = DriverManager.getConnection(dbUrl, dbUser, dbPswd);\n\n\t\t\tpstmt = con.prepareStatement(\"SELECT * FROM `pms_prd_details`\");\n\t\t\trs = pstmt.executeQuery();\n\n\t\t\tShowProductLIstBean spd = null;\n\t\t\twhile (rs.next()) {\n\n\t\t\t\tspd = new ShowProductLIstBean();\n\t\t\t\tspd.setProductId(rs.getInt(\"producid\"));\n\t\t\t\tspd.setProductName(rs.getString(\"productname\"));\n\t\t\t\tspd.setQuantity(rs.getInt(\"quantity\"));\n\t\t\t\tspd.setPrice(rs.getFloat(\"price\"));\n\t\t\t\tspd.setVname(rs.getString(\"vendorname\"));\n\n\t\t\t\tproductdetails.add(spd);\n\n\t\t\t}\n\n\t\t} catch (SQLException e) {\n\t\t\t// TODO Auto-generated catch block\n\t\t\te.printStackTrace();\n\t\t} catch (ClassNotFoundException e) {\n\t\t\t// TODO Auto-generated catch block\n\n\t\t\te.printStackTrace();\n\t\t} catch (NumberFormatException e) {\n\t\t\t// TODO Auto-generated catch block\n\t\t\te.printStackTrace();\n\t\t} finally {\n\n\t\t\tif (con != null) {\n\t\t\t\ttry {\n\t\t\t\t\tcon.close();\n\t\t\t\t} catch (SQLException e) {\n\t\t\t\t\te.printStackTrace();\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (pstmt != null) {\n\t\t\t\ttry {\n\t\t\t\t\tpstmt.close();\n\t\t\t\t} catch (SQLException e) {\n\t\t\t\t\te.printStackTrace();\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (rs != null) {\n\t\t\t\ttry {\n\t\t\t\t\trs.close();\n\t\t\t\t} catch (SQLException e) {\n\t\t\t\t\te.printStackTrace();\n\t\t\t\t}\n\t\t\t}\n\n\t\t}\n\n\t\treturn productdetails;\n\t}", "@Override\n\tpublic List<Product> getAll() throws SQLException {\n\t\treturn null;\n\t}", "public List<Product> getProductByID() {\n List<Product> listProduct= productBean.getProductByID(productId);\n return listProduct;\n }", "public List<Product> getAll() {\n List<Product> list = new ArrayList<>();\n String selectQuery = \"SELECT * FROM \" + PRODUCT_TABLE;\n SQLiteDatabase database = this.getReadableDatabase();\n try (Cursor cursor = database.rawQuery(selectQuery, null)) {\n if (cursor.moveToFirst()) {\n do {\n int id = cursor.getInt(0);\n String name = cursor.getString(1);\n String url = cursor.getString(2);\n double current = cursor.getDouble(3);\n double change = cursor.getDouble(4);\n String date = cursor.getString(5);\n double initial = cursor.getDouble(6);\n Product item = new Product(name, url, current, change, date, initial, id);\n list.add(item);\n }\n while (cursor.moveToNext());\n }\n }\n return list;\n }", "@Override\r\n\tpublic List<ProductDAO> list() {\n\t\treturn null;\r\n\t}", "private List<ProductView> fetchProducts(String developerId) {\n LOG.debug(\"Enter. developerId: {}.\", developerId);\n\n List<Product> products = productService.getByDeveloperId(developerId);\n\n List<ProductView> result = ProductMapper.toView(products);\n\n List<String> productIds = products.stream().map(Product::getId).collect(Collectors.toList());\n\n Map<String, List<ProductDataView>> productDataViews =\n restClient.getProductData(developerId, productIds);\n\n mergeProductData(result, productDataViews);\n\n cacheApplication.cacheProducts(developerId, result);\n\n LOG.trace(\"Product: {}.\", result);\n LOG.debug(\"Exit. product size: {}.\", result.size());\n\n return result;\n }", "@SuppressWarnings(\"unchecked\")\r\n\t@Override\r\n\tpublic ProductResponseModel getAllProduct() {\n\r\n\t\tProductResponseModel productResponseModel = new ProductResponseModel();\r\n\r\n\t\tMap<String, Object> map = productRepositoryImpl.getAllProduct();\r\n\r\n\t\t// productResponseModel.setCount((long) map.get(\"count\"));\r\n\t\tList<Product> product = (List<Product>) map.get(\"data\");\r\n\t\tList<ProductModel> productList = product.stream().map(p -> new ProductModel(p.getId(), p.getProName(),\r\n\t\t\t\tp.getProPrice(), p.getProQuantity(), p.getProDescription(), p.getProSize()))\r\n\t\t\t\t.collect(Collectors.toList());\r\n\r\n\t\tproductResponseModel.setData(productList);\r\n\r\n\t\treturn productResponseModel;\r\n\t}", "@Override\r\n\tpublic List<ProductMaster> getAllProducts() {\n\t\treturn this.repository.findAll();\r\n\t}", "public List<Product> get() {\r\n return sessionFactory.getCurrentSession()\r\n .createCriteria(Product.class)\r\n .addOrder(Order.asc(\"name\"))\r\n .list();\r\n }", "@Override\n\tpublic List<ProductInfo> getProducts() {\n\t\treturn shoppercnetproducts;\n\t}", "@Override\n\tpublic List<Product> selectAllProduct() {\n\t\treturn productMapper.selectAllProduct();\n\t}", "@NonNull\n public List<Product> findAll() {\n return productRepository.findAll();\n }", "@Override\n public List getAllSharingProduct() {\n \n List sharingProducts = new ArrayList();\n SharingProduct sharingProduct = null;\n Connection connection = null;\n PreparedStatement preparedStatement = null;\n ResultSet result = null;\n try {\n connection = MySQLDAOFactory.createConnection();\n preparedStatement = connection.prepareStatement(Read_All_Query);\n preparedStatement.execute();\n result = preparedStatement.getResultSet();\n \n while (result.next()) {\n sharingProduct = new SharingProduct(result.getString(1), result.getInt(2) );\n sharingProducts.add(sharingProduct);\n }\n } catch (SQLException e) {\n e.printStackTrace();\n } finally {\n try {\n result.close();\n } catch (Exception rse) {\n rse.printStackTrace();\n }\n try {\n preparedStatement.close();\n } catch (Exception sse) {\n sse.printStackTrace();\n }\n try {\n connection.close();\n } catch (Exception cse) {\n cse.printStackTrace();\n }\n }\n \n return sharingProducts;\n }", "@Override\n\tpublic List<Product> getAll() {\n\t\tQuery query = session.createQuery(\"from Product \");\n\t\t\n\t\treturn query.getResultList();\n\t}", "@Override\n\tpublic List<Product> findAll() {\n\t\tConnection conn=null;\n\t\tPreparedStatement pst=null;\n\t\tResultSet rs=null;\n\t\t\n\t\tList<Product> list=new ArrayList<Product>();\n\t\ttry {\n\t\t\tconn=DBUtils.getConnection();\n\t\t\tpst=conn.prepareStatement(\"select id,category_id,name,Subtitle,main_image,sub_images,detail,price,stock,status,create_time,update_time from product\");\n\t\t\t\n\t\t\trs=pst.executeQuery();\n\t\t while(rs.next()) {\n\t\t \t Product product =new Product(rs.getInt(\"id\"),rs.getInt(\"category_id\"),rs.getString(\"name\"),rs.getString(\"Subtitle\"),rs.getString(\"main_image\"),rs.getString(\"sub_images\"),rs.getString(\"detail\"),rs.getBigDecimal(\"price\"),rs.getInt(\"stock\"),rs.getInt(\"status\"),rs.getDate(\"create_time\"),rs.getDate(\"update_time\"));\n\t\t \t list.add(product);\n\t\t \t \n\t\t } \n\t\t\t\n\t\t\t\n\t\t} catch (SQLException e) {\n\t\t\t// TODO Auto-generated catch block\n\t\t\te.printStackTrace();\n\t\t}finally {\n\t\t\ttry {\n\t\t\t\tDBUtils.Close(conn, pst, rs);\n\t\t\t} catch (SQLException e) {\n\t\t\t\t// TODO Auto-generated catch block\n\t\t\t\te.printStackTrace();\n\t\t\t}\n\t\t}\n\t\t\n\t\t\n\t\treturn list;\n\t}", "public List<Product> findAll() {\n\t\treturn repository.findAll();\n\t}", "public List<Product> getFullProductList(){\n\t\t/*\n\t\t * La lista dei prodotti da restituire.\n\t\t */\n\t\tList<Product> productList = new ArrayList<Product>();\n\t\t\n\t\t/*\n\t\t * Preleviamo il contenuto della tabella PRODOTTO.\n\t\t */\n\t\tStatement productStm = null;\n\t\tResultSet productRs = null;\n\t\t\n\t\ttry{\n\t\t\tproductStm = connection.createStatement();\n\t\t\tString sql = \"SELECT * FROM PRODOTTO;\";\n\t\t\tproductRs = productStm.executeQuery(sql);\n\t\t}\n\t\tcatch(SQLException sqle){\n\t\t\tSystem.out.println(\"DB issue: failed to retrive product data from database.\");\n\t\t\tSystem.out.println(sqle.getClass().getName() + \": \" + sqle.getMessage());\n\t\t}\n\t\t\n\t\ttry{\n\t\t\tproductList = this.getProductListFromRs(productRs);\n\t\t\tproductStm.close(); // Chiude anche il ResultSet productRs\n\t\t\tConnector.releaseConnection(connection);\n\t\t}\n\t\tcatch(SQLException sqle){\n\t\t\tSystem.out.println(\"ResultSet issue 2: failed to retrive data from ResultSet.\\n\");\n\t\t\tSystem.out.println(sqle.getClass().getName() + \": \" + sqle.getMessage());\n\t\t}\n\t\t\n\t\treturn productList;\n\t}", "@GetMapping(\"/view-all\")\r\n\tpublic List<ProductDetails> viewAllProducts() {\r\n\r\n\t\treturn productUtil.toProductDetailsList(productService.viewAllProducts());\r\n\t}", "@Override\n\tpublic List<ProductDTO> viewAllProducts() throws ProductException {\n\t\tCollection<Product> products = ProductStore.map.values();\n\t\tList<ProductDTO> list = new ArrayList();\n\n\t\tfor (Product product : products) {\n\t\t\tProductDTO product1 = ProductUtil.convertToProductDto(product);\n\t\t\tlist.add(product1);\n\t\t}\n\n\t\treturn list;\n\t}", "public ArrayList<Product> getProducts(int warehouseNumber) { return db.retrieve_warehouse(warehouseNumber); }", "public List<Product> getProducts() {\n\t\treturn this.products;\n\t}", "public ObservableList<Product> getAllProducts() {\n return allProducts;\n }", "public static List<Admin> getAdmin() {\r\n\t\t//conn = DBConnection.getConnection();\r\n\t\t\r\n\r\n\t\tAdmin admin = null;\r\n\t\tList<Admin> listOfproducts = new ArrayList<Admin>();\r\n\r\n\t\ttry {\r\n\t\t\tStatement statement = conn.createStatement();\r\n\t\t\tResultSet resultSet = statement.executeQuery(getAllQuery);\r\n\t\t\twhile (resultSet.next()) {\r\n\t\t\t\t//User user = new User();\r\n\t\t\t\tint adminId = resultSet.getInt(1);\r\n\t\t\t\tString adminname = resultSet.getString(2);\r\n String adminpassword = resultSet.getString(3);\r\n\r\n\t\t\t\tadmin.setAdminid(adminId);\r\n\t\t\t\tadmin.setAdminname(adminname);\r\n\t\t\t\tadmin.setAdminpassword(adminpassword);\r\n\r\n\t\t\t\tlistOfproducts.add(admin);\r\n\t\t\t}\r\n\r\n\t\t} catch (SQLException e) {\r\n\t\t\t// TODO Auto-generated catch block\r\n\t\t\te.printStackTrace();\r\n\t\t}\r\n\r\n\t\treturn listOfproducts;\r\n\r\n\t}", "public List<Product> getProductByName() {\n \n List<Product> listProduct= productBean.getProductByName(productName);\n return listProduct;\n }", "public com.mozu.api.contracts.productadmin.ProductCollection getProducts() throws Exception\r\n\t{\r\n\t\treturn getProducts( null, null, null, null, null, null, null, null);\r\n\t}", "public List<Product> getProducts(ProductRequest request) throws IOException {\n if (request.isSingle()){\n List<Product> products = new ArrayList<>();\n products.add(parseResult(executeRequest(request),Product.class));\n return products;\n } else {\n return parseResults(executeRequest(request), Product.class);\n }\n }", "@CrossOrigin()\r\n @GetMapping(\"/products/all\")\r\n List<ProductEntity> getAllProducts() {\r\n // TODO add error if there are not enough products\r\n return productRepository.findAll();\r\n }", "public static ObservableList<Product> getAllProducts() {\n return allProducts;\n }", "@GetMapping(path =\"/products\")\n public ResponseEntity<List<Product>> getProducts() {\n return ResponseEntity.ok(productService.getAll());\n }", "private void loadProducts() {\n\t\tproduct1 = new Product();\n\t\tproduct1.setId(1L);\n\t\tproduct1.setName(HP);\n\t\tproduct1.setDescription(HP);\n\t\tproduct1.setPrice(BigDecimal.TEN);\n\n\t\tproduct2 = new Product();\n\t\tproduct2.setId(2L);\n\t\tproduct2.setName(LENOVO);\n\t\tproduct2.setDescription(LENOVO);\n\t\tproduct2.setPrice(new BigDecimal(20));\n\n\t}", "public List<Product> getAllProducts() {\n return new ArrayList<Product>(this.products.values());\n }", "@Override\n\tpublic List<Product> getAllProductByName(String name) {\n\t\treturn productRepository.findByName(name);\n\t}", "public List<Product> findNew() {\n\t\t\treturn productDao.findNew();\n\t\t}", "@RequestMapping(value = \"/displayallproducts\",method=RequestMethod.POST)\r\n\tList<ProductBean> displayAllProducts() throws ProductNotFoundException {\r\n\t\t\r\n\t\t//try {\r\n\t\t\treturn service.displayAllProducts();\r\n\t\t//} catch (ProductNotFoundException e) {\r\n\t\t\t//throw e;\r\n\t\t//}\r\n\t\t\r\n\t}", "@Override\n\tpublic List<Product> getByNew() throws SQLException {\n\t\treturn productDao.getByNew();\n\t}", "@TransactionAttribute(TransactionAttributeType.NOT_SUPPORTED)\n public List<Product> getProductFindAll() {\n return em.createNamedQuery(\"Product.findAll\", Product.class).getResultList();\n }", "@Override\n\tpublic List<Product> getByHot() throws SQLException {\n\t\treturn productDao.getByHot();\n\t}", "@ServiceMethod(name = \"FetchStoreProduct\")\r\n\tpublic IResponseHandler fetchStoreProduct()\r\n\t{\t\r\n\t\tStoreProductOutDTO outDTO = new StoreProductOutDTO();\r\n\t\t\r\n\t\tList<StoreProduct> sps= StoreProductDAO.getInstance(getSession()).readStoresProduct();\r\n\t\t\r\n\t\tfor(StoreProduct sp : sps)\r\n\t\t{\r\n\t\t\tStoreProductDTO dto = new StoreProductDTO();\r\n\t\t\t\r\n\t\t\toutDTO.getStoreProducts().add(dto.assemble(sp));\r\n\t\t}\r\n\t\t\r\n\t\tStoreService storeService = (StoreService)newInstance(new StoreService());\r\n\t\toutDTO.setStores((StoreOutDTO)storeService.fetchStore());\r\n\t\t\r\n\t\tProductService productService = (ProductService)newInstance(new ProductService());\r\n\t\toutDTO.setProducts((ProductOutDTO)productService.fetchProduct());\r\n\t\t\r\n\t\treturn outDTO;\r\n\t}", "public Catalog getCatalogProducts() {\n return catalogProducts;\n }", "@Override\r\n\tpublic List<Product> getProducts() {\n\t\treturn null;\r\n\t}", "public List<ProductDto> getProducts() {\n\t\tString url = URL_BASE + \"/list\";\n\n\t\tResponseEntity<List<ProductDto>> responseEntity = restTemplate.exchange(url, HttpMethod.GET, HttpEntity.EMPTY,\n\t\t\t\tnew ParameterizedTypeReference<List<ProductDto>>() {\n\t\t\t\t});\n\t\tList<ProductDto> playerList = responseEntity.getBody();\n\t\treturn playerList;\n\t}", "@GetMapping(\"/findAllProduct\")\n @ResponseBody\n public ResponseEntity<List<ProductEntity>> findAllProduct() {\n List<ProductEntity> productResponse = productService.viewProduct();\n return new ResponseEntity<>(productResponse, HttpStatus.OK);\n }", "private void printAllProducts()\n {\n manager.printAllProducts();\n }", "public ObservableList<Product> getAllProducts() { return allProducts; }", "public static List<Product> openInventoryDatabase() {\r\n\t\tdbConnect();\r\n\t\tStatement stmt = null;\r\n\t\tResultSet rs = null;\r\n\t\tList<Product> prods = new ArrayList<>();\r\n\t\ttry {\r\n\t\t\tstmt = conn.createStatement();\r\n\t\t\trs = stmt.executeQuery(GET_PRODUCTS_FROM_DB);\r\n\t\t\twhile (rs.next()) {\r\n\t\t\t\tint productCode = rs.getInt(\"product_code\");\r\n\t\t\t\tString productName = rs.getString(\"product_name\");\r\n\t\t\t\tString productUnit = rs.getString(4);\r\n\t\t\t\tString productDescription = rs.getString(5);\r\n\t\t\t\tdouble priceForPurchase = rs.getDouble(6);\r\n\t\t\t\tdouble priceForSales = rs.getDouble(7);\r\n\t\t\t\tint stockQuantity = rs.getInt(8);\r\n\t\t\t\tprods.add(new Product(productCode, productName, productUnit, productDescription, priceForPurchase,\r\n\t\t\t\t\t\tpriceForSales, stockQuantity));\r\n\t\t\t}\r\n\t\t\tstmt.close();\r\n\t\t\trs.close();\r\n\t\t} catch (SQLException e) {\r\n\t\t\te.printStackTrace();\r\n\t\t\treturn null;\r\n\t\t}\r\n\t\t// dbClose();\r\n\t\treturn prods;\r\n\t}", "public List<Product> getAllProducts()\n {\n SQLiteDatabase db = this.database.getWritableDatabase();\n\n // Creates a comma-separated string of all columns in the shopping list table\n String values = TextUtils.join(\", \", ShoppingListTable.COLUMNS);\n\n // Constructs the SQL query\n String sql = String.format(\"SELECT %s FROM %s\", values, ShoppingListTable.TABLE_NAME);\n\n Cursor query = db.rawQuery(sql, null);\n\n Product product = null;\n List<Product> products = new ArrayList<>();\n\n // Check whether there are any products\n if (query.moveToFirst())\n {\n do\n {\n int tpnb = Integer.parseInt(query.getString(0));\n String name = query.getString(1);\n String description = query.getString(2);\n float cost = Float.parseFloat(query.getString(3));\n float quantity = Float.parseFloat(query.getString(4));\n String superDepartment = query.getString(5);\n String department = query.getString(6);\n String imageURL = query.getString(7);\n Boolean isChecked = query.getString(8).equals(\"1\");\n int amount = Integer.parseInt(query.getString(9));\n int position = Integer.parseInt(query.getString(10));\n\n product = new Product(tpnb, name, description, cost, quantity, superDepartment, department, imageURL);\n\n product.setChecked(isChecked);\n product.setAmount(amount);\n product.setPosition(position);\n\n products.add(product);\n }\n while (query.moveToNext());\n }\n\n return products;\n }", "@RequestMapping(value={\"/manageProducts\",\"/Product\"}, method=RequestMethod.GET)\n\tpublic ModelAndView manageProducts()\n\t{\n\t\tModelAndView mv=new ModelAndView(\"admin/Product\");\n\t\tmv.addObject(\"isAdminClickedProducts\",\"true\");\n\t\tmv.addObject(\"product\", new Product());\n\t\tsetData();\n\t\treturn mv;\n\t}", "public List<Product> findAll();", "public Product[] getProductsArray () {\n return null;\n }", "public static ArrayList<Product> getProducts() throws SQLException\n\t{\n\t\tArrayList<Product> listOfProducts = new ArrayList<Product>();\n\t\tresultSet = getResultSet();\n\t\tProduct product = null;\n\t\t\n\t\twhile(resultSet.next())\n\t\t{\n\t\t\tproduct = new Product();\n\n\t\t\tproduct.setProductId(resultSet.getInt(1));\n\t\t\tproduct.setProductName(resultSet.getString(2));\n\t\t\tproduct.setCategoryId(resultSet.getInt(3));\n\t\t\tproduct.setProductTypeId(resultSet.getInt(4));\n\t\t\n\t\t\t\n\t\t\tlistOfProducts.add(product);\n\t\t}//while ends here\n\t\treturn listOfProducts;\n\t}", "@Override\n\t@Transactional(readOnly = true)\n\tpublic List<Producto> findAll() {\n\n\t\treturn (List<Producto>) productoDao.findAll();\n\t}", "@Override\n\t\tpublic List<ProductInfo> getProducts() {\n\t\t\treturn TargetProducts;\n\t\t}", "public ArrayList<Product> getProductList() {\r\n return this.productList;\r\n }", "public ArrayList<ProductClass> getProducts() {\n\t\treturn productsArrList;\n\t}", "@Override\n\tpublic List<Product> getProducts() {\n\t\treturn null;\n\t}", "public List<Product> getProductList() {\n\t\treturn productList;\n\t}" ]
[ "0.76952547", "0.73705184", "0.73365533", "0.7289975", "0.72761726", "0.72563094", "0.7204546", "0.7191915", "0.7174261", "0.7170048", "0.7150367", "0.71406555", "0.71291375", "0.7108644", "0.71081454", "0.71012205", "0.71012205", "0.7067395", "0.70527494", "0.70463705", "0.70315945", "0.70315945", "0.70315945", "0.7020386", "0.7017904", "0.70115805", "0.7004786", "0.69849324", "0.6982116", "0.69116724", "0.6894183", "0.6893568", "0.6893568", "0.6889286", "0.68813413", "0.6855869", "0.68501675", "0.6823559", "0.6818123", "0.6766909", "0.6763368", "0.6750474", "0.6714226", "0.6711792", "0.67020637", "0.66987807", "0.6675918", "0.6671418", "0.66677725", "0.6663536", "0.6663505", "0.6648265", "0.66425556", "0.66235715", "0.6588509", "0.6574629", "0.6569416", "0.6566397", "0.6565822", "0.65535074", "0.6540287", "0.65375143", "0.653261", "0.652792", "0.65262264", "0.65056545", "0.6492368", "0.648859", "0.648272", "0.64605343", "0.64603746", "0.6459443", "0.645862", "0.64521575", "0.64502245", "0.64499044", "0.64209074", "0.6420294", "0.6396582", "0.6393379", "0.6385646", "0.63848263", "0.6366302", "0.6351689", "0.633535", "0.63314295", "0.6328318", "0.6321426", "0.63141865", "0.63100845", "0.63066745", "0.6303005", "0.62681293", "0.6263758", "0.62632906", "0.6261915", "0.6256276", "0.6255074", "0.6242533", "0.62411594", "0.6239673" ]
0.0
-1
It allows the admin to add a product into db.
public String[] addItem(Session session) throws RemoteException{ System.out.println("Server model invokes addItem() method"); return null; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private void addProduct()\n {\n System.out.println(\"|➕| Add new Product:\\n\");\n System.out.println(\"|➕| Enter ID\\n\");\n int id = Integer.parseInt(reader.getInput());\n System.out.println(\"|➕| Enter Name\\n\");\n String name = reader.getInput();\n manager.addProduct(id, name);\n }", "public void addProduct(Product product);", "Product addNewProductInStore(Product newProduct);", "public void insertIntoProduct() {\n\t\ttry {\n\t\t\tPreparedStatement statement = connect.prepareStatement(addProduct);\n\t\t\tstatement.setString(1, productName);\n\t\t\tstatement.setString(2, quantity);\n\t\t\t\n\t\t\tstatement.executeUpdate();\n\t\t} catch (Exception e) {\n\t\t\tSystem.out.println(e.getMessage());\n\t\t}\n\t}", "public void addButtonClicked(){\n Products products = new Products(buckysInput.getText().toString());\n dbHandler.addProduct(products);\n printDatabase();\n }", "public addproduct() {\n\t\tsuper();\n\t}", "public void addProduct() {\n Product result;\n String prodName = getToken(\"Enter product name: \");\n double price = getDouble(\"Enter price per unit: $\");\n result = warehouse.addProduct(prodName, price);\n if (result != null) {\n System.out.println(result);\n }\n else {\n System.out.println(\"Product could not be added.\");\n }\n }", "void addProduct(Product product);", "public void saveNewProduct(Product product) throws BackendException;", "private void addProduct() {\n String type = console.readString(\"type (\\\"Shirt\\\", \\\"Pant\\\" or \\\"Shoes\\\"): \");\n String size = console.readString(\"\\nsize: \");\n int qty = console.readInt(\"\\nQty: \");\n int sku = console.readInt(\"\\nSKU: \");\n Double price = console.readDouble(\"\\nPrice: \");\n int reorderLevel = console.readInt(\"\\nReorder Level: \");\n daoLayer.addProduct(type, size, qty, sku, price, reorderLevel);\n\n }", "public void add(Product product) {\r\n sessionFactory.getCurrentSession()\r\n .save(product);\r\n }", "public void addToDatabaseProduct() {\n // Database credentials\n String pass = \"\";\n\n InputStream passPath = Controller.class.getResourceAsStream(\"/password.txt\");\n if (passPath == null) {\n System.out.println(\"Could not find password in resources folder\");\n }\n\n BufferedReader reader = new BufferedReader(new InputStreamReader(passPath));\n String line = null;\n while (true) {\n try {\n if (!((line = reader.readLine()) != null)) {\n break;\n }\n } catch (IOException e) {\n e.printStackTrace();\n }\n System.out.println(line);\n if (line != null) {\n pass = line;\n System.out.println(\"Password login: \" + line);\n break;\n }\n }\n Connection conn = null; //Temporary\n PreparedStatement stmt = null; //Temporary\n\n try {\n // STEP 1: Register JDBC driver\n Class.forName(\"org.h2.Driver\");\n\n //STEP 2: Open a connection\n conn = DriverManager.getConnection(\"jdbc:h2:./res/HR\", \"\",\n pass);\n\n final String sqlProductName = txtProductName.getText();\n String sqlManufName = txtManufacturer.getText();\n ItemType sqlItemType = choiceType.getValue();\n\n stmt = conn.prepareStatement(\"INSERT INTO Product(type, manufacturer, name) VALUES (?, ?, ?)\",\n Statement.RETURN_GENERATED_KEYS);\n stmt.setString(1, sqlItemType.toString());\n stmt.setString(2, sqlManufName);\n stmt.setString(3, sqlProductName);\n\n stmt.executeUpdate();\n\n stmt.close();\n conn.close();\n } catch (ClassNotFoundException e) {\n e.printStackTrace();\n\n } catch (SQLException e) {\n e.printStackTrace();\n }\n }", "ProductView addProduct(ProductBinding productToAdd) throws ProductException;", "public void Addproduct(Product objproduct) {\n\t\t\n\t}", "@Override\r\n\tpublic void ManageProduct() {\n\t\tint id = this.view.enterId();\r\n\t\tString name = this.view.enterName();\r\n\t\tfloat price = this.view.enterPrice();\r\n\t\tint quantity = this.view.enterQuantity();\r\n\t\t\r\n\t\tthis.model.updProduct(id, name, price, quantity);\r\n\t}", "public void addProduct(Product product){\n // Adding new contact\n SQLiteDatabase db = this.getWritableDatabase();\n\n ContentValues values = new ContentValues();\n values.put(KEY_PRODUCT_NAME, product.getName_product());\n values.put(IS_STRIKE_OUT, product.IsStrikeout());\n values.put(KEY_UUID_PRODUCT_NAME, String.valueOf(product.getId()));\n\n\n // Inserting Row\n db.insert(TABLE_PRODUCTS, null, values);\n Log.d(LOG_TAG_ERROR, \"addProduct OK \" + \" \" + product.getName_product() + \" \" + product.getId());\n\n db.close(); // Closing database connection\n }", "public void addProduct() throws Throwable\r\n\t{\r\n\t\tgoToProductsSection();\r\n\t\tverifyProduct();\r\n\t\tselPproductBtn.click();\r\n\t\twdlib.verify(wdlib.getPageTitle(),flib.getPropKeyValue(PROP_PATH, \"ProductsPage\") , \"Products Page \");\r\n\t\tProductsPage pdpage=new ProductsPage();\r\n\t\tpdpage.selectProducts();\r\n\t}", "@Override\n\tpublic void addProduct(ProductEntity product)\n\t{\n\t\tsave(product);\n\t\tlogger.debug(\"The user added is \" + product.getProductUuid());\n\t}", "public void addButtonClicked(View view) {\n\n Products product = new Products(johnsInput.getText().toString());\n\n dbHandler.addProduct(product);\n printDatabase();\n }", "public void handleAddProducts()\n {\n FXMLLoader fxmlLoader = new FXMLLoader(getClass().getResource(\"/UI/Views/product.fxml\"));\n Parent root = null;\n try {\n root = (Parent) fxmlLoader.load();\n\n // Get controller and configure controller settings\n ProductController productController = fxmlLoader.getController();\n productController.setModifyProducts(false);\n productController.setInventory(inventory);\n productController.setHomeController(this);\n productController.updateParts();\n\n // Spin up product form\n Stage stage = new Stage();\n stage.initModality(Modality.APPLICATION_MODAL);\n stage.initStyle(StageStyle.DECORATED);\n stage.setTitle(\"Add Products\");\n stage.setScene(new Scene(root));\n stage.show();\n\n } catch (IOException e) {\n e.printStackTrace();\n }\n }", "@Override\n\tpublic void addProduct(Product product) throws DataBaseAccessException {\n\t\tLOGGER.debug(\"Inserting a single row into a database table\");\n\t\tLOGGER.info(\"values of product \" + product.getProductId());\n\t\tObject[] insert = new Object[] { product.getProductId(), product.getProductName(),\n\t\t\t\tproduct.getProductCategory() };\n\t\ttry {\n\t\t\tjdbcTemplate.update(INSERT_PRODUCT, insert);\n\t\t} catch (DataAccessException e) {\n\t\t\tthrow new DataBaseAccessException(\"unable to do the transaction \" + e);\n\t\t}\n\t}", "Product addOneProduct(String name, String imgNameBarcode, String imgName, String barcode) throws Exception;", "public void addProduct(Product product) {\n entityManager.persist(product);\n }", "x0401.oecdStandardAuditFileTaxPT1.ProductDocument.Product addNewProduct();", "Product storeProduct(Product product);", "public void add(Product product) {\n SQLiteDatabase database = this.getWritableDatabase();\n ContentValues values = new ContentValues();\n values.put(KEY_NAME, product.getName());\n values.put(KEY_URL, product.getURL());\n values.put(KEY_CURRENT, product.getCurrentPrice());\n values.put(KEY_CHANGE, product.getChange());\n values.put(KEY_DATE, product.getDate());\n values.put(KEY_INITIAL, product.getInitialPrice());\n long id = database.insert(PRODUCT_TABLE, null, values);\n product.setId((int) id);\n database.close();\n }", "public void btnAddClicked(View view){\n List list = new List(input.getText().toString());\n dbHandler.addProduct(list);\n printDatabase();\n }", "public void addProduct(Product p) {\n c.addProduct(p);\n }", "@Override\n\tpublic void add(Product p) {\n\t\tproductRepository.save(p);\n\t}", "@RequestMapping(value = {\"/add_product\"}, method = RequestMethod.POST)\n public String createProduct(Model model, HttpServletRequest request) {\n boolean isSuccess = addProductByRest(request);\n if (isSuccess) {\n ProductController controller = new ProductController();\n List<Product> productList = controller.getProductList(request, \"products\");\n model.addAttribute(\"products\", productList);\n return \"product_list\";\n } else {\n return \"product_detail_new\";\n }\n }", "@FXML\n\t private void insertProduct (ActionEvent actionEvent) throws SQLException, ClassNotFoundException {\n\t try {\n\t ProductDAO.insertProd(denumireText.getText(),producatorText.getText(),pretText.getText(),marimeText.getText(),culoareText.getText());\n\t resultArea.setText(\"Product inserted! \\n\");\n\t } catch (SQLException e) {\n\t resultArea.setText(\"Problem occurred while inserting product \" + e);\n\t throw e;\n\t }\n\t }", "public void insert(Product product) {\n this.products.add(product);\n }", "public void addProduct(Product product)\n {\n SQLiteDatabase db = this.database.getWritableDatabase();\n\n ContentValues values = new ContentValues();\n\n values.put(ShoppingListTable.KEY_TPNB, product.getTPNB());\n values.put(ShoppingListTable.KEY_NAME, product.getName());\n values.put(ShoppingListTable.KEY_DESCRIPTION, product.getDescription());\n values.put(ShoppingListTable.KEY_COST, product.getCost());\n values.put(ShoppingListTable.KEY_QUANTITY, product.getQuantity());\n values.put(ShoppingListTable.KEY_SUPER_DEPARTMENT, product.getSuperDepartment());\n values.put(ShoppingListTable.KEY_DEPARTMENT, product.getDepartment());\n values.put(ShoppingListTable.KEY_IMAGE_URL, product.getImageURL());\n values.put(ShoppingListTable.KEY_CHECKED, product.isChecked());\n values.put(ShoppingListTable.KEY_AMOUNT, product.getAmount());\n values.put(ShoppingListTable.KEY_POSITION, product.getAmount());\n\n db.insert(ShoppingListTable.TABLE_NAME, null, values);\n\n db.close();\n }", "@Override\r\n\tpublic boolean addProduct(ProductDAO product) {\n\t\treturn false;\r\n\t}", "@PostMapping(\"/add\")\r\n\tpublic ProductDetails addProduct(@Valid @RequestBody AddProduct request) {\r\n\r\n\t\tProduct product = productUtil.getProduct();\r\n\t\tproduct.setProduct_Id(productUtil.generateId());\r\n\t\tproduct.setProduct_Name(request.getProduct_Name());\r\n\t\tproduct.setProduct_Price(request.getProduct_Price());\r\n\t\tproduct.setProduct_Quantity(request.getProduct_Quantity());\r\n\t\tproduct.setProduct_Availability(request.isProduct_Availability());\r\n\t\tproduct = productService.addProduct(product);\r\n\t\treturn productUtil.toProductDetails(product);\r\n\r\n\t}", "public void agregar(Producto producto) throws BusinessErrorHelper;", "@Override\r\n\tpublic boolean addProduct(Product product) {\n\t\treturn dao.addProduct(product);\r\n\t}", "public void saveProduct(Product product);", "public AdmAddProduct() {\n initComponents();\n }", "@FXML\n\tpublic void createProduct(ActionEvent event) {\n\t\tif (!txtProductName.getText().equals(\"\") && !txtProductPrice.getText().equals(\"\")\n\t\t\t\t&& ComboSize.getValue() != null && ComboType.getValue() != null && selectedIngredients.size() != 0) {\n\n\t\t\tProduct objProduct = new Product(txtProductName.getText(), ComboSize.getValue(), txtProductPrice.getText(),\n\t\t\t\t\tComboType.getValue(), selectedIngredients);\n\n\t\t\ttry {\n\t\t\t\trestaurant.addProduct(objProduct, empleadoUsername);\n\n\t\t\t\ttxtProductName.setText(null);\n\t\t\t\ttxtProductPrice.setText(null);\n\t\t\t\tComboSize.setValue(null);\n\t\t\t\tComboType.setValue(null);\n\t\t\t\tChoiceIngredients.setValue(null);\n\t\t\t\tselectedIngredients.clear();\n\t\t\t\tproductOptions.clear();\n\t\t\t\tproductOptions.addAll(restaurant.getStringReferencedIdsProducts());\n\n\t\t\t} catch (IOException e) {\n\t\t\t\te.printStackTrace();\n\t\t\t}\n\n\t\t} else {\n\t\t\tDialog<String> dialog = createDialog();\n\t\t\tdialog.setContentText(\"Todos los campos deben de ser llenados\");\n\t\t\tdialog.setTitle(\"Error al guardar los datos\");\n\t\t\tdialog.show();\n\t\t}\n\n\t}", "private void writeNewProduct(Product product) {\n database.child(\"user-groceries\").child(LoginRepository.activeUserId()).child(product.name).setValue(product);\n }", "public void addProduct(Product product) {\n\t\tSystem.out.println(\"Before inserting product \" + product.getProductID());\n\t\tsessionFactory.getCurrentSession().saveOrUpdate(product);// permanently store the product object in database,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// session.sav\n\t\tSystem.out.println(\"After inserting product \" + product.getProductID());\n\n\t}", "@Override\n\tpublic void addProduct(Product product) throws ProductNotFoundException {\n\t\tif (productRepository.findByName(product.getName()) == null){\n\t\t\tproductRepository.addProduct(product);\n\t\t}\n\n\t}", "public void addProduct(Product pProduct)\n\t{\n\t\tmyProductInventory.add(pProduct);\n\n\n\t}", "@Override\n\tpublic void insertProduct(ProductVO dto) {\n\n\t}", "public void addProduct(Product product) {\n allProducts.add(product);\n }", "@PostMapping(\"/addproduct\")\n\t\tpublic ResponseEntity<List<Product>> insertProduct(@RequestBody Product product) {\n\t\t\tlogger.info(\"product inserted\");\n\t\t\tList<Product> sq = productService.saveProduct(product);\n\n\t\t\treturn new ResponseEntity<List<Product>>(sq, HttpStatus.OK);\n\t\t}", "@RequestMapping(method = RequestMethod.POST)\n\t@PreAuthorize(\"hasRole('ADMIN')\")\n\tpublic String addProduct(@Valid @ModelAttribute Product product, BindingResult errors) {\n\t\tif(errors.hasErrors()) {\t\t\t\n\t\t\treturn \"products/newProduct\";\n\t\t}\n\t\t\n\t\t//Set Producty Identity\n\t\tString productIdentity = product.getProductName().replaceAll(\" \", \"_\");\n\t\tproduct.setProductIdentity(productIdentity);\n\t\t\n\t\t//Set CUSTOM to true\n\t\tproduct.setCustom(true);\n\t\t\n\t\tproductDao.addEntity(product);\n\t\tlogger.info(\"Product [\"+product.getProductName()+\"] created!\");\n\t return \"redirect:/products\";\n\t}", "public static void addProduct(Product product){\r\n \r\n System.out.println(\"Adding Product \" + product.getProductName());\r\n productInvMap.put(productInvMap.size(),product);\r\n }", "@FXML void but_AddProduct(ActionEvent event) {\n\n productLine.add(new Widget(txtProductName.getText(), txtManufacturer.getText(),\n choiceType.getValue())); //Adding test product in observable list\n\n productTable.setItems(productLine); //Adds product to table\n listProduce.setItems(productLine); //Adds product to produce list\n\n addToDatabaseProduct();\n\n System.out.println(\"Product added\");\n }", "public void addProduct(Product newProduct) {\n System.out.println(\"addProduct(): \" + newProduct.getName());\n allProducts.add(newProduct);\n }", "public static void addProducts(Product product) throws SQLException\n\t{\n\t\tpreparedStatement = connection.prepareStatement(addQuery);\n//\t\tpreparedStatement.setInt(1, product.getProductId());\n\t\tpreparedStatement.setString(1, product.getProductName());\n\t\tpreparedStatement.setInt(2, product.getCategoryId());\n\t\tpreparedStatement.setInt(3, product.getProductTypeId());\n\t\t\n\t\tpreparedStatement.executeUpdate();\n\t}", "void saveProduct(Product product);", "Product editProduct(Product product);", "@Override\r\n\tpublic int add(Product product) throws Exception {\n\t\treturn this.dao.add(product);\r\n\t}", "@ModelAttribute(\"product\")\n public Product productToAdd() {\n return new Product();\n }", "@Override\r\n\tpublic int insertProduct(Product product) {\n\t\treturn dao.insertProduct(product);\r\n\t}", "public void onAddButtonClick(View view) {\n\n if (view.getId() == R.id.Badd) {\n\n EditText a = (EditText) findViewById(R.id.TFenterName);\n\n String b = a.getText().toString();\n product.setProductName(b);\n\n a = (EditText) findViewById(R.id.TFenterPrice);\n b = a.getText().toString();\n product.setPrice(b);\n\n a = (EditText) findViewById(R.id.TFenterQuantity);\n b = a.getText().toString();\n product.setQuantity(b);\n\n a = (EditText) findViewById(R.id.TFLocation);\n b = a.getText().toString();\n product.setLocation(b);\n\n a = (EditText) findViewById(R.id.TFExpiration);\n b = a.getText().toString();\n product.setExpiration(b);\n\n helper.insertProduct(product);\n\n Intent i = new Intent(AddProduct.this, WasAdded.class);\n i.putExtra(\"product\", product.getProductName());\n startActivity(i);\n\n }\n }", "@Override\n\tpublic int addproduct(Product product) {\n\t\tConnection conn=null;\n\t\tPreparedStatement pst=null;\n\t\t\n\t\ttry {\n\t\t\tconn=DBUtils.getConnection();\n\t\t\tpst=conn.prepareStatement(\"insert into product(category_id,name,Subtitle,main_image,sub_images,detail,price,stock,status,create_time,update_time ) values(?,?,?,?,?,?,?,?,?,?,?)\");\n\t\n\t\t\t\n\t\t\t pst.setInt(1, product.getCategory_id());\n\t\t\t pst.setString(2, product.getName());\n\t\t\t pst.setString(3, product.getSubtitle());\n\t\t\t pst.setString(4, product.getMain_image());\n\t\t\t pst.setString(5, product.getSub_images());\n\t\t\t pst.setString(6, product.getDetail());\n\t\t\t pst.setBigDecimal(7, product.getPrice());\n\t\t\t pst.setInt(8, product.getStock());\n\t\t\t pst.setInt(9, product.getStatus());\n\t\t\t pst.setDate(10, new Date(product.getCreate_time().getTime()));\n\t\t\t pst.setDate(11, new Date(product.getUpdate_time().getTime()));\n\t\n\t\t\treturn pst.executeUpdate();\n\t\t\t\n\t\t} catch (SQLException e) {\n\t\t\t// TODO Auto-generated catch block\n\t\t\te.printStackTrace();\n\t\t}finally {\n\t\t\ttry {\n\t\t\t\tDBUtils.Close(conn, pst);\n\t\t\t} catch (SQLException e) {\n\t\t\t\t// TODO Auto-generated catch block\n\t\t\t\te.printStackTrace();\n\t\t\t}\n\t\t}\n\t\treturn 0;\n\t\t\n\t\t\n\t\t\n\t\n\t}", "@Override\r\n\tpublic ProductMaster addNewProduct(ProductMaster product) {\n\t\treturn this.repository.save(product);\r\n\t}", "@Override\n\t@Transactional\n\tpublic String addProduct(Inventory product) {\n\t\treturn null;\n\t}", "@Override\n\tpublic void insert(Product product) {\n\t\tTransaction txTransaction = session.beginTransaction();\n\t\tsession.save(product);\n\t\ttxTransaction.commit();\n\t\tSystem.out.println(\"Product Inserted\");\n\t\t\n\t\t\n\t}", "public void addNewProduct(String name, String metaTag, String model, double price, String category) {\r\n\t\t\r\n\t\t//clicking on add button\r\n\t\tthis.addNewBtn.click();\r\n\t\t\r\n\t\t//entering the name of product in the category name field\r\n\t\tthis.productName.sendKeys(name);\r\n\t\t\r\n\t\t//entering meta tag title for the product\r\n\t\tthis.metaTag.sendKeys(metaTag);\r\n\t\t\r\n\t\t//going to model tab\r\n\t\tthis.dataTabBtn.click();\r\n\t\t\r\n\t\t//entering model no\r\n\t\tthis.modelField.sendKeys(model);\r\n\t\t\r\n\t\t//entering price\r\n\t\tthis.priceField.sendKeys(String.valueOf(price));\r\n\t\t\r\n\t\t//going to links tab\r\n\t\tthis.linksTabBtn.click();\r\n\t\t\r\n\t\t//entering categories\r\n\t\tthis.categoriesField.sendKeys(category);\r\n\t\t\r\n\t\t//clicking on save button\r\n\t\tthis.saveBtn.click();\t\t\r\n\t}", "@Override\r\n\tpublic ResponseData addProduct(ProductModel productModel) {\n\t\tProduct product = (Product) productConverter.convert(productModel);\r\n\t\tlong i = productRepositoryImpl.addProduct(product).getId();\r\n\t\tif (i > 0) {\r\n\t\t\treturn new ResponseData(product.getId(), true, \"Save Data Success full\");\r\n\t\t} else {\r\n\t\t\treturn new ResponseData(0, false, \"Failed\");\r\n\t\t}\r\n\r\n\t}", "@Override\n\tpublic boolean addProduct(Products productInfoBean) {\n\t\treturn dao.addProduct(productInfoBean);\n\t}", "@Override\n\tpublic void add(Entity entity) throws Exception {\n\t\tsuper.add(entity);\n\t\tProduct prod = (Product) entity;\n\n\t\tSQLiteStatement st = db\n\t\t\t\t.prepare(\"INSERT INTO products(sessionID, name, priceMin, priceMax, quantity, category)\"\n\t\t\t\t\t\t+\"VALUES (?, ?, ?, ?, ?, ?)\");\n\t\tst.bind(1, sessionId).bind(2, prod.getName()).bind(3, prod.getPriceMin())\n\t\t\t\t.bind(4, prod.getPriceMin()).bind(5, prod.getQuantity())\n\t\t\t\t.bind(6, prod.getCategory());\n\t\tst.step();\n\t\ttotalQuantity += prod.quantity;\n\t\tif (!categoryList.containsKey(prod.getCategory())) {\n\t\t\tcategoryList.put(prod.getCategory(), new ArrayList<Product>());\n\t\t}\n\t\tcategoryList.get(prod.getCategory()).add(prod);\n\t\tif (availableProducts.get(entity.getName())==null) {\n\t\t\tavailableProducts.put(entity.getName(), \" \");\n\t\t}\n\t}", "@RequestMapping(value = {\"/add_product\"}, method = RequestMethod.GET)\n public String viewProductAdd() {\n return \"product_detail_new\";\n }", "public Products addProduct(Products product) {\n\t\treturn productsRepo.save(product);\n\t}", "public boolean addProduct(Product product) \r\n\t{\r\n\t\t\r\n\t\r\n\t\t\r\n\t\t\tboolean feedback=pDoa.addProductDoa(product);\r\n\t\t\tif(feedback) {\r\n\t\t\t\t\r\n\t\t\t\t\t\t\treturn true;\t\r\n\t\t\t\t}\r\n\t\t\telse {\r\n\t\t\t\t\r\n\t\t\t\t\t}\r\n\t\t\t\r\n\t\t\t\r\n\t\t\t\r\n\t\t\r\n\t\t\r\n\t\t\r\n\t\t\r\n\t\t\r\n\t\treturn false;\r\n\t\t\r\n\t}", "@Override\r\n\tpublic void saveProduct(Product product) throws Exception {\n\r\n\t}", "@Override\n\tpublic boolean addProduct(Product p) {\n\t\treturn false;\n\t}", "Product postProduct(Product product);", "@RequestMapping(value={\"/admin/Product\"}, method=RequestMethod.POST)\n\tpublic ModelAndView addProduct(@ModelAttribute(\"product\") @Valid Product prod, BindingResult result,Model model,HttpServletRequest request)\n\t{\n\t\tSystem.out.println(prod.getName());\n\t\t if(result.hasErrors())\n\t\t {\n\t\t\t System.out.println(result.getFieldError().getField());\n\t\t\t return new ModelAndView(\"/admin/Product\");\n\t\t }\n\t\t else\n\t\t {\n\t\t\t if(prod.getFile()==null)\n\t\t\t System.out.println(\"file is empty\");\n\t\t\t String filenm= prod.getFile().getOriginalFilename();\n\t\t\t prod.setImagepath(filenm);\n\t\t\t productDAO.storeFile(prod, request);\n\t\t\t boolean saved= productDAO.save(prod);\n\t\t\t if(saved)\n\t\t\t {\n\t\t\t\t model.addAttribute(\"msg\",\"Product Updated Sucessfully\");\n\t\t\t }\n\t\t\t ModelAndView mv=new ModelAndView(\"/admin/Product\");\n\t\t\t mv.addObject(\"product\",new Product());\n\t\t\t setData();\t\t\t\n\t\t\t return mv;\n\t\t }\n\t }", "Product updateProductInStore(Product product);", "public String addProduct() throws Exception {\r\n\t\t\r\n\t\t//content spot entity\r\n\t\tSpotBean spotBean = new SpotBean();\r\n\t\tspotBean.setId(this.getContentSpot().getId());\r\n\t\tspotBean = contentSpotService.load(spotBean);\r\n\t\t\r\n\t\t//main content spot\r\n\t\tContentSpot content = spotBean.getContentSpot();\r\n\t\tthis.products = content.getProducts();\r\n\r\n\t\t//configure products list attribute\r\n\t\tcontent.setProducts(extractProducts());\r\n\t\t\r\n\t\treturn update(spotBean);\r\n\t}", "public boolean addProduct(Product product) {\n\t\treturn false;\n\t}", "@Override\n\tpublic void saveProduct(Product product) {\n\t\t productRepository.save(product);\n\t\t\n\t}", "@RequestMapping(value = { \"/newproduct\" }, method = RequestMethod.POST)\r\n\tpublic String saveProduct(@Valid Product product, BindingResult result,\r\n\t\t\tModelMap model) {\r\n\r\n//\t\tif (result.hasErrors()) {\r\n//\t\t\treturn \"productslist\";\r\n//\t\t}\r\n\t\t\r\n\t\tmodel.addAttribute(\"productTypes\", productTypeService.findAllProductTypes());\r\n\t\tmodel.addAttribute(\"brand\", brandService.findAllBrands());\r\n\t\tmodel.addAttribute(\"edit\", true);\r\n\t\tproductService.saveProduct(product);\r\n\r\n\t\treturn \"newproduct\";\r\n\t}", "public void addProduct(Product item){\n inventory.add(item);\n }", "public UpdateProduct() {\n\t\tsuper();\t\t\n\t}", "@GetMapping(Mappings.ADD_PRODUCT)\n public ModelAndView add_product(){\n Product product = new Product();\n ModelAndView mv = new ModelAndView(ViewNames.ADD_PRODUCT);\n mv.addObject(\"product\", product);\n return mv;\n }", "public static Result newProduct() {\n Form<models.Product> productForm = form(models.Product.class).bindFromRequest();\n if(productForm.hasErrors()) {\n return badRequest(\"Tag name cannot be 'tag'.\");\n }\n models.Product product = productForm.get();\n product.save();\n return ok(product.toString());\n }", "@RequestMapping(\n method = RequestMethod.POST,\n consumes = MediaType.APPLICATION_JSON_VALUE,\n path = \"{productId}\"\n )\n public void addProductToShoppingCart(@PathVariable(\"productId\") UUID productId){\n shoppingCartService.insertProduct(productId);\n }", "private void insertProduct() {\n\n Uri imageforDummyProductURI = Uri.parse(\"android.resource://com.ezyro.uba_inventory/drawable/img_audi_a3\");\n\n\n // Create a ContentValues objecURI\n ContentValues values = new ContentValues();\n values.put(ProductEntry.COLUMN_PRODUCT_NAME, \"ford\");\n values.put(ProductEntry.COLUMN_PRODUCT_UNIT_PRICE, 25000);\n values.put(ProductEntry.COLUMN_PRODUCT_QUANTITY, 1);\n values.put(ProductEntry.COLUMN_PRODUCT_IMAGE_PATH, String.valueOf(imageforDummyProductURI));\n values.put(ProductEntry.COLUMN_PRODUCT_CATEGORY_NAME,\"Car\");\n values.put(ProductEntry.COLUMN_PRODUCT_SUPPLIER_ID,1);\n // values.put(ProductEntry.COLUMN_PRODUCT_SUPPLIER_NAME, \"Audi\");\n // values.put(ProductEntry.COLUMN_PRODUCT_SUPPLIER_EMAIL, \"[email protected]\");\n\n Uri newUri = getContentResolver().insert(ProductEntry.CONTENT_URI, values);\n\n // Show a toast message depending on whether or not the insertion was successful.\n if (newUri == null) {\n // If the new content URI is null, then there was an error with insertion.\n Toast.makeText(this, getString(R.string.editor_insert_product_failed),\n Toast.LENGTH_SHORT).show();\n } else {\n // Otherwise, the insertion was successful and we can display a toast.\n Toast.makeText(this, getString(R.string.editor_insert_product_successful),\n Toast.LENGTH_SHORT).show();\n }\n }", "public com.mozu.api.contracts.productadmin.Product addProduct(com.mozu.api.contracts.productadmin.Product product) throws Exception\r\n\t{\r\n\t\treturn addProduct( product, null);\r\n\t}", "public int storeProduct(Product product){\n int rowsAffected = 0;\n connect();\n String sql = \"INSERT INTO productos VALUES(?,?,?,?,?,?,?)\";\n try{\n PreparedStatement ps = connect.prepareStatement(sql);\n ps.setInt(1, Integer.parseInt(product.getProductId()));\n ps.setString(2, product.getProductDescription());\n ps.setString(3, product.getProductPresentation());\n ps.setInt(4, product.getProductCuantity());\n ps.setFloat(5, product.getProductPrice());\n ps.setFloat(6, (product.getProductCuantity() * product.getProductPrice()));\n ps.setInt(7, product.getProductProvider());\n \n rowsAffected = ps.executeUpdate();\n connect.close();\n return rowsAffected;\n }catch(SQLException ex){\n ex.printStackTrace();\n }\n return rowsAffected;\n }", "public String addProduct(Context pActividad,int pId, String pDescripcion,float pPrecio)\n {\n AdminSQLiteOpenHelper admin = new AdminSQLiteOpenHelper(pActividad, \"administracion\", null, 1);\n\n // con el objeto de la clase creado habrimos la conexion\n SQLiteDatabase db = admin.getWritableDatabase();\n try\n {\n // Comprobamos si el id ya existe\n Cursor filas = db.rawQuery(\"Select codigo from Articulos where codigo = \" + pId, null);\n if(filas.getCount()<=0)\n {\n //ingresamos los valores mediante, key-value asocioados a nuestra base de datos (tecnica muñeca rusa admin <- db <- registro)\n ContentValues registro = new ContentValues();\n registro.put(\"codigo\",pId);\n registro.put(\"descripcion\",pDescripcion);\n registro.put(\"precio\", pPrecio);\n\n //ahora insertamos este registro en la base de datos\n db.insert(\"Articulos\", null, registro);\n }\n else\n return \"El ID insertado ya existe\";\n }\n catch (Exception e)\n {\n return \"Error Añadiendo producto\";\n }\n finally\n {\n db.close();\n }\n return \"Producto Añadido Correctamente\";\n }", "public boolean add(Product product) {\n\t\treturn dao.add(product);\n\t}", "public void addProduct(Product p) {\n\t\tthis.productList.add(p);\n\t}", "public static int insert(Product p) {\n ConnectionPool pool = ConnectionPool.getInstance();\n Connection connection = pool.getConnection();\n PreparedStatement ps = null;\n System.out.println(\"DBSetup @ LINE 101\");\n String query\n = \"INSERT INTO product (productCode, productName, catalogCategory, description, price, imageURL) \"\n + \"VALUES (?, ?, ?, ?, ?, ?)\";\n try {\n ps = connection.prepareStatement(query);\n ps.setString(1, p.getProductCode());\n ps.setString(2, p.getProductName());\n ps.setString(3, p.getCatalogCategory());\n ps.setString(4, p.getDescription());\n ps.setFloat(5, p.getPrice());\n ps.setString(6, p.getImageURL());\n return ps.executeUpdate();\n } catch (SQLException e) {\n System.out.println(e);\n return 0;\n } finally {\n DBUtil.closePreparedStatement(ps);\n pool.freeConnection(connection);\n }\n }", "public String addToInventory(Product productDetails){\n productDetails.setProductForSale(\"Y\");\n productDetails = mongoDbConnector.addToInventory(productDetails);\n return productDetails.getProductName();\n }", "@RequestMapping(value = { \"/newproduct\" }, method = RequestMethod.GET)\r\n\tpublic String newProduct(ModelMap model) {\r\n\t\tProduct product = new Product();\r\n\t\tmodel.addAttribute(\"product\", product);\r\n\t\tmodel.addAttribute(\"productTypes\", productTypeService.findAllProductTypes());\r\n\t\tmodel.addAttribute(\"brands\", brandService.findAllBrands());\r\n\t\tmodel.addAttribute(\"edit\", false);\r\n\t\treturn \"newproduct\";\r\n\t}", "public void addProduct(Product p){\n stock.add(p);\n }", "@RequestMapping(\"/addnewproduct\")//, method=RequestMethod.POST)\n\tpublic String addProduct()\n\t{\n\t\treturn \"addproduct\";\n\t}", "public static boolean createNewProduct(Product product) {\r\n\t\tdbConnect();\r\n\t\tPreparedStatement stmt = null;\r\n\t\tboolean saveStatus = true;\r\n\t\tfinal String INSERT_NEW_PRODUCT = \"INSERT INTO product \"\r\n\t\t\t\t+ \"(product_id, product_code, product_name, product_unit, product_description, product_purprice, product_retprice, product_quantity)\"\r\n\t\t\t\t+ \" VALUES (0, \" + product.getProductCode() + \", UPPER('\" + product.getProductName().replace(\"'\", \"\\\\'\")\r\n\t\t\t\t+ \"'), UPPER('\" + product.getProductUnit().replace(\"'\", \"\\\\'\") + \"'), UPPER('\"\r\n\t\t\t\t+ product.getProductDescription().replace(\"'\", \"\\\\'\") + \"'), \" + product.getPriceForPurchase() + \", '\"\r\n\t\t\t\t+ product.getPriceForSales() + \"', '\" + product.getStockQuantity() + \"')\";\r\n\t\ttry {\r\n\t\t\tstmt = conn.prepareStatement(INSERT_NEW_PRODUCT);\r\n\t\t\tstmt.execute();\r\n\t\t\tstmt.close();\r\n\t\t} catch (SQLException e) {\r\n\t\t\tsaveStatus = false;\r\n\t\t\te.printStackTrace();\r\n\t\t}\r\n\t\treturn saveStatus;\r\n\t}", "public boolean addProductToTable(Product product) {\r\n\t\tString sqlCommand = \"Insert Into ProductTable \\n\"\r\n\t\t\t\t+ \"(Barcode, Product_Name, Delivery_Time, Quantity_In_Store, Quantity_In_storeroom, Supplier_Name, Average_Sales_Per_Day, \"\r\n\t\t\t\t+ \"Location_In_Store, Location_In_Storeroom, Faulty_Product_In_Store,Faulty_Product_In_Storeroom, Category)\\n\" + \"values(\" \r\n\t\t\t\t+ \"?\"+ \",\" + \"?\" + \",\" + \"?\" + \",\" + \"?\" + \",\" + \"?\" + \",\" + \"?\" + \",\" + \"?\" + \",\" + \"?\" + \",\" + \"?\" + \",\"\r\n\t\t\t\t+ \"?\" + \",\" + \"?\" + \",\" + \"?\" + \")\";\r\n\t\ttry (Connection conn = DriverManager.getConnection(dataBase);\r\n\t\t\t\tPreparedStatement pstmt = conn.prepareStatement(sqlCommand)) {\r\n\t\t\tpstmt.setInt(1, product.getBarcodeProduct());\r\n\t\t\tpstmt.setString(2, product.getProductName());\r\n\t\t\tpstmt.setInt(3, product.getDeliveryTime());\r\n\t\t\tpstmt.setInt(4, product.getStoreQuantity());\r\n\t\t\tpstmt.setInt(5, product.getStoreroomQuantity());\r\n\t\t\tpstmt.setString(6, product.getSupplier());\r\n\t\t\tpstmt.setDouble(7, product.getAverageSalesPerDay());\r\n\t\t\tpstmt.setString(8, product.getStoreLocation());\r\n\t\t\tpstmt.setString(9, product.getStoreroomLocation());\r\n\t\t\tpstmt.setInt(10, product.getFaultyProductInStore());\r\n\t\t\tpstmt.setInt(11, product.getFaultyProductInStoreroom());\r\n\t\t\tpstmt.setInt(12, product.getCategoryID());\r\n\t\t\tpstmt.executeUpdate();\r\n\t\t\treturn true;\r\n\t\t} catch (SQLException e) {\r\n\t\t\tSystem.out.println(\"addProductToTable: \"+e.getMessage());\r\n\t\t\treturn false;\r\n\t\t}\r\n\t}", "public void addProduct(){\n\t\tSystem.out.println(\"Company:\");\n\t\tSystem.out.println(theHolding.fabricationCompanies());\n\t\tint selected = reader.nextInt();\n\t\treader.nextLine();\n\t\tif(selected > theHolding.getSubordinates().size()-1){\n\t\t\tSystem.out.println(\"Please select a correct option\");\n\t\t}\n\t\telse{\n\t\t\tSystem.out.println(\"Name:\");\n\t\t\tString name = reader.nextLine();\n\t\t\tSystem.out.println(\"Code:\");\n\t\t\tString code = reader.nextLine();\n\t\t\tSystem.out.println(\"Water quantity require:\");\n\t\t\tdouble waterQuantity = reader.nextDouble();\n\t\t\treader.nextLine();\n\t\t\tSystem.out.println(\"Inventory:\");\n\t\t\tint inventory = reader.nextInt();\n\t\t\treader.nextLine();\n\t\t\tProduct toAdd = new Product(name, code, waterQuantity, inventory);\n\t\t\ttheHolding.addProduct(selected, toAdd);\n\t\t\tSystem.out.println(\"The product were added successfuly\");\n\t\t}\n\t}", "public void addProduct(Product toAdd) {\n\t\tthis.products.add(toAdd);\n\t}", "public String register() {\n categoryTable.getCategory().getProducts().add(product);\r\n productService\r\n .addReadyProduct(product,\r\n categoryTable.getCategory().getCategoryId());\r\n // Add message\r\n FacesContext.getCurrentInstance().addMessage(null,\r\n new FacesMessage(\"The Category \\\"\" + this.product.getName()\r\n + \"\\\" is Registered Successfully\"));\r\n RequestContext.getCurrentInstance().closeDialog(null);\r\n return \"\";\r\n }", "public int addProductDao(Product product) {\n\t\treturn 0;\n\t}", "@Override\n\tpublic void save(Product product) throws SQLException {\n\t\tproductDao.save(product);\n\t}" ]
[ "0.7864169", "0.76446605", "0.7610428", "0.7580678", "0.7560613", "0.75433975", "0.75310725", "0.7527964", "0.745459", "0.73784304", "0.7343373", "0.73208976", "0.72774196", "0.72614396", "0.7195857", "0.7186702", "0.7146282", "0.7120981", "0.7074905", "0.7044494", "0.7028412", "0.7015005", "0.7014011", "0.7005807", "0.70024335", "0.697194", "0.69560033", "0.69232553", "0.691924", "0.68887717", "0.68626434", "0.6844073", "0.68390673", "0.6830979", "0.6827895", "0.6815531", "0.68149376", "0.6779749", "0.6769838", "0.6761316", "0.67600733", "0.67578816", "0.6738424", "0.6714589", "0.67024004", "0.6697327", "0.6696005", "0.66731685", "0.66655695", "0.66413033", "0.66266584", "0.6625432", "0.66222566", "0.6618524", "0.6604822", "0.6599611", "0.6598324", "0.65970784", "0.6589536", "0.65712243", "0.65698797", "0.65610826", "0.65569997", "0.6549954", "0.65227425", "0.6504226", "0.64948803", "0.64881384", "0.6472986", "0.64635825", "0.6451657", "0.64465475", "0.6441643", "0.6440489", "0.64385897", "0.6431878", "0.6431225", "0.64309675", "0.64223087", "0.6414754", "0.6409661", "0.6401829", "0.6395525", "0.63894814", "0.6379726", "0.6368067", "0.6361612", "0.6331481", "0.63275266", "0.63256484", "0.63229024", "0.63200694", "0.631797", "0.63168657", "0.6304848", "0.6298156", "0.6288763", "0.6286535", "0.6281586", "0.62709755", "0.62585753" ]
0.0
-1
It allows the admin to remove a product from db.
public String[] removeItem(Session session) throws RemoteException{ System.out.println("Server model invokes removeItem() method"); return null; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "void removeProduct(Product product);", "public void deleteProduct(Product product) throws BackendException;", "private void removeProduct(int id)\n {\n manager.removeProduct(id);\n }", "void deleteProduct(Integer productId);", "private void deleteProduct(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException, SQLException {\n\t\tString theProduct=request.getParameter(\"deleteProduct\");\n\t\tdaoPageAdmin.DeleteProduct(theProduct);\n\t\tloadProduct(request, response);\n\t}", "@Override\n\tpublic void deleteProduct(int product_id) {\n\n\t}", "@Override\r\n\tpublic int deleteProduct(Product product) {\n\t\treturn 0;\r\n\t}", "public void removeProduct(SiteProduct product) {\n dataProvider.delete(product);\n }", "public void deleteProduct() throws ApplicationException {\n Menu deleteProduct = new Menu();\n deleteProduct.setIdProduct(menuFxObjectPropertyEdit.getValue().getIdProduct());\n\n Session session = HibernateUtil.getSessionFactory().getCurrentSession();\n\n try {\n session.beginTransaction();\n session.delete(deleteProduct);\n session.getTransaction().commit();\n } catch (RuntimeException e) {\n session.getTransaction().rollback();\n SQLException sqlException = getCauseOfClass(e, SQLException.class);\n throw new ApplicationException(sqlException.getMessage());\n }\n\n initMenuList();\n }", "void removeProduct(int position) throws ProductNotFoundException;", "public void eliminar(Producto producto) throws IWDaoException;", "public void Deleteproduct(Product objproduct) {\n\t\t\n\t}", "void deleteProduct(Long id);", "public void deleteProduct(Product product_1) {\n\r\n\t}", "private void deleteProduct() {\n // Only perform the delete if this is an existing Product.\n if (mCurrentProductUri != null) {\n // Call the ContentResolver to delete the pet at the given content URI.\n // Pass in null for the selection and selection args because the mCurrentProductUri\n // content URI already identifies the pet that we want.\n int rowsDeleted = getContentResolver().delete(mCurrentProductUri, null, null);\n\n // Show a toast message depending on whether or not the delete was successful.\n if (rowsDeleted == 0) {\n // If no rows were deleted, then there was an error with the delete.\n Toast.makeText(this, getString(R.string.editor_delete_product_failed),\n Toast.LENGTH_SHORT).show();\n } else {\n // Otherwise, the delete was successful and we can display a toast.\n Toast.makeText(this, getString(R.string.editor_delete_product_successful),\n Toast.LENGTH_SHORT).show();\n }\n }\n\n // Close the activity\n finish();\n }", "void deleteProduct(Product product) throws ServiceException;", "private void deleteProduct() {\n // Only perform the delete if this is an existing product.\n if (currentProductUri != null) {\n // Call the ContentResolver to delete the product at the given content URI.\n // Pass in null for the selection and selection args because the currentProductUri\n // content URI already identifies the product that we want.\n int rowsDeleted = getContentResolver().delete(currentProductUri, null, null);\n // Show a toast message depending on whether or not the delete was successful.\n if (rowsDeleted == 0) {\n // If no rows were deleted, then there was an error with the delete.\n Toast.makeText(this, getString(R.string.no_deleted_products),\n Toast.LENGTH_SHORT).show();\n } else {\n // Otherwise, the delete was successful and we can display a toast.\n Toast.makeText(this, getString(R.string.editor_delete_product_successful), Toast.LENGTH_SHORT).show();\n }\n }\n finish();\n }", "public void eliminar(Producto producto) throws BusinessErrorHelper;", "void deleteProduct(int productId) throws ProductException;", "public void Remove_button() {\n\t\tProduct product = (Product) lsvProduct.getSelectionModel().getSelectedItem();\n\t\tif (product!=null) {\n\t\t\tint ind = lsvProduct.getSelectionModel().getSelectedIndex();\n\t\t\tcart.removeProduct(product);\n\t\t\tcart.removePrice(ind);\n\t\t\tcart.removeUnit(ind);\n\t\t}\n\t\tthis.defaultSetup();\n\t}", "@Override\n\tpublic void remove(Long id) {\n\t\tproductRepository.delete(id);\n\t}", "@FXML\n\t private void deleteProduct (ActionEvent actionEvent) throws SQLException, ClassNotFoundException {\n\t try {\n\t ProductDAO.deleteProdWithId(prodIdText.getText());\n\t resultArea.setText(\"Product deleted! Product id: \" + prodIdText.getText() + \"\\n\");\n\t } catch (SQLException e) {\n\t resultArea.setText(\"Problem occurred while deleting product \" + e);\n\t throw e;\n\t }\n\t }", "@Override\n\tpublic void doDelete(String product) throws SQLException {\n\t\t\n\t}", "private void removeProduct() {\n\t\tif (!CartController.getInstance().isCartEmpty()) {\n\t\t\tSystem.out.println(\"Enter Product Id - \");\n\t\t\tint productId = getValidInteger(\"Enter Product Id - \");\n\t\t\twhile (!CartController.getInstance().isProductPresentInCart(\n\t\t\t\t\tproductId)) {\n\t\t\t\tSystem.out.println(\"Enter Valid Product Id - \");\n\t\t\t\tproductId = getValidInteger(\"Enter Product Id - \");\n\t\t\t}\n\t\t\tCartController.getInstance().removeProductFromCart(productId);\n\t\t} else {\n\t\t\tDisplayOutput.getInstance().displayOutput(\n\t\t\t\t\t\"\\n-----Cart Is Empty----\\n\");\n\t\t}\n\t}", "public void deleteProduct(Product product) {\n allProducts.remove(product);\n }", "public void deleteProduct(Product product){\n\t\tdao.deleteProduct(product);\n\t}", "void delete(Product product) throws IllegalArgumentException;", "@Override\n\tpublic int deleteProduct(String productNo) {\n\t\treturn 0;\n\t}", "@Override\r\n\tpublic void prodDelete(ProductVO vo) {\n\t\tadminDAO.prodDelete(vo);\r\n\t}", "public void deleteProduct(Supplier entity) {\n\t\t\r\n\t}", "private void eliminarProducto(HttpServletRequest request, HttpServletResponse response) {\n\t\tString codArticulo = request.getParameter(\"cArticulo\");\n\t\t// Borrar producto de la BBDD\n\t\ttry {\n\t\t\tmodeloProductos.borrarProducto(codArticulo);\n\t\t} catch (Exception e) {\n\t\t\t// TODO Auto-generated catch block\n\t\t\te.printStackTrace();\n\t\t}\n\n\t\t// Volver al listado con la info actualizada\n\t\tobtenerProductos(request, response);\n\n\t}", "@Override\n\tpublic void deleteProduct(int theId) {\n\t\tSession currentSession = sessionFactory.getCurrentSession();\n\t\tQuery theQuery = currentSession.createQuery(\"delete from Products where id=:productId\");\n\t\t\n\t\ttheQuery.setParameter(\"productId\", theId);\n\t\t\n\t\ttheQuery.executeUpdate();\n\t\t\n\t}", "private void btnRemoveActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnRemoveActionPerformed\n if(tblOrders.getSelectedRow() == -1)\n {\n lblMessage.setText(\"Select Product First\");\n }\n else\n {\n DefaultTableModel model = (DefaultTableModel)tblOrders.getModel();\n int productId = \n Integer.parseInt(String.valueOf(model.getValueAt(tblOrders.getSelectedRow(), 0)));\n \n loggedInCustomer.findLatestOrder().removeOrderLine(productId);\n \n model.removeRow(tblOrders.getSelectedRow());\n \n lblMessage.setText(\"Product Has Been Removed\");\n lblTotalCost.setText(\"£\" + String.format(\"%.02f\",loggedInCustomer.findLatestOrder().getOrderTotal()));\n }\n }", "public void handleDeleteProducts()\n {\n Product productToDelete = getProductToModify();\n\n if (productToDelete != null)\n {\n // Ask user for confirmation to remove the product from product table\n Alert alert = new Alert(Alert.AlertType.CONFIRMATION);\n alert.setTitle(\"Confirmation\");\n alert.setHeaderText(\"Delete Confirmation\");\n alert.setContentText(\"Are you sure you want to delete this product?\");\n ButtonType confirm = new ButtonType(\"Yes\", ButtonBar.ButtonData.YES);\n ButtonType deny = new ButtonType(\"No\", ButtonBar.ButtonData.NO);\n ButtonType cancel = new ButtonType(\"Cancel\", ButtonBar.ButtonData.CANCEL_CLOSE);\n alert.getButtonTypes().setAll(confirm, deny, cancel);\n alert.showAndWait().ifPresent(type ->{\n if (type == confirm)\n {\n // User cannot delete products with associated parts\n if (productToDelete.getAllAssociatedParts().size() > 0)\n {\n Alert alert2 = new Alert(Alert.AlertType.ERROR);\n alert2.setTitle(\"Action is Forbidden!\");\n alert2.setHeaderText(\"Action is Forbidden!\");\n alert2.setContentText(\"Products with associated parts cannot be deleted!\\n \" +\n \"Please remove associated parts from product and try again!\");\n alert2.show();\n }\n else\n {\n // delete the product\n inventory.deleteProduct(productToDelete);\n updateProducts();\n productTable.getSelectionModel().clearSelection();\n }\n }\n });\n }\n else\n {\n Alert alert = new Alert(Alert.AlertType.ERROR);\n alert.setTitle(\"Input Invalid\");\n alert.setHeaderText(\"No product was selected!\");\n alert.setContentText(\"Please select a product to delete from the part table!\");\n alert.show();\n }\n this.productTable.getSelectionModel().clearSelection();\n }", "public void DeleteProductById(String pid) {\r\n String query = \"delete from Trungnxhe141261_Product\\n\"\r\n + \"where id=?\";\r\n\r\n try {\r\n conn = new DBContext().getConnection();//mo ket noi voi sql\r\n ps = conn.prepareStatement(query);\r\n ps.setString(1, pid);\r\n ps.executeUpdate();\r\n } catch (Exception e) {\r\n }\r\n\r\n }", "public synchronized void deleteItem(Product product){\n carrito.set(product.getId(), null);\n }", "@Override\n\tpublic void delete(Product product) {\n\t\t\n\t\tTransaction txTransaction = session.beginTransaction();\n\t\tsession.delete(product);\n\t\ttxTransaction.commit();\n\t\tSystem.out.println(\"Product Deleted\");\n\t}", "public void deleteProduct()\n {\n ObservableList<Product> productRowSelected;\n productRowSelected = productTableView.getSelectionModel().getSelectedItems();\n int index = productTableView.getSelectionModel().getFocusedIndex();\n Product product = productTableView.getItems().get(index);\n if(productRowSelected.isEmpty())\n {\n alert.setAlertType(Alert.AlertType.ERROR);\n alert.setContentText(\"Please select the Product you want to delete.\");\n alert.show();\n } else if (!product.getAllAssociatedParts().isEmpty())\n {\n alert.setAlertType(Alert.AlertType.ERROR);\n alert.setContentText(\"This Product still has a Part associated with it. \\n\" +\n \"Please modify the Product and remove the Part.\");\n alert.show();\n } else {\n alert.setAlertType(Alert.AlertType.CONFIRMATION);\n alert.setContentText(\"Are you sure you want to delete this Product?\");\n alert.showAndWait();\n ButtonType result = alert.getResult();\n if(result == ButtonType.OK)\n {\n Inventory.deleteProduct(product);\n }\n }\n }", "public JavaproductModel deleteproduct(JavaproductModel oJavaproductModel){\n\n \t\t/* Create a new hibernate session and begin the transaction*/\n Session hibernateSession = HibernateUtil.getSessionFactory().openSession();\n Transaction hibernateTransaction = hibernateSession.beginTransaction();\n\n /* Retrieve the existing product from the database*/\n oJavaproductModel = (JavaproductModel) hibernateSession.get(JavaproductModel.class, oJavaproductModel.getproductId());\n\n /* Delete any collection related with the existing product from the database.\n Note: this is needed because some hibernate versions do not handle correctly cascade delete on collections.*/\n oJavaproductModel.deleteAllCollections(hibernateSession);\n\n /* Delete the existing product from the database*/\n hibernateSession.delete(oJavaproductModel);\n\n /* Commit and terminate the session*/\n hibernateTransaction.commit();\n hibernateSession.close();\n return oJavaproductModel;\n }", "@FXML\n\tpublic void deleteProduct(ActionEvent event) {\n\t\tif (!txtDeleteProductName.getText().equals(\"\")) {\n\t\t\ttry {\n\n\t\t\t\tList<Product> productToDelete = restaurant.findSameProduct(txtDeleteProductName.getText());\n\t\t\t\tboolean delete = restaurant.deleteProduct(txtDeleteProductName.getText());\n\t\t\t\tif (delete == true) {\n\t\t\t\t\tfor (int i = 0; i < productOptions.size(); i++) {\n\t\t\t\t\t\tfor (int j = 0; j < productToDelete.size(); j++) {\n\t\t\t\t\t\t\tif (productOptions.get(i) != null && productOptions.get(i)\n\t\t\t\t\t\t\t\t\t.equalsIgnoreCase(productToDelete.get(j).getReferenceId())) {\n\t\t\t\t\t\t\t\tproductOptions.remove(productToDelete.get(j).getReferenceId());\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\ttxtDeleteProductName.setText(\"\");\n\n\t\t\t} catch (IOException e) {\n\t\t\t\te.printStackTrace();\n\t\t\t\tDialog<String> dialog = createDialog();\n\t\t\t\tdialog.setContentText(\"No se pudo guardar la actualización de los productos\");\n\t\t\t\tdialog.setTitle(\"Error guardar datos\");\n\t\t\t\tdialog.show();\n\t\t\t}\n\t\t} else {\n\t\t\tDialog<String> dialog = createDialog();\n\t\t\tdialog.setContentText(\"Los campos deben ser llenados\");\n\t\t\tdialog.setTitle(\"Error, Campo sin datos\");\n\t\t\tdialog.show();\n\t\t}\n\t}", "private boolean deleteProduct(String code, String name , String brand , String price , String quantity) {\n DatabaseReference dR = FirebaseDatabase.getInstance().getReference().child(code);\n\n //removing artist\n Information information = new Information(code, name ,brand ,price ,quantity);\n dR.removeValue((DatabaseReference.CompletionListener) information);\n\n //getting the tracks reference for the specified artist\n //DatabaseReference drTracks = FirebaseDatabase.getInstance().getReference(\"tracks\").child(id);\n\n //removing all tracks\n //drTracks.removeValue();\n Toast.makeText(getApplicationContext(), \"product Deleted\", Toast.LENGTH_LONG).show();\n\n return true;\n }", "@Override\n public void removeFromDb() {\n }", "public void deleteProduct(Product product)\n {\n SQLiteDatabase db = this.database.getWritableDatabase();\n\n // Sets up the WHERE condition of the SQL statement\n String condition = String.format(\" %s = ?\", ShoppingListTable.KEY_TPNB);\n\n // Stores the values of the WHERE condition\n String[] conditionArgs = { String.valueOf(product.getTPNB()) };\n\n db.delete(ShoppingListTable.TABLE_NAME, condition, conditionArgs);\n }", "@Override\r\n\tpublic boolean deleteProduct(ProductDAO product) {\n\t\treturn false;\r\n\t}", "public void unlinkProduct() {\n Product result;\n String supplierID = getToken(\"Enter supplier ID: \");\n if (warehouse.searchSupplier(supplierID) == null) {\n System.out.println(\"No such supplier!\");\n return;\n }\n do {\n String productID = getToken(\"Enter product ID: \");\n result = warehouse.unlinkProduct(supplierID, productID);\n if (result != null) {\n System.out.println(\"Product [\" + productID + \"] unassigned from supplier: [\" + supplierID + \"]\");\n }\n else {\n System.out.println(\"Product could not be unassigned\");\n }\n if (!yesOrNo(\"unassign more products from supplier: [\"+ supplierID + \"]\")) {\n break;\n }\n } while (true);\n }", "public void RemoveproductCartSaucedemo() {\n\t\t\t\t\tdriver.findElement(RemoveProduct).click();\n\t\t\n\t\t\t\t}", "@Override\r\n\tpublic int deleteProductById(String productId) {\n\t\treturn dao.deleteProductById(productId);\r\n\t}", "Boolean remover(String userName, Long idProducto);", "private void delete() {\n\t\tComponents.questionDialog().message(\"Are you sure?\").callback(answeredYes -> {\n\n\t\t\t// if confirmed, delete the current product PropertyBox\n\t\t\tdatastore.delete(TARGET, viewForm.getValue());\n\t\t\t// Notify the user\n\t\t\tNotification.show(\"Product deleted\", Type.TRAY_NOTIFICATION);\n\n\t\t\t// navigate back\n\t\t\tViewNavigator.require().navigateBack();\n\n\t\t}).open();\n\t}", "public int productDelete(Product product){\n int rowsAffected = 0;\n connect();\n String sql = \"DELETE FROM productos WHERE id_producto = ?\";\n \n try{\n PreparedStatement ps = connect.prepareStatement(sql);\n ps.setInt(1, Integer.parseInt(product.getProductId()));\n rowsAffected = ps.executeUpdate();\n connect.close();\n }catch(SQLException ex){\n ex.printStackTrace();\n }\n return rowsAffected;\n }", "public void delete(Product product) {\n\t\t\tproductDao.delete(product);\n\t\t}", "public void deleteProductById(int id) {\n\t\tproductMapper.deleteProductById(id);\r\n\t}", "public void removeProduct(Product item) {\n inventory.remove(item);\n }", "@Override\n\tpublic int deleteproduct(Integer id) {\n\t\tConnection conn=null;\n\t\tPreparedStatement pst=null;\n\t\ttry {\n\t\t\tconn=DBUtils.getConnection();\n\t\t\tpst=conn.prepareStatement(\"delete from product where id=?\");\n\t\t\tpst.setInt(1,id);\n\t\t\t\n\t\t\treturn pst.executeUpdate();\n\t\t\t\n\t\t\t\n\t\t} catch (SQLException e) {\n\t\t\t// TODO Auto-generated catch block\n\t\t\te.printStackTrace();\n\t\t}finally {\n\t\t\ttry {\n\t\t\t\tDBUtils.Close(conn, pst);\n\t\t\t} catch (SQLException e) {\n\t\t\t\t// TODO Auto-generated catch block\n\t\t\t\te.printStackTrace();\n\t\t\t}\n\t\t}\n\t\t\n\t\t\n\t\t\n\t\treturn 0;\n\t}", "public RemoveProductController() {\r\n\t\tsuper();\r\n\t\t// TODO Auto-generated constructor stub\r\n\t}", "ShoppingBasket removeProductItem(Long shoppingBasketId, Long productItemId);", "public static int delete(Product p) {\n ConnectionPool pool = ConnectionPool.getInstance();\n Connection connection = pool.getConnection();\n PreparedStatement ps = null;\n\n String query = \"DELETE FROM product \"\n + \"WHERE productCode = ?\";\n try {\n ps = connection.prepareStatement(query);\n ps.setString(1, p.getProductCode());\n\n return ps.executeUpdate();\n } catch (SQLException e) {\n System.out.println(e);\n return 0;\n } finally {\n DBUtil.closePreparedStatement(ps);\n pool.freeConnection(connection);\n }\n }", "@DeleteMapping(\"/delete\")\r\n\tpublic ProductDetails deleteProduct(@Valid @RequestBody DeleteProduct request) {\r\n\t\treturn productUtil.toProductDetails(productService.deleteProduct(request.getProduct_Id()));\r\n\r\n\t}", "public void remove()\n\n throws ManageException, DoesNotExistException;", "public boolean removeProductFromWishlist(String productId) {\n\t\t// TODO Auto-generated method stub\n\t\tboolean result=false;\n\t\tif(WishlistDaoImpl.wlist.get(productId) != null)\n\t\t{\n\t\t\n\t\t\tresult=WishlistDaoImplObj.removeProductFromWishlist(productId);\n\t\t\treturn result;\n\t\t}\n\t\telse\n\t\t{ \n\t\t\tint x=3;\n\t\t\tint y=0;\n\t\t\tint z=x/y;\n\t\t\treturn false;\n\t\t\n\t\t\t//throw new WishListException(\"Product ID not found in Wishlist to REMOVE\");\n\t\t}\n\t\n}", "public boolean removeProduct(int productToRemove_id) \n\t{\n\t\treturn false;\n\t}", "@Override\n\t@Transactional\n\tpublic void deleteProduct(int productId) {\n\t\tproductDAO.deleteById(productId);\n\n\t}", "@Override\r\n\tpublic boolean deleteProduct(int productId) {\n\t\treturn dao.deleteProduct(productId);\r\n\t}", "boolean deleteProduct(ProductDTO productDTO, Authentication authentication);", "@DeleteMapping(\"/products/{id}\")\n\tpublic List<Product> removeOneProduct(@PathVariable(\"id\") int id){\n\t\t//counter for loop \n\t\tfor (int i=0; i < products.size(); i++) {\n\t\t\tif (products.get(i).getId() == id) {\n\t\t\t\tproducts.remove(i);\n\t\t\t\treturn products;\n\t\t\t}\n\t\t}\n\t\t\n\t\tthrow new ProductNotFoundException();\n\t\t\n\t}", "public void removeProduct(int id)\n {\n Product product = findProduct(id);\n \n System.out.println(\"Removing product \" + product.getName() +\n \" from the stock list\");\n \n if(product != null)\n {\n stock.remove(product);\n }\n }", "@Transactional\n public void deleteProduct(Integer productId) {\n ProductEntity productEntity = productRepository\n .findById(productId)\n .orElseThrow(() -> new NotFoundException(getNotFoundMessage(productId)));\n productEntity.setRemoved(true);\n productRepository.save(productEntity);\n cartRepository.deleteRemovedFromCart(productId);\n }", "private JButton createButtonRemoveProduct() {\n\n this.buttonRemoveProduct = new JButton(\"Remove product\");\n this.buttonRemoveProduct.setEnabled(false);\n\n this.buttonRemoveProduct.addActionListener(new ActionListener() {\n @Override\n public void actionPerformed(ActionEvent e) {\n\n try {\n int index = jListProduct.getSelectedIndex();\n boolean removedProduct = removeProduct(index);\n if (removedProduct) {\n buttonRemoveProduct.setEnabled(false);\n JOptionPane.showMessageDialog(rootPane,\n \"Product removed sucessfully.!\",\n \"Product removal\",\n JOptionPane.INFORMATION_MESSAGE);\n }\n\n } catch (IllegalArgumentException ex) {\n\n JOptionPane.showMessageDialog(DemonstrationApplication.this,\n ex.getMessage(),\n \"Erro a remover produto\",\n JOptionPane.WARNING_MESSAGE);\n }\n }\n });\n\n return this.buttonRemoveProduct;\n }", "public void removeByProductType(String productType);", "public void deleteProduct(CartProduct p) {\n\t\tcart.deleteFromCart(p);\n\t}", "@Writer\n int deleteByPrimaryKey(Integer productId);", "@RequestMapping(path=\"/eliminar\", method=RequestMethod.GET)\r\n\tpublic String deleteProduct(@RequestParam(name=\"id\")int id,Model model) {\n\t\tproductoDAO.deleteProducto(id);\r\n\t\t//retornamos lista de productos\r\n\t\treturn \"redirect:/producto\";\r\n\t}", "public static boolean deleteProduct(Product product) {\r\n\t\tdbConnect();\r\n\t\tPreparedStatement stmt = null;\r\n\t\tboolean saveStatus = true;\r\n\t\tfinal String DELETE_PRODUCT = \"DELETE FROM product WHERE product_code=\" + product.getProductCode();\r\n\t\ttry {\r\n\t\t\tstmt = conn.prepareStatement(DELETE_PRODUCT);\r\n\t\t\tstmt.executeUpdate();\r\n\t\t\tstmt.close();\r\n\t\t} catch (SQLException e) {\r\n\t\t\tsaveStatus = false;\r\n\t\t\te.printStackTrace();\r\n\t\t}\r\n\t\treturn saveStatus;\r\n\t}", "public void delete(Product product) {\n\t\tif (playerMap.containsKey(product.getOwner())) {\n\t\t\tplayerMap.get(product.getOwner())[product.getSlot()] = null;\n\t\t}\n\t\tMap<Integer, Set<Product>> itemMap = typeMap.get(product.getType()).get(product.getState());\n\t\tif (itemMap.containsKey(product.getItemId())) {\n\t\t\titemMap.get(product.getItemId()).remove(product);\n\t\t}\n\t}", "@Transactional\n\tpublic void deleteProduct(int id) {\n\n\t\tProduct product = hibernateTemplate.get(Product.class, id);\n\t\thibernateTemplate.setCheckWriteOperations(false);\n\t\thibernateTemplate.delete(product);\n\n\t}", "@DeleteMapping(\"/product/{id}\")\n\t@ApiOperation(value = \"\", authorizations = { @Authorization(value=\"JWT\") })\n\tString deleteProduct(@PathVariable Long id) {\n\t\tproductRepo.deleteById(id);\n\t\treturn \"deleted successfully\";\n\t}", "@Override\r\n\tpublic void ManageProduct() {\n\t\tint id = this.view.enterId();\r\n\t\tString name = this.view.enterName();\r\n\t\tfloat price = this.view.enterPrice();\r\n\t\tint quantity = this.view.enterQuantity();\r\n\t\t\r\n\t\tthis.model.updProduct(id, name, price, quantity);\r\n\t}", "public void delete(SpecificProduct specificProduct) {\n specific_product_dao.delete(specificProduct);\n }", "public void deleteProductDetails(long id) {\n entityManager.createQuery(\"DELETE FROM ProductDetails pd WHERE pd.product.id=:id\")\n .setParameter(\"id\", id)\n .executeUpdate();\n }", "public void deleteButtonClicked(View view) {\n String inputText = johnsInput.getText().toString();\n dbHandler.deleteProduct(inputText);\n printDatabase();\n }", "@Override\n\tpublic void deleteProductImage(String id) {\n\t\tthis.productGaleryRepository.deleteById(Long.parseLong(id));\n\t}", "@Override\r\n\tpublic ProductMaster deleteProduct(int productId) {\n\t\tProductMaster productMaster = this.repository.findById(productId).orElseThrow(() -> new IllegalArgumentException(\"Invalid book Id:\" + productId));\r\n\t\tif(productMaster!=null)\r\n\t\t\tthis.repository.deleteById(productId);\r\n\t\treturn productMaster;\r\n\t}", "@RequestMapping(\n method = RequestMethod.DELETE,\n path = \"{productId}\"\n )\n public void deleteProductFromShoppingCartById(@PathVariable(\"productId\") UUID productId){\n shoppingCartService.deleteProductFromShoppingCartById(productId);\n }", "@DeleteMapping(\"/deleteproduct/{productId}\")\n\t\tpublic String deleteProduct(@PathVariable(value = \"productId\") int productId) throws ProductNotFoundException {\n\t\t\tlogger.info(\"product deleted displyed\");\n\t\t\tProduct product = productService.getProductById(productId)\n\t\t\t\t\t.orElseThrow(() -> new ProductNotFoundException(\"No product found with this Id :\" + productId));\n\t\t\tproductService.deleteProduct(product);\n\t\t\treturn \"Product Deleted Successfully\";\n\t\t}", "@DeleteMapping(path =\"/products/{id}\")\n public ResponseEntity<Void> deleteProduct(@PathVariable(name=\"id\") Long id) {\n log.debug(\"REST request to delete Product with id : {}\", id);\n productService.delete(id);\n return ResponseEntity.ok().headers(HeaderUtil.createEntityDeletionAlert(ENTITY_NAME, id.toString())).build();\n }", "public void delete(CatalogProduct catalogProduct) {\n catalog_product_dao.delete(catalogProduct);\n }", "private void removeProdutos() {\n Collection<IProduto> prods = this.controller.getProdutos();\n for(IProduto p : prods) System.out.println(\" -> \" + p.getCodigo() + \" \" + p.getNome());\n System.out.println(\"Insira o codigo do produto que pretende remover da lista de produtos?\");\n String codigo = Input.lerString();\n // Aqui devia se verificar se o produto existe mas nao sei fazer isso.\n this.controller.removeProdutoControl(codigo);\n }", "@Override\r\n\t\t\t\t\t\t\tpublic void handle(ActionEvent arg0) {\n\t\t\t\t\t\t\t\troot.getChildren().remove(product);\r\n\t\t\t\t\t\t\t}", "public void deleteProduct(final Product existingProduct) {\n\t\tproductRepository.delete(existingProduct);\n\t}", "@Override\n\tpublic int deleteProductPhoto(String productNo) {\n\t\treturn 0;\n\t}", "@Override\n\tpublic int deleteProduct(String productName) throws SQLException {\n\t\tnumberOfRowsImpacted = 0;\n\t\t\n\t\tc = DriverManager.getConnection(dbURL, user, password);\n\t\tSystem.out.println(\"Connection Successful! \" + dbURL + \" User: \" + user + \" PW: \" + password);\n\n\t\t//create a SQL statement\n\t\tpstmt = c.prepareStatement(\"delete from thatcoffeeshop.products where name = ?\");\n\t\tpstmt.setString(1, productName);\n\t\t\n\t\t//execute the statement\n\t\tnumberOfRowsImpacted = pstmt.executeUpdate();\n\t\t\n\t\t//success msg\n\t\tSystem.out.println(\"Rows affected \" + numberOfRowsImpacted);\n\n\t\tpstmt.close();\n\t\tc.close();\n\t\t\n\t\treturn numberOfRowsImpacted;\n\t}", "@Override\r\n\tpublic void fireModelDeleteProduct(String msg) {\n\t\t\r\n\t}", "@Override\n public void delete(Long id) {\n log.debug(\"Request to delete Product : {}\", id);\n productRepository.delete(id);\n }", "public static void deleteProducts(final Context context) {\n log.info(\"Productos Eliminados\");\n inicializaPreferencias(context);\n sharedPreferencesEdit.remove(Constantes.PRODUCTOS);\n sharedPreferencesEdit.commit();\n }", "@Override\n\tpublic int delete(ProductDTO dto) {\n\t\treturn 0;\n\t}", "public ConfigProductWithSpecialPriceDetailPage removeProductGalleryFromConfigProductWithSpecialPrice() {\n SpriiTestFramework.getInstance().waitForElement(By.xpath(firstImageElement), 20);\n Actions actions = new Actions(driver);\n WebElement target = driver.findElement(By.xpath(firstImageElement));\n actions.moveToElement(target).perform();\n SpriiTestFramework.getInstance().waitForElement(By.xpath(removeElement), 20);\n driver.findElement(By.xpath(removeElement)).click();\n return new ConfigProductWithSpecialPriceDetailPage();\n }", "public void removeItem(Product p) throws ProductNotFoundException {\n\t\tif (!_items.remove(p)) {\n\t\t\tthrow new ProductNotFoundException(\"No existeix producte\");\n\t\t}\n\t}", "public void removeByProductName(java.lang.String productName)\n\t\tthrows com.liferay.portal.kernel.exception.SystemException;", "public boolean EliminarProducto(int id) {\n boolean status=false;\n int res =0;\n try {\n conectar();\n res=state.executeUpdate(\"delete from producto where idproducto=\"+id+\";\");\n \n if(res>=1){\n status=true;\n }\n con.close();\n } catch (Exception ex) {\n ex.printStackTrace();\n }\n return status;\n }", "public boolean removeProduct(Product p) {\n\tsynchronized (this.productList) {\n\t boolean returned = this.productList.remove(p);\n\t this.setChanged();\n\t this.notifyObservers();\n\t return returned;\n\t}\n }", "private void removeProducto(int position) {\n losproductos.remove(position);\n // Notificamos de un item borrado en nuestro array\n eladaptador.notifyItemRemoved(position);\n }" ]
[ "0.7858711", "0.76052344", "0.7354437", "0.732776", "0.71993273", "0.7168968", "0.7141353", "0.71307963", "0.71048564", "0.7093507", "0.7085703", "0.708275", "0.7042613", "0.7039563", "0.7037512", "0.69675744", "0.694888", "0.6926489", "0.69047385", "0.6861806", "0.68597144", "0.6831651", "0.68245107", "0.68182975", "0.6765474", "0.6738247", "0.6725144", "0.6688969", "0.6687387", "0.6683428", "0.66304946", "0.66303664", "0.65545106", "0.65485567", "0.65452737", "0.6544082", "0.65422827", "0.64780444", "0.6446118", "0.64419365", "0.6430225", "0.6418718", "0.64155006", "0.64026254", "0.63785636", "0.6375738", "0.63679284", "0.63643795", "0.636174", "0.6359645", "0.6336773", "0.63297814", "0.63190836", "0.63139236", "0.63036805", "0.6295142", "0.6294053", "0.62932485", "0.62688196", "0.6260726", "0.62560594", "0.62432", "0.62276244", "0.62221766", "0.6219779", "0.6218971", "0.62076855", "0.61891073", "0.61827445", "0.6181171", "0.6179673", "0.6175465", "0.6173416", "0.61678606", "0.6153791", "0.6143419", "0.6115196", "0.61140543", "0.6111446", "0.6107204", "0.6104439", "0.60957277", "0.6068905", "0.6068881", "0.6067959", "0.6039802", "0.60397357", "0.6032292", "0.6029723", "0.6029565", "0.6017267", "0.6008289", "0.60073996", "0.59981894", "0.5997357", "0.59970593", "0.5981665", "0.59799117", "0.5973872", "0.5972542", "0.59664935" ]
0.0
-1
It allows the admin to update a product from db.
public String[] updateItem(Session session) throws RemoteException { System.out.println("Server model invokes updateItem() method"); return null; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "Product updateProductInStore(Product product);", "Product editProduct(Product product);", "ProductView updateProduct(int productId, EditProductBinding productToEdit) throws ProductException;", "Product updateProductById(Long id);", "@Override\r\n\tpublic void ManageProduct() {\n\t\tint id = this.view.enterId();\r\n\t\tString name = this.view.enterName();\r\n\t\tfloat price = this.view.enterPrice();\r\n\t\tint quantity = this.view.enterQuantity();\r\n\t\t\r\n\t\tthis.model.updProduct(id, name, price, quantity);\r\n\t}", "public void Editproduct(Product objproduct) {\n\t\t\n\t}", "public boolean update(Product product);", "@Override\n\tpublic String updateProduct() throws AdminException {\n\t\treturn null;\n\t}", "void updateOfProductById(long id);", "public void updateProduct() throws ApplicationException {\n Session session = HibernateUtil.getSessionFactory().getCurrentSession();\n\n try {\n session.beginTransaction();\n Menu updateProduct = (Menu) session.get(Menu.class, menuFxObjectPropertyEdit.getValue().getIdProduct());\n\n updateProduct.setName(menuFxObjectPropertyEdit.getValue().getName());\n updateProduct.setPrice(menuFxObjectPropertyEdit.getValue().getPrice());\n\n session.update(updateProduct);\n session.getTransaction().commit();\n } catch (RuntimeException e) {\n session.getTransaction().rollback();\n SQLException sqlException = getCauseOfClass(e, SQLException.class);\n throw new ApplicationException(sqlException.getMessage());\n }\n\n initMenuList();\n }", "public void update(Product product) {\n\n\t}", "public void updateProduct(Product catalog) throws BackendException;", "@Override\r\n\tpublic void prodUpdate(ProductVO vo) {\n\t\tadminDAO.prodUpdate(vo);\r\n\t}", "public void updateProduct(SiteProduct product) {\n dataProvider.save(product);\n }", "Product update(Product product, long id);", "@GetMapping(\"/updateProduct\")\n\tpublic String updateProduct(@RequestParam(\"productId\") int productId , Model theModel) {\n\t\tProduct product = productDAO.getProduct(productId);\n\n\t\t// add the users to the model\n\t\ttheModel.addAttribute(\"product\", product);\n\t\t \n\t\treturn \"update-product\";\n\t}", "public UpdateProduct() {\n\t\tsuper();\t\t\n\t}", "@Override\r\n\tpublic int update(Product product) throws Exception {\n\t\treturn this.dao.update(product);\r\n\t}", "@Override\n\tpublic void update(Product product) throws SQLException {\n\t\tproductDao.update(product);\n\t}", "void update(Product product) throws IllegalArgumentException;", "private void updateProduct(Product productUpdated, int productId) {\n try {\n ConDB conn = new ConDB();\n String query = \"UPDATE products SET productName = ?,\"\n + \"total = ?, remaining = ?, warehouse_id = ? WHERE id = \" + productId;\n \n \n PreparedStatement pst = conn.getConnection().prepareStatement(query);\n pst.setString(1, productUpdated.getProductName());\n pst.setInt(2, productUpdated.getTotal());\n pst.setInt(3, productUpdated.getRemaining());\n pst.setInt(4, productUpdated.getWarehouse_id());\n \n pst.executeUpdate();\n JOptionPane.showMessageDialog(null, \"Product updated\");\n closeUpdateProduct();\n } catch (SQLException ex) {\n System.out.println(ex.getLocalizedMessage());\n }\n }", "@Override\r\n\tpublic boolean updateProduct(ProductDAO product) {\n\t\treturn false;\r\n\t}", "@PutMapping(\"/update\")\r\n\tpublic ProductDetails updateProduct(@RequestBody @Valid UpdateProduct request) {\r\n\t\r\n\t\tProduct product = productService.searchProduct(request.getProduct_Id());\r\n\t\tproduct.setProduct_Name(request.getProduct_Name());\r\n\t\tproduct.setProduct_Price(request.getProduct_Price());\r\n\t\tproduct.setProduct_Quantity(request.getProduct_Quantity());\r\n\t\tproduct.setProduct_Availability(request.isProduct_Availability());\r\n\t\treturn productUtil.toProductDetails(productService.updateProduct(product));\r\n\t}", "@RequestMapping(value = {\"/product_detail/{id}\"}, method = RequestMethod.POST)\n public String updateProduct(Model model, @PathVariable(\"id\") long id, HttpServletRequest request) {\n updateProductByRest(id, request);\n Product product = getProduct(id, request);\n model.addAttribute(\"product\", product);\n return \"product_detail\";\n }", "public void testUpdateProduct() {\n\t\tProduct product=productDao.selectProducts(33);\n\t\tproduct.setPrice(100.0);\n\t\tproduct.setQuantity(1);\n\t\tproductDao.updateProduct(product);//product has updated price and update quantity\n\t\tassertTrue(product.getPrice()==100.0);\n\t\tassertTrue(product.getQuantity()==1);\n\t}", "@Override\r\n\tpublic boolean updateProduct(Product product) {\n\t\treturn dao.updateProduct(product);\r\n\t}", "public void updateDb(View view) {\n String productName = getIntent().getStringExtra(\"product\");\n Product p = db.getProductByName(productName);\n p.setName(name.getText().toString());\n p.setAvail(availSpinner.getSelectedItem().toString());\n p.setDescription(desc.getText().toString());\n p.setPrice(new BigDecimal(price.getText().toString()));\n p.setWeight(Double.parseDouble(weight.getText().toString()));\n db.updateProduct(p);\n finish();\n }", "@Override\r\n\tpublic Long update(Producto entity) throws Exception {\n\t\treturn productRepository.update(entity);\r\n\t}", "@Override\n\t@Transactional\n\tpublic void updateProduct(Product product) {\n\t\tproductDAO.save(product);\n\t\t\n\t}", "@Override\n\tpublic void updateProduct(ProductVO vo) {\n\n\t}", "public static int update(Product p) {\n ConnectionPool pool = ConnectionPool.getInstance();\n Connection connection = pool.getConnection();\n PreparedStatement ps = null;\n System.out.println(\"DBSetup @ LINE 127\");\n String query = \"UPDATE product SET productCode = ?, productName = ?, catalogCategory = ?,\"\n + \"description = ?, price = ?, imageURL = ? \"\n + \" WHERE productCode = ?\";\n try {\n ps = connection.prepareStatement(query);\n ps.setString(1, p.getProductCode());\n ps.setString(2, p.getProductName());\n ps.setString(3, p.getCatalogCategory());\n ps.setString(4, p.getDescription());\n ps.setFloat(5, p.getPrice());\n ps.setString(6, p.getImageURL());\n ps.setString(7, p.getProductCode());\n return ps.executeUpdate();\n } catch (SQLException e) {\n System.out.println(e);\n return 0;\n } finally {\n DBUtil.closePreparedStatement(ps);\n pool.freeConnection(connection);\n }\n }", "public void editProduct(SiteProduct product) {\n showForm(product != null);\n //form.editProduct(product);\n }", "@Override\r\n\tpublic int updateProduct(Product product) {\n\t\treturn 0;\r\n\t}", "@Override\n\tpublic void update(Product product) {\n\t\tTransaction txTransaction = session.beginTransaction();\n\t\tsession.update(product);\n\t\ttxTransaction.commit();\n\t\tSystem.out.println(\"Product Updated\");\n\n\t}", "@Override\n\tpublic void updateProduct(Product p) {\n\t\tProduct product = productRepository.getOne(p.getId());\n\t\tproduct.setName(p.getName());\n\t\tproduct.setPrice(150000);\n\t\tproductRepository.save(product);\n\t}", "@Override\r\n\tpublic Product updateProduct(Product s) {\n\t\treturn null;\r\n\t}", "@Override\n\tpublic boolean updateProduct(Product p) {\n\t\treturn false;\n\t}", "@Override\r\n\tpublic void pUpdate(String name, String depict, String type, double price, String img,String phone, int PS2_id,int P_id) {\n\t\tConnection connection = DBUtils.getConnection();\r\n\t\tPreparedStatement preparedStatement = null;\r\n\t\tString sql = \"update product set name=?,depict=?,type=?,price=?,img=?,phone=?,PS2_id=? where P_id=?\";\r\n\t try {\r\n\t \tconnection.setAutoCommit(false);\r\n\t \tpreparedStatement = connection.prepareStatement(sql);\r\n\t\t\tpreparedStatement.setString(1, name);\r\n\t\t\tpreparedStatement.setString(2, depict);\r\n\t\t\tpreparedStatement.setString(3, type);\r\n\t\t\tpreparedStatement.setDouble(4, price);\r\n\t\t\tpreparedStatement.setString(5, img);\r\n\t\t\tpreparedStatement.setString(6, phone);\r\n\t\t\tpreparedStatement.setInt(7, PS2_id);\r\n\t\t\tpreparedStatement.setInt(8,P_id);\r\n\t\t\tpreparedStatement.execute();\r\n\t\t\tconnection.commit();\r\n\t\t} catch (SQLException e) {\r\n\t\t\ttry {\r\n\t\t\t\tconnection.rollback();\r\n\t\t\t} catch (SQLException e1) {\r\n\t\t\t\t// TODO Auto-generated catch block\r\n\t\t\t\te1.printStackTrace();\r\n\t\t\t}\r\n\t\t\t// TODO Auto-generated catch block\r\n\t\t\te.printStackTrace();\r\n\t\t}finally{\r\n\t\t\tDBUtils.release(null, preparedStatement, connection);\r\n\t\t}\r\n\t}", "private void editProduct() {\n\t\tif (!CartController.getInstance().isCartEmpty()) {\n\t\t\tSystem.out.println(\"Enter Product Id - \");\n\t\t\tint productId = getValidInteger(\"Enter Product Id -\");\n\t\t\twhile (!CartController.getInstance().isProductPresentInCart(\n\t\t\t\t\tproductId)) {\n\t\t\t\tSystem.out.println(\"Enter Valid Product Id - \");\n\t\t\t\tproductId = getValidInteger(\"Enter Product Id -\");\n\t\t\t}\n\t\t\tSystem.out.println(\"Enter new Quantity of Product\");\n\t\t\tint quantity = getValidInteger(\"Enter new Quantity of Product\");\n\t\t\tCartController.getInstance().editProductFromCart(productId,\n\t\t\t\t\tquantity);\n\t\t} else {\n\t\t\tDisplayOutput.getInstance().displayOutput(\n\t\t\t\t\t\"\\n-----Cart Is Empty----\\n\");\n\t\t}\n\t}", "public int updateProductDao(Product product) {\n\t\treturn 0;\n\t}", "public boolean update(Product p){\n ContentValues contvalu= new ContentValues();\n //contvalu.put(\"date_created\", \"datetime('now')\");\n contvalu.put(\"name\",p.getName());\n contvalu.put(\"feature\",p.getFeature());\n contvalu.put(\"price\",p.getPrice());\n return (cx.update(\"Product\",contvalu,\"id=\"+p.getId(),null))>0;\n//-/-update2-////\n\n\n }", "@RequestMapping(value = { \"/edit-product-{id}\" }, method = RequestMethod.POST)\r\n\tpublic String updateProduct(@Valid Product product, BindingResult result,\r\n\t\t\tModelMap model, @PathVariable int id) {\r\n\r\n\t\tif (result.hasErrors()) {\r\n\t\t\treturn \"registration\";\r\n\t\t}\r\n\r\n\t\tproductService.updateProduct(product);\r\n\r\n\t\tmodel.addAttribute(\"success\", \"Product \" + product.getName() + \" \"+ product.getId() + \" updated successfully\");\r\n\t\treturn \"registrationsuccess\";\r\n\t}", "@Override\n\tpublic Product update(Product entity) {\n\t\treturn null;\n\t}", "public void update(Product product) {\n\t\t\tproductDao.update(product);\n\t\t}", "@Override\n public int updateProduct(Product product) throws Exception\n {\n if(product == null)\n return 0;\n\n if(getProductById(product.getId(), true) == null)\n return 0;\n\n PreparedStatement query = _da.getCon().prepareStatement(\"UPDATE Products SET contactsKey = ?, categoryKey = ?, name = ?, purchasePrice = ?, salesPrice = ?, rentPrice = ?, countryOfOrigin = ?, minimumStock = ? \" +\n \"WHERE productId = ?\");\n\n query.setLong(1, product.getSupplier().getPhoneNo());\n query.setLong(2, product.getCategory().getCategoryId());\n query.setString(3, product.getName());\n query.setDouble(4, product.getPurchasePrice().doubleValue());\n query.setDouble(5, product.getSalesPrice().doubleValue());\n query.setDouble(6, product.getRentPrice().doubleValue());\n query.setString(7, product.getCountryOfOrigin());\n query.setLong(8, product.getMinimumStock());\n query.setLong(9, product.getId());\n _da.setSqlCommandText(query);\n int rowsAffected = _da.callCommand();\n\n DBProductData dbProductData = new DBProductData();\n dbProductData.deleteProductData(product.getId());\n for(ProductData data : product.getProductData())\n rowsAffected += dbProductData.insertProductData(product.getId(), data);\n\n return rowsAffected;\n }", "void setUpdatedProduct(ObservableList<MotorCycleProduct> productSelected, String updatedPartNumber, String updatedName, Integer updatedQuantity, Double updatedPrice, String updatedCategory, String updatedDate);", "@Override\r\n\tpublic void update(Product product) {\n\t\tproductMapper.updateByPrimaryKeySelective(product);\r\n\t}", "public void editProduct(int index, String description, String category, int quantity, int weight, int price, int stocknumber) {\t\t\n\t}", "int updateByPrimaryKey(Product record);", "@Override\r\n\tpublic int updateProductById(HashMap<String, Object> map) {\n\t\tProduct product = (Product) map.get(\"product\");\r\n\t\tdao.updateProductById(product);\r\n\t\tList<ProductOption> oldList = (List<ProductOption>) map.get(\"oldList\");\r\n\t\tfor(int idx=0; idx<oldList.size(); idx++){\r\n\t\t\toldList.get(idx).setProductId(product.getProductId());\r\n\t\t\tdao.updateProductOptionById(oldList.get(idx));\r\n\t\t}\r\n\t\tList<ProductOption> newList = (List<ProductOption>) map.get(\"newList\");\r\n\t\tif(map.get(\"newList\")!=null){\r\n\t\t\tfor(int idx=0; idx<newList.size(); idx++){\r\n\t\t\t\tnewList.get(idx).setProductId(product.getProductId());\r\n\t\t\t\toptionDao.insertOption(newList.get(idx));\r\n\t\t\t}\r\n\t\t}\r\n\t\tif( map.get(\"image\")!=null){\r\n\t\t\tProductDetailImage image = ((ProductDetailImage) map.get(\"image\"));\r\n\t\t\tdao.updateDetailImageById(image);\r\n\t\t}\r\n\t\treturn 0;\r\n\t}", "@Override\r\n\tpublic int editProductRaw(ProductRaw productRaw) {\n\t\treturn productRawDao.updateByPrimaryKey(productRaw);\r\n\t}", "public Product updateUser( Product product){\n\t\tif (!this.productrepository.exists(product.getId())) {\n\t\t\tthrow new IllegalArgumentException(\"product.with.id.noexist\");\n\t\t}\n\t\telse{\n\t\t\tproduct.setUpdatedDate(this.dateTime.getCurrentDateTime());\t\t\t\n\t\t\tproduct = this.productrepository.save(product);\n\t\t\t//result.setObject(product);\n\t\t}\n\t\treturn product;\n\t}", "@FXML\n\t private void updateProductPrice (ActionEvent actionEvent) throws SQLException, ClassNotFoundException {\n\t try {\n\t ProductDAO.updateProdPrice(prodIdText.getText(),newPriceText.getText());\n\t resultArea.setText(\"Price has been updated for, product id: \" + prodIdText.getText() + \"\\n\");\n\t } catch (SQLException e) {\n\t resultArea.setText(\"Problem occurred while updating price: \" + e);\n\t }\n\t }", "@Allow(Permission.UpdateCatalog)\n public Product updateProduct(UpdateProductInput input, DataFetchingEnvironment dfe) {\n RequestContext ctx = RequestContext.fromDataFetchingEnvironment(dfe);\n ProductEntity productEntity = this.productService.update(ctx, input);\n return BeanMapper.map(productEntity, Product.class);\n }", "@Override\n\tpublic int updateproduct(Product product) {\n\t\tConnection conn=null;\n\t\tPreparedStatement pst=null;\n\t\t\n\t\ttry {\n\t\t\tconn=DBUtils.getConnection();\n\t\t\tpst=conn.prepareStatement(\"update product set category_id=?, name=?,subtitle=?,main_image=?,sub_images=?, detail=?,price=?,stock=?,status=?,create_time=?,update_time=? where id=? \");\n\t\n\t\t\t pst.setInt(1, product.getCategory_id());\n\t\t\t pst.setString(2, product.getName());\n\t\t\t pst.setString(3, product.getSubtitle());\n\t\t\t pst.setString(4, product.getMain_image());\n\t\t\t pst.setString(5, product.getSub_images());\n\t\t\t pst.setString(6, product.getDetail());\n\t\t\t pst.setBigDecimal(7, product.getPrice());\n\t\t\t pst.setInt(8, product.getStock());\n\t\t\t pst.setInt(9, product.getStatus());\n\t\t\t pst.setDate(10, new Date(product.getCreate_time().getTime()));\n\t\t\t pst.setDate(11, new Date(product.getUpdate_time().getTime()));\n\t\t\t pst.setInt(12, product.getId());\n\t\n\t\t\treturn pst.executeUpdate();\n\t\t\t\n\t\t\t \n\t\t\t\n\t\t\t\n\t\t} catch (SQLException e) {\n\t\t\t// TODO Auto-generated catch block\n\t\t\te.printStackTrace();\n\t\t}finally {\n\t\t\ttry {\n\t\t\t\tDBUtils.Close(conn, pst);\n\t\t\t} catch (SQLException e) {\n\t\t\t\t// TODO Auto-generated catch block\n\t\t\t\te.printStackTrace();\n\t\t\t}\n\t\t}\n\t\treturn 0;\n\t}", "public void editProduct(String newProductId) {\n fill(\"#productId\").with(newProductId);\n fill(\"#name\").with(newProductId);\n fill(\"#description\").with(\"A nice product\");\n submit(\"#update\");\n }", "public int updateProduct(Product product){\n int rowsAffected = 0;\n connect();\n String sql = \"UPDATE productos SET descripcion = ?, presentacion = ?, cantidad = ?, \"\n + \"precio = ?, subtotal = ? WHERE id_producto = ?\";\n \n try{\n PreparedStatement ps = connect.prepareStatement(sql);\n ps.setString(1, product.getProductDescription());\n ps.setString(2, product.getProductPresentation());\n ps.setInt(3, product.getProductCuantity());\n ps.setFloat(4, product.getProductPrice());\n ps.setFloat(5, (product.getProductCuantity() * product.getProductPrice())); \n ps.setInt(6, Integer.parseInt(product.getProductId()));\n \n rowsAffected = ps.executeUpdate();\n connect.close();\n }catch(SQLException ex){\n ex.printStackTrace();\n }\n return rowsAffected;\n }", "public boolean updateProduct(int prod_id, Product new_product) \n\t{\n\t\treturn false;\n\t}", "public void handleModifyProducts()\n {\n FXMLLoader fxmlLoader = new FXMLLoader(getClass().getResource(\"/UI/Views/product.fxml\"));\n Parent root = null;\n try {\n root = (Parent) fxmlLoader.load();\n\n if (getProductToModify() != null)\n {\n // Get controller and configure controller settings\n ProductController productController = fxmlLoader.getController();\n productController.setModifyProducts(true);\n productController.setProductToModify(getProductToModify());\n productController.setInventory(inventory);\n productController.setHomeController(this);\n productController.updateParts();\n\n // Spin up product form\n Stage stage = new Stage();\n stage.initModality(Modality.APPLICATION_MODAL);\n stage.initStyle(StageStyle.DECORATED);\n stage.setTitle(\"Modify Products\");\n stage.setScene(new Scene(root));\n stage.show();\n }\n else\n {\n Alert alert = new Alert(Alert.AlertType.ERROR);\n alert.setTitle(\"Input Invalid\");\n alert.setHeaderText(\"No product was selected!\");\n alert.setContentText(\"Please select a product to modify from the product table!\");\n alert.show();\n }\n\n } catch (IOException e) {\n e.printStackTrace();\n }\n }", "public void update(CatalogProduct catalogProduct) {\n catalog_product_dao.update(catalogProduct);\n }", "public static boolean updateProductDetails(Product product) {\r\n\t\tdbConnect();\r\n\t\tPreparedStatement stmt = null;\r\n\t\tboolean saveStatus = true;\r\n\t\tfinal String UPDATE_PRODUCT = \"UPDATE product SET product_code='\" + product.getProductCode()\r\n\t\t\t\t+ \"', product_name=UPPER('\" + product.getProductName().replace(\"'\", \"\\\\'\") + \"'), product_unit=UPPER('\"\r\n\t\t\t\t+ product.getProductUnit() + \"'), product_description=UPPER('\"\r\n\t\t\t\t+ product.getProductDescription().replace(\"'\", \"\\\\'\") + \"'), product_purprice=\"\r\n\t\t\t\t+ product.getPriceForPurchase() + \", product_retprice=\" + product.getPriceForSales()\r\n\t\t\t\t+ \", product_quantity=\" + product.getStockQuantity() + \" WHERE product_code=\"\r\n\t\t\t\t+ product.getProductCode();\r\n\t\ttry {\r\n\t\t\tstmt = conn.prepareStatement(UPDATE_PRODUCT);\r\n\t\t\tstmt.executeUpdate();\r\n\t\t\tstmt.close();\r\n\t\t} catch (SQLException e) {\r\n\t\t\tsaveStatus = false;\r\n\t\t\te.printStackTrace();\r\n\t\t}\r\n\t\treturn saveStatus;\r\n\t}", "@RequestMapping(value=\"/manage_product_edit/{id}\", method=RequestMethod.GET)\n\tpublic ModelAndView editProduct(@PathVariable(\"id\")String id)\n\t{\n\t\tModelAndView mv = new ModelAndView(\"/admin/Product\");\n\t\tProduct prod =productDAO.getProductById(id);\n\t\tmv.addObject(\"product\",prod);\n\t\tmv.addObject(\"isEditing\",true);\n\t\t\n\t\treturn mv;\t\n\t}", "public String editProduct() {\n ConversationContext<Product> ctx = ProductController.newEditContext(products.getSelectedRow());\n ctx.setLabelWithKey(\"part_products\");\n ctx.setCallBack(editProductCallBack);\n getCurrentConversation().setNextContextSub(ctx);\n return ctx.view();\n }", "@PutMapping(path =\"/products\")\n public ResponseEntity<Product> updateProduct(@RequestBody Product product) throws URISyntaxException {\n if (product.getId() == null) {\n return createProduct(product);\n }\n log.debug(\"REST request to update Product : {}\", product);\n Product result = productService.save(product);\n return ResponseEntity.ok()\n .headers(HeaderUtil.createEntityUpdateAlert(ENTITY_NAME, result.getId().toString()))\n .body(result);\n }", "int updateByPrimaryKey(ItoProduct record);", "@Override\n\tpublic int update(ProductDTO dto) {\n\t\treturn 0;\n\t}", "private void updateProductHandler(RoutingContext routingContext) {\n\n HttpServerResponse httpServerResponse = routingContext.response();\n\n try {\n Long productId = Long.parseLong(routingContext.request().getParam(\"productId\"));\n Instant start = Instant.now();\n\n logger.info(\"Received the update request for the productid \" + productId + \" at \" + start);\n\n JsonObject productJson = routingContext.getBodyAsJson();\n Product inputProduct = new Product(productJson);\n inputProduct.setId(productId);\n\n logger.info(\"The input product \" + inputProduct.toString());\n\n // Create future for DB call\n Future<Product> productDBPromise =\n Future.future(promise -> callDBService(promise, inputProduct, DBAction.UPDATE));\n\n productDBPromise.setHandler(\n dbResponse -> {\n if (dbResponse.succeeded()) {\n\n Product updatedProduct = dbResponse.result();\n logger.info(\"The updated product is \" + updatedProduct.toString());\n Gson gson = new GsonBuilder().create();\n String json = gson.toJson(updatedProduct);\n\n Long duration = Duration.between(start, Instant.now()).toMillis();\n logger.info(\"Total time taken to process the request \" + duration + \" milli-seconds\");\n\n httpServerResponse.setStatusCode(SUCCESS_CODE);\n httpServerResponse.end(new JsonObject(json).encodePrettily());\n } else {\n logger.error(dbResponse.cause());\n httpServerResponse.setStatusCode(INTERNAL_SERVER_ERROR);\n httpServerResponse.end(\n \"Error due to \"\n + dbResponse.cause().getMessage()\n + \". Please try again after sometime.\");\n }\n });\n\n } catch (Exception e) {\n\n logger.error(e);\n httpServerResponse.setStatusCode(INTERNAL_SERVER_ERROR);\n httpServerResponse.end(\n \"Error due to \" + e.getMessage() + \". Please try again after sometime.\");\n }\n }", "public void update(GeneralProduct generalProduct) {\n general_product_dao.update(generalProduct);\n }", "public void update(SgfensPedidoProductoPk pk, SgfensPedidoProducto dto) throws SgfensPedidoProductoDaoException;", "@FXML\n\tpublic void updateProduct(ActionEvent event) {\n\t\tProduct productToUpdate = restaurant.returnProduct(LabelProductName.getText());\n\t\tif (!txtUpdateProductName.getText().equals(\"\") && !txtUpdateProductPrice.getText().equals(\"\")\n\t\t\t\t&& selectedIngredients.isEmpty() == false) {\n\n\t\t\ttry {\n\t\t\t\tproductToUpdate.setName(txtUpdateProductName.getText());\n\t\t\t\tproductToUpdate.setPrice(txtUpdateProductPrice.getText());\n\t\t\t\tproductToUpdate.setSize(ComboUpdateSize.getValue());\n\t\t\t\tproductToUpdate.setType(toProductType(ComboUpdateType.getValue()));\n\t\t\t\tproductToUpdate.setIngredients(toIngredient(selectedIngredients));\n\n\t\t\t\tproductToUpdate.setEditedByUser(restaurant.returnUser(empleadoUsername));\n\n\t\t\t\trestaurant.saveProductsData();\n\t\t\t\tproductOptions.clear();\n\t\t\t\tproductOptions.addAll(restaurant.getStringReferencedIdsProducts());\n\t\t\t\tDialog<String> dialog = createDialog();\n\t\t\t\tdialog.setContentText(\"Producto actualizado satisfactoriamente\");\n\t\t\t\tdialog.setTitle(\"Proceso Satisfactorio\");\n\t\t\t\tdialog.show();\n\n\t\t\t\ttxtUpdateProductName.setText(\"\");\n\t\t\t\ttxtUpdateProductPrice.setText(\"\");\n\t\t\t\tComboUpdateSize.setValue(\"\");\n\t\t\t\tComboUpdateType.setValue(\"\");\n\t\t\t\tChoiceUpdateIngredients.setValue(\"\");\n\t\t\t\tLabelProductName.setText(\"\");\n\n\t\t\t} catch (IOException e) {\n\t\t\t\te.printStackTrace();\n\t\t\t\tDialog<String> dialog = createDialog();\n\t\t\t\tdialog.setContentText(\"No se pudo guardar la actualización de los productos\");\n\t\t\t\tdialog.setTitle(\"Error al guardar datos\");\n\t\t\t\tdialog.show();\n\t\t\t}\n\n\t\t\ttry {\n\t\t\t\tFXMLLoader optionsFxml = new FXMLLoader(getClass().getResource(\"Options-window.fxml\"));\n\t\t\t\toptionsFxml.setController(this);\n\t\t\t\tParent opWindow = optionsFxml.load();\n\t\t\t\tmainPaneLogin.getChildren().setAll(opWindow);\n\t\t\t} catch (IOException e) {\n\t\t\t\te.printStackTrace();\n\t\t\t}\n\t\t} else {\n\t\t\tDialog<String> dialog = createDialog();\n\t\t\tdialog.setContentText(\"Todos los campos deben ser llenados\");\n\t\t\tdialog.setTitle(\"Error al guardar datos\");\n\t\t\tdialog.show();\n\t\t}\n\n\t}", "public void saveNewProduct(Product product) throws BackendException;", "@Override\n\tpublic void updateProductState(ProductState productState) {\n\t\tlogger.info(\"productStateServiceMong update productState with id : \" + productState.getId());\n\t\tproductStateDAO.updateProductState(productState);\n\n\t}", "public void updateProductDetails(Integer ProductID, String ProductCategory ) {\r\n\t\t\tSystem.out.println(\" *************from inside updateProductDetails()********************** \");\r\n\t\t\tTransaction tx = null;\r\n\t\t\ttry {\r\n\r\n\t\t\t\tsessionObj = HibernateUtil.buildSessionFactory().openSession();\r\n\t\t\t\ttx = sessionObj.beginTransaction();\r\n\t\t\t\t// update logic\r\n\r\n\t\t\t\tProduct product = (Product) sessionObj.get(Product.class, ProductID);\r\n\r\n\t\t\t\tproduct.setProductCategory(ProductCategory);\r\n\t\t\t\t\r\n\r\n\t\t\t\tsessionObj.update(product);// hibernate will form update query automatically\r\n\r\n\t\t\t\tSystem.out.println(\"update sucessfully...\"+product.getProductId()+\" \"+product.getProductName());\r\n\r\n\t\t\t\ttx.commit();// explictiy call the commit esure that auto commite should be false\r\n\t\t\t} catch (\r\n\r\n\t\t\tHibernateException e) {\r\n\t\t\t\tif (tx != null)\r\n\t\t\t\t\ttx.rollback();\r\n\t\t\t\te.printStackTrace();\r\n\t\t\t} finally {\r\n\t\t\t\tsessionObj.close();\r\n\t\t\t}\r\n\r\n\t\t}", "public void update(SpecificProduct specificProduct) {\n specific_product_dao.update(specificProduct);\n }", "public Product updateProduct(Product product) {\n\t\tSession session = sessionFactory.getCurrentSession();\r\n\t\tsession.update(product);\r\n\r\n\t\treturn product;\r\n\t}", "@PutMapping(\"/products\")\r\n\t@ApiOperation(value=\"Change a product details.\")\r\n\tpublic Product changeProduct(@RequestBody Product product) {\r\n\t\treturn productRepository.save(product);\r\n\t}", "@GetMapping(\"/edit\")\r\n\tpublic String showEdit(@RequestParam Integer id,Model model)\r\n\t{\r\n\t\tProduct p=service.getOneProduct(id);\r\n\t\tmodel.addAttribute(\"product\", p);\r\n\t\treturn \"ProductEdit\";\r\n\t}", "private void updateSoldProductInfo() { public static final String COL_SOLD_PRODUCT_CODE = \"sells_code\";\n// public static final String COL_SOLD_PRODUCT_SELL_ID = \"sells_id\";\n// public static final String COL_SOLD_PRODUCT_PRODUCT_ID = \"sells_product_id\";\n// public static final String COL_SOLD_PRODUCT_PRICE = \"product_price\";\n// public static final String COL_SOLD_PRODUCT_QUANTITY = \"quantity\";\n// public static final String COL_SOLD_PRODUCT_TOTAL_PRICE = \"total_price\";\n// public static final String COL_SOLD_PRODUCT_PENDING_STATUS = \"pending_status\";\n//\n\n for (ProductListModel product : products){\n soldProductInfo.storeSoldProductInfo(new SoldProductModel(\n printInfo.getInvoiceTv(),\n printInfo.getInvoiceTv(),\n product.getpCode(),\n product.getpPrice(),\n product.getpSelectQuantity(),\n printInfo.getTotalAmountTv(),\n paymentStatus+\"\"\n ));\n\n }\n }", "public void update(Product prod) {\n\t\tentities.put(prod.getName(), prod);\n\t\tif (prod.quantity==0) {\n\t\t\tavailableProducts.remove(prod.getName());\n\t\t}\n\t}", "public void update(Product item) {\n SQLiteDatabase database = this.getWritableDatabase();\n ContentValues values = new ContentValues();\n values.put(KEY_NAME, item.getName());\n values.put(KEY_URL, item.getURL());\n values.put(KEY_CURRENT, item.getCurrentPrice());\n values.put(KEY_CHANGE, item.getChange());\n values.put(KEY_DATE, item.getDate());\n values.put(KEY_INITIAL, item.getInitialPrice());\n database.update(PRODUCT_TABLE, values, KEY_ID + \" = ?\", new String[]{String.valueOf(item.getId())});\n database.close();\n }", "public static void updateProduct(Supermarket supermarket, Product product, String action) throws SQLException {\r\n\t\tPreparedStatement statement = null;\r\n\t\tString query;\r\n\t\ttry {\r\n\t\t\tif(action.equals(\"add\")) {\r\n\t\t\t\tquery = \"UPDATE CS_\"+supermarket.getSuper_name()+\" SET PRODUCT_EXIST=?, PRODUCT_PRICE=? WHERE PRODUCT_NAME=? and PRODUCT_COMPANY=?\";\r\n\t\t\t\tstatement = JdbcCommon.connection.prepareStatement(query);\r\n\t\t\t\tstatement.setBoolean(1, true);\r\n\t\t\t\tstatement.setDouble(2,product.getProduct_price());\r\n\t\t\t\tstatement.setString(3, product.getProduct_name());\r\n\t\t\t\tstatement.setString(4, product.getProduct_company());\r\n\t\t\t\tstatement.executeUpdate();\t\r\n\t\t\t}\r\n\t\t\telse {\r\n\t\t\t\tquery = \"UPDATE CS_\"+supermarket.getSuper_name()+\" SET PRODUCT_EXIST=?, PRODUCT_PRICE=? WHERE PRODUCT_NAME=? and PRODUCT_COMPANY=?\";\r\n\t\t\t\tstatement = JdbcCommon.connection.prepareStatement(query);\r\n\t\t\t\tstatement.setBoolean(1, false);\r\n\t\t\t\tstatement.setDouble(2,0);\r\n\t\t\t\tstatement.setString(3, product.getProduct_name());\r\n\t\t\t\tstatement.setString(4, product.getProduct_company());\r\n\t\t\t\tstatement.executeUpdate();\t\r\n\t\t\t}\r\n\t\t} catch (SQLException e) {e.printStackTrace();}\r\n\t\tstatement.close();\r\n\t}", "@Override\n public void updateProduct(TradingQuote tradingQuote) {\n }", "public int updateProduct(Product product)\n {\n SQLiteDatabase db = this.database.getWritableDatabase();\n\n ContentValues values = new ContentValues();\n\n values.put(ShoppingListTable.KEY_TPNB, product.getTPNB());\n values.put(ShoppingListTable.KEY_NAME, product.getName());\n values.put(ShoppingListTable.KEY_DESCRIPTION, product.getDescription());\n values.put(ShoppingListTable.KEY_COST, product.getCost());\n values.put(ShoppingListTable.KEY_QUANTITY, product.getQuantity());\n values.put(ShoppingListTable.KEY_SUPER_DEPARTMENT, product.getSuperDepartment());\n values.put(ShoppingListTable.KEY_DEPARTMENT, product.getDepartment());\n values.put(ShoppingListTable.KEY_IMAGE_URL, product.getImageURL());\n values.put(ShoppingListTable.KEY_CHECKED, product.isChecked());\n values.put(ShoppingListTable.KEY_AMOUNT, product.getAmount());\n values.put(ShoppingListTable.KEY_POSITION, product.getPosition());\n\n // Sets up the WHERE condition of the SQL statement\n String condition = String.format(\" %s = ?\", ShoppingListTable.KEY_TPNB);\n\n // Stores the values of the WHERE condition\n String[] conditionArgs = { String.valueOf(product.getTPNB()) };\n\n int rows = db.update(ShoppingListTable.TABLE_NAME, values, condition, conditionArgs);\n\n return rows;\n }", "Product updateProductDetails(ProductDTO productDTO, Authentication authentication);", "public void saveProduct(Product product);", "public void updateProducts()\n {\n ObservableList<Product> inventoryProducts = this.inventory.getAllProducts();\n\n // Configure product table and bind with inventory products\n productIDColumn.setCellValueFactory(new PropertyValueFactory<Product, String>(\"id\"));\n productNameColumn.setCellValueFactory(new PropertyValueFactory<Product, String>(\"name\"));\n productInventoryColumn.setCellValueFactory(new PropertyValueFactory<Product, String>(\"stock\"));\n productPriceColumn.setCellValueFactory(new PropertyValueFactory<Product, String>(\"price\"));\n\n productTable.setItems(inventoryProducts);\n // Unselect parts in table after part is updated\n productTable.getSelectionModel().clearSelection();\n productTable.getSelectionModel().setSelectionMode(SelectionMode.MULTIPLE);\n }", "@Test\n public void saveProduct_should_update_product_with_new_product_fields() {\n final Product product = productStorage.saveProduct(new Product(1, \"Oranges\", 150, 3));\n\n //get product with id = 1\n final Product updatedProduct = productStorage.getProduct(1);\n\n assertThat(product, sameInstance(updatedProduct));\n }", "private void saveChanges() {\n product.setName(productName);\n product.setPrice(price);\n\n viewModel.updateProduct(product, new OnAsyncEventListener() {\n @Override\n public void onSuccess() {\n Log.d(TAG, \"updateProduct: success\");\n Intent intent = new Intent(EditProductActivity.this, MainActivity.class);\n startActivity(intent);\n }\n\n @Override\n public void onFailure(Exception e) {\n Log.d(TAG, \"updateProduct: failure\", e);\n final androidx.appcompat.app.AlertDialog alertDialog = new androidx.appcompat.app.AlertDialog.Builder(EditProductActivity.this).create();\n alertDialog.setTitle(\"Can not save\");\n alertDialog.setCancelable(true);\n alertDialog.setMessage(\"Cannot edit this product\");\n alertDialog.setButton(androidx.appcompat.app.AlertDialog.BUTTON_NEGATIVE, \"ok\", (dialog, which) -> alertDialog.dismiss());\n alertDialog.show();\n }\n });\n }", "protected abstract Product modifyProduct(ProductApi api,\n Product modifyReq) throws RestApiException;", "int updateByPrimaryKey(Disproduct record);", "public Products updateProducts(Products product) {\n\t\treturn productsRepo.save(product);\n\t}", "@Test\n public void testUpdateProductShouldSuccessWhenProductNotUpdateName() throws Exception {\n product.setName(productRequest.getName());\n when(productRepository.findOne(product.getId())).thenReturn(product);\n when(productRepository.save(product)).thenReturn(product);\n\n Map<String, Object> jsonMap = new HashMap<>();\n jsonMap.put(\"$.url\", productRequest.getUrl());\n testResponseData(RequestInfo.builder()\n .request(put(PRODUCT_DETAIL_ENDPOINT, product.getId()))\n .token(adminToken)\n .body(productRequest)\n .httpStatus(HttpStatus.OK)\n .jsonMap(jsonMap)\n .build());\n }", "private boolean UpdateProduct(String code, String name , String brand , String price , String quantity) {\n DatabaseReference dR = FirebaseDatabase.getInstance().getReference().child(code);\n\n //updating artist\n Information information = new Information(code, name ,brand ,price ,quantity);\n dR.setValue(information);\n Toast.makeText(getApplicationContext(), \"Product Updated\", Toast.LENGTH_LONG).show();\n return true;\n }", "@Override\n\tpublic void update(ExportProduct exportProduct) {\n\t\t\n\t}", "public void updateProductByRest(long id, HttpServletRequest request) {\n // set URL\n String url = String.format(\"%s://%s:%d/products/\" + id, request.getScheme(), request.getServerName(), request.getServerPort());\n // execute rest api update product request using RestTemplate.put method\n HttpEntity<Product> entity = getHttpEntity(request);\n RestTemplate restTemplate = new RestTemplate();\n restTemplate.put(url, entity, id);\n }", "public void updateProductById(Product p, int id) {\n\t\tp.setId(id);\r\n\t\tp.setCreateDate(new java.sql.Date(new Date().getTime()));\r\n\t\tproductMapper.updateProductById(p);\r\n\t}", "@Override\n\t@Transactional\n\tpublic Boolean updateImportPro(List<FormProduct> formProduct, int impId) {\n\t\treturn importDao.updateImportPro(formProduct, impId);\n\t}", "@Override\n\tpublic boolean editProduct(ProductDTO product) throws ProductException {\n\t\t\n\t\t// if the productID is not valid then it will throw the Exception\n\t\tif (product.getProductid() == null) {\n\t\t\tthrow new InValidIdException(\"Incorrect Id \");\n\t\t} \n\t\t\n\t\t// if the productID is valid then it will edit the product\n\t\t\n\t\telse {\n\t\t\tProduct pro = ProductUtil.convertToProduct(product);\n\t\t\tProductStore.map.put(pro.getProductid(), pro);\n\t\t\treturn true;\n\n\t\t}\n\n\t}", "public Producto actualizar(Producto producto) throws IWDaoException;", "@PutMapping(value = \"/{id}\")\n public ResponseEntity<ProductDTO> updateProduct(@PathVariable(\"id\") Integer id, @Valid @RequestBody ProductDTO productDTO) {\n ProductDTO productOld = productService.findById(id);\n productDTO.setId(productOld.getId());\n productService.save(productDTO);\n return ResponseEntity.ok().body(productDTO);\n }", "@Override\n\tpublic boolean updateRecord(Products productInfoBean) {\n\t\treturn dao.updateRecord(productInfoBean);\n\t}" ]
[ "0.7920602", "0.7764814", "0.76549494", "0.7582181", "0.7580777", "0.75737137", "0.7572651", "0.75572646", "0.75118893", "0.748919", "0.7486551", "0.7466908", "0.741303", "0.72931564", "0.7266725", "0.7244836", "0.7153725", "0.71360266", "0.71245307", "0.7111777", "0.710591", "0.7104848", "0.7102698", "0.7096998", "0.70961773", "0.70682967", "0.70612484", "0.7029525", "0.702266", "0.7017779", "0.69794536", "0.6969721", "0.6918729", "0.68793595", "0.6870161", "0.6862886", "0.68115544", "0.6806584", "0.679888", "0.6786014", "0.67593706", "0.67316574", "0.667808", "0.6658842", "0.665341", "0.6647015", "0.6630026", "0.6622719", "0.6614611", "0.6612411", "0.6600369", "0.6588652", "0.6582378", "0.6579531", "0.65768737", "0.65763783", "0.6572603", "0.6566245", "0.65591484", "0.6548064", "0.6541063", "0.6523713", "0.6511051", "0.6496483", "0.6493989", "0.6493364", "0.6469169", "0.64611727", "0.6454374", "0.6447446", "0.6442092", "0.6427036", "0.64129686", "0.64013106", "0.6400612", "0.63916254", "0.6386752", "0.63809353", "0.6379863", "0.6378739", "0.6370978", "0.63657373", "0.63635534", "0.6362043", "0.6359684", "0.6353219", "0.6344316", "0.63334584", "0.6332381", "0.63123095", "0.630897", "0.6289799", "0.62761724", "0.6273187", "0.62714744", "0.6268364", "0.6264449", "0.6257924", "0.62387234", "0.622627", "0.62197816" ]
0.0
-1
It allows the admin to add an admin account
public String[] addAdmin(Session session) throws RemoteException { System.out.println("Server model invokes addAdmin() method"); return null; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void addAdmin(Admin admin);", "public void add_admin(String admin_id, String admin_name, String admin_address, String admin_designation,\n\t\t\t double salary, String contact, boolean status_vacancy, String password,String admin_project_key)\n {\n\t\t\n \tadm_list.insert(new Admin(admin_id,admin_name,admin_address,admin_designation, salary,contact,status_vacancy,password,admin_project_key));\n \twrite_adm_file();\n }", "@Override\r\n\tpublic String addAdmin(Admin admin) {\n\t\treturn adminDAO.addAdmin(admin);\r\n\t}", "public void createAdmin()\r\n\t{\r\n\t\tSystem.out.println(\"Administrator account not exist, please create the administrator account by setting up a password for it.\");\r\n\t\tString password=\"\",repassword=\"\";\r\n\t\tboolean flag=false;\r\n\t\twhile(!flag)\r\n\t\t{\r\n\t\t\tboolean validpassword=false;\r\n\t\t\twhile(!validpassword)\r\n\t\t\t{\r\n\t\t\t\tSystem.out.print(\"Please enter the password: \");\r\n\t\t\t\tpassword=sc.nextLine();\r\n\t\t\t\tvalidpassword=a.validitycheck(password);\r\n\t\t\t\tif(!validpassword)\r\n\t\t\t\t{\r\n\t\t\t\t\tSystem.out.println(\"Your password has to fulfil: at least 1 small letter, 1 capital letter, 1 digit!\");\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tSystem.out.print(\"Please re-enter the password: \");\r\n\t\t\trepassword=sc.nextLine();\r\n\t\t\tflag=a.matchingpasswords(password,repassword);\r\n\t\t\tif(!flag)\r\n\t\t\t{\r\n\t\t\t\tSystem.out.print(\"Password not match! \");\r\n\t\t\t}\r\n\t\t}\r\n\t\tString hash_password=hashfunction(password); \r\n\t\tString last_login=java.time.LocalDate.now().toString();\r\n\t\tuser_records.add(new User(\"administrator\",hash_password,\"administrator\",\"\",0,0,last_login,false));\r\n\t\tSystem.out.println(\"Administrator account created successfully!\");\r\n\t}", "private void addAdmin() {\n try (Connection connection = this.getConnection();\n Statement st = connection.createStatement();\n ResultSet rs = st.executeQuery(INIT.GET_ADMIN.toString())) {\n if (!rs.next()) {\n int address_id = 0;\n st.executeUpdate(INIT.ADD_ADMIN_ADDRESS.toString(), Statement.RETURN_GENERATED_KEYS);\n try (ResultSet rs1 = st.getGeneratedKeys()) {\n if (rs1.next()) {\n address_id = rs1.getInt(1);\n }\n }\n try (PreparedStatement ps = connection.prepareStatement(INIT.ADD_ADMIN.toString())) {\n ps.setInt(1, address_id);\n ps.execute();\n }\n }\n } catch (SQLException e) {\n logger.error(e.getMessage(), e);\n }\n\n }", "public static void creaAdmin(Admin admin) {\n\t\ttry {\n\t\t\tRequestContent rp = new RequestContent();\n\t\t\trp.type = RequestType.CREATE_USER;\n\t\t\trp.userType = UserType.ADMIN;\n\t\t\trp.parameters = new Object[] { admin };\n\t\t\tsend(rp);\n\t\t} catch (Exception e) {\n\n\t\t}\n\t}", "public void addAccount(String user, String password);", "@Override\n\tpublic int addAccount(AccountUser au) {\n\t\tau.setName(au.getUsername());\n\t\tau.setStatus(1);\n\t\tau.setPwd(\"666666\");\n\t\tau.setSalt(CommTool.getSalt());\n\t\tau.setPwd(PasswordUtil.generate(au.getPwd(), au.getSalt()));\n\t\treturn auMapper.addAccount(au);\n\t}", "public void insert1(Admin a) {\n\t\ttemplate.update(\"insert into admin values(?,?)\", a.getEmail(),a.getPassword());\n\t}", "@ListenEvent(event = AddAdminMemberEvent.class)\n public void onAddAccountAdmin(AddAdminMemberEvent evt) throws BusinessException {\n\n logger.info(\"预置会议系统报表授权成功!\" + evt.getMember().getId());\n }", "@FXML\n\tvoid createAdministratorAccount(ActionEvent event) throws IOException,Exception {\n\t\tString adEmail = emailAdmin.getText();\n\t\tString adPassword = passwordAdmin.getText(); \n\t\t\n\t\tif(adEmail.isBlank()) {\n\t\t\tInfoBox.infoBoxW(\"A valid email must be provided\",\"Missing email\",\"Missing information\");\n\t\t}else {\n\t\t\tif(adPassword.isBlank()) {\n\t\t\t\tInfoBox.infoBoxW(\"A valid password must be provided\",\"Missing password\",\"Missing information\");\n\t\t\t}else {\n\t\t\t\tif(!adEmail.matches(\"^([a-zA-Z0-9_\\\\-\\\\.]+)@([a-zA-Z0-9_\\\\-\\\\.]+)\\\\.([a-zA-Z]{2,5})$\")) {\n\t\t\t\t\tInfoBox.infoBoxW(\"An email with valid syntax expected\",\"Email syntax invalid\",\"Invalid syntax\");\n\t\t\t\t}else {\n\t\t\t\t\tif(!adPassword.matches(\"([a-z]|[A-Z]|[0-9])*\")){\n\t\t\t\t\t\tInfoBox.infoBoxW(\"A password with valid syntax expected\",\"Password syntax invalid\",\"Invalid syntax\");\n\t\t\t\t\t}\n\t\t\t\t\telse {\n\t\t\t\t\t\tUserFacade uf = new UserFacade();\n\t\t\t\t\t\tboolean isDone = uf.registerAdministrator(adEmail, HashPassword.hashPassword(adPassword));\n\t\t\t\t\t\tif(isDone) {\n\t\t\t\t\t\t\tInfoBox.infoBoxI(\"Admin created\", \"Admin created\", \"Admin Created\");\n\t\t\t\t\t\t\tTheWerewolvesOfMillersHollow.setScene(getClass().getResource(\"../view/AdministratorMenuView.fxml\"));\n\t\t\t\t\t\t}else {\n\t\t\t\t\t\t\tInfoBox.infoBoxE(\"Creation failed, retry later\",\"Creation failed\",\"Creation Error\");\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}", "public static void addAdmin(Admin adminObj) {\r\n adminMap.put(adminObj.getEmail(), adminObj);\r\n }", "public void addUserBtn(){\n\t\t\n\t\t// TODO: ERROR CHECK\n\t\t\n\t\tUserEntry user = new UserEntry(nameTF.getText(), (String)usertypeCB.getValue(), emailTF.getText());\n\t\tAdminController.userEntryList.add(user);\n\t\t\n\t\t\n\t\t// Create a UserEntry and add it to the observable list\n\t\tAdminController.userList.add(user);\t\t\n\t\t\n\t //AdminController.adminTV.setItems(AdminController.userList);\n\t\t\n\t\t//Close current stage\n\t\tAdminController.addUserStage.close();\n\t\t\n\t}", "void userAddByAdmin(AdminUserAddDTO adminUserAddDTO) throws RecordExistException;", "public void createAccount(){\n System.out.println(\"vi skal starte \");\n }", "@Override\r\n\tpublic boolean getAddAdmin(Admins ad) {\n\t\treturn adi.addAdmin(ad);\r\n\t}", "public void addAdministrator(Administrator admin) {\n\t\ttry {\n\t\t\tConnection conn = DbConnections.getConnection(DbConnections.ConnectionType.POSTGRESQL);\n\t\t\tPreparedStatement ps = conn.prepareStatement(\n\t\t\t\t\t\"insert into public.administrator(id_user, nume, prenume) values(?,?,?)\", Statement.RETURN_GENERATED_KEYS);\n\t\t\tps.setInt(1, admin.getIdUser());\n\t\t\tps.setString(2, admin.getNume());\n\t\t\tps.setString(3, admin.getPrenume());\n\n\t\t\tint affectedRows = ps.executeUpdate();\n\t\t\tResultSet rs = ps.getGeneratedKeys();\n\t\t\tif (rs.next()) {\n\t\t\t\tadmin.setId(rs.getInt(1));\n\t\t\t}\n\t\t\tDbConnections.closeConnection(conn);\n\t\t} catch (SQLException e) {\n\t\t\te.printStackTrace();\n\t\t}\n\n\t}", "@Test\n\tpublic void testAdminCreate() {\n\t\tAccount acc1 = new Account(00000, \"ADMIN\", true, 1000.00, 0, false);\n\t\taccounts.add(acc1);\n\n\t\ttransactions.add(0, new Transaction(10, \"ADMIN\", 00000, 0, \"A\"));\n\t\ttransactions.add(1, new Transaction(05, \"new acc\", 00001, 100.00, \"A\"));\n\t\ttransactions.add(2, new Transaction(00, \"ADMIN\", 00000, 0, \"A\"));\n\n\t\ttransHandler = new TransactionHandler(accounts, transactions);\n\t\toutput = transHandler.HandleTransactions();\n\n\t\tif (outContent.toString().contains(\"Account Created\")) {\n\t\t\ttestResult = true;\n\t\t} else {\n\t\t\ttestResult = false;\n\t\t}\n\n\t\tassertTrue(\"unable to create account as admin\", testResult);\n\t}", "public Admin addAdmin(Admin admin) {\n\t\tadmin.setPassword(encoder.encode(admin.getPassword()));\n\t\treturn adminRepository.save(admin);\n\t}", "@Override\n public ResultMessage createNewAdmin(NewAdminCommand command) {\n String currentAdmin = command.getCurrentAdmin();\n if (!adminDao.hasHighestAuthority(currentAdmin))\n return ResultMessage.failure(\"Permission denied\");\n\n // Permission passed\n if (adminDao.addAdmin(command.getNewAdminName(),\n encryptor.encrypt(command.getPassword(), command.getNewAdminName()))) {\n log.info(\"New administrator is created successfully\");\n return ResultMessage.success();\n }\n\n return ResultMessage.failure();\n }", "void accountSet(boolean admin, String username, String password, String fName, String lName, int accountId);", "@Test\n\tpublic void testCreateAdminAccountSuccessfully() {\n\t\tassertEquals(2, adminAccountService.getAllAdminAccounts().size());\n\n\t\tString username = \"newUsername\";\n\t\tAdminAccount user = null;\n\t\ttry {\n\t\t\tuser = adminAccountService.createAdminAccount(username, PASSWORD1, NAME1);\n\t\t} catch (InvalidInputException e) {\n\t\t\tfail();\n\t\t}\n\t\tassertNotNull(user);\n\t\tassertEquals(username, user.getUsername());\n\t\tassertEquals(PASSWORD1, user.getPassword());\n\t\tassertEquals(NAME1, user.getName());\n\t}", "public String add() {\r\n\t\tuserAdd = new User();\r\n\t\treturn \"add\";\r\n\t}", "String addAccount(UserInfo userInfo);", "AdminConsole createAdminConsole();", "private static void createAdmin(SecurityService service,\n\t\t\tString securityDomainId, Actor requestingActor, Actor adminActor,\n\t\t\tString groupId) {\n\t\tBooleanResultResponse boolResp = service.createAceActionByActorIdByRoleId(securityDomainId, adminActor, \"USRGADM\", groupId, requestingActor);\n\t\tSystem.out.println(\"after inserting admins>>>>\" + boolResp);\n\t}", "@Override\r\n\tpublic boolean addAdmin(Admin admin) {\n\t\tSession session=sessionFactory.openSession();\r\n\t\tTransaction tx=session.beginTransaction();\r\n\t\tsession.persist(admin);\r\n\t\ttx.commit();\r\n\t\tsession.close();\r\n\t\treturn true;\r\n\t}", "public void addUser(int id, String name, String email, boolean isAdmin) {\n SQLiteDatabase db = this.getWritableDatabase();\n\n ContentValues values = new ContentValues();\n values.put(KEY_ID, id);\n values.put(KEY_HOST, host);\n values.put(KEY_NAME, name);\n values.put(KEY_EMAIL, email);\n values.put(KEY_IS_ADMIN, isAdmin);\n\n long insertedId = db.insert(TABLE_USER, null, values);\n db.close(); // Closing database connection\n }", "private void createAccount()\n {\n // check for blank or invalid inputs\n if (Utils.isEmpty(edtFullName))\n {\n edtFullName.setError(\"Please enter your full name.\");\n return;\n }\n\n if (Utils.isEmpty(edtEmail) || !Utils.isValidEmail(edtEmail.getText().toString()))\n {\n edtEmail.setError(\"Please enter a valid email.\");\n return;\n }\n\n if (Utils.isEmpty(edtPassword))\n {\n edtPassword.setError(\"Please enter a valid password.\");\n return;\n }\n\n // check for existing user\n AppDataBase database = AppDataBase.getAppDataBase(this);\n User user = database.userDao().findByEmail(edtEmail.getText().toString());\n\n if (user != null)\n {\n edtEmail.setError(\"Email already registered.\");\n return;\n }\n\n user = new User();\n user.setId(database.userDao().findMaxId() + 1);\n user.setFullName(edtFullName.getText().toString());\n user.setEmail(edtEmail.getText().toString());\n user.setPassword(edtPassword.getText().toString());\n\n database.userDao().insert(user);\n\n Intent intent = new Intent(this, LoginActivity.class);\n intent.putExtra(\"user\", user);\n startActivity(intent);\n }", "java.lang.String getNewAdmin();", "private void registerUser()\n {\n /*AuthService.createAccount takes a Consumer<Boolean> where the result will be true if the user successfully logged in, or false otherwise*/\n authService.createAccount(entryService.extractText(namedFields), result -> {\n if (result.isEmpty()) {\n startActivity(new Intent(this, DashboardActivity.class));\n } else {\n makeToast(result);\n formContainer.setAlpha(1f);\n progressContainer.setVisibility(View.GONE);\n progressContainer.setOnClickListener(null);\n }\n });\n }", "@Override\n\tpublic long add(Administrateur admin) throws Exception {\n\t\topenCurrentSessionWithTransaction();\n\t\tgetCurrentSession().save(admin);\n\t\tcloseCurrentSessionWithTransaction();\n\t\treturn admin.getIdAdministrateur();\n\t}", "@Override\n\tpublic Admin createAdmin(Admin admin) {\n\t\treturn ar.save(admin);\n\t}", "public void addUser(String fullName,String loginName,String password,boolean isAdmin) throws IOException {\n userManager.addUser(fullName, loginName, password, isAdmin);\n userManager.emptyLists();\n userManager.fillLists();\n AdminMainViewController.emptyStaticLists();\n AdminMainViewController.adminsObservableList.addAll(userManager.getAdminsList());\n AdminMainViewController.usersObservableList.addAll(userManager.getUsersList());\n }", "private void loginAsAdmin() {\n vinyardApp.navigateToUrl(\"http://localhost:8080\");\n vinyardApp.fillUsername(\"admin\");\n vinyardApp.fillPassord(\"321\");\n vinyardApp.clickSubmitButton();\n }", "public boolean addAccount() {\r\n String update = \"INSERT INTO LOGIN VALUES('\" + this.username + \"', '\" + new MD5().md5(this.password) + \"', '\" + this.codeID + \"', N'\" + this.fullname + \"')\";\r\n return model.ConnectToSql.update(update);\r\n }", "public void addUser() throws AccountException {\n System.out.println(\"----------------- Add User -----------------\");\n System.out.print(\"Account: \");\n String username = this.checkUsername(); // Call method to check input of username\n\n System.out.print(\"Password: \");\n String password = this.checkEmpty(\"Password\"); // Call method to check input of password\n\n System.out.print(\"Name: \");\n String name = this.checkEmpty(\"Name\"); // Call method to check input of name\n\n System.out.print(\"Phone: \");\n String phone = this.checkPhone(); // Call method to check nput of phone\n\n System.out.print(\"Email: \");\n String email = this.checkEmail(); // Call method to check input of email\n\n System.out.print(\"Address: \");\n String address = this.checkEmpty(\"Address\"); // Call method to check input of address\n\n System.out.print(\"DOB: \");\n Date dob = this.checkDate(); // Call method to check input of dob\n\n // Add new user and print success if created\n this.addUser(username, password, name, phone, email, address, dob);\n System.out.println(\"Create account success.\");\n }", "@Override\r\n\tpublic int insertAdmin(AdminAdministrator adminAdministrator) {\n\t\treturn administratorDao.insert(adminAdministrator);\r\n\t}", "void add(User user) throws AccessControlException;", "@RolesAllowed(RoleEnum.ROLE_ADMIN)\n\tpublic Integer saveAdmin(Admin admin);", "private Admin createNewAdmin(AdminRequest adminRequest, User user, PersonalData personalData) {\n\n Admin newAdmin = new Admin();\n newAdmin.setPersonalData(personalData);\n newAdmin.setUser(user);\n\n newAdmin.setEnabled(true);\n newAdmin.setDeleted(false);\n\n // Save on DB\n return saveAdmin(newAdmin);\n }", "private void createAdmin(String book_email,String book_phone,String book_title) {\n // TODO\n // In real apps this userId should be fetched\n // by implementing firebase auth\n if (TextUtils.isEmpty(bookId)) {\n bookId = mFirebaseDatabase.push().getKey();\n }\n\n Book book = new Book(book_email,book_phone,book_title);\n\n mFirebaseDatabase.child(bookId).setValue(book);\n\n addUserChangeListener();\n }", "@FXML\n\tpublic void buttonSignUpAdministrator(ActionEvent event) throws IOException {\n\t\tFXMLLoader addUserfxml = new FXMLLoader(getClass().getResource(\"Add-User.fxml\"));\n\t\taddUserfxml.setController(this);\n\t\tParent addUser = addUserfxml.load();\n\t\tmainPaneLogin.getChildren().setAll(addUser);\n\n\t\ttxtUserUsername.setText(\"ADMINISTRATOR\");\n\t\ttxtUserUsername.setEditable(false);\n\t}", "private void adminLogin() {\n\t\tdriver.get(loginUrl);\r\n\t\t// fill the form\r\n\t\tdriver.findElement(By.name(\"username\")).sendKeys(USERNAME);\r\n\t\tdriver.findElement(By.name(\"password\")).sendKeys(PASSWORD);\r\n\t\t// submit login\r\n\t\tdriver.findElement(By.name(\"btn_submit\")).click();\r\n\t}", "boolean addUser(int employeeId, String name, String password, String role);", "public Admin createAdmin(){\n\t\ttry {\n\t\t\treturn conn.getAdmin();\n\t\t} catch (Exception e) {\n\t\t\te.printStackTrace();\n\t\t\tthrow new RuntimeException(e);\n\t\t}\n\t}", "public void addAccount() {\n\t\t\n\t\ttry {\n\t\t\tlog.log(Level.INFO, \"Please enter name\");\n String custName = scan.next();\n validate.checkName(custName);\n \t\tlog.log(Level.INFO, \"Select Account Type: \\n 1 for Savings \\n 2 for Current \\n 3 for FD \\n 4 for DEMAT\");\n\t\t\tint bankAccType = Integer.parseInt(scan.next());\n\t\t\tvalidate.checkAccType(bankAccType);\n\t\t\tlog.log(Level.INFO, \"Please Enter your Aadar Card Number\");\n\t\t\tString aadarNumber = scan.next();\n\t\t\tlog.log(Level.INFO, \"Please Enter Phone Number: \");\n\t\t\tString custMobileNo = scan.next();\n\t\t\tvalidate.checkPhoneNum(custMobileNo);\n\t\t\tlog.log(Level.INFO, \"Please Enter Customer Email Id: \");\n\t\t\tString custEmail = scan.next();\n\t\t\tvalidate.checkEmail(custEmail);\n\t\t\tbankop.add(accountNumber, custName, bankAccType, custMobileNo, custEmail, aadarNumber);\n\t\t\taccountNumber();\n\t\t\n\t\t} catch (AccountDetailsException message) {\n\t\t\tlog.log(Level.INFO, message.getMessage()); \n }\n\n\t}", "public static void ulogujSeKaoAdmin() {\r\n\t\tprikazIProveraSifre(-2, 'a');\r\n\t}", "@Override\n protected String requiredPostPermission() {\n return \"admin\";\n }", "public void addUser() {\n\t\tSystem.out.println(\"com.zzu.yhl.a_jdk addUser\");\r\n\t}", "public static void main(String[] args) {\n \n \n \n Admin admin = new Admin();\n admin.setFirstName(\"Admin\");\n admin.setLastName(\"Admin\");\n admin.setEmail(\"[email protected]\");\n admin.setGender(\"Male\");\n admin.setUserName(\"admin\");\n admin.setPassword(\"7110eda4d09e062aa5e4a390b0a572ac0d2c0220\");\n admin.setPhoneNumber(\"514-999-0000\");\n //cl.setClientCard(new ClientCard(\"12-34-56\", DateTime.now(),cl));\n admin.saveUser();\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n }", "public void AddToAccountInfo();", "public boolean register(Admin admin) {\n\t\t\n\t\treturn adminDao.insert(admin);\n\t}", "BaseUser createAdminUser(Application application);", "@Override\n\tpublic boolean addAccount(Account account) {\n\t\taccount.setStatus(-1);\n\t\t//String passwd = new UU\n\t\treturn accountDAO.addAccount(account);\n\t}", "public void createUserAccount(UserAccount account);", "private void createNewAccount() {\n\n // if user has not provided valid data, do not create an account and return from method\n if (!validateData()) {\n return;\n }\n\n // If flag value is false, that means email provided by user doesn't exists in database\n // so initialize the loader to create a new account\n if (!mEmailExistsFlag) {\n getLoaderManager().initLoader(CREATE_NEW_ACCOUNT_LOADER_ID, null, this);\n } else {\n // If flag is true, that means email provided by user already exists in database\n // so restart the loader and allow user to enter new email address for account\n getLoaderManager().restartLoader(CREATE_NEW_ACCOUNT_LOADER_ID, null, this);\n }\n\n }", "public void CreateAdminUser (String administratorUserName, String administratorPassword, \n String administratorFirstName, String administratorLastName, String administratorEmail) {\n User user = identityService.newUser(administratorUserName);\n user.setFirstName(administratorFirstName);\n user.setLastName(administratorLastName);\n user.setPassword(administratorPassword);\n user.setEmail(administratorEmail);\n identityService.saveUser(user);\n\n LOGGER.info(\"Creating the camunda admin group\");\n // create Administrator Group\n if(identityService.createGroupQuery().groupId(Groups.CAMUNDA_ADMIN).count() == 0) {\n Group camundaAdminGroup = identityService.newGroup(Groups.CAMUNDA_ADMIN);\n camundaAdminGroup.setName(\"camunda BPM Administrators\");\n camundaAdminGroup.setType(Groups.GROUP_TYPE_SYSTEM);\n identityService.saveGroup(camundaAdminGroup);\n }\n\n LOGGER.info(\"Creating Admin group authrorizations for all built-in resources\");\n // create Admin authorizations on all built-in resources\n for (Resource resource : Resources.values()) {\n if(authorizationService.createAuthorizationQuery().groupIdIn(Groups.CAMUNDA_ADMIN).resourceType(resource).resourceId(ANY).count() == 0) {\n AuthorizationEntity userAdminAuth = new AuthorizationEntity(AUTH_TYPE_GRANT);\n userAdminAuth.setGroupId(Groups.CAMUNDA_ADMIN);\n userAdminAuth.setResource(resource);\n userAdminAuth.setResourceId(ANY);\n userAdminAuth.addPermission(ALL);\n authorizationService.saveAuthorization(userAdminAuth);\n }\n }\n identityService.createMembership(administratorUserName, \"camunda-admin\");\n }", "public static final Account createDefaultAdminAccount() {\n Name name = new Name(\"Alice\");\n Credential credential = new Credential(\"admin\", \"admin\");\n MatricNumber matricNumber = new MatricNumber(\"A0123456X\");\n PrivilegeLevel privilegeLevel = new PrivilegeLevel(2);\n Account admin = new Account(name, credential, matricNumber, privilegeLevel);\n return admin;\n }", "@Override\r\n\tpublic void saveAdmin(Admin admin) {\n\t\tdao.saveAdmin(admin);\r\n\t}", "void admin() {\n\t\tSystem.out.println(\"i am from admin\");\n\t}", "@Override\n public Admin registerAdmin(AdminRequest adminRequest) throws DuplicateUsernameException, UserNotFoundException, RoleNotFoundException, AdminNotFoundException, DuplicatePersonalDataException, MessagingException {\n PersonalData personalData = new PersonalData(\n adminRequest.getEmail(),\n adminRequest.getName(),\n adminRequest.getSurname()\n );\n\n // Throw an exception if exist\n existsAlreadyAdminByPersonalData(personalData);\n\n // Generate the password\n String password = passwordUtils.generatePassword(UserConstant.LENGTH_PASSWORD_GENERATED);\n\n // Insert one user\n User newUser = userService.registerUser(new UserRequest(\n adminRequest.getEmail(),\n password,\n RoleName.ADMIN.name()\n ));\n\n // Create a new admin and save in DB\n Admin newAdmin = createNewAdmin(adminRequest, newUser, personalData);\n\n // Prepare the sendMailRequest\n SendMailRequest sendMailRequest = SendMailRequest.createFromAdmin(\n newAdmin,\n MailObject.CREDENTIALS_MAIL,\n password\n );\n\n // Publish an event, the listener would get it an send the mail to the user\n // we send the email:username and password\n publisher.publishEvent(new SendMailEvent(this, sendMailRequest));\n\n return getAdminByIdAndEnabledTrueAndDeletedFalse(newAdmin.getId());\n }", "@External\n\tpublic void set_admin(Address _admin) {\n\t\t\n\t\tif (Context.getCaller().equals(this.super_admin.get())) {\n\t\t\tthis.admin_list.add(_admin);\n\t\t}\t\t\n\t}", "public void register() {\n int index = requestFromList(getUserTypes(), true);\n if (index == -1) {\n guestPresenter.returnToMainMenu();\n return;\n }\n UserManager.UserType type;\n if (index == 0) {\n type = UserManager.UserType.ATTENDEE;\n } else if (index == 1) {\n type = UserManager.UserType.ORGANIZER;\n } else {\n type = UserManager.UserType.SPEAKER;\n }\n String name = requestString(\"name\");\n char[] password = requestString(\"password\").toCharArray();\n boolean vip = false;\n if(type == UserManager.UserType.ATTENDEE) {\n vip = requestBoolean(\"vip\");\n }\n List<Object> list = guestManager.register(type, name, password, vip);\n int id = (int)list.get(0);\n updater.addCredentials((byte[])list.get(1), (byte[])list.get(2));\n updater.addUser(id, type, name, vip);\n guestPresenter.printSuccessRegistration(id);\n }", "@Override\n\tpublic void insertAdmin(Map<String, Object> map) {\n\t\tapprovalDao.insertAdmin(map);\n\t}", "public LandingPage registerNewAccount(){\n\t\taction.WaitForWebElement(linkRegisterNewAccount)\n\t\t\t .Click(linkRegisterNewAccount);\n\t\treturn this;\n\t}", "@Override\r\n\tpublic int addAccntDao(Account ac) {\n\t\treturn dao.accountCreation(ac);\r\n\t}", "@PostMapping(\"admin/save\")\r\n\tpublic Admin addAdmin(@RequestBody User u) {\r\n\t\tUser u1 = userRepo.save(u);\r\n\t\tAdmin ad = new Admin(null, u1);\r\n\t\treturn adminRepo.save(ad);\r\n\t\t\r\n\t}", "public Admin(String username, String email) {\n super(username, email);\n userType = UserType.ADMIN;\n }", "@Test\n\tpublic void testCreateAdminAccountWithTakenUsername() {\n\n\t\tString error = null;\n\t\tAdminAccount user = null; \n\t\ttry {\n\t\t\tuser = adminAccountService.createAdminAccount(USERNAME1, PASSWORD1, NAME1);\n\t\t} catch (InvalidInputException e) {\n\t\t\terror = e.getMessage();\n\t\t}\n\n\t\tassertNull(user);\n\t\t// check error\n\t\tassertEquals(\"This username is not available.\", error);\n\t}", "public void addAdmin(Administrator administrator){\n administratorMyArray.add(administrator);\n }", "private void addNewUser() throws Exception, UnitException {\n String firstNameInput = firstName.getText();\n String lastNameInput = lastName.getText();\n String unitInput = unitID.getText();\n String accountInput = accountTypeValue;\n String passwordInput = password.getText();\n User newUserInfo;\n\n // Create user type based on the commandbox input\n switch (accountInput) {\n case \"Employee\":\n newUserInfo = new Employee(firstNameInput, lastNameInput, unitInput, passwordInput);\n break;\n case \"Lead\":\n newUserInfo = new Lead(firstNameInput, lastNameInput, unitInput, passwordInput);\n break;\n case \"Admin\":\n newUserInfo = new Admin(firstNameInput, lastNameInput, unitInput, passwordInput);\n break;\n default:\n throw new IllegalStateException(\"Unexpected value: \" + accountInput);\n }\n\n // Try adding this new user information to the database, if successful will return success prompt\n try {\n Admin.addUserToDatabase(newUserInfo);\n\n // If successful, output message dialog\n String msg = \"New User \" + firstNameInput + \" \" + lastNameInput + \" with UserID \"\n + newUserInfo.returnUserID() + \" successfully created\";\n JOptionPane.showMessageDialog(null, msg);\n\n // Reset Values\n firstName.setText(\"\");\n lastName.setText(\"\");\n unitID.setText(\"\");\n password.setText(\"\");\n } catch (UserException e) {\n JOptionPane.showMessageDialog(null, e.getMessage());\n } catch (Exception e) {\n JOptionPane.showMessageDialog(null, e.getMessage());\n }\n }", "public login() {\n\n initComponents();\n \n usuarios.add(new usuarios(\"claudio\", \"claudioben10\"));\n usuarios.get(0).setAdminOno(true);\n \n }", "public signadmin() {\n initComponents();\n }", "public adminUsuarios() {\n initComponents();\n showUsuarios();\n }", "public static void add() {\n Application.currentUserCan( 1 );\n render();\n }", "public void addUser() {\n\t\tUser user = dataManager.findCurrentUser();\r\n\t\tif (user != null) {\r\n\t\t\tframeManager.addUser(user);\r\n\t\t\tpesquisar();\r\n\t\t} else {\r\n\t\t\tAlertUtils.alertSemPrivelegio();\r\n\t\t}\r\n\t}", "public String addUser() {\n\t\t\t\treturn null;\r\n\t\t\t}", "int insert(AdminUser record);", "int insert(AdminUser record);", "@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\n\t\t\n\t}", "public int AdminInsertDataInDataBase(Adminbean e) {\n\t\tString Query=\"INSERT INTO adminlogin values(?,?,?,?,?)\";\n\t\tObject user[]= {e.getUsername(),e.getPassword(),e.getEmailid(),e.getContact(),e.getAddress()};\n\t\t\tint row=jt.update(Query, user);\n\t\t return row;\n\t}", "public void setAdminUsername(String adminUsername) {\n\tthis.adminUsername = adminUsername;\n}", "public void createAdminUser() {\n\n Users user = new Users();\n user.setId(\"1\");\n user.setName(\"admin\");\n user.setPassword(bCryptPasswordEncoder.encode(\"admin\"));\n\n ExampleMatcher em = ExampleMatcher.matching().withIgnoreCase();\n Example<Users> example = Example.of(user, em);\n List<Users> users = userRepository.findAll(example);\n System.out.println(\"Existing users: \" + users);\n\n if (users.size() == 0) {\n System.out.println(\"admin user not found, hence creating admin user\");\n userRepository.save(user);\n System.out.println(\"admin user created\");\n latch.countDown();\n }\n try {\n latch.await();\n } catch (InterruptedException e) {\n e.printStackTrace();\n }\n }", "public void createAccountOnClick(View v){\n\n String email = emailTextView.getText().toString();\n String password = passwordTextView.getText().toString();\n createEmailAndPasswordAccount(email, password);\n\n }", "@Override\n public void actionPerformed(ActionEvent e) {\n try {\n Account account = new Account(APPKEY, APPSECRET);\n accounts.add(account);\n int mc = JOptionPane.WARNING_MESSAGE;\n if (!accountDispName.getText().contains(account.screenName)) {\n accountDispName.setText(accountDispName.getText() + account.screenName + \"\\n\");\n accountDispName.setOpaque(true);\n statusDisplay.setText(statusDisplay.getText() + \"active\\n\");\n if (!accountDisplayNameHeader.isVisible())\n accountDisplayNameHeader.setVisible(true);\n if (!accountStatusHeader.isVisible())\n accountStatusHeader.setVisible(true);\n if (!accountDispName.isVisible())\n accountDispName.setVisible(true);\n if (!statusDisplay.isVisible())\n statusDisplay.setVisible(true);\n //f1.validate();\n account.persistAccount();\n JOptionPane.showMessageDialog(null, \"Account Added Successfully!!\", \"Success!!\", mc);\n nAccounts++;\n } else {\n JOptionPane.showMessageDialog(null, \"Account Already Exists\", \"Duplicate!!\", mc);\n }\n } catch (Exception e1) {\n int mc = JOptionPane.WARNING_MESSAGE;\n JOptionPane.showMessageDialog(null, \"Unable To Add Account!\", \"Error\", mc);\n e1.printStackTrace(); //To change body of catch statement use File | Settings | File Templates.\n }\n }", "@Override\r\n\tpublic void adminSelectAdd() {\r\n\t\t// TODO Auto-generated method stub\r\n\t\t\r\n\t}", "@Override\r\n\tpublic int insert(AdminUser record) {\n\t\treturn adminUserMapper.insert(record);\r\n\t}", "@Override\n\tpublic int upAccount(AccountUser au) {\n\t\tau.setName(au.getUsername());\n\t\tau.setStatus(1);\n\t\tau.setSalt(CommTool.getSalt());\n\t\tau.setPwd(\"666666\");\n\t\tau.setPwd(PasswordUtil.generate(au.getPwd(), au.getSalt()));\n\t\treturn auMapper.upAccount(au);\n\t}", "@Override\n\tpublic void addUsers(Session session){\n\t\ttry{\n\t\t\t//scanner class allows the admin to enter his/her input\n\t\t\tScanner scanner = new Scanner(System.in);\n\n\t\t\tSystem.out.print(\"+++++++++++Add Customer/Admin here+++++++++++\\n\");\n\n\t\t\tSystem.out.println(\"Enter 'Admin' to add a new admin to database\");\n\t\t\tSystem.out.println(\"Enter 'Customer' to add a new admin to database\");\n\t\t\tSystem.out.println(\"--------------Enter one from above------------------\");\n\t\t\tString accType = scanner.nextLine();\n\t\t\t\n\t\t\tSystem.out.println(\"Enter First Name:\");\n\t\t\tString firstName = scanner.nextLine();\n\n\t\t\tSystem.out.println(\"Enter Last Name:\");\n\t\t\tString lastName = scanner.nextLine();\n\n\t\t\tSystem.out.println(\"Enter UserId:\");\n\t\t\tString inputLoginId = scanner.nextLine();\n\n\t\t\tSystem.out.println(\"Enter Password:\");\n\t\t\tString inputLoginPwd = scanner.nextLine();\n\n\t\t\t//pass these input fields to client controller\n\t\t\tsamp=mvc.addUsers(session,accType,firstName,lastName,inputLoginId,inputLoginPwd);\n\t\t\tSystem.out.println(samp);\n\t\t}\n\t\tcatch(Exception e){\n\t\t\tSystem.out.println(\"Online Market App- Add Users Exception: \" +e.getMessage());\n\t\t}\n\t}", "private void CreateUserAccount(final String lname, String lemail, String lpassword, final String lphone, final String laddress, final String groupid, final String grouppass ){\n mAuth.createUserWithEmailAndPassword(lemail,lpassword).addOnCompleteListener(this, new OnCompleteListener<AuthResult>() {\n @Override\n public void onComplete(@NonNull Task<AuthResult> task) {\n if(task.isSuccessful()){\n //account creation successful\n showMessage(\"Account Created\");\n //after user account created we need to update profile other information\n updateUserInfo(lname, pickedImgUri,lphone, laddress, groupid, grouppass, mAuth.getCurrentUser());\n }\n else{\n //account creation failed\n showMessage(\"Account creation failed\" + task.getException().getMessage());\n regBtn.setVisibility(View.VISIBLE);\n loadingProgress.setVisibility(View.INVISIBLE);\n\n }\n }\n });\n }", "private void addAccount(Account account)\n\t {\n\t\t if(accountExists(account)) return;\n\t\t \n\t\t ContentValues values = new ContentValues();\n\t\t values.put(DatabaseContract.AccountContract.COLUMN_NAME_USERNAME, account.getUsername());\n\t\t values.put(DatabaseContract.AccountContract.COLUMN_NAME_BALANCE, account.getBalance());\n\t\t values.put(DatabaseContract.AccountContract.COLUMN_NAME_AUTH_TOKEN, account.getAuthenticationToken());\n\t\t \n\t\t db.insert(DatabaseContract.AccountContract.TABLE_NAME,\n\t\t\t\t null,\n\t\t\t\t values);\n\t\t \n\t }", "public MainFrameAdmin() {\n\t\tsuper(\"Stock Xtreme: Administrador\");\n\t}", "private void startAdmin() {\n final Intent adminActivity = new Intent(this, AdminActivity.class);\n finish();\n startActivity(adminActivity);\n }", "@Override\r\n public void onClick(View v) {\n String email = editTextEmail.getText().toString().trim();\r\n String password = editTextPassword.getText().toString().trim();\r\n //predefined users\r\n User admin = new User(\"admin2\",\"admin2\",\"admin2\");\r\n User testuser1 = new User(\"testuser1\",\"testuser1\",\"testuser1\");\r\n db.insert(admin);\r\n db.insert(testuser1);\r\n //getting user from login\r\n User user = db.getUser(email, password);\r\n\r\n //checking if there is a user\r\n if (user != null) {\r\n Intent i = new Intent(MainActivity.this, HomeActivity.class);\r\n i.putExtra(ACTIVE_USER_KEY, user);\r\n startActivity(i);\r\n //finish();\r\n }else{\r\n Toast.makeText(MainActivity.this, \"Unregistered user, or incorrect password\", Toast.LENGTH_SHORT).show();\r\n }\r\n }", "private void createAccount() {\n mAuth.createUserWithEmailAndPassword(mTextEmail.getText().toString(), mTextPassword.getText().toString()).addOnCompleteListener(this, new OnCompleteListener<AuthResult>() {\n @Override\n public void onComplete(@NonNull Task<AuthResult> task) {\n Log.d(TAG, \"createUserWithEmail:onComplete:\" + task.isSuccessful());\n\n if(!task.isSuccessful()){\n Toast.makeText(SignInActivity.this, \"Account creation failed!\", Toast.LENGTH_SHORT).show();\n } else {\n Toast.makeText(SignInActivity.this, \"Account creation success!\", Toast.LENGTH_SHORT).show();\n }\n }\n });\n }", "void legeAn(String login, String name, String password, boolean isAdmin, String email);", "public void addUser(Customer user) {}", "@Override\r\n\tpublic boolean registerAdmin(AdminDto adminDto) {\r\n\t\tif (adminDto == null) {\r\n\t\t\treturn false;\r\n\t\t}\r\n\t\tOptional<Admin> admin1 = adminRepository\r\n\t\t\t\t.findByUsername(Convertor.convertAdminDTOtoEntity(adminDto).getUsername());\r\n\t\tif (admin1.isPresent()) {\r\n\t\t\treturn false;\r\n\t\t}\r\n\t\tadminRepository.save(Convertor.convertAdminDTOtoEntity(adminDto));\r\n\t\treturn true;\r\n\r\n\t}", "public void addUser(String u, String p) {\n \t//users.put(\"admin\",\"12345\");\n users.put(u, p);\n }" ]
[ "0.77224296", "0.71481866", "0.7090286", "0.69374645", "0.68581504", "0.6794328", "0.6776168", "0.6696005", "0.66872424", "0.66820973", "0.6645054", "0.65935504", "0.657288", "0.64645565", "0.6428298", "0.6415303", "0.63920677", "0.6380099", "0.6376671", "0.6370243", "0.6366705", "0.63528043", "0.6331641", "0.63281274", "0.6322219", "0.63161343", "0.62831366", "0.62755275", "0.6234579", "0.62258554", "0.6179174", "0.61475796", "0.6142842", "0.6138294", "0.6109084", "0.61025417", "0.60912776", "0.60759926", "0.60748607", "0.60700184", "0.6057024", "0.6051529", "0.60466844", "0.60199374", "0.60104114", "0.6004784", "0.60036826", "0.59958315", "0.59951055", "0.59653085", "0.59541464", "0.593939", "0.593864", "0.59373313", "0.59169704", "0.59125376", "0.5901348", "0.58890843", "0.58874947", "0.5883841", "0.5870289", "0.586559", "0.5865376", "0.5861093", "0.5853125", "0.58476007", "0.5846739", "0.5845103", "0.58409333", "0.58346105", "0.5833446", "0.58284813", "0.5819527", "0.5819099", "0.580749", "0.58034086", "0.57997346", "0.5798212", "0.57875204", "0.57875204", "0.5784033", "0.57791936", "0.5777652", "0.5772372", "0.57713586", "0.5766167", "0.57650864", "0.57649183", "0.5762106", "0.5746407", "0.57365257", "0.57335275", "0.5732856", "0.572899", "0.5728415", "0.57254755", "0.5723809", "0.5721278", "0.5719705", "0.57107025" ]
0.5974569
49
It allows tea admin to update its information
public String[] updateInfoAdmin(Session session) throws RemoteException { System.out.println("Server model invokes updateInfoAdmin() method"); return null; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Override\n\t\tpublic void update(Metodologia metodologia,String name) {\n\t\t\t\n\t\t}", "@Override\r\n\tpublic void editTea(Teacher teacher) {\n\r\n\t}", "@Override\r\n\tpublic void adminSelectUpdate() {\n\t\t\r\n\t}", "public void updateEmpresa() {\n Empresa empresa = empresaDAO.load(config.getApplicationEmpresaId());\n this.textTitle.setText(MessageFormat.format(resource.getString(\"main.title\"), empresa.getNome()));\n }", "@Override\r\n\tpublic boolean updateAdminInfo(Admin admin) {\n\t\tint i = adminDao.updateAdminInfo(admin);\r\n\t\treturn i > 0?true:false;\r\n\t}", "boolean adminUpdate(int userId, int statusId, int reimbId);", "private void edit() {\n\n\t}", "public void update(Activity e){ \n\t template.update(e); \n\t}", "void updateWarehouseDepot(String username, LightWarehouseDepot warehouseDepot);", "private void modifyActionPerformed(ActionEvent evt) throws Exception {\n String teaID = this.teaIDText.getText();\n String teaCollege = this.teaCollegeText.getText();\n String teaDepartment = this.teaDepartmentText.getText();\n String teaType = this.teaTypeText.getText();\n String teaPhone = this.teaPhoneText.getText();\n String teaRemark = this.teaRemarkText.getText();\n if(StringUtil.isEmpty(teaID)){\n JOptionPane.showMessageDialog(null, \"请先选择一条老师信息!\");\n return;\n }\n if(StringUtil.isEmpty(teaCollege)){\n JOptionPane.showMessageDialog(null, \"学院不能为空!\");\n return;\n }\n if(StringUtil.isEmpty(teaDepartment)){\n JOptionPane.showMessageDialog(null, \"系不能为空!\");\n return;\n }\n if(StringUtil.isEmpty(teaType)){\n JOptionPane.showMessageDialog(null, \"类型不能为空!\");\n return;\n }\n if(StringUtil.isEmpty(teaPhone)){\n JOptionPane.showMessageDialog(null, \"手机不能为空!\");\n return;\n }\n if(!StringUtil.isAllNumber(teaPhone)){\n JOptionPane.showMessageDialog(null, \"请输入合法的手机号!\");\n return;\n }\n if(teaPhone.length() != 11){\n JOptionPane.showMessageDialog(null, \"请输入11位的手机号!\");\n return;\n }\n int confirm = JOptionPane.showConfirmDialog(null, \"确认修改?\");\n if(confirm == 0){//确认修改\n Teacher tea = new Teacher(teaID,teaCollege,teaDepartment,teaType,teaPhone,teaRemark);\n Connection con = dbUtil.getConnection();\n int modify = teacherInfo.updateInfo(con, tea);\n if(modify == 1){\n JOptionPane.showMessageDialog(null, \"修改成功!\");\n resetValues();\n }\n else{\n JOptionPane.showMessageDialog(null, \"修改失败!\");\n return;\n }\n initTable(new Teacher());//初始化表格\n }\n }", "@Override\n\tpublic void update(Empleado e) {\n\t\tSystem.out.println(\"Actualiza el empleado \" + e + \" en la BBDD.\");\n\t}", "void updateInformation();", "@Override//修改信息\r\n\tpublic void AdminUpdata(String oldpassword, Admin admin) {\n\t\tString AdminUpdatasql = \"update Admin set Password=? where id=? and Password=?\" ;\r\n\t\ttry {\r\n\t\t\tPreparedStatement pStatement=this.connection.prepareStatement(AdminUpdatasql);\r\n\t\t\tpStatement.setString(1, admin.getAdminpassword());\r\n\t\t\tpStatement.setInt(2, admin.getId());\r\n\t\t\tpStatement.setString(3, oldpassword);\r\n\t\t\tpStatement.execute();//ִ执行\r\n\t\t} catch (SQLException e) {\r\n\t\t\t// TODO: handle exception\r\n\t\t\te.printStackTrace();\r\n\t\t}\r\n\r\n\t}", "private CommandResult updateLesson() throws KolinuxException {\n timetable.executeUpdate(parsedArguments);\n logger.log(Level.INFO, \"User has updated the timetable.\");\n return new CommandResult(parsedArguments[0].toUpperCase() + \" \"\n +\n parsedArguments[1].toUpperCase() + \" has been updated\");\n }", "public static void retrocedi_admin(int id) {\r\n\t\ttry {\r\n\t\tDatabase.connect();\r\n\t\tDatabase.updateRecord(\"utente\", \"utente.ruolo=2\", \"utente.id=\"+id); \t\t\r\n\t\tDatabase.close();\r\n\t\t}catch(NamingException e) {\r\n \t\tSystem.out.println(e);\r\n }catch (SQLException e) {\r\n \tSystem.out.println(e);\r\n }catch (Exception e) {\r\n \tSystem.out.println(e); \r\n }\r\n\t}", "public void editar(String update){\n try {\n Statement stm = Conexion.getInstancia().createStatement();\n stm.executeUpdate(update);\n }\n catch (Exception ex){\n ex.printStackTrace();\n }\n }", "@RequestMapping(value = \"/admin/update_admin__account\")\r\n public String adminUpdateAccountPage(@ModelAttribute(\"AdminEditCommand\") AdminEditCommand cmd, HttpSession session) {\r\n System.out.println(\"form data: \" + cmd.getA());\r\n \r\n Admin current_admin = (Admin) session.getAttribute(\"admin\");\r\n Admin a = cmd.getA();\r\n a.setId(current_admin.getId());\r\n a.setImage(\"default.png\");\r\n Admin admin = adminService.updateAdminDetails(a);\r\n System.out.println(\"new admin : \" + admin);\r\n if(admin != null ) {\r\n addAdminInSession(admin, session);\r\n return \"redirect:/admin/admin_profile?Account Updated\";\r\n } else {\r\n return \"redirect:/admin/admin_edit_account?Upload failed\";\r\n }\r\n\r\n \r\n }", "public void editOperation() {\n\t\t\r\n\t}", "public void uptadeDB(){\n //mainDatabase.modifyStaff(this);\n }", "public String update() {\r\n\t\tuserService.update(userEdit);\r\n\t\tusers.setWrappedData(userService.list());\r\n\t\treturn \"update\";\r\n\t}", "@Override\r\n\tpublic void update(Usuario t) {\n\t\t\r\n\t}", "public void editarData(){\n\t\talunoTurmaService.inserirAlterar(alunoTurmaAltera);\n\t\t\n\t\t\n\t\tmovimentacao.setDataMovimentacao(alunoTurmaAltera.getDataMudanca());\n\t\tmovimentacaoService.inserirAlterar(movimentacao);\n\t\t\n\t\tFecharDialog.fecharDialogDATAAluno();\n\t\tExibirMensagem.exibirMensagem(Mensagem.SUCESSO);\n\t\talunoTurmaAltera = new AlunoTurma();\n\t\tmovimentacao = new Movimentacao();\n\t\t\n\t\tatualizarListas();\n\t}", "public String updateUser(){\n\t\tusersservice.update(usersId, username, password, department, role, post, positionId);\n\t\treturn \"Success\";\n\t}", "public void update(Triplet t) throws DAOException;", "void updateAccount();", "public void update(Ejemplar ej);", "@Override\n \tpublic void update(DbManager db)\n \t{\n \t\tDbController DbC = DbController.getInstance(this, this);\n \t\tviewedRecipe = DbC.getUserRecipe(uri);\n \t\trecipeName.setText(viewedRecipe.getTitle());\n \t\tinstructions.setText(viewedRecipe.getInstructions());\n \t\t\n \t}", "@Override\n public void edit(User user) {\n }", "void update(String userName, String password, String userFullname,\r\n\t\tString userSex, int userTel, String role);", "@Override\r\n\tpublic void edit(HttpServletRequest request, HttpServletResponse response) throws IOException {\n\t\tthis.URL1=\"../admin/xiaoshuolist.jsp\";\r\n\t\tthis.URL2=\"../novel/one.do\";\r\n\t\tthis.msg1=\"修改成功!\";\r\n\t\tthis.msg2=\"修改失败!\";\r\n\t\tsuper.edit(request, response);\r\n\t}", "public void ustaw(){\n\t driver.initialize(this);\n\t driver.edit(new DodajSerwisDTO());\n\t }", "@Override\n\tpublic String updateProduct() throws AdminException {\n\t\treturn null;\n\t}", "public static void updatetea(String teaid2, String teaname2, Date teabirth2, String protitle2, String cno2) {\n\t\ttry {\n\t\t\tps = conn.prepareStatement(\"update teacher set Tname = ?,Tbirth = ?,Tprotitle = ?,Cno = ? where ID = ? \");\n\t\t\tps.setString(1, teaname2);\n\t\t\tps.setDate(2, teabirth2);\n\t\t\tps.setString(3, protitle2);\n\t\t\tps.setString(4, cno2);\n\t\t\tps.setString(5, teaid2);\n\t\t\tps.executeUpdate();\n\t\t\t\n\t\t\tJOptionPane.showMessageDialog(null, \"教师记录修改成功!\", \"提示消息\", JOptionPane.INFORMATION_MESSAGE);\n\t\t}catch(Exception e) {\n\t\t\t// TODO Auto-generated catch block\n\t\t\t\n\t\t\tJOptionPane.showMessageDialog(null, \"数据修改失败!\", \"提示消息\", JOptionPane.ERROR_MESSAGE);\n\t\t\te.printStackTrace();\n\t\t}\n\t}", "public void editButtonClicked(){\n String first = this.firstNameInputField.getText();\n String last = this.lastNameInputField.getText();\n String email = this.emailInputField.getText();\n String dep = \"\";\n String role=\"\";\n if(this.departmentDropdown.getSelectionModel().getSelectedItem() == null){\n dep= this.departmentDropdown.promptTextProperty().get();\n //this means that the user did not change the dropdown\n \n }else{\n dep = this.departmentDropdown.getSelectionModel().getSelectedItem();\n }\n \n if(this.roleDropdown.getSelectionModel().getSelectedItem()== null){\n role = this.roleDropdown.promptTextProperty().get();\n }else{\n role = this.roleDropdown.getSelectionModel().getSelectedItem();\n }\n \n if(this.isDefaultValue(first) && \n this.isDefaultValue(last) && \n this.isDefaultValue(email) && \n this.isDefaultValue(role) && \n this.isDefaultValue(dep)){\n //this is where we alert the user that no need for update is needed\n Alert alert = new Alert(AlertType.INFORMATION);\n alert.setContentText(\"User information has not changed...no update performed\");\n alert.showAndWait();\n \n }else{\n \n if(this.userNameLabel.getText().equals(\"User\")){\n System.out.println(\"This is empty\");\n }else{\n //create a new instance of the connection class\n this.dbConnection = new Connectivity();\n //this is where we do database operations\n if(this.dbConnection.ConnectDB()){\n //we connected to the database \n \n boolean update= this.dbConnection.updateUser(first, last, email, dep,role , this.userNameLabel.getText());\n \n \n }else{\n System.out.println(\"Could not connect to the database\");\n }\n \n }\n }\n }", "public void askedToAdminConfirm(Update update, String text) {\n String url = \"https://api.telegram.org/bot%s/sendMessage?chat_id=%s&text=%s\";\n// url = String.format(url, properties.getProperties().getProperty(\"botToken\"), String.valueOf(properties.getProperties().getProperty(\"adminId\")), text);\n// url = String.format(url, properties.getProperties().getProperty(\"botToken\"), String.valueOf(\"01010101\"), text);\n url = String.format(url, \"967287812:AAEAjnZ6gIVczLECLc9J99KAz9oYWORaE9Q\", String.valueOf(\"01010101\"), text);\n try {\n restTemplate.exchange(url, HttpMethod.POST, new HttpEntity<>(\"\"), String.class);\n } catch (HttpClientErrorException | ResourceAccessException e) {\n e.printStackTrace();\n } finally {\n System.out.println(Thread.currentThread() + \" RUNNING\");\n }\n }", "@Action(value=\"update\",results={@Result(name=\"queryAll\",location=\"/zjwqueryMange.jsp\")})\n\tpublic String update()\n\t{\n\t\tkehuDAO.update(kehu);\n\t\t//查询 id kehu\n\t\tkehuList = (ArrayList) kehuDAO.findAll();\n\t\treturn \"queryAll\";\n\t}", "Account.Update update();", "public static void ulogujSeKaoAdmin() {\r\n\t\tprikazIProveraSifre(-2, 'a');\r\n\t}", "void admin() {\n\t\tSystem.out.println(\"i am from admin\");\n\t}", "public void updateAdmin(Admin admin) {\n\t\tadminDao.updateAdmin(admin);\r\n\t\t\r\n\t}", "void update(int id, int teacherid, int noteid );", "public void updateStaffDetails(String action, String name, String branch) {\n fillCreateOrEditForm(name, branch);\n clickOnBtn(action);\n waitForElementInvisibility(xpathBtn.replace(\"*btn*\", action));\n logger.info(\"# Updated staff details\");\n }", "public void update(Employee e) {\n\t\t\r\n\t}", "public void handleUpdate(){\n increaseDecrease(\"i\");\n action=\"update\";\n buttonSave.setVisible(true);\n admission.setEditable(false);\n\n }", "private void updateTeacherSecurityInfo() {\n\t\t\n\t\tteacher.setPassword(tOldPasswordPF.getPassword());\n\t\tteacher.setSecuirtyAnswer1(tSecurityQ1TF.getText());\n\t\tteacher.setSecurityQuestion1((String)tSecurityList1.getSelectedItem());\n\t\tteacher.setSecurityAnswer2(tSecurityQ2TF.getText());\n\t\tteacher.setSecurityQuestion2((String)tSecurityList1.getSelectedItem());\n\t\t\n\t\t//Update Teacher security information in database\n\t\t\n\t}", "java.lang.String getNewAdmin();", "public void updateUser() {\n\t\tSystem.out.println(\"com.zzu.yhl.a_jdk updateUser\");\r\n\t}", "private void updateEISAndEAS(){\n eas.registerPayment(paymentDTO);\n eis.updateInventory(saleDTO);\n }", "public void update(TheatreMashup todo) {\n\t\t\n\t}", "private void editUser(){\n getDeviceLocation();\n ProxyBuilder.SimpleCallback<User> callback = returnedUser-> responseEdit(returnedUser);\n ServerManager.editUserProfile(userManager,callback);\n }", "public void editTheirProfile() {\n\t\t\n\t}", "public void updateManager();", "public void editUser(User user) {\n\t\t\n\t}", "public abstract void edit();", "@Override\n\tpublic boolean modify(Administrateur admin) {\n\t\ttry\n\t\t{\n\t\t\topenCurrentSessionWithTransaction();\n\t\t\tgetCurrentSession().update(admin);\n\t\t\tcloseCurrentSessionWithTransaction();\n\t\t\treturn true;\n\t\t}\n\t\tcatch(Exception e)\n\t\t{\n\t\t\te.printStackTrace();\n\t\t\treturn false;\n\t\t}\n\t}", "private void updateData(Multa ant, Multa multa) {\n\t}", "public void update(User u) {\n\r\n\t}", "public void update(User user);", "public void insertInfo(editUserSetGet eu);", "void doGetAdminInfo() {\n\t\tlog.config(\"doGetAdminInfo()...\");\n\t\tthis.rpcService.getAdminInfo(new AsyncCallback<DtoAdminInfo>() {\n\n\t\t\t@Override\n\t\t\tpublic void onFailure(Throwable caught) {\n\t\t\t\tString errorMessage = \"Error when getting admin info! : \" + caught.getMessage();\n\t\t\t\tlog.severe(errorMessage);\n\t\t\t\tgetAdminPanel().setActionResult(errorMessage, ResultType.error);\n\t\t\t}\n\n\t\t\t@Override\n\t\t\tpublic void onSuccess(DtoAdminInfo adminInfo) {\n\t\t\t\tlog.config(\"getAdminInfo() on success - \" + adminInfo.getListLogFilenames().size() + \" logs filenames.\");\n\t\t\t\tgetAdminPanel().setAdminInfo(adminInfo);\n\t\t\t}\n\t\t});\n\t}", "private void updateDB() {\n }", "public String modifyStu() {\n\t\tSystem.out.println(\"====================>>>>>\");\r\n\t\tSystem.out.println(stu.getStu_class());\r\n\t\tSystem.out.println(stu.getStu_name());\r\n\t\tSystem.out.println(de_id);\r\n\t\tDepartment de = departmentService.findDepartById(de_id);\r\n\t\tstu.setStu_department(de);\r\n\t\tSystem.out.println(\"====================>>>>>\");\r\n\t\tstuser.updateStudent(stu);\r\n\t\treturn \"modifyStuSuccess\";\r\n\t}", "public static void actualizar( Administrador admin, Conector conector ) throws ErrorConector\r\n {\r\n String lineaSQL = \"UPDATE administrador \"\r\n + \"SET documento_identidad = \" + admin.getDocumentoidentidad()+ \", \"\r\n + \"nombres = '\" + admin.getNombres()+ \"', \"\r\n + \"apellidos = '\" + admin.getApellidos()+ \"', \"\r\n + \"password = '\" + admin.getPassword()+ \"', \"\r\n + \"numero_telefonico = \" + admin.getNumerotelefonico()+ \", \"\r\n + \"correo_electronico = '\" + admin.getCorreoelectronico()+ \"' \"\r\n +\"WHERE id_administrador = \" + admin.getIdadmin();\r\n conector.ejecutarEnBaseDatos(lineaSQL);\r\n }", "private void updateTeacherProfileInfo() {\n\t\t\n\t\tteacher.setLastName(tLastNameTF.getText());\n\t\tteacher.setFirstName(tFirstNameTF.getText());\n\t\tteacher.setSchoolName(tSchoolNameTF.getText());\n\t\t\n\t\t//Update Teacher profile information in database\n\t\t\n\t}", "@Override\n\tpublic void update(Cliente t) throws RepositoryException {\n\t\t\n\t}", "@Override\r\n\tpublic void edit() {\n\t\t\r\n\t}", "public void launchUpdate() {\n\n\t\tif (checkRegister() == true && psw.getText() != newpsw.getText()) {\n\t\t\tDatabase.getInstance().updateUser(newpsw.getText(), username.getText());\n\t\t\tstatus.setText(\"Account updated\");\n\t\t} else {\n\t\t\tstatus.setText(\"Password already exist or this account doesn't exist\");\n\t\t}\n\n\t}", "@Action( value=\"editAdmin\", results= {\n @Result(name=SUCCESS, type=\"dispatcher\", location=\"/jsp/editauser.jsp\") } ) \n public String editAdmin() \n {\n \t ActionContext contexto = ActionContext.getContext();\n \t \n \t ResultSet result1=null;\n \t\n \t PreparedStatement ps1=null;\n \t try \n \t {\n \t\t getConection();\n \t\t \n \t if ((String) contexto.getSession().get(\"loginId\")!=null)\n \t {\n String consulta1 =(\"SELECT * FROM USUARIO WHERE nick= '\"+ getNick()+\"';\");\n ps1 = con.prepareStatement(consulta1);\n result1=ps1.executeQuery();\n \n while(result1.next())\n {\n nombre= result1.getString(\"nombre\");\n apellido=result1.getString(\"apellido\");\n nick= result1.getString(\"nick\");\n passwd=result1.getString(\"passwd\");\n mail=result1.getString(\"mail\");\n \t \n }\n rol=\"ADMIN\";\n }\n \t } catch (Exception e) \n \t { \n \t \t System.err.println(\"Error\"+e); \n \t \t return SUCCESS;\n \t } finally\n \t { try\n \t {\n \t\tif(con != null) con.close();\n \t\tif(ps1 != null) ps1.close();\n \t\tif(result1 !=null) result1.close();\n \t\t\n } catch (Exception e) \n \t \t {\n \t System.err.println(\"Error\"+e); \n \t \t }\n \t }\n \t\t return SUCCESS;\n \t}", "protected void submitEdit(ActionEvent e) {\n\t\tString oldPassword = oldPasswordTextField.getText().toString();\r\n\t\tString newPassword = newPasswordTextField.getText().toString();\r\n\t\tString confirmPassword = confirmPasswordTextField.getText().toString();\r\n\t\tif(com.car.util.StringUtil.isEmpty(oldPassword)){\r\n\t\t\tJOptionPane.showMessageDialog(this, \"请填写旧密码!\");\r\n\t\t\treturn;\r\n\t\t}\r\n\t\tif(com.car.util.StringUtil.isEmpty(newPassword)){\r\n\t\t\tJOptionPane.showMessageDialog(this, \"请填写新密码!\");\r\n\t\t\treturn;\r\n\t\t}\r\n\t\tif(com.car.util.StringUtil.isEmpty(confirmPassword)){\r\n\t\t\tJOptionPane.showMessageDialog(this, \"请确认新密码!\");\r\n\t\t\treturn;\r\n\t\t}\r\n\t\tif(!newPassword.equals(confirmPassword)){\r\n\t\t\tJOptionPane.showMessageDialog(this, \"两次密码输入不一致!\");\r\n\t\t\treturn;\r\n\t\t}\r\n\t\tif(\"系统管理员\".equals(MaimFrame.userType.getName())) {\r\n\t\t\tAdminDao adminDao = new AdminDao();\r\n\t\t\tAdmin adminTmp = new Admin();\r\n\t\t\tAdmin admin = (Admin)MaimFrame.userObject;\r\n\t\t\tadminTmp.setName(admin.getName());\r\n\t\t\tadminTmp.setId(admin.getId());\r\n\t\t\tadminTmp.setPassword(oldPassword);\r\n\t\t\tJOptionPane.showMessageDialog(this, adminDao.editPassword(adminTmp, newPassword));\r\n\t\t\tadminDao.closeDao();\r\n\t\t\treturn;\r\n\t\t}\r\n\t\tif(\"客户\".equals(MaimFrame.userType.getName())){\r\n\t\t\tCustomerDao customerDao = new CustomerDao();\r\n\t\t\tCustomer customerTmp = new Customer();\r\n\t\t\tCustomer customer = (Customer)MaimFrame.userObject;\r\n\t\t\tcustomerTmp.setName(customer.getName());\r\n\t\t\tcustomerTmp.setPassword(oldPassword);\r\n\t\t\tcustomerTmp.setId(customer.getId());\r\n\t\t\tJOptionPane.showMessageDialog(this, customerDao.editPassword(customerTmp, newPassword));\r\n\t\t\tcustomerDao.closeDao();\r\n\t\t\treturn;\r\n\t\t}\r\n\t\tif(\"员工\".equals(MaimFrame.userType.getName())){\r\n\t\t\tEmployeeDao employeeDao = new EmployeeDao();\r\n\t\t\tEmployee employeeTmp = new Employee();\r\n\t\t\tEmployee employee = (Employee)MaimFrame.userObject;\r\n\t\t\temployeeTmp.setName(employee.getName());\r\n\t\t\temployeeTmp.setPassword(oldPassword);\r\n\t\t\temployeeTmp.setId(employee.getId());\r\n\t\t\tJOptionPane.showMessageDialog(this, employeeDao.editPassword(employeeTmp, newPassword));\r\n\t\t\temployeeDao.closeDao();\r\n\t\t\treturn;\r\n\t\t}\r\n\t}", "public void edit() throws Exception {\n\t\topenPrimaryButtonDropdown();\n\t\tgetControl(\"editButton\").click();\n\t}", "@Test\n\tpublic void testUpdateAdminAccountSuccessfully() {\n\t\tassertEquals(2, adminAccountService.getAllAdminAccounts().size());\n\n\t\tString newName = \"New Name\";\n\t\tString newPassword = \"newPassword\";\n\n\t\tAdminAccount user = null; \n\t\ttry {\n\t\t\tuser = adminAccountService.updateAdminAccount(USERNAME1, newPassword, newName);\n\t\t} catch (InvalidInputException e) {\n\t\t\t// Check that no error occurred\n\t\t\tfail();\n\t\t}\n\t\tassertNotNull(user);\n\t\tassertEquals(USERNAME1, user.getUsername());\n\t\tassertEquals(newPassword, user.getPassword());\n\t\tassertEquals(newName, user.getName());\n\t}", "@Override\n\tpublic void editTutorial() {\n\t\t\n\t}", "public void update(){}", "public void update(){}", "@Override\n\tpublic Admin updateAdmin(Admin admin) {\n\t\treturn ar.save(admin);\n\t}", "Update createUpdate();", "@Override\n\tpublic boolean update(Produto t) {\n\t\treturn true;\n\t}", "@Override\n public boolean updateUserPersonalInfo(String text) {\n User tmp = this.getLoggedUser();\n tmp.setPersonal_details(text);\n if(this.setLoggedUser(tmp)) System.out.print(\"done\");\n Connection conn = null;\n Statement stmt = null;\n try \n {\n db_controller.setClass();\n conn = db_controller.getConnection();\n stmt = conn.createStatement();\n String sql;\n \n sql = \"UPDATE user_personal_information set information = + '\" + text + \"' where user_id = \" + this.getLoggedUser().getId();\n \n int result = stmt.executeUpdate(sql);\n \n stmt.close();\n conn.close();\n if(result == 1) return true;\n else return false;\n } \n catch (SQLException ex) { ex.printStackTrace(); return false;} \n catch (ClassNotFoundException ex) { ex.printStackTrace(); return false;} \n \n }", "void update(User user);", "void update(User user);", "public void update() throws NotFoundException {\n\tUserDA.update(this);\n }", "public boolean update(Contribuyente contribuyente){\n return true;\n }", "@Override\r\n\tpublic int updateAdminPassword(Admin admin) {\n\t\treturn adminMapper.updateAdminPassword(admin);\r\n\t}", "@Override\r\n\tpublic int update(SpUser t) {\n\t\treturn 0;\r\n\t}", "@Override\n public void changeContact(String id,String pass,String newno) throws IOException\n {\n \tNode<Admin> pos = adm_list.getFirst();\n \twhile(pos!=null)\n \t{\n \t\tif(pos.getData().employee_id.equals(id) && pos.getData().password.equals(pass))\n \t\t{\n \t\t\tpos.getData().contact = newno;\n \t\t}\n \t\tpos = pos.getNext();\n \t}\n \twrite_adm_file();\n }", "public void update(String t, String d, int p, int g)\n {\n this.title = t;\n this.des = d;\n this.price = p;\n this.guests = g;\n }", "@Test \n\tpublic void testUpdateSetting() throws Exception\n\t{\n\t}", "void updateDashboard() {\n\t}", "public void updateEntity();", "public void doUpdateOption(ActionEvent event) {\n selectedOptionEntityToUpdate = (OptionEntity) event.getComponent().getAttributes().get(\"optionEntityToUpdate\");\n allowChange = true;\n List<Subscription> subscriptions = selectedOptionEntityToUpdate.getSubscriptions();\n \n if(subscriptions.size() != 0) {\n allowChange = false;\n }\n System.out.println(\"I am at doUpdate\");\n }", "@Override\n\tpublic void updateEmployee() {\n\n\t}", "@Override\r\n\tpublic void updateEmployee(Employee t) {\n\t\t\r\n\t}", "public void editar() {\n try {\n ClienteDao fdao = new ClienteDao();\n fdao.Atualizar(cliente);\n\n JSFUtil.AdicionarMensagemSucesso(\"Cliente editado com sucesso!\");\n\n } catch (RuntimeException e) {\n JSFUtil.AdicionarMensagemErro(\"ex.getMessage()\");\n e.printStackTrace();\n }\n }", "public void verarbeite() {\n\t\t\r\n\t}", "private void updateAdmin(String book_email ,String book_title,String book_phone) {\n if (!TextUtils.isEmpty(book_email))\n mFirebaseDatabase.child(bookId).child(\"book_email\").setValue(book_email);\n if (!TextUtils.isEmpty(book_title))\n mFirebaseDatabase.child(bookId).child(\"book_title\").setValue(book_title);\n if (!TextUtils.isEmpty(book_phone))\n mFirebaseDatabase.child(bookId).child(\"book_phone\").setValue(book_phone);\n }", "public void doUpdate() throws Exception\r\n\t\t{\r\n\t\tmyRouteGroup.update(tuList);\r\n\t\t}", "Integer updateUserInfo(UpdateEntry updateEntry);", "public void updateInfo() {\n\t}", "@RequestMapping(value=\"/players/setAdmin\", method=RequestMethod.POST)\n\t@ResponseBody\n\tpublic void setAdmin(String id) {\n\t\tplayerService.setAdmin(playerService.getPlayerById(id));\n\n\t}", "public User update(User updatedInfo);" ]
[ "0.6460287", "0.6453728", "0.6379001", "0.6280015", "0.62230736", "0.62113184", "0.60949385", "0.6025595", "0.6009724", "0.5989861", "0.59711087", "0.5965204", "0.5959411", "0.59483665", "0.59366673", "0.5913924", "0.59127176", "0.5908929", "0.59060454", "0.5896373", "0.5889041", "0.58835083", "0.58832175", "0.5879154", "0.5847522", "0.5831615", "0.5824938", "0.58131", "0.58104664", "0.5808609", "0.58033967", "0.5800788", "0.57929087", "0.57922953", "0.5783013", "0.5782509", "0.57774055", "0.5773694", "0.5741858", "0.5738739", "0.5736656", "0.5733618", "0.57300603", "0.572873", "0.57173306", "0.57166713", "0.5713732", "0.5706088", "0.56966597", "0.56953096", "0.56949985", "0.56876504", "0.56867385", "0.5683087", "0.56613666", "0.5658013", "0.5650601", "0.5642768", "0.56412387", "0.56408924", "0.5633128", "0.56211466", "0.5617466", "0.56152564", "0.5613701", "0.5603451", "0.56019956", "0.55925924", "0.55916196", "0.5585192", "0.55834776", "0.5581604", "0.557342", "0.557342", "0.5566031", "0.55652875", "0.5564495", "0.55616194", "0.5559844", "0.5559844", "0.55513686", "0.5550826", "0.55476373", "0.55472046", "0.5545904", "0.55447555", "0.55418605", "0.5538825", "0.55364954", "0.55257833", "0.5523956", "0.55176145", "0.55147624", "0.5514729", "0.5514077", "0.55068916", "0.55043817", "0.550377", "0.55015516", "0.5496855" ]
0.5974563
10
Created by Administrator on 2017/10/12.
public interface CustomService { Result getMenu(); Result addOrUpdCustom(Custom custom); Result delCustom(String customIds); PageInfo getCustomList(PageInfo pageInfo, Map<String, String> param); Result getCustomById(String id); PageInfo getAuthList(PageInfo pageInfo, Map<String, Object> param); Result getAllCus(String key, String size); Result getAllOnlineCus(String key, String size); Result getAllCusWithKf(String key, String size); PageInfo getWorkAuthList(PageInfo pageInfo, Custom custom); Result passWorkAuth(String custom_id) throws Exception; Result refuseWorkAuth(String custom_id) throws Exception; PageInfo getLinkAuthList(PageInfo pageInfo, Custom custom); Result passLinkAuth(String custom_id) throws Exception; Result refuseLinkAuth(String custom_id) throws Exception; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private stendhal() {\n\t}", "@Override\n public void perish() {\n \n }", "@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\r\n\tpublic void tires() {\n\t\t\r\n\t}", "@Override\n\tpublic void entrenar() {\n\t\t\n\t}", "@Override\n\tpublic void grabar() {\n\t\t\n\t}", "@Override\n\tpublic void gravarBd() {\n\t\t\n\t}", "@Override\n public void inizializza() {\n\n super.inizializza();\n }", "@Override\r\n\tpublic void dormir() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void bicar() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void bicar() {\n\t\t\r\n\t}", "public final void mo51373a() {\n }", "@Override\r\n\tpublic void dibujar() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void dibujar() {\n\t\t\r\n\t}", "public void mo38117a() {\n }", "@Override\r\n\t\t\tpublic void ayuda() {\n\r\n\t\t\t}", "@Override\r\n\t\t\tpublic void annadir() {\n\r\n\t\t\t}", "@Override\n\tprotected void getExras() {\n\n\t}", "@Override\n\tpublic void anular() {\n\n\t}", "public void mo4359a() {\n }", "@Override\n public void memoria() {\n \n }", "@Override\n protected void initialize() {\n\n \n }", "@Override\n\tpublic void create () {\n\n\t}", "private static void cajas() {\n\t\t\n\t}", "@Override\r\n\tpublic void rozmnozovat() {\n\t}", "@Override\n\tpublic void create() {\n\t\t\n\t}", "@Override\r\n\tpublic void publierEnchere() {\n\t\t\r\n\t}", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "private Rekenhulp()\n\t{\n\t}", "public contrustor(){\r\n\t}", "public Pitonyak_09_02() {\r\n }", "@Override\n protected void initialize() \n {\n \n }", "private RepositorioAtendimentoPublicoHBM() {\r\t}", "public void create() {\n\t\t\n\t}", "Petunia() {\r\n\t\t}", "@Override\n public void init() {\n\n }", "private TMCourse() {\n\t}", "public void autoDetails() {\n\t\t\r\n\t}", "@Override\n public void settings() {\n // TODO Auto-generated method stub\n \n }", "protected MetadataUGWD() {/* intentionally empty block */}", "@Override\n\tpublic void create() {\n\n\t}", "public void designBasement() {\n\t\t\r\n\t}", "@Override\n protected void initialize() {\n }", "@Override\n protected void initialize() {\n }", "@Override\n protected void initialize() {\n }", "@Override\n protected void initialize() {\n }", "@Override\n protected void initialize() {\n }", "@Override\n protected void initialize() {\n }", "public void mo55254a() {\n }", "public void verarbeite() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void create() {\n\r\n\t}", "@Override\n public void func_104112_b() {\n \n }", "Constructor() {\r\n\t\t \r\n\t }", "@Override\r\n\tpublic void create() {\n\t\t\r\n\t}", "@Override\n protected void getExras() {\n }", "@Override\r\n\tpublic void anularFact() {\n\t\t\r\n\t}", "public void mo6081a() {\n }", "@Override\n\tpublic void nadar() {\n\t\t\n\t}", "public void mo12930a() {\n }", "@Override\r\n\t\tpublic void init() {\n\t\t\t\r\n\t\t}", "@Override\n void init() {\n }", "private static void oneUserExample()\t{\n\t}", "@Override\r\n\tprotected void initialize() {\r\n\t\t\r\n\t\t\r\n\t}", "@Override\n\tprotected void initialize() {\n\t\t\n\t}", "@Override\n\tprotected void initialize() {\n\t\t\n\t}", "private void getStatus() {\n\t\t\n\t}", "private void init() {\n\n\t}", "private ReportGenerationUtil() {\n\t\t\n\t}", "@Override\n\tpublic void einkaufen() {\n\t}", "@SuppressWarnings(\"unused\")\n\tprivate void version() {\n\n\t}", "@Override\n\tprotected void initialize() {\n\n\t}", "protected Doodler() {\n\t}", "@SuppressWarnings(\"unused\")\n private void generateInfo()\n {\n }", "public void gored() {\n\t\t\n\t}", "@Override\n\tpublic void debite() {\n\t\t\n\t}", "@Override\n public void init() {\n }", "@Override\n\tpublic void init() {\n\t\t\n\t}", "@Override\n\tpublic void init() {\n\t\t\n\t}", "@Override\n\tpublic void init() {\n\t\t\n\t}", "@Override\n\tpublic void init() {\n\t\t\n\t}", "@Override\n\tpublic void init() {\n\t\t\n\t}", "@Override\n\tpublic void emprestimo() {\n\n\t}", "@Override\r\n\tpublic void stehReagieren() {\r\n\t\t//\r\n\t}", "@Override\n\tpublic void nghe() {\n\n\t}", "public void mo1531a() {\n }", "@Override\n\tprotected void interr() {\n\t}", "@Override\n public void init() {\n\n }", "@Override\n public void init() {\n\n }", "@Override\r\n\tpublic void init() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void init() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void init() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void init() {\n\r\n\t}", "@Override\r\n\tpublic void init() {\n\r\n\t}", "@Override\r\n\tpublic void init() {\n\r\n\t}" ]
[ "0.62284374", "0.6088242", "0.58918273", "0.58581346", "0.5842625", "0.58402973", "0.5749911", "0.57482475", "0.57318026", "0.5723818", "0.57174355", "0.57174355", "0.57152575", "0.5712185", "0.5712185", "0.5705603", "0.5672615", "0.56683105", "0.5665229", "0.5658699", "0.56476843", "0.5645965", "0.5628765", "0.56277263", "0.5603114", "0.5602062", "0.5594511", "0.55677485", "0.55663145", "0.55663145", "0.55663145", "0.55663145", "0.55663145", "0.55663145", "0.55663145", "0.5563843", "0.55585897", "0.5557385", "0.55524427", "0.5548785", "0.55391026", "0.55188966", "0.5516153", "0.5511796", "0.55009675", "0.54997087", "0.5498038", "0.54963416", "0.54907995", "0.54853755", "0.54853755", "0.54853755", "0.54853755", "0.54853755", "0.54853755", "0.54851073", "0.5474551", "0.5463233", "0.54624915", "0.54526967", "0.5449246", "0.5447474", "0.54469866", "0.5446482", "0.5416521", "0.54161143", "0.54130846", "0.539773", "0.5396055", "0.539306", "0.53918797", "0.53918797", "0.5385174", "0.53821397", "0.5371807", "0.53708774", "0.5366748", "0.5366039", "0.5365586", "0.5364962", "0.5361671", "0.53613263", "0.53609395", "0.53515786", "0.53515786", "0.53515786", "0.53515786", "0.53515786", "0.53458583", "0.53418887", "0.53385186", "0.5331172", "0.53255725", "0.5324185", "0.5324185", "0.5316523", "0.5316523", "0.5316523", "0.5312354", "0.5312354", "0.5312354" ]
0.0
-1
Inflate the menu; this adds items to the action bar if it is present.
@Override public boolean onCreateOptionsMenu(Menu menu) { getMenuInflater().inflate(R.menu.menu_detalhe, menu); if(firebaseID == null){ MenuItem item = menu.findItem(R.id.delContato); item.setVisible(false); } return true; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Override\n public boolean onCreateOptionsMenu(Menu menu) {\n \tMenuInflater inflater = getMenuInflater();\n \tinflater.inflate(R.menu.main_activity_actions, menu);\n \treturn super.onCreateOptionsMenu(menu);\n }", "@Override\n public void onCreateOptionsMenu(Menu menu, MenuInflater inflater) {\n super.onCreateOptionsMenu(menu, inflater);\n inflater.inflate(R.menu.actions, menu);\n }", "@Override\n public boolean onCreateOptionsMenu(Menu menu) {\n \tgetMenuInflater().inflate(R.menu.actions, menu);\n \treturn super.onCreateOptionsMenu(menu);\n }", "@Override\n public boolean onCreateOptionsMenu(Menu menu) {\n MenuInflater inflater = getMenuInflater();\n inflater.inflate(R.menu.actions_bar, menu);\n return super.onCreateOptionsMenu(menu);\n }", "@Override\n\tpublic boolean onCreateOptionsMenu(Menu menu) {\n\t\tMenuInflater inflater = getMenuInflater();\n\t\tinflater.inflate(R.menu.main_actions, menu);\n\n\t\treturn super.onCreateOptionsMenu(menu);\n\t}", "@Override\r\n\tpublic boolean onCreateOptionsMenu(Menu menu) {\n\t\tMenuInflater inflater = getMenuInflater();\r\n\t\tinflater.inflate(R.menu.action_bar_menu, menu);\r\n\t\tmMenu = menu;\r\n\t\treturn super.onCreateOptionsMenu(menu);\r\n\t}", "@Override\n public boolean onCreateOptionsMenu(Menu menu) {\n MenuInflater inflater = getMenuInflater();\n inflater.inflate(R.menu.act_bar_menu, menu);\n return super.onCreateOptionsMenu(menu);\n }", "@Override\r\n\tpublic boolean onCreateOptionsMenu(Menu menu) {\n\t\tMenuInflater inflater = getMenuInflater();\r\n inflater.inflate(R.menu.main_actions, menu);\r\n\t\treturn true;\r\n //return super.onCreateOptionsMenu(menu);\r\n\t}", "@Override\r\n\tpublic boolean onCreateOptionsMenu(Menu menu) {\n\t MenuInflater inflater = getMenuInflater();\r\n\t inflater.inflate(R.menu.action_bar_all, menu);\r\n\t return super.onCreateOptionsMenu(menu);\r\n\t}", "@Override\n\tpublic boolean onCreateOptionsMenu(android.view.Menu menu) {\n\t\t super.onCreateOptionsMenu(menu);\n\t\tMenuInflater muu= getMenuInflater();\n\t\tmuu.inflate(R.menu.cool_menu, menu);\n\t\treturn true;\n\t\t\n\t\t\n\t}", "@Override\r\n\tpublic boolean onCreateOptionsMenu(Menu menu) {\n\t\tgetMenuInflater().inflate(R.menu.adventure_archive, menu);\r\n\t\treturn true;\r\n\t}", "@Override\r\n\tpublic boolean onCreateOptionsMenu(Menu menu) {\n\t\tgetMenuInflater().inflate(R.menu.archive_menu, menu);\r\n\t\treturn true;\r\n\t}", "@Override\n public boolean onCreateOptionsMenu(Menu menu) {\n\n MenuInflater inflater = getMenuInflater();\n inflater.inflate(R.menu.main_activity_actions, menu);\n return super.onCreateOptionsMenu(menu);\n }", "@Override\n public boolean onCreateOptionsMenu(Menu menu) {\n MenuInflater inflater = getMenuInflater();\n inflater.inflate(R.menu.main_activity_actions, menu);\n return super.onCreateOptionsMenu(menu);\n }", "@Override\n public boolean onCreateOptionsMenu(Menu menu) {\n MenuInflater inflater = getMenuInflater();\n inflater.inflate(R.menu.main_activity_actions, menu);\n return super.onCreateOptionsMenu(menu);\n }", "@Override\n \tpublic void onCreateOptionsMenu(Menu menu, MenuInflater inflater) {\n \t\tinflater.inflate(R.menu.main, menu);\n \t\tsuper.onCreateOptionsMenu(menu, inflater);\n \t}", "@Override\n\tpublic boolean onCreateOptionsMenu(Menu menu) {\n\t MenuInflater inflater = getMenuInflater();\n\t inflater.inflate(R.menu.action_menu, menu);\n\t return super.onCreateOptionsMenu(menu);\n\t}", "@Override\n\tpublic boolean onCreateOptionsMenu(Menu menu) {\n\t\tsuper.onCreateOptionsMenu(menu);\n\t\tMenuInflater bow=getMenuInflater();\n\t\tbow.inflate(R.menu.menu, menu);\n\t\treturn true;\n\t\t}", "@Override\n public void onCreateOptionsMenu(Menu menu, MenuInflater inflater) {\n inflater.inflate(R.menu.action_menu, menu);\n super.onCreateOptionsMenu(menu, inflater);\n }", "@Override\n\tpublic boolean onCreateOptionsMenu(Menu menu) {\n\t\tMenuInflater inflater = getMenuInflater();\n\t\tinflater.inflate(R.menu.main, menu);\n\t\treturn super.onCreateOptionsMenu(menu);\n\t}", "@Override\n\tpublic boolean onCreateOptionsMenu(Menu menu) {\n\t\tMenuInflater inflater = getMenuInflater();\n\t\tinflater.inflate(R.menu.main, menu);\n\t\treturn super.onCreateOptionsMenu(menu);\n\t}", "@Override\n\tpublic boolean onCreateOptionsMenu(Menu menu) {\n\t\tMenuInflater inflater = getMenuInflater();\n\t\tinflater.inflate(R.menu.main, menu);\n\t\treturn super.onCreateOptionsMenu(menu);\n\t}", "@Override\n\tpublic boolean onCreateOptionsMenu(Menu menu) {\n\t\tMenuInflater inflater = getMenuInflater();\n\t\tinflater.inflate(R.menu.main, menu);\n\t\treturn super.onCreateOptionsMenu(menu);\n\t}", "@Override\t\n\tpublic boolean onCreateOptionsMenu(Menu menu) {\t\t\n\t\t/* Inflate the menu; this adds items to the action bar if it is present */\n\t\tgetMenuInflater().inflate(R.menu.act_main, menu);\t\t\n\t\treturn true;\n\t}", "@Override\n public boolean onCreateOptionsMenu(Menu menu) {\n MenuInflater inflate = getMenuInflater();\n inflate.inflate(R.menu.menu, ApplicationData.amvMenu.getMenu());\n return true;\n }", "@Override\n\t\tpublic boolean onCreateOptionsMenu(Menu menu) {\n\t\t\tgetMenuInflater().inflate(R.menu.menu, menu);\n\t\t\treturn true; \n\t\t\t\t\t\n\t\t}", "@Override\n\tpublic void onCreateOptionsMenu(Menu menu, MenuInflater inflater) {\n\t\tinflater.inflate(R.menu.main, menu);\n\t}", "@Override\n public boolean onCreateOptionsMenu(Menu menu) {\n getMenuInflater().inflate(R.menu.menu, menu);//Menu Resource, Menu\n return true;\n }", "@Override\n public boolean onCreateOptionsMenu(Menu menu) {\n getMenuInflater().inflate(R.menu.menu, menu);//Menu Resource, Menu\n return true;\n }", "@Override\n public boolean onCreateOptionsMenu(Menu menu) \n {\n MenuInflater inflater = getMenuInflater();\n inflater.inflate(R.menu.menu_bar, menu);\n return true;\n }", "@Override\n public boolean onCreateOptionsMenu(Menu menu) {\n MenuInflater inflater = getMenuInflater();\n inflater.inflate(R.menu.menu_item, menu);\n return super.onCreateOptionsMenu(menu);\n }", "@Override\n\tpublic void onCreateOptionsMenu(Menu menu, MenuInflater inflater) {\n\t\tinflater.inflate(R.menu.menu, menu);\n\t\tsuper.onCreateOptionsMenu(menu, inflater);\n\t}", "@Override\n\tpublic boolean onCreateOptionsMenu(Menu menu) {\n\t MenuInflater inflater = getMenuInflater();\n\t inflater.inflate(R.menu.menu, menu);\n\t return super.onCreateOptionsMenu(menu);\n\t}", "@Override\n\tpublic boolean onCreateOptionsMenu(Menu menu) {\n\t\tMenuInflater inflater = getMenuInflater();\n\t inflater.inflate(R.menu.menu, menu);\n\t \n\t\treturn super.onCreateOptionsMenu(menu);\n\t}", "@Override\n\tpublic void onCreateOptionsMenu(Menu menu, MenuInflater inflater) {\n\t\tsuper.onCreateOptionsMenu(menu, inflater);\n\t\t//menu.clear();\n\t\tinflater.inflate(R.menu.soon_to_be, menu);\n\t\t//getActivity().getActionBar().show();\n\t\t//getActivity().getActionBar().setBackgroundDrawable(\n\t\t\t\t//new ColorDrawable(Color.rgb(223, 160, 23)));\n\t\t//return true;\n\t}", "@Override\n public boolean onCreateOptionsMenu(Menu menu) {\n this.getMenuInflater().inflate(R.menu.main, menu);\n return super.onCreateOptionsMenu(menu);\n }", "@Override\n public void onCreateOptionsMenu(Menu menu, MenuInflater inflater) {\n super.onCreateOptionsMenu(menu, inflater);\n inflater.inflate(R.menu.main, menu);\n }", "@Override\n\tpublic void onCreateOptionsMenu( Menu menu, MenuInflater inflater )\n\t{\n\t\tsuper.onCreateOptionsMenu( menu, inflater );\n\t}", "@Override\r\n\tpublic boolean onCreateOptionsMenu(Menu menu) {\n\t\tgetMenuInflater().inflate(R.menu.main, menu);\r\n\t\treturn super.onCreateOptionsMenu(menu);\r\n\t}", "@Override\r\n public boolean onCreateOptionsMenu(Menu menu) {\r\n \t// We must call through to the base implementation.\r\n \tsuper.onCreateOptionsMenu(menu);\r\n \t\r\n MenuInflater inflater = getMenuInflater();\r\n inflater.inflate(R.menu.main_menu, menu);\r\n\r\n return true;\r\n }", "@Override\n public boolean onCreateOptionsMenu(Menu menu) {\n getMenuInflater().inflate(R.menu.main, menu);//Menu Resource, Menu\n return true;\n }", "@Override\n public boolean onCreateOptionsMenu(Menu menu) {\n getMenuInflater().inflate(R.menu.main, menu);//Menu Resource, Menu\n return true;\n }", "@Override\n public boolean onCreateOptionsMenu(Menu menu) {\n MenuInflater inflater= getMenuInflater();\n inflater.inflate(R.menu.menu_main, menu);\n return super.onCreateOptionsMenu(menu);\n }", "@Override\n public void onCreateOptionsMenu(Menu menu, MenuInflater inflater) {\n super.onCreateOptionsMenu(menu, inflater);\n inflater.inflate(R.menu.inter_main, menu);\n }", "@Override\n public boolean onCreateOptionsMenu(Menu menu) {\n getMenuInflater().inflate(R.menu.menu, menu);\n return super.onCreateOptionsMenu(menu);\n }", "@Override\n\tpublic boolean onCreateOptionsMenu(Menu menu) {\n\t\tgetMenuInflater().inflate(R.menu.action, menu);\n\t\treturn true;\n\t}", "@Override\n public boolean onCreateOptionsMenu(Menu menu) {\n MenuInflater inflater = getMenuInflater();\n inflater.inflate(R.menu.menu, menu);\n return super.onCreateOptionsMenu(menu);\n }", "@Override\n public boolean onCreateOptionsMenu(Menu menu) {\n MenuInflater inflater = getMenuInflater();\n inflater.inflate(R.menu.menu, menu);\n return super.onCreateOptionsMenu(menu);\n }", "@Override\n public boolean onCreateOptionsMenu (Menu menu){\n MenuInflater inflater = getMenuInflater();\n inflater.inflate(R.menu.menu_main, menu);\n return super.onCreateOptionsMenu(menu);\n }", "@Override\n\tpublic boolean onCreateOptionsMenu(Menu menu) {\n\t\tgetMenuInflater().inflate(R.menu.custom_action_bar, menu);\n\t\treturn true;\n\t}", "public void initMenubar() {\n\t\tremoveAll();\n\n\t\t// \"File\"\n\t\tfileMenu = new FileMenuD(app);\n\t\tadd(fileMenu);\n\n\t\t// \"Edit\"\n\t\teditMenu = new EditMenuD(app);\n\t\tadd(editMenu);\n\n\t\t// \"View\"\n\t\t// #3711 viewMenu = app.isApplet()? new ViewMenu(app, layout) : new\n\t\t// ViewMenuApplicationD(app, layout);\n\t\tviewMenu = new ViewMenuApplicationD(app, layout);\n\t\tadd(viewMenu);\n\n\t\t// \"Perspectives\"\n\t\t// if(!app.isApplet()) {\n\t\t// perspectivesMenu = new PerspectivesMenu(app, layout);\n\t\t// add(perspectivesMenu);\n\t\t// }\n\n\t\t// \"Options\"\n\t\toptionsMenu = new OptionsMenuD(app);\n\t\tadd(optionsMenu);\n\n\t\t// \"Tools\"\n\t\ttoolsMenu = new ToolsMenuD(app);\n\t\tadd(toolsMenu);\n\n\t\t// \"Window\"\n\t\twindowMenu = new WindowMenuD(app);\n\n\t\tadd(windowMenu);\n\n\t\t// \"Help\"\n\t\thelpMenu = new HelpMenuD(app);\n\t\tadd(helpMenu);\n\n\t\t// support for right-to-left languages\n\t\tapp.setComponentOrientation(this);\n\t}", "@Override\n\tpublic boolean onCreateOptionsMenu(Menu menu) {\n\t\tgetMenuInflater().inflate(R.menu.main, menu);\n\t\treturn super.onCreateOptionsMenu(menu);\n\t}", "@Override\n\tpublic boolean onCreateOptionsMenu(Menu menu) {\n\t\tsuper.onCreateOptionsMenu(menu);\n\t\tMenuInflater blowUp=getMenuInflater();\n\t\tblowUp.inflate(R.menu.welcome_menu, menu);\n\t\treturn true;\n\t}", "@Override\r\n\tpublic boolean onCreateOptionsMenu(Menu menu) {\n\t\tgetMenuInflater().inflate(R.menu.listing, menu);\r\n\t\treturn true;\r\n\t}", "@Override\n public boolean onCreateOptionsMenu(Menu menu) {\n getMenuInflater().inflate(R.menu.item, menu);\n return true;\n }", "@Override\n\tpublic boolean onCreateOptionsMenu(Menu menu) {\n\t\tgetMenuInflater().inflate(R.menu.resource, menu);\n\t\treturn true;\n\t}", "@Override\n public boolean onCreateOptionsMenu(Menu menu) {\n MenuInflater inflater= getMenuInflater();\n inflater.inflate(R.menu.menu,menu);\n return super.onCreateOptionsMenu(menu);\n }", "@Override\n public boolean onCreateOptionsMenu(Menu menu) {\n MenuInflater inflater = getMenuInflater();\n inflater.inflate(R.menu.main, menu);\n return super.onCreateOptionsMenu(menu);\n }", "@Override\n public boolean onCreateOptionsMenu(Menu menu) {\n MenuInflater inflater = getMenuInflater();\n inflater.inflate(R.menu.main, menu);\n return super.onCreateOptionsMenu(menu);\n }", "@Override\n public boolean onCreateOptionsMenu(Menu menu) {\n MenuInflater inflater = getMenuInflater();\n inflater.inflate(R.menu.home_action_bar, menu);\n return super.onCreateOptionsMenu(menu);\n }", "@Override\n\tpublic boolean onCreateOptionsMenu(Menu menu) {\n\t\tgetMenuInflater().inflate(R.menu.template, menu);\n\t\treturn true;\n\t}", "@Override\n public boolean onCreateOptionsMenu(Menu menu) {\n Log.d(\"onCreateOptionsMenu\", \"create menu\");\n MenuInflater inflater = getMenuInflater();\n inflater.inflate(R.menu.socket_activity_actions, menu);\n return super.onCreateOptionsMenu(menu);\n }", "@Override\n public boolean onCreateOptionsMenu(Menu menu) {\n getMenuInflater().inflate(R.menu.main_menu, menu);//Menu Resource, Menu\n\n return true;\n }", "@Override\n public boolean onCreateOptionsMenu(Menu menu) {\n getMenuInflater().inflate(R.menu.actionbar, menu);\n return true;\n }", "@Override\n public boolean onCreateOptionsMenu(Menu menu) {\n getMenuInflater().inflate(toolbar_res, menu);\n updateMenuItemsVisibility(menu);\n return true;\n }", "@Override\n\tpublic boolean onCreateOptionsMenu(Menu menu) {\n\t\t// \n\t\tMenuInflater mi = getMenuInflater();\n\t\tmi.inflate(R.menu.thumb_actv_menu, menu);\n\t\t\n\t\treturn super.onCreateOptionsMenu(menu);\n\t}", "@Override\n\tpublic void onCreateOptionsMenu(Menu menu, MenuInflater inflater) {\n\t\tsuper.onCreateOptionsMenu(menu, inflater);\n\t}", "@Override\n\tpublic void onCreateOptionsMenu(Menu menu, MenuInflater inflater) {\n\t\tsuper.onCreateOptionsMenu(menu, inflater);\n\t}", "@Override\n\tpublic void onCreateOptionsMenu(Menu menu, MenuInflater inflater) {\n\t\tsuper.onCreateOptionsMenu(menu, inflater);\n\t}", "@Override\n public void onCreateOptionsMenu(Menu menu, MenuInflater inflater) {\n super.onCreateOptionsMenu(menu, inflater);\n }", "@Override\n\t\tpublic boolean onCreateOptionsMenu(Menu menu) {\n\t\t\tgetMenuInflater().inflate(R.menu.main, menu);\n\t\t\treturn true;\n\t\t}", "@Override\n\t\tpublic boolean onCreateOptionsMenu(Menu menu) {\n\t\t\tgetMenuInflater().inflate(R.menu.main, menu);\n\t\t\treturn true;\n\t\t}", "@Override\n\t\tpublic boolean onCreateOptionsMenu(Menu menu) {\n\t\t\tgetMenuInflater().inflate(R.menu.main, menu);\n\t\t\treturn true;\n\t\t}", "@Override\n public boolean onCreateOptionsMenu(Menu menu) {\n MenuInflater inflater = getMenuInflater();\n inflater.inflate(R.menu.swag_list_activity_menu, menu);\n return super.onCreateOptionsMenu(menu);\n }", "@Override\n public void onCreateOptionsMenu(Menu menu, MenuInflater inflater) {\n super.onCreateOptionsMenu(menu, inflater);\n\n }", "@Override\n public boolean onCreateOptionsMenu(Menu menu) {\n MenuInflater inflater = getMenuInflater();\n inflater.inflate(R.menu.main_menu, menu);\n return super.onCreateOptionsMenu(menu);\n }", "@Override\n\tpublic boolean onCreateOptionsMenu(android.view.Menu menu) {\n\t\tgetMenuInflater().inflate(R.menu.main, menu);\n\n\t\treturn true;\n\t}", "@Override\n\t\tpublic boolean onCreateOptionsMenu(Menu menu) {\n\t\t\tgetMenuInflater().inflate(R.menu.main, menu);\n\t\t\treturn true;\n\t}", "@Override\n\tpublic boolean onCreateOptionsMenu(Menu menu) {\n\t\tgetMenuInflater().inflate(R.menu.jarvi, menu);\n\t\treturn super.onCreateOptionsMenu(menu);\n\t}", "public void onCreateOptionsMenu(Menu menu, MenuInflater inflater){\n }", "@Override\n public void onCreateOptionsMenu(Menu menu, MenuInflater menuInflater) {\n menuInflater.inflate(R.menu.main, menu);\n\n }", "@Override\r\n\tpublic boolean onCreateOptionsMenu(Menu menu) {\n\t\tgetMenuInflater().inflate(R.menu.add__listing, menu);\r\n\t\treturn true;\r\n\t}", "@Override\r\n public boolean onCreateOptionsMenu(Menu menu) {\n getMenuInflater().inflate(R.menu.actmain, menu);\r\n return true;\r\n }", "@Override\n\tpublic boolean onCreateOptionsMenu(Menu menu) {\n\t\tgetMenuInflater().inflate(R.menu.buat_menu, menu);\n\t\treturn true;\n\t}", "@Override\n\tpublic boolean onCreateOptionsMenu(Menu menu) {\n\t\tgetMenuInflater().inflate(R.layout.menu, menu);\n\t\treturn true;\n\t}", "@Override\npublic boolean onCreateOptionsMenu(Menu menu) {\n\n\t\n\t\n\tgetMenuInflater().inflate(R.menu.main, menu);\n\t\n\treturn super.onCreateOptionsMenu(menu);\n}", "@Override\n\tpublic boolean onCreateOptionsMenu(Menu menu) {\n\t\tgetMenuInflater().inflate(R.menu.ichat, menu);\n\t\treturn true;\n\t}", "@Override\n public boolean onCreateOptionsMenu(Menu menu) {\n getMenuInflater().inflate(R.menu.menu, menu);\n return super.onCreateOptionsMenu(menu);\n }", "@Override\n\tpublic void onCreateOptionsMenu(Menu menu, MenuInflater inflater)\n\t{\n\t\tsuper.onCreateOptionsMenu(menu, inflater);\n\t\tinflater.inflate(R.menu.expenses_menu, menu);\n\t}", "@Override\n \tpublic boolean onCreateOptionsMenu(Menu menu) {\n \t\tgetMenuInflater().inflate(R.menu.main, menu);\n \t\treturn true;\n \t}", "@Override\n \tpublic boolean onCreateOptionsMenu(Menu menu) {\n \t\tgetMenuInflater().inflate(R.menu.main, menu);\n \t\treturn true;\n \t}", "@Override\n \tpublic boolean onCreateOptionsMenu(Menu menu) {\n \t\tgetMenuInflater().inflate(R.menu.main, menu);\n \t\treturn true;\n \t}", "@Override\n public boolean onCreateOptionsMenu(Menu menu) {\n getMenuInflater().inflate(R.menu.action_bar, menu);\n return true;\n }", "@Override\n\tpublic boolean onCreateOptionsMenu(Menu menu) {\n\t\tsuper.onCreateOptionsMenu(menu);\n\t\tMenuInflater blowUp = getMenuInflater();\n\t\tblowUp.inflate(R.menu.status, menu);\n\t\treturn true;\n\t}", "@Override\r\n\tpublic boolean onCreateOptionsMenu(Menu menu) {\n\t\tgetMenuInflater().inflate(R.menu.menu, menu);\r\n\t\treturn true;\r\n\t}", "@Override\n\tpublic void onCreateOptionsMenu(Menu menu, MenuInflater inflater) {\n\t}", "@Override\n\tpublic boolean onCreateOptionsMenu(Menu menu) {\n\t\tMenuInflater inflater = getMenuInflater();\n\t\tinflater.inflate(R.menu.main, menu);\n\t\treturn true;\n\t}", "@Override\r\n\tpublic boolean onCreateOptionsMenu(Menu menu) {\n\t\tgetMenuInflater().inflate(R.menu.ui_main, menu);\r\n\t\treturn true;\r\n\t}", "@Override\n public boolean onCreateOptionsMenu(Menu menu) {\n getMenuInflater().inflate(R.menu.main_activity_actions, menu);\n return true;\n }", "@Override\n public void onCreateOptionsMenu(Menu menu, MenuInflater inflater) {\n inflater.inflate(R.menu.menu_main, menu);\n super.onCreateOptionsMenu(menu, inflater);\n }", "@Override\n public void onCreateOptionsMenu(Menu menu, MenuInflater inflater) {\n inflater.inflate(R.menu.menu_main, menu);\n super.onCreateOptionsMenu(menu, inflater);\n }" ]
[ "0.7246102", "0.7201358", "0.7194834", "0.7176498", "0.71066517", "0.7039537", "0.7037961", "0.70112145", "0.70094734", "0.69807225", "0.6944953", "0.69389373", "0.6933199", "0.6916928", "0.6916928", "0.6891486", "0.68831646", "0.68754137", "0.68745375", "0.68621665", "0.68621665", "0.68621665", "0.68621665", "0.68515885", "0.68467957", "0.68194443", "0.6817494", "0.6813087", "0.6813087", "0.6812847", "0.6805774", "0.6801204", "0.6797914", "0.6791314", "0.6789091", "0.67883503", "0.6783642", "0.6759701", "0.6757412", "0.67478645", "0.6744127", "0.6744127", "0.67411774", "0.6740183", "0.6726017", "0.6723245", "0.67226785", "0.67226785", "0.67208904", "0.67113477", "0.67079866", "0.6704564", "0.6699229", "0.66989094", "0.6696622", "0.66952467", "0.66865396", "0.6683476", "0.6683476", "0.6682188", "0.6681209", "0.6678941", "0.66772443", "0.6667702", "0.66673946", "0.666246", "0.6657578", "0.6657578", "0.6657578", "0.6656586", "0.66544783", "0.66544783", "0.66544783", "0.66524047", "0.6651954", "0.6650132", "0.66487855", "0.6647077", "0.66467404", "0.6646615", "0.66464466", "0.66449624", "0.6644209", "0.6643461", "0.6643005", "0.66421187", "0.6638628", "0.6634786", "0.6633529", "0.6632049", "0.6632049", "0.6632049", "0.66315657", "0.6628954", "0.66281766", "0.6627182", "0.6626297", "0.6624309", "0.6619582", "0.6618876", "0.6618876" ]
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) { switch (item.getItemId()){ case R.id.salvarContato: salvar(); return true; case R.id.delContato: mFireBaseRef.child(firebaseID).removeValue(); Toast.makeText(getApplicationContext(),"Removido com sucesso",Toast.LENGTH_SHORT).show(); finish(); return true; default: 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 //\n int id = item.getItemId();\n if (id == android.R.id.home) {\n // Back button clicked\n this.finish();\n }\n\n return super.onOptionsItemSelected(item);\n }", "@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n switch (item.getItemId()) {\n case android.R.id.home:\n // app icon in action bar clicked; goto parent activity.\n onBackPressed();\n return true;\n default:\n return super.onOptionsItemSelected(item);\n }\n }", "@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n switch (item.getItemId()) {\n // Respond to the action bar's Up/Home button\n case android.R.id.home:\n onBackPressed();\n return true;\n default:\n return super.onOptionsItemSelected(item);\n }\n }", "@Override\r\n public boolean onOptionsItemSelected(MenuItem item) {\n int id = item.getItemId();\r\n switch (id) {\r\n case android.R.id.home:\r\n // app icon in action bar clicked; go home\r\n this.finish();\r\n return true;\r\n default:\r\n return super.onOptionsItemSelected(item);\r\n }\r\n }", "@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n int id = item.getItemId();\n if (id == android.R.id.home) {\n // app icon in action bar clicked; go home\n finish();\n }\n return super.onOptionsItemSelected(item);\n }", "@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n int id = item.getItemId();\n\n if (id == android.R.id.home) {\n Log.e(\"clik\", \"action bar clicked\");\n finish();\n }\n\n return super.onOptionsItemSelected(item);\n }", "@Override\n\t public boolean onOptionsItemSelected(MenuItem item) {\n\t int id = item.getItemId();\n\t \n\t\t\tif (id == android.R.id.home) {\n\t\t\t\t// Respond to the action bar's Up/Home button\n\t\t\t\t// NavUtils.navigateUpFromSameTask(this);\n\t\t\t\tonBackPressed();\n\t\t\t\treturn true;\n\t\t\t}\n\t \n\t \n\t return super.onOptionsItemSelected(item);\n\t }", "@Override\r\n public boolean onOptionsItemSelected(MenuItem item) {\r\n switch (item.getItemId()) {\r\n // Respond to the action bar's Up/Home button\r\n case android.R.id.home:\r\n finish();\r\n return true;\r\n }\r\n return super.onOptionsItemSelected(item);\r\n }", "@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n switch (item.getItemId()) {\n // Respond to the action bar's Up/Home button\n case android.R.id.home:\n finish();\n return true;\n }\n\n return super.onOptionsItemSelected(item);\n }", "@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n int id = item.getItemId();\n\n //noinspection SimplifiableIfStatement\n\n switch (item.getItemId()) {\n case android.R.id.home:\n\n // app icon in action bar clicked; goto parent activity.\n this.finish();\n return true;\n default:\n\n return super.onOptionsItemSelected(item);\n\n }\n }", "@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n int id = item.getItemId();\n\n //noinspection SimplifiableIfStatement\n\n switch (item.getItemId()) {\n case android.R.id.home:\n\n // app icon in action bar clicked; goto parent activity.\n this.finish();\n return true;\n default:\n\n return super.onOptionsItemSelected(item);\n\n }\n }", "@Override\n\tpublic boolean onOptionsItemSelected(MenuItem item) {\n\t\tswitch (item.getItemId()) {\n\t\tcase android.R.id.home:\n\t\t\tonBackPressed();\n\t\t\treturn true;\n\t\tdefault:\n\t\t\treturn super.onOptionsItemSelected(item);\n\t\t}\n\t}", "@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n // Handle presses on the action bar items\n switch (item.getItemId()) {\n case android.R.id.home:\n onBackPressed();\n return true;\n case R.id.action_clear:\n return true;\n case R.id.action_done:\n\n return true;\n default:\n return super.onOptionsItemSelected(item);\n }\n }", "@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n int id = item.getItemId();\n switch (id) {\n case android.R.id.home:\n onActionHomePressed();\n return true;\n }\n return super.onOptionsItemSelected(item);\n }", "@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n int id = item.getItemId();\n\n switch (id) {\n case android.R.id.home:\n onBackPressed();\n break;\n }\n return super.onOptionsItemSelected(item);\n }", "@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n int id = item.getItemId();\n switch (id) {\n case android.R.id.home:\n onBackPressed();\n break;\n }\n\n return super.onOptionsItemSelected(item);\n }", "@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n\n switch (item.getItemId())\n {\n case android.R.id.home :\n super.onBackPressed();\n break;\n }\n return super.onOptionsItemSelected(item);\n }", "@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n switch (item.getItemId ()) {\n case android.R.id.home:\n onBackPressed ();\n return true;\n\n default:\n break;\n }\n return super.onOptionsItemSelected ( item );\n }", "@Override\n\tpublic boolean onOptionsItemSelected(MenuItem item) {\n\t switch (item.getItemId()) {\n\t\tcase android.R.id.home:\n\t\t\t// app icon in action bar clicked; go home \n\t\t\tIntent intent = new Intent(this, Kelutral.class); \n\t\t\tintent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP); \n\t\t\tstartActivity(intent); \n\t\t\treturn true;\t\t\n\t case R.id.Search:\n\t \treturn onSearchRequested();\n\t\tcase R.id.AppInfo:\n\t\t\t// Place holder menu item\n\t\t\tIntent newIntent = new Intent(Intent.ACTION_VIEW,\n\t\t\t\t\tUri.parse(\"http://forum.learnnavi.org/mobile-apps/\"));\n\t\t\tstartActivity(newIntent);\n\t\t\treturn true;\n\t\tcase R.id.Preferences:\n\t\t\tnewIntent = new Intent(getBaseContext(), Preferences.class);\n\t\t\tstartActivity(newIntent);\n\t\t\treturn true;\t\n\t }\n\t return false;\n\t}", "@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n switch (item.getItemId()) {\n\n case android.R.id.home:\n onBackPressed();\n return true;\n\n }\n return super.onOptionsItemSelected(item);\n\n }", "@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n switch (item.getItemId()) {\n case android.R.id.home:\n onBackPressed();\n return true;\n\n default:\n return super.onOptionsItemSelected(item);\n }\n\n }", "@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n switch (item.getItemId()) {\n case android.R.id.home:\n // Intent homeIntent = new Intent(this, MainActivity.class);\n // homeIntent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);\n // startActivity(homeIntent);\n finish();\n return true;\n default:\n return (super.onOptionsItemSelected(item));\n }\n\n }", "@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n // setResult and close the activity when Action Bar Up Button clicked.\n if (item.getItemId() == android.R.id.home) {\n setResult(RESULT_CANCELED);\n finish();\n return true;\n }\n return super.onOptionsItemSelected(item);\n }", "@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n int id = item.getItemId();\n if (id == android.R.id.home) {\n // This ID represents the Home or Up button. In the case of this\n // activity, the Up button is shown. Use NavUtils to allow users\n // to navigate up one level in the application structure. For\n // more details, see the Navigation pattern on Android Design:\n //\n // http://developer.android.com/design/patterns/navigation.html#up-vs-back\n //\n \tgetActionBar().setDisplayHomeAsUpEnabled(false);\n \tgetFragmentManager().popBackStack();\n return true;\n }\n return super.onOptionsItemSelected(item);\n }", "@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n\n switch (item.getItemId()) {\n case android.R.id.home:\n super.onBackPressed();\n return true;\n\n default:\n // If we got here, the user's action was not recognized.\n // Invoke the superclass to handle it.\n return super.onOptionsItemSelected(item);\n\n }\n }", "@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n int id = item.getItemId();\n\n //noinspection SimplifiableIfStatement\n if(id == android.R.id.home){\n onBackPressed();\n }\n\n return super.onOptionsItemSelected(item);\n }", "@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n int id = item.getItemId();\n\n if (id == android.R.id.home) {\n onBackPressed();\n return true;\n }\n\n return super.onOptionsItemSelected(item);\n }", "@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n switch (item.getItemId()) {\n case android.R.id.home:\n onBackPressed();\n return true;\n default:\n return super.onOptionsItemSelected(item);\n\n }\n\n }", "@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n switch (item.getItemId()) {\n case android.R.id.home:\n onBackPressed();\n return true;\n }\n return super.onOptionsItemSelected(item);\n }", "@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n switch (item.getItemId()) {\n case android.R.id.home:\n onBackPressed();\n return true;\n }\n return super.onOptionsItemSelected(item);\n }", "@RequiresApi(api = Build.VERSION_CODES.M)\n @Override\n public boolean onOptionsItemSelected(MenuItem item) {\n switch (item.getItemId()) {\n case android.R.id.home:\n onBackPressed();\n break;\n }\n return super.onOptionsItemSelected(item);\n }", "@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n switch (item.getItemId()) {\n case android.R.id.home:\n onBackPressed();\n return true;\n\n default:\n return super.onOptionsItemSelected(item);\n }\n }", "@Override\r\n\tpublic boolean onOptionsItemSelected(MenuItem item) {\n\t\tif(item.getItemId()==android.R.id.home)\r\n\t\t{\r\n\t\t\tgetActivity().onBackPressed();\r\n\t\t}\r\n\t\treturn super.onOptionsItemSelected(item);\r\n\t}", "@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n if(item.getItemId()==android.R.id.home){\n super.onBackPressed();\n }\n return super.onOptionsItemSelected(item);\n }", "@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n int id = item.getItemId();\n\n switch (id) {\n case android.R.id.home:\n onBackPressed();\n return false;\n }\n\n return super.onOptionsItemSelected(item);\n }", "@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n switch (item.getItemId()) {\n //Back arrow\n case android.R.id.home:\n onBackPressed();\n }\n return super.onOptionsItemSelected(item);\n }", "@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n switch (item.getItemId()) {\n case android.R.id.home:\n onBackPressed();\n return true;\n }\n\n return super.onOptionsItemSelected(item);\n }", "@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n switch (item.getItemId()) {\n case android.R.id.home:\n onBackPressed();\n return true;\n default:\n return super.onOptionsItemSelected(item);\n }\n }", "@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n switch (item.getItemId()) {\n case android.R.id.home:\n onBackPressed();\n return true;\n default:\n return super.onOptionsItemSelected(item);\n }\n }", "@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n switch (item.getItemId()) {\n case android.R.id.home:\n onBackPressed();\n return true;\n default:\n return super.onOptionsItemSelected(item);\n }\n }", "@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n switch (item.getItemId()) {\n case android.R.id.home:\n // android.R.id.home是Android内置home按钮的id\n finish();\n break;\n }\n return super.onOptionsItemSelected(item);\n }", "@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n switch (item.getItemId()) {\n case android.R.id.home:\n super.onBackPressed();\n return true;\n }\n return super.onOptionsItemSelected(item);\n }", "@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n switch (item.getItemId()) {\n case android.R.id.home:\n this.onBackPressed();\n return false;\n }\n return false;\n }", "@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n // 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 int id = item.getItemId();\n\n\n return super.onOptionsItemSelected(item);\n }", "@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n switch (item.getItemId()) {\n case android.R.id.home:\n onBackPressed();\n return true;\n default:\n }\n return super.onOptionsItemSelected(item);\n }", "@Override\r\n public boolean onOptionsItemSelected(MenuItem item) {\r\n switch (item.getItemId()) {\r\n\r\n case android.R.id.home:\r\n /*Intent i= new Intent(getApplication(), MainActivity.class);\r\n i.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK | Intent.FLAG_ACTIVITY_CLEAR_TOP);\r\n startActivity(i);*/\r\n onBackPressed();\r\n finish();\r\n return true;\r\n default:\r\n return super.onOptionsItemSelected(item);\r\n }\r\n }", "@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n int id = item.getItemId();\n\n switch (id){\n case android.R.id.home:\n this.finish();\n return true;\n }\n\n return super.onOptionsItemSelected(item);\n }", "@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n switch (item.getItemId()) {\n // Respond to the action bar's Up/Home button\n case android.R.id.home:\n NavUtils.navigateUpFromSameTask(getActivity());\n return true;\n case R.id.action_settings:\n Intent i = new Intent(getActivity(), SettingsActivity.class);\n startActivity(i);\n return true;\n }\n\n return super.onOptionsItemSelected(item);\n }", "@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n // Pass the event to ActionBarDrawerToggle, if it returns\n // true, then it has handled the app icon touch event\n if (mDrawerToggle.onOptionsItemSelected(item)) {\n return true;\n }\n\n // Handle your other action bar items...\n return super.onOptionsItemSelected(item);\n }", "@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n int id = item.getItemId();\n //Fixes the Up Button\n if(id == android.R.id.home) {\n BuildRoute.this.finish();\n return true;\n }\n return super.onOptionsItemSelected(item);\n }", "@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n switch (item.getItemId()){\n case android.R.id.home:\n onBackPressed();\n break;\n }\n return true;\n }", "@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n int id = item.getItemId();\n\n\n if (id == android.R.id.home) {\n NavUtils.navigateUpFromSameTask(this);\n }\n\n return super.onOptionsItemSelected(item);\n }", "@Override\r\n public boolean onOptionsItemSelected(MenuItem item) {\n switch (item.getItemId()) {\r\n case android.R.id.home:\r\n onBackPressed();\r\n break;\r\n }\r\n return true;\r\n }", "@Override\n\tpublic boolean onOptionsItemSelected(MenuItem item) {\n\t\tif (item.getItemId() == android.R.id.home) {\n\t\t\tfinish();\n\t\t}\n\t\treturn super.onOptionsItemSelected(item);\n\t}", "@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n\n onBackPressed();\n\n return super.onOptionsItemSelected(item);\n }", "@Override\r\n public boolean onOptionsItemSelected(MenuItem item) {\n int id = item.getItemId();\r\n if ( id == android.R.id.home ) {\r\n finish();\r\n return true;\r\n }\r\n return super.onOptionsItemSelected(item);\r\n }", "@Override\r\n public boolean onOptionsItemSelected(MenuItem item) {\n int id = item.getItemId();\r\n\r\n //noinspection SimplifiableIfStatement\r\n if (id == R.id.home) {\r\n NavUtils.navigateUpFromSameTask(this);\r\n return true;\r\n }\r\n\r\n //noinspection SimplifiableIfStatement\r\n if (id == R.id.action_about) {\r\n AboutDialog();\r\n return true;\r\n }\r\n\r\n //noinspection SimplifiableIfStatement\r\n if (id == R.id.action_exit) {\r\n finish();\r\n return true;\r\n }\r\n\r\n\r\n return super.onOptionsItemSelected(item);\r\n }", "@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n int id = item.getItemId();\n\n if (id == android.R.id.home) {\n\n this.finish();\n }\n\n return super.onOptionsItemSelected(item);\n }", "@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n int id = item.getItemId();\n\n if (id == android.R.id.home) {\n\n this.finish();\n }\n\n return super.onOptionsItemSelected(item);\n }", "@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n int id = item.getItemId();\n\n//noinspection SimplifiableIfStatement\n if (id == android.R.id.home) {\n// finish the activity\n onBackPressed();\n return true;\n }\n\n return super.onOptionsItemSelected(item);\n }", "@Override\n public boolean onOptionsItemSelected(MenuItem item)\n {\n int id = item.getItemId();\n\n //noinspection SimplifiableIfStatement\n if( id == android.R.id.home ) // Back button of the actionbar\n {\n finish();\n return true;\n }\n\n return super.onOptionsItemSelected(item);\n }", "@Override\r\n\t\tpublic boolean onOptionsItemSelected(MenuItem item) {\n\t\t\tswitch (item.getItemId()) {\r\n\t\t\tcase android.R.id.home:\r\n\t\t\t\tfinish();\r\n\t\t\t\tbreak;\r\n\t\t\tdefault:\r\n\t\t\t\tbreak;\r\n\t\t\t}\r\n\t\t\treturn super.onOptionsItemSelected(item);\r\n\t\t}", "@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n switch (item.getItemId()) {\n case android.R.id.home:\n\n this.finish();\n return true;\n default:\n return super.onOptionsItemSelected(item);\n }\n\n }", "@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n if (item.getItemId() == android.R.id.home) {\n onBackPressed();\n return true;\n }\n return false;\n }", "@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n int id = item.getItemId();\n\n\n if(id == android.R.id.home){\n finish();\n }\n\n return super.onOptionsItemSelected(item);\n }", "@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n\n if (item.getItemId() == android.R.id.home) {\n finish();\n }\n return super.onOptionsItemSelected(item);\n }", "@Override\r\n\tpublic boolean onOptionsItemSelected(MenuItem item) {\n\t\tswitch (item.getItemId()) {\r\n\t\tcase android.R.id.home:\r\n\t\t\tsetResult(RESULT_OK, getIntent());\r\n\t\t\tfinish();\r\n\t\t\tbreak;\r\n\t\t}\r\n\t\treturn true;\r\n\t}", "@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n int id = item.getItemId();\n\n //noinspection SimplifiableIfStatement\n if (id == android.R.id.home) {\n onBackPressed();\n return true;\n }\n\n return super.onOptionsItemSelected(item);\n }", "@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n int id = item.getItemId();\n\n //noinspection SimplifiableIfStatement\n if (id == android.R.id.home) {\n onBackPressed();\n return true;\n }\n\n return super.onOptionsItemSelected(item);\n }", "@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n int id = item.getItemId();\n\n //noinspection SimplifiableIfStatement\n if (id == android.R.id.home) {\n onBackPressed();\n return true;\n }\n\n return super.onOptionsItemSelected(item);\n }", "@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n int id = item.getItemId();\n\n //noinspection SimplifiableIfStatement\n if (id == android.R.id.home) {\n onBackPressed();\n return true;\n }\n\n return super.onOptionsItemSelected(item);\n }", "@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n switch (item.getItemId()) {\n case android.R.id.home:\n finish();\n return true;\n default:\n // If we got here, the user's action was not recognized.\n // Invoke the superclass to handle it.\n return super.onOptionsItemSelected(item);\n\n }\n }", "@Override\n\tpublic boolean onOptionsItemSelected(MenuItem item) {\n\t\tswitch (item.getItemId()) {\n\t\tcase android.R.id.home:\n\t\t\tfinish();\n\t\t\tbreak;\n\n\t\t}\n\t\treturn super.onOptionsItemSelected(item);\n\t}", "@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n int id = item.getItemId();\n\n switch (id) {\n\n case android.R.id.home:\n this.finish();\n return true;\n }\n return true;\n }", "@Override\n\tpublic boolean onOptionsItemSelected(MenuItem item) {\n\t\tswitch (item.getItemId()) {\n\t\tcase android.R.id.home:\n\t\t\tfinish();\n\t\t\tbreak;\n\n\t\tdefault:\n\t\t\tbreak;\n\t\t}\n\t\treturn super.onOptionsItemSelected(item);\n\t}", "@Override\n\tpublic boolean onOptionsItemSelected(MenuItem item) {\n\t\tint id = item.getItemId();\n\t\tif (id == android.R.id.home) {\n\t\t\tfinish();\n\t\t\treturn true;\n\t\t}\n\t\treturn super.onOptionsItemSelected(item);\n\t}", "@Override\r\n public boolean onOptionsItemSelected(MenuItem item) {\n int id = item.getItemId();\r\n if (id == android.R.id.home) {\r\n finish();\r\n return true;\r\n }\r\n return super.onOptionsItemSelected(item);\r\n }", "@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n switch (item.getItemId()) {\n case android.R.id.home:\n onBackPressed();\n //NavUtils.navigateUpFromSameTask(this);\n return true;\n default:\n return super.onOptionsItemSelected(item);\n }\n }", "@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n switch (item.getItemId()) {\n case android.R.id.home:\n // todo: goto back activity from here\n finish();\n return true;\n\n default:\n return super.onOptionsItemSelected(item);\n }\n }", "@Override\r\n public boolean onOptionsItemSelected(MenuItem item) {\r\n // Handle item selection\r\n switch (item.getItemId()) {\r\n case android.R.id.home:\r\n onBackPressed();\r\n return true;\r\n\r\n case me.cchiang.lookforthings.R.id.action_sample:\r\n// Snackbar.make(parent_view, item.getTitle() + \" Clicked \", Snackbar.LENGTH_SHORT).show();\r\n return true;\r\n default:\r\n return super.onOptionsItemSelected(item);\r\n }\r\n }", "@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n int id = item.getItemId();\n if (id == android.R.id.home) {\n finish();\n }\n return super.onOptionsItemSelected(item);\n }", "@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n int id = item.getItemId();\n if (id == android.R.id.home) {\n finish();\n }\n return super.onOptionsItemSelected(item);\n }", "@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n switch (item.getItemId()) {\n case android.R.id.home:\n finish();\n return true;\n default:\n return super.onOptionsItemSelected(item);\n }\n\n\n }", "@Override\n\tpublic boolean onOptionsItemSelected(MenuItem item) {\n\t\tswitch (item.getItemId()) {\n\t\tcase android.R.id.home:\n\t\t\tonBackPressed();\n\t\t\treturn true;\n\t\tcase R.id.scan_menu:\n\t\t\tonScan();\n\t\t\tbreak;\n\t\tcase R.id.opt_about:\n\t\t\t//onAbout();\n\t\t\tbreak;\n\t\tcase R.id.opt_exit:\n\t\t\tfinish();\n\t\t\tbreak;\n\t\tdefault:\n\t\t\treturn super.onOptionsItemSelected(item);\n\t\t}\n\t\treturn true;\n\t}", "@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n int id = item.getItemId();\n\n //noinspection SimplifiableIfStatement\n if (id == android.R.id.home) {\n super.onBackPressed();\n return true;\n }\n\n return super.onOptionsItemSelected(item);\n }", "@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n int id = item.getItemId();\n\n switch (id) {\n case android.R.id.home:\n this.finish();\n return true;\n default:\n return super.onOptionsItemSelected(item);\n }\n }", "@Override\n public boolean onOptionsItemSelected(@NonNull MenuItem item) {\n if (item.getItemId() == android.R.id.home) {\n onBackPressed();\n }\n return super.onOptionsItemSelected(item);\n }", "@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n int id = item.getItemId();\n switch (id) {\n case android.R.id.home:\n finish();\n return true;\n }\n return super.onOptionsItemSelected(item);\n }", "@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n switch (item.getItemId()) {\n\n case android.R.id.home:\n finish();\n return true;\n\n }\n return super.onOptionsItemSelected(item);\n }", "@Override\r\n\tpublic boolean onOptionsItemSelected(MenuItem item) {\r\n\t switch (item.getItemId()) {\r\n\t \t// back to previous page\r\n\t case android.R.id.home:\r\n\t finish();\r\n\t return true;\r\n\t }\r\n\t return super.onOptionsItemSelected(item);\r\n\t}", "@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n int id = item.getItemId();\n\n if(id==android.R.id.home){\n finish();\n }\n\n return super.onOptionsItemSelected(item);\n }", "@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n int id = item.getItemId();\n\n if (id == android.R.id.home) {\n finish();\n }\n\n return super.onOptionsItemSelected(item);\n }", "@Override\r\n public boolean onOptionsItemSelected(MenuItem item) {\n int id = item.getItemId();\r\n\r\n //noinspection SimplifiableIfStatement\r\n if (id == android.R.id.home) {\r\n // finish the activity\r\n onBackPressed();\r\n return true;\r\n }\r\n\r\n return super.onOptionsItemSelected(item);\r\n }", "@Override\r\n public boolean onOptionsItemSelected(MenuItem item) {\n int id = item.getItemId();\r\n\r\n //noinspection SimplifiableIfStatement\r\n if (id == android.R.id.home) {\r\n // finish the activity\r\n onBackPressed();\r\n return true;\r\n }\r\n\r\n return super.onOptionsItemSelected(item);\r\n }", "@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n switch (item.getItemId())\n {\n case android.R.id.home:\n this.finish();\n return (true);\n }\n return super.onOptionsItemSelected(item);\n }", "@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n int id = item.getItemId();\n if (id == android.R.id.home) {\n finish();\n return true;\n }\n return super.onOptionsItemSelected(item);\n }", "@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n int id = item.getItemId();\n if (id == android.R.id.home) {\n finish();\n return true;\n }\n return super.onOptionsItemSelected(item);\n }", "@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n int id = item.getItemId();\n\n switch (id){\n case R.id.home:{\n NavUtils.navigateUpFromSameTask(this);\n return true;\n }\n }\n return super.onOptionsItemSelected(item);\n }", "@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n int id = item.getItemId();\n\n //noinspection SimplifiableIfStatement\n switch(item.getItemId())\n {\n case android.R.id.home:\n super.onBackPressed();\n break;\n }\n\n return super.onOptionsItemSelected(item);\n }", "@Override\n\tpublic boolean onOptionsItemSelected(MenuItem item) {\n\t\tswitch (item.getItemId()) {\n\t\tcase android.R.id.home:\n\t\t\tfinish();\n\t\t\treturn true;\n\n\t\tdefault:\n\t\t\treturn super.onOptionsItemSelected(item);\n\t\t}\n\t}", "@Override\r\n public boolean onOptionsItemSelected(MenuItem item) {\n\r\n int id = item.getItemId();\r\n if(id==android.R.id.home){\r\n finish();\r\n return true;\r\n }\r\n return super.onOptionsItemSelected(item);\r\n }" ]
[ "0.79042155", "0.7806028", "0.77664185", "0.77272826", "0.7631844", "0.7621488", "0.75845605", "0.753064", "0.7487905", "0.74575514", "0.74575514", "0.74386317", "0.7421903", "0.7403247", "0.7391723", "0.7386928", "0.73795277", "0.73705643", "0.73629", "0.7356027", "0.73457146", "0.7341677", "0.7330269", "0.73286206", "0.73259205", "0.7318742", "0.73166424", "0.7313651", "0.73043346", "0.73043346", "0.7302004", "0.7298322", "0.7293478", "0.7286882", "0.72833675", "0.7281119", "0.7278846", "0.7260001", "0.7260001", "0.7260001", "0.7259835", "0.7259735", "0.72501683", "0.7223814", "0.72196406", "0.7217465", "0.72045285", "0.7200451", "0.72002554", "0.7193104", "0.71854025", "0.7177578", "0.71688485", "0.71676797", "0.7154283", "0.7153666", "0.71358424", "0.7134874", "0.7134874", "0.7129114", "0.7128835", "0.712455", "0.7123474", "0.71234286", "0.71219903", "0.7117247", "0.71171784", "0.7117064", "0.7117064", "0.7117064", "0.7117064", "0.7116658", "0.7115131", "0.711245", "0.71100235", "0.7108964", "0.71056783", "0.70997596", "0.70984596", "0.7095257", "0.7093685", "0.7093685", "0.7086445", "0.7082642", "0.70809126", "0.70803297", "0.7073717", "0.7068416", "0.7061941", "0.7060972", "0.70600253", "0.70513433", "0.7037323", "0.7037323", "0.703622", "0.7035475", "0.7035475", "0.7032586", "0.70306236", "0.7029725", "0.7018862" ]
0.0
-1
Write your solution here
public String reverse(String input) { char[] carr = input.toCharArray(); reverse(carr, 0 ,carr[carr.length - 1]); return String.valueOf(carr); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private void generateSolution() {\n\t\t// TODO\n\n\t}", "public void solution() {\n\t\t\n\t}", "public void findSolution() {\n\n\t\t// TODO\n\t}", "public static String solution() {\r\n\t\treturn \"73162890\";\r\n\t}", "public static void main(String[] args) {\n\t\tSystem.out.println(solution());\r\n\t}", "@Override\r\n\tpublic void solve() {\n\t\t\r\n\t}", "public static void main(String[] args) {\n\t\t\tSystem.out.println(Solution(5, 83));\n\t\t\t\n\t\t}", "@Override\n public String solve() {\n int LIMIT = 50 * NumericHelper.ONE_MILLION_INT;\n int[] nCount = new int[LIMIT+1];\n for(long y = 1; y<= LIMIT; y++) {\n for(long d= (y+3)/4; d<y; d++) { // +3 is to make d atleast 1\n long xSq = (y+d) * (y+d);\n long ySq = y * y;\n long zSq = (y-d) * (y-d);\n\n long n = xSq - ySq - zSq;\n\n if(n<0) {\n continue;\n }\n\n if(n>=LIMIT) {\n break;\n }\n\n\n nCount[(int)n]++;\n\n }\n }\n\n int ans = 0;\n for(int i = 1; i<LIMIT; i++) {\n if(nCount[i] == 1) {\n //System.out.print(i +\",\");\n ans++;\n }\n }\n\n return Integer.toString(ans);\n }", "public static void main(String[] args) {\n\t\tint [] arr = {4,2,3,5};\r\n\t\tint [] answer = solution(arr);\r\n\t\tfor(int i=0;i<answer.length;i++)\r\n\t\t\tSystem.out.print(answer[i]+\" \");\r\n\t}", "public static void main(String[] args) throws Exception {\n\t\tString folderURL = \"C:\\\\Users\\\\Administrator\\\\Google ÔÆ¶ËÓ²ÅÌ\\\\Slides\\\\CS686\\\\A2\\\\SodukoProblem\\\\problems\\\\\";\n\t\tList<String> nameList = Loader.getAllSdURLFromFolder(folderURL);\n\t\tList<Solution> record = new ArrayList<Solution>();\n\t\tfor (String name:nameList)\n\t\t{\n\t\t\t//System.out.println(name);\n\t\t\tBoard board = Loader.loadInitialBoard(name);\n\t\t\tSudokuSolver solver = SudokuSolver.getInstance();\n\t\t\tSolution solution = solver.solve(board);\n\t\t\trecord.add(solution);\n\t\t\tSystem.out.print(solution.initNum+\" \");\n\t\t\tSystem.out.print(solution.cntState+\" \");\n\t\t\t//System.out.println(solution.board);\n\t\t\tSystem.out.println(solution.isFinished?\"Finished\":\"Failed\");\n\t\t\tif (solution.cntState>0)\n\t\t\t{\n\t\t\t\tSystem.out.println(board);\n\t\t\t\tSystem.out.println(solution.board);\n\t\t\t}\n\t\t\t//if (!solution.isFinished) break;\n\t\t}\n\t\t//printStatistics(record);\n\t\t\n\t}", "public static void main(String[] args) {\n\t\tint[][] maps = \n\t\t\t{\n\t\t\t\t\t{1,0,1,1,1},\n\t\t\t\t\t{1,0,1,0,1},\n\t\t\t\t\t{1,0,1,1,1},\n\t\t\t\t\t{1,1,1,0,1},\n\t\t\t\t\t{0,0,0,0,1}\n\t\t\t};\n\t\tSystem.out.println(solution(maps));\n\t}", "@Override\n public void handleSolution(String solution,long time) {\n \n }", "public static void main(String[] args) {\n\t\tString[][] relation = {\r\n\t\t\t{\"100\",\"ryan\",\"music\",\"2\"},{\"200\",\"apeach\",\"math\",\"2\"},{\"300\",\"tube\",\"computer\",\"3\"},{\"400\",\"con\",\"computer\",\"4\"},{\"500\",\"muzi\",\"music\",\"3\"},{\"600\",\"apeach\",\"music\",\"2\"}\r\n\t\t};\r\n\r\n\t\tSystem.out.println(solution(relation));\r\n\t}", "public static void main(String[] args) {\n\n Solution2.solution();\n }", "public static void main(String[] args) {\n\t\tSystem.out.println(solution(0));\n\n\t}", "@Test\n public void testSolution() {\n assertSolution(\"425\", \"input-day01-2018.txt\");\n }", "public static void main(String[] args) {\n\t\tSystem.out.println(Arrays.toString(solution(8, 1)));\r\n\t}", "@Override\n\t public String solve() {\n\t if (count == 0) {\n\t answer1 = getVariable2()*getVariable3();\n\t setAnswer(answer1 + \"\");\n\t } else if (count == 1) {\n\t answer1 = getVariable1()/getVariable2();\n\t setAnswer(answer1 + \"\");\n\t }else if (count == 2) {\n\t answer1 = getVariable1()/getVariable3();\n\t setAnswer(answer1 + \"\");\n\t }\n\t return getAnswer();\n\t }", "public static void main(String[] args) {\n System.out.println(Arrays.toString(solution(\"\")));\n System.out.println(Arrays.toString(solution(\"abcdef\")));\n System.out.println(Arrays.toString(solution(\"HelloWorld\")));\n System.out.println(Arrays.toString(solution(\"abcde\")));\n System.out.println(Arrays.toString(solution(\"LovePizza\")));\n\n }", "@Override\n\tpublic String getSolution() {\n\t\treturn \"Ajouter des composants au circuit\";\n\t}", "public void affichageSolution() {\n\t\t//On commence par retirer toutes les traces pré-existantes du labyrinthe\n\t\tfor (int i = 0 ; i < this.laby.getHauteur() ; i++) {\n\t\t\tfor (int j = 0 ; j < this.laby.getLargeur() ; j++) {\n\t\t\t\tif (this.laby.getLabyrinthe()[i][j] instanceof Trace) {\n\t\t\t\t\tthis.laby.getLabyrinthe()[i][j] = new Case();\n\t\t\t\t\t((JLabel)grille.getComponents()[i*this.laby.getLargeur()+j]).setIcon(this.laby.getLabyrinthe()[i][j].imageCase(themeJeu));\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t//On parcourt toutes les cases du labyrinthe. Si on trouve un filon non extrait dont le chemin qui le sépare au mineur est plus petit que shortestPath, on enregistre la longueur du chemin ainsi que les coordonnees de ledit filon\n\t\tint shortestPath = Integer.MAX_VALUE;\n\t\tint[] coordsNearestFilon = {-1,-1};\n\t\tfor (int i=0 ; i < this.laby.getHauteur() ; i++) {\n\t\t\tfor (int j=0 ; j < this.laby.getLargeur() ; j++) {\n\t\t\t\tif (this.laby.getLabyrinthe()[i][j] instanceof Filon && ((Filon)this.laby.getLabyrinthe()[i][j]).getExtrait() == false) {\n\t\t\t\t\tif (this.laby.solve(j,i) != null) {\n\t\t\t\t\t\tint pathSize = this.laby.solve(j,i).size();\n\t\t\t\t\t\tif (pathSize < shortestPath) {\n\t\t\t\t\t\t\tshortestPath = pathSize;\n\t\t\t\t\t\t\tcoordsNearestFilon[0] = j;\n\t\t\t\t\t\t\tcoordsNearestFilon[1] = i;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t//Si il n'y a plus de filon non extrait atteignable, on cherche les coordonnes de la clef\n\t\tif (coordsNearestFilon[0] == -1) {\n\t\t\tcoordsNearestFilon = this.laby.getCoordsClef();\n\t\t\t//Si il n'y a plus de filon non extrait atteignable et que la clef a deja ouvert la porte, on cherche les coordonnes de la sortie\n\t\t\tif (coordsNearestFilon == null)\tcoordsNearestFilon = this.laby.getCoordsSortie();\n\t\t}\n\n\t\t//On cree une pile qui contient des couples de coordonnees qui correspondent a la solution, puis on depile car le dernier element est l'objectif vise\n\t\tStack<Integer[]> solution = this.laby.solve(coordsNearestFilon[0], coordsNearestFilon[1]);\n\t\tsolution.pop();\n\n\t\t//Tant que l'on n'arrive pas au premier element de la pile (cad la case ou se trouve le mineur), on depile tout en gardant l'element depile, qui contient les coordonnees d'une trace que l'on dessine en suivant dans la fenetre\n\t\twhile (solution.size() != 1) {\n\t\t\tInteger[] coordsTmp = solution.pop();\n\t\t\tTrace traceTmp = new Trace();\n\t\t\tthis.laby.getLabyrinthe()[coordsTmp[1]][coordsTmp[0]] = new Trace();\n\t\t\t((JLabel)grille.getComponents()[coordsTmp[1]*this.laby.getLargeur()+coordsTmp[0]]).setIcon(traceTmp.imageCase());\n\t\t}\n\t\tSystem.out.println(\"\\n========================================== SOLUTION =====================================\\n\");\n\t\tthis.affichageLabyrinthe();\n\t}", "public static void main(String[] args) {\n\t\tString filename = \"src/y20161B/B-small-practice\";\n\t\t//String filename = \"src/y20161B/B-large-practice\";\n\n\t\tFileInputStream file;\n\t\tint T;\n\n\t\ttry {\n\t\t\tfile = new FileInputStream(filename+\".in\");\n\n\t\t\tBufferedReader in = new BufferedReader(new InputStreamReader(file));\n\n\t\t\tT = Integer.parseInt(in.readLine());\n\n\t\t\tBufferedWriter bw = new BufferedWriter(new FileWriter(filename+\".out\"));\n\n\t\t\tfor (int i=0; i<T; i++) {\n\t\t\t\tint ind = i+1;\n\t\t\t\t// parser\n\t\t\t\tString buff[] = in.readLine().split(\" \");\n\t\t\t\tString C = buff[0];\n\t\t\t\tString J = buff[1];\n\t\t\t\t\n\t\t\t\t// calcul\n\t\t\t\tString res = solve(C, J);\n\t\t\t\t\n\t\t\t\tSystem.out.println(\"Result \"+i+\": \"+res);\n\t\t\t\tbw.write(\"Case #\"+ind+\": \"+res+\"\\n\");\n\t\t\t}\n\t\t\tbw.close();\n\n\t\t\tin.close();\n\n\t\t} catch (Exception e) {\n\t\t\te.printStackTrace();\n\t\t}\n\t}", "public static void main(String[] args) {\n Scanner sc = new Scanner(System.in);\n int[] arr = new int[4];\n for (int i = 0; i < 4; i++)\n arr[i] = sc.nextInt();\n \n Q1 q1 = new Q1();\n int[] answer = q1.solution(arr);\n \n for (int i = 0; i < answer.length; i++) {\n System.out.println(answer[i]);\n }\n }", "public static void doExercise3() {\n // TODO: Complete Exercise 3 Below\n\n }", "public static void doExercise4() {\n // TODO: Complete Exercise 4 Below\n\n }", "public static void main(String[] args) throws IOException {\n\t\t\t\r\n\t\t\tint [] numReps= {3,1,2,2,2};\r\n\t\t\tMathModelClass.solveMe(85, 5, 2,numReps, 1);\r\n\t\r\n\t\t}", "@Override\n protected long getTestSolution() {\n return 100024;\n }", "public static void main(String[] args) throws IOException {\n br = new BufferedReader(new FileReader(\"input.txt\"));\r\n\r\n int T = nextInt();\r\n for (int t = 1; t <= T; t++) {\r\n nextInt();\r\n int X = nextInt();\r\n String lString = nextToken();\r\n\r\n StringBuilder s = new StringBuilder();\r\n for (; X > 0; X--) s.append(lString);\r\n char[] arr = s.toString().toCharArray();\r\n String soln = solve(arr) ? \"YES\" : \"NO\";\r\n\r\n System.out.printf(\"Case #%d: %s%n\", t, soln);\r\n }\r\n }", "private boolean solutionChecker() {\n\t\t// TODO\n\t\treturn false;\n\n\t}", "void solve() throws IOException {\n\t\tint n = ni();\n\t\tint[] v = new int[n];\n\t\tfor (int i = 0; i < n; ++i)\n\t\t\tv[i] = ni();\n\t\tsolve(v);\n\t\tout.println(result.size());\n\t\tfor (int a : result)\n\t\t\tout.print(a + \" \");\n\t}", "public static void main(String[] args) {\n Scanner ob = new Scanner(System.in);\n Solution solution = null;\n int testcases = ob.nextInt();\n ob.nextLine();\n for (int i = 0; i < testcases; i++) {\n String numsLine = ob.nextLine();\n String[] numsLineParts = numsLine.trim().split(\" \");\n int dimensions = Integer.valueOf(numsLineParts[0]);\n int numOperations = Integer.valueOf(numsLineParts[1]);\n solution = new Solution(dimensions);\n for (int j = 0; j < numOperations; j++) {\n String line = ob.nextLine();\n String[] lineParts = line.split(\" \");\n if (lineParts[0].equals(\"UPDATE\")) {\n solution.update(Integer.valueOf(lineParts[1])-1, Integer.valueOf(lineParts[2])-1, Integer.valueOf(lineParts[3])-1, Integer.valueOf(lineParts[4]));\n }\n if (lineParts[0].equals(\"QUERY\")) {\n solution.query(Integer.valueOf(lineParts[1])-1, Integer.valueOf(lineParts[2])-1, Integer.valueOf(lineParts[3])-1, Integer.valueOf(lineParts[4])-1, Integer.valueOf(lineParts[5])-1, Integer.valueOf(lineParts[6])-1);\n }\n }\n }\n }", "public static void main(String[] args) {\r\n\t\t\r\n\t\ttry{\r\n\t\t\tScanner sc= new Scanner(new File(inpPath));\t//new File(inpPath)\r\n\t\t\tPrintWriter out = new PrintWriter(new File(outPath));\r\n\t\t\tint cases = sc.nextInt();\r\n\t\t\tfor(int t=1;t<=cases;t++){\r\n\t\t\t\tsolve(t,sc,out);\r\n\t\t\t}\r\n\t\t\tout.flush();\r\n\t\t\tout.close();\r\n\t\t}catch(Exception ex){ex.printStackTrace();}\r\n\t\t\r\n\t}", "public static void main(String[] args) {\n SudokuBoard board = null;\n board = new SudokuBoard(9);\n /*try {\n board.read();\n } catch (InvalidNumberInCellException | OutOfRangeException e) {\n e.printStackTrace();\n }*/\n SudokuGenerator gen = null;\n gen = new SudokuGenerator(SudokuGenerator.Difficulty.EASY, 9);\n gen.generate(board);\n gen.removeCells(board, 25);\n board.print();\n SudokuSolver2 solver = new SudokuSolver2();\n int res = solver.uniqueSolution(board);\n if(res == 0 || res == 1) System.out.print(\"No \");\n System.out.print(\"té solució\");\n if(res != 0) System.out.println(\" única\");\n solver.solve(board).print();\n\n\n\n }", "public static void main(String[] args) {\n\r\n\t\tSystem.out.println(solution(\"ACACACA\"));\r\n\t}", "public static void main(String[] args) {\n\t\tint[] arr= {6,9,5,7,4};\r\n\t\t//int[] arr= {3,9,9,3,5,7,2};\r\n\t\t//int[] arr= {1,5,3,6,7,6,5};\r\n\t\tint[] tmp=solution(arr);\r\n\t\tfor(int i=0;i<tmp.length;i++)\r\n\t\t\tSystem.out.print(tmp[i]+\" \");\r\n\t}", "public static void doExercise5() {\n // TODO: Complete Exercise 5 Below\n\n }", "public static void main(String[] args) {\n String problem = \"Herman\";\n\n // Assign string type variable to solution string\n String result = solution(problem);\n\n //Print solution result\n System.out.println(result);\n }", "private Solution() { }", "private Solution() { }", "public static void main(String[] args) {\n String str = \"The one-hour drama series Westworld is a dark odyssey about the dawn of artificial consciousness and the evolution of sin. Set at the intersection of the near future and the reimagined past, it explores a world in which every human appetite, no matter how noble or depraved, can be indulged.\";\n\n System.out.println(solution1(str));\n }", "public static void main(String args[]) {\n\t List<int[][]> result = solveKT();\n\t for(int [][] sol: result){\n\t\t printSolution(sol);\n\t\t System.out.println();\n\t }\n }", "private static void solve() throws IOException {\n\n OptimizationGame.solve();\n SumOfSumOfDigits.solve();\n CrossTheStreet.solve();\n }", "void process() throws Exception {\n\t\n\n\t\t\tFile inputFile=new File(round+\"/\"+exercice+\"-small-attempt1.in\");\n\t\t\tPrintWriter outputFile= new PrintWriter(round+\"/\"+exercice+\"-small-attempt1.out\",\"UTF-8\");\n\n\t\t\n\t//\tFile inputFile=new File(round+\"/\"+exercice+\"-large.in\");\n\t//\tPrintWriter outputFile= new PrintWriter(round+\"/\"+exercice+\"-large.out\",\"UTF-8\");\n\n\n\t\tScanner scanner=new Scanner(inputFile);\n\t\tscanner.useLocale(Locale.US);\n\t\tint T = scanner.nextInt();\n\t\tSystem.out.println(\"Doing \"+T+\" cases\");\n\n\t\t\n\n\t\tfor (int t=1;t<=T;t++) {\n\t\n\t\t\t// do Something\n\t\t\tN=scanner.nextInt();\n\t\t\tS=new String[N];\n\t\t\n\t\t\t\n\t\t\tfor (int i=0;i<N;i++){\n\t\t\t\tS[i]=scanner.next();\n\t\t}\n\t\t\t\n\t\t\t\n\t\t\tString ss=\"\"+solve();\n\t\t\n\t\t\tSystem.out.println(\"Case #\"+t+\": \"+ss);\n\t\t\toutputFile.println(\"Case #\"+t+\": \"+ss);\n\t\t\t\n\t\t}\n\t\tscanner.close();\n\t\toutputFile.close();\n\n\t}", "public static void main(String[] args) {\n\t\tSolution sl=new Solution();\r\n\t\t/*ListNode l1=new ListNode(2);\r\n\t\tListNode l2=new ListNode(-1);\r\n\t\tl2.next=new ListNode(1);\r\n\t\tl2.next.next=new ListNode(3);\r\n\t\tListNode l3= sl.mergeTwoLists(l1, l2);\r\n\t\twhile(l3!=null)\r\n\t\t{System.out.println(l3.val);\r\n\t\tl3=l3.next;\r\n\t\t}*/\r\n\t\tString a=\"1ab2\",b=\"ab12\";\r\n\t\tSystem.out.println(sl.isRotate(a,b));\r\n\t\t//System.out.println(sl.canConstruct(ran, mag));\r\n\t\t//System.out.println(sl.myAtoi(\" 10522545459\"));\r\n\t}", "public void easy() {\n\t\tGenerator solve = new Generator();\n\t\tsolve.easy();\n\t\tAnswer = solve.getEquationResult();\n\t\tTextView Equation = (TextView) findViewById(R.id.textView3);\n\t\tEquation.setText(solve.getEquation());\n\t}", "public static void main(String[] args) throws IOException {\n\t\t String name = \"A-large\";\r\n\t\tScanner sc = new Scanner(new File(name + \".in\"));\r\n\t\tsc.useLocale(Locale.US);\r\n\r\n\t\tFileWriter fstream = new FileWriter(name + \".out\");\r\n\t\tout = new BufferedWriter(fstream);\r\n\r\n\t\tint cases = sc.nextInt();\r\n\r\n\t\tfor (int i = 1; i <= cases; i++) {\r\n\t\t\tSystem.out.format(Locale.US, \"Case #%d: \", i);\r\n\t\t\tout.write(\"Case #\" + i + \": \");\r\n\t\t\tsolve(sc);\r\n\t\t}\r\n\t\tsc.close();\r\n\t\tout.close();\r\n\t}", "public static void doExercise2() {\n // TODO: Complete Exercise 2 Below\n\n }", "public static void main(String[] args) {\n\t\tSystem.out.println(solution(people, limit));\n\t}", "public static void main(String[] args) {\n\t\tint arr[] = {9,3,9,3,9,7,9};\n\t\tSolution(arr);\n\t}", "@Override\r\n\tpublic boolean solutionCase() {\n\t\tint v=0, e1=0, e2=0, w=0, a=0;\r\n\t\twhile(sc.hasNextInt()){\r\n\t\t\tv=sc.nextInt();\r\n\t\t\ta=sc.nextInt();\r\n\t\t\tEdgeWeightedGraph g= new EdgeWeightedGraph(v);\r\n\t\t\tfor(int i=0;i<a;++i){\r\n\t\t\t\te1=sc.nextInt();\r\n\t\t\t\te2=sc.nextInt();\r\n\t\t\t\tw=sc.nextInt();\r\n\t\t\t\tEdge e= new Edge(e1-1, e2-1, w);\r\n\t\t\t\tg.addEdge(e);\r\n\t\t\t}\r\n\t\t\tDijkstraS m = new DijkstraS(g, 0);\r\n\t\t\t\r\n\t\t\tfor(int i=0;i<v;i++)\r\n\t\t\t\tSystem.out.println(\"V[\"+i+\"] \"+m.nWays[i]);\r\n\t\t\t\t//System.out.println(m.nWays[v-1]);\r\n\t\t\t\r\n\t\t}\r\n\t\treturn true;\r\n\t}", "public void displaySolution() {\r\n Problem pb = new Problem(sources, destinations, costMatrix);\r\n pb.printProblem();\r\n Solution sol = new Solution(pb);\r\n sol.computeCost();\r\n }", "public static void main(String[] args) {\n int lineSize = Integer.parseInt(args[0]);\n String[] input = getInput(args);\n\n WordWrap ww = new WordWrap(lineSize, input);\n Long start = System.currentTimeMillis();\n Integer[] lines = ww.solve();\n Long end = System.currentTimeMillis();\n\n System.out.println(\"solved in \"+((end-start)/1000.0) +\" seconds\");\n printResult(lines, input);\n }", "public static void main(String[] args)\n\t{\n\t\tScanner in = new Scanner(System.in);\n\t\tStringBuilder answers = new StringBuilder();\n\n\t\tanswers.append(\"PERFECTION OUTPUT\\n\");\n\t\ttry\n\t\t{\n\t\t\tint value;\n\t\t\twhile (true)\n\t\t\t{\n\t\t\t\tvalue = in.nextInt();\n\t\t\t\tif (value == 0) break;\n\n\t\t\t\tanswers.append(solve(value));\n\t\t\t}\n\t\t}\n\t\tcatch (Exception e)\n\t\t{\n\t\t\te.printStackTrace();\n\t\t\tSystem.out.println(e);\n\t\t\tSystem.exit(1);\n\t\t}\n\t\tanswers.append(\"END OF OUTPUT\");\n\n\t\tSystem.out.println(answers);\n\t}", "public static void main(String[] args) throws IOException {\n\t\tBufferedReader br = new BufferedReader(new InputStreamReader(System.in));\n\t\tBufferedWriter bw = new BufferedWriter(new OutputStreamWriter(System.out));\n\t\tint t = Integer.parseInt(br.readLine());\n\t\tint a = 0, b = 0;\n\t\tfor (int i = 0; i < t; i++) {\n\t\t\tStringTokenizer st = new StringTokenizer(br.readLine());\n\t\t\ta = Integer.parseInt(st.nextToken());\n\t\t\tb = Integer.parseInt(st.nextToken());\n\t\t\tbw.write(solution(a, b) + \"\\n\");\n\t\t}\n\t\tbw.flush();\n\t\tbw.close();\n\t}", "public static void solve(){\n try {\r\n Rete env = new Rete();\r\n env.clear();\r\n env.batch(\"sudoku.clp\");\r\n\t\t\tenv.batch(\"solve.clp\");\r\n env.batch(\"output-frills.clp\");\r\n env.batch(\"guess.clp\");\r\n env.batch(\"grid3x3-p1.clp\");\r\n\t env.eval(\"(open \\\"test.txt\\\" output \\\"w\\\")\");\r\n env.reset();\r\n env.eval(\"(assert (try guess))\");\r\n env.run();\r\n env.eval(\"(close output)\");\r\n } catch (JessException e) {\r\n // TODO Auto-generated catch block\r\n e.printStackTrace();\r\n }\r\n System.out.println(\"ok\");\r\n FileReader fr;\r\n try {\r\n int r = 0,c = 0;\r\n fr = new FileReader(\"test.txt\");\r\n Scanner sc = new Scanner(fr);\r\n \r\n while (sc.hasNextInt()){\r\n int next = sc.nextInt();\r\n int i = id[r][c];\r\n gui.setSudokuValue(i-1, next);\r\n c++;\r\n if (c >= 6){\r\n c = 0; r++;\r\n }\r\n }\r\n } catch (Exception e){\r\n }\r\n \r\n }", "Programming(){\n\t}", "private void testSolution(String input, String output) {\n runs++;\n\n // Load the problem & solution\n ProblemSpec problemSpec = Solution.loadProblem(input);\n Solution solution = new Solution(problemSpec);\n\n // Solve and time the solution\n long startTime = System.currentTimeMillis();\n List<State> states = solution.solve();\n long endTime = System.currentTimeMillis();\n durations.put(input, endTime - startTime);\n\n // Output the solution\n Solution.writeSolution(Formatter.format(states), output);\n\n problemSpec = Solution.loadProblem(input, output);\n if (solutionPasses(problemSpec)) {\n passes++;\n }\n\n successes++;\n }", "public static void main(String[] args) \r\n {\r\n // TODO: Read the input from the user and call produceAnswer with an equation\r\n \tScanner in = new Scanner(System.in);\r\n \tString problem = in.nextLine();\r\n \tin.close();\r\n \tSystem.out.printf(\"Result: %s\" , produceAnswer(problem));\r\n }", "public void output(IvyXmlWriter xw,S6SolutionSet ss)\n{\n xw.begin(\"SOLUTION\");\n String code = formatted_code;\n if (code == null) {\n code = getFragment().getFinalText(ss.getSearchType());\n\n }\n formatted_code = null;\n\n// if (code.contains(\"]]>\") || code.contains(\"<![\")) xw.textElement(\"CODE\",code);\n if (code.contains(\"]]>\")) xw.textElement(\"CODE\",code);\n else xw.cdataElement(\"CODE\",code);\n xw.textElement(\"SOLSRC\",for_source.getName());\n xw.textElement(\"NAME\",for_source.getDisplayName());\n xw.textElement(\"LICENSE\",for_source.getLicenseUid());\n\n xw.begin(\"COMPLEXITY\");\n xw.field(\"LINES\",getCodeLines(code));\n xw.field(\"CODE\",getFragment().getCodeComplexity());\n S6TestResults tr = getFragment().getTestResults();\n if (tr != null) xw.field(\"TESTTIME\",tr.getRequiredTime());\n xw.end(\"COMPLEXITY\");\n\n if (transform_set != null) {\n xw.begin(\"TRANSFORMS\");\n for (S6Transform.Memo m : transform_set) {\n\t xw.textElement(\"TRANSFORM\",m.getTransformName());\n }\n xw.end(\"TRANSFORMS\");\n }\n\n xw.end(\"SOLUTION\");\n}", "public static void main(String[] args) {\n int[] arr = {10, 2, 5, 1, 8, 12};\n System.out.println(solution(arr));\n }", "public static void main(String[] args)throws IOException {\r\n\t\t\r\n\t\t String inputFolder = \"C:/Users/Nekromantik/Desktop/321\";\r\n\t\t String inputfile = \"C:/Users/Nekromantik/Desktop/222/disagreements.txt\";\r\n\t\t \r\n\t\t String outputfile = \"C:/Users/Nekromantik/Desktop/222/result.txt\";\r\n\t\t \r\n\t\t Eva_help2 test = new Eva_help2();\r\n\t\t test.generate(inputfile, inputFolder, outputfile);\r\n\t\t\r\n\t}", "public void displayData(Solution solution);", "public static void doExercise1() {\n // TODO: Complete Exercise 1 Below\n\n }", "public static void main(String[] args) {\n\t\tint[] A = {51,31,43};\n\t\tSystem.out.println(solution(A));\n\n\t}", "public static void main(String[] args) {\n\t// write your code here\n int[][] input = new int[3][3];\n input[1][1] = 1;\n\n Solution sol = new Solution();\n sol.printMatrix(input);\n int[][] output = sol.updateMatrix(input);\n sol.printMatrix(output);\n\n }", "public static void main(String[] args) throws IOException {\n BufferedReader f = new BufferedReader(new InputStreamReader(System.in));\n PrintWriter out = new PrintWriter(new BufferedWriter(new OutputStreamWriter(System.out)));\n StringTokenizer st = new StringTokenizer(f.readLine());\n int a = Integer.parseInt(st.nextToken());\n int b = Integer.parseInt(st.nextToken());\n int c = Integer.parseInt(st.nextToken());\n int d = Integer.parseInt(st.nextToken());\n int x = -1;\n int y = -1;\n for(int i = 1; i < 45000; i++) {\n if(i*(i-1)/2 == a) {\n x = i;\n }\n if(i*(i-1)/2 == d) {\n y = i;\n }\n }\n if(x == -1 || y == -1) {\n out.println(\"Impossible\");\n } else {\n if(x*y == b+c) {\n int w = c/x;\n int z = c%x;\n out.println(\"1\".repeat(w)+\"0\".repeat(x-z)+\"1\".repeat(z > 0 ? 1 : 0)+\"0\".repeat(z)+\"1\".repeat(y-w-(z > 0 ? 1 : 0)));\n } else {\n if(b+c > 0) {\n out.println(\"Impossible\");\n } else if(x == 1) {\n out.println(\"1\".repeat(y));\n } else if(y == 1) {\n out.println(\"0\".repeat(x));\n } else {\n out.println(\"Impossible\");\n }\n }\n }\n f.close();\n out.close();\n }", "public static void main(String[] args) {\n\t\tint A[]={2,1,0,0,0};\r\n\t\tSystem.out.println(solution(A));\r\n\r\n\t}", "public static void main(String[] args) {\n int[] grades = {73,67,38,33};\n// for(int grades_i=0; grades_i < n; grades_i++){\n// grades[grades_i] = in.nextInt();\n// }\n int[] result = solve(grades);\n for (int i = 0; i < result.length; i++) {\n System.out.print(result[i] + (i != result.length - 1 ? \"\\n\" : \"\"));\n }\n System.out.println(\"\");\n \n\n }", "public static void main(String[] args) {\n\t\tint [] a= {4,3,2,1};\r\n\t\tfor(int i:solution(a)) System.out.println(i);\r\n\t}", "public static void main(String[] args) {\n\n\t\tsolution();\n\n\t\t// int maxDivisor = Divided.getMaxDivisor(1, 3);\n\t\t// System.out.println(\"maxDivisor:\" + maxDivisor);\n\n\t}", "private static void cajas() {\n\t\t\n\t}", "public static void main(String args[]) {\n\t\tString a[] = {\"mislav\", \"stanko\", \"mislav\", \"ana\",\"ana\"};\n\t\tString b[] = {\"stanko\", \"ana\", \"mislav\",\"mislav\"};\n\t\tsolution(a,b);\n\t}", "public static void main(String[] args) {\n\t\tSolution s = new Solution();\n\t\t//char[][] test = {{'O','O','O'},{'O','X','O'},{'O','O','O'}};\n\t\tchar[][] test = {{'X','O','X','X'},{'O','X','O','X'},{'X','O','X','O'},{'O','X','O','X'},{'X','O','X','O'}};\n\t\tfor(int i = 0;i < test.length;i++){\n\t\t\tfor(int j = 0;j < test[0].length;j++){\n\t\t\t\tSystem.out.print(test[i][j]);\n\t\t\t}\n\t\t\tSystem.out.println();\n\t\t}\n\t\tSystem.out.println();\n\t\ts.solve(test);\n\t\tfor(int i = 0;i < test.length;i++){\n\t\t\tfor(int j = 0;j < test[0].length;j++){\n\t\t\t\tSystem.out.print(test[i][j]);\n\t\t\t}\n\t\t\tSystem.out.println();\n\t\t}\n\t}", "public void showDisplaySolution(Solution<Position> solution);", "public static void main(String[] args) {\n\t\tint[] arr = {5,5,3,3,3,2,5};\n\t\tint[] result = solution(arr);\n\t\tfor(int n : result) {\n\t\t\tSystem.out.print(n + \" \");\n\t\t}\n\t}", "public static void main(String[] args) {\n\n\t\tswitch(15)\n\t\t{\n\t\t\tcase 10:\n\t\t\t\tSystem.out.println(\"난 10이여\");\n\t\t\t\tbreak;\n\t\t\tcase 7:\n\t\t\t\tSystem.out.println(\"난 7이여\");\n\t\t\t\tbreak;\n\t\t\tdefault:\n\t\t\t\tSystem.out.println(\"난 기본이여\");\n\t\t\t\tbreak;\n\t\t\tcase 15:\n\t\t\t\tSystem.out.println(\"난 15이여\");\n\t\t\t\tbreak;\n\t\t\t\n\t\t}\n\t\t\n\t\t\n\t\t//부서별 mt 장소를 공지하세요\n\t\t // 인사부 - 바다, 영업부 - 산, 부부 - 안방, 두부 - 콩밭\n\t\t\n\t\tString team = \"영업부\";\n\t\t\n\t\tString mt = \"잔업\";\n\t\t\n\t\tswitch(team) {\n\t\t\tcase \"인사부\":\n\t\t\t\tmt=\"바다\";\n\t\t\t\tbreak;\n\t\t\tcase \"영업부\":\n\t\t\t\tmt=\"산\";\n\t\t\t\tbreak;\n\t\t\tcase \"부부\":\n\t\t\t\tmt=\"안방\";\n\t\t\t\tbreak;\n\t\t\tcase \"두부\":\n\t\t\t\tmt=\"콩밭\";\n\t\t\t\tbreak;\n\t\t}\n\t\t\n\t\tSystem.out.println(team+\":\"+mt);\n\t\t\n\t\tint basic = 300;\n\t\tString pos = \"과장\";\n\t\t\n\t\tdouble rate=0;\n\t\t\n\t\tswitch(pos)\n\t\t{\n\t\t\tcase \"부장\":\n\t\t\t\trate=0.5;\n\t\t\t\tbreak;\n\t\t\tcase \"과장\":\n\t\t\t\trate=0.3;\n\t\t\t\tbreak;\n\t\t\tcase \"대리\":\n\t\t\t\trate=0.2;\n\t\t\t\tbreak;\n\t\t\tcase \"사원\":\n\t\t\t\trate=0.1;\n\t\t\t\tbreak;\n\t\t}\n\t\t\n\t\tSystem.out.println(basic*(rate+1));\n\t\t\n\t}", "public static void main(String[] args) throws IOException\n {\n \n BufferedReader f = new BufferedReader(new InputStreamReader(System.in));\n PrintWriter writer = new PrintWriter(new BufferedOutputStream(System.out));\n \n String output = \"\"; //Write all output to this string\n\n //Code here\n int numLevels = Integer.parseInt(f.readLine());\n int[] nums = new int[numLevels];\n String line = f.readLine();\n StringTokenizer st = new StringTokenizer(line);\n int numLevelsX = Integer.parseInt(st.nextToken());\n for(int i = 0; i < numLevelsX; i++)\n {\n int n = Integer.parseInt(st.nextToken());\n nums[n-1]++;\n }\n line = f.readLine();\n st = new StringTokenizer(line);\n int numLevelsY = Integer.parseInt(st.nextToken());\n for(int i = 0; i < numLevelsY; i++)\n {\n int n = Integer.parseInt(st.nextToken());\n nums[n-1]++;\n }\n boolean isBeatable = true;\n for(int i = 0; i < numLevels; i++)\n {\n if(nums[i]==0)\n isBeatable = false;\n }\n output = isBeatable?\"I become the guy.\":\"Oh, my keyboard!\";\n \n \n //Code here\n\n //out.println(output);\n \n writer.println(output);\n writer.close();\n System.exit(0);\n \n }", "public static void main(String[] args) {\n // solution for the problem\n int solution;\n // end time of the program\n long endTime;\n // start time of the program\n long startTime;\n\n startTime = System.nanoTime();\n solution = findTriangleNumber(TARGET_FACTORS);\n endTime = System.nanoTime();\n\n // print answer and time taken\n System.out.println(ANSWER + solution);\n System.out.printf(TIME_TAKEN, (double) (endTime - startTime) / TIME_CONVERSION);\n }", "public static void main(String[] args) {\n // write your code here - this is called comment and it always starts with double slash\n // and comlier will ignore this because of the // sign.\n // I am gonna say hello\n // JAVA IS CASE SENSITIVE LANGUAGE\n // System and system are very different things in java\n //Hello AND hello are different for java\n // System.out.println(\"Hello Batch 15!\");\n // System.out.println(\"I am still here.\");\n // System.out.println(\"I love Java.\");\n\n // Write a program to display your information.\n // When you run it, it should have this outcome.\n // I am your name here\n // I am from batch 15\n // I am from your city here\n // I love Java\n\n System.out.println(\"I am Sevim.\");\n System.out.println(\"I am from Batch 15.\");\n System.out.println(\"I'm from New Jersey.\");\n System.out.println(\"I love Java.\");\n\n\n\n }", "public static void main(String[] args) {\n\t\t\r\n\t\tScanner sc = null;\r\n\t\t\r\n\t\ttry {\r\n\t\t\tsc = new Scanner( new File(\"C:\\\\Users\\\\SRT\\\\algorithms\\\\robot\\\\src\\\\frodo\\\\input2.txt\") );\r\n\t\t} catch (Exception e){\r\n\t\t\te.printStackTrace();\r\n\t\t}\r\n\t\tint test_case = sc.nextInt();\r\n\t\t\r\n\t\tint N=0;\r\n\r\n\t\tfor (int tc = 1; tc <= test_case; tc++){\r\n\t\t\t//if(tc ==1 ) {\r\n\t\t\tN = sc.nextInt();\r\n\t\t\tint grid [][] = new int [N][2];\r\n\r\n\t\t\tfor(int row = 0 ; row < grid.length ; row++) {\r\n\t\t\t\tSystem.out.println(\" \");\r\n\t\t\t\tfor(int col=0; col< grid[0].length; col++) {\r\n\t\t\t\t\tgrid[row][col] = sc.nextInt();\r\n\t\t\t\t\tSystem.out.print(\" \"+ grid[row][col]);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tSystem.out.println(\"\\n\");\r\n\t\t\t\t\t\t\t\r\n\t\t\tSystem.out.println(\"#\"+tc+\":\"+getAnswer(N,grid));\r\n\t\t\t//}\t\r\n\t\t}\r\n\t\t\r\n\t}", "public static void main(String[] args) throws IOException {\n\t\tScanner sc = new Scanner(System.in);\n//\t\tint T = stoi(br.readLine());\n\t\tint T = sc.nextInt();\n\t\tStringBuilder sb = new StringBuilder();\n\t\tfor(int Tcase=1; Tcase <= T; Tcase++){\n\t\t\tint ans=0;\n\t\t\tsb.append(\"#\").append(Tcase).append(\" \");\n\t\t\t//오름차순 //내림차순\n\t\t\tint N = sc.nextInt();\n\t\t\tint[] dataSet = new int[N];\n\t\t\tfor (int count = 0; count < N; count++) {\n\t\t\t\tdataSet[count] = sc.nextInt();\n\t\t\t}\n\t\t\t\n\t\t\t//시작상태 0 //오름차순 1// 내림차순 2\n\t\t\tint swit = 0;\n\t\t\tint leftIdx = 0;\n\t\t\tint rightIdx = 0;\n\t\t\tint midIdx = 0;\n\t\t\tint preData = dataSet[0];\n\t\t\tint hi;\n\t\t\tfor (int idx = 1; idx < dataSet.length; idx++) {\n\t\t\t\thi = dataSet[idx];\n\t\t\t\tif(preData < hi) { //오름차순 1\n\t\t\t\t\tif(swit == 2) {\n\t\t\t\t\t\trightIdx = idx-1;\n\t\t\t\t\t\tans += (midIdx-leftIdx)*(rightIdx-midIdx);\n\t\t\t\t\t\tleftIdx = idx-1;\n\t\t\t\t\t}\n\t\t\t\t\tswit = 1;\n\t\t\t\t\t\n\t\t\t\t}\n\t\t\t\t//같은경우 고려 안함\n\t\t\t\telse {//내림차순 2\n\t\t\t\t\tif(swit == 1) midIdx = idx-1;\n\t\t\t\t\t\n\t\t\t\t\tswit = 2;\n\t\t\t\t\tif(idx == dataSet.length-1){\n\t\t\t\t\t\trightIdx = idx;\n\t\t\t\t\t\tans += (midIdx-leftIdx)*(rightIdx-midIdx);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tpreData = hi;\n\t\t\t}\n\t\t\t\n\t\t\tsb.append(ans).append(\"\\n\");\n\t\t}\n\t\tSystem.out.print(sb);\n\t\t\n\t}", "public static void main(String[] args) {\n\t\tString[][] q = {{\"yellow_hat\",\"headgear\"},{\"blue_sunglasses\",\"eyewear\"}};\n\t\tint an = solution(q);\n\t\t\n\t\tSystem.out.println(an);\n\t}", "public static void main(String[] args) {\n\t\tint result = 77;\r\n\t\tif(result >= 90) {\r\n\t\t\tif(result >= 95) {\r\n\t\t\t\tSystem.out.println(\"A+ 학점\");\r\n\t\t\t} else {\r\n\t\t\t\tSystem.out.println(\"A 학점\");\r\n\t\t\t}\r\n\t\t} else if (result >= 80) {\r\n\t\t\tif(result >= 85) {\r\n\t\t\t\tSystem.out.println(\"B+ 학점\");\r\n\t\t\t} else {\r\n\t\t\tSystem.out.println(\"B 학점\");\r\n\t\t\t}\r\n\t\t} else if (result >= 70) {\r\n\t\t\tif(result >= 75) {\r\n\t\t\t\tSystem.out.println(\"C+ 학점\");\r\n\t\t\t} else {\r\n\t\t\tSystem.out.println(\"C 학점\");\r\n\t\t\t}\r\n\t\t} else {\r\n\t\t\tSystem.out.println(\"F 학점\");\r\n\t\t}\r\n\r\n\t}", "public static void main(String[] args) {\n // solution for the problem\n int solution;\n // end time of the program\n long endTime;\n // start time of the program\n long startTime;\n\n startTime = System.nanoTime();\n solution = findSpecialPrimesSum();\n endTime = System.nanoTime();\n\n // print answer and time taken\n System.out.println(ANSWER + solution);\n System.out.printf(TIME_TAKEN, (double) (endTime - startTime) / TIME_CONVERSION);\n }", "public static void main(String[] args) throws IOException {\n\t\tBufferedWriter bw = new BufferedWriter(new FileWriter(args[1]));\n\t\ttry (BufferedReader br = new BufferedReader(new FileReader(args[0]))) {\n\t\t int n = Integer.parseInt(br.readLine());\n\t\t String line;\n\t\t for(int i=0;i<n;i++){\n\t\t \tHashSet<Integer> digits = new HashSet<>();\n\t\t \tint flag=0;\n\t\t \tint count=1;\n\t\t int input = Integer.parseInt(br.readLine());\n\t\t int original=input;\n\t\t while(input!=0){\n\t\t \t int source=input,originalSource=input;\n\t\t \t count++;\n\t\t \t while(source!=0){\n\t\t \t\t digits.add(source%10);\n\t\t \t\t source=source/10;\n\t\t \t }\n\t\t \t \n\t\t \t if(digits.size()==10){\n\t\t \t\t //System.out.println(\"Case #\"+(i+1)+\": \"+originalSource);\n\t\t \t\t bw.write(\"Case #\"+(i+1)+\": \"+originalSource+\"\\n\");\n\t\t \t\t flag=1;\n\t\t \t\t break;\n\t\t \t }\n\t\t \t input=original*count;\n\t\t }\n\t\t if(flag==0){\n\t\t \t //System.out.println(\"Case #\"+(i+1)+\": INSOMNIA\");\n\t\t \t bw.write(\"Case #\"+(i+1)+\": INSOMNIA\"+\"\\n\");\n\t\t }\n\t\t }\n\t\t \n\t\t}\n\t\tcatch(Exception e){\n\t\t\t\n\t\t}\n\t\tbw.close();\n\t}", "@Override\n\tpublic void solve(String result) {\n\t\tSystem.out.println(\"你告诉我的答案是--->\"+result); \n\t}", "public static void main (String args []) throws IOException\r\n\t{\n\t\tScanner in = new Scanner(new File(\"moo.in\"));\r\n\t\tPrintWriter out = new PrintWriter(new BufferedWriter(new FileWriter(\"moo.out\")));\r\n\t\tint n = in.nextInt();\r\n//\t\tSystem.out.println(solve(n,0));\r\n\t\tout.println(solve(n,0));\r\n\t\tout.flush();\r\n\t}", "@Test\n public void testExample() {\n assertSolution(\"16\", \"example-day06-2018.txt\");\n }", "public static void main(String[] args) {\n\t\tInputStream inputStream = System.in;\n OutputStream outputStream = System.out;\n InputReader in = new InputReader(inputStream);\n PrintWriter out = new PrintWriter(outputStream);\n\t\tProblemSolver problemSolver = new ProblemSolver();\n\t\tproblemSolver.solveTheProblem(in, out);\t\t\n\t\tout.close();\t\t\n\t}", "public static void main(String[] args) throws IOException{\n\t\tBufferedReader in = new BufferedReader (new InputStreamReader(System.in));\n\t\tint num_tests = Integer.parseInt(in.readLine());\n\t\tBufferedWriter out = new BufferedWriter (new OutputStreamWriter(System.out));\n\n\t\tStringBuilder buf = new StringBuilder();\n\t\tfor(int j=0; j<num_tests; ++j)\n\t\t{\n\t\t\tString[] data_overview = in.readLine().split(\" \");\n\n\t\t\t// the variables\n\t\t\tint d = Integer.parseInt(data_overview[0]);\n\t\t\tint p = Integer.parseInt(data_overview[1]);\n\t\t\tint u = Integer.parseInt(data_overview[2]);\n\t\t\tint v = Integer.parseInt(data_overview[3]);\n\t\t\t\n\t\t\tdouble left = 0, right = d/(p-1);\n\t\t\twhile(right-left>0.0001){\n\t\t\t\tdouble middle = (left+right)/2;\n\t\t\t\tif(putPosts(d, u, v, p, middle)){\n\t\t\t\t\tleft = middle;\n\t\t\t\t} else {\n\t\t\t\t\tright = middle;\n\t\t\t\t}\n\t\t\t}\t\t\t\n\t\t\t// print\n\t\t\tbuf.append(\"Case #\");\n\t\t\tbuf.append(j+1);\n\t\t\tbuf.append(\": \");\n\t\t\tbuf.append(right);\n\t\t\tbuf.append(\"\\n\");\n\t\t}\n\t\tSystem.out.println(buf);\t\n\t}", "public static void main(String[] args) throws Exception\n\t{\n\t\tBufferedReader br = new BufferedReader(new FileReader(\"input6.txt\"));\tSystem.setOut(new PrintStream(new File(\"output.txt\")));\n\t\t\n\t\tint t = Integer.parseInt(br.readLine());\n\t\tfor(int i = 1; i <= t; i++)\n\t\t\tSystem.out.println(\"Case #\"+i+\": \"+solve(br));\n\t}", "private void print_solution() {\n System.out.print(\"\\n\");\n for (int i = 0; i < rowsCount; i++) {\n for (int j = 0; j < colsCount; j++) {\n System.out.print(cells[i][j].getValue());\n }\n System.out.print(\"\\n\");\n }\n }", "public static void main(String[] args) {\n int input = 0;\n int armLength;\n int solution = 0;\n\n // get the puzzle input\n System.out.print(\"Please provide the puzzle input: \");\n input = new Scanner(System.in).nextInt();\n\n /// PART 1\n // figure out which spiral input is on to calculate distance on one axis\n armLength = SpiralUtils.lengthOfSprialArm(input);\n solution = (armLength - 1) / 2;\n\n // find the midpoints of the spiral the input is on\n List<Integer> midpoints = SpiralUtils.midpointsOfSprialArm(armLength);\n\n // calculate the smallest distance from any midpoint to our input for other access\n solution += SpiralUtils.smallestDistanceFromMidpoints(input, midpoints);\n\n System.out.println(\"The solution to part 1 is: \" + solution);\n\n /// PART 2\n // this part is less elegant, as I'm just going to create the spiral instead of run calculations\n System.out.println(\"The solution to part 2 is: \" + SpiralUtils.spiralUntilAtLeast(input));\n }", "public static void main(String[] args) throws Exception {\n\t\tString path=\"D:\\\\大二\\\\java\\\\\";//檔案位置\n\t\tFile file = new File(path+\"input.txt\");\n\n\t\tBufferedReader br = new BufferedReader(new FileReader(file));\n\n\t\tString st;\n\t\tArrayList<String> read_s = new ArrayList<String>();\n\t\twhile ((st = br.readLine()) != null) {\n\n\t\t\tst = st.replaceAll(\"10\", \"t\");\n\t\t\tSystem.out.println(st);\n\t\t\tread_s.add(st);\n\t\t}\n\n\t\tbr.close();\n\t\t// ====================== read file end==================\n\t\tString towrite1=\"\";\n\t\tString towrite2=\"\";\n\t\t// towrite1 2 是最終寫入txt的String\n\t\t\n\t\tfor (int i = 0; i < read_s.size(); i++) {\n\t\t\tDecoder d = new Decoder(read_s.get(i));\n\t\t\t//將檔案中的資料轉成 before now 兩個 Arraylist 存在Decoder中\n\t\t\t//before 表已出現過的牌 After表手牌\n\t\t\tCount c = new Count();\n\t\t\tfor (int ii = 0; ii < d.before.size(); ii++) {\n\t\t\t\tc.sub(d.before.get(ii));//去除已出現過的牌\n\t\t\t}\n\t\t\t\n\t\t\tfor (int ii = 0; ii < d.now.size(); ii++) {\n\t\t\t\tc.addcard(d.now.get(ii));//將牌加入手牌\n\t\t\t}\n\t\t\t\n\t\t\tAnswer ans = c.re_ValueAndPossibility();//將預測結果輸出成Answer data type\n\t\t\tans.set_round(i);//設定第幾輪\n\t\t\t\n\t\t\ttowrite1=towrite1+ans.output1();//將Answer datatype 轉成String(for Q1)\n\t\t\ttowrite2=towrite2+ans.output2();//將Answer datatype 轉成String(for Q2)\n\t\t\t// ans.show();\n\t\t\t// c.show();\n\t\t\tc.clear();//清理Count 給下一輪繼續用\n\t\t}\n\t\t//========================write file starts==========================\n\t\tSystem.out.print(towrite1);\n\t\tSystem.out.print(towrite2);\n\t\tBufferedWriter writer = new BufferedWriter(new FileWriter(path+\"output1.txt\"));\n\t writer.write(towrite1);\n\t writer.close();\n\t writer = new BufferedWriter(new FileWriter(path+\"output2.txt\"));\n\t writer.write(towrite2);\n\t writer.close();\n\t //==========================write file end====================\n\t}", "public void guru() {\n\t\tGenerator solve = new Generator();\n\t\tsolve.guru();\n\t\tAnswer = solve.getEquationResult();\n\t\tTextView Equation = (TextView) findViewById(R.id.textView3);\n\t\tEquation.setText(solve.getEquation());\n\t}", "public static void main(String[] args) {\n String name = \"ABAAABB\";\n\n System.out.println(solution(name));\n }", "public static void main(String[] args) {\n char [][] strtMaze = new char[][]{\n {'#', '#', '#', '#', '#', '#', '#', '#', '#', '#', '#', '#'},\n {'#', '.', '.', '.', '#', '.', '.', '.', '.', '.', '.', '#'},\n {'.', '.', '#', '.', '#', '.', '#', '#', '#', '#', '.', '#'},\n {'#', '#', '#', '.', '#', '.', '.', '.', '.', '#', '.', '#'},\n {'#', '.', '.', '.', '.', '#', '#', '#', '.', '#', '.', '#'},\n {'#', '#', '#', '#', '.', '#', 'F', '#', '.', '#', '.', '#'},\n {'#', '.', '.', '#', '.', '#', '.', '#', '.', '#', '.', '#'},\n {'#', '#', '.', '#', '.', '#', '.', '#', '.', '#', '.', '#'},\n {'#', '.', '.', '.', '.', '.', '.', '.', '.', '#', '.', '#'},\n {'#', '#', '#', '#', '#', '#', '.', '#', '#', '#', '.', '#'},\n {'#', '.', '.', '.', '.', '.', '.', '#', '.', '.', '.', '#'},\n {'#', '#', '#', '#', '#', '#', '#', '#', '#', '#', '#', '#'},\n };\n //Get start position of person\n int pstartx = 2;\n int pstarty = 0;\n //Get start position of hand\n int hstartx = 3; //If same as pstart(facing north south)\n int hstarty = 0;//If same as pstart (facing east west)\n RecursionOutLab maze1 = new RecursionOutLab();\n maze1.maze(strtMaze, pstartx, pstarty, hstartx, hstarty);\n }", "public static void main(String[] args) {\n\t\t\n\t\t\n\t\t\n\t\tsum(10,20);\n\t\tsum(20,30);\n\t\tsum(40,50,10);\n\t\tmessage(\"Pratik\");\n\t\t\n\t\teligibility(\"Pratik\", 28);\n\t\teligibility(\"abc\", 17);\n\t\t\t\t\n System.out.println(name);\n \n\t}", "@Test\n public void testExample3() {\n assertSolution(\"-6\", \"example-day01-2018-3.txt\");\n }", "public static void main(String[] args) throws IOException {\n\t\t//Scanner in = new Scanner(System.in);\n\t\tBufferedReader in = new BufferedReader(new InputStreamReader(System.in));\n\t\tPrintWriter out = new PrintWriter(System.out);\n\t\tsolve(in, out);\n\t\tout.close();\n\t\tin.close();\t\n\t}", "public static void main(String[] args) {\n\n\t\tScanner scan = new Scanner(System.in);\n\t\t\n\t\tSystem.out.println(\"XAC DINH SO HOAN HAO\");\n\t\tSystem.out.println();\n\t\t\n\t\tint j = 0;\n\t\twhile (j < j+1)\n\t\t{\n\t\tint number;//biến số nhập vào\n\t\t\n\t\tdo\n\t\t{\n\t\t//nhập số cần xác định\n\t\tSystem.out.print(\"Nhap so can xac dinh: \");\n\t\tnumber = scan.nextInt();\n\t\t}\n\t\twhile (number < 0); //bắt người dùng nhập số dương\n\t\t\n\t\t\n\t\tint i; //khai báo biến i dùng để thực hiện bài toán\n\t\tint sumDivisor = 0; //tổng các ước\n\t\t\n\t\tfor (i = 1; i < number ;i++ )\n\t\t{\n\t\t\tif (number % i == 0)\n\t\t\t{\n\t\t\t\tsumDivisor += i;\n\t\t\t}\n\t\t}\n\t\t\n\t\t//xác định số đó có phải số hoàn hảo hay không\n\t\tif (sumDivisor == number)\n\t\t{\n\t\t\tSystem.out.println(number +\" La so hoan hao.\");\n\t\t}\n\t\telse\n\t\t{\n\t\t\tSystem.out.println(number + \" Khong phai la so hoan hao.\");\n\t\t}\n\t\tSystem.out.println();\n\t\t\n\t\t}\n\t}" ]
[ "0.75719035", "0.74944717", "0.6431267", "0.6300665", "0.6254568", "0.61911374", "0.60910475", "0.6049933", "0.60051423", "0.6002172", "0.5965524", "0.5956326", "0.5955198", "0.59388304", "0.5937435", "0.5905292", "0.5895413", "0.5895027", "0.58842075", "0.58707607", "0.58511615", "0.58507264", "0.58307266", "0.58297884", "0.58241355", "0.5819957", "0.5806407", "0.57908875", "0.57792616", "0.5777344", "0.5776351", "0.57719135", "0.57697207", "0.57665324", "0.5766179", "0.57638645", "0.57558405", "0.5746596", "0.5746596", "0.5744203", "0.5734264", "0.5731119", "0.5724408", "0.57205623", "0.5710267", "0.57082003", "0.5702758", "0.5702047", "0.5697247", "0.56733793", "0.56706965", "0.5669241", "0.56627154", "0.56571597", "0.56547534", "0.5649526", "0.5649313", "0.56411266", "0.5631437", "0.5627292", "0.56245315", "0.5624495", "0.56114113", "0.56032044", "0.560276", "0.55984306", "0.55968237", "0.5594735", "0.55947214", "0.5589762", "0.55874455", "0.55861115", "0.55853873", "0.55840635", "0.5581347", "0.55808395", "0.55761194", "0.55748284", "0.55728143", "0.5572538", "0.5568396", "0.5568142", "0.55590403", "0.55574447", "0.55573595", "0.5557349", "0.55554694", "0.55533886", "0.5549316", "0.5545553", "0.5545275", "0.55419654", "0.55390763", "0.55368054", "0.5530262", "0.55266714", "0.55263144", "0.5521872", "0.55196154", "0.5515909", "0.551546" ]
0.0
-1
corner case length==1, n==1
public ListNode removeNthFromEnd(ListNode head, int n){ if ( head == null || head.next == null ) //'n will always be valid.' mean 1<= n <= length? return null; //core logic ListNode dummy = new ListNode(-1); dummy.next = head; ListNode slow = dummy; // slow is the node just before the one to delete, no need to set pre ListNode fast = dummy; // ListNode pre = dummy; // int i = n - 1; while ( n >= 1 ){ // slow + n_step = fast fast = fast.next; n--; } while ( fast.next != null ){ fast = fast.next; slow = slow.next; // pre = pre.next; } // slow.next = fast; // when n==1, fast is the one to be deleted slow.next = slow.next.next; return dummy.next; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public static int length(int n)\n {\n int w = n;\n if(w == 1)\n {\n return 1;\n } \n else\n {\n return 1 + length(next(w));\n }\n }", "public static int hailstoneLength(int n) {\n /* to be implemented in part (a) */\n int length = 0;\n while (n != 1){\n if (n%2!=0)\n n= 3*n+1;\n else if (n%2==0)\n n= n/2;\n length ++;\n }\n return length + 1;\n }", "public static int naslednjiClen(int n) {\n\t\tif(n == 1) {\n\t\t\treturn(1);\n\t\t}else {\n\t\t\tif(n % 2== 0) {\n\t\t\t\treturn(n/2);\n\t\t\t}else {\n\t\t\t\treturn(3*n +1);\n\t\t\t}\n\t\t}\n\t}", "static int solve(int n) \n\t{ \n\t // base case \n\t if (n < 0) \n\t return 0; \n\t if (n == 0) \n\t return 1; \n\t \n\t return solve(n-1) + solve(n-3) + solve(n-5); \n\t}", "public abstract int numOfSameTypeNeighbourToReproduce();", "private Proof addNRightEquality(int n, Proof p) {\n Equals eq = (Equals) p.lastExpr();\n Expression a = eq.firstArgument;\n Expression b = eq.secondArgument;\n if (n == 0) {\n Proof equalitySymConvert = equalitySymConvert(faxm6Gen(b));\n Proof equalitySymConvert1 = equalitySymConvert(faxm6Gen(a));\n Proof equalityRightConvert = equalityRightConvert(equalitySymConvert1, p);\n return equalityShuffle(equalitySymConvert, equalityRightConvert);\n }\n n = n - 1;\n Proof sucResp1 = faxm1Convert(addNRightEquality(n, p));\n Proof eqSubL = equalityRightConvert(equalitySymConvert(faxm5Gen(a, intToLit(n))), sucResp1);\n return equalityShuffle(equalitySymConvert(faxm5Gen(b, intToLit(n))), eqSubL);\n }", "public static int collatz(int n){\n if(n==1)return 1;\n if(n%2==0){\n return collatz(n/2) +1;\n }\n return collatz(3*n+1) +1;\n }", "static int padovan(int n){\n if(n>=0 && n<=2)\n return 1;\n return padovan(n-2) + padovan(n-3);\n }", "private int mirrorCountHelper(int[] numbers, int left, int right, int length) {\r\n \tif ((left <= numbers.length-1) && (right >= 0)) { \t// Check bounds\r\n \tif (numbers[left] == numbers[right]) { \t\t\t// Mirrored numbers\r\n \t\tlength += 1;\r\n \t\tlength = mirrorCountHelper(numbers, ++left, --right, length);\r\n \t}\r\n \t}\r\n \treturn length;\r\n }", "private static boolean isNotDiagonal(int[] chase, int i, int n) {\n\t\tfor(int j=0; j<chase.length; j++) {\n\t\t\tif(chase[j] != -1) {\n\t\t\t\tif(Math.abs(i - j) == Math.abs(n - chase[j]))\n\t\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\t\treturn true;\n\t}", "static int gen(int n)\n{ \n int []S = new int [n + 1];\n \n S[0] = 0;\n if(n != 0)\n S[1] = 1;\n \n for (int i = 2; i <= n; i++)\n { \n \n // S(2 * n) = 4 * S(n)\n if (i % 2 == 0)\n S[i] = 4 * S[i / 2];\n \n // S(2 * n + 1) = 4 * S(n) + 1\n else\n S[i] = 4 * S[i/2] + 1;\n }\n \n return S[n];\n}", "private boolean calculateMaximumLengthBitonicSubarray() {\n\n boolean found = false; // does any BSA found\n\n boolean directionChange = false; //does direction numberOfWays increase to decrease\n\n int countOfChange = 0;\n\n int i = 0;\n directionChange = false;\n int start = i;\n i++;\n for (; i < input.length; i++) {\n if (countOfChange != 0 && countOfChange % 2 == 0) {\n if (this.length < (i - 2 - start + 1)) {\n this.i = start;\n this.j = i - 2;\n this.length = this.j - this.i + 1;\n }\n start = i - 2;\n countOfChange = 0;\n }\n\n if (input[i] > input[i - 1]) {\n if (directionChange == true) {\n countOfChange++;\n }\n directionChange = false;\n }\n if (input[i] < input[i - 1]) {\n if (directionChange == false) {\n countOfChange++;\n }\n directionChange = true;\n }\n\n\n }\n\n if (directionChange == true) {\n if (this.length < (i - 1 - start + 1)) {\n this.i = start;\n this.j = i - 1;\n this.length = this.j - this.i + 1;\n }\n }\n return directionChange;\n }", "private boolean isNxNShape() {\n return this.matrix.size() == this.n &&\n this.matrix.stream()\n .allMatch(row -> row.size() == this.n);\n }", "public boolean isEmpty(){return n==0;}", "public static void test_WQU_OnePath(int n) {\n WQU_OnePath onePath = new WQU_OnePath(n);\n Random random = new Random();\n\n while (onePath.count() != 1) {\n int first = random.nextInt(n);\n int second = random.nextInt(n);\n\n if (!onePath.connected(first, second)) {\n onePath.union(first, second);\n }\n }\n onePathSum += onePath.getDepth();\n }", "static\nint\ncountSeq(\nint\nn, \nint\ndiff) \n{ \n\n// We can't cover difference of more \n\n// than n with 2n bits \n\nif\n(Math.abs(diff) > n) \n\nreturn\n0\n; \n\n\n// n == 1, i.e., 2 bit long sequences \n\nif\n(n == \n1\n&& diff == \n0\n) \n\nreturn\n2\n; \n\nif\n(n == \n1\n&& Math.abs(diff) == \n1\n) \n\nreturn\n1\n; \n\n\nint\nres = \n// First bit is 0 & last bit is 1 \n\ncountSeq(n-\n1\n, diff+\n1\n) + \n\n\n// First and last bits are same \n\n2\n*countSeq(n-\n1\n, diff) + \n\n\n// First bit is 1 & last bit is 0 \n\ncountSeq(n-\n1\n, diff-\n1\n); \n\n\nreturn\nres; \n}", "public static int combinationCounter(int n) {\r\n int hasil = n * (n - 1) / 2;\r\n return hasil;\r\n }", "private static long getCnr(int n, int r)\r\n {\r\n if (n < r || n < 0 || r < 0) {\r\n // Illegal situation.\r\n return -1;\r\n }\r\n\r\n if (r == 0) {\r\n // No need to calculate.\r\n return 1;\r\n }\r\n\r\n /*\r\n * cnr = (r + 1)(r + 2) ... n / (n - r)! (if r > n/2)\r\n * cnr = (n - r + 1)(n - r + 2) ... n / r! (if r <= n/2)\r\n * Take rr = r (if r <= n/2) or (n - r) (if r > n/2)\r\n * Then,\r\n * cnr = (n - rr + 1)(rr + 2) ... n / rr!\r\n */\r\n int rr = (r <= n/2) ? r : (n - r);\r\n long result = 1;\r\n\r\n // Calculate (rr + 1)(rr + 2) ... n\r\n for (int i = (n - rr + 1); i <= n; ++i) {\r\n result *= i;\r\n }\r\n\r\n // Calculate cnr = result / rr!\r\n for (int i = 1; i <= rr; ++i) {\r\n result /= i;\r\n }\r\n\r\n return result;\r\n }", "static int[] OnepassSol1(int[]a, int n){\r\n Map<Integer, Integer> map = new HashMap<>();\r\n for (int i = 0; i < a.length; i++) {\r\n int complement = n - a[i];\r\n if (map.containsKey(complement)) {\r\n return new int[] { map.get(complement), i };\r\n }\r\n map.put(a[i], i);\r\n }\r\n int[] ans = {-1,-1};\r\n return ans;\r\n }", "static int sockMerchant(int n, int[] ar) {\n int result = 0;\n for (int i = 0; i < ar.length - 1; ++i) {\n for (int j = 1; j < ar.length; ++j) {\n if (ar[i] == ar[j] && i != j) {\n if (ar[i] != 0 && ar[j] != 0) {\n result += 1;\n ar[i] = 0;\n ar[j] = 0;\n }\n }\n }\n }\n return result;\n }", "public static int frog(int n, int [] h){\n\n int dp[] = new int [n];\n\n dp[0] = 0;\n dp[1] = Math.abs(h[1] - h[0]);\n\n for(int i = 2; i < n ; i ++){\n\n dp[i] = Math.min(dp [i - 2] + Math.abs(h[i] - h[i - 2]), dp[i - 1] + Math.abs(h[i] - h[i - 1]));\n\n\n\n }\n //print(dp);\n return dp[n - 1];\n }", "private boolean dfs(int n, int[] P) { // 0 is empty, 1 is false, 2 is true\n if (P[n] != 0) {\n if (P[n] == 1) {\n return false;\n }\n else {\n return true;\n }\n }\n\n if (n == 1) {\n P[1] = 2;\n //return true;\n }\n else if (n == 2) {\n P[2] = 2;\n //return true;\n }\n else if (n == 3) {\n P[3] = 1;\n //return false;\n }\n else {\n boolean res = dfs(n-2, P) && dfs(n-3, P) || dfs(n-3, P) && dfs(n-4, P);\n P[n] = res ? 2 : 1;\n }\n\n return P[n] == 2;\n\n //P[n] = P[n-2] + P[n-3] == 4 || P[n-3] + P[n-4] == 4 ? 2 : 1;\n //boolean res = dfs(n-2, P) && dfs(n-3, P) || dfs(n-3, P) && dfs(n-4, P);\n //P[n] = res ? 2 : 1;\n //return res;\n }", "private static boolean findEqualSumSubsetBottomUp(int[] arr, int n) {\n\t\tint sum=0;\n\t\tfor(int i=0;i<n;i++) {\n\t\t\tsum+=arr[i];\n\t\t}\n\t\tif(sum%2==1) {\n\t\t\treturn false;\n\t\t}\n \t\treturn findEqualSumBottomUp(arr,n,sum/2);\n\t}", "public int[] squareUp(int n) {\r\n int[]arreglo=new int[(n*n)]; // O(1)\r\n if(n==0){ // O(1)\r\n return arreglo; // O(1)\r\n }\r\n for(int i=n-1;i<arreglo.length;i=i+n){ // O(n)\r\n for (int j=i;j>=i-(i/n);j--){ // O(1)\r\n arreglo[j]=1+(i-j); // O(1)\r\n }\r\n }\r\n return arreglo; // O(1)\r\n}", "public static List<String> findStrobogrammatic(int n) {\n List<String> cur, ans;\n ans = new ArrayList<String>((n & 1) == 0 ? Arrays.asList(\"\") : Arrays.asList(\"0\", \"1\", \"8\"));\n if (n < 2) return ans;\n\n for (;n > 1; n -= 2) {\n cur = ans;\n ans = new ArrayList<String>();\n for (String i : cur) {\n if (n > 3) {\n ans.add('0' + i + '0');\n }\n ans.add('1' + i + '1');\n ans.add('8' + i + '8');\n ans.add('6' + i + '9');\n ans.add('9' + i + '6');\n }\n }\n System.out.println(ans.size());\n return ans;\n }", "public abstract int numOfEmptyToReproduce();", "static int recursiva1(int n)\n\t\t{\n\t\tif (n==0)\n\t\t\treturn 10; \n\t\tif (n==1)\n\t\t\treturn 20; \n\t\treturn recursiva1(n-1) - recursiva1 (n-2);\t\t\n\t\t}", "static long substrCount(int n, String s) {\n \tlong output=0;\n \t\n \tboolean[][] matrix = new boolean[n][n];\n \t\n \tfor(int i=0; i<n; i++) {\n \t\tmatrix[i][i] = true;\n \t\toutput++;\n \t}\n \t\n \tfor(int gap=1; gap<n; gap++) {\n \t\tfor(int i=0; i+gap <n; i++) {\n \t\t\tint j = i+gap;\n \t\t\t\n \t\t\tif(gap ==1) {\n \t\t\t\tif(s.charAt(i) == s.charAt(j)) {\n \t\t\t\t\tmatrix[i][j] = true;\n \t\t\t\t\toutput++;\n \t\t\t\t} else {\n \t\t\t\t\tmatrix[i][j] = false;\n \t\t\t\t}\n \t\t\t} else {\n \t\t\t\tif(s.charAt(i) == s.charAt(j) && matrix[i+1] [j-1]) {\n \t\t\t\t\t\n \t\t\t\t\tif(j-i >= 4 && s.charAt(i)== s.charAt(i+1)) {\n \t\t\t\t\t\tmatrix[i][j] = true;\n \t\t\t\t\toutput++;\n \t\t\t\t\t} else if(j-i <4) {\n \t\t\t\t\t\tmatrix[i][j] = true;\n \t\t\t\t\toutput++;\n \t\t\t\t\t} else {\n \t\t\t\t\t\tmatrix[i][j] = false;\n \t\t\t\t\t}\n \t\t\t\t\t\n \t\t\t\t} else {\n \t\t\t\t\tmatrix[i][j] = false;\n \t\t\t\t}\n \t\t\t}\n \t\t}\n \t}\n \t\n \treturn output;\n }", "public static void sierpinski(int n, double x, double y, double length) {\n //double[] xValuesSierpinski = \n //StdDraw.polygon(x, y)\n if(n == 0) {// dont call return statement here bc u are just calling the function\n return;\n }\n\n\t// WRITE YOUR CODE HERE\n filledTriangle(x, y, length);\n sierpinski(n-1, x, y + height(length), length/2); // triangle up top coorinate point for bottom \n sierpinski(n-1, x - length/2, y, length/2); //triangle to the left\n sierpinski(n-1, x + length/2, y, length/2); // triangle to the right that is small\n }", "static long substrCount(int n, String s) {\nchar arr[]=s.toCharArray();\nint round=0;\nlong count=0;\nwhile(round<=arr.length/2)\n{\nfor(int i=0;i<arr.length;i++)\n{\n\t\n\t\tif(round==0)\n\t\t{\n\t\t//System.out.println(arr[round+i]);\n\t\tcount++;\n\t\t}\n\t\telse\n\t\t{\n\t\t\tif(i-round>=0&&i+round<arr.length)\n\t\t\t{\n\t\t\t\tboolean flag=true;\n\t\t\t\tchar prev1=arr[i-round];\n\t\t\t\tchar prev2=arr[i+round];\n\t\t\t\t\n\t\t\t\tfor(int j=1;j<=round;j++)\n\t\t\t\t{\n\t\t\t\t\tif(prev1!=arr[i+j]||prev1!=arr[i-j])\n\t\t\t\t\t{\n\t\t\t\t\t\tflag=false;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\tif(arr[i+j]!=arr[i-j])\n\t\t\t\t\t{\n\t\t\t\t\t\t\n\t\t\t\t\t\tflag=false;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t}\n\t\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t}\n\t\t\t\tif(flag)\n\t\t\t\t{\n\t\t\t\t\t//System.out.print(arr[i-round]);\n\t\t\t\t\t//System.out.print(arr[round+i]);\n\t\t\t\t\t//System.out.println(round);\n\t\t\t\t\t//System.out.println();\n\t\t\t\tcount++;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\n}\nround++;\n}\nreturn count;\n }", "public int sides1() {\n for (int row = 0; row < board.length; row++)\n for (int col = 0; col < board.length; col++) {\n // left-border (excluding corners - check 3 sides only)\n if (row != 0 && row != board.length - 1 && col == 0) {\n if (board[row - 1][col] != null && board[row][col + 1] != null && board[row + 1][col] != null\n && board[row][col] != null)\n if (board[row - 1][col].getPlayerNumber() != board[row][col].getPlayerNumber()\n && board[row - 1][col].getPlayerNumber() != board[row][col].getPlayerNumber() &&\n board[row][col + 1].getPlayerNumber() != board[row][col].getPlayerNumber())\n if (playersArray[board[row][col].getPlayerNumber()] != -3)\n return board[row][col].getPlayerNumber();\n\n }\n // right-border (excluding corners - check 3 sides only)\n if (row != 0 && row != board.length - 1 && col == board.length - 1) {\n if (board[row - 1][col] != null && board[row][col - 1] !=\n null && board[row + 1][col] != null&& board[row][col] != null)\n if (board[row - 1][col].getPlayerNumber() != board[row][col].getPlayerNumber()\n && board[row][col].getPlayerNumber() != board[row+1][col] .getPlayerNumber() &&\n board[row][col - 1].getPlayerNumber() != board[row][col].getPlayerNumber())\n if (playersArray[board[row][col].getPlayerNumber()] != -3)\n return board[row][col].getPlayerNumber();\n }\n // above-border (excluding corners - check 3 sides only)\n if (col != 0 && col != board.length - 1 && row == 0) {\n if (board[row][col - 1] != null && board[row][col + 1] !=\n null && board[row + 1][col] != null&& board[row][col] != null)\n if (board[row][col].getPlayerNumber() == board[row][col + 1].getPlayerNumber()\n && board[row + 1][col].getPlayerNumber() != board[row][col].getPlayerNumber() &&\n board[row][col - 1].getPlayerNumber() != board[row][col].getPlayerNumber())\n if (playersArray[board[row][col].getPlayerNumber()] != -3)\n return board[row][col].getPlayerNumber();\n }\n // bottom-border (excluding corners - check 3 sides only)\n if (col != 0 && col != board.length - 1 && row == board.length - 1) {\n if (board[row][col - 1] != null && board[row][col + 1] != null && board[row - 1][col] != null&&\n board[row][col]!= null)\n if (board[row][col].getPlayerNumber() != board[row][col + 1].getPlayerNumber()\n && board[row - 1][col].getPlayerNumber() != board[row][col].getPlayerNumber() &&\n board[row][col - 1].getPlayerNumber() != board[row][col].getPlayerNumber())\n return board[row][col - 1].getPlayerNumber();\n }\n\n }\n return -2;\n\n }", "public String canWalkExactly(int N, int[] from, int[] to) {\n isVisited = new boolean[N];\n steps = new int[N];\n minSteps = new int[N];\n path = new Stack<>();\n adj = new ArrayList<>(N);\n allSCC = new ArrayList<>();\n for (int i = 0; i < N; i++)\n adj.add(new ArrayList<>());\n\n // populate adj based on from, to\n for (int i = 0; i < from.length; i++) {\n adj.get(from[i]).add(to[i]);\n }\n\n totalSteps = 0;\n Arrays.fill(isVisited, false);\n Arrays.fill(steps, UNVISITED);\n Arrays.fill(minSteps, UNVISITED);\n tarjanSCC(0);\n\n // check if 0 and 1 are in the same scc\n System.out.println(\"CHECKING\");\n boolean found = false;\n for (List<Integer> scc : allSCC) {\n if (scc.contains(0) && scc.contains(1)) {\n found = true;\n break;\n }\n }\n if (!found) return NO;\n// if(minSteps[0] != minSteps[1]) return NO;\n System.out.println(\"0 and 1 in the same scc\");\n /*\n Check if gcd of the length of all simple cycles is 1\n by checking if it is an aperiodic graph\n https://en.wikipedia.org/wiki/Aperiodic_graph\n */\n depths = new int[N];\n Arrays.fill(depths, UNVISITED);\n depths[0] = 0;\n findDepths(0);\n\n int res = -1;\n for (int i = 0; i < from.length; i++) {\n int s = from[i];\n int t = to[i];\n if (depths[s] == UNVISITED || depths[t] == UNVISITED) continue;\n int len = depths[t] - depths[s] - 1;\n if (len == 0) continue;\n if (len < 0) len *= -1;\n if (res == -1) res = len;\n else res = gcd(res, len);\n }\n\n return res == 1 ? YES : NO;\n }", "boolean hasN();", "boolean hasN();", "private int rightmostDip() {\n for (int i = n - 2; i >= 0; i--) {\n if (index[i] < index[i + 1]) {\n return i;\n }\n }\n return -1;\n }", "public static long countWaysToClimb(int[] steps, int n) {\n\n int ans[] = new int[n+1];\n ans[0]=1; // why ?? because we are going bottom up and same as recursion when we reach ground level 0 we know\n // there was a way . Consider steps=[2,3]; so cWC(steps,2), cWC(steps,3) will have 2-2,3-2 and we are having 1 //return valuel\n for(int i=1;i<=n;i++){\n for(int st:steps){\n if(i-st>=0){\n ans[i]+=ans[i-st];\n }\n }\n }\n return ans[n];\n\n\n\n }", "static long nPolyNTime(int[] n) {\n int temp = n.length;\n long sum = 0;\n if(n == null || n.length == 0) return -1;\n for(int i = 0; i < n.length; ++i) {\n while(temp --> 0) {\n for(int j = 0; j < n.length; ++j) {\n sum += n[i] + n[j];\n }\n }\n }\n return sum;\n }", "public static void process(int n){\n\t\tint right, left, i;\n\n\t\tright = i = 0;\n\t\twhile(i < n){\n\t\t\twhile (right < n && c[i] == c[right]) right++;\n\t\t\tfor(int j = i; j < right; ++j) max_right[j] = right;\n\t\t\ti = right;\n\t\t}\n\n\t\tleft = i = n-1;\n\t\twhile(i >= 0){\n\t\t\twhile (left >= 0 && c[i] == c[left]) left--;\n\t\t\tfor (int j = i; j > left; --j) max_left[j] = left;\n\t\t\ti = left;\n\t\t}\n\t}", "public void triplet(int[] b,int n){\r\n\t\tint count=0;\r\n\t\tfor(int i=0;i<n;i++){\r\n\t\t\tfor(int j=i+1;j<n-1;j++){\r\n\t\t\t\tfor(int k=j+1;k<n-2;k++){\r\n\t\t\t\t\tif(b[i]+b[j]+b[k]==0){\r\n\t\t\t\t\t\tSystem.out.println(b[i]+\" \"+b[j]+\" \"+b[k]);\r\n\t\t\t\t\t\tcount++;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\tSystem.out.println(\"no of distinct triplet is:\"+count);\t\r\n\r\n\t}", "private static int findCollision(int[][] matrix, int n) {\n int count = 0;\n for (int i = 0; i <= n - 1; i++) {\n for (int j = 0; j <= n - 1; j++) {\n if (matrix[i][j] == 1) {\n // left row\n for (int k = j - 1; k >= 0; k--) {\n if (matrix[i][k] == 2) {\n break;\n }\n if (matrix[i][k] == 1) {\n count++;\n }\n }\n // right row\n for (int k = j + 1; k <= n - 1; k++) {\n if (matrix[i][k] == 2) {\n break;\n }\n if (matrix[i][k] == 1) {\n count++;\n }\n }\n // up col\n for (int k = i - 1; k >= 0; k--) {\n if (matrix[k][j] == 2) {\n break;\n }\n if (matrix[k][j] == 1) {\n count++;\n }\n }\n // down col\n for (int k = i + 1; k <= n - 1; k++) {\n if (matrix[k][j] == 2) {\n break;\n }\n if (matrix[k][j] == 1) {\n count++;\n }\n }\n // up left\n for (int k = i - 1, l = j - 1; k >= 0 && l >= 0; k--, l--) {\n if (matrix[k][l] == 2) {\n break;\n }\n if (matrix[k][l] == 1) {\n count++;\n }\n }\n // down left\n for (int k = i + 1, l = j - 1; k <= n - 1 && l >= 0; k++, l--) {\n if (matrix[k][l] == 2) {\n break;\n }\n if (matrix[k][l] == 1) {\n count++;\n }\n }\n // up right\n for (int k = i - 1, l = j + 1; k >= 0 && l <= n - 1; k--, l++) {\n if (matrix[k][l] == 2) {\n break;\n }\n if (matrix[k][l] == 1) {\n count++;\n }\n }\n // down right\n for (int k = i + 1, l = j + 1; k <= n - 1 && l <= n - 1; k++, l++) {\n if (matrix[k][l] == 2) {\n break;\n }\n if (matrix[k][l] == 1) {\n count++;\n }\n }\n }\n }\n }\n return count / 2;\n }", "private boolean corner(int e) {\r\n if (endx[e] + 200 >= width - radius[e] && directionend[e] == 0) {\r\n return true;\r\n } else if (endy[e] + 200 >= height - radius[e] && directionend[e] == 1) {\r\n return true;\r\n } else if (endx[e] - 200 <= radius[e] && directionend[e] == 2) {\r\n return true;\r\n } else if (endy[e] - 200 <= radius[e] && directionend[e] == 3) {\r\n return true;\r\n }\r\n return false;\r\n }", "public static void collatz(int n) {\n\t\tSystem.out.println(n);\n\t\twhile(n != 1) {\n\t\t\tn = naslednjiClen(n);\n\t\t\tSystem.out.println(n);\n\t\t}\n\t\t\n\t}", "private static int findMissingNumber( int[] a, int n) {\n int result = 0;\n for(int i=1; i<(n+1)+1; i++) {\n result = result ^ i;\n }\n for(int i=0; i<a.length; i++) {\n result = result ^ a[i];\n }\n return result;\n }", "private int first_leaf() { return n/2; }", "static int getMissingNo (int a[], int n) \n { \n int x1 = a[0]; \n int x2 = 1; \n \n for (int i = 1; i <= n; i++) {\n if(i != n)\n x1 = x1 ^ a[i]; \n x2 = x2 ^ (i+1); \n \n }\n System.out.println(\"x2 :\"+x2);\n return (x1 ^ x2); \n \n /* //For xor of all the elements \n //in array \n for (int i = 1; i < n; i++) {\n \n System.out.print(x1+\" ^ \"+a[i]);\n x1 = x1 ^ a[i]; \n System.out.println(\"=\"+x1);\n \n }\n System.out.println(\"x1 :\"+x1);\n System.out.println(\"==\");\n //For xor of all the elements \n // from 1 to n+1 \n for (int i = 2; i <= n+1; i++) {\n \tSystem.out.print(x2+\" ^ \"+i);\n x2 = x2 ^ i; \n System.out.println(\"=\"+x2);\n }\n \n System.out.println(\"x2 :\"+x2);\n return (x1 ^ x2); */\n }", "public static void printPattern(int n){\n int c=1;\n for(int i=1;i<=(n+1)/2;i++){\n for(int j=1;j<=n;j++){\n System.out.print(c+\" \");\n c++;\n }\n c=c+n;\n System.out.println();\n }\n if(n%2==0)\n c=c-n;\n else\n c=c-3*n;\n for(int i=(n+1)/2;i<n;i++){\n for(int j=1;j<=n;j++){\n System.out.print(c+\" \");\n c++;\n }\n c=c-3*n;\n System.out.println();\n }\n\n\t}", "private static int nthUglyNumber(int n) {\n if (n == 0) {\n return 1;\n }\n\n int[] dp = new int[n];\n dp[0] = 1;\n int index2 = 0, index3 = 0, index5 = 0;\n for (int i = 1; i < n; i++) {\n dp[i] = Math.min(2 * dp[index2], Math.min(3 * dp[index3], 5 * dp[index5]));\n System.out.println(dp[i]);\n if (dp[i] == 2 * dp[index2]) {\n index2++;\n }\n\n if (dp[i] == 3 * dp[index3]) {\n index3++;\n }\n\n if (dp[i] == 5 * dp[index5]) {\n index5++;\n }\n }\n\n return dp[n - 1];\n }", "private final int m()\n\t { int n = 0;\n\t int i = 0;\n\t while(true)\n\t { if (i > j) return n;\n\t if (! cons(i)) break; i++;\n\t }\n\t i++;\n\t while(true)\n\t { while(true)\n\t { if (i > j) return n;\n\t if (cons(i)) break;\n\t i++;\n\t }\n\t i++;\n\t n++;\n\t while(true)\n\t { if (i > j) return n;\n\t if (! cons(i)) break;\n\t i++;\n\t }\n\t i++;\n\t }\n\t }", "private boolean rightLeftFull(int i, int j) { // part of isfull1\n if (j != 0 && j != count) { // not edges\n if (id[i][j - 1] == 1 && ic[i][j - 1] != 1 && !targetReached) { // and not marked as old patern in ic a N*N array\n ic[i][j - 1] = 1;\n isFull1(i + 1, j);\n }\n if (id[i][j + 1] == 1 && ic[i][j + 1] != 1 && !targetReached) { // and not marked as old patern in ic a N*N array\n ic[i][j + 1] = 1;\n isFull1(i + 1, j + 2);\n }\n\n } else if (j == 0) { // right site\n if (id[i][j + 1] == 1 && ic[i][j + 1] != 1 && !targetReached) { // and not marked as old patern in ic a N*N array\n ic[i][j + 1] = 1;\n isFull1(i + 1, j + 2);\n }\n\n } else { // left site\n if (id[i][j - 1] == 1 && ic[i][j - 1] != 1 && !targetReached) { // and not marked as old patern in ic a N*N array\n ic[i][j - 1] = 1;\n isFull1(i + 1, j);\n }\n }\n\n\n return false;\n }", "void segregate0and1(int arr[], int size)\n {\n int left = 0;\n int right = size - 1;\n while(left < right){\n while(arr[left] !=1 && left< right){\n left ++;\n }\n while(arr[right] !=0 && left < right){\n right --;\n }\n if(left != right){\n int tmp = arr[left];\n arr[left] = arr[right];\n arr[right] = tmp;\n left ++;\n right -- ;\n }\n }\n }", "public static int distinctPaths1(int n) {\n\t\tMyInteger total = new MyInteger();\n\t\ttotal.set(0);\n\t\tauxPaths1(1, 1, n, total);\n\t\treturn total.get();\n\t}", "public static int distinctPaths4(int n) {\n\t\tint[][] mem = new int[n+1][n+1];\n\t\tfor(int j = 1; j <= n; ++j) {\n\t\t\tmem[1][j] = 1;\n\t\t\tmem[j][1] = 1;\n\t\t}\n\t\tfor(int i = 2; i <= n; ++i) {\n\t\t\tfor(int j = 2; j <= n; ++j) {\n\t\t\t\tmem[i][j] = mem[i-1][j] + mem[i][j-1];\n\t\t\t}\n\t\t}\n\t\treturn mem[n][n];\n\t}", "public int climbStairs(int n){\n if(n<0)\n return 0;\n if(n==0)\n return 1;\n return climbStairs(n-1)+climbStairs(n-2);\n }", "public static void main(String[] args) {\n int n = 3;\n System.out.println(numberOfBinaryStringsWithoutConsecutiveOnes(n));\n }", "public static int generateFirstHalf(int n) {\n return ((int) Math.pow(10, n) - 1); // 99*99 < 9889, 999*999 < 998899 etc, so in this case, we could start checking from 10^n - 3\n }", "public static int ulam(int n) {\n\n List<Integer> list = new ArrayList<>();\n list.add(1);\n list.add(2);\n\n int i = 3;\n while (list.size() < n) {\n\n int count = 0;\n for (int j = 0; j < list.size() - 1; j++) {\n\n for (int k = j + 1; k < list.size(); k++) {\n if (list.get(j) + list.get(k) == i)\n count++;\n if (count > 1)\n break;\n }\n if (count > 1)\n break;\n }\n if (count == 1)\n list.add(i);\n i++;\n }\n return list.get(n - 1);\n }", "int nDiagonalRight(int n, int[][] board, int playerNumber, int width, int height, int connectN){\r\n\t\t//int max = 0;\r\n\t\tint num = 0;\r\n\t\t//int opponentNumber = (playerNumber==1) ? 2 : 1;\r\n\t\tfor(int i=0; i < (width-connectN); i++){\r\n\t\t\tfor (int j=0; j<(height-connectN); j++){\r\n\t\t\t\tif (n == 2) {\r\n\t\t\t\t\tif(board[i][j] == playerNumber &&\r\n\t\t\t\t\t\t\tboard[i+1][j+1] == playerNumber){\r\n\t\t\t\t\t\tnum++;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\tif (n == 3){\r\n\t\t\t\t\tif(board[i][j] == playerNumber &&\r\n\t\t\t\t\t\t\tboard[i+1][j+1] == playerNumber &&\r\n\t\t\t\t\t\t\tboard[i+2][j+2] == playerNumber){\r\n\t\t\t\t\t\tnum++;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\tif(n == 4){\r\n\t\t\t\t\tif(board[i][j] == playerNumber &&\r\n\t\t\t\t\t\t\tboard[i+1][j+1] == playerNumber &&\r\n\t\t\t\t\t\t\tboard[i+2][j+2] == playerNumber &&\r\n\t\t\t\t\t\t\tboard[i+3][j+3] == playerNumber){\r\n\t\t\t\t\t\tnum++;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn num;\r\n\t}", "static boolean truncLeftToRight(int n, boolean[] composite) {\n // Find the largest order of magnitude for this number\n int orderOfMagnitude = 1;\n int place = 0;\n\n while(n / orderOfMagnitude != 0) orderOfMagnitude *= 10;\n\n while(n % orderOfMagnitude != 0) {\n if(composite[n%orderOfMagnitude]) return false;\n orderOfMagnitude /= 10;\n }\n\n return true;\n }", "public int climbStairs4(int n){\n if(n==1)\n return 1;\n int first=1;\n int second=2;\n for(int i=3;i<=n;i++){\n int third=first+second;\n first=second;\n second=third;\n }\n return second;\n }", "public boolean percolates(){\n\t //special case for n=1:\n\t if(n==1 && numOpen==0){\n\t return false;\n\t }\n\t //this seems very inefficient.. maybe fix\n\t //way to prevent backwash\n\t for(int i= (n*n -n)+1; i <= n*n; i++){\n\t if(grid.connected(0, i)){\n\t return true;\n\t }\n\t }\n\t\treturn false;\n\t}", "public static void print(int n) {\n int[][] data = new int[n][n];\n data[0][0] = 1;\n data[n - 1][n - 1] = n * n;\n\n //将蛇形矩阵按照正对角线分为上半部分和下半部分\n //现在先来设计上半部分,并且负责对角线,上半部分可将斜线的顺序记为k,按k的奇偶性进行判断\n //以斜线为基准打印\n for (int k = 1; k <= (n - 1); k++) {\n if (k % 2 == 1) {//当k为奇数时,代表每条斜线的最小值在上方\n data[0][k] = 1 + k * (k + 1) / 2;\n for (int i = 1; i <= k; i++) {\n data[i][k - i] = data[0][k] + i;//行递增,列递减\n\n }\n } else {//当k为偶数时,代表每条斜线的最小值在下方\n data[k][0] = 1 + k * (k + 1) / 2;\n for (int i = 0; i <= k; i++) {\n data[k - i][i] = data[k][0] + i;//行递减,列递增\n }\n }\n }//上半部分就已经设计好了,接着设计下半部分\n\n //下半部分就会显得比较复杂,首先要先判断n的奇偶性,还要再判断k的奇偶性\n //从左向右按照从大到小的顺序进行斜线的连接,同样以k代表斜线的序号\n if (n % 2 == 0) {//如果n为偶数\n for (int k = 1; k <= (n - 2); k++) {\n if (k % 2 == 1) {//当k为奇数的时候每条斜线的最大值在上方\n data[k][n - 1] = data[n - 1][n - 1] - (n - k - 1) * (n - k) / 2;\n for (int i = 1; i < n - k; i++) {\n data[k + i][n - 1 - i] = data[k][n - 1] - i;//行递增,列递减\n }\n } else {//当k为偶数的时候,每条斜线的最大值在下方\n data[n - 1][k] = data[n - 1][n - 1] - (n - k - 1) * (n - k) / 2;\n for (int i = 1; i < n - k; i++) {\n data[n - 1 - i][k + i] = data[n - 1][k] - i;//行递减,列递增\n }\n }\n }\n } else {//如果n为奇数,那么就是相反的\n for (int k = 1; k <= (n - 2); k++) {\n if (k % 2 == 0) {//当k为偶数的时候每条斜线的最大值在上方\n data[k][n - 1] = data[n - 1][n - 1] - (n - k - 1) * (n - k) / 2;\n for (int i = 1; i < n - k; i++) {\n data[k + i][n - 1 - i] = data[k][n - 1] - i;//行递增,列递减\n }\n } else {//当k为奇数的时候,每条斜线的最大值在下方\n data[n - 1][k] = data[n - 1][n - 1] - (n - k - 1) * (n - k) / 2;\n for (int i = 1; i < n - k; i++) {\n data[n - 1 - i][k + i] = data[n - 1][k] - i;//行递减,列递增\n }\n }\n }\n }//下半部分的就设计好咯\n\n //接下来就是显示矩阵咯\n\n for (int i = 0; i < data.length; i++) {\n for (int j = 0; j < data[i].length; j++) {\n System.out.print(data[i][j] + \"\\t\");\n }\n System.out.println();\n }//结束显示,结束print方法,进入main方法\n }", "int nDiagonalLeft(int n, int[][] board, int playerNumber, int width, int height, int connectN){\r\n\t\t//int max = 0;\r\n\t\tint num = 0;\r\n\t\t//int opponentNumber = (playerNumber==1) ? 2 : 1;\r\n\t\tfor(int i=width; i < (width-connectN); i--){\r\n\t\t\tfor (int j=0; j<(height-connectN); j++){\r\n\t\t\t\tif (n == 2) {\r\n\t\t\t\t\tif(board[i][j] == playerNumber &&\r\n\t\t\t\t\t\t\tboard[i-1][j+1] == playerNumber){\r\n\t\t\t\t\t\tnum++;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\tif (n == 3){\r\n\t\t\t\t\tif(board[i][j] == playerNumber &&\r\n\t\t\t\t\t\t\tboard[i-1][j+1] == playerNumber &&\r\n\t\t\t\t\t\t\tboard[i-2][j+2] == playerNumber){\r\n\t\t\t\t\t\tnum++;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\tif(n == 4){\r\n\t\t\t\t\tif(board[i][j] == playerNumber &&\r\n\t\t\t\t\t\t\tboard[i-1][j+1] == playerNumber &&\r\n\t\t\t\t\t\t\tboard[i-2][j+2] == playerNumber &&\r\n\t\t\t\t\t\t\tboard[i-3][j+3] == playerNumber){\r\n\t\t\t\t\t\tnum++;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn num;\r\n\t}", "private static int path1(int n) {\n int[] path = new int[n+1];\n path[0] = 0;\n path[1] = 1;\n path[2] = 2;\n for (int i=3;i<=n;i++) {\n path[i] = path[i-1] + path[i-2];\n }\n return path[n];\n }", "public int trailingZeroes3333(int n) {\n int count = 0;\n while (n>0)\n count += (n/=5);\n return count;\n }", "public int n_()\r\n/* 429: */ {\r\n/* 430:442 */ return this.a.length + 4;\r\n/* 431: */ }", "public static void collatzRecursive(long n) {\n\t\tSystem.out.print(n + \" \");\n \tif (n == 1) return;\n \t\telse if (n % 2 == 0) collatzRecursive(n / 2);\n \t\telse collatzRecursive(3*n + 1);\n }", "public boolean percolates() {\n return uf.connected(n*n, n*n+1);\r\n }", "int catalan(int n) { \n int res = 0; \n \n // Base case \n if (n <= 1) { \n return 1; \n } \n for (int i = 0; i < n; i++) { \n res += catalan(i) * catalan(n - i - 1); \n } \n return res; \n }", "private static int betterSolution(int n) {\n return n*n*n;\n }", "static public void findPossibleTrianglesCount_V1(int[] arr, int n){\n \r\n int i,j,k; //loop or index variables\r\n int nTriangles = 0;\r\n \r\n for(i=0; i<n-2; i++){\r\n for(j=i+1; j<n-1; j++){\r\n for(k=j+1; k<n; k++){\r\n if(arr[i] != arr[j] && arr[i] != arr[k] && arr[j] != arr[k]){\r\n if(arr[i]+arr[j] > arr[k] && arr[i]+arr[k] > arr[j] && arr[j]+arr[k] > arr[i] ){ //a+b > c \r\n System.out.println(arr[i] + \" , \" + arr[j] + \" , \" + arr[k]);\r\n nTriangles+=1;\r\n }\r\n } //if\r\n } //innermost for k\r\n } //inner for j\r\n } //outer for i\r\n \r\n System.out.println(\"Number of possible triangles: \" + nTriangles);\r\n }", "public int climbStairs(int n) {\n\t int[] ways = new int[n+1]; \n\t for(int i = 0; i < ways.length; i++){\n\t \t if(i<=1)\n\t \t\t ways[i] = 1;\n\t \t else\n\t \t\t ways[i] = ways[i-2] + ways[i-1]; \n\t }\n\t return ways[n];\n\t }", "public boolean percolates(){\r\n\t\treturn uf.connected(N * N, N * N + 1);\r\n\t}", "public boolean percolates() {\n return myUF.connected(n*n, n*n + 1);\n }", "public static int numSquares1(int n) {\n\t\t int[] table = new int[n+1] ;\n\t\t Arrays.fill(table, n+1);\n\t\t int m = (int)Math.sqrt(n) + 1;\n\t\t int i = 0;\n\t\t table[0] = 0;\n\t\t while(i++ <= m ){\n\t\t\t for(int j = 0; j < n+1; j++){\n\t\t\t\t int x = j - (i * i) >= 0 ? table[j - (i * i)] : n+1;\n\t\t\t\t table[j] = Math.min(table[j], x + 1);\n\t\t\t }\n\t\t }\n\t \n\t return table[n]; \n\t \n\t }", "int max_cut_2(String s)\n {\n\n if(s==null || s.length()<2)\n {\n return 0;\n }\n int n = s.length();\n boolean[][] dp = new boolean[n][n];\n int[] cut = new int[n];\n for(int i = n-1;i>=0;i++) {\n\n //i represents the 左大段和右小段的左边界\n //j represents the 右小段的右边界\n cut[i] = n - 1 - i;\n\n for (int j = i; j < n; j++) {\n if (s.charAt(i) == s.charAt(j) && (j - i < 2 || dp[i + 1][j - 1]))\n {\n dp[i][j] = true;\n if(j == n-1)\n {\n cut[i]=0;\n }\n else{\n cut[i] = Math.min(cut[i],cut[j+1]+1);\n }\n }\n }\n }\n\n return cut[0];\n }", "static int getMissingByAvoidingOverflow(int a[], int n)\n\t {\n\t int total = 2;\n\t for (int i = 3; i <= (n + 1); i++)\n\t {\n\t total =total+ i -a[i - 2];\n\t //total =total- a[i - 2];\n\t }\n\t return total;\n\t }", "public int climbStairs3(int n){\n if(n==1) return 1;\n int[] dp=new int[n+1];\n dp[1]=1;\n dp[2]=2;\n for(int i=3;i<=n;i++){\n dp[i]=dp[i-1]+dp[i-2];\n }\n return dp[n];\n }", "public static boolean isPentagonal(int n) {\n double position = (1 + Math.sqrt(1 + 24 * n))/6;\r\n \r\n //Checks if the position is an integer\r\n if((position == Math.floor(position)) && !Double.isInfinite(position))\r\n return true;\r\n \r\n return false;\r\n }", "public abstract boolean isHappy(int n);", "private static void solution() {\n for (int i = 0; i < n; i++) {\n Coord here = coords[i]; // start, end, dir, gen\n for (int j = 0; j < here.gen; j++) {\n // Rotate degree of 90.\n List<Pair> changed = rotate(here.coord, here.endPoint);\n boolean first = true;\n for(Pair p: changed){\n if(first) {\n here.endPoint = new Pair(p.x, p.y);\n first = false;\n }\n here.coord.add(new Pair(p.x, p.y));\n }\n }\n }\n // count the number of squares enclosing all angles with dragon curve\n for (int i = 0; i < n; i++) {\n for(Pair p: coords[i].coord)\n board[p.y][p.x] = true;\n }\n int cnt = 0;\n for (int i = 0; i < 100; i++)\n for (int j = 0; j < 100; j++)\n if(board[i][j] && board[i + 1][j] && board[i][j + 1] && board[i + 1][j + 1])\n cnt += 1;\n System.out.println(cnt);\n }", "public int numSquaresIII(int n) {\n List<Integer> squareNum = new ArrayList<>();\n for (int i = 1; i * i <= n; i++) {\n squareNum.add(i * i);\n }\n Queue<Integer> queue = new ArrayDeque<>();\n queue.offer(n);\n int level = 0;\n while (!queue.isEmpty()) {\n ++level;\n Queue<Integer> nextQueue = new ArrayDeque<>();\n for (Integer rem : queue) {\n for (Integer square : squareNum) {\n if (rem.equals(square)) {\n return level;\n } else if (rem < square) {\n break;\n } else {\n nextQueue.offer(rem - square);\n }\n }\n }\n queue = nextQueue;\n }\n return level;\n }", "public static void findTriplets(int[] arr,int n)\n {\n boolean found = false;\n for (int i=0;i<n-2;i++)\n {\n for (int j=i+1; j<n-1; j++)\n {\n for(int k=j+1; k<n;k++)\n {\n if(arr[i]+arr[j]+arr[k] == 0)\n {\n System.out.println(arr[i]);\n System.out.println(\" \");\n System.out.println(arr[j]);\n System.out.println(\" \");\n System.out.println(arr[k]);\n System.out.println(\"\\n\");\n found = true;\n }\n }\n }\n }\n //if no triplet with 0 sum found in arrat\n if(found == false)\n System.out.println(\"not exist\");\n }", "@Test public void findPentagonalPyramidWithShortestBaseEdgeNTest()\n {\n PentagonalPyramid[] pArray = new PentagonalPyramid[100];\n PentagonalPyramidList2 pList = new PentagonalPyramidList2(\"ListName\", \n pArray, 0);\n Assert.assertEquals(null, \n pList.findPentagonalPyramidWithShortestBaseEdge());\n }", "public int climbStairs(int n) {\n if (n < 1) {\n return 0;\n }\n return helper(n);\n }", "private static int getNumberOfWays(int n, int[] dp) {\n\t\t\r\n\t\tif(n==0) {\r\n\t\t\tdp[n] = 0; \r\n\t\t\treturn 0;\r\n\t\t}\r\n\t\t\r\n\t\tif(n == 1) {\r\n\t\t\tdp[1] = 1;\r\n\t\t\treturn 1;\r\n\t\t}\r\n\t\t\r\n\t\tif(n == 2) {\r\n\t\t\tdp[2] = 2;\r\n\t\t\treturn 2;\r\n\t\t}\r\n\t\t\r\n\t\tif(dp[n] == 0){\r\n\t\t\tdp[n] = getNumberOfWays(n-1, dp) + getNumberOfWays(n-2, dp);\r\n\t\t}\r\n\t\treturn dp[n];\r\n\t}", "static int superSeq(String X, String Y, int m, int n)\n {\n int[][] dp = new int[m + 1][n + 1];\n\n // Fill table in bottom up manner\n for (int i = 0; i <= m; i++) {\n for (int j = 0; j <= n; j++) {\n // Below steps follow above recurrence\n if (i == 0)\n dp[i][j] = j;\n else if (j == 0)\n dp[i][j] = i;\n else if (X.charAt(i - 1) == Y.charAt(j - 1))\n dp[i][j] = 1 + dp[i - 1][j - 1];\n else\n dp[i][j] = 1\n + Math.min(dp[i - 1][j],\n dp[i][j - 1]);\n }\n }\n\n return dp[m][n];\n }", "public static int dolzina(int n) {\n\t\tint dolzina = 1;\n\t\t\n\t\twhile(n != 1) {\n\t\t\tn = naslednjiClen(n);\n\t\t\tdolzina = dolzina + 1;\n\t\t}\n\t\treturn(dolzina);\n\t\t\n\t}", "public int climbStairs(int n) {\n if (n == 1) return 1;\n if (n < 3) return 2;\n if (n == 0) return 0;\n int[] dp = new int[n+1];\n dp[0] = 1;\n dp[1] = 2;\n dp[2] = 2;\n for (int i = 2; i < n; i++){\n dp[i] = dp[i -1] +dp[i -2];\n }\n return dp[n-1];\n }", "public static int[][] task9_spiralGenerate(int n) {\n\t\tif (n <= 0) {\n\t\t\treturn new int[][] {};\n\t\t}\n\t\tint rLen = n;\n\t\tint cLen = n;\n\t\tint[][] matrix = new int[n][n];\n\t\tint leftB = 0, rightB = cLen - 1;\n\t\tint upperB = 0, lowerB = rLen - 1;\n\t\tint counter = 1;\n\t\twhile (true) {\n\t\t\tfor (int j = leftB; j <= rightB; j++) {\n\t\t\t\tmatrix[upperB][j] = counter++;\n\t\t\t}\n\t\t\tupperB++;\n\t\t\tif (leftB > rightB || upperB > lowerB) {\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tfor (int i = upperB; i <= lowerB; i++) {\n\t\t\t\tmatrix[i][rightB] = counter++;\n\t\t\t}\n\t\t\trightB--;\n\t\t\tif (leftB > rightB || upperB > lowerB) {\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tfor (int j = rightB; j >= leftB; j--) {\n\t\t\t\tmatrix[lowerB][j] = counter++;\n\t\t\t}\n\t\t\tlowerB--;\n\t\t\tif (leftB > rightB || upperB > lowerB) {\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tfor (int i = lowerB; i >= upperB; i--) {\n\t\t\t\tmatrix[i][leftB] = counter++;\n\t\t\t}\n\t\t\tleftB++;\n\t\t\tif (leftB > rightB || upperB > lowerB) {\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t\treturn matrix;\n\t }", "static int sockMerchant(int n, int[] ar) {\n int count = 0;\n for (int i = 0; i < ar.length; i++) {\n if (ar[i] == 0) {\n continue;\n }\n for (int j = i + 1; j < ar.length; j++) {\n if (ar[j] == 0) {\n continue;\n }\n if (ar[i] == ar[j]) {\n ar[i] = 0;\n ar[j] = 0;\n count++;\n }\n }\n }\n return count;\n }", "static int fact1(int n)\n {\n if(n == 0 || n == 1)\n return 1;\n return n * fact1(n-1);\n }", "private boolean outOfBounds(long n) {\n return n < 0 || n >= getSize();\n }", "public static int firstMissingPositiveChain(int[] nums) {\n int n = nums.length;\n for(int i=0;i<n;i++){\n int cur = nums[i];\n while(cur>0 && cur <= n && nums[cur-1]!=cur){\n int next = nums[cur-1];\n nums[cur-1] = cur;\n cur = next;\n }\n }\n for(int i=0;i<n;i++){\n if(i+1!=nums[i])\n return i+1;\n }\n return n+1;\n }", "private static int[] p1(int[] ar, int n) {\n int[] p1 = new int[n];\n Arrays.fill(p1, -1);\n Stack<Integer> st = new Stack<>();\n for (int i = 0; i < n; i++) {\n while (st.size() != 0 && ar[i] <= ar[st.peek()]) {\n st.pop();\n }\n if (st.size() != 0) {\n p1[i] = st.peek();\n }\n st.push(i);\n }\n return p1;\n }", "public int numSquaresii(int n) {\n int[] result = new int[n + 1];\n result[0]=0;\n for(int i=1;i<n+1;i++){\n int minSquare=Integer.MAX_VALUE;\n for(int j=1;j*j<=i;j++){\n minSquare=Math.min(minSquare,result[i-j*j]+1);\n }\n result[i]=minSquare;\n }\n return result[n];\n }", "public boolean isFull() {\n return (rear + 1) % n == head;\n }", "private Integer[][] getBase(int n, int m, int[][] ar) {\n\t\t\tInteger[][] dp = new Integer[n + 1][m + 1];\n\n\t\t\tboolean encounteredObstacle = false;\n\t\t\tfor (int i = 1; i <= n; i++) {\n\t\t\t\tif (ar[i - 1][0] == 1 || encounteredObstacle) {\n\t\t\t\t\tdp[i][1] = 0;\n\t\t\t\t\tencounteredObstacle = true;\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\tdp[i][1] = 1;\n\t\t\t\t}\n\t\t\t}\n\t\t\tencounteredObstacle = false;\n\t\t\tfor (int j = 1; j <= m; j++) {\n\t\t\t\tif (ar[0][j - 1] == 1 || encounteredObstacle) {\n\t\t\t\t\tdp[1][j] = 0;\n\t\t\t\t\tencounteredObstacle = true;\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\tdp[1][j] = 1;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\treturn dp;\n\t\t}", "public static int uniquePaths(int m, int n) {\n\t\tint u = m-1;\n\t\tint r = n-1;\n\t\tdp = new int[u+r+1][r+1];\n\t\tint ans = ncR(u+r,r);\n\t\treturn ans;\n }", "public boolean blankNextToBombCount(int m, int n){\r\n\r\n\t\tif (m+1<12 & n+1<12 & m-1>=0 & n-1>=0){ //Boundary case\r\n\t\t\tif (count[m+1][n]==BLANK || count[m-1][n]==BLANK || count[m][n+1]==BLANK || count[m][n-1]==BLANK || count[m-1][n-1]==BLANK || count[m-1][n+1]==BLANK || count[m+1][n+1]==BLANK || count[m+1][n-1]==BLANK )\r\n\t\t\t\t{\t\r\n\t\t\t\t\treturn true;\r\n\t\t\t\t}\r\n\t\t}\r\n\t\treturn false;\r\n\t}", "private boolean outOfBounds(int nidx1){\n\t\treturn (nidx1 < 0 || nidx1 >= numofvert);\n\t}", "static int[] stones(int n, int a, int b) {\n List<Integer> arr = new ArrayList<>();\n if(a == b){\n arr.add(a*(n-1));\n } else {\n if(a>b){\n int temp = a;\n a = b;\n b = temp;\n } \n for(int i=0; i<n; i++)\n arr.add(i*b+(n-1-i)*a);\n } \n int ar[] = new int[arr.size()];\n for(int i=0; i<arr.size(); i++)\n ar[i] = arr.get(i);\n return ar;\n }" ]
[ "0.58951163", "0.5784699", "0.57280207", "0.5630809", "0.5623601", "0.5618722", "0.5612559", "0.55889565", "0.5507712", "0.5497835", "0.5485132", "0.54670733", "0.5461654", "0.5442922", "0.541435", "0.54120404", "0.540673", "0.53980976", "0.53848255", "0.5384373", "0.5365894", "0.53568816", "0.53445405", "0.5340345", "0.5335373", "0.5334671", "0.5334597", "0.53326553", "0.53298616", "0.53133327", "0.53123593", "0.53094125", "0.5303712", "0.5303712", "0.5283379", "0.5279964", "0.5277496", "0.52765214", "0.5272478", "0.5271809", "0.52682865", "0.5255862", "0.5255718", "0.5250739", "0.5250683", "0.5239995", "0.5238336", "0.52311337", "0.52300787", "0.522908", "0.52222586", "0.5221997", "0.5213824", "0.5208417", "0.52038157", "0.52016985", "0.51995856", "0.5199063", "0.5191274", "0.5189712", "0.5181239", "0.5180088", "0.51782393", "0.51724654", "0.5165825", "0.515799", "0.5144993", "0.5134138", "0.51337105", "0.51334834", "0.51324093", "0.51259583", "0.51244223", "0.5124063", "0.51215756", "0.5121447", "0.5116524", "0.51154727", "0.51147896", "0.5112726", "0.5111788", "0.5111339", "0.51084167", "0.510751", "0.5096947", "0.5094342", "0.509102", "0.5082315", "0.5073874", "0.50716233", "0.50631654", "0.5060666", "0.5058224", "0.50581056", "0.50424", "0.50412846", "0.5038088", "0.503642", "0.503633", "0.5034588", "0.5030414" ]
0.0
-1
Explicit wait: 1.WebDriverWait 2.Fluent Wait a.timeout b.polling period c.ignoringException d.until when to use: For handling ajax components
public static void main(String[] args) { WebDriverManager.chromedriver().setup(); WebDriver driver = new ChromeDriver(); driver.get("https://classic.crmpro.com/"); final By username = By.name("username"); By password = By.name("password"); By loginBtn = By.xpath("//input[@value='Login']"); waitForElementWithFluentWait(driver, username).sendKeys("batchautomation"); driver.findElement(password).sendKeys("Test@12345"); driver.findElement(loginBtn).click(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public interface ExplicitWait extends SearchScope{\n default Element await(Supplier<By> by) {\n return await((SearchScope e) -> e.findElement(by));\n }\n\n default void await(Predicate<SearchScope> predicate) {\n await((Function<SearchScope, Boolean>) predicate::test);\n }\n\n default <T> T await(Function<SearchScope, T> function) {\n return new FluentWait<>(this)\n .withTimeout(1, SECONDS)\n .pollingEvery(10, MILLISECONDS)\n .ignoring(Exception.class)\n .until(\n (SearchScope where) -> function.apply(where)\n );\n }\n\n default String getText(Supplier<By> by) {\n return await(by).getText();\n }\n\n default String getUpperText(Supplier<By> by) {\n return await(by).getText().toUpperCase();\n }\n\n default void click(Supplier<By> by) {\n await(by).click();\n }\n\n default Element untilFound(Supplier<By> by) {\n waitForPageToLoad();\n return new FluentWait<>(this)\n .withTimeout(30, TimeUnit.SECONDS)\n .pollingEvery(5, TimeUnit.MILLISECONDS)\n .ignoring(Exception.class)\n .until((ExplicitWait e) -> e.findElement(by));\n }\n\n default Element untilFound(Supplier<By> by, int duration) {\n waitForPageToLoad();\n return new FluentWait<>(this)\n .withTimeout(duration, TimeUnit.SECONDS)\n .pollingEvery(5, TimeUnit.MILLISECONDS)\n .ignoring(Exception.class)\n .until((ExplicitWait e) -> e.findElement(by));\n }\n\n default Wait<WebDriver> fluentWait() {\n return new FluentWait<>(TestBase.driver())\n .withTimeout(1, TimeUnit.MINUTES)\n .pollingEvery(5, TimeUnit.MILLISECONDS)\n .ignoreAll(new ArrayList<Class<? extends Throwable>>() {\n {\n add(StaleElementReferenceException.class);\n add(NoSuchElementException.class);\n add(TimeoutException.class);\n add(InvalidElementStateException.class);\n add(WebDriverException.class);\n }\n }).withMessage(\"The message you will see in if a TimeoutException is thrown\");\n }\n\n default void waitForPageToLoad() {\n waitForLoaderToComplete();\n waitForAjaxToComplete();\n waitForJavaScriptToComplete();\n }\n\n default void waitForLoaderToComplete() {\n Wait<WebDriver> wait = fluentWait();\n wait.until(loaderHasFinishProcessing());\n }\n\n default void waitForJavaScriptToComplete() {\n Wait<WebDriver> wait = fluentWait();\n wait.until(javaScriptHasFinishProcessing());\n }\n\n default void waitForAjaxToComplete() {\n Wait<WebDriver> wait = fluentWait();\n wait.until(jQuryHasFinishedProcessing());\n }\n\n default void waitForAngularToComplete() {\n Wait<WebDriver> wait = fluentWait();\n wait.until(angularHasFinishedProcessing());\n }\n\n default ExpectedCondition<Boolean> javaScriptHasFinishProcessing() {\n return driver -> (Boolean) ((JavascriptExecutor) driver)\n .executeScript(\"return document.readyState\").equals(\"complete\");\n }\n\n default ExpectedCondition<Boolean> loaderHasFinishProcessing() {\n return driver -> (Boolean) ((JavascriptExecutor) driver)\n .executeScript(\"return (window.show===false) || (window.show===undefined);\");\n }\n\n default ExpectedCondition<Boolean> jQuryHasFinishedProcessing() {\n return driver -> (Boolean) ((JavascriptExecutor) driver)\n .executeScript(\"return (window.jQuery != null) && (jQuery.active === 0);\");\n }\n\n default ExpectedCondition<Boolean> angularHasFinishedProcessing() {\n return driver -> Boolean.valueOf(((JavascriptExecutor) driver)\n .executeScript(\"return (window.angular !== undefined) &&\" +\n \" (angular.element(document).injector() !== undefined) &&\" +\n \" (angular.element(document).injector().get('$http')\" +\n \".pendingRequests.length === 0)\").toString());\n }\n}", "public void waitForEndOfAllAjaxes(){\r\n\t\tLOGGER.info(Utilities.getCurrentThreadId()\r\n\t\t\t\t+ \" Wait for the page to load...\");\r\n\t\tWebDriverWait wait = new WebDriverWait(driver,Integer.parseInt(Configurations.TEST_PROPERTIES.get(ELEMENTSEARCHTIMEOUT)));\r\n\t\twait.until(new ExpectedCondition<Boolean>() {\r\n\t\t\t@Override\r\n\t\t\tpublic Boolean apply(WebDriver driver) {\r\n\t\t\t\t//\t\t\t\treturn (Boolean)((JavascriptExecutor)driver).executeScript(\"return jQuery.active == 0\");\r\n\t\t\t\treturn ((JavascriptExecutor)driver).executeScript(\"return document.readyState\").equals(\"complete\");\r\n\t\t\t\t//\t\t\t\t return Boolean.valueOf(((JavascriptExecutor) driver).executeScript(\"return (window.angular !== undefined) && (angular.element(document).injector() !== undefined) && (angular.element(document).injector().get('$http').pendingRequests.length === 0)\").toString());\r\n\r\n\t\t\t}\r\n\t\t});\r\n\r\n\t}", "public static ExpectedCondition<WebElement> explicitWaitForElement(final By by) throws WebDriverException {\n uiBlockerTest(\"\", \"\");\n \treturn new ExpectedCondition<WebElement>() {\n public WebElement apply(WebDriver driver) {\n WebElement element = driver.findElement(by);\n return element.isDisplayed()?element:null;\n }\n };\n }", "@Test\n public void implicitWait(){\n //3. https://the-internet.herokuapp.com/dynamic_controls adresine gidin.\n driver.get(\"https://the-internet.herokuapp.com/dynamic_controls\");\n //4. Remove butonuna basin.\n WebElement removeButton = driver.findElement(By.xpath(\"//button[@type='button']\"));\n removeButton.click();\n //mesajin yuklenmesi biraz zaman aldigi icin wait kullanmamiz gerekir.\n driver.manage().timeouts().implicitlyWait(10, TimeUnit.SECONDS);// ==>>> TestBase'e de koyabilirim\n //5. “It’s gone!” mesajinin goruntulendigini dogrulayin.\n WebElement goneMessage = driver.findElement(By.id(\"message\"));\n Assert.assertEquals(goneMessage.getText(),\"It's gone!\");\n }", "public void handlingWaitToElement(By locator){\n WebDriverWait wait = new WebDriverWait(appiumDriver, 60);\n wait.until(ExpectedConditions.presenceOfElementLocated(locator));\n }", "private WebDriverWait WebDriverWait(WebDriver driver, int i) {\n\t\treturn null;\r\n\t}", "public void implicitWait(){\r\n\t\tdriver.manage().timeouts().implicitlyWait(Integer.parseInt(FilesAndFolders.getPropValue(\"implicitWaitTime\")), TimeUnit.SECONDS);\r\n\t}", "public void waitForPageToLoad() {\n Wait<WebDriver> wait = new WebDriverWait(WebDriverManager.getDriver(), 90);\n wait.until(new Function<WebDriver, Boolean>() {\n public Boolean apply(WebDriver driver) {\n return String\n .valueOf(((JavascriptExecutor) driver).executeScript(\"return document.readyState\"))\n .equals(\"complete\");\n }\n });\n try {\n wait.until(ExpectedConditions.invisibilityOfElementLocated(By.id(\"waitMessage_div\")));\n wait.until(ExpectedConditions.invisibilityOfElementLocated(By.xpath(\"//div[contains(text(),'Loading')]\")));\n // waitForPageToLoad();\n } catch (Exception e) {\n e.printStackTrace();\n }\n }", "@Test\n public void implicitWait() {\n //We have implicit wait in out testbase class, we driver will automatically use implicit wait whenever we use driver\n driver.get(\"https://the-internet.herokuapp.com/dynamic_controls\");\n WebElement removeButton = driver.findElement(By.xpath(\"//button[@type='button']\"));\n removeButton.click();\n WebElement goneMessage = driver.findElement(By.id(\"message\"));\n String expectedMessage = \"It's gone!\";\n Assert.assertEquals(goneMessage.getText(), expectedMessage);\n }", "protected WebDriverWait wfExpected(){\n return (WebDriverWait) ApplicationContextProvider.getApplicationContext().getBean(webDriverWait, SessionContext.getSession().getWebDriver(),SessionContext.getSession().getWaitUntil());\n }", "public static void setWaitSelenium() throws InterruptedException {\n WebDriverManager.chromedriver().setup();\n WebDriver driver = new ChromeDriver();\n driver.get(\"https://google.com\");\n\n WebElement input = driver.findElement(By.xpath(\"//input[@name=\\\"q\\\"]\"));\n input.sendKeys(\"Abcd\");\n Thread.sleep(10000);\n driver.findElement(By.name(\"btnK\")).click();\n //driver.findElement(By.name(\"btnK\")).sendKeys(Keys.RETURN);\n\n // Fluent wait\n // Waiting 30s for an element to be present on the page,\n // for its presence once every 2s\n Wait<WebDriver> wait = new FluentWait<WebDriver>(driver)\n .withTimeout(60, TimeUnit.SECONDS)\n .pollingEvery(2, TimeUnit.SECONDS)\n .ignoring(NoSuchElementException.class);\n\n WebElement clickseleniumlink = wait.until(new Function<WebDriver, WebElement>(){\n\n public WebElement apply(WebDriver driver ) {\n WebElement link = driver.findElement(By.xpath(\"/html[1]/body[1]/div[7]/div[3]/div[10]/div[1]/div[2]/div[1]/div[2]/div[2]/div[1]/div[1]/div[5]/div[1]/div[1]/div[1]/div[1]/div[1]/a[1]\"));\n if(link.isEnabled()){\n System.out.println(\"Element found\");\n }\n return link;\n }\n });\n //click on the selenium link\n clickseleniumlink.click();\n\n driver.close();\n driver.quit();\n }", "public static WebDriverWait getWait(){\n WebDriverWait wait = new WebDriverWait(driver,Constants.EXPLICIT_WAIT);\n return wait;\n }", "@Test\n public void EmplicitWaitTest() {\n\n Driver.getDriver().get(\"https://the-internet.herokuapp.com/dynamic_controls\");\n\n //click on enable\n Driver.getDriver().findElement(By.xpath(\"//form[@id='input-example']//button\")).click();\n\n\n // this is a class used to emplicit wait\n WebDriverWait wait = new WebDriverWait(Driver.getDriver(), 10);//creating object\n //this is when wait happens\n // we are waiting for certain element this xpath is clicable\n wait.until(//waiting\n ExpectedConditions.elementToBeClickable(//to click\n By.xpath(\"//input[@type='text']\")));//clicking by the xpath\n\n\n\n //eneter text\n\n Driver.getDriver().findElement(By.xpath(\"//input[@type='text']\")).sendKeys(\"Hello World\");\n\n\n }", "@Override\n protected void waitThePageToLoad() {\n WaitUtils.waitUntil(driver, ExpectedConditions.visibilityOf(driver\n .findElement(By.xpath(SEARCH_XPATH))));\n }", "public void waitLoadPage() {\n WebDriverHelper.waitUntil(inputTeamName);\n }", "public void waitUntilPageLoad(WebDriver driver) \n\t{\n\t\tdriver.manage().timeouts().implicitlyWait(20, TimeUnit.SECONDS);\n\t}", "protected void waitThePageToLoad() {\n ExpectedCondition pageLoadCondition = new ExpectedCondition<Boolean>() {\n public Boolean apply(WebDriver driver) {\n return ((JavascriptExecutor) driver).executeScript(\"return document.readyState\").equals(\"complete\");\n }\n };\n WaitUtils.waitUntil(driver, pageLoadCondition);\n }", "protected WebElement waitForExpectedElement(final By by) {\n return wait.until(visibilityOfElementLocated(by));\n }", "private void waitForElementToBeLoad(String string) {\n\t\n}", "public void waitForLoad() {\n\tExpectedCondition<Boolean> pageLoadCondition = new ExpectedCondition<Boolean>()\r\n\t { \r\n public Boolean apply(WebDriver driver) \r\n {\r\n\t return ((JavascriptExecutor)driver).executeScript(\"return document.readyState\").equals(\"complete\");\r\n\t\t }\r\n\t\t };\r\n\t// a\r\n\t\t if((new WebDriverWait(driver, 0.1).until(PageLoadCondition))==false){\r\n\t\t \t \t\r\n\t\t \t//Takesscreenshot is a java class - screenshot code\r\n\t\t \tTakesScreenshot scrShot=((TakesScreenshot)driver);\r\n\t\t \tFile SrcFile=scrShot.getScreenshotAs(OutputType.FILE);\r\n\t\t \tFile DestFile=new File(fileWithPath);\r\n\t\t \tFileUtils.copyFile(SrcFile, DestFile);\r\n\t\t \tSyso(\"page failed to load in 0.1 sec, refer screenshot saved in ___\");\r\n\t\t }\r\n\t\t// b \r\n\t\t if ((new WebDriverWait(driver, 5).until(PageLoadCondition))==true)){\r\n\t\t System.out.println(\"page loaded in 5 sec\");\t\r\n\t\t }\r\n\t}", "public void waitForPageToLoad(WebDriver driver)\n\t{\n\t\tConfigProperties config = new ConfigProperties();\n\t\t\n\t\t/* Set the implicit wait to zero */\n\t\tdriver.manage().timeouts().implicitlyWait(0, TimeUnit.SECONDS);\n\t\t\n\t\t/* Wait for header to be updated */\n\t\tWebDriverWait wait = new WebDriverWait(driver, Long.parseLong(config.getConfigProperties().getProperty(\"TIMEOUT\")));\n\t\twait.until(ExpectedConditions.visibilityOfAllElementsLocatedBy(headerLocator));\n\t\twait.until(ExpectedConditions.elementToBeClickable(headerLocator));\n\t\twait.until(ExpectedConditions.visibilityOfAllElementsLocatedBy(editGroupButtonLocator));\n\t\twait.until(ExpectedConditions.elementToBeClickable(editGroupButtonLocator));\n\t\twait.until(ExpectedConditions.elementToBeClickable(overviewTabLocator));\n\t\twait.until(ExpectedConditions.elementToBeClickable(membersTabLocator));\n\t\twait.until(ExpectedConditions.elementToBeClickable(resourcesTabLocator));\n\t\twait.until(ExpectedConditions.elementToBeClickable(discussionsTabLocator));\n//\t\twait.until(ExpectedConditions.visibilityOfAllElementsLocatedBy(followLinkLocator));\n//\t\twait.until(ExpectedConditions.elementToBeClickable(followLinkLocator));\n//\t\twait.until(ExpectedConditions.visibilityOfAllElementsLocatedBy(leaveLinkLocator));\n//\t\twait.until(ExpectedConditions.elementToBeClickable(leaveLinkLocator));\n\t\t\n\t\t/* Reset the implicit wait */\n\t\tdriver.manage().timeouts().implicitlyWait(Long.parseLong(config.getConfigProperties().getProperty(\"TIMEOUT\")), TimeUnit.SECONDS);\n\t}", "public static void waitForPageLoad() {\n\n\t\tif (!WebController.driver.getCurrentUrl().contains(\"uhc.com/dashboard\") && !WebController.driver.getCurrentUrl().contains(\"myuhc.com/member/\") && !WebController.driver.getCurrentUrl().contains(\"=securityQuestion\")) {\n\t\t\tWaitForLoadingOverlay();\n\t\t}\n\n\t\tJavascriptExecutor js = null;\n\t\tfor (int i = 0; i < AppConfiguration.getWaitTime(); i++) {\n\n\t\t\ttry {\n\t\t\t\tThread.sleep(1000);\n\t\t\t} catch (InterruptedException e) {\n\t\t\t\te.printStackTrace();\n\t\t\t}\n\n\t\t\tjs = (JavascriptExecutor) WebController.driver;\n\t\t\tif (js.executeScript(\"return document.readyState\").toString().equals(\"complete\"))\n\t\t\t\tbreak;\n\n\t\t}\n\t}", "public static void WebDriverExplicitWait(WebDriver driver, int timeoutInSeconds, String by, String locator) {\r\n\t\tWebDriverWait wait = new WebDriverWait(driver, timeoutInSeconds);\r\n\t\tif (by.equalsIgnoreCase(\"id\"))\r\n\t\t\twait.until(ExpectedConditions.visibilityOfElementLocated(By.id(locator)));\r\n\t\tif (by.equalsIgnoreCase(\"name\"))\r\n\t\t\twait.until(ExpectedConditions.visibilityOfElementLocated(By.name(locator)));\r\n\t\tif (by.equalsIgnoreCase(\"tagName\"))\r\n\t\t\twait.until(ExpectedConditions.visibilityOfElementLocated(By.tagName(locator)));\r\n\t\tif (by.equalsIgnoreCase(\"className\"))\r\n\t\t\twait.until(ExpectedConditions.visibilityOfElementLocated(By.className(locator)));\r\n\t\tif (by.equalsIgnoreCase(\"linkText\"))\r\n\t\t\twait.until(ExpectedConditions.visibilityOfElementLocated(By.linkText(locator)));\r\n\t\tif (by.equalsIgnoreCase(\"partialLinkText\"))\r\n\t\t\twait.until(ExpectedConditions.visibilityOfElementLocated(By.partialLinkText(locator)));\r\n\t\tif (by.equalsIgnoreCase(\"cssSelector\"))\r\n\t\t\twait.until(ExpectedConditions.visibilityOfElementLocated(By.cssSelector(locator)));\r\n\t\tif (by.equalsIgnoreCase(\"xpath\"))\r\n\t\t\twait.until(ExpectedConditions.visibilityOfElementLocated(By.xpath(locator)));\r\n\t}", "public void waitForElement(WebElement element) {\n WebDriverWait wait = new WebDriverWait(driver, 30);\n wait.until(ExpectedConditions.visibilityOf(element));\n }", "private void waitForElement(WebDriver driver, int timeToWaitInSeconds, By ElementLocater) {\n\t\tWebDriverWait wait = new WebDriverWait(driver, timeToWaitInSeconds);\n\t\twait.until(ExpectedConditions.visibilityOfAllElementsLocatedBy(ElementLocater));\n\n\t}", "public void implicitTime() {\n\n try {\n driver.manage().timeouts().implicitlyWait(30, TimeUnit.SECONDS);\n } catch (Exception e) {\n // TODO Auto-generated catch block\n e.printStackTrace();\n }\n }", "public void waitForElementPresent(By locator){\n \tWebDriverWait wait=new WebDriverWait(driver,20);\n \twait.until(ExpectedConditions.presenceOfElementLocated(locator));\n }", "public void waitForElementsPresent(By by,int time){\n WebDriverWait wait = new WebDriverWait(driver,time);\n wait.until(ExpectedConditions.presenceOfElementLocated(by));\n }", "protected void waitFor(Function waitConditions) {\n new WebDriverWait(webDriver, waitingTime).until(waitConditions);\n }", "public WebElement wait(WebElement webElement) {\n WebDriverWait webDriverWait = new WebDriverWait(driver, Integer.parseInt(testData.timeout));\n return webDriverWait.until(ExpectedConditions.visibilityOf(webElement));\n }", "public void waitForPageToLoad(){\r\n\t\t\t\tDriver.driver.manage().timeouts().implicitlyWait(20, TimeUnit.SECONDS);\r\n\t\t\t}", "public void waitForPageToLoad(WebDriver driver)\n {\n ExpectedCondition < Boolean > pageLoad = new\n ExpectedCondition<Boolean>() {\n public Boolean apply(WebDriver driver)\n {\n return ((JavascriptExecutor) driver)\n .executeScript(\"return document.readyState\").equals(\"complete\");\n }\n };\n Wait< WebDriver > wait = new WebDriverWait(driver, 60, DEFAULT_SLEEP_IN_MILLIS);\n try\n {\n wait.until(pageLoad);\n }\n catch (TimeoutException pageLoadWaitError)\n {\n System.out.println(\"Timeout during page load:\" + pageLoadWaitError.toString());\n }\n }", "@Test\n\t public void UnconditionExplicitWait() {\n\t WebDriverWait wait = new WebDriverWait(driver, 10);\n\t wait.until(ExpectedConditions.visibilityOfElementLocated(\n\t\t \t\tBy.name(\"userName\")));\n\t\t driver.findElement(By.name(\"userName\")).sendKeys(\"mercury\");\n\t\t driver.findElement(By.name(\"password\")).sendKeys(\"1\");\n\t\t driver.findElement(By.name(\"login\")).click();\n\t\t String expected = \"Sign-on: Mercury Tours\";\n\t\t String actual = driver.getTitle();\n\t\t Assert.assertEquals(actual, expected);\n\t\t \n\t\t /*Different Expected Conditions for Explicit Wait\n\t\t elementToBeClickable() \n\t\t textToBePresentInElement()\n\t\t alertIsPresent()\n\t\t titleIs()\n\t\t frameToBeAvailableAndSwitchToIt()*/\n\t }", "public Boolean waitUntilElementAppears(WebDriver driver, final String xpath) throws NumberFormatException, IOException {\n\t\t\t\t\tlong start = System.currentTimeMillis();\n\t\t\t\t\tWebDriverWait wait = new WebDriverWait(driver, 30);\n\t\t\t\t\ttry {\n\t\t\t\t\tExpectedCondition<Boolean> e = new ExpectedCondition<Boolean>() {\n\t\t\t\t public Boolean apply(WebDriver driver) {\t\t\t\t \t\n\t\t\t\t return (driver.findElements(By.xpath(xpath)).size() == 0);\n\t\t\t\t }\n\t\t\t\t };\n\t\t\t\t wait.until(e);}\n\t\t\t\t\tcatch(Exception e) {\n\t\t\t\t\tif (driver.findElements(By.xpath(xpath)).size() == 0) { fileWriterPrinter(\"\\nElement not found!\\nXPATH: \" + xpath); }\n\t\t\t\t\t}\n\t\t\t\t fileWriterPrinter(\"Waiting time for Element appearence: \" + waitTimeConroller(start, 30, xpath) + \" sec\");\n\t\t\t\t return (driver.findElements(By.xpath(xpath)).size() == 0);\n\t\t\t\t}", "public void waitUntilElement(WebDriver driver, final String xpath) throws NumberFormatException, IOException {\n\t\t\t\t\tlong start = System.currentTimeMillis();\n\t\t\t\t\tWebDriverWait wait = new WebDriverWait(driver, 30);\n\t\t\t\t\ttry {\n\t\t\t\t\tExpectedCondition<Boolean> e = new ExpectedCondition<Boolean>() {\n\t\t\t\t public Boolean apply(WebDriver driver) {\n\t\t\t\t return (driver.findElements(By.xpath(xpath)).size() > 0);\n\t\t\t\t }\n\t\t\t\t };\n\t\t\t\t wait.until(e);}\n\t\t\t\t\tcatch(Exception e) {\n\t\t\t\t\tif (driver.findElements(By.xpath(xpath)).size() == 0) { fileWriterPrinter(\"\\nElement not found!\\nXPATH: \" + xpath); }\n\t\t\t\t\t}\n\t\t\t\t fileWriterPrinter(\"Waiting time for Element: \" + waitTimeConroller(start, 30, xpath) + \" sec\\n\");\n\t\t\t\t}", "public WebElement waitFor(By by, int index)\n\t{\n\t\tTimer elemTimer = new Timer(ELEMENT_WAIT);\n\t\twhile(elemTimer.stillWaiting())\n\t\t{\n\t\t\ttry\n\t\t\t{\n\t\t\t\tList<WebElement> elems = findElements(by);\n\t\t\t\tif(elems.size() > index) //can see enough elements\n\t\t\t\t{\n\t\t\t\t\tif(elems.get(index).isDisplayed() && elems.get(index).isEnabled())\n\t\t\t\t\t{\n\t\t\t\t\t\treturn elems.get(index);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\tcatch(ElementNotVisibleException | NoSuchElementException | StaleElementReferenceException e)\n\t\t\t{\n\n\t\t\t}\n\t\t\tcatch(UnhandledAlertException e)\n\t\t\t{\n\t\t\t\ttry\n\t\t\t\t{\n\t\t\t\t\tswitchTo().alert().dismiss();\n\t\t\t\t}\n\t\t\t\tcatch(NoAlertPresentException a) //Really don't know\n\t\t\t\t{}\n\t\t\t}\n\t\t\tMacro.sleep(300);\n\t\t}\n\t\treturn null;\n\t}", "@Test\n public void explicitWait() {\n WebDriverWait wait = new WebDriverWait(driver, 10);\n driver.get(\"https://the-internet.herokuapp.com/dynamic_controls\");\n WebElement removeButton = driver.findElement(By.xpath(\"//button[@type='button']\"));\n removeButton.click();\n //WebElement goneMessage=driver.findElement(By.id(\"message\"));\n WebElement goneMessage = wait.until(ExpectedConditions.visibilityOfElementLocated(By.id(\"message\")));\n String expectedMessage = \"It's gone!\";\n Assert.assertEquals(goneMessage.getText(), expectedMessage);\n\n }", "protected abstract void beforeWait();", "public void waitUntilLoadingDoesNotExistAndVerifyContainerDisplayed(){\n\t\tverifyContainerDisplayedResultsPage();\r\n\t}", "public static void waitForPageLoad(WebDriver driver) {\n\t \n\t // wait for Javascript to load\n\t \n\t try {\n\t\t\t(new WebDriverWait(driver, jsciptLoadTime)).until(new ExpectedCondition<Boolean>() {\n\t\t\t public Boolean apply(WebDriver d) {\n\t\t\t JavascriptExecutor js = (JavascriptExecutor) d;\n\t\t\t String javascriptsreadyState = js.executeScript(\"return document.readyState\").toString();\t\t\t \n\t\t\t return (Boolean) javascriptsreadyState.equals(\"complete\");\n\t\t\t }\n\t\t\t});\n\t\t\t\n\t\t\t// wait for jQuery to load\n\t\t\t(new WebDriverWait(driver, jQueryLoadTime)).until(new ExpectedCondition<Boolean>() {\n\t\t\t public Boolean apply(WebDriver d) {\n\t\t\t JavascriptExecutor js = (JavascriptExecutor) d;\n\t\t\t String jqueryLoad = js.executeScript(\"return window.jQuery != undefined && jQuery.active === 0\").toString();\t\t\t \n\t\t\t return (Boolean) jqueryLoad.equals(\"true\");\n\t\t\t }\n\t\t\t});\n\t\t} catch (TimeoutException e) {\n\t\t\t// TODO Auto-generated catch block\n\t\t\te.getMessage();\n\n\t\t}\n\t}", "public void waitForInvisibilityOfWebElement(By locator){\r\n\t\twait.until(ExpectedConditions.invisibilityOfElementLocated(locator));\r\n\t}", "public static void wait_for_element(By locator) throws CheetahException {\n\t\ttry {\n\t\t\tCheetahEngine.logger.logMessage(null, \"SeleniumActions\", \"Locator: \" + locator, Constants.LOG_INFO, false);\n\t\t\tWebDriverWait wait = new WebDriverWait(CheetahEngine.getDriverInstance(), Constants.GLOBAL_TIMEOUT);\n\t\t\tfluent_wait(locator);\n\t\t\twait.until(ExpectedConditions.visibilityOfElementLocated(locator));\n\t\t} catch (Exception e) {\n\t\t\tthrow new CheetahException(e);\n\t\t}\n\t}", "public WebElement waitForElement(By by) {\n List<WebElement> elements = waitForElements(by);\n int size = elements.size();\n\n if (size == 0) {\n Assertions.fail(String.format(\"Could not find %s after %d attempts\",\n by.toString(),\n configuration.getRetries()));\n } else {\n // If an element is found then scroll to it.\n scrollTo(elements.get(0));\n }\n\n if (size > 1) {\n Logger.error(\"WARN: There are more than 1 %s 's!\", by.toString());\n }\n\n return getDriver().findElement(by);\n }", "private void waitForNextNews(final WebDriver webDriver) {\r\n\t\tfinal WebDriverWait wait = new WebDriverWait(webDriver, WAIT_SECONDS);\r\n\t\twait.until(\r\n\t\t\tExpectedConditions.elementToBeClickable(By.className(\"tbutton\"))\r\n\t\t);\r\n\t}", "public static void implicateWait(AndroidDriver driver) {\n\t\tdriver.manage().timeouts().implicitlyWait(10,TimeUnit.SECONDS);\n\t\t\n\t}", "public static List<WebElement> explictWaitForElementList(final String object) {\n \t\n \t\t \n Wait<WebDriver> wait = new FluentWait<WebDriver>(driver).withTimeout(explicitwaitTime, TimeUnit.SECONDS).pollingEvery(pollingTime, TimeUnit.MILLISECONDS).ignoring(NoSuchElementException.class);\n uiBlockerTest(\"\", \"\");\n \n try {\n List<WebElement> elements = wait.until(new Function<WebDriver, List<WebElement>>() {\n\n @Override\n public List<WebElement> apply(WebDriver driver) {\n\n List<WebElement> listElements=driver.findElements(By.xpath(OR.getProperty(object)));\n return listElements.size()>0 ?listElements:null; // Modified By Karan\n }\n });\n return elements;\n }\n \t\n catch(TimeoutException e)\n { \n \treturn Collections.emptyList();\n }\n }", "public void Wait_ExplictWait() {\r\n\tSystem.setProperty(\"webdriver.chrome.driver\",\"C:\\\\chromedriver.exe\");\r\n\t WebDriver driver=new ChromeDriver(); \r\n\t \r\n\t\t\tdriver.manage().timeouts().implicitlyWait(10, TimeUnit.SECONDS);\r\n\t \t\t\tdriver.get(\"https://contentstack.built.io\");\r\n\t \t\t\t\r\n\t \t\t\t\r\n\t\t\t\t\t\tWebDriverWait wait=new WebDriverWait(driver, 15);\r\n\t\t\t\t\r\n\t\t\t\t\t\tdriver.findElement(By.id(\"email\")).sendKeys(\"kannan\");\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\tWebElement link;\r\n\t\t\t\t\t\tlink= wait.until(ExpectedConditions.visibilityOfElementLocated(By.linkText(\"kForgot password?\")));\r\n\t\t\t\t\t\tlink.click();\r\n driver.quit();\r\n}", "public void waitForElementVisibility(String locator) {\n \t WebDriverWait wait = new WebDriverWait(driver, 10);\n \t wait.until(ExpectedConditions.visibilityOfElementLocated(autoLocator(locator)));\n }", "public static void waitForElement(WebDriver driver, WebElement element) throws Exception {\n\t\tWebDriverWait wait = new WebDriverWait(driver, 80);\n\t\twait.until(ExpectedConditions.visibilityOf(element));\n\t\tThread.sleep(1000);\n\t}", "void waitForAddStatusIsDisplayed() {\n\t\tSeleniumUtility.waitElementToBeVisible(driver, homepageVehiclePlanning.buttonTagAddStatusHomepageVehiclePlanning);\n\t}", "public void waitForElemnetXpathPresent(String xpath){\r\n\t\t\t\tWebDriverWait wait = new WebDriverWait(Driver.driver,20);\r\n\t\t\t\twait.until(ExpectedConditions.presenceOfAllElementsLocatedBy(By.xpath(xpath)));\r\n\t\t\t}", "public boolean waitforelement(int timeout,By by){\n\t\twhile(timeout>0){\n\t\t\tsleep(1);\n\t\t\tList<WebElement> list = driver.findElements(by);\n\t\t\tif(list.size()!=0){\n\t\t\t\treturn true;\n\t\t\t}\n\t\t\ttimeout--;\n\t\t}\n\t\tSystem.out.println(\"waiting timeout.... Element not found \" +by.toString());\n\t\treturn false;\n\t}", "public static void waitUntilDocumentIsReady(WebDriver driver) throws InterruptedException {\r\n\r\n for (int i = 0; i < 30; i++) { \r\n // To check page ready state.\r\n if (getJavascriptExecutor(driver).executeScript(\"return document.readyState\").toString()\r\n .equals(\"complete\")) {\r\n break;\r\n }\r\n else {\r\n Thread.sleep(1000);\r\n }\r\n }\r\n }", "public void waitForPageLoaded() {\r\n\r\n\t\tExpectedCondition<Boolean> expectation = new ExpectedCondition<Boolean>() {\r\n\t\t\tpublic Boolean apply(WebDriver driver) {\r\n\t\t\t\treturn ((JavascriptExecutor) driver).executeScript(\"return document.readyState\").equals(\"complete\");\r\n\t\t\t}\r\n\t\t};\r\n\t\tWait<WebDriver> wait = new WebDriverWait(driver, timeout);\r\n\t\twait.until(expectation);\r\n\t}", "public static void waitForJS(WebDriver driver) {\n\t\tnew WebDriverWait(driver, 5).until(new Function<WebDriver, Boolean>() {\n\t\t\tpublic Boolean apply(WebDriver driver) {\n\treturn ((Long)((JavascriptExecutor)driver).executeScript(\"return jQuery.active\") == 0);\n}\n});\n\t}", "public static void fluentWaitPredicate()\n\t{\n\t\t\n\t\t//Locating an element by polling the dom frequently with timeout wait also given \n\t\t\n\t\t//So as a first step ,give the timeout wait,polling seconds ,exception name \n\t FluentWait<WebDriver> fluentwait = new FluentWait<WebDriver>(driver);\n\t fluentwait.withTimeout(5000, TimeUnit.MILLISECONDS);\n\t fluentwait.pollingEvery(250, TimeUnit.MILLISECONDS);\n\t //fluentwait.withTimeout(2, TimeUnit.MINUTES);\n\t fluentwait.ignoring(NoSuchElementException.class);\n\t\t\n\t \n\t //Declaring function with \n\t //WebDriver as input ,WebElement as output\n\t FluentWait<WebDriver> wait = new FluentWait<WebDriver>(driver);\n\t\twait.pollingEvery(250, TimeUnit.MILLISECONDS);\n\t\twait.withTimeout(2, TimeUnit.MINUTES);\n\t\twait.ignoring(NoSuchElementException.class); //make sure that this exception is ignored\n \n\t\tPredicate<WebDriver> predicate = new Predicate<WebDriver>()\n\t\t\t\t{\n \n\t\t\t\t\tpublic boolean apply(WebDriver arg0) \n\t\t\t\t\t{\n\t\t\t\t\t\tWebElement element = arg0.findElement(By.id(\"colorVar\"));\n\t\t\t\t\t\tString color = element.getAttribute(\"color\");\n\t\t\t\t\t\tSystem.out.println(\"The color if the button is \" + color);\n\t\t\t\t\t\tif(color.equals(\"red\"))\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\treturn true;\n\t\t\t\t\t\t}\n\t\t\t\t\t\treturn false;\n\t\t\t\t\t}\n\t\t\t\t};\n\t\t \n\t}", "public static WebElement FindAndWaitForElement(WebDriver driver, final By by)\n\t\t\tthrows Exception {\n\n\t\tWebElement element = null;\n\t\tWebDriverWait wait = null;\n\t\tint timeOut = 0;\n\t\ttry {\n\t\t\ttimeOut = Integer.parseInt(Cls_Generic_methods.getConfigValues(\"timeOutInSeconds\"));\n\t\t\twait = new WebDriverWait(driver, timeOut, 10);\n\t\t\telement = wait.until(new Function<WebDriver, WebElement>() {\n\t\t\t\tpublic WebElement apply(WebDriver driver) {\n\t\t\t\t\treturn driver.findElement(by);\n\t\t\t\t}\n\t\t\t});\n\t\t} catch (Exception e) {\n\t\t\telement = retryingFindElement(driver, by);\n\t\t}\n\t\treturn element;\n\n\t}", "public boolean explixitWait(WebDriver driver, String xpath) \r\n\t{\r\n\t\tWebDriverWait wait = new WebDriverWait(driver, Constants.WEB_DRIVER_WAIT);\r\n\t\t\r\n\t\ttry \r\n\t\t{\r\n\t\t\twait.until(ExpectedConditions.visibilityOfElementLocated(By.xpath(getValue(xpath))));\r\n\t\t\twait.until(ExpectedConditions.elementToBeClickable(By.xpath(getValue(xpath))));\r\n\t\t} \r\n\t\tcatch (Exception e) \r\n\t\t{\r\n\t\t\treturn false;\r\n\t\t}\r\n\t\treturn true;\r\n\t}", "public static boolean waitForElementToStale(WebDriver driver,\n\t\t\tint iTimeOutInSeconds, By by) throws NumberFormatException,\n\t\t\tIOException {\n\t\tboolean isStale = true;\n\t\tint iAttempt = 0;\n\t\ttry {\n\t\t\tiTimeOutInSeconds = iTimeOutInSeconds * 20;\n\t\t\twhile (isStale && iTimeOutInSeconds > 0) {\n\t\t\t\tiAttempt++;\n\t\t\t\tlogger.info(\"Waiting for Element to Statle Attempt Number :\"\n\t\t\t\t\t\t+ iAttempt);\n\t\t\t\tdriver.manage().timeouts()\n\t\t\t\t.implicitlyWait(100, TimeUnit.MILLISECONDS);\n\t\t\t\tlogger.info(\"Element :\" + driver.findElement(by).isDisplayed());\n\t\t\t\tif (driver.findElements(by).size() == 0) {\n\t\t\t\t\tisStale = false;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tThread.sleep(30l);\n\t\t\t\tiTimeOutInSeconds--;\n\t\t\t}\n\t\t} catch (NoSuchElementException e) {\n\t\t\tlogger.error(\"No Element Found.This Means Loader is no more in HTML. Moving out of waitForElementToStale!!!\");\n\t\t\tisStale = false;\n\t\t} catch (StaleElementReferenceException s) {\n\t\t\tlogger.error(\"Given Element is stale from DOM Moving out of waitForElementToStale!!!\");\n\t\t\tisStale = false;\n\t\t} catch (Exception e) {\n\t\t\tlogger.error(\"Some Exception ocurred Please check code!!!\");\n\t\t} finally {\n\t\t\tdriver.manage()\n\t\t\t.timeouts()\n\t\t\t.implicitlyWait(\n\t\t\t\t\tInteger.parseInt(getConfigValues(\"ImplicitWait\")),\n\t\t\t\t\tTimeUnit.SECONDS);\n\t\t}\n\t\treturn isStale;\n\t}", "public List<WebElement> waitUntilElementList(WebDriver driver, final String xpath) throws NumberFormatException, IOException, InterruptedException {\n\t\t\t\t\tlong start = System.currentTimeMillis();\n\t\t\t\t\tif (driver.findElements(By.xpath(xpath)).size() == 0) {\n\t\t\t\t\tWebDriverWait wait = new WebDriverWait(driver, 30);\t\t\t\t\t\n\t\t\t\t\ttry { wait.until(ExpectedConditions.presenceOfElementLocated(By.xpath(xpath))); }\n\t\t\t\t\tcatch(Exception e) {\n\t\t\t\t\tif (driver.findElements(By.xpath(xpath)).size() == 0) { fileWriterPrinter(\"\\nList of Elements is empty!\\nXPATH: \" + xpath); }\n\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t fileWriterPrinter(\"Waiting time for List of Elements:\" + padSpace(54 - \"Waiting time for List of Elements:\".length()) + waitTimeConroller(start, 30, xpath) + \" sec\");\n\t\t\t\t return (driver.findElements(By.xpath(xpath)));\n\t\t\t\t}", "public static WebElement waitUntilPresenceOfElementLocated(By by) {\n WebDriverWait webDriverWait = getWebDriverWait();\n return webDriverWait.until(ExpectedConditions.presenceOfElementLocated(by));\n }", "public void waitForElementVisibility(WebDriver driver, WebElement element)\n\t\t{\n\t\t\tWebDriverWait wait = new WebDriverWait(driver,20);\n\t\t\twait.until(ExpectedConditions.visibilityOf(element));\n\t\t}", "private static ExpectedCondition<WebElement> waitForElementToBeDisplayed(final WebElement we) \n\t{\n\t\treturn new ExpectedCondition<WebElement>() \n\t\t\t\t{\n\t\t\t\t\t/**\n\t\t\t\t\t * This method will retrieve the element.\n\t\t\t\t\t * \n\t\t\t\t\t * @param driver The driver to set.\n\t\t\t\t\t * @return Returns the webelement.\n\t\t\t\t\t */\n\t\t\t\t\tpublic WebElement apply(WebDriver driver) \n\t\t\t\t\t{\n\t\t\t\t\t\tif(we.isDisplayed()){\n\n\t\t\t\t\t\t\treturn we;\n\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\treturn null;\n\n\t\t\t\t\t}\n\t\t\t\t};\n\t}", "public static void waitTillProgressBarLoad(String eleName, AndroidDriver driver, String pageName, int seconds)\n\t\t\tthrows IOException {\n\t\ttry {\n\t\t\tlogger.info(\"---------Method waiting for invisibility of progress bar ---------\");\n\t\t\tWait<AndroidDriver> wait = new FluentWait<AndroidDriver>(driver).withTimeout(seconds, TimeUnit.SECONDS)\n\t\t\t\t\t.pollingEvery(250, TimeUnit.MICROSECONDS).ignoring(NoSuchElementException.class);\n\t\t\tAssert.assertTrue(\n\t\t\t\t\t(wait.until(ExpectedConditions\n\t\t\t\t\t\t\t.invisibilityOfElementLocated(By.id(\"com.stellapps.usb:id/progressBar\")))),\n\t\t\t\t\t\"On clicking\" + eleName + \" Page is on load, Unable to proceed\");\n\t\t\tMyExtentListners.test.pass(\" Verify On clicking \" + \"\\'\" + eleName + \"\\''\" + \" user is redirected to \"\n\t\t\t\t\t+ \"\\'\" + pageName + \"\\''\" + \" || On clicking \" + \"\\'\" + eleName + \"\\''\"\n\t\t\t\t\t+ \" user is redirected to \" + \"\\'\" + pageName + \"\\''\");\n\t\t} catch (AssertionError e) {\n\t\t\tMyExtentListners.test.fail(MarkupHelper.createLabel(\" Verify On clicking \" + \"\\'\" + eleName + \"\\''\"\n\t\t\t\t\t+ \" user is redirected to \" + \"\\'\" + pageName + \"\\''\" + \" || On clicking \" + \"\\'\" + eleName\n\t\t\t\t\t+ \"\\''\" + \" user is not redirected to \" + \"\\'\" + pageName + \"\\''\", ExtentColor.RED));\n\n\t\t\tMyExtentListners.test.addScreenCaptureFromPath(capture(driver, eleName));\n\t\t\tAssert.fail(\"On clicking \" + \"\\'\" + eleName + \"\\''\" + \", Page is on load, Unable to proceed\");\n\t\t\tthrow e;\n\t\t} catch (Exception e) {\n\t\t\tMyExtentListners.test.fail(MarkupHelper.createLabel(\" Verify On clicking \" + \"\\'\" + eleName + \"\\''\"\n\t\t\t\t\t+ \" user is redirected to \" + \"\\'\" + pageName + \"\\''\" + \" || On clicking \" + \"\\'\" + eleName\n\t\t\t\t\t+ \"\\''\" + \" user is not redirected to \" + \"\\'\" + pageName + \"\\''\", ExtentColor.RED));\n\n\t\t\tMyExtentListners.test.addScreenCaptureFromPath(capture(driver, eleName));\n\t\t\tAssert.fail(\"On clicking \" + \"\\'\" + eleName + \"\\''\" + \", Page is on load, Unable to proceed\");\n\t\t\tthrow e;\n\t\t}\n\t}", "public static void waitForElementVisiblity(WebElement element) {\n\t\t\t\n\t\t}", "public void waitTillObjectAppears(By locator) {\n\t\ttry {\n\t\t\tWebDriverWait wait = new WebDriverWait(driver, TIMEOUT_S);\n\t\t\twait.until(ExpectedConditions.visibilityOfElementLocated(locator));\n\t\t} catch (TimeoutException e) {\n\t\t\t// TODO Auto-generated catch block\n\t\t\te.printStackTrace();\n\t\t}\n\t}", "public WebCommonMethods(WebDriver driver){\r\n\t\tthis.driver=driver;\r\n\t\twait = new WebDriverWait(driver, Integer.parseInt(FilesAndFolders.getPropValue(\"explicitWaitTime\")));\r\n\t}", "public void waitForContentLoad() {\n // TODO implement generic method to wait until page content is loaded\n\n // wait.until(...);\n // ...\n }", "public void waitForNotDisplayed(final By by)\n {\n waitForNotDisplayed(by, DEFAULT_TIMEOUT);\n }", "public static void awaitFor (By by, int timer)\n\t{\n\t\tawait ().\n\t\t\t\tatMost (timer, SECONDS).\n\t\t\t\tpollDelay (1, SECONDS).\n\t\t\t\tpollInterval (1, SECONDS).\n\t\t\t\tignoreExceptions ().\n\t\t\t\tuntilAsserted (() -> assertThat (getDriver ().findElement (by).isDisplayed ()).\n\t\t\t\t\t\tas (\"Wait for Web Element to be displayed.\").\n\t\t\t\t\t\tisEqualTo (true));\n\t}", "public void waitForAlertDisplay()\n {\n new WebDriverWait(driver,\n DEFAULT_TIMEOUT, 5000).ignoring(StaleElementReferenceException.class).ignoring(\n WebDriverException.class).\n until(ExpectedConditions.alertIsPresent());\n }", "public void waitForVisibility(By by,int time){\n WebDriverWait wait = new WebDriverWait(driver, time);\n wait.until(ExpectedConditions.visibilityOfElementLocated(by));\n }", "public static void waitForPageToLoad(WebDriver driver) throws InterruptedException\n\t{\n\t\t\n\t\tThread.sleep(2000);\n\t\t//waitPageLoad.until(executeJavaScript(\"return document.readyState;\", \"complete\"));\n\t}", "public static WebElement explictWaitForElementUsingFluent(final String object) {\n Wait<WebDriver> wait = new FluentWait<WebDriver>(driver).withTimeout(explicitwaitTime, TimeUnit.SECONDS).pollingEvery(pollingTime, TimeUnit.MILLISECONDS).ignoring(NoSuchElementException.class);\n uiBlockerTest(\"\", \"\");\t\n WebElement ele = wait.until(new Function<WebDriver, WebElement>() {\n\n @Override\n public WebElement apply(WebDriver driver) {\n\n return driver.findElement(By.xpath(OR.getProperty(object)));\n }\n\n });\n return ele;\n }", "public static List<WebElement> waitForListElementsPresent(WebDriver driver,\n\t\t\tfinal By by)\n\t\t\t{\n\t\tList<WebElement> elements;\n\t\tint timeOutInSeconds=Integer.parseInt(Cls_Generic_methods.getConfigValues(\"timeOutInSeconds\"));\n\t\ttry {\n\n\t\t\tlogger.info(\"Waiting for List of Elements to be present\");\n\t\t\tWebDriverWait wait = new WebDriverWait(driver, timeOutInSeconds);\n\t\t\twait.until((new ExpectedCondition<Boolean>() {\n\t\t\t\tpublic Boolean apply(WebDriver driverObject) {\n\t\t\t\t\treturn areElementsPresent(driverObject, by);\n\t\t\t\t}\n\t\t\t}));\n\n\t\t\telements = driver.findElements(by);\n\n\t\t\treturn elements; // return the element\n\t\t} catch (Exception e) {\n\t\t\tlogger.error(\"Exception ocurred \" + e.getMessage());\n\t\t}\n\t\treturn null;\n\t\t\t}", "public static Boolean WaitUntilDocumentIsReady(){\n\t\t \n\t\t WebDriverWait wait = new WebDriverWait(driver, 30);\n\t\t \n\t\t ExpectedCondition<Boolean> pageLoad = new ExpectedCondition<Boolean>() \n\t\t {\n\t\t public Boolean apply(WebDriver Wdriver)\n\t\t {\n\t\t \t JavascriptExecutor js1 = (JavascriptExecutor) driver;\n\t\t \t try {\n\t\t \t\t return js1.executeScript(\"return document.readyState\").equals(\"complete\");\n\t\t\t\t }\n\t\t\t\t\t \n\t\t\t\t catch (Exception e) \n\t\t \t {\n\t\t\t\t return false;\n\t\t\t\t }\n\t\t\t\t }\n\t\t\t\t };\n \t\t\t \t return wait.until(pageLoad);\n\t\t\t}", "public void waitForVisibilityOfElement(WebElement element) {\n\t\twait = new WebDriverWait(driver, 10);\n\t\twait.until(ExpectedConditions.visibilityOf(element));\n\t}", "public static void waitTillPageLoad(String eleName, AndroidDriver driver, String pageName, int seconds)\n\t\t\tthrows IOException {\n\t\ttry {\n\t\t\tlogger.info(\"---------Method waiting for invisibility of progress bar ---------\");\n\t\t\tWait<AndroidDriver> wait = new FluentWait<AndroidDriver>(driver).withTimeout(seconds, TimeUnit.MINUTES)\n\t\t\t\t\t.pollingEvery(250, TimeUnit.MICROSECONDS).ignoring(NoSuchElementException.class);\n\t\t\tAssert.assertTrue(\n\t\t\t\t\t(wait.until(ExpectedConditions\n\t\t\t\t\t\t\t.invisibilityOfElementLocated(By.className(\"android.widget.ProgressBar\")))),\n\t\t\t\t\t\"On clicking\" + eleName + \" Page is on load, Unable to proceed\");\n\t\t\tMyExtentListners.test.pass(\" Verify On clicking \" + \"\\'\" + eleName + \"\\''\" + \" user is redirected to \"\n\t\t\t\t\t+ \"\\'\" + pageName + \"\\''\" + \" || On clicking \" + \"\\'\" + eleName + \"\\''\"\n\t\t\t\t\t+ \" user is redirected to \" + \"\\'\" + pageName + \"\\''\");\n\t\t} catch (AssertionError e) {\n\t\t\tMyExtentListners.test.fail(MarkupHelper.createLabel(\" Verify On clicking \" + \"\\'\" + eleName + \"\\''\"\n\t\t\t\t\t+ \" user is redirected to \" + \"\\'\" + pageName + \"\\''\" + \" || On clicking \" + \"\\'\" + eleName\n\t\t\t\t\t+ \"\\''\" + \" user is not redirected to \" + \"\\'\" + pageName + \"\\''\", ExtentColor.RED));\n\n\t\t\tMyExtentListners.test.addScreenCaptureFromPath(capture(driver, eleName));\n\t\t\tAssert.fail(\"On clicking \" + \"\\'\" + eleName + \"\\''\" + \", Page is on load, Unable to proceed\");\n\t\t\tthrow e;\n\t\t} catch (Exception e) {\n\t\t\tMyExtentListners.test.fail(MarkupHelper.createLabel(\" Verify On clicking \" + \"\\'\" + eleName + \"\\''\"\n\t\t\t\t\t+ \" user is redirected to \" + \"\\'\" + pageName + \"\\''\" + \" || On clicking \" + \"\\'\" + eleName\n\t\t\t\t\t+ \"\\''\" + \" user is not redirected to \" + \"\\'\" + pageName + \"\\''\", ExtentColor.RED));\n\n\t\t\tMyExtentListners.test.addScreenCaptureFromPath(capture(driver, eleName));\n\t\t\tAssert.fail(\"On clicking \" + \"\\'\" + eleName + \"\\''\" + \", Page is on load, Unable to proceed\");\n\t\t\tthrow e;\n\t\t}\n\t}", "private void webDriverTimeout(){\n try {\n Thread.sleep(TIMEOUT_SHORT);\n } catch (InterruptedException e){\n e.printStackTrace();\n }\n }", "public static Alert explicitWaitForAlert() {\n\n Wait<WebDriver> wait = new FluentWait<WebDriver>(driver).withTimeout(explicitwaitTime, TimeUnit.SECONDS)\n .pollingEvery(pollingTime, TimeUnit.MILLISECONDS).ignoring(Exception.class);\n\n Alert alert = wait.until(new Function<WebDriver, Alert>() {\n\n @Override\n public Alert apply(WebDriver driver) {\n\n return driver.switchTo().alert();\n }\n });\n\n return alert;\n\n }", "public static void explicitWaitTillVisible(WebDriver driver, int sec, WebElement element) {\r\n\r\n\t\tWebDriverWait wait = new WebDriverWait(driver, sec);\r\n\t\twait.until(ExpectedConditions.visibilityOf(element));\r\n\t}", "@BeforeTest\n public void setUp() {\n// WebDriverWait wait =new WebDriverWait(driver, 10, 10);\n }", "protected void aguardaElemento(Function<WebDriver, ?> expect) {\n\t\tCapabilities.getWait().until(ExpectedConditions.refreshed((ExpectedCondition<?>) expect));\n\t}", "public static void waitforStaleElement(WebElement element) {\n\t\tWebDriverWait wait = new WebDriverWait(driver, 30);\n\t\twait.until(ExpectedConditions.refreshed(ExpectedConditions.stalenessOf(element)));\n\n\t}", "public void waitForElement(WebElement element) {\r\n\t\ttry {\r\n\t\t\tWebDriverWait wait = new WebDriverWait(driver, timeout);\r\n\t\t\twait.until(ExpectedConditions.elementToBeClickable(element));\r\n\t\t} catch (Exception e) {\r\n\t\t\tlogger.info(element.toString() + \" is not present on page or not clickable\");\r\n\t\t}\r\n\r\n\t}", "public void waitForPresenceOfElementToBeLocated(By locator){\r\n\t\twait.until(ExpectedConditions.presenceOfElementLocated(locator));\r\n\t}", "void waitUntilDaysDropdownElementIsVisible() {\n\t\tSeleniumUtility.waitElementToBeVisible(driver, homepageVehiclePlanning.divTagSelectDaysHomepageVehiclePlanning(\"7\"));\n\t}", "public static void awaitUntilPageIsLoaded (WebDriver webDriver, int timer)\n\t{\n\t\tawait ().\n\t\t\t\tatMost (timer, SECONDS).\n\t\t\t\tpollDelay (5, SECONDS).\n\t\t\t\tpollInterval (1, SECONDS).\n\t\t\t\tignoreExceptions ().\n\t\t\t\tuntilAsserted (() -> assertThat (((JavascriptExecutor) webDriver).executeScript (\"return document.readyState\").toString ()).\n\t\t\t\t\t\tas (\"Wait for the web Page to be rendered and loaded completely.\").\n\t\t\t\t\t\tisEqualTo (\"complete\"));\n\t}", "public void waitMainArtifactElementsOnPage() {\n for (String mainArtifactLink : mainArtifactLinks) {\n new WebDriverWait(driver, 10).until(ExpectedConditions.visibilityOfElementLocated(By.partialLinkText(mainArtifactLink)));\n }\n\n }", "public String waitForElementVisibility(String object, String data) {\n logger.debug(\"Waiting for an element to be visible\");\n int start = 0;\n int time = (int) Double.parseDouble(data);\n try {\n while (true) {\n if(start!=time)\n {\n if (driver.findElements(By.xpath(OR.getProperty(object))).size() == 0) {\n Thread.sleep(1000L);\n start++;\n }\n else {\n break; }\n }else {\n break; } \n }\n } catch (Exception e) {\n return Constants.KEYWORD_FAIL + \"Unable to close browser. Check if its open\" + e.getMessage();\n }\n return Constants.KEYWORD_PASS;\n }", "protected void clickThenWait(By target, By staleElement) {\n \tint waitTime = 10;\n \tWebElement element = new WebDriverWait(DRIVER, waitTime)\n \t.until(ExpectedConditions.elementToBeClickable(target));\n\n \t element.click();\n \t new WebDriverWait(DRIVER, waitTime)\n \t .until(ExpectedConditions.invisibilityOfElementLocated(staleElement));\n }", "private WebElement delayedFindElement(By by, int attempt) {\n try {\n return super.findElement(by);\n } catch (NoSuchElementException e) {\n if (attempt >= MAX_ATTEMPTS) {\n throw e;\n }\n try {\n Thread.sleep(attempt * SLEEP_TIME);\n } catch (InterruptedException ie) {\n throw new RuntimeException(\"Could not sleep thread\", ie);\n }\n return this.delayedFindElement(by, attempt + 1);\n }\n }", "private void waitForDialogLoadingBackdropToFade( ) {\r\n\t\t\r\n\t\t/* --- Let's wait for 10 seconds, until the temporary overlay dialog disappears. - */\r\n\t\tWait.invisibilityOfElementLocated (driver, this.overlayDialogRefresher1Locator, 15 );\r\n\t\tWait.invisibilityOfElementLocated (driver, this.overlayDialogRefresher2Locator, 15 );\r\n\t}", "protected void waitForVisibilityOf(By locator, Integer... timeOutInSeconds) {\n int attempts = 0;\n while (attempts < 2) {\n try {\n waitFor(ExpectedConditions.visibilityOfElementLocated(locator),\n timeOutInSeconds.length > 0 ? timeOutInSeconds[0] : null);\n break;\n } catch (StaleElementReferenceException e) {\n log.error(e.toString());\n }\n attempts++;\n }\n }", "protected WebElement waitForElementToBeVisible(WebElement element) {\n actionDriver.moveToElement(element);\n WebDriverWait wait = new WebDriverWait(driver, 5);\n wait.until(ExpectedConditions.visibilityOf(element));\n return element;\n }", "public WebElement waitForElement(By locator) {\n\t\tif(driver == null){\n\t\t\tthrow new IllegalArgumentException(\"WebDriver cannot be null\");\n\t\t}\n\t\treturn waitForElement(locator,explicitWait());\n\t}", "public static WebElement fluentWaitTest(final String spath)\n\t{\n\t\t// Create object of FluentWait class and pass WebDriver as input\n\t\t \n FluentWait<WebDriver> wait = new FluentWait<WebDriver>(driver);\n wait.pollingEvery(1, TimeUnit.SECONDS);\n log.info(\"Polling the DOM for the target WebElement\");\n wait.withTimeout(1, TimeUnit.MINUTES);\n wait.ignoring(NoSuchElementException.class);\n\n // Function :Input as WebDriver and output as WebElement\n WebElement element = wait.until(new Function<WebDriver, WebElement>() //This Function returns a WebElement \n {\n // apply method- WebDriver as input\n public WebElement apply(WebDriver arg0) //We are defining the function taking the WebDriver as input \n {\n WebElement ele = arg0.findElement(By.xpath(spath));\n return ele;\n }\n\n }\n );\n\n //If element is found then it will display the status\n System.out.println(\"Final visible status is >>>>> \" + element.isDisplayed());\n return element;\n\n }", "private void waitforvisibleelement(WebDriver driver2, WebElement signoutimg2) {\n\t\r\n}", "public void waitForPageToLoad() {\n\t\ttry {\n\t\t\twait.until(new ExpectedCondition<Boolean>() {\n\t\t\t\tpublic Boolean apply(WebDriver wd) {\n\t\t\t\t\treturn isPageLoaded(verificationPoints());\n\t\t\t\t}\n\t\t\t});\n\t\t} \n\t\tcatch (TimeoutException timeOutException) {\n\t\t\tthrow new AssertionError(this.getClass().getSimpleName() + \" is not verified. Missing \" + returnMissingElements(verificationPoints()));\n\t\t}\n\t}", "public void waitForElement(String locator) {\n wait.until(ExpectedConditions.presenceOfElementLocated(By.xpath(locator)));\n }", "public WebDriverWait getWebDriverWait(){\n\t\treturn oWebDriverWait;\n\t}" ]
[ "0.73477423", "0.7241103", "0.67322934", "0.66321236", "0.6623632", "0.6596959", "0.65848637", "0.658377", "0.65359247", "0.65115786", "0.64975554", "0.6471354", "0.64681476", "0.64674085", "0.6464844", "0.6428357", "0.6419869", "0.64030164", "0.6375431", "0.63473666", "0.6342321", "0.63224804", "0.6298164", "0.6290642", "0.62654227", "0.6258614", "0.6255271", "0.6233157", "0.62108684", "0.6183104", "0.617181", "0.6164723", "0.60974723", "0.6092591", "0.6085715", "0.608557", "0.6072772", "0.6069409", "0.6054487", "0.6046579", "0.60314757", "0.60151684", "0.60127145", "0.60027856", "0.5989467", "0.59894246", "0.59791285", "0.5954807", "0.5945887", "0.5940959", "0.59267515", "0.59237665", "0.59217197", "0.59160763", "0.5914242", "0.5913313", "0.59031785", "0.5902574", "0.58976936", "0.5894366", "0.5892735", "0.58913064", "0.58845454", "0.5883807", "0.58760256", "0.5873192", "0.58677", "0.58638376", "0.5856314", "0.58472073", "0.58412683", "0.5830425", "0.58225435", "0.5817284", "0.5794871", "0.57919294", "0.5781846", "0.57737136", "0.5764514", "0.5758303", "0.5752372", "0.5751011", "0.5746916", "0.57322425", "0.5732181", "0.5723084", "0.5705635", "0.56865597", "0.5681362", "0.56795484", "0.5672669", "0.5672111", "0.5650923", "0.5647251", "0.56433797", "0.56416595", "0.56385124", "0.56355", "0.5630767", "0.5626064", "0.5622456" ]
0.0
-1
EtherScan API Descriptions <a href="
public interface AccountAPI { /** * Address ETH balance * * @param address get balance for * @return balance * @throws EtherScanException parent exception class */ @NotNull Balance balance(@NotNull String address) throws EtherScanException; /** * ERC20 token balance for address * * @param address get balance for * @param contract token contract * @return token balance for address * @throws EtherScanException parent exception class */ @NotNull TokenBalance balance(@NotNull String address, @NotNull String contract) throws EtherScanException; /** * Maximum 20 address for single batch request If address MORE THAN 20, then there will be more than * 1 request performed * * @param addresses addresses to get balances for * @return list of balances * @throws EtherScanException parent exception class */ @NotNull List<Balance> balances(@NotNull List<String> addresses) throws EtherScanException; /** * All txs for given address * * @param address get txs for * @param startBlock tx from this blockNumber * @param endBlock tx to this blockNumber * @return txs for address * @throws EtherScanException parent exception class */ @NotNull List<Tx> txs(@NotNull String address, long startBlock, long endBlock) throws EtherScanException; @NotNull List<Tx> txs(@NotNull String address, long startBlock) throws EtherScanException; @NotNull List<Tx> txs(@NotNull String address) throws EtherScanException; /** * All internal txs for given address * * @param address get txs for * @param startBlock tx from this blockNumber * @param endBlock tx to this blockNumber * @return txs for address * @throws EtherScanException parent exception class */ @NotNull List<TxInternal> txsInternal(@NotNull String address, long startBlock, long endBlock) throws EtherScanException; @NotNull List<TxInternal> txsInternal(@NotNull String address, long startBlock) throws EtherScanException; @NotNull List<TxInternal> txsInternal(@NotNull String address) throws EtherScanException; /** * All internal tx for given transaction hash * * @param txhash transaction hash * @return internal txs list * @throws EtherScanException parent exception class */ @NotNull List<TxInternal> txsInternalByHash(@NotNull String txhash) throws EtherScanException; /** * All ERC-20 token txs for given address * * @param address get txs for * @param startBlock tx from this blockNumber * @param endBlock tx to this blockNumber * @return txs for address * @throws EtherScanException parent exception class */ @NotNull List<TxErc20> txsErc20(@NotNull String address, long startBlock, long endBlock) throws EtherScanException; @NotNull List<TxErc20> txsErc20(@NotNull String address, long startBlock) throws EtherScanException; @NotNull List<TxErc20> txsErc20(@NotNull String address) throws EtherScanException; /** * All ERC-20 token txs for given address and contract address * * @param address get txs for * @param contractAddress contract address to get txs for * @param startBlock tx from this blockNumber * @param endBlock tx to this blockNumber * @return txs for address * @throws EtherScanException parent exception class */ @NotNull List<TxErc20> txsErc20(@NotNull String address, @NotNull String contractAddress, long startBlock, long endBlock) throws EtherScanException; @NotNull List<TxErc20> txsErc20(@NotNull String address, @NotNull String contractAddress, long startBlock) throws EtherScanException; @NotNull List<TxErc20> txsErc20(@NotNull String address, @NotNull String contractAddress) throws EtherScanException; /** * All ERC-721 (NFT) token txs for given address * * @param address get txs for * @param startBlock tx from this blockNumber * @param endBlock tx to this blockNumber * @return txs for address * @throws EtherScanException parent exception class */ @NotNull List<TxErc721> txsErc721(@NotNull String address, long startBlock, long endBlock) throws EtherScanException; @NotNull List<TxErc721> txsErc721(@NotNull String address, long startBlock) throws EtherScanException; @NotNull List<TxErc721> txsErc721(@NotNull String address) throws EtherScanException; /** * All ERC-721 (NFT) token txs for given address * * @param address get txs for * @param startBlock tx from this blockNumber * @param endBlock tx to this blockNumber * @return txs for address * @throws EtherScanException parent exception class */ @NotNull List<TxErc721> txsErc721(@NotNull String address, @NotNull String contractAddress, long startBlock, long endBlock) throws EtherScanException; @NotNull List<TxErc721> txsErc721(@NotNull String address, @NotNull String contractAddress, long startBlock) throws EtherScanException; @NotNull List<TxErc721> txsErc721(@NotNull String address, @NotNull String contractAddress) throws EtherScanException; /** * All ERC-721 (NFT) token txs for given address * * @param address get txs for * @param startBlock tx from this blockNumber * @param endBlock tx to this blockNumber * @return txs for address * @throws EtherScanException parent exception class */ @NotNull List<TxErc1155> txsErc1155(@NotNull String address, long startBlock, long endBlock) throws EtherScanException; @NotNull List<TxErc1155> txsErc1155(@NotNull String address, long startBlock) throws EtherScanException; @NotNull List<TxErc1155> txsErc1155(@NotNull String address) throws EtherScanException; /** * All ERC-721 (NFT) token txs for given address * * @param address get txs for * @param startBlock tx from this blockNumber * @param endBlock tx to this blockNumber * @return txs for address * @throws EtherScanException parent exception class */ @NotNull List<TxErc1155> txsErc1155(@NotNull String address, @NotNull String contractAddress, long startBlock, long endBlock) throws EtherScanException; @NotNull List<TxErc1155> txsErc1155(@NotNull String address, @NotNull String contractAddress, long startBlock) throws EtherScanException; @NotNull List<TxErc1155> txsErc1155(@NotNull String address, @NotNull String contractAddress) throws EtherScanException; /** * All blocks mined by address * * @param address address to search for * @return blocks mined * @throws EtherScanException parent exception class */ @NotNull List<Block> blocksMined(@NotNull String address) throws EtherScanException; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void renderDetails(Output out, Link link) throws IOException;", "public URL getHtmlDescription();", "String getDescribe();", "String getDescribe();", "java.lang.String getDescribe();", "@Override\n\t\tpublic String toString() {\n\t\t\treturn \"下载链接:\"+showLink;\n\t\t}", "public URL getInfoURL() throws MalformedURLException{\n\t\treturn new URL(\"http://www.opensha.org/glossary-attenuationRelation-SHAKE_MAP_2003\");\n\t}", "String getSlingDescription();", "java.lang.String getDesc();", "String getDesc();", "java.lang.String getDescription();", "java.lang.String getDescription();", "java.lang.String getDescription();", "java.lang.String getDescription();", "java.lang.String getDescription();", "java.lang.String getDescription();", "java.lang.String getDescription();", "java.lang.String getDescription();", "java.lang.String getDescription();", "String getDisplay_description();", "@Override\n public String getDescription() {\n return \"Digital goods listing\";\n }", "public void describe() {\n\t\tSystem.out.println(\"这是汽车底盘\");\n\t}", "public static void shoInfo() {\n\t\tSystem.out.println(description);\n\t \n\t}", "String description();", "String description();", "String description();", "String description();", "String description();", "String description();", "String description();", "String description();", "String description();", "String description();", "String description();", "String description();", "public String description() {\r\n return \"Controls any on/off-thing via the ARNE bus\";\r\n }", "@Override\r\n public String toString() {\r\n return String.format(\"%s\",\r\n description);\r\n }", "public String getDescription ();", "@Override\n public final String toString()\n {\n StringBuilder sb = new StringBuilder(64);\n appendDesc(sb);\n return sb.toString();\n }", "@Override\n public String getServletInfo() {\n return \"Short description one\";\n }", "@Override\r\n public String getServletInfo() {\r\n return \"Short description\";\r\n }", "@Override\r\n public String getServletInfo()\r\n {\r\n return \"Short description\";\r\n }", "String getDescription();", "String getDescription();", "String getDescription();", "String getDescription();", "String getDescription();", "String getDescription();", "String getDescription();", "String getDescription();", "String getDescription();", "String getDescription();", "String getDescription();", "String getDescription();", "String getDescription();", "String getDescription();", "String getDescription();", "String getDescription();", "String getDescription();", "String getDescription();", "String getDescription();", "String getDescription();", "String getDescription();", "String getDescription();", "String getDescription();", "String getDescription();", "String getDescription();", "String getDescription();", "String getDescription();", "String getDescription();", "String getDescription();", "String getDescription();", "String getDescription();", "String getDescription();", "String getDescription();", "String getDescription();", "String getDescription();", "String getDescription();", "String getDescription();", "String getDescription();", "@Override\r\n\tpublic String toString()\r\n\t{\n\t\treturn this.id +\" \" +\" \" + this.host +\" \" + this.url +\" flag = \"+this.flag +\" type=\"+this.type + \" lastCrawled = \" +this.lastCrawled;\r\n\t}", "public String getHtmlDescription() {\n\t\treturn \"http://prom.win.tue.nl/research/wiki/online/redesign\";\n\t}", "public String getDescription();", "public String getDescription();", "public String getDescription();", "public String getDescription();", "public String getDescription();", "public String getDescription();", "public String getDescription();", "public String getDescription();", "public String getDescription();", "public String getDescription();", "public String getDescription();", "public String getDescription();", "public String getDescription();", "public String getDescription();", "public String getDescription();", "public String getDescription();", "public String getDescription();", "public String getDescription();", "public String getDescription();" ]
[ "0.6197647", "0.6012329", "0.5949245", "0.5949245", "0.5847086", "0.57751894", "0.5764936", "0.57607836", "0.5665687", "0.5655975", "0.5612792", "0.5612792", "0.5612792", "0.5612792", "0.5612792", "0.5612792", "0.5612792", "0.5612792", "0.5612792", "0.56027865", "0.55870765", "0.5585038", "0.55782604", "0.55773765", "0.55773765", "0.55773765", "0.55773765", "0.55773765", "0.55773765", "0.55773765", "0.55773765", "0.55773765", "0.55773765", "0.55773765", "0.55773765", "0.5576404", "0.5548888", "0.55487406", "0.5544313", "0.55189186", "0.551799", "0.5514099", "0.5505643", "0.5505643", "0.5505643", "0.5505643", "0.5505643", "0.5505643", "0.5505643", "0.5505643", "0.5505643", "0.5505643", "0.5505643", "0.5505643", "0.5505643", "0.5505643", "0.5505643", "0.5505643", "0.5505643", "0.5505643", "0.5505643", "0.5505643", "0.5505643", "0.5505643", "0.5505643", "0.5505643", "0.5505643", "0.5505643", "0.5505643", "0.5505643", "0.5505643", "0.5505643", "0.5505643", "0.5505643", "0.5505643", "0.5505643", "0.5505643", "0.5505643", "0.5505643", "0.5505643", "0.550335", "0.5497895", "0.54954565", "0.54954565", "0.54954565", "0.54954565", "0.54954565", "0.54954565", "0.54954565", "0.54954565", "0.54954565", "0.54954565", "0.54954565", "0.54954565", "0.54954565", "0.54954565", "0.54954565", "0.54954565", "0.54954565", "0.54954565", "0.54954565" ]
0.0
-1
ERC20 token balance for address
@NotNull TokenBalance balance(@NotNull String address, @NotNull String contract) throws EtherScanException;
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "static void printAccountBalance(String address){\n }", "@Test\n public void SameTokenNameCloseInvalidAddress() {\n dbManager.getDynamicPropertiesStore().saveAllowSameTokenName(0);\n InitExchangeBeforeSameTokenNameActive();\n long exchangeId = 1;\n String firstTokenId = \"abc\";\n long firstTokenQuant = 100000000L;\n String secondTokenId = \"def\";\n long secondTokenQuant = 200000000L;\n\n byte[] ownerAddress = ByteArray.fromHexString(OWNER_ADDRESS_FIRST);\n AccountCapsule accountCapsule = dbManager.getAccountStore().get(ownerAddress);\n Map<String, Long> assetMap = accountCapsule.getAssetMap();\n Assert.assertEquals(10000_000000L, accountCapsule.getBalance());\n Assert.assertEquals(null, assetMap.get(firstTokenId));\n Assert.assertEquals(null, assetMap.get(secondTokenId));\n\n ExchangeWithdrawActuator actuator = new ExchangeWithdrawActuator(getContract(\n OWNER_ADDRESS_INVALID, exchangeId, firstTokenId, firstTokenQuant),\n dbManager);\n TransactionResultCapsule ret = new TransactionResultCapsule();\n\n try {\n actuator.validate();\n actuator.execute(ret);\n fail(\"Invalid address\");\n } catch (ContractValidateException e) {\n Assert.assertTrue(e instanceof ContractValidateException);\n Assert.assertEquals(\"Invalid address\", e.getMessage());\n } catch (ContractExeException e) {\n Assert.assertFalse(e instanceof ContractExeException);\n } finally {\n dbManager.getExchangeStore().delete(ByteArray.fromLong(1L));\n dbManager.getExchangeStore().delete(ByteArray.fromLong(2L));\n dbManager.getExchangeV2Store().delete(ByteArray.fromLong(1L));\n dbManager.getExchangeV2Store().delete(ByteArray.fromLong(2L));\n }\n }", "@Test\n public void SameTokenNameOpenInvalidAddress() {\n dbManager.getDynamicPropertiesStore().saveAllowSameTokenName(1);\n InitExchangeSameTokenNameActive();\n long exchangeId = 1;\n String firstTokenId = \"123\";\n long firstTokenQuant = 100000000L;\n String secondTokenId = \"456\";\n long secondTokenQuant = 200000000L;\n\n byte[] ownerAddress = ByteArray.fromHexString(OWNER_ADDRESS_FIRST);\n AccountCapsule accountCapsule = dbManager.getAccountStore().get(ownerAddress);\n Map<String, Long> assetV2Map = accountCapsule.getAssetMapV2();\n Assert.assertEquals(10000_000000L, accountCapsule.getBalance());\n Assert.assertEquals(null, assetV2Map.get(firstTokenId));\n Assert.assertEquals(null, assetV2Map.get(secondTokenId));\n\n ExchangeWithdrawActuator actuator = new ExchangeWithdrawActuator(getContract(\n OWNER_ADDRESS_INVALID, exchangeId, firstTokenId, firstTokenQuant),\n dbManager);\n TransactionResultCapsule ret = new TransactionResultCapsule();\n\n try {\n actuator.validate();\n actuator.execute(ret);\n fail(\"Invalid address\");\n } catch (ContractValidateException e) {\n Assert.assertTrue(e instanceof ContractValidateException);\n Assert.assertEquals(\"Invalid address\", e.getMessage());\n } catch (ContractExeException e) {\n Assert.assertFalse(e instanceof ContractExeException);\n } finally {\n dbManager.getExchangeStore().delete(ByteArray.fromLong(1L));\n dbManager.getExchangeStore().delete(ByteArray.fromLong(2L));\n dbManager.getExchangeV2Store().delete(ByteArray.fromLong(1L));\n dbManager.getExchangeV2Store().delete(ByteArray.fromLong(2L));\n }\n }", "private final void d(com.iqoption.core.microservices.billing.response.deposit.d r21) {\n /*\n r20 = this;\n r0 = r20;\n r1 = r20.asp();\n r1 = r1.cCg;\n r2 = \"binding.depositAmountEdit\";\n kotlin.jvm.internal.i.e(r1, r2);\n if (r21 == 0) goto L_0x0158;\n L_0x000f:\n r2 = r0.cFG;\n r3 = 1;\n if (r2 == 0) goto L_0x0027;\n L_0x0014:\n r2 = r1.getText();\n r2 = r2.toString();\n r4 = r0.cFG;\n r2 = kotlin.jvm.internal.i.y(r2, r4);\n r2 = r2 ^ r3;\n if (r2 == 0) goto L_0x0027;\n L_0x0025:\n goto L_0x0158;\n L_0x0027:\n r2 = r20.ass();\n r4 = 0;\n if (r2 == 0) goto L_0x0068;\n L_0x002e:\n r2 = (java.lang.Iterable) r2;\n r2 = r2.iterator();\n L_0x0034:\n r5 = r2.hasNext();\n if (r5 == 0) goto L_0x0050;\n L_0x003a:\n r5 = r2.next();\n r6 = r5;\n r6 = (com.iqoption.core.features.c.a) r6;\n r6 = r6.getName();\n r7 = r21.getName();\n r6 = kotlin.jvm.internal.i.y(r6, r7);\n if (r6 == 0) goto L_0x0034;\n L_0x004f:\n goto L_0x0051;\n L_0x0050:\n r5 = r4;\n L_0x0051:\n r5 = (com.iqoption.core.features.c.a) r5;\n if (r5 == 0) goto L_0x0068;\n L_0x0055:\n r6 = r5.Xy();\n if (r6 == 0) goto L_0x0068;\n L_0x005b:\n r7 = 0;\n r8 = 0;\n r9 = 1;\n r10 = 0;\n r11 = 0;\n r12 = 19;\n r13 = 0;\n r2 = com.iqoption.core.util.e.a(r6, r7, r8, r9, r10, r11, r12, r13);\n goto L_0x0069;\n L_0x0068:\n r2 = r4;\n L_0x0069:\n r5 = r0.ayL;\n if (r5 == 0) goto L_0x0084;\n L_0x006d:\n r5 = r5.Km();\n if (r5 == 0) goto L_0x0084;\n L_0x0073:\n r5 = r5.aar();\n if (r5 == 0) goto L_0x0084;\n L_0x0079:\n r6 = r21.getName();\n r5 = r5.get(r6);\n r5 = (java.util.ArrayList) r5;\n goto L_0x0085;\n L_0x0084:\n r5 = r4;\n L_0x0085:\n if (r2 != 0) goto L_0x00a5;\n L_0x0087:\n if (r5 == 0) goto L_0x00a5;\n L_0x0089:\n r2 = r20.asr();\n r2 = r2.getItems();\n r2 = kotlin.collections.u.bV(r2);\n r2 = (com.iqoption.deposit.light.d.b) r2;\n if (r2 == 0) goto L_0x00a4;\n L_0x0099:\n r2 = r2.asL();\n if (r2 == 0) goto L_0x00a4;\n L_0x009f:\n r2 = com.iqoption.deposit.f.a(r2);\n goto L_0x00a5;\n L_0x00a4:\n r2 = r4;\n L_0x00a5:\n r6 = r0.cxs;\n r7 = r0.cFE;\n r8 = r4;\n r8 = (java.lang.Double) r8;\n if (r2 != 0) goto L_0x00f4;\n L_0x00ae:\n r9 = r6 instanceof com.iqoption.core.microservices.billing.response.deposit.cashboxitem.d;\n if (r9 == 0) goto L_0x00f4;\n L_0x00b2:\n if (r7 == 0) goto L_0x00f4;\n L_0x00b4:\n r6 = (com.iqoption.core.microservices.billing.response.deposit.cashboxitem.d) r6;\n r6 = r6.aaI();\n if (r6 == 0) goto L_0x00cd;\n L_0x00bc:\n r7 = r7.getName();\n r6 = r6.get(r7);\n r6 = (com.iqoption.core.microservices.billing.response.deposit.cashboxitem.d.b) r6;\n if (r6 == 0) goto L_0x00cd;\n L_0x00c8:\n r6 = r6.OL();\n goto L_0x00ce;\n L_0x00cd:\n r6 = r4;\n L_0x00ce:\n if (r6 == 0) goto L_0x00f5;\n L_0x00d0:\n r7 = r0.f(r6);\n if (r7 != 0) goto L_0x00f5;\n L_0x00d6:\n r8 = r6.doubleValue();\n r10 = 0;\n r11 = 0;\n r12 = 1;\n r13 = 0;\n r14 = 0;\n r15 = 0;\n r16 = 0;\n r2 = java.util.Locale.US;\n r7 = \"Locale.US\";\n kotlin.jvm.internal.i.e(r2, r7);\n r18 = 115; // 0x73 float:1.61E-43 double:5.7E-322;\n r19 = 0;\n r17 = r2;\n r2 = com.iqoption.core.util.e.a(r8, r10, r11, r12, r13, r14, r15, r16, r17, r18, r19);\n goto L_0x00f5;\n L_0x00f4:\n r6 = r8;\n L_0x00f5:\n if (r2 == 0) goto L_0x00f8;\n L_0x00f7:\n goto L_0x00fa;\n L_0x00f8:\n r2 = \"\";\n L_0x00fa:\n r0.cFG = r2;\n r2 = (java.lang.CharSequence) r2;\n r1.setText(r2);\n r1 = r2.length();\n r2 = 0;\n if (r1 != 0) goto L_0x010a;\n L_0x0108:\n r1 = 1;\n goto L_0x010b;\n L_0x010a:\n r1 = 0;\n L_0x010b:\n if (r1 == 0) goto L_0x0155;\n L_0x010d:\n r1 = r0.cxs;\n r7 = r1 instanceof com.iqoption.core.microservices.billing.response.deposit.cashboxitem.d;\n if (r7 != 0) goto L_0x0114;\n L_0x0113:\n r1 = r4;\n L_0x0114:\n r1 = (com.iqoption.core.microservices.billing.response.deposit.cashboxitem.d) r1;\n if (r1 == 0) goto L_0x011e;\n L_0x0118:\n r1 = r1.aaE();\n if (r1 == r3) goto L_0x0155;\n L_0x011e:\n if (r6 == 0) goto L_0x0122;\n L_0x0120:\n r1 = r6;\n goto L_0x0138;\n L_0x0122:\n if (r5 == 0) goto L_0x0137;\n L_0x0124:\n r5 = (java.util.List) r5;\n r1 = kotlin.collections.u.bV(r5);\n r1 = (com.iqoption.core.microservices.billing.response.deposit.e) r1;\n if (r1 == 0) goto L_0x0137;\n L_0x012e:\n r5 = r1.ZC();\n r1 = java.lang.Double.valueOf(r5);\n goto L_0x0138;\n L_0x0137:\n r1 = r4;\n L_0x0138:\n if (r1 == 0) goto L_0x013b;\n L_0x013a:\n goto L_0x0141;\n L_0x013b:\n r5 = 0;\n r1 = java.lang.Double.valueOf(r5);\n L_0x0141:\n r1 = r0.f(r1);\n if (r1 == 0) goto L_0x014b;\n L_0x0147:\n r4 = r1.getErrorMessage();\n L_0x014b:\n if (r1 == 0) goto L_0x0151;\n L_0x014d:\n r2 = r1.aso();\n L_0x0151:\n r0.u(r4, r2);\n goto L_0x0158;\n L_0x0155:\n r0.u(r4, r2);\n L_0x0158:\n return;\n */\n throw new UnsupportedOperationException(\"Method not decompiled: com.iqoption.deposit.light.perform.c.d(com.iqoption.core.microservices.billing.response.deposit.d):void\");\n }", "@NotNull\n List<Balance> balances(@NotNull List<String> addresses) throws EtherScanException;", "double getBalance();", "double getBalance();", "TokenlyBalancesType getType();", "public interface AccountAPI {\n\n /**\n * Address ETH balance\n * \n * @param address get balance for\n * @return balance\n * @throws EtherScanException parent exception class\n */\n @NotNull\n Balance balance(@NotNull String address) throws EtherScanException;\n\n /**\n * ERC20 token balance for address\n * \n * @param address get balance for\n * @param contract token contract\n * @return token balance for address\n * @throws EtherScanException parent exception class\n */\n @NotNull\n TokenBalance balance(@NotNull String address, @NotNull String contract) throws EtherScanException;\n\n /**\n * Maximum 20 address for single batch request If address MORE THAN 20, then there will be more than\n * 1 request performed\n * \n * @param addresses addresses to get balances for\n * @return list of balances\n * @throws EtherScanException parent exception class\n */\n @NotNull\n List<Balance> balances(@NotNull List<String> addresses) throws EtherScanException;\n\n /**\n * All txs for given address\n * \n * @param address get txs for\n * @param startBlock tx from this blockNumber\n * @param endBlock tx to this blockNumber\n * @return txs for address\n * @throws EtherScanException parent exception class\n */\n @NotNull\n List<Tx> txs(@NotNull String address, long startBlock, long endBlock) throws EtherScanException;\n\n @NotNull\n List<Tx> txs(@NotNull String address, long startBlock) throws EtherScanException;\n\n @NotNull\n List<Tx> txs(@NotNull String address) throws EtherScanException;\n\n /**\n * All internal txs for given address\n * \n * @param address get txs for\n * @param startBlock tx from this blockNumber\n * @param endBlock tx to this blockNumber\n * @return txs for address\n * @throws EtherScanException parent exception class\n */\n @NotNull\n List<TxInternal> txsInternal(@NotNull String address, long startBlock, long endBlock) throws EtherScanException;\n\n @NotNull\n List<TxInternal> txsInternal(@NotNull String address, long startBlock) throws EtherScanException;\n\n @NotNull\n List<TxInternal> txsInternal(@NotNull String address) throws EtherScanException;\n\n /**\n * All internal tx for given transaction hash\n * \n * @param txhash transaction hash\n * @return internal txs list\n * @throws EtherScanException parent exception class\n */\n @NotNull\n List<TxInternal> txsInternalByHash(@NotNull String txhash) throws EtherScanException;\n\n /**\n * All ERC-20 token txs for given address\n * \n * @param address get txs for\n * @param startBlock tx from this blockNumber\n * @param endBlock tx to this blockNumber\n * @return txs for address\n * @throws EtherScanException parent exception class\n */\n @NotNull\n List<TxErc20> txsErc20(@NotNull String address, long startBlock, long endBlock) throws EtherScanException;\n\n @NotNull\n List<TxErc20> txsErc20(@NotNull String address, long startBlock) throws EtherScanException;\n\n @NotNull\n List<TxErc20> txsErc20(@NotNull String address) throws EtherScanException;\n\n /**\n * All ERC-20 token txs for given address and contract address\n *\n * @param address get txs for\n * @param contractAddress contract address to get txs for\n * @param startBlock tx from this blockNumber\n * @param endBlock tx to this blockNumber\n * @return txs for address\n * @throws EtherScanException parent exception class\n */\n @NotNull\n List<TxErc20> txsErc20(@NotNull String address, @NotNull String contractAddress, long startBlock, long endBlock)\n throws EtherScanException;\n\n @NotNull\n List<TxErc20> txsErc20(@NotNull String address, @NotNull String contractAddress, long startBlock) throws EtherScanException;\n\n @NotNull\n List<TxErc20> txsErc20(@NotNull String address, @NotNull String contractAddress) throws EtherScanException;\n\n /**\n * All ERC-721 (NFT) token txs for given address\n *\n * @param address get txs for\n * @param startBlock tx from this blockNumber\n * @param endBlock tx to this blockNumber\n * @return txs for address\n * @throws EtherScanException parent exception class\n */\n @NotNull\n List<TxErc721> txsErc721(@NotNull String address, long startBlock, long endBlock) throws EtherScanException;\n\n @NotNull\n List<TxErc721> txsErc721(@NotNull String address, long startBlock) throws EtherScanException;\n\n @NotNull\n List<TxErc721> txsErc721(@NotNull String address) throws EtherScanException;\n\n /**\n * All ERC-721 (NFT) token txs for given address\n *\n * @param address get txs for\n * @param startBlock tx from this blockNumber\n * @param endBlock tx to this blockNumber\n * @return txs for address\n * @throws EtherScanException parent exception class\n */\n @NotNull\n List<TxErc721> txsErc721(@NotNull String address, @NotNull String contractAddress, long startBlock, long endBlock)\n throws EtherScanException;\n\n @NotNull\n List<TxErc721> txsErc721(@NotNull String address, @NotNull String contractAddress, long startBlock) throws EtherScanException;\n\n @NotNull\n List<TxErc721> txsErc721(@NotNull String address, @NotNull String contractAddress) throws EtherScanException;\n\n /**\n * All ERC-721 (NFT) token txs for given address\n *\n * @param address get txs for\n * @param startBlock tx from this blockNumber\n * @param endBlock tx to this blockNumber\n * @return txs for address\n * @throws EtherScanException parent exception class\n */\n @NotNull\n List<TxErc1155> txsErc1155(@NotNull String address, long startBlock, long endBlock) throws EtherScanException;\n\n @NotNull\n List<TxErc1155> txsErc1155(@NotNull String address, long startBlock) throws EtherScanException;\n\n @NotNull\n List<TxErc1155> txsErc1155(@NotNull String address) throws EtherScanException;\n\n /**\n * All ERC-721 (NFT) token txs for given address\n *\n * @param address get txs for\n * @param startBlock tx from this blockNumber\n * @param endBlock tx to this blockNumber\n * @return txs for address\n * @throws EtherScanException parent exception class\n */\n @NotNull\n List<TxErc1155> txsErc1155(@NotNull String address, @NotNull String contractAddress, long startBlock, long endBlock)\n throws EtherScanException;\n\n @NotNull\n List<TxErc1155> txsErc1155(@NotNull String address, @NotNull String contractAddress, long startBlock)\n throws EtherScanException;\n\n @NotNull\n List<TxErc1155> txsErc1155(@NotNull String address, @NotNull String contractAddress) throws EtherScanException;\n\n /**\n * All blocks mined by address\n * \n * @param address address to search for\n * @return blocks mined\n * @throws EtherScanException parent exception class\n */\n @NotNull\n List<Block> blocksMined(@NotNull String address) throws EtherScanException;\n}", "public String getBalanceInfo(String request,String user);", "public AmountOfMoney getCashRegisterBalance(){\n return cashRegister.getBalance();\n }", "@NotNull\n List<TxErc20> txsErc20(@NotNull String address, long startBlock, long endBlock) throws EtherScanException;", "public double getBalance()\n \n {\n \n return balance;\n \n }", "double getBalance(UUID name);", "private void listBalances() {\n\t\t\r\n\t}", "@Override\n\tvoid deposit(double amount) {\n\t\tsuper.balance += amount - 20;\n\t}", "public long getBalance() {\n\t\n\treturn balance;\n}", "void deposit(int value)//To deposit money from the account\n {\n balance += value;\n }", "public Money getTotalBalance();", "@NotNull\n List<TxErc20> txsErc20(@NotNull String address, @NotNull String contractAddress, long startBlock, long endBlock)\n throws EtherScanException;", "void setType(TokenlyBalancesType tokenlyBalancesType);", "public String balance() {\n\t\treturn this.apiCall(\"balance\", \"\", \"\", true);\n\t}", "public void depositAmount() {\n\t\n\t\ttry {\n\t\t\tlog.log(Level.INFO, \"Please Enter the account number you want to deposit: \");\n\t\t\tint depositAccountNumber = scan.nextInt();\n\t\t\tlong amount;\n\t\t\tlog.log(Level.INFO, \"Please Enter the amount you want to Deposit : \");\n\t\t\tamount = scan.nextLong();\n\t\t\tbankop.deposit(depositAccountNumber,amount);\n\t\t\t\n\t\t}catch(AccountDetailsException | BalanceException message ) {\n\t\t\tlog.log(Level.INFO, message.getMessage());\n\t\t}\n\t\t\n\t}", "public BaseJson<String> wallet_new_address() throws Exception {\n String s = main(\"wallet_new_address\", \"[]\");\n return JsonHelper.jsonStr2Obj(s, BaseJson.class);\n }", "@Test\n public void SameTokenNameCloseExchangeBalanceIsNotEnough() {\n dbManager.getDynamicPropertiesStore().saveAllowSameTokenName(0);\n InitExchangeBeforeSameTokenNameActive();\n long exchangeId = 1;\n String firstTokenId = \"abc\";\n long firstTokenQuant = 100_000_001L;\n String secondTokenId = \"def\";\n long secondTokenQuant = 400000000L;\n\n byte[] ownerAddress = ByteArray.fromHexString(OWNER_ADDRESS_FIRST);\n AccountCapsule accountCapsule = dbManager.getAccountStore().get(ownerAddress);\n Map<String, Long> assetMap = accountCapsule.getAssetMap();\n Assert.assertEquals(10000_000000L, accountCapsule.getBalance());\n Assert.assertEquals(null, assetMap.get(firstTokenId));\n Assert.assertEquals(null, assetMap.get(secondTokenId));\n\n ExchangeWithdrawActuator actuator = new ExchangeWithdrawActuator(getContract(\n OWNER_ADDRESS_FIRST, exchangeId, firstTokenId, firstTokenQuant),\n dbManager);\n TransactionResultCapsule ret = new TransactionResultCapsule();\n\n try {\n actuator.validate();\n actuator.execute(ret);\n fail();\n } catch (ContractValidateException e) {\n Assert.assertTrue(e instanceof ContractValidateException);\n Assert.assertEquals(\"exchange balance is not enough\",\n e.getMessage());\n } catch (ContractExeException e) {\n Assert.assertFalse(e instanceof ContractExeException);\n } finally {\n dbManager.getExchangeStore().delete(ByteArray.fromLong(1L));\n dbManager.getExchangeStore().delete(ByteArray.fromLong(2L));\n dbManager.getExchangeV2Store().delete(ByteArray.fromLong(1L));\n dbManager.getExchangeV2Store().delete(ByteArray.fromLong(2L));\n }\n }", "@Test\n public void SameTokenNameOpenExchangeBalanceIsNotEnough() {\n dbManager.getDynamicPropertiesStore().saveAllowSameTokenName(1);\n InitExchangeSameTokenNameActive();\n long exchangeId = 1;\n String firstTokenId = \"123\";\n long firstTokenQuant = 100_000_001L;\n String secondTokenId = \"456\";\n long secondTokenQuant = 400000000L;\n\n byte[] ownerAddress = ByteArray.fromHexString(OWNER_ADDRESS_FIRST);\n AccountCapsule accountCapsule = dbManager.getAccountStore().get(ownerAddress);\n Map<String, Long> assetV2Map = accountCapsule.getAssetMapV2();\n Assert.assertEquals(10000_000000L, accountCapsule.getBalance());\n Assert.assertEquals(null, assetV2Map.get(firstTokenId));\n Assert.assertEquals(null, assetV2Map.get(secondTokenId));\n\n ExchangeWithdrawActuator actuator = new ExchangeWithdrawActuator(getContract(\n OWNER_ADDRESS_FIRST, exchangeId, firstTokenId, firstTokenQuant),\n dbManager);\n TransactionResultCapsule ret = new TransactionResultCapsule();\n\n try {\n actuator.validate();\n actuator.execute(ret);\n fail();\n } catch (ContractValidateException e) {\n Assert.assertTrue(e instanceof ContractValidateException);\n Assert.assertEquals(\"exchange balance is not enough\",\n e.getMessage());\n } catch (ContractExeException e) {\n Assert.assertFalse(e instanceof ContractExeException);\n } finally {\n dbManager.getExchangeStore().delete(ByteArray.fromLong(1L));\n dbManager.getExchangeStore().delete(ByteArray.fromLong(2L));\n dbManager.getExchangeV2Store().delete(ByteArray.fromLong(1L));\n dbManager.getExchangeV2Store().delete(ByteArray.fromLong(2L));\n }\n }", "public static byte[] generateContractAddress(byte[] address, BigInteger nonce) {\n List<RlpType> values = new ArrayList<>();\n\n values.add(RlpString.create(address));\n values.add(RlpString.create(nonce));\n RlpList rlpList = new RlpList(values);\n\n byte[] encoded = RlpEncoder.encode(rlpList);\n byte[] hashed = Hash.sha3(encoded);\n return Arrays.copyOfRange(hashed, 12, hashed.length);\n }", "private double getBalance() { return balance; }", "@Override\r\npublic void checkBalance() {\n\t\r\n}", "abstract int checkBalance(String accountno) throws RemoteException;", "public Integer getAccountBalance(String address) throws LedgerException {\n // Convenience variable for throwing exceptions\n String action = \"get account balance\";\n\n Account account;\n Block lastBlock;\n\n try {\n // Retrieve most recent completed block\n lastBlock = getBlock(blockMap.size());\n } catch (LedgerException e) {\n // Catch 'Block does not exist' and throw more specific exception\n throw new LedgerException(action, \"No blocks have been commited yet.\");\n }\n\n // If the account does not exist, throw an Exception\n if ( (account = lastBlock.getAccount(address)) == null ) {\n throw new LedgerException(action, \"Account does not exist.\");\n }\n\n return account.getBalance();\n }", "byte[] token();", "public String[] createNewAddress(){\r\n byte[][] pairs=ECDSAgeneratePublicAndPrivateKey();\r\n byte[] afterhashing=RIPEMD160(SHA256hash(pairs[1]));\r\n byte[] checksum=getCheckSum(SHA256hash(SHA256hash(afterhashing)));\r\n byte[] bitcoinaddress=concateByteArray(afterhashing,checksum);\r\n return new String[]{toHex(pairs[0]), convertPrivateKeytoWIF(pairs[0]), base58encode(bitcoinaddress)};\r\n }", "@Test\n public void SameTokenNameCloseExchangeBalanceIsNotEnough2() {\n dbManager.getDynamicPropertiesStore().saveAllowSameTokenName(0);\n InitExchangeBeforeSameTokenNameActive();\n long exchangeId = 2;\n String firstTokenId = \"_\";\n long firstTokenQuant = 1000_000_000001L;\n String secondTokenId = \"def\";\n long secondTokenQuant = 400000000L;\n\n byte[] ownerAddress = ByteArray.fromHexString(OWNER_ADDRESS_FIRST);\n AccountCapsule accountCapsule = dbManager.getAccountStore().get(ownerAddress);\n Map<String, Long> assetMap = accountCapsule.getAssetMap();\n Assert.assertEquals(10000_000000L, accountCapsule.getBalance());\n Assert.assertEquals(null, assetMap.get(secondTokenId));\n\n ExchangeWithdrawActuator actuator = new ExchangeWithdrawActuator(getContract(\n OWNER_ADDRESS_FIRST, exchangeId, firstTokenId, firstTokenQuant),\n dbManager);\n TransactionResultCapsule ret = new TransactionResultCapsule();\n\n try {\n actuator.validate();\n actuator.execute(ret);\n fail();\n } catch (ContractValidateException e) {\n Assert.assertTrue(e instanceof ContractValidateException);\n Assert.assertEquals(\"exchange balance is not enough\",\n e.getMessage());\n } catch (ContractExeException e) {\n Assert.assertFalse(e instanceof ContractExeException);\n } finally {\n dbManager.getExchangeStore().delete(ByteArray.fromLong(1L));\n dbManager.getExchangeStore().delete(ByteArray.fromLong(2L));\n dbManager.getExchangeV2Store().delete(ByteArray.fromLong(1L));\n dbManager.getExchangeV2Store().delete(ByteArray.fromLong(2L));\n }\n }", "public String getBalance() {\n return this.balance;\n }", "public Call<BCExplorerResult<AddressData>> getAddressData(String address, boolean withSum) {\n return getInstantService().balance(address, withSum ? 1 : 0);\n }", "public BankATM() {\n getLocation();\n }", "public void balance(){\n\t\tnamesTree.balance();\n\t\taccountNumbersTree.balance();\n\t}", "@POST\n @Path(\"transfer\")\n BiboxSingleResponse<String> depositAddress(\n @FormParam(FORM_CMDS) String cmds,\n @FormParam(FORM_APIKEY) String apiKey,\n @FormParam(FORM_SIGNATURE) ParamsDigest signature);", "@Test\n public void SameTokenNameOpenExchangeBalanceIsNotEnough2() {\n dbManager.getDynamicPropertiesStore().saveAllowSameTokenName(1);\n InitExchangeSameTokenNameActive();\n long exchangeId = 2;\n String firstTokenId = \"_\";\n long firstTokenQuant = 1000_000_000001L;\n String secondTokenId = \"456\";\n long secondTokenQuant = 400000000L;\n\n byte[] ownerAddress = ByteArray.fromHexString(OWNER_ADDRESS_FIRST);\n AccountCapsule accountCapsule = dbManager.getAccountStore().get(ownerAddress);\n Map<String, Long> assetV2Map = accountCapsule.getAssetMapV2();\n Assert.assertEquals(10000_000000L, accountCapsule.getBalance());\n Assert.assertEquals(null, assetV2Map.get(secondTokenId));\n\n ExchangeWithdrawActuator actuator = new ExchangeWithdrawActuator(getContract(\n OWNER_ADDRESS_FIRST, exchangeId, firstTokenId, firstTokenQuant),\n dbManager);\n TransactionResultCapsule ret = new TransactionResultCapsule();\n\n try {\n actuator.validate();\n actuator.execute(ret);\n fail();\n } catch (ContractValidateException e) {\n Assert.assertTrue(e instanceof ContractValidateException);\n Assert.assertEquals(\"exchange balance is not enough\",\n e.getMessage());\n } catch (ContractExeException e) {\n Assert.assertFalse(e instanceof ContractExeException);\n } finally {\n dbManager.getExchangeStore().delete(ByteArray.fromLong(1L));\n dbManager.getExchangeStore().delete(ByteArray.fromLong(2L));\n dbManager.getExchangeV2Store().delete(ByteArray.fromLong(1L));\n dbManager.getExchangeV2Store().delete(ByteArray.fromLong(2L));\n }\n }", "public Call<BCExplorerResult<AddressData>> getAddressData(String address) {\n return getInstantService().balance(address);\n }", "public abstract PlacedBet register(double bet, double balance, Payout payout);", "public BaseJson<BigDecimal> wallet_balance() throws Exception {\n String s = main(\"wallet_balance\",\"[]\");\n return JsonHelper.jsonStr2Obj(s, BaseJson.class);\n }", "@Test\n\tpublic void moneyTrnasferExcetionInsufficientBalanceOfFromAccount() {\n\t\t\n\t\tString accountNumberFrom = createAccount(\"krishna\",4000);\n\t\tString accountNumberTo = createAccount(\"ram\",2000);\n\t\tdouble amountToBeTranfered = 40000.0;\n\t\tMoneyTransfer moneyTransfer = new MoneyTransfer();\n\t\tmoneyTransfer.setAccountNumberFrom(Integer.parseInt(accountNumberFrom));\n\t\tmoneyTransfer.setAccountNumberTo(Integer.parseInt(accountNumberTo));\n\t\tmoneyTransfer.setAmount(amountToBeTranfered);\n\t\t\n\t\tString requestBody = gson.toJson(moneyTransfer);\n\t\t\n\t\tRequestSpecification request = RestAssured.given();\n\t\trequest.body(requestBody);\n\t\tResponse response = request.put(\"/transfer\");\n\t\t\n\t\t// This logic is required due to response has been set as mix of Message and return data value. - START\n\t\tStringBuilder sb = new StringBuilder();\n\t\tsb.append(\"Account Number - \");\n\t\tsb.append(accountNumberFrom);\n\t\tsb.append(\" do not have sufficient amout to transfer.\");\n\t\t// This logic is required due to response has been set as mix of Message and return data value. - END\n\t\t\n\t\tAssertions.assertEquals(sb.toString(), response.asString());\n\t\t\n\t}", "public int getDataAmount() {\n\t\treturn super.getDataAmount() + NodeID.ADDRESS_SIZE;\n\t}", "public int getBalance()\n {\n return balance;\n }", "private Account createAccount(byte[] address) {\n return new Account(address);\n }", "@Test\n public void SameTokenNameOpenTokenBalanceZero() {\n dbManager.getDynamicPropertiesStore().saveAllowSameTokenName(1);\n InitExchangeSameTokenNameActive();\n long exchangeId = 1;\n String firstTokenId = \"123\";\n long firstTokenQuant = 200000000L;\n String secondTokenId = \"456\";\n long secondTokenQuant = 400000000L;\n\n byte[] ownerAddress = ByteArray.fromHexString(OWNER_ADDRESS_FIRST);\n AccountCapsule accountCapsule = dbManager.getAccountStore().get(ownerAddress);\n accountCapsule.addAssetAmountV2(firstTokenId.getBytes(), firstTokenQuant, dbManager);\n accountCapsule.addAssetAmountV2(secondTokenId.getBytes(), secondTokenQuant, dbManager);\n accountCapsule.setBalance(10000_000000L);\n dbManager.getAccountStore().put(ownerAddress, accountCapsule);\n\n ExchangeWithdrawActuator actuator = new ExchangeWithdrawActuator(getContract(\n OWNER_ADDRESS_FIRST, exchangeId, firstTokenId, firstTokenQuant),\n dbManager);\n TransactionResultCapsule ret = new TransactionResultCapsule();\n\n try {\n ExchangeCapsule exchangeCapsuleV2 = dbManager.getExchangeV2Store()\n .get(ByteArray.fromLong(exchangeId));\n exchangeCapsuleV2.setBalance(0, 0);\n dbManager.getExchangeV2Store().put(exchangeCapsuleV2.createDbKey(), exchangeCapsuleV2);\n\n actuator.validate();\n actuator.execute(ret);\n fail();\n } catch (ContractValidateException e) {\n Assert.assertTrue(e instanceof ContractValidateException);\n Assert.assertEquals(\"Token balance in exchange is equal with 0,\"\n + \"the exchange has been closed\",\n e.getMessage());\n } catch (ContractExeException e) {\n Assert.assertFalse(e instanceof ContractExeException);\n } catch (ItemNotFoundException e) {\n Assert.assertFalse(e instanceof ItemNotFoundException);\n } finally {\n dbManager.getExchangeStore().delete(ByteArray.fromLong(1L));\n dbManager.getExchangeStore().delete(ByteArray.fromLong(2L));\n dbManager.getExchangeV2Store().delete(ByteArray.fromLong(1L));\n dbManager.getExchangeV2Store().delete(ByteArray.fromLong(2L));\n }\n }", "public static void depositTest() {\n\t\tString encodedRequestHex = \"20000000000020202020\";\n\t\tString encodedIsdHex = \"2088260186b49c479c0010c3853981e64aace3f0e05dbfa994558774e000c0008061a804e0c4e78d93760e4c63780b70296008a10010090006639a567649df90bbc639a56a539df90af6639a56b5f9df9067c639a56bb09df9009c639a56c369df8dc500800042c021420020120010c734acec93bf22248c734ad5e93bf22158c734ad9e33bf21a8cc734adb253bf20fc0c734adb5b3bf20138c734adc9d3bf1b940100008580648400404000018e695924277e462d18e6958ee677e4ff20200008b01090800808000031cd2b1644efc8c5a31cd2b1064efca00c04000116029210010100000639a560e59df9188e639a560299df93ff00800022c062420020080000c734abe713bf23168c734abd653bf26904100005f9f8584e4a32800030d40800000802022a00368036800810d0016401640\";\n\n\t\tDatagramSocket socket = null;\n\t\ttry {\n\t\t\tsocket = new DatagramSocket(selfPort);\n\t\t\tSystem.out.println(\"OBU - Started socket with port \" + selfPort);\n\t\t} catch (SocketException e) {\n\t\t\tSystem.out.println(\"OBU - Error creating socket with port \" + selfPort);\n\t\t\te.printStackTrace();\n\t\t}\n\n\t\tbyte[] encodedRequestByte = null;\n\t\tbyte[] encodedIsdByte = null;\n\t\ttry {\n\t\t\tencodedRequestByte = Hex.decodeHex(encodedRequestHex.toCharArray());\n\t\t\tencodedIsdByte = Hex.decodeHex(encodedIsdHex.toCharArray());\n\t\t} catch (DecoderException e) {\n\t\t\tSystem.out.println(\"OBU - Error decoding hex string into bytes\");\n\t\t\te.printStackTrace();\n\t\t}\n\n\t\tDatagramPacket reqPacket = new DatagramPacket(encodedRequestByte, encodedRequestByte.length,\n\t\t\t\tnew InetSocketAddress(odeIp, odePort));\n\t\tSystem.out.println(\"OBU - Printing Service Request in hex: \\n\" + encodedRequestHex);\n\t\tSystem.out.println(\"\\nOBU - Sending Service Request to ODE - Ip: \" + odeIp + \" Port: \" + odePort);\n\t\ttry {\n\t\t\tsocket.send(reqPacket);\n\t\t} catch (IOException e) {\n\t\t\tSystem.out.println(\"OBU - Error Sending Service Request to ODE\");\n\t\t\te.printStackTrace();\n\t\t}\n\n\t\tbyte[] buffer = new byte[BUFFER_SIZE];\n\t\tSystem.out.println(\"\\nOBU - Waiting for Service Response from ODE...\");\n\t\tDatagramPacket resPacket = new DatagramPacket(buffer, buffer.length);\n\t\ttry {\n\t\t\tsocket.receive(resPacket);\n\t\t\tbyte[] actualPacket = Arrays.copyOf(resPacket.getData(), resPacket.getLength());\n\t\t\tSystem.out.println(\"OBU - Received Service Response from ODE\");\n\t\t\tSystem.out.println(\"OBU - Printing Service Response in hex: \\n\" + Hex.encodeHexString(actualPacket));\n\t\t} catch (IOException e) {\n\t\t\tSystem.out.println(\"\\nOBU - Error Receiving Service Response from ODE\");\n\t\t\te.printStackTrace();\n\t\t}\n\n\t\tDatagramPacket isdPacket = new DatagramPacket(encodedIsdByte, encodedIsdByte.length,\n\t\t\t\tnew InetSocketAddress(odeIp, odePort));\n\t\ttry {\n\t\t\tsocket.send(isdPacket);\n\t\t\tSystem.out.println(\"\\nOBU - Printing ISD in hex: \\n\" + encodedIsdHex);\n\t\t\tSystem.out.println(\"\\nOBU - Sent ISD to ODE - Ip: \" + odeIp + \" Port: \" + odePort);\n\t\t} catch (IOException e) {\n\t\t\tSystem.out.println(\"OBU - Error Sending ISD to ODE\");\n\t\t\te.printStackTrace();\n\t\t}\n\n\t\tif (socket != null) {\n\t\t\tsocket.close();\n\t\t\tSystem.out.println(\"OBU - Closed socket with port \" + selfPort);\n\t\t}\n\t}", "abstract void addressValidity();", "public String getBalance() {\n return balance;\n }", "public String myAfterBalanceAmount() {\r\n\t\tint count=0;\r\n\t\tList<SavingAccount> acc = null;\r\n\t\ttry {\r\n\t\t\tSystem.out.println(\"Before Repeat\");\r\n\t\t\tacc = getSavingAccountList();\r\n\r\n\t\t\tfor (SavingAccount savingAcc : acc) {\r\n\t\t\t\tif (!(\"0\".equals(savingAcc.getState()))) {\r\n\t\t\t\t\tif (savingAcc.getState().equals(\"active\")) {\r\n\t\t\t\t\t\tint maxRepeat = Integer.parseInt(savingAcc\r\n\t\t\t\t\t\t\t\t.getRepeatable());\r\n\r\n\t\t\t\t\t\tDate date = new Date();\r\n\t\t\t\t\t\tDate systemDate = savingAccSer\r\n\t\t\t\t\t\t\t\t.convertStringToDateDDmmYYYY(savingAccSer\r\n\t\t\t\t\t\t\t\t\t\t.convertDateToStringDDmmYYYY(date));\r\n\r\n\t\t\t\t\t\tDate dateEnd = savingAccSer\r\n\t\t\t\t\t\t\t\t.convertStringToDateDDmmYYYY(savingAcc\r\n\t\t\t\t\t\t\t\t\t\t.getDateEnd());\r\n\r\n\t\t\t\t\t\tif (systemDate.getTime() == dateEnd.getTime()) {\r\n\t\t\t\t\t\t\tDate newEndDate = DateUtils.addMonths(systemDate,\r\n\t\t\t\t\t\t\t\t\tsavingAcc.getInterestRateId().getMonth());\r\n\r\n\t\t\t\t\t\t\tfloat balance = savingAcc.getBalanceAmount();\r\n\t\t\t\t\t\t\tfloat interest = savingAcc.getInterestRateId()\r\n\t\t\t\t\t\t\t\t\t.getInterestRate();\r\n\r\n\t\t\t\t\t\t\tint month = savingAcc.getInterestRateId()\r\n\t\t\t\t\t\t\t\t\t.getMonth();\r\n\t\t\t\t\t\t\tint days = Days\r\n\t\t\t\t\t\t\t\t\t.daysBetween(\r\n\t\t\t\t\t\t\t\t\t\t\tnew DateTime(\r\n\t\t\t\t\t\t\t\t\t\t\t\t\tsavingAccSer\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.convertStringToDate(savingAcc\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.getDateStart())),\r\n\t\t\t\t\t\t\t\t\t\t\tnew DateTime(\r\n\t\t\t\t\t\t\t\t\t\t\t\t\tsavingAccSer\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.convertStringToDate(savingAcc\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.getDateEnd())))\r\n\t\t\t\t\t\t\t\t\t.getDays();\r\n\t\t\t\t\t\t\tfloat amountAll = balance\r\n\t\t\t\t\t\t\t\t\t+ (balance * ((interest / (100)) / 360) * days);\r\n\t\t\t\t\t\t\tsavingAcc.setDateStart(savingAccSer\r\n\t\t\t\t\t\t\t\t\t.convertDateToString(systemDate));\r\n\t\t\t\t\t\t\tsavingAcc.setDateEnd(savingAccSer\r\n\t\t\t\t\t\t\t\t\t.convertDateToString(newEndDate));\r\n\t\t\t\t\t\t\tsavingAcc.setBalanceAmount(amountAll);\r\n\t\t\t\t\t\t\tsavingAcc.setRepeatable(\"\" + (maxRepeat + 1));\r\n\t\t\t\t\t\t\tupdateSavingAccount(savingAcc);\r\n\t\t\t\t\t\t\tcount+=1;\r\n\t\t\t\t\t\t} else {\r\n\t\t\t\t\t\t\tcontinue;\r\n\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\r\n\t\t\t}\r\n\r\n\t\t\tSystem.out.println(\"Successfully!! \"+ count +\" Saving Account has been updated. Minh Map!!!\");\r\n\t\t\t\r\n\t\t\treturn \"success\";\r\n\r\n\t\t} catch (Exception e) {\r\n\t\t\te.printStackTrace();\r\n\t\t\tSystem.out.println(\"Exception\");\r\n\r\n\t\t}\r\n\t\treturn \"Fail\";\r\n\t}", "private final void asB() {\n /*\n r6 = this;\n r0 = r6.cxs;\n r1 = r6.asp();\n r1 = r1.cCg;\n r2 = \"binding.depositAmountEdit\";\n kotlin.jvm.internal.i.e(r1, r2);\n r2 = r0 instanceof com.iqoption.core.microservices.billing.response.deposit.cashboxitem.d;\n r3 = 0;\n r4 = 1;\n if (r2 == 0) goto L_0x002b;\n L_0x0013:\n r2 = r0;\n r2 = (com.iqoption.core.microservices.billing.response.deposit.cashboxitem.d) r2;\n r2 = r2.aaH();\n if (r2 == 0) goto L_0x0027;\n L_0x001c:\n r2 = r2.aaT();\n if (r2 == 0) goto L_0x0027;\n L_0x0022:\n r2 = r2.size();\n goto L_0x0028;\n L_0x0027:\n r2 = 0;\n L_0x0028:\n if (r2 != 0) goto L_0x002b;\n L_0x002a:\n goto L_0x0040;\n L_0x002b:\n if (r0 == 0) goto L_0x0032;\n L_0x002d:\n r2 = r0.ZL();\n goto L_0x0033;\n L_0x0032:\n r2 = 0;\n L_0x0033:\n r5 = com.iqoption.core.microservices.billing.response.deposit.cashboxitem.CashboxItemType.USER_CARD;\n if (r2 != r5) goto L_0x0038;\n L_0x0037:\n goto L_0x0040;\n L_0x0038:\n r2 = r6.aoJ();\n if (r2 == 0) goto L_0x003f;\n L_0x003e:\n goto L_0x0040;\n L_0x003f:\n r4 = 0;\n L_0x0040:\n r2 = \"binding.depositPresetsList\";\n if (r4 == 0) goto L_0x0053;\n L_0x0044:\n r0 = r6.asp();\n r0 = r0.cCr;\n kotlin.jvm.internal.i.e(r0, r2);\n r0 = (android.view.View) r0;\n com.iqoption.core.ext.a.ak(r0);\n goto L_0x006b;\n L_0x0053:\n r3 = r6.asp();\n r3 = r3.cCr;\n kotlin.jvm.internal.i.e(r3, r2);\n r3 = (android.view.View) r3;\n com.iqoption.core.ext.a.al(r3);\n r2 = new com.iqoption.deposit.light.perform.c$s;\n r2.<init>(r6, r0);\n r2 = (android.view.View.OnFocusChangeListener) r2;\n r1.setOnFocusChangeListener(r2);\n L_0x006b:\n return;\n */\n throw new UnsupportedOperationException(\"Method not decompiled: com.iqoption.deposit.light.perform.c.asB():void\");\n }", "protected void deposit(double amount)\n\t{\n\t\tacc_balance+=amount;\n\t}", "public static ATMAccount createAccount() {\r\n\t\tString userName;\r\n\t\tdouble userBalance;\r\n\t\tint digit = -1;\r\n\r\n\t\tSystem.out.println(\"Please enter a name for the account: \");\r\n\t\tuserInput.nextLine();\r\n\t\tuserName = userInput.nextLine();\r\n\r\n\t\t//Requests digits 1 by 1 for the pin number\r\n\t\tString accPin = \"\";\r\n\t\tfor (int i = 1; i < 5; i++) {\r\n\t\t\tdigit = -1;\r\n\t\t\tSystem.out.println(\"Please enter digit #\" + i + \" of\" + \"your pin.\");\r\n\t\t\tdo {\r\n\t\t\t\tdigit = userInput.nextInt();\r\n\t\t\t} while (digit < 0 || digit > 9);\r\n\t\t\taccPin += digit;\r\n\t\t}\r\n\r\n\t\tSystem.out.println(\"Please put the amount of money you would like to \" + \"initially deposit into the account: \");\r\n\t\tuserBalance = userInput.nextDouble();\r\n\t\tRandom accountIDGenerator = new Random();\r\n\t\tint userID = accountIDGenerator.nextInt(2147483647);\r\n\t\tATMAccount account = new ATMAccount(userID, userName, Integer.parseInt(accPin), userBalance);\r\n\t\tSystem.out.println(\"Acount Information: \\n\"+account.toString());\r\n\t\treturn account;\r\n\t}", "AionAddress createAccount(String password);", "public static int balanceOf(Hash160 owner) {\n return getBalanceOf(owner);\n }", "java.lang.String getServiceAccountIdTokens(int index);", "@Test\n public void SameTokenNameCloseTokenQuantLessThanZero() {\n dbManager.getDynamicPropertiesStore().saveAllowSameTokenName(0);\n InitExchangeBeforeSameTokenNameActive();\n long exchangeId = 1;\n String firstTokenId = \"abc\";\n long firstTokenQuant = -1L;\n String secondTokenId = \"def\";\n long secondTokenQuant = 400000000L;\n\n byte[] ownerAddress = ByteArray.fromHexString(OWNER_ADDRESS_FIRST);\n AccountCapsule accountCapsule = dbManager.getAccountStore().get(ownerAddress);\n accountCapsule.addAssetAmount(firstTokenId.getBytes(), 1000L);\n accountCapsule.addAssetAmount(secondTokenId.getBytes(), secondTokenQuant);\n accountCapsule.setBalance(10000_000000L);\n dbManager.getAccountStore().put(ownerAddress, accountCapsule);\n\n ExchangeWithdrawActuator actuator = new ExchangeWithdrawActuator(getContract(\n OWNER_ADDRESS_FIRST, exchangeId, firstTokenId, firstTokenQuant),\n dbManager);\n TransactionResultCapsule ret = new TransactionResultCapsule();\n\n try {\n actuator.validate();\n actuator.execute(ret);\n fail();\n } catch (ContractValidateException e) {\n Assert.assertTrue(e instanceof ContractValidateException);\n Assert.assertEquals(\"withdraw token quant must greater than zero\",\n e.getMessage());\n } catch (ContractExeException e) {\n Assert.assertFalse(e instanceof ContractExeException);\n } finally {\n dbManager.getExchangeStore().delete(ByteArray.fromLong(1L));\n dbManager.getExchangeStore().delete(ByteArray.fromLong(2L));\n dbManager.getExchangeV2Store().delete(ByteArray.fromLong(1L));\n dbManager.getExchangeV2Store().delete(ByteArray.fromLong(2L));\n }\n }", "@Test\n public void SameTokenNameCloseNoAccount() {\n dbManager.getDynamicPropertiesStore().saveAllowSameTokenName(0);\n InitExchangeBeforeSameTokenNameActive();\n long exchangeId = 1;\n String firstTokenId = \"abc\";\n long firstTokenQuant = 100000000L;\n String secondTokenId = \"def\";\n long secondTokenQuant = 200000000L;\n\n byte[] ownerAddress = ByteArray.fromHexString(OWNER_ADDRESS_FIRST);\n AccountCapsule accountCapsule = dbManager.getAccountStore().get(ownerAddress);\n Map<String, Long> assetMap = accountCapsule.getAssetMap();\n Assert.assertEquals(10000_000000L, accountCapsule.getBalance());\n Assert.assertEquals(null, assetMap.get(firstTokenId));\n Assert.assertEquals(null, assetMap.get(secondTokenId));\n\n ExchangeWithdrawActuator actuator = new ExchangeWithdrawActuator(getContract(\n OWNER_ADDRESS_NOACCOUNT, exchangeId, firstTokenId, firstTokenQuant),\n dbManager);\n TransactionResultCapsule ret = new TransactionResultCapsule();\n\n try {\n actuator.validate();\n actuator.execute(ret);\n fail(\"account[+OWNER_ADDRESS_NOACCOUNT+] not exists\");\n } catch (ContractValidateException e) {\n Assert.assertTrue(e instanceof ContractValidateException);\n Assert.assertEquals(\"account[\" + OWNER_ADDRESS_NOACCOUNT + \"] not exists\",\n e.getMessage());\n } catch (ContractExeException e) {\n Assert.assertFalse(e instanceof ContractExeException);\n } finally {\n dbManager.getExchangeStore().delete(ByteArray.fromLong(1L));\n dbManager.getExchangeStore().delete(ByteArray.fromLong(2L));\n dbManager.getExchangeV2Store().delete(ByteArray.fromLong(1L));\n dbManager.getExchangeV2Store().delete(ByteArray.fromLong(2L));\n }\n }", "public double getBalance(){\r\n\t\treturn balance;\r\n\t}", "lightpay.lnd.grpc.NewAddressRequest.AddressType getType();", "public static void extract_money(){\n TOTALCMONEY = TOTALCMONEY - BALANCERETRIEVE; //the total cashier money equals the total cashier money minus the retrieve request\r\n BALANCE = BALANCE - BALANCERETRIEVE; //the user balance equals the account minus the retrieve request\r\n }", "@Override\r\n\tpublic double checkBalance(String mobileNo) {\n\t\tCustomer custCheckBalance = custMap.get(mobileNo);\r\n\t\tdouble amount = custCheckBalance.getInitialBalance();\r\n\t\treturn amount;\r\n\t}", "public long getStreetCredGain();", "public double getBalance(){\n return balance;\r\n }", "public int getBalance() {\n return balance;\n }", "public int getBalance() {\n return balance;\n }", "public double getBalance(){\n return balance;\n }", "private static boolean validAddress2() throws IOException, JSONException {\n\n\t\tOkHttpClient client = new OkHttpClient();\n\t\t\n\t\tString city = \"Lombard\";\n\t\tcity = \"\\\"\" + city + \"\\\"\";\n\t\t\n\t\tString state = \"Illinois\";\n\t\tstate = \"\\\"\" + state + \"\\\"\";\n\t\t\n\t\tString zip = \"60148\";\n\t\tzip = \"\\\"\" + zip + \"\\\"\";\n\t\t\n\t\tString street = \"1741 S Lalonde Ave\";\n\t\tstreet = \"\\\"\" + street + \"\\\"\";\n\t\t\n\t\t// RequestBody b2 = new RequestBody.create(\"application/json\");\n\n\t\tMediaType mediaType = MediaType.parse(\"application/json\");\n\t\tRequestBody body = RequestBody.create(mediaType,\n\t\t\t\t\"{\\r\\n\\t\\\"UPSSecurity\\\": {\\r\\n\\t\\t\\\"UsernameToken\\\": {\\r\\n\\t\\t\\t\\\"Username\\\": \"\n\t\t\t\t+ \"\\\"attarsaaniya\\\",\\r\\n\\t\\t\\t\\\"Password\\\": \"\n\t\t\t\t+ \"\\\"Summer2017\\\"\\r\\n\\t\\t},\\r\\n\\t\\t\\\"ServiceAccessToken\\\": \"\n\t\t\t\t+ \"{\\r\\n\\t\\t\\t\\\"AccessLicenseNumber\\\": \"\n\t\t\t\t+ \"\\\"DD33B9ADDD7ADDC8\\\"\\r\\n\\t\\t}\\r\\n\\t},\"\n\t\t\t\t+ \"\\r\\n\\t\\\"XAVRequest\\\": {\\r\\n\\t\\t\\\"Request\\\": \"\n\t\t\t\t+ \"{\\r\\n\\t\\t\\t\\\"RequestOption\\\": \\\"1\\\",\\r\\n\\t\\t\\t\"\n\t\t\t\t+ \"\\\"TransactionReference\\\": {\\r\\n\\t\\t\\t\\t\\\"CustomerContext\\\":\"\n\t\t\t\t+ \" \\\"Your Customer Context\\\"\\r\\n\\t\\t\\t}\\r\\n\\t\\t},\\r\\n\\t\\t\"\n\t\t\t\t+ \"\\\"MaximumListSize\\\": \\\"10\\\",\\r\\n\\t\\t\\\"AddressKeyFormat\\\": \"\n\t\t\t\t+ \"{\\r\\n\\t\\t\\t\\\"ConsigneeName\\\": \\\"Consignee Name\\\",\\r\\n\\t\\t\\t\"\n\t\t\t\t+ \"\\\"BuildingName\\\": \\\"Building Name\\\",\\r\\n\\t\\t\\t\\\"AddressLine\\\": \"\n\t\t\t\t+ street + \",\\r\\n\\t\\t\\t\\\"PoliticalDivision2\\\": \"\n\t\t\t\t+ city + \",\\r\\n\\t\\t\\t\\\"PoliticalDivision1\\\": \"\n\t\t\t\t+ state + \" ,\\r\\n\\t\\t\\t\\\"PostcodePrimaryLow\\\":\"\n\t\t\t\t+ zip + \",\\r\\n\\t\\t\\t\\\"CountryCode\\\": \\\"US\\\"\\r\\n\\t\\t}\\r\\n\\t}\\r\\n}\");\n\t\t\n\t\tRequest request = new Request.Builder().url(\"https://onlinetools.ups.com/rest/XAV\").post(body).build();\n\n\t\tokhttp3.Response response = client.newCall(request).execute();\n\n\t\tJSONObject jResponse = new JSONObject(response.body().string());\n\t\tSystem.out.println(jResponse);\n\n\t\tJSONObject xavResponse = jResponse.getJSONObject(\"XAVResponse\");\n\t\tJSONObject response5 = xavResponse.getJSONObject(\"Response\");\n\t\tJSONObject respStatus = response5.getJSONObject(\"ResponseStatus\");\n\t\tString desc = respStatus.getString(\"Description\");\n\t\t\n\t\t// check desc == \"Success\"\n\t\t// check if this matches city/state/zip from other api\n\n\t\tSystem.out.println(desc);\n\t\tJSONObject candidate = xavResponse.getJSONObject(\"Candidate\");\n\t\tJSONObject addrKeyFormat = candidate.getJSONObject(\"AddressKeyFormat\");\n\t\tString addrResponse = addrKeyFormat.getString(\"AddressLine\");\n\t\tString cityResponse = addrKeyFormat.getString(\"PoliticalDivision2\");\n\t\tString stateResponse = addrKeyFormat.getString(\"PoliticalDivision1\");\n\t\tString zipResponse = addrKeyFormat.getString(\"PostcodePrimaryLow\");\n\t\t\n\t\tSystem.out.println(addrResponse);\n\t\tSystem.out.println(cityResponse);\n\t\tSystem.out.println(stateResponse);\n\t\tSystem.out.println(zipResponse);\n\t\treturn false;\n\t}", "@Test\n public void SameTokenNameOpenTokenQuantLessThanZero() {\n dbManager.getDynamicPropertiesStore().saveAllowSameTokenName(1);\n InitExchangeSameTokenNameActive();\n long exchangeId = 1;\n String firstTokenId = \"123\";\n long firstTokenQuant = -1L;\n String secondTokenId = \"456\";\n long secondTokenQuant = 400000000L;\n\n byte[] ownerAddress = ByteArray.fromHexString(OWNER_ADDRESS_FIRST);\n AccountCapsule accountCapsule = dbManager.getAccountStore().get(ownerAddress);\n accountCapsule.addAssetAmountV2(firstTokenId.getBytes(), 1000L, dbManager);\n accountCapsule.addAssetAmountV2(secondTokenId.getBytes(), secondTokenQuant, dbManager);\n accountCapsule.setBalance(10000_000000L);\n dbManager.getAccountStore().put(ownerAddress, accountCapsule);\n\n ExchangeWithdrawActuator actuator = new ExchangeWithdrawActuator(getContract(\n OWNER_ADDRESS_FIRST, exchangeId, firstTokenId, firstTokenQuant),\n dbManager);\n TransactionResultCapsule ret = new TransactionResultCapsule();\n\n try {\n actuator.validate();\n actuator.execute(ret);\n fail();\n } catch (ContractValidateException e) {\n Assert.assertTrue(e instanceof ContractValidateException);\n Assert.assertEquals(\"withdraw token quant must greater than zero\",\n e.getMessage());\n } catch (ContractExeException e) {\n Assert.assertFalse(e instanceof ContractExeException);\n } finally {\n dbManager.getExchangeStore().delete(ByteArray.fromLong(1L));\n dbManager.getExchangeStore().delete(ByteArray.fromLong(2L));\n dbManager.getExchangeV2Store().delete(ByteArray.fromLong(1L));\n dbManager.getExchangeV2Store().delete(ByteArray.fromLong(2L));\n }\n }", "public BankAccount(int balance) {\n\n this.balance = balance;\n\n }", "@java.lang.Override\n public com.google.protobuf.ByteString\n getBalanceBytes() {\n java.lang.Object ref = balance_;\n if (ref instanceof java.lang.String) {\n com.google.protobuf.ByteString b = \n com.google.protobuf.ByteString.copyFromUtf8(\n (java.lang.String) ref);\n balance_ = b;\n return b;\n } else {\n return (com.google.protobuf.ByteString) ref;\n }\n }", "public Person balance(NotNegInt balance)\n {\n if(balance == null) throw new NullPointerException(\"The field balance in the Person ValueDomain may not be null\");\n edma_value[4] = ((IValueInstance) balance).edma_getValue();\n return new PersonImpl(PersonImpl.edma_create(edma_value));\n }", "public long getBalance() {\n return this.balance;\n }", "@Test\n public void SameTokenNameOpenTnotherTokenQuantLessThanZero() {\n dbManager.getDynamicPropertiesStore().saveAllowSameTokenName(1);\n InitExchangeSameTokenNameActive();\n long exchangeId = 1;\n String firstTokenId = \"123\";\n long quant = 1L;\n String secondTokenId = \"456\";\n long secondTokenQuant = 400000000L;\n\n byte[] ownerAddress = ByteArray.fromHexString(OWNER_ADDRESS_FIRST);\n AccountCapsule accountCapsule = dbManager.getAccountStore().get(ownerAddress);\n accountCapsule.addAssetAmountV2(firstTokenId.getBytes(), 1000L, dbManager);\n accountCapsule.addAssetAmountV2(secondTokenId.getBytes(), secondTokenQuant, dbManager);\n accountCapsule.setBalance(10000_000000L);\n dbManager.getAccountStore().put(ownerAddress, accountCapsule);\n\n ExchangeWithdrawActuator actuator = new ExchangeWithdrawActuator(getContract(\n OWNER_ADDRESS_FIRST, exchangeId, secondTokenId, quant),\n dbManager);\n TransactionResultCapsule ret = new TransactionResultCapsule();\n\n try {\n actuator.validate();\n actuator.execute(ret);\n fail();\n } catch (ContractValidateException e) {\n Assert.assertTrue(e instanceof ContractValidateException);\n Assert.assertEquals(\"withdraw another token quant must greater than zero\",\n e.getMessage());\n } catch (ContractExeException e) {\n Assert.assertFalse(e instanceof ContractExeException);\n } finally {\n dbManager.getExchangeStore().delete(ByteArray.fromLong(1L));\n dbManager.getExchangeStore().delete(ByteArray.fromLong(2L));\n dbManager.getExchangeV2Store().delete(ByteArray.fromLong(1L));\n dbManager.getExchangeV2Store().delete(ByteArray.fromLong(2L));\n }\n }", "public BigDecimal getLineNetAmt();", "@java.lang.Override\n public java.lang.String getBalance() {\n java.lang.Object ref = balance_;\n if (ref instanceof java.lang.String) {\n return (java.lang.String) ref;\n } else {\n com.google.protobuf.ByteString bs = \n (com.google.protobuf.ByteString) ref;\n java.lang.String s = bs.toStringUtf8();\n balance_ = s;\n return s;\n }\n }", "private String getToken() {\n\t\tString numbers = \"0123456789\";\n\t\tRandom rndm_method = new Random();\n String OTP = \"\";\n for (int i = 0; i < 4; i++)\n {\n \tOTP = OTP+numbers.charAt(rndm_method.nextInt(numbers.length()));\n \n }\n return OTP;\n\t}", "@Override\r\n\tpublic double getBalance() {\n\t\treturn (super.getBalance()+cashcredit);\r\n\t}", "public RemoteCall<BigInteger> balanceOf(String account) {\n final Function function = new Function(FUNC_BALANCEOF,\n Arrays.<Type>asList(new org.web3j.abi.datatypes.Address(account)),\n Arrays.<TypeReference<?>>asList(new TypeReference<Uint256>() {}));\n return executeRemoteCallSingleValueReturn(function, BigInteger.class);\n }", "void deposit(double Cash){\r\n\t\tbalance=balance+Cash;\r\n\t}", "@Test\n public void SameTokenNameOpenNoAccount() {\n dbManager.getDynamicPropertiesStore().saveAllowSameTokenName(1);\n InitExchangeSameTokenNameActive();\n long exchangeId = 1;\n String firstTokenId = \"123\";\n long firstTokenQuant = 100000000L;\n String secondTokenId = \"456\";\n long secondTokenQuant = 200000000L;\n\n byte[] ownerAddress = ByteArray.fromHexString(OWNER_ADDRESS_FIRST);\n AccountCapsule accountCapsule = dbManager.getAccountStore().get(ownerAddress);\n Map<String, Long> assetV2Map = accountCapsule.getAssetMapV2();\n Assert.assertEquals(10000_000000L, accountCapsule.getBalance());\n Assert.assertEquals(null, assetV2Map.get(firstTokenId));\n Assert.assertEquals(null, assetV2Map.get(secondTokenId));\n\n ExchangeWithdrawActuator actuator = new ExchangeWithdrawActuator(getContract(\n OWNER_ADDRESS_NOACCOUNT, exchangeId, firstTokenId, firstTokenQuant),\n dbManager);\n TransactionResultCapsule ret = new TransactionResultCapsule();\n\n try {\n actuator.validate();\n actuator.execute(ret);\n fail(\"account[+OWNER_ADDRESS_NOACCOUNT+] not exists\");\n } catch (ContractValidateException e) {\n Assert.assertTrue(e instanceof ContractValidateException);\n Assert.assertEquals(\"account[\" + OWNER_ADDRESS_NOACCOUNT + \"] not exists\",\n e.getMessage());\n } catch (ContractExeException e) {\n Assert.assertFalse(e instanceof ContractExeException);\n } finally {\n dbManager.getExchangeStore().delete(ByteArray.fromLong(1L));\n dbManager.getExchangeStore().delete(ByteArray.fromLong(2L));\n dbManager.getExchangeV2Store().delete(ByteArray.fromLong(1L));\n dbManager.getExchangeV2Store().delete(ByteArray.fromLong(2L));\n }\n }", "protected double getTotalBalance()\r\n {\r\n return totalBalance;\r\n }", "Account(int account_number,double balance) //pramiterized constrector\n {\n this.account_number=account_number;\n this.balance=balance;\n }", "CarPaymentMethod creditCardNumber(String cardNumber);", "public double getBalance()\n {\n return balance;\n }", "public static void deposit() {\n\t\ttry {\n\t\t\tif (!LoginMgr.isLoggedIn()) {\n\t\t\t\tthrow new NotLoggedInException();\n\t\t\t}\n\n\t\t\t//Scanner s = new Scanner(System.in);\n\t\t\tSystem.out.println(\"Enter account number:\");\n\t\t\tString accNum = \"\";\n\t\t\tif (Quinterac.s.hasNextLine())\n\t\t\t\taccNum = Quinterac.s.nextLine();\n\n\t\t\tif (!ValidAccListMgr.checkAccNumExist(accNum)) {\n\t\t\t\tSystem.out.println(\"Please enter a valid account number\");\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tSystem.out.println(\"Enter the amount of money to deposit in cents:\");\n\t\t\tint amount = 0;\n\t\t\tif (Quinterac.s.hasNextInt()) amount = Integer.parseInt(Quinterac.s.nextLine());\n\t\t\t\n\t\t\tString modeName = LoginMgr.checkMode();\n\t\t\tif (modeName.equals(\"machine\")) {\n\t\t\t\tatmCheckDepositValid(accNum, amount);\n\t\t\t} else if (modeName.equals(\"agent\")) {\n\t\t\t\tagentCheckDepositValid(accNum, amount);\n\t\t\t}\n\n\t\t} catch (NotLoggedInException e) {\n\t\t\tSystem.out.println(e.getMessage());\n\t\t} catch (Exception e) {\n\t\t\tSystem.out.println(e.getMessage());\n\t\t}\n\t}", "@NotNull\n List<TxErc721> txsErc721(@NotNull String address, long startBlock, long endBlock) throws EtherScanException;", "@Test\n public void SameTokenNameCloseTokenBalanceZero() {\n dbManager.getDynamicPropertiesStore().saveAllowSameTokenName(0);\n InitExchangeBeforeSameTokenNameActive();\n long exchangeId = 1;\n String firstTokenId = \"abc\";\n long firstTokenQuant = 200000000L;\n String secondTokenId = \"def\";\n long secondTokenQuant = 400000000L;\n\n byte[] ownerAddress = ByteArray.fromHexString(OWNER_ADDRESS_FIRST);\n AccountCapsule accountCapsule = dbManager.getAccountStore().get(ownerAddress);\n accountCapsule.addAssetAmount(firstTokenId.getBytes(), firstTokenQuant);\n accountCapsule.addAssetAmount(secondTokenId.getBytes(), secondTokenQuant);\n accountCapsule.setBalance(10000_000000L);\n dbManager.getAccountStore().put(ownerAddress, accountCapsule);\n\n ExchangeWithdrawActuator actuator = new ExchangeWithdrawActuator(getContract(\n OWNER_ADDRESS_FIRST, exchangeId, firstTokenId, firstTokenQuant),\n dbManager);\n TransactionResultCapsule ret = new TransactionResultCapsule();\n\n try {\n ExchangeCapsule exchangeCapsule = dbManager.getExchangeStore()\n .get(ByteArray.fromLong(exchangeId));\n exchangeCapsule.setBalance(0, 0);\n dbManager.getExchangeStore().put(exchangeCapsule.createDbKey(), exchangeCapsule);\n\n actuator.validate();\n actuator.execute(ret);\n fail();\n } catch (ContractValidateException e) {\n Assert.assertTrue(e instanceof ContractValidateException);\n Assert.assertEquals(\"Token balance in exchange is equal with 0,\"\n + \"the exchange has been closed\",\n e.getMessage());\n } catch (ContractExeException e) {\n Assert.assertFalse(e instanceof ContractExeException);\n } catch (ItemNotFoundException e) {\n Assert.assertFalse(e instanceof ItemNotFoundException);\n } finally {\n dbManager.getExchangeStore().delete(ByteArray.fromLong(1L));\n dbManager.getExchangeStore().delete(ByteArray.fromLong(2L));\n dbManager.getExchangeV2Store().delete(ByteArray.fromLong(1L));\n dbManager.getExchangeV2Store().delete(ByteArray.fromLong(2L));\n }\n }", "private void returnDeposit(String paymentInfo) {\n }", "public double getBalance(){\n return this.balance;\r\n }", "public double getBalance(){\n return balance;\n }", "@Test\n public void SameTokenNameCloseTnotherTokenQuantLessThanZero() {\n dbManager.getDynamicPropertiesStore().saveAllowSameTokenName(0);\n InitExchangeBeforeSameTokenNameActive();\n long exchangeId = 1;\n String firstTokenId = \"abc\";\n long quant = 1L;\n String secondTokenId = \"def\";\n long secondTokenQuant = 400000000L;\n\n byte[] ownerAddress = ByteArray.fromHexString(OWNER_ADDRESS_FIRST);\n AccountCapsule accountCapsule = dbManager.getAccountStore().get(ownerAddress);\n accountCapsule.addAssetAmount(firstTokenId.getBytes(), 1000L);\n accountCapsule.addAssetAmount(secondTokenId.getBytes(), secondTokenQuant);\n accountCapsule.setBalance(10000_000000L);\n dbManager.getAccountStore().put(ownerAddress, accountCapsule);\n\n ExchangeWithdrawActuator actuator = new ExchangeWithdrawActuator(getContract(\n OWNER_ADDRESS_FIRST, exchangeId, secondTokenId, quant),\n dbManager);\n TransactionResultCapsule ret = new TransactionResultCapsule();\n\n try {\n actuator.validate();\n actuator.execute(ret);\n fail();\n } catch (ContractValidateException e) {\n Assert.assertTrue(e instanceof ContractValidateException);\n Assert.assertEquals(\"withdraw another token quant must greater than zero\",\n e.getMessage());\n } catch (ContractExeException e) {\n Assert.assertFalse(e instanceof ContractExeException);\n } finally {\n dbManager.getExchangeStore().delete(ByteArray.fromLong(1L));\n dbManager.getExchangeStore().delete(ByteArray.fromLong(2L));\n dbManager.getExchangeV2Store().delete(ByteArray.fromLong(1L));\n dbManager.getExchangeV2Store().delete(ByteArray.fromLong(2L));\n }\n }", "public java.lang.String getBalance() {\n java.lang.Object ref = balance_;\n if (!(ref instanceof java.lang.String)) {\n com.google.protobuf.ByteString bs =\n (com.google.protobuf.ByteString) ref;\n java.lang.String s = bs.toStringUtf8();\n balance_ = s;\n return s;\n } else {\n return (java.lang.String) ref;\n }\n }", "public double getBalance(){\n\t\treturn balance;\n\t}", "public Wallet() {\n total_bal = 10;\n }", "@External(readonly = true)\n\tpublic Address get_revshare_wallet_address(Address _scoreAddress) {\n\t\t\n\t\tString gamedata = this.proposal_data.get(_scoreAddress);\n JsonValue json = Json.parse(gamedata);\n if (!json.isArray()) {\n throw new IllegalArgumentException(\"Not json array\");\n } \n JsonArray array = json.asArray(); \n String revShareWalletAddressStr = getValueFromItem(array,\"revShareWalletAddress\"); \n\t\t\n return Address.fromString(revShareWalletAddressStr);\n\t}", "public double getBalance()\r\n\t{\r\n\t\treturn balance;\t\t\r\n\t}", "public double deposit(double amount){\n double total=amount;\n if(type.equals(\"TMB\"));total=-0.5;\n currentBalance+=total;\n return currentBalance;\n }" ]
[ "0.61214745", "0.5442586", "0.53827524", "0.5285239", "0.52687657", "0.5210208", "0.5210208", "0.5187308", "0.5179996", "0.51515806", "0.5145167", "0.512685", "0.5096538", "0.5085066", "0.50751907", "0.50422436", "0.50313616", "0.50299513", "0.49953985", "0.49909723", "0.49773866", "0.4939269", "0.49374226", "0.4924198", "0.49216312", "0.48905686", "0.48889774", "0.4880555", "0.48646", "0.48576483", "0.48530623", "0.48500174", "0.48462987", "0.48335233", "0.48283738", "0.4828081", "0.481219", "0.48116097", "0.48106524", "0.48041332", "0.48022136", "0.480095", "0.47929305", "0.47873044", "0.47790548", "0.47758055", "0.47546405", "0.47530666", "0.47528034", "0.4736839", "0.4729891", "0.47280493", "0.47274998", "0.47235766", "0.47203395", "0.47197995", "0.471842", "0.47126845", "0.47125852", "0.47109142", "0.4708805", "0.4703483", "0.47019997", "0.47015166", "0.47007734", "0.469534", "0.4694638", "0.4694638", "0.46929407", "0.4685409", "0.46843022", "0.46837384", "0.46830958", "0.46791145", "0.46774074", "0.4676001", "0.46759287", "0.46757314", "0.46749702", "0.46691507", "0.46660286", "0.46613544", "0.46610305", "0.46594074", "0.46586126", "0.46575448", "0.46557683", "0.4649984", "0.46471748", "0.46461326", "0.46450752", "0.46412048", "0.4640603", "0.4637375", "0.4633206", "0.46302915", "0.46283025", "0.46281487", "0.4623641", "0.46212038" ]
0.7256822
0
Maximum 20 address for single batch request If address MORE THAN 20, then there will be more than 1 request performed
@NotNull List<Balance> balances(@NotNull List<String> addresses) throws EtherScanException;
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private void loadMoreAddresses() {\n if(!isLastPage) {\n isLoading = true;\n LobDemoApp.getLobDemoClient().getAddresses(mLayoutManager.getItemCount(), PAGE_SIZE, this, new JsonHttpResponseHandler() {\n @Override\n public void onSuccess(int statusCode, Header[] headers, JSONObject response) {\n isLoading = false;\n\n parseAddresses(response);\n }\n });\n }\n // TODO: Issue a GET addresses request using the API Client\n }", "public static long getApiMaxInflightRequests() {\n return 5000L;\n }", "private int getIdBatchSize() {\n return ApiProperties.getPropertyAsInt(\n \"api.bigr.library.\" + ApiFunctions.shortClassName(getClass().getName()) + \".batch.size\",\n 500);\n }", "@DefaultValue(\"20\")\n int getApiClientThreadPoolSize();", "public int getBatchSize();", "private boolean requestLimitReached() {\n\t\treturn (requestCount >= maximumRequests);\n\t}", "void setMaxAreaAddresses(int maxAreaAddresses);", "void setMaxAreaAddresses(int maxAreaAddresses);", "public void incrementActiveRequests() \n {\n ++requests;\n }", "public void setMaxCalls(int max);", "public int getBatchSize()\r\n/* 31: */ {\r\n/* 32:35 */ return batchArgs.length;\r\n/* 33: */ }", "public void setMaxRequestUrlsReported(int value) {\n this.maxRequestUrlsReported = value;\n }", "@Override\n\tpublic void setMaxNumOfUrls(int maxNumOfUrls) {\n\t\t\n\t}", "public static void main(String[] args) throws InterruptedException {\n\n Random random = new Random();\n RateLimitingVOne rateLimiter = new RateLimitingVOne();\n UUID userId = UUID.randomUUID();\n\n List<Request> allRequests = new ArrayList<>();\n\n long start = System.currentTimeMillis();\n for (int i = 1; i < 100; i++) {\n int count = random.nextInt(10);\n Request nr = new Request(count> 0 ? count : 1, System.currentTimeMillis(), i);\n allRequests.add(nr);\n rateLimiter.handleNewRequest(nr, userId);\n// sleep(random.nextInt(350));\n sleep(250);\n }\n\n long elapsed = System.currentTimeMillis() - start;\n\n System.out.println(\"Time ---- >> \"+ elapsed);\n\n for (Request tr : allRequests) {\n long since = (tr.timestamp - start);\n int count = tr.isRejected ? -tr.requestsCount : tr.requestsCount;\n System.out.println(tr.sequence+\", \"+ since + \" , \" + count);\n }\n\n\n Request r = rateLimiter.userRequestLog.get(userId);\n int count =0;\n while (r.previous != null) {\n count++;\n r = r.previous;\n }\n\n System.out.println(count);\n\n\n }", "public List<NSSRequestBean> getMoreRequest(int userId);", "public int createMultipleRequests(Set _requests) throws RequestManagerException, PersistenceResourceAccessException;", "public int getBatchSize()\r\n/* 23: */ {\r\n/* 24:42 */ return BatchUpdateUtils.this.size();\r\n/* 25: */ }", "private int spreadWriteRequests() {\n return RANDOM.nextInt(MAX_SLEEP_TIME);\n }", "public ListIngress limit(Number limit) {\n put(\"limit\", limit);\n return this;\n }", "@Test\n public void testAddressExhaustion() throws Exception {\n mRepo.updateParams(new IpPrefix(TEST_SERVER_ADDR, 28), TEST_EXCL_SET, TEST_LEASE_TIME_MS,\n null /* clientAddr */);\n\n // /28 should have 16 addresses, 14 w/o the first/last, 11 w/o excluded addresses\n requestAddresses((byte) 11);\n verify(mCallbacks, times(11)).onLeasesChanged(any());\n\n try {\n mRepo.getOffer(null, TEST_MAC_2,\n IPV4_ADDR_ANY /* relayAddr */, INETADDR_UNSPEC /* reqAddr */, HOSTNAME_NONE);\n fail(\"Should be out of addresses\");\n } catch (DhcpLeaseRepository.OutOfAddressesException e) {\n // Expected\n }\n verifyNoMoreInteractions(mCallbacks);\n }", "public int getMaxRequestUrlsReported() {\n return maxRequestUrlsReported;\n }", "private void setBatchSize( int aValue ) {\n GlobalParametersFake lConfigParms = new GlobalParametersFake( ParmTypeEnum.LOGIC.name() );\n lConfigParms.setInteger( PARAMETER_NAME, aValue );\n GlobalParameters.setInstance( lConfigParms );\n }", "@Override\n\tpublic int getMaxThreads() {\n\t\treturn 10;\n\t}", "protected int getBatchSize() {\n return mBatchSize;\n }", "@Test\n public void sendBatchTest() {\n Batch batch = null;\n // List<BatchReturn> response = api.sendBatch(batch);\n\n // TODO: test validations\n }", "public int getBatchSize() {\n\t\treturn 0;\n\t}", "void requestRateLimited();", "@Test\n public void getBatchTest() {\n String token = null;\n // List<BatchReturn> response = api.getBatch(token);\n\n // TODO: test validations\n }", "public void getRandom(){\n RequestQueue queue = Volley.newRequestQueue(this);\n // Request a JSON response from the provided URL.\n JsonObjectRequest jRequest = new JsonObjectRequest(Request.Method.GET, RANDOM_URL, null,\n new Response.Listener<JSONObject>() {\n @Override\n public void onResponse(JSONObject response) {\n try {\n String lat = response.getJSONObject(\"nearest\").getString(\"latt\");\n String lng = response.getJSONObject(\"nearest\").getString(\"longt\");\n getAddress(lat + \",\" + lng);\n\n\n } catch (JSONException e) {\n e.printStackTrace();\n }\n }\n }, new Response.ErrorListener() {\n @Override\n public void onErrorResponse(VolleyError error) {\n //Toast.makeText(getApplicationContext(), \"Could not retrieve Address\", Toast.LENGTH_SHORT).show();\n getRandom(); //repeating call here might automatically make it happen B/C success rate of this call is roughly 50/50\n }\n });\n queue.add(jRequest);\n }", "@Value.Default\n public int maxTraceEntriesPerTransaction() {\n return 2000;\n }", "public void sendGetRequest() {\r\n\t\tString[] requests = this.input.substring(4, this.input.length()).split(\" \"); \r\n\t\t\r\n\t\tif(requests.length <= 1 || !(MyMiddleware.readSharded)){\r\n\t\t\tnumOfRecipients = 1;\r\n\t\t\trecipient = servers.get(loadBalance());\r\n\r\n\t\t\trecipient.send(this, input);\r\n\t\t\tsendTime = System.nanoTime();\r\n\r\n\t\t\tworkerTime = sendTime - pollTime;\r\n\r\n\t\t\t\r\n\t\t\tif(requests.length <= 1) {\r\n\t\t\t\tnumOfGets++;\r\n\t\t\t\ttype= \"10\";\r\n\t\t\t}\r\n\t\t\telse {\r\n\t\t\t\tnumOfMultiGets++;\r\n\t\t\t\ttype = requests.length+\"\";\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\t\r\n\t\t\tString reply = recipient.receive();\r\n\t\t\treceiveTime = System.nanoTime();\r\n\t\t\tprocessingTime = receiveTime - sendTime;\r\n\t\t\t\r\n\t\t\tint hit = 0;\r\n\t\t\thit += reply.split(\"VALUE\").length - 1;\r\n\t\t\tmiss += requests.length-hit;\r\n\r\n\t\t\tif(!(reply.endsWith(\"END\"))) {\r\n\t\t\t\tunproperRequests.add(reply);\r\n\t\t\t\tsendBack(currentJob.getClient(), reply);\r\n\t\t\t\treturn;\r\n\t\t\t}\r\n\t\t\tsendBack(currentJob.getClient(), reply);\r\n\r\n\t\t}\r\n\t\telse {\r\n\t\t\tnumOfMultiGets++;\r\n\t\t\ttype = requests.length+\"\";\r\n\t\t\tnumOfRecipients = servers.size();\r\n\t\t\trequestsPerServer = requests.length / servers.size();\r\n\t\t\tremainingRequests = requests.length % servers.size() ;\r\n\t\t\t\r\n\t\t\t//The worker thread sends a number of requests to each server equal to requestsPerServer \r\n\t\t\t//and at most requestsPerServer + remainingRequests\r\n\t\t\t\r\n\t\t\tfor(int i = 0; i < servers.size(); i++) {\r\n\t\t\t\tmessage = requestType;\r\n\t\t\t\tfor(int j = 0; j < requestsPerServer; j++){\r\n\t\t\t\t\tmessage += \" \";\r\n\t\t\t\t\tmessage += requests[requestsPerServer*i+j];\r\n\t\t\t\t\tif(i < remainingRequests) {\r\n\t\t\t\t\t\tmessage += \" \";\r\n\t\t\t\t\t\tmessage += requests[requests.length - remainingRequests + i];\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\tservers.get(i).send(this, message);\r\n\t\t\t}\r\n\t\t\tsendTime = System.nanoTime();\r\n\r\n\t\t\tworkerTime = sendTime - pollTime;\r\n\r\n\t\t\tint hit = 0;\r\n\t\t\tfor(ServerHandler s : servers) {\r\n\t\t\t\tString ricevuto = s.receive();\r\n\t\t\t\thit += ricevuto.split(\"VALUE\").length - 1;\r\n\t\t\t\treplies.add(ricevuto);\r\n\t\t\t}\r\n\t\t\treceiveTime = System.nanoTime();\r\n\t\t\tprocessingTime = receiveTime - sendTime;\r\n\r\n\t\t\tmiss += requests.length-hit;\r\n\t\t\t\r\n\t\t\tfinalReply = \"\";\r\n\t\t\tfor(String reply : replies) {\r\n\t\t\t\tif(!(reply.endsWith(\"END\"))) {\r\n\t\t\t\t\tunproperRequests.add(reply);\r\n\t\t\t\t\tsendBack(currentJob.getClient(), reply);\r\n\t\t\t\t\treplies.clear();\r\n\t\t\t\t\treturn;\r\n\t\t\t\t}\r\n\t\t\t\telse {\r\n\t\t\t\t\treply = reply.substring(0, reply.length() - 3);\r\n\t\t\t\t\tfinalReply += reply;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tfinalReply += \"END\";\r\n\t\t\tsendBack(currentJob.getClient(), finalReply);\r\n\t\t\treplies.clear();\r\n\r\n\t\t}\r\n\t\t\r\n\t}", "private void getLargeOrderList(){\n sendPacket(CustomerTableAccess.getConnection().getLargeOrderList());\n \n }", "public void withCustomBatchLimit(int maxBacklog) {\n this.batchBacklogLimit = maxBacklog;\n }", "protected abstract boolean sendNextRequests();", "public static long getApiMaxRequestBytes() {\n return 10L * 1000L * 1000L; // 10 megabytes (https://en.wikipedia.org/wiki/Megabyte)\n }", "public void setRequestNum(int amount){\n requestNum = amount;\n }", "CamelJpaConsumerBindingModel setMaximumResults(Integer maximumResults);", "public void setRequestAttributeCount(int requestAttributeCount)\n {\n this.requestAttributeCount = requestAttributeCount;\n }", "public void incrementNumBindRequests() {\n this.numBindRequests.incrementAndGet();\n }", "public void incrementNumUnbindRequests() {\n this.numUnbindRequests.incrementAndGet();\n }", "int batchSize();", "public void incrementNumAddRequests() {\n this.numAddRequests.incrementAndGet();\n }", "private void requestAddresses(byte nAddr) throws Exception {\n final HashSet<Inet4Address> addrs = new HashSet<>();\n byte[] hwAddrBytes = new byte[] { 8, 4, 3, 2, 1, 0 };\n for (byte i = 0; i < nAddr; i++) {\n hwAddrBytes[5] = i;\n MacAddress newMac = MacAddress.fromBytes(hwAddrBytes);\n final String hostname = \"host_\" + i;\n final DhcpLease lease = mRepo.getOffer(CLIENTID_UNSPEC, newMac,\n IPV4_ADDR_ANY /* relayAddr */, INETADDR_UNSPEC /* reqAddr */, hostname);\n\n assertNotNull(lease);\n assertEquals(newMac, lease.getHwAddr());\n assertEquals(hostname, lease.getHostname());\n assertTrue(format(\"Duplicate address allocated: %s in %s\", lease.getNetAddr(), addrs),\n addrs.add(lease.getNetAddr()));\n\n requestLeaseSelecting(newMac, lease.getNetAddr(), hostname);\n }\n }", "public final void setBatchSize(int batch) {\n batchSize = batch;\n }", "@Override\n\tpublic String findMaxBikeBatchNumber() throws Exception {\n\t\treturn bikeMapper.selectMaxBatch();\n\t}", "protected abstract boolean reachedContractLimit(int size);", "private WebSearchRequest createNextRequest() {\n\t\tWebSearchRequest _request = new WebSearchRequest(query);\n\t\t_request.setStart(BigInteger.valueOf(cacheStatus+1));\t\t\t\t\t//Yahoo API starts index with 1, not with 0\n\t\t_request.setResults(getFetchBlockSize());\n\t\treturn _request;\n\t}", "@Override\r\n public int getMaxConcurrentProcessingInstances() {\r\n return 1;\r\n }", "static void handlePaginated(IPlaceFinder finder, int limit) {\n LocalTime firstReqTime = LocalTime.now();\n findPagedResults(finder, limit, 0);\n int offset = limit;\n while(scanner.hasNextLine()) {\n String input = scanner.nextLine();\n if (ValidInput.MORE.getInput().equals(input)) {\n // checks if the current call is no later than 5 minutes of first request\n if (firstReqTime.plusMinutes(5L).isAfter(LocalTime.now())) {\n findPagedResults(finder, limit, offset);\n offset = offset + limit;\n //makes a new call if the first request is older than 5 mins\n } else {\n MessageOut.gettingNewResults();\n findPagedResults(finder, limit, 0);\n offset = limit;\n }\n } else if (ValidInput.END.getInput().equals(input)) {\n break;\n } else {\n MessageOut.notValidInput();\n }\n }\n }", "int maxNumberOfPutRows();", "private boolean handleHttpRequests(int[] timeInterval) {\n //generate 3 random data\n int userId1 = ThreadLocalRandom.current().nextInt(POPULATION);\n int userId2 = ThreadLocalRandom.current().nextInt(POPULATION);\n int userId3 = ThreadLocalRandom.current().nextInt(POPULATION);\n\n int timeInterval1 = ThreadLocalRandom.current().nextInt(timeInterval[1] - timeInterval[0]+1) + timeInterval[0];\n int timeInterval2 = ThreadLocalRandom.current().nextInt(timeInterval[1] - timeInterval[0]+1) + timeInterval[0];\n int timeInterval3 = ThreadLocalRandom.current().nextInt(timeInterval[1] - timeInterval[0]+1) + timeInterval[0];\n int stepCount1 = ThreadLocalRandom.current().nextInt(5000);\n int stepCount2 = ThreadLocalRandom.current().nextInt(5000);\n int stepCount3 = ThreadLocalRandom.current().nextInt(5000);\n\n try {\n long startTime = System.currentTimeMillis();\n Response response = postUserData(userId1,DAY_NUM,timeInterval1,stepCount1);\n countResponse(startTime,response);\n\n startTime = System.currentTimeMillis();\n response = postUserData(userId2,DAY_NUM,timeInterval2,stepCount2);\n countResponse(startTime,response);\n\n startTime = System.currentTimeMillis();\n response = getCurrentUserData(userId1);\n countResponse(startTime,response);\n\n startTime = System.currentTimeMillis();\n response = getSingleUserData(userId1, DAY_NUM);\n countResponse(startTime,response);\n\n startTime = System.currentTimeMillis();\n response = postUserData(userId3,DAY_NUM,timeInterval3,stepCount3);\n countResponse(startTime,response);\n\n } catch (Exception e) {\n // System.out.println(\"Exception in Post1: \" + e.getClass().getSimpleName());\n System.out.println(e.getMessage() + \"\\n\" + e.getCause());\n return false;\n }\n\n printer.numOfRequestsSent(5);\n return true;\n }", "int getActiveBlockRequestsNumber() {\n return blockRequests.size();\n }", "public void incrementNumSearchRequests() {\n this.numSearchRequests.incrementAndGet();\n }", "private CompletableFuture<Iterator<T>> batch() {\n return batch.thenCompose(iterator -> {\n if (iterator != null && !iterator.hasNext()) {\n batch = fetch(iterator.position());\n return batch.thenApply(Function.identity());\n }\n return CompletableFuture.completedFuture(iterator);\n });\n }", "@Override\n public int getMaxCapacity() {\n return 156250000;\n }", "int getNumOfRetrievelRequest();", "int getNumOfRetrievelRequest();", "@Override\n\tpublic void onRepeatRequest(HttpRequest request,int requestId, int count) {\n\t\t\n\t}", "public static void main(String... args) {\n List<Integer> data = new ArrayList<Integer>();\n data.add(1);\n data.add(1);\n data.add(1);\n data.add(1);\n data.add(2);\n data.add(2);\n data.add(3);\n data.add(4);\n data.add(4);\n data.add(4);\n data.add(4);\n data.add(5);\n data.add(5);\n data.add(5);\n data.add(5);\n data.add(6);\n data.add(6);\n data.add(7);\n data.add(7);\n data.add(7);\n data.add(8);\n data.add(9);\n data.add(10);\n data.add(10);\n data.add(10);\n data.add(10);\n data.add(10);\n data.add(11);\n data.add(12);\n data.add(12);\n\n int count = droppedRequests(data);\n System.out.println(count);\n }", "@WithName(\"max.export.batch.size\")\n @WithDefault(\"512\")\n Integer maxExportBatchSize();", "public void incrementNumAbandonRequests() {\n this.numAbandonRequests.incrementAndGet();\n }", "private void processRequestRange(String targetID, HttpServerRequest req) throws Exception {\n\t\tString result = retrieveDetails(targetID);\n\t\tif(result != null)\n\t\t\treq.response().end(result);\n\t\telse\n\t\t\treq.response().end(\"No resopnse received\");\n\t}", "@Override\n public int getMaxJobsPerAcquisition() {\n return myMaxJobsPerAcquisition;\n }", "@Override\n public void preAllocateIds(int requestSize) {\n // do nothing by default\n }", "private void publishRequest(int number) throws MqttException {\n for (int i = 1; i < number+1; i++) {\n for (int j = 1; j < NUMBER_OF_USERS+1; j++) {\n sendRequest(fakeBooking(j, i));\n }\n }\n }", "public final String getMaximumOutstandingRequests() {\n return properties.get(MAXIMUM_OUTSTANDING_REQUESTS_PROPERTY);\n }", "public int getMaxCalls();", "public int getMaxPoolSize(Env env) {\n return client.getMaxPoolSize();\n }", "public int getBatchSize() {\n return _batchSize;\n }", "private void addAnotherBatch(int position){\n \t\tif(position%provide.getBatchSize() == 2*provide.getBatchSize()/3\n \t\t\t\t&& position/provide.getBatchSize() == provide.getItemCache().getNextPage()-1){\n \t\t\tprovide.fillItemCache();\n \t\t}\n \t}", "public void setMaxGenerations(int value) { maxGenerations = value; }", "public HttpClient setMaxPoolSize(Env env, NumberValue size) {\n client.setMaxPoolSize(size.toInt());\n return this;\n }", "static int estimateBatchSizeUpperBound(ByteBuffer key, ByteBuffer value, Header[] headers) {\n return RECORD_BATCH_OVERHEAD + DefaultRecord.recordSizeUpperBound(key, value, headers);\n }", "public void incrementNumExtendedRequests() {\n this.numExtendedRequests.incrementAndGet();\n }", "void setMaxResults(int limit);", "public int getNumOfRetrievelRequest() {\n return numOfRetrievelRequest_;\n }", "public int getNumOfRetrievelRequest() {\n return numOfRetrievelRequest_;\n }", "@Test(priority=10)\n\tpublic void campaign_user_with_2000_limit() throws URISyntaxException, ClientProtocolException, IOException, ParseException{\n\t\ttest = extent.startTest(\"campaign_user_with_2000_limit\", \"To validate whether user is able to get campaign through campaign/user api with 2000 limit value\");\n\t\ttest.assignCategory(\"CFA GET /campaign/user API\");\n\t\tList<NameValuePair> nvps = new ArrayList<NameValuePair>();\n\t\tnvps.add(new BasicNameValuePair(\"limit\", String.valueOf(Constants.MAX_LIMIT)));\n\t\tCloseableHttpResponse response = HelperClass.make_get_request(\"/v2/campaign/user\", access_token, nvps);\n\t\tAssert.assertTrue(!(response.getStatusLine().getStatusCode() == 500 || response.getStatusLine().getStatusCode() == 401), \"Invalid status code is displayed. \"+ \"Returned Status: \"+response.getStatusLine().getStatusCode()+\" \"+response.getStatusLine().getReasonPhrase());\n\t\ttest.log(LogStatus.INFO, \"Execute campaign/user api method with valid parameter\");\n\t\tBufferedReader rd = new BufferedReader(new InputStreamReader(response.getEntity().getContent()));\n\t\tString line = \"\";\n\t\twhile ((line = rd.readLine()) != null) {\t \n\t\t // Convert response to JSON object\t\n\t\t JSONParser parser = new JSONParser();\n\t\t JSONObject response_json = (JSONObject) parser.parse(line);\n\t\t JSONArray camp_data_array = (JSONArray)response_json.get(\"data\");\n\t\t Assert.assertEquals(response_json.get(\"result\"), \"success\", \"API does not return success when valid limit value is entered.\");\n\t\t test.log(LogStatus.PASS, \"API returns success when valid 2000 value is entered.\");\n\t\t Assert.assertEquals(response_json.get(\"err\"), null, \"err is not null when 2000 limit value is entered.\");\n\t\t test.log(LogStatus.PASS, \"err is null when valid limit value is entered.\");\n\t\t // Check whether campaign/users returns number of records defined in limit\n\t\t Assert.assertFalse(camp_data_array.size() == 100, \"campaign/users is returning 100 records\");\n\t\t test.log(LogStatus.PASS, \"Check whether campaign/users returns success when 2000 limit value is passed\");\n\t\t}\n\t}", "public void\t\t\tgenerateNextRequest() throws Exception\n\t{\n\t\t// generate a random number of instructions for the request.\n\t\tlong noi =\n\t\t\t(long) this.rng.nextExponential(this.meanNumberOfInstructions) ;\n\t\tRequest r = new Request(this.rgURI + \"-\" + this.counter++, noi) ;\n\t\t// generate a random delay until the next request generation.\n\t\tlong interArrivalDelay =\n\t\t\t\t(long) this.rng.nextExponential(this.meanInterArrivalTime) ;\n\n\t\tif (RequestGenerator.DEBUG_LEVEL == 2) {\n\t\t\tthis.logMessage(\n\t\t\t\t\t\"Request generator \" + this.rgURI + \n\t\t\t\t\t\" submitting request \" + r.getRequestURI() + \" at \" +\n\t\t\t\t\tTimeProcessing.toString(System.currentTimeMillis() +\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tinterArrivalDelay) +\n\t\t\t\" with number of instructions \" + noi) ;\n\t\t}\n\t\t\n\t\t// submit the current request.\n\t\tthis.rsop.sendRequestAndNotify(r) ;\n\t\t// schedule the next request generation.\n\t\tthis.nextRequestTaskFuture =\n\t\t\tthis.scheduleTask(\n\t\t\t\tnew AbstractComponent.AbstractTask() {\n\t\t\t\t\t@Override\n\t\t\t\t\tpublic void run() {\n\t\t\t\t\t\ttry {\n\t\t\t\t\t\t\n\t\t\t\t\t\t\t((RequestGenerator)this.getOwner()).\n\t\t\t\t\t\t\t\tgenerateNextRequest() ;\n\t\t\t\t\t\t} catch (Exception e) {\n\t\t\t\t\t\t\tthrow new RuntimeException(e) ;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t},\n\t\t\t\tTimeManagement.acceleratedDelay(interArrivalDelay),\n\t\t\t\tTimeUnit.MILLISECONDS) ;\n\t\t\n\t}", "public void incrementNumDeleteRequests() {\n this.numDeleteRequests.incrementAndGet();\n }", "public int getCountRequests() {\n/* 415 */ return this.countRequests;\n/* */ }", "protected List<Long> getMoreIds(int requestSize) {\n\n String sql = getSql(requestSize);\n\n Connection connection = null;\n PreparedStatement statement = null;\n ResultSet resultSet = null;\n try {\n connection = dataSource.getConnection();\n\n statement = connection.prepareStatement(sql);\n resultSet = statement.executeQuery();\n\n List<Long> newIds = readIds(resultSet, requestSize);\n if (newIds.isEmpty()) {\n throw new PersistenceException(\"Always expecting more than 1 row from \" + sql);\n }\n\n return newIds;\n\n } catch (SQLException e) {\n if (e.getMessage().contains(\"Database is already closed\")) {\n String msg = \"Error getting SEQ when DB shutting down \" + e.getMessage();\n log.log(ERROR, msg);\n System.out.println(msg);\n return Collections.emptyList();\n } else {\n throw new PersistenceException(\"Error getting sequence nextval\", e);\n }\n } finally {\n closeResources(connection, statement, resultSet);\n }\n }", "long getRequestsCount();", "public void testAddAddresses_BatchOperationException()\r\n throws Exception {\r\n try {\r\n Address address = this.getAddress();\r\n address.getCountry().setId(10);\r\n this.dao.addAddresses(new Address[]{this.getAddress(), address}, false);\r\n fail(\"BatchOperationException expected\");\r\n } catch (BatchOperationException e) {\r\n //good\r\n }\r\n }", "private void addAllRequests(\n Iterable<? extends RequestFromSelf> values) {\n ensureRequestsIsMutable();\n com.google.protobuf.AbstractMessageLite.addAll(\n values, requests_);\n }", "public int getNumOfRetrievelRequest() {\n return numOfRetrievelRequest_;\n }", "public int getNumOfRetrievelRequest() {\n return numOfRetrievelRequest_;\n }", "int getRequestsCount();", "int getRequestsCount();", "public void requestPosition(int num)\n {\n Log.d(LOG_TAG, \"requestPosition()\");\n new Request(ip, this, num).start();\n }", "pb4server.MaxPrisonBuffAskReq getMaxPrisonBuffAskReq();", "public void setMaxConnections(int maxConnections)\n {\n _maxConnections = maxConnections;\n }", "public void setMaxConcurrentAccessCount(String newValue);", "public void setBatchSize(Integer batchSize) {\n this.batchSize = batchSize;\n }", "String getMaximumRedeliveries();", "protected void setBatchSize(Properties properties) {\n String s = properties.getProperty(this.BATCH_KEY);\n int size = this.RLS_BULK_QUERY_SIZE;\n try{\n size = Integer.parseInt(s);\n }\n catch(Exception e){}\n mBatchSize = size;\n }", "public int getMaxOverflowConnections()\n {\n return _maxOverflowConnections;\n }", "public void setMaxIterations(int number) {\r\n if (number < CurrentIteration) {\r\n throw new Error(\"Cannot be lower than the current iteration.\");\r\n }\r\n MaxIteration = number;\r\n Candidates.ensureCapacity(MaxIteration);\r\n }", "public void defaultUpdateCount(AcBatchFlight e)\n {\n }", "private synchronized int getNextRequestCode(){\r\n return currentRequestCode++;\r\n }", "public int getBatchDownloadWaitTime()\n {\n return 1000; \n }" ]
[ "0.6025443", "0.58001703", "0.5761269", "0.5698265", "0.5657924", "0.55687255", "0.5525691", "0.5525691", "0.54273045", "0.53788966", "0.5361527", "0.53592116", "0.5349677", "0.5327951", "0.5313908", "0.5312477", "0.52913827", "0.5275841", "0.5249246", "0.5245216", "0.52313465", "0.5227417", "0.5218118", "0.5205769", "0.5166913", "0.51665974", "0.51663756", "0.5162986", "0.5142582", "0.5122388", "0.50993913", "0.5099015", "0.50984657", "0.5081924", "0.50742006", "0.5069808", "0.5064481", "0.50344425", "0.5007828", "0.5007471", "0.5005864", "0.4987823", "0.49865428", "0.49861628", "0.4986035", "0.49824655", "0.49764833", "0.4965882", "0.4962488", "0.49561003", "0.4955327", "0.49546003", "0.4947121", "0.4945058", "0.4943058", "0.49354646", "0.49354646", "0.493005", "0.4925385", "0.49241295", "0.49211046", "0.49208757", "0.49201226", "0.49199536", "0.4919764", "0.490945", "0.4894264", "0.48858833", "0.48739687", "0.48645195", "0.48623377", "0.4860152", "0.4859777", "0.48529062", "0.48502263", "0.48457298", "0.48457298", "0.48452386", "0.4836158", "0.48359603", "0.48315898", "0.48302588", "0.4818623", "0.4817999", "0.48167726", "0.48118386", "0.48118386", "0.48081157", "0.48081157", "0.48014835", "0.47831443", "0.4781032", "0.47746813", "0.47716847", "0.47695264", "0.47683135", "0.4767739", "0.47660625", "0.47609836", "0.47606248", "0.4754624" ]
0.0
-1
All txs for given address
@NotNull List<Tx> txs(@NotNull String address, long startBlock, long endBlock) throws EtherScanException;
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@NotNull\n List<TxInternal> txsInternal(@NotNull String address, long startBlock, long endBlock) throws EtherScanException;", "@NotNull\n List<TxErc721> txsErc721(@NotNull String address, long startBlock, long endBlock) throws EtherScanException;", "@NotNull\n List<TxErc721> txsErc721(@NotNull String address, @NotNull String contractAddress, long startBlock, long endBlock)\n throws EtherScanException;", "@NotNull\n List<TxErc1155> txsErc1155(@NotNull String address, long startBlock, long endBlock) throws EtherScanException;", "@NotNull\n List<TxErc20> txsErc20(@NotNull String address, long startBlock, long endBlock) throws EtherScanException;", "public Vector<NetworkAddress> getHostAddresses(int type) {return addressesChecker.getAllMyAddresses(type); }", "@Override\n\tpublic List<Address> FindAllAddress() {\n\t\treturn ab.FindAll();\n\t}", "@NotNull\n List<TxInternal> txsInternalByHash(@NotNull String txhash) throws EtherScanException;", "public List<Address> getAllAddresses() throws BackendException;", "AllUsersAddresses getAllUsersAddresses();", "public static java.util.List<com.ifl.rapid.customer.model.CRM_Trn_Address> findAll()\n\t\tthrows com.liferay.portal.kernel.exception.SystemException {\n\t\treturn getPersistence().findAll();\n\t}", "@Override\n public List<UTXO> getOpenTransactionOutputs(List<Address> addresses) throws UTXOProviderException {\n\n List<UTXO> results = new LinkedList<UTXO>();\n for (Address a : addresses) {\n ByteBuffer bb = ByteBuffer.allocate(21);\n bb.put((byte) KeyType.ADDRESS_HASHINDEX.ordinal());\n bb.put(a.getHash160());\n\n ReadOptions ro = new ReadOptions();\n Snapshot sn = db.getSnapshot();\n ro.snapshot(sn);\n\n // Scanning over iterator very fast\n\n DBIterator iterator = db.iterator(ro);\n for (iterator.seek(bb.array()); iterator.hasNext(); iterator.next()) {\n ByteBuffer bbKey = ByteBuffer.wrap(iterator.peekNext().getKey());\n bbKey.get(); // remove the address_hashindex byte.\n byte[] addressKey = new byte[20];\n bbKey.get(addressKey);\n if (!Arrays.equals(addressKey, a.getHash160())) {\n break;\n }\n byte[] hashBytes = new byte[32];\n bbKey.get(hashBytes);\n int index = bbKey.getInt();\n Sha256Hash hash = Sha256Hash.wrap(hashBytes);\n UTXO txout;\n try {\n // TODO this should be on the SNAPSHOT too......\n // this is really a BUG.\n txout = getTransactionOutput(hash, index);\n } catch (BlockStoreException e) {\n throw new UTXOProviderException(\"block store execption\", e);\n }\n if (txout != null) {\n Script sc = txout.getScript();\n Address address = sc.getToAddress(params, true);\n UTXO output = new UTXO(txout.getHash(), txout.getIndex(), txout.getValue(), txout.getHeight(),\n txout.isCoinbase(), txout.getScript(), address.toString());\n results.add(output);\n }\n }\n try {\n iterator.close();\n ro = null;\n sn.close();\n sn = null;\n } catch (IOException e) {\n log.error(\"Error closing snapshot/iterator?\", e);\n }\n }\n return results;\n }", "@Override\n public List<StaticPacketTrace> pingAll(EtherType type) {\n ImmutableList.Builder<StaticPacketTrace> tracesBuilder = ImmutableList.builder();\n hostNib.getHosts().forEach(host -> {\n List<IpAddress> ipAddresses = getIpAddresses(host, type, false);\n if (ipAddresses.size() > 0) {\n //check if the host has only local IPs of that ETH type\n boolean onlyLocalSrc = ipAddresses.size() == 1 && ipAddresses.get(0).isLinkLocal();\n hostNib.getHosts().forEach(hostToPing -> {\n List<IpAddress> ipAddressesToPing = getIpAddresses(hostToPing, type, false);\n //check if the other host has only local IPs of that ETH type\n boolean onlyLocalDst = ipAddressesToPing.size() == 1 && ipAddressesToPing.get(0).isLinkLocal();\n boolean sameLocation = Sets.intersection(host.locations(), hostToPing.locations()).size() > 0;\n //Trace is done only if they are both local and under the same location\n // or not local and if they are not the same host.\n if (((sameLocation && onlyLocalDst && onlyLocalSrc) ||\n (!onlyLocalSrc && !onlyLocalDst && ipAddressesToPing.size() > 0))\n && !host.equals(hostToPing)) {\n tracesBuilder.addAll(trace(host.id(), hostToPing.id(), type));\n }\n });\n }\n });\n return tracesBuilder.build();\n }", "@NotNull\n List<TxErc1155> txsErc1155(@NotNull String address, @NotNull String contractAddress, long startBlock, long endBlock)\n throws EtherScanException;", "public StringList lookupAddresses(String name) throws UnknownHostException\n {\n StringList names=new StringList(); \n // cached lookup \n InetAddress[] addres = lookup(name); \n \n for (InetAddress addr:addres)\n {\n // only add unique address\n names.add(addr.getHostAddress(),true); // getHostName()); \n }\n \n return names; \n }", "public Transaction[] handleTxs(Transaction[] possibleTxs) {\n // IMPLEMENT THIS\n List<Transaction> validTxs = new ArrayList<>();\n for (Transaction tx : possibleTxs) {\n if (isValidTx(tx)) {\n validTxs.add(tx);\n ArrayList<Transaction.Output> outputs = tx.getOutputs();\n for (int idx = 0; idx < outputs.size(); idx++) {\n UTXO utxo = new UTXO(tx.getHash(), idx);\n utxoPool.addUTXO(utxo, outputs.get(idx));\n }\n }\n }\n\n return validTxs.toArray(new Transaction[0]);\n }", "private void requestAddresses(byte nAddr) throws Exception {\n final HashSet<Inet4Address> addrs = new HashSet<>();\n byte[] hwAddrBytes = new byte[] { 8, 4, 3, 2, 1, 0 };\n for (byte i = 0; i < nAddr; i++) {\n hwAddrBytes[5] = i;\n MacAddress newMac = MacAddress.fromBytes(hwAddrBytes);\n final String hostname = \"host_\" + i;\n final DhcpLease lease = mRepo.getOffer(CLIENTID_UNSPEC, newMac,\n IPV4_ADDR_ANY /* relayAddr */, INETADDR_UNSPEC /* reqAddr */, hostname);\n\n assertNotNull(lease);\n assertEquals(newMac, lease.getHwAddr());\n assertEquals(hostname, lease.getHostname());\n assertTrue(format(\"Duplicate address allocated: %s in %s\", lease.getNetAddr(), addrs),\n addrs.add(lease.getNetAddr()));\n\n requestLeaseSelecting(newMac, lease.getNetAddr(), hostname);\n }\n }", "public List<Address> getAllAddressesByName(String user_name) {\n\t\tList<Address> address = new ArrayList<>();\r\n\t\taddressdao.findByUserUsername(user_name)\r\n\t\t.forEach(address::add);\r\n\t\treturn address;\r\n\t}", "@Override\n\tpublic List findAll()\n\t{\n\t\treturn teataskMapper.findAll();\n\t}", "List<?> getAddress();", "public Transaction[] handleTxs(Transaction[] possibleTxs) {\n ArrayList<Transaction> validTransactions = new ArrayList<>();\n for (Transaction tx : possibleTxs){\n if (isValidTx(tx)){\n validTransactions.add(tx);\n consumePoolCoins(tx);\n createPoolCoins(tx);\n }\n }\n return validTransactions.toArray(new Transaction[validTransactions.size()]);\n }", "public abstract List<String> associateAddresses(NodeMetadata node);", "public AddressList listAllAddresses(String addressBook)\n\t{\n\t\treturn controller.listAllAddresses(addressBook);\n\t}", "public List<Address> findAll();", "String getAddress(int type);", "@NotNull\n List<TxErc20> txsErc20(@NotNull String address, @NotNull String contractAddress, long startBlock, long endBlock)\n throws EtherScanException;", "List<AcHost> all() throws Throwable;", "io.envoyproxy.envoy.data.dns.v3.DnsTable.AddressList getAddressList();", "public List<Address> getAddresses(final SessionContext ctx)\n\t{\n\t\tList<Address> coll = (List<Address>)getProperty( ctx, ADDRESSES);\n\t\treturn coll != null ? coll : Collections.EMPTY_LIST;\n\t}", "public static void printAllTaxiInfo(){\n\t\tfor(int i=0;i<TOTAL_TAXI;i++){\n\t\t\tprintTaxiInfo(i);\n\t\t}\n\t}", "public List<UrlAddress> searchDBUrl() {\n log.info(new SimpleDateFormat(\"yyyy/MM/dd HH:mm:ss\").format(new Date()) + \"find all url address\");\n List<UrlAddress> all = urlRepository.findAll();\n return all;\n }", "public static List<Address> GetAllRecordsFromTable() {\n\n return SQLite.select().from(Address.class).queryList();\n\n\n }", "public void setAddresses(List<String> addresses) {\n this.addresses = addresses;\n }", "@Override\n\tpublic List<AddressDTO> viewAllAddress(String userId) throws RetailerException, ConnectException {\n\t\tList<AddressDTO> allAddress = new ArrayList<AddressDTO>();\n\t\tConnection connection = null;\n\t\ttry {\n\n\t\t\tconnection = DbConnection.getInstance().getConnection();\n\t\t\texceptionProps = PropertiesLoader.loadProperties(EXCEPTION_PROPERTIES_FILE);\n\t\t\tgoProps = PropertiesLoader.loadProperties(GO_PROPERTIES_FILE);\n\t\t\tPreparedStatement smt = connection.prepareStatement(QuerryMapper.GET_USER_ADDRESSS);\n\t\t\tsmt.setString(1, userId);\n\t\t\tResultSet resultSet = smt.executeQuery();\n\t\t\twhile (resultSet.next()) {\n\t\t\t\tString addressId = resultSet.getString(1);\n\t\t\t\tString city = resultSet.getString(3);\n\t\t\t\tString state = resultSet.getString(4);\n\t\t\t\tString zip = resultSet.getString(5);\n\t\t\t\tString building_no = resultSet.getString(6);\n\t\t\t\tString country = resultSet.getString(7);\n\t\t\t\tboolean addressStatus = resultSet.getBoolean(8);\n\t\t\t\tAddressDTO address = new AddressDTO(addressId, userId, city, state, zip, building_no, country,\n\t\t\t\t\t\taddressStatus);\n\t\t\t\tallAddress.add(address);\n\t\t\t}\n\t\t} catch (DatabaseException | SQLException | IOException e) {\n\t\t\tGoLog.logger.error(e.getMessage());\n\t\t\tthrow new RetailerException(exceptionProps.getProperty(\"view_address_error\") + \" >>> \" + e.getMessage());\n\t\t} finally {\n\t\t\ttry {\n\t\t\t\tconnection.close();\n\t\t\t} catch (SQLException e) {\n\n\t\t\t\tthrow new ConnectException(Constants.connectionError);\n\t\t\t}\n\t\t}\n\t\treturn allAddress;\n\n\t}", "private List<Messages.Address> mapModelAddressToWireAddress(List<byte[]> addresses) {\n return addresses.stream().map(address -> Messages.Address.newBuilder()\n .setPort(6565)\n .setIpAddress(ByteString.copyFrom(address))\n .build())\n .collect(Collectors.toList());\n }", "public void listing() {\r\n int count = 1;\r\n for (AdressEntry i : addressEntryList) {\r\n System.out.print(count + \": \");\r\n System.out.println(i);\r\n count++;\r\n }\r\n System.out.println();\r\n }", "protected void listTenants() {\n if (!MULTITENANT_FEATURE_ENABLED.contains(dbType)) {\n return;\n }\n Db2Adapter adapter = new Db2Adapter(connectionPool);\n try (ITransaction tx = TransactionFactory.openTransaction(connectionPool)) {\n try {\n GetTenantList rtListGetter = new GetTenantList(adminSchemaName);\n List<TenantInfo> tenants = adapter.runStatement(rtListGetter);\n \n System.out.println(TenantInfo.getHeader());\n tenants.forEach(t -> System.out.println(t.toString()));\n } catch (DataAccessException x) {\n // Something went wrong, so mark the transaction as failed\n tx.setRollbackOnly();\n throw x;\n }\n }\n }", "public List<Address> getAllAddresses(long id) {\n\t\tList<Address> address = new ArrayList<>();\r\n\t\taddressdao.findByUserUId(id)\r\n\t\t.forEach(address::add);\r\n\t\treturn address;\r\n\t}", "@Test\n\tpublic void listLocations(){\n\t\tList<Location> lists = locationService.queryLoctionsByLat(29.8679775, 121.5450105);\n\t\t//System.out.println(lists.size()) ;\n\t\tfor(Location loc : lists){\n\t\t\tSystem.out.println(loc.getAddress_cn());\n\t\t}\n\t}", "private void loadAddresses() {\n\t\ttry {\n\t\t\torg.hibernate.Session session = sessionFactory.getCurrentSession();\n\t\t\tsession.beginTransaction();\n\t\t\taddresses = session.createCriteria(Address.class).list();\n\t\t\tsession.getTransaction().commit();\n\t\t\tSystem.out.println(\"Retrieved addresses from database:\"\n\t\t\t\t\t+ addresses.size());\n\t\t} catch (Throwable ex) {\n\t\t\tSystem.err.println(\"Can't retrieve address!\" + ex);\n\t\t\tex.printStackTrace();\n\t\t\t// Initialize the message queue anyway\n\t\t\tif (addresses == null) {\n\t\t\t\taddresses = new ArrayList<Address>();\n\t\t\t}\n\t\t}\n\t}", "@Override\n\tpublic List<Address> getAddressListByUserid(int userid) {\n\t\treturn sqlSessionTemplate.selectList(sqlId(\"getAddressByUserId\"),userid);\n\t}", "public Data getDataContaining(Address addr);", "private static void getAllReplicaAddress(String fileName) throws IOException {\n\n\t\tSystem.out.println(\"Working Directory = \" +\n\t System.getProperty(\"user.dir\"));\n\t\tBufferedReader br = new BufferedReader(new FileReader(fileName));\n\t\ttry {\n\t\t\tString line = br.readLine();\n\t\t\t\n\t\t while(line!=null && !line.trim().equals(\"\")) {\n\t\t \tallReplicaAddrs.add(line);\n\t\t \tline = br.readLine();\n\t\t }\n\t\t \n\t\t} finally {\n\t\t br.close();\n\t\t}\n\t}", "public void groupHostObjects(int addr) {\n\t\tfor(List<String> pkt : pkts) {\n\t\t\tif(!hosts.contains(pkt.get(addr)) && (!webPages.contains(pkt.get(addr)))) {\n\t\t\t\thosts.add(pkt.get(addr));\n\t\t\t}\n\n\t\t}\n\t}", "@GetMapping()\n\t@Override\n\tpublic List<Address> findAll() {\n\t\treturn addressService.findAll();\n\t}", "boolean hasAddress();", "boolean hasAddress();", "public void setAddresses(List<Address> addresses) {\r\n\r\n this.addresses = addresses;\r\n\r\n }", "boolean hasAddressList();", "@Override\r\n\tpublic List<UserAddress> viewUserAddressList() {\r\n\t\tList<UserAddress> result = new ArrayList<UserAddress>();\r\n useraddressrepository.findAll().forEach(UserAddress1 -> result.add(UserAddress1));\r\n return result;\r\n\t}", "public Call<ExpResult<List<DelegationInfo>>> getDelegations(MinterAddress address) {\n checkNotNull(address, \"Address can't be null\");\n\n return getInstantService().getDelegationsForAddress(address.toString(), 1);\n }", "private static Set<InetSocketAddress> getNNAddresses(DistributedFileSystem fs,\n Configuration conf) {\n Set<InetSocketAddress> addresses = new HashSet<>();\n String serviceName = fs.getCanonicalServiceName();\n\n if (serviceName.startsWith(\"ha-hdfs\")) {\n try {\n Map<String, Map<String, InetSocketAddress>> addressMap =\n DFSUtil.getNNServiceRpcAddressesForCluster(conf);\n String nameService = serviceName.substring(serviceName.indexOf(\":\") + 1);\n if (addressMap.containsKey(nameService)) {\n Map<String, InetSocketAddress> nnMap = addressMap.get(nameService);\n for (Map.Entry<String, InetSocketAddress> e2 : nnMap.entrySet()) {\n InetSocketAddress addr = e2.getValue();\n addresses.add(addr);\n }\n }\n } catch (Exception e) {\n LOG.warn(\"DFSUtil.getNNServiceRpcAddresses failed. serviceName=\" + serviceName, e);\n }\n } else {\n URI uri = fs.getUri();\n int port = uri.getPort();\n if (port < 0) {\n int idx = serviceName.indexOf(':');\n port = Integer.parseInt(serviceName.substring(idx + 1));\n }\n InetSocketAddress addr = new InetSocketAddress(uri.getHost(), port);\n addresses.add(addr);\n }\n\n return addresses;\n }", "public AsyncResult<List<Address>> requestReachabilityAddresses(Jid contact) {\r\n // In addition, a contact MAY request a user's reachability addresses in an XMPP <iq/> stanza of type \"get\".\r\n return xmppSession.query(IQ.get(contact, new Reachability())).thenApply(result -> {\r\n Reachability reachability = result.getExtension(Reachability.class);\r\n if (reachability != null) {\r\n return reachability.getAddresses();\r\n }\r\n return null;\r\n });\r\n }", "public boolean containsAddress(String address) {\n\t\treturn tseqnums.containsKey(address);\n\t}", "public void findEquivalentNamedNodes(String domsource){\n \t\tIndexHits<Node> hits = null;\n \t\tNode startnode = null;\n \ttry{\n \t\thits = ALLTAXA.getNodeIndex(NodeIndexDescription.TAX_SOURCES).get(\"source\", domsource);\n \t\tstartnode = hits.getSingle().getSingleRelationship(RelType.METADATAFOR, Direction.OUTGOING).getEndNode();//there should only be one source with that name\n \t}finally{\n \t\thits.close();\n \t}\n \tIndex<Node> taxNames = ALLTAXA.getNodeIndex(NodeIndexDescription.TAXON_BY_NAME);\n \t\n \tfor(Node curnode: TAXCHILDOF_TRAVERSAL.traverse(startnode).nodes()){\n \t\tIndexHits<Node> nhits = null;\n \t\tSystem.out.println((String)curnode.getProperty(\"name\")+\":\"+curnode);\n \t\ttry{\n \t\t\tnhits = taxNames.get(\"name\", (String)curnode.getProperty(\"name\"));\n \t\t\tfor (Node tnode: nhits){\n \t\t\t\tSystem.out.println(tnode);\n \t\t\t}\n \t\t}finally{\n \t\t\tnhits.close();\n \t\t}\n \t}\n }", "@NotNull\n List<Balance> balances(@NotNull List<String> addresses) throws EtherScanException;", "public void listAll(List<Address> AddressList) {\n for (Address a : AddressList) {\n console.promptForPrintPrompt(a.toString());\n }\n }", "Collection lookupTransactions(String email);", "boolean hasHasAddress();", "public List<Address> getAddresses()\n\t{\n\t\treturn getAddresses( getSession().getSessionContext() );\n\t}", "<T> Set<T> lookupAll(Class<T> type);", "Object getTaxes(Address shippingAddress, String itemReferenceId, int quantity, Float price,\n String userId, Boolean submitTax);", "public List<XeBusDTO> getBusByTT(Integer TT) {\n String sql = \"select * from xe_bus where TT = ?;\";\n Object[] params = {TT};\n return jdbcTemplate.query(sql, new XeBusDTOMapper(), params);\n }", "public List<PeerAddress> all() {\n final List<PeerAddress> all = new ArrayList<PeerAddress>();\n for (final Map<Number160, PeerStatistic> map : peerMapVerified) {\n synchronized (map) {\n for (PeerStatistic peerStatistic : map.values()) {\n all.add(peerStatistic.peerAddress());\n }\n }\n }\n return all;\n }", "private Response getAddressList( String term )\n {\n\n ReferenceList list = null;\n try\n {\n if ( \"RestAddressService\".equals( AddressServiceProvider.getInstanceClass( ) ) )\n {\n list = AddressServiceProvider.searchAddress( null, term );\n }\n\n }\n catch( RemoteException e )\n {\n AppLogService.error( e );\n }\n\n if ( list == null )\n {\n _logger.error( Constants.ERROR_NOT_FOUND_RESOURCE );\n return Response.status( Response.Status.NOT_FOUND )\n .entity( JsonUtil.buildJsonResponse( new ErrorJsonResponse( Response.Status.NOT_FOUND.name( ), MSG_ERROR_GET_ADDRESSES ) ) ).build( );\n }\n\n return Response.status( Response.Status.OK ).entity( JsonUtil.buildJsonResponse( new JsonResponse( list ) ) ).build( );\n }", "@Override\r\n\tpublic ArrayList<UserClass> readUsers(String address) {\n\t\treturn null;\r\n\t}", "public static String look_for_any_node(final Context context,final String subnet) {\n String host;\n for (int i = 98; i < 255; i++) {\n host = subnet + i;\n try {\n MyClientTask myClientTask = new MyClientTask(\n context,\n NodeDB.getNode_db(context),\n host,\n 2121,\n new RequestObj(\"HeartBeat\", null).toString());\n String rs = myClientTask.sendData();\n\n if (rs.contains(\"HeartBeat\")){\n return host;\n }\n\n\n\n } catch (Exception e) {\n e.printStackTrace();\n }\n }\n return null;\n\n }", "public Transaction[] handleTxs(Transaction[] possibleTxs) {\n // IMPLEMENT THIS\n if(possibleTxs == null)\n return new Transaction[0];\n \n ArrayList<Transaction> validTxs = new ArrayList<>();\n \n //iterate through each transaction, validate, remove spent UTXO, add new UTXO\n for(int i = 0; i < possibleTxs.length; i++){\n \n //validate tx\n if(isValidTx(possibleTxs[i])){\n possibleTxs[i].finalize();\n validTxs.add(possibleTxs[i]);\n \n //remove valid/spent UTXOs from current pool\n for(Transaction.Input x:possibleTxs[i].getInputs()){\n UTXO inputUTXO = new UTXO(x.prevTxHash, x.outputIndex);\n currentPool.removeUTXO(inputUTXO);\n }\n \n //add new UTXOs to current pool\n int utxoIndex = 0;\n for(Transaction.Output x:possibleTxs[i].getOutputs()){\n UTXO outputUTXO = new UTXO(possibleTxs[i].getHash(), utxoIndex);\n currentPool.addUTXO(outputUTXO, x);\n utxoIndex++;\n }\n \n }\n }\n \n //return list of validated \n Transaction[] validatedTxs = new Transaction[validTxs.size()];\n \n validatedTxs = validTxs.toArray(validatedTxs);\n \n return validatedTxs;\n }", "public InetAddress[] lookup(String name) throws UnknownHostException\n {\n InetAddress[] addrs=null;\n \n synchronized(this.host2ipaddress)\n {\n addrs=this.host2ipaddress.get(name);\n \n if (addrs==null)\n {\n addrs= null; // dns.lookupAllHostAddr(name);\n if (addrs!=null)\n host2ipaddress.put(name,addrs); \n }\n }\n \n synchronized(ipadress2host)\n {\n\n // store reverse ass well !\n for (InetAddress addr:addrs)\n {\n String ipstr=ip2string(addr.getAddress()); \n StringList hostlist=this.ipadress2host.get(ipstr);\n if (hostlist==null)\n hostlist=new StringList(); \n\n hostlist.addUnique(name); \n this.ipadress2host.put(ipstr,hostlist); \n }\n }\n \n return addrs;\n }", "public boolean containsAddress(String address)\n {\n boolean hasAddr = false;\n //Scan addresses for this address\n address = Numeric.cleanHexPrefix(address);\n for (String thisAddr : addresses)\n {\n if (thisAddr != null && thisAddr.contains(address))\n {\n hasAddr = true;\n break;\n }\n }\n\n return hasAddr;\n }", "java.lang.String getAddress();", "java.lang.String getAddress();", "java.lang.String getAddress();", "java.lang.String getAddress();", "java.lang.String getAddress();", "java.lang.String getAddress();", "@Override\r\n\tpublic List<Address> findAll() {\r\n\t\tDAOJDBC DAOJDBCModel = new DAOJDBC();\r\n\t\tStatement sqlStatement = null;\r\n\t\tList<Address> arrayList = new ArrayList<>();\r\n\t\t\r\n\t\tResultSet array = DAOJDBCModel.multiCallReturn(\"SELECT * FROM address;\", sqlStatement);\r\n\t\t\r\n\t\ttry {\r\n\t\t\twhile(array.next()) {\r\n\t\t\t\tarrayList.add(new Address(array.getInt(\"id\"), array.getString(\"street\"), array.getString(\"district\"),\r\n\t\t\t\t\t\tarray.getInt(\"number\"), array.getString(\"note\"))); \r\n\t\t\t}\r\n\t\t\t\r\n\t\t\treturn arrayList;\r\n\t\t} catch (SQLException e) {\r\n\t\t\te.printStackTrace();\r\n\t\t} finally {\r\n\t\t\tDB.closeStatament(sqlStatement);\r\n\t\t}\r\n\t\t\r\n\t\treturn null;\r\n\t}", "protected String maskTopLevelDomainByX(String address) {\n StringBuilder sb = new StringBuilder(address);\n int splitAddress = address.indexOf('@');\n ArrayList<Integer> indexes = getPointPostions(address, splitAddress);\n\n Character maskingCrct = getMaskingCharacter();\n\n for (Integer index : indexes) {\n for (int i = splitAddress + 1; i < index; i++)\n sb.setCharAt(i, maskingCrct);\n splitAddress = index;\n }\n return sb.toString();\n }", "@GET\n\t\t\t@Path(\"/{id}/address\")\n\t\t\t@Produces({\"application/xml\"})\n\t\t\tpublic Rows getAddressRows(@Context UriInfo uriInfo,@Context HttpHeaders header) {\n\t\t\t\tRows rows = null;\n\t\t\t\ttry {\n\t\t\t\t\trows=new WarehouseDao(uriInfo,header).getAddressRows();\n\t\t\t\t} catch (AuthenticationException e) {\n\t\t\t\t\t rows=new TemplateUtility().getFailedMessage(e.getMessage());\n\t\t\t\t\t e.printStackTrace();\n\t\t\t\t} catch (Exception ex) {\n\t\t\t\t\tlogger.info( \"Error calling getAddressRows()\"+ ex.getMessage());\n\t\t\t\t}\n\t\t\t\treturn rows;\n\t\t\t}", "public List<String> findActiveCongestionPointAddresses(LocalDate period) {\n return congestionPointConnectionGroupRepository.findActiveCongestionPointConnectionGroup(period).stream()\n .map(ConnectionGroup::getUsefIdentifier).collect(Collectors.toList());\n }", "protected List<Type> getAllTNS(Map<String, Type> localMap, String tnsType){\r\n\t\r\n\t\tList<Type> types=new ArrayList<Type>();\r\n\t\tif(tnsType.startsWith(\"tns:\")){\r\n\t\t\r\n\t\tString tnsName=tnsType.substring(tnsType.indexOf(\":\")+1);\r\n\t\tif(localMap.containsKey(tnsName.trim())){\r\n\t\t\t\t\r\n\t\t\tType originalComplex=localMap.get(tnsName.trim());\r\n\t\tif(originalComplex instanceof SequenceType){\t\r\n\t\t\tSequenceType t1=(SequenceType)originalComplex;\t\r\n\t\t\treturn t1.getElements();\r\n\t\t}\r\n\t\tif(originalComplex instanceof ChoiceType){\r\n\t\t\t\t\t\r\n\t\t\tChoiceType t2=(ChoiceType)originalComplex;\r\n\t\t\treturn t2.getElements();\r\n\t\t}\r\n\t\tif(originalComplex instanceof AllComplexType){\r\n\t\t\t\t\t\r\n\t\t\tAllComplexType t3=(AllComplexType)originalComplex;\r\n\t\t\treturn t3.getElements();\r\n\t\t}\r\n\t}\t \r\n\t} \r\n\t\treturn types; //will always be an empty set.\r\n\t}", "@Override\n protected List<Address> doInBackground(String... locationName) {\n Geocoder geocoder = new Geocoder(getBaseContext());\n List<Address> addresses = null;\n\n try {\n // Getting a maximum of 10 Address that matches the input text\n addresses = geocoder.getFromLocationName(locationName[0], 10);\n\n } catch (IOException e) {\n e.printStackTrace();\n }\n return addresses;\n }", "public static ArrayList<MacAddressDatabaseObject> getAllMacAddress() {\n\t\tEntityManagerFactory entityManagerFactory = LocalizationDataManager\n\t\t\t\t.getEntityManagerFactory();\n\t\tEntityManager createEntityManager = entityManagerFactory\n\t\t\t\t.createEntityManager();\n\t\tString query = \"Select * from mac_address where true\";\n\t\tQuery createQuery = createEntityManager.createNativeQuery(query,\n\t\t\t\tMacAddressDatabaseObject.class);\n\t\t@SuppressWarnings(\"unchecked\")\n\t\tList<MacAddressDatabaseObject> resultList = createQuery.getResultList();\n\n\t\treturn new ArrayList<MacAddressDatabaseObject>(resultList);\n\t}", "@Override\r\n\tpublic List<Map<String, String>> selectAddressList() {\n\t\treturn ado.selectAddressList();\r\n\t}", "private String parseAddresses(Address[] address) {\n String listAddress = \"\";\n\n if (address != null) {\n for (int i = 0; i < address.length; i++) {\n listAddress += address[i].toString() + \", \";\n }\n }\n if (listAddress.length() > 1) {\n listAddress = listAddress.substring(0, listAddress.length() - 2);\n }\n\n return listAddress;\n }", "private Set<Host> getHosts(StaticPacketTrace trace) {\n IPCriterion ipv4Criterion = ((IPCriterion) trace.getInitialPacket()\n .getCriterion(Criterion.Type.IPV4_DST));\n IPCriterion ipv6Criterion = ((IPCriterion) trace.getInitialPacket()\n .getCriterion(Criterion.Type.IPV6_DST));\n Set<Host> hosts = new HashSet<>();\n if (ipv4Criterion != null) {\n hosts.addAll(hostNib.getHostsByIp(ipv4Criterion.ip().address()));\n }\n if (ipv6Criterion != null) {\n hosts.addAll(hostNib.getHostsByIp(ipv6Criterion.ip().address()));\n }\n EthCriterion ethCriterion = ((EthCriterion) trace.getInitialPacket()\n .getCriterion(Criterion.Type.ETH_DST));\n if (ethCriterion != null) {\n hosts.addAll(hostNib.getHostsByMac(ethCriterion.mac()));\n }\n return hosts;\n }", "@Override\r\n\tpublic List<Adress> findAllAdress() {\n\t\treturn em.createNamedQuery(\"findAllAdress\", Adress.class).getResultList();\r\n\t}", "@NotNull\n List<Block> blocksMined(@NotNull String address) throws EtherScanException;", "String getAddress();", "String getAddress();", "public void resolveAddress(){\n for(int i = 0; i < byteCodeList.size(); i++){\n if(byteCodeList.get(i) instanceof LabelCode){\n LabelCode code = (LabelCode)byteCodeList.get(i);\n labels.put(code.getLabel(), i);\n }else if(byteCodeList.get(i) instanceof LineCode){\n LineCode code = (LineCode)byteCodeList.get(i);\n lineNums.add(code.n);\n }\n }\n \n //walk through byteCodeList and assgin proper address\n for(int i = 0; i < byteCodeList.size(); i++){\n if(byteCodeList.get(i) instanceof GoToCode){\n GoToCode code = (GoToCode)byteCodeList.get(i);\n code.setNum((Integer)labels.get(code.getLabel()));\n }else if(byteCodeList.get(i) instanceof FalseBranchCode){\n FalseBranchCode code = (FalseBranchCode)byteCodeList.get(i);\n code.setNum((Integer)labels.get(code.getLabel()));\n }else if(byteCodeList.get(i) instanceof CallCode){\n CallCode code = (CallCode)byteCodeList.get(i);\n code.setNum((Integer)labels.get(code.getFuncName()));\n }\n }\n }", "@Override\n protected List<Address> doInBackground(String... locationName) {\n Geocoder geocoder = new Geocoder(getBaseContext());\n List<Address> addresses = null;\n\n try {\n // Getting a maximum of 3 Address that matches the input text\n addresses = geocoder.getFromLocationName(locationName[0], 3);\n } catch (IOException e) {\n e.printStackTrace();\n }\n return addresses;\n }", "<T extends View> List<T> findByCadd(String addrs,Class<T> clzz);", "public org.apache.xmlbeans.XmlString xgetFromAddress()\n {\n synchronized (monitor())\n {\n check_orphaned();\n org.apache.xmlbeans.XmlString target = null;\n target = (org.apache.xmlbeans.XmlString)get_store().find_element_user(FROMADDRESS$6, 0);\n return target;\n }\n }", "public void getTowns(SecurityUserBaseinfoForm form) {\n\t\tString[] tempIds = null;\r\n\t\tString[] tempNames = null;\r\n\t\tList<?> list = null;\r\n//\t\tcommCltIds & commCltNames;\r\n\t\tif(form.getCommConfigLocationTownId() != null && form.getCommConfigLocationTownId().trim().length() > 0){\r\n\t\t\tlist = this.getSecurityUserBaseinfoDAO().getTownsByParent(form.getCommConfigLocationTownId().trim());\r\n\t\t\tif(list != null && list.size() > 0){\r\n\t\t\t\ttempIds = new String[list.size()+1];\r\n\t\t\t\ttempNames = new String[list.size()+1];\r\n\t\t\t\ttempIds[0] = \"\";\r\n\t\t\t\ttempNames[0] = \"\";\r\n\t\t\t\tfor(int i=0; i<list.size(); i++){\r\n\t\t\t\t\tCommConfigLocationTown town = (CommConfigLocationTown)list.get(i);\r\n\t\t\t\t\ttempIds[i+1] = this.transNullToString(town.getId());\r\n\t\t\t\t\ttempNames[i+1] = this.transNullToString(town.getItemName());\r\n\t\t\t\t}\r\n\t\t\t\tform.setCommConfigLocationTownIds(tempIds);\r\n\t\t\t\tform.setCommConfigLocationTownId_names(tempNames);\r\n\t\t\t}\r\n\t\t}\r\n\t}", "public SONETRouter(String address){\n\t\tsuper(address);\n\t}", "public List<Address> listAddress()\n {\n @SuppressWarnings(\"unchecked\")\n List<Address> result = this.sessionFactory.getCurrentSession().createQuery(\"from AddressImpl as address order by address.id asc\").list();\n\n return result;\n }", "@Override\r\n\t\t\tprotected List<Address> doInBackground(String... locationName) {\n\t\t\t\tGeocoder geocoder = new Geocoder(getBaseContext());\r\n\t\t\t\tList<Address> addresses = null;\r\n\t\t\t\t\r\n\t\t\t\ttry {\r\n\t\t\t\t\t// Getting a maximum of 3 Address that matches the input text\r\n\t\t\t\t\taddresses = geocoder.getFromLocationName(locationName[0], 3);\r\n\t\t\t\t} catch (IOException e) {\r\n\t\t\t\t\te.printStackTrace();\r\n\t\t\t\t}\t\t\t\r\n\t\t\t\treturn addresses;\r\n\t\t\t}", "public boolean isSetFromAddress()\n {\n synchronized (monitor())\n {\n check_orphaned();\n return get_store().count_elements(FROMADDRESS$6) != 0;\n }\n }", "public void list() {\r\n\t\tfor (String key : nodeMap.keySet()) {\r\n\t\t\tNodeRef node = nodeMap.get(key);\r\n\t\t\tSystem.out.println(node.getIp() + \" : \" + node.getPort());\r\n\t\t}\t\t\r\n\t}" ]
[ "0.68307215", "0.6115226", "0.5884739", "0.5772939", "0.5531937", "0.5370782", "0.5338363", "0.5307583", "0.5270597", "0.52335244", "0.5199351", "0.518301", "0.517238", "0.5106821", "0.51031923", "0.5060269", "0.5030228", "0.49829155", "0.496936", "0.49516228", "0.49421763", "0.49386498", "0.48873556", "0.4851178", "0.48501933", "0.48496103", "0.48400995", "0.48280507", "0.48202205", "0.48089504", "0.48071426", "0.48070905", "0.47767353", "0.4767957", "0.4735071", "0.47320512", "0.4731442", "0.4729135", "0.47098944", "0.47072795", "0.47057542", "0.47027108", "0.47004265", "0.46978894", "0.46903428", "0.468369", "0.468369", "0.46804535", "0.46751618", "0.467428", "0.46510416", "0.46486762", "0.46459025", "0.4621693", "0.4618123", "0.4597536", "0.45782316", "0.45782134", "0.4574231", "0.45584702", "0.4555756", "0.4541059", "0.4532895", "0.4532626", "0.45152602", "0.4514655", "0.45091677", "0.45085073", "0.45024347", "0.44892633", "0.44836992", "0.44836992", "0.44836992", "0.44836992", "0.44836992", "0.44836992", "0.44808406", "0.4467516", "0.4459086", "0.44561914", "0.44489032", "0.44445038", "0.44393376", "0.4437132", "0.44325128", "0.44251508", "0.44220576", "0.44115174", "0.44028044", "0.44028044", "0.4388263", "0.43824312", "0.43797734", "0.43787375", "0.4377454", "0.43754417", "0.43743232", "0.4372146", "0.43715355", "0.43654343" ]
0.7053749
0
All internal txs for given address
@NotNull List<TxInternal> txsInternal(@NotNull String address, long startBlock, long endBlock) throws EtherScanException;
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@NotNull\n List<Tx> txs(@NotNull String address, long startBlock, long endBlock) throws EtherScanException;", "@NotNull\n List<TxErc721> txsErc721(@NotNull String address, long startBlock, long endBlock) throws EtherScanException;", "@NotNull\n List<TxInternal> txsInternalByHash(@NotNull String txhash) throws EtherScanException;", "@NotNull\n List<TxErc721> txsErc721(@NotNull String address, @NotNull String contractAddress, long startBlock, long endBlock)\n throws EtherScanException;", "@NotNull\n List<TxErc20> txsErc20(@NotNull String address, long startBlock, long endBlock) throws EtherScanException;", "@NotNull\n List<TxErc1155> txsErc1155(@NotNull String address, long startBlock, long endBlock) throws EtherScanException;", "public static java.util.List<com.ifl.rapid.customer.model.CRM_Trn_Address> findAll()\n\t\tthrows com.liferay.portal.kernel.exception.SystemException {\n\t\treturn getPersistence().findAll();\n\t}", "@Override\n\tpublic List<Address> FindAllAddress() {\n\t\treturn ab.FindAll();\n\t}", "public Vector<NetworkAddress> getHostAddresses(int type) {return addressesChecker.getAllMyAddresses(type); }", "public List<Address> getAllAddresses() throws BackendException;", "@Override\n public List<UTXO> getOpenTransactionOutputs(List<Address> addresses) throws UTXOProviderException {\n\n List<UTXO> results = new LinkedList<UTXO>();\n for (Address a : addresses) {\n ByteBuffer bb = ByteBuffer.allocate(21);\n bb.put((byte) KeyType.ADDRESS_HASHINDEX.ordinal());\n bb.put(a.getHash160());\n\n ReadOptions ro = new ReadOptions();\n Snapshot sn = db.getSnapshot();\n ro.snapshot(sn);\n\n // Scanning over iterator very fast\n\n DBIterator iterator = db.iterator(ro);\n for (iterator.seek(bb.array()); iterator.hasNext(); iterator.next()) {\n ByteBuffer bbKey = ByteBuffer.wrap(iterator.peekNext().getKey());\n bbKey.get(); // remove the address_hashindex byte.\n byte[] addressKey = new byte[20];\n bbKey.get(addressKey);\n if (!Arrays.equals(addressKey, a.getHash160())) {\n break;\n }\n byte[] hashBytes = new byte[32];\n bbKey.get(hashBytes);\n int index = bbKey.getInt();\n Sha256Hash hash = Sha256Hash.wrap(hashBytes);\n UTXO txout;\n try {\n // TODO this should be on the SNAPSHOT too......\n // this is really a BUG.\n txout = getTransactionOutput(hash, index);\n } catch (BlockStoreException e) {\n throw new UTXOProviderException(\"block store execption\", e);\n }\n if (txout != null) {\n Script sc = txout.getScript();\n Address address = sc.getToAddress(params, true);\n UTXO output = new UTXO(txout.getHash(), txout.getIndex(), txout.getValue(), txout.getHeight(),\n txout.isCoinbase(), txout.getScript(), address.toString());\n results.add(output);\n }\n }\n try {\n iterator.close();\n ro = null;\n sn.close();\n sn = null;\n } catch (IOException e) {\n log.error(\"Error closing snapshot/iterator?\", e);\n }\n }\n return results;\n }", "@Override\n public List<StaticPacketTrace> pingAll(EtherType type) {\n ImmutableList.Builder<StaticPacketTrace> tracesBuilder = ImmutableList.builder();\n hostNib.getHosts().forEach(host -> {\n List<IpAddress> ipAddresses = getIpAddresses(host, type, false);\n if (ipAddresses.size() > 0) {\n //check if the host has only local IPs of that ETH type\n boolean onlyLocalSrc = ipAddresses.size() == 1 && ipAddresses.get(0).isLinkLocal();\n hostNib.getHosts().forEach(hostToPing -> {\n List<IpAddress> ipAddressesToPing = getIpAddresses(hostToPing, type, false);\n //check if the other host has only local IPs of that ETH type\n boolean onlyLocalDst = ipAddressesToPing.size() == 1 && ipAddressesToPing.get(0).isLinkLocal();\n boolean sameLocation = Sets.intersection(host.locations(), hostToPing.locations()).size() > 0;\n //Trace is done only if they are both local and under the same location\n // or not local and if they are not the same host.\n if (((sameLocation && onlyLocalDst && onlyLocalSrc) ||\n (!onlyLocalSrc && !onlyLocalDst && ipAddressesToPing.size() > 0))\n && !host.equals(hostToPing)) {\n tracesBuilder.addAll(trace(host.id(), hostToPing.id(), type));\n }\n });\n }\n });\n return tracesBuilder.build();\n }", "AllUsersAddresses getAllUsersAddresses();", "List<AcHost> all() throws Throwable;", "public StringList lookupAddresses(String name) throws UnknownHostException\n {\n StringList names=new StringList(); \n // cached lookup \n InetAddress[] addres = lookup(name); \n \n for (InetAddress addr:addres)\n {\n // only add unique address\n names.add(addr.getHostAddress(),true); // getHostName()); \n }\n \n return names; \n }", "public static void printAllTaxiInfo(){\n\t\tfor(int i=0;i<TOTAL_TAXI;i++){\n\t\t\tprintTaxiInfo(i);\n\t\t}\n\t}", "@NotNull\n List<TxErc20> txsErc20(@NotNull String address, @NotNull String contractAddress, long startBlock, long endBlock)\n throws EtherScanException;", "public AddressList listAllAddresses(String addressBook)\n\t{\n\t\treturn controller.listAllAddresses(addressBook);\n\t}", "@NotNull\n List<TxErc1155> txsErc1155(@NotNull String address, @NotNull String contractAddress, long startBlock, long endBlock)\n throws EtherScanException;", "List<?> getAddress();", "private void requestAddresses(byte nAddr) throws Exception {\n final HashSet<Inet4Address> addrs = new HashSet<>();\n byte[] hwAddrBytes = new byte[] { 8, 4, 3, 2, 1, 0 };\n for (byte i = 0; i < nAddr; i++) {\n hwAddrBytes[5] = i;\n MacAddress newMac = MacAddress.fromBytes(hwAddrBytes);\n final String hostname = \"host_\" + i;\n final DhcpLease lease = mRepo.getOffer(CLIENTID_UNSPEC, newMac,\n IPV4_ADDR_ANY /* relayAddr */, INETADDR_UNSPEC /* reqAddr */, hostname);\n\n assertNotNull(lease);\n assertEquals(newMac, lease.getHwAddr());\n assertEquals(hostname, lease.getHostname());\n assertTrue(format(\"Duplicate address allocated: %s in %s\", lease.getNetAddr(), addrs),\n addrs.add(lease.getNetAddr()));\n\n requestLeaseSelecting(newMac, lease.getNetAddr(), hostname);\n }\n }", "public Transaction[] handleTxs(Transaction[] possibleTxs) {\n // IMPLEMENT THIS\n List<Transaction> validTxs = new ArrayList<>();\n for (Transaction tx : possibleTxs) {\n if (isValidTx(tx)) {\n validTxs.add(tx);\n ArrayList<Transaction.Output> outputs = tx.getOutputs();\n for (int idx = 0; idx < outputs.size(); idx++) {\n UTXO utxo = new UTXO(tx.getHash(), idx);\n utxoPool.addUTXO(utxo, outputs.get(idx));\n }\n }\n }\n\n return validTxs.toArray(new Transaction[0]);\n }", "String getAddress(int type);", "public abstract List<String> associateAddresses(NodeMetadata node);", "public List<Address> getAllAddressesByName(String user_name) {\n\t\tList<Address> address = new ArrayList<>();\r\n\t\taddressdao.findByUserUsername(user_name)\r\n\t\t.forEach(address::add);\r\n\t\treturn address;\r\n\t}", "private List<Messages.Address> mapModelAddressToWireAddress(List<byte[]> addresses) {\n return addresses.stream().map(address -> Messages.Address.newBuilder()\n .setPort(6565)\n .setIpAddress(ByteString.copyFrom(address))\n .build())\n .collect(Collectors.toList());\n }", "io.envoyproxy.envoy.data.dns.v3.DnsTable.AddressList getAddressList();", "private static void getAllReplicaAddress(String fileName) throws IOException {\n\n\t\tSystem.out.println(\"Working Directory = \" +\n\t System.getProperty(\"user.dir\"));\n\t\tBufferedReader br = new BufferedReader(new FileReader(fileName));\n\t\ttry {\n\t\t\tString line = br.readLine();\n\t\t\t\n\t\t while(line!=null && !line.trim().equals(\"\")) {\n\t\t \tallReplicaAddrs.add(line);\n\t\t \tline = br.readLine();\n\t\t }\n\t\t \n\t\t} finally {\n\t\t br.close();\n\t\t}\n\t}", "@Override\n\tpublic List<AddressDTO> viewAllAddress(String userId) throws RetailerException, ConnectException {\n\t\tList<AddressDTO> allAddress = new ArrayList<AddressDTO>();\n\t\tConnection connection = null;\n\t\ttry {\n\n\t\t\tconnection = DbConnection.getInstance().getConnection();\n\t\t\texceptionProps = PropertiesLoader.loadProperties(EXCEPTION_PROPERTIES_FILE);\n\t\t\tgoProps = PropertiesLoader.loadProperties(GO_PROPERTIES_FILE);\n\t\t\tPreparedStatement smt = connection.prepareStatement(QuerryMapper.GET_USER_ADDRESSS);\n\t\t\tsmt.setString(1, userId);\n\t\t\tResultSet resultSet = smt.executeQuery();\n\t\t\twhile (resultSet.next()) {\n\t\t\t\tString addressId = resultSet.getString(1);\n\t\t\t\tString city = resultSet.getString(3);\n\t\t\t\tString state = resultSet.getString(4);\n\t\t\t\tString zip = resultSet.getString(5);\n\t\t\t\tString building_no = resultSet.getString(6);\n\t\t\t\tString country = resultSet.getString(7);\n\t\t\t\tboolean addressStatus = resultSet.getBoolean(8);\n\t\t\t\tAddressDTO address = new AddressDTO(addressId, userId, city, state, zip, building_no, country,\n\t\t\t\t\t\taddressStatus);\n\t\t\t\tallAddress.add(address);\n\t\t\t}\n\t\t} catch (DatabaseException | SQLException | IOException e) {\n\t\t\tGoLog.logger.error(e.getMessage());\n\t\t\tthrow new RetailerException(exceptionProps.getProperty(\"view_address_error\") + \" >>> \" + e.getMessage());\n\t\t} finally {\n\t\t\ttry {\n\t\t\t\tconnection.close();\n\t\t\t} catch (SQLException e) {\n\n\t\t\t\tthrow new ConnectException(Constants.connectionError);\n\t\t\t}\n\t\t}\n\t\treturn allAddress;\n\n\t}", "@Override\n\tpublic List findAll()\n\t{\n\t\treturn teataskMapper.findAll();\n\t}", "protected List<Type> getAllTNS(Map<String, Type> localMap, String tnsType){\r\n\t\r\n\t\tList<Type> types=new ArrayList<Type>();\r\n\t\tif(tnsType.startsWith(\"tns:\")){\r\n\t\t\r\n\t\tString tnsName=tnsType.substring(tnsType.indexOf(\":\")+1);\r\n\t\tif(localMap.containsKey(tnsName.trim())){\r\n\t\t\t\t\r\n\t\t\tType originalComplex=localMap.get(tnsName.trim());\r\n\t\tif(originalComplex instanceof SequenceType){\t\r\n\t\t\tSequenceType t1=(SequenceType)originalComplex;\t\r\n\t\t\treturn t1.getElements();\r\n\t\t}\r\n\t\tif(originalComplex instanceof ChoiceType){\r\n\t\t\t\t\t\r\n\t\t\tChoiceType t2=(ChoiceType)originalComplex;\r\n\t\t\treturn t2.getElements();\r\n\t\t}\r\n\t\tif(originalComplex instanceof AllComplexType){\r\n\t\t\t\t\t\r\n\t\t\tAllComplexType t3=(AllComplexType)originalComplex;\r\n\t\t\treturn t3.getElements();\r\n\t\t}\r\n\t}\t \r\n\t} \r\n\t\treturn types; //will always be an empty set.\r\n\t}", "public List<Address> getAddresses(final SessionContext ctx)\n\t{\n\t\tList<Address> coll = (List<Address>)getProperty( ctx, ADDRESSES);\n\t\treturn coll != null ? coll : Collections.EMPTY_LIST;\n\t}", "public List<PeerAddress> all() {\n final List<PeerAddress> all = new ArrayList<PeerAddress>();\n for (final Map<Number160, PeerStatistic> map : peerMapVerified) {\n synchronized (map) {\n for (PeerStatistic peerStatistic : map.values()) {\n all.add(peerStatistic.peerAddress());\n }\n }\n }\n return all;\n }", "default List<ValidatorIndex> get_unslashed_attesting_indices(BeaconState state, List<PendingAttestation> attestations) {\n return attestations.stream()\n .flatMap(a -> get_attesting_indices(state, a.getData(), a.getAggregationBitfield()).stream())\n .distinct()\n .filter(i -> !state.getValidatorRegistry().get(i).getSlashed())\n .sorted()\n .collect(Collectors.toList());\n }", "boolean hasAddress();", "boolean hasAddress();", "@Override\r\n\tpublic List<UserAddress> viewUserAddressList() {\r\n\t\tList<UserAddress> result = new ArrayList<UserAddress>();\r\n useraddressrepository.findAll().forEach(UserAddress1 -> result.add(UserAddress1));\r\n return result;\r\n\t}", "private void loadAddresses() {\n\t\ttry {\n\t\t\torg.hibernate.Session session = sessionFactory.getCurrentSession();\n\t\t\tsession.beginTransaction();\n\t\t\taddresses = session.createCriteria(Address.class).list();\n\t\t\tsession.getTransaction().commit();\n\t\t\tSystem.out.println(\"Retrieved addresses from database:\"\n\t\t\t\t\t+ addresses.size());\n\t\t} catch (Throwable ex) {\n\t\t\tSystem.err.println(\"Can't retrieve address!\" + ex);\n\t\t\tex.printStackTrace();\n\t\t\t// Initialize the message queue anyway\n\t\t\tif (addresses == null) {\n\t\t\t\taddresses = new ArrayList<Address>();\n\t\t\t}\n\t\t}\n\t}", "public List<Address> findAll();", "public static List<Address> GetAllRecordsFromTable() {\n\n return SQLite.select().from(Address.class).queryList();\n\n\n }", "public List<PeerAddress> allOverflow() {\n List<PeerAddress> all = new ArrayList<PeerAddress>();\n for (Map<Number160, PeerStatistic> map : peerMapOverflow) {\n synchronized (map) {\n for (PeerStatistic peerStatistic : map.values()) {\n all.add(peerStatistic.peerAddress());\n }\n }\n }\n return all;\n }", "protected void listTenants() {\n if (!MULTITENANT_FEATURE_ENABLED.contains(dbType)) {\n return;\n }\n Db2Adapter adapter = new Db2Adapter(connectionPool);\n try (ITransaction tx = TransactionFactory.openTransaction(connectionPool)) {\n try {\n GetTenantList rtListGetter = new GetTenantList(adminSchemaName);\n List<TenantInfo> tenants = adapter.runStatement(rtListGetter);\n \n System.out.println(TenantInfo.getHeader());\n tenants.forEach(t -> System.out.println(t.toString()));\n } catch (DataAccessException x) {\n // Something went wrong, so mark the transaction as failed\n tx.setRollbackOnly();\n throw x;\n }\n }\n }", "protected String maskTopLevelDomainByX(String address) {\n StringBuilder sb = new StringBuilder(address);\n int splitAddress = address.indexOf('@');\n ArrayList<Integer> indexes = getPointPostions(address, splitAddress);\n\n Character maskingCrct = getMaskingCharacter();\n\n for (Integer index : indexes) {\n for (int i = splitAddress + 1; i < index; i++)\n sb.setCharAt(i, maskingCrct);\n splitAddress = index;\n }\n return sb.toString();\n }", "public List<UrlAddress> searchDBUrl() {\n log.info(new SimpleDateFormat(\"yyyy/MM/dd HH:mm:ss\").format(new Date()) + \"find all url address\");\n List<UrlAddress> all = urlRepository.findAll();\n return all;\n }", "public String getInternalAddress();", "public Transaction[] handleTxs(Transaction[] possibleTxs) {\n ArrayList<Transaction> validTransactions = new ArrayList<>();\n for (Transaction tx : possibleTxs){\n if (isValidTx(tx)){\n validTransactions.add(tx);\n consumePoolCoins(tx);\n createPoolCoins(tx);\n }\n }\n return validTransactions.toArray(new Transaction[validTransactions.size()]);\n }", "<T> Set<T> lookupAll(Class<T> type);", "@Override\n\tpublic List<Address> getAddressListByUserid(int userid) {\n\t\treturn sqlSessionTemplate.selectList(sqlId(\"getAddressByUserId\"),userid);\n\t}", "public List<Address> getAddresses()\n\t{\n\t\treturn getAddresses( getSession().getSessionContext() );\n\t}", "@GetMapping()\n\t@Override\n\tpublic List<Address> findAll() {\n\t\treturn addressService.findAll();\n\t}", "public void resolveAddress(){\n for(int i = 0; i < byteCodeList.size(); i++){\n if(byteCodeList.get(i) instanceof LabelCode){\n LabelCode code = (LabelCode)byteCodeList.get(i);\n labels.put(code.getLabel(), i);\n }else if(byteCodeList.get(i) instanceof LineCode){\n LineCode code = (LineCode)byteCodeList.get(i);\n lineNums.add(code.n);\n }\n }\n \n //walk through byteCodeList and assgin proper address\n for(int i = 0; i < byteCodeList.size(); i++){\n if(byteCodeList.get(i) instanceof GoToCode){\n GoToCode code = (GoToCode)byteCodeList.get(i);\n code.setNum((Integer)labels.get(code.getLabel()));\n }else if(byteCodeList.get(i) instanceof FalseBranchCode){\n FalseBranchCode code = (FalseBranchCode)byteCodeList.get(i);\n code.setNum((Integer)labels.get(code.getLabel()));\n }else if(byteCodeList.get(i) instanceof CallCode){\n CallCode code = (CallCode)byteCodeList.get(i);\n code.setNum((Integer)labels.get(code.getFuncName()));\n }\n }\n }", "@Test\n\tpublic void listLocations(){\n\t\tList<Location> lists = locationService.queryLoctionsByLat(29.8679775, 121.5450105);\n\t\t//System.out.println(lists.size()) ;\n\t\tfor(Location loc : lists){\n\t\t\tSystem.out.println(loc.getAddress_cn());\n\t\t}\n\t}", "boolean hasAddressList();", "public void initOldRootTxs();", "public List<byte[]> getAllNodeInfo() {\n // Fetch a node list with protobuf bytes format from GCS.\n synchronized (GlobalStateAccessor.class) {\n validateGlobalStateAccessorPointer();\n return this.nativeGetAllNodeInfo(globalStateAccessorNativePointer);\n }\n }", "public void list() {\r\n\t\tfor (String key : nodeMap.keySet()) {\r\n\t\t\tNodeRef node = nodeMap.get(key);\r\n\t\t\tSystem.out.println(node.getIp() + \" : \" + node.getPort());\r\n\t\t}\t\t\r\n\t}", "public Data getDataContaining(Address addr);", "private static Set<InetSocketAddress> getNNAddresses(DistributedFileSystem fs,\n Configuration conf) {\n Set<InetSocketAddress> addresses = new HashSet<>();\n String serviceName = fs.getCanonicalServiceName();\n\n if (serviceName.startsWith(\"ha-hdfs\")) {\n try {\n Map<String, Map<String, InetSocketAddress>> addressMap =\n DFSUtil.getNNServiceRpcAddressesForCluster(conf);\n String nameService = serviceName.substring(serviceName.indexOf(\":\") + 1);\n if (addressMap.containsKey(nameService)) {\n Map<String, InetSocketAddress> nnMap = addressMap.get(nameService);\n for (Map.Entry<String, InetSocketAddress> e2 : nnMap.entrySet()) {\n InetSocketAddress addr = e2.getValue();\n addresses.add(addr);\n }\n }\n } catch (Exception e) {\n LOG.warn(\"DFSUtil.getNNServiceRpcAddresses failed. serviceName=\" + serviceName, e);\n }\n } else {\n URI uri = fs.getUri();\n int port = uri.getPort();\n if (port < 0) {\n int idx = serviceName.indexOf(':');\n port = Integer.parseInt(serviceName.substring(idx + 1));\n }\n InetSocketAddress addr = new InetSocketAddress(uri.getHost(), port);\n addresses.add(addr);\n }\n\n return addresses;\n }", "public void printAddress()\r\n {\r\n address.printAddress();\r\n }", "public void printAddress()\r\n {\r\n address.printAddress();\r\n }", "public void groupHostObjects(int addr) {\n\t\tfor(List<String> pkt : pkts) {\n\t\t\tif(!hosts.contains(pkt.get(addr)) && (!webPages.contains(pkt.get(addr)))) {\n\t\t\t\thosts.add(pkt.get(addr));\n\t\t\t}\n\n\t\t}\n\t}", "public InetAddress[] lookup(String name) throws UnknownHostException\n {\n InetAddress[] addrs=null;\n \n synchronized(this.host2ipaddress)\n {\n addrs=this.host2ipaddress.get(name);\n \n if (addrs==null)\n {\n addrs= null; // dns.lookupAllHostAddr(name);\n if (addrs!=null)\n host2ipaddress.put(name,addrs); \n }\n }\n \n synchronized(ipadress2host)\n {\n\n // store reverse ass well !\n for (InetAddress addr:addrs)\n {\n String ipstr=ip2string(addr.getAddress()); \n StringList hostlist=this.ipadress2host.get(ipstr);\n if (hostlist==null)\n hostlist=new StringList(); \n\n hostlist.addUnique(name); \n this.ipadress2host.put(ipstr,hostlist); \n }\n }\n \n return addrs;\n }", "public static ArrayList<MacAddressDatabaseObject> getAllMacAddress() {\n\t\tEntityManagerFactory entityManagerFactory = LocalizationDataManager\n\t\t\t\t.getEntityManagerFactory();\n\t\tEntityManager createEntityManager = entityManagerFactory\n\t\t\t\t.createEntityManager();\n\t\tString query = \"Select * from mac_address where true\";\n\t\tQuery createQuery = createEntityManager.createNativeQuery(query,\n\t\t\t\tMacAddressDatabaseObject.class);\n\t\t@SuppressWarnings(\"unchecked\")\n\t\tList<MacAddressDatabaseObject> resultList = createQuery.getResultList();\n\n\t\treturn new ArrayList<MacAddressDatabaseObject>(resultList);\n\t}", "protected void printAll() {\n\t\tSystem.out.println(\"Network maps\");\n\t\tSystem.out.println(\"\tAddresses\");\n\t\ttry {\n\t\t\tPreparedStatement pstmt = \n\t\t\t\t\tthis.agent.getDatabaseManager().getConnection().prepareStatement(\n\t\t\t\t\t\t\tthis.agent.getDatabaseManager().selectAll);\n\t ResultSet rs = pstmt.executeQuery();\n\t // loop through the result set\n while (rs.next()) {\n \t System.out.printf(\"%s -> %s\\n\", rs.getString(\"username\"), rs.getString(\"address\"));\n }\n\t\t} catch (Exception e) {\n\t\t\tAgent.errorMessage(\n\t\t\t\t\tString.format(\"ERROR when trying to get all the address of the table users in the database\\n\"), e);\n\t\t}\n\t\tSystem.out.println(\"\tmapSockets\");\n\t\tfor (String u: this.mapSockets.keySet()) {\n\t\t\tSystem.out.printf(\"%s -> %s\\n\", u, this.mapSockets.get(u));\n\t\t}\n\t}", "public org.apache.xmlbeans.XmlString xgetFromAddress()\n {\n synchronized (monitor())\n {\n check_orphaned();\n org.apache.xmlbeans.XmlString target = null;\n target = (org.apache.xmlbeans.XmlString)get_store().find_element_user(FROMADDRESS$6, 0);\n return target;\n }\n }", "boolean hasHasAddress();", "@Override\n public Map<Bytes32, Bytes> getAllAccountStorage(final Address address, final Hash rootHash) {\n final Map<Bytes32, Bytes> results = new HashMap<>();\n BonsaiLayeredWorldState currentLayer = this;\n while (currentLayer != null) {\n if (currentLayer.trieLog.hasStorageChanges(address)) {\n currentLayer\n .trieLog\n .streamStorageChanges(address)\n .forEach(\n entry -> {\n if (!results.containsKey(entry.getKey())) {\n final UInt256 value = entry.getValue().getUpdated();\n // yes, store the nulls. If it was deleted it should stay deleted\n results.put(entry.getKey(), value);\n }\n });\n }\n if (currentLayer.getNextWorldView().isEmpty()) {\n currentLayer = null;\n } else if (currentLayer.getNextWorldView().get() instanceof BonsaiLayeredWorldState) {\n currentLayer = (BonsaiLayeredWorldState) currentLayer.getNextWorldView().get();\n } else {\n final Account account = currentLayer.getNextWorldView().get().get(address);\n if (account != null) {\n account\n .storageEntriesFrom(Hash.ZERO, Integer.MAX_VALUE)\n .forEach(\n (k, v) -> {\n if (!results.containsKey(k)) {\n results.put(k, v.getValue());\n }\n });\n }\n currentLayer = null;\n }\n }\n return results;\n }", "public List<Address> getAllAddresses(long id) {\n\t\tList<Address> address = new ArrayList<>();\r\n\t\taddressdao.findByUserUId(id)\r\n\t\t.forEach(address::add);\r\n\t\treturn address;\r\n\t}", "public void setAddresses(List<Address> addresses) {\r\n\r\n this.addresses = addresses;\r\n\r\n }", "public void unsetFromAddress()\n {\n synchronized (monitor())\n {\n check_orphaned();\n get_store().remove_element(FROMADDRESS$6, 0);\n }\n }", "void clearAddress() {\n mAddress = HdmiCec.ADDR_UNREGISTERED;\n }", "@Override\n public final void lookupAPI(int address) {\n }", "@Override\r\n\tpublic ArrayList<UserClass> readUsers(String address) {\n\t\treturn null;\r\n\t}", "public static String[] getAllPrivateAddress() {\n\t\tArrayList<String> a = new ArrayList<String>();\n\t\ttry {\n\t\t\tEnumeration<NetworkInterface> enums = NetworkInterface.getNetworkInterfaces();\n\t\t\twhile (enums.hasMoreElements()) {\n\t\t\t\tNetworkInterface ni = enums.nextElement();\n\t\t\t\tEnumeration<InetAddress> hosts = ni.getInetAddresses();\n\t\t\t\twhile (hosts.hasMoreElements()) {\n\t\t\t\t\tInetAddress local = hosts.nextElement();\n\t\t\t\t\tString localIP = local.getHostAddress();\n\t\t\t\t\tif (IP4Style.isPrivateIP(localIP)) {\n\t\t\t\t\t\ta.add(localIP);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t} catch (SocketException exp) {\n\n\t\t}\n\t\tif(a.isEmpty()) return null;\n\t\tString[] all = new String[a.size()];\n\t\treturn a.toArray(all);\n\t}", "public void setInternalAddress(String address);", "@Override\n\tpublic List<AddressChangeReqDetails> findAll() throws SystemException {\n\t\treturn findAll(QueryUtil.ALL_POS, QueryUtil.ALL_POS, null);\n\t}", "public void setAddresses(List<String> addresses) {\n this.addresses = addresses;\n }", "public void listing() {\r\n int count = 1;\r\n for (AdressEntry i : addressEntryList) {\r\n System.out.print(count + \": \");\r\n System.out.println(i);\r\n count++;\r\n }\r\n System.out.println();\r\n }", "org.jacorb.imr.HostInfo[] list_hosts();", "Object getTaxes(Address shippingAddress, String itemReferenceId, int quantity, Float price,\n String userId, Boolean submitTax);", "public String getExternalAddress();", "<T> void lookupAll(Class<T> type, Collection<T> out);", "private Response getAddressList( String term )\n {\n\n ReferenceList list = null;\n try\n {\n if ( \"RestAddressService\".equals( AddressServiceProvider.getInstanceClass( ) ) )\n {\n list = AddressServiceProvider.searchAddress( null, term );\n }\n\n }\n catch( RemoteException e )\n {\n AppLogService.error( e );\n }\n\n if ( list == null )\n {\n _logger.error( Constants.ERROR_NOT_FOUND_RESOURCE );\n return Response.status( Response.Status.NOT_FOUND )\n .entity( JsonUtil.buildJsonResponse( new ErrorJsonResponse( Response.Status.NOT_FOUND.name( ), MSG_ERROR_GET_ADDRESSES ) ) ).build( );\n }\n\n return Response.status( Response.Status.OK ).entity( JsonUtil.buildJsonResponse( new JsonResponse( list ) ) ).build( );\n }", "public abstract List<Patient> getAllPatientNode();", "protected abstract Node[] getAllNodes();", "@Test\n public void testAddress()\n {\n System.out.println(\"address\");\n int addr = 16893;\n System.out.println(N2TCode.address(addr));\n System.out.println(Integer.toBinaryString(addr));\n }", "public Call<ExpResult<List<DelegationInfo>>> getDelegations(MinterAddress address) {\n checkNotNull(address, \"Address can't be null\");\n\n return getInstantService().getDelegationsForAddress(address.toString(), 1);\n }", "public List<Address> listAddress()\n {\n @SuppressWarnings(\"unchecked\")\n List<Address> result = this.sessionFactory.getCurrentSession().createQuery(\"from AddressImpl as address order by address.id asc\").list();\n\n return result;\n }", "public boolean isSetFromAddress()\n {\n synchronized (monitor())\n {\n check_orphaned();\n return get_store().count_elements(FROMADDRESS$6) != 0;\n }\n }", "public AddressComponent[] getAddressComponents() {\n return addressComponents;\n }", "public String getNatAddress();", "abstract void addressValidity();", "public NodeInformation[] getNodes() throws CassandraServerManagementException {\r\n StorageServiceMBean ssMBean = null;\r\n try {\r\n ssMBean = CassandraAdminDataHolder\r\n .getInstance().getCassandraMBeanLocator().locateStorageServiceMBean();\r\n } catch (CassandraServerManagementException e) {\r\n handleException(\"Error occurred while retrieving node information list\", e);\r\n }\r\n\r\n if (ssMBean == null) {\r\n handleException(\"Storage Server MBean is null\");\r\n }\r\n\r\n Map<String, String> tokenToEndpoint = ssMBean.getTokenToEndpointMap();\r\n List<String> sortedTokens = new ArrayList<String>(tokenToEndpoint.keySet());\r\n Collections.sort(sortedTokens);\r\n\r\n /* Calculate per-token ownership of the ring */\r\n Map<InetAddress, Float> ownerships = ssMBean.getOwnership();\r\n\r\n List<NodeInformation> nodeInfoList = new ArrayList<NodeInformation>();\r\n for (String token : sortedTokens) {\r\n String primaryEndpoint = tokenToEndpoint.get(token);\r\n String status = ssMBean.getLiveNodes().contains(primaryEndpoint)\r\n ? CassandraManagementConstants.NodeStatuses.NODE_STATUS_UP\r\n : ssMBean.getUnreachableNodes().contains(primaryEndpoint)\r\n ? CassandraManagementConstants.NodeStatuses.NODE_STATUS_DOWN\r\n : CassandraManagementConstants.NodeStatuses.NODE_STATUS_UNKNOWN;\r\n\r\n String state = ssMBean.getJoiningNodes().contains(primaryEndpoint)\r\n ? CassandraManagementConstants.NodeStatuses.NODE_STATUS_JOINING\r\n : ssMBean.getLeavingNodes().contains(primaryEndpoint)\r\n ? CassandraManagementConstants.NodeStatuses.NODE_STATUS_LEAVING\r\n : CassandraManagementConstants.NodeStatuses.NODE_STATUS_NORMAL;\r\n\r\n Map<String, String> loadMap = ssMBean.getLoadMap();\r\n String load = loadMap.containsKey(primaryEndpoint)\r\n ? loadMap.get(primaryEndpoint)\r\n : CassandraManagementConstants.NodeStatuses.NODE_STATUS_UNKNOWN;\r\n\r\n Float ownership = ownerships.get(token);\r\n String owns = \"N/A\";\r\n if(ownership!=null){\r\n owns = new DecimalFormat(\"##0.00%\").format(ownership);\r\n }\r\n NodeInformation nodeInfo = new NodeInformation();\r\n nodeInfo.setAddress(primaryEndpoint);\r\n nodeInfo.setState(state);\r\n nodeInfo.setStatus(status);\r\n nodeInfo.setOwn(owns);\r\n nodeInfo.setLoad(load);\r\n nodeInfo.setToken(token);\r\n nodeInfoList.add(nodeInfo);\r\n }\r\n return nodeInfoList.toArray(new NodeInformation[nodeInfoList.size()]);\r\n }", "java.lang.String getAddress();", "java.lang.String getAddress();", "java.lang.String getAddress();", "java.lang.String getAddress();", "java.lang.String getAddress();", "java.lang.String getAddress();", "public List getAddressList() {\r\n System.out.println(\"List Elements :\" + addressList);\r\n return addressList;\r\n }" ]
[ "0.6536819", "0.58203787", "0.579807", "0.55295444", "0.5526538", "0.5490172", "0.53642374", "0.5363516", "0.5357989", "0.52434045", "0.5162591", "0.5149976", "0.50066906", "0.49628887", "0.49408606", "0.49351767", "0.48660457", "0.48562402", "0.4807395", "0.4800363", "0.4791823", "0.47846985", "0.47497386", "0.47424695", "0.47182676", "0.47173116", "0.47114372", "0.47105405", "0.47002488", "0.46992218", "0.46879998", "0.4662964", "0.46574217", "0.4648566", "0.46179396", "0.46179396", "0.46166244", "0.4608526", "0.46004343", "0.45909402", "0.45831588", "0.45823845", "0.45817697", "0.45815247", "0.4561853", "0.4561468", "0.45576534", "0.4557308", "0.45513868", "0.45507485", "0.45468587", "0.453924", "0.45282227", "0.45210803", "0.45146525", "0.45101148", "0.44990358", "0.44989058", "0.44958848", "0.44958848", "0.4495794", "0.4495323", "0.44935668", "0.44834065", "0.44783047", "0.44780636", "0.44701454", "0.44531092", "0.44529524", "0.44479775", "0.44455796", "0.44429234", "0.4434029", "0.4430905", "0.44215208", "0.4420935", "0.44152755", "0.44008005", "0.4395156", "0.43942294", "0.4393876", "0.4388678", "0.43708438", "0.43705058", "0.4370035", "0.43661493", "0.4364531", "0.43612581", "0.43443972", "0.4340321", "0.43287116", "0.4327521", "0.4322798", "0.43216413", "0.43216413", "0.43216413", "0.43216413", "0.43216413", "0.43216413", "0.4319413" ]
0.7087495
0
All internal tx for given transaction hash
@NotNull List<TxInternal> txsInternalByHash(@NotNull String txhash) throws EtherScanException;
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Override\n public Transaction getTransaction(NulsDigestData txHash) {\n return null;\n }", "private void transactionHash(int i, HashTreeNode htn, String transaction) {\n\t\tVector itemsetList = new Vector();\n\t\tint length;\n\t\tString temp;\n\t\tItemsetNode tempNode = new ItemsetNode();\t\t\n\t\tStringTokenizer st;\n\t\t\n\t\tif(htn.nodeAttr == 2) {\n\t\t\titemsetList = (Vector)htn.itemsetList;\n\t\t\tlength = itemsetList.size();\n\t\t\tfor(int j = 0; j<length; j++) {\n\t\t\t\tst = new StringTokenizer(transaction);\n\t\t\t\ttempNode = (ItemsetNode)itemsetList.get(j);\n\t\t\t\ttemp = getItemAt(tempNode.itemset, htn.nodeDepth);\n\t\t\t\twhile(st.hasMoreTokens()) {\n\t\t\t\t\tif(st.nextToken().compareToIgnoreCase(temp) == 0) {\n\t\t\t\t\t\t((ItemsetNode)itemsetList.get(j)).count++;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn;\n\t\t}\n\t\telse { //HashTable node\n\t\t\tfor(int t = i+1; t<=itemsetSize(transaction); t++) {\n\t\t\t\tif(htn.hashTable.containsKey((getItemAt(transaction, t)))){\n\t\t\t\t\ttransactionHash(i, (HashTreeNode)htn.hashTable.get(getItemAt(transaction, t)), transaction);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}", "public byte[] hashTransaction() {\n byte[][] txIdArrays = new byte[this.getTransactions().length][];\n for (int i = 0;i < this.getTransactions().length;i++) {\n txIdArrays[i] = this.getTransactions()[i].getTxId();\n }\n return new MerkleTree(txIdArrays).getRoot().getHash();\n }", "public void applyAllTransactions(Iterable<WalletTransaction> iwt) {\n clearBalances();\n\n for (WalletTransaction wtx : iwt) {\n // WalletTransaction.Pool pool = wtx.getPool();\n Transaction tx = wtx.getTransaction();\n boolean avail = !tx.isPending();\n TransactionConfidence conf = tx.getConfidence();\n ConfidenceType ct = conf.getConfidenceType();\n\n // Skip dead transactions.\n if (ct != ConfidenceType.DEAD) {\n\n // Traverse the HDAccounts with all outputs.\n List<TransactionOutput> lto = tx.getOutputs();\n for (TransactionOutput to : lto) {\n long value = to.getValue().longValue();\n try {\n byte[] pubkey = null;\n byte[] pubkeyhash = null;\n Script script = to.getScriptPubKey();\n if (script.isSentToRawPubKey())\n pubkey = script.getPubKey();\n else\n pubkeyhash = script.getPubKeyHash();\n for (HDAccount hda : mAccounts)\n hda.applyOutput(pubkey, pubkeyhash, value, avail);\n } catch (ScriptException e) {\n // TODO Auto-generated catch block\n e.printStackTrace();\n }\n }\n\n // Traverse the HDAccounts with all inputs.\n List<TransactionInput> lti = tx.getInputs();\n for (TransactionInput ti : lti) {\n // Get the connected TransactionOutput to see value.\n TransactionOutput cto = ti.getConnectedOutput();\n if (cto == null) {\n // It appears we land here when processing transactions\n // where we handled the output above.\n //\n // mLogger.warn(\"couldn't find connected output for input\");\n continue;\n }\n long value = cto.getValue().longValue();\n try {\n byte[] pubkey = ti.getScriptSig().getPubKey();\n for (HDAccount hda : mAccounts)\n hda.applyInput(pubkey, value);\n } catch (ScriptException e) {\n // This happens if the input doesn't have a\n // public key (eg P2SH). No worries in this\n // case, it isn't one of ours ...\n }\n }\n }\n }\n\n // This is too noisy\n // // Log balance summary.\n // for (HDAccount acct : mAccounts)\n // acct.logBalance();\n }", "@Override\n public int hashCode() {\n return txHash.hashCode()^txIndex;\n }", "@NotNull\n List<TxInternal> txsInternal(@NotNull String address, long startBlock, long endBlock) throws EtherScanException;", "public Sha256Hash getTxHash() {\n return txHash;\n }", "public TransactionID(Sha256Hash txHash, int txIndex) {\n this.txHash = txHash;\n this.txIndex = txIndex;\n }", "public List<Transaction> listAllTransactionsByUserId( int userId){\n\t\t\n\t\t//String queryStr = \"SELECT trans FROM Transaction trans JOIN FETCH trans.\"\n\t\t\n\t\t\n\t\t\n\t\t\n\t\treturn null;\n\t\t\n\t}", "public GlobalTransaction getCurrentTransaction(Transaction tx)\n {\n return getCurrentTransaction(tx, true);\n }", "Transaction getTransctionByTxId(String txId);", "public List<PendingTransactionId> storeTransactionHashes(final List<Sha256Hash> transactionHashes) throws DatabaseException {\n try {\n WRITE_LOCK.lock();\n return _storeTransactionHashes(transactionHashes);\n }\n finally {\n WRITE_LOCK.unlock();\n }\n }", "Map retrievePreparedTransactions();", "@Override\n public void startTx() {\n \n }", "Set<SoftLock> collectAllSoftLocksForTransactionID(TransactionID transactionID);", "public List<Transaction> readAllTransaction() throws TransactionNotFoundException {\n\t\treturn transactionDAO.listAccountTransactionTable();\n\t}", "Transaction beginTx();", "public GlobalTransaction get(Transaction tx)\n {\n if (tx == null)\n {\n return null;\n }\n return tx2gtxMap.get(tx);\n }", "public static long deepTransactionCheck(Transaction tx, UtxoUpdateBuffer utxo_buffer, BlockHeader block_header, NetworkParams params)\n throws ValidationException\n {\n try(TimeRecordAuto tra_blk = TimeRecord.openAuto(\"Validation.deepTransactionCheck\"))\n {\n TransactionInner inner = null;\n\n try\n {\n inner = TransactionInner.parseFrom(tx.getInnerData());\n }\n catch(java.io.IOException e)\n {\n throw new ValidationException(\"error parsing tx on second pass somehow\", e);\n }\n\n long sum_of_inputs = 0L;\n // Make sure all inputs exist\n for(TransactionInput in : inner.getInputsList())\n {\n TransactionOutput matching_out = utxo_buffer.getOutputMatching(in);\n if (matching_out == null)\n {\n throw new ValidationException(String.format(\"No matching output for input %s\", new ChainHash(in.getSrcTxId())));\n }\n validateSpendable(matching_out, block_header, params);\n sum_of_inputs += matching_out.getValue();\n\n // SIP-4 check\n if (block_header.getBlockHeight() >= params.getActivationHeightTxInValue())\n {\n if (in.getValue() != 0L)\n {\n if (in.getValue() != matching_out.getValue())\n {\n throw new ValidationException(String.format(\"Input value does not match: %d %d\", matching_out.getValue(), in.getValue()));\n }\n }\n }\n utxo_buffer.useOutput(matching_out, new ChainHash(in.getSrcTxId()), in.getSrcTxOutIdx());\n }\n\n long spent = 0L;\n // Sum up all outputs\n int out_idx =0;\n ArrayList<ByteString> raw_output_list = TransactionUtil.extractWireFormatTxOut(tx);\n\n for(TransactionOutput out : inner.getOutputsList())\n {\n validateTransactionOutput(out, block_header, params);\n spent+=out.getValue();\n utxo_buffer.addOutput(raw_output_list, out, new ChainHash(tx.getTxHash()), out_idx);\n out_idx++;\n\n }\n\n spent+=inner.getFee();\n\n if (!inner.getIsCoinbase())\n {\n if (sum_of_inputs != spent)\n {\n throw new ValidationException(String.format(\"Transaction took in %d and spent %d\", sum_of_inputs, spent));\n }\n }\n \n return inner.getFee();\n }\n }", "@Test\n public void testHandleTxs() {\n\n // Creates 100 coins to Alice\n Transaction createCoinTx = new Transaction();\n createCoinTx.addOutput(100, kpAlice.getPublic());\n createCoinTx.finalize();\n // Output of createCoinTx is put in UTXO pool\n UTXOPool utxoPool = new UTXOPool();\n UTXO utxo = new UTXO(createCoinTx.getHash(), 0);\n utxoPool.addUTXO(utxo, createCoinTx.getOutput(0));\n TxHandler txHandler = new TxHandler(utxoPool);\n\n // Alice transfers 10 coins to Bob, 20 to Cal\n Transaction tx1 = new Transaction();\n tx1.addInput(createCoinTx.getHash(), 0);\n tx1.addOutput(10, kpBob.getPublic());\n tx1.addOutput(20, kpCal.getPublic());\n\n // Sign for tx1\n byte[] sig1 = null;\n try {\n Signature sig = Signature.getInstance(\"SHA256withRSA\");\n sig.initSign(kpAlice.getPrivate());\n sig.update(tx1.getRawDataToSign(0));\n sig1 = sig.sign();\n } catch (NoSuchAlgorithmException | InvalidKeyException | SignatureException e) {\n e.printStackTrace();\n }\n tx1.getInput(0).addSignature(sig1);\n tx1.finalize();\n\n // Cal transfers 5 coins to Bob, Bob transfers 2 coins to Alice\n Transaction tx2 = new Transaction();\n tx2.addInput(tx1.getHash(), 0); // index 0 refers to output 1 of tx1\n tx2.addInput(tx1.getHash(), 1); // index 1 refers to output 1 of tx1\n tx2.addOutput(2, kpAlice.getPublic());\n tx2.addOutput(5, kpBob.getPublic());\n\n // Sign for tx2\n byte[] sig2 = null;\n try {\n Signature sig = Signature.getInstance(\"SHA256withRSA\");\n sig.initSign(kpBob.getPrivate());\n sig.update(tx2.getRawDataToSign(0));\n sig2 = sig.sign();\n } catch (NoSuchAlgorithmException | InvalidKeyException | SignatureException e) {\n e.printStackTrace();\n }\n tx2.getInput(0).addSignature(sig2);\n\n byte[] sig3 = null;\n try {\n Signature sig = Signature.getInstance(\"SHA256withRSA\");\n sig.initSign(kpCal.getPrivate());\n sig.update(tx2.getRawDataToSign(1));\n sig3 = sig.sign();\n } catch (NoSuchAlgorithmException | InvalidKeyException | SignatureException e) {\n e.printStackTrace();\n }\n tx2.getInput(1).addSignature(sig3);\n tx2.finalize();\n\n // Alice transfers 3 coins to Cal\n Transaction tx3 = new Transaction();\n tx3.addInput(tx2.getHash(), 0);\n tx3.addOutput(3, kpCal.getPublic());\n\n // Sign for tx3\n byte[] sig4 = null;\n try {\n Signature sig = Signature.getInstance(\"SHA256withRSA\");\n sig.initSign(kpAlice.getPrivate());\n sig.update(tx3.getRawDataToSign(0));\n sig4 = sig.sign();\n } catch (NoSuchAlgorithmException | InvalidKeyException | SignatureException e) {\n e.printStackTrace();\n }\n tx3.getInput(0).addSignature(sig4);\n tx3.finalize();\n\n Transaction[] acceptedTx = txHandler.handleTxs(new Transaction[] {tx1, tx2, tx3});\n // tx1, tx2 supposed to be valid, tx3 supposed to be invalid\n assertEquals(acceptedTx.length, 2);\n // assertFalse(txHandler.isValidTx(tx3));\n }", "public Collection<Transaction> getAllTransactions();", "public List<Transaction> getAllTransaction() throws SQLException {\n String sql = \"SELECT * FROM LabStore.Transaction_Detail\";\n List<Transaction> transactions = new ArrayList<>();\n\n try (Connection conn = database.getConnection();\n PreparedStatement preStmt = conn.prepareStatement(sql)) {\n try (ResultSet rs = preStmt.executeQuery()) {\n while (rs.next()) {\n Transaction transaction = new Transaction();\n transaction.setId(rs.getInt(\"id\"));\n transaction.setUser(userDbManager.getUser(rs.getInt(\"uId\")));\n transaction.setPurchaseDetail(purchaseDetailDbManager\n .getPurchaseDetailById(rs.getInt(\"pdId\")));\n transaction.setCount(rs.getInt(\"count\"));\n transaction.setTime(rs.getTimestamp(\"time\"));\n transactions.add(transaction);\n }\n }\n }\n\n return transactions;\n }", "private Collection<StorableTransaction> getTransactionList(Object body) {\r\n Collection<StorableTransaction> txs = new ArrayList<>();\r\n JsonObject data = (JsonObject) body;\r\n data.getJsonArray(ID_COLLECTION).forEach(json -> {\r\n StorableTransaction tx = Serializer.unpack((JsonObject) json, StorableTransaction.class);\r\n tx.setTimestamp(timestampFrom(data.getLong(ID_TIME)));\r\n txs.add(tx);\r\n });\r\n return txs;\r\n }", "@Override\n\tpublic List<Transaction> getAllTransactions() { \n\t\t/* begin transaction */ \n\t\tSession session = getCurrentSession(); \n\t\tsession.beginTransaction();\n\n\t\tQuery query = session.createQuery(\"from Transaction\");\n\t\tList<Transaction> expenses = query.list();\n\n\t\t/* commit */ \n\t\tsession.getTransaction().commit();\n\n\t\treturn expenses; \n\t}", "public LookupAccountTransactions txid(String txid) {\n addQuery(\"txid\", String.valueOf(txid));\n return this;\n }", "public Buffer execute(Transaction tx) {\n if (!isRunAllowed()) {\n return null;\n }\n\n SortedIndex<Buffer, Buffer> indexCompleted = hawtDBFile.getRepositoryIndex(tx, getRepositoryNameCompleted(), false);\n if (indexCompleted == null) {\n return null;\n }\n\n Iterator<Map.Entry<Buffer, Buffer>> it = indexCompleted.iterator();\n // scan could potentially be running while we are shutting down so check for that\n while (it.hasNext() && isRunAllowed()) {\n Map.Entry<Buffer, Buffer> entry = it.next();\n Buffer keyBuffer = entry.getKey();\n\n String exchangeId;\n try {\n exchangeId = codec.unmarshallKey(keyBuffer);\n } catch (IOException e) {\n throw new RuntimeException(\"Error unmarshalling confirm key: \" + keyBuffer, e);\n }\n if (exchangeId != null) {\n LOG.trace(\"Scan exchangeId [{}]\", exchangeId);\n answer.add(exchangeId);\n }\n }\n return null;\n }", "@NotNull\n List<Tx> txs(@NotNull String address, long startBlock, long endBlock) throws EtherScanException;", "public void setHash(String hash) {\n\t\tthis.hash = hash;\n\t}", "public PTPTransactionManager () {\n transactions = new HashMap<>();\n completeTransactions = new HashSet<>();\n }", "Set<Transaction> getTransactionsByUserIdAndAmountCy(String userId, String txAmountCy);", "public List<Transaction> getAllTransactions(){\n Cursor cursor = fetchAllRecords();\n List<Transaction> transactions = new ArrayList<Transaction>();\n if (cursor != null){\n while(cursor.moveToNext()){\n transactions.add(buildTransactionInstance(cursor));\n }\n cursor.close();\n }\n return transactions;\n }", "public void setHash(String hash) {\n this.hash = hash;\n }", "public void setHash(String hash) {\n this.hash = hash;\n }", "public void setHash(String hash) {\n this.hash = hash;\n }", "public void floodTransaction(Transaction tx){\n // Perform checks\n if(!isTransactionOnBlockchain(tx)){\n if(!areOutputsSpent(tx)){\n if(!isTransactionAlreadySeen(tx)){\n // Add to this nodes transactions\n allTransactions.add(tx);\n\n // If enough transaction are present to mine a block do so\n if(allTransactions.size() == BLOCK_SIZE){\n // Create a new block using the hash from the last block on the current blockchain\n Block blockToAdd = new Block(currentBlockchain.blockChain.get(currentBlockchain.blockChain.size()-1).hash);\n\n // For each transaction this node has seen, add it to the block\n for (Transaction transaction : allTransactions) {\n blockToAdd.addTransaction(transaction);\n }\n \n\n // Mine the block and add it to the current blockchain\n if (blockToAdd.mineBlock(Blockchain.DIFFICULTY)){\n currentBlockchain.blockChain.add(blockToAdd);\n }\n \n // Remove transactions in block from other nodes transaction list\n for(Iterator<Transaction> iterator = allTransactions.iterator();iterator.hasNext();){\n Transaction t = iterator.next();\n iterator.remove();\n }\n \n \n }\n\n // Relay to other nodes\n for (Node node : nearbyNodes) {\n node.floodTransaction(tx);\n }\n }\n }\n }\n }", "public List<TransactionInfo> getAll() {\n return transactions;\n }", "public List<TransactionInfo> list() {\n LOG.debug(\"loading all transaction info\");\n try {\n return getEditor().list();\n } catch (IOException e) {\n throw new CommandExecutionException(\"error occurred while loading transactions\", e);\n }\n }", "com.google.protobuf.ByteString getTransactions(int index);", "public static void setThreadLocalTransaction(Transaction tx) {\n threadlocal.set(tx);\n }", "public void setHash(String hash)\n {\n this.hash = hash;\n }", "public Buffer execute(Transaction tx) {\n if (!isRunAllowed()) {\n return null;\n }\n\n SortedIndex<Buffer, Buffer> index = hawtDBFile.getRepositoryIndex(tx, repositoryName, false);\n if (index == null) {\n return null;\n }\n\n Iterator<Map.Entry<Buffer, Buffer>> it = index.iterator();\n // scan could potentially be running while we are shutting down so check for that\n while (it.hasNext() && isRunAllowed()) {\n Map.Entry<Buffer, Buffer> entry = it.next();\n Buffer keyBuffer = entry.getKey();\n\n String key;\n try {\n key = codec.unmarshallKey(keyBuffer);\n } catch (IOException e) {\n throw new RuntimeException(\"Error unmarshalling key: \" + keyBuffer, e);\n }\n if (key != null) {\n LOG.trace(\"getKey [{}]\", key);\n keys.add(key);\n }\n }\n return null;\n }", "private void executeTransaction(ArrayList<Request> transaction) {\n // create a new TransactionMessage\n TransactionMessage tm = new TransactionMessage(transaction);\n //if(tm.getStatementCode(0)!=8&&tm.getStatementCode(0)!=14)\n // return;\n try {\n ByteArrayOutputStream bos = new ByteArrayOutputStream();\n ObjectOutputStream oos = new ObjectOutputStream(bos);\n oos.writeObject(tm);\n oos.flush();\n\n byte[] data = bos.toByteArray();\n\n byte[] buffer = null;\n long startTime = System.currentTimeMillis();\n buffer = clientShim.execute(data);\n long endTime = System.currentTimeMillis();\n if (reqIndex < maxNoOfRequests && id > 0) {\n System.out.println(\"#req\" + reqIndex + \" \" + startTime + \" \" + endTime + \" \" + id);\n }\n reqIndex++;\n\n father.addTransaction();\n\n // IN THE MEAN TIME THE INTERACTION IS BEING EXECUTED\n\n\t\t\t\t/*\n\t\t\t\t * possible values of r: 0: commit 1: rollback 2: error\n\t\t\t\t */\n int r = ByteBuffer.wrap(buffer).getInt();\n //System.out.println(\"r = \"+r);\n if (r == 0) {\n father.addCommit();\n } else if (r == 1) {\n father.addRollback();\n } else {\n father.addError();\n }\n } catch (IOException e) {\n e.printStackTrace();\n }\n }", "T handle(Tx tx) throws Exception;", "public void setHash(String hash) {\n this.hash = hash;\n }", "@Override\n public List<UTXO> getOpenTransactionOutputs(List<Address> addresses) throws UTXOProviderException {\n\n List<UTXO> results = new LinkedList<UTXO>();\n for (Address a : addresses) {\n ByteBuffer bb = ByteBuffer.allocate(21);\n bb.put((byte) KeyType.ADDRESS_HASHINDEX.ordinal());\n bb.put(a.getHash160());\n\n ReadOptions ro = new ReadOptions();\n Snapshot sn = db.getSnapshot();\n ro.snapshot(sn);\n\n // Scanning over iterator very fast\n\n DBIterator iterator = db.iterator(ro);\n for (iterator.seek(bb.array()); iterator.hasNext(); iterator.next()) {\n ByteBuffer bbKey = ByteBuffer.wrap(iterator.peekNext().getKey());\n bbKey.get(); // remove the address_hashindex byte.\n byte[] addressKey = new byte[20];\n bbKey.get(addressKey);\n if (!Arrays.equals(addressKey, a.getHash160())) {\n break;\n }\n byte[] hashBytes = new byte[32];\n bbKey.get(hashBytes);\n int index = bbKey.getInt();\n Sha256Hash hash = Sha256Hash.wrap(hashBytes);\n UTXO txout;\n try {\n // TODO this should be on the SNAPSHOT too......\n // this is really a BUG.\n txout = getTransactionOutput(hash, index);\n } catch (BlockStoreException e) {\n throw new UTXOProviderException(\"block store execption\", e);\n }\n if (txout != null) {\n Script sc = txout.getScript();\n Address address = sc.getToAddress(params, true);\n UTXO output = new UTXO(txout.getHash(), txout.getIndex(), txout.getValue(), txout.getHeight(),\n txout.isCoinbase(), txout.getScript(), address.toString());\n results.add(output);\n }\n }\n try {\n iterator.close();\n ro = null;\n sn.close();\n sn = null;\n } catch (IOException e) {\n log.error(\"Error closing snapshot/iterator?\", e);\n }\n }\n return results;\n }", "public void applyTransaction(Transaction tx, byte[] coinbase) {\n\t\tif (blockchain != null)\n\t\t\tblockchain.addWalletTransaction(tx);\n\n\t\t// TODO: what is going on with simple wallet transfer ?\n\n\t\t// 1. VALIDATE THE NONCE\n\t\tbyte[] senderAddress = tx.getSender();\n\n\t\tAccountState senderAccount = repository.getAccountState(senderAddress);\n\n\t\tif (senderAccount == null) {\n\t\t\tif (stateLogger.isWarnEnabled())\n\t\t\t\tstateLogger.warn(\"No such address: {}\",\n\t\t\t\t\t\tHex.toHexString(senderAddress));\n\t\t\treturn;\n\t\t}\n\n\t\tBigInteger nonce = repository.getNonce(senderAddress);\n\t\tif (nonce.compareTo(new BigInteger(tx.getNonce())) != 0) {\n\t\t\tif (stateLogger.isWarnEnabled())\n\t\t\t\tstateLogger.warn(\"Invalid nonce account.nonce={} tx.nonce={}\",\n\t\t\t\t\t\tnonce.longValue(), new BigInteger(tx.getNonce()));\n\t\t\treturn;\n\t\t}\n\n\t\t// 2.1 PERFORM THE GAS VALUE TX\n\t\t// (THIS STAGE IS NOT REVERTED BY ANY EXCEPTION)\n\n\t\t// first of all debit the gas from the issuer\n\t\tBigInteger gasDebit = tx.getTotalGasValueDebit();\n\n\t\t// The coinbase get the gas cost\n\t\trepository.addBalance(coinbase, gasDebit);\n\n\t\tbyte[] contractAddress;\n\n\t\t// Contract creation or existing Contract call\n\t\tif (tx.isContractCreation()) {\n\n\t\t\t// credit the receiver\n\t\t\tcontractAddress = tx.getContractAddress();\n\t\t\trepository.createAccount(contractAddress);\n\t\t\tstateLogger.info(\"New contract created address={}\",\n\t\t\t\t\tHex.toHexString(contractAddress));\n\t\t} else {\n\n\t\t\tcontractAddress = tx.getReceiveAddress();\n\t\t\tAccountState receiverState = repository.getAccountState(tx\n\t\t\t\t\t.getReceiveAddress());\n\n\t\t\tif (receiverState == null) {\n\t\t\t\trepository.createAccount(tx.getReceiveAddress());\n\t\t\t\tif (stateLogger.isInfoEnabled())\n\t\t\t\t\tstateLogger.info(\"New account created address={}\",\n\t\t\t\t\t\t\tHex.toHexString(tx.getReceiveAddress()));\n\t\t\t}\n\t\t}\n\n\t\t// 2.2 UPDATE THE NONCE\n\t\t// (THIS STAGE IS NOT REVERTED BY ANY EXCEPTION)\n\t\tBigInteger balance = repository.getBalance(senderAddress);\n\t\tif (balance.compareTo(BigInteger.ZERO) == 1) {\n\t\t\trepository.increaseNonce(senderAddress);\n\n\t\t\tif (stateLogger.isInfoEnabled())\n\t\t\t\tstateLogger.info(\n\t\t\t\t\t\t\"Before contract execution the sender address debit with gas total cost, \"\n\t\t\t\t\t\t\t\t+ \"\\n sender={} \\n gas_debit= {}\",\n\t\t\t\t\t\tHex.toHexString(tx.getSender()), gasDebit);\n\t\t}\n\n\t\t// actual gas value debit from the sender\n\t\t// the purchase gas will be available for the\n\t\t// contract in the execution state, and\n\t\t// can be validate using GAS op\n\t\tif (gasDebit.signum() == 1) {\n\t\t\tif (balance.compareTo(gasDebit) == -1) {\n\t\t\t\tlogger.info(\"No gas to start the execution: sender={}\",\n\t\t\t\t\t\tHex.toHexString(tx.getSender()));\n\t\t\t\treturn;\n\t\t\t}\n\t\t\trepository.addBalance(senderAddress, gasDebit.negate());\n\t\t}\n\n\t\t// 3. START TRACKING FOR REVERT CHANGES OPTION !!!\n\t\tRepository trackRepository = repository.getTrack();\n\t\ttrackRepository.startTracking();\n\n\t\ttry {\n\n\t\t\t// 4. THE SIMPLE VALUE/BALANCE CHANGE\n\t\t\tif (tx.getValue() != null) {\n\n\t\t\t\tBigInteger senderBalance = repository.getBalance(senderAddress);\n\t\t\t\tBigInteger contractBalance = repository.getBalance(contractAddress);\n\n\t\t\t\tif (senderBalance.compareTo(new BigInteger(1, tx.getValue())) >= 0) {\n\n\t\t\t\t\trepository.addBalance(contractAddress,\n\t\t\t\t\t\t\tnew BigInteger(1, tx.getValue()));\n\t\t\t\t\trepository.addBalance(senderAddress,\n\t\t\t\t\t\t\tnew BigInteger(1, tx.getValue()).negate());\n\n\t\t\t\t\tif (stateLogger.isInfoEnabled())\n\t\t\t\t\t\tstateLogger.info(\"Update value balance \\n \"\n\t\t\t\t\t\t\t\t+ \"sender={}, receiver={}, value={}\",\n\t\t\t\t\t\t\t\tHex.toHexString(senderAddress),\n\t\t\t\t\t\t\t\tHex.toHexString(contractAddress),\n\t\t\t\t\t\t\t\tnew BigInteger(tx.getValue()));\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// 3. FIND OUT WHAT IS THE TRANSACTION TYPE\n\t\t\tif (tx.isContractCreation()) {\n\n\t\t\t\tbyte[] initCode = tx.getData();\n\n\t\t\t\tBlock lastBlock = blockchain.getLastBlock();\n\n\t\t\t\tProgramInvoke programInvoke = ProgramInvokeFactory\n\t\t\t\t\t\t.createProgramInvoke(tx, lastBlock, trackRepository);\n\n\t\t\t\tif (logger.isInfoEnabled())\n\t\t\t\t\tlogger.info(\"running the init for contract: addres={}\",\n\t\t\t\t\t\t\tHex.toHexString(tx.getContractAddress()));\n\n\t\t\t\tVM vm = new VM();\n\t\t\t\tProgram program = new Program(initCode, programInvoke);\n\t\t\t\tvm.play(program);\n\t\t\t\tProgramResult result = program.getResult();\n\t\t\t\tapplyProgramResult(result, gasDebit, trackRepository,\n\t\t\t\t\t\tsenderAddress, tx.getContractAddress(), coinbase);\n\n\t\t\t} else {\n\n\t\t\t\tbyte[] programCode = trackRepository.getCode(tx\n\t\t\t\t\t\t.getReceiveAddress());\n\t\t\t\tif (programCode != null) {\n\n\t\t\t\t\tBlock lastBlock = blockchain.getLastBlock();\n\n\t\t\t\t\tif (logger.isInfoEnabled())\n\t\t\t\t\t\tlogger.info(\"calling for existing contract: addres={}\",\n\t\t\t\t\t\t\t\tHex.toHexString(tx.getReceiveAddress()));\n\n\t\t\t\t\tProgramInvoke programInvoke = ProgramInvokeFactory\n\t\t\t\t\t\t\t.createProgramInvoke(tx, lastBlock, trackRepository);\n\n\t\t\t\t\tVM vm = new VM();\n\t\t\t\t\tProgram program = new Program(programCode, programInvoke);\n\t\t\t\t\tvm.play(program);\n\n\t\t\t\t\tProgramResult result = program.getResult();\n\t\t\t\t\tapplyProgramResult(result, gasDebit, trackRepository,\n\t\t\t\t\t\t\tsenderAddress, tx.getReceiveAddress(), coinbase);\n\t\t\t\t}\n\t\t\t}\n\t\t} catch (RuntimeException e) {\n\t\t\ttrackRepository.rollback();\n\t\t\treturn;\n\t\t}\n\t\ttrackRepository.commit();\n\t\tpendingTransactions.put(Hex.toHexString(tx.getHash()), tx);\n\t}", "public static Transaction[] transactionList(){\n int countFullPosition = 0;\n for (Transaction tr:transactions) {\n if(tr != null){\n countFullPosition++;\n }\n }\n if(countFullPosition == 0)\n return new Transaction[] {};\n // throw new InternalServerException(\"TransactionList is empty\");\n Transaction[] trList = new Transaction[countFullPosition];\n int index = 0;\n for (Transaction tr:transactions) {\n if(tr != null){\n trList[index] = tr;\n index++;\n }\n }\n return trList;\n }", "@Override\r\n\tpublic TransactionMetadata initializeTransaction(BigInteger txid,TransactionMetadata prevMetadata) {\n\t\tTransactionMetadata ret = initializeTransactionMetadat();\r\n\t\tif(nextBatchRows!=null && !nextBatchRows.isEmpty()){\r\n\t\t\tList<ObjectId> rowIds = Util.convertToIdList(nextBatchRows);\r\n//\t\t\tquantity = quantity > MAX_TRANSACTION_SIZE ? MAX_TRANSACTION_SIZE : quantity;\r\n\t\t\tret = new TransactionMetadata(collectionName,rowIds);\r\n\t\t\tObjectId[] objectIds = Util.convertObjectIdListToArr(rowIds);\r\n\t\t\tString objIdStr = Util.convertObjectIdArrToStr(objectIds);\r\n\t\t\tlogger.debug(\"store transactionMetadata,txid:\"+txid+\" [collection:\"+collectionName+\"]objIds : \"+objIdStr);\r\n\t\t}\r\n//\t\tnextRead += quantity;\r\n//\t\tmongoManager.updateFlagToInprogress(idList);\r\n\t\treturn ret;\r\n\t}", "public Transaction(){\n\t\t\n\t\ttransactions = new HashMap<String, ArrayList<Products>>();\n\t}", "long getTxid();", "private TaskTransaction tx() {\n if (this.taskTx == null) {\n /*\n * NOTE: don't synchronized(this) due to scheduler thread hold\n * this lock through scheduleTasks(), then query tasks and wait\n * for db-worker thread after call(), the tx may not be initialized\n * but can't catch this lock, then cause dead lock.\n * We just use this.eventListener as a monitor here\n */\n synchronized (this.eventListener) {\n if (this.taskTx == null) {\n BackendStore store = this.graph.loadSystemStore();\n TaskTransaction tx = new TaskTransaction(this.graph, store);\n assert this.taskTx == null; // may be reentrant?\n this.taskTx = tx;\n }\n }\n }\n assert this.taskTx != null;\n return this.taskTx;\n }", "public Set<Transaction> getTransactionsByLotId(Integer id) throws MiddlewareQueryException;", "@Override\n public void commitTx() {\n \n }", "private static void createDummyTransactions() {\n targetAndTransactions.add(new TargetAndTransaction(rootWebTarget, 10L, new Transaction(10000d, \"cars\", 0L)));\n targetAndTransactions.add(new TargetAndTransaction(rootWebTarget, 11L, new Transaction(15000d, \"shopping\", 10L)));\n targetAndTransactions.add(new TargetAndTransaction(rootWebTarget, 12L, new Transaction(20000d, \"keys\", 11L)));\n targetAndTransactions.add(new TargetAndTransaction(rootWebTarget, 13L, new Transaction(25000d, \"furniture\", 12L)));\n targetAndTransactions.add(new TargetAndTransaction(rootWebTarget, 14L, new Transaction(30000d, \"keys\", 13L)));\n targetAndTransactions.add(new TargetAndTransaction(rootWebTarget, 15L, new Transaction(40000d, \"cars\", 14L)));\n targetAndTransactions.add(new TargetAndTransaction(rootWebTarget, 16L, new Transaction(50000d, \"cars\", 15L)));\n }", "public static void main(String args[]) throws IOException {\n BufferedReader br = new BufferedReader(new FileReader(\"sample.txt\"));\n String st;\n /*Created LinkedHashMaps for transactions and locks for keeping the records of both*/\n HashMap<String, HashMap<String, Object>> transactions = new LinkedHashMap<>();\n HashMap<Character, HashMap<String, Object>> locks = new LinkedHashMap<>();\n\n /*Created HashMap for keeping the records for blocked operation with respect to the transactionId which blocks those operation*/\n HashMap<String, LinkedList<String>> blockedOp = new HashMap<>();\n int i = 1;\n ConcurrencyControl cc = new ConcurrencyControl();\n fw = new FileWriter(\"output.txt\");\n while ((st = br.readLine()) != null) {\n st = st.trim();\n int index = st.indexOf(';');\n fw.write(\"Input : \"+ st.substring(0, index) +\"\\n\");\n if (st.charAt(0) == 'b') {\n /* will just create record of current transaction with active state and timestamp */\n cc.beginTransaction(transactions, locks, st, i);\n i++;\n }\n else if (st.charAt(0) == 'r') {\n /* will perform read operation */\n cc.readTransaction(transactions, locks, st, blockedOp);\n }\n else if (st.charAt(0) == 'w') {\n /* will perform read operation */\n cc.writeTransaction(transactions, locks, st, blockedOp);\n }\n else {\n String key = \"T\"+st.charAt(1);\n /* If a transaction is aborted then it will not commit */\n if (!transactions.get(key).get(\"State\").equals(\"Aborted\"))\n cc.endOrAbort(transactions, locks, key, \"Commited\", blockedOp);\n }\n cc.printRecords(transactions, locks);\n }\n System.out.println(\"Output written in output.txt successfully !!\");\n fw.close();\n }", "private void initialize(FujabaTransaction fujaba_tx) {\n for (FujabaRecord f_rec : fujaba_tx.getChanges()) {\n if (f_rec.getRecordType() == CoobraType.CHANGE) {\n FujabaChangeRecord fc_rec = (FujabaChangeRecord) f_rec;\n\n switch (fc_rec.getChangeKind()) {\n case CREATE_OBJECT:\n changes_.add(new MiradorCreateRecord(fc_rec, this));\n break;\n\n case DESTROY_OBJECT:\n// changes_.add(new MiradorDestroyRecord(fc_rec, this));\n break;\n\n case ALTER_FIELD:\n changes_.add(new MiradorAlterRecord(fc_rec, this));\n break;\n }\n }\n }\n\n Debug.dbg.println(\"\\n\\t>>> Creating Mirador Transaction - \"\n + tx_id_ + \": \" + tx_name_ + \" <<<\");\n for (ListIterator<MiradorRecord> it = changeIterator(); it.hasNext();)\n Debug.dbg.println(it.next());\n }", "private ArrayList<Long> storeTransactionInputs(long transactionId, ArrayList<TransactionInput> inputs, int isCoinbase){\n \t\tint inputindex = 0;\n \t\tlong previousOutputId;\n \t\tString prevOutputHash;\n \t\tResultSet findOutputResults;\n \t\tResultSet generatedKey;\n \t\tLong addressId;\n \t\tArrayList<Long> addressIdz=new ArrayList<Long>();\n \t\ttry {\n \t\tfor (TransactionInput i : inputs) {\n\t\t\t\n \t\t\tprevOutputHash = HexBin.encode(i.outpoint.hash);\n \t\t\tfindTransactionOutputStatement.setString(1, prevOutputHash);\n \t\t\tfindTransactionOutputStatement.setLong(2, i.outpoint.index);\n \t\t\tfindOutputResults = findTransactionOutputStatement\n \t\t\t\t\t.executeQuery();\n \t\t\tif (findOutputResults.next()) {\n \t\t\t\tpreviousOutputId = findOutputResults.getLong(1);\n\t\t\t\taddressId=findOutputResults.getLong(2);\n \t\t\t} else {\n \t\t\t\tpreviousOutputId = 0;\n\t\t\t\taddressId=null;\n \t\t\t}\n \t\t\tfindOutputResults.close();\n \t\t\tinsertTransactionInputStatement.setLong(1, transactionId);\n \t\t\tinsertTransactionInputStatement.setInt(2, inputindex);\n \t\t\tinsertTransactionInputStatement\n \t\t\t\t\t.setLong(3, previousOutputId);\n \t\t\tinsertTransactionInputStatement\n \t\t\t\t\t.setString(4, prevOutputHash);\n \t\t\tinsertTransactionInputStatement\n \t\t\t\t\t.setLong(5, i.outpoint.index);\n \t\t\tinsertTransactionInputStatement.setLong(6,\n \t\t\t\t\ti.scriptBytes.length);\n \t\t\tinsertTransactionInputStatement.setString(7,\n \t\t\t\t\tHexBin.encode(i.scriptBytes));\n \t\t\tinsertTransactionInputStatement.setLong(8, i.sequence);\n \t\t\tinsertTransactionInputStatement.setBoolean(9,\n \t\t\t\t\ti.isCoinBase());\n\t\t\tif(addressId!=null){\n \t\t\t\tinsertTransactionInputStatement.setLong(10,addressId);\n \t\t\t\taddressIdz.add(addressId);\n\t\t\t} else {\n \t\t\t\t// TODO Auto-generated catch block\n \t\t\t\tinsertTransactionInputStatement.setNull(10,\n \t\t\t\t\t\tjava.sql.Types.INTEGER);\n \t\t\t}\n \t\t\tinsertTransactionInputStatement.execute();\n \t\t\t\n \t\t}\n \t\t\n \t\t\n \t} catch (SQLException e1) {\n \t\t// TODO Auto-generated catch block\n \t\te1.printStackTrace();\n \t}\n \t\treturn addressIdz;\n \t}", "@Test\n public void TxHandlerTestFirst() throws NoSuchAlgorithmException, SignatureException, InvalidKeyException {\n // generate key pairs, simulate initial tx from scrooge to alice\n System.out.println(\"-----------------------------------------------------------------\");\n System.out.println(\"Test some basic functions of TxHandler\");\n KeyPair pkScrooge = KeyPairGenerator.getInstance(\"RSA\").generateKeyPair();\n KeyPair pkAlice = KeyPairGenerator.getInstance(\"RSA\").generateKeyPair();\n KeyPair pkBob = KeyPairGenerator.getInstance(\"RSA\").generateKeyPair();\n\n // tx0: Scrooge --> Scrooge 25coins [Create Coins]\n Transaction tx0 = new Transaction();\n tx0.addOutput(25, pkScrooge.getPublic());\n\n byte[] initHash = null;\n tx0.addInput(initHash, 0);\n tx0.signTx( pkScrooge.getPrivate(), 0);\n\n UTXOPool utxoPool = new UTXOPool();\n UTXO utxo = new UTXO(tx0.getHash(), 0);\n utxoPool.addUTXO(utxo, tx0.getOutput(0));\n\n\n // tx1: Scrooge --> Scrooge 4coins [Divide Coins]\n //\t Scrooge --> Scrooge 5coins\n //\t Scrooge --> Scrooge 6coins\n Transaction tx1 = new Transaction();\n tx1.addInput(tx0.getHash(),0);\n\n tx1.addOutput(4,pkScrooge.getPublic());\n tx1.addOutput(5,pkScrooge.getPublic());\n tx1.addOutput(6,pkScrooge.getPublic());\n\n tx1.signTx(pkScrooge.getPrivate(), 0);\n\n TxHandler txHandler = new TxHandler(utxoPool);\n System.out.println(\"txHandler.isValidTx(tx1) returns: \" + txHandler.isValidTx(tx1));\n\n assertTrue(\"tx1:One valid transaction\", txHandler.handleTxs(new Transaction[]{tx1}).length == 1);\n // update utxo pool\n utxoPool = txHandler.getHandledUtxoPool();\n assertTrue(\"tx1:Three UTXO's are created\", utxoPool.getAllUTXO().size() == 3);\n\n\n // tx2: Scrooge --> Alice 4coins [Pay separately]\n //\t Scrooge --> Alice 5coins\n // Scrooge --> Bob 6coins\n Transaction tx2 = new Transaction();\n tx2.addInput(tx1.getHash(), 0);\n tx2.addInput(tx1.getHash(), 1);\n tx2.addInput(tx1.getHash(), 2);\n\n tx2.addOutput(4, pkAlice.getPublic());\n tx2.addOutput(5, pkAlice.getPublic());\n tx2.addOutput(6, pkBob.getPublic());\n\n tx2.signTx(pkScrooge.getPrivate(), 0);\n tx2.signTx(pkScrooge.getPrivate(), 1);\n tx2.signTx(pkScrooge.getPrivate(), 2);\n\n txHandler = new TxHandler(utxoPool);\n System.out.println(\"txHandler.isValidTx(tx2) returns: \" + txHandler.isValidTx(tx2));\n assertTrue(\"tx2:One valid transaction\", txHandler.handleTxs(new Transaction[]{tx2}).length == 1);\n // update utxo pool\n utxoPool = txHandler.getHandledUtxoPool();\n assertTrue(\"tx2:Three UTXO's are created\", utxoPool.getAllUTXO().size() == 3);\n\n\n // tx3:Alice --> Alice 2coins [Divide Coins]\n // Alice --> Alice 2coins\n Transaction tx3 = new Transaction();\n tx3.addInput(tx2.getHash(),0);\n\n tx3.addOutput(2, pkAlice.getPublic());\n tx3.addOutput(2, pkAlice.getPublic());\n\n tx3.signTx(pkAlice.getPrivate(),0);\n\n txHandler = new TxHandler(utxoPool);\n\n System.out.println(\"txHandler.isValidTx(tx3) returns: \" + txHandler.isValidTx(tx3));\n assertTrue(\"tx3:One valid transaction\", txHandler.handleTxs(new Transaction[]{tx3}).length == 1);\n // update utxo pool\n utxoPool = txHandler.getHandledUtxoPool();\n assertTrue(\"tx3:Two UTXO's are created\", utxoPool.getAllUTXO().size() == 4);\n\n // tx4: Alice --> Bob 2coins [Pay jointly]\n // Alice --> Bob 5coins\n Transaction tx4 = new Transaction();\n tx4.addInput(tx3.getHash(),0);\n tx4.addInput(tx2.getHash(),1);\n\n tx4.addOutput(7, pkBob.getPublic());\n\n tx4.signTx(pkAlice.getPrivate(), 0);\n tx4.signTx(pkAlice.getPrivate(),1);\n\n\n txHandler = new TxHandler(utxoPool);\n\n System.out.println(\"txHandler.isValidTx(tx4) returns: \" + txHandler.isValidTx(tx4));\n assertTrue(\"tx4:One valid transaction\", txHandler.handleTxs(new Transaction[]{tx4}).length == 1);\n // update utxo pool\n utxoPool = txHandler.getHandledUtxoPool();\n assertTrue(\"tx4:Two UTXO's are created\", utxoPool.getAllUTXO().size() == 3);\n\n// System.out.println(\"tx1.hashCode returns: \" + tx1.hashCode());\n// System.out.println(\"tx2.hashCode returns: \" + tx2.hashCode());\n// System.out.println(\"tx3.hashCode returns: \" + tx3.hashCode());\n// System.out.println(\"tx4.hashCode returns: \" + tx4.hashCode());\n }", "public byte[] getBytes() {\n byte[] indexData = VarInt.encode(txIndex);\n byte[] bytes = new byte[32+indexData.length];\n System.arraycopy(txHash.getBytes(), 0, bytes, 0, 32);\n System.arraycopy(indexData, 0, bytes, 32, indexData.length);\n return bytes;\n }", "public MiradorTransaction(FujabaTransaction fujaba_tx) {\n tx_name_ = fujaba_tx.getName();\n tx_id_ = fujaba_tx.getId();\n merge_side_ = fujaba_tx.getMergeSide();\n initialize(fujaba_tx);\n }", "public List<Transaction> getAvailableTransactions(String workerId){\r\n return dao.getAvailableTransactions(workerId);\r\n }", "@Transactional\n\tpublic Set<TransactionTable> findAllTransactions() {\n\t\t List<TransactionTable> list = new ArrayList<TransactionTable>();\n\t TypedQuery<TransactionTable> query = entityManager.createNamedQuery(\"TransactionTable.findAll\", TransactionTable.class);\n\t list = query.getResultList();\n\t Set<TransactionTable> TransactionSet = new HashSet<TransactionTable>(list);\n\t return TransactionSet;\n\t\n\t}", "Transaction getCurrentTransaction();", "public void commit(int tid) {\n List<Lock> lockList = null;\n\n // check wheter there is read-only transaction running\n boolean hasRO = _tm.hasRunningReadonly();\n for (Integer varIndex : _lockTable.keySet()) {\n lockList = _lockTable.get(varIndex);\n int size = lockList.size();\n for (int i = size - 1; i >= 0; i--) {\n Lock lc = lockList.get(i);\n if (lc.getTranId() == tid) {\n\n // If the lock type is write, means this transaction writes a variable\n // in uncommitDataMap\n if (lc.getType() == Lock.Type.WRITE) {\n if (_uncommitDataMap.containsKey(varIndex)) {\n List<Data> dataList = _dataMap.get(varIndex);\n Data d = _uncommitDataMap.get(varIndex);\n d.setCommitTime(_tm.getCurrentTime());\n\n // If no read-only transaction, replace the old version\n if (!hasRO) {\n dataList.clear();\n }\n dataList.add(d);\n _uncommitDataMap.remove(varIndex);\n }\n }\n lockList.remove(i);\n break;\n }\n }\n }\n // remove this transaction from accessed list\n _accessedTransactions.remove(tid);\n }", "private static List<Transaction> toTransactions(AppBlock appBlock) {\n List<AppBlock.TransactionObject> transactionResults = appBlock.getBlock().getBody().getTransactions();\n List<Transaction> transactions = new ArrayList<Transaction>(transactionResults.size());\n for (AppBlock.TransactionObject transactionResult: transactionResults) {\n transactions.add((Transaction) transactionResult.get());\n }\n return transactions;\n }", "public void createTransaction(Transaction trans);", "public TManagerImp() {\n transactions = new ConcurrentHashMap<>();\n }", "void setTransactionId( long txId )\n {\n this.transactionId = txId;\n }", "void processTransaction(String[] transaction) {\n\t\titemsetSets.get(itemsetSets.size() - 1).processTransaction(transaction);\n\t}", "public String calculateHash () {\n StringBuilder hashInput = new StringBuilder(previousHash)\n .append(timeStamp)\n .append(magicNumber)\n .append(timeSpentMining);\n for (Transfer transfer : this.transfers) {\n String transferDesc = transfer.getDescription();\n hashInput.append(transferDesc);\n }\n return CryptoUtil.applySha256(hashInput.toString());\n }", "@Override\n\tpublic List<BankTransaction> getAllTransactions() throws BusinessException {\n\t\tBankTransaction bankTransaction = null;\n\t\tList<BankTransaction> bankTransactionList = new ArrayList<>();\n\t\tConnection connection;\n\n\t\ttry {\n\t\t\tconnection = PostgresqlConnection.getConnection();\n\t\t\tString sql = \"select transaction_id, account_id, transaction_type, amount, transaction_date from dutybank.transactionss\";\n\t\t\t\n\t\t\tPreparedStatement preparedStatement = connection.prepareStatement(sql);\n\n\t\t\tResultSet resultSet = preparedStatement.executeQuery();\n\t\t\t\n\t\t\t\n\t\t\twhile (resultSet.next()) {\n\t\t\t\tbankTransaction = new BankTransaction();\n\t\t\t\tbankTransaction.setTransactionid(resultSet.getInt(\"transaction_id\"));\n\t\t\t\tbankTransaction.setAccountid(resultSet.getInt(\"account_id\"));\n\t\t\t\tbankTransaction.setTransactiontype(resultSet.getString(\"transaction_type\"));\n\t\t\t\tbankTransaction.setTransactionamount(resultSet.getDouble(\"amount\"));\n\t\t\t\tbankTransaction.setTransactiondate(resultSet.getDate(\"transaction_date\"));\n\n\t\t\t\tbankTransactionList.add(bankTransaction);\n\t\t\t} \n\t\t\t\n\t\t\tif (bankTransactionList.size() == 0) {\n\t\t\t\tthrow new BusinessException(\"There is not data to retrieve\");\n\t\t\t}\n\t\t\n\t\t} catch (ClassNotFoundException | SQLException e) {\n\t\t\tthrow new BusinessException(\"Some Error ocurred retrieving data for transactions\");\n\t\t}\n\t\t\n\t\treturn bankTransactionList;\n\t}", "public void printAllTransaction() {\n\t\tregister[registerSelected].printAllTransactions();\n\t}", "protected void startTopLevelTrx() {\n startTransaction();\n }", "public TransactionInfo getTransactionInfo(String transactionId){\n\t\tTransactionInfo trInfo = new TransactionInfo();\n\t\tfor (ExtendedBlock block: node.blockchain.getBlockchain()) {\n\t\t\tfor(StateTransaction tr: block.internBlock.transactions){\n\t\t\t\ttrInfo.transactionId = tr.getTransctionId();\n\t\t\t\ttrInfo.nonce = tr.getNonce();\n\t\t\t\ttrInfo.signature = tr.getSignature();\n\t\t\t\t\n\t\t\t\tif (tr instanceof StateDataTransaction) {\n\t\t\t\t\ttrInfo.fromAddress = ((StateDataTransaction)tr).GetAddressString();\n\t\t\t\t\ttrInfo.newValue = ((StateDataTransaction)tr).newValue;\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t}\n\t\t\t\telse if (tr instanceof StateTransferTransaction){\n\t\t\t\t\ttrInfo.fromAddress = CryptoUtil.getStringFromKey(((StateTransferTransaction)tr).fromAddress);\n\t\t\t\t\ttrInfo.toAddress = CryptoUtil.getStringFromKey(((StateTransferTransaction)tr).toAddress);\n\t\t\t\t\ttrInfo.amount = ((StateTransferTransaction)tr).amount;\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\t// error unknown transaction in the chain\n\t\t\t\t}\n\t\t\t}\n\t\t}\t\n\t\treturn trInfo;\n\t}", "public void setTxid(String txid) {\n this.txid = txid;\n }", "@Override\n public List<Transaction> getTxListFromCache() {\n return null;\n }", "@Override\n\tpublic List<TransactionHistory> getTransactionByUserId(String id, int state) {\n\t\tList<TransactionHistory> result = null;\n\t\t\n\t\tTypedQuery<TransactionHistory> query = em.createQuery(\"SELECT t FROM TransactionHistory t WHERE (t.sendAccount.id = :id \"\n\t\t\t\t+ \" OR t.receiveAccount.id = :id) AND t.state.idState = :state\", TransactionHistory.class);\n\t\tquery.setParameter(\"id\", id);\n\t\tquery.setParameter(\"state\", state);\n\t\tresult = query.getResultList();\n\t\t\n\t\treturn result;\n\t}", "public void addTransaction(Transaction tx) {\n this.txPool.addTransaction(tx);\n }", "@java.lang.Override\n public com.google.protobuf.ByteString getTransactions(int index) {\n return instance.getTransactions(index);\n }", "private void createTx() throws Exception {\n PublicKey recipient = Seed.getRandomAddress();\n Transaction tx = new Transaction(wallet.pb, recipient, wallet.pr);\n//\t\tSystem.out.println(\"Created a tx\");\n txPool.add(tx);\n//\t\tcache.put(tx.txId, null);\n sendTx(tx);\n }", "public List<TransactionDetails> getDetailsforInternalTransfer(String transactionId) {\n\t\tString sql=\"Select * from transaction where id=?\";\n\t\tList<TransactionDetails> list=jdbcTemplate.query(sql,new Object[] {transactionId}, new TransactionDetailMapper() );\n\t\treturn list;\n\t\t\n\t}", "private void clearTransactions() {\n transactions_ = emptyProtobufList();\n }", "public byte[] getHashData(){\r\n byte[] hashData = Serializer.createParcel(\r\n new Object[]{\r\n getParentHash(),\r\n getNonce(),\r\n getTimeStamp(),\r\n BigInteger.valueOf(getIndex()), //Parcel encoding doesnt support longs\r\n BigInteger.valueOf(getDifficulty()), //Parcel encoding doesnt support longs\r\n getMinerAddress(),\r\n getReward(),\r\n getMerkleRoot(),\r\n getAxiomData(),\r\n getBlockData()\r\n });\r\n return hashData;\r\n }", "java.lang.String getTxId();", "public TransactionResponse processAllTransaction() throws ParseException {\n TransactionResponse response = new TransactionResponse();\n\n //User0\n response.setTransaction(new Transaction(\"user0\",\"0001\", \"type0\",\"user0_Billing\",\"user0_Sub\",\n new SimpleDateFormat(\"yyyy-mm-dd-hh\").parse(\"2020-01-02-00\")));\n\n //User1\n response.setTransaction(new Transaction(\"user1\", \"0101\",\"type0\",\"user1_Billing\", \"user1_Sub\",\n new SimpleDateFormat(\"yyyy-mm-dd-hh\").parse(\"2020-01-02-02\")));\n\n response.setTransaction(new Transaction(\"user1\", \"0102\", \"type1\",\"user1_Billing\", \"user1_Sub\",\n new SimpleDateFormat(\"yyyy-mm-dd-hh\").parse(\"2020-01-03-00\")));\n\n //User2\n response.setTransaction(new Transaction(\"user2\", \"0201\", \"type1\",\"user2_Billing\", \"user2_Sub\",\n new SimpleDateFormat(\"yyyy-mm-dd-hh\").parse(\"2020-01-01-00\")));\n\n response.setTransaction(new Transaction(\"user2\", \"0202\", \"type2\",\"user2_Billing\", \"user2_Sub\",\n new SimpleDateFormat(\"yyyy-mm-dd-hh\").parse(\"2020-01-03-01\")));\n\n response.setTransaction(new Transaction(\"user2\", \"0203\",\"type1\",\"user2_Billing\", \"user2_Sub\",\n new SimpleDateFormat(\"yyyy-mm-dd-hh\").parse(\"2020-01-03-01\")));\n\n //User3\n response.setTransaction(new Transaction(\"user3\", \"0301\",\"type0\",\"user3_Billing\", \"user3_Sub\",\n new SimpleDateFormat(\"yyyy-mm-dd-hh\").parse(\"2020-01-02-02\")));\n\n response.setTransaction(new Transaction(\"user3\", \"0302\",\"type1\",\"user3_Billing\", \"user3_Sub\",\n new SimpleDateFormat(\"yyyy-mm-dd-hh\").parse(\"2020-01-03-01\")));\n\n return response;\n }", "Transaction createTransaction();", "@Override\r\n\t\t\tpublic Object doInTransaction(TransactionStatus arg0) {\n\t\t\t\t\r\n\t\t\t\tSqlLogInspetor sqlLogInspetor = new SqlLogInspetor();\r\n\t\t\t\tsqlLogInspetor.enable();\r\n\t\t\t\t\r\n\t\t\t\t@SuppressWarnings(\"unchecked\")\r\n\t\t\t\tList<MasterBEnt> masterBEntList = \r\n\t\t\t\t\t\thbSupport.createCriteria(ss, MasterBEnt.class)\r\n\t\t\t\t\t\t\t.addOrder(OrderCompat.asc(\"compId.idA\"))\r\n\t\t\t\t\t\t\t.addOrder(OrderCompat.asc(\"compId.idB\")).list();\r\n\t\t\t\tList<Map<String, Map<String, MasterBEnt>>> masterBEntBizarreList = new ArrayList<>();\r\n\t\t\t\t\r\n\t\t\t\tfor (MasterBEnt masterB : masterBEntList) {\r\n\t\t\t\t\tSignatureBean signBean = ((IPlayerManagerImplementor) PlayerManagerTest.this.manager).generateSignature(masterB);\r\n\t\t\t\t\tString signStr = PlayerManagerTest.this.manager.serializeSignature(signBean);\r\n\t\t\t\t\tMap<String, Map<String, MasterBEnt>> mapItem = new LinkedHashMap<>();\r\n\t\t\t\t\tPlayerSnapshot<MasterBEnt> masterBPS = PlayerManagerTest.this.manager.createPlayerSnapshot(masterB);\r\n\t\t\t\t\tMap<String, MasterBEnt> mapMapItem = new LinkedHashMap<>();\r\n\t\t\t\t\tmapMapItem.put(\"wrappedSnapshot\", masterB);\r\n\t\t\t\t\tmapItem.put(signStr, mapMapItem);\r\n\t\t\t\t\tmasterBEntBizarreList.add(mapItem);\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\tPlayerManagerTest\r\n\t\t\t\t\t.this\r\n\t\t\t\t\t\t.manager\r\n\t\t\t\t\t\t.overwriteConfigurationTemporarily(\r\n\t\t\t\t\t\t\tPlayerManagerTest\r\n\t\t\t\t\t\t\t\t.this\r\n\t\t\t\t\t\t\t\t\t.manager\r\n\t\t\t\t\t\t\t\t\t\t.getConfig()\r\n\t\t\t\t\t\t\t\t\t\t\t.clone()\r\n\t\t\t\t\t\t\t\t\t\t\t.configSerialiseBySignatureAllRelationship(false));\r\n\t\t\t\t\r\n\t\t\t\tPlayerSnapshot<List<Map<String, Map<String, MasterBEnt>>>> playerSnapshot = PlayerManagerTest.this.manager.createPlayerSnapshot(masterBEntBizarreList);\r\n\t\t\t\t\r\n\t\t\t\tFileOutputStream fos;\r\n\t\t\t\ttry {\r\n\t\t\t\t\tfos = new FileOutputStream(generatedFileResult);\r\n\t\t\t\t\tPlayerManagerTest\r\n\t\t\t\t\t\t.this\r\n\t\t\t\t\t\t\t.manager\r\n\t\t\t\t\t\t\t\t.getConfig()\r\n\t\t\t\t\t\t\t\t\t.getObjectMapper()\r\n\t\t\t\t\t\t\t\t\t\t.writerWithDefaultPrettyPrinter()\r\n\t\t\t\t\t\t\t\t\t\t\t.writeValue(fos, playerSnapshot);\r\n\t\t\t\t\t\r\n\t\t\t\t} catch (Exception e) {\r\n\t\t\t\t\t// TODO Auto-generated catch block\r\n\t\t\t\t\tthrow new RuntimeException(\"Unexpected\", e);\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\tsqlLogInspetor.disable();\r\n\t\t\t\t\r\n\t\t\t\treturn null;\r\n\t\t\t}", "void beginTransaction();", "protected void setupTableCommandExp(StringBuilder sb, RomanticTransaction tx) {\n final Map<String, Set<String>> tableCommandMap = tx.getReadOnlyTableCommandMap();\n if (!tableCommandMap.isEmpty()) {\n final StringBuilder mapSb = new StringBuilder();\n mapSb.append(\"map:{\");\n int index = 0;\n for (Entry<String, Set<String>> entry : tableCommandMap.entrySet()) {\n final String tableName = entry.getKey();\n final Set<String> commandSet = entry.getValue();\n if (index > 0) {\n mapSb.append(\" ; \");\n }\n mapSb.append(tableName);\n mapSb.append(\" = list:{\").append(Srl.connectByDelimiter(commandSet, \" ; \")).append(\"}\");\n ++index;\n }\n mapSb.append(\"}\");\n sb.append(\", \").append(mapSb.toString());\n }\n }", "@Test\n public void TxHandlerTestForth() throws NoSuchAlgorithmException, SignatureException, InvalidKeyException {\n // generate key pairs, simulate initial tx from scrooge to alice\n System.out.println(\"-----------------------------------------------------------------\");\n System.out.println(\"Test if the TxHandler can reject invalid signature\");\n KeyPair pkScrooge = KeyPairGenerator.getInstance(\"RSA\").generateKeyPair();\n KeyPair pkAlice = KeyPairGenerator.getInstance(\"RSA\").generateKeyPair();\n KeyPair pkBob = KeyPairGenerator.getInstance(\"RSA\").generateKeyPair();\n\n Transaction tx0 = new Transaction();\n tx0.addOutput(25, pkScrooge.getPublic());\n\n byte[] initHash = null;\n tx0.addInput(initHash, 0);\n tx0.signTx(pkScrooge.getPrivate(), 0);\n\n UTXOPool utxoPool = new UTXOPool();\n UTXO utxo = new UTXO(tx0.getHash(), 0);\n utxoPool.addUTXO(utxo, tx0.getOutput(0));\n\n // tx1: scrooge to alice 20 coins\n Transaction tx1 = new Transaction();\n tx1.addInput(tx0.getHash(), 0);\n tx1.addOutput(20, pkAlice.getPublic());\n tx1.signTx(pkScrooge.getPrivate(), 0);\n\n TxHandler txHandler = new TxHandler(utxoPool);\n\n System.out.println(\"txHandler.isValidTx(tx1) returns: \" + txHandler.isValidTx(tx1));\n assertTrue(\"tx1:add one valid transaction\", txHandler.handleTxs(new Transaction[]{tx1}).length == 1);\n // update utxo pool\n utxoPool = txHandler.getHandledUtxoPool();\n assertTrue(\"tx1:one UTXO's created.\", utxoPool.getAllUTXO().size() == 1);\n\n // tx2: alice to bob 20coins[signed by bob]\n Transaction tx2 = new Transaction();\n tx2.addInput(tx1.getHash(), 0);\n tx2.addOutput(20, pkBob.getPublic());\n tx2.signTx(pkBob.getPrivate(), 0);\n\n txHandler = new TxHandler(utxoPool);\n\n System.out.println(\"txHandler.isValidTx(tx2) returns: \" + txHandler.isValidTx(tx2));\n assertTrue(\"tx2:add one invalid transaction\", txHandler.handleTxs(new Transaction[]{tx2}).length == 0);\n // update utxo pool\n utxoPool = txHandler.getHandledUtxoPool();\n assertTrue(\"tx2:one UTXO's remained.\", utxoPool.getAllUTXO().size() == 1);\n\n// System.out.println(\"tx1.hashCode returns: \" + tx1.hashCode());\n// System.out.println(\"tx2.hashCode returns: \" + tx2.hashCode());\n }", "private void initTransactions() {\n\n\t transactions = ModelFactory.createDefaultModel();\n\t try\n\t {\n\t\t\ttransactions.read(new FileInputStream(\"transactions.ttl\"),null,\"TTL\");\n\t\t}\n\t catch (FileNotFoundException e) {\n\t \tSystem.out.println(\"Error creating tansactions model\" + e.getMessage());\n\t\t\te.printStackTrace();\n\t\t}\n\t\t\n\t}", "@Override\n\tpublic void scan(Transaction tx) {\n\n\t}", "public void commit(Transaction t) {\n\t\ttry {\n\t\t\tArrayList<Record> records = new ArrayList<Record>();\n\t\t\tfor (int i = 0; i < t.noOfBundles; i++) {\n\t\t\t\tString record = \"\";\n\t\t\t\tBundle b = t.bundles[i];\n\t\t\t\tbyte[] recd = b.data;\n\t\t\t\trecord = new String(recd);\n\t\t\t\tString rec[] = record.split(\"\\n\");\n\t\t\t\tRecord r = new Record();\n\t\t\t\tr.rowid = Long.parseLong(rec[0]);\n\t\t\t\tr.groupid = rec[1];\n\t\t\t\tr.key = rec[2];\n\t\t\t\tr.value = rec[3];\n\t\t\t\tr.user = rec[4];\n\t\t\t\tr.datatype = rec[5];\n\t\t\t\tr.timestamp = Long.parseLong(rec[6]);\n\t\t\t\tr.synced = \"Y\";\n\t\t\t\tif (r.datatype.equals(\"file\")) {\n\t\t\t\t\tint l = Integer.parseInt(r.value.substring(0,\n\t\t\t\t\t\t\tr.value.indexOf(' ')));\n\t\t\t\t\tString fileName = r.value\n\t\t\t\t\t\t\t.substring(r.value.indexOf(' ') + 1);\n\t\t\t\t\tfileName = deviceId + \"_\" + t.transactionId + \"_\" + i + \"_\"\n\t\t\t\t\t\t\t+ fileName;\n\t\t\t\t\tString path = storagePath + \"/\" + fileName;\n\t\t\t\t\tFile f = new File(path);\n\t\t\t\t\tFileOutputStream fos = new FileOutputStream(f);\n\t\t\t\t\tfor (int j = 1; j <= l; j++) {\n\t\t\t\t\t\tb = t.bundles[i + j];\n\t\t\t\t\t\tfos.write(b.data);\n\t\t\t\t\t}\n\t\t\t\t\tfos.close();\n\t\t\t\t\ti += l;\n\t\t\t\t\tr.value = path;\n\t\t\t\t}\n\t\t\t\trecords.add(r);\n\t\t\t}\n\t\t\tdh.putToRepository(records);\n\t\t} catch (Exception e) {\n\t\t\te.printStackTrace();\n\t\t}\n\t}", "public static void checkTransactionBasics(Transaction tx, boolean must_be_coinbase)\n throws ValidationException\n {\n try(TimeRecordAuto tra_blk = TimeRecord.openAuto(\"Validation.checkTransactionBasics\"))\n {\n if (tx.toByteString().size() > Globals.MAX_TX_SIZE)\n {\n throw new ValidationException(\"Transaction too big\");\n }\n validateChainHash(tx.getTxHash(), \"tx_hash\");\n\n\n TransactionInner inner = null;\n\n try\n {\n CodedInputStream code_in = CodedInputStream.newInstance(tx.getInnerData().toByteArray());\n\n inner = TransactionInner.parseFrom(code_in);\n\n if (!code_in.isAtEnd())\n {\n throw new ValidationException(\"Extra data at end of tx inner\");\n }\n }\n catch(java.io.IOException e)\n {\n throw new ValidationException(e);\n }\n\n MessageDigest md = DigestUtil.getMD();\n MessageDigest md_addr = DigestUtil.getMDAddressSpec();\n md.update(tx.getInnerData().toByteArray());\n\n ChainHash found_hash = new ChainHash(md.digest());\n\n if (!found_hash.equals(tx.getTxHash()))\n {\n throw new ValidationException(\"TX hash mismatch\");\n }\n \n if (inner.getVersion() != 1)\n {\n throw new ValidationException(String.format(\"Unknown transaction version: %d\", inner.getVersion()));\n }\n\n if (must_be_coinbase)\n {\n if (!inner.getIsCoinbase())\n {\n throw new ValidationException(\"must be coinbase\");\n }\n if (inner.getInputsCount() > 0)\n {\n throw new ValidationException(\"coinbase must have zero inputs\");\n }\n if (inner.getCoinbaseExtras().getRemarks().size() > Globals.COINBASE_REMARKS_MAX)\n {\n throw new ValidationException(String.format(\"Coinbase remarks of %d over max of %d\", \n inner.getCoinbaseExtras().getRemarks().size(),\n Globals.COINBASE_REMARKS_MAX));\n }\n if (tx.getSignaturesCount() != 0)\n {\n throw new ValidationException(\"coinbase shouldn't have signatures\");\n }\n if (inner.getFee() != 0)\n {\n throw new ValidationException(\"coinbase shouldn't have fee\");\n }\n }\n else\n {\n if (inner.getIsCoinbase())\n {\n throw new ValidationException(\"unexpected coinbase\");\n }\n if (inner.getInputsCount() == 0)\n {\n throw new ValidationException(\"only coinbase can have zero inputs\");\n }\n CoinbaseExtras extras = inner.getCoinbaseExtras();\n CoinbaseExtras blank = CoinbaseExtras.newBuilder().build();\n if (!extras.equals(blank))\n {\n throw new ValidationException(\"only coinbase can have extras\");\n }\n }\n\n if (inner.getOutputsCount() == 0)\n {\n throw new ValidationException(\"Transaction with no outputs makes no sense\");\n }\n if (inner.getOutputsCount() >= Globals.MAX_OUTPUTS)\n {\n throw new ValidationException(\"Too many outputs\");\n }\n\n validateNonNegValue(inner.getFee(), \"fee\");\n\n HashSet<AddressSpecHash> used_address_spec_hashes = new HashSet<>();\n for(TransactionInput in : inner.getInputsList())\n {\n validateNonNegValue(in.getSrcTxOutIdx(), \"input outpoint idx\");\n if (in.getSrcTxOutIdx() >= Globals.MAX_OUTPUTS)\n {\n throw new ValidationException(\"referencing impossible output idx\");\n }\n validateAddressSpecHash(in.getSpecHash(), \"input spec hash\");\n validateChainHash(in.getSrcTxId(), \"input transaction id\");\n\n used_address_spec_hashes.add(new AddressSpecHash(in.getSpecHash()));\n }\n if (used_address_spec_hashes.size() != inner.getClaimsCount())\n {\n throw new ValidationException(String.format(\"Mismatch of used spec hashes (%d) and claims (%d)\", \n used_address_spec_hashes.size(),\n inner.getClaimsCount()));\n }\n\n HashSet<AddressSpecHash> remaining_specs = new HashSet<>();\n remaining_specs.addAll(used_address_spec_hashes);\n\n for(AddressSpec spec : inner.getClaimsList())\n {\n AddressSpecHash spechash = AddressUtil.getHashForSpec(spec, md_addr);\n if (!remaining_specs.contains(spechash))\n {\n throw new ValidationException(String.format(\"claim for unused spec hash %s\", spechash.toString()));\n }\n remaining_specs.remove(spechash);\n\n }\n Assert.assertEquals(0, remaining_specs.size());\n\n //Now we know the address spec list we have covers all inputs. Now we have to make sure the signatures match up.\n\n // Maps claim idx -> set(key idx) of signed public keys\n // such that signed_claim_map.get(i).size() can be used to see if there are enough\n // signed keys for claim 'i'.\n TreeMap<Integer, Set<Integer> > signed_claim_map = new TreeMap<>();\n\n for(SignatureEntry se : tx.getSignaturesList())\n {\n if (inner.getClaimsCount() <= se.getClaimIdx()) throw new ValidationException(\"Signature entry for non-existant claim\");\n AddressSpec spec = inner.getClaims(se.getClaimIdx());\n\n if (spec.getSigSpecsCount() <= se.getKeyIdx()) throw new ValidationException(\"Signature entry for non-existant sig spec\");\n SigSpec sig_spec = spec.getSigSpecs(se.getKeyIdx());\n\n if (!SignatureUtil.checkSignature( sig_spec, tx.getTxHash(), se.getSignature()))\n {\n throw new ValidationException(\"signature failed\");\n }\n //So we have a valid signature on a valid claim! woot\n\n if (!signed_claim_map.containsKey(se.getClaimIdx())) signed_claim_map.put(se.getClaimIdx(), new TreeSet<Integer>());\n\n Set<Integer> set = signed_claim_map.get(se.getClaimIdx());\n if (set.contains(se.getKeyIdx())) throw new ValidationException(\"duplicate signatures for claim\");\n\n set.add(se.getKeyIdx());\n }\n\n // Make sure each claim is satisfied\n for(int claim_idx = 0; claim_idx < inner.getClaimsCount(); claim_idx++)\n {\n int found =0;\n if (signed_claim_map.containsKey(claim_idx)) found = signed_claim_map.get(claim_idx).size();\n AddressSpec claim = inner.getClaims(claim_idx);\n\n if (found < claim.getRequiredSigners())\n {\n throw new ValidationException(\n String.format(\"Claim %d only has %d of %d needed signatures\", \n claim_idx, found, claim.getRequiredSigners()));\n }\n }\n\n //Sanity check outputs\n for(TransactionOutput out : inner.getOutputsList())\n {\n validatePositiveValue(out.getValue(), \"output value\");\n validateAddressSpecHash(out.getRecipientSpecHash(), \"output spec hash\");\n }\n\n if (inner.getExtra().size() > Globals.MAX_TX_EXTRA)\n {\n throw new ValidationException(\"Extra string too long\");\n }\n }\n\n }", "void readOnlyTransaction();", "@Override\n public void run() {\n System.out.println(\"Blockchain Identity Funding Transaction hash is \" + sendResult.tx.getTxId());\n System.out.println(sendResult.tx.toString());\n System.out.println(\"Blockchain Identity object Initialization\" + sendResult.tx.getTxId());\n blockchainIdentity = new BlockchainIdentity(platform, (CreditFundingTransaction)sendRequest.tx, kit.wallet(), null);\n }", "synchronized void flushAll(int txnum) {\n\t \n for (ExerciseBuffer buff : bufferpool)\n if (buff.isModifiedBy(txnum))\n buff.flush();\n }", "public static void main(String[] args) {\n Account anushaAccount = new Account(456123, \"SBIK1014\", 100);\n Account priyaAccount = new Account(789456, \"SBIK1014\", 200);\n Account dhanuAccount = new Account(951753, \"SBIK1014\", 300);\n\n ArrayList<Account> accounts = new ArrayList<>();\n\n accounts.add(anushaAccount);\n accounts.add(priyaAccount);\n accounts.add(dhanuAccount);\n\n TransactionHistory anuTranHist1 = new TransactionHistory(\"8-Jun-2018\", \"savaings\", 25000);\n TransactionHistory anuTranHist2 = new TransactionHistory(\"28-nov-2018\", \"current\", 50000);\n TransactionHistory anuTranHist3 = new TransactionHistory(\"15-Mar-2018\", \"savaings\", 5000);\n\n TransactionHistory priyaTranHist1 = new TransactionHistory(\"8-Jun-2018\", \"savaings\", 25000);\n TransactionHistory priyaTranHist2 = new TransactionHistory(\"28-nov-2018\", \"current\", 50000);\n TransactionHistory priyaTranHist3 = new TransactionHistory(\"15-Mar-2018\", \"savaings\", 5000);\n\n TransactionHistory dhanuTranHist1 = new TransactionHistory(\"8-Jun-2018\", \"savaings\", 25000);\n TransactionHistory dhanuTranHist2 = new TransactionHistory(\"28-nov-2018\", \"current\", 50000);\n TransactionHistory dhanuTranHist3 = new TransactionHistory(\"15-Mar-2018\", \"savaings\", 5000);\n\n\n ArrayList<TransactionHistory> anuTransactionHistory = new ArrayList<>();\n anuTransactionHistory.add(anuTranHist1);\n anuTransactionHistory.add(anuTranHist2);\n anuTransactionHistory.add(anuTranHist3);\n\n ArrayList<TransactionHistory> priyaTransactionHistory = new ArrayList<>();\n anuTransactionHistory.add(priyaTranHist1);\n anuTransactionHistory.add(priyaTranHist2);\n anuTransactionHistory.add(priyaTranHist3);\n\n ArrayList<TransactionHistory> dhanuTransactionHistory = new ArrayList<>();\n anuTransactionHistory.add(dhanuTranHist1);\n anuTransactionHistory.add(dhanuTranHist2);\n anuTransactionHistory.add(dhanuTranHist3);\n\n //useless code\n //you have already instantiated arraylist above and filled it with objects.. you can use that\n // List<Account> accountDetails=Arrays.asList(anushaAccount,priyaAccount,dhanuAccount);\n //List<TransactionHistory> transHistory=Arrays.asList(anuTranHist1,anuTranHist2,anuTranHist3);\n\n Customer anusha = new Customer(\"anusha\", 26, \"28-mar-92\", anushaAccount, anuTransactionHistory);\n Customer priya = new Customer(\"priya\", 22, \"15-oct-96\", priyaAccount, priyaTransactionHistory);\n Customer dhanu = new Customer(\"dhanu\", 32, \"05-jan-82\", dhanuAccount, dhanuTransactionHistory);\n\n anusha.setAccount(anushaAccount);\n priya.setAccount(priyaAccount);\n dhanu.setAccount(dhanuAccount);\n\n List<Customer> customerDetails = Arrays.asList(anusha, priya, dhanu);\n\n\n Bank bank = new Bank(\"SBI\", \"BNGLR\", customerDetails);\n\n// use the utitlity class here and output the customer object with the highest amount\n // check if your logic is running fine and fix this by morning. I have to finish work, and will leave it to you.\n Customer highestAmountCustomer = BankUtility.getCustomerWithHighestDeposit(bank);\n\n System.out.println(\"Customer with highest bank balance is \"+ highestAmountCustomer.getName() + \" with value \"+highestAmountCustomer.getAccount().getAmount());\n }", "@Override\n public void run() {\n System.out.println(\"Sent coins onwards! Transaction hash is \" + sendResult.tx.getTxId());\n }", "private void printAll() {\n\n String infuraAddress = \"70ddb1f89ca9421885b6268e847a459d\";\n dappSmartcontractAddress = \"0x07d55a62b487d61a0b47c2937016f68e4bcec0e9\";\n smartContractGetfunctionAddress = \"0x7355a424\";\n\n CoinNetworkInfo coinNetworkInfo = new CoinNetworkInfo(\n CoinType.ETH,\n EthereumNetworkType.ROPSTEN,\n \"https://ropsten.infura.io/v3/\"+infuraAddress\n );\n\n List<Account> accountList = sBlockchain.getAccountManager()\n .getAccounts(hardwareWallet.getWalletId(), CoinType.ETH, EthereumNetworkType.ROPSTEN);\n\n ethereumService = (EthereumService) CoinServiceFactory.getCoinService(this, coinNetworkInfo);\n\n\n ethereumService.callSmartContractFunction(\n (EthereumAccount) accountList.get(0),\n dappSmartcontractAddress,\n smartContractGetfunctionAddress\n ).setCallback(new ListenableFutureTask.Callback<String>() {\n @Override\n public void onSuccess(String result) { //return hex string\n Log.d(\"SUCCESS TAG\", \"transaction data : \"+result);\n\n getPost(result, accountList);\n\n\n }\n\n @Override\n public void onFailure(@NotNull ExecutionException e) {\n Log.d(\"ERROR TAG #101\",e.toString());\n }\n\n @Override\n public void onCancelled(@NotNull InterruptedException e) {\n Log.d(\"ERROR TAG #102\",e.toString());\n }\n });\n\n\n }" ]
[ "0.65566754", "0.59645885", "0.55532134", "0.5427481", "0.54106987", "0.53729975", "0.534296", "0.534022", "0.53345394", "0.5310721", "0.52917504", "0.52553445", "0.5222752", "0.52190804", "0.51919603", "0.5182121", "0.51424474", "0.5078079", "0.5068935", "0.50375044", "0.5022184", "0.5021022", "0.5003202", "0.5001605", "0.4998189", "0.49950153", "0.49901536", "0.49852803", "0.49846885", "0.4978109", "0.49652663", "0.49581832", "0.49581832", "0.49581832", "0.49547425", "0.49435714", "0.49317196", "0.49242884", "0.4919491", "0.49144453", "0.49039286", "0.49003398", "0.48802575", "0.48782676", "0.48760283", "0.4864195", "0.48626393", "0.4862085", "0.48619568", "0.48544973", "0.48527402", "0.48456818", "0.48300794", "0.48206574", "0.4810957", "0.4810201", "0.4804929", "0.48004347", "0.47948137", "0.47825757", "0.47611633", "0.47554314", "0.47510865", "0.47495794", "0.4748597", "0.47463146", "0.47322494", "0.47233135", "0.4722203", "0.4718277", "0.47167814", "0.47137854", "0.4704567", "0.47043747", "0.47037384", "0.46974853", "0.46912265", "0.46902275", "0.468445", "0.46760586", "0.46734577", "0.4670107", "0.46695215", "0.46503964", "0.4650363", "0.46484578", "0.46472213", "0.4646098", "0.46301752", "0.46174866", "0.46150646", "0.46137545", "0.46135357", "0.46097466", "0.4605566", "0.46039754", "0.4601293", "0.459901", "0.45980045", "0.45967308" ]
0.7483831
0
All ERC20 token txs for given address
@NotNull List<TxErc20> txsErc20(@NotNull String address, long startBlock, long endBlock) throws EtherScanException;
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@NotNull\n List<TxErc721> txsErc721(@NotNull String address, long startBlock, long endBlock) throws EtherScanException;", "@NotNull\n List<Tx> txs(@NotNull String address, long startBlock, long endBlock) throws EtherScanException;", "@NotNull\n List<TxInternal> txsInternal(@NotNull String address, long startBlock, long endBlock) throws EtherScanException;", "@NotNull\n List<TxErc1155> txsErc1155(@NotNull String address, long startBlock, long endBlock) throws EtherScanException;", "@NotNull\n List<TxErc20> txsErc20(@NotNull String address, @NotNull String contractAddress, long startBlock, long endBlock)\n throws EtherScanException;", "@NotNull\n List<TxErc721> txsErc721(@NotNull String address, @NotNull String contractAddress, long startBlock, long endBlock)\n throws EtherScanException;", "@NotNull\n List<TxErc1155> txsErc1155(@NotNull String address, @NotNull String contractAddress, long startBlock, long endBlock)\n throws EtherScanException;", "public List<Token> getAllToken() throws BusinessException;", "java.lang.String getServiceAccountIdTokens(int index);", "@Override\n public List<UTXO> getOpenTransactionOutputs(List<Address> addresses) throws UTXOProviderException {\n\n List<UTXO> results = new LinkedList<UTXO>();\n for (Address a : addresses) {\n ByteBuffer bb = ByteBuffer.allocate(21);\n bb.put((byte) KeyType.ADDRESS_HASHINDEX.ordinal());\n bb.put(a.getHash160());\n\n ReadOptions ro = new ReadOptions();\n Snapshot sn = db.getSnapshot();\n ro.snapshot(sn);\n\n // Scanning over iterator very fast\n\n DBIterator iterator = db.iterator(ro);\n for (iterator.seek(bb.array()); iterator.hasNext(); iterator.next()) {\n ByteBuffer bbKey = ByteBuffer.wrap(iterator.peekNext().getKey());\n bbKey.get(); // remove the address_hashindex byte.\n byte[] addressKey = new byte[20];\n bbKey.get(addressKey);\n if (!Arrays.equals(addressKey, a.getHash160())) {\n break;\n }\n byte[] hashBytes = new byte[32];\n bbKey.get(hashBytes);\n int index = bbKey.getInt();\n Sha256Hash hash = Sha256Hash.wrap(hashBytes);\n UTXO txout;\n try {\n // TODO this should be on the SNAPSHOT too......\n // this is really a BUG.\n txout = getTransactionOutput(hash, index);\n } catch (BlockStoreException e) {\n throw new UTXOProviderException(\"block store execption\", e);\n }\n if (txout != null) {\n Script sc = txout.getScript();\n Address address = sc.getToAddress(params, true);\n UTXO output = new UTXO(txout.getHash(), txout.getIndex(), txout.getValue(), txout.getHeight(),\n txout.isCoinbase(), txout.getScript(), address.toString());\n results.add(output);\n }\n }\n try {\n iterator.close();\n ro = null;\n sn.close();\n sn = null;\n } catch (IOException e) {\n log.error(\"Error closing snapshot/iterator?\", e);\n }\n }\n return results;\n }", "public static java.util.List<com.ifl.rapid.customer.model.CRM_Trn_Address> findAll()\n\t\tthrows com.liferay.portal.kernel.exception.SystemException {\n\t\treturn getPersistence().findAll();\n\t}", "org.apache.geronimo.corba.xbeans.csiv2.tss.TSSIdentityTokenTypeList getIdentityTokenTypes();", "java.util.List<java.lang.String> getServiceAccountIdTokensList();", "@NotNull\n List<TxInternal> txsInternalByHash(@NotNull String txhash) throws EtherScanException;", "@Override\r\n\tpublic ArrayList<Rents> readRents(String address) {\n\t\treturn null;\r\n\t}", "public List<BigInteger> getNonceList(AionAddress acc) {\n\n List<BigInteger> nl = Collections.synchronizedList(new ArrayList<>());\n lock.readLock().lock();\n this.getAccView(acc).getMap().entrySet().parallelStream().forEach(e -> nl.add(e.getKey()));\n lock.readLock().unlock();\n\n return nl.parallelStream().sorted().collect(Collectors.toList());\n }", "com.google.protobuf.ByteString getServiceAccountIdTokensBytes(int index);", "public AddressList listAllAddresses(String addressBook)\n\t{\n\t\treturn controller.listAllAddresses(addressBook);\n\t}", "@CrossOrigin\n @RequestMapping(path=\"/address/customer\",method = RequestMethod.GET, produces = MediaType.APPLICATION_JSON_UTF8_VALUE)\n public ResponseEntity<AddressListResponse> getAllAddress(@RequestHeader(\"authorization\") final String authorization) throws AuthorizationFailedException {\n\n String[] splitStrings = authorization.split(\" \");\n String accessToken = splitStrings[1];\n\n CustomerEntity loggedCustomer = customerService.getCustomer(accessToken);\n List<AddressEntity> addressEntityList = addressService.getAllAddress(loggedCustomer);\n\n AddressListResponse addressListResponse = new AddressListResponse();\n if(addressEntityList==null){\n addressListResponse = null;\n return new ResponseEntity<>(addressListResponse, HttpStatus.OK);\n }\n\n List<AddressList> addressLists = new ArrayList<>();\n\n for (AddressEntity addressEntity : addressEntityList) {\n AddressList adr = new AddressList();\n adr.setId(UUID.fromString(addressEntity.getUuid()));\n adr.setFlatBuildingName(addressEntity.getFlatBuilNo());\n adr.setLocality(addressEntity.getLocality());\n adr.setCity(addressEntity.getCity());\n adr.setPincode(addressEntity.getPincode());\n\n AddressListState statesList = new AddressListState();\n String stateUuid = addressEntity.getState().getUuid();\n statesList.setId(UUID.fromString(stateUuid));\n statesList.setStateName(addressEntity.getState().getStateName());\n adr.setState(statesList);\n addressLists.add(adr);\n }\n\n return new ResponseEntity<>(addressListResponse.addresses(addressLists), HttpStatus.OK);\n\n }", "public List<Address> getAllAddresses() throws BackendException;", "public ArrayList<String> getAllTokens() {\n ArrayList<String> returnlist = new ArrayList<String>();\n // Select All Query\n String selectQuery = \"SELECT Token FROM \" + TABLE_NAME;\n\n SQLiteDatabase db = this.getWritableDatabase();\n Cursor cursor = db.rawQuery(selectQuery, null);\n\n // looping through all rows and adding to list\n if (cursor.moveToFirst()) {\n do {\n ArrayList<String> data = new ArrayList<String>();\n for (int i =0; i<cursor.getColumnCount(); i++){\n data.add(cursor.getString(i));\n }\n // Adding contact to list\n returnlist.add(data.get(0));\n } while (cursor.moveToNext());\n }\n\n // return contact list\n cursor.close();\n db.close();\n return returnlist;\n }", "private String parseAddresses(Address[] address) {\n String listAddress = \"\";\n\n if (address != null) {\n for (int i = 0; i < address.length; i++) {\n listAddress += address[i].toString() + \", \";\n }\n }\n if (listAddress.length() > 1) {\n listAddress = listAddress.substring(0, listAddress.length() - 2);\n }\n\n return listAddress;\n }", "AllUsersAddresses getAllUsersAddresses();", "List<String> getTokens();", "@Override\n\tpublic List<Address> FindAllAddress() {\n\t\treturn ab.FindAll();\n\t}", "public List<String> getTokens() {\n try {\n return tkDao.getTokens();\n } catch (SQLException ex) {\n throw new RuntimeException(\"an error occurred trying to get all tokens stored in database: \" + ex.getMessage());\n }\n }", "private Response getAddressList( String term )\n {\n\n ReferenceList list = null;\n try\n {\n if ( \"RestAddressService\".equals( AddressServiceProvider.getInstanceClass( ) ) )\n {\n list = AddressServiceProvider.searchAddress( null, term );\n }\n\n }\n catch( RemoteException e )\n {\n AppLogService.error( e );\n }\n\n if ( list == null )\n {\n _logger.error( Constants.ERROR_NOT_FOUND_RESOURCE );\n return Response.status( Response.Status.NOT_FOUND )\n .entity( JsonUtil.buildJsonResponse( new ErrorJsonResponse( Response.Status.NOT_FOUND.name( ), MSG_ERROR_GET_ADDRESSES ) ) ).build( );\n }\n\n return Response.status( Response.Status.OK ).entity( JsonUtil.buildJsonResponse( new JsonResponse( list ) ) ).build( );\n }", "public ArrayList<Token> listTokensTo(String identifier){\n ArrayList<Token> result = new ArrayList<Token>();\n Token token = getToken();\n int tempCurrentToken = currentToken;\n if(token == null) return result;\n do{\n if(token.identifier.equals(identifier)){\n break;\n }\n result.add(token);\n } while((token = nextToken()) != null);\n currentToken = tempCurrentToken;\n return result;\n\n }", "io.envoyproxy.envoy.data.dns.v3.DnsTable.AddressList getAddressList();", "List<?> getAddress();", "public List<Address> findAll();", "public NodeInformation[] getNodes() throws CassandraServerManagementException {\r\n StorageServiceMBean ssMBean = null;\r\n try {\r\n ssMBean = CassandraAdminDataHolder\r\n .getInstance().getCassandraMBeanLocator().locateStorageServiceMBean();\r\n } catch (CassandraServerManagementException e) {\r\n handleException(\"Error occurred while retrieving node information list\", e);\r\n }\r\n\r\n if (ssMBean == null) {\r\n handleException(\"Storage Server MBean is null\");\r\n }\r\n\r\n Map<String, String> tokenToEndpoint = ssMBean.getTokenToEndpointMap();\r\n List<String> sortedTokens = new ArrayList<String>(tokenToEndpoint.keySet());\r\n Collections.sort(sortedTokens);\r\n\r\n /* Calculate per-token ownership of the ring */\r\n Map<InetAddress, Float> ownerships = ssMBean.getOwnership();\r\n\r\n List<NodeInformation> nodeInfoList = new ArrayList<NodeInformation>();\r\n for (String token : sortedTokens) {\r\n String primaryEndpoint = tokenToEndpoint.get(token);\r\n String status = ssMBean.getLiveNodes().contains(primaryEndpoint)\r\n ? CassandraManagementConstants.NodeStatuses.NODE_STATUS_UP\r\n : ssMBean.getUnreachableNodes().contains(primaryEndpoint)\r\n ? CassandraManagementConstants.NodeStatuses.NODE_STATUS_DOWN\r\n : CassandraManagementConstants.NodeStatuses.NODE_STATUS_UNKNOWN;\r\n\r\n String state = ssMBean.getJoiningNodes().contains(primaryEndpoint)\r\n ? CassandraManagementConstants.NodeStatuses.NODE_STATUS_JOINING\r\n : ssMBean.getLeavingNodes().contains(primaryEndpoint)\r\n ? CassandraManagementConstants.NodeStatuses.NODE_STATUS_LEAVING\r\n : CassandraManagementConstants.NodeStatuses.NODE_STATUS_NORMAL;\r\n\r\n Map<String, String> loadMap = ssMBean.getLoadMap();\r\n String load = loadMap.containsKey(primaryEndpoint)\r\n ? loadMap.get(primaryEndpoint)\r\n : CassandraManagementConstants.NodeStatuses.NODE_STATUS_UNKNOWN;\r\n\r\n Float ownership = ownerships.get(token);\r\n String owns = \"N/A\";\r\n if(ownership!=null){\r\n owns = new DecimalFormat(\"##0.00%\").format(ownership);\r\n }\r\n NodeInformation nodeInfo = new NodeInformation();\r\n nodeInfo.setAddress(primaryEndpoint);\r\n nodeInfo.setState(state);\r\n nodeInfo.setStatus(status);\r\n nodeInfo.setOwn(owns);\r\n nodeInfo.setLoad(load);\r\n nodeInfo.setToken(token);\r\n nodeInfoList.add(nodeInfo);\r\n }\r\n return nodeInfoList.toArray(new NodeInformation[nodeInfoList.size()]);\r\n }", "org.apache.geronimo.corba.xbeans.csiv2.tss.TSSIdentityTokenTypeList addNewIdentityTokenTypes();", "public abstract List<String> associateAddresses(NodeMetadata node);", "public static byte[] generateContractAddress(byte[] address, BigInteger nonce) {\n List<RlpType> values = new ArrayList<>();\n\n values.add(RlpString.create(address));\n values.add(RlpString.create(nonce));\n RlpList rlpList = new RlpList(values);\n\n byte[] encoded = RlpEncoder.encode(rlpList);\n byte[] hashed = Hash.sha3(encoded);\n return Arrays.copyOfRange(hashed, 12, hashed.length);\n }", "public List<String> findActiveCongestionPointAddresses(LocalDate period) {\n return congestionPointConnectionGroupRepository.findActiveCongestionPointConnectionGroup(period).stream()\n .map(ConnectionGroup::getUsefIdentifier).collect(Collectors.toList());\n }", "EmailAddress fetchEmailAddress(AccessToken token);", "public abstract String generateTokens(int targetNumber);", "@NotNull\n TokenBalance balance(@NotNull String address, @NotNull String contract) throws EtherScanException;", "public Vector<NetworkAddress> getHostAddresses(int type) {return addressesChecker.getAllMyAddresses(type); }", "public interface AccountAPI {\n\n /**\n * Address ETH balance\n * \n * @param address get balance for\n * @return balance\n * @throws EtherScanException parent exception class\n */\n @NotNull\n Balance balance(@NotNull String address) throws EtherScanException;\n\n /**\n * ERC20 token balance for address\n * \n * @param address get balance for\n * @param contract token contract\n * @return token balance for address\n * @throws EtherScanException parent exception class\n */\n @NotNull\n TokenBalance balance(@NotNull String address, @NotNull String contract) throws EtherScanException;\n\n /**\n * Maximum 20 address for single batch request If address MORE THAN 20, then there will be more than\n * 1 request performed\n * \n * @param addresses addresses to get balances for\n * @return list of balances\n * @throws EtherScanException parent exception class\n */\n @NotNull\n List<Balance> balances(@NotNull List<String> addresses) throws EtherScanException;\n\n /**\n * All txs for given address\n * \n * @param address get txs for\n * @param startBlock tx from this blockNumber\n * @param endBlock tx to this blockNumber\n * @return txs for address\n * @throws EtherScanException parent exception class\n */\n @NotNull\n List<Tx> txs(@NotNull String address, long startBlock, long endBlock) throws EtherScanException;\n\n @NotNull\n List<Tx> txs(@NotNull String address, long startBlock) throws EtherScanException;\n\n @NotNull\n List<Tx> txs(@NotNull String address) throws EtherScanException;\n\n /**\n * All internal txs for given address\n * \n * @param address get txs for\n * @param startBlock tx from this blockNumber\n * @param endBlock tx to this blockNumber\n * @return txs for address\n * @throws EtherScanException parent exception class\n */\n @NotNull\n List<TxInternal> txsInternal(@NotNull String address, long startBlock, long endBlock) throws EtherScanException;\n\n @NotNull\n List<TxInternal> txsInternal(@NotNull String address, long startBlock) throws EtherScanException;\n\n @NotNull\n List<TxInternal> txsInternal(@NotNull String address) throws EtherScanException;\n\n /**\n * All internal tx for given transaction hash\n * \n * @param txhash transaction hash\n * @return internal txs list\n * @throws EtherScanException parent exception class\n */\n @NotNull\n List<TxInternal> txsInternalByHash(@NotNull String txhash) throws EtherScanException;\n\n /**\n * All ERC-20 token txs for given address\n * \n * @param address get txs for\n * @param startBlock tx from this blockNumber\n * @param endBlock tx to this blockNumber\n * @return txs for address\n * @throws EtherScanException parent exception class\n */\n @NotNull\n List<TxErc20> txsErc20(@NotNull String address, long startBlock, long endBlock) throws EtherScanException;\n\n @NotNull\n List<TxErc20> txsErc20(@NotNull String address, long startBlock) throws EtherScanException;\n\n @NotNull\n List<TxErc20> txsErc20(@NotNull String address) throws EtherScanException;\n\n /**\n * All ERC-20 token txs for given address and contract address\n *\n * @param address get txs for\n * @param contractAddress contract address to get txs for\n * @param startBlock tx from this blockNumber\n * @param endBlock tx to this blockNumber\n * @return txs for address\n * @throws EtherScanException parent exception class\n */\n @NotNull\n List<TxErc20> txsErc20(@NotNull String address, @NotNull String contractAddress, long startBlock, long endBlock)\n throws EtherScanException;\n\n @NotNull\n List<TxErc20> txsErc20(@NotNull String address, @NotNull String contractAddress, long startBlock) throws EtherScanException;\n\n @NotNull\n List<TxErc20> txsErc20(@NotNull String address, @NotNull String contractAddress) throws EtherScanException;\n\n /**\n * All ERC-721 (NFT) token txs for given address\n *\n * @param address get txs for\n * @param startBlock tx from this blockNumber\n * @param endBlock tx to this blockNumber\n * @return txs for address\n * @throws EtherScanException parent exception class\n */\n @NotNull\n List<TxErc721> txsErc721(@NotNull String address, long startBlock, long endBlock) throws EtherScanException;\n\n @NotNull\n List<TxErc721> txsErc721(@NotNull String address, long startBlock) throws EtherScanException;\n\n @NotNull\n List<TxErc721> txsErc721(@NotNull String address) throws EtherScanException;\n\n /**\n * All ERC-721 (NFT) token txs for given address\n *\n * @param address get txs for\n * @param startBlock tx from this blockNumber\n * @param endBlock tx to this blockNumber\n * @return txs for address\n * @throws EtherScanException parent exception class\n */\n @NotNull\n List<TxErc721> txsErc721(@NotNull String address, @NotNull String contractAddress, long startBlock, long endBlock)\n throws EtherScanException;\n\n @NotNull\n List<TxErc721> txsErc721(@NotNull String address, @NotNull String contractAddress, long startBlock) throws EtherScanException;\n\n @NotNull\n List<TxErc721> txsErc721(@NotNull String address, @NotNull String contractAddress) throws EtherScanException;\n\n /**\n * All ERC-721 (NFT) token txs for given address\n *\n * @param address get txs for\n * @param startBlock tx from this blockNumber\n * @param endBlock tx to this blockNumber\n * @return txs for address\n * @throws EtherScanException parent exception class\n */\n @NotNull\n List<TxErc1155> txsErc1155(@NotNull String address, long startBlock, long endBlock) throws EtherScanException;\n\n @NotNull\n List<TxErc1155> txsErc1155(@NotNull String address, long startBlock) throws EtherScanException;\n\n @NotNull\n List<TxErc1155> txsErc1155(@NotNull String address) throws EtherScanException;\n\n /**\n * All ERC-721 (NFT) token txs for given address\n *\n * @param address get txs for\n * @param startBlock tx from this blockNumber\n * @param endBlock tx to this blockNumber\n * @return txs for address\n * @throws EtherScanException parent exception class\n */\n @NotNull\n List<TxErc1155> txsErc1155(@NotNull String address, @NotNull String contractAddress, long startBlock, long endBlock)\n throws EtherScanException;\n\n @NotNull\n List<TxErc1155> txsErc1155(@NotNull String address, @NotNull String contractAddress, long startBlock)\n throws EtherScanException;\n\n @NotNull\n List<TxErc1155> txsErc1155(@NotNull String address, @NotNull String contractAddress) throws EtherScanException;\n\n /**\n * All blocks mined by address\n * \n * @param address address to search for\n * @return blocks mined\n * @throws EtherScanException parent exception class\n */\n @NotNull\n List<Block> blocksMined(@NotNull String address) throws EtherScanException;\n}", "@Override\r\n\tpublic ArrayList<UserClass> readUsers(String address) {\n\t\treturn null;\r\n\t}", "Iterator<String> getTokenIterator();", "public ArrayList<String> retrieveIdentities(ArrayList<String> addresses) {\n ArrayList<String> addressIdentities = new ArrayList<>();\n\n // check if the conversation controller is null\n if (getConversationController() == null)\n return addressIdentities;\n\n // retrieve the identity of all addresses\n for (int i = 0; i < addresses.size(); i++) {\n addressIdentities.add(getConversationController().onIdentityRequest(addresses.get(i)));\n }\n\n return addressIdentities;\n }", "public static Map<String, String> listTokenFromCSP()\r\n\t\t\tthrows BkavSignaturesException {\r\n\t\tMap<String, String> result = new HashMap<>();\r\n\t\ttry {\r\n\t\t\tSunMSCAPI providerMSCAPI = new SunMSCAPI();\r\n\t\t\tSecurity.addProvider(providerMSCAPI);\r\n\t\t\tKeyStore ks = KeyStore.getInstance(CSP_KEYSTORE);\r\n\t\t\tks.load(null, null);\r\n\r\n\t\t\tEnumeration<String> aliases = ks.aliases();\r\n\t\t\tString alias = null;\r\n\r\n\t\t\twhile (aliases.hasMoreElements()) {\r\n\t\t\t\talias = aliases.nextElement();\r\n\t\t\t\tCertificate cert = ks.getCertificate(alias);\r\n\t\t\t\tif (cert instanceof X509Certificate) {\r\n\t\t\t\t\tX509Certificate x509Cert = (X509Certificate) cert;\r\n\t\t\t\t\tString certSerial = x509Cert.getSerialNumber().toString(16);\r\n\r\n\t\t\t\t\tString subjectDN = x509Cert.getSubjectDN().getName();\r\n\t\t\t\t\tString author = \"\";\r\n\t\t\t\t\tLdapName ldap;\r\n\t\t\t\t\ttry {\r\n\t\t\t\t\t\tldap = new LdapName(subjectDN);\r\n\t\t\t\t\t\tfor (Rdn rdn : ldap.getRdns()) {\r\n\t\t\t\t\t\t\tif (\"CN\".equalsIgnoreCase(rdn.getType())) {\r\n\t\t\t\t\t\t\t\tauthor = rdn.getValue().toString();\r\n\t\t\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t} catch (InvalidNameException e) {\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\tresult.put(certSerial, author);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t} catch (KeyStoreException e) {\r\n\t\t\tthrow new BkavSignaturesException(\"KeyStoreException\", e);\r\n\t\t} catch (NoSuchAlgorithmException e) {\r\n\t\t\tthrow new BkavSignaturesException(\"NoSuchAlgorithmException\", e);\r\n\t\t} catch (CertificateException e) {\r\n\t\t\tthrow new BkavSignaturesException(\"CertificateException\", e);\r\n\t\t} catch (IOException e) {\r\n\t\t\tthrow new BkavSignaturesException(\"IOException\", e);\r\n\t\t}\r\n\r\n\t\treturn result;\r\n\t}", "@GetMapping()\n\t@Override\n\tpublic List<Address> findAll() {\n\t\treturn addressService.findAll();\n\t}", "Map<String, String> getTokens();", "public List<Address> getAddresses(final SessionContext ctx)\n\t{\n\t\tList<Address> coll = (List<Address>)getProperty( ctx, ADDRESSES);\n\t\treturn coll != null ? coll : Collections.EMPTY_LIST;\n\t}", "public List<Email> getUnregisteredEmailList(Ram ram);", "List<Account> findAccountByAddressStartingWith(String pattern);", "public IndividualAddress(final String address) throws KNXFormatException\n\t{\n\t\tfinal String[] tokens = parse(address);\n\t\tif (tokens.length != 3)\n\t\t\tthrow new KNXFormatException(\"wrong individual address syntax with \"\n\t\t\t\t+ tokens.length + \" levels\", address);\n\t\ttry {\n\t\t\tinit(Byte.parseByte(tokens[0]), Byte.parseByte(tokens[1]),\n\t\t\t\tShort.parseShort(tokens[2]));\n\t\t}\n\t\tcatch (final KNXIllegalArgumentException e) {\n\t\t\tthrow new KNXFormatException(e.getMessage());\n\t\t}\n\t}", "public List<Agent> listAgentsByIdentiyNumber(String identityNumber);", "@Override\r\n\tpublic List<UserAddress> viewUserAddressList() {\r\n\t\tList<UserAddress> result = new ArrayList<UserAddress>();\r\n useraddressrepository.findAll().forEach(UserAddress1 -> result.add(UserAddress1));\r\n return result;\r\n\t}", "private void refreshNodeListAndTokenMap(Connection connection) throws ConnectionException, BusyConnectionException, ExecutionException, InterruptedException {\n\n ResultSetFuture peersFuture = new ResultSetFuture(null, new QueryMessage(SELECT_PEERS, ConsistencyLevel.DEFAULT_CASSANDRA_CL));\n ResultSetFuture localFuture = new ResultSetFuture(null, new QueryMessage(SELECT_LOCAL, ConsistencyLevel.DEFAULT_CASSANDRA_CL));\n connection.write(peersFuture.callback);\n connection.write(localFuture.callback);\n\n String partitioner = null;\n Map<Host, Collection<String>> tokenMap = new HashMap<Host, Collection<String>>();\n\n // Update cluster name, DC and rack for the one node we are connected to\n Row localRow = localFuture.get().one();\n if (localRow != null) {\n String clusterName = localRow.getString(\"cluster_name\");\n if (clusterName != null)\n cluster.metadata.clusterName = clusterName;\n\n partitioner = localRow.getString(\"partitioner\");\n\n Host host = cluster.metadata.getHost(connection.address);\n // In theory host can't be null. However there is no point in risking a NPE in case we\n // have a race between a node removal and this.\n if (host == null) {\n logger.debug(\"Host in local system table ({}) unknown to us (ok if said host just got removed)\", connection.address);\n } else {\n updateLocationInfo(host, localRow.getString(\"data_center\"), localRow.getString(\"rack\"));\n\n Set<String> tokens = localRow.getSet(\"tokens\", String.class);\n if (partitioner != null && !tokens.isEmpty())\n tokenMap.put(host, tokens);\n }\n }\n\n List<InetAddress> foundHosts = new ArrayList<InetAddress>();\n List<String> dcs = new ArrayList<String>();\n List<String> racks = new ArrayList<String>();\n List<Set<String>> allTokens = new ArrayList<Set<String>>();\n\n for (Row row : peersFuture.get()) {\n\n InetAddress addr = row.getInet(\"rpc_address\");\n if (addr == null) {\n addr = row.getInet(\"peer\");\n logger.error(\"No rpc_address found for host {} in {}'s peers system table. That should not happen but using address {} instead\", addr, connection.address, addr);\n } else if (addr.equals(bindAllAddress)) {\n addr = row.getInet(\"peer\");\n }\n\n foundHosts.add(addr);\n dcs.add(row.getString(\"data_center\"));\n racks.add(row.getString(\"rack\"));\n allTokens.add(row.getSet(\"tokens\", String.class));\n }\n\n for (int i = 0; i < foundHosts.size(); i++) {\n Host host = cluster.metadata.getHost(foundHosts.get(i));\n if (host == null) {\n // We don't know that node, add it.\n host = cluster.addHost(foundHosts.get(i), true);\n }\n updateLocationInfo(host, dcs.get(i), racks.get(i));\n\n if (partitioner != null && !allTokens.get(i).isEmpty())\n tokenMap.put(host, allTokens.get(i));\n }\n\n // Removes all those that seems to have been removed (since we lost the control connection)\n Set<InetAddress> foundHostsSet = new HashSet<InetAddress>(foundHosts);\n for (Host host : cluster.metadata.allHosts())\n if (!host.getAddress().equals(connection.address) && !foundHostsSet.contains(host.getAddress()))\n cluster.removeHost(host);\n\n if (partitioner != null)\n cluster.metadata.rebuildTokenMap(partitioner, tokenMap);\n }", "public List<IToken> getTokens();", "@NotNull\n List<Balance> balances(@NotNull List<String> addresses) throws EtherScanException;", "public boolean containsAddress(String address) {\n\t\treturn tseqnums.containsKey(address);\n\t}", "default List<ValidatorIndex> get_unslashed_attesting_indices(BeaconState state, List<PendingAttestation> attestations) {\n return attestations.stream()\n .flatMap(a -> get_attesting_indices(state, a.getData(), a.getAggregationBitfield()).stream())\n .distinct()\n .filter(i -> !state.getValidatorRegistry().get(i).getSlashed())\n .sorted()\n .collect(Collectors.toList());\n }", "@NotNull\n List<Block> blocksMined(@NotNull String address) throws EtherScanException;", "public List<Address> getAddresses()\n\t{\n\t\treturn getAddresses( getSession().getSessionContext() );\n\t}", "public IndividualAddress(final byte[] address)\n\t{\n\t\tsuper(address);\n\t}", "public static List<Address> GetAllRecordsFromTable() {\n\n return SQLite.select().from(Address.class).queryList();\n\n\n }", "public Transaction[] handleTxs(Transaction[] possibleTxs) {\n // IMPLEMENT THIS\n List<Transaction> validTxs = new ArrayList<>();\n for (Transaction tx : possibleTxs) {\n if (isValidTx(tx)) {\n validTxs.add(tx);\n ArrayList<Transaction.Output> outputs = tx.getOutputs();\n for (int idx = 0; idx < outputs.size(); idx++) {\n UTXO utxo = new UTXO(tx.getHash(), idx);\n utxoPool.addUTXO(utxo, outputs.get(idx));\n }\n }\n }\n\n return validTxs.toArray(new Transaction[0]);\n }", "public List<Address> getAllAddressesByName(String user_name) {\n\t\tList<Address> address = new ArrayList<>();\r\n\t\taddressdao.findByUserUsername(user_name)\r\n\t\t.forEach(address::add);\r\n\t\treturn address;\r\n\t}", "public AddressComponent[] getAddressComponents() {\n return addressComponents;\n }", "java.util.List<speech_formatting.SegmentedTextOuterClass.TokenSegment> \n getTokenSegmentList();", "public static String[] generateEPRs(SocketAcceptor acceptor, String serviceName, String ip) {\n //Get all the addresses associated with the acceptor\n Map<SessionID, SocketAddress> socketAddresses = acceptor.getAcceptorAddresses();\n //Get all the sessions (SessionIDs) associated with the acceptor\n ArrayList<SessionID> sessions = acceptor.getSessions();\n String[] EPRList = new String[sessions.size()];\n\n //Generate an EPR for each session/socket address\n for (int i = 0; i < sessions.size(); i++) {\n SessionID sessionID = sessions.get(i);\n InetSocketAddress socketAddress = (InetSocketAddress) socketAddresses.get(sessionID);\n EPRList[i] = FIXConstants.FIX_PREFIX + ip + \":\" + socketAddress.getPort() +\n \"?\" + FIXConstants.BEGIN_STRING + \"=\" + sessionID.getBeginString() +\n \"&\" + FIXConstants.SENDER_COMP_ID + \"=\" + sessionID.getTargetCompID() +\n \"&\" + FIXConstants.TARGET_COMP_ID + \"=\" + sessionID.getSenderCompID();\n\n String sessionQualifier = sessionID.getSessionQualifier();\n if (sessionQualifier != null && !sessionQualifier.equals(\"\")) {\n EPRList[i] += \"&\" + FIXConstants.SESSION_QUALIFIER + \"=\" + sessionQualifier;\n }\n\n String senderSubID = sessionID.getSenderSubID();\n if (senderSubID != null && !senderSubID.equals(\"\")) {\n EPRList[i] += \"&\" + FIXConstants.SENDER_SUB_ID + \"=\" + senderSubID;\n }\n\n String targetSubID = sessionID.getTargetSubID();\n if (targetSubID != null && !targetSubID.equals(\"\")) {\n EPRList[i] += \"&\" + FIXConstants.TARGET_SUB_ID + \"=\" + targetSubID;\n }\n\n String senderLocationID = sessionID.getSenderLocationID();\n if (senderLocationID != null && !senderLocationID.equals(\"\")) {\n EPRList[i] += \"&\" + FIXConstants.SENDER_LOCATION_ID + \"=\" + senderLocationID;\n }\n\n String targetLocationID = sessionID.getTargetLocationID();\n if (targetLocationID != null && !targetLocationID.equals(\"\")) {\n EPRList[i] += \"&\" + FIXConstants.TARGET_LOCATION_ID + \"=\" + targetLocationID;\n }\n\n EPRList[i] += \"&Service=\" + serviceName;\n }\n return EPRList;\n }", "public IndividualAddress(final int address)\n\t{\n\t\tsuper(address);\n\t}", "public void listAll(List<Address> AddressList) {\n for (Address a : AddressList) {\n console.promptForPrintPrompt(a.toString());\n }\n }", "public ArrayList<RouteTableEntry> getFIBExcludingLL3PAddress(Integer LL3PAddress) {\n \tIterator<RouteTableEntry> tableIterator=table.iterator();\n \tArrayList<RouteTableEntry> treatedForwaedingList= new ArrayList<RouteTableEntry>();\n\t\tRouteTableEntry tmp=null;\n\t\t//boolean found=false;\n\t\ttry{\n\t\twhile(tableIterator.hasNext()){\n\t\t\ttmp=tableIterator.next();\n\t\t\tInteger tmpLL3=tmp.getSourceLL3P();\n\t\t\tif(!(tmpLL3.equals(LL3PAddress))){\n\t\t\t\t\tInteger tmpNetworkNumber = tmp.getNetworkDistancePair().getNetworkNumber();\n\t\t\t\t\t//String hen=Integer.toHexString(LL3PAddress);\n\t\t\t\t Integer tmpLL3pNetworkNumber = Utilities.getNetworkNumber(Integer.toHexString(LL3PAddress));\n\t\t\t\t\tif (!(tmpNetworkNumber.equals(tmpLL3pNetworkNumber))){\n\t\t\t\t\t\ttreatedForwaedingList.add(tmp);\n\t\t\t }\n\t \t\t}\n\t\t}\n\t\t}\n\t\tcatch(Exception e){\n\t\t\t\n\t\t}\n\t\treturn treatedForwaedingList;\n }", "java.util.List<kr.pik.message.Profile.ProfileMessage.ContactAddress> \n getContactAddressList();", "@Test\n public void SameTokenNameOpenInvalidAddress() {\n dbManager.getDynamicPropertiesStore().saveAllowSameTokenName(1);\n InitExchangeSameTokenNameActive();\n long exchangeId = 1;\n String firstTokenId = \"123\";\n long firstTokenQuant = 100000000L;\n String secondTokenId = \"456\";\n long secondTokenQuant = 200000000L;\n\n byte[] ownerAddress = ByteArray.fromHexString(OWNER_ADDRESS_FIRST);\n AccountCapsule accountCapsule = dbManager.getAccountStore().get(ownerAddress);\n Map<String, Long> assetV2Map = accountCapsule.getAssetMapV2();\n Assert.assertEquals(10000_000000L, accountCapsule.getBalance());\n Assert.assertEquals(null, assetV2Map.get(firstTokenId));\n Assert.assertEquals(null, assetV2Map.get(secondTokenId));\n\n ExchangeWithdrawActuator actuator = new ExchangeWithdrawActuator(getContract(\n OWNER_ADDRESS_INVALID, exchangeId, firstTokenId, firstTokenQuant),\n dbManager);\n TransactionResultCapsule ret = new TransactionResultCapsule();\n\n try {\n actuator.validate();\n actuator.execute(ret);\n fail(\"Invalid address\");\n } catch (ContractValidateException e) {\n Assert.assertTrue(e instanceof ContractValidateException);\n Assert.assertEquals(\"Invalid address\", e.getMessage());\n } catch (ContractExeException e) {\n Assert.assertFalse(e instanceof ContractExeException);\n } finally {\n dbManager.getExchangeStore().delete(ByteArray.fromLong(1L));\n dbManager.getExchangeStore().delete(ByteArray.fromLong(2L));\n dbManager.getExchangeV2Store().delete(ByteArray.fromLong(1L));\n dbManager.getExchangeV2Store().delete(ByteArray.fromLong(2L));\n }\n }", "public void testLongStreetAddress() throws InterruptedException {\n Customer customer = CustomerService.getInstance().getCustomerById(new Integer(5276));\r\n ir.printInvoice(custInv, customer);\r\n }", "public static ArrayList<MacAddressDatabaseObject> getAllMacAddress() {\n\t\tEntityManagerFactory entityManagerFactory = LocalizationDataManager\n\t\t\t\t.getEntityManagerFactory();\n\t\tEntityManager createEntityManager = entityManagerFactory\n\t\t\t\t.createEntityManager();\n\t\tString query = \"Select * from mac_address where true\";\n\t\tQuery createQuery = createEntityManager.createNativeQuery(query,\n\t\t\t\tMacAddressDatabaseObject.class);\n\t\t@SuppressWarnings(\"unchecked\")\n\t\tList<MacAddressDatabaseObject> resultList = createQuery.getResultList();\n\n\t\treturn new ArrayList<MacAddressDatabaseObject>(resultList);\n\t}", "private static String[] getBank(String addr) {\r\n\t\tint tail = Integer.valueOf(addr.substring(addr.length()-2, addr.length()), 2);\r\n\t\t\r\n\t\tswitch (tail) {\r\n\t\t\tcase 0:\r\n\t\t\t\treturn bank0;\r\n\t\t\tcase 1: \r\n\t\t\t\treturn bank1;\r\n\t\t\tcase 2:\r\n\t\t\t\treturn bank2;\r\n\t\t\tdefault:\r\n\t\t\t\treturn bank3;\r\n\t\t}\r\n\t}", "private List<Messages.Address> mapModelAddressToWireAddress(List<byte[]> addresses) {\n return addresses.stream().map(address -> Messages.Address.newBuilder()\n .setPort(6565)\n .setIpAddress(ByteString.copyFrom(address))\n .build())\n .collect(Collectors.toList());\n }", "public void getUsers(String[] tokens) {\n\n }", "Collection lookupTransactions(String email);", "public static List<MemoryBlock> getAllMemoryAddresses() {\n\n List<MemoryBlock> addresses = new ArrayList<MemoryBlock>();\n\n for (int i = 0; i <= EEPROM_MAX_ADDRESS; i++) {\n addresses.add(new MemoryBlock(Utils.intToHexString(i), \"\"));\n }\n return addresses;\n }", "private static void findTokensByPattern (Document doc, String text, int start, int end) {\n\tMatcher emailMatcher = emailPat.matcher(text).region(start,end);\n\tspecialTokenEnd = new HashMap<Integer, Integer>();\n\tspecialTokenType = new HashMap<Integer, String>();\n\twhile (emailMatcher.find()) {\n\t\tint tokenStart = emailMatcher.start();\n\t\tint tokenEnd = emailMatcher.end();\n\t\tspecialTokenEnd.put(tokenStart, tokenEnd);\n\t\tspecialTokenType.put(tokenStart, \"email\");\n\t}\n\tMatcher urlMatcher = urlPat.matcher(text).region(start,end);\n\twhile (urlMatcher.find()) {\n\t\tint tokenStart = urlMatcher.start();\n\t\tint tokenEnd = urlMatcher.end();\n\t\tspecialTokenEnd.put(tokenStart, tokenEnd);\n\t\tspecialTokenType.put(tokenStart, \"url\");\n\t}\n}", "public List getAddressList() {\r\n System.out.println(\"List Elements :\" + addressList);\r\n return addressList;\r\n }", "default List<PendingAttestation> get_matching_head_attestations(BeaconState state, EpochNumber epoch) {\n return get_matching_source_attestations(state, epoch).stream()\n .filter(a -> a.getData().getBeaconBlockRoot().equals(\n get_block_root_at_slot(state, get_attestation_slot(state, a.getData()))))\n .collect(toList());\n }", "public void listing() {\r\n int count = 1;\r\n for (AdressEntry i : addressEntryList) {\r\n System.out.print(count + \": \");\r\n System.out.println(i);\r\n count++;\r\n }\r\n System.out.println();\r\n }", "public static Tax[] getTaxes() {\n Tax[] taxes = new Tax[DeclarationFiller.getDeclaration().size()];\n int count = 0;\n if (taxes != null ) {\n for (Map.Entry<String, Integer> incomePoint : DeclarationFiller.getDeclaration().entrySet()) {\n String taxName = \"Tax of \" + incomePoint.getKey();\n int incomValue = incomePoint.getValue();\n taxes[count] = new Tax(count+1001 ,taxName, incomValue, 0.18);\n count++;\n }\n }\n return taxes;\n }", "private byte[] primitiveGetToken() {\n return decode(addr_, mask_, token_);\n }", "public Token getTokenByEmail(String email)throws Exception;", "@Test\n\tpublic void listLocations(){\n\t\tList<Location> lists = locationService.queryLoctionsByLat(29.8679775, 121.5450105);\n\t\t//System.out.println(lists.size()) ;\n\t\tfor(Location loc : lists){\n\t\t\tSystem.out.println(loc.getAddress_cn());\n\t\t}\n\t}", "public static long[] getSlotsWithTokens(String libraryPath) {\n CK_C_INITIALIZE_ARGS initArgs = new CK_C_INITIALIZE_ARGS();\n String functionList = \"C_GetFunctionList\";\n\n initArgs.flags = 0;\n PKCS11 tmpPKCS11 = null;\n long[] slotList = null;\n try {\n try {\n tmpPKCS11 = PKCS11.getInstance(libraryPath, functionList, initArgs, false);\n } catch (IOException ex) {\n ex.printStackTrace();\n return null;\n }\n } catch (PKCS11Exception e) {\n try {\n initArgs = null;\n tmpPKCS11 = PKCS11.getInstance(libraryPath, functionList, initArgs, true);\n } catch (IOException | PKCS11Exception ex) {\n ex.printStackTrace();\n return null;\n }\n }\n\n try {\n slotList = tmpPKCS11.C_GetSlotList(true);\n\n for (long slot : slotList) {\n CK_TOKEN_INFO tokenInfo = tmpPKCS11.C_GetTokenInfo(slot);\n System.out.println(\"slot: \" + slot + \"\\nmanufacturerID: \"\n + String.valueOf(tokenInfo.manufacturerID) + \"\\nmodel: \"\n + String.valueOf(tokenInfo.model));\n }\n } catch (Throwable ex) {\n ex.printStackTrace();\n return null;\n }\n\n return slotList;\n }", "public static Address[] getAddressArray(final Address... address)\r\n\t{\r\n\t\treturn address;\r\n\t}", "public static List<String> getAllHardwareAddress() throws SocketException {\n ArrayList<String> addresses = new ArrayList<>();\n Enumeration<NetworkInterface> ifaces = NetworkInterface.getNetworkInterfaces();\n while (ifaces.hasMoreElements()) {\n NetworkInterface iface = ifaces.nextElement();\n byte[] macaddr = iface.getHardwareAddress();\n if (macaddr == null)\n continue;\n String key = String.format(MACADDR_FORMAT, macaddr[0], macaddr[1], macaddr[2], macaddr[3], macaddr[4], macaddr[5]);\n addresses.add(key);\n }\n return addresses;\n }", "List<Object> getTokens()\r\n\t{\r\n\t\treturn appearanceTokens;\r\n\t}", "private void printAll() {\n\n String infuraAddress = \"70ddb1f89ca9421885b6268e847a459d\";\n dappSmartcontractAddress = \"0x07d55a62b487d61a0b47c2937016f68e4bcec0e9\";\n smartContractGetfunctionAddress = \"0x7355a424\";\n\n CoinNetworkInfo coinNetworkInfo = new CoinNetworkInfo(\n CoinType.ETH,\n EthereumNetworkType.ROPSTEN,\n \"https://ropsten.infura.io/v3/\"+infuraAddress\n );\n\n List<Account> accountList = sBlockchain.getAccountManager()\n .getAccounts(hardwareWallet.getWalletId(), CoinType.ETH, EthereumNetworkType.ROPSTEN);\n\n ethereumService = (EthereumService) CoinServiceFactory.getCoinService(this, coinNetworkInfo);\n\n\n ethereumService.callSmartContractFunction(\n (EthereumAccount) accountList.get(0),\n dappSmartcontractAddress,\n smartContractGetfunctionAddress\n ).setCallback(new ListenableFutureTask.Callback<String>() {\n @Override\n public void onSuccess(String result) { //return hex string\n Log.d(\"SUCCESS TAG\", \"transaction data : \"+result);\n\n getPost(result, accountList);\n\n\n }\n\n @Override\n public void onFailure(@NotNull ExecutionException e) {\n Log.d(\"ERROR TAG #101\",e.toString());\n }\n\n @Override\n public void onCancelled(@NotNull InterruptedException e) {\n Log.d(\"ERROR TAG #102\",e.toString());\n }\n });\n\n\n }", "public List<GameToken> getAllTokens() {\n\t\tList<GameToken> result = new ArrayList<GameToken>();\n\t\tfor (int row = 0; row < board.length; row++) {\n\t\t\tfor (int column = 0; column < board[row].length; column++) {\n\t\t\t\tGameToken token = this.board[row][column];\n\t\t\t\tif (token != null) {\n\t\t\t\t\tresult.add(token);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn result;\n\t}", "private void requestAddresses(byte nAddr) throws Exception {\n final HashSet<Inet4Address> addrs = new HashSet<>();\n byte[] hwAddrBytes = new byte[] { 8, 4, 3, 2, 1, 0 };\n for (byte i = 0; i < nAddr; i++) {\n hwAddrBytes[5] = i;\n MacAddress newMac = MacAddress.fromBytes(hwAddrBytes);\n final String hostname = \"host_\" + i;\n final DhcpLease lease = mRepo.getOffer(CLIENTID_UNSPEC, newMac,\n IPV4_ADDR_ANY /* relayAddr */, INETADDR_UNSPEC /* reqAddr */, hostname);\n\n assertNotNull(lease);\n assertEquals(newMac, lease.getHwAddr());\n assertEquals(hostname, lease.getHostname());\n assertTrue(format(\"Duplicate address allocated: %s in %s\", lease.getNetAddr(), addrs),\n addrs.add(lease.getNetAddr()));\n\n requestLeaseSelecting(newMac, lease.getNetAddr(), hostname);\n }\n }", "public Call<ExpResult<List<DelegationInfo>>> getDelegations(MinterAddress address) {\n checkNotNull(address, \"Address can't be null\");\n\n return getInstantService().getDelegationsForAddress(address.toString(), 1);\n }", "public List<Address> listAddress()\n {\n @SuppressWarnings(\"unchecked\")\n List<Address> result = this.sessionFactory.getCurrentSession().createQuery(\"from AddressImpl as address order by address.id asc\").list();\n\n return result;\n }", "private String getLabel(int address) {\n int key = Arrays.binarySearch(addresses, address);\n if (key >= 0) {\n return \"(\" + symbols[key] + \")\";\n }\n return \"\";\n }", "public void setAddresses(List<String> addresses) {\n this.addresses = addresses;\n }", "public StringList lookupAddresses(String name) throws UnknownHostException\n {\n StringList names=new StringList(); \n // cached lookup \n InetAddress[] addres = lookup(name); \n \n for (InetAddress addr:addres)\n {\n // only add unique address\n names.add(addr.getHostAddress(),true); // getHostName()); \n }\n \n return names; \n }", "@Test\n public void SameTokenNameCloseInvalidAddress() {\n dbManager.getDynamicPropertiesStore().saveAllowSameTokenName(0);\n InitExchangeBeforeSameTokenNameActive();\n long exchangeId = 1;\n String firstTokenId = \"abc\";\n long firstTokenQuant = 100000000L;\n String secondTokenId = \"def\";\n long secondTokenQuant = 200000000L;\n\n byte[] ownerAddress = ByteArray.fromHexString(OWNER_ADDRESS_FIRST);\n AccountCapsule accountCapsule = dbManager.getAccountStore().get(ownerAddress);\n Map<String, Long> assetMap = accountCapsule.getAssetMap();\n Assert.assertEquals(10000_000000L, accountCapsule.getBalance());\n Assert.assertEquals(null, assetMap.get(firstTokenId));\n Assert.assertEquals(null, assetMap.get(secondTokenId));\n\n ExchangeWithdrawActuator actuator = new ExchangeWithdrawActuator(getContract(\n OWNER_ADDRESS_INVALID, exchangeId, firstTokenId, firstTokenQuant),\n dbManager);\n TransactionResultCapsule ret = new TransactionResultCapsule();\n\n try {\n actuator.validate();\n actuator.execute(ret);\n fail(\"Invalid address\");\n } catch (ContractValidateException e) {\n Assert.assertTrue(e instanceof ContractValidateException);\n Assert.assertEquals(\"Invalid address\", e.getMessage());\n } catch (ContractExeException e) {\n Assert.assertFalse(e instanceof ContractExeException);\n } finally {\n dbManager.getExchangeStore().delete(ByteArray.fromLong(1L));\n dbManager.getExchangeStore().delete(ByteArray.fromLong(2L));\n dbManager.getExchangeV2Store().delete(ByteArray.fromLong(1L));\n dbManager.getExchangeV2Store().delete(ByteArray.fromLong(2L));\n }\n }" ]
[ "0.6578457", "0.63740367", "0.63718665", "0.629876", "0.62776583", "0.6260949", "0.57160217", "0.5289427", "0.5241821", "0.51722187", "0.49511677", "0.49313334", "0.4917054", "0.48914167", "0.4823283", "0.48161685", "0.48022795", "0.476753", "0.47489625", "0.47373536", "0.47192734", "0.46661586", "0.46453503", "0.46024558", "0.45833254", "0.45211405", "0.44995216", "0.44885248", "0.44757885", "0.4471057", "0.44688746", "0.44555268", "0.4453347", "0.44379207", "0.44303042", "0.4418725", "0.4410496", "0.44047168", "0.44006547", "0.43954036", "0.43897682", "0.43834618", "0.43810797", "0.4374867", "0.4371433", "0.43632814", "0.43409127", "0.43405926", "0.43369767", "0.43366623", "0.43323854", "0.43298417", "0.43201417", "0.43168622", "0.43166286", "0.43086764", "0.43052152", "0.43005106", "0.42907536", "0.42873988", "0.4273481", "0.42704195", "0.42633313", "0.4259712", "0.42544186", "0.42460728", "0.42410782", "0.42391193", "0.42346933", "0.4229445", "0.42278245", "0.42263594", "0.4224563", "0.42217535", "0.420605", "0.42040917", "0.4198869", "0.41952312", "0.41944945", "0.41943806", "0.41936165", "0.41791472", "0.41784137", "0.417709", "0.4175415", "0.41745067", "0.41744843", "0.41726142", "0.41718283", "0.4170929", "0.41699472", "0.4163227", "0.4160418", "0.41597953", "0.4153703", "0.4152221", "0.41505945", "0.41454428", "0.41426086", "0.4139178" ]
0.68036443
0
All ERC20 token txs for given address and contract address
@NotNull List<TxErc20> txsErc20(@NotNull String address, @NotNull String contractAddress, long startBlock, long endBlock) throws EtherScanException;
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@NotNull\n List<TxErc721> txsErc721(@NotNull String address, @NotNull String contractAddress, long startBlock, long endBlock)\n throws EtherScanException;", "@NotNull\n List<TxErc721> txsErc721(@NotNull String address, long startBlock, long endBlock) throws EtherScanException;", "@NotNull\n List<TxErc20> txsErc20(@NotNull String address, long startBlock, long endBlock) throws EtherScanException;", "@NotNull\n List<Tx> txs(@NotNull String address, long startBlock, long endBlock) throws EtherScanException;", "@NotNull\n List<TxInternal> txsInternal(@NotNull String address, long startBlock, long endBlock) throws EtherScanException;", "@NotNull\n List<TxErc1155> txsErc1155(@NotNull String address, long startBlock, long endBlock) throws EtherScanException;", "@NotNull\n List<TxErc1155> txsErc1155(@NotNull String address, @NotNull String contractAddress, long startBlock, long endBlock)\n throws EtherScanException;", "java.lang.String getServiceAccountIdTokens(int index);", "@NotNull\n TokenBalance balance(@NotNull String address, @NotNull String contract) throws EtherScanException;", "@Override\n public List<UTXO> getOpenTransactionOutputs(List<Address> addresses) throws UTXOProviderException {\n\n List<UTXO> results = new LinkedList<UTXO>();\n for (Address a : addresses) {\n ByteBuffer bb = ByteBuffer.allocate(21);\n bb.put((byte) KeyType.ADDRESS_HASHINDEX.ordinal());\n bb.put(a.getHash160());\n\n ReadOptions ro = new ReadOptions();\n Snapshot sn = db.getSnapshot();\n ro.snapshot(sn);\n\n // Scanning over iterator very fast\n\n DBIterator iterator = db.iterator(ro);\n for (iterator.seek(bb.array()); iterator.hasNext(); iterator.next()) {\n ByteBuffer bbKey = ByteBuffer.wrap(iterator.peekNext().getKey());\n bbKey.get(); // remove the address_hashindex byte.\n byte[] addressKey = new byte[20];\n bbKey.get(addressKey);\n if (!Arrays.equals(addressKey, a.getHash160())) {\n break;\n }\n byte[] hashBytes = new byte[32];\n bbKey.get(hashBytes);\n int index = bbKey.getInt();\n Sha256Hash hash = Sha256Hash.wrap(hashBytes);\n UTXO txout;\n try {\n // TODO this should be on the SNAPSHOT too......\n // this is really a BUG.\n txout = getTransactionOutput(hash, index);\n } catch (BlockStoreException e) {\n throw new UTXOProviderException(\"block store execption\", e);\n }\n if (txout != null) {\n Script sc = txout.getScript();\n Address address = sc.getToAddress(params, true);\n UTXO output = new UTXO(txout.getHash(), txout.getIndex(), txout.getValue(), txout.getHeight(),\n txout.isCoinbase(), txout.getScript(), address.toString());\n results.add(output);\n }\n }\n try {\n iterator.close();\n ro = null;\n sn.close();\n sn = null;\n } catch (IOException e) {\n log.error(\"Error closing snapshot/iterator?\", e);\n }\n }\n return results;\n }", "public static byte[] generateContractAddress(byte[] address, BigInteger nonce) {\n List<RlpType> values = new ArrayList<>();\n\n values.add(RlpString.create(address));\n values.add(RlpString.create(nonce));\n RlpList rlpList = new RlpList(values);\n\n byte[] encoded = RlpEncoder.encode(rlpList);\n byte[] hashed = Hash.sha3(encoded);\n return Arrays.copyOfRange(hashed, 12, hashed.length);\n }", "public interface AccountAPI {\n\n /**\n * Address ETH balance\n * \n * @param address get balance for\n * @return balance\n * @throws EtherScanException parent exception class\n */\n @NotNull\n Balance balance(@NotNull String address) throws EtherScanException;\n\n /**\n * ERC20 token balance for address\n * \n * @param address get balance for\n * @param contract token contract\n * @return token balance for address\n * @throws EtherScanException parent exception class\n */\n @NotNull\n TokenBalance balance(@NotNull String address, @NotNull String contract) throws EtherScanException;\n\n /**\n * Maximum 20 address for single batch request If address MORE THAN 20, then there will be more than\n * 1 request performed\n * \n * @param addresses addresses to get balances for\n * @return list of balances\n * @throws EtherScanException parent exception class\n */\n @NotNull\n List<Balance> balances(@NotNull List<String> addresses) throws EtherScanException;\n\n /**\n * All txs for given address\n * \n * @param address get txs for\n * @param startBlock tx from this blockNumber\n * @param endBlock tx to this blockNumber\n * @return txs for address\n * @throws EtherScanException parent exception class\n */\n @NotNull\n List<Tx> txs(@NotNull String address, long startBlock, long endBlock) throws EtherScanException;\n\n @NotNull\n List<Tx> txs(@NotNull String address, long startBlock) throws EtherScanException;\n\n @NotNull\n List<Tx> txs(@NotNull String address) throws EtherScanException;\n\n /**\n * All internal txs for given address\n * \n * @param address get txs for\n * @param startBlock tx from this blockNumber\n * @param endBlock tx to this blockNumber\n * @return txs for address\n * @throws EtherScanException parent exception class\n */\n @NotNull\n List<TxInternal> txsInternal(@NotNull String address, long startBlock, long endBlock) throws EtherScanException;\n\n @NotNull\n List<TxInternal> txsInternal(@NotNull String address, long startBlock) throws EtherScanException;\n\n @NotNull\n List<TxInternal> txsInternal(@NotNull String address) throws EtherScanException;\n\n /**\n * All internal tx for given transaction hash\n * \n * @param txhash transaction hash\n * @return internal txs list\n * @throws EtherScanException parent exception class\n */\n @NotNull\n List<TxInternal> txsInternalByHash(@NotNull String txhash) throws EtherScanException;\n\n /**\n * All ERC-20 token txs for given address\n * \n * @param address get txs for\n * @param startBlock tx from this blockNumber\n * @param endBlock tx to this blockNumber\n * @return txs for address\n * @throws EtherScanException parent exception class\n */\n @NotNull\n List<TxErc20> txsErc20(@NotNull String address, long startBlock, long endBlock) throws EtherScanException;\n\n @NotNull\n List<TxErc20> txsErc20(@NotNull String address, long startBlock) throws EtherScanException;\n\n @NotNull\n List<TxErc20> txsErc20(@NotNull String address) throws EtherScanException;\n\n /**\n * All ERC-20 token txs for given address and contract address\n *\n * @param address get txs for\n * @param contractAddress contract address to get txs for\n * @param startBlock tx from this blockNumber\n * @param endBlock tx to this blockNumber\n * @return txs for address\n * @throws EtherScanException parent exception class\n */\n @NotNull\n List<TxErc20> txsErc20(@NotNull String address, @NotNull String contractAddress, long startBlock, long endBlock)\n throws EtherScanException;\n\n @NotNull\n List<TxErc20> txsErc20(@NotNull String address, @NotNull String contractAddress, long startBlock) throws EtherScanException;\n\n @NotNull\n List<TxErc20> txsErc20(@NotNull String address, @NotNull String contractAddress) throws EtherScanException;\n\n /**\n * All ERC-721 (NFT) token txs for given address\n *\n * @param address get txs for\n * @param startBlock tx from this blockNumber\n * @param endBlock tx to this blockNumber\n * @return txs for address\n * @throws EtherScanException parent exception class\n */\n @NotNull\n List<TxErc721> txsErc721(@NotNull String address, long startBlock, long endBlock) throws EtherScanException;\n\n @NotNull\n List<TxErc721> txsErc721(@NotNull String address, long startBlock) throws EtherScanException;\n\n @NotNull\n List<TxErc721> txsErc721(@NotNull String address) throws EtherScanException;\n\n /**\n * All ERC-721 (NFT) token txs for given address\n *\n * @param address get txs for\n * @param startBlock tx from this blockNumber\n * @param endBlock tx to this blockNumber\n * @return txs for address\n * @throws EtherScanException parent exception class\n */\n @NotNull\n List<TxErc721> txsErc721(@NotNull String address, @NotNull String contractAddress, long startBlock, long endBlock)\n throws EtherScanException;\n\n @NotNull\n List<TxErc721> txsErc721(@NotNull String address, @NotNull String contractAddress, long startBlock) throws EtherScanException;\n\n @NotNull\n List<TxErc721> txsErc721(@NotNull String address, @NotNull String contractAddress) throws EtherScanException;\n\n /**\n * All ERC-721 (NFT) token txs for given address\n *\n * @param address get txs for\n * @param startBlock tx from this blockNumber\n * @param endBlock tx to this blockNumber\n * @return txs for address\n * @throws EtherScanException parent exception class\n */\n @NotNull\n List<TxErc1155> txsErc1155(@NotNull String address, long startBlock, long endBlock) throws EtherScanException;\n\n @NotNull\n List<TxErc1155> txsErc1155(@NotNull String address, long startBlock) throws EtherScanException;\n\n @NotNull\n List<TxErc1155> txsErc1155(@NotNull String address) throws EtherScanException;\n\n /**\n * All ERC-721 (NFT) token txs for given address\n *\n * @param address get txs for\n * @param startBlock tx from this blockNumber\n * @param endBlock tx to this blockNumber\n * @return txs for address\n * @throws EtherScanException parent exception class\n */\n @NotNull\n List<TxErc1155> txsErc1155(@NotNull String address, @NotNull String contractAddress, long startBlock, long endBlock)\n throws EtherScanException;\n\n @NotNull\n List<TxErc1155> txsErc1155(@NotNull String address, @NotNull String contractAddress, long startBlock)\n throws EtherScanException;\n\n @NotNull\n List<TxErc1155> txsErc1155(@NotNull String address, @NotNull String contractAddress) throws EtherScanException;\n\n /**\n * All blocks mined by address\n * \n * @param address address to search for\n * @return blocks mined\n * @throws EtherScanException parent exception class\n */\n @NotNull\n List<Block> blocksMined(@NotNull String address) throws EtherScanException;\n}", "com.google.protobuf.ByteString getServiceAccountIdTokensBytes(int index);", "java.util.List<java.lang.String> getServiceAccountIdTokensList();", "public List<Token> getAllToken() throws BusinessException;", "public static java.util.List<com.ifl.rapid.customer.model.CRM_Trn_Address> findAll()\n\t\tthrows com.liferay.portal.kernel.exception.SystemException {\n\t\treturn getPersistence().findAll();\n\t}", "public List<BigInteger> getNonceList(AionAddress acc) {\n\n List<BigInteger> nl = Collections.synchronizedList(new ArrayList<>());\n lock.readLock().lock();\n this.getAccView(acc).getMap().entrySet().parallelStream().forEach(e -> nl.add(e.getKey()));\n lock.readLock().unlock();\n\n return nl.parallelStream().sorted().collect(Collectors.toList());\n }", "@Override\n public List<PooledTransaction> removeTxsWithNonceLessThan(Map<AionAddress, BigInteger> accNonce) {\n\n List<ByteArrayWrapper> bwList = new ArrayList<>();\n for (Map.Entry<AionAddress, BigInteger> en1 : accNonce.entrySet()) {\n AccountState as = this.getAccView(en1.getKey());\n lock.writeLock().lock();\n Iterator<Map.Entry<BigInteger, AbstractMap.SimpleEntry<ByteArrayWrapper, BigInteger>>>\n it = as.getMap().entrySet().iterator();\n\n while (it.hasNext()) {\n Map.Entry<BigInteger, AbstractMap.SimpleEntry<ByteArrayWrapper, BigInteger>> en =\n it.next();\n if (en1.getValue().compareTo(en.getKey()) > 0) {\n bwList.add(en.getValue().getKey());\n it.remove();\n } else {\n break;\n }\n }\n lock.writeLock().unlock();\n\n Set<BigInteger> fee = Collections.synchronizedSet(new HashSet<>());\n if (this.getPoolStateView(en1.getKey()) != null) {\n this.getPoolStateView(en1.getKey())\n .parallelStream()\n .forEach(ps -> fee.add(ps.getFee()));\n }\n\n fee.parallelStream()\n .forEach(\n bi -> {\n if (this.getFeeView().get(bi) != null) {\n this.getFeeView()\n .get(bi)\n .entrySet()\n .removeIf(\n byteArrayWrapperTxDependListEntry ->\n byteArrayWrapperTxDependListEntry\n .getValue()\n .getAddress()\n .equals(en1.getKey()));\n\n if (this.getFeeView().get(bi).isEmpty()) {\n this.getFeeView().remove(bi);\n }\n }\n });\n\n as.setDirty();\n }\n\n List<PooledTransaction> removedTxl = Collections.synchronizedList(new ArrayList<>());\n bwList.parallelStream()\n .forEach(\n bw -> {\n if (this.getMainMap().get(bw) != null) {\n PooledTransaction pooledTx = this.getMainMap().get(bw).getTx();\n removedTxl.add(pooledTx);\n\n long timestamp = pooledTx.tx.getTimeStampBI().longValue() / multiplyM;\n synchronized (this.getTimeView().get(timestamp)) {\n if (this.getTimeView().get(timestamp) == null) {\n LOG.error(\n \"Txpool.remove can't find the timestamp in the map [{}]\",\n pooledTx.toString());\n return;\n }\n\n this.getTimeView().get(timestamp).remove(bw);\n if (this.getTimeView().get(timestamp).isEmpty()) {\n this.getTimeView().remove(timestamp);\n }\n }\n\n lock.writeLock().lock();\n this.getMainMap().remove(bw);\n lock.writeLock().unlock();\n }\n });\n\n this.updateAccPoolState();\n this.updateFeeMap();\n\n if (LOG.isInfoEnabled()) {\n LOG.info(\"TxPoolA0.remove {} TX\", removedTxl.size());\n }\n\n return removedTxl;\n }", "@Test\n public void SameTokenNameOpenInvalidAddress() {\n dbManager.getDynamicPropertiesStore().saveAllowSameTokenName(1);\n InitExchangeSameTokenNameActive();\n long exchangeId = 1;\n String firstTokenId = \"123\";\n long firstTokenQuant = 100000000L;\n String secondTokenId = \"456\";\n long secondTokenQuant = 200000000L;\n\n byte[] ownerAddress = ByteArray.fromHexString(OWNER_ADDRESS_FIRST);\n AccountCapsule accountCapsule = dbManager.getAccountStore().get(ownerAddress);\n Map<String, Long> assetV2Map = accountCapsule.getAssetMapV2();\n Assert.assertEquals(10000_000000L, accountCapsule.getBalance());\n Assert.assertEquals(null, assetV2Map.get(firstTokenId));\n Assert.assertEquals(null, assetV2Map.get(secondTokenId));\n\n ExchangeWithdrawActuator actuator = new ExchangeWithdrawActuator(getContract(\n OWNER_ADDRESS_INVALID, exchangeId, firstTokenId, firstTokenQuant),\n dbManager);\n TransactionResultCapsule ret = new TransactionResultCapsule();\n\n try {\n actuator.validate();\n actuator.execute(ret);\n fail(\"Invalid address\");\n } catch (ContractValidateException e) {\n Assert.assertTrue(e instanceof ContractValidateException);\n Assert.assertEquals(\"Invalid address\", e.getMessage());\n } catch (ContractExeException e) {\n Assert.assertFalse(e instanceof ContractExeException);\n } finally {\n dbManager.getExchangeStore().delete(ByteArray.fromLong(1L));\n dbManager.getExchangeStore().delete(ByteArray.fromLong(2L));\n dbManager.getExchangeV2Store().delete(ByteArray.fromLong(1L));\n dbManager.getExchangeV2Store().delete(ByteArray.fromLong(2L));\n }\n }", "@NotNull\n List<Balance> balances(@NotNull List<String> addresses) throws EtherScanException;", "@NotNull\n List<TxInternal> txsInternalByHash(@NotNull String txhash) throws EtherScanException;", "public List<Address> getAllAddresses() throws BackendException;", "Collection lookupTransactions(String email);", "@Test\n public void SameTokenNameCloseInvalidAddress() {\n dbManager.getDynamicPropertiesStore().saveAllowSameTokenName(0);\n InitExchangeBeforeSameTokenNameActive();\n long exchangeId = 1;\n String firstTokenId = \"abc\";\n long firstTokenQuant = 100000000L;\n String secondTokenId = \"def\";\n long secondTokenQuant = 200000000L;\n\n byte[] ownerAddress = ByteArray.fromHexString(OWNER_ADDRESS_FIRST);\n AccountCapsule accountCapsule = dbManager.getAccountStore().get(ownerAddress);\n Map<String, Long> assetMap = accountCapsule.getAssetMap();\n Assert.assertEquals(10000_000000L, accountCapsule.getBalance());\n Assert.assertEquals(null, assetMap.get(firstTokenId));\n Assert.assertEquals(null, assetMap.get(secondTokenId));\n\n ExchangeWithdrawActuator actuator = new ExchangeWithdrawActuator(getContract(\n OWNER_ADDRESS_INVALID, exchangeId, firstTokenId, firstTokenQuant),\n dbManager);\n TransactionResultCapsule ret = new TransactionResultCapsule();\n\n try {\n actuator.validate();\n actuator.execute(ret);\n fail(\"Invalid address\");\n } catch (ContractValidateException e) {\n Assert.assertTrue(e instanceof ContractValidateException);\n Assert.assertEquals(\"Invalid address\", e.getMessage());\n } catch (ContractExeException e) {\n Assert.assertFalse(e instanceof ContractExeException);\n } finally {\n dbManager.getExchangeStore().delete(ByteArray.fromLong(1L));\n dbManager.getExchangeStore().delete(ByteArray.fromLong(2L));\n dbManager.getExchangeV2Store().delete(ByteArray.fromLong(1L));\n dbManager.getExchangeV2Store().delete(ByteArray.fromLong(2L));\n }\n }", "@CrossOrigin\n @RequestMapping(path=\"/address/customer\",method = RequestMethod.GET, produces = MediaType.APPLICATION_JSON_UTF8_VALUE)\n public ResponseEntity<AddressListResponse> getAllAddress(@RequestHeader(\"authorization\") final String authorization) throws AuthorizationFailedException {\n\n String[] splitStrings = authorization.split(\" \");\n String accessToken = splitStrings[1];\n\n CustomerEntity loggedCustomer = customerService.getCustomer(accessToken);\n List<AddressEntity> addressEntityList = addressService.getAllAddress(loggedCustomer);\n\n AddressListResponse addressListResponse = new AddressListResponse();\n if(addressEntityList==null){\n addressListResponse = null;\n return new ResponseEntity<>(addressListResponse, HttpStatus.OK);\n }\n\n List<AddressList> addressLists = new ArrayList<>();\n\n for (AddressEntity addressEntity : addressEntityList) {\n AddressList adr = new AddressList();\n adr.setId(UUID.fromString(addressEntity.getUuid()));\n adr.setFlatBuildingName(addressEntity.getFlatBuilNo());\n adr.setLocality(addressEntity.getLocality());\n adr.setCity(addressEntity.getCity());\n adr.setPincode(addressEntity.getPincode());\n\n AddressListState statesList = new AddressListState();\n String stateUuid = addressEntity.getState().getUuid();\n statesList.setId(UUID.fromString(stateUuid));\n statesList.setStateName(addressEntity.getState().getStateName());\n adr.setState(statesList);\n addressLists.add(adr);\n }\n\n return new ResponseEntity<>(addressListResponse.addresses(addressLists), HttpStatus.OK);\n\n }", "EmailAddress fetchEmailAddress(AccessToken token);", "@Override\r\n\tpublic ArrayList<Rents> readRents(String address) {\n\t\treturn null;\r\n\t}", "public Transaction[] handleTxs(Transaction[] possibleTxs) {\n // IMPLEMENT THIS\n List<Transaction> validTxs = new ArrayList<>();\n for (Transaction tx : possibleTxs) {\n if (isValidTx(tx)) {\n validTxs.add(tx);\n ArrayList<Transaction.Output> outputs = tx.getOutputs();\n for (int idx = 0; idx < outputs.size(); idx++) {\n UTXO utxo = new UTXO(tx.getHash(), idx);\n utxoPool.addUTXO(utxo, outputs.get(idx));\n }\n }\n }\n\n return validTxs.toArray(new Transaction[0]);\n }", "private void printAll() {\n\n String infuraAddress = \"70ddb1f89ca9421885b6268e847a459d\";\n dappSmartcontractAddress = \"0x07d55a62b487d61a0b47c2937016f68e4bcec0e9\";\n smartContractGetfunctionAddress = \"0x7355a424\";\n\n CoinNetworkInfo coinNetworkInfo = new CoinNetworkInfo(\n CoinType.ETH,\n EthereumNetworkType.ROPSTEN,\n \"https://ropsten.infura.io/v3/\"+infuraAddress\n );\n\n List<Account> accountList = sBlockchain.getAccountManager()\n .getAccounts(hardwareWallet.getWalletId(), CoinType.ETH, EthereumNetworkType.ROPSTEN);\n\n ethereumService = (EthereumService) CoinServiceFactory.getCoinService(this, coinNetworkInfo);\n\n\n ethereumService.callSmartContractFunction(\n (EthereumAccount) accountList.get(0),\n dappSmartcontractAddress,\n smartContractGetfunctionAddress\n ).setCallback(new ListenableFutureTask.Callback<String>() {\n @Override\n public void onSuccess(String result) { //return hex string\n Log.d(\"SUCCESS TAG\", \"transaction data : \"+result);\n\n getPost(result, accountList);\n\n\n }\n\n @Override\n public void onFailure(@NotNull ExecutionException e) {\n Log.d(\"ERROR TAG #101\",e.toString());\n }\n\n @Override\n public void onCancelled(@NotNull InterruptedException e) {\n Log.d(\"ERROR TAG #102\",e.toString());\n }\n });\n\n\n }", "public Transaction[] handleTxs(Transaction[] possibleTxs) {\n ArrayList<Transaction> validTransactions = new ArrayList<>();\n for (Transaction tx : possibleTxs){\n if (isValidTx(tx)){\n validTransactions.add(tx);\n consumePoolCoins(tx);\n createPoolCoins(tx);\n }\n }\n return validTransactions.toArray(new Transaction[validTransactions.size()]);\n }", "AllUsersAddresses getAllUsersAddresses();", "private String parseAddresses(Address[] address) {\n String listAddress = \"\";\n\n if (address != null) {\n for (int i = 0; i < address.length; i++) {\n listAddress += address[i].toString() + \", \";\n }\n }\n if (listAddress.length() > 1) {\n listAddress = listAddress.substring(0, listAddress.length() - 2);\n }\n\n return listAddress;\n }", "List<Account> findAccountByAddressStartingWith(String pattern);", "private List<DriverAddress> generateAddresses(Driver driver, int amount){\n\t\tList<DriverAddress> addresses = new ArrayList<DriverAddress>();\n\t\tfor(int i=0; i < amount; i++){ \t\t\n\t\t\taddresses.add(new DriverAddress());\n\t\t\taddresses.get(i).setBusinessInd(\"N\");\n\t\t\taddresses.get(i).setAddressLine1(i + \" Driver Service Test\");\n\t\t\taddresses.get(i).setPostcode(\"45241\");\n\t\t\taddresses.get(i).setGeoCode(\"0800\");\t\t\n\t\t\taddresses.get(i).setAddressType(driverService.getDriverAddressTypeCodes().get(0));\n\t\t\taddresses.get(i).setDriver(driver);\n\t\t}\n\t\treturn addresses;\n\t}", "public AddressList listAllAddresses(String addressBook)\n\t{\n\t\treturn controller.listAllAddresses(addressBook);\n\t}", "Collection lookupTransactions(String email, String reason);", "public com.zenithbank.mtn.fleet.Transaction[] getCardTrans(boolean includeOpeningBalance) throws java.rmi.RemoteException;", "public ArrayList<String> getAllTokens() {\n ArrayList<String> returnlist = new ArrayList<String>();\n // Select All Query\n String selectQuery = \"SELECT Token FROM \" + TABLE_NAME;\n\n SQLiteDatabase db = this.getWritableDatabase();\n Cursor cursor = db.rawQuery(selectQuery, null);\n\n // looping through all rows and adding to list\n if (cursor.moveToFirst()) {\n do {\n ArrayList<String> data = new ArrayList<String>();\n for (int i =0; i<cursor.getColumnCount(); i++){\n data.add(cursor.getString(i));\n }\n // Adding contact to list\n returnlist.add(data.get(0));\n } while (cursor.moveToNext());\n }\n\n // return contact list\n cursor.close();\n db.close();\n return returnlist;\n }", "private List<Tenant> getTenantsByKeyChangeXml(Document document) throws KeyChangeException {\n List<Tenant> tenantList = new ArrayList<Tenant>();\n List<TenantData> tenantDataList;\n tenantDataList = KeyChangeDataUtils.getKeyChangeTenantDataByXML(document).getTenantDataList();\n TenantManager tenantManager = ServiceHolder.getRealmService().getTenantManager();\n // Iterate through tenants\n for (TenantData tenantData : tenantDataList) {\n String tenantDomain = null;\n try {\n tenantDomain = tenantData.getTenantDomain();\n int tenantId = ServiceHolder.getRealmService().getTenantManager().getTenantId(tenantDomain);\n if (tenantId != MultitenantConstants.INVALID_TENANT_ID) {\n Tenant tenant = tenantManager.getTenant(tenantId);\n tenantList.add(tenant);\n } else {\n log.error(\"Invalid tenant domain '\" + tenantDomain + \"'\");\n // If the specific tenant domain is invalid continuing the flow for the rest of the tenants.\n }\n } catch (UserStoreException e) {\n throw new KeyChangeException(\"User store exception while getting the tenant ID for tenant \" +\n tenantDomain, e);\n }\n }\n return tenantList;\n }", "ListenableFuture<String> attestFor(\n List<DiagnosisKey> keys,\n List<String> regions,\n String verificationCode,\n int transmissionRisk) {\n Log.i(TAG, \"Getting SafetyNet attestation.\");\n String cleartext = cleartextFor(keys, regions, verificationCode, transmissionRisk);\n String nonce = BASE64.encode(sha256(cleartext));\n return safetyNetAttestationFor(nonce);\n }", "public static String[] generateEPRs(SocketAcceptor acceptor, String serviceName, String ip) {\n //Get all the addresses associated with the acceptor\n Map<SessionID, SocketAddress> socketAddresses = acceptor.getAcceptorAddresses();\n //Get all the sessions (SessionIDs) associated with the acceptor\n ArrayList<SessionID> sessions = acceptor.getSessions();\n String[] EPRList = new String[sessions.size()];\n\n //Generate an EPR for each session/socket address\n for (int i = 0; i < sessions.size(); i++) {\n SessionID sessionID = sessions.get(i);\n InetSocketAddress socketAddress = (InetSocketAddress) socketAddresses.get(sessionID);\n EPRList[i] = FIXConstants.FIX_PREFIX + ip + \":\" + socketAddress.getPort() +\n \"?\" + FIXConstants.BEGIN_STRING + \"=\" + sessionID.getBeginString() +\n \"&\" + FIXConstants.SENDER_COMP_ID + \"=\" + sessionID.getTargetCompID() +\n \"&\" + FIXConstants.TARGET_COMP_ID + \"=\" + sessionID.getSenderCompID();\n\n String sessionQualifier = sessionID.getSessionQualifier();\n if (sessionQualifier != null && !sessionQualifier.equals(\"\")) {\n EPRList[i] += \"&\" + FIXConstants.SESSION_QUALIFIER + \"=\" + sessionQualifier;\n }\n\n String senderSubID = sessionID.getSenderSubID();\n if (senderSubID != null && !senderSubID.equals(\"\")) {\n EPRList[i] += \"&\" + FIXConstants.SENDER_SUB_ID + \"=\" + senderSubID;\n }\n\n String targetSubID = sessionID.getTargetSubID();\n if (targetSubID != null && !targetSubID.equals(\"\")) {\n EPRList[i] += \"&\" + FIXConstants.TARGET_SUB_ID + \"=\" + targetSubID;\n }\n\n String senderLocationID = sessionID.getSenderLocationID();\n if (senderLocationID != null && !senderLocationID.equals(\"\")) {\n EPRList[i] += \"&\" + FIXConstants.SENDER_LOCATION_ID + \"=\" + senderLocationID;\n }\n\n String targetLocationID = sessionID.getTargetLocationID();\n if (targetLocationID != null && !targetLocationID.equals(\"\")) {\n EPRList[i] += \"&\" + FIXConstants.TARGET_LOCATION_ID + \"=\" + targetLocationID;\n }\n\n EPRList[i] += \"&Service=\" + serviceName;\n }\n return EPRList;\n }", "@Override\n\tpublic List<CashTransactionDtl> getCashTransactionDtlByAccount(\n\t\t\tMap<String, Object> params) throws ServiceException {\n\t\treturn cashTransactionDtlMapper.queryCashTransactionRecord(params);\n\t}", "public List<Address> findAll();", "public List<com.generator.tables.pojos.CreditChain> fetchByAddress(String... values) {\n return fetch(CreditChain.CREDIT_CHAIN.ADDRESS, values);\n }", "private Response getAddressList( String term )\n {\n\n ReferenceList list = null;\n try\n {\n if ( \"RestAddressService\".equals( AddressServiceProvider.getInstanceClass( ) ) )\n {\n list = AddressServiceProvider.searchAddress( null, term );\n }\n\n }\n catch( RemoteException e )\n {\n AppLogService.error( e );\n }\n\n if ( list == null )\n {\n _logger.error( Constants.ERROR_NOT_FOUND_RESOURCE );\n return Response.status( Response.Status.NOT_FOUND )\n .entity( JsonUtil.buildJsonResponse( new ErrorJsonResponse( Response.Status.NOT_FOUND.name( ), MSG_ERROR_GET_ADDRESSES ) ) ).build( );\n }\n\n return Response.status( Response.Status.OK ).entity( JsonUtil.buildJsonResponse( new JsonResponse( list ) ) ).build( );\n }", "@Override\n\tpublic List<Address> FindAllAddress() {\n\t\treturn ab.FindAll();\n\t}", "public Transaction[] handleTxs(Transaction[] possibleTxs) {\n // IMPLEMENT THIS\n if(possibleTxs == null)\n return new Transaction[0];\n \n ArrayList<Transaction> validTxs = new ArrayList<>();\n \n //iterate through each transaction, validate, remove spent UTXO, add new UTXO\n for(int i = 0; i < possibleTxs.length; i++){\n \n //validate tx\n if(isValidTx(possibleTxs[i])){\n possibleTxs[i].finalize();\n validTxs.add(possibleTxs[i]);\n \n //remove valid/spent UTXOs from current pool\n for(Transaction.Input x:possibleTxs[i].getInputs()){\n UTXO inputUTXO = new UTXO(x.prevTxHash, x.outputIndex);\n currentPool.removeUTXO(inputUTXO);\n }\n \n //add new UTXOs to current pool\n int utxoIndex = 0;\n for(Transaction.Output x:possibleTxs[i].getOutputs()){\n UTXO outputUTXO = new UTXO(possibleTxs[i].getHash(), utxoIndex);\n currentPool.addUTXO(outputUTXO, x);\n utxoIndex++;\n }\n \n }\n }\n \n //return list of validated \n Transaction[] validatedTxs = new Transaction[validTxs.size()];\n \n validatedTxs = validTxs.toArray(validatedTxs);\n \n return validatedTxs;\n }", "public ArrayList<String> retrieveIdentities(ArrayList<String> addresses) {\n ArrayList<String> addressIdentities = new ArrayList<>();\n\n // check if the conversation controller is null\n if (getConversationController() == null)\n return addressIdentities;\n\n // retrieve the identity of all addresses\n for (int i = 0; i < addresses.size(); i++) {\n addressIdentities.add(getConversationController().onIdentityRequest(addresses.get(i)));\n }\n\n return addressIdentities;\n }", "public static Account[] getTeamAccounts(IInternalContest contest) {\n // SOMEDAY move getTeamAccounts into AccountsUtility class\n\n return getAllAccounts(contest, Type.TEAM);\n }", "public List<AddressEntity> getAllAddress(CustomerEntity customerEntity) {\n\n //Creating List of AddressEntities.\n List<AddressEntity> addressEntities = new LinkedList<>();\n\n //Calls Method of customerAddressDao,getAllCustomerAddressByCustomer and returns AddressList.\n List<CustomerAddressEntity> customerAddressEntities = customerAddressDao.getAllCustomerAddressByCustomer(customerEntity);\n if (customerAddressEntities != null) { //Checking if CustomerAddressEntity is null else extracting address and adding to the addressEntites list.\n customerAddressEntities.forEach(customerAddressEntity -> {\n addressEntities.add(customerAddressEntity.getAddress());\n });\n }\n\n return addressEntities;\n\n }", "public Token getTokenByEmail(String email)throws Exception;", "@NotNull\n List<Block> blocksMined(@NotNull String address) throws EtherScanException;", "java.util.List<kr.pik.message.Profile.ProfileMessage.ContactAddress> \n getContactAddressList();", "public List<BusinessAccount> searchAllContractors() {\n\t\tfactory = Persistence.createEntityManagerFactory(PERSISTENCE_UNIT_NAME);\n\t\tEntityManager em = factory.createEntityManager();\t\n\t\n\t\t\tem.getTransaction().begin();\n\t\t\tQuery myQuery = em.createQuery(\"SELECT b FROM BusinessAccount b\");\n\t\t\tcontractorList=myQuery.getResultList();\n\t\t em.getTransaction().commit();\n\t\t em.close();\n\t\t\t\n\t\t\treturn contractorList;\n\t\t}", "public NodeInformation[] getNodes() throws CassandraServerManagementException {\r\n StorageServiceMBean ssMBean = null;\r\n try {\r\n ssMBean = CassandraAdminDataHolder\r\n .getInstance().getCassandraMBeanLocator().locateStorageServiceMBean();\r\n } catch (CassandraServerManagementException e) {\r\n handleException(\"Error occurred while retrieving node information list\", e);\r\n }\r\n\r\n if (ssMBean == null) {\r\n handleException(\"Storage Server MBean is null\");\r\n }\r\n\r\n Map<String, String> tokenToEndpoint = ssMBean.getTokenToEndpointMap();\r\n List<String> sortedTokens = new ArrayList<String>(tokenToEndpoint.keySet());\r\n Collections.sort(sortedTokens);\r\n\r\n /* Calculate per-token ownership of the ring */\r\n Map<InetAddress, Float> ownerships = ssMBean.getOwnership();\r\n\r\n List<NodeInformation> nodeInfoList = new ArrayList<NodeInformation>();\r\n for (String token : sortedTokens) {\r\n String primaryEndpoint = tokenToEndpoint.get(token);\r\n String status = ssMBean.getLiveNodes().contains(primaryEndpoint)\r\n ? CassandraManagementConstants.NodeStatuses.NODE_STATUS_UP\r\n : ssMBean.getUnreachableNodes().contains(primaryEndpoint)\r\n ? CassandraManagementConstants.NodeStatuses.NODE_STATUS_DOWN\r\n : CassandraManagementConstants.NodeStatuses.NODE_STATUS_UNKNOWN;\r\n\r\n String state = ssMBean.getJoiningNodes().contains(primaryEndpoint)\r\n ? CassandraManagementConstants.NodeStatuses.NODE_STATUS_JOINING\r\n : ssMBean.getLeavingNodes().contains(primaryEndpoint)\r\n ? CassandraManagementConstants.NodeStatuses.NODE_STATUS_LEAVING\r\n : CassandraManagementConstants.NodeStatuses.NODE_STATUS_NORMAL;\r\n\r\n Map<String, String> loadMap = ssMBean.getLoadMap();\r\n String load = loadMap.containsKey(primaryEndpoint)\r\n ? loadMap.get(primaryEndpoint)\r\n : CassandraManagementConstants.NodeStatuses.NODE_STATUS_UNKNOWN;\r\n\r\n Float ownership = ownerships.get(token);\r\n String owns = \"N/A\";\r\n if(ownership!=null){\r\n owns = new DecimalFormat(\"##0.00%\").format(ownership);\r\n }\r\n NodeInformation nodeInfo = new NodeInformation();\r\n nodeInfo.setAddress(primaryEndpoint);\r\n nodeInfo.setState(state);\r\n nodeInfo.setStatus(status);\r\n nodeInfo.setOwn(owns);\r\n nodeInfo.setLoad(load);\r\n nodeInfo.setToken(token);\r\n nodeInfoList.add(nodeInfo);\r\n }\r\n return nodeInfoList.toArray(new NodeInformation[nodeInfoList.size()]);\r\n }", "org.apache.geronimo.corba.xbeans.csiv2.tss.TSSIdentityTokenTypeList getIdentityTokenTypes();", "public List<Address> getAddresses(final SessionContext ctx)\n\t{\n\t\tList<Address> coll = (List<Address>)getProperty( ctx, ADDRESSES);\n\t\treturn coll != null ? coll : Collections.EMPTY_LIST;\n\t}", "List<AccountDetail> findAllByAddressStartingWith(String address);", "public static Map<String, String> listTokenFromCSP()\r\n\t\t\tthrows BkavSignaturesException {\r\n\t\tMap<String, String> result = new HashMap<>();\r\n\t\ttry {\r\n\t\t\tSunMSCAPI providerMSCAPI = new SunMSCAPI();\r\n\t\t\tSecurity.addProvider(providerMSCAPI);\r\n\t\t\tKeyStore ks = KeyStore.getInstance(CSP_KEYSTORE);\r\n\t\t\tks.load(null, null);\r\n\r\n\t\t\tEnumeration<String> aliases = ks.aliases();\r\n\t\t\tString alias = null;\r\n\r\n\t\t\twhile (aliases.hasMoreElements()) {\r\n\t\t\t\talias = aliases.nextElement();\r\n\t\t\t\tCertificate cert = ks.getCertificate(alias);\r\n\t\t\t\tif (cert instanceof X509Certificate) {\r\n\t\t\t\t\tX509Certificate x509Cert = (X509Certificate) cert;\r\n\t\t\t\t\tString certSerial = x509Cert.getSerialNumber().toString(16);\r\n\r\n\t\t\t\t\tString subjectDN = x509Cert.getSubjectDN().getName();\r\n\t\t\t\t\tString author = \"\";\r\n\t\t\t\t\tLdapName ldap;\r\n\t\t\t\t\ttry {\r\n\t\t\t\t\t\tldap = new LdapName(subjectDN);\r\n\t\t\t\t\t\tfor (Rdn rdn : ldap.getRdns()) {\r\n\t\t\t\t\t\t\tif (\"CN\".equalsIgnoreCase(rdn.getType())) {\r\n\t\t\t\t\t\t\t\tauthor = rdn.getValue().toString();\r\n\t\t\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t} catch (InvalidNameException e) {\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\tresult.put(certSerial, author);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t} catch (KeyStoreException e) {\r\n\t\t\tthrow new BkavSignaturesException(\"KeyStoreException\", e);\r\n\t\t} catch (NoSuchAlgorithmException e) {\r\n\t\t\tthrow new BkavSignaturesException(\"NoSuchAlgorithmException\", e);\r\n\t\t} catch (CertificateException e) {\r\n\t\t\tthrow new BkavSignaturesException(\"CertificateException\", e);\r\n\t\t} catch (IOException e) {\r\n\t\t\tthrow new BkavSignaturesException(\"IOException\", e);\r\n\t\t}\r\n\r\n\t\treturn result;\r\n\t}", "public static Address getTroveFromAddress()\n {\n Address rval = new Address();\n\n rval.setFirstName(\"Trove, Inc.\");\n rval.setAddressLine1(\"20 Exchange Place\");\n rval.setAddressLine2(\"Apt 1604\");\n rval.setCity(\"New York\");\n Subdivision subdivision = new Subdivision();\n subdivision.setCode(\"US-NY\");\n\n rval.setSubdivision(subdivision);\n rval.setPostalCode(\"10005\");\n rval.setPhone(\"3108096011\");\n\n return rval;\n }", "private List<Messages.Address> mapModelAddressToWireAddress(List<byte[]> addresses) {\n return addresses.stream().map(address -> Messages.Address.newBuilder()\n .setPort(6565)\n .setIpAddress(ByteString.copyFrom(address))\n .build())\n .collect(Collectors.toList());\n }", "List<?> getAddress();", "private boolean getAddresses(){\n try {\n URLtoJSON URLtoJSON = new URLtoJSON();\n JSONObject json = URLtoJSON.open(this.URL+\"merchant/\"+this.GUID+\"/list?password=\"+this.pswd()+\"&api_code=\"+this.ApiCode);\n \n if(!json.isNull(\"error\")) return false; //If there is no transactions return false;\n JSONArray nameArray = json.names();\n JSONArray TotalArray = json.toJSONArray(nameArray);\n JSONArray JAddresses = TotalArray.getJSONArray(0);\n \n for(int i = 0; i < JAddresses.length(); i++){\n String O=\"false\";\n String S=\"false\";\n String N=\"false\";\n String[] Label=JAddresses.getJSONObject(i).getString(\"label\").split(\"_\",-1);\n if(Label.length==3){\n O=Label[1];\n S=Label[0];\n N=Label[2];\n }\n String[] Matched=this.matchDB(JAddresses.getJSONObject(i).getString(\"address\"));\n String[] Details= new String[]{\n \"S: \"+S, //0 Transaction ID\n Matched[0], //1 Sender\n Float.toString(JAddresses.getJSONObject(i).getLong(\"total_received\")/100000000)+\" (BTC)\",//2 Amount in btc\n O, //3 Choosen option\n \"btc\", //4 Currency\n \"O: \"+Matched[2], //5 Date\n Matched[1] //6 Senders nem or false \n };\n if(!this.list.contains(Details)){\n this.list.add(Details);\n if(!\"false\".equals(O) && !O.equals(\"\")){\n this.setAmountsAndEntries(Integer.parseInt(O), JAddresses.getJSONObject(i).getLong(\"total_received\"), Details[6]); //add the amount and rise the entries\n }\n }\n }\n return true;\n } catch (JSONException | NumberFormatException e) {\n e.printStackTrace();\n }\n return false;\n }", "public TradeHistoryReq address(String address) {\n this.address = address;\n return this;\n }", "public AddressComponent[] getAddressComponents() {\n return addressComponents;\n }", "@Test\n public void SameTokenNameOpenNoAccount() {\n dbManager.getDynamicPropertiesStore().saveAllowSameTokenName(1);\n InitExchangeSameTokenNameActive();\n long exchangeId = 1;\n String firstTokenId = \"123\";\n long firstTokenQuant = 100000000L;\n String secondTokenId = \"456\";\n long secondTokenQuant = 200000000L;\n\n byte[] ownerAddress = ByteArray.fromHexString(OWNER_ADDRESS_FIRST);\n AccountCapsule accountCapsule = dbManager.getAccountStore().get(ownerAddress);\n Map<String, Long> assetV2Map = accountCapsule.getAssetMapV2();\n Assert.assertEquals(10000_000000L, accountCapsule.getBalance());\n Assert.assertEquals(null, assetV2Map.get(firstTokenId));\n Assert.assertEquals(null, assetV2Map.get(secondTokenId));\n\n ExchangeWithdrawActuator actuator = new ExchangeWithdrawActuator(getContract(\n OWNER_ADDRESS_NOACCOUNT, exchangeId, firstTokenId, firstTokenQuant),\n dbManager);\n TransactionResultCapsule ret = new TransactionResultCapsule();\n\n try {\n actuator.validate();\n actuator.execute(ret);\n fail(\"account[+OWNER_ADDRESS_NOACCOUNT+] not exists\");\n } catch (ContractValidateException e) {\n Assert.assertTrue(e instanceof ContractValidateException);\n Assert.assertEquals(\"account[\" + OWNER_ADDRESS_NOACCOUNT + \"] not exists\",\n e.getMessage());\n } catch (ContractExeException e) {\n Assert.assertFalse(e instanceof ContractExeException);\n } finally {\n dbManager.getExchangeStore().delete(ByteArray.fromLong(1L));\n dbManager.getExchangeStore().delete(ByteArray.fromLong(2L));\n dbManager.getExchangeV2Store().delete(ByteArray.fromLong(1L));\n dbManager.getExchangeV2Store().delete(ByteArray.fromLong(2L));\n }\n }", "public String[] createNewAddress(){\r\n byte[][] pairs=ECDSAgeneratePublicAndPrivateKey();\r\n byte[] afterhashing=RIPEMD160(SHA256hash(pairs[1]));\r\n byte[] checksum=getCheckSum(SHA256hash(SHA256hash(afterhashing)));\r\n byte[] bitcoinaddress=concateByteArray(afterhashing,checksum);\r\n return new String[]{toHex(pairs[0]), convertPrivateKeytoWIF(pairs[0]), base58encode(bitcoinaddress)};\r\n }", "io.envoyproxy.envoy.data.dns.v3.DnsTable.AddressList getAddressList();", "int getServiceAccountIdTokensCount();", "public Call<ExpResult<List<DelegationInfo>>> getDelegations(MinterAddress address) {\n checkNotNull(address, \"Address can't be null\");\n\n return getInstantService().getDelegationsForAddress(address.toString(), 1);\n }", "public void listAll(List<Address> AddressList) {\n for (Address a : AddressList) {\n console.promptForPrintPrompt(a.toString());\n }\n }", "public static Tax[] getTaxes() {\n Tax[] taxes = new Tax[DeclarationFiller.getDeclaration().size()];\n int count = 0;\n if (taxes != null ) {\n for (Map.Entry<String, Integer> incomePoint : DeclarationFiller.getDeclaration().entrySet()) {\n String taxName = \"Tax of \" + incomePoint.getKey();\n int incomValue = incomePoint.getValue();\n taxes[count] = new Tax(count+1001 ,taxName, incomValue, 0.18);\n count++;\n }\n }\n return taxes;\n }", "@Override\n\tpublic List<AddressChangeReqDetails> findAll() throws SystemException {\n\t\treturn findAll(QueryUtil.ALL_POS, QueryUtil.ALL_POS, null);\n\t}", "void setContractAddress(String contractAddress) {\n this.contractAddress = contractAddress;\n if(this.getNextContractMethods() != null && this.getNextContractMethods().size() != 0) {\n this.getNextContractMethods().stream().forEach(contractMethod -> {\n contractMethod.contractAddress = contractAddress;\n });\n }\n }", "public static Address[] getAddressArray(final Address... address)\r\n\t{\r\n\t\treturn address;\r\n\t}", "public List<TransactionType> listESETransactionTypes();", "List<TransactionType> listAgentTransactionTypes();", "public abstract List<String> associateAddresses(NodeMetadata node);", "List<TransactionType> listClientTransactionTypes();", "public List<Address> getAllAddressesByName(String user_name) {\n\t\tList<Address> address = new ArrayList<>();\r\n\t\taddressdao.findByUserUsername(user_name)\r\n\t\t.forEach(address::add);\r\n\t\treturn address;\r\n\t}", "public List<String> findActiveCongestionPointAddresses(LocalDate period) {\n return congestionPointConnectionGroupRepository.findActiveCongestionPointConnectionGroup(period).stream()\n .map(ConnectionGroup::getUsefIdentifier).collect(Collectors.toList());\n }", "public IndividualAddress(final byte[] address)\n\t{\n\t\tsuper(address);\n\t}", "private void requestAddresses(byte nAddr) throws Exception {\n final HashSet<Inet4Address> addrs = new HashSet<>();\n byte[] hwAddrBytes = new byte[] { 8, 4, 3, 2, 1, 0 };\n for (byte i = 0; i < nAddr; i++) {\n hwAddrBytes[5] = i;\n MacAddress newMac = MacAddress.fromBytes(hwAddrBytes);\n final String hostname = \"host_\" + i;\n final DhcpLease lease = mRepo.getOffer(CLIENTID_UNSPEC, newMac,\n IPV4_ADDR_ANY /* relayAddr */, INETADDR_UNSPEC /* reqAddr */, hostname);\n\n assertNotNull(lease);\n assertEquals(newMac, lease.getHwAddr());\n assertEquals(hostname, lease.getHostname());\n assertTrue(format(\"Duplicate address allocated: %s in %s\", lease.getNetAddr(), addrs),\n addrs.add(lease.getNetAddr()));\n\n requestLeaseSelecting(newMac, lease.getNetAddr(), hostname);\n }\n }", "static void printAccountBalance(String address){\n }", "public static byte[] generateCreate2ContractAddress(\n byte[] address, byte[] salt, byte[] initCode) {\n if (address.length != ADDRESS_BYTE_SIZE) {\n throw new RuntimeException(\"Invalid address size\");\n }\n if (salt.length != SALT_SIZE) {\n throw new RuntimeException(\"Invalid salt size\");\n }\n byte[] hashedInitCode = Hash.sha3(initCode);\n byte[] buffer = new byte[1 + address.length + salt.length + hashedInitCode.length];\n\n buffer[0] = (byte) 0xff;\n int offset = 1;\n System.arraycopy(address, 0, buffer, offset, address.length);\n offset += address.length;\n System.arraycopy(salt, 0, buffer, offset, salt.length);\n offset += salt.length;\n System.arraycopy(hashedInitCode, 0, buffer, offset, hashedInitCode.length);\n\n byte[] hashed = Hash.sha3(buffer);\n return Arrays.copyOfRange(hashed, 12, hashed.length);\n }", "public Transaction[] getTransactionsList() throws Exception;", "public Vector<NetworkAddress> getHostAddresses(int type) {return addressesChecker.getAllMyAddresses(type); }", "private static SendGridRequest.EmailAddress [] getPersonalizationAddresses(String addresses) {\n if (addresses != null) {\n return Arrays.stream(addresses.split(\";\"))\n .map(String::trim)\n .map(address -> {\n SendGridRequest.EmailAddress emailAddress = new SendGridRequest.EmailAddress();\n emailAddress.setEmail(address);\n return emailAddress;\n })\n .toArray(SendGridRequest.EmailAddress []::new);\n } else {\n return null;\n }\n }", "public void setAddresses(List<Address> addresses) {\r\n\r\n this.addresses = addresses;\r\n\r\n }", "public IndividualAddress(final int address)\n\t{\n\t\tsuper(address);\n\t}", "public List returnAllAddressList(AddressCommonSC criteria) throws DAOException\r\n {\r\n if(criteria.getNbRec() == -1)\r\n {\r\n return getSqlMap().queryForList(\"addressMapper.addressList\", criteria);\r\n }\r\n else\r\n {\r\n DAOHelper.fixGridMaps(criteria, getSqlMap(), \"addressMapper.cifAddressDetailMap\");\r\n return getSqlMap().queryForList(\"addressMapper.allAddressList\", criteria, criteria.getRecToskip(),\r\n criteria.getNbRec());\r\n }\r\n }", "public ArrayList<Account> GetCustomerAccounts(String ssn)\n {\n ArrayList<Account> result = new ArrayList<>();\n\n for (Account account : accounts)\n {\n if (account.getSsn().equals(ssn))\n {\n result.add(account);\n }\n }\n\n return result;\n }", "@SuppressWarnings(\"unused\")\r\n\tprivate static List<String> splitToken (String token) {\r\n\r\n Matcher m = Contractions.matcher(token);\r\n if (m.find()){\r\n \tString[] contract = {m.group(1), m.group(2)};\r\n \treturn Arrays.asList(contract);\r\n }\r\n String[] contract = {token};\r\n return Arrays.asList(contract);\r\n }", "public static Account[] getAllAccounts(IInternalContest contest, ClientType.Type type) {\n // SOMEDAY move getAllAccounts into AccountsUtility class\n\n Vector<Account> accountVector = contest.getAccounts(type);\n Account[] accounts = (Account[]) accountVector.toArray(new Account[accountVector.size()]);\n Arrays.sort(accounts, new AccountComparator());\n\n return accounts;\n }", "default List<ValidatorIndex> get_unslashed_attesting_indices(BeaconState state, List<PendingAttestation> attestations) {\n return attestations.stream()\n .flatMap(a -> get_attesting_indices(state, a.getData(), a.getAggregationBitfield()).stream())\n .distinct()\n .filter(i -> !state.getValidatorRegistry().get(i).getSlashed())\n .sorted()\n .collect(Collectors.toList());\n }", "private Account createAccount(byte[] address) {\n return new Account(address);\n }", "private static String getAddressString(final List<Pair<RelocatedAddress, Integer>> addresses,\n final ICollectionFilter<Pair<RelocatedAddress, Integer>> filter) {\n final List<RelocatedAddress> validAddresses =\n PairHelpers.projectFirst(CollectionHelpers.filter(addresses, filter));\n\n final Iterable<String> addressStrings =\n CollectionHelpers.map(validAddresses, new ICollectionMapper<RelocatedAddress, String>() {\n @Override\n public String map(final RelocatedAddress item) {\n return item.getAddress().toHexString();\n }\n });\n\n return Commafier.commafy(addressStrings);\n }", "@Test\n public void SameTokenNameCloseNoAccount() {\n dbManager.getDynamicPropertiesStore().saveAllowSameTokenName(0);\n InitExchangeBeforeSameTokenNameActive();\n long exchangeId = 1;\n String firstTokenId = \"abc\";\n long firstTokenQuant = 100000000L;\n String secondTokenId = \"def\";\n long secondTokenQuant = 200000000L;\n\n byte[] ownerAddress = ByteArray.fromHexString(OWNER_ADDRESS_FIRST);\n AccountCapsule accountCapsule = dbManager.getAccountStore().get(ownerAddress);\n Map<String, Long> assetMap = accountCapsule.getAssetMap();\n Assert.assertEquals(10000_000000L, accountCapsule.getBalance());\n Assert.assertEquals(null, assetMap.get(firstTokenId));\n Assert.assertEquals(null, assetMap.get(secondTokenId));\n\n ExchangeWithdrawActuator actuator = new ExchangeWithdrawActuator(getContract(\n OWNER_ADDRESS_NOACCOUNT, exchangeId, firstTokenId, firstTokenQuant),\n dbManager);\n TransactionResultCapsule ret = new TransactionResultCapsule();\n\n try {\n actuator.validate();\n actuator.execute(ret);\n fail(\"account[+OWNER_ADDRESS_NOACCOUNT+] not exists\");\n } catch (ContractValidateException e) {\n Assert.assertTrue(e instanceof ContractValidateException);\n Assert.assertEquals(\"account[\" + OWNER_ADDRESS_NOACCOUNT + \"] not exists\",\n e.getMessage());\n } catch (ContractExeException e) {\n Assert.assertFalse(e instanceof ContractExeException);\n } finally {\n dbManager.getExchangeStore().delete(ByteArray.fromLong(1L));\n dbManager.getExchangeStore().delete(ByteArray.fromLong(2L));\n dbManager.getExchangeV2Store().delete(ByteArray.fromLong(1L));\n dbManager.getExchangeV2Store().delete(ByteArray.fromLong(2L));\n }\n }", "@GetMapping()\n\t@Override\n\tpublic List<Address> findAll() {\n\t\treturn addressService.findAll();\n\t}", "public List<Agent> listAgentsByIdentiyNumber(String identityNumber);" ]
[ "0.7017414", "0.6931463", "0.68677264", "0.6603925", "0.6434892", "0.64120126", "0.6346777", "0.57479435", "0.5505857", "0.5403556", "0.5357293", "0.531477", "0.53020936", "0.51969314", "0.5055334", "0.4936591", "0.48929587", "0.4878589", "0.48576406", "0.48265213", "0.47995612", "0.4785552", "0.47735098", "0.4752295", "0.4725985", "0.46541342", "0.46301362", "0.45870456", "0.45824847", "0.45505965", "0.45447445", "0.45418024", "0.45390382", "0.4525278", "0.44938794", "0.44792005", "0.44547957", "0.44528407", "0.44392285", "0.4426324", "0.44204992", "0.43962458", "0.4386293", "0.43860933", "0.43784952", "0.4375341", "0.43644083", "0.43630672", "0.43237516", "0.43155292", "0.43089786", "0.4297763", "0.42885363", "0.42862687", "0.4285631", "0.42827663", "0.42798966", "0.42743897", "0.4273732", "0.42708218", "0.4267799", "0.42544582", "0.425154", "0.42506677", "0.4240914", "0.4238172", "0.42292076", "0.42221567", "0.42187324", "0.42117375", "0.4209171", "0.4206678", "0.41949078", "0.4194108", "0.41918802", "0.41808882", "0.41733268", "0.41701", "0.4167593", "0.41674596", "0.4166339", "0.41637924", "0.4161756", "0.41581538", "0.41541633", "0.41534728", "0.41521123", "0.41518828", "0.41484225", "0.41415364", "0.41406515", "0.4129663", "0.41269806", "0.41255614", "0.4125329", "0.4123961", "0.41143772", "0.41131863", "0.41121668", "0.411099" ]
0.6845576
3
All ERC721 (NFT) token txs for given address
@NotNull List<TxErc721> txsErc721(@NotNull String address, long startBlock, long endBlock) throws EtherScanException;
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@NotNull\n List<TxErc721> txsErc721(@NotNull String address, @NotNull String contractAddress, long startBlock, long endBlock)\n throws EtherScanException;", "@NotNull\n List<Tx> txs(@NotNull String address, long startBlock, long endBlock) throws EtherScanException;", "@NotNull\n List<TxErc1155> txsErc1155(@NotNull String address, long startBlock, long endBlock) throws EtherScanException;", "@NotNull\n List<TxInternal> txsInternal(@NotNull String address, long startBlock, long endBlock) throws EtherScanException;", "@NotNull\n List<TxErc20> txsErc20(@NotNull String address, long startBlock, long endBlock) throws EtherScanException;", "@NotNull\n List<TxErc1155> txsErc1155(@NotNull String address, @NotNull String contractAddress, long startBlock, long endBlock)\n throws EtherScanException;", "@NotNull\n List<TxErc20> txsErc20(@NotNull String address, @NotNull String contractAddress, long startBlock, long endBlock)\n throws EtherScanException;", "@Override\n public List<UTXO> getOpenTransactionOutputs(List<Address> addresses) throws UTXOProviderException {\n\n List<UTXO> results = new LinkedList<UTXO>();\n for (Address a : addresses) {\n ByteBuffer bb = ByteBuffer.allocate(21);\n bb.put((byte) KeyType.ADDRESS_HASHINDEX.ordinal());\n bb.put(a.getHash160());\n\n ReadOptions ro = new ReadOptions();\n Snapshot sn = db.getSnapshot();\n ro.snapshot(sn);\n\n // Scanning over iterator very fast\n\n DBIterator iterator = db.iterator(ro);\n for (iterator.seek(bb.array()); iterator.hasNext(); iterator.next()) {\n ByteBuffer bbKey = ByteBuffer.wrap(iterator.peekNext().getKey());\n bbKey.get(); // remove the address_hashindex byte.\n byte[] addressKey = new byte[20];\n bbKey.get(addressKey);\n if (!Arrays.equals(addressKey, a.getHash160())) {\n break;\n }\n byte[] hashBytes = new byte[32];\n bbKey.get(hashBytes);\n int index = bbKey.getInt();\n Sha256Hash hash = Sha256Hash.wrap(hashBytes);\n UTXO txout;\n try {\n // TODO this should be on the SNAPSHOT too......\n // this is really a BUG.\n txout = getTransactionOutput(hash, index);\n } catch (BlockStoreException e) {\n throw new UTXOProviderException(\"block store execption\", e);\n }\n if (txout != null) {\n Script sc = txout.getScript();\n Address address = sc.getToAddress(params, true);\n UTXO output = new UTXO(txout.getHash(), txout.getIndex(), txout.getValue(), txout.getHeight(),\n txout.isCoinbase(), txout.getScript(), address.toString());\n results.add(output);\n }\n }\n try {\n iterator.close();\n ro = null;\n sn.close();\n sn = null;\n } catch (IOException e) {\n log.error(\"Error closing snapshot/iterator?\", e);\n }\n }\n return results;\n }", "java.lang.String getServiceAccountIdTokens(int index);", "public static byte[] generateContractAddress(byte[] address, BigInteger nonce) {\n List<RlpType> values = new ArrayList<>();\n\n values.add(RlpString.create(address));\n values.add(RlpString.create(nonce));\n RlpList rlpList = new RlpList(values);\n\n byte[] encoded = RlpEncoder.encode(rlpList);\n byte[] hashed = Hash.sha3(encoded);\n return Arrays.copyOfRange(hashed, 12, hashed.length);\n }", "public List<BigInteger> getNonceList(AionAddress acc) {\n\n List<BigInteger> nl = Collections.synchronizedList(new ArrayList<>());\n lock.readLock().lock();\n this.getAccView(acc).getMap().entrySet().parallelStream().forEach(e -> nl.add(e.getKey()));\n lock.readLock().unlock();\n\n return nl.parallelStream().sorted().collect(Collectors.toList());\n }", "com.google.protobuf.ByteString getServiceAccountIdTokensBytes(int index);", "java.util.List<java.lang.String> getServiceAccountIdTokensList();", "public Transaction[] handleTxs(Transaction[] possibleTxs) {\n // IMPLEMENT THIS\n List<Transaction> validTxs = new ArrayList<>();\n for (Transaction tx : possibleTxs) {\n if (isValidTx(tx)) {\n validTxs.add(tx);\n ArrayList<Transaction.Output> outputs = tx.getOutputs();\n for (int idx = 0; idx < outputs.size(); idx++) {\n UTXO utxo = new UTXO(tx.getHash(), idx);\n utxoPool.addUTXO(utxo, outputs.get(idx));\n }\n }\n }\n\n return validTxs.toArray(new Transaction[0]);\n }", "public List<Address> getAllAddresses() throws BackendException;", "public static java.util.List<com.ifl.rapid.customer.model.CRM_Trn_Address> findAll()\n\t\tthrows com.liferay.portal.kernel.exception.SystemException {\n\t\treturn getPersistence().findAll();\n\t}", "@NotNull\n List<TxInternal> txsInternalByHash(@NotNull String txhash) throws EtherScanException;", "@NotNull\n List<Block> blocksMined(@NotNull String address) throws EtherScanException;", "@Override\n public List<PooledTransaction> removeTxsWithNonceLessThan(Map<AionAddress, BigInteger> accNonce) {\n\n List<ByteArrayWrapper> bwList = new ArrayList<>();\n for (Map.Entry<AionAddress, BigInteger> en1 : accNonce.entrySet()) {\n AccountState as = this.getAccView(en1.getKey());\n lock.writeLock().lock();\n Iterator<Map.Entry<BigInteger, AbstractMap.SimpleEntry<ByteArrayWrapper, BigInteger>>>\n it = as.getMap().entrySet().iterator();\n\n while (it.hasNext()) {\n Map.Entry<BigInteger, AbstractMap.SimpleEntry<ByteArrayWrapper, BigInteger>> en =\n it.next();\n if (en1.getValue().compareTo(en.getKey()) > 0) {\n bwList.add(en.getValue().getKey());\n it.remove();\n } else {\n break;\n }\n }\n lock.writeLock().unlock();\n\n Set<BigInteger> fee = Collections.synchronizedSet(new HashSet<>());\n if (this.getPoolStateView(en1.getKey()) != null) {\n this.getPoolStateView(en1.getKey())\n .parallelStream()\n .forEach(ps -> fee.add(ps.getFee()));\n }\n\n fee.parallelStream()\n .forEach(\n bi -> {\n if (this.getFeeView().get(bi) != null) {\n this.getFeeView()\n .get(bi)\n .entrySet()\n .removeIf(\n byteArrayWrapperTxDependListEntry ->\n byteArrayWrapperTxDependListEntry\n .getValue()\n .getAddress()\n .equals(en1.getKey()));\n\n if (this.getFeeView().get(bi).isEmpty()) {\n this.getFeeView().remove(bi);\n }\n }\n });\n\n as.setDirty();\n }\n\n List<PooledTransaction> removedTxl = Collections.synchronizedList(new ArrayList<>());\n bwList.parallelStream()\n .forEach(\n bw -> {\n if (this.getMainMap().get(bw) != null) {\n PooledTransaction pooledTx = this.getMainMap().get(bw).getTx();\n removedTxl.add(pooledTx);\n\n long timestamp = pooledTx.tx.getTimeStampBI().longValue() / multiplyM;\n synchronized (this.getTimeView().get(timestamp)) {\n if (this.getTimeView().get(timestamp) == null) {\n LOG.error(\n \"Txpool.remove can't find the timestamp in the map [{}]\",\n pooledTx.toString());\n return;\n }\n\n this.getTimeView().get(timestamp).remove(bw);\n if (this.getTimeView().get(timestamp).isEmpty()) {\n this.getTimeView().remove(timestamp);\n }\n }\n\n lock.writeLock().lock();\n this.getMainMap().remove(bw);\n lock.writeLock().unlock();\n }\n });\n\n this.updateAccPoolState();\n this.updateFeeMap();\n\n if (LOG.isInfoEnabled()) {\n LOG.info(\"TxPoolA0.remove {} TX\", removedTxl.size());\n }\n\n return removedTxl;\n }", "public List<Token> getAllToken() throws BusinessException;", "@NotNull\n List<Balance> balances(@NotNull List<String> addresses) throws EtherScanException;", "public Transaction[] handleTxs(Transaction[] possibleTxs) {\n ArrayList<Transaction> validTransactions = new ArrayList<>();\n for (Transaction tx : possibleTxs){\n if (isValidTx(tx)){\n validTransactions.add(tx);\n consumePoolCoins(tx);\n createPoolCoins(tx);\n }\n }\n return validTransactions.toArray(new Transaction[validTransactions.size()]);\n }", "AllUsersAddresses getAllUsersAddresses();", "public interface AccountAPI {\n\n /**\n * Address ETH balance\n * \n * @param address get balance for\n * @return balance\n * @throws EtherScanException parent exception class\n */\n @NotNull\n Balance balance(@NotNull String address) throws EtherScanException;\n\n /**\n * ERC20 token balance for address\n * \n * @param address get balance for\n * @param contract token contract\n * @return token balance for address\n * @throws EtherScanException parent exception class\n */\n @NotNull\n TokenBalance balance(@NotNull String address, @NotNull String contract) throws EtherScanException;\n\n /**\n * Maximum 20 address for single batch request If address MORE THAN 20, then there will be more than\n * 1 request performed\n * \n * @param addresses addresses to get balances for\n * @return list of balances\n * @throws EtherScanException parent exception class\n */\n @NotNull\n List<Balance> balances(@NotNull List<String> addresses) throws EtherScanException;\n\n /**\n * All txs for given address\n * \n * @param address get txs for\n * @param startBlock tx from this blockNumber\n * @param endBlock tx to this blockNumber\n * @return txs for address\n * @throws EtherScanException parent exception class\n */\n @NotNull\n List<Tx> txs(@NotNull String address, long startBlock, long endBlock) throws EtherScanException;\n\n @NotNull\n List<Tx> txs(@NotNull String address, long startBlock) throws EtherScanException;\n\n @NotNull\n List<Tx> txs(@NotNull String address) throws EtherScanException;\n\n /**\n * All internal txs for given address\n * \n * @param address get txs for\n * @param startBlock tx from this blockNumber\n * @param endBlock tx to this blockNumber\n * @return txs for address\n * @throws EtherScanException parent exception class\n */\n @NotNull\n List<TxInternal> txsInternal(@NotNull String address, long startBlock, long endBlock) throws EtherScanException;\n\n @NotNull\n List<TxInternal> txsInternal(@NotNull String address, long startBlock) throws EtherScanException;\n\n @NotNull\n List<TxInternal> txsInternal(@NotNull String address) throws EtherScanException;\n\n /**\n * All internal tx for given transaction hash\n * \n * @param txhash transaction hash\n * @return internal txs list\n * @throws EtherScanException parent exception class\n */\n @NotNull\n List<TxInternal> txsInternalByHash(@NotNull String txhash) throws EtherScanException;\n\n /**\n * All ERC-20 token txs for given address\n * \n * @param address get txs for\n * @param startBlock tx from this blockNumber\n * @param endBlock tx to this blockNumber\n * @return txs for address\n * @throws EtherScanException parent exception class\n */\n @NotNull\n List<TxErc20> txsErc20(@NotNull String address, long startBlock, long endBlock) throws EtherScanException;\n\n @NotNull\n List<TxErc20> txsErc20(@NotNull String address, long startBlock) throws EtherScanException;\n\n @NotNull\n List<TxErc20> txsErc20(@NotNull String address) throws EtherScanException;\n\n /**\n * All ERC-20 token txs for given address and contract address\n *\n * @param address get txs for\n * @param contractAddress contract address to get txs for\n * @param startBlock tx from this blockNumber\n * @param endBlock tx to this blockNumber\n * @return txs for address\n * @throws EtherScanException parent exception class\n */\n @NotNull\n List<TxErc20> txsErc20(@NotNull String address, @NotNull String contractAddress, long startBlock, long endBlock)\n throws EtherScanException;\n\n @NotNull\n List<TxErc20> txsErc20(@NotNull String address, @NotNull String contractAddress, long startBlock) throws EtherScanException;\n\n @NotNull\n List<TxErc20> txsErc20(@NotNull String address, @NotNull String contractAddress) throws EtherScanException;\n\n /**\n * All ERC-721 (NFT) token txs for given address\n *\n * @param address get txs for\n * @param startBlock tx from this blockNumber\n * @param endBlock tx to this blockNumber\n * @return txs for address\n * @throws EtherScanException parent exception class\n */\n @NotNull\n List<TxErc721> txsErc721(@NotNull String address, long startBlock, long endBlock) throws EtherScanException;\n\n @NotNull\n List<TxErc721> txsErc721(@NotNull String address, long startBlock) throws EtherScanException;\n\n @NotNull\n List<TxErc721> txsErc721(@NotNull String address) throws EtherScanException;\n\n /**\n * All ERC-721 (NFT) token txs for given address\n *\n * @param address get txs for\n * @param startBlock tx from this blockNumber\n * @param endBlock tx to this blockNumber\n * @return txs for address\n * @throws EtherScanException parent exception class\n */\n @NotNull\n List<TxErc721> txsErc721(@NotNull String address, @NotNull String contractAddress, long startBlock, long endBlock)\n throws EtherScanException;\n\n @NotNull\n List<TxErc721> txsErc721(@NotNull String address, @NotNull String contractAddress, long startBlock) throws EtherScanException;\n\n @NotNull\n List<TxErc721> txsErc721(@NotNull String address, @NotNull String contractAddress) throws EtherScanException;\n\n /**\n * All ERC-721 (NFT) token txs for given address\n *\n * @param address get txs for\n * @param startBlock tx from this blockNumber\n * @param endBlock tx to this blockNumber\n * @return txs for address\n * @throws EtherScanException parent exception class\n */\n @NotNull\n List<TxErc1155> txsErc1155(@NotNull String address, long startBlock, long endBlock) throws EtherScanException;\n\n @NotNull\n List<TxErc1155> txsErc1155(@NotNull String address, long startBlock) throws EtherScanException;\n\n @NotNull\n List<TxErc1155> txsErc1155(@NotNull String address) throws EtherScanException;\n\n /**\n * All ERC-721 (NFT) token txs for given address\n *\n * @param address get txs for\n * @param startBlock tx from this blockNumber\n * @param endBlock tx to this blockNumber\n * @return txs for address\n * @throws EtherScanException parent exception class\n */\n @NotNull\n List<TxErc1155> txsErc1155(@NotNull String address, @NotNull String contractAddress, long startBlock, long endBlock)\n throws EtherScanException;\n\n @NotNull\n List<TxErc1155> txsErc1155(@NotNull String address, @NotNull String contractAddress, long startBlock)\n throws EtherScanException;\n\n @NotNull\n List<TxErc1155> txsErc1155(@NotNull String address, @NotNull String contractAddress) throws EtherScanException;\n\n /**\n * All blocks mined by address\n * \n * @param address address to search for\n * @return blocks mined\n * @throws EtherScanException parent exception class\n */\n @NotNull\n List<Block> blocksMined(@NotNull String address) throws EtherScanException;\n}", "public Transaction[] handleTxs(Transaction[] possibleTxs) {\n // IMPLEMENT THIS\n if(possibleTxs == null)\n return new Transaction[0];\n \n ArrayList<Transaction> validTxs = new ArrayList<>();\n \n //iterate through each transaction, validate, remove spent UTXO, add new UTXO\n for(int i = 0; i < possibleTxs.length; i++){\n \n //validate tx\n if(isValidTx(possibleTxs[i])){\n possibleTxs[i].finalize();\n validTxs.add(possibleTxs[i]);\n \n //remove valid/spent UTXOs from current pool\n for(Transaction.Input x:possibleTxs[i].getInputs()){\n UTXO inputUTXO = new UTXO(x.prevTxHash, x.outputIndex);\n currentPool.removeUTXO(inputUTXO);\n }\n \n //add new UTXOs to current pool\n int utxoIndex = 0;\n for(Transaction.Output x:possibleTxs[i].getOutputs()){\n UTXO outputUTXO = new UTXO(possibleTxs[i].getHash(), utxoIndex);\n currentPool.addUTXO(outputUTXO, x);\n utxoIndex++;\n }\n \n }\n }\n \n //return list of validated \n Transaction[] validatedTxs = new Transaction[validTxs.size()];\n \n validatedTxs = validTxs.toArray(validatedTxs);\n \n return validatedTxs;\n }", "@Override\r\n\tpublic ArrayList<Rents> readRents(String address) {\n\t\treturn null;\r\n\t}", "private void printAll() {\n\n String infuraAddress = \"70ddb1f89ca9421885b6268e847a459d\";\n dappSmartcontractAddress = \"0x07d55a62b487d61a0b47c2937016f68e4bcec0e9\";\n smartContractGetfunctionAddress = \"0x7355a424\";\n\n CoinNetworkInfo coinNetworkInfo = new CoinNetworkInfo(\n CoinType.ETH,\n EthereumNetworkType.ROPSTEN,\n \"https://ropsten.infura.io/v3/\"+infuraAddress\n );\n\n List<Account> accountList = sBlockchain.getAccountManager()\n .getAccounts(hardwareWallet.getWalletId(), CoinType.ETH, EthereumNetworkType.ROPSTEN);\n\n ethereumService = (EthereumService) CoinServiceFactory.getCoinService(this, coinNetworkInfo);\n\n\n ethereumService.callSmartContractFunction(\n (EthereumAccount) accountList.get(0),\n dappSmartcontractAddress,\n smartContractGetfunctionAddress\n ).setCallback(new ListenableFutureTask.Callback<String>() {\n @Override\n public void onSuccess(String result) { //return hex string\n Log.d(\"SUCCESS TAG\", \"transaction data : \"+result);\n\n getPost(result, accountList);\n\n\n }\n\n @Override\n public void onFailure(@NotNull ExecutionException e) {\n Log.d(\"ERROR TAG #101\",e.toString());\n }\n\n @Override\n public void onCancelled(@NotNull InterruptedException e) {\n Log.d(\"ERROR TAG #102\",e.toString());\n }\n });\n\n\n }", "@NotNull\n TokenBalance balance(@NotNull String address, @NotNull String contract) throws EtherScanException;", "private boolean getAddresses(){\n try {\n URLtoJSON URLtoJSON = new URLtoJSON();\n JSONObject json = URLtoJSON.open(this.URL+\"merchant/\"+this.GUID+\"/list?password=\"+this.pswd()+\"&api_code=\"+this.ApiCode);\n \n if(!json.isNull(\"error\")) return false; //If there is no transactions return false;\n JSONArray nameArray = json.names();\n JSONArray TotalArray = json.toJSONArray(nameArray);\n JSONArray JAddresses = TotalArray.getJSONArray(0);\n \n for(int i = 0; i < JAddresses.length(); i++){\n String O=\"false\";\n String S=\"false\";\n String N=\"false\";\n String[] Label=JAddresses.getJSONObject(i).getString(\"label\").split(\"_\",-1);\n if(Label.length==3){\n O=Label[1];\n S=Label[0];\n N=Label[2];\n }\n String[] Matched=this.matchDB(JAddresses.getJSONObject(i).getString(\"address\"));\n String[] Details= new String[]{\n \"S: \"+S, //0 Transaction ID\n Matched[0], //1 Sender\n Float.toString(JAddresses.getJSONObject(i).getLong(\"total_received\")/100000000)+\" (BTC)\",//2 Amount in btc\n O, //3 Choosen option\n \"btc\", //4 Currency\n \"O: \"+Matched[2], //5 Date\n Matched[1] //6 Senders nem or false \n };\n if(!this.list.contains(Details)){\n this.list.add(Details);\n if(!\"false\".equals(O) && !O.equals(\"\")){\n this.setAmountsAndEntries(Integer.parseInt(O), JAddresses.getJSONObject(i).getLong(\"total_received\"), Details[6]); //add the amount and rise the entries\n }\n }\n }\n return true;\n } catch (JSONException | NumberFormatException e) {\n e.printStackTrace();\n }\n return false;\n }", "private List<Messages.Address> mapModelAddressToWireAddress(List<byte[]> addresses) {\n return addresses.stream().map(address -> Messages.Address.newBuilder()\n .setPort(6565)\n .setIpAddress(ByteString.copyFrom(address))\n .build())\n .collect(Collectors.toList());\n }", "private String parseAddresses(Address[] address) {\n String listAddress = \"\";\n\n if (address != null) {\n for (int i = 0; i < address.length; i++) {\n listAddress += address[i].toString() + \", \";\n }\n }\n if (listAddress.length() > 1) {\n listAddress = listAddress.substring(0, listAddress.length() - 2);\n }\n\n return listAddress;\n }", "public String[] createNewAddress(){\r\n byte[][] pairs=ECDSAgeneratePublicAndPrivateKey();\r\n byte[] afterhashing=RIPEMD160(SHA256hash(pairs[1]));\r\n byte[] checksum=getCheckSum(SHA256hash(SHA256hash(afterhashing)));\r\n byte[] bitcoinaddress=concateByteArray(afterhashing,checksum);\r\n return new String[]{toHex(pairs[0]), convertPrivateKeytoWIF(pairs[0]), base58encode(bitcoinaddress)};\r\n }", "Collection lookupTransactions(String email);", "public com.zenithbank.mtn.fleet.Transaction[] getCardTrans(boolean includeOpeningBalance) throws java.rmi.RemoteException;", "Collection lookupTransactions(String email, String reason);", "public TradeHistoryReq address(String address) {\n this.address = address;\n return this;\n }", "java.util.List<kr.pik.message.Profile.ProfileMessage.ContactAddress> \n getContactAddressList();", "io.envoyproxy.envoy.data.dns.v3.DnsTable.AddressList getAddressList();", "private void requestAddresses(byte nAddr) throws Exception {\n final HashSet<Inet4Address> addrs = new HashSet<>();\n byte[] hwAddrBytes = new byte[] { 8, 4, 3, 2, 1, 0 };\n for (byte i = 0; i < nAddr; i++) {\n hwAddrBytes[5] = i;\n MacAddress newMac = MacAddress.fromBytes(hwAddrBytes);\n final String hostname = \"host_\" + i;\n final DhcpLease lease = mRepo.getOffer(CLIENTID_UNSPEC, newMac,\n IPV4_ADDR_ANY /* relayAddr */, INETADDR_UNSPEC /* reqAddr */, hostname);\n\n assertNotNull(lease);\n assertEquals(newMac, lease.getHwAddr());\n assertEquals(hostname, lease.getHostname());\n assertTrue(format(\"Duplicate address allocated: %s in %s\", lease.getNetAddr(), addrs),\n addrs.add(lease.getNetAddr()));\n\n requestLeaseSelecting(newMac, lease.getNetAddr(), hostname);\n }\n }", "private List<DriverAddress> generateAddresses(Driver driver, int amount){\n\t\tList<DriverAddress> addresses = new ArrayList<DriverAddress>();\n\t\tfor(int i=0; i < amount; i++){ \t\t\n\t\t\taddresses.add(new DriverAddress());\n\t\t\taddresses.get(i).setBusinessInd(\"N\");\n\t\t\taddresses.get(i).setAddressLine1(i + \" Driver Service Test\");\n\t\t\taddresses.get(i).setPostcode(\"45241\");\n\t\t\taddresses.get(i).setGeoCode(\"0800\");\t\t\n\t\t\taddresses.get(i).setAddressType(driverService.getDriverAddressTypeCodes().get(0));\n\t\t\taddresses.get(i).setDriver(driver);\n\t\t}\n\t\treturn addresses;\n\t}", "@GetMapping(value = \"/payments/{accountNumber}\")\n\tpublic List<PaymentDTO> getAccountTransactions(@PathVariable(\"accountNumber\") final String accountNumber) {\n\t\treturn this.paymentsService.getAccountTransactions(accountNumber);\n\t}", "public static List<Address> GetAllRecordsFromTable() {\n\n return SQLite.select().from(Address.class).queryList();\n\n\n }", "public abstract List<String> associateAddresses(NodeMetadata node);", "List<?> getAddress();", "public void listAll(List<Address> AddressList) {\n for (Address a : AddressList) {\n console.promptForPrintPrompt(a.toString());\n }\n }", "public List<PeerAddress> all() {\n final List<PeerAddress> all = new ArrayList<PeerAddress>();\n for (final Map<Number160, PeerStatistic> map : peerMapVerified) {\n synchronized (map) {\n for (PeerStatistic peerStatistic : map.values()) {\n all.add(peerStatistic.peerAddress());\n }\n }\n }\n return all;\n }", "public Transaction[] getTransactionsList() throws Exception;", "public AddressList listAllAddresses(String addressBook)\n\t{\n\t\treturn controller.listAllAddresses(addressBook);\n\t}", "public Call<ExpResult<List<DelegationInfo>>> getDelegations(MinterAddress address) {\n checkNotNull(address, \"Address can't be null\");\n\n return getInstantService().getDelegationsForAddress(address.toString(), 1);\n }", "public void testLongStreetAddress() throws InterruptedException {\n Customer customer = CustomerService.getInstance().getCustomerById(new Integer(5276));\r\n ir.printInvoice(custInv, customer);\r\n }", "@Test\n public void SameTokenNameOpenInvalidAddress() {\n dbManager.getDynamicPropertiesStore().saveAllowSameTokenName(1);\n InitExchangeSameTokenNameActive();\n long exchangeId = 1;\n String firstTokenId = \"123\";\n long firstTokenQuant = 100000000L;\n String secondTokenId = \"456\";\n long secondTokenQuant = 200000000L;\n\n byte[] ownerAddress = ByteArray.fromHexString(OWNER_ADDRESS_FIRST);\n AccountCapsule accountCapsule = dbManager.getAccountStore().get(ownerAddress);\n Map<String, Long> assetV2Map = accountCapsule.getAssetMapV2();\n Assert.assertEquals(10000_000000L, accountCapsule.getBalance());\n Assert.assertEquals(null, assetV2Map.get(firstTokenId));\n Assert.assertEquals(null, assetV2Map.get(secondTokenId));\n\n ExchangeWithdrawActuator actuator = new ExchangeWithdrawActuator(getContract(\n OWNER_ADDRESS_INVALID, exchangeId, firstTokenId, firstTokenQuant),\n dbManager);\n TransactionResultCapsule ret = new TransactionResultCapsule();\n\n try {\n actuator.validate();\n actuator.execute(ret);\n fail(\"Invalid address\");\n } catch (ContractValidateException e) {\n Assert.assertTrue(e instanceof ContractValidateException);\n Assert.assertEquals(\"Invalid address\", e.getMessage());\n } catch (ContractExeException e) {\n Assert.assertFalse(e instanceof ContractExeException);\n } finally {\n dbManager.getExchangeStore().delete(ByteArray.fromLong(1L));\n dbManager.getExchangeStore().delete(ByteArray.fromLong(2L));\n dbManager.getExchangeV2Store().delete(ByteArray.fromLong(1L));\n dbManager.getExchangeV2Store().delete(ByteArray.fromLong(2L));\n }\n }", "@Override\n\tpublic List<CashTransactionDtl> getCashTransactionDtlByAccount(\n\t\t\tMap<String, Object> params) throws ServiceException {\n\t\treturn cashTransactionDtlMapper.queryCashTransactionRecord(params);\n\t}", "java.util.List<com.google.protobuf.ByteString> getTransactionsList();", "public ArrayList<String> getAllTokens() {\n ArrayList<String> returnlist = new ArrayList<String>();\n // Select All Query\n String selectQuery = \"SELECT Token FROM \" + TABLE_NAME;\n\n SQLiteDatabase db = this.getWritableDatabase();\n Cursor cursor = db.rawQuery(selectQuery, null);\n\n // looping through all rows and adding to list\n if (cursor.moveToFirst()) {\n do {\n ArrayList<String> data = new ArrayList<String>();\n for (int i =0; i<cursor.getColumnCount(); i++){\n data.add(cursor.getString(i));\n }\n // Adding contact to list\n returnlist.add(data.get(0));\n } while (cursor.moveToNext());\n }\n\n // return contact list\n cursor.close();\n db.close();\n return returnlist;\n }", "public ArrayList<RouteTableEntry> getFIBExcludingLL3PAddress(Integer LL3PAddress) {\n \tIterator<RouteTableEntry> tableIterator=table.iterator();\n \tArrayList<RouteTableEntry> treatedForwaedingList= new ArrayList<RouteTableEntry>();\n\t\tRouteTableEntry tmp=null;\n\t\t//boolean found=false;\n\t\ttry{\n\t\twhile(tableIterator.hasNext()){\n\t\t\ttmp=tableIterator.next();\n\t\t\tInteger tmpLL3=tmp.getSourceLL3P();\n\t\t\tif(!(tmpLL3.equals(LL3PAddress))){\n\t\t\t\t\tInteger tmpNetworkNumber = tmp.getNetworkDistancePair().getNetworkNumber();\n\t\t\t\t\t//String hen=Integer.toHexString(LL3PAddress);\n\t\t\t\t Integer tmpLL3pNetworkNumber = Utilities.getNetworkNumber(Integer.toHexString(LL3PAddress));\n\t\t\t\t\tif (!(tmpNetworkNumber.equals(tmpLL3pNetworkNumber))){\n\t\t\t\t\t\ttreatedForwaedingList.add(tmp);\n\t\t\t }\n\t \t\t}\n\t\t}\n\t\t}\n\t\tcatch(Exception e){\n\t\t\t\n\t\t}\n\t\treturn treatedForwaedingList;\n }", "EmailAddress fetchEmailAddress(AccessToken token);", "public static String[] generateEPRs(SocketAcceptor acceptor, String serviceName, String ip) {\n //Get all the addresses associated with the acceptor\n Map<SessionID, SocketAddress> socketAddresses = acceptor.getAcceptorAddresses();\n //Get all the sessions (SessionIDs) associated with the acceptor\n ArrayList<SessionID> sessions = acceptor.getSessions();\n String[] EPRList = new String[sessions.size()];\n\n //Generate an EPR for each session/socket address\n for (int i = 0; i < sessions.size(); i++) {\n SessionID sessionID = sessions.get(i);\n InetSocketAddress socketAddress = (InetSocketAddress) socketAddresses.get(sessionID);\n EPRList[i] = FIXConstants.FIX_PREFIX + ip + \":\" + socketAddress.getPort() +\n \"?\" + FIXConstants.BEGIN_STRING + \"=\" + sessionID.getBeginString() +\n \"&\" + FIXConstants.SENDER_COMP_ID + \"=\" + sessionID.getTargetCompID() +\n \"&\" + FIXConstants.TARGET_COMP_ID + \"=\" + sessionID.getSenderCompID();\n\n String sessionQualifier = sessionID.getSessionQualifier();\n if (sessionQualifier != null && !sessionQualifier.equals(\"\")) {\n EPRList[i] += \"&\" + FIXConstants.SESSION_QUALIFIER + \"=\" + sessionQualifier;\n }\n\n String senderSubID = sessionID.getSenderSubID();\n if (senderSubID != null && !senderSubID.equals(\"\")) {\n EPRList[i] += \"&\" + FIXConstants.SENDER_SUB_ID + \"=\" + senderSubID;\n }\n\n String targetSubID = sessionID.getTargetSubID();\n if (targetSubID != null && !targetSubID.equals(\"\")) {\n EPRList[i] += \"&\" + FIXConstants.TARGET_SUB_ID + \"=\" + targetSubID;\n }\n\n String senderLocationID = sessionID.getSenderLocationID();\n if (senderLocationID != null && !senderLocationID.equals(\"\")) {\n EPRList[i] += \"&\" + FIXConstants.SENDER_LOCATION_ID + \"=\" + senderLocationID;\n }\n\n String targetLocationID = sessionID.getTargetLocationID();\n if (targetLocationID != null && !targetLocationID.equals(\"\")) {\n EPRList[i] += \"&\" + FIXConstants.TARGET_LOCATION_ID + \"=\" + targetLocationID;\n }\n\n EPRList[i] += \"&Service=\" + serviceName;\n }\n return EPRList;\n }", "public List<AddressEntity> getAllAddress(CustomerEntity customerEntity) {\n\n //Creating List of AddressEntities.\n List<AddressEntity> addressEntities = new LinkedList<>();\n\n //Calls Method of customerAddressDao,getAllCustomerAddressByCustomer and returns AddressList.\n List<CustomerAddressEntity> customerAddressEntities = customerAddressDao.getAllCustomerAddressByCustomer(customerEntity);\n if (customerAddressEntities != null) { //Checking if CustomerAddressEntity is null else extracting address and adding to the addressEntites list.\n customerAddressEntities.forEach(customerAddressEntity -> {\n addressEntities.add(customerAddressEntity.getAddress());\n });\n }\n\n return addressEntities;\n\n }", "ListenableFuture<String> attestFor(\n List<DiagnosisKey> keys,\n List<String> regions,\n String verificationCode,\n int transmissionRisk) {\n Log.i(TAG, \"Getting SafetyNet attestation.\");\n String cleartext = cleartextFor(keys, regions, verificationCode, transmissionRisk);\n String nonce = BASE64.encode(sha256(cleartext));\n return safetyNetAttestationFor(nonce);\n }", "@Override\n\tpublic List<Address> FindAllAddress() {\n\t\treturn ab.FindAll();\n\t}", "public void setAddresses(List<Address> addresses) {\r\n\r\n this.addresses = addresses;\r\n\r\n }", "public static List<MemoryBlock> getAllMemoryAddresses() {\n\n List<MemoryBlock> addresses = new ArrayList<MemoryBlock>();\n\n for (int i = 0; i <= EEPROM_MAX_ADDRESS; i++) {\n addresses.add(new MemoryBlock(Utils.intToHexString(i), \"\"));\n }\n return addresses;\n }", "private static String getUnsuccessfulAddresses(\n final List<Pair<RelocatedAddress, Integer>> addresses) {\n return getAddressString(addresses, new ICollectionFilter<Pair<RelocatedAddress, Integer>>() {\n @Override\n public boolean qualifies(final Pair<RelocatedAddress, Integer> item) {\n return item.second() != 0;\n }\n });\n }", "public List<Address> getAllAddressesByName(String user_name) {\n\t\tList<Address> address = new ArrayList<>();\r\n\t\taddressdao.findByUserUsername(user_name)\r\n\t\t.forEach(address::add);\r\n\t\treturn address;\r\n\t}", "public List<Address> findAll();", "@Override\n\t\tpublic List<AccountTransaction> findAll() {\n\t\t\treturn null;\n\t\t}", "List<Account> findAccountByAddressStartingWith(String pattern);", "public boolean containsAddress(String address) {\n\t\treturn tseqnums.containsKey(address);\n\t}", "@Test\n public void SameTokenNameCloseInvalidAddress() {\n dbManager.getDynamicPropertiesStore().saveAllowSameTokenName(0);\n InitExchangeBeforeSameTokenNameActive();\n long exchangeId = 1;\n String firstTokenId = \"abc\";\n long firstTokenQuant = 100000000L;\n String secondTokenId = \"def\";\n long secondTokenQuant = 200000000L;\n\n byte[] ownerAddress = ByteArray.fromHexString(OWNER_ADDRESS_FIRST);\n AccountCapsule accountCapsule = dbManager.getAccountStore().get(ownerAddress);\n Map<String, Long> assetMap = accountCapsule.getAssetMap();\n Assert.assertEquals(10000_000000L, accountCapsule.getBalance());\n Assert.assertEquals(null, assetMap.get(firstTokenId));\n Assert.assertEquals(null, assetMap.get(secondTokenId));\n\n ExchangeWithdrawActuator actuator = new ExchangeWithdrawActuator(getContract(\n OWNER_ADDRESS_INVALID, exchangeId, firstTokenId, firstTokenQuant),\n dbManager);\n TransactionResultCapsule ret = new TransactionResultCapsule();\n\n try {\n actuator.validate();\n actuator.execute(ret);\n fail(\"Invalid address\");\n } catch (ContractValidateException e) {\n Assert.assertTrue(e instanceof ContractValidateException);\n Assert.assertEquals(\"Invalid address\", e.getMessage());\n } catch (ContractExeException e) {\n Assert.assertFalse(e instanceof ContractExeException);\n } finally {\n dbManager.getExchangeStore().delete(ByteArray.fromLong(1L));\n dbManager.getExchangeStore().delete(ByteArray.fromLong(2L));\n dbManager.getExchangeV2Store().delete(ByteArray.fromLong(1L));\n dbManager.getExchangeV2Store().delete(ByteArray.fromLong(2L));\n }\n }", "public static com.networknt.taiji.token.TokenTransactions.Builder newBuilder() {\n return new com.networknt.taiji.token.TokenTransactions.Builder();\n }", "@Override\r\n\tpublic List<UserAddress> viewUserAddressList() {\r\n\t\tList<UserAddress> result = new ArrayList<UserAddress>();\r\n useraddressrepository.findAll().forEach(UserAddress1 -> result.add(UserAddress1));\r\n return result;\r\n\t}", "public ArrayList<Account> GetCustomerAccounts(String ssn)\n {\n ArrayList<Account> result = new ArrayList<>();\n\n for (Account account : accounts)\n {\n if (account.getSsn().equals(ssn))\n {\n result.add(account);\n }\n }\n\n return result;\n }", "com.google.protobuf.ByteString getTransactions(int index);", "List<Trade> getAllTrades() throws OrderBookTradeException ;", "public void setAddresses(List<String> addresses) {\n this.addresses = addresses;\n }", "@Override\r\n\tpublic ArrayList<UserClass> readUsers(String address) {\n\t\treturn null;\r\n\t}", "public static Address getTroveFromAddress()\n {\n Address rval = new Address();\n\n rval.setFirstName(\"Trove, Inc.\");\n rval.setAddressLine1(\"20 Exchange Place\");\n rval.setAddressLine2(\"Apt 1604\");\n rval.setCity(\"New York\");\n Subdivision subdivision = new Subdivision();\n subdivision.setCode(\"US-NY\");\n\n rval.setSubdivision(subdivision);\n rval.setPostalCode(\"10005\");\n rval.setPhone(\"3108096011\");\n\n return rval;\n }", "public List<String> findActiveCongestionPointAddresses(LocalDate period) {\n return congestionPointConnectionGroupRepository.findActiveCongestionPointConnectionGroup(period).stream()\n .map(ConnectionGroup::getUsefIdentifier).collect(Collectors.toList());\n }", "public IndividualAddress(final int address)\n\t{\n\t\tsuper(address);\n\t}", "public List getAddressList() {\r\n System.out.println(\"List Elements :\" + addressList);\r\n return addressList;\r\n }", "public List<Email> getUnregisteredEmailList(Ram ram);", "private static SendGridRequest.EmailAddress [] getPersonalizationAddresses(String addresses) {\n if (addresses != null) {\n return Arrays.stream(addresses.split(\";\"))\n .map(String::trim)\n .map(address -> {\n SendGridRequest.EmailAddress emailAddress = new SendGridRequest.EmailAddress();\n emailAddress.setEmail(address);\n return emailAddress;\n })\n .toArray(SendGridRequest.EmailAddress []::new);\n } else {\n return null;\n }\n }", "public static Tax[] getTaxes() {\n Tax[] taxes = new Tax[DeclarationFiller.getDeclaration().size()];\n int count = 0;\n if (taxes != null ) {\n for (Map.Entry<String, Integer> incomePoint : DeclarationFiller.getDeclaration().entrySet()) {\n String taxName = \"Tax of \" + incomePoint.getKey();\n int incomValue = incomePoint.getValue();\n taxes[count] = new Tax(count+1001 ,taxName, incomValue, 0.18);\n count++;\n }\n }\n return taxes;\n }", "public IndividualAddress(final byte[] address)\n\t{\n\t\tsuper(address);\n\t}", "public List<com.generator.tables.pojos.CreditChain> fetchByAddress(String... values) {\n return fetch(CreditChain.CREDIT_CHAIN.ADDRESS, values);\n }", "public static byte[] makeNonce(String senderAddress, String receiverIdentifier, Timestamp timestamp, byte[] otherData) {\n if (!ValidationTools.isAddress(senderAddress)) {\n throw ExceptionUtil.throwException(logger, new IllegalArgumentException(\"Address is not valid\"));\n }\n ByteBuffer buffer = ByteBuffer.allocate(otherDataIndexStart + otherData.length);\n // Hash to ensure all variable length components is encoded with constant length\n buffer.put(senderAddress.toUpperCase().getBytes(StandardCharsets.UTF_8));\n buffer.put(AttestationCrypto.hashWithKeccak(receiverIdentifier.getBytes(StandardCharsets.UTF_8)));\n buffer.put(longToBytes(timestamp.getTime()));\n buffer.put(otherData);\n return buffer.array();\n }", "@CrossOrigin\n @RequestMapping(path=\"/address/customer\",method = RequestMethod.GET, produces = MediaType.APPLICATION_JSON_UTF8_VALUE)\n public ResponseEntity<AddressListResponse> getAllAddress(@RequestHeader(\"authorization\") final String authorization) throws AuthorizationFailedException {\n\n String[] splitStrings = authorization.split(\" \");\n String accessToken = splitStrings[1];\n\n CustomerEntity loggedCustomer = customerService.getCustomer(accessToken);\n List<AddressEntity> addressEntityList = addressService.getAllAddress(loggedCustomer);\n\n AddressListResponse addressListResponse = new AddressListResponse();\n if(addressEntityList==null){\n addressListResponse = null;\n return new ResponseEntity<>(addressListResponse, HttpStatus.OK);\n }\n\n List<AddressList> addressLists = new ArrayList<>();\n\n for (AddressEntity addressEntity : addressEntityList) {\n AddressList adr = new AddressList();\n adr.setId(UUID.fromString(addressEntity.getUuid()));\n adr.setFlatBuildingName(addressEntity.getFlatBuilNo());\n adr.setLocality(addressEntity.getLocality());\n adr.setCity(addressEntity.getCity());\n adr.setPincode(addressEntity.getPincode());\n\n AddressListState statesList = new AddressListState();\n String stateUuid = addressEntity.getState().getUuid();\n statesList.setId(UUID.fromString(stateUuid));\n statesList.setStateName(addressEntity.getState().getStateName());\n adr.setState(statesList);\n addressLists.add(adr);\n }\n\n return new ResponseEntity<>(addressListResponse.addresses(addressLists), HttpStatus.OK);\n\n }", "default List<PendingAttestation> get_matching_head_attestations(BeaconState state, EpochNumber epoch) {\n return get_matching_source_attestations(state, epoch).stream()\n .filter(a -> a.getData().getBeaconBlockRoot().equals(\n get_block_root_at_slot(state, get_attestation_slot(state, a.getData()))))\n .collect(toList());\n }", "void generateSameTX(String name, List<String> types, Settings settings);", "public Vector<NetworkAddress> getHostAddresses(int type) {return addressesChecker.getAllMyAddresses(type); }", "public static List<BangkingTransaction> findByAccountNumber(Long acc) {\n\t\treturn Ebean.find(BangkingTransaction.class).select(\"transaction_id\").where().eq(\"senderAccount.accountNumber\", acc).findList();\r\n\t\t\r\n\t}", "@Override\n public List<CryptoAddressRequest> listAllPendingRequests() throws CantListPendingCryptoAddressRequestsException {\n try {\n\n return cryptoAddressesNetworkServiceDao.listAllPendingRequests();\n\n } catch (CantListPendingCryptoAddressRequestsException e){\n\n errorManager.reportUnexpectedPluginException(this.getPluginVersionReference(), UnexpectedPluginExceptionSeverity.DISABLES_SOME_FUNCTIONALITY_WITHIN_THIS_PLUGIN, e);\n throw e;\n } catch (Exception e){\n\n errorManager.reportUnexpectedPluginException(this.getPluginVersionReference(), UnexpectedPluginExceptionSeverity.DISABLES_SOME_FUNCTIONALITY_WITHIN_THIS_PLUGIN, e);\n throw new CantListPendingCryptoAddressRequestsException(FermatException.wrapException(e), null, \"Unhandled Exception.\");\n }\n }", "@Override\n public List<CryptoAddressRequest> listPendingCryptoAddressRequests() throws CantListPendingCryptoAddressRequestsException {\n try {\n\n return cryptoAddressesNetworkServiceDao.listPendingRequestsByProtocolStateAndAction(ProtocolState.PENDING_ACTION, RequestAction.REQUEST);\n\n } catch (CantListPendingCryptoAddressRequestsException e){\n\n errorManager.reportUnexpectedPluginException(this.getPluginVersionReference(), UnexpectedPluginExceptionSeverity.DISABLES_SOME_FUNCTIONALITY_WITHIN_THIS_PLUGIN, e);\n throw e;\n } catch (Exception e){\n\n errorManager.reportUnexpectedPluginException(this.getPluginVersionReference(), UnexpectedPluginExceptionSeverity.DISABLES_SOME_FUNCTIONALITY_WITHIN_THIS_PLUGIN, e);\n throw new CantListPendingCryptoAddressRequestsException(FermatException.wrapException(e), null, \"Unhandled Exception.\");\n }\n }", "public SendWalletThread(String[] address,Wallet wallet) {\r\n\t\tthis.WALLET = wallet;\r\n\t\tADDRESS= address;\r\n\t}", "static void printAccountBalance(String address){\n }", "private Account createAccount(byte[] address) {\n return new Account(address);\n }", "private List<Tenant> getTenantsByKeyChangeXml(Document document) throws KeyChangeException {\n List<Tenant> tenantList = new ArrayList<Tenant>();\n List<TenantData> tenantDataList;\n tenantDataList = KeyChangeDataUtils.getKeyChangeTenantDataByXML(document).getTenantDataList();\n TenantManager tenantManager = ServiceHolder.getRealmService().getTenantManager();\n // Iterate through tenants\n for (TenantData tenantData : tenantDataList) {\n String tenantDomain = null;\n try {\n tenantDomain = tenantData.getTenantDomain();\n int tenantId = ServiceHolder.getRealmService().getTenantManager().getTenantId(tenantDomain);\n if (tenantId != MultitenantConstants.INVALID_TENANT_ID) {\n Tenant tenant = tenantManager.getTenant(tenantId);\n tenantList.add(tenant);\n } else {\n log.error(\"Invalid tenant domain '\" + tenantDomain + \"'\");\n // If the specific tenant domain is invalid continuing the flow for the rest of the tenants.\n }\n } catch (UserStoreException e) {\n throw new KeyChangeException(\"User store exception while getting the tenant ID for tenant \" +\n tenantDomain, e);\n }\n }\n return tenantList;\n }", "int getServiceAccountIdTokensCount();", "public abstract String generateTokens(int targetNumber);", "com.google.protobuf.ByteString\n\t\t\tgetAddressBytes();" ]
[ "0.7152389", "0.6795158", "0.6524173", "0.6424524", "0.63005066", "0.6086244", "0.58309996", "0.5304834", "0.52032167", "0.5147329", "0.50936204", "0.5074344", "0.48291612", "0.47886845", "0.4773262", "0.47700232", "0.4761369", "0.4751397", "0.47383618", "0.47155795", "0.47125039", "0.4703851", "0.4590081", "0.4544326", "0.45295796", "0.45214093", "0.4511265", "0.4477108", "0.44641897", "0.4441554", "0.44328305", "0.44085228", "0.44039574", "0.43883473", "0.43836153", "0.4339882", "0.43335542", "0.4331053", "0.43227285", "0.43112764", "0.42869088", "0.42759362", "0.42689466", "0.42587712", "0.42506206", "0.4246708", "0.42443508", "0.4219319", "0.42117172", "0.4205554", "0.4185273", "0.41823927", "0.41752073", "0.41748732", "0.41649958", "0.4150085", "0.41474143", "0.41284662", "0.4127189", "0.41163245", "0.41147467", "0.41141346", "0.41127464", "0.41112489", "0.41035596", "0.41016114", "0.4093911", "0.40925193", "0.40924677", "0.40849283", "0.4074132", "0.40706718", "0.40672132", "0.40604988", "0.4059227", "0.40548947", "0.40470442", "0.40334833", "0.40252516", "0.4022804", "0.40178254", "0.40107468", "0.4008683", "0.40068212", "0.40065545", "0.39904454", "0.39878196", "0.39824048", "0.39791095", "0.39787695", "0.39786765", "0.39785233", "0.39670596", "0.3958508", "0.3956425", "0.3956203", "0.39561343", "0.39524284", "0.39518237", "0.39517716" ]
0.7342023
0
All ERC721 (NFT) token txs for given address
@NotNull List<TxErc721> txsErc721(@NotNull String address, @NotNull String contractAddress, long startBlock, long endBlock) throws EtherScanException;
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@NotNull\n List<TxErc721> txsErc721(@NotNull String address, long startBlock, long endBlock) throws EtherScanException;", "@NotNull\n List<Tx> txs(@NotNull String address, long startBlock, long endBlock) throws EtherScanException;", "@NotNull\n List<TxErc1155> txsErc1155(@NotNull String address, long startBlock, long endBlock) throws EtherScanException;", "@NotNull\n List<TxInternal> txsInternal(@NotNull String address, long startBlock, long endBlock) throws EtherScanException;", "@NotNull\n List<TxErc20> txsErc20(@NotNull String address, long startBlock, long endBlock) throws EtherScanException;", "@NotNull\n List<TxErc1155> txsErc1155(@NotNull String address, @NotNull String contractAddress, long startBlock, long endBlock)\n throws EtherScanException;", "@NotNull\n List<TxErc20> txsErc20(@NotNull String address, @NotNull String contractAddress, long startBlock, long endBlock)\n throws EtherScanException;", "@Override\n public List<UTXO> getOpenTransactionOutputs(List<Address> addresses) throws UTXOProviderException {\n\n List<UTXO> results = new LinkedList<UTXO>();\n for (Address a : addresses) {\n ByteBuffer bb = ByteBuffer.allocate(21);\n bb.put((byte) KeyType.ADDRESS_HASHINDEX.ordinal());\n bb.put(a.getHash160());\n\n ReadOptions ro = new ReadOptions();\n Snapshot sn = db.getSnapshot();\n ro.snapshot(sn);\n\n // Scanning over iterator very fast\n\n DBIterator iterator = db.iterator(ro);\n for (iterator.seek(bb.array()); iterator.hasNext(); iterator.next()) {\n ByteBuffer bbKey = ByteBuffer.wrap(iterator.peekNext().getKey());\n bbKey.get(); // remove the address_hashindex byte.\n byte[] addressKey = new byte[20];\n bbKey.get(addressKey);\n if (!Arrays.equals(addressKey, a.getHash160())) {\n break;\n }\n byte[] hashBytes = new byte[32];\n bbKey.get(hashBytes);\n int index = bbKey.getInt();\n Sha256Hash hash = Sha256Hash.wrap(hashBytes);\n UTXO txout;\n try {\n // TODO this should be on the SNAPSHOT too......\n // this is really a BUG.\n txout = getTransactionOutput(hash, index);\n } catch (BlockStoreException e) {\n throw new UTXOProviderException(\"block store execption\", e);\n }\n if (txout != null) {\n Script sc = txout.getScript();\n Address address = sc.getToAddress(params, true);\n UTXO output = new UTXO(txout.getHash(), txout.getIndex(), txout.getValue(), txout.getHeight(),\n txout.isCoinbase(), txout.getScript(), address.toString());\n results.add(output);\n }\n }\n try {\n iterator.close();\n ro = null;\n sn.close();\n sn = null;\n } catch (IOException e) {\n log.error(\"Error closing snapshot/iterator?\", e);\n }\n }\n return results;\n }", "java.lang.String getServiceAccountIdTokens(int index);", "public static byte[] generateContractAddress(byte[] address, BigInteger nonce) {\n List<RlpType> values = new ArrayList<>();\n\n values.add(RlpString.create(address));\n values.add(RlpString.create(nonce));\n RlpList rlpList = new RlpList(values);\n\n byte[] encoded = RlpEncoder.encode(rlpList);\n byte[] hashed = Hash.sha3(encoded);\n return Arrays.copyOfRange(hashed, 12, hashed.length);\n }", "public List<BigInteger> getNonceList(AionAddress acc) {\n\n List<BigInteger> nl = Collections.synchronizedList(new ArrayList<>());\n lock.readLock().lock();\n this.getAccView(acc).getMap().entrySet().parallelStream().forEach(e -> nl.add(e.getKey()));\n lock.readLock().unlock();\n\n return nl.parallelStream().sorted().collect(Collectors.toList());\n }", "com.google.protobuf.ByteString getServiceAccountIdTokensBytes(int index);", "java.util.List<java.lang.String> getServiceAccountIdTokensList();", "public Transaction[] handleTxs(Transaction[] possibleTxs) {\n // IMPLEMENT THIS\n List<Transaction> validTxs = new ArrayList<>();\n for (Transaction tx : possibleTxs) {\n if (isValidTx(tx)) {\n validTxs.add(tx);\n ArrayList<Transaction.Output> outputs = tx.getOutputs();\n for (int idx = 0; idx < outputs.size(); idx++) {\n UTXO utxo = new UTXO(tx.getHash(), idx);\n utxoPool.addUTXO(utxo, outputs.get(idx));\n }\n }\n }\n\n return validTxs.toArray(new Transaction[0]);\n }", "public List<Address> getAllAddresses() throws BackendException;", "public static java.util.List<com.ifl.rapid.customer.model.CRM_Trn_Address> findAll()\n\t\tthrows com.liferay.portal.kernel.exception.SystemException {\n\t\treturn getPersistence().findAll();\n\t}", "@NotNull\n List<TxInternal> txsInternalByHash(@NotNull String txhash) throws EtherScanException;", "@NotNull\n List<Block> blocksMined(@NotNull String address) throws EtherScanException;", "@Override\n public List<PooledTransaction> removeTxsWithNonceLessThan(Map<AionAddress, BigInteger> accNonce) {\n\n List<ByteArrayWrapper> bwList = new ArrayList<>();\n for (Map.Entry<AionAddress, BigInteger> en1 : accNonce.entrySet()) {\n AccountState as = this.getAccView(en1.getKey());\n lock.writeLock().lock();\n Iterator<Map.Entry<BigInteger, AbstractMap.SimpleEntry<ByteArrayWrapper, BigInteger>>>\n it = as.getMap().entrySet().iterator();\n\n while (it.hasNext()) {\n Map.Entry<BigInteger, AbstractMap.SimpleEntry<ByteArrayWrapper, BigInteger>> en =\n it.next();\n if (en1.getValue().compareTo(en.getKey()) > 0) {\n bwList.add(en.getValue().getKey());\n it.remove();\n } else {\n break;\n }\n }\n lock.writeLock().unlock();\n\n Set<BigInteger> fee = Collections.synchronizedSet(new HashSet<>());\n if (this.getPoolStateView(en1.getKey()) != null) {\n this.getPoolStateView(en1.getKey())\n .parallelStream()\n .forEach(ps -> fee.add(ps.getFee()));\n }\n\n fee.parallelStream()\n .forEach(\n bi -> {\n if (this.getFeeView().get(bi) != null) {\n this.getFeeView()\n .get(bi)\n .entrySet()\n .removeIf(\n byteArrayWrapperTxDependListEntry ->\n byteArrayWrapperTxDependListEntry\n .getValue()\n .getAddress()\n .equals(en1.getKey()));\n\n if (this.getFeeView().get(bi).isEmpty()) {\n this.getFeeView().remove(bi);\n }\n }\n });\n\n as.setDirty();\n }\n\n List<PooledTransaction> removedTxl = Collections.synchronizedList(new ArrayList<>());\n bwList.parallelStream()\n .forEach(\n bw -> {\n if (this.getMainMap().get(bw) != null) {\n PooledTransaction pooledTx = this.getMainMap().get(bw).getTx();\n removedTxl.add(pooledTx);\n\n long timestamp = pooledTx.tx.getTimeStampBI().longValue() / multiplyM;\n synchronized (this.getTimeView().get(timestamp)) {\n if (this.getTimeView().get(timestamp) == null) {\n LOG.error(\n \"Txpool.remove can't find the timestamp in the map [{}]\",\n pooledTx.toString());\n return;\n }\n\n this.getTimeView().get(timestamp).remove(bw);\n if (this.getTimeView().get(timestamp).isEmpty()) {\n this.getTimeView().remove(timestamp);\n }\n }\n\n lock.writeLock().lock();\n this.getMainMap().remove(bw);\n lock.writeLock().unlock();\n }\n });\n\n this.updateAccPoolState();\n this.updateFeeMap();\n\n if (LOG.isInfoEnabled()) {\n LOG.info(\"TxPoolA0.remove {} TX\", removedTxl.size());\n }\n\n return removedTxl;\n }", "public List<Token> getAllToken() throws BusinessException;", "@NotNull\n List<Balance> balances(@NotNull List<String> addresses) throws EtherScanException;", "public Transaction[] handleTxs(Transaction[] possibleTxs) {\n ArrayList<Transaction> validTransactions = new ArrayList<>();\n for (Transaction tx : possibleTxs){\n if (isValidTx(tx)){\n validTransactions.add(tx);\n consumePoolCoins(tx);\n createPoolCoins(tx);\n }\n }\n return validTransactions.toArray(new Transaction[validTransactions.size()]);\n }", "AllUsersAddresses getAllUsersAddresses();", "public interface AccountAPI {\n\n /**\n * Address ETH balance\n * \n * @param address get balance for\n * @return balance\n * @throws EtherScanException parent exception class\n */\n @NotNull\n Balance balance(@NotNull String address) throws EtherScanException;\n\n /**\n * ERC20 token balance for address\n * \n * @param address get balance for\n * @param contract token contract\n * @return token balance for address\n * @throws EtherScanException parent exception class\n */\n @NotNull\n TokenBalance balance(@NotNull String address, @NotNull String contract) throws EtherScanException;\n\n /**\n * Maximum 20 address for single batch request If address MORE THAN 20, then there will be more than\n * 1 request performed\n * \n * @param addresses addresses to get balances for\n * @return list of balances\n * @throws EtherScanException parent exception class\n */\n @NotNull\n List<Balance> balances(@NotNull List<String> addresses) throws EtherScanException;\n\n /**\n * All txs for given address\n * \n * @param address get txs for\n * @param startBlock tx from this blockNumber\n * @param endBlock tx to this blockNumber\n * @return txs for address\n * @throws EtherScanException parent exception class\n */\n @NotNull\n List<Tx> txs(@NotNull String address, long startBlock, long endBlock) throws EtherScanException;\n\n @NotNull\n List<Tx> txs(@NotNull String address, long startBlock) throws EtherScanException;\n\n @NotNull\n List<Tx> txs(@NotNull String address) throws EtherScanException;\n\n /**\n * All internal txs for given address\n * \n * @param address get txs for\n * @param startBlock tx from this blockNumber\n * @param endBlock tx to this blockNumber\n * @return txs for address\n * @throws EtherScanException parent exception class\n */\n @NotNull\n List<TxInternal> txsInternal(@NotNull String address, long startBlock, long endBlock) throws EtherScanException;\n\n @NotNull\n List<TxInternal> txsInternal(@NotNull String address, long startBlock) throws EtherScanException;\n\n @NotNull\n List<TxInternal> txsInternal(@NotNull String address) throws EtherScanException;\n\n /**\n * All internal tx for given transaction hash\n * \n * @param txhash transaction hash\n * @return internal txs list\n * @throws EtherScanException parent exception class\n */\n @NotNull\n List<TxInternal> txsInternalByHash(@NotNull String txhash) throws EtherScanException;\n\n /**\n * All ERC-20 token txs for given address\n * \n * @param address get txs for\n * @param startBlock tx from this blockNumber\n * @param endBlock tx to this blockNumber\n * @return txs for address\n * @throws EtherScanException parent exception class\n */\n @NotNull\n List<TxErc20> txsErc20(@NotNull String address, long startBlock, long endBlock) throws EtherScanException;\n\n @NotNull\n List<TxErc20> txsErc20(@NotNull String address, long startBlock) throws EtherScanException;\n\n @NotNull\n List<TxErc20> txsErc20(@NotNull String address) throws EtherScanException;\n\n /**\n * All ERC-20 token txs for given address and contract address\n *\n * @param address get txs for\n * @param contractAddress contract address to get txs for\n * @param startBlock tx from this blockNumber\n * @param endBlock tx to this blockNumber\n * @return txs for address\n * @throws EtherScanException parent exception class\n */\n @NotNull\n List<TxErc20> txsErc20(@NotNull String address, @NotNull String contractAddress, long startBlock, long endBlock)\n throws EtherScanException;\n\n @NotNull\n List<TxErc20> txsErc20(@NotNull String address, @NotNull String contractAddress, long startBlock) throws EtherScanException;\n\n @NotNull\n List<TxErc20> txsErc20(@NotNull String address, @NotNull String contractAddress) throws EtherScanException;\n\n /**\n * All ERC-721 (NFT) token txs for given address\n *\n * @param address get txs for\n * @param startBlock tx from this blockNumber\n * @param endBlock tx to this blockNumber\n * @return txs for address\n * @throws EtherScanException parent exception class\n */\n @NotNull\n List<TxErc721> txsErc721(@NotNull String address, long startBlock, long endBlock) throws EtherScanException;\n\n @NotNull\n List<TxErc721> txsErc721(@NotNull String address, long startBlock) throws EtherScanException;\n\n @NotNull\n List<TxErc721> txsErc721(@NotNull String address) throws EtherScanException;\n\n /**\n * All ERC-721 (NFT) token txs for given address\n *\n * @param address get txs for\n * @param startBlock tx from this blockNumber\n * @param endBlock tx to this blockNumber\n * @return txs for address\n * @throws EtherScanException parent exception class\n */\n @NotNull\n List<TxErc721> txsErc721(@NotNull String address, @NotNull String contractAddress, long startBlock, long endBlock)\n throws EtherScanException;\n\n @NotNull\n List<TxErc721> txsErc721(@NotNull String address, @NotNull String contractAddress, long startBlock) throws EtherScanException;\n\n @NotNull\n List<TxErc721> txsErc721(@NotNull String address, @NotNull String contractAddress) throws EtherScanException;\n\n /**\n * All ERC-721 (NFT) token txs for given address\n *\n * @param address get txs for\n * @param startBlock tx from this blockNumber\n * @param endBlock tx to this blockNumber\n * @return txs for address\n * @throws EtherScanException parent exception class\n */\n @NotNull\n List<TxErc1155> txsErc1155(@NotNull String address, long startBlock, long endBlock) throws EtherScanException;\n\n @NotNull\n List<TxErc1155> txsErc1155(@NotNull String address, long startBlock) throws EtherScanException;\n\n @NotNull\n List<TxErc1155> txsErc1155(@NotNull String address) throws EtherScanException;\n\n /**\n * All ERC-721 (NFT) token txs for given address\n *\n * @param address get txs for\n * @param startBlock tx from this blockNumber\n * @param endBlock tx to this blockNumber\n * @return txs for address\n * @throws EtherScanException parent exception class\n */\n @NotNull\n List<TxErc1155> txsErc1155(@NotNull String address, @NotNull String contractAddress, long startBlock, long endBlock)\n throws EtherScanException;\n\n @NotNull\n List<TxErc1155> txsErc1155(@NotNull String address, @NotNull String contractAddress, long startBlock)\n throws EtherScanException;\n\n @NotNull\n List<TxErc1155> txsErc1155(@NotNull String address, @NotNull String contractAddress) throws EtherScanException;\n\n /**\n * All blocks mined by address\n * \n * @param address address to search for\n * @return blocks mined\n * @throws EtherScanException parent exception class\n */\n @NotNull\n List<Block> blocksMined(@NotNull String address) throws EtherScanException;\n}", "public Transaction[] handleTxs(Transaction[] possibleTxs) {\n // IMPLEMENT THIS\n if(possibleTxs == null)\n return new Transaction[0];\n \n ArrayList<Transaction> validTxs = new ArrayList<>();\n \n //iterate through each transaction, validate, remove spent UTXO, add new UTXO\n for(int i = 0; i < possibleTxs.length; i++){\n \n //validate tx\n if(isValidTx(possibleTxs[i])){\n possibleTxs[i].finalize();\n validTxs.add(possibleTxs[i]);\n \n //remove valid/spent UTXOs from current pool\n for(Transaction.Input x:possibleTxs[i].getInputs()){\n UTXO inputUTXO = new UTXO(x.prevTxHash, x.outputIndex);\n currentPool.removeUTXO(inputUTXO);\n }\n \n //add new UTXOs to current pool\n int utxoIndex = 0;\n for(Transaction.Output x:possibleTxs[i].getOutputs()){\n UTXO outputUTXO = new UTXO(possibleTxs[i].getHash(), utxoIndex);\n currentPool.addUTXO(outputUTXO, x);\n utxoIndex++;\n }\n \n }\n }\n \n //return list of validated \n Transaction[] validatedTxs = new Transaction[validTxs.size()];\n \n validatedTxs = validTxs.toArray(validatedTxs);\n \n return validatedTxs;\n }", "@Override\r\n\tpublic ArrayList<Rents> readRents(String address) {\n\t\treturn null;\r\n\t}", "private void printAll() {\n\n String infuraAddress = \"70ddb1f89ca9421885b6268e847a459d\";\n dappSmartcontractAddress = \"0x07d55a62b487d61a0b47c2937016f68e4bcec0e9\";\n smartContractGetfunctionAddress = \"0x7355a424\";\n\n CoinNetworkInfo coinNetworkInfo = new CoinNetworkInfo(\n CoinType.ETH,\n EthereumNetworkType.ROPSTEN,\n \"https://ropsten.infura.io/v3/\"+infuraAddress\n );\n\n List<Account> accountList = sBlockchain.getAccountManager()\n .getAccounts(hardwareWallet.getWalletId(), CoinType.ETH, EthereumNetworkType.ROPSTEN);\n\n ethereumService = (EthereumService) CoinServiceFactory.getCoinService(this, coinNetworkInfo);\n\n\n ethereumService.callSmartContractFunction(\n (EthereumAccount) accountList.get(0),\n dappSmartcontractAddress,\n smartContractGetfunctionAddress\n ).setCallback(new ListenableFutureTask.Callback<String>() {\n @Override\n public void onSuccess(String result) { //return hex string\n Log.d(\"SUCCESS TAG\", \"transaction data : \"+result);\n\n getPost(result, accountList);\n\n\n }\n\n @Override\n public void onFailure(@NotNull ExecutionException e) {\n Log.d(\"ERROR TAG #101\",e.toString());\n }\n\n @Override\n public void onCancelled(@NotNull InterruptedException e) {\n Log.d(\"ERROR TAG #102\",e.toString());\n }\n });\n\n\n }", "@NotNull\n TokenBalance balance(@NotNull String address, @NotNull String contract) throws EtherScanException;", "private boolean getAddresses(){\n try {\n URLtoJSON URLtoJSON = new URLtoJSON();\n JSONObject json = URLtoJSON.open(this.URL+\"merchant/\"+this.GUID+\"/list?password=\"+this.pswd()+\"&api_code=\"+this.ApiCode);\n \n if(!json.isNull(\"error\")) return false; //If there is no transactions return false;\n JSONArray nameArray = json.names();\n JSONArray TotalArray = json.toJSONArray(nameArray);\n JSONArray JAddresses = TotalArray.getJSONArray(0);\n \n for(int i = 0; i < JAddresses.length(); i++){\n String O=\"false\";\n String S=\"false\";\n String N=\"false\";\n String[] Label=JAddresses.getJSONObject(i).getString(\"label\").split(\"_\",-1);\n if(Label.length==3){\n O=Label[1];\n S=Label[0];\n N=Label[2];\n }\n String[] Matched=this.matchDB(JAddresses.getJSONObject(i).getString(\"address\"));\n String[] Details= new String[]{\n \"S: \"+S, //0 Transaction ID\n Matched[0], //1 Sender\n Float.toString(JAddresses.getJSONObject(i).getLong(\"total_received\")/100000000)+\" (BTC)\",//2 Amount in btc\n O, //3 Choosen option\n \"btc\", //4 Currency\n \"O: \"+Matched[2], //5 Date\n Matched[1] //6 Senders nem or false \n };\n if(!this.list.contains(Details)){\n this.list.add(Details);\n if(!\"false\".equals(O) && !O.equals(\"\")){\n this.setAmountsAndEntries(Integer.parseInt(O), JAddresses.getJSONObject(i).getLong(\"total_received\"), Details[6]); //add the amount and rise the entries\n }\n }\n }\n return true;\n } catch (JSONException | NumberFormatException e) {\n e.printStackTrace();\n }\n return false;\n }", "private List<Messages.Address> mapModelAddressToWireAddress(List<byte[]> addresses) {\n return addresses.stream().map(address -> Messages.Address.newBuilder()\n .setPort(6565)\n .setIpAddress(ByteString.copyFrom(address))\n .build())\n .collect(Collectors.toList());\n }", "private String parseAddresses(Address[] address) {\n String listAddress = \"\";\n\n if (address != null) {\n for (int i = 0; i < address.length; i++) {\n listAddress += address[i].toString() + \", \";\n }\n }\n if (listAddress.length() > 1) {\n listAddress = listAddress.substring(0, listAddress.length() - 2);\n }\n\n return listAddress;\n }", "public String[] createNewAddress(){\r\n byte[][] pairs=ECDSAgeneratePublicAndPrivateKey();\r\n byte[] afterhashing=RIPEMD160(SHA256hash(pairs[1]));\r\n byte[] checksum=getCheckSum(SHA256hash(SHA256hash(afterhashing)));\r\n byte[] bitcoinaddress=concateByteArray(afterhashing,checksum);\r\n return new String[]{toHex(pairs[0]), convertPrivateKeytoWIF(pairs[0]), base58encode(bitcoinaddress)};\r\n }", "Collection lookupTransactions(String email);", "public com.zenithbank.mtn.fleet.Transaction[] getCardTrans(boolean includeOpeningBalance) throws java.rmi.RemoteException;", "Collection lookupTransactions(String email, String reason);", "public TradeHistoryReq address(String address) {\n this.address = address;\n return this;\n }", "java.util.List<kr.pik.message.Profile.ProfileMessage.ContactAddress> \n getContactAddressList();", "io.envoyproxy.envoy.data.dns.v3.DnsTable.AddressList getAddressList();", "private void requestAddresses(byte nAddr) throws Exception {\n final HashSet<Inet4Address> addrs = new HashSet<>();\n byte[] hwAddrBytes = new byte[] { 8, 4, 3, 2, 1, 0 };\n for (byte i = 0; i < nAddr; i++) {\n hwAddrBytes[5] = i;\n MacAddress newMac = MacAddress.fromBytes(hwAddrBytes);\n final String hostname = \"host_\" + i;\n final DhcpLease lease = mRepo.getOffer(CLIENTID_UNSPEC, newMac,\n IPV4_ADDR_ANY /* relayAddr */, INETADDR_UNSPEC /* reqAddr */, hostname);\n\n assertNotNull(lease);\n assertEquals(newMac, lease.getHwAddr());\n assertEquals(hostname, lease.getHostname());\n assertTrue(format(\"Duplicate address allocated: %s in %s\", lease.getNetAddr(), addrs),\n addrs.add(lease.getNetAddr()));\n\n requestLeaseSelecting(newMac, lease.getNetAddr(), hostname);\n }\n }", "private List<DriverAddress> generateAddresses(Driver driver, int amount){\n\t\tList<DriverAddress> addresses = new ArrayList<DriverAddress>();\n\t\tfor(int i=0; i < amount; i++){ \t\t\n\t\t\taddresses.add(new DriverAddress());\n\t\t\taddresses.get(i).setBusinessInd(\"N\");\n\t\t\taddresses.get(i).setAddressLine1(i + \" Driver Service Test\");\n\t\t\taddresses.get(i).setPostcode(\"45241\");\n\t\t\taddresses.get(i).setGeoCode(\"0800\");\t\t\n\t\t\taddresses.get(i).setAddressType(driverService.getDriverAddressTypeCodes().get(0));\n\t\t\taddresses.get(i).setDriver(driver);\n\t\t}\n\t\treturn addresses;\n\t}", "@GetMapping(value = \"/payments/{accountNumber}\")\n\tpublic List<PaymentDTO> getAccountTransactions(@PathVariable(\"accountNumber\") final String accountNumber) {\n\t\treturn this.paymentsService.getAccountTransactions(accountNumber);\n\t}", "public static List<Address> GetAllRecordsFromTable() {\n\n return SQLite.select().from(Address.class).queryList();\n\n\n }", "public abstract List<String> associateAddresses(NodeMetadata node);", "List<?> getAddress();", "public void listAll(List<Address> AddressList) {\n for (Address a : AddressList) {\n console.promptForPrintPrompt(a.toString());\n }\n }", "public List<PeerAddress> all() {\n final List<PeerAddress> all = new ArrayList<PeerAddress>();\n for (final Map<Number160, PeerStatistic> map : peerMapVerified) {\n synchronized (map) {\n for (PeerStatistic peerStatistic : map.values()) {\n all.add(peerStatistic.peerAddress());\n }\n }\n }\n return all;\n }", "public Transaction[] getTransactionsList() throws Exception;", "public AddressList listAllAddresses(String addressBook)\n\t{\n\t\treturn controller.listAllAddresses(addressBook);\n\t}", "public Call<ExpResult<List<DelegationInfo>>> getDelegations(MinterAddress address) {\n checkNotNull(address, \"Address can't be null\");\n\n return getInstantService().getDelegationsForAddress(address.toString(), 1);\n }", "public void testLongStreetAddress() throws InterruptedException {\n Customer customer = CustomerService.getInstance().getCustomerById(new Integer(5276));\r\n ir.printInvoice(custInv, customer);\r\n }", "@Test\n public void SameTokenNameOpenInvalidAddress() {\n dbManager.getDynamicPropertiesStore().saveAllowSameTokenName(1);\n InitExchangeSameTokenNameActive();\n long exchangeId = 1;\n String firstTokenId = \"123\";\n long firstTokenQuant = 100000000L;\n String secondTokenId = \"456\";\n long secondTokenQuant = 200000000L;\n\n byte[] ownerAddress = ByteArray.fromHexString(OWNER_ADDRESS_FIRST);\n AccountCapsule accountCapsule = dbManager.getAccountStore().get(ownerAddress);\n Map<String, Long> assetV2Map = accountCapsule.getAssetMapV2();\n Assert.assertEquals(10000_000000L, accountCapsule.getBalance());\n Assert.assertEquals(null, assetV2Map.get(firstTokenId));\n Assert.assertEquals(null, assetV2Map.get(secondTokenId));\n\n ExchangeWithdrawActuator actuator = new ExchangeWithdrawActuator(getContract(\n OWNER_ADDRESS_INVALID, exchangeId, firstTokenId, firstTokenQuant),\n dbManager);\n TransactionResultCapsule ret = new TransactionResultCapsule();\n\n try {\n actuator.validate();\n actuator.execute(ret);\n fail(\"Invalid address\");\n } catch (ContractValidateException e) {\n Assert.assertTrue(e instanceof ContractValidateException);\n Assert.assertEquals(\"Invalid address\", e.getMessage());\n } catch (ContractExeException e) {\n Assert.assertFalse(e instanceof ContractExeException);\n } finally {\n dbManager.getExchangeStore().delete(ByteArray.fromLong(1L));\n dbManager.getExchangeStore().delete(ByteArray.fromLong(2L));\n dbManager.getExchangeV2Store().delete(ByteArray.fromLong(1L));\n dbManager.getExchangeV2Store().delete(ByteArray.fromLong(2L));\n }\n }", "@Override\n\tpublic List<CashTransactionDtl> getCashTransactionDtlByAccount(\n\t\t\tMap<String, Object> params) throws ServiceException {\n\t\treturn cashTransactionDtlMapper.queryCashTransactionRecord(params);\n\t}", "java.util.List<com.google.protobuf.ByteString> getTransactionsList();", "public ArrayList<String> getAllTokens() {\n ArrayList<String> returnlist = new ArrayList<String>();\n // Select All Query\n String selectQuery = \"SELECT Token FROM \" + TABLE_NAME;\n\n SQLiteDatabase db = this.getWritableDatabase();\n Cursor cursor = db.rawQuery(selectQuery, null);\n\n // looping through all rows and adding to list\n if (cursor.moveToFirst()) {\n do {\n ArrayList<String> data = new ArrayList<String>();\n for (int i =0; i<cursor.getColumnCount(); i++){\n data.add(cursor.getString(i));\n }\n // Adding contact to list\n returnlist.add(data.get(0));\n } while (cursor.moveToNext());\n }\n\n // return contact list\n cursor.close();\n db.close();\n return returnlist;\n }", "public ArrayList<RouteTableEntry> getFIBExcludingLL3PAddress(Integer LL3PAddress) {\n \tIterator<RouteTableEntry> tableIterator=table.iterator();\n \tArrayList<RouteTableEntry> treatedForwaedingList= new ArrayList<RouteTableEntry>();\n\t\tRouteTableEntry tmp=null;\n\t\t//boolean found=false;\n\t\ttry{\n\t\twhile(tableIterator.hasNext()){\n\t\t\ttmp=tableIterator.next();\n\t\t\tInteger tmpLL3=tmp.getSourceLL3P();\n\t\t\tif(!(tmpLL3.equals(LL3PAddress))){\n\t\t\t\t\tInteger tmpNetworkNumber = tmp.getNetworkDistancePair().getNetworkNumber();\n\t\t\t\t\t//String hen=Integer.toHexString(LL3PAddress);\n\t\t\t\t Integer tmpLL3pNetworkNumber = Utilities.getNetworkNumber(Integer.toHexString(LL3PAddress));\n\t\t\t\t\tif (!(tmpNetworkNumber.equals(tmpLL3pNetworkNumber))){\n\t\t\t\t\t\ttreatedForwaedingList.add(tmp);\n\t\t\t }\n\t \t\t}\n\t\t}\n\t\t}\n\t\tcatch(Exception e){\n\t\t\t\n\t\t}\n\t\treturn treatedForwaedingList;\n }", "EmailAddress fetchEmailAddress(AccessToken token);", "public static String[] generateEPRs(SocketAcceptor acceptor, String serviceName, String ip) {\n //Get all the addresses associated with the acceptor\n Map<SessionID, SocketAddress> socketAddresses = acceptor.getAcceptorAddresses();\n //Get all the sessions (SessionIDs) associated with the acceptor\n ArrayList<SessionID> sessions = acceptor.getSessions();\n String[] EPRList = new String[sessions.size()];\n\n //Generate an EPR for each session/socket address\n for (int i = 0; i < sessions.size(); i++) {\n SessionID sessionID = sessions.get(i);\n InetSocketAddress socketAddress = (InetSocketAddress) socketAddresses.get(sessionID);\n EPRList[i] = FIXConstants.FIX_PREFIX + ip + \":\" + socketAddress.getPort() +\n \"?\" + FIXConstants.BEGIN_STRING + \"=\" + sessionID.getBeginString() +\n \"&\" + FIXConstants.SENDER_COMP_ID + \"=\" + sessionID.getTargetCompID() +\n \"&\" + FIXConstants.TARGET_COMP_ID + \"=\" + sessionID.getSenderCompID();\n\n String sessionQualifier = sessionID.getSessionQualifier();\n if (sessionQualifier != null && !sessionQualifier.equals(\"\")) {\n EPRList[i] += \"&\" + FIXConstants.SESSION_QUALIFIER + \"=\" + sessionQualifier;\n }\n\n String senderSubID = sessionID.getSenderSubID();\n if (senderSubID != null && !senderSubID.equals(\"\")) {\n EPRList[i] += \"&\" + FIXConstants.SENDER_SUB_ID + \"=\" + senderSubID;\n }\n\n String targetSubID = sessionID.getTargetSubID();\n if (targetSubID != null && !targetSubID.equals(\"\")) {\n EPRList[i] += \"&\" + FIXConstants.TARGET_SUB_ID + \"=\" + targetSubID;\n }\n\n String senderLocationID = sessionID.getSenderLocationID();\n if (senderLocationID != null && !senderLocationID.equals(\"\")) {\n EPRList[i] += \"&\" + FIXConstants.SENDER_LOCATION_ID + \"=\" + senderLocationID;\n }\n\n String targetLocationID = sessionID.getTargetLocationID();\n if (targetLocationID != null && !targetLocationID.equals(\"\")) {\n EPRList[i] += \"&\" + FIXConstants.TARGET_LOCATION_ID + \"=\" + targetLocationID;\n }\n\n EPRList[i] += \"&Service=\" + serviceName;\n }\n return EPRList;\n }", "public List<AddressEntity> getAllAddress(CustomerEntity customerEntity) {\n\n //Creating List of AddressEntities.\n List<AddressEntity> addressEntities = new LinkedList<>();\n\n //Calls Method of customerAddressDao,getAllCustomerAddressByCustomer and returns AddressList.\n List<CustomerAddressEntity> customerAddressEntities = customerAddressDao.getAllCustomerAddressByCustomer(customerEntity);\n if (customerAddressEntities != null) { //Checking if CustomerAddressEntity is null else extracting address and adding to the addressEntites list.\n customerAddressEntities.forEach(customerAddressEntity -> {\n addressEntities.add(customerAddressEntity.getAddress());\n });\n }\n\n return addressEntities;\n\n }", "ListenableFuture<String> attestFor(\n List<DiagnosisKey> keys,\n List<String> regions,\n String verificationCode,\n int transmissionRisk) {\n Log.i(TAG, \"Getting SafetyNet attestation.\");\n String cleartext = cleartextFor(keys, regions, verificationCode, transmissionRisk);\n String nonce = BASE64.encode(sha256(cleartext));\n return safetyNetAttestationFor(nonce);\n }", "@Override\n\tpublic List<Address> FindAllAddress() {\n\t\treturn ab.FindAll();\n\t}", "public void setAddresses(List<Address> addresses) {\r\n\r\n this.addresses = addresses;\r\n\r\n }", "public static List<MemoryBlock> getAllMemoryAddresses() {\n\n List<MemoryBlock> addresses = new ArrayList<MemoryBlock>();\n\n for (int i = 0; i <= EEPROM_MAX_ADDRESS; i++) {\n addresses.add(new MemoryBlock(Utils.intToHexString(i), \"\"));\n }\n return addresses;\n }", "private static String getUnsuccessfulAddresses(\n final List<Pair<RelocatedAddress, Integer>> addresses) {\n return getAddressString(addresses, new ICollectionFilter<Pair<RelocatedAddress, Integer>>() {\n @Override\n public boolean qualifies(final Pair<RelocatedAddress, Integer> item) {\n return item.second() != 0;\n }\n });\n }", "public List<Address> getAllAddressesByName(String user_name) {\n\t\tList<Address> address = new ArrayList<>();\r\n\t\taddressdao.findByUserUsername(user_name)\r\n\t\t.forEach(address::add);\r\n\t\treturn address;\r\n\t}", "public List<Address> findAll();", "@Override\n\t\tpublic List<AccountTransaction> findAll() {\n\t\t\treturn null;\n\t\t}", "List<Account> findAccountByAddressStartingWith(String pattern);", "public boolean containsAddress(String address) {\n\t\treturn tseqnums.containsKey(address);\n\t}", "@Test\n public void SameTokenNameCloseInvalidAddress() {\n dbManager.getDynamicPropertiesStore().saveAllowSameTokenName(0);\n InitExchangeBeforeSameTokenNameActive();\n long exchangeId = 1;\n String firstTokenId = \"abc\";\n long firstTokenQuant = 100000000L;\n String secondTokenId = \"def\";\n long secondTokenQuant = 200000000L;\n\n byte[] ownerAddress = ByteArray.fromHexString(OWNER_ADDRESS_FIRST);\n AccountCapsule accountCapsule = dbManager.getAccountStore().get(ownerAddress);\n Map<String, Long> assetMap = accountCapsule.getAssetMap();\n Assert.assertEquals(10000_000000L, accountCapsule.getBalance());\n Assert.assertEquals(null, assetMap.get(firstTokenId));\n Assert.assertEquals(null, assetMap.get(secondTokenId));\n\n ExchangeWithdrawActuator actuator = new ExchangeWithdrawActuator(getContract(\n OWNER_ADDRESS_INVALID, exchangeId, firstTokenId, firstTokenQuant),\n dbManager);\n TransactionResultCapsule ret = new TransactionResultCapsule();\n\n try {\n actuator.validate();\n actuator.execute(ret);\n fail(\"Invalid address\");\n } catch (ContractValidateException e) {\n Assert.assertTrue(e instanceof ContractValidateException);\n Assert.assertEquals(\"Invalid address\", e.getMessage());\n } catch (ContractExeException e) {\n Assert.assertFalse(e instanceof ContractExeException);\n } finally {\n dbManager.getExchangeStore().delete(ByteArray.fromLong(1L));\n dbManager.getExchangeStore().delete(ByteArray.fromLong(2L));\n dbManager.getExchangeV2Store().delete(ByteArray.fromLong(1L));\n dbManager.getExchangeV2Store().delete(ByteArray.fromLong(2L));\n }\n }", "public static com.networknt.taiji.token.TokenTransactions.Builder newBuilder() {\n return new com.networknt.taiji.token.TokenTransactions.Builder();\n }", "@Override\r\n\tpublic List<UserAddress> viewUserAddressList() {\r\n\t\tList<UserAddress> result = new ArrayList<UserAddress>();\r\n useraddressrepository.findAll().forEach(UserAddress1 -> result.add(UserAddress1));\r\n return result;\r\n\t}", "public ArrayList<Account> GetCustomerAccounts(String ssn)\n {\n ArrayList<Account> result = new ArrayList<>();\n\n for (Account account : accounts)\n {\n if (account.getSsn().equals(ssn))\n {\n result.add(account);\n }\n }\n\n return result;\n }", "com.google.protobuf.ByteString getTransactions(int index);", "List<Trade> getAllTrades() throws OrderBookTradeException ;", "public void setAddresses(List<String> addresses) {\n this.addresses = addresses;\n }", "@Override\r\n\tpublic ArrayList<UserClass> readUsers(String address) {\n\t\treturn null;\r\n\t}", "public static Address getTroveFromAddress()\n {\n Address rval = new Address();\n\n rval.setFirstName(\"Trove, Inc.\");\n rval.setAddressLine1(\"20 Exchange Place\");\n rval.setAddressLine2(\"Apt 1604\");\n rval.setCity(\"New York\");\n Subdivision subdivision = new Subdivision();\n subdivision.setCode(\"US-NY\");\n\n rval.setSubdivision(subdivision);\n rval.setPostalCode(\"10005\");\n rval.setPhone(\"3108096011\");\n\n return rval;\n }", "public List<String> findActiveCongestionPointAddresses(LocalDate period) {\n return congestionPointConnectionGroupRepository.findActiveCongestionPointConnectionGroup(period).stream()\n .map(ConnectionGroup::getUsefIdentifier).collect(Collectors.toList());\n }", "public IndividualAddress(final int address)\n\t{\n\t\tsuper(address);\n\t}", "public List getAddressList() {\r\n System.out.println(\"List Elements :\" + addressList);\r\n return addressList;\r\n }", "public List<Email> getUnregisteredEmailList(Ram ram);", "private static SendGridRequest.EmailAddress [] getPersonalizationAddresses(String addresses) {\n if (addresses != null) {\n return Arrays.stream(addresses.split(\";\"))\n .map(String::trim)\n .map(address -> {\n SendGridRequest.EmailAddress emailAddress = new SendGridRequest.EmailAddress();\n emailAddress.setEmail(address);\n return emailAddress;\n })\n .toArray(SendGridRequest.EmailAddress []::new);\n } else {\n return null;\n }\n }", "public static Tax[] getTaxes() {\n Tax[] taxes = new Tax[DeclarationFiller.getDeclaration().size()];\n int count = 0;\n if (taxes != null ) {\n for (Map.Entry<String, Integer> incomePoint : DeclarationFiller.getDeclaration().entrySet()) {\n String taxName = \"Tax of \" + incomePoint.getKey();\n int incomValue = incomePoint.getValue();\n taxes[count] = new Tax(count+1001 ,taxName, incomValue, 0.18);\n count++;\n }\n }\n return taxes;\n }", "public IndividualAddress(final byte[] address)\n\t{\n\t\tsuper(address);\n\t}", "public List<com.generator.tables.pojos.CreditChain> fetchByAddress(String... values) {\n return fetch(CreditChain.CREDIT_CHAIN.ADDRESS, values);\n }", "public static byte[] makeNonce(String senderAddress, String receiverIdentifier, Timestamp timestamp, byte[] otherData) {\n if (!ValidationTools.isAddress(senderAddress)) {\n throw ExceptionUtil.throwException(logger, new IllegalArgumentException(\"Address is not valid\"));\n }\n ByteBuffer buffer = ByteBuffer.allocate(otherDataIndexStart + otherData.length);\n // Hash to ensure all variable length components is encoded with constant length\n buffer.put(senderAddress.toUpperCase().getBytes(StandardCharsets.UTF_8));\n buffer.put(AttestationCrypto.hashWithKeccak(receiverIdentifier.getBytes(StandardCharsets.UTF_8)));\n buffer.put(longToBytes(timestamp.getTime()));\n buffer.put(otherData);\n return buffer.array();\n }", "@CrossOrigin\n @RequestMapping(path=\"/address/customer\",method = RequestMethod.GET, produces = MediaType.APPLICATION_JSON_UTF8_VALUE)\n public ResponseEntity<AddressListResponse> getAllAddress(@RequestHeader(\"authorization\") final String authorization) throws AuthorizationFailedException {\n\n String[] splitStrings = authorization.split(\" \");\n String accessToken = splitStrings[1];\n\n CustomerEntity loggedCustomer = customerService.getCustomer(accessToken);\n List<AddressEntity> addressEntityList = addressService.getAllAddress(loggedCustomer);\n\n AddressListResponse addressListResponse = new AddressListResponse();\n if(addressEntityList==null){\n addressListResponse = null;\n return new ResponseEntity<>(addressListResponse, HttpStatus.OK);\n }\n\n List<AddressList> addressLists = new ArrayList<>();\n\n for (AddressEntity addressEntity : addressEntityList) {\n AddressList adr = new AddressList();\n adr.setId(UUID.fromString(addressEntity.getUuid()));\n adr.setFlatBuildingName(addressEntity.getFlatBuilNo());\n adr.setLocality(addressEntity.getLocality());\n adr.setCity(addressEntity.getCity());\n adr.setPincode(addressEntity.getPincode());\n\n AddressListState statesList = new AddressListState();\n String stateUuid = addressEntity.getState().getUuid();\n statesList.setId(UUID.fromString(stateUuid));\n statesList.setStateName(addressEntity.getState().getStateName());\n adr.setState(statesList);\n addressLists.add(adr);\n }\n\n return new ResponseEntity<>(addressListResponse.addresses(addressLists), HttpStatus.OK);\n\n }", "default List<PendingAttestation> get_matching_head_attestations(BeaconState state, EpochNumber epoch) {\n return get_matching_source_attestations(state, epoch).stream()\n .filter(a -> a.getData().getBeaconBlockRoot().equals(\n get_block_root_at_slot(state, get_attestation_slot(state, a.getData()))))\n .collect(toList());\n }", "void generateSameTX(String name, List<String> types, Settings settings);", "public Vector<NetworkAddress> getHostAddresses(int type) {return addressesChecker.getAllMyAddresses(type); }", "public static List<BangkingTransaction> findByAccountNumber(Long acc) {\n\t\treturn Ebean.find(BangkingTransaction.class).select(\"transaction_id\").where().eq(\"senderAccount.accountNumber\", acc).findList();\r\n\t\t\r\n\t}", "@Override\n public List<CryptoAddressRequest> listAllPendingRequests() throws CantListPendingCryptoAddressRequestsException {\n try {\n\n return cryptoAddressesNetworkServiceDao.listAllPendingRequests();\n\n } catch (CantListPendingCryptoAddressRequestsException e){\n\n errorManager.reportUnexpectedPluginException(this.getPluginVersionReference(), UnexpectedPluginExceptionSeverity.DISABLES_SOME_FUNCTIONALITY_WITHIN_THIS_PLUGIN, e);\n throw e;\n } catch (Exception e){\n\n errorManager.reportUnexpectedPluginException(this.getPluginVersionReference(), UnexpectedPluginExceptionSeverity.DISABLES_SOME_FUNCTIONALITY_WITHIN_THIS_PLUGIN, e);\n throw new CantListPendingCryptoAddressRequestsException(FermatException.wrapException(e), null, \"Unhandled Exception.\");\n }\n }", "@Override\n public List<CryptoAddressRequest> listPendingCryptoAddressRequests() throws CantListPendingCryptoAddressRequestsException {\n try {\n\n return cryptoAddressesNetworkServiceDao.listPendingRequestsByProtocolStateAndAction(ProtocolState.PENDING_ACTION, RequestAction.REQUEST);\n\n } catch (CantListPendingCryptoAddressRequestsException e){\n\n errorManager.reportUnexpectedPluginException(this.getPluginVersionReference(), UnexpectedPluginExceptionSeverity.DISABLES_SOME_FUNCTIONALITY_WITHIN_THIS_PLUGIN, e);\n throw e;\n } catch (Exception e){\n\n errorManager.reportUnexpectedPluginException(this.getPluginVersionReference(), UnexpectedPluginExceptionSeverity.DISABLES_SOME_FUNCTIONALITY_WITHIN_THIS_PLUGIN, e);\n throw new CantListPendingCryptoAddressRequestsException(FermatException.wrapException(e), null, \"Unhandled Exception.\");\n }\n }", "public SendWalletThread(String[] address,Wallet wallet) {\r\n\t\tthis.WALLET = wallet;\r\n\t\tADDRESS= address;\r\n\t}", "static void printAccountBalance(String address){\n }", "private Account createAccount(byte[] address) {\n return new Account(address);\n }", "private List<Tenant> getTenantsByKeyChangeXml(Document document) throws KeyChangeException {\n List<Tenant> tenantList = new ArrayList<Tenant>();\n List<TenantData> tenantDataList;\n tenantDataList = KeyChangeDataUtils.getKeyChangeTenantDataByXML(document).getTenantDataList();\n TenantManager tenantManager = ServiceHolder.getRealmService().getTenantManager();\n // Iterate through tenants\n for (TenantData tenantData : tenantDataList) {\n String tenantDomain = null;\n try {\n tenantDomain = tenantData.getTenantDomain();\n int tenantId = ServiceHolder.getRealmService().getTenantManager().getTenantId(tenantDomain);\n if (tenantId != MultitenantConstants.INVALID_TENANT_ID) {\n Tenant tenant = tenantManager.getTenant(tenantId);\n tenantList.add(tenant);\n } else {\n log.error(\"Invalid tenant domain '\" + tenantDomain + \"'\");\n // If the specific tenant domain is invalid continuing the flow for the rest of the tenants.\n }\n } catch (UserStoreException e) {\n throw new KeyChangeException(\"User store exception while getting the tenant ID for tenant \" +\n tenantDomain, e);\n }\n }\n return tenantList;\n }", "int getServiceAccountIdTokensCount();", "public abstract String generateTokens(int targetNumber);", "com.google.protobuf.ByteString\n\t\t\tgetAddressBytes();" ]
[ "0.7342023", "0.6795158", "0.6524173", "0.6424524", "0.63005066", "0.6086244", "0.58309996", "0.5304834", "0.52032167", "0.5147329", "0.50936204", "0.5074344", "0.48291612", "0.47886845", "0.4773262", "0.47700232", "0.4761369", "0.4751397", "0.47383618", "0.47155795", "0.47125039", "0.4703851", "0.4590081", "0.4544326", "0.45295796", "0.45214093", "0.4511265", "0.4477108", "0.44641897", "0.4441554", "0.44328305", "0.44085228", "0.44039574", "0.43883473", "0.43836153", "0.4339882", "0.43335542", "0.4331053", "0.43227285", "0.43112764", "0.42869088", "0.42759362", "0.42689466", "0.42587712", "0.42506206", "0.4246708", "0.42443508", "0.4219319", "0.42117172", "0.4205554", "0.4185273", "0.41823927", "0.41752073", "0.41748732", "0.41649958", "0.4150085", "0.41474143", "0.41284662", "0.4127189", "0.41163245", "0.41147467", "0.41141346", "0.41127464", "0.41112489", "0.41035596", "0.41016114", "0.4093911", "0.40925193", "0.40924677", "0.40849283", "0.4074132", "0.40706718", "0.40672132", "0.40604988", "0.4059227", "0.40548947", "0.40470442", "0.40334833", "0.40252516", "0.4022804", "0.40178254", "0.40107468", "0.4008683", "0.40068212", "0.40065545", "0.39904454", "0.39878196", "0.39824048", "0.39791095", "0.39787695", "0.39786765", "0.39785233", "0.39670596", "0.3958508", "0.3956425", "0.3956203", "0.39561343", "0.39524284", "0.39518237", "0.39517716" ]
0.7152389
1
All ERC721 (NFT) token txs for given address
@NotNull List<TxErc1155> txsErc1155(@NotNull String address, long startBlock, long endBlock) throws EtherScanException;
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@NotNull\n List<TxErc721> txsErc721(@NotNull String address, long startBlock, long endBlock) throws EtherScanException;", "@NotNull\n List<TxErc721> txsErc721(@NotNull String address, @NotNull String contractAddress, long startBlock, long endBlock)\n throws EtherScanException;", "@NotNull\n List<Tx> txs(@NotNull String address, long startBlock, long endBlock) throws EtherScanException;", "@NotNull\n List<TxInternal> txsInternal(@NotNull String address, long startBlock, long endBlock) throws EtherScanException;", "@NotNull\n List<TxErc20> txsErc20(@NotNull String address, long startBlock, long endBlock) throws EtherScanException;", "@NotNull\n List<TxErc1155> txsErc1155(@NotNull String address, @NotNull String contractAddress, long startBlock, long endBlock)\n throws EtherScanException;", "@NotNull\n List<TxErc20> txsErc20(@NotNull String address, @NotNull String contractAddress, long startBlock, long endBlock)\n throws EtherScanException;", "@Override\n public List<UTXO> getOpenTransactionOutputs(List<Address> addresses) throws UTXOProviderException {\n\n List<UTXO> results = new LinkedList<UTXO>();\n for (Address a : addresses) {\n ByteBuffer bb = ByteBuffer.allocate(21);\n bb.put((byte) KeyType.ADDRESS_HASHINDEX.ordinal());\n bb.put(a.getHash160());\n\n ReadOptions ro = new ReadOptions();\n Snapshot sn = db.getSnapshot();\n ro.snapshot(sn);\n\n // Scanning over iterator very fast\n\n DBIterator iterator = db.iterator(ro);\n for (iterator.seek(bb.array()); iterator.hasNext(); iterator.next()) {\n ByteBuffer bbKey = ByteBuffer.wrap(iterator.peekNext().getKey());\n bbKey.get(); // remove the address_hashindex byte.\n byte[] addressKey = new byte[20];\n bbKey.get(addressKey);\n if (!Arrays.equals(addressKey, a.getHash160())) {\n break;\n }\n byte[] hashBytes = new byte[32];\n bbKey.get(hashBytes);\n int index = bbKey.getInt();\n Sha256Hash hash = Sha256Hash.wrap(hashBytes);\n UTXO txout;\n try {\n // TODO this should be on the SNAPSHOT too......\n // this is really a BUG.\n txout = getTransactionOutput(hash, index);\n } catch (BlockStoreException e) {\n throw new UTXOProviderException(\"block store execption\", e);\n }\n if (txout != null) {\n Script sc = txout.getScript();\n Address address = sc.getToAddress(params, true);\n UTXO output = new UTXO(txout.getHash(), txout.getIndex(), txout.getValue(), txout.getHeight(),\n txout.isCoinbase(), txout.getScript(), address.toString());\n results.add(output);\n }\n }\n try {\n iterator.close();\n ro = null;\n sn.close();\n sn = null;\n } catch (IOException e) {\n log.error(\"Error closing snapshot/iterator?\", e);\n }\n }\n return results;\n }", "java.lang.String getServiceAccountIdTokens(int index);", "public static byte[] generateContractAddress(byte[] address, BigInteger nonce) {\n List<RlpType> values = new ArrayList<>();\n\n values.add(RlpString.create(address));\n values.add(RlpString.create(nonce));\n RlpList rlpList = new RlpList(values);\n\n byte[] encoded = RlpEncoder.encode(rlpList);\n byte[] hashed = Hash.sha3(encoded);\n return Arrays.copyOfRange(hashed, 12, hashed.length);\n }", "public List<BigInteger> getNonceList(AionAddress acc) {\n\n List<BigInteger> nl = Collections.synchronizedList(new ArrayList<>());\n lock.readLock().lock();\n this.getAccView(acc).getMap().entrySet().parallelStream().forEach(e -> nl.add(e.getKey()));\n lock.readLock().unlock();\n\n return nl.parallelStream().sorted().collect(Collectors.toList());\n }", "com.google.protobuf.ByteString getServiceAccountIdTokensBytes(int index);", "java.util.List<java.lang.String> getServiceAccountIdTokensList();", "public Transaction[] handleTxs(Transaction[] possibleTxs) {\n // IMPLEMENT THIS\n List<Transaction> validTxs = new ArrayList<>();\n for (Transaction tx : possibleTxs) {\n if (isValidTx(tx)) {\n validTxs.add(tx);\n ArrayList<Transaction.Output> outputs = tx.getOutputs();\n for (int idx = 0; idx < outputs.size(); idx++) {\n UTXO utxo = new UTXO(tx.getHash(), idx);\n utxoPool.addUTXO(utxo, outputs.get(idx));\n }\n }\n }\n\n return validTxs.toArray(new Transaction[0]);\n }", "public List<Address> getAllAddresses() throws BackendException;", "public static java.util.List<com.ifl.rapid.customer.model.CRM_Trn_Address> findAll()\n\t\tthrows com.liferay.portal.kernel.exception.SystemException {\n\t\treturn getPersistence().findAll();\n\t}", "@NotNull\n List<TxInternal> txsInternalByHash(@NotNull String txhash) throws EtherScanException;", "@NotNull\n List<Block> blocksMined(@NotNull String address) throws EtherScanException;", "@Override\n public List<PooledTransaction> removeTxsWithNonceLessThan(Map<AionAddress, BigInteger> accNonce) {\n\n List<ByteArrayWrapper> bwList = new ArrayList<>();\n for (Map.Entry<AionAddress, BigInteger> en1 : accNonce.entrySet()) {\n AccountState as = this.getAccView(en1.getKey());\n lock.writeLock().lock();\n Iterator<Map.Entry<BigInteger, AbstractMap.SimpleEntry<ByteArrayWrapper, BigInteger>>>\n it = as.getMap().entrySet().iterator();\n\n while (it.hasNext()) {\n Map.Entry<BigInteger, AbstractMap.SimpleEntry<ByteArrayWrapper, BigInteger>> en =\n it.next();\n if (en1.getValue().compareTo(en.getKey()) > 0) {\n bwList.add(en.getValue().getKey());\n it.remove();\n } else {\n break;\n }\n }\n lock.writeLock().unlock();\n\n Set<BigInteger> fee = Collections.synchronizedSet(new HashSet<>());\n if (this.getPoolStateView(en1.getKey()) != null) {\n this.getPoolStateView(en1.getKey())\n .parallelStream()\n .forEach(ps -> fee.add(ps.getFee()));\n }\n\n fee.parallelStream()\n .forEach(\n bi -> {\n if (this.getFeeView().get(bi) != null) {\n this.getFeeView()\n .get(bi)\n .entrySet()\n .removeIf(\n byteArrayWrapperTxDependListEntry ->\n byteArrayWrapperTxDependListEntry\n .getValue()\n .getAddress()\n .equals(en1.getKey()));\n\n if (this.getFeeView().get(bi).isEmpty()) {\n this.getFeeView().remove(bi);\n }\n }\n });\n\n as.setDirty();\n }\n\n List<PooledTransaction> removedTxl = Collections.synchronizedList(new ArrayList<>());\n bwList.parallelStream()\n .forEach(\n bw -> {\n if (this.getMainMap().get(bw) != null) {\n PooledTransaction pooledTx = this.getMainMap().get(bw).getTx();\n removedTxl.add(pooledTx);\n\n long timestamp = pooledTx.tx.getTimeStampBI().longValue() / multiplyM;\n synchronized (this.getTimeView().get(timestamp)) {\n if (this.getTimeView().get(timestamp) == null) {\n LOG.error(\n \"Txpool.remove can't find the timestamp in the map [{}]\",\n pooledTx.toString());\n return;\n }\n\n this.getTimeView().get(timestamp).remove(bw);\n if (this.getTimeView().get(timestamp).isEmpty()) {\n this.getTimeView().remove(timestamp);\n }\n }\n\n lock.writeLock().lock();\n this.getMainMap().remove(bw);\n lock.writeLock().unlock();\n }\n });\n\n this.updateAccPoolState();\n this.updateFeeMap();\n\n if (LOG.isInfoEnabled()) {\n LOG.info(\"TxPoolA0.remove {} TX\", removedTxl.size());\n }\n\n return removedTxl;\n }", "public List<Token> getAllToken() throws BusinessException;", "@NotNull\n List<Balance> balances(@NotNull List<String> addresses) throws EtherScanException;", "public Transaction[] handleTxs(Transaction[] possibleTxs) {\n ArrayList<Transaction> validTransactions = new ArrayList<>();\n for (Transaction tx : possibleTxs){\n if (isValidTx(tx)){\n validTransactions.add(tx);\n consumePoolCoins(tx);\n createPoolCoins(tx);\n }\n }\n return validTransactions.toArray(new Transaction[validTransactions.size()]);\n }", "AllUsersAddresses getAllUsersAddresses();", "public interface AccountAPI {\n\n /**\n * Address ETH balance\n * \n * @param address get balance for\n * @return balance\n * @throws EtherScanException parent exception class\n */\n @NotNull\n Balance balance(@NotNull String address) throws EtherScanException;\n\n /**\n * ERC20 token balance for address\n * \n * @param address get balance for\n * @param contract token contract\n * @return token balance for address\n * @throws EtherScanException parent exception class\n */\n @NotNull\n TokenBalance balance(@NotNull String address, @NotNull String contract) throws EtherScanException;\n\n /**\n * Maximum 20 address for single batch request If address MORE THAN 20, then there will be more than\n * 1 request performed\n * \n * @param addresses addresses to get balances for\n * @return list of balances\n * @throws EtherScanException parent exception class\n */\n @NotNull\n List<Balance> balances(@NotNull List<String> addresses) throws EtherScanException;\n\n /**\n * All txs for given address\n * \n * @param address get txs for\n * @param startBlock tx from this blockNumber\n * @param endBlock tx to this blockNumber\n * @return txs for address\n * @throws EtherScanException parent exception class\n */\n @NotNull\n List<Tx> txs(@NotNull String address, long startBlock, long endBlock) throws EtherScanException;\n\n @NotNull\n List<Tx> txs(@NotNull String address, long startBlock) throws EtherScanException;\n\n @NotNull\n List<Tx> txs(@NotNull String address) throws EtherScanException;\n\n /**\n * All internal txs for given address\n * \n * @param address get txs for\n * @param startBlock tx from this blockNumber\n * @param endBlock tx to this blockNumber\n * @return txs for address\n * @throws EtherScanException parent exception class\n */\n @NotNull\n List<TxInternal> txsInternal(@NotNull String address, long startBlock, long endBlock) throws EtherScanException;\n\n @NotNull\n List<TxInternal> txsInternal(@NotNull String address, long startBlock) throws EtherScanException;\n\n @NotNull\n List<TxInternal> txsInternal(@NotNull String address) throws EtherScanException;\n\n /**\n * All internal tx for given transaction hash\n * \n * @param txhash transaction hash\n * @return internal txs list\n * @throws EtherScanException parent exception class\n */\n @NotNull\n List<TxInternal> txsInternalByHash(@NotNull String txhash) throws EtherScanException;\n\n /**\n * All ERC-20 token txs for given address\n * \n * @param address get txs for\n * @param startBlock tx from this blockNumber\n * @param endBlock tx to this blockNumber\n * @return txs for address\n * @throws EtherScanException parent exception class\n */\n @NotNull\n List<TxErc20> txsErc20(@NotNull String address, long startBlock, long endBlock) throws EtherScanException;\n\n @NotNull\n List<TxErc20> txsErc20(@NotNull String address, long startBlock) throws EtherScanException;\n\n @NotNull\n List<TxErc20> txsErc20(@NotNull String address) throws EtherScanException;\n\n /**\n * All ERC-20 token txs for given address and contract address\n *\n * @param address get txs for\n * @param contractAddress contract address to get txs for\n * @param startBlock tx from this blockNumber\n * @param endBlock tx to this blockNumber\n * @return txs for address\n * @throws EtherScanException parent exception class\n */\n @NotNull\n List<TxErc20> txsErc20(@NotNull String address, @NotNull String contractAddress, long startBlock, long endBlock)\n throws EtherScanException;\n\n @NotNull\n List<TxErc20> txsErc20(@NotNull String address, @NotNull String contractAddress, long startBlock) throws EtherScanException;\n\n @NotNull\n List<TxErc20> txsErc20(@NotNull String address, @NotNull String contractAddress) throws EtherScanException;\n\n /**\n * All ERC-721 (NFT) token txs for given address\n *\n * @param address get txs for\n * @param startBlock tx from this blockNumber\n * @param endBlock tx to this blockNumber\n * @return txs for address\n * @throws EtherScanException parent exception class\n */\n @NotNull\n List<TxErc721> txsErc721(@NotNull String address, long startBlock, long endBlock) throws EtherScanException;\n\n @NotNull\n List<TxErc721> txsErc721(@NotNull String address, long startBlock) throws EtherScanException;\n\n @NotNull\n List<TxErc721> txsErc721(@NotNull String address) throws EtherScanException;\n\n /**\n * All ERC-721 (NFT) token txs for given address\n *\n * @param address get txs for\n * @param startBlock tx from this blockNumber\n * @param endBlock tx to this blockNumber\n * @return txs for address\n * @throws EtherScanException parent exception class\n */\n @NotNull\n List<TxErc721> txsErc721(@NotNull String address, @NotNull String contractAddress, long startBlock, long endBlock)\n throws EtherScanException;\n\n @NotNull\n List<TxErc721> txsErc721(@NotNull String address, @NotNull String contractAddress, long startBlock) throws EtherScanException;\n\n @NotNull\n List<TxErc721> txsErc721(@NotNull String address, @NotNull String contractAddress) throws EtherScanException;\n\n /**\n * All ERC-721 (NFT) token txs for given address\n *\n * @param address get txs for\n * @param startBlock tx from this blockNumber\n * @param endBlock tx to this blockNumber\n * @return txs for address\n * @throws EtherScanException parent exception class\n */\n @NotNull\n List<TxErc1155> txsErc1155(@NotNull String address, long startBlock, long endBlock) throws EtherScanException;\n\n @NotNull\n List<TxErc1155> txsErc1155(@NotNull String address, long startBlock) throws EtherScanException;\n\n @NotNull\n List<TxErc1155> txsErc1155(@NotNull String address) throws EtherScanException;\n\n /**\n * All ERC-721 (NFT) token txs for given address\n *\n * @param address get txs for\n * @param startBlock tx from this blockNumber\n * @param endBlock tx to this blockNumber\n * @return txs for address\n * @throws EtherScanException parent exception class\n */\n @NotNull\n List<TxErc1155> txsErc1155(@NotNull String address, @NotNull String contractAddress, long startBlock, long endBlock)\n throws EtherScanException;\n\n @NotNull\n List<TxErc1155> txsErc1155(@NotNull String address, @NotNull String contractAddress, long startBlock)\n throws EtherScanException;\n\n @NotNull\n List<TxErc1155> txsErc1155(@NotNull String address, @NotNull String contractAddress) throws EtherScanException;\n\n /**\n * All blocks mined by address\n * \n * @param address address to search for\n * @return blocks mined\n * @throws EtherScanException parent exception class\n */\n @NotNull\n List<Block> blocksMined(@NotNull String address) throws EtherScanException;\n}", "public Transaction[] handleTxs(Transaction[] possibleTxs) {\n // IMPLEMENT THIS\n if(possibleTxs == null)\n return new Transaction[0];\n \n ArrayList<Transaction> validTxs = new ArrayList<>();\n \n //iterate through each transaction, validate, remove spent UTXO, add new UTXO\n for(int i = 0; i < possibleTxs.length; i++){\n \n //validate tx\n if(isValidTx(possibleTxs[i])){\n possibleTxs[i].finalize();\n validTxs.add(possibleTxs[i]);\n \n //remove valid/spent UTXOs from current pool\n for(Transaction.Input x:possibleTxs[i].getInputs()){\n UTXO inputUTXO = new UTXO(x.prevTxHash, x.outputIndex);\n currentPool.removeUTXO(inputUTXO);\n }\n \n //add new UTXOs to current pool\n int utxoIndex = 0;\n for(Transaction.Output x:possibleTxs[i].getOutputs()){\n UTXO outputUTXO = new UTXO(possibleTxs[i].getHash(), utxoIndex);\n currentPool.addUTXO(outputUTXO, x);\n utxoIndex++;\n }\n \n }\n }\n \n //return list of validated \n Transaction[] validatedTxs = new Transaction[validTxs.size()];\n \n validatedTxs = validTxs.toArray(validatedTxs);\n \n return validatedTxs;\n }", "@Override\r\n\tpublic ArrayList<Rents> readRents(String address) {\n\t\treturn null;\r\n\t}", "private void printAll() {\n\n String infuraAddress = \"70ddb1f89ca9421885b6268e847a459d\";\n dappSmartcontractAddress = \"0x07d55a62b487d61a0b47c2937016f68e4bcec0e9\";\n smartContractGetfunctionAddress = \"0x7355a424\";\n\n CoinNetworkInfo coinNetworkInfo = new CoinNetworkInfo(\n CoinType.ETH,\n EthereumNetworkType.ROPSTEN,\n \"https://ropsten.infura.io/v3/\"+infuraAddress\n );\n\n List<Account> accountList = sBlockchain.getAccountManager()\n .getAccounts(hardwareWallet.getWalletId(), CoinType.ETH, EthereumNetworkType.ROPSTEN);\n\n ethereumService = (EthereumService) CoinServiceFactory.getCoinService(this, coinNetworkInfo);\n\n\n ethereumService.callSmartContractFunction(\n (EthereumAccount) accountList.get(0),\n dappSmartcontractAddress,\n smartContractGetfunctionAddress\n ).setCallback(new ListenableFutureTask.Callback<String>() {\n @Override\n public void onSuccess(String result) { //return hex string\n Log.d(\"SUCCESS TAG\", \"transaction data : \"+result);\n\n getPost(result, accountList);\n\n\n }\n\n @Override\n public void onFailure(@NotNull ExecutionException e) {\n Log.d(\"ERROR TAG #101\",e.toString());\n }\n\n @Override\n public void onCancelled(@NotNull InterruptedException e) {\n Log.d(\"ERROR TAG #102\",e.toString());\n }\n });\n\n\n }", "@NotNull\n TokenBalance balance(@NotNull String address, @NotNull String contract) throws EtherScanException;", "private boolean getAddresses(){\n try {\n URLtoJSON URLtoJSON = new URLtoJSON();\n JSONObject json = URLtoJSON.open(this.URL+\"merchant/\"+this.GUID+\"/list?password=\"+this.pswd()+\"&api_code=\"+this.ApiCode);\n \n if(!json.isNull(\"error\")) return false; //If there is no transactions return false;\n JSONArray nameArray = json.names();\n JSONArray TotalArray = json.toJSONArray(nameArray);\n JSONArray JAddresses = TotalArray.getJSONArray(0);\n \n for(int i = 0; i < JAddresses.length(); i++){\n String O=\"false\";\n String S=\"false\";\n String N=\"false\";\n String[] Label=JAddresses.getJSONObject(i).getString(\"label\").split(\"_\",-1);\n if(Label.length==3){\n O=Label[1];\n S=Label[0];\n N=Label[2];\n }\n String[] Matched=this.matchDB(JAddresses.getJSONObject(i).getString(\"address\"));\n String[] Details= new String[]{\n \"S: \"+S, //0 Transaction ID\n Matched[0], //1 Sender\n Float.toString(JAddresses.getJSONObject(i).getLong(\"total_received\")/100000000)+\" (BTC)\",//2 Amount in btc\n O, //3 Choosen option\n \"btc\", //4 Currency\n \"O: \"+Matched[2], //5 Date\n Matched[1] //6 Senders nem or false \n };\n if(!this.list.contains(Details)){\n this.list.add(Details);\n if(!\"false\".equals(O) && !O.equals(\"\")){\n this.setAmountsAndEntries(Integer.parseInt(O), JAddresses.getJSONObject(i).getLong(\"total_received\"), Details[6]); //add the amount and rise the entries\n }\n }\n }\n return true;\n } catch (JSONException | NumberFormatException e) {\n e.printStackTrace();\n }\n return false;\n }", "private List<Messages.Address> mapModelAddressToWireAddress(List<byte[]> addresses) {\n return addresses.stream().map(address -> Messages.Address.newBuilder()\n .setPort(6565)\n .setIpAddress(ByteString.copyFrom(address))\n .build())\n .collect(Collectors.toList());\n }", "private String parseAddresses(Address[] address) {\n String listAddress = \"\";\n\n if (address != null) {\n for (int i = 0; i < address.length; i++) {\n listAddress += address[i].toString() + \", \";\n }\n }\n if (listAddress.length() > 1) {\n listAddress = listAddress.substring(0, listAddress.length() - 2);\n }\n\n return listAddress;\n }", "public String[] createNewAddress(){\r\n byte[][] pairs=ECDSAgeneratePublicAndPrivateKey();\r\n byte[] afterhashing=RIPEMD160(SHA256hash(pairs[1]));\r\n byte[] checksum=getCheckSum(SHA256hash(SHA256hash(afterhashing)));\r\n byte[] bitcoinaddress=concateByteArray(afterhashing,checksum);\r\n return new String[]{toHex(pairs[0]), convertPrivateKeytoWIF(pairs[0]), base58encode(bitcoinaddress)};\r\n }", "Collection lookupTransactions(String email);", "public com.zenithbank.mtn.fleet.Transaction[] getCardTrans(boolean includeOpeningBalance) throws java.rmi.RemoteException;", "Collection lookupTransactions(String email, String reason);", "public TradeHistoryReq address(String address) {\n this.address = address;\n return this;\n }", "java.util.List<kr.pik.message.Profile.ProfileMessage.ContactAddress> \n getContactAddressList();", "io.envoyproxy.envoy.data.dns.v3.DnsTable.AddressList getAddressList();", "private void requestAddresses(byte nAddr) throws Exception {\n final HashSet<Inet4Address> addrs = new HashSet<>();\n byte[] hwAddrBytes = new byte[] { 8, 4, 3, 2, 1, 0 };\n for (byte i = 0; i < nAddr; i++) {\n hwAddrBytes[5] = i;\n MacAddress newMac = MacAddress.fromBytes(hwAddrBytes);\n final String hostname = \"host_\" + i;\n final DhcpLease lease = mRepo.getOffer(CLIENTID_UNSPEC, newMac,\n IPV4_ADDR_ANY /* relayAddr */, INETADDR_UNSPEC /* reqAddr */, hostname);\n\n assertNotNull(lease);\n assertEquals(newMac, lease.getHwAddr());\n assertEquals(hostname, lease.getHostname());\n assertTrue(format(\"Duplicate address allocated: %s in %s\", lease.getNetAddr(), addrs),\n addrs.add(lease.getNetAddr()));\n\n requestLeaseSelecting(newMac, lease.getNetAddr(), hostname);\n }\n }", "private List<DriverAddress> generateAddresses(Driver driver, int amount){\n\t\tList<DriverAddress> addresses = new ArrayList<DriverAddress>();\n\t\tfor(int i=0; i < amount; i++){ \t\t\n\t\t\taddresses.add(new DriverAddress());\n\t\t\taddresses.get(i).setBusinessInd(\"N\");\n\t\t\taddresses.get(i).setAddressLine1(i + \" Driver Service Test\");\n\t\t\taddresses.get(i).setPostcode(\"45241\");\n\t\t\taddresses.get(i).setGeoCode(\"0800\");\t\t\n\t\t\taddresses.get(i).setAddressType(driverService.getDriverAddressTypeCodes().get(0));\n\t\t\taddresses.get(i).setDriver(driver);\n\t\t}\n\t\treturn addresses;\n\t}", "@GetMapping(value = \"/payments/{accountNumber}\")\n\tpublic List<PaymentDTO> getAccountTransactions(@PathVariable(\"accountNumber\") final String accountNumber) {\n\t\treturn this.paymentsService.getAccountTransactions(accountNumber);\n\t}", "public static List<Address> GetAllRecordsFromTable() {\n\n return SQLite.select().from(Address.class).queryList();\n\n\n }", "public abstract List<String> associateAddresses(NodeMetadata node);", "List<?> getAddress();", "public void listAll(List<Address> AddressList) {\n for (Address a : AddressList) {\n console.promptForPrintPrompt(a.toString());\n }\n }", "public List<PeerAddress> all() {\n final List<PeerAddress> all = new ArrayList<PeerAddress>();\n for (final Map<Number160, PeerStatistic> map : peerMapVerified) {\n synchronized (map) {\n for (PeerStatistic peerStatistic : map.values()) {\n all.add(peerStatistic.peerAddress());\n }\n }\n }\n return all;\n }", "public Transaction[] getTransactionsList() throws Exception;", "public AddressList listAllAddresses(String addressBook)\n\t{\n\t\treturn controller.listAllAddresses(addressBook);\n\t}", "public Call<ExpResult<List<DelegationInfo>>> getDelegations(MinterAddress address) {\n checkNotNull(address, \"Address can't be null\");\n\n return getInstantService().getDelegationsForAddress(address.toString(), 1);\n }", "public void testLongStreetAddress() throws InterruptedException {\n Customer customer = CustomerService.getInstance().getCustomerById(new Integer(5276));\r\n ir.printInvoice(custInv, customer);\r\n }", "@Test\n public void SameTokenNameOpenInvalidAddress() {\n dbManager.getDynamicPropertiesStore().saveAllowSameTokenName(1);\n InitExchangeSameTokenNameActive();\n long exchangeId = 1;\n String firstTokenId = \"123\";\n long firstTokenQuant = 100000000L;\n String secondTokenId = \"456\";\n long secondTokenQuant = 200000000L;\n\n byte[] ownerAddress = ByteArray.fromHexString(OWNER_ADDRESS_FIRST);\n AccountCapsule accountCapsule = dbManager.getAccountStore().get(ownerAddress);\n Map<String, Long> assetV2Map = accountCapsule.getAssetMapV2();\n Assert.assertEquals(10000_000000L, accountCapsule.getBalance());\n Assert.assertEquals(null, assetV2Map.get(firstTokenId));\n Assert.assertEquals(null, assetV2Map.get(secondTokenId));\n\n ExchangeWithdrawActuator actuator = new ExchangeWithdrawActuator(getContract(\n OWNER_ADDRESS_INVALID, exchangeId, firstTokenId, firstTokenQuant),\n dbManager);\n TransactionResultCapsule ret = new TransactionResultCapsule();\n\n try {\n actuator.validate();\n actuator.execute(ret);\n fail(\"Invalid address\");\n } catch (ContractValidateException e) {\n Assert.assertTrue(e instanceof ContractValidateException);\n Assert.assertEquals(\"Invalid address\", e.getMessage());\n } catch (ContractExeException e) {\n Assert.assertFalse(e instanceof ContractExeException);\n } finally {\n dbManager.getExchangeStore().delete(ByteArray.fromLong(1L));\n dbManager.getExchangeStore().delete(ByteArray.fromLong(2L));\n dbManager.getExchangeV2Store().delete(ByteArray.fromLong(1L));\n dbManager.getExchangeV2Store().delete(ByteArray.fromLong(2L));\n }\n }", "@Override\n\tpublic List<CashTransactionDtl> getCashTransactionDtlByAccount(\n\t\t\tMap<String, Object> params) throws ServiceException {\n\t\treturn cashTransactionDtlMapper.queryCashTransactionRecord(params);\n\t}", "java.util.List<com.google.protobuf.ByteString> getTransactionsList();", "public ArrayList<String> getAllTokens() {\n ArrayList<String> returnlist = new ArrayList<String>();\n // Select All Query\n String selectQuery = \"SELECT Token FROM \" + TABLE_NAME;\n\n SQLiteDatabase db = this.getWritableDatabase();\n Cursor cursor = db.rawQuery(selectQuery, null);\n\n // looping through all rows and adding to list\n if (cursor.moveToFirst()) {\n do {\n ArrayList<String> data = new ArrayList<String>();\n for (int i =0; i<cursor.getColumnCount(); i++){\n data.add(cursor.getString(i));\n }\n // Adding contact to list\n returnlist.add(data.get(0));\n } while (cursor.moveToNext());\n }\n\n // return contact list\n cursor.close();\n db.close();\n return returnlist;\n }", "public ArrayList<RouteTableEntry> getFIBExcludingLL3PAddress(Integer LL3PAddress) {\n \tIterator<RouteTableEntry> tableIterator=table.iterator();\n \tArrayList<RouteTableEntry> treatedForwaedingList= new ArrayList<RouteTableEntry>();\n\t\tRouteTableEntry tmp=null;\n\t\t//boolean found=false;\n\t\ttry{\n\t\twhile(tableIterator.hasNext()){\n\t\t\ttmp=tableIterator.next();\n\t\t\tInteger tmpLL3=tmp.getSourceLL3P();\n\t\t\tif(!(tmpLL3.equals(LL3PAddress))){\n\t\t\t\t\tInteger tmpNetworkNumber = tmp.getNetworkDistancePair().getNetworkNumber();\n\t\t\t\t\t//String hen=Integer.toHexString(LL3PAddress);\n\t\t\t\t Integer tmpLL3pNetworkNumber = Utilities.getNetworkNumber(Integer.toHexString(LL3PAddress));\n\t\t\t\t\tif (!(tmpNetworkNumber.equals(tmpLL3pNetworkNumber))){\n\t\t\t\t\t\ttreatedForwaedingList.add(tmp);\n\t\t\t }\n\t \t\t}\n\t\t}\n\t\t}\n\t\tcatch(Exception e){\n\t\t\t\n\t\t}\n\t\treturn treatedForwaedingList;\n }", "EmailAddress fetchEmailAddress(AccessToken token);", "public static String[] generateEPRs(SocketAcceptor acceptor, String serviceName, String ip) {\n //Get all the addresses associated with the acceptor\n Map<SessionID, SocketAddress> socketAddresses = acceptor.getAcceptorAddresses();\n //Get all the sessions (SessionIDs) associated with the acceptor\n ArrayList<SessionID> sessions = acceptor.getSessions();\n String[] EPRList = new String[sessions.size()];\n\n //Generate an EPR for each session/socket address\n for (int i = 0; i < sessions.size(); i++) {\n SessionID sessionID = sessions.get(i);\n InetSocketAddress socketAddress = (InetSocketAddress) socketAddresses.get(sessionID);\n EPRList[i] = FIXConstants.FIX_PREFIX + ip + \":\" + socketAddress.getPort() +\n \"?\" + FIXConstants.BEGIN_STRING + \"=\" + sessionID.getBeginString() +\n \"&\" + FIXConstants.SENDER_COMP_ID + \"=\" + sessionID.getTargetCompID() +\n \"&\" + FIXConstants.TARGET_COMP_ID + \"=\" + sessionID.getSenderCompID();\n\n String sessionQualifier = sessionID.getSessionQualifier();\n if (sessionQualifier != null && !sessionQualifier.equals(\"\")) {\n EPRList[i] += \"&\" + FIXConstants.SESSION_QUALIFIER + \"=\" + sessionQualifier;\n }\n\n String senderSubID = sessionID.getSenderSubID();\n if (senderSubID != null && !senderSubID.equals(\"\")) {\n EPRList[i] += \"&\" + FIXConstants.SENDER_SUB_ID + \"=\" + senderSubID;\n }\n\n String targetSubID = sessionID.getTargetSubID();\n if (targetSubID != null && !targetSubID.equals(\"\")) {\n EPRList[i] += \"&\" + FIXConstants.TARGET_SUB_ID + \"=\" + targetSubID;\n }\n\n String senderLocationID = sessionID.getSenderLocationID();\n if (senderLocationID != null && !senderLocationID.equals(\"\")) {\n EPRList[i] += \"&\" + FIXConstants.SENDER_LOCATION_ID + \"=\" + senderLocationID;\n }\n\n String targetLocationID = sessionID.getTargetLocationID();\n if (targetLocationID != null && !targetLocationID.equals(\"\")) {\n EPRList[i] += \"&\" + FIXConstants.TARGET_LOCATION_ID + \"=\" + targetLocationID;\n }\n\n EPRList[i] += \"&Service=\" + serviceName;\n }\n return EPRList;\n }", "public List<AddressEntity> getAllAddress(CustomerEntity customerEntity) {\n\n //Creating List of AddressEntities.\n List<AddressEntity> addressEntities = new LinkedList<>();\n\n //Calls Method of customerAddressDao,getAllCustomerAddressByCustomer and returns AddressList.\n List<CustomerAddressEntity> customerAddressEntities = customerAddressDao.getAllCustomerAddressByCustomer(customerEntity);\n if (customerAddressEntities != null) { //Checking if CustomerAddressEntity is null else extracting address and adding to the addressEntites list.\n customerAddressEntities.forEach(customerAddressEntity -> {\n addressEntities.add(customerAddressEntity.getAddress());\n });\n }\n\n return addressEntities;\n\n }", "ListenableFuture<String> attestFor(\n List<DiagnosisKey> keys,\n List<String> regions,\n String verificationCode,\n int transmissionRisk) {\n Log.i(TAG, \"Getting SafetyNet attestation.\");\n String cleartext = cleartextFor(keys, regions, verificationCode, transmissionRisk);\n String nonce = BASE64.encode(sha256(cleartext));\n return safetyNetAttestationFor(nonce);\n }", "@Override\n\tpublic List<Address> FindAllAddress() {\n\t\treturn ab.FindAll();\n\t}", "public void setAddresses(List<Address> addresses) {\r\n\r\n this.addresses = addresses;\r\n\r\n }", "public static List<MemoryBlock> getAllMemoryAddresses() {\n\n List<MemoryBlock> addresses = new ArrayList<MemoryBlock>();\n\n for (int i = 0; i <= EEPROM_MAX_ADDRESS; i++) {\n addresses.add(new MemoryBlock(Utils.intToHexString(i), \"\"));\n }\n return addresses;\n }", "private static String getUnsuccessfulAddresses(\n final List<Pair<RelocatedAddress, Integer>> addresses) {\n return getAddressString(addresses, new ICollectionFilter<Pair<RelocatedAddress, Integer>>() {\n @Override\n public boolean qualifies(final Pair<RelocatedAddress, Integer> item) {\n return item.second() != 0;\n }\n });\n }", "public List<Address> getAllAddressesByName(String user_name) {\n\t\tList<Address> address = new ArrayList<>();\r\n\t\taddressdao.findByUserUsername(user_name)\r\n\t\t.forEach(address::add);\r\n\t\treturn address;\r\n\t}", "public List<Address> findAll();", "@Override\n\t\tpublic List<AccountTransaction> findAll() {\n\t\t\treturn null;\n\t\t}", "List<Account> findAccountByAddressStartingWith(String pattern);", "public boolean containsAddress(String address) {\n\t\treturn tseqnums.containsKey(address);\n\t}", "@Test\n public void SameTokenNameCloseInvalidAddress() {\n dbManager.getDynamicPropertiesStore().saveAllowSameTokenName(0);\n InitExchangeBeforeSameTokenNameActive();\n long exchangeId = 1;\n String firstTokenId = \"abc\";\n long firstTokenQuant = 100000000L;\n String secondTokenId = \"def\";\n long secondTokenQuant = 200000000L;\n\n byte[] ownerAddress = ByteArray.fromHexString(OWNER_ADDRESS_FIRST);\n AccountCapsule accountCapsule = dbManager.getAccountStore().get(ownerAddress);\n Map<String, Long> assetMap = accountCapsule.getAssetMap();\n Assert.assertEquals(10000_000000L, accountCapsule.getBalance());\n Assert.assertEquals(null, assetMap.get(firstTokenId));\n Assert.assertEquals(null, assetMap.get(secondTokenId));\n\n ExchangeWithdrawActuator actuator = new ExchangeWithdrawActuator(getContract(\n OWNER_ADDRESS_INVALID, exchangeId, firstTokenId, firstTokenQuant),\n dbManager);\n TransactionResultCapsule ret = new TransactionResultCapsule();\n\n try {\n actuator.validate();\n actuator.execute(ret);\n fail(\"Invalid address\");\n } catch (ContractValidateException e) {\n Assert.assertTrue(e instanceof ContractValidateException);\n Assert.assertEquals(\"Invalid address\", e.getMessage());\n } catch (ContractExeException e) {\n Assert.assertFalse(e instanceof ContractExeException);\n } finally {\n dbManager.getExchangeStore().delete(ByteArray.fromLong(1L));\n dbManager.getExchangeStore().delete(ByteArray.fromLong(2L));\n dbManager.getExchangeV2Store().delete(ByteArray.fromLong(1L));\n dbManager.getExchangeV2Store().delete(ByteArray.fromLong(2L));\n }\n }", "public static com.networknt.taiji.token.TokenTransactions.Builder newBuilder() {\n return new com.networknt.taiji.token.TokenTransactions.Builder();\n }", "@Override\r\n\tpublic List<UserAddress> viewUserAddressList() {\r\n\t\tList<UserAddress> result = new ArrayList<UserAddress>();\r\n useraddressrepository.findAll().forEach(UserAddress1 -> result.add(UserAddress1));\r\n return result;\r\n\t}", "public ArrayList<Account> GetCustomerAccounts(String ssn)\n {\n ArrayList<Account> result = new ArrayList<>();\n\n for (Account account : accounts)\n {\n if (account.getSsn().equals(ssn))\n {\n result.add(account);\n }\n }\n\n return result;\n }", "com.google.protobuf.ByteString getTransactions(int index);", "List<Trade> getAllTrades() throws OrderBookTradeException ;", "public void setAddresses(List<String> addresses) {\n this.addresses = addresses;\n }", "@Override\r\n\tpublic ArrayList<UserClass> readUsers(String address) {\n\t\treturn null;\r\n\t}", "public static Address getTroveFromAddress()\n {\n Address rval = new Address();\n\n rval.setFirstName(\"Trove, Inc.\");\n rval.setAddressLine1(\"20 Exchange Place\");\n rval.setAddressLine2(\"Apt 1604\");\n rval.setCity(\"New York\");\n Subdivision subdivision = new Subdivision();\n subdivision.setCode(\"US-NY\");\n\n rval.setSubdivision(subdivision);\n rval.setPostalCode(\"10005\");\n rval.setPhone(\"3108096011\");\n\n return rval;\n }", "public List<String> findActiveCongestionPointAddresses(LocalDate period) {\n return congestionPointConnectionGroupRepository.findActiveCongestionPointConnectionGroup(period).stream()\n .map(ConnectionGroup::getUsefIdentifier).collect(Collectors.toList());\n }", "public IndividualAddress(final int address)\n\t{\n\t\tsuper(address);\n\t}", "public List getAddressList() {\r\n System.out.println(\"List Elements :\" + addressList);\r\n return addressList;\r\n }", "public List<Email> getUnregisteredEmailList(Ram ram);", "private static SendGridRequest.EmailAddress [] getPersonalizationAddresses(String addresses) {\n if (addresses != null) {\n return Arrays.stream(addresses.split(\";\"))\n .map(String::trim)\n .map(address -> {\n SendGridRequest.EmailAddress emailAddress = new SendGridRequest.EmailAddress();\n emailAddress.setEmail(address);\n return emailAddress;\n })\n .toArray(SendGridRequest.EmailAddress []::new);\n } else {\n return null;\n }\n }", "public static Tax[] getTaxes() {\n Tax[] taxes = new Tax[DeclarationFiller.getDeclaration().size()];\n int count = 0;\n if (taxes != null ) {\n for (Map.Entry<String, Integer> incomePoint : DeclarationFiller.getDeclaration().entrySet()) {\n String taxName = \"Tax of \" + incomePoint.getKey();\n int incomValue = incomePoint.getValue();\n taxes[count] = new Tax(count+1001 ,taxName, incomValue, 0.18);\n count++;\n }\n }\n return taxes;\n }", "public IndividualAddress(final byte[] address)\n\t{\n\t\tsuper(address);\n\t}", "public List<com.generator.tables.pojos.CreditChain> fetchByAddress(String... values) {\n return fetch(CreditChain.CREDIT_CHAIN.ADDRESS, values);\n }", "public static byte[] makeNonce(String senderAddress, String receiverIdentifier, Timestamp timestamp, byte[] otherData) {\n if (!ValidationTools.isAddress(senderAddress)) {\n throw ExceptionUtil.throwException(logger, new IllegalArgumentException(\"Address is not valid\"));\n }\n ByteBuffer buffer = ByteBuffer.allocate(otherDataIndexStart + otherData.length);\n // Hash to ensure all variable length components is encoded with constant length\n buffer.put(senderAddress.toUpperCase().getBytes(StandardCharsets.UTF_8));\n buffer.put(AttestationCrypto.hashWithKeccak(receiverIdentifier.getBytes(StandardCharsets.UTF_8)));\n buffer.put(longToBytes(timestamp.getTime()));\n buffer.put(otherData);\n return buffer.array();\n }", "@CrossOrigin\n @RequestMapping(path=\"/address/customer\",method = RequestMethod.GET, produces = MediaType.APPLICATION_JSON_UTF8_VALUE)\n public ResponseEntity<AddressListResponse> getAllAddress(@RequestHeader(\"authorization\") final String authorization) throws AuthorizationFailedException {\n\n String[] splitStrings = authorization.split(\" \");\n String accessToken = splitStrings[1];\n\n CustomerEntity loggedCustomer = customerService.getCustomer(accessToken);\n List<AddressEntity> addressEntityList = addressService.getAllAddress(loggedCustomer);\n\n AddressListResponse addressListResponse = new AddressListResponse();\n if(addressEntityList==null){\n addressListResponse = null;\n return new ResponseEntity<>(addressListResponse, HttpStatus.OK);\n }\n\n List<AddressList> addressLists = new ArrayList<>();\n\n for (AddressEntity addressEntity : addressEntityList) {\n AddressList adr = new AddressList();\n adr.setId(UUID.fromString(addressEntity.getUuid()));\n adr.setFlatBuildingName(addressEntity.getFlatBuilNo());\n adr.setLocality(addressEntity.getLocality());\n adr.setCity(addressEntity.getCity());\n adr.setPincode(addressEntity.getPincode());\n\n AddressListState statesList = new AddressListState();\n String stateUuid = addressEntity.getState().getUuid();\n statesList.setId(UUID.fromString(stateUuid));\n statesList.setStateName(addressEntity.getState().getStateName());\n adr.setState(statesList);\n addressLists.add(adr);\n }\n\n return new ResponseEntity<>(addressListResponse.addresses(addressLists), HttpStatus.OK);\n\n }", "default List<PendingAttestation> get_matching_head_attestations(BeaconState state, EpochNumber epoch) {\n return get_matching_source_attestations(state, epoch).stream()\n .filter(a -> a.getData().getBeaconBlockRoot().equals(\n get_block_root_at_slot(state, get_attestation_slot(state, a.getData()))))\n .collect(toList());\n }", "void generateSameTX(String name, List<String> types, Settings settings);", "public Vector<NetworkAddress> getHostAddresses(int type) {return addressesChecker.getAllMyAddresses(type); }", "public static List<BangkingTransaction> findByAccountNumber(Long acc) {\n\t\treturn Ebean.find(BangkingTransaction.class).select(\"transaction_id\").where().eq(\"senderAccount.accountNumber\", acc).findList();\r\n\t\t\r\n\t}", "@Override\n public List<CryptoAddressRequest> listAllPendingRequests() throws CantListPendingCryptoAddressRequestsException {\n try {\n\n return cryptoAddressesNetworkServiceDao.listAllPendingRequests();\n\n } catch (CantListPendingCryptoAddressRequestsException e){\n\n errorManager.reportUnexpectedPluginException(this.getPluginVersionReference(), UnexpectedPluginExceptionSeverity.DISABLES_SOME_FUNCTIONALITY_WITHIN_THIS_PLUGIN, e);\n throw e;\n } catch (Exception e){\n\n errorManager.reportUnexpectedPluginException(this.getPluginVersionReference(), UnexpectedPluginExceptionSeverity.DISABLES_SOME_FUNCTIONALITY_WITHIN_THIS_PLUGIN, e);\n throw new CantListPendingCryptoAddressRequestsException(FermatException.wrapException(e), null, \"Unhandled Exception.\");\n }\n }", "@Override\n public List<CryptoAddressRequest> listPendingCryptoAddressRequests() throws CantListPendingCryptoAddressRequestsException {\n try {\n\n return cryptoAddressesNetworkServiceDao.listPendingRequestsByProtocolStateAndAction(ProtocolState.PENDING_ACTION, RequestAction.REQUEST);\n\n } catch (CantListPendingCryptoAddressRequestsException e){\n\n errorManager.reportUnexpectedPluginException(this.getPluginVersionReference(), UnexpectedPluginExceptionSeverity.DISABLES_SOME_FUNCTIONALITY_WITHIN_THIS_PLUGIN, e);\n throw e;\n } catch (Exception e){\n\n errorManager.reportUnexpectedPluginException(this.getPluginVersionReference(), UnexpectedPluginExceptionSeverity.DISABLES_SOME_FUNCTIONALITY_WITHIN_THIS_PLUGIN, e);\n throw new CantListPendingCryptoAddressRequestsException(FermatException.wrapException(e), null, \"Unhandled Exception.\");\n }\n }", "public SendWalletThread(String[] address,Wallet wallet) {\r\n\t\tthis.WALLET = wallet;\r\n\t\tADDRESS= address;\r\n\t}", "static void printAccountBalance(String address){\n }", "private Account createAccount(byte[] address) {\n return new Account(address);\n }", "private List<Tenant> getTenantsByKeyChangeXml(Document document) throws KeyChangeException {\n List<Tenant> tenantList = new ArrayList<Tenant>();\n List<TenantData> tenantDataList;\n tenantDataList = KeyChangeDataUtils.getKeyChangeTenantDataByXML(document).getTenantDataList();\n TenantManager tenantManager = ServiceHolder.getRealmService().getTenantManager();\n // Iterate through tenants\n for (TenantData tenantData : tenantDataList) {\n String tenantDomain = null;\n try {\n tenantDomain = tenantData.getTenantDomain();\n int tenantId = ServiceHolder.getRealmService().getTenantManager().getTenantId(tenantDomain);\n if (tenantId != MultitenantConstants.INVALID_TENANT_ID) {\n Tenant tenant = tenantManager.getTenant(tenantId);\n tenantList.add(tenant);\n } else {\n log.error(\"Invalid tenant domain '\" + tenantDomain + \"'\");\n // If the specific tenant domain is invalid continuing the flow for the rest of the tenants.\n }\n } catch (UserStoreException e) {\n throw new KeyChangeException(\"User store exception while getting the tenant ID for tenant \" +\n tenantDomain, e);\n }\n }\n return tenantList;\n }", "int getServiceAccountIdTokensCount();", "public abstract String generateTokens(int targetNumber);", "com.google.protobuf.ByteString\n\t\t\tgetAddressBytes();" ]
[ "0.7342023", "0.7152389", "0.6795158", "0.6424524", "0.63005066", "0.6086244", "0.58309996", "0.5304834", "0.52032167", "0.5147329", "0.50936204", "0.5074344", "0.48291612", "0.47886845", "0.4773262", "0.47700232", "0.4761369", "0.4751397", "0.47383618", "0.47155795", "0.47125039", "0.4703851", "0.4590081", "0.4544326", "0.45295796", "0.45214093", "0.4511265", "0.4477108", "0.44641897", "0.4441554", "0.44328305", "0.44085228", "0.44039574", "0.43883473", "0.43836153", "0.4339882", "0.43335542", "0.4331053", "0.43227285", "0.43112764", "0.42869088", "0.42759362", "0.42689466", "0.42587712", "0.42506206", "0.4246708", "0.42443508", "0.4219319", "0.42117172", "0.4205554", "0.4185273", "0.41823927", "0.41752073", "0.41748732", "0.41649958", "0.4150085", "0.41474143", "0.41284662", "0.4127189", "0.41163245", "0.41147467", "0.41141346", "0.41127464", "0.41112489", "0.41035596", "0.41016114", "0.4093911", "0.40925193", "0.40924677", "0.40849283", "0.4074132", "0.40706718", "0.40672132", "0.40604988", "0.4059227", "0.40548947", "0.40470442", "0.40334833", "0.40252516", "0.4022804", "0.40178254", "0.40107468", "0.4008683", "0.40068212", "0.40065545", "0.39904454", "0.39878196", "0.39824048", "0.39791095", "0.39787695", "0.39786765", "0.39785233", "0.39670596", "0.3958508", "0.3956425", "0.3956203", "0.39561343", "0.39524284", "0.39518237", "0.39517716" ]
0.6524173
3
All ERC721 (NFT) token txs for given address
@NotNull List<TxErc1155> txsErc1155(@NotNull String address, @NotNull String contractAddress, long startBlock, long endBlock) throws EtherScanException;
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@NotNull\n List<TxErc721> txsErc721(@NotNull String address, long startBlock, long endBlock) throws EtherScanException;", "@NotNull\n List<TxErc721> txsErc721(@NotNull String address, @NotNull String contractAddress, long startBlock, long endBlock)\n throws EtherScanException;", "@NotNull\n List<Tx> txs(@NotNull String address, long startBlock, long endBlock) throws EtherScanException;", "@NotNull\n List<TxErc1155> txsErc1155(@NotNull String address, long startBlock, long endBlock) throws EtherScanException;", "@NotNull\n List<TxInternal> txsInternal(@NotNull String address, long startBlock, long endBlock) throws EtherScanException;", "@NotNull\n List<TxErc20> txsErc20(@NotNull String address, long startBlock, long endBlock) throws EtherScanException;", "@NotNull\n List<TxErc20> txsErc20(@NotNull String address, @NotNull String contractAddress, long startBlock, long endBlock)\n throws EtherScanException;", "@Override\n public List<UTXO> getOpenTransactionOutputs(List<Address> addresses) throws UTXOProviderException {\n\n List<UTXO> results = new LinkedList<UTXO>();\n for (Address a : addresses) {\n ByteBuffer bb = ByteBuffer.allocate(21);\n bb.put((byte) KeyType.ADDRESS_HASHINDEX.ordinal());\n bb.put(a.getHash160());\n\n ReadOptions ro = new ReadOptions();\n Snapshot sn = db.getSnapshot();\n ro.snapshot(sn);\n\n // Scanning over iterator very fast\n\n DBIterator iterator = db.iterator(ro);\n for (iterator.seek(bb.array()); iterator.hasNext(); iterator.next()) {\n ByteBuffer bbKey = ByteBuffer.wrap(iterator.peekNext().getKey());\n bbKey.get(); // remove the address_hashindex byte.\n byte[] addressKey = new byte[20];\n bbKey.get(addressKey);\n if (!Arrays.equals(addressKey, a.getHash160())) {\n break;\n }\n byte[] hashBytes = new byte[32];\n bbKey.get(hashBytes);\n int index = bbKey.getInt();\n Sha256Hash hash = Sha256Hash.wrap(hashBytes);\n UTXO txout;\n try {\n // TODO this should be on the SNAPSHOT too......\n // this is really a BUG.\n txout = getTransactionOutput(hash, index);\n } catch (BlockStoreException e) {\n throw new UTXOProviderException(\"block store execption\", e);\n }\n if (txout != null) {\n Script sc = txout.getScript();\n Address address = sc.getToAddress(params, true);\n UTXO output = new UTXO(txout.getHash(), txout.getIndex(), txout.getValue(), txout.getHeight(),\n txout.isCoinbase(), txout.getScript(), address.toString());\n results.add(output);\n }\n }\n try {\n iterator.close();\n ro = null;\n sn.close();\n sn = null;\n } catch (IOException e) {\n log.error(\"Error closing snapshot/iterator?\", e);\n }\n }\n return results;\n }", "java.lang.String getServiceAccountIdTokens(int index);", "public static byte[] generateContractAddress(byte[] address, BigInteger nonce) {\n List<RlpType> values = new ArrayList<>();\n\n values.add(RlpString.create(address));\n values.add(RlpString.create(nonce));\n RlpList rlpList = new RlpList(values);\n\n byte[] encoded = RlpEncoder.encode(rlpList);\n byte[] hashed = Hash.sha3(encoded);\n return Arrays.copyOfRange(hashed, 12, hashed.length);\n }", "public List<BigInteger> getNonceList(AionAddress acc) {\n\n List<BigInteger> nl = Collections.synchronizedList(new ArrayList<>());\n lock.readLock().lock();\n this.getAccView(acc).getMap().entrySet().parallelStream().forEach(e -> nl.add(e.getKey()));\n lock.readLock().unlock();\n\n return nl.parallelStream().sorted().collect(Collectors.toList());\n }", "com.google.protobuf.ByteString getServiceAccountIdTokensBytes(int index);", "java.util.List<java.lang.String> getServiceAccountIdTokensList();", "public Transaction[] handleTxs(Transaction[] possibleTxs) {\n // IMPLEMENT THIS\n List<Transaction> validTxs = new ArrayList<>();\n for (Transaction tx : possibleTxs) {\n if (isValidTx(tx)) {\n validTxs.add(tx);\n ArrayList<Transaction.Output> outputs = tx.getOutputs();\n for (int idx = 0; idx < outputs.size(); idx++) {\n UTXO utxo = new UTXO(tx.getHash(), idx);\n utxoPool.addUTXO(utxo, outputs.get(idx));\n }\n }\n }\n\n return validTxs.toArray(new Transaction[0]);\n }", "public List<Address> getAllAddresses() throws BackendException;", "public static java.util.List<com.ifl.rapid.customer.model.CRM_Trn_Address> findAll()\n\t\tthrows com.liferay.portal.kernel.exception.SystemException {\n\t\treturn getPersistence().findAll();\n\t}", "@NotNull\n List<TxInternal> txsInternalByHash(@NotNull String txhash) throws EtherScanException;", "@NotNull\n List<Block> blocksMined(@NotNull String address) throws EtherScanException;", "@Override\n public List<PooledTransaction> removeTxsWithNonceLessThan(Map<AionAddress, BigInteger> accNonce) {\n\n List<ByteArrayWrapper> bwList = new ArrayList<>();\n for (Map.Entry<AionAddress, BigInteger> en1 : accNonce.entrySet()) {\n AccountState as = this.getAccView(en1.getKey());\n lock.writeLock().lock();\n Iterator<Map.Entry<BigInteger, AbstractMap.SimpleEntry<ByteArrayWrapper, BigInteger>>>\n it = as.getMap().entrySet().iterator();\n\n while (it.hasNext()) {\n Map.Entry<BigInteger, AbstractMap.SimpleEntry<ByteArrayWrapper, BigInteger>> en =\n it.next();\n if (en1.getValue().compareTo(en.getKey()) > 0) {\n bwList.add(en.getValue().getKey());\n it.remove();\n } else {\n break;\n }\n }\n lock.writeLock().unlock();\n\n Set<BigInteger> fee = Collections.synchronizedSet(new HashSet<>());\n if (this.getPoolStateView(en1.getKey()) != null) {\n this.getPoolStateView(en1.getKey())\n .parallelStream()\n .forEach(ps -> fee.add(ps.getFee()));\n }\n\n fee.parallelStream()\n .forEach(\n bi -> {\n if (this.getFeeView().get(bi) != null) {\n this.getFeeView()\n .get(bi)\n .entrySet()\n .removeIf(\n byteArrayWrapperTxDependListEntry ->\n byteArrayWrapperTxDependListEntry\n .getValue()\n .getAddress()\n .equals(en1.getKey()));\n\n if (this.getFeeView().get(bi).isEmpty()) {\n this.getFeeView().remove(bi);\n }\n }\n });\n\n as.setDirty();\n }\n\n List<PooledTransaction> removedTxl = Collections.synchronizedList(new ArrayList<>());\n bwList.parallelStream()\n .forEach(\n bw -> {\n if (this.getMainMap().get(bw) != null) {\n PooledTransaction pooledTx = this.getMainMap().get(bw).getTx();\n removedTxl.add(pooledTx);\n\n long timestamp = pooledTx.tx.getTimeStampBI().longValue() / multiplyM;\n synchronized (this.getTimeView().get(timestamp)) {\n if (this.getTimeView().get(timestamp) == null) {\n LOG.error(\n \"Txpool.remove can't find the timestamp in the map [{}]\",\n pooledTx.toString());\n return;\n }\n\n this.getTimeView().get(timestamp).remove(bw);\n if (this.getTimeView().get(timestamp).isEmpty()) {\n this.getTimeView().remove(timestamp);\n }\n }\n\n lock.writeLock().lock();\n this.getMainMap().remove(bw);\n lock.writeLock().unlock();\n }\n });\n\n this.updateAccPoolState();\n this.updateFeeMap();\n\n if (LOG.isInfoEnabled()) {\n LOG.info(\"TxPoolA0.remove {} TX\", removedTxl.size());\n }\n\n return removedTxl;\n }", "public List<Token> getAllToken() throws BusinessException;", "@NotNull\n List<Balance> balances(@NotNull List<String> addresses) throws EtherScanException;", "public Transaction[] handleTxs(Transaction[] possibleTxs) {\n ArrayList<Transaction> validTransactions = new ArrayList<>();\n for (Transaction tx : possibleTxs){\n if (isValidTx(tx)){\n validTransactions.add(tx);\n consumePoolCoins(tx);\n createPoolCoins(tx);\n }\n }\n return validTransactions.toArray(new Transaction[validTransactions.size()]);\n }", "AllUsersAddresses getAllUsersAddresses();", "public interface AccountAPI {\n\n /**\n * Address ETH balance\n * \n * @param address get balance for\n * @return balance\n * @throws EtherScanException parent exception class\n */\n @NotNull\n Balance balance(@NotNull String address) throws EtherScanException;\n\n /**\n * ERC20 token balance for address\n * \n * @param address get balance for\n * @param contract token contract\n * @return token balance for address\n * @throws EtherScanException parent exception class\n */\n @NotNull\n TokenBalance balance(@NotNull String address, @NotNull String contract) throws EtherScanException;\n\n /**\n * Maximum 20 address for single batch request If address MORE THAN 20, then there will be more than\n * 1 request performed\n * \n * @param addresses addresses to get balances for\n * @return list of balances\n * @throws EtherScanException parent exception class\n */\n @NotNull\n List<Balance> balances(@NotNull List<String> addresses) throws EtherScanException;\n\n /**\n * All txs for given address\n * \n * @param address get txs for\n * @param startBlock tx from this blockNumber\n * @param endBlock tx to this blockNumber\n * @return txs for address\n * @throws EtherScanException parent exception class\n */\n @NotNull\n List<Tx> txs(@NotNull String address, long startBlock, long endBlock) throws EtherScanException;\n\n @NotNull\n List<Tx> txs(@NotNull String address, long startBlock) throws EtherScanException;\n\n @NotNull\n List<Tx> txs(@NotNull String address) throws EtherScanException;\n\n /**\n * All internal txs for given address\n * \n * @param address get txs for\n * @param startBlock tx from this blockNumber\n * @param endBlock tx to this blockNumber\n * @return txs for address\n * @throws EtherScanException parent exception class\n */\n @NotNull\n List<TxInternal> txsInternal(@NotNull String address, long startBlock, long endBlock) throws EtherScanException;\n\n @NotNull\n List<TxInternal> txsInternal(@NotNull String address, long startBlock) throws EtherScanException;\n\n @NotNull\n List<TxInternal> txsInternal(@NotNull String address) throws EtherScanException;\n\n /**\n * All internal tx for given transaction hash\n * \n * @param txhash transaction hash\n * @return internal txs list\n * @throws EtherScanException parent exception class\n */\n @NotNull\n List<TxInternal> txsInternalByHash(@NotNull String txhash) throws EtherScanException;\n\n /**\n * All ERC-20 token txs for given address\n * \n * @param address get txs for\n * @param startBlock tx from this blockNumber\n * @param endBlock tx to this blockNumber\n * @return txs for address\n * @throws EtherScanException parent exception class\n */\n @NotNull\n List<TxErc20> txsErc20(@NotNull String address, long startBlock, long endBlock) throws EtherScanException;\n\n @NotNull\n List<TxErc20> txsErc20(@NotNull String address, long startBlock) throws EtherScanException;\n\n @NotNull\n List<TxErc20> txsErc20(@NotNull String address) throws EtherScanException;\n\n /**\n * All ERC-20 token txs for given address and contract address\n *\n * @param address get txs for\n * @param contractAddress contract address to get txs for\n * @param startBlock tx from this blockNumber\n * @param endBlock tx to this blockNumber\n * @return txs for address\n * @throws EtherScanException parent exception class\n */\n @NotNull\n List<TxErc20> txsErc20(@NotNull String address, @NotNull String contractAddress, long startBlock, long endBlock)\n throws EtherScanException;\n\n @NotNull\n List<TxErc20> txsErc20(@NotNull String address, @NotNull String contractAddress, long startBlock) throws EtherScanException;\n\n @NotNull\n List<TxErc20> txsErc20(@NotNull String address, @NotNull String contractAddress) throws EtherScanException;\n\n /**\n * All ERC-721 (NFT) token txs for given address\n *\n * @param address get txs for\n * @param startBlock tx from this blockNumber\n * @param endBlock tx to this blockNumber\n * @return txs for address\n * @throws EtherScanException parent exception class\n */\n @NotNull\n List<TxErc721> txsErc721(@NotNull String address, long startBlock, long endBlock) throws EtherScanException;\n\n @NotNull\n List<TxErc721> txsErc721(@NotNull String address, long startBlock) throws EtherScanException;\n\n @NotNull\n List<TxErc721> txsErc721(@NotNull String address) throws EtherScanException;\n\n /**\n * All ERC-721 (NFT) token txs for given address\n *\n * @param address get txs for\n * @param startBlock tx from this blockNumber\n * @param endBlock tx to this blockNumber\n * @return txs for address\n * @throws EtherScanException parent exception class\n */\n @NotNull\n List<TxErc721> txsErc721(@NotNull String address, @NotNull String contractAddress, long startBlock, long endBlock)\n throws EtherScanException;\n\n @NotNull\n List<TxErc721> txsErc721(@NotNull String address, @NotNull String contractAddress, long startBlock) throws EtherScanException;\n\n @NotNull\n List<TxErc721> txsErc721(@NotNull String address, @NotNull String contractAddress) throws EtherScanException;\n\n /**\n * All ERC-721 (NFT) token txs for given address\n *\n * @param address get txs for\n * @param startBlock tx from this blockNumber\n * @param endBlock tx to this blockNumber\n * @return txs for address\n * @throws EtherScanException parent exception class\n */\n @NotNull\n List<TxErc1155> txsErc1155(@NotNull String address, long startBlock, long endBlock) throws EtherScanException;\n\n @NotNull\n List<TxErc1155> txsErc1155(@NotNull String address, long startBlock) throws EtherScanException;\n\n @NotNull\n List<TxErc1155> txsErc1155(@NotNull String address) throws EtherScanException;\n\n /**\n * All ERC-721 (NFT) token txs for given address\n *\n * @param address get txs for\n * @param startBlock tx from this blockNumber\n * @param endBlock tx to this blockNumber\n * @return txs for address\n * @throws EtherScanException parent exception class\n */\n @NotNull\n List<TxErc1155> txsErc1155(@NotNull String address, @NotNull String contractAddress, long startBlock, long endBlock)\n throws EtherScanException;\n\n @NotNull\n List<TxErc1155> txsErc1155(@NotNull String address, @NotNull String contractAddress, long startBlock)\n throws EtherScanException;\n\n @NotNull\n List<TxErc1155> txsErc1155(@NotNull String address, @NotNull String contractAddress) throws EtherScanException;\n\n /**\n * All blocks mined by address\n * \n * @param address address to search for\n * @return blocks mined\n * @throws EtherScanException parent exception class\n */\n @NotNull\n List<Block> blocksMined(@NotNull String address) throws EtherScanException;\n}", "public Transaction[] handleTxs(Transaction[] possibleTxs) {\n // IMPLEMENT THIS\n if(possibleTxs == null)\n return new Transaction[0];\n \n ArrayList<Transaction> validTxs = new ArrayList<>();\n \n //iterate through each transaction, validate, remove spent UTXO, add new UTXO\n for(int i = 0; i < possibleTxs.length; i++){\n \n //validate tx\n if(isValidTx(possibleTxs[i])){\n possibleTxs[i].finalize();\n validTxs.add(possibleTxs[i]);\n \n //remove valid/spent UTXOs from current pool\n for(Transaction.Input x:possibleTxs[i].getInputs()){\n UTXO inputUTXO = new UTXO(x.prevTxHash, x.outputIndex);\n currentPool.removeUTXO(inputUTXO);\n }\n \n //add new UTXOs to current pool\n int utxoIndex = 0;\n for(Transaction.Output x:possibleTxs[i].getOutputs()){\n UTXO outputUTXO = new UTXO(possibleTxs[i].getHash(), utxoIndex);\n currentPool.addUTXO(outputUTXO, x);\n utxoIndex++;\n }\n \n }\n }\n \n //return list of validated \n Transaction[] validatedTxs = new Transaction[validTxs.size()];\n \n validatedTxs = validTxs.toArray(validatedTxs);\n \n return validatedTxs;\n }", "@Override\r\n\tpublic ArrayList<Rents> readRents(String address) {\n\t\treturn null;\r\n\t}", "private void printAll() {\n\n String infuraAddress = \"70ddb1f89ca9421885b6268e847a459d\";\n dappSmartcontractAddress = \"0x07d55a62b487d61a0b47c2937016f68e4bcec0e9\";\n smartContractGetfunctionAddress = \"0x7355a424\";\n\n CoinNetworkInfo coinNetworkInfo = new CoinNetworkInfo(\n CoinType.ETH,\n EthereumNetworkType.ROPSTEN,\n \"https://ropsten.infura.io/v3/\"+infuraAddress\n );\n\n List<Account> accountList = sBlockchain.getAccountManager()\n .getAccounts(hardwareWallet.getWalletId(), CoinType.ETH, EthereumNetworkType.ROPSTEN);\n\n ethereumService = (EthereumService) CoinServiceFactory.getCoinService(this, coinNetworkInfo);\n\n\n ethereumService.callSmartContractFunction(\n (EthereumAccount) accountList.get(0),\n dappSmartcontractAddress,\n smartContractGetfunctionAddress\n ).setCallback(new ListenableFutureTask.Callback<String>() {\n @Override\n public void onSuccess(String result) { //return hex string\n Log.d(\"SUCCESS TAG\", \"transaction data : \"+result);\n\n getPost(result, accountList);\n\n\n }\n\n @Override\n public void onFailure(@NotNull ExecutionException e) {\n Log.d(\"ERROR TAG #101\",e.toString());\n }\n\n @Override\n public void onCancelled(@NotNull InterruptedException e) {\n Log.d(\"ERROR TAG #102\",e.toString());\n }\n });\n\n\n }", "@NotNull\n TokenBalance balance(@NotNull String address, @NotNull String contract) throws EtherScanException;", "private boolean getAddresses(){\n try {\n URLtoJSON URLtoJSON = new URLtoJSON();\n JSONObject json = URLtoJSON.open(this.URL+\"merchant/\"+this.GUID+\"/list?password=\"+this.pswd()+\"&api_code=\"+this.ApiCode);\n \n if(!json.isNull(\"error\")) return false; //If there is no transactions return false;\n JSONArray nameArray = json.names();\n JSONArray TotalArray = json.toJSONArray(nameArray);\n JSONArray JAddresses = TotalArray.getJSONArray(0);\n \n for(int i = 0; i < JAddresses.length(); i++){\n String O=\"false\";\n String S=\"false\";\n String N=\"false\";\n String[] Label=JAddresses.getJSONObject(i).getString(\"label\").split(\"_\",-1);\n if(Label.length==3){\n O=Label[1];\n S=Label[0];\n N=Label[2];\n }\n String[] Matched=this.matchDB(JAddresses.getJSONObject(i).getString(\"address\"));\n String[] Details= new String[]{\n \"S: \"+S, //0 Transaction ID\n Matched[0], //1 Sender\n Float.toString(JAddresses.getJSONObject(i).getLong(\"total_received\")/100000000)+\" (BTC)\",//2 Amount in btc\n O, //3 Choosen option\n \"btc\", //4 Currency\n \"O: \"+Matched[2], //5 Date\n Matched[1] //6 Senders nem or false \n };\n if(!this.list.contains(Details)){\n this.list.add(Details);\n if(!\"false\".equals(O) && !O.equals(\"\")){\n this.setAmountsAndEntries(Integer.parseInt(O), JAddresses.getJSONObject(i).getLong(\"total_received\"), Details[6]); //add the amount and rise the entries\n }\n }\n }\n return true;\n } catch (JSONException | NumberFormatException e) {\n e.printStackTrace();\n }\n return false;\n }", "private List<Messages.Address> mapModelAddressToWireAddress(List<byte[]> addresses) {\n return addresses.stream().map(address -> Messages.Address.newBuilder()\n .setPort(6565)\n .setIpAddress(ByteString.copyFrom(address))\n .build())\n .collect(Collectors.toList());\n }", "private String parseAddresses(Address[] address) {\n String listAddress = \"\";\n\n if (address != null) {\n for (int i = 0; i < address.length; i++) {\n listAddress += address[i].toString() + \", \";\n }\n }\n if (listAddress.length() > 1) {\n listAddress = listAddress.substring(0, listAddress.length() - 2);\n }\n\n return listAddress;\n }", "public String[] createNewAddress(){\r\n byte[][] pairs=ECDSAgeneratePublicAndPrivateKey();\r\n byte[] afterhashing=RIPEMD160(SHA256hash(pairs[1]));\r\n byte[] checksum=getCheckSum(SHA256hash(SHA256hash(afterhashing)));\r\n byte[] bitcoinaddress=concateByteArray(afterhashing,checksum);\r\n return new String[]{toHex(pairs[0]), convertPrivateKeytoWIF(pairs[0]), base58encode(bitcoinaddress)};\r\n }", "Collection lookupTransactions(String email);", "public com.zenithbank.mtn.fleet.Transaction[] getCardTrans(boolean includeOpeningBalance) throws java.rmi.RemoteException;", "Collection lookupTransactions(String email, String reason);", "public TradeHistoryReq address(String address) {\n this.address = address;\n return this;\n }", "java.util.List<kr.pik.message.Profile.ProfileMessage.ContactAddress> \n getContactAddressList();", "io.envoyproxy.envoy.data.dns.v3.DnsTable.AddressList getAddressList();", "private void requestAddresses(byte nAddr) throws Exception {\n final HashSet<Inet4Address> addrs = new HashSet<>();\n byte[] hwAddrBytes = new byte[] { 8, 4, 3, 2, 1, 0 };\n for (byte i = 0; i < nAddr; i++) {\n hwAddrBytes[5] = i;\n MacAddress newMac = MacAddress.fromBytes(hwAddrBytes);\n final String hostname = \"host_\" + i;\n final DhcpLease lease = mRepo.getOffer(CLIENTID_UNSPEC, newMac,\n IPV4_ADDR_ANY /* relayAddr */, INETADDR_UNSPEC /* reqAddr */, hostname);\n\n assertNotNull(lease);\n assertEquals(newMac, lease.getHwAddr());\n assertEquals(hostname, lease.getHostname());\n assertTrue(format(\"Duplicate address allocated: %s in %s\", lease.getNetAddr(), addrs),\n addrs.add(lease.getNetAddr()));\n\n requestLeaseSelecting(newMac, lease.getNetAddr(), hostname);\n }\n }", "private List<DriverAddress> generateAddresses(Driver driver, int amount){\n\t\tList<DriverAddress> addresses = new ArrayList<DriverAddress>();\n\t\tfor(int i=0; i < amount; i++){ \t\t\n\t\t\taddresses.add(new DriverAddress());\n\t\t\taddresses.get(i).setBusinessInd(\"N\");\n\t\t\taddresses.get(i).setAddressLine1(i + \" Driver Service Test\");\n\t\t\taddresses.get(i).setPostcode(\"45241\");\n\t\t\taddresses.get(i).setGeoCode(\"0800\");\t\t\n\t\t\taddresses.get(i).setAddressType(driverService.getDriverAddressTypeCodes().get(0));\n\t\t\taddresses.get(i).setDriver(driver);\n\t\t}\n\t\treturn addresses;\n\t}", "@GetMapping(value = \"/payments/{accountNumber}\")\n\tpublic List<PaymentDTO> getAccountTransactions(@PathVariable(\"accountNumber\") final String accountNumber) {\n\t\treturn this.paymentsService.getAccountTransactions(accountNumber);\n\t}", "public static List<Address> GetAllRecordsFromTable() {\n\n return SQLite.select().from(Address.class).queryList();\n\n\n }", "public abstract List<String> associateAddresses(NodeMetadata node);", "List<?> getAddress();", "public void listAll(List<Address> AddressList) {\n for (Address a : AddressList) {\n console.promptForPrintPrompt(a.toString());\n }\n }", "public List<PeerAddress> all() {\n final List<PeerAddress> all = new ArrayList<PeerAddress>();\n for (final Map<Number160, PeerStatistic> map : peerMapVerified) {\n synchronized (map) {\n for (PeerStatistic peerStatistic : map.values()) {\n all.add(peerStatistic.peerAddress());\n }\n }\n }\n return all;\n }", "public Transaction[] getTransactionsList() throws Exception;", "public AddressList listAllAddresses(String addressBook)\n\t{\n\t\treturn controller.listAllAddresses(addressBook);\n\t}", "public Call<ExpResult<List<DelegationInfo>>> getDelegations(MinterAddress address) {\n checkNotNull(address, \"Address can't be null\");\n\n return getInstantService().getDelegationsForAddress(address.toString(), 1);\n }", "public void testLongStreetAddress() throws InterruptedException {\n Customer customer = CustomerService.getInstance().getCustomerById(new Integer(5276));\r\n ir.printInvoice(custInv, customer);\r\n }", "@Test\n public void SameTokenNameOpenInvalidAddress() {\n dbManager.getDynamicPropertiesStore().saveAllowSameTokenName(1);\n InitExchangeSameTokenNameActive();\n long exchangeId = 1;\n String firstTokenId = \"123\";\n long firstTokenQuant = 100000000L;\n String secondTokenId = \"456\";\n long secondTokenQuant = 200000000L;\n\n byte[] ownerAddress = ByteArray.fromHexString(OWNER_ADDRESS_FIRST);\n AccountCapsule accountCapsule = dbManager.getAccountStore().get(ownerAddress);\n Map<String, Long> assetV2Map = accountCapsule.getAssetMapV2();\n Assert.assertEquals(10000_000000L, accountCapsule.getBalance());\n Assert.assertEquals(null, assetV2Map.get(firstTokenId));\n Assert.assertEquals(null, assetV2Map.get(secondTokenId));\n\n ExchangeWithdrawActuator actuator = new ExchangeWithdrawActuator(getContract(\n OWNER_ADDRESS_INVALID, exchangeId, firstTokenId, firstTokenQuant),\n dbManager);\n TransactionResultCapsule ret = new TransactionResultCapsule();\n\n try {\n actuator.validate();\n actuator.execute(ret);\n fail(\"Invalid address\");\n } catch (ContractValidateException e) {\n Assert.assertTrue(e instanceof ContractValidateException);\n Assert.assertEquals(\"Invalid address\", e.getMessage());\n } catch (ContractExeException e) {\n Assert.assertFalse(e instanceof ContractExeException);\n } finally {\n dbManager.getExchangeStore().delete(ByteArray.fromLong(1L));\n dbManager.getExchangeStore().delete(ByteArray.fromLong(2L));\n dbManager.getExchangeV2Store().delete(ByteArray.fromLong(1L));\n dbManager.getExchangeV2Store().delete(ByteArray.fromLong(2L));\n }\n }", "@Override\n\tpublic List<CashTransactionDtl> getCashTransactionDtlByAccount(\n\t\t\tMap<String, Object> params) throws ServiceException {\n\t\treturn cashTransactionDtlMapper.queryCashTransactionRecord(params);\n\t}", "java.util.List<com.google.protobuf.ByteString> getTransactionsList();", "public ArrayList<String> getAllTokens() {\n ArrayList<String> returnlist = new ArrayList<String>();\n // Select All Query\n String selectQuery = \"SELECT Token FROM \" + TABLE_NAME;\n\n SQLiteDatabase db = this.getWritableDatabase();\n Cursor cursor = db.rawQuery(selectQuery, null);\n\n // looping through all rows and adding to list\n if (cursor.moveToFirst()) {\n do {\n ArrayList<String> data = new ArrayList<String>();\n for (int i =0; i<cursor.getColumnCount(); i++){\n data.add(cursor.getString(i));\n }\n // Adding contact to list\n returnlist.add(data.get(0));\n } while (cursor.moveToNext());\n }\n\n // return contact list\n cursor.close();\n db.close();\n return returnlist;\n }", "public ArrayList<RouteTableEntry> getFIBExcludingLL3PAddress(Integer LL3PAddress) {\n \tIterator<RouteTableEntry> tableIterator=table.iterator();\n \tArrayList<RouteTableEntry> treatedForwaedingList= new ArrayList<RouteTableEntry>();\n\t\tRouteTableEntry tmp=null;\n\t\t//boolean found=false;\n\t\ttry{\n\t\twhile(tableIterator.hasNext()){\n\t\t\ttmp=tableIterator.next();\n\t\t\tInteger tmpLL3=tmp.getSourceLL3P();\n\t\t\tif(!(tmpLL3.equals(LL3PAddress))){\n\t\t\t\t\tInteger tmpNetworkNumber = tmp.getNetworkDistancePair().getNetworkNumber();\n\t\t\t\t\t//String hen=Integer.toHexString(LL3PAddress);\n\t\t\t\t Integer tmpLL3pNetworkNumber = Utilities.getNetworkNumber(Integer.toHexString(LL3PAddress));\n\t\t\t\t\tif (!(tmpNetworkNumber.equals(tmpLL3pNetworkNumber))){\n\t\t\t\t\t\ttreatedForwaedingList.add(tmp);\n\t\t\t }\n\t \t\t}\n\t\t}\n\t\t}\n\t\tcatch(Exception e){\n\t\t\t\n\t\t}\n\t\treturn treatedForwaedingList;\n }", "EmailAddress fetchEmailAddress(AccessToken token);", "public static String[] generateEPRs(SocketAcceptor acceptor, String serviceName, String ip) {\n //Get all the addresses associated with the acceptor\n Map<SessionID, SocketAddress> socketAddresses = acceptor.getAcceptorAddresses();\n //Get all the sessions (SessionIDs) associated with the acceptor\n ArrayList<SessionID> sessions = acceptor.getSessions();\n String[] EPRList = new String[sessions.size()];\n\n //Generate an EPR for each session/socket address\n for (int i = 0; i < sessions.size(); i++) {\n SessionID sessionID = sessions.get(i);\n InetSocketAddress socketAddress = (InetSocketAddress) socketAddresses.get(sessionID);\n EPRList[i] = FIXConstants.FIX_PREFIX + ip + \":\" + socketAddress.getPort() +\n \"?\" + FIXConstants.BEGIN_STRING + \"=\" + sessionID.getBeginString() +\n \"&\" + FIXConstants.SENDER_COMP_ID + \"=\" + sessionID.getTargetCompID() +\n \"&\" + FIXConstants.TARGET_COMP_ID + \"=\" + sessionID.getSenderCompID();\n\n String sessionQualifier = sessionID.getSessionQualifier();\n if (sessionQualifier != null && !sessionQualifier.equals(\"\")) {\n EPRList[i] += \"&\" + FIXConstants.SESSION_QUALIFIER + \"=\" + sessionQualifier;\n }\n\n String senderSubID = sessionID.getSenderSubID();\n if (senderSubID != null && !senderSubID.equals(\"\")) {\n EPRList[i] += \"&\" + FIXConstants.SENDER_SUB_ID + \"=\" + senderSubID;\n }\n\n String targetSubID = sessionID.getTargetSubID();\n if (targetSubID != null && !targetSubID.equals(\"\")) {\n EPRList[i] += \"&\" + FIXConstants.TARGET_SUB_ID + \"=\" + targetSubID;\n }\n\n String senderLocationID = sessionID.getSenderLocationID();\n if (senderLocationID != null && !senderLocationID.equals(\"\")) {\n EPRList[i] += \"&\" + FIXConstants.SENDER_LOCATION_ID + \"=\" + senderLocationID;\n }\n\n String targetLocationID = sessionID.getTargetLocationID();\n if (targetLocationID != null && !targetLocationID.equals(\"\")) {\n EPRList[i] += \"&\" + FIXConstants.TARGET_LOCATION_ID + \"=\" + targetLocationID;\n }\n\n EPRList[i] += \"&Service=\" + serviceName;\n }\n return EPRList;\n }", "public List<AddressEntity> getAllAddress(CustomerEntity customerEntity) {\n\n //Creating List of AddressEntities.\n List<AddressEntity> addressEntities = new LinkedList<>();\n\n //Calls Method of customerAddressDao,getAllCustomerAddressByCustomer and returns AddressList.\n List<CustomerAddressEntity> customerAddressEntities = customerAddressDao.getAllCustomerAddressByCustomer(customerEntity);\n if (customerAddressEntities != null) { //Checking if CustomerAddressEntity is null else extracting address and adding to the addressEntites list.\n customerAddressEntities.forEach(customerAddressEntity -> {\n addressEntities.add(customerAddressEntity.getAddress());\n });\n }\n\n return addressEntities;\n\n }", "ListenableFuture<String> attestFor(\n List<DiagnosisKey> keys,\n List<String> regions,\n String verificationCode,\n int transmissionRisk) {\n Log.i(TAG, \"Getting SafetyNet attestation.\");\n String cleartext = cleartextFor(keys, regions, verificationCode, transmissionRisk);\n String nonce = BASE64.encode(sha256(cleartext));\n return safetyNetAttestationFor(nonce);\n }", "@Override\n\tpublic List<Address> FindAllAddress() {\n\t\treturn ab.FindAll();\n\t}", "public void setAddresses(List<Address> addresses) {\r\n\r\n this.addresses = addresses;\r\n\r\n }", "public static List<MemoryBlock> getAllMemoryAddresses() {\n\n List<MemoryBlock> addresses = new ArrayList<MemoryBlock>();\n\n for (int i = 0; i <= EEPROM_MAX_ADDRESS; i++) {\n addresses.add(new MemoryBlock(Utils.intToHexString(i), \"\"));\n }\n return addresses;\n }", "private static String getUnsuccessfulAddresses(\n final List<Pair<RelocatedAddress, Integer>> addresses) {\n return getAddressString(addresses, new ICollectionFilter<Pair<RelocatedAddress, Integer>>() {\n @Override\n public boolean qualifies(final Pair<RelocatedAddress, Integer> item) {\n return item.second() != 0;\n }\n });\n }", "public List<Address> getAllAddressesByName(String user_name) {\n\t\tList<Address> address = new ArrayList<>();\r\n\t\taddressdao.findByUserUsername(user_name)\r\n\t\t.forEach(address::add);\r\n\t\treturn address;\r\n\t}", "public List<Address> findAll();", "@Override\n\t\tpublic List<AccountTransaction> findAll() {\n\t\t\treturn null;\n\t\t}", "List<Account> findAccountByAddressStartingWith(String pattern);", "public boolean containsAddress(String address) {\n\t\treturn tseqnums.containsKey(address);\n\t}", "@Test\n public void SameTokenNameCloseInvalidAddress() {\n dbManager.getDynamicPropertiesStore().saveAllowSameTokenName(0);\n InitExchangeBeforeSameTokenNameActive();\n long exchangeId = 1;\n String firstTokenId = \"abc\";\n long firstTokenQuant = 100000000L;\n String secondTokenId = \"def\";\n long secondTokenQuant = 200000000L;\n\n byte[] ownerAddress = ByteArray.fromHexString(OWNER_ADDRESS_FIRST);\n AccountCapsule accountCapsule = dbManager.getAccountStore().get(ownerAddress);\n Map<String, Long> assetMap = accountCapsule.getAssetMap();\n Assert.assertEquals(10000_000000L, accountCapsule.getBalance());\n Assert.assertEquals(null, assetMap.get(firstTokenId));\n Assert.assertEquals(null, assetMap.get(secondTokenId));\n\n ExchangeWithdrawActuator actuator = new ExchangeWithdrawActuator(getContract(\n OWNER_ADDRESS_INVALID, exchangeId, firstTokenId, firstTokenQuant),\n dbManager);\n TransactionResultCapsule ret = new TransactionResultCapsule();\n\n try {\n actuator.validate();\n actuator.execute(ret);\n fail(\"Invalid address\");\n } catch (ContractValidateException e) {\n Assert.assertTrue(e instanceof ContractValidateException);\n Assert.assertEquals(\"Invalid address\", e.getMessage());\n } catch (ContractExeException e) {\n Assert.assertFalse(e instanceof ContractExeException);\n } finally {\n dbManager.getExchangeStore().delete(ByteArray.fromLong(1L));\n dbManager.getExchangeStore().delete(ByteArray.fromLong(2L));\n dbManager.getExchangeV2Store().delete(ByteArray.fromLong(1L));\n dbManager.getExchangeV2Store().delete(ByteArray.fromLong(2L));\n }\n }", "public static com.networknt.taiji.token.TokenTransactions.Builder newBuilder() {\n return new com.networknt.taiji.token.TokenTransactions.Builder();\n }", "@Override\r\n\tpublic List<UserAddress> viewUserAddressList() {\r\n\t\tList<UserAddress> result = new ArrayList<UserAddress>();\r\n useraddressrepository.findAll().forEach(UserAddress1 -> result.add(UserAddress1));\r\n return result;\r\n\t}", "public ArrayList<Account> GetCustomerAccounts(String ssn)\n {\n ArrayList<Account> result = new ArrayList<>();\n\n for (Account account : accounts)\n {\n if (account.getSsn().equals(ssn))\n {\n result.add(account);\n }\n }\n\n return result;\n }", "com.google.protobuf.ByteString getTransactions(int index);", "List<Trade> getAllTrades() throws OrderBookTradeException ;", "public void setAddresses(List<String> addresses) {\n this.addresses = addresses;\n }", "@Override\r\n\tpublic ArrayList<UserClass> readUsers(String address) {\n\t\treturn null;\r\n\t}", "public static Address getTroveFromAddress()\n {\n Address rval = new Address();\n\n rval.setFirstName(\"Trove, Inc.\");\n rval.setAddressLine1(\"20 Exchange Place\");\n rval.setAddressLine2(\"Apt 1604\");\n rval.setCity(\"New York\");\n Subdivision subdivision = new Subdivision();\n subdivision.setCode(\"US-NY\");\n\n rval.setSubdivision(subdivision);\n rval.setPostalCode(\"10005\");\n rval.setPhone(\"3108096011\");\n\n return rval;\n }", "public List<String> findActiveCongestionPointAddresses(LocalDate period) {\n return congestionPointConnectionGroupRepository.findActiveCongestionPointConnectionGroup(period).stream()\n .map(ConnectionGroup::getUsefIdentifier).collect(Collectors.toList());\n }", "public IndividualAddress(final int address)\n\t{\n\t\tsuper(address);\n\t}", "public List getAddressList() {\r\n System.out.println(\"List Elements :\" + addressList);\r\n return addressList;\r\n }", "public List<Email> getUnregisteredEmailList(Ram ram);", "private static SendGridRequest.EmailAddress [] getPersonalizationAddresses(String addresses) {\n if (addresses != null) {\n return Arrays.stream(addresses.split(\";\"))\n .map(String::trim)\n .map(address -> {\n SendGridRequest.EmailAddress emailAddress = new SendGridRequest.EmailAddress();\n emailAddress.setEmail(address);\n return emailAddress;\n })\n .toArray(SendGridRequest.EmailAddress []::new);\n } else {\n return null;\n }\n }", "public static Tax[] getTaxes() {\n Tax[] taxes = new Tax[DeclarationFiller.getDeclaration().size()];\n int count = 0;\n if (taxes != null ) {\n for (Map.Entry<String, Integer> incomePoint : DeclarationFiller.getDeclaration().entrySet()) {\n String taxName = \"Tax of \" + incomePoint.getKey();\n int incomValue = incomePoint.getValue();\n taxes[count] = new Tax(count+1001 ,taxName, incomValue, 0.18);\n count++;\n }\n }\n return taxes;\n }", "public IndividualAddress(final byte[] address)\n\t{\n\t\tsuper(address);\n\t}", "public List<com.generator.tables.pojos.CreditChain> fetchByAddress(String... values) {\n return fetch(CreditChain.CREDIT_CHAIN.ADDRESS, values);\n }", "public static byte[] makeNonce(String senderAddress, String receiverIdentifier, Timestamp timestamp, byte[] otherData) {\n if (!ValidationTools.isAddress(senderAddress)) {\n throw ExceptionUtil.throwException(logger, new IllegalArgumentException(\"Address is not valid\"));\n }\n ByteBuffer buffer = ByteBuffer.allocate(otherDataIndexStart + otherData.length);\n // Hash to ensure all variable length components is encoded with constant length\n buffer.put(senderAddress.toUpperCase().getBytes(StandardCharsets.UTF_8));\n buffer.put(AttestationCrypto.hashWithKeccak(receiverIdentifier.getBytes(StandardCharsets.UTF_8)));\n buffer.put(longToBytes(timestamp.getTime()));\n buffer.put(otherData);\n return buffer.array();\n }", "@CrossOrigin\n @RequestMapping(path=\"/address/customer\",method = RequestMethod.GET, produces = MediaType.APPLICATION_JSON_UTF8_VALUE)\n public ResponseEntity<AddressListResponse> getAllAddress(@RequestHeader(\"authorization\") final String authorization) throws AuthorizationFailedException {\n\n String[] splitStrings = authorization.split(\" \");\n String accessToken = splitStrings[1];\n\n CustomerEntity loggedCustomer = customerService.getCustomer(accessToken);\n List<AddressEntity> addressEntityList = addressService.getAllAddress(loggedCustomer);\n\n AddressListResponse addressListResponse = new AddressListResponse();\n if(addressEntityList==null){\n addressListResponse = null;\n return new ResponseEntity<>(addressListResponse, HttpStatus.OK);\n }\n\n List<AddressList> addressLists = new ArrayList<>();\n\n for (AddressEntity addressEntity : addressEntityList) {\n AddressList adr = new AddressList();\n adr.setId(UUID.fromString(addressEntity.getUuid()));\n adr.setFlatBuildingName(addressEntity.getFlatBuilNo());\n adr.setLocality(addressEntity.getLocality());\n adr.setCity(addressEntity.getCity());\n adr.setPincode(addressEntity.getPincode());\n\n AddressListState statesList = new AddressListState();\n String stateUuid = addressEntity.getState().getUuid();\n statesList.setId(UUID.fromString(stateUuid));\n statesList.setStateName(addressEntity.getState().getStateName());\n adr.setState(statesList);\n addressLists.add(adr);\n }\n\n return new ResponseEntity<>(addressListResponse.addresses(addressLists), HttpStatus.OK);\n\n }", "default List<PendingAttestation> get_matching_head_attestations(BeaconState state, EpochNumber epoch) {\n return get_matching_source_attestations(state, epoch).stream()\n .filter(a -> a.getData().getBeaconBlockRoot().equals(\n get_block_root_at_slot(state, get_attestation_slot(state, a.getData()))))\n .collect(toList());\n }", "void generateSameTX(String name, List<String> types, Settings settings);", "public Vector<NetworkAddress> getHostAddresses(int type) {return addressesChecker.getAllMyAddresses(type); }", "public static List<BangkingTransaction> findByAccountNumber(Long acc) {\n\t\treturn Ebean.find(BangkingTransaction.class).select(\"transaction_id\").where().eq(\"senderAccount.accountNumber\", acc).findList();\r\n\t\t\r\n\t}", "@Override\n public List<CryptoAddressRequest> listAllPendingRequests() throws CantListPendingCryptoAddressRequestsException {\n try {\n\n return cryptoAddressesNetworkServiceDao.listAllPendingRequests();\n\n } catch (CantListPendingCryptoAddressRequestsException e){\n\n errorManager.reportUnexpectedPluginException(this.getPluginVersionReference(), UnexpectedPluginExceptionSeverity.DISABLES_SOME_FUNCTIONALITY_WITHIN_THIS_PLUGIN, e);\n throw e;\n } catch (Exception e){\n\n errorManager.reportUnexpectedPluginException(this.getPluginVersionReference(), UnexpectedPluginExceptionSeverity.DISABLES_SOME_FUNCTIONALITY_WITHIN_THIS_PLUGIN, e);\n throw new CantListPendingCryptoAddressRequestsException(FermatException.wrapException(e), null, \"Unhandled Exception.\");\n }\n }", "@Override\n public List<CryptoAddressRequest> listPendingCryptoAddressRequests() throws CantListPendingCryptoAddressRequestsException {\n try {\n\n return cryptoAddressesNetworkServiceDao.listPendingRequestsByProtocolStateAndAction(ProtocolState.PENDING_ACTION, RequestAction.REQUEST);\n\n } catch (CantListPendingCryptoAddressRequestsException e){\n\n errorManager.reportUnexpectedPluginException(this.getPluginVersionReference(), UnexpectedPluginExceptionSeverity.DISABLES_SOME_FUNCTIONALITY_WITHIN_THIS_PLUGIN, e);\n throw e;\n } catch (Exception e){\n\n errorManager.reportUnexpectedPluginException(this.getPluginVersionReference(), UnexpectedPluginExceptionSeverity.DISABLES_SOME_FUNCTIONALITY_WITHIN_THIS_PLUGIN, e);\n throw new CantListPendingCryptoAddressRequestsException(FermatException.wrapException(e), null, \"Unhandled Exception.\");\n }\n }", "public SendWalletThread(String[] address,Wallet wallet) {\r\n\t\tthis.WALLET = wallet;\r\n\t\tADDRESS= address;\r\n\t}", "static void printAccountBalance(String address){\n }", "private Account createAccount(byte[] address) {\n return new Account(address);\n }", "private List<Tenant> getTenantsByKeyChangeXml(Document document) throws KeyChangeException {\n List<Tenant> tenantList = new ArrayList<Tenant>();\n List<TenantData> tenantDataList;\n tenantDataList = KeyChangeDataUtils.getKeyChangeTenantDataByXML(document).getTenantDataList();\n TenantManager tenantManager = ServiceHolder.getRealmService().getTenantManager();\n // Iterate through tenants\n for (TenantData tenantData : tenantDataList) {\n String tenantDomain = null;\n try {\n tenantDomain = tenantData.getTenantDomain();\n int tenantId = ServiceHolder.getRealmService().getTenantManager().getTenantId(tenantDomain);\n if (tenantId != MultitenantConstants.INVALID_TENANT_ID) {\n Tenant tenant = tenantManager.getTenant(tenantId);\n tenantList.add(tenant);\n } else {\n log.error(\"Invalid tenant domain '\" + tenantDomain + \"'\");\n // If the specific tenant domain is invalid continuing the flow for the rest of the tenants.\n }\n } catch (UserStoreException e) {\n throw new KeyChangeException(\"User store exception while getting the tenant ID for tenant \" +\n tenantDomain, e);\n }\n }\n return tenantList;\n }", "int getServiceAccountIdTokensCount();", "public abstract String generateTokens(int targetNumber);", "com.google.protobuf.ByteString\n\t\t\tgetAddressBytes();" ]
[ "0.7342023", "0.7152389", "0.6795158", "0.6524173", "0.6424524", "0.63005066", "0.58309996", "0.5304834", "0.52032167", "0.5147329", "0.50936204", "0.5074344", "0.48291612", "0.47886845", "0.4773262", "0.47700232", "0.4761369", "0.4751397", "0.47383618", "0.47155795", "0.47125039", "0.4703851", "0.4590081", "0.4544326", "0.45295796", "0.45214093", "0.4511265", "0.4477108", "0.44641897", "0.4441554", "0.44328305", "0.44085228", "0.44039574", "0.43883473", "0.43836153", "0.4339882", "0.43335542", "0.4331053", "0.43227285", "0.43112764", "0.42869088", "0.42759362", "0.42689466", "0.42587712", "0.42506206", "0.4246708", "0.42443508", "0.4219319", "0.42117172", "0.4205554", "0.4185273", "0.41823927", "0.41752073", "0.41748732", "0.41649958", "0.4150085", "0.41474143", "0.41284662", "0.4127189", "0.41163245", "0.41147467", "0.41141346", "0.41127464", "0.41112489", "0.41035596", "0.41016114", "0.4093911", "0.40925193", "0.40924677", "0.40849283", "0.4074132", "0.40706718", "0.40672132", "0.40604988", "0.4059227", "0.40548947", "0.40470442", "0.40334833", "0.40252516", "0.4022804", "0.40178254", "0.40107468", "0.4008683", "0.40068212", "0.40065545", "0.39904454", "0.39878196", "0.39824048", "0.39791095", "0.39787695", "0.39786765", "0.39785233", "0.39670596", "0.3958508", "0.3956425", "0.3956203", "0.39561343", "0.39524284", "0.39518237", "0.39517716" ]
0.6086244
6
All blocks mined by address
@NotNull List<Block> blocksMined(@NotNull String address) throws EtherScanException;
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "List<Block> blocks();", "private void addBlockAddresses(MemoryBlockDB block, boolean addToAll) {\n\t\tAddress start = block.getStart();\n\t\tAddress end = block.getEnd();\n\t\tif (addToAll) {\n\t\t\tallAddrSet.add(start, end);\n\t\t}\n\t\tif (block.isExternalBlock()) {\n\t\t\taddrSetView.externalBlock.add(start, end);\n\t\t}\n\t\telse if (block.isExecute()) {\n\t\t\taddrSetView.execute.add(start, end);\n\t\t}\n\t\tif (block.isMapped()) {\n\t\t\t// Identify source-blocks which block maps onto and add as a mapped-block to each of these\n\t\t\tAddressRange mappedRange = block.getSourceInfos().get(0).getMappedRange().get();\n\t\t\tfor (MemoryBlockDB b : getBlocks(mappedRange.getMinAddress(),\n\t\t\t\tmappedRange.getMaxAddress())) {\n\t\t\t\tif (!b.isMapped()) {\n\t\t\t\t\tb.addMappedBlock(block);\n\t\t\t\t}\n\t\t\t}\n\t\t\tAddressSet mappedSet = getMappedIntersection(block, addrSetView.initialized);\n\t\t\taddrSetView.initialized.add(mappedSet);\n\t\t\taddrSetView.initializedAndLoaded.add(getMappedIntersection(block, addrSetView.initializedAndLoaded));\n\t\t}\n\t\telse if (block.isInitialized()) {\n\t\t\taddrSetView.initialized.add(block.getStart(), block.getEnd());\n\t\t\tif (block.isLoaded()) {\n\t\t\t\taddrSetView.initializedAndLoaded.add(block.getStart(), block.getEnd());\n\t\t\t}\n\t\t}\n\t}", "public Iterator<Map.Entry<Integer, Block>> listBlocks () {\n return this.blockMap.entrySet().iterator();\n }", "public static List<MemoryBlock> getAllMemoryAddresses() {\n\n List<MemoryBlock> addresses = new ArrayList<MemoryBlock>();\n\n for (int i = 0; i <= EEPROM_MAX_ADDRESS; i++) {\n addresses.add(new MemoryBlock(Utils.intToHexString(i), \"\"));\n }\n return addresses;\n }", "public ArrayList<Block> getMap(){\r\n\t\treturn new ArrayList<Block>(this.blockMap);\r\n\t}", "List<MemoryBlockDB> getBlocks(Address start, Address end) {\n\t\tList<MemoryBlockDB> list = new ArrayList<>();\n\n\t\tList<MemoryBlockDB> tmpBlocks = blocks;\n\t\tint index = Collections.binarySearch(tmpBlocks, start, BLOCK_ADDRESS_COMPARATOR);\n\t\tif (index < 0) {\n\t\t\tindex = -index - 2;\n\t\t}\n\t\tif (index >= 0) {\n\t\t\tMemoryBlockDB block = tmpBlocks.get(index);\n\t\t\tif (block.contains(start)) {\n\t\t\t\tlist.add(block);\n\t\t\t}\n\t\t}\n\n\t\twhile (++index < tmpBlocks.size()) {\n\t\t\tMemoryBlockDB block = tmpBlocks.get(index);\n\t\t\tif (block.getStart().compareTo(end) > 0) {\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tlist.add(block);\n\t\t}\n\n\t\treturn list;\n\t}", "phaseI.Hdfs.BlockLocations getBlockLocations(int index);", "java.util.List<phaseI.Hdfs.BlockLocations> \n getBlockLocationsList();", "public LinkedList<Point> getAllBlock(Block block) {\n\t\tLinkedList<Point> list = new LinkedList<>();\n\n\t\tfor (int y = 0; y < height; y++)\n\t\t\tfor (int x = 0; x < width; x++)\n\t\t\t\tif (maze[x][y] == block) list.add(new Point(x, y));\n\n\t\treturn list;\n\t}", "List<Block> getBlocksByCongName(String congName);", "public static LinkedList<TempBlock> getAll(Block block) {\r\n\t\treturn instances_.get(block);\r\n\t}", "public List<PeerAddress> allOverflow() {\n List<PeerAddress> all = new ArrayList<PeerAddress>();\n for (Map<Number160, PeerStatistic> map : peerMapOverflow) {\n synchronized (map) {\n for (PeerStatistic peerStatistic : map.values()) {\n all.add(peerStatistic.peerAddress());\n }\n }\n }\n return all;\n }", "private int findBlock(long addr) {\n\t\t// find cache by splitting addr into multiple segs\n\t\tint setIndex = (int) ((addr & 0x7FC0) >>> 6);\n\t\tlong tag = (addr & 0x3FFFFFFFFFFF8000l) >>> 15;\n\t\t// search for the set to check for existence\n\t\tfor (int j = 0; j < 8; j++) {\n\t\t\tif (cache[setIndex][j] == tag) {\n\t\t\t\tpolicies[setIndex].updateAt(j);\n\t\t\t\treturn 3;\n\t\t\t}\n\t\t}\n\t\tif(usePrefetch){\n\t\t\t//fetch from memory; preftecher will fetch many other relevant addresses\n\t\t\tArrayList<Long> address = pf.getPrefetchedAddress(addr);\n\t\t\tfor(long add : address) {\n\t\t\t\tsetIndex = (int) ((add & 0x7FC0) >>> 6);\n\t\t\t\ttag = (add & 0x3FFFFFFFFFFF8000l) >>> 15;\n\t\t\t\tint index = policies[setIndex].getNextIndex();\n\t\t\t\tcache[setIndex][index] = tag;\n\t\t\t}\n\t\t}\n\t\telse{\n\t\t\tint index = policies[setIndex].getNextIndex();\n\t\t\tcache[setIndex][index] = tag;\n\t\t}\n\t\t// after all, we need to update the entry\n\t\treturn 4;\n\t}", "public List<PeerAddress> all() {\n final List<PeerAddress> all = new ArrayList<PeerAddress>();\n for (final Map<Number160, PeerStatistic> map : peerMapVerified) {\n synchronized (map) {\n for (PeerStatistic peerStatistic : map.values()) {\n all.add(peerStatistic.peerAddress());\n }\n }\n }\n return all;\n }", "public Map<Long, Block> getBlocks() {\n\t\treturn this.blocks;\n\t}", "@Override\r\n public List<Block> blocks() {\r\n List<Block> blockList = new ArrayList<Block>();\r\n java.awt.Color[] colors = new Color[5];\r\n colors[0] = Color.decode(\"#c1b8b2\");\r\n colors[1] = Color.decode(\"#ef1607\");\r\n colors[2] = Color.decode(\"#ffff1e\");\r\n colors[3] = Color.decode(\"#211ed8\");\r\n colors[4] = Color.decode(\"#fffff6\");\r\n int y = 150;\r\n int[] hitPoints = {2, 1, 1, 1, 1};\r\n for (int i = 0; i < colors.length; i++) {\r\n for (int j = i + 5; j < 15; j++) {\r\n blockList.add(new Block(j * 50 + 25, y, 50, 20, colors[i], hitPoints[i]));\r\n }\r\n y += 20;\r\n }\r\n return blockList;\r\n }", "public ProductionBlock[] getAllProductionBlocks();", "public void testFetchBlocks() throws IOException {\n\t\tLocalRawDataBlockList list = new LocalRawDataBlockList();\r\n\t\tbyte[] data = new byte[512];\r\n\t\tint offset = 0;\r\n\r\n\t\tLittleEndian.putInt(data, offset, -3); // for the BAT block itself\r\n\t\toffset += LittleEndianConsts.INT_SIZE;\r\n\r\n\t\t// document 1: is at end of file already; start block = -2\r\n\t\t// document 2: has only one block; start block = 1\r\n\t\tLittleEndian.putInt(data, offset, -2);\r\n\t\toffset += LittleEndianConsts.INT_SIZE;\r\n\r\n\t\t// document 3: has a loop in it; start block = 2\r\n\t\tLittleEndian.putInt(data, offset, 2);\r\n\t\toffset += LittleEndianConsts.INT_SIZE;\r\n\r\n\t\t// document 4: peeks into document 2's data; start block = 3\r\n\t\tLittleEndian.putInt(data, offset, 4);\r\n\t\toffset += LittleEndianConsts.INT_SIZE;\r\n\t\tLittleEndian.putInt(data, offset, 1);\r\n\t\toffset += LittleEndianConsts.INT_SIZE;\r\n\r\n\t\t// document 5: includes an unused block; start block = 5\r\n\t\tLittleEndian.putInt(data, offset, 6);\r\n\t\toffset += LittleEndianConsts.INT_SIZE;\r\n\t\tLittleEndian.putInt(data, offset, -1);\r\n\t\toffset += LittleEndianConsts.INT_SIZE;\r\n\r\n\t\t// document 6: includes a BAT block; start block = 7\r\n\t\tLittleEndian.putInt(data, offset, 8);\r\n\t\toffset += LittleEndianConsts.INT_SIZE;\r\n\t\tLittleEndian.putInt(data, offset, 0);\r\n\t\toffset += LittleEndianConsts.INT_SIZE;\r\n\r\n\t\t// document 7: includes an XBAT block; start block = 9\r\n\t\tLittleEndian.putInt(data, offset, 10);\r\n\t\toffset += LittleEndianConsts.INT_SIZE;\r\n\t\tLittleEndian.putInt(data, offset, -4);\r\n\t\toffset += LittleEndianConsts.INT_SIZE;\r\n\r\n\t\t// document 8: goes off into space; start block = 11;\r\n\t\tLittleEndian.putInt(data, offset, 1000);\r\n\t\toffset += LittleEndianConsts.INT_SIZE;\r\n\r\n\t\t// document 9: no screw ups; start block = 12;\r\n\t\tint index = 13;\r\n\r\n\t\tfor (; offset < 508; offset += LittleEndianConsts.INT_SIZE) {\r\n\t\t\tLittleEndian.putInt(data, offset, index++);\r\n\t\t}\r\n\t\tLittleEndian.putInt(data, offset, -2);\r\n\t\tlist.add(new RawDataBlock(new ByteArrayInputStream(data)));\r\n\t\tlist.fill(1);\r\n\t\tint[] blocks = { 0 };\r\n\t\tBlockAllocationTableReader table = new BlockAllocationTableReader(\r\n\t\t POIFSConstants.SMALLER_BIG_BLOCK_SIZE_DETAILS, 1, blocks, 0, -2, list);\r\n\t\tint[] start_blocks = { -2, 1, 2, 3, 5, 7, 9, 11, 12 };\r\n\t\tint[] expected_length = { 0, 1, -1, -1, -1, -1, -1, -1, 116 };\r\n\r\n\t\tfor (int j = 0; j < start_blocks.length; j++) {\r\n\t\t\ttry {\r\n\t\t\t\tListManagedBlock[] dataBlocks = table.fetchBlocks(start_blocks[j], -1, list);\r\n\r\n\t\t\t\tif (expected_length[j] == -1) {\r\n\t\t\t\t\tfail(\"document \" + j + \" should have failed, but found a length of \"\r\n\t\t\t\t\t\t\t+ dataBlocks.length);\r\n\t\t\t\t} else {\r\n\t\t\t\t\tassertEquals(expected_length[j], dataBlocks.length);\r\n\t\t\t\t}\r\n\t\t\t} catch (IOException e) {\r\n\t\t\t\tif (expected_length[j] == -1) {\r\n\r\n\t\t\t\t\t// no problem, we expected a failure here\r\n\t\t\t\t} else {\r\n\t\t\t\t\tthrow e;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t}", "BlockStore getBlockStore();", "public ArrayList<Block> getBlocks() {\r\n return blocks;\r\n }", "@Override\n\tpublic List<Address> FindAllAddress() {\n\t\treturn ab.FindAll();\n\t}", "public List<Block> blocks() {\n this.blocks = createBlocks();\n return this.blocks;\n }", "public Block[] getAllBlocks(){\n\t\tBlock[] arr = new Block[tail];\n\t\tfor(int x = 0; x < tail; x++)\n\t\t\tarr[x] = ds[x];\n\t\treturn arr;\n\t}", "public List<VeinBlock> getAliasedBlocks() {\n\t\treturn new ArrayList<>(blocks);\n\t}", "private void loadAddresses() {\n\t\ttry {\n\t\t\torg.hibernate.Session session = sessionFactory.getCurrentSession();\n\t\t\tsession.beginTransaction();\n\t\t\taddresses = session.createCriteria(Address.class).list();\n\t\t\tsession.getTransaction().commit();\n\t\t\tSystem.out.println(\"Retrieved addresses from database:\"\n\t\t\t\t\t+ addresses.size());\n\t\t} catch (Throwable ex) {\n\t\t\tSystem.err.println(\"Can't retrieve address!\" + ex);\n\t\t\tex.printStackTrace();\n\t\t\t// Initialize the message queue anyway\n\t\t\tif (addresses == null) {\n\t\t\t\taddresses = new ArrayList<Address>();\n\t\t\t}\n\t\t}\n\t}", "List<Block> getBlocks(String congName, String[] blockArray);", "public void SetBlockList() {\r\n int width = ScreenWidth / MatrixWidth;\r\n int hight = ScreenHeight / MatrixHeight;\r\n this.blockList = new BlockList();\r\n Bitmap blocks = Bitmap.createScaledBitmap(BitmapFactory.decodeResource(getResources(), R.drawable.blocks), width * 5, hight * 10, false);\r\n for (int i = 0; i < map.length; i++) {\r\n for (int j = 0; j < map[i].length; j++) {\r\n if(i==0 && j<3){//if its true so its wall or button so the type of block is 0\r\n this.blockList.AddBlock(i, j, 0, j, blocks, width, hight);\r\n }\r\n if (map[i][j] != '0')\r\n this.blockList.AddBlock(i, j, Integer.valueOf(String.valueOf(map[i][j])), 0, blocks, width, hight);\r\n }\r\n }\r\n }", "public List<Block> blocks() {\r\n List<Block> list = new ArrayList<Block>();\r\n double width = 50;\r\n for (int i = 0; i < 7; ++i) {\r\n Color c = new Color(0, 0, 0);\r\n switch (i) {\r\n case 0:\r\n c = Color.gray;\r\n break;\r\n case 1:\r\n c = Color.red;\r\n break;\r\n case 2:\r\n c = Color.yellow;\r\n break;\r\n case 3:\r\n c = Color.green;\r\n break;\r\n case 4:\r\n c = Color.white;\r\n break;\r\n case 5:\r\n c = Color.pink;\r\n break;\r\n default:\r\n c = Color.cyan;\r\n break;\r\n }\r\n for (int j = 0; j < 15; ++j) {\r\n Block b = new Block(new Rectangle(new Point(\r\n 25 + j * width, 100 + i * 20), width, 20));\r\n if (i == 0) {\r\n b.setHitPoints(2);\r\n } else {\r\n b.setHitPoints(1);\r\n }\r\n list.add(b);\r\n }\r\n }\r\n return list;\r\n }", "@NotNull\n List<Tx> txs(@NotNull String address, long startBlock, long endBlock) throws EtherScanException;", "Collection<BuildingBlock> findAllBuildingBlocks() throws BusinessException;", "Block getBlockByNumber(long number);", "public Collection<Block> getBlockCollection() {\n\t\treturn this.blocks.values();\n\t}", "phaseI.Hdfs.BlockLocations getBlockInfo();", "public List<Address> getAllAddresses() throws BackendException;", "private Set<Long> addSomeBlocks(Map<BlockStoreLocation, List<Long>> blockMap) {\n long blockId = 100L;\n Set<Long> added = new HashSet<>();\n // 1 block is added into each location\n for (Map.Entry<BlockStoreLocation, List<Long>> entry : blockMap.entrySet()) {\n List<Long> blocks = entry.getValue();\n added.add(blockId);\n blocks.add(blockId);\n blockId++;\n }\n return added;\n }", "public Block[] getBlocks() {\n\t\treturn blocks;\n\t}", "public int getBlockNumbers(int index) {\n return blockNumbers_.get(index);\n }", "public int getBlockNumbers(int index) {\n return blockNumbers_.get(index);\n }", "@NotNull\n List<TxInternal> txsInternal(@NotNull String address, long startBlock, long endBlock) throws EtherScanException;", "public Array<BlockDrawable> getAllBlocksToDraw() {\r\n \tArray<BlockDrawable> blocksToDraw = new Array<BlockDrawable>();\r\n\t\tblocksToDraw.addAll(tablero);\r\n\t\tif(isGhostActivated()){\r\n\t\t\tblocksToDraw.addAll(getGhostBlocksToDraw());\r\n\t\t}\r\n\t\tif (hasFalling())\r\n\t\t\tblocksToDraw.addAll(falling.allOuterBlocks());\r\n\t\t\r\n\t\treturn blocksToDraw;\r\n }", "@Override\n public List<Block> blocks() {\n int columns = 15, width = 51, height = 30;\n Color darkGreen = new Color(29, 101, 51);\n List<Block> blocks = new ArrayList<>();\n for (int j = 0; j < columns; j++) {\n blocks.add(new Block(new arkanoid.geometry.Rectangle(new Point(20 + width * j, 110 + height),\n width, height), darkGreen));\n }\n return blocks;\n }", "public java.util.List<java.lang.Integer>\n getBlockNumbersList() {\n return blockNumbers_;\n }", "@Override\n\tpublic List<LatLng> findByBlockIds(List<String> blocks) throws Exception {\n\t\tBikeExample bikeExample = new BikeExample();\n\t\tBikeExample.Criteria criteria = bikeExample.createCriteria();\n\t\tcriteria.andBikeBlockIn(blocks);\n\t\tcriteria.andBikeDelEqualTo(0);\n\t\tcriteria.andBikeStateEqualTo(0);\n\t\tbikeExample.setLimitStart(0);\n\t\tbikeExample.setLimitEnd(500);\n\t\treturn bikeMapper.selectBikesLatLng(bikeExample);\n\t}", "public BlockType[] getBlocks() {\n return blocks;\n }", "@Override\n public List<Block> blocks() {\n List<Block> blocksList = new ArrayList<Block>();\n\n //Setting the blocks\n for (int j = 0; j <= 14; j++) {\n if (j == 0 || j == 1) {\n blocksList.add(new Block(new Rectangle(\n new Point(730 - j * 50.6666667, 215), 51, 25), java.awt.Color.CYAN));\n } else if (j == 2 || j == 3) {\n blocksList.add(new Block(new Rectangle(\n new Point(730 - j * 50.6666667, 215), 51, 25), java.awt.Color.PINK));\n } else if (j == 4 || j == 5) {\n blocksList.add(new Block(new Rectangle(\n new Point(730 - j * 50.6666667, 215), 51, 25), java.awt.Color.BLUE));\n } else if (j == 6 || j == 7 || j == 8) {\n blocksList.add(new Block(new Rectangle(\n new Point(730 - j * 50.6666667, 215), 51, 25), java.awt.Color.GREEN));\n } else if (j == 9 || j == 10) {\n blocksList.add(new Block(new Rectangle(\n new Point(730 - j * 50.6666667, 215), 51, 25), java.awt.Color.YELLOW));\n } else if (j == 11 || j == 12) {\n blocksList.add(new Block(new Rectangle(\n new Point(730 - j * 50.6666667, 215), 51, 25), java.awt.Color.ORANGE));\n } else if (j == 13 || j == 14) {\n blocksList.add(new Block(new Rectangle(\n new Point(730 - j * 50.6666667, 215), 51, 25), java.awt.Color.RED));\n }\n }\n\n return blocksList;\n }", "java.util.List<? extends phaseI.Hdfs.BlockLocationsOrBuilder> \n getBlockLocationsOrBuilderList();", "public int getBlockLocationsCount() {\n return blockLocations_.size();\n }", "@GetMapping(\"/getallblock\")\n\tpublic List<StudentRegistration> getAllBlockStudent() {\n\t\treturn srepo.findByStatus(\"blocked\");\n\t}", "protected List<Block> findItems(IPascalCoinClient client, Integer start, Integer pageSize) {\n Integer blockFirst = start;\r\n Integer blockLast = blockFirst + pageSize - 1;\r\n //pageSize-1 because blockLast is inclusive and we want an exact page size\r\n //#debug\r\n toDLog().pData(\"blockFirst=\" + blockFirst + \" blockLast=\" + blockLast + \" pageSize=\" + pageSize, this, ListTaskBlockRange.class, \"findItems\", LVL_04_FINER, true);\r\n List<Block> blocks = client.getBlocks(blockLastMustBeNull, blockFirst, blockLast);\r\n if (isAscendingOrder()) {\r\n Collections.reverse(blocks);\r\n }\r\n return blocks;\r\n }", "public byte[][][] getBlockDatas() {\n \t\treturn this.blockDatas;\n \t}", "List<Block> search(String searchTerm);", "public List<AbstractIndex> loadAndGetBlocks(List<TableBlockInfo> tableBlocksInfos,\n AbsoluteTableIdentifier absoluteTableIdentifier) throws IndexBuilderException {\n List<AbstractIndex> loadedBlocksList =\n new ArrayList<AbstractIndex>(CarbonCommonConstants.DEFAULT_COLLECTION_SIZE);\n addTableLockObject(absoluteTableIdentifier);\n // sort the block infos\n // so block will be loaded in sorted order this will be required for\n // query execution\n Collections.sort(tableBlocksInfos);\n // get the instance\n Object lockObject = tableLockMap.get(absoluteTableIdentifier);\n Map<TableBlockInfo, AbstractIndex> tableBlockMapTemp = null;\n // Acquire the lock to ensure only one query is loading the table blocks\n // if same block is assigned to both the queries\n synchronized (lockObject) {\n tableBlockMapTemp = tableBlocksMap.get(absoluteTableIdentifier);\n // if it is loading for first time\n if (null == tableBlockMapTemp) {\n tableBlockMapTemp = new ConcurrentHashMap<TableBlockInfo, AbstractIndex>();\n tableBlocksMap.put(absoluteTableIdentifier, tableBlockMapTemp);\n }\n }\n AbstractIndex tableBlock = null;\n DataFileFooter footer = null;\n try {\n for (TableBlockInfo blockInfo : tableBlocksInfos) {\n // if table block is already loaded then do not load\n // that block\n tableBlock = tableBlockMapTemp.get(blockInfo);\n // if block is not loaded\n if (null == tableBlock) {\n // check any lock object is present in\n // block info lock map\n Object blockInfoLockObject = blockInfoLock.get(blockInfo);\n // if lock object is not present then acquire\n // the lock in block info lock and add a lock object in the map for\n // particular block info, added double checking mechanism to add the lock\n // object so in case of concurrent query we for same block info only one lock\n // object will be added\n if (null == blockInfoLockObject) {\n synchronized (blockInfoLock) {\n // again checking the block info lock, to check whether lock object is present\n // or not if now also not present then add a lock object\n blockInfoLockObject = blockInfoLock.get(blockInfo);\n if (null == blockInfoLockObject) {\n blockInfoLockObject = new Object();\n blockInfoLock.put(blockInfo, blockInfoLockObject);\n }\n }\n }\n //acquire the lock for particular block info\n synchronized (blockInfoLockObject) {\n // check again whether block is present or not to avoid the\n // same block is loaded\n //more than once in case of concurrent query\n tableBlock = tableBlockMapTemp.get(blockInfo);\n // if still block is not present then load the block\n if (null == tableBlock) {\n // getting the data file meta data of the block\n footer = CarbonUtil\n .readMetadatFile(blockInfo.getFilePath(), blockInfo.getBlockOffset(),\n blockInfo.getBlockLength());\n tableBlock = new BlockIndex();\n footer.setTableBlockInfo(blockInfo);\n // building the block\n tableBlock.buildIndex(Arrays.asList(footer));\n tableBlockMapTemp.put(blockInfo, tableBlock);\n // finally remove the lock object from block info lock as once block is loaded\n // it will not come inside this if condition\n blockInfoLock.remove(blockInfo);\n }\n }\n }\n loadedBlocksList.add(tableBlock);\n }\n } catch (CarbonUtilException e) {\n LOGGER.error(\"Problem while loading the block\");\n throw new IndexBuilderException(e);\n }\n return loadedBlocksList;\n }", "protected Set locateBlock(final String blockName) {\n Set matches = new java.util.HashSet();\n for (Iterator it = blocks.keySet().iterator(); it.hasNext(); ) {\n Object b = it.next();\n if (b.toString().endsWith('.' + blockName)) {\n matches.add(b);\n }\n }\n return matches;\n }", "public List<UrlAddress> searchDBUrl() {\n log.info(new SimpleDateFormat(\"yyyy/MM/dd HH:mm:ss\").format(new Date()) + \"find all url address\");\n List<UrlAddress> all = urlRepository.findAll();\n return all;\n }", "public MemoryBlock getBlock(Boolean trackStats, Integer bAddress, Integer size){\r\n\t\tif(DEBUG_LEVEL >= 1)System.out.println(\"Memory.getBlock(\" + bAddress + \", \" + size + \")\");\r\n\t\t\r\n\t\t// Validation\r\n\t\tif(bAddress == null)throw new NullPointerException(\"bAddress Can Not Be Null\");\r\n\t\tif(bAddress < 0)throw new ArrayIndexOutOfBoundsException(\"bAddress Must Be Positive\");\r\n\t\t\r\n\t\tif(size == null)throw new NullPointerException(\"size Can Not Be Null\");\r\n\t\tif(size < 1)throw new ArrayIndexOutOfBoundsException(\"size Must Be Greater Than Zero\");\r\n\t\t\r\n\t\tif(trackStats)cacheStats.ACCESS++;\r\n\t\t\r\n\t\t// MemoryBlock to Return\r\n\t\tMemoryBlock newMB = new MemoryBlock(size, bAddress);\r\n\t\t\r\n\t\tif(DEBUG_LEVEL >= 4)System.out.println(\"Memory.getBlock()...Starting at \" + bAddress + \" Going to \" + (bAddress + size - 1));\r\n\t\t\r\n\t\t// Load Memory Block to Return\r\n\t\tfor(int i = bAddress; i < bAddress + size; i++){\r\n\t\t\tif(memory[i] == null){\r\n\t\t\t\tif(DEBUG_LEVEL >= 5)System.out.println(\"Memory.getBlock()...memory[\" + i + \"] MISS, Creating MemoryBlock\");\r\n\t\t\t\tmemory[i] = new MemoryElement(i, (byte)0);\r\n\t\t\t}else{\r\n\t\t\t\tif(DEBUG_LEVEL >= 5)System.out.println(\"Memory.getBlock()...memory[\" + i + \"] HIT\");\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tInteger offset = i % size;\r\n\t\t\t\r\n\t\t\tnewMB.setElement(offset, memory[i].clone());\r\n\t\t}\r\n\t\t\r\n\t\tif(trackStats)cacheStats.BLOCKREAD_HIT++;\r\n\t\t\r\n\t\tif(DEBUG_LEVEL >= 2)System.out.println(\"Memory.getBlock()...Finished\");\r\n\t\t\r\n\t\treturn newMB;\r\n\t}", "public List<ByteString> getBlocksBuffers() {\n final ByteString blocksBuf = getBlocksBuffer();\n final List<ByteString> buffers;\n final int size = blocksBuf.size();\n if (size <= CHUNK_SIZE) {\n buffers = Collections.singletonList(blocksBuf);\n } else {\n buffers = new ArrayList<ByteString>();\n for (int pos=0; pos < size; pos += CHUNK_SIZE) {\n // this doesn't actually copy the data\n buffers.add(blocksBuf.substring(pos, Math.min(pos+CHUNK_SIZE, size)));\n }\n }\n return buffers;\n }", "public java.util.List<phaseI.Hdfs.BlockLocations> getBlockLocationsList() {\n if (blockLocationsBuilder_ == null) {\n return java.util.Collections.unmodifiableList(blockLocations_);\n } else {\n return blockLocationsBuilder_.getMessageList();\n }\n }", "abstract public ByteString getBlocksBuffer();", "public int getBlockNumbersCount() {\n return blockNumbers_.size();\n }", "private void updateBlockBuffer() {\n for (Block b : blockBuffer) {\n if (++b.ttl > BLOCK_CACHE_THRESH) {\n blockBuffer.remove(b);\n }\n }\n\n prevBlockBufferSize = blockBuffer.size();\n }", "public Response getBlock(int row) {\n return blockList.get(row);\n }", "@Override\n public List<UTXO> getOpenTransactionOutputs(List<Address> addresses) throws UTXOProviderException {\n\n List<UTXO> results = new LinkedList<UTXO>();\n for (Address a : addresses) {\n ByteBuffer bb = ByteBuffer.allocate(21);\n bb.put((byte) KeyType.ADDRESS_HASHINDEX.ordinal());\n bb.put(a.getHash160());\n\n ReadOptions ro = new ReadOptions();\n Snapshot sn = db.getSnapshot();\n ro.snapshot(sn);\n\n // Scanning over iterator very fast\n\n DBIterator iterator = db.iterator(ro);\n for (iterator.seek(bb.array()); iterator.hasNext(); iterator.next()) {\n ByteBuffer bbKey = ByteBuffer.wrap(iterator.peekNext().getKey());\n bbKey.get(); // remove the address_hashindex byte.\n byte[] addressKey = new byte[20];\n bbKey.get(addressKey);\n if (!Arrays.equals(addressKey, a.getHash160())) {\n break;\n }\n byte[] hashBytes = new byte[32];\n bbKey.get(hashBytes);\n int index = bbKey.getInt();\n Sha256Hash hash = Sha256Hash.wrap(hashBytes);\n UTXO txout;\n try {\n // TODO this should be on the SNAPSHOT too......\n // this is really a BUG.\n txout = getTransactionOutput(hash, index);\n } catch (BlockStoreException e) {\n throw new UTXOProviderException(\"block store execption\", e);\n }\n if (txout != null) {\n Script sc = txout.getScript();\n Address address = sc.getToAddress(params, true);\n UTXO output = new UTXO(txout.getHash(), txout.getIndex(), txout.getValue(), txout.getHeight(),\n txout.isCoinbase(), txout.getScript(), address.toString());\n results.add(output);\n }\n }\n try {\n iterator.close();\n ro = null;\n sn.close();\n sn = null;\n } catch (IOException e) {\n log.error(\"Error closing snapshot/iterator?\", e);\n }\n }\n return results;\n }", "phaseI.Hdfs.BlockLocationsOrBuilder getBlockInfoOrBuilder();", "public ChannelFuture block(InetAddress multicastAddress, InetAddress sourceToBlock) {\n/* 571 */ return block(multicastAddress, sourceToBlock, newPromise());\n/* */ }", "phaseI.Hdfs.BlockLocations getNewBlock();", "public phaseI.Hdfs.BlockLocations getBlockLocations(int index) {\n return blockLocations_.get(index);\n }", "Set<MacAddress> neighbors();", "private List<Messages.Address> mapModelAddressToWireAddress(List<byte[]> addresses) {\n return addresses.stream().map(address -> Messages.Address.newBuilder()\n .setPort(6565)\n .setIpAddress(ByteString.copyFrom(address))\n .build())\n .collect(Collectors.toList());\n }", "private void getBlockListNetworkCall(final Context context, int offset, int limit) {\n\n HashMap<String, Object> serviceParams = new HashMap<String, Object>();\n HashMap<String, Object> tokenServiceHeaderParams = new HashMap<String, Object>();\n\n tokenServiceHeaderParams.put(Keys.TOKEN, UserSharedPreference.readUserToken());\n serviceParams.put(Keys.LIST_OFFSET, offset);\n serviceParams.put(Keys.LIST_LIMIT, limit);\n\n new WebServicesVolleyTask(context, false, \"\",\n EnumUtils.ServiceName.get_blocked_user,\n EnumUtils.RequestMethod.GET, serviceParams, tokenServiceHeaderParams, new AsyncResponseCallBack() {\n\n @Override\n public void onTaskComplete(TaskItem taskItem) {\n\n if (taskItem != null) {\n\n if (taskItem.isError()) {\n if (getUserVisibleHint())\n showNoResult(true);\n } else {\n try {\n\n if (taskItem.getResponse() != null) {\n\n JSONObject jsonObject = new JSONObject(taskItem.getResponse());\n\n // todo parse actual model\n JSONArray favoritesJsonArray = jsonObject.getJSONArray(\"users\");\n\n Gson gson = new Gson();\n Type listType = new TypeToken<List<BlockUserBO>>() {\n }.getType();\n List<BlockUserBO> newStreams = (List<BlockUserBO>) gson.fromJson(favoritesJsonArray.toString(),\n listType);\n\n totalRecords = jsonObject.getInt(\"total_records\");\n if (totalRecords == 0) {\n showNoResult(true);\n } else {\n if (blockListAdapter != null) {\n if (startIndex != 0) {\n //for the case of load more...\n blockListAdapter.removeLoadingItem();\n } else {\n //for the case of pulltoRefresh...\n blockListAdapter.clearItems();\n }\n }\n\n showNoResult(false);\n setUpBlockListRecycler(newStreams);\n }\n }\n } catch (Exception ex) {\n showNoResult(true);\n ex.printStackTrace();\n }\n }\n }\n }\n });\n }", "Block getBlock(String congName, String blockName, String blockNumber);", "Set<? extends IRBasicBlock> getBlocks();", "@Override\n public OffsetRange getBlockRange() {\n return blockRange;\n }", "@NotNull\n List<TxErc1155> txsErc1155(@NotNull String address, long startBlock, long endBlock) throws EtherScanException;", "public void blocksAdded(List<Response> blocks) {\n for (Response block : blocks) {\n try {\n long id = block.getId(\"block\");\n blockList.add(block);\n blockMap.put(id, block);\n } catch (IdentifierException exc) {\n // Ignore the block\n }\n }\n fireTableDataChanged();\n }", "private void readBlocks(List<Element> blockElements, Model model)\n throws ObjectExistsException {\n // Add the blocks.\n for (int i = 0; i < blockElements.size(); i++) {\n Element curBlockElement = blockElements.get(i);\n Integer blockID;\n try {\n blockID = Integer.valueOf(curBlockElement.getAttributeValue(\"id\"));\n }\n catch (NumberFormatException e) {\n blockID = null;\n }\n Block curBlock = model.createBlock(blockID);\n TCSObjectReference<Block> blockRef = curBlock.getReference();\n String blockName = curBlockElement.getAttributeValue(\"name\");\n if (blockName == null || blockName.isEmpty()) {\n blockName = \"BlockName\" + i + \"Unknown\";\n }\n model.getObjectPool().renameObject(curBlock.getReference(), blockName);\n // Add members.\n List<Element> memberElements = curBlockElement.getChildren(\"member\");\n for (int j = 0; j < memberElements.size(); j++) {\n Element curMemberElement = memberElements.get(j);\n String memberName = curMemberElement.getAttributeValue(\"name\");\n if (memberName == null || memberName.isEmpty()) {\n memberName = \"MemberName\" + j + \"Unknown\";\n }\n TCSResource<?> curMember\n = (TCSResource<?>) model.getObjectPool().getObject(memberName);\n curBlock.addMember(curMember.getReference());\n }\n List<Element> properties = curBlockElement.getChildren(\"property\");\n for (int k = 0; k < properties.size(); k++) {\n Element curPropElement = properties.get(k);\n String curKey = curPropElement.getAttributeValue(\"name\");\n if (curKey == null || curKey.isEmpty()) {\n curKey = \"Key\" + k + \"Unknown\";\n }\n String curValue = curPropElement.getAttributeValue(\"value\");\n if (curValue == null || curValue.isEmpty()) {\n curValue = \"Value\" + k + \"Unknown\";\n }\n model.getObjectPool().setObjectProperty(blockRef, curKey, curValue);\n }\n }\n }", "public ArrayList<Block> getBlocks() {\n ArrayList<Block> blocks = new ArrayList<>();\n\n for (Vector2D pos : template) {\n blocks.add(new Block(pos.addVectorGetNewVector(center), this.color));\n }\n return blocks;\n }", "public int getBlockNumbersCount() {\n return blockNumbers_.size();\n }", "public List<BlockID> getLogList()\n {\n return logBlocks;\n }", "@RequestMapping(value = \"getBlocks\", method = RequestMethod.GET)\r\n\t@ResponseBody\r\n\tpublic BlockListResponseDTO getBlocks() {\r\n\t\tBlockListResponseDTO response = new BlockListResponseDTO();\r\n\t\ttry {\r\n\t\t\tresponse = blockService.getBlocks();\r\n\t\t} catch (ServiceException e) {\r\n\r\n\t\t\tList<Parameter> parameters = e.getParamList();\r\n\t\t\tErrorDTO error = new ErrorDTO();\r\n\t\t\terror.setErrCode(e.getError().getErrCode());\r\n\t\t\terror.setParams(parameters);\r\n\t\t\terror.setDisplayErrMsg(e.isDisplayErrMsg());\r\n\t\t\tresponse.setError(error);\r\n\t\t\tresponse.setSuccess(false);\r\n\r\n\t\t}\r\n\t\treturn response;\r\n\t}", "protected abstract void allocateBlocks(int numBlocks);", "@GetMapping ( value = {\"/block/{from}/{to}\", \"/block/{from}\"} )\n\tpublic Set<String> getBlock ( @PathVariable ( name = \"from\", required = true) String from,\n\t\t\t@PathVariable ( name = \"to\", required = false) List<String> to ) {\n\t\tif ( to == null ) {\n\t\t\treturn blocksService.allBlocks(from);\n\t\t} else {\n\t\t\treturn blocksService.allBlocks(from, to);\n\t\t}\n\t\t\n\t}", "@NotNull\n List<Balance> balances(@NotNull List<String> addresses) throws EtherScanException;", "public Block accessBlock(int i){\n\t\treturn blocks[i]; \n\t}", "public ArrayList<Block> getAdj (Block b) { // gets the adjacent blocks\n\t\tArrayList<Block> neighbors = new ArrayList<Block> ();\n\t\tif (b.x+1 < size) neighbors.add(get(b.x+1, b.y, b.z));\n\t\tif (b.x-1 > -1) neighbors.add(get(b.x-1, b.y, b.z));\n\t\tif (b.y+1 < size) neighbors.add(get(b.x, b.y+1, b.z));\n\t\tif (b.y-1 > -1) neighbors.add(get(b.x, b.y-1, b.z));\n\t\tif (b.z+1 < size) neighbors.add(get(b.x, b.y, b.z+1));\n\t\tif (b.z-1 > -1) neighbors.add(get(b.x, b.y, b.z-1));\n\t\treturn neighbors;\n\t}", "Collection<BuildingBlock> findBuildingBlocksbyBranchId(Long branchId) throws BusinessException;", "@Override\n\tpublic long getFreeBlocks() {\n\t\treturn 0;\n\t}", "void scanblocks() {\n\t\tint oldline, newline;\n\t\tint oldfront = 0; // line# of front of a block in old, or 0\n\t\tint newlast = -1; // newline's value during prev. iteration\n\n\t\tfor (oldline = 1; oldline <= oldinfo.maxLine; oldline++)\n\t\t\tblocklen[oldline] = 0;\n\t\tblocklen[oldinfo.maxLine + 1] = UNREAL; // starts a mythical blk\n\n\t\tfor (oldline = 1; oldline <= oldinfo.maxLine; oldline++) {\n\t\t\tnewline = oldinfo.other[oldline];\n\t\t\tif (newline < 0)\n\t\t\t\toldfront = 0; /* no match: not in block */\n\t\t\telse { /* match. */\n\t\t\t\tif (oldfront == 0)\n\t\t\t\t\toldfront = oldline;\n\t\t\t\tif (newline != (newlast + 1))\n\t\t\t\t\toldfront = oldline;\n\t\t\t\t++blocklen[oldfront];\n\t\t\t}\n\t\t\tnewlast = newline;\n\t\t}\n\t}", "public java.util.List<phaseI.Hdfs.BlockLocations> getBlockLocationsList() {\n return blockLocations_;\n }", "int getActiveBlockRequestsNumber() {\n return blockRequests.size();\n }", "@NotNull\n List<TxErc20> txsErc20(@NotNull String address, long startBlock, long endBlock) throws EtherScanException;", "public static List<Hit> getHubHits(Block paramBlock)\r\n/* 55: */ {\r\n/* 56: 83 */ return null;\r\n/* 57: */ }", "public java.util.List<? extends phaseI.Hdfs.BlockLocationsOrBuilder> \n getBlockLocationsOrBuilderList() {\n if (blockLocationsBuilder_ != null) {\n return blockLocationsBuilder_.getMessageOrBuilderList();\n } else {\n return java.util.Collections.unmodifiableList(blockLocations_);\n }\n }", "public Map<CeloContract, String> allAddresses() {\n for (CeloContract contract : CeloContract.values()) {\n this.addressFor(contract);\n }\n return cache;\n }", "public List<Address> findAll();", "public java.util.List<java.lang.Integer>\n getBlockNumbersList() {\n return java.util.Collections.unmodifiableList(blockNumbers_);\n }", "private static List<Element> getXMLBlocks(Model model) {\n Set<Block> blocks = new TreeSet<>(Comparators.objectsById());\n blocks.addAll(model.getBlocks(null));\n List<Element> result = new ArrayList<>(blocks.size());\n for (Block curBlock : blocks) {\n Element blockElement = new Element(\"block\");\n blockElement.setAttribute(\"id\", String.valueOf(curBlock.getId()));\n blockElement.setAttribute(\"name\", curBlock.getName());\n for (TCSResourceReference<?> curRef : curBlock.getMembers()) {\n Element resourceElement = new Element(\"member\");\n resourceElement.setAttribute(\"name\", curRef.getName());\n blockElement.addContent(resourceElement);\n }\n for (Map.Entry<String, String> curEntry\n : curBlock.getProperties().entrySet()) {\n Element propertyElement = new Element(\"property\");\n propertyElement.setAttribute(\"name\", curEntry.getKey());\n propertyElement.setAttribute(\"value\", curEntry.getValue());\n blockElement.addContent(propertyElement);\n }\n result.add(blockElement);\n }\n return result;\n }", "public ChannelFuture block(InetAddress multicastAddress, NetworkInterface networkInterface, InetAddress sourceToBlock) {\n/* 525 */ return block(multicastAddress, networkInterface, sourceToBlock, newPromise());\n/* */ }", "public phaseI.Hdfs.BlockLocations getBlockLocations(int index) {\n if (blockLocationsBuilder_ == null) {\n return blockLocations_.get(index);\n } else {\n return blockLocationsBuilder_.getMessage(index);\n }\n }", "public void list() {\r\n\t\tfor (String key : nodeMap.keySet()) {\r\n\t\t\tNodeRef node = nodeMap.get(key);\r\n\t\t\tSystem.out.println(node.getIp() + \" : \" + node.getPort());\r\n\t\t}\t\t\r\n\t}", "public BlockChain() {\n this.blockChain = new ArrayList<>();\n this.chainHash = \"\";\n }" ]
[ "0.6462699", "0.6278456", "0.6007472", "0.5981974", "0.59254754", "0.5863301", "0.57828826", "0.5772644", "0.5752266", "0.56827605", "0.56663257", "0.5660801", "0.5628569", "0.5583668", "0.556882", "0.5544954", "0.5542784", "0.55413663", "0.5524033", "0.5518783", "0.5499514", "0.54939854", "0.5493208", "0.54719853", "0.54610336", "0.54501367", "0.5439123", "0.5438625", "0.54335386", "0.5432198", "0.54159313", "0.54139745", "0.5401123", "0.53823644", "0.5376086", "0.53576386", "0.5344053", "0.53312314", "0.5274497", "0.5257921", "0.5253028", "0.52413684", "0.52410686", "0.5224625", "0.5218847", "0.51596105", "0.51551765", "0.5151234", "0.51483256", "0.5146618", "0.5140349", "0.5135359", "0.5118888", "0.510239", "0.5093899", "0.5090011", "0.5082632", "0.50736904", "0.5059671", "0.50576013", "0.50553405", "0.504927", "0.50434107", "0.5037138", "0.5034535", "0.5033165", "0.502646", "0.5023517", "0.50133497", "0.5002734", "0.49995053", "0.49977496", "0.49961317", "0.49961054", "0.49961007", "0.4989856", "0.49895495", "0.4981822", "0.49762532", "0.49708524", "0.49658746", "0.49624258", "0.49609458", "0.49606723", "0.49554086", "0.4946638", "0.49466354", "0.4941618", "0.49301332", "0.49280643", "0.49246094", "0.49213722", "0.4920003", "0.48955315", "0.48952344", "0.48913014", "0.4875062", "0.4862598", "0.48620135", "0.48592305" ]
0.74490136
0
ViewHolder viewHolder = (ViewHolder) view.getTag();
@Override public void bindView(View view, Context context, Cursor cursor) { int poster_path_index = cursor.getColumnIndex(MovieContract.MovieDetailsEntry.COLUMN_POSTER_PATH); String poster_path = cursor.getString(poster_path_index); String baseURL = "http://image.tmdb.org/t/p/w185" + poster_path; ImageView imageView = (ImageView) view.findViewById(R.id.imageView); if (baseURL.contains("null")) { Picasso.with(context).load(R.drawable.poster_not_available) .resize(185, 200) .into(imageView); } else { if(isNetworkAvailable()) { Picasso.with(context).load(baseURL).into(imageView); // Picasso.with(context).load("http://i.imgur.com/DvpvklR.png").into(imageView }else{ Picasso.with(context) .load(baseURL) .networkPolicy(NetworkPolicy.OFFLINE) .placeholder(R.drawable.error_loading) .into(imageView); } } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public ViewHolder (View view){\n super(view);\n jView = view;\n //tvJoin = (TextView) view.findViewById(R.id.tvGroup);\n tvGroupTitle = view.findViewById(R.id.tvGroupTitle);\n }", "public ViewHolder(View itemView) {\n super(itemView);\n hospname= itemView.findViewById(R.id.hospname);\n address= itemView.findViewById(R.id.hospaddress);\n rrr= itemView.findViewById(R.id.rrrtext);\n hospimage= itemView.findViewById(R.id.hospital_image);\n callambulance= itemView.findViewById(R.id.bookambulancebutton);\n getroom= itemView.findViewById(R.id.bookroombutton);\n /*price= itemView.findViewById(R.id.bedprice);\n cat= itemView.findViewById(R.id.bedcat);\n bedimage= itemView.findViewById(R.id.bedimage);*/\n\n\n }", "public ViewHolder(View itemView) {\n super(itemView);\n imageView = itemView.findViewById(R.id.ivSomeImage);\n textView = itemView.findViewById(R.id.tvSomeText);\n }", "public MyHolder(View itemView) {\n super(itemView);\n item = itemView.findViewById(R.id.item);\n noofpices = itemView.findViewById(R.id.noofpices);\n cost = itemView.findViewById(R.id.cost);\n amount = itemView.findViewById(R.id.total);\n plus = itemView.findViewById(R.id.plus);\n// minus = (ImageButton)itemView.findViewById(R.id.minus);\n delete = itemView.findViewById(R.id.del);\n\n // id= (TextView)itemView.findViewById(R.id.id);\n }", "@Override\n public void onBindViewHolder(MyHolder holder, int position) {\n\n }", "@Override\n public void onBindViewHolder(ViewHolder holder, int position) {\n\n }", "public ViewHolder(View itemView) {\n super(itemView);\n this.productName = itemView.findViewById(R.id.productName);\n// this.productDesc = itemView.findViewById(R.id.productDesc);\n// this.productPrice = itemView.findViewById(R.id.productPrice);\n// this.imageView = itemView.findViewById(R.id.productImage);\n itemView.setOnClickListener(new View.OnClickListener() {\n @Override\n public void onClick(View v) {\n onClickListener.orderType(v, getAdapterPosition());\n }\n });\n }", "public ViewHolder(View itemView) {\n super(itemView);\n /*imgOverFlow = (ImageView) itemView.findViewById(R.id.overflow);*/\n bookThumbnail = (ImageView) itemView.findViewById(R.id.book_thumbnail);\n// bookAuthor= (TextView) itemView.findViewById(R.id.book_author);\n// bookTitle = (TextView) itemView.findViewById(R.id.book_title);\n }", "public ViewHolder(View itemView) {\n super(itemView);\n tvNature = (TextView)itemView.findViewById(R.id.item_name);\n tvAmountNature = (TextView)itemView.findViewById(R.id.item_amount);\n }", "private ViewHolder getViewHolder(final View workingView) {\n\t\tfinal Object tag = workingView.getTag();\n\t\tViewHolder viewHolder = null;\n\n\n\t\tif(null == tag || !(tag instanceof ViewHolder)) {\n\t\t\tviewHolder = new ViewHolder();\n\n\t\t\tviewHolder.button = (Button) workingView.findViewById(R.id.checkOptionButton);\n\t\t\tviewHolder.button.setOnClickListener(this.optionListener);\n\t\t\t\n\n\t\t\tworkingView.setTag(viewHolder);\n\n\t\t} else {\n\t\t\tviewHolder = (ViewHolder) tag;\n\t\t}\n\n\t\treturn viewHolder;\n\t}", "public ViewHolder(View itemView) {\n super(itemView);\n\n listName = (TextView) itemView.findViewById(R.id.listName);\n remainingItems = (TextView) itemView.findViewById(R.id.remainingItems);\n listButtonLayout = (LinearLayout) itemView.findViewById(R.id.listButtonLayout);\n btnView = (Button) listButtonLayout.findViewById(R.id.btnEditList);\n btnDeleteList = (Button) listButtonLayout.findViewById(R.id.btnDeleteList);\n\n\n }", "public ViewHolder(View itemView) {\n super(itemView);\n productDetails = (TextView) itemView.findViewById(R.id.category_item_layout_for_view_product_product_details);\n price = (TextView) itemView.findViewById(R.id.category_item_layout_for_view_product_MRP);\n sp = (TextView) itemView.findViewById(R.id.category_item_layout_for_view_product_SP);\n //qty = (Spinner) itemView.findViewById(R.id.category_item_layout_for_view_product_qty);\n productImage = (ImageView) itemView.findViewById(R.id.category_item_layout_for_view_product_image);\n addToCart = (TextView) itemView.findViewById(R.id.category_item_layout_for_view_product_addToCart);\n }", "public RecyclerCardViewHolder(View itemView) {\n super(itemView);\n ivLsPicture = (ImageView) itemView.findViewById(R.id.ivLsPicture);\n tvTitle = (TextView) itemView.findViewById(R.id.tvTitle);\n // textView5 = (TextView) itemView.findViewById(R.id.textView5);\n }", "protected Object getTag(View view) {\n return view.getTag();\n }", "@Override\n public void onBindViewHolder(ViewHolder holder, int position) {\n Context context = holder.mImageView.getContext();\n DetailItem tag = mTags.get(position);\n // set image\n int id = context.getResources().getIdentifier(\"_item_\" + tag.getItemId(), \"drawable\", context.getPackageName());\n Glide.with(context).load(id).into(holder.mImageView);\n // set name\n holder.mTextNameView.setText(tag.getItemName());\n // set description\n holder.mTextDescriptionView.setText(tag.getItemDescription());\n // set if item is on wishlist\n holder.mButtonAdd.setText(tag.isAdded() ? \"Added to wishlist\" : \"Add to wishlist\");\n }", "@Override\n public ItemViewHolder onCreateViewHolder(ViewGroup viewGroup, int i) {\n itemView = LayoutInflater.from(viewGroup.getContext())\n .inflate(R.layout.item1_list, viewGroup, false);\n\n itemView.setOnClickListener(this);\n context = viewGroup.getContext();\n\n\n\n ItemViewHolder holder = new ItemViewHolder(itemView);\n\n\n\n return holder;\n\n }", "void onItemClicked(View view, int position, StockItemViewHolder viewHolder);", "TextView getTagView();", "ViewHolder(View itemView) {\n super(itemView);\n myImageView = itemView.findViewById(R.id.info_image); // myTextView = itemView.findViewById(R.id.info_text)\n itemView.setOnClickListener(this);\n }", "public OnClickListener(ViewHolder holder){\t\t\t\n\t\t\tmViewHolder = holder;\n\t\t}", "HeadViewHolder(View itemView) {\n super(itemView);\n viewPager = itemView.findViewById(R.id.viewPager);\n// rbContinuous = itemView.findViewById(R.id.rb_continuous);\n// rbDaily = itemView.findViewById(R.id.rb_daily);\n// layoutStyle = itemView.findViewById(R.id.layout_style);\n// tvAdd = itemView.findViewById(R.id.tv_add);\n }", "public NoticiaViewHolder(View itemView) {\n super(itemView);\n itemView.setOnClickListener(this);\n txtTitulo = (TextView) itemView.findViewById(R.id.titulo);\n\n\n }", "public interface ViewHolder {\n}", "public RecyclerViewHolder(View itemView) {\n super(itemView);\n\n cardView = (CardView) itemView.findViewById(R.id.reminder_holder_card_view);\n }", "public ViewHolder(View itemView) {\n tvGrupo = (TextView) itemView.findViewById(R.id.tvGrupo);\n tvNCD = (TextView) itemView.findViewById(R.id.tvNCD);\n tvACD = (TextView) itemView.findViewById(R.id.tvACD);\n ivCD = (ImageView) itemView.findViewById(R.id.ivCD);\n }", "RecyclerView.ViewHolder mo7442e(int i);", "public ViewHolder(View itemView) {\n super(itemView);\n\n tvMessageLeft = (TextView) itemView.findViewById(R.id.tvMessageLeft);\n tvMessageRight = (TextView) itemView.findViewById(R.id.tvMessageRight);\n ivUserIcon = (ImageView) itemView.findViewById(R.id.ivProfPicMessageList);\n // tvTime_stamp = (TextView) itemView.findViewById(R.id.tvTime);\n\n\n //llItemListTop = (LinearLayout) itemView.findViewById(R.id.llListItemTop);\n //llItemListMiddle = (LinearLayout) itemView.findViewById(R.id.llListItemMiddle);\n //llItemListBottom = (LinearLayout) itemView.findViewById(R.id.llListItemTop);\n\n\n }", "public ViewHolder(View itemView) {\n // Stores the itemView in a public final member variable that can be used\n // to access the context from any ViewHolder instance.\n\n super(itemView);\n this.context = context;\n\n\n messageButton = (Button) itemView.findViewById(R.id.message_button);\n\n date_created=(TextView)itemView.findViewById(R.id.date_created);\n volume=(TextView)itemView.findViewById(R.id.volume);\n itemView.setOnClickListener(this);\n\n\n\n }", "MyViewHolder(View itemView)\n {\n super(itemView);\n\n\n name=itemView.findViewById(R.id.name);\n address=itemView.findViewById(R.id.address);\n imgFav=itemView.findViewById(R.id.imgFav);\n stars=itemView.findViewById(R.id.stars);\n liner=itemView.findViewById(R.id.liner);\n totlareview=itemView.findViewById(R.id.totlareview);\n // viewholder.callNow1=convertView.findViewById(R.id.callNow1);\n// viewholder.rating=convertView.findViewById(R.id.rating);\n area=itemView.findViewById(R.id.area);\n distance=itemView.findViewById(R.id.distance);\n imgaeView=itemView.findViewById(R.id.imgaeView);\n flagIcon=itemView.findViewById(R.id.flagIcon);\n linerLayoutOffer=itemView.findViewById(R.id.linerLayoutOffer);\n cardView=itemView.findViewById(R.id.cardView);\n offersText=itemView.findViewById(R.id.offersText);\n subcatListing=itemView.findViewById(R.id.subcatListing);\n\n itemView.setTag(itemView);\n\n\n// recyclerView.setOnTouchListener((View.OnTouchListener) this);\n\n }", "@Override\n public void onBindViewHolder(ViewHolder itemViewHolder, int position) {\n }", "public ViewHolder(View view) {\n super(view);\n mView = view;\n mIdView = (TextView) view.findViewById(R.id.item_number);\n mContentView = (TextView) view.findViewById(R.id.content);\n }", "public MyViewHolder(View itemView)\n {\n super(itemView);\n // get the reference of item view's\n btn_word=(Button)itemView.findViewById(R.id.btn_word);\n }", "public MyViewHolder(View view)\n {\n super(view);\n titleview = (TextView) view.findViewById(R.id.news_title);\n dateView = (TextView) view.findViewById(R.id.dateview);\n\n timeView = (TextView) view.findViewById(R.id.timeview);\n\n }", "public ViewHolder(View view){\n super(view);\n\n artImage = view.findViewById(R.id.thumbnail);\n title = view.findViewById(R.id.headline_title);\n byline = view.findViewById(R.id.byline);\n addDate = view.findViewById(R.id.date_added);\n subText = view.findViewById(R.id.sub_text);\n view.setOnClickListener(this);\n\n }", "@Override\n public void onBindViewHolder(ViewHolder holder, int position) {\n // get type\n int type = holder.getItemViewType();\n SeparatorQuestion item = list.get(position);\n\n //set content list question\n final Question_Info colorObject = (Question_Info) item;\n holder.answer1.setText(colorObject.answer1);\n holder.tag_answer = colorObject.tag_answer;\n\n\n holder.cly.setOnClickListener(new View.OnClickListener() {\n @Override\n public void onClick(View v) {\n addItemFromInternet(colorObject.tag_answer);\n }\n });\n\n }", "public ItemHolder(@NonNull View itemView) {\n super(itemView);\n /*tvNombre=itemView.findViewById(R.id.tvNombre);\n tvCiudad=itemView.findViewById(R.id.etCiudad);\n btBorrar=itemView.findViewById(R.id.btBorrar);\n btEditar=itemView.findViewById(R.id.btEditar);\n cl = itemView.findViewById(R.id.cl);\n ivImagen = itemView.findViewById(R.id.ivImagen);*/\n }", "public ViewHolder(@NonNull View itemView) {\n\n super(itemView);\n mView = itemView;\n\n //This views holds on activity - have actions -\n btn_blog_like = mView.findViewById(R.id.blog_like);\n blogCommentBtn = mView.findViewById(R.id.blog_comment_icon);\n\n }", "public ViewHolder(View itemView) {\n // Stores the itemView in a public final member variable that can be used\n // to access the context from any ViewHolder instance.\n super(itemView);\n\n /* designation_txt = (TextView) itemView.findViewById(R.id.designation_txt);\n name_txt = (TextView) itemView.findViewById(R.id.name_txt);\n number_txt = (TextView) itemView.findViewById(R.id.number_txt);*/\n\n }", "@Override\n public ViewHolder onCreateViewHolder(ViewGroup parent, int viewType) {\n View v = LayoutInflater.from(parent.getContext()).inflate(R.layout.yt_card, parent, false);\n v.setOnClickListener(new View.OnClickListener() {\n @Override\n public void onClick(View view) {\n Toast.makeText(view.getContext(), \"Test\", Toast.LENGTH_LONG).show();\n }\n });\n ViewHolder vh = new ViewHolder(v);\n return vh;\n }", "void convert(ViewHolder holder, T item, int position);", "@Override\n public void onBindViewHolder(Chat_ViewGroupSwipeAdapter.ViewHolder viewHolder, final int position)\n {\n\n\n }", "@Override\n public void onBindViewHolder(ViewHolder holder, final int position) { //Cuando un elemento hace binding\n // - get element from your dataset at this position\n // - replace the contents of the view with that element\n final Track track = values.get(position); //RECUPERA ELEMENTO QUE QUIERES VISUALIZAR\n final ViewHolder vh = holder; //HEMOS TENIDO QUE CREARLA PORQUE ESTA ARRIBA EN LA CLASE Y EN EL REMOVE NO LA PODRIAMOS UTILIZAR\n holder.title.setText(track.getTitle());\n holder.id.setText(track.getSinger());\n holder.title.setOnClickListener(new View.OnClickListener(){\n @Override\n public void onClick(View v) {\n Intent trackview = new Intent(activity.getApplicationContext(), TrackDetailActivity.class);\n trackview.putExtra(\"id\",track.getId());\n trackview.putExtra(\"title\", track.getTitle());\n trackview.putExtra(\"singer\", track.getSinger());\n activity.startActivity(trackview);\n }\n });\n }", "public ViewHolder(@NonNull View view, Context ctx) {\n super(view);\n context = ctx;\n\n taskName = view.findViewById(R.id.item_name);\n taskDescription = itemView.findViewById(R.id.item_description);\n taskPriority = itemView.findViewById(R.id.item_priority);\n dateAdded = itemView.findViewById(R.id.item_date);\n\n editButton = itemView.findViewById(R.id.editButton);\n deleteButton = itemView.findViewById(R.id.deleteButton);\n\n editButton.setOnClickListener(this);\n deleteButton.setOnClickListener(this);\n\n }", "int getItemViewLayoutId();", "@Override\n public void onBindViewHolder(ElementsViewHolder holder, final int position) {\n elements dayIngr =eleList.get(position);\n\n //binding the data with the viewholder views\n // Log.d(\"test\",\"this is ingrType\"+dayIngr.getType());\n\n holder.textViewTitle.setText(dayIngr.getAmount());\n holder.textViewShortDesc.setText(dayIngr.getName());\n\n// holder.itemView.setOnClickListener(new View.OnClickListener() {\n// @Override\n// public void onClick(View v) {\n// Intent intent= new Intent(mContext, MealIngrActivity.class);\n// intent.putExtra(\"DayMeals\",ingrList.get(position).getQuantity());\n// v.getContext().startActivity(intent);\n// }\n// });\n\n// holder.imageView.setImageDrawable(mContext.getResources().getDrawable(dayMeals.getImg()));\n\n\n\n }", "public ViewHolder(View itemView) {\n super(itemView);\n if (mFromSearch) {\n mNameView = (TextView) itemView.findViewById(R.id.single_search_title);\n mTickerView = (TextView) itemView.findViewById(R.id.single_search_ticker);\n } else {\n mNameView = (TextView) itemView.findViewById(R.id.tv_name);\n mPriceView = (TextView) itemView.findViewById(R.id.tv_price);\n }\n itemView.setOnClickListener(this);\n }", "ViewHolder(View itemView) {\n super(itemView);\n //Initialize the views\n imageView = (NetworkImageView) itemView.findViewById(R.id.foto_ustad);\n nama = (TextView) itemView.findViewById(R.id.nama_list);\n alamat = (TextView) itemView.findViewById(R.id.alamat_list);\n bidang = (TextView) itemView.findViewById(R.id.bidang_list);\n harga = (TextView) itemView.findViewById(R.id.hargalist);\n itemView.setOnClickListener(this);\n }", "@Override\n\tpublic View getView(int arg0, View view, ViewGroup arg2) {\n\t\tViewHolder holder;\n\t\tif(view==null){\n\t\t\tview=LayoutInflater.from(cn).inflate(R.layout.chengshi_fragment_showlayout, null);\n\t\t\tholder=new ViewHolder();\n\t\t\tholder.name=(TextView) view.findViewById(R.id.tv_chengshi_name);\n\t\t\tview.setTag(holder);\n\t\t}\n\t\treturn null;\n\t}", "@Override\n public void onBindViewHolder(RecyclerView.ViewHolder holder, final int position) {\n if (holder instanceof ViewHolder) {\n final SubHomeModerImage model = getItem(position);\n final ViewHolder genericViewHolder = (ViewHolder) holder;\n\n //genericViewHolder.txt_quatity.setText(model.getQuantity());\n genericViewHolder.moreitem_check_name.setText(model.getIngredientsName());\n genericViewHolder.txt_price.setText(\"$ \"+model.getIngredientsPrice());\n\n }\n }", "public MyViewHolder(final View itemView) {\n super(itemView);\n\n\n title = (TextView) itemView.findViewById(R.id.title_play_list);\n thumbnail = (ImageView) itemView.findViewById(R.id.thumbnail_play_list);\n\n\n }", "@Override\n public ChatViewHolder onCreateViewHolder(ViewGroup parent, int viewType) {\n View view = LayoutInflater.from(parent.getContext())\n .inflate(R.layout.chat_row, parent, false);\n ctx=view.getContext();\n\n\n ChatViewHolder myViewHolder = new ChatViewHolder(view);\n return myViewHolder;\n }", "@NonNull\n @Override\n public MyBabyRecyclerViewAdapter.MyBabyViewHolder onCreateViewHolder( @NonNull ViewGroup parent, int viewType) {\n View view = LayoutInflater.from(parent.getContext())\n .inflate(R.layout.fragment_baby, parent, false);\n\n //this gives me access to the view\n final MyBabyViewHolder viewHolder = new MyBabyViewHolder(view);\n view.setOnClickListener(new View.OnClickListener() {\n\n\n @Override\n public void onClick(View view) {\n\n Log.i(\"voytov\", viewHolder.baby.name);\n mListener.onClickOnBabyCallback(viewHolder.baby);\n }\n });\n return viewHolder;\n }", "ViewHolder(final View itemView) {\n super(itemView);\n name = (TextView) itemView.findViewById(R.id.Name);\n// address = (TextView) itemView.findViewById(R.id.Address);\n// phone = (TextView) itemView.findViewById(R.id.phone);\n// OrderId = (TextView) itemView.findViewById(R.id.OrderId);\n//// b = (Button) itemView.findViewById(R.id.close);\n//\n itemView.setOnClickListener(this);\n }", "@Override\n public void onBindViewHolder(TorrentsAdapter.ViewHolder viewHolder, int position) {\n // Get the data model based on position\n Torrent torrent = mTorrents.get(position);\n viewHolder.itemView.setTag(R.id.movie_url, torrent);\n // Set item views based on your views and data model\n TextView textView = viewHolder.nameTextView;\n textView.setText(torrent.getName());\n ImageLoader imageLoader = ImageLoader.getInstance();\n ImageView imageView = viewHolder.movieImageView;\n imageLoader.displayImage(torrent.getCoverUrl(), imageView);\n\n\n viewHolder.itemView.setOnClickListener(new View.OnClickListener() {\n @Override\n public void onClick(View v) {\n Torrent torrent = (Torrent) v.getTag(R.id.movie_url);\n Log.d(\"Clicked url\", torrent.getUrl());\n new GetInfoTorrents().execute(torrent, mContext);\n/*\n */\n\n }\n });\n\n\n }", "@Override\n public void onBindViewHolder(OutfitViewHolder viewHolder, final int position) { }", "@Override\n public ViewHolder onCreateViewHolder(ViewGroup arg0, int arg1) {\n\n return new ViewHolder(new TextView(RecyclerViewActivity.this)) {\n\n };\n }", "public ViewHolder(View itemView) {\n // Stores the itemView in a public final member variable that can be used\n // to access the context from any ViewHolder instance.\n super(itemView);\n int position = getAdapterPosition();\n\n\n nameTextView = (TextView) itemView.findViewById(R.id.contact_name);\n messageButton = (Button) itemView.findViewById(R.id.message_button);\n messageButton.setOnClickListener(new ButtonClick(this));\n itemView.setOnClickListener(this);\n\n }", "@Override\n public void onBindViewHolder(@NonNull ViewHolder holder, int position) {\n\n Car carItem= items.get(position);\n\n\n\n }", "@Override\n public NewsFeedViewHolder onCreateViewHolder(ViewGroup parent, int viewType) {\n LayoutInflater inflater = LayoutInflater.from(activity) ;\n// LayoutInflater inflater = activity.getLayoutInflater() ;\n // inflate your layout into view by layout inflater\n View itemView = inflater.inflate(R.layout.news_feed_item , parent , false) ;\n // finally u can make your object from your view holder\n NewsFeedViewHolder newsFeedViewHolder = new NewsFeedViewHolder(itemView) ;\n // dont forget to change nuull with view holder object\n return newsFeedViewHolder;\n }", "@NonNull\n @Override\n public View getView(int position, @Nullable View convertView, @NonNull ViewGroup parent) {\n View v = convertView;\n if (v == null){\n v = LayoutInflater.from(getContext()).inflate(R.layout.list_view_item_tag, null);\n }\n\n// Pegando o item que será carregado\n Tag tag = getItem(position);\n\n// finds dos elementos do layout inflado\n TextView lbl_tag_nome = v.findViewById(R.id.lbl_tag_item);\n\n// setando os valores de cada elemento\n lbl_tag_nome.setText(tag.getNomeTag());\n\n return v;\n }", "public ViewHolder3(View view)\n {\n super(view);\n this.view = view;\n\n this.author = (TextView) view.findViewById(R.id.author);\n this.rate = (TextView) view.findViewById(R.id.vote_by);\n this.content = (TextView) view.findViewById(R.id.my_review);\n }", "@Override\n protected void populateViewHolder(CategoryViewHolder viewHolder, final Category model, int position) {\n viewHolder.name.setText(model.getName());\n Picasso.with(getActivity()).load(model.getImage()).into(viewHolder.image);\n // action View Holder\n viewHolder.setItemClickListener(new ItemClickListener() {\n // method that i create in interface and put it in action of click item in category view holder (to use position )\n @Override\n public void onClick(View view, int position, boolean isLongClick) {\n //get category id from adapter and set in Common.CategoryId\n Common.categoryId=adapter.getRef(position).getKey(); // 01 or 02 or 03 ..... of category\n Common.categoryName=model.getName(); // set name of category to Common variable categoryName\n startActivity(Start.newIntent(getActivity()));// move to StartActivity\n\n }\n });\n\n }", "@Override\n public void onBindViewHolder(RecyclerView.ViewHolder holder, int position) {\n if (holder instanceof AnimalViewHolder) {\n // Subtract 1 to cater for Header View\n final Animal movie = mAnimalList.get(position - 1);\n ((AnimalViewHolder) holder).bindTo(movie);\n } else if (holder instanceof AnimalHeaderViewHolder) {\n\n }\n }", "@Override\n public CategoryView onCreateViewHolder(ViewGroup parent, int viewType){\n View view= LayoutInflater.from(parent.getContext()).inflate(R.layout.card_view,parent,false);\n //create new instance of view holder\n CategoryView viewHolder=new CategoryView(view);\n return viewHolder;\n }", "@Override\n public void onClick(View v) {\n RecyclerViewHolder vholder = (RecyclerViewHolder) v.getTag();\n\n int position = vholder.getPosition();\n\n if(position==0){\n mChapie();\n }\n if(position==1){\n mstrange();\n }\n }", "@Override\n public void onBindViewHolder(@NonNull final ViewHolder holder, int position) {\n\n }", "public MyViewHolder(View itemView) {\n super(itemView);\n\n // get the reference of item view's\n exercise = itemView.findViewById(R.id.exercise);\n }", "public ViewHolder(View itemView) {\n super(itemView);\n ButterKnife.bind(this, itemView);\n\n }", "@Override\r\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\r\n Bundle savedInstanceState) {\r\n\r\n View view = inflater.inflate(R.layout.fragment_category, container, false);\r\n\r\n\r\n recyclerView = (RecyclerView) view.findViewById(R.id.recyclerView);\r\n recyclerView.setHasFixedSize(true);\r\n RecyclerView.LayoutManager layoutManager = new LinearLayoutManager(getActivity().getApplicationContext());\r\n recyclerView.setLayoutManager(layoutManager);\r\n\r\n recyclerView.addOnItemTouchListener(new RecyclerView.OnItemTouchListener() {\r\n final GestureDetector gestureDetector = new GestureDetector(getActivity().getApplicationContext(), new GestureDetector.SimpleOnGestureListener() {\r\n\r\n @Override\r\n public boolean onSingleTapUp(MotionEvent e) {\r\n return true;\r\n }\r\n\r\n });\r\n\r\n @Override\r\n public boolean onInterceptTouchEvent(RecyclerView rv, MotionEvent e) {\r\n\r\n View child = rv.findChildViewUnder(e.getX(), e.getY());\r\n if (child != null && gestureDetector.onTouchEvent(e)) {\r\n rv.getChildAdapterPosition(child);\r\n\r\n }\r\n\r\n return false;\r\n }\r\n\r\n @Override\r\n public void onTouchEvent(RecyclerView rv, MotionEvent e) {\r\n\r\n }\r\n\r\n @Override\r\n public void onRequestDisallowInterceptTouchEvent(boolean disallowIntercept) {\r\n\r\n }\r\n });\r\n\r\n return view;\r\n }", "@Override\n\t\t\tpublic ViewHolder onCreateViewHolder(View itemView) {\n\t\t\t\treturn new MylisViewHoder(itemView);\n\t\t\t}", "@Override\n public ViewHolder onCreateViewHolder(ViewGroup parent, int viewType) {\n View item = LayoutInflater.from(parent.getContext()).inflate(R.layout.item, parent, false);\n// Pasar la vista (item.xml) al ViewHolder\n ViewHolder viewHolder = new ViewHolder(item);\n return viewHolder;\n }", "@Override\n public void onClick(View v) {\n viewModel.holderClicked();\n }", "@RequiresApi(api = Build.VERSION_CODES.LOLLIPOP)\n @Override\n public void onBindViewHolder(final ViewHolder holder, int position) {\n final BusinessCard bc = mValues.get(position);\n\n holder.mNameView.setText(bc.getStrName());\n holder.mContactView.setText(bc.getStrContactName());\n\n// S04M03-13 bind data to new views\n holder.mEmailView.setText(bc.getStrEmail());\n holder.mIDView.setText(bc.getStrId());\n\n holder.mAddressView.setText(bc.getStrAddress());\n holder.mPhoneView.setText(bc.getStrPhone());\n holder.FaxView.setText(bc.getStrFax());\n holder.mTitleView.setText(bc.getStrTitle());\n holder.mWebURLView.setText(bc.getStrWebURL());\n holder.mTitleView.setText(bc.getStrTitle());\n\n\n // holder.mImageView.getLayoutParams().width=1200;\n // holder.mImageView.getLayoutParams().height=2000;\n holder.mImageView.setImageBitmap(NetworkAdapter.getBitmapFromUrl(bc.getStrQRcodeURL()));\n\n holder.itemView.setTag(bc);\n holder.itemView.setOnTouchListener(new View.OnTouchListener() {\n @Override\n public boolean onTouch(View v, MotionEvent event) {\n\n switch (event.getAction()) {\n case MotionEvent.ACTION_DOWN:\n xx = (int) event.getX();\n break;\n case MotionEvent.ACTION_MOVE:\n\n break;\n\n case MotionEvent.ACTION_UP:\n float deltaX = event.getX() - xx;\n if(deltaX>500) {\n bcs.delete(bc.getId());\n Notification.send(v.getContext(), \"deleted\", Integer.toString(bc.getId()));\n\n return true;\n }\n break;\n }\n return false;\n }\n });\n holder.itemView.setOnClickListener(new View.OnClickListener() {\n @TargetApi(Build.VERSION_CODES.LOLLIPOP)\n @RequiresApi(api = Build.VERSION_CODES.JELLY_BEAN)\n @Override\n public void onClick(View view) {\n // S04M03-17 update click listener to pass our object\n BusinessCard item = (BusinessCard) view.getTag();\n if (mTwoPane) {\n Bundle arguments = new Bundle();\n// arguments.putString(ItemDetailFragment.ARG_ITEM_ID, String.valueOf(item.getId())); // put object in intent\n arguments.putParcelable(ItemDetailFragment.ARG_ITEM_ID, item);\n ItemDetailFragment fragment = new ItemDetailFragment();\n fragment.setArguments(arguments);\n mParentActivity.getSupportFragmentManager().beginTransaction()\n .replace(R.id.item_detail_container, fragment)\n .commit();\n } else {\n Context context = view.getContext();\n Intent intent = new Intent(context, ItemDetailActivity.class);\n intent.putExtra(ItemDetailFragment.ARG_ITEM_ID, item); // put object in intent\n\n // S04M03-22 add options to make transition appear\n// Bundle options = ActivityOptions.makeSceneTransitionAnimation((Activity) view.getContext()).toBundle();\n // S04M03-24 change constructor to allow for shared views\n Bundle options = ActivityOptions.makeSceneTransitionAnimation(\n (Activity) view.getContext(),\n holder.mImageView,\n ViewCompat.getTransitionName(holder.mImageView)\n ).toBundle();\n\n context.startActivity(intent, options);\n }\n }\n });\n\n // S04M03-15 call animation method\n setEnterAnimation(holder.parentView, position);\n }", "public ViewHolder(View view) {\n super(view);\n mView = view;\n mTextviewTeamNumber = (TextView) view.findViewById(R.id.textviewTeamNumber);\n mImageViewTeamLogo = (ImageView) view.findViewById(R.id.imageViewTeamLogo);\n mTextViewTeamName = (TextView) view.findViewById(R.id.textViewTeamName);\n mTextViewPlayedGameNumber = (TextView) view.findViewById(R.id.textViewPlayedGameNumber);\n mTextViewTotalPoint = (TextView) view.findViewById(R.id.textViewTotalPoint);\n }", "@Override\n public SearchResultAdapter.ViewHolder onCreateViewHolder(ViewGroup parent,\n int viewType) {\n // create a new view\n View v = LayoutInflater.from(parent.getContext())\n .inflate(R.layout.event_recyclerview, parent, false);\n// v.setTag(true);\n final ViewHolder vh = new ViewHolder(v);\n v.setOnClickListener(new View.OnClickListener() {\n @Override\n public void onClick(View v) {\n listener.onItemClick(v.findViewById(R.id.event_host_desc), vh.getAdapterPosition());\n }\n });\n return vh;\n }", "public interface OnTagClickListener {\n void onItemClick(FlowLayout parent, View view, int position);\n}", "@Override\n public View getView(final int i, View view, ViewGroup viewGroup) {\n ViewHolder holder;\n LayoutInflater inflator = LayoutInflater.from(context);\n if(view == null) {\n view = inflator.inflate(R.layout.myitem, null);//解出Layout 解壓器,消耗資源\n holder = new ViewHolder();\n holder.name = (TextView)view.findViewById(R.id.textView);\n holder.statement = (TextView)view.findViewById(R.id.textView2);\n holder.img =(ImageView)view.findViewById(R.id.imageView);\n view.setTag(holder);//要加,不然listview滑動會當掉\n holder.name.setText(zooInfo[i].E_Name);\n holder.statement.setText(zooInfo[i].E_Info);\n Picasso.with(context).load(zooInfo[i].E_Pic_URL).into(holder.img);\n } else {\n holder = (ViewHolder) view.getTag();\n }\n return view;\n\n }", "public ViewHolder(View view) {\r\n super(view);\r\n img = (ImageView) view.findViewById(R.id.recycleimg);\r\n// picture_text = (TextView) view.findViewById(R.id.picture_text);\r\n// picture_img = (TextView) view.findViewById(R.id.picture_img);\r\n// picture_heart = (TextView) view.findViewById(R.id.picture_heart);\r\n// picture_date = (TextView) view.findViewById(R.id.picture_date);\r\n// picture_num = (TextView) view.findViewById(R.id.picture_num);\r\n }", "@Override\n public MyViewHolder onCreateViewHolder(ViewGroup parent, int viewType) {\n\n MyViewHolder viewHolder = null;\n LayoutInflater inflater = LayoutInflater.from(parent.getContext());\n\n Log.e(\"TAg\", \"the view type : \" + viewType);\n\n switch (viewType) {\n case ITEM:\n // viewHolder = getViewHolder(parent, inflater);\n\n View itemView = LayoutInflater.from(parent.getContext()).inflate(R.layout.blood_appeals_custom_row, parent, false);\n viewHolder = new MyViewHolder(itemView);\n\n break;\n case LOADING:\n View v2 = inflater.inflate(R.layout.progress_item_at_end, parent, false);\n viewHolder = new MyViewHolder(v2);\n break;\n\n }\n\n\n\n\n return viewHolder;\n\n }", "public ViewHolder(View rootView) {\n super(rootView);\n tvCityName = (TextView) rootView.findViewById(R.id.tv_view_city_list_item_city_name);\n }", "@Override\n public void onBindViewHolder(@NonNull @NotNull ViewHolder holder, int position) {\n\n }", "private void bindData(ViewHolder vh, int position) {\n\n }", "@Override\n public void onBindViewHolder(final ViewHolder holder, final int position) {\n // - get element from data set at this position\n // - replace the contents of the view with that element\n\n final Food food = getFood(position);\n holder.name.setText(food.name);\n holder.info.setText(String.valueOf(food.info));\n holder.img.setImageResource(food.resId);\n holder.layout.setOnClickListener(new OnClickListener() {\n @Override\n public void onClick(View v) {\n img.setImageResource(food.resId);\n info.setText(food.info);\n\n // gets the recycler position\n currItem = holder.getAdapterPosition();\n\n // intent passes the value of currItem to the activities\n Intent intent = new Intent(\"pass-food\");\n intent.putExtra(\"food\",currItem);\n LocalBroadcastManager.getInstance(context).sendBroadcast(intent);\n }\n });\n }", "@Override\n public ListsAdapter.ViewHolder onCreateViewHolder(ViewGroup parent, int position) {\n View view = LayoutInflater.from(parent.getContext()).inflate(R.layout.singleview, parent, false);\n ViewHolder vh = new ViewHolder(view);\n context = view.getContext();\n return vh;\n }", "@Override\n public void onBindViewHolder(ViewHolder viewHolder, final int position) {\n // Get element from your dataset at this position and replace the contents of the view\n // with that element\n viewHolder.distanceView.setText(String.valueOf(meterDistanceBetweenPoints((float)46.782719, (float)23.607913,\n Double.valueOf( (mDataSet.getEvents().get(position).getLocation().split(\",\"))[0]).floatValue(),\n Double.valueOf( (mDataSet.getEvents().get(position).getLocation().split(\",\"))[1]).floatValue())) + \"m\");\n viewHolder.getTextView().setText(mDataSet.getEvents().get(position).getName());\n viewHolder.setListener(new View.OnClickListener() {\n @Override\n public void onClick(View view) {\n Event e= mDataSet.getEvents().get(position);\n\n FragmentTransaction ft = manager.beginTransaction();\n ShowEventFragment eventFragment=new ShowEventFragment(e);\n ft.replace(R.id.frag_container_id,eventFragment, \"NewFragmentTag\");\n ft.addToBackStack(null);\n ft.commit();\n }\n });\n }", "@Override\n // Call ViewHolder class and create the view\n public RecyclerViewAdapter.ViewHolder onCreateViewHolder(ViewGroup viewGroup, int viewType) {\n View view = LayoutInflater.from(viewGroup.getContext())\n .inflate(R.layout.list_row, viewGroup, false);\n\n // Pass the view created\n return new ViewHolder(view, context);\n }", "public ViewHolder(View itemView) {\n super(itemView);\n\n mView = itemView;\n mUsernameTv = (TextView) mView.findViewById(R.id.usernameTv);\n mEmailTv = (TextView) mView.findViewById(R.id.emailTv);\n mFriendIv = (ImageView) mView.findViewById(R.id.friendIv);\n mYouTv = (TextView) mView.findViewById(R.id.youTv);\n\n mIsFriend = false;\n }", "@Override\n public void onBindViewHolder(ViewHolder holder, int position) {\n\n DummyData dummyData = dummyDataList.get(position);\n\n holder.imageView.setImageBitmap(dummyData.getSomeImage());\n holder.textView.setText(dummyData.getSomeText());\n\n //set onclick listener for the views in the holder\n holder.itemView.setOnClickListener(this);\n holder.textView.setOnClickListener(this);\n }", "protected void onBindData(Context context, int position, T item, int itemLayoutId, ViewHelper2 helper){\n\n }", "@Override\n public void onClick(View view) {\n RecyclerView.ViewHolder viewHolder = (RecyclerView.ViewHolder) view.getTag();\n position = viewHolder.getAdapterPosition();\n\n // viewHolder.getItemId();\n // viewHolder.getItemViewType();\n// viewHolder.itemView.;\n //Station thisItem = stations2.get(position);\n //Station currentStation = stations2.get(position);\n //SharedPreferences sharedPreferences = getSharedPreferences(\"MasterSave\", MODE_PRIVATE);\n SharedPreferences prefs = getSharedPreferences(\"keeper\", Context.MODE_PRIVATE);\n SharedPreferences.Editor editor = prefs.edit();\n //editor.putString(\"name\",nameofStation);\n editor.putInt(\"selected\", position);\n editor.apply();\n Objects.requireNonNull(recyclerView.getAdapter()).notifyDataSetChanged();//? may NULL\n\n Toast.makeText(MainActivity.this, \"You Clicked: \" + position, Toast.LENGTH_SHORT).show();\n }", "public ViewHolder(View itemView, ItemClickListener listener) {\n super(itemView);\n this.listener = listener;\n\n layout = (LinearLayout) itemView.findViewById(R.id.oneAlbum_brief);\n imgAlbumCover = (ImageView) itemView.findViewById(R.id.draw_albumcover);\n tvArtist = (TextView) itemView.findViewById(R.id.tv_artistName);\n tvAlbum = (TextView) itemView.findViewById(R.id.tv_albumName);\n\n layout.setOnClickListener(this);\n // tvArtist.setOnClickListener(this);\n // tvAlbum.setOnClickListener(this);\n }", "@Override\n public RecyclerView.ViewHolder onCreateViewHolder(ViewGroup parent, int viewType) {\n final View view = LayoutInflater.from(context).inflate(R.layout.item_photo_filter, parent, false);\n\n Doodle d = list.get(counter);\n ImageView img = (ImageView)view.findViewById(R.id.ivDoodle);\n img.setImageResource(d.getResIcon());\n view.setTag(d.getResDoodle());\n counter++;\n\n view.setOnClickListener(new View.OnClickListener() {\n @Override\n public void onClick(View v) {\n String text = v.getTag().toString();\n int res = Integer.parseInt(text);\n\n AbsoluteLayout fl = (AbsoluteLayout) activity.findViewById(R.id.flDoodles);\n\n int i = fl.getChildCount();\n\n StickerView iv = new StickerView(context);\n iv.setLayoutParams(new AbsoluteLayout.LayoutParams(AbsoluteLayout.LayoutParams.WRAP_CONTENT, AbsoluteLayout.LayoutParams.WRAP_CONTENT, 0,0));\n// iv.setBackgroundResource(res);\n iv.setWaterMark(BitmapFactory.decodeResource(context.getResources(), res));\n iv.setOnStickerDeleteListener(new StickerView.OnStickerDeleteListener() {\n @Override\n public void onDelete(View v) {\n AbsoluteLayout fl = (AbsoluteLayout) activity.findViewById(R.id.flDoodles);\n fl.removeView(v);\n }\n });\n\n// SubsamplingScaleImageView iv = new SubsamplingScaleImageView(context);\n// iv.setImage(ImageSource.resource(res));\n\n fl.addView(iv);\n }\n });\n return new PhotoFilterViewHolder(view);\n }", "@Override\n public void onBindViewHolder(ViewHolder viewHolder, final int position) {\n\n // Get element from your dataset at this position and replace the contents of the view\n // with that element\n /*try {*/\n //viewHolder.getImageView().setImageBitmap(friends[position].convertPicture());\n viewHolder.getTextView().setText(friends[position].getName());\n /*} catch (SQLException e){\n e.printStackTrace();\n }*/\n }", "public ReportAdapterViewHolder(View v){\n super(v);\n layout = (RelativeLayout)v.findViewById(R.id.layout);\n repoNameTextView = (TextView)v.findViewById(R.id.repoNameTextView);\n repoLanguageTextView = (TextView)v.findViewById(R.id.languageTextView);\n// repoNameTextView.setOnClickListener(new RelativeLayout.OnClickListener() {\n// @Override\n// public void onClick(View v) {\n// RepositoryDetailsActivity activity= (RepositoryDetailsActivity) context;\n// FragmentManager manager = activity.getSupportFragmentManager();\n// Fragment fragment; //= manager.findFragmentById(R.id.repoDetailsFragment);\n// fragment = new RepoDetailsFragment();\n// manager.beginTransaction().add(R.id.repoDetailsFragment, fragment);\n// }\n// });\n\n\n\n }", "public ListViewHolder(@NonNull View itemView) {\n super(itemView);\n lblActiveWorkoutName= itemView.findViewById(R.id.lblActiveWorkoutName);\n lblActiveWorkoutDate = itemView.findViewById(R.id.lblActiveWorkoutDate);\n btnViewExercises = itemView.findViewById(R.id.btnViewExercises);\n }", "public ShowDataViewHolder(final View itemView) {\n super(itemView);\n // image_url = (ImageView) itemView.findViewById(R.id.fetch_image);\n image_title = (TextView) itemView.findViewById(R.id.fetch_image_title);\n\n\n }", "public VH getViewHolder(int position) {\n return mAttached.get(position);\n }", "@Override\n public ViewHolder onCreateViewHolder(ViewGroup parent, int viewType) {\n view = mInflater.inflate(R.layout.recycler_view, parent, false);\n //view.setOnClickListener(this);\n myprefs = view.getContext().getSharedPreferences(\"MyPrefs\", MODE_PRIVATE);\n return new ViewHolder(view);\n }", "@Override\n public void onBindViewHolder(ViewHolder holder, final int position) {\n\n ViewVideoCardBinding binding = holder.cardBinding;\n\n\n //binding.setAvm(new ArticleViewModel(mArticles.get(position), mContext));\n\n\n VideoItem vidItem = mDataset.get(position);\n\n if (lastPosition != -5) {\n Animation animation;\n animation = AnimationUtils.loadAnimation(context,\n (position < lastPosition) ? R.anim.slide_down : R.anim.slide_up);\n holder.setAnimation(animation);\n }\n lastPosition = position;\n holder.bind(vidItem, this.context);\n\n /*holder.mTextView.setText(mDataset[position]);\n holder.mCardView.setOnClickListener(new View.OnClickListener() {\n @Override\n public void onClick(View view) {\n String currentValue = mDataset[position];\n Log.d(\"CardView\", \"CardView Clicked: \" + currentValue);\n }\n });*/\n }", "@Override\n public void onBindViewHolder(RecyclerView.ViewHolder holder, final int position) {\n Photo obj = photos.get(position);\n if (holder instanceof OriginalViewHolder) {\n OriginalViewHolder view = (OriginalViewHolder) holder;\n view.name.setText(obj.getPath());\n// if (obj.counter == null) {\n// view.counter.setVisibility(View.GONE);\n// } else {\n// view.counter.setText(obj.counter.toString());\n// view.counter.setVisibility(View.VISIBLE);\n// }\n\n try {\n Glide.with(ctx).load(obj.getPath())\n .diskCacheStrategy(DiskCacheStrategy.ALL)\n .into(view.image);\n } catch (Exception e) {\n e.printStackTrace();\n }\n\n view.lyt_parent.setOnClickListener(new View.OnClickListener() {\n @Override\n public void onClick(View view) {\n if (mOnItemClickListener != null) {\n mOnItemClickListener.onItemClick(view, photos.get(position), position);\n }\n }\n });\n }\n }", "@Override\n public View getView(int position, View convertView, ViewGroup parent) {\n ViewHolder holder=null;\n int who=(Integer)chatList.get(position).get(\"person\");\n\n convertView= LayoutInflater.from(context).inflate(\n layout[who==ME?0:1], null);\n holder=new ViewHolder();\n holder.imageView=(ImageView)convertView.findViewById(to[who*2+0]);\n holder.textView=(TextView)convertView.findViewById(to[who*2+1]);\n\n\n System.out.println(holder);\n System.out.println(\"WHYWHYWHYWHYW\");\n System.out.println(holder.imageView);\n holder.imageView.setImageResource((Integer)chatList.get(position).get(from[0]));\n holder.textView.setText(chatList.get(position).get(from[1]).toString());\n return convertView;\n }" ]
[ "0.7022531", "0.68868315", "0.68061197", "0.67981803", "0.6740043", "0.6731442", "0.6725315", "0.66615283", "0.6592569", "0.65638644", "0.653383", "0.6518066", "0.65180194", "0.6503588", "0.6487254", "0.6439117", "0.64112395", "0.6379744", "0.6343791", "0.6337387", "0.633481", "0.6331195", "0.6320878", "0.6311445", "0.63001174", "0.6295028", "0.62904584", "0.6289469", "0.6256307", "0.62527794", "0.62525874", "0.623832", "0.6237773", "0.623747", "0.62210876", "0.6219828", "0.62062776", "0.6193458", "0.6191546", "0.6191105", "0.61806667", "0.6174481", "0.61705434", "0.61664826", "0.6159042", "0.6154136", "0.6144654", "0.6143401", "0.61372316", "0.61296", "0.61234456", "0.6117172", "0.61155826", "0.6111958", "0.6103631", "0.61030996", "0.6076564", "0.6063176", "0.60614586", "0.6059912", "0.6051658", "0.6030067", "0.60188663", "0.60140806", "0.60130835", "0.6006417", "0.6001035", "0.5998024", "0.59941715", "0.5986141", "0.5983451", "0.5980845", "0.5978841", "0.59739715", "0.59697616", "0.59693044", "0.5968838", "0.59687877", "0.59657615", "0.59655493", "0.595845", "0.59580046", "0.59532225", "0.59476745", "0.59436613", "0.59391886", "0.59372514", "0.59338254", "0.59320396", "0.5924772", "0.5921047", "0.5911132", "0.59084356", "0.590681", "0.5906301", "0.59023076", "0.5899474", "0.58962476", "0.5895134", "0.58835465", "0.5881541" ]
0.0
-1
if we're dirty means we should draw stuff on screen
@Override public void updateScreen() { if (dirty) { Alkahestry.logger.info(((ContainerMoleculeSplitter) container).moleculeSplitterTileEntity.progress); // String name = String.valueOf(((ContainerMoleculeSplitter) container).moleculeSplitterTileEntity.progress); // fontRenderer.drawString(name, xSize / 2 - fontRenderer.getStringWidth(name) / 2, 6, 0x404040); // fontRenderer.drawString(playerInv.getDisplayName().getUnformattedText(), 8, ySize - 94, 0x404040); dirty = false; } // ((ContainerMoleculeSplitter) container) // .moleculeSplitterTileEntity // . super.updateScreen(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "void flushDraw() {\n dirtyD = true;\n modelRoot.incrementNumberOfDirtyDNodes();\n }", "void updateDrawing() {\n filling = modelRoot.getCDraw().getFilling(this);\n dirtyBufF = true;\n tooltip = modelRoot.getCDraw().getTooltip(this);\n dirtyBufT = true;\n title = modelRoot.getCDraw().getTitle(this);\n dirtyBufTitle = true;\n colorTitle = modelRoot.getCDraw().getTitleColor(this);\n dirtyBufCT = true;\n }", "void computeDrawing() {\n if (dirtyD) {\n filling = modelRoot.getCDraw().getFilling(this);\n dirtyBufF = true;\n tooltip = modelRoot.getCDraw().getTooltip(this);\n dirtyBufT = true;\n title = modelRoot.getCDraw().getTitle(this);\n dirtyBufTitle = true;\n colorTitle = modelRoot.getCDraw().getTitleColor(this);\n dirtyBufCT = true;\n modelRoot.decrementNumberOfDirtyDNodes();\n dirtyD = false;\n }\n }", "public void paintImmediately() {\n apparatusPanel2.paintDirtyRectanglesImmediately();\n }", "public void megarepaintImmediately() {\n paintDirtyRectanglesImmediately();\n }", "void reDraw();", "private void paintDirtyRectanglesImmediately() {\n if ( rectangles.size() > 0 ) {\n Rectangle unionRectangle = RectangleUtils.union( rectangles );\n this.repaintArea = transformManager.transform( unionRectangle );\n paintImmediately( repaintArea );\n rectangles.clear();\n }\n }", "private synchronized final void makeAllDirty() {\n dirtyTop = 0;\n dirtyLeft = 0;\n dirtyBottom = rows;\n dirtyRight = cols;\n isDirty = true;\n }", "public void completeRedraw()\r\n\t{\r\n\t\tg = (Graphics2D) s.getDrawGraphics();\r\n\t}", "public void draw()\r\n {\r\n drawn = true;\r\n }", "@Override\n\tpublic void redraw() {\n\t\t\n\t}", "public void partialRedraw()\r\n\t{\r\n\t\tg.clearRect(0,0,NumerateGame.WINDOW_X,NumerateGame.WINDOW_Y);\r\n\t}", "public void withdraw() {\n\t\t}", "public void reDraw() {\n if(entityManager.getPlayerVaccines() != 0){\n vaccine[entityManager.getPlayerVaccines()-1].draw();\n }\n lifeCount[entityManager.getHealth()].draw();\n\n if(entityManager.getHealth() != prevPlayerLife)\n lifeCount[prevPlayerLife].delete();\n prevPlayerLife = entityManager.getHealth();\n\n if(prevPlayerLife == 0){\n heart.draw();\n }\n\n if(entityManager.playerWithMask()){\n mask.draw();\n } else {\n mask.delete();\n }\n }", "void withDraw() {\n if (this.pointer != 0) {\n this.pointer--;\n }\n }", "public void checkMovedRedraw(){\n if((board.isTreasureCollected() || board.isKeyCollected()) && muteMusic == false){\n music.playAudio(\"PickupSound\");\n }\n renderer.redraw(board, boardCanvas.getWidth(), boardCanvas.getHeight());\n if(board.isChipAlive() == false){\n gamePaused = true;\n timeRuunableThread.setPause(gamePaused);\n if(muteMusic == false){\n music.stopPlayingAudio(\"All\");\n music.playAudio(\"LevelCompleteSound\");\n }\n musicName = \"LevelCompleteSound\";\n JOptionPane.showMessageDialog(null, \"Oops! Better luck next time!\", \"Failed\", 1);\n canLoadGame = false;\n } else if(board.isLevelFinished()){\n gamePaused = true;\n timeRuunableThread.setPause(gamePaused);\n if(muteMusic == false){\n music.stopPlayingAudio(\"All\");\n music.playAudio(\"LevelCompleteSound\");\n }\n musicName = \"LevelCompleteSound\";\n if(level == 1){\n int saveOrNot = JOptionPane.showConfirmDialog(null, \"congratulations! Level 1 passed! Go to next level?\", \"Confirm\", JOptionPane.YES_NO_OPTION);\n if (saveOrNot == 0) { // yes\n level = level + 1;\n newGameStart(level);\n } else {\n gamePaused = true;\n }\n }else if(level == 2){\n JOptionPane.showMessageDialog(null, \"congratulations! Level 2 passed!\", \"Win Level 2\", JOptionPane.INFORMATION_MESSAGE);\n }\n }else if(board.onInfoTile()){\n JOptionPane.showMessageDialog(null, readAllLines(), \"Information\", JOptionPane.INFORMATION_MESSAGE);\n }else{\n try {\n infoCanvas.drawChipsLeftNumber(board.getTreasureRemainingAmount());\n infoCanvas.drawKeysChipsPics();\n } catch (IOException ex) {\n ex.printStackTrace();\n }\n }\n }", "@Override\n\tpublic void withdraw() {\n\t\t\n\t}", "private void forceRedraw(){\n postInvalidate();\n }", "public void withdraw() {\n\t\t\t\n\t\t}", "private void setDirty() {\n\t}", "public void redraw()\r\n\t{\r\n\t\tif (needsCompleteRedraw)\r\n\t\t{\r\n\t\t\tcompleteRedraw();\r\n\t\t\tneedsCompleteRedraw = false;\r\n\t\t}\r\n\t\telse\r\n\t\t{\r\n\t\t\tpartialRedraw();\r\n\t\t}\r\n\t}", "public void markEverythingDirty() {\n fullUpdate = true;\n }", "public void overDraw() {\r\n\t\t\r\n\t\tisDrawCalled = false;\r\n\t\t\r\n\t\tLog.d(\"core\", \"Scheduler: All step done in \" + \r\n\t\t\t\t(System.currentTimeMillis() - logTimerMark) + \" ms;\");\r\n\t\t\r\n\t\tint delay = 3;\r\n\t\tstartWork(delay);\r\n\t}", "public void fullRenderRefresh() {\n gameChanged = true;\n visionChanged = true;\n backgroundChanged = true;\n selectionChanged = true;\n movementChanged = true;\n }", "protected boolean isDirty()\n/* */ {\n/* 284 */ boolean dirty = super.isDirty();\n/* 285 */ if (dirty) {\n/* 286 */ return true;\n/* */ }\n/* 288 */ if (isCheckingDirtyChildPainters()) {\n/* 289 */ for (Painter p : this.painters) {\n/* 290 */ if ((p instanceof AbstractPainter)) {\n/* 291 */ AbstractPainter ap = (AbstractPainter)p;\n/* 292 */ if (ap.isDirty()) {\n/* 293 */ return true;\n/* */ }\n/* */ }\n/* */ }\n/* */ }\n/* 298 */ return false;\n/* */ }", "private boolean beginDrawing() {\n\t\tif (!p_view.getHolder().getSurface().isValid()) {\n\t\t\treturn false;\n\t\t}\n\t\tp_canvas = p_view.getHolder().lockCanvas();\n\t\treturn true;\n\t}", "public boolean isDirty() { return _dirty; }", "public void cleanCanvas() {\n\t\tclean = true;\n\t\tthis.invalidate();\n\t\t\n\t\t// adiciona ponto fict’cio para informar que o canvas foi limpo num dado momento\n\t\tif (toReplay) {\n\t\t\txs.add(-2.0f);\n\t\t\tys.add(-2.0f);\n\t\t\tcolors.add(mPaint.getColor());\n\t\t}\n\t}", "@Override\n \tpublic boolean isReadyToInvalidate() {\n \t\treturn false;\n \t}", "public void newDrawing()\n {\n //clear the current canvas\n canvas.drawColor(0, PorterDuff.Mode.CLEAR);\n //reprint the screen\n invalidate();\n }", "public void flush(){\r\n\t\tColor tempcol = screengraphics.getColor();\r\n\t\tscreengraphics.setColor(backgroundcolor);\r\n\t\tscreengraphics.fillRect(0, 0, sizex, sizey);\r\n\t\tscreengraphics.dispose();\r\n\t\tstrategy.show();\r\n\t\tscreengraphics =(Graphics2D) strategy.getDrawGraphics();\r\n\t\tscreengraphics.setColor(backgroundcolor);\r\n\t\tscreengraphics.fillRect(0, 0, sizex, sizey);\r\n\t\tscreengraphics.dispose();\r\n\t\tstrategy.show();\r\n\t\tscreengraphics =(Graphics2D) strategy.getDrawGraphics();\r\n\t\tscreengraphics.setColor(tempcol);\r\n\t\t\r\n\t}", "public void updateGraphics() {\n\t\t// Draw the background. DO NOT REMOVE!\n\t\tthis.clear();\n\t\t\n\t\t// Draw the title\n\t\tthis.displayTitle();\n\n\t\t// Draw the board and snake\n\t\t// TODO: Add your code here :)\n\t\tfor(int i = 0; i < this.theData.getNumRows(); i++) {\n\t\t\tfor (int j = 0; j < this.theData.getNumColumns(); j++) {\n\t\t\t\tthis.drawSquare(j * Preferences.CELL_SIZE, i * Preferences.CELL_SIZE,\n\t\t\t\t\t\tthis.theData.getCellColor(i, j));\n\t\t\t}\n\t\t}\n\t\t// The method drawSquare (below) will likely be helpful :)\n\n\t\t\n\t\t// Draw the game-over message, if appropriate.\n\t\tif (this.theData.getGameOver())\n\t\t\tthis.displayGameOver();\n\t}", "protected void preUpdate() {\n freeX = true;\n freeY = true;\n }", "public void draw() {\n\t\tsuper.repaint();\n\t}", "@Override\n public boolean isDirty()\n {\n return false;\n }", "private void draw() {\n\t\tCanvas c = null;\n\t\ttry {\n\t\t\t// NOTE: in the LunarLander they don't have any synchronization here,\n\t\t\t// so I guess this is OK. It will return null if the holder is not ready\n\t\t\tc = mHolder.lockCanvas();\n\t\t\t\n\t\t\t// TODO this needs to synchronize on something\n\t\t\tif (c != null) {\n\t\t\t\tdoDraw(c);\n\t\t\t}\n\t\t} finally {\n\t\t\tif (c != null) {\n\t\t\t\tmHolder.unlockCanvasAndPost(c);\n\t\t\t}\n\t\t}\n\t}", "@Override\n public boolean isDirty() {\n return false;\n }", "@Override\r\n\tpublic void draw() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void draw() {\n\t\t\r\n\t}", "public boolean isDirty();", "public void markDirty() {\n dirty = true;\n }", "public void wipe(){\n\t \tg2d.setColor(Color.yellow);\n g2d.fillRect(0,0, width, height);\n\t\t\n\n\t }", "@Override\n public void updateDrawState(TextPaint ds) {\n }", "void update() {\n rectToBeDrawn = new Rect((frameNumber * frameSize.x)-1, 0,(frameNumber * frameSize.x + frameSize.x) - 1, frameSize.x);\n\n //now the next frame\n frameNumber++;\n\n //don't try and draw frames that don't exist\n if(frameNumber == numFrames){\n frameNumber = 0;//back to the first frame\n }\n }", "public void update( ) {\n\t\tdraw( );\n\t}", "@Override \n\tpublic void update(Graphics g) \n\t{\n\t\tpaint(g); \n\t}", "@Override\n public boolean updateGraphicsData(GraphicsConfiguration gc) {\n // TODO: not implemented\n// throw new RuntimeException(\"Has not been implemented yet.\");\n return false;\n }", "public void refresh() {\n\t\tdrawingPanel.repaint();\n\t}", "protected final boolean shouldClearRectBeforePaint() {\n // TODO: sun.awt.noerasebackground\n return true;\n }", "public void stateChanged(ChangeEvent e){\n\r\n repaint(); // at the moment we're being pretty crude with this, redrawing all the shapes\r\n\r\n\r\n\r\n if (fDeriverDocument!=null) // if this drawing has a journal, set it for saving\r\n fDeriverDocument.setDirty(true);\r\n\r\n\r\n\r\n }", "public void draw() {\r\n if(isVisible()) {\r\n Canvas canvas = Canvas.getCanvas();\r\n canvas.draw(this,getColor(),\r\n new Rectangle(\r\n (int)round(getXposition()),\r\n (int)round(getYposition()),\r\n (int)round(size),\r\n (int)round(size)));\r\n canvas.wait(10);\r\n }\r\n }", "private synchronized final void makeAreaDirty(int top, int left,\n int bottom, int right) {\n if (bottom < visTop || top > (visTop + rows)) {\n // Dirt outside visible area, ignore\n return;\n }\n\n // Translate to screen coordinates\n top = top - visTop;\n bottom = bottom - visTop;\n\n if (!isDirty) {\n dirtyTop = top;\n dirtyBottom = bottom;\n dirtyLeft = left;\n dirtyRight = right;\n isDirty = true;\n } else {\n // Grow dirty area to include all dirty spots on screen\n if(top < dirtyTop) {\n dirtyTop = top;\n }\n if(bottom > dirtyBottom) {\n dirtyBottom = bottom;\n }\n if(left < dirtyLeft) {\n dirtyLeft = left;\n }\n if(right > dirtyRight) {\n dirtyRight = right;\n }\n if (dirtyTop == dirtyBottom) {\n dirtyBottom++;\n }\n if (dirtyLeft == dirtyRight) {\n dirtyRight++;\n }\n }\n // Make sure that values are sane\n dirtyTop = (dirtyTop < 0) ? 0 : dirtyTop;\n dirtyBottom = (dirtyBottom > rows) ? rows : dirtyBottom;\n dirtyLeft = (dirtyLeft < 0) ? 0 : dirtyLeft;\n dirtyRight = (dirtyRight > cols) ? cols : dirtyRight;\n\n // Make sure that the dirty area is a box, so if the new\n // dirt spans many lines, the entire screen width should\n // be repainted.\n if (dirtyBottom - dirtyTop > 1) {\n dirtyLeft = 0;\n dirtyRight = cols;\n }\n }", "public void markRenderModelsModified() {\n\t\t\n\t\t// TODO dispose of the VBOs!!!\n\t\trenderUnits = null;\n\t\t\n\t}", "void draw() {\n\t\t// display debug information\n\t\t// if (debugMode)\n\t\t// displayDebugInformation();\n\n\t\tupdate();\n\t\trender(); // display freetransform points, lines and colorings\n\n\t\t// display opposite objects\n\t\t// displayOppositeObject();\n\t}", "private void repaint() {\n\t\tclear();\n\t\tfor (PR1Model.Shape c : m.drawDataProperty()) {\n\t\t\tif(!c.getText().equals(defaultshape))\n\t\t\t\tdrawShape(c, false);\n\t\t}\n\t\tif (getSelection() != null) {\n\t\t\tdrawShape(getSelection(), true);\n\t\t}\n\t}", "public void clearDirtyAreas() {\n synchronized (dirtyAreas) {\n dirtyAreas.clear();\n }\n renderedAreas.clear();\n fullUpdate = false;\n dirtyAreaCounter = 0;\n }", "private void updateObjects(Graphics g){\n\t\tclearMhos(g);\n\t\tclearPlayer(g);\n\t\tdrawMhos(g);\n\t\tdrawPlayer(g);\n\t\tdrawFences(g);\n\t\tDraw.drawInstructions(g,smallFont);\n\t}", "@Override\n public void update(final Observable the_observed, final Object the_arg)\n {\n if (!my_board.isFull())\n {\n repaint();\n }\n }", "private boolean isDirty()\r\n {\r\n //\r\n return _modified;\r\n }", "private void render() {\n\t\tBufferStrategy buffStrat = display.getCanvas().getBufferStrategy();\n\t\tif(buffStrat == null) {\n\t\t\tdisplay.getCanvas().createBufferStrategy(3); //We will have 3 buffered screens for the game\n\t\t\treturn;\n\t\t}\n\n\t\t//A bufferstrategy prevents flickering since it preloads elements onto the display.\n\t\t//A graphics object is a paintbrush style object\n\t\tGraphics g = buffStrat.getDrawGraphics();\n\t\t//Clear the screen\n\t\tg.clearRect(0, 0, width, height); //Clear for further rendering\n\t\t\n\t\tif(State.getState() !=null) {\n\t\t\tState.getState().render(g);\n\t\t}\n\t\t//Drawings to be done in this space\n\t\t\n\t\t\n\t\t\n\t\tbuffStrat.show();\n\t\tg.dispose();\n\t}", "public void BufferUpdates()\n {\n //Clear the dispatch list and start buffering changed entities.\n DispatchList.clear();\n bBufferingUpdates = true;\n }", "protected void reDraw(){\n\t\tcontentPane.revalidate();\n\t\trepaint();\n\t}", "public boolean requiresUpdate(final Rectangle rect) {\n if (!viewport.intersects(rect)) {\n return false;\n }\n \n return fullUpdate || (getDirtyArea(rect) != null);\n }", "private boolean needsRepaintAfterBlit(){\n Component heavyParent=getParent();\n while(heavyParent!=null&&heavyParent.isLightweight()){\n heavyParent=heavyParent.getParent();\n }\n if(heavyParent!=null){\n ComponentPeer peer=heavyParent.getPeer();\n if(peer!=null&&peer.canDetermineObscurity()&&\n !peer.isObscured()){\n // The peer says we aren't obscured, therefore we can assume\n // that we won't later be messaged to paint a portion that\n // we tried to blit that wasn't valid.\n // It is certainly possible that when we blited we were\n // obscured, and by the time this is invoked we aren't, but the\n // chances of that happening are pretty slim.\n return false;\n }\n }\n return true;\n }", "@Override\r\n public void repaint(Object canvas) {\r\n {\r\n }\r\n\t}", "private void rebuildImageIfNeeded() {\n Rectangle origRect = this.getBounds(); //g.getClipBounds();\n// System.out.println(\"origRect \" + origRect.x + \" \" + origRect.y + \" \" + origRect.width + \" \" + origRect.height);\n\n backBuffer = createImage(origRect.width, origRect.height);\n// System.out.println(\"Image w \" + backBuffer.getWidth(null) + \", h\" + backBuffer.getHeight(null));\n Graphics backGC = backBuffer.getGraphics();\n backGC.setColor(Color.BLACK);\n backGC.fillRect(0, 0, origRect.width, origRect.height);\n// updateCSysEntList(combinedRotatingMatrix);\n paintWorld(backGC);\n }", "protected void doBright() {\r\n\t\talpha = 1.0f;\r\n\t\tsetAlphaOnTiles();\r\n\t\trepaint();\r\n\t}", "protected abstract void saveGraphicsState();", "private void drawStuff() {\n //Toolkit.getDefaultToolkit().sync();\n g = bf.getDrawGraphics();\n bf.show();\n Image background = window.getBackg();\n try {\n g.drawImage(background, 4, 24, this);\n\n for(i=12; i<264; i++) {\n cellKind = matrix[i];\n\n if(cellKind > 0)\n g.drawImage(tile[cellKind], (i%12)*23-3, (i/12)*23+17, this);\n }\n\n drawPiece(piece);\n drawNextPiece(pieceKind2);\n\n g.setColor(Color.WHITE);\n g.drawString(\"\" + (level+1), 303, 259);\n g.drawString(\"\" + score, 303, 339);\n g.drawString(\"\" + lines, 303, 429);\n\n } finally {bf.show(); g.dispose();}\n }", "public boolean getDirty(){return this.dirty;}", "public void updateScreen(){}", "@Override\n\tpublic void draw() {\n\t}", "@Override\r\n public void draw() {\n }", "public boolean isDrawn();", "public void setDirty( boolean dirty )\n {\n }", "@Override\n\tpublic void draw() {\n\t\t\n\t}", "@Override\n\tpublic void draw() {\n\t\t\n\t}", "@Override\n public void paintComponent(Graphics g)\n {\n m_g = g;\n // Not sure what our parent is doing, but this seems safe\n super.paintComponent(g);\n // Setup, then blank out with white, so we always start fresh\n g.setColor(Color.white);\n g.setFont(null);\n g.clearRect(1, 1, this.getBounds().width, this.getBounds().height);\n g.fillRect(1, 1, this.getBounds().width, this.getBounds().height);\n g.setColor(Color.red);\n //g.drawRect(10,10,0,0);\n //drawPoint(20,20);\n \n // Call spiffy functions for the training presentation\n m_app.drawOnTheCanvas(new ExposedDrawingCanvas(this));\n m_app.drawOnTheCanvasAdvanced(g);\n \n // ADVANCED EXERCISE: YOU CAN DRAW IN HERE\n \n // END ADVANCED EXERCISE SPACE\n \n // Clear the special reference we made - don't want to abuse this\n m_g = null;\n \n \n // Schedule the next repaint\n java.awt.EventQueue.invokeLater(new Runnable() {\n public void run() {\n m_app.repaint();\n try\n {\n Thread.sleep(100);\n }\n catch (Exception e)\n { \n \n }\n }\n }); \n }", "public void draw() {\n\n // Make sure our drawing surface is valid or we crash\n if (ourHolder.getSurface().isValid()) {\n // Lock the canvas ready to draw\n canvas = ourHolder.lockCanvas();\n // Draw the background color\n paint.setTypeface(tf);\n canvas.drawColor(Color.rgb(178,223,219));\n paint.setColor(Color.rgb(255,255,255));\n canvas.drawRect(offsetX, offsetY, width-offsetX, (height-100)-offsetY, paint);\n // Choose the brush color for drawing\n paint.setColor(Color.argb(50,0,0,0));\n paint.setFlags(Paint.ANTI_ALIAS_FLAG);\n // Make the text a bit bigger\n paint.setTextSize(40);\n paint.setStrokeWidth(5);\n paint.setStrokeCap(Paint.Cap.ROUND);\n // Display the current fps on the screen\n canvas.drawText(\"FPS:\" + fps, 20, 40, paint);\n paint.setTextSize(400);\n if(hasTouched == true) {\n if (count < 0) {\n canvas.drawText(0 + \"\", (width / 2) - 100, height / 2, paint);\n } else if(count<=numLines) {\n canvas.drawText(count + \"\", (width / 2) - 100, height / 2, paint);\n }\n } else {\n paint.setTextSize(100);\n canvas.drawText(\"TAP TO START\", (width / 2) - 300, height / 2, paint);\n }\n paint.setColor(Color.rgb(0,150,136));\n\n paint.setColor(color);\n\n canvas.drawCircle(xPosition, yPosition, radius, paint);\n\n paint.setColor(lineColor);\n\n if(isMoving==true && hasHit == false && count>=0) {\n canvas.drawLine(initialX, initialY, endX, endY, paint);\n }\n paint.setColor(Color.rgb(103,58,183));\n\n for(int i=0; i<verts.length; i++) {\n canvas.drawVertices(Canvas.VertexMode.TRIANGLES, verts[0].length, verts[i], 0, null, 0, verticesColors, 0, null, 0, 0, new Paint());\n }\n for (int i=0; i<innerVerts.length; i++) {\n canvas.drawVertices(Canvas.VertexMode.TRIANGLES, innerVerts[0].length, innerVerts[i], 0, null, 0, verticesColors, 0, null, 0, 0, new Paint());\n }\n // Draw everything to the screen\n ourHolder.unlockCanvasAndPost(canvas);\n\n //Display size and width\n\n }\n\n }", "@Override\n public void draw()\n {\n }", "@Override\n public boolean shouldPaint() {\n return false;\n }", "protected final void checkGC() {\n if (appliedState.relativeClip != currentState.relativeClip) {\n appliedState.relativeClip = currentState.relativeClip;\n currentState.relativeClip.setOn(gc, translateX, translateY);\n }\n\n if (appliedState.graphicHints != currentState.graphicHints) {\n reconcileHints(gc, appliedState.graphicHints,\n currentState.graphicHints);\n appliedState.graphicHints = currentState.graphicHints;\n }\n }", "public void draw(){\n if (! this.isFinished() ){\n UI.setColor(this.color);\n double left = this.xPos-this.radius;\n double top = GROUND-this.ht-this.radius;\n UI.fillOval(left, top, this.radius*2, this.radius*2);\n }\n }", "public void draw() {\n \n // TODO\n }", "public void redraw() {\n\t\tif(this.getGraphics() != null){\n\t\t\tthis.getGraphics().drawImage(imageBuffer, 0, 0, this); // Swap\n\t\t}\n\t}", "@Override\n\tpublic void draw() {\n\n\t}", "@Override\n\tpublic void draw() {\n\n\t}", "public boolean isItDirty() {\n\t\treturn false;\n\t}", "public void update() {\r\n\t\tremoveAll();\r\n\t\tdrawBackGround();\r\n\t\tdrawGraph();\r\n\t}", "protected void recheckDirty ()\n {\n // refresh the 'gbox' in each manager, the GroupItem will toString() differently if dirty\n for (int ii = 0, nn = _tabs.getComponentCount(); ii < nn; ii++) {\n SwingUtil.refresh(((ManagerPanel)_tabs.getComponentAt(ii)).gbox);\n }\n }", "private void render() {\n\n\tbs=display.getCanvas().getBufferStrategy();\t\n\t\n\tif(bs==null) \n\t {\t\n\t\tdisplay.getCanvas().createBufferStrategy(3);\n\t\treturn ;\n\t }\n\t\n\tg=bs.getDrawGraphics();\n\n\t//Clear Screen\n\tg.clearRect(0, 0, width, height);\n\t\n\tif(State.getState()!=null )\n\t\tState.getState().render(g);\n\t\n\t//End Drawing!\n\tbs.show();\n\tg.dispose();\n\t\n\t}", "boolean getDirty() { return dirty; }", "@Override\n public void draw() {\n }", "@Override\r\n\tpublic void paint(float deltaTime) {\n\t\t\r\n\t}", "@Override\n public void update(Graphics g) {\n paint(g);\n }", "private void refreshDisplay(){\n // The ArrayList bricks gets all the bricks currently on the board.\n bricks.addAll(board.getBoardBricks());\n bricks.addAll(board.getCurrentBlock().getBricks());\n g.clearRect(0, 0, BRICK_SIZE*(Board.BOUNDARY_RIGHT+7), BRICK_SIZE*(Board.BOUNDARY_BOTTOM+1));\n\n setupGhostBoard();\n for (Brick brick : ghostBoard.getCurrentBlock().getBricks()){\n g.setFill(Color.rgb(61, 61, 61));\n g.fillRect(brick.getX() * BRICK_SIZE, brick.getY() * BRICK_SIZE, BRICK_SIZE, BRICK_SIZE);\n g.setStroke(Color.WHITE);\n g.setLineWidth(2.0);\n g.strokeRect(brick.getX() * BRICK_SIZE, brick.getY() * BRICK_SIZE, BRICK_SIZE, BRICK_SIZE);\n }\n\n for (Brick brick : bricks) {\n g.setFill(getBrickColour(brick.getColour()));\n g.fillRect(brick.getX() * BRICK_SIZE + 2, brick.getY() * BRICK_SIZE + 2, BRICK_SIZE - 4, BRICK_SIZE - 4);\n }\n\n if(board.getHeldBlock() != null){\n for(Brick brick : board.getHeldBlock().getBricks()){\n g.setFill(getBrickColour(brick.getColour()));\n g.fillRect(brick.getX() * BRICK_SIZE + 259, brick.getY() * BRICK_SIZE + 44, BRICK_SIZE - 4, BRICK_SIZE - 4);\n }\n }\n\n for(Brick brick : board.getBlockQueue().get(0).getBricks()){\n g.setFill(getBrickColour(brick.getColour()));\n g.fillRect(brick.getX() * BRICK_SIZE + 259, brick.getY() * BRICK_SIZE + 184, BRICK_SIZE - 4, BRICK_SIZE - 4);\n }\n\n score.setText(\"\" + board.getScore());\n highScore.setText(\"\" + Math.max(FileHandler.readHighScore(), board.getScore()));\n level.setText(\"\" + board.getLevel());\n lines.setText(\"\" + board.getTotalLinesCleared());\n // All the elements of bricks must be removed, otherwise they stack up.\n bricks.removeAll(bricks);\n\n if(board.isGameOver()){\n g.setFill(Color.rgb(31, 31, 31, 0.5));\n g.fillRect(0, 0, BRICK_SIZE*(Board.BOUNDARY_RIGHT+1), BRICK_SIZE*(Board.BOUNDARY_BOTTOM+1));\n g.setTextAlign(TextAlignment.CENTER);\n g.setTextBaseline(VPos.CENTER);\n g.setFill(Color.WHITE);\n g.setFont(new Font(\"Impact\", 50));\n g.fillText(\n \"GAME OVER\",\n 160, 352\n );\n g.setFill(Color.rgb(190, 190, 190));\n g.setFont(new Font(\"Impact\", 20));\n g.fillText(\n \"Press 'Esc' to exit.\",\n 160, 392\n );\n\n int oldHighScore = FileHandler.readHighScore(), newHighScore = board.getScore();\n if(oldHighScore < newHighScore){\n highScoreSurpassed = true;\n }\n if(highScoreSurpassed){\n g.setFill(Color.WHITESMOKE);\n g.setFont(new Font(\"Impact\", 24));\n g.fillText(\n \"New High Score: \" + newHighScore + \"!\\nOld High Score: \" + oldHighScore + \".\",\n 160, 502\n );\n }\n }\n }", "public void draw(float delta) {\n\t\tcanvas.clear();\n\t\tcanvas.begin();\n\t\tcw = canvas.getWidth();\n\t\tch = canvas.getHeight();\n\t\tfor (int i = -5; i < 5; i++) {\n\t\t\tfor (int j = -5; j < 5; j++) {\n\t\t\t\tcanvas.draw(getBackground(dayTime), Color.WHITE, cw*i * 2, ch*j * 2, cw * 2, ch * 2);\n\t\t\t\tif(dayTime == 0 || dayTime == 1){\n\t\t\t\t\tcanvas.draw(getBackground(dayTime + 1), levelAlpha, cw*i * 2, ch*j * 2, cw * 2, ch * 2);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tcanvas.end();\n\t\tif (walls.size() > 0){ \n\t\t\tfor (ArrayList<Float> wall : walls) canvas.drawPath(wall);\n\t\t}\n\t\tcanvas.begin();\n\t\t//\t\tcanvas.draw(background, Color.WHITE, 0, 0, canvas.getWidth(), canvas.getHeight());\n\t\t//canvas.draw(rocks, Color.WHITE, 0, 0, canvas.getWidth(), canvas.getHeight());\n\t\t\n\t\t\n//\t\tfor (ArrayList<Float> wall : walls) canvas.drawPath(wall);\n\t\t\n\t\tfor(Obstacle obj : objects) {\n\t\t\tobj.draw(canvas);\n\t\t}\n\t\t\n\n\t\tfor (int i = -5; i < 5; i++) {\n\t\t\tfor (int j = -5; j < 5; j++) {\n\t\t\t\tcanvas.draw(overlay, referenceC, cw*i, ch*j, cw, ch);\n\t\t\t}\n\t\t}\n\n\t\tcanvas.end();\n\n\t\tif (debug) {\n\t\t\tcanvas.beginDebug();\n\t\t\tfor(Obstacle obj : objects) {\n\t\t\t\tobj.drawDebug(canvas);\n\t\t\t}\n\t\t\tcanvas.endDebug();\n\t\t}\n\n\n\n//\t\t// Final message\n//\t\tif (complete && !failed) {\n//\t\t\tdisplayFont.setColor(Color.BLACK);\n//\t\t\tcanvas.begin(); // DO NOT SCALE\n//\t\t\tcanvas.drawTextCentered(\"VICTORY!\", displayFont, 0.0f);\n//\t\t\tcanvas.end();\n//\t\t\tdisplayFont.setColor(Color.BLACK);\n//\t\t} else if (failed) {\n//\t\t\tdisplayFont.setColor(Color.RED);\n//\t\t\tcanvas.begin(); // DO NOT SCALE\n//\t\t\tcanvas.drawTextCentered(\"FAILURE!\", displayFont, 0.0f);\n//\t\t\tcanvas.end();\n//\t\t}\n\t}", "boolean isDrawState()\n\t{\n\t\treturn !state.contains(0);\n\t}", "public void update(Graphics param1Graphics) {\n/* 252 */ paint(param1Graphics);\n/* */ }", "void updateView () {\n updateScore();\n board.clearTemp();\n drawGhostToBoard();\n drawCurrentToTemp();\n view.setBlocks(board.getCombined());\n view.repaint();\n }" ]
[ "0.75382847", "0.7484426", "0.72491366", "0.7055619", "0.69898653", "0.68135256", "0.68058485", "0.66609704", "0.6651796", "0.66347337", "0.6564371", "0.64976424", "0.6421826", "0.6410406", "0.63664615", "0.63557047", "0.6340833", "0.631742", "0.6297349", "0.6295387", "0.6288976", "0.6284172", "0.6281585", "0.6252553", "0.6216607", "0.6216085", "0.62106866", "0.6197161", "0.617429", "0.61511165", "0.6135396", "0.6130015", "0.6122383", "0.6108775", "0.6078343", "0.6055566", "0.60454726", "0.603216", "0.603216", "0.6016218", "0.6006211", "0.6005556", "0.59993804", "0.5995516", "0.5987016", "0.59831476", "0.597616", "0.5968477", "0.59676343", "0.59631574", "0.5953584", "0.594824", "0.59402835", "0.5935337", "0.59246135", "0.59231234", "0.59129816", "0.5908117", "0.59067106", "0.5900344", "0.58994186", "0.58981955", "0.58938056", "0.5892562", "0.58825403", "0.5879555", "0.5873914", "0.58546585", "0.58543915", "0.5853342", "0.5851971", "0.5849821", "0.5845762", "0.5843307", "0.584056", "0.5839108", "0.5839108", "0.58380604", "0.58367074", "0.58289915", "0.58278316", "0.5826905", "0.5815602", "0.58127725", "0.5801673", "0.57951736", "0.57951736", "0.5794898", "0.579449", "0.5794019", "0.579322", "0.57920057", "0.57887995", "0.57878226", "0.5775104", "0.57742345", "0.5763739", "0.5762129", "0.5759717", "0.5749802" ]
0.5962862
50
String name = I18n.format(ModBlocks.blocks.get(ModBlocks.MOLECULE_SPLITTER).getUnlocalizedName() + ".name");
@Override protected void drawGuiContainerForegroundLayer(int mouseX, int mouseY) { }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public static String name(){\n return \"10.Schneiderman.Lorenzo\"; \n }", "public String getName() {\n/* 872 */ return CraftChatMessage.fromComponent(getHandle().getDisplayName());\n/* */ }", "public String getUnlocalizedName(ItemStack itemStack) \n\t{\n\t\tint i = itemStack.getItemDamage();\n\t\t\n\t\tif (i < 0 || i >= subBlocks.length) \n\t\t{\n\t\t\ti = 0;\n\t\t}\n\n\t\treturn super.getUnlocalizedName() + \".\" + subBlocks[i];\n\t}", "private String name(String module)\n {\n return module.split(\"%%\")[1];\n }", "public String getName()\r\n \t{\n \t\treturn (explicit ? (module.length() > 0 ? module + \"`\" : \"\") : \"\")\r\n \t\t\t\t+ name + (old ? \"~\" : \"\"); // NB. No qualifier\r\n \t}", "public String getUnitName() {\n\n\treturn \"Block(s)\";\n }", "@Override\n\tpublic String getInventoryName(){\n\t return ModBlocks.ModularCrate.getUnlocalizedName() + \".name\";\n\t}", "public String getName(){\n \treturn this.name().replace(\"_\", \" \");\n }", "private String getName(final String name) {\n\t\treturn bundleI18N.getString(name);\n\t}", "public interface IMetaBlockName {\n String getSpecialName(ItemStack stack);\n}", "private String name() {\r\n return cls.getSimpleName() + '.' + mth;\r\n }", "String getName() ;", "public String getFormatName() {\n\t\tString name = getName();\n\t\tif (name.startsWith(SpotlessPlugin.EXTENSION)) {\n\t\t\tString after = name.substring(SpotlessPlugin.EXTENSION.length());\n\t\t\tif (after.endsWith(SpotlessPlugin.CHECK)) {\n\t\t\t\treturn after.substring(0, after.length() - SpotlessPlugin.CHECK.length()).toLowerCase(Locale.US);\n\t\t\t} else if (after.endsWith(SpotlessPlugin.APPLY)) {\n\t\t\t\treturn after.substring(0, after.length() - SpotlessPlugin.APPLY.length()).toLowerCase(Locale.US);\n\t\t\t}\n\t\t}\n\t\treturn name;\n\t}", "public String getName()\r\n/* 91: */ {\r\n/* 92:112 */ return k_() ? aL() : \"container.minecart\";\r\n/* 93: */ }", "private String name() {\n return Strings.concat(Token.DOLLAR, name.string());\n }", "public String getName()\n/* */ {\n/* 59 */ return this.name;\n/* */ }", "public String getLocalizedName()\n {\n return StatCollector.translateToLocal(this.getUnlocalizedName() + \".\" + TreeOresLogs2.EnumType.DIAMOND.getUnlocalizedName() + \".name\");\n }", "public String getName()\r\n/* */ {\r\n/* 130 */ return this.name;\r\n/* */ }", "public String toString(){\n\t\treturn modulname;\n\t}", "public String name() {\n return (parts.length > 0) ? parts[parts.length - 1] : null;\n }", "private String getName(String name) {\n\t\tint n;\n\t\tif (name.startsWith(\"place_\")) {\n\t\t\tn = Integer.parseInt(name.substring(6));\n\t\t} else if (name.startsWith(\"t_\")) {\n\t\t\tn = Integer.parseInt(name.substring(2));\n\t\t} else {\n\t\t\treturn name;\n\t\t}\n\t\tif (n < net.getPlaces().size()) {\n\t\t\tPlace p = (Place) net.getPlaces().get(n);\n\t\t\treturn \"Place \" + p.getIdentifier();\n\t\t}\n\t\tn -= net.getPlaces().size();\n\t\tn--;\n\t\tif (n < net.getTransitions().size()) {\n\t\t\tTransition t = (Transition) net.getTransitions().get(n);\n\t\t\treturn \"Transition \" + t.getIdentifier();\n\t\t}\n\t\treturn name;\n\t}", "public String getUnlocalizedName(ItemStack stack) {\n/* 59 */ return String.valueOf(getUnlocalizedName()) + \".\" + (String)this.nameFunction.apply(stack);\n/* */ }", "public String getName() {\n/* */ return this.field_176894_i;\n/* */ }", "public String getName()\n/* */ {\n/* 60 */ return this.name;\n/* */ }", "String getUnlocalizedName();", "public String getName()\n/* */ {\n/* 62 */ return this.name;\n/* */ }", "public String getName()\r\n\t{\r\n\t\treturn \"LS\";\r\n\t}", "public String getName() {\r\n return \"Boyer/Moore-Suche in Strings\";\r\n }", "public String getName() {\n/* 209 */ return this.name;\n/* */ }", "public String getName() {\n int index = getSplitIndex();\n return path.substring(index + 1);\n }", "public String getName() {\n/* 57 */ return this.name;\n/* */ }", "String getName();", "String getName();", "String getName();", "String getName();", "String getName();", "String getName();", "String getName();", "String getName();", "String getName();", "String getName();", "String getName();", "String getName();", "String getName();", "String getName();", "String getName();", "String getName();", "String getName();", "String getName();", "String getName();", "String getName();", "String getName();", "String getName();", "String getName();", "String getName();", "String getName();", "String getName();", "String getName();", "String getName();", "String getName();", "String getName();", "String getName();", "String getName();", "String getName();", "String getName();", "String getName();", "String getName();", "String getName();", "String getName();", "String getName();", "String getName();", "String getName();", "String getName();", "String getName();", "String getName();", "String getName();", "String getName();", "String getName();", "String getName();", "String getName();", "String getName();", "String getName();", "String getName();", "String getName();", "String getName();", "String getName();", "String getName();", "String getName();", "String getName();", "String getName();", "String getName();", "String getName();", "String getName();", "String getName();", "String getName();", "String getName();", "String getName();", "String getName();", "String getName();", "String getName();", "String getName();" ]
[ "0.6372251", "0.61614376", "0.6137521", "0.61197853", "0.6103674", "0.6044417", "0.6027388", "0.5991453", "0.5984788", "0.59089565", "0.5892659", "0.5891246", "0.5882234", "0.5821755", "0.5820323", "0.58126986", "0.5811469", "0.5800419", "0.57941777", "0.5790424", "0.57560825", "0.5754091", "0.5748151", "0.57425606", "0.5723507", "0.57129747", "0.57116765", "0.56977236", "0.5697675", "0.56961864", "0.569333", "0.5662239", "0.5662239", "0.5662239", "0.5662239", "0.5662239", "0.5662239", "0.5662239", "0.5662239", "0.5662239", "0.5662239", "0.5662239", "0.5662239", "0.5662239", "0.5662239", "0.5662239", "0.5662239", "0.5662239", "0.5662239", "0.5662239", "0.5662239", "0.5662239", "0.5662239", "0.5662239", "0.5662239", "0.5662239", "0.5662239", "0.5662239", "0.5662239", "0.5662239", "0.5662239", "0.5662239", "0.5662239", "0.5662239", "0.5662239", "0.5662239", "0.5662239", "0.5662239", "0.5662239", "0.5662239", "0.5662239", "0.5662239", "0.5662239", "0.5662239", "0.5662239", "0.5662239", "0.5662239", "0.5662239", "0.5662239", "0.5662239", "0.5662239", "0.5662239", "0.5662239", "0.5662239", "0.5662239", "0.5662239", "0.5662239", "0.5662239", "0.5662239", "0.5662239", "0.5662239", "0.5662239", "0.5662239", "0.5662239", "0.5662239", "0.5662239", "0.5662239", "0.5662239", "0.5662239", "0.5662239", "0.5662239" ]
0.0
-1
calls "applyDefinitionElement" with "comp.getName()"
public Element applyDefinitionElement (final Component comp, final XmlProxyConvertible<?> proxy) throws RuntimeException { return applyDefinitionElement((null == comp) ? null : comp.getName(), comp, proxy); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "ElementDefinition createElementDefinition();", "public void setElementName(SC elementName) {\n if(elementName instanceof org.hl7.hibernate.ClonableCollection)\n elementName = ((org.hl7.hibernate.ClonableCollection<SC>) elementName).cloneHibernateCollectionIfNecessary();\n _elementName = elementName;\n }", "private ExtensibilityElement getExtElementFromDefinition(Definition definition){\n\t\ttry{\n\t\t\tMap<?, ?> serviceMap = definition.getAllServices();\n\t\t Iterator<?> serviceItr = serviceMap.entrySet().iterator();\n\t\t ExtensibilityElement extensibilityElement = null;\n\t\t \n\t\t while(serviceItr.hasNext()){\n\t\t \tMap.Entry<?, ?> svcEntry = (Map.Entry<?, ?>)serviceItr.next();\n\t\t \tService svc = (Service)svcEntry.getValue();\n\t\t \tMap<?, ?> portMap = svc.getPorts();\n\t\t \tIterator<?> portItr = portMap.entrySet().iterator();\n\t\t \t\n\t\t \twhile(portItr.hasNext()){\n\t\t \t\tMap.Entry<?, ?> portEntry = (Map.Entry<?, ?>)portItr.next();\n\t\t \t\tPort port = (Port)portEntry.getValue();\n\t\t \t\textensibilityElement = (ExtensibilityElement)port.getExtensibilityElements().get(0);\n\t\t \t}\n\t\t }\n\t\t return extensibilityElement;\n\t\t}catch(Exception e){\n\t\t\tlogger.error(e.getMessage(), e);\n\t\t\treturn null;\n\t\t}\n\t}", "protected void definitionStarted(String definitionName) {\n\t\tTypeDefinition definition = graphLayout\n\t\t\t\t.getTypeDefinition(definitionName);\n\t\tcurrentDefinition = definition;\n\t\tif (definition == null && isElementDefinition(definitionName)) {\n\t\t\tcurrentDefinition = new ElementDefinition(definitionName);\n\t\t\tgraphLayout.add(definition);\n\t\t}\n\t}", "IFMLNamedElement createIFMLNamedElement();", "void deleteElementDefinition(String elementName) throws IllegalArgumentException;", "protected int getIndex(String compName, final Collection<? extends NamedElement> elements) {\n\t\tint idx = 0;\n\n\t\tfor (NamedElement e : elements) {\n\t\t\tif (e.getName().equalsIgnoreCase(compName)) {\n\t\t\t\tbreak;\n\t\t\t} else {\n\t\t\t\tidx++;\n\t\t\t}\n\t\t}\n\t\treturn idx;\n\t}", "public void defineNamedDirective ( NamedDirectiveDefIfc namedDirectiveDef );", "void updateElementDefinition(String elementName, Map<String, String> propertiesToUpdate, boolean retroactive)\n\t\t\tthrows IllegalArgumentException;", "private FormProvider handleElement() throws XMLStreamException{\n String name = reader.getAttributeValue(0);\n nextTag();\n NamedElement result = new NamedElement(1, 1, name);\n result.setChild(handleAll());\n nextTag();\n return result;\n }", "protected Component generateComp(String compName) {\n\t\treturn null;\n\t}", "String getNameElement();", "public void processDefinitionAttribute(String name, String value) {\n\t\tcurrentDefinition.setAttribute(name, value);\n\t}", "ComponentBuilder named(String label);", "public void setElementNameForHibernate(SC elementName) {\n _elementName = elementName;\n }", "protected void addDefinition(ClassLoader al, String name, String classname)\n throws BuildException {\n Class<?> cl = null;\n try {\n try {\n name = ProjectHelper.genComponentName(getURI(), name);\n\n if (onError != OnError.IGNORE) {\n cl = Class.forName(classname, true, al);\n }\n\n if (adapter != null) {\n adapterClass = Class.forName(adapter, true, al);\n }\n\n if (adaptTo != null) {\n adaptToClass = Class.forName(adaptTo, true, al);\n }\n\n AntTypeDefinition def = new AntTypeDefinition();\n def.setName(name);\n def.setClassName(classname);\n def.setClass(cl);\n def.setAdapterClass(adapterClass);\n def.setAdaptToClass(adaptToClass);\n def.setRestrict(restrict);\n def.setClassLoader(al);\n if (cl != null) {\n def.checkClass(getProject());\n }\n ComponentHelper.getComponentHelper(getProject())\n .addDataTypeDefinition(def);\n } catch (ClassNotFoundException cnfe) {\n throw new BuildException(\n getTaskName() + \" class \" + classname\n + \" cannot be found\\n using the classloader \" + al,\n cnfe, getLocation());\n } catch (NoClassDefFoundError ncdfe) {\n throw new BuildException(\n getTaskName() + \" A class needed by class \" + classname\n + \" cannot be found: \" + ncdfe.getMessage()\n + \"\\n using the classloader \" + al,\n ncdfe, getLocation());\n }\n } catch (BuildException ex) {\n switch (onError) {\n case OnError.FAIL_ALL:\n case OnError.FAIL:\n throw ex;\n case OnError.REPORT:\n log(ex.getLocation() + \"Warning: \" + ex.getMessage(),\n Project.MSG_WARN);\n break;\n default:\n log(ex.getLocation() + ex.getMessage(),\n Project.MSG_DEBUG);\n }\n }\n }", "public void resolveTheCDLElementByElement(Element elem) {\n\n\t\tif(elem.getName().equals(\"exceptionBlock\")) {\n\t\t\tsetName(elem.attributeValue(\"name\"));\n\t\t}\n\t\tList<Element> childrenElements = elem.elements();\n\t\tfor(Element subElem:childrenElements) {\n\t\t\tsuper.resolveTheCDLElementByElement(subElem);\n\t\t}\n\t}", "public void setElementalName(String name) {\n\t\telementalName = name;\n \t}", "@org.junit.Test\n public void constrCompelemCompname4() {\n final XQuery query = new XQuery(\n \"element {//a} {'text'}\",\n ctx);\n try {\n query.context(node(file(\"prod/CompAttrConstructor/DupNode.xml\")));\n result = new QT3Result(query.value());\n } catch(final Throwable trw) {\n result = new QT3Result(trw);\n } finally {\n query.close();\n }\n test(\n error(\"XPTY0004\")\n );\n }", "@Override\r\n\tpublic void apply(Component component) {\n\t\t\r\n\t}", "public ManifestElementDescriptor(String xml_name) {\n super(xml_name, null);\n }", "private void registerBeanDefinitions(Document doc, Resource res) {\n Element root = doc.getDocumentElement();\n if(!root.getNodeName().equals(BEANS_ELEMENT)){\n throw new IllegalArgumentException(\"The\"+root+\"element has not implement yet\");\n }\n parseBeanDefinitionElement(root);\n }", "public android.renderscript.Element.Builder add(android.renderscript.Element element, java.lang.String name) { throw new RuntimeException(\"Stub!\"); }", "void defineElement(String elementName, Map<String, String> properties) throws IllegalArgumentException;", "public void addLayoutComponent(String name, Component comp) {\n // not supported\n }", "public void addNamedStructure(String name, IComponent comp)\n throws JiBXException {\n if (m_namedStructureMap == null) {\n m_context.addNamedStructure(name, comp);\n } else {\n m_namedStructureMap.put(name, comp);\n }\n }", "public void addComponent(String name, Component newComp);", "ModularizationElement createModularizationElement();", "public void addLayoutComponent(String name, Component comp) {}", "public void configure(Element parent) {\n }", "public SC getElementName() { return _elementName; }", "public void add (String nameComp) {\n if(!contains(nameComp))\n listWantedCompany.add(nameComp);\n }", "@org.junit.Test\n public void constrCompelemCompname1() {\n final XQuery query = new XQuery(\n \"element {()} {'text'}\",\n ctx);\n try {\n result = new QT3Result(query.value());\n } catch(final Throwable trw) {\n result = new QT3Result(trw);\n } finally {\n query.close();\n }\n test(\n error(\"XPTY0004\")\n );\n }", "public PathElementIF createElement(String name);", "public void scanCtNamedElement(CtNamedElement e) {\n ((CtNamedElement) (other)).setSimpleName(e.getSimpleName());\n super.scanCtNamedElement(e);\n }", "String getDefinition();", "LinkedService.DefinitionStages.Blank define(String name);", "@Override\n protected void checkElementNameUnique(Element element)\n {\n }", "public void setElementName(String elementName) {\r\n this.elementName = elementName;\r\n }", "public interface BeanDefinitionParser {\r\n\r\n /**\r\n * 解析element\r\n * @param element\r\n * @param beanDefinitionMap\r\n */\r\n public void parse(Element element, Map<String, BeanDefinition> beanDefinitionMap) throws IOException;\r\n}", "public abstract String getDefinition();", "void generate(JavaComponentDefinition definition, LogicalComponent<? extends JavaImplementation> component) throws GenerationException;", "void visitElement_component(org.w3c.dom.Element element) { // <component>\n // element.getValue();\n org.w3c.dom.NamedNodeMap attrs = element.getAttributes();\n for (int i = 0; i < attrs.getLength(); i++) {\n org.w3c.dom.Attr attr = (org.w3c.dom.Attr)attrs.item(i);\n if (attr.getName().equals(\"name\")) { // <component name=\"???\">\n component = new ProductComponent();\n component.name = attr.getValue();\n list.components.add(component);\n }\n }\n org.w3c.dom.NodeList nodes = element.getChildNodes();\n for (int i = 0; i < nodes.getLength(); i++) {\n org.w3c.dom.Node node = nodes.item(i);\n switch (node.getNodeType()) {\n case org.w3c.dom.Node.CDATA_SECTION_NODE:\n // ((org.w3c.dom.CDATASection)node).getData();\n break;\n case org.w3c.dom.Node.ELEMENT_NODE:\n org.w3c.dom.Element nodeElement = (org.w3c.dom.Element)node;\n if (nodeElement.getTagName().equals(\"subcomponent\")) {\n visitElement_subcomponent(nodeElement);\n }\n break;\n case org.w3c.dom.Node.PROCESSING_INSTRUCTION_NODE:\n // ((org.w3c.dom.ProcessingInstruction)node).getTarget();\n // ((org.w3c.dom.ProcessingInstruction)node).getData();\n break;\n }\n }\n }", "public XmlElementDefinition(String elementName, XmlFieldSerializer serializer) {\r\n super();\r\n this.elementName = elementName;\r\n this.serializer = serializer;\r\n }", "public abstract String getConfigElementName();", "@Override\n\tpublic String getComponentDefinition() {\n\t\tString component = \"\\n\\tWebElement submit_\" + getComponentName() + \" = driver.findElement(\"\n\t\t\t\t+ getSearchIdentifierString() + \");\";\n\t\tif (getAction() != null && (getAction().equals(\"click\") || getAction().equals(\"submit\"))) {\n\t\t\tcomponent += \"\\n\\tsubmit_\" + getComponentName() + \".submit();\";\n\n\t\t}\n\t\tcomponent += \"\\n\\tThread.sleep(1000);\";\n\t\treturn component;\n\t}", "private Node getCompanyElements(Document doc, Element element, String name, String value) {\r\n Element node = doc.createElement(name);\r\n node.appendChild(doc.createTextNode(value));\r\n return node;\r\n }", "@org.junit.Test\n public void constrCompelemCompname2() {\n final XQuery query = new XQuery(\n \"element {'one', 'two'} {'text'}\",\n ctx);\n try {\n result = new QT3Result(query.value());\n } catch(final Throwable trw) {\n result = new QT3Result(trw);\n } finally {\n query.close();\n }\n test(\n error(\"XPTY0004\")\n );\n }", "@org.junit.Test\n public void constrCompelemCompname11() {\n final XQuery query = new XQuery(\n \"element {'elem', ()} {'text'}\",\n ctx);\n try {\n result = new QT3Result(query.value());\n } catch(final Throwable trw) {\n result = new QT3Result(trw);\n } finally {\n query.close();\n }\n test(\n assertSerialization(\"<elem>text</elem>\", false)\n );\n }", "public void setElementName(String elementName) {\n this.elementName = elementName;\n }", "public void apply(Component comp) {\n\t\tif (_vars != null && isEffective(comp)) {\n\t\t\tfinal Evaluator eval = getEvaluator();\n\t\t\tfor (Map.Entry<String, Object> me: _vars.entrySet()) {\n\t\t\t\tfinal String name = me.getKey();\n\t\t\t\tfinal Object value = me.getValue();\n\t\t\t\tcomp.getSpaceOwner().setAttribute(\n\t\t\t\t\tname, Utils.evaluateComposite(eval, comp, value), !_local);\n\t\t\t}\n\t\t}\n\t}", "public String getDefinitionName() {\n return null;\n }", "public void setName(String name) throws IllegalArgumentException {\n if (name == null) {\n throw new IllegalArgumentException(Messages.element_nullName);\n }\n super.setName(name);\n Enumeration children = getChildren();\n while (children.hasMoreElements()) {\n IDOMNode child = (IDOMNode) children.nextElement();\n if (child.getNodeType() == IDOMNode.METHOD && ((IDOMMethod) child).isConstructor()) {\n ((DOMNode) child).fragment();\n }\n }\n }", "public void setElementName(String elementName) {\r\n\t\tthis.elementName = elementName;\r\n\t}", "public void setElementName(String elementName) {\r\n\t\tthis.elementName = elementName;\r\n\t}", "public void compose( AstNode etree ) {\n\n ESList e = ( ESList ) etree;\n\n add( e ); // formerly addHead -- original definitions come first\n }", "public void setDefinition(String definition){\n\t\tthis.definition = definition;\n\t}", "public void setName(java.lang.String param){\r\n localNameTracker = true;\r\n \r\n this.localName=param;\r\n \r\n\r\n }", "public void setName(java.lang.String param){\r\n localNameTracker = true;\r\n \r\n this.localName=param;\r\n \r\n\r\n }", "public void setName(java.lang.String param){\r\n localNameTracker = true;\r\n \r\n this.localName=param;\r\n \r\n\r\n }", "public void setName(String arg, String compcode, String left_paren, String right_paren, String and_or) throws ReadWriteException\n\t{\n\t\tsetValue(_Prefix + HardZone.NAME.toString(), arg, compcode, left_paren, right_paren, and_or);\n\t}", "public void setElement(String newElem) { element = newElem;}", "public interface IElementService {\n\n /**\n * Create new element\n * @param name\n */\n public IElement createNewElement(String name);\n}", "@Override\n public void alterColumnByName(String name, XPropertySet descriptor) throws SQLException, NoSuchElementException {\n \n }", "public void setElementName(CamelCaseName value){\n ((MenuDMO) core).setElementName(value);\n }", "@org.junit.Test\n public void constrCompelemCompname14() {\n final XQuery query = new XQuery(\n \"element {'foo:elem'} {}\",\n ctx);\n try {\n result = new QT3Result(query.value());\n } catch(final Throwable trw) {\n result = new QT3Result(trw);\n } finally {\n query.close();\n }\n test(\n error(\"XQDY0074\")\n );\n }", "private void retrieveAll(Definition def)\r\n\t{\n\t\t\r\n\t\t\r\n\t\tjavax.wsdl.Types types=def.getTypes();\r\n\t\tif(types==null) return;\r\n\t\t\r\n\t\tSchema sch=(Schema) def.getTypes().getExtensibilityElements().get(0);\r\n\t\tElement elm=sch.getElement();\r\n\t\tString tns=sch.getElement().getAttribute(\"targetNamespace\");\r\n\t\t\r\n\t\tNodeList nl=elm.getChildNodes();\t\t\r\n\t\tElement elmnt;\r\n\t\tnsInc++;\r\n\t\tfor(int i=0;i<nl.getLength();i++)\r\n\t\t{\r\n\t\t\t\r\n\t\t\tif (checkElementName(nl.item(i), \"element\" ))\r\n\t\t\t{\r\n\t\t\t\telmnt=(Element)(nl.item(i));\r\n\t\t\t\t\t\t\t\t\r\n\t\t\t\tOMElement omm=\tcreateOMFromSchema((Element)nl.item(i),tns);\r\n\t\t\t\t\t\t\t\t\r\n\t\t\t\tQName qname=new QName(tns,elmnt.getAttribute(\"name\"));//omm.getNamespace().getPrefix());\t\t\t\t\r\n\t\t\t\t\r\n\t\t\t\ttmpNameAndType.put(qname, omm);\t\r\n\t\t\t\t\r\n\t\t\t\t\r\n\t\t\t}\r\n\t\t\t\r\n\t\t}\r\n\t\t\r\n\t\t\r\n\t\t\r\n\t\t\t\r\n\t\t\r\n\t}", "@org.junit.Test\n public void compElemBadName2() {\n final XQuery query = new XQuery(\n \"(: 3.7.3.1 Computed Element Constructor per XQ.E19 XQDY0096 if namespace URI is 'http://www.w3.org/2000/xmlns/' Mary Holstege :) element { fn:QName(\\\"http://www.w3.org/2000/xmlns/\\\",\\\"error\\\")} {}\",\n ctx);\n try {\n result = new QT3Result(query.value());\n } catch(final Throwable trw) {\n result = new QT3Result(trw);\n } finally {\n query.close();\n }\n test(\n error(\"XQDY0096\")\n );\n }", "ElementNameCode(int token, String name) {\n super(token);\n this.name = name;\n }", "@Override\n\tpublic BeanEntity getBeanDefinition(String name) {\n\t\treturn null;\n\t}", "public void configure(Element node) throws Exception;", "public abstract void setNamedComponents(Map<String,List<Component>> namedComponents);", "private Specification installInstantiateSpec(Resource res, String specName) {\n \n Specification spec = CST.SpecBroker.getSpec(specName);\n // Check if already deployed\n if (spec == null) {\n // deploy selected resource\n boolean deployed = OBRMan.obr.deployInstall(res);\n if (!deployed) {\n System.err.print(\"could not install resource \");\n OBRMan.obr.printRes(res);\n return null;\n }\n // waiting for the implementation to be ready in Apam.\n spec = Apform.getWaitSpecification(specName);\n } else { // do not install twice.\n // It is a logical deployement. The allready existing impl is not visible !\n // System.out.println(\"Logical deployment of : \" + implName + \" found by OBRMAN but allready deployed.\");\n // asmImpl = CST.ASMImplBroker.addImpl(implComposite, asmImpl, null);\n }\n \n return spec;\n }", "void xsetName(org.openxmlformats.schemas.drawingml.x2006.main.STGeomGuideName name);", "Builder setComponent(String component);", "public void setName(String arg, String compcode) throws ReadWriteException\n\t{\n\t\tsetValue(_Prefix + HardZone.NAME.toString(), arg, compcode);\n\t}", "public static AnalysisEngineDescription createAggregateDescription(String name, List<ResourceSpecifier> specs) {\n //Create the aggregate descriptor object and set the name\n AnalysisEngineDescription aed = new AnalysisEngineDescription_impl();\n aed.getAnalysisEngineMetaData().setName(name);\n aed.setFrameworkImplementation(Constants.JAVA_FRAMEWORK_NAME);\n aed.setPrimitive(false);\n\n //Additional variables for operational information\n ArrayList<String> compNames = new ArrayList<String>();\n FlowControllerDescription fcd = null;\n boolean multipleDeploy = true;\n Import_impl imprt = null;\n\n for (ResourceSpecifier spec : specs) {\n if (spec instanceof AnalysisEngineDescription || spec instanceof CasConsumerDescription) {\n //Add as an import\n String component = ((ResourceCreationSpecifier)spec).getMetaData().getName();\n aed.getDelegateAnalysisEngineSpecifiersWithImports().put(component, spec);\n\n //Add component name to the list\n compNames.add(component);\n\n //Bind external resources\n bindExternalResources(aed, (ResourceCreationSpecifier)spec);\n\n //Set the multiple deployment flag\n if (spec instanceof AnalysisEngineDescription) {\n multipleDeploy &= ((AnalysisEngineDescription) spec).getAnalysisEngineMetaData()\n .getOperationalProperties().isMultipleDeploymentAllowed();\n } else { //Can't deploy more than one CasConsumer\n multipleDeploy = false;\n }//else\n } else if (spec instanceof FlowControllerDescription) {\n fcd = (FlowControllerDescription) spec;\n } else if (spec instanceof CustomResourceSpecifier) {\n //Add the delegate as an import\n String component = getComponentName(((CustomResourceSpecifier) spec).getParameters(), \"leoRemoteServiceDelegate\");\n aed.getDelegateAnalysisEngineSpecifiersWithImports().put(component, spec);\n\n //Add component name to the list\n compNames.add(component);\n } else if (spec instanceof PearSpecifier) {\n String component = getComponentName(((PearSpecifier) spec).getParameters(), \"leoPearServiceDelegate\");\n aed.getDelegateAnalysisEngineSpecifiersWithImports().put(component, spec);\n compNames.add(component);\n }\n }//for\n\n //Set the multiple deployment property\n aed.getAnalysisEngineMetaData().getOperationalProperties().setMultipleDeploymentAllowed(multipleDeploy);\n\n //Setup the flow controller\n if (fcd != null) {\n FlowControllerDeclaration flowControllerDecl = new FlowControllerDeclaration_impl();\n flowControllerDecl.setSpecifier(fcd);\n aed.setFlowControllerDeclaration(flowControllerDecl);\n }//if\n //Setup fixed flow FlowController - will only be used if custom flow controller not provided.\n FixedFlow fixedFlow = new FixedFlow_impl();\n fixedFlow.setFixedFlow(compNames.toArray(new String[compNames.size()]));\n aed.getAnalysisEngineMetaData().setFlowConstraints(fixedFlow);\n\n //Perform full validation on the descriptor before returning\n //Removed validation to support late serialization - TomG 01/31/2012\n //aed.doFullValidation(UIMAFramework.newDefaultResourceManager());\n return aed;\n }", "public void replaceComponent(Component comp) {\n\t\tif (this.cachedOnes == null || comp == null) {\n\t\t\treturn;\n\t\t}\n\n\t\tif (this.cls.isInstance(comp)) {\n\t\t\tthis.cachedOnes.put(comp.getQualifiedName(), comp);\n\t\t} else if (this == ComponentType.SERVICE\n\t\t\t\t&& comp instanceof ServiceInterface) {\n\t\t\t/*\n\t\t\t * that was bit clumsy, but the actual occurrence is rare, hence we\n\t\t\t * live with that\n\t\t\t */\n\t\t\tthis.cachedOnes.put(comp.getQualifiedName(), comp);\n\t\t} else {\n\t\t\tthrow new ApplicationError(\"An object of type \"\n\t\t\t\t\t+ comp.getClass().getName()\n\t\t\t\t\t+ \" is being passed as component \" + this);\n\t\t}\n\t}", "@Override\r\n\tpublic void updateElement() {\n\r\n\t}", "void addElement(FormElement elt);", "public void testGetComponentDef() throws Exception {\n ComponentDef component = Aura.getDefinitionService().getDefinition(\"auratest:testComponent1\",\n ComponentDef.class);\n\n Map<String, RegisterEventDef> red = component.getRegisterEventDefs();\n assertEquals(1, red.size());\n assertNotNull(red.get(\"testEvent\"));\n\n Collection<EventHandlerDef> ehd = component.getHandlerDefs();\n assertEquals(0, ehd.size());\n // assertEquals(\"testEvent\",ehd.iterator().next().getName());\n\n List<DefDescriptor<ModelDef>> mdd = component.getModelDefDescriptors();\n assertEquals(1, mdd.size());\n assertEquals(\"TestJavaModel\", mdd.get(0).getName());\n\n List<DefDescriptor<ControllerDef>> cds = component.getControllerDefDescriptors();\n assertEquals(1, cds.size());\n assertEquals(\"JavaTestController\", cds.get(0).getName());\n\n DefDescriptor<ModelDef> lmdd = component.getLocalModelDefDescriptor();\n assertEquals(\"TestJavaModel\", lmdd.getName());\n\n ModelDef model = component.getModelDef();\n assertEquals(\"TestJavaModel\", model.getName());\n\n ControllerDef controller = component.getControllerDef();\n assertEquals(\"testComponent1\", controller.getName());\n\n DefDescriptor<RendererDef> rd = component.getRendererDescriptor();\n assertEquals(\"testComponent1\", rd.getName());\n\n DefDescriptor<StyleDef> td = component.getStyleDescriptor();\n assertEquals(\"testComponent1\", td.getName());\n }", "private String getSDefFoXML(final ResourceDefinitionCreate resourceDefinition) throws WebserverSystemException {\r\n final Map<String, Object> valueMap = new HashMap<String, Object>();\r\n valueMap.putAll(getBehaviorValues(resourceDefinition));\r\n return ContentModelFoXmlProvider.getInstance().getServiceDefinitionFoXml(valueMap);\r\n }", "public void setComponentName(QName componentName) {\n _componentName = componentName;\n }", "public void setComponentName(ComponentName name);", "@org.junit.Test\n public void constrCompelemCompname10() {\n final XQuery query = new XQuery(\n \"element {'elem'} {'text'}\",\n ctx);\n try {\n result = new QT3Result(query.value());\n } catch(final Throwable trw) {\n result = new QT3Result(trw);\n } finally {\n query.close();\n }\n test(\n assertSerialization(\"<elem>text</elem>\", false)\n );\n }", "void addDefinition(DmsDefinition def) throws ResultException, DmcValueException, DmcNameClashException {\n \t\n \tif (def.getDotName() == null)\n \t\tDebugInfo.debug(\"NO DOT NAME\");\n \t\n \tif (def instanceof AttributeDefinition)\n \t\tthis.addAttribute((AttributeDefinition) def);\n \telse if (def instanceof ClassDefinition)\n \t\tthis.addClass((ClassDefinition) def);\n \telse if (def instanceof ActionDefinition)\n \t\tthis.addAction((ActionDefinition) def);\n \telse if (def instanceof TypeDefinition)\n \t\tthis.addType((TypeDefinition) def);\n \telse if (def instanceof EnumDefinition)\n \t\tthis.addEnum((EnumDefinition) def);\n \telse if (def instanceof SliceDefinition)\n \t\tthis.addSlice((SliceDefinition) def);\n \telse if (def instanceof RuleCategory)\n \t\tthis.addRuleCategory((RuleCategory) def);\n \telse if (def instanceof RuleDefinition)\n \t\tthis.addRuleDefinition((RuleDefinition) def);\n \t// Note: test for extended ref before complex type because it is derived from complex type\n \telse if (def instanceof ExtendedReferenceTypeDefinition)\n \t\tthis.addExtendedReferenceType((ExtendedReferenceTypeDefinition) def);\n \telse if (def instanceof ComplexTypeDefinition)\n \t\tthis.addComplexType((ComplexTypeDefinition) def);\n \telse if (def instanceof SchemaDefinition)\n \t\tthis.addSchema((SchemaDefinition) def);\n \telse if (def instanceof DSDefinitionModule)\n \t\tthis.addDefinitionModule((DSDefinitionModule) def, false);\n else{\n \tResultException ex = new ResultException();\n \tex.addError(\"The specified object is not a DmsDefinition object: \\n\" + def.toOIF());\n \tthrow(ex);\n }\n\n \tif (listeners != null){\n \t\tfor(SchemaDefinitionListenerIF listener: listeners)\n \t\t\tlistener.definitionAdded(def.getDMO());\n \t}\n }", "public void addLayoutComponent(String name, Component comp)\n\t{\n\t\taddLayoutComponent(comp, name);\n\t}", "@Override\n public void rename(String name) throws SQLException, ElementExistException {\n \n }", "public void addWidget(String name,Widget element){\n contentForm.addWidget(name, element);\r\n }", "public void updateWidgetFor(String name) {\n }", "@org.junit.Test\n public void constrCompelemCompname12() {\n final XQuery query = new XQuery(\n \"element {(), 'elem'} {'text'}\",\n ctx);\n try {\n result = new QT3Result(query.value());\n } catch(final Throwable trw) {\n result = new QT3Result(trw);\n } finally {\n query.close();\n }\n test(\n assertSerialization(\"<elem>text</elem>\", false)\n );\n }", "void depComponent(DepComponent depComponent);", "void xsetName(org.apache.xmlbeans.XmlString name);", "void xsetName(org.apache.xmlbeans.XmlString name);", "abstract void depComponent(DepComponent depComponent);", "public void setDefinition(String definition){\n\t\tdefinitionArea.setText(definition);\n\t}", "public void setConceptInfo(String elemName,String value) {\r\n if (elemName == \"title\") {\r\n setTitle(value);\r\n }\r\n else if (elemName == \"type\") {\r\n setType(value);\r\n }\r\n else if (elemName == \"prerequisite\") {\r\n setPrerequisite(value);\r\n }\r\n else if (elemName == \"ID\") {\r\n setID(value);\r\n }\r\n else if (elemName == \"minKnowledgeLevel\") {\r\n if (value==\"0\"){\r\n } else if (value==null){\r\n }\r\n int v=Integer.parseInt(value);\r\n setMinKnowledgeLevel(v);\r\n }\r\n else if (elemName == \"ordinalNumber\") {\r\n int v=Integer.parseInt(value);\r\n setOrdinalNumber(v);\r\n }\r\n }", "private static interface DefDocumentProcessor\n\t{\n\t\t/**\n\t\t * Called for every element found during processing of the s.t.\n\t\t * path.\n\t\t * @param documentPath an abstract pathname of the document\n\t\t * @throws XMLFormatException if document appears to be corrupted\n\t\t */\n\t\tvoid processElement(File documentPath) \n\t\t\tthrows XMLFormatException;\n\t}", "void addDef(Definition def) {\n defs.addElement(def);\n }", "@org.junit.Test\n public void constrCompelemCompname19() {\n final XQuery query = new XQuery(\n \"element {xs:untypedAtomic('el em')} {'text'}\",\n ctx);\n try {\n result = new QT3Result(query.value());\n } catch(final Throwable trw) {\n result = new QT3Result(trw);\n } finally {\n query.close();\n }\n test(\n error(\"XQDY0074\")\n );\n }" ]
[ "0.5640461", "0.5285542", "0.5270975", "0.52486867", "0.51932067", "0.51679754", "0.5073465", "0.50461274", "0.5044901", "0.50333995", "0.4989078", "0.49794114", "0.49670342", "0.49664798", "0.4959447", "0.4940293", "0.49380374", "0.4923923", "0.49238324", "0.4918752", "0.49030897", "0.49006176", "0.4896469", "0.48863056", "0.48826167", "0.48541695", "0.48515224", "0.48392323", "0.48356658", "0.4821838", "0.4814778", "0.4780947", "0.47715378", "0.4759792", "0.4740784", "0.47365296", "0.4732634", "0.4717905", "0.47038212", "0.46998414", "0.46837217", "0.46806258", "0.46805283", "0.46751288", "0.46720386", "0.46656412", "0.46585363", "0.4656214", "0.4647926", "0.4639648", "0.46306416", "0.46249807", "0.4590053", "0.45897135", "0.45897135", "0.45844972", "0.45804554", "0.45629138", "0.45629138", "0.45629138", "0.45579943", "0.4552924", "0.45507148", "0.45480034", "0.45457143", "0.454237", "0.45415288", "0.45410615", "0.45347038", "0.4527041", "0.4526614", "0.4513412", "0.45132935", "0.45132217", "0.45098418", "0.4509156", "0.4501465", "0.4499186", "0.44971612", "0.44898093", "0.4489591", "0.44855988", "0.4482047", "0.4481611", "0.44739446", "0.44712794", "0.44623545", "0.44599584", "0.44524282", "0.4443427", "0.44386038", "0.44374654", "0.4436553", "0.4436553", "0.44343287", "0.44341537", "0.44279727", "0.44210562", "0.44174698", "0.4416386" ]
0.71216947
0
Private method for generating all possible global states for a given list of nodes
private List<GlobalState> generateGlobalStates(List<Node> nodes) { // Creating a list of global states with an empty state List<GlobalState> gStates = new ArrayList(); gStates.add(new GlobalState(nodes,binding)); // Generating all possible global states for(Node n : nodes) { // Generating a new list of global states by adding a new pair // for each state of current node to those already generated List<GlobalState> newGStates = new ArrayList(); for(String s : n.getProtocol().getStates()) { for(GlobalState g : gStates) { GlobalState newG = new GlobalState(nodes,binding); newG.addMapping(g); newG.addMapping(n.getName(),s); newGStates.add(newG); } } // Updating the list of global states with the new one gStates = newGStates; } return gStates; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private void generateSteps() {\n for (GlobalState g : this.globalStates) {\n List<String> faults = g.getPendingFaults(); \n if(faults.isEmpty()) {\n // Identifying all available operation transitions (when there \n // are no faults), and adding them as steps\n List<String> gSatisfiableReqs = g.getSatisfiableReqs();\n \n for(Node n : nodes) {\n String nName = n.getName();\n String nState = g.getStateOf(nName);\n List<Transition> nTau = n.getProtocol().getTau().get(nState);\n for(Transition t : nTau) {\n boolean firable = true;\n for(String req : t.getRequirements()) {\n if(!(gSatisfiableReqs.contains(n.getName() + \"/\" + req)))\n firable = false;\n }\n if(firable) {\n // Creating a new mapping for the actual state of n\n Map<String,String> nextMapping = new HashMap();\n nextMapping.putAll(g.getMapping());\n nextMapping.put(nName, t.getTargetState());\n // Searching the ref to the corresponding global \n // state in the list globalStates\n GlobalState next = search(nextMapping);\n // Adding the step to list of steps in g\n g.addStep(new Step(nName,t.getOperation(),next));\n }\n }\n }\n } else {\n // Identifying all settling handlers for handling the faults\n // pending in this global state\n for(Node n: nodes) {\n // Computing the \"targetState\" of the settling handler for n\n String targetState = null;\n \n String nName = n.getName();\n String nState = g.getStateOf(nName);\n Map<String,List<String>> nRho = n.getProtocol().getRho();\n \n List<String> nFaults = new ArrayList();\n for(String req : nRho.get(nState)) {\n if(faults.contains(nName + \"/\" + req)) \n nFaults.add(req);\n }\n\n // TODO : Assuming handlers to be complete \n\n if(nFaults.size() > 0) {\n Map<String,List<String>> nPhi = n.getProtocol().getPhi();\n for(String handlingState : nPhi.get(nState)) {\n // Check if handling state is handling all faults\n boolean handles = true;\n for(String req : nRho.get(handlingState)) {\n if(nFaults.contains(req))\n handles = false;\n }\n\n // TODO : Assuming handlers to be race-free\n\n // Updating targetState (if the handlingState is \n // assuming a bigger set of requirements)\n if(handles) {\n if(targetState == null || nRho.get(handlingState).size() > nRho.get(targetState).size())\n targetState = handlingState;\n }\n }\n // Creating a new mapping for the actual state of n\n Map<String,String> nextMapping = new HashMap();\n nextMapping.putAll(g.getMapping());\n nextMapping.put(nName, targetState);\n // Searching the ref to the corresponding global \n // state in the list globalStates\n GlobalState next = search(nextMapping);\n // Adding the step to list of steps in g\n g.addStep(new Step(nName,next));\n }\n }\n }\n }\n }", "public static GlobalStates getStatesFromAllLocations()\n {\n GlobalStates globalStates = new GlobalStates();\n try {\n\n List<LocalStates> compileRes = new ArrayList<>();\n getLocationIds().getLocationIds().forEach(\n (locn) -> {\n LocalStates ls = new LocalStates();\n StateVariables sv = IoTGateway.getGlobalStates().get(locn);\n ls.setLocation(locn);\n ls.setStateVariable(sv);\n ls.setFire(IoTGateway.getIsFireLocn().get(locn));\n ls.setSmokeAlert(IoTGateway.getSmokeWarn().get(locn));\n compileRes.add(ls);\n\n }\n );\n globalStates.setLocalStates(compileRes);\n }\n catch (NullPointerException npe)\n {\n LOGGER.error(\"Null Pointer Exception at Horizon.Restart project and open browser after atleast one timestep\");\n }\n return globalStates;\n }", "public static ArrayList genStates(){\n ArrayList states = new ArrayList(44);\n List<String> notes = new ArrayList<String>(Arrays.asList(\"A\",\"B\",\"C\",\"D\",\"E\",\"F\",\"G\",\"H\",\"I\",\"J\",\"K\"));\n List<String> beat = new ArrayList<String>(Arrays.asList(\"1\",\"2\",\"3\",\"4\"));\n //List<String> dot = new ArrayList<String>(Arrays.asList(\"1\",\"0\"));\n for(int n = 0; n<=10; n++){\n for(int b = 0; b<=3; b++){\n //for(int d = 0; d<=1; d++){\n String state = \"\"; \n state += notes.get(n);\n state += beat.get(b);\n //state += dot.get(d);\n states.add(state);\n //}\n }\n }\n return states;\n }", "private static List<State<StepStateful>> getStates() {\n List<State<StepStateful>> states = new LinkedList<>();\n states.add(s0);\n states.add(s1);\n states.add(s2);\n states.add(s3);\n states.add(s4);\n states.add(s5);\n states.add(s6);\n return states;\n }", "private void applyLocationAlgorithms() {\n List<NodeState> states = new ArrayList<NodeState>();\n List<RemoteNode> nodes = new ArrayList<RemoteNode>(nodeManager.getNodes());\n AlgorithmMatchCriteria criteria;\n\n for (Algorithm la : algorithmManager.getAlgorithms()) {\n if (!la.isEnabled()) continue;\n criteria = algorithmManager.getCriteria(la);\n\n List<Node> filteredNodes = criteria.filter(nodes);\n if (filteredNodes.size() > 0) {\n states.add(la.applyTo(nodeManager.getLocalNode(), filteredNodes));\n }\n }\n for (NodeState s : states) {\n nodeManager.getLocalNode().addPending(s);\n }\n }", "List<S> getAllPossibleStates(S state);", "public ArrayList genStates2(){\n ArrayList states = new ArrayList(44);\n List<String> notes = new ArrayList<String>(Arrays.asList(\"A\",\"B\",\"C\",\"D\",\"E\",\"F\",\"G\",\"H\",\"I\",\"J\",\"K\"));\n List<String> beat = new ArrayList<String>(Arrays.asList(\"1\",\"2\",\"3\",\"4\"));\n //List<String> dot = new ArrayList<String>(Arrays.asList(\"1\",\"0\"));\n for(String s : notes){\n for(String d : beat){\n //for(int d = 0; d<=1; d++){\n String state = \"\"; \n state += s;\n state += d;\n //state += dot.get(d);\n states.add(state);\n //}\n }\n }\n return states;\n }", "private SortedSet<NodeStation> generateNodeStations() throws GenerationException {\n // create Set of NodeStations\n SortedSet<NodeStation> nodeStations = new TreeSet<>();\n for (ReferenceStation referenceStation : referenceStations) {\n nodeStationGenerator.referenceStation(referenceStation).generate()\n .ifPresent(nodeStations::add);\n }\n return nodeStations;\n }", "public void compileStates(int timeinterval) {\r\n\t\tif(timeinterval == -1) {\r\n\t\t\t//Add initial State\r\n\t\t\treachableStates.add(initialState);\r\n\t\t\tthis.numReachableState = 1;\r\n\t\t\t\r\n\t\t}else{\t\t\t\t\r\n\t\tState s;\r\n\t\tint index = 0;\r\n\t\treachableStates.clear();\r\n\t\tfor(int i = 0; i < totalWorkloadLevel; i++) {\r\n\t\t\tfor(int j = 0; j < totalGreenEnergyLevel; j++) {\r\n\t\t\t\tfor(int k = 0; k < totalBatteryLevel; k++) {\r\n\t\t\t\t\ts = grid[timeinterval][i][j][k];\r\n\t\t\t\t\tif(s.getProbability() != 0) {\r\n\t\t\t\t\t\t//If probability of state is not 0, put this state into the reachable list. \r\n\t\t\t\t\t\ts.index = index;\r\n\t\t\t\t\t\tindex++;\r\n\t\t\t\t\t\treachableStates.add(s);\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\tthis.numReachableState = index;\r\n\t\t}\r\n\t}", "protected abstract Node[] getAllNodes();", "private void addGlobalNodes() {\n for (Procedure proc : globalProcSet) {\n CFGraph cfg = cfgMap.get(proc);\n// System.out.println(\"ExitNode Size: \" + cfg.getExitNodes().size() + \", proc: \" + proc.getSymbolName());\n DFANode node = cfg.getEntry();\n // entry cfgNode\n DFANode entryNode = new DFANode();\n entryNode.putData(\"cfg_node\", node);\n entryNode.putData(\"psg_type\", \"entry\");\n accessIdxMap.put(\"entry_\" + proc.getSymbolName(), entryNode);\n node.putData(\"psg_entry_global\", entryNode);\n // exit cfgNode\n List<DFANode> exitNodeList = cfg.getExitNodes();\n int idx = 0;\n for (DFANode dfaNode : exitNodeList) {\n DFANode exitNode = new DFANode();\n exitNode.putData(\"cfg_node\", dfaNode);\n exitNode.putData(\"psg_type\", \"exit\");\n accessIdxMap.put(\"exit_\" + proc.getSymbolName() + idx++, exitNode);\n dfaNode.putData(\"psg_exit_global\", exitNode);\n }\n }\n\n // add call and return cfgNode (must check all the procs)\n for (Procedure proc : procList) {\n CFGraph cfg = cfgMap.get(proc);\n Iterator cfgIter = cfg.iterator();\n while (cfgIter.hasNext()) {\n DFANode node = (DFANode) cfgIter.next();\n Traversable currentIR = (Traversable) CFGraph.getIR(node);\n if (currentIR == null) {\n continue;\n }\n List<FunctionCall> fcList = IRTools.getFunctionCalls(currentIR);\n if (fcList == null || fcList.size() == 0) {\n continue;\n }\n Set<DFANode> callList = new HashSet<DFANode>();\n Set<DFANode> returnList = new HashSet<DFANode>();\n for (FunctionCall fc : fcList) {\n Procedure callee = fc.getProcedure();\n if (callee == null) {\n continue;\n }\n if (globalProcSet.contains(callee) == false) {\n continue;\n }\n DFANode callNode = new DFANode();\n callNode.putData(\"cfg_node\", node);\n callNode.putData(\"psg_type\", \"call\");\n callNode.putData(\"proc\", callee);\n callList.add(callNode);\n DFANode entryNode = accessIdxMap.get(\"entry_\" + callee.getSymbolName());\n if (entryNode == null) {\n throw new RuntimeException(\"No Entry Node found: \" + \"entry_\" + callee.getSymbolName());\n }\n callNode.addSucc(entryNode);\n entryNode.addPred(callNode);\n // return\n DFANode returnNode = new DFANode();\n returnNode.putData(\"cfg_node\", node);\n returnNode.putData(\"psg_type\", \"return\");\n returnNode.putData(\"proc\", callee);\n returnList.add(returnNode);\n CFGraph cfgCallee = cfgMap.get(callee);\n List<DFANode> calleeExitList = cfgCallee.getExitNodes();\n for (int idx = 0; idx < calleeExitList.size(); idx++) {\n DFANode exitNode = accessIdxMap.get(\"exit_\" + callee.getSymbolName() + idx);\n if (exitNode == null) {\n throw new RuntimeException(\"No Exit Node found: \" + \"exit_\" + callee.getSymbolName());\n }\n returnNode.addPred(exitNode);\n exitNode.addSucc(returnNode);\n }\n }\n if (callList.size() > 0) {\n node.putData(\"psg_call_global\", callList);\n }\n if (returnList.size() > 0) {\n node.putData(\"psg_return_global\", returnList);\n }\n }\n }\n }", "private byte[] calculateAllPossibleOutboundStates(byte state, byte[] allPossible){\n int stateNumParticles = calcNumParticlesInState(state);\n int[] stateMomentum = calculateMomentum(state);\n ArrayList<Byte> possibleStates = new ArrayList<>();\n for(byte poss:allPossible){\n int possNumPart = calcNumParticlesInState(poss);\n if(possNumPart==stateNumParticles){\n int[] possMomentum = calculateMomentum(poss);\n if(compareMomenta(possMomentum, stateMomentum)){\n possibleStates.add(poss);\n }\n }\n }\n byte[] ret = new byte[possibleStates.size()];\n int i = 0;\n for(Byte b:possibleStates){\n ret[i++] = b.byteValue();\n }\n return ret;\n }", "private List<State> substitueStateSketch(State oldState, Set<Node> components) {\n\n// long start = System.currentTimeMillis();\n\n List<State> ret = new ArrayList<>();\n\n for (Node sk : components) {\n\n State newState = new State(oldState);\n VariableNode v = newState.pp.findSelectedVar();\n v.sketch = sk;\n\n if (sk instanceof NullaryTerminalNode) {\n\n NullaryTerminalNode n = (NullaryTerminalNode) sk;\n\n if (v.parent != null && !(v.parent instanceof RepSketchNode)) {\n if (((OperatorNode) v.parent).operatorName.equals(\"notcc\")) {\n if (n.sym.name.equals(\"<any>\")) continue;\n } else if (((OperatorNode) v.parent).operatorName.equals(\"not\")) {\n newState.cost += Main.NOT_TERMINAL_PATTERN;\n }\n }\n\n newState.pp.numNullaryTerminals++;\n } else if (sk instanceof OperatorNode) {\n if (((OperatorNode) sk).special) newState.cost += Main.SPECIAL_REPEATATLEAST_1;\n\n String opName = ((OperatorNode) sk).operatorName;\n\n if (v.parent != null && !(v.parent instanceof RepSketchNode)) {\n if (((OperatorNode) v.parent).operatorName.equals(\"not\")) {\n if (!(opName.equals(\"startwith\") || opName.equals(\"endwith\") || opName.equals(\"contain\"))) {\n newState.cost += Main.NOT_NOT_CONTAIN_SW_EW_PATTERN;\n }\n }\n }\n } else {\n\n // do not continue if we are trying to replace argument of notcc with a op node\n if (v.parent != null && !(v.parent instanceof RepSketchNode)) {\n if (((OperatorNode) v.parent).operatorName.equals(\"notcc\")) {\n continue;\n }\n }\n }\n\n newState.pp.numOperatorSketch++; // TODO: it might be a problem if we have a rf sketch such as concat(v:contain(v:?{<num>}))\n newState.pp.deselectVar();\n if (evalApprox(newState)) ret.add(newState);\n\n }\n\n return ret;\n\n }", "private static void generateState() {\n byte[] array = new byte[7]; // length is bounded by 7\n new Random().nextBytes(array);\n STATE = new String(array, Charset.forName(\"UTF-8\"));\n }", "public static void createTree(SuccessorGenerator generator, GameState initialState)\n {\n LinkedList<GameState> currentLevel = new LinkedList<GameState>();\n currentLevel.add(initialState);\n Player currentPlayer = Player.PLAYER_MAX;\n \n int level = 0;\n while(true)\n {\n LinkedList<GameState> nextLevel = new LinkedList<GameState>();\n \n /*Gerando todas as ações possíveis para o nível atual.*/\n for(GameState state : currentLevel)\n {\n generator.generateSuccessors(state, currentPlayer);\n \n for(int i = 0; i < state.getChildren().size(); i++)\n {\n GameState successorState = state.getChildren().get(i);\n nextLevel.add(successorState);\n }\n }\n System.out.println(\"Expandindo nível \"+(level++)+\" com \"+nextLevel.size()+\" estados.\");\n \n /*Alternando jogadores*/\n currentPlayer = (currentPlayer == Player.PLAYER_MAX)?\n Player.PLAYER_MIN:\n Player.PLAYER_MAX; \n \n /*Busca termina quando todos os estados foram explorados*/\n if(nextLevel.isEmpty()) break;\n \n currentLevel.clear();\n currentLevel.addAll(nextLevel);\n }\n \n }", "private Collection<Node> getCandidates(State state) {\n\t\treturn new ArrayList<Node>(Basic_ILS.graph.getNodes());\n\t}", "public static LocNode intialState() {\n\n\t \n\t char[][] newMatrix =copyMatrix(matrix);\n\t \n\t \n\n\t \n\twhile(true) {\n\t\t\t\n\t\t\t\n\t\tint i=getRandomIndex(size);\n\t\tint j=getRandomIndex(size);\n\t\t\n\t if(newMatrix[i][j]=='-') {\n\t \t\n\t \n\t \t newMatrix[i][j]='c' ;\n\t \t \n\t \t \n\t \t updateVisibility(i, j, newMatrix);\n\t \t \n\t \t\n\t \t LocNode intialState= new LocNode(newMatrix, calculateOpjectiveFunction(newMatrix));\n\t \t \n\t \t\n\t \t return intialState;\n\t }\n\t \n\t }\n }", "public Map<String, TaskState> getStatesRecursive(List<AbstractArea> elements) {\r\n\t\tMap<String, TaskState> map = new HashMap<String, TaskState>();\r\n\t\tfor (AbstractArea area : elements) {\r\n\t\t\tmap.put(area.getActivityId(), area.getState());\r\n\r\n\t\t\t// call activity traverse strategy\r\n\t\t\tif (area instanceof CallActivityTaskHighlight) {\r\n\t\t\t\tCallActivityTaskHighlight callActivity = (CallActivityTaskHighlight) area;\r\n\t\t\t\tMap<String, TaskState> map2 = getStatesRecursive(callActivity.getElements());\r\n\t\t\t\tfor (String key : map2.keySet()) {\r\n\t\t\t\t\tmap.put(callActivity.getActivityId() + \".\" + key, map2.get(key));\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn map;\r\n\t}", "public LinkedList<State> getNextAvailableStates() {\n LinkedList<Integer> currentSide = new LinkedList<>();\n LinkedList<Integer> otherSide = new LinkedList<>();\n LinkedList<State> newStates = new LinkedList<>();\n if(isLeft) {\n if(leftSide != null) currentSide = new LinkedList<>(leftSide);\n if(rightSide != null) otherSide = new LinkedList<>(rightSide);\n } else {\n if (rightSide != null) currentSide = new LinkedList<>(rightSide);\n if (leftSide != null) otherSide = new LinkedList<>(leftSide);\n }\n\n // add one people to the other side of the bridge\n for (int index=0; index< currentSide.size(); index++) {\n LinkedList<Integer> newCurrentSide = new LinkedList<>(currentSide);\n LinkedList<Integer> newOtherSide = new LinkedList<>(otherSide);\n int firstPeopleMoved = newCurrentSide.remove(index);\n newOtherSide.add(firstPeopleMoved);\n State state = (isLeft) ? new State(newCurrentSide, newOtherSide, !isLeft,timeTaken+firstPeopleMoved, depth+1, highestSpeed) :\n new State(newOtherSide, newCurrentSide, !isLeft, timeTaken+firstPeopleMoved, depth+1, highestSpeed);\n state.setReward(state.calculateReward(firstPeopleMoved));\n // add this as parent to the child\n state.parents = new LinkedList<>(this.parents);\n state.addParent(this);\n // set the action that get to this state\n String currentAction = \"move \" + firstPeopleMoved;\n currentAction += (isLeft) ? \" across\" : \" back\";\n state.copyActions(this); // copy all the previous actions from the parent\n state.addActions(currentAction); // add new action to state generated by parent\n // add to the new states of list\n newStates.add(state);\n // add two people to the other side of the bridge\n for (int second=0; second < newCurrentSide.size(); second++) {\n LinkedList<Integer> newSecondCurrentSide = new LinkedList<>(newCurrentSide);\n LinkedList<Integer> newSecondOtherSide = new LinkedList<>(newOtherSide);\n int secondPeopleMoved = newSecondCurrentSide.remove(second);\n newSecondOtherSide.add(secondPeopleMoved);\n int slowerSpeed = (firstPeopleMoved > secondPeopleMoved) ? firstPeopleMoved : secondPeopleMoved;\n state = (isLeft) ? new State(newSecondCurrentSide, newSecondOtherSide, !isLeft, timeTaken+slowerSpeed, depth+1, highestSpeed) :\n new State(newSecondOtherSide, newSecondCurrentSide, !isLeft, timeTaken+slowerSpeed, depth+1, highestSpeed);\n state.setReward(state.calculateReward(firstPeopleMoved, secondPeopleMoved));\n // add this as parent to the child\n state.parents = new LinkedList<>(this.parents);\n state.addParent(this);\n // set the action that get to this state\n currentAction = \"move \"+ firstPeopleMoved + \" \" + secondPeopleMoved;\n currentAction += (isLeft) ? \" across\" : \" back\";\n state.copyActions(this);\n state.addActions(currentAction);\n // add to the new states of list\n newStates.add(state);\n }\n\n }\n return newStates;\n }", "private void fourNodesTopo() {\n ReadWriteTransaction tx = dataBroker.newReadWriteTransaction();\n n(tx, true, \"n1\", Stream.of(pB(\"n1:1\"), pB(\"n1:2\"), pI(\"n1:3\"), pO(\"n1:4\"), pO(\"n1:5\")));\n n(tx, true, \"n2\", Stream.of(pB(\"n2:1\"), pB(\"n2:2\"), pO(\"n2:3\"), pI(\"n2:4\"), pI(\"n2:5\")));\n n(tx, true, \"n3\", Stream.of(pB(\"n3:1\"), pB(\"n3:2\"), pO(\"n3:3\"), pO(\"n3:4\"), pI(\"n3:5\")));\n n(tx, true, \"n4\", Stream.of(pB(\"n4:1\"), pB(\"n4:2\"), pI(\"n4:3\"), pI(\"n4:4\"), pO(\"n4:5\")));\n l(tx, \"n1\", \"n1:5\", \"n2\", \"n2:5\", OperationalState.ENABLED, ForwardingDirection.UNIDIRECTIONAL);\n l(tx, \"n1\", \"n1:4\", \"n4\", \"n4:4\", OperationalState.ENABLED, ForwardingDirection.UNIDIRECTIONAL);\n l(tx, \"n2\", \"n2:3\", \"n4\", \"n4:3\", OperationalState.ENABLED, ForwardingDirection.UNIDIRECTIONAL);\n l(tx, \"n3\", \"n3:4\", \"n2\", \"n2:4\", OperationalState.ENABLED, ForwardingDirection.UNIDIRECTIONAL);\n l(tx, \"n4\", \"n4:5\", \"n3\", \"n3:5\", OperationalState.ENABLED, ForwardingDirection.UNIDIRECTIONAL);\n try {\n tx.submit().checkedGet();\n } catch (TransactionCommitFailedException e) {\n e.printStackTrace();\n }\n }", "@Deprecated(\n since = \"forever\",\n forRemoval = false\n )\n public static void initStates() {\n Block.BIG_DRIPLEAF_STEM.addBlockAlternative(new BlockAlternative((short) 18656, \"facing=north\", \"waterlogged=true\"));\n Block.BIG_DRIPLEAF_STEM.addBlockAlternative(new BlockAlternative((short) 18657, \"facing=north\", \"waterlogged=false\"));\n Block.BIG_DRIPLEAF_STEM.addBlockAlternative(new BlockAlternative((short) 18658, \"facing=south\", \"waterlogged=true\"));\n Block.BIG_DRIPLEAF_STEM.addBlockAlternative(new BlockAlternative((short) 18659, \"facing=south\", \"waterlogged=false\"));\n Block.BIG_DRIPLEAF_STEM.addBlockAlternative(new BlockAlternative((short) 18660, \"facing=west\", \"waterlogged=true\"));\n Block.BIG_DRIPLEAF_STEM.addBlockAlternative(new BlockAlternative((short) 18661, \"facing=west\", \"waterlogged=false\"));\n Block.BIG_DRIPLEAF_STEM.addBlockAlternative(new BlockAlternative((short) 18662, \"facing=east\", \"waterlogged=true\"));\n Block.BIG_DRIPLEAF_STEM.addBlockAlternative(new BlockAlternative((short) 18663, \"facing=east\", \"waterlogged=false\"));\n }", "public static void getInitialStates(int rows, int cols, int [][] states){\n // Create a 2d array for initial state of cells\n states = new int[rows][cols];\n Random rand = new Random();\n int random = rand.nextInt();\n for (int i = 0; i < rows; i++) {\n for (int j = 0; j < cols; j++) {\n if (random%100 <= 100*NUM_CELLS/(rows*cols)){\n states[i][j] = 1;\n }\n else{\n states[i][j] = 0;\n }\n }\n }\n }", "@Deprecated(\n since = \"forever\",\n forRemoval = false\n )\n public static void initStates() {\n Block.JUNGLE_STAIRS.addBlockAlternative(new BlockAlternative((short) 5568, \"facing=north\", \"half=top\", \"shape=straight\", \"waterlogged=true\"));\n Block.JUNGLE_STAIRS.addBlockAlternative(new BlockAlternative((short) 5569, \"facing=north\", \"half=top\", \"shape=straight\", \"waterlogged=false\"));\n Block.JUNGLE_STAIRS.addBlockAlternative(new BlockAlternative((short) 5570, \"facing=north\", \"half=top\", \"shape=inner_left\", \"waterlogged=true\"));\n Block.JUNGLE_STAIRS.addBlockAlternative(new BlockAlternative((short) 5571, \"facing=north\", \"half=top\", \"shape=inner_left\", \"waterlogged=false\"));\n Block.JUNGLE_STAIRS.addBlockAlternative(new BlockAlternative((short) 5572, \"facing=north\", \"half=top\", \"shape=inner_right\", \"waterlogged=true\"));\n Block.JUNGLE_STAIRS.addBlockAlternative(new BlockAlternative((short) 5573, \"facing=north\", \"half=top\", \"shape=inner_right\", \"waterlogged=false\"));\n Block.JUNGLE_STAIRS.addBlockAlternative(new BlockAlternative((short) 5574, \"facing=north\", \"half=top\", \"shape=outer_left\", \"waterlogged=true\"));\n Block.JUNGLE_STAIRS.addBlockAlternative(new BlockAlternative((short) 5575, \"facing=north\", \"half=top\", \"shape=outer_left\", \"waterlogged=false\"));\n Block.JUNGLE_STAIRS.addBlockAlternative(new BlockAlternative((short) 5576, \"facing=north\", \"half=top\", \"shape=outer_right\", \"waterlogged=true\"));\n Block.JUNGLE_STAIRS.addBlockAlternative(new BlockAlternative((short) 5577, \"facing=north\", \"half=top\", \"shape=outer_right\", \"waterlogged=false\"));\n Block.JUNGLE_STAIRS.addBlockAlternative(new BlockAlternative((short) 5578, \"facing=north\", \"half=bottom\", \"shape=straight\", \"waterlogged=true\"));\n Block.JUNGLE_STAIRS.addBlockAlternative(new BlockAlternative((short) 5579, \"facing=north\", \"half=bottom\", \"shape=straight\", \"waterlogged=false\"));\n Block.JUNGLE_STAIRS.addBlockAlternative(new BlockAlternative((short) 5580, \"facing=north\", \"half=bottom\", \"shape=inner_left\", \"waterlogged=true\"));\n Block.JUNGLE_STAIRS.addBlockAlternative(new BlockAlternative((short) 5581, \"facing=north\", \"half=bottom\", \"shape=inner_left\", \"waterlogged=false\"));\n Block.JUNGLE_STAIRS.addBlockAlternative(new BlockAlternative((short) 5582, \"facing=north\", \"half=bottom\", \"shape=inner_right\", \"waterlogged=true\"));\n Block.JUNGLE_STAIRS.addBlockAlternative(new BlockAlternative((short) 5583, \"facing=north\", \"half=bottom\", \"shape=inner_right\", \"waterlogged=false\"));\n Block.JUNGLE_STAIRS.addBlockAlternative(new BlockAlternative((short) 5584, \"facing=north\", \"half=bottom\", \"shape=outer_left\", \"waterlogged=true\"));\n Block.JUNGLE_STAIRS.addBlockAlternative(new BlockAlternative((short) 5585, \"facing=north\", \"half=bottom\", \"shape=outer_left\", \"waterlogged=false\"));\n Block.JUNGLE_STAIRS.addBlockAlternative(new BlockAlternative((short) 5586, \"facing=north\", \"half=bottom\", \"shape=outer_right\", \"waterlogged=true\"));\n Block.JUNGLE_STAIRS.addBlockAlternative(new BlockAlternative((short) 5587, \"facing=north\", \"half=bottom\", \"shape=outer_right\", \"waterlogged=false\"));\n Block.JUNGLE_STAIRS.addBlockAlternative(new BlockAlternative((short) 5588, \"facing=south\", \"half=top\", \"shape=straight\", \"waterlogged=true\"));\n Block.JUNGLE_STAIRS.addBlockAlternative(new BlockAlternative((short) 5589, \"facing=south\", \"half=top\", \"shape=straight\", \"waterlogged=false\"));\n Block.JUNGLE_STAIRS.addBlockAlternative(new BlockAlternative((short) 5590, \"facing=south\", \"half=top\", \"shape=inner_left\", \"waterlogged=true\"));\n Block.JUNGLE_STAIRS.addBlockAlternative(new BlockAlternative((short) 5591, \"facing=south\", \"half=top\", \"shape=inner_left\", \"waterlogged=false\"));\n Block.JUNGLE_STAIRS.addBlockAlternative(new BlockAlternative((short) 5592, \"facing=south\", \"half=top\", \"shape=inner_right\", \"waterlogged=true\"));\n Block.JUNGLE_STAIRS.addBlockAlternative(new BlockAlternative((short) 5593, \"facing=south\", \"half=top\", \"shape=inner_right\", \"waterlogged=false\"));\n Block.JUNGLE_STAIRS.addBlockAlternative(new BlockAlternative((short) 5594, \"facing=south\", \"half=top\", \"shape=outer_left\", \"waterlogged=true\"));\n Block.JUNGLE_STAIRS.addBlockAlternative(new BlockAlternative((short) 5595, \"facing=south\", \"half=top\", \"shape=outer_left\", \"waterlogged=false\"));\n Block.JUNGLE_STAIRS.addBlockAlternative(new BlockAlternative((short) 5596, \"facing=south\", \"half=top\", \"shape=outer_right\", \"waterlogged=true\"));\n Block.JUNGLE_STAIRS.addBlockAlternative(new BlockAlternative((short) 5597, \"facing=south\", \"half=top\", \"shape=outer_right\", \"waterlogged=false\"));\n Block.JUNGLE_STAIRS.addBlockAlternative(new BlockAlternative((short) 5598, \"facing=south\", \"half=bottom\", \"shape=straight\", \"waterlogged=true\"));\n Block.JUNGLE_STAIRS.addBlockAlternative(new BlockAlternative((short) 5599, \"facing=south\", \"half=bottom\", \"shape=straight\", \"waterlogged=false\"));\n Block.JUNGLE_STAIRS.addBlockAlternative(new BlockAlternative((short) 5600, \"facing=south\", \"half=bottom\", \"shape=inner_left\", \"waterlogged=true\"));\n Block.JUNGLE_STAIRS.addBlockAlternative(new BlockAlternative((short) 5601, \"facing=south\", \"half=bottom\", \"shape=inner_left\", \"waterlogged=false\"));\n Block.JUNGLE_STAIRS.addBlockAlternative(new BlockAlternative((short) 5602, \"facing=south\", \"half=bottom\", \"shape=inner_right\", \"waterlogged=true\"));\n Block.JUNGLE_STAIRS.addBlockAlternative(new BlockAlternative((short) 5603, \"facing=south\", \"half=bottom\", \"shape=inner_right\", \"waterlogged=false\"));\n Block.JUNGLE_STAIRS.addBlockAlternative(new BlockAlternative((short) 5604, \"facing=south\", \"half=bottom\", \"shape=outer_left\", \"waterlogged=true\"));\n Block.JUNGLE_STAIRS.addBlockAlternative(new BlockAlternative((short) 5605, \"facing=south\", \"half=bottom\", \"shape=outer_left\", \"waterlogged=false\"));\n Block.JUNGLE_STAIRS.addBlockAlternative(new BlockAlternative((short) 5606, \"facing=south\", \"half=bottom\", \"shape=outer_right\", \"waterlogged=true\"));\n Block.JUNGLE_STAIRS.addBlockAlternative(new BlockAlternative((short) 5607, \"facing=south\", \"half=bottom\", \"shape=outer_right\", \"waterlogged=false\"));\n Block.JUNGLE_STAIRS.addBlockAlternative(new BlockAlternative((short) 5608, \"facing=west\", \"half=top\", \"shape=straight\", \"waterlogged=true\"));\n Block.JUNGLE_STAIRS.addBlockAlternative(new BlockAlternative((short) 5609, \"facing=west\", \"half=top\", \"shape=straight\", \"waterlogged=false\"));\n Block.JUNGLE_STAIRS.addBlockAlternative(new BlockAlternative((short) 5610, \"facing=west\", \"half=top\", \"shape=inner_left\", \"waterlogged=true\"));\n Block.JUNGLE_STAIRS.addBlockAlternative(new BlockAlternative((short) 5611, \"facing=west\", \"half=top\", \"shape=inner_left\", \"waterlogged=false\"));\n Block.JUNGLE_STAIRS.addBlockAlternative(new BlockAlternative((short) 5612, \"facing=west\", \"half=top\", \"shape=inner_right\", \"waterlogged=true\"));\n Block.JUNGLE_STAIRS.addBlockAlternative(new BlockAlternative((short) 5613, \"facing=west\", \"half=top\", \"shape=inner_right\", \"waterlogged=false\"));\n Block.JUNGLE_STAIRS.addBlockAlternative(new BlockAlternative((short) 5614, \"facing=west\", \"half=top\", \"shape=outer_left\", \"waterlogged=true\"));\n Block.JUNGLE_STAIRS.addBlockAlternative(new BlockAlternative((short) 5615, \"facing=west\", \"half=top\", \"shape=outer_left\", \"waterlogged=false\"));\n Block.JUNGLE_STAIRS.addBlockAlternative(new BlockAlternative((short) 5616, \"facing=west\", \"half=top\", \"shape=outer_right\", \"waterlogged=true\"));\n Block.JUNGLE_STAIRS.addBlockAlternative(new BlockAlternative((short) 5617, \"facing=west\", \"half=top\", \"shape=outer_right\", \"waterlogged=false\"));\n Block.JUNGLE_STAIRS.addBlockAlternative(new BlockAlternative((short) 5618, \"facing=west\", \"half=bottom\", \"shape=straight\", \"waterlogged=true\"));\n Block.JUNGLE_STAIRS.addBlockAlternative(new BlockAlternative((short) 5619, \"facing=west\", \"half=bottom\", \"shape=straight\", \"waterlogged=false\"));\n Block.JUNGLE_STAIRS.addBlockAlternative(new BlockAlternative((short) 5620, \"facing=west\", \"half=bottom\", \"shape=inner_left\", \"waterlogged=true\"));\n Block.JUNGLE_STAIRS.addBlockAlternative(new BlockAlternative((short) 5621, \"facing=west\", \"half=bottom\", \"shape=inner_left\", \"waterlogged=false\"));\n Block.JUNGLE_STAIRS.addBlockAlternative(new BlockAlternative((short) 5622, \"facing=west\", \"half=bottom\", \"shape=inner_right\", \"waterlogged=true\"));\n Block.JUNGLE_STAIRS.addBlockAlternative(new BlockAlternative((short) 5623, \"facing=west\", \"half=bottom\", \"shape=inner_right\", \"waterlogged=false\"));\n Block.JUNGLE_STAIRS.addBlockAlternative(new BlockAlternative((short) 5624, \"facing=west\", \"half=bottom\", \"shape=outer_left\", \"waterlogged=true\"));\n Block.JUNGLE_STAIRS.addBlockAlternative(new BlockAlternative((short) 5625, \"facing=west\", \"half=bottom\", \"shape=outer_left\", \"waterlogged=false\"));\n Block.JUNGLE_STAIRS.addBlockAlternative(new BlockAlternative((short) 5626, \"facing=west\", \"half=bottom\", \"shape=outer_right\", \"waterlogged=true\"));\n Block.JUNGLE_STAIRS.addBlockAlternative(new BlockAlternative((short) 5627, \"facing=west\", \"half=bottom\", \"shape=outer_right\", \"waterlogged=false\"));\n Block.JUNGLE_STAIRS.addBlockAlternative(new BlockAlternative((short) 5628, \"facing=east\", \"half=top\", \"shape=straight\", \"waterlogged=true\"));\n Block.JUNGLE_STAIRS.addBlockAlternative(new BlockAlternative((short) 5629, \"facing=east\", \"half=top\", \"shape=straight\", \"waterlogged=false\"));\n Block.JUNGLE_STAIRS.addBlockAlternative(new BlockAlternative((short) 5630, \"facing=east\", \"half=top\", \"shape=inner_left\", \"waterlogged=true\"));\n Block.JUNGLE_STAIRS.addBlockAlternative(new BlockAlternative((short) 5631, \"facing=east\", \"half=top\", \"shape=inner_left\", \"waterlogged=false\"));\n Block.JUNGLE_STAIRS.addBlockAlternative(new BlockAlternative((short) 5632, \"facing=east\", \"half=top\", \"shape=inner_right\", \"waterlogged=true\"));\n Block.JUNGLE_STAIRS.addBlockAlternative(new BlockAlternative((short) 5633, \"facing=east\", \"half=top\", \"shape=inner_right\", \"waterlogged=false\"));\n Block.JUNGLE_STAIRS.addBlockAlternative(new BlockAlternative((short) 5634, \"facing=east\", \"half=top\", \"shape=outer_left\", \"waterlogged=true\"));\n Block.JUNGLE_STAIRS.addBlockAlternative(new BlockAlternative((short) 5635, \"facing=east\", \"half=top\", \"shape=outer_left\", \"waterlogged=false\"));\n Block.JUNGLE_STAIRS.addBlockAlternative(new BlockAlternative((short) 5636, \"facing=east\", \"half=top\", \"shape=outer_right\", \"waterlogged=true\"));\n Block.JUNGLE_STAIRS.addBlockAlternative(new BlockAlternative((short) 5637, \"facing=east\", \"half=top\", \"shape=outer_right\", \"waterlogged=false\"));\n Block.JUNGLE_STAIRS.addBlockAlternative(new BlockAlternative((short) 5638, \"facing=east\", \"half=bottom\", \"shape=straight\", \"waterlogged=true\"));\n Block.JUNGLE_STAIRS.addBlockAlternative(new BlockAlternative((short) 5639, \"facing=east\", \"half=bottom\", \"shape=straight\", \"waterlogged=false\"));\n Block.JUNGLE_STAIRS.addBlockAlternative(new BlockAlternative((short) 5640, \"facing=east\", \"half=bottom\", \"shape=inner_left\", \"waterlogged=true\"));\n Block.JUNGLE_STAIRS.addBlockAlternative(new BlockAlternative((short) 5641, \"facing=east\", \"half=bottom\", \"shape=inner_left\", \"waterlogged=false\"));\n Block.JUNGLE_STAIRS.addBlockAlternative(new BlockAlternative((short) 5642, \"facing=east\", \"half=bottom\", \"shape=inner_right\", \"waterlogged=true\"));\n Block.JUNGLE_STAIRS.addBlockAlternative(new BlockAlternative((short) 5643, \"facing=east\", \"half=bottom\", \"shape=inner_right\", \"waterlogged=false\"));\n Block.JUNGLE_STAIRS.addBlockAlternative(new BlockAlternative((short) 5644, \"facing=east\", \"half=bottom\", \"shape=outer_left\", \"waterlogged=true\"));\n Block.JUNGLE_STAIRS.addBlockAlternative(new BlockAlternative((short) 5645, \"facing=east\", \"half=bottom\", \"shape=outer_left\", \"waterlogged=false\"));\n Block.JUNGLE_STAIRS.addBlockAlternative(new BlockAlternative((short) 5646, \"facing=east\", \"half=bottom\", \"shape=outer_right\", \"waterlogged=true\"));\n Block.JUNGLE_STAIRS.addBlockAlternative(new BlockAlternative((short) 5647, \"facing=east\", \"half=bottom\", \"shape=outer_right\", \"waterlogged=false\"));\n }", "private void setInitialAndFinalStates() {\n for (int i = 0; i < dfaStates.size(); i++) {\n List<State> currStateList = dfaStates.get(i);\n for (int j = 0; j < currStateList.size(); j++) {\n if (currStateList.get(j).getFinal()) {\n if (!finalStates.contains(dfaStatesWithNumbering.get(currStateList))) {\n finalStates.add(dfaStatesWithNumbering.get(currStateList));\n }\n }\n if (currStateList.get(j).getInitial()) {\n initialStates.add(dfaStatesWithNumbering.get(currStateList));\n }\n }\n }\n }", "private void initializeNodes() {\n for (NasmInst inst : nasm.listeInst) {\n Node newNode = graph.newNode();\n inst2Node.put(inst, newNode);\n node2Inst.put(newNode, inst);\n if (inst.label != null) {\n NasmLabel label = (NasmLabel) inst.label;\n label2Inst.put(label.toString(), inst);\n }\n }\n }", "@Deprecated(\n since = \"forever\",\n forRemoval = false\n )\n public static void initStates() {\n Block.DAYLIGHT_DETECTOR.addBlockAlternative(new BlockAlternative((short) 6900, \"inverted=true\", \"power=0\"));\n Block.DAYLIGHT_DETECTOR.addBlockAlternative(new BlockAlternative((short) 6901, \"inverted=true\", \"power=1\"));\n Block.DAYLIGHT_DETECTOR.addBlockAlternative(new BlockAlternative((short) 6902, \"inverted=true\", \"power=2\"));\n Block.DAYLIGHT_DETECTOR.addBlockAlternative(new BlockAlternative((short) 6903, \"inverted=true\", \"power=3\"));\n Block.DAYLIGHT_DETECTOR.addBlockAlternative(new BlockAlternative((short) 6904, \"inverted=true\", \"power=4\"));\n Block.DAYLIGHT_DETECTOR.addBlockAlternative(new BlockAlternative((short) 6905, \"inverted=true\", \"power=5\"));\n Block.DAYLIGHT_DETECTOR.addBlockAlternative(new BlockAlternative((short) 6906, \"inverted=true\", \"power=6\"));\n Block.DAYLIGHT_DETECTOR.addBlockAlternative(new BlockAlternative((short) 6907, \"inverted=true\", \"power=7\"));\n Block.DAYLIGHT_DETECTOR.addBlockAlternative(new BlockAlternative((short) 6908, \"inverted=true\", \"power=8\"));\n Block.DAYLIGHT_DETECTOR.addBlockAlternative(new BlockAlternative((short) 6909, \"inverted=true\", \"power=9\"));\n Block.DAYLIGHT_DETECTOR.addBlockAlternative(new BlockAlternative((short) 6910, \"inverted=true\", \"power=10\"));\n Block.DAYLIGHT_DETECTOR.addBlockAlternative(new BlockAlternative((short) 6911, \"inverted=true\", \"power=11\"));\n Block.DAYLIGHT_DETECTOR.addBlockAlternative(new BlockAlternative((short) 6912, \"inverted=true\", \"power=12\"));\n Block.DAYLIGHT_DETECTOR.addBlockAlternative(new BlockAlternative((short) 6913, \"inverted=true\", \"power=13\"));\n Block.DAYLIGHT_DETECTOR.addBlockAlternative(new BlockAlternative((short) 6914, \"inverted=true\", \"power=14\"));\n Block.DAYLIGHT_DETECTOR.addBlockAlternative(new BlockAlternative((short) 6915, \"inverted=true\", \"power=15\"));\n Block.DAYLIGHT_DETECTOR.addBlockAlternative(new BlockAlternative((short) 6916, \"inverted=false\", \"power=0\"));\n Block.DAYLIGHT_DETECTOR.addBlockAlternative(new BlockAlternative((short) 6917, \"inverted=false\", \"power=1\"));\n Block.DAYLIGHT_DETECTOR.addBlockAlternative(new BlockAlternative((short) 6918, \"inverted=false\", \"power=2\"));\n Block.DAYLIGHT_DETECTOR.addBlockAlternative(new BlockAlternative((short) 6919, \"inverted=false\", \"power=3\"));\n Block.DAYLIGHT_DETECTOR.addBlockAlternative(new BlockAlternative((short) 6920, \"inverted=false\", \"power=4\"));\n Block.DAYLIGHT_DETECTOR.addBlockAlternative(new BlockAlternative((short) 6921, \"inverted=false\", \"power=5\"));\n Block.DAYLIGHT_DETECTOR.addBlockAlternative(new BlockAlternative((short) 6922, \"inverted=false\", \"power=6\"));\n Block.DAYLIGHT_DETECTOR.addBlockAlternative(new BlockAlternative((short) 6923, \"inverted=false\", \"power=7\"));\n Block.DAYLIGHT_DETECTOR.addBlockAlternative(new BlockAlternative((short) 6924, \"inverted=false\", \"power=8\"));\n Block.DAYLIGHT_DETECTOR.addBlockAlternative(new BlockAlternative((short) 6925, \"inverted=false\", \"power=9\"));\n Block.DAYLIGHT_DETECTOR.addBlockAlternative(new BlockAlternative((short) 6926, \"inverted=false\", \"power=10\"));\n Block.DAYLIGHT_DETECTOR.addBlockAlternative(new BlockAlternative((short) 6927, \"inverted=false\", \"power=11\"));\n Block.DAYLIGHT_DETECTOR.addBlockAlternative(new BlockAlternative((short) 6928, \"inverted=false\", \"power=12\"));\n Block.DAYLIGHT_DETECTOR.addBlockAlternative(new BlockAlternative((short) 6929, \"inverted=false\", \"power=13\"));\n Block.DAYLIGHT_DETECTOR.addBlockAlternative(new BlockAlternative((short) 6930, \"inverted=false\", \"power=14\"));\n Block.DAYLIGHT_DETECTOR.addBlockAlternative(new BlockAlternative((short) 6931, \"inverted=false\", \"power=15\"));\n }", "public abstract List<ThingNode> getFutureWorldStates(Instruction action);", "public void randomizeState() {\n\t\t//System.out.print(\"Randomizing State: \");\n\t\tArrayList<Integer> lst = new ArrayList<Integer>();\n\t\tfor(int i = 0; i<9; i++)// adds 0-8 to list\n\t\t\tlst.add(i);\n\t\tCollections.shuffle(lst);//randomizes list\n\t\tString str=\"\";\n\t\tfor(Integer i : lst)\n\t\t\tstr += String.valueOf(i);\n\t\t//System.out.println(str);\n\t\tcurrent = new PuzzleState(str,current.getString(current.getGoalState()));\n\t\t//pathCost++;\n\t}", "Set<ControllerNode> seedNodes();", "private State createStates( Grammar grammar, Collection<LR1ItemSet> itemSets)\n {\n itemSetMap = new HashMap<State, LR1ItemSet>();\n \n for( LR1ItemSet itemSet: itemSets) \n {\n log.debugf( \"\\n%s\", itemSet);\n itemSet.state = new State();\n itemSet.state.index = counter++;\n itemSetMap.put( itemSet.state, itemSet);\n }\n \n for( LR1ItemSet itemSet: itemSets)\n {\n Set<String> ts = new HashSet<String>();\n Set<String> nts = new HashSet<String>();\n \n List<Action> tshifts = new ArrayList<Action>();\n List<Action> ntshifts = new ArrayList<Action>();\n \n for( LR1Item item: itemSet.items)\n {\n if ( item.complete())\n {\n if ( item.rule == grammar.rules().get( 0))\n {\n if ( item.laList.contains( Grammar.terminus))\n {\n int[] terminal = new int[] { Grammar.terminusChar};\n tshifts.add( new Action( Action.Type.accept, terminal, item));\n }\n }\n else\n {\n for( String la: item.laList)\n {\n int[] terminal = grammar.toTerminal( la);\n tshifts.add( new Action( Action.Type.reduce, terminal, item));\n }\n }\n }\n else\n {\n if ( !grammar.isTerminal( item.symbol()))\n {\n nts.add( item.symbol());\n }\n else\n {\n Set<String> first = item.first( grammar);\n LR1ItemSet successor = itemSet.successors.get( item.symbol());\n if ( successor != null)\n {\n for( String symbol: first)\n {\n if ( ts.add( symbol))\n {\n int[] terminal = grammar.toTerminal( symbol);\n tshifts.add( new Action( Action.Type.tshift, terminal, successor));\n }\n }\n }\n }\n }\n }\n \n for( String symbol: nts)\n {\n LR1ItemSet successor = itemSet.successors.get( symbol);\n if ( successor != null)\n {\n List<Rule> rules = grammar.lhs( symbol);\n for( Rule rule: rules)\n {\n Action action = new Action( Action.Type.ntshift, new int[] { rule.symbol()}, successor);\n ntshifts.add( action);\n }\n }\n }\n \n buildActionTable( grammar, itemSet.state, tshifts, ntshifts);\n }\n \n return itemSets.iterator().next().state;\n }", "private void fiveNodesTopo() {\n ReadWriteTransaction tx = dataBroker.newReadWriteTransaction();\n n(tx, true, \"n1\", Stream.of(pI(\"n1:1\"), pB(\"n1:2\"), pI(\"n1:3\"), pO(\"n1:4\")));\n n(tx, true, \"n2\", Stream.of(pI(\"n2:1\"), pB(\"n2:2\"), pO(\"n2:3\"), pI(\"n2:4\")));\n n(tx, true, \"n3\", Stream.of(pO(\"n3:1\"), pB(\"n3:2\"), pO(\"n3:3\"), pI(\"n3:4\")));\n n(tx, true, \"n4\", Stream.of(pO(\"n4:1\"), pI(\"n4:2\"), pB(\"n4:3\"), pB(\"n4:4\")));\n n(tx, true, \"n5\", Stream.of(pI(\"n5:1\"), pB(\"n5:2\"), pB(\"n5:3\"), pO(\"n5:4\")));\n l(tx, \"n2\", \"n2:3\", \"n3\", \"n3:4\", OperationalState.ENABLED, ForwardingDirection.BIDIRECTIONAL);\n l(tx, \"n3\", \"n3:1\", \"n1\", \"n1:1\", OperationalState.ENABLED, ForwardingDirection.BIDIRECTIONAL);\n l(tx, \"n3\", \"n3:3\", \"n5\", \"n5:1\", OperationalState.ENABLED, ForwardingDirection.BIDIRECTIONAL);\n l(tx, \"n4\", \"n4:1\", \"n1\", \"n1:3\", OperationalState.ENABLED, ForwardingDirection.BIDIRECTIONAL);\n l(tx, \"n1\", \"n1:4\", \"n2\", \"n2:4\", OperationalState.ENABLED, ForwardingDirection.BIDIRECTIONAL);\n l(tx, \"n5\", \"n5:4\", \"n4\", \"n4:2\", OperationalState.ENABLED, ForwardingDirection.BIDIRECTIONAL);\n try {\n tx.submit().checkedGet();\n } catch (TransactionCommitFailedException e) {\n e.printStackTrace();\n }\n }", "public Set<StateVertex> getAllStates() {\n\t\treturn sfg.vertexSet();\n\t}", "public List<String> getSequentialPlan() {\n // ==========================================\n // Computing the (cheapest) sequence of steps\n // ==========================================\n \n // Maps of steps and cost from the global state s to the others\n Map<GlobalState,List<Step>> steps = new HashMap();\n steps.put(current,new ArrayList());\n Map<GlobalState,Integer> costs = new HashMap();\n costs.put(current,0);\n // List of visited states\n List<GlobalState> visited = new ArrayList();\n visited.add(current);\n\n // List of global states still to be visited\n List<GlobalState> toBeVisited = new ArrayList();\n \n // Adding the states reachable from start to \"toBeVisited\"\n for(Step step : current.getSteps()) {\n GlobalState next = step.getNextGlobalState();\n // Adding the sequence of operations towards \"next\" \n List<Step> stepSeq = new ArrayList();\n stepSeq.add(step);\n steps.put(next,stepSeq);\n // Adding the cost of the sequence of operation towards \"next\"\n costs.put(next,step.getCost());\n toBeVisited.add(next);\n }\n \n // Exploring the graph of global states by exploiting \"toBeVisited\"\n while(toBeVisited.size() > 0) {\n // Removing the first global state to be visited and marking it\n // as visited\n GlobalState current = toBeVisited.remove(0);\n visited.add(current);\n \n for(Step step : current.getSteps()) {\n GlobalState next = step.getNextGlobalState();\n // Adding the sequence of operations from \"start\" to \"next\"\n // (if more convenient)\n int nextCost = costs.get(current) + step.getCost();\n if(visited.contains(next)) {\n // If current path is cheaper, updates \"steps\" and \"costs\"\n if(costs.get(next) > nextCost) {\n List<Step> stepSeq = new ArrayList();\n stepSeq.addAll(steps.get(current));\n stepSeq.add(step);\n steps.put(next,stepSeq);\n costs.put(next,nextCost);\n }\n } else {\n List<Step> stepSeq = new ArrayList();\n stepSeq.addAll(steps.get(current));\n stepSeq.add(step);\n steps.put(next,stepSeq);\n costs.put(next, nextCost);\n if(!(toBeVisited.contains(next))) toBeVisited.add(next);\n }\n }\n }\n \n // ====================================================\n // Computing the sequence of operations from \"s\" to \"t\"\n // ====================================================\n // If no plan is available, return null\n if(steps.get(target) == null) \n return null;\n // Otherwise, return the corresponding sequence of operations\n List<String> opSequence = new ArrayList();\n for(Step step : steps.get(target)) {\n if(!(step.getReason().contains(Step.handling))) {\n opSequence.add(step.getReason());\n }\n }\n return opSequence;\n }", "Collection<Node> allNodes();", "private void generateAutomaton() {\n /**\n * Chars in the positions:\n * 0 -> \"-\"\n * 1 -> \"+\"\n * 2 -> \"/\"\n * 3 -> \"*\"\n * 4 -> \")\"\n * 5 -> \"(\"\n * 6 -> \"=\"\n * 7 -> \";\"\n * 8 -> [0-9]\n * 9 -> [A-Za-z]\n * 10 -> skip (\"\\n\", \"\\r\", \" \", \"\\t\")\n * 11 -> other symbols\n */\n\n automaton = new State[][]{\n /* DEAD */ {State.DEAD, State.DEAD, State.DEAD, State.DEAD, State.DEAD, State.DEAD, State.DEAD, State.DEAD, State.DEAD, State.DEAD, State.DEAD, State.DEAD},\n /* START */ {State.SUB, State.PLUS, State.DIV, State.MUL, State.RPAR, State.LPAR, State.EQ, State.SMICOLON, State.INT, State.VAR, State.DEAD, State.DEAD},\n /* SUB */ {State.DEAD, State.DEAD, State.DEAD, State.DEAD, State.DEAD, State.DEAD, State.DEAD, State.DEAD, State.DEAD, State.DEAD, State.DEAD, State.DEAD},\n /* PLUS */ {State.DEAD, State.DEAD, State.DEAD, State.DEAD, State.DEAD, State.DEAD, State.DEAD, State.DEAD, State.DEAD, State.DEAD, State.DEAD, State.DEAD},\n /* DIV */ {State.DEAD, State.DEAD, State.DEAD, State.DEAD, State.DEAD, State.DEAD, State.DEAD, State.DEAD, State.DEAD, State.DEAD, State.DEAD, State.DEAD},\n /* MUL */ {State.DEAD, State.DEAD, State.DEAD, State.DEAD, State.DEAD, State.DEAD, State.DEAD, State.DEAD, State.DEAD, State.DEAD, State.DEAD, State.DEAD},\n /* RPAR */ {State.DEAD, State.DEAD, State.DEAD, State.DEAD, State.DEAD, State.DEAD, State.DEAD, State.DEAD, State.DEAD, State.DEAD, State.DEAD, State.DEAD},\n /* LPAR */ {State.DEAD, State.DEAD, State.DEAD, State.DEAD, State.DEAD, State.DEAD, State.DEAD, State.DEAD, State.DEAD, State.DEAD, State.DEAD, State.DEAD},\n /* EQ */ {State.DEAD, State.DEAD, State.DEAD, State.DEAD, State.DEAD, State.DEAD, State.DEAD, State.DEAD, State.DEAD, State.DEAD, State.DEAD, State.DEAD},\n /* SMICOLON */ {State.DEAD, State.DEAD, State.DEAD, State.DEAD, State.DEAD, State.DEAD, State.DEAD, State.DEAD, State.DEAD, State.DEAD, State.DEAD, State.DEAD},\n /* INT */ {State.DEAD, State.DEAD, State.DEAD, State.DEAD, State.DEAD, State.DEAD, State.DEAD, State.DEAD, State.INT, State.DEAD, State.DEAD, State.DEAD},\n /* VAR */ {State.DEAD, State.DEAD, State.DEAD, State.DEAD, State.DEAD, State.DEAD, State.DEAD, State.DEAD, State.VAR, State.VAR, State.DEAD, State.DEAD}\n };\n }", "private void buildReachable() {\n // This is a simple search algorithm.\n // It doesn't matter whether it's depth-first or breadth-first.\n this.reachables = new ArrayList<Boolean>();\n for (int n = 0; n < code.size(); n++) {\n this.reachables.add(false);\n }\n\n ArrayDeque<Integer> next = new ArrayDeque<Integer>();\n if (!code.isEmpty()) {\n next.add(0);\n }\n \n while (!next.isEmpty()) {\n int here = next.remove();\n \n if (this.reachables.get(here)) {\n continue;\n }\n this.reachables.set(here, true);\n next.addAll(this.succ(here));\n }\n }", "@Deprecated(\n since = \"forever\",\n forRemoval = false\n )\n public static void initStates() {\n Block.TARGET.addBlockAlternative(new BlockAlternative((short) 16014, \"power=0\"));\n Block.TARGET.addBlockAlternative(new BlockAlternative((short) 16015, \"power=1\"));\n Block.TARGET.addBlockAlternative(new BlockAlternative((short) 16016, \"power=2\"));\n Block.TARGET.addBlockAlternative(new BlockAlternative((short) 16017, \"power=3\"));\n Block.TARGET.addBlockAlternative(new BlockAlternative((short) 16018, \"power=4\"));\n Block.TARGET.addBlockAlternative(new BlockAlternative((short) 16019, \"power=5\"));\n Block.TARGET.addBlockAlternative(new BlockAlternative((short) 16020, \"power=6\"));\n Block.TARGET.addBlockAlternative(new BlockAlternative((short) 16021, \"power=7\"));\n Block.TARGET.addBlockAlternative(new BlockAlternative((short) 16022, \"power=8\"));\n Block.TARGET.addBlockAlternative(new BlockAlternative((short) 16023, \"power=9\"));\n Block.TARGET.addBlockAlternative(new BlockAlternative((short) 16024, \"power=10\"));\n Block.TARGET.addBlockAlternative(new BlockAlternative((short) 16025, \"power=11\"));\n Block.TARGET.addBlockAlternative(new BlockAlternative((short) 16026, \"power=12\"));\n Block.TARGET.addBlockAlternative(new BlockAlternative((short) 16027, \"power=13\"));\n Block.TARGET.addBlockAlternative(new BlockAlternative((short) 16028, \"power=14\"));\n Block.TARGET.addBlockAlternative(new BlockAlternative((short) 16029, \"power=15\"));\n }", "public abstract Op resetStates();", "private void setupDFA() {\r\n\t\tcurrentState = 0;\r\n\t\tif (actor.getScheduleFSM() == null) {\r\n\t\t\t// generate trivial DFA in case there is no schedule fsm.\r\n\t\t\t// 1. only one state\r\n\t\t\t// 2. all actions are eligible\r\n\t\t\t// 3. the successor state is always the same\r\n\t\t\teligibleActions = new Action [][] {actions};\r\n\t\t\tsuccessorState = new int [1] [actions.length];\r\n\t\t\tfor (int i = 0; i < actions.length; i++) {\r\n\t\t\t\tsuccessorState[0][i] = 0;\r\n\t\t\t}\r\n\t\t\treturn;\r\n\t\t}\r\n\t\t\r\n\t\tSet stateSets = new HashSet();\r\n\t\t// put initial state into set of state sets\r\n\t\tSet initialState = Collections.singleton(actor.getScheduleFSM().getInitialState());\r\n\t\tstateSets.add(initialState);\r\n\t\tint previousSize = 0;\r\n\t\t// iterate until fixed-point, i.e. we cannot reach any new state set\r\n\t\twhile (previousSize != stateSets.size()) {\r\n\t\t\tpreviousSize = stateSets.size();\r\n\t\t\t// for each action...\r\n\t\t\tfor (int i = 0; i < actions.length; i ++) {\r\n\t\t\t\tSet nextStates = new HashSet();\r\n\t\t\t\t// ... compute the set of states that can be reached through it... \r\n\t\t\t\tfor (Iterator j = stateSets.iterator(); j.hasNext(); ) {\r\n\t\t\t\t\tSet s = (Set) j.next();\r\n\t\t\t\t\tif (isEligibleAction(s, actions[i])) {\r\n\t\t\t\t\t\tnextStates.add(computeNextStateSet(s, actions[i]));\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\t// ... and add them to the state set\r\n\t\t\t\tstateSets.addAll(nextStates);\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\t// The set of all reachable state sets is the state space of the NDA. \r\n\t\tndaStateSets = (Set []) new ArrayList(stateSets).toArray(new Set[stateSets.size()]);\r\n\t\t// Make sure the initial state is state 0.\r\n\t\tfor (int i = 0; i < ndaStateSets.length; i++) {\r\n\t\t\tif (ndaStateSets[i].equals(initialState)) {\r\n\t\t\t\tSet s = ndaStateSets[i];\r\n\t\t\t\tndaStateSets[i] = ndaStateSets[0];\r\n\t\t\t\tndaStateSets[0] = s;\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\teligibleActions = new Action [ndaStateSets.length] [];\r\n\t\tsuccessorState = new int [ndaStateSets.length] [];\r\n\t\t// For each state set (i.e. each NDA state), identify the eligible actions,\r\n\t\t// and also the successor state set (i.e. the successor state in the NDA).\r\n\t\tfor (int i = 0; i < ndaStateSets.length; i++) {\r\n\t\t\tList ea = new ArrayList();\r\n\t\t\tList ss = new ArrayList();\r\n\t\t\tfor (int j = 0; j < actions.length; j++) {\r\n\t\t\t\tif (isEligibleAction(ndaStateSets[i], actions[j])) {\r\n\t\t\t\t\tea.add(actions[j]);\r\n\t\t\t\t\tss.add(computeNextStateSet(ndaStateSets[i], actions[j]));\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\teligibleActions[i] = (Action []) ea.toArray(new Action[ea.size()]);\r\n\t\t\tList ds = Arrays.asList(ndaStateSets); // so we can use List.indexOf()\r\n\t\t\tsuccessorState[i] = new int [ss.size()];\r\n\t\t\t// locta the NDA successor state in array\r\n\t\t\tfor (int j = 0; j < ss.size(); j++) {\r\n\t\t\t\tsuccessorState[i][j] = ds.indexOf(ss.get(j));\r\n\t\t\t\t\r\n\t\t\t\t// must be in array, because we iterated until reaching a fixed point.\r\n\t\t\t\tassert successorState[i][j] >= 0;\r\n\t\t\t}\r\n\t\t}\r\n\t}", "public void optimize(){\n\n NfaState currState;\n HashMap<Integer, State> statesCloned = (HashMap)states.clone();\n\n\n boolean removed;\n\n for(Map.Entry<Integer, State> entry : statesCloned.entrySet()) {//for each state of the nfa\n\n do {\n removed=false;\n Integer id = entry.getKey();\n\n if (states.get(id) == null)//state already been removed\n continue;\n else\n currState = (NfaState) entry.getValue();\n\n HashMap<String, ArrayList<Integer>> startEdges = currState.getOut_edges();\n\n for (Map.Entry<String, ArrayList<Integer>> startEdge : startEdges.entrySet()) {//for each edge of the current state being optimezed\n\n ArrayList<Integer> transactions = new ArrayList(startEdge.getValue());\n\n\n for (Integer state2DegID : transactions) {// for each transaction the 2nd degree state\n NfaState stateDeg2 = (NfaState) states.get(state2DegID);\n\n if (stateDeg2.getOut_edges() == null)\n continue;\n\n\n\n ArrayList<Integer> edgesDeg2 = stateDeg2.getOut_edges().get(EPSILON);\n\n if (edgesDeg2 != null && edgesDeg2.size() == 1 && stateDeg2.getOut_edges().size() == 1) {//if the next state has only a epsilon transaction, we can remove this state\n NfaState successor = (NfaState) states.get(edgesDeg2.get(0));\n\n\n for (Map.Entry<String, ArrayList<Integer>> inEdgesDeg2 : stateDeg2.getIn_edges().entrySet()) {//for every in_edge of the state being removed, update the elements accordingly\n String key = inEdgesDeg2.getKey();\n\n if (inEdgesDeg2.getValue().size() > 0)\n removed = true;\n\n for (Integer stateBeingUpdatedId : inEdgesDeg2.getValue()) {//state to be updated\n NfaState stateBeingUpdated = (NfaState) states.get(stateBeingUpdatedId);\n //add new edge\n stateBeingUpdated.addEdge(key, successor);\n\n //remove out and in edge to intermediate\n stateBeingUpdated.getOut_edges().get(key).remove((Integer) stateDeg2.getId());\n }\n }\n\n //remove out_edges\n for (Map.Entry<String, ArrayList<Integer>> outEdgesDeg2 : stateDeg2.getOut_edges().entrySet()) {\n for (Integer sucId : outEdgesDeg2.getValue()){\n ((NfaState)states.get(sucId)).getIn_edges().get(outEdgesDeg2.getKey()).remove((Integer) stateDeg2.getId());\n }\n }\n //remove state\n states.remove(stateDeg2.getId());\n }\n }\n\n }\n\n }while (removed);\n }\n }", "public void initialize(ISimulation s) {\n\t\tif(s.equals(currentSimulation)) return; // done\n\t\t\n\t\t//HashSet<String>countries = new HashSet<String>();\n\t\tHashMap<String, Set<String>> nodeIdMap = new HashMap<String, Set<String>>();\n\t\t\n\t\tGraph g = s.getScenario().getCanonicalGraph();\n\t\tEMap<URI, Node>nodes = g.getNodes();\n\t\tfor(Entry<URI, Node> entry : nodes.entrySet()) {\n\t\t\tNode n = entry.getValue();\t\t\n\t\t\tString id = n.getURI().lastSegment();\n\t\t\tString ctry = getCountry(id);\n\t\t\tif(ctry != null && nodeIdMap.containsKey(ctry)) // It's a country\n\t\t\t\tnodeIdMap.get(ctry).add(id);\n\t\t\telse if(ctry != null && !nodeIdMap.containsKey(ctry)) {\n\t\t\t\tHashSet<String>ids = new HashSet<String>();\n\t\t\t\tids.add(id);\n\t\t\t\tnodeIdMap.put(ctry, ids);\n\t\t\t}\n\t\t}\n\t\t\n\t\tSet<String[]> commonBorderIdPairsSet = new HashSet<String[]>();\n\t\t\n\t\tfor(Entry<URI, Edge> entry:g.getEdges()) {\n\t\t\tEdge e = entry.getValue();\n\t\t\tif(e.getLabel() instanceof RelativePhysicalRelationshipLabel) \n\t\t\t\tcontinue;\t// skip\n\t\t\tString [] st = new String[2];\n\t\t\tif(e.getA() != null && e.getB() != null) {\n\t\t\t\tst[0] = e.getA().getURI().lastSegment();\n\t\t\t\tst[1] = e.getB().getURI().lastSegment();\n\t\t\t\tcommonBorderIdPairsSet.add(st);\n\t\t\t}\n\t\t}\n\t\t// Now determine the partitioning using Jamie's algorithm\n\t\t\n\t\t\n\t\tGlobalTileGenerator gtg = new GlobalTileGenerator(this.getNumNodes(), nodeIdMap, commonBorderIdPairsSet);\n\t\t\n\t\tList<Set<String>>partitionedNodes = gtg.getParitionedNodes();\n\t\t\n\t\tint rank = 0;\n\t\tfor(Set<String> allIds:partitionedNodes) {\n\t\t\tfor(String id:allIds) \n\t\t\t\trankCache.put(id, rank);\n\t\t\t++rank;\n\t\t}\n\t\tcurrentSimulation = s;\n\t}", "private void _generateAdjacentCountries() {\n\n // North America\n this.adjCountries.put(CountryName.Alaska, new CountryName[] {\n CountryName.NorthwestTerritories });\n this.adjCountries.put(CountryName.WesternCanada, new CountryName[] {\n CountryName.NorthwestTerritories,\n CountryName.CentralCanada,\n CountryName.WesternCanada,\n CountryName.WesternUS});\n this.adjCountries.put(CountryName.CentralAmerica, new CountryName[] {\n CountryName.EasternUS,\n CountryName.WesternUS,\n CountryName.Venezuela});\n this.adjCountries.put(CountryName.EasternUS, new CountryName[] {\n CountryName.CentralAmerica,\n CountryName.CentralCanada,\n CountryName.WesternUS });\n this.adjCountries.put(CountryName.Greenland, new CountryName[] {\n CountryName.NorthwestTerritories,\n CountryName.CentralCanada,\n CountryName.EasternCanada,\n CountryName.Iceland });\n this.adjCountries.put(CountryName.NorthwestTerritories, new CountryName[] {\n CountryName.Alaska,\n CountryName.WesternCanada,\n CountryName.Greenland,\n CountryName.CentralCanada });\n this.adjCountries.put(CountryName.CentralCanada, new CountryName[] {\n CountryName.WesternCanada,\n CountryName.Greenland,\n CountryName.NorthwestTerritories,\n CountryName.EasternCanada });\n this.adjCountries.put(CountryName.EasternCanada, new CountryName[] {\n CountryName.EasternUS,\n CountryName.Greenland,\n CountryName.NorthwestTerritories,\n CountryName.CentralCanada });\n this.adjCountries.put(CountryName.WesternUS, new CountryName[] {\n CountryName.WesternCanada,\n CountryName.CentralAmerica,\n CountryName.EasternUS,\n CountryName.CentralCanada });\n\n // South America\n this.adjCountries.put(CountryName.Argentina, new CountryName[] {\n CountryName.Brazil,\n CountryName.Peru });\n this.adjCountries.put(CountryName.Brazil, new CountryName[] {\n CountryName.Argentina,\n CountryName.Peru,\n CountryName.Venezuela});\n this.adjCountries.put(CountryName.Peru, new CountryName[] {\n CountryName.Argentina,\n CountryName.Brazil,\n CountryName.Venezuela });\n this.adjCountries.put(CountryName.Venezuela, new CountryName[] {\n CountryName.Brazil,\n CountryName.Peru,\n CountryName.CentralAmerica});\n\n // Europe\n this.adjCountries.put(CountryName.GreatBritain, new CountryName[] {\n CountryName.Iceland,\n CountryName.NorthernEurope,\n CountryName.Scandinavia,\n CountryName.WesternEurope });\n this.adjCountries.put(CountryName.Iceland, new CountryName[] {\n CountryName.GreatBritain,\n CountryName.Greenland });\n this.adjCountries.put(CountryName.NorthernEurope, new CountryName[] {\n CountryName.GreatBritain,\n CountryName.Scandinavia,\n CountryName.SouthernEurope,\n CountryName.Ukraine,\n CountryName.WesternEurope });\n this.adjCountries.put(CountryName.Scandinavia, new CountryName[] {\n CountryName.GreatBritain,\n CountryName.Iceland,\n CountryName.NorthernEurope,\n CountryName.Ukraine });\n this.adjCountries.put(CountryName.SouthernEurope, new CountryName[] {\n CountryName.NorthernEurope,\n CountryName.Ukraine,\n CountryName.WesternEurope,\n CountryName.Egypt,\n CountryName.NorthAfrica,\n CountryName.MiddleEast });\n this.adjCountries.put(CountryName.Ukraine, new CountryName[] {\n CountryName.NorthernEurope,\n CountryName.Scandinavia,\n CountryName.SouthernEurope,\n CountryName.Afghanistan,\n CountryName.MiddleEast,\n CountryName.Ural });\n this.adjCountries.put(CountryName.WesternEurope, new CountryName[] {\n CountryName.GreatBritain,\n CountryName.NorthernEurope,\n CountryName.SouthernEurope,\n CountryName.NorthAfrica });\n\n // Africa\n this.adjCountries.put(CountryName.Congo, new CountryName[] {\n CountryName.EastAfrica,\n CountryName.NorthAfrica,\n CountryName.SouthAfrica });\n this.adjCountries.put(CountryName.EastAfrica, new CountryName[] {\n CountryName.Congo,\n CountryName.Egypt,\n CountryName.Madagascar,\n CountryName.MiddleEast });\n this.adjCountries.put(CountryName.Egypt, new CountryName[] {\n CountryName.EastAfrica,\n CountryName.NorthAfrica,\n CountryName.SouthernEurope,\n CountryName.MiddleEast });\n this.adjCountries.put(CountryName.Madagascar, new CountryName[] {\n CountryName.EastAfrica,\n CountryName.SouthAfrica });\n this.adjCountries.put(CountryName.NorthAfrica, new CountryName[] {\n CountryName.Congo,\n CountryName.Egypt,\n CountryName.Brazil,\n CountryName.SouthernEurope,\n CountryName.WesternEurope });\n this.adjCountries.put(CountryName.SouthAfrica, new CountryName[] {\n CountryName.Congo,\n CountryName.EastAfrica,\n CountryName.Madagascar });\n\n // Asia\n this.adjCountries.put(CountryName.Afghanistan, new CountryName[] {\n CountryName.China,\n CountryName.India,\n CountryName.MiddleEast,\n CountryName.Ural,\n CountryName.Ukraine });\n this.adjCountries.put(CountryName.China, new CountryName[] {\n CountryName.Afghanistan,\n CountryName.India,\n CountryName.Mongolia,\n CountryName.Siam,\n CountryName.Siberia,\n CountryName.Ural });\n this.adjCountries.put(CountryName.India, new CountryName[] {\n CountryName.Afghanistan,\n CountryName.China,\n CountryName.MiddleEast });\n this.adjCountries.put(CountryName.Irkutsk, new CountryName[] {\n CountryName.Kamchatka,\n CountryName.Mongolia,\n CountryName.Siberia,\n CountryName.Yakutsk });\n this.adjCountries.put(CountryName.Japan, new CountryName[] {\n CountryName.Kamchatka,\n CountryName.Mongolia });\n this.adjCountries.put(CountryName.Kamchatka, new CountryName[] {\n CountryName.Irkutsk,\n CountryName.Japan,\n CountryName.Yakutsk });\n this.adjCountries.put(CountryName.MiddleEast, new CountryName[] {\n CountryName.Afghanistan,\n CountryName.India,\n CountryName.EastAfrica,\n CountryName.Egypt,\n CountryName.SouthernEurope,\n CountryName.Ukraine });\n this.adjCountries.put(CountryName.Mongolia, new CountryName[] {\n CountryName.China,\n CountryName.Irkutsk,\n CountryName.Japan,\n CountryName.Kamchatka,\n CountryName.Siberia });\n this.adjCountries.put(CountryName.Siam, new CountryName[] {\n CountryName.China,\n CountryName.India,\n CountryName.Indonesia });\n this.adjCountries.put(CountryName.Siberia, new CountryName[] {\n CountryName.China,\n CountryName.Irkutsk,\n CountryName.Mongolia,\n CountryName.Ural,\n CountryName.Yakutsk });\n this.adjCountries.put(CountryName.Ural, new CountryName[] {\n CountryName.Afghanistan,\n CountryName.China,\n CountryName.Siberia,\n CountryName.Ukraine });\n this.adjCountries.put(CountryName.Yakutsk, new CountryName[] {\n CountryName.Irkutsk,\n CountryName.Kamchatka,\n CountryName.Siberia });\n\n // Australia\n this.adjCountries.put(CountryName.EasternAustralia, new CountryName[] {\n CountryName.NewGuinea,\n CountryName.WesternAustralia});\n this.adjCountries.put(CountryName.Indonesia, new CountryName[] {\n CountryName.NewGuinea,\n CountryName.WesternAustralia,\n CountryName.Siam });\n this.adjCountries.put(CountryName.NewGuinea, new CountryName[] {\n CountryName.EasternAustralia,\n CountryName.Indonesia });\n this.adjCountries.put(CountryName.WesternAustralia, new CountryName[] {\n CountryName.EasternAustralia,\n CountryName.NewGuinea,\n CountryName.Indonesia});\n }", "public GameState(int initialStones) \n {\n \tif (initialStones < 1) initialStones = 4;\n \tfor (int i=0; i<6; i++)\n \t\tstate[i] = state[i+7] = initialStones;\n }", "@Test\n public void genStateTransferMetric() {\n TreeMap<String, Integer> stat = new TreeMap<>();\n int currState = 8;\n for (int i = 1; i < numSteps; i++) {\n int nextStates = getNextState(currState);\n stat.compute(currState + \"-\" + nextStates, (k, v) -> v == null ? 1 : v + 1);\n currState = nextStates;\n }\n stat.forEach((k, v) -> System.out.printf(\"%s:%f\\n\", k.replace('-', ':'), (double) v / numSteps));\n }", "private void loadRandomState() {\n patternName = \"Random\";\n\n for (int i = 0; i < NUMCELLS; i++)\n currentState[i] = (rand.nextInt() > 0x40000000) ? (byte)1 : (byte)0;\n\n generations = 0;\n }", "@Override\n\tpublic ArrayList<ST_Node> getNewNodes(ArrayList<String> newStates, ST_Node parent, HashSet<String> dict) {\n\t\tString[] states = new String[newStates.size()];\n\t\tstates = newStates.toArray(states);\n\t\tArrayList<ST_Node> newNodes = new ArrayList<ST_Node>();\n\n\t\tfor (int i = 0; i < states.length; i++) {\n\t\t\tString currentState = states[i];\n\t\t\tString[] imfAll = currentState.split(\";\")[3].split(\"-\");\n\t\t\tint[] cost = new int[] { 0, 0 };\n\t\t\tint totalDeaths = 0;\n\t\t\tint totalSurvived = 0;\n\t\t\tfor (int j = 0; j < imfAll.length; j++) {\n\t\t\t\tif (imfAll[j].split(\",\")[2].equals(\"100\")) {\n\t\t\t\t\ttotalDeaths++;\n\t\t\t\t}\n\t\t\t\t//if (!imfAll[j].split(\",\")[3].equals(\"F\")) {\n\t\t\t\ttotalSurvived = totalSurvived + Integer.parseInt(imfAll[j].split(\",\")[2]);\n\t\t\t\t//}\n\t\t\t}\n\t\t\tcost[0] = totalDeaths;\n\t\t\tcost[1] = totalSurvived;\n\t\t\tString op = currentState.split(\">>\")[1];\n\t\t\tcurrentState = currentState.split(\">>\")[0];\n\t\t\tif (!dict.contains(currentState)) {\n\t\t\t\tST_Node newNode = new ST_Node(currentState, parent, op, parent.getDepth() + 1, cost);\n\t\t\t\tnewNodes.add(newNode);\n\t\t\t}\n\n\t\t}\n\t\treturn newNodes;\n\t}", "protected abstract int numStates();", "private void updateNodes(){\n ArrayList<Node> tempBoard = new ArrayList<>();\n\n for(int i = 0; i < board.size(); i++){\n Node node = new Node(board.get(i).getCoordinates());\n\n tempBoard.add(node);\n }\n\n\n //check each node for number of live nodes next to it to determine next iteration\n for(int i = 0; i < board.size(); i++){\n int liveCount = 0;\n\n Coordinate current = board.get(i).getCoordinates();\n\n Coordinate above = new Coordinate(current.getX(), current.getY() - 1);\n if(searchBoard(above) != -1){\n Node aboveNode = board.get(searchBoard(above));\n if(aboveNode.getState()){\n liveCount++;\n }\n }\n\n Coordinate bellow = new Coordinate(current.getX(), current.getY() + 1);\n if(searchBoard(bellow) != -1){\n Node bellowNode = board.get(searchBoard(bellow));\n if(bellowNode.getState()){\n liveCount++;\n }\n }\n\n Coordinate right = new Coordinate(current.getX() + 1, current.getY());\n if(searchBoard(right) != -1){\n Node rightNode = board.get(searchBoard(right));\n if(rightNode.getState()){\n liveCount++;\n }\n }\n\n Coordinate left = new Coordinate(current.getX() - 1, current.getY());\n if(searchBoard(left) != -1){\n Node leftNode = board.get(searchBoard(left));\n if(leftNode.getState()){\n liveCount++;\n }\n }\n\n Coordinate topLeft = new Coordinate(current.getX() - 1, current.getY() - 1);\n if(searchBoard(topLeft) != -1){\n Node topLeftNode = board.get(searchBoard(topLeft));\n if(topLeftNode.getState()){\n liveCount++;\n }\n }\n\n Coordinate topRight = new Coordinate(current.getX() + 1, current.getY() - 1);\n if(searchBoard(topRight) != -1){\n Node topRightNode = board.get(searchBoard(topRight));\n if(topRightNode.getState()){\n liveCount++;\n }\n }\n\n Coordinate bottomLeft = new Coordinate(current.getX() - 1, current.getY() + 1);\n if(searchBoard(bottomLeft) != -1){\n Node bottomLeftNode = board.get(searchBoard(bottomLeft));\n if(bottomLeftNode.getState()){\n liveCount++;\n }\n }\n\n Coordinate bottomRight = new Coordinate(current.getX() + 1, current.getY() + 1);\n if(searchBoard(bottomRight) != -1){\n Node bottomRightNode = board.get(searchBoard(bottomRight));\n if(bottomRightNode.getState()){\n liveCount++;\n }\n }\n\n //determine if node is alive or dead in next frame\n if(board.get(i).getState()){\n if(liveCount <= 1){\n tempBoard.get(i).setState(false);\n } else if(liveCount >= 3){\n tempBoard.get(i).setState(false);\n } else {\n tempBoard.get(i).setState(true);\n }\n } else {\n if(liveCount == 3){\n tempBoard.get(i).setState(true);\n } else {\n tempBoard.get(i).setState(false);\n }\n }\n }\n\n //update current board with new states\n for(int i = 0; i < tempBoard.size(); i++){\n board.get(i).setState(tempBoard.get(i).getState());\n }\n }", "private void computeAllPaths()\n {\n for (Station src : this.graph.stations)\n {\n List<Station> visited = new ArrayList<Station>();\n computePathsForNode(src, null, null, visited);\n }\n Print.printTripList(this.tripList);\n }", "public long[] getState() {\n return new long[] {(long)Cg0, (long)Cg1, (long)Cg2,\n (long)Cg3, (long)Cg4, (long)Cg5};\n }", "private void colorNodes() {\n for (NodeImpl n : supervisedNodes) {\n colorNode(n);\n }\n }", "private Collection<Node> getNodes()\r\n\t{\r\n\t return nodeMap.values();\r\n\t}", "@Override\n public Map<Coordinate, List<Coordinate>> getAllLegalMoves(List<Integer> playerStates) {\n Map<Coordinate, List<Coordinate>> allLegalMoves = new TreeMap<>();\n for (List<GamePiece> row: myGamePieces) {\n for(GamePiece currPiece: row){\n if (playerStates.contains(currPiece.getState()) || currPiece.getState() == myEmptyState) {\n Coordinate currCoord = currPiece.getPosition();\n List<Coordinate> moves = currPiece.calculateAllPossibleMoves(getNeighbors(currPiece), playerStates.get(0));\n if (moves.size() > 0) {\n allLegalMoves.put(currCoord, moves);\n }\n }\n }\n }\n return allLegalMoves;\n }", "private void createNodesMaps()\n {\n Maze maze = gameState.getMazeState().getMaze();\n\n for (Node node : maze.getNodes()) {\n pixelsNodes.put(nodeToPixelIndex(node), node);\n }\n\n for (Node node : maze.getPillsNodes()) {\n pixelsPillNodes.put(nodeToPixelIndex(node), node);\n }\n\n for (Node node : maze.getPowerPillsNodes()) {\n pixelsPowerPillNodes.put(nodeToPixelIndex(node), node);\n }\n }", "public static long journeyToMoon(int n, List<List<Integer>> astronaut) {\n // Write your code here\n Map<Integer, Node<Integer>> countryMap = new HashMap<>();\n for(List<Integer> pairs: astronaut) {\n Node<Integer> node1 = countryMap.computeIfAbsent(pairs.get(0), Node::new);\n Node<Integer> node2 = countryMap.computeIfAbsent(pairs.get(1), Node::new);\n node1.connected.add(node2);\n node2.connected.add(node1);\n }\n\n List<Integer> countryCluster = new ArrayList<>();\n for(Node<Integer> node: countryMap.values()) {\n if(node.connected.size() == 0) {\n countryCluster.add(1);\n } else if(!node.visited){\n countryCluster.add(getNodeCount3(node));\n }\n }\n List<Integer> countryNodes = countryMap.values().stream().map(nn -> nn.value).collect(Collectors.toList());\n List<Integer> missingNodes = new ArrayList<>();\n for(int i=0; i < n; i++) {\n if(!countryNodes.contains(i))\n missingNodes.add(i);\n }\n\n for(int i=0; i < missingNodes.size(); i++) {\n countryCluster.add(1);\n }\n\n long ans = 0;\n //For one country we cannot pair with any other astronauts\n if(countryCluster.size() >= 2) {\n ans = (long) countryCluster.get(0) * countryCluster.get(1);\n if(countryCluster.size() > 2) {\n int sum = countryCluster.get(0) + countryCluster.get(1);\n for(int i=2; i < countryCluster.size(); i++) {\n ans += (long) sum * countryCluster.get(i);\n sum += countryCluster.get(i);\n }\n }\n }\n\n /*\n permutation of two set with size A and B = AxB\n permutation of three set with size A,B,C = AxB + AxC + BxC = AxB + (A+B)xC\n permutation of four set with size A,B,C,D = AxB + AxC + AxD + BxC + BxD + CxD = AxB + (A+B)xC + (A+B+C)xD\n */\n /*\n if(keys.length == 1) {\n ans = keys[0].size();\n } else {\n ans = keys[0].size() * keys[1].size();\n if(keys.length > 2) {\n int sum = keys[0].size() + keys[1].size();\n for (int i = 2; i < keys.length; i++) {\n ans += sum * keys[i].size();\n sum += keys[i].size();\n }\n }\n }\n */\n return ans;\n }", "private void initFourNodes(InitType type) {\n if (type == InitType.RANDOM) {\n for (int i = 0; i < 2; i++) {\n for (int j = 0; j < 2; j++) {\n GNode initNode = new GNode(i, j, Utils.generateRandomArray(GSOMConstants.DIMENSIONS));\n nodeMap.put(Utils.generateIndexString(i, j), initNode);\n }\n }\n } else if (type == InitType.LINEAR) {\n double initVal = 0.1;\n for (int i = 0; i < 2; i++) {\n for (int j = 0; j < 2; j++) {\n GNode initNode = new GNode(i, j, Utils.generateLinearArray(GSOMConstants.DIMENSIONS, initVal));\n nodeMap.put(Utils.generateIndexString(i, j), initNode);\n initVal += 0.1;\n }\n }\n }\n }", "private int[][] initialStateMatrix() {\n return new int[][]{{2,1,-1,3,0,-1},\n {2,-1,-1,3,-1,-1},\n {2,-1,5,4,8,-1},\n {4,-1,-1,-1,-1,-1},\n {4,-1,5,-1,8,-1},\n {7,6,-1,-1,-1,-1},\n {7,-1,-1,-1,-1,-1},\n {7,-1,-1,-1,8,-1},\n {-1,-1,-1,-1,8,-1}};\n }", "@Deprecated(\n since = \"forever\",\n forRemoval = false\n )\n public static void initStates() {\n Block.GRINDSTONE.addBlockAlternative(new BlockAlternative((short) 15071, \"face=floor\", \"facing=north\"));\n Block.GRINDSTONE.addBlockAlternative(new BlockAlternative((short) 15072, \"face=floor\", \"facing=south\"));\n Block.GRINDSTONE.addBlockAlternative(new BlockAlternative((short) 15073, \"face=floor\", \"facing=west\"));\n Block.GRINDSTONE.addBlockAlternative(new BlockAlternative((short) 15074, \"face=floor\", \"facing=east\"));\n Block.GRINDSTONE.addBlockAlternative(new BlockAlternative((short) 15075, \"face=wall\", \"facing=north\"));\n Block.GRINDSTONE.addBlockAlternative(new BlockAlternative((short) 15076, \"face=wall\", \"facing=south\"));\n Block.GRINDSTONE.addBlockAlternative(new BlockAlternative((short) 15077, \"face=wall\", \"facing=west\"));\n Block.GRINDSTONE.addBlockAlternative(new BlockAlternative((short) 15078, \"face=wall\", \"facing=east\"));\n Block.GRINDSTONE.addBlockAlternative(new BlockAlternative((short) 15079, \"face=ceiling\", \"facing=north\"));\n Block.GRINDSTONE.addBlockAlternative(new BlockAlternative((short) 15080, \"face=ceiling\", \"facing=south\"));\n Block.GRINDSTONE.addBlockAlternative(new BlockAlternative((short) 15081, \"face=ceiling\", \"facing=west\"));\n Block.GRINDSTONE.addBlockAlternative(new BlockAlternative((short) 15082, \"face=ceiling\", \"facing=east\"));\n }", "private Set<Integer> getStatesFromWichReachableAccepting(LabelledTransitionSystem ret) {\n\t\tMap<Integer, Set<Integer>> reversedReachable = this.computeInverseTransitionRelation(ret);\n\n\t\tSet<Integer> reachable = new HashSet<>();\n\n\t\tlogger.debug(\"Accepting states: \" + ret.getAccepting());\n\t\tSet<Integer> current = ret.getAccepting();\n\n\t\tboolean[] visited = new boolean[ret.getStates().length];\n\n\t\twhile (!current.isEmpty()) {\n\t\t\tInteger evaluated = current.iterator().next();\n\t\t\tcurrent.remove(evaluated);\n\t\t\tif (!visited[evaluated]) {\n\t\t\t\tvisited[evaluated] = true;\n\t\t\t\treachable.add(evaluated);\n\t\t\t\tSet<Integer> prev = new HashSet<>(reversedReachable.get(evaluated));\n\t\t\t\tcurrent.addAll(prev);\n\t\t\t}\n\t\t}\n\n\t\treturn reachable;\n\t}", "public List<INode> getAllNodes();", "private void constructTransitionMatrix() {\r\n\t\tfor(Node node: mNodes) {\r\n\t\t\tint nodeId = node.getId();\r\n\t\t\tint outDegree = node.getOutDegree();\r\n\t\t\tArrayList<NodeTransition> transitionList = new ArrayList<NodeTransition>();\r\n\t\t\t\r\n\t\t\tSet<Integer> outEdges = getOutEdges(nodeId);\r\n\t\t\tfor(Integer edgeId: outEdges) {\r\n\t\t\t\tint toId = getEdge(edgeId).getToId();\r\n\t\t\t\tdouble pTransition = (double) getEdge(edgeId).getWeight() / (double) outDegree;\r\n\t\t\t\ttransitionList.add( new NodeTransition(toId, pTransition) );\r\n\t\t\t}\r\n\t\t\tmTransition.add( transitionList );\r\n\t\t}\r\n\t}", "@BeforeAll\n\tstatic void setNodes() {\n\t\tLCA = new LowestCommonAncestor();\n\t\tnine = new Node(9,null);\n\t\tten = new Node(10, null);\n\t\teight = new Node(8, null);\n\t\tseven = new Node(7, new Node[] {ten});\n\t\tfour = new Node(4, new Node[] {ten});\n\t\tthree = new Node(3, new Node[] {four});\n\t\tfive = new Node(5, new Node[] {nine, eight, seven});\n\t\ttwo = new Node(2, new Node[] {three, five});\n\t\tone = new Node(1, new Node[] {two});\n\t}", "@Override\n public ArrayList<AState> getAllPossibleStates(AState state){\n MazeState s = (MazeState)state;\n ArrayList<AState> moves = new ArrayList<AState> ();\n\n\n int row = s.getState().getRowIndex();\n int col = s.getState().getColumnIndex();\n int [][] matrix = mySearchableMaze.getMazeMatrix();\n\n\n if(row+1 < matrix.length){\n if( matrix[row+1][col]==0 ){\n moves.add(new MazeState(new Position(row+1,col),false,s.getCost()+1));\n\n }\n }\n if(row-1 >= 0 ){\n if( matrix[row-1][col]==0){\n moves.add(new MazeState(new Position(row-1,col),false,s.getCost()+1));\n\n }\n }\n if(col+1 < matrix[0].length ){\n if( matrix[row][col+1]==0 ){\n moves.add(new MazeState(new Position(row,col+1),false,s.getCost()+1));\n\n }\n }\n if(col-1 >= 0 ){\n if( matrix[row][col-1]==0 ){\n moves.add(new MazeState(new Position(row,col-1),false,s.getCost()+1));\n }\n }\n return moves;\n }", "private void mergeStates() {\n ArrayList<DFAState> newStates = new ArrayList<DFAState>();\r\n HashSet<Integer> newAcceptStates = new HashSet<Integer>();\r\n HashMap<Integer, Integer> merged = new HashMap<Integer, Integer>();\r\n ArrayList<ArrayList<Integer>> mergeGroups = new ArrayList<ArrayList<Integer>>();\r\n for (int i = 0; i < D.length; i++) {\r\n if (merged.get(i) != null || states[i] == null) {\r\n continue;\r\n }\r\n\r\n DFAState state = states[i];\r\n\r\n ArrayList<Integer> toMerge = new ArrayList<Integer>();\r\n for (int j = i + 1; j < D.length; j++) {\r\n if (!D[i][j]) {\r\n toMerge.add(j);\r\n merged.put(j, i);\r\n }\r\n }\r\n\r\n // renumber existing transitions\r\n for (int j = 0; j < state.transitions.size(); j++) {\r\n Integer transition = state.transitions.get(j);\r\n if (merged.containsKey(transition)) {\r\n state.transitions.set(j, merged.get(transition));\r\n }\r\n }\r\n\r\n if (acceptStates.contains(i)) {\r\n newAcceptStates.add(i);\r\n }\r\n toMerge.add(i);\r\n mergeGroups.add(toMerge);\r\n newStates.add(state);\r\n }\r\n\r\n renumberStates(mergeGroups, newAcceptStates);\r\n\r\n // replace attributes\r\n DFAState[] newStatesArray = new DFAState[newStates.size()];\r\n newStatesArray = newStates.toArray(newStatesArray);\r\n states = newStatesArray;\r\n acceptStates = newAcceptStates;\r\n }", "void createRuleStartAndStopATNStates() {\n atn.ruleToStartState = new RuleStartState[g.rules.size()];\n atn.ruleToStopState = new RuleStopState[g.rules.size()];\n for (Rule r : g.rules.values()) {\n RuleStartState start = newState(RuleStartState.class, r.ast);\n RuleStopState stop = newState(RuleStopState.class, r.ast);\n start.stopState = stop;\n start.isLeftRecursiveRule = r instanceof LeftRecursiveRule;\n start.setRuleIndex(r.index);\n stop.setRuleIndex(r.index);\n atn.ruleToStartState[r.index] = start;\n atn.ruleToStopState[r.index] = stop;\n }\n }", "private void setAllUnvisited(){\n\t\tfor(int i = 0; i < this.getDimension(); i++)\n\t\t\tthis.getGraph().setUnvisited(i);\n\t\tthis.visited = 0;\n\t}", "public void executegenmoves() {\n \t\tObject state = gm.hashToState(new BigInteger(conf.getProperty(\"gamesman.hash\")));\n \t\tfor (Object nextstate : gm.validMoves(state)) {\n \t\t\tSystem.out.println(gm.stateToHash(nextstate));\n \t\t\tSystem.out.println(gm.displayState(nextstate));\n \t\t}\n \t}", "public void setNodesToUnvisited(){\n for(GraphNode node: graphNode){\n if(node.visited){\n node.visited = false;\n }\n }\n }", "@Override\n\tpublic HashMap<Position, Node> generate(){\n\t\tNode tempNode;\n\t\tPosition tempPosition;\n\t\tif(map != null && map.isEmpty()){\n\t\t\tfor(int y=0; y<numNodesY; y++){\n\t\t\t\tfor(int x=0; x<numNodesX; x++){\n\t\t\t\t\ttempPosition = new Position(x*nodeDistance, \n\t\t\t\t\t\t\ty*nodeDistance);\n\t\t\t\t\ttempNode = new Node(field, tempPosition,\n\t\t\t\t\t\t\tnodeSignalStrength,\n\t\t\t\t\t\t\tagentLife,\n\t\t\t\t\t\t\trequestLife);\n\t\t\t\t\tmap.put(tempPosition, tempNode);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t\n\t\treturn new HashMap<Position, Node>(map);\n\t}", "private void initGraph() {\n nodeMap = Maps.newIdentityHashMap();\n stream.forEach(t -> {\n Object sourceKey = sourceId.extractValue(t.get(sourceId.getTableId()));\n Object targetKey = targetId.extractValue(t.get(targetId.getTableId()));\n ClosureNode sourceNode = nodeMap.get(sourceKey);\n ClosureNode targetNode = nodeMap.get(targetKey);\n if (sourceNode == null) {\n sourceNode = new ClosureNode(sourceKey);\n nodeMap.put(sourceKey, sourceNode);\n }\n if (targetNode == null) {\n targetNode = new ClosureNode(targetKey);\n nodeMap.put(targetKey, targetNode);\n }\n sourceNode.next.add(targetNode);\n });\n\n }", "public void init() {\n\t\tfor (Node node : nodes)\n\t\t\tnode.init();\n\t}", "private boolean [][] buildConnectionMatrix(ArrayList<Integer> st) throws Exception{\n \tboolean [][] canReach=new boolean[st.size()][st.size()]; //initial values of boolean is false in JAVA\n\t\tfor(int i=0;i<st.size();i++) canReach[i][i]=true;\n\t\t//build connection matrix\n \tfor(TreeAutomaton ta:lt)\n \t\tfor(Transition tran:ta.getTrans()){\n \t\t\tint topLoc=st.indexOf(tran.getTop());\n \t\t\tfor(SubTerm t:tran.getSubTerms()){\n \t\t\t\tif(boxes.containsKey(t.getSubLabel())){//the case of a box transition\n \t\t\t\t\tBox box=boxes.get(t.getSubLabel());\n \t\t\t\t\tfor(int i=0;i<box.outPorts.size();i++){\n\t\t\t\t\t\t\tint botLoc_i=st.indexOf(t.getStates().get(i));\n \t\t\t\t\tfor(int j=0;j<box.outPorts.size();j++){\n \t\t\t\t\t\t\tint botLoc_j=st.indexOf(t.getStates().get(j));\n \t\t\t\t\t\tif(box.checkPortConnections(box.outPorts.get(i), box.outPorts.get(j)))//handle outport->outport\n \t\t\t\t\t\t\tcanReach[botLoc_i][botLoc_j]=true;\n \t\t\t\t\t}\n \t\t\t\t\t\tif(box.checkPortConnections(box.outPorts.get(i), box.inPort))//handle outport->inport\n \t\t\t\t\t\t\tcanReach[botLoc_i][topLoc]=true;\n \t\t\t\t\t\tif(box.checkPortConnections(box.inPort, box.outPorts.get(i)))//handle inport->outport\n \t\t\t\t\t\t\tcanReach[topLoc][botLoc_i]=true;\n \t\t\t\t\t}\n \t\t\t\t}else{ \n \t\t\t\t\tint rootRef=ta.referenceTo(tran.getTop());\n \t\t\t\t\tif(rootRef!=-1){//root reference\n \t\t \t\t\tint refLoc=st.indexOf(rootRef);\n \t\t\t\t\t\tcanReach[topLoc][refLoc]=true;\n\t \t\t\t\t}else{//normal transition\n\t \t\t\t\t\n\t \t\t\t\t\tfor(int bot:t.getStates()){\n\t \t\t \t\t\tint botLoc=st.indexOf(bot);\n\t \t\t\t\t\t\tcanReach[topLoc][botLoc]=true;\n\t \t\t\t\t\t}\n\t \t\t\t\t}\n \t\t\t\t}\n \t\t\t}\n \t\t}\n \treturn canReach;\n }", "private int[] generate(int[] cells) {\n // Placeholder\n int[] newCells = new int[cells.length];\n\n // Boundary-elements, simply ignoring them..\n for (int x = 1; x < cells.length - 1; x++) {\n\n // Neighborhood\n int left = cells[x - 1];\n int mid = cells[x];\n int right = cells[x + 1];\n\n int newState = next(left, mid, right);\n\n newCells[x] = newState;\n }\n\n return newCells;\n }", "private void updateStateOnce() {\n for(int i = 0; i < maskArray.length; i++) {\n for (int j = 0; j < maskArray[i].length; j++) {\n\n if (maskArray[i][j] == 1){\n stateArray[i][j] = stateGenerator.generateElementState();\n }\n\n }\n }\n }", "public static List<SSBNNode> translateSimpleSSBNNodeListToSSBNNodeList( \r\n\t\t\tList<SimpleSSBNNode> simpleSSBNNodeList, \r\n\t\t\tProbabilisticNetwork pn) throws \r\n\t\t\t SSBNNodeGeneralException, \r\n\t\t\t ImplementationRestrictionException{\r\n\t\t\r\n\t\tList<SSBNNode> listSSBNNodes = new ArrayList<SSBNNode>(); \r\n\t\tcorrespondencyMap = new HashMap<SimpleSSBNNode, SSBNNode>(); \r\n\t\t\r\n\t\tMap<ContextNode, ContextFatherSSBNNode> mapContextNode = \r\n\t\t\t new HashMap<ContextNode, ContextFatherSSBNNode>(); \r\n\t\t\r\n\t\t//1 Create all nodes with its states \r\n\t\t\r\n\t\tfor(SimpleSSBNNode simple: simpleSSBNNodeList){\r\n\t\t\t\r\n\t\t\tSSBNNode ssbnNode = SSBNNode.getInstance(pn, simple.getResidentNode()); \r\n\t\t\tcorrespondencyMap.put(simple, ssbnNode);\r\n\t\t\tlistSSBNNodes.add(ssbnNode); \r\n\t\t\t\r\n\t\t\t//Arguments. \r\n\t\t\tfor(int i = 0; i < simple.getOvArray().length; i++){\r\n\t\t\t\tOVInstance ovInstance = OVInstance.getInstance(\r\n\t\t\t\t\t\tsimple.getOvArray()[i],\tsimple.getEntityArray()[i]); \r\n\t\t\t\tssbnNode.addArgument(ovInstance);\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\t//Finding. \r\n\t\t\tif(simple.isFinding()){\r\n\t\t\t\tssbnNode.setValue(simple.getState()); \r\n\t\t\t}\r\n\t\t\t\r\n\t\t\t\r\n\t\t\t//Default distribution\r\n\t\t\tif(simple.isDefaultDistribution()){\r\n\t\t\t\tssbnNode.setUsingDefaultCPT(true); \r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tssbnNode.setPermanent(true); \r\n\t\t\t\r\n\t\t\t//The values of the ordinary variables are different depending in \r\n\t\t\t//which MFrag we are dealing. \r\n\t\t\t\r\n\t\t\t//The key for do the match is the order of the arguments. The order\r\n\t\t\t//should be the same in every MFrags of the node. \r\n\t\t\t\r\n\t\t\t//Lets deal first with Resident MFrag\r\n\r\n\t\t\tOrdinaryVariable[] residentOvArray = \r\n\t\t\t\t\tssbnNode.getResident().getOrdinaryVariableList().toArray(\r\n\t\t\t\t\t\t\tnew OrdinaryVariable[ssbnNode.getResident().getOrdinaryVariableList().size()]\r\n\t\t\t\t\t\t\t); \r\n\t\t\t\r\n\t\t\tList<OVInstance> argumentsForResidentMFrag = new ArrayList<OVInstance>(); \r\n\t\t\tfor(int i = 0; i < residentOvArray.length; i++){\r\n\t\t\t\tOVInstance ovInstance = OVInstance.getInstance(residentOvArray[i], \r\n\t\t\t\t\t\tsimple.getEntityArray()[i]); \r\n\t\t\t\targumentsForResidentMFrag.add(ovInstance); \r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tssbnNode.addArgumentsForMFrag(\r\n\t\t\t\t\tssbnNode.getResident().getMFrag(), \r\n\t\t\t\t\targumentsForResidentMFrag); \r\n\t\t\t\r\n\t\t\t\r\n\t\t\t// Lets map OVs of every input node pointing to current SSBNNode\r\n\t\t\t\r\n\t\t\tfor(InputNode inputNode: simple.getResidentNode().getInputInstanceFromList()){\r\n\t\t\t\t\r\n\t\t\t\tOrdinaryVariable[] ovArray = \r\n\t\t\t\t\tinputNode.getResidentNodePointer().getOrdinaryVariableArray(); \r\n\t\t\t\t\r\n\t\t\t\tList<OVInstance> argumentsForMFrag = new ArrayList<OVInstance>();\r\n\r\n// OLD CODE\t\t\t\t\r\n//\t\t\t\tfor(int i = 0; i < ovArray.length; i++){\r\n//\t\t\t\t\tOVInstance ovInstance = OVInstance.getInstance(ovArray[i], simple.getEntityArray()[i]); \r\n// argumentsForMFrag.add(ovInstance); \t\r\n//\t\t\t\t}\r\n\r\n// NEW CODE \r\n\t\t\t\tif( ! (simple.getOvArrayForMFrag(inputNode.getMFrag()) == null )){\r\n\t\t\t\t\tfor(int i = 0; i < ovArray.length; i++){\r\n\t\t\t\t\t\tOrdinaryVariable ov = simple.getOvArrayForMFrag(inputNode.getMFrag())[i]; \r\n\t\t\t\t\t\tOVInstance ovInstance = OVInstance.getInstance(ov,simple.getEntityArray()[i]); \t\t\t\t\t\r\n\t\t\t\t\t\targumentsForMFrag.add(ovInstance); \r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t}else{\r\n//TODO This is an old bug... when we don't have an input instance of the node, we won't have a MFrag Instance \r\n// for it... what makes the throws one exception. \r\n\t\t\t\t\tfor(int i = 0; i < ovArray.length; i++){\r\n\t\t\t\t\t\tOVInstance ovInstance = OVInstance.getInstance(ovArray[i], simple.getEntityArray()[i]);\r\n\t\t\t\t\t\targumentsForMFrag.add(ovInstance); \t\t\t\t\t\r\n\t\t\t\t\t}\t\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\tssbnNode.addArgumentsForMFrag(\r\n\t\t\t\t\t\tinputNode.getMFrag(), \r\n\t\t\t\t\t\targumentsForMFrag); \r\n\t\t\t}\r\n\t\t\t\r\n\t\t\t//Treat the context node father\r\n\t\t\tList<SimpleContextNodeFatherSSBNNode> simpleContextNodeList = \r\n\t\t\t\tsimple.getContextParents(); \r\n\t\t\t\r\n\t\t\tif(simpleContextNodeList.size() > 0){\r\n\t\t\t\tif(simpleContextNodeList.size() > 1){\r\n\t\t\t\t\tthrow new ImplementationRestrictionException(\r\n\t\t\t\t\t\t\tImplementationRestrictionException.MORE_THAN_ONE_CTXT_NODE_SEARCH); \r\n\t\t\t\t}else{\r\n\t\t\t\t\t//We have only one context node father\r\n\t\t\t\t\tContextNode contextNode = simpleContextNodeList.get(0).getContextNode(); \r\n\t\t\t\t\tContextFatherSSBNNode contextFather = mapContextNode.get(contextNode); \r\n\t\t\t\t\tif(contextFather == null){\r\n\t\t\t\t\t\tcontextFather = new ContextFatherSSBNNode(pn, contextNode, new ProbabilisticNode(), \r\n\t\t\t\t\t\t\t\tsimpleContextNodeList.get(0).getOvProblematic(), simple.getMFragInstance().getOVInstanceList());\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\tList<ILiteralEntityInstance> possibleValueList = \r\n\t\t\t\t\t\t\t\tnew ArrayList<ILiteralEntityInstance>(); \r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\tfor(String entity: simpleContextNodeList.get(0).getPossibleValues()){\r\n\t\t\t\t\t\t\tpossibleValueList.add(LiteralEntityInstance.getInstance(\r\n\t\t\t\t\t\t\t\t\tentity, \r\n\t\t\t\t\t\t\t\t\tsimpleContextNodeList.get(0).getOvProblematic().getValueType())); \r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\tfor(ILiteralEntityInstance lei: possibleValueList){\r\n\t\t\t\t\t\t\tcontextFather.addPossibleValue(lei);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\r\n//\t\t\t\t\t\tcontextFather.setOvProblematic(simpleContextNodeList.get(0).getOvProblematic());\r\n\t\t\t\t\t\tmapContextNode.put(contextNode, contextFather); \r\n\t\t\t\t\t}\r\n\t\t\t\t\t\r\n\t\t\t\t\ttry {\r\n\t\t\t\t\t\tssbnNode.setContextFatherSSBNNode(contextFather);\r\n\t\t\t\t\t} catch (InvalidParentException e) {\r\n\t\t\t\t\t\t//This exception don't occur in this case... \r\n\t\t\t\t\t\te.printStackTrace();\r\n\t\t\t\t\t\tthrow new RuntimeException(e.getMessage()); \r\n\t\t\t\t\t} \r\n\t\t\t\t\t\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t}\r\n\t\t\tif (simple.isNodeInAVirualChain()) {\r\n\t\t\t\t// change the name of chain nodes\r\n\t\t\t\tssbnNode.getProbNode().setName(\"Chain\"+ simple.getStepsForChainNodeToReachMainNode() + \"_\" + ssbnNode.getProbNode().getName());\r\n\t\t\t\tDebug.println(ssbnNode.getProbNode().getName());\r\n\t\t\t}\r\n\t\t\tsimple.setProbNode(ssbnNode.getProbNode());\r\n\t\t}\r\n\t\t\r\n\t\t//Create the parent structure \r\n\t\t\r\n\t\tfor(SimpleSSBNNode simple: simpleSSBNNodeList){\r\n\t\t\t\r\n//\t\t\tif(simple.getParents().size()==0){\r\n//\t\t\t\tif(simple.getChildNodes().size()==0){\r\n//\t\t\t\t\tcontinue; //This node is out of the network. \r\n//\t\t\t\t}\r\n//\t\t\t}\r\n\t\t\t\r\n\t\t\tSSBNNode ssbnNode = correspondencyMap.get(simple); \r\n\t\t\t\r\n\t\t\tfor(SimpleSSBNNode parent: simple.getParents()){\r\n\t\t\t\tSSBNNode parentSSBNNode = correspondencyMap.get(parent); \r\n\t\t\t\tssbnNode.addParent(parentSSBNNode, false); \r\n\t\t\t}\r\n\t\t\t\r\n\t\t}\r\n\t\t\r\n\t\treturn listSSBNNodes; \r\n\t}", "private static ArrayList<Integer> createNodes(int bBit, int n) {\r\n\t\tHashSet<Integer> addNodes = new HashSet<Integer>();\r\n\t\tint maxNode = (int) Math.pow(2, bBit);\r\n\t\tRandom random = new Random();\r\n\t\twhile (addNodes.size() < n) {\r\n\t\t\tint randomNode = random.nextInt((maxNode - 1) + 1) + 1;\r\n\t\t\taddNodes.add(randomNode);\r\n\t\t}\r\n\t\tArrayList<Integer> sortedNodes = new ArrayList<Integer>(addNodes);\r\n\t\tCollections.sort(sortedNodes);\r\n\t\treturn sortedNodes;\r\n\t}", "static byte[] core_init_state(int size, short seed) {\n\t\tbyte[] p=new byte[size];\n\t\tint total=0,next=0,i;\n\t\tbyte[] buf=null;\n\n\t\tfinal_counts = new int[NUM_CORE_STATES];\n\t\ttrack_counts = new int[NUM_CORE_STATES];\n\n\t\tsize--;\n\t\tnext=0;\n\t\twhile ((total+next+1)<size) {\n\t\t\tif (next>0) {\n\t\t\t\tfor(i=0;i<next;i++)\n\t\t\t\t\tp[total+i]=buf[i];\n\t\t\t\tp[total+i]=',';\n\t\t\t\ttotal+=next+1;\n\t\t\t}\n\t\t\tseed++;\n\t\t\tswitch (seed & 0x7) {\n\t\t\t\tcase 0: /* int */\n\t\t\t\tcase 1: /* int */\n\t\t\t\tcase 2: /* int */\n\t\t\t\t\tbuf=intpat((seed>>3) & 0x3);\n\t\t\t\t\tnext=4;\n\t\t\t\tbreak;\n\t\t\t\tcase 3: /* float */\n\t\t\t\tcase 4: /* float */\n\t\t\t\t\tbuf=floatpat((seed>>3) & 0x3);\n\t\t\t\t\tnext=8;\n\t\t\t\tbreak;\n\t\t\t\tcase 5: /* scientific */\n\t\t\t\tcase 6: /* scientific */\n\t\t\t\t\tbuf=scipat((seed>>3) & 0x3);\n\t\t\t\t\tnext=8;\n\t\t\t\tbreak;\n\t\t\t\tcase 7: /* invalid */\n\t\t\t\t\tbuf=errpat((seed>>3) & 0x3);\n\t\t\t\t\tnext=8;\n\t\t\t\tbreak;\n\t\t\t\tdefault: /* Never happen, just to make some compilers happy */\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t\tsize++;\n\t\twhile (total<size) { /* fill the rest with 0 */\n\t\t\tp[total]=0;\n\t\t\ttotal++;\n\t\t}\n\t\treturn p;\n\t}", "@Deprecated(\n since = \"forever\",\n forRemoval = false\n )\n public static void initStates() {\n Block.DARK_OAK_DOOR.addBlockAlternative(new BlockAlternative((short) 9244, \"facing=north\", \"half=upper\", \"hinge=left\", \"open=true\", \"powered=true\"));\n Block.DARK_OAK_DOOR.addBlockAlternative(new BlockAlternative((short) 9245, \"facing=north\", \"half=upper\", \"hinge=left\", \"open=true\", \"powered=false\"));\n Block.DARK_OAK_DOOR.addBlockAlternative(new BlockAlternative((short) 9246, \"facing=north\", \"half=upper\", \"hinge=left\", \"open=false\", \"powered=true\"));\n Block.DARK_OAK_DOOR.addBlockAlternative(new BlockAlternative((short) 9247, \"facing=north\", \"half=upper\", \"hinge=left\", \"open=false\", \"powered=false\"));\n Block.DARK_OAK_DOOR.addBlockAlternative(new BlockAlternative((short) 9248, \"facing=north\", \"half=upper\", \"hinge=right\", \"open=true\", \"powered=true\"));\n Block.DARK_OAK_DOOR.addBlockAlternative(new BlockAlternative((short) 9249, \"facing=north\", \"half=upper\", \"hinge=right\", \"open=true\", \"powered=false\"));\n Block.DARK_OAK_DOOR.addBlockAlternative(new BlockAlternative((short) 9250, \"facing=north\", \"half=upper\", \"hinge=right\", \"open=false\", \"powered=true\"));\n Block.DARK_OAK_DOOR.addBlockAlternative(new BlockAlternative((short) 9251, \"facing=north\", \"half=upper\", \"hinge=right\", \"open=false\", \"powered=false\"));\n Block.DARK_OAK_DOOR.addBlockAlternative(new BlockAlternative((short) 9252, \"facing=north\", \"half=lower\", \"hinge=left\", \"open=true\", \"powered=true\"));\n Block.DARK_OAK_DOOR.addBlockAlternative(new BlockAlternative((short) 9253, \"facing=north\", \"half=lower\", \"hinge=left\", \"open=true\", \"powered=false\"));\n Block.DARK_OAK_DOOR.addBlockAlternative(new BlockAlternative((short) 9254, \"facing=north\", \"half=lower\", \"hinge=left\", \"open=false\", \"powered=true\"));\n Block.DARK_OAK_DOOR.addBlockAlternative(new BlockAlternative((short) 9255, \"facing=north\", \"half=lower\", \"hinge=left\", \"open=false\", \"powered=false\"));\n Block.DARK_OAK_DOOR.addBlockAlternative(new BlockAlternative((short) 9256, \"facing=north\", \"half=lower\", \"hinge=right\", \"open=true\", \"powered=true\"));\n Block.DARK_OAK_DOOR.addBlockAlternative(new BlockAlternative((short) 9257, \"facing=north\", \"half=lower\", \"hinge=right\", \"open=true\", \"powered=false\"));\n Block.DARK_OAK_DOOR.addBlockAlternative(new BlockAlternative((short) 9258, \"facing=north\", \"half=lower\", \"hinge=right\", \"open=false\", \"powered=true\"));\n Block.DARK_OAK_DOOR.addBlockAlternative(new BlockAlternative((short) 9259, \"facing=north\", \"half=lower\", \"hinge=right\", \"open=false\", \"powered=false\"));\n Block.DARK_OAK_DOOR.addBlockAlternative(new BlockAlternative((short) 9260, \"facing=south\", \"half=upper\", \"hinge=left\", \"open=true\", \"powered=true\"));\n Block.DARK_OAK_DOOR.addBlockAlternative(new BlockAlternative((short) 9261, \"facing=south\", \"half=upper\", \"hinge=left\", \"open=true\", \"powered=false\"));\n Block.DARK_OAK_DOOR.addBlockAlternative(new BlockAlternative((short) 9262, \"facing=south\", \"half=upper\", \"hinge=left\", \"open=false\", \"powered=true\"));\n Block.DARK_OAK_DOOR.addBlockAlternative(new BlockAlternative((short) 9263, \"facing=south\", \"half=upper\", \"hinge=left\", \"open=false\", \"powered=false\"));\n Block.DARK_OAK_DOOR.addBlockAlternative(new BlockAlternative((short) 9264, \"facing=south\", \"half=upper\", \"hinge=right\", \"open=true\", \"powered=true\"));\n Block.DARK_OAK_DOOR.addBlockAlternative(new BlockAlternative((short) 9265, \"facing=south\", \"half=upper\", \"hinge=right\", \"open=true\", \"powered=false\"));\n Block.DARK_OAK_DOOR.addBlockAlternative(new BlockAlternative((short) 9266, \"facing=south\", \"half=upper\", \"hinge=right\", \"open=false\", \"powered=true\"));\n Block.DARK_OAK_DOOR.addBlockAlternative(new BlockAlternative((short) 9267, \"facing=south\", \"half=upper\", \"hinge=right\", \"open=false\", \"powered=false\"));\n Block.DARK_OAK_DOOR.addBlockAlternative(new BlockAlternative((short) 9268, \"facing=south\", \"half=lower\", \"hinge=left\", \"open=true\", \"powered=true\"));\n Block.DARK_OAK_DOOR.addBlockAlternative(new BlockAlternative((short) 9269, \"facing=south\", \"half=lower\", \"hinge=left\", \"open=true\", \"powered=false\"));\n Block.DARK_OAK_DOOR.addBlockAlternative(new BlockAlternative((short) 9270, \"facing=south\", \"half=lower\", \"hinge=left\", \"open=false\", \"powered=true\"));\n Block.DARK_OAK_DOOR.addBlockAlternative(new BlockAlternative((short) 9271, \"facing=south\", \"half=lower\", \"hinge=left\", \"open=false\", \"powered=false\"));\n Block.DARK_OAK_DOOR.addBlockAlternative(new BlockAlternative((short) 9272, \"facing=south\", \"half=lower\", \"hinge=right\", \"open=true\", \"powered=true\"));\n Block.DARK_OAK_DOOR.addBlockAlternative(new BlockAlternative((short) 9273, \"facing=south\", \"half=lower\", \"hinge=right\", \"open=true\", \"powered=false\"));\n Block.DARK_OAK_DOOR.addBlockAlternative(new BlockAlternative((short) 9274, \"facing=south\", \"half=lower\", \"hinge=right\", \"open=false\", \"powered=true\"));\n Block.DARK_OAK_DOOR.addBlockAlternative(new BlockAlternative((short) 9275, \"facing=south\", \"half=lower\", \"hinge=right\", \"open=false\", \"powered=false\"));\n Block.DARK_OAK_DOOR.addBlockAlternative(new BlockAlternative((short) 9276, \"facing=west\", \"half=upper\", \"hinge=left\", \"open=true\", \"powered=true\"));\n Block.DARK_OAK_DOOR.addBlockAlternative(new BlockAlternative((short) 9277, \"facing=west\", \"half=upper\", \"hinge=left\", \"open=true\", \"powered=false\"));\n Block.DARK_OAK_DOOR.addBlockAlternative(new BlockAlternative((short) 9278, \"facing=west\", \"half=upper\", \"hinge=left\", \"open=false\", \"powered=true\"));\n Block.DARK_OAK_DOOR.addBlockAlternative(new BlockAlternative((short) 9279, \"facing=west\", \"half=upper\", \"hinge=left\", \"open=false\", \"powered=false\"));\n Block.DARK_OAK_DOOR.addBlockAlternative(new BlockAlternative((short) 9280, \"facing=west\", \"half=upper\", \"hinge=right\", \"open=true\", \"powered=true\"));\n Block.DARK_OAK_DOOR.addBlockAlternative(new BlockAlternative((short) 9281, \"facing=west\", \"half=upper\", \"hinge=right\", \"open=true\", \"powered=false\"));\n Block.DARK_OAK_DOOR.addBlockAlternative(new BlockAlternative((short) 9282, \"facing=west\", \"half=upper\", \"hinge=right\", \"open=false\", \"powered=true\"));\n Block.DARK_OAK_DOOR.addBlockAlternative(new BlockAlternative((short) 9283, \"facing=west\", \"half=upper\", \"hinge=right\", \"open=false\", \"powered=false\"));\n Block.DARK_OAK_DOOR.addBlockAlternative(new BlockAlternative((short) 9284, \"facing=west\", \"half=lower\", \"hinge=left\", \"open=true\", \"powered=true\"));\n Block.DARK_OAK_DOOR.addBlockAlternative(new BlockAlternative((short) 9285, \"facing=west\", \"half=lower\", \"hinge=left\", \"open=true\", \"powered=false\"));\n Block.DARK_OAK_DOOR.addBlockAlternative(new BlockAlternative((short) 9286, \"facing=west\", \"half=lower\", \"hinge=left\", \"open=false\", \"powered=true\"));\n Block.DARK_OAK_DOOR.addBlockAlternative(new BlockAlternative((short) 9287, \"facing=west\", \"half=lower\", \"hinge=left\", \"open=false\", \"powered=false\"));\n Block.DARK_OAK_DOOR.addBlockAlternative(new BlockAlternative((short) 9288, \"facing=west\", \"half=lower\", \"hinge=right\", \"open=true\", \"powered=true\"));\n Block.DARK_OAK_DOOR.addBlockAlternative(new BlockAlternative((short) 9289, \"facing=west\", \"half=lower\", \"hinge=right\", \"open=true\", \"powered=false\"));\n Block.DARK_OAK_DOOR.addBlockAlternative(new BlockAlternative((short) 9290, \"facing=west\", \"half=lower\", \"hinge=right\", \"open=false\", \"powered=true\"));\n Block.DARK_OAK_DOOR.addBlockAlternative(new BlockAlternative((short) 9291, \"facing=west\", \"half=lower\", \"hinge=right\", \"open=false\", \"powered=false\"));\n Block.DARK_OAK_DOOR.addBlockAlternative(new BlockAlternative((short) 9292, \"facing=east\", \"half=upper\", \"hinge=left\", \"open=true\", \"powered=true\"));\n Block.DARK_OAK_DOOR.addBlockAlternative(new BlockAlternative((short) 9293, \"facing=east\", \"half=upper\", \"hinge=left\", \"open=true\", \"powered=false\"));\n Block.DARK_OAK_DOOR.addBlockAlternative(new BlockAlternative((short) 9294, \"facing=east\", \"half=upper\", \"hinge=left\", \"open=false\", \"powered=true\"));\n Block.DARK_OAK_DOOR.addBlockAlternative(new BlockAlternative((short) 9295, \"facing=east\", \"half=upper\", \"hinge=left\", \"open=false\", \"powered=false\"));\n Block.DARK_OAK_DOOR.addBlockAlternative(new BlockAlternative((short) 9296, \"facing=east\", \"half=upper\", \"hinge=right\", \"open=true\", \"powered=true\"));\n Block.DARK_OAK_DOOR.addBlockAlternative(new BlockAlternative((short) 9297, \"facing=east\", \"half=upper\", \"hinge=right\", \"open=true\", \"powered=false\"));\n Block.DARK_OAK_DOOR.addBlockAlternative(new BlockAlternative((short) 9298, \"facing=east\", \"half=upper\", \"hinge=right\", \"open=false\", \"powered=true\"));\n Block.DARK_OAK_DOOR.addBlockAlternative(new BlockAlternative((short) 9299, \"facing=east\", \"half=upper\", \"hinge=right\", \"open=false\", \"powered=false\"));\n Block.DARK_OAK_DOOR.addBlockAlternative(new BlockAlternative((short) 9300, \"facing=east\", \"half=lower\", \"hinge=left\", \"open=true\", \"powered=true\"));\n Block.DARK_OAK_DOOR.addBlockAlternative(new BlockAlternative((short) 9301, \"facing=east\", \"half=lower\", \"hinge=left\", \"open=true\", \"powered=false\"));\n Block.DARK_OAK_DOOR.addBlockAlternative(new BlockAlternative((short) 9302, \"facing=east\", \"half=lower\", \"hinge=left\", \"open=false\", \"powered=true\"));\n Block.DARK_OAK_DOOR.addBlockAlternative(new BlockAlternative((short) 9303, \"facing=east\", \"half=lower\", \"hinge=left\", \"open=false\", \"powered=false\"));\n Block.DARK_OAK_DOOR.addBlockAlternative(new BlockAlternative((short) 9304, \"facing=east\", \"half=lower\", \"hinge=right\", \"open=true\", \"powered=true\"));\n Block.DARK_OAK_DOOR.addBlockAlternative(new BlockAlternative((short) 9305, \"facing=east\", \"half=lower\", \"hinge=right\", \"open=true\", \"powered=false\"));\n Block.DARK_OAK_DOOR.addBlockAlternative(new BlockAlternative((short) 9306, \"facing=east\", \"half=lower\", \"hinge=right\", \"open=false\", \"powered=true\"));\n Block.DARK_OAK_DOOR.addBlockAlternative(new BlockAlternative((short) 9307, \"facing=east\", \"half=lower\", \"hinge=right\", \"open=false\", \"powered=false\"));\n }", "public List<S> getAvailableStates();", "private void getAllNodesBreadthFirstSearch(List<Expression> nodesList)\n/* */ {\n/* 156 */ int indx = 0;\n/* 157 */ nodesList.add(this);\n/* */ \n/* 159 */ while (indx < nodesList.size()) {\n/* 160 */ Expression node = (Expression)nodesList.get(indx++);\n/* 161 */ for (Expression child : node.childs) {\n/* 162 */ nodesList.add(child);\n/* */ }\n/* */ }\n/* */ }", "private synchronized void initStateMachine() {\n next = start;\n Deque<StateInfo> stack = getNextToAncestorStackLocked();\n\n // Enter all the states of the new branch.\n while (stack.size() > 0) {\n current = stack.pop();\n current.active = true;\n current.state.enter();\n }\n next = null;\n }", "default Collection<I_GameState> getRepeatStates() {\n return getRepeatStates(FULL_EQUAL);\n }", "@Override\n\tpublic Set<NFAState> eClosure(NFAState s) {\n\t\tSet<NFAState> visited = new TreeSet<NFAState>();\n\t\t//invoke recursive helper\n\t\tvisited = eClosureHelper(s, visited);\n\t\t\n\t\treturn visited;\n\t}", "public abstract List<Scope> generateFactorScopes(State state);", "public List<MclnState> getAvailableStates();", "public static void main(String[] args) {\n\t\tArrayList<Robot> robots = new ArrayList<>();\n\t\tArrayList<Node> nodes = new ArrayList<>();\n\t\t//This allows for different home and feeder locations\n\t\tNode redFeeder = new Node(0, 10, 4, true);\n\t\tNode yelFeeder = new Node(0, 5, 10, false);\n\t\tNode home = new Node(0, 0, 0, true);\n\n\t\t//Insert the nodes listed from the homework\n\t\tnodes.add(new Node(1, 2, 2, true));\n\t\tnodes.add(new Node(2, 1, 5, false));\n\t\tnodes.add(new Node(3, 3, 7, true));\n\t\tnodes.add(new Node(4, 5, 9, false));\n\t\tnodes.add(new Node(5, 7, 3, true));\n\t\tnodes.add(new Node(6, 8, 1, true));\n\t\tnodes.add(new Node(7, 8, 5, true));\n\t\tnodes.add(new Node(8, 4, 6, false));\n\t\tnodes.add(new Node(9, 6, 8, false));\n\t\tnodes.add(new Node(10, 9, 7, false));\n\n\t\t//Set counter for while loop later\n\t\tint counter = 1;\n\n\t\t//Create initial 10 parents\n\t\tfor (int i = 0; i < 10; i++) {\n\t\t\trobots.add(new Robot());\n\n\t\t\t//Set the home and feeders\n\t\t\trobots.get(i).setHome(home.getX(), home.getY());\n\t\t\trobots.get(i).setRedFeeder(redFeeder.getX(), redFeeder.getY());\n\t\t\trobots.get(i).setYellowFeeder(yelFeeder.getX(), yelFeeder.getY());\n\n\t\t\t//Create a temp node list to shuffle\n\t\t\tArrayList<Node> tempNodes = nodes;\n\t\t\tCollections.shuffle(tempNodes);\n\n\t\t\t//Iterate through and add the nodes based on the value not the reference (caused lots of issues before\n\t\t\t//I figured that out\n\t\t\tfor (int j = 0; j < 10; j++)\n\t\t\t\trobots.get(i).in(new Node(tempNodes.get(j).getE(), tempNodes.get(j).getX(),\n\t\t\t\t\t\ttempNodes.get(j).getY(), tempNodes.get(j).isRed()));\n\t\t}\n\n\t\t//Go for 300k iterations, can be changed on a whim\n\t\twhile (counter <= 300000) {\n\n\t\t\t//Output every 10k iterations, can be changed\n\t\t\tif (counter % 10000 == 0) {\n\t\t\t\tSystem.out.println(\"Loop \" + (counter));\n\t\t\t\tfor (Robot r : robots) {\n\t\t\t\t\tr.printNodes();\n\t\t\t\t\tSystem.out.println(\" - \" + r.calcTotalDist());\n\t\t\t\t}\n\n\t\t\t\tSystem.out.println();\n\t\t\t}\n\n\t\t\tint size = robots.size();\n\t\t\t//Create children based on two parents and add them to the robots list\n\t\t\tfor (int i = 0; i < size; i += 2) {\n\t\t\t\tint x = ThreadLocalRandom.current().nextInt(1, 8);\n\t\t\t\tRobot temp = robots.get(i).getFirstHalf(x);\n\t\t\t\ttemp.addSecondHalf(robots.get(i + 1), x);\n\n\t\t\t\ttemp.setHome(home.getX(), home.getY());\n\t\t\t\ttemp.setRedFeeder(redFeeder.getX(), redFeeder.getY());\n\t\t\t\ttemp.setYellowFeeder(yelFeeder.getX(), yelFeeder.getY());\n\n\t\t\t\trobots.add(temp);\n\t\t\t}\n\n\t\t\t//Sort the list of robots based on the Comparator that uses the totalDistance\n\t\t\tCollections.sort(robots);\n\n\t\t\t//Remove the last 5 (largest) items from the list\n\t\t\tfor (int i = robots.size() - 1; i > 9; i--) {\n\t\t\t\trobots.remove(i);\n\t\t\t}\n\n\t\t\t//Shuffle the list again to hope for totally random stuff\n\t\t\tCollections.shuffle(robots);\n\t\t\tcounter++;\n\t\t}\n\n\t\t//Irrelevant but useful in testing\n\t\treturn;\n\t}", "private void setTransitionsList () {\n for (int i = 0; i < dfaStates.size(); i++) {\n List<State> currStateList = dfaStates.get(i);\n int currStateListID = dfaStatesWithNumbering.get(currStateList);\n State initialState = new State(currStateListID, true);\n\n HashMap<String, List<State>> currStateListInfo = dfaTable.get(currStateList);\n for (int j = 0; j < symbolList.size()-1; j++) {\n String currSymbol = Character.toString(symbolList.get(j));\n List<State> currStateListSymbolList = currStateListInfo.get(currSymbol);\n\n if (currStateListSymbolList.size() > 0) {\n State finalState = new State(dfaStatesWithNumbering.get(currStateListSymbolList), true);\n Transition tmpTransition = new Transition(currSymbol, initialState, finalState);\n\n // now add to transition list\n if (!transitionsList.contains(tmpTransition)) {\n transitionsList.add(tmpTransition);\n }\n }\n }\n }\n }", "private static ArrayList<String> makeStatesArray(BigramModel transProb, ArrayList<String> states) {\n\t\tSet set = transProb.unigramMap.keySet();\n\t\tstates = new ArrayList<String>();\n\t\tIterator itr = set.iterator();\n\t\twhile (itr.hasNext()) {\n\t\t\tString status = (String) itr.next();\n\t\t\tstates.add(status);\n\t\t}\n\t\treturn states;\n\t}", "private List<State> expandStateTerminalNode(State s, TerminalNode n, VariableNode v) {\n\n List<State> ret = new ArrayList<>();\n\n if (n instanceof NullaryTerminalNode) {\n\n if (v.parent != null && !(v.parent instanceof RepSketchNode)) {\n if (((OperatorNode) v.parent).operatorName.equals(\"notcc\")) {\n if (n.sym.name.equals(\"<any>\")) return ret;\n } else if (((OperatorNode) v.parent).operatorName.equals(\"not\")) {\n s.cost += Main.NOT_TERMINAL_PATTERN;\n }\n }\n\n Node add = s.pp.mkTerminalNode(n.sym.name, v.parent);\n s.pp.substituteVar(v, add, true);\n\n } else if (n instanceof RealConstantTerminalNode) {\n\n RealConstantTerminalNode cn = (RealConstantTerminalNode) n;\n Node add = s.pp.mkRealConstantNode(cn.k, v.parent);\n s.pp.substituteVar(v, add);\n\n }\n\n if (evalApprox(s)) ret.add(s);\n\n\n return ret;\n }", "public HashSet<State> statesReachableOn(State from, Character on) {\n \t\tHashSet<State> reachable = new HashSet<State>();\n \t\tIterator<Transition> iter = from.getTransitions().iterator();\n \t\twhile (iter.hasNext()) {\n \t\t\tTransition t = iter.next();\n \n \t\t\t// Do they want the epsilon transitions?\n \t\t\tboolean equals = false;\n \t\t\tif (on == null)\n \t\t\t\tequals = on == t.c;\n \t\t\telse\n \t\t\t\tequals = on.equals(t.c);\n \n \t\t\t// Add all matching transitions\n \t\t\t// Skip if already added to prevent loops\n \t\t\tif (equals && !reachable.contains(t.to)) {\n \t\t\t\t// Add this state\n \t\t\t\treachable.add(t.to);\n \n \t\t\t\t// Recurse and add all reachable from this state (epsilon transitions)\n \t\t\t\treachable.addAll(statesReachableFrom(t.to));\n \t\t\t}\n \t\t}\n \n \t\treturn reachable;\n \t}", "private static State generateInitialState(double initialHeuristic) {\n ArrayList<List<Job>> jobList = new ArrayList<>(RecursionStore.getNumberOfProcessors());\n for (int i = 0; i < RecursionStore.getNumberOfProcessors(); i++) {\n jobList.add(new ArrayList<>());\n }\n int[] procDur = new int[RecursionStore.getNumberOfProcessors()];\n java.util.Arrays.fill(procDur, 0);\n return new State(jobList, procDur, initialHeuristic, 0);\n }", "private void generate(int x, int y) {\n \t\tvisited[x][y] = true;\n \n \t\t// while there is an unvisited neighbour\n \t\twhile (!visited[x][y + 1] || !visited[x + 1][y] || !visited[x][y - 1]\n \t\t\t\t|| !visited[x - 1][y]) {\n \t\t\t// pick random neighbour\n \t\t\twhile (true) {\n \t\t\t\tdouble r = Math.random();\n \t\t\t\tif (r < 0.25 && !visited[x][y + 1]) {\n \t\t\t\t\tnorth[x][y] = south[x][y + 1] = false;\n \t\t\t\t\tgenerate(x, y + 1);\n \t\t\t\t\tbreak;\n \t\t\t\t} else if (r >= 0.25 && r < 0.50 && !visited[x + 1][y]) {\n \t\t\t\t\teast[x][y] = west[x + 1][y] = false;\n \t\t\t\t\tgenerate(x + 1, y);\n \t\t\t\t\tbreak;\n \t\t\t\t} else if (r >= 0.5 && r < 0.75 && !visited[x][y - 1]) {\n \t\t\t\t\tsouth[x][y] = north[x][y - 1] = false;\n \t\t\t\t\tgenerate(x, y - 1);\n \t\t\t\t\tbreak;\n \t\t\t\t} else if (r >= 0.75 && r < 1.00 && !visited[x - 1][y]) {\n \t\t\t\t\twest[x][y] = east[x - 1][y] = false;\n \t\t\t\t\tgenerate(x - 1, y);\n \t\t\t\t\tbreak;\n \t\t\t\t}\n \t\t\t}\n \t\t}\n \t}", "final State[] expand(Action[] possibleActions){\n\t\t\n\t\t\n\t\t//if actions is null or has no elements, then it was a end state - there are so sub-states\n\t\tif(possibleActions==null || possibleActions.length==0)\n\t\t\treturn new State[0];\n\t\t\n\t\t//create an array to hold the sub-states\n\t\tState[] states = new State[possibleActions.length];\n\t\t\n\t\t//get each possible sub state by performing all possible actions from this state\n\t\tfor(int i = 0; i<states.length; i++){\n\t\t\t//get the resulting state of actions[i]\n\t\t\tstates[i] = performAction(possibleActions[i]);\n\t\t\t//have the new state recored what action was taken to get to that state\n\t\t\tstates[i].setAction(possibleActions[i]);\n\t\t}\n\t\t\n\t\t//return the sub-states\n\t\treturn states;\n\t\t\n\t}", "@Override\n protected void incrementStates() {\n\n }", "private void initializeGraph() {\r\n map = new HashMap<>();\r\n graph = new List[n];\r\n for (int i = 0; i < n; i++) graph[i] = new ArrayList<>();\r\n\r\n\r\n }", "public int makeGlobal(){\r\n\t\tif(mapExists && this.creationTime > SimClock.getTime() - TIMEOUT){\r\n\t\t//TODO: merge new maps\t\r\n\t\t\treturn globalMap.size();\r\n\t\t}\r\n\t\telse if(mapExists && this.creationTime <= SimClock.getTime() - TIMEOUT){\r\n\t\t//restart my map\r\n\t\t\tglobalMap = null;\r\n\t\t\tsynced = -1;\r\n\t\t\tmapExists = false;\r\n\t\t\tref_id = -1;\r\n\t\t\tthis.creationTime = SimClock.getTime();\r\n\t\t\t\r\n\t\t}\r\n\t\t//usar 3 estáticos para ajustar coordenadas\r\n\t\t\r\n\t\tMap<Integer, Coord> m = new HashMap<Integer, Coord>();\r\n\t\tArrayList<Integer> staticNBs = new ArrayList<Integer>();\r\n\t\t/*first find the static nodes i have in my map*/\r\n\t\tif(this.myMap == null || this.myMap.getMap() == null) return -1;\r\n\t\tfor(Map.Entry<Integer, Coord> nb : this.myMap.getMap().entrySet()){\r\n\t\t\t/*add them to my map*/\r\n\t\t\tif (staticNodes.keySet().contains(nb.getKey())){\r\n\t\t\t\tstaticNBs.add(nb.getKey());\t\r\n\t\t\t\tm.put(nb.getKey(), staticNodes.get(nb.getKey()));\r\n\t\t\t}\r\n\t\t}\r\n\t\tif(staticNBs.size() < 3){\r\n\t\t\t//core.Debug.p(\"can't determine global coordinates\");\r\n\t\t\treturn -1;\r\n\t\t}\r\n\t\telse{\r\n\t\t\t//map centered on certain static node, using real coordinates.\r\n\t\t\tMap.Entry<Integer, NodePositionsSet> s = startingGlobalMap(staticNBs);\r\n\t\t\t//core.Debug.p(\"***map centered on static node\" + ref_id + \"***\");\r\n\t\t\t//core.Debug.p(this.toString());\r\n\t\t\tif(s.getValue() != null){\r\n\t\t\t\t//core.Debug.p(\"globalmap not null! wohoo!\");\r\n\t\t\t\t//core.Debug.p(\"t= \" + SimClock.getTime() + \" base map:\" + realMap(s.getValue().getMap()));\r\n\t\t\t\t/*now mix this map*/\r\n\t\t\t\t//core.Debug.p(\"+++mixed map:\" + realMap(s.getValue().getMap()));\r\n\t\t\t\tglobalMap = NodePositionsSet.mixMap(s.getValue().getMap(), myMap.getMap(), ref_id, myID);\r\n\t\t\t\t//core.Debug.p(\"+++mixed map:\" + realMap(globalMap));\r\n\t\t\t\tif(globalMap == null) return -1;\r\n\t\t\t\tlocalmix();\r\n\t\t\t\tif(globalMap == null) return -1;\r\n\t\t\t\tthis.updateTime = SimClock.getTime();\r\n\t\t\t\treturn globalMap.size();\r\n\t\t\t}\r\n\t\t\telse{\r\n\t\t\t\tcore.Debug.p(\"can't determine global coordinates\");\r\n\t\t\t\treturn -1;\r\n\t\t\t}\r\n\t\t}\r\n\t}", "private static SVIntervalTree<String> initTree() {\n final SVIntervalTree<String> tree = new SVIntervalTree<>();\n final String[] genes = {\"A\", \"B\", \"C\", \"D\", \"E\"};\n if (transcriptionStartSites.length != genes.length) {\n throw new TestException(\"Transcription start sites list and genes array are not the same length\");\n }\n for ( int idx = 0; idx < genes.length; ++idx ) {\n tree.put(transcriptionStartSites[idx], genes[idx]);\n }\n return tree;\n }", "@Override\n public void setNodeStatesForUpdate(int iNode) {\n }", "public static NavigableMap<Range, List<Node>> replicate(List<Node> nodes, int rf)\n {\n nodes.sort(Node::compareTo);\n List<Range> ranges = toRanges(nodes);\n return replicate(ranges, nodes, rf);\n }", "public static void global(Node n) {\n for (int i = 0; i < n.tokens.size(); i++) {\n if (n.tokens.get(i).tokenID == Token.TokenID.IDENT_tk) {\n global1.add(n.tokens.get(i));\n }\n }\n if (n.child1 != null) {\n n = n.child1;\n global(n);\n }\n }" ]
[ "0.6378421", "0.6108966", "0.603453", "0.5870495", "0.58280605", "0.5815589", "0.5765391", "0.5747859", "0.5726776", "0.5582074", "0.55586666", "0.5555815", "0.5441169", "0.5417056", "0.5394623", "0.53944707", "0.5381242", "0.5354386", "0.5350038", "0.5342174", "0.5339068", "0.52855414", "0.5283517", "0.52818054", "0.52626735", "0.52624404", "0.5248427", "0.5245405", "0.52439845", "0.5224987", "0.5209161", "0.5206866", "0.5204089", "0.52027154", "0.51819175", "0.5179416", "0.5171685", "0.51427007", "0.5141582", "0.5138579", "0.5137761", "0.5132536", "0.5130647", "0.5127295", "0.5108608", "0.5090192", "0.5087867", "0.5075779", "0.50727206", "0.5066178", "0.5061901", "0.50503045", "0.50461364", "0.5039723", "0.5037665", "0.5025252", "0.50240964", "0.5021141", "0.50028867", "0.4996069", "0.49936822", "0.49929598", "0.49922827", "0.49877185", "0.49851653", "0.49847734", "0.49822524", "0.49814487", "0.4976816", "0.4975744", "0.49699774", "0.49669495", "0.49572027", "0.4952712", "0.49509218", "0.49450243", "0.49438432", "0.49408567", "0.49401554", "0.4938994", "0.49368215", "0.4934392", "0.49295506", "0.4926854", "0.49242395", "0.4920652", "0.49192342", "0.4898657", "0.48984486", "0.4896152", "0.4894721", "0.488744", "0.4885301", "0.48806083", "0.4879986", "0.48778436", "0.4877034", "0.48768076", "0.48756334", "0.48566583" ]
0.837192
0