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
A unit test for JUnit
public void test03() throws RefactoringException { RenameFieldRefactoring rfr = new RenameFieldRefactoring(); rfr.setClass("field", "RenameFieldTest"); rfr.setField("height"); rfr.setNewName("changed"); rfr.run(); // Check things out File check = new File(this.check + "\\ut2\\step13"); FileCompare.assertEquals("RenameFieldTest is incorrect", new File(check, "RenameFieldTest.java"), new File(dest, "RenameFieldTest.java")); FileCompare.assertEquals("UsesFieldTest is incorrect", new File(check, "UsesFieldTest.java"), new File(dest, "UsesFieldTest.java")); FileCompare.assertEquals("InheritFieldTest is incorrect", new File(check, "InheritFieldTest.java"), new File(dest, "InheritFieldTest.java")); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Test\r\n\tpublic void testSanity() {\n\t}", "@Override\r\n\t\t\tpublic void test() {\n\t\t\t}", "@Test\n public void simpleUse(){\n }", "@Test\r\n\tpublic void test() {\r\n\t}", "@org.junit.Test\r\n\tpublic void test() {\n\t\t\t\t\r\n\t}", "public void testDumbJUnit() {\n }", "@Test\n\tpublic v...
[ "0.75710434", "0.74449277", "0.73627865", "0.731134", "0.7304504", "0.7222832", "0.7215483", "0.72147363", "0.72147363", "0.7214447", "0.72114563", "0.72114515", "0.7207631", "0.7183441", "0.71810764", "0.716787", "0.7122575", "0.71210265", "0.709407", "0.7086396", "0.7084878...
0.0
-1
A unit test for JUnit
public void test04() throws RefactoringException { RenameFieldRefactoring rfr = new RenameFieldRefactoring(); rfr.setClass("field", "RenameFieldTest"); rfr.setField("CODE_ON"); rfr.setNewName("changed"); rfr.run(); // Check things out File check = new File(this.check + "\\ut2\\step14"); FileCompare.assertEquals("RenameFieldTest is incorrect", new File(check, "RenameFieldTest.java"), new File(dest, "RenameFieldTest.java")); FileCompare.assertEquals("UsesFieldTest is incorrect", new File(check, "UsesFieldTest.java"), new File(dest, "UsesFieldTest.java")); FileCompare.assertEquals("InheritFieldTest is incorrect", new File(check, "InheritFieldTest.java"), new File(dest, "InheritFieldTest.java")); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Test\r\n\tpublic void testSanity() {\n\t}", "@Override\r\n\t\t\tpublic void test() {\n\t\t\t}", "@Test\n public void simpleUse(){\n }", "@Test\r\n\tpublic void test() {\r\n\t}", "@org.junit.Test\r\n\tpublic void test() {\n\t\t\t\t\r\n\t}", "public void testDumbJUnit() {\n }", "@Test\n\tpublic v...
[ "0.75710434", "0.74449277", "0.73627865", "0.731134", "0.7304504", "0.7222832", "0.7215483", "0.72147363", "0.72147363", "0.7214447", "0.72114563", "0.72114515", "0.7207631", "0.7183441", "0.71810764", "0.716787", "0.7122575", "0.71210265", "0.709407", "0.7086396", "0.7084878...
0.0
-1
A unit test for JUnit
public void test05() { RenameFieldRefactoring rfr = new RenameFieldRefactoring(); rfr.setClass("field", "RenameFieldTest"); rfr.setField("crazy"); rfr.setNewName("changed"); boolean exceptionThrown = false; try { rfr.run(); } catch (RefactoringException re) { exceptionThrown = true; assertEquals("Incorrect exception", "No field named crazy is contained in RenameFieldTest", re.getMessage()); } assertTrue("No exception thrown", exceptionThrown); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Test\r\n\tpublic void testSanity() {\n\t}", "@Override\r\n\t\t\tpublic void test() {\n\t\t\t}", "@Test\n public void simpleUse(){\n }", "@Test\r\n\tpublic void test() {\r\n\t}", "@org.junit.Test\r\n\tpublic void test() {\n\t\t\t\t\r\n\t}", "public void testDumbJUnit() {\n }", "@Test\n\tpublic v...
[ "0.75710434", "0.74449277", "0.73627865", "0.731134", "0.7304504", "0.7222832", "0.7215483", "0.72147363", "0.72147363", "0.7214447", "0.72114563", "0.72114515", "0.7207631", "0.7183441", "0.71810764", "0.716787", "0.7122575", "0.71210265", "0.709407", "0.7086396", "0.7084878...
0.0
-1
A unit test for JUnit
public void test06() { RenameFieldRefactoring rfr = new RenameFieldRefactoring(); rfr.setClass("field", "RenameFieldTest"); rfr.setField("simple"); rfr.setNewName("code"); boolean exceptionThrown = false; try { rfr.run(); } catch (RefactoringException re) { exceptionThrown = true; assertEquals("Incorrect exception", "A field named code already exists in class RenameFieldTest", re.getMessage()); } assertTrue("No exception thrown", exceptionThrown); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Test\r\n\tpublic void testSanity() {\n\t}", "@Override\r\n\t\t\tpublic void test() {\n\t\t\t}", "@Test\n public void simpleUse(){\n }", "@Test\r\n\tpublic void test() {\r\n\t}", "@org.junit.Test\r\n\tpublic void test() {\n\t\t\t\t\r\n\t}", "public void testDumbJUnit() {\n }", "@Test\n\tpublic v...
[ "0.75710434", "0.74449277", "0.73627865", "0.731134", "0.7304504", "0.7222832", "0.7215483", "0.72147363", "0.72147363", "0.7214447", "0.72114563", "0.72114515", "0.7207631", "0.7183441", "0.71810764", "0.716787", "0.7122575", "0.71210265", "0.709407", "0.7086396", "0.7084878...
0.0
-1
A unit test for JUnit
public void test07() throws RefactoringException { RenameFieldRefactoring rfr = new RenameFieldRefactoring(); rfr.setClass("", "XDateChooser"); rfr.setField("_maxDate"); rfr.setNewName("_maximumDate"); rfr.run(); // Check things out File check = new File(this.check + "\\ut2\\step15"); FileCompare.assertEquals("XDateChooser is incorrect", new File(check, "XDateChooser.java"), new File(root + "\\XDateChooser.java")); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Test\r\n\tpublic void testSanity() {\n\t}", "@Override\r\n\t\t\tpublic void test() {\n\t\t\t}", "@Test\n public void simpleUse(){\n }", "@Test\r\n\tpublic void test() {\r\n\t}", "@org.junit.Test\r\n\tpublic void test() {\n\t\t\t\t\r\n\t}", "public void testDumbJUnit() {\n }", "@Test\n\tpublic v...
[ "0.75710434", "0.74449277", "0.73627865", "0.731134", "0.7304504", "0.7222832", "0.7215483", "0.72147363", "0.72147363", "0.7214447", "0.72114563", "0.72114515", "0.7207631", "0.7183441", "0.71810764", "0.716787", "0.7122575", "0.71210265", "0.709407", "0.7086396", "0.7084878...
0.0
-1
A unit test for JUnit
public void test08() throws RefactoringException { RenameFieldRefactoring rfr = new RenameFieldRefactoring(); rfr.setClass("field", "RenameFieldTest"); rfr.setField("childObject"); rfr.setNewName("myChild"); rfr.run(); // Check things out File check = new File(this.check + "\\ut2\\step16"); FileCompare.assertEquals("RenameFieldTest is incorrect", new File(check, "RenameFieldTest.java"), new File(dest, "RenameFieldTest.java")); FileCompare.assertEquals("UsesFieldTest is incorrect", new File(check, "UsesFieldTest.java"), new File(dest, "UsesFieldTest.java")); FileCompare.assertEquals("InheritFieldTest is incorrect", new File(check, "InheritFieldTest.java"), new File(dest, "InheritFieldTest.java")); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Test\r\n\tpublic void testSanity() {\n\t}", "@Override\r\n\t\t\tpublic void test() {\n\t\t\t}", "@Test\n public void simpleUse(){\n }", "@Test\r\n\tpublic void test() {\r\n\t}", "@org.junit.Test\r\n\tpublic void test() {\n\t\t\t\t\r\n\t}", "public void testDumbJUnit() {\n }", "@Test\n\tpublic v...
[ "0.75710434", "0.74449277", "0.73627865", "0.731134", "0.7304504", "0.7222832", "0.7215483", "0.72147363", "0.72147363", "0.7214447", "0.72114563", "0.72114515", "0.7207631", "0.7183441", "0.71810764", "0.716787", "0.7122575", "0.71210265", "0.709407", "0.7086396", "0.7084878...
0.0
-1
The JUnit setup method
protected void setUp() { File cleanDir = new File(this.clean); dest = new File(root + "\\field"); if (!dest.exists()) { dest.mkdirs(); } (new FileCopy( new File(cleanDir, "field_RenameFieldTest.java"), new File(dest, "RenameFieldTest.java"), false)).run(); (new FileCopy( new File(cleanDir, "field_UsesFieldTest.java"), new File(dest, "UsesFieldTest.java"), false)).run(); (new FileCopy( new File(cleanDir, "field_InheritFieldTest.java"), new File(dest, "InheritFieldTest.java"), false)).run(); (new FileCopy( new File(cleanDir, "XDateChooser.java"), new File(root + "\\XDateChooser.java"), false)).run(); (new SummaryTraversal(root)).run(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@BeforeClass\n\tpublic static void setup() {\n\n\t}", "protected void setUp()\n {\n }", "protected void setUp()\n {\n }", "protected void setUp() {\n\t}", "@Before\r\n\tpublic void setup() {\r\n\t}", "protected void setUp() {\n\n }", "public void setUp() {\n\n\t}", "@Before\n\tpublic v...
[ "0.8439523", "0.8341067", "0.8341067", "0.83352935", "0.8317363", "0.8281777", "0.82574123", "0.82262236", "0.82121086", "0.8211444", "0.8208847", "0.8208847", "0.8208847", "0.8160784", "0.8146338", "0.81424946", "0.8133781", "0.8092053", "0.8063123", "0.80401844", "0.8022731...
0.0
-1
The teardown method for JUnit
protected void tearDown() { (new File(dest, "RenameFieldTest.java")).delete(); (new File(dest, "UsesFieldTest.java")).delete(); (new File(dest, "InheritFieldTest.java")).delete(); (new File(root + "\\XDateChooser.java")).delete(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "void teardown();", "void teardown();", "@Override\n public void teardown() {\n }", "@Override\n\tpublic void teardown() {\n\t}", "@AfterClass\n\tpublic static void teardown() {\n\t\tdataMunger = null;\n\n\t}", "@AfterClass\n\tpublic void teardown(){\n\t}", "protected void tearDown() {\n\t...
[ "0.9063598", "0.9063598", "0.90424395", "0.89785075", "0.8558831", "0.8554747", "0.83391744", "0.82628727", "0.82628727", "0.8227815", "0.8207605", "0.8172145", "0.8172029", "0.81562203", "0.81562203", "0.8143138", "0.8142196", "0.8138874", "0.8118606", "0.81114364", "0.80965...
0.0
-1
This method runs through all the permutations for working with identifiers, and provides examples for their common use.
private void runBiSciColIdentifierTools(EZIDService ezidAccount, Integer naan, Integer who) throws Exception { // Create a minter object to use for all these samples System.out.println("\nCreating a minter object by passing in an existing Dataset Prefix ..."); // Creation method Example #1, no arguments is just the default test case ark:/99999/fk4 // minterBCID minter = new minterBCID(); // Creation method Example #2, provide a NAAN & a user, which automatically creates a new shoulder // minterBCID minter = new minterBCID("87286",1); // Creation method Example #3, pass in an existing prefix and use that elementMinter minter = new elementMinter(87286, "C2", false, true); System.out.println(" prefix=" + minter.prefix); System.out.println(" datasets_id=" + minter.getDatasets_id()); // Create a bcid for localId without Suffix passthrough System.out.println("\nCreate bcids WITHOUT suffix passthrough from test dataset ..."); String datasetIdentifier = minter.mintList(testDatafile); System.out.println(" datasetIdentifier = " + datasetIdentifier); Iterator ezids1It = minter.getIdentifiers(datasetIdentifier).iterator(); while (ezids1It.hasNext()) { System.out.println(" " + ezids1It.next()); } System.out.println(" cleaning up ..."); minter.deleteLoadedSetUUID(datasetIdentifier); // Create a bcid for each localId's with Suffix passthrough System.out.println("\nCreate bcids WITH suffix passthrough from test dataset ..."); System.out.println(" datasetIdentifier = " + datasetIdentifier); datasetIdentifier = minter.mintList(testDatafile); Iterator ezids2It = minter.getIdentifiers(datasetIdentifier).iterator(); while (ezids2It.hasNext()) { System.out.println(" " + ezids2It.next()); } System.out.println(" cleaning up ..."); minter.deleteLoadedSetUUID(datasetIdentifier); // Create a bunch of bcids int num = 10; System.out.println("\nCreate " + num + " bcids (a reserved slot in our database) ..."); datasetIdentifier = minter.createBCIDs(num, new URI("http://purl.org/dc/dcmitype/PhysicalObject")); System.out.println(" datasetIdentifier = " + datasetIdentifier); Iterator guidsIt = minter.getIdentifiers(datasetIdentifier).iterator(); while (guidsIt.hasNext()) { System.out.println(" " + guidsIt.next()); } System.out.println(" cleaning up (deleting these identifiers cause we're just testing here) ..."); minter.deleteLoadedSetUUID(datasetIdentifier); // Create bcids from Given uuids with Suffix Passthrough System.out.println("\nCreate test uuid dataset ..."); String uuidInputStringFromTextBox = "" + UUID.randomUUID() + "\thttp://biocode.berkeley.edu/specimens/MBIO57\n" + UUID.randomUUID() + "\n" + UUID.randomUUID(); ArrayList localUUIDs = new inputFileParser(uuidInputStringFromTextBox, minter).elementArrayList; System.out.println(" Successfully created test uuid dataset"); // Create a bcid for each localId's System.out.println("\nCreating bcids with uuid suffix passthrough from test uuid dataset (FSU case) ..."); datasetIdentifier = minter.mintList(localUUIDs); System.out.println(" datasetIdentifier = " + datasetIdentifier); Iterator uuidsIt = minter.getIdentifiers(datasetIdentifier).iterator(); while (uuidsIt.hasNext()) { System.out.println(" " + uuidsIt.next()); } // Return information about an identifier (resolver service) //ark:/87286/C2 //ark:/87286/C2eee9cd5b-fd7d-40f9-acc6-362770e7bfde //1. Look in the identifiers table and resolve there. //2. Look in the datasets table // Create bcids from Given uuids with Suffix Passthrough System.out.println("\nCreate a second test uuid dataset ..."); String uuidInputStringFromTextBox2 = "" + UUID.randomUUID() + "\thttp://biocode.berkeley.edu/specimens/MBIO57\n" + UUID.randomUUID() + "\n" + UUID.randomUUID(); ArrayList localUUIDs2 = new inputFileParser(uuidInputStringFromTextBox2, minter).elementArrayList; System.out.println(" Successfully created test uuid dataset #2"); // Create a bcid for each localId's System.out.println("\nCreating bcidS WITHOUT uuid suffix passthrough from test uuid dataset #2 ..."); datasetIdentifier = minter.mintList(localUUIDs2); Iterator uuidsIt2 = minter.getIdentifiers(datasetIdentifier).iterator(); while (uuidsIt2.hasNext()) { System.out.println(" " + uuidsIt2.next()); } // TODO: Send URL Link to results // Scan Identifiers table and create ezids where ezidRequest = true && ezidMade = false System.out.println("\nBatch create ezids for Identifiers ..."); System.out.println(" OPTION disabled here for now; we cannot scale for all requests, but we want to maintain them."); //manageEZIDs creator = new manageEZIDs(); //creator.createEZIDs(ezidAccount); // Scan Datasets table and create ezids where ezidRequest = true && ezidMade = false System.out.println("\nBatch create ezids for Datasets ..."); manageEZID creator = new manageEZID(); creator.createDatasetsEZIDs(ezidAccount); System.out.println(" Scanned datasets table and created any dataset ezids"); // Force an update on an individual bcid System.out.println("\nUpdate a single ezid metadata record for id = " + minter.getDatasets_id() + " ..."); creator.updateDatasetsEZID(ezidAccount, minter.getDatasets_id()); // Create a Dataset /* System.out.println("\nCreate a new dataset object:"); dataset dataset = new dataset(false); dataset.mint(naan, who, new ResourceTypes().RESOURCE, null, "http://www.google.com/", "this is a test"); System.out.println(" Created " + dataset.prefix); dataset.close(); */ // Close connection minter.close(); creator.close(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public static void main(String... args) {\n List<String> list = Arrays.asList(\"aap\", \"noot\", \"mies\");\n List<List<String>> perms = getPermutations(list);\n perms.forEach(System.out::println);\n }", "@Test\r\n public void PermutationTest() {\r\n System.out.println(\"permuta...
[ "0.5906901", "0.57167023", "0.5708114", "0.5687999", "0.56448257", "0.5643547", "0.559214", "0.55879056", "0.55553144", "0.5548575", "0.55419624", "0.55335855", "0.55065554", "0.5479537", "0.54782", "0.54719734", "0.54532206", "0.5431698", "0.5430522", "0.5417556", "0.5386533...
0.0
-1
Test the Resolution Services
public static void resolver(EZIDService ezidService) { resolverResults(ezidService, "ark:/87286/C2/AOkI"); resolverResults(ezidService, "ark:/87286/C2/64c82d19-6562-4174-a5ea-e342eae353e8"); resolverResults(ezidService, "ark:/87286/C2/Foo"); resolverResults(ezidService, "ark:/87286/Cddfdf2"); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Test\n @Ignore\n public void testRegistration() {\n ROIAwareWarpDescriptor.register();\n ScaleDescriptor.register();\n AffineDescriptor.register();\n }", "@Override\r\n\t@Test(groups = {\"function\",\"setting\"} ) \r\n\tpublic boolean checkResolution() {\n\t\tboolean flag = oTest.c...
[ "0.66147965", "0.6570242", "0.6087589", "0.60358775", "0.5967375", "0.5941697", "0.5935311", "0.59269524", "0.5742929", "0.5720801", "0.56878126", "0.56279796", "0.55685174", "0.555759", "0.55398536", "0.55193704", "0.55174136", "0.55152404", "0.54846364", "0.5475874", "0.547...
0.0
-1
Test creating a bunch of BCIDs as if it were being called from a REST service
private void runBCIDCreatorService(){ // Initialize variables dataGroupMinter dataset = null; SettingsManager sm = SettingsManager.getInstance(); sm.loadProperties(); EZIDService ezidAccount = new EZIDService(); Integer user_id = 1; Integer NAAN = new Integer(sm.retrieveValue("bcidNAAN")); Integer ResourceType = ResourceTypes.PRESERVEDSPECIMEN; String doi = null; String webaddress = null; String title = "TEST Load from Java"; // Create a new dataset System.out.println("\nCreating a new dataset"); dataset = new dataGroupMinter(true, true); dataset.mint(NAAN, user_id, new ResourceTypes().get(ResourceType).uri, doi, webaddress, null,title); dataset.close(); /* // Create test data by using input file String path = Thread.currentThread().getContextClassLoader().getResource("bigfile.txt").getFile(); System.out.println("\nReading input file = " + path + " ..."); try { testDatafile = new inputFileParser(readFile(path), dataset).elementArrayList; } catch (IOException e) { e.printStackTrace(); } catch (URISyntaxException e) { e.printStackTrace(); } // Create an elementMinter object by using a dataset elementMinter minter = new elementMinter(dataset.getDatasets_id()); // Mint a list of identifiers System.out.println("\nPreparing to mint " + testDatafile.size()+ " identifiers"); String datasetUUID = minter.mintList(testDatafile); // Return the list of identifiers that were made here System.out.println(JSONArray.fromObject(minter.getIdentifiers(datasetUUID)).toString()); */ }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Test\n public void createComaPatients() {\n \n Assert.assertEquals(service.createComa().get(0).getBedNumber(), \"45\");\n }", "@Test\n public void createObject() {\n\n for (int i = 1; i < 20; i++) {\n\n /**\n * Get the current array\n */\n ...
[ "0.6677897", "0.6318466", "0.6276133", "0.6152345", "0.6009257", "0.5983575", "0.59329444", "0.5924546", "0.59110683", "0.5865836", "0.5864172", "0.58407426", "0.5835111", "0.5819037", "0.5797531", "0.57493293", "0.5739415", "0.57255274", "0.57182455", "0.56839025", "0.567743...
0.5897153
9
recebe uma string "f4:d4"
public void mover_peca(String comando) { int ii = '7' - comando.charAt(1); //i inicial int ji = comando.charAt(0) - 'a'; //j inicial int id = '7' - comando.charAt(4); //i destino int jd = comando.charAt(3) - 'a'; //j destino if(this.mov_valido(ii, ji, id, jd)) { m[(ii+id)/2][(ji+jd)/2] = null; m[id][jd] = m[ii][ji]; m[ii][ji] = null; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "java.lang.String getS4();", "public final String m2268d(String str) {\n JsonValue a = m2259a(str);\n if (a != null) {\n return a.m2260a();\n }\n throw new IllegalArgumentException(\"Named value not found: \" + str);\n }", "private static String formatTime(String time) ...
[ "0.54526466", "0.54338354", "0.5422101", "0.52998376", "0.5139481", "0.50970876", "0.50618106", "0.5026911", "0.50207835", "0.5012947", "0.5004422", "0.4985059", "0.4982113", "0.49758172", "0.49734202", "0.49710253", "0.49706072", "0.4959413", "0.49565378", "0.49554208", "0.4...
0.0
-1
Get a list of running apps
@Override public void onClick(View view) { List<AndroidAppProcess> runningAppProcessInfo = AndroidProcesses.getRunningAppProcesses(); for (int i = 0; i < runningAppProcessInfo.size(); i++) { Log.i("MainActivity", runningAppProcessInfo.get(i).getPackageName()); // Check for AnkuLua if(runningAppProcessInfo.get(i).getPackageName().equals("com.appautomatic.ankulua.pro2") || runningAppProcessInfo.get(i).getPackageName().equals("com.appautomatic.ankulua.pro") || runningAppProcessInfo.get(i).getPackageName().equals("com.appautomatic.ankulua.trial")){ // AnkuLua package process has been detected! Perma ban account for abusing Terms & Conditions alert(); return; } } Toast.makeText(MainActivity.this,"Not Found",Toast.LENGTH_SHORT).show(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public ArrayList<String> getAllRunningApp() {\n\t\tArrayList<String> apps = new ArrayList<String>();\n\t\tActivityManager activityManager = (ActivityManager)getSystemService(ACTIVITY_SERVICE);\n\t\tList<RunningAppProcessInfo> runningAppProcesses = activityManager.getRunningAppProcesses();\n\t\t\n\t\tfor (RunningAp...
[ "0.8223861", "0.7560645", "0.74182963", "0.7375811", "0.73068374", "0.7271555", "0.72485524", "0.71694696", "0.70207363", "0.6978502", "0.6968055", "0.68746865", "0.681805", "0.6811896", "0.6766585", "0.6713698", "0.6694503", "0.6674112", "0.6542052", "0.64928615", "0.6488418...
0.0
-1
Create and return a single reference to be included in the text
public static DocumentFragment getIntextElement(Module m, PIcommand cmd,Reference ref) { DocumentFragment df = m.getDoc().createDocumentFragment(); Element refElt = m.getDoc().createElement("span"); refElt.setAttribute("class", cmd.getCommandStyleName()); Node n_ref = null; String reftext = ""; // set as requested String index = Reference.EMPTY; if (cmd.paramExist(PIcommand.INDEX)) { index = cmd.getValue(PIcommand.INDEX); } // display according to style // display IEE style reftext += " [" + index + "] "; n_ref = m.getDoc().createTextNode(reftext.trim()); refElt.appendChild(n_ref); df.appendChild(refElt); return df; //return refElt; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "TextWithReferences getTextWithReferences();", "public String toReference(Object text) { String t=toString(text); if(t==null || t.length()==0) {return null;} return \"<<\"+t+\">>\"; }", "String getReference();", "String getReference();", "java.lang.String getRef();", "public String getReference();", "pu...
[ "0.73373723", "0.73362774", "0.695699", "0.695699", "0.6951675", "0.6704501", "0.6704501", "0.6680422", "0.6589227", "0.656188", "0.625201", "0.62219036", "0.6200169", "0.6124568", "0.612287", "0.6113743", "0.6085697", "0.60697925", "0.6025897", "0.60223216", "0.60223216", ...
0.6019516
22
Create and return a lielement for an referencelist The actual fields and which are mandatory for differents styles are implemented here, and no other place
public static DocumentFragment getListElement(Module mod, PIcommand cmd, Reference ref, List<IndexItem> users) { String style = mod.getScriptHandler().getOption(Options.REFERENCE_FORM); DocumentFragment df = mod.getDoc().createDocumentFragment(); Element liElt = mod.getDoc().createElement("li"); liElt.setAttribute("class", "refitem skiptranslate " + style); HashMap<String,String> m_propertMap=ref.m_propertMap; // do IEEE liElt.appendChild(m_propertMap.containsKey(ref.AUTHORS_IN_LIST) ? liElt.appendChild(ref.makePropertyElement(ref.AUTHORS_IN_LIST, mod)) : liElt.appendChild(ref.makePropertyElement("title", mod))); liElt.appendChild(ref.makePropertyElement("year", mod)); if (m_propertMap.containsKey("chaptertitle")) { liElt.appendChild(ref.makePropertyElement("chaptertitle", mod)); } if (m_propertMap.containsKey("journal")) { liElt.appendChild(ref.makePropertyElement("journal", mod)); } if (m_propertMap.containsKey("editor")) { liElt.appendChild(ref.makePropertyElement("editor", mod)); } if (!m_propertMap.containsKey(ref.AUTHORS_IN_LIST)) { liElt.appendChild(ref.makePropertyElement("title", mod)); } if (m_propertMap.containsKey("place")) { liElt.appendChild(ref.makePropertyElement("place", mod)); } if (m_propertMap.containsKey("publisher")) { liElt.appendChild(ref.makePropertyElement("publisher", mod)); } if (m_propertMap.containsKey("pages")) { liElt.appendChild(ref.makePropertyElement("pages", mod)); } if (m_propertMap.containsKey("isbn")) { liElt.appendChild(ref.makePropertyElement("isbn", mod)); } if (m_propertMap.containsKey("text")) { liElt.appendChild(ref.makePropertyElement("text", mod)); } if (m_propertMap.containsKey("uri")) { liElt.appendChild(ref.makeUriElement(m_propertMap.get("uri"), mod)); } if (m_propertMap.containsKey("dateread")) { liElt.appendChild(ref.makePropertyElement("dateread", mod)); } df.appendChild(liElt); return df; //return liElt; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "LI createLI();", "ListItem createListItem();", "UnorderedListContent createUnorderedListContent();", "ListValue createListValue();", "private void structureListElement() {\n postBodyHTMLContent = postBodyHTMLContent.replaceAll(Data.LI_OPENING_REGEX_MATCHER, \"- \");\n\n // replace closing tag...
[ "0.7131844", "0.6506517", "0.6251373", "0.62225455", "0.62191707", "0.6172313", "0.60193235", "0.59873205", "0.5941725", "0.5938451", "0.5938451", "0.5927676", "0.58994865", "0.5839678", "0.5832849", "0.5820074", "0.5809365", "0.5789927", "0.57352", "0.5734606", "0.5734606", ...
0.63150555
2
/ To change this license header, choose License Headers in Project Properties. To change this template file, choose Tools | Templates and open the template in the editor. Observer interface to be notified when sensor values have changed or an error occured.
public interface ISpO2Observer { /** * Different error states * */ public enum ErrorState { /** sensor ok*/ OK, /** sensor disconnected*/ SensorDisconnect, /** finger is out*/ FingerOut, /** perfusion is low*/ LowPerfusion, /** selftest was not completeted successfully*/ SelftestError} /** * Is called when a new sensor value was received. * @param pulse the current pulse value * @param spo2 the spo2 value */ void onNewPulse(int pulse, int spo2 ); /** * Is called when a error occured * @param oxiError the error */ void onErrorState(ErrorState oxiError); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public interface OnSensorValueChangeListener {\n public void onSensorValueChanged(int newVal);\n}", "public interface Observer {\n public void update(float temperature , float pressure , float humdity);\n}", "public void onSensorChanged() {\n\t\tsensorChanged();\n\t}", "@Override\n\tpublic void onSens...
[ "0.76291645", "0.7543118", "0.75394964", "0.74349546", "0.74349546", "0.73891777", "0.73874193", "0.72824717", "0.72824717", "0.7233742", "0.7132228", "0.70917904", "0.7079636", "0.70704496", "0.7016167", "0.69529283", "0.6862651", "0.68607515", "0.6840024", "0.6825336", "0.6...
0.6352002
48
Is called when a new sensor value was received.
void onNewPulse(int pulse, int spo2 );
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void onSensorChanged() {\n\t\tsensorChanged();\n\t}", "@Override\n public void onSensorChanged(SensorEvent event) {\n long now = SystemClock.elapsedRealtime();\n\n long deltaMs = 0;\n if (mLastUpdateTS != 0) {\n deltaMs = now - mLa...
[ "0.715614", "0.699007", "0.6805588", "0.6784752", "0.67644024", "0.66251683", "0.65540004", "0.6529422", "0.6525047", "0.6514144", "0.6508102", "0.6507415", "0.6494711", "0.6494711", "0.6479882", "0.6452721", "0.64020646", "0.6392537", "0.6385022", "0.6351298", "0.6313916", ...
0.0
-1
/ Based on the API reference: POST/1/cards
@Test public void addCard_response_check_status_test() throws ClientProtocolException, IOException { System.out.println("\n--------------------------------------------------"); System.out.println("Start test: " + testName.getMethodName()); //Given String idList = testSuite.listId; String due = "null"; String name = "Add card"; String desc = "API test - Add card through trello API"; String query = String.format("idList=%s&due=%s&name=%s&desc=%s&key=%s&token=%s", URLEncoder.encode(idList, charset), URLEncoder.encode(due, charset), URLEncoder.encode(name, charset), URLEncoder.encode(desc, charset), URLEncoder.encode(key, charset), URLEncoder.encode(token, charset)); //When CloseableHttpClient httpClient = HttpClients.createDefault(); HttpPost postRequest = new HttpPost(cardUrl + "?" + query); HttpResponse response = httpClient.execute(postRequest); //Then /* * Expect: 200 - status code * */ assertEquals(response.getStatusLine().getStatusCode(), 200); //Tear down httpClient.close(); System.out.println("Finish test: " + testName.getMethodName()); System.out.println("--------------------------------------------------\n"); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@FormUrlEncoded\n @POST(\"/v2/cards/create.json\")\n void create(@Field(\"card_data\") CardData data, Callback<CardCreate> cb);", "@PostMapping(\"/cards\")\n StarbucksCard newCard() {\n StarbucksCard newcard = new StarbucksCard();\n\n Random random = new Random();\n int num = random...
[ "0.7279771", "0.698753", "0.69107866", "0.6804971", "0.65093553", "0.6464893", "0.64490724", "0.6346703", "0.6194059", "0.61654913", "0.61436886", "0.60516536", "0.60236305", "0.6020458", "0.59550285", "0.59252626", "0.59216136", "0.590427", "0.58967185", "0.58913577", "0.588...
0.57629
29
/ Based on the API reference: DELETE/1/cards/card id
@Test public void delete_card_check_status_test() throws ClientProtocolException, IOException { System.out.println("\n--------------------------------------------------"); System.out.println("Start test: " + testName.getMethodName()); //Given //Create a card first String idList = testSuite.listId; String due = "null"; String name = "Card need to delete"; String desc = "API test - create this card and need to delete"; String createQuery = String.format("idList=%s&due=%s&name=%s&desc=%s&key=%s&token=%s", URLEncoder.encode(idList, charset), URLEncoder.encode(due, charset), URLEncoder.encode(name, charset), URLEncoder.encode(desc, charset), URLEncoder.encode(key, charset), URLEncoder.encode(token, charset)); CloseableHttpClient httpClient = HttpClients.createDefault(); HttpPost postRequest = new HttpPost(cardUrl + "?" + createQuery); HttpResponse response = httpClient.execute(postRequest); if(response.getStatusLine().getStatusCode() == 200) //Add test card successfully { JsonReader jsonReader = Json.createReader(response.getEntity().getContent()); JsonObject cardJson = jsonReader.readObject(); String cardId = cardJson.getString("id"); jsonReader.close(); String query = String.format("key=%s&token=%s", URLEncoder.encode(key, charset), URLEncoder.encode(token, charset)); //When HttpDelete deleteRequest = new HttpDelete(cardUrl + cardId + "?" + query); HttpResponse delResponse = httpClient.execute(deleteRequest); //Then /* * Expect: 200 - Status code * */ assertEquals(delResponse.getStatusLine().getStatusCode(), 200); } else { fail("Adding card is wrong, cannot delete card"); } //Tear down httpClient.close(); System.out.println("Finish test: " + testName.getMethodName()); System.out.println("--------------------------------------------------\n"); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public boolean delete(String cardid);", "public void deleteCard(int cardId)\n {\n dbObj=new dbFlashCards(uid);\n dbObj.deleteCard(cardId, packId);\n \n \n }", "int deleteByPrimaryKey(String card);", "public int deleteCard() {\r...
[ "0.8034475", "0.772111", "0.7711954", "0.72669363", "0.72219986", "0.7083216", "0.7022358", "0.6982365", "0.68764615", "0.6845651", "0.67519015", "0.6616671", "0.6567832", "0.6489056", "0.6455875", "0.6367895", "0.63646346", "0.6363494", "0.63333553", "0.63033545", "0.6301077...
0.6127452
26
/ Test the default reponse content type should be JSON
@Test public void get_card_ckeck_content_format_is_JSON_test() throws ClientProtocolException, IOException { System.out.println("\n--------------------------------------------------"); System.out.println("Start test: " + testName.getMethodName()); //Given //Add a card to get card content String idList = testSuite.listId; String due = "null"; String name = "Card need to get content"; String desc = "API test - create this card and need to get its content"; String createQuery = String.format("idList=%s&due=%s&name=%s&desc=%s&key=%s&token=%s", URLEncoder.encode(idList, charset), URLEncoder.encode(due, charset), URLEncoder.encode(name, charset), URLEncoder.encode(desc, charset), URLEncoder.encode(key, charset), URLEncoder.encode(token, charset)); CloseableHttpClient httpClient = HttpClients.createDefault(); HttpPost postRequest = new HttpPost(cardUrl + "?" + createQuery); HttpResponse response = httpClient.execute(postRequest); if(response.getStatusLine().getStatusCode() == 200) //Add test card successfully { JsonReader jsonReader = Json.createReader(response.getEntity().getContent()); JsonObject cardJson = jsonReader.readObject(); String cardId = cardJson.getString("id"); jsonReader.close(); String query = String.format("key=%s&token=%s", URLEncoder.encode(key, charset), URLEncoder.encode(token, charset)); //When HttpGet getRequest = new HttpGet(cardUrl + cardId + "?" + query); HttpResponse getResponse = httpClient.execute(getRequest); //Then /* * Expect: /application/json - content format * */ String type = getResponse.getEntity().getContentType().getValue().toString(); assertThat(type, CoreMatchers.containsString("application/json")); } else { fail("Adding card is wrong, cannot get card content format"); } //Tear down httpClient.close(); System.out.println("Finish test: " + testName.getMethodName()); System.out.println("--------------------------------------------------\n"); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "boolean isJSON(Response response) {\n return response.getHeaderString(\"Content-Type\").equalsIgnoreCase(MediaType.APPLICATION_JSON);\n }", "@Test\n\tpublic void requestDataForCustomer12212_checkContentType_expectApplicationJson() {\n\n\t\tgiven().\n\t\t\tspec(requestSpec).\n\t\twhen().\n\t\tthen();\n\...
[ "0.7164561", "0.68194175", "0.6786626", "0.6441385", "0.64413357", "0.64173", "0.6272414", "0.6241088", "0.6177883", "0.6056852", "0.6056435", "0.60303175", "0.6025985", "0.5999686", "0.59974045", "0.5941785", "0.5930924", "0.59274423", "0.586862", "0.58255243", "0.58205396",...
0.5787216
22
Initialize Properties (only once in program
public static void loadProperties() { if (!isLoaded) { new BCProperties() ; isLoaded = true ; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private void initProperties()\r\n {\r\n try\r\n {\r\n properties.load(new FileInputStream(propertiesURL));\r\n }\r\n catch (IOException ex)\r\n {\r\n log.log(DEBUG,\"\"+ex);\r\n } \r\n }", "public void init(Properties props) ;", "publ...
[ "0.7953739", "0.7848436", "0.78292656", "0.7778296", "0.7730502", "0.75931615", "0.7592292", "0.7509239", "0.7415025", "0.73598385", "0.7356839", "0.73269737", "0.7293548", "0.72551364", "0.7245999", "0.7226907", "0.718164", "0.71767116", "0.71667635", "0.7155544", "0.7140261...
0.74668914
8
Get Property with default.
public static String getProperty(String key, String defaultValue) { return properties.getProperty(key, defaultValue) ; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "String getProperty(String name, String defaultValue);", "protected <T> Property getProperty(String key, T defaultVal) {\r\n return getProperty(key, defaultVal, RestartReqs.NONE);\r\n }", "public String getProperty(Object obj, String key, String defaultValue);", "@Override\n\t\tpublic Object getProperty(S...
[ "0.79449034", "0.76693577", "0.7535586", "0.73681635", "0.7261764", "0.71442485", "0.7095214", "0.6977769", "0.69530714", "0.69316983", "0.6869481", "0.68666834", "0.680654", "0.680654", "0.6738604", "0.6706819", "0.6688152", "0.66342986", "0.6591907", "0.6584483", "0.6560910...
0.66298187
18
Constructor for objects of class MyVM constructor with no params
public MyVM( ) { // initialise instance variables try { // your code here this.si=new ServiceInstance(new URL(SJSULAB.getVmwareHostURL()), SJSULAB.getVmwareLogin(), SJSULAB.getVmwarePassword(), true); } catch ( Exception e ) { System.out.println( e.toString() ) ; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public VM() {\n initComponents();\n }", "VM createVM();", "public TParametrosVOImpl() {\r\n }", "public VMProcess() \n\t{\n\t\tsuper();\n\t}", "public VMProcess() {\n\t\tsuper();\n\t}", "public TV() {\r\n\t}", "public VMKernel() {\n }", "public MyVM(String virtual_machine_name)\n {...
[ "0.68000185", "0.66570985", "0.6456419", "0.64098823", "0.6294041", "0.62277627", "0.6080493", "0.60427845", "0.60379905", "0.6031631", "0.6003446", "0.5989035", "0.5940657", "0.59176236", "0.59052676", "0.590135", "0.58363867", "0.5822306", "0.5790701", "0.5761024", "0.57485...
0.71302825
0
constructor with 1 param
public MyVM(String virtual_machine_name) { try { this.vmname= virtual_machine_name; this.si=new ServiceInstance(new URL(SJSULAB.getVmwareHostURL()), SJSULAB.getVmwareLogin(), SJSULAB.getVmwarePassword(), true); this.folder = si.getRootFolder(); this.vm=(VirtualMachine) new InventoryNavigator(folder).searchManagedEntity("VirtualMachine", this.vmname); System.out.println("MyVM, vm value : "+vm); this.hs= (HostSystem) new InventoryNavigator(folder).searchManagedEntity("HostSystem", "130.65.132.194"); System.out.println("MyVM, HS value : "+hs); this.snapshotname="snap2"; } catch(Exception e) { System.out.println(e.toString()); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "Constructor() {\r\n\t\t \r\n\t }", "public Constructor(){\n\t\t\n\t}", "public Pasien() {\r\n }", "public Video( int arg1 ) { \n\t\tsuper( );\n\t}", "ConstuctorOverloading(int num){\n\t\tSystem.out.println(\"I am contructor with 1 parameter\");\n\t}", "public Clade() {}", "DefaultConstructor(int ...
[ "0.7162059", "0.7107145", "0.67049795", "0.6667298", "0.6629703", "0.6563407", "0.6556004", "0.65439355", "0.65434146", "0.654272", "0.65323627", "0.6527024", "0.6521265", "0.6507124", "0.6492242", "0.6492124", "0.64867884", "0.64830494", "0.64561105", "0.6426002", "0.6412285...
0.0
-1
Destructor for objects of class MyVM
protected void finalize() throws Throwable { // your code here this.si.getServerConnection().logout(); super.finalize(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void cleanup() {\n try {\n resManager.stopVirtualNodes();\n } catch (Exception e) {\n logger.error(ITConstants.TS + \": \" + DEL_VM_ERR, e);\n }\n logger.info(\"Cleanup done\");\n }", "void destroyWithClearVisitorData();", "public void destruct() {\n\...
[ "0.7119121", "0.68975234", "0.65350753", "0.63792914", "0.6311796", "0.6282837", "0.6259797", "0.62440515", "0.61907613", "0.61907613", "0.61802995", "0.61696875", "0.61578166", "0.61412394", "0.61412394", "0.6135392", "0.6135392", "0.6135392", "0.6135392", "0.6135392", "0.61...
0.0
-1
Power On the Virtual Machine
public void powerOn() { try { // your code here System.out.println("Powering on virtual machine '"+vm.getName() +"'. Please wait..."); Task t=vm.powerOnVM_Task(null); if(t.waitForTask()== Task.SUCCESS) { System.out.println("Virtual machine powered on."); System.out.println("===================================="); } else System.out.println("Power on failed / VM already powered on..."); } catch ( Exception e ) { System.out.println( e.toString() ) ; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void powerOnVm(String vmName){\r\n\t\tVirtualMachine virtualMachine;\r\n\t\tString status;\r\n\t\ttry {\r\n\t\t\tvirtualMachine = searchVirtualMachine(vmName);\r\n\t\t} catch (Exception e) {\r\n\t\t\tprintInvalidVmMessage(vmName);\r\n\t\t\treturn;\r\n\t\t}\r\n\t\tSystem.out.println(\"Name = \"+vmName);\r\n\...
[ "0.7698023", "0.71723765", "0.69221616", "0.690357", "0.6575138", "0.65694773", "0.63068694", "0.6272768", "0.62666786", "0.622527", "0.6215877", "0.6214729", "0.61698985", "0.61639667", "0.6120324", "0.6112539", "0.5982004", "0.59781194", "0.5973714", "0.5943565", "0.5840645...
0.84864235
0
Power Off the Virtual Machine
public void powerOff() { try { // your code here System.out.println("Powering off virtual machine '"+vm.getName() +"'. Please wait..."); Task t=vm.powerOffVM_Task(); if(t.waitForTask()== Task.SUCCESS) { System.out.println("Virtual machine powered off."); System.out.println("===================================="); } else System.out.println("Power off failed / VM already powered on..."); } catch ( Exception e ) { System.out.println( e.toString() ) ; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void powerOffVm(String vmName){\r\n\t\tVirtualMachine virtualMachine;\r\n\t\tString status;\r\n\t\tTask powerOffVmTask = null;\r\n\t\ttry {\r\n\t\t\tvirtualMachine = searchVirtualMachine(vmName);\r\n\t\t} catch (Exception e) {\r\n\t\t\tprintInvalidVmMessage(vmName);\r\n\t\t\treturn;\r\n\t\t}\r\n\t\tSystem.o...
[ "0.75514495", "0.73757213", "0.7362848", "0.71390206", "0.70354736", "0.68561757", "0.6710834", "0.66837555", "0.65910894", "0.65397954", "0.65063614", "0.64322364", "0.64014786", "0.61788213", "0.61652994", "0.6159223", "0.6141097", "0.61261576", "0.61108625", "0.6060724", "...
0.8280028
0
Reset the Virtual Machine
public void reset() { try { // your code here System.out.println("Resetting virtual machine '"+vm.getName() +"'. Please wait..."); Task t=vm.resetVM_Task(); if(t.waitForTask()== Task.SUCCESS) { System.out.println("Virtual machine reset."); System.out.println("===================================="); } else System.out.println("Reset failed..."); } catch ( Exception e ) { System.out.println( e.toString() ) ; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "void reset() throws EnvironmentException;", "private void cmdReset() throws NoSystemException {\n fSession.reset();\n }", "void reset();", "void reset();", "void reset();", "void reset();", "void reset();", "void reset();", "void reset();", "void reset();", "void reset();", "void re...
[ "0.6969766", "0.68501455", "0.6662484", "0.6662484", "0.6662484", "0.6662484", "0.6662484", "0.6662484", "0.6662484", "0.6662484", "0.6662484", "0.6662484", "0.6662484", "0.6662484", "0.6662484", "0.6662484", "0.6662484", "0.6662484", "0.6662484", "0.6662484", "0.6662484", ...
0.8303154
0
ManagedObjectReference mor; System.out.println("in get tree");
static ManagedObjectReference getSnapshotFromTree(VirtualMachineSnapshotTree[] vmst, String s) { for(int i=0; i <vmst.length; i++) { VirtualMachineSnapshotTree node = vmst[i]; if(s.equals(node.getName())) { return node.getSnapshot(); } else { VirtualMachineSnapshotTree[] childTree = node.getChildSnapshotList(); if(childTree!=null) { ManagedObjectReference mor = getSnapshotFromTree(childTree, s); if(mor!=null) { return mor; } } } } return null; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public ObjectReference getObject();", "public Object getObject() {\r\n/* 109 */ return this.object;\r\n/* */ }", "List<SoftObjectReference> getObjects();", "String getObjectRefName();", "public Object getObject() ;", "OperationNode getNode();", "public NetObject getObject();", "@Test\n ...
[ "0.6373411", "0.5802637", "0.5706356", "0.5596996", "0.5573875", "0.5499967", "0.54803413", "0.5422541", "0.5413481", "0.54087365", "0.53731936", "0.5372477", "0.5372465", "0.5368373", "0.5357186", "0.530591", "0.52754134", "0.526531", "0.5260424", "0.5252059", "0.52301097", ...
0.511111
36
/Print details of all VMs present on the vCenter (multiple hosts included)
public void helloVM() { try { VirtualMachineConfigInfo vminfo = vm.getConfig(); VirtualMachineCapability vmc = vm.getCapability(); VirtualMachineRuntimeInfo vmri = vm.getRuntime(); VirtualMachineSummary vmsum = vm.getSummary(); System.out.println("------------------------------------------"); System.out.println("VM Information : "); System.out.println("VM Name: " + vminfo.getName()); System.out.println("VM OS: " + vminfo.getGuestFullName()); System.out.println("VM ID: " + vminfo.getGuestId()); System.out.println("VM Guest IP Address is " +vm.getGuest().getIpAddress()); System.out.println("------------------------------------------"); System.out.println("Resource Pool Informtion : "); System.out.println("Resource pool: " +vm.getResourcePool()); System.out.println("VM Parent: " +vm.getParent()); //System.out.println("VM Values: " +vm.getValues()); System.out.println("Multiple snapshot supported: " + vmc.isMultipleSnapshotsSupported()); System.out.println("Powered Off snapshot supported: "+vmc.isPoweredOffSnapshotsSupported()); System.out.println("Connection State: " + vmri.getConnectionState()); System.out.println("Power State: " + vmri.getPowerState()); //CPU Statistics System.out.println("------------------------------------------"); System.out.println("CPU and Memory Statistics" ); System.out.println("CPU Usage: " +vmsum.getQuickStats().getOverallCpuUsage()); System.out.println("Max CPU Usage: " + vmri.getMaxCpuUsage()); System.out.println("Memory Usage: "+vmsum.getQuickStats().getGuestMemoryUsage()); System.out.println("Max Memory Usage: " + vmri.getMaxMemoryUsage()); System.out.println("------------------------------------------"); } catch (InvalidProperty e) { e.printStackTrace(); } catch (RuntimeFault e) { e.printStackTrace(); } catch (RemoteException e) { e.printStackTrace(); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void printVirtualMachines() throws InvalidProperty, RuntimeFault, RemoteException{\r\n\t\tManagedEntity[] mes = new\r\n\t\t\t\tInventoryNavigator(_instance.getRootFolder()).searchManagedEntities(\"VirtualMachine\");\r\n\t\tfor (int i = 0; i < mes.length; i++) {\r\n\t\t\tVirtualMachine currVm = (VirtualMachi...
[ "0.7695324", "0.70809215", "0.6694747", "0.6642496", "0.66139114", "0.6528943", "0.62099004", "0.60871565", "0.59663665", "0.5879662", "0.5877476", "0.57794803", "0.57323897", "0.5612325", "0.55618805", "0.55256134", "0.5518479", "0.54935807", "0.5492855", "0.54715914", "0.54...
0.63159966
6
Dictionary table (entity). May return possible values for a set of attributes.
public interface DBSDictionary { /** * Checks that this constrain supports key enumerations. * Usually it depends on constraint type (enumerations makes sense only for unique constraints). * @return true or false */ boolean supportsDictionaryEnumeration(); /** * Gets enumeration values * * @param monitor session * @param keyColumn enumeration column. * @param keyPattern pattern for enumeration values. If null or empty then returns full enumration set * @param searchText * @param preceedingKeys other constrain key values. May be null. * @param caseInsensitiveSearch use case-insensitive search for {@code keyPattern} * @param sortAsc ascending sorting (irrelevant is {@code sortByValue} is false) * @param sortByValue sort results by value * @param offset enumeration values offset in result set * @param maxResults maximum enumeration values in result set * @return statement with result set which contains valid enumeration values. */ @NotNull List<DBDLabelValuePair> getDictionaryEnumeration( @NotNull DBRProgressMonitor monitor, @NotNull DBSEntityAttribute keyColumn, @Nullable Object keyPattern, @Nullable String searchText, @Nullable List<DBDAttributeValue> preceedingKeys, boolean caseInsensitiveSearch, boolean sortAsc, boolean sortByValue, int offset, int maxResults ) throws DBException; @NotNull List<DBDLabelValuePair> getDictionaryValues( @NotNull DBRProgressMonitor monitor, @NotNull DBSEntityAttribute keyColumn, @NotNull List<Object> keyValues, @Nullable List<DBDAttributeValue> preceedingKeys, boolean sortByValue, boolean sortAsc ) throws DBException; @NotNull DBSDictionaryAccessor getDictionaryAccessor( @NotNull DBRProgressMonitor monitor, @Nullable List<DBDAttributeValue> precedingKeys, @NotNull DBSEntityAttribute keyColumn, boolean sortAsc, boolean sortByDesc ) throws DBException; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public abstract Map<String, Object> getAttributes();", "Map<String, String> getAttributes();", "Map<String, Object> getAttributes();", "Map<String, Object> getAttributes();", "Map<String, Object> getAttributes();", "public abstract Map getAttributes();", "public Map<String, Object> getAttributes();", ...
[ "0.6566911", "0.645978", "0.6443286", "0.6443286", "0.6443286", "0.6420927", "0.63478976", "0.63478976", "0.632535", "0.6163154", "0.60220873", "0.5972368", "0.5877117", "0.58406746", "0.57809544", "0.5769673", "0.5766392", "0.5696072", "0.5634011", "0.55321974", "0.5508346",...
0.51812065
45
Checks that this constrain supports key enumerations. Usually it depends on constraint type (enumerations makes sense only for unique constraints).
boolean supportsDictionaryEnumeration();
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public static List<Class<? extends Enum<?>>> getValidEnums(TKey<?, ?> key) {\n ArrayList<Class<? extends Enum<?>>> ret = validQualifiers.get(key);\n if (ret == null) return new ArrayList<Class<? extends Enum<?>>>(0);\n return ret;\n }", "public abstract Enumeration keys();", "boolean ha...
[ "0.62608224", "0.5906526", "0.57013404", "0.5660624", "0.56466985", "0.552839", "0.54170305", "0.5393952", "0.5283994", "0.52812386", "0.52727544", "0.5244354", "0.52199775", "0.521801", "0.519526", "0.5194295", "0.5153697", "0.5153515", "0.5141852", "0.51363105", "0.51330256...
0.63088477
0
updates cache based on request from ansible
public void updateClusterDetails(UpdateClusterRequest callbackRequest) throws JsonProcessingException, IOException { ObjectMapper mapper = new ObjectMapper(); String callbackRequestStr = mapper.writeValueAsString(callbackRequest); logger.info("Update Request: " + callbackRequestStr); ArrayList<String> masterNodes = new ArrayList<String>(); ArrayList<String> workderNodes = new ArrayList<String>(); // set cluster id and inventory path. ClusterEnv clusterEnv = new ClusterEnv(callbackRequest.getClusterID()); clusterEnv.setInventoryPath(getInventoryPath(callbackRequest.getClusterID())); // if provision details are present set it. If request is posted after // provisioning K8SCluster cluster = clusterRepository.findById(callbackRequest.getClusterID()); if (cluster == null) { logger.info("Cluster could not be found in Database... "); throw new ClusterException("Cluster could not be found in database.."); } if (callbackRequest.getProvisionDetails() != null) { for (ProvisionDetails provDetails : callbackRequest.getProvisionDetails()) { if (provDetails.getNodeType().toUpperCase().equals("MASTER") && masterNodes.size() <= 1) { masterNodes.add(provDetails.getPublicIP()); } if (provDetails.getNodeType().toUpperCase().equals("WORKER")) { workderNodes.add(provDetails.getPublicIP()); } } String[] kubeMasterIps = new String[masterNodes.size()]; String[] kubeNodeIps = new String[workderNodes.size()]; masterNodes.toArray(kubeMasterIps); workderNodes.toArray(kubeNodeIps); clusterEnv.setKubeMasterIps(kubeMasterIps); clusterEnv.setKubeNodeIps(kubeNodeIps); clusterEnv.setClusterseqid(cluster.getId()); clusterRepository.saveClusterEnv(clusterEnv); cluster.setCreateStatus(ClusterStatusEnum.PROV_COMPLETED.getKeyValue()); clusterRepository.updateClusterStatus(cluster); } // if request is posted after create cluster if (callbackRequest.getCreateClusterDetails() != null) { // clusterDetails = (ClusterEnv) redisRepo.findById(clusterRequest.getClusterID(), // CacheKeysEnum.CLUSTER_DETAILS); clusterEnv.setApiServerUrl(callbackRequest.getCreateClusterDetails().getKubeApiServerUrl()); // clusterEnv.setK8sAdminToken(clusterRequest.getCreateClusterDetails().getK8sAdminToken()); clusterEnv.setK8sDashboardUrl(callbackRequest.getCreateClusterDetails().getK8sDashboadUrl()); // clusterEnv.setDashboardToken(clusterRequest.getCreateClusterDetails().getDashboardToken()); clusterEnv.setClusterseqid(cluster.getId()); // If provisioning completed, that means, Azure Native flow. Already record // present in clusterenv - hence update if (cluster.getCreateStatus().equalsIgnoreCase(ClusterStatusEnum.PROV_COMPLETED.getKeyValue())) { clusterRepository.updateClusterEnv(clusterEnv); } else { clusterRepository.saveClusterEnv(clusterEnv); } // SAVE Tokens to Vault saveTokensToVault(callbackRequest); cluster.setCreateStatus(ClusterStatusEnum.READY.getKeyValue()); clusterRepository.updateClusterStatus(cluster); if (callbackRequest.getCreateClusterDetails().getKubeConfig() != null) { logger.info("Kube Cofig from callback request::" + callbackRequest.getCreateClusterDetails().getKubeConfig().asText()); } else { logger.info("Kube Cofig from callback request is null::"); } } if (callbackRequest.getMonitoringDetails() != null) { // TODO - Save montiroting details in database logger.info("Monitoring details - Grafana URL- from callback request::" + callbackRequest.getMonitoringDetails().getGrafanaUrl()); } // redisRepo.save(clusterEnv, CacheKeysEnum.CLUSTER_DETAILS); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Override\n public void filter(ContainerRequestContext requestContext, ContainerResponseContext responseContext) throws IOException {\n if (requestContext.getProperty(CACHE_USED) == null && responseContext.getEntity() instanceof Result) {\n Result result = (Result) responseContext.getEntity();...
[ "0.61043066", "0.6091498", "0.5932054", "0.57309663", "0.560443", "0.55136204", "0.5432911", "0.5432196", "0.54285544", "0.5426217", "0.53904855", "0.53726494", "0.5366742", "0.5363425", "0.53617716", "0.5359364", "0.5341002", "0.53263235", "0.5294718", "0.52860886", "0.52843...
0.0
-1
Save API token to vault
private void saveTokensToVault(UpdateClusterRequest callbackRequest) { VaultRequest vaultRequest = new VaultRequest(); vaultRequest.setClusterReqId(callbackRequest.getClusterID()); vaultRequest.setApiServerToken(callbackRequest.getCreateClusterDetails().getK8sAdminToken()); vaultRequest.setDashboardToken(callbackRequest.getCreateClusterDetails().getDashboardToken()); vaultService.saveCredential(vaultRequest, VaultEntityTypes.API_TOKEN.getKeyValue()); vaultService.saveCredential(vaultRequest, VaultEntityTypes.DASHBOARD_TOKEN.getKeyValue()); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void storeToken(AuthorizationToken token);", "public static void storeToken(AccessToken token, Context cont)\n\t{\n\t\tSharedPreferences.Editor editor = cont.getSharedPreferences(\"StatPump\", 0).edit();\n\t\teditor.putString(\"Token\", token.getToken());\n\t\teditor.putString(\"Token Secret\", token.getT...
[ "0.65215683", "0.6319164", "0.5886629", "0.5872082", "0.5867804", "0.57697326", "0.56588316", "0.5589805", "0.5564185", "0.5451508", "0.54453045", "0.542651", "0.5391776", "0.5351408", "0.5328949", "0.5262604", "0.5253287", "0.5128272", "0.51042396", "0.50915265", "0.5077912"...
0.67182124
0
Invokes provision playbook followed by create cluster
private void createClusterAsyncAzureNative(ProvisionRequest provisionRequest, String processID) throws ClusterException { try { // K8SCluster cluster = new K8SCluster(processID, "Started"); // redisRepo.save(cluster, CacheKeysEnum.CLUSTER_STATUS); Process process = startProvisionTask(provisionRequest); K8SCluster cluster = saveAndGetProvisionStatus(processID, process, ClusterStatusEnum.PROV_COMPLETED.getKeyValue()); Thread.sleep(10000); if (cluster.getCreateStatus().equals(ClusterStatusEnum.PROV_COMPLETED.getKeyValue())) { // to create cluster fields from provision request (kubeDashboard value) is also // required. createClusterForAzureNative(provisionRequest, processID); } else { // Retry once } logger.info("Inside Async process"); } catch (Exception ex) { logger.error("Exception Occurred...", ex); throw new ClusterException("Exception occurred in createClusterAsyncAzure..", ex); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private Process startCreateClusterTaskForAks(ProvisionRequest provisionRequest) throws ClusterException {\n\t\tProcess process = null;\n\n\t\ttry {\n\t\t\tObjectMapper mapper = new ObjectMapper();\n\t\t\tString clusterRequestStr = mapper.writeValueAsString(provisionRequest);\n\t\t\tString provisionRequestStrWithQt...
[ "0.6303186", "0.6113944", "0.6049821", "0.59337205", "0.55924237", "0.54957086", "0.54912317", "0.5349267", "0.53109026", "0.5261015", "0.52208865", "0.52157414", "0.51910627", "0.5124748", "0.51134926", "0.5104672", "0.5093322", "0.5006876", "0.50059044", "0.5003984", "0.499...
0.5758807
4
Invoke playbook and Create AKS cluster
private void createClusterForAks(ProvisionRequest provisionRequest, String processID) { if ("Y".equals(provisionRequest.getMonitoringEnabled())) { provisionRequest.setKubeMonitoring("Grafana"); } startCreateClusterTaskForAks(provisionRequest); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Test\n\tpublic void createCluster() throws KeeperException, InterruptedException {\n\n\t\tclusterManager.createCluster(clusterResourceName);\n\n\t}", "private Process startCreateClusterTaskForAks(ProvisionRequest provisionRequest) throws ClusterException {\n\t\tProcess process = null;\n\n\t\ttry {\n\t\t\tObject...
[ "0.646643", "0.61076933", "0.6090284", "0.59042436", "0.5330118", "0.52665925", "0.51417863", "0.51051706", "0.5074303", "0.50631285", "0.50487846", "0.50238055", "0.49120572", "0.48937413", "0.48868686", "0.48745173", "0.48737848", "0.48369938", "0.4835597", "0.48304325", "0...
0.57636285
4
Read IP from file CreateClusterRequest clusterRequest = readFileAndGetIPs(); Read IP from Cache disabling as IPs need not be passed for azure. (replaced by inventory) CreateClusterRequest clusterRequest = buildClusterRequestWithIPs(processID);
private CreateClusterRequest createClusterForAzureNative(ProvisionRequest provisionRequest, String processID) { CreateClusterRequest clusterRequest = new CreateClusterRequest(); // Populate other fields clusterRequest.setClusterID(processID); clusterRequest.setKubeDashboard(provisionRequest.getKubeDashboard()); clusterRequest.setCloudSrvc(provisionRequest.getCloudSrvc()); // set cluster after replacing - with _ clusterRequest.setClusterName(provisionRequest.getClusterName().replace('-', '_')); logger.info("provisionRequest.getMonitoringEnabled()::" + provisionRequest.getMonitoringEnabled()); if ("Y".equals(provisionRequest.getMonitoringEnabled())) { clusterRequest.setKubeMonitoring("Grafana"); logger.info("setKubeMonitoring::Grafana"); } // Populate other constant params populateCreateClusterRequest(clusterRequest); startCreateClusterTaskAzure(clusterRequest); return clusterRequest; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private void readFile(File filename) throws IOException {\n\t\tFileInputStream fis = new FileInputStream(filename);\n\t\tInputStreamReader isr = new InputStreamReader(fis, \"UTF-8\");\n\t\tBufferedReader br = new BufferedReader(isr);\n\t\tSimpleFieldSet fs = new SimpleFieldSet(br, false, true);\n\t\tbr.close();\n\...
[ "0.55334955", "0.53275955", "0.51480687", "0.5119401", "0.511571", "0.49982673", "0.49464402", "0.4932239", "0.48820713", "0.4875787", "0.48366827", "0.48348117", "0.4807064", "0.48031867", "0.47899687", "0.4787326", "0.4782522", "0.47448385", "0.46979687", "0.46851", "0.4674...
0.5196459
2
Create cluster command structure is different for Azure and AKS this method is for Azure
private Process startCreateClusterTaskAzure(CreateClusterRequest clusterRequest) throws ClusterException { Process process = null; try { ObjectMapper mapper = new ObjectMapper(); String clusterRequestStr = mapper.writeValueAsString(clusterRequest); String provisionRequestStrWithQt = "'" + clusterRequestStr + "'"; ProcessBuilder builder = new ProcessBuilder(new String[0]); String command = "ansible-playbook -i " + "\"" + getInventoryPath(clusterRequest.getClusterID()) + "\" " + appConfig .getConfigValue("createClusterPlayBook" + getPropertySuffix(clusterRequest.getCloudSrvc())) + " --e " + provisionRequestStrWithQt; // Process p = Runtime.getRuntime().exec(ansible_run, null); logger.info("Create Cluster Command:: " + command); builder.command(new String[] { "sh", "-c", command }); logger.info("Config param for directory:" + "createClusterFolder" + getPropertySuffix(clusterRequest.getCloudSrvc())); String directory = appConfig .getConfigValue("createClusterFolder" + getPropertySuffix(clusterRequest.getCloudSrvc())); logger.info("Create cluster directory::" + directory); builder.directory(new File(directory)); process = builder.start(); logger.info("Running create azure cluster playbook ..."); StreamGobbler streamGobbler = new StreamGobbler(process.getInputStream(), System.out::println); Executors.newSingleThreadExecutor().submit(streamGobbler); } catch (Exception ex) { // ex.printStackTrace(); throw new ClusterException("Exception occurred in startCreateClusterTaskAzure", ex); } return process; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "CreateClusterResult createCluster(CreateClusterRequest createClusterRequest);", "@Test\n\tpublic void createCluster() throws KeeperException, InterruptedException {\n\n\t\tclusterManager.createCluster(clusterResourceName);\n\n\t}", "private CreateClusterRequest createClusterForAzureNative(ProvisionRequest prov...
[ "0.76954734", "0.7191008", "0.69068277", "0.68712693", "0.6788854", "0.6762635", "0.67322856", "0.65705234", "0.64173913", "0.63063985", "0.62882245", "0.62283874", "0.61707973", "0.6149781", "0.606707", "0.60566217", "0.6006399", "0.5998957", "0.5969771", "0.5903784", "0.573...
0.63897634
9
Create cluster command structure is different for Azure and AKS
private Process startCreateClusterTaskForAks(ProvisionRequest provisionRequest) throws ClusterException { Process process = null; try { ObjectMapper mapper = new ObjectMapper(); String clusterRequestStr = mapper.writeValueAsString(provisionRequest); String provisionRequestStrWithQt = "'" + clusterRequestStr + "'"; ProcessBuilder builder = new ProcessBuilder(new String[0]); String command = "ansible-playbook " + appConfig.getConfigValue( "createClusterPlayBook" + getPropertySuffix(provisionRequest.getCloudSrvc())) + " --e " + provisionRequestStrWithQt; // Process p = Runtime.getRuntime().exec(ansible_run, null); logger.info("Create Cluster Command:: " + command); builder.command(new String[] { "sh", "-c", command }); String directory = appConfig .getConfigValue("createClusterFolder" + getPropertySuffix(provisionRequest.getCloudSrvc())); builder.directory(new File(directory)); process = builder.start(); logger.info("Running create aks playbook ..."); StreamGobbler streamGobbler = new StreamGobbler(process.getInputStream(), System.out::println); Executors.newSingleThreadExecutor().submit(streamGobbler); } catch (Exception ex) { // ex.printStackTrace(); throw new ClusterException("Exception occurred in startCreateClusterTaskForAks...", ex); } return process; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "CreateClusterResult createCluster(CreateClusterRequest createClusterRequest);", "@Test\n\tpublic void createCluster() throws KeeperException, InterruptedException {\n\n\t\tclusterManager.createCluster(clusterResourceName);\n\n\t}", "private CreateClusterRequest createClusterForAzureNative(ProvisionRequest prov...
[ "0.7459931", "0.7029379", "0.6686843", "0.66780263", "0.6622976", "0.65842104", "0.65315104", "0.63852733", "0.634054", "0.6250504", "0.6017553", "0.59980327", "0.5941573", "0.5847473", "0.58246535", "0.5808297", "0.57972383", "0.5773711", "0.57218", "0.5689991", "0.5651985",...
0.58828264
13
created by dduru on 26/09/2018
@Repository public interface StateRepository extends JpaRepository<State, Long> { Optional<State> findByName(String name); Optional<State> findByNameContaining(String name); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Override\n public void func_104112_b() {\n \n }", "public final void mo51373a() {\n }", "@Override\n public void perish() {\n \n }", "public void mo38117a() {\n }", "@Override\r\n\tpublic void tires() {\n\t\t\r\n\t}", "@Override\n\tprotected void getExras() {\n\n\...
[ "0.5638022", "0.55852723", "0.5583161", "0.5471768", "0.5429931", "0.5401798", "0.5392817", "0.5381514", "0.53715146", "0.5356211", "0.53315574", "0.53315574", "0.5329959", "0.5325976", "0.526626", "0.526626", "0.526626", "0.526626", "0.526626", "0.526626", "0.526626", "0.5...
0.0
-1
Generateur de cle RSA
public String[] keyGen(){ p1 = BigInteger.probablePrime(N / 2, random); p2 = BigInteger.probablePrime(N / 2, random); phi0 = (p1.subtract(one)).multiply(p2.subtract(one)); BigInteger modulus = p1.multiply(p2); BigInteger privateKey = setPrivateKey(modulus); BigInteger publicKey = privateKey.modInverse(phi0); /* Retourne un tableau de 3 chaine de caractere contenant dans cette ordre */ /* cle publique, modulus, cle prive */ String tab[] = {publicKey + "", modulus + "", privateKey + ""}; return tab; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "RSAKeygen(){\n Random rnd = new Random();\n p = BigInteger.probablePrime(bitlength, rnd);\n BigInteger eTmp = BigInteger.probablePrime(bitlength, rnd);\n\n while(p.equals(eTmp)){\n eTmp = BigInteger.probablePrime(bitlength,rnd);\n }\n\n q = eTmp;\n n = p....
[ "0.7560179", "0.7143197", "0.7062719", "0.69894546", "0.68554175", "0.6818818", "0.67810524", "0.6682186", "0.66546065", "0.6612754", "0.6588604", "0.64530474", "0.6441281", "0.6384353", "0.63754994", "0.63354903", "0.63136315", "0.6306024", "0.6236772", "0.6236638", "0.62184...
0.6706177
7
Generation de cles privee
private BigInteger setPrivateKey(BigInteger modulus){ BigInteger privateKey = null; do { privateKey = BigInteger.probablePrime(N / 2, random); } /* n'a aucun autre diviseur que 1 */ while (privateKey.gcd(phi0).intValue() != 1 || /* qu'il est plus grand que p1 et p2 */ privateKey.compareTo(modulus) != -1 || /* qu'il est plus petit que p1 * p2 */ privateKey.compareTo(p1.max(p2)) == -1); return privateKey; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void generate() {\n\t}", "protected abstract void generate();", "@Override\n public String generaCodigo() {\n return \"\";\n }", "public Generateur() {\n }", "public static void generateCode()\n {\n \n }", "public void generarCodigo(){\r\n this.setCodigo(\"c\"+t...
[ "0.6484577", "0.6449677", "0.6429502", "0.6260175", "0.62341714", "0.62286335", "0.62144035", "0.60375977", "0.6032117", "0.5948039", "0.5938105", "0.5931619", "0.5918453", "0.58992696", "0.5893407", "0.5869554", "0.586568", "0.58631784", "0.5842603", "0.5840476", "0.5807298"...
0.0
-1
Chiffre une phrase complete caractere par caractere
public String encrypt(String message, String publicKey, String modulus){ char a; BigInteger b; String c = ""; for(int i = 0; i < message.length(); i++){ a = message.charAt(i); b = new BigInteger("" + (int)a); c += "" + encrypt(b, new BigInteger(publicKey), new BigInteger(modulus)) + (char)29; } return c; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void reagir(String frase) {\n if (frase.equals(\"toma comida\") || frase.equals(\"olá\")) {\n System.out.println(\"abanar e latir\");\n } else {\n System.out.println(\"rosnar\");\n }\n }", "public static void main(String arg[]) {\n String frase1 = \"Ha...
[ "0.64361817", "0.59564024", "0.58805484", "0.5596933", "0.55140996", "0.5489735", "0.5448024", "0.536752", "0.5353045", "0.532371", "0.5290184", "0.5283836", "0.52837396", "0.5276189", "0.52539456", "0.5239388", "0.5236741", "0.5224229", "0.5216409", "0.51682466", "0.51316106...
0.0
-1
Decrypte un caractere avec les clees prive
private BigInteger decrypt(BigInteger encrypted, BigInteger privateKey, BigInteger modulus){ return encrypted.modPow(privateKey, modulus); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public String Decrypt(String s);", "public String decrypt(String key);", "public String decrypt(String cipherText);", "String decryptString(String toDecrypt) throws NoUserSelectedException, IllegalValueException;", "@Override\n public void decrypt() {\n algo.decrypt();\n String cypher = v...
[ "0.7738073", "0.7182781", "0.7106706", "0.69775975", "0.6971861", "0.6919723", "0.69173944", "0.6909454", "0.6834011", "0.67769825", "0.67685187", "0.67268986", "0.667127", "0.66684186", "0.66515684", "0.6648816", "0.6628267", "0.66055274", "0.6603399", "0.65755075", "0.65590...
0.0
-1
Dechiffre une phrase complete caractere par caractere
public String decrypt(String p, String pv, String md){ char a; BigInteger b; String c = "", d = ""; for(int i = 0; i < p.length(); i++){ if((int)p.charAt(i) != 29) c += p.charAt(i); else{ b = new BigInteger(c); a = (char)decrypt(b, new BigInteger(pv), new BigInteger(md)).intValue(); d += a; c = ""; } } return d; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void reagir(String frase) {\n if (frase.equals(\"toma comida\") || frase.equals(\"olá\")) {\n System.out.println(\"abanar e latir\");\n } else {\n System.out.println(\"rosnar\");\n }\n }", "public void reagir(String frase) {\n\t\tif (frase.equals(\"toma comid...
[ "0.6203893", "0.5764212", "0.5746987", "0.56893903", "0.5586131", "0.557351", "0.5490504", "0.54545295", "0.53648114", "0.53584015", "0.53529614", "0.53379077", "0.5287768", "0.5262882", "0.5241785", "0.52150345", "0.5173905", "0.5158161", "0.5150458", "0.513219", "0.51149267...
0.0
-1
Metodo che restituisce il numero degli alunni da un file
public static int ottieniNumeroRighe(File fileDaLeggere){ //Creo e inizializzo la variabile che contiene il numero degli alunni int numeroAlunni = 0; try { //Inizializzo i controlli FileInputStream lettoreIniziale = new FileInputStream(fileDaLeggere); BufferedReader lettoreFinale = new BufferedReader(new InputStreamReader(lettoreIniziale)); //Creo e inizializzo la variabile che controlla se la linea è piena o vuota String lineaPienaVuota; while(true){ lineaPienaVuota = lettoreFinale.readLine(); if (lineaPienaVuota != null){ numeroAlunni++; } else{ lettoreFinale.close(); break; } } } catch (IOException Errore) { JOptionPane.showMessageDialog(null, "Impossibile interagire con il file " + fileDaLeggere + ". Errore: \n" + Errore); } return numeroAlunni; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public static int getFileNum(File f)\r\n\t{\r\n\t\tString fileStr = f.toString().substring(2);\r\n\t\t\r\n\t\tint num = Integer.parseInt(fileStr.substring(13, fileStr.length()-5));\r\n\t\treturn num;\r\n\t}", "public int idNum(String fullFilePath){\n\n int lines = 0;\n\n try {\n Buffered...
[ "0.70844513", "0.70663995", "0.7044223", "0.70283055", "0.69995356", "0.6422472", "0.6364414", "0.6350384", "0.6321203", "0.63110316", "0.6305379", "0.62477386", "0.6160922", "0.6156703", "0.6141857", "0.6141857", "0.61413956", "0.6099902", "0.6097686", "0.60429096", "0.60401...
0.6747223
5
Metodo che aggiunge elementi alla list per ogni riga del file
public static void aggiungiAlunni(List<String> listaNomi, File fileDaLeggere, BasicTextEncryptor ekrittik){ try { //Inizializzo i controlli FileInputStream lettoreIniziale = new FileInputStream(fileDaLeggere); BufferedReader lettoreFinale = new BufferedReader(new InputStreamReader(lettoreIniziale)); while(true){ String nomeAlunno = lettoreFinale.readLine(); if (nomeAlunno != null){ listaNomi.add(ekrittik.decrypt(nomeAlunno)); } else{ lettoreFinale.close(); break; } } } catch (IOException Errore) { JOptionPane.showMessageDialog(null, "Impossibile interagire con il file " + fileDaLeggere + ". Errore: \n" + Errore); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Override\r\n public void remove() {\n ArrayList<String>Lines=new ArrayList<>();\r\n String Path = \"/home/yara/Documents/4year/OODP/Task.txt\";\r\n \r\n String RID=id.getText();\r\n String Taskname = name.getText();\r\n String startDate = date_start.getText();...
[ "0.65464574", "0.65098345", "0.6351513", "0.6351304", "0.63276696", "0.6314919", "0.6249388", "0.6204501", "0.6200247", "0.6185403", "0.6180297", "0.61499447", "0.6143821", "0.61347973", "0.6048262", "0.6014513", "0.5964117", "0.5896817", "0.58904696", "0.5870395", "0.5868296...
0.6049476
14
... Initialize Firebase Auth
@Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); binding = ActivitySignupBinding.inflate(getLayoutInflater()); setContentView(binding.getRoot()); mRegisterBtn= findViewById(R.id.signup); mEmail = findViewById(R.id.username); mPassword = findViewById(R.id.password); getSupportActionBar().hide(); mAuth = FirebaseAuth.getInstance(); database = FirebaseDatabase.getInstance(); progressDialog = new ProgressDialog(SignupActivity.this); progressDialog.setTitle("creating your account"); progressDialog.setMessage("We're creating your account"); mRegisterBtn.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { final String email = binding.username.getText().toString().trim(); String password = binding.password.getText().toString().trim(); String confirm_password = binding.confirmPassword.getText().toString().trim(); if (TextUtils.isEmpty(email)) { mEmail.setError("Email is Required."); return; } if (TextUtils.isEmpty(password)) { mPassword.setError("Password is Required."); return; } if (password.length() < 6) { mPassword.setError("Password Must be greater than 6 Characters"); return; } if (TextUtils.isEmpty(confirm_password)) { mPassword.setError("Confirm Password"); return; } if(password.equals(confirm_password)) { progressDialog.show(); mAuth.createUserWithEmailAndPassword(email, password) .addOnCompleteListener(task -> { progressDialog.dismiss(); if (task.isSuccessful()) { Users user = new Users(email, password); String id = task.getResult().getUser().getUid(); database.getReference("Users").child(id).setValue(user); Toast.makeText(SignupActivity.this, "user created", Toast.LENGTH_LONG).show(); } else { Toast.makeText(SignupActivity.this, task.getException().getMessage(), Toast.LENGTH_LONG).show(); } }); } } }); binding.login.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { Intent i = new Intent(SignupActivity.this,LoginActivity.class); startActivity(i); finish(); } }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private void setupFirebaseAuth() {\n Log.d(TAG, \"setupFirebaseAuth: setting up firebase auth.\");\n mAuth = FirebaseAuth.getInstance();\n mAuthListener = new FirebaseAuth.AuthStateListener() {\n @Override\n public void onAuthStateChanged(@NonNull FirebaseAuth firebaseAut...
[ "0.78499913", "0.7836418", "0.7767383", "0.7649103", "0.758813", "0.7556087", "0.7349044", "0.7242472", "0.71986413", "0.71980864", "0.7159526", "0.71383953", "0.6917937", "0.6882292", "0.68308437", "0.6789008", "0.6776534", "0.6748983", "0.66412127", "0.66227865", "0.6619624...
0.0
-1
TODO Autogenerated method stub
public T getValue() { return value; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Override\r\n\tpublic void comer() \r\n\t{\n\t\t\r\n\t}", "@Override\n\tpublic void comer() {\n\t\t\n\t}", "@Override\n public void perish() {\n \n }", "@Override\r\n\t\t\tpublic void annadir() {\n\r\n\t\t\t}", "@Override\n\tpublic void anular() {\n\n\t}", "@Override\n\tprotected void getExr...
[ "0.6671074", "0.6567672", "0.6523024", "0.6481211", "0.6477082", "0.64591026", "0.64127725", "0.63762105", "0.6276059", "0.6254286", "0.623686", "0.6223679", "0.6201336", "0.61950207", "0.61950207", "0.61922914", "0.6186996", "0.6173591", "0.61327106", "0.61285484", "0.608016...
0.0
-1
TODO Autogenerated method stub
@Override public void check() throws ApiRuleException { }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Override\r\n\tpublic void comer() \r\n\t{\n\t\t\r\n\t}", "@Override\n\tpublic void comer() {\n\t\t\n\t}", "@Override\n public void perish() {\n \n }", "@Override\r\n\t\t\tpublic void annadir() {\n\r\n\t\t\t}", "@Override\n\tpublic void anular() {\n\n\t}", "@Override\n\tprotected void getExr...
[ "0.6671074", "0.6567672", "0.6523024", "0.6481211", "0.6477082", "0.64591026", "0.64127725", "0.63762105", "0.6276059", "0.6254286", "0.623686", "0.6223679", "0.6201336", "0.61950207", "0.61950207", "0.61922914", "0.6186996", "0.6173591", "0.61327106", "0.61285484", "0.608016...
0.0
-1
TODO Autogenerated method stub
@Override public String getApiMethodName() { return null; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Override\r\n\tpublic void comer() \r\n\t{\n\t\t\r\n\t}", "@Override\n\tpublic void comer() {\n\t\t\n\t}", "@Override\n public void perish() {\n \n }", "@Override\r\n\t\t\tpublic void annadir() {\n\r\n\t\t\t}", "@Override\n\tpublic void anular() {\n\n\t}", "@Override\n\tprotected void getExr...
[ "0.6671074", "0.6567672", "0.6523024", "0.6481211", "0.6477082", "0.64591026", "0.64127725", "0.63762105", "0.6276059", "0.6254286", "0.623686", "0.6223679", "0.6201336", "0.61950207", "0.61950207", "0.61922914", "0.6186996", "0.6173591", "0.61327106", "0.61285484", "0.608016...
0.0
-1
Interface for the MatrixMultiplicator Component.
public interface IMatrixMultiplicator { /** * Multiplies two matrixes and returns the result in a new matrix * * @param matrixA first matrix * @param matrixB second matrix * @return result of the multiplication */ public long multiplyMatrix(final Matrix matrixA, final Matrix matrixB, final Matrix res); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public interface IMatrix {\n\n /**\n * Set coefficient\n * @param y row (0..height-1)\n * @param x column (0..width-1)\n * @param v value\n */\n public void set(int y, int x, double v);\n /**\n * Get coefficient from matrix, by returning coeff[y*width + x].\n * @param y row (0..height-1)\n * @pa...
[ "0.6128349", "0.60526466", "0.6017523", "0.5872967", "0.5776593", "0.57399374", "0.57043505", "0.5657673", "0.556408", "0.5540668", "0.5533117", "0.5526284", "0.5512023", "0.5498189", "0.5464114", "0.5429971", "0.5358993", "0.5354682", "0.5351928", "0.5313288", "0.5313243", ...
0.7701014
0
Multiplies two matrixes and returns the result in a new matrix
public long multiplyMatrix(final Matrix matrixA, final Matrix matrixB, final Matrix res);
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public static Matrix multiply(Matrix first, Matrix second) {\n \n Matrix result = new Matrix(first.getRows(), first.getClumns());\n \n for (int row = 0; row < first.getRows(); row++) {\n for (int col = 0; col < first.getClumns(); col++) {\n result.matrix[row][c...
[ "0.77890205", "0.7500587", "0.7454777", "0.7447289", "0.7378319", "0.7291569", "0.7285535", "0.72698116", "0.7244799", "0.7212367", "0.7169227", "0.7134624", "0.7118809", "0.7058964", "0.7047968", "0.7036611", "0.70020866", "0.70020175", "0.69796306", "0.6944863", "0.69391423...
0.74046063
4
TODO Autogenerated method stub
@Override public void onActionCallback(boolean result, Object object) { if (result) { msgList = (List<XmppMessage>) object; RefreshAdapter(); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Override\r\n\tpublic void comer() \r\n\t{\n\t\t\r\n\t}", "@Override\n\tpublic void comer() {\n\t\t\n\t}", "@Override\n public void perish() {\n \n }", "@Override\r\n\t\t\tpublic void annadir() {\n\r\n\t\t\t}", "@Override\n\tpublic void anular() {\n\n\t}", "@Override\n\tprotected void getExr...
[ "0.6671074", "0.6567672", "0.6523024", "0.6481211", "0.6477082", "0.64591026", "0.64127725", "0.63762105", "0.6276059", "0.6254286", "0.623686", "0.6223679", "0.6201336", "0.61950207", "0.61950207", "0.61922914", "0.6186996", "0.6173591", "0.61327106", "0.61285484", "0.608016...
0.0
-1
TODO Autogenerated method stub
@Override public void onStart() { super.onStart(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Override\r\n\tpublic void comer() \r\n\t{\n\t\t\r\n\t}", "@Override\n\tpublic void comer() {\n\t\t\n\t}", "@Override\n public void perish() {\n \n }", "@Override\r\n\t\t\tpublic void annadir() {\n\r\n\t\t\t}", "@Override\n\tpublic void anular() {\n\n\t}", "@Override\n\tprotected void getExr...
[ "0.6671074", "0.6567672", "0.6523024", "0.6481211", "0.6477082", "0.64591026", "0.64127725", "0.63762105", "0.6276059", "0.6254286", "0.623686", "0.6223679", "0.6201336", "0.61950207", "0.61950207", "0.61922914", "0.6186996", "0.6173591", "0.61327106", "0.61285484", "0.608016...
0.0
-1
TODO Autogenerated method stub
@Override public void onUpdate() { super.onUpdate(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Override\r\n\tpublic void comer() \r\n\t{\n\t\t\r\n\t}", "@Override\n\tpublic void comer() {\n\t\t\n\t}", "@Override\n public void perish() {\n \n }", "@Override\r\n\t\t\tpublic void annadir() {\n\r\n\t\t\t}", "@Override\n\tpublic void anular() {\n\n\t}", "@Override\n\tprotected void getExr...
[ "0.6671074", "0.6567672", "0.6523024", "0.6481211", "0.6477082", "0.64591026", "0.64127725", "0.63762105", "0.6276059", "0.6254286", "0.623686", "0.6223679", "0.6201336", "0.61950207", "0.61950207", "0.61922914", "0.6186996", "0.6173591", "0.61327106", "0.61285484", "0.608016...
0.0
-1
Pointbypoint Gaussian filter application
public void applyFilterAtPoint(int x, int y, BufferedImage imgIn, BufferedImage imgOut) { double dltX = 0; double dltY = 0; for(int i_x = -getMargin(); i_x <= getMargin(); i_x++) { for(int i_y = -getMargin(); i_y <= getMargin(); i_y++) { int rgb = imgIn.getRGB(x + i_x, y + i_y); int blue = (rgb) & 0x000000FF; double V_ = blue * Math.exp(-0.25 * (Math.pow(i_x, 2) + Math.pow(i_y, 2))); dltX += Integer.signum(i_x) * V_; dltY += Integer.signum(i_y) * V_; } } double N_ = Math.sqrt(Math.pow(dltX, 2) + Math.pow(dltY, 2)); double V_ = 255.0 - 0.5 * N_; int V_grey = (int) Math.round(Math.max(0.0d, V_)); imgOut.setRGB(x - this.getMargin() , y - this.getMargin(), new Color(V_grey, V_grey, V_grey).getRGB()); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private static void gaussianSmooth(double[] img, int width, int height, double sigma) {\n\t\tint radius = (int)Math.sqrt((6.908)*(2*sigma*sigma));\n\t\t// compute coefficients of the gaussian filter\n\t\tdouble[] filter = new double[2*radius+1];\n\t\tdouble filtersum = 0;\n\n\t\tfor(int i=-radius;i<=radius;i++) {\...
[ "0.63382727", "0.6230982", "0.61350286", "0.6015929", "0.59254706", "0.5796465", "0.5666851", "0.5620814", "0.55068654", "0.549492", "0.5480227", "0.5453791", "0.54337656", "0.53027356", "0.5297538", "0.52581155", "0.52315944", "0.5227258", "0.51564145", "0.51554805", "0.5152...
0.5942078
4
called when user has put in all of the input successfully.
public void newRound(){ clearRandomDirections(); this.currentAmountToPutIn++; initializeNewRound(); //reset timer; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private void checkUserInput() {\n }", "private void takeInUserInput(){\n\t\t// only take in input when it is in the ANSWERING phase\n\t\tif(spellList.status == QuizState.Answering){\n\t\t\tspellList.setAnswer(getAndClrInput());\n\t\t\tspellList.status = QuizState.Answered;\n\t\t\tansChecker=spellList.getAnswe...
[ "0.6824957", "0.6409321", "0.631002", "0.62492704", "0.6189683", "0.6189683", "0.61003", "0.6018371", "0.600304", "0.59176403", "0.5915002", "0.5888544", "0.5877879", "0.58631134", "0.5840691", "0.57922745", "0.5766833", "0.5731702", "0.5703262", "0.5681225", "0.5666084", "...
0.0
-1
Test of createTimer method, of class FleaseStage.
public void testOpenAndGetLease() throws Exception { final ASCIIString CELL_ID = new ASCIIString("testcell"); final AtomicReference<Flease> result = new AtomicReference(); FleaseStage fs = new FleaseStage(cfg, "/tmp/xtreemfs-test/", new FleaseMessageSenderInterface() { @Override public void sendMessage(FleaseMessage message, InetSocketAddress recipient) { //ignore me } }, true, new FleaseViewChangeListenerInterface() { @Override public void viewIdChangeEvent(ASCIIString cellId, int viewId) { } },new FleaseStatusListener() { @Override public void statusChanged(ASCIIString cellId, Flease lease) { // System.out.println("state change: "+cellId+" owner="+lease.getLeaseHolder()); synchronized (result) { result.set(new Flease(cellId, lease.getLeaseHolder(), lease.getLeaseTimeout_ms(),lease.getMasterEpochNumber())); result.notify(); } } @Override public void leaseFailed(ASCIIString cellId, FleaseException error) { MasterEpochTest.fail(error.toString()); } }, new MasterEpochHandlerInterface() { long masterEpochNum = 0; @Override public void sendMasterEpoch(FleaseMessage response, Continuation callback) { // System.out.println("sending: "+masterEpochNum); response.setMasterEpochNumber(masterEpochNum); callback.processingFinished(); } @Override public void storeMasterEpoch(FleaseMessage request, Continuation callback) { masterEpochNum = request.getMasterEpochNumber(); // System.out.println("storing: "+masterEpochNum); callback.processingFinished(); } }); FleaseMessage msg = new FleaseMessage(FleaseMessage.MsgType.EVENT_RESTART); msg.setCellId(CELL_ID); fs.startAndWait(); fs.openCell(CELL_ID, new ArrayList(),true); synchronized(result) { if (result.get() == null) result.wait(1000); if (result.get() == null) fail("timeout!"); } assertEquals(result.get().getLeaseHolder(),cfg.getIdentity()); assertEquals(result.get().getMasterEpochNumber(),1); FleaseFuture f = fs.closeCell(CELL_ID, false); f.get(); Thread.sleep(12000); result.set(null); fs.openCell(CELL_ID, new ArrayList(), true); synchronized(result) { if (result.get() == null) result.wait(1000); if (result.get() == null) fail("timeout!"); } assertEquals(result.get().getLeaseHolder(),cfg.getIdentity()); assertEquals(result.get().getMasterEpochNumber(),2); fs.stopAndWait(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "TimerType createTimerType();", "public void createTimer() {\n timer = new AnimationTimer() {\n @Override\n public void handle(long now) {\n if (animal.changeScore()) {\n setNumber(animal.getPoints());\n }\n if (animal.ge...
[ "0.6770262", "0.6528391", "0.6462217", "0.640483", "0.6399101", "0.6357699", "0.6265556", "0.61719257", "0.61485714", "0.60154593", "0.60149175", "0.5958902", "0.59085643", "0.589372", "0.5877599", "0.58649987", "0.586431", "0.58430594", "0.5836607", "0.58335733", "0.58303225...
0.0
-1
System.out.println("state change: "+cellId+" owner="+lease.getLeaseHolder());
@Override public void statusChanged(ASCIIString cellId, Flease lease) { synchronized (result) { result.set(new Flease(cellId, lease.getLeaseHolder(), lease.getLeaseTimeout_ms(),lease.getMasterEpochNumber())); result.notify(); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "long getStateChange();", "public void testOpenAndGetLease() throws Exception {\n final ASCIIString CELL_ID = new ASCIIString(\"testcell\");\n\n final AtomicReference<Flease> result = new AtomicReference();\n\n FleaseStage fs = new FleaseStage(cfg, \"/tmp/xtreemfs-test/\", new FleaseMessageSe...
[ "0.59451824", "0.5618135", "0.5451526", "0.5433061", "0.5431796", "0.54150623", "0.53984064", "0.5367134", "0.52899486", "0.523861", "0.5230157", "0.5217632", "0.52032053", "0.51949805", "0.519186", "0.5189909", "0.5182019", "0.5176364", "0.5144113", "0.51081574", "0.51062155...
0.7013319
2
Test of createTimer method, of class FleaseStage.
public void testSimpleMasterEpochHandler() throws Exception { final ASCIIString CELL_ID = new ASCIIString("testcell"); final AtomicReference<Flease> result = new AtomicReference(); SimpleMasterEpochHandler meHandler = new SimpleMasterEpochHandler("/tmp/xtreemfs-test/"); Service.State svcState = meHandler.startAndWait(); if (svcState != Service.State.RUNNING) { LOG.error("Unable to start Master Epoch Handler", meHandler.failureCause()); } FleaseStage fs = new FleaseStage(cfg, "/tmp/xtreemfs-test/", new FleaseMessageSenderInterface() { @Override public void sendMessage(FleaseMessage message, InetSocketAddress recipient) { //ignore me } }, true, new FleaseViewChangeListenerInterface() { @Override public void viewIdChangeEvent(ASCIIString cellId, int viewId) { } },new FleaseStatusListener() { @Override public void statusChanged(ASCIIString cellId, Flease lease) { // System.out.println("state change: "+cellId+" owner="+lease.getLeaseHolder()); synchronized (result) { result.set(new Flease(cellId, lease.getLeaseHolder(), lease.getLeaseTimeout_ms(),lease.getMasterEpochNumber())); result.notify(); } } @Override public void leaseFailed(ASCIIString cellId, FleaseException error) { MasterEpochTest.fail(error.toString()); } }, meHandler); FleaseMessage msg = new FleaseMessage(FleaseMessage.MsgType.EVENT_RESTART); msg.setCellId(CELL_ID); fs.startAndWait(); fs.openCell(CELL_ID, new ArrayList(),true); synchronized(result) { if (result.get() == null) result.wait(1000); if (result.get() == null) fail("timeout!"); } assertEquals(result.get().getLeaseHolder(),cfg.getIdentity()); assertEquals(1, result.get().getMasterEpochNumber()); FleaseFuture f = fs.closeCell(CELL_ID, false); f.get(); fs.stopAndWait(); meHandler.stopAndWait(); Thread.sleep(12000); //restart meHandler = new SimpleMasterEpochHandler("/tmp/xtreemfs-test/"); if (meHandler.startAndWait() != Service.State.RUNNING) { LOG.error("Couldnt start meHandler", meHandler.failureCause()); } fs = new FleaseStage(cfg, "/tmp/xtreemfs-test/", new FleaseMessageSenderInterface() { @Override public void sendMessage(FleaseMessage message, InetSocketAddress recipient) { //ignore me } }, true, new FleaseViewChangeListenerInterface() { @Override public void viewIdChangeEvent(ASCIIString cellId, int viewId) { } },new FleaseStatusListener() { @Override public void statusChanged(ASCIIString cellId, Flease lease) { // System.out.println("state change: "+cellId+" owner="+lease.getLeaseHolder()); synchronized (result) { result.set(new Flease(cellId, lease.getLeaseHolder(), lease.getLeaseTimeout_ms(),lease.getMasterEpochNumber())); result.notify(); } } @Override public void leaseFailed(ASCIIString cellId, FleaseException error) { MasterEpochTest.fail(error.toString()); } }, meHandler); fs.startAndWait(); result.set(null); fs.openCell(CELL_ID, new ArrayList(), true); synchronized(result) { if (result.get() == null) result.wait(1000); if (result.get() == null) fail("timeout!"); } assertEquals(result.get().getLeaseHolder(),cfg.getIdentity()); assertEquals(result.get().getMasterEpochNumber(),2); fs.stopAndWait(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "TimerType createTimerType();", "public void createTimer() {\n timer = new AnimationTimer() {\n @Override\n public void handle(long now) {\n if (animal.changeScore()) {\n setNumber(animal.getPoints());\n }\n if (animal.ge...
[ "0.676967", "0.652761", "0.64619136", "0.6402427", "0.6397494", "0.63570243", "0.62658966", "0.6170769", "0.6147857", "0.60143554", "0.601388", "0.5958826", "0.5907815", "0.58907473", "0.58774704", "0.5864428", "0.586428", "0.58439445", "0.5836248", "0.58338976", "0.5829928",...
0.0
-1
System.out.println("state change: "+cellId+" owner="+lease.getLeaseHolder());
@Override public void statusChanged(ASCIIString cellId, Flease lease) { synchronized (result) { result.set(new Flease(cellId, lease.getLeaseHolder(), lease.getLeaseTimeout_ms(),lease.getMasterEpochNumber())); result.notify(); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "long getStateChange();", "public void testOpenAndGetLease() throws Exception {\n final ASCIIString CELL_ID = new ASCIIString(\"testcell\");\n\n final AtomicReference<Flease> result = new AtomicReference();\n\n FleaseStage fs = new FleaseStage(cfg, \"/tmp/xtreemfs-test/\", new FleaseMessageSe...
[ "0.59451824", "0.5618135", "0.5451526", "0.5433061", "0.5431796", "0.54150623", "0.53984064", "0.5367134", "0.52899486", "0.523861", "0.5230157", "0.5217632", "0.52032053", "0.51949805", "0.519186", "0.5189909", "0.5182019", "0.5176364", "0.5144113", "0.51081574", "0.51062155...
0.7013319
0
System.out.println("state change: "+cellId+" owner="+lease.getLeaseHolder());
@Override public void statusChanged(ASCIIString cellId, Flease lease) { synchronized (result) { result.set(new Flease(cellId, lease.getLeaseHolder(), lease.getLeaseTimeout_ms(),lease.getMasterEpochNumber())); result.notify(); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "long getStateChange();", "public void testOpenAndGetLease() throws Exception {\n final ASCIIString CELL_ID = new ASCIIString(\"testcell\");\n\n final AtomicReference<Flease> result = new AtomicReference();\n\n FleaseStage fs = new FleaseStage(cfg, \"/tmp/xtreemfs-test/\", new FleaseMessageSe...
[ "0.59451824", "0.5618135", "0.5451526", "0.5433061", "0.5431796", "0.54150623", "0.53984064", "0.5367134", "0.52899486", "0.523861", "0.5230157", "0.5217632", "0.52032053", "0.51949805", "0.519186", "0.5189909", "0.5182019", "0.5176364", "0.5144113", "0.51081574", "0.51062155...
0.7013319
1
Default constructor does nothing.
public LoansInfoPolitics() { super(new BorderLayout()); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@SuppressWarnings(\"unused\")\n public NoConstructor() {\n // Empty\n }", "defaultConstructor(){}", "void DefaultConstructor(){}", "private Default()\n {}", "ConstructorPractice () {\n\t\tSystem.out.println(\"Default Constructor\");\n\t}", "private Instantiation(){}", "p...
[ "0.84495765", "0.81525123", "0.81511194", "0.78258723", "0.75096065", "0.74775475", "0.7421495", "0.7364523", "0.7351661", "0.73146206", "0.72444093", "0.72125804", "0.71801627", "0.7152324", "0.7106019", "0.7097337", "0.70769495", "0.7058723", "0.7039895", "0.70390165", "0.7...
0.0
-1
Returns the Short Label
@Override public String getShortLabel() { return label; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "java.lang.String getLabel();", "public java.lang.String getLabel();", "String getLabel();", "String getLabel();", "public String getLabel();", "public String getLabel();", "public String getLabel();", "public String getLabel();", "public String getLabel() {\n return name().toLowerCase().repl...
[ "0.78969336", "0.7871197", "0.78600055", "0.78600055", "0.7724171", "0.7724171", "0.7724171", "0.7724171", "0.76259804", "0.76039714", "0.74660647", "0.7418911", "0.7411434", "0.74063694", "0.7404107", "0.74017346", "0.73835737", "0.7375636", "0.7375636", "0.7373839", "0.7361...
0.84020495
0
Creates a new instance of Loans Log called during simulation
@Override public void initialise(Simulation sim) { this.sim = sim; this.en = (Environment)sim.environment; this.add(new JScrollPane(new JList(data))); setBackground(Color.LIGHT_GRAY); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public MyLogs() {\n }", "@Override\n\tpublic CreditrepayplanLog getLogInstance() {\n\t\treturn new CreditrepayplanLog();\n\t}", "public LogX() {\n\n }", "public LogEntry generateLogEntry() {\n long time = getTime();\n int bloodGlucose = getBloodGlucose();\n double bolus = getBolus();\n ...
[ "0.63554406", "0.633445", "0.6159419", "0.6133346", "0.6083166", "0.6066735", "0.59849423", "0.59683836", "0.5942043", "0.58809924", "0.5842549", "0.5819151", "0.5807998", "0.5763665", "0.57351273", "0.5720036", "0.567826", "0.5670431", "0.5643496", "0.5605676", "0.5598119", ...
0.0
-1
Marks the beginning of a new cycle
@Override public void execute() { SortedSet<String> active_agent_ids = sim.getactiveParticipantIdSet("group"); Iterator<String> iter = active_agent_ids.iterator(); String name; updateLoanPlayers(active_agent_ids, iter); if (en.getRoundsPassed() == rounds) { data.add( " ==== Cycle " + sim.getTime() + " Begins (" + en.getRoundsPassed() + ':' + en.getCurrentTurnType() + ") ==== "); data.add( "************************************************************************************************************ "); for (Map.Entry<String, PoliticalGroup> entry : p_players.entrySet()) { while (iter.hasNext()) { String id = iter.next(); if (p_players.get(id) != null) { name = p_players.get(id).getDataModel().getName(); data.add( "===============================" + name + "==============================="); data.add( "Group population: " + p_players.get(id).getDataModel().getMemberList().size()); data.add( "Current reserve: " + p_players.get(id).getDataModel().getCurrentReservedFood()); data.add("Greediness: " + PoliticalGroup.getGreediness(p_players.get( id).getDataModel())); data.add("++++++LOAN HISTORY OF THIS GROUP++++++"); //Display debtors / loans given data.add("Debtors History-------------------------------"); Map<String, List<Tuple<Double, Double>>> loansGiven = PoliticalGroup.getLoansGiven(p_players.get( id).getDataModel()); if (loansGiven != null) { Set<String> debtors = loansGiven.keySet(); for (String deb : debtors) { String gname; if (PublicEnvironmentConnection.getInstance().getGroupById(deb) == null) { gname = "A DEAD GROUP"; } else { gname = PublicEnvironmentConnection.getInstance().getGroupById( deb).getName(); } data.add("---->Debtor: " + gname + " has been given: " + loansGiven.get( deb).size() + " loans from this group!"); double amountBorrowed = 0; for (Tuple<Double, Double> t : loansGiven.get(deb)) { amountBorrowed += t.getKey() * (1 + t.getValue()); } data.add( " This debtor has borrowed " + amountBorrowed + " units of food"); } } else { data.add("No loans given at the moment!"); } data.add("Creditors History-------------------------------"); //Display debtors / loans given Map<String, List<Tuple<Double, Double>>> loansTaken = PoliticalGroup.getLoansTaken(p_players.get( id).getDataModel()); if (loansTaken != null) { Set<String> creditors = loansTaken.keySet(); for (String cred : creditors) { String gname; if (PublicEnvironmentConnection.getInstance().getGroupById(cred) == null) { gname = "A DEAD GROUP"; } else { gname = PublicEnvironmentConnection.getInstance().getGroupById( cred).getName(); } data.add("---->Creditor: " + gname + " has given this group: " + loansTaken.get( cred).size() + " loans!"); double amountBorrowed = 0; for (Tuple<Double, Double> t : loansTaken.get(cred)) { amountBorrowed += t.getKey() * (1 + t.getValue()); } data.add( " This group has been given " + amountBorrowed + " units of food from this creditor"); } } else { data.add("No loans taken at the moment!"); } } } data.add(" "); iter = active_agent_ids.iterator(); } rounds++; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public boolean isFirstCycle() {\n return cycle == 0;\n }", "public void start( )\r\n {\r\n if (cursor != head){\r\n \t cursor = head; // Implemented by student.\r\n \t precursor = null;\r\n }\r\n }", "public void markRunStart(){\r\n runStart = stepCount;\r\n }", "@Override...
[ "0.67895997", "0.6479103", "0.63145953", "0.6204192", "0.6168962", "0.61196345", "0.61170477", "0.6082777", "0.5990207", "0.59738517", "0.596891", "0.59662527", "0.5928955", "0.59075433", "0.5848559", "0.5827462", "0.5807064", "0.5802355", "0.5785135", "0.57816106", "0.573926...
0.0
-1
Deals with plugin upon plugin deletion
@Deprecated @Override public void onDelete() { }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "static public void callPluginDestroy(Object plugin)\n {\n callSpecialFunc(plugin, \"destroy\");\n }", "@Override\n public synchronized void unload() {\n if (hasPlugin()) {\n try {\n plugin.unload();\n plugin = null;\n } catch (Throwabl...
[ "0.6936949", "0.65166175", "0.65003467", "0.64659727", "0.63592356", "0.63131213", "0.6271974", "0.62632346", "0.6207412", "0.6149668", "0.6081953", "0.6081953", "0.60625213", "0.6007127", "0.6005684", "0.58895487", "0.587734", "0.5870661", "0.585111", "0.5846115", "0.5839398...
0.0
-1
1st create index for all xml files, set the index dir and data dir (xml location) RepRiskIndexer.createIndex();
public static void main(String[] args) throws IOException { RepRiskIndexer.createIndex(AppConstants.INDEX_DIR, AppConstants.DATA_DIR); long totalIndexed = RepRiskIndexer.getTotalIndexed(); // 2nd lets get the contents from csv (RepRisk Companies) RepRiskCsvParser csvParser = new RepRiskCsvParser(); csvParser.setDELIMITER(';'); List<Company> companies = csvParser.readCsvFile("C:\\Lucene\\RepRisk\\company_list.csv"); System.out.println(companies); // 3rd lets get relevant results and documents for each of the companies Map<Company, SearchResults> relevantDocs = new HashMap<>(); RepRiskSearcher searcher = new RepRiskSearcher(); for(Company company : companies) { relevantDocs.put(company, new SearchResults( searcher.absoluteSearch(company.getName()), searcher.relevantSearch(company.getName()))); } // 4th initialize Precision and Recall PrecisionRecallCalculator calc = new PrecisionRecallCalculator(totalIndexed); for(Map.Entry<Company, SearchResults> doc : relevantDocs.entrySet()) { Company company = doc.getKey(); PrecisionRecall result = calc.calculate(doc.getValue()); System.out.println(company.getName() + " " + result); } // 5th print results calc.calculateAveragePrecision(); calc.calculate11point(); calc.printAllResults(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void createIndex(String dataDirPath){\n\t\tFile[] files = new File(dataDirPath).listFiles();\n\n\t\tfor (File file : files) {\n\t\t\tif(!file.isDirectory()\n\t\t\t\t\t&& !file.isHidden()\n\t\t\t\t\t&& file.exists()\n\t\t\t\t\t){\n\t\t\t\t//add to Map\n\t\t\t\t// m.put(file.getAbsolutePath(), new RankModel(f...
[ "0.7020719", "0.68551266", "0.68089515", "0.6683049", "0.6420755", "0.64115214", "0.6337615", "0.633271", "0.62682205", "0.6263379", "0.62361467", "0.6145296", "0.61243546", "0.609093", "0.6004094", "0.5995686", "0.59776497", "0.5973409", "0.596048", "0.59567606", "0.5956644"...
0.568169
38
A common index value can be very generic but must have a way to identify its visibility
public interface CommonIndexValue { public byte[] getVisibility(); public void setVisibility( byte[] visibility ); public boolean overlaps( NumericDimensionField[] field, NumericData[] rangeData ); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public abstract int getIndex();", "@VTID(10)\n int getIndex();", "public abstract long getIndex();", "boolean isIndex();", "boolean getIsIndexOnValues();", "public int getIndex();", "public int getIndex();", "public int getIndex();", "abstract int get(int index);", "public int index();", "bool...
[ "0.6604585", "0.65618825", "0.6524679", "0.63245577", "0.62623996", "0.62558776", "0.62558776", "0.62558776", "0.6159118", "0.61397266", "0.61245495", "0.61245495", "0.61245495", "0.61245495", "0.61245495", "0.61245495", "0.61009324", "0.61009324", "0.60978496", "0.60978496", ...
0.7661389
0
Return all the relations on the given user without any filter.
private Collection<EaterRelation> getRelations(Eater ofUser) { Conjunction pendingFriend = Restrictions.conjunction(); pendingFriend.add(Restrictions.eq(EaterRelation.TO_USER, ofUser)); Disjunction inOr = Restrictions.disjunction(); inOr.add(pendingFriend); inOr.add(Restrictions.eq(EaterRelation.FROM_USER, ofUser)); List<EaterRelation> results = findByCriteria(inOr); return results; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public List<JRuleRelation> getAllRuleRelations(final String userToken) {\n System.out.println(\"Invoking getAllRuleRelations...\");\n logger.info(\"Invoking getAllRuleRelations...\");\n final JCredentials credentials = new JCredentials();\n credentials.setUserToken(userToken);\n ...
[ "0.62841296", "0.6018845", "0.59979427", "0.59721345", "0.5912042", "0.5908607", "0.5678431", "0.5606617", "0.5590949", "0.55476874", "0.55444705", "0.5535472", "0.55196196", "0.5518894", "0.5496911", "0.54842186", "0.54529345", "0.54158986", "0.54076445", "0.54065263", "0.54...
0.74310577
0
Class constructor for testing purposes.
public PhylogeneticTree(Model model) { this.model = model; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private Instantiation(){}", "private QcTestRunner()\n\t{\n\t\t// To prevent external instantiation of this class\n\t}", "Constructor() {\r\n\t\t \r\n\t }", "Reproducible newInstance();", "public Test() {\n }", "public BookcaseTest () {\n }", "public Test()\n {\n }", "public Constructor(){...
[ "0.7628332", "0.7518788", "0.74350184", "0.7414113", "0.7395444", "0.7387784", "0.736933", "0.7366341", "0.7342239", "0.7316366", "0.72538924", "0.72378296", "0.7234938", "0.72281736", "0.72162014", "0.7215353", "0.7212276", "0.7192927", "0.7171558", "0.71650743", "0.71421987...
0.0
-1
Get the model of the PhylogeneticTree.
public Model getModel() { return model; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public PhylogeneticTree(Model model) {\n this.model = model;\n }", "public TreeModel getTreeModel() {\r\n return ModelBuilder.getSingleton().buildTreeModelAsync(this);\r\n }", "public HierarchicalConfiguration getTreeModel()\n {\n return treeModel;\n }", "@Override\n\tpublic Know...
[ "0.7016141", "0.6788483", "0.6744391", "0.6454292", "0.62415165", "0.6231961", "0.6196564", "0.60635954", "0.59578794", "0.5909536", "0.5895233", "0.5889358", "0.582551", "0.5791267", "0.5718211", "0.57138926", "0.5712324", "0.562077", "0.5616828", "0.561121", "0.5597767", ...
0.52432287
68
Set the model of the PhylogeneticTree.
public void setModel(Model model) { this.model = model; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public PhylogeneticTree(Model model) {\n this.model = model;\n }", "public void setTreeModel(HierarchicalConfiguration treeModel)\n {\n this.treeModel = treeModel;\n }", "public void setModel(IHierarchicalNodeModel model);", "public void setModel(DefaultTreeModel model)\n {\n ...
[ "0.77336407", "0.7206536", "0.6797748", "0.6203033", "0.6127028", "0.60679364", "0.6011769", "0.59651214", "0.5909038", "0.5840707", "0.58222806", "0.5750137", "0.57248247", "0.5715777", "0.5709225", "0.5689538", "0.56736344", "0.56696314", "0.5665214", "0.56615597", "0.56264...
0.5579001
24
Setup the tree model from a Newick data file.
@SuppressFBWarnings({"NP_NULL_PARAM_DEREF", "DM_DEFAULT_ENCODING", "NP_NULL_ON_SOME_PATH_FROM_RETURN_VALUE"}) public Tree getTreeFromFile(String path) { FileInputStream fileInputStream = null; try { fileInputStream = new FileInputStream(path); } catch (FileNotFoundException e) { } BufferedReader r = new BufferedReader(new InputStreamReader(fileInputStream)); TreeParser tp = new TreeParser(r); String f = Paths.get(path).getFileName().toString(); return tp.tokenize(f); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void initTreeModel() {\n\t\t\n\t}", "public void initTreeModel() {\n\t\t\n\t}", "protected void init(String tree){\n\t\tJSONObject tree_model = null;\n\t\ttry {\n\t\t\ttree_model = (JSONObject)new JSONParser().parse(tree);\n\t\t} catch (ParseException e) {\n\t\t\te.printStackTrace();\n\t\t\treturn;\n\t\...
[ "0.66340894", "0.66340894", "0.6432409", "0.6406519", "0.63159615", "0.6245657", "0.6243463", "0.6200291", "0.6194229", "0.61410856", "0.61403704", "0.6063433", "0.6012876", "0.59709966", "0.5966856", "0.5962827", "0.59376675", "0.5882467", "0.5812864", "0.5794129", "0.577283...
0.0
-1
Add TreeNodes to the model.
public void setup(Tree tree) { model.setTree(tree); for (TreeNode node : tree.nodes) { if (node.isLeaf()) { model.addCell(node.getKey(), node.getName(), 0, CellType.TREELEAF); } else { model.addCell(node.getKey(), node.getName(), 0, CellType.TREEMIDDLE); } } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void addNode(Node node){subNodes.add(node);}", "void addNodes(List<CyNode> nodes);", "public void addToRootNode(PluginDataModel pluginDataModel){\r\n\t\trootNode.add(new DefaultMutableTreeNode(pluginDataModel));\r\n\t\ttreeModel.reload();\r\n\t}", "public TreeList(TreeModel treeModel) {\n super.set...
[ "0.65699726", "0.6383006", "0.6377069", "0.63301295", "0.6259097", "0.623127", "0.6133392", "0.6088292", "0.6056342", "0.60489887", "0.604494", "0.6022868", "0.6006494", "0.59609026", "0.59193206", "0.59016013", "0.58872944", "0.58640486", "0.58442223", "0.58442223", "0.58418...
0.5540006
39
Searching for Right OR Left foot site amputations should return ALL foot amputations: left, right and bilateral
@Test void attributeGroupDisjunction2() { assertEquals( "Match procedure with left OR right foot (grouped)", Sets.newHashSet(AMPUTATION_FOOT_LEFT, AMPUTATION_FOOT_RIGHT, AMPUTATION_FOOT_BILATERAL), strings(selectConceptIds("< 71388002 |Procedure|: { 363704007 |Procedure site| = 22335008 |Left Foot| } OR { 363704007 |Procedure site| = 7769000 |Right Foot| }"))); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Test\n public void testCombineRankHighPageRankWeight() {\n Iterator<Pair<Document, Double>> resultIterator = icsSearchEngine.searchQuery(Arrays.asList(\"anteater\"),\n 10, 1000000000.0);\n ImmutableList<Pair<Document, Double>> resultList = ImmutableList.copyOf(resultIterator);\n ...
[ "0.51294136", "0.49892834", "0.48928124", "0.48460805", "0.4818341", "0.47320816", "0.47126582", "0.47104996", "0.47078425", "0.46156403", "0.46097267", "0.45959595", "0.45537883", "0.45313257", "0.4531203", "0.45246187", "0.4490014", "0.44821486", "0.44680652", "0.44674093", ...
0.4418326
24
Select the Finding sites of descendants of Disorder Using Reverse Flag
@Test void reverseFlagAttributes() { assertEquals( Sets.newHashSet(RIGHT_VENTRICULAR_STRUCTURE, PULMONARY_VALVE_STRUCTURE), strings(selectConceptIds("*:R " + FINDING_SITE + " = <" + DISORDER))); // Using Dot notation assertEquals( Sets.newHashSet(RIGHT_VENTRICULAR_STRUCTURE, PULMONARY_VALVE_STRUCTURE), strings(selectConceptIds("<" + DISORDER + "." + FINDING_SITE))); // Dot notation against empty set of concepts assertEquals( Sets.newHashSet(), strings(selectConceptIds("<" + RIGHT_VENTRICULAR_STRUCTURE + "." + LATERALITY))); // Select the Finding sites of descendants of Clinical finding assertEquals( Sets.newHashSet(RIGHT_VENTRICULAR_STRUCTURE, PULMONARY_VALVE_STRUCTURE, SKIN_STRUCTURE), strings(selectConceptIds("<" + CLINICAL_FINDING + "." + FINDING_SITE))); // Select the just the first two Finding sites of descendants of Clinical finding PageRequest pageRequest = PageRequest.of(0, 2); assertEquals( Sets.newHashSet(RIGHT_VENTRICULAR_STRUCTURE, SKIN_STRUCTURE), strings(selectConceptIds("<" + CLINICAL_FINDING + "." + FINDING_SITE, pageRequest))); // Select the second page of Finding sites of descendants of Clinical finding pageRequest = PageRequest.of(1, 2); assertEquals( Sets.newHashSet(PULMONARY_VALVE_STRUCTURE), strings(selectConceptIds("<" + CLINICAL_FINDING + "." + FINDING_SITE, pageRequest))); // Select the Laterality of Finding sites of descendants of Clinical finding assertEquals( Sets.newHashSet(RIGHT), strings(selectConceptIds("<" + CLINICAL_FINDING + "." + FINDING_SITE + "." + LATERALITY))); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public static void main(String[] args) {\nDGraph g=new DGraph();\r\nDirectedDFS d=new DirectedDFS(g);\r\nfor(Iterator<Integer> i=d.preorder.iterator();i.hasNext();)\r\n{\r\n\tSystem.out.print(i.next()+\" \");\r\n}\r\nSystem.out.println();\r\nfor(Iterator<Integer> i=d.postorder.iterator();i.hasNext();)\r\n{\r\n\tSy...
[ "0.57271093", "0.5466094", "0.5403343", "0.52674925", "0.52665687", "0.52466625", "0.5218252", "0.5203559", "0.51763916", "0.51756465", "0.51198083", "0.5092603", "0.4986432", "0.49860924", "0.49805662", "0.49741712", "0.49717927", "0.49601722", "0.4955219", "0.4898323", "0.4...
0.5434104
2
TODO: Add reverse flag with cardinality
@Test void attributeCardinality() { assertEquals( Sets.newHashSet(CLINICAL_FINDING, DISORDER, BLEEDING, BLEEDING_SKIN, PENTALOGY_OF_FALLOT, PENTALOGY_OF_FALLOT_INCORRECT_GROUPING), strings(selectConceptIds("<<" + CLINICAL_FINDING + ":[0..*]" + FINDING_SITE + "=*"))); assertEquals( Sets.newHashSet(CLINICAL_FINDING, DISORDER, BLEEDING, BLEEDING_SKIN, PENTALOGY_OF_FALLOT, PENTALOGY_OF_FALLOT_INCORRECT_GROUPING), strings(selectConceptIds("<<" + CLINICAL_FINDING + ":[0..2]" + FINDING_SITE + "=*"))); assertEquals( Sets.newHashSet(BLEEDING_SKIN, PENTALOGY_OF_FALLOT, PENTALOGY_OF_FALLOT_INCORRECT_GROUPING), strings(selectConceptIds("<<" + CLINICAL_FINDING + ":[1..2]" + FINDING_SITE + "=*"))); assertEquals( Sets.newHashSet(BLEEDING_SKIN), strings(selectConceptIds("<<" + CLINICAL_FINDING + ":[1..1]" + FINDING_SITE + "=*"))); assertEquals( Sets.newHashSet(BLEEDING_SKIN, CLINICAL_FINDING, DISORDER, BLEEDING), strings(selectConceptIds("<<" + CLINICAL_FINDING + ":[0..1]" + FINDING_SITE + "=*"))); assertEquals( Sets.newHashSet(CLINICAL_FINDING, DISORDER, BLEEDING), strings(selectConceptIds("<<" + CLINICAL_FINDING + ":[0..0]" + FINDING_SITE + "=*"))); assertEquals( Sets.newHashSet(BLEEDING_SKIN, PENTALOGY_OF_FALLOT, PENTALOGY_OF_FALLOT_INCORRECT_GROUPING), strings(selectConceptIds("<<" + CLINICAL_FINDING + ":[1..2]" + FINDING_SITE + "= <<" + BODY_STRUCTURE))); assertEquals( Sets.newHashSet(BLEEDING_SKIN), strings(selectConceptIds( "<<" + CLINICAL_FINDING + ":" + "[1..2]" + FINDING_SITE + "= <<" + BODY_STRUCTURE + "," + "[0..0]" + ASSOCIATED_MORPHOLOGY + "= <<" + STENOSIS))); assertEquals( Sets.newHashSet(BLEEDING_SKIN, PENTALOGY_OF_FALLOT, PENTALOGY_OF_FALLOT_INCORRECT_GROUPING), strings(selectConceptIds( "<<" + CLINICAL_FINDING + ":" + "[1..2]" + FINDING_SITE + "= <<" + BODY_STRUCTURE + "," + "[0..1]" + ASSOCIATED_MORPHOLOGY + "= <<" + STENOSIS))); assertEquals( Sets.newHashSet(PENTALOGY_OF_FALLOT, PENTALOGY_OF_FALLOT_INCORRECT_GROUPING), strings(selectConceptIds( "<<" + CLINICAL_FINDING + ":" + "[1..2]" + FINDING_SITE + "= <<" + BODY_STRUCTURE + "," + "[1..*]" + ASSOCIATED_MORPHOLOGY + "= <<" + STENOSIS))); assertEquals( Sets.newHashSet(PENTALOGY_OF_FALLOT_INCORRECT_GROUPING), strings(selectConceptIds( "<<" + CLINICAL_FINDING + ":" + "{" + "[1..1]" + FINDING_SITE + " != <<" + PULMONARY_VALVE_STRUCTURE + "," + "[1..*]" + ASSOCIATED_MORPHOLOGY + "= <<" + STENOSIS + "" + "}"))); assertEquals( Sets.newHashSet(PENTALOGY_OF_FALLOT, PENTALOGY_OF_FALLOT_INCORRECT_GROUPING), strings(selectConceptIds( "<<" + CLINICAL_FINDING + ":" + "[0..0]" + FINDING_SITE + " != <<" + BODY_STRUCTURE + "," + "[1..*]" + ASSOCIATED_MORPHOLOGY + "= <<" + STENOSIS))); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Override\n\tpublic int cardinality() {\n\t\treturn 2;\n\t}", "int cardinality();", "public int getCardinality();", "public int getNewCardinalityType(){\n return localNewCardinalityType;\n }", "@Override\r\n\tpublic boolean reverseAccrualIt() {\n\t\r...
[ "0.5997813", "0.59792465", "0.56070054", "0.53824854", "0.53412306", "0.53027934", "0.52163637", "0.51979065", "0.51971537", "0.5161499", "0.5141528", "0.5117745", "0.5106585", "0.49864382", "0.49797857", "0.49170038", "0.48678923", "0.4865261", "0.48355114", "0.481774", "0.4...
0.4789411
22
Sending a message to the console saying that the plugin has been enabled
@Override public void onEnable() { getLogger().info((TextFormat.GREEN + "Custom Messages plugin has been enabled.")); getServer().getPluginManager().registerEvents(this, this); // Registering the plugin's events // Config saveDefaultConfig(); config = getConfig(); // Checking config's version - Hard coded if (config.getInt("Version") != currentConfig){ getLogger().warn(TextFormat.RED + "Outdated config, please consider updating the plugin."); getServer().getPluginManager().disablePlugin(this); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Override\r\n public boolean isPluginEnabled()\r\n {\n return true;\r\n }", "public void onEnable()\n\t{\n\t\t//Tells the user that the plugin is starting up.\n\t\tlog.info(\"Started up.\");\n\t}", "protected abstract void onPluginEnable();", "public void onEnable() {\n PluginDescripti...
[ "0.7105032", "0.70839345", "0.6988201", "0.6957834", "0.6907927", "0.6756983", "0.64340675", "0.63058", "0.6292273", "0.62854964", "0.6262949", "0.61675394", "0.601432", "0.60097694", "0.5989865", "0.5920859", "0.5886482", "0.58857304", "0.5859403", "0.58082825", "0.5794734",...
0.64761394
6
Assigning player into a variable
@EventHandler(ignoreCancelled = true, priority = EventPriority.HIGHEST) public void onJoin(PlayerJoinEvent joinEvent) { Player player = joinEvent.getPlayer(); String health = String.valueOf(player.getHealth()); String ping = String.valueOf(player.getPing()); if (config.getBoolean("JoinEnabled")) { joinEvent.setJoinMessage(config.getString("JoinMessage"). replace("%player%", player.getDisplayName()). replace("%server%", getServer().getMotd()). replace("%ping%", ping). replace("%health%", health)); // Checks if the user has put a join message or not if (config.getString("JoinMessage").trim().isEmpty() || config.getString("JoinMessage").equals("")) { this.getLogger().info("Couldn't define any join message."); } } else this.getLogger().info("Join messages are disabled."); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void setPlayer(Player myPlayer){\n battlePlayer=myPlayer;\n }", "public void setPlayer(Player player) {\r\n this.player = player;\r\n }", "public void setPlayer(Player player) {\n this.currentPlayer = player;\n }", "public void setPlayer(Player player) {\n this.player = pl...
[ "0.7683957", "0.73966855", "0.73514533", "0.733405", "0.72985756", "0.72545695", "0.7243224", "0.71868926", "0.7113708", "0.7102396", "0.7015997", "0.69953907", "0.6988284", "0.69087356", "0.6891357", "0.6843835", "0.68388295", "0.68355167", "0.68355167", "0.6835227", "0.6833...
0.0
-1
Assigning player into a variable
@EventHandler(ignoreCancelled = true, priority = EventPriority.HIGHEST) public void onQuit(PlayerQuitEvent quitEvent) { Player player = quitEvent.getPlayer(); String health = String.valueOf(player.getHealth()); String ping = String.valueOf(player.getPing()); if (config.getBoolean("QuitEnabled")) { quitEvent.setQuitMessage(config.getString("QuitMessage"). replace("%player%", player.getDisplayName()). replace("%server%", getServer().getMotd()). replace("%ping%", ping). replace("%health%", health)); // Checks if the user has put a quit message or not if (config.getString("QuitMessage").trim().isEmpty() || config.getString("QuitMessage").equals("")) { this.getLogger().info("Couldn't define any quit message."); } } else this.getLogger().info("Quit messages are disabled."); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void setPlayer(Player myPlayer){\n battlePlayer=myPlayer;\n }", "public void setPlayer(Player player) {\r\n this.player = player;\r\n }", "public void setPlayer(Player player) {\n this.currentPlayer = player;\n }", "public void setPlayer(Player player) {\n this.player = pl...
[ "0.7683957", "0.73966855", "0.73514533", "0.733405", "0.72985756", "0.72545695", "0.7243224", "0.71868926", "0.7113708", "0.7102396", "0.7015997", "0.69953907", "0.6988284", "0.69087356", "0.6891357", "0.6843835", "0.68388295", "0.68355167", "0.68355167", "0.6835227", "0.6833...
0.0
-1
menuunjukkan Tombol GETSTARTED dan menyembunyikan indikator dan tombol selanjutnya
private void loaddLastScreen() { btnSelanjutnya.setVisibility(View.INVISIBLE); btnMulai.setVisibility(View.VISIBLE); tvSkip.setVisibility(View.INVISIBLE); tabIndicator.setVisibility(View.INVISIBLE); // TODO : ADD an animation the getstarted button // penyiapan animasi btnMulai.setAnimation(btnAnim); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void sendeSpielStarten();", "@Override\n\tpublic void statusVomMenschen() {\n\t\tSystem.out.println(\"Sie wurden getroffen nun können Sie nicht mehr so schnell laufen!\");\n\t}", "public void start( )\n {\n // Implemented by student.\n }", "public void recibir_estado_partida(){\n\n }", "...
[ "0.6808683", "0.603524", "0.59176755", "0.5896238", "0.58350176", "0.5789307", "0.57834065", "0.57734233", "0.57634145", "0.5747383", "0.5733288", "0.57154393", "0.56987584", "0.5657745", "0.56571025", "0.565664", "0.56537306", "0.56461614", "0.5636992", "0.5636211", "0.56353...
0.0
-1
Created by JustMe on 11/28/2017.
public interface MenuItem<T> { T[] getItems(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Override\n public void perish() {\n \n }", "@Override\n\tpublic void grabar() {\n\t\t\n\t}", "public final void mo51373a() {\n }", "private stendhal() {\n\t}", "@Override\n\tpublic void comer() {\n\t\t\n\t}", "@Override\r\n\tpublic void bicar() {\n\t\t\r\n\t}", "@Override\r\n\tpubl...
[ "0.6028601", "0.5884795", "0.5872228", "0.5830608", "0.580863", "0.5717442", "0.5717442", "0.5690373", "0.5685771", "0.5652856", "0.56371534", "0.56297624", "0.56198454", "0.56080556", "0.558719", "0.5582353", "0.5565469", "0.555888", "0.555888", "0.555888", "0.555888", "0....
0.0
-1
Create a new ObjectFactory that can be used to create new instances of schema derived classes for package: org.example.types
public ObjectFactory() { }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "SchemaBuilder withFactory(String factoryClassName);", "ObjectTypeDefinition createObjectTypeDefinition();", "SchemaComponentType createSchemaComponentType();", "TypeSystemDefinition createTypeSystemDefinition();", "public interface GraphQLFactory extends EFactory\n{\n /**\n * The singleton instance of t...
[ "0.6857429", "0.6674344", "0.65048665", "0.62852556", "0.6214055", "0.61864936", "0.6169888", "0.61467093", "0.6138808", "0.6122363", "0.6109448", "0.60802007", "0.6059718", "0.6059718", "0.6059718", "0.6045585", "0.6045585", "0.6045585", "0.6043686", "0.5972331", "0.5942515"...
0.0
-1
TODO Autogenerated method stub
public static void main(String[] args) throws IOException { WebDriverManager.firefoxdriver().setup(); WebDriver driver = new FirefoxDriver(); driver.manage().timeouts().implicitlyWait(10, TimeUnit.SECONDS); driver.get("https://demo.nopcommerce.com/"); driver.manage().window().maximize(); driver.manage().deleteAllCookies(); //Full page screenshot // TakesScreenshot tScreenshot=(TakesScreenshot) driver; // File src = tScreenshot.getScreenshotAs(OutputType.FILE); // File target = new File(".\\screenshots\\homepage.png"); // FileUtils.copyFile(src, target); //Screenshot of a particular section // WebElement section = driver.findElement(By.xpath("//div[@class='category-grid home-page-category-grid']")); // File src = section.getScreenshotAs(OutputType.FILE); // File target = new File(".\\screenshots\\featurepdoducts.png"); // FileUtils.copyFile(src, target); //Screenshot for a specific element WebElement section = driver.findElement(By.xpath("//img[@alt='nopCommerce demo store']")); File src = section.getScreenshotAs(OutputType.FILE); File target = new File(".\\screenshots\\logo.jpg"); FileUtils.copyFile(src, target); driver.quit(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Override\r\n\tpublic void comer() \r\n\t{\n\t\t\r\n\t}", "@Override\n\tpublic void comer() {\n\t\t\n\t}", "@Override\n public void perish() {\n \n }", "@Override\r\n\t\t\tpublic void annadir() {\n\r\n\t\t\t}", "@Override\n\tpublic void anular() {\n\n\t}", "@Override\n\tprotected void getExr...
[ "0.6671074", "0.6567672", "0.6523024", "0.6481211", "0.6477082", "0.64591026", "0.64127725", "0.63762105", "0.6276059", "0.6254286", "0.623686", "0.6223679", "0.6201336", "0.61950207", "0.61950207", "0.61922914", "0.6186996", "0.6173591", "0.61327106", "0.61285484", "0.608016...
0.0
-1
Called when the activity is first created.
@Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.main); Intent serviceIntent = new Intent(); serviceIntent.setAction("org.urish.soundtracker.doggie.DoggieService"); startService(serviceIntent); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Override\n\tpublic void onActivityCreated(Bundle savedInstanceState) {\n\t\tsuper.onActivityCreated(savedInstanceState);\n\t\tinit();\n\t}", "@Override\r\n\tpublic void onActivityCreated(Bundle savedInstanceState) {\n\t\tsuper.onActivityCreated(savedInstanceState);\r\n\t}", "@Override\n\tpublic void onActivit...
[ "0.791686", "0.77270156", "0.7693263", "0.7693263", "0.7693263", "0.7693263", "0.7693263", "0.7693263", "0.7637394", "0.7637394", "0.7629958", "0.76189965", "0.76189965", "0.7543775", "0.7540053", "0.7540053", "0.7539505", "0.75269467", "0.75147736", "0.7509639", "0.7500879",...
0.0
-1
Add attribute values in the order of attributes as specified by the dataset
public void addAttribute(String i) { if (attributes == null) attributes = new ArrayList<String>(); attributes.add(i); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private void addAttrAnnotation(List<Iattribute> attributes, String packageName, String className) {\n\n FileSavedAnnotAttr annotAttr;\n\n for (Iattribute itemAttr: attributes) {\n\n for (Iannotation itemAnnot: itemAttr.getAttrAnnotations()) {\n\n if (itemAnnot.isChangen()) {...
[ "0.6109258", "0.582032", "0.5796908", "0.57939076", "0.5783285", "0.5762076", "0.5747164", "0.5747164", "0.5647515", "0.56095785", "0.5595055", "0.55887806", "0.5582452", "0.55712956", "0.55571735", "0.5537927", "0.5518079", "0.54779917", "0.5476848", "0.5471753", "0.54678494...
0.5873237
1
TODO Autogenerated method stub
@Override public int getMediaDuration() { return 0; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Override\r\n\tpublic void comer() \r\n\t{\n\t\t\r\n\t}", "@Override\n\tpublic void comer() {\n\t\t\n\t}", "@Override\n public void perish() {\n \n }", "@Override\r\n\t\t\tpublic void annadir() {\n\r\n\t\t\t}", "@Override\n\tpublic void anular() {\n\n\t}", "@Override\n\tprotected void getExr...
[ "0.6671074", "0.6567672", "0.6523024", "0.6481211", "0.6477082", "0.64591026", "0.64127725", "0.63762105", "0.6276059", "0.6254286", "0.623686", "0.6223679", "0.6201336", "0.61950207", "0.61950207", "0.61922914", "0.6186996", "0.6173591", "0.61327106", "0.61285484", "0.608016...
0.0
-1
============================== / true if all required fields (dbnotnull fields) are valid
public boolean isDBValid(){ return noInduk != null && !noInduk.isEmpty(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private boolean CheckAllRequiredFields() {\n\t\tboolean res = true;\n\t\tres &= CheckParkSelection();\n\t\tres &= CheckDateSelection();\n\t\tres &= CheckVisitorHour();\n\t\tres &= CheckEmail();\n\t\tres &= CheckPhoneNumber();\n\t\treturn res;\n\t}", "protected boolean isAllRequiredTxtFieldsFilled() {\r\n JTex...
[ "0.7501502", "0.7319795", "0.71993804", "0.7075136", "0.6971481", "0.6967834", "0.69482225", "0.6899647", "0.689031", "0.68826413", "0.6875583", "0.68567157", "0.6844625", "0.6822824", "0.6811073", "0.6746601", "0.67418283", "0.6737112", "0.673031", "0.67087185", "0.67065895"...
0.6643129
24
/ rs.isBeforeFirst must be false throws KasirException(BAD_RECORD, tableName) if the resulting Profil.isDBValid = false never ret null
public Profil dynFromResultSet(ResultSet rs, boolean onCallingObj) throws SQLException, KasirException{ assert !rs.isBeforeFirst() : "rs.isBeforeFirst = true"; Profil profil = onCallingObj? this : new Profil(); profil.noInduk = rs.getString(noIndukColName); profil.currentLevel = Level.fromResultSet(rs, currentLevelColName); profil.biodata = Biodata.fromResultSet(rs); profil.tanggalMasuk = Kalender.fromResultSet(rs, tanggalMasukColName); profil.tanggalLulus = Kalender.fromResultSet(rs, tanggalLulusColName); String tmpGelombang = rs.getString(gelombangColName); if(tmpGelombang != null){ if(tmpGelombang.equalsIgnoreCase("GELOMBANG_1")){ profil.gelombang = Gelombang.GELOMBANG_1; }else if(tmpGelombang.equalsIgnoreCase("GELOMBANG_2")){ profil.gelombang = Gelombang.GELOMBANG_2; } } profil.totalIuran = rs.getFloat(totalIuranColName); String tmpStatusPendaftaran = rs.getString(statusPendaftaranColName); if(tmpStatusPendaftaran != null){ if(tmpStatusPendaftaran.equalsIgnoreCase("DAFTAR")){ profil.statusPendaftaran = StatusPendaftaran.DAFTAR; }else if(tmpStatusPendaftaran.equalsIgnoreCase("PROSES")){ profil.statusPendaftaran = StatusPendaftaran.PROSES; }else if(tmpStatusPendaftaran.equalsIgnoreCase("LUNAS")){ profil.statusPendaftaran = StatusPendaftaran.LUNAS; }else if (tmpStatusPendaftaran.equalsIgnoreCase("BATAL")){ profil.statusPendaftaran = StatusPendaftaran.BATAL; } } profil.lastUpdateDate = Kalender.fromResultSet(rs, lastUpdateDateColName); if(profil.isDBValid()) return profil; else throw new KasirException(KasirException.Tipe.BAD_RECORD, tableName); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void beforeFirst() throws SQLException\n {\n m_rs.beforeFirst();\n }", "public void beforeFirst() throws SQLException {\n/* 251 */ notSupported();\n/* */ }", "public boolean isBeforeFirst() throws SQLException\n {\n return m_rs.isBeforeFirst();\n }", "public boolean isBefor...
[ "0.69291705", "0.68749285", "0.685676", "0.68139315", "0.66679424", "0.6574376", "0.6359694", "0.6189364", "0.612648", "0.6073402", "0.5998289", "0.58882767", "0.57872564", "0.570905", "0.5588507", "0.55815387", "0.5543167", "0.548924", "0.5473715", "0.536849", "0.5363756", ...
0.5462786
19
/ never ret null throws KasirException(BAD_RECORD, tableName) if the resulting Profil.isDBValid = false
public static Profil fromResultSet(ResultSet rs) throws SQLException, KasirException{ return new Profil().dynFromResultSet(rs, true); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Test(timeout = 4000)\n public void test059() throws Throwable {\n DBUtil.assertAllDbResourcesClosed(false);\n DBCatalog dBCatalog0 = new DBCatalog();\n // Undeclared exception!\n try { \n dBCatalog0.getTable(\"uJr'z\");\n fail(\"Expecting exception: RuntimeException\");\n ...
[ "0.59152126", "0.5841673", "0.5698307", "0.56806445", "0.5675238", "0.5525149", "0.5523695", "0.5487325", "0.5486973", "0.5482588", "0.5476363", "0.54642475", "0.5463523", "0.543096", "0.54258126", "0.54185814", "0.53789383", "0.53746986", "0.53727317", "0.5350806", "0.534681...
0.0
-1
/ noInduk may not be null / empty never ret null throws KasirException(ROW_NOT_FOUND, noInduk) if no matching row found throws KasirException(BAD_RECORD, tableName) if the resulting Profil.isDBValid = false
public static Profil fromResultSet(ResultSet rs, String noInduk) throws SQLException, KasirException { assert noInduk != null && !noInduk.isEmpty() : "fromResultSet(ResultSet, String noInduk = null / empty)"; return fromResultSet(rs, noIndukColName, false, noInduk); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public static Profil select(String noInduk) throws SQLException, KasirException{\r\n assert noInduk != null && !noInduk.isEmpty() : \"selectProfil(String, String, String noInduk = null)\";\r\n\r\n return select(noIndukColName, false, noInduk);\r\n }", "public boolean updateNoInduk(String oldNoIn...
[ "0.6567767", "0.6092123", "0.59458727", "0.57712024", "0.5757312", "0.55114", "0.5308313", "0.52615124", "0.525964", "0.5241388", "0.5227394", "0.5210384", "0.51936233", "0.5173392", "0.5170402", "0.5122953", "0.509099", "0.50821793", "0.5075317", "0.50671643", "0.5055093", ...
0.6360282
1
/ caller of this method must ensure that isDBValid = true & RS cursor points to the intended row never ret false
public boolean flushResultSet(ResultSet rs, boolean flushNoInduk) throws SQLException { if(flushNoInduk) rs.updateString(noIndukColName, noInduk); if(currentLevel != null) currentLevel.flushResultSet(rs, currentLevelColName); if (biodata != null) biodata.flushResultSet(rs); if(tanggalMasuk != null) tanggalMasuk.flushResultSet(rs, tanggalMasukColName); if(tanggalLulus != null) tanggalLulus.flushResultSet(rs, tanggalLulusColName); if(gelombang != null) rs.updateString(gelombangColName, gelombang.toString()); if(totalIuran > 0) rs.updateFloat(totalIuranColName, totalIuran); if(statusPendaftaran != null) rs.updateString(statusPendaftaranColName, statusPendaftaran.toString()); if(lastUpdateDate != null) lastUpdateDate.flushResultSet(rs, lastUpdateDateColName); return true; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private void verifyCursorPosition(long expectedCurrentRow) throws SQLException {\n\t\tif (verifyCursorPosition) {\n\t\t\tif (expectedCurrentRow != this.rs.getRow()) {\n\t\t\t\tthrow new InvalidDataAccessResourceUsageException(\"Unexpected cursor position change.\");\n\t\t\t}\n\t\t}\n\t}", "@Nullable\n\tprotected...
[ "0.631763", "0.6228026", "0.609012", "0.60830003", "0.59658855", "0.5965686", "0.5916377", "0.5906782", "0.58755434", "0.58221483", "0.58203644", "0.58198947", "0.5806018", "0.57981604", "0.578471", "0.5670544", "0.56679153", "0.5665379", "0.56433165", "0.56081843", "0.558896...
0.0
-1
/ caller of this method must ensure that RS cursor is at the insert row & that no existing row has the same noInduk & call rs.insertRow() when all done throws KasirException(DB_INVALID, this) if isInsertDBValid = false never ret false
public boolean insertResultSet(ResultSet rs) throws SQLException, KasirException{ if(isInsertDBValid()) return flushResultSet(rs, true); else throw new KasirException(KasirException.Tipe.DB_INVALID, this); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public boolean insertDB(String qryExp, RequestBox rBox) throws Exception {\n\t\t\n\t\tConnection conn = null;\n\t\tconn = DBConnect.getDBConnection(\"TPI_TRIBON\");\n\t\tconn.setAutoCommit(false);\n\t\t\n PreparedStatement \tpstmt \t\t= null;\n int \t\t\t\tisOk \t\t= 0;\n int \t\t\t\tisAll...
[ "0.67399895", "0.66892254", "0.65827906", "0.63928384", "0.6358266", "0.6330395", "0.62277406", "0.6209911", "0.6204866", "0.6190891", "0.61657065", "0.61643064", "0.6156308", "0.6144742", "0.61272025", "0.61156464", "0.60825205", "0.6074376", "0.60447705", "0.6013287", "0.59...
0.70809174
0
/ updates without updating noInduk if noInduk is changed prior to calling this method, the new noInduk is still isn't stored throws KasirException(DB_INVALID, this) if isDBValid = false throws KasirException(ROW_NOT_FOUND, this) if no row matches never ret false
public boolean updateResultSet(ResultSet rs) throws SQLException, KasirException{ if(!isDBValid()) throw new KasirException(KasirException.Tipe.DB_INVALID, this); if(DBSR.searchRow(rs, noIndukColName, false, noInduk) > 0) return flushResultSet(rs, false); else throw new KasirException(KasirException.Tipe.ROW_NOT_FOUND, this); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public boolean updateNoInduk(String oldNoInduk) throws SQLException, KasirException{\r\n assert oldNoInduk != null;\r\n\r\n //profil.noInduk is also retrieved to check for noInduk duplication\r\n ResultSet rs = DBSR.takeResultSetByString(tableName, noIndukColName, 1, oldNoInduk, noInduk);\r\n\...
[ "0.7790531", "0.7056909", "0.61059535", "0.5978394", "0.57220584", "0.5666216", "0.56629574", "0.5600221", "0.55152583", "0.5506018", "0.5487219", "0.5436778", "0.5417349", "0.5407668", "0.5397259", "0.5395893", "0.5395337", "0.53896236", "0.534632", "0.5332142", "0.5324764",...
0.5993668
3
/ updates including noInduk. if oldNoInduk.equals(noInduk) = true, then it's the same as flushResultSet(rs) oldNoInduk may not be null throws KasirException(DB_INVALID, this) if isDBValid = false throws KasirException(ROW_NOT_FOUND, this/oldNoInduk) if no row matches throws KasirException(DUPLICATE_PRIMARY_KEY, this) if the new noInduk has already existed in db never ret false
public boolean updateResultSetNoInduk(ResultSet rs, String oldNoInduk) throws SQLException, KasirException { assert oldNoInduk != null : "oldNoInduk = null"; if(!isDBValid()) throw new KasirException(KasirException.Tipe.DB_INVALID, this); if(noInduk.equals(oldNoInduk)){ if(DBSR.searchRow(rs, noIndukColName, false, noInduk) > 0) return flushResultSet(rs, false); else throw new KasirException(KasirException.Tipe.ROW_NOT_FOUND, this); }else{ if(DBSR.searchRow(rs, noIndukColName, false, noInduk) > 0) throw new KasirException(KasirException.Tipe.DUPLICATE_PRIMARY_KEY, this); if(DBSR.searchRow(rs, noIndukColName, false, oldNoInduk) > 0) return flushResultSet(rs, true); else throw new KasirException(KasirException.Tipe.ROW_NOT_FOUND, oldNoInduk); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public boolean updateNoInduk(String oldNoInduk) throws SQLException, KasirException{\r\n assert oldNoInduk != null;\r\n\r\n //profil.noInduk is also retrieved to check for noInduk duplication\r\n ResultSet rs = DBSR.takeResultSetByString(tableName, noIndukColName, 1, oldNoInduk, noInduk);\r\n\...
[ "0.84479547", "0.654515", "0.6057254", "0.5992945", "0.5939492", "0.5888489", "0.5878575", "0.587452", "0.58633035", "0.5856519", "0.58435005", "0.5793002", "0.57831043", "0.5743955", "0.5736017", "0.5730052", "0.5717002", "0.5713965", "0.5707193", "0.5680578", "0.56739414", ...
0.8094003
1
ret empty if all vars are empty
public String asWhereClause() { LinkedList<String> whereClause = new LinkedList<>(); if (noInduk != null && !noInduk.isEmpty()) whereClause.add(noIndukColName + " LIKE '%" + noInduk + "%'"); if (currentLevel != null) whereClause.add(currentLevelColName + " LIKE '%" + currentLevel.asWhereClause() + "%'"); if (biodata != null){ String wc = biodata.asWhereClause(); if(wc != null && !wc.isEmpty()) whereClause.add(wc); } if (tanggalMasuk != null) whereClause.add(tanggalMasukColName + " LIKE '%" + tanggalMasuk.asWhereClause(true) + "%'"); if (tanggalLulus != null) whereClause.add(tanggalLulusColName + " LIKE '%" + tanggalLulus.asWhereClause(true) + "%'"); if (gelombang != null) whereClause.add(gelombangColName + " = '" + gelombang + "'"); if (statusPendaftaran != null) whereClause.add(statusPendaftaranColName + " = '" + statusPendaftaran + "'"); if (lastUpdateDate != null) whereClause.add(lastUpdateDateColName + " LIKE '%" + lastUpdateDate.asWhereClause(true) + "%'"); return whereClause.isEmpty()? "" : StringUtils.join(whereClause, " AND "); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public StringSet freeVars() {\n\treturn argument.freeVars();\n }", "private boolean isParamsEmpty(String... params){\n for (String param : params) {\n if (param.isEmpty())\n return true;\n }\n return false;\n }", "private boolean isEmpty()\n {\n return d...
[ "0.60222936", "0.5853034", "0.5768242", "0.5728989", "0.56789386", "0.5660729", "0.56605697", "0.5652071", "0.5642528", "0.5622093", "0.5528963", "0.55134076", "0.54837984", "0.54793024", "0.54767936", "0.5476435", "0.5469775", "0.54629254", "0.5439767", "0.543729", "0.543330...
0.0
-1
/ noInduk may not be null / empty never ret null throws KasirException(ROW_NOT_FOUND, noInduk)
public static Profil select(String noInduk) throws SQLException, KasirException{ assert noInduk != null && !noInduk.isEmpty() : "selectProfil(String, String, String noInduk = null)"; return select(noIndukColName, false, noInduk); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public static boolean delete(String noInduk) throws SQLException, KasirException{\r\n return DBSR.deleteKasirO(tableName, noIndukColName, false, noInduk);\r\n }", "public boolean updateNoInduk(String oldNoInduk) throws SQLException, KasirException{\r\n assert oldNoInduk != null;\r\n\r\n /...
[ "0.62837714", "0.60503674", "0.5565094", "0.54666317", "0.5445909", "0.5433758", "0.54153526", "0.5346662", "0.53120875", "0.52305394", "0.51572156", "0.515668", "0.51493406", "0.50555885", "0.5034443", "0.50167793", "0.49922267", "0.49895653", "0.4988956", "0.49872586", "0.4...
0.6213341
1
/ null / empty elts of noInduks are ignored ret all Profil if noInduks = null throws KasirException(BAD_RECORD, tableName). possible only if noInduks = null ret empty Map if (noInduks = null & table is empty) / (all elts of noInduks aren't valid (null / empty)) / noInduks.isEmpty = true ret Map. never null Map.get(noInduks[i]) = null if no row has noInduks[i] Map.size() <= noInduks.length, because duplicate elts of ids are treated as 1 map entry
public static Map<String,Profil> selectS(Set<String> noInduks) throws SQLException, KasirException{ ResultSet rs; Map<String,Profil> noIndukProfil; if(noInduks == null){ rs = DBSR.takeResultSetByStringColl(tableName, noIndukColName, -1, null); noIndukProfil = new HashMap<>(DBSR.rowCountRS(rs)); rs.beforeFirst(); while(rs.next()){ Profil p = Profil.fromResultSet(rs); noIndukProfil.put(p.noInduk, p); } }else{ Set<String> validNoInduk = new HashSet<>(CollectionUtils.subtract(noInduks, Arrays.asList(null, ""))); rs = DBSR.takeResultSetByStringColl(tableName, noIndukColName, -1, validNoInduk); noIndukProfil = new HashMap<>(validNoInduk.size()); for(String noInduk : validNoInduk){ try{ noIndukProfil.put(noInduk, Profil.fromResultSet(rs, noInduk)); }catch(KasirException e){ noIndukProfil.put(noInduk, null); } } } return noIndukProfil; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public static Result<Map<String, String>> getUsers(Connection c){\n PreparedStatement pstmt;\n ResultSet rst;\n Map<String, String> maps=new HashMap<String,String>(); //Maps\n try {\n pstmt = c.prepareStatement(getUserStatement);\n rst=pstmt.executeQuery();\n ...
[ "0.5371116", "0.53335226", "0.51053214", "0.5022138", "0.50169736", "0.50048953", "0.5003408", "0.49819106", "0.49686426", "0.4964206", "0.49465245", "0.49402326", "0.49139062", "0.4891814", "0.48498073", "0.484783", "0.48372522", "0.48310068", "0.48180345", "0.47929236", "0....
0.67492276
0