query stringlengths 7 3.3k | positive listlengths 1 1 | negative listlengths 9 9 |
|---|---|---|
Returns the value of the specified matrix element. Performs a bounds check to make sure
the requested element is part of the matrix.
@param row The row of the element.
@param col The column of the element.
@return The value of the element. | [
"@Override\n public double get( int row , int col ) {\n if( col < 0 || col >= numCols || row < 0 || row >= numRows ) {\n throw new IllegalArgumentException(\"Specified element is out of bounds: \"+row+\" \"+col);\n }\n\n return data[ row * numCols + col ];\n }"
] | [
"public void clear() {\n valueBoxBase.setText(\"\");\n clearStatusText();\n\n if (getPlaceholder() == null || getPlaceholder().isEmpty()) {\n label.removeStyleName(CssName.ACTIVE);\n }\n }",
"public static ResourceResolutionContext context(ResourceResolutionComponent[] co... |
Can be overridden if you want to replace or supplement the debug handling for responses.
@param responseCode
@param inputStream | [
"protected void handleResponse(int responseCode, InputStream inputStream) {\n BufferedReader rd = null;\n try {\n // Buffer the result into a string\n rd = new BufferedReader(new InputStreamReader(inputStream));\n StringBuilder sb = new StringBuilder();\n St... | [
"public static responderglobal_responderpolicy_binding[] get(nitro_service service) throws Exception{\n\t\tresponderglobal_responderpolicy_binding obj = new responderglobal_responderpolicy_binding();\n\t\tresponderglobal_responderpolicy_binding response[] = (responderglobal_responderpolicy_binding[]) obj.get_resour... |
Return a capitalized version of the specified property name.
@param s
The property name | [
"public static String capitalizePropertyName(String s) {\r\n\t\tif (s.length() == 0) {\r\n\t\t\treturn s;\r\n\t\t}\r\n\r\n\t\tchar[] chars = s.toCharArray();\r\n\t\tchars[0] = Character.toUpperCase(chars[0]);\r\n\t\treturn new String(chars);\r\n\t}"
] | [
"public int getCostRateTableIndex()\n {\n Integer value = (Integer) getCachedValue(AssignmentField.COST_RATE_TABLE);\n return value == null ? 0 : value.intValue();\n }",
"public void stopServer() throws Exception {\n if (!externalDatabaseHost) {\n try (Connection sqlConnection = ge... |
Gets a SerialMessage with the SENSOR_ALARM_SUPPORTED_GET command
@return the serial message, or null if the supported command is not supported. | [
"public SerialMessage getSupportedMessage() {\r\n\t\tlogger.debug(\"Creating new message for application command SENSOR_ALARM_SUPPORTED_GET for node {}\", this.getNode().getNodeId());\r\n\t\t\r\n\t\tif (this.getNode().getManufacturer() == 0x010F && this.getNode().getDeviceType() == 0x0501) {\r\n\t\t\tlogger.warn(\"... | [
"synchronized boolean markReadMessageForId(String messageId, String userId){\n if(messageId == null || userId == null) return false;\n\n final String tName = Table.INBOX_MESSAGES.getName();\n try{\n final SQLiteDatabase db = dbHelper.getWritableDatabase();\n ContentValues ... |
Creates an operation to deploy existing deployment content to the runtime.
@param deployment the deployment to deploy
@return the deploy operation | [
"public static Operation createDeployOperation(final DeploymentDescription deployment) {\n Assert.checkNotNullParam(\"deployment\", deployment);\n final CompositeOperationBuilder builder = CompositeOperationBuilder.create(true);\n addDeployOperationStep(builder, deployment);\n return bui... | [
"@Override\n\tpublic ProxyAuthenticationMethod getMethod() {\n\t\tswitch (authenticationMethod) {\n\t\tcase BASIC:\n\t\t\treturn ProxyAuthenticationMethod.BASIC;\n\t\tcase DIGEST:\n\t\t\treturn ProxyAuthenticationMethod.DIGEST;\n\t\tcase URL:\n\t\t\treturn ProxyAuthenticationMethod.URL;\n\t\tdefault:\n\t\t\treturn ... |
Sets a request header with the given name and value. If a header with the
specified name has already been set then the new value overwrites the
current value.
@param header the name of the header
@param value the value of the header
@throws NullPointerException if header or value are null
@throws IllegalArgumentExcep... | [
"public void setHeader(String header, String value) {\n StringValidator.throwIfEmptyOrNull(\"header\", header);\n StringValidator.throwIfEmptyOrNull(\"value\", value);\n\n if (headers == null) {\n headers = new HashMap<String, String>();\n }\n\n headers.put(header, valu... | [
"public void setMatrix(int[] matrix) {\n\t\tthis.matrix = matrix;\n\t\tsum = 0;\n\t\tfor (int i = 0; i < matrix.length; i++)\n\t\t\tsum += matrix[i];\n\t}",
"private Integer getIntegerPropertyOverrideValue(String name, String key) {\n if (properties != null) {\n String propertyName = getProperty... |
Revert all the working copy changes. | [
"public void revertWorkingCopy() throws IOException, InterruptedException {\n build.getWorkspace()\n .act(new RevertWorkingCopyCallable(getLocation(), getSvnAuthenticationProvider(build), buildListener));\n }"
] | [
"public void forAllClassDefinitions(String template, Properties attributes) throws XDocletException\r\n {\r\n for (Iterator it = _model.getClasses(); it.hasNext(); )\r\n {\r\n _curClassDef = (ClassDescriptorDef)it.next();\r\n generate(template);\r\n }\r\n _curCla... |
Removes the specified object in index from the array.
@param index The index to remove. | [
"public void removeAt(int index) {\n synchronized (mLock) {\n if (mOriginalValues != null) {\n mOriginalValues.remove(index);\n } else {\n mObjects.remove(index);\n }\n }\n if (mNotifyOnChange) notifyDataSetChanged();\n }"
] | [
"public void evictCache(String key) {\n H.Session sess = session();\n if (null != sess) {\n sess.evict(key);\n } else {\n app().cache().evict(key);\n }\n }",
"private static String getBundle(String friendlyName, String className, int truncate)\r\n\t{\r\n\t\ttry... |
Use this API to update transformpolicy. | [
"public static base_response update(nitro_service client, transformpolicy resource) throws Exception {\n\t\ttransformpolicy updateresource = new transformpolicy();\n\t\tupdateresource.name = resource.name;\n\t\tupdateresource.rule = resource.rule;\n\t\tupdateresource.profilename = resource.profilename;\n\t\tupdater... | [
"public void setBackgroundColor(int color) {\n colorUnpressed = color;\n\n if(!isSelected()) {\n if (rippleAnimationSupport()) {\n ripple.setRippleBackground(colorUnpressed);\n }\n else {\n view.setBackgroundColor(colorUnpressed);\n ... |
Obtains a local date in International Fixed calendar system from the
era, year-of-era and day-of-year fields.
@param era the International Fixed era, not null
@param yearOfEra the year-of-era
@param dayOfYear the day-of-year
@return the International Fixed local date, not null
@throws DateTimeException if unable to... | [
"@Override\n public InternationalFixedDate dateYearDay(Era era, int yearOfEra, int dayOfYear) {\n return dateYearDay(prolepticYear(era, yearOfEra), dayOfYear);\n }"
] | [
"public static void main(String[] args) throws ParseException, IOException {\n\t\tClient client = new Client(\n\t\t\t\tnew DumpProcessingController(\"wikidatawiki\"), args);\n\t\tclient.performActions();\n\t}",
"private boolean processQueue(K key) {\n Queue<AsyncResourceRequest<V>> requestQueue = getReques... |
Use this API to fetch all the nssimpleacl resources that are configured on netscaler. | [
"public static nssimpleacl[] get(nitro_service service) throws Exception{\n\t\tnssimpleacl obj = new nssimpleacl();\n\t\tnssimpleacl[] response = (nssimpleacl[])obj.get_resources(service);\n\t\treturn response;\n\t}"
] | [
"public static void plotCharts(List<Chart> charts){\n\t\tint numRows =1;\n\t\tint numCols =1;\n\t\tif(charts.size()>1){\n\t\t\tnumRows = (int) Math.ceil(charts.size()/2.0);\n\t\t\tnumCols = 2;\n\t\t}\n\t\t\n\t final JFrame frame = new JFrame(\"\");\n\t frame.setDefaultCloseOperation(JFrame.HIDE_ON_CLOSE);\n ... |
Tell a device to turn sync on or off.
@param deviceNumber the device whose sync state is to be set
@param synced {@code} true if sync should be turned on, else it will be turned off
@throws IOException if there is a problem sending the command to the device
@throws IllegalStateException if the {@code VirtualCdj} is n... | [
"public void sendSyncModeCommand(int deviceNumber, boolean synced) throws IOException {\n final DeviceUpdate update = getLatestStatusFor(deviceNumber);\n if (update == null) {\n throw new IllegalArgumentException(\"Device \" + deviceNumber + \" not found on network.\");\n }\n ... | [
"public Triple<EObject, EReference, INode> decode(Resource res, String uriFragment) {\n\t\tif (isUseIndexFragment(res)) {\n\t\t\treturn getLazyProxyInformation(res, uriFragment);\n\t\t}\n\t\tList<String> split = Strings.split(uriFragment, SEP);\n\t\tEObject source = resolveShortFragment(res, split.get(1));\n\t\tERe... |
If there is a SubReport on a Group, we do the layout here
@param columnsGroup
@param jgroup | [
"protected void layoutGroupSubreports(DJGroup columnsGroup, JRDesignGroup jgroup) {\n\t\tlog.debug(\"Starting subreport layout...\");\n\t\tJRDesignBand footerBand = (JRDesignBand) ((JRDesignSection)jgroup.getGroupFooterSection()).getBandsList().get(0);\n\t\tJRDesignBand headerBand = (JRDesignBand) ((JRDesignSection... | [
"public boolean classifySentenceStdin(DocumentReaderAndWriter<IN> readerWriter)\r\n throws IOException\r\n {\r\n BufferedReader is = new BufferedReader(new InputStreamReader(System.in, flags.inputEncoding));\r\n String line;\r\n String text = \"\";\r\n String eol = \"\\n\";\r\n String sentence = ... |
Returns an array of all endpoints
@param profileId ID of profile
@param clientUUID UUID of client
@param filters filters to apply to endpoints
@return Collection of endpoints
@throws Exception exception | [
"public List<EndpointOverride> getPaths(int profileId, String clientUUID, String[] filters) throws Exception {\n ArrayList<EndpointOverride> properties = new ArrayList<EndpointOverride>();\n PreparedStatement statement = null;\n ResultSet results = null;\n\n try (Connection sqlConnection... | [
"public void removeCorporateGroupId(final String organizationId, final String corporateGroupId) {\n final DbOrganization dbOrganization = getOrganization(organizationId);\n\n if(dbOrganization.getCorporateGroupIdPrefixes().contains(corporateGroupId)){\n dbOrganization.getCorporateGroupIdPre... |
This method lists all tasks defined in the file.
@param file MPX file | [
"private static void listTasks(ProjectFile file)\n {\n SimpleDateFormat df = new SimpleDateFormat(\"dd/MM/yyyy HH:mm z\");\n\n for (Task task : file.getTasks())\n {\n Date date = task.getStart();\n String text = task.getStartText();\n String startDate = text != null ? text :... | [
"public final void debug(Object pObject)\r\n\t{\r\n\t\tgetLogger().log(FQCN, Level.DEBUG, pObject, null);\r\n\t}",
"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 = va... |
Returns server group by ID
@param id ID of server group
@return ServerGroup
@throws Exception exception | [
"public ServerGroup getServerGroup(int id, int profileId) throws Exception {\n PreparedStatement queryStatement = null;\n ResultSet results = null;\n\n if (id == 0) {\n return new ServerGroup(0, \"Default\", profileId);\n }\n\n try (Connection sqlConnection = sqlService... | [
"public static <T> T withStreams(Socket socket, @ClosureParams(value=SimpleType.class, options={\"java.io.InputStream\",\"java.io.OutputStream\"}) Closure<T> closure) throws IOException {\n InputStream input = socket.getInputStream();\n OutputStream output = socket.getOutputStream();\n try {\n ... |
Appends the indentation string at the current position of the parent and adds a new composite node, indicating the same indentation for
subsequent lines.
@return an indentation node, using the given indentString, appended as a child on the given parent | [
"public CompositeGeneratorNode indent(final CompositeGeneratorNode parent, final String indentString) {\n final IndentNode indent = new IndentNode(indentString);\n List<IGeneratorNode> _children = parent.getChildren();\n _children.add(indent);\n return indent;\n }"
] | [
"private static Version getDockerVersion(String serverUrl) {\n try {\n DockerClient client = DockerClientBuilder.getInstance(serverUrl).build();\n return client.versionCmd().exec();\n } catch (Exception e) {\n return null;\n }\n }",
"public static Indexable... |
Merges a list of local and online dumps. For dumps available both online
and locally, only the local version is included. The list is order with
most recent dump date first.
@return a merged list of dump files | [
"List<MwDumpFile> mergeDumpLists(List<MwDumpFile> localDumps,\n\t\t\tList<MwDumpFile> onlineDumps) {\n\t\tList<MwDumpFile> result = new ArrayList<>(localDumps);\n\n\t\tHashSet<String> localDateStamps = new HashSet<>();\n\t\tfor (MwDumpFile dumpFile : localDumps) {\n\t\t\tlocalDateStamps.add(dumpFile.getDateStamp())... | [
"@Override\n public void preStateCrawling(CrawlerContext context,\n ImmutableList<CandidateElement> candidateElements, StateVertex state) {\n LOG.debug(\"preStateCrawling\");\n List<CandidateElementPosition> newElements = Lists.newLinkedList();\n LOG.info(\"Pr... |
Main method of the class, which handles the process of creating the tests
@param requirementsFolder
, it is the folder where the plain text given by the client is
stored
@param platformName
, to choose the MAS platform (JADE, JADEX, etc.)
@param src_test_dir
, the folder where our classes are created
@param tests_pack... | [
"public static void generateJavaFiles(String requirementsFolder,\n String platformName, String src_test_dir, String tests_package,\n String casemanager_package, String loggingPropFile)\n throws Exception {\n\n File reqFolder = new File(requirementsFolder);\n if (reqFol... | [
"public static Duration getDuration(ProjectProperties properties, Integer durationValue, Integer unitsValue)\n {\n Duration result;\n if (durationValue == null)\n {\n result = null;\n }\n else\n {\n result = Duration.getInstance(durationValue.intValue(), TimeUnit.MINU... |
Normalizes elements in 'u' by dividing by max and computes the norm2 of the normalized
array u. Adjust the sign of the returned value depending on the size of the first
element in 'u'. Normalization is done to avoid overflow.
<pre>
for i=j:numRows
u[i] = u[i] / max
tau = tau + u[i]*u[i]
end
tau = sqrt(tau)
if( u[j] &... | [
"public static double computeTauAndDivide(final int j, final int numRows ,\n final double[] u , final double max) {\n double tau = 0;\n// double div_max = 1.0/max;\n// if( Double.isInfinite(div_max)) {\n for( int i = j; i < numRows; i++ ) {... | [
"@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 (... |
append human message to JsonRtn class
@param jsonRtn
@return | [
"private static JsonRtn appendErrorHumanMsg(JsonRtn jsonRtn) {\n if (bundle == null || jsonRtn == null || StringUtils.isEmpty(jsonRtn.getErrCode())) {\n return null;\n }\n\n try {\n jsonRtn.setErrHumanMsg(bundle.getString(jsonRtn.getErrCode()));\n return jsonRtn... | [
"private Task readTask(ChildTaskContainer parent, Integer id)\n {\n Table a0 = getTable(\"A0TAB\");\n Table a1 = getTable(\"A1TAB\");\n Table a2 = getTable(\"A2TAB\");\n Table a3 = getTable(\"A3TAB\");\n Table a4 = getTable(\"A4TAB\");\n\n Task task = parent.addTask();\n MapRow ... |
Set the state of an individual day in a weekly recurrence.
@param day Day instance
@param value true if this day is included in the recurrence | [
"public void setWeeklyDay(Day day, boolean value)\n {\n if (value)\n {\n m_days.add(day);\n }\n else\n {\n m_days.remove(day);\n }\n }"
] | [
"private static void updateSniffingLoggersLevel(Logger logger) {\n\n\t\tInputStream settingIS = FoundationLogger.class\n\t\t\t\t.getResourceAsStream(\"/sniffingLogger.xml\");\n\t\tif (settingIS == null) {\n\t\t\tlogger.debug(\"file sniffingLogger.xml not found in classpath\");\n\t\t} else {\n\t\t\ttry {\n\t\t\t\tSA... |
Constructs a list of items with given separators.
@param sql
StringBuilder to which the constructed string will be
appended.
@param list
List of objects (usually strings) to join.
@param init
String to be added to the start of the list, before any of the
items.
@param sep
Separator string to be added between items in ... | [
"protected void appendList(StringBuilder sql, List<?> list, String init, String sep) {\n\n boolean first = true;\n\n for (Object s : list) {\n if (first) {\n sql.append(init);\n } else {\n sql.append(sep);\n }\n sql.append(s);\n... | [
"public ItemRequest<Section> delete(String section) {\n \n String path = String.format(\"/sections/%s\", section);\n return new ItemRequest<Section>(this, Section.class, path, \"DELETE\");\n }",
"void writeBestRankTriples() {\n\t\tfor (Resource resource : this.rankBuffer.getBestRankedStatement... |
Use this API to add dnsaaaarec. | [
"public static base_response add(nitro_service client, dnsaaaarec resource) throws Exception {\n\t\tdnsaaaarec addresource = new dnsaaaarec();\n\t\taddresource.hostname = resource.hostname;\n\t\taddresource.ipv6address = resource.ipv6address;\n\t\taddresource.ttl = resource.ttl;\n\t\treturn addresource.add_resource... | [
"public void deploy(DeploymentPhaseContext phaseContext) throws DeploymentUnitProcessingException {\n final ResourceRoot deploymentRoot = phaseContext.getDeploymentUnit().getAttachment(Attachments.DEPLOYMENT_ROOT);\n final ModuleSpecification moduleSpecification = phaseContext.getDeploymentUnit().getA... |
Use this API to disable snmpalarm resources of given names. | [
"public static base_responses disable(nitro_service client, String trapname[]) throws Exception {\n\t\tbase_responses result = null;\n\t\tif (trapname != null && trapname.length > 0) {\n\t\t\tsnmpalarm disableresources[] = new snmpalarm[trapname.length];\n\t\t\tfor (int i=0;i<trapname.length;i++){\n\t\t\t\tdisabler... | [
"public static <T> DatabaseTableConfig<T> fromClass(DatabaseType databaseType, Class<T> clazz) throws SQLException {\n\t\tString tableName = extractTableName(databaseType, clazz);\n\t\tif (databaseType.isEntityNamesMustBeUpCase()) {\n\t\t\ttableName = databaseType.upCaseEntityName(tableName);\n\t\t}\n\t\treturn new... |
Create a random permutation of the numbers 0, ..., size - 1.
see Algorithm P, D.E. Knuth: The Art of Computer Programming, Vol. 2, p. 145 | [
"public static int[] randomPermutation(int size) {\n Random r = new Random();\n int[] result = new int[size];\n\n for (int j = 0; j < size; j++) {\n result[j] = j;\n }\n \n for (int j = size - 1; j > 0; j--) {\n int k = r.nextInt(j);\n int t... | [
"public static void requireNamespace(final XMLExtendedStreamReader reader, final Namespace requiredNs) throws XMLStreamException {\n Namespace actualNs = Namespace.forUri(reader.getNamespaceURI());\n if (actualNs != requiredNs) {\n throw unexpectedElement(reader);\n }\n }",
"pro... |
Returns a new AWT BufferedImage from this image.
@param type the type of buffered image to create, if not specified then defaults to the current image type
@return a new, non-shared, BufferedImage with the same data as this Image. | [
"public BufferedImage toNewBufferedImage(int type) {\n BufferedImage target = new BufferedImage(width, height, type);\n Graphics2D g2 = (Graphics2D) target.getGraphics();\n g2.drawImage(awt, 0, 0, null);\n g2.dispose();\n return target;\n }"
] | [
"public static base_responses add(nitro_service client, snmpuser resources[]) throws Exception {\n\t\tbase_responses result = null;\n\t\tif (resources != null && resources.length > 0) {\n\t\t\tsnmpuser addresources[] = new snmpuser[resources.length];\n\t\t\tfor (int i=0;i<resources.length;i++){\n\t\t\t\taddresource... |
Encodes the given URI path with the given encoding.
@param path the path to be encoded
@param encoding the character encoding to encode to
@return the encoded path
@throws UnsupportedEncodingException when the given encoding parameter is not supported | [
"public static String encodePath(String path, String encoding) throws UnsupportedEncodingException {\n\t\treturn HierarchicalUriComponents.encodeUriComponent(path, encoding, HierarchicalUriComponents.Type.PATH);\n\t}"
] | [
"public void removeWorstFit() {\n // find the observation with the most error\n int worstIndex=-1;\n double worstError = -1;\n\n for( int i = 0; i < y.numRows; i++ ) {\n double predictedObs = 0;\n\n for( int j = 0; j < coef.numRows; j++ ) {\n predicte... |
Count the total number of queued resource requests for all queues. The
result is "approximate" in the face of concurrency since individual
queues can change size during the aggregate count.
@return The (approximate) aggregate count of queued resource requests. | [
"public int getRegisteredResourceRequestCount() {\n int count = 0;\n for(Entry<K, Queue<AsyncResourceRequest<V>>> entry: this.requestQueueMap.entrySet()) {\n // FYI: .size() is not constant time in the next call. ;)\n count += entry.getValue().size();\n }\n return c... | [
"public void prepareServer() {\n try {\n server = new Server(0);\n jettyHandler = new AbstractHandler() {\n public void handle(String target, Request req, HttpServletRequest request,\n HttpServletResponse response) throws IOException, Ser... |
Draw a rounded rectangular boundary.
@param rect rectangle
@param color colour
@param linewidth line width
@param r radius for rounded corners | [
"public void strokeRoundRectangle(Rectangle rect, Color color, float linewidth, float r) {\n\t\ttemplate.saveState();\n\t\tsetStroke(color, linewidth, null);\n\t\ttemplate.roundRectangle(origX + rect.getLeft(), origY + rect.getBottom(), rect.getWidth(), rect.getHeight(), r);\n\t\ttemplate.stroke();\n\t\ttemplate.re... | [
"private void merge(ExecutionStatistics otherStatistics) {\n for (String s : otherStatistics.executionInfo.keySet())\n {\n TimingData thisStats = this.executionInfo.get(s);\n TimingData otherStats = otherStatistics.executionInfo.get(s);\n if(thisStats == null) {\n ... |
Use this API to count bridgegroup_vlan_binding resources configued on NetScaler. | [
"public static long count(nitro_service service, Long id) throws Exception{\n\t\tbridgegroup_vlan_binding obj = new bridgegroup_vlan_binding();\n\t\tobj.set_id(id);\n\t\toptions option = new options();\n\t\toption.set_count(true);\n\t\tbridgegroup_vlan_binding response[] = (bridgegroup_vlan_binding[]) obj.get_resou... | [
"public User getLimits() throws FlickrException {\r\n Map<String, Object> parameters = new HashMap<String, Object>();\r\n parameters.put(\"method\", METHOD_GET_LIMITS);\r\n\r\n Response response = transportAPI.get(transportAPI.getPath(), parameters, apiKey, sharedSecret);\r\n if (respons... |
Parses values out of the header text.
@param header header text | [
"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 ... | [
"public static csparameter get(nitro_service service) throws Exception{\n\t\tcsparameter obj = new csparameter();\n\t\tcsparameter[] response = (csparameter[])obj.get_resources(service);\n\t\treturn response[0];\n\t}",
"public static <T> T[] concat(T firstElement, T... array) {\n\t\t@SuppressWarnings(\"unchecked\... |
Converts the http entity to string. If entity is null, returns empty string.
@param entity
@return
@throws IOException | [
"public static String entityToString(HttpEntity entity) throws IOException {\n if (entity != null) {\n InputStream is = entity.getContent();\n return IOUtils.toString(is, \"UTF-8\");\n }\n return \"\";\n }"
] | [
"public RendererBuilder<T> withPrototype(Renderer<? extends T> renderer) {\n if (renderer == null) {\n throw new NeedsPrototypesException(\n \"RendererBuilder can't use a null Renderer<T> instance as prototype\");\n }\n this.prototypes.add(renderer);\n return this;\n }",
"public static ... |
Gets the time warp.
@return the time warp | [
"@PrefMetadata(type = CmsTimeWarpPreference.class)\n public String getTimeWarp() {\n\n long warp = m_settings.getTimeWarp();\n return warp < 0 ? \"\" : \"\" + warp; // if timewarp < 0 (i.e. time warp is not set), use the empty string because we don't want the date selector widget to interpret the n... | [
"public static final String getString(byte[] data, int offset)\n {\n return getString(data, offset, data.length - offset);\n }",
"private void WebPageCloseOnClick(GVRViewSceneObject gvrWebViewSceneObject, GVRSceneObject gvrSceneObjectAnchor, String url) {\n final String urlFinal = url;\n\n ... |
Creates a new Box Developer Edition connection with enterprise token leveraging an access token cache.
@param enterpriseId the enterprise ID to use for requesting access token.
@param clientId the client ID to use when exchanging the JWT assertion for an access token.
@param clientSecret ... | [
"public static BoxDeveloperEditionAPIConnection getAppEnterpriseConnection(String enterpriseId, String clientId,\n String clientSecret, JWTEncryptionPreferences encryptionPref, IAccessTokenCache accessTokenCache) {\n\n BoxDeveloperEditionAPIConnection connection = new BoxDeveloperEditionAPIConnect... | [
"public static ForwardCurveInterpolation createForwardCurveFromMonteCarloLiborModel(String name, LIBORModelMonteCarloSimulationModel model, double startTime) throws CalculationException{\n\n\t\tint timeIndex\t= model.getTimeIndex(startTime);\n\t\t// Get all Libors at timeIndex which are not yet fixed (others null) ... |
Reads color table as 256 RGB integer values.
@param ncolors int number of colors to read.
@return int array containing 256 colors (packed ARGB with full alpha). | [
"private int[] readColorTable(int ncolors) {\n int nbytes = 3 * ncolors;\n int[] tab = null;\n byte[] c = new byte[nbytes];\n\n try {\n rawData.get(c);\n\n // Max size to avoid bounds checks.\n tab = new int[MAX_BLOCK_SIZE];\n int i = 0;\n ... | [
"@Override\n\tpublic T next() {\n\t\tSQLException sqlException = null;\n\t\ttry {\n\t\t\tT result = nextThrow();\n\t\t\tif (result != null) {\n\t\t\t\treturn result;\n\t\t\t}\n\t\t} catch (SQLException e) {\n\t\t\tsqlException = e;\n\t\t}\n\t\t// we have to throw if there is no next or on a SQLException\n\t\tlast =... |
This method returns the installed identity with the requested name and version.
If the product name is null, the default identity will be returned.
If the product name was recognized and the requested version was not null,
the version comparison will take place. If the version of the currently installed product
doesn'... | [
"@Override\n public InstalledIdentity getInstalledIdentity(String productName, String productVersion) throws PatchingException {\n final String defaultIdentityName = defaultIdentity.getIdentity().getName();\n if(productName == null) {\n productName = defaultIdentityName;\n }\n\n ... | [
"public void printMinors(int matrix[], int N, PrintStream stream) {\n this.N = N;\n this.stream = stream;\n\n // compute all the minors\n int index = 0;\n for( int i = 1; i <= N; i++ ) {\n for( int j = 1; j <= N; j++ , index++) {\n stream.print(\" ... |
Given a directory, determine if it contains a multi-file database whose format
we can process.
@param directory directory to process
@return ProjectFile instance if we can process anything, or null | [
"private ProjectFile handleDatabaseInDirectory(File directory) throws Exception\n {\n byte[] buffer = new byte[BUFFER_SIZE];\n File[] files = directory.listFiles();\n if (files != null)\n {\n for (File file : files)\n {\n if (file.isDirectory())\n {\n ... | [
"public AppMsg setLayoutGravity(int gravity) {\n mLayoutParams = new FrameLayout.LayoutParams(LayoutParams.MATCH_PARENT, LayoutParams.WRAP_CONTENT, gravity);\n return this;\n }",
"public ContentAssistEntry createProposal(final String proposal, final ContentAssistContext context, final Procedure1<... |
Refresh's this connection's access token using its refresh token.
@throws IllegalStateException if this connection's access token cannot be refreshed. | [
"public void refresh() {\n this.refreshLock.writeLock().lock();\n\n if (!this.canRefresh()) {\n this.refreshLock.writeLock().unlock();\n throw new IllegalStateException(\"The BoxAPIConnection cannot be refreshed because it doesn't have a \"\n + \"refresh token.\");... | [
"public Operation.Info create( Symbol op , Variable left , Variable right ) {\n switch( op ) {\n case PLUS:\n return Operation.add(left, right, managerTemp);\n\n case MINUS:\n return Operation.subtract(left, right, managerTemp);\n\n case TIMES:\n... |
Store the data of a print job in the registry.
@param printJobStatus the print job status | [
"private void store(final PrintJobStatus printJobStatus) throws JSONException {\n JSONObject metadata = new JSONObject();\n metadata.put(JSON_REQUEST_DATA, printJobStatus.getEntry().getRequestData().getInternalObj());\n metadata.put(JSON_STATUS, printJobStatus.getStatus().toString());\n ... | [
"public synchronized void becomeTempoMaster() throws IOException {\n logger.debug(\"Trying to become master.\");\n if (!isSendingStatus()) {\n throw new IllegalStateException(\"Must be sending status updates to become the tempo master.\");\n }\n\n // Is there someone we need t... |
This method writes predecessor data to an MSPDI file.
We have to deal with a slight anomaly in this method that is introduced
by the MPX file format. It would be possible for someone to create an
MPX file with both the predecessor list and the unique ID predecessor
list populated... which means that we must process bot... | [
"private void writePredecessors(Project.Tasks.Task xml, Task mpx)\n {\n List<Project.Tasks.Task.PredecessorLink> list = xml.getPredecessorLink();\n\n List<Relation> predecessors = mpx.getPredecessors();\n for (Relation rel : predecessors)\n {\n Integer taskUniqueID = rel.getTargetTask(... | [
"public static String expandLine(CharSequence self, int tabStop) {\n String s = self.toString();\n int index;\n while ((index = s.indexOf('\\t')) != -1) {\n StringBuilder builder = new StringBuilder(s);\n int count = tabStop - index % tabStop;\n builder.deleteCh... |
Creates builder for passed path element
@param elementName name of xml element that is used as decorator
@return PersistentResourceXMLBuilder
@deprecated decorator element support is currently considered as preview
@since 4.0 | [
"@Deprecated\n public static PersistentResourceXMLBuilder decorator(final String elementName) {\n return new PersistentResourceXMLBuilder(PathElement.pathElement(elementName), null).setDecoratorGroup(elementName);\n }"
] | [
"private SearchableItem buildSearchableItem(Message menuItem) {\n return new SearchableItem((int) ((NumberField) menuItem.arguments.get(1)).getValue(),\n ((StringField) menuItem.arguments.get(3)).getValue());\n }",
"protected Collection provideStateManagers(Collection pojos)\r\n {\r\n ... |
Entry point for this example
Uses HDFS ToolRunner to wrap processing of
@param args Command-line arguments for HDFS example | [
"public static void main(String[] args) {\n CmdLine cmd = new CmdLine();\n Configuration conf = new Configuration();\n int res = 0;\n try {\n res = ToolRunner.run(conf, cmd, args);\n } catch (Exception e) {\n System.err.println(\"Error while running MR job\")... | [
"private void getYearlyDates(Calendar calendar, List<Date> dates)\n {\n if (m_relative)\n {\n getYearlyRelativeDates(calendar, dates);\n }\n else\n {\n getYearlyAbsoluteDates(calendar, dates);\n }\n }",
"private <T extends Index> List<T> listIndexType(String type,... |
Mbeans for FETCH_ENTRIES | [
"@JmxGetter(name = \"avgFetchEntriesNetworkTimeMs\", description = \"average time spent on network, for streaming operations\")\n public double getAvgFetchEntriesNetworkTimeMs() {\n return networkTimeCounterMap.get(Operation.FETCH_ENTRIES).getAvgEventValue()\n / Time.NS_PER_MS;\n }"
] | [
"public static <R extends Resource<?>, U extends PaginatedResponse<R>> Flux<R> getResources(U response) {\n return Flux.fromIterable(response.getResources());\n }",
"protected void addPoint(double time, RandomVariable value, boolean isParameter) {\n\t\tsynchronized (rationalFunctionInterpolationLazyInit... |
Determine the target type for the generic return type of the given method,
where formal type variables are declared on the given class.
@param method the method to introspect
@param clazz the class to resolve type variables against
@return the corresponding generic parameter or return type
@see #resolveReturnTypeForGen... | [
"public static Class<?> resolveReturnType(Method method, Class<?> clazz) {\n\t\tAssert.notNull(method, \"Method must not be null\");\n\t\tType genericType = method.getGenericReturnType();\n\t\tAssert.notNull(clazz, \"Class must not be null\");\n\t\tMap<TypeVariable, Type> typeVariableMap = getTypeVariableMap(clazz)... | [
"private Object getColumnValue(String table, String column, String data, int type, boolean epochDateFormat) throws MPXJException\n {\n try\n {\n Object value = null;\n\n switch (type)\n {\n case Types.BIT:\n {\n value = DatatypeConverter.parseB... |
Use this API to fetch sslservicegroup_sslcertkey_binding resources of given name . | [
"public static sslservicegroup_sslcertkey_binding[] get(nitro_service service, String servicegroupname) throws Exception{\n\t\tsslservicegroup_sslcertkey_binding obj = new sslservicegroup_sslcertkey_binding();\n\t\tobj.set_servicegroupname(servicegroupname);\n\t\tsslservicegroup_sslcertkey_binding response[] = (ssl... | [
"public void rollback() throws GitAPIException {\n try (Git git = getGit()) {\n git.reset().setMode(ResetCommand.ResetType.HARD).setRef(HEAD).call();\n }\n }",
"private void ensureFields(ClassDescriptorDef classDef, Collection fields) throws ConstraintException\r\n {\r\n bool... |
Checks whether given class descriptor has a primary key.
@param classDef The class descriptor
@param checkLevel The current check level (this constraint is only checked in strict)
@exception ConstraintException If the constraint has been violated | [
"private void checkPrimaryKey(ClassDescriptorDef classDef, String checkLevel) throws ConstraintException\r\n {\r\n if (CHECKLEVEL_NONE.equals(checkLevel))\r\n {\r\n return;\r\n }\r\n\r\n if (classDef.getBooleanProperty(PropertyHelper.OJB_PROPERTY_GENERATE_TABLE_INFO, true) ... | [
"public static void copyRecursively(final Path source, final Path target, boolean overwrite) throws IOException {\n final CopyOption[] options;\n if (overwrite) {\n options = new CopyOption[]{StandardCopyOption.COPY_ATTRIBUTES, StandardCopyOption.REPLACE_EXISTING};\n } else {\n ... |
Returns true if this Bytes object equals another. This method checks it's arguments.
@since 1.2.0 | [
"public boolean contentEquals(byte[] bytes, int offset, int len) {\n Preconditions.checkArgument(len >= 0 && offset >= 0 && offset + len <= bytes.length);\n return contentEqualsUnchecked(bytes, offset, len);\n }"
] | [
"private void checkSequenceName(FieldDescriptorDef fieldDef, String checkLevel) throws ConstraintException\r\n {\r\n if (CHECKLEVEL_NONE.equals(checkLevel))\r\n {\r\n return;\r\n }\r\n\r\n String autoIncr = fieldDef.getProperty(PropertyHelper.OJB_PROPERTY_AUTOINCREMENT);\r\... |
Get HttpResourceModel which matches the HttpMethod of the request.
@param routableDestinations List of ResourceModels.
@param targetHttpMethod HttpMethod.
@param requestUri request URI.
@return RoutableDestination that matches httpMethod that needs to be handled. null if there are no matches. | [
"private PatternPathRouterWithGroups.RoutableDestination<HttpResourceModel>\n getMatchedDestination(List<PatternPathRouterWithGroups.RoutableDestination<HttpResourceModel>> routableDestinations,\n HttpMethod targetHttpMethod, String requestUri) {\n\n LOG.trace(\"Routable destinations for ... | [
"public static base_responses delete(nitro_service client, clusterinstance resources[]) throws Exception {\n\t\tbase_responses result = null;\n\t\tif (resources != null && resources.length > 0) {\n\t\t\tclusterinstance deleteresources[] = new clusterinstance[resources.length];\n\t\t\tfor (int i=0;i<resources.length... |
Determines whether the current object on the specified level has a specific property, and if so, processes the
template
@param template The template
@param attributes The attributes of the tag
@exception XDocletException If an error occurs
@doc.tag type="block"
@doc.param ... | [
"public void ifHasProperty(String template, Properties attributes) throws XDocletException\r\n {\r\n String value = getPropertyValue(attributes.getProperty(ATTRIBUTE_LEVEL), attributes.getProperty(ATTRIBUTE_NAME));\r\n\r\n if (value != null)\r\n {\r\n generate(template);\r\n ... | [
"public static List<File> listFilesByRegex(String regex, File... directories) {\n return listFiles(directories,\n new RegexFileFilter(regex),\n CanReadFileFilter.CAN_READ);\n }",
"public ParallelTaskBuilder setReplaceVarMapToSingleTargetFromMap(\n Map<String, Str... |
Appends the given string to the given StringBuilder, replacing '&',
'<' and '>' by their respective HTML entities.
@param out
The StringBuilder to append to.
@param value
The string to append.
@param offset
The character offset into value from where to start | [
"public final static void codeEncode(final StringBuilder out, final String value, final int offset)\n {\n for (int i = offset; i < value.length(); i++)\n {\n final char c = value.charAt(i);\n switch (c)\n {\n case '&':\n out.append(\"&\... | [
"private String getCurrencyFormat(CurrencySymbolPosition position)\n {\n String result;\n\n switch (position)\n {\n case AFTER:\n {\n result = \"1.1#\";\n break;\n }\n\n case AFTER_WITH_SPACE:\n {\n result = \"1.1 #\";\n ... |
Filter that's either negated or normal as specified. | [
"public static <E> Filter<E> switchedFilter(Filter<E> filter, boolean negated) {\r\n return (new NegatedFilter<E>(filter, negated));\r\n }"
] | [
"public static sslocspresponder get(nitro_service service, String name) throws Exception{\n\t\tsslocspresponder obj = new sslocspresponder();\n\t\tobj.set_name(name);\n\t\tsslocspresponder response = (sslocspresponder) obj.get_resource(service);\n\t\treturn response;\n\t}",
"private void parseResponse(InputStream... |
Return the factor loading for a given time and a given component.
The factor loading is the vector <i>f<sub>i</sub></i> such that the scalar product <br>
<i>f<sub>j</sub>f<sub>k</sub> = f<sub>j,1</sub>f<sub>k,1</sub> + ... + f<sub>j,m</sub>f<sub>k,m</sub></i> <br>
is the instantaneous covariance of the component <i>j<... | [
"public\tRandomVariableInterface[]\tgetFactorLoading(double time, double component, RandomVariableInterface[] realizationAtTimeIndex) {\n\t\tint componentIndex = liborPeriodDiscretization.getTimeIndex(component);\n\t\tif(componentIndex < 0) {\n\t\t\tcomponentIndex = -componentIndex - 2;\n\t\t}\n\t\treturn getFactor... | [
"synchronized void started() {\n try {\n if(isConnected()) {\n channelHandler.executeRequest(new ServerStartedRequest(), null).getResult().await();\n }\n } catch (Exception e) {\n ServerLogger.AS_ROOT_LOGGER.debugf(e, \"failed to send started notificatio... |
If the burst mode is on, emit the particles only once.
@param particlePositions
@param particleVelocities
@param particleTimeStamps | [
"protected void emitWithBurstCheck(float[] particlePositions, float[] particleVelocities,\n float[] particleTimeStamps)\n {\n if ( burstMode )\n {\n if ( executeOnce )\n {\n emit(particlePositions, particleVelocities, particleTimeStamps)... | [
"public OJBLock atomicGetOrCreateLock(Object resourceId, Object isolationId)\r\n {\r\n synchronized(globalLocks)\r\n {\r\n MultiLevelLock lock = getLock(resourceId);\r\n if(lock == null)\r\n {\r\n lock = createLock(resourceId, isolationId);\r\n ... |
refresh all deliveries dependencies for a particular product | [
"public void work(RepositoryHandler repoHandler, DbProduct product) {\n if (!product.getDeliveries().isEmpty()) {\n\n product.getDeliveries().forEach(delivery -> {\n\n final Set<Artifact> artifacts = new HashSet<>();\n\n final DataFetchingUtils utils = new DataFetchin... | [
"private <T> MongoCollection<T> getLocalCollection(\n final MongoNamespace namespace,\n final Class<T> resultClass,\n final CodecRegistry codecRegistry\n ) {\n return localClient\n .getDatabase(String.format(\"sync_user_%s\", namespace.getDatabaseName()))\n .getCollection(namespace.... |
Gets the registration point that been associated with the registration for the longest period.
@return the initial registration point, or {@code null} if there are no longer any registration points | [
"public synchronized RegistrationPoint getOldestRegistrationPoint() {\n return registrationPoints.size() == 0 ? null : registrationPoints.values().iterator().next().get(0);\n }"
] | [
"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 ... |
Look for the closing parenthesis corresponding to the one at position
represented by the opening index.
@param text input expression
@param opening opening parenthesis index
@return closing parenthesis index | [
"private int getClosingParenthesisPosition(String text, int opening)\n {\n if (text.charAt(opening) != '(')\n {\n return -1;\n }\n\n int count = 0;\n for (int i = opening; i < text.length(); i++)\n {\n char c = text.charAt(i);\n switch (c)\n {\n ... | [
"public String getRelativePath() {\n final StringBuilder builder = new StringBuilder();\n for(final String p : path) {\n builder.append(p).append(\"/\");\n }\n builder.append(getName());\n return builder.toString();\n }",
"public void insertValue(int index, float[]... |
Extracts baseline cost from the MPP file for a specific baseline.
Returns null if no baseline cost is present, otherwise returns
a list of timephased work items.
@param calendar baseline calendar
@param normaliser normaliser associated with this data
@param data timephased baseline work data block
@param raw flag indi... | [
"public TimephasedCostContainer getBaselineCost(ProjectCalendar calendar, TimephasedCostNormaliser normaliser, byte[] data, boolean raw)\n {\n TimephasedCostContainer result = null;\n\n if (data != null && data.length > 0)\n {\n LinkedList<TimephasedCost> list = null;\n\n //System.o... | [
"public void addChannel(String boneName, GVRAnimationChannel channel)\n {\n int boneId = mSkeleton.getBoneIndex(boneName);\n if (boneId >= 0)\n {\n mBoneChannels[boneId] = channel;\n mSkeleton.setBoneOptions(boneId, GVRSkeleton.BONE_ANIMATE);\n Log.d(\"BONE\"... |
Returns the z-coordinate of a vertex normal.
@param vertex the vertex index
@return the z coordinate | [
"public float getNormalZ(int vertex) {\n if (!hasNormals()) {\n throw new IllegalStateException(\"mesh has no normals\");\n }\n \n checkVertexIndexBounds(vertex);\n \n return m_normals.getFloat((vertex * 3 + 2) * SIZEOF_FLOAT);\n }"
] | [
"private void addUDFValue(FieldTypeClass fieldType, FieldContainer container, Row row)\n {\n Integer fieldId = row.getInteger(\"udf_type_id\");\n String fieldName = m_udfFields.get(fieldId);\n\n Object value = null;\n FieldType field = m_project.getCustomFields().getFieldByAlias(fieldType, fie... |
Returns the shared prefix of these columns. Null otherwise.
@param associationKeyColumns the columns sharing a prefix
@return the shared prefix of these columns. {@code null} otherwise. | [
"public static String getColumnSharedPrefix(String[] associationKeyColumns) {\n\t\tString prefix = null;\n\t\tfor ( String column : associationKeyColumns ) {\n\t\t\tString newPrefix = getPrefix( column );\n\t\t\tif ( prefix == null ) { // first iteration\n\t\t\t\tprefix = newPrefix;\n\t\t\t\tif ( prefix == null ) {... | [
"private Filter getFilter(String layerFilter, String[] featureIds) throws GeomajasException {\n\t\tFilter filter = null;\n\t\tif (null != layerFilter) {\n\t\t\tfilter = filterService.parseFilter(layerFilter);\n\t\t}\n\t\tif (null != featureIds) {\n\t\t\tFilter fidFilter = filterService.createFidFilter(featureIds);\... |
Removes a design document using the id and rev from the database.
@param id the document id (optionally prefixed with "_design/")
@param rev the document revision
@return {@link DesignDocument} | [
"public Response remove(String id, String rev) {\r\n assertNotEmpty(id, \"id\");\r\n assertNotEmpty(id, \"rev\");\r\n return db.remove(ensureDesignPrefix(id), rev);\r\n\r\n }"
] | [
"private boolean addonDependsOnReporting(Addon addon)\n {\n for (AddonDependency dep : addon.getDependencies())\n {\n if (dep.getDependency().equals(this.addon))\n {\n return true;\n }\n boolean subDep = addonDependsOnReporting(dep.getDepen... |
Read all of the fields information from the configuration file. | [
"private static <T> void readFields(BufferedReader reader, DatabaseTableConfig<T> config) throws SQLException {\n\t\tList<DatabaseFieldConfig> fields = new ArrayList<DatabaseFieldConfig>();\n\t\twhile (true) {\n\t\t\tString line;\n\t\t\ttry {\n\t\t\t\tline = reader.readLine();\n\t\t\t} catch (IOException e) {\n\t\t... | [
"@NonNull\n @SuppressWarnings({\"WeakerAccess\", \"unused\"}) // For library users\n public Searcher reset() {\n lastResponsePage = 0;\n lastRequestPage = 0;\n lastResponseId = 0;\n endReached = false;\n clearFacetRefinements();\n cancelPendingRequests();\n num... |
Remove a key for all language versions. If a descriptor is present, the key is only removed in the descriptor.
@param key the key to remove.
@return <code>true</code> if removing was successful, <code>false</code> otherwise. | [
"private boolean removeKeyForAllLanguages(String key) {\n\n try {\n if (hasDescriptor()) {\n lockDescriptor();\n }\n loadAllRemainingLocalizations();\n lockAllLocalizations(key);\n } catch (CmsException | IOException e) {\n LOG.warn... | [
"public static String printUUID(UUID guid)\n {\n return guid == null ? null : \"{\" + guid.toString().toUpperCase() + \"}\";\n }",
"public void process(AvailabilityTable table, byte[] data)\n {\n if (data != null)\n {\n Calendar cal = DateHelper.popCalendar();\n int items = MP... |
Register a new SingleServiceWrapperInterceptor for the bean being
wrapped, associate it with the PerformanceMonitor and tell it which methods
to intercept.
@param source An Attribute node from the spring configuration
@param beanName The name of the bean that this performance monitor is wrapped around
@param registry ... | [
"private void registerInterceptor(Node source,\n String beanName,\n BeanDefinitionRegistry registry) {\n List<String> methodList = buildMethodList(source);\n\n BeanDefinitionBuilder initializer =\n BeanDefinitionBuilder... | [
"public static <T> Observable<T> delayedEmitAsync(T event, int milliseconds) {\n return delayProvider.delayedEmitAsync(event, milliseconds);\n }",
"public static Integer convertPathIdentifier(String identifier, Integer profileId) throws Exception {\n Integer pathId = -1;\n try {\n ... |
Returns the parsed story from the given path
@param configuration the Configuration used to run story
@param storyPath the story path
@return The parsed Story | [
"public Story storyOfPath(Configuration configuration, String storyPath) {\n String storyAsText = configuration.storyLoader().loadStoryAsText(storyPath);\n return configuration.storyParser().parseStory(storyAsText, storyPath);\n }"
] | [
"public void configure(@Observes(precedence = -10) ArquillianDescriptor arquillianDescriptor) {\n Map<String, String> config = arquillianDescriptor.extension(EXTENSION_NAME).getExtensionProperties();\n CubeConfiguration cubeConfiguration = CubeConfiguration.fromMap(config);\n configurationProdu... |
Sets the node meta data but allows overwriting values.
@param key - the meta data key
@param value - the meta data value
@return the old node meta data value for this key
@throws GroovyBugError if key is null | [
"public Object putNodeMetaData(Object key, Object value) {\n if (key == null) throw new GroovyBugError(\"Tried to set meta data with null key on \" + this + \".\");\n if (metaDataMap == null) {\n metaDataMap = new ListHashMap();\n }\n return metaDataMap.put(key, value);\n }... | [
"private static void writeUtf16Bom(OutputStream stream, boolean bigEndian) throws IOException {\n if (bigEndian) {\n stream.write(-2);\n stream.write(-1);\n } else {\n stream.write(-1);\n stream.write(-2);\n }\n }",
"public double[][] Kernel2D(in... |
Here we start a intern odmg-Transaction to hide transaction demarcation
This method could be invoked several times within a transaction, but only
the first call begin a intern odmg transaction | [
"private void beginInternTransaction()\r\n {\r\n if (log.isDebugEnabled()) log.debug(\"beginInternTransaction was called\");\r\n J2EETransactionImpl tx = (J2EETransactionImpl) super.currentTransaction();\r\n if (tx == null) tx = newInternTransaction();\r\n if (!tx.isOpen())\r\n ... | [
"public String calculateCacheKey(String sql, int autoGeneratedKeys) {\r\n\t\tStringBuilder tmp = new StringBuilder(sql.length()+4);\r\n\t\ttmp.append(sql);\r\n\t\ttmp.append(autoGeneratedKeys);\r\n\t\treturn tmp.toString();\r\n\t}",
"public synchronized void delete(String name) {\n if (isEmpty(name)) {\n ... |
Converts a date series configuration to a date series bean.
@return the date series bean. | [
"public CmsJspDateSeriesBean getToDateSeries() {\n\n if (m_dateSeries == null) {\n m_dateSeries = new CmsJspDateSeriesBean(this, m_cms.getRequestContext().getLocale());\n }\n return m_dateSeries;\n }"
] | [
"private static Point getScreenSize(Context context, Point p) {\n if (p == null) {\n p = new Point();\n }\n WindowManager windowManager = (WindowManager) context\n .getSystemService(Context.WINDOW_SERVICE);\n Display display = windowManager.getDefaultDisplay();\... |
Create a JavadocComment, by formatting the text of the Javadoc using the given indentation. | [
"public JavadocComment toComment(String indentation) {\n for (char c : indentation.toCharArray()) {\n if (!Character.isWhitespace(c)) {\n throw new IllegalArgumentException(\"The indentation string should be composed only by whitespace characters\");\n }\n }\n ... | [
"@SuppressWarnings(\"unchecked\")\n\tpublic <T extends Annotation> T getAnnotation(Class<T> annotationType) {\n\t\tfor (Annotation annotation : this.annotations) {\n\t\t\tif (annotation.annotationType().equals(annotationType)) {\n\t\t\t\treturn (T) annotation;\n\t\t\t}\n\t\t}\n\t\tfor (Annotation metaAnn : this.ann... |
Returns all accessible projects of the given organizational unit.
That is all projects which are owned by the current user or which are
accessible for the group of the user.<p>
@param cms the opencms context
@param ouFqn the fully qualified name of the organizational unit to get projects for
@param includeSubOus if a... | [
"public List<CmsProject> getAllAccessibleProjects(CmsObject cms, String ouFqn, boolean includeSubOus)\n throws CmsException {\n\n CmsOrganizationalUnit orgUnit = readOrganizationalUnit(cms, ouFqn);\n return (m_securityManager.getAllAccessibleProjects(cms.getRequestContext(), orgUnit, includeSubOus)... | [
"public static int rank(DMatrixRMaj A , double threshold ) {\n SingularValueDecomposition_F64<DMatrixRMaj> svd = DecompositionFactory_DDRM.svd(A.numRows,A.numCols,false,false,true);\n\n if( svd.inputModified() )\n A = A.copy();\n\n if( !svd.decompose(A) )\n throw new Runti... |
Parses the dictionary from an InputStream.
@param client The SolrClient instance object.
@param lang The language of the dictionary.
@param is The InputStream object.
@param documents List to put the assembled SolrInputObjects into.
@param closeStream boolean flag that determines whether to close the inputstream
or no... | [
"private static void readAndAddDocumentsFromStream(\n final SolrClient client,\n final String lang,\n final InputStream is,\n final List<SolrInputDocument> documents,\n final boolean closeStream) {\n\n final BufferedReader br = new BufferedReader(new InputStreamReader(is));... | [
"public String expand(String macro) {\n if (!isMacro(macro)) {\n return macro;\n }\n String definition = macros.get(Config.canonical(macro));\n if (null == definition) {\n warn(\"possible missing definition of macro[%s]\", macro);\n }\n return null == ... |
Add an index on the given collection and field
@param collection the collection to use for the index
@param field the field to use for the index
@param asc the sorting direction. <code>true</code> to sort ascending; <code>false</code> to sort descending
@param background iff <code>true</code> the index is ... | [
"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 Date getTimestampFromLong(long timestamp)\n {\n TimeZone tz = TimeZone.getDefault();\n Date result = new Date(timestamp - tz.getRawOffset());\n\n if (tz.inDaylightTime(result) == true)\n {\n int savings;\n\n if (HAS_DST_SAVINGS == true)\n {\n s... |
Transforms a list of Integer objects to an array of primitive int values.
@param integers
@return | [
"static int[] toIntArray(List<Integer> integers) {\n\t\tint[] ints = new int[integers.size()];\n\t\tint i = 0;\n\t\tfor (Integer n : integers) {\n\t\t\tints[i++] = n;\n\t\t}\n\t\treturn ints;\n\t}"
] | [
"public boolean absolute(int row) throws PersistenceBrokerException\r\n {\r\n // 1. handle the special cases first.\r\n if (row == 0)\r\n {\r\n return true;\r\n }\r\n\r\n if (row == 1)\r\n {\r\n m_activeIteratorIndex = 0;\r\n m_activeIter... |
Stops and clears all transitions | [
"public void removeAllAnimations() {\n for (int i = 0, size = mAnimationList.size(); i < size; i++) {\n mAnimationList.get(i).removeAnimationListener(mAnimationListener);\n }\n mAnimationList.clear();\n }"
] | [
"public static <T> T assertNotNull(T value, String message) {\n if (value == null)\n throw new IllegalStateException(message);\n return value;\n }",
"private static Map<String, String> mapCustomInfo(CustomInfoType ciType){\n Map<String, String> customInfo = new HashMap<String, S... |
add converter at given index. The index can be changed during conversion
if canReorder is true
@param index
@param converter | [
"public void addConverter(int index, IConverter converter) {\r\n\t\tconverterList.add(index, converter);\r\n\t\tif (converter instanceof IContainerConverter) {\r\n\t\t\tIContainerConverter containerConverter = (IContainerConverter) converter;\r\n\t\t\tif (containerConverter.getElementConverter() == null) {\r\n\t\t\... | [
"public static Object instantiate(Constructor constructor) throws InstantiationException\r\n {\r\n if(constructor == null)\r\n {\r\n throw new ClassNotPersistenceCapableException(\r\n \"A zero argument constructor was not provided!\");\r\n }\r\n\r\n Objec... |
Gets the automaton by id.
@param id the id
@return the automaton by id
@throws IOException Signals that an I/O exception has occurred. | [
"public Automaton getAutomatonById(String id) throws IOException {\n if (idToVersion.containsKey(id)) {\n List<BytesRef> bytesArray = new ArrayList<>();\n Set<String> data = get(id);\n if (data != null) {\n Term term;\n for (String item : data) {\n term = new Term(\"dummy\",... | [
"public <T> T cached(String key) {\n H.Session sess = session();\n if (null != sess) {\n return sess.cached(key);\n } else {\n return app().cache().get(key);\n }\n }",
"public static String resolveSvnMigratedRevision(final Revision revision, final String branch... |
binds the Identities Primary key values to the statement | [
"public void bindDelete(PreparedStatement stmt, Identity oid, ClassDescriptor cld) throws SQLException\r\n {\r\n Object[] pkValues = oid.getPrimaryKeyValues();\r\n FieldDescriptor[] pkFields = cld.getPkFields();\r\n int i = 0;\r\n try\r\n {\r\n for (; i < pkValues.le... | [
"public static void writeCorrelationId(Message message, String correlationId) {\n Map<String, List<String>> headers = getOrCreateProtocolHeader(message);\n headers.put(CORRELATIONID_HTTP_HEADER_NAME, Collections.singletonList(correlationId));\n if (LOG.isLoggable(Level.FINE)) {\n LOG... |
helper to calculate the actionBar height
@param context
@return | [
"public static int getActionBarHeight(Context context) {\n int actionBarHeight = UIUtils.getThemeAttributeDimensionSize(context, R.attr.actionBarSize);\n if (actionBarHeight == 0) {\n actionBarHeight = context.getResources().getDimensionPixelSize(R.dimen.abc_action_bar_default_height_materi... | [
"public void setIsSeries(Boolean isSeries) {\r\n\r\n if (null != isSeries) {\r\n final boolean series = isSeries.booleanValue();\r\n if ((null != m_model.getParentSeriesId()) && series) {\r\n m_removeSeriesBindingConfirmDialog.show(new Command() {\r\n\r\n ... |
Get upload status for the currently authenticated user.
Requires authentication with 'read' permission using the new authentication API.
@return A User object with upload status data fields filled
@throws FlickrException | [
"public User getUploadStatus() throws FlickrException {\r\n Map<String, Object> parameters = new HashMap<String, Object>();\r\n parameters.put(\"method\", METHOD_GET_UPLOAD_STATUS);\r\n\r\n Response response = transportAPI.get(transportAPI.getPath(), parameters, apiKey, sharedSecret);\r\n ... | [
"public AccrueType getAccrueType(int field)\n {\n AccrueType result;\n\n if ((field < m_fields.length) && (m_fields[field].length() != 0))\n {\n result = AccrueTypeUtility.getInstance(m_fields[field], m_locale);\n }\n else\n {\n result = null;\n }\n\n return... |
Use this API to fetch responderpolicy resource of given name . | [
"public static responderpolicy get(nitro_service service, String name) throws Exception{\n\t\tresponderpolicy obj = new responderpolicy();\n\t\tobj.set_name(name);\n\t\tresponderpolicy response = (responderpolicy) obj.get_resource(service);\n\t\treturn response;\n\t}"
] | [
"public static String urlEncode(String path) throws URISyntaxException {\n if (isNullOrEmpty(path)) return path;\n\n return UrlEscapers.urlFragmentEscaper().escape(path);\n }",
"public void saveFavorites(List<CmsFavoriteEntry> favorites) throws CmsException {\n\n try {\n JSONObj... |
Returns the primary port of the server.
@return the primary {@link ServerPort} if the server is started. {@link Optional#empty()} otherwise. | [
"public Optional<ServerPort> activePort() {\n final Server server = this.server;\n return server != null ? server.activePort() : Optional.empty();\n }"
] | [
"public CollectionRequest<Project> findByWorkspace(String workspace) {\n \n String path = String.format(\"/workspaces/%s/projects\", workspace);\n return new CollectionRequest<Project>(this, Project.class, path, \"GET\");\n }",
"public static void addIndex(DBCollection collection, String field... |
Set the default size of the texture buffers. You can call this to reduce the buffer size
of views with anti-aliasing issue.
The max value to the buffer size should be the Math.max(width, height) of attached view.
@param size buffer size. Value > 0 and <= Math.max(width, height). | [
"public void setTextureBufferSize(final int size) {\n mRootViewGroup.post(new Runnable() {\n @Override\n public void run() {\n mRootViewGroup.setTextureBufferSize(size);\n }\n });\n }"
] | [
"@JmxGetter(name = \"avgUpdateEntriesNetworkTimeMs\", description = \"average time spent on network, for streaming operations\")\n public double getAvgUpdateEntriesNetworkTimeMs() {\n return networkTimeCounterMap.get(Operation.UPDATE_ENTRIES).getAvgEventValue()\n / Time.NS_PER_MS;\n }",
... |
Parse parameters from this request using HTTP.
@param req The ServletRequest containing all request parameters.
@param cms The OpenCms object.
@return CmsSpellcheckingRequest object that contains parsed parameters. | [
"private CmsSpellcheckingRequest parseHttpRequest(final ServletRequest req, final CmsObject cms) {\n\n if ((null != cms) && OpenCms.getRoleManager().hasRole(cms, CmsRole.ROOT_ADMIN)) {\n try {\n if (null != req.getParameter(HTTP_PARAMETER_CHECKREBUILD)) {\n if (Cm... | [
"public static Operation createDeployOperation(final Set<DeploymentDescription> deployments) {\n Assertions.requiresNotNullOrNotEmptyParameter(\"deployments\", deployments);\n final CompositeOperationBuilder builder = CompositeOperationBuilder.create(true);\n for (DeploymentDescription deployme... |
Generate a set of datetime patterns to accommodate variations in MPX files.
@param datePattern date pattern element
@param timePatterns time patterns
@return datetime patterns | [
"private List<String> generateDateTimePatterns(String datePattern, String[] timePatterns)\n {\n List<String> patterns = new ArrayList<String>();\n for (String timePattern : timePatterns)\n {\n patterns.add(datePattern + \" \" + timePattern);\n }\n\n // Always fall back on the date... | [
"public static void addToMediaStore(Context context, File file) {\n String[] path = new String[]{file.getPath()};\n MediaScannerConnection.scanFile(context, path, null, null);\n }",
"public EventBus emitSync(String event, Object... args) {\n return _emitWithOnceBus(eventContextSync(event, ... |
This method maps the currency symbol position from the
representation used in the MPP file to the representation
used by MPX.
@param value MPP symbol position
@return MPX symbol position | [
"public static CurrencySymbolPosition getSymbolPosition(int value)\n {\n CurrencySymbolPosition result;\n\n switch (value)\n {\n case 1:\n {\n result = CurrencySymbolPosition.AFTER;\n break;\n }\n\n case 2:\n {\n result = Curr... | [
"static String fromPackageName(String packageName) {\n List<String> tokens = tokenOf(packageName);\n return fromTokens(tokens);\n }",
"static int[] toIntArray(List<Integer> integers) {\n\t\tint[] ints = new int[integers.size()];\n\t\tint i = 0;\n\t\tfor (Integer n : integers) {\n\t\t\tints[i++] =... |
Straight conversion from an ObjectName to a PathAddress.
There may not necessarily be a Resource at this path address (if that correspond to a pattern) but it must
match a model in the registry.
@param domain the name of the caller's JMX domain
@param registry the root resource for the management model
@param name th... | [
"static PathAddress toPathAddress(String domain, ImmutableManagementResourceRegistration registry, ObjectName name) {\n if (!name.getDomain().equals(domain)) {\n return PathAddress.EMPTY_ADDRESS;\n }\n if (name.equals(ModelControllerMBeanHelper.createRootObjectName(domain))) {\n ... | [
"private final void replyErrors(final String errorMessage,\n final String stackTrace, final String statusCode,\n final int statusCodeInt) {\n reply(true, errorMessage, stackTrace, statusCode, statusCodeInt,\n PcConstants.NA, null);\n\n }",
"public static <T> T create... |
Get the element at the index as a json array.
@param i the index of the element to access | [
"public final PJsonArray getJSONArray(final int i) {\n JSONArray val = this.array.optJSONArray(i);\n final String context = \"[\" + i + \"]\";\n if (val == null) {\n throw new ObjectMissingException(this, context);\n }\n return new PJsonArray(this, val, context);\n }... | [
"public static final int getInt(byte[] data, int offset)\n {\n int result = 0;\n int i = offset;\n for (int shiftBy = 0; shiftBy < 32; shiftBy += 8)\n {\n result |= ((data[i] & 0xff)) << shiftBy;\n ++i;\n }\n return result;\n }",
"static void initSingleParam(Strin... |
Helper. Current transaction is committed in some cases. | [
"private Integer highlanderMode(JobDef jd, DbConn cnx)\n {\n if (!jd.isHighlander())\n {\n return null;\n }\n\n try\n {\n Integer existing = cnx.runSelectSingle(\"ji_select_existing_highlander\", Integer.class, jd.getId());\n return existing;\n ... | [
"public QueryBuilder<T, ID> join(QueryBuilder<?, ?> joinedQueryBuilder) throws SQLException {\n\t\taddJoinInfo(JoinType.INNER, null, null, joinedQueryBuilder, JoinWhereOperation.AND);\n\t\treturn this;\n\t}",
"public synchronized void bindShader(GVRScene scene, boolean isMultiview)\n {\n GVRRenderPass p... |
This method displays the resource assignments for each resource. This time
rather than just iterating through the list of all assignments in
the file, we extract the assignments on a resource-by-resource basis.
@param file MPX file | [
"private static void listAssignmentsByResource(ProjectFile file)\n {\n for (Resource resource : file.getResources())\n {\n System.out.println(\"Assignments for resource \" + resource.getName() + \":\");\n\n for (ResourceAssignment assignment : resource.getTaskAssignments())\n {\n... | [
"@Override\n public T getById(Object id)\n {\n return context.getFramed().getFramedVertex(this.type, id);\n }",
"public static base_response unset(nitro_service client, sslcertkey resource, String[] args) throws Exception{\n\t\tsslcertkey unsetresource = new sslcertkey();\n\t\tunsetresource.certke... |
The entity instance is already in the session cache
Copied from Loader#instanceAlreadyLoaded | [
"private void instanceAlreadyLoaded(\n\t\tfinal Tuple resultset,\n\t\tfinal int i,\n\t\t\t//TODO create an interface for this usage\n\t\tfinal OgmEntityPersister persister,\n\t\tfinal org.hibernate.engine.spi.EntityKey key,\n\t\tfinal Object object,\n\t\tfinal LockMode lockMode,\n\t\tfinal SharedSessionContractImpl... | [
"public byte[] toByteArray() {\n try {\n ByteArrayOutputStream baos = new ByteArrayOutputStream();\n ObjectOutputStream oos = new ObjectOutputStream(baos);\n oos.writeObject(this);\n return baos.toByteArray();\n } catch (IOException e) {\n throw E... |
Sets the target translator for all cells in the table.
It will also remove any other translator set.
Nothing will happen if the argument is null.
@param targetTranslator translator
@return this to allow chaining | [
"public AsciiTable setTargetTranslator(TargetTranslator targetTranslator) {\r\n\t\tfor(AT_Row row : this.rows){\r\n\t\t\tif(row.getType()==TableRowType.CONTENT){\r\n\t\t\t\trow.setTargetTranslator(targetTranslator);\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn this;\r\n\t}"
] | [
"protected static void captureSystemStreams(boolean captureOut, boolean captureErr){\r\n if(captureOut){\r\n System.setOut(new RedwoodPrintStream(STDOUT, realSysOut));\r\n }\r\n if(captureErr){\r\n System.setErr(new RedwoodPrintStream(STDERR, realSysErr));\r\n }\r\n }",
"protected <T> Reque... |
Adds a new Site matcher object to the map of server names.
@param matcher the SiteMatcher of the server
@param site the site to add | [
"private void addServer(CmsSiteMatcher matcher, CmsSite site) {\n\n Map<CmsSiteMatcher, CmsSite> siteMatcherSites = new HashMap<CmsSiteMatcher, CmsSite>(m_siteMatcherSites);\n siteMatcherSites.put(matcher, site);\n setSiteMatcherSites(siteMatcherSites);\n }"
] | [
"public static GVRMesh createQuad(GVRContext gvrContext, float width, float height) {\n GVRMesh mesh = new GVRMesh(gvrContext);\n\n float[] vertices = { width * -0.5f, height * 0.5f, 0.0f, width * -0.5f,\n height * -0.5f, 0.0f, width * 0.5f, height * 0.5f, 0.0f,\n width *... |
Copy the contents of the given InputStream into a String.
Leaves the stream open when done.
@param in the InputStream to copy from
@return the String that has been copied to
@throws IOException in case of I/O errors | [
"public static String copyToString(InputStream in, Charset charset) throws IOException {\n\t\tAssert.notNull(in, \"No InputStream specified\");\n\t\tStringBuilder out = new StringBuilder();\n\t\tInputStreamReader reader = new InputStreamReader(in, charset);\n\t\tchar[] buffer = new char[BUFFER_SIZE];\n\t\tint bytes... | [
"@Override\n public Optional<SoyMapData> toSoyMap(@Nullable final Object model) throws Exception {\n if (model instanceof SoyMapData) {\n return Optional.of((SoyMapData) model);\n }\n if (model instanceof Map) {\n return Optional.of(new SoyMapData(model));\n }\n\... |
Returns an array specifing the index of each hull vertex with respect to
the original input points.
@return vertex indices with respect to the original points | [
"public int[] getVertexPointIndices() {\n int[] indices = new int[numVertices];\n for (int i = 0; i < numVertices; i++) {\n indices[i] = vertexPointIndices[i];\n }\n return indices;\n }"
] | [
"public List<BoxAPIResponse> execute(List<BoxAPIRequest> requests) {\n this.prepareRequest(requests);\n BoxJSONResponse batchResponse = (BoxJSONResponse) send();\n return this.parseResponse(batchResponse);\n }",
"private void sendEvents(final List<Event> events) {\n if (null != hand... |
Install the installation manager service.
@param serviceTarget
@return the service controller for the installed installation manager | [
"public static ServiceController<InstallationManager> installService(ServiceTarget serviceTarget) {\n final InstallationManagerService service = new InstallationManagerService();\n return serviceTarget.addService(InstallationManagerService.NAME, service)\n .addDependency(JBOSS_PRODUCT_C... | [
"private ModelNode resolveExpressionsRecursively(final ModelNode node) throws OperationFailedException {\n if (!node.isDefined()) {\n return node;\n }\n\n ModelType type = node.getType();\n ModelNode resolved;\n if (type == ModelType.EXPRESSION) {\n resolved ... |
Calls the specified function with the specified arguments. This is used for v2 response overrides
@param className name of class
@param methodName name of method
@param pluginArgs plugin arguments
@param args arguments to supply to function
@throws Exception exception | [
"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... | [
"protected void onNewParentObject(GVRSceneObject parent) {\n for (GVRComponent comp : mComponents.values()) {\n comp.onNewOwnersParent(parent);\n }\n }",
"public void switchDataSource(BoneCPConfig newConfig) throws SQLException {\n\t\tlogger.info(\"Switch to new datasource requested. N... |
Retrieve a map of custom document properties.
@return the Document Summary Information Map | [
"@SuppressWarnings(\"unchecked\") public Map<String, Object> getCustomProperties()\n {\n return (Map<String, Object>) getCachedValue(ProjectField.CUSTOM_PROPERTIES);\n }"
] | [
"protected void setBeanStore(BoundBeanStore beanStore) {\n if (beanStore == null) {\n this.beanStore.remove();\n } else {\n this.beanStore.set(beanStore);\n }\n }",
"void scan() {\n if (acquireScanLock()) {\n boolean scheduleRescan = false;\n ... |
Convert a wavelength to an RGB value.
@param wavelength wavelength in nanometres
@return the RGB value | [
"public static int wavelengthToRGB(float wavelength) {\n\t\tfloat gamma = 0.80f;\n\t\tfloat r, g, b, factor;\n\n\t\tint w = (int)wavelength;\n\t\tif (w < 380) {\n\t\t\tr = 0.0f;\n\t\t\tg = 0.0f;\n\t\t\tb = 0.0f;\n\t\t} else if (w < 440) {\n\t\t\tr = -(wavelength - 440) / (440 - 380);\n\t\t\tg = 0.0f;\n\t\t\tb = 1.0... | [
"public void notifyHeaderItemMoved(int fromPosition, int toPosition) {\n if (fromPosition < 0 || toPosition < 0 || fromPosition >= headerItemCount || toPosition >= headerItemCount) {\n throw new IndexOutOfBoundsException(\"The given fromPosition \" + fromPosition + \" or toPosition \" + toPosition... |
Obtain parameters from query
@param query query to scan
@return Map of parameters | [
"public static HashMap<String, String> getParameters(String query) {\n HashMap<String, String> params = new HashMap<String, String>();\n if (query == null || query.length() == 0) {\n return params;\n }\n\n String[] splitQuery = query.split(\"&\");\n for (String splitIte... | [
"private void logState(final FileRollEvent fileRollEvent) {\n\n//\t\tif (ApplicationState.isApplicationStateEnabled()) {\n\t\t\t\n\t\t\tsynchronized (this) {\n\t\t\t\t\n\t\t\t\tfinal Collection<ApplicationState.ApplicationStateMessage> entries = ApplicationState.getAppStateEntries();\n\t\t\t\tfor (ApplicationState.... |
Set the mbean server on the QueryExp and try and pass back any previously set one | [
"private static MBeanServer setQueryExpServer(QueryExp query, MBeanServer toSet) {\n // We assume the QueryExp is a QueryEval subclass or uses the QueryEval thread local\n // mechanism to store any existing MBeanServer. If that's not the case we have no\n // way to access the old mbeanserver to... | [
"public static double StdDev( int[] values, double mean ){\n double stddev = 0;\n double diff;\n int hits;\n int total = 0;\n\n // for all values\n for ( int i = 0, n = values.length; i < n; i++ )\n {\n hits = values[i];\n diff = (doub... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.