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
/ Get the last reader for the index in argument and register (inc a counter for that reader)
public synchronized IndexReader getReader(File indexDir) throws Exception{ if (!mReaders.containsKey(indexDir)){ setNewReader(indexDir); return getReader(indexDir); } synchronized (mReaders) { try{ List<ReaderContainer> lReader = mReaders.get(indexDir); log.debug("getReader :: lReader size = "+lReader.size()+" | nb index files= "+indexDir.listFiles().length); if (lReader.size() == 0) { setNewReader(indexDir); } else { ReaderContainer readerContainer = lReader.get(lReader.size()-1); if (readerContainer.isClosable()){ readerContainer.close(); lReader.remove(readerContainer); log.debug("getReader :: closed = (unRegister) size lreader = "+lReader.size()); setNewReader(indexDir); } } ReaderContainer readerContainer = lReader.get(lReader.size()-1); readerContainer.incNbSearch(); return readerContainer.getReader(); } catch(Exception ex){ log.fatal("getReader :: mReaders.containsKey(indexDir)" +mReaders.containsKey(indexDir)+" ERR:"+ex); if (mReaders.containsKey(indexDir)){ List<ReaderContainer> lReader = mReaders.get(indexDir); log.fatal("getReader :: size reader for this index : "+lReader.size() +" index: "+indexDir.getCanonicalPath()); } return null; } } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "int readerIndex();", "private Optional<Integer> nextReaderIndex() {\n Optional<Integer> index = Optional.absent();\n for (int i = 0; i < callReaders.size(); i++) {\n if (callReaders.get(i).hasNext()) {\n index = Optional.of(i);\n break;\n }\n }\n\n return index;\n }", "prot...
[ "0.6906732", "0.66203475", "0.6089616", "0.5944626", "0.56793886", "0.56369495", "0.5613393", "0.55494565", "0.5532301", "0.552472", "0.55126446", "0.54780155", "0.546125", "0.54502374", "0.5450125", "0.5436032", "0.54181284", "0.5417633", "0.5413693", "0.5411949", "0.5378583...
0.5325518
24
/ Before changing the reader, check if the latest reader is being used by someone, if not close that reader
public synchronized void setNewReader(File indexDir) throws IOException{ synchronized (mReaders) { try{ List<ReaderContainer> lReader; if (!mReaders.containsKey(indexDir)){ lReader = new ArrayList<ReaderContainer>(); lReader.add(new ReaderContainer(IndexReader.open(FSDirectory.open(indexDir)))); mReaders.put(indexDir, lReader); } else { lReader = mReaders.get(indexDir); if (lReader.size() > 0){ log.debug("setNewReader-STEP1 :: lReader.size() = " + lReader.size()); // for (int i = lReader.size() - 1; i >= 0 ; i--) { // ReaderContainer readerContainer = lReader.get(i); ReaderContainer readerContainer = lReader.get(lReader.size() - 1); if (readerContainer.isClosable()){ readerContainer.close(); lReader.remove(readerContainer); } // } } lReader.add(new ReaderContainer(IndexReader.open(FSDirectory.open(indexDir)))); log.debug("setNewReader :: lReader.size() = " + lReader.size()); } } catch(Exception ex){ log.fatal("setNewReader :: mReaders.containsKey(indexDir)" +mReaders.containsKey(indexDir)+" indexDir "+indexDir.getCanonicalPath()+" ERR:"+ex); } } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void checkReadLock() {\r\n return;\r\n }", "boolean isUsedForReading();", "public void closeReader() throws IOException{\n if(isOpen){\n csvReader.close();\n }\n\n }", "public void lastReaderAdded(){\r\n\t\tdoneAddingReaders = true;\r\n\t}", "public boolean ...
[ "0.6323008", "0.62322474", "0.62014425", "0.6182321", "0.6105456", "0.6065783", "0.60186636", "0.59889704", "0.598833", "0.59451413", "0.5878823", "0.57713974", "0.57544327", "0.5743618", "0.5645277", "0.56452674", "0.5617421", "0.56120765", "0.560596", "0.56057215", "0.56021...
0.0
-1
/ Unregister a reader, if it's the last one using it then close the reader except if it's the only reader for that index!
public synchronized void unRegister(File indexDir, IndexReader reader) throws Exception{ if (!mReaders.containsKey(indexDir)){ throw new Exception("Unauthorized operation"); } synchronized (mReaders) { List<ReaderContainer> lReader = mReaders.get(indexDir); // log.debug("unRegister-STEP1 :: lReader size = "+lReader.size()+" | index of reader = "+lReader.indexOf(new ReaderContainer(reader))); // ReaderContainer readerContainer = lReader.get(lReader.indexOf(new ReaderContainer(reader))); readerContainer.decNbSearch(); if (readerContainer.isClosable()){ readerContainer.close(); lReader.remove(readerContainer); log.debug("unRegister :: closed = (unRegister) size lreader = "+lReader.size()+" | reader = "+reader); } log.debug("unRegister-STEP2 :: lReader size = "+lReader.size()+" | index of reader = "+lReader.indexOf(new ReaderContainer(reader))); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void closeReader() throws IOException{\n if(isOpen){\n csvReader.close();\n }\n\n }", "public void close() throws IOException {\r\n reader.close();\r\n reader = null;\r\n }", "public void disconnect() {\n if (reader != null) {\n reader.s...
[ "0.6394177", "0.63647985", "0.61902213", "0.61898804", "0.61553764", "0.6113237", "0.6054358", "0.6007875", "0.60073483", "0.59979135", "0.5911924", "0.5910779", "0.583613", "0.58337957", "0.58102196", "0.579812", "0.57628804", "0.57265234", "0.5722915", "0.57041174", "0.5692...
0.6972261
0
Do tasks upsertion This is the place where you may catch and treat exceptions for which tasks upsertion shouldn't be retried (e.g in case of invalid tasks). Otherwise throw exception
private void upsertTasks(UpsertTasksEvent upsertTasksEvent, UpsertTaskInputTopic inputTopic) { LocalDateTime startTime = LocalDateTime.now(); try { upsertTasksInternal(upsertTasksEvent, inputTopic); } catch ( ResourceNotFoundException e) { LOGGER.error("Upserting tasks for lane {} failed with exception. " + "Won't be retried as failure is unrecoverable for event: {}", inputTopic, upsertTasksEvent, e); publishIncrementMetric(DD_ASPECT_UPSERT_TASKS_BY_KAFKA_EVENTS + inputTopic + ".EventCountUnrecoverable"); } publishHistogramMetric(DD_ASPECT_UPSERT_TASKS_BY_KAFKA_EVENTS + inputTopic + ".EventUpsertDuration", Duration.between(startTime, LocalDateTime.now()).toMillis()); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private void tryDoingTasksInQueue() {\n var list = queue.exceptionsList;\n var t2 = new Thread(() -> {\n Retry.Operation op = (list1) -> {\n if (!list1.isEmpty()) {\n LOG.warn(\"Error in accessing queue db to do tasks, trying again..\");\n throw list1.remove(0);\n }\n ...
[ "0.63172257", "0.61723197", "0.61274755", "0.5943856", "0.58033216", "0.57987833", "0.5777097", "0.57719344", "0.5743913", "0.5739406", "0.5690335", "0.5672492", "0.5668571", "0.56621313", "0.5655954", "0.56531864", "0.5597925", "0.5584693", "0.5563575", "0.55419505", "0.5505...
0.70896673
0
Submits the sick note form. Note that this method doesn't wait until something happens (e.g. submit button is stale for instance). You may have to add a wait yourself after calling this method.
public void submit() { driver.findElement(SUBMIT_SELECTOR).click(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public static void SubmitNurseNote(WebDriver driver) throws Exception{\n\t\tWaits.ForElementToBeClickable(driver, btn_ES_Submit(driver));\n\t\tbtn_ES_Submit(driver).click();\n\t\tVerify.ExactPageHeader(driver, \"Hotbox\");\n\t}", "public void clickOnSubmitButton() throws FileNotFoundException, IOException, Parse...
[ "0.6893053", "0.6025559", "0.6018387", "0.5890912", "0.5887819", "0.5854666", "0.5832337", "0.5792827", "0.5629514", "0.55484915", "0.5475354", "0.5467672", "0.5443922", "0.53879297", "0.53161657", "0.53035605", "0.5301713", "0.5287918", "0.5280489", "0.5162904", "0.51037323"...
0.62946194
1
Check if the given name matches the selected person.
public boolean personSelected(String name) { final WebElement selectElement = driver.findElement(PERSON_SELECTOR); final String value = selectElement.getAttribute("value"); final WebElement optionElement = selectElement.findElement(By.cssSelector("option[value=\"" + value + "\"]")); return optionElement.getText().strip().equals(name); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Override\n\tpublic boolean equals(Object target) {\n\t\treturn name.equals(((Person)target).getName());\n\t}", "public boolean match(String str){\n if(this.name.equalsIgnoreCase(str))\n return true; \n return false;\n }", "public boolean isValidName(String proposedName);", "pub...
[ "0.6405301", "0.63850343", "0.63636136", "0.63568485", "0.6322851", "0.6255567", "0.62422276", "0.6161998", "0.61495334", "0.6141819", "0.6090869", "0.6050626", "0.603821", "0.6026324", "0.60240173", "0.6022874", "0.6008451", "0.6008338", "0.5985415", "0.5975163", "0.59707713...
0.78268766
0
/reader = Resources.getResourceAsReader("conf/mybatisconfig.xml"); sqlSessionFactory = new SqlSessionFactoryBuilder().build(reader); SqlSession session = sqlSessionFactory.openSession();
public static void main(String[] args) throws IOException { InputStream inputStream = Resources.getResourceAsStream("conf/mybatis-config.xml"); SqlSessionFactory sqlSessionFactory = new SqlSessionFactoryBuilder().build(inputStream); SqlSession session=sqlSessionFactory.openSession(); List<Category> cs = session.selectList("listCategory"); for(Category c: cs){ System.out.println(c.toString()); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public static void main(String[] args) {\n\n String resource = \"spring/mybatis/mybatis.xml\";\n InputStream inputStream = null;\n try {\n inputStream = Resources.getResourceAsStream(resource);\n }catch (IOException e){\n e.printStackTrace();\n }\n\n ...
[ "0.74819404", "0.7068522", "0.7028377", "0.6655419", "0.6102199", "0.6022709", "0.6008246", "0.5886724", "0.5865798", "0.569887", "0.56730896", "0.56685174", "0.5636201", "0.5573706", "0.5549966", "0.55416775", "0.554062", "0.5531431", "0.5530673", "0.5486471", "0.5477317", ...
0.66007364
4
Writes changes to underlying player.
protected void apply() { player.setAutoRoll(autoroll); player.setMission(mission); player.setState(state); player.getCards().setArtillery(cards.getArtillery()); player.getCards().setCavalry(cards.getCavalry()); player.getCards().setInfantry(cards.getInfantry()); player.getCards().setJokers(cards.getJokers()); Member member = player.getMember(); if(score == Score.WIN) { member.setScore(member.getScore() + player.getGame().getPlayers().size() - 1); member.setWins(member.getWins() + 1); } else if(score == Score.LOSS) { member.setScore(member.getScore() - 1); member.setLosses(member.getLosses() + 1); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Override\n\tpublic void savePlayerData(OutputStream os) {\n\t\t\n\t}", "@Override\n\tpublic void savePlayerData(OutputStream os) {\n\n\t}", "@Override\n\tpublic void savePlayerData(OutputStream arg0) {\n\n\t}", "@Override\n\tpublic void savePlayerData(OutputStream arg0)\n\t{\n\n\t}", "public void saveCurr...
[ "0.6944478", "0.69404244", "0.68928134", "0.6853752", "0.64095455", "0.63631105", "0.6331227", "0.6244082", "0.6210277", "0.6164809", "0.61017627", "0.608608", "0.5982316", "0.59446573", "0.5943041", "0.5941335", "0.593781", "0.59358317", "0.59076536", "0.5896921", "0.5893416...
0.0
-1
called by internal mechanisms, do not call yourself.
public void __setDaoSession(DaoSession daoSession) { this.daoSession = daoSession; myDao = daoSession != null ? daoSession.getBMessageDao() : null; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public final void mo51373a() {\n }", "@Override\n\tpublic void sacrifier() {\n\t\t\n\t}", "@Override\n\tprotected void interr() {\n\t}", "@Override\n public void perish() {\n \n }", "@Override\r\n\t\tprotected void run() {\n\t\t\t\r\n\t\t}", "@Override\r\n\tpublic void comer() \r\n\t{...
[ "0.6371722", "0.6260732", "0.6228073", "0.616492", "0.6125714", "0.6042472", "0.5979736", "0.5976913", "0.5956299", "0.5942653", "0.5929282", "0.5929282", "0.5929282", "0.5929282", "0.5929282", "0.5929282", "0.590189", "0.5893604", "0.5893604", "0.58852583", "0.58852583", "...
0.0
-1
Toone relationship, resolved on first access.
public BUser getBUserSender() { Long __key = this.Sender; if (BUserSender__resolvedKey == null || !BUserSender__resolvedKey.equals(__key)) { if (daoSession == null) { throw new DaoException("Entity is detached from DAO context"); } BUserDao targetDao = daoSession.getBUserDao(); BUser BUserSenderNew = targetDao.load(__key); synchronized (this) { BUserSender = BUserSenderNew; BUserSender__resolvedKey = __key; } } return BUserSender; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Test\n\tpublic void oneToOneNoBind() {\n\t\tSystem.out.println(\"============oneToOneNoBind=========\");\n\t\tUser u = new User();\n\t\tAddress a = new Address();\n\t\tList<User> users = Dao.queryForEntityList(User.class, select(), u.all(), \",\", a.all(), from(), u.table(), \",\",\n\t\t\t\ta.table(), \" where \"...
[ "0.5862854", "0.5857389", "0.57361376", "0.5697713", "0.56714755", "0.5648432", "0.56100655", "0.55987066", "0.55692047", "0.5493379", "0.54847467", "0.5479508", "0.54721624", "0.546691", "0.5385023", "0.5373879", "0.5369611", "0.53155494", "0.52854615", "0.525083", "0.524175...
0.0
-1
Toone relationship, resolved on first access.
public BThread getThread() { Long __key = this.threadDaoId; if (thread__resolvedKey == null || !thread__resolvedKey.equals(__key)) { if (daoSession == null) { throw new DaoException("Entity is detached from DAO context"); } BThreadDao targetDao = daoSession.getBThreadDao(); BThread threadNew = targetDao.load(__key); synchronized (this) { thread = threadNew; thread__resolvedKey = __key; } } return thread; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Test\n\tpublic void oneToOneNoBind() {\n\t\tSystem.out.println(\"============oneToOneNoBind=========\");\n\t\tUser u = new User();\n\t\tAddress a = new Address();\n\t\tList<User> users = Dao.queryForEntityList(User.class, select(), u.all(), \",\", a.all(), from(), u.table(), \",\",\n\t\t\t\ta.table(), \" where \"...
[ "0.586295", "0.5858311", "0.57361096", "0.56971985", "0.5671697", "0.56491035", "0.5610516", "0.5598799", "0.5569257", "0.5493518", "0.5485247", "0.54806054", "0.5471793", "0.54670626", "0.538438", "0.53736156", "0.5369618", "0.5316193", "0.5285615", "0.52508867", "0.52423453...
0.0
-1
Tomany relationship, resolved on first access (and after reset). Changes to tomany relations are not persisted, make changes to the target entity.
public List<BMessageReceipt> getBMessageReceiptList() { if (bMessageReceiptList == null) { if (daoSession == null) { throw new DaoException("Entity is detached from DAO context"); } BMessageReceiptDao targetDao = daoSession.getBMessageReceiptDao(); List<BMessageReceipt> bMessageReceiptListNew = targetDao._queryBMessage_BMessageReceiptList(id); synchronized (this) { if(bMessageReceiptList == null) { bMessageReceiptList = bMessageReceiptListNew; } } } return bMessageReceiptList; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Override\n\tpublic void onRelationshipChanged() {\n\t\tloadData();\n\t}", "public void onRelationshipChanged();", "public void setHasEntity(Boolean setTo) {\n \n hasEntity_ = setTo;\n \n }", "@Override\n public void onRelationshipMapLoaded() {\n }", "private void makeUnidirec...
[ "0.5940735", "0.5846391", "0.5734578", "0.56806374", "0.56424737", "0.55891424", "0.55707717", "0.55027515", "0.5477861", "0.54467994", "0.54185194", "0.53971165", "0.5334147", "0.53232676", "0.5309395", "0.5305609", "0.52375084", "0.5197301", "0.5191754", "0.5176072", "0.515...
0.0
-1
Resets a tomany relationship, making the next get call to query for a fresh result.
public synchronized void resetBMessageReceiptList() { bMessageReceiptList = null; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "void unsetFurtherRelations();", "public void resetRelatesToList(MappingType mapping) {\n\t\tmapping.getRelatesTo().clear();\n\t}", "void clearAssociations();", "public void resetIds()\r\n {\r\n this.ids = null;\r\n }", "public void resetAll() {\n reset(getAll());\n }", "public void...
[ "0.6746963", "0.6169835", "0.6005044", "0.5843066", "0.56396157", "0.5581024", "0.556239", "0.5501575", "0.54860204", "0.54579014", "0.5418305", "0.538338", "0.53609544", "0.5352021", "0.5333522", "0.53251266", "0.5289436", "0.52858824", "0.52719766", "0.5256134", "0.52523345...
0.0
-1
KEEP METHODS put your custom methods here
@Override public BPath getBPath() { if (getThread() == null) { if (DEBUG) Timber.e("Owner Thread is null"); return null; } return getThread().getBPath().addPathComponent(BFirebaseDefines.Path.BMessagesPath, entityID); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Override\n\t\tpublic void method() {\n\t\t\t\n\t\t}", "private void someUtilityMethod() {\n }", "private void someUtilityMethod() {\n }", "public void doGeneralThings() {\n logger.debug(\"Overrided or implememted method - doGeneralThings!\");\n }", "@Override\n\tpublic void myMetho...
[ "0.6209938", "0.618594", "0.618594", "0.60465866", "0.6014668", "0.60098", "0.59371775", "0.5936077", "0.5929191", "0.5929191", "0.59234256", "0.5923415", "0.5899172", "0.58520025", "0.5821774", "0.58198124", "0.57914096", "0.57836086", "0.57836086", "0.57821524", "0.5767343"...
0.0
-1
Null safe version of getIsRead
public boolean wasRead(){ return isRead==null || isRead; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "boolean hasRead();", "boolean hasForRead();", "boolean getForRead();", "boolean getRead();", "public boolean isRead(){\n \treturn isRead;\n }", "public Boolean getIsRead() {\n return isRead;\n }", "public boolean getRead()\n\t{\n\t\treturn this.read;\n\t}", "public boolean getForRead(...
[ "0.8278433", "0.82125014", "0.820625", "0.8184006", "0.7787873", "0.7656183", "0.74967474", "0.7438545", "0.7428327", "0.74217033", "0.73538804", "0.7337216", "0.7335713", "0.7295503", "0.71608925", "0.71407074", "0.7123679", "0.7110584", "0.7077705", "0.7052733", "0.6900326"...
0.819846
3
used for initial creation of receipts
public Boolean updateUserReadReceipt(BUser reader, int messageReceiptStatus){ // Do not set read-receipts for public chats! if (this.getThread().getTypeSafely() == BThread.Type.Public || this.getThread().getTypeSafely() == BThread.Type.PublicPrivate) { return false; } BMessageReceipt oldBMessageReceipt = getUserReadReceipt(reader); // Only update receipts that have been initialized if(oldBMessageReceipt.getReadStatus() == null) return false; // Make sure a higher status value is not overwritten. if (oldBMessageReceipt.getReadStatus() >= messageReceiptStatus) return false; // Remove old user read receipt removeUserReadReceipt(reader); createUserReadReceipt(reader, messageReceiptStatus); return true; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public String insertStartReceipt() {\r\n\t\tif (receiptS == null) {\r\n\t\t\treceiptS = new Receipt();\r\n\t\t}\r\n\t\treturn SUCCESS;\r\n\t}", "public abstract void generateReceipt(Transaction trans);", "public receipt() {\n initComponents();\n \n }", "public void createInvoice() {\n\t}", ...
[ "0.6749398", "0.6357229", "0.62494683", "0.6154732", "0.61162937", "0.6039121", "0.5984928", "0.59235954", "0.58418113", "0.5805985", "0.5786844", "0.5751941", "0.5749392", "0.5740405", "0.57147914", "0.5692238", "0.56876206", "0.5648085", "0.5617594", "0.5617594", "0.5614593...
0.0
-1
used for initial creation of receipts and loading existing ones from remote DB
public void createUserReadReceipt(BUser reader, int messageReceiptStatus){ // Add the read receipt to the local dao database BMessageReceipt bMessageReceipt = new BMessageReceipt(); // Add/update a read receipt removeUserReadReceipt(reader); resetBMessageReceiptList(); List readReceipts = getBMessageReceiptList(); bMessageReceipt.setReader(reader); bMessageReceipt.setReaderId(reader.getId()); bMessageReceipt.setBMessageId(this.getId()); bMessageReceipt.setReadStatus(messageReceiptStatus); daoSession.insertOrReplace(bMessageReceipt); readReceipts.add(bMessageReceipt); DaoCore.updateEntity(this); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void initiateStore() {\r\n\t\tURLConnection urlConnection = null;\r\n\t\tBufferedReader in = null;\r\n\t\tURL dataUrl = null;\r\n\t\ttry {\r\n\t\t\tdataUrl = new URL(URL_STRING);\r\n\t\t\turlConnection = dataUrl.openConnection();\r\n\t\t\tin = new BufferedReader(new InputStreamReader(urlConnection.getInputS...
[ "0.5762808", "0.56508183", "0.5646619", "0.555531", "0.5483904", "0.5458896", "0.5425669", "0.53471035", "0.5342265", "0.5294996", "0.52900064", "0.5250637", "0.5237278", "0.52330303", "0.52132964", "0.521016", "0.520216", "0.5192217", "0.5167866", "0.51547366", "0.5127959", ...
0.5132624
20
Initialize all readers in the list of listeners in the thread to be included in reader list
public void initBMessageReceipts(){ List<BUser> readers; readers = getBThreadUsers(); // Do not init for public threads. if(this.getThread().getType() == com.braunster.chatsdk.dao.BThread.Type.Public || this.getThread().getType() == com.braunster.chatsdk.dao.BThread.Type.PublicPrivate) return; // If no readers, why should there be receipts? if (readers.isEmpty()){ return; } // add all users in the chat other than yourself for (BUser reader : readers) { if (getBUserSender().equals(reader)) continue; createUserReadReceipt(reader, none); } this.update(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Override\n protected void initializeReader() {\n this.fileList = new ArrayList<>();\n this.fileListPosition = new AtomicInteger(0);\n this.currentTextAnnotation = new AtomicReference<>();\n }", "@Override\r\n\tpublic void initListeners() {\n\t\t\r\n\t}", "private void initReader(boo...
[ "0.653488", "0.61845", "0.61261857", "0.61045605", "0.6030467", "0.5987457", "0.59717166", "0.597123", "0.59678066", "0.5959909", "0.58412206", "0.58114517", "0.58015037", "0.5765232", "0.57315946", "0.5702542", "0.56969166", "0.5695044", "0.565556", "0.56473464", "0.56446797...
0.0
-1
Returns the ReadStatus that is representative lowest common read Status of all users in Map
public int getCommonReadStatus(){ List<BMessageReceipt> readReceipts; resetBMessageReceiptList(); readReceipts = getBMessageReceiptList(); Boolean delivered = false; Boolean read = false; for ( BMessageReceipt readReceipt : readReceipts) { switch (readReceipt.getReadStatus()) { case none: return none; case BMessageReceiptEntity.ReadStatus.delivered: delivered = true; break; case BMessageReceiptEntity.ReadStatus.read: read = true; break; } } // if(!read){ // BNetworkManager.sharedManager().getNetworkAdapter().readReceiptsOnFromUI(this); // } if(delivered){ return BMessageReceiptEntity.ReadStatus.delivered; } else if (read) { return BMessageReceiptEntity.ReadStatus.read; } else { logMessage = "Message has no readers"; if(DEBUG) Log.d(TAG , logMessage); return none; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public IsolationLevel lowestCommon(IsolationLevel level) {\r\n return (ordinal() >= level.ordinal()) ? level : this;\r\n }", "public ReadPreference getPreferredRead() {\n if (preferredRead != null && !preferredRead.isEmpty()) {\n return MONGO_READ_PREF.get(preferredRead);\n }\n...
[ "0.5053181", "0.4925301", "0.48671448", "0.4785146", "0.47557464", "0.4731274", "0.4718448", "0.4683746", "0.4670675", "0.4629703", "0.46070856", "0.45889017", "0.45734477", "0.4553262", "0.45489088", "0.4541884", "0.45309535", "0.45235065", "0.45066202", "0.4500968", "0.4487...
0.6447678
0
Mandatory empty constructor for the fragment manager to instantiate the fragment (e.g. upon screen orientation changes).
public MyLocationsFragment() { }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public FragmentMy() {\n }", "public RickAndMortyFragment() {\n }", "public MainActivityFragment() {\n }", "public MainActivityFragment() {\n }", "public RegisterFragment() {\n // Required empty public constructor\n }", "public VehicleFragment() {\r\n }", "public EmployeeFragmen...
[ "0.80315286", "0.7699558", "0.767644", "0.767644", "0.75390023", "0.7535283", "0.7532307", "0.7522787", "0.7507683", "0.7412924", "0.7406995", "0.7376808", "0.7376239", "0.7366176", "0.7326723", "0.7302857", "0.7302857", "0.72952265", "0.7288", "0.72855604", "0.72822803", "...
0.7089653
49
TODO: Customize parameter initialization
@SuppressWarnings("unused") public static MyLocationsFragment newInstance(int columnCount) { MyLocationsFragment fragment = new MyLocationsFragment(); Bundle args = new Bundle(); args.putInt(ARG_COLUMN_COUNT, columnCount); fragment.setArguments(args); return fragment; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Override\n\tprotected void initParams() {\n\t\t\n\t}", "private LocalParameters() {\n\n\t}", "private Params()\n {\n }", "Parameter createParameter();", "protected void setupParameters() {\n \n \n\n }", "public BaseParameters(){\r\n\t}", "protected void parametersInstantiation_EM() {\n...
[ "0.7448214", "0.71421653", "0.7040167", "0.688528", "0.6882766", "0.6739142", "0.66899866", "0.65924996", "0.65924996", "0.65924996", "0.65721244", "0.6531869", "0.64020884", "0.63855916", "0.62994415", "0.6293869", "0.6286753", "0.6285116", "0.62805855", "0.6262726", "0.6248...
0.0
-1
This interface must be implemented by activities that contain this fragment to allow an interaction in this fragment to be communicated to the activity and potentially other fragments contained in that activity. See the Android Training lesson Communicating with Other Fragments for more information.
public interface MyLocationsFragmentListener { void MyLocationsClickListener(Location location); void MyLocationsPressListener(Location location); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public interface OnFragmentInteractionListener {\n void onFragmentMessage(String TAG, Object data);\n}", "public interface FragmentInteraction {\n void switchToBoardView();\n void switchToPinsView();\n void switchToPins(PDKBoard pdkBoard);\n void switchToDescription(PDKPin pin);\n}", "public int...
[ "0.73235685", "0.720846", "0.71351564", "0.71232235", "0.71222746", "0.70140475", "0.69755626", "0.69755626", "0.69755626", "0.69729954", "0.6966197", "0.696411", "0.6959307", "0.6952445", "0.6942727", "0.6933436", "0.6929703", "0.6927678", "0.6921319", "0.69094676", "0.69028...
0.0
-1
Bass is the lowest note, D (below 1st ledger)
public int toMidi(Note n) { int normIndex = n.getNoteIndex() + numOffset + (7 * octaveOffset); int numOctaves = normIndex/7; int midiAddend = MIDI_OFFSETS[normIndex - (7*numOctaves)]; return 38 + midiAddend + 12*numOctaves; // 37 is low D }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "int minNoteValue();", "@Override\n public Note getLowestNote() {\n List<Note> currentNotes = this.getNotes();\n int size = currentNotes.size();\n Note lowestNote = null;\n\n for (int i = 0; i < size; i++) {\n Note currentNote = currentNotes.get(i);\n\n if (currentNote.isLower(lowestNote)) ...
[ "0.71274215", "0.6221653", "0.61725956", "0.61530465", "0.60377294", "0.5882717", "0.58216184", "0.5787721", "0.5777335", "0.5769574", "0.5768248", "0.5751711", "0.57226855", "0.5705118", "0.5657874", "0.5640948", "0.56407964", "0.5632304", "0.56036913", "0.559403", "0.557597...
0.0
-1
Created by Arkadiy on 02.04.2016.
public interface OnBackPressListener { /** * @return boolean Return true if back press was handled */ boolean backPressHandled(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Override\n public void perish() {\n \n }", "private stendhal() {\n\t}", "@Override\n\tpublic void comer() {\n\t\t\n\t}", "@Override\n\tpublic void grabar() {\n\t\t\n\t}", "@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...
[ "0.60876215", "0.5962583", "0.581534", "0.58027947", "0.57584816", "0.57584816", "0.5713526", "0.57057077", "0.56977785", "0.56779444", "0.56387573", "0.56211746", "0.5613571", "0.5611182", "0.5591739", "0.5580987", "0.5574681", "0.55657005", "0.55535203", "0.55476826", "0.55...
0.0
-1
When an object implementing interface Runnable is used to create a thread, starting the thread causes the object's run method to be called in that separately executing thread. The general contract of the method run is that it may take any action whatsoever.
@Override public void run() { /* try { Thread.sleep(100); } catch (InterruptedException e) { e.printStackTrace(); }*/ System.out.println(Thread.currentThread().getName()); AddDataFromFile(); Thread.yield(); /* try { Thread.sleep(100); } catch (InterruptedException e) { e.printStackTrace(); }*/ }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public interface Startable extends Runnable {\n \n /**\n * Waits until the thread this object is running in is finished before returning.\n */\n public void join();\n \n /**\n * Checks whether the component is done with its work.\n * @return <code>true</code> if the component is fini...
[ "0.70486647", "0.69597656", "0.68883115", "0.67373145", "0.6644344", "0.6578161", "0.65179926", "0.64961547", "0.64943063", "0.6465665", "0.6443635", "0.64434725", "0.63917446", "0.63879454", "0.6379522", "0.6372614", "0.6365644", "0.6365644", "0.6365644", "0.6365644", "0.636...
0.0
-1
=================================================================================== Line Separator ==============
public static String getLineSeparator() { // /- - - - - - - - - - - - - - - - - - - - - - // Because 'CR + LF' caused many trouble! // And Now 'LF' have little trouble. // // return System.getProperty("line.separator"); // - - - - - - - - - -/ return "\n"; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public String getLineSeparator();", "private static void printSeparatorLine() {\r\n System.out.print(\"\\n----------------------------------------------------------\" +\r\n \"----------------------------------------------------------\");\r\n }", "private String getLineSepar...
[ "0.84090155", "0.7924732", "0.77766645", "0.7680915", "0.7661113", "0.753033", "0.7508908", "0.74919397", "0.72470003", "0.7238111", "0.721886", "0.7122984", "0.7109777", "0.7038132", "0.69335777", "0.69284976", "0.6914528", "0.6865073", "0.68567735", "0.68458825", "0.6844121...
0.79658514
1
/ Executes a job on a VM. If a JobEvent (Success,Failure) or an InterruptedException happens, the exception is rethrown to the physical machine.
public void setJob(Job job) throws JobEvent, InterruptedException { this.job = job; try { job.run(); } catch (JobEvent | InterruptedException rethrow) { this.job = null; throw rethrow; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "T execute(String jobName) throws Exception;", "void execute(Runnable job);", "public abstract void processJob() throws Exception;", "@Override\n public Void run() throws Exception {\n Callable<Job> jobCreator = ReflectionUtils.newInstance(jobConfig.getJobCreator(), jobConfiguration);\n ...
[ "0.6203446", "0.58774424", "0.575881", "0.5582176", "0.54633164", "0.5415063", "0.53832316", "0.5382785", "0.5375711", "0.53463256", "0.53018254", "0.5269343", "0.52327454", "0.52196324", "0.52142406", "0.5196152", "0.51803416", "0.51731014", "0.51179284", "0.50582176", "0.50...
0.5715368
3
TODO Autogenerated method stub
public static void main(String[] args) { float x=1; int y=2; float z=3; int a=4; int b=5; float result =x/y ; System.out.println (result); result =x+y ; System.out.println ("9+2=" +result); result =x-y ; System.out.println ("9-2=" +result); result =x*y ; System.out.println ("9-2=" +result); if (x==b) { System.out.println ("true"); } else { System.out.println ("false"); } if (x!=a) { System.out.println ("true"); } else { System.out.println ("false"); } if (z<b) { System.out.println ("b is grather "); } else { System.out.println ("b is less"); } }
{ "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.66708666", "0.65675074", "0.65229905", "0.6481001", "0.64770633", "0.64584893", "0.6413091", "0.63764185", "0.6275735", "0.62541914", "0.6236919", "0.6223816", "0.62017626", "0.61944294", "0.61944294", "0.61920846", "0.61867654", "0.6173323", "0.61328775", "0.61276996", "0...
0.0
-1
Instantiates a new onionoo parser.
public OnionooParser() { }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public Parser() {}", "private Parser () { }", "public Parser()\n {\n //nothing to do\n }", "public OpenOfficeXMLDocumentParser() {\r\n }", "public PjxParser()\r\n {\r\n LOG.info(this + \" instantiated\");\r\n }", "Parse createParse();", "public Parser()\n{\n //nothing to do\n}", ...
[ "0.74536", "0.7209789", "0.7102555", "0.684771", "0.68221766", "0.6814816", "0.67515796", "0.67298734", "0.66991526", "0.6529011", "0.64690346", "0.6428506", "0.61974627", "0.61400336", "0.61290646", "0.6126124", "0.6096476", "0.6093076", "0.609152", "0.6089176", "0.6048338",...
0.849553
0
Build a null relay.
private Relay nullRelayBuilder() { Relay relay = new Relay(); relay.setAdvertisedBandwidth(null); relay.setAllegedFamily(null); relay.setASName(null); relay.setASNumber(null); relay.setBandwidthBurst(null); relay.setBandwidthRate(null); relay.setCityName(null); relay.setConsensusWeight(null); relay.setConsensusWeightFraction(null); relay.setContact(null); relay.setCountryCode(null); relay.setCountryName(null); relay.setDirAddress(null); relay.setExitPolicy(null); relay.setExitPolicySummary(null); relay.setExitPolicyV6Summary(null); relay.setFamily(null); relay.setFirstSeen(null); relay.setFlags(null); relay.setHostName(null); relay.setLastChangedAddressOrPort(null); relay.setLastRestarted(null); relay.setLastSeen(null); relay.setLatitude(null); relay.setLongitude(null); relay.setMeasured(null); relay.setMiddleProbability(null); relay.setNickname(null); relay.setObservedBandwidth(null); relay.setOrAddresses(null); relay.setPlatform(null); relay.setRecommendedVersion(null); relay.setRegionName(null); relay.setRunning(null); return relay; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public Relay(){}", "private Relay relayBuilder(JSONObject jsonRelay) {\n\t\tRelay relay = new Relay();\n\n\t\tif (isPresent(jsonRelay, \"advertised_bandwidth\")) {\n\t\t\trelay.setAdvertisedBandwidth((Integer) jsonRelay.get(\"advertised_bandwidth\"));\n\t\t} else {\n\t\t\trelay.setAdvertisedBandwidth(null);\n\t\...
[ "0.62519354", "0.6246191", "0.5758694", "0.5682075", "0.5669573", "0.5669573", "0.5611919", "0.553191", "0.54674387", "0.54308635", "0.53737587", "0.5318284", "0.5276697", "0.5260318", "0.5232823", "0.52251524", "0.5220013", "0.5177119", "0.5161612", "0.5158985", "0.51541746"...
0.80599165
0
Relay builder. Will return a relay from a JSONObject
private Relay relayBuilder(JSONObject jsonRelay) { Relay relay = new Relay(); if (isPresent(jsonRelay, "advertised_bandwidth")) { relay.setAdvertisedBandwidth((Integer) jsonRelay.get("advertised_bandwidth")); } else { relay.setAdvertisedBandwidth(null); } if (isPresent(jsonRelay, "alleged_family")) { ArrayList<String> allegedFamily = new ArrayList<String>(); JSONArray jsonAllegedFamily = jsonRelay.getJSONArray("alleged_family"); for (int i = 0; i < jsonAllegedFamily.length(); i++) { allegedFamily.add(jsonAllegedFamily.getString(i)); } relay.setAllegedFamily(allegedFamily); } else { relay.setAllegedFamily(null); } if (isPresent(jsonRelay, "as_name")) { relay.setASName(jsonRelay.getString("as_name")); } else { relay.setASName(null); } if (isPresent(jsonRelay, "as_number")) { relay.setASNumber(jsonRelay.getString("as_number")); } else { relay.setASNumber(null); } if (isPresent(jsonRelay, "bandwidth_burst")) { relay.setBandwidthBurst((Integer) jsonRelay.get("bandwidth_burst")); } else { relay.setBandwidthBurst(null); } if (isPresent(jsonRelay, "bandwidth_rate")) { relay.setBandwidthRate((Integer) jsonRelay.get("bandwidth_rate")); } else { relay.setBandwidthRate(null); } if (isPresent(jsonRelay, "city_name")) { relay.setCityName(jsonRelay.getString("city_name")); } else { relay.setCityName(null); } if (isPresent(jsonRelay, "consensus_weight")) { relay.setConsensusWeight((Integer) jsonRelay.get("consensus_weight")); } else { relay.setConsensusWeight(null); } if (isPresent(jsonRelay, "consensus_weight_fraction")) { relay.setConsensusWeightFraction((Double) jsonRelay.get("consensus_weight_fraction")); } else { relay.setConsensusWeightFraction(null); } if (isPresent(jsonRelay, "contact")) { relay.setContact(jsonRelay.getString("contact")); } else { relay.setContact(null); } if (isPresent(jsonRelay, "country")) { relay.setCountryCode(jsonRelay.getString("country")); } else { relay.setCountryCode(null); } if (isPresent(jsonRelay, "country_name")) { relay.setCountryName(jsonRelay.getString("country_name")); } else { relay.setCountryName(null); } if (isPresent(jsonRelay, "dir_address")) { relay.setDirAddress(jsonRelay.getString("dir_address")); } else { relay.setDirAddress(null); } if (isPresent(jsonRelay, "effective_family")) { ArrayList<String> effectiveFamily = new ArrayList<String>(); JSONArray jsonEffectiveFamily = jsonRelay.getJSONArray("effective_family"); for (int i = 0; i < jsonEffectiveFamily.length(); i++) { effectiveFamily.add(jsonEffectiveFamily.getString(i)); } relay.setFamily(effectiveFamily); } else { relay.setEffectiveFamily(null); } if (isPresent(jsonRelay, "exit_policy")) { ArrayList<String> exitPolicy = new ArrayList<String>(); JSONArray jsonExitPolicy = jsonRelay.getJSONArray("exit_policy"); for (int i = 0; i < jsonExitPolicy.length(); i++) { exitPolicy.add(jsonExitPolicy.getString(i)); } relay.setExitPolicy(exitPolicy); } else { relay.setExitPolicy(null); } if (isPresent(jsonRelay, "exit_policy_summary")) { ExitPolicySummary exitPolicySummary = new ExitPolicySummary(); JSONObject jsonExitPolicySummary = jsonRelay.getJSONObject("exit_policy_summary"); if (isPresent(jsonExitPolicySummary, "accept")) { ArrayList<String> accept = new ArrayList<String>(); JSONArray jsonAccept = jsonExitPolicySummary.getJSONArray("accept"); for (int i = 0; i < jsonAccept.length(); i++) { accept.add(jsonAccept.getString(i)); } exitPolicySummary.setAccept(accept); } if (isPresent(jsonExitPolicySummary, "reject")) { ArrayList<String> reject = new ArrayList<String>(); JSONArray jsonReject = jsonExitPolicySummary.getJSONArray("reject"); for (int i = 0; i < jsonReject.length(); i++) { reject.add(jsonReject.getString(i)); } exitPolicySummary.setReject(reject); } relay.setExitPolicySummary(exitPolicySummary); } else { relay.setExitPolicySummary(null); } if (isPresent(jsonRelay, "exit_policy_v6_summary")) { ExitPolicyV6Summary exitPolicyV6Summary = new ExitPolicyV6Summary(); JSONObject jsonExitPolicyV6Summary = jsonRelay.getJSONObject("exit_policy_v6_summary"); if (isPresent(jsonExitPolicyV6Summary, "accept")) { ArrayList<String> accept = new ArrayList<String>(); JSONArray jsonAccept = jsonExitPolicyV6Summary.getJSONArray("accept"); for (int i = 0; i < jsonAccept.length(); i++) { accept.add(jsonAccept.getString(i)); } exitPolicyV6Summary.setAccept(accept); } if (isPresent(jsonExitPolicyV6Summary, "reject")) { ArrayList<String> reject = new ArrayList<String>(); JSONArray jsonReject = jsonExitPolicyV6Summary.getJSONArray("reject"); for (int i = 0; i < jsonReject.length(); i++) { reject.add(jsonReject.getString(i)); } exitPolicyV6Summary.setReject(reject); } relay.setExitPolicyV6Summary(exitPolicyV6Summary); } else { relay.setExitPolicyV6Summary(null); } if (isPresent(jsonRelay, "exit_probability")) { relay.setExitProbability((Double) jsonRelay.get("exit_probability")); } else { relay.setExitProbability(null); } if (isPresent(jsonRelay, "family")) { ArrayList<String> family = new ArrayList<String>(); JSONArray jsonFamily = jsonRelay.getJSONArray("family"); for (int i = 0; i < jsonFamily.length(); i++) { family.add(jsonFamily.getString(i)); } relay.setFamily(family); } else { relay.setFamily(null); } if (isPresent(jsonRelay, "fingerprint")) { relay.setFingerprint(jsonRelay.getString("fingerprint")); } else { relay.setFingerprint(null); } if (isPresent(jsonRelay, "first_seen")) { relay.setFirstSeen(jsonRelay.getString("first_seen")); } else { relay.setFirstSeen(null); } if (isPresent(jsonRelay, "flags")) { ArrayList<String> flags = new ArrayList<String>(); JSONArray jsonFlags = jsonRelay.getJSONArray("flags"); for (int i = 0; i < jsonFlags.length(); i++) { flags.add(jsonFlags.getString(i)); } relay.setFlags(flags); } else { relay.setFlags(null); } if (isPresent(jsonRelay, "guard_probability")) { relay.setGuardProbability((Double) jsonRelay.get("guard_probability")); } else { relay.setGuardProbability(null); } if (isPresent(jsonRelay, "host_name")) { relay.setHostName(jsonRelay.getString("host_name")); } else { relay.setHostName(null); } if (isPresent(jsonRelay, "last_changed_address_or_port")) { relay.setLastChangedAddressOrPort(jsonRelay.getString("last_changed_address_or_port")); } else { relay.setLastChangedAddressOrPort(null); } if (isPresent(jsonRelay, "last_restarted")) { relay.setLastRestarted(jsonRelay.getString("last_restarted")); } else { relay.setLastRestarted(null); } if (isPresent(jsonRelay, "last_seen")) { relay.setLastSeen(jsonRelay.getString("last_seen")); } else { relay.setLastSeen(null); } if (isPresent(jsonRelay, "latitude")) { relay.setLatitude((Double) jsonRelay.get("latitude")); } else { relay.setLatitude(null); } if (isPresent(jsonRelay, "longitude")) { relay.setLongitude((Double) jsonRelay.get("longitude")); } else { relay.setLongitude(null); } if (isPresent(jsonRelay, "measured")) { relay.setMeasured((Boolean) jsonRelay.get("measured")); } else { relay.setMeasured(null); } if (isPresent(jsonRelay, "middle_probability")) { relay.setMiddleProbability((Double) jsonRelay.get("middle_probability")); } else { relay.setMiddleProbability(null); } if (isPresent(jsonRelay, "nickname")) { relay.setNickname(jsonRelay.getString("nickname")); } else { relay.setNickname(null); } if (isPresent(jsonRelay, "observed_bandwidth")) { relay.setObservedBandwidth((Integer) jsonRelay.get("observed_bandwidth")); } else { relay.setObservedBandwidth(null); } if (isPresent(jsonRelay, "or_addresses")) { ArrayList<String> orAddresses = new ArrayList<String>(); JSONArray jsonORAddresses = jsonRelay.getJSONArray("or_addresses"); for (int i = 0; i < jsonORAddresses.length(); i++) { orAddresses.add(jsonORAddresses.getString(i)); } relay.setOrAddresses(orAddresses); } else { relay.setOrAddresses(null); } if (isPresent(jsonRelay, "platform")) { relay.setPlatform(jsonRelay.getString("platform")); } else { relay.setPlatform(null); } if (isPresent(jsonRelay, "recommended_version")) { relay.setRecommendedVersion((Boolean) jsonRelay.get("recommended_version")); } else { relay.setRecommendedVersion(null); } if (isPresent(jsonRelay, "region_name")) { relay.setRegionName(jsonRelay.getString("region_name")); } else { relay.setRegionName(null); } if (isPresent(jsonRelay, "running")) { relay.setRunning((Boolean) jsonRelay.get("running")); } else { relay.setRunning(null); } return relay; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public Gateway(org.json.JSONObject jsonObject) {\n this();\n genClient.setJsonObject(jsonObject);\n }", "private Relay nullRelayBuilder() {\n\t\tRelay relay = new Relay();\n\n\t\trelay.setAdvertisedBandwidth(null);\n\t\trelay.setAllegedFamily(null);\n\t\trelay.setASName(null);\n\t\trelay.setASNumber(null)...
[ "0.5868922", "0.576657", "0.56461287", "0.5633243", "0.5625849", "0.5425557", "0.5329747", "0.5299477", "0.5273157", "0.52599365", "0.5179177", "0.5171477", "0.51516783", "0.51047933", "0.51035357", "0.50539774", "0.49585402", "0.48901808", "0.48713174", "0.4845628", "0.48170...
0.8171983
0
Checks if a key is present in a JSONObject.
private boolean isPresent(JSONObject object, String key) { return !(object.isNull(key)); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public boolean hasKey(String key) {\r\n\t\tif (objectMap.containsKey(key))\r\n\t\t\treturn true;\r\n\r\n\t\treturn false;\r\n\t}", "boolean hasKey(String key);", "public boolean containsKey(String key);", "boolean containsKey(Object key) throws NullPointerException;", "public boolean existsKey(String inKey...
[ "0.6841971", "0.6810645", "0.6808585", "0.6759217", "0.67227983", "0.6682613", "0.6620266", "0.6620266", "0.66080064", "0.65858054", "0.65759116", "0.6514486", "0.6488808", "0.64709413", "0.6461279", "0.6448171", "0.64448893", "0.6420136", "0.6370756", "0.63340825", "0.633306...
0.7447661
0
Method use locally to read a JSON file.
private static String readAll(Reader rd) throws IOException { StringBuilder sb = new StringBuilder(); int cp; while ((cp = rd.read()) != -1) { sb.append((char) cp); } return sb.toString(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private JsonObject loadJSONFile(String jsonFilePath) throws IOException {\r\n\tInputStream is = new FileInputStream(jsonFilePath);\r\n\tJsonReader jsonReader = Json.createReader(is);\r\n\tJsonObject json = jsonReader.readObject();\r\n\tjsonReader.close();\r\n\tis.close();\r\n\treturn json;\r\n }", "@Test\n\tp...
[ "0.75475883", "0.7433471", "0.7265773", "0.71463895", "0.70085204", "0.6963862", "0.695233", "0.69289994", "0.68985534", "0.6871779", "0.683722", "0.67988116", "0.6732343", "0.67096347", "0.6663499", "0.6662259", "0.66581476", "0.66509837", "0.6636566", "0.65997386", "0.65777...
0.0
-1
Read JSON from URL.
private static JSONObject readJsonFromUrl(String url) throws IOException, JSONException { InputStream is = new URL(url).openStream(); try { BufferedReader rd = new BufferedReader(new InputStreamReader(is, Charset.forName("UTF-8"))); String jsonText = readAll(rd); JSONObject json = new JSONObject(jsonText); return json; } finally { is.close(); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public JSONObject readJsonFromUrl() throws IOException, JSONException {\n\t\tInputStream inputStream = new URL(url).openStream();\n\t\ttry {\n\t\t\tBufferedReader bufferedReader = new BufferedReader(\n\t\t\t\t\tnew InputStreamReader(inputStream, Charset.forName(\"UTF-8\")));\n\t\t\tString jsonText = readAllBytes(b...
[ "0.7982967", "0.7951624", "0.7691734", "0.7146962", "0.69775784", "0.6936332", "0.68937796", "0.6852991", "0.68010837", "0.6781162", "0.67742157", "0.6577659", "0.65726423", "0.63617194", "0.6321303", "0.62915343", "0.6269153", "0.6257897", "0.6245914", "0.6174572", "0.616428...
0.78956294
2
TODO Autogenerated method stub
public static void main(String[] args) { Thread Th1 = new MyThreadPriority("First",1); // actually we only need constructor Thread Th2 = new MyThreadPriority("Second",5); Thread Th3 = new MyThreadPriority("Third",10); }
{ "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
60 inches forward Push Cap ball 53 right 60 inches forward 63 degrees right 20 inches forward read beacon color 4 inches forward press beacon
@Override public void runOpMode() throws InterruptedException { CommonAutonomous commonAutonomous = new CommonAutonomous(AllianceColor.BLUE, hardwareMap, this); waitForStart(); commonAutonomous.wallPos1ToBeacon1(); commonAutonomous.pressBeacon(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void loop() {\n telemetry.addData(\"loop count:\", mLoopCount++);\n telemetry.addData(\"version: \", \"1.3\");\n\n int[] topScan;\n int[] middleScan;\n int[] bottomScan;\n\n // get most recent frame from camera (may be same as last time or null)\n CameraLib.C...
[ "0.58688587", "0.58404005", "0.57126194", "0.5583763", "0.5534154", "0.54954547", "0.54189235", "0.5418712", "0.54023504", "0.53959036", "0.5386353", "0.5370941", "0.5337491", "0.52974963", "0.52958554", "0.52787995", "0.5275923", "0.52554697", "0.52541405", "0.52533114", "0....
0.0
-1
Handler for closing navigation first and performing action onClick after a certain delay
@Override public boolean onNavigationItemSelected(@NonNull final MenuItem menuItem) { new Handler().postDelayed(new Runnable() { @Override public void run() { switch (menuItem.getItemId()) { case R.id.activity1: Intent activity1 = new Intent(MainActivity.this, NavActivity1.class); startActivity(activity1); overridePendingTransition(R.anim.slide_in_right, R.anim.slide_out_left); //Animation for opening activity Toast.makeText(MainActivity.this, "Activity 1", Toast.LENGTH_SHORT).show(); break; case R.id.activity2: Intent activity2 = new Intent(MainActivity.this, NavActivity2.class); startActivity(activity2); overridePendingTransition(R.anim.slide_in_right, R.anim.slide_out_left); //Animation for opening activity Toast.makeText(MainActivity.this, "Activity 2", Toast.LENGTH_SHORT).show(); break; case R.id.activity3: Intent activity3 = new Intent(MainActivity.this, NavActivity3.class); startActivity(activity3); overridePendingTransition(R.anim.slide_in_right, R.anim.slide_out_left); //Animation for opening activity Toast.makeText(MainActivity.this, "Activity 3", Toast.LENGTH_SHORT).show(); break; } } }, 200); //............... drawerLayout.closeDrawer(GravityCompat.START); return true; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private void closeActivity() {\n final Handler handler = new Handler(Looper.getMainLooper());\n handler.postDelayed(new Runnable() {\n @Override\n public void run() {\n finish();\n }\n }, 250);\n }", "public void finishActivity() {\r\n ...
[ "0.63996404", "0.6274017", "0.6186425", "0.6178752", "0.6044553", "0.5980402", "0.5976096", "0.59398955", "0.5901955", "0.5898964", "0.588284", "0.58499247", "0.58474267", "0.5838419", "0.5835224", "0.5805315", "0.5804579", "0.57846385", "0.57684475", "0.5767572", "0.5755338"...
0.60112846
5
Extrato com dados brutos, agrupados por instituicao, pac e tipo pessoa (PJ e PF)
List<GestaoEmpresarialLegadoDTO> gerarExtratoDIRF(Integer idInstituicao, Date dataInicio) throws BancoobException;
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Override\n\tpublic void crearNuevaPoblacion() {\n\t\t/* Nos quedamos con los mejores individuos. Del resto, cruzamos la mitad, los mejores,\n\t\t * y el resto los borramos.*/\n\t\tList<IIndividuo> poblacion2 = new ArrayList<>();\n\t\tint numFijos = (int) (poblacion.size()/2);\n\t\t/* Incluimos el 50%, los mejores...
[ "0.63582027", "0.6328201", "0.63161796", "0.6295477", "0.6267819", "0.6163552", "0.61470926", "0.6135746", "0.61253476", "0.61041653", "0.6102196", "0.60752314", "0.6067052", "0.6065789", "0.6035308", "0.6034232", "0.60283756", "0.60072285", "0.6000747", "0.59868366", "0.5986...
0.0
-1
Verifica se ha novos lancamentos (DIRF) apartir da data
Boolean novosLancamentosDIRF(Integer numCoop, Date data) throws BancoobException;
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private static void noDirigido(TraductorGrafo grafo){\r\n\r\n\t\t// Inicializa variable booleana que almacena si el grafo es no dirigido\r\n\t\tboolean esNoDirigido = true;\r\n\r\n\t\t// Itera sobre la matriz de adyacencias del grafo verificando que paratodo i,j se cumple que\r\n\t\t// grafo[i][j] == grafo[j][i]\r...
[ "0.59633833", "0.5699378", "0.568699", "0.5638946", "0.56203467", "0.5590002", "0.5534078", "0.5533771", "0.549383", "0.54829186", "0.5459171", "0.54402214", "0.54286873", "0.5408239", "0.5398326", "0.5396327", "0.53944325", "0.53711945", "0.5340336", "0.53173906", "0.531189"...
0.6199852
0
Will cancel the listening socket, and cause the thread to finish
public void cancel() { try { mmServerSocket.close(); } catch (IOException e) { } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void cancel() {\r\n mStopped = true;\r\n try {\r\n mSocket.close();\r\n } catch (IOException ioe) {\r\n Log.e(Common.TAG, \"Error closing the socket: \" + ioe.getMessage());\r\n }\r\n }", "public void cancel(){\r\n\t\t\r\n\t\ttry{\t\t\t\r\n\t\t\t// Stop...
[ "0.78673476", "0.7846516", "0.7634614", "0.75915134", "0.75179744", "0.74749464", "0.74514496", "0.7409911", "0.7396875", "0.7386712", "0.7341659", "0.73370403", "0.73370403", "0.7323323", "0.7286058", "0.7159255", "0.71431565", "0.71431565", "0.7119602", "0.7093361", "0.7028...
0.72846115
15
Cancel discovery because it will slow down the connection
public void run() { mBluetooth.cancelDiscovery(); try { // Connect the device through the socket. This will block // until it succeeds or throws an exception mmSocket.connect(); } catch (IOException connectException) { // Unable to connect; close the socket and get out try { mmSocket.close(); } catch (IOException closeException) { } return; } // Do work to manage the connection (in a separate thread) connectedSocket(mmSocket); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private void stopDiscovery() {\n if (mDisposable != null) {\n mDisposable.dispose();\n }\n }", "public void stopDiscoverability() {\r\n this.findableServerThread.interrupt();\r\n }", "public void stopDiscovery() {\n if (mApiClient != null) {\n Weave.DEVIC...
[ "0.74874884", "0.7284498", "0.6979483", "0.6349688", "0.6230988", "0.61304533", "0.6127898", "0.6122331", "0.6043501", "0.602902", "0.5999324", "0.59864235", "0.5978969", "0.5977171", "0.59696305", "0.5962076", "0.5957441", "0.59410655", "0.5915114", "0.5876782", "0.5869328",...
0.0
-1
Will cancel an inprogress connection, and close the socket
public void cancel() { try { mmSocket.close(); } catch (IOException e) { } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void cancel() {\r\n\t\t\ttry {\r\n\t\t\t\tsocket.close();\r\n\t\t\t} catch (IOException e) {\r\n\t\t\t\t//pass\r\n\t\t\t}\r\n\t\t}", "public void cancel() {\r\n\t\t\ttry {\r\n\t\t\t\tsocket.close();\r\n\t\t\t} catch (IOException e) {\r\n\t\t\t\te.printStackTrace();\r\n\t\t\t}\r\n\t\t}", "public void can...
[ "0.8316673", "0.82833505", "0.8117103", "0.7945492", "0.7884965", "0.7882617", "0.7742026", "0.77406067", "0.7723242", "0.7722198", "0.7715249", "0.7710952", "0.7710952", "0.7691734", "0.76666975", "0.76518023", "0.7638199", "0.76315945", "0.7464666", "0.7441542", "0.74375093...
0.76928294
15
/ Call this from the main activity to send data to the remote device
public void write(byte[] bytes) { try { mmOutStream.write(bytes); } catch (IOException e) { } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void onClickSend(View view) {\n //String string = editText.getText().toString();\n //serialPort.write(string.getBytes());\n //tvAppend(txtResponse, \"\\nData Sent : \" + string + \"\\n\");\n }", "void sendData(String msg) throws IOException\n {\n if ( msg.length() == 0 ) ...
[ "0.7220107", "0.69929326", "0.69556475", "0.68971527", "0.6834165", "0.682294", "0.6811406", "0.6774727", "0.6757828", "0.671438", "0.671371", "0.6683387", "0.66093045", "0.66024715", "0.6560913", "0.65319306", "0.649817", "0.64862204", "0.64802265", "0.6465589", "0.6435869",...
0.0
-1
/ Call this from the main activity to shutdown the connection
public void cancel() { try { mmSocket.close(); } catch (IOException e) { } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private void shutdown() {\n clientTUI.showMessage(\"Closing the connection...\");\n try {\n in.close();\n out.close();\n serverSock.close();\n } catch (IOException e) {\n e.printStackTrace();\n }\n }", "public void shutdown() {\n m...
[ "0.8088713", "0.7528002", "0.7391469", "0.730617", "0.72964746", "0.7260692", "0.7232609", "0.719543", "0.71392703", "0.71392703", "0.71392703", "0.71392703", "0.7133095", "0.71298265", "0.70955336", "0.7090879", "0.7084074", "0.70752573", "0.7062675", "0.70610094", "0.705985...
0.0
-1
TODO Autogenerated method stub
@Override public Set<Person> getfindByName(String name) { return null; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Override\r\n\tpublic void comer() \r\n\t{\n\t\t\r\n\t}", "@Override\n\tpublic void comer() {\n\t\t\n\t}", "@Override\n public void perish() {\n \n }", "@Override\r\n\t\t\tpublic void annadir() {\n\r\n\t\t\t}", "@Override\n\tpublic void anular() {\n\n\t}", "@Override\n\tprotected void getExr...
[ "0.6671074", "0.6567672", "0.6523024", "0.6481211", "0.6477082", "0.64591026", "0.64127725", "0.63762105", "0.6276059", "0.6254286", "0.623686", "0.6223679", "0.6201336", "0.61950207", "0.61950207", "0.61922914", "0.6186996", "0.6173591", "0.61327106", "0.61285484", "0.608016...
0.0
-1
TODO Autogenerated method stub
@Override public Set<Person> getfindByNameContaining(String name) { return null; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Override\r\n\tpublic void comer() \r\n\t{\n\t\t\r\n\t}", "@Override\n\tpublic void comer() {\n\t\t\n\t}", "@Override\n public void perish() {\n \n }", "@Override\r\n\t\t\tpublic void annadir() {\n\r\n\t\t\t}", "@Override\n\tpublic void anular() {\n\n\t}", "@Override\n\tprotected void getExr...
[ "0.6671074", "0.6567672", "0.6523024", "0.6481211", "0.6477082", "0.64591026", "0.64127725", "0.63762105", "0.6276059", "0.6254286", "0.623686", "0.6223679", "0.6201336", "0.61950207", "0.61950207", "0.61922914", "0.6186996", "0.6173591", "0.61327106", "0.61285484", "0.608016...
0.0
-1
TODO Autogenerated method stub
@Override public Set<Person> getfindByNameContainingIgnoreCase(String name) { return null; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Override\r\n\tpublic void comer() \r\n\t{\n\t\t\r\n\t}", "@Override\n\tpublic void comer() {\n\t\t\n\t}", "@Override\n public void perish() {\n \n }", "@Override\r\n\t\t\tpublic void annadir() {\n\r\n\t\t\t}", "@Override\n\tpublic void anular() {\n\n\t}", "@Override\n\tprotected void getExr...
[ "0.6671074", "0.6567672", "0.6523024", "0.6481211", "0.6477082", "0.64591026", "0.64127725", "0.63762105", "0.6276059", "0.6254286", "0.623686", "0.6223679", "0.6201336", "0.61950207", "0.61950207", "0.61922914", "0.6186996", "0.6173591", "0.61327106", "0.61285484", "0.608016...
0.0
-1
TODO Autogenerated method stub
@Override public Set<Person> getfindByBirthdateYear(int year) { return null; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Override\r\n\tpublic void comer() \r\n\t{\n\t\t\r\n\t}", "@Override\n\tpublic void comer() {\n\t\t\n\t}", "@Override\n public void perish() {\n \n }", "@Override\r\n\t\t\tpublic void annadir() {\n\r\n\t\t\t}", "@Override\n\tpublic void anular() {\n\n\t}", "@Override\n\tprotected void getExr...
[ "0.66708666", "0.65675074", "0.65229905", "0.6481001", "0.64770633", "0.64584893", "0.6413091", "0.63764185", "0.6275735", "0.62541914", "0.6236919", "0.6223816", "0.62017626", "0.61944294", "0.61944294", "0.61920846", "0.61867654", "0.6173323", "0.61328775", "0.61276996", "0...
0.0
-1
TODO Autogenerated method stub
@Override public List<Person> getAllPersons() { return null; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Override\r\n\tpublic void comer() \r\n\t{\n\t\t\r\n\t}", "@Override\n\tpublic void comer() {\n\t\t\n\t}", "@Override\n public void perish() {\n \n }", "@Override\r\n\t\t\tpublic void annadir() {\n\r\n\t\t\t}", "@Override\n\tpublic void anular() {\n\n\t}", "@Override\n\tprotected void getExr...
[ "0.6671074", "0.6567672", "0.6523024", "0.6481211", "0.6477082", "0.64591026", "0.64127725", "0.63762105", "0.6276059", "0.6254286", "0.623686", "0.6223679", "0.6201336", "0.61950207", "0.61950207", "0.61922914", "0.6186996", "0.6173591", "0.61327106", "0.61285484", "0.608016...
0.0
-1
Created by zun.wei on 2016/11/3. To change this template use File|Default Setting |Editor|File and Code Templates|Includes|File Header
public interface ISalaryDao { public Map<String, Object> querySingleMapByOraginalSql(String sql, Object... realValue); public void updateRowByOraginalSql(Object... realValue); public void resetInitPwd(String A0100); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public DetailsFileHeaderTemplate() {\n\t\tsuper(ID_HEADER_LABEL, DESCRIPTION_HEADER_LABEL, OCCURRENCES_HEADER_LABEL);\n\t}", "@Override\n public FileCollection getCompileIncludePath() {\n return super.getCompileIncludePath().plus(getProjectLayout().files(new Callable<FileCollection>() {\n @O...
[ "0.60303724", "0.5982008", "0.57789195", "0.567249", "0.56659645", "0.5652372", "0.5637187", "0.54296285", "0.54290366", "0.5395655", "0.539035", "0.53641915", "0.5286975", "0.5255592", "0.5240406", "0.52170515", "0.5214344", "0.5195066", "0.51924497", "0.51871866", "0.513496...
0.0
-1
Scale down by stepDown number of times, selecting the most recently created launchers to be killed.
public void scaleDown() { log.info("Scaling down by [Step Down] " + stepDown + " instances..."); // Scale down by (1 x stepDown) at a time for (int i = 0; i < stepDown; i++) { // Get free launchers List<String> urlsToScaleDown = getFreeLaunchers(); log.info("URLs to scale down: " + urlsToScaleDown.toString()); // Sort by launcher url. This will sort the oldest first, making it possible to take the youngest out of the // tail urlsToScaleDown.sort((o1, o2) -> { int mySuffix = Integer.parseInt(o1.split("\\.")[0].substring( (Constants.LAUNCHER_URL_PREFIX + "-").length())); int theirSuffix = Integer.parseInt(o2.split("\\.")[0].substring( (Constants.LAUNCHER_URL_PREFIX + "-").length())); return Integer.compare(mySuffix, theirSuffix); }); // Get the youngest free launcher URL String launcherUrlToDelete = urlsToScaleDown.get(urlsToScaleDown.size() - 1); log.info("Cutting down [Launcher URL] " + launcherUrlToDelete + "..."); // Get object name from launcher URL String deploymentName = getObjectNameFromLauncherUrl(launcherUrlToDelete); // Delete deployment and service if (!deleteLauncher(deploymentName)) { log.error("Launcher deletion failed [Object Name] " + deploymentName); } } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void scaleUp(String reason) {\n log.info(\"Scaling up by [Step Up] \" + stepUp + \" instances...\");\n\n // Where to start naming things\n int newNameSuffix = getLatestDeploymentNameSuffix() + 1;\n\n // scale up by (1 x stepUp) at a time\n for (int i = 0; i < stepUp; i++) ...
[ "0.6035748", "0.54296553", "0.537616", "0.5186831", "0.5170897", "0.51260656", "0.5115956", "0.50722486", "0.5063906", "0.48963088", "0.48605686", "0.48556328", "0.4855353", "0.484379", "0.484236", "0.484236", "0.47895733", "0.47707608", "0.4759112", "0.47463006", "0.47293428...
0.7655813
0
Scale up by stepUp number of launchers
public void scaleUp(String reason) { log.info("Scaling up by [Step Up] " + stepUp + " instances..."); // Where to start naming things int newNameSuffix = getLatestDeploymentNameSuffix() + 1; // scale up by (1 x stepUp) at a time for (int i = 0; i < stepUp; i++) { int deploymentNameSuffix = newNameSuffix + i; String deploymentName = Constants.BPG_APP_TYPE_LAUNCHER + "-" + deploymentNameSuffix; if (createLauncher(deploymentNameSuffix, reason)) { // Register the newly spawned launcher as a free one addFreeLauncher(deploymentName); } else { log.error("Launcher creation failed for [Object Name] " + deploymentName); } } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void scaleDown() {\n log.info(\"Scaling down by [Step Down] \" + stepDown + \" instances...\");\n\n // Scale down by (1 x stepDown) at a time\n for (int i = 0; i < stepDown; i++) {\n // Get free launchers\n List<String> urlsToScaleDown = getFreeLaunchers();\n\n ...
[ "0.72621065", "0.5944824", "0.5881762", "0.56555486", "0.56196225", "0.5563572", "0.5514629", "0.5507408", "0.54911625", "0.5374067", "0.53470194", "0.5346825", "0.5229424", "0.52164054", "0.52092594", "0.5189809", "0.51728916", "0.51650083", "0.5164741", "0.5157764", "0.5106...
0.7373499
0
Check max count, free buffer count, and scale down prioritizing free buffer count over max count.
public void honourMaxCount() { // Get free and total counts int freeCount = getFreeLaunchers().size(); int totalCount = getTotalLaunchers().size(); // Scale down if max is exceeded, irrespective of free buffer count if (totalCount > maxCount) { log.info("Scaling down until [freeBufferCount] " + freeBufferCount + " is met since [Max Count] " + maxCount + " has been exceeded."); while (freeCount <= freeBufferCount){ log.info("Scaling DOWN: REASON -> [Total Count] " + totalCount + " > [Max Count] " + maxCount); scaleDown(); freeCount = getFreeLaunchers().size(); } totalCount = getTotalLaunchers().size(); freeCount = getFreeLaunchers().size(); log.info("Stats after scale down operation: [Total Count] " + totalCount + ", [Free Count] " + freeCount); return; } // Don't scale down if there are not enough free launchers if (freeCount <= freeBufferCount) { log.info("Not scaling down since [Free Count] " + freeCount + " <= [Free Buffer Size] " + freeBufferCount + "..."); return; } // Don't scale down if the desired count is not exceeded if (totalCount <= desiredCount) { log.info("Not scaling down since [Total Count] " + totalCount + " <= [Desired Count] " + desiredCount + "..."); return; } // Scale down if desired count is exceeded, but with more free launchers than buffer count by stepDown count // TODO: to test scale down if ((freeCount - stepDown) >= freeBufferCount) { log.info("Scaling DOWN: REASON -> [Total Count] " + totalCount + " > [Desired Count] " + desiredCount + " AND [Free Count] - [Step Down] " + freeCount + " - " + stepDown + " >= [Free Buffer Count] " + freeBufferCount); scaleDown(); return; } // If after scaling down there wouldn't be enough free launchers, don't scale down log.info("Not scaling down since [Free Count] + [Step Down] " + freeCount + " + " + stepDown + " < [Free Buffer Count] " + freeBufferCount); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void honourFreeBufferCount() {\n // Check if there are enough free launchers\n int freeCount = getFreeLaunchers().size();\n\n while (freeCount < freeBufferCount) {\n if (getTotalLaunchers().size() > maxCount) {\n log.warn(\"Specified Maximum Concurrency has bee...
[ "0.7608005", "0.6248479", "0.60644674", "0.5972976", "0.5949788", "0.593502", "0.58972406", "0.5889357", "0.58523095", "0.5829725", "0.5829725", "0.5819864", "0.581044", "0.5799249", "0.57895714", "0.57171094", "0.57094944", "0.5671289", "0.5664103", "0.565896", "0.5570351", ...
0.8077412
0
Check if desired count is honoured, scale up if not.
public void honourDesiredCount() { int totalDeploymentCount = getDeployments().size(); // log.info("[Total count] " + totalDeploymentCount + " [Desired Count] " + desiredCount); while (totalDeploymentCount < desiredCount) { log.info("Scaling UP: REASON -> [Total Count] " + totalDeploymentCount + " < [Desired Count] " + desiredCount); scaleUp("honourDesiredCount"); totalDeploymentCount = getDeployments().size(); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void honourMaxCount() {\n // Get free and total counts\n int freeCount = getFreeLaunchers().size();\n int totalCount = getTotalLaunchers().size();\n\n // Scale down if max is exceeded, irrespective of free buffer count\n if (totalCount > maxCount) {\n log.info(\...
[ "0.68046534", "0.5934144", "0.5749186", "0.5625793", "0.55970913", "0.5552801", "0.5513459", "0.5510423", "0.5466752", "0.5451437", "0.5409753", "0.5393839", "0.53265274", "0.5311296", "0.53080404", "0.5301007", "0.5298619", "0.523202", "0.5217201", "0.5214217", "0.5200636", ...
0.6980696
0
Check if free buffer count is available.
public void honourFreeBufferCount() { // Check if there are enough free launchers int freeCount = getFreeLaunchers().size(); while (freeCount < freeBufferCount) { if (getTotalLaunchers().size() > maxCount) { log.warn("Specified Maximum Concurrency has been exceeded, but scaling up will be permitted. If this " + "message appears often increase maximum concurrency."); } log.info("Scaling UP: REASON -> [Free Count] " + freeCount + " < [Free Gap] " + freeBufferCount); scaleUp("honourFreeBufferCount"); freeCount = getFreeLaunchers().size(); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public boolean isEmptyBufferAvailable()\n {\n return circularBuffer.canWrite();\n }", "int getBytesInBufferAvailable() {\n if (this.count == this.pos) return 0;\n else return this.buf.length - this.pos;\n }", "public boolean isAvailable(){\r\n return blockingQue...
[ "0.68514323", "0.68264073", "0.6670613", "0.6561706", "0.65221715", "0.6516872", "0.65122783", "0.6455219", "0.6400928", "0.6379738", "0.6356598", "0.63444054", "0.63192314", "0.6310445", "0.6261704", "0.6261704", "0.62572837", "0.62518334", "0.62510765", "0.62510765", "0.623...
0.65598315
4
Check if there are Services without corresponding Deployments, and clean them up from the launcher list.
public void cleanOrphanServices() { log.info("Cleaning orphan Services..."); List<String> serviceNames = getServices(); for (String serviceName : serviceNames) { if (serviceName.startsWith(Constants.BPG_APP_TYPE_LAUNCHER + "-") && !deploymentExists(serviceName)) { log.info("Cleaning orphan Service [Name] " + serviceName + "..."); unregisterLauncherIfExistsByObjectName(serviceName); if (!runtimeClient.deleteService(serviceName)) { log.error("Service deletion failed [Service Name] " + serviceName); } } } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private void addAllDeploymentsAsFreeLaunchers() {\n List<String> deployments = getDeployments();\n log.info(\"Found \" + deployments.size() + \" deployments to be added\");\n for (String deployment : deployments) {\n if (runtimeClient.serviceExists(deployment)) {\n ad...
[ "0.70936054", "0.70368624", "0.6111372", "0.5974715", "0.5963567", "0.57504916", "0.573777", "0.5615287", "0.558768", "0.5565802", "0.55033195", "0.5469403", "0.5447524", "0.53958476", "0.5378253", "0.5378253", "0.5374555", "0.53670096", "0.53578216", "0.5344129", "0.5322588"...
0.7846448
0
Check if there are Deployments without corresponding Services, and clean them up from the launcher list.
public void cleanOrphanDeployments() { log.info("Cleaning orphan Deployments..."); List<String> deploymentNames = getDeployments(); for (String deploymentName : deploymentNames) { if (deploymentName.startsWith(Constants.BPG_APP_TYPE_LAUNCHER + "-") && !serviceExists(deploymentName)) { log.info("Cleaning orphan Deployment [Name] " + deploymentName + "..."); unregisterLauncherIfExistsByObjectName(deploymentName); if (!runtimeClient.deleteDeployment(deploymentName)) { log.error("Deployment deletion failed [Deployment Name] " + deploymentName); } } } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private void addAllDeploymentsAsFreeLaunchers() {\n List<String> deployments = getDeployments();\n log.info(\"Found \" + deployments.size() + \" deployments to be added\");\n for (String deployment : deployments) {\n if (runtimeClient.serviceExists(deployment)) {\n ad...
[ "0.74137455", "0.7409154", "0.62486774", "0.6113659", "0.6100012", "0.5774695", "0.5714509", "0.5586773", "0.55055416", "0.5485973", "0.54367566", "0.5344528", "0.53359807", "0.5322906", "0.5310646", "0.5245085", "0.52346736", "0.52290845", "0.5216833", "0.52139115", "0.51936...
0.7673348
0
Check if there are valid Services and Deployments for each launcher available on the launcher list.
public void validateLauncherUrls() { log.info("Validating the existing launcher URL list for missing deployments..."); for (String launcherUrl : getTotalLaunchers()) { log.info("Validating [Launcher URL] " + launcherUrl + "..."); String objectName = getObjectNameFromLauncherUrl(launcherUrl); if (!runtimeClient.deploymentExists(objectName) || !runtimeClient.serviceExists(objectName)) { log.info("Found an invalid launcher [URL] " + launcherUrl); // Just remove the reference to launcher now // cleanOrphan* jobs will clean any orphan deployments // desired count check will scale up if free count is reduced unregisterLauncherIfExists(launcherUrl); } } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private void addAllDeploymentsAsFreeLaunchers() {\n List<String> deployments = getDeployments();\n log.info(\"Found \" + deployments.size() + \" deployments to be added\");\n for (String deployment : deployments) {\n if (runtimeClient.serviceExists(deployment)) {\n ad...
[ "0.67941254", "0.5862826", "0.5831899", "0.5740772", "0.55521065", "0.548605", "0.53746414", "0.5370675", "0.532084", "0.52666074", "0.5241263", "0.5232683", "0.5228507", "0.52228653", "0.51917464", "0.5176422", "0.516702", "0.51075166", "0.509582", "0.5094253", "0.5072353", ...
0.77410054
0
Get the list of Services on the K8S Cluster.
public List<String> getServices() { return runtimeClient.getServices(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public java.util.List<go.micro.runtime.RuntimeOuterClass.Service> getServicesList() {\n return services_;\n }", "public java.util.List<go.micro.runtime.RuntimeOuterClass.Service> getServicesList() {\n return services_;\n }", "public List<String> getAllServices() {\n List<String> allServi...
[ "0.7022183", "0.7022183", "0.6986541", "0.69198626", "0.69198626", "0.6890106", "0.68251", "0.68251", "0.67757267", "0.67757267", "0.6773767", "0.67287886", "0.66906524", "0.6658522", "0.6630368", "0.662623", "0.662623", "0.65809566", "0.6543174", "0.6432612", "0.6428288", ...
0.74691963
0
Get the list of Deployments on the K8S Cluster.
public List<String> getDeployments() { return runtimeClient.getDeployments(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@XmlTransient\n public List<ProfileDeploymentMetaData> getDeployments()\n {\n return Collections.emptyList();\n }", "@GetMapping(\"deployList\")\n\tpublic JsonResult<List<org.flowable.engine.repository.Model>> deploy(){\n\t\tList<org.flowable.engine.repository.Model> models = repositoryService.create...
[ "0.61192423", "0.5916623", "0.58324426", "0.5614431", "0.5360705", "0.53236276", "0.5271111", "0.52535176", "0.5133596", "0.50503165", "0.49689057", "0.49246007", "0.49051127", "0.48806646", "0.48550233", "0.48379618", "0.4794158", "0.47707444", "0.47555363", "0.47440478", "0...
0.76388407
0
Check if a Deploymen exists by the given name.
public boolean deploymentExists(String deploymentName) { return runtimeClient.deploymentExists(deploymentName); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "boolean existsByName(String name);", "@Override\n\tpublic boolean isExist(String name) {\n\t\treturn false;\n\t}", "public boolean exists(String name) throws IOException;", "public Boolean Exist(String name)\n\t{\n\t\tBoolean res = false;\n\n\t\tint f = this.FindByName(name);\n\n\t\tif (f == -1)\n\t\t{\n\t\t...
[ "0.72009194", "0.67776823", "0.66146255", "0.6577165", "0.6480484", "0.6377809", "0.63723177", "0.63179755", "0.62908065", "0.6264325", "0.6264325", "0.6264325", "0.6264325", "0.6264325", "0.6264325", "0.6264325", "0.6264325", "0.6264325", "0.6264325", "0.6264325", "0.6264325...
0.0
-1
Check if a Service exists by the given name.
public boolean serviceExists(String serviceName) { return runtimeClient.serviceExists(serviceName); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "boolean hasServiceName();", "boolean hasServiceName();", "boolean existsByName(String name);", "boolean hasService();", "boolean hasService();", "boolean hasService();", "boolean hasService();", "boolean hasService();", "Object getService(String serviceName, boolean checkExistence);", "public boo...
[ "0.7665775", "0.7665775", "0.7204018", "0.7180632", "0.7180632", "0.7180632", "0.7180632", "0.7180632", "0.7094114", "0.66145045", "0.650817", "0.6492005", "0.6470068", "0.64100367", "0.6400458", "0.6397163", "0.6391837", "0.6391837", "0.6391837", "0.63501215", "0.6338822", ...
0.77705157
0
Iterate through the Deployments list and add any valid Deployment+Service as a free Launcher.
private void addAllDeploymentsAsFreeLaunchers() { List<String> deployments = getDeployments(); log.info("Found " + deployments.size() + " deployments to be added"); for (String deployment : deployments) { if (runtimeClient.serviceExists(deployment)) { addFreeLauncher(deployment); } else { log.info("Deployment " + deployment + " doesn't have a Service that exposes it. Not adding as a launcher..."); } } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private void addFreeLauncher(String deploymentName) {\n persistence.addFreeLauncher(getLauncherUrlFromObjectName(deploymentName));\n }", "public void validateLauncherUrls() {\n log.info(\"Validating the existing launcher URL list for missing deployments...\");\n\n for (String launcherUrl ...
[ "0.63434935", "0.5697891", "0.5659901", "0.5578303", "0.52517486", "0.5163203", "0.515479", "0.5110495", "0.5107249", "0.50410867", "0.5037768", "0.49914926", "0.4965398", "0.4913825", "0.48909447", "0.4889196", "0.48879468", "0.48712507", "0.48421538", "0.48345205", "0.48132...
0.87598103
0
Get the list of free launchers from the persistence.
public List<String> getFreeLaunchers() { return persistence.getFreeLauncherUrls(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public List<String> getTotalLaunchers() {\n return persistence.getTotalLauncherUrls();\n }", "public int getFreezers ()\n {\n return (freezers);\n }", "public Vector<String> getAllLaunchersIds() {\n\t\tVector<String> visibleIds = new Vector<>();\n\n\t\tfor (EnemyLauncher el : enemyLaunch...
[ "0.6480937", "0.5737458", "0.54782444", "0.5435439", "0.5405924", "0.53363556", "0.5314265", "0.53028053", "0.52699465", "0.52648413", "0.5242611", "0.5237652", "0.5226091", "0.52113414", "0.51871336", "0.515159", "0.508155", "0.5066465", "0.50655967", "0.50605094", "0.505737...
0.8154454
0
Get the full list of launchers from the persistence.
public List<String> getTotalLaunchers() { return persistence.getTotalLauncherUrls(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public List<String> getFreeLaunchers() {\n return persistence.getFreeLauncherUrls();\n }", "public Vector<String> getAllLaunchersIds() {\n\t\tVector<String> visibleIds = new Vector<>();\n\n\t\tfor (EnemyLauncher el : enemyLauncherArr) {\n\t\t\tif (el.isAlive()) {\n\t\t\t\tvisibleIds.add(el.getLauncherI...
[ "0.7623172", "0.6191944", "0.5892019", "0.5775486", "0.5727795", "0.5727382", "0.56900877", "0.5689316", "0.55893034", "0.55248237", "0.5456933", "0.54519546", "0.5400729", "0.5399305", "0.53888696", "0.53835106", "0.53627264", "0.53152066", "0.531029", "0.5300954", "0.529929...
0.6809147
1
Mark a launcher by the given subdomain as busy.
public boolean markLauncherAsBusyBySubDomain(String launcherSubDomain) { return markLauncherAsBusy(launcherSubDomain + "." + rootDomainName); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public boolean markLauncherAsFreeBySubDomain(String launcherSubDomain) {\n return markLauncherAsFree(launcherSubDomain + \".\" + rootDomainName);\n }", "public boolean markLauncherAsBusy(String launcherUrl) {\n if (persistence.launcherExists(launcherUrl)) {\n return persistence.markLa...
[ "0.63634485", "0.5992416", "0.56236637", "0.5496863", "0.54651505", "0.5454036", "0.53765106", "0.53210294", "0.52380013", "0.50518626", "0.49777427", "0.4892478", "0.48398376", "0.47534", "0.47482517", "0.47358984", "0.47358546", "0.4713657", "0.4709944", "0.47098687", "0.46...
0.7893404
0
Mark the given launcher URL as busy.
public boolean markLauncherAsBusy(String launcherUrl) { if (persistence.launcherExists(launcherUrl)) { return persistence.markLauncherAsBusy(launcherUrl); } return false; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public boolean markLauncherAsBusyBySubDomain(String launcherSubDomain) {\n return markLauncherAsBusy(launcherSubDomain + \".\" + rootDomainName);\n }", "public boolean markLauncherAsFree(String launcherUrl) {\n if (persistence.launcherExists(launcherUrl)) {\n return persistence.markLa...
[ "0.61737496", "0.60319644", "0.5997368", "0.5958028", "0.573361", "0.57291275", "0.5595785", "0.55915546", "0.5324263", "0.52581024", "0.5209593", "0.51716065", "0.51680547", "0.5141848", "0.513717", "0.51001203", "0.50771433", "0.5050188", "0.5038551", "0.5015939", "0.498957...
0.7567572
0
Mark a launcher by the given subdomain as free.
public boolean markLauncherAsFreeBySubDomain(String launcherSubDomain) { return markLauncherAsFree(launcherSubDomain + "." + rootDomainName); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public boolean markLauncherAsBusyBySubDomain(String launcherSubDomain) {\n return markLauncherAsBusy(launcherSubDomain + \".\" + rootDomainName);\n }", "public boolean markLauncherAsFree(String launcherUrl) {\n if (persistence.launcherExists(launcherUrl)) {\n return persistence.markLa...
[ "0.66220504", "0.6270158", "0.57486284", "0.5718797", "0.5621299", "0.5392943", "0.51957804", "0.5063605", "0.49488798", "0.48807684", "0.48213932", "0.48194093", "0.47592995", "0.47578213", "0.4738265", "0.47295177", "0.46986285", "0.46931034", "0.46861973", "0.46087754", "0...
0.7937914
0
Makr the given launcher URL as free.
public boolean markLauncherAsFree(String launcherUrl) { if (persistence.launcherExists(launcherUrl)) { return persistence.markLauncherAsFree(launcherUrl); } return false; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private void unregisterLauncherIfExists(String launcherUrl) {\n log.info(\"Unregistering launcher [URL] \" + launcherUrl);\n if (persistence.launcherExists(launcherUrl)) {\n persistence.unregisterLauncher(launcherUrl);\n } else {\n log.debug(\"Launcher URL not found: \" +...
[ "0.6006832", "0.5708806", "0.5693836", "0.55742776", "0.5352581", "0.5253149", "0.5206511", "0.51910985", "0.5186907", "0.5157777", "0.5139209", "0.50626284", "0.49964136", "0.49911684", "0.49789843", "0.4961325", "0.4892544", "0.48749298", "0.48720595", "0.4858332", "0.48197...
0.6851818
0
Delete launcher URL derived from the object name, from the list of launchers, if it exists, and delete from the K8S cluster.
private boolean deleteLauncher(String deploymentName) { unregisterLauncherIfExistsByObjectName(deploymentName); boolean svcDeleted = runtimeClient.deleteService(deploymentName); boolean depDeleted = runtimeClient.deleteDeployment(deploymentName); return svcDeleted && depDeleted; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private void unregisterLauncherIfExistsByObjectName(String objectName) {\n // Unregister from launcher list\n String launcherUrl = getLauncherUrlFromObjectName(objectName);\n unregisterLauncherIfExists(launcherUrl);\n }", "private void unregisterLauncherIfExists(String launcherUrl) {\n ...
[ "0.6038219", "0.5716322", "0.53382033", "0.52037823", "0.51421905", "0.50992936", "0.49826252", "0.4937572", "0.48291618", "0.48251885", "0.48188642", "0.474718", "0.47422203", "0.4723599", "0.46898562", "0.46833405", "0.46720335", "0.46637946", "0.4643038", "0.46371832", "0....
0.5378288
2
Delete launcher URL, derived from the object name, from the list of launchers, if it exists.
private void unregisterLauncherIfExistsByObjectName(String objectName) { // Unregister from launcher list String launcherUrl = getLauncherUrlFromObjectName(objectName); unregisterLauncherIfExists(launcherUrl); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private void unregisterLauncherIfExists(String launcherUrl) {\n log.info(\"Unregistering launcher [URL] \" + launcherUrl);\n if (persistence.launcherExists(launcherUrl)) {\n persistence.unregisterLauncher(launcherUrl);\n } else {\n log.debug(\"Launcher URL not found: \" +...
[ "0.6777881", "0.5850546", "0.56654143", "0.55500686", "0.54972374", "0.5288", "0.51948583", "0.50654495", "0.5024532", "0.5022085", "0.49433967", "0.4939287", "0.48779765", "0.48574084", "0.4833685", "0.48122692", "0.47895393", "0.47761953", "0.47154796", "0.47020894", "0.470...
0.66179717
1
Delete launcher URL from the list of launchers, if it exists.
private void unregisterLauncherIfExists(String launcherUrl) { log.info("Unregistering launcher [URL] " + launcherUrl); if (persistence.launcherExists(launcherUrl)) { persistence.unregisterLauncher(launcherUrl); } else { log.debug("Launcher URL not found: " + launcherUrl); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void validateLauncherUrls() {\n log.info(\"Validating the existing launcher URL list for missing deployments...\");\n\n for (String launcherUrl : getTotalLaunchers()) {\n log.info(\"Validating [Launcher URL] \" + launcherUrl + \"...\");\n String objectName = getObjectName...
[ "0.6556899", "0.61297655", "0.57717884", "0.5677161", "0.55175096", "0.5365072", "0.52708817", "0.5229477", "0.5092214", "0.4983349", "0.49273816", "0.48792115", "0.48678088", "0.4863656", "0.48206943", "0.47984105", "0.47903764", "0.4739422", "0.4737948", "0.47081634", "0.47...
0.74858296
0
Add a new launcher URL by creating a K8S Deployment+Service pair and adding the entry to persistence.
private boolean createLauncher(int deploymentNameSuffix, String reason) { boolean depCreated = runtimeClient.createDeployment(deploymentNameSuffix, rootDomainName, reason); boolean svcCreated = runtimeClient.createService(deploymentNameSuffix, rootDomainName, reason); return depCreated && svcCreated; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private void addFreeLauncher(String deploymentName) {\n persistence.addFreeLauncher(getLauncherUrlFromObjectName(deploymentName));\n }", "public void addUrlArg(String key, String value);", "public void addDAppURL(String url)\n {\n\n String checkVal = url.replaceFirst(\"^(http[s]?://www\\\\....
[ "0.5818914", "0.5008831", "0.5008389", "0.49136958", "0.47959825", "0.47271168", "0.4696447", "0.4695377", "0.46558058", "0.46260783", "0.46143022", "0.45970905", "0.45895147", "0.45648333", "0.4559998", "0.45164335", "0.45144436", "0.44585145", "0.4452404", "0.44395053", "0....
0.48863992
4
Add a launcher URL by the given object name to the persistence.
private void addFreeLauncher(String deploymentName) { persistence.addFreeLauncher(getLauncherUrlFromObjectName(deploymentName)); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private String getLauncherUrlFromObjectName(String objectName) {\n if (objectName != null) {\n return objectName.replace(Constants.BPG_APP_TYPE_LAUNCHER, Constants.LAUNCHER_URL_PREFIX) +\n \".\" +\n rootDomainName;\n }\n\n throw new IllegalArgum...
[ "0.59125495", "0.5317453", "0.529935", "0.49388105", "0.49329138", "0.48873842", "0.48624438", "0.48596364", "0.4749314", "0.4738745", "0.47176442", "0.47143254", "0.46998754", "0.46732903", "0.46339792", "0.4629085", "0.46287182", "0.46193364", "0.46173012", "0.46073928", "0...
0.61347073
0
Get the object name used in the K8S cluster, from the launcher URL.
private String getObjectNameFromLauncherUrl(String launchUrl) { if (launchUrl != null) { String[] domainParts = launchUrl.split("\\."); return domainParts[0].replace(Constants.LAUNCHER_URL_PREFIX, Constants.BPG_APP_TYPE_LAUNCHER); } throw new IllegalArgumentException("Null launcher URL cannot be processed."); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private String getLauncherUrlFromObjectName(String objectName) {\n if (objectName != null) {\n return objectName.replace(Constants.BPG_APP_TYPE_LAUNCHER, Constants.LAUNCHER_URL_PREFIX) +\n \".\" +\n rootDomainName;\n }\n\n throw new IllegalArgum...
[ "0.64145476", "0.633114", "0.59514904", "0.5849335", "0.5847244", "0.5811223", "0.5719221", "0.5681208", "0.5519827", "0.55085045", "0.54463094", "0.54277796", "0.5408881", "0.5407457", "0.5399623", "0.53907204", "0.5359491", "0.5335288", "0.53188455", "0.52984184", "0.529006...
0.6799054
0
Get the launcher URL used in the persistence by the given object name in the K8S cluster.
private String getLauncherUrlFromObjectName(String objectName) { if (objectName != null) { return objectName.replace(Constants.BPG_APP_TYPE_LAUNCHER, Constants.LAUNCHER_URL_PREFIX) + "." + rootDomainName; } throw new IllegalArgumentException("Null Object name cannot be processed."); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private String getObjectNameFromLauncherUrl(String launchUrl) {\n if (launchUrl != null) {\n String[] domainParts = launchUrl.split(\"\\\\.\");\n return domainParts[0].replace(Constants.LAUNCHER_URL_PREFIX, Constants.BPG_APP_TYPE_LAUNCHER);\n }\n\n throw new IllegalArgume...
[ "0.58453256", "0.54244256", "0.5376862", "0.53726363", "0.5128362", "0.5105464", "0.5013119", "0.49571848", "0.49500266", "0.49147844", "0.49129748", "0.49012876", "0.48446444", "0.48189956", "0.47975627", "0.47947925", "0.4771881", "0.47634742", "0.47421294", "0.46934927", "...
0.7160374
0
Get the last created increment number of the Deployment/Service in the K8S cluster.
private int getLatestDeploymentNameSuffix() { List<String> deploymentList = getDeployments(); // log.info("Currently have " + deploymentList.size() + " deployments..."); if (deploymentList.size() > 0) { deploymentList.sort((o1, o2) -> { int mySuffix = Integer.parseInt(o1.substring((Constants.BPG_APP_TYPE_LAUNCHER + "-").length())); int theirSuffix = Integer.parseInt(o2.substring((Constants.BPG_APP_TYPE_LAUNCHER + "-").length())); return Integer.compare(mySuffix, theirSuffix); }); // log.info("Sorted deployments: " + deploymentList.toString()); String lastElement = deploymentList.get(deploymentList.size() - 1); // log.info("Last element: " + lastElement); String lastLauncherSuffix = lastElement.substring((Constants.BPG_APP_TYPE_LAUNCHER + "-").length()); // log.info("Picking last deployment suffix: " + lastLauncherSuffix); return Integer.parseInt(lastLauncherSuffix); } return 0; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public long generateContainerId() {\n return this.containerIdCounter.incrementAndGet();\n }", "public int getCurrentOperationId(){\n int nmr = 1;\n operationLock.lock();\n try (\n Statement s = rawDataSource.getConnection().createStatement(ResultSet.TYPE_SCROLL_INSENSI...
[ "0.5566818", "0.5507838", "0.55022067", "0.5375154", "0.5339838", "0.53013194", "0.5291325", "0.5263758", "0.5249746", "0.5237987", "0.52136683", "0.52092284", "0.51994836", "0.5167597", "0.51377964", "0.5122452", "0.5112817", "0.5086751", "0.50810754", "0.50373375", "0.50316...
0.49925557
24
Start watching the K8S events to see if any related Deployments or Services are being deleted. If found, run a cleanup of the launcher URLs. Note: This is too slow. Events take about 2 minutes to be received.
public void watchAndClean() { runtimeClient.watchWithWatcher(new Watcher<Event>() { @Override public void eventReceived(Action action, Event resource) { if ((resource.getInvolvedObject().getKind().equals("Deployment") || resource.getInvolvedObject().getKind().equals("Service")) && resource.getInvolvedObject().getName().startsWith(Constants.BPG_APP_TYPE_LAUNCHER) && (action == Action.DELETED || action == Action.MODIFIED)) { log.info("Received " + action.toString() + " event for " + resource.getInvolvedObject().getKind() + " " + resource.getInvolvedObject().getName()); cleanOrphanDeployments(); cleanOrphanServices(); } else { log.debug("Received action " + action.toString() + " for resource " + resource.getInvolvedObject().getKind() + ":" + resource.getInvolvedObject().getName()); } } @Override public void onClose(KubernetesClientException cause) { log.info("Shutting down Event Watcher..."); } }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void cleanOrphanServices() {\n log.info(\"Cleaning orphan Services...\");\n List<String> serviceNames = getServices();\n for (String serviceName : serviceNames) {\n if (serviceName.startsWith(Constants.BPG_APP_TYPE_LAUNCHER + \"-\") && !deploymentExists(serviceName)) {\n ...
[ "0.54038346", "0.5285767", "0.52636063", "0.52182424", "0.5148183", "0.51221436", "0.5054833", "0.50259006", "0.5013078", "0.5007515", "0.50067", "0.49451372", "0.49281663", "0.49183923", "0.4908451", "0.48708925", "0.48673764", "0.481663", "0.48137006", "0.48085058", "0.4802...
0.77006954
0
/Fragments List (xml+java) and Text 1 . Fragment class for above both 2. override oncreateview 3. create obj of xml and inflate it 4. Add fragment java/xml
@Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Override\n //This will handle how the fragment will display content\n public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle saveInstanceState) {\n View layout = inflater.inflate(R.layout.fragment_main, container, false);\n\n FeedListView mFeedListVie...
[ "0.71859866", "0.7101077", "0.70159644", "0.6972713", "0.69323283", "0.69238394", "0.69152445", "0.68725675", "0.6863918", "0.68351823", "0.6829196", "0.6822116", "0.68135244", "0.6799551", "0.6788722", "0.6781281", "0.6779301", "0.6758367", "0.6757575", "0.67517394", "0.6737...
0.0
-1
Creates a new instance of ContactsService
public ContactsService() { }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private ContactManager() {\n }", "public ContactManager() {\n\t\tthis.contacts = new HashMap<>();\n\n\t\tgenerateDirectories();\n\t\tloadContacts();\n\t}", "public static Contacts createContacts(String name,String phoneNumber){\n //it calling the constuctor to create an new contact record\n re...
[ "0.64618176", "0.61602175", "0.5951783", "0.59382445", "0.5898435", "0.5898435", "0.5898435", "0.58920234", "0.58602357", "0.5741993", "0.5723536", "0.57207584", "0.571828", "0.56209797", "0.5620889", "0.5601046", "0.55833536", "0.55752957", "0.5570722", "0.55378723", "0.5524...
0.80063987
0
TODO Autogenerated method stub
@Override public void onValueChange(NumberPicker picker, int oldVal, int newVal) { }
{ "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
Insert the given player into the players collection All handlers should add this player to their collection
@Override public void addPlayerHandler(Player player) { // add new player to current TreeSet playerByIdTreeSet.add(player); if(successor!=null){ // there are more handlers - trigger them to add this player as well successor.addPlayerHandler(player); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void addPlayer(Player player) {\n //int id = Repository.getNextUniqueID();\n this.player = player;\n }", "public void addPlayer(Player player){\n players.add(player);\n }", "public void addPlayer(Player player) {\n playerList.add(player);\n }", "public void insertP...
[ "0.75995857", "0.74356073", "0.71686244", "0.70895636", "0.70668954", "0.69430256", "0.69146925", "0.6892507", "0.68858516", "0.6828955", "0.67700434", "0.67525667", "0.67401445", "0.6734643", "0.66961074", "0.667783", "0.664371", "0.6631118", "0.66040075", "0.6599596", "0.65...
0.73606175
2
Get a collection of all the players sorted by the given sorting parameter. Only one handler should response to this request the one which contains a collection which is sorted by the given sortingParameter
@Override public Collection<Player> getSortedPlayersHandler(String sortingParameter) { if(sortingParameter.equals(ID_SORTING_PARAM_STRING)){ // the sorting param is by id - return current TreeSet return playerByIdTreeSet; }else if(successor!=null){ // sorting param not by id - pass the request to the next handler return successor.getSortedPlayersHandler(sortingParameter); }else{ // no more handlers - return current TreeSet return playerByIdTreeSet; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@GET\n @Produces({ \"application/json\" })\n public abstract Response get(@QueryParam(\"sort\") String sort);", "Sort asc(QueryParameter parameter);", "private void getPlayerList(){\r\n\r\n PlayerDAO playerDAO = new PlayerDAO(Statistics.this);\r\n players = playerDAO.readListofPlayerNameswD...
[ "0.61365306", "0.5602057", "0.5429077", "0.5394571", "0.5365939", "0.53601575", "0.5313649", "0.5291012", "0.5246674", "0.5222201", "0.51889884", "0.51434535", "0.51352125", "0.51237315", "0.5121532", "0.5110916", "0.51093024", "0.5105491", "0.5098768", "0.5092269", "0.507962...
0.7451576
0
Returns a month based on a gregorian calendar. valuereturns 0January 1February 2March 3April 4May 5June 6July 7August 8September 9October 10November 11December otherwisenull
public static Month of(int value) { if (value < MINIMUM_MONTH) return null; if (value > MAXIMUM_MONTH) return null; return MONTHS.get(value); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private int getCalendarMonth(String month){\n month = month.toUpperCase();\n if (month.indexOf(\"JAN\") == 0 ) {\n return Calendar.JANUARY;\n } else if (month.indexOf(\"FEB\") == 0) {\n return Calendar.FEBRUARY;\n } else if (month.indexOf(\"MAR\") == 0) {\n ...
[ "0.6703685", "0.6555714", "0.6554219", "0.63903046", "0.6274132", "0.6260861", "0.61250395", "0.6112495", "0.60967433", "0.6069555", "0.6067861", "0.6052029", "0.6046", "0.60385823", "0.5973854", "0.59578943", "0.5946035", "0.5933285", "0.59318346", "0.59305155", "0.59110504"...
0.5457852
75
Returns the formal name of the current month from a gregorian calendar. monthNameReturn Month January | JanJanuary Febraury | FebFebruary March | MarMarch April | AprApril MayMay June | JunJune July | JulJuly August | AugAugust September | SepSeptember October | OctOctober November | NovNovember December | DecDecember
public static Month of(String monthName) { for (Month month : MONTHS) { if (month.name.equalsIgnoreCase(monthName)) return month; if (month.shortName.equalsIgnoreCase(monthName)) return month; } return null; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public String getMonthName()\r\n {\r\n int mn = theMonthNumber;\r\n if (mn == 1)\r\n {return \"January\";}\r\n else if (mn == 2)\r\n {return \"February\";}\r\n else if (mn == 3)\r\n {return \"March\";}\r\n else if (mn == 4)\r\n {return \"April\";}\r...
[ "0.8254989", "0.7620193", "0.75561345", "0.7435254", "0.72470117", "0.7212473", "0.6941755", "0.6843429", "0.68385404", "0.67864376", "0.6699276", "0.6684204", "0.6645693", "0.6629166", "0.66182554", "0.66053164", "0.65972406", "0.6591361", "0.6586979", "0.6566746", "0.654519...
0.5623856
63
Returns the formal name of the current month from a gregorian calendar. Month IndexReturn Value 0January 1February 2March 3April 4May 5June 6July 7August 8September 9October 10November 11December
public String getName() { return name; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public String getMonthName()\r\n {\r\n int mn = theMonthNumber;\r\n if (mn == 1)\r\n {return \"January\";}\r\n else if (mn == 2)\r\n {return \"February\";}\r\n else if (mn == 3)\r\n {return \"March\";}\r\n else if (mn == 4)\r\n {return \"April\";}\r...
[ "0.7912883", "0.7453658", "0.6990397", "0.69793636", "0.6948603", "0.6916588", "0.69016576", "0.6867812", "0.68150616", "0.6801028", "0.6793758", "0.6783467", "0.6775553", "0.6767148", "0.6749169", "0.6714487", "0.6677462", "0.66760373", "0.6660554", "0.6613327", "0.65808666"...
0.0
-1
Returns the short name of the current month from a gregorian calendar. Month IndexReturn Value 0Jan 1Feb 2Mar 3Apr/td> 4May 5Jun 6Jul 7Aug 8Sep 9Oct 10Nov 11Dec
public String getShortName() { return shortName; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public String getMonthName()\r\n {\r\n int mn = theMonthNumber;\r\n if (mn == 1)\r\n {return \"January\";}\r\n else if (mn == 2)\r\n {return \"February\";}\r\n else if (mn == 3)\r\n {return \"March\";}\r\n else if (mn == 4)\r\n {return \"April\";}\r...
[ "0.777555", "0.72747743", "0.69671273", "0.6956956", "0.6903955", "0.68560356", "0.6816727", "0.6809455", "0.67656064", "0.67646074", "0.6738682", "0.6719289", "0.6708304", "0.6707328", "0.670347", "0.6669604", "0.6652994", "0.6634735", "0.6627346", "0.66268986", "0.66216475"...
0.0
-1
Returns the zero based index of the current month within a gregorian calendar. MonthReturn Value January0 February1 March2 April3 May4 June5 July6 August7 September8 October9 November10 December11
public int getValue() { return value; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public static int getCurrentMonth()\n\t{\n\t\treturn Calendar.getInstance().get(Calendar.MONTH) + 1;\n\t}", "public static int getCurrentMonth(int month) {\n month++;\n return month;\n }", "public int getMonthInteger() \n\t{\n\t\t// 1 will be added here to be able to use this func alone to...
[ "0.7205362", "0.69862384", "0.6607929", "0.6591078", "0.65196484", "0.6509328", "0.6453782", "0.6452349", "0.64295584", "0.6420044", "0.6407181", "0.63900936", "0.6377965", "0.63603646", "0.63600695", "0.6355515", "0.6335842", "0.6310558", "0.63019013", "0.6207383", "0.617212...
0.0
-1
we need to be able to delegate initial TableView population to AppLauncher because it sets the proper value for our db and thread pool. Feels hackish, but whatever. Populate the Table View with values. Called only after initialization.
public void runTableUpdateService() { tableUpdateService.restart(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Override\n public void initialize(URL url, ResourceBundle resourceBundle) {\n\n //configure the TableView to get data from the DB!\n getTableData();\n MSAppointmentsTableView.setItems(allAppointments);\n\n\n\n\n\n\n\n }", "private void initializeTable()\n {\n mTable = new ListV...
[ "0.7105355", "0.704695", "0.69647497", "0.68108475", "0.6750771", "0.67203796", "0.6699327", "0.66992307", "0.66905314", "0.656699", "0.655214", "0.6518684", "0.65016246", "0.6483291", "0.6455372", "0.640948", "0.64002186", "0.6392366", "0.6386661", "0.6380783", "0.63640803",...
0.0
-1
passes data to table
public void pass_data (int row, String name, Boolean screen, Boolean reset, int direction) { if (reset) { data_table.model_data(row, " ", " ", " "); } else { String screen_name; String direction_str = " "; if (screen) screen_name = "Yes"; else screen_name = "No"; if (direction == 1) direction_str = "Right"; else if (direction == 2) direction_str = "Left"; else if (direction == 3) direction_str = "Down"; else if (direction == 4) direction_str = "Up"; data_table.model_data(row, name, screen_name, direction_str); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private void fillData() {\n table.setRowList(data);\n }", "private void populateTableData() {\n DefaultTableModel model = (DefaultTableModel) jTable1.getModel();\n model.setRowCount(0);\n for (Organization o : organizationDirectory.getOrganizationList()) {\n Object[] row...
[ "0.7087227", "0.65080184", "0.6465014", "0.6461002", "0.6446194", "0.64185405", "0.6359223", "0.6333854", "0.62866235", "0.6275095", "0.6244084", "0.62376523", "0.62235385", "0.6183597", "0.6163578", "0.6146893", "0.6140684", "0.61344695", "0.61166674", "0.6100796", "0.609230...
0.57164735
84
toggle for instruction showing
public void show_text (Boolean show) { if (show) instructions.setText(instr_str); if (!show) instructions.setText(default_str); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void showInstructions()\n {\n //make the instructions window visible\n instructionScreen.setVisible(true);\n }", "public void toggle()\n\t{\n\t\tsetVisible(!this.isShowing());\n\t}", "public void show() {\n hidden = false;\n }", "void toggle();", "@Override\n public ...
[ "0.7205485", "0.6908987", "0.68953776", "0.6809813", "0.6774422", "0.67513835", "0.6746867", "0.66066146", "0.65720725", "0.64537376", "0.64414227", "0.6430666", "0.6361776", "0.6351973", "0.63215643", "0.6314401", "0.6308965", "0.6305772", "0.62688136", "0.6268159", "0.62554...
0.67712516
5
Methods: Converts date format from visual to logical.
@VTID(5) String convertVisualToLogicalDateType( int fieldType, boolean skipEqualityInVerification, String visualDate);
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@VTID(4)\n String convertLogicalToVisualDate(\n String fieldName,\n String logicalDate);", "@VTID(6)\n String convertLogicalToVisualDateType(\n int fieldType,\n boolean skipEqualityInVerification,\n String logicalDate);", "@VTID(3)\n String convertVisualToLogical...
[ "0.71006835", "0.6980413", "0.688144", "0.5659676", "0.55190504", "0.5511233", "0.5421783", "0.53688806", "0.536479", "0.53336245", "0.5329587", "0.5307037", "0.5301122", "0.52842987", "0.52721083", "0.5271816", "0.5254605", "0.52496946", "0.5247872", "0.523801", "0.5177054",...
0.68422276
3
Converts date format from logical to visual.
@VTID(6) String convertLogicalToVisualDateType( int fieldType, boolean skipEqualityInVerification, String logicalDate);
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@VTID(4)\n String convertLogicalToVisualDate(\n String fieldName,\n String logicalDate);", "@VTID(3)\n String convertVisualToLogicalDate(\n String fieldName,\n String visualDate);", "DateFormat getDisplayDateFormat();", "default String toDisplay(Date date) {\n ret...
[ "0.68718034", "0.6510748", "0.634327", "0.628979", "0.6267672", "0.621386", "0.6134754", "0.60703504", "0.5994508", "0.5955347", "0.58744955", "0.5841012", "0.5820375", "0.5800442", "0.5798362", "0.5796948", "0.5794125", "0.57862663", "0.57724047", "0.5762136", "0.57310534", ...
0.6386374
2
/ Each private variable (gyroscope, dcmotor, diital channel, distance sensor, and servo) is for everything we configured. However we didn't use some of these things but this is for practicing/ examples. TeleOp (at the beginning) indicates that this was written for a driver controlled period,
@Override public void runOpMode () { motor1 = hardwareMap.get(DcMotor.class, "motor1"); motor2 = hardwareMap.get(DcMotor.class, "motor2"); telemetry.addData("Status", "Initialized"); telemetry.update(); //Wait for game to start (driver presses PLAY) waitForStart(); /* the overridden runOpMode method happens with every OpMode using the LinearOpMode type. hardwareMap is an object that references the hardware listed above (private variables). The hardwareMap.get method matches the name of the device used in the configuration, so we would have to change the names (ex. motorTest to Motor 1 or Motor 2 (or something else)) if not, the opMode won't recognize the device in the second half of this section, it uses something called telemetry. In the first and second lines it sends a message to the driver station saying ("Status", "Initialized") and then it prompts the driver to press start and waits. All linear functions should have a wait for start command so that the robot doesn't start executing the commands before the driver wants to (or pushes the start button) */ //run until end of match (driver presses STOP) double tgtpower = 0; while (opModeIsActive()) { telemetry.addData("Left Stick X", this.gamepad1.left_stick_x); telemetry.addData("Left Stick Y", this.gamepad1.left_stick_y); telemetry.addData("Right Stick X", this.gamepad1.right_stick_x); telemetry.addData("Right Stick Y", this.gamepad1.right_stick_y); if (this.gamepad1.left_stick_y < 0){ tgtpower=-this.gamepad1.left_stick_y; motor1.setPower(tgtpower); motor2.setPower(-tgtpower); }else if (this.gamepad1.left_stick_y > 0){ tgtpower=this.gamepad1.left_stick_y; motor1.setPower(-tgtpower); motor2.setPower(tgtpower); }else if (this.gamepad1.left_stick_x > 0){ tgtpower=this.gamepad1.left_stick_x; motor1.setPower(tgtpower); motor2.setPower(tgtpower); }else if (this.gamepad1.left_stick_x < 0){ tgtpower=-this.gamepad1.left_stick_x; motor1.setPower(-tgtpower); motor2.setPower(-tgtpower); }else{ motor1.setPower(0); motor2.setPower(0); } telemetry.addData("Motor1 Power", motor1.getPower()); telemetry.addData("Motor2 Power", motor2.getPower()); telemetry.addData("Status", "Running"); telemetry.update (); /* if (this.gamepad1.right_stick_x == 1){ //trying to make robot turn right, == 1 may be wrong motor2.setPower(-1); } else if (this.gamepad1.right_stick_x == -1){ //trying to make robot turn left, == -1 may be wrong motor1.setPower(-1); } else { } */ /* After the driver presses start,the opMode enters a while loop until the driver presses stop, while the loop is running it will continue to send messages of ("Status", "Running") to the driver station */ } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Override\n public void init() {\n telemetry.addData(\"Status\", \"Initializing\"); //display on the drivers phone that its working\n\n FLM = hardwareMap.get(DcMotor.class, \"FLM\"); //Go into the config and get the device named \"FLM\" and assign it to FLM\n FRM = hardwareMap.get(DcMotor.c...
[ "0.67998976", "0.66259664", "0.66028357", "0.6596697", "0.65128475", "0.6385841", "0.6382263", "0.63767606", "0.6368629", "0.6342001", "0.63387513", "0.6317162", "0.63152957", "0.62871313", "0.62848794", "0.6274658", "0.6268246", "0.626436", "0.62440556", "0.6227371", "0.6209...
0.57759637
78
loadingView = getView(loadingView, R.id.loading_view);
@Override public void initView() { }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Override\n\t\t\t\t\t\tpublic void onLoadingStarted(String arg0, View arg1) {\n\t\t\t\t\t\t}", "@Override\r\n\t\t\t\t\tpublic void onLoadingStarted(String arg0, View arg1) {\n\t\t\t\t\t}", "@Override\n public void onLoadingStarted(String arg0, View arg1) {\n }", "@Override\r\n\t\tpublic...
[ "0.75615203", "0.74494773", "0.7446948", "0.7371172", "0.7356045", "0.7356045", "0.7336416", "0.73265237", "0.7312038", "0.7287237", "0.70237035", "0.6946704", "0.6913425", "0.6896624", "0.679046", "0.67349046", "0.6711601", "0.6683244", "0.6658766", "0.66499805", "0.6635336"...
0.6303602
66
ZigzagIterator it = new ZigzagIterator(Arrays.asList(1,2), Arrays.asList(3,4,5,6));
public static void main(String[] args) { ZigzagIterator it = new ZigzagIterator(Arrays.asList(1,2,3), Arrays.asList(4,5,6,7), Arrays.asList(8,9)); while(it.hasNext()) { System.out.println(it.next()); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public static void ZigZag(int x[] , int y[]){\n int a[] = new int[x.length + y.length];\n\t\tint k = 0;\n\t\tfor(int i = 0; i < x.length; i++){\n\t\t\ta[k++] = x[i];\n\t\t}\n\t\tfor(int i = 0; i < y.length; i++){\n\t\t\ta[k++] = y[i];\n\t\t}\n\t\tboolean flag = true;\n\t\tfor(int i= 0; i <= a.length - 2; ...
[ "0.64445317", "0.6008304", "0.5588034", "0.55853903", "0.53187394", "0.5188742", "0.5105969", "0.50424594", "0.5040366", "0.4963959", "0.4933699", "0.493291", "0.4927468", "0.49116215", "0.4894379", "0.48893067", "0.4886844", "0.48849708", "0.48829126", "0.48458648", "0.48351...
0.7083456
0
111123456 111123457 111123458 111123459
@Test @Prepare(autoImport = true, autoClearExistsData = true) public void testdeleteById() throws Exception { int[] ids = { 111123456, 111123457, 111123458, 111123459 }; for (int id : ids) { inventoryOutDao.deleteById(id); } for (int id : ids) { assertNull(inventoryOutDao.getById(id)); } // List<InventoryOutDO> list = inventoryOutDao.list(new // InventoryOutDO()); // assertResultListSorted(list, "id"); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Test\n public void calculationOnElevenDigitMsgIsCorrect() {\n final String msg = \"00110001110\";\n final int[] expectedMsg = {0,0,1,0, 1,0,1,1, 1,0,0,0, 1,1,1,0};\n\n // When\n int[] transformedMsg = HammingAlgorithm.calculate(msg);\n\n // Then\n assertThat(transforme...
[ "0.6589994", "0.6215127", "0.6102794", "0.59671324", "0.5952409", "0.58389556", "0.58265805", "0.5733374", "0.56846595", "0.5667819", "0.5662449", "0.56487715", "0.5638271", "0.56334597", "0.56087565", "0.5598173", "0.55861646", "0.5576129", "0.55755377", "0.5558121", "0.5540...
0.0
-1
TODO Autogenerated method stub
public static void main(String[] args) { int[][] t1 = new int[4][]; t1[0]= new int[4]; System.out.println(t1[0]); System.out.println(t1[0][0]); int[][] t2 = {{1,2,3,4,5},{44,66,77,99,12,21},{11,22}}; for(int i=0 ; i<t2.length;i++) { for(int j=0 ; j < t2[i].length ;j++) { System.out.print(t2[i][j]+" "); } System.out.println(); } char[][]s = { {'x','x','x'}, {'x','o','x'}, {'x','x','o'}, {'x','x','x'} }; for(int i=0 ; i<s.length ; i++) { for(int j=0 ; j<s[i].length;j++) { if(s[i][j]=='o') { System.out.printf("[%2d행%2d열}%n",i,j); } } } }
{ "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
User u = new User(); u.setUsername("testMybatisss"); u.setPassword("123"); u.setBrithDate(Calendar.getInstance().getTime()); System.out.println(u); int insert = iUserDao.insert(u); System.out.println(u);
@Test public void insert() { // int insert = iUserDao.insert(u); // System.out.println(u); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Test\r\n\t\tpublic void insertUserTestCase() {\r\n\t\t\t\r\n\t\t\tUser user = new User();\r\n\t\t\t\t\t\r\n\t\t//\tuser.setBirthDate(LocalDate.parse(\"1994-04-09\"));\r\n\t\t\tuser.setUsername(\"renu\");\r\n\t\t//\tuser.setUserId(1003);\r\n\t\t\t\r\n\t\t\tuser.setEmail(\"renu@gmail.com\");\r\n\t\t\t\t\t\r\n\t\t\t...
[ "0.80710447", "0.7850062", "0.78472424", "0.7736815", "0.77130044", "0.77116203", "0.7653171", "0.7645515", "0.76342463", "0.76124895", "0.7576947", "0.74119985", "0.7352934", "0.7342664", "0.72989076", "0.72942597", "0.7230732", "0.7220337", "0.7212791", "0.7186933", "0.7177...
0.7819804
3
User user = iUserDao.findById(3); user.setUsername("update"); iUserDao.updateById(user);
@Test public void update() { }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "void updateUser(User entity) throws UserDaoException;", "public User updateUser(User user);", "int updateUserById( User user);", "@Test\n public void testModifyUser() throws Exception {\n\n User user = userDao.retrieveById(\"uuid123123123\");\n user.setUsername(\"newbody4\");\n\n Bool...
[ "0.81850153", "0.80780137", "0.7985893", "0.7963281", "0.7901159", "0.78461033", "0.77393395", "0.77378184", "0.76729256", "0.7621004", "0.75973487", "0.75901556", "0.7550346", "0.75322884", "0.75322884", "0.74959576", "0.74727315", "0.7460605", "0.74577856", "0.7450215", "0....
0.0
-1