query stringlengths 7 3.3k | positive listlengths 1 1 | negative listlengths 9 9 |
|---|---|---|
Put everything smaller than days at 0
@param cal calendar to be cleaned | [
"private Calendar cleanHistCalendar(Calendar cal) {\n cal.set(Calendar.MILLISECOND, 0);\n cal.set(Calendar.SECOND, 0);\n cal.set(Calendar.MINUTE, 0);\n cal.set(Calendar.HOUR, 0);\n return cal;\n }"
] | [
"public void warn(Throwable throwable, String msg, Object[] argArray) {\n\t\tlogIfEnabled(Level.WARNING, throwable, msg, UNKNOWN_ARG, UNKNOWN_ARG, UNKNOWN_ARG, argArray);\n\t}",
"public void postLicense(final License license, final String user, final String password) throws GrapesCommunicationException, Authentic... |
Runs a Story with the given steps factory, applying the given meta
filter, and staring from given state.
@param configuration the Configuration used to run story
@param stepsFactory the InjectableStepsFactory used to created the
candidate steps methods
@param story the Story to run
@param filter the Filter to apply to... | [
"public void run(Configuration configuration, InjectableStepsFactory stepsFactory, Story story, MetaFilter filter,\n State beforeStories) throws Throwable {\n RunContext context = new RunContext(configuration, stepsFactory, story.getPath(), filter);\n if (beforeStories != null) {\n ... | [
"public List<DbLicense> getModuleLicenses(final String moduleId,\n final LicenseMatcher licenseMatcher) {\n final DbModule module = getModule(moduleId);\n\n final List<DbLicense> licenses = new ArrayList<>();\n final FiltersHolder filters = new Filter... |
given the groupId, returns the groupName
@param groupId ID of group
@return name of group | [
"public String getGroupNameFromId(int groupId) {\n return (String) sqlService.getFromTable(Constants.GROUPS_GROUP_NAME, Constants.GENERIC_ID, groupId,\n Constants.DB_TABLE_GROUPS);\n }"
] | [
"@Override\n public String logFile() {\n if(logFile == null) {\n logFile = Config.getTmpDir()+Config.getPathSeparator()+\"aesh.log\";\n }\n return logFile;\n }",
"private void throwExceptionIfSafetyRestrictionsAreViolated(CmsObject cms, CmsSolrQuery query, boolean isSpell)\r\... |
Clear JobContext of current thread | [
"public static void clear() {\n JobContext ctx = current_.get();\n if (null != ctx) {\n ctx.bag_.clear();\n JobContext parent = ctx.parent;\n if (null != parent) {\n current_.set(parent);\n ctx.parent = null;\n } else {\n ... | [
"public int compare(Vector3 o1, Vector3 o2) {\n\t\tint ans = 0;\n\n\t\tif (o1 != null && o2 != null) {\n\t\t\tVector3 d1 = o1;\n\t\t\tVector3 d2 = o2;\n\n\t\t\tif (d1.x > d2.x)\n\t\t\t\treturn 1;\n\t\t\tif (d1.x < d2.x)\n\t\t\t\treturn -1;\n\t\t\t// x1 == x2\n\t\t\tif (d1.y > d2.y)\n\t\t\t\treturn 1;\n\t\t\tif (d1.... |
Escape text to ensure valid JSON.
@param value value
@return escaped value | [
"private String escapeString(String value)\n {\n m_buffer.setLength(0);\n m_buffer.append('\"');\n for (int index = 0; index < value.length(); index++)\n {\n char c = value.charAt(index);\n switch (c)\n {\n case '\"':\n {\n m_buffer.a... | [
"@Override public Object instantiateItem(ViewGroup parent, int position) {\n T content = getItem(position);\n rendererBuilder.withContent(content);\n rendererBuilder.withParent(parent);\n rendererBuilder.withLayoutInflater(LayoutInflater.from(parent.getContext()));\n Renderer<T> r... |
Set an attribute.
@param name attribute name.
@param value attribute value. | [
"public void set(String name, Object value) {\n hashAttributes.put(name, value);\n\n if (plugin != null) {\n plugin.invalidate();\n }\n }"
] | [
"public static String determineFieldName(@Nonnull final String methodName) {\n\t\tCheck.notEmpty(methodName, \"methodName\");\n\t\tfinal Matcher m = PATTERN.matcher(methodName);\n\t\tCheck.stateIsTrue(m.find(), \"passed method name '%s' is not applicable\", methodName);\n\t\treturn m.group(2).substring(0, 1).toLowe... |
blocks until there is a connection | [
"public void checkConnection() {\n long start = Time.currentTimeMillis();\n\n while (clientChannel == null) {\n\n tcpSocketConsumer.checkNotShutdown();\n\n if (start + timeoutMs > Time.currentTimeMillis())\n try {\n condition.await(1, TimeUnit.MI... | [
"public void useNewSOAPServiceWithOldClientAndRedirection() throws Exception {\n URL wsdlURL = getClass().getResource(\"/CustomerService.wsdl\");\n com.example.customerservice.CustomerServiceService service = \n new com.example.customerservice.CustomerServiceService(wsdlURL);\n \n ... |
Handles the response of the SendData request.
@param incomingMessage the response message to process. | [
"private void handleSendDataResponse(SerialMessage incomingMessage) {\n\t\tlogger.trace(\"Handle Message Send Data Response\");\n\t\tif(incomingMessage.getMessageBuffer()[2] != 0x00)\n\t\t\tlogger.debug(\"Sent Data successfully placed on stack.\");\n\t\telse\n\t\t\tlogger.error(\"Sent Data was not placed on stack d... | [
"private Point parsePoint(String point) {\n int comma = point.indexOf(',');\n if (comma == -1)\n return null;\n\n float lat = Float.valueOf(point.substring(0, comma));\n float lng = Float.valueOf(point.substring(comma + 1));\n return spatialctx.makePoint(lng, lat);\n }",
"private BigInteger g... |
Deletes this BoxStoragePolicyAssignment. | [
"public void delete() {\n URL url = STORAGE_POLICY_ASSIGNMENT_WITH_ID_URL_TEMPLATE.build(this.getAPI().getBaseURL(), this.getID());\n BoxAPIRequest request = new BoxAPIRequest(this.getAPI(), url, HttpMethod.DELETE);\n\n request.send();\n }"
] | [
"private ProjectFile readTextFile(InputStream inputStream) throws MPXJException\n {\n ProjectReader reader = new AstaTextFileReader();\n addListeners(reader);\n return reader.read(inputStream);\n }",
"protected void updateFontTable()\n {\n PDResources resources = pdpage.getResources()... |
If needed, destroy the remaining conversation contexts after an HTTP session was invalidated within the current request.
@param request | [
"private void processDestructionQueue(HttpServletRequest request) {\n Object contextsAttribute = request.getAttribute(DESTRUCTION_QUEUE_ATTRIBUTE_NAME);\n if (contextsAttribute instanceof Map) {\n Map<String, List<ContextualInstance<?>>> contexts = cast(contextsAttribute);\n sync... | [
"public void setGamma(float rGamma, float gGamma, float bGamma) {\n\t\tthis.rGamma = rGamma;\n\t\tthis.gGamma = gGamma;\n\t\tthis.bGamma = bGamma;\n\t\tinitialized = false;\n\t}",
"public static base_response unset(nitro_service client, protocolhttpband resource, String[] args) throws Exception{\n\t\tprotocolhttp... |
Makes a CRFDatum by producing features and a label from input data at a
specific position, using the provided factory.
@param info
The input data
@param loc
The position to build a datum at
@param featureFactory
The FeatureFactory to use to extract features
@return The constructed CRFDatum | [
"public CRFDatum<List<String>, CRFLabel> makeDatum(List<IN> info, int loc,\r\n edu.stanford.nlp.sequences.FeatureFactory<IN> featureFactory) {\r\n pad.set(AnswerAnnotation.class, flags.backgroundSymbol);\r\n PaddedList<IN> pInfo = new PaddedList<IN>(info, pad);\r\n\r\n ArrayList<List<String>> features... | [
"public static void waitForDomain(final ModelControllerClient client, final long startupTimeout)\n throws InterruptedException, RuntimeException, TimeoutException {\n waitForDomain(null, client, startupTimeout);\n }",
"public CmsJspInstanceDateBean getToInstanceDate() {\n\n if (m_insta... |
Submits the configured assembly to Transloadit for processing.
@param isResumable boolean value that tells the assembly whether or not to use tus.
@return {@link AssemblyResponse} the response received from the Transloadit server.
@throws RequestException if request to Transloadit server fails.
@throws LocalOpe... | [
"public AssemblyResponse save(boolean isResumable)\n throws RequestException, LocalOperationException {\n Request request = new Request(getClient());\n options.put(\"steps\", steps.toMap());\n\n // only do tus uploads if files will be uploaded\n if (isResumable && getFilesCoun... | [
"public <Result> Result process(IUnitOfWork<Result, State> work) {\n\t\treleaseReadLock();\n\t\tacquireWriteLock();\n\t\ttry {\n\t\t\tif (log.isTraceEnabled())\n\t\t\t\tlog.trace(\"process - \" + Thread.currentThread().getName());\n\t\t\treturn modify(work);\n\t\t} finally {\n\t\t\tif (log.isTraceEnabled())\n\t\t\t... |
return the list of FormInputs that match this element
@param element
@return | [
"private FormInput formInputMatchingNode(Node element) {\n\t\tNamedNodeMap attributes = element.getAttributes();\n\t\tIdentification id;\n\n\t\tif (attributes.getNamedItem(\"id\") != null\n\t\t\t\t&& formFillMode != FormFillMode.XPATH_TRAINING) {\n\t\t\tid = new Identification(Identification.How.id,\n\t\t\t\t\tattr... | [
"private static <R> RowKey buildRowKey(AssociationKey associationKey, R row, AssociationRowAccessor<R> accessor) {\n\t\tString[] columnNames = associationKey.getMetadata().getRowKeyColumnNames();\n\t\tObject[] columnValues = new Object[columnNames.length];\n\n\t\tfor ( int i = 0; i < columnNames.length; i++ ) {\n\t... |
Translate this rectangle over the specified following distances.
@param rect rectangle to move
@param dx delta x
@param dy delta y | [
"public void translateRectangle(Rectangle rect, float dx, float dy) {\n\t\tfloat width = rect.getWidth();\n\t\tfloat height = rect.getHeight();\n\t\trect.setLeft(rect.getLeft() + dx);\n\t\trect.setBottom(rect.getBottom() + dy);\n\t\trect.setRight(rect.getLeft() + dx + width);\n\t\trect.setTop(rect.getBottom() + dy ... | [
"private void _handleMultiValues(ArrayList<String> values, String key, String command) {\n if (key == null) return;\n\n if (values == null || values.isEmpty()) {\n _generateEmptyMultiValueError(key);\n return;\n }\n\n ValidationResult vr;\n\n // validate the ... |
Map content.
@param dh the data handler
@return the string | [
"private static String mapContent(DataHandler dh) {\n if (dh == null) {\n return \"\";\n }\n try {\n InputStream is = dh.getInputStream();\n String content = IOUtils.toString(is);\n is.close();\n return content;\n } catch (IOExceptio... | [
"public List<Versioned<V>> getWithCustomTimeout(CompositeVoldemortRequest<K, V> requestWrapper) {\n validateTimeout(requestWrapper.getRoutingTimeoutInMs());\n for(int attempts = 0; attempts < this.metadataRefreshAttempts; attempts++) {\n try {\n long startTimeInMs = System.cu... |
Whether the given value generation strategy requires to read the value from the database or not. | [
"private boolean isReadRequired(ValueGeneration valueGeneration, GenerationTiming matchTiming) {\n\t\treturn valueGeneration != null && valueGeneration.getValueGenerator() == null &&\n\t\t\t\ttimingsMatch( valueGeneration.getGenerationTiming(), matchTiming );\n\t}"
] | [
"public long[] keys() {\n long[] values = new long[size];\n int idx = 0;\n for (Entry entry : table) {\n while (entry != null) {\n values[idx++] = entry.key;\n entry = entry.next;\n }\n }\n return values;\n }",
"public void ... |
Post the specified photo to a blog. Note that the Photo.title and Photo.description are used for the blog entry title and body respectively.
@param photo
The photo metadata
@param blogId
The blog ID
@param blogPassword
The blog password
@throws FlickrException | [
"public void postPhoto(Photo photo, String blogId, String blogPassword) throws FlickrException {\r\n Map<String, Object> parameters = new HashMap<String, Object>();\r\n parameters.put(\"method\", METHOD_POST_PHOTO);\r\n\r\n parameters.put(\"blog_id\", blogId);\r\n parameters.put(\"photo_... | [
"private void updateBaseCalendarNames(List<Pair<ProjectCalendar, Integer>> baseCalendars)\n {\n for (Pair<ProjectCalendar, Integer> pair : baseCalendars)\n {\n ProjectCalendar cal = pair.getFirst();\n Integer baseCalendarID = pair.getSecond();\n ProjectCalendar baseCal = m_calend... |
Set a status message in the JTextComponent passed to this
model.
@param message The message that should be displayed. | [
"public void setStatusBarMessage(final String message)\r\n {\r\n // Guaranteed to return a non-null array\r\n Object[] listeners = listenerList.getListenerList();\r\n // Process the listeners last to first, notifying\r\n // those that are interested in this event\r\n for (int i... | [
"private void checkExistingTracks() {\n SwingUtilities.invokeLater(new Runnable() {\n @Override\n public void run() {\n for (Map.Entry<DeckReference, TrackMetadata> entry : MetadataFinder.getInstance().getLoadedTracks().entrySet()) {\n if (entry.getKey(... |
Checks if a given number is in the range of a double.
@param number
a number which should be in the range of a double (positive or negative)
@see java.lang.Double#MIN_VALUE
@see java.lang.Double#MAX_VALUE
@return number as a double | [
"@ArgumentsChecked\n\t@Throws(IllegalNullArgumentException.class)\n\tpublic static double checkDouble(@Nonnull final Number number) {\n\t\tCheck.notNull(number, \"number\");\n\t\tif (!isInDoubleRange(number)) {\n\t\t\tthrow new IllegalNumberRangeException(number.toString(), DOUBLE_MIN, DOUBLE_MAX);\n\t\t}\n\n\t\tre... | [
"public Replication queryParams(Map<String, Object> queryParams) {\r\n this.replication = replication.queryParams(queryParams);\r\n return this;\r\n }",
"static boolean shouldShowRequestPermissionRationale(Activity activity, String... permissions) {\n for (String permission : permissions) {\n ... |
Return list of all files in the directory.
@param directory target directory on file system
@return list of files in the directory or empty list if directory is empty. | [
"@NonNull\n public static File[] listAllFiles(File directory) {\n if (directory == null) {\n return new File[0];\n }\n File[] files = directory.listFiles();\n return files != null ? files : new File[0];\n }"
] | [
"@SuppressWarnings(\"unused\")\n public void selectItem(int position, boolean invokeListeners) {\n IOperationItem item = mOuterAdapter.getItem(position);\n IOperationItem oldHidedItem = mOuterAdapter.getItem(mRealHidedPosition);\n\n int realPosition = mOuterAdapter.normalizePosition(position... |
Runs a queued task, if the queue is not already empty.
Note that this will decrement the request count if there are no queued tasks to be run
@param hasPermit If the caller has already called {@link #beginRequest(boolean force)} | [
"private boolean runQueuedTask(boolean hasPermit) {\n if (!hasPermit && beginRequest(paused) == RunResult.REJECTED) {\n return false;\n }\n QueuedTask task = null;\n if (!paused) {\n task = taskQueue.poll();\n } else {\n //the container is suspende... | [
"public QueryBuilder<T, ID> orderByRaw(String rawSql) {\n\t\taddOrderBy(new OrderBy(rawSql, (ArgumentHolder[]) null));\n\t\treturn this;\n\t}",
"public List<BoxTask.Info> getTasks(String... fields) {\n QueryStringBuilder builder = new QueryStringBuilder();\n if (fields.length > 0) {\n bui... |
Build and return a foreign collection based on the field settings that matches the id argument. This can return
null in certain circumstances.
@param parent
The parent object that we will set on each item in the collection.
@param id
The id of the foreign object we will look for. This can be null if we are creating an... | [
"public <FT, FID> BaseForeignCollection<FT, FID> buildForeignCollection(Object parent, FID id) throws SQLException {\n\t\t// this can happen if we have a foreign-auto-refresh scenario\n\t\tif (foreignFieldType == null) {\n\t\t\treturn null;\n\t\t}\n\t\t@SuppressWarnings(\"unchecked\")\n\t\tDao<FT, FID> castDao = (D... | [
"public ItemRequest<Task> addProject(String task) {\n \n String path = String.format(\"/tasks/%s/addProject\", task);\n return new ItemRequest<Task>(this, Task.class, path, \"POST\");\n }",
"protected void fixIntegerPrecisions(ItemIdValue itemIdValue,\n\t\t\tString propertyId) {\n\n\t\tString ... |
Maps all views that don't start with "android" namespace.
@param names All shared element names.
@return The obsolete shared element names. | [
"@NonNull\n private List<String> mapObsoleteElements(List<String> names) {\n List<String> elementsToRemove = new ArrayList<>(names.size());\n for (String name : names) {\n if (name.startsWith(\"android\")) continue;\n elementsToRemove.add(name);\n }\n return elem... | [
"protected synchronized void doWriteObjects(boolean isFlush) throws TransactionAbortedException, LockNotGrantedException\r\n {\r\n /*\r\n arminw:\r\n if broker isn't in PB-tx, start tx\r\n */\r\n if (!getBroker().isInTransaction())\r\n {\r\n if (log.isDebugEna... |
Returns a date and time string which is formatted as ISO-8601. | [
"@JsonProperty\n public String timestamp() {\n if (timestampAsText == null) {\n timestampAsText = DateTimeFormatter.ISO_INSTANT.format(timestamp);\n }\n return timestampAsText;\n }"
] | [
"private void addSequence(String sequenceName, HighLowSequence seq)\r\n {\r\n // lookup the sequence map for calling DB\r\n String jcdAlias = getBrokerForClass()\r\n .serviceConnectionManager().getConnectionDescriptor().getJcdAlias();\r\n Map mapForDB = (Map) sequencesDBMap.ge... |
Use this API to fetch nstimer_binding resource of given name . | [
"public static nstimer_binding get(nitro_service service, String name) throws Exception{\n\t\tnstimer_binding obj = new nstimer_binding();\n\t\tobj.set_name(name);\n\t\tnstimer_binding response = (nstimer_binding) obj.get_resource(service);\n\t\treturn response;\n\t}"
] | [
"public static boolean isAscii(Slice utf8)\n {\n int length = utf8.length();\n int offset = 0;\n\n // Length rounded to 8 bytes\n int length8 = length & 0x7FFF_FFF8;\n for (; offset < length8; offset += 8) {\n if ((utf8.getLongUnchecked(offset) & TOP_MASK64) != 0) {\... |
Formats a resource type.
@param resource MPXJ resource
@return Primavera resource type | [
"private String getResourceType(Resource resource)\n {\n String result;\n net.sf.mpxj.ResourceType type = resource.getType();\n if (type == null)\n {\n type = net.sf.mpxj.ResourceType.WORK;\n }\n\n switch (type)\n {\n case MATERIAL:\n {\n resul... | [
"@NonNull\n @UiThread\n private HashMap<Integer, Boolean> generateExpandedStateMap() {\n HashMap<Integer, Boolean> parentHashMap = new HashMap<>();\n int childCount = 0;\n\n int listItemCount = mFlatItemList.size();\n for (int i = 0; i < listItemCount; i++) {\n if (mFlat... |
Will prompt a user the "Add to Homescreen" feature
@param callback A callback function after the method has been executed. | [
"public void installApp(Functions.Func callback) {\n if (isPwaSupported()) {\n appInstaller = new AppInstaller(callback);\n appInstaller.prompt();\n }\n }"
] | [
"public static Node updateNode(Node node, List<Integer> partitionsList) {\n return new Node(node.getId(),\n node.getHost(),\n node.getHttpPort(),\n node.getSocketPort(),\n node.getAdminPort(),\n ... |
Stops the compressor. | [
"final void end() {\n final Thread thread = this.threadRef;\n this.keepRunning.set(false);\n if (thread != null) {\n // thread.interrupt();\n try {\n thread.join();\n } catch (InterruptedException e) {\n Thread.currentThread().interrupt();\n }\n }\n this.threadRef = n... | [
"public Collection<Locale> getCountries() {\n Collection<Locale> result = get(KEY_QUERY_COUNTRIES, Collection.class);\n if (result == null) {\n return Collections.emptySet();\n }\n return result;\n }",
"private void writeTasks(Project project)\n {\n Project.Tasks t... |
Populate a sorted list of custom fields to ensure that these fields
are written to the file in a consistent order. | [
"private void populateSortedCustomFieldsList ()\n {\n m_sortedCustomFieldsList = new ArrayList<CustomField>();\n for (CustomField field : m_projectFile.getCustomFields())\n {\n FieldType fieldType = field.getFieldType();\n if (fieldType != null)\n {\n m_sortedCust... | [
"@SafeVarargs\n public static <T> Set<T> create(final T... values) {\n Set<T> result = new HashSet<>(values.length);\n Collections.addAll(result, values);\n return result;\n }",
"public Set<RGBColor> colours() {\n return stream().map(Pixel::toColor).collect(Collectors.toSet());\n... |
Check if the current node is part of routing request based on cluster.xml
or throw an exception.
@param key The key we are checking
@param routingStrategy The routing strategy
@param currentNode Current node | [
"public static void assertValidMetadata(ByteArray key,\n RoutingStrategy routingStrategy,\n Node currentNode) {\n List<Node> nodes = routingStrategy.routeRequest(key.get());\n for(Node node: nodes) {\n if(no... | [
"private void countGender(EntityIdValue gender, SiteRecord siteRecord) {\n\t\tInteger curValue = siteRecord.genderCounts.get(gender);\n\t\tif (curValue == null) {\n\t\t\tsiteRecord.genderCounts.put(gender, 1);\n\t\t} else {\n\t\t\tsiteRecord.genderCounts.put(gender, curValue + 1);\n\t\t}\n\t}",
"public String get... |
Use this API to update Interface resources. | [
"public static base_responses update(nitro_service client, Interface resources[]) throws Exception {\n\t\tbase_responses result = null;\n\t\tif (resources != null && resources.length > 0) {\n\t\t\tInterface updateresources[] = new Interface[resources.length];\n\t\t\tfor (int i=0;i<resources.length;i++){\n\t\t\t\tup... | [
"public static boolean isFinalVariable(DeclarationExpression declarationExpression, SourceCode sourceCode) {\r\n if (isFromGeneratedSourceCode(declarationExpression)) {\r\n return false;\r\n }\r\n List<Expression> variableExpressions = getVariableExpressions(declarationExpression);\r... |
Sets up this object to represent an argument that will be set to a
constant value.
@param constantValue the constant value. | [
"public void setValue(String constantValue)\r\n {\r\n this.fieldSource = SOURCE_VALUE;\r\n this.fieldRefName = null;\r\n this.returnedByProcedure = false;\r\n this.constantValue = constantValue;\r\n }"
] | [
"public static double normP1( DMatrixRMaj A ) {\n if( MatrixFeatures_DDRM.isVector(A)) {\n return CommonOps_DDRM.elementSumAbs(A);\n } else {\n return inducedP1(A);\n }\n }",
"private Pair<Cluster, List<StoreDefinition>> getCurrentClusterState() {\n\n // Retrie... |
Adds a parameter to the argument list if the given integer is non-null.
If the value is null, then the argument list remains unchanged. | [
"ArgumentsBuilder param(String param, Integer value) {\n if (value != null) {\n args.add(param);\n args.add(value.toString());\n }\n return this;\n }"
] | [
"public static int cudnnSoftmaxBackward(\n cudnnHandle handle, \n int algo, \n int mode, \n Pointer alpha, \n cudnnTensorDescriptor yDesc, \n Pointer y, \n cudnnTensorDescriptor dyDesc, \n Pointer dy, \n Pointer beta, \n cudnnTensorDescriptor dxD... |
Get a lower-scoped token restricted to a resource for the list of scopes that are passed.
@param scopes the list of scopes to which the new token should be restricted for
@param resource the resource for which the new token has to be obtained
@return scopedToken which has access token and other details | [
"public ScopedToken getLowerScopedToken(List<String> scopes, String resource) {\n assert (scopes != null);\n assert (scopes.size() > 0);\n URL url = null;\n try {\n url = new URL(this.getTokenURL());\n } catch (MalformedURLException e) {\n assert false : \"An... | [
"public static List<QuotaType> getQuotaTypes(List<String> strQuotaTypes) {\n if(strQuotaTypes.size() < 1) {\n throw new VoldemortException(\"Quota type not specified.\");\n }\n List<QuotaType> quotaTypes;\n if(strQuotaTypes.size() == 1 && strQuotaTypes.get(0).equals(AdminToolU... |
Loads the favorite list.
@return the list of favorites
@throws CmsException if something goes wrong | [
"public List<CmsFavoriteEntry> loadFavorites() throws CmsException {\n\n List<CmsFavoriteEntry> result = new ArrayList<>();\n try {\n CmsUser user = readUser();\n String data = (String)user.getAdditionalInfo(ADDINFO_KEY);\n if (CmsStringUtil.isEmptyOrWhitespaceOnly(dat... | [
"private int[] readTypeAnnotations(final MethodVisitor mv,\n final Context context, int u, boolean visible) {\n char[] c = context.buffer;\n int[] offsets = new int[readUnsignedShort(u)];\n u += 2;\n for (int i = 0; i < offsets.length; ++i) {\n offsets[i] = u;\n ... |
Process a beat packet, potentially updating the master tempo and sending our listeners a master
beat notification. Does nothing if we are not active. | [
"void processBeat(Beat beat) {\n if (isRunning() && beat.isTempoMaster()) {\n setMasterTempo(beat.getEffectiveTempo());\n deliverBeatAnnouncement(beat);\n }\n }"
] | [
"protected static boolean isMaskCompatibleWithRange(long value, long upperValue, long maskValue, long maxValue) {\n\t\tif(value == upperValue || maskValue == maxValue || maskValue == 0) {\n\t\t\treturn true;\n\t\t}\n\n\t\t//algorithm:\n\t\t//here we find the highest bit that is part of the range, highestDifferingBi... |
Add an appliable "post-run" dependent for this task item.
@param appliable the appliable "post-run" dependent.
@return the key to be used as parameter to taskResult(string) method to retrieve updated "post-run" dependent | [
"@SuppressWarnings(\"unchecked\")\n protected String addPostRunDependent(Appliable<? extends Indexable> appliable) {\n TaskGroup.HasTaskGroup dependency = (TaskGroup.HasTaskGroup) appliable;\n return this.addPostRunDependent(dependency);\n }"
] | [
"protected void processAliases(List<MonolingualTextValue> addAliases, List<MonolingualTextValue> deleteAliases) {\n for(MonolingualTextValue val : addAliases) {\n addAlias(val);\n }\n for(MonolingualTextValue val : deleteAliases) {\n deleteAlias(val);\n }\n }",
... |
Removes and returns a random element from the set.
@return the removed element, or <code>null</code> when the key does not exist. | [
"public String pop() {\n return doWithJedis(new JedisCallable<String>() {\n @Override\n public String call(Jedis jedis) {\n return jedis.spop(getKey());\n }\n });\n }"
] | [
"public static void validate(final ArtifactQuery artifactQuery) {\n final Pattern invalidChars = Pattern.compile(\"[^A-Fa-f0-9]\");\n if(artifactQuery.getUser() == null ||\n \t\tartifactQuery.getUser().isEmpty()){\n throw new WebApplicationException(Response.status(Response.Status.BA... |
Lift a Java Func0 to a Scala Function0
@param f the function to lift
@returns the Scala function | [
"public static<Z> Function0<Z> lift(Func0<Z> f) {\n\treturn bridge.lift(f);\n }"
] | [
"public void alias(DMatrixRMaj variable , String name ) {\n if( isReserved(name))\n throw new RuntimeException(\"Reserved word or contains a reserved character\");\n VariableMatrix old = (VariableMatrix)variables.get(name);\n if( old == null ) {\n variables.put(name, new V... |
Move sections relative to each other in a board view. One of
`before_section` or `after_section` is required.
Sections cannot be moved between projects.
At this point in time, moving sections is not supported in list views, only board views.
Returns an empty data block.
@param project The project in which to reord... | [
"public ItemRequest<Section> insertInProject(String project) {\n \n String path = String.format(\"/projects/%s/sections/insert\", project);\n return new ItemRequest<Section>(this, Section.class, path, \"POST\");\n }"
] | [
"private void prepare() throws IOException, DocumentException, PrintingException {\n\t\tif (baos == null) {\n\t\t\tbaos = new ByteArrayOutputStream(); // let it grow as much as needed\n\t\t}\n\t\tbaos.reset();\n\t\tboolean resize = false;\n\t\tif (page.getConstraint().getWidth() == 0 || page.getConstraint().getHeig... |
Use this API to fetch systemuser resource of given name . | [
"public static systemuser get(nitro_service service, String username) throws Exception{\n\t\tsystemuser obj = new systemuser();\n\t\tobj.set_username(username);\n\t\tsystemuser response = (systemuser) obj.get_resource(service);\n\t\treturn response;\n\t}"
] | [
"public void set( T a ) {\n if( a.getType() == getType() )\n mat.set(a.getMatrix());\n else {\n setMatrix(a.mat.copy());\n }\n }",
"@SuppressWarnings(\"unused\")\n public Phonenumber.PhoneNumber getPhoneNumber() {\n try {\n String iso = null;\n ... |
Rehashes the contents of the receiver into a new table
with a smaller or larger capacity.
This method is called automatically when the
number of keys in the receiver exceeds the high water mark or falls below the low water mark. | [
"protected void rehash(int newCapacity) {\r\n\tint oldCapacity = table.length;\r\n\t//if (oldCapacity == newCapacity) return;\r\n\t\r\n\tlong oldTable[] = table;\r\n\tint oldValues[] = values;\r\n\tbyte oldState[] = state;\r\n\r\n\tlong newTable[] = new long[newCapacity];\r\n\tint newValues[] = new int[newCapacity]... | [
"@Override\n\tpublic Result getResult() throws Exception {\n\t\tResult returnResult = result;\n\n\t\t// If we've chained to other Actions, we need to find the last result\n\t\twhile (returnResult instanceof ActionChainResult) {\n\t\t\tActionProxy aProxy = ((ActionChainResult) returnResult).getProxy();\n\n\t\t\tif (... |
Serializes descriptor instance to XML
@param descriptor descriptor to be serialized
@return xml representation of descriptor as string | [
"public static String toXml(DeploymentDescriptor descriptor) {\n try {\n\n Marshaller marshaller = getContext().createMarshaller();\n marshaller.setProperty(Marshaller.JAXB_FORMATTED_OUTPUT, Boolean.TRUE);\n marshaller.setProperty(Marshaller.JAXB_SCHEMA_LOCATION, \"http://www... | [
"private SortedSet<Date> calculateDates() {\n\n if (null == m_allDates) {\n SortedSet<Date> result = new TreeSet<>();\n if (isAnyDatePossible()) {\n Calendar date = getFirstDate();\n int previousOccurrences = 0;\n while (showMoreEntries(date,... |
Adds a patch operation.
@param op the operation type. Must be add, replace, remove, or test.
@param path the path that designates the key. Must be prefixed with a "/".
@param value the value to be set. | [
"private void addOp(String op, String path, String value) {\n if (this.operations == null) {\n this.operations = new JsonArray();\n }\n\n this.operations.add(new JsonObject()\n .add(\"op\", op)\n .add(\"path\", path)\n .add(\"value\", valu... | [
"public static base_response update(nitro_service client, tmtrafficaction resource) throws Exception {\n\t\ttmtrafficaction updateresource = new tmtrafficaction();\n\t\tupdateresource.name = resource.name;\n\t\tupdateresource.apptimeout = resource.apptimeout;\n\t\tupdateresource.sso = resource.sso;\n\t\tupdateresou... |
called periodically to check that the heartbeat has been received
@return {@code true} if we have received a heartbeat recently | [
"private boolean hasReceivedHeartbeat() {\n long currentTimeMillis = System.currentTimeMillis();\n boolean result = lastTimeMessageReceived + heartbeatTimeoutMs >= currentTimeMillis;\n\n if (!result)\n Jvm.warn().on(getClass(), Integer.toHexString(hashCode()) + \" missed heartbeat, l... | [
"public static responderpolicylabel_binding get(nitro_service service, String labelname) throws Exception{\n\t\tresponderpolicylabel_binding obj = new responderpolicylabel_binding();\n\t\tobj.set_labelname(labelname);\n\t\tresponderpolicylabel_binding response = (responderpolicylabel_binding) obj.get_resource(servi... |
Append field with quotes and escape characters added, if required.
@return this | [
"SimpleJsonEncoder appendToJSON(final String key, final Object value) {\n if (closed) {\n throw new IllegalStateException(\"Encoder already closed\");\n }\n if (value != null) {\n appendKey(key);\n if (value instanceof Number) {\n sb.append(value.... | [
"protected ViewPort load() {\n resize = Window.addResizeHandler(event -> {\n execute(event.getWidth(), event.getHeight());\n });\n\n execute(window().width(), (int)window().height());\n return viewPort;\n }",
"public boolean isMaterialized(Object object)\r\n {\r\n ... |
Creates a new instance from the given configuration file.
@throws IOException if failed to load the configuration from the specified file | [
"public static CentralDogma forConfig(File configFile) throws IOException {\n requireNonNull(configFile, \"configFile\");\n return new CentralDogma(Jackson.readValue(configFile, CentralDogmaConfig.class));\n }"
] | [
"public static <E> Set<E> diff(Set<E> s1, Set<E> s2) {\r\n Set<E> s = new HashSet<E>();\r\n for (E o : s1) {\r\n if (!s2.contains(o)) {\r\n s.add(o);\r\n }\r\n }\r\n return s;\r\n }",
"public static String createFolderPath(String path) {\n\n String[] pathParts = path.split(\"\... |
Image scale method
@param imageToScale The image to be scaled
@param dWidth Desired width, the new image object is created to this size
@param dHeight Desired height, the new image object is created to this size
@param fWidth What to multiply the width by. value < 1 scales down, and value > one scales up
@param fHeight... | [
"private static BufferedImage scale(BufferedImage imageToScale, int dWidth, int dHeight, double fWidth, double fHeight) {\n BufferedImage dbi = null;\n // Needed to create a new BufferedImage object\n int imageType = imageToScale.getType();\n if (imageToScale != null) {\n dbi ... | [
"public void recordGetAllTime(long timeNS,\n int requested,\n int returned,\n long totalValueBytes,\n long totalKeyBytes) {\n recordTime(Tracked.GET_ALL,\n timeNS,... |
Initialize the pattern choice button group. | [
"private void initPatternButtonGroup() {\n\n m_groupPattern = new CmsRadioButtonGroup();\n m_patternButtons = new HashMap<>();\n\n createAndAddButton(PatternType.DAILY, Messages.GUI_SERIALDATE_TYPE_DAILY_0);\n m_patternButtons.put(PatternType.NONE, m_patternButtons.get(PatternType.DAILY)... | [
"public static void waitForStandalone(final ModelControllerClient client, final long startupTimeout)\n throws InterruptedException, RuntimeException, TimeoutException {\n waitForStandalone(null, client, startupTimeout);\n }",
"public void rotateToFront() {\n GVRTransform transform = mS... |
Copies the non-zero structure of orig into "this"
@param orig Matrix who's structure is to be copied | [
"public void copyStructure( DMatrixSparseCSC orig ) {\n reshape(orig.numRows, orig.numCols, orig.nz_length);\n this.nz_length = orig.nz_length;\n System.arraycopy(orig.col_idx,0,col_idx,0,orig.numCols+1);\n System.arraycopy(orig.nz_rows,0,nz_rows,0,orig.nz_length);\n }"
] | [
"private URL[] getClasspath(JobInstance ji, JobRunnerCallback cb) throws JqmPayloadException\n {\n switch (ji.getJD().getPathType())\n {\n case MAVEN:\n return mavenResolver.resolve(ji);\n case MEMORY:\n return new URL[0];\n case FS:\n default:\n ... |
Returns the property value read from the given JavaBean.
@param bean the JavaBean to read the property from
@param property the property to read
@return the property value read from the given JavaBean | [
"protected Object getMacroBeanValue(Object bean, String property) {\n\n Object result = null;\n if ((bean != null) && CmsStringUtil.isNotEmptyOrWhitespaceOnly(property)) {\n try {\n PropertyUtilsBean propBean = BeanUtilsBean.getInstance().getPropertyUtils();\n ... | [
"@SuppressWarnings(\"unchecked\")\n private static synchronized Map<String, Boolean> getCache(GraphRewrite event)\n {\n Map<String, Boolean> result = (Map<String, Boolean>)event.getRewriteContext().get(ClassificationServiceCache.class);\n if (result == null)\n {\n result = Coll... |
Returns the export format indicated in the result-type parameter "layoutManager"
@param _invocation
@return | [
"protected LayoutManager getLayOutManagerObj(ActionInvocation _invocation) {\n\t\tif (layoutManager == null || \"\".equals(layoutManager)){\n\t\t\tLOG.warn(\"No valid LayoutManager, using ClassicLayoutManager\");\n\t\t\treturn new ClassicLayoutManager();\n\t\t}\n\n\t\tObject los = conditionalParse(layoutManager, _i... | [
"public static sslpolicylabel[] get(nitro_service service) throws Exception{\n\t\tsslpolicylabel obj = new sslpolicylabel();\n\t\tsslpolicylabel[] response = (sslpolicylabel[])obj.get_resources(service);\n\t\treturn response;\n\t}",
"@SuppressWarnings(\"unchecked\")\n protected String addPostRunDependent(Appli... |
Unregister the mbean with the given name from the platform mbean server
@param name The name of the mbean to unregister | [
"public static void unregisterMbean(ObjectName name) {\n try {\n ManagementFactory.getPlatformMBeanServer().unregisterMBean(name);\n } catch(Exception e) {\n logger.error(\"Error unregistering mbean\", e);\n }\n }"
] | [
"public int getFaceNumIndices(int face) {\n if (null == m_faceOffsets) {\n if (face >= m_numFaces || face < 0) {\n throw new IndexOutOfBoundsException(\"Index: \" + face + \n \", Size: \" + m_numFaces);\n }\n return 3;\n }\n ... |
Return a list of websocket connection by key
@param key
the key to find the websocket connection list
@return a list of websocket connection or an empty list if no websocket connection found by key | [
"public List<WebSocketConnection> get(String key) {\n final List<WebSocketConnection> retList = new ArrayList<>();\n accept(key, C.F.addTo(retList));\n return retList;\n }"
] | [
"public ProgressBar stop() {\n target.kill();\n try {\n thread.join();\n target.consoleStream.print(\"\\n\");\n target.consoleStream.flush();\n }\n catch (InterruptedException ex) { }\n return this;\n }",
"@Pure\n\t@Inline(value = \"$3.union($... |
Checks whether a String satisfies the number range selection filter.
The test is evaluated based on the rightmost natural number found in
the String. Note that this is just evaluated on the String as given.
It is not trying to interpret it as a filename and to decide whether
the file exists, is a directory or anythin... | [
"public boolean accept(String str) {\r\n int k = str.length() - 1;\r\n char c = str.charAt(k);\r\n while (k >= 0 && !Character.isDigit(c)) {\r\n k--;\r\n if (k >= 0) {\r\n c = str.charAt(k);\r\n }\r\n }\r\n if (k < 0) {\r\n return false;\r\n }\r\n int j = k;\r\n c ... | [
"protected String toHexString(boolean with0xPrefix, CharSequence zone) {\n\t\tif(isDualString()) {\n\t\t\treturn toNormalizedStringRange(toIPParams(with0xPrefix ? IPStringCache.hexPrefixedParams : IPStringCache.hexParams), getLower(), getUpper(), zone);\n\t\t}\n\t\treturn toIPParams(with0xPrefix ? IPStringCache.hex... |
Check given class modifiers. Plugin with resources plugin should not be private or abstract
or interface. | [
"private static boolean checkModifiers(Class<? extends AbstractPlugin> pluginClass) {\n int modifiers = pluginClass.getModifiers();\n return !Modifier.isAbstract(modifiers) &&\n !Modifier.isInterface(modifiers) &&\n !Modifier.isPrivate(modifiers);\n }"
] | [
"public boolean doSyncPass() {\n if (!this.isConfigured || !syncLock.tryLock()) {\n return false;\n }\n try {\n if (logicalT == Long.MAX_VALUE) {\n if (logger.isInfoEnabled()) {\n logger.info(\"reached max logical time; resetting back to 0\");\n }\n logicalT = 0;\n ... |
Create a new remote proxy controller.
@param client the transactional protocol client
@param pathAddress the path address
@param addressTranslator the address translator
@param targetKernelVersion the {@link ModelVersion} of the kernel management API exposed by the proxied process
@return the proxy controller | [
"public static RemoteProxyController create(final TransactionalProtocolClient client, final PathAddress pathAddress,\n final ProxyOperationAddressTranslator addressTranslator,\n final ModelVersion targetKernelVersion) {\n ... | [
"public static <T> T[] sort(T[] self, Comparator<T> comparator) {\n return sort(self, true, comparator);\n }",
"public Collection<String> getMethods() throws FlickrException {\r\n Map<String, Object> parameters = new HashMap<String, Object>();\r\n parameters.put(\"method\", METHOD_GET_METH... |
Start the drag of the pivot object.
@param dragMe Scene object with a rigid body.
@param relX rel position in x-axis.
@param relY rel position in y-axis.
@param relZ rel position in z-axis.
@return Pivot instance if success, otherwise returns null. | [
"public GVRSceneObject startDrag(GVRSceneObject dragMe, float relX, float relY, float relZ) {\n synchronized (mLock) {\n if (mCursorController == null) {\n Log.w(TAG, \"Physics drag failed: Cursor controller not found!\");\n return null;\n }\n\n ... | [
"public PhotoList<Photo> getClusterPhotos(String tag, String clusterId) throws FlickrException {\n\n PhotoList<Photo> photos = new PhotoList<Photo>();\n Map<String, Object> parameters = new HashMap<String, Object>();\n parameters.put(\"method\", METHOD_GET_CLUSTER_PHOTOS);\n\n parameters... |
Use this API to fetch lbvserver_cachepolicy_binding resources of given name . | [
"public static lbvserver_cachepolicy_binding[] get(nitro_service service, String name) throws Exception{\n\t\tlbvserver_cachepolicy_binding obj = new lbvserver_cachepolicy_binding();\n\t\tobj.set_name(name);\n\t\tlbvserver_cachepolicy_binding response[] = (lbvserver_cachepolicy_binding[]) obj.get_resources(service)... | [
"public static String getAt(String text, Range range) {\n RangeInfo info = subListBorders(text.length(), range);\n String answer = text.substring(info.from, info.to);\n if (info.reverse) {\n answer = reverse(answer);\n }\n return answer;\n }",
"public String read(i... |
Start the operation by instantiating the first job instance in a separate Thread.
@param arguments {@inheritDoc} | [
"@Override\n public void start(String[] arguments) {\n boolean notStarted = !started.getAndSet(true);\n if (notStarted) {\n start(new MultiInstanceWorkloadStrategy(factory, name, arguments, endpointRegistry, execService));\n }\n }"
] | [
"public static boolean isAssignableFrom(TypeReference<?> from, TypeReference<?> to) {\n\t\tif (from == null) {\n\t\t\treturn false;\n\t\t}\n\n\t\tif (to.equals(from)) {\n\t\t\treturn true;\n\t\t}\n\n\t\tif (to.getType() instanceof Class) {\n\t\t\treturn to.getRawType().isAssignableFrom(from.getRawType());\n\t\t} el... |
Deletes a FilePath file.
@param workspace The build workspace.
@param path The path in the workspace.
@throws IOException In case of missing file. | [
"public static void deleteFilePath(FilePath workspace, String path) throws IOException {\n if (StringUtils.isNotBlank(path)) {\n try {\n FilePath propertiesFile = new FilePath(workspace, path);\n propertiesFile.delete();\n } catch (Exception e) {\n ... | [
"protected void parseCombineIntegerLists(TokenList tokens) {\n TokenList.Token t = tokens.getFirst();\n if( t == null || t.next == null )\n return;\n\n int numFound = 0;\n\n TokenList.Token start = null;\n TokenList.Token end = null;\n\n while( t != null ) {\n ... |
Compute the offset for the item in the layout based on the offsets of neighbors
in the layout. The other offsets are not patched. If neighbors offsets have not
been computed the offset of the item will not be set.
@return true if the item fits the container, false otherwise | [
"protected boolean computeOffset(CacheDataSet cache) {\n // offset computation: update offset for all items in the cache\n float startDataOffset = getStartingOffset((cache.getTotalSizeWithPadding()));\n float layoutOffset = getLayoutOffset();\n\n boolean inBounds = startDataOffset < -lay... | [
"public static ModelNode getAccessControl(ModelControllerClient client, OperationRequestAddress address, boolean operations) {\n return getAccessControl(client, null, address, operations);\n }",
"public static void acceptsHex(OptionParser parser) {\n parser.acceptsAll(Arrays.asList(OPT_X, OPT_HEX... |
Takes the specified object and converts the argument to a String.
@param arg The object to convert
@return A String representation of the argument. | [
"protected String getArgString(Object arg) {\n //if (arg instanceof LatLong) {\n // return ((LatLong) arg).getVariableName();\n //} else \n if (arg instanceof JavascriptObject) {\n return ((JavascriptObject) arg).getVariableName();\n // return ((JavascriptObject)... | [
"public boolean getFlag(int index)\n {\n return BooleanHelper.getBoolean((Boolean) getCachedValue(selectField(ResourceFieldLists.CUSTOM_FLAG, index)));\n }",
"public static TaskField getMpxjField(int value)\n {\n TaskField result = null;\n\n if (value >= 0 && value < MPX_MPXJ_ARRAY.length)\n ... |
Get the filters ExporterServiceFilter and ExportDeclarationFilter from the properties, stop the instance if one of.
them is invalid. | [
"private void processProperties() {\n state = true;\n try {\n exporterServiceFilter = getFilter(exporterServiceFilterProperty);\n } catch (InvalidFilterException invalidFilterException) {\n LOG.debug(\"The value of the Property \" + FILTER_EXPORTERSERVICE_PROPERTY + \" is ... | [
"private HashMap<String, StoreDefinition> makeStoreDefinitionMap(List<StoreDefinition> storeDefs) {\n HashMap<String, StoreDefinition> storeDefMap = new HashMap<String, StoreDefinition>();\n for(StoreDefinition storeDef: storeDefs)\n storeDefMap.put(storeDef.getName(), storeDef);\n r... |
returns a sorted array of properties | [
"public GroovyFieldDoc[] properties() {\n Collections.sort(properties);\n return properties.toArray(new GroovyFieldDoc[properties.size()]);\n }"
] | [
"public String getKeyValue(String key){\n String keyName = keysMap.get(key);\n if (keyName != null){\n return keyName;\n }\n return \"\"; //key wasn't defined in keys properties file\n }",
"@Override\n public void setJobQueue(int jobId, Queue queue)\n {\n Jqm... |
Use this API to delete locationfile. | [
"public static base_response delete(nitro_service client) throws Exception {\n\t\tlocationfile deleteresource = new locationfile();\n\t\treturn deleteresource.delete_resource(client);\n\t}"
] | [
"private void lockLocalization(Locale l) throws CmsException {\n\n if (null == m_lockedBundleFiles.get(l)) {\n LockedFile lf = LockedFile.lockResource(m_cms, m_bundleFiles.get(l));\n m_lockedBundleFiles.put(l, lf);\n }\n\n }",
"public static URL asUrlOrResource(String s) {\n... |
Given the comma separated list of properties as a string, splits it
multiple strings
@param paramValue Concatenated string
@param type Type of parameter ( to throw exception )
@return List of string properties | [
"public static List<String> getCommaSeparatedStringValues(String paramValue, String type) {\n List<String> commaSeparatedProps = Lists.newArrayList();\n for(String url: Utils.COMMA_SEP.split(paramValue.trim()))\n if(url.trim().length() > 0)\n commaSeparatedProps.add(url);\n\n... | [
"public EventBus emit(String event, Object... args) {\n return _emitWithOnceBus(eventContext(event, args));\n }",
"public B importContext(AbstractContext context, boolean overwriteDuplicates){\n for (Map.Entry<String, Object> en : context.data.entrySet()) {\n if (overwriteDuplicates) {... |
Use this API to fetch dospolicy resource of given name . | [
"public static dospolicy get(nitro_service service, String name) throws Exception{\n\t\tdospolicy obj = new dospolicy();\n\t\tobj.set_name(name);\n\t\tdospolicy response = (dospolicy) obj.get_resource(service);\n\t\treturn response;\n\t}"
] | [
"public void seekToSeasonYear(String seasonString, String yearString) {\n Season season = Season.valueOf(seasonString);\n assert(season != null);\n \n seekToIcsEventYear(SEASON_ICS_FILE, yearString, season.getSummary());\n }",
"public void setIssueTrackerInfo(BuildInfoBuilder builder) {\n Issu... |
Use this API to delete onlinkipv6prefix of given name. | [
"public static base_response delete(nitro_service client, String ipv6prefix) throws Exception {\n\t\tonlinkipv6prefix deleteresource = new onlinkipv6prefix();\n\t\tdeleteresource.ipv6prefix = ipv6prefix;\n\t\treturn deleteresource.delete_resource(client);\n\t}"
] | [
"public OperationTransformerEntry resolveOperationTransformer(final PathAddress address, final String operationName, PlaceholderResolver placeholderResolver) {\n final Iterator<PathElement> iterator = address.iterator();\n final OperationTransformerEntry entry = resolveOperationTransformer(iterator, o... |
Read the metadata from a hadoop SequenceFile
@param fs The filesystem to read from
@param path The file to read from
@return The metadata from this file | [
"public static Map<String, String> getMetadataFromSequenceFile(FileSystem fs, Path path) {\n try {\n Configuration conf = new Configuration();\n conf.setInt(\"io.file.buffer.size\", 4096);\n SequenceFile.Reader reader = new SequenceFile.Reader(fs, path, new Configuration());\... | [
"public ArtifactName build() {\n String groupId = this.groupId;\n String artifactId = this.artifactId;\n String classifier = this.classifier;\n String packaging = this.packaging;\n String version = this.version;\n if (artifact != null && !artifact.isEmpty()) {\n ... |
Creates a bridge accessory, capable of holding multiple child accessories. This has the
advantage over multiple standalone accessories of only requiring a single pairing from iOS for
the bridge.
@param authInfo authentication information for this accessory. These values should be persisted
and re-supplied on re-start ... | [
"public HomekitRoot createBridge(\n HomekitAuthInfo authInfo,\n String label,\n String manufacturer,\n String model,\n String serialNumber)\n throws IOException {\n HomekitRoot root = new HomekitRoot(label, http, localAddress, authInfo);\n root.addAccessory(new HomekitBridge(labe... | [
"protected AbsoluteURI getGeneratedLocation(PersistedTrace trace) {\n\t\tAbsoluteURI path = trace.getPath();\n\t\tString fileName = traceFileNameProvider.getJavaFromTrace(path.getURI().toString());\n\t\treturn new AbsoluteURI(fileName);\n\t}",
"public FluoMutationGenerator put(Column col, CharSequence value) {\n ... |
Updates the path_order column in the table, loops though the pathOrder array, and changes the value to the loop
index+1 for the specified pathId
@param profileId ID of profile
@param pathOrder array containing new order of paths | [
"public void updatePathOrder(int profileId, int[] pathOrder) {\n for (int i = 0; i < pathOrder.length; i++) {\n EditService.updatePathTable(Constants.PATH_PROFILE_PATH_ORDER, (i + 1), pathOrder[i]);\n }\n }"
] | [
"private LinkedList<TimephasedWork> readTimephasedAssignment(ProjectCalendar calendar, Project.Assignments.Assignment assignment, int type)\n {\n LinkedList<TimephasedWork> result = new LinkedList<TimephasedWork>();\n\n for (TimephasedDataType item : assignment.getTimephasedData())\n {\n if... |
Send ourselves "updates" about any tracks that were loaded before we started, since we missed them. | [
"private void checkExistingTracks() {\n SwingUtilities.invokeLater(new Runnable() {\n @Override\n public void run() {\n for (Map.Entry<DeckReference, TrackMetadata> entry : MetadataFinder.getInstance().getLoadedTracks().entrySet()) {\n if (entry.getKey(... | [
"boolean lock(final Integer permit, final long timeout, final TimeUnit unit) {\n boolean result = false;\n try {\n result = lockInterruptibly(permit, timeout, unit);\n } catch (InterruptedException e) {\n Thread.currentThread().interrupt();\n }\n return resul... |
Request a scoped transactional token.
@param accessToken application access token.
@param scope scope of transactional token.
@return a BoxAPIConnection which can be used to perform transactional requests. | [
"public static BoxAPIConnection getTransactionConnection(String accessToken, String scope) {\n return BoxTransactionalAPIConnection.getTransactionConnection(accessToken, scope, null);\n }"
] | [
"public void addPartialFieldAssignment(\n SourceBuilder code, Excerpt finalField, String builder) {\n addFinalFieldAssignment(code, finalField, builder);\n }",
"public int getGeoPerms() throws FlickrException {\r\n Map<String, Object> parameters = new HashMap<String, Object>();\r\n paramete... |
Use this API to renumber nspbr6. | [
"public static base_response renumber(nitro_service client) throws Exception {\n\t\tnspbr6 renumberresource = new nspbr6();\n\t\treturn renumberresource.perform_operation(client,\"renumber\");\n\t}"
] | [
"public static Platform detect() throws UnsupportedPlatformException {\n String osArch = getProperty(\"os.arch\");\n String osName = getProperty(\"os.name\");\n\n for (Arch arch : Arch.values()) {\n if (arch.pattern.matcher(osArch).matches()) {\n for (OS os : OS.values... |
Processes a procedure tag.
@param template The template
@param attributes The attributes of the tag
@exception XDocletException If an error occurs
@doc.tag type="content"
@doc.param name="arguments" optional="true" description="The arguments of the procedu... | [
"public String processProcedure(Properties attributes) throws XDocletException\r\n {\r\n String type = attributes.getProperty(ATTRIBUTE_TYPE);\r\n ProcedureDef procDef = _curClassDef.getProcedure(type);\r\n String attrName;\r\n\r\n if (procDef == null)\r\n { \... | [
"public void addRow(Component component) {\n\n Component actualComponent = component == null ? m_newComponentFactory.get() : component;\n I_CmsEditableGroupRow row = m_rowBuilder.buildRow(this, actualComponent);\n m_container.addComponent(row);\n updatePlaceholder();\n updateButto... |
Returns a unique file name
@param baseFileName the requested base name for the file
@param extension the requested extension for the file
@param cleanBaseFileName specify if the <code>baseFileName</code> has to be cleaned before being used (i.e. 'jboss-web' should not be cleaned to avoid '-' to become '_')
@param ances... | [
"public String getUniqueFilename(String baseFileName, String extension, boolean cleanBaseFileName, String... ancestorFolders)\n {\n if (cleanBaseFileName)\n {\n baseFileName = PathUtil.cleanFileName(baseFileName);\n }\n\n if (ancestorFolders != null)\n {\n ... | [
"static Type parseType(String value, ResourceLoader resourceLoader) {\n value = value.trim();\n // Wildcards\n if (value.equals(WILDCARD)) {\n return WildcardTypeImpl.defaultInstance();\n }\n if (value.startsWith(WILDCARD_EXTENDS)) {\n Type upperBound = parse... |
Start timing an operation with the given identifier. | [
"public void begin(String key)\n {\n if (key == null)\n {\n return;\n }\n TimingData data = executionInfo.get(key);\n if (data == null)\n {\n data = new TimingData(key);\n executionInfo.put(key, data);\n }\n data.begin();\n ... | [
"public static int cudnnPoolingBackward(\n cudnnHandle handle, \n cudnnPoolingDescriptor poolingDesc, \n Pointer alpha, \n cudnnTensorDescriptor yDesc, \n Pointer y, \n cudnnTensorDescriptor dyDesc, \n Pointer dy, \n cudnnTensorDescriptor xDesc, \n Poin... |
Loads the rules from files in the class loader, often jar files.
@return the list of loaded rules, not null
@throws Exception if an error occurs | [
"private static Data loadLeapSeconds() {\n Data bestData = null;\n URL url = null;\n try {\n // this is the new location of the file, working on Java 8, Java 9 class path and Java 9 module path\n Enumeration<URL> en = Thread.currentThread().getContextClassLoader().getResou... | [
"private FieldDescriptor[] getExtentFieldDescriptors(TableAlias extAlias, FieldDescriptor[] fds)\r\n {\r\n FieldDescriptor[] result = new FieldDescriptor[fds.length];\r\n\r\n for (int i = 0; i < fds.length; i++)\r\n {\r\n result[i] = extAlias.cld.getFieldDescriptorByName(fds[i].ge... |
FOR internal use. This method was called before the external transaction was completed.
This method was called by the JTA-TxManager before the JTA-tx prepare call. Within this method
we prepare odmg for commit and pass all modified persistent objects to DB and release/close the used
connection. We have to close the co... | [
"public void beforeCompletion()\r\n {\r\n // avoid redundant calls\r\n if(beforeCompletionCall) return;\r\n\r\n log.info(\"Method beforeCompletion was called\");\r\n int status = Status.STATUS_UNKNOWN;\r\n try\r\n {\r\n JTATxManager mgr = (JTATxManager) getImp... | [
"private List<File> getConfigFiles() {\n\n String[] filenames = {\n \"opencms-modules.xml\",\n \"opencms-system.xml\",\n \"opencms-vfs.xml\",\n \"opencms-importexport.xml\",\n \"opencms-sites.xml\",\n \"opencms-variables.xml\",\n \"... |
The CommandContext can be retrieved thatnks to the ExecutableBuilder. | [
"void execute(ExecutableBuilder builder,\n int timeout,\n TimeUnit unit) throws\n CommandLineException,\n InterruptedException, ExecutionException, TimeoutException {\n Future<Void> task = executorService.submit(() -> {\n builder.build().execute();\n ... | [
"public static tunneltrafficpolicy[] get(nitro_service service, options option) throws Exception{\n\t\ttunneltrafficpolicy obj = new tunneltrafficpolicy();\n\t\ttunneltrafficpolicy[] response = (tunneltrafficpolicy[])obj.get_resources(service,option);\n\t\treturn response;\n\t}",
"public void fillTile(InternalTil... |
This method will add a DemoInterceptor into every in and every out phase
of the interceptor chains.
@param provider | [
"public static void addInterceptors(InterceptorProvider provider) {\n PhaseManager phases = BusFactory.getDefaultBus().getExtension(PhaseManager.class);\n for (Phase p : phases.getInPhases()) {\n provider.getInInterceptors().add(new DemoInterceptor(p.getName()));\n provider.getIn... | [
"@SuppressWarnings(\"StringEquality\")\n public static MatchInfo fromAuthScope(final AuthScope authscope) {\n String newScheme = StringUtils.equals(authscope.getScheme(), AuthScope.ANY_SCHEME) ? ANY_SCHEME :\n authscope.getScheme();\n String newHost = StringUtils.equals(authscope.get... |
Sets the currency code, or the regular expression to select codes.
@param codes the currency codes or code expressions, not null.
@return the query for chaining. | [
"public CurrencyQueryBuilder setCurrencyCodes(String... codes) {\n return set(CurrencyQuery.KEY_QUERY_CURRENCY_CODES, Arrays.asList(codes));\n }"
] | [
"public AssemblyResponse save(boolean isResumable)\n throws RequestException, LocalOperationException {\n Request request = new Request(getClient());\n options.put(\"steps\", steps.toMap());\n\n // only do tus uploads if files will be uploaded\n if (isResumable && getFilesCoun... |
Assign FK value of main object with PK values of the reference object.
@param obj real object with reference (proxy) object (or real object with set FK values on insert)
@param cld {@link ClassDescriptor} of the real object
@param rds An {@link ObjectReferenceDescriptor} of real object.
@param insert Show if "linking"... | [
"public void linkOneToOne(Object obj, ClassDescriptor cld, ObjectReferenceDescriptor rds, boolean insert)\n {\n storeAndLinkOneToOne(true, obj, cld, rds, true);\n }"
] | [
"public PartialCollection<BoxItem.Info> searchRange(long offset, long limit, final BoxSearchParameters bsp) {\n QueryStringBuilder builder = bsp.getQueryParameters()\n .appendParam(\"limit\", limit)\n .appendParam(\"offset\", offset);\n URL url = SEARCH_URL_TEMPLATE.build... |
Sets up internal data structures and creates a copy of the input matrix.
@param A The input matrix. Not modified. | [
"protected void init(DMatrixRMaj A ) {\n UBV = A;\n\n m = UBV.numRows;\n n = UBV.numCols;\n\n min = Math.min(m,n);\n int max = Math.max(m,n);\n\n if( b.length < max+1 ) {\n b = new double[ max+1 ];\n u = new double[ max+1 ];\n }\n if( gam... | [
"private static <T> void writeConfig(BufferedWriter writer, DatabaseTableConfig<T> config) throws IOException,\n\t\t\tSQLException {\n\t\twriter.append(CONFIG_FILE_START_MARKER);\n\t\twriter.newLine();\n\t\tif (config.getDataClass() != null) {\n\t\t\twriter.append(FIELD_NAME_DATA_CLASS).append('=').append(config.ge... |
Use this API to fetch a vpnglobal_appcontroller_binding resources. | [
"public static vpnglobal_appcontroller_binding[] get(nitro_service service) throws Exception{\n\t\tvpnglobal_appcontroller_binding obj = new vpnglobal_appcontroller_binding();\n\t\tvpnglobal_appcontroller_binding response[] = (vpnglobal_appcontroller_binding[]) obj.get_resources(service);\n\t\treturn response;\n\t}... | [
"private void debugLogStart(String operationType,\n Long originTimeInMS,\n Long requestReceivedTimeInMs,\n String keyString) {\n long durationInMs = requestReceivedTimeInMs - originTimeInMS;\n logger.debug(\"Rece... |
try to find a field in class c, recurse through class hierarchy if necessary
@throws NoSuchFieldException if no Field was found into the class hierarchy | [
"private Field getFieldRecursive(Class c, String name) throws NoSuchFieldException\r\n {\r\n try\r\n {\r\n return c.getDeclaredField(name);\r\n }\r\n catch (NoSuchFieldException e)\r\n {\r\n // if field could not be found in the inheritance hierarchy, sig... | [
"private LinkedList<TimephasedWork> readTimephasedAssignment(ProjectCalendar calendar, Project.Assignments.Assignment assignment, int type)\n {\n LinkedList<TimephasedWork> result = new LinkedList<TimephasedWork>();\n\n for (TimephasedDataType item : assignment.getTimephasedData())\n {\n if... |
Returns the class of datatype URI that best characterizes the range of
the given property based on its datatype.
@param propertyIdValue
the property for which to get a range
@return the range URI or null if the datatype could not be identified. | [
"String getRangeUri(PropertyIdValue propertyIdValue) {\n\t\tString datatype = this.propertyRegister\n\t\t\t\t.getPropertyType(propertyIdValue);\n\n\t\tif (datatype == null)\n\t\t\treturn null;\n\n\t\tswitch (datatype) {\n\t\tcase DatatypeIdValue.DT_MONOLINGUAL_TEXT:\n\t\t\tthis.rdfConversionBuffer.addDatatypeProper... | [
"public static void dumpMaterial(AiMaterial material) {\n for (AiMaterial.Property prop : material.getProperties()) {\n dumpMaterialProperty(prop);\n }\n }",
"public static base_responses update(nitro_service client, clusternodegroup resources[]) throws Exception {\n\t\tbase_responses ... |
Recycle all views in the list. The host views might be reused for other data to
save resources on creating new widgets. | [
"protected void recycleChildren() {\n for (ListItemHostWidget host: getAllHosts()) {\n recycle(host);\n }\n mContent.onTransformChanged();\n mContent.requestLayout();\n }"
] | [
"public int getCrossZonePartitionStoreMoves() {\n int xzonePartitionStoreMoves = 0;\n for (RebalanceTaskInfo info : batchPlan) {\n Node donorNode = finalCluster.getNodeById(info.getDonorId());\n Node stealerNode = finalCluster.getNodeById(info.getStealerId());\n\n if(d... |
BuildInteractiveObjectFromAnchor is a special type of interactive object in that it does not get
built using ROUTE's.
@param anchorSensor is the Sensor that describes the sensor set to an Anchor
@param anchorDestination is either another Viewpoint, url to a web site or another x3d scene | [
"public void BuildInteractiveObjectFromAnchor(Sensor anchorSensor, String anchorDestination) {\n InteractiveObject interactiveObject = new InteractiveObject();\n interactiveObject.setSensor(anchorSensor, anchorDestination);\n interactiveObjects.add(interactiveObject);\n }"
] | [
"private boolean evaluateLogicalOperator(FieldContainer container, Map<GenericCriteriaPrompt, Object> promptValues)\n {\n boolean result = false;\n\n if (m_criteriaList.size() == 0)\n {\n result = true;\n }\n else\n {\n for (GenericCriteria criteria : m_criteriaList)\... |
Parse a string representation of a Boolean value.
XER files sometimes have "N" and "Y" to indicate boolean
@param value string representation
@return Boolean value | [
"private final boolean parseBoolean(String value)\n {\n return value != null && (value.equalsIgnoreCase(\"true\") || value.equalsIgnoreCase(\"y\") || value.equalsIgnoreCase(\"yes\"));\n }"
] | [
"private void beforeBatch(BatchBackend backend) {\n\t\tif ( this.purgeAtStart ) {\n\t\t\t// purgeAll for affected entities\n\t\t\tIndexedTypeSet targetedTypes = searchFactoryImplementor.getIndexedTypesPolymorphic( rootIndexedTypes );\n\t\t\tfor ( IndexedTypeIdentifier type : targetedTypes ) {\n\t\t\t\t// needs do b... |
Resumes a given entry point type;
@param entryPoint The entry point | [
"public synchronized void resumeControlPoint(final String entryPoint) {\n for (ControlPoint ep : entryPoints.values()) {\n if (ep.getEntryPoint().equals(entryPoint)) {\n ep.resume();\n }\n }\n }"
] | [
"public static java.sql.Date rollYears(java.util.Date startDate, int years) {\n return rollDate(startDate, Calendar.YEAR, years);\n }",
"public static List<Number> findIndexValues(Object self, Number startIndex, Closure closure) {\n List<Number> result = new ArrayList<Number>();\n long cou... |
Create a ModelNode representing the operating system the instance is running on.
@return a ModelNode representing the operating system the instance is running on.
@throws OperationFailedException | [
"private ModelNode createOSNode() throws OperationFailedException {\n String osName = getProperty(\"os.name\");\n final ModelNode os = new ModelNode();\n if (osName != null && osName.toLowerCase().contains(\"linux\")) {\n try {\n os.set(GnuLinuxDistribution.discover())... | [
"public void refreshConnection() throws SQLException{\r\n\t\tthis.connection.close(); // if it's still in use, close it.\r\n\t\ttry{\r\n\t\t\tthis.connection = this.pool.obtainRawInternalConnection();\r\n\t\t} catch(SQLException e){\r\n\t\t\tthrow markPossiblyBroken(e);\r\n\t\t}\r\n\t}",
"private void init(Attrib... |
Helper method to get a list of node ids.
@param nodeList | [
"private static List<Integer> stripNodeIds(List<Node> nodeList) {\n List<Integer> nodeidList = new ArrayList<Integer>();\n if(nodeList != null) {\n for(Node node: nodeList) {\n nodeidList.add(node.getId());\n }\n }\n return nodeidList;\n }"
] | [
"public static PacketType validateHeader(DatagramPacket packet, int port) {\n byte[] data = packet.getData();\n\n if (data.length < PACKET_TYPE_OFFSET) {\n logger.warn(\"Packet is too short to be a Pro DJ Link packet; must be at least \" + PACKET_TYPE_OFFSET +\n \" bytes ... |
Returns the JMX connector address of a child process.
@param p the process to which to connect
@param startAgent whether to installed the JMX agent in the target process if not already in place
@return a {@link JMXServiceURL} to the process's MBean server | [
"public static JMXServiceURL getLocalConnectorAddress(Process p, boolean startAgent) {\n return getLocalConnectorAddress(Integer.toString(getPid(p)), startAgent);\n }"
] | [
"public static void addIndex(DBCollection collection, String field, boolean asc, boolean background) {\n int dir = (asc) ? 1 : -1;\n collection.createIndex(new BasicDBObject(field, dir), new BasicDBObject(\"background\", background));\n }",
"public static String unexpandLine(CharSequence self, in... |
Zeros an inner rectangle inside the matrix.
@param A Matrix that is to be modified.
@param row0 Start row.
@param row1 Stop row+1.
@param col0 Start column.
@param col1 Stop column+1. | [
"public static void zero( DMatrixSparseCSC A , int row0, int row1, int col0, int col1 ) {\n for (int col = col1-1; col >= col0; col--) {\n int numRemoved = 0;\n\n int idx0 = A.col_idx[col], idx1 = A.col_idx[col+1];\n for (int i = idx0; i < idx1; i++) {\n int ro... | [
"private void writeAssignmentExtendedAttributes(Project.Assignments.Assignment xml, ResourceAssignment mpx)\n {\n Project.Assignments.Assignment.ExtendedAttribute attrib;\n List<Project.Assignments.Assignment.ExtendedAttribute> extendedAttributes = xml.getExtendedAttribute();\n\n for (AssignmentFie... |
Parses the given Reader for PmdRuleSets.
@return The extracted PmdRuleSet - empty in case of problems, never null. | [
"@Override\n public PmdRuleSet create() {\n final SAXBuilder parser = new SAXBuilder();\n final Document dom;\n try {\n dom = parser.build(source);\n } catch (JDOMException | IOException e) {\n if (messages != null) {\n messages.addErrorText(INVALI... | [
"public static base_responses update(nitro_service client, nsip6 resources[]) throws Exception {\n\t\tbase_responses result = null;\n\t\tif (resources != null && resources.length > 0) {\n\t\t\tnsip6 updateresources[] = new nsip6[resources.length];\n\t\t\tfor (int i=0;i<resources.length;i++){\n\t\t\t\tupdateresource... |
Use this API to fetch all the nsip6 resources that are configured on netscaler. | [
"public static nsip6[] get(nitro_service service) throws Exception{\n\t\tnsip6 obj = new nsip6();\n\t\tnsip6[] response = (nsip6[])obj.get_resources(service);\n\t\treturn response;\n\t}"
] | [
"private void initDescriptor() throws CmsXmlException, CmsException {\n\n if (m_bundleType.equals(CmsMessageBundleEditorTypes.BundleType.DESCRIPTOR)) {\n m_desc = m_resource;\n } else {\n //First try to read from same folder like resource, if it fails use CmsMessageBundleEditorTy... |
Detaches or removes the value from this context.
@param key the key to the attachment.
@param <V> the value type of the attachment.
@return the attachment if found otherwise {@code null}. | [
"public <V> V detach(final AttachmentKey<V> key) {\n assert key != null;\n return key.cast(contextAttachments.remove(key));\n }"
] | [
"private boolean contentEqualsUnchecked(byte[] bytes, int offset, int len) {\n if (length != len) {\n return false;\n }\n\n return compareToUnchecked(bytes, offset, len) == 0;\n }",
"public void recordCheckoutTimeUs(SocketDestination dest, long checkoutTimeUs) {\n if(dest != null) {\n ... |
Returns the compact task records for all tasks with the given tag.
@param tag The tag in which to search for tasks.
@return Request object | [
"public CollectionRequest<Task> findByTag(String tag) {\n \n String path = String.format(\"/tags/%s/tasks\", tag);\n return new CollectionRequest<Task>(this, Task.class, path, \"GET\");\n }"
] | [
"private int decode(Huffman h) throws IOException\n {\n int len; /* current number of bits in code */\n int code; /* len bits being decoded */\n int first; /* first code of length len */\n int count; /* number of codes of length len */\n int index; /* index of first code of length len in ... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.