query
stringlengths
8
1.54M
document
stringlengths
9
312k
negatives
listlengths
19
20
metadata
dict
/ update() This method makes a call to the DB to update a an existing room in the room table. Param: db statement Return:None
private void update(Statement statement) { try { statement.execute("update isaacp.room set " + "RoomNumber = '" + roomNumber + "', BuildingID = '" + buildingId + "', StudentID = '" + studentID + "', MonthlyRentRate = '" + monthlyRent + ...
[ "int Update(DbInfo obj) throws SQLException;", "public void runUpdate(String sql);", "public void updateRoom(Room room);", "public void updateDB() {\n \n sql = \"UPDATE Order set \" + \"CustomerID='\"+getCustomerID()+\"',\" + \" Status='\"+getStatus()+\"'\" + \" WHERE OrderID= '\" + getOrderID()...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Returns the modified date of this employee interview schedule.
@Override public java.util.Date getModifiedDate() { return _employeeInterviewSchedule.getModifiedDate(); }
[ "public java.util.Date getModifiedDate() {\n\t\treturn _timesheetTask.getModifiedDate();\n\t}", "@Override\n\tpublic java.util.Date getModifiedDate() {\n\t\treturn _employee.getModifiedDate();\n\t}", "@Override\n\tpublic Date getModifiedDate() {\n\t\treturn _activityCoursePlace.getModifiedDate();\n\t}", "@Ove...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Creates EventGridSubscriber with default deserializer.
@Beta public EventGridSubscriber() { this.defaultSerializerAdapter = new AzureJacksonAdapter(); this.eventTypeToEventDataMapping = new HashMap<>(); }
[ "Subscriber create(Subscriber subscriber);", "public EventoConverter() {\n }", "public MessageToServerDeserializer() {\n gsonBuilder = new GsonBuilder().registerTypeAdapter(MessageToServer.class,this);\n customGson = gsonBuilder.create();\n }", "Events<T> create();", "EventsSnapshotManag...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Creates temp posting file
private BufferedWriter fnCreateTempPostingFile() throws IOException { this.iNumOfPostingFiles++; String sPostingFilePath = sPath + "\\" + this.iNumOfPostingFiles + ".txt"; File postingFile = new File(sPostingFilePath); if (!postingFile.exists()) { postingF...
[ "private void fnWriteToTempFile()\n {\n BufferedWriter bfWriter = null;\n try\n {\n bfWriter = fnCreateTempPostingFile();\n TreeSet<String> hashSetOfKeys = new TreeSet<>(this.hashMapTempStrings.keySet());\n for (Iterator<String> iterator = hashSetOfKe...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
query inspection personnel according to precinct
public ArrayList<InspectionPersonnel> queryInspByPrecinct(String precinct) { ArrayList<InspectionPersonnel> list = new ArrayList<InspectionPersonnel>(); if (DBConnection.conn == null) { DBConnection.openConn(); } try { String sql = "select * from InspectionPersonnel where precinct = ?"; ps = DBC...
[ "public ArrayList<String> queryPrecinct() {\r\n\t\tArrayList<String> list = new ArrayList<String>();\r\n\t\tif (DBConnection.conn == null) {\r\n\t\t\tDBConnection.openConn();\r\n\t\t}\r\n\t\ttry {\r\n\t\t\tString sql = \"select distinct precinct from InspectionPersonnel\";\r\n\t\t\tps = DBConnection.conn.prepareSta...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Update the value of unused funds.
public void updateUnusedFunds(Amount change) { this.unusedFunds = this.unusedFunds.incrementSavedAmount(change); }
[ "public void setUnusedFunds(SavedAmount amount) {\n this.unusedFunds = amount;\n }", "public void setFund(double value) {\r\n this.fund = value;\r\n }", "public void updateMonthlyFee() {\n balance -= monthlyFee;\n checkAllowed();\n }", "void clearFunds() {\n\t\tbalance += cheq...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
clears the current graph and inserts nodes and connections, which depict the vertices and edges from the arena given.
public final void populateGraphWithArena(final Arena arena) { for (final GraphNode node : vertexCorrespondence.values()) { node.dispose(); } vertexCorrespondence.clear(); for (final GraphConnection connection : edgeCorrespondence.values()) { connection.dispo...
[ "public void clear() {\n for (Node node : _graph)\n node.remove();\n _graph = new Vector<Node>();\n }", "public void flush(){\r\n\t\tfor (Node n : allNodes.values()){\r\n\t\t\tn.flush();\r\n\t\t}\r\n\t\t\r\n\t\tfor (Connection c : connections.values()){\r\n\t\t\tc.reset();\r\n\t\t}\r\n\t}", "private...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Adds a entry to the prefab matrix, that represents a block
public MultiblockPrefabMatrix add(BlockPos pos, Supplier<Block> block, boolean doubleBlock) { if (this.entries.containsKey(pos)) this.entries.replace(pos, new MatrixEntry(pos, block, doubleBlock)); else this.entries.put(pos, new MatrixEntry(pos, block, doubleBlock)); retu...
[ "public void addBlock(int row, int col, Block block, GameplayState gps) {\n if (row < 4) {\n gps.setGameIsLost(true);\n }\n\n cells[row][col] = block;\n }", "public void addRow() {\n this.rowPointer++;\n this.maze.add(rowPointer, new ArrayList<>());\n this.c...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Sets the value of the 'field985' field
public com.maxpoint.cascading.avro.TestExtraLarge.Builder setField985(java.lang.CharSequence value) { validate(fields()[985], value); this.field985 = value; fieldSetFlags()[985] = true; return this; }
[ "public void setField985(java.lang.CharSequence value) {\n this.field985 = value;\n }", "public void setField987(java.lang.CharSequence value) {\n this.field987 = value;\n }", "public void setField989(java.lang.CharSequence value) {\n this.field989 = value;\n }", "public void setField983(java.lang...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Set/change the movie of this node.
public void setMovie(Movie newMovie){ this.setMovie(newMovie, null); }
[ "public void setMovie(String newMovie)\n {\n movie = newMovie;\n }", "public void setMovie(BoxOfficeMovie pMovie) {\n this.movie = pMovie;\n }", "public void setVersion(MovieVersion movieVersion) { \n this.version = movieVersion; \n }", "private void setMovieToViews(Movie movi...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Same as addLike(..) but with checking clients wildcard preferences for String searches. If default constructor is used, this method acts exactly like the normal addLike(..) method.
QueryElement addLikeWithWildcardSetting(String property, String value);
[ "Like createLike();", "public void addLike() {\n // TODO implement here\n }", "LikeOperand createLikeOperand();", "private String createLikeSQLValue(String value)\n\t{\n\t\tString updValue = stripWildcardChars(value);\n\t\tupdValue += PERCENT_WILDCARD;\n\t\t\t\t\n\t\treturn updValue;\n\t}", "publi...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
This method was generated by MyBatis Generator. This method returns the value of the database column TBL_URI01_HEAD.C_Sale_Kb
public String getcSaleKb() { return cSaleKb; }
[ "public String getSaleKb() {\n return saleKb;\n }", "public void setcSaleKb(String cSaleKb) {\n this.cSaleKb = cSaleKb;\n }", "public void setSaleKb(String saleKb) {\n this.saleKb = saleKb;\n }", "public Long getSaleBident() {\n\t return saleBident;\n\t }", "public String getSumShopKb() {\n ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
This method performs the action of inserting the MarbleLeft in the MarbleMatrix in order to give the player the list of Marbles which he will later insert into his depots
public List<Marble> insertMarbleInRow(int rowIndex) { List<Marble> marbleLinkedList = new LinkedList<>(); //add Marbles to be converted in a List which will be returned to Player for (int i = 0; i < ROW_SIZE; i++) { marbleLinkedList.add(0, marbleMatrix[rowIndex][i]); } ...
[ "private void setUpLeftSide() { \n add(myGameBoard);\n }", "public void addBeesToMatrix() {\r\n int i;\r\n int j;\r\n int k;\r\n for (int b = 0; b < this.numberOfBees; b++) {\r\n Bee3D bee = this.beesArray[b];\r\n i = (int) (Math.abs(Math.abs(bee....
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
/ Find all neighbours in specific document with specific positions The neighbours are terms, that are located nearby current position back and forward Push term in result if it belongs to toCompare ArrayList (these are the result ten terms surrounding email more frequent) Return LinkerHashMap . Unique Id is used for ma...
public static LinkedHashMap<String, String> getNeighboursByDocPos( Directory indexDir, Integer docId, ArrayList<Integer> pos, ArrayList<String> toCompare ) throws IOException { IndexReader ir = DirectoryReader.open(indexDir); Fields fields = MultiFields.ge...
[ "private Map<Integer, Double> runNear(Node root, List<Map<Integer, Double>> matches) {\n\t\tList<Map<Integer, InvertedListEntry>> allLists = new ArrayList<Map<Integer, InvertedListEntry>>();\n\t\tint maxDist = ((NearOperator) root.getOperator()).getDistance();\n\t\t\n\t\tfor(Node child : root.getChildren()) {\n\t\t...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Return the request number for this Request Object.
public Integer getRequestNum() { return requestNum; }
[ "public String getRequestNo() {\r\n return requestNo;\r\n }", "public static int getRequestNum(){\n return requestNum;\n }", "public int getRequestID() {\n return requestID.getValue();\n }", "public Integer getRequestID() {\n return this.requestID;\n }", "public int getRequestRef...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Gets the value of the itId property.
public long getItId() { return itId; }
[ "public int getAnItId() {\n return anItId;\n }", "public final String getIid() {\n return this.iid;\n }", "public final String getId()\n {\n return element.getId();\n }", "public String getId() {\n if (id == null)\n return \"\"; //$NON-NLS-1$\n return id;\n ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
This method was generated by MyBatis Generator. This method sets the value of the database column bp_carousel.CAROUSEL_STATUS
public void setCarouselStatus(String carouselStatus) { this.carouselStatus = carouselStatus; }
[ "public void setCatalogStatus(String catalogStatus) {\r\n this.catalogStatus = catalogStatus;\r\n }", "public void setComplaintStatus(Integer complaintStatus) {\n this.complaintStatus = complaintStatus;\n }", "public void setCscStatus(Byte cscStatus) {\n this.cscStatus = cscStatus;\n ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
/ renamed from: com.panasonic.avc.cng.view.parts.PictureJumpView$a
public interface C3959a { void onPictureJump(int i); void onSetContent(int i); }
[ "@Override public BufferedImage getImg(){\n if(jumpState >= 1){\n return jumpingImg;\n }\n else\n return super.getImg();\n}", "public Image getJump(int player, boolean ep)\t{return null; }", "public void slideDownPicture() {\n Log.d(TAG, \"slideDownPicture\");\n final float tran...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Removes all the feeds where scope = &63; from the database.
@Override public void removeByScope(String scope) throws SystemException { for (Feed feed : findByScope(scope, QueryUtil.ALL_POS, QueryUtil.ALL_POS, null)) { remove(feed); } }
[ "@Override\n\tpublic void removeAll() throws SystemException {\n\t\tfor (Feed feed : findAll()) {\n\t\t\tremove(feed);\n\t\t}\n\t}", "public void removeAllFavorites() {\r\n SQLiteDatabase db = helper.getWritableDatabase();\r\n db.beginTransaction();\r\n\r\n // Removes all the favo...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Use Account.newBuilder() to construct.
private Account(com.google.protobuf.GeneratedMessage.Builder<?> builder) { super(builder); }
[ "private Account(com.google.protobuf.GeneratedMessageV3.Builder<?> builder) {\n super(builder);\n }", "private Account(com.google.protobuf.GeneratedMessageV3.Builder<?> builder) {\n super(builder);\n }", "public Account (String accountId) {\n this.address = accountId;\n\n // 'master' a...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
.POGOProtos.Rpc.BuddyObservedData.BuddyFeedStats buddy_feed_stats = 11;
public POGOProtos.Rpc.BuddyObservedData.BuddyFeedStats getBuddyFeedStats() { if (buddyFeedStatsBuilder_ == null) { return buddyFeedStats_ == null ? POGOProtos.Rpc.BuddyObservedData.BuddyFeedStats.getDefaultInstance() : buddyFeedStats_; } else { return buddyFeedStatsBuilder_.getMessage(); ...
[ "@java.lang.Override\n public POGOProtos.Rpc.BuddyObservedData.BuddyFeedStatsOrBuilder getBuddyFeedStatsOrBuilder() {\n return getBuddyFeedStats();\n }", "@java.lang.Override\n public POGOProtos.Rpc.BuddyObservedData.BuddyFeedStats getBuddyFeedStats() {\n return buddyFeedStats_ == null ? POGOProtos.Rpc.B...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
redirects to getResults(SimpleSurnameAndPostcodeQuery query)
private Collection<Record> getResults(SimpleSurnameAndPostcodeQuery query) { return search(query); }
[ "@RequestMapping(value = \"/search\", method = RequestMethod.GET)\n public String handleGetProfileSearch() {\n return \"redirect:/profile\";\n }", "private void showResults(String query) {\n }", "List<ResultDTO> searchUser(String query);", "List<SearchResult> search(SearchQuery searchQuery);",...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
string checksum = 11;
java.lang.String getChecksum();
[ "int calcChecksum(String in);", "String getChecksum();", "private int checksum(String name) {\n\t\tint sum = 0;\n\t\tfor (int i = 0; i < 11; i++) {\n\t\t\tsum = (((sum & 1) == 1 ? 0x80 : 0) + (sum >> 1) + name.charAt(i)) & 0x00ff;\n\t\t}\n\t\treturn sum;\n\t}", "public static void main(String[] args) {\n ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Choosing random background image/texture
private void randBackground(){ int index = (int)(Math.random()*FRAME_COUNT); TextureRegion newBackground = frames.get(index); for (Background background : backgrounds) { background.setFrame(newBackground); } }
[ "private void loadBackground() {\n RelativeLayout thisRL = (RelativeLayout) findViewById(R.id.relativeLayout);\n\n // randomly chooses a background image for the splash screen\n int r = new Random().nextInt(NUM_BACKGROUNDS);\n switch (r) {\n case 0:\n thisRL.set...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
This method has been deprecated, please use method buildGrpc instead.
@Deprecated public V1GRPCAction getGrpc() { return this.grpc!=null ?this.grpc.build():null; }
[ "private GRPCRequest(com.google.protobuf.GeneratedMessage.Builder<?> builder) {\n super(builder);\n }", "public static InstantiatingGrpcChannelProvider.Builder defaultGrpcTransportProviderBuilder() {\n return CloudBuildStubSettings.defaultGrpcTransportProviderBuilder();\n }", "private AbelanaGrpcServer(...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
V_TPS_1_BAS 2 0...3FFH 0...4.9951 5/1024
@Override protected String calc() { double value = ((buff[0] & 0xFF) * 256 + (buff[1] & 0xFF)) * 5 / 1024; return String.format(Locale.getDefault(), "%.4f", value); }
[ "double getVstall();", "private short genSimdWMDPtShotGun()\r\n{\r\n\r\n //convert wall in inches to number of samples\r\n //debug mks -- use value loaded from config file\r\n int tof = convertInchesToSampleCounts(.250);\r\n \r\n short wallDataPoint = (short)(tof - (tof * .05 * Math.random()));\r\n...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Attaches the text change listener while updating the tweet text
private void setTweetTextListener() { mTvTweetLength.setTextColor(Color.BLACK); mEtTweet.addTextChangedListener(new TextWatcher() { @Override public void beforeTextChanged(CharSequence s, int start, int count, int after) { } @Override public v...
[ "public void attachTextListener(TextListener listener);", "void addTextListener(TextListener l);", "public void updateText( String text ) {\n\t\tthis.text = text;\n\t}", "void updateText(String text);", "void updateText( String text );", "private void listenToTextChanges(boolean listen) {\n \t\tif (listen...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Factory for creating RequestTemplate.
interface Factory { /** * create a request template using args passed to a method invocation. */ RequestTemplate create(Object[] argv); }
[ "public RequestTemplate() {\n super();\n }", "public static RequestTemplate from(RequestTemplate requestTemplate) {\n RequestTemplate template =\n new RequestTemplate(\n requestTemplate.target,\n requestTemplate.fragment,\n requestTemplate.uriTemplate,\n r...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Loads List of StageObjects from the Objects file
public static ArrayList<StageObject> loadListOfObjects() { ArrayList<StageObject> objects = null; try { DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance(); DocumentBuilder builder = factory.newDocumentBuilder(); Document doc = builder.parse(new File("res/Objects.xml")); ...
[ "abstract void loadObjects();", "protected void loadDatabaseObjects() {\n\t\tString fileName = dirName + \"DatabaseObject.txt\";\n\t\tif (verbose) Log.info(\"Loading objects from '\" + fileName + \"'\");\n\n\t\t// Ensure capacity\n\t\tint numObjects = Gpr.countLines(fileName);\n\t\tif (verbose) Log.info(\"Countin...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
$ANTLR end "rule__XIfExpression__Group__3__Impl" $ANTLR start "rule__XIfExpression__Group__4" ../com.avaloq.tools.dslsdk.check.ui/srcgen/com/avaloq/tools/dslsdk/check/ui/contentassist/antlr/internal/InternalCheck.g:12007:1: rule__XIfExpression__Group__4 : rule__XIfExpression__Group__4__Impl rule__XIfExpression__Group__...
public final void rule__XIfExpression__Group__4() throws RecognitionException { int stackSize = keepStackSize(); try { // ../com.avaloq.tools.dslsdk.check.ui/src-gen/com/avaloq/tools/dslsdk/check/ui/contentassist/antlr/internal/InternalCheck.g:12011:1: ( rule__XIfExpress...
[ "public final void rule__XIfExpression__Group__4() throws RecognitionException {\n\n \t\tint stackSize = keepStackSize();\n \n try {\n // ../org.xtext.example.helloxcore.ui/src-gen/org/xtext/example/helloxcore/ui/contentassist/antlr/internal/InternalHelloXcore.g:8785:1: ( rule__X...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Sets whether a resource split may occur when a model element is added.
public void setSplitResource(boolean splitResource) { this.splitResource = splitResource; }
[ "public boolean isSplitResource() {\n\t\treturn splitResource;\n\t}", "public void setSplitRecord(boolean value) {\n this.splitRecord = value;\n }", "public void setIsPrepareSplitDocument (boolean IsPrepareSplitDocument)\n\t{\n\t\tset_Value (COLUMNNAME_IsPrepareSplitDocument, Boolean.valueOf(IsPrepare...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Allows connection through SSH to the device whose IP is present in the field deviceIP.
public void connectSSH() throws Exception{ log.info("Trying to connect to the device "+deviceIP+" via SSH ....\n"); try{ session = jsch.getSession(deviceName, deviceIP); session.setPassword(devicePassword); session.setConfig("StrictHostKeyChecking", "no"); session.connect(60 * 1000); ...
[ "public void setIPOfMasterDevice(String ip);", "public void setDeviceIP(String argIp){\n\t deviceIP=argIp;\n }", "public String getDeviceIp(){\n\t return deviceIP;\n }", "int connectTo(String deviceAddress);", "boolean hasForwardSshConnectivity();", "private boolean initDataOnHosts(String srcIP, S...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Applies ECDSA Signature and returns the result ( as bytes ).
public static byte[] applyECDSASig(PrivateKey privateKey, String input) { Signature dsa; byte[] output = new byte[0]; try { dsa = Signature.getInstance("ECDSA", "SC"); dsa.initSign(privateKey); byte[] strByte = input.getBytes(); dsa.update(strByte)...
[ "byte[] getSignatureImage();", "com.google.protobuf.ByteString getSignatureS();", "BigInteger getDigitalSignature();", "private byte[] signData(byte[] data)\n throws CmsCadesException, GeneralSecurityException, IOException {\n CadesSignature cmsSig = new CadesSignature(data, SignedData.EXPLICIT);\n ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
This method takes a screenshot and saves it in the location specified in the system property "TEST_RESULTS_PATH".
public void getScreenshot() { String screenshotPath = System.getProperty("TEST_RESULTS_PATH"); getScreenshot(screenshotPath); }
[ "public void saveScreenshot() {\r\n\t\tFile scrFile = ((TakesScreenshot) getDriver()).getScreenshotAs(OutputType.FILE), destFile;\r\n\r\n\t\ttry {\r\n\t\t\tdestFile = File.createTempFile(TAFConfig.tafConfig.getString(\"browser\"), \"-ScreenShot.png\");\r\n\t\t\tFileInputStream fileInputStream = new FileInputStream(...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Transforms the specified client operations against the specified server operations, returning the transformed client operations in a new list.
private List<WaveletOperation> transformOps( List<WaveletOperation> clientOps, ParticipantId clientAuthor, List<WaveletOperation> serverOps, ParticipantId serverAuthor) throws OperationException { List<WaveletOperation> transformedClientOps = new ArrayList<WaveletOperation>(); for (WaveletOperation...
[ "private List<WaveletOperation> transformOps(List<WaveletOperation> clientOps,\n List<WaveletOperation> serverOps) throws OperationException {\n List<WaveletOperation> transformedClientOps = Lists.newArrayList();\n\n for (WaveletOperation c : clientOps) {\n for (WaveletOperation s : serverOps) {\n ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
test the function setFatherClassName (getFatherClassName())
@Test public void testSetFatherClassName(){ check.setFatherClassName("a"); assertEquals("a", check.getFatherClassName()); check.setFatherClassName("testclass"); assertEquals("testclass", check.getFatherClassName()); check.setFatherClassName("class1234567890123456789012345678901234567890"); asser...
[ "@Test\n\t public void testDefaultFatherClassName(){\n\t\t String fatherClassNameReceived=check.getFatherClassName();\n\t\t // fatherClassName default value should be empty string\n\t\t assertEquals(\"\", fatherClassNameReceived);\n\t }", "@Test\r\n public void testSetForename() {\r\n System.out.println...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
At least three cards have the same rank of any suit. Compares the first card to the next card. If they match, increment numCardsMatch If they don't match, change the card being compared to and increment the loop. When numCardsMatch == numCardsNeeded, return true numCardsMatch starts at 1 since all cards match themselve...
public boolean hasThreeOfAKind(int numCardsNeeded) { Card card = handToScore.getCards().get(0); int numCardsMatch = 1; for (int i = 1; i < handToScore.getHandSize(); i++) { Card cardAtIndex = handToScore.getCards().get(i); if (card.compareTo(cardAtIndex) == 0) { ...
[ "private boolean cardsEqual(ArrayList<String> guessCards){\n\t\tint check = 0;\n\t\tif(guessCards.size() == 3){\n\t\t\t//good\n\t\t\tSystem.out.println(\"3 cards foudn good\");\n\t\t\tfor(String card : guessCards){\n\t\t\t\tSystem.out.println(card);\n\t\t\t\tif(Main.deck.getCrimeCards().contains(card)){\n\t\t\t\t\t...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
/ Sorts the meld by colour and by number Differentiates between a run and a meld (to save time), then overrides default collections comparator
public void sort() { /*int jokers = this.getJokers(); if (jokers > 0 && this.size() > 2) { ArrayList<Tile> list = new ArrayList<>(); for (int i=0; i<this.size(); i++) { if (this.get(i).getColour() == 'J') { Tile joker = this.remove(this.get(i)); list.add(joker); i--; } ...
[ "public void sort_meld() {\n ArrayList<Tile> red = new ArrayList<>(), blue = new ArrayList<>(), green = new ArrayList<>(), orange = new ArrayList<>();\n\n for (Tile tile : this.tiles) {\n switch (tile.get_color()) {\n case \"R\":\n red.add(tile);\n ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Set the old_vclock value.
public T withOldVClock(Long oldVClock) { this.oldVClock = oldVClock; return self(); }
[ "public void setOldCashLimit(Long oldCashLimit) {\r\n this.oldCashLimit = oldCashLimit;\r\n }", "public void setClock(VectorClock clock) {\n\tvclock = clock;\n }", "@Override\n\tpublic void setChangeSetOld(String cs){\n\t\t\n\t\tthis.changeSetOld = cs;\n\t\t\n\t}", "public void setOldSafeLimit(Lo...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
After processing a separator, a quick peek whether it is followed by a double wildcard (and only as the last path element).
private boolean peekDoubleWildcard() { if ((this.pos + 2) >= this.pathPatternLength) { return false; } if (this.pathPatternData[this.pos + 1] != '*' || this.pathPatternData[this.pos + 2] != '*') { return false; } char separator = this.parser.getPathOptions().separator(); if ((this.pos + 3) < this.path...
[ "private boolean checkPattern() {\n if (pattern == null) {\n return false;\n }\n char leftSeparator = getLeftSeparator();\n char rightSeparator = getRightSeparator();\n Stack<Character> separatorStack = new Stack<Character>();\n for (int i = 0; i < pattern.length...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Handler's run method, parses received command and relays information to Server.
@Override public void run() { try { String response = ""; String[] args = command[1].split("\\s+"); if (this.command[0].equals("purchase")) { response = Server.purchase(args[0], args[1], args[2], args[3]); } else if (t...
[ "public void processRequest(){\n\t\tCommandArgument argument = readFromClient();\n\t\tCommandResponse response = processArgument(argument);\n\t\tsendResponse(response);\n\t}", "@Override\n public void run()\n {\n while(true)\n {\n Message<String, Object> message = commandQueue.poll(...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Adds cost of executing MobileSoftwareComponent s on target node n and infrastructure I
public void addCost(MobileSoftwareComponent s, ComputationalNode n, MobileCloudInfrastructure I) { //cost is computed according to node cost model this.userCost += n.computeCost(s, I); }
[ "public void addCost(MobileSoftwareComponent s, ComputationalNode n, ComputationalNode m, MobileCloudInfrastructure I) {\n \t//cost is computed according to node cost model\n \tthis.userCost += n.computeCost(s, m, I);\n }", "public void addEnergyConsumption(MobileSoftwareComponent s, ComputationalNode n,...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Check if AlwaysTimeShift is recording.
public boolean isAlwaysTimeShiftRecording() throws TvCommonException { return pvrMgr.isAlwaysTimeShiftRecording(); }
[ "public boolean isTimeShiftRecording() throws TvCommonException\r\n\t{\r\n\t\treturn pvrMgr.isTimeShiftRecording();\r\n\t}", "boolean isSupportTimeShift();", "public boolean isRecording();", "boolean isRecording();", "public short startAlwaysTimeShiftRecord() throws TvCommonException\r\n\t{\r\n\t\treturn pv...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Processes this image in rowmajor order and decreases the value of each pixel at position (row, col) by the value of the pixel at position (row + 2, col + 2) if it exists. Resulting values that would be less than BLACK are replaced by BLACK. Pixels for which there is no pixel at position (row + 2, col + 2) are unchanged...
public void processImage() { int i = 0; int currArray = 0; for (int j = 0; j < pixelValues.length; j++) { for (int value : pixelValues[j]) { //System.out.println((currArray + 2) + " < " + pixelValues.length); if (currArray + 2 < pixelValues.length) { if (i + 2 < pixelValues[currArray + 2].length) ...
[ "private void processImage () {\n\t\tfor (int row = 0; row < pixelValues.length; row++) {\n\t\t\tfor (int col = 0; col < pixelValues[0].length; col++) {\n\t\t\t\tif ((row + 2) < pixelValues.length \n\t\t\t\t&& (col + 2) < pixelValues[0].length) {\n\t\t\t\t\tpixelValues [row] [col] -= pixelValues [row + 2] [col + 2...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Indicates whether termination protection is enabled for the event data store.
public Boolean isTerminationProtectionEnabled() { return this.terminationProtectionEnabled; }
[ "boolean hasDeletionProtection();", "public void setTerminationProtectionEnabled(Boolean terminationProtectionEnabled) {\n this.terminationProtectionEnabled = terminationProtectionEnabled;\n }", "public boolean isPENSIONCERTIFICATENEEDRECOVERY() {\r\n return pensioncertificateneedrecovery;\r\n ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Filters the list of notifications by a given Category.
public void filterBy(NotificationCategory category);
[ "public void filterPostsByCategor(String category){\r\n\t\t\r\n\t}", "private LinkedList<Article> filterCategory(LinkedList<Article> articles, String category) {\n LinkedList<Article> filtered = new LinkedList<Article>();\n\n for (Article article : articles)\n if (article.getCategory().eq...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
retrieves customer balance from db
public double getCustBalance(String uname) { int i=getCustId(uname); double bal = 0; try { Statement st = conn.createStatement(); ResultSet rs = st.executeQuery("select balance from accounts where c_id='"+i+"'"); while(rs.next()) { bal = rs.getDouble(1); } return bal; } catch (...
[ "@Override\n public BigDecimal getBalance(String customerId, EMCUserData userData) {\n BigDecimal outstandingDebit = null;\n\n //Get total outstanding credits for customer, which existed at atDate\n EMCQuery query = new EMCQuery(enumQueryTypes.SELECT, DebtorsOpenTransactions.class);\n ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Specifies changes to request and response headers that need to take effect for the selected backendService. HeaderAction specified here are applied after the matching HttpRouteRule HeaderAction and before the HeaderAction in the UrlMap
public Builder setHeaderAction(HttpHeaderAction headerAction) { this.headerAction = headerAction; return this; }
[ "public void setHdrAction(List<HTTPHdrAction> hdrAction) {\n this.hdrAction = hdrAction;\n }", "public HttpHeaderAction getHeaderAction() {\n return headerAction;\n }", "public HttpHeaderAction getHeaderAction() {\n return headerAction;\n }", "protected void setRequestHeaders(ODataBasic...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Converts a distance in meters to one in (horizontal) pixels at the current zoomlevel and at the current latitude at the center of the screen.
public float metersToPixels(final float meters) { return metersToPixels(meters, getBoundingBox().getCenterWithDateLine().getLatitude(), mZoomLevelProjection); }
[ "private double getZoomForMetersWide(final double meters, final double width, final double lat) {\n final double latAdjust = Math.cos(Math.PI * lat / 180.0);\n\n final double arg = EQUATOR_LENGTH * width * latAdjust / (meters * 256.0);\n\n return Math.log(arg) / Math.log(2.0);\n ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Allows you to access attributes of a given Sandwich via its corresponding UI item's id.
@NonNull private String accessSandwichById(Sandwich sandwich, int id) { switch (id) { case R.id.also_known_tv: return (sandwich.getAlsoKnownAs() != null) ? interpret(sandwich.getAlsoKnownAs()) : ""; case R.id.origin_tv: return (sandwich.getPlaceOfOrig...
[ "public Attribute getAttributeById(Integer id) throws MiddlewareQueryException;", "String getIdAttribute();", "public Attribute fetchAttributeById(int attribId);", "public String getAttributeValue(int id) {\n Attribute attr = super.findById(id, false);\n if (attr != null ) {\n return ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
PPP_SUGGESTIONS, PPP_USER_PROFILE; What kind of file is created by each task? (Some tasks may create more than one file on occasions, but this method just returns the "main" type).
public DataFile.Type outputFor() { if (this == Task.Op.HISTORY_TO_PROFILE) { return DataFile.Type.USER_PROFILE; } else if (this == Task.Op.LINEAR_SUGGESTIONS_1) { return DataFile.Type.LINEAR_SUGGESTIONS_1; } else if (this == Task.Op.LOG_SUGGESTIONS_1) { return DataFile.Type.LOG_SUGGESTIONS_1; ...
[ "String getDefaultFiletype();", "public String getPROG_TYPE() {\r\n return PROG_TYPE;\r\n }", "public String getProfesionTI() {\n return this.profesionTI;\n }", "String getTaskType();", "public String getTaskType(){\n return TaskType.TRADITIONAL_TASK.toString();\n }", "privat...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Default constructor. Create the underlying Mersenne Twister prng and seed it based on the first number in the java.util.Random prng sequence, as seeded with the default Random constructor.
private PRNG() { java.util.Random r = new java.util.Random(); seed = r.nextInt(); mersenne = new MersenneTwister(seed); }
[ "public MersenneTwisterRandomGenerator() {\r\n\t\tthis(42);\r\n\t}", "public Random() {\n real = new UniversalGenerator();\n twister = new MersenneTwister();\n }", "public GeneratorRandom() {\n this(FastRandom.random());\n }", "public CellularAutomatonRNG()\n {\n this(Defa...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
/ Retourne true si l'Expression a une HashMap de variables, cad si l'Expression represente le debut d'une portee
public boolean hasVariableHashMap() { return false; }
[ "private static boolean checkFormulaValues(char formulaElement, HashMap<String, Double> variables) {\n if (!variables.containsKey(Character.toString(formulaElement))) {\n System.out.println(\"No data for item \\\"\" + formulaElement + \"\\\" was found\");\n System.exit(0); // stop progr...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Receives the POSTed New API Key form to be processed. Returns any form errors.
@LoginRequired @RequestMapping(value={"/user/key/new","/admin/user/key/new"}, method=RequestMethod.POST) public String createKey(@Valid ApiKey apiKey, BindingResult result, ModelMap model, HttpSession session, RedirectAttributes redirectAttributes) throws Exception { User user = (User) session.getAttribute("user");...
[ "private void detectAndSetApikey() {\n if (APIKEY.equals(\"\")) {\n JFrame pop = new JFrame();\n String apikey = JOptionPane.showInputDialog(pop, \"please enter the api key\");\n String action = \"setapikey\";\n\n Pattern p = Pattern.compile(\"\\\\s*|\\t|\\r|\\n\")...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
set the minutes after midday for calculating Dhuhr
public void setDhuhrMinutes(int minutes) { dhuhrMinutes = minutes; }
[ "public HoraDelDia(int h, int min){\n horas = h;\n minutos = min;\n }", "public void setHours(double h){\n\t if (h>=0 && h<168)\n\t \t hours=h;\n\t else\n\t hours=0;\n }", "public void setAditionalNightHours(int hours){\r\n\t this.addings = (double)(40*hours);\r\n }", ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
$ANTLR end "rule__XCastedExpression__Group__1__Impl" $ANTLR start "rule__XCastedExpression__Group_1__0" ../org.xtext.mongobeans.ui/srcgen/org/xtext/mongobeans/ui/contentassist/antlr/internal/InternalMongoBeans.g:6742:1: rule__XCastedExpression__Group_1__0 : rule__XCastedExpression__Group_1__0__Impl rule__XCastedExpress...
public final void rule__XCastedExpression__Group_1__0() throws RecognitionException { int stackSize = keepStackSize(); try { // ../org.xtext.mongobeans.ui/src-gen/org/xtext/mongobeans/ui/contentassist/antlr/internal/InternalMongoBeans.g:6746:1: ( rule__XCastedExpression__Grou...
[ "public final void rule__XCastedExpression__Group_1_0__0() throws RecognitionException {\n\n \t\tint stackSize = keepStackSize();\n \n try {\n // ../org.xtext.mongobeans.ui/src-gen/org/xtext/mongobeans/ui/contentassist/antlr/internal/InternalMongoBeans.g:6807:1: ( rule__XCastedEx...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
getAccount1 method end getAccount2 method returns the selected item from the first ComboBox
public int getAccount2() // getAccount2 method start { if (increasing) { return convertIncreasingName(creditBox2.getSelectedIndex()); } // end if else { return convertDecreasingName(creditBox2.getSelectedIndex()); } // end else }
[ "public int getAccount1() // getAccount1 method start\n\t\t{\n\t\t\treturn debitBox1.getSelectedIndex();\n\t\t}", "public int getAccount2() // getAccount2 method start\n\t\t{\n\t\t\tif (accounts[debitBox1.getSelectedIndex() - 1].getStatus())\n\t\t\t{\n\t\t\t\treturn convertIncreasingName(debitBox2.getSelectedInde...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Check reserved entries to ensure the last UpdateVotersConfig entry is applied to the current voter config.
private void recoverVoterConfig() { boolean isRecoveredFromJournal = false; for (long index = journal.maxIndex(INTERNAL_PARTITION) - 1; index >= journal.minIndex(INTERNAL_PARTITION); index--) { JournalEntry entry = journal.readByPartition(INTERNAL_PARTITION, index);...
[ "public void checkAvaliableElevators()\r\n\t{\r\n\t\tSystem.out.println(\"--------- Checking Elevators Current Status ------\");\t\r\n\t\t\r\n\t\tif(availableElevadors.isEmpty())\r\n\t\t{\r\n\t\t\tfor(int i=0; i <numberOfElevators-3; i++) {\r\n\t\t\t\tavailableElevadors.add(occupiedElevadors.remove(i));\r\n\t\t\t\t...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Get entire Queue object.
public Queue getQueue() { return queue; }
[ "private Queue<String> getQueue() {\n return new ConcurrentLinkedQueue<>();\n }", "public BlockingQueue<Message> getQueue() {\n return queue;\n }", "public LinkedList<ITask> GetQueue() {\n\t\treturn this.Queue;\n\t}", "public MemoryQueue getQ() {\r\n\t\treturn q;\r\n\t}", "BlockingQueue<...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
private methods that is used to help the constructor. Cleans up the given infix expression by adding and removing spaces where needed to make the infix expression work.
private void clean() { String newInfix = infix; while(newInfix.charAt(0) == ' ') { newInfix = newInfix.substring(1, newInfix.length()); } int pos = 1; while(pos < newInfix.length()) { if(newInfix.charAt(pos - 1) == ' ' && newInfix.charAt(pos) == ' ') { newInfix = newInfix.substring(0, pos - 1) + new...
[ "public InfixToPostfixParentheses()\n {\n this.operatorStack = new Stack<Character>();\n this.postfix = new StringBuilder();\n }", "public void parseExpression() {\n String regex = \"[ ]\";\n //\"?<=[-+*/()ep])|(?=[-+*/()ei]\";\n String[] splitString = infix.split(regex);\...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Execute listOptionsContracts request (asynchronously)
public okhttp3.Call executeAsync(final ApiCallback<List<OptionsContract>> _callback) throws ApiException { return listOptionsContractsAsync(underlying, expiration, _callback); }
[ "public ApiResponse<List<OptionsContract>> executeWithHttpInfo() throws ApiException {\n return listOptionsContractsWithHttpInfo(underlying, expiration);\n }", "public List<Contract> getContracts(Contract contract,String start,String limit,String sortColumn, String sortDir) throws Exception;", ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
return the first appearence once char in current stringstream
public char FirstAppearingOnce() { for (int i = 0; i < s.length(); i++) { if (hash[s.charAt(i)] == 1) { return s.charAt(i); } } return '#'; }
[ "public char FirstAppearingOnce()\n {\n \n for(int i = 0; i < stringstream.size(); i++){\n char ch = stringstream.get(i);\n\t\t\tif(!rep.contains(ch)){\n return ch;\n }\n }\n return '#';\n }", "public char FirstAppearingOnce()\n {\n retu...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Get the time that passed since mood was received.
public Long getTimeLapsed() { if(moodTimestamp == null) return null; else return ((System.currentTimeMillis()/1000) - moodTimestamp.longValue()); }
[ "public abstract float getWantedTime();", "public double timePassed()\n\t{\n\t\tmyPresentTime = System.currentTimeMillis();\n\t\treturn (myPresentTime - myStartTime) / 1000.0;\n\t}", "long getReceiveTime();", "public double getEventTime();", "public double getWaitTime() {\n Date now = new Date();\n ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Fill in the array 'infos.metadata' with a String
public void setString_infos_metadata(String s) { int len = s.length(); int i; for (i = 0; i < len; i++) { setElement_infos_metadata(i, (short)s.charAt(i)); } setElement_infos_metadata(i, (short)0); //null terminate }
[ "public String getString_infos_metadata() { \n char carr[] = new char[Math.min(net.tinyos.message.Message.MAX_CONVERTED_STRING_LENGTH,2)];\n int i;\n for (i = 0; i < carr.length; i++) {\n if ((char)getElement_infos_metadata(i) == (char)0) break;\n carr[i] = (char)getE...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
When adding adding possible chains, add the gozintaNum to the end of each link, because it has already been established that all links divide into gozintaNum == 0
private void addNewChainPoss(List<Integer> chain){ tempChain = new ArrayList<Integer>(); tempChain.addAll(chain); listOfGozintaChains.add(tempChain); }
[ "private void addFirstChain(){\n chain.add(1);\n chain.add(gozintaNum);\n listOfGozintaChains.add(chain);\n }", "private void createChains(int start, int numChainLinks)\n\t{\n\t\tArray<Body> bodyList = new Array<Body>();\n\t\tBody b;\n\t\tGameEntity ge;\n\t\t\n\t\tfor (int i = 0; i < numPl...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Private constructor for CasVersion. You should not be able to instantiate this class.
private CasVersion() { // this class is not instantiable }
[ "private Version() {\r\n\t}", "protected AbstractVersionable() {\r\n\t\tsuper();\r\n\t}", "private CodecVersion() {\n initFields();\n }", "public VersionModel() {\n }", "public ComputeInstanceVersion() {\n }", "public ApplicationVersion() {\n }", "public VersionController() {\r\n }", ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
org.xms.g.common.api.ResultTransform.ResultTransform(org.xms.g.utils.XBox) constructor of ResultTransform with XBox. Support running environments including both HMS and GMS which are chosen by users. Below are the references of HMS apis and GMS apis respectively:
public ResultTransform(org.xms.g.utils.XBox param0) { super(param0); wrapper = true; }
[ "public ResultTransform() {\n super(((org.xms.g.utils.XBox) null));\n if (org.xms.g.utils.GlobalEnvSetting.isHms()) {\n this.setHInstance(new HImpl());\n } else {\n this.setGInstance(new GImpl());\n }\n wrapper = false;\n }", "public XImpl(org.xms.g.util...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Create a predicted state vector by propagating a given helix to a measurement site
StateVector predict(int newSite, Vec pivot, double B, Vec t, Vec originPrime, double XL, double deltaE) { // newSite = index of the new site // pivot = pivot point of the new site in the local coordinates of this state vector (i.e. coordinates of the old site) // B and t = magnitude and directio...
[ "StateVector predict(int newSite, Vec pivot, double B, Vec t, Vec originPrime, double XL, double deltaE) {\n // newSite = index of the new site\n // pivot = pivot point of the new site in the local coordinates of this state vector (i.e. coordinates of the old site)\n // B and t = magnitude and ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Setter for property affiliateIdentifier.
public void setAffiliateIdentifier(AffiliateIdentifier affiliateIdentifier) { this.affiliateIdentifier = affiliateIdentifier; }
[ "public AffiliateIdentifier getAffiliateIdentifier() {\n return affiliateIdentifier;\n }", "public void setAffiliateId(String affiliateId) {\n\n this.affiliateId = affiliateId;\n }", "@Length(max = NAME_MAX_LENGTH, message = \"length.affiliate.id\")\n @Pattern(regexp = \"[[^@#$%&*();:,{}^...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Returns true if automation can extract the given item in the given slot from the given side. Args: Slot, item, side
public boolean canExtractItem(int slot, ItemStack item, int side) { return true; }
[ "public boolean canExtractItem(int slot, ItemStack item, int side)\n {\n return this.getAccessibleSlotsFromSide(side)[0] == slot && item.getItem() == waterjetStacks[slot].getItem();\n }", "@Override\n\tpublic boolean canExtractItem(int slot, ItemStack par2ItemStack, int side) {\n\t\t\n\t\tif((side ==...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Checks if the given version string meets all three constraints.
public boolean meetsConstraint(String version) { return (matches(version, this.version) && isEarlier(version, latest) && isLater(version, earliest)); }
[ "public static boolean isValidVersion(String version) {\n // Note: Technically this condition is redundant this isOrderableVersion ==> isNonOrderableVersion.\n // Will check both for maintainability and legibility.\n return isOrderableVersion(version) || isNonOrderableVersion(version);\n }",...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
ManagedServiceFactory Interface method Called by the framewok when the configuration manager has fond new configuration for this service. Four properties are expected from each configuration set: Ebus_port, Ebus_slave_master, Ebus_id and Ebus_encoding ( theses values are described in the EbusDriver interface ). For eac...
public void updated(String pid, Dictionary properties) { String port = (String) properties.get(EbusDriver.EBUS_PORT); Object id = properties.get(EbusDriver.EBUS_ID); Integer ebusID = id instanceof Integer ? (Integer) id: Integer.parseInt(id.toString()); Object lockCounter = properties....
[ "public EbusDriverFactory() {\n // create a new hastable that will contain references to all the Ebusdriver services.\n EbusDrivers = new Hashtable();\n // register the class as a service factory.\n Hashtable properties = new Hashtable();\n properties.put(Constants.SERVICE_PID, \"...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Create a comparator that compares the number of days since death.
public Comparator<Zombie> getDaysSinceDeathComparator() { return new Comparator<Zombie>() { @Override public int compare(Zombie zombie1, Zombie zombie2) { return zombie1.getDaysSinceDeath() - zombie2.getDaysSinceDeath(); ...
[ "public Comparator<Human> getLikelinessToGetKilledComparator() {\n return new Comparator<Human>() {\n @Override\n public int compare(Human human1, Human human2) {\n return (int) (100 * (human1.getLikelinessToGetKilled()\n - human...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Sort by name length
public List<User> sortNameLength(List<User> users) { users.sort( (u1, u2) -> { Integer u1NameLength = u1.getName().length(); Integer u2NameLength = u2.getName().length(); return u1NameLength.compareTo(u2NameLength); }); ...
[ "public void sortByWordLengthAsc() {\r\n\t\tcomparator = new WordLengthAsc();\r\n\t}", "public void sortByWordLengthDesc() {\r\n\t\tcomparator = new WordLengthDesc();\r\n\t}", "public List<User> sortNameLength(List<User> users) {\n\t\tusers.sort(new Comparator<User>() {\n\t\t\t@Override\n\t\t\tpublic int compar...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Decider for winner between two three of a kind.
private boolean threeOfAKindDecider(UserPlayer userPlayer, OpponentPlayer opponentPlayer) { int userIndex = userPlayer.threeOfAKindIndex(); int opponentIndex = opponentPlayer.threeOfAKindIndex(); if (userPlayer.getCards().get(userIndex).getRawRank() < opponentPlayer.getCards().g...
[ "public boolean winner(){\n\t\treturn goals1 > goals2;\n\t}", "private int decideWinnerOfTrick() {\r\n\t\tint winner = -1;\r\n\t\t\r\n\t\tif( players[PLAYER_0].trickCard.getNum() > players[PLAYER_1].trickCard.getNum() ) {\r\n\t\t\twinner = players[PLAYER_0].canWin ? PLAYER_0 : PLAYER_1;\r\n\t\t}\r\n\t\telse {\r\n...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Returns a new object of class 'Clase'.
Clase createClase();
[ "public void crearClase() {\r\n\t\tsetClase(3);\r\n\t\tsetTipoAtaque(3);\r\n\t\tsetArmadura(15);\r\n\t\tsetModopelea(0);\r\n\t}", "public Classe() {\r\n }", "public Cake getCake(){\n return new Cake();\n }", "Class3 createClass3();", "public void addClase(Clase clase){\r\n\t\tClaseObjeto c = new...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Asserts that the number of elements locatable by the given XPath expression is equal to the given count.
public void assertXpathCount(final String xpath, final String count);
[ "public void assertXpathCount(final String xpath, final int count);", "public void assertElementCount(final String elementLocator, final int count);", "public void assertElementCount(final String elementLocator, final String count);", "@Then(\"There should be {int} occurences of {string}\")\n public void c...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Play card. It returns true if given card can be played to given target enemy. returns false otherwise.
public boolean playCard(Card card, Enemy enemy){ if( isGameOver() )return false; if( card.isHasTarget() && !enemyController.hasEnemy(enemy) )return false; System.out.println("IN PLAYCARD METHOD"); boolean b = effectHandler.playCard( card , enemy); System.out.println( "HAND CARDS...
[ "public boolean canPlayCard(AbstractCard card) {\n return true;\n }", "private Boolean CanPlayCard(Player Attacker){\r\n\tfor(Card c: Attacker.getHand()){\r\n\t\tif(c.getCost()<Attacker.getResources())\r\n\t\t\treturn true;\r\n\t}\r\n\treturn false;\r\n}", "public boolean playCard(Card card){\n ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
================================================================================================= Test of unsubscribe
@Test public void unsubscribeIsOkTest() throws Exception { final String queryStr = createQueryStringForUnregister("eventType", "systemName", "address", 1); doNothing().when( eventHandlerService ).unsubscribe(any(), any(), any(), anyInt() ); deleteUnregisterSubscription( queryStr, status().isOk() ); }
[ "@Test\r\n\tpublic void testUnSubscribeCall() {\r\n\t\tboolean b;\r\n\t\tb=mc.input(\"!unsubscribe eeee\");\r\n\t\tassertTrue(b);\r\n\t}", "void unsubscribe();", "public boolean unsubscribe( Subscription sub ) throws IOException;", "@Test\r\n\tpublic void testUnSubscribeNoId() {\r\n\t\tboolean b;\r\n\t\tb=mc....
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Computes properties of the molecules in a reaction.
private IReaction computeProperties(IReaction reaction) { reaction = computePartialCharge(reaction); reaction = computeHybridization(reaction); reaction = computeCovalentRadius(reaction); return reaction; }
[ "private IReaction computeCovalentRadius(IReaction reaction) {\n\n IAtomicDescriptor covalentRadiusDescriptor = null;\n\n try {\n covalentRadiusDescriptor = new CovalentRadiusDescriptor();\n } catch (IOException | ClassNotFoundException e) {\n e.printStackTrace();\n ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
This constructs a community chest space on the gameboard
public CommunityChestSpace( GameBoard g, int location, int x, int y, int o ) { super( g, location, x, y, o ); name = "Community Chest"; buyable = false; canHaveBuildings = false; if(myOrientation == 0) { goodLocs[0][0] = myX; goodLocs[...
[ "public void communityChest(Card card, Player[] users, Deed[] board) {\n if (card.name.equals(\"Get Out of Jail Free\")) {\n getOutOfJail++;\n } else\n useCard(card, users, board);\n }", "private void setCommunityChestCards()\n {\n m_communityChest.add(new Card(\"A...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Waits until the url is ready. As a first attemp tries to ask the deployer whether the application with given deploymentUrl is already started. As a fallback it asks the jboss for the MBean of the warfile (name of the war is expected to be moduleID.getModuleID()).
protected final boolean waitForUrlReady(TargetModuleID moduleID, File deployedFile, Long previousDeploymentTime, long timeout) throws InterruptedException { if (Thread.currentThread().isInterrupted()) { throw new InterruptedException("Interrupted on wait enter"); // NOI18N } ...
[ "private BundleDeployment waitForBundleDeployment(BundleDeployment deployment) {\n \twhile (deployment.getStatus().equals(BundleDeploymentStatus.IN_PROGRESS) \n \t\t||deployment.getStatus().equals(BundleDeploymentStatus.PENDING)) {\n \t try {\n \t\tThread.currentThread().join(3 * 1000);\n \t } catch (Interrup...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Initializes an AddDeadline Object with the user input.
public AddDeadline(String userIn) { this.userIn = userIn; }
[ "public void addDeadline(){\n try {\n newMessage = Message[1];\n String[] DeadlineMessage = parser.parseDeadlineCommand(newMessage);\n newTask = new Deadline(DeadlineMessage[0], DeadlineMessage[1]);\n taskList.addTask(newTask);\n System.out.println(bound...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Sets the branchDescM value for this ScenicBranchBean.
public void setBranchDescM(java.lang.String branchDescM) { this.branchDescM = branchDescM; }
[ "public java.lang.String getBranchDescM() {\n return branchDescM;\n }", "public void setBranchDesc(String branchDesc) {\n this.branchDesc = branchDesc;\n }", "public void setBranchDesc(java.lang.String branchDesc) {\n this.branchDesc = branchDesc;\n }", "public String getBranchDe...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
The purpose of this method is to display the fitUser's profile
public static void viewProfile(FitnessUser fitUser){ //get activities for the last 7 days List<ExerciseActivity> pastActivities = getActivitiesInThePast(fitUser,7); String fitUserInfo = ""; String weeklyReportTop = "\nProgress Report For Last 7 Days:\n" + "Activities Calories Burned\n"...
[ "private void loadProfileInfo() {\n\t\tMyTwitterApp.getRestClient().getAnyUser(userToDisplay, new \n\t\tJsonHttpResponseHandler() {\n\t\t\t@Override\n\t\t\tpublic void onSuccess(JSONArray jsonUsers) {\n\t\t\t\t/* in the request you can specify multiple screen_names, so it returns\n\t\t\t\t * an array. Get the json...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Returns all the credit app bank references.
@Override public List<CreditAppBankReference> findAll() throws SystemException { return findAll(QueryUtil.ALL_POS, QueryUtil.ALL_POS, null); }
[ "@GetMapping(\"/bank-references\")\n @Timed\n public List<BankReference> getAllBankReferences() {\n log.debug(\"REST request to get all BankReferences\");\n return bankReferenceRepository.findAll();\n }", "@Override\n\tpublic List<CreditAppBankReference> findByCreditAppId(long creditApp...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Test the conversion of a string to a month. Note that this test will fail if the default locale doesn't use English month names...devise a better test!
public void testStringToMonth() { Month m = Month.parse("January"); assertEquals(Month.JANUARY, m); m = Month.parse(" January "); assertEquals(Month.JANUARY, m); m = Month.parse("Jan"); assertEquals(Month.JANUARY, m); }
[ "@Test\n\tpublic void parseDateTextFieldMonthTest() {\n\t\tassertEquals(01,\n\t\t\t\tInteger.parseInt(textFieldDate.getText().substring(5, 7)));\n\t}", "public static Matcher<LocalDateTime> isFebruary() {\r\n\t\treturn isMonth(FEBRUARY);\r\n\t}", "@Test\n public void testGetMonthName() {\n assertThat(...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
The constructor sets the player's name, gives it a new PokerHand of 5 cards, sets the number of wins for the player to 0 and tells you it is not a computer player.
public Player() { myName = DEFAULT_NAME; myHand = new PokerHand(5); myNumberWins = 0; myAmAI = false; }
[ "public Poker() {\n\t\tresetDeck();\n\t\tshuffleDeck();\n\t\t// In case we want to play 7 card or something\n\t\t// Logic isn't done for that yet, though, so\n\t\t// keep it at 5\n\t\thandSize = 5;\n\t\thand = drawCards(handSize);\n\t}", "public BlackjackPlayer(String name){\n super(name);\n //reset...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
this is the getter for the trade points.
public int getTradePoint() { return tradePoint; }
[ "public double getPoints() {\n return points;\n }", "public List<Point> getPoints()\r\n\t{\r\n\t\treturn chartPoints;\r\n\t}", "public BigDecimal getPoints() {\n return points;\n }", "public int getPoints()\n {\n return points;\n }", "public ArrayList getPoints() {\n return p...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Reads all text of a file and returns the lines as string array.
public static String[] readAllLines(File file) { if (file == null || !file.exists()) { throw new IllegalArgumentException("Invalid file given: " + file); } BufferedReader reader = null; try { reader = new BufferedReader(new FileReader(file)); ...
[ "public static String[] readAllLines() {\n ArrayList<String> lines = new ArrayList<String>();\n while (hasNextLine()) {\n lines.add(readLine());\n }\n return lines.toArray(new String[lines.size()]);\n }", "public static String[] readLines(String f) throws IOExceptio...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Test checks if HeaderOption was added to ImportUnit.
@Test public void shouldAddHeaderOptionToImportUnit() { // GIVEN final ImpexHeaderOption headerOption = new ImpexHeaderOption(); headerOption.setMacro("$distanceUnit=km"); // WHEN this.importPatchAction.updatedHeaderOptions(this.impexImportUnit, headerOption); // THEN assertThat(this.impexImportUnit.get...
[ "@Test\n\tpublic void shouldAddHeaderOptionsToImportUnit()\n\t{\n\t\t// GIVEN\n\t\tfinal ImpexHeaderOption headerOption1 = new ImpexHeaderOption();\n\t\theaderOption1.setMacro(\"$pickupInStoreMode=BUY_AND_COLLECT\");\n\t\tfinal ImpexHeaderOption headerOption2 = new ImpexHeaderOption();\n\t\theaderOption2.setMacro(\...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Constructs and returns a ValueAnimator that animates between float values. A single value implies that that value is the one being animated to. However, this is not typically useful in a ValueAnimator object because there is no way for the object to determine the starting value for the animation (unlike ObjectAnimator,...
public static ValueAnimator ofFloat(float... values) { ValueAnimator anim = new ValueAnimator(); anim.setFloatValues(values); return anim; }
[ "private ValueAnimator() {}", "public float getAnimatedValue() {\n return mStartValue + (mEndValue - mStartValue) * mProgress;\n }", "@TargetApi(Build.VERSION_CODES.HONEYCOMB_MR1)\n\t@Override\n\tpublic void animateToGoalValues() {\n\t\tif (android.os.Build.VERSION.SDK_INT < Build.VERSION_CODES.HONEYC...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Tries to read the texture to detect a marker.
private Marker isMarker(MatOfPoint2f result, Mat texture) { boolean[][] pattern = new boolean[4][4]; // reset error allowance int errorAllowance = 0; // Check border: for (int i = 1; i < MARKER_GRID - 1; i++) { if (testSample(half + (i * step), half, ...
[ "protected void readFirstMarker() throws IOException, JpegException {\n int c1 = read(in);\n int c2 = read(in);\n if (c1 != MARKER_CHAR || c2 != M_SOI)\n throw new JpegException(\"Not a JPEG file\");\n }", "public abstract ResourceLocation getTexture(int block, int meta);", ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Function Name: createCurrentCart Input: String client_email Output: none Description: create new table for current cart for the user and add the products
public static void createCurrentCart(String client_email) throws SQLException, IllegalAccessException, ClassNotFoundException { Client client = new Client(client_email); String email = client.getUser_email(); email = email.replace("@", ""); email = email.replace(".", ""); String table_name = null; Jdb...
[ "public void addToClientCart() {\n String client_id = getToken(\"Enter client id\");\n String product_id = getToken(\"Enter product id\");\n int product_quantity = getNumber(\"Enter product quantity\");\n warehouse.addToClientCart(client_id, product_id, product_quantity);\n }", "pub...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
/ Find Median Finds the median of an array of integers.
public static int findMedian(int[] arr) { if (arr.length % 2==0) { return (int)(arr[arr.length/2]+arr[(arr.length/2)-1])/2; } return (int)arr[(arr.length-1)/2]; }
[ "public static int findMedian(double[] arr)\r\n\t{\r\n\t\tif (arr.length % 2==0)\r\n\t\t{\r\n\t\t\treturn (int)(arr[arr.length/2]+arr[(arr.length/2)-1])/2;\r\n\t\t}\r\n\t\treturn (int)arr[(arr.length-1)/2];\r\n\t}", "public static double findMedian(int [] numbers)\n {\n Arrays.sort(numbers);\n if...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Create a LinphoneConfig object from a user config file.
public Config createConfig(String filename);
[ "public static CliConfig fromUserConfig() throws IOException {\n final String userHome = System.getProperty(\"user.home\");\n final String defaults = userHome + File.separator + CONFIG_PATH;\n final File defaultsFile = new File(defaults);\n return fromFile(defaultsFile);\n }", "private void createCon...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Removes a field from this
public Object removeField(String field) { return getFieldMap().remove(field); }
[ "public Object removeField( Object n );", "public void delete() {\n mapping.getFieldOrFieldExclude().remove(field);\n }", "public void removeField(String name) {\n fields.remove(name.toLowerCase());\n }", "void fieldRemoved(final DBObject object, final String field);", "void removeField(...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Creates a combo box with all supported encoding types
private static Combo getEncodingCombo(Composite parent, Vector<String> encodingTypes) { Combo encodingCombo = new Combo(parent, SWT.SINGLE | SWT.BORDER | SWT.READ_ONLY); for (int i = 0; i < encodingTypes.size(); i++) { encodingCombo.add(encodingTypes.get(i)); } // for encodingCombo.select(0); return enco...
[ "private void createTierTypesComboBox()\n\t{\n\t\tthis.oGIPSYTierTypesComboBox = new JComboBox();\n\t\n\t\tfor(String strTierType: AppConstants.TIER_TYPES)\n\t\t{\n\t\t\tthis.oGIPSYTierTypesComboBox.addItem(strTierType);\n\t\t}\n\t}", "public void createSpecialityComboBox(){\n SpecialityRefference refferen...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
/ DECLARE > ("STRING"|"FLOAT"|"STRING") ID (COMMA ID) SEMICOLON
public void declare(){ getToken(); match(TokenTypes.T_ID); while(is(TokenTypes.DELIMIT_COMMA)){ getToken(); match(TokenTypes.T_ID); } match(TokenTypes.DELIMIT_SEMICOLON); }
[ "public void input(){\n getToken();\n match(TokenTypes.T_ID);\n while(is(TokenTypes.DELIMIT_COMMA)){\n getToken();\n match(TokenTypes.T_ID);\n }\n match(TokenTypes.DELIMIT_SEMICOLON);\n }", "private Part parseTypeNameWithArguments() {\n Part type...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
A listener that will be notified when eviction of a mapping happens
public interface Listener<K, V> { /** * Invoked when a mapping is evicted. * * @param key the key evicted * @param value the value evicted */ void evicted(K key, V value); }
[ "@Override\n\tpublic void mapEvicted(MapEvent event) {\n\t}", "public void onEntryEvicted();", "@Override\n public void entryEvicted(EntryEvent event) {\n }", "public void onUsedCache() {}", "public abstract void onAddedToCache();", "public void notifyMapLoaded();", "@Override\n public void onL...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }