query stringlengths 7 3.3k | positive listlengths 1 1 | negative listlengths 9 9 |
|---|---|---|
Executes the rebalance plan. Does so batch-by-batch. Between each batch,
status is dumped to logger.info.
@param rebalancePlan | [
"private void executePlan(RebalancePlan rebalancePlan) {\n logger.info(\"Starting to execute rebalance Plan!\");\n\n int batchCount = 0;\n int partitionStoreCount = 0;\n long totalTimeMs = 0;\n\n List<RebalanceBatchPlan> entirePlan = rebalancePlan.getPlan();\n int numBatche... | [
"@Override\n public void writeText(PDDocument doc, Writer outputStream) throws IOException\n {\n try\n {\n DOMImplementationRegistry registry = DOMImplementationRegistry.newInstance();\n DOMImplementationLS impl = (DOMImplementationLS)registry.getDOMImplementation(\"LS\");\... |
Use this API to add dnspolicylabel resources. | [
"public static base_responses add(nitro_service client, dnspolicylabel resources[]) throws Exception {\n\t\tbase_responses result = null;\n\t\tif (resources != null && resources.length > 0) {\n\t\t\tdnspolicylabel addresources[] = new dnspolicylabel[resources.length];\n\t\t\tfor (int i=0;i<resources.length;i++){\n\... | [
"private void closeClient(Client client) {\n logger.debug(\"Closing client {}\", client);\n client.close();\n openClients.remove(client.targetPlayer);\n useCounts.remove(client);\n timestamps.remove(client);\n }",
"private CmsXmlContent unmarshalXmlContent(CmsFile file) throw... |
Generate a path select string
@return Select query string | [
"private String getPathSelectString() {\n String queryString = \"SELECT \" + Constants.DB_TABLE_REQUEST_RESPONSE + \".\" + Constants.GENERIC_CLIENT_UUID +\n \",\" + Constants.DB_TABLE_PATH + \".\" + Constants.GENERIC_ID +\n \",\" + Constants.PATH_PROFILE_PATHNAME +\n \",\" + ... | [
"public String getAccuracyDescription(int numDigits) {\r\n NumberFormat nf = NumberFormat.getNumberInstance();\r\n nf.setMaximumFractionDigits(numDigits);\r\n Triple<Double, Integer, Integer> accu = getAccuracyInfo();\r\n return nf.format(accu.first()) + \" (\" + accu.second() + \"/\" + (accu.second() ... |
Read the calendar data from a Gantt Designer file.
@param gantt Gantt Designer file. | [
"private void readCalendar(Gantt gantt)\n {\n Gantt.Calendar ganttCalendar = gantt.getCalendar();\n m_projectFile.getProjectProperties().setWeekStartDay(ganttCalendar.getWeekStart());\n\n ProjectCalendar calendar = m_projectFile.addCalendar();\n calendar.setName(\"Standard\");\n m_project... | [
"protected FluentModelTImpl prepareForFutureCommitOrPostRun(FluentModelTImpl childResource) {\n if (this.isPostRunMode) {\n if (!childResource.taskGroup().dependsOn(this.parentTaskGroup)) {\n this.parentTaskGroup.addPostRunDependentTaskGroup(childResource.taskGroup());\n ... |
Read the role definitions from a GanttProject project.
@param gpProject GanttProject project | [
"private void readRoleDefinitions(Project gpProject)\n {\n m_roleDefinitions.put(\"Default:1\", \"project manager\");\n\n for (Roles roles : gpProject.getRoles())\n {\n if (\"Default\".equals(roles.getRolesetName()))\n {\n continue;\n }\n\n for (Role role ... | [
"public IntervalFrequency getRefreshFrequency() {\n switch (mRefreshInterval) {\n case REALTIME_REFRESH_INTERVAL:\n return IntervalFrequency.REALTIME;\n case HIGH_REFRESH_INTERVAL:\n return IntervalFrequency.HIGH;\n case LOW_REFRESH_INTERVAL:\n ... |
Uncheck all items in the list including all sub-items.
@param list list of CmsTreeItem entries. | [
"private void uncheckAll(CmsList<? extends I_CmsListItem> list) {\r\n\r\n for (Widget it : list) {\r\n CmsTreeItem treeItem = (CmsTreeItem)it;\r\n treeItem.getCheckBox().setChecked(false);\r\n uncheckAll(treeItem.getChildren());\r\n }\r\n }"
] | [
"@Override\n public ModelNode resolveValue(ExpressionResolver resolver, ModelNode value) throws OperationFailedException {\n\n // Pass non-LIST values through the superclass so it can reject weird values and, in the odd chance\n // that's how this object is set up, turn undefined into a default lis... |
This produces a canonical string.
RFC 5952 describes canonical representations.
http://en.wikipedia.org/wiki/IPv6_address#Recommended_representation_as_text
http://tools.ietf.org/html/rfc5952 | [
"@Override\n\tpublic String toCanonicalString() {\n\t\tString result;\n\t\tif(hasNoStringCache() || (result = stringCache.canonicalString) == null) {\n\t\t\tstringCache.canonicalString = result = toNormalizedString(IPv6StringCache.canonicalParams);\n\t\t}\n\t\treturn result;\n\t}"
] | [
"protected void resize( VariableMatrix mat , int numRows , int numCols ) {\n if( mat.isTemp() ) {\n mat.matrix.reshape(numRows,numCols);\n }\n }",
"private List<ExpandableWrapper<P, C>> generateFlattenedParentChildList(List<P> parentList) {\n List<ExpandableWrapper<P, C>> flatIt... |
Sets the Red, Green, and Blue color variables. This will automatically populate the Hue, Saturation and Brightness and Hexadecimal fields, too.
The RGB color model is an additive color model in which red, green, and blue light are added together in various ways to reproduce a broad array of colors. The name of the model comes from the initials of the three additive primary colors, red, green, and blue.
@param red strength - valid range is 0-255
@param green strength - valid range is 0-255
@param blue strength - valid range is 0-255
@throws java.lang.Exception Exception if the Red, Green or Blue variables are out of range. | [
"public void setRGB(int red, int green, int blue) throws Exception {\r\n\r\n CmsColor color = new CmsColor();\r\n color.setRGB(red, green, blue);\r\n\r\n m_red = red;\r\n m_green = green;\r\n m_blue = blue;\r\n m_hue = color.getHue();\r\n m_saturation = color.getSatu... | [
"public CurrencyQueryBuilder setCurrencyCodes(String... codes) {\n return set(CurrencyQuery.KEY_QUERY_CURRENCY_CODES, Arrays.asList(codes));\n }",
"public static Type getArrayComponentType(Type type) {\n if (type instanceof GenericArrayType) {\n return GenericArrayType.class.cast(type)... |
Notifies that a content item is changed.
@param position the position. | [
"public final void notifyContentItemChanged(int position) {\n if (position < 0 || position >= contentItemCount) {\n throw new IndexOutOfBoundsException(\"The given position \" + position\n + \" is not within the position bounds for content items [0 - \" + (contentItemCount - 1) ... | [
"public void setSlideDrawable(Drawable drawable) {\n mSlideDrawable = new SlideDrawable(drawable);\n mSlideDrawable.setIsRtl(ViewHelper.getLayoutDirection(this) == LAYOUT_DIRECTION_RTL);\n\n if (mActionBarHelper != null) {\n mActionBarHelper.setDisplayShowHomeAsUpEnabled(true);\n\n ... |
Disply available use cases. | [
"public void displayUseCases()\r\n {\r\n System.out.println();\r\n for (int i = 0; i < useCases.size(); i++)\r\n {\r\n System.out.println(\"[\" + i + \"] \" + ((UseCase) useCases.get(i)).getDescription());\r\n }\r\n }"
] | [
"public void createEnterpriseCustomFieldMap(Props props, Class<?> c)\n {\n byte[] fieldMapData = null;\n for (Integer key : ENTERPRISE_CUSTOM_KEYS)\n {\n fieldMapData = props.getByteArray(key);\n if (fieldMapData != null)\n {\n break;\n }\n }\n\n ... |
Print a work group.
@param value WorkGroup instance
@return work group value | [
"public static final String printWorkGroup(WorkGroup value)\n {\n return (Integer.toString(value == null ? WorkGroup.DEFAULT.getValue() : value.getValue()));\n }"
] | [
"public boolean ifTaskCompletedSuccessOrFailureFromResponse(\n ResponseOnSingeRequest myResponse) {\n\n boolean isCompleted = false;\n try {\n\n if (myResponse == null || myResponse.isFailObtainResponse()) {\n return isCompleted;\n }\n\n Strin... |
Computes the inner product of A times A and stores the results in B. The inner product is symmetric and this
function will only store the lower triangle. The value of the upper triangular matrix is undefined.
<p>B = A<sup>T</sup>*A</sup>
@param A (Input) Matrix
@param B (Output) Storage for output. | [
"public static void inner_reorder_lower(DMatrix1Row A , DMatrix1Row B )\n {\n final int cols = A.numCols;\n B.reshape(cols,cols);\n\n Arrays.fill(B.data,0);\n for (int i = 0; i <cols; i++) {\n for (int j = 0; j <=i; j++) {\n B.data[i*cols+j] += A.data[i]*A.da... | [
"private String determineAndCacheOuterMostNullEmbeddable(String column, String[] path) {\n\t\tString embeddable = path[0];\n\t\t// process each embeddable from less specific to most specific\n\t\t// exclude path leaves as it's a column and not an embeddable\n\t\tfor ( int index = 0; index < path.length - 1; index++... |
This method is used to launch mock agents. First it creates them, with
the generic df_service_name \"mock_agent\", and then the method sends to
the agent a message with the new df_service_name and its behaviour.
@param agent_name
The name of the mock agent
@param agent_path
The path of the agent, described in
mocks/jadex/common/Definitions file
@param configuration
Where the new df_service_name and the agents behaviour is
saved
@param scenario
The Scenario of the Test | [
"public static void startMockJadexAgent(String agent_name,\n String agent_path, MockConfiguration configuration,\n BeastTestCase story) {\n\n story.startAgent(agent_name, agent_path);\n story.sendMessageToAgent(agent_name, SFipa.INFORM, configuration);\n story.setExecution... | [
"public AsciiTable setPaddingTop(int paddingTop) {\r\n\t\tfor(AT_Row row : this.rows){\r\n\t\t\tif(row.getType()==TableRowType.CONTENT){\r\n\t\t\t\trow.setPaddingTop(paddingTop);\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn this;\r\n\t}",
"public static base_responses add(nitro_service client, sslocspresponder resources[]) ... |
Add utility routes the router
@param router | [
"public ProteusApplication addDefaultRoutes(RoutingHandler router)\n {\n\n if (config.hasPath(\"health.statusPath\")) {\n try {\n final String statusPath = config.getString(\"health.statusPath\");\n\n router.add(Methods.GET, statusPath, (final HttpServerExchange ex... | [
"@Override\n protected URL getDefinitionsURL() {\n try {\n URL url = CustomEPSGCodes.class.getResource(CUSTOM_EPSG_CODES_FILE);\n // quickly test url\n try (InputStream stream = url.openStream()) {\n //noinspection ResultOfMethodCallIgnored\n ... |
Prints a suggestion to stderr for the argument based on the levenshtein distance metric
@param arg the argument which could not be assigned to a flag
@param co the {@link ConfigOption} List where every flag is stored | [
"private void printSuggestion( String arg, List<ConfigOption> co ) {\n List<ConfigOption> sortedList = new ArrayList<ConfigOption>( co );\n Collections.sort( sortedList, new ConfigOptionLevenshteinDistance( arg ) );\n System.err.println( \"Parse error for argument \\\"\" + arg + \"\\\", did you... | [
"@Nonnull\n public final Style getDefaultStyle(@Nonnull final String geometryType) {\n String normalizedGeomName = GEOMETRY_NAME_ALIASES.get(geometryType.toLowerCase());\n if (normalizedGeomName == null) {\n normalizedGeomName = geometryType.toLowerCase();\n }\n Style style... |
Quick and dirty XML text escape.
@param sb working string buffer
@param text input text
@return escaped text | [
"private String escapeText(StringBuilder sb, String text)\n {\n int length = text.length();\n char c;\n\n sb.setLength(0);\n\n for (int loop = 0; loop < length; loop++)\n {\n c = text.charAt(loop);\n\n switch (c)\n {\n case '<':\n {\n ... | [
"protected static <R extends AddressSection, S extends AddressSegment> R fastIncrement(\n\t\t\tR section,\n\t\t\tlong increment,\n\t\t\tAddressCreator<?, R, ?, S> addrCreator, \n\t\t\tSupplier<R> lowerProducer,\n\t\t\tSupplier<R> upperProducer,\n\t\t\tInteger prefixLength) {\n\t\tif(increment >= 0) {\n\t\t\tBigInte... |
General API
-> compile each of supplied files
-> recompile any required types for which we have an incomplete principle structure | [
"private void compile(ICompilationUnit[] sourceUnits, boolean lastRound) {\n this.stats.startTime = System.currentTimeMillis();\n try {\n // build and record parsed units\n reportProgress(Messages.compilation_beginningToCompile);\n\n if (this.options.complianceLevel >=... | [
"protected void checkVariableName(GraphRewrite event, EvaluationContext context)\n {\n if (variableName == null)\n {\n setVariableName(Iteration.getPayloadVariableName(event, context));\n }\n }",
"public void update(int width, int height, int sampleCount) {\n if (captu... |
Generate a Jongo query regarding a set of parameters.
@param params Map<queryKey, queryValue> of query parameters
@return String | [
"public static String generateQuery(final Map<String,Object> params){\n\t\tfinal StringBuilder sb = new StringBuilder();\n\t\tboolean newEntry = false;\n\t\t\n\t\tsb.append(\"{\");\n\t\tfor(final Entry<String,Object> param: params.entrySet()){\n\t\t\tif(newEntry){\n\t\t\t\tsb.append(\", \");\n\t\t\t}\n\n\t\t\tsb.ap... | [
"public RandomVariableInterface[] getBasisFunctions(double exerciseDate, LIBORModelMonteCarloSimulationInterface model) throws CalculationException {\n\n\t\tArrayList<RandomVariableInterface> basisFunctions = new ArrayList<RandomVariableInterface>();\n\n\t\tRandomVariableInterface basisFunction;\n\n\t\t// Constant\... |
This method allows a subsection of a byte array to be copied.
@param data source data
@param offset offset into the source data
@param size length of the source data to copy
@return new byte array containing copied data | [
"public static final byte[] cloneSubArray(byte[] data, int offset, int size)\n {\n byte[] newData = new byte[size];\n System.arraycopy(data, offset, newData, 0, size);\n return (newData);\n }"
] | [
"private void addFoldersToSearchIn(final List<String> folders) {\n\n if (null == folders) {\n return;\n }\n\n for (String folder : folders) {\n if (!CmsResource.isFolder(folder)) {\n folder += \"/\";\n }\n\n m_foldersToSearchIn.add(fold... |
Read the project data and return a ProjectFile instance.
@return ProjectFile instance | [
"private ProjectFile read() throws Exception\n {\n m_project = new ProjectFile();\n m_eventManager = m_project.getEventManager();\n\n ProjectConfig config = m_project.getProjectConfig();\n config.setAutoCalendarUniqueID(false);\n config.setAutoTaskUniqueID(false);\n config.setAutoRes... | [
"public void set( T a ) {\n if( a.getType() == getType() )\n mat.set(a.getMatrix());\n else {\n setMatrix(a.mat.copy());\n }\n }",
"public static appfwprofile_denyurl_binding[] get(nitro_service service, String name) throws Exception{\n\t\tappfwprofile_denyurl_binding... |
Set the face to be culled
@param cullFace
{@code GVRCullFaceEnum.Back} Tells Graphics API to discard
back faces, {@code GVRCullFaceEnum.Front} Tells Graphics API
to discard front faces, {@code GVRCullFaceEnum.None} Tells
Graphics API to not discard any face
@param passIndex
The rendering pass to set cull face state | [
"public GVRRenderData setCullFace(GVRCullFaceEnum cullFace, int passIndex) {\n if (passIndex < mRenderPassList.size()) {\n mRenderPassList.get(passIndex).setCullFace(cullFace);\n } else {\n Log.e(TAG, \"Trying to set cull face to a invalid pass. Pass \" + passIndex + \" was not c... | [
"public List<TimephasedWork> getTimephasedBaselineWork(int index)\n {\n return m_timephasedBaselineWork[index] == null ? null : m_timephasedBaselineWork[index].getData();\n }",
"@GwtIncompatible(\"Class.getDeclaredFields\")\n\tpublic ToStringBuilder addDeclaredFields() {\n\t\tField[] fields = instance.ge... |
Extract task data. | [
"private void processTasks() throws IOException\n {\n TaskReader reader = new TaskReader(m_data.getTableData(\"Tasks\"));\n reader.read();\n for (MapRow row : reader.getRows())\n {\n processTask(m_project, row);\n }\n updateDates();\n }"
] | [
"public void animate(float animationTime, Matrix4f mat)\n {\n mRotInterpolator.animate(animationTime, mRotKey);\n mPosInterpolator.animate(animationTime, mPosKey);\n mSclInterpolator.animate(animationTime, mScaleKey);\n mat.translationRotateScale(mPosKey[0], mPosKey[1], mPosKey[2], mR... |
This method inserts a name value pair into internal storage.
@param field task field
@param value attribute value | [
"private void set(FieldType field, boolean value)\n {\n set(field, (value ? Boolean.TRUE : Boolean.FALSE));\n }"
] | [
"public static String decodeUrl(String stringToDecode) {\n try {\n return URLDecoder.decode(stringToDecode, \"UTF-8\");\n } catch (UnsupportedEncodingException e1) {\n throw new RuntimeException(e1);\n }\n }",
"public static base_responses add(nitro_service client, ro... |
Sets a string-valued additional info entry on the user.
@param username the name of the user
@param infoName the additional info key
@param value the additional info value
@throws CmsException if something goes wrong | [
"public void setUserInfo(String username, String infoName, String value) throws CmsException {\n\n CmsUser user = m_cms.readUser(username);\n user.setAdditionalInfo(infoName, value);\n m_cms.writeUser(user);\n }"
] | [
"public byte[] serialize() throws PersistenceBrokerException\r\n {\r\n // Identity is serialized and written to an ObjectOutputStream\r\n // This ObjectOutputstream is compressed by a GZIPOutputStream\r\n // and finally written to a ByteArrayOutputStream.\r\n // the resulting byte[] i... |
Constructs the appropriate MenuDrawer based on the position. | [
"private static MenuDrawer createMenuDrawer(Activity activity, int dragMode, Position position, Type type) {\n MenuDrawer drawer;\n\n if (type == Type.STATIC) {\n drawer = new StaticDrawer(activity);\n\n } else if (type == Type.OVERLAY) {\n drawer = new OverlayDrawer(activ... | [
"okhttp3.Response get(String url, Map<String, Object> params)\n throws RequestException, LocalOperationException {\n\n String fullUrl = getFullUrl(url);\n okhttp3.Request request = new okhttp3.Request.Builder()\n .url(addUrlParams(fullUrl, toPayload(params)))\n ... |
Converts an object to an object, with squiggly filters applied.
@param mapper the object mapper
@param source the source to convert
@return target instance
@see SquigglyUtils#objectify(ObjectMapper, Object, Class) | [
"public static Object objectify(ObjectMapper mapper, Object source) {\n return objectify(mapper, source, Object.class);\n }"
] | [
"protected static void error(\n final HttpServletResponse httpServletResponse, final String message, final HttpStatus code) {\n try {\n httpServletResponse.setContentType(\"text/plain\");\n httpServletResponse.setStatus(code.value());\n setNoCache(httpServletRespon... |
Returns the number of key-value mappings in this map for the second key.
@param firstKey
the first key
@return Returns the number of key-value mappings in this map for the second key. | [
"public int size(final K1 firstKey) {\n\t\t// existence check on inner map\n\t\tfinal HashMap<K2, HashMap<K3, V>> innerMap = map.get(firstKey);\n\t\tif( innerMap == null ) {\n\t\t\treturn 0;\n\t\t}\n\t\treturn innerMap.size();\n\t}"
] | [
"protected boolean isValidLayout(Gravity gravity, Orientation orientation) {\n boolean isValid = true;\n\n switch (gravity) {\n case TOP:\n case BOTTOM:\n isValid = (!isUnlimitedSize() && orientation == Orientation.VERTICAL);\n break;\n ca... |
Convenience method for retrieving a Map resource.
@param locale locale identifier
@param key resource key
@return resource value | [
"@SuppressWarnings(\"rawtypes\") public static final Map getMap(Locale locale, String key)\n {\n ResourceBundle bundle = ResourceBundle.getBundle(LocaleData.class.getName(), locale);\n return ((Map) bundle.getObject(key));\n }"
] | [
"public void addFile(String description, FileModel fileModel)\n {\n Map<FileModel, ProblemFileSummary> files = addDescription(description);\n\n if (files.containsKey(fileModel))\n {\n files.get(fileModel).addOccurrence();\n } else {\n files.put(fileModel, new Pro... |
Sets the quaternion of the keyframe. | [
"public void setValue(Quaternionf rot) {\n mX = rot.x;\n mY = rot.y;\n mZ = rot.z;\n mW = rot.w;\n }"
] | [
"public static Variable deserialize(String s,\n VariableType variableType) {\n return deserialize(s,\n variableType,\n null);\n }",
"public Client getClient(int clientId) throws Exception {\n Client client =... |
Gets the current instance of plugin manager
@return PluginManager | [
"public static PluginManager getInstance() {\n if (_instance == null) {\n _instance = new PluginManager();\n _instance.classInformation = new HashMap<String, ClassInformation>();\n _instance.methodInformation = new HashMap<String, com.groupon.odo.proxylib.models.Method>();\n ... | [
"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... |
So we will follow rfc 1035 and in addition allow the underscore. | [
"static ParsedHost validateHostImpl(HostName fromHost) throws HostNameException {\n\t\tfinal String str = fromHost.toString();\n\t\tHostNameParameters validationOptions = fromHost.getValidationOptions();\n\t\treturn validateHost(fromHost, str, validationOptions);\n\t}"
] | [
"private double getConstraint(double x1, double x2)\n {\n double c1,c2,h;\n c1 = -x1*x1-x2*x2+1+0.1*Math.cos(16*Math.atan(x1/x2));\n c2 = (x1-0.5)*(x1-0.5)+(x2-0.5)*(x2-0.5)-0.5;\n if(c1>c2)\n h = (c1>0)?c1:0;\n else\n h = (c2>0)?c2:0;\n return h;\n }",
"private v... |
Convert custom info.
@param customInfo the custom info map
@return the custom info type | [
"private static CustomInfoType convertCustomInfo(Map<String, String> customInfo) {\n if (customInfo == null) {\n return null;\n }\n\n CustomInfoType ciType = new CustomInfoType();\n for (Entry<String, String> entry : customInfo.entrySet()) {\n CustomInfoType.Item cI... | [
"public boolean add(long key) {\n final int index = ((((int) (key >>> 32)) ^ ((int) (key))) & 0x7fffffff) % capacity;\n final Entry entryOriginal = table[index];\n for (Entry entry = entryOriginal; entry != null; entry = entry.next) {\n if (entry.key == key) {\n return... |
Set the on-finish callback.
The basic {@link GVROnFinish} callback will notify you when the animation
runs to completion. This is a good time to do things like removing
now-invisible objects from the scene graph.
<p>
The extended {@link GVROnRepeat} callback will be called after every
iteration of an indefinite (repeat count less than 0) animation, giving
you a way to stop the animation when it's not longer appropriate.
@param callback
A {@link GVROnFinish} or {@link GVROnRepeat} implementation.
<p>
<em>Note</em>: Supplying a {@link GVROnRepeat} callback will
{@linkplain #setRepeatCount(int) set the repeat count} to a
negative number. Calling {@link #setRepeatCount(int)} with a
non-negative value after setting a {@link GVROnRepeat}
callback will effectively convert the callback to a
{@link GVROnFinish}.
@return {@code this}, so you can chain setProperty() calls. | [
"public GVRAnimation setOnFinish(GVROnFinish callback) {\n mOnFinish = callback;\n\n // Do the instance-of test at set-time, not at use-time\n mOnRepeat = callback instanceof GVROnRepeat ? (GVROnRepeat) callback\n : null;\n if (mOnRepeat != null) {\n mRepeatCoun... | [
"public static java.util.Date newDateTime() {\n return new java.util.Date((System.currentTimeMillis() / SECOND_MILLIS) * SECOND_MILLIS);\n }",
"protected boolean clearSpecial(DatabaseConnection connection, Logger logger) {\n\t\tNestedConnection currentSaved = specialConnection.get();\n\t\tboolean cleare... |
Use this API to delete snmpmanager. | [
"public static base_response delete(nitro_service client, snmpmanager resource) throws Exception {\n\t\tsnmpmanager deleteresource = new snmpmanager();\n\t\tdeleteresource.ipaddress = resource.ipaddress;\n\t\tdeleteresource.netmask = resource.netmask;\n\t\treturn deleteresource.delete_resource(client);\n\t}"
] | [
"public String renameApp(String appName, String newName) {\n return connection.execute(new AppRename(appName, newName), apiKey).getName();\n }",
"public final void setVolumeByIncrement(float level) throws IOException {\n Volume volume = this.getStatus().volume;\n float total = volume.level... |
Utility function to get the current text. | [
"public static final String getSelectedText(ListBox list) {\n\tint index = list.getSelectedIndex();\n\treturn (index >= 0) ? list.getItemText(index) : null;\n }"
] | [
"private static void freeTempLOB(ClobWrapper clob, BlobWrapper blob)\r\n\t{\r\n\t\ttry\r\n\t\t{\r\n\t\t\tif (clob != null)\r\n\t\t\t{\r\n\t\t\t\t// If the CLOB is open, close it\r\n\t\t\t\tif (clob.isOpen())\r\n\t\t\t\t{\r\n\t\t\t\t\tclob.close();\r\n\t\t\t\t}\r\n\r\n\t\t\t\t// Free the memory used by this CLOB\r\n... |
dst is just for log information | [
"private void doSend(byte[] msg, boolean wait, KNXAddress dst)\r\n\t\tthrows KNXAckTimeoutException, KNXLinkClosedException\r\n\t{\r\n\t\tif (closed)\r\n\t\t\tthrow new KNXLinkClosedException(\"link closed\");\r\n\t\ttry {\r\n\t\t\tlogger.info(\"send message to \" + dst + (wait ? \", wait for ack\" : \"\"));\r\n\t\... | [
"public static String dump(final int displayOffset, final byte[] data, final int offset, final int len)\n {\n StringBuilder sb = new StringBuilder();\n Formatter formatter = new Formatter(sb);\n StringBuilder ascii = new StringBuilder();\n\n int dataNdx = offset;\n final int maxDataNdx = ... |
Obtains a Symmetry010 zoned date-time from another date-time object.
@param temporal the date-time object to convert, not null
@return the Symmetry010 zoned date-time, not null
@throws DateTimeException if unable to create the date-time | [
"@Override\n @SuppressWarnings(\"unchecked\")\n public ChronoZonedDateTime<Symmetry010Date> zonedDateTime(TemporalAccessor temporal) {\n return (ChronoZonedDateTime<Symmetry010Date>) super.zonedDateTime(temporal);\n }"
] | [
"private void processResourceAssignment(Task task, MapRow row)\n {\n Resource resource = m_resourceMap.get(row.getUUID(\"RESOURCE_UUID\"));\n task.addResourceAssignment(resource);\n }",
"public List<Callouts.Callout> getCallout()\n {\n if (callout == null)\n {\n callout = new Arr... |
List all apps for the current user's account.
@param range The range of apps provided by {@link Range#getNextRange()}
@return a list of apps | [
"public Range<App> listApps(String range) {\n return connection.execute(new AppList(range), apiKey);\n }"
] | [
"public static String toJson(Date date) {\n if (date == null) {\n return NULL_VALUE;\n }\n\n CharBuf buffer = CharBuf.create(26);\n writeDate(date, buffer);\n\n return buffer.toString();\n }",
"public byte[] getThumbnail(ThumbnailFileType fileType, int minWidth, in... |
Use this API to add cmppolicylabel resources. | [
"public static base_responses add(nitro_service client, cmppolicylabel resources[]) throws Exception {\n\t\tbase_responses result = null;\n\t\tif (resources != null && resources.length > 0) {\n\t\t\tcmppolicylabel addresources[] = new cmppolicylabel[resources.length];\n\t\t\tfor (int i=0;i<resources.length;i++){\n\... | [
"public static double JaccardDistance(double[] p, double[] q) {\n double distance = 0;\n int intersection = 0, union = 0;\n\n for (int x = 0; x < p.length; x++) {\n if ((p[x] != 0) || (q[x] != 0)) {\n if (p[x] == q[x]) {\n intersection++;\n ... |
Appends the given string encoding special HTML characters.
@param out
The StringBuilder to write to.
@param in
Input String.
@param start
Input String starting position.
@param end
Input String end position. | [
"public final static void appendCode(final StringBuilder out, final String in, final int start, final int end)\n {\n for (int i = start; i < end; i++)\n {\n final char c;\n switch (c = in.charAt(i))\n {\n case '&':\n out.append(\"&\");\... | [
"public MapBounds getRotatedBounds(final Rectangle2D.Double paintAreaPrecise, final Rectangle paintArea) {\n final MapBounds rotatedBounds = this.getRotatedBounds();\n\n if (rotatedBounds instanceof CenterScaleMapBounds) {\n return rotatedBounds;\n }\n\n final ReferencedEnvelo... |
Use this API to fetch transformpolicylabel resource of given name . | [
"public static transformpolicylabel get(nitro_service service, String labelname) throws Exception{\n\t\ttransformpolicylabel obj = new transformpolicylabel();\n\t\tobj.set_labelname(labelname);\n\t\ttransformpolicylabel response = (transformpolicylabel) obj.get_resource(service);\n\t\treturn response;\n\t}"
] | [
"protected Object getObjectFromResultSet() throws PersistenceBrokerException\r\n {\r\n\r\n try\r\n {\r\n // if all primitive attributes of the object are contained in the ResultSet\r\n // the fast direct mapping can be used\r\n return super.getObjectFromResultSet();... |
Creates a player wrapper for the Android MediaPlayer. | [
"public static GVRVideoSceneObjectPlayer<MediaPlayer> makePlayerInstance(final MediaPlayer mediaPlayer) {\n return new GVRVideoSceneObjectPlayer<MediaPlayer>() {\n @Override\n public MediaPlayer getPlayer() {\n return mediaPlayer;\n }\n\n @Override\n... | [
"public void addCommandClass(ZWaveCommandClass commandClass) {\r\n\t\tZWaveCommandClass.CommandClass key = commandClass.getCommandClass();\r\n\t\tif (!supportedCommandClasses.containsKey(key)) {\r\n\t\t\tsupportedCommandClasses.put(key, commandClass);\r\n\t\t}\r\n\t}",
"public void loadWithTimeout(int timeout) {\... |
Creates an element that represents a single positioned box with no content.
@return the resulting DOM element | [
"protected Element createTextElement(float width)\n {\n Element el = doc.createElement(\"div\");\n el.setAttribute(\"id\", \"p\" + (textcnt++));\n el.setAttribute(\"class\", \"p\");\n String style = curstyle.toString();\n style += \"width:\" + width + UNIT + \";\";\n el.... | [
"public static String parseServers(String zookeepers) {\n int slashIndex = zookeepers.indexOf(\"/\");\n if (slashIndex != -1) {\n return zookeepers.substring(0, slashIndex);\n }\n return zookeepers;\n }",
"private StepFormatter.Formatting<?, ?> getFormatting( Annotation[] annotations, Set<Class<... |
Used to get the complex value of a matrix element.
@param row The row of the element.
@param col The column of the element.
@param output Storage for the value | [
"public void get( int row , int col , Complex_F64 output ) {\n ops.get(mat,row,col,output);\n }"
] | [
"public void deleteProduct(final String name) {\n final DbProduct dbProduct = getProduct(name);\n repositoryHandler.deleteProduct(dbProduct.getName());\n }",
"public void checkConnection() {\n long start = Time.currentTimeMillis();\n\n while (clientChannel == null) {\n\n ... |
Appends the accumulated words to the resulting words. Trailing whitespace is removed because of the
postprocessing that inserts custom whitespace
@param currentWords is the {@link StringBuilder} of the accumulated words
@param formattedWords is the list that is being appended to | [
"private static void flushCurrentWord( StringBuilder currentWords, List<Word> formattedWords, boolean cutWhitespace ) {\n if( currentWords.length() > 0 ) {\n if( cutWhitespace && currentWords.charAt( currentWords.length() - 1 ) == ' ' ) {\n currentWords.setLength( currentWords.lengt... | [
"@SuppressWarnings(\"checkstyle:illegalcatch\")\n private boolean sendMessage(final byte[] messageToSend) {\n try {\n connectionPool.execute(new PooledObjectConsumer<TcpConnection>() {\n @Override\n public void accept(final TcpConnection tcpConnection) throws IOExc... |
Creates a date from the equivalent long value. This conversion
takes account of the time zone.
@param date date expressed as a long integer
@return new Date instance | [
"public static Date getDateFromLong(long date)\n {\n TimeZone tz = TimeZone.getDefault();\n return (new Date(date - tz.getRawOffset()));\n }"
] | [
"protected final void hardcodeValidCopyMethod(Class<?> fieldType, String fullyQualifiedMethodName, Class<?> argType) {\r\n if (argType==null || fieldType==null || fullyQualifiedMethodName==null) {\r\n throw new IllegalArgumentException(\"All parameters must be supplied - no nulls\");\r\n }\... |
Determines whether a project has the specified publisher type, wrapped by the "Flexible Publish" publisher.
@param project The project
@param type The type of the publisher
@return true if the project contains a publisher of the specified type wrapped by the "Flexible Publish" publisher. | [
"public boolean isPublisherWrapped(AbstractProject<?, ?> project, Class<T> type) {\n return find(project, type) != null;\n }"
] | [
"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... |
compute Sinh using Taylor Series.
@param x An angle, in radians.
@param nTerms Number of terms.
@return Result. | [
"public static double Sinh(double x, int nTerms) {\r\n if (nTerms < 2) return x;\r\n if (nTerms == 2) {\r\n return x + (x * x * x) / 6D;\r\n } else {\r\n\r\n double mult = x * x * x;\r\n double fact = 6;\r\n int factS = 5;\r\n double result... | [
"public WebSocketContext sendJsonToUser(Object data, String username) {\n return sendToTagged(JSON.toJSONString(data), username);\n }",
"public void build(Point3d[] points, int nump) throws IllegalArgumentException {\n if (nump < 4) {\n throw new IllegalArgumentException(\"Less than fo... |
Add a resource assignment which has been populated elsewhere.
@param assignment resource assignment | [
"public void addResourceAssignment(ResourceAssignment assignment)\n {\n if (getExistingResourceAssignment(assignment.getResource()) == null)\n {\n m_assignments.add(assignment);\n getParentFile().getResourceAssignments().add(assignment);\n\n Resource resource = assignment.getReso... | [
"public void remove(RowKey key) {\n\t\tcurrentState.put( key, new AssociationOperation( key, null, REMOVE ) );\n\t}",
"public static boolean isFileExist(String filePath) {\n\n File f = new File(filePath);\n\n return f.exists() && !f.isDirectory();\n }",
"public ProjectCalendarException addCalen... |
Flush the in-memory data to the file | [
"private synchronized void flushData() {\n BufferedWriter writer = null;\n try {\n writer = new BufferedWriter(new FileWriter(new File(this.inputPath)));\n for(String key: this.metadataMap.keySet()) {\n writer.write(NEW_PROPERTY_SEPARATOR + key.toString() + \"]\" +... | [
"public @Nullable ChangeEvent<BsonDocument> getUnprocessedEventForDocumentId(\n final BsonValue documentId\n ) {\n final ChangeEvent<BsonDocument> event;\n nsLock.readLock().lock();\n try {\n event = this.events.get(documentId);\n } finally {\n nsLock.readLock().unlock();\n }\n\n n... |
Revisit message to set their item ref to a item definition
@param def Definitions | [
"private void revisitMessages(Definitions def) {\n List<RootElement> rootElements = def.getRootElements();\n List<ItemDefinition> toAddDefinitions = new ArrayList<ItemDefinition>();\n for (RootElement root : rootElements) {\n if (root instanceof Message) {\n if (!exist... | [
"public static final Rect getViewportBounds() {\n return new Rect(Window.getScrollLeft(), Window.getScrollTop(), Window.getClientWidth(), Window.getClientHeight());\n }",
"public static final BigDecimal printCurrency(Number value)\n {\n return (value == null || value.doubleValue() == 0 ? null : n... |
The normalized string returned by this method is consistent with java.net.Inet6address.
IPs are not compressed nor mixed in this representation. If this has a prefix length, that will be included in the string. | [
"@Override\n\tpublic String toNormalizedString() {\n\t\tString result;\n\t\tif(hasNoStringCache() || (result = stringCache.normalizedString) == null) {\n\t\t\tif(hasZone()) {\n\t\t\t\tstringCache.normalizedString = result = toNormalizedString(IPv6StringCache.normalizedParams);\n\t\t\t} else {\n\t\t\t\tresult = getS... | [
"public GVRRenderData setDrawMode(int drawMode) {\n if (drawMode != GL_POINTS && drawMode != GL_LINES\n && drawMode != GL_LINE_STRIP && drawMode != GL_LINE_LOOP\n && drawMode != GL_TRIANGLES && drawMode != GL_TRIANGLE_STRIP\n && drawMode != GL_TRIANGLE_FAN) {\n ... |
Check, if the resource should be exported with minimal meta-data.
This holds for resources that are not part of the export, but must be
exported as super-folders.
@param path export-site relative path of the resource to check.
@return flag, indicating if the resource should be exported with minimal meta data. | [
"protected boolean exportWithMinimalMetaData(String path) {\n\n String checkPath = path.startsWith(\"/\") ? path + \"/\" : \"/\" + path + \"/\";\n for (String p : m_parameters.getResourcesToExportWithMetaData()) {\n if (checkPath.startsWith(p)) {\n return false;\n ... | [
"public Map<String, Attribute> getAttributes() {\n Map<String, Attribute> result = new HashMap<>();\n DataSourceAttribute datasourceAttribute = new DataSourceAttribute();\n Map<String, Attribute> dsResult = new HashMap<>();\n dsResult.put(MAP_KEY, this.mapAttribute);\n datasourceA... |
Loads the configuration file, using CmsVfsMemoryObjectCache for caching.
@param cms the CMS context
@return the template mapper configuration | [
"private CmsTemplateMapperConfiguration getConfiguration(final CmsObject cms) {\n\n if (!m_enabled) {\n return CmsTemplateMapperConfiguration.EMPTY_CONFIG;\n }\n\n if (m_configPath == null) {\n m_configPath = OpenCms.getSystemInfo().getConfigFilePath(cms, \"template-mappin... | [
"public static URI createRestURI(\n final String matrixId, final int row, final int col,\n final WMTSLayerParam layerParam) throws URISyntaxException {\n String path = layerParam.baseURL;\n if (layerParam.dimensions != null) {\n for (int i = 0; i < layerParam.dimension... |
Use this API to unset the properties of filterhtmlinjectionparameter resource.
Properties that need to be unset are specified in args array. | [
"public static base_response unset(nitro_service client, filterhtmlinjectionparameter resource, String[] args) throws Exception{\n\t\tfilterhtmlinjectionparameter unsetresource = new filterhtmlinjectionparameter();\n\t\treturn unsetresource.unset_resource(client,args);\n\t}"
] | [
"public void setDay(Day d)\n {\n if (m_day != null)\n {\n m_parentCalendar.removeHoursFromDay(this);\n }\n\n m_day = d;\n\n m_parentCalendar.attachHoursToDay(this);\n }",
"private static boolean containsGreekLetter(String s) {\r\n Matcher m = biogreek.matcher(s);\r\n ret... |
Returns an empty map with expected size matching the iterable size if
it's of type Collection. Otherwise, an empty map with the default size is
returned. | [
"public static <K, V> HashMap<K, V> newEmptyHashMap(Iterable<?> iterable) {\n if(iterable instanceof Collection<?>)\n return Maps.newHashMapWithExpectedSize(((Collection<?>) iterable).size());\n return Maps.newHashMap();\n }"
] | [
"@SuppressWarnings(\"deprecation\")\n\tpublic static boolean dateTimeEquals(java.util.Date d1, java.util.Date d2) {\n if (d1 == null || d2 == null) {\n return false;\n }\n\n return d1.getDate() == d2.getDate()\n && d1.getMonth() == d2.getMonth()\n && d1.... |
Prepare the baseURL to make a request.
@param matrixId matrixId
@param row row
@param col cold
@param layerParam layerParam | [
"public static URI createRestURI(\n final String matrixId, final int row, final int col,\n final WMTSLayerParam layerParam) throws URISyntaxException {\n String path = layerParam.baseURL;\n if (layerParam.dimensions != null) {\n for (int i = 0; i < layerParam.dimension... | [
"public void takeNoteOfGradient(IntDoubleVector gradient) {\n gradient.iterate(new FnIntDoubleToVoid() { \n @Override\n public void call(int index, double value) {\n gradSumSquares[index] += value * value;\n assert !Double.isNaN(gradSumSquares[in... |
Utility function that creates directory.
@param dir Directory path
@return File object of directory. | [
"public static File createDir(String dir) {\n // create outdir\n File directory = null;\n if(dir != null) {\n directory = new File(dir);\n if(!(directory.exists() || directory.mkdir())) {\n Utils.croak(\"Can't find or create directory \" + dir);\n ... | [
"@GwtIncompatible(\"Class.getDeclaredFields\")\n\tpublic ToStringBuilder addDeclaredFields() {\n\t\tField[] fields = instance.getClass().getDeclaredFields();\n\t\tfor(Field field : fields) {\n\t\t\taddField(field);\n\t\t}\n\t\treturn this;\n\t}",
"public void setContentType(String photoId, String contentType) thr... |
disables the current active id, enables the new one selected
@param profileId profile ID of the client
@param clientUUID UUID of the client
@param active true to make client active, false to make client inactive
@throws Exception exception | [
"public void updateActive(int profileId, String clientUUID, Boolean active) throws Exception {\n PreparedStatement statement = null;\n try (Connection sqlConnection = sqlService.getConnection()) {\n statement = sqlConnection.prepareStatement(\n \"UPDATE \" + Constants.DB_TABL... | [
"@RequestMapping(value = \"api/servergroup\", method = RequestMethod.GET)\n public\n @ResponseBody\n HashMap<String, Object> getServerGroups(Model model,\n @RequestParam(value = \"profileId\", required = false) Integer profileId,\n ... |
Sets an attribute in the main section of the manifest to a map.
The map entries will be joined with a single whitespace character, and each key-value pair will be joined with a '='.
@param name the attribute's name
@param values the attribute's value
@return {@code this}
@throws IllegalStateException if entries have been added or the JAR has been written prior to calling this methods. | [
"public Jar setMapAttribute(String name, Map<String, ?> values) {\n return setAttribute(name, join(values));\n }"
] | [
"public synchronized int get(byte[] dst, int off, int len) {\n if (available == 0) {\n return 0;\n }\n\n // limit is last index to read + 1\n int limit = idxGet < idxPut ? idxPut : capacity;\n int count = Math.min(limit - idxGet, len);\n System.arraycopy(buffer, ... |
Registers add operation
@param registration resource on which to register
@param handler operation handler to register
@param flags with flags
@deprecated use {@link #registerAddOperation(org.jboss.as.controller.registry.ManagementResourceRegistration, AbstractAddStepHandler, org.jboss.as.controller.registry.OperationEntry.Flag...)} | [
"@Deprecated\n @SuppressWarnings(\"deprecation\")\n protected void registerAddOperation(final ManagementResourceRegistration registration, final OperationStepHandler handler, OperationEntry.Flag... flags) {\n if (handler instanceof DescriptionProvider) {\n registration.registerOperationHandl... | [
"private void processCalendarData(List<ProjectCalendar> calendars) throws SQLException\n {\n for (ProjectCalendar calendar : calendars)\n {\n processCalendarData(calendar, getRows(\"SELECT * FROM MSP_CALENDAR_DATA WHERE PROJ_ID=? AND CAL_UID=?\", m_projectID, calendar.getUniqueID()));\n }\n... |
Get the service name of a top-level deployment unit.
@param name the simple name of the deployment
@param phase the deployment phase
@return the service name | [
"public static ServiceName deploymentUnitName(String name, Phase phase) {\n return JBOSS_DEPLOYMENT_UNIT.append(name, phase.name());\n }"
] | [
"protected boolean hasContentType() {\n\n boolean result = false;\n if(this.request.getHeader(RestMessageHeaders.CONTENT_TYPE) != null) {\n result = true;\n } else {\n logger.error(\"Error when validating put request. Missing Content-Type header.\");\n RestError... |
Set the role info for this user. If set, this will be used to set the user's authorizations.
@param roles the roles
@since 1.10.0 | [
"public void setRoles(List<NamedRoleInfo> roles) {\n\t\tthis.roles = roles;\n\t\tList<AuthorizationInfo> authorizations = new ArrayList<AuthorizationInfo>();\n\t\tfor (NamedRoleInfo role : roles) {\n\t\t\tauthorizations.addAll(role.getAuthorizations());\n\t\t}\n\t\tsuper.setAuthorizations(authorizations);\n\t}"
] | [
"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 }",
"public final void notif... |
Delivers the correct JSON Object for the Bounds
@param bounds
@throws org.json.JSONException | [
"private static JSONObject parseBounds(Bounds bounds) throws JSONException {\n if (bounds != null) {\n JSONObject boundsObject = new JSONObject();\n JSONObject lowerRight = new JSONObject();\n JSONObject upperLeft = new JSONObject();\n\n lowerRight.put(\"x\",\n ... | [
"public boolean removeHandlerFor(final GVRSceneObject sceneObject) {\n sceneObject.detachComponent(GVRCollider.getComponentType());\n return null != touchHandlers.remove(sceneObject);\n }",
"@SafeVarargs\n public static <T> Set<T> create(final T... values) {\n Set<T> result = new HashSe... |
What is something came in between when we last checked and when this method is called | [
"public void waitForBuffer(long timeoutMilli) {\n //assert(callerProcessing.booleanValue() == false);\n\n synchronized(buffer) {\n if( dirtyBuffer )\n return;\n if( !foundEOF() ) {\n logger.trace(\"Waiting for things to come in, or until timeout\");\... | [
"@SuppressWarnings(\"resource\")\n public static FileChannel openChannel(File file, boolean mutable) throws IOException {\n if (mutable) {\n return new RandomAccessFile(file, \"rw\").getChannel();\n }\n return new FileInputStream(file).getChannel();\n }",
"private static Tech... |
Add a simple property to the map file.
@param writer xml stream writer
@param name property name
@param propertyType property type
@param readMethod read method name
@param writeMethod write method name
@throws XMLStreamException | [
"private void addProperty(XMLStreamWriter writer, String name, Class<?> propertyType, String readMethod, String writeMethod) throws XMLStreamException\n {\n if (name.length() != 0)\n {\n writer.writeStartElement(\"property\");\n\n // convert property name to .NET style (i.e. first letter... | [
"public static ZMatrixRMaj hermitian(int length, double min, double max, Random rand) {\n ZMatrixRMaj A = new ZMatrixRMaj(length,length);\n\n fillHermitian(A, min, max, rand);\n\n return A;\n }",
"public void histogramToStructure(int histogram[] ) {\n col_idx[0] = 0;\n int in... |
Creates new metadata template.
@param api the API connection to be used.
@param scope the scope of the object.
@param templateKey a unique identifier for the template.
@param displayName the display name of the field.
@param hidden whether this template is hidden in the UI.
@param fields the ordered set of fields for the template
@return the metadata template returned from the server. | [
"public static MetadataTemplate createMetadataTemplate(BoxAPIConnection api, String scope, String templateKey,\n String displayName, boolean hidden, List<Field> fields) {\n\n JsonObject jsonObject = new JsonObject();\n jsonObject.add(\"scope\", scope);\n jsonObject.add(\"displayName\... | [
"public static base_response update(nitro_service client, snmpuser resource) throws Exception {\n\t\tsnmpuser updateresource = new snmpuser();\n\t\tupdateresource.name = resource.name;\n\t\tupdateresource.group = resource.group;\n\t\tupdateresource.authtype = resource.authtype;\n\t\tupdateresource.authpasswd = reso... |
Get file size
@return Long | [
"public static Long getSize(final File file){\n if ( file!=null && file.exists() ){\n return file.length();\n }\n return null;\n }"
] | [
"public static dnsnsecrec get(nitro_service service, String hostname) throws Exception{\n\t\tdnsnsecrec obj = new dnsnsecrec();\n\t\tobj.set_hostname(hostname);\n\t\tdnsnsecrec response = (dnsnsecrec) obj.get_resource(service);\n\t\treturn response;\n\t}",
"public void addConverter(int index, IConverter converter... |
Adds a parameter to the MIMEType.
@param name name of parameter
@param value value of parameter
@return returns a new instance with the parameter set | [
"public MIMEType addParameter(String name, String value) {\n Map<String, String> copy = new LinkedHashMap<>(this.parameters);\n copy.put(name, value);\n return new MIMEType(type, subType, copy);\n }"
] | [
"public Map<String, String> listConfig(String appName) {\n return connection.execute(new ConfigList(appName), apiKey);\n }",
"public static String resourceTypeFromResourceId(String id) {\n return (id != null) ? ResourceId.fromString(id).resourceType() : null;\n }",
"public Date toDate(Object... |
Use this API to fetch responderpolicylabel_responderpolicy_binding resources of given name . | [
"public static responderpolicylabel_responderpolicy_binding[] get(nitro_service service, String labelname) throws Exception{\n\t\tresponderpolicylabel_responderpolicy_binding obj = new responderpolicylabel_responderpolicy_binding();\n\t\tobj.set_labelname(labelname);\n\t\tresponderpolicylabel_responderpolicy_bindin... | [
"public final ReadOnlyObjectProperty<LatLongBounds> boundsProperty() {\n if (bounds == null) {\n bounds = new ReadOnlyObjectWrapper<>(getBounds());\n addStateEventHandler(MapStateEventType.idle, () -> {\n bounds.set(getBounds());\n });\n }\n retur... |
Find the scheme to use to connect to the service.
Uses java annotations first and if not found, uses kubernetes annotations on the service object.
@param service
The target service.
@param qualifiers
The set of qualifiers.
@return Returns the resolved scheme of 'http' as a fallback. | [
"private static String getScheme(Service service, Annotation... qualifiers) {\n for (Annotation q : qualifiers) {\n if (q instanceof Scheme) {\n return ((Scheme) q).value();\n }\n }\n\n if (service.getMetadata() != null && service.getMetadata().getAnnotation... | [
"public float getBoundsWidth() {\n if (mSceneObject != null) {\n GVRSceneObject.BoundingVolume v = mSceneObject.getBoundingVolume();\n return v.maxCorner.x - v.minCorner.x;\n }\n return 0f;\n }",
"private static void bodyWithConcatenation(\n SourceBuilder code,\n... |
Connect sync.
@param configuration the protocol configuration
@return the connection
@throws IOException | [
"public static Connection connectSync(final ProtocolConnectionConfiguration configuration) throws IOException {\n long timeoutMillis = configuration.getConnectionTimeout();\n CallbackHandler handler = configuration.getCallbackHandler();\n final CallbackHandler actualHandler;\n ProtocolTi... | [
"public void addChildTask(Task child)\n {\n child.m_parent = this;\n m_children.add(child);\n setSummary(true);\n\n if (getParentFile().getProjectConfig().getAutoOutlineLevel() == true)\n {\n child.setOutlineLevel(Integer.valueOf(NumberHelper.getInt(getOutlineLevel()) + 1));\n ... |
Installs a provider either in the scope or the pool of unbound providers.
@param clazz the class for which to install the provider.
@param bindingName the name, possibly {@code null}, for which to install the scoped provider.
@param internalProvider the internal provider to install.
@param isBound whether or not the provider is bound to the scope or belongs to the pool of unbound providers.
@param isTestProvider whether or not is a test provider, installed through a Test Module that should override
existing providers for the same class-bindingname.
@param <T> the type of {@code clazz}.
Note to maintainers : we don't use this method directly, both {@link #installBoundProvider(Class, String, InternalProviderImpl, boolean)}
and {@link #installUnBoundProvider(Class, String, InternalProviderImpl)}
are a facade of this method and make the calls more clear. | [
"private <T> InternalProviderImpl installInternalProvider(Class<T> clazz, String bindingName, InternalProviderImpl<? extends T> internalProvider,\n boolean isBound, boolean isTestProvider) {\n if (bindingName == null) {\n if (isBound) {\n return installUnNamedProvider(mapClassesToUnNamedBoundPro... | [
"public Iterable<BoxItem.Info> getChildren(final String... fields) {\n return new Iterable<BoxItem.Info>() {\n @Override\n public Iterator<BoxItem.Info> iterator() {\n String queryString = new QueryStringBuilder().appendParam(\"fields\", fields).toString();\n ... |
Dumps a texture coordinate set of a mesh to stdout.
@param mesh the mesh
@param coords the coordinates | [
"public static void dumpTexCoords(AiMesh mesh, int coords) {\n if (!mesh.hasTexCoords(coords)) {\n System.out.println(\"mesh has no texture coordinate set \" + coords);\n return;\n }\n \n for (int i = 0; i < mesh.getNumVertices(); i++) {\n int numComponen... | [
"@SuppressWarnings(\"WeakerAccess\")\n public synchronized void stop() {\n if (isRunning()) {\n final Set<DeviceAnnouncement> lastDevices = getCurrentDevices();\n socket.get().close();\n socket.set(null);\n devices.clear();\n firstDeviceTime.set(0);\n... |
Checks if the duration option is valid.
NOTE: This does NOT check, if too many events are specified.
@return a flag, indicating if the duration option is valid. | [
"protected final boolean isDurationValid() {\n\n if (isValidEndTypeForPattern()) {\n switch (getEndType()) {\n case DATE:\n return (getStart().getTime() < (getSeriesEndDate().getTime() + DAY_IN_MILLIS));\n case TIMES:\n return get... | [
"@Override\n public void close() throws VoldemortException {\n logger.debug(\"Close called for read-only store.\");\n this.fileModificationLock.writeLock().lock();\n\n try {\n if(isOpen) {\n this.isOpen = false;\n fileSet.close();\n } else ... |
Clean wait task queue. | [
"public synchronized void cleanWaitTaskQueue() {\n\n for (ParallelTask task : waitQ) {\n task.setState(ParallelTaskState.COMPLETED_WITH_ERROR);\n task.getTaskErrorMetas().add(\n new TaskErrorMeta(TaskErrorType.USER_CANCELED, \"NA\"));\n logger.info(\n ... | [
"private void putEvent(EventType eventType) throws Exception {\n List<EventType> eventTypes = Collections.singletonList(eventType);\n\n int i;\n for (i = 0; i < retryNum; ++i) {\n try {\n monitoringService.putEvents(eventTypes);\n break;\n } c... |
Get the number of views, comments and favorites on a photoset for a given date.
@param date
(Required) Stats will be returned for this date. A day according to Flickr Stats starts at midnight GMT for all users, and timestamps will
automatically be rounded down to the start of the day.
@param photosetId
(Required) The id of the photoset to get stats for.
@see "http://www.flickr.com/services/api/flickr.stats.getPhotosetStats.htm" | [
"public Stats getPhotosetStats(String photosetId, Date date) throws FlickrException {\n return getStats(METHOD_GET_PHOTOSET_STATS, \"photoset_id\", photosetId, date);\n }"
] | [
"public void overrideCubeProperties(DockerCompositions overrideDockerCompositions) {\n final Set<String> containerIds = overrideDockerCompositions.getContainerIds();\n for (String containerId : containerIds) {\n\n // main definition of containers contains a container that must be overrode\n... |
Specifies the ARM resource id of the user assigned managed service identity resource that
should be used to retrieve the access token.
@param identityId the ARM resource id of the user assigned identity resource
@return MSICredentials | [
"@Beta\n public MSICredentials withIdentityId(String identityId) {\n this.identityId = identityId;\n this.clientId = null;\n this.objectId = null;\n return this;\n }"
] | [
"@ArgumentsChecked\n\t@Throws({ IllegalNullArgumentException.class, IllegalNumberArgumentException.class })\n\tpublic static void isNumber(final boolean condition, @Nonnull final String value) {\n\t\tif (condition) {\n\t\t\tCheck.isNumber(value);\n\t\t}\n\t}",
"private void writeResource(Resource record) throws I... |
Write a double attribute.
@param name attribute name
@param value attribute value | [
"public void writeNameValuePair(String name, double value) throws IOException\n {\n internalWriteNameValuePair(name, Double.toString(value));\n }"
] | [
"public FieldType getFieldByAlias(FieldTypeClass typeClass, String alias)\n {\n return m_aliasMap.get(new Pair<FieldTypeClass, String>(typeClass, alias));\n }",
"public <T> T invokeWithClientSession(int targetPlayer, ClientTask<T> task, String description)\n throws Exception {\n if (!is... |
Returns a predicate that takes no parameters. The given SQL expression is
used directly.
@param sql
SQL text of the expression | [
"public static Predicate is(final String sql) {\n return new Predicate() {\n public String toSql() {\n return sql;\n }\n public void init(AbstractSqlCreator creator) {\n }\n };\n }"
] | [
"public static String createOdataFilterForTags(String tagName, String tagValue) {\n if (tagName == null) {\n return null;\n } else if (tagValue == null) {\n return String.format(\"tagname eq '%s'\", tagName);\n } else {\n return String.format(\"tagname eq '%s' a... |
Acquire a calendar instance.
@return Calendar instance | [
"public static Calendar popCalendar()\n {\n Calendar result;\n Deque<Calendar> calendars = CALENDARS.get();\n if (calendars.isEmpty())\n {\n result = Calendar.getInstance();\n }\n else\n {\n result = calendars.pop();\n }\n return result;\n }"
] | [
"private void checkOrMarkPrivateAccess(Expression source, FieldNode fn) {\n if (fn!=null && Modifier.isPrivate(fn.getModifiers()) &&\n (fn.getDeclaringClass() != typeCheckingContext.getEnclosingClassNode() || typeCheckingContext.getEnclosingClosure()!=null) &&\n fn.getDeclaringClass().g... |
Add a file to notify the script that asked to stop the print that it is now done processing the remain
jobs. | [
"private void notifyIfStopped() {\n if (isAcceptingNewJobs() || !this.runningTasksFutures.isEmpty()) {\n return;\n }\n final File stoppedFile = new File(this.workingDirectories.getWorking(), \"stopped\");\n try {\n LOGGER.info(\"The print has finished processing job... | [
"private void handleMemoryGetId(SerialMessage incomingMessage) {\n\t\tthis.homeId = ((incomingMessage.getMessagePayloadByte(0)) << 24) | \n\t\t\t\t((incomingMessage.getMessagePayloadByte(1)) << 16) | \n\t\t\t\t((incomingMessage.getMessagePayloadByte(2)) << 8) | \n\t\t\t\t(incomingMessage.getMessagePayloadByte(3));\... |
Performs a similar transform on A-pI | [
"protected void createBulge( int x1 , double p , boolean byAngle ) {\n double a11 = diag[x1];\n double a22 = diag[x1+1];\n double a12 = off[x1];\n double a23 = off[x1+1];\n\n if( byAngle ) {\n c = Math.cos(p);\n s = Math.sin(p);\n\n c2 = c*c;\n ... | [
"private void addGreeting(String guestbookName, String user, String message)\n throws DatastoreException {\n Entity.Builder greeting = Entity.newBuilder();\n greeting.setKey(makeKey(GUESTBOOK_KIND, guestbookName, GREETING_KIND));\n greeting.getMutableProperties().put(USER_PROPERTY, makeValue(user).bui... |
Triggers a replication request, blocks while the replication is in progress.
@return ReplicationResult encapsulating the result | [
"public com.cloudant.client.api.model.ReplicationResult trigger() {\r\n ReplicationResult couchDbReplicationResult = replication.trigger();\r\n com.cloudant.client.api.model.ReplicationResult replicationResult = new com.cloudant\r\n .client.api.model.ReplicationResult(couchDbReplication... | [
"public static BoxUser.Info createEnterpriseUser(BoxAPIConnection api, String login, String name,\n CreateUserParams params) {\n\n JsonObject requestJSON = new JsonObject();\n requestJSON.add(\"login\", login);\n requestJSON.add(\"name\", name);\n\n if (params != null) {\n ... |
Add a management request handler factory to this context.
@param factory the request handler to add | [
"public void addHandlerFactory(ManagementRequestHandlerFactory factory) {\n for (;;) {\n final ManagementRequestHandlerFactory[] snapshot = updater.get(this);\n final int length = snapshot.length;\n final ManagementRequestHandlerFactory[] newVal = new ManagementRequestHandler... | [
"public UniqueEntityLoader buildLoader(\n\t\t\tOuterJoinLoadable persister,\n\t\t\tint batchSize,\n\t\t\tLockMode lockMode,\n\t\t\tSessionFactoryImplementor factory,\n\t\t\tLoadQueryInfluencers influencers,\n\t\t\tBatchableEntityLoaderBuilder innerEntityLoaderBuilder) {\n\t\tif ( batchSize <= 1 ) {\n\t\t\t// no bat... |
Use this API to fetch aaagroup_vpnsessionpolicy_binding resources of given name . | [
"public static aaagroup_vpnsessionpolicy_binding[] get(nitro_service service, String groupname) throws Exception{\n\t\taaagroup_vpnsessionpolicy_binding obj = new aaagroup_vpnsessionpolicy_binding();\n\t\tobj.set_groupname(groupname);\n\t\taaagroup_vpnsessionpolicy_binding response[] = (aaagroup_vpnsessionpolicy_bi... | [
"private boolean findBinding(Injector injector, Class<?> type) {\n boolean found = false;\n for (Key<?> key : injector.getBindings().keySet()) {\n if (key.getTypeLiteral().getRawType().equals(type)) {\n found = true;\n break;\n }\n }\n ... |
Overridden to skip some symbolizers. | [
"@Override\n\tpublic void visit(Rule rule) {\n\t\tRule copy = null;\n\t\tFilter filterCopy = null;\n\n\t\tif (rule.getFilter() != null) {\n\t\t\tFilter filter = rule.getFilter();\n\t\t\tfilterCopy = copy(filter);\n\t\t}\n\n\t\tList<Symbolizer> symsCopy = new ArrayList<Symbolizer>();\n\t\tfor (Symbolizer sym : rule.... | [
"public void save() throws CmsException {\n\n if (hasChanges()) {\n switch (m_bundleType) {\n case PROPERTY:\n saveLocalization();\n saveToPropertyVfsBundle();\n break;\n\n case XML:\n saveLoc... |
Moves the given row down.
@param row the row to move | [
"public void moveDown(I_CmsEditableGroupRow row) {\n\n int index = m_container.getComponentIndex(row);\n if ((index >= 0) && (index < (m_container.getComponentCount() - 1))) {\n m_container.removeComponent(row);\n m_container.addComponent(row, index + 1);\n }\n upda... | [
"private void recurseAndAddFiles(GraphRewrite event, FileService fileService, WindupJavaConfigurationService javaConfigurationService, FileModel file)\n {\n if (javaConfigurationService.checkIfIgnored(event, file))\n return;\n\n String filePath = file.getFilePath();\n File fileRef... |
gets the first non annotation line number of a node, taking into account annotations. | [
"public static int findFirstNonAnnotationLine(ASTNode node, SourceCode sourceCode) {\r\n if (node instanceof AnnotatedNode && !((AnnotatedNode) node).getAnnotations().isEmpty()) {\r\n\r\n // HACK: Groovy line numbers are broken when annotations have a parameter :(\r\n // so we must look... | [
"public static ReportGenerator.Format getFormat( String... args ) {\n ConfigOptionParser configParser = new ConfigOptionParser();\n List<ConfigOption> configOptions = Arrays.asList( format, help );\n\n for( ConfigOption co : configOptions ) {\n if( co.hasDefault() ) {\n ... |
Checks length and compare order of field names with declared PK fields in metadata. | [
"private boolean isOrdered(FieldDescriptor[] flds, String[] pkFieldNames)\r\n {\r\n if((flds.length > 1 && pkFieldNames == null) || flds.length != pkFieldNames.length)\r\n {\r\n throw new PersistenceBrokerException(\"pkFieldName length does not match number of defined PK fields.\" +\r\n ... | [
"protected boolean isTransient(ClassDescriptor cld, Object obj, Identity oid)\r\n {\r\n // if the Identity is transient we assume a non-persistent object\r\n boolean isNew = oid != null && oid.isTransient();\r\n /*\r\n detection of new objects is costly (select of ID in DB to check if... |
Creates a new Logger instance for the specified name. | [
"private Logger createLoggerInstance(String loggerName) throws Exception\r\n {\r\n Class loggerClass = getConfiguration().getLoggerClass();\r\n Logger log = (Logger) ClassHelper.newInstance(loggerClass, String.class, loggerName);\r\n log.configure(getConfiguration());\r\n return log;\... | [
"public void forAllIndexDescriptorColumns(String template, Properties attributes) throws XDocletException\r\n {\r\n String fields = _curIndexDescriptorDef.getProperty(PropertyHelper.OJB_PROPERTY_FIELDS);\r\n FieldDescriptorDef fieldDef;\r\n String name;\r\n\r\n ... |
Checks that the targetClass is widening the argument class
@param argumentClass
@param targetClass
@return | [
"private static boolean isWideningPrimitive(Class<?> argumentClass, Class<?> targetClass) {\n return WIDENING_TABLE.containsKey(argumentClass) && WIDENING_TABLE.get(argumentClass).contains(targetClass);\n }"
] | [
"public Set<DeviceAnnouncement> findUnreachablePlayers() {\n ensureRunning();\n Set<DeviceAnnouncement> result = new HashSet<DeviceAnnouncement>();\n for (DeviceAnnouncement candidate: DeviceFinder.getInstance().getCurrentDevices()) {\n if (!Util.sameNetwork(matchedAddress.getNetwork... |
Returns a new analysis context builder that extracts the information about the available extensions from
the provided Revapi instance.
<p>The extensions have to be known so that both old and new style of configuration can be usefully worked with.
@param revapi the revapi instance to read the available extensions from
@return a new analysis context builder | [
"@Nonnull\n public static Builder builder(Revapi revapi) {\n List<String> knownExtensionIds = new ArrayList<>();\n\n addExtensionIds(revapi.getPipelineConfiguration().getApiAnalyzerTypes(), knownExtensionIds);\n addExtensionIds(revapi.getPipelineConfiguration().getTransformTypes(), knownExte... | [
"private void addAllWithFilter(Map<String, String> toMap, Map<String, String> fromMap, IncludeExcludePatterns pattern) {\n for (Object o : fromMap.entrySet()) {\n Map.Entry entry = (Map.Entry) o;\n String key = (String) entry.getKey();\n if (PatternMatcher.pathConflicts(key, ... |
The normalized string returned by this method is consistent with java.net.Inet6address.
IPs are not compressed nor mixed in this representation. | [
"@Override\n\tpublic String toNormalizedString() {\n\t\tString result;\n\t\tif(hasNoStringCache() || (result = getStringCache().normalizedString) == null) {\n\t\t\tgetStringCache().normalizedString = result = toNormalizedString(IPv6StringCache.normalizedParams);\n\t\t}\n\t\treturn result;\n\t}"
] | [
"protected LogContext getOrCreate(final String loggingProfile) {\n LogContext result = profileContexts.get(loggingProfile);\n if (result == null) {\n result = LogContext.create();\n final LogContext current = profileContexts.putIfAbsent(loggingProfile, result);\n if (c... |
Add an additional binary type | [
"@Override\n public void accept(IBinaryType binaryType, PackageBinding packageBinding, AccessRestriction accessRestriction) {\n if (this.options.verbose) {\n this.out.println(\n Messages.bind(Messages.compilation_loadBinary, new String(binaryType.getName())));\n//\t\t\tnew Except... | [
"public Iterator getAllExtentClasses()\r\n {\r\n ArrayList subTypes = new ArrayList();\r\n\r\n subTypes.addAll(_extents);\r\n\r\n for (int idx = 0; idx < subTypes.size(); idx++)\r\n {\r\n ClassDescriptorDef curClassDef = (ClassDescriptorDef)subTypes.get(idx);\r\n\r\n ... |
Generates the InputValue for the form input by inspecting the current
value of the corresponding WebElement on the DOM.
@return The current InputValue for the element on the DOM. | [
"private InputValue getInputValue(FormInput input) {\n\n\t\t/* Get the DOM element from Selenium. */\n\t\tWebElement inputElement = browser.getWebElement(input.getIdentification());\n\n\t\tswitch (input.getType()) {\n\t\t\tcase TEXT:\n\t\t\tcase PASSWORD:\n\t\t\tcase HIDDEN:\n\t\t\tcase SELECT:\n\t\t\tcase TEXTAREA... | [
"public static String[] copyArrayAddFirst(String[] arr, String add) {\n String[] arrCopy = new String[arr.length + 1];\n arrCopy[0] = add;\n System.arraycopy(arr, 0, arrCopy, 1, arr.length);\n return arrCopy;\n }",
"public String getStatement()\r\n {\r\n if(sql == null)\r\... |
checks if there is a writelock for transaction tx on object obj.
Returns true if so, else false. | [
"public synchronized boolean checkWrite(TransactionImpl tx, Object obj)\r\n {\r\n if (log.isDebugEnabled()) log.debug(\"LM.checkWrite(tx-\" + tx.getGUID() + \", \" + new Identity(obj, tx.getBroker()).toString() + \")\");\r\n LockStrategy lockStrategy = LockStrategyFactory.getStrategyFor(obj);\r\n ... | [
"public void addExtraInfo(String key, Object value) {\n // Turn extraInfo into map\n Map<String, Object> infoMap = (HashMap<String, Object>)getMapFromJSON(extraInfo);\n // Add value\n infoMap.put(key, value);\n\n // Turn back into string\n extraInfo = getJSONFromMap(infoMap... |
Writes all error responses to the client.
TODO REST-Server 1. collect error stats
@param messageEvent - for retrieving the channel details
@param status - error code
@param message - error message | [
"public static void writeErrorResponse(MessageEvent messageEvent,\n HttpResponseStatus status,\n String message) {\n\n // Create the Response object\n HttpResponse response = new DefaultHttpResponse(HTTP_1_1, status);\n ... | [
"private int calculateRowHeaderMaxWidth(DJCrosstabColumn crosstabColumn) {\n\t\tint auxWidth = 0;\n\t\tboolean firstTime = true;\n\t\tList<DJCrosstabColumn> auxList = new ArrayList<DJCrosstabColumn>(djcross.getColumns());\n\t\tCollections.reverse(auxList);\n\t\tfor (DJCrosstabColumn col : auxList) {\n\t\t\tif (col.... |
Print a resource type.
@param value ResourceType instance
@return resource type value | [
"public static final String printResourceType(ResourceType value)\n {\n return (Integer.toString(value == null ? ResourceType.WORK.getValue() : value.getValue()));\n }"
] | [
"public void setTargetBytecode(String version) {\n if (CompilerConfiguration.PRE_JDK5.equals(version) || CompilerConfiguration.POST_JDK5.equals(version)) {\n this.targetBytecode = version;\n }\n }",
"public static Boolean assertFalse(Boolean value, String message) {\n if (Boolea... |
Append the text at the end of the Path.
@param self a Path
@param text the text to append at the end of the Path
@throws java.io.IOException if an IOException occurs.
@since 2.3.0 | [
"public static void append(Path self, Object text) throws IOException {\n Writer writer = null;\n try {\n writer = new OutputStreamWriter(Files.newOutputStream(self, CREATE, APPEND), Charset.defaultCharset());\n InvokerHelper.write(writer, text);\n writer.flush();\n\n ... | [
"@SuppressWarnings(\"unchecked\")\n\tpublic Map<String, ?> decodeSignedRequest(String signedRequest) throws SignedRequestException {\n\t\treturn decodeSignedRequest(signedRequest, Map.class);\n\t}",
"public void checkConstraints(String checkLevel) throws ConstraintException\r\n {\r\n // now checking con... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.