query
stringlengths
8
1.54M
document
stringlengths
9
312k
negatives
listlengths
19
20
metadata
dict
/ If HDF5_VOL_CONNECTOR is set, this might not be the native connector and the error stack might be different. Only check for the specific error stack if the native connector is being used.
@Ignore public void testH5Eprint() { String connector = System.getenv("HDF5_VOL_CONNECTOR"); if (connector == null) { try { H5.H5Fopen("test", HDF5Constants.H5F_ACC_RDWR, HDF5Constants.H5P_DEFAULT); } catch (Throwable err) { } ...
[ "public boolean isConnectorError(){\n return isConnectorError (getCode ());\n }", "private native static int shout_get_errno(long shoutInstancePtr);", "@Ignore\n public void testH5EprintInt() {\n String connector = System.getenv(\"HDF5_VOL_CONNECTOR\");\n if (connector == null) {\n ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Returns the configured number of maximum threads to use for concurrent propagation when multithread evaluation is enabled. Default is zero.
public int getMaxThreads() { return this.maxThreads; }
[ "public static int getMaxThreadCount(){\n return Integer.parseInt(properties.getProperty(\"maxThreadCount\"));\n }", "public int getMaxThreads(){\n return Max_threads;\n }", "public static int computeMaximumThreads() {\n return ArrayUtils.rangeOf(Runtime.getRuntime().availableProcesso...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Get data manage by supplier id
List<DataManageEntity> listDataManageBySupplierId(Integer supplierId);
[ "public SupplierCard find_Supplier(Integer supplier_id) {\n return supplier_dao.find(supplier_id);\n }", "public Suppliers viewSupplierById(String supplier_id) {\n\t\tSession session = getSession();\n\t\tSuppliers supplier= session.get(Suppliers.class, supplier_id);\n\t\tsession.close();\n\t\treturn sup...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
This method updates the available time slots by removing the index passed in to the method.
public void removeTime(int index) { this.timeAvailable.remove(index); }
[ "public void deleteReservationFromReservedTables(int table_id, int time_index) throws SQLException {\r\n \t\tResultSet rs = getReservedInfo(table_id);\r\n \t\tString str = rs.getString(\"reserveInfo\");\r\n \t\tchar[] ch = str.toCharArray();\r\n \t\tch[time_index] = '0';\r\n \t\tstr = new String(ch);\r\n \t\tstmt.e...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Construct an instance of the upper case field.
public UpperCaseField(final String value) { this(value, 0, 0); }
[ "public UpperCaseField() {\n this(null, 0, 0);\n }", "public UpperCaseField(final String value, final int l) {\n this(value, l, 0);\n }", "public UpperCaseField(final int l) {\n this(null, l, 0);\n }", "private Field() {}", "public NoUpperAlphaException() {}", "public LString...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Tests "Position Vector transformation (geocentric domain)" (EPSG:1033) with a sample point from WGS 72 to WGS 84 (EPSG Dataset transformation code 1238).
@Test public void testGeocentricDomain() throws FactoryException, TransformException { createTransform(new PositionVector7Param()); tolerance = 0.01; // Precision for (X,Y,Z) values given by EPSG derivativeDeltas = new double[] {100, 100, 100}; // In metr...
[ "@Test\n public void testNAD19833TM117() {\n testToWGS84AndBack(PROJ.getNAD19833TM117());\n }", "@Test\n public void testNAD19833TM114() {\n testToWGS84AndBack(PROJ.getNAD19833TM114());\n }", "@Test\n public void testNAD1927CGQ77MTM10SCoPQ() {\n testToWGS84AndBack(PROJ.getNAD1927CGQ77MTM10SCoPQ())...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Process most N frequent phrases
private void processPhrases(final int n) { result = new LinkedHashMap<String, Integer>(); List<Entry<String, Integer>> list = new LinkedList<Entry<String, Integer>>( counter.entrySet()); Collections.sort(list, new Comparator<Entry<String, Integer>>() { public int compare(final Entry<String, Integer> o1, ...
[ "String findWordsTopCount(int topCount, List<String> source);", "private static void printMostUsedWords(){\n\t\tMap<String, Integer> words = getWords();\n\t\t\n\t\tString max_count_string[] = new String[3];\n\t\tint max_counts[] = new int[3];\n\t\t\n\t\tfor(String str : words.keySet()){\n\t\t\tint count = words.g...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
This method was generated by MyBatis Generator. This method returns the value of the database column ls_task.del_flag
public String getDelFlag() { return delFlag; }
[ "public Integer getDel_flag() {\n return del_flag;\n }", "public Integer getDeleteflag() {\n return deleteflag;\n }", "public BigDecimal getDeleteFlag() {\r\n return deleteFlag;\r\n }", "public void setDel_flag(Integer del_flag) {\n this.del_flag = del_flag;\n }", "pu...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Sets the value of the '_2400HSD03FrequencyPeriod' field.
public void set2400HSD03FrequencyPeriod$1(java.lang.CharSequence value) { this._2400HSD03FrequencyPeriod = value; }
[ "public net.explorys.samhat.z12.r837.X837Pro_2400_HSD_HealthCareServicesDelivery.Builder set2400HSD03FrequencyPeriod$1(java.lang.CharSequence value) {\n validate(fields()[2], value);\n this._2400HSD03FrequencyPeriod = value;\n fieldSetFlags()[2] = true;\n return this; \n }", "public java.la...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Checks if the specified channel is registered as active by the other end of the connection.
public boolean isActiveChannel(String channel) { return activeChannels.contains(channel); }
[ "public boolean isActiveChannel(NetworkManager manager, String channel)\n {\n if (connections.containsKey(manager))\n {\n ConnectionInstance con = getConnection(manager);\n return con.isActiveChannel(channel);\n }\n return false;\n }", "public boolea...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Asserts whether actual bitmap is very similar to the expected bitmap at some quality level. This is defined as their PSNR value is greater than or equal to the threshold. The higher the threshold, the more similar they are.
public static void assertBitmapsAreSimilar( Bitmap expectedBitmap, Bitmap actualBitmap, double psnrThresholdDb) { assertThat(getPsnr(expectedBitmap, actualBitmap)).isAtLeast(psnrThresholdDb); }
[ "@Test\r\n public void testRatio() throws Exception {\r\n Bitmap orig = util.loadAssetBitmap(\"lena.png\");\r\n\r\n //start with lossless image\r\n byte[] encoded = new JP2Encoder(orig).setCompressionRatio(1).encode();\r\n assertNotNull(encoded);\r\n Bitmap decoded = new JP2Dec...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Selects chain event sequences
protected void selectChains(EventType event, List<EventType> sequence, int length) { // desired length reached? if (0 == length) { // add sequence chains.add(sequence); // make sequence executable if (null != makeExec(sequence)) execChains.add(sequence); return; } // itera...
[ "protected void selectChains(int length) {\r\n\t\tfor (EventType event : events) {\r\n\t\t\tLog.info(\"Selecting Chain Sequences for Event \"\r\n\t\t\t\t\t+ event.getEventId());\r\n\r\n\t\t\t// create sequence and add event\r\n\t\t\tList<EventType> sequence = new ArrayList<EventType>();\r\n\t\t\tsequence.add(event)...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Check for the variuous namespace and VALIDATION features
void checkFeatures(SAXParser sp) { XMLReader reader; try { reader = sp.getXMLReader(); System.out.println("Parser is " + (sp.isNamespaceAware() ? "" : " NOT ") + "configured to understand NAMESPACES."); System.out.println("Parser is " + (sp.isValidating() ? "" : " NOT ") + "configured to vali...
[ "public synchronized void validateVariableNames() {\n DataClassValidator dataClassValidator = new DataClassValidator(dataClass);\n dataClassValidator.validateVariableNames(mandatoryUsageTokens);\n dataClassValidator.validateVariableNames(optionalUsageTokens);\n }", "public abstract boolean...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Gets the constraints for the specified component. A copy of the actual MyGridBagConstraints object is returned.
public MyGridBagConstraints getConstraints(Component comp) { return comptable.get(comp).clone(); }
[ "private MyGridBagConstraints lookupConstraints(Component comp) {\n return comptable.get(comp);\n }", "public GridBagConstraints getConstraints() {\n GridBagConstraints constraints = new GridBagConstraints();\n constraints.weightx = 0.1;\n constraints.weighty = 0.1;\n constra...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
moveObject is the base method for adding or removing a GameObject from a location. Note this only handles the logical location of the game object, not its actual disappearance as a sprite or graphic from the GUI
public void moveObject(GridVector newLocation) { //Save the old location GridVector oldLocation = location.clone(); //Set the item to the new location location = newLocation; //Notify the ObjectWatcher of the...
[ "public void relocateWorldObject(WorldObject object, Point point) {\n worldObjectInThisWorldCheck(object);\n pointInThisWorldCheck(point);\n \n getWorldObjectsInPoint(object.getPosition()).remove(object);\n getWorldObjectsInPoint(point).add(object);\n object.setPosition(poi...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Creates a new collection that contains the elements from this collection where collectionFilter.filter() returns true on that element. All other elements are omitted.
public BCollection filter(BCollectionFilter collectionFilter);
[ "public BCollection inplaceFilter(BCollectionFilter collectionFilter);", "public Predicate<CollectionId> collectionFilter() {\n return collectionFilter;\n }", "public static <E> Collection<E> filterColl(Iterable<E> coll,\n\t\t\t\t\t Predicate<E> pred,\n\t\t\t\t\t Collection<E> newColl) {\n...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Create departments and add them to the collection of departments
private static void createDepartments() { Department marketing =new Department(001,"Marketing"); Department sales=new Department(002,"Sales"); Department engineering=new Department(003,"Engineering"); departments.add(marketing); departments.add(sales); departments.add(engineeri...
[ "public void addDepartment( org.ontoware.rdf2go.model.node.Node value) {\r\n\t\tBase.add(this.model, this.getResource(), DEPARTMENT, value);\r\n\t}", "void insertDepartment(String depName, Date creationDate, long idParentDepartment);", "public static void loadDepartments() {\n\t\t/* Try block for trying to find...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
This sampling method draws numbers from the box until the fist time X is found.
public double[] drawUntil(double X){ Vector v=new Vector(vec.size()); double d; do{ int index=randomSeed(0,vec.size()-1); v.addElement(vec.elementAt(index)); d=((Double)vec.elementAt(index)).doubleValue(); } while(d!=X); ...
[ "public void rng() {\n if (System.currentTimeMillis() > timerStart + delay) {\r\n //Creates a rng generator, highest number 5, lowest is 1\r\n Random rng = new Random();\r\n walls = rng.nextInt(5) + 1;\r\n //'resets' the timer\r\n timerStart = System.cur...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
This method was generated by MyBatis Generator. This method returns the value of the database column account_log.log_id
public Integer getLogId() { return logId; }
[ "public String getAccountLogId() {\n return accountLogId;\n }", "public Long getLogId() {\n return logId;\n }", "public int getLogId() {\n return logId.get();\n }", "public String getLogId() {\n return logId;\n }", "public Integer getLogid() {\n return logid;\n...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Gets the time in milliseconds when the given image file was last cached. The system will first see if this is an internal file, if not, it will check external.
public static long getLastCached(File file) { File cacheFile = getCacheFor(file, true); if (!cacheFile.isFile()) cacheFile = getCacheFor(file, false); return cacheFile.isFile() ? cacheFile.lastModified() : -1; }
[ "private long getLastCacheUpdateTimeMillis() {\n return this.fileManager.getFromPreferences(this.context, SETTINGS_KEY);\n }", "private long getLastCacheUpdateTimeMillis() {\n return this.fileManager.getFromPreferences(this.context, SETTINGS_FILE_NAME,\n SETTINGS_KEY_LAST_CACHE_UPDATE);\n }",...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Sends a PacketPlayOutCollect to play the animation of entity picking up item
public void sendPickupItemPacket(ViewableEntity entity, ViewableEntity item) { Object packet = ReflectUtils.newInstance("PacketPlayOutCollect"); ReflectUtils.setField(packet, "a", item.getEntityId()); ReflectUtils.setField(packet, "b", entity.getEntityId()); ReflectUtils.setField(packet...
[ "void pickup(EntityItem item);", "public void collectItems(){\n\t Point player_index = map.toIndex(getCenter().x, getCenter().y);\n\t for(int i = player_index.x - 1; i <= player_index.x + 1; i++ ){\n\t\t for(int j = player_index.y - 1; j <= player_index.y + 1; j++ ){\t \n\t\t\t Powerup item = map.items.g...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Show introns of Entries
public void showIntrons(boolean show) { entry1.showIntrons(show); entry2.showIntrons(show); reciprocals.showIntronReciprocals(show); }
[ "public void showEntryList(List<Entry> ListOfEntry){\n for (Entry i : ListOfEntry) {\n System.out.println(\"=======================\");\n System.out.println(i.toString());\n System.out.println(\"=======================\");\n }\n }", "private void displayEntries(List<Entry> entries) {\n\t\tfo...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Removes a field binding.
void removeFieldBinding( FieldBinding binding );
[ "public Binding removeBinding(QName name);", "public void removeBindings();", "public Object removeField( Object n );", "public Binding removeBinding(int anIndex) { return getBindings(true).remove(anIndex); }", "public void unRegisterKeyBinding(KeyBinding binding)\r\n\t{\r\n\t\tMinecraft minecraft = Minecr...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
$ANTLR end "rule__ImmovableObject__Group__1__Impl" $ANTLR start "rule__ImmovableObject__Group__2" InternalDronesDsl.g:1272:1: rule__ImmovableObject__Group__2 : rule__ImmovableObject__Group__2__Impl ;
public final void rule__ImmovableObject__Group__2() throws RecognitionException { int stackSize = keepStackSize(); try { // InternalDronesDsl.g:1276:1: ( rule__ImmovableObject__Group__2__Impl ) // InternalDronesDsl.g:1277:2: rule__ImmovableObject__Group__2__Impl ...
[ "public final void rule__MovableObject__Group__2() throws RecognitionException {\n\n \t\tint stackSize = keepStackSize();\n \t\n try {\n // InternalDronesDsl.g:1195:1: ( rule__MovableObject__Group__2__Impl )\n // InternalDronesDsl.g:1196:2: rule__MovableObject__Group__2__I...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Return an OutputFilter representing the CALDAV:calendardata property in a report info, if one is provided.
protected OutputFilter findOutputFilter(ReportInfo info) throws DavException { Element propdata = DomUtil.getChildElement(info.getReportElement(), XML_PROP, NAMESPACE); if (propdata == null) { return null; } El...
[ "protected static OutputFilter findOutputFilter(ReportInfo info)\n throws CosmoDavException {\n Element propdata =\n DomUtil.getChildElement(getReportElementFrom(info),\n XML_PROP, NAMESPACE);\n if (propdata == null) {\n return null;\n ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Compares the message Buffer to the specified char array.
public boolean equals(final char[] b, int offset, final int len) { if (getLength() != len) { return false; } for (int i = start; i < end; i++) { if (buffer.get(i) != b[offset++]) { return false; } } return true; }
[ "private boolean compareBytes(byte [] buffer, int offset, String str) {\r\n\t\tfor (int i = 0; i < str.length(); i++) {\r\n\t\t\tif ( ((byte) (str.charAt(i))) != buffer[i + offset]) {\r\n\t\t\t\treturn false;\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn true;\r\n\t}", "private static boolean byteCmp(byte a[], byte b[], int ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Algorithm above is not effective when we are comparing arrays with a lot of matching values like [1,1,1,1,1,1] vs [8,1,1,1,1,1]. We can make it faster if we collapse simple matching values.
private void doSimpleMatching() { for (int i = 0; i < equalElements.size(); i++) { if (!alreadyMatched.get(i)) { List<Integer> equalTo = equalElements.get(i); if (equalTo.size() > 0) { List<Integer> equivalentElements = getEquivalentElements(equalT...
[ "@Test\n public void testCollapseArrayNoCombine()\n {\n \tint[] testArr ={2, 0, 0, 4, 0, 2};\n \tint[] compareArr={2, 4, 2, 0, 0, 0};\n \tGameUtil.collapseArray(testArr);\n \tfor(int i=0; i<testArr.length; i++)\n\t\t\tassertEquals(testArr[i],compareArr[i]);\n }", "public static boolean hasAll...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
If both bonds are in a ring (SMARTS and normal definitions), then the bond is made ringonly. If one is in a ring and the other isn't, the bond is made standard. If both bonds are not in a ring (chain bonds), then it's made chain only. Bond order is still kept into account in this. So is aromaticity, at least as far as ...
private IQueryBond createSMARTSRingChainBond( IAtom translated1, IAtom translated2, IBond hsBond, IBond origBond ) { IQueryBond newBond = null; Boolean bothRings = null; // true = both in rings, false = both in chains, null = exclusive-OR if( hsBond != null && !( hsBond instanceof SmartsBondExpression) ...
[ "public Bond(IAtom atom1, IAtom atom2) {\n this(atom1, atom2, IBond.Order.SINGLE, CDKConstants.STEREO_BOND_NONE);\n }", "public void setBondedOnly(boolean flag) {\n bondedOnly = flag;\n }", "private boolean isSP2Bond(IBond bond) {\n return bond.getFlag(CDKConstants.ISAROMATIC);\n ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
optional .alluxio.proto.journal.InodeDirectoryIdGeneratorEntry inode_directory_id_generator = 10;
public Builder setInodeDirectoryIdGenerator(alluxio.proto.journal.File.InodeDirectoryIdGeneratorEntry value) { if (inodeDirectoryIdGeneratorBuilder_ == null) { if (value == null) { throw new NullPointerException(); } inodeDirectoryIdGenerator_ = value; onChang...
[ "alluxio.proto.journal.File.InodeDirectoryIdGeneratorEntryOrBuilder getInodeDirectoryIdGeneratorOrBuilder();", "public alluxio.proto.journal.File.InodeDirectoryIdGeneratorEntryOrBuilder getInodeDirectoryIdGeneratorOrBuilder() {\n return inodeDirectoryIdGenerator_;\n }", "alluxio.proto.journal.File.Inode...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
C func: char memcached_stat_get_keys( const memcached_st ptr, memcached_stat_st memc_stat, memcached_return_t error );
public String[] memcached_stat_get_keys( memcached_st ptr, memcached_stat_st memc_stat, IntByReference error );
[ "public memcached_stat_st memcached_stat(memcached_st ptr, String args, IntByReference error);", "public String memcached_stat_get_value(\n memcached_st ptr,\n memcached_stat_st memc_stat,\n String key,\n IntByReference error\n );", "public void memcached_stat_free(memcached_st pt...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Return the scheduler that is a part of the Plant's configuration.
@Override public PlantScheduler getPlantScheduler() { return plantConfiguration.getPlantScheduler(); }
[ "@Override\n public String getActualSchedulerConfiguration() {\n MdrConfiguration mdrSynch = mdrRepository.getMdrSchedulerConfiguration();\n return mdrSynch.getConfigValue();\n }", "public Scheduler getScheduler() {\n\t\treturn scheduler;\n\t}", "public Scheduler getScheduler() {\n\t\treturn...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Invokes a method with the specified parameters on the specified object.
@SuppressWarnings("squid:S3011") @SneakyThrows public static Object invokeMethod(final Object object, final String methodName, final Object... param) { var method = object.getClass().getDeclaredMethod(methodName, getClasses(param)); method.setAccessible(true); return method.invoke(object...
[ "public Object invoke(final Object object) {\n\t\treturn method.invoke(object, args);\n\t}", "void callMethod(Object obj, String name, Object... args)\n throws ScriptRunnerException;", "public abstract Object invoke(Object obj, Object... args) throws Throwable;", "@SuppressWarnings(\"unchecked\")\n...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
end method redSliderAddListener method to add a change listener to the blue slider
public void blueSliderAddListener( ChangeListener changeListener ) { // add the change listener passed in to the blue slider blueSlider.addChangeListener( changeListener ); }
[ "public void redSliderAddListener( ChangeListener changeListener )\r\n\t{\r\n\t\t// add the change listener passed in to the red slider\r\n\t\tredSlider.addChangeListener( changeListener );\r\n\t}", "public void greenSliderAddListener( ChangeListener changeListener )\r\n\t{\r\n\t\t// add the change listener passe...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
http.antMatcher("/") .authorizeRequests() .antMatchers("/oauth/", "/", "/login", "/webjars/").permitAll() .anyRequest().authenticated() .and().exceptionHandling() .authenticationEntryPoint(new LoginUrlAuthenticationEntryPoint("/")) ;
@Override protected void configure(HttpSecurity http) throws Exception { http .authorizeRequests().antMatchers("/oauth/**", "/login/**", "/logout", "/webjars/**").permitAll() .and() .authorizeRequests().anyRequest().authenticated() .and() ...
[ "@Override\n protected void configure(HttpSecurity http) throws Exception {\n\n\n http\n .csrf().disable()\n .authorizeRequests()\n .antMatchers(\"/admin/**\").hasRole(\"ADMIN\")\n .antMatchers(\"/anonymous*\").anonymous()\n .antMa...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Checks whether given plaintext password corresponds to a stored salted hash of the password.
public static boolean check(String password, String stored) throws Exception{ logger.log(Level.INFO, "PasswordUtils: enter check()"); if (password == null) { return false; } if (stored == null) { return false; } final String[] saltAndPass = stored....
[ "public static boolean check(String password, String stored) throws Exception {\n String[] saltAndPass = stored.split(\"\\\\$\");\n if (saltAndPass.length != 2) {\n return false;\n }\n String hashOfInput = hash(password, hexDecode(saltAndPass[0]));\n return hashOfInput....
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Returns an unmodifiable view of the specified list. This method makes use of the method unmodifiableList of java.util.Collections and returns an empty list if the provided list is null.
public static <T> List<T> unmodifiableList(List<? extends T> list) { if ( list == null ) { return Collections.emptyList(); } else { return Collections.unmodifiableList(list); } }
[ "public static <T> List<T> copyToUnmodifiableList(List<T> list)\n {\n if (list != null)\n {\n List<T> listCopy = new ArrayList(list);\n return Collections.unmodifiableList(listCopy);\n }\n else\n {\n return Collections.emptyList();\n }\n }", "public static <T> List<T> readOnly(f...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Set write mode for the specified slave (03).
public void setSlaveWriteMode(byte num, boolean mode) { if (num > 3) { return; } if (mode) { I2Cdev.writeBit(MPU6050_Registers.MPU6050_RA_I2C_SLV0_CTRL, MPU6050_Registers.MPU6050_I2C_SLV_REG_DIS_BIT, (byte) 1); } else { I2Cdev.writeBit(MPU6050_Register...
[ "void setSlaveMode();", "public void setWriteMode(String writeMode) {\n this.writeMode = writeMode;\n }", "public void setWriteMode(FileSystem.WriteMode writeMode) {\n this.writeMode = writeMode;\n }", "public void setSlave4WriteMode(boolean mode) {\n if (mode) {\n I2Cdev.write...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Method to find squareRoot for a number as the base method of java.lang.Math are very slow hence a custom implementation
public static double squareRoot(double number) { double baseNumber,squareRoot = number / 2; do { baseNumber = squareRoot; squareRoot = (baseNumber + (number / baseNumber)) / 2; } while ((baseNumber - squareRoot) != 0); return squareRoot; }
[ "public static Double squareRoot(Double n)\n {\n /*We are using n itself as initial approximation - This can definitely be improved */\n Double x = n;\n Double y = 1.0;\n Double e = 0.000001; /* e decides the accuracy level*/\n\n while(x - y > e) {\n x = (x + y)/2;\n...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Clears tag values, tag TextView, and preview ImageView
public void clearFields() { tags.clear(); tagText.setText(""); ((ImageView)findViewById(R.id.picture)).setImageResource(android.R.color.transparent); }
[ "public void clearTaggedValues();", "public void resetNewTag();", "protected final void ClearTags()\n\t{\n\t\tthis.tags.clear();\n\t}", "private void clearVolatileTags() {\n\t\ttextHousenumber.setText(\"\");\n\t\ttextHousename.setText(\"\");\n\t\tHashMap<String, String> newAddress = new HashMap<String, String...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Generates SQL statement which marks content as not used.
public PreparedStatement markUnusedSQL( BinaryKey key ) throws BinaryStoreException { try { PreparedStatement sql = sqlBuilder.update(tableName()) .set("usage", "?") .set("usage_time", "?") ...
[ "boolean getMissingStatement();", "protected boolean generateSQL() {\r\n return true;\r\n }", "protected String getNonDirtyRecordIdsSql(String soupName, String idField, String additionalPredicate) {\n return String.format(\"SELECT {%s:%s} FROM {%s} WHERE {%s:%s} = 'false' %s ORDER BY {%s:%s} ASC\",\n...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Getter method for property explanation.
public String getExplanation() { return explanation; }
[ "public String getExplanation() {\n\n\t\treturn explanation;\n\t}", "public String explain()\n {\n return _explanation;\n }", "public java.lang.String getDescripcion();", "public String getDescription(){\n\n //returns the value of the description field\n return this.description;\n }", "p...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Create a new AMQP adapter client.
public AmqpAdapterClient createAmqpAdapterClient() throws Exception { return createAmqpAdapterClient(null); }
[ "public AmqpAdapterClient createAmqpAdapterClient(final Set<String> tlsVersions) throws Exception {\n if (this.key != null) {\n return IoTTestSession.this.createAmqpAdapterClient(this.key, this.certificate, tlsVersions);\n } else {\n return IoTTest...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Returns the TimeFormat of the line or null if it can't be parsed. Not being able to parse the line is an indicator for a multi line message
private TimeFormat getTimeFormat(String line) { LocalDateTime dateTime = null; // if the line is shorter than the shortest time format, it has to be a multi line // this is an optimisation measure if (line.length() < this.timeFormats.get(this.timeFormats.size() - 1).getLength()) { ...
[ "public final flipsParser.timeFormat_return timeFormat() throws RecognitionException {\n flipsParser.timeFormat_return retval = new flipsParser.timeFormat_return();\n retval.start = input.LT(1);\n\n CommonTree root_0 = null;\n\n Token char_literal350=null;\n Token char_literal351=...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Set Hdop field value by int format and update the related Bluetooth GATT Characteristic.
public boolean setHdop(int value) { if (!FormatUtils.uint8RangeCheck(value)) { return false; } mHdop = FormatUtils.intToUint8(value); updateGattCharacteristic(); return true; }
[ "void setChargingMethod(int value);", "public void setHops(int h){\n setSpecialAttr(\"hops\",\"\"+h);\n }", "public boolean setVdop(int value) {\r\n if (!FormatUtils.uint8RangeCheck(value)) {\r\n return false;\r\n }\r\n mVdop = FormatUtils.intToUint8(value);\r\n ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
getAllExerciseInfoByName (db, name) Given a Cursor thats initialized AND pointing to an exercise row (not BEFORE), this creates and fills in an ExerciseData instance. preconditions: This really should be called within a try/catch block. Do that anytime you fill in a Cursor from a database. It's just good sense.
public static ExerciseData getExerciseData (Cursor cursor) { int col; ExerciseData data = new ExerciseData(); // now load up the data: col = cursor.getColumnIndex(COL_ID); data._id = cursor.getInt(col); col = cursor.getColumnIndex(EXERCISE_COL_NAME); data.name = cursor.getString(col); col = cursor.ge...
[ "public static ExerciseData getExerciseData (SQLiteDatabase db,\n\t\t\t\t\t\t\t\t\t\t\t\tString name) {\n\n\t\tCursor cursor = null;\n\t\tExerciseData data = null;\n\n\t\ttry {\n\t\t\tcursor = db.query(EXERCISE_TABLE_NAME,\n\t\t\t\t\t\t\tnull,\n\t\t\t\t\t\t\tEXERCISE_COL_NAME + \"=?\",\n\t\t\t\t\t\t\tnew String[] {...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Parses the local string into an PDB atom object.
public PdbAtom parseAtomRecord() { // String recordName = this.atomLine.substring(0,6); // Integer serial = Integer.valueOf(this.atomLine.substring(6, 11)); String atomName = this.atomLine.substring(12, 16).trim(); String residueType = this.atomLine.substring(17, 20).trim(); int ...
[ "Optional<Symbol> parseLine(String line);", "public Local newLocal(String name, Type t) {\n return new BafLocal(name, t);\n }", "public Sym\nsearchLocal(String pInternedName,int pSymKind);", "private PDBAtom readAtom(String cLine, int lineLength) {\n\t\t// a line looks like:\n\t\t// 0123456789012345678901...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Internally sets known positions and euclidean distances. If any distance value is zero or negative, it will be fixed assuming an EPSILON value.
@Override protected void internalSetPositionsAndDistances( final P[] positions, final double[] distances) { super.internalSetPositionsAndDistances(positions, distances); //initialize distances standard deviations to default values mDistanceStandardDeviations = new double[distanc...
[ "private void ensureDistances() {\n if (getDistanceEnd() > distances.length) {\n int newLength = distances.length * 4;\n double[] newDistances = new double[newLength];\n System.arraycopy(distances, 0, newDistances, 0, distances.length);\n Arrays.fill(newDistances, ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Creates a new instance of GE_RISProcessToUFD
public GE_RISProcessToUFD(String pHL7Message) throws ICANException { super(pHL7Message); mVersion = "a"; // GE_RISProcessToUFD Release Version Number mHL7Message = pHL7Message; }
[ "public static UserProcess newUserProcess() {\n return (UserProcess)Lib.constructObject(Machine.getProcessClassName());\n }", "public static UserProcess newUserProcess() {\n\treturn (UserProcess)Lib.constructObject(Machine.getProcessClassName());\n }", "public static UserProcess newUserProcess() {\n\t\tre...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
/ Utility method to print the statistics about the index
private void printStatistics() throws IOException { System.out.println("*********************** " + analyzer + " *********************************"); idxReader = DirectoryReader .open(FSDirectory.open(Paths.get(indexPath))); System.out.println("Total no. of document in the corpus: " + idxReader.max...
[ "public void printStats(){\r\n\r\n\t\tSystem.out.println(\"Search Agent Statistics: \"+searchMethod); \r\n\t\tSystem.out.println(); \r\n\t\tSystem.out.println(\"Total nodes generated :\"+ (OPEN.size() + CLOSED.size())); \r\n\t\tSystem.out.println(\" nodes popped from Agenda :\"+ CLOSED.size());\r\n\t\tSyst...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Gets the primaryAccountPostalCode value for this Account.
public java.lang.String getPrimaryAccountPostalCode() { return primaryAccountPostalCode; }
[ "public java.lang.String getPrimaryBillToPostalCode() {\n return primaryBillToPostalCode;\n }", "public void setPrimaryAccountPostalCode(java.lang.String primaryAccountPostalCode) {\n this.primaryAccountPostalCode = primaryAccountPostalCode;\n }", "public java.lang.String getPrimaryAddressId...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Provides a reference to the CxA stop latch.
public CountDownLatch stopLatch() { return stopLatch; }
[ "long getStop();", "public synchronized void stop(){\n\t\tif (tickHandle != null){\n\t\t\ttickHandle.cancel(false);\n\t\t\ttickHandle = null;\n\t\t}\n\t}", "public void service_CAS_STOP(){\n if ((eccState == index_START)) state_CAS_STOP();\n }", "public int getSTOP() {\n return stop;\n ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Gets the possible platform IDs on the system.
public cl_platform_id[] getPlatforms() { int[] numPlatformsArray = new int[1]; CL.clGetPlatformIDs(0, null, numPlatformsArray); int numPlatforms = numPlatformsArray[0]; cl_platform_id[] platforms = new cl_platform_id[numPlatforms]; CL.clGetPlatformIDs(platforms.length, platforms, null); return pla...
[ "public List<String> getPlatforms() {\n\t\treturn platforms;\n\t}", "public List<Platform> getPlatforms() {\n return platforms;\n }", "public static List<Platform> getAllPlatforms() throws NoPlatformException {\n LOG.info(\"Starting get all OpenCL platform\");\n int[] actuallyPlatformNum = new...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Set the TAD (tensor along dimension) threshold for ops
void setTadThreshold(int threshold);
[ "int tadThreshold();", "void setElementwiseThreshold(int threshold);", "public static void setThreshold(int threshold) {\n EvalutionUtil.ifFalseCrash(threshold>0, \n \"The threshold for the relevant documents in the ranking should be bigger than 0\");\n thres = threshold;\n }", "protected void ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Creates and returns a clone copy of this set. I.e., the returned set object returned by this method is independent of this object.
public OrderedSet<E> copy() { OrderedSet<E> set = new OrderedSet<>(); for (E x : this) { set.add(x); } return set; }
[ "public Set clone() {\n Set copySet = new Set(this.S);\n copySet.next = this.next;\n return copySet;\n }", "public SetSet deepCopy(){\n\t\tSetSet copy = new SetSet();\n\t\tfor(int i=0;i<size();i++){\n\t\t\tcopy.add(get(i).deepCopy());\n\t\t}\n\t\treturn copy;\n\t}", "public Object clone(...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Test the addition of a null attribute.
@Test public void testAddNullAttribute() { Tag tag = new BaseTag("testtag"); String attributeName = "testAttr"; tag.addAttribute(attributeName, null); assertNull("Wrong attribute value returned", tag.getAttribute(attributeName)); assertNotNull("No attribute map", tag.getAttributes()); assertEq...
[ "public String getNullAttribute();", "@Test\n\tpublic void testAddNull()\n\t{\n\t\tassertFalse(set.add(null));\n\t}", "public void testUpdateAttribute_NullNewElement() throws Exception {\n try {\n extractor.updateAttribute(null);\n fail(\"IllegalArgumentException expected.\");\n ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Test of getInfluentialUsers method, of class SocialNetwork.
@Test public void testGetInfluentialUsers01() { System.out.println("getInfluentialUsers"); Set<User> expResult = new HashSet<>(); expResult.add(new User("nick3", "mail_3_@sapo.pt")); expResult.add(new User("nick5", "mail_5_@sapo.pt")); expResult.add(new User("nick8", "mail_8...
[ "public void testGetKnownUsers() {\n List<byte[]> list = null;\n try {\n list = userManager.getKnownUsers();\n } catch (ExMiddlewareException e) {\n fail(e.toString());\n } catch (IOException e) {\n fail(e.toString());\n }\n assertNotNull(li...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
mhc: humidity mWs: windspeed mtc: temperature mrh: rainfall Image
public static void main(String[] args) { Pixel[][] p=new Pixel[455][455]; //Pixel[][] p2=new Pixel[455][455]; WeatherImage imgTemperature=new WeatherImage(); WeatherImage imgPrecipitation=new WeatherImage(); WeatherImage imgHumidity=new WeatherImage(); WeatherImage imgWind=new WeatherImage(); //...
[ "String getTempHumContainer();", "void deriveImage()\n\t{\n\n\t\t//img = new BufferedImage(dimx, dimy, BufferedImage.TYPE_INT_ARGB);\n\t\timg = null;\n\t\ttry{\n\t\t\timg = ImageIO.read(new File(\"src/input/World.png\"));\n\n\t\t}catch (IOException e){\n\t\t\tSystem.out.println(\"world image file error\");\n\t\t}...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
LogU.d("readTag currentFrame "+ currentFrame + " trackid " +mTrackId+" frames.size() "+ frames.size());
public Tag readTag() { Tag tag = null; if(currentFrame >= frames.size()) { return tag; } try { lock.acquire(); //get the current frame MP4Frame frame = frames.get(currentFrame); if (frame != null) { // LogU.d("c...
[ "public int getFrameCounter(){\n return frameCounter;\n }", "private void handleFrameElement(JsonArray frameInfo) {\n\t\t// TODO Auto-generated method stub\n\t\tint frameid = frameInfo.get(0).getAsInt();\n\t\tint matchid = frameInfo.get(1).getAsInt();\n\t\tSystem.out.println(frameid);\n\t\tSystem.out.pr...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Construct a view volume viewer.
public ViewVolumeViewer(WorldWindow observedWindow, Dimension size) { this.observered = observedWindow; this.getContentPane().setLayout(new BorderLayout(5, 5)); this.wwp = new WWPanel((WorldWindowGLCanvas) this.observered, size, this.makeModel()); this.getContentPane().add(wwp, Bord...
[ "protected abstract StructuredViewer createViewer(Shell shell);", "protected SourceViewer createViewer(Composite parent) {\n\t\tSourceViewer viewer= new SourceViewer(parent, null, null, false, SWT.BORDER | SWT.V_SCROLL | SWT.H_SCROLL);\n\t\tSourceViewerConfiguration configuration= new SourceViewerConfiguration();...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
check that SYMMETRIC_LT_SRC_MODEL_TEST_FILE has valid weights.
@Test public void logicTreeHasValidWeightTest() { LogicTreeParser parser = new LogicTreeParser( SYMMETRIC_LT_SRC_MODEL_TEST_FILE); Tree<LogicTreeNode> tree = parser.parse(); assertTrue(treeProcessor.hasValidWeights(tree)); }
[ "@Test\n\tpublic void logicTreeHasInvalidWeightsTest() {\n\n\t\tLogicTreeParser parser = new LogicTreeParser(\n\t\t\t\tINVALID_SYMMETRIC_LT_SRC_MODEL_TEST_FILE);\n\t\tTree<LogicTreeNode> tree = parser.parse();\n\n\t\tassertFalse(treeProcessor.hasValidWeights(tree));\n\t}", "public void testCheckWeightsReturnsFals...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
isKnown /======================================================================= getNext/Prev/DataID First, see the "Accepted conventional triangle notation" note in the file comment header. It's important. (...c) A b C a B c (A...) The following two functions give the next or previous identifier assuming that next is ...
public static DataID getNextDataID ( DataID dID // input ) { DataID outputID = DataID.DATA_INVALID; switch ( dID ) { case DATA_A: outputID = DataID.DATA_B; break; case DATA_B: outputID = DataID.DATA_C; ...
[ "public static DataID getPrevDataID\r\n ( DataID dID // input\r\n )\r\n {\r\n DataID outputID = DataID.DATA_INVALID;\r\n \r\n switch ( dID )\r\n {\r\n case DATA_A:\r\n outputID = DataID.DATA_C;\r\n break;\r\n case DATA_B:\r\n output...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Sets up the region and api key for the API
public void setUp() { RiotAPI.setRegion(region); RiotAPI.setAPIKey(apikey); }
[ "private void setup()\r\n\t{\r\n\t\t\r\n\t\tcontext = new GeoApiContext.Builder().apiKey(\"AIzaSyBgcCPoJcVPvdsClek4TljQ7E7XzcMbU4I\").build();\r\n\t}", "public void createApiRootEU() {\n ApiRoot apiRoot = ImportApiRootBuilder.of()\n .defaultClient(ClientCredentials.of()\n ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Start the timer for a given turn, activating the DisconnectionManager if the time elapses
private void startTurnTimer (long turntime, Handler handler){ this.turntimer = new Timer(); turntimer.schedule(new DisconnectionManager(handler) , turntime); }
[ "private void turn() {\r\n\t\ttimer.schedule(new MyTimer(this), 2 * 60 * 1000);\r\n\t\twhile (playerList.get(playerTurn).isActive()) {\r\n\t\t\ttry {\r\n\t\t\t\tthis.wait();\r\n\t\t\t} catch (InterruptedException e) {\r\n\t\t\t\te.printStackTrace();\r\n\t\t\t}\r\n\t\t}\r\n\t}", "public void startTurn() {\r\n\t\tb...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
This is the same as testContainerReservationContinueLookingWithLabels, but this test doesn't specify the label expression in the ResourceRequest, instead it uses default queue label expressions
@Test (timeout = 120000) public void testContainerReservationContinueLookingWithDefaultLabels() throws Exception { mgr.addToCluserNodeLabelsWithDefaultExclusivity(ImmutableSet.of("x")); mgr.addLabelsToNode(ImmutableMap.of(NodeId.newInstance("h1", 0), toSet("x"), NodeId.newInstance("h2", 0), toSe...
[ "@Test (timeout = 120000)\n public void testContainerReservationWithLabels() throws Exception {\n mgr.addToCluserNodeLabelsWithDefaultExclusivity(ImmutableSet.of(\"x\", \"y\",\n \"z\"));\n mgr.addLabelsToNode(ImmutableMap.of(NodeId.newInstance(\"h1\", 0),\n toSet(\"x\"), NodeId.newInstance(\"h2...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
This method was generated by MyBatis Generator. This method returns the value of the database column POSSalesDetail.FixMoney
public BigDecimal getFixmoney() { return fixmoney; }
[ "public Integer getFixMoney() {\n return fixMoney;\n }", "public void setFixMoney(Integer fixMoney) {\n this.fixMoney = fixMoney;\n }", "public void setFixmoney(BigDecimal fixmoney) {\r\n this.fixmoney = fixmoney;\r\n }", "public java.lang.String getProjectFixFee() {\n ret...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Creates and returns a new array of Style objects from the given Element.
protected Style[] parseStyles( Element datasetElement ) throws XMLParsingException, InvalidCapabilitiesException { List<Node> styleList = XMLTools.getNodes( datasetElement, PRE_WPVS + "Style", nsContext ); // optional therefore return null if n...
[ "JRStyle[] getStyles();", "public Style[] getStylesPreOrder()\n\t{\n\t\tArrayList collect = new ArrayList();\n\t\tStyle root = getStyle(\"base\");\n\t\tcollectStyles(root,collect);\n\t\tStyle[] result = new Style[collect.size()];\n\t\tcollect.toArray(result);\n\t\treturn result;\n\t}", "public static Hashtable ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
This method was generated by MyBatis Generator. This method sets the value of the database column TRSPAYPLANDET_TENTATIVE_TEMP.EXCLUDE_PROFIT_AMOUNT
public void setEXCLUDE_PROFIT_AMOUNT(BigDecimal EXCLUDE_PROFIT_AMOUNT) { this.EXCLUDE_PROFIT_AMOUNT = EXCLUDE_PROFIT_AMOUNT; }
[ "public BigDecimal getEXCLUDE_PROFIT_AMOUNT() {\r\n return EXCLUDE_PROFIT_AMOUNT;\r\n }", "public void setACTUAL_PROFIT_AMT(BigDecimal ACTUAL_PROFIT_AMT) {\r\n this.ACTUAL_PROFIT_AMT = ACTUAL_PROFIT_AMT;\r\n }", "public void setACTUAL_PROMISSORY_DEAL_AMOUNT(BigDecimal ACTUAL_PROMISSORY_DEAL_...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
/ ReadOnly Status change event An Event object specifying the Property whose readonly status has been changed.
public interface ReadOnlyStatusChangeEvent extends Serializable { /** * Property whose read-only state has changed. * * @return source Property of the event. */ public Property getProperty(); }
[ "public void readOnlyStatusChange(\n Property.ReadOnlyStatusChangeEvent event);", "public interface ReadOnlyStatusChangeListener extends Serializable {\n\n /**\n * Notifies this listener that a Property's read-only status has\n * changed.\n * \n * @param event...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
end selectionSort O(?) ArrayListreturning selectionSort postcondition: order of input ArrayList's elements unchanged Returns sorted copy of input ArrayList.
public static ArrayList<Comparable> selectionSort( ArrayList<Comparable> input ) { ArrayList<Comparable> temp = new ArrayList(); for (int counter = 0 ; counter < input.size() ; counter++){ temp.add(input.get(counter)); } selectionSortV(temp); return temp; }
[ "public static ArrayList<Comparable> selectionSort( ArrayList<Comparable> input ) {\n\t\n\tArrayList<Comparable> output = new ArrayList<Comparable>();//creates variable output with the contents of input\n\tfor (Comparable a : input){\n\t output.add(a);\n\t}\n\t\n\tselectionSortV(output);//sorts the output\n\t\n\...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Gets the weight of the edge connecting the two nodes. Returns null if the edge has no weight set.
public Double getEdgeWeight(Node p_a, Node p_b) { Edge edge = makeEdge(p_a, p_b); int id = edge.hashCode(); return weights.get(id); }
[ "public double getEdgeWeight(Vertex vtx1, Vertex vtx2);", "double getEdgeWeight();", "public int getEdgeWeight(T vertex1, T vertex2){\n if (isEdge(vertex1, vertex2)){\n return edges[vertexIndex(vertex1)][vertexIndex(vertex2)];\n }\n return NOT_FOUND;\n }", "public int getWeight(){\n\t\treturn t...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Construct graph stats object
public GraphStats(Graph graph) { this.graph = graph; }
[ "public GraphInfo(){}", "public Graph() {}", "abstract T createStats();", "private Stats(){}", "private MetricStats createMetricStats() {\n\t\tMetricStats stats = new MetricStats();\n\t\tstats.setMaximum(new Double(maximum));\n\t\tstats.setMinimum(new Double(minimum));\n\t\tstats.setSum(new Double(sum));\n\...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
/ Time complexity: O(N Log N) + O(N) Space complexity: O(1) ALGORITHM: 1) Sort all intervals in decreasing order of start time. 2) Traverse sorted intervals starting from first interval, do following for every interval. a) If current interval is not first interval and it overlaps with previous interval, then merge it w...
public static List<Interval> mergeIntervalsInSpace(List<Interval> intervalList) { Collections.sort(intervalList, new Comparator<Interval>() { public int compare(Interval interval1, Interval interval2) { return interval2.start - interval1.start; } }); Lis...
[ "private void merge(List<Interval> list) {\n if(list == null) {\n return;\n }\n \n // first sort the list on their start time\n Collections.sort(list, new Comparator<Interval>() {\n\n @Override\n public int compare(Interval i1, Interval i2) {\n ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Return true for a spy.
public boolean isSpy() { return _isSpy; }
[ "boolean isSpy(int agent){\n boolean spy = false;\n for(int i = 0; i< spies.length; i++)\n spy = spy || spies[i]==agent;\n return spy;\n }", "static boolean isSpy(long id) {\n\t\treturn !isMarmot[(int)id];\n\t}", "public boolean useOn(Spy spy)\n\t{\n\t\tspy.setRadar(true);\n\t\treturn t...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Build call for updateFulfillmentState
public com.squareup.okhttp.Call updateFulfillmentStateCall(Integer orderId, OrderFulfillmentStatusUpdate fulfillmentStatusRequest, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { Object localVarPostBod...
[ "interface WithState {\n /**\n * Specifies the state property: If specified, the value must be Shipping, which tells the Import/Export\n * service that the package for the job has been shipped. The ReturnAddress and DeliveryPackage properties\n * must have been set eit...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
A command representing a drawn point.
public Command(Paint paint, Point point) { cmdPaint = new Paint(paint); cmdPath = null; cmdPoint = new Point(point); }
[ "public void draw() {\r\n /* DO NOT MODIFY */\r\n StdDraw.point(x, y);\r\n }", "public void draw() {\n /* DO NOT MODIFY */\n StdDraw.point(x, y);\n }", "public void drawTo(Point p) {\n StdDraw.line(this.x, this.y, p.x, p.y);\n }", "public void pointSelect(Point p) {...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Returns user of given name or null if the user has not been found.
public MsUser getUser(final String name) { for (final MsUser user : users) { if (user.getName().equals(name)) { return user; } } return null; }
[ "public static Optional<User> getUser(String name) {\n\t\ttry {\n\t\t\treturn getUser(UUID.fromString(name));\n\t\t} catch (Exception e) {\n\t\t\tif (Sponge.getServer().getPlayer(name).isPresent()) {\n\t\t\t\treturn wrap(Sponge.getServer().getPlayer(name).orElse(null));\n\t\t\t}\n\t\t\tUserStorageService storage = ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Allows to turn on/off sharing statistics ability.
private void toggleShareStatistics() { if(mShareStatsCheckBox == null) { return; } boolean shareStatistics = mShareStatsCheckBox.isChecked(); if(shareStatistics) { GoogleAnalytics.getInstance(this).reportActivityStart(this); } else { GoogleAna...
[ "void setStatisticsEnabled(boolean statsEnabled);", "private void setUsageStatisticsStatus() {\n final Preference pref = findPreference(R.string.pref_key_modify_usage_statistics);\n final PackageManager pm = pref.getContext().getPackageManager();\n\n pref.setEnabled(pref.getIntent().resolveAc...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Criar o addViewControllers quando for criar a tela de login
@Override public void addViewControllers(ViewControllerRegistry registry) { //Pode apagar tudo o que tiver dentro registry.addViewController("/login").setViewName("/login"); registry.setOrder(Ordered.LOWEST_PRECEDENCE); }
[ "@Override\r\n\tpublic void addViewControllers(ViewControllerRegistry registry) {\r\n\t\t// registry.addViewController(\"/login\").setViewName(\"login\");\r\n\t}", "public void crearControladorLogin() {\r\n this.contLog = new ControladorLogin(this);\r\n }", "public void istanziaLoginAction() {\n\t\t\n...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Returns the value of the 'Event Type Emit Event Action' reference.
EventType getEventType__EmitEventAction();
[ "@VTID(27)\r\n java.lang.String getOnAction();", "com.netflix.conductor.proto.EventHandlerPb.EventHandler.Action.Type getAction();", "@DISPID(1610874906) //= 0x6004001a. The runtime will prefer the VTID if present\r\n @VTID(56)\r\n java.lang.String getOnAction();", "public SoHandleEventAction getAct...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Sets the postal code.
public void setPostalCode(String postalCode) { this.postalCode = postalCode; }
[ "public void setPostalcode(int value) {\n this.postalcode = value;\n }", "public void setPostalCode(java.lang.String postalCode)\n {\n synchronized (monitor())\n {\n check_orphaned();\n org.apache.xmlbeans.SimpleValue target = null;\n tar...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
hole alle StationsInformationen von der Api
private static StationInformation[] getStationInformations() { return restTemplate.getForObject(URI + ACTIVE_STATIONS, StationInformation[].class); }
[ "public abstract Map<Integer, Station> getStationsCurrentlyWithSmSt() throws DataAccessException;", "private void loadStations() {\n mSearchLocationView.setLoadingStatusForStations();\n\n // Build and queue a GET request to get the latest data from the BikeShare API\n Retrofit retrofit = new ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
A test where the connection fails twice and then the get operation succeeds (jobunrelated blob).
@Test public void testBlobFetchRetries() throws IOException { testBlobFetchRetries(new VoidBlobStore(), null, TRANSIENT_BLOB); }
[ "@Test\n public void testBlobForJobFetchRetries() throws IOException {\n testBlobFetchRetries(new VoidBlobStore(), new JobID(), TRANSIENT_BLOB);\n }", "@Test(expected = ConnectionException.class)\n public void testJobGetConnectionException() throws P4JavaException {\n when(server.execMapCmd...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
gov.georgia.dhr.dfcs.sacwis.structs.output.ROWCSUB45SOG01 getROWCSUB45SOG01() Returns the value of field 'szNmPersonFull'.
public java.lang.String getSzNmPersonFull() { return this._szNmPersonFull; }
[ "public gov.georgia.dhr.dfcs.sacwis.structs.output.ROWCSUB45SOG01 getROWCSUB45SOG01()\r\n {\r\n return this._ROWCSUB45SOG01;\r\n }", "public void setROWCSUB45SOG01(gov.georgia.dhr.dfcs.sacwis.structs.output.ROWCSUB45SOG01 ROWCSUB45SOG01)\r\n {\r\n this._ROWCSUB45SOG01 = ROWCSUB45SOG01;\r\n ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Use internal camera activity
private void callCameraActivity() { Intent cameraintent = new Intent(MediaStore.ACTION_IMAGE_CAPTURE); startActivityForResult(cameraintent,CAMERA_ACTIVITY_CODE); //Use customized camera activity //Intent cameraintent = new Intent(this,CameraActivity.class); //startActivityForResult(cameraintent,CAMERA_ACTIV...
[ "private void openCamera() {\n Intent cam = new Intent(MediaStore.ACTION_IMAGE_CAPTURE);\n startActivityForResult(cam, REQUEST_CODE);\n }", "private void openCameraActivity(){\n Intent intent = new Intent(getApplicationContext(), HeartRateMonitor.class);\n startActivity(intent);\n ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Write the audio data to a WAV file using the AudioSystem class (omitted for brevity)
private static void writeWavFile(String fileName, byte[] audioData, int sampleRate, int sampleSize, int numChannels) { }
[ "public native int writeAudio(byte[] data, int offset, int length, long timestamp);", "public void saveAsWaveFile() throws IOException, FileNotFoundException, IOException, UnsupportedAudioFileException\n {\n File savedTempFile = new File(\"audioTemp.Bytes\");\n \n FileInputStream fis =...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Returns the first bookmarks entry in the ordered set where companyId = &63; and status ≠ &63;.
public static BookmarksEntry fetchByC_NotS_First(long companyId, int status, OrderByComparator<BookmarksEntry> orderByComparator) { return getPersistence() .fetchByC_NotS_First(companyId, status, orderByComparator); }
[ "public BookmarksEntry fetchByC_NotS_First(long companyId, int status,\n\t\tcom.liferay.portal.kernel.util.OrderByComparator<BookmarksEntry> orderByComparator);", "public java.util.List<BookmarksEntry> findByC_NotS(long companyId,\n\t\tint status);", "public Todo fetchByC_S_First(\n\t\tlong companyId, int statu...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Verify nextState method behavior with valid parameters.
public static void nextStateValidParametersTest() { TableDrivenFSA t1 = new TableDrivenFSA(TEST_DATA_FILE_NAME); assertEquals(1, t1.nextState(0, "a")); assertEquals(2, t1.nextState(0, "b")); assertEquals(3, t1.nextState(0, "c")); assertEquals(0, t1.nextState(1, "a")); ass...
[ "public static void nextStateInvalidParameterTest() {\n TableDrivenFSA t1 = new TableDrivenFSA(TEST_DATA_FILE_NAME);\n assertEquals(0, t1.nextState(0, \"x\"));\n assertEquals(6, t1.nextState(6, \"b\"));\n assertEquals(8, t1.nextState(8, \"quack\"));\n assertEquals(-1, t1.nextState...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
$ANTLR end "rule__ClockDefinition__IntValueAssignment_1_0" $ANTLR start "rule__ClockDefinition__TimeValueAssignment_1_1" InternalReflex.g:9644:1: rule__ClockDefinition__TimeValueAssignment_1_1 : ( RULE_TIME ) ;
public final void rule__ClockDefinition__TimeValueAssignment_1_1() throws RecognitionException { int stackSize = keepStackSize(); try { // InternalReflex.g:9648:1: ( ( RULE_TIME ) ) // InternalReflex.g:9649:2: ( RULE_TIME ) { // InternalReflex...
[ "public final void rule__ClockDefinition__Alternatives_1() throws RecognitionException {\n\n \t\tint stackSize = keepStackSize();\n \t\n try {\n // InternalReflex.g:1587:1: ( ( ( rule__ClockDefinition__IntValueAssignment_1_0 ) ) | ( ( rule__ClockDefinition__TimeValueAssignment_1_1 ) ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
initializer for add to wishlist page
private void initAddToWishlistPage(IUserAccount user) throws Exception { String addToWishlistButtonText = languageRB.getString("addToWishlistButtonText"); int height = tradingSystemGUINavigator.getInventoryNavigator().size(); // setting the frame of the page for adding item addToWishli...
[ "public void WishListAdd()\n {\n wait.until(ExpectedConditions.elementToBeClickable(ObjectRepo.WishlistBTNLocator));\n WebElement wishlistBtn = driver.findElement(ObjectRepo.WishlistBTNLocator);\n wishlistBtn.click();\n }", "public ItemPage clickAddToWishlistLink() {\n addToWishl...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Gets the timeseries master.
public HistoricalTimeSeriesMaster getHistoricalTimeSeriesMaster() { return getParentResource().getHistoricalTimeSeriesMaster(); }
[ "public TimeSeriesMaster<?> getTimeSeriesMaster() {\n return _timeSeriesMaster;\n }", "public HistoricalTimeSeriesMaster getHistoricalTimeSeriesMaster() {\n return _historicalTimeSeriesMaster;\n }", "@Override\n public HistoricalTimeSeriesMaster getHistoricalTimeSeriesMaster() {\n return _toolContex...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
stations are monitors for train threads when a train arrives, it will acquire the lock on the station. train will wait, passengers will get notified (notifyall()) and load on the train
public Station(){ RemoveTrain(); passengers = new ArrayList(); this.LockInit(); this.CondInit(); Thread stationThread = new Thread(this); stationThread.start(); // pm = new PassengerMaker(); // Thread pmThread = new Thread(pm); // p...
[ "void checkAvailableTrainByStation(Train train, String station);", "public void waitUntilTrainPasses(Train train) {\n\t\tthis.wait = train;\n\t}", "public void addTrain(Train myTrain) {\n\t\t\tlock.lock();\n\t\t\ttry {\n\t\t\t\twhile(capacity == 0) {\n\t\t\t\t\tmyTrain.setTrack(this);\n\t\t cond.awai...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Clone a media file using MediaMuxer
private void cloneMediaUsingMuxer(int srcMedia, String dstMediaPath, int expectedTrackCount, int degrees) throws IOException { // Set up MediaExtractor to read from the source. AssetFileDescriptor srcFd = mResources.openRawResourceFd(srcMedia); MediaExtracto...
[ "public void copy() {\n\t\tObject[] data = super.copyMediaData();\n\t\tAudioBook clone = new AudioBook((String)data[0],(String)data[1],(String)data[2],(String)data[3],((Boolean)data[4]).booleanValue(),((Integer)data[5]).intValue(),\n\t\t\t\tthis.author,this.narrator);\n\t}", "@Test\r\n public void bufferMusic...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
This returns the Song of the Record
public String getSong() { return this.Song; }
[ "public SongsResultsTableItem getSong(int track){\r\n\t\treturn songs.get(track);\r\n\t}", "public Song getSong() {\n\t\treturn song;\n\t}", "public SongObject getSong() {\n\t\treturn song;\n\t}", "public String getSong() {\r\n\r\n return this.songName;\r\n }", "@Override\n public Song getSongR...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Database column used for ON DUPLICATE KEY UPDATE
public String getDuplicateUpdateColumnString() { return null; }
[ "int upsert(UserShare5Min record);", "Updater setOnInsert(String field, Object value);", "@Test\n\tpublic void testOnDuplicateKeyUpdateBugFix() throws SQLException, DataException {\n\t\tResultSet resultSet;\n\n\t\ttry (final HSQLDBRepository hsqldb = (HSQLDBRepository) RepositoryManager.getRepository()) {\n\t\t...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Turn on or off the drawing of a bounding rect around the canvas contents (generally for debugging purposes)
public void setDrawCanvasContentBoundingRect(boolean drawCanvasContentBoundingRect) { this.drawCanvasContentBoundingRect = drawCanvasContentBoundingRect; invalidate(); }
[ "public void setRectangle() {\n ((MyPCanvas) canvas).setSelectionEventHandler(this.rectangleSelectionEventHandler);\n PNotificationCenter.defaultCenter().addListener(this, \"selectionChanged\", PSelectionEventHandler.SELECTION_CHANGED_NOTIFICATION,\n this.rectangleSelectionEventHandler)...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
/ this method is used to view all the library items available in the libraryy including DVD and books
public Result viewLibryItems() throws SQLException { String itemName = request().body().asText(); JsonNode json = Json.parse(itemName); String libItemName = json.get("ItemName").textValue(); System.out.println(libItemName); westminsterLibryManager westminsterLibryManager = new...
[ "static void viewAllBooks() {\n List<Book> viewAll = Library.viewBookList();\n System.out.println(viewAll);\n }", "private void browseBooks() {\n System.out.println(\"Title: Genre||\\n\");\n for (Book b: library.getBooks()) {\n System.out.println(b.getTitle() + \": \" + b.getCatego...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Optimistically reinitialize lastIndex to be the current server's state. Clear the confirmedIndex so that we only make commit decisions based on follower replies we receive in this term.
private void resetFollowers() { lastIndex.clear(); confirmedIndex.clear(); confirmedIndex.put(id, log.getLast()); for (ServerID follower : configuration.getFollowers()) { lastIndex.put(follower, log.getLast()); } }
[ "public void reindexingTraversalEnd() {\n messagePrefix = INDEX_MSG;\n }", "public void onIndexReset();", "public final void setLatestPostNumber(final int lastIndex) {\n\t\tthis.latestPostNumber = lastIndex;\n\t}", "public void resetActiveAfterUpdate() {\n if (activeTokenListIndex != -1) {\n ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
/ methods to get color of webElement star
public String getColorOfWebElementStar(int star, String xpath) { String color = null; int i = 1; HashMap<Integer, WebElement> map = mapStarWithKey(xpath); mouseHover((WebElement) map.get(star)); while (i <= star) { color = ((WebElement) map.get(star)).getCssValue("color"); i++; } return color; }
[ "public int getColor( )\r\n {\r\n return color;\r\n }", "String getStartColor();", "float getRed();", "public void getColor() {\n\t\tPoint point = MouseInfo.getPointerInfo().getLocation();\n\t\trobot.mouseMove(point.x, point.y);\n\t\tColor color = robot.getPixelColor(point.x, point.y);\n//\t\...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
$ANTLR end "entryRuleNumber" $ANTLR start "ruleNumber" InternalJSchema.g:87:1: ruleNumber : ( ( rule__Number__Group__0 ) ) ;
public final void ruleNumber() throws RecognitionException { int stackSize = keepStackSize(); try { // InternalJSchema.g:91:2: ( ( ( rule__Number__Group__0 ) ) ) // InternalJSchema.g:92:2: ( ( rule__Number__Group__0 ) ) { // InternalJSchema.g:...
[ "public final void ruleNumber() throws RecognitionException {\n\n \t\tHiddenTokens myHiddenTokenState = ((XtextTokenStream)input).setHiddenTokens();\n \t\tint stackSize = keepStackSize();\n \n try {\n // ../org.iworkz.qon.ui/src-gen/org/iworkz/qon/ui/contentassist/antlr/in...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Populates the reviews from a given JSON file.
protected void populateReviews(String filePath) throws IOException { File file = new File(filePath); BufferedReader fileReader = new BufferedReader(new FileReader(file)); String line; while ((line = fileReader.readLine()) != null) { StringReader sr = new StringReader(line); JsonReader parseFile = Js...
[ "private ArrayList<Review> processReviewFile(String reviewsJSONfilename) {\n ArrayList<Review> reviewList = new ArrayList<Review>();\n JSONParser parser = new JSONParser();\n BufferedReader reviewFile;\n try {\n reviewFile = new BufferedReader(new FileReader(reviewsJSONfilenam...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }