query stringlengths 74 6.1k | positive listlengths 1 1 | negative listlengths 9 9 |
|---|---|---|
public int getNumWeights() {
if (weights == null) return 0;
int numWeights = 0;
for (double[] wts : weights) {
numWeights += wts.length;
}
return numWeights;
} | [
"Returns the total number of weights associated with this classifier.\n\n@return number of weights"
] | [
"Returns the list of store defs as a map\n\n@param storeDefs\n@return",
"Returns a non-validating XML parser. The parser ignores both DTDs and XSDs.\n\n@return An XML parser in the form of a DocumentBuilder",
"Use this API to fetch all the bridgetable resources that are configured on netscaler.",
"Retrieve co... |
public static lbvserver[] get_filtered(nitro_service service, filtervalue[] filter) throws Exception{
lbvserver obj = new lbvserver();
options option = new options();
option.set_filter(filter);
lbvserver[] response = (lbvserver[]) obj.getfiltered(service, option);
return response;
} | [
"Use this API to fetch filtered set of lbvserver resources.\nset the filter parameter values in filtervalue object."
] | [
"Copies entries in the source map to target map.\n\n@param source source map\n@param target target map",
"Creates a resource key for given enumeration value. By convention,\nresource bundle for enumerations has the name of enumeration class\nand value identifier is the same as enumeration value name.\n@param valu... |
private void cleanUpAction() {
try {
m_model.deleteDescriptorIfNecessary();
} catch (CmsException e) {
LOG.error(m_messages.key(Messages.ERR_DELETING_DESCRIPTOR_0), e);
}
// unlock resource
m_model.unlock();
} | [
"Unlock all edited resources."
] | [
"Returns the index descriptor definition of the given name if it exists.\n\n@param name The name of the index\n@return The index descriptor definition or <code>null</code> if there is no such index",
"Constructs and sets the layout parameters to have some gravity.\n\n@param gravity the gravity of the Crouton\n@re... |
public String updateClassification(String classificationType) {
Metadata metadata = new Metadata("enterprise", Metadata.CLASSIFICATION_TEMPLATE_KEY);
metadata.add("/Box__Security__Classification__Key", classificationType);
Metadata classification = this.updateMetadata(metadata);
return classification.getString(Metadata.CLASSIFICATION_KEY);
} | [
"Updates a metadata classification on the specified file.\n\n@param classificationType the metadata classification type.\n@return the new metadata classification type updated on the file."
] | [
"get all consumers for the group\n\n@param zkClient the zookeeper client\n@param group the group name\n@return topic->(consumerIdStringA-0,consumerIdStringA-1...consumerIdStringB-0,consumerIdStringB-1)",
"Use this API to add vpath.",
"Save the current file as the given type.\n\n@param file target file\n@p... |
public static base_responses restore(nitro_service client, appfwprofile resources[]) throws Exception {
base_responses result = null;
if (resources != null && resources.length > 0) {
appfwprofile restoreresources[] = new appfwprofile[resources.length];
for (int i=0;i<resources.length;i++){
restoreresources[i] = new appfwprofile();
restoreresources[i].archivename = resources[i].archivename;
}
result = perform_operation_bulk_request(client, restoreresources,"restore");
}
return result;
} | [
"Use this API to restore appfwprofile resources."
] | [
"Takes a date, and retrieves the next business day\n\n@param dateString the date\n@param onlyBusinessDays only business days\n@return a string containing the next business day",
"Get a message bundle of the given type.\n\n@param type the bundle type class\n\n@return the bundle",
"Copy the data from an InputStre... |
public PhotoList<Photo> getContactsPublicPhotos(String userId, int count, boolean justFriends, boolean singlePhoto, boolean includeSelf)
throws FlickrException {
return getContactsPublicPhotos(userId, Extras.MIN_EXTRAS, count, justFriends, singlePhoto, includeSelf);
} | [
"Get public photos from the user's contacts.\n\nThis method does not require authentication.\n\n@see com.flickr4java.flickr.photos.Extras\n@param userId\nThe user ID\n@param count\nThe number of photos to return\n@param justFriends\nTrue to include friends\n@param singlePhoto\nTrue to get a single photo\n@param inc... | [
"Converts a vector from eigen space into sample space.\n\n@param eigenData Eigen space data.\n@return Sample space projection.",
"Reads a file and returns the result in a String\n\n@param file File\n@return String\n@throws IOException",
"Returns the class hierarchy of the given type, from bottom to top, startin... |
public QueryBuilder<T, ID> groupBy(String columnName) {
FieldType fieldType = verifyColumnName(columnName);
if (fieldType.isForeignCollection()) {
throw new IllegalArgumentException("Can't groupBy foreign collection field: " + columnName);
}
addGroupBy(ColumnNameOrRawSql.withColumnName(columnName));
return this;
} | [
"Add \"GROUP BY\" clause to the SQL query statement. This can be called multiple times to add additional \"GROUP BY\"\nclauses.\n\n<p>\nNOTE: Use of this means that the resulting objects may not have a valid ID column value so cannot be deleted or\nupdated.\n</p>"
] | [
"Wrapped version of standard jdbc executeUpdate Pays attention to DB\nlocked exception and waits up to 1s\n\n@param query SQL query to execute\n@throws Exception - will throw an exception if we can never get a lock",
"Updates the date and time formats.\n\n@param properties project properties",
"Generates a full... |
public void delete() {
BoxAPIConnection api = this.getAPI();
URL url = COLLABORATION_WHITELIST_ENTRY_URL_TEMPLATE.build(api.getBaseURL(), this.getID());
BoxAPIRequest request = new BoxAPIRequest(api, url, HttpMethod.DELETE);
BoxAPIResponse response = request.send();
response.disconnect();
} | [
"Deletes this collaboration whitelist."
] | [
"Get the underlying channel. This may block until the channel is set.\n\n@return the channel\n@throws IOException for any error",
"Add a listener to be invoked when the checked button changes in this group.\n@param listener\n@param <T>\n@return",
"Returns the associated SQL WHERE statement.",
"Most complete o... |
public void load(String soundFile)
{
if (mSoundFile != null)
{
unload();
}
mSoundFile = soundFile;
if (mAudioListener != null)
{
mAudioListener.getAudioEngine().preloadSoundFile(soundFile);
Log.d("SOUND", "loaded audio file %s", getSoundFile());
}
} | [
"Preloads a sound file.\n\n@param soundFile path/name of the file to be played."
] | [
"Process start.\n\n@param endpoint the endpoint\n@param eventType the event type",
"For a particular stealer node find all the primary partitions tuples it\nwill steal.\n\n@param currentCluster The cluster definition of the existing cluster\n@param finalCluster The final cluster definition\n@param stealNodeId Nod... |
public void updateShownOptions(boolean showModeSwitch, boolean showAddKeyOption) {
if (showModeSwitch != m_showModeSwitch) {
m_upperLeftComponent.removeAllComponents();
m_upperLeftComponent.addComponent(m_languageSwitch);
if (showModeSwitch) {
m_upperLeftComponent.addComponent(m_modeSwitch);
}
m_upperLeftComponent.addComponent(m_filePathLabel);
m_showModeSwitch = showModeSwitch;
}
if (showAddKeyOption != m_showAddKeyOption) {
if (showAddKeyOption) {
m_optionsComponent.addComponent(m_lowerLeftComponent, 0, 1);
m_optionsComponent.addComponent(m_lowerRightComponent, 1, 1);
} else {
m_optionsComponent.removeComponent(0, 1);
m_optionsComponent.removeComponent(1, 1);
}
m_showAddKeyOption = showAddKeyOption;
}
} | [
"Update which options are shown.\n@param showModeSwitch flag, indicating if the mode switch should be shown.\n@param showAddKeyOption flag, indicating if the \"Add key\" row should be shown."
] | [
"Process a beat packet, potentially updating the master tempo and sending our listeners a master\nbeat notification. Does nothing if we are not active.",
"Converts a submatrix into an extract matrix operation.\n@param variableTarget The variable in which the submatrix is extracted from",
"Gets the file from whi... |
public static base_responses enable(nitro_service client, String trapname[]) throws Exception {
base_responses result = null;
if (trapname != null && trapname.length > 0) {
snmpalarm enableresources[] = new snmpalarm[trapname.length];
for (int i=0;i<trapname.length;i++){
enableresources[i] = new snmpalarm();
enableresources[i].trapname = trapname[i];
}
result = perform_operation_bulk_request(client, enableresources,"enable");
}
return result;
} | [
"Use this API to enable snmpalarm resources of given names."
] | [
"This method writes assignment data to a Planner file.",
"Call the Yahoo! PlaceFinder service for a result.\n\n@param q\nsearch string\n@param maxRows\nmax number of rows in result, or 0 for all\n@param locale\nlocale for strings\n@return list of found results\n@throws Exception\noops\n@see <a\nhref=\"http://deve... |
private YearWeek with(int newYear, int newWeek) {
if (year == newYear && week == newWeek) {
return this;
}
return of(newYear, newWeek);
} | [
"Returns a copy of this year-week with the new year and week, checking\nto see if a new object is in fact required.\n\n@param newYear the year to represent, validated from MIN_YEAR to MAX_YEAR\n@param newWeek the week to represent, validated from 1 to 53\n@return the year-week, not null"
] | [
"Try to extract a numeric version from a collection of strings.\n\n@param versionStrings Collection of string properties.\n@return The version string if exists in the collection.",
"Resolves the POM for the specified parent.\n\n@param parent the parent coordinates to resolve, must not be {@code null}\n@return The... |
@Override
protected final void subAppend(final LoggingEvent event) {
if (event instanceof ScheduledFileRollEvent) {
// the scheduled append() call has been made by a different thread
synchronized (this) {
if (this.closed) {
// just consume the event
return;
}
this.rollFile(event);
}
} else if (event instanceof FileRollEvent) {
// definitely want to avoid rolling here whilst a file roll event is still being handled
super.subAppend(event);
} else {
if(event instanceof FoundationLof4jLoggingEvent){
FoundationLof4jLoggingEvent foundationLof4jLoggingEvent = (FoundationLof4jLoggingEvent)event;
foundationLof4jLoggingEvent.setAppenderName(this.getName());
}
this.rollFile(event);
super.subAppend(event);
}
} | [
"Responsible for executing file rolls as and when required, in addition to\ndelegating to the super class to perform the actual append operation.\nSynchronized for safety during enforced file roll.\n\n@see org.apache.log4j.WriterAppender#subAppend(org.apache.log4j.spi.LoggingEvent)"
] | [
"Retrieve the var data key for a specific field.\n\n@param type field type\n@return var data key",
"Returns a representation of the date from the value attributes as ISO\n8601 encoding.\n\n@param value\n@return ISO 8601 value (String)",
"Generates a schedule based on some meta data. The schedule generation\ncon... |
public ItemRequest<Project> createInWorkspace(String workspace) {
String path = String.format("/workspaces/%s/projects", workspace);
return new ItemRequest<Project>(this, Project.class, path, "POST");
} | [
"If the workspace for your project _is_ an organization, you must also\nsupply a `team` to share the project with.\n\nReturns the full record of the newly created project.\n\n@param workspace The workspace or organization to create the project in.\n@return Request object"
] | [
"Gen error response.\n\n@param t\nthe t\n@return the response on single request",
"Initialize current thread's JobContext using specified copy\n@param origin the original job context",
"Looks up the EJB in the container and executes the method on it\n\n@param self the proxy instance.\n@param method the over... |
public static void handleDomainOperationResponseStreams(final OperationContext context,
final ModelNode responseNode,
final List<OperationResponse.StreamEntry> streams) {
if (responseNode.hasDefined(RESPONSE_HEADERS)) {
ModelNode responseHeaders = responseNode.get(RESPONSE_HEADERS);
// Strip out any stream header as the header created by this process is what counts
responseHeaders.remove(ATTACHED_STREAMS);
if (responseHeaders.asInt() == 0) {
responseNode.remove(RESPONSE_HEADERS);
}
}
for (OperationResponse.StreamEntry streamEntry : streams) {
context.attachResultStream(streamEntry.getUUID(), streamEntry.getMimeType(), streamEntry.getStream());
}
} | [
"Deal with streams attached to an operation response from a proxied domain process.\n\n@param context the context of the operation\n@param responseNode the DMR response from the proxied process\n@param streams the streams associated with the response"
] | [
"why isn't this functionality in enum?",
"Remove a partition from the node provided\n\n@param node The node from which we're removing the partition\n@param donatedPartition The partitions to remove\n@return The new node without the partition",
"Handles an incoming request message.\nAn incoming request message i... |
private JSONValue datesToJsonArray(Collection<Date> dates) {
if (null != dates) {
JSONArray result = new JSONArray();
for (Date d : dates) {
result.set(result.size(), dateToJson(d));
}
return result;
}
return null;
} | [
"Converts a collection of dates to a JSON array with the long representation of the dates as strings.\n@param dates the list to convert.\n@return JSON array with long values of dates as string"
] | [
"Clear the selection of all items.\n@param requestLayout request layout after clear selection if the flag is true, no layout\nrequested otherwise\n@return {@code true} if at least one item was deselected,\n{@code false} otherwise.",
"Static factory method.\n\n@param targetVariable\nthe variable to find the effect... |
public void begin(String key)
{
if (key == null)
{
return;
}
TimingData data = executionInfo.get(key);
if (data == null)
{
data = new TimingData(key);
executionInfo.put(key, data);
}
data.begin();
} | [
"Start timing an operation with the given identifier."
] | [
"Use this API to fetch all the cmppolicylabel resources that are configured on netscaler.",
"IN Criteria with SubQuery\n@param attribute The field name to be used\n@param subQuery The subQuery",
"Stop finding signatures for all active players.",
"Called from the native side\n@param eye",
"Callback from the... |
@Override
public Future<GcsFileMetadata> readObjectAsync(final ByteBuffer dst, final GcsFilename filename,
long startOffsetBytes, long timeoutMillis) {
Preconditions.checkArgument(startOffsetBytes >= 0, "%s: offset must be non-negative: %s", this,
startOffsetBytes);
final int n = dst.remaining();
Preconditions.checkArgument(n > 0, "%s: dst full: %s", this, dst);
final int want = Math.min(READ_LIMIT_BYTES, n);
final HTTPRequest req = makeRequest(filename, null, GET, timeoutMillis);
req.setHeader(
new HTTPHeader(RANGE, "bytes=" + startOffsetBytes + "-" + (startOffsetBytes + want - 1)));
final HTTPRequestInfo info = new HTTPRequestInfo(req);
return new FutureWrapper<HTTPResponse, GcsFileMetadata>(urlfetch.fetchAsync(req)) {
@Override
protected GcsFileMetadata wrap(HTTPResponse resp) throws IOException {
long totalLength;
switch (resp.getResponseCode()) {
case 200:
totalLength = getLengthFromHeader(resp, X_GOOG_CONTENT_LENGTH);
break;
case 206:
totalLength = getLengthFromContentRange(resp);
break;
case 404:
throw new FileNotFoundException("Could not find: " + filename);
case 416:
throw new BadRangeException("Requested Range not satisfiable; perhaps read past EOF? "
+ URLFetchUtils.describeRequestAndResponse(info, resp));
default:
throw HttpErrorHandler.error(info, resp);
}
byte[] content = resp.getContent();
Preconditions.checkState(content.length <= want, "%s: got %s > wanted %s", this,
content.length, want);
dst.put(content);
return getMetadataFromResponse(filename, resp, totalLength);
}
@Override
protected Throwable convertException(Throwable e) {
return OauthRawGcsService.convertException(info, e);
}
};
} | [
"Might not fill all of dst."
] | [
"Adds a new point.\n\n@param point a point\n@return this for chaining",
"Apply any applicable header overrides to request\n\n@param httpMethodProxyRequest\n@throws Exception",
"a small static helper class to get the color from the colorHolder\n\n@param colorHolder\n@param ctx\n@return",
"These exact lines are... |
private TrackMetadata requestMetadataInternal(final DataReference track, final CdjStatus.TrackType trackType,
final boolean failIfPassive) {
// First check if we are using cached data for this request.
MetadataCache cache = getMetadataCache(SlotReference.getSlotReference(track));
if (cache != null && trackType == CdjStatus.TrackType.REKORDBOX) {
return cache.getTrackMetadata(null, track);
}
// Then see if any registered metadata providers can offer it for us.
final MediaDetails sourceDetails = getMediaDetailsFor(track.getSlotReference());
if (sourceDetails != null) {
final TrackMetadata provided = allMetadataProviders.getTrackMetadata(sourceDetails, track);
if (provided != null) {
return provided;
}
}
// At this point, unless we are allowed to actively request the data, we are done. We can always actively
// request tracks from rekordbox.
if (passive.get() && failIfPassive && track.slot != CdjStatus.TrackSourceSlot.COLLECTION) {
return null;
}
// Use the dbserver protocol implementation to request the metadata.
ConnectionManager.ClientTask<TrackMetadata> task = new ConnectionManager.ClientTask<TrackMetadata>() {
@Override
public TrackMetadata useClient(Client client) throws Exception {
return queryMetadata(track, trackType, client);
}
};
try {
return ConnectionManager.getInstance().invokeWithClientSession(track.player, task, "requesting metadata");
} catch (Exception e) {
logger.error("Problem requesting metadata, returning null", e);
}
return null;
} | [
"Ask the specified player for metadata about the track in the specified slot with the specified rekordbox ID,\nusing cached media instead if it is available, and possibly giving up if we are in passive mode.\n\n@param track uniquely identifies the track whose metadata is desired\n@param trackType identifies the typ... | [
"calls _initMH on the method handler and then stores the result in the\nmethodHandler field as then new methodHandler",
"Deletes the disabled marker file in the directory of the specified version.\n\n@param version to enable\n@throws PersistenceFailureException if the marker file could not be deleted (can happen ... |
private String generateAbbreviatedExceptionMessage(final Throwable throwable) {
final StringBuilder builder = new StringBuilder();
builder.append(": ");
builder.append(throwable.getClass().getCanonicalName());
builder.append(": ");
builder.append(throwable.getMessage());
Throwable cause = throwable.getCause();
while (cause != null) {
builder.append('\n');
builder.append("Caused by: ");
builder.append(cause.getClass().getCanonicalName());
builder.append(": ");
builder.append(cause.getMessage());
// make sure the exception cause is not itself to prevent infinite
// looping
assert (cause != cause.getCause());
cause = (cause == cause.getCause() ? null : cause.getCause());
}
return builder.toString();
} | [
"Method generates abbreviated exception message.\n\n@param message\nOriginal log message\n@param throwable\nThe attached throwable\n@return Abbreviated exception message"
] | [
"Create a new collaboration object.\n@param api the API connection used to make the request.\n@param accessibleBy the JSON object describing who should be collaborated.\n@param item the JSON object describing which item to collaborate.\n@param role the role to give the collaborators.\n@para... |
public void deployApplication(String applicationName, String... classpathLocations) throws IOException {
final List<URL> classpathElements = Arrays.stream(classpathLocations)
.map(classpath -> Thread.currentThread().getContextClassLoader().getResource(classpath))
.collect(Collectors.toList());
deployApplication(applicationName, classpathElements.toArray(new URL[classpathElements.size()]));
} | [
"Deploys application reading resources from specified classpath location\n\n@param applicationName to configure in cluster\n@param classpathLocations where resources are read\n@throws IOException"
] | [
"Moves a particular enum option to be either before or after another specified enum option in the custom field.\n\n@param customField Globally unique identifier for the custom field.\n@return Request object",
"Method will be executed asynchronously.",
"Pump events from event stream.",
"Calls afterMaterializa... |
public void seekToMonth(String direction, String seekAmount, String month) {
int seekAmountInt = Integer.parseInt(seekAmount);
int monthInt = Integer.parseInt(month);
assert(direction.equals(DIR_LEFT) || direction.equals(DIR_RIGHT));
assert(monthInt >= 1 && monthInt <= 12);
markDateInvocation();
// set the day to the first of month. This step is necessary because if we seek to the
// current day of a month whose number of days is less than the current day, we will
// pushed into the next month.
_calendar.set(Calendar.DAY_OF_MONTH, 1);
// seek to the appropriate year
if(seekAmountInt > 0) {
int currentMonth = _calendar.get(Calendar.MONTH) + 1;
int sign = direction.equals(DIR_RIGHT) ? 1 : -1;
int numYearsToShift = seekAmountInt +
(currentMonth == monthInt ? 0 : (currentMonth < monthInt ? sign > 0 ? -1 : 0 : sign > 0 ? 0 : -1));
_calendar.add(Calendar.YEAR, (numYearsToShift * sign));
}
// now set the month
_calendar.set(Calendar.MONTH, monthInt - 1);
} | [
"seeks to a particular month\n\n@param direction the direction to seek: two possibilities\n'<' go backward\n'>' go forward\n\n@param seekAmount the amount to seek. Must be guaranteed to parse as an integer\n\n@param month the month to seek to. Must be guaranteed to parse as an integer\nbetween 1 and 12"
] | [
"As already described, but if separator is not null, then objects\nsuch as TaggedWord\n\n@param separator The string used to separate Word and Tag\nin TaggedWord, etc",
"This method allows us to peek into the OLE compound document to extract the file format.\nThis allows the UniversalProjectReader to determine if... |
private void clearMetadata(DeviceAnnouncement announcement) {
final int player = announcement.getNumber();
// Iterate over a copy to avoid concurrent modification issues
for (DeckReference deck : new HashSet<DeckReference>(hotCache.keySet())) {
if (deck.player == player) {
hotCache.remove(deck);
if (deck.hotCue == 0) {
deliverTrackMetadataUpdate(player, null); // Inform listeners the metadata is gone.
}
}
}
} | [
"We have received notification that a device is no longer on the network, so clear out its metadata.\n\n@param announcement the packet which reported the device’s disappearance"
] | [
"Upload a photo from an InputStream.\n\n@param in\n@param metaData\n@return photoId or ticketId\n@throws FlickrException",
"Prints one line to the csv file\n\n@param cr data pipe with search results",
"Return whether or not the field value passed in is the default value for the type of the field. Null will retu... |
public long getLong(Integer type)
{
long result = 0;
byte[] item = m_map.get(type);
if (item != null)
{
result = MPPUtility.getLong6(item, 0);
}
return (result);
} | [
"Retrieves a long value from the extended data.\n\n@param type Type identifier\n@return long value"
] | [
"Init the headers of the table regarding the filters\n\n@return String[]",
"Removes a parameter from this configuration.\n\n@param key the parameter to remove",
"Use this API to fetch all the systementitydata resources that are configured on netscaler.\nThis uses systementitydata_args which is a way to provide ... |
public void setWeekDay(String dayString) {
final WeekDay day = WeekDay.valueOf(dayString);
if (m_model.getWeekDay() != day) {
removeExceptionsOnChange(new Command() {
public void execute() {
m_model.setWeekDay(day);
onValueChange();
}
});
}
} | [
"Set the week day the event should take place.\n@param dayString the day as string."
] | [
"Find the earliest task start date. We treat this as the\nstart date for the project.\n\n@return start date",
"Disable all overrides for a specified path\n\n@param pathID ID of path containing overrides\n@param clientUUID UUID of client",
"Given a list of store definitions return a set of store names\n\n@param ... |
public ItemRequest<CustomField> delete(String customField) {
String path = String.format("/custom_fields/%s", customField);
return new ItemRequest<CustomField>(this, CustomField.class, path, "DELETE");
} | [
"A specific, existing custom field can be deleted by making a DELETE request on the URL for that custom field.\n\nReturns an empty data record.\n\n@param customField Globally unique identifier for the custom field.\n@return Request object"
] | [
"Returns a compact representation of all of the tags the task has.\n\n@param task The task to get tags on.\n@return Request object",
"Returns the first found autoincrement field\ndefined in this class descriptor. Use carefully\nwhen multiple autoincrement field were defined.\n@deprecated does not make sense beca... |
public String getOriginalUrl() throws FlickrException {
if (originalSize == null) {
if (originalFormat != null) {
return getOriginalBaseImageUrl() + "_o." + originalFormat;
}
return getOriginalBaseImageUrl() + DEFAULT_ORIGINAL_IMAGE_SUFFIX;
} else {
return originalSize.getSource();
}
} | [
"Get the original image URL.\n\n@return The original image URL"
] | [
"Use this API to fetch statistics of service_stats resource of given name .",
"set the textColor of the ColorHolder to an drawable\n\n@param ctx\n@param drawable",
"Saves a matrix to disk using Java binary serialization.\n\n@param A The matrix being saved.\n@param fileName Name of the file its being saved at.\n... |
public boolean setCustomResponse(String pathName, String customResponse) throws Exception {
// figure out the new ordinal
int nextOrdinal = this.getNextOrdinalForMethodId(-1, pathName);
// add override
this.addMethodToResponseOverride(pathName, "-1");
// set argument
return this.setMethodArguments(pathName, "-1", nextOrdinal, customResponse);
} | [
"Set a custom response for this path\n\n@param pathName name of path\n@param customResponse value of custom response\n@return true if success, false otherwise\n@throws Exception exception"
] | [
"this remove the linebreak.\n\n@param input\nthe input\n@param patternStr\nthe pattern str\n@return the string",
"Constructs the appropriate MenuDrawer based on the position.",
"Read a text file into a single string\n\n@param file\nThe file to read\n@return The contents, or null on error.",
"Perform construct... |
public static DMatrixSparseCSC convert(DMatrixSparseTriplet src , DMatrixSparseCSC dst , int hist[] ) {
if( dst == null )
dst = new DMatrixSparseCSC(src.numRows, src.numCols , src.nz_length);
else
dst.reshape(src.numRows, src.numCols, src.nz_length);
if( hist == null )
hist = new int[ src.numCols ];
else if( hist.length >= src.numCols )
Arrays.fill(hist,0,src.numCols, 0);
else
throw new IllegalArgumentException("Length of hist must be at least numCols");
// compute the number of elements in each columns
for (int i = 0; i < src.nz_length; i++) {
hist[src.nz_rowcol.data[i*2+1]]++;
}
// define col_idx
dst.histogramToStructure(hist);
System.arraycopy(dst.col_idx,0,hist,0,dst.numCols);
// now write the row indexes and the values
for (int i = 0; i < src.nz_length; i++) {
int row = src.nz_rowcol.data[i*2];
int col = src.nz_rowcol.data[i*2+1];
double value = src.nz_value.data[i];
int index = hist[col]++;
dst.nz_rows[index] = row;
dst.nz_values[index] = value;
}
dst.indicesSorted = false;
return dst;
} | [
"Converts SMatrixTriplet_64 into a SMatrixCC_64.\n\n@param src Original matrix which is to be copied. Not modified.\n@param dst Destination. Will be a copy. Modified.\n@param hist Workspace. Should be at least as long as the number of columns. Can be null."
] | [
"Sets the necessary height for all bands in the report, to hold their children",
"Loads the Configuration from the properties file.\n\nLoads the properties file, or uses defaults on failure.\n\n@see org.apache.ojb.broker.util.configuration.impl.ConfigurationAbstractImpl#setFilename(java.lang.String)",
"Get rand... |
public boolean removeWriter(Object key, Object resourceId)
{
boolean result = false;
ObjectLocks objectLocks = null;
synchronized(locktable)
{
objectLocks = (ObjectLocks) locktable.get(resourceId);
if(objectLocks != null)
{
/**
* MBAIRD, last one out, close the door and turn off the lights.
* if no locks (readers or writers) exist for this object, let's remove
* it from the locktable.
*/
LockEntry entry = objectLocks.getWriter();
if(entry != null && entry.isOwnedBy(key))
{
objectLocks.setWriter(null);
result = true;
// no need to check if writer is null, we just set it.
if(objectLocks.getReaders().size() == 0)
{
locktable.remove(resourceId);
}
}
}
}
return result;
} | [
"Remove an write lock."
] | [
"Use this API to fetch service_dospolicy_binding resources of given name .",
"Generate random velocities for every particle. The direction is obtained by assuming\nthe position of a particle as a vector. This normalised vector is scaled by\nthe speed range.\n\n@return",
"Get a compatible constructor\n\n@param t... |
public String prepareStatementString() throws SQLException {
List<ArgumentHolder> argList = new ArrayList<ArgumentHolder>();
return buildStatementString(argList);
} | [
"Build and return a string version of the query. If you change the where or make other calls you will need to\nre-call this method to re-prepare the query for execution."
] | [
"Registers your facet filters, adding them to this InstantSearch's widgets.\n\n@param filters a List of facet filters.",
"Set the current playback position. This method can only be used in situations where the component is\ntied to a single player, and therefore always has a single playback position.\n\nWill caus... |
public void drawGeometry(Geometry geometry, SymbolInfo symbol, Color fillColor, Color strokeColor, float lineWidth,
float[] dashArray, Rectangle clipRect) {
template.saveState();
// clipping code
if (clipRect != null) {
template.rectangle(clipRect.getLeft() + origX, clipRect.getBottom() + origY, clipRect.getWidth(), clipRect
.getHeight());
template.clip();
template.newPath();
}
setStroke(strokeColor, lineWidth, dashArray);
setFill(fillColor);
drawGeometry(geometry, symbol);
template.restoreState();
} | [
"Draw the specified geometry.\n\n@param geometry geometry to draw\n@param symbol symbol for geometry\n@param fillColor fill colour\n@param strokeColor stroke colour\n@param lineWidth line width\n@param clipRect clipping rectangle"
] | [
"Returns a string that should be used as a label for the given item. The\nmethod also ensures that each label is used for only one class. Other\nclasses with the same label will have their QID added for disambiguation.\n\n@param entityIdValue\nthe item to label\n@return the label",
"This method extracts data for ... |
@UiHandler("m_seriesCheckBox")
void onSeriesChange(ValueChangeEvent<Boolean> event) {
if (handleChange()) {
m_controller.setIsSeries(event.getValue());
}
} | [
"Handle changes of the series check box.\n@param event the change event."
] | [
"Get an image as a stream. Callers must be sure to close the stream when they are done with it.\n\n@deprecated\n@see PhotosInterface#getImageAsStream(Photo, int)\n@param suffix\nThe suffix\n@return The InputStream\n@throws IOException",
"Determine the generic value type of the given Map field.\n@param mapField th... |
public static CmsResourceTypeStatResultList init(CmsResourceTypeStatResultList resList) {
if (resList == null) {
return new CmsResourceTypeStatResultList();
}
resList.deleteOld();
return resList;
} | [
"Method to initialize the list.\n\n@param resList a given instance or null\n@return an instance"
] | [
"Get upload status for the currently authenticated user.\n\nRequires authentication with 'read' permission using the new authentication API.\n\n@return A User object with upload status data fields filled\n@throws FlickrException",
"prefix length in this section is ignored when converting to MAC",
"Get info abou... |
public ImageSource apply(ImageSource input) {
ImageSource originalImage = input;
int width = originalImage.getWidth();
int height = originalImage.getHeight();
boolean[][] matrix = new boolean[width][height]; // black n white boolean matrix; true = blck, false = white
// Copy
ImageSource filteredImage = new MatrixSource(input);
int[] histogram = OtsuBinarize.imageHistogram(originalImage);
int totalNumberOfpixels = height * width;
int threshold = OtsuBinarize.threshold(histogram, totalNumberOfpixels);
int black = 0;
int white = 255;
int gray;
int alpha;
int newColor;
for (int i = 0; i < width; i++) {
for (int j = 0; j < height; j++) {
gray = originalImage.getGray(i, j);
if (gray > threshold) {
matrix[i][j] = false;
} else {
matrix[i][j] = true;
}
}
}
int blackTreshold = letterThreshold(originalImage, matrix);
for (int i = 0; i < width; i++) {
for (int j = 0; j < height; j++) {
gray = originalImage.getGray(i, j);
alpha = originalImage.getA(i, j);
if (gray > blackTreshold) {
newColor = white;
} else {
newColor = black;
}
newColor = ColorHelper.getARGB(newColor, newColor, newColor, alpha);
filteredImage.setRGB(i, j, newColor);
}
}
return filteredImage;
} | [
"radi otsu da dobije spojena crna slova i ra\n\n@param input\n@return the processed image"
] | [
"Adds all rows from the TSV file specified, using the provided delimiter and null value.\n\n@param file The file to read the data from.\n@param delimiter A column delimiter.\n@param nullValue Value to be treated as null in the source data.\n@return {@code this}",
"Get all field attributes in an unmodifiable Map, ... |
public static String join(Iterable<?> iterable, String separator) {
if (iterable != null) {
StringBuilder buf = new StringBuilder();
Iterator<?> it = iterable.iterator();
char singleChar = separator.length() == 1 ? separator.charAt(0) : 0;
while (it.hasNext()) {
buf.append(it.next());
if (it.hasNext()) {
if (singleChar != 0) {
// More efficient
buf.append(singleChar);
} else {
buf.append(separator);
}
}
}
return buf.toString();
} else {
return "";
}
} | [
"Joins the given iterable objects using the given separator into a single string.\n\n@return the joined string or an empty string if iterable is null"
] | [
"Return all valid tenors for a given moneyness and maturity.\nUses the payment times of the fix schedule to determine fractions.\n\n@param moneyness The moneyness as actual offset from par swap rate for which to get the maturities.\n@param maturity The maturities as year fraction from the reference date.\n@return T... |
public void awaitStartupCompletion() {
try {
Object obj = startedStatusQueue.take();
if(obj instanceof Throwable)
throw new VoldemortException((Throwable) obj);
} catch(InterruptedException e) {
// this is okay, if we are interrupted we can stop waiting
}
} | [
"Blocks until the server has started successfully or an exception is\nthrown.\n\n@throws VoldemortException if a problem occurs during start-up wrapping\nthe original exception."
] | [
"Parses an RgbaColor from an rgba value.\n\n@return the parsed color",
"Prints text to output stream, replacing parameter start and end\nplaceholders\n\n@param text the String to print",
"get all consumers for the group\n\n@param zkClient the zookeeper client\n@param group the group name\n@return topic->(... |
public static Envelope getTileBounds(TileCode code, Envelope maxExtent, double scale) {
double[] layerSize = getTileLayerSize(code, maxExtent, scale);
if (layerSize[0] == 0) {
return null;
}
double cX = maxExtent.getMinX() + code.getX() * layerSize[0];
double cY = maxExtent.getMinY() + code.getY() * layerSize[1];
return new Envelope(cX, cX + layerSize[0], cY, cY + layerSize[1]);
} | [
"Get the bounding box for a certain tile.\n\n@param code\nThe unique tile code. Determines what tile we're talking about.\n@param maxExtent\nThe maximum extent of the grid to which this tile belongs.\n@param scale\nThe current client side scale.\n@return Returns the bounding box for the tile, expressed in the layer... | [
"Inserts a Parcelable value into the mapping of the underlying Bundle, replacing any existing\nvalue for the given key. Either key or value may be null.\n\n@param key a String, or null\n@param value a Parcelable object, or null\n@return this bundler instance to chain method calls",
"Return true if the Declaration... |
public FinishRequest toFinishRequest(boolean includeHeaders) {
if (includeHeaders) {
return new FinishRequest(body, copyHeaders(headers), statusCode);
} else {
String mime = null;
if (body!=null) {
mime = "text/plain";
if (headers!=null && (headers.containsKey("Content-Type") || headers.containsKey("content-type"))) {
mime = headers.get("Content-Type");
if (mime==null) {
mime = headers.get("content-type");
}
}
}
return new FinishRequest(body, mime, statusCode);
}
} | [
"Convert the message to a FinishRequest"
] | [
"Gets the publisher wrapped by the specofoed FlexiblePublisher.\n@param publisher The FlexiblePublisher wrapping the publisher.\n@param type The type of the publisher wrapped by the FlexiblePublisher.\n@return The publisher object wrapped by ... |
private void processPredecessors()
{
for (Map.Entry<Task, List<MapRow>> entry : m_predecessorMap.entrySet())
{
Task task = entry.getKey();
List<MapRow> predecessors = entry.getValue();
for (MapRow predecessor : predecessors)
{
processPredecessor(task, predecessor);
}
}
} | [
"Extract predecessor data."
] | [
"Convert the Primavera string representation of a UUID into a Java UUID instance.\n\n@param value Primavera UUID\n@return Java UUID instance",
"generate a prepared INSERT-Statement for the Class\ndescribed by cld.\n\n@param cld the ClassDescriptor",
"Associate an input stream with the operation. Closing the inp... |
private void updateLetsEncrypt() {
getReport().println(Messages.get().container(Messages.RPT_STARTING_LETSENCRYPT_UPDATE_0));
CmsLetsEncryptConfiguration config = OpenCms.getLetsEncryptConfig();
if ((config == null) || !config.isValidAndEnabled()) {
return;
}
CmsSiteConfigToLetsEncryptConfigConverter converter = new CmsSiteConfigToLetsEncryptConfigConverter(config);
boolean ok = converter.run(getReport(), OpenCms.getSiteManager());
if (ok) {
getReport().println(
org.opencms.ui.apps.Messages.get().container(org.opencms.ui.apps.Messages.RPT_LETSENCRYPT_FINISHED_0),
I_CmsReport.FORMAT_OK);
}
} | [
"Updates LetsEncrypt configuration."
] | [
"Method to send Request messages to a specific df_service\n\n@param df_service\nThe name of the df_service\n@param msgContent\nThe content of the message to be sent\n@return Message sent to + the name of the df_service",
"Acquires a write lock on a specific key.\n@param key The key to lock\n@param timeout in mill... |
protected String extractHeaderComment( File xmlFile )
throws MojoExecutionException
{
try
{
SAXParser parser = SAXParserFactory.newInstance().newSAXParser();
SaxHeaderCommentHandler handler = new SaxHeaderCommentHandler();
parser.setProperty( "http://xml.org/sax/properties/lexical-handler", handler );
parser.parse( xmlFile, handler );
return handler.getHeaderComment();
}
catch ( Exception e )
{
throw new MojoExecutionException( "Failed to parse XML from " + xmlFile, e );
}
} | [
"This method extracts the XML header comment if available.\n\n@param xmlFile is the XML {@link File} to parse.\n@return the XML comment between the XML header declaration and the root tag or <code>null</code> if NOT\navailable.\n@throws MojoExecutionException if anything goes wrong."
] | [
"Used to determine if the current method should be ignored.\n\n@param name method name\n@return true if the method should be ignored",
"Builds the HTML code for a select widget given a bean containing the select options\n\n@param htmlAttributes html attributes for the select widget\n@param options the bean contai... |
private static <D extends DatastoreConfiguration<G>, G extends GlobalContext<?, ?>> AppendableConfigurationContext invokeOptionConfigurator(
OptionConfigurator configurator) {
ConfigurableImpl configurable = new ConfigurableImpl();
configurator.configure( configurable );
return configurable.getContext();
} | [
"Invokes the given configurator, obtaining the correct global context type via the datastore configuration type of\nthe current datastore provider.\n\n@param configurator the configurator to invoke\n@return a context object containing the options set via the given configurator"
] | [
"Drops a driver from the DriverManager's list.",
"Parses values out of the header text.\n\n@param header header text",
"Make sure that we have some reasonable defaults available. These would typically be provided by the rulesets\nin the real world.",
"Returns a OkHttpClient that ignores SSL cert errors\n@retu... |
public static boolean doAcquireLock(final Jedis jedis, final String namespace, final String lockName, final String lockHolder, final int timeout) {
final String key = JesqueUtils.createKey(namespace, lockName);
// If lock already exists, extend it
String existingLockHolder = jedis.get(key);
if ((existingLockHolder != null) && existingLockHolder.equals(lockHolder)) {
if (jedis.expire(key, timeout) == 1) {
existingLockHolder = jedis.get(key);
if ((existingLockHolder != null) && existingLockHolder.equals(lockHolder)) {
return true;
}
}
}
// Check to see if the key exists and is expired for cleanup purposes
if (jedis.exists(key) && (jedis.ttl(key) < 0)) {
// It is expired, but it may be in the process of being created, so
// sleep and check again
try {
Thread.sleep(2000);
} catch (InterruptedException ie) {
} // Ignore interruptions
if (jedis.ttl(key) < 0) {
existingLockHolder = jedis.get(key);
// If it is our lock mark the time to live
if ((existingLockHolder != null) && existingLockHolder.equals(lockHolder)) {
if (jedis.expire(key, timeout) == 1) {
existingLockHolder = jedis.get(key);
if ((existingLockHolder != null) && existingLockHolder.equals(lockHolder)) {
return true;
}
}
} else { // The key is expired, whack it!
jedis.del(key);
}
} else { // Someone else locked it while we were sleeping
return false;
}
}
// Ignore the cleanup steps above, start with no assumptions test
// creating the key
if (jedis.setnx(key, lockHolder) == 1) {
// Created the lock, now set the expiration
if (jedis.expire(key, timeout) == 1) { // Set the timeout
existingLockHolder = jedis.get(key);
if ((existingLockHolder != null) && existingLockHolder.equals(lockHolder)) {
return true;
}
} else { // Don't know why it failed, but for now just report failed
// acquisition
return false;
}
}
// Failed to create the lock
return false;
} | [
"Helper method that encapsulates the logic to acquire a lock.\n\n@param jedis\nthe connection to Redis\n@param namespace\nthe Resque namespace\n@param lockName\nall calls to this method will contend for a unique lock with\nthe name of lockName\n@param timeout\nseconds until the lock will expire\n@param lockHolder\n... | [
"Locate the no arg constructor for the class.",
"Clears the internal used cache for object materialization.",
"Use this API to convert sslpkcs12.",
"Get interfaces implemented by clazz\n\n@param clazz\n@return",
"Set the classpath for loading the driver.\n\n@param classpath the classpath",
"Set keyboard d... |
@JmxGetter(name = "avgSlopUpdateNetworkTimeMs", description = "average time spent on network, for streaming operations")
public double getAvgSlopUpdateNetworkTimeMs() {
return networkTimeCounterMap.get(Operation.SLOP_UPDATE).getAvgEventValue() / Time.NS_PER_MS;
} | [
"Mbeans for SLOP_UPDATE"
] | [
"Import user from file.",
"1-D Perlin noise function.\n\n@param x X Value.\n@return Returns function's value at point x.",
"Use this API to update dbdbprofile.",
"Read custom property definitions for tasks.\n\n@param gpTasks GanttProject tasks",
"Counts a single pair of coordinates in all datasets.\n\n@para... |
public void sendJsonToTagged(Object data, String ... labels) {
for (String label : labels) {
sendJsonToTagged(data, label);
}
} | [
"Send JSON representation of given data object to all connections tagged with all give tag labels\n@param data the data object\n@param labels the tag labels"
] | [
"Returns an input stream that applies the required decompression to the\ngiven input stream.\n\n@param inputStream\nthe input stream with the (possibly compressed) data\n@param compressionType\nthe kind of compression\n@return an input stream with decompressed data\n@throws IOException\nif there was a problem creat... |
public static String get(String language) {
language = language.toLowerCase();
if("ecmascript".equals(language)) {
language = "javascript";
}
String extension = extensions.get(language);
if(extension == null) {
return null;
} else {
return loadScriptEnv(language, extension);
}
} | [
"Get the spin scripting environment\n\n@param language the language name\n@return the environment script as string or null if the language is\nnot in the set of languages supported by spin."
] | [
"Remove any overrides for an endpoint\n\n@param pathValue path (endpoint) value\n@param requestType path request type. \"GET\", \"POST\", etc\n@return true if success, false otherwise",
"Resize picture to desired size.\n\n@param width Desired width.\n@param height Desired height.\n@throws IllegalArgumentException... |
public BoxAPIResponse send(ProgressListener listener) {
if (this.api == null) {
this.backoffCounter.reset(BoxGlobalSettings.getMaxRequestAttempts());
} else {
this.backoffCounter.reset(this.api.getMaxRequestAttempts());
}
while (this.backoffCounter.getAttemptsRemaining() > 0) {
try {
return this.trySend(listener);
} catch (BoxAPIException apiException) {
if (!this.backoffCounter.decrement() || !isResponseRetryable(apiException.getResponseCode())) {
throw apiException;
}
try {
this.resetBody();
} catch (IOException ioException) {
throw apiException;
}
try {
this.backoffCounter.waitBackoff();
} catch (InterruptedException interruptedException) {
Thread.currentThread().interrupt();
throw apiException;
}
}
}
throw new RuntimeException();
} | [
"Sends this request while monitoring its progress and returns a BoxAPIResponse containing the server's response.\n\n<p>A ProgressListener is generally only useful when the size of the request is known beforehand. If the size is\nunknown, then the ProgressListener will be updated for each byte sent, but the total nu... | [
"Get random stub matching this user type\n@param userType User type\n@return Random stub",
"Broadcast a packet that tells some players to start playing and others to stop. If a player number is in\nboth sets, it will be told to stop. Numbers outside the range 1 to 4 are ignored.\n\n@param deviceNumbersToStart the... |
public Class<?> getType(String key) {
Object val = this.data.get(key);
return val == null ? null : val.getClass();
} | [
"Get the current attribute type.\n@param key the entry's key, not null\n@return the current attribute type, or null, if no such attribute exists."
] | [
"Check if the current node is part of routing request based on cluster.xml\nor throw an exception.\n\n@param key The key we are checking\n@param routingStrategy The routing strategy\n@param currentNode Current node",
"Returns the time elapsed by the user on the app\n@return Time elapsed by user on the app in int"... |
public void increasePriority(int overrideId, int ordinal, int pathId, String clientUUID) {
logger.info("Increase priority");
int origPriority = -1;
int newPriority = -1;
int origId = 0;
int newId = 0;
PreparedStatement statement = null;
ResultSet results = null;
try (Connection sqlConnection = sqlService.getConnection()) {
results = null;
statement = sqlConnection.prepareStatement(
"SELECT * FROM " + Constants.DB_TABLE_ENABLED_OVERRIDE +
" WHERE " + Constants.ENABLED_OVERRIDES_PATH_ID + " = ?" +
" AND " + Constants.GENERIC_CLIENT_UUID + " = ?" +
" ORDER BY " + Constants.ENABLED_OVERRIDES_PRIORITY
);
statement.setInt(1, pathId);
statement.setString(2, clientUUID);
results = statement.executeQuery();
int ordinalCount = 0;
while (results.next()) {
if (results.getInt(Constants.ENABLED_OVERRIDES_OVERRIDE_ID) == overrideId) {
ordinalCount++;
if (ordinalCount == ordinal) {
origPriority = results.getInt(Constants.ENABLED_OVERRIDES_PRIORITY);
origId = results.getInt(Constants.GENERIC_ID);
break;
}
}
newPriority = results.getInt(Constants.ENABLED_OVERRIDES_PRIORITY);
newId = results.getInt(Constants.GENERIC_ID);
}
} catch (Exception e) {
e.printStackTrace();
} finally {
try {
if (results != null) {
results.close();
}
} catch (Exception e) {
}
try {
if (statement != null) {
statement.close();
}
} catch (Exception e) {
}
}
try (Connection sqlConnection = sqlService.getConnection()) {
// update priorities
if (origPriority != -1 && newPriority != -1) {
statement = sqlConnection.prepareStatement(
"UPDATE " + Constants.DB_TABLE_ENABLED_OVERRIDE +
" SET " + Constants.ENABLED_OVERRIDES_PRIORITY + "=?" +
" WHERE " + Constants.GENERIC_ID + "=?"
);
statement.setInt(1, origPriority);
statement.setInt(2, newId);
statement.executeUpdate();
statement.close();
statement = sqlConnection.prepareStatement(
"UPDATE " + Constants.DB_TABLE_ENABLED_OVERRIDE +
" SET " + Constants.ENABLED_OVERRIDES_PRIORITY + "=?" +
" WHERE " + Constants.GENERIC_ID + "=?"
);
statement.setInt(1, newPriority);
statement.setInt(2, origId);
statement.executeUpdate();
}
} catch (Exception e) {
} finally {
try {
if (statement != null) {
statement.close();
}
} catch (Exception e) {
}
}
} | [
"Increase the priority of an overrideId\n\n@param overrideId ID of override\n@param pathId ID of path containing override\n@param clientUUID UUID of client"
] | [
"Converts a string representation of an integer into an Integer object.\nSilently ignores any parse exceptions and returns null.\n\n@param value String representation of an integer\n@return Integer instance",
"Gets the txinfo cache weight\n\n@param conf The FluoConfiguration\n@return The size of the cache value f... |
public static final BigInteger printConstraintType(ConstraintType value)
{
return (value == null ? null : BigInteger.valueOf(value.getValue()));
} | [
"Print a constraint type.\n\n@param value ConstraintType instance\n@return constraint type value"
] | [
"Exception handler if we are unable to parse a json value into a java representation\n\n@param expectedType Name of the expected Type\n@param type Type of the json node\n@return SpinJsonDataFormatException",
"Get a list of referring domains for a photostream.\n\n@param date\n(Required) Stats will be returned for ... |
private Integer mapTaskID(Integer id)
{
Integer mappedID = m_clashMap.get(id);
if (mappedID == null)
{
mappedID = id;
}
return (mappedID);
} | [
"Deals with the case where we have had to map a task ID to a new value.\n\n@param id task ID from database\n@return mapped task ID"
] | [
"Used to retrieve all metadata associated with the item.\n@param item item to get metadata for.\n@param fields the optional fields to retrieve.\n@return An iterable of metadata instances associated with the item.",
"callers of doLogin should be serialized before calling in.",
"Returns the data about all of the ... |
public boolean isHomeKeyPresent() {
final GVRApplication application = mApplication.get();
if (null != application) {
final String model = getHmtModel();
if (null != model && model.contains("R323")) {
return true;
}
}
return false;
} | [
"Does the headset the device is docked into have a dedicated home key\n@return"
] | [
"Load physics information for the current avatar\n@param filename name of physics file\n@param scene scene the avatar is part of\n@throws IOException if physics file cannot be parsed",
"URLDecode a string\n@param s\n@return",
"calculate and set position to menu items",
"Returns the instance.\n@return Int... |
private void checkMessageID(Message message) {
if (!MessageUtils.isOutbound(message)) return;
AddressingProperties maps =
ContextUtils.retrieveMAPs(message, false, MessageUtils.isOutbound(message));
if (maps == null) {
maps = new AddressingProperties();
}
if (maps.getMessageID() == null) {
String messageID = ContextUtils.generateUUID();
boolean isRequestor = ContextUtils.isRequestor(message);
maps.setMessageID(ContextUtils.getAttributedURI(messageID));
ContextUtils.storeMAPs(maps, message, ContextUtils.isOutbound(message), isRequestor);
}
} | [
"check if MessageID exists in the message, if not, only generate new MessageID for outbound message.\n@param message"
] | [
"Awaits at most 5 minutes until all pods meets the given predicate.\n\n@param filter used to wait to detect that a pod is up and running.",
"Counts the coordinates stored in a single statement for the relevant\nproperty, if they are actually given and valid.\n\n@param statement\n@param itemDocument",
"Saves the... |
private int readOptionalInt(JSONValue val) {
JSONString str = null == val ? null : val.isString();
if (str != null) {
try {
return Integer.valueOf(str.stringValue()).intValue();
} catch (@SuppressWarnings("unused") NumberFormatException e) {
// Do nothing, return default value
}
}
return 0;
} | [
"Read an optional int value form a JSON value.\n@param val the JSON value that should represent the int.\n@return the int from the JSON or 0 reading the int fails."
] | [
"find the middle point of two intersect points in circle,only one point will be correct\n\n@param center\n@param a\n@param b\n@param area\n@param radius\n@return",
"Creates a color item that represents a color field fond for a track.\n\n@param colorId the key of the color as found in the database\n@param label th... |
private void readRecord(Tokenizer tk, List<String> record) throws IOException
{
record.clear();
while (tk.nextToken() == Tokenizer.TT_WORD)
{
record.add(tk.getToken());
}
} | [
"Reads each token from a single record and adds it to a list.\n\n@param tk tokenizer\n@param record list of tokens\n@throws IOException"
] | [
"Maps the text representation of column data to Java types.\n\n@param table table name\n@param column column name\n@param data text representation of column data\n@param type column data type\n@param epochDateFormat true if date is represented as an offset from an epoch\n@return Java representation of column data\n... |
public static base_response add(nitro_service client, onlinkipv6prefix resource) throws Exception {
onlinkipv6prefix addresource = new onlinkipv6prefix();
addresource.ipv6prefix = resource.ipv6prefix;
addresource.onlinkprefix = resource.onlinkprefix;
addresource.autonomusprefix = resource.autonomusprefix;
addresource.depricateprefix = resource.depricateprefix;
addresource.decrementprefixlifetimes = resource.decrementprefixlifetimes;
addresource.prefixvalidelifetime = resource.prefixvalidelifetime;
addresource.prefixpreferredlifetime = resource.prefixpreferredlifetime;
return addresource.add_resource(client);
} | [
"Use this API to add onlinkipv6prefix."
] | [
"Initializes the mode switcher.\n@param current the current edit mode",
"Used to retrieve all metadata associated with the item.\n@param item item to get metadata for.\n@param fields the optional fields to retrieve.\n@return An iterable of metadata instances associated with the item.",
"Removes a value from the... |
public static base_response add(nitro_service client, snmpmanager resource) throws Exception {
snmpmanager addresource = new snmpmanager();
addresource.ipaddress = resource.ipaddress;
addresource.netmask = resource.netmask;
addresource.domainresolveretry = resource.domainresolveretry;
return addresource.add_resource(client);
} | [
"Use this API to add snmpmanager."
] | [
"Use this API to disable vserver of given name.",
"Builds sql clause to load data into a database.\n\n@param config Load configuration.\n@param prefix Prefix for temporary resources.\n@return the load DDL",
"Lookup a PortComponentMetaData by wsdl-port local part\n\n@param name - the wsdl-port local part\n@retur... |
protected TokenList.Token parseSubmatrixToExtract(TokenList.Token variableTarget,
TokenList tokens, Sequence sequence) {
List<TokenList.Token> inputs = parseParameterCommaBlock(tokens, sequence);
List<Variable> variables = new ArrayList<Variable>();
// for the operation, the first variable must be the matrix which is being manipulated
variables.add(variableTarget.getVariable());
addSubMatrixVariables(inputs, variables);
if( variables.size() != 2 && variables.size() != 3 ) {
throw new ParseError("Unexpected number of variables. 1 or 2 expected");
}
// first parameter is the matrix it will be extracted from. rest specify range
Operation.Info info;
// only one variable means its referencing elements
// two variables means its referencing a sub matrix
if( inputs.size() == 1 ) {
Variable varA = variables.get(1);
if( varA.getType() == VariableType.SCALAR ) {
info = functions.create("extractScalar", variables);
} else {
info = functions.create("extract", variables);
}
} else if( inputs.size() == 2 ) {
Variable varA = variables.get(1);
Variable varB = variables.get(2);
if( varA.getType() == VariableType.SCALAR && varB.getType() == VariableType.SCALAR) {
info = functions.create("extractScalar", variables);
} else {
info = functions.create("extract", variables);
}
} else {
throw new ParseError("Expected 2 inputs to sub-matrix");
}
sequence.addOperation(info.op);
return new TokenList.Token(info.output);
} | [
"Converts a submatrix into an extract matrix operation.\n@param variableTarget The variable in which the submatrix is extracted from"
] | [
"Use this API to rename a gslbservice resource.",
"Use this API to update responderpolicy.",
"set the property destination type for given property\n\n@param propertyName\n@param destinationType",
"Merge two maps of configuration properties. If the original contains a mapping for the same key, the new mapping ... |
private Task findChildTaskByUUID(ChildTaskContainer parent, UUID uuid)
{
Task result = null;
for (Task task : parent.getChildTasks())
{
if (uuid.equals(task.getGUID()))
{
result = task;
break;
}
}
return result;
} | [
"Locates a task within a child task container which matches the supplied UUID.\n\n@param parent child task container\n@param uuid required UUID\n@return Task instance or null if the task is not found"
] | [
"Use this API to export sslfipskey.",
"Helper method for formatting connection termination messages.\n\n@param connectionName\nThe name of the connection\n@param host\nThe remote host\n@param connectionReason\nThe reason for establishing the connection\n@param terminationReason\nThe reason for terminating the con... |
private static boolean isAssignableFrom(WildcardType type1, Type type2) {
if (!isAssignableFrom(type1.getUpperBounds()[0], type2)) {
return false;
}
if (type1.getLowerBounds().length > 0 && !isAssignableFrom(type2, type1.getLowerBounds()[0])) {
return false;
}
return true;
} | [
"This logic is shared for all actual types i.e. raw types, parameterized types and generic array types."
] | [
"Get a property as a float or throw an exception.\n\n@param key the property name",
"Check whether the given class is cache-safe in the given context,\ni.e. whether it is loaded by the given ClassLoader or a parent of it.\n@param clazz the class to analyze\n@param classLoader the ClassLoader to potentially cache ... |
public Set<Action.ActionEffect> getActionEffects() {
switch(getImpact()) {
case CLASSLOADING:
case WRITE:
return WRITES;
case READ_ONLY:
return READS;
default:
throw new IllegalStateException();
}
} | [
"Gets the effects of this action.\n\n@return the effects. Will not be {@code null}"
] | [
"Performs a variety of tests to see if the provided matrix is a valid\ncovariance matrix.\n\n@return 0 = is valid 1 = failed positive diagonal, 2 = failed on symmetry, 2 = failed on positive definite",
"Gets the Taneja divergence.\n\n@param p P vector.\n@param q Q vector.\n@return The Taneja divergence between p... |
public Token add( String word ) {
Token t = new Token(word);
push( t );
return t;
} | [
"Adds a word to the end of the token list\n@param word word which is to be added\n@return The new Token created around symbol"
] | [
"Byte run automaton map.\n\n@param automatonMap the automaton map\n@return the map",
"Walk through the object graph of the specified insert object. Was used for\nrecursive object graph walk.",
"Updates the Q matrix to take inaccount the row that was removed by only multiplying e\nlements that need to be. There... |
public static void fillHermitian(ZMatrixRMaj A, double min, double max, Random rand) {
if( A.numRows != A.numCols )
throw new IllegalArgumentException("A must be a square matrix");
double range = max-min;
int length = A.numRows;
for( int i = 0; i < length; i++ ) {
A.set(i,i,rand.nextDouble()*range + min,0);
for( int j = i+1; j < length; j++ ) {
double real = rand.nextDouble()*range + min;
double imaginary = rand.nextDouble()*range + min;
A.set(i,j,real,imaginary);
A.set(j,i,real,-imaginary);
}
}
} | [
"Assigns the provided square matrix to be a random Hermitian matrix with elements from min to max value.\n\n@param A The matrix that is to be modified. Must be square. Modified.\n@param min Minimum value an element can have.\n@param max Maximum value an element can have.\n@param rand Random number generator."
] | [
"Runs through the log removing segments until the size of the log is at least\nlogRetentionSize bytes in size\n\n@throws IOException",
"Given the lambda value perform an implicit QR step on the matrix.\n\nB^T*B-lambda*I\n\n@param lambda Stepping factor.",
"Merge msg bundles together, creating new MsgBundle with... |
@Override
public synchronized boolean fireEventAndWait(Eventable eventable)
throws ElementNotVisibleException, NoSuchElementException, InterruptedException {
try {
boolean handleChanged = false;
boolean result = false;
if (eventable.getRelatedFrame() != null && !eventable.getRelatedFrame().equals("")) {
LOGGER.debug("switching to frame: " + eventable.getRelatedFrame());
try {
switchToFrame(eventable.getRelatedFrame());
} catch (NoSuchFrameException e) {
LOGGER.debug("Frame not found, possibly while back-tracking..", e);
// TODO Stefan, This exception is caught to prevent stopping
// from working
// This was the case on the Gmail case; find out if not switching
// (catching)
// Results in good performance...
}
handleChanged = true;
}
WebElement webElement =
browser.findElement(eventable.getIdentification().getWebDriverBy());
if (webElement != null) {
result = fireEventWait(webElement, eventable);
}
if (handleChanged) {
browser.switchTo().defaultContent();
}
return result;
} catch (ElementNotVisibleException | NoSuchElementException e) {
throw e;
} catch (WebDriverException e) {
throwIfConnectionException(e);
return false;
}
} | [
"Fires an event on an element using its identification.\n\n@param eventable The eventable.\n@return true if it is able to fire the event successfully on the element.\n@throws InterruptedException when interrupted during the wait."
] | [
"Handling out request.\n\n@param message\nthe message\n@throws Fault\nthe fault",
"Creates a new child folder inside this folder.\n\n@param name the new folder's name.\n@return the created folder's info.",
"Send a waveform detail update announcement to all registered listeners.\n\n@param player the player whose... |
private TreeMap<Integer, Integer> createResourceMap(FieldMap fieldMap, FixedMeta rscFixedMeta, FixedData rscFixedData)
{
TreeMap<Integer, Integer> resourceMap = new TreeMap<Integer, Integer>();
int itemCount = rscFixedMeta.getAdjustedItemCount();
for (int loop = 0; loop < itemCount; loop++)
{
byte[] data = rscFixedData.getByteArrayValue(loop);
if (data == null || data.length < fieldMap.getMaxFixedDataSize(0))
{
continue;
}
Integer uniqueID = Integer.valueOf(MPPUtility.getShort(data, 0));
resourceMap.put(uniqueID, Integer.valueOf(loop));
}
return (resourceMap);
} | [
"This method maps the resource unique identifiers to their index number\nwithin the FixedData block.\n\n@param fieldMap field map\n@param rscFixedMeta resource fixed meta data\n@param rscFixedData resource fixed data\n@return map of resource IDs to resource data"
] | [
"Awaits at most 5 minutes until all pods meets the given predicate.\n\n@param filter used to wait to detect that a pod is up and running.",
"Return all server groups for a profile\n\n@param profileId ID of profile\n@return collection of ServerGroups for a profile",
"Will prompt a user the \"Add to Homescreen\" ... |
public FieldDescriptorDef getField(String name)
{
FieldDescriptorDef fieldDef = null;
for (Iterator it = _fields.iterator(); it.hasNext(); )
{
fieldDef = (FieldDescriptorDef)it.next();
if (fieldDef.getName().equals(name))
{
return fieldDef;
}
}
return null;
} | [
"Returns the field definition with the specified name.\n\n@param name The name of the desired field\n@return The field definition or <code>null</code> if there is no such field"
] | [
"Logs an error message for unhandled exception thrown from the target method.\n\n@param joinPoint - the joint point cut that contains information about the target\n@param throwable - the cause of the exception from the target method invocation",
"Resolves line alpha based on distance comparing to max distance.\nW... |
private static void writeCharSequence(CharSequence seq, CharBuf buffer) {
if (seq.length() > 0) {
buffer.addJsonEscapedString(seq.toString());
} else {
buffer.addChars(EMPTY_STRING_CHARS);
}
} | [
"Serializes any char sequence and writes it into specified buffer."
] | [
"Replies to this comment with another message.\n@param message the message for the reply.\n@return info about the newly created reply comment.",
"Checks if the given operator code is a valid one.\n\n@param operatorCode an operator code to evaluate\n@throws IllegalStateException if operatorCode is not a known ope... |
boolean hasNoAlternativeWildcardRegistration() {
return parent == null || PathElement.WILDCARD_VALUE.equals(valueString) || !parent.getChildNames().contains(PathElement.WILDCARD_VALUE);
} | [
"Gets whether this registration has an alternative wildcard registration"
] | [
"Return the most appropriate log type. This should _never_ return null.",
"Set the color at \"index\" to \"color\". Entries are interpolated linearly from\nthe existing entries at \"firstIndex\" and \"lastIndex\" to the new entry.\nfirstIndex < index < lastIndex must hold.\n@param index the position to set\n@para... |
public synchronized void addListener(CollectionProxyListener listener)
{
if (_listeners == null)
{
_listeners = new ArrayList();
}
// to avoid multi-add of same listener, do check
if(!_listeners.contains(listener))
{
_listeners.add(listener);
}
} | [
"Adds a listener to this collection.\n\n@param listener The listener to add"
] | [
"Use this API to fetch sslpolicylabel resource of given name .",
"Calculate start dates for a monthly relative recurrence.\n\n@param calendar current date\n@param frequency frequency\n@param dates array of start dates",
"Creates SLD rules for each old style.",
"Sets the time warp.\n\n@param l the new time war... |
private void readCalendars(Project ganttProject)
{
m_mpxjCalendar = m_projectFile.addCalendar();
m_mpxjCalendar.setName(ProjectCalendar.DEFAULT_BASE_CALENDAR_NAME);
Calendars gpCalendar = ganttProject.getCalendars();
setWorkingDays(m_mpxjCalendar, gpCalendar);
setExceptions(m_mpxjCalendar, gpCalendar);
m_eventManager.fireCalendarReadEvent(m_mpxjCalendar);
} | [
"This method extracts calendar data from a GanttProject file.\n\n@param ganttProject Root node of the GanttProject file"
] | [
"crates a StencilSet object and add it to the current diagram\n@param modelJSON\n@param current\n@throws org.json.JSONException",
"Get a View that displays the data at the specified\nposition in the data set.\n\n@param position Position of the item whose data we want\n@param convertView View to recycle, if not... |
public SelectBuilder orderBy(String name, boolean ascending) {
if (ascending) {
orderBys.add(name + " asc");
} else {
orderBys.add(name + " desc");
}
return this;
} | [
"Adds an ORDER BY item with a direction indicator.\n\n@param name\nName of the column by which to sort.\n@param ascending\nIf true, specifies the direction \"asc\", otherwise, specifies\nthe direction \"desc\"."
] | [
"Get the label distance..\n\n@param settings Parameters for rendering the scalebar.",
"Format the date for the status messages.\n\n@param date the date to format.\n\n@return the formatted date.",
"Use this API to add dnsview resources.",
"Registers Jersey HeaderDelegateProviders for the specified TinyTypes.\n... |
public static <T> T createProxy(final Class<T> proxyInterface) {
if( proxyInterface == null ) {
throw new NullPointerException("proxyInterface should not be null");
}
return proxyInterface.cast(Proxy.newProxyInstance(proxyInterface.getClassLoader(),
new Class[] { proxyInterface }, new BeanInterfaceProxy()));
} | [
"Creates a proxy object which implements a given bean interface.\n\n@param proxyInterface\nthe interface the the proxy will implement\n@param <T>\nthe proxy implementation type\n@return the proxy implementation\n@throws NullPointerException\nif proxyInterface is null"
] | [
"Parse an extended attribute boolean value.\n\n@param value string representation\n@return boolean value",
"Use this API to fetch all the lbsipparameters resources that are configured on netscaler.",
"Gets a SerialMessage with the MULTI INSTANCE GET command.\nReturns the number of instances for this command cla... |
public void updateStructure()
{
if (size() > 1)
{
Collections.sort(this);
m_projectFile.getChildTasks().clear();
Task lastTask = null;
int lastLevel = -1;
boolean autoWbs = m_projectFile.getProjectConfig().getAutoWBS();
boolean autoOutlineNumber = m_projectFile.getProjectConfig().getAutoOutlineNumber();
for (Task task : this)
{
task.clearChildTasks();
Task parent = null;
if (!task.getNull())
{
int level = NumberHelper.getInt(task.getOutlineLevel());
if (lastTask != null)
{
if (level == lastLevel || task.getNull())
{
parent = lastTask.getParentTask();
level = lastLevel;
}
else
{
if (level > lastLevel)
{
parent = lastTask;
}
else
{
while (level <= lastLevel)
{
parent = lastTask.getParentTask();
if (parent == null)
{
break;
}
lastLevel = NumberHelper.getInt(parent.getOutlineLevel());
lastTask = parent;
}
}
}
}
lastTask = task;
lastLevel = level;
if (autoWbs || task.getWBS() == null)
{
task.generateWBS(parent);
}
if (autoOutlineNumber)
{
task.generateOutlineNumber(parent);
}
}
if (parent == null)
{
m_projectFile.getChildTasks().add(task);
}
else
{
parent.addChildTask(task);
}
}
}
} | [
"This method is used to recreate the hierarchical structure of the\nproject file from scratch. The method sorts the list of all tasks,\nthen iterates through it creating the parent-child structure defined\nby the outline level field."
] | [
"Compute Cholesky decomposition of A\n\n@param A symmetric, positive definite matrix (only upper half is used)\n@return upper triangular matrix U such that A = U' * U",
"Return a copy of the new fragment and set the variable above.",
"Adds a parameter that requires a string argument to the argument list.\nIf t... |
@Deprecated
public synchronized FailureDetectorConfig setNodes(Collection<Node> nodes) {
Utils.notNull(nodes);
this.nodes = new HashSet<Node>(nodes);
return this;
} | [
"Assigns a list of nodes in the cluster represented by this failure\ndetector configuration.\n\n@param nodes Collection of Node instances, usually determined from the\nCluster; must be non-null"
] | [
"Use this API to fetch all the nslimitselector resources that are configured on netscaler.",
"Write objects to data store, but don't release the locks.\nI don't know what we should do if we are in a checkpoint and\nwe need to abort.",
"Use this API to fetch all the nstimeout resources that are configured on net... |
@VisibleForTesting
protected static double getNearestNiceValue(
final double value, final DistanceUnit scaleUnit, final boolean lockUnits) {
DistanceUnit bestUnit = bestUnit(scaleUnit, value, lockUnits);
double factor = scaleUnit.convertTo(1.0, bestUnit);
// nearest power of 10 lower than value
int digits = (int) Math.floor((Math.log(value * factor) / Math.log(10)));
double pow10 = Math.pow(10, digits);
// ok, find first character
double firstChar = value * factor / pow10;
// right, put it into the correct bracket
int barLen;
if (firstChar >= 10.0) {
barLen = 10;
} else if (firstChar >= 5.0) {
barLen = 5;
} else if (firstChar >= 2.0) {
barLen = 2;
} else {
barLen = 1;
}
// scale it up the correct power of 10
return barLen * pow10 / factor;
} | [
"Reduce the given value to the nearest smaller 1 significant digit number starting with 1, 2 or 5.\n\n@param value the value to find a nice number for.\n@param scaleUnit the unit of the value.\n@param lockUnits if set, the values are not scaled to a \"nicer\" unit."
] | [
"Shows a dialog with user information for given session.\n\n@param session to show information for",
"Convert the continuous values into discrete values by chopping up\nthe distribution into several equally-sized intervals.",
"Use this API to update spilloverpolicy.",
"Read a text file from assets into a sing... |
public static void validate(final License license) {
// A license should have a name
if(license.getName() == null ||
license.getName().isEmpty()){
throw new WebApplicationException(Response.status(Response.Status.BAD_REQUEST)
.entity("License name should not be empty!")
.build());
}
// A license should have a long name
if(license.getLongName() == null ||
license.getLongName().isEmpty()){
throw new WebApplicationException(Response.status(Response.Status.BAD_REQUEST)
.entity("License long name should not be empty!")
.build());
}
// If there is a regexp, it should compile
if(license.getRegexp() != null &&
!license.getRegexp().isEmpty()){
try{
Pattern.compile(license.getRegexp());
}
catch (PatternSyntaxException e){
throw new WebApplicationException(Response.status(Response.Status.BAD_REQUEST)
.entity("License regexp does not compile!").build());
}
Pattern regex = Pattern.compile("[&%//]");
if(regex.matcher(license.getRegexp()).find()){
throw new WebApplicationException(Response.status(Response.Status.BAD_REQUEST)
.entity("License regexp does not compile!").build());
}
}
} | [
"Checks if the provided license is valid and could be stored into the database\n\n@param license the license to test\n@throws WebApplicationException if the data is corrupted"
] | [
"Searches the type and its sub types for the nearest ojb-persistent type and returns its name.\n\n@param type The type to search\n@return The qualified name of the found type or <code>null</code> if no type has been found",
"Parse a boolean.\n\n@param value boolean\n@return Boolean value",
"Adds OPT_FORMA... |
public void setIndexBuffer(GVRIndexBuffer ibuf)
{
mIndices = ibuf;
NativeMesh.setIndexBuffer(getNative(), (ibuf != null) ? ibuf.getNative() : 0L);
} | [
"Changes the index buffer associated with this mesh.\n@param ibuf new index buffer to use\n@see #setIndices(int[])\n@see #getIndexBuffer()\n@see #getIntIndices()"
] | [
"Begin a \"track;\" that is, begin logging at one level deeper.\nChannels other than the FORCE channel are ignored.\n@param args The title of the track to begin, with an optional FORCE flag.",
"Use this API to fetch systemuser resource of given name .",
"Removes the supplied marker from the map.\n\n@param marke... |
@Override
public Set<String> paramKeys() {
Set<String> set = new HashSet<String>();
set.addAll(C.<String>list(request.paramNames()));
set.addAll(extraParams.keySet());
set.addAll(bodyParams().keySet());
set.remove("_method");
set.remove("_body");
return set;
} | [
"Get all parameter keys.\n@return a set of parameter keys"
] | [
"Simple, high-level API to enable or disable eye picking for this scene\nobject.\n\nThe {@linkplain #attachCollider low-level\nAPI} gives you a lot of control over eye picking, but it does involve an\nawful lot of details. This method\n(and {@link #getPickingEnabled()}) provides a simple boolean property.\nIt attac... |
public static AiScene importFile(String filename) throws IOException {
return importFile(filename, EnumSet.noneOf(AiPostProcessSteps.class));
} | [
"Imports a file via assimp without post processing.\n\n@param filename the file to import\n@return the loaded scene\n@throws IOException if an error occurs"
] | [
"Handle a \"current till end\" change event.\n@param event the change event.",
"Load the given configuration file.",
"Returns s if it's at most maxWidth chars, otherwise chops right side to fit.",
"Append data to JSON response.\n@param param\n@param value",
"Use this API to fetch vpath resource of given nam... |
public static double computeRowMax( ZMatrixRMaj A ,
int row , int col0 , int col1 ) {
double max = 0;
int indexA = A.getIndex(row,col0);
double h[] = A.data;
for (int i = col0; i < col1; i++) {
double realVal = h[indexA++];
double imagVal = h[indexA++];
double magVal = realVal*realVal + imagVal*imagVal;
if( max < magVal ) {
max = magVal;
}
}
return Math.sqrt(max);
} | [
"Finds the magnitude of the largest element in the row\n@param A Complex matrix\n@param row Row in A\n@param col0 First column in A to be copied\n@param col1 Last column in A + 1 to be copied\n@return magnitude of largest element"
] | [
"Add a new check box.\n@param date the date for the check box\n@param checkState the initial check state.",
"Use this API to fetch bridgegroup_vlan_binding resources of given name .",
"Generate the next permutation and return a list containing\nthe elements in the appropriate order.\n@see #nextPermutationAsList... |
public static String encodeQueryParam(String queryParam, String encoding) throws UnsupportedEncodingException {
return HierarchicalUriComponents.encodeUriComponent(queryParam, encoding, HierarchicalUriComponents.Type.QUERY_PARAM);
} | [
"Encodes the given URI query parameter with the given encoding.\n@param queryParam the query parameter to be encoded\n@param encoding the character encoding to encode to\n@return the encoded query parameter\n@throws UnsupportedEncodingException when the given encoding parameter is not supported"
] | [
"Gets the value of the ppvItem property.\n\n<p>\nThis accessor method returns a reference to the live list,\nnot a snapshot. Therefore any modification you make to the\nreturned list will be present inside the JAXB object.\nThis is why there is not a <CODE>set</CODE> method for the ppvItem property.\n\n<p>\nFor exa... |
void lockSharedInterruptibly(final Integer permit) throws InterruptedException {
if (permit == null) {
throw new IllegalArgumentException();
}
sync.acquireSharedInterruptibly(permit);
} | [
"Acquire the shared lock allowing the acquisition to be interrupted.\n@param permit - the permit Integer for this operation. May not be {@code null}.\n@throws InterruptedException - if the acquiring thread is interrupted.\n@throws IllegalArgumentException if {@code permit} is null."
] | [
"Returns this bar code's pattern, converted into a set of corresponding codewords.\nUseful for bar codes that encode their content as a pattern.\n\n@param size the number of digits in each codeword\n@return this bar code's pattern, converted into a set of corresponding codewords",
"Request the list of all tracks ... |
public ImmutableList<AbstractElement> getFirstSetGrammarElements() {
if (firstSetGrammarElements == null) {
firstSetGrammarElements = ImmutableList.copyOf(mutableFirstSetGrammarElements);
}
return firstSetGrammarElements;
} | [
"The grammar elements that may occur at the given offset."
] | [
"Use this API to add route6.",
"Flushes this output stream and forces any buffered output bytes to be written out to the stream. If propagate is\ntrue, the wrapped stream will also be flushed.\n\n@param propagate\nboolean flag to indicate whether the wrapped OutputStream should also be flushed.\n@throws IOExcepti... |
public static String getCorrelationId(Message message) {
String correlationId = (String) message.get(CORRELATION_ID_KEY);
if(null == correlationId) {
correlationId = readCorrelationId(message);
}
if(null == correlationId) {
correlationId = readCorrelationIdSoap(message);
}
return correlationId;
} | [
"Get CorrelationId from message.\n\n@param message the message\n@return correlationId or null if not set"
] | [
"Use this API to fetch all the cacheobject resources that are configured on netscaler.",
"Dumps the partition IDs per node in terms of zone n-ary type.\n\n@param cluster\n@param storeRoutingPlan\n@return pretty printed string of detailed zone n-ary type.",
"This method retrieves the data at the given offset and... |
public static Cluster greedyShufflePartitions(final Cluster nextCandidateCluster,
final int greedyAttempts,
final int greedySwapMaxPartitionsPerNode,
final int greedySwapMaxPartitionsPerZone,
List<Integer> greedySwapZoneIds,
List<StoreDefinition> storeDefs) {
List<Integer> zoneIds = null;
if(greedySwapZoneIds.isEmpty()) {
zoneIds = new ArrayList<Integer>(nextCandidateCluster.getZoneIds());
} else {
zoneIds = new ArrayList<Integer>(greedySwapZoneIds);
}
List<Integer> nodeIds = new ArrayList<Integer>();
Cluster returnCluster = Cluster.cloneCluster(nextCandidateCluster);
double currentUtility = new PartitionBalance(returnCluster, storeDefs).getUtility();
for(int i = 0; i < greedyAttempts; i++) {
// Iterate over zone ids to decide which node ids to include for
// intra-zone swapping.
// In future, if there is a need to support inter-zone swapping,
// then just remove the
// zone specific logic that populates nodeIdSet and add all nodes
// from across all zones.
int zoneIdOffset = i % zoneIds.size();
Set<Integer> nodeIdSet = nextCandidateCluster.getNodeIdsInZone(zoneIds.get(zoneIdOffset));
nodeIds = new ArrayList<Integer>(nodeIdSet);
Collections.shuffle(zoneIds, new Random(System.currentTimeMillis()));
Cluster shuffleResults = swapGreedyRandomPartitions(returnCluster,
nodeIds,
greedySwapMaxPartitionsPerNode,
greedySwapMaxPartitionsPerZone,
storeDefs);
double nextUtility = new PartitionBalance(shuffleResults, storeDefs).getUtility();
System.out.println("Swap improved max-min ratio: " + currentUtility + " -> "
+ nextUtility + " (swap attempt " + i + " in zone "
+ zoneIds.get(zoneIdOffset) + ")");
returnCluster = shuffleResults;
currentUtility = nextUtility;
}
return returnCluster;
} | [
"Within a single zone, tries swapping some minimum number of random\npartitions per node with some minimum number of random partitions from\nother nodes within the zone. Chooses the best swap in each iteration.\nLarge values of the greedSwapMaxPartitions... arguments make this method\nequivalent to comparing every ... | [
"Maps a field index to a ResourceField instance.\n\n@param fields array of fields used as the basis for the mapping.\n@param index required field index\n@return ResourceField instance",
"Default settings set type loader to ClasspathTypeLoader if not set before.",
"Get random geographical location\n@return 2-Tup... |
public List<MapRow> read() throws IOException
{
List<MapRow> result = new ArrayList<MapRow>();
int fileCount = m_stream.readInt();
if (fileCount != 0)
{
for (int index = 0; index < fileCount; index++)
{
// We use a LinkedHashMap to preserve insertion order in iteration
// Useful when debugging the file format.
Map<String, Object> map = new LinkedHashMap<String, Object>();
readBlock(map);
result.add(new MapRow(map));
}
}
return result;
} | [
"Read a list of fixed sized blocks from the input stream.\n\n@return List of MapRow instances representing the fixed size blocks"
] | [
"Sets a custom configuration attribute.\n@param attributeName the attribute name. Names starting with\n{@link #JDBC_PROPERTY_NAME_PREFIX} will be used (without the prefix) by the\nConnectionFactory when creating connections from DriverManager\n(not used for external DataSource connections). Names starting with\n{@l... |
private void saveLocalization() {
SortedProperties localization = new SortedProperties();
for (Object itemId : m_container.getItemIds()) {
Item item = m_container.getItem(itemId);
String key = item.getItemProperty(TableProperty.KEY).getValue().toString();
String value = item.getItemProperty(TableProperty.TRANSLATION).getValue().toString();
if (!(key.isEmpty() || value.isEmpty())) {
localization.put(key, value);
}
}
m_keyset.updateKeySet(m_localizations.get(m_locale).keySet(), localization.keySet());
m_localizations.put(m_locale, localization);
} | [
"Saves the current translations from the container to the respective localization."
] | [
"Get unique values form the array.\n\n@param values Array of values.\n@return Unique values.",
"Gets an iterator to the EJB descriptors for an EJB implementation class\n\n@param beanClass The EJB class\n@return An iterator",
"Returns the configured mappings of the current field.\n\n@return the configured mappin... |
@Override
public CompletableFuture<Map<String, Change<?>>> diff(Revision from, Revision to, String pathPattern) {
final ServiceRequestContext ctx = context();
return CompletableFuture.supplyAsync(() -> {
requireNonNull(from, "from");
requireNonNull(to, "to");
requireNonNull(pathPattern, "pathPattern");
failFastIfTimedOut(this, logger, ctx, "diff", from, to, pathPattern);
final RevisionRange range = normalizeNow(from, to).toAscending();
readLock();
try (RevWalk rw = new RevWalk(jGitRepository)) {
final RevTree treeA = rw.parseTree(commitIdDatabase.get(range.from()));
final RevTree treeB = rw.parseTree(commitIdDatabase.get(range.to()));
// Compare the two Git trees.
// Note that we do not cache here because CachingRepository caches the final result already.
return toChangeMap(blockingCompareTreesUncached(treeA, treeB,
pathPatternFilterOrTreeFilter(pathPattern)));
} catch (StorageException e) {
throw e;
} catch (Exception e) {
throw new StorageException("failed to parse two trees: range=" + range, e);
} finally {
readUnlock();
}
}, repositoryWorker);
} | [
"Get the diff between any two valid revisions.\n\n@param from revision from\n@param to revision to\n@param pathPattern target path pattern\n@return the map of changes mapped by path\n@throws StorageException if {@code from} or {@code to} does not exist."
] | [
"Writes image files for all data that was collected and the statistics\nfile for all sites.",
"Gets a list of any comments on this file.\n\n@return a list of comments on this file.",
"Set the classpath for loading the driver.\n\n@param classpath the classpath",
"Writes the body of this request to an HttpURLCo... |
private Class<?> beanType(String name) {
Class<?> type = context.getType(name);
if (ClassUtils.isCglibProxyClass(type)) {
return AopProxyUtils.ultimateTargetClass(context.getBean(name));
}
return type;
} | [
"Return the bean type, untangling the proxy if needed\n\n@param name\nthe bean name\n@return The Class of the bean"
] | [
"Use this API to unset the properties of sslparameter resource.\nProperties that need to be unset are specified in args array.",
"Get the class name without the package\n\n@param c The class name with package\n@return the class name without the package",
"Returns the approximate size of slop to help in throttli... |
public static void doBatchEnqueue(final Jedis jedis, final String namespace, final String queue, final List<String> jobJsons) {
Pipeline pipelined = jedis.pipelined();
pipelined.sadd(JesqueUtils.createKey(namespace, QUEUES), queue);
for (String jobJson : jobJsons) {
pipelined.rpush(JesqueUtils.createKey(namespace, QUEUE, queue), jobJson);
}
pipelined.sync();
} | [
"Helper method that encapsulates the minimum logic for adding jobs to a queue.\n\n@param jedis\nthe connection to Redis\n@param namespace\nthe Resque namespace\n@param queue\nthe Resque queue name\n@param jobJsons\na list of jobs serialized as JSON"
] | [
"Use this API to enable the mode on Netscaler.\n@param mode mode to be enabled.\n@return status of the operation performed.\n@throws Exception Nitro exception.",
"Validations specific to PUT",
"Retrieve the FeatureSource object from the data store.\n\n@return An OpenGIS FeatureSource object;\n@throws LayerExcep... |
public static <T> List<T> toList(Iterator<? extends T> iterator) {
return Lists.newArrayList(iterator);
} | [
"Returns a list that contains all the entries of the given iterator in the same order.\n\n@param iterator\nthe iterator. May not be <code>null</code>.\n@return a list with the same entries as the given iterator. Never <code>null</code>."
] | [
"Create a clone of the Renderer. This method is the base of the prototype mechanism implemented\nto avoid create new objects from RendererBuilder. Pay an special attention implementing clone\nmethod in Renderer subtypes.\n\n@return a copy of the current renderer.",
"Generate a PageMetadata object for the page rep... |
public static void deleteMetadataTemplate(BoxAPIConnection api, String scope, String template) {
URL url = METADATA_TEMPLATE_URL_TEMPLATE.build(api.getBaseURL(), scope, template);
BoxJSONRequest request = new BoxJSONRequest(api, url, "DELETE");
request.send();
} | [
"Deletes the schema of an existing metadata template.\n\n@param api the API connection to be used\n@param scope the scope of the object\n@param template Unique identifier of the template"
] | [
"Check if the the nodeId is present in the cluster managed by the metadata store\nor throw an exception.\n\n@param nodeId The nodeId to check existence of",
"Converts the List to PagedList.\n@param list list to be converted in to paged list\n@param <InnerT> the wrapper inner type\n@return the Paged list for the i... |
private static TransportType map2TransportType(String transportId) {
TransportType type;
if (CXF_HTTP_TRANSPORT_ID.equals(transportId) || SOAP_HTTP_TRANSPORT_ID.equals(transportId)) {
type = TransportType.HTTP;
} else {
type = TransportType.OTHER;
}
return type;
} | [
"Maps a transportId to its corresponding TransportType.\n@param transportId\n@return"
] | [
"Returns the text value of all of the elements in the collection.\n\n@return the text value of all the elements in the collection or null",
"Reads the availability table from the file.\n\n@param resource MPXJ resource instance\n@param periods MSPDI availability periods",
"Adds the class descriptor to this model... |
public void addRoute(String path, Class<? extends Actor> actorClass) throws RouteAlreadyMappedException {
addRoute(new Route(path, false), actorClass);
} | [
"Add an exact path to the routing table.\n\n@throws RouteAlreadyMappedException"
] | [
"Reloads the synchronization config. This wipes all in-memory synchronization settings.",
"Use this API to fetch all the callhome resources that are configured on netscaler.",
"adds the qualified names to the export-package attribute, if not already\npresent.\n\n@param packages - passing parameterized packages ... |
public static int restrictRange(int value, int min, int max)
{
return Math.min((Math.max(value, min)), max);
} | [
"If the specified value is not greater than or equal to the specified minimum and\nless than or equal to the specified maximum, adjust it so that it is.\n@param value The value to check.\n@param min The minimum permitted value.\n@param max The maximum permitted value.\n@return {@code value} if it is between the spe... | [
"Read an exception day for a calendar.\n\n@param mpxjCalendar ProjectCalendar instance\n@param day ConceptDraw PROJECT exception day",
"Determines whether the specified permission is permitted.\n\n@param permission\n@return <tt>false<tt> if the specified permission is not permitted, based on the current security ... |
public JSONObject toJSON() {
try {
return new JSONObject(properties).putOpt("name", getName());
} catch (JSONException e) {
e.printStackTrace();
Log.e(TAG, e, "toJSON()");
throw new RuntimeAssertion("NodeEntry.toJSON() failed for '%s'", this);
}
} | [
"Converts the node to JSON\n@return JSON object"
] | [
"Tests whether a Row name occurs more than once in the list of rows\n@param name\n@return",
"Returns all entries in no particular order.",
"Use this API to delete dnssuffix of given name.",
"Utility function that fetches node ids.\n\n@param adminClient An instance of AdminClient points to given cluster\n@retu... |
public void removeScript(int id) throws Exception {
PreparedStatement statement = null;
try (Connection sqlConnection = SQLService.getInstance().getConnection()) {
statement = sqlConnection.prepareStatement(
"DELETE FROM " + Constants.DB_TABLE_SCRIPT +
" WHERE " + Constants.GENERIC_ID + " = ?"
);
statement.setInt(1, id);
statement.executeUpdate();
} catch (SQLException e) {
e.printStackTrace();
} finally {
try {
if (statement != null) {
statement.close();
}
} catch (Exception e) {
}
}
} | [
"Remove script for a given ID\n\n@param id ID of script\n@throws Exception exception"
] | [
"Sets the name of the designated bone.\n\n@param boneindex zero based index of bone to rotate.\n@param bonename string with name of bone.\n. * @see #getBoneName",
"Run a task periodically, for a set number of times.\n\n@param task\nTask to run.\n@param delay\nThe first execution will happen in {@code delay} ... |
public void process(InputStream is) throws Exception
{
readHeader(is);
readVersion(is);
readTableData(readTableHeaders(is), is);
} | [
"Extract raw table data from the input stream.\n\n@param is input stream"
] | [
"Clears the internal used cache for object materialization.",
"Build filter for the request.\n\n@param layerFilter layer filter\n@param featureIds features to include in report (null for all)\n@return filter\n@throws GeomajasException filter could not be parsed/created",
"Adds the value to the Collection mapped... |
public Weld addBeanDefiningAnnotations(Class<? extends Annotation>... annotations) {
for (Class<? extends Annotation> annotation : annotations) {
this.extendedBeanDefiningAnnotations.add(annotation);
}
return this;
} | [
"Registers annotations which will be considered as bean defining annotations.\n\nNOTE - If used along with {@code <trim/>} bean archives and/or with Weld configuration key\n{@code org.jboss.weld.bootstrap.vetoTypesWithoutBeanDefiningAnnotation}, these annotations will be ignored.\n\n@param annotations annotations w... | [
"Gets the date time str standard.\n\n@param d\nthe d\n@return the date time str standard",
"Launches the client with the specified parameters.\n\n@param args\ncommand line parameters\n@throws ParseException\n@throws IOException",
"Re-initializes the shader texture used to fill in\nthe Circle upon drawing.",
"... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.