query stringlengths 74 6.1k | positive listlengths 1 1 | negative listlengths 9 9 |
|---|---|---|
private final void replyErrors(final String errorMessage,
final String stackTrace, final String statusCode,
final int statusCodeInt) {
reply(true, errorMessage, stackTrace, statusCode, statusCodeInt,
PcConstants.NA, null);
} | [
"Reply used in error cases. set the response header as null.\n\n@param errorMessage the error message\n@param stackTrace the stack trace\n@param statusCode the status code\n@param statusCodeInt the status code int"
] | [
"Decides what are the preferred credentials to use for resolving the repo keys of the server\n\n@return Preferred credentials for repo resolving. Never null.",
"Clear any current allowed job types and use the given set.\n@param jobTypes the job types to allow",
"Fires the event.\n\n@param source the event sourc... |
public static<A, Z> Function1<A, Z> lift(Func1<A, Z> f) {
return bridge.lift(f);
} | [
"Lift a Java Func1 to a Scala Function1\n\n@param f the function to lift\n\n@returns the Scala function"
] | [
"exposed only for tests",
"Locks the bundle descriptor.\n@throws CmsException thrown if locking fails.",
"Returns the title according to the given locale.\n@param locale the locale for which the title should be read.\n@return the title according to the given locale",
"Method generates abbreviated exception me... |
public MaterialSection getSectionByTitle(String title) {
for(MaterialSection section : sectionList) {
if(section.getTitle().equals(title)) {
return section;
}
}
for(MaterialSection section : bottomSectionList) {
if(section.getTitle().equals(title))
return section;
}
return null;
} | [
"Get a setted section knowing his title\n\nN.B. this search only into section list and bottom section list.\n@param title is the title of the section\n@return the section with title or null if the section is not founded"
] | [
"Start transaction on the underlying connection.",
"Handles the cases in which we can use longs rather than BigInteger\n\n@param section\n@param increment\n@param addrCreator\n@param lowerProducer\n@param upperProducer\n@param prefixLength\n@return",
"Calculates a md5 hash for an url\n\nIf a passed in url is ab... |
public String getValueSchema() throws IOException {
Schema schema = getInputPathAvroSchema();
String valueSchema = schema.getField(valueFieldName).schema().toString();
return valueSchema;
} | [
"Extract schema of the value field"
] | [
"Add \"ORDER BY\" clause to the SQL query statement. This can be called multiple times to add additional \"ORDER BY\"\nclauses. Ones earlier are applied first.",
"Use this API to fetch the statistics of all lbvserver_stats resources that are configured on netscaler.",
"Gets the flags associated with this attrib... |
public void enable(ConduitSelectorHolder conduitSelectorHolder, SLPropertiesMatcher matcher,
String selectionStrategy) {
LocatorTargetSelector selector = new LocatorTargetSelector();
selector.setEndpoint(conduitSelectorHolder.getConduitSelector().getEndpoint());
String actualStrategy = selectionStrategy != null ? selectionStrategy : defaultLocatorSelectionStrategy;
LocatorSelectionStrategy locatorSelectionStrategy = getLocatorSelectionStrategy(actualStrategy);
locatorSelectionStrategy.setServiceLocator(locatorClient);
if (matcher != null) {
locatorSelectionStrategy.setMatcher(matcher);
}
selector.setLocatorSelectionStrategy(locatorSelectionStrategy);
if (LOG.isLoggable(Level.INFO)) {
LOG.log(Level.INFO, "Client enabled with strategy "
+ locatorSelectionStrategy.getClass().getName() + ".");
}
conduitSelectorHolder.setConduitSelector(selector);
if (LOG.isLoggable(Level.FINE)) {
LOG.log(Level.FINE, "Successfully enabled client " + conduitSelectorHolder
+ " for the service locator");
}
} | [
"The selectionStrategy given as String argument is selected as locatorSelectionStrategy.\nIf selectionStrategy is null, the defaultLocatorSelectionStrategy is used instead.\nThen the new locatorSelectionStrategy is connected to the locatorClient and the matcher.\nA new LocatorTargetSelector is created, set to the l... | [
"Convenience method dispatches the specified event to the source appender,\nwhich will result in the custom event data being appended to the new file.\n\n@param customLoggingEvent\nThe custom Log4J event to be appended.",
"Return the list of module dependencies\n\n@param moduleName\n@param moduleVersion\n@param f... |
@SuppressWarnings("unchecked")
public static <E> TypeConverter<E> typeConverterFor(Class<E> cls) throws NoSuchTypeConverterException {
TypeConverter<E> typeConverter = TYPE_CONVERTERS.get(cls);
if (typeConverter == null) {
throw new NoSuchTypeConverterException(cls);
}
return typeConverter;
} | [
"Returns a TypeConverter for a given class.\n\n@param cls The class for which the TypeConverter should be fetched."
] | [
"Legacy conversion.\n@param map\n@return Properties",
"Associate a type with the given resource model.",
"Use this API to delete nsacl6 of given name.",
"Loads the asset referenced by the file name\nunder the owner of this component.\nIf this component was constructed to replace the scene with\nthe asset, the... |
protected String getQueryParam() {
String param = parseOptionalStringValue(m_configObject, JSON_KEY_QUERYPARAM);
if (param == null) {
return null != m_baseConfig ? m_baseConfig.getGeneralConfig().getQueryParam() : DEFAULT_QUERY_PARAM;
} else {
return param;
}
} | [
"Returns the configured request parameter for the query string, or the default parameter if no core is configured.\n@return The configured request parameter for the query string, or the default parameter if no core is configured."
] | [
"Returns an Array with an Objects PK VALUES if convertToSql is true, any\nassociated java-to-sql conversions are applied. If the Object is a Proxy\nor a VirtualProxy NO conversion is necessary.\n\n@param objectOrProxy\n@param convertToSql\n@return Object[]\n@throws PersistenceBrokerException",
"Populates default ... |
public static String getXPathExpression(Node node) {
Object xpathCache = node.getUserData(FULL_XPATH_CACHE);
if (xpathCache != null) {
return xpathCache.toString();
}
Node parent = node.getParentNode();
if ((parent == null) || parent.getNodeName().contains("#document")) {
String xPath = "/" + node.getNodeName() + "[1]";
node.setUserData(FULL_XPATH_CACHE, xPath, null);
return xPath;
}
if (node.hasAttributes() && node.getAttributes().getNamedItem("id") != null) {
String xPath = "//" + node.getNodeName() + "[@id = '"
+ node.getAttributes().getNamedItem("id").getNodeValue() + "']";
node.setUserData(FULL_XPATH_CACHE, xPath, null);
return xPath;
}
StringBuffer buffer = new StringBuffer();
if (parent != node) {
buffer.append(getXPathExpression(parent));
buffer.append("/");
}
buffer.append(node.getNodeName());
List<Node> mySiblings = getSiblings(parent, node);
for (int i = 0; i < mySiblings.size(); i++) {
Node el = mySiblings.get(i);
if (el.equals(node)) {
buffer.append('[').append(Integer.toString(i + 1)).append(']');
// Found so break;
break;
}
}
String xPath = buffer.toString();
node.setUserData(FULL_XPATH_CACHE, xPath, null);
return xPath;
} | [
"Reverse Engineers an XPath Expression of a given Node in the DOM.\n\n@param node the given node.\n@return string xpath expression (e.g., \"/html[1]/body[1]/div[3]\")."
] | [
"Return the current handedness of the Gear Controller.\n\n@return returns whether the user is using the controller left or right handed. This function\nreturns <code>null</code> if the controller is unavailable or the data is stale.",
"Insert an entity into the datastore.\n\nThe entity must have no ids.\n\n@retur... |
public void cullHistory(final int profileId, final String clientUUID, final int limit) throws Exception {
//Allow only 1 delete thread to run
if (threadActive) {
return;
}
threadActive = true;
//Create a thread so proxy will continue to work during long delete
Thread t1 = new Thread(new Runnable() {
@Override
public void run() {
PreparedStatement statement = null;
try (Connection sqlConnection = sqlService.getConnection()) {
String sqlQuery = "SELECT COUNT(" + Constants.GENERIC_ID + ") FROM " + Constants.DB_TABLE_HISTORY + " ";
// see if profileId is set or not (-1)
if (profileId != -1) {
sqlQuery += "WHERE " + Constants.GENERIC_PROFILE_ID + "=" + profileId + " ";
}
if (clientUUID != null && clientUUID.compareTo("") != 0) {
sqlQuery += "AND " + Constants.GENERIC_CLIENT_UUID + "='" + clientUUID + "' ";
}
sqlQuery += ";";
Statement query = sqlConnection.createStatement();
ResultSet results = query.executeQuery(sqlQuery);
if (results.next()) {
if (results.getInt("COUNT(" + Constants.GENERIC_ID + ")") < (limit + 10000)) {
return;
}
}
//Find the last item in the table
statement = sqlConnection.prepareStatement("SELECT " + Constants.GENERIC_ID + " FROM " + Constants.DB_TABLE_HISTORY +
" WHERE " + Constants.CLIENT_CLIENT_UUID + " = \'" + clientUUID + "\'" +
" AND " + Constants.CLIENT_PROFILE_ID + " = " + profileId +
" ORDER BY " + Constants.GENERIC_ID + " ASC LIMIT 1");
ResultSet resultSet = statement.executeQuery();
if (resultSet.next()) {
int currentSpot = resultSet.getInt(Constants.GENERIC_ID) + 100;
int finalDelete = currentSpot + 10000;
//Delete 100 items at a time until 10000 are deleted
//Do this so table is unlocked frequently to allow other proxy items to access it
while (currentSpot < finalDelete) {
PreparedStatement deleteStatement = sqlConnection.prepareStatement("DELETE FROM " + Constants.DB_TABLE_HISTORY +
" WHERE " + Constants.CLIENT_CLIENT_UUID + " = \'" + clientUUID + "\'" +
" AND " + Constants.CLIENT_PROFILE_ID + " = " + profileId +
" AND " + Constants.GENERIC_ID + " < " + currentSpot);
deleteStatement.executeUpdate();
currentSpot += 100;
}
}
} catch (Exception e) {
e.printStackTrace();
} finally {
try {
threadActive = false;
if (statement != null) {
statement.close();
}
} catch (Exception e) {
}
}
}
});
t1.start();
} | [
"Removes old entries in the history table for the given profile and client UUID\n\n@param profileId ID of profile\n@param clientUUID UUID of client\n@param limit Maximum number of history entries to remove\n@throws Exception exception"
] | [
"Calculate start dates for a yearly recurrence.\n\n@param calendar current date\n@param dates array of start dates",
"calculate the difference of the two maps, so we know what was added, removed & updated\n@param left\n@param right\n@param onlyOnLeft\n@param onlyOnRight\n@param updated",
"In this method perform... |
public static sslglobal_sslpolicy_binding[] get(nitro_service service) throws Exception{
sslglobal_sslpolicy_binding obj = new sslglobal_sslpolicy_binding();
sslglobal_sslpolicy_binding response[] = (sslglobal_sslpolicy_binding[]) obj.get_resources(service);
return response;
} | [
"Use this API to fetch a sslglobal_sslpolicy_binding resources."
] | [
"Validates operations against their description providers\n\n@param operations The operations to validate\n@throws IllegalArgumentException if any operation is not valid",
"state chain management ops below",
"Internal method that adds a metadata provider to the set associated with a particular hash key, creatin... |
public void search(String query) {
final Query newQuery = searcher.getQuery().setQuery(query);
searcher.setQuery(newQuery).search();
} | [
"Triggers a new search with the given text.\n\n@param query the text to search for."
] | [
"Adds version information.",
"set the specified object at index\n\n@param object The object to add at the end of the array.",
"Adds an array of groupby fieldNames for ReportQueries.\n@param fieldNames The groupby to set\n@deprecated use QueryByCriteria#addGroupBy",
"Returns the text for the JSONObject of Link... |
public static auditnslogpolicy_systemglobal_binding[] get(nitro_service service, String name) throws Exception{
auditnslogpolicy_systemglobal_binding obj = new auditnslogpolicy_systemglobal_binding();
obj.set_name(name);
auditnslogpolicy_systemglobal_binding response[] = (auditnslogpolicy_systemglobal_binding[]) obj.get_resources(service);
return response;
} | [
"Use this API to fetch auditnslogpolicy_systemglobal_binding resources of given name ."
] | [
"This method writes resource data to a PM XML file.",
"Report on the filtered data in DMR .",
"Returns all the retention policies.\n@param api the API connection to be used by the resource.\n@param fields the fields to retrieve.\n@return an iterable with all the retention policies.",
"Implements the AAD Algor... |
public String getController() {
final StringBuilder controller = new StringBuilder();
if (getProtocol() != null) {
controller.append(getProtocol()).append("://");
}
if (getHost() != null) {
controller.append(getHost());
} else {
controller.append("localhost");
}
if (getPort() > 0) {
controller.append(':').append(getPort());
}
return controller.toString();
} | [
"Formats a connection string for CLI to use as it's controller connection.\n\n@return the controller string to connect CLI"
] | [
"blocks until there is a connection",
"LRN cross-channel forward computation. Double parameters cast to tensor data type",
"This method is used to calculate the duration of work between two fixed\ndates according to the work schedule defined in the named calendar.\nThe name of the calendar to be used is passed ... |
private boolean ignoreMethod(String name)
{
boolean result = false;
for (String ignoredName : IGNORED_METHODS)
{
if (name.matches(ignoredName))
{
result = true;
break;
}
}
return result;
} | [
"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"
] | [
"Use this API to fetch all the appfwlearningdata resources that are configured on netscaler.\nThis uses appfwlearningdata_args which is a way to provide additional arguments while fetching the resources.",
"Updates metadata versions on stores.\n\n@param adminClient An instance of AdminClient points to given clust... |
public T create(BeanInstance beanInstance) {
final T proxy = (System.getSecurityManager() == null) ? run() : AccessController.doPrivileged(this);
((ProxyObject) proxy).weld_setHandler(new ProxyMethodHandler(contextId, beanInstance, bean));
return proxy;
} | [
"Method to create a new proxy that wraps the bean instance.\n\n@param beanInstance the bean instance\n@return a new proxy object"
] | [
"Gets the value for the key.\n\n@param key the key to check for the value\n\n@return the value or an empty collection if no values were set",
"Retrieve the number of minutes per month for this calendar.\n\n@return minutes per month",
"Use this API to unset the properties of clusternodegroup resources.\nProperti... |
public void setMonitoringService(org.talend.esb.sam.common.service.MonitoringService monitoringService) {
this.monitoringService = monitoringService;
} | [
"Sets the monitoring service.\n\n@param monitoringService the new monitoring service"
] | [
"Use this API to clear configuration on netscaler.\n@param force clear confirmation without prompting.\n@param level clear config according to the level. eg: basic, extended, full\n@return status of the operation performed.\n@throws Exception Nitro exception is thrown.",
"Seeks to the given season within the give... |
private boolean isBundleProperty(Object property) {
return (property.equals(TableProperty.KEY) || property.equals(TableProperty.TRANSLATION));
} | [
"Check if values in the column \"property\" are written to the bundle files.\n@param property the property id of the table column.\n@return a flag, indicating if values of the table column are stored to the bundle files."
] | [
"Writes the content of an input stream to an output stream\n\n@throws IOException",
"Configure all UI elements in the \"ending\"-options panel.",
"Copy a subsequence of Bytes to specific byte array. Uses the specified offset in the dest byte\narray to start the copy.\n\n@param start index of subsequence start (... |
protected static PropertyDescriptor findPropertyDescriptor(Class aClass, String aPropertyName)
{
BeanInfo info;
PropertyDescriptor[] pd;
PropertyDescriptor descriptor = null;
try
{
info = Introspector.getBeanInfo(aClass);
pd = info.getPropertyDescriptors();
for (int i = 0; i < pd.length; i++)
{
if (pd[i].getName().equals(aPropertyName))
{
descriptor = pd[i];
break;
}
}
if (descriptor == null)
{
/*
* Daren Drummond: Throw here so we are consistent
* with PersistentFieldDefaultImpl.
*/
throw new MetadataException("Can't find property " + aPropertyName + " in " + aClass.getName());
}
return descriptor;
}
catch (IntrospectionException ex)
{
/*
* Daren Drummond: Throw here so we are consistent
* with PersistentFieldDefaultImpl.
*/
throw new MetadataException("Can't find property " + aPropertyName + " in " + aClass.getName(), ex);
}
} | [
"Get the PropertyDescriptor for aClass and aPropertyName"
] | [
"Find Flickr Places information by Place ID.\n\n@deprecated This method has been deprecated. It won't be removed but you should use {@link #getInfo(String, String)} instead.\n@param placeId\n@return A Location\n@throws FlickrException",
"Byte run automaton map.\n\n@param automatonMap the automaton map\n@return th... |
public static String resolveDataSourceTypeFromDialect(String dialect)
{
if (StringUtils.contains(dialect, "Oracle"))
{
return "Oracle";
}
else if (StringUtils.contains(dialect, "MySQL"))
{
return "MySQL";
}
else if (StringUtils.contains(dialect, "DB2390Dialect"))
{
return "DB2/390";
}
else if (StringUtils.contains(dialect, "DB2400Dialect"))
{
return "DB2/400";
}
else if (StringUtils.contains(dialect, "DB2"))
{
return "DB2";
}
else if (StringUtils.contains(dialect, "Ingres"))
{
return "Ingres";
}
else if (StringUtils.contains(dialect, "Derby"))
{
return "Derby";
}
else if (StringUtils.contains(dialect, "Pointbase"))
{
return "Pointbase";
}
else if (StringUtils.contains(dialect, "Postgres"))
{
return "Postgres";
}
else if (StringUtils.contains(dialect, "SQLServer"))
{
return "SQLServer";
}
else if (StringUtils.contains(dialect, "Sybase"))
{
return "Sybase";
}
else if (StringUtils.contains(dialect, "HSQLDialect"))
{
return "HyperSQL";
}
else if (StringUtils.contains(dialect, "H2Dialect"))
{
return "H2";
}
return dialect;
} | [
"Converts the given dislect to a human-readable datasource type."
] | [
"Seeks forward or backwards to a particular season based on the current date\n\n@param seasonString The season to seek to\n@param direction The direction to seek\n@param seekAmount The number of years to seek",
"Reads GIF image from stream.\n\n@param is containing GIF file.\n@return read status code (0 = n... |
public synchronized static <D extends Dao<T, ?>, T> D lookupDao(ConnectionSource connectionSource, Class<T> clazz) {
if (connectionSource == null) {
throw new IllegalArgumentException("connectionSource argument cannot be null");
}
ClassConnectionSource key = new ClassConnectionSource(connectionSource, clazz);
Dao<?, ?> dao = lookupDao(key);
@SuppressWarnings("unchecked")
D castDao = (D) dao;
return castDao;
} | [
"Helper method to lookup a DAO if it has already been associated with the class. Otherwise this returns null."
] | [
"changes an existing property with the same name, or adds a new one\n@param key property name with which the specified value is to be\nassociated\n@param value value to be associated with the specified property name\n@return the previous value associated with property name, or null if\nthere was no mapping for prop... |
public Node createEmbedded(GraphDatabaseService executionEngine, Object[] columnValues) {
Map<String, Object> params = params( columnValues );
Result result = executionEngine.execute( getCreateEmbeddedNodeQuery(), params );
return singleResult( result );
} | [
"Create a single node representing an embedded element.\n\n@param executionEngine the {@link GraphDatabaseService} used to run the query\n@param columnValues the values in {@link org.hibernate.ogm.model.key.spi.EntityKey#getColumnValues()}\n@return the corresponding node;"
] | [
"Configs created by this ConfigBuilder will use the given Redis sentinels.\n\n@param sentinels the Redis set of sentinels\n@return this ConfigBuilder",
"Log long string using verbose tag\n\n@param TAG The tag.\n@param longString The long string.",
"Use this API to fetch a vpnglobal_vpnnexthopserver_binding reso... |
public static double elementSum( DMatrixSparseCSC A ) {
if( A.nz_length == 0)
return 0;
double sum = 0;
for(int i = 0; i < A.nz_length; i++ ) {
sum += A.nz_values[i];
}
return sum;
} | [
"Sum of all elements\n\n@param A (Input) Matrix. Not modified.\n@return scalar"
] | [
"Converts a tab delimited string into an object with given fields\nRequires the object has setXxx functions for the specified fields\n\n@param objClass Class of object to be created\n@param str string to convert\n@param delimiterRegex delimiter regular expression\n@param fieldNames fieldnames\n@param <T> type to re... |
public void setT(int t) {
this.t = Math.min((radius * 2 + 1) * (radius * 2 + 1) / 2, Math.max(0, t));
} | [
"Set trimmed value.\n\n@param t Trimmed value."
] | [
"Dumps an animation channel to stdout.\n\n@param nodeAnim the channel",
"Detects if the current browser is a BlackBerry device AND\nhas a more capable recent browser. Excludes the Playbook.\nExamples, Storm, Bold, Tour, Curve2\nExcludes the new BlackBerry OS 6 and 7 browser!!\n@return detection of a Blackberry de... |
private void deliverCacheUpdate(SlotReference slot, MetadataCache cache) {
for (final MetadataCacheListener listener : getCacheListeners()) {
try {
if (cache == null) {
listener.cacheDetached(slot);
} else {
listener.cacheAttached(slot, cache);
}
} catch (Throwable t) {
logger.warn("Problem delivering metadata cache update to listener", t);
}
}
} | [
"Send a metadata cache update announcement to all registered listeners.\n\n@param slot the media slot whose cache status has changed\n@param cache the cache which has been attached, or, if {@code null}, the previous cache has been detached"
] | [
"Pump events from event stream.",
"Sets the CircularImageView's border width in pixels.\n@param borderWidth Width in pixels for the border.",
"Searches the set of imports to find a matching import by type name.\n\n@param typeName\nname of type (qualified or simple name allowed)\n@return found import or {@code n... |
private void bindProcedure(PreparedStatement stmt, ClassDescriptor cld, Object obj, ProcedureDescriptor proc)
throws SQLException
{
int valueSub = 0;
// Figure out if we are using a callable statement. If we are, then we
// will need to register one or more output parameters.
CallableStatement callable = null;
try
{
callable = (CallableStatement) stmt;
}
catch(Exception e)
{
m_log.error("Error while bind values for class '" + (cld != null ? cld.getClassNameOfObject() : null)
+ "', using stored procedure: "+ proc, e);
if(e instanceof SQLException)
{
throw (SQLException) e;
}
else
{
throw new PersistenceBrokerException("Unexpected error while bind values for class '"
+ (cld != null ? cld.getClassNameOfObject() : null) + "', using stored procedure: "+ proc);
}
}
// If we have a return value, then register it.
if ((proc.hasReturnValue()) && (callable != null))
{
int jdbcType = proc.getReturnValueFieldRef().getJdbcType().getType();
m_platform.setNullForStatement(stmt, valueSub + 1, jdbcType);
callable.registerOutParameter(valueSub + 1, jdbcType);
valueSub++;
}
// Process all of the arguments.
Iterator iterator = proc.getArguments().iterator();
while (iterator.hasNext())
{
ArgumentDescriptor arg = (ArgumentDescriptor) iterator.next();
Object val = arg.getValue(obj);
int jdbcType = arg.getJdbcType();
setObjectForStatement(stmt, valueSub + 1, val, jdbcType);
if ((arg.getIsReturnedByProcedure()) && (callable != null))
{
callable.registerOutParameter(valueSub + 1, jdbcType);
}
valueSub++;
}
} | [
"Bind a prepared statment that represents a call to a procedure or\nuser-defined function.\n\n@param stmt the statement to bind.\n@param cld the class descriptor of the object that triggered the\ninvocation of the procedure or user-defined function.\n@param obj the object that triggered the invocation of the proced... | [
"Create a clone of this volatility surface using a generic calibration\nof its parameters to given market data.\n\n@param calibrationModel The model used during calibration (contains additional objects required during valuation, e.g. curves).\n@param calibrationProducts The calibration products.\n@param calibration... |
public boolean hasNullPKField(ClassDescriptor cld, Object obj)
{
FieldDescriptor[] fields = cld.getPkFields();
boolean hasNull = false;
// an unmaterialized proxy object can never have nullified PK's
IndirectionHandler handler = ProxyHelper.getIndirectionHandler(obj);
if(handler == null || handler.alreadyMaterialized())
{
if(handler != null) obj = handler.getRealSubject();
FieldDescriptor fld;
for(int i = 0; i < fields.length; i++)
{
fld = fields[i];
hasNull = representsNull(fld, fld.getPersistentField().get(obj));
if(hasNull) break;
}
}
return hasNull;
} | [
"Detect if the given object has a PK field represents a 'null' value."
] | [
"Add a dependency task item for this model.\n\n@param dependency the dependency task item.\n@return key to be used as parameter to taskResult(string) method to retrieve result the task item",
"Return a collection of product descriptors for each option in the smile.\n\n@param referenceDate The reference date (tran... |
private static int checkResult(int result)
{
if (exceptionsEnabled && result !=
cudnnStatus.CUDNN_STATUS_SUCCESS)
{
throw new CudaException(cudnnStatus.stringFor(result));
}
return result;
} | [
"If the given result is not cudnnStatus.CUDNN_STATUS_SUCCESS\nand exceptions have been enabled, this method will throw a\nCudaException with an error message that corresponds to the\ngiven result code. Otherwise, the given result is simply\nreturned.\n\n@param result The result to check\n@return The result that was... | [
"Returns the key of the entity targeted by the represented association, retrieved from the given tuple.\n\n@param tuple the tuple from which to retrieve the referenced entity key\n@return the key of the entity targeted by the represented association",
"Get the parameters of determining this parametric\ncovariance... |
public static String readCorrelationId(Message message) {
String correlationId = null;
Map<String, List<String>> headers = getOrCreateProtocolHeader(message);
List<String> correlationIds = headers.get(CORRELATION_ID_KEY);
if (correlationIds != null && correlationIds.size() > 0) {
correlationId = correlationIds.get(0);
if (LOG.isLoggable(Level.FINE)) {
LOG.fine("HTTP header '" + CORRELATION_ID_KEY + "' found: " + correlationId);
}
} else {
if (LOG.isLoggable(Level.FINE)) {
LOG.fine("No HTTP header '" + CORRELATION_ID_KEY + "' found");
}
}
return correlationId;
} | [
"Read correlation id from message.\n\n@param message the message\n@return the CorrelationId as string"
] | [
"Sets padding between the pages\n@param padding\n@param axis",
"Sorts the specified list itself into ascending order, according to the natural ordering of its elements.\n\n@param list\nthe list to be sorted. May not be <code>null</code>.\n@return the sorted list itself.\n@see Collections#sort(List)",
"Heat Equa... |
public synchronized void createImportationDeclaration(String deviceId, String deviceType, String deviceSubType) {
Map<String, Object> metadata = new HashMap<String, Object>();
metadata.put(Constants.DEVICE_ID, deviceId);
metadata.put(Constants.DEVICE_TYPE, deviceType);
metadata.put(Constants.DEVICE_TYPE_SUB, deviceSubType);
metadata.put("scope", "generic");
ImportDeclaration declaration = ImportDeclarationBuilder.fromMetadata(metadata).build();
importDeclarations.put(deviceId, declaration);
registerImportDeclaration(declaration);
} | [
"Create an import declaration and delegates its registration for an upper class."
] | [
"Retrieve the ordinal text for a given integer.\n\n@param value integer value\n@return ordinal text",
"Retrieves the notes text for this resource.\n\n@return notes text",
"Applies the kubernetes json url to the configuration.\n\n@param map\nThe arquillian configuration.",
"Sets the options contained in the DJ... |
protected AbstractColumn buildExpressionColumn() {
ExpressionColumn column = new ExpressionColumn();
populateCommonAttributes(column);
populateExpressionAttributes(column);
column.setExpression(customExpression);
column.setExpressionToGroupBy(customExpressionToGroupBy);
column.setExpressionForCalculation(customExpressionForCalculation);
return column;
} | [
"For creating expression columns\n@return"
] | [
"Helper method to add a parameter without having to create it explicitely. The created parameter should be persisted afterwards.\n\n@param key\nname of the parameter to add\n@param value\nvalue of the parameter to create\n@return the newly created parameter",
"Creates a polling state.\n\n@param response the respo... |
public static auditsyslogpolicy_systemglobal_binding[] get(nitro_service service, String name) throws Exception{
auditsyslogpolicy_systemglobal_binding obj = new auditsyslogpolicy_systemglobal_binding();
obj.set_name(name);
auditsyslogpolicy_systemglobal_binding response[] = (auditsyslogpolicy_systemglobal_binding[]) obj.get_resources(service);
return response;
} | [
"Use this API to fetch auditsyslogpolicy_systemglobal_binding resources of given name ."
] | [
"Finish the initialization.\n\n@param container\n@param isShutdownHookEnabled",
"Used to retrieve the watermark for the item.\nIf the item does not have a watermark applied to it, a 404 Not Found will be returned by API.\n@param itemUrl url template for the item.\n@param fields the fields to retrieve.\n@return th... |
public static <T> T assertNotNull(T value, String message) {
if (value == null)
throw new IllegalStateException(message);
return value;
} | [
"Throws an IllegalStateException when the given value is null.\n@return the value"
] | [
"Get a signature for a list of parameters using the given shared secret.\n\n@param sharedSecret\nThe shared secret\n@param params\nThe parameters\n@return The signature String",
"Given the histogram of columns compute the col_idx for the matrix. nz_length is automatically set and\nnz_values will grow if needed.\... |
private void prepareInitialState(boolean isNewObject)
{
// determine appropriate modification state
ModificationState initialState;
if(isNewObject)
{
// if object is not already persistent it must be marked as new
// it must be marked as dirty because it must be stored even if it will not modified during tx
initialState = StateNewDirty.getInstance();
}
else if(isDeleted(oid))
{
// if object is already persistent it will be marked as old.
// it is marked as dirty as it has been deleted during tx and now it is inserted again,
// possibly with new field values.
initialState = StateOldDirty.getInstance();
}
else
{
// if object is already persistent it will be marked as old.
// it is marked as clean as it has not been modified during tx already
initialState = StateOldClean.getInstance();
}
// remember it:
modificationState = initialState;
} | [
"Sets the initial MoificationState of the wrapped object myObj. The initial state will be StateNewDirty if myObj\nis not persisten already. The state will be set to StateOldClean if the object is already persistent."
] | [
"Returns the index of the first invalid character of the zone, or -1 if the zone is valid\n\n@param sequence\n@return",
"Stops the current connection. No reconnecting will occur. Kills thread + cleanup.\nWaits for the loop to end",
"Invokes a JavaScript function that takes no arguments.\n\n@param <T>\n@param fu... |
public boolean detectTierIphone() {
if (detectIphoneOrIpod()
|| detectAndroidPhone()
|| detectWindowsPhone()
|| detectBlackBerry10Phone()
|| (detectBlackBerryWebKit() && detectBlackBerryTouch())
|| detectPalmWebOS()
|| detectBada()
|| detectTizen()
|| detectFirefoxOSPhone()
|| detectSailfishPhone()
|| detectUbuntuPhone()
|| detectGamingHandheld()) {
return true;
}
return false;
} | [
"The quick way to detect for a tier of devices.\nThis method detects for devices which can\ndisplay iPhone-optimized web content.\nIncludes iPhone, iPod Touch, Android, Windows Phone 7 and 8, BB10, WebOS, Playstation Vita, etc.\n@return detection of any device in the iPhone/Android/Windows Phone/BlackBerry/WebOS Ti... | [
"Records the result of updating a server group.\n\n@param serverGroup the server group's name. Cannot be <code>null</code>\n@param failed <code>true</code> if the server group update failed;\n<code>false</code> if it succeeded",
"Unlinks a set of dependencies from this task.\n\n@param task The task to remove dep... |
private static String toColumnName(String fieldName) {
int lastDot = fieldName.indexOf('.');
if (lastDot > -1) {
return fieldName.substring(lastDot + 1);
} else {
return fieldName;
}
} | [
"Returns the portion of the field name after the last dot, as field names\nmay actually be paths."
] | [
"Use this API to disable snmpalarm of given name.",
"Load the windows resize handler with initial view port detection.",
"Use this API to fetch statistics of appfwprofile_stats resource of given name .",
"Helper function to bind script bundler to various targets",
"Returns the value of the element with the ... |
public static linkset[] get(nitro_service service) throws Exception{
linkset obj = new linkset();
linkset[] response = (linkset[])obj.get_resources(service);
return response;
} | [
"Use this API to fetch all the linkset resources that are configured on netscaler."
] | [
"All address strings are comparable. If two address strings are invalid, their strings are compared.\nOtherwise, address strings are compared according to which type or version of string, and then within each type or version\nthey are compared using the comparison rules for addresses.\n\n@param other\n@return",
... |
private void writeTaskPredecessors(Task record)
{
m_buffer.setLength(0);
//
// Write the task predecessor
//
if (!record.getSummary() && !record.getPredecessors().isEmpty())
{ // I don't use summary tasks for SDEF
m_buffer.append("PRED ");
List<Relation> predecessors = record.getPredecessors();
for (Relation pred : predecessors)
{
m_buffer.append(SDEFmethods.rset(pred.getSourceTask().getUniqueID().toString(), 10) + " ");
m_buffer.append(SDEFmethods.rset(pred.getTargetTask().getUniqueID().toString(), 10) + " ");
String type = "C"; // default finish-to-start
if (!pred.getType().toString().equals("FS"))
{
type = pred.getType().toString().substring(0, 1);
}
m_buffer.append(type + " ");
Duration dd = pred.getLag();
double duration = dd.getDuration();
if (dd.getUnits() != TimeUnit.DAYS)
{
dd = Duration.convertUnits(duration, dd.getUnits(), TimeUnit.DAYS, m_minutesPerDay, m_minutesPerWeek, m_daysPerMonth);
}
Double days = Double.valueOf(dd.getDuration() + 0.5); // Add 0.5 so half day rounds up upon truncation
Integer est = Integer.valueOf(days.intValue());
m_buffer.append(SDEFmethods.rset(est.toString(), 4) + " "); // task duration in days required by USACE
}
m_writer.println(m_buffer.toString());
}
} | [
"Write each predecessor for a task.\n\n@param record Task instance"
] | [
"Deletes the metadata on this folder associated with a specified scope and template.\n\n@param templateName the metadata template type name.\n@param scope the scope of the template (usually \"global\" or \"enterprise\").",
"Search for rectangles which have the same width and x position, and\nwhich join tog... |
public static void read(InputStream stream, byte[] buffer) throws IOException {
int read = 0;
while(read < buffer.length) {
int newlyRead = stream.read(buffer, read, buffer.length - read);
if(newlyRead == -1)
throw new EOFException("Attempt to read " + buffer.length
+ " bytes failed due to EOF.");
read += newlyRead;
}
} | [
"Read exactly buffer.length bytes from the stream into the buffer\n\n@param stream The stream to read from\n@param buffer The buffer to read into"
] | [
"When the descriptor was added while editing, but the change was not saved, it has to be removed\nwhen the editor is closed.\n@throws CmsException thrown when deleting the descriptor resource fails",
"Consumer is required to do any privilege checks before getting here\n\n@param request a {@link HttpServletRequest... |
public static dbdbprofile[] get_filtered(nitro_service service, filtervalue[] filter) throws Exception{
dbdbprofile obj = new dbdbprofile();
options option = new options();
option.set_filter(filter);
dbdbprofile[] response = (dbdbprofile[]) obj.getfiltered(service, option);
return response;
} | [
"Use this API to fetch filtered set of dbdbprofile resources.\nset the filter parameter values in filtervalue object."
] | [
"Use this API to delete appfwjsoncontenttype of given name.",
"Returns the association row with the given key.\n\n@param key the key of the row to return.\n@return the association row with the given key or {@code null} if no row with that key is contained in this\nassociation",
"Checks to see if the two matrice... |
public void sub(Vector3d v1) {
x -= v1.x;
y -= v1.y;
z -= v1.z;
} | [
"Subtracts v1 from this vector and places the result in this vector.\n\n@param v1\nright-hand vector"
] | [
"Perform a one-off scan during boot to establish deployment tasks to execute during boot",
"Reads primary key information from current RS row and generates a\n\ncorresponding Identity, and returns a proxy from the Identity.\n\n@throws PersistenceBrokerException\nif there was an error creating the proxy class",
... |
public int readFrom(byte[] src, int srcOffset, long destOffset, int length) {
int readLen = (int) Math.min(src.length - srcOffset, Math.min(size() - destOffset, length));
ByteBuffer b = toDirectByteBuffer(destOffset, readLen);
b.position(0);
b.put(src, srcOffset, readLen);
return readLen;
} | [
"Read the given source byte array, then overwrite this buffer's contents\n\n@param src source byte array\n@param srcOffset offset in source byte array to read from\n@param destOffset offset in this buffer to read to\n@param length max number of bytes to read\n@return the number of bytes read"
] | [
"Sorts the given array into sorted order using the given comparator.\n\n@param self the array to be sorted\n@param comparator a Comparator used for the comparison\n@return the sorted array\n@since 1.5.5",
"Loads a CRF classifier from an InputStream, and returns it. This method\ndoes not buffer the InputStream, so... |
public void fire(StepStartedEvent event) {
Step step = new Step();
event.process(step);
stepStorage.put(step);
notifier.fire(event);
} | [
"Process StepStartedEvent. New step will be created and added to\nstepStorage.\n\n@param event to process"
] | [
"Gets the gradient at the current point, computed on the given batch of examples.\n@param batch A set of indices indicating the examples over which the gradient should be computed.\n@param gradient The output gradient, a vector of partial derivatives.",
"Returns the real key object.",
"Use this API to fetch all... |
public static GVRTexture loadFutureCubemapTexture(
GVRContext gvrContext, ResourceCache<GVRImage> textureCache,
GVRAndroidResource resource, int priority,
Map<String, Integer> faceIndexMap) {
GVRTexture tex = new GVRTexture(gvrContext);
GVRImage cached = textureCache.get(resource);
if (cached != null)
{
Log.v("ASSET", "Future Texture: %s loaded from cache", cached.getFileName());
tex.setImage(cached);
}
else
{
AsyncCubemapTexture.get().loadTexture(gvrContext,
CancelableCallbackWrapper.wrap(GVRCubemapImage.class, tex),
resource, priority, faceIndexMap);
}
return tex;
} | [
"Load a cube map texture asynchronously.\n\nThis is the implementation of\n{@link GVRAssetLoader#loadCubemapTexture(GVRAndroidResource)} - it will\nusually be more convenient (and more efficient) to call that directly.\n\n@param gvrContext\nThe GVRF context\n@param textureCache\nTexture cache - may be {@code null}\... | [
"Gets the value of the task 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 task property.\n\n<p>\nFor example, ... |
final protected char next(final ByteBuffer buffer, boolean allow8859) throws BaseExceptions.BadMessage {
if (!buffer.hasRemaining()) return HttpTokens.EMPTY_BUFF;
if (_segmentByteLimit <= _segmentBytePosition) {
shutdownParser();
throw new BaseExceptions.BadMessage("Request length limit exceeded: " + _segmentByteLimit);
}
final byte b = buffer.get();
_segmentBytePosition++;
// If we ended on a CR, make sure we are
if (_cr) {
if (b != HttpTokens.LF) {
throw new BadCharacter("Invalid sequence: LF didn't follow CR: " + b);
}
_cr = false;
return (char)b; // must be LF
}
// Make sure its a valid character
if (b < HttpTokens.SPACE) {
if (b == HttpTokens.CR) { // Set the flag to check for _cr and just run again
_cr = true;
return next(buffer, allow8859);
}
else if (b == HttpTokens.TAB || allow8859 && b < 0) {
return (char)(b & 0xff);
}
else if (b == HttpTokens.LF) {
return (char)b; // A backend should accept a bare linefeed. http://tools.ietf.org/html/rfc2616#section-19.3
}
else if (isLenient()) {
return HttpTokens.REPLACEMENT;
}
else {
shutdownParser();
throw new BadCharacter("Invalid char: '" + (char)(b & 0xff) + "', 0x" + Integer.toHexString(b));
}
}
// valid ascii char
return (char)b;
} | [
"Removes CRs but returns LFs"
] | [
"Print a constraint type.\n\n@param value ConstraintType instance\n@return constraint type value",
"Searches for brackets which are only used to construct new matrices by concatenating\n1 or more matrices together",
"Invokes the ready tasks.\n\n@param context group level shared context that need be passed to\n{... |
public ConfigOptionBuilder setCommandLineOptionWithArgument( CommandLineOption commandLineOption, StringConverter converter ) {
co.setCommandLineOption( commandLineOption );
return setStringConverter( converter );
} | [
"if you want to parse an argument, you need a converter from String to Object\n\n@param commandLineOption specification of the command line options\n@param converter how to convert your String value to a castable Object"
] | [
"Create a mapping from entity names to entity ID values.",
"Read resource data.",
"Executes the query and returns the factory found, if there is only one factory.\nIf multiple factories match the query, one is selected.\n\n@param query the factory query, not null.\n@return the factory found, or null.",
"Use t... |
public static Operation createDeployOperation(final DeploymentDescription deployment) {
Assert.checkNotNullParam("deployment", deployment);
final CompositeOperationBuilder builder = CompositeOperationBuilder.create(true);
addDeployOperationStep(builder, deployment);
return builder.build();
} | [
"Creates an operation to deploy existing deployment content to the runtime.\n\n@param deployment the deployment to deploy\n\n@return the deploy operation"
] | [
"Returns the result of the performed spellcheck formatted in JSON.\n\n@param request The CmsSpellcheckingRequest.\n@return JSONObject that contains the result of the performed spellcheck.",
"Add the given headers to the given HTTP request.\n@param httpRequest the request to add the headers to\n@param headers the ... |
public static Info rand( final Variable A , final Variable B , ManagerTempVariables manager) {
Info ret = new Info();
final VariableMatrix output = manager.createMatrix();
ret.output = output;
if( A instanceof VariableInteger && B instanceof VariableInteger ) {
ret.op = new Operation("rand-ii") {
@Override
public void process() {
int numRows = ((VariableInteger)A).value;
int numCols = ((VariableInteger)B).value;
output.matrix.reshape(numRows,numCols);
RandomMatrices_DDRM.fillUniform(output.matrix, 0,1,manager.getRandom());
}
};
} else {
throw new RuntimeException("Expected two integers got "+A+" "+B);
}
return ret;
} | [
"Uniformly random numbers"
] | [
"Record the details of the media being cached, to make it easier to recognize, now that we have access to that\ninformation.\n\n@param slot the slot from which a metadata cache is being created\n@param zos the stream to which the ZipFile is being written\n@param channel the low-level channel to which the cache is b... |
protected String sourceLineTrimmed(ASTNode node) {
return sourceCode.line(AstUtil.findFirstNonAnnotationLine(node, sourceCode) - 1);
} | [
"Return the trimmed source line corresponding to the specified AST node\n\n@param node - the Groovy AST node"
] | [
"Resets all override settings for the clientUUID and disables it\n\n@param profileId profile ID of the client\n@param clientUUID UUID of the client\n@throws Exception exception",
"Treats the object as iterable, iterating through the values it represents and returns the first non-null result obtained from calling ... |
public ConverterServerBuilder baseUri(String baseUri) {
checkNotNull(baseUri);
this.baseUri = URI.create(baseUri);
return this;
} | [
"Specifies the base URI of this conversion server.\n\n@param baseUri The URI under which this remote conversion server is reachable.\n@return This builder instance."
] | [
"A specific, existing project can be updated by making a PUT request on the\nURL for that project. Only the fields provided in the `data` block will be\nupdated; any unspecified fields will remain unchanged.\n\nWhen using this method, it is best to specify only those fields you wish\nto change, or else you may over... |
public static base_response unset(nitro_service client, nsconfig resource, String[] args) throws Exception{
nsconfig unsetresource = new nsconfig();
return unsetresource.unset_resource(client,args);
} | [
"Use this API to unset the properties of nsconfig resource.\nProperties that need to be unset are specified in args array."
] | [
"Obtains a Julian zoned date-time from another date-time object.\n\n@param temporal the date-time object to convert, not null\n@return the Julian zoned date-time, not null\n@throws DateTimeException if unable to create the date-time",
"Convert the message to a FinishRequest",
"Use this API to fetch all the aut... |
public SerialMessage getValueMessage() {
logger.debug("Creating new message for application command BASIC_GET for node {}", this.getNode().getNodeId());
SerialMessage result = new SerialMessage(this.getNode().getNodeId(), SerialMessageClass.SendData, SerialMessageType.Request, SerialMessageClass.ApplicationCommandHandler, SerialMessagePriority.Get);
byte[] newPayload = { (byte) this.getNode().getNodeId(),
2,
(byte) getCommandClass().getKey(),
(byte) BASIC_GET };
result.setMessagePayload(newPayload);
return result;
} | [
"Gets a SerialMessage with the BASIC GET command\n@return the serial message"
] | [
"Gets the boxed type of a class\n\n@param type The type\n@return The boxed type",
"Returns all methods for a specific group\n\n@param groupId group ID to remove methods from\n@param filters array of method types to filter by, null means no filter\n@return Collection of methods found\n@throws Exception exception",... |
private CmsFavInfo createFavInfo(CmsFavoriteEntry entry) throws CmsException {
String title = "";
String subtitle = "";
CmsFavInfo result = new CmsFavInfo(entry);
CmsObject cms = A_CmsUI.getCmsObject();
String project = getProject(cms, entry);
String site = getSite(cms, entry);
try {
CmsUUID idToLoad = entry.getDetailId() != null ? entry.getDetailId() : entry.getStructureId();
CmsResource resource = cms.readResource(idToLoad, CmsResourceFilter.IGNORE_EXPIRATION.addRequireVisible());
CmsResourceUtil resutil = new CmsResourceUtil(cms, resource);
switch (entry.getType()) {
case explorerFolder:
title = CmsStringUtil.isEmpty(resutil.getTitle())
? CmsResource.getName(resource.getRootPath())
: resutil.getTitle();
break;
case page:
title = resutil.getTitle();
break;
}
subtitle = resource.getRootPath();
CmsResourceIcon icon = result.getResourceIcon();
icon.initContent(resutil, CmsResource.STATE_UNCHANGED, false, false);
} catch (CmsException e) {
LOG.warn(e.getLocalizedMessage(), e);
}
result.getTopLine().setValue(title);
result.getBottomLine().setValue(subtitle);
result.getProjectLabel().setValue(project);
result.getSiteLabel().setValue(site);
return result;
} | [
"Creates a favorite widget for a favorite entry.\n\n@param entry the favorite entry\n@return the favorite widget\n\n@throws CmsException if something goes wrong"
] | [
"Start listening for device announcements and keeping track of the DJ Link devices visible on the network.\nIf already listening, has no effect.\n\n@throws SocketException if the socket to listen on port 50000 cannot be created",
"Creates a real agent in the platform\n\n@param agent_name\nThe name that the agent ... |
public AnalyticProductInterface getCalibrationProductForSymbol(String symbol) {
/*
* The internal data structure is not optimal here (a map would make more sense here),
* if the user does not require access to the products, we would allow non-unique symbols.
* Hence we store both in two side by side vectors.
*/
for(int i=0; i<calibrationProductsSymbols.size(); i++) {
String calibrationProductSymbol = calibrationProductsSymbols.get(i);
if(calibrationProductSymbol.equals(symbol)) {
return calibrationProducts.get(i);
}
}
return null;
} | [
"Returns the first product found in the vector of calibration products\nwhich matches the given symbol, where symbol is the String set in\nthe calibrationSpecs.\n\n@param symbol A given symbol string.\n@return The product associated with that symbol."
] | [
"Compare the supplied plaintext password to a hashed password.\n\n@param passwd Plaintext password.\n@param hashed scrypt hashed password.\n\n@return true if passwd matches hashed value.",
"Serialize the Document object.\n\n@param dom the document to serialize\n@return the serialized dom String",
"Adds an... |
public void configure(@Observes(precedence = -10) ArquillianDescriptor arquillianDescriptor) {
Map<String, String> config = arquillianDescriptor.extension(EXTENSION_NAME).getExtensionProperties();
CubeConfiguration cubeConfiguration = CubeConfiguration.fromMap(config);
configurationProducer.set(cubeConfiguration);
} | [
"Add precedence -10 because we need that ContainerRegistry is available in the Arquillian scope."
] | [
"Returns the connection count by key specified in this registry\n\nNote it might count connections that are closed but not removed from registry yet\n\n@param key\nthe key\n@return connection count by key",
"Adds a new step to the list of steps.\n\n@param name Name of the step to add.\n@param robot The name of th... |
public boolean getBooleanProperty(String name, boolean defaultValue)
{
return PropertyHelper.toBoolean(_properties.getProperty(name), defaultValue);
} | [
"Returns the boolean value of the specified property.\n\n@param name The name of the property\n@param defaultValue The value to use if the property is not set or not a boolean\n@return The value"
] | [
"Shows error dialog, manually supplying details instead of getting them from an exception stack trace.\n\n@param message the error message\n@param details the details",
"Locate a feature in the file by match a byte pattern.\n\n@param patterns patterns to match\n@param bufferIndex start index\n@return true if the ... |
public Task add()
{
Task task = new Task(m_projectFile, (Task) null);
add(task);
m_projectFile.getChildTasks().add(task);
return task;
} | [
"Add a task to the project.\n\n@return new task instance"
] | [
"Configures the player whose current track waveforms and status will automatically be reflected. Whenever a new\ntrack is loaded on that player, the waveform and metadata will be updated, and the current playback position and\nstate of the player will be reflected by the component.\n\n@param player the player numbe... |
public byte[] toByteArray() {
try {
ByteArrayOutputStream baos = new ByteArrayOutputStream();
ObjectOutputStream oos = new ObjectOutputStream(baos);
oos.writeObject(this);
return baos.toByteArray();
} catch (IOException e) {
throw E.ioException(e);
}
} | [
"Serialize this `AppDescriptor` and output byte array\n\n@return\nserialize this `AppDescriptor` into byte array"
] | [
"Returns whether the division grouping range matches the block of values for its prefix length.\nIn other words, returns true if and only if it has a prefix length and it has just a single prefix.",
"Computes annualized seasonal adjustments from given monthly realized CPI values.\n\n@param realizedCPIValues An ar... |
public ProteusApplication setServerConfigurationFunction(Function<Undertow.Builder, Undertow.Builder> serverConfigurationFunction)
{
this.serverConfigurationFunction = serverConfigurationFunction;
return this;
} | [
"Allows direct access to the Undertow.Builder for custom configuration\n\n@param serverConfigurationFunction the serverConfigurationFunction"
] | [
"Given a key and a list of steal infos give back a list of stealer node\nids which will steal this.\n\n@param key Byte array of key\n@param stealerNodeToMappingTuples Pairs of stealer node id to their\ncorresponding [ partition - replica ] tuples\n@param cluster Cluster metadata\n@param storeDef Store definitions\n... |
public static void ensureChildElement(DomXmlElement parentElement, DomXmlElement childElement) {
Node parent = childElement.unwrap().getParentNode();
if (parent == null || !parentElement.unwrap().isEqualNode(parent)) {
throw LOG.elementIsNotChildOfThisElement(childElement, parentElement);
}
} | [
"Ensures that the element is child element of the parent element.\n\n@param parentElement the parent xml dom element\n@param childElement the child element\n@throws SpinXmlElementException if the element is not child of the parent element"
] | [
"Creates a ServiceCall from a paging operation.\n\n@param first the observable to the first page\n@param next the observable to poll subsequent pages\n@param callback the client-side callback\n@param <E> the element type\n@return the future based ServiceCall",
"Adds a criterion to given pipeline which filters out... |
public void forAllMemberTagTokens(String template, Properties attributes) throws XDocletException
{
if (getCurrentField() != null) {
forAllMemberTagTokens(template, attributes, FOR_FIELD);
}
else if (getCurrentMethod() != null) {
forAllMemberTagTokens(template, attributes, FOR_METHOD);
}
} | [
"Iterates over all tokens in current member tag with the name tagName and evaluates the body for every token.\n\n@param template The body of the block tag\n@param attributes The attributes of the template tag\n@exception XDocletException If an error occurs\n@doc.tag type... | [
"Copy the specified bytes into a new array\n\n@param array The array to copy from\n@param from The index in the array to begin copying from\n@param to The least index not copied\n@return A new byte[] containing the copied bytes",
"Finds for the given project.\n\n@param name project name\n@return given project or ... |
public static hanode_routemonitor_binding[] get(nitro_service service, Long id) throws Exception{
hanode_routemonitor_binding obj = new hanode_routemonitor_binding();
obj.set_id(id);
hanode_routemonitor_binding response[] = (hanode_routemonitor_binding[]) obj.get_resources(service);
return response;
} | [
"Use this API to fetch hanode_routemonitor_binding resources of given name ."
] | [
"Use this API to fetch nslimitselector resource of given name .",
"Reads characters until the 'end' character is encountered.\n\n@param out\nThe StringBuilder to write to.\n@param in\nThe Input String.\n@param start\nStarting position.\n@param end\nEnd characters.\n@return The new position or -1 if no 'end' char ... |
public ItemRequest<User> findById(String user) {
String path = String.format("/users/%s", user);
return new ItemRequest<User>(this, User.class, path, "GET");
} | [
"Returns the full user record for the single user with the provided ID.\n\n@param user An identifier for the user. Can be one of an email address,\nthe globally unique identifier for the user, or the keyword `me`\nto indicate the current user making the request.\n@return Request object"
] | [
"This is the profiles page. this is the 'regular' page when the url is typed in",
"Returns the result of calling a closure with the first occurrence of a regular expression found within a CharSequence.\nIf the regex doesn't match, the closure will not be called and find will return null.\n\n@param self a CharS... |
public static base_response disable(nitro_service client, Long clid) throws Exception {
clusterinstance disableresource = new clusterinstance();
disableresource.clid = clid;
return disableresource.perform_operation(client,"disable");
} | [
"Use this API to disable clusterinstance of given name."
] | [
"Build data model for serialization.",
"Returns the device push token or null\n\n@param type com.clevertap.android.sdk.PushType (FCM or GCM)\n@return String device token or null\nNOTE: on initial install calling getDevicePushToken may return null, as the device token is\nnot yet available\nImplement CleverTapAPI.... |
protected String consumeWord(ImapRequestLineReader request,
CharacterValidator validator)
throws ProtocolException {
StringBuilder atom = new StringBuilder();
char next = request.nextWordChar();
while (!isWhitespace(next)) {
if (validator.isValid(next)) {
atom.append(next);
request.consume();
} else {
throw new ProtocolException("Invalid character: '" + next + '\'');
}
next = request.nextChar();
}
return atom.toString();
} | [
"Reads the next \"word from the request, comprising all characters up to the next SPACE.\nCharacters are tested by the supplied CharacterValidator, and an exception is thrown\nif invalid characters are encountered."
] | [
"Enables a custom response\n\n@param model\n@param custom\n@param path_id\n@param clientUUID\n@return\n@throws Exception",
"Preloads a sound file.\n\n@param soundFile path/name of the file to be played.",
"Count the number of occurrences of a sub CharSequence.\n\n@param self a CharSequence\n@param text a sub Ch... |
public void addOrder(String columnName, boolean ascending) {
if (columnName == null) {
return;
}
for (int i = 0; i < columns.size(); i++) {
if (!columnName.equals(columns.get(i).getData())) {
continue;
}
order.add(new Order(i, ascending ? "asc" : "desc"));
}
} | [
"Add an order on the given column\n\n@param columnName the name of the column\n@param ascending whether the sorting is ascending or descending"
] | [
"Delete a server group by id\n\n@param id server group ID",
"Reconstructs a number that is represented by more than one byte in a network packet in little-endian order, for\nthe very few protocol values that are sent in this quirky way.\n\n@param buffer the byte array containing the packet data\n@param start the ... |
private String toRfsName(String name, IconSize size) {
return CmsStringUtil.joinPaths(m_cache.getRepositoryPath(), "" + name.hashCode()) + size.getSuffix();
} | [
"Transforms user name and icon size into the rfs image path.\n\n@param name the user name\n@param size IconSize to get icon for\n\n@return the path"
] | [
"Write resource assignment.\n\n@param record resource assignment instance\n@throws IOException",
"Returns IMAP formatted String of MessageFlags for named user",
"Roll the java.util.Date forward or backward.\n\n@param startDate - The start date\n@param period Calendar.YEAR etc\n@param amount - Negative to rollba... |
private String[] readXMLDeclaration(Reader r) throws KNXMLException
{
final StringBuffer buf = new StringBuffer(100);
try {
for (int c = 0; (c = r.read()) != -1 && c != '?';)
buf.append((char) c);
}
catch (final IOException e) {
throw new KNXMLException("reading XML declaration, " + e.getMessage(), buf
.toString(), 0);
}
String s = buf.toString().trim();
String version = null;
String encoding = null;
String standalone = null;
for (int state = 0; state < 3; ++state)
if (state == 0 && s.startsWith("version")) {
version = getAttValue(s = s.substring(7));
s = s.substring(s.indexOf(version) + version.length() + 1).trim();
}
else if (state == 1 && s.startsWith("encoding")) {
encoding = getAttValue(s = s.substring(8));
s = s.substring(s.indexOf(encoding) + encoding.length() + 1).trim();
}
else if (state == 1 || state == 2) {
if (s.startsWith("standalone")) {
standalone = getAttValue(s);
if (!standalone.equals("yes") && !standalone.equals("no"))
throw new KNXMLException("invalid standalone pseudo-attribute",
standalone, 0);
break;
}
}
else
throw new KNXMLException("unknown XML declaration pseudo-attribute", s, 0);
return new String[] { version, encoding, standalone };
} | [
"returns array with length 3 and optional entries version, encoding, standalone"
] | [
"Add raw SQL \"ORDER BY\" clause to the SQL query statement.\n\n@param rawSql\nThe raw SQL order by clause. This should not include the \"ORDER BY\".",
"Closing will only skip to the end of this fixed length input stream and\nnot call the parent's close method.\n@throws IOException if an I/O error occurs while cl... |
public static void log(byte[] data)
{
if (LOG != null)
{
LOG.println(ByteArrayHelper.hexdump(data, true, 16, ""));
LOG.flush();
}
} | [
"Log a byte array as a hex dump.\n\n@param data byte array"
] | [
"Demonstrates obtaining the request history data from a test run",
"Additional bean deployment archives are used for extentions, synthetic annotated types and beans which do not come from a bean archive.\n\n@param beanClass\n@return the additional bean deployment archive",
"Use this API to delete gslbservice of... |
public static boolean isPrimitiveArray(Class<?> clazz) {
Assert.notNull(clazz, "Class must not be null");
return (clazz.isArray() && clazz.getComponentType().isPrimitive());
} | [
"Check if the given class represents an array of primitives,\ni.e. boolean, byte, char, short, int, long, float, or double.\n@param clazz the class to check\n@return whether the given class is a primitive array class"
] | [
"Set the role info for this user. If set, this will be used to set the user's authorizations.\n\n@param roles the roles\n@since 1.10.0",
"Adds tags to the If-Match header.\n\n@param tag the tag to add, may be null. This means the same as adding {@link Tag#ALL}\n@throws IllegalArgumentException if ALL is supplied ... |
@IntRange(from = 0, to = OPAQUE)
private static int resolveLineAlpha(
@IntRange(from = 0, to = OPAQUE) final int sceneAlpha,
final float maxDistance,
final float distance) {
final float alphaPercent = 1f - distance / maxDistance;
final int alpha = (int) ((float) OPAQUE * alphaPercent);
return alpha * sceneAlpha / OPAQUE;
} | [
"Resolves line alpha based on distance comparing to max distance.\nWhere alpha is close to 0 for maxDistance, and close to 1 to 0 distance.\n\n@param distance line length\n@param maxDistance max line length\n@return line alpha"
] | [
"Creates a map of identifiers or page titles to documents retrieved via\nthe API URL\n\n@param properties\nparameter setting for wbgetentities\n@return map of document identifiers or titles to documents retrieved via\nthe API URL\n@throws MediaWikiApiErrorException\nif the API returns an error\n@throws IOException\... |
private void deriveProjectCalendar()
{
//
// Count the number of times each calendar is used
//
Map<ProjectCalendar, Integer> map = new HashMap<ProjectCalendar, Integer>();
for (Task task : m_project.getTasks())
{
ProjectCalendar calendar = task.getCalendar();
Integer count = map.get(calendar);
if (count == null)
{
count = Integer.valueOf(1);
}
else
{
count = Integer.valueOf(count.intValue() + 1);
}
map.put(calendar, count);
}
//
// Find the most frequently used calendar
//
int maxCount = 0;
ProjectCalendar defaultCalendar = null;
for (Entry<ProjectCalendar, Integer> entry : map.entrySet())
{
if (entry.getValue().intValue() > maxCount)
{
maxCount = entry.getValue().intValue();
defaultCalendar = entry.getKey();
}
}
//
// Set the default calendar for the project
// and remove it's use as a task-specific calendar.
//
if (defaultCalendar != null)
{
m_project.setDefaultCalendar(defaultCalendar);
for (Task task : m_project.getTasks())
{
if (task.getCalendar() == defaultCalendar)
{
task.setCalendar(null);
}
}
}
} | [
"Asta Powerproject assigns an explicit calendar for each task. This method\nis used to find the most common calendar and use this as the default project\ncalendar. This allows the explicitly assigned task calendars to be removed."
] | [
"Use this API to fetch all the nsspparams resources that are configured on netscaler.",
"Attach a script file to a scriptable target.\n\n@param target The scriptable target.\n@param scriptFile The script file object.",
"Append a SubQuery the SQL-Clause\n@param subQuery the subQuery value of SelectionCriteria",
... |
protected boolean isFiltered(Param param) {
AbstractElement elementToParse = param.elementToParse;
while (elementToParse != null) {
if (isFiltered(elementToParse, param)) {
return true;
}
elementToParse = getEnclosingSingleElementGroup(elementToParse);
}
return false;
} | [
"Returns true if the grammar element that is associated with the given param is filtered due to guard conditions\nof parameterized rules in the current call stack.\n\nIf the grammar element is the only element contained in a group, its container is checked, too.\n\n@see #isFiltered(AbstractElement, Param)"
] | [
"Gets the value for the key.\n\n@param key the key to check for the value\n\n@return the value or an empty collection if no values were set",
"Establish a new tempo master, and if it is a change from the existing one, report it to the listeners.\n\n@param newMaster the packet which caused the change of masters, o... |
private boolean contentEqualsUnchecked(byte[] bytes, int offset, int len) {
if (length != len) {
return false;
}
return compareToUnchecked(bytes, offset, len) == 0;
} | [
"Returns true if this Bytes object equals another. This method doesn't check it's arguments.\n\n@since 1.2.0"
] | [
"Blocking function which completes the migration of one store\n\n@param storeName The name of the store\n@param adminClient Admin client used to initiate the copying of data\n@param stealInfo The steal information\n@param isReadOnlyStore Boolean indicating that this is a read-only store",
"Retrieve the default nu... |
public static void unsetCurrentPersistenceBroker(PBKey key, PersistenceBrokerInternal broker)
throws PBFactoryException
{
HashMap map = (HashMap) currentBrokerMap.get();
WeakHashMap set = null;
if(map != null)
{
set = (WeakHashMap) map.get(key);
if(set != null)
{
set.remove(broker);
if(set.isEmpty())
{
map.remove(key);
}
}
if(map.isEmpty())
{
currentBrokerMap.set(null);
synchronized(lock) {
loadedHMs.remove(map);
}
}
}
} | [
"Unmark a PersistenceBroker as preferred choice for current Thread\n\n@param key The PBKey the broker is associated to\n@param broker The PersistenceBroker to unmark"
] | [
"Closes the transactor node by removing its node in Zookeeper",
"Append the data of another lattice to this lattice. If the other lattice follows a different quoting convention, it is automatically converted.\nHowever, this method does not check, whether the two lattices are aligned in terms of reference date, cu... |
@Override
public PaxDate dateYearDay(Era era, int yearOfEra, int dayOfYear) {
return dateYearDay(prolepticYear(era, yearOfEra), dayOfYear);
} | [
"Obtains a local date in Pax calendar system from the\nera, year-of-era and day-of-year fields.\n\n@param era the Pax era, not null\n@param yearOfEra the year-of-era\n@param dayOfYear the day-of-year\n@return the Pax local date, not null\n@throws DateTimeException if unable to create the date\n@throws ClassCastE... | [
"Set the main attribute \"Bundle-Activator\" to the given value.\n\n@param bundleActivator The new value",
"Add the given pair to a given map for obtaining a new map.\n\n<p>\nThe replied map is a view on the given map. It means that any change\nin the original map is reflected to the result of this operation.\n</... |
public boolean classifyDocumentStdin(DocumentReaderAndWriter<IN> readerWriter)
throws IOException
{
BufferedReader is = new BufferedReader(new InputStreamReader(System.in, flags.inputEncoding));
String line;
String text = "";
String eol = "\n";
String sentence = "<s>";
int blankLines = 0;
while ((line = is.readLine()) != null) {
if (line.trim().equals("")) {
++blankLines;
if (blankLines > 3) {
return false;
} else if (blankLines > 2) {
ObjectBank<List<IN>> documents = makeObjectBankFromString(text, readerWriter);
classifyAndWriteAnswers(documents, readerWriter);
text = "";
} else {
text += sentence + eol;
}
} else {
text += line + eol;
blankLines = 0;
}
}
// Classify last document before input stream end
if (text.trim() != "") {
ObjectBank<List<IN>> documents = makeObjectBankFromString(text, readerWriter);
classifyAndWriteAnswers(documents, readerWriter);
}
return (line == null); // reached eol
} | [
"Classify stdin by documents seperated by 3 blank line\n@param readerWriter\n@return boolean reached end of IO\n@throws IOException"
] | [
"Finds the file at the provided path within the archive.\n\nEg, getChildFile(ArchiveModel, \"/META-INF/MANIFEST.MF\") will return a {@link FileModel} if a file named\n/META-INF/MANIFEST.MF exists within the archive\n\n@return Returns the located {@link FileModel} or null if no file with this path could be located",... |
public synchronized void start() throws SocketException {
if (!isRunning()) {
DeviceFinder.getInstance().addLifecycleListener(lifecycleListener);
DeviceFinder.getInstance().addDeviceAnnouncementListener(announcementListener);
DeviceFinder.getInstance().start();
for (DeviceAnnouncement device: DeviceFinder.getInstance().getCurrentDevices()) {
requestPlayerDBServerPort(device);
}
new Thread(null, new Runnable() {
@Override
public void run() {
while (isRunning()) {
try {
Thread.sleep(500);
} catch (InterruptedException e) {
logger.warn("Interrupted sleeping to close idle dbserver clients");
}
closeIdleClients();
}
logger.info("Idle dbserver client closer shutting down.");
}
}, "Idle dbserver client closer").start();
running.set(true);
deliverLifecycleAnnouncement(logger, true);
}
} | [
"Start offering shared dbserver sessions.\n\n@throws SocketException if there is a problem opening connections"
] | [
"Retrieve the dir pointed to by 'latest' symbolic-link or the current\nversion dir\n\n@return Current version directory, else null",
"Given a string with method or package name, creates a Class Name with no\nspaces and first letter lower case\n\n@param String\n- The name of the scenario/story. It should be in low... |
public ArrayList<Duration> segmentBaselineWork(ProjectFile file, List<TimephasedWork> work, TimescaleUnits rangeUnits, ArrayList<DateRange> dateList)
{
return segmentWork(file.getBaselineCalendar(), work, rangeUnits, dateList);
} | [
"This is the main entry point used to convert the internal representation\nof timephased baseline work into an external form which can\nbe displayed to the user.\n\n@param file parent project file\n@param work timephased resource assignment data\n@param rangeUnits timescale units\n@param dateList timescale date ran... | [
"returns the XmlCapable id associated with the literal.\nOJB maintains a RepositoryTags table that provides\na mapping from xml-tags to XmlCapable ids.\n\n@param literal the literal to lookup\n@return the int value representing the XmlCapable\n\n@throws MetadataException if no literal was found in tags mapping",
... |
public void removeFile(String name) {
if(files.containsKey(name)) {
files.remove(name);
}
if(fileStreams.containsKey(name)) {
fileStreams.remove(name);
}
} | [
"Removes file from your assembly.\n\n@param name field name of the file to remove."
] | [
"Exit the Application",
"Distributed process finish.\n\n@param rb the rb\n@param mtasFields the mtas fields\n@throws IOException Signals that an I/O exception has occurred.",
"Checks whether an XPath expression starts with an XPath eventable condition.\n\n@param dom The DOM String.\n@param eventa... |
public static String plus(Number value, String right) {
return DefaultGroovyMethods.toString(value) + right;
} | [
"Appends a String to the string representation of this number.\n\n@param value a Number\n@param right a String\n@return a String\n@since 1.0"
] | [
"Process the graphical indicator criteria for a single column.\n\n@param type field type\n@return indicator criteria data",
"Analyze all source code using the specified RuleSet and return the report results.\n\n@param ruleSet - the RuleSet to apply to each source component; must not be null.\n@return the results ... |
private void computeUnnamedParams() {
unnamedParams.addAll(rawArgs.stream().filter(arg -> !isNamedParam(arg)).collect(Collectors.toList()));
} | [
"This method computes the list of unnamed parameters, by filtering the\nlist of raw arguments, stripping out the named parameters."
] | [
"Compute morse.\n\n@param term the term\n@return the string",
"This method maps the encoded height of a Gantt bar to\nthe height in pixels.\n\n@param height encoded height\n@return height in pixels",
"Process a file.\n\n@param file the file to be processed\n@param mode the patching mode\n@throws IOException",
... |
private static boolean isAssignableFrom(Type from, GenericArrayType to) {
Type toGenericComponentType = to.getGenericComponentType();
if (toGenericComponentType instanceof ParameterizedType) {
Type t = from;
if (from instanceof GenericArrayType) {
t = ((GenericArrayType) from).getGenericComponentType();
} else if (from instanceof Class) {
Class<?> classType = (Class<?>) from;
while (classType.isArray()) {
classType = classType.getComponentType();
}
t = classType;
}
return isAssignableFrom(t,
(ParameterizedType) toGenericComponentType,
new HashMap<String, Type>());
}
// No generic defined on "to"; therefore, return true and let other
// checks determine assignability
return true;
} | [
"Private helper function that performs some assignability checks for the\nprovided GenericArrayType."
] | [
"Gets the effects of this action.\n\n@return the effects. Will not be {@code null}",
"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.vetoTypesWithoutBeanDefi... |
private void addMetadataProviderForMedia(String key, MetadataProvider provider) {
if (!metadataProviders.containsKey(key)) {
metadataProviders.put(key, Collections.newSetFromMap(new ConcurrentHashMap<MetadataProvider, Boolean>()));
}
Set<MetadataProvider> providers = metadataProviders.get(key);
providers.add(provider);
} | [
"Internal method that adds a metadata provider to the set associated with a particular hash key, creating the\nset if needed.\n\n@param key the hashKey identifying the media for which this provider can offer metadata (or the empty string if\nit can offer metadata for all media)\n@param provider the metadata provide... | [
"Returns the Field for a given parent class and a dot-separated path of\nfield names.\n\n@param clazz\nParent class.\n@param path\nPath to the desired field.",
"Detect numbers using comma as a decimal separator and replace with period.\n\n@param value original numeric value\n@return corrected numeric value",
"T... |
public static auditnslogpolicy_authenticationvserver_binding[] get(nitro_service service, String name) throws Exception{
auditnslogpolicy_authenticationvserver_binding obj = new auditnslogpolicy_authenticationvserver_binding();
obj.set_name(name);
auditnslogpolicy_authenticationvserver_binding response[] = (auditnslogpolicy_authenticationvserver_binding[]) obj.get_resources(service);
return response;
} | [
"Use this API to fetch auditnslogpolicy_authenticationvserver_binding resources of given name ."
] | [
"Execute push docker image on agent\n\n@param launcher\n@param log\n@param imageTag\n@param username\n@param password\n@param host @return\n@throws IOException\n@throws InterruptedException",
"Returns true if required properties for FluoClient are set",
"This method lists all resource assignments defined in... |
public ItemRequest<Workspace> update(String workspace) {
String path = String.format("/workspaces/%s", workspace);
return new ItemRequest<Workspace>(this, Workspace.class, path, "PUT");
} | [
"A specific, existing workspace can be updated by making a PUT request on\nthe URL for that workspace. Only the fields provided in the data block\nwill be updated; any unspecified fields will remain unchanged.\n\nCurrently the only field that can be modified for a workspace is its `name`.\n\nReturns the complete, u... | [
"Adds a qualifier with the given property and value to the constructed\nstatement.\n\n@param propertyIdValue\nthe property of the qualifier\n@param value\nthe value of the qualifier\n@return builder object to continue construction",
"Write all state items to the log file.\n\n@param fileRollEvent the event to l... |
public static int convertBytesToInt(byte[] bytes, int offset)
{
return (BITWISE_BYTE_TO_INT & bytes[offset + 3])
| ((BITWISE_BYTE_TO_INT & bytes[offset + 2]) << 8)
| ((BITWISE_BYTE_TO_INT & bytes[offset + 1]) << 16)
| ((BITWISE_BYTE_TO_INT & bytes[offset]) << 24);
} | [
"Take four bytes from the specified position in the specified\nblock and convert them into a 32-bit int, using the big-endian\nconvention.\n@param bytes The data to read from.\n@param offset The position to start reading the 4-byte int from.\n@return The 32-bit integer represented by the four bytes."
] | [
"Checks if is file exist.\n\n@param filePath\nthe file path\n@return true, if is file exist",
"Expects a height mat as input\n\n@param input - A grayscale height map\n@return edges",
"Get file extension for script language.\n\n@param language the language name\n@return the file extension as string or null if th... |
public static void dumpAnalysisToFile(String outputDirName,
String baseFileName,
PartitionBalance partitionBalance) {
if(outputDirName != null) {
File outputDir = new File(outputDirName);
if(!outputDir.exists()) {
Utils.mkdirs(outputDir);
}
try {
FileUtils.writeStringToFile(new File(outputDirName, baseFileName + ".analysis"),
partitionBalance.toString());
} catch(IOException e) {
logger.error("IOException during dumpAnalysisToFile: " + e);
}
}
} | [
"Prints a balance analysis to a file.\n\n@param outputDirName\n@param baseFileName suffix '.analysis' is appended to baseFileName.\n@param partitionBalance"
] | [
"Hide multiple channels. All other channels will be unaffected.\n@param channels The channels to hide",
"Extract predecessor data.",
"Update artifact download url of an artifact\n\n@param gavc String\n@param downLoadUrl String",
"Determine which field the Activity ID has been mapped to.\n\n@param map field m... |
private void printSuggestion( String arg, List<ConfigOption> co ) {
List<ConfigOption> sortedList = new ArrayList<ConfigOption>( co );
Collections.sort( sortedList, new ConfigOptionLevenshteinDistance( arg ) );
System.err.println( "Parse error for argument \"" + arg + "\", did you mean " + sortedList.get( 0 ).getCommandLineOption()
.showFlagInfo() + "? Ignoring for now." );
} | [
"Prints a suggestion to stderr for the argument based on the levenshtein distance metric\n\n@param arg the argument which could not be assigned to a flag\n@param co the {@link ConfigOption} List where every flag is stored"
] | [
"Convert one project file format to another.\n\n@param inputFile input file\n@param outputFile output file\n@throws Exception",
"First reduce the Criteria to the normal disjunctive form, then\ncalculate the necessary tree of joined tables for each item, then group\nitems with the same tree of joined tables.",
"... |
public Number getOvertimeCost()
{
Number cost = (Number) getCachedValue(AssignmentField.OVERTIME_COST);
if (cost == null)
{
Number actual = getActualOvertimeCost();
Number remaining = getRemainingOvertimeCost();
if (actual != null && remaining != null)
{
cost = NumberHelper.getDouble(actual.doubleValue() + remaining.doubleValue());
set(AssignmentField.OVERTIME_COST, cost);
}
}
return (cost);
} | [
"Returns the overtime cost of this resource assignment.\n\n@return cost"
] | [
"Returns the complete task record for a single task.\n\n@param task The task to get.\n@return Request object",
"Gets the publisher of the specified type, if it is wrapped by the \"Flexible Publish\" publisher in a project.\nNull is returned if no such publisher is found.\n@param project The project\n@param typ... |
public Integer getInteger(String fieldName) {
try {
return hasValue(fieldName) ? Integer.valueOf(String.valueOf(resultMap.get(fieldName))) : null;
} catch (NumberFormatException e) {
throw new FqlException("Field '" + fieldName +"' is not a number.", e);
}
} | [
"Returns the value of the identified field as an Integer.\n@param fieldName the name of the field\n@return the value of the field as an Integer\n@throws FqlException if the field cannot be expressed as an Integer"
] | [
"Helper to read an optional String value list.\n@param path The XML path of the element to read.\n@return The String list stored in the XML, or <code>null</code> if the value could not be read.",
"A document that is paused no longer has remote updates applied to it.\nAny local updates to this document cause it to... |
public CliCommandBuilder setTimeout(final int timeout) {
if (timeout > 0) {
addCliArgument(CliArgument.TIMEOUT, Integer.toString(timeout));
} else {
addCliArgument(CliArgument.TIMEOUT, null);
}
return this;
} | [
"Sets the timeout used when connecting to the server.\n\n@param timeout the time out to use\n\n@return the builder"
] | [
"Initialize the pattern choice button group.",
"Write the text to the File, using the specified encoding.\n\n@param file a File\n@param text the text to write to the File\n@param charset the charset used\n@throws IOException if an IOException occurs.\n@since 1.0",
"Old SOAP client uses new SOAP service wi... |
protected Connection newConnectionFromDataSource(JdbcConnectionDescriptor jcd)
throws LookupException
{
Connection retval = null;
// use JNDI lookup
DataSource ds = jcd.getDataSource();
if (ds == null)
{
// [tomdz] Would it suffice to store the datasources only at the JCDs ?
// Only possible problem would be serialization of the JCD because
// the data source object in the JCD does not 'survive' this
ds = (DataSource) dataSourceCache.get(jcd.getDatasourceName());
}
try
{
if (ds == null)
{
/**
* this synchronization block won't be a big deal as we only look up
* new datasources not found in the map.
*/
synchronized (dataSourceCache)
{
InitialContext ic = new InitialContext();
ds = (DataSource) ic.lookup(jcd.getDatasourceName());
/**
* cache the datasource lookup.
*/
dataSourceCache.put(jcd.getDatasourceName(), ds);
}
}
if (jcd.getUserName() == null)
{
retval = ds.getConnection();
}
else
{
retval = ds.getConnection(jcd.getUserName(), jcd.getPassWord());
}
}
catch (SQLException sqlEx)
{
log.error("SQLException thrown while trying to get Connection from Datasource (" +
jcd.getDatasourceName() + ")", sqlEx);
throw new LookupException("SQLException thrown while trying to get Connection from Datasource (" +
jcd.getDatasourceName() + ")", sqlEx);
}
catch (NamingException namingEx)
{
log.error("Naming Exception while looking up DataSource (" + jcd.getDatasourceName() + ")", namingEx);
throw new LookupException("Naming Exception while looking up DataSource (" + jcd.getDatasourceName() +
")", namingEx);
}
// initialize connection
initializeJdbcConnection(retval, jcd);
if(log.isDebugEnabled()) log.debug("Create new connection using DataSource: "+retval);
return retval;
} | [
"Creates a new connection from the data source that the connection descriptor\nrepresents. If the connection descriptor does not directly contain the data source\nthen a JNDI lookup is performed to retrieve the data source.\n\n@param jcd The connection descriptor\n@return A connection instance\n@throws LookupExcept... | [
"Invokes the observer method immediately passing the event.\n\n@param event The event to notify observer with",
"Exit the Application",
"Push docker image using the docker java client.\n\n@param imageTag\n@param username\n@param password\n@param host",
"Creates a color item that represents a color field found... |
public static String getFilename(String path) throws IllegalArgumentException {
if (Pattern.matches(sPatternUrl, path))
return getURLFilename(path);
return new File(path).getName();
} | [
"Gets the filename from a path or URL.\n@param path or url.\n@return the file name."
] | [
"Generated the report.",
"Returns an Organization that suits the Module or null if there is none\n\n@param dbModule DbModule\n@return DbOrganization",
"Use this API to fetch tmtrafficpolicy_tmglobal_binding resources of given name .",
"Main entry point. Reads a directory containing a P3 Btrieve database files... |
public static base_response unset(nitro_service client, sslcertkey resource, String[] args) throws Exception{
sslcertkey unsetresource = new sslcertkey();
unsetresource.certkey = resource.certkey;
return unsetresource.unset_resource(client,args);
} | [
"Use this API to unset the properties of sslcertkey resource.\nProperties that need to be unset are specified in args array."
] | [
"Creates the tables according to the schema files.\n\n@throws PlatformException If some error occurred",
"Load resource content from given path into variable with\ntype specified by `spec`.\n\n@param resourcePath the resource path\n@param spec {@link BeanSpec} specifies the return value type\n@return the resource... |
public void onLayoutApplied(final WidgetContainer container, final Vector3Axis viewPortSize) {
mContainer = container;
mViewPort.setSize(viewPortSize);
if (mContainer != null) {
mContainer.onLayoutChanged(this);
}
} | [
"Called when the layout is applied to the data\n@param container WidgetContainer to access the org.gearvrf.org.gearvrf.widgetlib in the layout\n@param viewPortSize View port for data set"
] | [
"Creates a new Message from the specified text.",
"Reads the integer representation of calendar hours for a given\nday and populates the calendar.\n\n@param calendar parent calendar\n@param day target day\n@param hours working hours",
"Send a failed operation response.\n\n@param context the request context\n@pa... |
public User getUploadStatus() throws FlickrException {
Map<String, Object> parameters = new HashMap<String, Object>();
parameters.put("method", METHOD_GET_UPLOAD_STATUS);
Response response = transportAPI.get(transportAPI.getPath(), parameters, apiKey, sharedSecret);
if (response.isError()) {
throw new FlickrException(response.getErrorCode(), response.getErrorMessage());
}
Element userElement = response.getPayload();
User user = new User();
user.setId(userElement.getAttribute("id"));
user.setPro("1".equals(userElement.getAttribute("ispro")));
user.setUsername(XMLUtilities.getChildValue(userElement, "username"));
Element bandwidthElement = XMLUtilities.getChild(userElement, "bandwidth");
user.setBandwidthMax(bandwidthElement.getAttribute("max"));
user.setBandwidthUsed(bandwidthElement.getAttribute("used"));
user.setIsBandwidthUnlimited("1".equals(bandwidthElement.getAttribute("unlimited")));
Element filesizeElement = XMLUtilities.getChild(userElement, "filesize");
user.setFilesizeMax(filesizeElement.getAttribute("max"));
Element setsElement = XMLUtilities.getChild(userElement, "sets");
user.setSetsCreated(setsElement.getAttribute("created"));
user.setSetsRemaining(setsElement.getAttribute("remaining"));
Element videosElement = XMLUtilities.getChild(userElement, "videos");
user.setVideosUploaded(videosElement.getAttribute("uploaded"));
user.setVideosRemaining(videosElement.getAttribute("remaining"));
Element videoSizeElement = XMLUtilities.getChild(userElement, "videosize");
user.setVideoSizeMax(videoSizeElement.getAttribute("maxbytes"));
return user;
} | [
"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"
] | [
"Creates a map between a work pattern ID and a list of time entry rows.\n\n@param rows time entry rows\n@return time entry map",
"Returns a new List containing the given objects.",
"Use this API to fetch dnstxtrec resources of given names .",
"Use this API to fetch clusterinstance resources of given names .",... |
public void bind(Object object, String name)
throws ObjectNameNotUniqueException
{
/**
* Is DB open? ODMG 3.0 says it has to be to call bind.
*/
if (!this.isOpen())
{
throw new DatabaseClosedException("Database is not open. Must have an open DB to call bind.");
}
/**
* Is Tx open? ODMG 3.0 says it has to be to call bind.
*/
TransactionImpl tx = getTransaction();
if (tx == null || !tx.isOpen())
{
throw new TransactionNotInProgressException("Tx is not open. Must have an open TX to call bind.");
}
tx.getNamedRootsMap().bind(object, name);
} | [
"Associate a name with an object and make it persistent.\nAn object instance may be bound to more than one name.\nBinding a previously transient object to a name makes that object persistent.\n@param object The object to be named.\n@param name The name to be given to the object.\n@exception org.odmg.ObjectNameNotUn... | [
"Ask the specified player for the specified artwork from the specified media slot, first checking if we have a\ncached copy.\n\n@param artReference uniquely identifies the desired artwork\n@param trackType the kind of track that owns the artwork\n\n@return the artwork, if it was found, or {@code null}\n\n@throws Il... |
private void addContentInfo() {
if (!m_cms.getRequestContext().getCurrentProject().isOnlineProject()
&& (null == m_searchController.getCommon().getConfig().getSolrIndex())
&& (null != m_addContentInfoForEntries)) {
CmsSolrQuery query = new CmsSolrQuery();
m_searchController.addQueryParts(query, m_cms);
query.setStart(Integer.valueOf(0));
query.setRows(m_addContentInfoForEntries);
CmsContentLoadCollectorInfo info = new CmsContentLoadCollectorInfo();
info.setCollectorClass(this.getClass().getName());
info.setCollectorParams(query.getQuery());
info.setId((new CmsUUID()).getStringValue());
if (CmsJspTagEditable.getDirectEditProvider(pageContext) != null) {
try {
CmsJspTagEditable.getDirectEditProvider(pageContext).insertDirectEditListMetadata(
pageContext,
info);
} catch (JspException e) {
LOG.error("Could not write content info.", e);
}
}
}
} | [
"Adds the content info for the collected resources used in the \"This page\" publish dialog."
] | [
"Map from an activity code value UUID to the actual value itself, and its\nsequence number.\n\n@param storepoint storepoint containing current project data",
"This method retrieves a Duration instance representing the amount of\nwork between two dates based on this calendar.\n\n@param startDate start date\n@param... |
private <Y> void checkObserverMethod(EnhancedAnnotatedMethod<T, Y> annotated) {
// Make sure exactly one and only one parameter is annotated with Observes or ObservesAsync
List<EnhancedAnnotatedParameter<?, Y>> eventObjects = annotated.getEnhancedParameters(Observes.class);
eventObjects.addAll(annotated.getEnhancedParameters(ObservesAsync.class));
if (this.reception.equals(Reception.IF_EXISTS) && declaringBean.getScope().equals(Dependent.class)) {
throw EventLogger.LOG.invalidScopedConditionalObserver(this, Formats.formatAsStackTraceElement(annotated.getJavaMember()));
}
if (eventObjects.size() > 1) {
throw EventLogger.LOG.multipleEventParameters(this, Formats.formatAsStackTraceElement(annotated.getJavaMember()));
}
EnhancedAnnotatedParameter<?, Y> eventParameter = eventObjects.iterator().next();
checkRequiredTypeAnnotations(eventParameter);
// Check for parameters annotated with @Disposes
List<?> disposeParams = annotated.getEnhancedParameters(Disposes.class);
if (disposeParams.size() > 0) {
throw EventLogger.LOG.invalidDisposesParameter(this, Formats.formatAsStackTraceElement(annotated.getJavaMember()));
}
// Check annotations on the method to make sure this is not a producer
// method, initializer method, or destructor method.
if (this.observerMethod.getAnnotated().isAnnotationPresent(Produces.class)) {
throw EventLogger.LOG.invalidProducer(this, Formats.formatAsStackTraceElement(annotated.getJavaMember()));
}
if (this.observerMethod.getAnnotated().isAnnotationPresent(Inject.class)) {
throw EventLogger.LOG.invalidInitializer(this, Formats.formatAsStackTraceElement(annotated.getJavaMember()));
}
boolean containerLifecycleObserverMethod = Observers.isContainerLifecycleObserverMethod(this);
for (EnhancedAnnotatedParameter<?, ?> parameter : annotated.getEnhancedParameters()) {
// if this is an observer method for container lifecycle event, it must not inject anything besides BeanManager
if (containerLifecycleObserverMethod && !parameter.isAnnotationPresent(Observes.class) && !parameter.isAnnotationPresent(ObservesAsync.class) && !BeanManager.class.equals(parameter.getBaseType())) {
throw EventLogger.LOG.invalidInjectionPoint(this, Formats.formatAsStackTraceElement(annotated.getJavaMember()));
}
}
} | [
"Performs validation of the observer method for compliance with the specifications."
] | [
"Verify that cluster is congruent to store def wrt zones.",
"returns whether masking with the given mask results in a valid contiguous range for this segment,\nand if it does, if it matches the range obtained when masking the given values with the same mask.\n\n@param lowerValue\n@param upperValue\n@param mask\n@... |
public synchronized Widget measureChild(final int dataIndex, boolean calculateOffset) {
Log.d(Log.SUBSYSTEM.LAYOUT, TAG, "measureChild dataIndex = %d", dataIndex);
Widget widget = mContainer.get(dataIndex);
if (widget != null) {
synchronized (mMeasuredChildren) {
mMeasuredChildren.add(dataIndex);
}
}
return widget;
} | [
"Calculate the child size along the axis and measure the offset inside the\nlayout container\n@param dataIndex of child in Container\n@return true item fits the container, false - otherwise"
] | [
"Gets the current page\n@return",
"The timeout which we block for when a resource is not available\n\n@param timeout The timeout\n@param unit The units of the timeout",
"Checks if this service implementation accepts the given resource path.\n@param resourcePath Resource path\n@return true if the implementation ... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.