query
stringlengths
8
1.54M
document
stringlengths
9
312k
negatives
listlengths
19
20
metadata
dict
Initiates the IAS instance that belongs to the SUB cluster.
private static void initIAS() { Log.printConcatLine("Initiating a Hazelcast instance."); Config cfg = ClusterConfig.getSubClusterConfig(); HazelSim.spawnInstance(cfg); IasRunnable.initHealthMap(); }
[ "public void initAsg(){\n\t\tConfigure conf = Configure.getConf();\n\t\tint min = conf.getMaxNum();\n\t\t\n\t\t//launch min number of instances\n\t\tTimeManager.PrintCurrentTime(\"Init Cluster, launching %d DC\\n\", min);\n\t\tfor(int i=0; i < min; i++){\n\t\t\tConnToDC dc = nova.launchOne(conf.getInatanceName());\...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Returns the time for when file icon on the content server is no longer valid to download.
public long getFileIconExpiration() throws RcsPersistentStorageException, RcsGenericException { try { return mTransferInf.getFileIconExpiration(); } catch (Exception e) { RcsPersistentStorageException.assertException(e); throw new RcsGenericException(e); } ...
[ "public long getFileExpiration() { return expiration; }", "public long getFileIconValidity() {\n\t\treturn mFileIconValidity;\n\t}", "public long getFileExpiration() throws RcsPersistentStorageException, RcsGenericException {\n try {\n return mTransferInf.getFileExpiration();\n\n ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Setter of the Die pointed by this coordinate
public void set(Die die) { this.container.setDie(index, die); }
[ "public void set(Coord dest) {\n x = dest.x;\n y = dest.y;\n }", "public void setDie(Die die) {\n this.die = die;\n }", "public void setCoordinate(Coordinate coord);", "public void setDie(int i, int value) {\n dice[i] = value;\n modelListener.setDie(i, value);\n }",...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Returns whether object is empty or not. Returns whether specified object is empty or not. 'Empty' means that a object is null or 0length String.
protected boolean isEmpty(Object obj) { return (obj == null || obj instanceof String && ((String) obj).trim().length() == 0); }
[ "private static boolean isOEmptyOrNull(Object o) {\n return o == null || isSEmptyOrNull(o.toString());\n }", "public boolean isEmpty()\n {\n return Shortcuts.empty(internalGetDefaultModelObjectAsString());\n }", "public boolean isNotEmpty() {\n\t\treturn ! asString().orElse(\"\").isEmpty(...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
This method was generated by MyBatis Generator. This method sets the value of the database column design_single_option.design_single_option_id
public void setDesignSingleOptionId(String designSingleOptionId) { this.designSingleOptionId = designSingleOptionId == null ? null : designSingleOptionId.trim(); }
[ "public String getDesignSingleOptionId() {\n return designSingleOptionId;\n }", "public void setDesignSingleId(String designSingleId) {\n this.designSingleId = designSingleId == null ? null : designSingleId.trim();\n }", "DesignSingleOption selectByPrimaryKey(String designSingleOptionId);", ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Serializes and writes the value_date_int of the daily_position_performance to the specified buffer.
protected void serializeValueDate(ByteBuffer out, int rowOffset, int value) { out.putInt(20 + rowOffset, value); }
[ "void setHistoricValue(String id, Date date, BigDecimal value);", "void writeDateTime(long value);", "@Override\n public byte[] serialize(Date value) {\n return LONG_SERIALIZER.serialize(value.getTime());\n }", "public static byte[] date2buf(Date d) {\r\n return date2buf(d.getTime());\r\n ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
counts the total number of lines(blocks) in a block (including nested blocks)
public void countBlocks(Block b){ if(b.getNestedBlocks().isEmpty()){ return; } for(int key: b.getNestedBlocks().keySet()){ this.countblocks++; countBlocks(b.getNestedBlocks().get(key)); } }
[ "@Override\n public int countBlocks() {\n int sum = 0;\n return sum + statementListBlock.countBlocks();\n }", "private int countNumberOfStringBlocks() {\n\t\tint counter = 0;\n\t\tString currentLine = \"\";\n\t\t\n\t\twhile (reader.hasNext()) {\n\t\t\tif(currentLine.isEmpty()) {\n\t\t\t\tcurre...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Searches and returns the supplier among the suppliers list by its name.
public Supplier searchSupplier(String name) { for (int i = 0; i < suppliers.size(); i++) { if (name.toLowerCase() == suppliers.get(i).getName().toLowerCase()) return suppliers.get(i); //matching name found in the item list, return it. } return null; //item not found, return null }
[ "public Supplier searchSupplier(int id) {\r\n\t\tfor (int i = 0; i < suppliers.size(); i++) {\r\n\t\t\tif (id == suppliers.get(i).getId())\r\n\t\t\t\treturn suppliers.get(i); //matching name found in the item list, return it.\r\n\t\t}\r\n\t\treturn null; //item not found, return null\r\n\t}", "private BOSupplier ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
/ Name: convertStringToIntArray Process: converts string to int array Method Input/Parameters: keyString (String) Method Output/Parameters: none Method Output/Returned: integer array (int[]) Device Input/Keyboard: none Device Output/Monitor: none Dependencies: Console IO Class Tools
public static int[] convertStringToIntArray(String keyString) { //create variables int index, stringLength, currentInt; char currentChar; int[] finalArray; //create the array with length of the string stringLength = k...
[ "private static int[] convertToIntArray() {\n int[] barcodeInt = new int[BARCODE.length() + 1];\n for (int i = 0; i < BARCODE.length(); i++) {\n barcodeInt[i] = Integer.parseInt(BARCODE.charAt(i) + \"\");\n }\n return barcodeInt;\n }", "private Integer[] convertToInteger(...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Visit a pooled unsigned integer value.
void visitPooledUInt(Long l);
[ "void visitPooledInt(Integer i);", "public UnsignedInt(int unsignedValue)\n {\n this.unsignedValue = unsignedValue;\n }", "UnsignedValue createUnsignedValue();", "public UnsignedInteger(int i) {\n\t\tvalue = new Integer(i);\n\t}", "void visitIntValue(IntValue value);", "public static void traverseUnsigne...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
.ChunkRequest chunkRequest = 10;
entities.Torrent.ChunkRequest getChunkRequest();
[ "int getChunkSize();", "public abstract HttpClientRequest setChunked(boolean chunked);", "long getChunkSize();", "public void setInboundChunk(entity.InboundChunk value);", "public void setChunkSize(int chunkSize) {\n this.chunkSize = chunkSize;\n }", "DataSize getRequestSizeLimitRegular();", "...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
findLongest The find shortest method looks for the shortest song and returns it to the console.
public SongWeiss findShortest() { int shortest = Integer.MAX_VALUE; int i = 0; SongWeiss shortestSong = null; for(i = 0; i < mySize; i++) { if(mySongs[i].getMyMinutes() * 60 + mySongs[i].getMySeconds() < shortest) { shortest = mySongs[i].getMyMinutes() * 60 + mySongs[i].getMySeconds(); short...
[ "public SongWeiss findLongest()\n\t{\n\t\tint longest = Integer.MIN_VALUE;\n\t\tint i = 0;\n\t\tSongWeiss longestSong = null;\n\t\t\n\t\tfor(i = 0; i < mySize; i++)\n\t\t{\n\t\t\tif(mySongs[i].getMyMinutes() * 60 + mySongs[i].getMySeconds() > longest)\n\t\t\t{\n\t\t\t\tlongest = mySongs[i].getMyMinutes() * 60 + myS...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Returns the datasetId set by a Command.
public String getDatasetId() { return (attributes.containsKey(KEY_DATASET_ID) ? (String) attributes .get(KEY_DATASET_ID) : null); }
[ "public Long getDatasetId() {\n return this.datasetId;\n }", "@java.lang.Override\n public java.lang.String getDatasetId() {\n java.lang.Object ref = datasetId_;\n if (ref instanceof java.lang.String) {\n return (java.lang.String) ref;\n } else {\n com.google.protobuf.Byt...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
`status: Not Mapped` coredatatypereference: BIAN::DataTypesLibrary::CoreDataTypes::ISO20022andUNCEFACT::Identifier generalinfo: Reference to the parent Loan Fulfillment Arrangement instance
public String getLoanFulfillmentArrangementInstanceReference() { return loanFulfillmentArrangementInstanceReference; }
[ "com.expedia.www.packagefinder.database.exppackage.ExpPackageProtos.flight getFlightdetails();", "public ExaminationArrangementInfoRecord() {\n\t\tsuper(ExaminationArrangementInfo.EXAMINATION_ARRANGEMENT_INFO);\n\t}", "com.expedia.www.packagefinder.database.exppackage.ExpPackageProtos.flightOrBuilder getFlightd...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Controls whether this cart item can be placed by the Cart and Train Dispensers. Generally, you can ignore the placeCart() function if this returns false.
public boolean canBePlacedByNonPlayer(ItemStack cart);
[ "boolean isCartValid();", "boolean isDealInCart();", "private static boolean canBePlaced(Item item) {\n return Block.getBlockFromItem(item) != null || CLASSES_OF_ITEMS_THAT_CAN_BE_PLACED.contains(item.getClass());\n }", "public boolean canUseMinecarts(Player player) {\n\t\tif (Settings.cartz) {\n\t\...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Sets whether the iterator will iterate through all attachments of all parts that are encountered.
public void setIterateIntoAttachmentsOfParts(boolean flag) { iterateIntoAttachmentsOfParts = flag; initialize(); }
[ "public\t\tvoid\t\tsetIterateIntoAttachmentsOfParts(boolean flag)\n\t\t{\n\t\titerateIntoAttachmentsOfParts = flag;\n\t\t}", "public\t\tboolean\t\tgetIterateIntoAttachmentsOfParts()\n\t\t{\n\t\treturn(iterateIntoAttachmentsOfParts);\n\t\t}", "public\t\tvoid\t\tsetIterateIntoPartsOfParts(boolean flag)\n\t\t{\n\t...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Find the 8k blocks of other that need to change to make the file contents the same. Assumes that other is no longer than this.
public List<Long> changedBlockOffsets(FileState other) { long offset = 0; List<Long> r = new ArrayList<>(); Iterator<Long> i = this.hashes.iterator(); if (other != null) { Iterator<Long> j = other.hashes.iterator(); if (other.hashes.size() > this.hashes.size()) ...
[ "private void compareFirstPass() {\n this.oldFileNoMatch = new HashMap<String, SubsetElement>();\r\n Iterator<String> iter = this.oldFile.keySet().iterator();\r\n while (iter.hasNext()) {\r\n final String key = iter.next();\r\n if (!this.newFile.containsKey(key)) {\r\n ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Get the seed that generated the current map
public int getSeed() { return map.getSeed(); }
[ "public static int getMapSeed() {\n\t\treturn mapSeed;\n\t}", "public int getSeed() {\r\n return seed;\r\n }", "long getSeed();", "public static long getSeed() {\r\n return _seed;\r\n }", "public long getSeed(){\n\t\treturn this.seed;\n\t}", "public void generateRandomMap() {\n\n\t}", ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Create an OffsetPos with the given tag and (0,0) coordinates.
public OffsetPos(String tag) { super(tag); }
[ "Offset createOffset();", "DVector3C getOffsetPosition();", "Position createPosition();", "private void setNewTagPosition() {\n targetX = (float) ((this.dpWidth/2 - tagViewWidth/2 + Math.sin(theta.get()) * R.get() * (this.dpWidth / this.roomWidth)) * this.dpToPx);\n targetY = (float) (((Math.cos...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Returns true if field uploadedLocation is set (has been assigned a value) and false otherwise
public boolean is_set_uploadedLocation() { return this.uploadedLocation != null; }
[ "public boolean is_set_uploadedJarLocation() {\n return this.uploadedJarLocation != null;\n }", "public boolean isLocationSet() {\n \treturn location_ != null;\n \t}", "public boolean is_set_location() {\n return this.location != null;\n }", "public boolean isSetLocation() {\n return th...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Checks if a channel is disabled from appearing in statistics.
public static boolean checkDisabledChannel(Channel channel) { return disabledChannels.contains(channel); }
[ "boolean isDisabled();", "boolean isChannelPresenceTaskEnabled();", "public boolean isDisabled() {\n return isClientRevoked || isAccountLocked;\n }", "boolean isAccountDisabled();", "public boolean isCurrentChannelBlocked() {\n\t\tTVChannel ch = mTvChannelSelector.getCurrentChannel();\n\t\tif (ch ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Constructor: Create a tournament selection strategy with m players.
public Tournament( int m ){ this.m = m; }
[ "public Tournament(){ this(4); }", "public TournamentSelector(int tournamentSize) {\n this.tournamentSize = tournamentSize;\n if (this.tournamentSize < 2) {\n this.tournamentSize = 2;\n }\n }", "protected void SelectTournament() {\n\t // Torneo.length -> tournament size\n\t ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Sets the "InheritAddress" element
public void setInheritAddress(boolean inheritAddress) { synchronized (monitor()) { check_orphaned(); org.apache.xmlbeans.SimpleValue target = null; target = (org.apache.xmlbeans.SimpleValue)get_store().find_element_user(INHERITADDRESS$58, 0); if (targe...
[ "public void xsetInheritAddress(org.apache.xmlbeans.XmlBoolean inheritAddress)\n {\n synchronized (monitor())\n {\n check_orphaned();\n org.apache.xmlbeans.XmlBoolean target = null;\n target = (org.apache.xmlbeans.XmlBoolean)get_store().find_element_user(INHERITADDR...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Provide a menu description, or null to skip it.
@Override protected String getDescription() { return "Welcome to the main menu of the program."; }
[ "public void setMenuDesc(String menuDesc) {\n\t\tthis.menuDesc = menuDesc;\n\t}", "public String getMenuDesc() {\n\t\treturn menuDesc;\n\t}", "@Override\n\tpublic String menuDescription(Actor actor) {\n\t\treturn null;\t\n\t}", "Optional<String> description();", "public void setDescription(String desc) {\n ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
/ The method returns index of first nonrepeating character in a string. If all characters are repeating then returns 1
static int firstNonRepeating(String str) { if (str == null || str.equals("")) return -1; getCharCountArray(str); for (int i = 0; i < str.length(); i++) { if (count[str.charAt(i)] == 1) { return i; } } ...
[ "static int firstNonRepeating(String str) {\n getCharCountArray(str);\n int index = -1, i;\n\n for (i = 0; i < str.length(); i++) {\n if (count[str.charAt(i)] == 1) {\n index = i;\n break;\n }\n }\n\n return index;\n }", "pu...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
/ Create a new employee, looking up their pension id We need to start our flow with either a Mono or Flux. In this case we've modified the original pensionLookup() to return a Mono, so we can start our flow with that. The only trick then is that the setPensionId() call doesn't return anything, and because each step in ...
@PostMapping("/employees") Mono<Employee> newEmployee(@RequestBody Employee newEmployee) { return pensionLookup(newEmployee.getName()) .map(pensionId -> { newEmployee.setPensionId(pensionId); return newEmployee; }) .flat...
[ "@GetMapping(\"/employees/pension\")\n Flux<Employee> pension() {\n return this.repository.findAll()\n .flatMap(employee -> pensionLookup(employee.getName())\n .map(pensionId -> {\n System.out.println(\"Thread: \" + Thread.currentThread().ge...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Play a random music on the list.
public void randomPlay() { int size = musicList.size(); int playnext; if (!musicList.isEmpty()) { playnext = Randomizer.randomInt(0, size - 1); musicTable.setRowSelectionInterval(playnext, playnext); this.play(playnext); } else { ...
[ "public static void playRandomChicken() {\n\t\t\n\t\tString[] chickenSoundArray = {\"chicken1\", \"chicken2\", \"chicken3\"};\n\t\t\n\t\tint rnd = new Random().nextInt(chickenSoundArray.length);\n\t\tplaySound(chickenSoundArray[rnd],0.5f);\n\t}", "public void playAudio() {\n\t\tmusic[currentSong].stop();\n\t\tcur...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
10.doubleTree() > create a duplicate of each node and place it to its left
public void doubleTree(Node root){ if(root == null){ return; } Node current = root; Node newNode = new Node(current.data); if(current.left != null){ Node temp = current.left; current.left = newNode; current.left.left = temp; ...
[ "private static Node buildSmallerTree() {\n\t\tNode root = createNode(10);\n\t\troot.leftChild = createNode(25);\n\t\troot.rightChild = createNode(25);\n\t\troot.leftChild.leftChild = createNode(13);\n\t\troot.rightChild.rightChild = createNode(7);\n\t\troot.leftChild.rightChild = createNode(27);\n\t\t\n\t\treturn ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
////////////////////////IMAGE PROCESSING FUNCTIONS///////////////////////////// A safe way to get an instance of the Camera object.
public static Camera getCameraInstance(){ Camera c = null; try { c = Camera.open(); // attempt to get a Camera instance } catch (Exception e){ // Camera is not available (in use or does not exist) } return c; // returns null if camera is unavailable }
[ "private static Camera getCameraInstance(){\n\t Camera c = null;\n\t try {\n\t c = Camera.open(); // attempt to get a Camera instance\n\t }\n\t catch (Exception e){\n\t // Camera is not available (in use or does not exist)\n\t }\n\t return c; // returns null if camera is unavailable\...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Test of hasPrevious method, of class oasisListIterator.
@Test public void testHasPrevious_Start() { OasisList<Integer> baseList = new SegmentedOasisList<>(); baseList.addAll(Arrays.asList(1, 2, 3, 4, 5)); ListIterator<Integer> instance = baseList.listIterator(); boolean expResult = false; boolean result = instance.hasPrevious(); ...
[ "public boolean hasPrevious();", "@Test\n public void testListIteratorHasPrevious(){\n DoubleLinkedList<Integer> list1 = new DoubleLinkedList<Integer>();\n ListIterator<Integer> list1It = list1.iterator();\n assertFalse(\"testing with no previous element\", list1It.hasPrevious());\n list1It.add(1);\n...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Creates an HTTP request to add a particular food to be available at a building.
public static boolean addFoodToBuilding(int foodId, int buildingId) { String params = "food=" + foodId + "&building=" + buildingId; return sendPost("addFoodToBuilding", params); }
[ "public static boolean addFoodToReservation(int foodId, int reservationId, int quantity) {\n String params = \"food=\" + foodId + \"&reservation=\" + reservationId + \"&quantity=\" + quantity;\n return sendPost(\"addFoodToReservation\", params);\n }", "public static boolean addFoodToReservation(i...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Compares the Edge of the current index to its children, and swaps the Edge with its lowest child then recursively calls itself on the child's index
public void downHeap( int index ) { int i = 0;//represents the smallest child of the index if( ( 2*index )+2 < size ) { //checks if the index has 2 children //compares the two children if( array[ (2*index)+2 ].getWeight() < array[ (2*index)+1 ].getWeight() ) { ...
[ "private static void pushDown(int[]data,int size,int index){\n while (index * 2 + 1 < size){ //has at least one child (not a leaf)\n if (index * 2 + 2 < size){ //has two children\n int child1 = data[index * 2 + 1];\n int child2 = data[index * 2 + 2];\n if (child1 > child2 && child1 > da...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
This method was generated by MyBatis Generator. This method returns the value of the database column dbo.FLOW_CodeRule.pk
public Integer getPk() { return pk; }
[ "@Override\n\tpublic long getPrimaryKey() {\n\t\treturn _rule.getPrimaryKey();\n\t}", "@Override\n\tpublic long getPrimaryKey() {\n\t\treturn _codeDto.getPrimaryKey();\n\t}", "public Integer nextPK() throws DatabaseException {\n\t log.debug(\"Model nextPK Started\");\n\t Connection conn = null;\n\...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
set a call back for setting config.
void setSettingConfigCallback(SettingConfigCallback callback);
[ "void setCallback(Callback callback);", "void setCallback(Object callback);", "public void setConfig(java.lang.String value);", "public void asyncSetOfconfig(){\n\t\tRunnable task = new Runnable() {\n\t\t\t@Override\n\t\t\tpublic void run() {\n\t\t\t\ttry {\n\t\t\t\t\twebMonitor.setConfiguration(true);\n\t\t\...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
================================================================================== REPLAY FACTORY API ==================================================================================
@Override public ReplayFactoryApi getReplayFactoryApi() { return this; }
[ "Repetition createRepetition();", "Ressource createRessource();", "RDRS createRDRS();", "<PS extends ClientSession> SessionPreview<PS, D> newPreview();", "public static PreviewManager newInstance(){return new PreviewManager();}", "GameDescription createGameDescription();", "PlayerDescription createPlaye...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Construct and returns a new 1d matrix of the corresponding dynamic type, entirelly independent of the receiver. For example, if the receiver is an instance of type DenseObjectMatrix2D the new matrix must be of type DenseObjectMatrix1D, if the receiver is an instance of type SparseObjectMatrix2D the new matrix must be o...
public ObjectMatrix1D like1D(int size) { return new SparseObjectMatrix1D(size); }
[ "protected abstract T createMatrix( int numRows, int numCols, MatrixType type );", "abstract protected Matrix getMatrixOfSameType(int rows, int cols);", "Matrix createMatrix();", "public T createLike() {\n return createMatrix(numRows(), numCols(), getType());\n }", "public MatrixFactory<?> getMatr...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Set the value related to the column: examination_date
public void setExaminationDate (java.util.Date examinationDate) { this.examinationDate = examinationDate; }
[ "public void setExamdate(Date examdate) {\n this.examdate = examdate;\n }", "public void setExamDate(Date examDate) {\n this.examDate = examDate;\n }", "void setExpDate(Date value);", "void setEffDate(Date value);", "void setDateValue(final Date dateValue);", "public void setDate (Date...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
end OrdinaryItem increaseQuantity tests PerishableItem increaseQuantity tests
@Test public void testPerishableIncreaseQuantity() throws StockException { Item icecream = new PerishableItem(null, 0, 0, 0, 0, -12); ItemStock is = stock.addNewItem(icecream, 40); stock.increaseQuantity(is.getItemID(), 200); assertEquals(240, stock.stockTotal()); }
[ "public void increaseQuantity() {\r\n\t\tthis.quantity++;\r\n\t}", "void increaseQuantity(OrderId orderId, OrderItemId orderItemId);", "public void reduceQuantity();", "@Test\r\n\tpublic void testUpdateQuantity() throws IdNotContainedException { \r\n\t\tint initialQuantity = menu.findItemId(\"DES006\").getQu...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
A commaseparated list of Hadoop configuration files
public final String getHadoopConfigurationFiles() { return properties.get(HADOOP_CONFIGURATION_FILES_PROPERTY); }
[ "List<String> getConfigFilePaths();", "public abstract List<String> listConfigs() throws IOException;", "public abstract List<String> getAllConfigFiles(String configName) throws IOException;", "private List<String> configFileCandidates() {\n val home = System.getProperty(\"user.home\");\n return...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
setup previous month and check for calendar range
public void setPreviousMonth() { if (month.get(GregorianCalendar.MONTH) == month .getActualMinimum(GregorianCalendar.MONTH)) { month.set((month.get(GregorianCalendar.YEAR) - 1), month.getActualMaximum(GregorianCalendar.MONTH), 1); Singleton.getInstance...
[ "private void setPreviousMonth() {\r\n if (mGregorianCalendar.get(GregorianCalendar.MONTH) == mGregorianCalendar\r\n .getActualMinimum(GregorianCalendar.MONTH)) {\r\n mGregorianCalendar.set((mGregorianCalendar.get(GregorianCalendar.YEAR) - 1),\r\n mGregorianCalend...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Unsets the "RaceList" element
void unsetRaceList();
[ "void setNilRaceList();", "public void unsetRaceCode()\n {\n synchronized (monitor())\n {\n check_orphaned();\n get_store().remove_element(RACECODE$18, 0);\n }\n }", "void unsetList();", "public void reset() {\n\t renderList.reset();\n\t rlistInvalid = tr...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
todo some method to shuffle your table return type Stream probably should be not the random shuffles
private static Stream<List<String>> shuffles(List<Integer> inititalList,List<String> zer,List<String> one, String function) { List<String> result = new ArrayList<>(); List<Integer> lst = new ArrayList<>(inititalList); List<Integer> lst2 = new ArrayList<>(inititalList); Collections.shuffl...
[ "default Stream<T> reshuffle() {\n return reshuffle(null);\n }", "public void randomizeFanIn() {\n for (Synapse synapse : getFanIn()) {\n synapse.randomize();\n }\n\n }", "private TableData generateTable(RowOrganizedProto.RowOrganizedPackage.Table stachTable) {\n TableData...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Conversions from Feet Per Second
public static double feetPerSecondToCentiMetresPerSecond(double num) { return (num*30.48); }
[ "private double feetToMetersConversion(double valueInFeet){\n double valueInMeters;\n valueInMeters = valueInFeet / FEET_TO_METER_SCALAR;\n return valueInMeters;\n }", "private double metersToFeetConversion(double valueInMeters){\n double valueInFeet;\n valueInFeet = valueInM...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
If you know that this Value is definitely a Sexpr, this method does the casting for you in a nice, pipelined fashion.
default Sexpr asSexpr() { return (Sexpr) this; }
[ "public Object visit(CastExpr node) {\n node.getExpr().accept(this);\n return null;\n }", "public StringExpression stringValue() {\n if (stringCast == null) {\n stringCast = Expressions.stringOperation(Ops.STRING_CAST, mixin);\n }\n return stringCast;\n }", "p...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Sets the type name input field's text to the given value. Method doesn't update the model.
public void setTypeName(String name, boolean canBeModified) { fTypeNameDialogField.setText(name); fTypeNameDialogField.setEnabled(canBeModified); }
[ "public void setTypeName(java.lang.String value);", "public void setNameFieldText(String text) {\n nameField.setText(text);\n }", "public void typeUserName(String text) {\n txtUserName().typeText(text);\n }", "public void setpermitTypeName(String value) {\n setAttributeInternal(PERM...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
This method does the murders count and the weapon used.
public void countMurdersAndWeapons() { for (LogLineData d : dataList) { int killerIdex = getKillerIndex(d.getKillerName()); if (!d.getKillerName().equals("<WORLD>")) { if (killerIdex == -1) { Soldier s = new Soldier(d.getKillerName()); s.getWeapons().put(d.getWeaponName(), 1); s.setMurdersNum...
[ "public int checkForWeapons(){\r\n int totalAttackBoost = 0;\r\n \r\n for(int i = 0; i < playerInventory.size(); i++){\r\n if(playerInventory.get(i).name.toLowerCase().equals(\"dagger\")){\r\n totalAttackBoost = totalAttackBoost + 2;\r\n }\r\n else if(playerInventory.get(i).name.toLow...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
This method was generated by MyBatis Generator. This method sets the value of the database column neeq_company_industry_rating.research_institute_shortname
public void setResearchInstituteShortname(String researchInstituteShortname) { this.researchInstituteShortname = researchInstituteShortname; }
[ "public String getResearchInstituteShortname() {\r\n return researchInstituteShortname;\r\n }", "public void setInstitute(String institute) {\n this.institute = institute;\n }", "public void setInstitute(String aInstitute) {\n\t\tinstitute = aInstitute;\n\t}", "public String getResearchIns...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Create an instance of Value given an JSON string
public static Value fromJson(String jsonString) throws IOException { return JSON.getGson().fromJson(jsonString, Value.class); }
[ "public Object fromJson(String stringObject, Class<?> clazz);", "public static Value create(JsonObject jsonObject)\n {\n Object[] edma_pair = new Object[2];\n edma_pair[0] = 5;\n edma_pair[1] = ((IValueInstance) jsonObject).edma_getValue();\n return new ValueImpl(edma_pair);\n }"...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Gets the value of the totalCpuCapacityMhz property.
public int getTotalCpuCapacityMhz() { return totalCpuCapacityMhz; }
[ "public void setTotalCpuCapacityMhz(int value) {\n this.totalCpuCapacityMhz = value;\n }", "public long getCpuReservationUsedMhz() {\n return cpuReservationUsedMhz;\n }", "public int getCpuReservationMhz() {\n return cpuReservationMhz;\n }", "public long getCpuReservationMhz() {\...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Sets the value of the 'field678' field.
public void setField678(java.lang.CharSequence value) { this.field678 = value; }
[ "public com.maxpoint.cascading.avro.TestExtraLarge.Builder setField678(java.lang.CharSequence value) {\n validate(fields()[678], value);\n this.field678 = value;\n fieldSetFlags()[678] = true;\n return this; \n }", "public void setField567(java.lang.CharSequence value) {\n this.field567 ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Turn Coordinates JSON to String from Assets folder
public String loadCoordinatesFromAsset() { String json; try { InputStream inputStream = mContext.getAssets().open("coordinates.json"); int size = inputStream.available(); byte[] buffer = new byte[size]; inputStream.read(buffer); inputStream.clo...
[ "private String loadJsonString()\n {\n String json = null;\n try{\n AssetManager assetManager = gameView.getContext().getAssets();\n InputStream input = assetManager.open(levelName + \".json\");\n int size = input.available();\n\n byte[] buffer = new byte...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Adds a comment to the current element of the DOM Document.
public void addComment(String comment);
[ "@Override\n public void addComment(XmlElement xmlElement) {\n\n }", "private void addComment() {\r\n Editor classEditor = null;\r\n try {\r\n classEditor = curClass.getEditor();\r\n } catch (Exception e) {\r\n }\r\n if (classEditor == null) {\r\n Sys...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Returns the curator database client used by this
public CuratorDatabaseClient database() { return db; }
[ "public CuratorDb database() { return db; }", "public SqlManagementClientImpl getClient() {\n return this.client;\n }", "private MongoClient getClient() {\n if (client == null) {\n initClient();\n }\n return client;\n }", "public AdpDBClient getAdpDBClient() {\n ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
hace el PARAM de cada parametro
public String parametro (String param){ return "PARAM,,," + param + "\n"; }
[ "java.lang.String getParams();", "public abstract String getParameters();", "java.lang.String getParams1();", "Parameter[] getParameters();", "java.lang.String getParam();", "public List getParameterNames();", "String getParam();", "@Override\n public void getParams(Map<String, String> param) {\n ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
convert protos message bean and normal java bean
public interface ProtosMessageConverter { MessageWrapper convertFromProtos2Bean(Message msg) throws Exception; Message convertFromBean2Protos(MessageWrapper wrapper) throws Exception; }
[ "public abstract Object fromProtoValue(Object in);", "@Mapper(componentModel = \"spring\",\n uses = { LongDateMapper.class },\n nullValueCheckStrategy = NullValueCheckStrategy.ALWAYS,\n collectionMappingStrategy = CollectionMappingStrategy.ADDER_PREFERRED)\npublic interface ProtobufMapper {\n...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
/ Constructors Creates a new WrapperServicePauseEvent.
public WrapperServicePauseEvent( int actionSourceCode ) { super( actionSourceCode ); }
[ "public ServiceEvent() {\n // eventSenderID and eventSenderClass are initialized by the OperatingSystem! \n }", "public QPEvent() {}", "public Servicepoint(int serviceID, String name, ContinuousGenerator generator, Engine engine, EventType eventType, boolean skippable){\n\t\tthis.engine = engine;\n\t\...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Gets ending column where error happened.
public int columnEnd() { if (context != null) return context.columnEnd(); return -1; }
[ "public int getErrorColEnd() {\n return this.node!=null ? node.getEndCol() : -1;\n }", "public int getErrorCol() {\n return this.node!=null ? node.getBeginCol() : -1;\n }", "public int getEndColumn() {\n return endcolumn;\n }", "public int getEndColumn() {\n\t\treturn endColumn;\n\t}",...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Divides two NumberP variables.
public static NumberP Division(NumberP first, NumberP second) { return OperationsManaged.PerformArithmeticOperation ( first, second, ExistingOperations.Division ); }
[ "public double divisao (double numero1, double numero2){\n\t}", "double div(int a, int b);", "public int division(int a, int b) {\n return a / b;\n }", "BaseNumber divide(BaseNumber operand);", "static RVector div(RVector a, RVector b) {\n RVector c = new RVector(a.x/b.x, a.y/b.y);\n return c;\...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Add the given mapping for a (simple) java class that should be represented by an empty schema.
public final SimpleTypeModule withEmptySchema(Class<?> javaType) { return this.with(javaType, SchemaKeyword.TAG_TYPE_NULL, null); }
[ "public void addMapping(IMapping def) throws JiBXException {\n\n // create structure if not already done\n if (m_mappings == null) {\n m_classMap = new ArrayMap();\n m_mappings = new ArrayList();\n }\n\n // check for conflict on class name before adding to definitio...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Tests playing a money lender when there is no copper in hand.
@Test //can play moneylender with no copper, but nothing happens public void testMoneyLenderNoCopper(){ getNewState(4); DominionDeckState deck = state.getDominionPlayers()[currPlayer].getDeck(); setupSpecialHand(deck); DominionCardState moneyLender = shopCards.get(MONEY_LENDER)....
[ "@Test\n public void testMoneyLenderWithOneCopper(){\n getNewState(4);\n DominionDeckState deck = state.getDominionPlayers()[currPlayer].getDeck();\n setupSpecialHand(deck);\n\n assertEquals(shopCards.get(MONEY_LENDER).getCard(), deck.getHand().get(4));//money lender is 4th card\n ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Sets this tableview's content insets. A table view is essentially a scroll view that contains a set of static row views that represents the content. Thus, the setContentInsets method facilitates a margin, or inset, distance between the content and the container scroll view. Typically used with the headerPullView proper...
public native void setContentInsets(TableViewEdgeInsets value, boolean animate) /*-{ var jso = this.@com.emitrom.ti4j.core.client.ProxyObject::getJsObj()(); jso.setContentInsets( value.@com.emitrom.ti4j.core.client.ProxyObject::getJsObj()(), { animated : animate }); }-*/;
[ "public native void setContentInsets(TableViewEdgeInsets value) /*-{\n\t\tvar jso = this.@com.emitrom.ti4j.core.client.ProxyObject::getJsObj()();\n\t\tjso\n\t\t\t\t.setContentInsets(value.@com.emitrom.ti4j.core.client.ProxyObject::getJsObj()());\n }-*/;", "public native void setContentInsets(TableViewEdgeInset...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Callback for the create album button. Creates a new album from the search results
public void createAlbum() { // System.out.println("got in here and now im in buisness"); String albumName=albumname.getText(); albumname.setText(""); if(albumName.equals("")){ showAlert("No name given"); return; } Album album = new Album(albumName); if(user.getAlbums().contains(album)) { showAlert...
[ "@FXML\r\n\tprotected void createFromSearch(ActionEvent event) throws IOException \r\n\t{\r\n\t\tDialog<Album> d = new Dialog<>();\r\n\t\td.setTitle(\"Create an Album\");\r\n\t\td.setHeaderText(\"Add the searched photos into an album.\");\r\n\t\td.setResizable(true);\r\n\t\t \r\n\t\tLabel albumLabel = new Label(\...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
We can only print if our parent is printed and setup. We do this so that circular dependencies don't cause errors.
private void checkParentPrinted(JavaClass child) { if (this.parent == null || this.parent.isPrinted) child.alertPrint(); else this.parent.childClasses.add(child); }
[ "public void printSelf() {\n\t\tSystem.out.println(\"I am a child!\");\n\t}", "public void printInfo(){\r\nsuper.printInfo();\t//to call hidden method printInfo()\r\nthis.printWickets();\t//to print wickets\r\n}", "public void print() {\n\t\tPrinter.print(doPrint());\n\t}", "public void printOutput() {\n\t\t/...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
This validates the first header of a wave file. This method was written in response to QTJ's MovieExporter occasionally converting MP3s to a wave file incorrectly. The resulting wave file contained all the correct PCM data, but the chunk size of the "RIFF" and "data" chunks are zero. This method only validates the firs...
public static boolean isValidSizeHeader(File wavFile) { long realFileSize = wavFile.length(); FileInputStream in = null; byte[] array = new byte[4]; try { in = new FileInputStream(wavFile); read(in, array, 4); String chunkID = readString(array, 0, 4); if (!chunkID.equals("RIFF")) { return fal...
[ "void validateHeader_HMP457( ){\n//\t\tHeader_HMP5 pcHeader = (const HMP::Header_HMP5*)mBuffer;\n\t\tHeader_HMP5 pcHeader = header_HMP5.load(mBuffer);\n\n//\t\tif (120 > iFileSize)\n//\t\t{\n//\t\t\tthrow new DeadlyImportError(\"HMP file is too small (header size is 120 bytes, this file is smaller)\");\n//\t\t}\n\n...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Creates a new cluster set where each edge and cluster in the new cluster set correspond 1to1 with those in the original graph
public ClusterSet createEquivalentClusterSet(Graph anotherGraph) { ClusterSet newClusterSet = new EdgeClusterSet(anotherGraph); for (Iterator cIt=iterator();cIt.hasNext();) { Set cluster = (Set) cIt.next(); Set newCluster = new HashSet(); for (Iterator udcIt=cluster.i...
[ "ClusterSet() {\r\n\t\tC= new TreeSet<Cluster>();\r\n\t}", "private HashSet<Cluster> transitivity(HashSet<Cluster> obj1clusters,\n\t\t\tHashSet<Cluster> relclusters, HashSet<Cluster> obj2clusters) {\n\t\tHashSet<Cluster> clusters = new HashSet<Cluster>();\n\t\t\n\t\tArrayList<Integer> ignoreUs = new ArrayList<Int...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Indicates whether some other trader is "equal to" this one, based on comparing their screen names case blind. This method will throw a ClassCastException if other is not an instance of Trader.
public boolean equals(Object other) { return compareTo( (Trader)other ) == 0; }
[ "@Override\r\n public int compareTo( Trader other )\r\n {\r\n return screenName.toLowerCase().compareTo( other.screenName.toLowerCase() );\r\n }", "public boolean equals(ModernAccidental other)\n {\n if (other==null)\n return false;\n\n if (this.accType==ACC_NONE)\n return this.pi...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Increments the observed transmission count c(word, tag)
public void incrementObservedEmissionCount(int word, int tag) { String key = makeKey(word, tag); // if(debugMode) System.out.println("incrementing emission count:"+key); if(!countWordTag.containsKey(key)) { countWordTag.put(key, Probability.ZERO); // if(debugMode) System.out.printf("adding (%d = %d) aka (%s =...
[ "public void increment(){\n\t\twordCount += 1;\n\t}", "public void incrementNumberTaggedWordTokens() {\n\t\tnumberWordTagTokens++;\n\t}", "public void incrementNewCountOfWord(String word) {\n\t\tString key = makeKey(getKeyFromWord(word));\n//\t\tSystem.out.printf(\"incrementing new word count: word:%s c:%s\\n\"...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Drives forward using encoder values
private void driveForwardEnc() { //drive.setPos(0, 0, Config.Auto.encDriveForwardDistance, Config.Auto.encDriveForwardDistance); }
[ "void turnUsingEncoder(double degrees, double power);", "public void spin_with_encoderr(DcMotor left_back_motor, DcMotor left_front_motor,\n DcMotor right_back_motor, DcMotor right_front_motor,\n double power , int Given_Degree , char direction,boo...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
setAffectiveListener method provides connection listener to graph plot
public void setAffectiveListener(AffectiveColorService affectiveColorService) { affectiveGraphPlot.setAffectiveListener(affectiveColorService); }
[ "void addListener(GraphListener listener);", "public void addConnectedCallback(OctaveReference listener) {\n\t\tlistenerConnected.add(listener);\n\t}", "public abstract void setListeners();", "void setListener(Listener listener);", "public interface GraphListener extends java.util.EventListener {\n /**\n...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
This returns a thread safe receive queue. Pulling an item off of the queue makes it unavailable to other thread.
ReceiveQueue<T> receiveQueue();
[ "public T dequeue() {\n // stores element in temporary variable to return\n T element = queue.remove();\n\n return element;\n }", "@Override\n public synchronized QueueMessage pull(String queueName, long visibilityTimeout) {\n int startReadLocation = this.readQueueLocation;\n ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Queries the Contacts database with the given contact URI and returns whether the query runs successfully.
@WorkerThread boolean query(@NonNull String contactUri) { if (TextUtils.isEmpty(contactUri)) { return false; } Uri uri = Uri.parse(contactUri); if ("tel".equals(uri.getScheme())) { return queryWithPhoneNumber(uri.getSchemeSpecificPart()); } else if ("m...
[ "private boolean loadContactsFromDB() {\n // Reset the Contacts List First\n this.contacts.clear();\n String sql = \"SELECT ctnContactID, ctnContactTypeID, ctnContact, typContactType FROM pmp_contacts, pmp_ctypes WHERE (typContactTypeID = ctnContactTypeID) AND (ctnPersonID = '\"+this.personID+\...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Helper method to percolate down the maximum levels of the minmax heap.
private void percolateDownMax(int hole) { int grandChild; // The nearest descendants of 'hole' also in a max level are its // grandchildren. // First consider levels with a complete set of grandchildren. while (hole * 4 + 3 <= currentSize) { grandChild = hole * 4; // Find the largest grandchild. in...
[ "private void heapify() {\n for (int i = minHeap.size() / 2; i >= 0; i--) {\n heapifyDown(i);\n }\n }", "private void downHeapMAX(int arrayIndex){\n\t\tint index = arrayIndex;\n\t\twhile(index*2 <= elementCount){\n\t\t\tint indexOfChild = 2*index;\n\t\t\t\n\t\t\tif(indexOfChild < eleme...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Returns the right neighbour of the triangle located at the given index position
public Triangle getRightNeighbour(int index) { Triangle current = getTriangle(index); if (current == null) return null; Triangle rightNeighbour = getTriangle(index+1); if (rightNeighbour == null || rightNeighbour.getY() != current.getY()) return null; return rightNeighbour; }
[ "private int get_right_child(int index){\r\n return 2 * index + 2;\r\n }", "private int getRightChild(int index) {\n\t\treturn 2 * index + 2;\n\t}", "private int rightChild(int index) {\n\t\treturn index * 2 + 1;\n\t}", "int getRight(int index) {\n boundsCheck(index);\n index *= SIZEOF_NOD...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Test of infoProveedor method, of class CtrlUsuarios.
@Test public void testInfoProveedor() throws Exception { System.out.println("infoProveedor"); //DTUsuario("jorge2", "N1", "A1", "jorge2@gmail.com", null, new Date(1992, 11, 10)) ctrlUsuarios.seleccionarProveedor("jorge2"); DTProveedor result = ctrlUsuarios.infoProveedor(); assertEquals((new DTProveedor("jorge2...
[ "@Test\n\tpublic void testIngresarDatosProveedor() {\n\t\tSystem.out.println(\"ingresarDatosProveedor\");\n\t\tctrlUsuarios.ingresarDatosProveedor(\"\", \"\");\n\t}", "@Test\n\tpublic void testInfoCliente() throws Exception {\n\t\tSystem.out.println(\"infoCliente\");\n\t\tctrlUsuarios.seleccionarCliente(\"jorge1\...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
if take==true returns the take demand otherwise returns the return demand
DemandResult getDemand(int hour, boolean take) { if (take) { return new DemandResult(true, data[hour][0] / (double) data[hour][2]); } else { return new DemandResult(true, data[hour][1] / (double) data[hour][2]); } }
[ "public Take getTake();", "public boolean hasTake();", "Runnable take();", "public double getDemand(){\r\n //calculate demand based off of external factors. Ex) military\r\n //or sporting events like the super bowl\r\n \r\n // For now, generate a random number (uniform) from .9 to ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
when calibaration ends successfully or unsucessfully
public void onEndCalibration(int userId, boolean successfull) { println("Calibration of userId: "+userId+", successfull: "+successfull); if (successfull) { println(" User calibrated !!!"); kinect.saveCalibrationDataSkeleton(userId, "calibration.skel"); // begin skeleton tracking ...
[ "void finishCalibration();", "public void onCalibrationFinished() {\n\t\tLog.d(\"&5\", \"onCalibrationFinished\");\n\t\tshowMessageOnUI(\"onCalibrationFinished(): starting positioning.\");\n\t\tvib.vibrate(100);\n\t\tcalibrated = true;\n\t\tindoorAtlas.startPositioning(buildingId, levelId,\n\t\t\t\tBuilding_Data....
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Return synonyms for all senses
public Map<String, Set<String>> getAllSynonyms() { Map<String, Set<String>> set = new HashMap<>(); if (pos == null) return set; POS wnPos = PosUtils.getWordNetPOS(pos); if (dict == null || wnPos == null) return set; try { String lemma_ = getLem...
[ "List<String> getSynonyms();", "String getSynonyms();", "public Vector getSynonyms() {\n return getSynonyms(false);\n }", "public List<String> getSynonyms() {\n return synonyms;\n }", "public Set<String> getSynonyms() {\n Set<String> synonyms = new TreeSet<>();\n if (pos == null)\n ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Generates a Set of 4digit Prime numbers
public static void generateFourDigitPrimeNumbers() { // Generate prime numbers from 2 ... 9999 Queue<Integer> original = new LinkedList<Integer>(); for(int i = 2; i <= 9999; i++) { original.add(i); } Queue<Integer> primesQueue = new LinkedList<Integer>(); while(!original.isEmpty()) { // Add the first ...
[ "private void genPrimes(){\n long longBitSetLimit = Long.parseLong(this.LIMIT);\n this.primeBitSet.set(0,false); // 0 is not a prime\n this.primeBitSet.set(1,false); // 1 is not a prime\n for (long p = 2; p < longBitSetLimit; p++) this.primeBitSet.set(p,true); // set [2,LIMIT) prime\n ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Getter method for property powerdivisiontype.
public String getPowerdivisiontype() { return powerdivisiontype; }
[ "public void setPowerdivisiontype(String powerdivisiontype) {\n\t\tthis.powerdivisiontype = powerdivisiontype;\n\t}", "public String getPowerType() {\n return this.powerType;\n }", "public String getPowerdivisionindex() {\n\t\treturn powerdivisionindex;\n\t}", "public PowerUpType getType() {\n\t\tre...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
/ This method calculates the annual raise and implemented by subclass
public abstract void annualRaise();
[ "public void annualRaises()\n {\n for (int t = 0; t < currentEmployees; t++)\n {\n employees[t].annualRaise();\n }\n }", "@Override\npublic double earnings()\n{\n return getCommissionRate() * getGrossSales()*CalculateAppointmentDate()+CalculateBirth();\n}", "double getAnn...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Returns if this JVM runs on the Linux operating system.
public static boolean isLinux() { return Bootstrap.IS_LINUX; }
[ "private boolean osIstLinux() {\n\t\treturn System.getProperty(\"os.name\").equals(\"Linux\");\n\t}", "public static boolean isLinux(){\n return LINUX;\n }", "public static boolean isLinux() {\n return getOsName().startsWith(\"Linux\");\n }", "public static boolean isLinux() {\n\t\treturn osName...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
See the engineering note in MemoizedFunctionTest, which discusses how and why we're calling mock() like this.
@Test public void makeOnlyOnce() throws Exception { @SuppressWarnings("unchecked") BiFunction<Integer, Integer, Integer> spyAdder = mock(BiFunction.class, AdditionalAnswers.delegatesTo(adder)); final BiFunction<Integer, Integer, Integer> memoizedAdder = MemoizedBiFunction.make(spyAdder); verify(spy...
[ "public void testMock(){\n\t}", "@Test\n\tpublic void testFindRedundantInvocations() {\n\t\tList mockedList = mock(List.class);\n\n\t\t// using mocks\n\t\tmockedList.add(\"one\");\n\t\tmockedList.add(\"two\");\n\n\t\tverify(mockedList).add(\"one\");\n\n\t\t// following verification will fail\n\t\tverifyNoMoreInte...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Reads tessdata/configs/tess_configvars and setVariable on Tesseract engine. This only works for
void controlParameters(Tesseract instance) throws Exception { File configvarsFilePath = new File(datapath, CONFIG_PATH + CONFIGVARS_FILE); if (!configvarsFilePath.exists()) { return; } String str = Utils.readTextFile(configvarsFilePath); for (String line : str.split...
[ "public void setConfig(){\n\t\t//instance & read file -> get settings\n\t\tif(config==null) config = Config.getInstance();\n\t\tconfig.init();\n\t\trefreshUserConfig();\n\t\t//read & set values from powershell\n\t\tconfig.setIp(powerShell.command(\"system\", \"ip\", false));\n\t\tconfig.setHost(powerShell.command(\...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Restore to the previous position before the first call to writeEntry64() or writeEntryArray() methods.
private void outRestore() throws IOException { if (lastWriteOffset > 0) { outSeek(lastWriteOffset); lastWriteOffset = -1; } }
[ "public void restoreInsertionPoint() {\n if (savedElement == null) {\n throw new IllegalStateException(\"Insertion point not saved\");\n }\n\n currentElement = savedElement;\n currentPosition = savedPosition;\n\n savedElement = null;\n savedPosition = null;\n ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Creates a new instance of CommonSettings
protected CommonSettings() { port = 1099; objectName = "library"; }
[ "public static CommonConstants InstanceOf(){\r\n if (globalConstants == null){\r\n globalConstants = new CommonConstants();\r\n }\r\n return globalConstants;\r\n }", "public static SeoConfig getCommonConfig() {\n //return DEBUG_FORCERELOAD ? readDefaultCommonConfig() : Co...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
The interface for handling events when the account info are reloaded.
public interface AccountInfoChangeListener { /** * This method will be called whenever the AccountInfoProvider reloads the * accounts. */ public void onAccountInfoChange(); }
[ "void handleAccountManagerEvent(AccountManagerEvent event);", "public void refreshAccountInformation() {\n ((gw.api.domain.account.AccountSyncable)__getDelegateManager().getImplementation(\"gw.api.domain.account.AccountSyncable\")).refreshAccountInformation();\n }", "public void refreshAccountInformatio...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
The executeAction method takes in actionInfo and runs the action code
public void executeAction( String actionInfo );
[ "static public void performAction(String actionName) {\n FileObject myActionsFolder = FileUtil.getConfigFile(\"Actions/Edit\");\n FileObject[] myActionsFolderKids = myActionsFolder.getChildren();\n for (FileObject fileObject : myActionsFolderKids) {\n //Probably want to make this mor...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Getter method for the COM property "oncontrolselect"
@DISPID(-2147412033) //= 0x800117bf. The runtime will prefer the VTID if present @VTID(19) @ReturnValue(type=NativeType.VARIANT) java.lang.Object oncontrolselect();
[ "@DISPID(-2147412033) //= 0x800117bf. The runtime will prefer the VTID if present\n @VTID(18)\n void oncontrolselect(\n @MarshalAs(NativeType.VARIANT) java.lang.Object p);", "@DISPID(-2147412075)\n @PropGet\n java.lang.Object onselectstart();", "@DISPID(1610874885) //= 0x60040005. The runtime will prefer...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Creates the panel included in the footer of this dialog. They contain the action buttons.
private JPanel createFooterButtons() { GridLayout layout = new GridLayout(1,2); layout.setHgap(10); JPanel footer = new JPanel(layout); footer.add(okButton); footer.add(cancelButton); return footer; }
[ "private void createFooter() {\n okButton = new JButton(new OKAction());\n JPanel footerPanel = new JPanel(new MigLayout(\"fill, insets 0 15 10 15\"));\n footerPanel.add(okButton, \"alignx right, aligny bottom, split, tag ok\");\n footerPanel.add(new JButton(new CancelAction()), \"aligny...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Returns number of columns in a file
private int numberOfColumns(String filename) { String data = (String) fileNameAndData.get(filename); // get the last line data = data.substring(data.lastIndexOf("\r\n")); return data.length() - data.replaceAll(",", "").length(); }
[ "int getNumOfColumns();", "public int getNumColumns();", "private static int getNumFieldsInTDF(File file) throws FileNotFoundException, IOException {\n\n // open the file\n CSVReader reader = new CSVReader(new FileReader(file), VariantManagerUtils.FIELD_DELIMITER.charAt(0), CSVWriter.DEFAULT_QUOTE...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Test case number: 2 / 5 covered goals: 1 org.apache.commons.collections4.comparators.ComparableComparator.equals(Ljava/lang/Object;)Z: I13 Branch 3 IFEQ L124 false 2 org.apache.commons.collections4.comparators.ComparableComparator.()V: rootBranch 3 org.apache.commons.collections4.comparators.ComparableComparator.compar...
@Test public void test2() throws Throwable { fr.inria.diversify.sosie.logger.LogWriter.writeTestStart(864,"org.apache.commons.collections4.comparators.ComparableComparatorEvoSuiteTest.test2"); ComparableComparator<Integer> comparableComparator0 = new ComparableComparator<Integer>(); ComparableComparat...
[ "@Test\n public void test1() throws Throwable {\n\t\tfr.inria.diversify.sosie.logger.LogWriter.writeTestStart(863,\"org.apache.commons.collections4.comparators.ComparableComparatorEvoSuiteTest.test1\");\n ComparableComparator<Integer> comparableComparator0 = new ComparableComparator<Integer>();\n compa...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Adds a car in the storage.
public void add(Car car) { Objects.requireNonNull(car); storage.put(car.getId(), new StoredCar(car, true)); }
[ "public void add(Car car) {\n cars.add(car);\n }", "public void addCar(Car c){\n list.add(c);\n }", "@Override\n public void add(T car) {\n carsInGarage.add(car);\n }", "public void addCarToSlot(Car c)\t\n\t{ \n\t\tthis.car = c;\t\n\t}", "public void addCard(Card cardToAdd) ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Clears the 'employee' field, the 'has' method for this field will now return false
public void clearEmployee() { genClient.clear(CacheKey.employee); }
[ "public void clearEmployee() {\n\t\temployees.clear();\n\t}", "public boolean clearRegisterEmployee() {\n\t\tboolean retVal = false;\n\t\t\n\t\t//Validate someone is currently signed onto the register\n\t\t//Note: Someone is logged into a register if the employee object isn't null\n\t\tif(null != register[registe...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Gets the nextMaintenanceDistance value for this VehicleNeedCare.
public java.lang.Integer getNextMaintenanceDistance() { return nextMaintenanceDistance; }
[ "public void setNextMaintenanceDistance(java.lang.Integer nextMaintenanceDistance) {\n this.nextMaintenanceDistance = nextMaintenanceDistance;\n }", "public java.util.Calendar getNextMaintenanceTime() {\n return nextMaintenanceTime;\n }", "public int getTravelDistance() {\n \t\treturn travel...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
GET /details : get all the details.
@RequestMapping(value = "/details", method = RequestMethod.GET, produces = MediaType.APPLICATION_JSON_VALUE) @Timed public List<Detail> getAllDetails() { log.debug("REST request to get all Details"); List<Detail> details = detailRepository.findAll(); return details; }
[ "@GetMapping(\"/details\")\n public String details() {\n return \"/admin/member/details\";\n }", "@RequestMapping(value = \"/details/{id}\",\n method = RequestMethod.GET,\n produces = MediaType.APPLICATION_JSON_VALUE)\n @Timed\n public ResponseEntity<Detail> getDetail(@PathVariabl...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Gets the time zone desc.
public String getTimeZoneDesc() { return timeZoneDesc; }
[ "String getTimezone();", "java.lang.String getTimezone();", "java.lang.String getStringTimezone();", "String getTimeZone()\n {\n return configfile.time_zone;\n }", "public String getLBSCDOTimeZone() throws EMHException {\n\t\tResultSet rs = null;\n\t\tStatement st = null;\n\t\tString lbscdoTimeZone...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
This method appends messages with the appropriate HTML formatting to the end of the text in the chat history.
private void appendMessage(String message) { String[] parts = message.split(":", 2); String name = parts[0]; String messageText = "<span>" + parts[1] + "</span><br>"; if (name.equals(playerName)) { // messages by this player are blue name = "<span style=\"color:blue\">&#60;" + name + "&#62; </span>"; } els...
[ "private void addToHistory(String msg){\n\t\ttry{\n\t\t\tlockHistory.writeLock().lock();\n\t\t\thistory.add(msg);\n\t\t\tlogOut.write(msg);\n\t\t\tlogOut.newLine();\n\t\t\tlogOut.flush();\n\t\t} catch (IOException e) {\n\t\t\te.printStackTrace();\n\t\t} finally {\n\t\t\tlockHistory.writeLock().unlock();\n\t\t}\n\t}...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Set the value related to the column: requiresSed.
public void setRequiresSed(final Boolean requiresSed) { this.requiresSed = requiresSed; }
[ "public Boolean isRequiresSed() {\r\n\t\treturn this.requiresSed;\r\n\t\t\r\n\t}", "public void setRequires(java.lang.String requires)\r\n {\r\n synchronized (monitor())\r\n {\r\n check_orphaned();\r\n org.apache.xmlbeans.SimpleValue target = null;\r\n ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Return this vector as a string in cartesian coordinates
public String asCartesian(){ return String.format(CARTESIAN_FORMAT, this.getX(), this.getY()); }
[ "public String toString() { return \"Vector [\" + x + \" \" + y + \"]\"; }", "public String toString()\n\t{\n\t\tString stringx=Integer.toString(xcoord);\n\t\tString stringy=Integer.toString(ycoord);\n\t\treturn \"(\" +stringx + \",\" + stringy+ \")\";\n\t}", "public String toString() {\n\t\tString ret = \"\";...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
TODO: Implementati DFS. La finalul parcurgerii unei celule, adaugati celula in cellStack.
public static void DFS(Cell cell) { int t = 0; List<Cell> dependent = cell.getDependentCells(); cell.setColor(Cell.Color.GRAY); cell.setInitTime(t); ++t; for(int i = 0; i < dependent.size(); i++) { if (dependent.get(i).getColor() == Cell.Color.WHITE) { DFS(dependent.get(i)); } } // celula in c...
[ "private void setCellVisited(Cell cell) {\n\n\t\tif (!isIn(cell))\n\t\t\treturn;\n\n\t\tint r = cell.r;\n\t\tint c = cell.c;\n\t\tif (maze.type == HEX) {\n\t\t\tc = c - (r + 1) / 2;\n\t\t}\n\t\ttry {\n\t\t\tvisited[r][c] = true;\n\t\t} catch (Exception e) {\n\t\t\te.printStackTrace();\n\t\t}\n\t}", "static void D...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }