conversation listlengths 2 2 |
|---|
[
{
"content": "Divide two complex numbers, in-place\n\n@param c complex number to divide this by\n@param result complex number to hold result\n@return same as result",
"role": "user"
},
{
"content": "public ComplexDouble divi(ComplexDouble c, ComplexDouble result) {\n double d = c.r * c.r + c... |
[
{
"content": "Create a random permutation of the numbers 0, ..., size - 1.\n\nsee Algorithm P, D.E. Knuth: The Art of Computer Programming, Vol. 2, p. 145",
"role": "user"
},
{
"content": "public static int[] randomPermutation(int size) {\n Random r = new Random();\n int[] result = new... |
[
{
"content": "Get a random sample of k out of n elements.\n\nSee Algorithm S, D. E. Knuth, The Art of Computer Programming, Vol. 2, p.142.",
"role": "user"
},
{
"content": "public static int[] randomSubset(int k, int n) {\n assert(0 < k && k <= n);\n Random r = new Random();\n i... |
[
{
"content": "Compute a singular-value decomposition of A.\n\n@return A DoubleMatrix[3] array of U, S, V such that A = U * diag(S) * V'",
"role": "user"
},
{
"content": "public static DoubleMatrix[] fullSVD(DoubleMatrix A) {\n int m = A.rows;\n int n = A.columns;\n\n DoubleMatri... |
[
{
"content": "Try to open a file at the given position.",
"role": "user"
},
{
"content": "private InputStream tryPath(String path) {\r\n Logger.getLogger().debug(\"Trying path \\\"\" + path + \"\\\".\");\r\n return getClass().getResourceAsStream(path);\r\n }",
"role": "assistant"
}
] |
[
{
"content": "Load a system library from a stream. Copies the library to a temp file\nand loads from there.\n\n@param libname name of the library (just used in constructing the library name)\n@param is InputStream pointing to the library",
"role": "user"
},
{
"content": "private void loadLibrar... |
[
{
"content": "Check whether vector addition works. This is pure Java code and should work.",
"role": "user"
},
{
"content": "public static void checkVectorAddition() {\n DoubleMatrix x = new DoubleMatrix(3, 1, 1.0, 2.0, 3.0);\n DoubleMatrix y = new DoubleMatrix(3, 1, 4.0, 5.0, 6.0);\n ... |
[
{
"content": "Check whether error handling works. If it works, you should see an\nok, otherwise, you might see the actual error message and then\nthe program exits.",
"role": "user"
},
{
"content": "public static void checkXerbla() {\n double[] x = new double[9];\n System.out.println(\... |
[
{
"content": "Compute eigenvalues. This is a routine not in ATLAS, but in the original\nLAPACK.",
"role": "user"
},
{
"content": "public static void checkEigenvalues() {\n DoubleMatrix A = new DoubleMatrix(new double[][]{\n {3.0, 2.0, 0.0},\n {2.0, 3.0, 2... |
[
{
"content": "Compute Cholesky decomposition of A\n\n@param A symmetric, positive definite matrix (only upper half is used)\n@return upper triangular matrix U such that A = U' * U",
"role": "user"
},
{
"content": "public static DoubleMatrix cholesky(DoubleMatrix A) {\n DoubleMatrix result = A.... |
[
{
"content": "QR decomposition.\n\nDecomposes (m,n) matrix A into a (m,m) matrix Q and an (m,n) matrix R such that\nQ is orthogonal, R is upper triangular and Q * R = A\n\nNote that if A has more rows than columns, then the lower rows of R will contain\nonly zeros, such that the corresponding later columns of Q... |
[
{
"content": "Sets all elements in this matrix to their absolute values. Note\nthat this operation is in-place.\n@see MatrixFunctions#abs(DoubleMatrix)\n@return this matrix",
"role": "user"
},
{
"content": "public static DoubleMatrix absi(DoubleMatrix x) { \n\t\t/*# mapfct('Math.abs') #*/\n//RJPP-BE... |
[
{
"content": "Calculate matrix exponential of a square matrix.\n\nA scaled Pade approximation algorithm is used.\nThe algorithm has been directly translated from Golub & Van Loan \"Matrix Computations\",\nalgorithm 11.3.1. Special Horner techniques from 11.2 are also used to minimize the number\nof matrix multi... |
[
{
"content": "Get the MVT type mapping for the provided JTS Geometry.\n\n@param geometry JTS Geometry to get MVT type for\n@return MVT type for the given JTS Geometry, may return\n{@link com.wdtinc.mapbox_vector_tile.VectorTile.Tile.GeomType#UNKNOWN}",
"role": "user"
},
{
"content": "public static V... |
[
{
"content": "Return true if the values of the two vectors are equal when cast as ints.\n\n@param a first vector to compare\n@param b second vector to compare\n@return true if the values of the two vectors are equal when cast as ints",
"role": "user"
},
{
"content": "private static boolean equalAsIn... |
[
{
"content": "Validate the JtsLayer.\n\n@param name mvt layer name\n@param geometries geometries in the tile\n@throws IllegalArgumentException when {@code name} or {@code geometries} are null",
"role": "user"
},
{
"content": "private static void validate(String name, Collection<Geometry> geometries,... |
[
{
"content": "Add the key and return it's index code. If the key already is present, the previous\nindex code is returned and no insertion is done.\n\n@param key key to add\n@return index of the key",
"role": "user"
},
{
"content": "public int addKey(String key) {\n JdkUtils.requireNonNull(ke... |
[
{
"content": "Find out the scrollable child view from a ViewGroup.\n\n@param viewGroup",
"role": "user"
},
{
"content": "private void findScrollView(ViewGroup viewGroup) {\n scrollChild = viewGroup;\n if (viewGroup.getChildCount() > 0) {\n int count = viewGroup.getChildCount... |
[
{
"content": "Removes all pending broadcasts\n\n@param sessionIds to remove broadcast for (or null for all sessions)",
"role": "user"
},
{
"content": "private void removeAllBroadcasts(Set<String> sessionIds) {\n\n if (sessionIds == null) {\n for (CmsSessionInfo info : OpenCms.getSe... |
[
{
"content": "Handles week day changes.\n@param event the change event.",
"role": "user"
},
{
"content": "@UiHandler(\"m_atDay\")\r\n void onWeekDayChange(ValueChangeEvent<String> event) {\r\n\r\n if (handleChange()) {\r\n m_controller.setWeekDay(event.getValue());\r\n }\... |
[
{
"content": "Creates a check box and adds it to the week panel and the checkboxes.\n@param internalValue the internal value of the checkbox\n@param labelMessageKey key for the label of the checkbox",
"role": "user"
},
{
"content": "private void addCheckBox(final String internalValue, String labelMe... |
[
{
"content": "Check exactly the week check-boxes representing the given weeks.\n@param weeksToCheck the weeks selected.",
"role": "user"
},
{
"content": "private void checkExactlyTheWeeksCheckBoxes(Collection<WeekOfMonth> weeksToCheck) {\r\n\r\n for (CmsCheckBox cb : m_checkboxes) {\r\n ... |
[
{
"content": "Fills the week panel with checkboxes.",
"role": "user"
},
{
"content": "private void fillWeekPanel() {\r\n\r\n addCheckBox(WeekOfMonth.FIRST.toString(), Messages.GUI_SERIALDATE_WEEKDAYNUMBER_1_0);\r\n addCheckBox(WeekOfMonth.SECOND.toString(), Messages.GUI_SERIALDATE_WEEK... |
[
{
"content": "Creates a new HTML-formatted label with the given content.\n\n@param html the label content",
"role": "user"
},
{
"content": "public Label htmlLabel(String html) {\n\n Label label = new Label();\n label.setContentMode(ContentMode.HTML);\n label.setValue(html);\n ... |
[
{
"content": "Reads an HTML snippet with the given name.\n\n@return the HTML data",
"role": "user"
},
{
"content": "public String readSnippet(String name) {\n\n String path = CmsStringUtil.joinPaths(\n m_context.getSetupBean().getWebAppRfsPath(),\n CmsSetupBean.FOLDER_SE... |
[
{
"content": "Returns all values that can be selected in the widget.\n@param cms the current CMS object\n@param rootPath the root path to the currently edited xml file (sitemap config)\n@param allRemoved flag, indicating if all inheritedly available formatters should be disabled\n@return all values that can be ... |
[
{
"content": "Adds a row for the given component at the end of the group.\n\n@param component the component to wrap in the row to be added",
"role": "user"
},
{
"content": "public void addRow(Component component) {\n\n Component actualComponent = component == null ? m_newComponentFactory.get(... |
[
{
"content": "Adds a new row after the given one.\n\n@param row the row after which a new one should be added",
"role": "user"
},
{
"content": "public void addRowAfter(I_CmsEditableGroupRow row) {\n\n int index = m_container.getComponentIndex(row);\n if (index >= 0) {\n Comp... |
[
{
"content": "Gets all rows.\n\n@return the list of all rows",
"role": "user"
},
{
"content": "public List<I_CmsEditableGroupRow> getRows() {\n\n List<I_CmsEditableGroupRow> result = Lists.newArrayList();\n for (Component component : m_container) {\n if (component instanceof... |
[
{
"content": "Moves the given row down.\n\n@param row the row to move",
"role": "user"
},
{
"content": "public void moveDown(I_CmsEditableGroupRow row) {\n\n int index = m_container.getComponentIndex(row);\n if ((index >= 0) && (index < (m_container.getComponentCount() - 1))) {\n ... |
[
{
"content": "Moves the given row up.\n\n@param row the row to move",
"role": "user"
},
{
"content": "public void moveUp(I_CmsEditableGroupRow row) {\n\n int index = m_container.getComponentIndex(row);\n if (index > 0) {\n m_container.removeComponent(row);\n m_con... |
[
{
"content": "Removes the given row.\n\n@param row the row to remove",
"role": "user"
},
{
"content": "public void remove(I_CmsEditableGroupRow row) {\n\n int index = m_container.getComponentIndex(row);\n if (index >= 0) {\n m_container.removeComponent(row);\n }\n ... |
[
{
"content": "Adjusts all links in the target folder that point to the source folder\nso that they are kept \"relative\" in the target folder where possible.\n\nIf a link is found from the target folder to the source folder,\nthen the target folder is checked if a target of the same name\nis found also \"relati... |
[
{
"content": "Sets the Red, Green, and Blue color variables. This will automatically populate the Hue, Saturation and Brightness and Hexadecimal fields, too.\n\nThe 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 col... |
[
{
"content": "Saves the list of currently displayed favorites.",
"role": "user"
},
{
"content": "protected void doSave() {\n\n List<CmsFavoriteEntry> entries = getEntries();\n try {\n m_favDao.saveFavorites(entries);\n } catch (Exception e) {\n CmsErrorDial... |
[
{
"content": "Gets the favorite entries corresponding to the currently displayed favorite widgets.\n\n@return the list of favorite entries",
"role": "user"
},
{
"content": "List<CmsFavoriteEntry> getEntries() {\n\n List<CmsFavoriteEntry> result = new ArrayList<>();\n for (I_CmsEditable... |
[
{
"content": "Creates a favorite widget for a favorite entry.\n\n@param entry the favorite entry\n@return the favorite widget\n\n@throws CmsException if something goes wrong",
"role": "user"
},
{
"content": "private CmsFavInfo createFavInfo(CmsFavoriteEntry entry) throws CmsException {\n\n St... |
[
{
"content": "Gets the favorite entry for a given row.\n\n@param row the widget used to display the favorite\n@return the favorite entry for the widget",
"role": "user"
},
{
"content": "private CmsFavoriteEntry getEntry(Component row) {\n\n if (row instanceof CmsFavInfo) {\n\n retu... |
[
{
"content": "Gets the project name for a favorite entry.\n\n@param cms the CMS context\n@param entry the favorite entry\n@return the project name for the favorite entry\n@throws CmsException if something goes wrong",
"role": "user"
},
{
"content": "private String getProject(CmsObject cms, CmsFavori... |
[
{
"content": "Gets the site label for the entry.\n\n@param cms the current CMS context\n@param entry the entry\n@return the site label for the entry",
"role": "user"
},
{
"content": "private String getSite(CmsObject cms, CmsFavoriteEntry entry) {\n\n CmsSite site = OpenCms.getSiteManager().ge... |
[
{
"content": "The click handler for the add button.",
"role": "user"
},
{
"content": "private void onClickAdd() {\n\n if (m_currentLocation.isPresent()) {\n CmsFavoriteEntry entry = m_currentLocation.get();\n List<CmsFavoriteEntry> entries = getEntries();\n en... |
[
{
"content": "Sets the locale for which the property should be read.\n\n@param locale the locale for which the property should be read.",
"role": "user"
},
{
"content": "public void setLocale(String locale) {\n\n try {\n m_locale = LocaleUtils.toLocale(locale);\n } catch (Il... |
[
{
"content": "Loads the favorite list.\n\n@return the list of favorites\n\n@throws CmsException if something goes wrong",
"role": "user"
},
{
"content": "public List<CmsFavoriteEntry> loadFavorites() throws CmsException {\n\n List<CmsFavoriteEntry> result = new ArrayList<>();\n try {\n... |
[
{
"content": "Saves the favorites.\n\n@param favorites the list of favorites to save\n@throws CmsException if something goes wrong",
"role": "user"
},
{
"content": "public void saveFavorites(List<CmsFavoriteEntry> favorites) throws CmsException {\n\n try {\n JSONObject json = new J... |
[
{
"content": "Validates a favorite entry.\n\n<p>If the favorite entry references a resource or project that can't be read, this will return false.\n\n@param entry the favorite entry\n@return the",
"role": "user"
},
{
"content": "private boolean validate(CmsFavoriteEntry entry) {\n\n try {\n ... |
[
{
"content": "Shows the provided list of dates as current dates.\n@param dates the current dates to show, accompanied with the information if they are exceptions or not.",
"role": "user"
},
{
"content": "public void showCurrentDates(Collection<CmsPair<Date, Boolean>> dates) {\n\n m_overviewLi... |
[
{
"content": "Updates the exceptions panel.",
"role": "user"
},
{
"content": "public void updateExceptions() {\n\n m_exceptionsList.setDates(m_model.getExceptions());\n if (m_model.getExceptions().size() > 0) {\n m_exceptionsPanel.setVisible(true);\n } else {\n ... |
[
{
"content": "Handle a \"current till end\" change event.\n@param event the change event.",
"role": "user"
},
{
"content": "@UiHandler(\"m_currentTillEndCheckBox\")\n void onCurrentTillEndChange(ValueChangeEvent<Boolean> event) {\n\n if (handleChange()) {\n m_controller.setCurre... |
[
{
"content": "Handle an end time change.\n@param event the change event.",
"role": "user"
},
{
"content": "@UiHandler(\"m_endTime\")\n void onEndTimeChange(CmsDateBoxEvent event) {\n\n if (handleChange() && !event.isUserTyping()) {\n m_controller.setEndTime(event.getDate());\n ... |
[
{
"content": "Called when the end type is changed.",
"role": "user"
},
{
"content": "void onEndTypeChange() {\n\n EndType endType = m_model.getEndType();\n m_groupDuration.selectButton(getDurationButtonForType(endType));\n switch (endType) {\n case DATE:\n ... |
[
{
"content": "Called when the pattern has changed.",
"role": "user"
},
{
"content": "void onPatternChange() {\n\n PatternType patternType = m_model.getPatternType();\n boolean isSeries = !patternType.equals(PatternType.NONE);\n setSerialOptionsVisible(isSeries);\n m_serie... |
[
{
"content": "Handle changes of the series check box.\n@param event the change event.",
"role": "user"
},
{
"content": "@UiHandler(\"m_seriesCheckBox\")\n void onSeriesChange(ValueChangeEvent<Boolean> event) {\n\n if (handleChange()) {\n m_controller.setIsSeries(event.getValue()... |
[
{
"content": "Handle a start time change.\n\n@param event the change event",
"role": "user"
},
{
"content": "@UiHandler(\"m_startTime\")\n void onStartTimeChange(CmsDateBoxEvent event) {\n\n if (handleChange() && !event.isUserTyping()) {\n m_controller.setStartTime(event.getDate... |
[
{
"content": "Handle a whole day change event.\n@param event the change event.",
"role": "user"
},
{
"content": "@UiHandler(\"m_wholeDayCheckBox\")\n void onWholeDayChange(ValueChangeEvent<Boolean> event) {\n\n //TODO: Improve - adjust time selections?\n if (handleChange()) {\n ... |
[
{
"content": "Creates a pattern choice radio button and adds it where necessary.\n@param pattern the pattern that should be chosen by the button.\n@param messageKey the message key for the button's label.",
"role": "user"
},
{
"content": "private void createAndAddButton(PatternType pattern, String m... |
[
{
"content": "Initialize dates panel elements.",
"role": "user"
},
{
"content": "private void initDatesPanel() {\n\n m_startLabel.setText(Messages.get().key(Messages.GUI_SERIALDATE_TIME_STARTTIME_0));\n m_startTime.setAllowInvalidValue(true);\n m_startTime.setValue(m_model.getSt... |
[
{
"content": "Initialize elements of the panel displayed for the deactivated widget.",
"role": "user"
},
{
"content": "private void initDeactivationPanel() {\n\n m_deactivationPanel.setVisible(false);\n m_deactivationText.setText(Messages.get().key(Messages.GUI_SERIALDATE_DEACTIVE_TEXT... |
[
{
"content": "Configure all UI elements in the \"ending\"-options panel.",
"role": "user"
},
{
"content": "private void initDurationButtonGroup() {\n\n m_groupDuration = new CmsRadioButtonGroup();\n\n m_endsAfterRadioButton = new CmsRadioButton(\n EndType.TIMES.toString(),\n... |
[
{
"content": "Initialize elements from the duration panel.",
"role": "user"
},
{
"content": "private void initDurationPanel() {\n\n m_durationPrefixLabel.setText(Messages.get().key(Messages.GUI_SERIALDATE_DURATION_PREFIX_0));\n m_durationAfterPostfixLabel.setText(Messages.get().key(Mes... |
[
{
"content": "Configure all UI elements in the exceptions panel.",
"role": "user"
},
{
"content": "private void initExceptionsPanel() {\n\n m_exceptionsPanel.setLegend(Messages.get().key(Messages.GUI_SERIALDATE_PANEL_EXCEPTIONS_0));\n m_exceptionsPanel.addCloseHandler(this);\n m... |
[
{
"content": "Initialize the ui elements for the management part.",
"role": "user"
},
{
"content": "private void initManagementPart() {\n\n m_manageExceptionsButton.setText(Messages.get().key(Messages.GUI_SERIALDATE_BUTTON_MANAGE_EXCEPTIONS_0));\n m_manageExceptionsButton.getElement().... |
[
{
"content": "Initialize the pattern choice button group.",
"role": "user"
},
{
"content": "private void initPatternButtonGroup() {\n\n m_groupPattern = new CmsRadioButtonGroup();\n m_patternButtons = new HashMap<>();\n\n createAndAddButton(PatternType.DAILY, Messages.GUI_SERIAL... |
[
{
"content": "Inject external stylesheets.",
"role": "user"
},
{
"content": "private void injectAdditionalStyles() {\n\n try {\n Collection<String> stylesheets = OpenCms.getWorkplaceAppManager().getAdditionalStyleSheets();\n for (String stylesheet : stylesheets) {\n ... |
[
{
"content": "Creates a new form session to edit the file with the given name using the given form configuration.\n\n@param configPath the site path of the form configuration\n@param fileName the name (not path) of the XML content to edit\n@return the id of the newly created form session\n\n@throws CmsUgcExcept... |
[
{
"content": "Set the value as provided.\n@param value the serial date value as JSON string.",
"role": "user"
},
{
"content": "public final void setValue(String value) {\n\n if ((null == value) || value.isEmpty()) {\n setDefaultValue();\n } else {\n try {\n ... |
[
{
"content": "Converts a collection of dates to a JSON array with the long representation of the dates as strings.\n@param dates the list to convert.\n@return JSON array with long values of dates as string",
"role": "user"
},
{
"content": "private JSONValue datesToJsonArray(Collection<Date> dates) {... |
[
{
"content": "Convert a date to the String representation we use in the JSON.\n@param d the date to convert\n@return the String representation we use in the JSON.",
"role": "user"
},
{
"content": "private JSONValue dateToJson(Date d) {\n\n return null != d ? new JSONString(Long.toString(d.get... |
[
{
"content": "Read an optional boolean value form a JSON value.\n@param val the JSON value that should represent the boolean.\n@return the boolean from the JSON or null if reading the boolean fails.",
"role": "user"
},
{
"content": "private Boolean readOptionalBoolean(JSONValue val) {\n\n JSO... |
[
{
"content": "Read an optional Date value form a JSON value.\n@param val the JSON value that should represent the Date as long value in a string.\n@return the Date from the JSON or null if reading the date fails.",
"role": "user"
},
{
"content": "private Date readOptionalDate(JSONValue val) {\n\n ... |
[
{
"content": "Read an optional int value form a JSON value.\n@param val the JSON value that should represent the int.\n@return the int from the JSON or 0 reading the int fails.",
"role": "user"
},
{
"content": "private int readOptionalInt(JSONValue val) {\n\n JSONString str = null == val ? nu... |
[
{
"content": "Read an optional month value form a JSON value.\n@param val the JSON value that should represent the month.\n@return the month from the JSON or null if reading the month fails.",
"role": "user"
},
{
"content": "private Month readOptionalMonth(JSONValue val) {\n\n String str = re... |
[
{
"content": "Read an optional string value form a JSON value.\n@param val the JSON value that should represent the string.\n@return the string from the JSON or null if reading the string fails.",
"role": "user"
},
{
"content": "private String readOptionalString(JSONValue val) {\n\n JSONStrin... |
[
{
"content": "Read a single weekday from the provided JSON value.\n@param val the value to read the week day from.\n@return the week day read\n@throws IllegalArgumentException thrown if the provided JSON value is not the representation of a week day.",
"role": "user"
},
{
"content": "private WeekDay... |
[
{
"content": "Convert a list of objects to a JSON array with the string representations of that objects.\n@param list the list of objects.\n@return the JSON array with the string representations.",
"role": "user"
},
{
"content": "private JSONValue toJsonStringList(Collection<? extends Object> list) ... |
[
{
"content": "Try to set the value from the provided Json string.\n@param value the value to set.\n@throws Exception thrown if parsing fails.",
"role": "user"
},
{
"content": "private void tryToSetParsedValue(String value) throws Exception {\n\n JSONObject json = JSONParser.parseStrict(value)... |
[
{
"content": "Reads the categories for the given resource.\n\n@param cms the {@link CmsObject} used for reading the categories.\n@param resource the resource for which the categories should be read.\n@return the categories assigned to the given resource.",
"role": "user"
},
{
"content": "private sta... |
[
{
"content": "Returns only the leaf categories of the wrapped categories.\n\nThe method assumes that categories are ordered in the list, i.e., parents are directly followed by their children.\n\nNOTE: In the complete category tree a leaf of the wrapped tree part may not be a leaf.\n\n@return only the leaf categ... |
[
{
"content": "Returns a map from a category path to the wrapper of all the sub-categories of the category with the path given as key.\n\n@return a map from a category path to all sub-categories of the path's category.",
"role": "user"
},
{
"content": "public Map<String, CmsJspCategoryAccessBean> get... |
[
{
"content": "Returns all categories that are direct children of the current main category.\n\n@return all categories that are direct children of the current main category.",
"role": "user"
},
{
"content": "public List<CmsCategory> getTopItems() {\n\n List<CmsCategory> categories = new ArrayL... |
[
{
"content": "adds a CmsJspImageBean as hi-DPI variant to this image\n@param factor the variant multiplier, e.g. \"2x\" (the common retina multiplier)\n@param image the image to be used for this variant",
"role": "user"
},
{
"content": "public void addHiDpiImage(String factor, CmsJspImageBean image)... |
[
{
"content": "Returns the list of Solr fields a search result must have to initialize the gallery search result correctly.\n@return the list of Solr fields.",
"role": "user"
},
{
"content": "public static final String[] getRequiredSolrFields() {\n\n if (null == m_requiredSolrFields) {\n ... |
[
{
"content": "Converts string to UUID and returns it, or null if the conversion is not possible.\n\n@param uuid the potential UUID string\n@return the UUID, or null if conversion is not possible",
"role": "user"
},
{
"content": "private static CmsUUID toUuid(String uuid) {\n\n if (\"null\".eq... |
[
{
"content": "Remove write.lock file in the data directory to ensure the index is unlocked.\n@param dataDir the data directory of the Solr index that should be unlocked.",
"role": "user"
},
{
"content": "private void ensureIndexIsUnlocked(String dataDir) {\n\n Collection<File> lockFiles = new... |
[
{
"content": "Synchronize the scroll positions of the scrollbars with the actual scroll\nposition of the content.",
"role": "user"
},
{
"content": "private void maybeUpdateScrollbarPositions() {\r\n\r\n if (!isAttached()) {\r\n return;\r\n }\r\n\r\n if (m_scrollbar !=... |
[
{
"content": "Set the scrollbar used for vertical scrolling.\n\n@param scrollbar the scrollbar, or null to clear it\n@param width the width of the scrollbar in pixels",
"role": "user"
},
{
"content": "private void setVerticalScrollbar(final CmsScrollBar scrollbar, int width) {\r\n\r\n // Vali... |
[
{
"content": "Detects if the current browser is a BlackBerry device AND\nhas a more capable recent browser. Excludes the Playbook.\nExamples, Storm, Bold, Tour, Curve2\nExcludes the new BlackBerry OS 6 and 7 browser!!\n@return detection of a Blackberry device with a better browser",
"role": "user"
},
{
... |
[
{
"content": "Detects if the current browser is a BlackBerry Touch\ndevice, such as the Storm, Torch, and Bold Touch. Excludes the Playbook.\n@return detection of a Blackberry touchscreen device",
"role": "user"
},
{
"content": "public boolean detectBlackBerryTouch() {\r\n\r\n if (detectBlack... |
[
{
"content": "Detects if the current device is a mobile device.\nThis method catches most of the popular modern devices.\nExcludes Apple iPads and other modern tablets.\n@return detection of any mobile device using the quicker method",
"role": "user"
},
{
"content": "public boolean detectMobileQuick... |
[
{
"content": "Detects if the current device is a Nintendo game device.\n@return detection of Nintendo",
"role": "user"
},
{
"content": "public boolean detectNintendo() {\r\n\r\n if ((userAgent.indexOf(deviceNintendo) != -1)\r\n || (userAgent.indexOf(deviceWii) != -1)\r\n ... |
[
{
"content": "Detects Opera Mobile or Opera Mini.\n@return detection of an Opera browser for a mobile device",
"role": "user"
},
{
"content": "public boolean detectOperaMobile() {\r\n\r\n if ((userAgent.indexOf(engineOpera) != -1)\r\n && ((userAgent.indexOf(mini) != -1) || (userAge... |
[
{
"content": "Detects if the current browser is a Sony Mylo device.\n@return detection of a Sony Mylo device",
"role": "user"
},
{
"content": "public boolean detectSonyMylo() {\r\n\r\n if ((userAgent.indexOf(manuSony) != -1)\r\n && ((userAgent.indexOf(qtembedded) != -1) || (userAge... |
[
{
"content": "The quick way to detect for a tier of devices.\nThis method detects for devices which can\ndisplay iPhone-optimized web content.\nIncludes iPhone, iPod Touch, Android, Windows Phone 7 and 8, BB10, WebOS, Playstation Vita, etc.\n@return detection of any device in the iPhone/Android/Windows Phone/Bl... |
[
{
"content": "The quick way to detect for a tier of devices.\nThis method detects for devices which are likely to be capable\nof viewing CSS content optimized for the iPhone,\nbut may not necessarily support JavaScript.\nExcludes all iPhone Tier devices.\n@return detection of any device in the 'Rich CSS' Tier",... |
[
{
"content": "Set the correct day for the date with year and month already fixed.\n@param date the date, where year and month are already correct.",
"role": "user"
},
{
"content": "private void setCorrectDay(Calendar date) {\n\n if (monthHasNotDay(date)) {\n date.set(Calendar.DAY_O... |
[
{
"content": "Returns the value for a given key from the database properties.\n\n@param key the property key\n\n@return the string value for a given key",
"role": "user"
},
{
"content": "public String getDbProperty(String key) {\n\n // extract the database key out of the entire key\n S... |
[
{
"content": "Over simplistic helper to compare two strings to check radio buttons.\n\n@param value1 the first value\n@param value2 the second value\n@return \"checked\" if both values are equal, the empty String \"\" otherwise",
"role": "user"
},
{
"content": "public String isChecked(String value1,... |
[
{
"content": "Checks whether a user account can be locked because of inactivity.\n\n@param cms the CMS context\n@param user the user to check\n@return true if the user may be locked after being inactive for too long",
"role": "user"
},
{
"content": "public boolean canLockBecauseOfInactivity(CmsObjec... |
[
{
"content": "Adds the download button.\n\n@param view layout which displays the log file",
"role": "user"
},
{
"content": "private void addDownloadButton(final CmsLogFileView view) {\n\n Button button = CmsToolBar.createButton(\n FontOpenCms.DOWNLOAD,\n CmsVaadinUtils.g... |
[
{
"content": "Adds the default value of property if defined.\n\n@param props the Properties object\n@param propDef the property definition\n\n@return true if the property could be added",
"role": "user"
},
{
"content": "@SuppressWarnings(\"unchecked\")\r\n public static boolean addPropertyDefault... |
[
{
"content": "Checks whether a property can be added to a Properties.\n\n@param typeManager\n@param properties the properties object\n@param typeId the type id\n@param filter the property filter\n@param id the property id\n\n@return true if the property should be added",
"role": "user"
},
{
"content... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.