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 | partition stringclasses 1
value |
|---|---|---|---|---|---|---|---|---|---|---|---|
TheHortonMachine/hortonmachine | gears/src/main/java/org/hortonmachine/gears/utils/coverage/CoverageUtilities.java | CoverageUtilities.mergeCoverages | public static GridCoverage2D mergeCoverages( GridCoverage2D valuesMap, GridCoverage2D onMap ) {
RegionMap valuesRegionMap = getRegionParamsFromGridCoverage(valuesMap);
int cs = valuesRegionMap.getCols();
int rs = valuesRegionMap.getRows();
RegionMap onRegionMap = getRegionParamsFromGridC... | java | public static GridCoverage2D mergeCoverages( GridCoverage2D valuesMap, GridCoverage2D onMap ) {
RegionMap valuesRegionMap = getRegionParamsFromGridCoverage(valuesMap);
int cs = valuesRegionMap.getCols();
int rs = valuesRegionMap.getRows();
RegionMap onRegionMap = getRegionParamsFromGridC... | [
"public",
"static",
"GridCoverage2D",
"mergeCoverages",
"(",
"GridCoverage2D",
"valuesMap",
",",
"GridCoverage2D",
"onMap",
")",
"{",
"RegionMap",
"valuesRegionMap",
"=",
"getRegionParamsFromGridCoverage",
"(",
"valuesMap",
")",
";",
"int",
"cs",
"=",
"valuesRegionMap",... | Coverage merger.
<p>Values from valuesMap are placed into the onMap coverage, if they are valid.</p>
@param valuesMap the map from which to take teh valid values to place in the output map.
@param onMap the base map on which to place the valuesMap values.
@return the merged map of valuesMap over onMap. | [
"Coverage",
"merger",
"."
] | d2b436bbdf951dc1fda56096a42dbc0eae4d35a5 | https://github.com/TheHortonMachine/hortonmachine/blob/d2b436bbdf951dc1fda56096a42dbc0eae4d35a5/gears/src/main/java/org/hortonmachine/gears/utils/coverage/CoverageUtilities.java#L1408-L1434 | train |
TheHortonMachine/hortonmachine | gears/src/main/java/org/hortonmachine/gears/utils/coverage/CoverageUtilities.java | CoverageUtilities.calculateHypsographic | public static double[][] calculateHypsographic( GridCoverage2D elevationCoverage, int bins, IHMProgressMonitor pm ) {
if (pm == null) {
pm = new DummyProgressMonitor();
}
RegionMap regionMap = getRegionParamsFromGridCoverage(elevationCoverage);
int cols = regionMap.getCols();... | java | public static double[][] calculateHypsographic( GridCoverage2D elevationCoverage, int bins, IHMProgressMonitor pm ) {
if (pm == null) {
pm = new DummyProgressMonitor();
}
RegionMap regionMap = getRegionParamsFromGridCoverage(elevationCoverage);
int cols = regionMap.getCols();... | [
"public",
"static",
"double",
"[",
"]",
"[",
"]",
"calculateHypsographic",
"(",
"GridCoverage2D",
"elevationCoverage",
",",
"int",
"bins",
",",
"IHMProgressMonitor",
"pm",
")",
"{",
"if",
"(",
"pm",
"==",
"null",
")",
"{",
"pm",
"=",
"new",
"DummyProgressMon... | Calculates the hypsographic curve for the given raster, using the supplied bins.
@param elevationCoverage the elevation raster.
@param bins the bins to use.
@param pm the monitor.
@return the matrix containing the hypsographic curve in [elev, area] pairs per row. | [
"Calculates",
"the",
"hypsographic",
"curve",
"for",
"the",
"given",
"raster",
"using",
"the",
"supplied",
"bins",
"."
] | d2b436bbdf951dc1fda56096a42dbc0eae4d35a5 | https://github.com/TheHortonMachine/hortonmachine/blob/d2b436bbdf951dc1fda56096a42dbc0eae4d35a5/gears/src/main/java/org/hortonmachine/gears/utils/coverage/CoverageUtilities.java#L1444-L1504 | train |
TheHortonMachine/hortonmachine | gears/src/main/java/org/hortonmachine/gears/utils/CompressionUtilities.java | CompressionUtilities.zipFolder | static public void zipFolder( String srcFolder, String destZipFile, boolean addBaseFolder ) throws IOException {
if (new File(srcFolder).isDirectory()) {
try (FileOutputStream fileWriter = new FileOutputStream(destZipFile);
ZipOutputStream zip = new ZipOutputStream(fileWriter)) {... | java | static public void zipFolder( String srcFolder, String destZipFile, boolean addBaseFolder ) throws IOException {
if (new File(srcFolder).isDirectory()) {
try (FileOutputStream fileWriter = new FileOutputStream(destZipFile);
ZipOutputStream zip = new ZipOutputStream(fileWriter)) {... | [
"static",
"public",
"void",
"zipFolder",
"(",
"String",
"srcFolder",
",",
"String",
"destZipFile",
",",
"boolean",
"addBaseFolder",
")",
"throws",
"IOException",
"{",
"if",
"(",
"new",
"File",
"(",
"srcFolder",
")",
".",
"isDirectory",
"(",
")",
")",
"{",
... | Compress a folder and its contents.
@param srcFolder path to the folder to be compressed.
@param destZipFile path to the final output zip file.
@param addBaseFolder flag to decide whether to add also the provided base (srcFolder) folder or not.
@throws IOException | [
"Compress",
"a",
"folder",
"and",
"its",
"contents",
"."
] | d2b436bbdf951dc1fda56096a42dbc0eae4d35a5 | https://github.com/TheHortonMachine/hortonmachine/blob/d2b436bbdf951dc1fda56096a42dbc0eae4d35a5/gears/src/main/java/org/hortonmachine/gears/utils/CompressionUtilities.java#L50-L59 | train |
TheHortonMachine/hortonmachine | gears/src/main/java/org/hortonmachine/gears/utils/CompressionUtilities.java | CompressionUtilities.unzipFolder | public static String unzipFolder( String zipFile, String destFolder, boolean addTimeStamp ) throws IOException {
String newFirstName = null;
try (ZipFile zf = new ZipFile(zipFile)) {
Enumeration< ? extends ZipEntry> zipEnum = zf.entries();
String firstName = null;
w... | java | public static String unzipFolder( String zipFile, String destFolder, boolean addTimeStamp ) throws IOException {
String newFirstName = null;
try (ZipFile zf = new ZipFile(zipFile)) {
Enumeration< ? extends ZipEntry> zipEnum = zf.entries();
String firstName = null;
w... | [
"public",
"static",
"String",
"unzipFolder",
"(",
"String",
"zipFile",
",",
"String",
"destFolder",
",",
"boolean",
"addTimeStamp",
")",
"throws",
"IOException",
"{",
"String",
"newFirstName",
"=",
"null",
";",
"try",
"(",
"ZipFile",
"zf",
"=",
"new",
"ZipFile... | Uncompress a compressed file to the contained structure.
@param zipFile the zip file that needs to be unzipped
@param destFolder the folder into which unzip the zip file and create the folder structure
@param addTimeStamp if <code>true</code>, the timestamp is added if the base folder already exists.
@return the name ... | [
"Uncompress",
"a",
"compressed",
"file",
"to",
"the",
"contained",
"structure",
"."
] | d2b436bbdf951dc1fda56096a42dbc0eae4d35a5 | https://github.com/TheHortonMachine/hortonmachine/blob/d2b436bbdf951dc1fda56096a42dbc0eae4d35a5/gears/src/main/java/org/hortonmachine/gears/utils/CompressionUtilities.java#L77-L136 | train |
TheHortonMachine/hortonmachine | gears/src/main/java/oms3/util/Processes1.java | Processes1.setWorkingDirectory | public void setWorkingDirectory(File dir) {
if (!dir.exists()) {
throw new IllegalArgumentException(dir + " doesn't exist.");
}
pb.directory(dir);
} | java | public void setWorkingDirectory(File dir) {
if (!dir.exists()) {
throw new IllegalArgumentException(dir + " doesn't exist.");
}
pb.directory(dir);
} | [
"public",
"void",
"setWorkingDirectory",
"(",
"File",
"dir",
")",
"{",
"if",
"(",
"!",
"dir",
".",
"exists",
"(",
")",
")",
"{",
"throw",
"new",
"IllegalArgumentException",
"(",
"dir",
"+",
"\" doesn't exist.\"",
")",
";",
"}",
"pb",
".",
"directory",
"(... | Set the working directory where the process get executed.
@param dir the directory in which the executable will be started | [
"Set",
"the",
"working",
"directory",
"where",
"the",
"process",
"get",
"executed",
"."
] | d2b436bbdf951dc1fda56096a42dbc0eae4d35a5 | https://github.com/TheHortonMachine/hortonmachine/blob/d2b436bbdf951dc1fda56096a42dbc0eae4d35a5/gears/src/main/java/oms3/util/Processes1.java#L82-L87 | train |
TheHortonMachine/hortonmachine | gears/src/main/java/oms3/util/Processes1.java | Processes1.exec | public int exec() throws IOException {
int exitValue = 0;
List<String> argl = new ArrayList<String>();
argl.add(executable.toString());
for (Object a : args) {
if (a != null) {
if (a.getClass() == String.class) {
argl.add(a.toString());
... | java | public int exec() throws IOException {
int exitValue = 0;
List<String> argl = new ArrayList<String>();
argl.add(executable.toString());
for (Object a : args) {
if (a != null) {
if (a.getClass() == String.class) {
argl.add(a.toString());
... | [
"public",
"int",
"exec",
"(",
")",
"throws",
"IOException",
"{",
"int",
"exitValue",
"=",
"0",
";",
"List",
"<",
"String",
">",
"argl",
"=",
"new",
"ArrayList",
"<",
"String",
">",
"(",
")",
";",
"argl",
".",
"add",
"(",
"executable",
".",
"toString"... | Process execution. This call blocks until the process is done.
@throws java.lang.Exception
@return the exit status of the process. | [
"Process",
"execution",
".",
"This",
"call",
"blocks",
"until",
"the",
"process",
"is",
"done",
"."
] | d2b436bbdf951dc1fda56096a42dbc0eae4d35a5 | https://github.com/TheHortonMachine/hortonmachine/blob/d2b436bbdf951dc1fda56096a42dbc0eae4d35a5/gears/src/main/java/oms3/util/Processes1.java#L138-L187 | train |
enasequence/sequencetools | src/main/java/uk/ac/ebi/embl/api/validation/ValidationPlanResult.java | ValidationPlanResult.addResult | private void addResult(ValidationResult result) {
if (result == null || result.count() == 0) {
return;
}
this.results.add(result);
} | java | private void addResult(ValidationResult result) {
if (result == null || result.count() == 0) {
return;
}
this.results.add(result);
} | [
"private",
"void",
"addResult",
"(",
"ValidationResult",
"result",
")",
"{",
"if",
"(",
"result",
"==",
"null",
"||",
"result",
".",
"count",
"(",
")",
"==",
"0",
")",
"{",
"return",
";",
"}",
"this",
".",
"results",
".",
"add",
"(",
"result",
")",
... | Adds a validationResult to the results - if there are any messages
@param result a validation message to be added | [
"Adds",
"a",
"validationResult",
"to",
"the",
"results",
"-",
"if",
"there",
"are",
"any",
"messages"
] | 4127f5e1a17540239f5810136153fbd6737fa262 | https://github.com/enasequence/sequencetools/blob/4127f5e1a17540239f5810136153fbd6737fa262/src/main/java/uk/ac/ebi/embl/api/validation/ValidationPlanResult.java#L48-L53 | train |
enasequence/sequencetools | src/main/java/uk/ac/ebi/embl/api/validation/ValidationPlanResult.java | ValidationPlanResult.getMessages | public List<ValidationMessage<Origin>> getMessages(String messageKey, Severity severity) {
List<ValidationMessage<Origin>> messages = new ArrayList<ValidationMessage<Origin>>();
for (ValidationResult result : results) {
for (ValidationMessage<Origin> message : result.getMessages()) {
... | java | public List<ValidationMessage<Origin>> getMessages(String messageKey, Severity severity) {
List<ValidationMessage<Origin>> messages = new ArrayList<ValidationMessage<Origin>>();
for (ValidationResult result : results) {
for (ValidationMessage<Origin> message : result.getMessages()) {
... | [
"public",
"List",
"<",
"ValidationMessage",
"<",
"Origin",
">",
">",
"getMessages",
"(",
"String",
"messageKey",
",",
"Severity",
"severity",
")",
"{",
"List",
"<",
"ValidationMessage",
"<",
"Origin",
">>",
"messages",
"=",
"new",
"ArrayList",
"<",
"Validation... | Finds validation messages by the message key and severity.
@param messageKey a message key of the message
@param severity a severity of the message
@return a collection of found validation messages | [
"Finds",
"validation",
"messages",
"by",
"the",
"message",
"key",
"and",
"severity",
"."
] | 4127f5e1a17540239f5810136153fbd6737fa262 | https://github.com/enasequence/sequencetools/blob/4127f5e1a17540239f5810136153fbd6737fa262/src/main/java/uk/ac/ebi/embl/api/validation/ValidationPlanResult.java#L213-L226 | train |
TheHortonMachine/hortonmachine | dbs/src/main/java/org/hortonmachine/dbs/utils/SerializationUtilities.java | SerializationUtilities.serialize | public static byte[] serialize( Object obj ) throws IOException {
try (ByteArrayOutputStream bos = new ByteArrayOutputStream()) {
ObjectOutputStream out = new ObjectOutputStream(bos);
out.writeObject(obj);
out.close();
return bos.toByteArray();
}
} | java | public static byte[] serialize( Object obj ) throws IOException {
try (ByteArrayOutputStream bos = new ByteArrayOutputStream()) {
ObjectOutputStream out = new ObjectOutputStream(bos);
out.writeObject(obj);
out.close();
return bos.toByteArray();
}
} | [
"public",
"static",
"byte",
"[",
"]",
"serialize",
"(",
"Object",
"obj",
")",
"throws",
"IOException",
"{",
"try",
"(",
"ByteArrayOutputStream",
"bos",
"=",
"new",
"ByteArrayOutputStream",
"(",
")",
")",
"{",
"ObjectOutputStream",
"out",
"=",
"new",
"ObjectOut... | Serialize an Object to disk.
@param obj
the object to serialize.
@return the bytes.
@throws IOException | [
"Serialize",
"an",
"Object",
"to",
"disk",
"."
] | d2b436bbdf951dc1fda56096a42dbc0eae4d35a5 | https://github.com/TheHortonMachine/hortonmachine/blob/d2b436bbdf951dc1fda56096a42dbc0eae4d35a5/dbs/src/main/java/org/hortonmachine/dbs/utils/SerializationUtilities.java#L24-L31 | train |
TheHortonMachine/hortonmachine | dbs/src/main/java/org/hortonmachine/dbs/utils/SerializationUtilities.java | SerializationUtilities.deSerialize | public static <T> T deSerialize( byte[] bytes, Class<T> adaptee ) throws Exception {
ObjectInputStream in = new ObjectInputStream(new ByteArrayInputStream(bytes));
Object readObject = in.readObject();
return adaptee.cast(readObject);
} | java | public static <T> T deSerialize( byte[] bytes, Class<T> adaptee ) throws Exception {
ObjectInputStream in = new ObjectInputStream(new ByteArrayInputStream(bytes));
Object readObject = in.readObject();
return adaptee.cast(readObject);
} | [
"public",
"static",
"<",
"T",
">",
"T",
"deSerialize",
"(",
"byte",
"[",
"]",
"bytes",
",",
"Class",
"<",
"T",
">",
"adaptee",
")",
"throws",
"Exception",
"{",
"ObjectInputStream",
"in",
"=",
"new",
"ObjectInputStream",
"(",
"new",
"ByteArrayInputStream",
... | Deserialize a byte array to a given object.
@param bytes
the byte array.
@param adaptee
the class to adapt to.
@return the object.
@throws Exception | [
"Deserialize",
"a",
"byte",
"array",
"to",
"a",
"given",
"object",
"."
] | d2b436bbdf951dc1fda56096a42dbc0eae4d35a5 | https://github.com/TheHortonMachine/hortonmachine/blob/d2b436bbdf951dc1fda56096a42dbc0eae4d35a5/dbs/src/main/java/org/hortonmachine/dbs/utils/SerializationUtilities.java#L43-L47 | train |
TheHortonMachine/hortonmachine | dbs/src/main/java/org/hortonmachine/dbs/utils/SerializationUtilities.java | SerializationUtilities.serializeToDisk | public static void serializeToDisk( File file, Object obj ) throws IOException {
byte[] serializedObj = serialize(obj);
try (RandomAccessFile raFile = new RandomAccessFile(file, "rw")) {
raFile.write(serializedObj);
}
} | java | public static void serializeToDisk( File file, Object obj ) throws IOException {
byte[] serializedObj = serialize(obj);
try (RandomAccessFile raFile = new RandomAccessFile(file, "rw")) {
raFile.write(serializedObj);
}
} | [
"public",
"static",
"void",
"serializeToDisk",
"(",
"File",
"file",
",",
"Object",
"obj",
")",
"throws",
"IOException",
"{",
"byte",
"[",
"]",
"serializedObj",
"=",
"serialize",
"(",
"obj",
")",
";",
"try",
"(",
"RandomAccessFile",
"raFile",
"=",
"new",
"R... | Serialize an object to disk.
@param file
the file to write to.
@param obj
the object to write.
@throws IOException | [
"Serialize",
"an",
"object",
"to",
"disk",
"."
] | d2b436bbdf951dc1fda56096a42dbc0eae4d35a5 | https://github.com/TheHortonMachine/hortonmachine/blob/d2b436bbdf951dc1fda56096a42dbc0eae4d35a5/dbs/src/main/java/org/hortonmachine/dbs/utils/SerializationUtilities.java#L58-L63 | train |
TheHortonMachine/hortonmachine | dbs/src/main/java/org/hortonmachine/dbs/utils/SerializationUtilities.java | SerializationUtilities.deSerializeFromDisk | public static <T> T deSerializeFromDisk( File file, Class<T> adaptee ) throws Exception {
try (RandomAccessFile raf = new RandomAccessFile(file, "r")) {
long length = raf.length();
// System.out.println(length + "/" + (int) length);
byte[] bytes = new byte[(int) length];
... | java | public static <T> T deSerializeFromDisk( File file, Class<T> adaptee ) throws Exception {
try (RandomAccessFile raf = new RandomAccessFile(file, "r")) {
long length = raf.length();
// System.out.println(length + "/" + (int) length);
byte[] bytes = new byte[(int) length];
... | [
"public",
"static",
"<",
"T",
">",
"T",
"deSerializeFromDisk",
"(",
"File",
"file",
",",
"Class",
"<",
"T",
">",
"adaptee",
")",
"throws",
"Exception",
"{",
"try",
"(",
"RandomAccessFile",
"raf",
"=",
"new",
"RandomAccessFile",
"(",
"file",
",",
"\"r\"",
... | Deserialize a file to a given object.
@param file
the file to read.
@param adaptee
the class to adapt to.
@return the object.
@throws Exception | [
"Deserialize",
"a",
"file",
"to",
"a",
"given",
"object",
"."
] | d2b436bbdf951dc1fda56096a42dbc0eae4d35a5 | https://github.com/TheHortonMachine/hortonmachine/blob/d2b436bbdf951dc1fda56096a42dbc0eae4d35a5/dbs/src/main/java/org/hortonmachine/dbs/utils/SerializationUtilities.java#L75-L88 | train |
TheHortonMachine/hortonmachine | hmachine/src/main/java/org/hortonmachine/hmachine/modules/hydrogeomorphology/energybalance/OmsEnergyBalance.java | OmsEnergyBalance.checkParametersAndRunEnergyBalance | private void checkParametersAndRunEnergyBalance( double[] rain, double[][] T, double[][] V, double[][] P, double[][] RH,
double month, double day, double hour, double[] Abasin, double[][][] A, double[][][] EI, double[][] DTd,
double[][] DTm, double[][] canopy ) {
double Dt = ((double) t... | java | private void checkParametersAndRunEnergyBalance( double[] rain, double[][] T, double[][] V, double[][] P, double[][] RH,
double month, double day, double hour, double[] Abasin, double[][][] A, double[][][] EI, double[][] DTd,
double[][] DTm, double[][] canopy ) {
double Dt = ((double) t... | [
"private",
"void",
"checkParametersAndRunEnergyBalance",
"(",
"double",
"[",
"]",
"rain",
",",
"double",
"[",
"]",
"[",
"]",
"T",
",",
"double",
"[",
"]",
"[",
"]",
"V",
",",
"double",
"[",
"]",
"[",
"]",
"P",
",",
"double",
"[",
"]",
"[",
"]",
"... | Method to check the input parameters.
<p>
Due to the huge amount of parameters, this method is used to do
necessary checks and set default values. This is made so the initialize
method doesn't get flooded.
</p>
@param dtData
@param rain
@param T matrix of temperatures of every altimetric band for every basin.[basin][... | [
"Method",
"to",
"check",
"the",
"input",
"parameters",
"."
] | d2b436bbdf951dc1fda56096a42dbc0eae4d35a5 | https://github.com/TheHortonMachine/hortonmachine/blob/d2b436bbdf951dc1fda56096a42dbc0eae4d35a5/hmachine/src/main/java/org/hortonmachine/hmachine/modules/hydrogeomorphology/energybalance/OmsEnergyBalance.java#L689-L730 | train |
TheHortonMachine/hortonmachine | gears/src/main/java/org/hortonmachine/gears/utils/style/sld/RequestUtils.java | RequestUtils.getBufferedXMLReader | public static BufferedReader getBufferedXMLReader(InputStream stream, int xmlLookahead)
throws IOException {
// create a buffer so we can reset the input stream
BufferedInputStream input = new BufferedInputStream(stream);
input.mark(xmlLookahead);
// create object to hold e... | java | public static BufferedReader getBufferedXMLReader(InputStream stream, int xmlLookahead)
throws IOException {
// create a buffer so we can reset the input stream
BufferedInputStream input = new BufferedInputStream(stream);
input.mark(xmlLookahead);
// create object to hold e... | [
"public",
"static",
"BufferedReader",
"getBufferedXMLReader",
"(",
"InputStream",
"stream",
",",
"int",
"xmlLookahead",
")",
"throws",
"IOException",
"{",
"// create a buffer so we can reset the input stream",
"BufferedInputStream",
"input",
"=",
"new",
"BufferedInputStream",
... | Wraps an xml input xstream in a buffered reader specifying a lookahead that can be used to
preparse some of the xml document, resetting it back to its original state for actual
parsing.
@param stream The original xml stream.
@param xmlLookahead The number of bytes to support for parse. If more than this number of
byte... | [
"Wraps",
"an",
"xml",
"input",
"xstream",
"in",
"a",
"buffered",
"reader",
"specifying",
"a",
"lookahead",
"that",
"can",
"be",
"used",
"to",
"preparse",
"some",
"of",
"the",
"xml",
"document",
"resetting",
"it",
"back",
"to",
"its",
"original",
"state",
"... | d2b436bbdf951dc1fda56096a42dbc0eae4d35a5 | https://github.com/TheHortonMachine/hortonmachine/blob/d2b436bbdf951dc1fda56096a42dbc0eae4d35a5/gears/src/main/java/org/hortonmachine/gears/utils/style/sld/RequestUtils.java#L212-L232 | train |
TheHortonMachine/hortonmachine | gears/src/main/java/org/hortonmachine/gears/utils/style/sld/RequestUtils.java | RequestUtils.getBufferedXMLReader | public static BufferedReader getBufferedXMLReader(Reader reader, int xmlLookahead)
throws IOException {
// ensure the reader is a buffered reader
if (!(reader instanceof BufferedReader)) {
reader = new BufferedReader(reader);
}
// mark the input stream
r... | java | public static BufferedReader getBufferedXMLReader(Reader reader, int xmlLookahead)
throws IOException {
// ensure the reader is a buffered reader
if (!(reader instanceof BufferedReader)) {
reader = new BufferedReader(reader);
}
// mark the input stream
r... | [
"public",
"static",
"BufferedReader",
"getBufferedXMLReader",
"(",
"Reader",
"reader",
",",
"int",
"xmlLookahead",
")",
"throws",
"IOException",
"{",
"// ensure the reader is a buffered reader",
"if",
"(",
"!",
"(",
"reader",
"instanceof",
"BufferedReader",
")",
")",
... | Wraps an xml reader in a buffered reader specifying a lookahead that can be used to preparse
some of the xml document, resetting it back to its original state for actual parsing.
@param reader The original xml reader.
@param xmlLookahead The number of bytes to support for parse. If more than this number of
bytes are p... | [
"Wraps",
"an",
"xml",
"reader",
"in",
"a",
"buffered",
"reader",
"specifying",
"a",
"lookahead",
"that",
"can",
"be",
"used",
"to",
"preparse",
"some",
"of",
"the",
"xml",
"document",
"resetting",
"it",
"back",
"to",
"its",
"original",
"state",
"for",
"act... | d2b436bbdf951dc1fda56096a42dbc0eae4d35a5 | https://github.com/TheHortonMachine/hortonmachine/blob/d2b436bbdf951dc1fda56096a42dbc0eae4d35a5/gears/src/main/java/org/hortonmachine/gears/utils/style/sld/RequestUtils.java#L243-L255 | train |
TheHortonMachine/hortonmachine | gears/src/main/java/org/hortonmachine/gears/utils/math/interpolation/LeastSquaresInterpolator.java | LeastSquaresInterpolator.validateCoefficients | private void validateCoefficients() {
if (coefsValid)
return;
if (n >= 2) {
double xBar = (double) sumX / n;
double yBar = (double) sumY / n;
a1 = (double) ((n * sumXY - sumX * sumY) / (n * sumXX - sumX * sumX));
a0 = (double) (yBar - a1 * xB... | java | private void validateCoefficients() {
if (coefsValid)
return;
if (n >= 2) {
double xBar = (double) sumX / n;
double yBar = (double) sumY / n;
a1 = (double) ((n * sumXY - sumX * sumY) / (n * sumXX - sumX * sumX));
a0 = (double) (yBar - a1 * xB... | [
"private",
"void",
"validateCoefficients",
"(",
")",
"{",
"if",
"(",
"coefsValid",
")",
"return",
";",
"if",
"(",
"n",
">=",
"2",
")",
"{",
"double",
"xBar",
"=",
"(",
"double",
")",
"sumX",
"/",
"n",
";",
"double",
"yBar",
"=",
"(",
"double",
")",... | Validate the coefficients. | [
"Validate",
"the",
"coefficients",
"."
] | d2b436bbdf951dc1fda56096a42dbc0eae4d35a5 | https://github.com/TheHortonMachine/hortonmachine/blob/d2b436bbdf951dc1fda56096a42dbc0eae4d35a5/gears/src/main/java/org/hortonmachine/gears/utils/math/interpolation/LeastSquaresInterpolator.java#L91-L106 | train |
TheHortonMachine/hortonmachine | gears/src/main/java/org/hortonmachine/gears/io/dxfdwg/libs/dxf/DxfFile.java | DxfFile.initializeDXF_SCHEMA | public static synchronized void initializeDXF_SCHEMA( CoordinateReferenceSystem crs ) {
if (DXF_POINTSCHEMA != null && DXF_POINTSCHEMA.getAttributeCount() != 0)
return;
SimpleFeatureTypeBuilder b = new SimpleFeatureTypeBuilder();
b.setName("dxfpointfile");
b.setCRS(crs);
... | java | public static synchronized void initializeDXF_SCHEMA( CoordinateReferenceSystem crs ) {
if (DXF_POINTSCHEMA != null && DXF_POINTSCHEMA.getAttributeCount() != 0)
return;
SimpleFeatureTypeBuilder b = new SimpleFeatureTypeBuilder();
b.setName("dxfpointfile");
b.setCRS(crs);
... | [
"public",
"static",
"synchronized",
"void",
"initializeDXF_SCHEMA",
"(",
"CoordinateReferenceSystem",
"crs",
")",
"{",
"if",
"(",
"DXF_POINTSCHEMA",
"!=",
"null",
"&&",
"DXF_POINTSCHEMA",
".",
"getAttributeCount",
"(",
")",
"!=",
"0",
")",
"return",
";",
"SimpleFe... | Initialize a JUMP FeatureSchema to load dxf data keeping some graphic
attributes. | [
"Initialize",
"a",
"JUMP",
"FeatureSchema",
"to",
"load",
"dxf",
"data",
"keeping",
"some",
"graphic",
"attributes",
"."
] | d2b436bbdf951dc1fda56096a42dbc0eae4d35a5 | https://github.com/TheHortonMachine/hortonmachine/blob/d2b436bbdf951dc1fda56096a42dbc0eae4d35a5/gears/src/main/java/org/hortonmachine/gears/io/dxfdwg/libs/dxf/DxfFile.java#L115-L161 | train |
TheHortonMachine/hortonmachine | gears/src/main/java/oms3/compiler/JavaFileManagerClassLoader.java | JavaFileManagerClassLoader.readClassData | private byte[] readClassData(JavaFileObject classFile) throws IOException {
ByteArrayOutputStream bos = new ByteArrayOutputStream();
byte[] buf = new byte[4096];
InputStream classStream = classFile.openInputStream();
int n = classStream.read(buf);
while (n > 0) {
bos.... | java | private byte[] readClassData(JavaFileObject classFile) throws IOException {
ByteArrayOutputStream bos = new ByteArrayOutputStream();
byte[] buf = new byte[4096];
InputStream classStream = classFile.openInputStream();
int n = classStream.read(buf);
while (n > 0) {
bos.... | [
"private",
"byte",
"[",
"]",
"readClassData",
"(",
"JavaFileObject",
"classFile",
")",
"throws",
"IOException",
"{",
"ByteArrayOutputStream",
"bos",
"=",
"new",
"ByteArrayOutputStream",
"(",
")",
";",
"byte",
"[",
"]",
"buf",
"=",
"new",
"byte",
"[",
"4096",
... | Reads all class file data into a byte array from the given file
object.
@param classFile the class file to read.
@return the class data.
@throws IOException if an I/O error occurs. | [
"Reads",
"all",
"class",
"file",
"data",
"into",
"a",
"byte",
"array",
"from",
"the",
"given",
"file",
"object",
"."
] | d2b436bbdf951dc1fda56096a42dbc0eae4d35a5 | https://github.com/TheHortonMachine/hortonmachine/blob/d2b436bbdf951dc1fda56096a42dbc0eae4d35a5/gears/src/main/java/oms3/compiler/JavaFileManagerClassLoader.java#L62-L73 | train |
TheHortonMachine/hortonmachine | gears/src/main/java/org/hortonmachine/gears/utils/style/StyleUtilities.java | StyleUtilities.getAllMarksArray | public static String[] getAllMarksArray() {
Set<String> keySet = markNamesToDef.keySet();
return (String[]) keySet.toArray(new String[keySet.size()]);
} | java | public static String[] getAllMarksArray() {
Set<String> keySet = markNamesToDef.keySet();
return (String[]) keySet.toArray(new String[keySet.size()]);
} | [
"public",
"static",
"String",
"[",
"]",
"getAllMarksArray",
"(",
")",
"{",
"Set",
"<",
"String",
">",
"keySet",
"=",
"markNamesToDef",
".",
"keySet",
"(",
")",
";",
"return",
"(",
"String",
"[",
"]",
")",
"keySet",
".",
"toArray",
"(",
"new",
"String",... | Getter for an array of all available marks.
@return all mark names (for gui use). | [
"Getter",
"for",
"an",
"array",
"of",
"all",
"available",
"marks",
"."
] | d2b436bbdf951dc1fda56096a42dbc0eae4d35a5 | https://github.com/TheHortonMachine/hortonmachine/blob/d2b436bbdf951dc1fda56096a42dbc0eae4d35a5/gears/src/main/java/org/hortonmachine/gears/utils/style/StyleUtilities.java#L172-L175 | train |
TheHortonMachine/hortonmachine | gears/src/main/java/org/hortonmachine/gears/utils/style/StyleUtilities.java | StyleUtilities.substituteMark | public static void substituteMark( Rule rule, String wellKnownMarkName ) {
PointSymbolizer pointSymbolizer = StyleUtilities.pointSymbolizerFromRule(rule);
Mark oldMark = SLD.mark(pointSymbolizer);
Graphic graphic = SLD.graphic(pointSymbolizer);
graphic.graphicalSymbols().clear();
... | java | public static void substituteMark( Rule rule, String wellKnownMarkName ) {
PointSymbolizer pointSymbolizer = StyleUtilities.pointSymbolizerFromRule(rule);
Mark oldMark = SLD.mark(pointSymbolizer);
Graphic graphic = SLD.graphic(pointSymbolizer);
graphic.graphicalSymbols().clear();
... | [
"public",
"static",
"void",
"substituteMark",
"(",
"Rule",
"rule",
",",
"String",
"wellKnownMarkName",
")",
"{",
"PointSymbolizer",
"pointSymbolizer",
"=",
"StyleUtilities",
".",
"pointSymbolizerFromRule",
"(",
"rule",
")",
";",
"Mark",
"oldMark",
"=",
"SLD",
".",... | Change the mark shape in a rule.
@param rule the rule of which the mark has to be changed.
@param wellKnownMarkName the name of the new mark. | [
"Change",
"the",
"mark",
"shape",
"in",
"a",
"rule",
"."
] | d2b436bbdf951dc1fda56096a42dbc0eae4d35a5 | https://github.com/TheHortonMachine/hortonmachine/blob/d2b436bbdf951dc1fda56096a42dbc0eae4d35a5/gears/src/main/java/org/hortonmachine/gears/utils/style/StyleUtilities.java#L575-L589 | train |
TheHortonMachine/hortonmachine | gears/src/main/java/org/hortonmachine/gears/utils/style/StyleUtilities.java | StyleUtilities.substituteExternalGraphics | public static void substituteExternalGraphics( Rule rule, URL externalGraphicsUrl ) {
String urlString = externalGraphicsUrl.toString();
String format = "";
if (urlString.toLowerCase().endsWith(".png")) {
format = "image/png";
} else if (urlString.toLowerCase().endsWith(".jpg... | java | public static void substituteExternalGraphics( Rule rule, URL externalGraphicsUrl ) {
String urlString = externalGraphicsUrl.toString();
String format = "";
if (urlString.toLowerCase().endsWith(".png")) {
format = "image/png";
} else if (urlString.toLowerCase().endsWith(".jpg... | [
"public",
"static",
"void",
"substituteExternalGraphics",
"(",
"Rule",
"rule",
",",
"URL",
"externalGraphicsUrl",
")",
"{",
"String",
"urlString",
"=",
"externalGraphicsUrl",
".",
"toString",
"(",
")",
";",
"String",
"format",
"=",
"\"\"",
";",
"if",
"(",
"url... | Change the external graphic in a rule.
@param rule the rule of which the external graphic has to be changed.
@param path the path of the image. | [
"Change",
"the",
"external",
"graphic",
"in",
"a",
"rule",
"."
] | d2b436bbdf951dc1fda56096a42dbc0eae4d35a5 | https://github.com/TheHortonMachine/hortonmachine/blob/d2b436bbdf951dc1fda56096a42dbc0eae4d35a5/gears/src/main/java/org/hortonmachine/gears/utils/style/StyleUtilities.java#L597-L621 | train |
TheHortonMachine/hortonmachine | gears/src/main/java/org/hortonmachine/gears/utils/style/StyleUtilities.java | StyleUtilities.changeMarkSize | public static void changeMarkSize( Rule rule, int newSize ) {
PointSymbolizer pointSymbolizer = StyleUtilities.pointSymbolizerFromRule(rule);
Graphic graphic = SLD.graphic(pointSymbolizer);
graphic.setSize(ff.literal(newSize));
// Mark oldMark = SLDs.mark(pointSymbolizer);
// old... | java | public static void changeMarkSize( Rule rule, int newSize ) {
PointSymbolizer pointSymbolizer = StyleUtilities.pointSymbolizerFromRule(rule);
Graphic graphic = SLD.graphic(pointSymbolizer);
graphic.setSize(ff.literal(newSize));
// Mark oldMark = SLDs.mark(pointSymbolizer);
// old... | [
"public",
"static",
"void",
"changeMarkSize",
"(",
"Rule",
"rule",
",",
"int",
"newSize",
")",
"{",
"PointSymbolizer",
"pointSymbolizer",
"=",
"StyleUtilities",
".",
"pointSymbolizerFromRule",
"(",
"rule",
")",
";",
"Graphic",
"graphic",
"=",
"SLD",
".",
"graphi... | Changes the size of a mark inside a rule.
@param rule the {@link Rule}.
@param newSize the new size. | [
"Changes",
"the",
"size",
"of",
"a",
"mark",
"inside",
"a",
"rule",
"."
] | d2b436bbdf951dc1fda56096a42dbc0eae4d35a5 | https://github.com/TheHortonMachine/hortonmachine/blob/d2b436bbdf951dc1fda56096a42dbc0eae4d35a5/gears/src/main/java/org/hortonmachine/gears/utils/style/StyleUtilities.java#L666-L673 | train |
TheHortonMachine/hortonmachine | gears/src/main/java/org/hortonmachine/gears/utils/style/StyleUtilities.java | StyleUtilities.changeRotation | public static void changeRotation( Rule rule, int newRotation ) {
PointSymbolizer pointSymbolizer = StyleUtilities.pointSymbolizerFromRule(rule);
Graphic graphic = SLD.graphic(pointSymbolizer);
graphic.setRotation(ff.literal(newRotation));
// Mark oldMark = SLDs.mark(pointSymbolizer);
... | java | public static void changeRotation( Rule rule, int newRotation ) {
PointSymbolizer pointSymbolizer = StyleUtilities.pointSymbolizerFromRule(rule);
Graphic graphic = SLD.graphic(pointSymbolizer);
graphic.setRotation(ff.literal(newRotation));
// Mark oldMark = SLDs.mark(pointSymbolizer);
... | [
"public",
"static",
"void",
"changeRotation",
"(",
"Rule",
"rule",
",",
"int",
"newRotation",
")",
"{",
"PointSymbolizer",
"pointSymbolizer",
"=",
"StyleUtilities",
".",
"pointSymbolizerFromRule",
"(",
"rule",
")",
";",
"Graphic",
"graphic",
"=",
"SLD",
".",
"gr... | Changes the rotation value inside a rule.
@param rule the {@link Rule}.
@param newRotation the new rotation value in degrees. | [
"Changes",
"the",
"rotation",
"value",
"inside",
"a",
"rule",
"."
] | d2b436bbdf951dc1fda56096a42dbc0eae4d35a5 | https://github.com/TheHortonMachine/hortonmachine/blob/d2b436bbdf951dc1fda56096a42dbc0eae4d35a5/gears/src/main/java/org/hortonmachine/gears/utils/style/StyleUtilities.java#L681-L687 | train |
TheHortonMachine/hortonmachine | gears/src/main/java/org/hortonmachine/gears/utils/style/StyleUtilities.java | StyleUtilities.setOffset | @SuppressWarnings({"rawtypes", "unchecked"})
public static void setOffset( Symbolizer symbolizer, String text ) {
if (text.indexOf(',') == -1) {
return;
}
String[] split = text.split(",");
if (split.length != 2) {
return;
}
double xOffset = Dou... | java | @SuppressWarnings({"rawtypes", "unchecked"})
public static void setOffset( Symbolizer symbolizer, String text ) {
if (text.indexOf(',') == -1) {
return;
}
String[] split = text.split(",");
if (split.length != 2) {
return;
}
double xOffset = Dou... | [
"@",
"SuppressWarnings",
"(",
"{",
"\"rawtypes\"",
",",
"\"unchecked\"",
"}",
")",
"public",
"static",
"void",
"setOffset",
"(",
"Symbolizer",
"symbolizer",
",",
"String",
"text",
")",
"{",
"if",
"(",
"text",
".",
"indexOf",
"(",
"'",
"'",
")",
"==",
"-"... | Sets the offset in a symbolizer.
@param symbolizer the symbolizer.
@param text the text representing the offsets in the CSV form. | [
"Sets",
"the",
"offset",
"in",
"a",
"symbolizer",
"."
] | d2b436bbdf951dc1fda56096a42dbc0eae4d35a5 | https://github.com/TheHortonMachine/hortonmachine/blob/d2b436bbdf951dc1fda56096a42dbc0eae4d35a5/gears/src/main/java/org/hortonmachine/gears/utils/style/StyleUtilities.java#L721-L745 | train |
TheHortonMachine/hortonmachine | gears/src/main/java/org/hortonmachine/gears/utils/style/StyleUtilities.java | StyleUtilities.styleToString | public static String styleToString( Style style ) throws Exception {
StyledLayerDescriptor sld = sf.createStyledLayerDescriptor();
UserLayer layer = sf.createUserLayer();
layer.setLayerFeatureConstraints(new FeatureTypeConstraint[]{null});
sld.addStyledLayer(layer);
layer.addUser... | java | public static String styleToString( Style style ) throws Exception {
StyledLayerDescriptor sld = sf.createStyledLayerDescriptor();
UserLayer layer = sf.createUserLayer();
layer.setLayerFeatureConstraints(new FeatureTypeConstraint[]{null});
sld.addStyledLayer(layer);
layer.addUser... | [
"public",
"static",
"String",
"styleToString",
"(",
"Style",
"style",
")",
"throws",
"Exception",
"{",
"StyledLayerDescriptor",
"sld",
"=",
"sf",
".",
"createStyledLayerDescriptor",
"(",
")",
";",
"UserLayer",
"layer",
"=",
"sf",
".",
"createUserLayer",
"(",
")"... | Converts a style to its string representation to be written to file.
@param style the style to convert.
@return the style string.
@throws Exception | [
"Converts",
"a",
"style",
"to",
"its",
"string",
"representation",
"to",
"be",
"written",
"to",
"file",
"."
] | d2b436bbdf951dc1fda56096a42dbc0eae4d35a5 | https://github.com/TheHortonMachine/hortonmachine/blob/d2b436bbdf951dc1fda56096a42dbc0eae4d35a5/gears/src/main/java/org/hortonmachine/gears/utils/style/StyleUtilities.java#L898-L909 | train |
TheHortonMachine/hortonmachine | gears/src/main/java/org/hortonmachine/gears/utils/style/StyleUtilities.java | StyleUtilities.createStyleFromGraphic | public static StyleWrapper createStyleFromGraphic( File graphicsPath ) throws IOException {
String name = graphicsPath.getName();
ExternalGraphic exGraphic = null;
if (name.toLowerCase().endsWith(".png")) {
exGraphic = sf.createExternalGraphic(graphicsPath.toURI().toURL(), "image/png... | java | public static StyleWrapper createStyleFromGraphic( File graphicsPath ) throws IOException {
String name = graphicsPath.getName();
ExternalGraphic exGraphic = null;
if (name.toLowerCase().endsWith(".png")) {
exGraphic = sf.createExternalGraphic(graphicsPath.toURI().toURL(), "image/png... | [
"public",
"static",
"StyleWrapper",
"createStyleFromGraphic",
"(",
"File",
"graphicsPath",
")",
"throws",
"IOException",
"{",
"String",
"name",
"=",
"graphicsPath",
".",
"getName",
"(",
")",
";",
"ExternalGraphic",
"exGraphic",
"=",
"null",
";",
"if",
"(",
"name... | Generates a style based on a graphic.
@param graphicsPath the graphic.
@return the generated style.
@throws IOException | [
"Generates",
"a",
"style",
"based",
"on",
"a",
"graphic",
"."
] | d2b436bbdf951dc1fda56096a42dbc0eae4d35a5 | https://github.com/TheHortonMachine/hortonmachine/blob/d2b436bbdf951dc1fda56096a42dbc0eae4d35a5/gears/src/main/java/org/hortonmachine/gears/utils/style/StyleUtilities.java#L918-L953 | train |
TheHortonMachine/hortonmachine | gears/src/main/java/org/hortonmachine/gears/utils/style/StyleUtilities.java | StyleUtilities.getDash | public static float[] getDash( String dashStr ) {
if (dashStr == null) {
return null;
}
String[] dashSplit = dashStr.split(","); //$NON-NLS-1$
int size = dashSplit.length;
float[] dash = new float[size];
try {
for( int i = 0; i < dash.length; i++ )... | java | public static float[] getDash( String dashStr ) {
if (dashStr == null) {
return null;
}
String[] dashSplit = dashStr.split(","); //$NON-NLS-1$
int size = dashSplit.length;
float[] dash = new float[size];
try {
for( int i = 0; i < dash.length; i++ )... | [
"public",
"static",
"float",
"[",
"]",
"getDash",
"(",
"String",
"dashStr",
")",
"{",
"if",
"(",
"dashStr",
"==",
"null",
")",
"{",
"return",
"null",
";",
"}",
"String",
"[",
"]",
"dashSplit",
"=",
"dashStr",
".",
"split",
"(",
"\",\"",
")",
";",
"... | Returns a dash array from a dash string.
@param dashStr the dash string definition.
@return the dash array or null if the definition can't be parsed. | [
"Returns",
"a",
"dash",
"array",
"from",
"a",
"dash",
"string",
"."
] | d2b436bbdf951dc1fda56096a42dbc0eae4d35a5 | https://github.com/TheHortonMachine/hortonmachine/blob/d2b436bbdf951dc1fda56096a42dbc0eae4d35a5/gears/src/main/java/org/hortonmachine/gears/utils/style/StyleUtilities.java#L961-L976 | train |
TheHortonMachine/hortonmachine | gears/src/main/java/org/hortonmachine/gears/utils/style/StyleUtilities.java | StyleUtilities.getDashString | public static String getDashString( float[] dashArray ) {
StringBuilder sb = null;
for( float f : dashArray ) {
if (sb == null) {
sb = new StringBuilder(String.valueOf(f));
} else {
sb.append(",");
sb.append(String.valueOf(f));
... | java | public static String getDashString( float[] dashArray ) {
StringBuilder sb = null;
for( float f : dashArray ) {
if (sb == null) {
sb = new StringBuilder(String.valueOf(f));
} else {
sb.append(",");
sb.append(String.valueOf(f));
... | [
"public",
"static",
"String",
"getDashString",
"(",
"float",
"[",
"]",
"dashArray",
")",
"{",
"StringBuilder",
"sb",
"=",
"null",
";",
"for",
"(",
"float",
"f",
":",
"dashArray",
")",
"{",
"if",
"(",
"sb",
"==",
"null",
")",
"{",
"sb",
"=",
"new",
... | Converts teh array to string.
@param dashArray the dash array.
@return the converted string. | [
"Converts",
"teh",
"array",
"to",
"string",
"."
] | d2b436bbdf951dc1fda56096a42dbc0eae4d35a5 | https://github.com/TheHortonMachine/hortonmachine/blob/d2b436bbdf951dc1fda56096a42dbc0eae4d35a5/gears/src/main/java/org/hortonmachine/gears/utils/style/StyleUtilities.java#L984-L995 | train |
TheHortonMachine/hortonmachine | gears/src/main/java/org/hortonmachine/gears/utils/style/StyleUtilities.java | StyleUtilities.sld2awtJoin | public static int sld2awtJoin( String sldJoin ) {
if (sldJoin.equals(lineJoinNames[1])) {
return BasicStroke.JOIN_BEVEL;
} else if (sldJoin.equals("") || sldJoin.equals(lineJoinNames[2])) {
return BasicStroke.JOIN_MITER;
} else if (sldJoin.equals(lineJoinNames[3])) {
... | java | public static int sld2awtJoin( String sldJoin ) {
if (sldJoin.equals(lineJoinNames[1])) {
return BasicStroke.JOIN_BEVEL;
} else if (sldJoin.equals("") || sldJoin.equals(lineJoinNames[2])) {
return BasicStroke.JOIN_MITER;
} else if (sldJoin.equals(lineJoinNames[3])) {
... | [
"public",
"static",
"int",
"sld2awtJoin",
"(",
"String",
"sldJoin",
")",
"{",
"if",
"(",
"sldJoin",
".",
"equals",
"(",
"lineJoinNames",
"[",
"1",
"]",
")",
")",
"{",
"return",
"BasicStroke",
".",
"JOIN_BEVEL",
";",
"}",
"else",
"if",
"(",
"sldJoin",
"... | Convert a sld line join definition to the java awt value.
@param sldJoin the sld join string.
@return the awt value. | [
"Convert",
"a",
"sld",
"line",
"join",
"definition",
"to",
"the",
"java",
"awt",
"value",
"."
] | d2b436bbdf951dc1fda56096a42dbc0eae4d35a5 | https://github.com/TheHortonMachine/hortonmachine/blob/d2b436bbdf951dc1fda56096a42dbc0eae4d35a5/gears/src/main/java/org/hortonmachine/gears/utils/style/StyleUtilities.java#L1049-L1059 | train |
TheHortonMachine/hortonmachine | gears/src/main/java/org/hortonmachine/gears/utils/style/StyleUtilities.java | StyleUtilities.sld2awtCap | public static int sld2awtCap( String sldCap ) {
if (sldCap.equals("") || sldCap.equals(lineCapNames[1])) {
return BasicStroke.CAP_BUTT;
} else if (sldCap.equals(lineCapNames[2])) {
return BasicStroke.CAP_ROUND;
} else if (sldCap.equals(lineCapNames[3])) {
retu... | java | public static int sld2awtCap( String sldCap ) {
if (sldCap.equals("") || sldCap.equals(lineCapNames[1])) {
return BasicStroke.CAP_BUTT;
} else if (sldCap.equals(lineCapNames[2])) {
return BasicStroke.CAP_ROUND;
} else if (sldCap.equals(lineCapNames[3])) {
retu... | [
"public",
"static",
"int",
"sld2awtCap",
"(",
"String",
"sldCap",
")",
"{",
"if",
"(",
"sldCap",
".",
"equals",
"(",
"\"\"",
")",
"||",
"sldCap",
".",
"equals",
"(",
"lineCapNames",
"[",
"1",
"]",
")",
")",
"{",
"return",
"BasicStroke",
".",
"CAP_BUTT"... | Convert a sld line cap definition to the java awt value.
@param sldCap the sld cap string.
@return the awt value. | [
"Convert",
"a",
"sld",
"line",
"cap",
"definition",
"to",
"the",
"java",
"awt",
"value",
"."
] | d2b436bbdf951dc1fda56096a42dbc0eae4d35a5 | https://github.com/TheHortonMachine/hortonmachine/blob/d2b436bbdf951dc1fda56096a42dbc0eae4d35a5/gears/src/main/java/org/hortonmachine/gears/utils/style/StyleUtilities.java#L1067-L1077 | train |
TheHortonMachine/hortonmachine | gears/src/main/java/org/hortonmachine/gears/utils/TransformationUtils.java | TransformationUtils.scaleToWidth | public static Envelope scaleToWidth( Envelope original, double newWidth ) {
double width = original.getWidth();
double factor = newWidth / width;
double newHeight = original.getHeight() * factor;
return new Envelope(original.getMinX(), original.getMinX() + newWidth, original.getMinY(),... | java | public static Envelope scaleToWidth( Envelope original, double newWidth ) {
double width = original.getWidth();
double factor = newWidth / width;
double newHeight = original.getHeight() * factor;
return new Envelope(original.getMinX(), original.getMinX() + newWidth, original.getMinY(),... | [
"public",
"static",
"Envelope",
"scaleToWidth",
"(",
"Envelope",
"original",
",",
"double",
"newWidth",
")",
"{",
"double",
"width",
"=",
"original",
".",
"getWidth",
"(",
")",
";",
"double",
"factor",
"=",
"newWidth",
"/",
"width",
";",
"double",
"newHeight... | Scale an envelope to have a given width.
@param original the envelope.
@param newWidth the new width to use.
@return the scaled envelope placed in the original lower left corner position. | [
"Scale",
"an",
"envelope",
"to",
"have",
"a",
"given",
"width",
"."
] | d2b436bbdf951dc1fda56096a42dbc0eae4d35a5 | https://github.com/TheHortonMachine/hortonmachine/blob/d2b436bbdf951dc1fda56096a42dbc0eae4d35a5/gears/src/main/java/org/hortonmachine/gears/utils/TransformationUtils.java#L108-L116 | train |
TheHortonMachine/hortonmachine | gears/src/main/java/oms3/util/Times.java | Times.getDayOfYear | public static int getDayOfYear(Calendar cal, int type) {
int jday = cal.get(Calendar.DAY_OF_YEAR);
int mo = cal.get(java.util.Calendar.MONTH) + 1;
if (type == CALENDAR_YEAR) {
return jday;
} else if (type == SOLAR_YEAR) {
int day = cal.get(Calendar.DAY_OF_MONTH);
... | java | public static int getDayOfYear(Calendar cal, int type) {
int jday = cal.get(Calendar.DAY_OF_YEAR);
int mo = cal.get(java.util.Calendar.MONTH) + 1;
if (type == CALENDAR_YEAR) {
return jday;
} else if (type == SOLAR_YEAR) {
int day = cal.get(Calendar.DAY_OF_MONTH);
... | [
"public",
"static",
"int",
"getDayOfYear",
"(",
"Calendar",
"cal",
",",
"int",
"type",
")",
"{",
"int",
"jday",
"=",
"cal",
".",
"get",
"(",
"Calendar",
".",
"DAY_OF_YEAR",
")",
";",
"int",
"mo",
"=",
"cal",
".",
"get",
"(",
"java",
".",
"util",
".... | Get the Day of the year in WATER, SOLAR, or CALENDAR year. | [
"Get",
"the",
"Day",
"of",
"the",
"year",
"in",
"WATER",
"SOLAR",
"or",
"CALENDAR",
"year",
"."
] | d2b436bbdf951dc1fda56096a42dbc0eae4d35a5 | https://github.com/TheHortonMachine/hortonmachine/blob/d2b436bbdf951dc1fda56096a42dbc0eae4d35a5/gears/src/main/java/oms3/util/Times.java#L106-L118 | train |
TheHortonMachine/hortonmachine | gears/src/main/java/oms3/util/Times.java | Times.deltaHours | public static double deltaHours(int calUnit, int increments) {
if (calUnit == Calendar.DATE) {
return 24 * increments;
} else if (calUnit == Calendar.HOUR) {
return increments;
} else if (calUnit == Calendar.MINUTE) {
return increments / 60;
} else if ... | java | public static double deltaHours(int calUnit, int increments) {
if (calUnit == Calendar.DATE) {
return 24 * increments;
} else if (calUnit == Calendar.HOUR) {
return increments;
} else if (calUnit == Calendar.MINUTE) {
return increments / 60;
} else if ... | [
"public",
"static",
"double",
"deltaHours",
"(",
"int",
"calUnit",
",",
"int",
"increments",
")",
"{",
"if",
"(",
"calUnit",
"==",
"Calendar",
".",
"DATE",
")",
"{",
"return",
"24",
"*",
"increments",
";",
"}",
"else",
"if",
"(",
"calUnit",
"==",
"Cale... | This used to be 'deltim' in MMS. | [
"This",
"used",
"to",
"be",
"deltim",
"in",
"MMS",
"."
] | d2b436bbdf951dc1fda56096a42dbc0eae4d35a5 | https://github.com/TheHortonMachine/hortonmachine/blob/d2b436bbdf951dc1fda56096a42dbc0eae4d35a5/gears/src/main/java/oms3/util/Times.java#L142-L153 | train |
enasequence/sequencetools | src/main/java/uk/ac/ebi/embl/api/validation/check/feature/FeatureValidationCheck.java | FeatureValidationCheck.reportError | protected ValidationMessage<Origin> reportError(Origin origin, String messageKey,
Object... params) {
return reportMessage(Severity.ERROR, origin, messageKey, params);
} | java | protected ValidationMessage<Origin> reportError(Origin origin, String messageKey,
Object... params) {
return reportMessage(Severity.ERROR, origin, messageKey, params);
} | [
"protected",
"ValidationMessage",
"<",
"Origin",
">",
"reportError",
"(",
"Origin",
"origin",
",",
"String",
"messageKey",
",",
"Object",
"...",
"params",
")",
"{",
"return",
"reportMessage",
"(",
"Severity",
".",
"ERROR",
",",
"origin",
",",
"messageKey",
","... | Creates an error validation message for the feature and adds it to
the validation result.
@param origin the origin
@param messageKey a message key
@param params message parameters | [
"Creates",
"an",
"error",
"validation",
"message",
"for",
"the",
"feature",
"and",
"adds",
"it",
"to",
"the",
"validation",
"result",
"."
] | 4127f5e1a17540239f5810136153fbd6737fa262 | https://github.com/enasequence/sequencetools/blob/4127f5e1a17540239f5810136153fbd6737fa262/src/main/java/uk/ac/ebi/embl/api/validation/check/feature/FeatureValidationCheck.java#L67-L70 | train |
enasequence/sequencetools | src/main/java/uk/ac/ebi/embl/api/validation/check/feature/FeatureValidationCheck.java | FeatureValidationCheck.reportFeatureError | protected ValidationMessage<Origin> reportFeatureError(Origin origin, String messageKey, Feature feature,
Object... params) {
ValidationMessage<Origin> message = reportMessage(Severity.ERROR, origin, messageKey, params);
appendLocusTadAndGeneIDToMessage(feature, message);
return message;
... | java | protected ValidationMessage<Origin> reportFeatureError(Origin origin, String messageKey, Feature feature,
Object... params) {
ValidationMessage<Origin> message = reportMessage(Severity.ERROR, origin, messageKey, params);
appendLocusTadAndGeneIDToMessage(feature, message);
return message;
... | [
"protected",
"ValidationMessage",
"<",
"Origin",
">",
"reportFeatureError",
"(",
"Origin",
"origin",
",",
"String",
"messageKey",
",",
"Feature",
"feature",
",",
"Object",
"...",
"params",
")",
"{",
"ValidationMessage",
"<",
"Origin",
">",
"message",
"=",
"repor... | Creates an error validation message for the feature and adds it to
the validation result. If there are locus_tag or gene qualifiers the values of these will be added
to the message as a curator comment.
@param origin the origin
@param messageKey a message key
@param params message parameters | [
"Creates",
"an",
"error",
"validation",
"message",
"for",
"the",
"feature",
"and",
"adds",
"it",
"to",
"the",
"validation",
"result",
".",
"If",
"there",
"are",
"locus_tag",
"or",
"gene",
"qualifiers",
"the",
"values",
"of",
"these",
"will",
"be",
"added",
... | 4127f5e1a17540239f5810136153fbd6737fa262 | https://github.com/enasequence/sequencetools/blob/4127f5e1a17540239f5810136153fbd6737fa262/src/main/java/uk/ac/ebi/embl/api/validation/check/feature/FeatureValidationCheck.java#L81-L88 | train |
enasequence/sequencetools | src/main/java/uk/ac/ebi/embl/api/validation/check/feature/FeatureValidationCheck.java | FeatureValidationCheck.appendLocusTadAndGeneIDToMessage | public static void appendLocusTadAndGeneIDToMessage(Feature feature, ValidationMessage<Origin> message) {
if (SequenceEntryUtils.isQualifierAvailable(Qualifier.LOCUS_TAG_QUALIFIER_NAME, feature)) {
Qualifier locusTag = SequenceEntryUtils.getQualifier(Qualifier.LOCUS_TAG_QUALIFIER_NAME, feature);
... | java | public static void appendLocusTadAndGeneIDToMessage(Feature feature, ValidationMessage<Origin> message) {
if (SequenceEntryUtils.isQualifierAvailable(Qualifier.LOCUS_TAG_QUALIFIER_NAME, feature)) {
Qualifier locusTag = SequenceEntryUtils.getQualifier(Qualifier.LOCUS_TAG_QUALIFIER_NAME, feature);
... | [
"public",
"static",
"void",
"appendLocusTadAndGeneIDToMessage",
"(",
"Feature",
"feature",
",",
"ValidationMessage",
"<",
"Origin",
">",
"message",
")",
"{",
"if",
"(",
"SequenceEntryUtils",
".",
"isQualifierAvailable",
"(",
"Qualifier",
".",
"LOCUS_TAG_QUALIFIER_NAME",... | If a feature had locus_tag or gene qualifiers - appends the value of these to the message as a curator
comment. Useful for some submitters who want more of a handle on the origin than just a line number.
@param feature
@param message | [
"If",
"a",
"feature",
"had",
"locus_tag",
"or",
"gene",
"qualifiers",
"-",
"appends",
"the",
"value",
"of",
"these",
"to",
"the",
"message",
"as",
"a",
"curator",
"comment",
".",
"Useful",
"for",
"some",
"submitters",
"who",
"want",
"more",
"of",
"a",
"h... | 4127f5e1a17540239f5810136153fbd6737fa262 | https://github.com/enasequence/sequencetools/blob/4127f5e1a17540239f5810136153fbd6737fa262/src/main/java/uk/ac/ebi/embl/api/validation/check/feature/FeatureValidationCheck.java#L97-L111 | train |
enasequence/sequencetools | src/main/java/uk/ac/ebi/embl/api/validation/check/feature/FeatureValidationCheck.java | FeatureValidationCheck.reportWarning | protected ValidationMessage<Origin> reportWarning(Origin origin, String messageKey,
Object... params) {
return reportMessage(Severity.WARNING, origin, messageKey, params);
} | java | protected ValidationMessage<Origin> reportWarning(Origin origin, String messageKey,
Object... params) {
return reportMessage(Severity.WARNING, origin, messageKey, params);
} | [
"protected",
"ValidationMessage",
"<",
"Origin",
">",
"reportWarning",
"(",
"Origin",
"origin",
",",
"String",
"messageKey",
",",
"Object",
"...",
"params",
")",
"{",
"return",
"reportMessage",
"(",
"Severity",
".",
"WARNING",
",",
"origin",
",",
"messageKey",
... | Creates a warning validation message for the feature and adds it to
the validation result.
@param origin the origin
@param messageKey a message key
@param params message parameters | [
"Creates",
"a",
"warning",
"validation",
"message",
"for",
"the",
"feature",
"and",
"adds",
"it",
"to",
"the",
"validation",
"result",
"."
] | 4127f5e1a17540239f5810136153fbd6737fa262 | https://github.com/enasequence/sequencetools/blob/4127f5e1a17540239f5810136153fbd6737fa262/src/main/java/uk/ac/ebi/embl/api/validation/check/feature/FeatureValidationCheck.java#L121-L124 | train |
enasequence/sequencetools | src/main/java/uk/ac/ebi/embl/api/validation/check/feature/FeatureValidationCheck.java | FeatureValidationCheck.reportMessage | protected ValidationMessage<Origin> reportMessage(Severity severity, Origin origin,
String messageKey, Object... params) {
ValidationMessage<Origin> message = EntryValidations.createMessage(origin, severity, messageKey, params);
message.getMessage();
// System.out.println("message = " + messag... | java | protected ValidationMessage<Origin> reportMessage(Severity severity, Origin origin,
String messageKey, Object... params) {
ValidationMessage<Origin> message = EntryValidations.createMessage(origin, severity, messageKey, params);
message.getMessage();
// System.out.println("message = " + messag... | [
"protected",
"ValidationMessage",
"<",
"Origin",
">",
"reportMessage",
"(",
"Severity",
"severity",
",",
"Origin",
"origin",
",",
"String",
"messageKey",
",",
"Object",
"...",
"params",
")",
"{",
"ValidationMessage",
"<",
"Origin",
">",
"message",
"=",
"EntryVal... | Creates a validation message for the feature and adds it to
the validation result.
@param severity message severity
@param origin the origin
@param messageKey a message key
@param params message parameters | [
"Creates",
"a",
"validation",
"message",
"for",
"the",
"feature",
"and",
"adds",
"it",
"to",
"the",
"validation",
"result",
"."
] | 4127f5e1a17540239f5810136153fbd6737fa262 | https://github.com/enasequence/sequencetools/blob/4127f5e1a17540239f5810136153fbd6737fa262/src/main/java/uk/ac/ebi/embl/api/validation/check/feature/FeatureValidationCheck.java#L135-L142 | train |
TheHortonMachine/hortonmachine | gears/src/main/java/org/hortonmachine/gears/modules/v/smoothing/OmsLineSmootherMcMaster.java | OmsLineSmootherMcMaster.isAlone | private boolean isAlone( Geometry geometryN ) {
Coordinate[] coordinates = geometryN.getCoordinates();
if (coordinates.length > 1) {
Coordinate first = coordinates[0];
Coordinate last = coordinates[coordinates.length - 1];
for( SimpleFeature line : linesList ) {
... | java | private boolean isAlone( Geometry geometryN ) {
Coordinate[] coordinates = geometryN.getCoordinates();
if (coordinates.length > 1) {
Coordinate first = coordinates[0];
Coordinate last = coordinates[coordinates.length - 1];
for( SimpleFeature line : linesList ) {
... | [
"private",
"boolean",
"isAlone",
"(",
"Geometry",
"geometryN",
")",
"{",
"Coordinate",
"[",
"]",
"coordinates",
"=",
"geometryN",
".",
"getCoordinates",
"(",
")",
";",
"if",
"(",
"coordinates",
".",
"length",
">",
"1",
")",
"{",
"Coordinate",
"first",
"=",... | Checks if the given geometry is connected to any other line.
@param geometryN the geometry to test.
@return true if the geometry is alone in the space, i.e. not connected at
one of the ends to any other geometry. | [
"Checks",
"if",
"the",
"given",
"geometry",
"is",
"connected",
"to",
"any",
"other",
"line",
"."
] | d2b436bbdf951dc1fda56096a42dbc0eae4d35a5 | https://github.com/TheHortonMachine/hortonmachine/blob/d2b436bbdf951dc1fda56096a42dbc0eae4d35a5/gears/src/main/java/org/hortonmachine/gears/modules/v/smoothing/OmsLineSmootherMcMaster.java#L205-L231 | train |
TheHortonMachine/hortonmachine | gears/src/main/java/org/hortonmachine/gears/modules/v/smoothing/OmsLineSmootherMcMaster.java | OmsLineSmootherMcMaster.defaultSmoothShapefile | public static void defaultSmoothShapefile( String shapePath, String outPath ) throws Exception {
PrintStreamProgressMonitor pm = new PrintStreamProgressMonitor(System.out, System.err);
SimpleFeatureCollection initialFC = OmsShapefileFeatureReader.readShapefile(shapePath);
OmsLineSmootherMcMaste... | java | public static void defaultSmoothShapefile( String shapePath, String outPath ) throws Exception {
PrintStreamProgressMonitor pm = new PrintStreamProgressMonitor(System.out, System.err);
SimpleFeatureCollection initialFC = OmsShapefileFeatureReader.readShapefile(shapePath);
OmsLineSmootherMcMaste... | [
"public",
"static",
"void",
"defaultSmoothShapefile",
"(",
"String",
"shapePath",
",",
"String",
"outPath",
")",
"throws",
"Exception",
"{",
"PrintStreamProgressMonitor",
"pm",
"=",
"new",
"PrintStreamProgressMonitor",
"(",
"System",
".",
"out",
",",
"System",
".",
... | An utility method to use the module with default values and shapefiles.
<p>
This will use the windowed average and a density of 0.2, simplification threshold of 0.1
and a lookahead of 13, as well as a length filter of 10.
</p>
@param shapePath the input file.
@param outPath the output smoothed path.
@throws Exception | [
"An",
"utility",
"method",
"to",
"use",
"the",
"module",
"with",
"default",
"values",
"and",
"shapefiles",
"."
] | d2b436bbdf951dc1fda56096a42dbc0eae4d35a5 | https://github.com/TheHortonMachine/hortonmachine/blob/d2b436bbdf951dc1fda56096a42dbc0eae4d35a5/gears/src/main/java/org/hortonmachine/gears/modules/v/smoothing/OmsLineSmootherMcMaster.java#L245-L262 | train |
TheHortonMachine/hortonmachine | gears/src/main/java/org/hortonmachine/gears/utils/clustering/GvmVectorSpace.java | GvmVectorSpace.magnitudeSqr | @Override
public double magnitudeSqr( Object pt ) {
double sum = 0.0;
double[] coords = coords(pt);
for( int i = 0; i < dimensions; i++ ) {
double c = coords[i];
sum += c * c;
}
return sum;
} | java | @Override
public double magnitudeSqr( Object pt ) {
double sum = 0.0;
double[] coords = coords(pt);
for( int i = 0; i < dimensions; i++ ) {
double c = coords[i];
sum += c * c;
}
return sum;
} | [
"@",
"Override",
"public",
"double",
"magnitudeSqr",
"(",
"Object",
"pt",
")",
"{",
"double",
"sum",
"=",
"0.0",
";",
"double",
"[",
"]",
"coords",
"=",
"coords",
"(",
"pt",
")",
";",
"for",
"(",
"int",
"i",
"=",
"0",
";",
"i",
"<",
"dimensions",
... | space point operations | [
"space",
"point",
"operations"
] | d2b436bbdf951dc1fda56096a42dbc0eae4d35a5 | https://github.com/TheHortonMachine/hortonmachine/blob/d2b436bbdf951dc1fda56096a42dbc0eae4d35a5/gears/src/main/java/org/hortonmachine/gears/utils/clustering/GvmVectorSpace.java#L45-L54 | train |
codahale/xsalsa20poly1305 | src/main/java/com/codahale/xsalsa20poly1305/Keys.java | Keys.generateSecretKey | public static byte[] generateSecretKey() {
final byte[] k = new byte[KEY_LEN];
final SecureRandom random = new SecureRandom();
random.nextBytes(k);
return k;
} | java | public static byte[] generateSecretKey() {
final byte[] k = new byte[KEY_LEN];
final SecureRandom random = new SecureRandom();
random.nextBytes(k);
return k;
} | [
"public",
"static",
"byte",
"[",
"]",
"generateSecretKey",
"(",
")",
"{",
"final",
"byte",
"[",
"]",
"k",
"=",
"new",
"byte",
"[",
"KEY_LEN",
"]",
";",
"final",
"SecureRandom",
"random",
"=",
"new",
"SecureRandom",
"(",
")",
";",
"random",
".",
"nextBy... | Generates a 32-byte secret key.
@return a 32-byte secret key | [
"Generates",
"a",
"32",
"-",
"byte",
"secret",
"key",
"."
] | f3c1ab2f05b17df137ed8fbb66da2b417066729a | https://github.com/codahale/xsalsa20poly1305/blob/f3c1ab2f05b17df137ed8fbb66da2b417066729a/src/main/java/com/codahale/xsalsa20poly1305/Keys.java#L36-L41 | train |
enasequence/sequencetools | src/main/java/uk/ac/ebi/embl/api/checksum/CRC32.java | CRC32.initialize | private static void initialize()
{
for (int i = 0; i < 256; ++i)
{
long crc = i;
for (int j = 8; j > 0; j--)
{
if ((crc & 1) == 1)
crc = (crc >>> 1) ^ polynomial;
else
crc >>>= 1;
}
values[i] = crc;
}
init_done = true;
} | java | private static void initialize()
{
for (int i = 0; i < 256; ++i)
{
long crc = i;
for (int j = 8; j > 0; j--)
{
if ((crc & 1) == 1)
crc = (crc >>> 1) ^ polynomial;
else
crc >>>= 1;
}
values[i] = crc;
}
init_done = true;
} | [
"private",
"static",
"void",
"initialize",
"(",
")",
"{",
"for",
"(",
"int",
"i",
"=",
"0",
";",
"i",
"<",
"256",
";",
"++",
"i",
")",
"{",
"long",
"crc",
"=",
"i",
";",
"for",
"(",
"int",
"j",
"=",
"8",
";",
"j",
">",
"0",
";",
"j",
"--"... | Calculates a CRC value for a byte to be used by CRC calculation
functions. | [
"Calculates",
"a",
"CRC",
"value",
"for",
"a",
"byte",
"to",
"be",
"used",
"by",
"CRC",
"calculation",
"functions",
"."
] | 4127f5e1a17540239f5810136153fbd6737fa262 | https://github.com/enasequence/sequencetools/blob/4127f5e1a17540239f5810136153fbd6737fa262/src/main/java/uk/ac/ebi/embl/api/checksum/CRC32.java#L29-L44 | train |
enasequence/sequencetools | src/main/java/uk/ac/ebi/embl/api/checksum/CRC32.java | CRC32.calculateCRC32 | public static long calculateCRC32(byte[] buffer, int offset, int length)
{
if (!init_done)
{
initialize();
}
for (int i = offset; i < offset + length; i++)
{
long tmp1 = (crc >>> 8) & 0x00FFFFFFL;
long tmp2 = values[(int) ((crc ^ Character.toUpperCase((char) buffer[i])) & 0xff)];
crc = tmp1 ^ tmp... | java | public static long calculateCRC32(byte[] buffer, int offset, int length)
{
if (!init_done)
{
initialize();
}
for (int i = offset; i < offset + length; i++)
{
long tmp1 = (crc >>> 8) & 0x00FFFFFFL;
long tmp2 = values[(int) ((crc ^ Character.toUpperCase((char) buffer[i])) & 0xff)];
crc = tmp1 ^ tmp... | [
"public",
"static",
"long",
"calculateCRC32",
"(",
"byte",
"[",
"]",
"buffer",
",",
"int",
"offset",
",",
"int",
"length",
")",
"{",
"if",
"(",
"!",
"init_done",
")",
"{",
"initialize",
"(",
")",
";",
"}",
"for",
"(",
"int",
"i",
"=",
"offset",
";"... | Calculates the CRC-32 of a block of data all at once | [
"Calculates",
"the",
"CRC",
"-",
"32",
"of",
"a",
"block",
"of",
"data",
"all",
"at",
"once"
] | 4127f5e1a17540239f5810136153fbd6737fa262 | https://github.com/enasequence/sequencetools/blob/4127f5e1a17540239f5810136153fbd6737fa262/src/main/java/uk/ac/ebi/embl/api/checksum/CRC32.java#L49-L63 | train |
TheHortonMachine/hortonmachine | gears/src/main/java/oms3/dsl/Model.java | Model.getClassLoader | private synchronized URLClassLoader getClassLoader() {
if (modelClassLoader == null) {
List<File> jars = res.filterFiles("jar"); // jars as defined in
List<File> cli_jars = getExtraResources(); // cli extra jars
List<File> dirs = res.filterDirectories(); // testing
... | java | private synchronized URLClassLoader getClassLoader() {
if (modelClassLoader == null) {
List<File> jars = res.filterFiles("jar"); // jars as defined in
List<File> cli_jars = getExtraResources(); // cli extra jars
List<File> dirs = res.filterDirectories(); // testing
... | [
"private",
"synchronized",
"URLClassLoader",
"getClassLoader",
"(",
")",
"{",
"if",
"(",
"modelClassLoader",
"==",
"null",
")",
"{",
"List",
"<",
"File",
">",
"jars",
"=",
"res",
".",
"filterFiles",
"(",
"\"jar\"",
")",
";",
"// jars as defined in",
"List",
... | get the URL class loader for all the resources (just for jar files
@return
@throws Exception | [
"get",
"the",
"URL",
"class",
"loader",
"for",
"all",
"the",
"resources",
"(",
"just",
"for",
"jar",
"files"
] | d2b436bbdf951dc1fda56096a42dbc0eae4d35a5 | https://github.com/TheHortonMachine/hortonmachine/blob/d2b436bbdf951dc1fda56096a42dbc0eae4d35a5/gears/src/main/java/oms3/dsl/Model.java#L144-L181 | train |
TheHortonMachine/hortonmachine | dbs/src/main/java/org/hortonmachine/dbs/utils/CommonQueries.java | CommonQueries.getDistanceBetween | public static double getDistanceBetween( IHMConnection connection, Coordinate p1, Coordinate p2, int srid ) throws Exception {
if (srid < 0) {
srid = 4326;
}
GeometryFactory gf = new GeometryFactory();
LineString lineString = gf.createLineString(new Coordinate[]{p1, p2});
... | java | public static double getDistanceBetween( IHMConnection connection, Coordinate p1, Coordinate p2, int srid ) throws Exception {
if (srid < 0) {
srid = 4326;
}
GeometryFactory gf = new GeometryFactory();
LineString lineString = gf.createLineString(new Coordinate[]{p1, p2});
... | [
"public",
"static",
"double",
"getDistanceBetween",
"(",
"IHMConnection",
"connection",
",",
"Coordinate",
"p1",
",",
"Coordinate",
"p2",
",",
"int",
"srid",
")",
"throws",
"Exception",
"{",
"if",
"(",
"srid",
"<",
"0",
")",
"{",
"srid",
"=",
"4326",
";",
... | Calculates the GeodesicLength between to points.
@param connection the database connection.
@param p1 the first point.
@param p2 the second point.
@param srid the srid. If <0, 4326 will be used. This needs to be a geographic prj.
@return the distance.
@throws Exception | [
"Calculates",
"the",
"GeodesicLength",
"between",
"to",
"points",
"."
] | d2b436bbdf951dc1fda56096a42dbc0eae4d35a5 | https://github.com/TheHortonMachine/hortonmachine/blob/d2b436bbdf951dc1fda56096a42dbc0eae4d35a5/dbs/src/main/java/org/hortonmachine/dbs/utils/CommonQueries.java#L157-L172 | train |
TheHortonMachine/hortonmachine | hmachine/src/main/java/org/hortonmachine/hmachine/modules/hydrogeomorphology/debrisvandre/OmsDebrisVandre.java | OmsDebrisVandre.moveToNextTriggerpoint | private boolean moveToNextTriggerpoint( RandomIter triggerIter, RandomIter flowIter, int[] flowDirColRow ) {
double tmpFlowValue = flowIter.getSampleDouble(flowDirColRow[0], flowDirColRow[1], 0);
if (tmpFlowValue == 10) {
return false;
}
if (!ModelsEngine.go_downstream(flowDi... | java | private boolean moveToNextTriggerpoint( RandomIter triggerIter, RandomIter flowIter, int[] flowDirColRow ) {
double tmpFlowValue = flowIter.getSampleDouble(flowDirColRow[0], flowDirColRow[1], 0);
if (tmpFlowValue == 10) {
return false;
}
if (!ModelsEngine.go_downstream(flowDi... | [
"private",
"boolean",
"moveToNextTriggerpoint",
"(",
"RandomIter",
"triggerIter",
",",
"RandomIter",
"flowIter",
",",
"int",
"[",
"]",
"flowDirColRow",
")",
"{",
"double",
"tmpFlowValue",
"=",
"flowIter",
".",
"getSampleDouble",
"(",
"flowDirColRow",
"[",
"0",
"]"... | Moves the flowDirColRow variable to the next trigger point.
@param triggerIter
@param flowDirColRow
@return <code>true</code> if a new trigger was found, <code>false</code> if the exit was reached. | [
"Moves",
"the",
"flowDirColRow",
"variable",
"to",
"the",
"next",
"trigger",
"point",
"."
] | d2b436bbdf951dc1fda56096a42dbc0eae4d35a5 | https://github.com/TheHortonMachine/hortonmachine/blob/d2b436bbdf951dc1fda56096a42dbc0eae4d35a5/hmachine/src/main/java/org/hortonmachine/hmachine/modules/hydrogeomorphology/debrisvandre/OmsDebrisVandre.java#L641-L659 | train |
TheHortonMachine/hortonmachine | gears/src/main/java/org/hortonmachine/gears/io/dxfdwg/libs/dwg/utils/ByteUtils.java | ByteUtils.memclr | public static void memclr( byte[] array, int offset, int length ) {
for( int i = 0; i < length; ++i, ++offset )
array[offset] = 0;
} | java | public static void memclr( byte[] array, int offset, int length ) {
for( int i = 0; i < length; ++i, ++offset )
array[offset] = 0;
} | [
"public",
"static",
"void",
"memclr",
"(",
"byte",
"[",
"]",
"array",
",",
"int",
"offset",
",",
"int",
"length",
")",
"{",
"for",
"(",
"int",
"i",
"=",
"0",
";",
"i",
"<",
"length",
";",
"++",
"i",
",",
"++",
"offset",
")",
"array",
"[",
"offs... | Fill the given array with zeros.
@param array the array to clear
@param offset the start offset
@param length the number of <code>byte</code>s to clear. | [
"Fill",
"the",
"given",
"array",
"with",
"zeros",
"."
] | d2b436bbdf951dc1fda56096a42dbc0eae4d35a5 | https://github.com/TheHortonMachine/hortonmachine/blob/d2b436bbdf951dc1fda56096a42dbc0eae4d35a5/gears/src/main/java/org/hortonmachine/gears/io/dxfdwg/libs/dwg/utils/ByteUtils.java#L534-L537 | train |
TheHortonMachine/hortonmachine | gears/src/main/java/org/hortonmachine/gears/io/dxfdwg/libs/dwg/utils/ByteUtils.java | ByteUtils.zero_pad | public static byte[] zero_pad( byte[] original, int block_size ) {
if ((original.length % block_size) == 0) {
return original;
}
byte[] result = new byte[round_up(original.length, block_size)];
memcpy(result, 0, original, 0, original.length);
// Unnecessary - jvm se... | java | public static byte[] zero_pad( byte[] original, int block_size ) {
if ((original.length % block_size) == 0) {
return original;
}
byte[] result = new byte[round_up(original.length, block_size)];
memcpy(result, 0, original, 0, original.length);
// Unnecessary - jvm se... | [
"public",
"static",
"byte",
"[",
"]",
"zero_pad",
"(",
"byte",
"[",
"]",
"original",
",",
"int",
"block_size",
")",
"{",
"if",
"(",
"(",
"original",
".",
"length",
"%",
"block_size",
")",
"==",
"0",
")",
"{",
"return",
"original",
";",
"}",
"byte",
... | Return a new array equal to original except zero-padded to an integral
mulitple of blocks. If the original is already an integral multiple of
blocks, just return it.
@param original the array of <code>byte</code>s to be padded
@param block_size the size of the blocks
@return an array whose size divides <code>block_s... | [
"Return",
"a",
"new",
"array",
"equal",
"to",
"original",
"except",
"zero",
"-",
"padded",
"to",
"an",
"integral",
"mulitple",
"of",
"blocks",
".",
"If",
"the",
"original",
"is",
"already",
"an",
"integral",
"multiple",
"of",
"blocks",
"just",
"return",
"i... | d2b436bbdf951dc1fda56096a42dbc0eae4d35a5 | https://github.com/TheHortonMachine/hortonmachine/blob/d2b436bbdf951dc1fda56096a42dbc0eae4d35a5/gears/src/main/java/org/hortonmachine/gears/io/dxfdwg/libs/dwg/utils/ByteUtils.java#L565-L576 | train |
TheHortonMachine/hortonmachine | gears/src/main/java/org/hortonmachine/gears/utils/DataUtilities.java | DataUtilities.isSupportedVectorExtension | public static boolean isSupportedVectorExtension( String name ) {
for( String ext : supportedVectors ) {
if (name.toLowerCase().endsWith(ext)) {
return true;
}
}
return false;
} | java | public static boolean isSupportedVectorExtension( String name ) {
for( String ext : supportedVectors ) {
if (name.toLowerCase().endsWith(ext)) {
return true;
}
}
return false;
} | [
"public",
"static",
"boolean",
"isSupportedVectorExtension",
"(",
"String",
"name",
")",
"{",
"for",
"(",
"String",
"ext",
":",
"supportedVectors",
")",
"{",
"if",
"(",
"name",
".",
"toLowerCase",
"(",
")",
".",
"endsWith",
"(",
"ext",
")",
")",
"{",
"re... | Checks a given name of a file if it is a supported vector extension.
@param name the name of the file.
@return <code>true</code>, if the extension is supported. | [
"Checks",
"a",
"given",
"name",
"of",
"a",
"file",
"if",
"it",
"is",
"a",
"supported",
"vector",
"extension",
"."
] | d2b436bbdf951dc1fda56096a42dbc0eae4d35a5 | https://github.com/TheHortonMachine/hortonmachine/blob/d2b436bbdf951dc1fda56096a42dbc0eae4d35a5/gears/src/main/java/org/hortonmachine/gears/utils/DataUtilities.java#L37-L44 | train |
TheHortonMachine/hortonmachine | gears/src/main/java/org/hortonmachine/gears/utils/DataUtilities.java | DataUtilities.isSupportedRasterExtension | public static boolean isSupportedRasterExtension( String name ) {
for( String ext : supportedRasters ) {
if (name.toLowerCase().endsWith(ext)) {
return true;
}
}
return false;
} | java | public static boolean isSupportedRasterExtension( String name ) {
for( String ext : supportedRasters ) {
if (name.toLowerCase().endsWith(ext)) {
return true;
}
}
return false;
} | [
"public",
"static",
"boolean",
"isSupportedRasterExtension",
"(",
"String",
"name",
")",
"{",
"for",
"(",
"String",
"ext",
":",
"supportedRasters",
")",
"{",
"if",
"(",
"name",
".",
"toLowerCase",
"(",
")",
".",
"endsWith",
"(",
"ext",
")",
")",
"{",
"re... | Checks a given name of a file if it is a supported raster extension.
@param name the name of the file.
@return <code>true</code>, if the extension is supported. | [
"Checks",
"a",
"given",
"name",
"of",
"a",
"file",
"if",
"it",
"is",
"a",
"supported",
"raster",
"extension",
"."
] | d2b436bbdf951dc1fda56096a42dbc0eae4d35a5 | https://github.com/TheHortonMachine/hortonmachine/blob/d2b436bbdf951dc1fda56096a42dbc0eae4d35a5/gears/src/main/java/org/hortonmachine/gears/utils/DataUtilities.java#L52-L59 | train |
TheHortonMachine/hortonmachine | gears/src/main/java/org/hortonmachine/gears/io/rasterreader/OmsRasterReader.java | OmsRasterReader.readRaster | public static GridCoverage2D readRaster( String path ) throws Exception {
OmsRasterReader reader = new OmsRasterReader();
reader.file = path;
reader.process();
GridCoverage2D geodata = reader.outRaster;
return geodata;
} | java | public static GridCoverage2D readRaster( String path ) throws Exception {
OmsRasterReader reader = new OmsRasterReader();
reader.file = path;
reader.process();
GridCoverage2D geodata = reader.outRaster;
return geodata;
} | [
"public",
"static",
"GridCoverage2D",
"readRaster",
"(",
"String",
"path",
")",
"throws",
"Exception",
"{",
"OmsRasterReader",
"reader",
"=",
"new",
"OmsRasterReader",
"(",
")",
";",
"reader",
".",
"file",
"=",
"path",
";",
"reader",
".",
"process",
"(",
")"... | Utility method to quickly read a grid in default mode.
@param path the path to the file.
@return the read coverage.
@throws Exception | [
"Utility",
"method",
"to",
"quickly",
"read",
"a",
"grid",
"in",
"default",
"mode",
"."
] | d2b436bbdf951dc1fda56096a42dbc0eae4d35a5 | https://github.com/TheHortonMachine/hortonmachine/blob/d2b436bbdf951dc1fda56096a42dbc0eae4d35a5/gears/src/main/java/org/hortonmachine/gears/io/rasterreader/OmsRasterReader.java#L518-L524 | train |
TheHortonMachine/hortonmachine | gears/src/main/java/oms3/dsl/cosu/Matrix.java | Matrix.swap | private void swap(int i, int j) {
double[] temp = data[i];
data[i] = data[j];
data[j] = temp;
} | java | private void swap(int i, int j) {
double[] temp = data[i];
data[i] = data[j];
data[j] = temp;
} | [
"private",
"void",
"swap",
"(",
"int",
"i",
",",
"int",
"j",
")",
"{",
"double",
"[",
"]",
"temp",
"=",
"data",
"[",
"i",
"]",
";",
"data",
"[",
"i",
"]",
"=",
"data",
"[",
"j",
"]",
";",
"data",
"[",
"j",
"]",
"=",
"temp",
";",
"}"
] | swap rows i and j | [
"swap",
"rows",
"i",
"and",
"j"
] | d2b436bbdf951dc1fda56096a42dbc0eae4d35a5 | https://github.com/TheHortonMachine/hortonmachine/blob/d2b436bbdf951dc1fda56096a42dbc0eae4d35a5/gears/src/main/java/oms3/dsl/cosu/Matrix.java#L58-L62 | train |
TheHortonMachine/hortonmachine | gears/src/main/java/oms3/dsl/cosu/Matrix.java | Matrix.transpose | public Matrix transpose() {
Matrix A = new Matrix(N, M);
for (int i = 0; i < M; i++) {
for (int j = 0; j < N; j++) {
A.data[j][i] = data[i][j];
}
}
return A;
} | java | public Matrix transpose() {
Matrix A = new Matrix(N, M);
for (int i = 0; i < M; i++) {
for (int j = 0; j < N; j++) {
A.data[j][i] = data[i][j];
}
}
return A;
} | [
"public",
"Matrix",
"transpose",
"(",
")",
"{",
"Matrix",
"A",
"=",
"new",
"Matrix",
"(",
"N",
",",
"M",
")",
";",
"for",
"(",
"int",
"i",
"=",
"0",
";",
"i",
"<",
"M",
";",
"i",
"++",
")",
"{",
"for",
"(",
"int",
"j",
"=",
"0",
";",
"j",... | create and return the transpose of the invoking matrix | [
"create",
"and",
"return",
"the",
"transpose",
"of",
"the",
"invoking",
"matrix"
] | d2b436bbdf951dc1fda56096a42dbc0eae4d35a5 | https://github.com/TheHortonMachine/hortonmachine/blob/d2b436bbdf951dc1fda56096a42dbc0eae4d35a5/gears/src/main/java/oms3/dsl/cosu/Matrix.java#L69-L77 | train |
TheHortonMachine/hortonmachine | gears/src/main/java/oms3/dsl/cosu/Matrix.java | Matrix.solve | public Matrix solve(Matrix rhs) {
if (M != N || rhs.M != N || rhs.N != 1) {
throw new RuntimeException("Illegal matrix dimensions.");
}
// create copies of the data
Matrix A = new Matrix(this);
Matrix b = new Matrix(rhs);
// Gaussian elimination with partial... | java | public Matrix solve(Matrix rhs) {
if (M != N || rhs.M != N || rhs.N != 1) {
throw new RuntimeException("Illegal matrix dimensions.");
}
// create copies of the data
Matrix A = new Matrix(this);
Matrix b = new Matrix(rhs);
// Gaussian elimination with partial... | [
"public",
"Matrix",
"solve",
"(",
"Matrix",
"rhs",
")",
"{",
"if",
"(",
"M",
"!=",
"N",
"||",
"rhs",
".",
"M",
"!=",
"N",
"||",
"rhs",
".",
"N",
"!=",
"1",
")",
"{",
"throw",
"new",
"RuntimeException",
"(",
"\"Illegal matrix dimensions.\"",
")",
";",... | return x = A^-1 b, assuming A is square and has full rank | [
"return",
"x",
"=",
"A^",
"-",
"1",
"b",
"assuming",
"A",
"is",
"square",
"and",
"has",
"full",
"rank"
] | d2b436bbdf951dc1fda56096a42dbc0eae4d35a5 | https://github.com/TheHortonMachine/hortonmachine/blob/d2b436bbdf951dc1fda56096a42dbc0eae4d35a5/gears/src/main/java/oms3/dsl/cosu/Matrix.java#L157-L210 | train |
TheHortonMachine/hortonmachine | gears/src/main/java/oms3/dsl/cosu/Matrix.java | Matrix.print | public void print() {
for (int i = 0; i < M; i++) {
for (int j = 0; j < N; j++) {
System.out.printf("%9.4f ", data[i][j]);
}
System.out.println();
}
} | java | public void print() {
for (int i = 0; i < M; i++) {
for (int j = 0; j < N; j++) {
System.out.printf("%9.4f ", data[i][j]);
}
System.out.println();
}
} | [
"public",
"void",
"print",
"(",
")",
"{",
"for",
"(",
"int",
"i",
"=",
"0",
";",
"i",
"<",
"M",
";",
"i",
"++",
")",
"{",
"for",
"(",
"int",
"j",
"=",
"0",
";",
"j",
"<",
"N",
";",
"j",
"++",
")",
"{",
"System",
".",
"out",
".",
"printf... | print matrix to standard output | [
"print",
"matrix",
"to",
"standard",
"output"
] | d2b436bbdf951dc1fda56096a42dbc0eae4d35a5 | https://github.com/TheHortonMachine/hortonmachine/blob/d2b436bbdf951dc1fda56096a42dbc0eae4d35a5/gears/src/main/java/oms3/dsl/cosu/Matrix.java#L213-L220 | train |
TheHortonMachine/hortonmachine | dbs/src/main/java/org/hortonmachine/dbs/mbtiles/MBTilesDb.java | MBTilesDb.createTables | public void createTables( boolean makeIndexes ) throws Exception {
database.executeInsertUpdateDeleteSql("DROP TABLE IF EXISTS " + TABLE_TILES);
database.executeInsertUpdateDeleteSql("DROP TABLE IF EXISTS " + TABLE_METADATA);
database.executeInsertUpdateDeleteSql(CREATE_TILES);
database.... | java | public void createTables( boolean makeIndexes ) throws Exception {
database.executeInsertUpdateDeleteSql("DROP TABLE IF EXISTS " + TABLE_TILES);
database.executeInsertUpdateDeleteSql("DROP TABLE IF EXISTS " + TABLE_METADATA);
database.executeInsertUpdateDeleteSql(CREATE_TILES);
database.... | [
"public",
"void",
"createTables",
"(",
"boolean",
"makeIndexes",
")",
"throws",
"Exception",
"{",
"database",
".",
"executeInsertUpdateDeleteSql",
"(",
"\"DROP TABLE IF EXISTS \"",
"+",
"TABLE_TILES",
")",
";",
"database",
".",
"executeInsertUpdateDeleteSql",
"(",
"\"DR... | Create the mbtiles tables in the db.
<p><b>This removes existing tables!</b>
@param makeIndexes if true, indexes are made on creation.
@throws Exception | [
"Create",
"the",
"mbtiles",
"tables",
"in",
"the",
"db",
"."
] | d2b436bbdf951dc1fda56096a42dbc0eae4d35a5 | https://github.com/TheHortonMachine/hortonmachine/blob/d2b436bbdf951dc1fda56096a42dbc0eae4d35a5/dbs/src/main/java/org/hortonmachine/dbs/mbtiles/MBTilesDb.java#L136-L144 | train |
TheHortonMachine/hortonmachine | dbs/src/main/java/org/hortonmachine/dbs/mbtiles/MBTilesDb.java | MBTilesDb.fillMetadata | public void fillMetadata( float n, float s, float w, float e, String name, String format, int minZoom, int maxZoom )
throws Exception {
// type = baselayer
// version = 1.1
// descritpion = name
String query = toMetadataQuery("name", name);
database.executeInsertUpdat... | java | public void fillMetadata( float n, float s, float w, float e, String name, String format, int minZoom, int maxZoom )
throws Exception {
// type = baselayer
// version = 1.1
// descritpion = name
String query = toMetadataQuery("name", name);
database.executeInsertUpdat... | [
"public",
"void",
"fillMetadata",
"(",
"float",
"n",
",",
"float",
"s",
",",
"float",
"w",
",",
"float",
"e",
",",
"String",
"name",
",",
"String",
"format",
",",
"int",
"minZoom",
",",
"int",
"maxZoom",
")",
"throws",
"Exception",
"{",
"// type = basela... | Populate the metadata table.
@param n nord bound.
@param s south bound.
@param w west bound.
@param e east bound.
@param name name of the dataset.
@param format format of the images. png or jpg.
@param minZoom lowest zoomlevel.
@param maxZoom highest zoomlevel.
@throws Exception | [
"Populate",
"the",
"metadata",
"table",
"."
] | d2b436bbdf951dc1fda56096a42dbc0eae4d35a5 | https://github.com/TheHortonMachine/hortonmachine/blob/d2b436bbdf951dc1fda56096a42dbc0eae4d35a5/dbs/src/main/java/org/hortonmachine/dbs/mbtiles/MBTilesDb.java#L169-L191 | train |
TheHortonMachine/hortonmachine | dbs/src/main/java/org/hortonmachine/dbs/mbtiles/MBTilesDb.java | MBTilesDb.addTile | public synchronized void addTile( int x, int y, int z, byte[] imageBytes ) throws Exception {
database.execOnConnection(connection -> {
try (IHMPreparedStatement pstmt = connection.prepareStatement(insertTileSql);) {
pstmt.setInt(1, z);
pstmt.setInt(2, x);
... | java | public synchronized void addTile( int x, int y, int z, byte[] imageBytes ) throws Exception {
database.execOnConnection(connection -> {
try (IHMPreparedStatement pstmt = connection.prepareStatement(insertTileSql);) {
pstmt.setInt(1, z);
pstmt.setInt(2, x);
... | [
"public",
"synchronized",
"void",
"addTile",
"(",
"int",
"x",
",",
"int",
"y",
",",
"int",
"z",
",",
"byte",
"[",
"]",
"imageBytes",
")",
"throws",
"Exception",
"{",
"database",
".",
"execOnConnection",
"(",
"connection",
"->",
"{",
"try",
"(",
"IHMPrepa... | Add a single tile.
@param x the x tile index.
@param y the y tile index.
@param z the zoom level.
@return the tile image bytes.
@throws Exception | [
"Add",
"a",
"single",
"tile",
"."
] | d2b436bbdf951dc1fda56096a42dbc0eae4d35a5 | https://github.com/TheHortonMachine/hortonmachine/blob/d2b436bbdf951dc1fda56096a42dbc0eae4d35a5/dbs/src/main/java/org/hortonmachine/dbs/mbtiles/MBTilesDb.java#L218-L229 | train |
TheHortonMachine/hortonmachine | dbs/src/main/java/org/hortonmachine/dbs/mbtiles/MBTilesDb.java | MBTilesDb.addTilesInBatch | public synchronized void addTilesInBatch( List<Tile> tilesList ) throws Exception {
database.execOnConnection(connection -> {
boolean autoCommit = connection.getAutoCommit();
connection.setAutoCommit(false);
try (IHMPreparedStatement pstmt = connection.prepareStatement(insert... | java | public synchronized void addTilesInBatch( List<Tile> tilesList ) throws Exception {
database.execOnConnection(connection -> {
boolean autoCommit = connection.getAutoCommit();
connection.setAutoCommit(false);
try (IHMPreparedStatement pstmt = connection.prepareStatement(insert... | [
"public",
"synchronized",
"void",
"addTilesInBatch",
"(",
"List",
"<",
"Tile",
">",
"tilesList",
")",
"throws",
"Exception",
"{",
"database",
".",
"execOnConnection",
"(",
"connection",
"->",
"{",
"boolean",
"autoCommit",
"=",
"connection",
".",
"getAutoCommit",
... | Add a list of tiles in batch mode.
@param tilesList the list of tiles.
@throws Exception | [
"Add",
"a",
"list",
"of",
"tiles",
"in",
"batch",
"mode",
"."
] | d2b436bbdf951dc1fda56096a42dbc0eae4d35a5 | https://github.com/TheHortonMachine/hortonmachine/blob/d2b436bbdf951dc1fda56096a42dbc0eae4d35a5/dbs/src/main/java/org/hortonmachine/dbs/mbtiles/MBTilesDb.java#L237-L255 | train |
TheHortonMachine/hortonmachine | dbs/src/main/java/org/hortonmachine/dbs/mbtiles/MBTilesDb.java | MBTilesDb.getTile | public byte[] getTile( int tx, int tyOsm, int zoom ) throws Exception {
int ty = tyOsm;
if (tileRowType.equals("tms")) {
int[] tmsTileXY = MercatorUtils.osmTile2TmsTile(tx, tyOsm, zoom);
ty = tmsTileXY[1];
}
int _ty = ty;
return database.execOnConnection(c... | java | public byte[] getTile( int tx, int tyOsm, int zoom ) throws Exception {
int ty = tyOsm;
if (tileRowType.equals("tms")) {
int[] tmsTileXY = MercatorUtils.osmTile2TmsTile(tx, tyOsm, zoom);
ty = tmsTileXY[1];
}
int _ty = ty;
return database.execOnConnection(c... | [
"public",
"byte",
"[",
"]",
"getTile",
"(",
"int",
"tx",
",",
"int",
"tyOsm",
",",
"int",
"zoom",
")",
"throws",
"Exception",
"{",
"int",
"ty",
"=",
"tyOsm",
";",
"if",
"(",
"tileRowType",
".",
"equals",
"(",
"\"tms\"",
")",
")",
"{",
"int",
"[",
... | Get a Tile's image bytes from the database.
@param tx the x tile index.
@param tyOsm the y tile index, the osm way.
@param zoom the zoom level.
@return the tile image bytes.
@throws Exception | [
"Get",
"a",
"Tile",
"s",
"image",
"bytes",
"from",
"the",
"database",
"."
] | d2b436bbdf951dc1fda56096a42dbc0eae4d35a5 | https://github.com/TheHortonMachine/hortonmachine/blob/d2b436bbdf951dc1fda56096a42dbc0eae4d35a5/dbs/src/main/java/org/hortonmachine/dbs/mbtiles/MBTilesDb.java#L266-L286 | train |
TheHortonMachine/hortonmachine | dbs/src/main/java/org/hortonmachine/dbs/mbtiles/MBTilesDb.java | MBTilesDb.getBounds | public Envelope getBounds() throws Exception {
checkMetadata();
String boundsWSEN = metadataMap.get("bounds");
String[] split = boundsWSEN.split(",");
double w = Double.parseDouble(split[0]);
double s = Double.parseDouble(split[1]);
double e = Double.parseDouble(split[2])... | java | public Envelope getBounds() throws Exception {
checkMetadata();
String boundsWSEN = metadataMap.get("bounds");
String[] split = boundsWSEN.split(",");
double w = Double.parseDouble(split[0]);
double s = Double.parseDouble(split[1]);
double e = Double.parseDouble(split[2])... | [
"public",
"Envelope",
"getBounds",
"(",
")",
"throws",
"Exception",
"{",
"checkMetadata",
"(",
")",
";",
"String",
"boundsWSEN",
"=",
"metadataMap",
".",
"get",
"(",
"\"bounds\"",
")",
";",
"String",
"[",
"]",
"split",
"=",
"boundsWSEN",
".",
"split",
"(",... | Get the db envelope.
@return the Envelope of the dataset.
@throws Exception | [
"Get",
"the",
"db",
"envelope",
"."
] | d2b436bbdf951dc1fda56096a42dbc0eae4d35a5 | https://github.com/TheHortonMachine/hortonmachine/blob/d2b436bbdf951dc1fda56096a42dbc0eae4d35a5/dbs/src/main/java/org/hortonmachine/dbs/mbtiles/MBTilesDb.java#L294-L303 | train |
TheHortonMachine/hortonmachine | dbs/src/main/java/org/hortonmachine/dbs/mbtiles/MBTilesDb.java | MBTilesDb.getBoundsInTileIndex | public int[] getBoundsInTileIndex( int zoomlevel ) throws Exception {
String sql = "select min(tile_column), max(tile_column), min(tile_row), max(tile_row) from tiles where zoom_level="
+ zoomlevel;
return database.execOnConnection(connection -> {
try (IHMStatement statement ... | java | public int[] getBoundsInTileIndex( int zoomlevel ) throws Exception {
String sql = "select min(tile_column), max(tile_column), min(tile_row), max(tile_row) from tiles where zoom_level="
+ zoomlevel;
return database.execOnConnection(connection -> {
try (IHMStatement statement ... | [
"public",
"int",
"[",
"]",
"getBoundsInTileIndex",
"(",
"int",
"zoomlevel",
")",
"throws",
"Exception",
"{",
"String",
"sql",
"=",
"\"select min(tile_column), max(tile_column), min(tile_row), max(tile_row) from tiles where zoom_level=\"",
"+",
"zoomlevel",
";",
"return",
"dat... | Get the bounds of a zoomlevel in tile indexes.
<p>This comes handy when one wants to navigate all tiles of a zoomlevel.
@param zoomlevel the zoom level.
@return the tile indexes as [minTx, maxTx, minTy, maxTy].
@throws Exception | [
"Get",
"the",
"bounds",
"of",
"a",
"zoomlevel",
"in",
"tile",
"indexes",
"."
] | d2b436bbdf951dc1fda56096a42dbc0eae4d35a5 | https://github.com/TheHortonMachine/hortonmachine/blob/d2b436bbdf951dc1fda56096a42dbc0eae4d35a5/dbs/src/main/java/org/hortonmachine/dbs/mbtiles/MBTilesDb.java#L314-L329 | train |
TheHortonMachine/hortonmachine | gears/src/main/java/oms3/Compound.java | Compound.out2in | public void out2in(Object from, String from_out, Object... tos) {
for (Object co : tos) {
out2in(from, from_out, co, from_out);
}
} | java | public void out2in(Object from, String from_out, Object... tos) {
for (Object co : tos) {
out2in(from, from_out, co, from_out);
}
} | [
"public",
"void",
"out2in",
"(",
"Object",
"from",
",",
"String",
"from_out",
",",
"Object",
"...",
"tos",
")",
"{",
"for",
"(",
"Object",
"co",
":",
"tos",
")",
"{",
"out2in",
"(",
"from",
",",
"from_out",
",",
"co",
",",
"from_out",
")",
";",
"}"... | Connects field1 of cmd1 with the same named fields in cmds
@param from component1
@param from_out field
@param tos other components | [
"Connects",
"field1",
"of",
"cmd1",
"with",
"the",
"same",
"named",
"fields",
"in",
"cmds"
] | d2b436bbdf951dc1fda56096a42dbc0eae4d35a5 | https://github.com/TheHortonMachine/hortonmachine/blob/d2b436bbdf951dc1fda56096a42dbc0eae4d35a5/gears/src/main/java/oms3/Compound.java#L110-L114 | train |
TheHortonMachine/hortonmachine | gears/src/main/java/oms3/Compound.java | Compound.in2in | public void in2in(String in, Object to, String to_in) {
controller.mapIn(in, to, to_in);
} | java | public void in2in(String in, Object to, String to_in) {
controller.mapIn(in, to, to_in);
} | [
"public",
"void",
"in2in",
"(",
"String",
"in",
",",
"Object",
"to",
",",
"String",
"to_in",
")",
"{",
"controller",
".",
"mapIn",
"(",
"in",
",",
"to",
",",
"to_in",
")",
";",
"}"
] | Maps a Compound Input field to a internal simple input field.
@param in Compound input field.
@param to internal Component
@param to_in Input field of the internal component | [
"Maps",
"a",
"Compound",
"Input",
"field",
"to",
"a",
"internal",
"simple",
"input",
"field",
"."
] | d2b436bbdf951dc1fda56096a42dbc0eae4d35a5 | https://github.com/TheHortonMachine/hortonmachine/blob/d2b436bbdf951dc1fda56096a42dbc0eae4d35a5/gears/src/main/java/oms3/Compound.java#L145-L147 | train |
TheHortonMachine/hortonmachine | gears/src/main/java/oms3/Compound.java | Compound.in2in | public void in2in(String in, Object... to) {
for (Object cmd : to) {
in2in(in, cmd, in);
}
} | java | public void in2in(String in, Object... to) {
for (Object cmd : to) {
in2in(in, cmd, in);
}
} | [
"public",
"void",
"in2in",
"(",
"String",
"in",
",",
"Object",
"...",
"to",
")",
"{",
"for",
"(",
"Object",
"cmd",
":",
"to",
")",
"{",
"in2in",
"(",
"in",
",",
"cmd",
",",
"in",
")",
";",
"}",
"}"
] | Maps a compound input to an internal simple input field. Both
fields have the same name.
@param in the name of the field
@param to the commands to map to | [
"Maps",
"a",
"compound",
"input",
"to",
"an",
"internal",
"simple",
"input",
"field",
".",
"Both",
"fields",
"have",
"the",
"same",
"name",
"."
] | d2b436bbdf951dc1fda56096a42dbc0eae4d35a5 | https://github.com/TheHortonMachine/hortonmachine/blob/d2b436bbdf951dc1fda56096a42dbc0eae4d35a5/gears/src/main/java/oms3/Compound.java#L154-L158 | train |
TheHortonMachine/hortonmachine | gears/src/main/java/oms3/Compound.java | Compound.field2in | public void field2in(Object o, String field, Object to, String to_in) {
controller.mapInField(o, field, to, to_in);
} | java | public void field2in(Object o, String field, Object to, String to_in) {
controller.mapInField(o, field, to, to_in);
} | [
"public",
"void",
"field2in",
"(",
"Object",
"o",
",",
"String",
"field",
",",
"Object",
"to",
",",
"String",
"to_in",
")",
"{",
"controller",
".",
"mapInField",
"(",
"o",
",",
"field",
",",
"to",
",",
"to_in",
")",
";",
"}"
] | Maps a object's field to an In field
@param o the object
@param field the field name
@param to the component
@param to_in the In field. | [
"Maps",
"a",
"object",
"s",
"field",
"to",
"an",
"In",
"field"
] | d2b436bbdf951dc1fda56096a42dbc0eae4d35a5 | https://github.com/TheHortonMachine/hortonmachine/blob/d2b436bbdf951dc1fda56096a42dbc0eae4d35a5/gears/src/main/java/oms3/Compound.java#L189-L191 | train |
TheHortonMachine/hortonmachine | gears/src/main/java/oms3/Compound.java | Compound.field2in | public void field2in(Object o, String field, Object to) {
field = field.trim();
if (field.indexOf(' ') > 0) { // maybe multiple field names given
String[] fields = field.split("\\s+");
for (String f : fields) {
field2in(o, f, to, f);
}
... | java | public void field2in(Object o, String field, Object to) {
field = field.trim();
if (field.indexOf(' ') > 0) { // maybe multiple field names given
String[] fields = field.split("\\s+");
for (String f : fields) {
field2in(o, f, to, f);
}
... | [
"public",
"void",
"field2in",
"(",
"Object",
"o",
",",
"String",
"field",
",",
"Object",
"to",
")",
"{",
"field",
"=",
"field",
".",
"trim",
"(",
")",
";",
"if",
"(",
"field",
".",
"indexOf",
"(",
"'",
"'",
")",
">",
"0",
")",
"{",
"// maybe mult... | Maps an object's field to a component's In field with the same name
@param o the object
@param field the field name
@param to the component. | [
"Maps",
"an",
"object",
"s",
"field",
"to",
"a",
"component",
"s",
"In",
"field",
"with",
"the",
"same",
"name"
] | d2b436bbdf951dc1fda56096a42dbc0eae4d35a5 | https://github.com/TheHortonMachine/hortonmachine/blob/d2b436bbdf951dc1fda56096a42dbc0eae4d35a5/gears/src/main/java/oms3/Compound.java#L199-L209 | train |
TheHortonMachine/hortonmachine | gears/src/main/java/oms3/Compound.java | Compound.out2field | public void out2field(Object from, String from_out, Object o, String field) {
controller.mapOutField(from, from_out, o, field);
} | java | public void out2field(Object from, String from_out, Object o, String field) {
controller.mapOutField(from, from_out, o, field);
} | [
"public",
"void",
"out2field",
"(",
"Object",
"from",
",",
"String",
"from_out",
",",
"Object",
"o",
",",
"String",
"field",
")",
"{",
"controller",
".",
"mapOutField",
"(",
"from",
",",
"from_out",
",",
"o",
",",
"field",
")",
";",
"}"
] | Maps a component's Out field to an object field.
@param from the component
@param from_out the component's out field
@param o the object
@param field the object's field | [
"Maps",
"a",
"component",
"s",
"Out",
"field",
"to",
"an",
"object",
"field",
"."
] | d2b436bbdf951dc1fda56096a42dbc0eae4d35a5 | https://github.com/TheHortonMachine/hortonmachine/blob/d2b436bbdf951dc1fda56096a42dbc0eae4d35a5/gears/src/main/java/oms3/Compound.java#L219-L221 | train |
TheHortonMachine/hortonmachine | gears/src/main/java/oms3/Compound.java | Compound.out2field | public void out2field(Object from, String from_out, Object o) {
out2field(from, from_out, o, from_out);
} | java | public void out2field(Object from, String from_out, Object o) {
out2field(from, from_out, o, from_out);
} | [
"public",
"void",
"out2field",
"(",
"Object",
"from",
",",
"String",
"from_out",
",",
"Object",
"o",
")",
"{",
"out2field",
"(",
"from",
",",
"from_out",
",",
"o",
",",
"from_out",
")",
";",
"}"
] | Maps a component Out field to an object's field. Both field have the
same name.
@param from the component
@param from_out the component's Out field.
@param o the object | [
"Maps",
"a",
"component",
"Out",
"field",
"to",
"an",
"object",
"s",
"field",
".",
"Both",
"field",
"have",
"the",
"same",
"name",
"."
] | d2b436bbdf951dc1fda56096a42dbc0eae4d35a5 | https://github.com/TheHortonMachine/hortonmachine/blob/d2b436bbdf951dc1fda56096a42dbc0eae4d35a5/gears/src/main/java/oms3/Compound.java#L230-L232 | train |
TheHortonMachine/hortonmachine | gears/src/main/java/oms3/Compound.java | Compound.out2out | public void out2out(String out, Object to, String to_out) {
controller.mapOut(out, to, to_out);
} | java | public void out2out(String out, Object to, String to_out) {
controller.mapOut(out, to, to_out);
} | [
"public",
"void",
"out2out",
"(",
"String",
"out",
",",
"Object",
"to",
",",
"String",
"to_out",
")",
"{",
"controller",
".",
"mapOut",
"(",
"out",
",",
"to",
",",
"to_out",
")",
";",
"}"
] | Maps a Compound Output field to a internal simple output field.
@param out Compount output field.
@param to internal Component
@param to_out output field of the internal component | [
"Maps",
"a",
"Compound",
"Output",
"field",
"to",
"a",
"internal",
"simple",
"output",
"field",
"."
] | d2b436bbdf951dc1fda56096a42dbc0eae4d35a5 | https://github.com/TheHortonMachine/hortonmachine/blob/d2b436bbdf951dc1fda56096a42dbc0eae4d35a5/gears/src/main/java/oms3/Compound.java#L241-L243 | train |
TheHortonMachine/hortonmachine | gears/src/main/java/oms3/Compound.java | Compound.connect | @Deprecated
public void connect(Object from, String from_out, Object to, String to_in) {
controller.connect(from, from_out, to, to_in);
} | java | @Deprecated
public void connect(Object from, String from_out, Object to, String to_in) {
controller.connect(from, from_out, to, to_in);
} | [
"@",
"Deprecated",
"public",
"void",
"connect",
"(",
"Object",
"from",
",",
"String",
"from_out",
",",
"Object",
"to",
",",
"String",
"to_in",
")",
"{",
"controller",
".",
"connect",
"(",
"from",
",",
"from_out",
",",
"to",
",",
"to_in",
")",
";",
"}"
... | deprecated methods starting here. | [
"deprecated",
"methods",
"starting",
"here",
"."
] | d2b436bbdf951dc1fda56096a42dbc0eae4d35a5 | https://github.com/TheHortonMachine/hortonmachine/blob/d2b436bbdf951dc1fda56096a42dbc0eae4d35a5/gears/src/main/java/oms3/Compound.java#L293-L296 | train |
enasequence/sequencetools | src/main/java/uk/ac/ebi/embl/api/validation/check/sequence/SequenceValidationCheck.java | SequenceValidationCheck.reportError | protected void reportError(ValidationResult result, String messageKey,
Object... params) {
reportMessage(result, Severity.ERROR, messageKey, params);
} | java | protected void reportError(ValidationResult result, String messageKey,
Object... params) {
reportMessage(result, Severity.ERROR, messageKey, params);
} | [
"protected",
"void",
"reportError",
"(",
"ValidationResult",
"result",
",",
"String",
"messageKey",
",",
"Object",
"...",
"params",
")",
"{",
"reportMessage",
"(",
"result",
",",
"Severity",
".",
"ERROR",
",",
"messageKey",
",",
"params",
")",
";",
"}"
] | Creates an error validation message for the sequence and adds it to
the validation result.
@param messageKey a message key
@param params message parameters | [
"Creates",
"an",
"error",
"validation",
"message",
"for",
"the",
"sequence",
"and",
"adds",
"it",
"to",
"the",
"validation",
"result",
"."
] | 4127f5e1a17540239f5810136153fbd6737fa262 | https://github.com/enasequence/sequencetools/blob/4127f5e1a17540239f5810136153fbd6737fa262/src/main/java/uk/ac/ebi/embl/api/validation/check/sequence/SequenceValidationCheck.java#L70-L73 | train |
enasequence/sequencetools | src/main/java/uk/ac/ebi/embl/api/validation/check/sequence/SequenceValidationCheck.java | SequenceValidationCheck.reportWarning | protected void reportWarning(ValidationResult result, String messageKey,
Object... params) {
reportMessage(result, Severity.WARNING, messageKey, params);
} | java | protected void reportWarning(ValidationResult result, String messageKey,
Object... params) {
reportMessage(result, Severity.WARNING, messageKey, params);
} | [
"protected",
"void",
"reportWarning",
"(",
"ValidationResult",
"result",
",",
"String",
"messageKey",
",",
"Object",
"...",
"params",
")",
"{",
"reportMessage",
"(",
"result",
",",
"Severity",
".",
"WARNING",
",",
"messageKey",
",",
"params",
")",
";",
"}"
] | Creates a warning validation message for the sequence and adds it to
the validation result.
@param messageKey a message key
@param params message parameters | [
"Creates",
"a",
"warning",
"validation",
"message",
"for",
"the",
"sequence",
"and",
"adds",
"it",
"to",
"the",
"validation",
"result",
"."
] | 4127f5e1a17540239f5810136153fbd6737fa262 | https://github.com/enasequence/sequencetools/blob/4127f5e1a17540239f5810136153fbd6737fa262/src/main/java/uk/ac/ebi/embl/api/validation/check/sequence/SequenceValidationCheck.java#L82-L85 | train |
enasequence/sequencetools | src/main/java/uk/ac/ebi/embl/api/validation/check/sequence/SequenceValidationCheck.java | SequenceValidationCheck.reportMessage | protected void reportMessage(ValidationResult result, Severity severity,
String messageKey, Object... params) {
result.append(EntryValidations.createMessage(origin, severity, messageKey, params));
} | java | protected void reportMessage(ValidationResult result, Severity severity,
String messageKey, Object... params) {
result.append(EntryValidations.createMessage(origin, severity, messageKey, params));
} | [
"protected",
"void",
"reportMessage",
"(",
"ValidationResult",
"result",
",",
"Severity",
"severity",
",",
"String",
"messageKey",
",",
"Object",
"...",
"params",
")",
"{",
"result",
".",
"append",
"(",
"EntryValidations",
".",
"createMessage",
"(",
"origin",
",... | Creates a validation message for the sequence and adds it to
the validation result.
@param severity message severity
@param messageKey a message key
@param params message parameters | [
"Creates",
"a",
"validation",
"message",
"for",
"the",
"sequence",
"and",
"adds",
"it",
"to",
"the",
"validation",
"result",
"."
] | 4127f5e1a17540239f5810136153fbd6737fa262 | https://github.com/enasequence/sequencetools/blob/4127f5e1a17540239f5810136153fbd6737fa262/src/main/java/uk/ac/ebi/embl/api/validation/check/sequence/SequenceValidationCheck.java#L95-L98 | train |
TheHortonMachine/hortonmachine | hmachine/src/main/java/org/hortonmachine/hmachine/modules/hydrogeomorphology/insolation/OmsInsolation.java | OmsInsolation.calcInsolation | private void calcInsolation( double lambda, WritableRaster demWR, WritableRaster gradientWR, WritableRaster insolationWR,
int day, double dx ) {
// calculating the day angle
// double dayang = 2 * Math.PI * (day - 1) / 365.0;
double dayangb = (360 / 365.25) * (day - 79.436);
... | java | private void calcInsolation( double lambda, WritableRaster demWR, WritableRaster gradientWR, WritableRaster insolationWR,
int day, double dx ) {
// calculating the day angle
// double dayang = 2 * Math.PI * (day - 1) / 365.0;
double dayangb = (360 / 365.25) * (day - 79.436);
... | [
"private",
"void",
"calcInsolation",
"(",
"double",
"lambda",
",",
"WritableRaster",
"demWR",
",",
"WritableRaster",
"gradientWR",
",",
"WritableRaster",
"insolationWR",
",",
"int",
"day",
",",
"double",
"dx",
")",
"{",
"// calculating the day angle",
"// double dayan... | Evaluate the radiation.
@param lambda
the latitude.
@param demWR
the raster of elevation
@param gradientWR
the raster of the gradient value of the dem.
@param insolationWR
the wr where to store the result.
@param the
day in the year.
@paradx the resolutiono of the dem. | [
"Evaluate",
"the",
"radiation",
"."
] | d2b436bbdf951dc1fda56096a42dbc0eae4d35a5 | https://github.com/TheHortonMachine/hortonmachine/blob/d2b436bbdf951dc1fda56096a42dbc0eae4d35a5/hmachine/src/main/java/org/hortonmachine/hmachine/modules/hydrogeomorphology/insolation/OmsInsolation.java#L205-L236 | train |
TheHortonMachine/hortonmachine | gears/src/main/java/org/hortonmachine/gears/utils/CrsUtilities.java | CrsUtilities.isCrsValid | public static boolean isCrsValid( CoordinateReferenceSystem crs ) {
if (crs instanceof AbstractSingleCRS) {
AbstractSingleCRS aCrs = (AbstractSingleCRS) crs;
Datum datum = aCrs.getDatum();
ReferenceIdentifier name = datum.getName();
String code = name.getCode();
... | java | public static boolean isCrsValid( CoordinateReferenceSystem crs ) {
if (crs instanceof AbstractSingleCRS) {
AbstractSingleCRS aCrs = (AbstractSingleCRS) crs;
Datum datum = aCrs.getDatum();
ReferenceIdentifier name = datum.getName();
String code = name.getCode();
... | [
"public",
"static",
"boolean",
"isCrsValid",
"(",
"CoordinateReferenceSystem",
"crs",
")",
"{",
"if",
"(",
"crs",
"instanceof",
"AbstractSingleCRS",
")",
"{",
"AbstractSingleCRS",
"aCrs",
"=",
"(",
"AbstractSingleCRS",
")",
"crs",
";",
"Datum",
"datum",
"=",
"aC... | Checks if a crs is valid, i.e. if it is not a wildcard default one.
@param crs the crs to check. | [
"Checks",
"if",
"a",
"crs",
"is",
"valid",
"i",
".",
"e",
".",
"if",
"it",
"is",
"not",
"a",
"wildcard",
"default",
"one",
"."
] | d2b436bbdf951dc1fda56096a42dbc0eae4d35a5 | https://github.com/TheHortonMachine/hortonmachine/blob/d2b436bbdf951dc1fda56096a42dbc0eae4d35a5/gears/src/main/java/org/hortonmachine/gears/utils/CrsUtilities.java#L60-L71 | train |
TheHortonMachine/hortonmachine | gears/src/main/java/org/hortonmachine/gears/utils/CrsUtilities.java | CrsUtilities.writeProjectionFile | @SuppressWarnings("nls")
public static void writeProjectionFile( String filePath, String extention, CoordinateReferenceSystem crs )
throws IOException {
/*
* fill a prj file
*/
String prjPath = null;
if (extention != null && filePath.toLowerCase().endsWith("." +... | java | @SuppressWarnings("nls")
public static void writeProjectionFile( String filePath, String extention, CoordinateReferenceSystem crs )
throws IOException {
/*
* fill a prj file
*/
String prjPath = null;
if (extention != null && filePath.toLowerCase().endsWith("." +... | [
"@",
"SuppressWarnings",
"(",
"\"nls\"",
")",
"public",
"static",
"void",
"writeProjectionFile",
"(",
"String",
"filePath",
",",
"String",
"extention",
",",
"CoordinateReferenceSystem",
"crs",
")",
"throws",
"IOException",
"{",
"/*\n * fill a prj file\n */... | Fill the prj file with the actual map projection.
@param filePath the path to the regarding data or prj file.
@param extention the extention of the data file. If <code>null</code>, the crs is written to filePath directly.
@param crs the {@link CoordinateReferenceSystem} to write.
@throws IOException | [
"Fill",
"the",
"prj",
"file",
"with",
"the",
"actual",
"map",
"projection",
"."
] | d2b436bbdf951dc1fda56096a42dbc0eae4d35a5 | https://github.com/TheHortonMachine/hortonmachine/blob/d2b436bbdf951dc1fda56096a42dbc0eae4d35a5/gears/src/main/java/org/hortonmachine/gears/utils/CrsUtilities.java#L82-L104 | train |
TheHortonMachine/hortonmachine | gears/src/main/java/org/hortonmachine/gears/utils/CrsUtilities.java | CrsUtilities.reproject | public static void reproject( CoordinateReferenceSystem from, CoordinateReferenceSystem to, Object[] geometries )
throws Exception {
MathTransform mathTransform = CRS.findMathTransform(from, to);
for( int i = 0; i < geometries.length; i++ ) {
geometries[i] = JTS.transform((Geome... | java | public static void reproject( CoordinateReferenceSystem from, CoordinateReferenceSystem to, Object[] geometries )
throws Exception {
MathTransform mathTransform = CRS.findMathTransform(from, to);
for( int i = 0; i < geometries.length; i++ ) {
geometries[i] = JTS.transform((Geome... | [
"public",
"static",
"void",
"reproject",
"(",
"CoordinateReferenceSystem",
"from",
",",
"CoordinateReferenceSystem",
"to",
",",
"Object",
"[",
"]",
"geometries",
")",
"throws",
"Exception",
"{",
"MathTransform",
"mathTransform",
"=",
"CRS",
".",
"findMathTransform",
... | Reproject a set of geometries
@param from the starting crs
@param to the destination crs
@param geometries the array of geometries, wrapped into an Object array
@throws Exception | [
"Reproject",
"a",
"set",
"of",
"geometries"
] | d2b436bbdf951dc1fda56096a42dbc0eae4d35a5 | https://github.com/TheHortonMachine/hortonmachine/blob/d2b436bbdf951dc1fda56096a42dbc0eae4d35a5/gears/src/main/java/org/hortonmachine/gears/utils/CrsUtilities.java#L151-L158 | train |
TheHortonMachine/hortonmachine | gears/src/main/java/org/hortonmachine/gears/utils/CrsUtilities.java | CrsUtilities.reproject | public static void reproject( CoordinateReferenceSystem from, CoordinateReferenceSystem to, Coordinate[] coordinates )
throws Exception {
MathTransform mathTransform = CRS.findMathTransform(from, to);
for( int i = 0; i < coordinates.length; i++ ) {
coordinates[i] = JTS.transform... | java | public static void reproject( CoordinateReferenceSystem from, CoordinateReferenceSystem to, Coordinate[] coordinates )
throws Exception {
MathTransform mathTransform = CRS.findMathTransform(from, to);
for( int i = 0; i < coordinates.length; i++ ) {
coordinates[i] = JTS.transform... | [
"public",
"static",
"void",
"reproject",
"(",
"CoordinateReferenceSystem",
"from",
",",
"CoordinateReferenceSystem",
"to",
",",
"Coordinate",
"[",
"]",
"coordinates",
")",
"throws",
"Exception",
"{",
"MathTransform",
"mathTransform",
"=",
"CRS",
".",
"findMathTransfor... | Reproject a set of coordinates.
@param from the starting crs
@param to the destination crs
@param coordinates the array of coordinates, wrapped into an Object array
@throws Exception | [
"Reproject",
"a",
"set",
"of",
"coordinates",
"."
] | d2b436bbdf951dc1fda56096a42dbc0eae4d35a5 | https://github.com/TheHortonMachine/hortonmachine/blob/d2b436bbdf951dc1fda56096a42dbc0eae4d35a5/gears/src/main/java/org/hortonmachine/gears/utils/CrsUtilities.java#L169-L176 | train |
TheHortonMachine/hortonmachine | gears/src/main/java/org/hortonmachine/gears/utils/CrsUtilities.java | CrsUtilities.getMetersAsWGS84 | public static double getMetersAsWGS84( double meters, Coordinate c ) {
GeodeticCalculator gc = new GeodeticCalculator(DefaultGeographicCRS.WGS84);
gc.setStartingGeographicPoint(c.x, c.y);
gc.setDirection(90, meters);
Point2D destinationGeographicPoint = gc.getDestinationGeographicPoint()... | java | public static double getMetersAsWGS84( double meters, Coordinate c ) {
GeodeticCalculator gc = new GeodeticCalculator(DefaultGeographicCRS.WGS84);
gc.setStartingGeographicPoint(c.x, c.y);
gc.setDirection(90, meters);
Point2D destinationGeographicPoint = gc.getDestinationGeographicPoint()... | [
"public",
"static",
"double",
"getMetersAsWGS84",
"(",
"double",
"meters",
",",
"Coordinate",
"c",
")",
"{",
"GeodeticCalculator",
"gc",
"=",
"new",
"GeodeticCalculator",
"(",
"DefaultGeographicCRS",
".",
"WGS84",
")",
";",
"gc",
".",
"setStartingGeographicPoint",
... | Converts meters to degrees, based on a given coordinate in 90 degrees direction.
@param meters the meters to convert.
@param c the position to consider.
@return the converted degrees. | [
"Converts",
"meters",
"to",
"degrees",
"based",
"on",
"a",
"given",
"coordinate",
"in",
"90",
"degrees",
"direction",
"."
] | d2b436bbdf951dc1fda56096a42dbc0eae4d35a5 | https://github.com/TheHortonMachine/hortonmachine/blob/d2b436bbdf951dc1fda56096a42dbc0eae4d35a5/gears/src/main/java/org/hortonmachine/gears/utils/CrsUtilities.java#L249-L256 | train |
TheHortonMachine/hortonmachine | gears/src/main/java/org/hortonmachine/gears/modules/r/houghes/HoughCircles.java | HoughCircles.createHoughPixels | private void createHoughPixels( double[][][] houghValues, byte houghPixels[] ) {
double d = -1D;
for( int j = 0; j < height; j++ ) {
for( int k = 0; k < width; k++ ) {
if (houghValues[k][j][0] > d) {
d = houghValues[k][j][0];
}
... | java | private void createHoughPixels( double[][][] houghValues, byte houghPixels[] ) {
double d = -1D;
for( int j = 0; j < height; j++ ) {
for( int k = 0; k < width; k++ ) {
if (houghValues[k][j][0] > d) {
d = houghValues[k][j][0];
}
... | [
"private",
"void",
"createHoughPixels",
"(",
"double",
"[",
"]",
"[",
"]",
"[",
"]",
"houghValues",
",",
"byte",
"houghPixels",
"[",
"]",
")",
"{",
"double",
"d",
"=",
"-",
"1D",
";",
"for",
"(",
"int",
"j",
"=",
"0",
";",
"j",
"<",
"height",
";"... | Convert Values in Hough Space to an 8-Bit Image Space. | [
"Convert",
"Values",
"in",
"Hough",
"Space",
"to",
"an",
"8",
"-",
"Bit",
"Image",
"Space",
"."
] | d2b436bbdf951dc1fda56096a42dbc0eae4d35a5 | https://github.com/TheHortonMachine/hortonmachine/blob/d2b436bbdf951dc1fda56096a42dbc0eae4d35a5/gears/src/main/java/org/hortonmachine/gears/modules/r/houghes/HoughCircles.java#L216-L230 | train |
TheHortonMachine/hortonmachine | gears/src/main/java/org/hortonmachine/gears/modules/r/houghes/HoughCircles.java | HoughCircles.drawCircles | public void drawCircles( double[][][] houghValues, byte[] circlespixels ) {
// Copy original input pixels into output
// circle location display image and
// combine with saturation at 100
int roiaddr = 0;
for( int y = offy; y < offy + height; y++ ) {
for( int x = of... | java | public void drawCircles( double[][][] houghValues, byte[] circlespixels ) {
// Copy original input pixels into output
// circle location display image and
// combine with saturation at 100
int roiaddr = 0;
for( int y = offy; y < offy + height; y++ ) {
for( int x = of... | [
"public",
"void",
"drawCircles",
"(",
"double",
"[",
"]",
"[",
"]",
"[",
"]",
"houghValues",
",",
"byte",
"[",
"]",
"circlespixels",
")",
"{",
"// Copy original input pixels into output",
"// circle location display image and",
"// combine with saturation at 100",
"int",
... | Draw the circles found in the original image. | [
"Draw",
"the",
"circles",
"found",
"in",
"the",
"original",
"image",
"."
] | d2b436bbdf951dc1fda56096a42dbc0eae4d35a5 | https://github.com/TheHortonMachine/hortonmachine/blob/d2b436bbdf951dc1fda56096a42dbc0eae4d35a5/gears/src/main/java/org/hortonmachine/gears/modules/r/houghes/HoughCircles.java#L233-L296 | train |
enasequence/sequencetools | src/main/java/uk/ac/ebi/embl/api/entry/sequence/AbstractSequence.java | AbstractSequence.getSequence | public String getSequence(Long beginPosition, Long endPosition)
{
byte[] sequenceByte = getSequenceByte(beginPosition, endPosition);
if (sequenceByte != null)
return new String(sequenceByte);
return null;
} | java | public String getSequence(Long beginPosition, Long endPosition)
{
byte[] sequenceByte = getSequenceByte(beginPosition, endPosition);
if (sequenceByte != null)
return new String(sequenceByte);
return null;
} | [
"public",
"String",
"getSequence",
"(",
"Long",
"beginPosition",
",",
"Long",
"endPosition",
")",
"{",
"byte",
"[",
"]",
"sequenceByte",
"=",
"getSequenceByte",
"(",
"beginPosition",
",",
"endPosition",
")",
";",
"if",
"(",
"sequenceByte",
"!=",
"null",
")",
... | Returns a subsequence string or null if the location
is not valid.
@param beginPosition the sequence begin position.
@param endPosition the sequence end position.
@return a subsequence string or null if the location is not valid. | [
"Returns",
"a",
"subsequence",
"string",
"or",
"null",
"if",
"the",
"location",
"is",
"not",
"valid",
"."
] | 4127f5e1a17540239f5810136153fbd6737fa262 | https://github.com/enasequence/sequencetools/blob/4127f5e1a17540239f5810136153fbd6737fa262/src/main/java/uk/ac/ebi/embl/api/entry/sequence/AbstractSequence.java#L36-L42 | train |
TheHortonMachine/hortonmachine | gears/src/main/java/org/hortonmachine/gears/utils/math/matrixes/SquareMatrix.java | SquareMatrix.set | private void set(Matrix m)
{
this.nRows = this.nCols = Math.min(m.nRows, m.nCols);
this.values = m.values;
} | java | private void set(Matrix m)
{
this.nRows = this.nCols = Math.min(m.nRows, m.nCols);
this.values = m.values;
} | [
"private",
"void",
"set",
"(",
"Matrix",
"m",
")",
"{",
"this",
".",
"nRows",
"=",
"this",
".",
"nCols",
"=",
"Math",
".",
"min",
"(",
"m",
".",
"nRows",
",",
"m",
".",
"nCols",
")",
";",
"this",
".",
"values",
"=",
"m",
".",
"values",
";",
"... | Set this square matrix from another matrix. Note that this
matrix will reference the values of the argument matrix. If
the values are not square, only the upper left square is used.
@param values the 2-d array of values | [
"Set",
"this",
"square",
"matrix",
"from",
"another",
"matrix",
".",
"Note",
"that",
"this",
"matrix",
"will",
"reference",
"the",
"values",
"of",
"the",
"argument",
"matrix",
".",
"If",
"the",
"values",
"are",
"not",
"square",
"only",
"the",
"upper",
"lef... | d2b436bbdf951dc1fda56096a42dbc0eae4d35a5 | https://github.com/TheHortonMachine/hortonmachine/blob/d2b436bbdf951dc1fda56096a42dbc0eae4d35a5/gears/src/main/java/org/hortonmachine/gears/utils/math/matrixes/SquareMatrix.java#L45-L49 | train |
TheHortonMachine/hortonmachine | gears/src/main/java/org/hortonmachine/gears/utils/math/matrixes/SquareMatrix.java | SquareMatrix.set | protected void set(double values[][])
{
super.set(values);
nRows = nCols = Math.min(nRows, nCols);
} | java | protected void set(double values[][])
{
super.set(values);
nRows = nCols = Math.min(nRows, nCols);
} | [
"protected",
"void",
"set",
"(",
"double",
"values",
"[",
"]",
"[",
"]",
")",
"{",
"super",
".",
"set",
"(",
"values",
")",
";",
"nRows",
"=",
"nCols",
"=",
"Math",
".",
"min",
"(",
"nRows",
",",
"nCols",
")",
";",
"}"
] | Set this square matrix from a 2-d array of values. If the
values are not square, only the upper left square is used.
@param values the 2-d array of values | [
"Set",
"this",
"square",
"matrix",
"from",
"a",
"2",
"-",
"d",
"array",
"of",
"values",
".",
"If",
"the",
"values",
"are",
"not",
"square",
"only",
"the",
"upper",
"left",
"square",
"is",
"used",
"."
] | d2b436bbdf951dc1fda56096a42dbc0eae4d35a5 | https://github.com/TheHortonMachine/hortonmachine/blob/d2b436bbdf951dc1fda56096a42dbc0eae4d35a5/gears/src/main/java/org/hortonmachine/gears/utils/math/matrixes/SquareMatrix.java#L56-L60 | train |
TheHortonMachine/hortonmachine | gears/src/main/java/org/hortonmachine/gears/utils/PrintUtilities.java | PrintUtilities.printMatrixData | public static void printMatrixData(double[][] matrix) {
int cols = matrix[0].length;
int rows = matrix.length;
for (int r = 0; r < rows; r++) {
for (int c = 0; c < cols; c++) {
printer.print(matrix[r][c]);
printer.print(separator);
}
... | java | public static void printMatrixData(double[][] matrix) {
int cols = matrix[0].length;
int rows = matrix.length;
for (int r = 0; r < rows; r++) {
for (int c = 0; c < cols; c++) {
printer.print(matrix[r][c]);
printer.print(separator);
}
... | [
"public",
"static",
"void",
"printMatrixData",
"(",
"double",
"[",
"]",
"[",
"]",
"matrix",
")",
"{",
"int",
"cols",
"=",
"matrix",
"[",
"0",
"]",
".",
"length",
";",
"int",
"rows",
"=",
"matrix",
".",
"length",
";",
"for",
"(",
"int",
"r",
"=",
... | Print data from a matrix.
@param matrix
the matrix. | [
"Print",
"data",
"from",
"a",
"matrix",
"."
] | d2b436bbdf951dc1fda56096a42dbc0eae4d35a5 | https://github.com/TheHortonMachine/hortonmachine/blob/d2b436bbdf951dc1fda56096a42dbc0eae4d35a5/gears/src/main/java/org/hortonmachine/gears/utils/PrintUtilities.java#L150-L160 | train |
TheHortonMachine/hortonmachine | gears/src/main/java/org/hortonmachine/gears/utils/PrintUtilities.java | PrintUtilities.envelope2WKT | public static String envelope2WKT(org.locationtech.jts.geom.Envelope env) {
GeometryFactory gf = GeometryUtilities.gf();
Geometry geometry = gf.toGeometry(env);
return geometry.toText();
} | java | public static String envelope2WKT(org.locationtech.jts.geom.Envelope env) {
GeometryFactory gf = GeometryUtilities.gf();
Geometry geometry = gf.toGeometry(env);
return geometry.toText();
} | [
"public",
"static",
"String",
"envelope2WKT",
"(",
"org",
".",
"locationtech",
".",
"jts",
".",
"geom",
".",
"Envelope",
"env",
")",
"{",
"GeometryFactory",
"gf",
"=",
"GeometryUtilities",
".",
"gf",
"(",
")",
";",
"Geometry",
"geometry",
"=",
"gf",
".",
... | Print the envelope as WKT.
@param env
the {@link org.locationtech.jts.geom.Envelope}.
@return the WKT string. | [
"Print",
"the",
"envelope",
"as",
"WKT",
"."
] | d2b436bbdf951dc1fda56096a42dbc0eae4d35a5 | https://github.com/TheHortonMachine/hortonmachine/blob/d2b436bbdf951dc1fda56096a42dbc0eae4d35a5/gears/src/main/java/org/hortonmachine/gears/utils/PrintUtilities.java#L169-L173 | train |
TheHortonMachine/hortonmachine | gears/src/main/java/org/hortonmachine/gears/utils/style/sld/RewindableInputStream.java | RewindableInputStream.read | public int read() throws IOException {
int b = 0;
// Byte to be read is already in out buffer, simply returning it
if (fOffset < fLength) {
return fData[fOffset++] & 0xff;
}
/*
* End of the stream is reached.
* I also believe that in certain cases ... | java | public int read() throws IOException {
int b = 0;
// Byte to be read is already in out buffer, simply returning it
if (fOffset < fLength) {
return fData[fOffset++] & 0xff;
}
/*
* End of the stream is reached.
* I also believe that in certain cases ... | [
"public",
"int",
"read",
"(",
")",
"throws",
"IOException",
"{",
"int",
"b",
"=",
"0",
";",
"// Byte to be read is already in out buffer, simply returning it",
"if",
"(",
"fOffset",
"<",
"fLength",
")",
"{",
"return",
"fData",
"[",
"fOffset",
"++",
"]",
"&",
"... | Reads next byte from this stream. This byte is either being read from underlying InputStream
or taken from the internal buffer in case it was already read at some point before.
@return Next byte of data or <code>-1</code> if end of stream is reached.
@throws IOException in case of any I/O errors. | [
"Reads",
"next",
"byte",
"from",
"this",
"stream",
".",
"This",
"byte",
"is",
"either",
"being",
"read",
"from",
"underlying",
"InputStream",
"or",
"taken",
"from",
"the",
"internal",
"buffer",
"in",
"case",
"it",
"was",
"already",
"read",
"at",
"some",
"p... | d2b436bbdf951dc1fda56096a42dbc0eae4d35a5 | https://github.com/TheHortonMachine/hortonmachine/blob/d2b436bbdf951dc1fda56096a42dbc0eae4d35a5/gears/src/main/java/org/hortonmachine/gears/utils/style/sld/RewindableInputStream.java#L166-L210 | train |
TheHortonMachine/hortonmachine | gears/src/main/java/org/hortonmachine/gears/utils/style/sld/RewindableInputStream.java | RewindableInputStream.close | public void close() throws IOException {
if (fInputStream != null) {
fInputStream.close();
fInputStream = null;
fData = null;
}
} | java | public void close() throws IOException {
if (fInputStream != null) {
fInputStream.close();
fInputStream = null;
fData = null;
}
} | [
"public",
"void",
"close",
"(",
")",
"throws",
"IOException",
"{",
"if",
"(",
"fInputStream",
"!=",
"null",
")",
"{",
"fInputStream",
".",
"close",
"(",
")",
";",
"fInputStream",
"=",
"null",
";",
"fData",
"=",
"null",
";",
"}",
"}"
] | Closes underlying byte stream.
@throws IOException if an I/O error occurs. | [
"Closes",
"underlying",
"byte",
"stream",
"."
] | d2b436bbdf951dc1fda56096a42dbc0eae4d35a5 | https://github.com/TheHortonMachine/hortonmachine/blob/d2b436bbdf951dc1fda56096a42dbc0eae4d35a5/gears/src/main/java/org/hortonmachine/gears/utils/style/sld/RewindableInputStream.java#L426-L432 | train |
enasequence/sequencetools | src/main/java/uk/ac/ebi/embl/api/translation/TranslationResult.java | TranslationResult.getTranslation | public String getTranslation() {
if (codons == null) {
return "";
}
StringBuilder translation = new StringBuilder();
for (Codon codon : codons) {
translation.append(codon.getAminoAcid());
}
return translation.toString();
} | java | public String getTranslation() {
if (codons == null) {
return "";
}
StringBuilder translation = new StringBuilder();
for (Codon codon : codons) {
translation.append(codon.getAminoAcid());
}
return translation.toString();
} | [
"public",
"String",
"getTranslation",
"(",
")",
"{",
"if",
"(",
"codons",
"==",
"null",
")",
"{",
"return",
"\"\"",
";",
"}",
"StringBuilder",
"translation",
"=",
"new",
"StringBuilder",
"(",
")",
";",
"for",
"(",
"Codon",
"codon",
":",
"codons",
")",
... | Returns the translation including stop codons
and trailing bases.
@return the translation including stop codons
and trailing base | [
"Returns",
"the",
"translation",
"including",
"stop",
"codons",
"and",
"trailing",
"bases",
"."
] | 4127f5e1a17540239f5810136153fbd6737fa262 | https://github.com/enasequence/sequencetools/blob/4127f5e1a17540239f5810136153fbd6737fa262/src/main/java/uk/ac/ebi/embl/api/translation/TranslationResult.java#L100-L109 | train |
enasequence/sequencetools | src/main/java/uk/ac/ebi/embl/api/translation/TranslationResult.java | TranslationResult.getConceptualTranslation | public String getConceptualTranslation() {
if (codons == null) {
return "";
}
StringBuilder translation = new StringBuilder();
for (int i = 0 ; i < conceptualTranslationCodons ; ++i) {
Codon codon = codons.get(i);
translation.append(codon.getAm... | java | public String getConceptualTranslation() {
if (codons == null) {
return "";
}
StringBuilder translation = new StringBuilder();
for (int i = 0 ; i < conceptualTranslationCodons ; ++i) {
Codon codon = codons.get(i);
translation.append(codon.getAm... | [
"public",
"String",
"getConceptualTranslation",
"(",
")",
"{",
"if",
"(",
"codons",
"==",
"null",
")",
"{",
"return",
"\"\"",
";",
"}",
"StringBuilder",
"translation",
"=",
"new",
"StringBuilder",
"(",
")",
";",
"for",
"(",
"int",
"i",
"=",
"0",
";",
"... | Returns the translation excluding stop codons
and trailing bases.
@return the translation excluding stop codons
and trailing bases. | [
"Returns",
"the",
"translation",
"excluding",
"stop",
"codons",
"and",
"trailing",
"bases",
"."
] | 4127f5e1a17540239f5810136153fbd6737fa262 | https://github.com/enasequence/sequencetools/blob/4127f5e1a17540239f5810136153fbd6737fa262/src/main/java/uk/ac/ebi/embl/api/translation/TranslationResult.java#L116-L126 | train |
TheHortonMachine/hortonmachine | gears/src/main/java/org/hortonmachine/gears/modules/r/filter/OmsKernelFilter.java | OmsKernelFilter.gaussianSmooth | public static double[] gaussianSmooth( double[] values, int kernelRadius ) throws Exception {
int size = values.length;
double[] newValues = new double[values.length];
double[] kernelData2D = makeGaussianKernel(kernelRadius);
for( int i = 0; i < kernelRadius; i++ ) {
newValue... | java | public static double[] gaussianSmooth( double[] values, int kernelRadius ) throws Exception {
int size = values.length;
double[] newValues = new double[values.length];
double[] kernelData2D = makeGaussianKernel(kernelRadius);
for( int i = 0; i < kernelRadius; i++ ) {
newValue... | [
"public",
"static",
"double",
"[",
"]",
"gaussianSmooth",
"(",
"double",
"[",
"]",
"values",
",",
"int",
"kernelRadius",
")",
"throws",
"Exception",
"{",
"int",
"size",
"=",
"values",
".",
"length",
";",
"double",
"[",
"]",
"newValues",
"=",
"new",
"doub... | Smooth an array of values with a gaussian blur.
@param values the values to smooth.
@param kernelRadius the radius of the kernel to use.
@return the smoothed values.
@throws Exception | [
"Smooth",
"an",
"array",
"of",
"values",
"with",
"a",
"gaussian",
"blur",
"."
] | d2b436bbdf951dc1fda56096a42dbc0eae4d35a5 | https://github.com/TheHortonMachine/hortonmachine/blob/d2b436bbdf951dc1fda56096a42dbc0eae4d35a5/gears/src/main/java/org/hortonmachine/gears/modules/r/filter/OmsKernelFilter.java#L144-L168 | train |
TheHortonMachine/hortonmachine | gears/src/main/java/org/hortonmachine/gears/modules/r/filter/OmsKernelFilter.java | OmsKernelFilter.averageSmooth | public static double[] averageSmooth( double[] values, int lookAhead ) throws Exception {
int size = values.length;
double[] newValues = new double[values.length];
for( int i = 0; i < lookAhead; i++ ) {
newValues[i] = values[i];
}
for( int i = lookAhead; i < size - lo... | java | public static double[] averageSmooth( double[] values, int lookAhead ) throws Exception {
int size = values.length;
double[] newValues = new double[values.length];
for( int i = 0; i < lookAhead; i++ ) {
newValues[i] = values[i];
}
for( int i = lookAhead; i < size - lo... | [
"public",
"static",
"double",
"[",
"]",
"averageSmooth",
"(",
"double",
"[",
"]",
"values",
",",
"int",
"lookAhead",
")",
"throws",
"Exception",
"{",
"int",
"size",
"=",
"values",
".",
"length",
";",
"double",
"[",
"]",
"newValues",
"=",
"new",
"double",... | Smooth an array of values with an averaging moving window.
@param values the values to smooth.
@param lookAhead the size of half of the window.
@return the smoothed values.
@throws Exception | [
"Smooth",
"an",
"array",
"of",
"values",
"with",
"an",
"averaging",
"moving",
"window",
"."
] | d2b436bbdf951dc1fda56096a42dbc0eae4d35a5 | https://github.com/TheHortonMachine/hortonmachine/blob/d2b436bbdf951dc1fda56096a42dbc0eae4d35a5/gears/src/main/java/org/hortonmachine/gears/modules/r/filter/OmsKernelFilter.java#L178-L200 | train |
TheHortonMachine/hortonmachine | gears/src/main/java/org/hortonmachine/gears/utils/ENU.java | ENU.wgs84ToEnu | public Coordinate wgs84ToEnu( Coordinate cLL ) {
checkZ(cLL);
Coordinate cEcef = wgs84ToEcef(cLL);
Coordinate enu = ecefToEnu(cEcef);
return enu;
} | java | public Coordinate wgs84ToEnu( Coordinate cLL ) {
checkZ(cLL);
Coordinate cEcef = wgs84ToEcef(cLL);
Coordinate enu = ecefToEnu(cEcef);
return enu;
} | [
"public",
"Coordinate",
"wgs84ToEnu",
"(",
"Coordinate",
"cLL",
")",
"{",
"checkZ",
"(",
"cLL",
")",
";",
"Coordinate",
"cEcef",
"=",
"wgs84ToEcef",
"(",
"cLL",
")",
";",
"Coordinate",
"enu",
"=",
"ecefToEnu",
"(",
"cEcef",
")",
";",
"return",
"enu",
";"... | Converts the wgs84 coordinate to ENU.
@param cLL the wgs84 coordinate.
@return the ENU coordinate.
@throws MatrixException | [
"Converts",
"the",
"wgs84",
"coordinate",
"to",
"ENU",
"."
] | d2b436bbdf951dc1fda56096a42dbc0eae4d35a5 | https://github.com/TheHortonMachine/hortonmachine/blob/d2b436bbdf951dc1fda56096a42dbc0eae4d35a5/gears/src/main/java/org/hortonmachine/gears/utils/ENU.java#L115-L120 | train |
TheHortonMachine/hortonmachine | gears/src/main/java/org/hortonmachine/gears/utils/ENU.java | ENU.enuToWgs84 | public Coordinate enuToWgs84( Coordinate enu ) {
checkZ(enu);
Coordinate cEcef = enuToEcef(enu);
Coordinate wgs84 = ecefToWgs84(cEcef);
return wgs84;
} | java | public Coordinate enuToWgs84( Coordinate enu ) {
checkZ(enu);
Coordinate cEcef = enuToEcef(enu);
Coordinate wgs84 = ecefToWgs84(cEcef);
return wgs84;
} | [
"public",
"Coordinate",
"enuToWgs84",
"(",
"Coordinate",
"enu",
")",
"{",
"checkZ",
"(",
"enu",
")",
";",
"Coordinate",
"cEcef",
"=",
"enuToEcef",
"(",
"enu",
")",
";",
"Coordinate",
"wgs84",
"=",
"ecefToWgs84",
"(",
"cEcef",
")",
";",
"return",
"wgs84",
... | Converts the ENU coordinate to wgs84.
@param enu the ENU coordinate.
@return the wgs84 coordinate.
@throws MatrixException | [
"Converts",
"the",
"ENU",
"coordinate",
"to",
"wgs84",
"."
] | d2b436bbdf951dc1fda56096a42dbc0eae4d35a5 | https://github.com/TheHortonMachine/hortonmachine/blob/d2b436bbdf951dc1fda56096a42dbc0eae4d35a5/gears/src/main/java/org/hortonmachine/gears/utils/ENU.java#L129-L134 | train |
TheHortonMachine/hortonmachine | gears/src/main/java/org/hortonmachine/gears/utils/ENU.java | ENU.convertGeometryFromEnuToWgs84 | public void convertGeometryFromEnuToWgs84( Geometry geometryEnu ) {
Coordinate[] coordinates = geometryEnu.getCoordinates();
for( int i = 0; i < coordinates.length; i++ ) {
Coordinate wgs84 = enuToWgs84(coordinates[i]);
coordinates[i].x = wgs84.x;
coordinates[i].y = w... | java | public void convertGeometryFromEnuToWgs84( Geometry geometryEnu ) {
Coordinate[] coordinates = geometryEnu.getCoordinates();
for( int i = 0; i < coordinates.length; i++ ) {
Coordinate wgs84 = enuToWgs84(coordinates[i]);
coordinates[i].x = wgs84.x;
coordinates[i].y = w... | [
"public",
"void",
"convertGeometryFromEnuToWgs84",
"(",
"Geometry",
"geometryEnu",
")",
"{",
"Coordinate",
"[",
"]",
"coordinates",
"=",
"geometryEnu",
".",
"getCoordinates",
"(",
")",
";",
"for",
"(",
"int",
"i",
"=",
"0",
";",
"i",
"<",
"coordinates",
".",... | Converts a geometry from ENU to WGS.
<p>Note that the geometry is internally converted. Use clone() if you need a copy.</p>
@param geometryEnu | [
"Converts",
"a",
"geometry",
"from",
"ENU",
"to",
"WGS",
"."
] | d2b436bbdf951dc1fda56096a42dbc0eae4d35a5 | https://github.com/TheHortonMachine/hortonmachine/blob/d2b436bbdf951dc1fda56096a42dbc0eae4d35a5/gears/src/main/java/org/hortonmachine/gears/utils/ENU.java#L232-L240 | train |
TheHortonMachine/hortonmachine | gears/src/main/java/org/hortonmachine/gears/utils/ENU.java | ENU.convertGeometryFromWgsToEnu | public void convertGeometryFromWgsToEnu( Geometry geometryWgs ) {
Coordinate[] coordinates = geometryWgs.getCoordinates();
for( int i = 0; i < coordinates.length; i++ ) {
Coordinate enu = wgs84ToEnu(coordinates[i]);
coordinates[i].x = enu.x;
coordinates[i].y = enu.y;
... | java | public void convertGeometryFromWgsToEnu( Geometry geometryWgs ) {
Coordinate[] coordinates = geometryWgs.getCoordinates();
for( int i = 0; i < coordinates.length; i++ ) {
Coordinate enu = wgs84ToEnu(coordinates[i]);
coordinates[i].x = enu.x;
coordinates[i].y = enu.y;
... | [
"public",
"void",
"convertGeometryFromWgsToEnu",
"(",
"Geometry",
"geometryWgs",
")",
"{",
"Coordinate",
"[",
"]",
"coordinates",
"=",
"geometryWgs",
".",
"getCoordinates",
"(",
")",
";",
"for",
"(",
"int",
"i",
"=",
"0",
";",
"i",
"<",
"coordinates",
".",
... | Converts a geometry from WGS to ENU.
<p>Note that the geometry is internally converted. Use clone() if you need a copy.</p>
@param geometryWgs | [
"Converts",
"a",
"geometry",
"from",
"WGS",
"to",
"ENU",
"."
] | d2b436bbdf951dc1fda56096a42dbc0eae4d35a5 | https://github.com/TheHortonMachine/hortonmachine/blob/d2b436bbdf951dc1fda56096a42dbc0eae4d35a5/gears/src/main/java/org/hortonmachine/gears/utils/ENU.java#L249-L257 | train |
TheHortonMachine/hortonmachine | gears/src/main/java/org/hortonmachine/gears/utils/ENU.java | ENU.convertEnvelopeFromWgsToEnu | public Envelope convertEnvelopeFromWgsToEnu( Envelope envelopeWgs ) {
Polygon polygonEnu = GeometryUtilities.createPolygonFromEnvelope(envelopeWgs);
convertGeometryFromWgsToEnu(polygonEnu);
Envelope envelopeEnu = polygonEnu.getEnvelopeInternal();
return envelopeEnu;
} | java | public Envelope convertEnvelopeFromWgsToEnu( Envelope envelopeWgs ) {
Polygon polygonEnu = GeometryUtilities.createPolygonFromEnvelope(envelopeWgs);
convertGeometryFromWgsToEnu(polygonEnu);
Envelope envelopeEnu = polygonEnu.getEnvelopeInternal();
return envelopeEnu;
} | [
"public",
"Envelope",
"convertEnvelopeFromWgsToEnu",
"(",
"Envelope",
"envelopeWgs",
")",
"{",
"Polygon",
"polygonEnu",
"=",
"GeometryUtilities",
".",
"createPolygonFromEnvelope",
"(",
"envelopeWgs",
")",
";",
"convertGeometryFromWgsToEnu",
"(",
"polygonEnu",
")",
";",
... | Converts an envelope from WGS to ENU.
@param envelopeWgs
@return the converted envelope. | [
"Converts",
"an",
"envelope",
"from",
"WGS",
"to",
"ENU",
"."
] | d2b436bbdf951dc1fda56096a42dbc0eae4d35a5 | https://github.com/TheHortonMachine/hortonmachine/blob/d2b436bbdf951dc1fda56096a42dbc0eae4d35a5/gears/src/main/java/org/hortonmachine/gears/utils/ENU.java#L265-L270 | train |
TheHortonMachine/hortonmachine | apps/src/main/java/org/hortonmachine/nww/gui/NwwPanel.java | NwwPanel.goTo | public synchronized Position goTo( Double lon, Double lat, Double elev, Double azimuth, boolean animate ) {
View view = getWwd().getView();
view.stopAnimations();
view.stopMovement();
Position eyePosition;
if (lon == null || lat == null) {
Position currentEyePosition... | java | public synchronized Position goTo( Double lon, Double lat, Double elev, Double azimuth, boolean animate ) {
View view = getWwd().getView();
view.stopAnimations();
view.stopMovement();
Position eyePosition;
if (lon == null || lat == null) {
Position currentEyePosition... | [
"public",
"synchronized",
"Position",
"goTo",
"(",
"Double",
"lon",
",",
"Double",
"lat",
",",
"Double",
"elev",
",",
"Double",
"azimuth",
",",
"boolean",
"animate",
")",
"{",
"View",
"view",
"=",
"getWwd",
"(",
")",
".",
"getView",
"(",
")",
";",
"vie... | Move to a given location.
@param lon
the longitude.
@param lat
the latitude.
@param elev
the eye elevation.
@param azimuth
if supplied, the map is rotated to follow that angle.
@param animate
if <code>true</code>, it animates to the position. | [
"Move",
"to",
"a",
"given",
"location",
"."
] | d2b436bbdf951dc1fda56096a42dbc0eae4d35a5 | https://github.com/TheHortonMachine/hortonmachine/blob/d2b436bbdf951dc1fda56096a42dbc0eae4d35a5/apps/src/main/java/org/hortonmachine/nww/gui/NwwPanel.java#L208-L247 | train |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.