query stringlengths 7 3.3k | positive listlengths 1 1 | negative listlengths 9 9 |
|---|---|---|
Update an object in the database to change its id to the newId parameter. | [
"public int updateId(DatabaseConnection databaseConnection, T data, ID newId, ObjectCache objectCache)\n\t\t\tthrows SQLException {\n\t\tif (mappedUpdateId == null) {\n\t\t\tmappedUpdateId = MappedUpdateId.build(dao, tableInfo);\n\t\t}\n\t\tint result = mappedUpdateId.execute(databaseConnection, data, newId, object... | [
"public static String encodePathSegment(String segment, String encoding) throws UnsupportedEncodingException {\n\t\treturn HierarchicalUriComponents.encodeUriComponent(segment, encoding, HierarchicalUriComponents.Type.PATH_SEGMENT);\n\t}",
"public String getName()\n {\n GVRSceneObject owner = getOwnerOb... |
Creates a householder reflection.
(I-gamma*v*v')*x = tau*e1
<p>NOTE: Same as cs_house in csparse</p>
@param x (Input) Vector x (Output) Vector v. Modified.
@param xStart First index in X that is to be processed
@param xEnd Last + 1 index in x that is to be processed.
@param gamma (Output) Storage for computed gamma
@... | [
"public static double computeHouseholder(double []x , int xStart , int xEnd , double max , DScalar gamma ) {\n double tau = 0;\n for (int i = xStart; i < xEnd ; i++) {\n double val = x[i] /= max;\n tau += val*val;\n }\n tau = Math.sqrt(tau);\n if( x[xStart] <... | [
"public static List<Map<String, Object>> listify(ObjectMapper mapper, Object source) {\n return (List<Map<String, Object>>) collectify(mapper, source, List.class);\n }",
"public void updateShownOptions(boolean showModeSwitch, boolean showAddKeyOption) {\n\n if (showModeSwitch != m_showModeSwitch)... |
Create an `AppDescriptor` with appName and package name specified
If `appName` is `null` or blank, it will try the following
approach to get app name:
1. check the {@link Version#getArtifactId() artifact id} and use it unless
2. if artifact id is null or empty, then infer app name using {@link AppNameInferer}
@param... | [
"public static AppDescriptor of(String appName, String packageName) {\n String[] packages = packageName.split(S.COMMON_SEP);\n return of(appName, packageName, Version.ofPackage(packages[0]));\n }"
] | [
"@Override\n\tprotected void clearReference(EObject obj, EReference ref) {\n\t\tsuper.clearReference(obj, ref);\n\t\tif (obj.eIsSet(ref) && ref.getEType().equals(XtextPackage.Literals.TYPE_REF)) {\n\t\t\tINode node = NodeModelUtils.getNode((EObject) obj.eGet(ref));\n\t\t\tif (node == null)\n\t\t\t\tobj.eUnset(ref);... |
Merge the source skeleton with this one.
The result will be that this skeleton has all of its
original bones and all the bones in the new skeleton.
@param newSkel skeleton to merge with this one | [
"public void merge(GVRSkeleton newSkel)\n {\n int numBones = getNumBones();\n List<Integer> parentBoneIds = new ArrayList<Integer>(numBones + newSkel.getNumBones());\n List<String> newBoneNames = new ArrayList<String>(newSkel.getNumBones());\n List<Matrix4f> newMatrices = new ArrayLis... | [
"private void onClickAdd() {\n\n if (m_currentLocation.isPresent()) {\n CmsFavoriteEntry entry = m_currentLocation.get();\n List<CmsFavoriteEntry> entries = getEntries();\n entries.add(entry);\n try {\n m_favDao.saveFavorites(entries);\n }... |
Wait for the template resources to come up after the test container has
been started. This allows the test container and the template resources
to come up in parallel. | [
"public void waitForDeployments(@Observes(precedence = -100) AfterStart event, OpenShiftAdapter client,\n CEEnvironmentProcessor.TemplateDetails details, TestClass testClass, CubeOpenShiftConfiguration configuration, OpenShiftClient openshiftClient)\n throws Exception {\n if (testClass == null)... | [
"public static <T> String join(Collection<T> col, String delim) {\n StringBuilder sb = new StringBuilder();\n Iterator<T> iter = col.iterator();\n if (iter.hasNext())\n sb.append(iter.next().toString());\n while (iter.hasNext()) {\n sb.append(delim);\n sb.append(iter.next().toString());\n... |
Use this API to delete cacheselector of given name. | [
"public static base_response delete(nitro_service client, String selectorname) throws Exception {\n\t\tcacheselector deleteresource = new cacheselector();\n\t\tdeleteresource.selectorname = selectorname;\n\t\treturn deleteresource.delete_resource(client);\n\t}"
] | [
"@RequestMapping(value = \"/api/profile/{profileIdentifier}/clients/delete\", method = RequestMethod.POST)\n public\n @ResponseBody\n HashMap<String, Object> deleteClient(Model model,\n @RequestParam(\"profileIdentifier\") String profileIdentifier,\n ... |
Specifies the container object class to be instantiated
@param containerObjectClass
container object class to be instantiated
@return the current builder instance | [
"public DockerContainerObjectBuilder<T> withContainerObjectClass(Class<T> containerObjectClass) {\n if (containerObjectClass == null) {\n throw new IllegalArgumentException(\"container object class cannot be null\");\n }\n this.containerObjectClass = containerObjectClass;\n\n ... | [
"public String format() {\r\n if (getName().equals(\"*\")) {\r\n return \"*\";\r\n }\r\n else {\r\n StringBuilder sb = new StringBuilder();\r\n if (isWeak()) {\r\n sb.append(\"W/\");\r\n }\r\n return sb.append('\"').append(ge... |
Total count of partition-stores moved in this task.
@return number of partition stores moved in this task. | [
"public synchronized int getPartitionStoreMoves() {\n int count = 0;\n for (List<Integer> entry : storeToPartitionIds.values())\n count += entry.size();\n return count;\n }"
] | [
"public void set(final Argument argument) {\n if (argument != null) {\n map.put(argument.getKey(), Collections.singleton(argument));\n }\n }",
"public static ModelNode createRemoveOperation(final ModelNode address, final boolean recursive) {\n final ModelNode op = createRemoveOp... |
Handles reports by consumers
@param name the name of the reporting consumer
@param report the number of lines the consumer has written since last report
@return "exit" if maxScenarios has been reached, "ok" otherwise | [
"public String makeReport(String name, String report) {\n long increment = Long.valueOf(report);\n long currentLineCount = globalLineCounter.addAndGet(increment);\n\n if (currentLineCount >= maxScenarios) {\n return \"exit\";\n } else {\n return \"ok\";\n }\n... | [
"public static <T extends Publisher> T getPublisher(AbstractProject<?, ?> project, Class<T> type) {\n // Search for a publisher of the given type in the project and return it if found:\n T publisher = new PublisherFindImpl<T>().find(project, type);\n if (publisher != null) {\n return... |
Log an audit record of this operation. | [
"void logAuditRecord() {\n trackConfigurationChange();\n if (!auditLogged) {\n try {\n AccessAuditContext accessContext = SecurityActions.currentAccessAuditContext();\n Caller caller = getCaller();\n auditLogger.log(\n isRe... | [
"public static cacheobject[] get(nitro_service service, cacheobject_args args) throws Exception{\n\t\tcacheobject obj = new cacheobject();\n\t\toptions option = new options();\n\t\toption.set_args(nitro_util.object_to_string_withoutquotes(args));\n\t\tcacheobject[] response = (cacheobject[])obj.get_resources(servic... |
Detects if the current browser is a Sony Mylo device.
@return detection of a Sony Mylo device | [
"public boolean detectSonyMylo() {\r\n\r\n if ((userAgent.indexOf(manuSony) != -1)\r\n && ((userAgent.indexOf(qtembedded) != -1) || (userAgent.indexOf(mylocom2) != -1))) {\r\n return true;\r\n }\r\n return false;\r\n }"
] | [
"public DateTimeZone getZone(String id) {\n if (id == null) {\n return null;\n }\n\n Object obj = iZoneInfoMap.get(id);\n if (obj == null) {\n return null;\n }\n\n if (id.equals(obj)) {\n // Load zone data for the first time.\n re... |
Pass the activity you use the drawer in ;)
This is required if you want to set any values by resource
@param activity
@return | [
"public MaterializeBuilder withActivity(Activity activity) {\n this.mRootView = (ViewGroup) activity.findViewById(android.R.id.content);\n this.mActivity = activity;\n return this;\n }"
] | [
"protected String sourceLine(ASTNode node) {\r\n return sourceCode.getLines().get(AstUtil.findFirstNonAnnotationLine(node, sourceCode) - 1);\r\n }",
"@Override\n public Object[] getAgentPlans(String agent_name, Connector connector) {\n // Not supported in JADE\n connector.getLogger().wa... |
get all consumers for the group
@param zkClient the zookeeper client
@param group the group name
@return topic->(consumerIdStringA-0,consumerIdStringA-1...consumerIdStringB-0,consumerIdStringB-1) | [
"public static Map<String, List<String>> getConsumersPerTopic(ZkClient zkClient, String group) {\n ZkGroupDirs dirs = new ZkGroupDirs(group);\n List<String> consumers = getChildrenParentMayNotExist(zkClient, dirs.consumerRegistryDir);\n //\n Map<String, List<String>> consumersPerTopicMap... | [
"void setFilters(Map<Object, Object> filters) {\n\n for (Object column : filters.keySet()) {\n Object filterValue = filters.get(column);\n if ((filterValue != null) && !filterValue.toString().isEmpty() && !m_table.isColumnCollapsed(column)) {\n m_table.setFilterFieldValue... |
If the not a bitmap itself, this will read the file's meta data.
@param resources {@link android.content.Context#getResources()}
@return Point where x = width and y = height | [
"public Point measureImage(Resources resources) {\n BitmapFactory.Options justBoundsOptions = new BitmapFactory.Options();\n justBoundsOptions.inJustDecodeBounds = true;\n\n if (bitmap != null) {\n return new Point(bitmap.getWidth(), bitmap.getHeight());\n } else if (resId != ... | [
"private static boolean hasSelfPermissions(Context context, String... permissions) {\n for (String permission : permissions) {\n if (checkSelfPermission(context, permission) == PackageManager.PERMISSION_GRANTED) {\n return true;\n }\n }\n return false;\n }",
"public Map<Integer, List<Ro... |
Decomposes the input matrix 'a' and makes sure it isn't modified. | [
"public static boolean decomposeSafe(DecompositionInterface<ZMatrixRMaj> decomposition, ZMatrixRMaj a) {\n\n if( decomposition.inputModified() ) {\n a = a.copy();\n }\n return decomposition.decompose(a);\n }"
] | [
"private boolean checkAndSetManifestAndImagePathCandidates(String manifestPath, String candidateImagePath, ArtifactoryDependenciesClient dependenciesClient, TaskListener listener) throws IOException {\n String candidateManifest = getManifestFromArtifactory(dependenciesClient, manifestPath);\n if (cand... |
Use this API to update snmpalarm resources. | [
"public static base_responses update(nitro_service client, snmpalarm resources[]) throws Exception {\n\t\tbase_responses result = null;\n\t\tif (resources != null && resources.length > 0) {\n\t\t\tsnmpalarm updateresources[] = new snmpalarm[resources.length];\n\t\t\tfor (int i=0;i<resources.length;i++){\n\t\t\t\tup... | [
"@Deprecated\n public int getEntityTypeId(@NotNull final String entityType, final boolean allowCreate) {\n return getEntityTypeId(txnProvider, entityType, allowCreate);\n }",
"private void add(int field)\n {\n if (field < m_flags.length)\n {\n if (m_flags[field] == false)\n ... |
Registers your facet filters, adding them to this InstantSearch's widgets.
@param filters a List of facet filters. | [
"@SuppressWarnings({\"WeakerAccess\", \"unused\"}) // For library users\n public void registerFilters(List<AlgoliaFilter> filters) {\n for (final AlgoliaFilter filter : filters) {\n searcher.addFacet(filter.getAttribute());\n }\n }"
] | [
"private JSONObject getJsonFormattedSpellcheckResult(CmsSpellcheckingRequest request) {\n\n final JSONObject response = new JSONObject();\n\n try {\n if (null != request.m_id) {\n response.put(JSON_ID, request.m_id);\n }\n\n response.put(JSON_RESULT, req... |
Send a fader start command to all registered listeners.
@param playersToStart contains the device numbers of all players that should start playing
@param playersToStop contains the device numbers of all players that should stop playing | [
"private void deliverFaderStartCommand(Set<Integer> playersToStart, Set<Integer> playersToStop) {\n for (final FaderStartListener listener : getFaderStartListeners()) {\n try {\n listener.fadersChanged(playersToStart, playersToStop);\n } catch (Throwable t) {\n ... | [
"public void pushDryRun() throws Exception {\n if (releaseAction.isCreateVcsTag()) {\n if (scmManager.isTagExists(scmManager.getRemoteConfig(releaseAction.getTargetRemoteName()), releaseAction.getTagUrl())) {\n throw new Exception(String.format(\"Tag with name '%s' already exists\",... |
Adds OPT_U | OPT_URL option to OptionParser, with multiple arguments.
@param parser OptionParser to be modified
@param required Tells if this option is required or optional | [
"public static void acceptsUrlMultiple(OptionParser parser) {\n parser.acceptsAll(Arrays.asList(OPT_U, OPT_URL), \"coordinator bootstrap urls\")\n .withRequiredArg()\n .describedAs(\"url-list\")\n .withValuesSeparatedBy(',')\n .ofType(String.class);\n }"... | [
"@Override public RendererViewHolder onCreateViewHolder(ViewGroup viewGroup, int viewType) {\n rendererBuilder.withParent(viewGroup);\n rendererBuilder.withLayoutInflater(LayoutInflater.from(viewGroup.getContext()));\n rendererBuilder.withViewType(viewType);\n RendererViewHolder viewHolder = rendererBui... |
Check that the ranges and sizes add up, otherwise we have lost some data somewhere | [
"private void validateSegments(List<LogSegment> segments) {\n synchronized (lock) {\n for (int i = 0; i < segments.size() - 1; i++) {\n LogSegment curr = segments.get(i);\n LogSegment next = segments.get(i + 1);\n if (curr.start() + curr.size() != next.... | [
"@Deprecated\r\n public Category browse(String catId) throws FlickrException {\r\n List<Subcategory> subcategories = new ArrayList<Subcategory>();\r\n List<Group> groups = new ArrayList<Group>();\r\n\r\n Map<String, Object> parameters = new HashMap<String, Object>();\r\n parameters.pu... |
Expands the cluster to include density-reachable items.
@param cluster Cluster to expand
@param point Point to add to cluster
@param neighbors List of neighbors
@param points the data set
@param visited the set of already visited points
@return the expanded cluster | [
"private Cluster expandCluster(final Cluster cluster,\n final Point2D point,\n final List<Point2D> neighbors,\n final KDTree<Point2D> points,\n final Map<Point2D, PointStat... | [
"protected void runScript(File script) {\n if (!script.exists()) {\n JOptionPane.showMessageDialog(cliGuiCtx.getMainPanel(), script.getAbsolutePath() + \" does not exist.\",\n \"Unable to run script.\", JOptionPane.ERROR_MESSAGE);\n return;\n ... |
Called when a payload thread has ended. This also notifies the poller to poll once again. | [
"void releaseResources(JobInstance ji)\n {\n this.peremption.remove(ji.getId());\n this.actualNbThread.decrementAndGet();\n\n for (ResourceManagerBase rm : this.resourceManagers)\n {\n rm.releaseResource(ji);\n }\n\n if (!this.strictPollingPeriod)\n {\n... | [
"@RequestMapping(value = \"/scripts\", method = RequestMethod.GET)\n public String scriptView(Model model) throws Exception {\n return \"script\";\n }",
"public static <T> T buildInstanceForMap(Class<T> clazz, Map<String, Object> values)\n throws InstantiationException, IllegalAccessException, I... |
Save a weak reference to the resource | [
"public void put(GVRAndroidResource androidResource, T resource) {\n Log.d(TAG, \"put resource %s to cache\", androidResource);\n\n super.put(androidResource, resource);\n }"
] | [
"private void checkOrMarkPrivateAccess(Expression source, MethodNode mn) {\n if (mn==null) {\n return;\n }\n ClassNode declaringClass = mn.getDeclaringClass();\n ClassNode enclosingClassNode = typeCheckingContext.getEnclosingClassNode();\n if (declaringClass != enclosin... |
Gets the numeric codes. Setting it to -1 search for currencies that have no numeric code.
@return the query for chaining. | [
"public Collection<Integer> getNumericCodes() {\n Collection<Integer> result = get(KEY_QUERY_NUMERIC_CODES, Collection.class);\n if (result == null) {\n return Collections.emptySet();\n }\n return result;\n }"
] | [
"private Boolean readOptionalBoolean(JSONValue val) {\n\n JSONBoolean b = null == val ? null : val.isBoolean();\n if (b != null) {\n return Boolean.valueOf(b.booleanValue());\n }\n return null;\n }",
"protected Class<?> getPropertyClass(ClassMetadata meta, String property... |
Gets information about this collaboration.
@return info about this collaboration. | [
"public Info getInfo() {\n BoxAPIConnection api = this.getAPI();\n URL url = COLLABORATION_URL_TEMPLATE.build(api.getBaseURL(), this.getID());\n\n BoxAPIRequest request = new BoxAPIRequest(api, url, \"GET\");\n BoxJSONResponse response = (BoxJSONResponse) request.send();\n JsonObj... | [
"public void setTimeWarp(String l) {\n\n long warp = CmsContextInfo.CURRENT_TIME;\n try {\n warp = Long.parseLong(l);\n } catch (NumberFormatException e) {\n // if parsing the time warp fails, it will be set to -1 (i.e. disabled)\n }\n m_settings.setTimeWarp(... |
Tries to load a the bundle for a given locale, also loads the backup
locales with the same language.
@param baseName the raw bundle name, without locale qualifiers
@param locale the locale
@param wantBase whether a resource bundle made only from the base name
(with no locale information attached) should be returned.
@... | [
"private static ResourceBundle tryBundle(String baseName, Locale locale, boolean wantBase) {\n\n I_CmsResourceBundle first = null; // The most specialized bundle.\n I_CmsResourceBundle last = null; // The least specialized bundle.\n\n List<String> bundleNames = CmsLocaleManager.getLocaleVariant... | [
"public void register(Delta delta) {\n\t\tfinal IResourceDescription newDesc = delta.getNew();\n\t\tif (newDesc == null) {\n\t\t\tremoveDescription(delta.getUri());\n\t\t} else {\n\t\t\taddDescription(delta.getUri(), newDesc);\n\t\t}\n\t}",
"public void processCalendar(Row row)\n {\n ProjectCalendar calend... |
Sets the indirection handler class.
@param indirectionHandlerClass The class for indirection handlers | [
"public void setIndirectionHandlerClass(Class indirectionHandlerClass)\r\n {\r\n if(indirectionHandlerClass == null)\r\n {\r\n //throw new MetadataException(\"No IndirectionHandlerClass specified.\");\r\n /**\r\n * andrew.clute\r\n * Allow the default I... | [
"public static sslaction get(nitro_service service, String name) throws Exception{\n\t\tsslaction obj = new sslaction();\n\t\tobj.set_name(name);\n\t\tsslaction response = (sslaction) obj.get_resource(service);\n\t\treturn response;\n\t}",
"private static void handlePing(final Channel channel, final ManagementPro... |
Extracts the elements from the source matrix by their 1D index.
@param src Source matrix. Not modified.
@param indexes array of row indexes
@param length maximum element in row array
@param dst output matrix. Must be a vector of the correct length. | [
"public static void extract(DMatrixRMaj src, int indexes[] , int length , DMatrixRMaj dst ) {\n if( !MatrixFeatures_DDRM.isVector(dst))\n throw new MatrixDimensionException(\"Dst must be a vector\");\n if( length != dst.getNumElements())\n throw new MatrixDimensionException(\"Une... | [
"@SuppressWarnings({\"unused\", \"WeakerAccess\"})\n public void recordScreen(String screenName){\n if(screenName == null || (!currentScreenName.isEmpty() && currentScreenName.equals(screenName))) return;\n getConfigLogger().debug(getAccountId(), \"Screen changed to \" + screenName);\n curre... |
Creates the main component of the editor with all sub-components.
@return the completely filled main component of the editor.
@throws IOException thrown if setting the table's content data source fails.
@throws CmsException thrown if setting the table's content data source fails. | [
"private Component createMainComponent() throws IOException, CmsException {\n\n VerticalLayout mainComponent = new VerticalLayout();\n mainComponent.setSizeFull();\n mainComponent.addStyleName(\"o-message-bundle-editor\");\n m_table = createTable();\n Panel navigator = new Panel()... | [
"private void setup(DMatrixRBlock orig) {\n blockLength = orig.blockLength;\n dataW.blockLength = blockLength;\n dataWTA.blockLength = blockLength;\n\n this.dataA = orig;\n A.original = dataA;\n\n int l = Math.min(blockLength,orig.numCols);\n dataW.reshape(orig.numRo... |
Returns the RPC service for serial dates.
@return the RPC service for serial dates. | [
"I_CmsSerialDateServiceAsync getService() {\r\n\r\n if (SERVICE == null) {\r\n SERVICE = GWT.create(I_CmsSerialDateService.class);\r\n String serviceUrl = CmsCoreProvider.get().link(\"org.opencms.ade.contenteditor.CmsSerialDateService.gwt\");\r\n ((ServiceDefTarget)SERVICE).s... | [
"public static base_response unset(nitro_service client, cmpparameter resource, String[] args) throws Exception{\n\t\tcmpparameter unsetresource = new cmpparameter();\n\t\treturn unsetresource.unset_resource(client,args);\n\t}",
"private void processUDF(UDFTypeType udf)\n {\n FieldTypeClass fieldType = FIE... |
Copies information between specified streams and then closes
both of the streams.
@throws java.io.IOException | [
"public static void copyThenClose(InputStream input, OutputStream output)\r\n throws IOException {\r\n copy(input, output);\r\n input.close();\r\n output.close();\r\n }"
] | [
"private void handleTextWebSocketFrameInternal(TextWebSocketFrame frame, ChannelHandlerContext ctx) {\n\t\tif (logger.isTraceEnabled()) {\n\t\t\tlogger.trace(String.format(\"%s received %s\", ctx.channel(), frame.text()));\n\t\t}\n\n\t\taddTraceForFrame(frame, \"text\");\n\t\tctx.channel().write(new TextWebSocketFr... |
Prints the URL of a thumbnail for the given item document to the output,
or a default image if no image is given for the item.
@param out
the output to write to
@param itemDocument
the document that may provide the image information | [
"private void printImage(PrintStream out, ItemDocument itemDocument) {\n\t\tString imageFile = null;\n\n\t\tif (itemDocument != null) {\n\t\t\tfor (StatementGroup sg : itemDocument.getStatementGroups()) {\n\t\t\t\tboolean isImage = \"P18\".equals(sg.getProperty().getId());\n\t\t\t\tif (!isImage) {\n\t\t\t\t\tcontin... | [
"private I_CmsFacetQueryItem parseFacetQueryItem(final String prefix) {\n\n I_CmsXmlContentValue query = m_xml.getValue(prefix + XML_ELEMENT_QUERY_FACET_QUERY_QUERY, m_locale);\n if (null != query) {\n String queryString = query.getStringValue(null);\n I_CmsXmlContentValue label ... |
Calculates the bounds of the non-transparent parts of the given image.
@param p the image
@return the bounds of the non-transparent area | [
"public static Rectangle getSelectedBounds(BufferedImage p) {\n\t\tint width = p.getWidth();\n int height = p.getHeight();\n\t\tint maxX = 0, maxY = 0, minX = width, minY = height;\n\t\tboolean anySelected = false;\n\t\tint y1;\n\t\tint [] pixels = null;\n\t\t\n\t\tfor (y1 = height-1; y1 >= 0; y1--) {\n\t\t\... | [
"@Override\n public int add(DownloadRequest request) throws IllegalArgumentException {\n checkReleased(\"add(...) called on a released ThinDownloadManager.\");\n if (request == null) {\n throw new IllegalArgumentException(\"DownloadRequest cannot be null\");\n }\n return mR... |
Use this API to add snmpmanager resources. | [
"public static base_responses add(nitro_service client, snmpmanager resources[]) throws Exception {\n\t\tbase_responses result = null;\n\t\tif (resources != null && resources.length > 0) {\n\t\t\tsnmpmanager addresources[] = new snmpmanager[resources.length];\n\t\t\tfor (int i=0;i<resources.length;i++){\n\t\t\t\tad... | [
"private void createFrameset(File outputDirectory) throws Exception\n {\n VelocityContext context = createContext();\n generateFile(new File(outputDirectory, INDEX_FILE),\n INDEX_FILE + TEMPLATE_EXTENSION,\n context);\n }",
"private void removeXmlBundleF... |
Retrieve the dir pointed to by 'latest' symbolic-link or the current
version dir
@return Current version directory, else null | [
"public static File getCurrentVersion(File storeDirectory) {\n File latestDir = getLatestDir(storeDirectory);\n if(latestDir != null)\n return latestDir;\n\n File[] versionDirs = getVersionDirs(storeDirectory);\n if(versionDirs == null || versionDirs.length == 0) {\n ... | [
"public void startTask(int id, String taskName) {\n if (isActivated) {\n durations.add(new Duration(id, taskName, BenchmarkUtil.elapsedRealTimeNanos()));\n }\n }",
"@Override\n @Deprecated\n public List<CardWithActions> getBoardMemberActivity(String boardId, String memberId,\n ... |
Return the Payload attached to the current active bucket for |test|.
Always returns a payload so the client doesn't crash on a malformed
test definition.
@param testName test name
@return pay load attached to the current active bucket
@deprecated Use {@link #getPayload(String, Bucket)} instead | [
"@Nonnull\n protected Payload getPayload(final String testName) {\n // Get the current bucket.\n final TestBucket testBucket = buckets.get(testName);\n\n // Lookup Payloads for this test\n if (testBucket != null) {\n final Payload payload = testBucket.getPayload();\n ... | [
"public Task add()\n {\n Task task = new Task(m_projectFile, (Task) null);\n add(task);\n m_projectFile.getChildTasks().add(task);\n return task;\n }",
"public final void save(final PrintJobStatusExtImpl entry) {\n getSession().merge(entry);\n getSession().flush();\n g... |
Generate random time stamps from the current time upto the next one second.
Passed as texture coordinates to the vertex shader; an unused field is present
with every pair passed.
@param totalTime
@return | [
"private float[] generateParticleTimeStamps(float totalTime)\n {\n float timeStamps[] = new float[mEmitRate * 2];\n\n if ( burstMode ) {\n for (int i = 0; i < mEmitRate * 2; i += 2) {\n timeStamps[i] = totalTime;\n timeStamps[i + 1] = 0;\n }\n ... | [
"public static String regexFindFirst(String pattern, String str) {\n return regexFindFirst(Pattern.compile(pattern), str, 1);\n }",
"public static wisite_binding get(nitro_service service, String sitepath) throws Exception{\n\t\twisite_binding obj = new wisite_binding();\n\t\tobj.set_sitepath(sitepath);\n\t\t... |
Perform the merge
@param stereotypeAnnotations The stereotype annotations | [
"protected void merge(Set<Annotation> stereotypeAnnotations) {\n final MetaAnnotationStore store = manager.getServices().get(MetaAnnotationStore.class);\n for (Annotation stereotypeAnnotation : stereotypeAnnotations) {\n // Retrieve and merge all metadata from stereotypes\n Stere... | [
"@Nullable\n\tpublic Import find(@Nonnull final String typeName) {\n\t\tCheck.notEmpty(typeName, \"typeName\");\n\t\tImport ret = null;\n\t\tfinal Type type = new Type(typeName);\n\t\tfor (final Import imp : imports) {\n\t\t\tif (imp.getType().getName().equals(type.getName())) {\n\t\t\t\tret = imp;\n\t\t\t\tbreak;\... |
Filter out interceptors and decorators which are also enabled globally.
@param enabledClasses
@param globallyEnabledClasses
@param logMessageCallback
@param deployment
@return the filtered list | [
"private <T> List<Class<?>> filter(List<Class<?>> enabledClasses, List<Class<?>> globallyEnabledClasses, LogMessageCallback logMessageCallback,\n BeanDeployment deployment) {\n for (Iterator<Class<?>> iterator = enabledClasses.iterator(); iterator.hasNext(); ) {\n Class<?> enabledClass ... | [
"public CliCommandBuilder setTimeout(final int timeout) {\n if (timeout > 0) {\n addCliArgument(CliArgument.TIMEOUT, Integer.toString(timeout));\n } else {\n addCliArgument(CliArgument.TIMEOUT, null);\n }\n return this;\n }",
"public int[] getTenors(int moneyne... |
Removes a value from the list.
@param list the list
@param value value to remove | [
"public static void removeFromList(List<String> list, String value) {\n int foundIndex = -1;\n int i = 0;\n for (String id : list) {\n if (id.equalsIgnoreCase(value)) {\n foundIndex = i;\n break;\n }\n i++;\n }\n if (f... | [
"public static final BigDecimal printCurrency(Number value)\n {\n return (value == null || value.doubleValue() == 0 ? null : new BigDecimal(value.doubleValue() * 100));\n }",
"public void setPerms(String photoId, GeoPermissions perms) throws FlickrException {\r\n Map<String, Object> parameters = n... |
Write the auxiliary RDF data for encoding the given value.
@param value
the value to write
@param resource
the (subject) URI to use to represent this value in RDF
@throws RDFHandlerException | [
"@Override\n\tpublic void writeValue(TimeValue value, Resource resource)\n\t\t\tthrows RDFHandlerException {\n\t\tthis.rdfWriter.writeTripleValueObject(resource, RdfWriter.RDF_TYPE,\n\t\t\t\tRdfWriter.WB_TIME_VALUE);\n\n\t\tthis.rdfWriter.writeTripleValueObject(resource, RdfWriter.WB_TIME,\n\t\t\t\tTimeValueConvert... | [
"protected int adjustIndex(Widget child, int beforeIndex) {\n\n checkIndexBoundsForInsertion(beforeIndex);\n\n // Check to see if this widget is already a direct child.\n if (child.getParent() == this) {\n // If the Widget's previous position was left of the desired new position\n ... |
Retrieve the number of minutes per week for this calendar.
@return minutes per week | [
"public int getMinutesPerWeek()\n {\n return m_minutesPerWeek == null ? NumberHelper.getInt(getParentFile().getProjectProperties().getMinutesPerWeek()) : m_minutesPerWeek.intValue();\n }"
] | [
"private static OkHttpClient getUnsafeOkHttpClient() {\n try {\n // Create a trust manager that does not validate certificate chains\n final TrustManager[] trustAllCerts = new TrustManager[] {\n new X509TrustManager() {\n @Override\n ... |
This is a temporary measure until we have a type-safe solution for
retrieving serializers from a SerializerFactory. It avoids warnings all
over the codebase while making it easy to verify who calls it. | [
"@SuppressWarnings(\"unchecked\")\n public static <T> Serializer<T> unsafeGetSerializer(SerializerFactory serializerFactory,\n SerializerDefinition serializerDefinition) {\n return (Serializer<T>) serializerFactory.getSerializer(serializerDefinition);... | [
"public Float getFloat(String fieldName) {\n\t\ttry {\n\t\t\treturn hasValue(fieldName) ? Float.valueOf(String.valueOf(resultMap.get(fieldName))) : null;\n\t\t} catch (NumberFormatException e) {\n\t\t\tthrow new FqlException(\"Field '\" + fieldName +\"' is not a number.\", e);\n\t\t}\n\t}",
"public static double[... |
Tests whether the given string is the name of a java.lang type. | [
"public static boolean isJavaLangType(String s) {\n\t\treturn getJavaDefaultTypes().contains(s) && Character.isUpperCase(s.charAt(0));\n\t}"
] | [
"public int nextToken() throws IOException\n {\n int c;\n int nextc = -1;\n boolean quoted = false;\n int result = m_next;\n if (m_next != 0)\n {\n m_next = 0;\n }\n\n m_buffer.setLength(0);\n\n while (result == 0)\n {\n if (nextc != -1)\n ... |
Adapt the size of the tiles so that we have the same amount of tiles as we would have had with maxWidth
and maxHeight, but with the smallest tiles as possible. | [
"private static Dimension adaptTileDimensions(\n final Dimension pixels, final int maxWidth, final int maxHeight) {\n return new Dimension(adaptTileDimension(pixels.width, maxWidth),\n adaptTileDimension(pixels.height, maxHeight));\n }"
] | [
"public GeoPolygon addHoles(List<List<GeoPoint>> holes) {\n\t\tContracts.assertNotNull( holes, \"holes\" );\n\t\tthis.rings.addAll( holes );\n\t\treturn this;\n\t}",
"public boolean checkPrefixes(String uri, String[] patterns) {\n\t\tfor (String pattern : patterns) {\n\t\t\tif (pattern.length() > 0) {\n\t\t\t\tif... |
Converts a DTO attribute into a generic attribute object.
@param attribute
The DTO attribute.
@return The server side attribute representation. As we don't know at this point what kind of object the
attribute is (that's a problem for the <code>FeatureModel</code>), we return an <code>Object</code>. | [
"public Object toInternal(Attribute<?> attribute) throws GeomajasException {\n\t\tif (attribute instanceof PrimitiveAttribute<?>) {\n\t\t\treturn toPrimitiveObject((PrimitiveAttribute<?>) attribute);\n\t\t} else if (attribute instanceof AssociationAttribute<?>) {\n\t\t\treturn toAssociationObject((AssociationAttrib... | [
"private static XMLStreamException unexpectedElement(final XMLStreamReader reader) {\n return SecurityManagerLogger.ROOT_LOGGER.unexpectedElement(reader.getName(), reader.getLocation());\n }",
"public void applyPattern(String primaryPattern, String[] alternativePatterns, char decimalSeparator, char grou... |
Creates instance of the entity class. This method is called to create the object
instances when returning query results. | [
"protected T createInstance() {\n try {\n Constructor<T> ctor = clazz.getDeclaredConstructor();\n ctor.setAccessible(true);\n return ctor.newInstance();\n } catch (InstantiationException e) {\n throw new RuntimeException(e);\n } catch (IllegalAccessEx... | [
"public void copyTo(int start, int end, byte[] dest, int destPos) {\n // this.subSequence(start, end).copyTo(dest, destPos) would allocate another Bytes object\n arraycopy(start, dest, destPos, end - start);\n }",
"public synchronized Message menuRequestTyped(Message.KnownType requestType, Message.MenuIden... |
Obtains a string from a PDF value
@param value the PDF value of the String, Integer or Float type
@return the corresponging string value | [
"protected String stringValue(COSBase value)\n {\n if (value instanceof COSString)\n return ((COSString) value).getString();\n else if (value instanceof COSNumber)\n return String.valueOf(((COSNumber) value).floatValue());\n else\n return \"\";\n }"
] | [
"public String isChecked(String value1, String value2) {\n\n if ((value1 == null) || (value2 == null)) {\n return \"\";\n }\n\n if (value1.trim().equalsIgnoreCase(value2.trim())) {\n return \"checked\";\n }\n\n return \"\";\n }",
"@Override public Intege... |
Returns the red color component of a color from a vertex color set.
@param vertex the vertex index
@param colorset the color set
@return the red color component | [
"public float getColorR(int vertex, int colorset) {\n if (!hasColors(colorset)) {\n throw new IllegalStateException(\"mesh has no colorset \" + colorset);\n }\n \n checkVertexIndexBounds(vertex);\n /* bound checks for colorset are done by java for us */\n \n ... | [
"private float[] generateParticleTimeStamps(float totalTime)\n {\n float timeStamps[] = new float[mEmitRate * 2];\n for ( int i = 0; i < mEmitRate * 2; i +=2 )\n {\n timeStamps[i] = totalTime + mRandom.nextFloat();\n timeStamps[i + 1] = 0;\n }\n return tim... |
Get the type created by selecting only a subset of properties from this
type. The type must be a map for this to work
@param properties The properties to select
@return The new type definition | [
"public JsonTypeDefinition projectionType(String... properties) {\n if(this.getType() instanceof Map<?, ?>) {\n Map<?, ?> type = (Map<?, ?>) getType();\n Arrays.sort(properties);\n Map<String, Object> newType = new LinkedHashMap<String, Object>();\n for(String prop... | [
"public Photoset getInfo(String photosetId) throws FlickrException {\r\n Map<String, Object> parameters = new HashMap<String, Object>();\r\n parameters.put(\"method\", METHOD_GET_INFO);\r\n\r\n parameters.put(\"photoset_id\", photosetId);\r\n\r\n Response response = transportAPI.get(tran... |
Check if this path matches the address path.
An address matches this address if its path elements match or are valid
multi targets for this path elements. Addresses that are equal are matching.
@param address The path to check against this path. If null, this method
returns false.
@return true if the provided path mat... | [
"public boolean matches(PathAddress address) {\n if (address == null) {\n return false;\n }\n if (equals(address)) {\n return true;\n }\n if (size() != address.size()) {\n return false;\n }\n for (int i = 0; i < size(); i++) {\n ... | [
"public static <T> JacksonParser<T> json(Class<T> contentType) {\n return new JacksonParser<>(null, contentType);\n }",
"public static void setFieldValue(Object object, String fieldName, Object value) {\n try {\n getDeclaredFieldInHierarchy(object.getClass(), fieldName).set(object, val... |
Converts assignment duration values from minutes to hours.
@param list assignment data | [
"protected void convertToHours(LinkedList<TimephasedWork> list)\n {\n for (TimephasedWork assignment : list)\n {\n Duration totalWork = assignment.getTotalAmount();\n Duration workPerDay = assignment.getAmountPerDay();\n totalWork = Duration.getInstance(totalWork.getDuration() / ... | [
"public static byte[] encode(byte[] ba, int offset, long v) {\n ba[offset + 0] = (byte) (v >>> 56);\n ba[offset + 1] = (byte) (v >>> 48);\n ba[offset + 2] = (byte) (v >>> 40);\n ba[offset + 3] = (byte) (v >>> 32);\n ba[offset + 4] = (byte) (v >>> 24);\n ba[offset + 5] = (byte) (v >>> 16);\n ba[... |
Creates an immutable map. A copy of the given map is used. As a result, it is safe to modify the source map afterwards.
@param map the given map
@return an immutable map | [
"public static <K, V> Map<K, V> copyOf(Map<K, V> map) {\n Preconditions.checkNotNull(map);\n return ImmutableMap.<K, V> builder().putAll(map).build();\n }"
] | [
"public void setLinearLowerLimits(float limitX, float limitY, float limitZ) {\n Native3DGenericConstraint.setLinearLowerLimits(getNative(), limitX, limitY, limitZ);\n }",
"public static Boolean assertTrue(Boolean value, String message) {\n if (!Boolean.valueOf(value))\n throw new Illeg... |
Gets a byte within this sequence of bytes
@param i index into sequence
@return byte
@throws IllegalArgumentException if i is out of range | [
"public byte byteAt(int i) {\n\n if (i < 0) {\n throw new IndexOutOfBoundsException(\"i < 0, \" + i);\n }\n\n if (i >= length) {\n throw new IndexOutOfBoundsException(\"i >= length, \" + i + \" >= \" + length);\n }\n\n return data[offset + i];\n }"
] | [
"protected <T> T invokeJavascriptReturnValue(String function, Class<T> returnType) {\n Object returnObject = invokeJavascript(function);\n if (returnObject instanceof JSObject) {\n try {\n Constructor<T> constructor = returnType.getConstructor(JSObject.class);\n ... |
Check if this applies to the provided authorization scope and return the credentials for that scope or
null if it doesn't apply to the scope.
@param authscope the scope to test against. | [
"@Nullable\n public final Credentials toCredentials(final AuthScope authscope) {\n try {\n\n if (!matches(MatchInfo.fromAuthScope(authscope))) {\n return null;\n }\n } catch (UnknownHostException | MalformedURLException | SocketException e) {\n throw ... | [
"public static double computeRowMax( ZMatrixRMaj A ,\n int row , int col0 , int col1 ) {\n double max = 0;\n\n int indexA = A.getIndex(row,col0);\n double h[] = A.data;\n\n for (int i = col0; i < col1; i++) {\n double realVal = h[indexA++... |
Extracts the zip file to the output folder
@param zipFile ZIP File to extract
@param outputFolder Output Folder
@return A Collection with the extracted files
@throws IOException I/O Error | [
"public static List<File> extract(File zipFile, File outputFolder) throws IOException {\n List<File> extracted = new ArrayList<File>();\n\n byte[] buffer = new byte[2048];\n\n if (!outputFolder.exists()) {\n outputFolder.mkdir();\n }\n\n ZipInputStream zipInput = new ZipInputStream(new FileInput... | [
"public static GridLabelFormat fromConfig(final GridParam param) {\n if (param.labelFormat != null) {\n return new GridLabelFormat.Simple(param.labelFormat);\n } else if (param.valueFormat != null) {\n return new GridLabelFormat.Detailed(\n param.valueFormat, p... |
Returns an integer array that contains the current values for all the
texture parameters.
@return an integer array that contains the current values for all the
texture parameters. | [
"public int[] getCurrentValuesArray() {\n int[] currentValues = new int[5];\n\n currentValues[0] = getMinFilterType().getFilterValue(); // MIN FILTER\n currentValues[1] = getMagFilterType().getFilterValue(); // MAG FILTER\n currentValues[2] = getAnisotropicValue(); // ANISO FILTER\n ... | [
"private void parse(String header)\n {\n ArrayList<String> list = new ArrayList<String>(4);\n StringBuilder sb = new StringBuilder();\n int index = 1;\n while (index < header.length())\n {\n char c = header.charAt(index++);\n if (Character.isDigit(c))\n {\n ... |
Set the model used by the right table.
@param model table model | [
"public void setRightTableModel(TableModel model)\n {\n TableModel old = m_rightTable.getModel();\n m_rightTable.setModel(model);\n firePropertyChange(\"rightTableModel\", old, model);\n }"
] | [
"public void callFunction(String className, String methodName, PluginArguments pluginArgs, Object... args) throws Exception {\n Class<?> cls = getClass(className);\n\n ArrayList<Object> newArgs = new ArrayList<>();\n newArgs.add(pluginArgs);\n com.groupon.odo.proxylib.models.Method m = p... |
This method creates the flattened POM what is the main task of this plugin.
@param pomFile is the name of the original POM file to read and transform.
@return the {@link Model} of the flattened POM.
@throws MojoExecutionException if anything goes wrong (e.g. POM can not be processed).
@throws MojoFailureException if a... | [
"protected Model createFlattenedPom( File pomFile )\n throws MojoExecutionException, MojoFailureException\n {\n\n ModelBuildingRequest buildingRequest = createModelBuildingRequest( pomFile );\n Model effectivePom = createEffectivePom( buildingRequest, isEmbedBuildProfileDependencies(), this.... | [
"@Override\n\tpublic void close() {\n\t\tlogger.info(\"Finished processing.\");\n\t\tthis.timer.stop();\n\t\tthis.lastSeconds = (int) (timer.getTotalWallTime() / 1000000000);\n\t\tprintStatus();\n\t}",
"protected void addNeighbor(Queue<ColorPoint> queue, int px, int py, int color, Feature component) {\n if... |
Removes CRs but returns LFs | [
"final protected char next(final ByteBuffer buffer, boolean allow8859) throws BaseExceptions.BadMessage {\n\n if (!buffer.hasRemaining()) return HttpTokens.EMPTY_BUFF;\n\n if (_segmentByteLimit <= _segmentBytePosition) {\n shutdownParser();\n throw new BaseExceptions.BadMessage(\... | [
"private boolean processQueue(K key) {\n Queue<AsyncResourceRequest<V>> requestQueue = getRequestQueueForKey(key);\n if(requestQueue.isEmpty()) {\n return false;\n }\n\n // Attempt to get a resource.\n Pool<V> resourcePool = getResourcePoolForKey(key);\n V resour... |
Adds an additional statement to the constructed document.
@param statement
the additional statement
@return builder object to continue construction | [
"public T withStatement(Statement statement) {\n\t\tPropertyIdValue pid = statement.getMainSnak()\n\t\t\t\t.getPropertyId();\n\t\tArrayList<Statement> pidStatements = this.statements.get(pid);\n\t\tif (pidStatements == null) {\n\t\t\tpidStatements = new ArrayList<Statement>();\n\t\t\tthis.statements.put(pid, pidSta... | [
"protected static CallableStatement memorize(final CallableStatement target, final ConnectionHandle connectionHandle) {\n\t\treturn (CallableStatement) Proxy.newProxyInstance(\n\t\t\t\tCallableStatementProxy.class.getClassLoader(),\n\t\t\t\tnew Class[] {CallableStatementProxy.class},\n\t\t\t\tnew MemorizeTransactio... |
Enable a host
@param hostName
@throws Exception | [
"public static void enableHost(String hostName) throws Exception {\n Registry myRegistry = LocateRegistry.getRegistry(\"127.0.0.1\", port);\n com.groupon.odo.proxylib.hostsedit.rmi.Message impl = (com.groupon.odo.proxylib.hostsedit.rmi.Message) myRegistry.lookup(SERVICE_NAME);\n\n impl.enableHo... | [
"void updateFromResponseOnPutPatch(Response<ResponseBody> response) throws CloudException, IOException {\n String responseContent = null;\n if (response.body() != null) {\n responseContent = response.body().string();\n response.body().close();\n }\n\n if (responseCo... |
Transits a float property from the start value to the end value.
@param propertyId
@param vals
@return self | [
"public T transitInt(int propertyId, int... vals) {\n String property = getPropertyName(propertyId);\n mHolders.put(propertyId, PropertyValuesHolder.ofInt(property, vals));\n mShadowHolders.put(propertyId, ShadowValuesHolder.ofInt(property, vals));\n return self();\n }"
] | [
"public static boolean changeHost(String hostName,\n boolean enable,\n boolean disable,\n boolean remove,\n boolean isEnabled,\n boolean... |
Determine the color to use to draw a cue list entry. Hot cues are green, ordinary memory points are red,
and loops are orange.
@param entry the entry being drawn
@return the color with which it should be represented. | [
"public static Color cueColor(CueList.Entry entry) {\n if (entry.hotCueNumber > 0) {\n return Color.GREEN;\n }\n if (entry.isLoop) {\n return Color.ORANGE;\n }\n return Color.RED;\n }"
] | [
"public Set<Class> entityClasses() {\n EntityMetaInfoRepo repo = app().entityMetaInfoRepo().forDb(id);\n return null == repo ? C.<Class>set() : repo.entityClasses();\n }",
"public void setValue(String constantValue)\r\n {\r\n this.fieldSource = SOURCE_VALUE;\r\n this.fieldRefName... |
Generate a sql where-clause matching the contraints defined by the array of fields
@param columns array containing all columns used in WHERE clause | [
"protected void appendWhereClause(StringBuffer stmt, Object[] columns)\r\n {\r\n stmt.append(\" WHERE \");\r\n\r\n for (int i = 0; i < columns.length; i++)\r\n {\r\n if (i > 0)\r\n {\r\n stmt.append(\" AND \");\r\n }\r\n stmt.append(... | [
"public static void setCurrentPersistenceBroker(PBKey key, PersistenceBrokerInternal broker)\r\n throws PBFactoryException\r\n {\r\n HashMap map = (HashMap) currentBrokerMap.get();\r\n WeakHashMap set = null;\r\n if(map == null)\r\n {\r\n map = new HashMap();\r\n... |
Use this API to add systemuser resources. | [
"public static base_responses add(nitro_service client, systemuser resources[]) throws Exception {\n\t\tbase_responses result = null;\n\t\tif (resources != null && resources.length > 0) {\n\t\t\tsystemuser addresources[] = new systemuser[resources.length];\n\t\t\tfor (int i=0;i<resources.length;i++){\n\t\t\t\taddre... | [
"private static ResourceBundle tryBundle(String baseName, Locale locale, boolean wantBase) {\n\n I_CmsResourceBundle first = null; // The most specialized bundle.\n I_CmsResourceBundle last = null; // The least specialized bundle.\n\n List<String> bundleNames = CmsLocaleManager.getLocaleVariant... |
Use this API to update cmpparameter. | [
"public static base_response update(nitro_service client, cmpparameter resource) throws Exception {\n\t\tcmpparameter updateresource = new cmpparameter();\n\t\tupdateresource.cmplevel = resource.cmplevel;\n\t\tupdateresource.quantumsize = resource.quantumsize;\n\t\tupdateresource.servercmp = resource.servercmp;\n\t... | [
"public void setValue(Vector3f pos) {\n mX = pos.x;\n mY = pos.y;\n mZ = pos.z;\n }",
"public long queryForLong(DatabaseConnection databaseConnection, PreparedStmt<T> preparedStmt) throws SQLException {\n\t\tCompiledStatement compiledStatement = preparedStmt.compile(databaseConnection, Sta... |
Prepares transformation interceptors for a client.
@param clientConfig the client configuration
@param newClient indicates if it is a new/updated client | [
"private void addTransformInterceptors(List<Interceptor<?>> inInterceptors,\n List<Interceptor<?>> outInterceptors,\n boolean newClient) {\n \n // The old service expects the Customer data be qualified with\n // t... | [
"@SuppressWarnings({\"WeakerAccess\", \"unused\"}) // For library users\n public Searcher addBooleanFilter(String attribute, Boolean value) {\n booleanFilterMap.put(attribute, value);\n rebuildQueryFacetFilters();\n return this;\n }",
"public static String frame(String imageUrl) {\n ... |
Get a reader implementation class to perform API calls with while specifying
an explicit page size for paginated API calls. This gets translated to a per_page=
parameter on API requests. Note that Canvas does not guarantee it will honor this page size request.
There is an explicit maximum page size on the server side w... | [
"public <T extends CanvasReader> T getReader(Class<T> type, OauthToken oauthToken, Integer paginationPageSize) {\n LOG.debug(\"Factory call to instantiate class: \" + type.getName());\n RestClient restClient = new RefreshingRestClient();\n\n @SuppressWarnings(\"unchecked\")\n Class<T> co... | [
"private void readAvailabilityTable(Resource resource, AvailabilityPeriods periods)\n {\n if (periods != null)\n {\n AvailabilityTable table = resource.getAvailability();\n List<AvailabilityPeriod> list = periods.getAvailabilityPeriod();\n for (AvailabilityPeriod period : list)\n... |
Removes an accessory from being handled or advertised by this root. Any existing Homekit
connections will be terminated to allow the clients to reconnect and see the updated accessory
list.
@param accessory accessory to cease advertising and handling | [
"public void removeAccessory(HomekitAccessory accessory) {\n this.registry.remove(accessory);\n logger.info(\"Removed accessory \" + accessory.getLabel());\n if (started) {\n registry.reset();\n webHandler.resetConnections();\n }\n }"
] | [
"@Override\n public Scenario<GIVEN, WHEN, THEN> startScenario( String description ) {\n super.startScenario( description );\n return this;\n\n }",
"public static DMatrixRBlock initializeQ(DMatrixRBlock Q,\n int numRows , int numCols , int blockLengt... |
This method retrieves a String of the specified type,
belonging to the item with the specified unique ID.
@param id unique ID of entity to which this data belongs
@param type data type identifier
@return string containing required data | [
"public String getUnicodeString(Integer id, Integer type)\n {\n return (getUnicodeString(m_meta.getOffset(id, type)));\n }"
] | [
"private void deleteLinks(@NotNull final PersistentStoreTransaction txn, @NotNull final PersistentEntity entity) {\n final PersistentEntityId id = entity.getId();\n final int entityTypeId = id.getTypeId();\n final long entityLocalId = id.getLocalId();\n final Transaction envTxn = txn.get... |
Converts an integer into a time format.
@param format integer format value
@return TimeUnit instance | [
"private TimeUnit getFormat(int format)\n {\n TimeUnit result;\n if (format == 0xFFFF)\n {\n result = TimeUnit.HOURS;\n }\n else\n {\n result = MPPUtility.getWorkTimeUnits(format);\n }\n return result;\n }"
] | [
"public boolean isPrivate() {\n\t\t// refer to RFC 1918\n // 10/8 prefix\n // 172.16/12 prefix (172.16.0.0 – 172.31.255.255)\n // 192.168/16 prefix\n\t\tIPv4AddressSegment seg0 = getSegment(0);\n\t\tIPv4AddressSegment seg1 = getSegment(1);\n\t\treturn seg0.matches(10)\n\t\t\t|| seg0.matches(172... |
Search down all extent classes and return max of all found
PK values. | [
"public static long getMaxId(PersistenceBroker brokerForClass, Class topLevel, FieldDescriptor original) throws PersistenceBrokerException\r\n {\r\n long max = 0;\r\n long tmp;\r\n ClassDescriptor cld = brokerForClass.getClassDescriptor(topLevel);\r\n\r\n // if class is not an interfa... | [
"public Set<CoreDocumentSynchronizationConfig> getSynchronizedDocuments(\n final MongoNamespace namespace\n ) {\n this.waitUntilInitialized();\n try {\n ongoingOperationsGroup.enter();\n return this.syncConfig.getSynchronizedDocuments(namespace);\n } finally {\n ongoingOperationsGroup.... |
Sets divider padding for axis. If axis does not match the orientation, it has no effect.
@param padding
@param axis {@link Axis} | [
"public void setDividerPadding(float padding, final Axis axis) {\n if (axis == getOrientationAxis()) {\n super.setDividerPadding(padding, axis);\n } else {\n Log.w(TAG, \"Cannot apply divider padding for wrong axis [%s], orientation = %s\",\n axis, getOrientation... | [
"public static base_responses add(nitro_service client, appfwjsoncontenttype resources[]) throws Exception {\n\t\tbase_responses result = null;\n\t\tif (resources != null && resources.length > 0) {\n\t\t\tappfwjsoncontenttype addresources[] = new appfwjsoncontenttype[resources.length];\n\t\t\tfor (int i=0;i<resourc... |
Get a collection of all of the user's groups.
@return A Collection of Group objects
@throws FlickrException | [
"public Collection<Group> getGroups() throws FlickrException {\r\n GroupList<Group> groups = new GroupList<Group>();\r\n\r\n Map<String, Object> parameters = new HashMap<String, Object>();\r\n parameters.put(\"method\", METHOD_GET_GROUPS);\r\n\r\n Response response = transport.get(transp... | [
"public static boolean isLong(CharSequence self) {\n try {\n Long.valueOf(self.toString().trim());\n return true;\n } catch (NumberFormatException nfe) {\n return false;\n }\n }",
"public void set1Value(int index, String newValue) {\n try {\n ... |
This method determines whether the given date falls in the range of
dates covered by this exception. Note that this method assumes that both
the start and end date of this exception have been set.
@param date Date to be tested
@return Boolean value | [
"public boolean contains(Date date)\n {\n boolean result = false;\n\n if (date != null)\n {\n result = (DateHelper.compare(getFromDate(), getToDate(), date) == 0);\n }\n\n return (result);\n }"
] | [
"private void writeCompressedText(File file, byte[] compressedContent) throws IOException\r\n {\r\n ByteArrayInputStream bais = new ByteArrayInputStream(compressedContent);\r\n GZIPInputStream gis = new GZIPInputStream(bais);\r\n BufferedReader input = new BufferedReader(new... |
Calculate the value of a swaption assuming the Black'76 model.
@param forwardSwaprate The forward (spot)
@param volatility The Black'76 volatility.
@param optionMaturity The option maturity.
@param optionStrike The option strike.
@param swapAnnuity The swap annuity corresponding to the underlying swap.
@return Returns... | [
"public static double blackModelSwaptionValue(\n\t\t\tdouble forwardSwaprate,\n\t\t\tdouble volatility,\n\t\t\tdouble optionMaturity,\n\t\t\tdouble optionStrike,\n\t\t\tdouble swapAnnuity)\n\t{\n\t\t// May be interpreted as a special version of the Black-Scholes Formula\n\t\treturn AnalyticFormulas.blackScholesGene... | [
"public ParallelTaskBuilder setSshPrivKeyRelativePathWtihPassphrase(\n String privKeyRelativePath, String passphrase) {\n this.sshMeta.setPrivKeyRelativePath(privKeyRelativePath);\n this.sshMeta.setPrivKeyUsePassphrase(true);\n this.sshMeta.setPassphrase(passphrase);\n this.ss... |
Close it and ignore any exceptions. | [
"public static void closeThrowSqlException(Closeable closeable, String label) throws SQLException {\n\t\tif (closeable != null) {\n\t\t\ttry {\n\t\t\t\tcloseable.close();\n\t\t\t} catch (IOException e) {\n\t\t\t\tthrow SqlExceptionUtil.create(\"could not close \" + label, e);\n\t\t\t}\n\t\t}\n\t}"
] | [
"public final int toChars(int[] src, int srcOff, int srcLen, char[] dest, int destOff) {\n if (srcLen < 0) {\n throw new IllegalArgumentException(\"srcLen must be >= 0\");\n }\n int written = 0;\n for (int i = 0; i < srcLen; ++i) {\n written += Character.toChars(src[srcOff + i], dest, destOff ... |
Ensure that the nodeList is either null or empty.
@param nodeList the nodeList to ensure to be either null or empty
@param expression the expression was used to fine the nodeList
@throws SpinXPathException if the nodeList is either null or empty | [
"public static void ensureXPathNotEmpty(NodeList nodeList, String expression) {\n if (nodeList == null || nodeList.getLength() == 0) {\n throw LOG.unableToFindXPathExpression(expression);\n }\n }"
] | [
"@Deprecated\n public FluoConfiguration addObservers(Iterable<ObserverSpecification> observers) {\n int next = getNextObserverId();\n for (ObserverSpecification oconf : observers) {\n addObserver(oconf, next++);\n }\n return this;\n }",
"void reset()\n {\n if (!hasStopped)\n {\... |
Add a listener to be invoked when the checked button changes in this group.
@param listener
@param <T>
@return | [
"public <T extends Widget & Checkable> boolean addOnCheckChangedListener\n (OnCheckChangedListener listener) {\n final boolean added;\n synchronized (mListeners) {\n added = mListeners.add(listener);\n }\n if (added) {\n List<T> c = getCheckableChildren()... | [
"public static base_response update(nitro_service client, cmpparameter resource) throws Exception {\n\t\tcmpparameter updateresource = new cmpparameter();\n\t\tupdateresource.cmplevel = resource.cmplevel;\n\t\tupdateresource.quantumsize = resource.quantumsize;\n\t\tupdateresource.servercmp = resource.servercmp;\n\t... |
Set the visibility of the object.
@see Visibility
@param visibility
The visibility of the object.
@return {@code true} if the visibility was changed, {@code false} if it
wasn't. | [
"public boolean setVisibility(final Visibility visibility) {\n if (visibility != mVisibility) {\n Log.d(Log.SUBSYSTEM.WIDGET, TAG, \"setVisibility(%s) for %s\", visibility, getName());\n updateVisibility(visibility);\n mVisibility = visibility;\n return true;\n ... | [
"DeleteResult deleteMany(final MongoNamespace namespace,\n final Bson filter) {\n this.waitUntilInitialized();\n\n try {\n ongoingOperationsGroup.enter();\n final List<ChangeEvent<BsonDocument>> eventsToEmit = new ArrayList<>();\n final DeleteResult result;\n final... |
Create a local target.
@param jbossHome the jboss home
@param moduleRoots the module roots
@param bundlesRoots the bundle roots
@return the local target
@throws IOException | [
"public static final PatchOperationTarget createLocal(final File jbossHome, List<File> moduleRoots, List<File> bundlesRoots) throws IOException {\n final PatchTool tool = PatchTool.Factory.createLocalTool(jbossHome, moduleRoots, bundlesRoots);\n return new LocalPatchOperationTarget(tool);\n }"
] | [
"boolean setFrameIndex(int frame) {\n if(frame < INITIAL_FRAME_POINTER || frame >= getFrameCount()) {\n return false;\n }\n framePointer = frame;\n return true;\n }",
"public void setAlias(String alias)\r\n\t{\r\n\t\tm_alias = alias;\r\n\t\tString attributePath = (String)... |
Removes all documents from the collection that match the given query filter. If no documents
match, the collection is not modified.
@param filter the query filter to apply the the delete operation
@return the result of the remove many operation | [
"DeleteResult deleteMany(final MongoNamespace namespace,\n final Bson filter) {\n this.waitUntilInitialized();\n\n try {\n ongoingOperationsGroup.enter();\n final List<ChangeEvent<BsonDocument>> eventsToEmit = new ArrayList<>();\n final DeleteResult result;\n final... | [
"protected String stringValue(COSBase value)\n {\n if (value instanceof COSString)\n return ((COSString) value).getString();\n else if (value instanceof COSNumber)\n return String.valueOf(((COSNumber) value).floatValue());\n else\n return \"\";\n }",
"pr... |
Sets the submatrix of W up give Y is already configured and if it is being cached or not. | [
"private void setW() {\n if( saveW ) {\n W.col0 = Y.col0;\n W.col1 = Y.col1;\n W.row0 = Y.row0;\n W.row1 = Y.row1;\n } else {\n W.col1 = Y.col1 - Y.col0;\n W.row0 = Y.row0;\n }\n }"
] | [
"public BlurBuilder contrast(float contrast) {\n data.preProcessors.add(new ContrastProcessor(data.contextWrapper.getRenderScript(), Math.max(Math.min(1500.f, contrast), -1500.f)));\n return this;\n }",
"public void putInWakeUpQueue(SerialMessage serialMessage) {\r\n\t\tif (this.wakeUpQueue.conta... |
Marks the given list of statements for deletion. It is verified that the
current document actually contains the statements before doing so. This
check is based on exact statement equality, including qualifier order and
statement id.
@param currentDocument
the document with the current statements
@param deleteStatement... | [
"protected void markStatementsForDeletion(StatementDocument currentDocument,\n\t\t\tList<Statement> deleteStatements) {\n\t\tfor (Statement statement : deleteStatements) {\n\t\t\tboolean found = false;\n\t\t\tfor (StatementGroup sg : currentDocument.getStatementGroups()) {\n\t\t\t\tif (!sg.getProperty().equals(stat... | [
"protected void processStart(Endpoint endpoint, EventTypeEnum eventType) {\n if (!sendLifecycleEvent) {\n return;\n }\n\n Event event = createEvent(endpoint, eventType);\n queue.add(event);\n }",
"public String getBaselineDurationText(int baselineNumber)\n {\n Obje... |
Generate random time stamps from the current time upto the next one second.
Passed as texture coordinates to the vertex shader, an unused field is present
with every pair passed.
@param totalTime
@return | [
"private float[] generateParticleTimeStamps(float totalTime)\n {\n float timeStamps[] = new float[mEmitRate * 2];\n for ( int i = 0; i < mEmitRate * 2; i +=2 )\n {\n timeStamps[i] = totalTime + mRandom.nextFloat();\n timeStamps[i + 1] = 0;\n }\n return tim... | [
"public void handleStateEvent(String callbackKey) {\n if (handlers.containsKey(callbackKey) && handlers.get(callbackKey) instanceof StateEventHandler) {\n ((StateEventHandler) handlers.get(callbackKey)).handle();\n } else {\n System.err.println(\"Error in handle: \" + callbackKey... |
Sets the country for which currencies should be requested.
@param countries The ISO countries.
@return the query for chaining. | [
"public CurrencyQueryBuilder setCountries(Locale... countries) {\n return set(CurrencyQuery.KEY_QUERY_COUNTRIES, Arrays.asList(countries));\n }"
] | [
"public Criteria copy(boolean includeGroupBy, boolean includeOrderBy, boolean includePrefetchedRelationships)\r\n {\r\n Criteria copy = new Criteria();\r\n\r\n copy.m_criteria = new Vector(this.m_criteria);\r\n copy.m_negative = this.m_negative;\r\n\r\n if (includeGroupBy)\r\n ... |
Sets top and bottom padding for all cells in the row.
@param padding new padding for top and bottom, ignored if smaller than 0
@return this to allow chaining | [
"public AT_Row setPaddingTopBottom(int padding){\r\n\t\tif(this.hasCells()){\r\n\t\t\tfor(AT_Cell cell : this.getCells()){\r\n\t\t\t\tcell.getContext().setPaddingTopBottom(padding);\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn this;\r\n\t}"
] | [
"public static List<Number> findIndexValues(Object self, Number startIndex, Closure closure) {\n List<Number> result = new ArrayList<Number>();\n long count = 0;\n long startCount = startIndex.longValue();\n BooleanClosureWrapper bcw = new BooleanClosureWrapper(closure);\n for (It... |
This method extracts candidate elements from the current DOM tree in the browser, based on
the crawl tags defined by the user.
@param currentState the state in which this extract method is requested.
@return a list of candidate elements that are not excluded.
@throws CrawljaxException if the method fails. | [
"public ImmutableList<CandidateElement> extract(StateVertex currentState)\n\t\t\tthrows CrawljaxException {\n\t\tLinkedList<CandidateElement> results = new LinkedList<>();\n\n\t\tif (!checkedElements.checkCrawlCondition(browser)) {\n\t\t\tLOG.info(\"State {} did not satisfy the CrawlConditions.\", currentState.getN... | [
"public static sslglobal_sslpolicy_binding[] get(nitro_service service) throws Exception{\n\t\tsslglobal_sslpolicy_binding obj = new sslglobal_sslpolicy_binding();\n\t\tsslglobal_sslpolicy_binding response[] = (sslglobal_sslpolicy_binding[]) obj.get_resources(service);\n\t\treturn response;\n\t}",
"public static ... |
In managed environment do internal close the used connection | [
"private void internalCleanup()\r\n {\r\n if(hasBroker())\r\n {\r\n PersistenceBroker broker = getBroker();\r\n if(log.isDebugEnabled())\r\n {\r\n log.debug(\"Do internal cleanup and close the internal used connection without\" +\r\n ... | [
"@Override\r\n public String upload(File file, UploadMetaData metaData) throws FlickrException {\r\n Payload payload = new Payload(file);\r\n return sendUploadRequest(metaData, payload);\r\n }",
"public static IndexableTaskItem create(final FunctionalTaskItem taskItem) {\n return new In... |
This method is called to alert project listeners to the fact that
a task has been written to a project file.
@param task task instance | [
"public void fireTaskWrittenEvent(Task task)\n {\n if (m_projectListeners != null)\n {\n for (ProjectListener listener : m_projectListeners)\n {\n listener.taskWritten(task);\n }\n }\n }"
] | [
"public Iterable<BoxLegalHoldAssignment.Info> getAssignments(String ... fields) {\n return this.getAssignments(null, null, DEFAULT_LIMIT, fields);\n }",
"private List<String> generateDateTimePatterns(String datePattern, String[] timePatterns)\n {\n List<String> patterns = new ArrayList<String>();... |
Say whether this character is an annotation introducing
character.
@param ch The character to check
@return Whether it is an annotation introducing character | [
"public boolean isLabelAnnotationIntroducingCharacter(char ch) {\r\n char[] cutChars = labelAnnotationIntroducingCharacters();\r\n for (char cutChar : cutChars) {\r\n if (ch == cutChar) {\r\n return true;\r\n }\r\n }\r\n return false;\r\n }"
] | [
"public static Priority getInstance(Locale locale, String priority)\n {\n int index = DEFAULT_PRIORITY_INDEX;\n\n if (priority != null)\n {\n String[] priorityTypes = LocaleData.getStringArray(locale, LocaleData.PRIORITY_TYPES);\n for (int loop = 0; loop < priorityTypes.length; loop... |
Use this API to enable the mode on Netscaler.
@param mode mode to be enabled.
@return status of the operation performed.
@throws Exception Nitro exception. | [
"public base_response enable_modes(String[] modes) throws Exception\n\t{\n\t\tbase_response result = null;\n\t\tnsmode resource = new nsmode();\n\t\tresource.set_mode(modes);\n\t\toptions option = new options();\n\t\toption.set_action(\"enable\");\n\t\tresult = resource.perform_operation(this, option);\n\t\treturn ... | [
"public TableReader read() throws IOException\n {\n int tableHeader = m_stream.readInt();\n if (tableHeader != 0x39AF547A)\n {\n throw new IllegalArgumentException(\"Unexpected file format\");\n }\n\n int recordCount = m_stream.readInt();\n for (int loop = 0; loop < recordCou... |
Use this API to add nspbr6 resources. | [
"public static base_responses add(nitro_service client, nspbr6 resources[]) throws Exception {\n\t\tbase_responses result = null;\n\t\tif (resources != null && resources.length > 0) {\n\t\t\tnspbr6 addresources[] = new nspbr6[resources.length];\n\t\t\tfor (int i=0;i<resources.length;i++){\n\t\t\t\taddresources[i] =... | [
"private void validationRelations(Task task)\n {\n List<Relation> predecessors = task.getPredecessors();\n if (!predecessors.isEmpty())\n {\n ArrayList<Relation> invalid = new ArrayList<Relation>();\n for (Relation relation : predecessors)\n {\n Task sourceTask = ... |
Calculates a column title using camel humps to separate words.
@param _property the property descriptor.
@return the column title for the given property. | [
"private static String getColumnTitle(final PropertyDescriptor _property) {\n final StringBuilder buffer = new StringBuilder();\n final String name = _property.getName();\n buffer.append(Character.toUpperCase(name.charAt(0)));\n for (int i = 1; i < name.length(); i++) {\n fina... | [
"public static void closeWithWarning(Closeable c) {\n if (c != null) {\n try {\n c.close();\n } catch (IOException e) {\n LOG.warning(\"Caught exception during close(): \" + e);\n }\n }\n }",
"public static final BigDecimal printCurre... |
Reads and returns the mediator URN from the JSON content.
@see #RegistrationConfig(String) | [
"public String getURN() throws InvalidRegistrationContentException {\n if (parsedConfig==null || parsedConfig.urn==null || parsedConfig.urn.trim().isEmpty()) {\n throw new InvalidRegistrationContentException(\"Invalid registration config - failed to read mediator URN\");\n }\n return... | [
"private void computeUnnamedParams() {\n unnamedParams.addAll(rawArgs.stream().filter(arg -> !isNamedParam(arg)).collect(Collectors.toList()));\n }",
"public void visitMethodInsn(int opcode, String owner, String name,\n String desc, boolean itf) {\n if (mv != null) {\n mv.vi... |
Get the days difference | [
"public static int daysDiff(Date earlierDate, Date laterDate) {\n if (earlierDate == null || laterDate == null) {\n return 0;\n }\n\n return (int) ((laterDate.getTime() / DAY_MILLIS) - (earlierDate.getTime() / DAY_MILLIS));\n }"
] | [
"public void onDrawFrame(float frameTime)\n {\n if (isEnabled() && (mScene != null) && mPickEventLock.tryLock())\n {\n // Don't call if we are in the middle of processing another pick\n try\n {\n doPick();\n }\n finally\n ... |
Checks whether two internet addresses are on the same subnet.
@param prefixLength the number of bits within an address that identify the network
@param address1 the first address to be compared
@param address2 the second address to be compared
@return true if both addresses share the same network bits | [
"public static boolean sameNetwork(int prefixLength, InetAddress address1, InetAddress address2) {\n if (logger.isDebugEnabled()) {\n logger.debug(\"Comparing address \" + address1.getHostAddress() + \" with \" + address2.getHostAddress() + \", prefixLength=\" + prefixLength);\n }\n ... | [
"public void close()\n {\n if (transac_open)\n {\n try\n {\n this._cnx.rollback();\n }\n catch (Exception e)\n {\n // Ignore.\n }\n }\n\n for (Statement s : toClose)\n {\n ... |
Reads a single day for a calendar.
@param mpxjCalendar ProjectCalendar instance
@param day ConceptDraw PROJECT week day | [
"private void readWeekDay(ProjectCalendar mpxjCalendar, WeekDay day)\n {\n if (day.isIsDayWorking())\n {\n ProjectCalendarHours hours = mpxjCalendar.addCalendarHours(day.getDay());\n for (Document.Calendars.Calendar.WeekDays.WeekDay.TimePeriods.TimePeriod period : day.getTimePeriods().ge... | [
"public void ifDoesntHaveMemberTag(String template, Properties attributes) throws XDocletException\r\n {\r\n boolean result = false;\r\n\r\n if (getCurrentField() != null) {\r\n if (!hasTag(attributes, FOR_FIELD)) {\r\n result = true;\r\n generate(template);... |
Schedule at most one task.
The scheduled task *must* invoke 'doneTask()' upon
completion/termination.
@param executeService flag to control execution of the service, some tests pass
in value 'false'
@return The task scheduled or null if not possible to schedule a task at
this time. | [
"protected synchronized StealerBasedRebalanceTask scheduleNextTask(boolean executeService) {\n // Make sure there is work left to do.\n if(doneSignal.getCount() == 0) {\n logger.info(\"All tasks completion signaled... returning\");\n\n return null;\n }\n // Limit nu... | [
"private String typeParameters(Options opt, ParameterizedType t) {\n\tif (t == null)\n\t return \"\";\n\tStringBuffer tp = new StringBuffer(1000).append(\"<\");\n\tType args[] = t.typeArguments();\n\tfor (int i = 0; i < args.length; i++) {\n\t tp.append(type(opt, args[i], true));\n\t if (i != args.lengt... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.