id int32 0 165k | repo stringlengths 7 58 | path stringlengths 12 218 | func_name stringlengths 3 140 | original_string stringlengths 73 34.1k | language stringclasses 1
value | code stringlengths 73 34.1k | code_tokens list | docstring stringlengths 3 16k | docstring_tokens list | sha stringlengths 40 40 | url stringlengths 105 339 |
|---|---|---|---|---|---|---|---|---|---|---|---|
145,400 | fuinorg/utils4j | src/main/java/org/fuin/utils4j/Utils4J.java | Utils4J.zipDir | public static void zipDir(final File srcDir, final FileFilter filter, final String destPath, final File destFile) throws IOException {
Utils4J.checkNotNull("srcDir", srcDir);
Utils4J.checkValidDir(srcDir);
Utils4J.checkNotNull("destFile", destFile);
try (final ZipOutputStream out... | java | public static void zipDir(final File srcDir, final FileFilter filter, final String destPath, final File destFile) throws IOException {
Utils4J.checkNotNull("srcDir", srcDir);
Utils4J.checkValidDir(srcDir);
Utils4J.checkNotNull("destFile", destFile);
try (final ZipOutputStream out... | [
"public",
"static",
"void",
"zipDir",
"(",
"final",
"File",
"srcDir",
",",
"final",
"FileFilter",
"filter",
",",
"final",
"String",
"destPath",
",",
"final",
"File",
"destFile",
")",
"throws",
"IOException",
"{",
"Utils4J",
".",
"checkNotNull",
"(",
"\"srcDir\... | Creates a ZIP file and adds all files in a directory and all it's sub directories to the archive. Only entries are added that comply
to the file filter.
@param srcDir
Directory to add - Cannot be <code>null</code> and must be a valid directory.
@param filter
Filter or <code>null</code> for all files/directories.
@para... | [
"Creates",
"a",
"ZIP",
"file",
"and",
"adds",
"all",
"files",
"in",
"a",
"directory",
"and",
"all",
"it",
"s",
"sub",
"directories",
"to",
"the",
"archive",
".",
"Only",
"entries",
"are",
"added",
"that",
"comply",
"to",
"the",
"file",
"filter",
"."
] | 71cf88e0a8d8ed67bbac513bf3cab165cd7e3280 | https://github.com/fuinorg/utils4j/blob/71cf88e0a8d8ed67bbac513bf3cab165cd7e3280/src/main/java/org/fuin/utils4j/Utils4J.java#L1379-L1389 |
145,401 | fuinorg/utils4j | src/main/java/org/fuin/utils4j/Utils4J.java | Utils4J.zipDir | public static void zipDir(final File srcDir, final String destPath, final File destFile) throws IOException {
zipDir(srcDir, null, destPath, destFile);
} | java | public static void zipDir(final File srcDir, final String destPath, final File destFile) throws IOException {
zipDir(srcDir, null, destPath, destFile);
} | [
"public",
"static",
"void",
"zipDir",
"(",
"final",
"File",
"srcDir",
",",
"final",
"String",
"destPath",
",",
"final",
"File",
"destFile",
")",
"throws",
"IOException",
"{",
"zipDir",
"(",
"srcDir",
",",
"null",
",",
"destPath",
",",
"destFile",
")",
";",... | Creates a ZIP file and adds all files in a directory and all it's sub directories to the archive.
@param srcDir
Directory to add - Cannot be <code>null</code> and must be a valid directory.
@param destPath
Path to use for the ZIP archive - May be <code>null</code> or an empyt string.
@param destFile
Target ZIP file - ... | [
"Creates",
"a",
"ZIP",
"file",
"and",
"adds",
"all",
"files",
"in",
"a",
"directory",
"and",
"all",
"it",
"s",
"sub",
"directories",
"to",
"the",
"archive",
"."
] | 71cf88e0a8d8ed67bbac513bf3cab165cd7e3280 | https://github.com/fuinorg/utils4j/blob/71cf88e0a8d8ed67bbac513bf3cab165cd7e3280/src/main/java/org/fuin/utils4j/Utils4J.java#L1404-L1408 |
145,402 | fuinorg/utils4j | src/main/java/org/fuin/utils4j/Utils4J.java | Utils4J.readAsString | public static String readAsString(final URL url, final String encoding, final int bufSize) {
try (final Reader reader = new InputStreamReader(url.openStream(), encoding)) {
final StringBuilder sb = new StringBuilder();
final char[] cbuf = new char[bufSize];
int count;
... | java | public static String readAsString(final URL url, final String encoding, final int bufSize) {
try (final Reader reader = new InputStreamReader(url.openStream(), encoding)) {
final StringBuilder sb = new StringBuilder();
final char[] cbuf = new char[bufSize];
int count;
... | [
"public",
"static",
"String",
"readAsString",
"(",
"final",
"URL",
"url",
",",
"final",
"String",
"encoding",
",",
"final",
"int",
"bufSize",
")",
"{",
"try",
"(",
"final",
"Reader",
"reader",
"=",
"new",
"InputStreamReader",
"(",
"url",
".",
"openStream",
... | Reads a given URL and returns the content as String.
@param url
URL to read.
@param encoding
Encoding (like 'utf-8').
@param bufSize
Size of the buffer to use.
@return File content as String. | [
"Reads",
"a",
"given",
"URL",
"and",
"returns",
"the",
"content",
"as",
"String",
"."
] | 71cf88e0a8d8ed67bbac513bf3cab165cd7e3280 | https://github.com/fuinorg/utils4j/blob/71cf88e0a8d8ed67bbac513bf3cab165cd7e3280/src/main/java/org/fuin/utils4j/Utils4J.java#L1469-L1481 |
145,403 | fuinorg/utils4j | src/main/java/org/fuin/utils4j/Utils4J.java | Utils4J.replaceCrLfTab | public static String replaceCrLfTab(final String str) {
if (str == null) {
return null;
}
final int len = str.length();
final StringBuilder sb = new StringBuilder();
int i = 0;
while (i < len) {
final char ch = str.charAt(i++);
... | java | public static String replaceCrLfTab(final String str) {
if (str == null) {
return null;
}
final int len = str.length();
final StringBuilder sb = new StringBuilder();
int i = 0;
while (i < len) {
final char ch = str.charAt(i++);
... | [
"public",
"static",
"String",
"replaceCrLfTab",
"(",
"final",
"String",
"str",
")",
"{",
"if",
"(",
"str",
"==",
"null",
")",
"{",
"return",
"null",
";",
"}",
"final",
"int",
"len",
"=",
"str",
".",
"length",
"(",
")",
";",
"final",
"StringBuilder",
... | Replaces the strings "\r", "\n" and "\t" with "carriage return", "new line" and "tab" character.
@param str
String to replace or <code>null</code>.
@return Replaced string or <code>null</code>. | [
"Replaces",
"the",
"strings",
"\\",
"r",
"\\",
"n",
"and",
"\\",
"t",
"with",
"carriage",
"return",
"new",
"line",
"and",
"tab",
"character",
"."
] | 71cf88e0a8d8ed67bbac513bf3cab165cd7e3280 | https://github.com/fuinorg/utils4j/blob/71cf88e0a8d8ed67bbac513bf3cab165cd7e3280/src/main/java/org/fuin/utils4j/Utils4J.java#L1513-L1540 |
145,404 | fuinorg/utils4j | src/main/java/org/fuin/utils4j/Utils4J.java | Utils4J.expectedCause | public static boolean expectedCause(final Exception actualException, final Collection<Class<? extends Exception>> expectedExceptions) {
checkNotNull("actualException", actualException);
if (expectedExceptions == null || expectedExceptions.size() == 0) {
// All exceptions are expected
... | java | public static boolean expectedCause(final Exception actualException, final Collection<Class<? extends Exception>> expectedExceptions) {
checkNotNull("actualException", actualException);
if (expectedExceptions == null || expectedExceptions.size() == 0) {
// All exceptions are expected
... | [
"public",
"static",
"boolean",
"expectedCause",
"(",
"final",
"Exception",
"actualException",
",",
"final",
"Collection",
"<",
"Class",
"<",
"?",
"extends",
"Exception",
">",
">",
"expectedExceptions",
")",
"{",
"checkNotNull",
"(",
"\"actualException\"",
",",
"ac... | Verifies if the cause of an exception is of a given type.
@param actualException
Actual exception that was caused by something else - Cannot be <code>null</code>.
@param expectedExceptions
Expected exceptions - May be <code>null</code> if any cause is expected.
@return TRUE if the actual exception is one of the expec... | [
"Verifies",
"if",
"the",
"cause",
"of",
"an",
"exception",
"is",
"of",
"a",
"given",
"type",
"."
] | 71cf88e0a8d8ed67bbac513bf3cab165cd7e3280 | https://github.com/fuinorg/utils4j/blob/71cf88e0a8d8ed67bbac513bf3cab165cd7e3280/src/main/java/org/fuin/utils4j/Utils4J.java#L1568-L1585 |
145,405 | fuinorg/utils4j | src/main/java/org/fuin/utils4j/Utils4J.java | Utils4J.expectedException | public static boolean expectedException(final Exception actualException,
final Collection<Class<? extends Exception>> expectedExceptions) {
checkNotNull("actualException", actualException);
if (expectedExceptions == null || expectedExceptions.size() == 0) {
// All excepti... | java | public static boolean expectedException(final Exception actualException,
final Collection<Class<? extends Exception>> expectedExceptions) {
checkNotNull("actualException", actualException);
if (expectedExceptions == null || expectedExceptions.size() == 0) {
// All excepti... | [
"public",
"static",
"boolean",
"expectedException",
"(",
"final",
"Exception",
"actualException",
",",
"final",
"Collection",
"<",
"Class",
"<",
"?",
"extends",
"Exception",
">",
">",
"expectedExceptions",
")",
"{",
"checkNotNull",
"(",
"\"actualException\"",
",",
... | Verifies if an exception is of a given type.
@param actualException
Actual exception - Cannot be <code>null</code>.
@param expectedExceptions
Expected exceptions - May be <code>null</code> if any exception is expected.
@return TRUE if the actual exception is one of the expected exceptions. | [
"Verifies",
"if",
"an",
"exception",
"is",
"of",
"a",
"given",
"type",
"."
] | 71cf88e0a8d8ed67bbac513bf3cab165cd7e3280 | https://github.com/fuinorg/utils4j/blob/71cf88e0a8d8ed67bbac513bf3cab165cd7e3280/src/main/java/org/fuin/utils4j/Utils4J.java#L1597-L1615 |
145,406 | fuinorg/utils4j | src/main/java/org/fuin/utils4j/Utils4J.java | Utils4J.jreFile | public static boolean jreFile(final File file) {
final String javaHome = System.getProperty("java.home");
try {
return file.getCanonicalPath().startsWith(javaHome) && file.isFile();
} catch (final IOException ex) {
throw new RuntimeException("Error reading canonical ... | java | public static boolean jreFile(final File file) {
final String javaHome = System.getProperty("java.home");
try {
return file.getCanonicalPath().startsWith(javaHome) && file.isFile();
} catch (final IOException ex) {
throw new RuntimeException("Error reading canonical ... | [
"public",
"static",
"boolean",
"jreFile",
"(",
"final",
"File",
"file",
")",
"{",
"final",
"String",
"javaHome",
"=",
"System",
".",
"getProperty",
"(",
"\"java.home\"",
")",
";",
"try",
"{",
"return",
"file",
".",
"getCanonicalPath",
"(",
")",
".",
"start... | Determines if the file is a file from the Java runtime and exists.
@param file
File to test.
@return TRUE if the file is in the 'java.home' directory. | [
"Determines",
"if",
"the",
"file",
"is",
"a",
"file",
"from",
"the",
"Java",
"runtime",
"and",
"exists",
"."
] | 71cf88e0a8d8ed67bbac513bf3cab165cd7e3280 | https://github.com/fuinorg/utils4j/blob/71cf88e0a8d8ed67bbac513bf3cab165cd7e3280/src/main/java/org/fuin/utils4j/Utils4J.java#L1625-L1632 |
145,407 | fuinorg/utils4j | src/main/java/org/fuin/utils4j/Utils4J.java | Utils4J.classpathFiles | public static List<File> classpathFiles(final Predicate<File> predicate) {
return pathsFiles(System.getProperty("java.class.path"), predicate);
} | java | public static List<File> classpathFiles(final Predicate<File> predicate) {
return pathsFiles(System.getProperty("java.class.path"), predicate);
} | [
"public",
"static",
"List",
"<",
"File",
">",
"classpathFiles",
"(",
"final",
"Predicate",
"<",
"File",
">",
"predicate",
")",
"{",
"return",
"pathsFiles",
"(",
"System",
".",
"getProperty",
"(",
"\"java.class.path\"",
")",
",",
"predicate",
")",
";",
"}"
] | Returns a list of files from the classpath.
@param predicate
Condition that returns files from the classpath.
@return List of files in the classpath (from property "java.class.path"). | [
"Returns",
"a",
"list",
"of",
"files",
"from",
"the",
"classpath",
"."
] | 71cf88e0a8d8ed67bbac513bf3cab165cd7e3280 | https://github.com/fuinorg/utils4j/blob/71cf88e0a8d8ed67bbac513bf3cab165cd7e3280/src/main/java/org/fuin/utils4j/Utils4J.java#L1690-L1693 |
145,408 | fuinorg/utils4j | src/main/java/org/fuin/utils4j/Utils4J.java | Utils4J.pathsFiles | public static List<File> pathsFiles(final String paths, final Predicate<File> predicate) {
final List<File> files = new ArrayList<File>();
for (final String filePathAndName : paths.split(File.pathSeparator)) {
final File file = new File(filePathAndName);
if (file.isDirectory(... | java | public static List<File> pathsFiles(final String paths, final Predicate<File> predicate) {
final List<File> files = new ArrayList<File>();
for (final String filePathAndName : paths.split(File.pathSeparator)) {
final File file = new File(filePathAndName);
if (file.isDirectory(... | [
"public",
"static",
"List",
"<",
"File",
">",
"pathsFiles",
"(",
"final",
"String",
"paths",
",",
"final",
"Predicate",
"<",
"File",
">",
"predicate",
")",
"{",
"final",
"List",
"<",
"File",
">",
"files",
"=",
"new",
"ArrayList",
"<",
"File",
">",
"(",... | Returns a list of files from all given paths.
@param paths
Paths to search (Paths separated by {@link File#pathSeparator}.
@param predicate
Condition for files to return.
@return List of files in the given paths. | [
"Returns",
"a",
"list",
"of",
"files",
"from",
"all",
"given",
"paths",
"."
] | 71cf88e0a8d8ed67bbac513bf3cab165cd7e3280 | https://github.com/fuinorg/utils4j/blob/71cf88e0a8d8ed67bbac513bf3cab165cd7e3280/src/main/java/org/fuin/utils4j/Utils4J.java#L1705-L1722 |
145,409 | pressgang-ccms/PressGangCCMSCommonUtilities | src/main/java/org/jboss/pressgang/ccms/utils/common/HTMLUtilities.java | HTMLUtilities.inlineSvgNodes | private static void inlineSvgNodes(final Document doc, final String basePath) {
try {
// handle null inputs
if (doc == null) return;
final String fixedBasePath = basePath == null ? "" : basePath;
final List<Node> nodes = XMLUtilities.getChildNodes(doc.getDocumen... | java | private static void inlineSvgNodes(final Document doc, final String basePath) {
try {
// handle null inputs
if (doc == null) return;
final String fixedBasePath = basePath == null ? "" : basePath;
final List<Node> nodes = XMLUtilities.getChildNodes(doc.getDocumen... | [
"private",
"static",
"void",
"inlineSvgNodes",
"(",
"final",
"Document",
"doc",
",",
"final",
"String",
"basePath",
")",
"{",
"try",
"{",
"// handle null inputs",
"if",
"(",
"doc",
"==",
"null",
")",
"return",
";",
"final",
"String",
"fixedBasePath",
"=",
"b... | Finds any reference to an external SVG image and replaces the node with
the SVG inline data.
@param doc The document that holds the XHTML
@param basePath The base path where the SVG images can be found | [
"Finds",
"any",
"reference",
"to",
"an",
"external",
"SVG",
"image",
"and",
"replaces",
"the",
"node",
"with",
"the",
"SVG",
"inline",
"data",
"."
] | 5ebf5ed30a94c34c33f4708caa04a8da99cbb15c | https://github.com/pressgang-ccms/PressGangCCMSCommonUtilities/blob/5ebf5ed30a94c34c33f4708caa04a8da99cbb15c/src/main/java/org/jboss/pressgang/ccms/utils/common/HTMLUtilities.java#L87-L124 |
145,410 | pressgang-ccms/PressGangCCMSCommonUtilities | src/main/java/org/jboss/pressgang/ccms/utils/common/HTMLUtilities.java | HTMLUtilities.inlineCssNodes | private static void inlineCssNodes(final Document doc, final String basePath) {
if (doc == null) return;
final String fixedBasePath = basePath == null ? "" : basePath;
final List<Node> nodes = XMLUtilities.getChildNodes(doc.getDocumentElement(), "link");
for (final Node node : nodes) {... | java | private static void inlineCssNodes(final Document doc, final String basePath) {
if (doc == null) return;
final String fixedBasePath = basePath == null ? "" : basePath;
final List<Node> nodes = XMLUtilities.getChildNodes(doc.getDocumentElement(), "link");
for (final Node node : nodes) {... | [
"private",
"static",
"void",
"inlineCssNodes",
"(",
"final",
"Document",
"doc",
",",
"final",
"String",
"basePath",
")",
"{",
"if",
"(",
"doc",
"==",
"null",
")",
"return",
";",
"final",
"String",
"fixedBasePath",
"=",
"basePath",
"==",
"null",
"?",
"\"\""... | Finds any reference to an external CSS scripts and replaces the node with
inline CSS data.
@param doc The document that holds the XHTML
@param basePath The base path where the CSS scripts can be found | [
"Finds",
"any",
"reference",
"to",
"an",
"external",
"CSS",
"scripts",
"and",
"replaces",
"the",
"node",
"with",
"inline",
"CSS",
"data",
"."
] | 5ebf5ed30a94c34c33f4708caa04a8da99cbb15c | https://github.com/pressgang-ccms/PressGangCCMSCommonUtilities/blob/5ebf5ed30a94c34c33f4708caa04a8da99cbb15c/src/main/java/org/jboss/pressgang/ccms/utils/common/HTMLUtilities.java#L133-L173 |
145,411 | pressgang-ccms/PressGangCCMSCommonUtilities | src/main/java/org/jboss/pressgang/ccms/utils/common/HTMLUtilities.java | HTMLUtilities.inlineCssImports | private static String inlineCssImports(final String css, final String basePath) {
String retValue = css;
int start;
while ((start = retValue.indexOf(CSS_IMPORT_START)) != -1) {
int end = retValue.indexOf(CSS_IMPORT_END, start);
if (end != -1) {
final Strin... | java | private static String inlineCssImports(final String css, final String basePath) {
String retValue = css;
int start;
while ((start = retValue.indexOf(CSS_IMPORT_START)) != -1) {
int end = retValue.indexOf(CSS_IMPORT_END, start);
if (end != -1) {
final Strin... | [
"private",
"static",
"String",
"inlineCssImports",
"(",
"final",
"String",
"css",
",",
"final",
"String",
"basePath",
")",
"{",
"String",
"retValue",
"=",
"css",
";",
"int",
"start",
";",
"while",
"(",
"(",
"start",
"=",
"retValue",
".",
"indexOf",
"(",
... | Finds any reference to an external CSS scripts that themselves have been
referenced in a CSS script using an import statement and replaces the
node with inline CSS data.
@param doc The document that holds the XHTML
@param basePath The base path where the CSS scripts can be found | [
"Finds",
"any",
"reference",
"to",
"an",
"external",
"CSS",
"scripts",
"that",
"themselves",
"have",
"been",
"referenced",
"in",
"a",
"CSS",
"script",
"using",
"an",
"import",
"statement",
"and",
"replaces",
"the",
"node",
"with",
"inline",
"CSS",
"data",
".... | 5ebf5ed30a94c34c33f4708caa04a8da99cbb15c | https://github.com/pressgang-ccms/PressGangCCMSCommonUtilities/blob/5ebf5ed30a94c34c33f4708caa04a8da99cbb15c/src/main/java/org/jboss/pressgang/ccms/utils/common/HTMLUtilities.java#L183-L196 |
145,412 | pressgang-ccms/PressGangCCMSCommonUtilities | src/main/java/org/jboss/pressgang/ccms/utils/common/HTMLUtilities.java | HTMLUtilities.inlineImgNodes | private static void inlineImgNodes(final Document doc, final String basePath) {
// handle null inputs
if (doc == null) return;
final String fixedBasePath = basePath == null ? "" : basePath;
final List<Node> imageNodes = XMLUtilities.getChildNodes(doc.getDocumentElement(), "img");
... | java | private static void inlineImgNodes(final Document doc, final String basePath) {
// handle null inputs
if (doc == null) return;
final String fixedBasePath = basePath == null ? "" : basePath;
final List<Node> imageNodes = XMLUtilities.getChildNodes(doc.getDocumentElement(), "img");
... | [
"private",
"static",
"void",
"inlineImgNodes",
"(",
"final",
"Document",
"doc",
",",
"final",
"String",
"basePath",
")",
"{",
"// handle null inputs",
"if",
"(",
"doc",
"==",
"null",
")",
"return",
";",
"final",
"String",
"fixedBasePath",
"=",
"basePath",
"=="... | Finds any reference to an external images and replaces them with inline
base64 data
@param doc The document that holds the XHTML
@param basePath The base path where the images can be found | [
"Finds",
"any",
"reference",
"to",
"an",
"external",
"images",
"and",
"replaces",
"them",
"with",
"inline",
"base64",
"data"
] | 5ebf5ed30a94c34c33f4708caa04a8da99cbb15c | https://github.com/pressgang-ccms/PressGangCCMSCommonUtilities/blob/5ebf5ed30a94c34c33f4708caa04a8da99cbb15c/src/main/java/org/jboss/pressgang/ccms/utils/common/HTMLUtilities.java#L205-L244 |
145,413 | rwl/JKLU | src/main/java/edu/ufl/cise/klu/tdouble/Dklu_kernel.java | Dklu_kernel.dfs | public static int dfs(int j, int k, int[] Pinv, int[] Llen, int Llen_offset,
int[] Lip, int Lip_offset,
int[] Stack, int[] Flag, int[] Lpend, int top, double[] LU,
double[] Lik, int Lik_offset, int[] plength, int[] Ap_pos)
{
int i, pos, jnew, head, l_length;
/*int[]*/double[] Li;
l_length = plength [0]... | java | public static int dfs(int j, int k, int[] Pinv, int[] Llen, int Llen_offset,
int[] Lip, int Lip_offset,
int[] Stack, int[] Flag, int[] Lpend, int top, double[] LU,
double[] Lik, int Lik_offset, int[] plength, int[] Ap_pos)
{
int i, pos, jnew, head, l_length;
/*int[]*/double[] Li;
l_length = plength [0]... | [
"public",
"static",
"int",
"dfs",
"(",
"int",
"j",
",",
"int",
"k",
",",
"int",
"[",
"]",
"Pinv",
",",
"int",
"[",
"]",
"Llen",
",",
"int",
"Llen_offset",
",",
"int",
"[",
"]",
"Lip",
",",
"int",
"Lip_offset",
",",
"int",
"[",
"]",
"Stack",
","... | Does a depth-first-search, starting at node j.
@param j node at which to start the DFS
@param k mark value, for the Flag array
@param Pinv Pinv[i] = k if row i is kth pivot row, or EMPTY if
row i is not yet pivotal.
@param Llen size n, Llen[k] = # nonzeros in column k of L
@param Lip size n, Lip[k] is position in LU o... | [
"Does",
"a",
"depth",
"-",
"first",
"-",
"search",
"starting",
"at",
"node",
"j",
"."
] | 4e5fcdfb479040be72b4642ff1682670142b4892 | https://github.com/rwl/JKLU/blob/4e5fcdfb479040be72b4642ff1682670142b4892/src/main/java/edu/ufl/cise/klu/tdouble/Dklu_kernel.java#L57-L133 |
145,414 | rwl/JKLU | src/main/java/edu/ufl/cise/klu/tdouble/Dklu_kernel.java | Dklu_kernel.lsolve_symbolic | public static int lsolve_symbolic(int n, int k, int[] Ap, int[] Ai,
int[] Q, int[] Pinv, int[] Stack, int[] Flag, int[] Lpend,
int[] Ap_pos, double[] LU, int lup, int[] Llen, int Llen_offset,
int[] Lip, int Lip_offset, int k1, int[] PSinv)
{
/*int[]*/double[] Lik;
int i, p, pend, oldcol, kglobal, top ;
... | java | public static int lsolve_symbolic(int n, int k, int[] Ap, int[] Ai,
int[] Q, int[] Pinv, int[] Stack, int[] Flag, int[] Lpend,
int[] Ap_pos, double[] LU, int lup, int[] Llen, int Llen_offset,
int[] Lip, int Lip_offset, int k1, int[] PSinv)
{
/*int[]*/double[] Lik;
int i, p, pend, oldcol, kglobal, top ;
... | [
"public",
"static",
"int",
"lsolve_symbolic",
"(",
"int",
"n",
",",
"int",
"k",
",",
"int",
"[",
"]",
"Ap",
",",
"int",
"[",
"]",
"Ai",
",",
"int",
"[",
"]",
"Q",
",",
"int",
"[",
"]",
"Pinv",
",",
"int",
"[",
"]",
"Stack",
",",
"int",
"[",
... | Finds the pattern of x, for the solution of Lx=b.
@param n L is n-by-n, where n >= 0
@param k also used as the mark value, for the Flag array
@param Ap
@param Ai
@param Q
@param Pinv Pinv[i] = k if i is kth pivot row, or EMPTY if row i
is not yet pivotal.
@param Stack size n
@param Flag size n. Initially, all of Flag... | [
"Finds",
"the",
"pattern",
"of",
"x",
"for",
"the",
"solution",
"of",
"Lx",
"=",
"b",
"."
] | 4e5fcdfb479040be72b4642ff1682670142b4892 | https://github.com/rwl/JKLU/blob/4e5fcdfb479040be72b4642ff1682670142b4892/src/main/java/edu/ufl/cise/klu/tdouble/Dklu_kernel.java#L159-L208 |
145,415 | rwl/JKLU | src/main/java/edu/ufl/cise/klu/tdouble/Dklu_kernel.java | Dklu_kernel.construct_column | public static void construct_column(int k, int[] Ap, int[] Ai, double[] Ax,
int[] Q, double[] X, int k1, int[] PSinv, double[] Rs, int scale,
int[] Offp, int[] Offi, double[] Offx)
{
double aik ;
int i, p, pend, oldcol, kglobal, poff, oldrow ;
/* -----------------------------------------------------------... | java | public static void construct_column(int k, int[] Ap, int[] Ai, double[] Ax,
int[] Q, double[] X, int k1, int[] PSinv, double[] Rs, int scale,
int[] Offp, int[] Offi, double[] Offx)
{
double aik ;
int i, p, pend, oldcol, kglobal, poff, oldrow ;
/* -----------------------------------------------------------... | [
"public",
"static",
"void",
"construct_column",
"(",
"int",
"k",
",",
"int",
"[",
"]",
"Ap",
",",
"int",
"[",
"]",
"Ai",
",",
"double",
"[",
"]",
"Ax",
",",
"int",
"[",
"]",
"Q",
",",
"double",
"[",
"]",
"X",
",",
"int",
"k1",
",",
"int",
"["... | Construct the kth column of A, and the off-diagonal part, if requested.
Scatter the numerical values into the workspace X, and construct the
corresponding column of the off-diagonal matrix.
@param k the column of A (or the column of the block) to get
@param Ap
@param Ai
@param Ax
@param Q column pre-ordering
@param X
... | [
"Construct",
"the",
"kth",
"column",
"of",
"A",
"and",
"the",
"off",
"-",
"diagonal",
"part",
"if",
"requested",
".",
"Scatter",
"the",
"numerical",
"values",
"into",
"the",
"workspace",
"X",
"and",
"construct",
"the",
"corresponding",
"column",
"of",
"the",... | 4e5fcdfb479040be72b4642ff1682670142b4892 | https://github.com/rwl/JKLU/blob/4e5fcdfb479040be72b4642ff1682670142b4892/src/main/java/edu/ufl/cise/klu/tdouble/Dklu_kernel.java#L229-L292 |
145,416 | pressgang-ccms/PressGangCCMSCommonUtilities | src/main/java/org/jboss/pressgang/ccms/utils/common/FileUtilities.java | FileUtilities.getFileExtension | public static String getFileExtension(final String fileName) {
if (fileName == null) return null;
final int lastPeriodIndex = fileName.lastIndexOf(".");
// make sure there is an extension, and that the filename doesn't end with a period
if (lastPeriodIndex != -1 && lastPeriodIndex ... | java | public static String getFileExtension(final String fileName) {
if (fileName == null) return null;
final int lastPeriodIndex = fileName.lastIndexOf(".");
// make sure there is an extension, and that the filename doesn't end with a period
if (lastPeriodIndex != -1 && lastPeriodIndex ... | [
"public",
"static",
"String",
"getFileExtension",
"(",
"final",
"String",
"fileName",
")",
"{",
"if",
"(",
"fileName",
"==",
"null",
")",
"return",
"null",
";",
"final",
"int",
"lastPeriodIndex",
"=",
"fileName",
".",
"lastIndexOf",
"(",
"\".\"",
")",
";",
... | Gets the extension for a file.
@param fileName The name of the file. eg Image.jpg
@return The filename extension for the file if it has one, otherwise null. | [
"Gets",
"the",
"extension",
"for",
"a",
"file",
"."
] | 5ebf5ed30a94c34c33f4708caa04a8da99cbb15c | https://github.com/pressgang-ccms/PressGangCCMSCommonUtilities/blob/5ebf5ed30a94c34c33f4708caa04a8da99cbb15c/src/main/java/org/jboss/pressgang/ccms/utils/common/FileUtilities.java#L117-L128 |
145,417 | pressgang-ccms/PressGangCCMSCommonUtilities | src/main/java/org/jboss/pressgang/ccms/utils/common/FileUtilities.java | FileUtilities.openFile | public static void openFile(final File file) throws IOException {
// Check that the file is a file
if (!file.isFile()) throw new IOException("Passed file is not a file.");
// Check that the Desktop API is supported
if (!Desktop.isDesktopSupported()) {
throw new Illegal... | java | public static void openFile(final File file) throws IOException {
// Check that the file is a file
if (!file.isFile()) throw new IOException("Passed file is not a file.");
// Check that the Desktop API is supported
if (!Desktop.isDesktopSupported()) {
throw new Illegal... | [
"public",
"static",
"void",
"openFile",
"(",
"final",
"File",
"file",
")",
"throws",
"IOException",
"{",
"// Check that the file is a file\r",
"if",
"(",
"!",
"file",
".",
"isFile",
"(",
")",
")",
"throw",
"new",
"IOException",
"(",
"\"Passed file is not a file.\"... | Opens a file using the OS default program for the file type, using the Java Desktop API.
@param file The file to be opened.
@throws IOException Thrown if there is an issue opening the file.
@throws IllegalStateException Thrown if the Desktop API isn't supported. | [
"Opens",
"a",
"file",
"using",
"the",
"OS",
"default",
"program",
"for",
"the",
"file",
"type",
"using",
"the",
"Java",
"Desktop",
"API",
"."
] | 5ebf5ed30a94c34c33f4708caa04a8da99cbb15c | https://github.com/pressgang-ccms/PressGangCCMSCommonUtilities/blob/5ebf5ed30a94c34c33f4708caa04a8da99cbb15c/src/main/java/org/jboss/pressgang/ccms/utils/common/FileUtilities.java#L223-L241 |
145,418 | pressgang-ccms/PressGangCCMSCommonUtilities | src/main/java/org/jboss/pressgang/ccms/utils/common/FileUtilities.java | FileUtilities.saveFile | public static void saveFile(final File file, final String contents, final String encoding) throws IOException {
saveFile(file, contents.getBytes(encoding));
} | java | public static void saveFile(final File file, final String contents, final String encoding) throws IOException {
saveFile(file, contents.getBytes(encoding));
} | [
"public",
"static",
"void",
"saveFile",
"(",
"final",
"File",
"file",
",",
"final",
"String",
"contents",
",",
"final",
"String",
"encoding",
")",
"throws",
"IOException",
"{",
"saveFile",
"(",
"file",
",",
"contents",
".",
"getBytes",
"(",
"encoding",
")",
... | Save the data, represented as a String to a file
@param file The location/name of the file to be saved.
@param contents The data that is to be written to the file.
@throws IOException | [
"Save",
"the",
"data",
"represented",
"as",
"a",
"String",
"to",
"a",
"file"
] | 5ebf5ed30a94c34c33f4708caa04a8da99cbb15c | https://github.com/pressgang-ccms/PressGangCCMSCommonUtilities/blob/5ebf5ed30a94c34c33f4708caa04a8da99cbb15c/src/main/java/org/jboss/pressgang/ccms/utils/common/FileUtilities.java#L250-L252 |
145,419 | pressgang-ccms/PressGangCCMSCommonUtilities | src/main/java/org/jboss/pressgang/ccms/utils/common/FileUtilities.java | FileUtilities.saveFile | public static void saveFile(final File file, byte[] fileContents) throws IOException {
if (file.isDirectory()) {
throw new IOException("Unable to save file contents as a directory.");
}
final FileOutputStream fos = new FileOutputStream(file);
fos.write(fileContents);
... | java | public static void saveFile(final File file, byte[] fileContents) throws IOException {
if (file.isDirectory()) {
throw new IOException("Unable to save file contents as a directory.");
}
final FileOutputStream fos = new FileOutputStream(file);
fos.write(fileContents);
... | [
"public",
"static",
"void",
"saveFile",
"(",
"final",
"File",
"file",
",",
"byte",
"[",
"]",
"fileContents",
")",
"throws",
"IOException",
"{",
"if",
"(",
"file",
".",
"isDirectory",
"(",
")",
")",
"{",
"throw",
"new",
"IOException",
"(",
"\"Unable to save... | Save the data, represented as a byte array to a file
@param file The location/name of the file to be saved.
@param fileContents The data that is to be written to the file.
@throws IOException | [
"Save",
"the",
"data",
"represented",
"as",
"a",
"byte",
"array",
"to",
"a",
"file"
] | 5ebf5ed30a94c34c33f4708caa04a8da99cbb15c | https://github.com/pressgang-ccms/PressGangCCMSCommonUtilities/blob/5ebf5ed30a94c34c33f4708caa04a8da99cbb15c/src/main/java/org/jboss/pressgang/ccms/utils/common/FileUtilities.java#L261-L270 |
145,420 | rwl/JKLU | src/main/java/edu/ufl/cise/klu/tdouble/Dklu_defaults.java | Dklu_defaults.klu_defaults | public static int klu_defaults(KLU_common Common)
{
if (Common == null)
{
return (FALSE) ;
}
/* parameters */
Common.tol = 0.001 ; /* pivot tolerance for diagonal */
Common.memgrow = 1.2 ; /* realloc size ratio increase for LU factors */
Common.initmem_amd = 1.2 ; /* init. mem with AMD: c*... | java | public static int klu_defaults(KLU_common Common)
{
if (Common == null)
{
return (FALSE) ;
}
/* parameters */
Common.tol = 0.001 ; /* pivot tolerance for diagonal */
Common.memgrow = 1.2 ; /* realloc size ratio increase for LU factors */
Common.initmem_amd = 1.2 ; /* init. mem with AMD: c*... | [
"public",
"static",
"int",
"klu_defaults",
"(",
"KLU_common",
"Common",
")",
"{",
"if",
"(",
"Common",
"==",
"null",
")",
"{",
"return",
"(",
"FALSE",
")",
";",
"}",
"/* parameters */",
"Common",
".",
"tol",
"=",
"0.001",
";",
"/* pivot tolerance for diagona... | Sets default parameters for KLU.
@param Common
@return | [
"Sets",
"default",
"parameters",
"for",
"KLU",
"."
] | 4e5fcdfb479040be72b4642ff1682670142b4892 | https://github.com/rwl/JKLU/blob/4e5fcdfb479040be72b4642ff1682670142b4892/src/main/java/edu/ufl/cise/klu/tdouble/Dklu_defaults.java#L38-L86 |
145,421 | fuinorg/srcgen4j-commons | src/main/java/org/fuin/srcgen4j/commons/ParserConfig.java | ParserConfig.getParser | @SuppressWarnings("unchecked")
@NotNull
public final Parser<Object> getParser() {
if (parser != null) {
return parser;
}
LOG.info("Creating parser: {}", className);
if (className == null) {
throw new IllegalStateException("Class name was not set: "... | java | @SuppressWarnings("unchecked")
@NotNull
public final Parser<Object> getParser() {
if (parser != null) {
return parser;
}
LOG.info("Creating parser: {}", className);
if (className == null) {
throw new IllegalStateException("Class name was not set: "... | [
"@",
"SuppressWarnings",
"(",
"\"unchecked\"",
")",
"@",
"NotNull",
"public",
"final",
"Parser",
"<",
"Object",
">",
"getParser",
"(",
")",
"{",
"if",
"(",
"parser",
"!=",
"null",
")",
"{",
"return",
"parser",
";",
"}",
"LOG",
".",
"info",
"(",
"\"Crea... | Returns an existing parser instance or creates a new one if it's the first call to this method.
@return Parser of type {@link #className}. | [
"Returns",
"an",
"existing",
"parser",
"instance",
"or",
"creates",
"a",
"new",
"one",
"if",
"it",
"s",
"the",
"first",
"call",
"to",
"this",
"method",
"."
] | bce26fd3167ea91fb2f3ad3fc9a1836d3d9fb14b | https://github.com/fuinorg/srcgen4j-commons/blob/bce26fd3167ea91fb2f3ad3fc9a1836d3d9fb14b/src/main/java/org/fuin/srcgen4j/commons/ParserConfig.java#L148-L168 |
145,422 | fuinorg/srcgen4javassist | src/main/java/org/fuin/srcgen4javassist/factory/ImplementedMethod.java | ImplementedMethod.addInterface | public final void addInterface(final Class<?> intf) {
if (intf == null) {
throw new IllegalArgumentException("The argument 'intf' cannot be null!");
}
if (!intf.isInterface()) {
throw new IllegalArgumentException("The argument 'intf' [" + intf.getName()
... | java | public final void addInterface(final Class<?> intf) {
if (intf == null) {
throw new IllegalArgumentException("The argument 'intf' cannot be null!");
}
if (!intf.isInterface()) {
throw new IllegalArgumentException("The argument 'intf' [" + intf.getName()
... | [
"public",
"final",
"void",
"addInterface",
"(",
"final",
"Class",
"<",
"?",
">",
"intf",
")",
"{",
"if",
"(",
"intf",
"==",
"null",
")",
"{",
"throw",
"new",
"IllegalArgumentException",
"(",
"\"The argument 'intf' cannot be null!\"",
")",
";",
"}",
"if",
"("... | Adds a new interface that has this method.
@param intf
Interface to add - Cannot be <code>null</code> and must be an
interface. | [
"Adds",
"a",
"new",
"interface",
"that",
"has",
"this",
"method",
"."
] | 355828113cfce3cdd3d69ba242c5bdfc7d899f2f | https://github.com/fuinorg/srcgen4javassist/blob/355828113cfce3cdd3d69ba242c5bdfc7d899f2f/src/main/java/org/fuin/srcgen4javassist/factory/ImplementedMethod.java#L67-L76 |
145,423 | akberc/ceylon-maven-plugin | src/main/java/com/dgwave/car/maven/CeylonInstallJar.java | CeylonInstallJar.gavExists | private boolean gavExists() {
return groupId != null && !"".equals(groupId)
&& artifactId != null && !"".equals(artifactId)
&& version != null && !"".equals(version);
} | java | private boolean gavExists() {
return groupId != null && !"".equals(groupId)
&& artifactId != null && !"".equals(artifactId)
&& version != null && !"".equals(version);
} | [
"private",
"boolean",
"gavExists",
"(",
")",
"{",
"return",
"groupId",
"!=",
"null",
"&&",
"!",
"\"\"",
".",
"equals",
"(",
"groupId",
")",
"&&",
"artifactId",
"!=",
"null",
"&&",
"!",
"\"\"",
".",
"equals",
"(",
"artifactId",
")",
"&&",
"version",
"!=... | Determines if the GAV coordinates are specified.
@return True if all three exist, false otherwise | [
"Determines",
"if",
"the",
"GAV",
"coordinates",
"are",
"specified",
"."
] | b7f6c4a2b24f2fa237350c9e715f4193e83415ef | https://github.com/akberc/ceylon-maven-plugin/blob/b7f6c4a2b24f2fa237350c9e715f4193e83415ef/src/main/java/com/dgwave/car/maven/CeylonInstallJar.java#L221-L225 |
145,424 | akberc/ceylon-maven-plugin | src/main/java/com/dgwave/car/maven/CeylonInstallJar.java | CeylonInstallJar.installJar | private void installJar(final File installableFile) throws MojoExecutionException {
try {
Artifact artifact = new DefaultArtifact(groupId,
artifactId, version,
null, "jar",
null, new DefaultArtifactHandler("jar"));
inst... | java | private void installJar(final File installableFile) throws MojoExecutionException {
try {
Artifact artifact = new DefaultArtifact(groupId,
artifactId, version,
null, "jar",
null, new DefaultArtifactHandler("jar"));
inst... | [
"private",
"void",
"installJar",
"(",
"final",
"File",
"installableFile",
")",
"throws",
"MojoExecutionException",
"{",
"try",
"{",
"Artifact",
"artifact",
"=",
"new",
"DefaultArtifact",
"(",
"groupId",
",",
"artifactId",
",",
"version",
",",
"null",
",",
"\"jar... | Does the actual installation of the jar file.
@param installableFile The file to install
@throws MojoExecutionException In case of an error | [
"Does",
"the",
"actual",
"installation",
"of",
"the",
"jar",
"file",
"."
] | b7f6c4a2b24f2fa237350c9e715f4193e83415ef | https://github.com/akberc/ceylon-maven-plugin/blob/b7f6c4a2b24f2fa237350c9e715f4193e83415ef/src/main/java/com/dgwave/car/maven/CeylonInstallJar.java#L232-L258 |
145,425 | akberc/ceylon-maven-plugin | src/main/java/com/dgwave/car/maven/CeylonInstallJar.java | CeylonInstallJar.processModel | private void processModel(final Model readModel) {
this.model = readModel;
Parent parent = readModel.getParent();
if (this.groupId == null) {
this.groupId = readModel.getGroupId();
if (this.groupId == null && parent != null) {
this.groupI... | java | private void processModel(final Model readModel) {
this.model = readModel;
Parent parent = readModel.getParent();
if (this.groupId == null) {
this.groupId = readModel.getGroupId();
if (this.groupId == null && parent != null) {
this.groupI... | [
"private",
"void",
"processModel",
"(",
"final",
"Model",
"readModel",
")",
"{",
"this",
".",
"model",
"=",
"readModel",
";",
"Parent",
"parent",
"=",
"readModel",
".",
"getParent",
"(",
")",
";",
"if",
"(",
"this",
".",
"groupId",
"==",
"null",
")",
"... | Populates missing mojo parameters from the specified POM.
@param readModel The POM to extract missing artifact coordinates from,
must not be <code>null</code>. | [
"Populates",
"missing",
"mojo",
"parameters",
"from",
"the",
"specified",
"POM",
"."
] | b7f6c4a2b24f2fa237350c9e715f4193e83415ef | https://github.com/akberc/ceylon-maven-plugin/blob/b7f6c4a2b24f2fa237350c9e715f4193e83415ef/src/main/java/com/dgwave/car/maven/CeylonInstallJar.java#L266-L289 |
145,426 | akberc/ceylon-maven-plugin | src/main/java/com/dgwave/car/maven/CeylonInstallJar.java | CeylonInstallJar.readModel | private Model readModel(final InputStream pomStream) throws MojoExecutionException {
Reader reader = null;
try {
reader = ReaderFactory.newXmlReader(pomStream);
return new MavenXpp3Reader().read(reader);
} catch (FileNotFoundException e) {
throw new Mojo... | java | private Model readModel(final InputStream pomStream) throws MojoExecutionException {
Reader reader = null;
try {
reader = ReaderFactory.newXmlReader(pomStream);
return new MavenXpp3Reader().read(reader);
} catch (FileNotFoundException e) {
throw new Mojo... | [
"private",
"Model",
"readModel",
"(",
"final",
"InputStream",
"pomStream",
")",
"throws",
"MojoExecutionException",
"{",
"Reader",
"reader",
"=",
"null",
";",
"try",
"{",
"reader",
"=",
"ReaderFactory",
".",
"newXmlReader",
"(",
"pomStream",
")",
";",
"return",
... | Parses a POM.
@param pomStream The path of the POM file to parse, must not be <code>null</code>.
@return The model from the POM file, never <code>null</code>.
@throws MojoExecutionException If the POM could not be parsed. | [
"Parses",
"a",
"POM",
"."
] | b7f6c4a2b24f2fa237350c9e715f4193e83415ef | https://github.com/akberc/ceylon-maven-plugin/blob/b7f6c4a2b24f2fa237350c9e715f4193e83415ef/src/main/java/com/dgwave/car/maven/CeylonInstallJar.java#L298-L312 |
145,427 | HsiangLeekwok/hlklib | hlklib/src/main/java/com/hlk/hlklib/lib/view/CircularSeekBar.java | CircularSeekBar.initAttributes | protected void initAttributes(TypedArray attrArray) {
mCircleXRadius = attrArray.getDimension(R.styleable.CircularSeekBar_circle_x_radius, DEFAULT_CIRCLE_X_RADIUS * DPTOPX_SCALE);
mCircleYRadius = attrArray.getDimension(R.styleable.CircularSeekBar_circle_y_radius, DEFAULT_CIRCLE_Y_RADIUS * DPTOPX_SCALE)... | java | protected void initAttributes(TypedArray attrArray) {
mCircleXRadius = attrArray.getDimension(R.styleable.CircularSeekBar_circle_x_radius, DEFAULT_CIRCLE_X_RADIUS * DPTOPX_SCALE);
mCircleYRadius = attrArray.getDimension(R.styleable.CircularSeekBar_circle_y_radius, DEFAULT_CIRCLE_Y_RADIUS * DPTOPX_SCALE)... | [
"protected",
"void",
"initAttributes",
"(",
"TypedArray",
"attrArray",
")",
"{",
"mCircleXRadius",
"=",
"attrArray",
".",
"getDimension",
"(",
"R",
".",
"styleable",
".",
"CircularSeekBar_circle_x_radius",
",",
"DEFAULT_CIRCLE_X_RADIUS",
"*",
"DPTOPX_SCALE",
")",
";",... | Initialize the CircularSeekBar with the attributes from the XML style.
Uses the defaults defined at the top of this file when an attribute is not specified by the user.
@param attrArray TypedArray containing the attributes. | [
"Initialize",
"the",
"CircularSeekBar",
"with",
"the",
"attributes",
"from",
"the",
"XML",
"style",
".",
"Uses",
"the",
"defaults",
"defined",
"at",
"the",
"top",
"of",
"this",
"file",
"when",
"an",
"attribute",
"is",
"not",
"specified",
"by",
"the",
"user",... | b122f6dcab7cec60c8e5455e0c31613d08bec6ad | https://github.com/HsiangLeekwok/hlklib/blob/b122f6dcab7cec60c8e5455e0c31613d08bec6ad/hlklib/src/main/java/com/hlk/hlklib/lib/view/CircularSeekBar.java#L349-L386 |
145,428 | HsiangLeekwok/hlklib | hlklib/src/main/java/com/hlk/hlklib/lib/view/CircularSeekBar.java | CircularSeekBar.setProgress | public void setProgress(int progress) {
if (mProgress != progress) {
mProgress = progress;
if (mOnCircularSeekBarChangeListener != null) {
mOnCircularSeekBarChangeListener.onProgressChanged(this, progress, false);
}
recalculateAll();
i... | java | public void setProgress(int progress) {
if (mProgress != progress) {
mProgress = progress;
if (mOnCircularSeekBarChangeListener != null) {
mOnCircularSeekBarChangeListener.onProgressChanged(this, progress, false);
}
recalculateAll();
i... | [
"public",
"void",
"setProgress",
"(",
"int",
"progress",
")",
"{",
"if",
"(",
"mProgress",
"!=",
"progress",
")",
"{",
"mProgress",
"=",
"progress",
";",
"if",
"(",
"mOnCircularSeekBarChangeListener",
"!=",
"null",
")",
"{",
"mOnCircularSeekBarChangeListener",
"... | Set the progress of the CircularSeekBar.
If the progress is the same, then any listener will not receive a onProgressChanged event.
@param progress The progress to set the CircularSeekBar to. | [
"Set",
"the",
"progress",
"of",
"the",
"CircularSeekBar",
".",
"If",
"the",
"progress",
"is",
"the",
"same",
"then",
"any",
"listener",
"will",
"not",
"receive",
"a",
"onProgressChanged",
"event",
"."
] | b122f6dcab7cec60c8e5455e0c31613d08bec6ad | https://github.com/HsiangLeekwok/hlklib/blob/b122f6dcab7cec60c8e5455e0c31613d08bec6ad/hlklib/src/main/java/com/hlk/hlklib/lib/view/CircularSeekBar.java#L531-L541 |
145,429 | HsiangLeekwok/hlklib | hlklib/src/main/java/com/hlk/hlklib/lib/view/CircularSeekBar.java | CircularSeekBar.setPointerAlpha | public void setPointerAlpha(int alpha) {
if (alpha >= 0 && alpha <= 255) {
mPointerAlpha = alpha;
mPointerHaloPaint.setAlpha(mPointerAlpha);
invalidate();
}
} | java | public void setPointerAlpha(int alpha) {
if (alpha >= 0 && alpha <= 255) {
mPointerAlpha = alpha;
mPointerHaloPaint.setAlpha(mPointerAlpha);
invalidate();
}
} | [
"public",
"void",
"setPointerAlpha",
"(",
"int",
"alpha",
")",
"{",
"if",
"(",
"alpha",
">=",
"0",
"&&",
"alpha",
"<=",
"255",
")",
"{",
"mPointerAlpha",
"=",
"alpha",
";",
"mPointerHaloPaint",
".",
"setAlpha",
"(",
"mPointerAlpha",
")",
";",
"invalidate",... | Sets the pointer alpha.
@param alpha the alpha of the pointer | [
"Sets",
"the",
"pointer",
"alpha",
"."
] | b122f6dcab7cec60c8e5455e0c31613d08bec6ad | https://github.com/HsiangLeekwok/hlklib/blob/b122f6dcab7cec60c8e5455e0c31613d08bec6ad/hlklib/src/main/java/com/hlk/hlklib/lib/view/CircularSeekBar.java#L973-L979 |
145,430 | HsiangLeekwok/hlklib | hlklib/src/main/java/com/hlk/hlklib/lib/view/CircularSeekBar.java | CircularSeekBar.setMax | public void setMax(int max) {
if (!(max <= 0)) { // Check to make sure it's greater than zero
if (max <= mProgress) {
mProgress = 0; // If the new max is less than current progress, set progress to zero
if (mOnCircularSeekBarChangeListener != null) {
... | java | public void setMax(int max) {
if (!(max <= 0)) { // Check to make sure it's greater than zero
if (max <= mProgress) {
mProgress = 0; // If the new max is less than current progress, set progress to zero
if (mOnCircularSeekBarChangeListener != null) {
... | [
"public",
"void",
"setMax",
"(",
"int",
"max",
")",
"{",
"if",
"(",
"!",
"(",
"max",
"<=",
"0",
")",
")",
"{",
"// Check to make sure it's greater than zero",
"if",
"(",
"max",
"<=",
"mProgress",
")",
"{",
"mProgress",
"=",
"0",
";",
"// If the new max is ... | Set the max of the CircularSeekBar.
If the new max is less than the current progress, then the progress will be set to zero.
If the progress is changed as a result, then any listener will receive a onProgressChanged event.
@param max The new max for the CircularSeekBar. | [
"Set",
"the",
"max",
"of",
"the",
"CircularSeekBar",
".",
"If",
"the",
"new",
"max",
"is",
"less",
"than",
"the",
"current",
"progress",
"then",
"the",
"progress",
"will",
"be",
"set",
"to",
"zero",
".",
"If",
"the",
"progress",
"is",
"changed",
"as",
... | b122f6dcab7cec60c8e5455e0c31613d08bec6ad | https://github.com/HsiangLeekwok/hlklib/blob/b122f6dcab7cec60c8e5455e0c31613d08bec6ad/hlklib/src/main/java/com/hlk/hlklib/lib/view/CircularSeekBar.java#L1037-L1050 |
145,431 | wcm-io-caravan/caravan-hal | resource/src/main/java/io/wcm/caravan/hal/resource/HalResource.java | HalResource.collectLinks | public List<Link> collectLinks(String rel) {
return collectResources(Link.class, HalResourceType.LINKS, rel);
} | java | public List<Link> collectLinks(String rel) {
return collectResources(Link.class, HalResourceType.LINKS, rel);
} | [
"public",
"List",
"<",
"Link",
">",
"collectLinks",
"(",
"String",
"rel",
")",
"{",
"return",
"collectResources",
"(",
"Link",
".",
"class",
",",
"HalResourceType",
".",
"LINKS",
",",
"rel",
")",
";",
"}"
] | recursively collects links within this resource and all embedded resources
@param rel the relation your interested in
@return a list of all links | [
"recursively",
"collects",
"links",
"within",
"this",
"resource",
"and",
"all",
"embedded",
"resources"
] | 25d58756b58c70c8c48a17fe781e673dd93d5085 | https://github.com/wcm-io-caravan/caravan-hal/blob/25d58756b58c70c8c48a17fe781e673dd93d5085/resource/src/main/java/io/wcm/caravan/hal/resource/HalResource.java#L218-L220 |
145,432 | wcm-io-caravan/caravan-hal | resource/src/main/java/io/wcm/caravan/hal/resource/HalResource.java | HalResource.collectEmbedded | public List<HalResource> collectEmbedded(String rel) {
return collectResources(HalResource.class, HalResourceType.EMBEDDED, rel);
} | java | public List<HalResource> collectEmbedded(String rel) {
return collectResources(HalResource.class, HalResourceType.EMBEDDED, rel);
} | [
"public",
"List",
"<",
"HalResource",
">",
"collectEmbedded",
"(",
"String",
"rel",
")",
"{",
"return",
"collectResources",
"(",
"HalResource",
".",
"class",
",",
"HalResourceType",
".",
"EMBEDDED",
",",
"rel",
")",
";",
"}"
] | recursively collects embedded resources of a specific rel
@param rel the relation your interested in
@return a list of all embedded resources | [
"recursively",
"collects",
"embedded",
"resources",
"of",
"a",
"specific",
"rel"
] | 25d58756b58c70c8c48a17fe781e673dd93d5085 | https://github.com/wcm-io-caravan/caravan-hal/blob/25d58756b58c70c8c48a17fe781e673dd93d5085/resource/src/main/java/io/wcm/caravan/hal/resource/HalResource.java#L251-L253 |
145,433 | wcm-io-caravan/caravan-hal | resource/src/main/java/io/wcm/caravan/hal/resource/HalResource.java | HalResource.setEmbedded | public HalResource setEmbedded(String relation, HalResource resource) {
if (resource == null) {
return this;
}
return addResources(HalResourceType.EMBEDDED, relation, false, new HalResource[] {
resource
});
} | java | public HalResource setEmbedded(String relation, HalResource resource) {
if (resource == null) {
return this;
}
return addResources(HalResourceType.EMBEDDED, relation, false, new HalResource[] {
resource
});
} | [
"public",
"HalResource",
"setEmbedded",
"(",
"String",
"relation",
",",
"HalResource",
"resource",
")",
"{",
"if",
"(",
"resource",
"==",
"null",
")",
"{",
"return",
"this",
";",
"}",
"return",
"addResources",
"(",
"HalResourceType",
".",
"EMBEDDED",
",",
"r... | Embed resource for the given relation. Overwrites existing one.
@param relation Embedded resource relation
@param resource Resource to embed
@return HAL resource | [
"Embed",
"resource",
"for",
"the",
"given",
"relation",
".",
"Overwrites",
"existing",
"one",
"."
] | 25d58756b58c70c8c48a17fe781e673dd93d5085 | https://github.com/wcm-io-caravan/caravan-hal/blob/25d58756b58c70c8c48a17fe781e673dd93d5085/resource/src/main/java/io/wcm/caravan/hal/resource/HalResource.java#L337-L344 |
145,434 | wcm-io-caravan/caravan-hal | resource/src/main/java/io/wcm/caravan/hal/resource/HalResource.java | HalResource.removeLink | public HalResource removeLink(String relation, int index) {
return removeResource(HalResourceType.LINKS, relation, index);
} | java | public HalResource removeLink(String relation, int index) {
return removeResource(HalResourceType.LINKS, relation, index);
} | [
"public",
"HalResource",
"removeLink",
"(",
"String",
"relation",
",",
"int",
"index",
")",
"{",
"return",
"removeResource",
"(",
"HalResourceType",
".",
"LINKS",
",",
"relation",
",",
"index",
")",
";",
"}"
] | Removes one link for the given relation and index.
@param relation Link relation
@param index Array index
@return HAL resource | [
"Removes",
"one",
"link",
"for",
"the",
"given",
"relation",
"and",
"index",
"."
] | 25d58756b58c70c8c48a17fe781e673dd93d5085 | https://github.com/wcm-io-caravan/caravan-hal/blob/25d58756b58c70c8c48a17fe781e673dd93d5085/resource/src/main/java/io/wcm/caravan/hal/resource/HalResource.java#L440-L442 |
145,435 | wcm-io-caravan/caravan-hal | resource/src/main/java/io/wcm/caravan/hal/resource/HalResource.java | HalResource.removeLinkWithHref | public HalResource removeLinkWithHref(String relation, String href) {
List<Link> links = getLinks(relation);
for (int i = 0; i < links.size(); i++) {
if (href.equals(links.get(i).getHref())) {
return removeLink(relation, i);
}
}
return this;
} | java | public HalResource removeLinkWithHref(String relation, String href) {
List<Link> links = getLinks(relation);
for (int i = 0; i < links.size(); i++) {
if (href.equals(links.get(i).getHref())) {
return removeLink(relation, i);
}
}
return this;
} | [
"public",
"HalResource",
"removeLinkWithHref",
"(",
"String",
"relation",
",",
"String",
"href",
")",
"{",
"List",
"<",
"Link",
">",
"links",
"=",
"getLinks",
"(",
"relation",
")",
";",
"for",
"(",
"int",
"i",
"=",
"0",
";",
"i",
"<",
"links",
".",
"... | Remove the link with the given relation and href
@param relation Link relation
@param href to identify the link to remove
@return this HAL resource | [
"Remove",
"the",
"link",
"with",
"the",
"given",
"relation",
"and",
"href"
] | 25d58756b58c70c8c48a17fe781e673dd93d5085 | https://github.com/wcm-io-caravan/caravan-hal/blob/25d58756b58c70c8c48a17fe781e673dd93d5085/resource/src/main/java/io/wcm/caravan/hal/resource/HalResource.java#L451-L461 |
145,436 | wcm-io-caravan/caravan-hal | resource/src/main/java/io/wcm/caravan/hal/resource/HalResource.java | HalResource.removeEmbedded | public HalResource removeEmbedded(String relation, int index) {
return removeResource(HalResourceType.EMBEDDED, relation, index);
} | java | public HalResource removeEmbedded(String relation, int index) {
return removeResource(HalResourceType.EMBEDDED, relation, index);
} | [
"public",
"HalResource",
"removeEmbedded",
"(",
"String",
"relation",
",",
"int",
"index",
")",
"{",
"return",
"removeResource",
"(",
"HalResourceType",
".",
"EMBEDDED",
",",
"relation",
",",
"index",
")",
";",
"}"
] | Removes one embedded resource for the given relation and index.
@param relation Embedded resource relation
@param index Array index
@return HAL resource | [
"Removes",
"one",
"embedded",
"resource",
"for",
"the",
"given",
"relation",
"and",
"index",
"."
] | 25d58756b58c70c8c48a17fe781e673dd93d5085 | https://github.com/wcm-io-caravan/caravan-hal/blob/25d58756b58c70c8c48a17fe781e673dd93d5085/resource/src/main/java/io/wcm/caravan/hal/resource/HalResource.java#L469-L471 |
145,437 | wcm-io-caravan/caravan-hal | resource/src/main/java/io/wcm/caravan/hal/resource/HalResource.java | HalResource.renameEmbedded | public HalResource renameEmbedded(String relToRename, String newRel) {
List<HalResource> resources = getEmbedded(relToRename);
return removeEmbedded(relToRename).addEmbedded(newRel, resources);
} | java | public HalResource renameEmbedded(String relToRename, String newRel) {
List<HalResource> resources = getEmbedded(relToRename);
return removeEmbedded(relToRename).addEmbedded(newRel, resources);
} | [
"public",
"HalResource",
"renameEmbedded",
"(",
"String",
"relToRename",
",",
"String",
"newRel",
")",
"{",
"List",
"<",
"HalResource",
">",
"resources",
"=",
"getEmbedded",
"(",
"relToRename",
")",
";",
"return",
"removeEmbedded",
"(",
"relToRename",
")",
".",
... | Changes the rel of embedded resources
@param relToRename the rel that you want to change
@param newRel the new rel for all embedded items
@return HAL resource | [
"Changes",
"the",
"rel",
"of",
"embedded",
"resources"
] | 25d58756b58c70c8c48a17fe781e673dd93d5085 | https://github.com/wcm-io-caravan/caravan-hal/blob/25d58756b58c70c8c48a17fe781e673dd93d5085/resource/src/main/java/io/wcm/caravan/hal/resource/HalResource.java#L508-L511 |
145,438 | wcm-io-caravan/caravan-hal | resource/src/main/java/io/wcm/caravan/hal/resource/HalResource.java | HalResource.addState | public HalResource addState(ObjectNode state) {
state.fields().forEachRemaining(entry -> model.set(entry.getKey(), entry.getValue()));
return this;
} | java | public HalResource addState(ObjectNode state) {
state.fields().forEachRemaining(entry -> model.set(entry.getKey(), entry.getValue()));
return this;
} | [
"public",
"HalResource",
"addState",
"(",
"ObjectNode",
"state",
")",
"{",
"state",
".",
"fields",
"(",
")",
".",
"forEachRemaining",
"(",
"entry",
"->",
"model",
".",
"set",
"(",
"entry",
".",
"getKey",
"(",
")",
",",
"entry",
".",
"getValue",
"(",
")... | Adds state to the resource.
@param state Resource state
@return HAL resource | [
"Adds",
"state",
"to",
"the",
"resource",
"."
] | 25d58756b58c70c8c48a17fe781e673dd93d5085 | https://github.com/wcm-io-caravan/caravan-hal/blob/25d58756b58c70c8c48a17fe781e673dd93d5085/resource/src/main/java/io/wcm/caravan/hal/resource/HalResource.java#L523-L526 |
145,439 | wcm-io-caravan/caravan-hal | docs/src/main/java/io/wcm/caravan/hal/docs/impl/reader/ServiceModelReader.java | ServiceModelReader.read | public static Service read(Bundle bundle) {
String resourcePath = DOCS_CLASSPATH_PREFIX + "/" + SERVICE_DOC_FILE;
URL bundleResource = bundle.getResource(resourcePath);
if (bundleResource == null) {
return null;
}
try (InputStream is = bundleResource.openStream()) {
return new ServiceJso... | java | public static Service read(Bundle bundle) {
String resourcePath = DOCS_CLASSPATH_PREFIX + "/" + SERVICE_DOC_FILE;
URL bundleResource = bundle.getResource(resourcePath);
if (bundleResource == null) {
return null;
}
try (InputStream is = bundleResource.openStream()) {
return new ServiceJso... | [
"public",
"static",
"Service",
"read",
"(",
"Bundle",
"bundle",
")",
"{",
"String",
"resourcePath",
"=",
"DOCS_CLASSPATH_PREFIX",
"+",
"\"/\"",
"+",
"SERVICE_DOC_FILE",
";",
"URL",
"bundleResource",
"=",
"bundle",
".",
"getResource",
"(",
"resourcePath",
")",
";... | Reads service model from bundle classpath.
@param bundle Bundle
@return Service model or null if not found or not parseable. | [
"Reads",
"service",
"model",
"from",
"bundle",
"classpath",
"."
] | 25d58756b58c70c8c48a17fe781e673dd93d5085 | https://github.com/wcm-io-caravan/caravan-hal/blob/25d58756b58c70c8c48a17fe781e673dd93d5085/docs/src/main/java/io/wcm/caravan/hal/docs/impl/reader/ServiceModelReader.java#L57-L70 |
145,440 | HsiangLeekwok/hlklib | hlklib/src/main/java/com/hlk/hlklib/lib/datetimepicker/SlidingTabLayout.java | SlidingTabLayout.setTabText | public void setTabText(int index, String text) {
TextView tv = (TextView) mTabTitleViews.get(index);
if (tv != null) {
tv.setText(text);
}
} | java | public void setTabText(int index, String text) {
TextView tv = (TextView) mTabTitleViews.get(index);
if (tv != null) {
tv.setText(text);
}
} | [
"public",
"void",
"setTabText",
"(",
"int",
"index",
",",
"String",
"text",
")",
"{",
"TextView",
"tv",
"=",
"(",
"TextView",
")",
"mTabTitleViews",
".",
"get",
"(",
"index",
")",
";",
"if",
"(",
"tv",
"!=",
"null",
")",
"{",
"tv",
".",
"setText",
... | Set the text on the specified tab's TextView.
@param index the index of the tab whose TextView you want to update
@param text the text to display on the specified tab's TextView | [
"Set",
"the",
"text",
"on",
"the",
"specified",
"tab",
"s",
"TextView",
"."
] | b122f6dcab7cec60c8e5455e0c31613d08bec6ad | https://github.com/HsiangLeekwok/hlklib/blob/b122f6dcab7cec60c8e5455e0c31613d08bec6ad/hlklib/src/main/java/com/hlk/hlklib/lib/datetimepicker/SlidingTabLayout.java#L247-L253 |
145,441 | fuinorg/srcgen4j-commons | src/main/java/org/fuin/srcgen4j/commons/Generators.java | Generators.addGenerator | public final void addGenerator(@NotNull final GeneratorConfig generator) {
Contract.requireArgNotNull("generator", generator);
if (list == null) {
list = new ArrayList<>();
}
list.add(generator);
} | java | public final void addGenerator(@NotNull final GeneratorConfig generator) {
Contract.requireArgNotNull("generator", generator);
if (list == null) {
list = new ArrayList<>();
}
list.add(generator);
} | [
"public",
"final",
"void",
"addGenerator",
"(",
"@",
"NotNull",
"final",
"GeneratorConfig",
"generator",
")",
"{",
"Contract",
".",
"requireArgNotNull",
"(",
"\"generator\"",
",",
"generator",
")",
";",
"if",
"(",
"list",
"==",
"null",
")",
"{",
"list",
"=",... | Adds a generator to the list. If the list does not exist it's created.
@param generator
Generator to add. | [
"Adds",
"a",
"generator",
"to",
"the",
"list",
".",
"If",
"the",
"list",
"does",
"not",
"exist",
"it",
"s",
"created",
"."
] | bce26fd3167ea91fb2f3ad3fc9a1836d3d9fb14b | https://github.com/fuinorg/srcgen4j-commons/blob/bce26fd3167ea91fb2f3ad3fc9a1836d3d9fb14b/src/main/java/org/fuin/srcgen4j/commons/Generators.java#L99-L105 |
145,442 | fuinorg/srcgen4j-commons | src/main/java/org/fuin/srcgen4j/commons/Generators.java | Generators.findByName | @Nullable
public final GeneratorConfig findByName(@NotEmpty final String generatorName) throws GeneratorNotFoundException {
Contract.requireArgNotEmpty("generatorName", generatorName);
final int idx = list.indexOf(new GeneratorConfig(generatorName, "dummy", "dummy"));
if (idx < 0) {
... | java | @Nullable
public final GeneratorConfig findByName(@NotEmpty final String generatorName) throws GeneratorNotFoundException {
Contract.requireArgNotEmpty("generatorName", generatorName);
final int idx = list.indexOf(new GeneratorConfig(generatorName, "dummy", "dummy"));
if (idx < 0) {
... | [
"@",
"Nullable",
"public",
"final",
"GeneratorConfig",
"findByName",
"(",
"@",
"NotEmpty",
"final",
"String",
"generatorName",
")",
"throws",
"GeneratorNotFoundException",
"{",
"Contract",
".",
"requireArgNotEmpty",
"(",
"\"generatorName\"",
",",
"generatorName",
")",
... | Returns a generator by it's name.
@param generatorName
Name to find.
@return The generator.
@throws GeneratorNotFoundException
No generator with the given name was found. | [
"Returns",
"a",
"generator",
"by",
"it",
"s",
"name",
"."
] | bce26fd3167ea91fb2f3ad3fc9a1836d3d9fb14b | https://github.com/fuinorg/srcgen4j-commons/blob/bce26fd3167ea91fb2f3ad3fc9a1836d3d9fb14b/src/main/java/org/fuin/srcgen4j/commons/Generators.java#L142-L150 |
145,443 | fuinorg/srcgen4javassist | src/main/java/org/fuin/srcgen4javassist/SgClassPool.java | SgClassPool.get | public final SgClass get(final String className) {
if (className == null) {
throw new IllegalArgumentException("The argument 'className' cannot be null!");
}
return cache.get(className);
} | java | public final SgClass get(final String className) {
if (className == null) {
throw new IllegalArgumentException("The argument 'className' cannot be null!");
}
return cache.get(className);
} | [
"public",
"final",
"SgClass",
"get",
"(",
"final",
"String",
"className",
")",
"{",
"if",
"(",
"className",
"==",
"null",
")",
"{",
"throw",
"new",
"IllegalArgumentException",
"(",
"\"The argument 'className' cannot be null!\"",
")",
";",
"}",
"return",
"cache",
... | Returns a class from the internal cache.
@param className
Class to find - Cannot be null.
@return Class or null if it's not found. | [
"Returns",
"a",
"class",
"from",
"the",
"internal",
"cache",
"."
] | 355828113cfce3cdd3d69ba242c5bdfc7d899f2f | https://github.com/fuinorg/srcgen4javassist/blob/355828113cfce3cdd3d69ba242c5bdfc7d899f2f/src/main/java/org/fuin/srcgen4javassist/SgClassPool.java#L55-L60 |
145,444 | fuinorg/srcgen4javassist | src/main/java/org/fuin/srcgen4javassist/SgClassPool.java | SgClassPool.put | public final void put(final SgClass clasz) {
if (clasz == null) {
throw new IllegalArgumentException("The argument 'clasz' cannot be null!");
}
cache.put(clasz.getName(), clasz);
} | java | public final void put(final SgClass clasz) {
if (clasz == null) {
throw new IllegalArgumentException("The argument 'clasz' cannot be null!");
}
cache.put(clasz.getName(), clasz);
} | [
"public",
"final",
"void",
"put",
"(",
"final",
"SgClass",
"clasz",
")",
"{",
"if",
"(",
"clasz",
"==",
"null",
")",
"{",
"throw",
"new",
"IllegalArgumentException",
"(",
"\"The argument 'clasz' cannot be null!\"",
")",
";",
"}",
"cache",
".",
"put",
"(",
"c... | Adds a class to the internal cache.
@param clasz
Class to add - Cannot be null. | [
"Adds",
"a",
"class",
"to",
"the",
"internal",
"cache",
"."
] | 355828113cfce3cdd3d69ba242c5bdfc7d899f2f | https://github.com/fuinorg/srcgen4javassist/blob/355828113cfce3cdd3d69ba242c5bdfc7d899f2f/src/main/java/org/fuin/srcgen4javassist/SgClassPool.java#L68-L73 |
145,445 | UweTrottmann/getglue-java | src/main/java/com/uwetrottmann/getglue/Utils.java | Utils.createOkHttpClient | public static OkHttpClient createOkHttpClient() {
OkHttpClient okHttpClient = new OkHttpClient();
// set timeouts
okHttpClient.setConnectTimeout(15 * 1000, TimeUnit.MILLISECONDS);
okHttpClient.setReadTimeout(20 * 1000, TimeUnit.MILLISECONDS);
return okHttpClient;
} | java | public static OkHttpClient createOkHttpClient() {
OkHttpClient okHttpClient = new OkHttpClient();
// set timeouts
okHttpClient.setConnectTimeout(15 * 1000, TimeUnit.MILLISECONDS);
okHttpClient.setReadTimeout(20 * 1000, TimeUnit.MILLISECONDS);
return okHttpClient;
} | [
"public",
"static",
"OkHttpClient",
"createOkHttpClient",
"(",
")",
"{",
"OkHttpClient",
"okHttpClient",
"=",
"new",
"OkHttpClient",
"(",
")",
";",
"// set timeouts",
"okHttpClient",
".",
"setConnectTimeout",
"(",
"15",
"*",
"1000",
",",
"TimeUnit",
".",
"MILLISEC... | Create an OkHttpClient with sensible timeouts for mobile connections. | [
"Create",
"an",
"OkHttpClient",
"with",
"sensible",
"timeouts",
"for",
"mobile",
"connections",
"."
] | 9d79c150124f7e71c88568510df5f4f7ccd75d25 | https://github.com/UweTrottmann/getglue-java/blob/9d79c150124f7e71c88568510df5f4f7ccd75d25/src/main/java/com/uwetrottmann/getglue/Utils.java#L28-L36 |
145,446 | jmchilton/galaxy-bootstrap | src/main/java/com/github/jmchilton/galaxybootstrap/DownloadProperties.java | DownloadProperties.forGalaxyDist | @Deprecated
public static DownloadProperties forGalaxyDist(final File destination, String revision) {
return new DownloadProperties(GALAXY_DIST_REPOSITORY_URL, BRANCH_STABLE, revision, destination);
} | java | @Deprecated
public static DownloadProperties forGalaxyDist(final File destination, String revision) {
return new DownloadProperties(GALAXY_DIST_REPOSITORY_URL, BRANCH_STABLE, revision, destination);
} | [
"@",
"Deprecated",
"public",
"static",
"DownloadProperties",
"forGalaxyDist",
"(",
"final",
"File",
"destination",
",",
"String",
"revision",
")",
"{",
"return",
"new",
"DownloadProperties",
"(",
"GALAXY_DIST_REPOSITORY_URL",
",",
"BRANCH_STABLE",
",",
"revision",
","... | Builds a new DownloadProperties for downloading Galaxy from galaxy-dist.
@param destination The destination directory to store Galaxy, null if a directory
should be chosen by default.
@param revision The revision to use for Galaxy.
@return A new DownloadProperties for downloading Galaxy from galaxy-dist. | [
"Builds",
"a",
"new",
"DownloadProperties",
"for",
"downloading",
"Galaxy",
"from",
"galaxy",
"-",
"dist",
"."
] | 4a899f5e6ec0c9f6f4b9b21d5a0320e5925ec649 | https://github.com/jmchilton/galaxy-bootstrap/blob/4a899f5e6ec0c9f6f4b9b21d5a0320e5925ec649/src/main/java/com/github/jmchilton/galaxybootstrap/DownloadProperties.java#L326-L329 |
145,447 | jmchilton/galaxy-bootstrap | src/main/java/com/github/jmchilton/galaxybootstrap/DownloadProperties.java | DownloadProperties.forGalaxyCentral | @Deprecated
public static DownloadProperties forGalaxyCentral(final File destination, String revision) {
return new DownloadProperties(GALAXY_CENTRAL_REPOSITORY_URL, BRANCH_DEFAULT, revision, destination);
} | java | @Deprecated
public static DownloadProperties forGalaxyCentral(final File destination, String revision) {
return new DownloadProperties(GALAXY_CENTRAL_REPOSITORY_URL, BRANCH_DEFAULT, revision, destination);
} | [
"@",
"Deprecated",
"public",
"static",
"DownloadProperties",
"forGalaxyCentral",
"(",
"final",
"File",
"destination",
",",
"String",
"revision",
")",
"{",
"return",
"new",
"DownloadProperties",
"(",
"GALAXY_CENTRAL_REPOSITORY_URL",
",",
"BRANCH_DEFAULT",
",",
"revision"... | Builds a new DownloadProperties for downloading Galaxy from galaxy-central.
@param destination The destination directory to store Galaxy, null if a directory
should be chosen by default.
@param revision The revision to use for Galaxy.
@return A new DownloadProperties for downloading Galaxy from galaxy-central. | [
"Builds",
"a",
"new",
"DownloadProperties",
"for",
"downloading",
"Galaxy",
"from",
"galaxy",
"-",
"central",
"."
] | 4a899f5e6ec0c9f6f4b9b21d5a0320e5925ec649 | https://github.com/jmchilton/galaxy-bootstrap/blob/4a899f5e6ec0c9f6f4b9b21d5a0320e5925ec649/src/main/java/com/github/jmchilton/galaxybootstrap/DownloadProperties.java#L349-L352 |
145,448 | jmchilton/galaxy-bootstrap | src/main/java/com/github/jmchilton/galaxybootstrap/DownloadProperties.java | DownloadProperties.forStableAtRevision | @Deprecated
public static DownloadProperties forStableAtRevision(final File destination, String revision) {
return new DownloadProperties(GALAXY_CENTRAL_REPOSITORY_URL, BRANCH_STABLE, revision, destination);
} | java | @Deprecated
public static DownloadProperties forStableAtRevision(final File destination, String revision) {
return new DownloadProperties(GALAXY_CENTRAL_REPOSITORY_URL, BRANCH_STABLE, revision, destination);
} | [
"@",
"Deprecated",
"public",
"static",
"DownloadProperties",
"forStableAtRevision",
"(",
"final",
"File",
"destination",
",",
"String",
"revision",
")",
"{",
"return",
"new",
"DownloadProperties",
"(",
"GALAXY_CENTRAL_REPOSITORY_URL",
",",
"BRANCH_STABLE",
",",
"revisio... | Builds a new DownloadProperties for downloading Galaxy at the given revision.
@param destination The destination directory to store Galaxy, null if a directory
should be chosen by default.
@return A new DownloadProperties for downloading Galaxy at the given revision. | [
"Builds",
"a",
"new",
"DownloadProperties",
"for",
"downloading",
"Galaxy",
"at",
"the",
"given",
"revision",
"."
] | 4a899f5e6ec0c9f6f4b9b21d5a0320e5925ec649 | https://github.com/jmchilton/galaxy-bootstrap/blob/4a899f5e6ec0c9f6f4b9b21d5a0320e5925ec649/src/main/java/com/github/jmchilton/galaxybootstrap/DownloadProperties.java#L371-L374 |
145,449 | jmchilton/galaxy-bootstrap | src/main/java/com/github/jmchilton/galaxybootstrap/DownloadProperties.java | DownloadProperties.forRelease | public static DownloadProperties forRelease(final String release, final File destination) {
return new DownloadProperties(new WgetGithubDownloader(release), destination);
} | java | public static DownloadProperties forRelease(final String release, final File destination) {
return new DownloadProperties(new WgetGithubDownloader(release), destination);
} | [
"public",
"static",
"DownloadProperties",
"forRelease",
"(",
"final",
"String",
"release",
",",
"final",
"File",
"destination",
")",
"{",
"return",
"new",
"DownloadProperties",
"(",
"new",
"WgetGithubDownloader",
"(",
"release",
")",
",",
"destination",
")",
";",
... | Builds a new DownloadProperties for downloading a specific Galaxy release.
@param release The release to pull from GitHub (eg. "v17.01")
@param destination The destination directory to store Galaxy, null if a directory
should be chosen by default.
@return A new DownloadProperties for downloading a specific Galaxy rele... | [
"Builds",
"a",
"new",
"DownloadProperties",
"for",
"downloading",
"a",
"specific",
"Galaxy",
"release",
"."
] | 4a899f5e6ec0c9f6f4b9b21d5a0320e5925ec649 | https://github.com/jmchilton/galaxy-bootstrap/blob/4a899f5e6ec0c9f6f4b9b21d5a0320e5925ec649/src/main/java/com/github/jmchilton/galaxybootstrap/DownloadProperties.java#L403-L405 |
145,450 | jmchilton/galaxy-bootstrap | src/main/java/com/github/jmchilton/galaxybootstrap/DownloadProperties.java | DownloadProperties.download | void download() {
final String path = location.getAbsolutePath();
logger.info("About to download Galaxy from " + downloader.toString()
+ " to " + path);
this.downloader.downloadTo(location, cache);
logger.info("Finished downloading Galaxy to " + path);
} | java | void download() {
final String path = location.getAbsolutePath();
logger.info("About to download Galaxy from " + downloader.toString()
+ " to " + path);
this.downloader.downloadTo(location, cache);
logger.info("Finished downloading Galaxy to " + path);
} | [
"void",
"download",
"(",
")",
"{",
"final",
"String",
"path",
"=",
"location",
".",
"getAbsolutePath",
"(",
")",
";",
"logger",
".",
"info",
"(",
"\"About to download Galaxy from \"",
"+",
"downloader",
".",
"toString",
"(",
")",
"+",
"\" to \"",
"+",
"path"... | Performs the download of Galaxy. | [
"Performs",
"the",
"download",
"of",
"Galaxy",
"."
] | 4a899f5e6ec0c9f6f4b9b21d5a0320e5925ec649 | https://github.com/jmchilton/galaxy-bootstrap/blob/4a899f5e6ec0c9f6f4b9b21d5a0320e5925ec649/src/main/java/com/github/jmchilton/galaxybootstrap/DownloadProperties.java#L410-L417 |
145,451 | geomajas/geomajas-project-hammer-gwt | hammer-gwt/src/main/java/org/geomajas/hammergwt/client/event/NativeHammerEvent.java | NativeHammerEvent.getRelativeX | public final int getRelativeX() {
NativeEvent e = getNativeEvent();
Element target = getTarget();
return e.getClientX() - target.getAbsoluteLeft() + target.getScrollLeft() +
target.getOwnerDocument().getScrollLeft();
} | java | public final int getRelativeX() {
NativeEvent e = getNativeEvent();
Element target = getTarget();
return e.getClientX() - target.getAbsoluteLeft() + target.getScrollLeft() +
target.getOwnerDocument().getScrollLeft();
} | [
"public",
"final",
"int",
"getRelativeX",
"(",
")",
"{",
"NativeEvent",
"e",
"=",
"getNativeEvent",
"(",
")",
";",
"Element",
"target",
"=",
"getTarget",
"(",
")",
";",
"return",
"e",
".",
"getClientX",
"(",
")",
"-",
"target",
".",
"getAbsoluteLeft",
"(... | Get relative x position on the page.
@return x position in pixels | [
"Get",
"relative",
"x",
"position",
"on",
"the",
"page",
"."
] | bc764171bed55e5a9eced72f0078ec22b8105b62 | https://github.com/geomajas/geomajas-project-hammer-gwt/blob/bc764171bed55e5a9eced72f0078ec22b8105b62/hammer-gwt/src/main/java/org/geomajas/hammergwt/client/event/NativeHammerEvent.java#L262-L268 |
145,452 | geomajas/geomajas-project-hammer-gwt | hammer-gwt/src/main/java/org/geomajas/hammergwt/client/event/NativeHammerEvent.java | NativeHammerEvent.getRelativeY | public final int getRelativeY() {
NativeEvent e = getNativeEvent();
Element target = getTarget();
return e.getClientY() - target.getAbsoluteTop() + target.getScrollTop() +
target.getOwnerDocument().getScrollTop();
} | java | public final int getRelativeY() {
NativeEvent e = getNativeEvent();
Element target = getTarget();
return e.getClientY() - target.getAbsoluteTop() + target.getScrollTop() +
target.getOwnerDocument().getScrollTop();
} | [
"public",
"final",
"int",
"getRelativeY",
"(",
")",
"{",
"NativeEvent",
"e",
"=",
"getNativeEvent",
"(",
")",
";",
"Element",
"target",
"=",
"getTarget",
"(",
")",
";",
"return",
"e",
".",
"getClientY",
"(",
")",
"-",
"target",
".",
"getAbsoluteTop",
"("... | Get relative y position on the page.
@return x position in pixels | [
"Get",
"relative",
"y",
"position",
"on",
"the",
"page",
"."
] | bc764171bed55e5a9eced72f0078ec22b8105b62 | https://github.com/geomajas/geomajas-project-hammer-gwt/blob/bc764171bed55e5a9eced72f0078ec22b8105b62/hammer-gwt/src/main/java/org/geomajas/hammergwt/client/event/NativeHammerEvent.java#L274-L280 |
145,453 | dbracewell/mango | src/main/java/com/davidbracewell/conversion/CollectionConverter.java | CollectionConverter.COLLECTION | public static Function<Object, Collection<?>> COLLECTION(final Class<? extends Collection> collectionType) {
return as(new CollectionConverterImpl<>(collectionType, null));
} | java | public static Function<Object, Collection<?>> COLLECTION(final Class<? extends Collection> collectionType) {
return as(new CollectionConverterImpl<>(collectionType, null));
} | [
"public",
"static",
"Function",
"<",
"Object",
",",
"Collection",
"<",
"?",
">",
">",
"COLLECTION",
"(",
"final",
"Class",
"<",
"?",
"extends",
"Collection",
">",
"collectionType",
")",
"{",
"return",
"as",
"(",
"new",
"CollectionConverterImpl",
"<>",
"(",
... | Converts an object to a collection
@param collectionType the collection type
@return the conversion function | [
"Converts",
"an",
"object",
"to",
"a",
"collection"
] | 2cec08826f1fccd658694dd03abce10fc97618ec | https://github.com/dbracewell/mango/blob/2cec08826f1fccd658694dd03abce10fc97618ec/src/main/java/com/davidbracewell/conversion/CollectionConverter.java#L87-L89 |
145,454 | dbracewell/mango | src/main/java/com/davidbracewell/conversion/CollectionConverter.java | CollectionConverter.COLLECTION | public static <T> Function<Object, Collection<T>> COLLECTION(final Class<? extends Collection> collectionType, final Class<T> componentType) {
return new CollectionConverterImpl<>(collectionType, componentType);
} | java | public static <T> Function<Object, Collection<T>> COLLECTION(final Class<? extends Collection> collectionType, final Class<T> componentType) {
return new CollectionConverterImpl<>(collectionType, componentType);
} | [
"public",
"static",
"<",
"T",
">",
"Function",
"<",
"Object",
",",
"Collection",
"<",
"T",
">",
">",
"COLLECTION",
"(",
"final",
"Class",
"<",
"?",
"extends",
"Collection",
">",
"collectionType",
",",
"final",
"Class",
"<",
"T",
">",
"componentType",
")"... | Converts an object to a collection and converts the components as well.
@param <T> the component type parameter
@param collectionType the collection type
@param componentType the component type
@return the conversion function | [
"Converts",
"an",
"object",
"to",
"a",
"collection",
"and",
"converts",
"the",
"components",
"as",
"well",
"."
] | 2cec08826f1fccd658694dd03abce10fc97618ec | https://github.com/dbracewell/mango/blob/2cec08826f1fccd658694dd03abce10fc97618ec/src/main/java/com/davidbracewell/conversion/CollectionConverter.java#L99-L101 |
145,455 | poolik/classfinder | src/main/java/com/poolik/classfinder/info/ClassInfo.java | ClassInfo.setClassFields | private void setClassFields(String name,
String superClassName,
String[] interfaces,
int asmAccessMask,
File location) {
this.className = translateInternalClassName(name);
this.locationFound =... | java | private void setClassFields(String name,
String superClassName,
String[] interfaces,
int asmAccessMask,
File location) {
this.className = translateInternalClassName(name);
this.locationFound =... | [
"private",
"void",
"setClassFields",
"(",
"String",
"name",
",",
"String",
"superClassName",
",",
"String",
"[",
"]",
"interfaces",
",",
"int",
"asmAccessMask",
",",
"File",
"location",
")",
"{",
"this",
".",
"className",
"=",
"translateInternalClassName",
"(",
... | Set the fields in this object.
@param name the class name
@param superClassName the parent class name, or null
@param interfaces the names of interfaces the class implements,
or null
@param asmAccessMask ASM API's access mask for the class
@param location File (jar, zip) or directory where class w... | [
"Set",
"the",
"fields",
"in",
"this",
"object",
"."
] | 0544f1c702f4fe6cb4a33db2a85c48b1d93f168f | https://github.com/poolik/classfinder/blob/0544f1c702f4fe6cb4a33db2a85c48b1d93f168f/src/main/java/com/poolik/classfinder/info/ClassInfo.java#L266-L288 |
145,456 | poolik/classfinder | src/main/java/com/poolik/classfinder/info/ClassInfo.java | ClassInfo.convertAccessMaskToModifierMask | private int convertAccessMaskToModifierMask(int asmAccessMask) {
int modifier = 0;
// Convert the ASM access info into Reflection API modifiers.
if ((asmAccessMask & Opcodes.ACC_FINAL) != 0)
modifier |= Modifier.FINAL;
if ((asmAccessMask & Opcodes.ACC_NATIVE) != 0)
modifier |= Modifier.NA... | java | private int convertAccessMaskToModifierMask(int asmAccessMask) {
int modifier = 0;
// Convert the ASM access info into Reflection API modifiers.
if ((asmAccessMask & Opcodes.ACC_FINAL) != 0)
modifier |= Modifier.FINAL;
if ((asmAccessMask & Opcodes.ACC_NATIVE) != 0)
modifier |= Modifier.NA... | [
"private",
"int",
"convertAccessMaskToModifierMask",
"(",
"int",
"asmAccessMask",
")",
"{",
"int",
"modifier",
"=",
"0",
";",
"// Convert the ASM access info into Reflection API modifiers.",
"if",
"(",
"(",
"asmAccessMask",
"&",
"Opcodes",
".",
"ACC_FINAL",
")",
"!=",
... | Convert an ASM access mask to a reflection Modifier mask.
@param asmAccessMask the ASM access mask
@return the Modifier mask | [
"Convert",
"an",
"ASM",
"access",
"mask",
"to",
"a",
"reflection",
"Modifier",
"mask",
"."
] | 0544f1c702f4fe6cb4a33db2a85c48b1d93f168f | https://github.com/poolik/classfinder/blob/0544f1c702f4fe6cb4a33db2a85c48b1d93f168f/src/main/java/com/poolik/classfinder/info/ClassInfo.java#L296-L338 |
145,457 | triceo/splitlog | splitlog-core/src/main/java/com/github/triceo/splitlog/expectations/AbstractExpectation.java | AbstractExpectation.call | @Override
public Message call() throws InterruptedException {
AbstractExpectation.LOGGER.info("Thread blocked waiting for message to pass condition {}.",
this.getBlockingCondition());
try {
this.latch.await();
this.manager.unsetExpectation(this);
A... | java | @Override
public Message call() throws InterruptedException {
AbstractExpectation.LOGGER.info("Thread blocked waiting for message to pass condition {}.",
this.getBlockingCondition());
try {
this.latch.await();
this.manager.unsetExpectation(this);
A... | [
"@",
"Override",
"public",
"Message",
"call",
"(",
")",
"throws",
"InterruptedException",
"{",
"AbstractExpectation",
".",
"LOGGER",
".",
"info",
"(",
"\"Thread blocked waiting for message to pass condition {}.\"",
",",
"this",
".",
"getBlockingCondition",
"(",
")",
")"... | Will start the wait for the condition to become true. | [
"Will",
"start",
"the",
"wait",
"for",
"the",
"condition",
"to",
"become",
"true",
"."
] | 4e1b188e8c814119f5cf7343bbc53917843d68a2 | https://github.com/triceo/splitlog/blob/4e1b188e8c814119f5cf7343bbc53917843d68a2/splitlog-core/src/main/java/com/github/triceo/splitlog/expectations/AbstractExpectation.java#L53-L71 |
145,458 | geomajas/geomajas-project-hammer-gwt | hammer-gwt-example/src/main/java/org/geomajas/hammergwt/example/server/RemoteSLF4j.java | RemoteSLF4j.logOnServer | public final String logOnServer(LogRecord lr) {
String strongName = getPermutationStrongName();
/*RemoteLoggingServiceUtil.logOnServer(
lr, strongName, deobfuscator, loggerNameOverride);*/
logger.error(lr.getMessage());
return null;
} | java | public final String logOnServer(LogRecord lr) {
String strongName = getPermutationStrongName();
/*RemoteLoggingServiceUtil.logOnServer(
lr, strongName, deobfuscator, loggerNameOverride);*/
logger.error(lr.getMessage());
return null;
} | [
"public",
"final",
"String",
"logOnServer",
"(",
"LogRecord",
"lr",
")",
"{",
"String",
"strongName",
"=",
"getPermutationStrongName",
"(",
")",
";",
"/*RemoteLoggingServiceUtil.logOnServer(\n\t\t\t\tlr, strongName, deobfuscator, loggerNameOverride);*/",
"logger",
".",
"error",... | Logs a Log Record which has been serialized using GWT RPC on the server.
@return either an error message, or null if logging is successful. | [
"Logs",
"a",
"Log",
"Record",
"which",
"has",
"been",
"serialized",
"using",
"GWT",
"RPC",
"on",
"the",
"server",
"."
] | bc764171bed55e5a9eced72f0078ec22b8105b62 | https://github.com/geomajas/geomajas-project-hammer-gwt/blob/bc764171bed55e5a9eced72f0078ec22b8105b62/hammer-gwt-example/src/main/java/org/geomajas/hammergwt/example/server/RemoteSLF4j.java#L41-L49 |
145,459 | geomajas/geomajas-project-hammer-gwt | hammer-gwt-example/src/main/java/org/geomajas/hammergwt/example/server/RemoteSLF4j.java | RemoteSLF4j.setSymbolMapsDirectory | public void setSymbolMapsDirectory(String symbolMapsDir) {
if (deobfuscator == null) {
deobfuscator = new StackTraceDeobfuscator(symbolMapsDir);
} else {
deobfuscator.setSymbolMapsDirectory(symbolMapsDir);
}
} | java | public void setSymbolMapsDirectory(String symbolMapsDir) {
if (deobfuscator == null) {
deobfuscator = new StackTraceDeobfuscator(symbolMapsDir);
} else {
deobfuscator.setSymbolMapsDirectory(symbolMapsDir);
}
} | [
"public",
"void",
"setSymbolMapsDirectory",
"(",
"String",
"symbolMapsDir",
")",
"{",
"if",
"(",
"deobfuscator",
"==",
"null",
")",
"{",
"deobfuscator",
"=",
"new",
"StackTraceDeobfuscator",
"(",
"symbolMapsDir",
")",
";",
"}",
"else",
"{",
"deobfuscator",
".",
... | By default, this service does not do any deobfuscation. In order to do
server side deobfuscation, you must copy the symbolMaps files to a
directory visible to the server and set the directory using this method.
@param symbolMapsDir | [
"By",
"default",
"this",
"service",
"does",
"not",
"do",
"any",
"deobfuscation",
".",
"In",
"order",
"to",
"do",
"server",
"side",
"deobfuscation",
"you",
"must",
"copy",
"the",
"symbolMaps",
"files",
"to",
"a",
"directory",
"visible",
"to",
"the",
"server",... | bc764171bed55e5a9eced72f0078ec22b8105b62 | https://github.com/geomajas/geomajas-project-hammer-gwt/blob/bc764171bed55e5a9eced72f0078ec22b8105b62/hammer-gwt-example/src/main/java/org/geomajas/hammergwt/example/server/RemoteSLF4j.java#L67-L73 |
145,460 | josueeduardo/snappy | snappy/src/main/java/io/joshworks/snappy/handler/HandlerUtil.java | HandlerUtil.removePathTemplate | public static String[] removePathTemplate(List<MappedEndpoint> mappedEndpoints) {
return mappedEndpoints.stream()
.filter(me -> !me.type.equals(MappedEndpoint.Type.STATIC))
.map(me -> {
int idx = me.url.indexOf("/{");
return idx >= 0 ? me.... | java | public static String[] removePathTemplate(List<MappedEndpoint> mappedEndpoints) {
return mappedEndpoints.stream()
.filter(me -> !me.type.equals(MappedEndpoint.Type.STATIC))
.map(me -> {
int idx = me.url.indexOf("/{");
return idx >= 0 ? me.... | [
"public",
"static",
"String",
"[",
"]",
"removePathTemplate",
"(",
"List",
"<",
"MappedEndpoint",
">",
"mappedEndpoints",
")",
"{",
"return",
"mappedEndpoints",
".",
"stream",
"(",
")",
".",
"filter",
"(",
"me",
"->",
"!",
"me",
".",
"type",
".",
"equals",... | best effort to resolve url that may be unique | [
"best",
"effort",
"to",
"resolve",
"url",
"that",
"may",
"be",
"unique"
] | d95a9e811eda3c24a5e53086369208819884fa49 | https://github.com/josueeduardo/snappy/blob/d95a9e811eda3c24a5e53086369208819884fa49/snappy/src/main/java/io/joshworks/snappy/handler/HandlerUtil.java#L233-L242 |
145,461 | gsi-upm/Shanks | shanks-core/src/main/java/es/upm/dit/gsi/shanks/agent/capability/movement/ShanksAgentMovementCapability.java | ShanksAgentMovementCapability.normalizeDouble3D | private static Double3D normalizeDouble3D(Double3D vector) {
double invertedlen = 1.0D / Math.sqrt(vector.x * vector.x + vector.y
* vector.y + vector.z * vector.z);
if ((invertedlen == (1.0D / 0.0D)) || (invertedlen == (-1.0D / 0.0D))
|| (invertedlen == 0.0D) || (inve... | java | private static Double3D normalizeDouble3D(Double3D vector) {
double invertedlen = 1.0D / Math.sqrt(vector.x * vector.x + vector.y
* vector.y + vector.z * vector.z);
if ((invertedlen == (1.0D / 0.0D)) || (invertedlen == (-1.0D / 0.0D))
|| (invertedlen == 0.0D) || (inve... | [
"private",
"static",
"Double3D",
"normalizeDouble3D",
"(",
"Double3D",
"vector",
")",
"{",
"double",
"invertedlen",
"=",
"1.0D",
"/",
"Math",
".",
"sqrt",
"(",
"vector",
".",
"x",
"*",
"vector",
".",
"x",
"+",
"vector",
".",
"y",
"*",
"vector",
".",
"y... | Normalize a Double3D object
@param vector
@return the normalized vector | [
"Normalize",
"a",
"Double3D",
"object"
] | 35d87a81c22731f4f83bbd0571c9c6d466bd16be | https://github.com/gsi-upm/Shanks/blob/35d87a81c22731f4f83bbd0571c9c6d466bd16be/shanks-core/src/main/java/es/upm/dit/gsi/shanks/agent/capability/movement/ShanksAgentMovementCapability.java#L194-L204 |
145,462 | jmchilton/galaxy-bootstrap | src/main/java/com/github/jmchilton/galaxybootstrap/IoUtils.java | IoUtils.findFreePort | public static int findFreePort() {
ServerSocket socket = null;
try {
socket = new ServerSocket(0);
socket.setReuseAddress(true);
int port = socket.getLocalPort();
try {
socket.close();
} catch(IOException e) {
// Ignore IOException on close()
}
return po... | java | public static int findFreePort() {
ServerSocket socket = null;
try {
socket = new ServerSocket(0);
socket.setReuseAddress(true);
int port = socket.getLocalPort();
try {
socket.close();
} catch(IOException e) {
// Ignore IOException on close()
}
return po... | [
"public",
"static",
"int",
"findFreePort",
"(",
")",
"{",
"ServerSocket",
"socket",
"=",
"null",
";",
"try",
"{",
"socket",
"=",
"new",
"ServerSocket",
"(",
"0",
")",
";",
"socket",
".",
"setReuseAddress",
"(",
"true",
")",
";",
"int",
"port",
"=",
"so... | Returns a free port number on localhost.
Heavily inspired from org.eclipse.jdt.launching.SocketUtil (to avoid a dependency to JDT just because of this).
Slightly improved with close() missing in JDT. And throws exception instead of returning -1.
https://gist.github.com/vorburger/3429822
@return a free port number on... | [
"Returns",
"a",
"free",
"port",
"number",
"on",
"localhost",
"."
] | 4a899f5e6ec0c9f6f4b9b21d5a0320e5925ec649 | https://github.com/jmchilton/galaxy-bootstrap/blob/4a899f5e6ec0c9f6f4b9b21d5a0320e5925ec649/src/main/java/com/github/jmchilton/galaxybootstrap/IoUtils.java#L28-L50 |
145,463 | fuinorg/utils4j | src/main/java/org/fuin/utils4j/JandexUtils.java | JandexUtils.indexClassFile | public static boolean indexClassFile(final Indexer indexer, final List<File> knownFiles, final File classFile) {
if (knownFiles.contains(classFile)) {
return false;
}
knownFiles.add(classFile);
try (final InputStream in = classFile.toURI().toURL().openStream()) {
... | java | public static boolean indexClassFile(final Indexer indexer, final List<File> knownFiles, final File classFile) {
if (knownFiles.contains(classFile)) {
return false;
}
knownFiles.add(classFile);
try (final InputStream in = classFile.toURI().toURL().openStream()) {
... | [
"public",
"static",
"boolean",
"indexClassFile",
"(",
"final",
"Indexer",
"indexer",
",",
"final",
"List",
"<",
"File",
">",
"knownFiles",
",",
"final",
"File",
"classFile",
")",
"{",
"if",
"(",
"knownFiles",
".",
"contains",
"(",
"classFile",
")",
")",
"{... | Indexes a single file, except it was already analyzed.
@param indexer
Indexer to use.
@param knownFiles
List of files already analyzed. New files will be added within this method.
@param classFile
Class file to analyze.
@return TRUE if the file was indexed or FALSE if it was ignored. | [
"Indexes",
"a",
"single",
"file",
"except",
"it",
"was",
"already",
"analyzed",
"."
] | 71cf88e0a8d8ed67bbac513bf3cab165cd7e3280 | https://github.com/fuinorg/utils4j/blob/71cf88e0a8d8ed67bbac513bf3cab165cd7e3280/src/main/java/org/fuin/utils4j/JandexUtils.java#L55-L69 |
145,464 | fuinorg/utils4j | src/main/java/org/fuin/utils4j/JandexUtils.java | JandexUtils.indexDir | public static void indexDir(final Indexer indexer, final List<File> knownFiles, final File dir) {
final List<File> classes = Utils4J.pathsFiles(dir.getPath(), Utils4J::classFile);
for (final File file : classes) {
indexClassFile(indexer, knownFiles, file);
}
} | java | public static void indexDir(final Indexer indexer, final List<File> knownFiles, final File dir) {
final List<File> classes = Utils4J.pathsFiles(dir.getPath(), Utils4J::classFile);
for (final File file : classes) {
indexClassFile(indexer, knownFiles, file);
}
} | [
"public",
"static",
"void",
"indexDir",
"(",
"final",
"Indexer",
"indexer",
",",
"final",
"List",
"<",
"File",
">",
"knownFiles",
",",
"final",
"File",
"dir",
")",
"{",
"final",
"List",
"<",
"File",
">",
"classes",
"=",
"Utils4J",
".",
"pathsFiles",
"(",... | Indexes all classes in a directory or it's sub directories.
@param indexer
Indexer to use.
@param knownFiles
List of files already analyzed. New files will be added within this method.
@param dir
Directory to analyze. | [
"Indexes",
"all",
"classes",
"in",
"a",
"directory",
"or",
"it",
"s",
"sub",
"directories",
"."
] | 71cf88e0a8d8ed67bbac513bf3cab165cd7e3280 | https://github.com/fuinorg/utils4j/blob/71cf88e0a8d8ed67bbac513bf3cab165cd7e3280/src/main/java/org/fuin/utils4j/JandexUtils.java#L81-L86 |
145,465 | fuinorg/utils4j | src/main/java/org/fuin/utils4j/JandexUtils.java | JandexUtils.indexJar | public static boolean indexJar(final Indexer indexer, final List<File> knownFiles, final File jarFile) {
if (knownFiles.contains(jarFile)) {
return false;
}
knownFiles.add(jarFile);
try (final JarFile jar = new JarFile(jarFile)) {
final Enumeration<JarEntry> ent... | java | public static boolean indexJar(final Indexer indexer, final List<File> knownFiles, final File jarFile) {
if (knownFiles.contains(jarFile)) {
return false;
}
knownFiles.add(jarFile);
try (final JarFile jar = new JarFile(jarFile)) {
final Enumeration<JarEntry> ent... | [
"public",
"static",
"boolean",
"indexJar",
"(",
"final",
"Indexer",
"indexer",
",",
"final",
"List",
"<",
"File",
">",
"knownFiles",
",",
"final",
"File",
"jarFile",
")",
"{",
"if",
"(",
"knownFiles",
".",
"contains",
"(",
"jarFile",
")",
")",
"{",
"retu... | Indexes a single JAR, except it was already analyzed.
@param indexer
Indexer to use.
@param knownFiles
List of files already analyzed. New files will be added within this method.
@param jarFile
JAR to analyze.
@return TRUE if the JAR was indexed or FALSE if it was ignored. | [
"Indexes",
"a",
"single",
"JAR",
"except",
"it",
"was",
"already",
"analyzed",
"."
] | 71cf88e0a8d8ed67bbac513bf3cab165cd7e3280 | https://github.com/fuinorg/utils4j/blob/71cf88e0a8d8ed67bbac513bf3cab165cd7e3280/src/main/java/org/fuin/utils4j/JandexUtils.java#L100-L125 |
145,466 | Mthwate/DatLib | src/main/java/com/mthwate/datlib/ImageUtils.java | ImageUtils.totalImageDiff | public static long totalImageDiff(BufferedImage img1, BufferedImage img2) {
int width = img1.getWidth();
int height = img1.getHeight();
if ((width != img2.getWidth()) || (height != img2.getHeight())) {
throw new IllegalArgumentException("Image dimensions do not match");
}
long diff = 0;
for (int x = 0... | java | public static long totalImageDiff(BufferedImage img1, BufferedImage img2) {
int width = img1.getWidth();
int height = img1.getHeight();
if ((width != img2.getWidth()) || (height != img2.getHeight())) {
throw new IllegalArgumentException("Image dimensions do not match");
}
long diff = 0;
for (int x = 0... | [
"public",
"static",
"long",
"totalImageDiff",
"(",
"BufferedImage",
"img1",
",",
"BufferedImage",
"img2",
")",
"{",
"int",
"width",
"=",
"img1",
".",
"getWidth",
"(",
")",
";",
"int",
"height",
"=",
"img1",
".",
"getHeight",
"(",
")",
";",
"if",
"(",
"... | The total difference between two images calculated as the sum of the difference in RGB values of each pixel
the images MUST be the same dimensions.
@since 1.2
@param img1 the first image to be compared
@param img2 the second image to be compared
@return the difference between the two images | [
"The",
"total",
"difference",
"between",
"two",
"images",
"calculated",
"as",
"the",
"sum",
"of",
"the",
"difference",
"in",
"RGB",
"values",
"of",
"each",
"pixel",
"the",
"images",
"MUST",
"be",
"the",
"same",
"dimensions",
"."
] | f0b3a9f9cf6fdc773d4f86234ebd95986c9b6077 | https://github.com/Mthwate/DatLib/blob/f0b3a9f9cf6fdc773d4f86234ebd95986c9b6077/src/main/java/com/mthwate/datlib/ImageUtils.java#L21-L51 |
145,467 | devcon5io/common | classutils/src/main/java/io/devcon5/classutils/TypeConverter.java | TypeConverter.to | public <T> T to(Class<T> targetType) {
if (targetType == String.class) {
return (T) value;
}
try {
final String methodName;
final Class type;
if (targetType.isPrimitive()) {
final String typeName = targetType.getSimpleName();
... | java | public <T> T to(Class<T> targetType) {
if (targetType == String.class) {
return (T) value;
}
try {
final String methodName;
final Class type;
if (targetType.isPrimitive()) {
final String typeName = targetType.getSimpleName();
... | [
"public",
"<",
"T",
">",
"T",
"to",
"(",
"Class",
"<",
"T",
">",
"targetType",
")",
"{",
"if",
"(",
"targetType",
"==",
"String",
".",
"class",
")",
"{",
"return",
"(",
"T",
")",
"value",
";",
"}",
"try",
"{",
"final",
"String",
"methodName",
";"... | Converts the underlying string value to a primitive value.
@param targetType
the type into which the string value should be converted.
@param <T>
the type of the target type
@return the converted value. | [
"Converts",
"the",
"underlying",
"string",
"value",
"to",
"a",
"primitive",
"value",
"."
] | 363688e0dc904d559682bf796bd6c836b4e0efc7 | https://github.com/devcon5io/common/blob/363688e0dc904d559682bf796bd6c836b4e0efc7/classutils/src/main/java/io/devcon5/classutils/TypeConverter.java#L75-L94 |
145,468 | gsi-upm/Shanks | shanks-core/src/main/java/es/upm/dit/gsi/shanks/agent/capability/creation/CreationShanksAgentCapability.java | CreationShanksAgentCapability.addNewAgent | public static void addNewAgent(ShanksSimulation sim, ShanksAgent agent)
throws ShanksException {
sim.registerShanksAgent(agent);
if (sim.schedule.getTime() < 0) {
sim.schedule.scheduleRepeating(Schedule.EPOCH, 2, agent, 1);
} else {
sim.schedule.scheduleRepeat... | java | public static void addNewAgent(ShanksSimulation sim, ShanksAgent agent)
throws ShanksException {
sim.registerShanksAgent(agent);
if (sim.schedule.getTime() < 0) {
sim.schedule.scheduleRepeating(Schedule.EPOCH, 2, agent, 1);
} else {
sim.schedule.scheduleRepeat... | [
"public",
"static",
"void",
"addNewAgent",
"(",
"ShanksSimulation",
"sim",
",",
"ShanksAgent",
"agent",
")",
"throws",
"ShanksException",
"{",
"sim",
".",
"registerShanksAgent",
"(",
"agent",
")",
";",
"if",
"(",
"sim",
".",
"schedule",
".",
"getTime",
"(",
... | Adds an agent to the simulation
@param sim
- The shanks simulation
@param agent
- The new agent
@throws DuplicatedAgentIDException | [
"Adds",
"an",
"agent",
"to",
"the",
"simulation"
] | 35d87a81c22731f4f83bbd0571c9c6d466bd16be | https://github.com/gsi-upm/Shanks/blob/35d87a81c22731f4f83bbd0571c9c6d466bd16be/shanks-core/src/main/java/es/upm/dit/gsi/shanks/agent/capability/creation/CreationShanksAgentCapability.java#L48-L58 |
145,469 | gsi-upm/Shanks | shanks-core/src/main/java/es/upm/dit/gsi/shanks/agent/capability/creation/CreationShanksAgentCapability.java | CreationShanksAgentCapability.removeAgent | public static void removeAgent(ShanksSimulation sim, String agentID)
throws ShanksException {
sim.logger.info("Stoppable not fount. Attempting direct stop...");
sim.unregisterShanksAgent(agentID);
sim.logger.info("Agent " + agentID + " stopped.");
} | java | public static void removeAgent(ShanksSimulation sim, String agentID)
throws ShanksException {
sim.logger.info("Stoppable not fount. Attempting direct stop...");
sim.unregisterShanksAgent(agentID);
sim.logger.info("Agent " + agentID + " stopped.");
} | [
"public",
"static",
"void",
"removeAgent",
"(",
"ShanksSimulation",
"sim",
",",
"String",
"agentID",
")",
"throws",
"ShanksException",
"{",
"sim",
".",
"logger",
".",
"info",
"(",
"\"Stoppable not fount. Attempting direct stop...\"",
")",
";",
"sim",
".",
"unregiste... | "Removes" an agent with the given name from the simulation
Be careful: what this actually do is to stop the agent execution.
@param sim
-The Shanks Simulation
@param agentID
- The name of the agent to remove
@throws ShanksException
An UnkownAgentException if the Agent ID is not found on the
simulation. | [
"Removes",
"an",
"agent",
"with",
"the",
"given",
"name",
"from",
"the",
"simulation"
] | 35d87a81c22731f4f83bbd0571c9c6d466bd16be | https://github.com/gsi-upm/Shanks/blob/35d87a81c22731f4f83bbd0571c9c6d466bd16be/shanks-core/src/main/java/es/upm/dit/gsi/shanks/agent/capability/creation/CreationShanksAgentCapability.java#L73-L78 |
145,470 | theisenp/harbor | src/main/java/com/theisenp/harbor/lcm/Subscriber.java | Subscriber.clear | public synchronized void clear() {
peers.clear();
for(Future<?> timeout : timeouts.values()) {
timeout.cancel(true);
}
timeouts.clear();
} | java | public synchronized void clear() {
peers.clear();
for(Future<?> timeout : timeouts.values()) {
timeout.cancel(true);
}
timeouts.clear();
} | [
"public",
"synchronized",
"void",
"clear",
"(",
")",
"{",
"peers",
".",
"clear",
"(",
")",
";",
"for",
"(",
"Future",
"<",
"?",
">",
"timeout",
":",
"timeouts",
".",
"values",
"(",
")",
")",
"{",
"timeout",
".",
"cancel",
"(",
"true",
")",
";",
"... | Clear all known peers | [
"Clear",
"all",
"known",
"peers"
] | 59a6d373a709e10ddf0945475b95394f3f7a8254 | https://github.com/theisenp/harbor/blob/59a6d373a709e10ddf0945475b95394f3f7a8254/src/main/java/com/theisenp/harbor/lcm/Subscriber.java#L74-L80 |
145,471 | theisenp/harbor | src/main/java/com/theisenp/harbor/lcm/Subscriber.java | Subscriber.notifyConnected | private void notifyConnected(Peer peer) {
for(Listener listener : new HashSet<>(listeners)) {
listener.onConnected(peer);
}
} | java | private void notifyConnected(Peer peer) {
for(Listener listener : new HashSet<>(listeners)) {
listener.onConnected(peer);
}
} | [
"private",
"void",
"notifyConnected",
"(",
"Peer",
"peer",
")",
"{",
"for",
"(",
"Listener",
"listener",
":",
"new",
"HashSet",
"<>",
"(",
"listeners",
")",
")",
"{",
"listener",
".",
"onConnected",
"(",
"peer",
")",
";",
"}",
"}"
] | Notifies all registered listeners of the connected peer | [
"Notifies",
"all",
"registered",
"listeners",
"of",
"the",
"connected",
"peer"
] | 59a6d373a709e10ddf0945475b95394f3f7a8254 | https://github.com/theisenp/harbor/blob/59a6d373a709e10ddf0945475b95394f3f7a8254/src/main/java/com/theisenp/harbor/lcm/Subscriber.java#L146-L150 |
145,472 | theisenp/harbor | src/main/java/com/theisenp/harbor/lcm/Subscriber.java | Subscriber.notifyActive | private void notifyActive(Peer peer) {
for(Listener listener : new HashSet<>(listeners)) {
listener.onActive(peer);
}
} | java | private void notifyActive(Peer peer) {
for(Listener listener : new HashSet<>(listeners)) {
listener.onActive(peer);
}
} | [
"private",
"void",
"notifyActive",
"(",
"Peer",
"peer",
")",
"{",
"for",
"(",
"Listener",
"listener",
":",
"new",
"HashSet",
"<>",
"(",
"listeners",
")",
")",
"{",
"listener",
".",
"onActive",
"(",
"peer",
")",
";",
"}",
"}"
] | Notifies all registered listeners of the active peer | [
"Notifies",
"all",
"registered",
"listeners",
"of",
"the",
"active",
"peer"
] | 59a6d373a709e10ddf0945475b95394f3f7a8254 | https://github.com/theisenp/harbor/blob/59a6d373a709e10ddf0945475b95394f3f7a8254/src/main/java/com/theisenp/harbor/lcm/Subscriber.java#L155-L159 |
145,473 | theisenp/harbor | src/main/java/com/theisenp/harbor/lcm/Subscriber.java | Subscriber.notifyInactive | private void notifyInactive(Peer peer) {
for(Listener listener : new HashSet<>(listeners)) {
listener.onInactive(peer);
}
} | java | private void notifyInactive(Peer peer) {
for(Listener listener : new HashSet<>(listeners)) {
listener.onInactive(peer);
}
} | [
"private",
"void",
"notifyInactive",
"(",
"Peer",
"peer",
")",
"{",
"for",
"(",
"Listener",
"listener",
":",
"new",
"HashSet",
"<>",
"(",
"listeners",
")",
")",
"{",
"listener",
".",
"onInactive",
"(",
"peer",
")",
";",
"}",
"}"
] | Notifies all registered listeners of the inactive peer | [
"Notifies",
"all",
"registered",
"listeners",
"of",
"the",
"inactive",
"peer"
] | 59a6d373a709e10ddf0945475b95394f3f7a8254 | https://github.com/theisenp/harbor/blob/59a6d373a709e10ddf0945475b95394f3f7a8254/src/main/java/com/theisenp/harbor/lcm/Subscriber.java#L164-L168 |
145,474 | theisenp/harbor | src/main/java/com/theisenp/harbor/lcm/Subscriber.java | Subscriber.notifyDisconnected | private void notifyDisconnected(Peer peer) {
for(Listener listener : new HashSet<>(listeners)) {
listener.onDisconnected(peer);
}
} | java | private void notifyDisconnected(Peer peer) {
for(Listener listener : new HashSet<>(listeners)) {
listener.onDisconnected(peer);
}
} | [
"private",
"void",
"notifyDisconnected",
"(",
"Peer",
"peer",
")",
"{",
"for",
"(",
"Listener",
"listener",
":",
"new",
"HashSet",
"<>",
"(",
"listeners",
")",
")",
"{",
"listener",
".",
"onDisconnected",
"(",
"peer",
")",
";",
"}",
"}"
] | Notifies all registered listeners of the disconnected peer | [
"Notifies",
"all",
"registered",
"listeners",
"of",
"the",
"disconnected",
"peer"
] | 59a6d373a709e10ddf0945475b95394f3f7a8254 | https://github.com/theisenp/harbor/blob/59a6d373a709e10ddf0945475b95394f3f7a8254/src/main/java/com/theisenp/harbor/lcm/Subscriber.java#L173-L177 |
145,475 | fuinorg/utils4j | src/main/java/org/fuin/utils4j/filter/TokenFilter.java | TokenFilter.complies | protected final boolean complies(final String value, final String constValue, final String separators) {
if (value == null) {
return false;
} else {
final StringTokenizer tok = new StringTokenizer(value, separators);
while (tok.hasMoreTokens()) {
... | java | protected final boolean complies(final String value, final String constValue, final String separators) {
if (value == null) {
return false;
} else {
final StringTokenizer tok = new StringTokenizer(value, separators);
while (tok.hasMoreTokens()) {
... | [
"protected",
"final",
"boolean",
"complies",
"(",
"final",
"String",
"value",
",",
"final",
"String",
"constValue",
",",
"final",
"String",
"separators",
")",
"{",
"if",
"(",
"value",
"==",
"null",
")",
"{",
"return",
"false",
";",
"}",
"else",
"{",
"fin... | Helper method for subclasses to do the comparation.
@param value
Object that contains the property.
@param constValue
Value to compare with.
@param separators
Separators
@return If object property contains the value as one of the tokens TRUE else FALSE. | [
"Helper",
"method",
"for",
"subclasses",
"to",
"do",
"the",
"comparation",
"."
] | 71cf88e0a8d8ed67bbac513bf3cab165cd7e3280 | https://github.com/fuinorg/utils4j/blob/71cf88e0a8d8ed67bbac513bf3cab165cd7e3280/src/main/java/org/fuin/utils4j/filter/TokenFilter.java#L80-L94 |
145,476 | fuinorg/srcgen4javassist | src/main/java/org/fuin/srcgen4javassist/SgBehavior.java | SgBehavior.getLastArgument | public final SgArgument getLastArgument() {
final int size = arguments.size();
if (size == 0) {
return null;
}
return arguments.get(size - 1);
} | java | public final SgArgument getLastArgument() {
final int size = arguments.size();
if (size == 0) {
return null;
}
return arguments.get(size - 1);
} | [
"public",
"final",
"SgArgument",
"getLastArgument",
"(",
")",
"{",
"final",
"int",
"size",
"=",
"arguments",
".",
"size",
"(",
")",
";",
"if",
"(",
"size",
"==",
"0",
")",
"{",
"return",
"null",
";",
"}",
"return",
"arguments",
".",
"get",
"(",
"size... | Returns the last argument of the list.
@return Last argument or null if the list is empty. | [
"Returns",
"the",
"last",
"argument",
"of",
"the",
"list",
"."
] | 355828113cfce3cdd3d69ba242c5bdfc7d899f2f | https://github.com/fuinorg/srcgen4javassist/blob/355828113cfce3cdd3d69ba242c5bdfc7d899f2f/src/main/java/org/fuin/srcgen4javassist/SgBehavior.java#L158-L164 |
145,477 | fuinorg/srcgen4javassist | src/main/java/org/fuin/srcgen4javassist/SgBehavior.java | SgBehavior.addArgument | public final void addArgument(final SgArgument arg) {
if (arg == null) {
throw new IllegalArgumentException("The argument 'arg' cannot be null!");
}
if (arg.getOwner() != this) {
throw new IllegalArgumentException("The owner of 'arg' is different from 'this'!");
... | java | public final void addArgument(final SgArgument arg) {
if (arg == null) {
throw new IllegalArgumentException("The argument 'arg' cannot be null!");
}
if (arg.getOwner() != this) {
throw new IllegalArgumentException("The owner of 'arg' is different from 'this'!");
... | [
"public",
"final",
"void",
"addArgument",
"(",
"final",
"SgArgument",
"arg",
")",
"{",
"if",
"(",
"arg",
"==",
"null",
")",
"{",
"throw",
"new",
"IllegalArgumentException",
"(",
"\"The argument 'arg' cannot be null!\"",
")",
";",
"}",
"if",
"(",
"arg",
".",
... | Adds an argument to the list. Does nothing if the argument is already in
the list of arguments. You will never need to use this method in your
code! An argument is added automatically to the owning behavior when it's
constructed!
@param arg
Argument to add - Non null. | [
"Adds",
"an",
"argument",
"to",
"the",
"list",
".",
"Does",
"nothing",
"if",
"the",
"argument",
"is",
"already",
"in",
"the",
"list",
"of",
"arguments",
".",
"You",
"will",
"never",
"need",
"to",
"use",
"this",
"method",
"in",
"your",
"code!",
"An",
"a... | 355828113cfce3cdd3d69ba242c5bdfc7d899f2f | https://github.com/fuinorg/srcgen4javassist/blob/355828113cfce3cdd3d69ba242c5bdfc7d899f2f/src/main/java/org/fuin/srcgen4javassist/SgBehavior.java#L175-L185 |
145,478 | fuinorg/srcgen4javassist | src/main/java/org/fuin/srcgen4javassist/SgBehavior.java | SgBehavior.addException | public final void addException(final SgClass clasz) {
if (clasz == null) {
throw new IllegalArgumentException("The argument 'clasz' cannot be null!");
}
// TODO Check if any superclass is of type Exception.
if (!exceptions.contains(clasz)) {
exceptions.add(c... | java | public final void addException(final SgClass clasz) {
if (clasz == null) {
throw new IllegalArgumentException("The argument 'clasz' cannot be null!");
}
// TODO Check if any superclass is of type Exception.
if (!exceptions.contains(clasz)) {
exceptions.add(c... | [
"public",
"final",
"void",
"addException",
"(",
"final",
"SgClass",
"clasz",
")",
"{",
"if",
"(",
"clasz",
"==",
"null",
")",
"{",
"throw",
"new",
"IllegalArgumentException",
"(",
"\"The argument 'clasz' cannot be null!\"",
")",
";",
"}",
"// TODO Check if any super... | Adds an exception to the list. Does nothing if the class is already in
the list of exceptions.
@param clasz
Exception to add. | [
"Adds",
"an",
"exception",
"to",
"the",
"list",
".",
"Does",
"nothing",
"if",
"the",
"class",
"is",
"already",
"in",
"the",
"list",
"of",
"exceptions",
"."
] | 355828113cfce3cdd3d69ba242c5bdfc7d899f2f | https://github.com/fuinorg/srcgen4javassist/blob/355828113cfce3cdd3d69ba242c5bdfc7d899f2f/src/main/java/org/fuin/srcgen4javassist/SgBehavior.java#L203-L211 |
145,479 | dbracewell/mango | src/main/java/com/davidbracewell/concurrent/Broker.java | Broker.run | public boolean run() {
ExecutorService executors = Executors.newFixedThreadPool(producers.size() + consumers.size());
runningProducers.set(producers.size());
//create the producers
for (Producer<V> producer : producers) {
producer.setOwner(this);
executors.submit(new ProducerT... | java | public boolean run() {
ExecutorService executors = Executors.newFixedThreadPool(producers.size() + consumers.size());
runningProducers.set(producers.size());
//create the producers
for (Producer<V> producer : producers) {
producer.setOwner(this);
executors.submit(new ProducerT... | [
"public",
"boolean",
"run",
"(",
")",
"{",
"ExecutorService",
"executors",
"=",
"Executors",
".",
"newFixedThreadPool",
"(",
"producers",
".",
"size",
"(",
")",
"+",
"consumers",
".",
"size",
"(",
")",
")",
";",
"runningProducers",
".",
"set",
"(",
"produc... | Starts execution of the broker.
@return Returns true if the broker completed without interruption, false otherwise | [
"Starts",
"execution",
"of",
"the",
"broker",
"."
] | 2cec08826f1fccd658694dd03abce10fc97618ec | https://github.com/dbracewell/mango/blob/2cec08826f1fccd658694dd03abce10fc97618ec/src/main/java/com/davidbracewell/concurrent/Broker.java#L71-L99 |
145,480 | pressgang-ccms/PressGangCCMSCommonUtilities | src/main/java/org/jboss/pressgang/ccms/utils/concurrency/BaseWorkQueue.java | BaseWorkQueue.execute | public void execute(final T runnable) {
synchronized (queue) {
if (runnable != null && !disabled) {
queue.addLast(runnable);
queue.notify();
System.out.println("WorkQueue has added runable - WorkQueue size is " + queue.size());
}
}
... | java | public void execute(final T runnable) {
synchronized (queue) {
if (runnable != null && !disabled) {
queue.addLast(runnable);
queue.notify();
System.out.println("WorkQueue has added runable - WorkQueue size is " + queue.size());
}
}
... | [
"public",
"void",
"execute",
"(",
"final",
"T",
"runnable",
")",
"{",
"synchronized",
"(",
"queue",
")",
"{",
"if",
"(",
"runnable",
"!=",
"null",
"&&",
"!",
"disabled",
")",
"{",
"queue",
".",
"addLast",
"(",
"runnable",
")",
";",
"queue",
".",
"not... | Add a Runnable object to the pool to be executed once a thread is available | [
"Add",
"a",
"Runnable",
"object",
"to",
"the",
"pool",
"to",
"be",
"executed",
"once",
"a",
"thread",
"is",
"available"
] | 5ebf5ed30a94c34c33f4708caa04a8da99cbb15c | https://github.com/pressgang-ccms/PressGangCCMSCommonUtilities/blob/5ebf5ed30a94c34c33f4708caa04a8da99cbb15c/src/main/java/org/jboss/pressgang/ccms/utils/concurrency/BaseWorkQueue.java#L116-L124 |
145,481 | pressgang-ccms/PressGangCCMSCommonUtilities | src/main/java/org/jboss/pressgang/ccms/utils/concurrency/BaseWorkQueue.java | BaseWorkQueue.runAndWait | public static void runAndWait(final Runnable r) {
try {
if (r != null) {
final Thread thread = new Thread(r);
thread.start();
thread.join();
}
} catch (final Exception ex) {
LOG.debug("Thread has been interrupted and can... | java | public static void runAndWait(final Runnable r) {
try {
if (r != null) {
final Thread thread = new Thread(r);
thread.start();
thread.join();
}
} catch (final Exception ex) {
LOG.debug("Thread has been interrupted and can... | [
"public",
"static",
"void",
"runAndWait",
"(",
"final",
"Runnable",
"r",
")",
"{",
"try",
"{",
"if",
"(",
"r",
"!=",
"null",
")",
"{",
"final",
"Thread",
"thread",
"=",
"new",
"Thread",
"(",
"r",
")",
";",
"thread",
".",
"start",
"(",
")",
";",
"... | Provides the boilerplate code for running and waiting on a Runnable. | [
"Provides",
"the",
"boilerplate",
"code",
"for",
"running",
"and",
"waiting",
"on",
"a",
"Runnable",
"."
] | 5ebf5ed30a94c34c33f4708caa04a8da99cbb15c | https://github.com/pressgang-ccms/PressGangCCMSCommonUtilities/blob/5ebf5ed30a94c34c33f4708caa04a8da99cbb15c/src/main/java/org/jboss/pressgang/ccms/utils/concurrency/BaseWorkQueue.java#L129-L139 |
145,482 | sangupta/jerry-services | src/main/java/com/sangupta/jerry/lock/service/impl/RedisLockServiceImpl.java | RedisLockServiceImpl.getNewLockValue | protected String getNewLockValue(long timeoutInMillis) {
long time = System.currentTimeMillis() + timeoutInMillis + 1l;
String lockValue = ApplicationContext.NODE_ID + ":" + time;
return lockValue;
} | java | protected String getNewLockValue(long timeoutInMillis) {
long time = System.currentTimeMillis() + timeoutInMillis + 1l;
String lockValue = ApplicationContext.NODE_ID + ":" + time;
return lockValue;
} | [
"protected",
"String",
"getNewLockValue",
"(",
"long",
"timeoutInMillis",
")",
"{",
"long",
"time",
"=",
"System",
".",
"currentTimeMillis",
"(",
")",
"+",
"timeoutInMillis",
"+",
"1l",
";",
"String",
"lockValue",
"=",
"ApplicationContext",
".",
"NODE_ID",
"+",
... | Return the new value for the lock for given timeout.
@param timeoutInMillis
timeout in milli-seconds
@return the new lock value | [
"Return",
"the",
"new",
"value",
"for",
"the",
"lock",
"for",
"given",
"timeout",
"."
] | 25ff6577445850916425c72068d654c08eba9bcc | https://github.com/sangupta/jerry-services/blob/25ff6577445850916425c72068d654c08eba9bcc/src/main/java/com/sangupta/jerry/lock/service/impl/RedisLockServiceImpl.java#L153-L157 |
145,483 | akberc/ceylon-maven-plugin | src/main/java/com/dgwave/car/repo/CeylonModelLocator.java | CeylonModelLocator.locatePom | public File locatePom(final File folder) {
if (folder != null && folder.exists() && folder.isDirectory()) {
String moduleVersion = folder.getParentFile().getName();
File[] list = folder.listFiles();
File[] four = new File[CeylonUtil.NUM_CEYLON_JAVA_DEP_TYPES];
... | java | public File locatePom(final File folder) {
if (folder != null && folder.exists() && folder.isDirectory()) {
String moduleVersion = folder.getParentFile().getName();
File[] list = folder.listFiles();
File[] four = new File[CeylonUtil.NUM_CEYLON_JAVA_DEP_TYPES];
... | [
"public",
"File",
"locatePom",
"(",
"final",
"File",
"folder",
")",
"{",
"if",
"(",
"folder",
"!=",
"null",
"&&",
"folder",
".",
"exists",
"(",
")",
"&&",
"folder",
".",
"isDirectory",
"(",
")",
")",
"{",
"String",
"moduleVersion",
"=",
"folder",
".",
... | Implementing Maven API to locate the project model.
@param folder The folder in which to look
@return File The file that represents the POM. It may be a Ceylon properties or .module file | [
"Implementing",
"Maven",
"API",
"to",
"locate",
"the",
"project",
"model",
"."
] | b7f6c4a2b24f2fa237350c9e715f4193e83415ef | https://github.com/akberc/ceylon-maven-plugin/blob/b7f6c4a2b24f2fa237350c9e715f4193e83415ef/src/main/java/com/dgwave/car/repo/CeylonModelLocator.java#L24-L52 |
145,484 | flex-oss/flex-fruit | fruit-jpa/src/main/java/org/cdlflex/fruit/jpa/JpaRepository.java | JpaRepository.findOneByAttribute | public T findOneByAttribute(String attribute, Object value) {
CriteriaBuilder cb = getEntityManager().getCriteriaBuilder();
CriteriaQuery<T> query = cb.createQuery(getEntityClass());
Root<T> from = query.from(getEntityClass());
query.where(cb.equal(from.get(attribute), value));
... | java | public T findOneByAttribute(String attribute, Object value) {
CriteriaBuilder cb = getEntityManager().getCriteriaBuilder();
CriteriaQuery<T> query = cb.createQuery(getEntityClass());
Root<T> from = query.from(getEntityClass());
query.where(cb.equal(from.get(attribute), value));
... | [
"public",
"T",
"findOneByAttribute",
"(",
"String",
"attribute",
",",
"Object",
"value",
")",
"{",
"CriteriaBuilder",
"cb",
"=",
"getEntityManager",
"(",
")",
".",
"getCriteriaBuilder",
"(",
")",
";",
"CriteriaQuery",
"<",
"T",
">",
"query",
"=",
"cb",
".",
... | Finds an entity by a given attribute. Returns null if none was found.
@param attribute the attribute to search for
@param value the value
@return the entity or null if none was found | [
"Finds",
"an",
"entity",
"by",
"a",
"given",
"attribute",
".",
"Returns",
"null",
"if",
"none",
"was",
"found",
"."
] | 30d7eca5ee796b829f96c9932a95b259ca9738d9 | https://github.com/flex-oss/flex-fruit/blob/30d7eca5ee796b829f96c9932a95b259ca9738d9/fruit-jpa/src/main/java/org/cdlflex/fruit/jpa/JpaRepository.java#L190-L202 |
145,485 | flex-oss/flex-fruit | fruit-jpa/src/main/java/org/cdlflex/fruit/jpa/JpaRepository.java | JpaRepository.execute | protected void execute(EntityManagerCommand command) {
try {
getEntityManagerCommandExecutor().execute(command);
} catch (javax.persistence.PersistenceException e) {
throw new PersistenceException(e);
}
} | java | protected void execute(EntityManagerCommand command) {
try {
getEntityManagerCommandExecutor().execute(command);
} catch (javax.persistence.PersistenceException e) {
throw new PersistenceException(e);
}
} | [
"protected",
"void",
"execute",
"(",
"EntityManagerCommand",
"command",
")",
"{",
"try",
"{",
"getEntityManagerCommandExecutor",
"(",
")",
".",
"execute",
"(",
"command",
")",
";",
"}",
"catch",
"(",
"javax",
".",
"persistence",
".",
"PersistenceException",
"e",... | Executes the given command using an EntityManagerCommandExecutor.
@param command the command to execute | [
"Executes",
"the",
"given",
"command",
"using",
"an",
"EntityManagerCommandExecutor",
"."
] | 30d7eca5ee796b829f96c9932a95b259ca9738d9 | https://github.com/flex-oss/flex-fruit/blob/30d7eca5ee796b829f96c9932a95b259ca9738d9/fruit-jpa/src/main/java/org/cdlflex/fruit/jpa/JpaRepository.java#L308-L314 |
145,486 | gsi-upm/Shanks | shanks-core/src/main/java/es/upm/dit/gsi/shanks/ShanksSimulation3DGUI.java | ShanksSimulation3DGUI.removeTimeChart | public void removeTimeChart(String chartID) throws ShanksException {
Scenario3DPortrayal scenarioPortrayal = (Scenario3DPortrayal) this
.getSimulation().getScenarioPortrayal();
scenarioPortrayal.removeTimeChart(chartID);
} | java | public void removeTimeChart(String chartID) throws ShanksException {
Scenario3DPortrayal scenarioPortrayal = (Scenario3DPortrayal) this
.getSimulation().getScenarioPortrayal();
scenarioPortrayal.removeTimeChart(chartID);
} | [
"public",
"void",
"removeTimeChart",
"(",
"String",
"chartID",
")",
"throws",
"ShanksException",
"{",
"Scenario3DPortrayal",
"scenarioPortrayal",
"=",
"(",
"Scenario3DPortrayal",
")",
"this",
".",
"getSimulation",
"(",
")",
".",
"getScenarioPortrayal",
"(",
")",
";"... | Remove a chart to the simulation
@param chartID
@throws DuplicatedPortrayalIDException
@throws ScenarioNotFoundException | [
"Remove",
"a",
"chart",
"to",
"the",
"simulation"
] | 35d87a81c22731f4f83bbd0571c9c6d466bd16be | https://github.com/gsi-upm/Shanks/blob/35d87a81c22731f4f83bbd0571c9c6d466bd16be/shanks-core/src/main/java/es/upm/dit/gsi/shanks/ShanksSimulation3DGUI.java#L360-L364 |
145,487 | gsi-upm/Shanks | shanks-core/src/main/java/es/upm/dit/gsi/shanks/ShanksSimulation3DGUI.java | ShanksSimulation3DGUI.addScatterPlot | public void addScatterPlot(String scatterID, String xAxisLabel,
String yAxisLabel) throws ShanksException {
Scenario3DPortrayal scenarioPortrayal = (Scenario3DPortrayal) this
.getSimulation().getScenarioPortrayal();
scenarioPortrayal.addScatterPlot(scatterID, xAxisLabel, yAxi... | java | public void addScatterPlot(String scatterID, String xAxisLabel,
String yAxisLabel) throws ShanksException {
Scenario3DPortrayal scenarioPortrayal = (Scenario3DPortrayal) this
.getSimulation().getScenarioPortrayal();
scenarioPortrayal.addScatterPlot(scatterID, xAxisLabel, yAxi... | [
"public",
"void",
"addScatterPlot",
"(",
"String",
"scatterID",
",",
"String",
"xAxisLabel",
",",
"String",
"yAxisLabel",
")",
"throws",
"ShanksException",
"{",
"Scenario3DPortrayal",
"scenarioPortrayal",
"=",
"(",
"Scenario3DPortrayal",
")",
"this",
".",
"getSimulati... | Add a Scatter Plot to the simulation
@param scatterID
- The name of the plot
@param xAxisLabel
- The name of the x axis
@param yAxisLabel
- The name of the y axis
@throws DuplicatedPortrayalIDException
@throws ScenarioNotFoundException
@throws DuplicatedChartIDException | [
"Add",
"a",
"Scatter",
"Plot",
"to",
"the",
"simulation"
] | 35d87a81c22731f4f83bbd0571c9c6d466bd16be | https://github.com/gsi-upm/Shanks/blob/35d87a81c22731f4f83bbd0571c9c6d466bd16be/shanks-core/src/main/java/es/upm/dit/gsi/shanks/ShanksSimulation3DGUI.java#L379-L384 |
145,488 | pressgang-ccms/PressGangCCMSCommonUtilities | src/main/java/org/jboss/pressgang/ccms/utils/common/CollectionUtilities.java | CollectionUtilities.getSortOrder | public static <T extends Comparable<? super T>> Integer getSortOrder(final T first, final T second) {
if (first == null && second == null) return null;
if (first == null && second != null) return -1;
if (first != null && second == null) return 1;
return first.compareTo(second);
} | java | public static <T extends Comparable<? super T>> Integer getSortOrder(final T first, final T second) {
if (first == null && second == null) return null;
if (first == null && second != null) return -1;
if (first != null && second == null) return 1;
return first.compareTo(second);
} | [
"public",
"static",
"<",
"T",
"extends",
"Comparable",
"<",
"?",
"super",
"T",
">",
">",
"Integer",
"getSortOrder",
"(",
"final",
"T",
"first",
",",
"final",
"T",
"second",
")",
"{",
"if",
"(",
"first",
"==",
"null",
"&&",
"second",
"==",
"null",
")"... | Provides an easy way to compare two possibly null comparable objects
@param first The first object to compare
@param second The second object to compare
@return < 0 if the first object is less than the second object, 0 if they are equal, and > 0 otherwise | [
"Provides",
"an",
"easy",
"way",
"to",
"compare",
"two",
"possibly",
"null",
"comparable",
"objects"
] | 5ebf5ed30a94c34c33f4708caa04a8da99cbb15c | https://github.com/pressgang-ccms/PressGangCCMSCommonUtilities/blob/5ebf5ed30a94c34c33f4708caa04a8da99cbb15c/src/main/java/org/jboss/pressgang/ccms/utils/common/CollectionUtilities.java#L163-L171 |
145,489 | pressgang-ccms/PressGangCCMSCommonUtilities | src/main/java/org/jboss/pressgang/ccms/utils/common/CollectionUtilities.java | CollectionUtilities.isEqual | public static <T> boolean isEqual(final T first, final T second) {
/* test to see if they are both null, or both reference the same object */
if (first == second) return true;
if (first == null && second != null) return false;
return first.equals(second);
} | java | public static <T> boolean isEqual(final T first, final T second) {
/* test to see if they are both null, or both reference the same object */
if (first == second) return true;
if (first == null && second != null) return false;
return first.equals(second);
} | [
"public",
"static",
"<",
"T",
">",
"boolean",
"isEqual",
"(",
"final",
"T",
"first",
",",
"final",
"T",
"second",
")",
"{",
"/* test to see if they are both null, or both reference the same object */",
"if",
"(",
"first",
"==",
"second",
")",
"return",
"true",
";"... | Provides an easy way to see if two possibly null objects are equal
@param first The first object to test
@param second The second to test
@return true if both objects are equal, false otherwise | [
"Provides",
"an",
"easy",
"way",
"to",
"see",
"if",
"two",
"possibly",
"null",
"objects",
"are",
"equal"
] | 5ebf5ed30a94c34c33f4708caa04a8da99cbb15c | https://github.com/pressgang-ccms/PressGangCCMSCommonUtilities/blob/5ebf5ed30a94c34c33f4708caa04a8da99cbb15c/src/main/java/org/jboss/pressgang/ccms/utils/common/CollectionUtilities.java#L180-L187 |
145,490 | pressgang-ccms/PressGangCCMSCommonUtilities | src/main/java/org/jboss/pressgang/ccms/utils/common/CollectionUtilities.java | CollectionUtilities.trimStringArray | public static String[] trimStringArray(final String[] input) {
final ArrayList<String> output = new ArrayList<String>();
for (int i = 0; i < input.length; i++) {
String s = input[i].trim();
if (!s.equals("")) output.add(s);
}
return output.toArray(new String[0]);
... | java | public static String[] trimStringArray(final String[] input) {
final ArrayList<String> output = new ArrayList<String>();
for (int i = 0; i < input.length; i++) {
String s = input[i].trim();
if (!s.equals("")) output.add(s);
}
return output.toArray(new String[0]);
... | [
"public",
"static",
"String",
"[",
"]",
"trimStringArray",
"(",
"final",
"String",
"[",
"]",
"input",
")",
"{",
"final",
"ArrayList",
"<",
"String",
">",
"output",
"=",
"new",
"ArrayList",
"<",
"String",
">",
"(",
")",
";",
"for",
"(",
"int",
"i",
"=... | Trims an array of Strings to remove the whitespace. If the string is empty then its removed from the array.
@param input The array of strings to be trimmed
@return The same array of strings but all elements have been trimmed of whitespace | [
"Trims",
"an",
"array",
"of",
"Strings",
"to",
"remove",
"the",
"whitespace",
".",
"If",
"the",
"string",
"is",
"empty",
"then",
"its",
"removed",
"from",
"the",
"array",
"."
] | 5ebf5ed30a94c34c33f4708caa04a8da99cbb15c | https://github.com/pressgang-ccms/PressGangCCMSCommonUtilities/blob/5ebf5ed30a94c34c33f4708caa04a8da99cbb15c/src/main/java/org/jboss/pressgang/ccms/utils/common/CollectionUtilities.java#L202-L209 |
145,491 | keenon/loglinear | src/main/java/com/github/keenon/loglinear/model/ConcatVectorNamespace.java | ConcatVectorNamespace.newWeightsVector | public ConcatVector newWeightsVector(boolean presize) {
ConcatVector vector = new ConcatVector(featureToIndex.size());
if (presize) {
for (ObjectCursor<String> s : sparseFeatureIndex.keys()) {
int size = sparseFeatureIndex.get(s.value).size();
vector.setDenseC... | java | public ConcatVector newWeightsVector(boolean presize) {
ConcatVector vector = new ConcatVector(featureToIndex.size());
if (presize) {
for (ObjectCursor<String> s : sparseFeatureIndex.keys()) {
int size = sparseFeatureIndex.get(s.value).size();
vector.setDenseC... | [
"public",
"ConcatVector",
"newWeightsVector",
"(",
"boolean",
"presize",
")",
"{",
"ConcatVector",
"vector",
"=",
"new",
"ConcatVector",
"(",
"featureToIndex",
".",
"size",
"(",
")",
")",
";",
"if",
"(",
"presize",
")",
"{",
"for",
"(",
"ObjectCursor",
"<",
... | This constructs a fresh vector that is sized correctly to accommodate all the known sparse values for vectors
that are possibly sparse.
@param presize a flag for whether or not to create all the dense double arrays for our sparse features
@return a new, internally correctly sized ConcatVector that will work correctly... | [
"This",
"constructs",
"a",
"fresh",
"vector",
"that",
"is",
"sized",
"correctly",
"to",
"accommodate",
"all",
"the",
"known",
"sparse",
"values",
"for",
"vectors",
"that",
"are",
"possibly",
"sparse",
"."
] | fa0c370ab6782015412f676ef2ab11c97be58e29 | https://github.com/keenon/loglinear/blob/fa0c370ab6782015412f676ef2ab11c97be58e29/src/main/java/com/github/keenon/loglinear/model/ConcatVectorNamespace.java#L48-L58 |
145,492 | keenon/loglinear | src/main/java/com/github/keenon/loglinear/model/ConcatVectorNamespace.java | ConcatVectorNamespace.ensureFeature | public int ensureFeature(String featureName) {
int feature = featureToIndex.getOrDefault(featureName, -1);
if (feature == -1) {
synchronized (featureToIndex) {
feature = featureToIndex.getOrDefault(featureName, -1);
if (feature == -1) {
fea... | java | public int ensureFeature(String featureName) {
int feature = featureToIndex.getOrDefault(featureName, -1);
if (feature == -1) {
synchronized (featureToIndex) {
feature = featureToIndex.getOrDefault(featureName, -1);
if (feature == -1) {
fea... | [
"public",
"int",
"ensureFeature",
"(",
"String",
"featureName",
")",
"{",
"int",
"feature",
"=",
"featureToIndex",
".",
"getOrDefault",
"(",
"featureName",
",",
"-",
"1",
")",
";",
"if",
"(",
"feature",
"==",
"-",
"1",
")",
"{",
"synchronized",
"(",
"fea... | An optimization, this lets clients inform the ConcatVectorNamespace of how many features to expect, so
that we can avoid resizing ConcatVectors.
@param featureName the feature to add to our index | [
"An",
"optimization",
"this",
"lets",
"clients",
"inform",
"the",
"ConcatVectorNamespace",
"of",
"how",
"many",
"features",
"to",
"expect",
"so",
"that",
"we",
"can",
"avoid",
"resizing",
"ConcatVectors",
"."
] | fa0c370ab6782015412f676ef2ab11c97be58e29 | https://github.com/keenon/loglinear/blob/fa0c370ab6782015412f676ef2ab11c97be58e29/src/main/java/com/github/keenon/loglinear/model/ConcatVectorNamespace.java#L65-L77 |
145,493 | keenon/loglinear | src/main/java/com/github/keenon/loglinear/model/ConcatVectorNamespace.java | ConcatVectorNamespace.ensureSparseFeature | public int ensureSparseFeature(String featureName, String index) {
ensureFeature(featureName);
ObjectIntMap<String> sparseIndex = sparseFeatureIndex.get(featureName);
IntObjectMap<String> reverseSparseIndex = reverseSparseFeatureIndex.get(featureName);
if (sparseIndex == null || reverseS... | java | public int ensureSparseFeature(String featureName, String index) {
ensureFeature(featureName);
ObjectIntMap<String> sparseIndex = sparseFeatureIndex.get(featureName);
IntObjectMap<String> reverseSparseIndex = reverseSparseFeatureIndex.get(featureName);
if (sparseIndex == null || reverseS... | [
"public",
"int",
"ensureSparseFeature",
"(",
"String",
"featureName",
",",
"String",
"index",
")",
"{",
"ensureFeature",
"(",
"featureName",
")",
";",
"ObjectIntMap",
"<",
"String",
">",
"sparseIndex",
"=",
"sparseFeatureIndex",
".",
"get",
"(",
"featureName",
"... | An optimization, this lets clients inform the ConcatVectorNamespace of how many sparse feature components to
expect, again so that we can avoid resizing ConcatVectors.
@param featureName the feature to use in our index
@param index the sparse value to ensure is available | [
"An",
"optimization",
"this",
"lets",
"clients",
"inform",
"the",
"ConcatVectorNamespace",
"of",
"how",
"many",
"sparse",
"feature",
"components",
"to",
"expect",
"again",
"so",
"that",
"we",
"can",
"avoid",
"resizing",
"ConcatVectors",
"."
] | fa0c370ab6782015412f676ef2ab11c97be58e29 | https://github.com/keenon/loglinear/blob/fa0c370ab6782015412f676ef2ab11c97be58e29/src/main/java/com/github/keenon/loglinear/model/ConcatVectorNamespace.java#L85-L114 |
145,494 | keenon/loglinear | src/main/java/com/github/keenon/loglinear/model/ConcatVectorNamespace.java | ConcatVectorNamespace.setDenseFeature | public void setDenseFeature(ConcatVector vector, String featureName, double[] value) {
vector.setDenseComponent(ensureFeature(featureName), value);
} | java | public void setDenseFeature(ConcatVector vector, String featureName, double[] value) {
vector.setDenseComponent(ensureFeature(featureName), value);
} | [
"public",
"void",
"setDenseFeature",
"(",
"ConcatVector",
"vector",
",",
"String",
"featureName",
",",
"double",
"[",
"]",
"value",
")",
"{",
"vector",
".",
"setDenseComponent",
"(",
"ensureFeature",
"(",
"featureName",
")",
",",
"value",
")",
";",
"}"
] | This adds a dense feature to a vector, setting the appropriate component of the given vector to the passed in
value.
@param vector the vector
@param featureName the feature whose value to set
@param value the value we want to set this vector to | [
"This",
"adds",
"a",
"dense",
"feature",
"to",
"a",
"vector",
"setting",
"the",
"appropriate",
"component",
"of",
"the",
"given",
"vector",
"to",
"the",
"passed",
"in",
"value",
"."
] | fa0c370ab6782015412f676ef2ab11c97be58e29 | https://github.com/keenon/loglinear/blob/fa0c370ab6782015412f676ef2ab11c97be58e29/src/main/java/com/github/keenon/loglinear/model/ConcatVectorNamespace.java#L134-L136 |
145,495 | keenon/loglinear | src/main/java/com/github/keenon/loglinear/model/ConcatVectorNamespace.java | ConcatVectorNamespace.setSparseFeature | public void setSparseFeature(ConcatVector vector, String featureName, String index, double value) {
vector.setSparseComponent(ensureFeature(featureName), ensureSparseFeature(featureName, index), value);
} | java | public void setSparseFeature(ConcatVector vector, String featureName, String index, double value) {
vector.setSparseComponent(ensureFeature(featureName), ensureSparseFeature(featureName, index), value);
} | [
"public",
"void",
"setSparseFeature",
"(",
"ConcatVector",
"vector",
",",
"String",
"featureName",
",",
"String",
"index",
",",
"double",
"value",
")",
"{",
"vector",
".",
"setSparseComponent",
"(",
"ensureFeature",
"(",
"featureName",
")",
",",
"ensureSparseFeatu... | This adds a sparse feature to a vector, setting the appropriate component of the given vector to the passed in
value.
@param vector the vector
@param featureName the feature whose value to set
@param index the index of the one-hot vector to set, as a string, which we will translate into a mapping
@param value the value... | [
"This",
"adds",
"a",
"sparse",
"feature",
"to",
"a",
"vector",
"setting",
"the",
"appropriate",
"component",
"of",
"the",
"given",
"vector",
"to",
"the",
"passed",
"in",
"value",
"."
] | fa0c370ab6782015412f676ef2ab11c97be58e29 | https://github.com/keenon/loglinear/blob/fa0c370ab6782015412f676ef2ab11c97be58e29/src/main/java/com/github/keenon/loglinear/model/ConcatVectorNamespace.java#L146-L148 |
145,496 | keenon/loglinear | src/main/java/com/github/keenon/loglinear/model/ConcatVectorNamespace.java | ConcatVectorNamespace.debugVector | public void debugVector(ConcatVector vector, BufferedWriter bw) throws IOException {
List<String> features = new ArrayList<>();
Map<String, List<Integer>> sortedFeatures = new HashMap<>();
for (ObjectCursor<String> key : featureToIndex.keys()) {
features.add(key.value);
... | java | public void debugVector(ConcatVector vector, BufferedWriter bw) throws IOException {
List<String> features = new ArrayList<>();
Map<String, List<Integer>> sortedFeatures = new HashMap<>();
for (ObjectCursor<String> key : featureToIndex.keys()) {
features.add(key.value);
... | [
"public",
"void",
"debugVector",
"(",
"ConcatVector",
"vector",
",",
"BufferedWriter",
"bw",
")",
"throws",
"IOException",
"{",
"List",
"<",
"String",
">",
"features",
"=",
"new",
"ArrayList",
"<>",
"(",
")",
";",
"Map",
"<",
"String",
",",
"List",
"<",
... | This prints out a ConcatVector by mapping to the namespace, to make debugging learning algorithms easier.
@param vector the vector to print
@param bw the output stream to write to | [
"This",
"prints",
"out",
"a",
"ConcatVector",
"by",
"mapping",
"to",
"the",
"namespace",
"to",
"make",
"debugging",
"learning",
"algorithms",
"easier",
"."
] | fa0c370ab6782015412f676ef2ab11c97be58e29 | https://github.com/keenon/loglinear/blob/fa0c370ab6782015412f676ef2ab11c97be58e29/src/main/java/com/github/keenon/loglinear/model/ConcatVectorNamespace.java#L308-L366 |
145,497 | keenon/loglinear | src/main/java/com/github/keenon/loglinear/model/ConcatVectorNamespace.java | ConcatVectorNamespace.debugFeatureValue | private void debugFeatureValue(String feature, int index, ConcatVector vector, BufferedWriter bw) throws IOException {
bw.write("\t");
if (sparseFeatureIndex.containsKey(feature) && sparseFeatureIndex.get(feature).values().contains(index)) {
// we can map this index to an interpretable strin... | java | private void debugFeatureValue(String feature, int index, ConcatVector vector, BufferedWriter bw) throws IOException {
bw.write("\t");
if (sparseFeatureIndex.containsKey(feature) && sparseFeatureIndex.get(feature).values().contains(index)) {
// we can map this index to an interpretable strin... | [
"private",
"void",
"debugFeatureValue",
"(",
"String",
"feature",
",",
"int",
"index",
",",
"ConcatVector",
"vector",
",",
"BufferedWriter",
"bw",
")",
"throws",
"IOException",
"{",
"bw",
".",
"write",
"(",
"\"\\t\"",
")",
";",
"if",
"(",
"sparseFeatureIndex",... | This writes a feature's individual value, using the human readable name if possible, to a StringBuilder | [
"This",
"writes",
"a",
"feature",
"s",
"individual",
"value",
"using",
"the",
"human",
"readable",
"name",
"if",
"possible",
"to",
"a",
"StringBuilder"
] | fa0c370ab6782015412f676ef2ab11c97be58e29 | https://github.com/keenon/loglinear/blob/fa0c370ab6782015412f676ef2ab11c97be58e29/src/main/java/com/github/keenon/loglinear/model/ConcatVectorNamespace.java#L371-L386 |
145,498 | dbracewell/mango | src/main/java/com/davidbracewell/string/CSVFormatter.java | CSVFormatter.format | public String format(Object... array) {
if (array == null) {
return StringUtils.EMPTY;
}
if (array.length == 1 && array[0].getClass().isArray()) {
return format(Convert.convert(array[0], Iterable.class));
}
return format(Arrays.asList(array).iterator());
} | java | public String format(Object... array) {
if (array == null) {
return StringUtils.EMPTY;
}
if (array.length == 1 && array[0].getClass().isArray()) {
return format(Convert.convert(array[0], Iterable.class));
}
return format(Arrays.asList(array).iterator());
} | [
"public",
"String",
"format",
"(",
"Object",
"...",
"array",
")",
"{",
"if",
"(",
"array",
"==",
"null",
")",
"{",
"return",
"StringUtils",
".",
"EMPTY",
";",
"}",
"if",
"(",
"array",
".",
"length",
"==",
"1",
"&&",
"array",
"[",
"0",
"]",
".",
"... | Formats the items in an Array.
@param array The array to format
@return A String representing the single DSV formatted row | [
"Formats",
"the",
"items",
"in",
"an",
"Array",
"."
] | 2cec08826f1fccd658694dd03abce10fc97618ec | https://github.com/dbracewell/mango/blob/2cec08826f1fccd658694dd03abce10fc97618ec/src/main/java/com/davidbracewell/string/CSVFormatter.java#L235-L243 |
145,499 | josueeduardo/snappy | plugin-parent/snappy-maven-plugin/src/main/java/io/joshworks/snappy/maven/tools/FileUtils.java | FileUtils.sha1Hash | public static String sha1Hash(File file) throws IOException {
try {
DigestInputStream inputStream = new DigestInputStream(
new FileInputStream(file), MessageDigest.getInstance("SHA-1"));
try {
byte[] buffer = new byte[4098];
while (inpu... | java | public static String sha1Hash(File file) throws IOException {
try {
DigestInputStream inputStream = new DigestInputStream(
new FileInputStream(file), MessageDigest.getInstance("SHA-1"));
try {
byte[] buffer = new byte[4098];
while (inpu... | [
"public",
"static",
"String",
"sha1Hash",
"(",
"File",
"file",
")",
"throws",
"IOException",
"{",
"try",
"{",
"DigestInputStream",
"inputStream",
"=",
"new",
"DigestInputStream",
"(",
"new",
"FileInputStream",
"(",
"file",
")",
",",
"MessageDigest",
".",
"getIns... | Generate a SHA.1 Hash for a given file.
@param file the file to hash
@return the hash value as a String
@throws IOException if the file cannot be read | [
"Generate",
"a",
"SHA",
".",
"1",
"Hash",
"for",
"a",
"given",
"file",
"."
] | d95a9e811eda3c24a5e53086369208819884fa49 | https://github.com/josueeduardo/snappy/blob/d95a9e811eda3c24a5e53086369208819884fa49/plugin-parent/snappy-maven-plugin/src/main/java/io/joshworks/snappy/maven/tools/FileUtils.java#L66-L82 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.