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
We must make sure that Anki DB data have sufficient quality to begin with.
private static void verifyAnkiNotesIntegrity() throws ClassNotFoundException { List<AnkiNote> notesWithoutPron = new AnkiDatabase().getNotesWithoutPron(); for (AnkiNote note : notesWithoutPron) { String deutsch = note.getDeutsch(); String tags = note.getTags(); String articleError = "Note has flag %s, but does not start with %s: %s%n"; //Notes with tag Femininum must have german field starting with e or r/e if (tags.contains("Femininum") && !(deutsch.startsWith("e ") || deutsch.startsWith("r/e "))) { System.err.printf(articleError, "Femininum", "e or r/e", note); } //Notes with tag Maskulinum must start with r or r/e or r/s if (tags.contains("Maskulinum") && !(deutsch.startsWith("r ") || deutsch.startsWith("r/e ") || deutsch.startsWith("r/s "))) { System.err.printf(articleError, "Maskulinum", "r or r/e", note); } //Notes with tag Neutrum must start with s or (s) if (tags.contains("Neutrum") && !(deutsch.startsWith("s ") || deutsch.startsWith("(s) ") || deutsch.startsWith("r/s "))) { System.err.printf(articleError, "Neutrum", "s or (s)", note); } //No nbsp; in notes! if (note.getFlds().contains("nbsp;")) { System.err.printf("Note contains nbsp; :%s%n", note); } //No special characters in words! String word = note.getWord(); if (word != null && (word.contains("<") || word.contains(" ") || word.contains(">") || word.contains("­"))) { System.err.printf("Note contains one of characters <, ,>,-: %s%n", note); } //When note has Maskulinum, Femininum or Neutrum, then it must have wort if ((tags.contains("Maskulinum") || tags.contains("Femininum") || tags.contains("Neutrum")) && !tags.contains("wort")) { System.err.printf("Note has Maskulinu, Femininum or Neutrum, but doesn't have wort: %s%n", note); } } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Override\n\tvoid checkConsistency()\n\t{\n\t\t\n\t}", "@Test(timeout = 4000)\n public void test68() throws Throwable {\n PipedReader pipedReader0 = new PipedReader();\n StreamTokenizer streamTokenizer0 = new StreamTokenizer(pipedReader0);\n streamTokenizer0.nval = 713.6331870209585;\n SQL...
[ "0.588483", "0.5881999", "0.5836039", "0.5831953", "0.5699112", "0.5686732", "0.5680917", "0.5677198", "0.5615798", "0.55925155", "0.558875", "0.55533254", "0.5544379", "0.5518213", "0.5500044", "0.54983145", "0.54872435", "0.5472949", "0.54513764", "0.54389304", "0.54164684"...
0.0
-1
Constructor for the class.
public MapDictionary(String dictionaryLocation) { try { Scanner dictionary = new Scanner(new FileReader(dictionaryLocation)); while(dictionary.hasNextLine()) { String word = dictionary.nextLine().toLowerCase(); if(PredictivePrototype.isValidWord(word)) addElement(word, PredictivePrototype.wordToSignature(word)); } dictionary.close(); } catch (FileNotFoundException e) { System.out.print("Dictionary not found."); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "Constructor() {\r\n\t\t \r\n\t }", "public Constructor(){\n\t\t\n\t}", "public CyanSus() {\n\n }", "public PSRelation()\n {\n }", "public _355() {\n\n }", "private Instantiation(){}", "public Chick() {\n\t}", "public CSSTidier() {\n\t}", "public Pitonyak_09_02() {\r\n }", "public Treni...
[ "0.84834844", "0.80363995", "0.7402332", "0.73984003", "0.7169051", "0.7097029", "0.7073533", "0.7069785", "0.70525056", "0.70207524", "0.7020108", "0.6995734", "0.6990981", "0.69893134", "0.6969099", "0.6965046", "0.696421", "0.6951068", "0.6946851", "0.69132704", "0.6886052...
0.0
-1
Check whether a key for the word's signature exists. If so, add the word to the existing set. Otherwise, create a new entry.
public void addElement(String word, String signature) { if(dictionaryMap.get(signature)!= null) dictionaryMap.get(signature).add(word); else { Set<String> newSignature = new TreeSet<>(); newSignature.add(word); dictionaryMap.put(signature, newSignature); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public boolean add(String word) {\r\n\t\treturn dict.add(word);\r\n\t}", "public boolean add(String key) {\n char[] characters = key.trim().toCharArray();\n\n TrieNode trieNode = root; // current trie node\n\n boolean alreadyExists = true;\n\n for (char ch : characters) {\n ...
[ "0.5974995", "0.58252174", "0.5744606", "0.5735508", "0.5708189", "0.5617863", "0.56155115", "0.5541254", "0.5512819", "0.54857814", "0.5438572", "0.54350626", "0.54314953", "0.54168415", "0.53612894", "0.53031373", "0.53012586", "0.5300914", "0.5291033", "0.5271849", "0.5263...
0.67448115
0
Get all words associated with the given signature.
public Set<String> signatureToWords(String signature) { if(dictionaryMap.containsKey(signature)) return dictionaryMap.get(signature); return new TreeSet<>(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public Collection<String> signatureToWords(String sig);", "@Override\n\tpublic Set<String> signatureToWords(String signature) {\n\t\tif(dictionary.containsKey(signature));\n\t\t\treturn dictionary.get(signature);\n\t}", "public static Set<String> signatureToWords(String signature){\n\n\t\tFile dictionary = new...
[ "0.79413116", "0.7929594", "0.7601417", "0.73435044", "0.71207607", "0.69304264", "0.6044577", "0.59158635", "0.58998233", "0.5800664", "0.5684714", "0.5638704", "0.5629627", "0.55754113", "0.5573807", "0.5549139", "0.55466807", "0.55140454", "0.55041265", "0.5421715", "0.540...
0.7737322
2
Replace the android default class loader
void injectorClassLoader() { //To get the package name String pkgName = context.getPackageName(); //To get the context Context contextImpl = ((ContextWrapper) context).getBaseContext(); //Access to the Activity of the main thread Object activityThread = null; try { activityThread = Reflection.getField(contextImpl, "mMainThread"); } catch (Exception e) { e.printStackTrace(); } //Get package container Map mPackages = null; try { mPackages = (Map) Reflection.getField(activityThread, "mPackages"); } catch (Exception e) { e.printStackTrace(); } //To obtain a weak reference object, the standard reflection WeakReference weakReference = (WeakReference) mPackages.get(pkgName); if (weakReference == null) { log.e("loadedApk is null"); } else { //Get apk need to be loaded Object loadedApk = weakReference.get(); if (loadedApk == null) { log.e("loadedApk is null"); return; } if (appClassLoader == null) { //Access to the original class loader ClassLoader old = null; try { old = (ClassLoader) Reflection.getField(loadedApk, "mClassLoader"); } catch (Exception e) { e.printStackTrace(); } //According to the default class loader instantiate a plug-in class loader appClassLoader = new SyknetAppClassLoader(old, this); } //Replace the new plug-in loader loader by default try { Reflection.setField(loadedApk, "mClassLoader", appClassLoader); } catch (Exception e) { e.printStackTrace(); } } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private static AndroidNClassLoader createAndroidNClassLoader(PathClassLoader original, Application application) throws Exception {\n AndroidNClassLoader androidNClassLoader = new AndroidNClassLoader(\"\", original, application);\n Field originPathList = ShareReflectUtil.findField(original, \"pathLis...
[ "0.6252656", "0.61629486", "0.6038525", "0.60226744", "0.59883183", "0.5968261", "0.58981705", "0.5808434", "0.5777481", "0.57199866", "0.57054204", "0.5698238", "0.5684679", "0.5650862", "0.5617074", "0.5594309", "0.55554193", "0.55441034", "0.5543923", "0.5529779", "0.55275...
0.7027052
0
Instantiate a plugin class information
public PluginInfo load(String apkfile, String packageName) { PluginInfo pluginInfo = new PluginInfo(); try { boolean ok = pluginInfo.load(context, storagePath, apkfile, packageName); log.d("load plugin: " + apkfile + ", name:" + packageName + ", result:" + ok); if (!ok) return null; } catch (Exception e) { e.printStackTrace(); } synchronized(this) { //Will object information added to the plugin's container pluginInfoMap.put(pluginInfo.getPackageName(), pluginInfo); } return pluginInfo; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public DemoPluginFactory() {}", "private PluginsInternal() {}", "static Plugin newInstance(String simpleClassName) throws Exception {\n final String className = Plugin.class.getPackageName() + \".\" + simpleClassName;\n return (Plugin) Class.forName(className).getDeclaredConstructor().newInstance...
[ "0.7197168", "0.6677877", "0.6550236", "0.65090954", "0.64255214", "0.6381311", "0.63779056", "0.63636076", "0.6252725", "0.620136", "0.61791974", "0.61373115", "0.6101616", "0.6059629", "0.60570425", "0.60316086", "0.5982488", "0.5952594", "0.5947042", "0.5943994", "0.593735...
0.0
-1
This method filters creating same objects.
public Word getWord(String wordName){ Word word = words.get(wordName); if (word == null){ word = new Word(wordName); words.put(wordName, word); } return word; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private static Filter newFilter()\r\n {\r\n Filter filter = new Filter(\"filter1\", new Source(\"display1\", \"name1\", \"server\", \"key1\"));\r\n filter.getOtherSources().add(filter.getSource());\r\n Group group = new Group();\r\n group.addFilterCriteria(new Criteria(\"field1\", Co...
[ "0.5444329", "0.5342161", "0.5293217", "0.5273742", "0.52000695", "0.51993865", "0.51993865", "0.5137831", "0.5106418", "0.5092942", "0.5088498", "0.50646657", "0.5026058", "0.499525", "0.49883556", "0.49743056", "0.4964455", "0.4954479", "0.4951456", "0.49224803", "0.4915494...
0.0
-1
Called when an item has been stored.
void onItemStored(EntityId storedItem);
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void store(Item item) {\n this.items.add(item);\n }", "@Override\n\tItem save(Item item);", "public void onSetNewCurrentItem() {\n }", "public void handleStore()\r\n {\r\n //\r\n }", "public void save(Item item) {\r\n \t\tpersistenceManager.save(item);\r\n \t}", "protected vo...
[ "0.7093229", "0.6623451", "0.6455247", "0.6367681", "0.62596285", "0.61556625", "0.6087866", "0.60846806", "0.6077842", "0.6057684", "0.6039786", "0.6039786", "0.6032316", "0.6031709", "0.5996691", "0.5993159", "0.596024", "0.59145457", "0.5912879", "0.5908252", "0.5882246", ...
0.7251406
0
Called when an item has been dropped.
void onItemDropped(EntityId droppedItem);
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "void onDropped();", "void onDrop(int from, int to);", "public interface DropListener {\n\t\n\t/**\n\t * Called when an item is to be dropped.\n\t * @param from - index item started at.\n\t * @param to - index to place item at.\n\t */\n\tvoid onDrop(int from, int to);\n}", "private void dropped(HeroItem item,...
[ "0.76469743", "0.7115269", "0.70639575", "0.70027274", "0.6982976", "0.697036", "0.69101954", "0.688341", "0.68129", "0.6770748", "0.669499", "0.66838026", "0.6617167", "0.657801", "0.6576419", "0.65617085", "0.65612555", "0.6536216", "0.65086824", "0.64774996", "0.64350545",...
0.81873107
0
creates a GObject instance of a deck
public GDeck(Deck startdeck){ cards=startdeck; add(back=new GImage(((GCard)startdeck.get(0)).getBackImage().getImage())); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public Deck() {\n generateDeckOfCards();\n }", "public void createDeck(){\n //Does nothing because it will be overridden in the child classes.\n }", "private Pile createDeck() {\n \t\tPile deck = new Pile(\"deck\"); // TODO Refactor, no hardcoded string\n\t\tpileNames.add(\"deck\");\n \t\tf...
[ "0.72849053", "0.70248157", "0.69753385", "0.689712", "0.6893141", "0.684197", "0.6772485", "0.6675049", "0.6664046", "0.66399837", "0.6628198", "0.6581082", "0.656239", "0.6553608", "0.6549225", "0.6519147", "0.6517799", "0.6516865", "0.6506769", "0.647555", "0.64073545", ...
0.6594073
11
returns the deck used by the GDeck
public Deck getDeck(){ return cards; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public Deck getDeck() {\n\t\treturn deck;\n\t}", "public CardDeck cardDeck(){\r\n\t\treturn deck;\r\n\t}", "public Deck getDeck() {\n\t\treturn this.deck;\n\t}", "public CardDeck getCardDeck() {\n return cardDeck;\n }", "public ArrayList<Card> getDeck()\n {\n return deck;\n }", "pu...
[ "0.7579105", "0.7548552", "0.7528196", "0.7175975", "0.69428205", "0.6936485", "0.6849949", "0.68267894", "0.6742814", "0.6737536", "0.67177373", "0.6713053", "0.66988695", "0.65751565", "0.6526635", "0.6521507", "0.65194625", "0.64813423", "0.6450335", "0.63770086", "0.63651...
0.69935143
4
returns the image used by the back of the deck
public GImage getBack(){ return back; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private Image getBackImage() {\n return getImage(\"playing-cards/blue-back.png\");\n }", "public Image deckImage() {\n if (this.size() == 0) {\n return getImageFromStream(\"graphics/empty_deck.png\");\n }\n return getImageFromStream(this.topCard().getImageSource());\n ...
[ "0.79224235", "0.7649302", "0.6984779", "0.685439", "0.6703633", "0.66994864", "0.658462", "0.65837455", "0.65679044", "0.65408474", "0.6540846", "0.6491198", "0.64640707", "0.6420549", "0.64011914", "0.63999087", "0.6380434", "0.6376176", "0.635493", "0.6321197", "0.6301168"...
0.6740726
4
Test of getFirst method, of class TestDataGenerator.
@org.junit.Test public void testGetFirst() { System.out.println("getFirst"); TestDataGenerator instance = new TestDataGenerator(); First result = instance.getFirst(); // Assert.assertEquals("Here is a string to check", result.getOruString()); Assert.assertEquals(444422, result.getOruInt()); Assert.assertTrue(result.isOruBoolean()); Assert.assertEquals(8.8886664E7f, result.getOruFloat(), 0); Assert.assertEquals(5555533333222L, result.getOruLong()); Assert.assertEquals(9.99966663322E9, result.getOruDoble(), 0); Assert.assertEquals(OruEnum.FIRST_ENUM, result.getOruEnum()); Assert.assertNotNull(result.getSecond()); // Second // Assert.assertEquals(531223, result.getSecond().getSecondInt()); Assert.assertEquals(666666666L, result.getSecond().getOruLong()); Assert.assertEquals("Here is a second String", result.getSecond().getSecondString()); Assert.assertFalse(result.getSecond().isSecondBoolean()); Assert.assertEquals(4444.333f, result.getSecond().getSecondFloat(), 0); Assert.assertEquals(555555.55555, result.getSecond().getSecondDoble(), 0); Assert.assertNotNull(result.getListOfThrird()); //Collection Assert.assertEquals(3, result.getListOfThrird().size()); // 1 Thrird thrird = result.getListOfThrird().get(0); Assert.assertEquals(0, thrird.getThrirdInt()); Assert.assertEquals(0L, thrird.getThrirdLong()); Assert.assertEquals("Thrird String 0", thrird.getThrirdString()); Assert.assertTrue(thrird.isThrirdBoolean()); Assert.assertEquals(0.0f, thrird.getThrirdFloat(), 0); Assert.assertEquals(0.0, thrird.getThrirdDoble(), 0); // 2 Thrird thrird2 = result.getListOfThrird().get(1); Assert.assertEquals(1, thrird2.getThrirdInt()); Assert.assertEquals(1L, thrird2.getThrirdLong()); Assert.assertEquals("Thrird String 1", thrird2.getThrirdString()); Assert.assertTrue(thrird2.isThrirdBoolean()); Assert.assertEquals(1.0f, thrird2.getThrirdFloat(), 0); Assert.assertEquals(1.0, thrird2.getThrirdDoble(), 0); // 3 Thrird thrird3 = result.getListOfThrird().get(2); Assert.assertEquals(2, thrird3.getThrirdInt()); Assert.assertEquals(2L, thrird3.getThrirdLong()); Assert.assertEquals("Thrird String 2", thrird3.getThrirdString()); Assert.assertTrue(thrird3.isThrirdBoolean()); Assert.assertEquals(2.0f, thrird3.getThrirdFloat(), 0); Assert.assertEquals(2.0, thrird3.getThrirdDoble(), 0); Assert.assertNotNull(result.getCollectionOfObjects()); //Collection //Support for [java.util.HashMap$KeySet] is yet to be added Assert.assertNotNull(result.getMapOfThrird()); //MAP Assert.assertEquals(5, result.getMapOfThrird().size()); // 1 Thrird thrird4 = result.getMapOfThrird().get("KEY_12"); Assert.assertEquals(12, thrird4.getThrirdInt()); Assert.assertEquals(12L, thrird4.getThrirdLong()); Assert.assertEquals("Thrird String 12", thrird4.getThrirdString()); Assert.assertTrue(thrird4.isThrirdBoolean()); Assert.assertEquals(12.0f, thrird4.getThrirdFloat(), 0); Assert.assertEquals(12.0, thrird4.getThrirdDoble(), 0); // 1 Thrird thrird5 = result.getMapOfThrird().get("KEY_11"); Assert.assertEquals(11, thrird5.getThrirdInt()); Assert.assertEquals(11L, thrird5.getThrirdLong()); Assert.assertEquals("Thrird String 11", thrird5.getThrirdString()); Assert.assertTrue(thrird5.isThrirdBoolean()); Assert.assertEquals(11.0f, thrird5.getThrirdFloat(), 0); Assert.assertEquals(11.0, thrird5.getThrirdDoble(), 0); // 1 Thrird thrird6 = result.getMapOfThrird().get("KEY_14"); Assert.assertEquals(14, thrird6.getThrirdInt()); Assert.assertEquals(14L, thrird6.getThrirdLong()); Assert.assertEquals("Thrird String 14", thrird6.getThrirdString()); Assert.assertTrue(thrird6.isThrirdBoolean()); Assert.assertEquals(14.0f, thrird6.getThrirdFloat(), 0); Assert.assertEquals(14.0, thrird6.getThrirdDoble(), 0); // 1 Thrird thrird7 = result.getMapOfThrird().get("KEY_13"); Assert.assertEquals(13, thrird7.getThrirdInt()); Assert.assertEquals(13L, thrird7.getThrirdLong()); Assert.assertEquals("Thrird String 13", thrird7.getThrirdString()); Assert.assertTrue(thrird7.isThrirdBoolean()); Assert.assertEquals(13.0f, thrird7.getThrirdFloat(), 0); Assert.assertEquals(13.0, thrird7.getThrirdDoble(), 0); // 1 Thrird thrird8 = result.getMapOfThrird().get("KEY_10"); Assert.assertEquals(10, thrird8.getThrirdInt()); Assert.assertEquals(10L, thrird8.getThrirdLong()); Assert.assertEquals("Thrird String 10", thrird8.getThrirdString()); Assert.assertTrue(thrird8.isThrirdBoolean()); Assert.assertEquals(10.0f, thrird8.getThrirdFloat(), 0); Assert.assertEquals(10.0, thrird8.getThrirdDoble(), 0); Assert.assertNotNull(result.getMapOfObjects()); //MAP Assert.assertEquals(8, result.getMapOfObjects().size()); Assert.assertEquals("VALUE_7", result.getMapOfObjects().get("KEY_FOR_STRING")); Assert.assertEquals("VALUE_1", result.getMapOfObjects().get(new Character('1'))); Assert.assertEquals("VALUE_7", result.getMapOfObjects().get(new Double(123456.7890625))); Assert.assertEquals("VALUE_4", result.getMapOfObjects().get(new Integer(1234567))); Assert.assertEquals("VALUE_6", result.getMapOfObjects().get(new Float(1234.56F))); Assert.assertEquals("VALUE_5", result.getMapOfObjects().get(new Long(1234567891011L))); Assert.assertEquals("VALUE_3", result.getMapOfObjects().get(new Short((short) 12345))); Assert.assertEquals("VALUE_2", result.getMapOfObjects().get(new Byte((byte) 123))); Assert.assertNotNull(result.getArrayOfThrird()); //Array Assert.assertEquals(5, result.getArrayOfThrird().length); // 1 Thrird thrird9 = result.getArrayOfThrird()[0]; Assert.assertEquals(0, thrird9.getThrirdInt()); Assert.assertEquals(0L, thrird9.getThrirdLong()); Assert.assertEquals("Thrird String 0", thrird9.getThrirdString()); Assert.assertTrue(thrird9.isThrirdBoolean()); Assert.assertEquals(0.0f, thrird9.getThrirdFloat(), 0); Assert.assertEquals(0.0, thrird9.getThrirdDoble(), 0); // 2 Thrird thrird10 = result.getArrayOfThrird()[1]; Assert.assertEquals(1, thrird10.getThrirdInt()); Assert.assertEquals(1L, thrird10.getThrirdLong()); Assert.assertEquals("Thrird String 1", thrird10.getThrirdString()); Assert.assertTrue(thrird10.isThrirdBoolean()); Assert.assertEquals(1.0f, thrird10.getThrirdFloat(), 0); Assert.assertEquals(1.0, thrird10.getThrirdDoble(), 0); // 3 Thrird thrird11 = result.getArrayOfThrird()[2]; Assert.assertEquals(2, thrird11.getThrirdInt()); Assert.assertEquals(2L, thrird11.getThrirdLong()); Assert.assertEquals("Thrird String 2", thrird11.getThrirdString()); Assert.assertTrue(thrird11.isThrirdBoolean()); Assert.assertEquals(2.0f, thrird11.getThrirdFloat(), 0); Assert.assertEquals(2.0, thrird11.getThrirdDoble(), 0); // 4 Assert.assertNull(result.getArrayOfThrird()[3]); // 5 Assert.assertNull(result.getArrayOfThrird()[4]); Assert.assertNotNull(result.getArrayOfString()); //Array Assert.assertEquals(3, result.getArrayOfString().length); // 1 Assert.assertEquals("array_1", result.getArrayOfString()[0]); // 2 Assert.assertEquals("array_2", result.getArrayOfString()[1]); // 3 Assert.assertEquals("arrat_3", result.getArrayOfString()[2]); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Test\r\n\tpublic void testGetFirst() {\n\t}", "@Test\r\n\tvoid testFirst() {\r\n\t\tSimpleList test = new SimpleList();\r\n\t\ttest.add(3);\r\n\t\ttest.add(7);\r\n\t\ttest.add(10);\r\n\t\tint output = test.first();\r\n\t\tassertEquals(10, output);\r\n\t}", "public Object getFirst()\n {\n if(first == n...
[ "0.7423596", "0.71160495", "0.6777389", "0.6633933", "0.65096134", "0.64711416", "0.64711416", "0.6469377", "0.64328456", "0.63558143", "0.62582695", "0.62101585", "0.61702853", "0.6145823", "0.6109989", "0.610733", "0.6087615", "0.6057123", "0.6050599", "0.60347074", "0.6022...
0.7656511
0
Iterates through all the obs in the test obs group and returns the first one that who concept matches the specified concept Returns null if obs not found
public static Obs getObsFromObsGroup(Concept concept, Obs group) { if (group.getGroupMembers() != null) { for(Obs obs : group.getGroupMembers()) { // need to check for voided obs here because getGroupMembers returns voided obs if (!obs.isVoided() && obs.getConcept().equals(concept)) { return obs; } } } return null; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public static Obs getObsFromEncounter(Concept concept, Encounter encounter) {\r\n \t\tif (encounter.getObsAtTopLevel(false) != null) {\r\n \t\t\tfor (Obs obs : encounter.getObsAtTopLevel(false)) {\r\n \t\t\t\tif (!obs.isVoided() && obs.getConcept().equals(concept)) {\r\n \t\t\t\t\treturn obs;\r\n \t\t\t\t}\r\...
[ "0.61701703", "0.58510864", "0.559697", "0.5406479", "0.50594085", "0.50572866", "0.50027233", "0.49168068", "0.48724988", "0.48717177", "0.4869902", "0.4834917", "0.4834917", "0.47615987", "0.4748868", "0.46369568", "0.45799226", "0.4560637", "0.455278", "0.45433682", "0.453...
0.6482924
0
Iterates through all the toplevel obs in the encounter and returns the first one that who concept matches the specified concept Returns null if obs not found
public static Obs getObsFromEncounter(Concept concept, Encounter encounter) { if (encounter.getObsAtTopLevel(false) != null) { for (Obs obs : encounter.getObsAtTopLevel(false)) { if (!obs.isVoided() && obs.getConcept().equals(concept)) { return obs; } } } return null; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private ReportConcept getRelatedConcept(ReportConcept entry) {\n\t\t// if completly removed, no point in searching\n\t\tif(entry.getLabels().isEmpty())\n\t\t\treturn null;\n\t\t\n\t\tfor (ReportConcept c : concepts) {\n\t\t\t// labels in the new concept are contained within the old concept label list\n\t\t\tif(Col...
[ "0.5761497", "0.5560187", "0.5521394", "0.5383434", "0.5360984", "0.5330298", "0.5288472", "0.51673263", "0.5161279", "0.5144387", "0.5140436", "0.50394946", "0.4998132", "0.49879074", "0.49787405", "0.49309", "0.4899175", "0.48889568", "0.48758575", "0.48758575", "0.48751277...
0.71822035
0
Gets the antiretroviral regimens for a current patient
public static List<Regimen> getAntiretroviralRegimens(Patient patient) { if (patient == null) { return null; } return RegimenUtils.getHivRegimenHistory(patient).getAllRegimens(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public List<Ant> getAnts()\n {\n return ants;\n }", "@Override\n\tpublic List<Patientstreatments> getallpatienttreat() {\n\t\treturn patreatrep.findAll();\n\t}", "public ArrayList<Patient> getPatients() {\n return this.patients;\n }", "public Ant[] getAnts() {\n\t\treturn this.Ants;\n\t}", "...
[ "0.5772469", "0.5765891", "0.5590592", "0.5541417", "0.543835", "0.54057723", "0.53950775", "0.5346555", "0.5328192", "0.52412784", "0.52203745", "0.5206543", "0.5158511", "0.5151448", "0.5148062", "0.51128983", "0.51115316", "0.51029575", "0.5088516", "0.5076173", "0.5057593...
0.7980375
0
Returns a set of all encounter types associated with the MDRTB Program
public static Set<EncounterType> getMdrtbEncounterTypes() { Set<EncounterType> types = new HashSet<EncounterType>(); types.add(Context.getEncounterService().getEncounterType(Context.getAdministrationService().getGlobalProperty("mdrtb.intake_encounter_type"))); types.add(Context.getEncounterService().getEncounterType(Context.getAdministrationService().getGlobalProperty("mdrtb.follow_up_encounter_type"))); types.add(Context.getEncounterService().getEncounterType(Context.getAdministrationService().getGlobalProperty("mdrtb.specimen_collection_encounter_type"))); return types; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public static Set<Type> getBiomeTypes() {\n\t\ttry {\n\t\t\tfinal Field accessor = ReflectionHelper.findField(BiomeDictionary.Type.class, \"byName\");\n\t\t\tif (accessor != null) {\n\t\t\t\t@SuppressWarnings(\"unchecked\")\n\t\t\t\tfinal Map<String, BiomeDictionary.Type> stuff = (Map<String, BiomeDictionary.Type>...
[ "0.5809285", "0.5741359", "0.56826717", "0.5505921", "0.54804295", "0.5480162", "0.5469237", "0.5463696", "0.5461257", "0.5460286", "0.5458301", "0.54407686", "0.54407686", "0.5440561", "0.5417942", "0.54141533", "0.5410454", "0.5392001", "0.5388452", "0.5241188", "0.52121603...
0.72085625
0
Returns all the concepts that represent positive results for a smear or culture
public static Set<Concept> getPositiveResultConcepts() { MdrtbService service = Context.getService(MdrtbService.class); // create a list of all concepts that represent positive results Set<Concept> positiveResults = new HashSet<Concept>(); positiveResults.add(service.getConcept(MdrtbConcepts.STRONGLY_POSITIVE)); positiveResults.add(service.getConcept(MdrtbConcepts.MODERATELY_POSITIVE)); positiveResults.add(service.getConcept(MdrtbConcepts.WEAKLY_POSITIVE)); positiveResults.add(service.getConcept(MdrtbConcepts.POSITIVE)); positiveResults.add(service.getConcept(MdrtbConcepts.SCANTY)); return positiveResults; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public static Integer [] getPositiveResultConceptIds() {\r\n \tSet<Concept> positiveConcepts = getPositiveResultConcepts();\r\n \tInteger [] positiveResultIds = new Integer[positiveConcepts.size()];\r\n \t\r\n \tint i = 0;\r\n \tfor (Concept positiveConcept : positiveConcepts) {\r\n \t\tpositiveR...
[ "0.575063", "0.5566088", "0.5535189", "0.54106104", "0.5405572", "0.5388577", "0.5223758", "0.51491714", "0.509736", "0.5056353", "0.5056242", "0.50464314", "0.50459784", "0.5018289", "0.5017012", "0.50133663", "0.4954861", "0.49450648", "0.49338275", "0.4912781", "0.49108782...
0.7723358
0
Returns the concept ids of all the concepts that represent positive results for a smear or culture
public static Integer [] getPositiveResultConceptIds() { Set<Concept> positiveConcepts = getPositiveResultConcepts(); Integer [] positiveResultIds = new Integer[positiveConcepts.size()]; int i = 0; for (Concept positiveConcept : positiveConcepts) { positiveResultIds[i] = positiveConcept.getConceptId(); i++; } return positiveResultIds; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public static Set<Concept> getPositiveResultConcepts() {\r\n \tMdrtbService service = Context.getService(MdrtbService.class);\r\n \t\r\n \t// create a list of all concepts that represent positive results\r\n \tSet<Concept> positiveResults = new HashSet<Concept>();\r\n \tpositiveResults.add(service.g...
[ "0.75711095", "0.5432642", "0.5181685", "0.5112589", "0.5110684", "0.5061149", "0.5050232", "0.5018231", "0.5018231", "0.49741885", "0.49317434", "0.49244174", "0.4901812", "0.4822839", "0.476017", "0.47549745", "0.47429666", "0.47226086", "0.47126785", "0.4674551", "0.467040...
0.77154744
0
Loads and sorts the drugs stored in the global property mdtrb.defaultDstDrugs
public static List<List<Object>> getDefaultDstDrugs() { List<List<Object>> drugs = new LinkedList<List<Object>>(); String defaultDstDrugs = Context.getAdministrationService().getGlobalProperty("mdrtb.defaultDstDrugs"); if(StringUtils.isNotBlank(defaultDstDrugs)) { // split on the pipe for (String drugString : defaultDstDrugs.split("\\|")) { // now split into a name and concentration String drug = drugString.split(":")[0]; String concentration = null; if (drugString.split(":").length > 1) { concentration = drugString.split(":")[1]; } try { // see if this is a concept id Integer conceptId = Integer.valueOf(drug); Concept concept = Context.getConceptService().getConcept(conceptId); if (concept == null) { log.error("Unable to find concept referenced by id " + conceptId); } // add the concept/concentration pair to the list else { addDefaultDstDrugToMap(drugs, concept, concentration); } } catch (NumberFormatException e) { // if not a concept id, must be a concept map Concept concept = Context.getService(MdrtbService.class).getConcept(drug); if (concept == null) { log.error("Unable to find concept referenced by " + drug); } // add the concept to the list else { addDefaultDstDrugToMap(drugs, concept, concentration); } } } } return drugs; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public static List<Concept> sortMdrtbDrugs(List<Concept> drugs) {\r\n \treturn MdrtbUtil.sortDrugs(drugs, Context.getService(MdrtbService.class).getMdrtbDrugs());\r\n }", "private static void addDefaultDstDrugToMap(List<List<Object>> drugs, Concept concept, String concentration) {\r\n \tList<Object> dat...
[ "0.5323872", "0.52932495", "0.52539563", "0.5066209", "0.5004715", "0.49762425", "0.48990893", "0.48736483", "0.486484", "0.48211503", "0.47279164", "0.4696114", "0.46821135", "0.46759748", "0.4660434", "0.46394292", "0.4616335", "0.46157032", "0.45707455", "0.45688966", "0.4...
0.6669869
0
Private helper method used by getDefaultDstDrugs (Adds an element to the default dst drug map)
private static void addDefaultDstDrugToMap(List<List<Object>> drugs, Concept concept, String concentration) { List<Object> data = new LinkedList<Object>(); data.add(concept); data.add(concentration); drugs.add(data); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public static List<List<Object>> getDefaultDstDrugs() {\r\n \tList<List<Object>> drugs = new LinkedList<List<Object>>();\r\n \t\r\n \tString defaultDstDrugs = Context.getAdministrationService().getGlobalProperty(\"mdrtb.defaultDstDrugs\");\r\n \t\r\n \tif(StringUtils.isNotBlank(defaultDstDrugs)) {\r...
[ "0.57005715", "0.52200043", "0.506573", "0.50398415", "0.4790402", "0.4752547", "0.4700067", "0.46857578", "0.4683986", "0.46728227", "0.46164107", "0.46111813", "0.45968208", "0.4581031", "0.45654708", "0.45609224", "0.4554941", "0.45516947", "0.45425946", "0.44994736", "0.4...
0.6447507
0
Given a list of concepts, sorts them in the same order as the list of MDRTB drugs (All nonMDRTB drugs are ignored) returns by getMdrtbDrugs(); all nonMDRTB drug are ignored
public static List<Concept> sortMdrtbDrugs(List<Concept> drugs) { return MdrtbUtil.sortDrugs(drugs, Context.getService(MdrtbService.class).getMdrtbDrugs()); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public static List<Concept> sortAntiretrovirals(List<Concept> drugs) {\r\n \treturn MdrtbUtil.sortDrugs(drugs, Context.getService(MdrtbService.class).getAntiretrovirals());\r\n }", "public static List<Concept> sortDrugs(List<Concept> drugsToSort, List<Concept> drugList) {\r\n \tList<Concept> sortedDrugs...
[ "0.7084605", "0.62652874", "0.53187037", "0.5162626", "0.5152054", "0.508789", "0.4973391", "0.49361765", "0.488646", "0.48667815", "0.48447508", "0.48097667", "0.47842604", "0.47695136", "0.4767664", "0.4751956", "0.47359872", "0.4705836", "0.47043777", "0.4695951", "0.46819...
0.77176017
0
Given a list of concepts, sorts them in the same order as the list of antiretrovirals (All nonantiretrovirals are ignored)
public static List<Concept> sortAntiretrovirals(List<Concept> drugs) { return MdrtbUtil.sortDrugs(drugs, Context.getService(MdrtbService.class).getAntiretrovirals()); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void sortKnowledgeBase()\n {\n int i;\n Random random;\n String aPredicate;\n StringTokenizer tokenizer;\n //------------\n random = new Random();\n i = 0;\n while (i < knowledgeBase.size())\n {\n aPredicate = knowledgeBase.get(i)....
[ "0.6189086", "0.57339853", "0.56990254", "0.5693796", "0.5677007", "0.5583864", "0.5566038", "0.54993033", "0.5496587", "0.54414606", "0.53280365", "0.531288", "0.5300183", "0.52893645", "0.52701825", "0.5268494", "0.52667356", "0.52587247", "0.5175317", "0.51711184", "0.5169...
0.6885932
0
Given a list of drugs to sort and a drug list, sorts the first list so that the drugs are in the same order as the second list; any drugs in the list to sort not found in the drug list are discarded
public static List<Concept> sortDrugs(List<Concept> drugsToSort, List<Concept> drugList) { List<Concept> sortedDrugs = new LinkedList<Concept>(); for (Concept drug : drugList) { if (drugsToSort.contains(drug)) { sortedDrugs.add(drug); } } return sortedDrugs; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public static List<Concept> sortAntiretrovirals(List<Concept> drugs) {\r\n \treturn MdrtbUtil.sortDrugs(drugs, Context.getService(MdrtbService.class).getAntiretrovirals());\r\n }", "public static List<Concept> sortMdrtbDrugs(List<Concept> drugs) {\r\n \treturn MdrtbUtil.sortDrugs(drugs, Context.getServi...
[ "0.7007435", "0.7001435", "0.62898916", "0.62316185", "0.61154246", "0.5905174", "0.58473235", "0.5826852", "0.56608635", "0.55827636", "0.55643606", "0.55066496", "0.55050623", "0.5502904", "0.5497833", "0.5497535", "0.54966277", "0.54431874", "0.5436038", "0.5420828", "0.54...
0.8213171
0
Gets a specific ProgramWorkflowState, given the concept associated with the state
public static ProgramWorkflowState getProgramWorkflowState(Concept programWorkflowStateConcept) { for (ProgramWorkflowState state : Context.getProgramWorkflowService().getStates()) { if (state.getConcept().equals(programWorkflowStateConcept)) { return state; } } return null; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "State findByResource( int nIdResource, String strResourceType, int nIdWorkflow );", "State getState(Long stateId);", "public State getState(String stateName) {\r\n return processModel.getState(stateName);\r\n }", "public WorkflowConfig getWorkflow(String name) {\n if (!this.workflows.con...
[ "0.62805223", "0.5768522", "0.56607926", "0.5518876", "0.55138713", "0.54240704", "0.54226387", "0.5371251", "0.5296612", "0.5273471", "0.5273471", "0.52330303", "0.52156115", "0.52084804", "0.52084804", "0.52084804", "0.52084804", "0.5206529", "0.51870215", "0.5177714", "0.5...
0.81735957
0
Autoassign a patient identifier for a specific identifier type, if required, if the idgen module is installed, using reflection Auto generated method comment
@SuppressWarnings("unchecked") public static String assignIdentifier(PatientIdentifierType type) { try { Class identifierSourceServiceClass = Context.loadClass("org.openmrs.module.idgen.service.IdentifierSourceService"); Object idgen = Context.getService(identifierSourceServiceClass); Method generateIdentifier = identifierSourceServiceClass.getMethod("generateIdentifier", PatientIdentifierType.class, String.class); // note that generate identifier returns null if this identifier type is not set to be auto-generated return (String) generateIdentifier.invoke(idgen, type, "auto-assigned during patient creation"); } catch (Exception e) { log.error("Unable to access IdentifierSourceService for automatic id generation. Is the Idgen module installed and up-to-date?", e); } return null; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private void AutoID() {\n throw new UnsupportedOperationException(\"Not supported yet.\"); //To change body of generated methods, choose Tools | Templates.\n }", "public void setIdentifier(String value) {\n/* 214 */ setValue(\"identifier\", value);\n/* */ }", "protected abstract String getI...
[ "0.6425427", "0.60381746", "0.60011107", "0.5962061", "0.595554", "0.59268934", "0.5890715", "0.58829325", "0.5872755", "0.5851047", "0.5836524", "0.5795335", "0.5743407", "0.5718336", "0.56960106", "0.56942445", "0.56764334", "0.56664896", "0.56664896", "0.56664896", "0.5666...
0.7420709
0
Given a concept, locale, and a string that represents a concept name tag, returns the first concept name for that concept that matches the language and is tagged with the specified tag
public static ConceptName getConceptName(Concept concept, String language, String conceptNameTag) { if (concept == null) { log.error("No concept provided to findConceptName"); return null; } ConceptNameTag tag = Context.getConceptService().getConceptNameTagByName(conceptNameTag); if (tag == null) { log.warn("Invalid concept name tag parameter " + conceptNameTag + " passed to findConceptName"); } for (ConceptName name : concept.getNames()) { if ((language == null || name.getLocale() == null || name.getLocale().getLanguage() == null || name.getLocale().getLanguage().equals(language)) && ((tag == null) || (name.getTags().contains(tag)))) { return name; } } return null; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "Concept getConceptName();", "public static String getLabel(URI concept, Rdf2GoCore repo, String languageTag) {\n\n\t\t// try to find language specific label\n\t\tString label = getLanguageSpecificLabel(concept, repo, languageTag);\n\n\t\t// otherwise use standard label\n\t\tif (label == null) {\n\n\t\t\tString l...
[ "0.60524654", "0.60172415", "0.5491103", "0.5382409", "0.5377872", "0.53664064", "0.5337004", "0.5269337", "0.51773316", "0.5174776", "0.51712507", "0.5065294", "0.49709713", "0.49574617", "0.49388912", "0.49292046", "0.49207643", "0.49120265", "0.49091554", "0.48961097", "0....
0.7300595
0
Configures the default values for a Test, based on the existing values for other tests in the specimen Implements the following rule: If this is the first test, and the specimen has a sample id, set the accession field with this sample id. If this is not the first test, then If the Accession on all the existing tests and the sample ID on the specimen are all the same, set the accession field with this number. If the Lab, Date Ordered, or Date Received on all the existing tests are identical, set these fields with these values.
public static void setTestDefaults(Specimen specimen, Test test) { Set<String> accessionNumberSet = new HashSet<String>(); Set<Date> dateOrderedSet = new HashSet<Date>(); Set<Date> dateReceivedSet = new HashSet<Date>(); Set<Location> labSet = new HashSet<Location>(); // first add the identifier of the sample to the accession number set accessionNumberSet.add(specimen.getIdentifier()); // now loop through all the tests for this sample, excluding the test we want to set the defaults for for (Test t : specimen.getTests()) { if (t != test) { accessionNumberSet.add(t.getAccessionNumber()); dateOrderedSet.add(t.getDateOrdered()); dateReceivedSet.add(t.getDateReceived()); labSet.add(t.getLab()); } } // test if any of are sets contain exactly one non-null member if (accessionNumberSet.size() == 1 && !accessionNumberSet.contains(null)) { test.setAccessionNumber(accessionNumberSet.iterator().next()); } if (dateOrderedSet.size() == 1 && !dateOrderedSet.contains(null)) { test.setDateOrdered(dateOrderedSet.iterator().next()); } if (dateReceivedSet.size() == 1 && !dateReceivedSet.contains(null)) { test.setDateReceived(dateReceivedSet.iterator().next()); } if (labSet.size() == 1 && !labSet.contains(null)) { test.setLab(labSet.iterator().next()); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void fillDefaultValues() {\n checkUsingAdaptation();\n tfSemiSaturation.setText(Double.toString(prototypeRule\n .getSemiSaturationConstant()));\n tfSteepness.setText(Double.toString(prototypeRule.getSteepness()));\n tfTimeConstant\n .setText(Double.t...
[ "0.55674464", "0.526806", "0.52319765", "0.51640654", "0.5120461", "0.5100507", "0.5085248", "0.5081487", "0.508137", "0.5040002", "0.5036663", "0.50273293", "0.50135595", "0.49865097", "0.4981109", "0.49538532", "0.4941956", "0.4933536", "0.49128085", "0.49041435", "0.488485...
0.779335
0
Utility method to return patients matching passed criteria
public static Cohort getMdrPatients(String identifier, String name, String enrollment, Location location, List<ProgramWorkflowState> states) { Cohort cohort = Context.getPatientSetService().getAllPatients(); MdrtbService ms = (MdrtbService) Context.getService(MdrtbService.class); Date now = new Date(); Program mdrtbProgram = ms.getMdrtbProgram(); if ("current".equals(enrollment)) { Cohort current = Context.getPatientSetService().getPatientsInProgram(mdrtbProgram, now, now); cohort = Cohort.intersect(cohort, current); } else { Cohort ever = Context.getPatientSetService().getPatientsInProgram(mdrtbProgram, null, null); if ("previous".equals(enrollment)) { Cohort current = Context.getPatientSetService().getPatientsInProgram(mdrtbProgram, now, now); Cohort previous = Cohort.subtract(ever, current); cohort = Cohort.intersect(cohort, previous); } else if ("never".equals(enrollment)) { cohort = Cohort.subtract(cohort, ever); } else { cohort = Cohort.intersect(cohort, ever); } } if (StringUtils.isNotBlank(name) || StringUtils.isNotBlank(identifier)) { name = "".equals(name) ? null : name; identifier = "".equals(identifier) ? null : identifier; Cohort nameIdMatches = new Cohort(Context.getPatientService().getPatients(name, identifier, null, false)); cohort = Cohort.intersect(cohort, nameIdMatches); } // If Location is specified, limit to patients at this Location if (location != null) { CohortDefinition lcd = Cohorts.getLocationFilter(location, now, now); Cohort locationCohort; try { locationCohort = Context.getService(CohortDefinitionService.class).evaluate(lcd, new EvaluationContext()); } catch (EvaluationException e) { throw new MdrtbAPIException("Unable to evalute location cohort",e); } cohort = Cohort.intersect(cohort, locationCohort); } if (states != null) { Cohort inStates = Context.getPatientSetService().getPatientsByProgramAndState(null, states, now, now); cohort = Cohort.intersect(cohort, inStates); } return cohort; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "List<Patient> findPatients(Employee nurse_id);", "public Patient[] findID(String sv)\r\n\t{\r\n\t\tPatient[] foundPatients = new Patient[999];//Creates a blank array\r\n\t\tint count = 0;\r\n\r\n\t\tfor(int i=0; arrayPatients[i]!=null ;i++)//loops through the array\r\n\t\t{\r\n\t\t\tif(arrayPatients[i].forename....
[ "0.6467302", "0.6292085", "0.62456286", "0.6084717", "0.6048174", "0.59881073", "0.5986975", "0.59810776", "0.5972641", "0.5896138", "0.58835876", "0.5861339", "0.5861288", "0.5860845", "0.5803742", "0.5790233", "0.5766299", "0.57403", "0.5702295", "0.56609243", "0.56541884",...
0.0
-1
Tests whether a String is parseable as an Integer
public static boolean isInteger(String string) { try { Integer.valueOf(string); return true; } catch (NumberFormatException e) { return false; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private static boolean isInteger(String s) {\r\n try {\r\n Integer.parseInt(s);\r\n return true;\r\n } catch (Exception ex) {\r\n return false;\r\n }\r\n }", "public static boolean isInteger(String s) {\n\t try { \n\t Integer.parseInt(s); \n\t ...
[ "0.8072236", "0.805301", "0.8044199", "0.8023588", "0.7995572", "0.79865175", "0.7979776", "0.79611087", "0.7960647", "0.7956789", "0.79522365", "0.7940468", "0.7899568", "0.78832614", "0.7873818", "0.7859028", "0.78371793", "0.7829081", "0.77837056", "0.778021", "0.7775542",...
0.7723095
23
Returns true/false if all the fields in the address are empty or null
public static Boolean isBlank(PersonAddress address) { return StringUtils.isBlank(address.getAddress1()) && StringUtils.isBlank(address.getAddress2()) && StringUtils.isBlank(address.getCityVillage()) && StringUtils.isBlank(address.getStateProvince()) && StringUtils.isBlank(address.getCountry()) && StringUtils.isBlank(address.getCountyDistrict()) && StringUtils.isBlank(address.getNeighborhoodCell()) && StringUtils.isBlank(address.getPostalCode()) && StringUtils.isBlank(address.getTownshipDivision()) && StringUtils.isBlank(address.getLatitude()) && StringUtils.isBlank(address.getLongitude()) && StringUtils.isBlank(address.getRegion()) && StringUtils.isBlank(address.getSubregion()) && StringUtils.isBlank(address.getPostalCode()); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private boolean haveEmptyField() {\n return getTextID(FIRST_NAME).isEmpty() ||\n getTextID(LAST_NAME).isEmpty() ||\n getTextID(ADDRESS).isEmpty();\n }", "public boolean hasAddress() {\n return addressBuilder_ != null || address_ != null;\n }", "public boolean ex...
[ "0.772036", "0.74495894", "0.73163956", "0.71123296", "0.6968735", "0.6958734", "0.6902509", "0.68945926", "0.68897974", "0.68897974", "0.6842642", "0.6828396", "0.68033653", "0.6787164", "0.6776514", "0.67338157", "0.6697312", "0.66204125", "0.65937823", "0.65674025", "0.653...
0.7231255
3
Utility method to return patients matching passed criteria. Difference between this and main method is that locations are matched by patient rayon
public static Cohort getMdrPatientsTJK(String identifier, String name, /*String enrollment,*/ Location location, String oblast, List<ProgramWorkflowState> states, Integer minage, Integer maxage, String gender, Integer year, String quarter, String month) { Cohort cohort = Context.getPatientSetService().getAllPatients(); MdrtbService ms = (MdrtbService) Context.getService(MdrtbService.class); Date now = new Date(); Program mdrtbProgram = ms.getMdrtbProgram(); Map<String, Date> dateMap = ReportUtil.getPeriodDates(year, quarter, month); Date startDate = (Date)(dateMap.get("startDate")); Date endDate = (Date)(dateMap.get("endDate")); CohortDefinition drtb = Cohorts.getEnrolledInMDRProgramDuring(startDate, endDate); try { Cohort enrollmentCohort = Context.getService(CohortDefinitionService.class).evaluate(drtb, new EvaluationContext()); cohort = Cohort.intersect(cohort, enrollmentCohort); } catch (EvaluationException e) { throw new MdrtbAPIException("Unable to evalute location cohort",e); } /*if ("current".equals(enrollment)) { Cohort current = Context.getPatientSetService().getPatientsInProgram(mdrtbProgram, now, now); cohort = Cohort.intersect(cohort, current); } else { Cohort ever = Context.getPatientSetService().getPatientsInProgram(mdrtbProgram, null, null); if ("previous".equals(enrollment)) { Cohort current = Context.getPatientSetService().getPatientsInProgram(mdrtbProgram, now, now); Cohort previous = Cohort.subtract(ever, current); cohort = Cohort.intersect(cohort, previous); } else if ("never".equals(enrollment)) { cohort = Cohort.subtract(cohort, ever); } else { cohort = Cohort.intersect(cohort, ever); } }*/ if (StringUtils.isNotBlank(name) || StringUtils.isNotBlank(identifier)) { name = "".equals(name) ? null : name; identifier = "".equals(identifier) ? null : identifier; Cohort nameIdMatches = new Cohort(Context.getPatientService().getPatients(name, identifier, null, false)); cohort = Cohort.intersect(cohort, nameIdMatches); } if (states != null) { Cohort inStates = Context.getPatientSetService().getPatientsByProgramAndState(null, states, now, now); cohort = Cohort.intersect(cohort, inStates); } Oblast o = null; if(!oblast.equals("") && location == null) o = Context.getService(MdrtbService.class).getOblast(Integer.parseInt(oblast)); List<Location> locList = new ArrayList<Location>(); if(o != null && location == null) locList = Context.getService(MdrtbService.class).getLocationsFromOblastName(o); else if (location != null) locList.add(location); CohortDefinition temp = null; CohortDefinition lcd = null; for(Location loc : locList) { temp = Cohorts.getLocationFilter(loc, null,null); if(lcd == null) lcd = temp; else lcd = ReportUtil.getCompositionCohort("OR", lcd, temp); } Cohort locationCohort; try { locationCohort = Context.getService(CohortDefinitionService.class).evaluate(lcd, new EvaluationContext()); } catch (EvaluationException e) { throw new MdrtbAPIException("Unable to evalute location cohort",e); } cohort = Cohort.intersect(cohort, locationCohort); // If Location is specified, limit to patients at this Location /*if (location != null) { CohortDefinition lcd = Cohorts.getLocationFilter(location, now, now); Cohort locationCohort; try { locationCohort = Context.getService(CohortDefinitionService.class).evaluate(lcd, new EvaluationContext()); } catch (EvaluationException e) { throw new MdrtbAPIException("Unable to evalute location cohort",e); } cohort = Cohort.intersect(cohort, locationCohort); }*/ /*// If Location is specified, limit to patients at this Location if (location != null) { //System.out.println("ENTERED!!!!!!!!!"); //System.out.println("L:" + location.getCountyDistrict()); Cohort fc = new Cohort(); Set<Integer> idSet = cohort.getMemberIds(); //System.out.println("SET SIZE:" + idSet.size()); Iterator<Integer> itr = idSet.iterator(); Integer idCheck = null; Patient patient = null; PersonAddress addr = null; PatientService ps = Context.getService(PatientService.class); while(itr.hasNext()) { idCheck = (Integer)itr.next(); patient = ps.getPatient(idCheck); addr = patient.getPersonAddress(); if(addr==null) continue; //System.out.println("A:"+ addr.getCountyDistrict()); if(areRussianStringsEqual(addr.getCountyDistrict(),location.getCountyDistrict())==true) fc.addMember(idCheck); } cohort = fc; }*/ if(minage != null || maxage != null) { Cohort ageCohort = new Cohort(); AgeAtMDRRegistrationCohortDefinition ageatEnrollmentCohort = new AgeAtMDRRegistrationCohortDefinition(); ageatEnrollmentCohort.setMaxAge(maxage); ageatEnrollmentCohort.setMinAge(minage); ageatEnrollmentCohort.setStartDate(startDate); ageatEnrollmentCohort.setEndDate(endDate); ; //eval.evaluate(ageatEnrollmentCohort, context) try { ageCohort = Context.getService(CohortDefinitionService.class).evaluate(ageatEnrollmentCohort, new EvaluationContext()); } catch (EvaluationException e) { throw new MdrtbAPIException("Unable to evalute age cohort",e); } /*Patient patient = null; Set<Integer> idSet = cohort.getMemberIds(); Iterator<Integer> itr = idSet.iterator(); Integer idCheck = null; PatientService ps = Context.getService(PatientService.class); boolean use = false; while(itr.hasNext()) { use = false; idCheck = (Integer)itr.next(); patient = ps.getPatient(idCheck); MdrtbService svc = Context.getService(MdrtbService.class); MdrtbPatientProgram mpp = svc.getMostRecentMdrtbPatientProgram(patient); Date tsd = mpp.getDateEnrolled(); //mpp.getTreatmentStartDateDuringProgram(); if(minage != null && maxage !=null ) { if(patient.getAge(tsd)>= minage.intValue() && patient.getAge(tsd)<= maxage.intValue() ) { use = true; } } else if(minage!=null) { if(patient.getAge(tsd)>= minage.intValue()) { use = true; } else use = false; } else if(maxage!=null) { if(patient.getAge(tsd)<= maxage.intValue()) { use = true; } else use = false; } if(use) { ageCohort.addMember(patient.getPatientId()); } }*/ cohort = Cohort.intersect(cohort, ageCohort); } if(gender!=null && gender.length()!=0) { Cohort genderCohort = new Cohort(); Patient patient = null; Set<Integer> idSet = cohort.getMemberIds(); Iterator<Integer> itr = idSet.iterator(); Integer idCheck = null; PatientService ps = Context.getService(PatientService.class); boolean use = false; while(itr.hasNext()) { use = false; idCheck = (Integer)itr.next(); patient = ps.getPatient(idCheck); if(patient.getGender().equalsIgnoreCase(gender)) { genderCohort.addMember(patient.getPatientId()); } } cohort = Cohort.intersect(cohort, genderCohort); } return cohort; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public Patient[] findID(String sv)\r\n\t{\r\n\t\tPatient[] foundPatients = new Patient[999];//Creates a blank array\r\n\t\tint count = 0;\r\n\r\n\t\tfor(int i=0; arrayPatients[i]!=null ;i++)//loops through the array\r\n\t\t{\r\n\t\t\tif(arrayPatients[i].forename.contains(sv)||arrayPatients[i].surname.contains(sv))...
[ "0.56921357", "0.5653478", "0.5557091", "0.5504451", "0.5398518", "0.5328897", "0.52936584", "0.5252072", "0.52350986", "0.5226935", "0.52259034", "0.52126396", "0.5198702", "0.51922464", "0.51600516", "0.5154581", "0.50925267", "0.5078189", "0.50575805", "0.50433266", "0.504...
0.0
-1
Builds SessionFactory from database properties file.
private static SessionFactory buildSessionFactory() { try { Configuration configuration = new Configuration(); Properties properties = new Properties(); properties.load(AuthDao.class.getResourceAsStream("/db.properties")); configuration.setProperties(properties); // configuration.addAnnotatedClass(Driver.class); // configuration.addAnnotatedClass(DriverStatusChange.class); // configuration.addAnnotatedClass(Freight.class); // configuration.addAnnotatedClass(Location.class); configuration.addAnnotatedClass(Manager.class); // configuration.addAnnotatedClass(Order.class); // configuration.addAnnotatedClass(OrderDriver.class); // configuration.addAnnotatedClass(OrderWaypoint.class); // configuration.addAnnotatedClass(Truck.class); // configuration.addAnnotatedClass(Waypoint.class); ServiceRegistry serviceRegistry = new StandardServiceRegistryBuilder().applySettings(configuration.getProperties()).build(); return configuration.buildSessionFactory(serviceRegistry); } catch (IOException e) { e.printStackTrace(); throw new ExceptionInInitializerError(e); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private static void createSessionFactory() {\n\t\ttry {\n\t\t\tif (sessionFactory == null) {\n\n\t\t\t\tProperties properties = new Properties();\n\t\t\t\tproperties.load(ClassLoader.getSystemResourceAsStream(\"hibernate.properties\"));\n\n\t\t\t\tConfiguration configuration = new Configuration();\n\t\t\t\tEntityS...
[ "0.71916634", "0.66934395", "0.6638468", "0.65104806", "0.64744693", "0.6459552", "0.6442098", "0.622725", "0.6067901", "0.60111", "0.5933493", "0.58111435", "0.5705095", "0.56751144", "0.56064314", "0.55843", "0.55510026", "0.550159", "0.54764575", "0.54671913", "0.5459965",...
0.7495263
0
Provides SessionFactory or calls building if null.
public static SessionFactory getSessionFactory() { if (sessionFactory == null) sessionFactory = buildSessionFactory(); return sessionFactory; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private static SessionFactory buildSessionFactory() {\n\t\ttry {\n\t\t\t// Create the SessionFactory from hibernate.cfg.xml\n\t\t\tConfiguration configuration = new Configuration().configure();\n\t\t\tServiceRegistry serviceRegistry = new ServiceRegistryBuilder()\n\t\t\t\t\t.applySettings(configuration.getProperti...
[ "0.7659082", "0.7306056", "0.7166389", "0.7160805", "0.71571684", "0.711056", "0.70543855", "0.7008249", "0.69902825", "0.6939603", "0.693418", "0.6877306", "0.6835945", "0.680851", "0.67939013", "0.67912", "0.67658305", "0.674921", "0.6744518", "0.6679184", "0.66707623", "...
0.72619224
2
Inflate the menu; this adds items to the action bar if it is present.
@Override public boolean onCreateOptionsMenu(Menu menu) { getMenuInflater().inflate(R.menu.band, menu); return true; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Override\n public boolean onCreateOptionsMenu(Menu menu) {\n \tMenuInflater inflater = getMenuInflater();\n \tinflater.inflate(R.menu.main_activity_actions, menu);\n \treturn super.onCreateOptionsMenu(menu);\n }", "@Override\n public void onCreateOptionsMenu(Menu menu, MenuInflater inflater) {...
[ "0.72473437", "0.7202402", "0.71960324", "0.7177793", "0.7108265", "0.7040525", "0.70388484", "0.70126176", "0.70101976", "0.6981143", "0.69461405", "0.694", "0.69346833", "0.69183874", "0.69183874", "0.6891571", "0.6884306", "0.68758994", "0.687534", "0.68627334", "0.6862733...
0.0
-1
Created by damma on 19.11.2016.
public interface AdminDAO { boolean login(String mail, String password) throws SQLException; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Override\n public void perish() {\n \n }", "private stendhal() {\n\t}", "@Override\n\tpublic void grabar() {\n\t\t\n\t}", "private static void cajas() {\n\t\t\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\tpubli...
[ "0.5959541", "0.5843183", "0.5771781", "0.5699807", "0.5692707", "0.5677689", "0.5677689", "0.5661249", "0.56606394", "0.5584698", "0.55720884", "0.55687016", "0.55680436", "0.55674297", "0.55667883", "0.55515325", "0.55361664", "0.5524856", "0.5497045", "0.5481775", "0.54795...
0.0
-1
Returns the assigned name
public String getName() { return name; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "java.lang.String getName();", "java.lang.String getName();", "java.lang.String getName();", "java.lang.String getName();", "java.lang.String getName();", "java.lang.String getName();", "java.lang.String getName();", "java.lang.String getName();", "java.lang.String getName();", "java.lang.String g...
[ "0.7473182", "0.7473182", "0.7473182", "0.7473182", "0.7473182", "0.7473182", "0.7473182", "0.7473182", "0.7473182", "0.7473182", "0.7473182", "0.7473182", "0.7473182", "0.7473182", "0.7473182", "0.7473182", "0.7473182", "0.7473182", "0.7473182", "0.7473182", "0.7473182", "...
0.0
-1
Returns the child expression
public CsdlExpression getValue() { return value; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public Operator getChild() {\r\n\t\treturn child;\r\n\t}", "Expression getExpression();", "Expression getExpression();", "Expression getExpression();", "Expression getExpression();", "DExpression getExpression();", "public Node getExpression() {\r\n return expression;\r\n }", "XExpression g...
[ "0.7111226", "0.68571156", "0.68571156", "0.68571156", "0.68571156", "0.6719686", "0.6662705", "0.6617964", "0.6612416", "0.64333075", "0.64237994", "0.6372781", "0.6346082", "0.63329405", "0.630368", "0.6271644", "0.6230769", "0.62098897", "0.6130496", "0.61277944", "0.61261...
0.0
-1
Get reference allele bases. Return null if there is a missing value.
public String getReferenceBases(VariantContext variantContext);
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public static byte[] getBasesCoveringRefInterval(final int refStart, final int refEnd, final byte[] bases, final int basesStartOnRef, final Cigar basesToRefCigar) {\n if ( refStart < 0 || refEnd < refStart ) throw new IllegalArgumentException(\"Bad start \" + refStart + \" and/or stop \" + refEnd);\n ...
[ "0.60400814", "0.5845048", "0.5763207", "0.57165545", "0.5613893", "0.55103934", "0.54740614", "0.52987874", "0.5224707", "0.5156535", "0.51146764", "0.5098722", "0.50952584", "0.5090776", "0.50789297", "0.505635", "0.5054244", "0.5045322", "0.49672166", "0.49636588", "0.4961...
0.6624555
0
Get names from VariantContext's ID field. It should be a semicolon separated list of unique identifiers where available. As names field is repeated, if the value is a missing value("."), return an empty list.
public List<String> getNames(VariantContext variantContext);
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "Set<String> getIdentifiers();", "public Vector<String> getIdentifiers()\n\t{\n\t\tfinal Vector<String> rets = new Vector<String>();\n\t\trets.add(identifier);\n\t\treturn rets;\n\t}", "@DISPID(10) //= 0xa. The runtime will prefer the VTID if present\r\n @VTID(17)\r\n java.lang.String[] getNames();", "@Over...
[ "0.6307344", "0.62573737", "0.6147748", "0.6071034", "0.60244924", "0.6012562", "0.60001457", "0.5966074", "0.5946676", "0.5944957", "0.5908764", "0.5837209", "0.58072275", "0.57875484", "0.5731748", "0.57269746", "0.5722786", "0.571182", "0.56969804", "0.56969804", "0.568437...
0.62740827
1
Add variant Info field into BQ table row. Iterate each field in the VCFHeader, check if the field is presented. If the field type is `Flag` but not presented, it will set `false` in the corresponding row field. And the row field name should match the schema format. If the attribute name does not match the schema format, we will get the sanitized field name and set the row value in the sanitized field. Also check if the field value size matches the count defined by VCFHeader and convert each value to the defined type. If the info field number in the VCF header is `A`, add it to the ALT sub field. The size for this field should be equal to the expected alternate bases count, which is the size of the alternate bases value.
public void addInfo(TableRow row, VariantContext variantContext, List<TableRow> altMetadata, VCFHeader vcfHeader, int expectedAltCount);
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public static String makeAltVcfField(BreakendVariant variant) {\n String alt = toPositiveStrand(variant.strand(), variant.alt());\n String ref = toPositiveStrand(variant.strand(), variant.ref());\n return makeAltVcfField(variant.left(), variant.right(), ref, alt);\n }", "InstrumentedType ...
[ "0.49575895", "0.45914707", "0.45409963", "0.45352378", "0.4491365", "0.44020343", "0.43606308", "0.43511078", "0.43171054", "0.4212545", "0.42095956", "0.4196829", "0.41638684", "0.4151568", "0.414572", "0.41385326", "0.4135655", "0.41350752", "0.4124459", "0.4117128", "0.41...
0.69926286
0
If the value is a missing value("."), we need to replace it with null in BQ row, which refers to `unknown`.
public String replaceMissingWithNull(String value);
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private void replaceBlanks(String[] row) {\n for(int i = 0; i < row.length; i++) {\n if(row[i] == null || row[i].isEmpty()) {\n row[i] = \"b\";\n }\n }\n }", "private String notNull(String value) {\n return value != null ? value : \"\";\n }", "pri...
[ "0.63281316", "0.6042675", "0.59310186", "0.59016824", "0.58800495", "0.5662429", "0.5634427", "0.56126094", "0.56006527", "0.55845743", "0.55752677", "0.551073", "0.5506946", "0.54111934", "0.5407738", "0.54060954", "0.53725755", "0.53436255", "0.53253657", "0.53141445", "0....
0.729647
0
Instantiates a new Guided mutation coordinator that selects trees to mutate and applies one of a given set of (weighted) mutators. Also distinguishes between guided mutators and random/stupid mutators.
public GuidedTreeMutationCoordinator(CentralRegistry registry, double chanceOfRandomMutation, boolean preventDuplicates, LinkedHashMap<TreeMutationAbstract, Double> smartMutators, TreeMutationCoordinator dumbCoordinator) { this.registry = registry; this.chanceOfRandomMutation = chanceOfRandomMutation; this.preventDuplicates = preventDuplicates; this.smartMutators = smartMutators; this.dumbCoordinator = dumbCoordinator; calculateTotalChance(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private void mutateHelper() {\n\t\tsynchronized (this) {\n\t\t\tRandom rand = new Random();\n\t\t\tint mutateType = rand.nextInt(5);\n\t\t\tif (rules.size() >= 14) {\n\t\t\t\tmutateType = rand.nextInt(6);\n\t\t\t}\n\t\t\tint index = rand.nextInt(rules.size());\n\t\t\tMutation m = null;\n\t\t\tswitch (mutateType) {...
[ "0.5898118", "0.5822275", "0.56864727", "0.5656126", "0.5629546", "0.5531276", "0.5492567", "0.5411089", "0.5315542", "0.518904", "0.51503253", "0.51279974", "0.50441074", "0.4973278", "0.4948759", "0.49392736", "0.4928467", "0.49180517", "0.4910082", "0.48961246", "0.4852465...
0.60760254
0
Applies mutation functions to the tree, depending on the tree's fitness characteristics and the provided probabilities
public NAryTree apply(NAryTree tree, Random rng) { if (rng.nextDouble() > chanceOfRandomMutation) { //DO A SMART MUTATION NAryTree mutatedTree; boolean changed = false; int nrTries = 0; TreeMutationAbstract mutator; do { mutator = getSmartMutatorForChance(rng.nextDouble() * totalChanceSmart); mutatedTree = mutator.mutate(tree); changed = mutator.changedAtLastCall(); nrTries++; this.locationOfLastChange = mutator.locationOfLastChange; this.typeOfChange = mutator.typeOfChange; //FIXME problem with the smart mutator, it always says that the individual changed, even when it didn't. if (nrTries > 2 && changed == false) { //Going dumb... We tried to be smart long enough return applyDumb(tree, rng); } } while (!changed); assert mutatedTree.isConsistent(); return mutatedTree; } else { //DELEGATE TO DUMB COORDINATOR return applyDumb(tree, rng); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private void mutate(float probability) {\r\n\r\n individual[] temp_pop = new individual[this.pop_size];\r\n\r\n for (int i = 0; i < this.pop_size; i++) {\r\n\r\n float temp_genes[] = this.offspring_population.getPopulation()[i].getGenes();\r\n\r\n // mutation can now mutate wild...
[ "0.69160575", "0.61905533", "0.5874875", "0.5611543", "0.5480231", "0.54259056", "0.54058814", "0.5402939", "0.53833354", "0.5369595", "0.5364167", "0.5359782", "0.5349244", "0.5347801", "0.53328276", "0.53022426", "0.5217014", "0.5200264", "0.5184167", "0.5177045", "0.517122...
0.5434529
5
encapsulate the process of calling the dumb coordinator and saving the mutation point.
private NAryTree applyDumb(NAryTree tree, Random rng) { NAryTree mutatedTree = dumbCoordinator.apply(tree, rng); this.locationOfLastChange = dumbCoordinator.locationOfLastChange; this.typeOfChange = dumbCoordinator.typeOfChange; return mutatedTree; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private void signalAndCreateCoordinator(Cluster pCluster)\n \t{\n \t\tRandom tRandom = new Random(System.currentTimeMillis());\n \t\tHRMController tHRMController = pCluster.getHRMController();\n \t\tNode tNode = tHRMController.getPhysicalNode();\n \t\tint tToken = tRandom.nextInt();\n \t\t\n \t\tpCluster.setToken(...
[ "0.5530032", "0.5430956", "0.5352332", "0.5251477", "0.5241299", "0.5234769", "0.505578", "0.50456274", "0.49634022", "0.49331242", "0.49225426", "0.4896947", "0.48937696", "0.48650432", "0.48545378", "0.48506504", "0.48418695", "0.48312375", "0.4805957", "0.47986406", "0.478...
0.44438407
92
May return no FlowState if the FlowState represented by the lookupKey was already completed.
@Override public FlowState call() { // TODO: We should not need? to pass the flowState because this flow is already known (reapplying same values???) FlowState flowState = getFlowState(); if ( flowState == null ) { throw new FlowException("No flowState with id:", getExistingFlowStateLookupKey()); } else { return getFlowManagementWithCheck().continueFlowState(getExistingFlowStateLookupKey(), true, this.getInitialFlowState()); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "String lookupKey(String key) throws CommunicationFailureException, TimeoutReachedException, NoSuccessorsExceptions;", "@Override\n public void checkDone() throws IllegalStateException {\n if (NO_KEYS.equals(range)\n || (!range.getEndKey().isEmpty() && range.getStartKey().equals(range.getEndKey()))) {\...
[ "0.50311565", "0.49909222", "0.49861708", "0.4825279", "0.48147383", "0.4732663", "0.46955568", "0.4695421", "0.4687391", "0.4642646", "0.46063417", "0.45885515", "0.45752573", "0.4559339", "0.45561036", "0.4544524", "0.45282185", "0.4463949", "0.44523233", "0.4443155", "0.44...
0.6424611
0
Magic types are types that may appear in the replacement and will need to find their corresponding entry in the list of matches.
public interface MagicType extends Type { /** * Given that we are a type specified in a replacement rule (e.g. a Var or * Atom), can we consume a submatch of the given type in the match? * * Alternatively, we could have overriden .equals(). */ boolean replacementfor(Type o); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "boolean replacementfor(Type o);", "public void matchType()\n {\n if(this.getGameType() == 1)\n {\n this.setType(\"s\");\n }\n else if(this.getGameType() == 2)\n {\n this.setType(\"r\");\n }\n else if(this.getGameType() == 3)\n {\n ...
[ "0.5475074", "0.5438148", "0.5237428", "0.5221895", "0.51448196", "0.51117206", "0.50630236", "0.5002596", "0.4935949", "0.4931132", "0.49262422", "0.49251845", "0.4859302", "0.48453128", "0.48402086", "0.4835488", "0.48306167", "0.48237333", "0.48119196", "0.48076606", "0.48...
0.6892851
0
Given that we are a type specified in a replacement rule (e.g. a Var or Atom), can we consume a submatch of the given type in the match? Alternatively, we could have overriden .equals().
boolean replacementfor(Type o);
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public interface MagicType extends Type {\n\n\t/**\n\t * Given that we are a type specified in a replacement rule (e.g. a Var or\n\t * Atom), can we consume a submatch of the given type in the match?\n\t *\n\t * Alternatively, we could have overriden .equals().\n\t */\n\tboolean replacementfor(Type o);\n}", "Obj...
[ "0.7248663", "0.69790435", "0.57939506", "0.575197", "0.56018263", "0.56010956", "0.55877167", "0.5543815", "0.5535773", "0.5528807", "0.54561627", "0.53328353", "0.5331318", "0.53256595", "0.531766", "0.53085744", "0.52801746", "0.5275025", "0.52310324", "0.51417863", "0.513...
0.6019482
2
Check if the player is colliding with the mob, if so initiate a time for the mob to start hitting If the timer has passed, the mob can hit the player
@Override public boolean checkCollideSingle(GameObject gameObject, int x, int y) { if (!(gameObject instanceof Player) || !isAlive()) return false; boolean result = super.withinRange(x, y); if (result) { if (prev + (hitInterval * 10) < System.currentTimeMillis()) { prev = System.currentTimeMillis(); startHitTime = prev + 300; startHit = true; } } if (result) { if (startHitTime < System.currentTimeMillis() && startHit) { HUD.getInstance().removeHealth(getDamage()); setStatus(PlayerStatus.FIGHTING); startHit = false; } } return result; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "int aggroHitTimer(IGeneticMob geneticMob, EntityLiving attacker);", "private void updateTileCollisions(Mob mob) {\n\t\tif (mob instanceof Player) {\r\n\t\t\tmob.setScreenPosition(\r\n\t\t\t\t\tnew Point(\r\n\t\t\t\t\t\t\tMath.max(mob.getScreenPosition().x, mob.getWidth() / 2), \r\n\t\t\t\t\t\t\tMath.max(mob.getS...
[ "0.6581047", "0.6133172", "0.60728794", "0.5982372", "0.59459984", "0.58908105", "0.5873248", "0.58449006", "0.5816039", "0.5780242", "0.5778615", "0.575816", "0.5758015", "0.5754814", "0.5712857", "0.56850696", "0.5679978", "0.5679918", "0.56459326", "0.5629719", "0.56178945...
0.637432
1
Get the LevelEditorSpecs for Orc
public static LevelEditor.LevelEditorItem getLevelEditorSpecs() { return new LevelEditor.LevelEditorItem(Orc.class, FileLoader.getInstance().getOrcImage(PlayerStatus.IDLE, PlayerStatus.Direction.RIGHT, 0)) { @Override public void onPlace(int mouseX, int mouseY) { super.onPlace(mouseX, mouseY); Level level = LevelEditor.getInstance().getLevel(); if (!this.allowedToPlace(mouseX, mouseY)) return; level.addGameObject(new Orc(gridX, gridY)); } }.setRequireGround(true); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "ImmutableList<SchemaOrgType> getEditorList();", "@NotNull\n List<NlComponentEditor> getEditors();", "@Override\n\tpublic java.lang.String getEditorType() {\n\t\treturn _scienceApp.getEditorType();\n\t}", "public List<String> getSpecifications() {\n\t\tString sql =\"select specification from specifications\"...
[ "0.59610206", "0.5732508", "0.48487622", "0.4828527", "0.4823871", "0.47986415", "0.4790784", "0.47489178", "0.47102708", "0.46962327", "0.46840787", "0.46634898", "0.46567455", "0.46473467", "0.46429074", "0.4627899", "0.4627899", "0.46164972", "0.46161", "0.45865116", "0.45...
0.79372805
0
TODO Autogenerated method stub
@Override public void actionPerformed(ActionEvent e) { if(e.getSource() == this.btn){ if(!this.txtf2.getText().equals(null) && !this.txtf1.getText().equals(null)){ Modele.ajouteDestination(this.txtf1.getText(),this.txtf2.getText()); this.txt3 = new JLabel("Votre Destination a bien été ajouter a la base de donnee."); this.add(this.txt3); revalidate(); }else{ this.txt3 = new JLabel("Veuillez saisir tout les champs."); this.add(this.txt3); revalidate(); } } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Override\r\n\tpublic void comer() \r\n\t{\n\t\t\r\n\t}", "@Override\n\tpublic void comer() {\n\t\t\n\t}", "@Override\n public void perish() {\n \n }", "@Override\r\n\t\t\tpublic void annadir() {\n\r\n\t\t\t}", "@Override\n\tpublic void anular() {\n\n\t}", "@Override\n\tprotected void getExr...
[ "0.6671074", "0.6567672", "0.6523024", "0.6481211", "0.6477082", "0.64591026", "0.64127725", "0.63762105", "0.6276059", "0.6254286", "0.623686", "0.6223679", "0.6201336", "0.61950207", "0.61950207", "0.61922914", "0.6186996", "0.6173591", "0.61327106", "0.61285484", "0.608016...
0.0
-1
This assigns the recyclerviewAdapter to the recycler view
@Override public void onViewCreated(@NonNull View view, @Nullable Bundle savedInstanceState) { super.onViewCreated(view, savedInstanceState); // Set the Recycler View Adapter Context context = view.getContext(); mRecyclerView.setLayoutManager(new LinearLayoutManager(context)); mRecyclerView.setAdapter(moviesRViewAdapter); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private void setRecyclerAdapter() {\n if (mRecyclerAdapter == null) {\n mRecyclerAdapter = new IssueResultsRecyclerAdapter(this, issueResult, mNation);\n mRecyclerView.setAdapter(mRecyclerAdapter);\n } else {\n ((IssueResultsRecyclerAdapter) mRecyclerAdapter).setConte...
[ "0.8090261", "0.77823126", "0.7600877", "0.7586872", "0.75855565", "0.7569657", "0.7550726", "0.7539602", "0.7512044", "0.7506464", "0.7501387", "0.74992126", "0.7498272", "0.74861586", "0.74756634", "0.7444968", "0.74359953", "0.74037236", "0.7335241", "0.73185384", "0.73153...
0.0
-1
This takes a list of Movies, checks for duplicates and then adds each new Movie to teh ArrayList. It hsould also notify the Recycler View Adapter that a new item has been inserted.
public void setMovies(List<Movies> mvoies) { for ( Movies movie: mvoies) { if (!mMovies.contains(movie)) { mMovies.add(movie); moviesRViewAdapter.notifyItemInserted(mMovies.indexOf(movie)); } } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void addData(Movie movieToAdd, View view)\n {\n /* Creating a DatabaseHelper Instance to access the getData Method in order to get the\n * Title (Index 1 in terms of Columns) of all the saved Movies in the Database and to make\n * sure that the Title of the Movie to be registered i...
[ "0.65960836", "0.6505999", "0.6418075", "0.60810155", "0.59902006", "0.58934635", "0.5892583", "0.588441", "0.585647", "0.5839842", "0.5816927", "0.58001363", "0.5736286", "0.5676842", "0.56577235", "0.56448376", "0.5606184", "0.5606166", "0.56040716", "0.55994785", "0.557284...
0.66815335
0
write your code in Java SE 8 OR you can calculate sumRange as (N+1)(N+2)/2 according to summation rules
public int solution(int[] A) { int sumRange = 0; for (int i = 1; i <= A.length+1; i++){ sumRange+=i; } int sumArray = 0; for(int a : A) { sumArray+=a; } //Take the total without the missing number, and subtract the total with the missing number return sumRange-sumArray; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private static int findSum(int[] nums, int start, int end) {\n int sum = 0;\n for ( int i = start ; i < end ; i++ ) {\n sum = sum + nums[i];\n }\n return sum;\n }", "public static int sumRange(int a, int b) {\r\n int sum = 0;\r\n int big = 0;\r\n int small...
[ "0.6603667", "0.6490593", "0.64732844", "0.64165825", "0.63511467", "0.6263571", "0.6235804", "0.61847264", "0.60791594", "0.6055819", "0.60097", "0.5990571", "0.59865916", "0.59838855", "0.5983107", "0.5965871", "0.5965871", "0.5924753", "0.59184426", "0.59157896", "0.590866...
0.0
-1
Initializes this 'StorageLoader' by connecting 'Storages' with given paths. Once this is called, the same 'StorageLoader' is not allowed to call this twice.
public static StorageLoader initialize(String... paths) throws LoaderInitializationFailureException {// TODO: 16. 10. 17 Not Nomalize uri yet. StorageLoader loader; URI uri; HashMap<String, Storage> tempStorages =new HashMap<>(); Storage storage; for (String path: paths){ try{ uri =new URI(path); storage= Contexts.generateStorageConnection(uri.getScheme(), path); tempStorages.putIfAbsent(path, storage); // TODO: 16. 10. 17 Log metadata of Storage Instances. }catch (URISyntaxException e) {continue;} catch (InvaildStorageException e) {continue;} } if (tempStorages.isEmpty()) new LoaderInitializationFailureException(); loader = new StorageLoader(tempStorages); return loader; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void init() {\n LOG.info(\"Initializing side input stores.\");\n\n initializeStoreDirectories();\n }", "public void initialize(final List<Guild> guilds, final StorageManager storage) {\n this.commands.forEach((ChatCommand t) -> {\n t.initialize(guilds, storage);\n });\n ...
[ "0.6142194", "0.60665894", "0.5892338", "0.58060217", "0.5663908", "0.5530746", "0.54715335", "0.5459804", "0.54212195", "0.53720844", "0.5356473", "0.5354963", "0.533948", "0.52930844", "0.5282096", "0.52186036", "0.5186597", "0.51807106", "0.51697415", "0.51658773", "0.5163...
0.7497944
0
Constructor. Set outlets to the itemView.
public PlaylistViewHolder(View itemView) { super(itemView); this.imageView1 = itemView.findViewById(R.id.imageView1); this.imageView2 = itemView.findViewById(R.id.imageView2); this.imageView3 = itemView.findViewById(R.id.imageView3); this.imageView4 = itemView.findViewById(R.id.imageView4); this.imageView5 = itemView.findViewById(R.id.imageView5); this.imageView6 = itemView.findViewById(R.id.imageView6); this.imageViews = new ImageView[] {imageView1, imageView2, imageView3, imageView4, imageView5, imageView6}; this.playlistTitleTextView = itemView.findViewById(R.id.playlistTitleTextView); this.playlistDescriptionTextView = itemView.findViewById(R.id.playlistDescriptionTextView); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public ViewHolder(View itemView) {\n // Stores the itemView in a public final member variable that can be used\n // to access the context from any ViewHolder instance.\n super(itemView);\n\n nameTextView = (TextView) itemView.findViewById(R.id.torrent_name);\n ...
[ "0.6639047", "0.66074127", "0.6554218", "0.6410656", "0.6363896", "0.6336243", "0.62820905", "0.62417966", "0.6238995", "0.62243545", "0.6222466", "0.6222466", "0.6213682", "0.6209274", "0.61951476", "0.6187174", "0.6165233", "0.6149182", "0.6146159", "0.6135646", "0.6094332"...
0.605167
25
Set the playlist's images/title/description in UI.
public void updateUI(Playlist playlist) { this.playlistTitleTextView.setText(playlist.getName()); this.playlistDescriptionTextView.setText(playlist.getDescription()); ArrayList<String> imageURIs = playlist.getImageURIs(); int currIndex = 0; for (String uri : imageURIs) { ImageView currImageView = imageViews[currIndex]; int resourceID = currImageView.getResources().getIdentifier(uri, null, currImageView.getContext().getPackageName()); currImageView.setImageResource(resourceID); currIndex++; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private void createDefaultPlayLists() {\n try {\n BufferedImage favoriteSongsImage = ImageIO.read(new File(\"Images/FavoriteSong.png\"));\n PlayListPanel favoriteSongs = new PlayListPanel(favoriteSongsImage, \"Favorite Songs\", \"Favorite albumSongs chosen by user\", this, this);\n ...
[ "0.6298616", "0.597243", "0.5856922", "0.5784531", "0.57770294", "0.5731825", "0.5643281", "0.56310976", "0.5610902", "0.5610399", "0.558033", "0.55740684", "0.55096114", "0.55011636", "0.54974395", "0.5475124", "0.54684126", "0.54676133", "0.54556495", "0.54405755", "0.54382...
0.71609795
0
Constructor with parameters The constructor with parameters is used to create the object with filled attributes, it uses the setters methods to put the information in the attributes.
public Employee(String username,String password,String firstname,String lastname,Date DoB, String contactNamber,String email,float salary,String positionStatus,String name, String buildingName, String street, Integer buildingNo, String area, String city, String country, String postcode){ super(username, password,firstname, lastname,DoB, contactNamber, email, name, buildingName, street, buildingNo, area, city, country, postcode); setSalary(salary); setPositionStatus(positionStatus); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "Constructor() {\r\n\t\t \r\n\t }", "public Parameters() {\n\t}", "public BaseParameters(){\r\n\t}", "public Contructor(int year, String name) {\n // constructor name must match class name and cannot have return type\n // all classes have constructor by default\n // f you do not create a ...
[ "0.64635783", "0.6419635", "0.63706964", "0.6369119", "0.63618964", "0.6345918", "0.63170856", "0.6301077", "0.629714", "0.6224238", "0.622092", "0.6202806", "0.61675954", "0.6112038", "0.6111659", "0.6109753", "0.6108225", "0.6085344", "0.6063957", "0.60608417", "0.6042511",...
0.0
-1
Setter methods The following methods set the attributes of the class Employee. The key word 'final' does not allow to subclasses (if they are exist) to override the setter methods because there is a rule: a constructor should not call methods that can be overridden. Set salary
public final void setSalary(float salary){ if(salary>=0){ this.salary=salary; } else{ JOptionPane.showMessageDialog(null,"Incorrect amount of salary "); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void setSalary(double salary){\r\n this.salary = salary;\r\n }", "public void setSalary(double salary) {\r\n this.salary = salary;\r\n }", "public void setSalary(double sal) { //salary variable to assign a value\n\t\tsalary = sal;\n\t}", "public void setSalary(double salary) {\n ...
[ "0.73213404", "0.7134039", "0.7113219", "0.7098836", "0.7098836", "0.68691456", "0.686526", "0.6809788", "0.68066376", "0.66174775", "0.6554571", "0.6523052", "0.6510273", "0.6488553", "0.64524287", "0.63939416", "0.63722193", "0.6306971", "0.628718", "0.6275631", "0.62441206...
0.6603711
10
Other Methods Save Employee in file Saves the user's information to the destination file.
@Override public void save(String fileName){ FileWriter addEmployeeDetails = null; try{ addEmployeeDetails = new FileWriter(fileName,true); addEmployeeDetails.append(getUsername()); addEmployeeDetails.append(System.getProperty("line.separator")); addEmployeeDetails.append(getPassword()); addEmployeeDetails.append(System.getProperty("line.separator")); addEmployeeDetails.append(getFirstname()); addEmployeeDetails.append(System.getProperty("line.separator")); addEmployeeDetails.append(getLastname()); addEmployeeDetails.append(System.getProperty("line.separator")); addEmployeeDetails.append(DMY.format(getDoB()));//format,convert,save addEmployeeDetails.append(System.getProperty("line.separator")); addEmployeeDetails.append(getContactNumber()); addEmployeeDetails.append(System.getProperty("line.separator")); addEmployeeDetails.append(getEmail()); addEmployeeDetails.append(System.getProperty("line.separator")); addEmployeeDetails.append(String.valueOf(getSalary())); addEmployeeDetails.append(System.getProperty("line.separator")); addEmployeeDetails.append(getPositionStatus()); addEmployeeDetails.append(System.getProperty("line.separator")); //************Saves the address in the file.**************** homeAddress.save(addEmployeeDetails); //********************************************************** addEmployeeDetails.append("$$$"); addEmployeeDetails.append(System.getProperty("line.separator")); addEmployeeDetails.close(); addEmployeeDetails = null; }//end try catch (IOException ioe){}//end catch }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "static void WriteEmployeeObjectIntoFile(Employee emp,String filename)\n\t{\n\t\t\n\t try\n\t {\n\t FileOutputStream fileOut =\n\t new FileOutputStream(filename);\n\t ObjectOutputStream out = new ObjectOutputStream(fileOut);\n\t //Main write method\n\t out.writeObje...
[ "0.69330937", "0.6628618", "0.66085064", "0.65785426", "0.65588355", "0.65063864", "0.6483218", "0.6406097", "0.6238583", "0.61776245", "0.6147336", "0.61239475", "0.6105383", "0.60550225", "0.60464346", "0.59974766", "0.5975819", "0.5972444", "0.59158045", "0.5889257", "0.58...
0.75535333
0
Load details Loads employee details from the text file
@Override public void load(String keyWord, String fileName){ FileReader loadDetails; String record; try{ loadDetails=new FileReader(fileName); BufferedReader bin=new BufferedReader(loadDetails); while (((record=bin.readLine()) != null)){ if ((record).contentEquals(keyWord)){ setUsername(record); setPassword(bin.readLine()); setFirstname(bin.readLine()); setLastname(bin.readLine()); setDoB((Date)DMY.parse(bin.readLine())); setContactNumber(bin.readLine()); setEmail(bin.readLine()); setSalary(Float.valueOf(bin.readLine())); setPositionStatus(bin.readLine()); homeAddress.load(bin); }//end if }//end while bin.close(); }//end try catch (IOException ioe){}//end catch catch (ParseException ex) { Logger.getLogger(Product.class.getName()).log(Level.SEVERE, null, ex); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void loadEmployees(String fileName)\r\n\t{\r\n\t\t//try block to attempt to open the file\r\n\t\ttry\r\n\t\t{\r\n\t\t\t//declare local variables for the file name and data fields within the employeelist text file\r\n\t\t\t//these will all be Strings when pulled from the file, and then converted to the prope...
[ "0.7502014", "0.72978175", "0.6976945", "0.6965155", "0.69643885", "0.66967434", "0.6682795", "0.65027225", "0.6461597", "0.64477324", "0.6395349", "0.63598776", "0.6359591", "0.6298586", "0.627457", "0.62259996", "0.61993545", "0.61389214", "0.6124515", "0.60817176", "0.6064...
0.68321025
5
Display Employee Displays Employee's information at JtextFileds.
@Override public void display(JPasswordField passFirstnameTextField, JTextField userFirstnameTextField, JTextField userLastnameTextField, JTextField DoBTextField, JTextField contactNumberTextField, JTextField emailTextField, JTextField salaryTextField, JTextField positionStatusTextField, JTextField nameTextField, JTextField buildingNameTextField, JTextField streetTextField, JTextField buildingNoTextField, JTextField areaTextField, JTextField cityTextField, JTextField countryTextField, JTextField postcodeTextField){ passFirstnameTextField.setText(getPassword()); userFirstnameTextField.setText(getFirstname()); userLastnameTextField.setText(getLastname()); DoBTextField.setText(DMY.format(getDoB())); contactNumberTextField.setText(getContactNumber()); emailTextField.setText(getEmail()); salaryTextField.setText(String.valueOf(getSalary())); positionStatusTextField.setText(getPositionStatus()); homeAddress.display(nameTextField,buildingNameTextField,streetTextField, buildingNoTextField,areaTextField,cityTextField, countryTextField,postcodeTextField); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void displayEmployees(){\n System.out.println(\"NAME --- SALARY --- AGE \");\n for (Employee employee : employees) {\n System.out.println(employee.getName() + \" \" + employee.getSalary() + \" \" + employee.getAge());\n }\n }", "public static void showEmployee(Reques...
[ "0.71017784", "0.7076639", "0.6917487", "0.6792148", "0.6775536", "0.6658171", "0.65851015", "0.65503305", "0.6458684", "0.6449608", "0.63708043", "0.629784", "0.62786233", "0.62635064", "0.62602913", "0.6251515", "0.623602", "0.62216944", "0.6216088", "0.6214841", "0.6210499...
0.0
-1
Edit method Allow to user to change the information of employee's profile. This method put each line of a text fil into an ArrayList of stings
private ArrayList<String> saveText(){ FileReader loadDetails = null; String record; record = null; //Create an ArrayList to store the lines from text file ArrayList<String> lineKeeper = new ArrayList<String>(); try{ loadDetails=new FileReader("employees.txt"); BufferedReader bin=new BufferedReader (loadDetails); record=new String(); while (((record=bin.readLine()) != null)){//Read the file and store it into the ArrayList line by line* lineKeeper.add(record); }//end while bin.close(); bin=null; }//end try catch (IOException ioe) {}//end catc return lineKeeper; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Override\n public void edit(){\n Integer Pointer=0;\n FileWriter editDetails = null;\n ArrayList<String> lineKeeper = saveText();\n\n /* Search into the list to find the Username, if it founds it, changes the\n * old information with the new information.\n * Search*/\n i...
[ "0.76074827", "0.61558557", "0.6031909", "0.60163176", "0.5930704", "0.5764944", "0.5733894", "0.5648746", "0.5634261", "0.5622021", "0.56189346", "0.5596486", "0.55896664", "0.5574204", "0.55674446", "0.55594546", "0.5557735", "0.5527598", "0.5524064", "0.5517859", "0.547673...
0.61604667
1
The following method take the ArrayList from the method above and finish the editing.
@Override public void edit(){ Integer Pointer=0; FileWriter editDetails = null; ArrayList<String> lineKeeper = saveText(); /* Search into the list to find the Username, if it founds it, changes the * old information with the new information. * Search*/ if(lineKeeper.contains(getUsername())){ Pointer=lineKeeper.indexOf(getUsername()); //Write the new information lineKeeper.set(Pointer+1, getPassword()); lineKeeper.set(Pointer+2, getFirstname()); lineKeeper.set(Pointer+3, getLastname()); lineKeeper.set(Pointer+4, DMY.format(getDoB())); lineKeeper.set(Pointer+5, getContactNumber()); lineKeeper.set(Pointer+6, getEmail()); lineKeeper.set(Pointer+7, String.valueOf(getSalary())); lineKeeper.set(Pointer+8, getPositionStatus()); Pointer=Pointer+9; homeAddress.edit(lineKeeper,Pointer); }//end if try{ editDetails= new FileWriter("employees.txt",false); for( int i=0;i<lineKeeper.size();i++){ editDetails.append(lineKeeper.get(i)); editDetails.append(System.getProperty("line.separator")); }//end for editDetails.close(); editDetails = null; }//end try catch (IOException ioe) {}//end catch }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public static void slide127() {\n ArrayList<String> obj = new ArrayList<String>();\n\n //This is how we add elements to an ArrayList\n obj.add(\"Alex\");\n obj.add(\"Con\");\n obj.add(\"Paul\");\n obj.add(\"Estel\");\n obj.add(\"Peter\");...
[ "0.67358166", "0.64996487", "0.6486077", "0.62991166", "0.6244", "0.6199656", "0.61648613", "0.60781205", "0.6051611", "0.6050893", "0.6046054", "0.60227424", "0.59966487", "0.5993247", "0.59814864", "0.5882548", "0.5880574", "0.5859202", "0.5846131", "0.58452994", "0.5844869...
0.55993015
42
Delete method Delete an existing employee
@Override public void delete(){ Integer Pointer=0; FileWriter editDetails = null; ArrayList<String> lineKeeper = saveText(); if(lineKeeper.contains(getUsername())){ Pointer=lineKeeper.indexOf(getUsername()); Pointer=Pointer-1; for(int i=1;i<=8;i++){ lineKeeper.remove(Pointer+1); }//end for homeAddress.delete(lineKeeper); } try{ editDetails= new FileWriter("employees.txt",false); for( int i=0;i<lineKeeper.size();i++){ editDetails.append(lineKeeper.get(i)); editDetails.append(System.getProperty("line.separator")); }//end for editDetails.close(); editDetails = null; }//end try catch (IOException ioe) {}//end catch }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public String deleteEmployee(EmployeeDetails employeeDetails);", "@Override\n\tpublic void deleteEmployee() {\n\n\t}", "@Override\n\tpublic void deleteEmployee(Employee employee) {\n\t\t\n\t}", "public void delete(Employee employee){\n employeeRepository.delete(employee);\n }", "@Override\n\tpubl...
[ "0.85345966", "0.8423302", "0.8362232", "0.8352293", "0.83260995", "0.826066", "0.82531565", "0.8220535", "0.8188256", "0.81316674", "0.8105619", "0.8089938", "0.8068804", "0.7976881", "0.7900794", "0.7888894", "0.78854", "0.7871655", "0.7868204", "0.7849611", "0.7836619", ...
0.0
-1
Search method This method search employees by first name and last name
@Override public void search(String firstName,String lastName,String fileName){ int Pointer; ArrayList<String> lineKeeper = saveText(); /* Search into the list to find the firstname, if it founds * old information and then rewrite new inforamtion * Search and remove*/ if(lineKeeper.contains(firstName)){ Pointer=lineKeeper.indexOf(firstName); if(lineKeeper.get(Pointer+1).equals(lastName)){ this.load(lineKeeper.get(Pointer-3),fileName); } } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@GetMapping(value = \"/search\")\n\tpublic String searchName(@RequestParam(name = \"fname\") String fname, Model model) {\n\t\tmodel.addAttribute(\"employees\", employeerepository.findByFnameIgnoreCaseContaining(fname));\n\t\treturn \"employeelist\";\n\t}", "private Employee searchEmployee(String empName)\n {...
[ "0.7314662", "0.72372746", "0.6775847", "0.669932", "0.6698817", "0.65063196", "0.6460672", "0.64548737", "0.6454842", "0.64523405", "0.6441554", "0.6434485", "0.64312494", "0.6392926", "0.63548595", "0.6344629", "0.6323708", "0.63040376", "0.62938064", "0.62811923", "0.62708...
0.6425071
13
Clone method This method gets as parameter an Employee object and clone all the attribute to the object that calls the methods
public void clone(Employee theEmployee) { this.setUsername(theEmployee.getUsername()); this.setPassword(theEmployee.getPassword()); this.setFirstname(theEmployee.getFirstname()); this.setLastname(theEmployee.getLastname()); this.setDoB(theEmployee.getDoB()); this.setContactNumber(theEmployee.getContactNumber()); this.setEmail(theEmployee.getEmail()); this.setSalary(theEmployee.getSalary()); this.setPositionStatus(theEmployee.getPositionStatus()); this.homeAddress.clone(theEmployee.getHomeAddress()); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Override\r\n\tpublic Object clone() throws CloneNotSupportedException {\n\t\tEmployee e = (Employee)super.clone();\r\n\t\te.add = this.add.clone(); //Clone method of Address class\r\n\t\treturn e;\r\n\t}", "@Override\r\n\tprotected Object clone() throws CloneNotSupportedException {\n\t\tEmployee eClone = (Emplo...
[ "0.8063044", "0.805637", "0.6461267", "0.6440511", "0.63104284", "0.62555784", "0.6237014", "0.6160677", "0.61425847", "0.6142088", "0.61365366", "0.61365366", "0.61348695", "0.6112877", "0.60988575", "0.6089758", "0.6083402", "0.6074358", "0.6029218", "0.5996953", "0.5996953...
0.7753064
2
isEqual method The following method checks of two objects of class Employee have identical elements (Username, password etc).
public boolean isEqual(Employee theEmployee) { boolean equal; if (this.username.equals(theEmployee.username) && this.password.equals(theEmployee.password) && this.firstname.equals(theEmployee.firstname) && this.lastname.equals(theEmployee.lastname) && this.DoB.equals(theEmployee.DoB) && this.contactNumber.equals(theEmployee.contactNumber) && this.email.equals(theEmployee.email) && (this.salary==theEmployee.salary) && this.positionStatus.equals(theEmployee.positionStatus) && this.homeAddress.equals(theEmployee.homeAddress)){ equal = true; } else { equal = false; } return equal; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Override\n public boolean equals(Object object) {\n if (!(object instanceof Employee)) {\n return false;\n }\n Employee other = (Employee) object;\n if ((this.username == null && other.username != null) || (this.username != null && !this.username.equals(other.username))) ...
[ "0.7537861", "0.69602555", "0.68304354", "0.67996556", "0.6745006", "0.67366135", "0.6704204", "0.6696917", "0.66953576", "0.6684644", "0.66699636", "0.66344726", "0.66178393", "0.6615723", "0.6599851", "0.65942174", "0.65807176", "0.6565561", "0.65434194", "0.6541667", "0.65...
0.76804847
0
Creates new handler for client with given sockets for communication.
public ClientHandler(Socket cmdSocket, Socket fileSocket, FileTransferServer server) { // Set up a simple configuration that logs on the console. BasicConfigurator.configure(); log = Logger.getLogger(ClientHandler.class.getName()); this.cmdSocket = cmdSocket; this.fileSocket = fileSocket; this.server = server; prepareStreams(); // Initialize handlers for each command handlers = new HashMap<>(); handlers.put("DIR", new DirRequestHandler(server)); handlers.put("GET", new GetRequestHandler(server, fileOutStream)); handlers.put("PUT", new PutRequestHandler(server, fileInStream)); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "abstract public TelnetServerHandler createHandler(TelnetSocket s);", "ClientHandler(Socket socket) {\n this.client = socket;\n }", "private void initSocketWithHandlers() {\n\t\tfor(String key: eventHandlerMap.keySet()) {\n\t\t\tmSocket.on(key, eventHandlerMap.get(key));\n\t\t}\n\t}", "public Client...
[ "0.64748335", "0.6365735", "0.62987614", "0.62264377", "0.5858654", "0.5819042", "0.57744706", "0.5685101", "0.5637421", "0.5635924", "0.56052285", "0.5598046", "0.5566442", "0.55618465", "0.5522567", "0.5514853", "0.5512556", "0.5494091", "0.5490908", "0.5490908", "0.5439369...
0.5345019
23
Starts client handler. Handler begins to listen for commands from client and responds to it.
@Override public void run() { try { Request command = (Request) cmdInStream.readObject(); while (!"EXIT".equalsIgnoreCase(command.getContent())) { log.info(String.format("Received command: %s", command.getContent())); // Searching for appropriate handler for received request RequestHandler request = handlers.get(command.getContent()); if (request != null) { // Processing request and writing response Response response = request.handle(command); cmdOutStream.writeObject(response); } else { cmdOutStream.writeObject(new Response("Incorrect request. Please try again.")); } // Read next command command = (Request) cmdInStream.readObject(); } cmdInStream.close(); cmdOutStream.close(); fileInStream.close(); fileOutStream.close(); cmdSocket.close(); fileSocket.close(); } catch (ClassNotFoundException ex) { log.error("Class can't be found! " + ex.getMessage()); } catch (IOException ex) { log.error(ex.getMessage()); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "protected void serveClient() {\r\n\t\tif (lineIn == null || lineOut == null) {\r\n\t\t\tSystem.err.printf(\"I/O has not been set up.%n\");\r\n\t\t} else {\r\n\t\t\ttry {\r\n\t\t\t\tString clientRequest;\r\n\t\t\t\tStringTokenizer args;\r\n\r\n\t\t\t\t// control loop, receiving client requests\r\n\t\t\t\twhile (!ex...
[ "0.68783355", "0.6649693", "0.6610888", "0.6470383", "0.64076084", "0.63433594", "0.612469", "0.6119706", "0.61094415", "0.6104393", "0.6092675", "0.6089585", "0.6062007", "0.60605484", "0.6035304", "0.6026001", "0.6025731", "0.60169643", "0.59299445", "0.59121203", "0.590448...
0.0
-1
saveAndReturnId(); updateBudgetByName(); fetchAll(); fetchProducerNameByMovieName(); fetchCount1();
public static void main(String[] args) { fetchMaxBudget(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Repository\npublic interface LoanCorporateForeignInvestment_DAO{\n @Insert(\"insert into LoanCorporateForeignInvestment(custCode,CreditCardNumber,InvesteeCompanyName,InvestmentAmount,InvestmentCurrency,OrganizationCode) \" +\n \"values (\" +\n \"#{custCode,jdbcType=VARCHAR},\" +\n ...
[ "0.58847225", "0.58114856", "0.55385244", "0.5537376", "0.54796773", "0.54748285", "0.54648507", "0.5444338", "0.5398169", "0.5393515", "0.53784823", "0.53555334", "0.53280246", "0.5327271", "0.5322535", "0.53181773", "0.53170043", "0.5313435", "0.53023934", "0.5291084", "0.5...
0.0
-1
Inflate the layout for this fragment
@Override public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { View rootView = inflater.inflate(R.layout.fragment_tutor_list, container, false); rv = (RecyclerView) rootView.findViewById(R.id.rvTutors); // rv.setHasFixedSize(true); rv.setLayoutManager(new LinearLayoutManager(getActivity())); swipeRefreshLayout = (SwipeRefreshLayout) rootView.findViewById(R.id.swipeRefreshLayout); id = this.getArguments().getString("session"); //Toast.makeText(getContext(),"Session id "+id,Toast.LENGTH_SHORT); connect2server = new getTutors(this.getActivity(), id, list); connect2server.delegate = this; connect2server.execute(); swipeRefreshLayout.setColorSchemeResources(android.R.color.holo_blue_bright, android.R.color.holo_green_light, android.R.color.holo_orange_light, android.R.color.holo_red_light); swipeRefreshLayout.setOnRefreshListener(new SwipeRefreshLayout.OnRefreshListener() { @Override public void onRefresh() { // Refresh items refreshItems(); } }); return rootView; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n return inflater.inflate(R.layout.fragment_main_allinfo, container, false);\n }", "@Override\r\n\tpublic View onCreateView(LayoutInflater inflater, ViewGroup...
[ "0.6739604", "0.67235583", "0.6721706", "0.6698254", "0.6691869", "0.6687986", "0.66869223", "0.6684548", "0.66766286", "0.6674615", "0.66654444", "0.66654384", "0.6664403", "0.66596216", "0.6653321", "0.6647136", "0.66423255", "0.66388357", "0.6637491", "0.6634193", "0.66251...
0.0
-1
Publish a bean to generate swagger2 endpoints
@Bean public Docket usersApi() { return new Docket(DocumentationType.SWAGGER_2) .apiInfo(usersApiInfo()) .select() .paths(userPaths()) .apis(RequestHandlerSelectors.any()) .build() .useDefaultResponseMessages(false); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Bean\n public Docket api(){\n //Enables following endpoints once configured\n //http://localhost:8080/swagger-ui.html\n //http://localhost:8080/v2/api-docs\n return new Docket(DocumentationType.SWAGGER_2)\n //.apiInfo(ApiInfo.DEFAULT)\n .apiInfo(DEFAULT...
[ "0.63285476", "0.6305854", "0.62405604", "0.61480194", "0.60214", "0.5914546", "0.5863444", "0.5845168", "0.5815267", "0.58124864", "0.5809024", "0.5794706", "0.5781983", "0.57485783", "0.573589", "0.5642202", "0.5617435", "0.56127715", "0.5588965", "0.5581967", "0.5488899", ...
0.4852469
80
Method responsible for show the view telling there is no matches in that day
private void showNoView(boolean isShown){ if(isShown){ mNoMatchesImageView.setVisibility(View.VISIBLE); mNoMatchesTextView.setVisibility(View.VISIBLE); }else{ mNoMatchesImageView.setVisibility(View.GONE); mNoMatchesTextView.setVisibility(View.GONE); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void showMatchFailedView() {\n mMatchStatus = MATCH_STATUS_MATCH_FAILED;\n postInvalidate();\n }", "public static void displayNoResults()\n {\n tableData.add(new Company(null, \"No results found\"));\n tableView.setItems(tableData); \n }", "public static void...
[ "0.61531097", "0.61132485", "0.57636786", "0.5732152", "0.5520446", "0.54781103", "0.5471621", "0.54240745", "0.54192245", "0.5414938", "0.54024994", "0.53260523", "0.53015447", "0.5295616", "0.5278784", "0.5271252", "0.52643424", "0.52378", "0.5163518", "0.5139335", "0.51242...
0.52022314
18
Method responsible for control the refresh icon
private void postRefreshing(final boolean refreshing) { // Check if layout is not null and then add or remove the refresh icon according to the parameter if (mSwipeRefreshLayout != null) mSwipeRefreshLayout.post(new Runnable() { @Override public void run() { if (mSwipeRefreshLayout != null) mSwipeRefreshLayout.setRefreshing(refreshing); } }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Override\n\t\t\tpublic void onRefreshClick() {\n\t\t\t\thttpRefreshMethod();\n\t\t\t}", "public void Refresh_button() {\n\t\tthis.defaultSetup();\n\t}", "public void refresh() {\n \t\n /* Attach a rotating ImageView to the refresh item as an ActionView */\n LayoutInflater inflater = (LayoutIn...
[ "0.6880749", "0.68570286", "0.6724968", "0.6595266", "0.65327996", "0.64938194", "0.64893806", "0.64438564", "0.64340967", "0.6426319", "0.64186025", "0.63998646", "0.6391513", "0.63851684", "0.6378502", "0.63735044", "0.6368505", "0.6365905", "0.6362482", "0.63554364", "0.63...
0.0
-1
Check if it was find matches in that day and make the TextView gone
@Override public void onLoadFinished(Loader<Cursor> cursorLoader, Cursor cursor) { if(cursor.getCount() > 0) showNoView(false); // Swap the cursor and cancel the refresh icon mMatchesAdapter.swapCursor(cursor); postRefreshing(false); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Override\n public void onFocusChange(View v, boolean hasFocus) {\n if (et_night.isFocused()) {\n et_night.setText(null);\n et_night.requestFocus();\n\n }\n\n }", "private void findHide() {\n \tif (this.pagesView != null...
[ "0.5853671", "0.5626717", "0.55216724", "0.54961234", "0.54695445", "0.54526985", "0.5413859", "0.5354564", "0.53266823", "0.53165543", "0.52972937", "0.5289693", "0.5283377", "0.52696323", "0.5259633", "0.5251006", "0.5235503", "0.5224779", "0.5217134", "0.5203451", "0.51993...
0.0
-1
First delete old values from DB
private void updateMatches(){ getContext().getContentResolver().delete(MatchesContract.BASE_CONTENT_URI, null, null); // Fetch new data new FetchScoreTask(getContext()).execute(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private void clearData() {\n em.createQuery(\"delete from ViajeroEntity\").executeUpdate();\n }", "private void deleteOldData() {\n Date today = SunshineDateUtils.getNormalizedUtcDateForToday();\n weatherDao.deleteOldWeather(today);\n }", "public void removeOldRecords();", "private...
[ "0.6860494", "0.6842252", "0.68077254", "0.6785814", "0.6547479", "0.648695", "0.6481635", "0.6464174", "0.6437724", "0.64349186", "0.64340883", "0.6373924", "0.63381094", "0.63276494", "0.62369037", "0.61938095", "0.6191044", "0.6186723", "0.6181258", "0.61528075", "0.613883...
0.0
-1
Convierte el String en un byte
private void send (String messageToSend) throws IOException { byte[] ba = messageToSend.getBytes(); packetToSend = new DatagramPacket (ba, ba.length, serverIPAddress, PORT); //Envia el paquete por el socket. clientSocket.send(packetToSend); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Override\n\t\tpublic byte[] convert(String s) {\n\t\t\treturn s.getBytes();\n\t\t}", "@NonNull\n public static byte[] StringToByte(String string) throws UnsupportedEncodingException\n {\n return string.getBytes(\"UTF-8\");\n }", "static ByteString toBytes(String str) {\n return ByteString.c...
[ "0.73673373", "0.7218121", "0.71082187", "0.68615234", "0.681577", "0.6802713", "0.67840767", "0.6780783", "0.6699114", "0.66851175", "0.6641117", "0.66123533", "0.6609432", "0.6522016", "0.6513473", "0.64906174", "0.6462239", "0.6442034", "0.6432216", "0.6431193", "0.6419782...
0.0
-1
/ Set the Nimbus look and feel / If Nimbus (introduced in Java SE 6) is not available, stay with the default look and feel. For details see
public static void main(String args[]) { try { for (javax.swing.UIManager.LookAndFeelInfo info : javax.swing.UIManager.getInstalledLookAndFeels()) { if ("Nimbus".equals(info.getName())) { javax.swing.UIManager.setLookAndFeel(info.getClassName()); break; } } } catch (ClassNotFoundException ex) { java.util.logging.Logger.getLogger(Multihilo_Chat.class.getName()).log(java.util.logging.Level.SEVERE, null, ex); } catch (InstantiationException ex) { java.util.logging.Logger.getLogger(Multihilo_Chat.class.getName()).log(java.util.logging.Level.SEVERE, null, ex); } catch (IllegalAccessException ex) { java.util.logging.Logger.getLogger(Multihilo_Chat.class.getName()).log(java.util.logging.Level.SEVERE, null, ex); } catch (javax.swing.UnsupportedLookAndFeelException ex) { java.util.logging.Logger.getLogger(Multihilo_Chat.class.getName()).log(java.util.logging.Level.SEVERE, null, ex); } //</editor-fold> /* Create and display the form */ java.awt.EventQueue.invokeLater(new Runnable() { public void run() { try { new Multihilo_Chat().setVisible(true); } catch (UnknownHostException ex) { Logger.getLogger(Multihilo_Chat.class.getName()).log(Level.SEVERE, null, ex); } catch (IOException ex) { Logger.getLogger(Multihilo_Chat.class.getName()).log(Level.SEVERE, null, ex); } } }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public static void setLookAndFeel() {\n try {\n for (LookAndFeelInfo info : UIManager.getInstalledLookAndFeels()) {\n if (\"Nimbus\".equals(info.getName())) {\n UIManager.setLookAndFeel(info.getClassName());\n break;\n }\n ...
[ "0.7949177", "0.7767432", "0.7700453", "0.7505285", "0.72892106", "0.7228083", "0.72242665", "0.7219334", "0.71824956", "0.71557355", "0.7120814", "0.71131855", "0.71004164", "0.70623386", "0.70506656", "0.6914896", "0.681819", "0.67058736", "0.66945297", "0.6586071", "0.6574...
0.0
-1
As an air traffic controller So I can get passengers to a destination I want to instruct a plane to land at an airport
@Test public void planeCanLand() { try { heathrow.landing(tap); } catch (Exception exception) { } expectedPlanes.add(tap); assertEquals(expectedPlanes, heathrow.hangar); assertSame(tap, heathrow.hangar.get(0)); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public IAirport getDestination();", "LaneController getStraightLaneController();", "@Override\n\tprotected void land(){\n\t\tgvh.log.i(TAG, \"Drone landing\");\n\t\t//setControlInput(my_model.yaw, 0, 0, 5);\n\t}", "public Airplane (){\n \n }", "public static void main(String[] args) {\n\t\tint gr...
[ "0.65607595", "0.6371535", "0.62493384", "0.6186578", "0.59600914", "0.59287894", "0.58959", "0.5894845", "0.57951534", "0.5772711", "0.5755709", "0.5753759", "0.56876713", "0.56792957", "0.56674147", "0.5652183", "0.5651145", "0.5631379", "0.56253046", "0.5620392", "0.560947...
0.6150996
4
As an air traffic controller So I can get passengers on the way to their destination I want to instruct a plane to take off from an airport and confirm that it is no longer in the airport
@Test public void planeCanTakeOff() { try { heathrow.landing(tap); } catch (Exception exception) { } try { heathrow.takeoff(tap); } catch (Exception exception) { } assertEquals(expectedPlanes, heathrow.hangar); assertTrue(heathrow.hangar.isEmpty()); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void confirmFlight();", "public void flightDisappear();", "public void noFlights();", "@Override\n public void informPlaneReadyToTakeOff(int passengerId) {\n this.lock.lock();\n try {\n // wait for last passenger\n while (this.lastPassengerToBoard != passengerId)...
[ "0.63177854", "0.60385925", "0.59353954", "0.5795577", "0.57936597", "0.56520575", "0.564721", "0.5641962", "0.5628323", "0.5622062", "0.56176335", "0.5602935", "0.54999375", "0.54988736", "0.5493202", "0.54853326", "0.5483619", "0.5475948", "0.54755783", "0.547491", "0.54704...
0.5947738
2
As an air traffic controller To ensure safety I want to prevent landing when the airport is full
@Test public void landingPreventedWhenFull() throws Exception { Exception e = new Exception(); try { heathrow.landing(tap); heathrow.landing(ba); } catch (Exception exception) { e = exception; } assertEquals("Airport is full", e.getMessage()); assertEquals(heathrow.capacity, heathrow.hangar.size()); assertEquals(1, heathrow.hangar.size()); assertEquals(-1, heathrow.hangar.indexOf(ba)); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public boolean isSeatAllReserved() {\n return airplane.isFull();\n }", "public void noFlights();", "private void travelToAirport()\n {\n try\n { sleep ((long) (1 + 30000 * Math.random ()));\n }\n catch (InterruptedException e) {}\n }", "public boolean takeControl()...
[ "0.5938257", "0.58932275", "0.5782056", "0.5777831", "0.57614774", "0.5616863", "0.5556931", "0.55047315", "0.55043095", "0.54763526", "0.5471112", "0.5407462", "0.5404355", "0.5402837", "0.5386619", "0.53686523", "0.5359436", "0.53390974", "0.53353775", "0.5331541", "0.53276...
0.63602346
0
As the system designer So that the software can be used for many different airports I would like a default airport capacity that can be overridden as appropriate
@Test public void overrideDefaultCapacity() { cst = new Airport(2, weatherMock); assertEquals(2, cst.capacity); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "com.cantor.drop.aggregator.model.CFTrade.Capacity getCapacity();", "public Airplane(int aircraftType, int flightNumber, int maximumCapacity,\n\t\t\tint maximumWeight) {\n\t\tthis.aircraftType = aircraftType; // all of these are of the airplane\n\t\tthis.flightNumber = flightNumber;\n\t\tthis.maximumCapacity = ma...
[ "0.5682482", "0.5671575", "0.5651661", "0.5545372", "0.5541049", "0.5484843", "0.5482297", "0.54453015", "0.5441184", "0.5440678", "0.54275626", "0.540607", "0.53968143", "0.53772986", "0.5337528", "0.5327218", "0.53271073", "0.53239346", "0.5318727", "0.5289899", "0.5289411"...
0.6980199
0
As an air traffic controller To ensure safety I want to prevent takeoff when weather is stormy
@Test public void preventTakeOffWhenStormyWeather() { Exception exception = new Exception(); try { heathrow.landing(tap); // airport instance return stormy weather when(weatherMock.getWeather()).thenReturn("stormy"); heathrow.takeoff(tap); } catch (Exception e) { exception = e; } assertEquals("Not allowed to takeoff in stormy weather", exception.getMessage()); assertEquals(1, heathrow.hangar.size()); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private void penguinStormReaction(){\n if(obstacle.getUserData().getAssetId().equals(OBSTACLE_CLOUD_ASSETS_ID)){\n if(penguin.isFrightStopped()){\n obstacle.setStormRaining(false);\n }else{\n obstacle.setStormRaining(true);\n }\n }\n }...
[ "0.64644265", "0.6375125", "0.63289803", "0.60844713", "0.5903213", "0.5902263", "0.5895337", "0.5859328", "0.58032256", "0.57682693", "0.5709414", "0.56970406", "0.56715125", "0.56629133", "0.5648251", "0.56481564", "0.562932", "0.5624229", "0.5617046", "0.56161016", "0.5610...
0.62778974
3
As an air traffic controller To ensure safety I want to prevent landing when weather is stormy
@Test public void preventLandingWhenStormyWeather() { Exception exception = new Exception(); try { when(weatherMock.getWeather()).thenReturn("stormy"); heathrow.landing(tap); } catch (Exception e) { exception = e; } assertEquals("Not allowed to land in stormy weather", exception.getMessage()); assertEquals(0, heathrow.hangar.size()); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "boolean canSnowFallOn();", "@Test\n\tpublic void preventTakeOffWhenStormyWeather() {\n\t\tException exception = new Exception();\n\n\t\ttry {\n\t\t\theathrow.landing(tap);\n\t\t\t// airport instance return stormy weather\n\t\t\twhen(weatherMock.getWeather()).thenReturn(\"stormy\");\n\t\t\theathrow.takeoff(tap);\...
[ "0.60934746", "0.60600114", "0.6020324", "0.6005918", "0.5954852", "0.59411675", "0.59072024", "0.5754633", "0.5711718", "0.5625349", "0.56245804", "0.5588555", "0.5585657", "0.5576646", "0.5540423", "0.5522859", "0.55133754", "0.5505964", "0.55021465", "0.5496287", "0.548691...
0.62945664
0
unlike interfaces, abstract classes have concrete and at least one abstract methods
public void engine() { System.out.println("Follow engine guidelines"); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Override\n\tvoid methodAbstractAndSubclassIsAbstract() {\n\t\t\n\t}", "public boolean isAbstract()\n/* */ {\n/* 146 */ return false;\n/* */ }", "public boolean isAbstract();", "public abstract void abstractMethodToImplement();", "public interface AbstractC2883ha {\n boolean a();\n}", ...
[ "0.75825924", "0.749714", "0.74469423", "0.7307807", "0.719057", "0.70996076", "0.6987594", "0.6972758", "0.6967071", "0.6950546", "0.6943486", "0.6863291", "0.685282", "0.6848893", "0.68410933", "0.6824801", "0.6770064", "0.6746766", "0.6739988", "0.67218447", "0.6709935", ...
0.0
-1
api para consulta de estados pelo ibge
@RequestLine("GET /api/v1/localidades/estados") List<EstadoJson> get();
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public List<DietaBalanceada> consultar_dietaBalanceada();", "List<InsureUnitTrend> queryInsureDate();", "private void querys() {\n\t try {\r\n\t\tBoxYieldRptFactory.getRemoteInstance().SteDate();\r\n\t } catch (EASBizException e) {\r\n\t\t// TODO Auto-generated catch block\r\n\t\te.printStackTrace();\r\n...
[ "0.57930875", "0.57756174", "0.57678396", "0.5706893", "0.56750846", "0.56646216", "0.5663888", "0.56603354", "0.56313264", "0.5605635", "0.55964375", "0.55869246", "0.5585885", "0.55769235", "0.55761105", "0.5564627", "0.5537621", "0.5535061", "0.5517393", "0.55024445", "0.5...
0.54497033
29
add to local list
@Override public void run() { chatAdapter.notifyDataSetChanged(); chatListView.postInvalidate(); chatListView.smoothScrollToPosition(chatAdapter.getCount()); // input.setText(""); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public static void addList() {\n\t}", "public TempList<T> add(T elem) {\n chk();\n list.add(elem);\n return this;\n }", "private void add() {\n\n\t}", "private void addToList (IGameState state, MoveEvaluation m) {\n\t\tlist.append(new Pair(state.copy(), m));\n\t}", "...
[ "0.6899728", "0.6379032", "0.63095164", "0.6304549", "0.6206425", "0.61161435", "0.60938996", "0.60761184", "0.60517275", "0.603062", "0.60178185", "0.6010226", "0.59783924", "0.5972209", "0.59315705", "0.59313333", "0.5910321", "0.5896465", "0.58797455", "0.586597", "0.58449...
0.0
-1
add to local list
@Override public void run() { chatAdapter.notifyDataSetChanged(); chatListView.postInvalidate(); input.setText(""); chatListView.smoothScrollToPosition(chatAdapter.getCount()); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public static void addList() {\n\t}", "public TempList<T> add(T elem) {\n chk();\n list.add(elem);\n return this;\n }", "private void add() {\n\n\t}", "private void addToList (IGameState state, MoveEvaluation m) {\n\t\tlist.append(new Pair(state.copy(), m));\n\t}", "...
[ "0.690285", "0.6379813", "0.6313125", "0.6308416", "0.6207322", "0.6118244", "0.6094481", "0.60752255", "0.6053751", "0.6033701", "0.6020748", "0.6012052", "0.5981748", "0.5973048", "0.59339225", "0.5933156", "0.59119636", "0.5897413", "0.58798623", "0.5866773", "0.58486366",...
0.0
-1
This Method is used to take the folder path and select the workflow
public void operation() { try { if (path==null) { scanner = new Scanner(System.in); System.out.println("Enter The Directory (path):"); path= scanner.next(); } workFlow(); } catch(Exception e){ e.printStackTrace(); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void openWorkflow() {\n Workflow workflow = null;\n int returnVal = this.graphFileChooser.showOpenDialog(this.engine.getGUI().getFrame());\n\n if (returnVal == JFileChooser.APPROVE_OPTION) {\n File file = this.graphFileChooser.getSelectedFile();\n logger.debug(file...
[ "0.5929118", "0.560747", "0.56024116", "0.55863804", "0.5586077", "0.55642444", "0.54346347", "0.541485", "0.53642166", "0.5313975", "0.52878314", "0.52510226", "0.5247363", "0.5217956", "0.51996064", "0.5190395", "0.5178008", "0.5174907", "0.51661956", "0.51649654", "0.51615...
0.59374315
0
Sort the files in Ascending order
public static void ascendingOrder(File folder) { try { folder.exists(); File[] listOfFiles = folder.listFiles(); Arrays.sort(listOfFiles); if (listOfFiles.length > 0) { for(int i = 0; i < listOfFiles.length; i++) { System.out.println("File :" + listOfFiles[i].getName()); } } else { System.out.println("No Files in the folder"); } } catch (Exception e) { System.out.println(e.getMessage()); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private void sort() {\n setFiles(getFileStreamFromView());\n }", "public static void sortFiles(List<File> files)\r\n\t{\r\n\t\t/*\r\n\t\t * bubblesort algorithm\r\n\t\t */\r\n\t\tboolean changesMade = true;\r\n\t\t\r\n\t\twhile (changesMade)\r\n\t\t{\r\n\t\t\tchangesMade = false;\r\n\t\t\t\r\n\t\t\tfor(in...
[ "0.74731696", "0.7111747", "0.710987", "0.699678", "0.6826459", "0.6815126", "0.66033703", "0.6538002", "0.65178365", "0.6492611", "0.6469363", "0.6386946", "0.63803494", "0.63559103", "0.6309815", "0.63016057", "0.62505394", "0.6249481", "0.6248682", "0.6230955", "0.62021345...
0.7349515
1
Create the New file
public static void createFile(String path) { try { Scanner scanner = new Scanner(System.in); System.out.println("Enter the file name :"); String filepath = path+"/"+scanner.next(); File newFile = new File(filepath); newFile.createNewFile(); System.out.println("File is Created Successfully"); } catch (Exception ex) { System.out.println(ex.getMessage()); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "void createFile()\n {\n //Check if file already exists\n try {\n File myObj = new File(\"src/main/java/ex45/exercise45_output.txt\");\n if (myObj.createNewFile()) {\n System.out.println(\"File created: \" + myObj.getName());// created\n } else {\n ...
[ "0.7188921", "0.71493185", "0.70549244", "0.7046145", "0.703206", "0.6910916", "0.6853993", "0.68468094", "0.6830529", "0.68165386", "0.67405283", "0.6719523", "0.66984177", "0.6673988", "0.66271836", "0.6620416", "0.6601299", "0.65801793", "0.65754175", "0.6571958", "0.65545...
0.6245035
41
Find file in folder
public static void searchFile(String path){ try { Scanner scanner = new Scanner(System.in); System.out.println("Enter the File Name You need to Find:"); String name = scanner.next(); File file = new File(path + "/" + name); if (file.isFile()) { file.getName(); System.out.println("File Exists"); } else{ System.out.println("File Not Found"); } } catch (Exception e) { e.printStackTrace(); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public static void searchFile() \n\t{\n\t\t//Variable Declaration\n\t\tString fileName;\n\t\tScanner obj = new Scanner(System.in);\n\n\t\t//Read file name from user\n\t\tSystem.out.println(\"Enter file name to searched:\");\n\t\tfileName= obj.nextLine();\n\t\t\n\t\t//Searching the file\n\t\tboolean isFound = FileM...
[ "0.6908228", "0.6710762", "0.6532409", "0.6369467", "0.63034195", "0.62441343", "0.6228954", "0.6189753", "0.61800736", "0.6163421", "0.61620486", "0.6120826", "0.606627", "0.60177976", "0.60116124", "0.6007929", "0.5926833", "0.59147894", "0.5901405", "0.58858657", "0.581268...
0.6573692
2
Select the workflow for the selected Option
public void workFlow() { System.out.println("Enter the Option:"); options(); int option = scanner.nextInt(); switch (option) { case 1: file = new File(path); if(file.isDirectory()) { ascendingOrder(file); } else { System.out.println("Invalid path please select new context to continue"); } System.out.println("\n"); operation(); break; case 2: file = new File(path); if(file.isDirectory()) { createFile(path); System.out.println("[If you want to view the file added in the folder ,select option 1,else please continue]"); }else { System.out.println("Invalid path please select new context to continue"); } System.out.println("\n"); operation(); break; case 3: file = new File(path); if(file.isDirectory()) { deleteFile(path); System.out.println("\n"); }else { System.out.println("Invalid path please select new context to continue"); } operation(); break; case 4: file = new File(path); if(file.isDirectory()) { searchFile(path); System.out.println("\n"); }else { System.out.println("Invalid path please select new context to continue"); } operation(); break; case 5: file = new File(path); if(file.isDirectory()) { System.out.println("The current execution context is closed--------/"); System.out.println("\n"); }else { System.out.println("-----------Invalid Input-----------"); } path=null; operation(); break; case 6: System.out.println("--------------Thank You For Using File System------------"); break; default: System.out.println("The Option You Have Entered Does not exist ,Please enter the valid option:"); workFlow(); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Override\r\n\t\t\tpublic void actionPerformed(ActionEvent actionevent) {\n\t\t\t\tif (select.isSelected()) {\r\n\t\t\t\t\tservice.selectTask(row);\r\n\t\t\t\t\t// service.getTask(row).setSelected(true);\r\n\t\t\t\t} else {\r\n\t\t\t\t\tservice.cancleTask(row);\r\n\t\t\t\t\t// service.getTask(row).setSelected(fals...
[ "0.58419675", "0.5828239", "0.5735003", "0.57248336", "0.5722333", "0.56942517", "0.56331456", "0.56213397", "0.5602491", "0.5523965", "0.54948694", "0.5468157", "0.54679555", "0.5458593", "0.5456465", "0.54538465", "0.5411228", "0.54063976", "0.5401926", "0.5384144", "0.5359...
0.0
-1
Spy framework's main frame.
@Override public void build(final Component root, final Component currentComponent) { frame = new JFrame(ctx.getString(TITLE.getStr())); frame.getContentPane().setBackground(Color.decode(ctx.getString(BG_COLOR.getStr()))); frame.setPreferredSize(new Dimension(ctx.getInt(WIDTH.getStr()), ctx.getInt(HEIGHT.getStr()))); frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); // Spy framework's status bar. statusBar = new SpyStatusBar(ctx); frame.getContentPane().add(statusBar.getStatusBarPanel(), BorderLayout.SOUTH); // Spy framework's menu. SpyMenu spyMenu = new SpyMenu(statusBar); frame.setJMenuBar(spyMenu.getMenuBar()); // Spy framework's toolbar. SpyToolBar toolBar = new SpyToolBar(statusBar); frame.getContentPane().add(toolBar.getToolBar(), BorderLayout.NORTH); // Spy framework's tree panel. SpyTreePanel treePanel = new SpyTreePanel(); frame.getContentPane().add(treePanel.getTreePanel(), BorderLayout.WEST); // Spy framework's properties panel. SpyPropertiesPanel propertiesPanel = new SpyPropertiesPanel(); frame.getContentPane().add(propertiesPanel.getPropertiesPanel(), BorderLayout.CENTER); JPanel fut = new JPanel(); fut.setBackground(Color.decode("#CCE0FF")); frame.getContentPane().add(fut, BorderLayout.EAST); // Spy framework's settings for display. frame.setExtendedState(java.awt.Frame.MAXIMIZED_BOTH); frame.pack(); frame.setVisible(true); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public launchFrame() {\n \n initComponents();\n \n }", "@Test\n\n\tpublic void testCallMain() {\n\n\t\tDABPanel.main(new String[0]);\n\n\t\tSwingUtilities.invokeLater(() -> {\n\n\t\t\tfor (Frame frame : Frame.getFrames()) {\n\n\t\t\t\tframe.dispose();\n\n\t\t\t}\n\n\t\t});\n\n\t}", "public ...
[ "0.6664409", "0.6571429", "0.65374845", "0.6493795", "0.648736", "0.64291024", "0.64279526", "0.6378004", "0.6376791", "0.635743", "0.63502234", "0.63449544", "0.6337825", "0.6335407", "0.6270044", "0.6267727", "0.62099534", "0.6178901", "0.61410606", "0.6139058", "0.61011857...
0.5993371
35
TODO Autogenerated method stub
public static void main(String[] args) throws IOException { FileManager csv=new FileManager(); csv.readListOfFiles(); csv.readFile(); //csv.tk.displayTokens(); //csv.it.displayHashMap(); csv.writeTokensToFile(csv.tk.tokensMap); csv.matcher.longestSequence(csv.it); //csv.it.intTokenList was supposed to be passed but since I need csv.it object in caller so im passing it csv.matcher.displaySubsequences(csv.it); csv.writeMatchesToFile(csv.matcher.resultMap,csv.it); System.out.println("\nProgram Ends "); }
{ "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
For all ajax call in meter replacement screen
public String ajaxMethod() { AppLog.begin(); try { Map<String, Object> session = ActionContext.getContext() .getSession(); String userId = (String) session.get("userId"); if (null == userId || "".equals(userId)) { addActionError(getText("error.login.expired")); inputStream = new StringBufferInputStream("ERROR:" + getText("error.login.expired") + ", Please re login and try Again!"); AppLog.end(); return "login"; } if ("populateMRNo".equalsIgnoreCase(hidAction)) { Map<String, String> returnMap = (HashMap<String, String>) GetterDAO .getMRNoListMap(selectedZone); StringBuffer dropDownSB = new StringBuffer(512); dropDownSB .append("<select name=\"selectedMRNo\" id=\"selectedMRNo\" class=\"selectbox\" onfocus=\"fnCheckZone();\" onchange=\"fnGetArea();\">"); dropDownSB.append("<option value=''>Please Select</option>"); if (null != returnMap && !returnMap.isEmpty()) { for (Entry<String, String> entry : returnMap.entrySet()) { dropDownSB.append(optionTagBeginPart1); dropDownSB.append(entry.getKey()); dropDownSB.append(optionTagBeginPart2); dropDownSB.append(entry.getValue()); dropDownSB.append(optionTagEnd); } } dropDownSB.append(selectTagEnd); session.put("MRNoListMap", returnMap); inputStream = new StringBufferInputStream(dropDownSB.toString()); } if ("populateArea".equalsIgnoreCase(hidAction)) { Map<String, String> returnMap = (HashMap<String, String>) GetterDAO .getAreaListMap(selectedZone, selectedMRNo); StringBuffer dropDownSB = new StringBuffer(512); dropDownSB .append("<select name=\"selectedArea\" id=\"selectedArea\" class=\"selectbox-long\" onfocus=\"fnCheckZoneMRNo();\" >"); dropDownSB.append("<option value=''>Please Select</option>"); if (null != returnMap && !returnMap.isEmpty()) { for (Entry<String, String> entry : returnMap.entrySet()) { dropDownSB.append(optionTagBeginPart1); dropDownSB.append(entry.getKey()); dropDownSB.append(optionTagBeginPart2); dropDownSB.append(entry.getValue()); dropDownSB.append(optionTagEnd); } } dropDownSB.append(selectTagEnd); session.put("AreaListMap", returnMap); inputStream = new StringBufferInputStream(dropDownSB.toString()); } /** * @Added by Madhuri as per Jtrac -Djb:- 4464 & Open Project id 1203 to match mrkey tagged with AMR user & The mrkey selected by User for new job submit * @return * @author 735689 * @since 03-06-2016 */ if ("validateMrkey".equalsIgnoreCase(hidAction)) { Map<String, String> mrkyFromSession = (Map<String, String>) session.get("taggedMrkey"); String validMrkey = MRDScheduleDownloadDAO.getMrdCode( selectedZone, selectedMRNo, selectedArea); AppLog.info("Mrkeys Tagged to Logged In users is/Are" +mrkyFromSession.size()); try { if(null != validMrkey && null != mrkyFromSession && mrkyFromSession.containsValue(validMrkey)){ inputStream = new StringBufferInputStream("validMrkey"); } else{ inputStream = new StringBufferInputStream("ERROR:You do not have security rights for this action. Please select the input fields correctly."); } } catch(Exception e){ inputStream = new StringBufferInputStream("ERROR:"); AppLog.error(e); } /*@Ended by Madhuri as per Jtrac -Djb:- 4464 & Open Project id 1203 to match mrkey tagged with AMR user & The mrkey selected by User for new job submit */ } response.setHeader("Expires", "0"); response.setHeader("Pragma", "cache"); response.setHeader("Cache-Control", "private"); } catch (Exception e) { inputStream = new StringBufferInputStream( "ERROR:There was an error at Server end."); // response.setHeader("Expires", "0"); // response.setHeader("Pragma", "cache"); // response.setHeader("Cache-Control", "private"); AppLog.error(e); } AppLog.end(); return SUCCESS; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void ajaxListener() {\n System.out.println(\"!ttttt \" );\n }", "@Override\n public void onWebBridgeResult(String url, JSONObject json, AjaxStatus ajaxStatus) {\n\n // TODO Auto-generated method stub\n int status = 0;\n String msg = \"\";\n\n try {\n st...
[ "0.6168905", "0.60722804", "0.59428793", "0.57372093", "0.57323694", "0.57114106", "0.563447", "0.56002396", "0.5596802", "0.55905086", "0.5579135", "0.55782986", "0.5573137", "0.55724967", "0.5543111", "0.55405354", "0.5496946", "0.54862523", "0.5474093", "0.54698735", "0.54...
0.0
-1
Created by yangxiong on 2018/4/22/022.
public interface ILoginView { void showProgress(); void hideProgress(); void setUsernameError(); void setPasswordError(); void navigateToHome(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Override\n public void perish() {\n \n }", "private stendhal() {\n\t}", "@Override\r\n\tpublic void bicar() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void bicar() {\n\t\t\r\n\t}", "@Override\n\tpublic void comer() {\n\t\t\n\t}", "@Override\n\tpublic void grabar() {\n\t\t\n\t}", "private sta...
[ "0.5949967", "0.5892733", "0.57048285", "0.57048285", "0.5677127", "0.565009", "0.56455433", "0.5641377", "0.5609627", "0.55813515", "0.5514394", "0.551135", "0.5493289", "0.54800606", "0.54792297", "0.5460331", "0.544987", "0.54459745", "0.5439848", "0.54396296", "0.54354715...
0.0
-1
Returns the next element in the iteration without advancing the iterator.
public Integer peek() { if (list == null || list.size() == 0) { return -1; } return list.peek(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Override\n public Integer next() {\n if (!isPeeked && hasNext())\n return iterator.next();\n int toReturn = peekedElement;\n peekedElement = -1;\n isPeeked = false;\n return toReturn;\n }", "Object getNextElement() throws NoSuchElementException;", "@Override\n public Integer next(...
[ "0.7958216", "0.794867", "0.78590846", "0.78295815", "0.77967113", "0.77268815", "0.77264446", "0.7711753", "0.7703207", "0.7672829", "0.7652239", "0.76162845", "0.7611684", "0.7596586", "0.75893503", "0.7583718", "0.7583034", "0.75609744", "0.7560039", "0.75470746", "0.75417...
0.0
-1
Intent: Provide the user with the option to run various evaluation and grading tasks. Once the user selects a task, the task is run and the result of the task is displayed to the console. Postcondition1 (Task and secret prompt): The user is prompted to select a task and is then prompted to enter a secret. Postcondition2 (Task execution): The task the user selected has been executed.
public static void main(String[] args) { // Set up Scanner object Scanner keyboard = new Scanner(System.in); // Print welcome message System.out.println("Welcome to JGRAM."); // Loop until the user indicates they wish to exit boolean keepGoing = true; while (keepGoing) { // Post1 Task and secret prompt System.out.println("\n---------------------------------[ INPUT ]--" + "-----------------------------------\n"); String task = prompt(TASK_SELECTION, keyboard); // Post3 Task execution switch (task) { // New Document case "1": Task newDocTask = new NewDocumentTask(keyboard); newDocTask.performTask(); break; // Evaluation case "2": String evalSecret = prompt(GET_SECRET, keyboard); System.out.println(SECRET_REMINDER); Task evalTask = new EvaluationTask(evalSecret, keyboard); evalTask.performTask(); break; // Tamper case "3": String tamperSecret = prompt(GET_SECRET, keyboard); System.out.println(SECRET_REMINDER); Task tamperTask = new TamperTask(tamperSecret, keyboard); tamperTask.performTask(); break; // Report case "4": Task assignmentReportTask = new AssignmentReportTask(keyboard); assignmentReportTask.performTask(); break; // Help case "5": help(); break; // Exit case "6": keepGoing = false; break; // Invalid selection default: System.out.println("Invalid selection. Please try again."); break; } // End switch } // End while keyboard.close(); System.out.println("Goodbye..."); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void mainCommands() {\n\t\tint inputId = taskController.getInt(\"Please input the number of your option: \", \"You must input an integer!\");\n\t\tswitch (inputId) {\n\t\tcase 1:\n\t\t\tthis.taskController.showTaskByTime();\n\t\t\tbreak;\n\t\tcase 2:\n\t\t\tthis.taskController.filterAProject();\n\t\t\tbreak...
[ "0.5996974", "0.57933354", "0.5737513", "0.56227565", "0.5587669", "0.5580666", "0.5552843", "0.5469504", "0.5460453", "0.5459535", "0.54464215", "0.54089487", "0.5364835", "0.535935", "0.5334309", "0.5299293", "0.5282253", "0.5255164", "0.5252614", "0.52399844", "0.52343595"...
0.6074495
0