query
stringlengths
8
1.54M
document
stringlengths
9
312k
negatives
listlengths
19
20
metadata
dict
save data to dest table TODO ignore columns cl_des.doesColumnNameExist(columnData_des, "DateCreated")
private void save() { // does this data exist in dest table, (can have multile keys) long count = doIdentsExistAlready(database_des); String fields = getFields(); if (fields == null || fields.trim().length() == 0) { //log.info("Transfer.save(): skipping save(). " + // "probably b/c we only have a primary key and/or one to many is the only thing being used. " + // "Its possible your only moving one to many records. Ignore this if only moving one to many."); return; } String sql = ""; if (count > 0) { // update String where = getSql_WhereQueryIfDataExists(); sql = "UPDATE " + tableRight + " SET " + fields + " WHERE " + where; } else { // insert sql = "INSERT INTO " + tableRight + " SET " + fields; } testColumnValueSizes(columnData_des); log.info(index + " Transfer.save(): " + sql); ql_des.update(database_des, sql, false); deleteSourceRecord(); index--; }
[ "private void createDestTable() {\n String primaryKeyName = cl_src.getPrimaryKey_Name(columnData_src);\n tl_des.createTable(database_des, tableRight, primaryKeyName);\n }", "public function save()\n {\n global $Database;\n \n $query = new QueryBuilder();\n $columns = [];\n ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
displays the scores in columnar form. Golfer is the header for each column
public void displayColumns() { System.out.println("SCORES"); System.out.println("0\t1\t2\t3\t4\t5"); // \t will space to the next tab for(int i = 0; i<scores[0].length;i++) { for(int c = 0; c<scores.length;c++) { System.out.printf(scores[c][i] +"\t"); } System.out.println(); } // marker (for formatting) System.out.println("-\t-\t-\t-\t-\t-"); }
[ "public void displayScoresHeader() {\n\t\tSystem.out.println(\"### Scores ###\");\n\t}", "public static void displayGrades(){\r\n //print out grades to board\r\n for(int row =0; row< grade.length; row++){\r\n for(int col=0; col<grade[row].length; col++){\r\n grade[row][col] =...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
These settings relate to your QuickTime MOV output container.
public MovSettings getMovSettings() { return this.movSettings; }
[ "public void setMovSettings(MovSettings movSettings) {\n this.movSettings = movSettings;\n }", "private static double outputQuality()\r\n {\r\n return Iterator.mode ? 0.3 : 0.8;\r\n }", "public void setDefaultParameters() {\n\t\toptions = 0;\n\t\toutBits = null;\n\t\ttext = new byte[0];\n\t\tyHei...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Reset Card related Transactions for specific customer
@ApiOperation(value = "Update Payee Response for specific users") @PostMapping(value = "/init/{customerId}/cards/transactions", consumes = {"application/json"}) public ResponseEntity<String> resetCardTransactionsResponse( @RequestBody Map<String, CardTransactionsResponse> cardTransactionsResponseMap, @PathVariable(name = "customerId", required = true) String customerId, @PathVariable(name = "accountId", required = true) String accountId) { ApplicationLogger.logInfo("Updating card response...", this.getClass()); CoreBankingModel coreBankingModel = coreBankingService.getCoreBankingModel(customerId); coreBankingModel.setCardTransactionsResponse(cardTransactionsResponseMap); coreBankingService.saveCoreBankingModel(coreBankingModel); String response = "Re-initialised card response successfully"; return ResponseEntity.ok(response); }
[ "public void clearCustomer()\n\t{\n\t\tcustomer = null;\n\t}", "public void resetChange(){\n\t\tCustomerPanel custPanel=txCtrl.getCustomerPanel();\n\t\tif(custPanel!=null){\n\t\t\tcustPanel.resetChange();\n\t\t}\n\t}", "void unsetCustomerParameters();", "void unsetSettlementAmount();", "public void clearCas...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Creates an entity ID from a UTF8 text Kiji row key.
public EntityId fromKijiRowKey(String text) { return fromKijiRowKey(Bytes.toBytes(text)); }
[ "public abstract EntityId fromKijiRowKey(byte[] kijiRowKey);", "public abstract EntityId fromHBaseRowKey(byte[] hbaseRowKey);", "public abstract String generateFirstRowKey(final long id);", "private NodeIdentifier getKeyFromDatabaseEntry(DatabaseEntry keyEntry)\n\t\t\tthrows IOException {\n\t\tbyte[] keyData ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
The goal of this interface is to declare the required getters and setters the target class needs to implement. This will enable the class to be able to store the secrets in Sources, and to pull the secrets from it.
public interface SourcesSecretable { /** * Get the contents of the secret token. * @return the contents of the secret token. */ String getSecretToken(); /** * Set the contents of the secret token. * @param secretToken the contents of the secret token. */ void setSecretToken(String secretToken); /** * Get the ID of the "secret token" secret stored in Sources. * @return the ID of the secret. */ Long getSecretTokenSourcesId(); /** * Set the ID of the "secret token" secret stored in Sources. * @param secretTokenSourcesId the ID of the secret. */ void setSecretTokenSourcesId(Long secretTokenSourcesId); /** * Get the basic authentication object. * @return the basic authentication object. */ BasicAuthentication getBasicAuthentication(); /** * Set the basic authentication object. * @param basicAuthentication the basic authentication object to be set. */ void setBasicAuthentication(BasicAuthentication basicAuthentication); /** * Get the ID of the "basic authentication" secret stored in Sources. * @return the ID of the secret. */ Long getBasicAuthenticationSourcesId(); /** * Set the ID of the "basic authentication" secret stored in Sources. * @param basicAuthenticationSourcesId the ID of the secret. */ void setBasicAuthenticationSourcesId(Long basicAuthenticationSourcesId); }
[ "public interface BaseCredentialsProvider {\n}", "public interface ConfigSource\n{\n\t/**\n\t * Get the properties that this source has available.\n\t *\n\t * @return\n\t */\n\tMapIterable<String, Object> getProperties();\n\n\t/**\n\t * Get the keys that are available directly under the given path.\n\t *\n\t * @p...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
/ Get the next Cartesian combination of indices for inputs. Return true if a new Cartesian combination of indices exists and false otherwise.
private boolean nextIndices(List<List<T>> inputs, List<Integer> indices) { // First iteration, initialize each index to zero if (indices.isEmpty()) { for (int i=0; i<inputs.size(); i++) { indices.add(0); } return true; } // Not first iteration, calculate next Cartesian product of indices for (int i=(inputs.size()-1); i>=0; i--) { List<T> input = inputs.get(i); int nextIndex = (indices.get(i)+1) % input.size(); indices.set(i, nextIndex); // Only want to increment one index per call, if nextIndex is greater // than zero, that has already happened so just return true if (nextIndex>0) { return true; } } // None of the indices incremented, return false return false; }
[ "private void checkIfHasNextCartesianProduct() {\n nextIndex = vectorSize - 1;\n while (nextIndex >= 0 &&\n indices[nextIndex] + 1 >= vector.get(nextIndex).size()) {\n nextIndex--;\n }\n }", "@Override\n public List<T> next() {\n if (index == 0) {\n return generateCartesianProduct()...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Create an instance of DevelopmentComponentUpdater.
public DevelopmentComponentUpdater(final String location, final DevelopmentComponentFactory dcFactory) { this.location = location; this.dcFactory = dcFactory; }
[ "public DevelopmentComponentUpdater(final String location, final DevelopmentComponentFactory dcFactory) {\r\n this.dcFactory = dcFactory;\r\n antHelper = new AntHelper(location, dcFactory);\r\n }", "public Updater()\n { \n }", "Component createComponent();", "public abstract PackageConfigur...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
set shutdown flag Reject further work Call shutdown on thread pool Wait till queue is empty Exit then
public void shutdown(){ shutdown = true; incomingElementsQueueExecutorService.shutdown(); }
[ "public void shutdown() {\n shutdown = true;\n for (Thread thread : threads) {\n thread.interrupt();\n }\n synchronized (tasksQueue) {\n try {\n while (!tasksQueue.isEmpty()) {\n PoolTask<?> task = tasksQueue.take();\n ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Replaces the binding for the specified name in this registry with the supplied remote reference. If a previous binding for the specified name exists, it is discarded.
public void rebind(String name, Remote ref) throws RemoteException;
[ "public void bind(String name, Remote ref) throws RemoteException, AlreadyBoundException;", "public void bindEjbReference(String referenceName, String jndiName) throws ConfigurationException;", "public void rebind(String name, Object obj)\n throws NamingException, RemoteException {\n\n rootCon...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
create a bunch of visitors (Book, CD, and DVD)
public static void main(String[] args) { Visitable myBook = new Book(8.52, 1.05); Visitable myCD = new CD(18.52, 3.05); Visitable myDVD = new DVD(6.53, 4.02); // add each vistor to the array list items.add(myBook); items.add(myCD); items.add(myDVD); Visitor visitor = new USPostageVisitor(); double myPostage = calculatePostage(visitor); System.out.println("The total postage for my items shipped to the US is: " + myPostage); visitor = new SouthAmericaPostageVisitor(); myPostage = calculatePostage(visitor); System.out.println("The total postage for my items shipped to South America is: " + myPostage); }
[ "public void createAgents(int count) {\n for (int idx = 0; idx < count; ++idx) {\n Agent agent = new Agent(idx, 0);\n addAgent(agent);\n }\n }", "private void createVehicles() {\n for (int i = 0; i < 10; i++) {\n vehicles.add(new Car());\n vehicl...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Check which Goal radio button was clicked and set sign for goal calorie calculation
@Override public void onClick(View v) { switch (goalRadioGroup.getCheckedRadioButtonId()) { case R.id.lose_weight_radio_button: goalSign = -1; break; case R.id.maintain_weight_radio_button: goalSign = 0; break; case R.id.gain_weight_radio_button: goalSign = 1; break; } /* Check which Goal Speed radio button was clicked and set amount of calories to add or gain */ switch (goalSpeedRadioGroup.getCheckedRadioButtonId()) { case R.id.aggressive_radio_button: additionalGoalCalories = 500; break; case R.id.suggested_radio_button: additionalGoalCalories = 250; break; case R.id.slowly_radio_button: additionalGoalCalories = 100; break; } // Calculate calories to meet user's goal based on their stats and display the amount calculateGoalCalories(tdee, goalSign, additionalGoalCalories); goalCaloriesTextView.setText(String.valueOf(goalCalories)); }
[ "private void bruteForceJRadioButtonMenuItemActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_bruteForceJRadioButtonMenuItemActionPerformed\n bruteForceJRadioButton.setSelected(true);\n calculateJButton.doClick();\n// methodJLabel.setText(\"Brute Force\");\n// clearStats...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
/ Create Content without contentType. Expected : 400 CLIENT_ERROR
@Test public void createContentWithoutContentType() throws Exception { String createContentReq = "{\"request\": {\"content\": {\"name\": \"Unit Test\",\"code\": \"unit.test\",\"mimeType\": \"application/pdf\"}}}"; String path = basePath + "/create"; actions = mockMvc.perform(MockMvcRequestBuilders.post(path).contentType(MediaType.APPLICATION_JSON) .header("X-Channel-Id", "channelKA").content(createContentReq)); Assert.assertEquals(400, actions.andReturn().getResponse().getStatus()); Response resp = getResponse(actions); Assert.assertEquals("ERR_GRAPH_ADD_NODE_VALIDATION_FAILED", resp.getParams().getErr()); Assert.assertEquals("CLIENT_ERROR", resp.getResponseCode().toString()); }
[ "@Test\n\tpublic void createContentWithInvalidContentType() throws Exception {\n\t\tString createContentReq = \"{\\\"request\\\": {\\\"content\\\": {\\\"name\\\": \\\"Unit Test\\\",\\\"code\\\": \\\"unit.test\\\",\\\"mimeType\\\": \\\"application/pdf\\\",\\\"contentType\\\":\\\"pdf\\\"}}}\";\n\t\tString path = base...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Encode file to base64 binary string.
public static String encodeFileToBase64BinaryString(File fileName) throws IOException { return new String(Base64.encode(FileUtils.readFileToByteArray(fileName))); }
[ "public static String encodeToBase64String(MultipartFile file) throws IOException, SQLException {\n byte[] fileBytes = file.getBytes();\n String base64String = Base64Utils.encodeToString(fileBytes);\n\n return base64String;\n }", "public static String base64Encode(byte[] input) {\n ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Deplace le robot d'une case en bas si le deplacement est possible.
private void down() { Point p = robot.getPosition(); if (grille.deplacementPossible(robot, p.getX(), p.getY() + 1)) { robot.setPosition(p.getX(), p.getY() + 1); } }
[ "public void deplacements () {\n\t\t//Efface de la fenetre le mineur\n\t\t((JLabel)grille.getComponents()[this.laby.getMineur().getY()*this.laby.getLargeur()+this.laby.getMineur().getX()]).setIcon(this.laby.getLabyrinthe()[this.laby.getMineur().getY()][this.laby.getMineur().getX()].imageCase(themeJeu));\n\t\t//Depl...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
A CurveMeasure is like a AtMeasure, but the behavior defined creates a curve of points (atValue, result) on a lot of xValues (atValues) specified by CurveMeasure interface users. Whatever class that implements the CurveMeasure interface has to implement the behavior defined by Measure interface.
public interface CurveMeasure extends Measure{ /** * Returns a MeasureSet object that contains the measure result to all topic and atValues specified on the run selected. * @param run - name of run * @param xValues - atValues array. * @return MeasureSet - The object that encapsulates the measure result. * @throws IOException -If happened a problem when open the result file * @throws InterruptedException - * @throws InvalidItemNameException - If the data is not a number. * @throws ItemNotFoundException - If a topic does not exist. * @throws InvalidItemNameException - If a topics with the same name exists. */ public MeasureSet getValue(String run, String [] xValues) throws IOException, InterruptedException, NumberFormatException, ItemNotFoundException, InvalidItemNameException, QrelItemNotFoundException, TopicNotFoundException, InvalidQrelFormatException; /** * Returns a MeasureSet object that contains the measure result to selected topics and atValues specified on the run selected. * @param run - name of run * @param xValues - atValues array. * @param topicNumbers - selected topic name array * @return MeasureSet - The object that encapsulates the measure result. * @throws IOException -If happened a problem when open the result file * @throws InterruptedException - * @throws InvalidItemNameException - If the data is not a number. * @throws ItemNotFoundException - If a topic does not exist. * @throws InvalidItemNameException - If a topics with the same name exists. */ public MeasureSet getValue(String run, String [] xValues, String[] topicNumbers) throws IOException, InterruptedException, NumberFormatException, ItemNotFoundException, InvalidItemNameException, QrelItemNotFoundException, TopicNotFoundException, InvalidQrelFormatException; }
[ "Measure createMeasure();", "public interface CurvePainter {\n\n /**\n * paint specified curve\n * \n * @param g2d\n * the graphics context\n * @param curve\n * the curve to paint\n */\n public void paintCurve(Graphics2D g2d, Curve curve);\n}", "public abs...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
prints the information that is necessary to be organized for club information
public String toString(){ return ("\nClub Name:\t\t" + clubName + "\n"+ "Number Of Members:\t" + numOfMembers + "\n"+ "University:\t\t" + university + "\n"+ "President:\t\t" + president + "\n\n"); }
[ "public void printInfo(){\n System.out.println(hubName);\n System.out.println(netmask);\n System.out.println(subnetFull);\n System.out.println(subnet);\n System.out.println(clientaddressList);\n System.out.println(infList);\n }", "public void printDetails()\n {\n ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Sets the prerequisites for the course.
public void setPrerequisites(CourseGroup prerequisites) { this.prerequisites = prerequisites; }
[ "public void setPreRequisites(Set<Course> preRequisites) {\n this.preRequisites = preRequisites;\n }", "void addPrerequisites(List<String> prereq) {\n _prerequisites.addAll(prereq);\n }", "void setRequiredCourses(ArrayList<Course> requiredCourses) {\r\n this.requiredCourses = required...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
FieldType s the new way to set the configuration. Before, in version 3.6, we had doc.add(new Field(CONTENTS_NAME, new FileReader(f),//Index file content TermVector.WITH_POSITIONS_OFFSETS)); Now we simply set this up in FieldType
protected Document getDocument(File f) throws IOException{ Document doc = new Document(); FieldType tft = new FieldType(TextField.TYPE_STORED); tft.setIndexOptions(IndexOptions.DOCS_AND_FREQS_AND_POSITIONS_AND_OFFSETS); Field textField = new Field(CONTENTS_NAME, new FileReader(f), tft); doc.add(textField); // TODO uncertain whether we need TYPE_STORED FieldType sft = new FieldType(StringField.TYPE_STORED); //tft.setIndexOptions(IndexOptions.); Field stringField = new Field("filename", f.getName(), sft); doc.add(stringField); FieldType pft = new FieldType(StringField.TYPE_STORED); Field pathField = new Field("fullpath", f.getCanonicalPath(), pft); doc.add(pathField); /* * doc.add(new Field("filename", f.getName(), //Index file name Field.Store.YES, * Field.Index.NOT_ANALYZED)); * * doc.add(new Field("fullpath", f.getCanonicalPath(), //Index file full path * Field.Store.YES, Field.Index.NOT_ANALYZED)); * */ return doc; }
[ "@Test\n public void setFieldIndexFormat() throws Exception {\n Document doc = new Document();\n DocumentBuilder builder = new DocumentBuilder(doc);\n builder.write(\"A\");\n builder.insertBreak(BreakType.LINE_BREAK);\n builder.insertField(\"XE \\\"A\\\"\");\n builder.wr...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Gets the valorOutros value for this CustoEfetivoTotal.
public java.lang.Double getValorOutros() { return valorOutros; }
[ "public BigDecimal getValorTotal(){\r\n\t\r\n\t\t// percorre a lista de ItemVenda - stream especie de interator do java 8\r\n\t\treturn itens.stream()\r\n\t .map(ItemVenda::getValorTotal) // para cada um dos itens, obtem o valor total do item\t\r\n\t .reduce(BigDecimal::add) // som...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Checks that the sum of all angles is 360
protected boolean angleValidityCheck(double alpha, double beta, double gamma, double delta){ if(alpha+beta+gamma+delta!=360) throw new IllegalArgumentException("Total of all angles should always be 360"); return true; }
[ "private boolean checkAngle() {\n\t\tint bornes = FILTER_BORNES;\n\t\treturn checkAngleBornes(angle, 0d, bornes) || checkAngleBornes(angle, 90d, bornes) || checkAngleBornes(angle, 180d, bornes);\n\t}", "public boolean isAngleOkay(){if(wheelError() < Constants.TURNING_ADD_POWER_THRESHOLD) {return true;} else {retu...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Switch share functionality tests
@Test (priority = 1) public void switchShare() throws InterruptedException, Exception { Actions share = new Actions(driver); WebElement sh = driver.findElement(By.xpath("html/body/nav/div/div[1]/ul[1]/li/a")); Thread.sleep(3000); share.moveToElement(sh).build().perform(); Thread.sleep(3000); sh.click(); System.out.println("Share switch link clicked"); Actions share1 = new Actions(driver); WebElement dallpp = driver.findElement(By.xpath("html/body/nav/div/div[1]/ul[1]/li/ul/li[3]/a")); ((JavascriptExecutor) driver).executeScript("arguments[0].scrollIntoView();", dallpp); // scroll here share1.moveToElement(dallpp).build().perform(); Thread.sleep(3000); dallpp.click(); Thread.sleep(3000); NotificationsCS.captureScreenShot(driver); Actions share2 = new Actions(driver); WebElement sh1 = driver.findElement(By.xpath("html/body/nav/div/div[1]/ul[1]/li/a")); Thread.sleep(3000); share2.moveToElement(sh1).build().perform(); Thread.sleep(3000); sh1.click(); Thread.sleep(3000); WebElement kg = driver.findElement(By.xpath("html/body/nav/div/div[1]/ul[1]/li/ul/li[10]/a")); ((JavascriptExecutor) driver).executeScript("arguments[0].scrollIntoView();", kg); // scroll here share2.moveToElement(kg).build().perform(); Thread.sleep(4000); kg.click(); Thread.sleep(3000); System.out.println("KG Share opened, to test notifications"); }
[ "private void doTests()\n {\n doDeleteTest(); // doSelectTest();\n }", "@Test public void runCommonTests() {\n\t\trunAllTests();\n\t}", "@Test\n public void onSearchRideActionTest() {\n onSearchRideActionWithNetworkConfigTest(false);\n onSearchRideActionWithNetworkConfigTest(true);\n }"...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Populate docs array with 8 preconfigured docs
private void initialiseDocArray() { docs[0] = new Doc(1234500001, "A New Hope", "pdf"); docs[1] = new Doc(1234500002, "Empire Strikes Back", "msg"); docs[2] = new Doc(1234500003, "Return of the Jedi", "txt"); docs[3] = new Doc(1234500004, "The Hobbit", "pdf"); docs[4] = new Doc(1234500005, "Fellowship of the Ring", "txt"); docs[5] = new Doc(1234500006, "Two Towers", "msg"); docs[6] = new Doc(1234500007, "Return of the King", "pdf"); docs[7] = new Doc(1234500008, "Macbeth", "txt"); }
[ "public void setDocs(Doc[] newDocs) \n {\n\tdocs = newDocs;\n }", "private void initializeAddDocObjects()\r\n {\r\n initializeUpdateHandler();\r\n initializeAddUpdateCommand();\r\n initializeDocBuilder();\r\n }", "public void setDocs(String docs) {\n\t\tthis.docs = docs;...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Checks if the pawn can capture another pawn by en passant
private boolean canCaptureEnPassant(Board board, Point pt) { Piece temp = board.getPieceAt(pt); if(temp != null) if (temp instanceof Pawn && temp.getColor() != this.color) if (((Pawn)temp).enPassantOk) return true; return false; }
[ "private static boolean canCapture(Piece p, Piece middle) {\n if (p.side() == middle.side())\n return false;\n else\n return true;\n }", "private boolean isBeingCapturedBySameEnemyTeam() {\n return commandPostTeam != getCapturingTeam() && attemptedCaptureTeam == getCa...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Return a list of traffic violations in a driver's or vehicle's history.
@Override public ArrayList<ITrafficViolation> getTrafficViolations() { return trafficViolations; }
[ "public AbstractHistory(\n ArrayList<ITrafficViolation> trafficViolations) {\n this.trafficViolations = trafficViolations;\n }", "public AbstractHistory(\n ArrayList<ITrafficViolation> trafficViolations,\n ArrayList<IVehicleCrash> crashes) {\n this.trafficViolations = trafficViolations;\n ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Handles bookkeeping necessary when the turn ends. Specifically updating whose turn it is.
private void endTurn() { currentTurn = getNextPlayer(); }
[ "private void endTurnState() {\n nullLastError();\n logger.d(\"End turn.\");\n\n // get turn data\n int[] p1TurnWord = new int[Constrains.MAX_NUMBER_OF_STONES];\n int[] p2TurnWord = new int[Constrains.MAX_NUMBER_OF_STONES];\n int[] data = (int[])getData();\n for(int ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
This method was generated by MyBatis Generator. This method returns the value of the database column IMAL141_DEV_O18.S_CONTROL_PARAM.ADD_NUMBER1_MAND
public String getADD_NUMBER1_MAND() { return ADD_NUMBER1_MAND; }
[ "public String getADD_NUMBER2_MAND() {\r\n return ADD_NUMBER2_MAND;\r\n }", "public String getADD_DATE1_MAND() {\r\n return ADD_DATE1_MAND;\r\n }", "public String getADD_STRING1_MAND() {\r\n return ADD_STRING1_MAND;\r\n }", "public String getADD_NUMBER5_MAND() {\r\n return...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Get the has_balance state which is a possible internal Wallet state.
public State has_balance_state() { return has_balance; }
[ "public boolean isSetBalance() {\n return this.balance != null;\n }", "public State has_saving_no_balance_state() {\n\t\treturn has_saving_no_balance;\n\t}", "public boolean isSetBalance() {\n return org.apache.thrift.EncodingUtils.testBit(__isset_bitfield, __BALANCE_ISSET_ID);\n }", "public boolean i...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
the sum from pile[i] to the end
public int stoneGameII(int[] piles) { int n = piles.length; memo = new int[n][n]; sums = new int[n]; sums[n-1] = piles[n-1]; for(int i = n -2; i>=0;i--) { sums[i] = sums[i+1] + piles[i]; //the sum from piles[i] to the end } int score = helper(0, 1, piles); return score; }
[ "public static int sum() {\n int sum = 0;\n for (int i=0; i<=100; i++){\n sum += i;\n }\n return sum;\n }", "public int totalGemValue() {\r\n\t\ttotal = 0;\r\n\t\ttotal += gemPile[0];\r\n\t\ttotal += gemPile[1] * 2;\r\n\t\ttotal += gemPile[2] * 3;\r\n\t\ttotal += gemPile[...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Tests that we can map BioPAX Physical Interactions Correctly.
public void testPhysicalInteractions() throws Exception { Model model = BioPaxUtil.read(new FileInputStream(getClass().getResource("/DIP_ppi.owl").getFile())); MapBioPaxToCytoscape mapper = new MapBioPaxToCytoscape(); mapper.doMapping(model); CyNetwork cyNetwork = createNetwork("network2", mapper); int nodeCount = cyNetwork.getNodeCount(); assertEquals(3, nodeCount); // First, find the Target Interaction: physicalInteraction1. int targetNodeIndex = 0; RootGraph rootGraph = cyNetwork.getRootGraph(); Iterator nodeIterator = cyNetwork.nodesIterator(); while (nodeIterator.hasNext()) { CyNode node = (CyNode) nodeIterator.next(); String uri = Cytoscape.getNodeAttributes() .getStringAttribute(node.getIdentifier(), MapBioPaxToCytoscape.BIOPAX_RDF_ID); if (uri.endsWith("physicalInteraction1")) { targetNodeIndex = node.getRootGraphIndex(); } } // Get All Edges Adjacent to this Node int[] edgeIndices = rootGraph.getAdjacentEdgeIndicesArray(targetNodeIndex, true, true, true); // There should be two edges; one for each participant assertEquals(2, edgeIndices.length); }
[ "private void testMap() {\n\t\t_knowledgeMapA.updateLocation(new Point(2, 2), 4, 2);\n\t\t_knowledgeMapA.updateLocation(new Point(2, 3), 5, 2);\n\t\t_knowledgeMapA.updateLocation(new Point(2, 4), 6, 2);\n\t\t_knowledgeMapA.updateLocation(new Point(2, 0), 7, 2);\n\t\t_knowledgeMapA.updateLocation(new Point(0, 2), 8,...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Tests ctor CutStateNodeAbstractActionCutStateNodeAbstractAction(String,StateVertex,Clipboard) for accuracy. Verify : the newly created CutStateNodeAbstractAction instance should not be null.
public void testCtor() { assertNotNull("Failed to create a new CutStateNodeAbstractAction instance.", action); }
[ "public void testCtor_NullClipboard() {\n assertNotNull(\"Failed to create a new CutStateNodeAbstractAction instance.\",\n new MockCutStateNodeAbstractAction(\"Cut\", state, null));\n }", "public void testCtor_NullState() {\n try {\n new MockCutStateNodeAbstractAction(\"Cut\...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
If the message matches this classes message type, then the class will return a new message of this type, part of the chain of responsibility
@Override public Message getMessageType(Message message) { if (message.getHeader().getMessageType() == MESSAGE_TYPE) { return new AbilityMessage(message); } else { // Send it on to the next in the chain if (this.messageChain != null) { return this.messageChain.getMessageType(message); } } return null; }
[ "public void readNewMessage() throws IOException, ClassNotFoundException, IllegalAccessException,\n InvocationTargetException, IllegalArgumentException {\n mReadMessage = (Message) mInStream.readObject();\n if (mReadMessage instanceof NewMessageType) {\n // we add the messag...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Add the Object to the serializer, if it implements the ca.uregina.thg.client.common.net.Serializable interface
public void write(othi.thg.common.Serializer obj) throws IOException { obj.writeObject(this); }
[ "void serialize(Object o, ByteBuf b);", "void serialize(Object obj, OutputStream stream) throws IOException;", "private void encodeOSRFSerializable(OSRFSerializable obj, StringBuffer sb) {\n\n OSRFRegistry reg = obj.getRegistry();\n String[] fields = reg.getFields();\n Map<String, Object> m...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Sets the unique name associated with the i'th numeric attribute. All strings will be converted to lower case first.
public boolean setNumericName(String name, int i) { if (i < getNumNumericalVars() && i >= 0) numericalVariableNames.put(i, name); else return false; return true; }
[ "public void setUniqueName(String name){\n //uniqueName = name;\n\n int range = Integer.MAX_VALUE / 3 * 2;\n Random rand = new Random();\n int i = rand.nextInt(range);\n Integer j = new Integer(i);\n uniqueName = name + j.toString();\n }", "public String getNumericName...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
A modified version of localization using at waypoints. The final position and orientation of the robot is changed from the original version. In this version however, the final orientation is 180 degrees different to the localize_waypoint() method.
public static void localize_waypoint_2() { stepOne_waypoint_2(); stepTwo_waypoint(); }
[ "public static void localize_waypoint() {\n stepOne_waypoint();\n stepTwo_waypoint();\n }", "public void localize(double x0, double y0){\n // Slow down robot so that it does not miss the line\n this.driver.setForwardSpeed(100);\n \n // Correct the robot's odometer's Y position by finding a hori...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
======================= PRIVATE ============================== ======================= PRIVATE ============================== ======================= PRIVATE ============================== ======================= PRIVATE ============================== ======================= PRIVATE ============================== ======================= PRIVATE ============================== ======================= PRIVATE ============================== Get the metadata from dom element and put into PM_PictureMetadaten.
private void getMetadaten(PM_Picture picture, Element bildElement) { picture.meta.setInit(true); // init mode proceed // ---- Attributes im bild-Tag ---------------------- if (getAttribute(bildElement, XML_VALID).equals("no")) { picture.meta.setInvalid(true); } else { picture.meta.setInvalid(false); } setDate( picture, bildElement); picture.meta.setCategory(getAttribute(bildElement, XML_QS)); setImageSize(picture, bildElement); // picture.meta // .setRotationString(getAttribute(bildElement, XML_ROTATE)); setRotation(picture, bildElement); picture.meta.setMiniSequence(getAttribute(bildElement, XML_MINI_SQUENCE)); // test String s = getAttribute(bildElement, XML_MINI_SQUENCE); if (s != null && s.length() != 0) { System.out.println("---- mini sequence: " +s); } // end String spiegeln = getAttribute(bildElement, XML_SPIEGELN); picture.meta.setMirror(spiegeln.equalsIgnoreCase("S")); if (getAttribute(bildElement, XML_BEARBEITET).equals("ja")) { picture.meta.setModified(true); } else { picture.meta.setModified(false); } // tags picture.meta.setIndex1(getTagValue(bildElement, XML_INDEX)); picture.meta.setRemarks(getTagValue(bildElement, XML_BEMERKUNGEN)); picture.meta.setIndex2(getTagValue(bildElement, XML_ORT)); picture.meta.setSequenz(getTagValue(bildElement, XML_SEQUENCE)); // im cut-tag List elements = bildElement.elements(XML_CUT); Element cutElement = null; if (elements.size() != 0) { cutElement = (Element) elements.get(0); } setCutRectangle( picture, cutElement); // picture.meta.setCutX(getAttribute(cutElement, XML_CUT_X)); // picture.meta.setCutY(getAttribute(cutElement, XML_CUT_Y)); // picture.meta.setCutBreite(getAttribute(cutElement, XML_CUT_B)); // picture.meta.setCutHoehe(getAttribute(cutElement, XML_CUT_H)); // work done picture.meta.setInit(false); // end init mode }
[ "ElementMetadata getElementMetadata();", "public String getProductPictureDetails(){\r\n\t\t\t\r\n\t\t\treturn (hasProductPicture())?McsElement.getElementByXpath(driver, PRODUCT_PIC_CONTAINER+\"//img\").getAttribute(\"src\"): \"\";\r\n\t\t}", "org.chromium.components.paint_preview.common.proto.PaintPreview.Metad...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Returns the value of a property as a boolean.
public boolean getBoolean(String property);
[ "boolean getBoolean(String propertyName);", "public boolean getBoolean(String property, boolean defaultValue);", "public boolean getBoolean(String property)\n\tthrows PropertiesPlusException\n\t{\n\t\tString value = getProperty(property);\n\t\tif (value == null)\n\t\t\tthrow new PropertiesPlusException(property...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Gets the equality comparator used to compare the objects in this collection.
default EqualityComparator<? super E> getComparator() { // Most implementations do not support custom equality comparators, // and just use the equals() and hashCode() implementations of the objects by default. return EqualityComparator.getDefault(); }
[ "protected EqualsComparator _getEqualsComparator() {\n return _mEqualsComparator;\n }", "public AttributeComparator getComparator() {\n\t\treturn comparator;\n\t}", "public Comparator getComparator() {\n return comparator;\n }", "public String getComparator() {\n\t\treturn comparator;\n\t}", "...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Create an independant data copy of the brain
public NeuralBrainData copy() { return new NeuralBrainData(this); }
[ "public Data copyData() {\r\n\t\treturn (new Bay(this)).data(); // Make a new Bay that will copy the data we view into it\r\n\t}", "Copydata createCopydata();", "CellularAutomata createCellularAutomata();", "private Instances deepCopy(Instances data) {\n Instances newInst = new Instances(data);\n\n...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
computeHashCodeOfNode Compute hash code of node pNode taking into account the hash codes of its children so that any two subtrees have the same hash code if they have the same shape.
int computeHashCodeOfNode(HIR pNode) { int lCode, lNodeIndex, lChild, lChildCount; Sym lSym; if (fDbgLevel > 3) ioRoot.dbgFlow.print(7, " computeHashCodeOfNode "); if (pNode == null) return 0; lNodeIndex = pNode.getIndex(); lCode = getHashCodeOfIndexedNode(lNodeIndex); if (lCode != 0) // Hash code is already computed. return it. return lCode; lCode = pNode.getOperator() + System.identityHashCode(pNode.getType()); lSym = pNode.getSym(); if (lSym != null) { // This is a leaf node attached with a symbol. lCode = lCode * 2 + System.identityHashCode(lSym); } else { lChildCount = pNode.getChildCount(); for (lChild = 1; lChild <= lChildCount; lChild++) { lCode = lCode * 2 + computeHashCodeOfNode((HIR)(pNode.getChild(lChild))); } } //##60 BEGIN // Assign different hash code for l-value compared to r-value. //##65 if ((pNode.getParent()instanceof AssignStmt) && //##65 (pNode.getParent().getChild1() == pNode)) if (FlowUtil.isAssignLHS(pNode)) //##65 { lCode = lCode * 2; } //##60 END lCode = (lCode & 0x7FFFFFFF) % EXP_ID_HASH_SIZE; if (fDbgLevel > 3) ioRoot.dbgFlow.print(7, Integer.toString(lCode, 10)); setHashCodeOfIndexedNode(lNodeIndex, lCode); return lCode; }
[ "private int recTreeHashCode(Node node) {\n // Get the parents HashCode.\n int hashCode = node.getTupleSet().hashCode();\n\n // Get the children's HashCode.\n int childrenHashCode = 1;\n for (Node child: node.children) {\n // Sum the children's HashCode.\n ch...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Sets a value of property OfficialArtistWebpage from an RDF2Go node. First, all existing values are removed, then this value is added. Cardinality constraints are not checked, but this method exists only for properties with no minCardinality or minCardinality == 1.
public static void setOfficialArtistWebpage( Model model, org.ontoware.rdf2go.model.node.Resource instanceResource, org.ontoware.rdf2go.model.node.Node value) { Base.set(model, instanceResource, OFFICIALARTISTWEBPAGE, value); }
[ "public void setOfficialArtistWebpage( org.ontoware.rdf2go.model.node.Node value) {\r\n\t\tBase.set(this.model, this.getResource(), OFFICIALARTISTWEBPAGE, value);\r\n\t}", "public void setOfficialArtistWebpage(org.ontoware.rdfreactor.schema.rdfs.Resource value) {\r\n\t\tBase.set(this.model, this.getResource(), OF...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
get versionPath of type UTF8String.
public UTF8String getVersionPath() { return this.versionPath; }
[ "public void setVersionPath(final UTF8String versionPath) {\n this.versionPath = versionPath;\n }", "public String getVPath() {\n return vPath;\n }", "protected String buildVersionedPath(final String path, final AbstractResourceVersion version) {\n\t\tif (!version.isValid()) {\n\t\t\treturn path;\...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
$ANTLR start "notExpression" /home/chinaski/programming/agile_workspace/ExplorerCat/src/main/antlr3/net/explorercat/cql/parser/CQL.g:384:1: notExpression : ( NOT )? arithmeticExpression ;
public final CQLParser.notExpression_return notExpression() throws RecognitionException { CQLParser.notExpression_return retval = new CQLParser.notExpression_return(); retval.start = input.LT(1); Object root_0 = null; Token NOT93=null; CQLParser.arithmeticExpression_return arithmeticExpression94 = null; Object NOT93_tree=null; errorMessageStack.push("NOT expression"); try { // /home/chinaski/programming/agile_workspace/ExplorerCat/src/main/antlr3/net/explorercat/cql/parser/CQL.g:388:2: ( ( NOT )? arithmeticExpression ) // /home/chinaski/programming/agile_workspace/ExplorerCat/src/main/antlr3/net/explorercat/cql/parser/CQL.g:388:4: ( NOT )? arithmeticExpression { root_0 = (Object)adaptor.nil(); // /home/chinaski/programming/agile_workspace/ExplorerCat/src/main/antlr3/net/explorercat/cql/parser/CQL.g:388:4: ( NOT )? int alt25=2; int LA25_0 = input.LA(1); if ( (LA25_0==NOT) ) { alt25=1; } switch (alt25) { case 1 : // /home/chinaski/programming/agile_workspace/ExplorerCat/src/main/antlr3/net/explorercat/cql/parser/CQL.g:388:5: NOT { NOT93=(Token)match(input,NOT,FOLLOW_NOT_in_notExpression1816); NOT93_tree = (Object)adaptor.create(NOT93); root_0 = (Object)adaptor.becomeRoot(NOT93_tree, root_0); } break; } pushFollow(FOLLOW_arithmeticExpression_in_notExpression1821); arithmeticExpression94=arithmeticExpression(); state._fsp--; adaptor.addChild(root_0, arithmeticExpression94.getTree()); } retval.stop = input.LT(-1); retval.tree = (Object)adaptor.rulePostProcessing(root_0); adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop); errorMessageStack.pop(); } catch(RecognitionException re) { reportError(re); throw re; } finally { } return retval; }
[ "private Node parseNot() {\n\t\tNode child = null;\n\t\t\n\t\tif (tokenIsType(TokenType.OPERATOR) && \"not\".equals(getTokenValue())) {\n\t\t\tgetNextToken();\n\t\t\t\n\t\t\tchild = parseNot();\n\t\t\t\n\t\t\treturn new UnaryOperatorNode(\n\t\t\t\t\t\"not\", \n\t\t\t\t\tchild, \n\t\t\t\t\tbool -> !bool\n\t\t\t);\n\...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
insert new item to item_in_catalog table and create item id by max value in the table
public static void insertNewItemInCatalog(Msg msg1, Connection conn, ConnectionToClient client) { Msg msg = (Msg) msg1; Item_In_Catalog tmp = (Item_In_Catalog) msg1.newO; PreparedStatement ps,ps1; ResultSet rs,rs1; int new_id; try { /* get the last ID of sale */ ps = conn.prepareStatement("SELECT max(ID) FROM item_in_catalog;"); rs = ps.executeQuery(); rs.next(); /* execute the insert query */ ps = conn.prepareStatement("INSERT INTO item_in_catalog (ID, Name, Price, Description, Status)" + " VALUES (?, ?, ?, ?, ?)"); new_id = Integer.parseInt(rs.getString(1)) + 1; ps.setString(1, "" + new_id); // insert the last id + 1 ps.setString(2, tmp.getName()); ps.setString(3, ""+tmp.getPrice()); ps.setString(4, tmp.getDescription()); ps.setString(5, "Active"); ps.executeUpdate(); tmp.setID(""+new_id); tmp.getImage().setFileName(tmp.getID()+".jpg"); CreateImage(tmp.getImage()); System.out.println(tmp.getImage()); msg.newO = tmp; ps=conn.prepareStatement("SELECT * FROM store GROUP BY ID"); rs=ps.executeQuery(); while(rs.next()) { ps1 = conn.prepareStatement("INSERT INTO store (ID, Location, Open_Hours, Manager_ID, Item_ID, Type, Amount)" + " VALUES (?, ?, ?, ?, ?,'Catalog',0)"); ps1.setString(1, rs.getString(1)); ps1.setString(2, rs.getString(2)); ps1.setString(3, rs.getString(3)); ps1.setString(4, rs.getString(4)); ps1.setString(5, tmp.getID()); ps1.executeUpdate(); } client.sendToClient(msg); } catch (SQLException e) { e.printStackTrace(); } catch (IOException e) { e.printStackTrace(); } }
[ "private void updateCatalogId() throws TranslationException\n {\n\tString sql = \"SELECT MAX(id) FROM \" + PropertyLookup.getCatalogsTableName();\n\ttry\n\t{\n\t sqlConnector.closeConnection();\n\t ResultSet result = sqlConnector.executeQuery(sql);\n\n\t // We assume the last id added is the id of our c...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
This function is used to select login certificates in PRODVIP environment after BN menu navigation
public static void selectCertAfterMenuNavigation(){ try { try{ Alert alert = driver.switchTo().alert(); alert.accept(); //Added the below code to select the certificate pop-up displayed after the menu navigation LPLCoreDriver.selectCertificate(); }catch(Exception ex){ LPLCoreDriver.selectCertificate(); }finally{ //driver.switchTo().window(parentWindowHandle); driver.switchTo().defaultContent(); } } catch (Exception e) { System.out.println("Certificate Not found"); } }
[ "public static void selectCertificate(){\r\n\t\ttry{\r\n\t\t\t/** \r\n\t\t\t * \tHandle Login Certificates in PRODVIP Environment for BranchNet Application \t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\r\n\t\t\t */\r\n\t\t\tif((ocfg.getEnvironment().toUpperCase().contains(\"PROD\") || ocfg.getEnvironment().toUpperCa...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Get one transportMethod by id.
@Override @Transactional(readOnly = true) public Optional<TransportMethod> findOne(UUID id) { log.debug("Request to get TransportMethod : {}", id); return transportMethodRepository.findById(id); }
[ "@GetMapping(\"/transport-methods/{id}\")\n @Timed\n public ResponseEntity<TransportMethod> getTransportMethod(@PathVariable UUID id) {\n log.debug(\"REST request to get TransportMethod : {}\", id);\n Optional<TransportMethod> transportMethod = transportMethodService.findOne(id);\n return...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Return the number of samples that should be used for FSAA. If the number is 0, don't use FSAA. The default value is 0.
public int getNumAASamples() { return fsaaSamples; }
[ "public static int size_sampleCnt() {\n return (32 / 8);\n }", "public int getNumberOfSamples()\r\n\t{\r\n\t\treturn this.samples.length / (this.format.getNBits() / 8);\r\n\t}", "public @UInt32 int getSampleSize();", "public int nSamples(){\n return _nSamples;\n }", "int getNumberOfAvera...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Calculate the dimension value to power of 2.
private int dimPowerOfTwo(int dim) { if (dim <= 4) { return 4; } else if (dim <= 8) { return 8; } else if (dim <= 16) { return 16; } else if (dim <= 32) { return 32; } else if (dim <= 64) { return 64; } else if (dim <= 128) { return 128; } else if (dim <= 256) { return 256; } else if (dim <= 512) { return 512; } else if (dim <= 1024) { return 1024; } else if (dim <= 2048) { return 2048; } else if (dim <= 4096) { return 4096; } else if (dim <= 8192) { return 8192; } else if (dim <= 16384) { return 16384; } else if (dim <= 32768) { return 32768; } else { return 65536; } }
[ "public static int dimPowerOfTwo(final int dim) {\r\n\r\n // 128^3 x 4 is 8MB\r\n // 256^3 x 4 is 64MB\r\n if (dim <= 16) {\r\n return 16;\r\n } else if (dim <= 32) {\r\n return 32;\r\n } else if (dim <= 64) {\r\n\r\n if (dim > 40) {\r\n ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Get Maximum storage space Note: This field may return null, indicating that no valid values can be obtained.
public Long getStorageLimit() { return this.StorageLimit; }
[ "public Long getMaxStorageSize() {\n return this.MaxStorageSize;\n }", "public Integer getMaxspace() {\r\n return maxspace;\r\n }", "public int getStorageCapacity() {\n if(getBuilding(\"storage\") == -1) {\n //no information use fallback\n return Integer.MAX_VALU...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Generates QueryOrderByConfig list from the given Siddhi OrderByAttribute list.
private List<QueryOrderByConfig> generateOrderBy(List<OrderByAttribute> orderByAttributeList) { List<QueryOrderByConfig> orderBy = new ArrayList<>(); for (OrderByAttribute orderByAttribute : orderByAttributeList) { String value = ""; if (orderByAttribute.getVariable().getStreamId() != null) { value = orderByAttribute.getVariable().getStreamId() + "."; } value += orderByAttribute.getVariable() .getAttributeName(); orderBy.add(new QueryOrderByConfig( value, orderByAttribute.getOrder().name())); } return orderBy; }
[ "public static void setOrderBy (String columnList){\n fetchAllOrderBy=columnList;\n }", "protected void generateOrderBy( SQLQueryModel query, LogicalModel model, List<Order> orderBy,\n DatabaseMeta databaseMeta, String locale, Map<LogicalTable, String> tableAliases, Map<String, String> columnsMap,\...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Sets the widget's name.
@Override public void setName(String name) { listBox.setName(name); }
[ "public void setName(String name) {\n this.name = name;\n this.box.getElement().setAttribute(\"name\", name);\n }", "public void setName(String name) {\n\t\tmVH.tvResourceName.setText(name);\n\t}", "public void setName(String name) {\n NAME = name;\n }", "public String getName() {\n...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Called by a com.n157239.Panel to select a particular com.n157239.Grid to play.
@Override public void onSelection(int gridSelected) { mainGrid = grids.get(gridSelected); drawStuff(); }
[ "private void setGridOnCollectibleSelected() {\n showCardInfo(getNameFromID(selectedCollectibleID));\n setGridColor(Color.GOLD);\n for (int row = 0; row < Map.NUMBER_OF_ROWS; row++) {\n for (int column = 0; column < Map.NUMBER_OF_COLUMNS; column++) {\n ImageView intera...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
This method will create string representation for Table using QueryTableColum object. It will also append the alias based on the input boolean
public String createTableRepresentationQueryTableColumn (QueryTable queryTable, boolean appendAlias);
[ "public String createColumRepresentationQueryTableColumn (QueryTableColumn queryTableColumn);", "default String buildTableSql(String tableName, String tableAlias) {\r\n String result = wrapName(convertTableOrColumnName(tableName));\r\n if (LangUtils.isNotEmpty(tableAlias)) {\r\n result = ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
The unique heap id that corresponds to this model's slot storage.
UUID getHeapId(final Model model);
[ "public int getSlotId()\n {\n return sharedBindingInfo.getSlotId();\n }", "public Integer getStorageId() {\n return storageId;\n }", "public String getSizeId() {\n return (String)getAttributeInternal(SIZEID);\n }", "public Long getStorageId() {\n return storageId;\n ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Returns the hp string for the given actionable in the format currentHP/maxHP
private String getHPString(Actionable clicked){ double currentHP = clicked.getHitPoints(); double maxHP = clicked.getParameters().get("MaxHP"); return (new DecimalFormat("#.##").format(currentHP)) //format current HP +'/'+ //put the slash (int)maxHP; //format maxHP; }
[ "public String toString(){\n\t return name + \"\\n\" + \"HP: \" + hp + \"/\" + maxHP;\n\t }", "public String showHealthBar(String target) {\n if (target == \"player\") {\n return \"(\" + playerShipHealth + \"/\" + playerShipHealthMax + \")\";\n } else if (target == \"enemy\") {\n ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Decode single QR code that has had sequence information inserted into its payload.
@Test public void testDecodeQrWithSequenceInfo() { // Screenshot of QR code received from transmitter String filename = "fooScreenshot_withReservedBits.png"; String expectedText = "foo"; // Decode the image Result result = decodeAndCheckValidQR(filename); PartialMessage m = PartialMessage.createFromResult(result, Integer.MAX_VALUE); // Expect payload to match 'expectedText' and only one QR code in sequence assertNotNull("Expected QR code to be formatted for QRLib", m); assertEquals("Should only have 1 chunk" , 1, m.getTotalChunks()); assertEquals("Unexpected chunkId" , 1, m.getChunkId()); String actualText = new String (m.getPayload(), Charsets.ISO_8859_1); assertEquals("Expect decoded result to match expected", expectedText, actualText); }
[ "@Test\n public void testDecodeQrWithNoSequenceInfo() {\n // Decode qr code received from transmitter as screenshot\n String filename = \"fooScreenshot_noReservedBits.png\";\n String expectedText = \"foo\";\n\n BufferedImage b = getImageResourceAndCheckNotNull(filename);\n LuminanceSource lumSrc =...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
//GENEND:|163getter|2| //GENBEGIN:|165getter|0|165preInit Returns an initiliazed instance of cmdGrafPagtosVoltar component.
public Command getCmdGrafPagtosVoltar() { if (cmdGrafPagtosVoltar == null) {//GEN-END:|165-getter|0|165-preInit // write pre-init user code here cmdGrafPagtosVoltar = new Command("Voltar", Command.BACK, 0);//GEN-LINE:|165-getter|1|165-postInit // write post-init user code here }//GEN-BEGIN:|165-getter|2| return cmdGrafPagtosVoltar; }
[ "public Command getCmdFormVoltar() {\n if (cmdFormVoltar == null) {//GEN-END:|48-getter|0|48-preInit\n // write pre-init user code here\n cmdFormVoltar = new Command(\"Voltar\", Command.BACK, 0);//GEN-LINE:|48-getter|1|48-postInit\n // write post-init user code here\n ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Determine if the given primary type and mixin types satisfies the node type requirements of an event.
boolean matchesType( Name primaryType, Set<Name> mixinTypes );
[ "boolean isNodeType(InternalQName testTypeName, InternalQName primaryType);", "protected abstract boolean hasElementsToCheckWithType();", "boolean handlesEventsOfType(RuleEventType type);", "public boolean isParameterTypesMatched(Object event) {\n return parameterTypes != null\n ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Load the specified Lua script into the script cache. Scripting
public Reply script_load(Object script0) throws RedisException { if (version < SCRIPT_LOAD_VERSION) throw new RedisException("Server does not support SCRIPT_LOAD"); return (Reply) execute(SCRIPT_LOAD, new Command(SCRIPT_LOAD_BYTES, SCRIPT_LOAD2_BYTES, script0)); }
[ "public ListenableFuture<Reply> script_load(Object script0) throws RedisException {\n if (version < SCRIPT_LOAD_VERSION) throw new RedisException(\"Server does not support SCRIPT_LOAD\");\n return (ListenableFuture<Reply>) pipeline(SCRIPT_LOAD, new Command(SCRIPT_LOAD_BYTES, SCRIPT_LOAD2_BYTES, script0));\n ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Get the access patterns for the specified group
Collection getAccessPatternsInGroup(Object groupID) throws Exception;
[ "public static List getAccessPatternElementsInGroups(final QueryMetadataInterface metadata, Collection groups, boolean flatten) throws MetaMatrixComponentException, QueryMetadataException {\n \t\tList accessPatterns = null;\n \t\tIterator i = groups.iterator();\n \t\twhile (i.hasNext()){\n \t\t \n \t\t GroupS...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Create translation matrix. The matrix's dimensions will be the same as the vector's dimensions plus one, on both sides.
public static Matrix translate(Vector vector) { int size = vector.dimensions() + 1; double[] data = identityData(size); IntStream.range(0, size - 1) .map(i -> (i + 1) * size - 1) .forEach(i -> data[i] = vector.get(i / size)); data[size * size - 1] = 1.0; return new Matrix(size, size, data); }
[ "public static final CoordMatrix TranslationMatrix(Coords v) {\n\n\t\tint n = v.getLength();\n\t\tCoordMatrix m = new CoordMatrix(n + 1, n + 1);\n\n\t\tfor (int i = 1; i <= n; i++) {\n\t\t\tm.set(i, i, 1.0);\n\t\t\tm.set(i, n + 1, v.get(i));\n\t\t}\n\t\tm.set(n + 1, n + 1, 1.0);\n\n\t\treturn m;\n\n\t}", "public ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
$ANTLR end "rule__XTypeLiteral__TypeAssignment_3" $ANTLR start "rule__XTypeLiteral__ArrayDimensionsAssignment_4" InternalDroneScript.g:19056:1: rule__XTypeLiteral__ArrayDimensionsAssignment_4 : ( ruleArrayBrackets ) ;
public final void rule__XTypeLiteral__ArrayDimensionsAssignment_4() throws RecognitionException { int stackSize = keepStackSize(); try { // InternalDroneScript.g:19060:1: ( ( ruleArrayBrackets ) ) // InternalDroneScript.g:19061:2: ( ruleArrayBrackets ) { // InternalDroneScript.g:19061:2: ( ruleArrayBrackets ) // InternalDroneScript.g:19062:3: ruleArrayBrackets { if ( state.backtracking==0 ) { before(grammarAccess.getXTypeLiteralAccess().getArrayDimensionsArrayBracketsParserRuleCall_4_0()); } pushFollow(FOLLOW_2); ruleArrayBrackets(); state._fsp--; if (state.failed) return ; if ( state.backtracking==0 ) { after(grammarAccess.getXTypeLiteralAccess().getArrayDimensionsArrayBracketsParserRuleCall_4_0()); } } } } catch (RecognitionException re) { reportError(re); recover(input,re); } finally { restoreStackSize(stackSize); } return ; }
[ "public final void rule__XTypeLiteral__ArrayDimensionsAssignment_4() throws RecognitionException {\n\n \t\tint stackSize = keepStackSize();\n \n try {\n // ../org.xtext.guicemodules.ui/src-gen/org/xtext/guicemodules/ui/contentassist/antlr/internal/InternalGuiceModules.g:18609:1: ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
/ If the opponent loses, we assume that his attack will change, we calculate what more possibilities would have to win or draw and we raise the probability by a 10%
static void prob() { if (Main.result == true) { if (Main.lastTwo[Main.i - 1] == 0) { // If he changes to scissors, we draw, but if he changes to paper, we won Main.scissors += 0.10; } else if (Main.lastTwo[Main.i - 1] == 1) { // If he changes to rock, we draw, but if he changes to scissors, we won Main.rock += 0.10; } else if (Main.lastTwo[Main.i - 1] == 2) { // If he changes to paper, we draw, but if he changes to rock, we won Main.paper += 0.10; } } else { /* * If he won we assume that he will continue with the same thing so we increase * the percentage to what is best */ if (Main.lastTwo[Main.i - 1] == 0) { Main.paper += 0.10; } else if (Main.lastTwo[Main.i - 1] == 1) { Main.scissors += 0.10; } else if (Main.lastTwo[Main.i - 1] == 2) { Main.rock += 0.10; } } /* * If in the last two rounds the opponent's shots were the same, we assume that * it will change and we increase the probability to what would have the maximum * chance of a draw or victory. And as it is more normal instead of increasing * 10% we increase 15% */ if (Main.lastTwo[0] == Main.lastTwo[1]) { if (Main.lastTwo[0] == 0) { /* * If the last two rounds he was going with rock, what is more likely to win or * tie is scissors */ Main.scissors += 0.15; } else if (Main.lastTwo[0] == 1) { /* * If the last two rounds he was going with paper, what is more * likely to win or tie is rock */ Main.rock += 0.15; } else if (Main.lastTwo[0] == 2) { /* * If the last two rounds he was going with scissors, what is more likely to win or * tie is paper */ Main.paper += 0.15; } } }
[ "private void adjustStrategy(String playerMove) {\n Move pMove = decider.convertMove(playerMove);\n switch (pMove) {\n case ROCK: {\n switch (decider.playerWins(pMove, aiPreviousMove)) {\n //Player loses by selecting rock\n case -1: {\n ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Converts the context meta information into a humanreadable tooltip (e.g. for display in a table or list).
public String tooltip() { if (contextURI==null) return "(no context specified)"; if (contextURI.equals(Vocabulary.SYSTEM_CONTEXT.METACONTEXT)) return "MetaContext (stores data about contexts)"; if(contextURI.equals(Vocabulary.SYSTEM_CONTEXT.VOIDCONTEXT)) return "VoID Context (stores statistics about contexts)"; if (type!=null && timestamp!=null) { GregorianCalendar c = new GregorianCalendar(); c.setTimeInMillis(timestamp); String date = ReadWriteDataManagerImpl.dateToISOliteral(c.getTime()); if (!StringUtil.isNullOrEmpty(date)) date = ValueResolver.resolveSysDate(date); String ret = "Created by " + type; if (type.equals(ContextType.USER)) ret += " '" + source.getLocalName() + "'"; else { String displaySource = null; if(source!=null) { displaySource = EndpointImpl.api().getNamespaceService().getAbbreviatedURI(source); if (StringUtil.isNullOrEmpty(displaySource)) displaySource = source.stringValue(); // fallback solution: full URI } String displayGroup = null; if (group!=null) { displayGroup = EndpointImpl.api().getNamespaceService().getAbbreviatedURI(group); if (StringUtil.isNullOrEmpty(displayGroup)) displayGroup = group.stringValue(); // fallback solution: full URI } ret += " ("; ret += source==null ? "" : "source='" + displaySource + "'"; ret += source!=null && group!=null ? "/" : ""; ret += group==null ? "" : "group='" + displayGroup + "'"; ret += ")"; } ret += " on " + date; if (label!=null) ret += " (" + label.toString() + ")"; if (state!=null && !state.equals(ContextState.PUBLISHED)) ret += " (" + state + ")"; return ret; } else return contextURI.stringValue(); }
[ "java.lang.String getTooltip();", "String getTooltip();", "@DISPID(1610874917) //= 0x60040025. The runtime will prefer the VTID if present\r\n @VTID(67)\r\n java.lang.String getTooltipText();", "@VTID(145)\r\n boolean getDisplayContextTooltips();", "protected String getToolTip( MouseEvent event )\n {\...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Sets the value of the "newerthantid" attribute. The value indicates the highest thread number of messages to return, where higher numbers are more recent email threads. The server will return only threads newer than that specified by this attribute. If using this attribute, you should also use newerthantime for best results. When querying for the first time, you should omit this value.
public void setNewerThanTid(long newerThanTid) { this.newerThanTid = newerThanTid; }
[ "public long getNewerThanTid()\n\t{\n\t\treturn this.newerThanTid;\n\t}", "public void setNewerThanTime(long newerThanTime)\n\t{\n\t\tthis.newerThanTime = newerThanTime;\n\t}", "public long getNewerThanTime()\n\t{\n\t\treturn this.newerThanTime;\n\t}", "public void setWaiting_thread_id(Long waiting_thread_id)...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Tests construction with an empty Map (should throw an Exception).
@Test(expected = IllegalArgumentException.class) public void testConstructionWithEmptyMap() { new HashMapper(new HashMap<Object, Object>(), DEFAULT_VALUE); }
[ "@Test(expected = IllegalArgumentException.class)\n\tpublic void testChainedConstructionWithEmptyMap() {\n\t\tnew HashMapper(new HashMap<Object, Object>(), DEFAULT_VALUE, new IdentityTransform());\n\t}", "@Test(expected = NullPointerException.class)\n\tpublic void testConstructionWithNullMap() {\n\t\tnew HashMapp...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
void AcceptChannel_set_funding_pubkey(struct LDKAcceptChannel NONNULL_PTR this_ptr, struct LDKPublicKey val);
public static native void AcceptChannel_set_funding_pubkey(long this_ptr, byte[] val);
[ "public static native void OpenChannel_set_funding_pubkey(long this_ptr, byte[] val);", "public static native void ChannelPublicKeys_set_funding_pubkey(long this_ptr, byte[] val);", "public static native byte[] AcceptChannel_get_funding_pubkey(long this_ptr);", "public static native void UnsignedChannelAnnoun...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
$ANTLR end "ruleAddress_Impl" $ANTLR start "entryRuleLanguage" ../org.xtext.example.mydsl.extensions.ui/srcgen/org/xtext/example/mydsl/extensions/ui/contentassist/antlr/internal/InternalMyDsl.g:172:1: entryRuleLanguage : ruleLanguage EOF ;
public final void entryRuleLanguage() throws RecognitionException { try { // ../org.xtext.example.mydsl.extensions.ui/src-gen/org/xtext/example/mydsl/extensions/ui/contentassist/antlr/internal/InternalMyDsl.g:173:1: ( ruleLanguage EOF ) // ../org.xtext.example.mydsl.extensions.ui/src-gen/org/xtext/example/mydsl/extensions/ui/contentassist/antlr/internal/InternalMyDsl.g:174:1: ruleLanguage EOF { before(grammarAccess.getLanguageRule()); pushFollow(FollowSets000.FOLLOW_ruleLanguage_in_entryRuleLanguage301); ruleLanguage(); state._fsp--; after(grammarAccess.getLanguageRule()); match(input,EOF,FollowSets000.FOLLOW_EOF_in_entryRuleLanguage308); } } catch (RecognitionException re) { reportError(re); recover(input,re); } finally { } return ; }
[ "public final void entryRuleAddress() throws RecognitionException {\n try {\n // ../org.xtext.example.mydsl.extensions.ui/src-gen/org/xtext/example/mydsl/extensions/ui/contentassist/antlr/internal/InternalMyDsl.g:89:1: ( ruleAddress EOF )\n // ../org.xtext.example.mydsl.extensions.ui/sr...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Returns the CPU time in nanoseconds. CPU time is user time plus system time. It's the total time spent using a CPU for your application
private long getCpuTime() { ThreadMXBean bean = ManagementFactory.getThreadMXBean(); return bean.isCurrentThreadCpuTimeSupported() ? bean.getCurrentThreadCpuTime() : 0L; }
[ "public long getCpuTime() {\n return cpuTimer.getTime();\n }", "public long getCpuTime() {\n\t\t\t// Return time in milliseconds, not in nanoseconds\n\t\t\t\n\t\t\treturn (cpuLocalTimerFinish - cpuLocalTimerStart) / 1000000;\n\t\t}", "public double getCpuTimeSec() {\n\treturn getCpuTime() / Math.pow(1...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Tests the region endpoint with the gender filter
@Test public void testReceiverDonorEndpointGender() { ResponseEntity response = dataController.getDonorDataRegion("M", null, null); assertNotNull(response.getBody()); assertEquals(HttpStatus.OK, response.getStatusCode()); }
[ "@Test\n public void testReceiverGenderEndpointRegionFilterReturns() {\n ResponseEntity response = dataController.getReceiverDataGender(\"Canterbury\", null, null);\n assertNotNull(response.getBody());\n assertEquals(HttpStatus.OK, response.getStatusCode());\n }", "@Test\n public void testDonorGender...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Put a random integer between from..to into each cell of the vector. Put with probability , with probability ,...
public static void randomInteger(IntVector x, int from, Vector prob) { // 1. compute accumulated probabilities: DefaultVector accum = new DefaultVector(prob.size()); accum.set(0, prob.get(0)); for (int i = 1; i < prob.size(); ++i) accum.set(i, prob.get(i) + accum.get(i-1)); Vectors.print(accum); // 2. draw the numbers: int n = x.size(); for (int i = 0; i < n; ++i) { float p = (float) Math.random(); int idx = 0; while (idx < prob.size() && p > accum.get(idx)) ++idx; x.set(i, idx + from); } }
[ "public abstract void initiateRandomCells(double probabilityForEachCell);", "public static void randomInteger(IntVector x, int from, int to) {\n\t\tint n = x.size();\n\t\tfor (int i = 0; i < n; ++i)\n\t\t\tx.set(i, (int) Math.floor(Math.random() * (to-from) + from));\n\t}", "public List<Vec> sample(int count, R...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Main command line jarfileName lowVersion highVersion e.g. myjar.jar 1.0 1.8
public static void main( String[] args ) { try { if ( args.length != 3 ) { err.println( "usage: java -ea -jar jarcheck.jar jarFileName.jar 1.1 1.7" ); System.exit( 2 ); } String jarFilename = args[ 0 ]; int low = convertHumanToMachine.get( args[ 1 ] ); int high = convertHumanToMachine.get( args[ 2 ] ); boolean success = checkJar( jarFilename, low, high ); if ( !success ) { err.println("JarCheck failed for " + jarFilename+". See error messages above."); System.exit( 1 ); } } catch ( NullPointerException e ) { err.println( "usage: java -ea -jar jarcheck.jar jarFileName.jar 1.1 1.8" ); System.exit( 2 ); } }
[ "private static boolean checkJar( String jarFilename, int low, int high )\n {\n out.println( \"\\nChecking jar \" + jarFilename );\n boolean success = true;\n FileInputStream fis;\n ZipInputStream zip = null;\n try\n {\n try\n {\n fis...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Constructs a new AffinityTimeRange with a given value
private AffinityTimeRange(String value) { this.value = value; }
[ "RangeValue createRangeValue();", "ValueRange createValueRange();", "public void setTimeRange(TimeRange value) {\n timeRange = value;\n }", "ValueRangeConstraint createValueRangeConstraint();", "public TimeRange(long from, long to) {\n if (from <= to) {\n this.from = from;\n ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Get the CREATE player Object.
public Common.Object getCreateObject(Player player, boolean isControllable) { Common.Object.Builder builder = Common.Object.newBuilder(); builder.setId(player.getId().toString()); builder.setName(player.getName()); Common.SystemObject.Builder graphicSystemObject = builder.addSystemObjectsBuilder(); graphicSystemObject.setSystemType(Common.SystemType.Graphic); graphicSystemObject.setType(MESH); graphicSystemObject.addProperties(player.getMeshProperty().build()); if (isControllable) { Common.SystemObject.Builder inputSystemObject = builder.addSystemObjectsBuilder(); inputSystemObject.setSystemType(Common.SystemType.Input); inputSystemObject.setType(PLAYER); } Common.SystemObject.Builder networkSystemObject = builder.addSystemObjectsBuilder(); networkSystemObject.setSystemType(Common.SystemType.Network); networkSystemObject.setType(isControllable ? PLAYER : UPDATABLE); Common.SystemObject.Builder physicSystemObject = builder.addSystemObjectsBuilder(); physicSystemObject.setSystemType(Common.SystemType.Physic); physicSystemObject.setType(MOVABLE); physicSystemObject.addProperties(player.getPositionProperty().build()); physicSystemObject.addProperties(player.getOrientationProperty().build()); physicSystemObject.addProperties(player.getVelocityProperty().build()); return builder.build(); }
[ "public long getCreatePlayerId() {\n return createPlayerId_;\n }", "Player createPlayer();", "public static GameObject createPlayer() {\n return new GameObject(new PlayerInputComponent(),\n new ObjectPhysicComponent(),\n new ObjectGraphicComponent(),\n \"player\");\n }", "...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Triggers the insert attached image wizard. Sets the content of the editor (rich text area).
public AttachedImageSelectPane insertAttachedImage() { editor.getMenuBar().clickImageMenu(); return editor.getMenuBar().clickInsertAttachedImageMenu(); }
[ "public void image()\n {\n ImageConfig imageConfig;\n String imageJSON = getTextArea().getCommandManager().getStringValue(Command.INSERT_IMAGE);\n if (imageJSON != null) {\n imageConfig = imageConfigJSONParser.parse(imageJSON);\n } else {\n imageConfig = new Imag...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Gets the status of the service
public Status getServiceStatus() { if (service.getStatus() != null) { if (service.getStatus().equals(Status.ERROR)) { return Status.ERROR; } } return super.getServiceStatus(); }
[ "public ServiceStatus getStatus();", "public StatusService getStatusService() {\r\n return this.statusService;\r\n }", "public ServiceStatus getServiceStatus(final ExasolService service) {\n return this.serviceStatuses.get(service);\n }", "public final ServiceStatusType getServiceStatus(...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Sets an array of URLs property. If null or size null removes previous preference.
public void setURLs(String mkey, URL[] values) { int j = 0; if (values != null) for (URL value : values) { if (value != null) { setURL(mkey + j, value); j++; } } // erase other elements String last; while (true) { last = getString(mkey + j); if (last == null) break; setString(mkey + j, null); j++; } }
[ "public void setUrl(String[] newValue) {\n this.url.setValue(newValue.length, newValue );\n }", "public final void setSeedUrls(URL[] urls){\n\t\tseedUrls.clear();\n\t\taddSeedUrls(urls);\n\t}", "protected void internalSetUris(String[] uris) {\n m_uris = uris;\n m_prefixes = new String[ur...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Creates an effect result that is triggered when a card is stacked from table.
public StackedFromTableResult(Action action, String performingPlayerId, PhysicalCard card, PhysicalCard stackedOn) { super(Type.STACKED_FROM_TABLE, performingPlayerId); _card = card; _stackedOn = stackedOn; }
[ "public StackedFromTableResult(Action action, PhysicalCard card, PhysicalCard stackedOn) {\n this(action, action.getPerformingPlayer(), card, stackedOn);\n }", "public void executeEffect() {\n\t\texecuteEffect(myCard);\n\t}", "@Override\n protected void performAc...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
acid test to mock the update sequence all the way from the update loop The loop simulates the logic in the typical GlobalSimulationObjectiveListener::simulatedNumeric implementation
@Test public void testNestedUpdates() throws Exception { // acid test to mock the update sequence all the way from the update loop // The loop simulates the logic in the typical // GlobalSimulationObjectiveListener::simulatedNumeric implementation // class Simulator { Number param = new NumberWithJitter<Integer>(10, 1, 5); public Number getParam() { return param; } public void setParam(Number targetValue) { param = new NumberWithGradient(param, targetValue, 2); } } Simulator sim = new Simulator(); for (int idx = 1; idx < 5; idx++) { Number newValue = new NumberWithJitter<Integer>(10+idx, 1, 5); sim.setParam(newValue); } NumberWithGradient nwg = (NumberWithGradient)sim.getParam(); Assert.assertTrue("Make sure there is no memory leak due to chaining", nwg.startValue instanceof NumberWithJitter); }
[ "@Test\r\n public void testUpdate() {\r\n System.out.println(\"update\");\r\n float tpf = 1f;\r\n instance.usePowerup(player);\r\n \r\n for (int i = 0; i < 5; i++) {\r\n instance.update(tpf);\r\n }\r\n System.out.println(System.currentTimeMillis());\r\n...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
This method was generated by MyBatis Generator. This method sets the value of the database column mem.MemAddress
public void setMemaddress(String memaddress) { this.memaddress = memaddress; }
[ "public void set_mem_address(int mem_address) {\n this.address = mem_address;\n }", "public void setMAddr(String mAddr) throws IllegalArgumentException, \n SipParseException {\n LogWriter.logMessage(LogWriter.TRACE_DEBUG,\"setMaddr () \" + mAddr);\n Via via=(Via)sipHeader;\n ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Gets personal shared plans for user.
List<PersonalProgramDTO> getPersonalSharedPlansForUser(Long userId);
[ "List<PersonalProgramDTO> getPlansSharedWithUser(Long userId);", "List<PersonalProgramDTO> getPlansForUser(Long userId);", "public List<Plan> getPlansByUser(Integer userId) {\n return plansRepository.findPlansByUserId(userId);\n }", "List<PersonalProgramDTO> getArchivedPlansForUser(Long userId);", ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Gets the failed login attempts.
public int getFailedLoginAttempts() { return failedLoginAttempts; }
[ "public long getFailedLoginAttempts() {\n return FxContext.getUserTicket().getFailedLoginAttempts();\n }", "public Integer getLoginFailTimes() {\n return loginFailTimes;\n }", "BigInteger getLoginRetries();", "public int getAttempts(){\n\t\treturn consecutiveLoginAttempts;\t\n\t}", "publ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Is called to determine the sample rates supported by the signal source
public int[] requestSupportedSampleRates();
[ "public int requestCurrentSampleRate();", "public int getSampleRate() {\n return sampleRate_;\n }", "long getSampleRate();", "public Integer getSamplingRate() {\n return samplingRate;\n }", "public Rational getAudioSampleRate();", "public int getSamplingRate() {\n return samplingRate;\n ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
optional string acting_date = 21;
java.lang.String getActingDate();
[ "public Builder setActingDate(\n java.lang.String value) {\n if (value == null) {\n throw new NullPointerException();\n }\n bitField0_ |= 0x00100000;\n actingDate_ = value;\n onChanged();\n return this;\n }", "java.lang.String getArrivedondate();", "java.lang.Strin...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Returns the Y data.
public DoubleData getY() { return y; }
[ "public double[] getYPoints() {\n return yData;\n }", "public double[] getYArray()\n {\n return ya;\n }", "double[] getY();", "public Object[] getYValues() {\n return yValues;\n }", "public double getY() {\n return Y;\n }", "public double getY() {\n return Y;...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
This method was generated by MyBatis Generator. This method returns the value of the database column t_test_param_value.PUB2
public String getPub2() { return pub2; }
[ "public java.lang.String getParam2() {\r\n return param2;\r\n }", "public java.lang.String getValue2() {\n return this.value2;\n }", "public String getCol2value() {\n return col2value;\n }", "java.lang.String getParam2();", "public java.lang.String getValor2() {\n\t\treturn _co...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Returns the object with the settings used for calls to updateAssignment.
public UnaryCallSettings<UpdateAssignmentRequest, Assignment> updateAssignmentSettings() { return ((ReservationServiceStubSettings) getStubSettings()).updateAssignmentSettings(); }
[ "public UnaryCallSettings.Builder<UpdateAssignmentRequest, Assignment>\n updateAssignmentSettings() {\n return getStubSettingsBuilder().updateAssignmentSettings();\n }", "public Assignment getAssignment() {\r\n\r\n //Grab the assignment associated with this analysis in the API\r\n if ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
load all extensions with java spi
public void loadAllExtensions() { if (!isLoaded) { synchronized (loadLock) { if (!isLoaded) { loadNamingService(); loadLoadBalance(); isLoaded = true; } } } }
[ "public void initialize(){\n Reflections reflections = ReflectionUtils.get();\n extensionPoints = reflections.getTypesAnnotatedWith(ExtensionPoint.class, true);\n log.info(\"Bootstrap registry : found \" + extensionPoints.size() + \" extension points\");\n Set<Class<?>> e...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Overrides the isKing() method to return false always since this is not a king piece
@Override public boolean isKing() { return false; }
[ "@Override\r\n public boolean isKing()\r\n {\r\n return true;\r\n }", "@Override\r\n public boolean isKing() {\r\n return true;\r\n }", "public final boolean isKing() {\n return (this == WHITE_KING) || (this == BLACK_KING);\n }", "public boolean isKing(...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
comparator, nulls lower (lastHandledUtcTs) //
public JwComparator<AcItemMovementVo> getLastHandledUtcTsComparatorNullsLower() { return LastHandledUtcTsComparatorNullsLower; }
[ "public JwComparator<AcItemMovementVo> getFirstHandledUtcTsComparatorNullsLower()\n {\n return FirstHandledUtcTsComparatorNullsLower;\n }", "public JwComparator<AcItem> getLastResultUtcTsComparatorNullsLower()\n {\n return LastResultUtcTsComparatorNullsLower;\n }", "public JwComparator...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Function to find the least common ancestor of node1 and node2 of Binary Search Tree Time complexity O(n) Space complexity O(1)
private static Node leastCommonAncestor(Node root, int node1, int node2) { if (root == null) { return null; } //Check if the nodes are available in the Binary Search Tree if (TreeUtil.isNodeAvailable(root, node1) && TreeUtil.isNodeAvailable(root, node2)) { return leastCommonAncestorUtil(root, node1, node2); } else { //return null if any of the node is missing from the Binary Search Tree return null; } }
[ "private static PhyloTreeNode findLeastCommonAncestor(PhyloTreeNode node1, PhyloTreeNode node2) {\n if(node1 == null || node2 == null) {\n return null;\n }\n else{\n String label1 = node1.getLabel();\n String label2 = node2.getLabel();\n if(label1.contains(label2) && (...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
This will figure out how much change should be given back to the customer in dollars, quarters, dimes, nickels, and pennies then tell them.
public void changeGiven() { change2 = (int)(change*100); dollars = change2/100; quarters = change2%100/25; dimes = change2%100%25/10; nickels = change2%100%25%10/5; pennies = change2%100%25%10%5/1; System.out.println("You gave me "+money.format(pay)+" and you will recieve " + dollars+" dollars, "+(quarters)+" quarters, "+dimes+" dimes, "+ nickels+" nickes, and "+pennies+" pennies."); }
[ "private void calculateChange() {\r\n\t\tif (stock > 0 && deposit >= price)\r\n\t\t\tchange = deposit - price;\r\n\t\telse\r\n\t\t\tchange = deposit;\r\n\t}", "private static void getChangeDue(int totalCents) {\n int moneyAvailable = totalCents/100;\n int quarters = (totalCents - (moneyAvailable * 1...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Gets the default sort value for this column based upon its title. The first column is sorted the others unsorted.
public synchronized ColumnSort getDefaultSort() { return f_title.equals(SUMMARY_COLUMN) ? ColumnSort.SORT_UP : ColumnSort.UNSORTED; }
[ "public java.lang.String getDefaultSort() { \n return this.defaultSort; \n }", "protected FileBrowserSortField getDefaultSortField(PortalControllerContext portalControllerContext) {\n // Window properties\n FileBrowserWindowProperties windowProperties = this.getWindowProperties(portalControll...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Initialize the close button.
private void initCloseButton() { this.closeButton.addClickHandler(new ClickHandler() { @Override public void onClick(ClickEvent event) { if (null != closeHandler) { closeHandler.closeRequested(); } } }); }
[ "public void close() {\n getCloseButton().click();\n }", "public Button getCloseButton() {\r\n\t\treturn closeButton;\r\n\t}", "public void clickClose()\n {\n click(CLOSE_BUTTON);\n }", "public Button getCloseButton() {\n\t\treturn closeButton;\n\t}", "private void setupExitButton() {...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Ask whether assertions (xsl:assert instructions) should be enabled. By default they are disabled. If assertions are enabled at compile time, then by default they will also be enabled at run time; but they can be disabled at run time by specific request
public boolean isAssertionsEnabled() { return compilerInfo.isAssertionsEnabled(); }
[ "@Test(expected = AssertionError.class)\n\tpublic void testAssertionsEnabled() {\n\t\tassert false;\n\t}", "@Test(enabled = false)\n\tpublic void HardAssert(){\n\t\t\t\t\n\t\tSystem.out.println(\"Hard Asset Step 1\");\n\t\tAssert.assertEquals(false, false);\n\t\tSystem.out.println(\"Hard Asset Step 2\");\n\t\tAs...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Initializes the Volley Wrapper library before the tests are run.
@BeforeClass public static void initVolleyWrapper() { VolleyWrapper.init(InstrumentationRegistry.getTargetContext()); Configuration configuration = new Configuration.Builder() .setBodyContentType("application/json") .setSyncTimeout(30L) .build(); VolleyWrapper.setDefaultConfiguration(configuration); }
[ "public void init(Context context) {\n this.mContext = context;\n vollyRequestManager = new VollyRequestManager(VolleyUtil.getInstance(mContext).getRequestQueue());\n }", "public void initializeVolley(Context context) {\n Log.e(LOG, \"initializing Volley Networking ...\");\n request...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Use CGameNotifications_UpdateNotificationSettings_Request.newBuilder() to construct.
private CGameNotifications_UpdateNotificationSettings_Request(com.google.protobuf.GeneratedMessageV3.Builder<?> builder) { super(builder); }
[ "private CGameNotifications_UpdateNotificationSettings_Response(com.google.protobuf.GeneratedMessageV3.Builder<?> builder) {\n super(builder);\n }", "com.bingo.server.msg.Settings.SettingsRequestOrBuilder getSettingsRequestOrBuilder();", "private CGameNotifications_UpdateSession_Request(com.google.proto...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Adds a collection of step hooks to an individual step. The collection may contain duplicates.
private WorkflowGraphBuilder addStepHooks(Class<? extends WorkflowStep> stepToHook, Collection<WorkflowStepHook> hooks) { if (!stepImpls.containsKey(stepToHook)) { throw new WorkflowGraphBuildException("Please add a step with addStep before adding hooks for it."); } if (hooks == null || hooks.isEmpty()) { throw new WorkflowGraphBuildException("Cannot add zero hooks."); } if (!stepHooks.containsKey(stepToHook)) { stepHooks.put(stepToHook, new LinkedList<>()); } stepHooks.get(stepToHook).addAll(hooks); return this; }
[ "public WorkflowGraphBuilder addHookForAllSteps(WorkflowStepHook hook) {\n validateHook(hook);\n hooksForAllSteps.add(hook);\n return this;\n }", "public void addStep(Step step)\r\r\n {\r\r\n this.stepList.add(step);\r\r\n }", "public void addToSteps(entity.LoadStep element);...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
This is a automatic generated file according to the OpenSCENARIO specification version 1.0 From OpenSCENARIO class model specification: Defines the weather conditions in terms of light, fog, precipitation and cloud states.
public interface IWeather extends IOpenScenarioModelElement { /** * From OpenSCENARIO class model specification: Definition of the cloud state, i.e. cloud state * and sky visualization settings. * * @return value of model property cloudState */ public CloudState getCloudState(); /** * From OpenSCENARIO class model specification: Definition of the sun, i.e. position and * intensity. * * @return value of model property sun */ public ISun getSun(); /** * From OpenSCENARIO class model specification: Definition of fog, i.e. visual range and bounding * box. * * @return value of model property fog */ public IFog getFog(); /** * From OpenSCENARIO class model specification: Definition of precipitation, i.e. type and * intensity. * * @return value of model property precipitation */ public IPrecipitation getPrecipitation(); }
[ "public String getWeatherConditions() {\r\n\t\treturn weather.getWeatherConditionString();\r\n\t}", "public WeatherCondition getCondition() {\n return condition;\n }", "public void setCondition(WeatherCondition condition) {\n this.condition = condition;\n }", "public void setConditions(ent...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Gets the ResourceSpecificPermissionGrant from the service
void get(final ICallback<? super ResourceSpecificPermissionGrant> callback);
[ "ResourceSpecificPermissionGrant get() throws ClientException;", "public AccessGrant getAccessGrant();", "PermissionService getPermissionService();", "public GroupPermissionType getSpecificPermission() {\r\n return specificPermission;\r\n }", "ApiFuture<Policy> getIamPolicy(String resource);", "...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }