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/modules/r/cutout/OmsCutOut.java
OmsCutOut.cut
public static GridCoverage2D cut( GridCoverage2D raster, GridCoverage2D mask ) throws Exception { OmsCutOut cutDrain = new OmsCutOut(); cutDrain.inRaster = raster; cutDrain.inMask = mask; cutDrain.process(); return cutDrain.outRaster; }
java
public static GridCoverage2D cut( GridCoverage2D raster, GridCoverage2D mask ) throws Exception { OmsCutOut cutDrain = new OmsCutOut(); cutDrain.inRaster = raster; cutDrain.inMask = mask; cutDrain.process(); return cutDrain.outRaster; }
[ "public", "static", "GridCoverage2D", "cut", "(", "GridCoverage2D", "raster", ",", "GridCoverage2D", "mask", ")", "throws", "Exception", "{", "OmsCutOut", "cutDrain", "=", "new", "OmsCutOut", "(", ")", ";", "cutDrain", ".", "inRaster", "=", "raster", ";", "cut...
Cut a raster on a mask using the default parameters. @param raster the raster to cut. @param mask the mask to apply. @return the cut map. @throws Exception
[ "Cut", "a", "raster", "on", "a", "mask", "using", "the", "default", "parameters", "." ]
d2b436bbdf951dc1fda56096a42dbc0eae4d35a5
https://github.com/TheHortonMachine/hortonmachine/blob/d2b436bbdf951dc1fda56096a42dbc0eae4d35a5/gears/src/main/java/org/hortonmachine/gears/modules/r/cutout/OmsCutOut.java#L186-L192
train
enasequence/sequencetools
src/main/java/uk/ac/ebi/embl/api/validation/ValidationResult.java
ValidationResult.addMessage
private void addMessage(ValidationMessage<Origin> message) { if (message == null) { return; } if( null != defaultOrigin ) { message.addOrigin( defaultOrigin ); } this.messages.add(message); }
java
private void addMessage(ValidationMessage<Origin> message) { if (message == null) { return; } if( null != defaultOrigin ) { message.addOrigin( defaultOrigin ); } this.messages.add(message); }
[ "private", "void", "addMessage", "(", "ValidationMessage", "<", "Origin", ">", "message", ")", "{", "if", "(", "message", "==", "null", ")", "{", "return", ";", "}", "if", "(", "null", "!=", "defaultOrigin", ")", "{", "message", ".", "addOrigin", "(", ...
Adds a validation message to the result. @param message a validation message to be added
[ "Adds", "a", "validation", "message", "to", "the", "result", "." ]
4127f5e1a17540239f5810136153fbd6737fa262
https://github.com/enasequence/sequencetools/blob/4127f5e1a17540239f5810136153fbd6737fa262/src/main/java/uk/ac/ebi/embl/api/validation/ValidationResult.java#L131-L141
train
enasequence/sequencetools
src/main/java/uk/ac/ebi/embl/api/validation/ValidationResult.java
ValidationResult.count
public int count(Severity severity) { int result = 0; if (severity == null) { return result; } for (ValidationMessage<Origin> message : messages) { if (severity.equals(message.getSeverity())) { result++; } } return result; }
java
public int count(Severity severity) { int result = 0; if (severity == null) { return result; } for (ValidationMessage<Origin> message : messages) { if (severity.equals(message.getSeverity())) { result++; } } return result; }
[ "public", "int", "count", "(", "Severity", "severity", ")", "{", "int", "result", "=", "0", ";", "if", "(", "severity", "==", "null", ")", "{", "return", "result", ";", "}", "for", "(", "ValidationMessage", "<", "Origin", ">", "message", ":", "messages...
Counts validation messages by its severity. @param severity a severity of the message which should be counted @return a number of validation messages with provided severity
[ "Counts", "validation", "messages", "by", "its", "severity", "." ]
4127f5e1a17540239f5810136153fbd6737fa262
https://github.com/enasequence/sequencetools/blob/4127f5e1a17540239f5810136153fbd6737fa262/src/main/java/uk/ac/ebi/embl/api/validation/ValidationResult.java#L215-L226
train
enasequence/sequencetools
src/main/java/uk/ac/ebi/embl/api/validation/ValidationResult.java
ValidationResult.removeMessage
public void removeMessage(String messageId) { Collection<ValidationMessage<Origin>> toRemove = new ArrayList<ValidationMessage<Origin>>(); for (ValidationMessage<Origin> message : messages) { if (messageId.equals(message.getMessageKey())) { toRemove.add(message); ...
java
public void removeMessage(String messageId) { Collection<ValidationMessage<Origin>> toRemove = new ArrayList<ValidationMessage<Origin>>(); for (ValidationMessage<Origin> message : messages) { if (messageId.equals(message.getMessageKey())) { toRemove.add(message); ...
[ "public", "void", "removeMessage", "(", "String", "messageId", ")", "{", "Collection", "<", "ValidationMessage", "<", "Origin", ">>", "toRemove", "=", "new", "ArrayList", "<", "ValidationMessage", "<", "Origin", ">", ">", "(", ")", ";", "for", "(", "Validati...
removes all messages with a specified message id @param messageId
[ "removes", "all", "messages", "with", "a", "specified", "message", "id" ]
4127f5e1a17540239f5810136153fbd6737fa262
https://github.com/enasequence/sequencetools/blob/4127f5e1a17540239f5810136153fbd6737fa262/src/main/java/uk/ac/ebi/embl/api/validation/ValidationResult.java#L302-L311
train
TheHortonMachine/hortonmachine
gears/src/main/java/org/hortonmachine/gears/io/las/index/strtree/BoundablePair.java
BoundablePair.compareTo
public int compareTo( Object o ) { BoundablePair nd = (BoundablePair) o; if (distance < nd.distance) return -1; if (distance > nd.distance) return 1; return 0; }
java
public int compareTo( Object o ) { BoundablePair nd = (BoundablePair) o; if (distance < nd.distance) return -1; if (distance > nd.distance) return 1; return 0; }
[ "public", "int", "compareTo", "(", "Object", "o", ")", "{", "BoundablePair", "nd", "=", "(", "BoundablePair", ")", "o", ";", "if", "(", "distance", "<", "nd", ".", "distance", ")", "return", "-", "1", ";", "if", "(", "distance", ">", "nd", ".", "di...
Compares two pairs based on their minimum distances
[ "Compares", "two", "pairs", "based", "on", "their", "minimum", "distances" ]
d2b436bbdf951dc1fda56096a42dbc0eae4d35a5
https://github.com/TheHortonMachine/hortonmachine/blob/d2b436bbdf951dc1fda56096a42dbc0eae4d35a5/gears/src/main/java/org/hortonmachine/gears/io/las/index/strtree/BoundablePair.java#L134-L141
train
TheHortonMachine/hortonmachine
gears/src/main/java/org/hortonmachine/gears/utils/math/interpolation/splines/Bspline.java
Bspline.b
double b( int i, double t ) { switch( i ) { case -2: return (((-t + 3) * t - 3) * t + 1) / 6; case -1: return (((3 * t - 6) * t) * t + 4) / 6; case 0: return (((-3 * t + 3) * t + 3) * t + 1) / 6; case 1: return (t * t * t) / 6; ...
java
double b( int i, double t ) { switch( i ) { case -2: return (((-t + 3) * t - 3) * t + 1) / 6; case -1: return (((3 * t - 6) * t) * t + 4) / 6; case 0: return (((-3 * t + 3) * t + 3) * t + 1) / 6; case 1: return (t * t * t) / 6; ...
[ "double", "b", "(", "int", "i", ",", "double", "t", ")", "{", "switch", "(", "i", ")", "{", "case", "-", "2", ":", "return", "(", "(", "(", "-", "t", "+", "3", ")", "*", "t", "-", "3", ")", "*", "t", "+", "1", ")", "/", "6", ";", "cas...
the basis function for a cubic B spline
[ "the", "basis", "function", "for", "a", "cubic", "B", "spline" ]
d2b436bbdf951dc1fda56096a42dbc0eae4d35a5
https://github.com/TheHortonMachine/hortonmachine/blob/d2b436bbdf951dc1fda56096a42dbc0eae4d35a5/gears/src/main/java/org/hortonmachine/gears/utils/math/interpolation/splines/Bspline.java#L35-L47
train
TheHortonMachine/hortonmachine
gears/src/main/java/org/hortonmachine/gears/utils/math/interpolation/splines/Bspline.java
Bspline.p
private Coordinate p( int i, double t ) { double px = 0; double py = 0; for( int j = -2; j <= 1; j++ ) { Coordinate coordinate = pts.get(i + j); px += b(j, t) * coordinate.x; py += b(j, t) * coordinate.y; } return new Coordinate(px, py); }
java
private Coordinate p( int i, double t ) { double px = 0; double py = 0; for( int j = -2; j <= 1; j++ ) { Coordinate coordinate = pts.get(i + j); px += b(j, t) * coordinate.x; py += b(j, t) * coordinate.y; } return new Coordinate(px, py); }
[ "private", "Coordinate", "p", "(", "int", "i", ",", "double", "t", ")", "{", "double", "px", "=", "0", ";", "double", "py", "=", "0", ";", "for", "(", "int", "j", "=", "-", "2", ";", "j", "<=", "1", ";", "j", "++", ")", "{", "Coordinate", "...
evaluate a point on the B spline
[ "evaluate", "a", "point", "on", "the", "B", "spline" ]
d2b436bbdf951dc1fda56096a42dbc0eae4d35a5
https://github.com/TheHortonMachine/hortonmachine/blob/d2b436bbdf951dc1fda56096a42dbc0eae4d35a5/gears/src/main/java/org/hortonmachine/gears/utils/math/interpolation/splines/Bspline.java#L50-L59
train
TheHortonMachine/hortonmachine
gears/src/main/java/org/hortonmachine/gears/utils/sorting/OddEvenSortAlgorithm.java
OddEvenSortAlgorithm.oddEvenSort
public static void oddEvenSort( List<Double> listToBeSorted, List<Double> listThatFollowsTheSort ) { for( int i = 0; i < listToBeSorted.size() / 2; i++ ) { for( int j = 0; j + 1 < listToBeSorted.size(); j += 2 ) if (listToBeSorted.get(j) > listToBeSorted.get(j + 1)) { ...
java
public static void oddEvenSort( List<Double> listToBeSorted, List<Double> listThatFollowsTheSort ) { for( int i = 0; i < listToBeSorted.size() / 2; i++ ) { for( int j = 0; j + 1 < listToBeSorted.size(); j += 2 ) if (listToBeSorted.get(j) > listToBeSorted.get(j + 1)) { ...
[ "public", "static", "void", "oddEvenSort", "(", "List", "<", "Double", ">", "listToBeSorted", ",", "List", "<", "Double", ">", "listThatFollowsTheSort", ")", "{", "for", "(", "int", "i", "=", "0", ";", "i", "<", "listToBeSorted", ".", "size", "(", ")", ...
Sorts two lists regarding to the sort of the first @param listToBeSorted the array on wich the sort is performed @param listThatFollowsTheSort the array that is sorted following the others list sort. Can be null, in which case it acts like a normal sorting algorithm
[ "Sorts", "two", "lists", "regarding", "to", "the", "sort", "of", "the", "first" ]
d2b436bbdf951dc1fda56096a42dbc0eae4d35a5
https://github.com/TheHortonMachine/hortonmachine/blob/d2b436bbdf951dc1fda56096a42dbc0eae4d35a5/gears/src/main/java/org/hortonmachine/gears/utils/sorting/OddEvenSortAlgorithm.java#L67-L92
train
TheHortonMachine/hortonmachine
gears/src/main/java/org/hortonmachine/gears/utils/math/integration/SimpsonIntegral.java
SimpsonIntegral.simpson
protected double simpson() { double s = 0f; double st = 0f; double ost = 0f; double os = 0f; for( int i = 1; i < maxsteps; i++ ) { st = trapezoid(i); s = (4f * st - ost) / 3f; if (i > 5) { if (Math.abs(s - os) < accuracy * Ma...
java
protected double simpson() { double s = 0f; double st = 0f; double ost = 0f; double os = 0f; for( int i = 1; i < maxsteps; i++ ) { st = trapezoid(i); s = (4f * st - ost) / 3f; if (i > 5) { if (Math.abs(s - os) < accuracy * Ma...
[ "protected", "double", "simpson", "(", ")", "{", "double", "s", "=", "0f", ";", "double", "st", "=", "0f", ";", "double", "ost", "=", "0f", ";", "double", "os", "=", "0f", ";", "for", "(", "int", "i", "=", "1", ";", "i", "<", "maxsteps", ";", ...
Calculate the integral with the simpson method of the equation implemented in the method equation @return @throws Exception
[ "Calculate", "the", "integral", "with", "the", "simpson", "method", "of", "the", "equation", "implemented", "in", "the", "method", "equation" ]
d2b436bbdf951dc1fda56096a42dbc0eae4d35a5
https://github.com/TheHortonMachine/hortonmachine/blob/d2b436bbdf951dc1fda56096a42dbc0eae4d35a5/gears/src/main/java/org/hortonmachine/gears/utils/math/integration/SimpsonIntegral.java#L46-L67
train
TheHortonMachine/hortonmachine
gears/src/main/java/org/hortonmachine/gears/utils/math/integration/SimpsonIntegral.java
SimpsonIntegral.trapezoid
protected double trapezoid( int n ) { double x = 0; double tnm = 0; double sum = 0; double del = 0; int it = 0; int j = 0; if (n == 1) { strapezoid = 0.5f * (upperlimit - lowerlimit) * (equation(lowerlimit) + equation(upperlimit));...
java
protected double trapezoid( int n ) { double x = 0; double tnm = 0; double sum = 0; double del = 0; int it = 0; int j = 0; if (n == 1) { strapezoid = 0.5f * (upperlimit - lowerlimit) * (equation(lowerlimit) + equation(upperlimit));...
[ "protected", "double", "trapezoid", "(", "int", "n", ")", "{", "double", "x", "=", "0", ";", "double", "tnm", "=", "0", ";", "double", "sum", "=", "0", ";", "double", "del", "=", "0", ";", "int", "it", "=", "0", ";", "int", "j", "=", "0", ";"...
Calculate the integral with the trapezoidal algorithm of the equation implemented in the method equation @param n - number of steps to perform @return
[ "Calculate", "the", "integral", "with", "the", "trapezoidal", "algorithm", "of", "the", "equation", "implemented", "in", "the", "method", "equation" ]
d2b436bbdf951dc1fda56096a42dbc0eae4d35a5
https://github.com/TheHortonMachine/hortonmachine/blob/d2b436bbdf951dc1fda56096a42dbc0eae4d35a5/gears/src/main/java/org/hortonmachine/gears/utils/math/integration/SimpsonIntegral.java#L76-L106
train
TheHortonMachine/hortonmachine
dbs/src/main/java/org/hortonmachine/dbs/utils/MercatorUtils.java
MercatorUtils.tileLatLonBounds
public static double[] tileLatLonBounds( int tx, int ty, int zoom, int tileSize ) { double[] bounds = tileBounds3857(tx, ty, zoom, tileSize); double[] mins = metersToLatLon(bounds[0], bounds[1]); double[] maxs = metersToLatLon(bounds[2], bounds[3]); return new double[]{mins[1], maxs[0], ...
java
public static double[] tileLatLonBounds( int tx, int ty, int zoom, int tileSize ) { double[] bounds = tileBounds3857(tx, ty, zoom, tileSize); double[] mins = metersToLatLon(bounds[0], bounds[1]); double[] maxs = metersToLatLon(bounds[2], bounds[3]); return new double[]{mins[1], maxs[0], ...
[ "public", "static", "double", "[", "]", "tileLatLonBounds", "(", "int", "tx", ",", "int", "ty", ",", "int", "zoom", ",", "int", "tileSize", ")", "{", "double", "[", "]", "bounds", "=", "tileBounds3857", "(", "tx", ",", "ty", ",", "zoom", ",", "tileSi...
Get lat-long bounds from tile index. @param tx tile x. @param ty tile y. @param zoom zoomlevel. @param tileSize tile size. @return [minx, miny, maxx, maxy]
[ "Get", "lat", "-", "long", "bounds", "from", "tile", "index", "." ]
d2b436bbdf951dc1fda56096a42dbc0eae4d35a5
https://github.com/TheHortonMachine/hortonmachine/blob/d2b436bbdf951dc1fda56096a42dbc0eae4d35a5/dbs/src/main/java/org/hortonmachine/dbs/utils/MercatorUtils.java#L74-L79
train
TheHortonMachine/hortonmachine
dbs/src/main/java/org/hortonmachine/dbs/utils/MercatorUtils.java
MercatorUtils.metersYToLatitude
public static double metersYToLatitude( double y ) { return Math.toDegrees(Math.atan(Math.sinh(y / EQUATORIALRADIUS))); }
java
public static double metersYToLatitude( double y ) { return Math.toDegrees(Math.atan(Math.sinh(y / EQUATORIALRADIUS))); }
[ "public", "static", "double", "metersYToLatitude", "(", "double", "y", ")", "{", "return", "Math", ".", "toDegrees", "(", "Math", ".", "atan", "(", "Math", ".", "sinh", "(", "y", "/", "EQUATORIALRADIUS", ")", ")", ")", ";", "}" ]
Convert a meter measure to a latitude @param y in meters @return latitude in degrees in spherical mercator projection
[ "Convert", "a", "meter", "measure", "to", "a", "latitude" ]
d2b436bbdf951dc1fda56096a42dbc0eae4d35a5
https://github.com/TheHortonMachine/hortonmachine/blob/d2b436bbdf951dc1fda56096a42dbc0eae4d35a5/dbs/src/main/java/org/hortonmachine/dbs/utils/MercatorUtils.java#L172-L174
train
TheHortonMachine/hortonmachine
dbs/src/main/java/org/hortonmachine/dbs/postgis/PostgisDb.java
PostgisDb.addGeometryXYColumnAndIndex
public void addGeometryXYColumnAndIndex( String tableName, String geomColName, String geomType, String epsg, boolean avoidIndex ) throws Exception { String epsgStr = "4326"; if (epsg != null) { epsgStr = epsg; } String geomTypeStr = "LINESTRING"; if (geomT...
java
public void addGeometryXYColumnAndIndex( String tableName, String geomColName, String geomType, String epsg, boolean avoidIndex ) throws Exception { String epsgStr = "4326"; if (epsg != null) { epsgStr = epsg; } String geomTypeStr = "LINESTRING"; if (geomT...
[ "public", "void", "addGeometryXYColumnAndIndex", "(", "String", "tableName", ",", "String", "geomColName", ",", "String", "geomType", ",", "String", "epsg", ",", "boolean", "avoidIndex", ")", "throws", "Exception", "{", "String", "epsgStr", "=", "\"4326\"", ";", ...
Adds a geometry column to a table. @param tableName the table name. @param geomColName the geometry column name. @param geomType the geometry type (ex. LINESTRING); @param epsg the optional epsg code (default is 4326); @param avoidIndex if <code>true</code>, the index is not created. @throws Exception
[ "Adds", "a", "geometry", "column", "to", "a", "table", "." ]
d2b436bbdf951dc1fda56096a42dbc0eae4d35a5
https://github.com/TheHortonMachine/hortonmachine/blob/d2b436bbdf951dc1fda56096a42dbc0eae4d35a5/dbs/src/main/java/org/hortonmachine/dbs/postgis/PostgisDb.java#L279-L310
train
TheHortonMachine/hortonmachine
gears/src/main/java/org/hortonmachine/gears/modules/r/tmsgenerator/MBTilesHelper.java
MBTilesHelper.getTile
public BufferedImage getTile( int x, int y, int z ) throws Exception { try (PreparedStatement statement = connection.prepareStatement(SELECTQUERY)) { statement.setInt(1, z); statement.setInt(2, x); statement.setInt(3, y); ResultSet resultSet = statement.executeQue...
java
public BufferedImage getTile( int x, int y, int z ) throws Exception { try (PreparedStatement statement = connection.prepareStatement(SELECTQUERY)) { statement.setInt(1, z); statement.setInt(2, x); statement.setInt(3, y); ResultSet resultSet = statement.executeQue...
[ "public", "BufferedImage", "getTile", "(", "int", "x", ",", "int", "y", ",", "int", "z", ")", "throws", "Exception", "{", "try", "(", "PreparedStatement", "statement", "=", "connection", ".", "prepareStatement", "(", "SELECTQUERY", ")", ")", "{", "statement"...
Get a Tile image from the database. @param x @param y @param z @return @throws Exception
[ "Get", "a", "Tile", "image", "from", "the", "database", "." ]
d2b436bbdf951dc1fda56096a42dbc0eae4d35a5
https://github.com/TheHortonMachine/hortonmachine/blob/d2b436bbdf951dc1fda56096a42dbc0eae4d35a5/gears/src/main/java/org/hortonmachine/gears/modules/r/tmsgenerator/MBTilesHelper.java#L275-L292
train
TheHortonMachine/hortonmachine
gears/src/main/java/org/hortonmachine/gears/modules/r/tmsgenerator/MBTilesHelper.java
MBTilesHelper.readGridcoverageImageForTile
public static BufferedImage readGridcoverageImageForTile( AbstractGridCoverage2DReader reader, int x, int y, int zoom, CoordinateReferenceSystem resampleCrs ) throws IOException { double north = tile2lat(y, zoom); double south = tile2lat(y + 1, zoom); double west = tile2lon(x, zoom);...
java
public static BufferedImage readGridcoverageImageForTile( AbstractGridCoverage2DReader reader, int x, int y, int zoom, CoordinateReferenceSystem resampleCrs ) throws IOException { double north = tile2lat(y, zoom); double south = tile2lat(y + 1, zoom); double west = tile2lon(x, zoom);...
[ "public", "static", "BufferedImage", "readGridcoverageImageForTile", "(", "AbstractGridCoverage2DReader", "reader", ",", "int", "x", ",", "int", "y", ",", "int", "zoom", ",", "CoordinateReferenceSystem", "resampleCrs", ")", "throws", "IOException", "{", "double", "nor...
Read the image of a tile from a generic geotools coverage reader. @param reader the reader, expected to be in CRS 3857. @param x the tile x. @param y the tile y. @param zoom the zoomlevel. @return the image. @throws IOException
[ "Read", "the", "image", "of", "a", "tile", "from", "a", "generic", "geotools", "coverage", "reader", "." ]
d2b436bbdf951dc1fda56096a42dbc0eae4d35a5
https://github.com/TheHortonMachine/hortonmachine/blob/d2b436bbdf951dc1fda56096a42dbc0eae4d35a5/gears/src/main/java/org/hortonmachine/gears/modules/r/tmsgenerator/MBTilesHelper.java#L341-L363
train
TheHortonMachine/hortonmachine
gears/src/main/java/org/hortonmachine/gears/modules/utils/BinaryFast.java
BinaryFast.convertToArray
public int[] convertToArray() { int[] p = new int[size]; for( int j = 0; j < height; ++j ) { for( int i = 0; i < width; ++i ) { p[(j * width) + i] = pixels[i][j]; } } return p; }
java
public int[] convertToArray() { int[] p = new int[size]; for( int j = 0; j < height; ++j ) { for( int i = 0; i < width; ++i ) { p[(j * width) + i] = pixels[i][j]; } } return p; }
[ "public", "int", "[", "]", "convertToArray", "(", ")", "{", "int", "[", "]", "p", "=", "new", "int", "[", "size", "]", ";", "for", "(", "int", "j", "=", "0", ";", "j", "<", "height", ";", "++", "j", ")", "{", "for", "(", "int", "i", "=", ...
Converts the 2D array into a 1D array of pixel values. @return The 1D array of pixel values.
[ "Converts", "the", "2D", "array", "into", "a", "1D", "array", "of", "pixel", "values", "." ]
d2b436bbdf951dc1fda56096a42dbc0eae4d35a5
https://github.com/TheHortonMachine/hortonmachine/blob/d2b436bbdf951dc1fda56096a42dbc0eae4d35a5/gears/src/main/java/org/hortonmachine/gears/modules/utils/BinaryFast.java#L138-L146
train
TheHortonMachine/hortonmachine
gears/src/main/java/org/hortonmachine/gears/modules/utils/BinaryFast.java
BinaryFast.generatePixels
public void generatePixels( HashSet<Point> pix ) { // Reset all pixels to background for( int j = 0; j < height; ++j ) { for( int i = 0; i < width; ++i ) { pixels[i][j] = BACKGROUND; } } convertToPixels(pix); }
java
public void generatePixels( HashSet<Point> pix ) { // Reset all pixels to background for( int j = 0; j < height; ++j ) { for( int i = 0; i < width; ++i ) { pixels[i][j] = BACKGROUND; } } convertToPixels(pix); }
[ "public", "void", "generatePixels", "(", "HashSet", "<", "Point", ">", "pix", ")", "{", "// Reset all pixels to background", "for", "(", "int", "j", "=", "0", ";", "j", "<", "height", ";", "++", "j", ")", "{", "for", "(", "int", "i", "=", "0", ";", ...
Generates a new 2D array of pixels from a hash set of foreground pixels. @param pix The hash set of foreground pixels.
[ "Generates", "a", "new", "2D", "array", "of", "pixels", "from", "a", "hash", "set", "of", "foreground", "pixels", "." ]
d2b436bbdf951dc1fda56096a42dbc0eae4d35a5
https://github.com/TheHortonMachine/hortonmachine/blob/d2b436bbdf951dc1fda56096a42dbc0eae4d35a5/gears/src/main/java/org/hortonmachine/gears/modules/utils/BinaryFast.java#L154-L162
train
TheHortonMachine/hortonmachine
gears/src/main/java/org/hortonmachine/gears/modules/utils/BinaryFast.java
BinaryFast.convertToPixels
public void convertToPixels( HashSet<Point> pix ) { Iterator<Point> it = pix.iterator(); while( it.hasNext() ) { Point p = it.next(); pixels[p.x][p.y] = FOREGROUND; } }
java
public void convertToPixels( HashSet<Point> pix ) { Iterator<Point> it = pix.iterator(); while( it.hasNext() ) { Point p = it.next(); pixels[p.x][p.y] = FOREGROUND; } }
[ "public", "void", "convertToPixels", "(", "HashSet", "<", "Point", ">", "pix", ")", "{", "Iterator", "<", "Point", ">", "it", "=", "pix", ".", "iterator", "(", ")", ";", "while", "(", "it", ".", "hasNext", "(", ")", ")", "{", "Point", "p", "=", "...
Adds the pixels from a hash set to the 2D array of pixels. @param pix The hash set of foreground pixels to be added.
[ "Adds", "the", "pixels", "from", "a", "hash", "set", "to", "the", "2D", "array", "of", "pixels", "." ]
d2b436bbdf951dc1fda56096a42dbc0eae4d35a5
https://github.com/TheHortonMachine/hortonmachine/blob/d2b436bbdf951dc1fda56096a42dbc0eae4d35a5/gears/src/main/java/org/hortonmachine/gears/modules/utils/BinaryFast.java#L169-L175
train
TheHortonMachine/hortonmachine
gears/src/main/java/org/hortonmachine/gears/modules/utils/BinaryFast.java
BinaryFast.generateForegroundEdge
public void generateForegroundEdge() { foregroundEdgePixels.clear(); Point p; for( int n = 0; n < height; ++n ) { for( int m = 0; m < width; ++m ) { if (pixels[m][n] == FOREGROUND) { p = new Point(m, n); for( int j = -1; j < 2; ...
java
public void generateForegroundEdge() { foregroundEdgePixels.clear(); Point p; for( int n = 0; n < height; ++n ) { for( int m = 0; m < width; ++m ) { if (pixels[m][n] == FOREGROUND) { p = new Point(m, n); for( int j = -1; j < 2; ...
[ "public", "void", "generateForegroundEdge", "(", ")", "{", "foregroundEdgePixels", ".", "clear", "(", ")", ";", "Point", "p", ";", "for", "(", "int", "n", "=", "0", ";", "n", "<", "height", ";", "++", "n", ")", "{", "for", "(", "int", "m", "=", "...
Generates the foreground edge hash set from the 2D array of pixels.
[ "Generates", "the", "foreground", "edge", "hash", "set", "from", "the", "2D", "array", "of", "pixels", "." ]
d2b436bbdf951dc1fda56096a42dbc0eae4d35a5
https://github.com/TheHortonMachine/hortonmachine/blob/d2b436bbdf951dc1fda56096a42dbc0eae4d35a5/gears/src/main/java/org/hortonmachine/gears/modules/utils/BinaryFast.java#L180-L201
train
TheHortonMachine/hortonmachine
gears/src/main/java/org/hortonmachine/gears/modules/utils/BinaryFast.java
BinaryFast.generateBackgroundEdgeFromForegroundEdge
public void generateBackgroundEdgeFromForegroundEdge() { backgroundEdgePixels.clear(); Point p, p2; Iterator<Point> it = foregroundEdgePixels.iterator(); while( it.hasNext() ) { p = new Point(it.next()); for( int j = -1; j < 2; ++j ) { for( int i =...
java
public void generateBackgroundEdgeFromForegroundEdge() { backgroundEdgePixels.clear(); Point p, p2; Iterator<Point> it = foregroundEdgePixels.iterator(); while( it.hasNext() ) { p = new Point(it.next()); for( int j = -1; j < 2; ++j ) { for( int i =...
[ "public", "void", "generateBackgroundEdgeFromForegroundEdge", "(", ")", "{", "backgroundEdgePixels", ".", "clear", "(", ")", ";", "Point", "p", ",", "p2", ";", "Iterator", "<", "Point", ">", "it", "=", "foregroundEdgePixels", ".", "iterator", "(", ")", ";", ...
Generates the background edge hash set from the foreground edge hash set and the 2D array of pixels.
[ "Generates", "the", "background", "edge", "hash", "set", "from", "the", "foreground", "edge", "hash", "set", "and", "the", "2D", "array", "of", "pixels", "." ]
d2b436bbdf951dc1fda56096a42dbc0eae4d35a5
https://github.com/TheHortonMachine/hortonmachine/blob/d2b436bbdf951dc1fda56096a42dbc0eae4d35a5/gears/src/main/java/org/hortonmachine/gears/modules/utils/BinaryFast.java#L207-L224
train
TheHortonMachine/hortonmachine
gears/src/main/java/oms3/io/CSVParser.java
CSVParser.nextValue
public String nextValue() throws IOException { Token tkn = nextToken(); String ret = null; switch (tkn.type) { case TT_TOKEN: case TT_EORECORD: ret = tkn.content.toString(); break; case TT_EOF: ret = null; ...
java
public String nextValue() throws IOException { Token tkn = nextToken(); String ret = null; switch (tkn.type) { case TT_TOKEN: case TT_EORECORD: ret = tkn.content.toString(); break; case TT_EOF: ret = null; ...
[ "public", "String", "nextValue", "(", ")", "throws", "IOException", "{", "Token", "tkn", "=", "nextToken", "(", ")", ";", "String", "ret", "=", "null", ";", "switch", "(", "tkn", ".", "type", ")", "{", "case", "TT_TOKEN", ":", "case", "TT_EORECORD", ":...
Parses the CSV according to the given strategy and returns the next csv-value as string. @return next value in the input stream ('null' when end of file) @throws IOException on parse error or input read-failure
[ "Parses", "the", "CSV", "according", "to", "the", "given", "strategy", "and", "returns", "the", "next", "csv", "-", "value", "as", "string", "." ]
d2b436bbdf951dc1fda56096a42dbc0eae4d35a5
https://github.com/TheHortonMachine/hortonmachine/blob/d2b436bbdf951dc1fda56096a42dbc0eae4d35a5/gears/src/main/java/oms3/io/CSVParser.java#L237-L256
train
TheHortonMachine/hortonmachine
gears/src/main/java/oms3/io/CSVParser.java
CSVParser.getLine
public String[] getLine() throws IOException { String[] ret = EMPTY_STRING_ARRAY; record.clear(); while (true) { reusableToken.reset(); nextToken(reusableToken); switch (reusableToken.type) { case TT_TOKEN: record.add(reusab...
java
public String[] getLine() throws IOException { String[] ret = EMPTY_STRING_ARRAY; record.clear(); while (true) { reusableToken.reset(); nextToken(reusableToken); switch (reusableToken.type) { case TT_TOKEN: record.add(reusab...
[ "public", "String", "[", "]", "getLine", "(", ")", "throws", "IOException", "{", "String", "[", "]", "ret", "=", "EMPTY_STRING_ARRAY", ";", "record", ".", "clear", "(", ")", ";", "while", "(", "true", ")", "{", "reusableToken", ".", "reset", "(", ")", ...
Parses from the current point in the stream til the end of the current line. @return array of values til end of line ('null' when end of file has been reached) @throws IOException on parse error or input read-failure
[ "Parses", "from", "the", "current", "point", "in", "the", "stream", "til", "the", "end", "of", "the", "current", "line", "." ]
d2b436bbdf951dc1fda56096a42dbc0eae4d35a5
https://github.com/TheHortonMachine/hortonmachine/blob/d2b436bbdf951dc1fda56096a42dbc0eae4d35a5/gears/src/main/java/oms3/io/CSVParser.java#L266-L300
train
TheHortonMachine/hortonmachine
gears/src/main/java/oms3/io/CSVParser.java
CSVParser.nextToken
Token nextToken(Token tkn) throws IOException { wsBuf.clear(); // resuse // get the last read char (required for empty line detection) int lastChar = in.readAgain(); // read the next char and set eol /* note: unfourtunately isEndOfLine may consumes a character silently. *...
java
Token nextToken(Token tkn) throws IOException { wsBuf.clear(); // resuse // get the last read char (required for empty line detection) int lastChar = in.readAgain(); // read the next char and set eol /* note: unfourtunately isEndOfLine may consumes a character silently. *...
[ "Token", "nextToken", "(", "Token", "tkn", ")", "throws", "IOException", "{", "wsBuf", ".", "clear", "(", ")", ";", "// resuse", "// get the last read char (required for empty line detection)", "int", "lastChar", "=", "in", ".", "readAgain", "(", ")", ";", "// re...
Returns the next token. A token corresponds to a term, a record change or an end-of-file indicator. @param tkn an existing Token object to reuse. The caller is responsible to initialize the Token. @return the next token found @throws IOException on stream access error
[ "Returns", "the", "next", "token", "." ]
d2b436bbdf951dc1fda56096a42dbc0eae4d35a5
https://github.com/TheHortonMachine/hortonmachine/blob/d2b436bbdf951dc1fda56096a42dbc0eae4d35a5/gears/src/main/java/oms3/io/CSVParser.java#L335-L411
train
TheHortonMachine/hortonmachine
gears/src/main/java/oms3/io/CSVParser.java
CSVParser.simpleTokenLexer
private Token simpleTokenLexer(Token tkn, int c) throws IOException { for (;;) { if (isEndOfLine(c)) { // end of record tkn.type = TT_EORECORD; tkn.isReady = true; break; } else if (isEndOfFile(c)) { // end o...
java
private Token simpleTokenLexer(Token tkn, int c) throws IOException { for (;;) { if (isEndOfLine(c)) { // end of record tkn.type = TT_EORECORD; tkn.isReady = true; break; } else if (isEndOfFile(c)) { // end o...
[ "private", "Token", "simpleTokenLexer", "(", "Token", "tkn", ",", "int", "c", ")", "throws", "IOException", "{", "for", "(", ";", ";", ")", "{", "if", "(", "isEndOfLine", "(", "c", ")", ")", "{", "// end of record", "tkn", ".", "type", "=", "TT_EORECOR...
A simple token lexer Simple token are tokens which are not surrounded by encapsulators. A simple token might contain escaped delimiters (as \, or \;). The token is finished when one of the following conditions become true: <ul> <li>end of line has been reached (TT_EORECORD)</li> <li>end of stream has been reached (TT_...
[ "A", "simple", "token", "lexer" ]
d2b436bbdf951dc1fda56096a42dbc0eae4d35a5
https://github.com/TheHortonMachine/hortonmachine/blob/d2b436bbdf951dc1fda56096a42dbc0eae4d35a5/gears/src/main/java/oms3/io/CSVParser.java#L431-L465
train
TheHortonMachine/hortonmachine
gears/src/main/java/oms3/io/CSVParser.java
CSVParser.encapsulatedTokenLexer
private Token encapsulatedTokenLexer(Token tkn, int c) throws IOException { // save current line int startLineNumber = getLineNumber(); // ignore the given delimiter // assert c == delimiter; for (;;) { c = in.read(); if (c == '\\' && strategy.getUnicodeE...
java
private Token encapsulatedTokenLexer(Token tkn, int c) throws IOException { // save current line int startLineNumber = getLineNumber(); // ignore the given delimiter // assert c == delimiter; for (;;) { c = in.read(); if (c == '\\' && strategy.getUnicodeE...
[ "private", "Token", "encapsulatedTokenLexer", "(", "Token", "tkn", ",", "int", "c", ")", "throws", "IOException", "{", "// save current line", "int", "startLineNumber", "=", "getLineNumber", "(", ")", ";", "// ignore the given delimiter", "// assert c == delimiter;", "f...
An encapsulated token lexer Encapsulated tokens are surrounded by the given encapsulating-string. The encapsulator itself might be included in the token using a doubling syntax (as "", '') or using escaping (as in \", \'). Whitespaces before and after an encapsulated token are ignored. @param tkn the current token...
[ "An", "encapsulated", "token", "lexer" ]
d2b436bbdf951dc1fda56096a42dbc0eae4d35a5
https://github.com/TheHortonMachine/hortonmachine/blob/d2b436bbdf951dc1fda56096a42dbc0eae4d35a5/gears/src/main/java/oms3/io/CSVParser.java#L480-L530
train
TheHortonMachine/hortonmachine
gears/src/main/java/oms3/io/CSVParser.java
CSVParser.unicodeEscapeLexer
protected int unicodeEscapeLexer(int c) throws IOException { int ret = 0; // ignore 'u' (assume c==\ now) and read 4 hex digits c = in.read(); code.clear(); try { for (int i = 0; i < 4; i++) { c = in.read(); if (isEndOfFile(c) || isEndO...
java
protected int unicodeEscapeLexer(int c) throws IOException { int ret = 0; // ignore 'u' (assume c==\ now) and read 4 hex digits c = in.read(); code.clear(); try { for (int i = 0; i < 4; i++) { c = in.read(); if (isEndOfFile(c) || isEndO...
[ "protected", "int", "unicodeEscapeLexer", "(", "int", "c", ")", "throws", "IOException", "{", "int", "ret", "=", "0", ";", "// ignore 'u' (assume c==\\ now) and read 4 hex digits", "c", "=", "in", ".", "read", "(", ")", ";", "code", ".", "clear", "(", ")", "...
Decodes Unicode escapes. Interpretation of "\\uXXXX" escape sequences where XXXX is a hex-number. @param c current char which is discarded because it's the "\\" of "\\uXXXX" @return the decoded character @throws IOException on wrong unicode escape sequence or read error
[ "Decodes", "Unicode", "escapes", "." ]
d2b436bbdf951dc1fda56096a42dbc0eae4d35a5
https://github.com/TheHortonMachine/hortonmachine/blob/d2b436bbdf951dc1fda56096a42dbc0eae4d35a5/gears/src/main/java/oms3/io/CSVParser.java#L541-L560
train
TheHortonMachine/hortonmachine
gears/src/main/java/oms3/io/CSVParser.java
CSVParser.isEndOfLine
private boolean isEndOfLine(int c) throws IOException { // check if we have \r\n... if (c == '\r') { if (in.lookAhead() == '\n') { // note: does not change c outside of this method !! c = in.read(); } } return (c == '\n'); }
java
private boolean isEndOfLine(int c) throws IOException { // check if we have \r\n... if (c == '\r') { if (in.lookAhead() == '\n') { // note: does not change c outside of this method !! c = in.read(); } } return (c == '\n'); }
[ "private", "boolean", "isEndOfLine", "(", "int", "c", ")", "throws", "IOException", "{", "// check if we have \\r\\n...", "if", "(", "c", "==", "'", "'", ")", "{", "if", "(", "in", ".", "lookAhead", "(", ")", "==", "'", "'", ")", "{", "// note: does not ...
Greedy - accepts \n and \r\n This checker consumes silently the second control-character... @return true if the given character is a line-terminator
[ "Greedy", "-", "accepts", "\\", "n", "and", "\\", "r", "\\", "n", "This", "checker", "consumes", "silently", "the", "second", "control", "-", "character", "..." ]
d2b436bbdf951dc1fda56096a42dbc0eae4d35a5
https://github.com/TheHortonMachine/hortonmachine/blob/d2b436bbdf951dc1fda56096a42dbc0eae4d35a5/gears/src/main/java/oms3/io/CSVParser.java#L616-L625
train
TheHortonMachine/hortonmachine
hmachine/src/main/java/org/hortonmachine/hmachine/modules/hydrogeomorphology/skyview/OmsSkyview.java
OmsSkyview.skyviewfactor
private WritableRaster skyviewfactor( WritableRaster pitWR, double res ) { /* * evalutating the normal vector (in the center of the square compound * of 4 pixel. */ normalVectorWR = normalVector(pitWR, res); WritableRaster skyviewFactorWR = CoverageUtilities.createW...
java
private WritableRaster skyviewfactor( WritableRaster pitWR, double res ) { /* * evalutating the normal vector (in the center of the square compound * of 4 pixel. */ normalVectorWR = normalVector(pitWR, res); WritableRaster skyviewFactorWR = CoverageUtilities.createW...
[ "private", "WritableRaster", "skyviewfactor", "(", "WritableRaster", "pitWR", ",", "double", "res", ")", "{", "/*\n * evalutating the normal vector (in the center of the square compound\n * of 4 pixel.\n */", "normalVectorWR", "=", "normalVector", "(", "pitWR"...
Calculate the skyview factor. @param pitWR the dem ( the map of elevation). @param res the resolution of the map. @return the map of sky view factor.
[ "Calculate", "the", "skyview", "factor", "." ]
d2b436bbdf951dc1fda56096a42dbc0eae4d35a5
https://github.com/TheHortonMachine/hortonmachine/blob/d2b436bbdf951dc1fda56096a42dbc0eae4d35a5/hmachine/src/main/java/org/hortonmachine/hmachine/modules/hydrogeomorphology/skyview/OmsSkyview.java#L228-L270
train
TheHortonMachine/hortonmachine
hmachine/src/main/java/org/hortonmachine/hmachine/modules/hydrogeomorphology/skyview/OmsSkyview.java
OmsSkyview.shadow
protected WritableRaster shadow( int x, int y, WritableRaster tmpWR, WritableRaster pitWR, double res, double[] normalSunVector, double[] inverseSunVector, double[] sunVector ) { int n = 0; double zcompare = -Double.MAX_VALUE; double dx = (inverseSunVector[0] * n); double dy ...
java
protected WritableRaster shadow( int x, int y, WritableRaster tmpWR, WritableRaster pitWR, double res, double[] normalSunVector, double[] inverseSunVector, double[] sunVector ) { int n = 0; double zcompare = -Double.MAX_VALUE; double dx = (inverseSunVector[0] * n); double dy ...
[ "protected", "WritableRaster", "shadow", "(", "int", "x", ",", "int", "y", ",", "WritableRaster", "tmpWR", ",", "WritableRaster", "pitWR", ",", "double", "res", ",", "double", "[", "]", "normalSunVector", ",", "double", "[", "]", "inverseSunVector", ",", "do...
Calculate the angle. @param x the x index. @param y the y index. @param tmpWR the sky map. @param pitWR the elevation map. @param res the resolution of the map. @param normalSunVector @param inverseSunVector @param sunVector
[ "Calculate", "the", "angle", "." ]
d2b436bbdf951dc1fda56096a42dbc0eae4d35a5
https://github.com/TheHortonMachine/hortonmachine/blob/d2b436bbdf951dc1fda56096a42dbc0eae4d35a5/hmachine/src/main/java/org/hortonmachine/hmachine/modules/hydrogeomorphology/skyview/OmsSkyview.java#L284-L315
train
TheHortonMachine/hortonmachine
hmachine/src/main/java/org/hortonmachine/hmachine/modules/hydrogeomorphology/adige/core/MonitoringPoint.java
MonitoringPoint.connectIfPossible
public boolean connectIfPossible( MonitoringPoint monitoringPoint ) { // check if the other point has this as related id if (ID == monitoringPoint.getRelatedID()) { pfafRelatedMonitoringPointsTable.put(monitoringPoint.getPfatstetterNumber().toString(), monitoringPoint); ...
java
public boolean connectIfPossible( MonitoringPoint monitoringPoint ) { // check if the other point has this as related id if (ID == monitoringPoint.getRelatedID()) { pfafRelatedMonitoringPointsTable.put(monitoringPoint.getPfatstetterNumber().toString(), monitoringPoint); ...
[ "public", "boolean", "connectIfPossible", "(", "MonitoringPoint", "monitoringPoint", ")", "{", "// check if the other point has this as related id", "if", "(", "ID", "==", "monitoringPoint", ".", "getRelatedID", "(", ")", ")", "{", "pfafRelatedMonitoringPointsTable", ".", ...
Tries to connect another monitoringpoint if that one has a related id equal to that of this object. That way it would be possible to add more than one point as related. @param monitoringPoint the point to connect @return true if the connection was successfull
[ "Tries", "to", "connect", "another", "monitoringpoint", "if", "that", "one", "has", "a", "related", "id", "equal", "to", "that", "of", "this", "object", ".", "That", "way", "it", "would", "be", "possible", "to", "add", "more", "than", "one", "point", "as...
d2b436bbdf951dc1fda56096a42dbc0eae4d35a5
https://github.com/TheHortonMachine/hortonmachine/blob/d2b436bbdf951dc1fda56096a42dbc0eae4d35a5/hmachine/src/main/java/org/hortonmachine/hmachine/modules/hydrogeomorphology/adige/core/MonitoringPoint.java#L102-L111
train
TheHortonMachine/hortonmachine
hmachine/src/main/java/org/hortonmachine/hmachine/modules/hydrogeomorphology/adige/core/MonitoringPoint.java
MonitoringPoint.getRelatedMonitoringPoint
public MonitoringPoint getRelatedMonitoringPoint( String pfafStetter ) { if (pfafStetter != null) { return pfafRelatedMonitoringPointsTable.get(pfafStetter); } else { Set<String> keySet = pfafRelatedMonitoringPointsTable.keySet(); for( String key : keySet ) { ...
java
public MonitoringPoint getRelatedMonitoringPoint( String pfafStetter ) { if (pfafStetter != null) { return pfafRelatedMonitoringPointsTable.get(pfafStetter); } else { Set<String> keySet = pfafRelatedMonitoringPointsTable.keySet(); for( String key : keySet ) { ...
[ "public", "MonitoringPoint", "getRelatedMonitoringPoint", "(", "String", "pfafStetter", ")", "{", "if", "(", "pfafStetter", "!=", "null", ")", "{", "return", "pfafRelatedMonitoringPointsTable", ".", "get", "(", "pfafStetter", ")", ";", "}", "else", "{", "Set", "...
Get the related monitoringpoint. If there are more than one, the pfafstetter number is used to chose. @param pfafStetter used to chose in the points table. Can be null, in which case the first found is taken (should be used only if there is only one point in the table) @return the related point
[ "Get", "the", "related", "monitoringpoint", ".", "If", "there", "are", "more", "than", "one", "the", "pfafstetter", "number", "is", "used", "to", "chose", "." ]
d2b436bbdf951dc1fda56096a42dbc0eae4d35a5
https://github.com/TheHortonMachine/hortonmachine/blob/d2b436bbdf951dc1fda56096a42dbc0eae4d35a5/hmachine/src/main/java/org/hortonmachine/hmachine/modules/hydrogeomorphology/adige/core/MonitoringPoint.java#L121-L131
train
TheHortonMachine/hortonmachine
hmachine/src/main/java/org/hortonmachine/hmachine/modules/hydrogeomorphology/adige/core/MonitoringPoint.java
MonitoringPoint.toFeatureCollection
public SimpleFeatureCollection toFeatureCollection( List<MonitoringPoint> monitoringPointsList ) { // create the feature type SimpleFeatureTypeBuilder b = new SimpleFeatureTypeBuilder(); // set the name b.setName("monitoringpoints"); // add a geometry property ...
java
public SimpleFeatureCollection toFeatureCollection( List<MonitoringPoint> monitoringPointsList ) { // create the feature type SimpleFeatureTypeBuilder b = new SimpleFeatureTypeBuilder(); // set the name b.setName("monitoringpoints"); // add a geometry property ...
[ "public", "SimpleFeatureCollection", "toFeatureCollection", "(", "List", "<", "MonitoringPoint", ">", "monitoringPointsList", ")", "{", "// create the feature type", "SimpleFeatureTypeBuilder", "b", "=", "new", "SimpleFeatureTypeBuilder", "(", ")", ";", "// set the name", "...
Create a featurecollection from a list of monitoringpoints. Based on the position of the points and some of their attributes. @param monitoringPointsList @return the featurecollection
[ "Create", "a", "featurecollection", "from", "a", "list", "of", "monitoringpoints", ".", "Based", "on", "the", "position", "of", "the", "points", "and", "some", "of", "their", "attributes", "." ]
d2b436bbdf951dc1fda56096a42dbc0eae4d35a5
https://github.com/TheHortonMachine/hortonmachine/blob/d2b436bbdf951dc1fda56096a42dbc0eae4d35a5/hmachine/src/main/java/org/hortonmachine/hmachine/modules/hydrogeomorphology/adige/core/MonitoringPoint.java#L241-L278
train
TheHortonMachine/hortonmachine
dbs/src/main/java/jsqlite/Blob.java
BlobR.skip
public long skip(long n) throws IOException { long ret = pos + n; if (ret < 0) { ret = 0; pos = 0; } else if (ret > blob.size) { ret = blob.size; pos = blob.size; } else { pos = (int) ret; } return ret; }
java
public long skip(long n) throws IOException { long ret = pos + n; if (ret < 0) { ret = 0; pos = 0; } else if (ret > blob.size) { ret = blob.size; pos = blob.size; } else { pos = (int) ret; } return ret; }
[ "public", "long", "skip", "(", "long", "n", ")", "throws", "IOException", "{", "long", "ret", "=", "pos", "+", "n", ";", "if", "(", "ret", "<", "0", ")", "{", "ret", "=", "0", ";", "pos", "=", "0", ";", "}", "else", "if", "(", "ret", ">", "...
Skip over blob data.
[ "Skip", "over", "blob", "data", "." ]
d2b436bbdf951dc1fda56096a42dbc0eae4d35a5
https://github.com/TheHortonMachine/hortonmachine/blob/d2b436bbdf951dc1fda56096a42dbc0eae4d35a5/dbs/src/main/java/jsqlite/Blob.java#L82-L94
train
TheHortonMachine/hortonmachine
dbs/src/main/java/jsqlite/Blob.java
BlobR.read
public int read() throws IOException { byte b[] = new byte[1]; int n = blob.read(b, 0, pos, b.length); if (n > 0) { pos += n; return b[0]; } return -1; }
java
public int read() throws IOException { byte b[] = new byte[1]; int n = blob.read(b, 0, pos, b.length); if (n > 0) { pos += n; return b[0]; } return -1; }
[ "public", "int", "read", "(", ")", "throws", "IOException", "{", "byte", "b", "[", "]", "=", "new", "byte", "[", "1", "]", ";", "int", "n", "=", "blob", ".", "read", "(", "b", ",", "0", ",", "pos", ",", "b", ".", "length", ")", ";", "if", "...
Read single byte from blob. @return byte read
[ "Read", "single", "byte", "from", "blob", "." ]
d2b436bbdf951dc1fda56096a42dbc0eae4d35a5
https://github.com/TheHortonMachine/hortonmachine/blob/d2b436bbdf951dc1fda56096a42dbc0eae4d35a5/dbs/src/main/java/jsqlite/Blob.java#L101-L109
train
TheHortonMachine/hortonmachine
dbs/src/main/java/jsqlite/Blob.java
BlobR.read
public int read(byte b[], int off, int len) throws IOException { if (off + len > b.length) { len = b.length - off; } if (len < 0) { return -1; } if (len == 0) { return 0; } int n = blob.read(b, off, pos, len); if (n > 0) { pos += n; return n; } return -1; }
java
public int read(byte b[], int off, int len) throws IOException { if (off + len > b.length) { len = b.length - off; } if (len < 0) { return -1; } if (len == 0) { return 0; } int n = blob.read(b, off, pos, len); if (n > 0) { pos += n; return n; } return -1; }
[ "public", "int", "read", "(", "byte", "b", "[", "]", ",", "int", "off", ",", "int", "len", ")", "throws", "IOException", "{", "if", "(", "off", "+", "len", ">", "b", ".", "length", ")", "{", "len", "=", "b", ".", "length", "-", "off", ";", "}...
Read slice of byte array from blob. @param b byte array to be filled @param off offset into byte array @param len length to be read @return number of bytes read
[ "Read", "slice", "of", "byte", "array", "from", "blob", "." ]
d2b436bbdf951dc1fda56096a42dbc0eae4d35a5
https://github.com/TheHortonMachine/hortonmachine/blob/d2b436bbdf951dc1fda56096a42dbc0eae4d35a5/dbs/src/main/java/jsqlite/Blob.java#L134-L150
train
TheHortonMachine/hortonmachine
dbs/src/main/java/org/hortonmachine/dbs/rasterlite/Rasterlite2Db.java
Rasterlite2Db.getRasterCoverages
public List<Rasterlite2Coverage> getRasterCoverages( boolean doOrder ) throws Exception { List<Rasterlite2Coverage> rasterCoverages = new ArrayList<Rasterlite2Coverage>(); String orderBy = " ORDER BY " + Rasterlite2Coverage.COVERAGE_NAME; if (!doOrder) { orderBy = ""; } ...
java
public List<Rasterlite2Coverage> getRasterCoverages( boolean doOrder ) throws Exception { List<Rasterlite2Coverage> rasterCoverages = new ArrayList<Rasterlite2Coverage>(); String orderBy = " ORDER BY " + Rasterlite2Coverage.COVERAGE_NAME; if (!doOrder) { orderBy = ""; } ...
[ "public", "List", "<", "Rasterlite2Coverage", ">", "getRasterCoverages", "(", "boolean", "doOrder", ")", "throws", "Exception", "{", "List", "<", "Rasterlite2Coverage", ">", "rasterCoverages", "=", "new", "ArrayList", "<", "Rasterlite2Coverage", ">", "(", ")", ";"...
Get the list of available raster coverages. @param doOrder if <code>true</code>, the names are ordered. @return the list of raster coverages. @throws Exception
[ "Get", "the", "list", "of", "available", "raster", "coverages", "." ]
d2b436bbdf951dc1fda56096a42dbc0eae4d35a5
https://github.com/TheHortonMachine/hortonmachine/blob/d2b436bbdf951dc1fda56096a42dbc0eae4d35a5/dbs/src/main/java/org/hortonmachine/dbs/rasterlite/Rasterlite2Db.java#L61-L94
train
TheHortonMachine/hortonmachine
gears/src/main/java/org/hortonmachine/gears/io/dxfdwg/libs/dwg/objects/DwgEndblk.java
DwgEndblk.readDwgEndblkV15
public void readDwgEndblkV15(int[] data, int offset) throws Exception { int bitPos = offset; bitPos = readObjectHeaderV15(data, bitPos); bitPos = readObjectTailV15(data, bitPos); }
java
public void readDwgEndblkV15(int[] data, int offset) throws Exception { int bitPos = offset; bitPos = readObjectHeaderV15(data, bitPos); bitPos = readObjectTailV15(data, bitPos); }
[ "public", "void", "readDwgEndblkV15", "(", "int", "[", "]", "data", ",", "int", "offset", ")", "throws", "Exception", "{", "int", "bitPos", "=", "offset", ";", "bitPos", "=", "readObjectHeaderV15", "(", "data", ",", "bitPos", ")", ";", "bitPos", "=", "re...
Read a Endblk in the DWG format Version 15 @param data Array of unsigned bytes obtained from the DWG binary file @param offset The current bit offset where the value begins @throws Exception If an unexpected bit value is found in the DWG file. Occurs when we are looking for LwPolylines.
[ "Read", "a", "Endblk", "in", "the", "DWG", "format", "Version", "15" ]
d2b436bbdf951dc1fda56096a42dbc0eae4d35a5
https://github.com/TheHortonMachine/hortonmachine/blob/d2b436bbdf951dc1fda56096a42dbc0eae4d35a5/gears/src/main/java/org/hortonmachine/gears/io/dxfdwg/libs/dwg/objects/DwgEndblk.java#L38-L42
train
TheHortonMachine/hortonmachine
gears/src/main/java/org/hortonmachine/gears/utils/features/FilterUtilities.java
FilterUtilities.getBboxFilter
public static Filter getBboxFilter( String attribute, BoundingBox bbox ) throws CQLException { double w = bbox.getMinX(); double e = bbox.getMaxX(); double s = bbox.getMinY(); double n = bbox.getMaxY(); return getBboxFilter(attribute, w, e, s, n); }
java
public static Filter getBboxFilter( String attribute, BoundingBox bbox ) throws CQLException { double w = bbox.getMinX(); double e = bbox.getMaxX(); double s = bbox.getMinY(); double n = bbox.getMaxY(); return getBboxFilter(attribute, w, e, s, n); }
[ "public", "static", "Filter", "getBboxFilter", "(", "String", "attribute", ",", "BoundingBox", "bbox", ")", "throws", "CQLException", "{", "double", "w", "=", "bbox", ".", "getMinX", "(", ")", ";", "double", "e", "=", "bbox", ".", "getMaxX", "(", ")", ";...
Create a bounding box filter from a bounding box. @param attribute the geometry attribute or null in the case of default "the_geom". @param bbox the {@link BoundingBox}. @return the filter. @throws CQLException
[ "Create", "a", "bounding", "box", "filter", "from", "a", "bounding", "box", "." ]
d2b436bbdf951dc1fda56096a42dbc0eae4d35a5
https://github.com/TheHortonMachine/hortonmachine/blob/d2b436bbdf951dc1fda56096a42dbc0eae4d35a5/gears/src/main/java/org/hortonmachine/gears/utils/features/FilterUtilities.java#L44-L51
train
TheHortonMachine/hortonmachine
gears/src/main/java/org/hortonmachine/gears/utils/features/FilterUtilities.java
FilterUtilities.getBboxFilter
public static Filter getBboxFilter( String attribute, double west, double east, double south, double north ) throws CQLException { if (attribute == null) { attribute = "the_geom"; } StringBuilder sB = new StringBuilder(); sB.append("BBOX("); sB.append(at...
java
public static Filter getBboxFilter( String attribute, double west, double east, double south, double north ) throws CQLException { if (attribute == null) { attribute = "the_geom"; } StringBuilder sB = new StringBuilder(); sB.append("BBOX("); sB.append(at...
[ "public", "static", "Filter", "getBboxFilter", "(", "String", "attribute", ",", "double", "west", ",", "double", "east", ",", "double", "south", ",", "double", "north", ")", "throws", "CQLException", "{", "if", "(", "attribute", "==", "null", ")", "{", "at...
Create a bounding box filter from the bounds coordinates. @param attribute the geometry attribute or null in the case of default "the_geom". @param west western bound coordinate. @param east eastern bound coordinate. @param south southern bound coordinate. @param north northern bound coordinate. @return the filter. @t...
[ "Create", "a", "bounding", "box", "filter", "from", "the", "bounds", "coordinates", "." ]
d2b436bbdf951dc1fda56096a42dbc0eae4d35a5
https://github.com/TheHortonMachine/hortonmachine/blob/d2b436bbdf951dc1fda56096a42dbc0eae4d35a5/gears/src/main/java/org/hortonmachine/gears/utils/features/FilterUtilities.java#L64-L87
train
TheHortonMachine/hortonmachine
gears/src/main/java/org/hortonmachine/gears/utils/features/FilterUtilities.java
FilterUtilities.getIntersectsGeometryFilter
public static Filter getIntersectsGeometryFilter( String geomName, Geometry geometry ) throws CQLException { Filter result = CQL.toFilter("INTERSECTS(" + geomName + ", " + geometry.toText() + " )"); return result; }
java
public static Filter getIntersectsGeometryFilter( String geomName, Geometry geometry ) throws CQLException { Filter result = CQL.toFilter("INTERSECTS(" + geomName + ", " + geometry.toText() + " )"); return result; }
[ "public", "static", "Filter", "getIntersectsGeometryFilter", "(", "String", "geomName", ",", "Geometry", "geometry", ")", "throws", "CQLException", "{", "Filter", "result", "=", "CQL", ".", "toFilter", "(", "\"INTERSECTS(\"", "+", "geomName", "+", "\", \"", "+", ...
Creates an intersect filter. @param geomName the name of the geom field to filter. @param geometry the geometry to use as filtering geom. @return the filter. @throws CQLException
[ "Creates", "an", "intersect", "filter", "." ]
d2b436bbdf951dc1fda56096a42dbc0eae4d35a5
https://github.com/TheHortonMachine/hortonmachine/blob/d2b436bbdf951dc1fda56096a42dbc0eae4d35a5/gears/src/main/java/org/hortonmachine/gears/utils/features/FilterUtilities.java#L102-L105
train
TheHortonMachine/hortonmachine
gears/src/main/java/oms3/ngmf/util/cosu/DDS.java
DDS.neigh_value
private double neigh_value(double x_cur, double x_min, double x_max, double r) { double ranval, zvalue, new_value; double work3, work2 = 0, work1 = 0; double x_range = x_max - x_min; // ------------ generate a standard normal random variate (zvalue) ------------------- // perturb cur...
java
private double neigh_value(double x_cur, double x_min, double x_max, double r) { double ranval, zvalue, new_value; double work3, work2 = 0, work1 = 0; double x_range = x_max - x_min; // ------------ generate a standard normal random variate (zvalue) ------------------- // perturb cur...
[ "private", "double", "neigh_value", "(", "double", "x_cur", ",", "double", "x_min", ",", "double", "x_max", ",", "double", "r", ")", "{", "double", "ranval", ",", "zvalue", ",", "new_value", ";", "double", "work3", ",", "work2", "=", "0", ",", "work1", ...
Purpose is to generate a neighboring decision variable value for a single decision variable value being perturbed by the DDS optimization algorithm. New DV value respects the upper and lower DV bounds. Coded by Bryan Tolson, Nov 2005. I/O variable definitions: x_cur - current decision variable (DV) value x_min - min D...
[ "Purpose", "is", "to", "generate", "a", "neighboring", "decision", "variable", "value", "for", "a", "single", "decision", "variable", "value", "being", "perturbed", "by", "the", "DDS", "optimization", "algorithm", ".", "New", "DV", "value", "respects", "the", ...
d2b436bbdf951dc1fda56096a42dbc0eae4d35a5
https://github.com/TheHortonMachine/hortonmachine/blob/d2b436bbdf951dc1fda56096a42dbc0eae4d35a5/gears/src/main/java/oms3/ngmf/util/cosu/DDS.java#L144-L201
train
TheHortonMachine/hortonmachine
hmachine/src/main/java/org/hortonmachine/hmachine/modules/hydrogeomorphology/hillshade/OmsHillshade.java
OmsHillshade.calchillshade
private void calchillshade( WritableRaster pitWR, WritableRaster hillshadeWR, WritableRaster gradientWR, double dx ) { pAzimuth = Math.toRadians(pAzimuth); pElev = Math.toRadians(pElev); double[] sunVector = calcSunVector(); double[] normalSunVector = calcNormalSunVector(sunVector); ...
java
private void calchillshade( WritableRaster pitWR, WritableRaster hillshadeWR, WritableRaster gradientWR, double dx ) { pAzimuth = Math.toRadians(pAzimuth); pElev = Math.toRadians(pElev); double[] sunVector = calcSunVector(); double[] normalSunVector = calcNormalSunVector(sunVector); ...
[ "private", "void", "calchillshade", "(", "WritableRaster", "pitWR", ",", "WritableRaster", "hillshadeWR", ",", "WritableRaster", "gradientWR", ",", "double", "dx", ")", "{", "pAzimuth", "=", "Math", ".", "toRadians", "(", "pAzimuth", ")", ";", "pElev", "=", "M...
Evaluate the hillshade. @param pitWR the raster of elevation. @param hillshadeWR the WR where store the result. @param gradientWR the raster of the gradient value of the dem. @param dx the resolution of the dem. .
[ "Evaluate", "the", "hillshade", "." ]
d2b436bbdf951dc1fda56096a42dbc0eae4d35a5
https://github.com/TheHortonMachine/hortonmachine/blob/d2b436bbdf951dc1fda56096a42dbc0eae4d35a5/hmachine/src/main/java/org/hortonmachine/hmachine/modules/hydrogeomorphology/hillshade/OmsHillshade.java#L169-L194
train
TheHortonMachine/hortonmachine
gears/src/main/java/org/hortonmachine/gears/utils/coverage/ProfilePoint.java
ProfilePoint.getMeanSlope
public static double getMeanSlope( List<ProfilePoint> points ) { double meanSlope = 0; int num = 0; for( int i = 0; i < points.size() - 1; i++ ) { ProfilePoint p1 = points.get(i); ProfilePoint p2 = points.get(i + 1); double dx = p2.progressive - p1.progressi...
java
public static double getMeanSlope( List<ProfilePoint> points ) { double meanSlope = 0; int num = 0; for( int i = 0; i < points.size() - 1; i++ ) { ProfilePoint p1 = points.get(i); ProfilePoint p2 = points.get(i + 1); double dx = p2.progressive - p1.progressi...
[ "public", "static", "double", "getMeanSlope", "(", "List", "<", "ProfilePoint", ">", "points", ")", "{", "double", "meanSlope", "=", "0", ";", "int", "num", "=", "0", ";", "for", "(", "int", "i", "=", "0", ";", "i", "<", "points", ".", "size", "(",...
Calculates the mean slope of a given set of profilepoints. @param points the points of the profile. @return the mean slope.
[ "Calculates", "the", "mean", "slope", "of", "a", "given", "set", "of", "profilepoints", "." ]
d2b436bbdf951dc1fda56096a42dbc0eae4d35a5
https://github.com/TheHortonMachine/hortonmachine/blob/d2b436bbdf951dc1fda56096a42dbc0eae4d35a5/gears/src/main/java/org/hortonmachine/gears/utils/coverage/ProfilePoint.java#L82-L98
train
TheHortonMachine/hortonmachine
gears/src/main/java/org/hortonmachine/gears/utils/coverage/ProfilePoint.java
ProfilePoint.getLastVisiblePointData
public static double[] getLastVisiblePointData( List<ProfilePoint> profile ) { if (profile.size() < 2) { throw new IllegalArgumentException("A profile needs to have at least 2 points."); } ProfilePoint first = profile.get(0); double baseElev = first.getElevation(); Co...
java
public static double[] getLastVisiblePointData( List<ProfilePoint> profile ) { if (profile.size() < 2) { throw new IllegalArgumentException("A profile needs to have at least 2 points."); } ProfilePoint first = profile.get(0); double baseElev = first.getElevation(); Co...
[ "public", "static", "double", "[", "]", "getLastVisiblePointData", "(", "List", "<", "ProfilePoint", ">", "profile", ")", "{", "if", "(", "profile", ".", "size", "(", ")", "<", "2", ")", "{", "throw", "new", "IllegalArgumentException", "(", "\"A profile need...
Return last visible point data for a profile points list. <p>For the profile the min and max angles of "sight" are calculated. The min azimuth angle represents the "upper" line of sight, as thoght from the zenith. <p>The max azimuth angle represents the "below the earth" line of sight (think of a viewer looking in dir...
[ "Return", "last", "visible", "point", "data", "for", "a", "profile", "points", "list", "." ]
d2b436bbdf951dc1fda56096a42dbc0eae4d35a5
https://github.com/TheHortonMachine/hortonmachine/blob/d2b436bbdf951dc1fda56096a42dbc0eae4d35a5/gears/src/main/java/org/hortonmachine/gears/utils/coverage/ProfilePoint.java#L125-L175
train
enasequence/sequencetools
src/main/java/uk/ac/ebi/embl/api/validation/check/sourcefeature/SourceFeatureQualifierCheck.java
SourceFeatureQualifierCheck.checkMetagenomeSource
private void checkMetagenomeSource(Origin origin, SourceFeature source) { List<Qualifier> metagenomeSourceQual = source.getQualifiers(Qualifier.METAGENOME_SOURCE_QUALIFIER_NAME); if(metagenomeSourceQual != null && !metagenomeSourceQual.isEmpty()) { Qualifier envSample = source.getSingleQualifier(Qualifier.ENVIR...
java
private void checkMetagenomeSource(Origin origin, SourceFeature source) { List<Qualifier> metagenomeSourceQual = source.getQualifiers(Qualifier.METAGENOME_SOURCE_QUALIFIER_NAME); if(metagenomeSourceQual != null && !metagenomeSourceQual.isEmpty()) { Qualifier envSample = source.getSingleQualifier(Qualifier.ENVIR...
[ "private", "void", "checkMetagenomeSource", "(", "Origin", "origin", ",", "SourceFeature", "source", ")", "{", "List", "<", "Qualifier", ">", "metagenomeSourceQual", "=", "source", ".", "getQualifiers", "(", "Qualifier", ".", "METAGENOME_SOURCE_QUALIFIER_NAME", ")", ...
ENA-2825
[ "ENA", "-", "2825" ]
4127f5e1a17540239f5810136153fbd6737fa262
https://github.com/enasequence/sequencetools/blob/4127f5e1a17540239f5810136153fbd6737fa262/src/main/java/uk/ac/ebi/embl/api/validation/check/sourcefeature/SourceFeatureQualifierCheck.java#L146-L169
train
TheHortonMachine/hortonmachine
gears/src/main/java/org/hortonmachine/gears/utils/images/ImageGenerator.java
ImageGenerator.addFeaturePath
public void addFeaturePath( String featurePath, String filter ) { if (!featurePaths.contains(featurePath)) { featurePaths.add(featurePath); if (filter == null) { filter = ""; } featureFilter.add(filter); } }
java
public void addFeaturePath( String featurePath, String filter ) { if (!featurePaths.contains(featurePath)) { featurePaths.add(featurePath); if (filter == null) { filter = ""; } featureFilter.add(filter); } }
[ "public", "void", "addFeaturePath", "(", "String", "featurePath", ",", "String", "filter", ")", "{", "if", "(", "!", "featurePaths", ".", "contains", "(", "featurePath", ")", ")", "{", "featurePaths", ".", "add", "(", "featurePath", ")", ";", "if", "(", ...
Add a new feature file path. <p>The order will be considered. First paths are drawn first.</p> @param featurePath the path to add.
[ "Add", "a", "new", "feature", "file", "path", "." ]
d2b436bbdf951dc1fda56096a42dbc0eae4d35a5
https://github.com/TheHortonMachine/hortonmachine/blob/d2b436bbdf951dc1fda56096a42dbc0eae4d35a5/gears/src/main/java/org/hortonmachine/gears/utils/images/ImageGenerator.java#L184-L192
train
TheHortonMachine/hortonmachine
gears/src/main/java/org/hortonmachine/gears/utils/images/ImageGenerator.java
ImageGenerator.drawImageWithNewMapContent
public BufferedImage drawImageWithNewMapContent( ReferencedEnvelope ref, int imageWidth, int imageHeight, double buffer ) { MapContent content = new MapContent(); content.setTitle("dump"); if (forceCrs != null) { content.getViewport().setCoordinateReferenceSystem(forceCrs); ...
java
public BufferedImage drawImageWithNewMapContent( ReferencedEnvelope ref, int imageWidth, int imageHeight, double buffer ) { MapContent content = new MapContent(); content.setTitle("dump"); if (forceCrs != null) { content.getViewport().setCoordinateReferenceSystem(forceCrs); ...
[ "public", "BufferedImage", "drawImageWithNewMapContent", "(", "ReferencedEnvelope", "ref", ",", "int", "imageWidth", ",", "int", "imageHeight", ",", "double", "buffer", ")", "{", "MapContent", "content", "=", "new", "MapContent", "(", ")", ";", "content", ".", "...
Draw the map on an image creating a new MapContent. @param bounds the area of interest. @param imageWidth the width of the image to produce. @param imageHeight the height of the image to produce. @param buffer the buffer to add around the map bounds in map units. @return the image.
[ "Draw", "the", "map", "on", "an", "image", "creating", "a", "new", "MapContent", "." ]
d2b436bbdf951dc1fda56096a42dbc0eae4d35a5
https://github.com/TheHortonMachine/hortonmachine/blob/d2b436bbdf951dc1fda56096a42dbc0eae4d35a5/gears/src/main/java/org/hortonmachine/gears/utils/images/ImageGenerator.java#L512-L557
train
TheHortonMachine/hortonmachine
gears/src/main/java/org/hortonmachine/gears/utils/images/ImageGenerator.java
ImageGenerator.dumpPngImage
public void dumpPngImage( String imagePath, ReferencedEnvelope bounds, int imageWidth, int imageHeight, double buffer, int[] rgbCheck ) throws IOException { BufferedImage dumpImage = drawImageWithNewMapContent(bounds, imageWidth, imageHeight, buffer); boolean dumpIt = true; if (rgbCh...
java
public void dumpPngImage( String imagePath, ReferencedEnvelope bounds, int imageWidth, int imageHeight, double buffer, int[] rgbCheck ) throws IOException { BufferedImage dumpImage = drawImageWithNewMapContent(bounds, imageWidth, imageHeight, buffer); boolean dumpIt = true; if (rgbCh...
[ "public", "void", "dumpPngImage", "(", "String", "imagePath", ",", "ReferencedEnvelope", "bounds", ",", "int", "imageWidth", ",", "int", "imageHeight", ",", "double", "buffer", ",", "int", "[", "]", "rgbCheck", ")", "throws", "IOException", "{", "BufferedImage",...
Writes an image of maps drawn to a png file. @param imagePath the path to which to write the image. @param bounds the area of interest. @param imageWidth the width of the image to produce. @param imageHeight the height of the image to produce. @param buffer the buffer to add around the map bounds in map units. @param ...
[ "Writes", "an", "image", "of", "maps", "drawn", "to", "a", "png", "file", "." ]
d2b436bbdf951dc1fda56096a42dbc0eae4d35a5
https://github.com/TheHortonMachine/hortonmachine/blob/d2b436bbdf951dc1fda56096a42dbc0eae4d35a5/gears/src/main/java/org/hortonmachine/gears/utils/images/ImageGenerator.java#L577-L585
train
TheHortonMachine/hortonmachine
gears/src/main/java/org/hortonmachine/gears/utils/images/ImageGenerator.java
ImageGenerator.dumpPngImageForScaleAndPaper
public void dumpPngImageForScaleAndPaper( String imagePath, ReferencedEnvelope bounds, double scale, EPaperFormat paperFormat, Double dpi, BufferedImage legend, int legendX, int legendY, String scalePrefix, float scaleSize, int scaleX, int scaleY ) throws Exception { if (dpi == null) { ...
java
public void dumpPngImageForScaleAndPaper( String imagePath, ReferencedEnvelope bounds, double scale, EPaperFormat paperFormat, Double dpi, BufferedImage legend, int legendX, int legendY, String scalePrefix, float scaleSize, int scaleX, int scaleY ) throws Exception { if (dpi == null) { ...
[ "public", "void", "dumpPngImageForScaleAndPaper", "(", "String", "imagePath", ",", "ReferencedEnvelope", "bounds", ",", "double", "scale", ",", "EPaperFormat", "paperFormat", ",", "Double", "dpi", ",", "BufferedImage", "legend", ",", "int", "legendX", ",", "int", ...
Create an image for a given paper size and scale. @param imagePath the path to which to write the image. @param bounds the area of interest. In this case only the center is considered. The bounds are recalculated based in paper size and scale. @param scale the scale wanted for the map. @param paperFormat the paper for...
[ "Create", "an", "image", "for", "a", "given", "paper", "size", "and", "scale", "." ]
d2b436bbdf951dc1fda56096a42dbc0eae4d35a5
https://github.com/TheHortonMachine/hortonmachine/blob/d2b436bbdf951dc1fda56096a42dbc0eae4d35a5/gears/src/main/java/org/hortonmachine/gears/utils/images/ImageGenerator.java#L668-L721
train
TheHortonMachine/hortonmachine
gears/src/main/java/org/hortonmachine/gears/utils/clustering/GvmSpace.java
GvmSpace.distance
public double distance(Object pt1, Object pt2) { Object p = newCopy(pt1); subtract(p, pt2); return magnitude(p); }
java
public double distance(Object pt1, Object pt2) { Object p = newCopy(pt1); subtract(p, pt2); return magnitude(p); }
[ "public", "double", "distance", "(", "Object", "pt1", ",", "Object", "pt2", ")", "{", "Object", "p", "=", "newCopy", "(", "pt1", ")", ";", "subtract", "(", "p", ",", "pt2", ")", ";", "return", "magnitude", "(", "p", ")", ";", "}" ]
not used directly in algorithm, but useful - override for good performance
[ "not", "used", "directly", "in", "algorithm", "but", "useful", "-", "override", "for", "good", "performance" ]
d2b436bbdf951dc1fda56096a42dbc0eae4d35a5
https://github.com/TheHortonMachine/hortonmachine/blob/d2b436bbdf951dc1fda56096a42dbc0eae4d35a5/gears/src/main/java/org/hortonmachine/gears/utils/clustering/GvmSpace.java#L24-L28
train
TheHortonMachine/hortonmachine
hmachine/src/main/java/org/hortonmachine/hmachine/modules/demmanipulation/pitfiller/OmsDePitter.java
OmsDePitter.makeCellsFlowReady
private void makeCellsFlowReady( int iteration, GridNode pitfillExitNode, List<GridNode> cellsToMakeFlowReady, BitMatrix allPitsPositions, WritableRandomIter pitIter, float delta ) { iteration++; double exitElevation = pitfillExitNode.elevation; List<GridNode> connected = new ArrayL...
java
private void makeCellsFlowReady( int iteration, GridNode pitfillExitNode, List<GridNode> cellsToMakeFlowReady, BitMatrix allPitsPositions, WritableRandomIter pitIter, float delta ) { iteration++; double exitElevation = pitfillExitNode.elevation; List<GridNode> connected = new ArrayL...
[ "private", "void", "makeCellsFlowReady", "(", "int", "iteration", ",", "GridNode", "pitfillExitNode", ",", "List", "<", "GridNode", ">", "cellsToMakeFlowReady", ",", "BitMatrix", "allPitsPositions", ",", "WritableRandomIter", "pitIter", ",", "float", "delta", ")", "...
Make cells flow ready by creating a slope starting from the output cell. @param iteration the iteration. @param pitfillExitNode the exit node. @param cellsToMakeFlowReady the cells to check and change at each iteration. @param allPitsPositions the marked positions of all existing pits. Necessary to pick only those tha...
[ "Make", "cells", "flow", "ready", "by", "creating", "a", "slope", "starting", "from", "the", "output", "cell", "." ]
d2b436bbdf951dc1fda56096a42dbc0eae4d35a5
https://github.com/TheHortonMachine/hortonmachine/blob/d2b436bbdf951dc1fda56096a42dbc0eae4d35a5/hmachine/src/main/java/org/hortonmachine/hmachine/modules/demmanipulation/pitfiller/OmsDePitter.java#L568-L599
train
TheHortonMachine/hortonmachine
lesto/src/main/java/org/hortonmachine/lesto/modules/raster/adaptivetinfilter/TinHandler.java
TinHandler.setStartCoordinates
public void setStartCoordinates( List<Coordinate> coordinateList ) { generateTin(coordinateList); for( int i = 0; i < tinGeometries.length; i++ ) { Coordinate[] coordinates = tinGeometries[i].getCoordinates(); if (!tinCoordinateList.contains(coordinates[0])) { tin...
java
public void setStartCoordinates( List<Coordinate> coordinateList ) { generateTin(coordinateList); for( int i = 0; i < tinGeometries.length; i++ ) { Coordinate[] coordinates = tinGeometries[i].getCoordinates(); if (!tinCoordinateList.contains(coordinates[0])) { tin...
[ "public", "void", "setStartCoordinates", "(", "List", "<", "Coordinate", ">", "coordinateList", ")", "{", "generateTin", "(", "coordinateList", ")", ";", "for", "(", "int", "i", "=", "0", ";", "i", "<", "tinGeometries", ".", "length", ";", "i", "++", ")"...
Sets the initial coordinates to start with. <p>Generates the tin on the first set of coordinates and adds the coordinates to the {@link #tinCoordinateList} for future use.</p> <p><b>Note that it is mandatory to call this method to initialize.</b></p> @param coordinateList the initial list of coordinates.
[ "Sets", "the", "initial", "coordinates", "to", "start", "with", "." ]
d2b436bbdf951dc1fda56096a42dbc0eae4d35a5
https://github.com/TheHortonMachine/hortonmachine/blob/d2b436bbdf951dc1fda56096a42dbc0eae4d35a5/lesto/src/main/java/org/hortonmachine/lesto/modules/raster/adaptivetinfilter/TinHandler.java#L135-L150
train
TheHortonMachine/hortonmachine
lesto/src/main/java/org/hortonmachine/lesto/modules/raster/adaptivetinfilter/TinHandler.java
TinHandler.filterOnAllData
public void filterOnAllData( final ALasDataManager lasHandler ) throws Exception { final ConcurrentSkipListSet<Double> angleSet = new ConcurrentSkipListSet<Double>(); final ConcurrentSkipListSet<Double> distanceSet = new ConcurrentSkipListSet<Double>(); if (isFirstStatsCalculation) { ...
java
public void filterOnAllData( final ALasDataManager lasHandler ) throws Exception { final ConcurrentSkipListSet<Double> angleSet = new ConcurrentSkipListSet<Double>(); final ConcurrentSkipListSet<Double> distanceSet = new ConcurrentSkipListSet<Double>(); if (isFirstStatsCalculation) { ...
[ "public", "void", "filterOnAllData", "(", "final", "ALasDataManager", "lasHandler", ")", "throws", "Exception", "{", "final", "ConcurrentSkipListSet", "<", "Double", ">", "angleSet", "=", "new", "ConcurrentSkipListSet", "<", "Double", ">", "(", ")", ";", "final", ...
Filter data on thresholds of all available data on the tin. <p><b>Note: At the first run of this method, only thresholds are calculated.</b></p> @param lasHandler the las data handler of all data. @throws Exception
[ "Filter", "data", "on", "thresholds", "of", "all", "available", "data", "on", "the", "tin", "." ]
d2b436bbdf951dc1fda56096a42dbc0eae4d35a5
https://github.com/TheHortonMachine/hortonmachine/blob/d2b436bbdf951dc1fda56096a42dbc0eae4d35a5/lesto/src/main/java/org/hortonmachine/lesto/modules/raster/adaptivetinfilter/TinHandler.java#L190-L256
train
TheHortonMachine/hortonmachine
lesto/src/main/java/org/hortonmachine/lesto/modules/raster/adaptivetinfilter/TinHandler.java
TinHandler.generateTin
private void generateTin( List<Coordinate> coordinateList ) { pm.beginTask("Generate tin...", -1); DelaunayTriangulationBuilder b = new DelaunayTriangulationBuilder(); b.setSites(coordinateList); Geometry tinTriangles = b.getTriangles(gf); tinGeometries = new Geometry[tinTriangle...
java
private void generateTin( List<Coordinate> coordinateList ) { pm.beginTask("Generate tin...", -1); DelaunayTriangulationBuilder b = new DelaunayTriangulationBuilder(); b.setSites(coordinateList); Geometry tinTriangles = b.getTriangles(gf); tinGeometries = new Geometry[tinTriangle...
[ "private", "void", "generateTin", "(", "List", "<", "Coordinate", ">", "coordinateList", ")", "{", "pm", ".", "beginTask", "(", "\"Generate tin...\"", ",", "-", "1", ")", ";", "DelaunayTriangulationBuilder", "b", "=", "new", "DelaunayTriangulationBuilder", "(", ...
Generate a tin from a given coords list. The internal tin geoms array is set from the result. @param coordinateList the coords to use for the tin generation.
[ "Generate", "a", "tin", "from", "a", "given", "coords", "list", ".", "The", "internal", "tin", "geoms", "array", "is", "set", "from", "the", "result", "." ]
d2b436bbdf951dc1fda56096a42dbc0eae4d35a5
https://github.com/TheHortonMachine/hortonmachine/blob/d2b436bbdf951dc1fda56096a42dbc0eae4d35a5/lesto/src/main/java/org/hortonmachine/lesto/modules/raster/adaptivetinfilter/TinHandler.java#L588-L598
train
TheHortonMachine/hortonmachine
lesto/src/main/java/org/hortonmachine/lesto/modules/raster/adaptivetinfilter/TinHandler.java
TinHandler.generateTinIndex
public STRtree generateTinIndex( Double maxEdgeLength ) { double maxEdge = maxEdgeLength != null ? maxEdgeLength : 0.0; pm.beginTask("Creating tin indexes...", tinGeometries.length); final STRtree tinTree = new STRtree(tinGeometries.length); for( Geometry geometry : tinGeometries ) { ...
java
public STRtree generateTinIndex( Double maxEdgeLength ) { double maxEdge = maxEdgeLength != null ? maxEdgeLength : 0.0; pm.beginTask("Creating tin indexes...", tinGeometries.length); final STRtree tinTree = new STRtree(tinGeometries.length); for( Geometry geometry : tinGeometries ) { ...
[ "public", "STRtree", "generateTinIndex", "(", "Double", "maxEdgeLength", ")", "{", "double", "maxEdge", "=", "maxEdgeLength", "!=", "null", "?", "maxEdgeLength", ":", "0.0", ";", "pm", ".", "beginTask", "(", "\"Creating tin indexes...\"", ",", "tinGeometries", "."...
Generate a spatial index on the tin geometries.
[ "Generate", "a", "spatial", "index", "on", "the", "tin", "geometries", "." ]
d2b436bbdf951dc1fda56096a42dbc0eae4d35a5
https://github.com/TheHortonMachine/hortonmachine/blob/d2b436bbdf951dc1fda56096a42dbc0eae4d35a5/lesto/src/main/java/org/hortonmachine/lesto/modules/raster/adaptivetinfilter/TinHandler.java#L603-L628
train
TheHortonMachine/hortonmachine
lesto/src/main/java/org/hortonmachine/lesto/modules/raster/adaptivetinfilter/TinHandler.java
TinHandler.getOrderedNodes
private Coordinate[] getOrderedNodes( Coordinate c, Coordinate coordinate1, Coordinate coordinate2, Coordinate coordinate3 ) { double d = distance3d(c, coordinate1, null); Coordinate nearest = coordinate1; Coordinate c2 = coordinate2; Coordinate c3 = coordinate3; double d2 = dis...
java
private Coordinate[] getOrderedNodes( Coordinate c, Coordinate coordinate1, Coordinate coordinate2, Coordinate coordinate3 ) { double d = distance3d(c, coordinate1, null); Coordinate nearest = coordinate1; Coordinate c2 = coordinate2; Coordinate c3 = coordinate3; double d2 = dis...
[ "private", "Coordinate", "[", "]", "getOrderedNodes", "(", "Coordinate", "c", ",", "Coordinate", "coordinate1", ",", "Coordinate", "coordinate2", ",", "Coordinate", "coordinate3", ")", "{", "double", "d", "=", "distance3d", "(", "c", ",", "coordinate1", ",", "...
Order coordinates to have the first coordinate in the array as the nearest to a given coordinate 'c'. The second and third are not ordered, but randomly added. @param c @param coordinate1 @param coordinate2 @param coordinate3 @return
[ "Order", "coordinates", "to", "have", "the", "first", "coordinate", "in", "the", "array", "as", "the", "nearest", "to", "a", "given", "coordinate", "c", ".", "The", "second", "and", "third", "are", "not", "ordered", "but", "randomly", "added", "." ]
d2b436bbdf951dc1fda56096a42dbc0eae4d35a5
https://github.com/TheHortonMachine/hortonmachine/blob/d2b436bbdf951dc1fda56096a42dbc0eae4d35a5/lesto/src/main/java/org/hortonmachine/lesto/modules/raster/adaptivetinfilter/TinHandler.java#L652-L672
train
enasequence/sequencetools
src/main/java/uk/ac/ebi/embl/flatfile/reader/BufferedFileLineReader.java
BufferedFileLineReader.seek
public void seek(long pos) throws IOException { int n = (int) (real_pos - pos); if (n >= 0 && n <= buf_end) { buf_pos = buf_end - n; } else { raf.seek(pos); buf_end = 0; buf_pos = 0; real_pos = raf.getFilePointer(); } }
java
public void seek(long pos) throws IOException { int n = (int) (real_pos - pos); if (n >= 0 && n <= buf_end) { buf_pos = buf_end - n; } else { raf.seek(pos); buf_end = 0; buf_pos = 0; real_pos = raf.getFilePointer(); } }
[ "public", "void", "seek", "(", "long", "pos", ")", "throws", "IOException", "{", "int", "n", "=", "(", "int", ")", "(", "real_pos", "-", "pos", ")", ";", "if", "(", "n", ">=", "0", "&&", "n", "<=", "buf_end", ")", "{", "buf_pos", "=", "buf_end", ...
If the sought position is within the buffer - simply sets the current buffer position so the next read will be from the buffer. Otherwise seeks in the RAF and reset the buffer end and current positions. @param pos @throws IOException
[ "If", "the", "sought", "position", "is", "within", "the", "buffer", "-", "simply", "sets", "the", "current", "buffer", "position", "so", "the", "next", "read", "will", "be", "from", "the", "buffer", ".", "Otherwise", "seeks", "in", "the", "RAF", "and", "...
4127f5e1a17540239f5810136153fbd6737fa262
https://github.com/enasequence/sequencetools/blob/4127f5e1a17540239f5810136153fbd6737fa262/src/main/java/uk/ac/ebi/embl/flatfile/reader/BufferedFileLineReader.java#L108-L124
train
enasequence/sequencetools
src/main/java/uk/ac/ebi/embl/flatfile/reader/BufferedFileLineReader.java
BufferedFileLineReader.readLine
@Override public final String readLine() throws IOException { String str = null; if (buf_end - buf_pos <= 0) { if (fillBuffer() < 0) { // return null if we are at the end and there is nothing to read return null; } } int lineend = -1; for (int i = buf_pos; i < buf_end; i++) { if (buffer[...
java
@Override public final String readLine() throws IOException { String str = null; if (buf_end - buf_pos <= 0) { if (fillBuffer() < 0) { // return null if we are at the end and there is nothing to read return null; } } int lineend = -1; for (int i = buf_pos; i < buf_end; i++) { if (buffer[...
[ "@", "Override", "public", "final", "String", "readLine", "(", ")", "throws", "IOException", "{", "String", "str", "=", "null", ";", "if", "(", "buf_end", "-", "buf_pos", "<=", "0", ")", "{", "if", "(", "fillBuffer", "(", ")", "<", "0", ")", "{", "...
This method first decides if the buffer still contains unread contents. If it doesn't, the buffer needs to be filled up. If the new line delimiter can be found in the buffer, then a new line is read from the buffer and converted into String. Otherwise, it will simply call the read method to read byte by byte. Although ...
[ "This", "method", "first", "decides", "if", "the", "buffer", "still", "contains", "unread", "contents", ".", "If", "it", "doesn", "t", "the", "buffer", "needs", "to", "be", "filled", "up", ".", "If", "the", "new", "line", "delimiter", "can", "be", "found...
4127f5e1a17540239f5810136153fbd6737fa262
https://github.com/enasequence/sequencetools/blob/4127f5e1a17540239f5810136153fbd6737fa262/src/main/java/uk/ac/ebi/embl/flatfile/reader/BufferedFileLineReader.java#L155-L197
train
TheHortonMachine/hortonmachine
gears/src/main/java/org/hortonmachine/gears/utils/StringUtilities.java
StringUtilities.checkSameName
public static String checkSameName( List<String> strings, String string ) { int index = 1; for( int i = 0; i < strings.size(); i++ ) { if (index == 10000) { // something odd is going on throw new RuntimeException(); } String existingStr...
java
public static String checkSameName( List<String> strings, String string ) { int index = 1; for( int i = 0; i < strings.size(); i++ ) { if (index == 10000) { // something odd is going on throw new RuntimeException(); } String existingStr...
[ "public", "static", "String", "checkSameName", "(", "List", "<", "String", ">", "strings", ",", "String", "string", ")", "{", "int", "index", "=", "1", ";", "for", "(", "int", "i", "=", "0", ";", "i", "<", "strings", ".", "size", "(", ")", ";", "...
Checks if the list of strings supplied contains the supplied string. <p>If the string is contained it changes the name by adding a number. <p>The spaces are trimmed away before performing name equality. @param strings the list of existing strings. @param string the proposed new string, to be changed if colliding. @re...
[ "Checks", "if", "the", "list", "of", "strings", "supplied", "contains", "the", "supplied", "string", "." ]
d2b436bbdf951dc1fda56096a42dbc0eae4d35a5
https://github.com/TheHortonMachine/hortonmachine/blob/d2b436bbdf951dc1fda56096a42dbc0eae4d35a5/gears/src/main/java/org/hortonmachine/gears/utils/StringUtilities.java#L47-L68
train
TheHortonMachine/hortonmachine
gears/src/main/java/org/hortonmachine/gears/utils/StringUtilities.java
StringUtilities.splitString
public static List<String> splitString( String string, int limit ) { List<String> list = new ArrayList<String>(); char[] chars = string.toCharArray(); boolean endOfString = false; int start = 0; int end = start; while( start < chars.length - 1 ) { int charCou...
java
public static List<String> splitString( String string, int limit ) { List<String> list = new ArrayList<String>(); char[] chars = string.toCharArray(); boolean endOfString = false; int start = 0; int end = start; while( start < chars.length - 1 ) { int charCou...
[ "public", "static", "List", "<", "String", ">", "splitString", "(", "String", "string", ",", "int", "limit", ")", "{", "List", "<", "String", ">", "list", "=", "new", "ArrayList", "<", "String", ">", "(", ")", ";", "char", "[", "]", "chars", "=", "...
Splits a string by char limit, not breaking works. @param string the string to split. @param limit the char limit. @return the list of split words.
[ "Splits", "a", "string", "by", "char", "limit", "not", "breaking", "works", "." ]
d2b436bbdf951dc1fda56096a42dbc0eae4d35a5
https://github.com/TheHortonMachine/hortonmachine/blob/d2b436bbdf951dc1fda56096a42dbc0eae4d35a5/gears/src/main/java/org/hortonmachine/gears/utils/StringUtilities.java#L98-L123
train
TheHortonMachine/hortonmachine
gears/src/main/java/org/hortonmachine/gears/utils/StringUtilities.java
StringUtilities.streamToScanner
@SuppressWarnings("resource") public static Scanner streamToScanner( InputStream stream, String delimiter ) { java.util.Scanner s = new java.util.Scanner(stream).useDelimiter(delimiter); return s; }
java
@SuppressWarnings("resource") public static Scanner streamToScanner( InputStream stream, String delimiter ) { java.util.Scanner s = new java.util.Scanner(stream).useDelimiter(delimiter); return s; }
[ "@", "SuppressWarnings", "(", "\"resource\"", ")", "public", "static", "Scanner", "streamToScanner", "(", "InputStream", "stream", ",", "String", "delimiter", ")", "{", "java", ".", "util", ".", "Scanner", "s", "=", "new", "java", ".", "util", ".", "Scanner"...
Get scanner from input stream. <b>Note: the scanner needs to be closed after use.</b> @param stream the stream to read. @param delimiter the delimiter to use. @return the scanner.
[ "Get", "scanner", "from", "input", "stream", "." ]
d2b436bbdf951dc1fda56096a42dbc0eae4d35a5
https://github.com/TheHortonMachine/hortonmachine/blob/d2b436bbdf951dc1fda56096a42dbc0eae4d35a5/gears/src/main/java/org/hortonmachine/gears/utils/StringUtilities.java#L141-L145
train
TheHortonMachine/hortonmachine
gears/src/main/java/org/hortonmachine/gears/utils/StringUtilities.java
StringUtilities.stringToDoubleArray
public static double[] stringToDoubleArray( String string, String separator ) { if (separator == null) { separator = ","; } String[] stringSplit = string.trim().split(separator); double[] array = new double[stringSplit.length]; for( int i = 0; i < array.length; i++ ) ...
java
public static double[] stringToDoubleArray( String string, String separator ) { if (separator == null) { separator = ","; } String[] stringSplit = string.trim().split(separator); double[] array = new double[stringSplit.length]; for( int i = 0; i < array.length; i++ ) ...
[ "public", "static", "double", "[", "]", "stringToDoubleArray", "(", "String", "string", ",", "String", "separator", ")", "{", "if", "(", "separator", "==", "null", ")", "{", "separator", "=", "\",\"", ";", "}", "String", "[", "]", "stringSplit", "=", "st...
Convert a string containing a list of numbers into its array. @param string the string containing numbers. @param separator the number separator. @return the array of values.
[ "Convert", "a", "string", "containing", "a", "list", "of", "numbers", "into", "its", "array", "." ]
d2b436bbdf951dc1fda56096a42dbc0eae4d35a5
https://github.com/TheHortonMachine/hortonmachine/blob/d2b436bbdf951dc1fda56096a42dbc0eae4d35a5/gears/src/main/java/org/hortonmachine/gears/utils/StringUtilities.java#L154-L164
train
enasequence/sequencetools
src/main/java/uk/ac/ebi/embl/api/entry/feature/Feature.java
Feature.getTextDescription
public String getTextDescription() { StringBuilder builder = new StringBuilder(name); builder.append(" "); List<Location> locationList = new ArrayList<Location>(locations.getLocations()); Collections.sort(locationList, new LocationComparator(LocationComparator.START_LOCATION)); f...
java
public String getTextDescription() { StringBuilder builder = new StringBuilder(name); builder.append(" "); List<Location> locationList = new ArrayList<Location>(locations.getLocations()); Collections.sort(locationList, new LocationComparator(LocationComparator.START_LOCATION)); f...
[ "public", "String", "getTextDescription", "(", ")", "{", "StringBuilder", "builder", "=", "new", "StringBuilder", "(", "name", ")", ";", "builder", ".", "append", "(", "\" \"", ")", ";", "List", "<", "Location", ">", "locationList", "=", "new", "ArrayList", ...
The feature name and location as a string - handy for text summary @return
[ "The", "feature", "name", "and", "location", "as", "a", "string", "-", "handy", "for", "text", "summary" ]
4127f5e1a17540239f5810136153fbd6737fa262
https://github.com/enasequence/sequencetools/blob/4127f5e1a17540239f5810136153fbd6737fa262/src/main/java/uk/ac/ebi/embl/api/entry/feature/Feature.java#L369-L382
train
codahale/xsalsa20poly1305
src/main/java/com/codahale/xsalsa20poly1305/SimpleBox.java
SimpleBox.seal
public byte[] seal(byte[] plaintext) { final byte[] nonce = box.nonce(plaintext); final byte[] ciphertext = box.seal(nonce, plaintext); final byte[] combined = new byte[nonce.length + ciphertext.length]; System.arraycopy(nonce, 0, combined, 0, nonce.length); System.arraycopy(ciphertext, 0, combined,...
java
public byte[] seal(byte[] plaintext) { final byte[] nonce = box.nonce(plaintext); final byte[] ciphertext = box.seal(nonce, plaintext); final byte[] combined = new byte[nonce.length + ciphertext.length]; System.arraycopy(nonce, 0, combined, 0, nonce.length); System.arraycopy(ciphertext, 0, combined,...
[ "public", "byte", "[", "]", "seal", "(", "byte", "[", "]", "plaintext", ")", "{", "final", "byte", "[", "]", "nonce", "=", "box", ".", "nonce", "(", "plaintext", ")", ";", "final", "byte", "[", "]", "ciphertext", "=", "box", ".", "seal", "(", "no...
Encrypt the plaintext with the given key. @param plaintext any arbitrary bytes @return the ciphertext
[ "Encrypt", "the", "plaintext", "with", "the", "given", "key", "." ]
f3c1ab2f05b17df137ed8fbb66da2b417066729a
https://github.com/codahale/xsalsa20poly1305/blob/f3c1ab2f05b17df137ed8fbb66da2b417066729a/src/main/java/com/codahale/xsalsa20poly1305/SimpleBox.java#L56-L63
train
codahale/xsalsa20poly1305
src/main/java/com/codahale/xsalsa20poly1305/SimpleBox.java
SimpleBox.open
public Optional<byte[]> open(byte[] ciphertext) { if (ciphertext.length < SecretBox.NONCE_SIZE) { return Optional.empty(); } final byte[] nonce = Arrays.copyOfRange(ciphertext, 0, SecretBox.NONCE_SIZE); final byte[] x = Arrays.copyOfRange(ciphertext, SecretBox.NONCE_SIZE, ciphertext.length); r...
java
public Optional<byte[]> open(byte[] ciphertext) { if (ciphertext.length < SecretBox.NONCE_SIZE) { return Optional.empty(); } final byte[] nonce = Arrays.copyOfRange(ciphertext, 0, SecretBox.NONCE_SIZE); final byte[] x = Arrays.copyOfRange(ciphertext, SecretBox.NONCE_SIZE, ciphertext.length); r...
[ "public", "Optional", "<", "byte", "[", "]", ">", "open", "(", "byte", "[", "]", "ciphertext", ")", "{", "if", "(", "ciphertext", ".", "length", "<", "SecretBox", ".", "NONCE_SIZE", ")", "{", "return", "Optional", ".", "empty", "(", ")", ";", "}", ...
Decrypt the ciphertext with the given key. @param ciphertext an encrypted message @return an {@link Optional} of the original plaintext, or if either the key, nonce, or ciphertext was modified, an empty {@link Optional}
[ "Decrypt", "the", "ciphertext", "with", "the", "given", "key", "." ]
f3c1ab2f05b17df137ed8fbb66da2b417066729a
https://github.com/codahale/xsalsa20poly1305/blob/f3c1ab2f05b17df137ed8fbb66da2b417066729a/src/main/java/com/codahale/xsalsa20poly1305/SimpleBox.java#L72-L79
train
TheHortonMachine/hortonmachine
gears/src/main/java/org/hortonmachine/gears/io/dxfdwg/libs/dwg/objects/DwgVertex3D.java
DwgVertex3D.readDwgVertex3DV15
public void readDwgVertex3DV15(int[] data, int offset) throws Exception { int bitPos = offset; bitPos = readObjectHeaderV15(data, bitPos); Vector v = DwgUtil.getRawChar(data, bitPos); bitPos = ((Integer)v.get(0)).intValue(); int flags = ((Integer)v.get(1)).intValue(); this.flags = flags; v = DwgUtil.getBi...
java
public void readDwgVertex3DV15(int[] data, int offset) throws Exception { int bitPos = offset; bitPos = readObjectHeaderV15(data, bitPos); Vector v = DwgUtil.getRawChar(data, bitPos); bitPos = ((Integer)v.get(0)).intValue(); int flags = ((Integer)v.get(1)).intValue(); this.flags = flags; v = DwgUtil.getBi...
[ "public", "void", "readDwgVertex3DV15", "(", "int", "[", "]", "data", ",", "int", "offset", ")", "throws", "Exception", "{", "int", "bitPos", "=", "offset", ";", "bitPos", "=", "readObjectHeaderV15", "(", "data", ",", "bitPos", ")", ";", "Vector", "v", "...
Read a Vertex3D in the DWG format Version 15 @param data Array of unsigned bytes obtained from the DWG binary file @param offset The current bit offset where the value begins @throws Exception If an unexpected bit value is found in the DWG file. Occurs when we are looking for LwPolylines.
[ "Read", "a", "Vertex3D", "in", "the", "DWG", "format", "Version", "15" ]
d2b436bbdf951dc1fda56096a42dbc0eae4d35a5
https://github.com/TheHortonMachine/hortonmachine/blob/d2b436bbdf951dc1fda56096a42dbc0eae4d35a5/gears/src/main/java/org/hortonmachine/gears/io/dxfdwg/libs/dwg/objects/DwgVertex3D.java#L43-L62
train
TheHortonMachine/hortonmachine
gears/src/main/java/org/hortonmachine/gears/modules/utils/fileiterator/OmsFileIterator.java
OmsFileIterator.addPrj
public static void addPrj( String folder, String epsg ) throws Exception { OmsFileIterator fiter = new OmsFileIterator(); fiter.inFolder = folder; fiter.pCode = epsg; fiter.process(); }
java
public static void addPrj( String folder, String epsg ) throws Exception { OmsFileIterator fiter = new OmsFileIterator(); fiter.inFolder = folder; fiter.pCode = epsg; fiter.process(); }
[ "public", "static", "void", "addPrj", "(", "String", "folder", ",", "String", "epsg", ")", "throws", "Exception", "{", "OmsFileIterator", "fiter", "=", "new", "OmsFileIterator", "(", ")", ";", "fiter", ".", "inFolder", "=", "folder", ";", "fiter", ".", "pC...
Utility to add to all found files in a given folder the prj file following the supplied epsg. @param folder the folder to browse. @param epsg the epsg from which to take the prj. @throws Exception
[ "Utility", "to", "add", "to", "all", "found", "files", "in", "a", "given", "folder", "the", "prj", "file", "following", "the", "supplied", "epsg", "." ]
d2b436bbdf951dc1fda56096a42dbc0eae4d35a5
https://github.com/TheHortonMachine/hortonmachine/blob/d2b436bbdf951dc1fda56096a42dbc0eae4d35a5/gears/src/main/java/org/hortonmachine/gears/modules/utils/fileiterator/OmsFileIterator.java#L181-L186
train
TheHortonMachine/hortonmachine
hmachine/src/main/java/org/hortonmachine/hmachine/modules/geomorphology/draindir/OmsDrainDir.java
OmsDrainDir.process
@Execute public void process() throws Exception { if (!concatOr(outFlow == null, doReset)) { return; } checkNull(inFlow, inPit); RegionMap regionMap = CoverageUtilities.getRegionParamsFromGridCoverage(inPit); cols = regionMap.getCols(); rows = regionMap.g...
java
@Execute public void process() throws Exception { if (!concatOr(outFlow == null, doReset)) { return; } checkNull(inFlow, inPit); RegionMap regionMap = CoverageUtilities.getRegionParamsFromGridCoverage(inPit); cols = regionMap.getCols(); rows = regionMap.g...
[ "@", "Execute", "public", "void", "process", "(", ")", "throws", "Exception", "{", "if", "(", "!", "concatOr", "(", "outFlow", "==", "null", ",", "doReset", ")", ")", "{", "return", ";", "}", "checkNull", "(", "inFlow", ",", "inPit", ")", ";", "Regio...
Calculates new drainage directions @throws Exception
[ "Calculates", "new", "drainage", "directions" ]
d2b436bbdf951dc1fda56096a42dbc0eae4d35a5
https://github.com/TheHortonMachine/hortonmachine/blob/d2b436bbdf951dc1fda56096a42dbc0eae4d35a5/hmachine/src/main/java/org/hortonmachine/hmachine/modules/geomorphology/draindir/OmsDrainDir.java#L144-L215
train
TheHortonMachine/hortonmachine
gears/src/main/java/org/hortonmachine/gears/io/geopaparazzi/geopap4/DaoMetadata.java
DaoMetadata.fillProjectMetadata
public static void fillProjectMetadata(Connection connection, String name, String description, String notes, String creationUser) throws Exception { Date creationDate = new Date(); if (name == null) { name = "project-" + ETimeUtilities.INSTANCE.TIME_FORMATTER_LOCAL.format(creationDate); ...
java
public static void fillProjectMetadata(Connection connection, String name, String description, String notes, String creationUser) throws Exception { Date creationDate = new Date(); if (name == null) { name = "project-" + ETimeUtilities.INSTANCE.TIME_FORMATTER_LOCAL.format(creationDate); ...
[ "public", "static", "void", "fillProjectMetadata", "(", "Connection", "connection", ",", "String", "name", ",", "String", "description", ",", "String", "notes", ",", "String", "creationUser", ")", "throws", "Exception", "{", "Date", "creationDate", "=", "new", "...
Populate the project metadata table. @param name the project name @param description an optional description. @param notes optional notes. @param creationUser the user creating the project. @throws java.io.IOException if something goes wrong.
[ "Populate", "the", "project", "metadata", "table", "." ]
d2b436bbdf951dc1fda56096a42dbc0eae4d35a5
https://github.com/TheHortonMachine/hortonmachine/blob/d2b436bbdf951dc1fda56096a42dbc0eae4d35a5/gears/src/main/java/org/hortonmachine/gears/io/geopaparazzi/geopap4/DaoMetadata.java#L74-L97
train
TheHortonMachine/hortonmachine
gears/src/main/java/oms3/compiler/MemoryOutputJavaFileManager.java
MemoryOutputJavaFileManager.listClassesFromUrl
protected List<JavaFileObject> listClassesFromUrl(URL base, String packageName) throws IOException { //TODO this will only work with file:// not jar:// if (base == null) { throw new NullPointerException("base == null"); } List<JavaFileObject> list = new ArrayList<JavaFileOb...
java
protected List<JavaFileObject> listClassesFromUrl(URL base, String packageName) throws IOException { //TODO this will only work with file:// not jar:// if (base == null) { throw new NullPointerException("base == null"); } List<JavaFileObject> list = new ArrayList<JavaFileOb...
[ "protected", "List", "<", "JavaFileObject", ">", "listClassesFromUrl", "(", "URL", "base", ",", "String", "packageName", ")", "throws", "IOException", "{", "//TODO this will only work with file:// not jar://", "if", "(", "base", "==", "null", ")", "{", "throw", "new...
Lists all files at a specified URL. @param base the URL. @param packageName the package name of classes to list. @return a list of class files. @throws IOException if an I/O error occurs.
[ "Lists", "all", "files", "at", "a", "specified", "URL", "." ]
d2b436bbdf951dc1fda56096a42dbc0eae4d35a5
https://github.com/TheHortonMachine/hortonmachine/blob/d2b436bbdf951dc1fda56096a42dbc0eae4d35a5/gears/src/main/java/oms3/compiler/MemoryOutputJavaFileManager.java#L175-L214
train
TheHortonMachine/hortonmachine
gears/src/main/java/oms3/io/DataIO.java
DataIO.sliceByTime
public static int[] sliceByTime(CSTable table, int timeCol, Date start, Date end) { if (end.before(start)) { throw new IllegalArgumentException("end<start"); } if (timeCol < 0) { throw new IllegalArgumentException("timeCol :" + timeCol); } int s = -1; ...
java
public static int[] sliceByTime(CSTable table, int timeCol, Date start, Date end) { if (end.before(start)) { throw new IllegalArgumentException("end<start"); } if (timeCol < 0) { throw new IllegalArgumentException("timeCol :" + timeCol); } int s = -1; ...
[ "public", "static", "int", "[", "]", "sliceByTime", "(", "CSTable", "table", ",", "int", "timeCol", ",", "Date", "start", ",", "Date", "end", ")", "{", "if", "(", "end", ".", "before", "(", "start", ")", ")", "{", "throw", "new", "IllegalArgumentExcept...
Get a slice of rows out of the table matching the time window @param table @param timeCol @param start @param end @return the first and last row that matches the time window start->end
[ "Get", "a", "slice", "of", "rows", "out", "of", "the", "table", "matching", "the", "time", "window" ]
d2b436bbdf951dc1fda56096a42dbc0eae4d35a5
https://github.com/TheHortonMachine/hortonmachine/blob/d2b436bbdf951dc1fda56096a42dbc0eae4d35a5/gears/src/main/java/oms3/io/DataIO.java#L468-L490
train
TheHortonMachine/hortonmachine
gears/src/main/java/oms3/io/DataIO.java
DataIO.getProperties
public static AbstractTableModel getProperties(final CSProperties p) { return new AbstractTableModel() { @Override public int getRowCount() { return p.keySet().size(); } @Override public int getColumnCount() { return ...
java
public static AbstractTableModel getProperties(final CSProperties p) { return new AbstractTableModel() { @Override public int getRowCount() { return p.keySet().size(); } @Override public int getColumnCount() { return ...
[ "public", "static", "AbstractTableModel", "getProperties", "(", "final", "CSProperties", "p", ")", "{", "return", "new", "AbstractTableModel", "(", ")", "{", "@", "Override", "public", "int", "getRowCount", "(", ")", "{", "return", "p", ".", "keySet", "(", "...
Get the KVP as table. @param p @return an AbstractTableModel for properties (KVP)
[ "Get", "the", "KVP", "as", "table", "." ]
d2b436bbdf951dc1fda56096a42dbc0eae4d35a5
https://github.com/TheHortonMachine/hortonmachine/blob/d2b436bbdf951dc1fda56096a42dbc0eae4d35a5/gears/src/main/java/oms3/io/DataIO.java#L555-L601
train
TheHortonMachine/hortonmachine
gears/src/main/java/oms3/io/DataIO.java
DataIO.toArrayString
public static String toArrayString(String[] arr) { StringBuilder b = new StringBuilder(); b.append('{'); for (int i = 0; i < arr.length; i++) { b.append(arr[i]); if (i < arr.length - 1) { b.append(','); } } b.append('}'); ...
java
public static String toArrayString(String[] arr) { StringBuilder b = new StringBuilder(); b.append('{'); for (int i = 0; i < arr.length; i++) { b.append(arr[i]); if (i < arr.length - 1) { b.append(','); } } b.append('}'); ...
[ "public", "static", "String", "toArrayString", "(", "String", "[", "]", "arr", ")", "{", "StringBuilder", "b", "=", "new", "StringBuilder", "(", ")", ";", "b", ".", "append", "(", "'", "'", ")", ";", "for", "(", "int", "i", "=", "0", ";", "i", "<...
Create array string. @param arr @return an array String.
[ "Create", "array", "string", "." ]
d2b436bbdf951dc1fda56096a42dbc0eae4d35a5
https://github.com/TheHortonMachine/hortonmachine/blob/d2b436bbdf951dc1fda56096a42dbc0eae4d35a5/gears/src/main/java/oms3/io/DataIO.java#L789-L800
train
TheHortonMachine/hortonmachine
gears/src/main/java/oms3/io/DataIO.java
DataIO.getColumnDoubleValues
public static Double[] getColumnDoubleValues(CSTable t, String columnName) { int col = columnIndex(t, columnName); if (col == -1) { throw new IllegalArgumentException("No such column: " + columnName); } List<Double> l = new ArrayList<Double>(); for (String[] s : t.row...
java
public static Double[] getColumnDoubleValues(CSTable t, String columnName) { int col = columnIndex(t, columnName); if (col == -1) { throw new IllegalArgumentException("No such column: " + columnName); } List<Double> l = new ArrayList<Double>(); for (String[] s : t.row...
[ "public", "static", "Double", "[", "]", "getColumnDoubleValues", "(", "CSTable", "t", ",", "String", "columnName", ")", "{", "int", "col", "=", "columnIndex", "(", "t", ",", "columnName", ")", ";", "if", "(", "col", "==", "-", "1", ")", "{", "throw", ...
Get a column as an int array. @param t @param columnName @return the column data as doubles.
[ "Get", "a", "column", "as", "an", "int", "array", "." ]
d2b436bbdf951dc1fda56096a42dbc0eae4d35a5
https://github.com/TheHortonMachine/hortonmachine/blob/d2b436bbdf951dc1fda56096a42dbc0eae4d35a5/gears/src/main/java/oms3/io/DataIO.java#L941-L951
train
TheHortonMachine/hortonmachine
gears/src/main/java/oms3/io/DataIO.java
DataIO.getDate
public static Date getDate(CSProperties p, String key) throws ParseException { String val = p.get(key).toString(); if (val == null) { throw new IllegalArgumentException(key); } String f = p.getInfo(key).get(KEY_FORMAT); DateFormat fmt = new SimpleDateFormat(f == null ...
java
public static Date getDate(CSProperties p, String key) throws ParseException { String val = p.get(key).toString(); if (val == null) { throw new IllegalArgumentException(key); } String f = p.getInfo(key).get(KEY_FORMAT); DateFormat fmt = new SimpleDateFormat(f == null ...
[ "public", "static", "Date", "getDate", "(", "CSProperties", "p", ",", "String", "key", ")", "throws", "ParseException", "{", "String", "val", "=", "p", ".", "get", "(", "key", ")", ".", "toString", "(", ")", ";", "if", "(", "val", "==", "null", ")", ...
Get a value as date. @param p @param key @return a property as Date @throws java.text.ParseException
[ "Get", "a", "value", "as", "date", "." ]
d2b436bbdf951dc1fda56096a42dbc0eae4d35a5
https://github.com/TheHortonMachine/hortonmachine/blob/d2b436bbdf951dc1fda56096a42dbc0eae4d35a5/gears/src/main/java/oms3/io/DataIO.java#L961-L969
train
TheHortonMachine/hortonmachine
gears/src/main/java/oms3/io/DataIO.java
DataIO.getInt
public static int getInt(CSProperties p, String key) throws ParseException { String val = p.get(key).toString(); if (val == null) { throw new IllegalArgumentException(key); } return Integer.parseInt(val); }
java
public static int getInt(CSProperties p, String key) throws ParseException { String val = p.get(key).toString(); if (val == null) { throw new IllegalArgumentException(key); } return Integer.parseInt(val); }
[ "public", "static", "int", "getInt", "(", "CSProperties", "p", ",", "String", "key", ")", "throws", "ParseException", "{", "String", "val", "=", "p", ".", "get", "(", "key", ")", ".", "toString", "(", ")", ";", "if", "(", "val", "==", "null", ")", ...
Get a value as integer. @param p @param key @return a property value as integer. @throws java.text.ParseException
[ "Get", "a", "value", "as", "integer", "." ]
d2b436bbdf951dc1fda56096a42dbc0eae4d35a5
https://github.com/TheHortonMachine/hortonmachine/blob/d2b436bbdf951dc1fda56096a42dbc0eae4d35a5/gears/src/main/java/oms3/io/DataIO.java#L978-L984
train
TheHortonMachine/hortonmachine
gears/src/main/java/oms3/io/DataIO.java
DataIO.print
public static void print(CSProperties props, PrintWriter out) { out.println(PROPERTIES + "," + CSVParser.printLine(props.getName())); for (String key : props.getInfo().keySet()) { out.println(" " + CSVParser.printLine(key, props.getInfo().get(key))); } out.println(); ...
java
public static void print(CSProperties props, PrintWriter out) { out.println(PROPERTIES + "," + CSVParser.printLine(props.getName())); for (String key : props.getInfo().keySet()) { out.println(" " + CSVParser.printLine(key, props.getInfo().get(key))); } out.println(); ...
[ "public", "static", "void", "print", "(", "CSProperties", "props", ",", "PrintWriter", "out", ")", "{", "out", ".", "println", "(", "PROPERTIES", "+", "\",\"", "+", "CSVParser", ".", "printLine", "(", "props", ".", "getName", "(", ")", ")", ")", ";", "...
Print CSProperties. @param props the Properties to print @param out the output writer to print to.
[ "Print", "CSProperties", "." ]
d2b436bbdf951dc1fda56096a42dbc0eae4d35a5
https://github.com/TheHortonMachine/hortonmachine/blob/d2b436bbdf951dc1fda56096a42dbc0eae4d35a5/gears/src/main/java/oms3/io/DataIO.java#L1010-L1025
train
TheHortonMachine/hortonmachine
gears/src/main/java/oms3/io/DataIO.java
DataIO.print
public static void print(CSTable table, PrintWriter out) { out.println(TABLE + "," + CSVParser.printLine(table.getName())); for (String key : table.getInfo().keySet()) { out.println(CSVParser.printLine(key, table.getInfo().get(key))); } if (table.getColumnCount() < 1) { ...
java
public static void print(CSTable table, PrintWriter out) { out.println(TABLE + "," + CSVParser.printLine(table.getName())); for (String key : table.getInfo().keySet()) { out.println(CSVParser.printLine(key, table.getInfo().get(key))); } if (table.getColumnCount() < 1) { ...
[ "public", "static", "void", "print", "(", "CSTable", "table", ",", "PrintWriter", "out", ")", "{", "out", ".", "println", "(", "TABLE", "+", "\",\"", "+", "CSVParser", ".", "printLine", "(", "table", ".", "getName", "(", ")", ")", ")", ";", "for", "(...
Print a CSTable to a PrintWriter @param table the table to print @param out the writer to write to
[ "Print", "a", "CSTable", "to", "a", "PrintWriter" ]
d2b436bbdf951dc1fda56096a42dbc0eae4d35a5
https://github.com/TheHortonMachine/hortonmachine/blob/d2b436bbdf951dc1fda56096a42dbc0eae4d35a5/gears/src/main/java/oms3/io/DataIO.java#L1043-L1073
train
TheHortonMachine/hortonmachine
gears/src/main/java/oms3/io/DataIO.java
DataIO.save
public static void save(CSTable table, File file) throws IOException { PrintWriter w = new PrintWriter(file); print(table, w); w.close(); }
java
public static void save(CSTable table, File file) throws IOException { PrintWriter w = new PrintWriter(file); print(table, w); w.close(); }
[ "public", "static", "void", "save", "(", "CSTable", "table", ",", "File", "file", ")", "throws", "IOException", "{", "PrintWriter", "w", "=", "new", "PrintWriter", "(", "file", ")", ";", "print", "(", "table", ",", "w", ")", ";", "w", ".", "close", "...
Saves a table to a file. @param table the table to save @param file the file to store it in (overwritten, if exists) @throws IOException
[ "Saves", "a", "table", "to", "a", "file", "." ]
d2b436bbdf951dc1fda56096a42dbc0eae4d35a5
https://github.com/TheHortonMachine/hortonmachine/blob/d2b436bbdf951dc1fda56096a42dbc0eae4d35a5/gears/src/main/java/oms3/io/DataIO.java#L1081-L1085
train
TheHortonMachine/hortonmachine
gears/src/main/java/oms3/io/DataIO.java
DataIO.properties
public static CSProperties properties(Reader r, String name) throws IOException { return new CSVProperties(r, name); }
java
public static CSProperties properties(Reader r, String name) throws IOException { return new CSVProperties(r, name); }
[ "public", "static", "CSProperties", "properties", "(", "Reader", "r", ",", "String", "name", ")", "throws", "IOException", "{", "return", "new", "CSVProperties", "(", "r", ",", "name", ")", ";", "}" ]
Parse properties from a reader @param r the Reader @param name the name of the properties @return properties from a file. @throws java.io.IOException
[ "Parse", "properties", "from", "a", "reader" ]
d2b436bbdf951dc1fda56096a42dbc0eae4d35a5
https://github.com/TheHortonMachine/hortonmachine/blob/d2b436bbdf951dc1fda56096a42dbc0eae4d35a5/gears/src/main/java/oms3/io/DataIO.java#L1095-L1097
train
TheHortonMachine/hortonmachine
gears/src/main/java/oms3/io/DataIO.java
DataIO.properties
public static CSProperties properties(Reader[] r, String name) throws IOException { CSVProperties p = new CSVProperties(r[0], name); for (int i = 1; i < r.length; i++) { CSVParser csv = new CSVParser(r[i], CSVStrategy.DEFAULT_STRATEGY); locate(csv, name, PROPERTIES, PROPERTIES1);...
java
public static CSProperties properties(Reader[] r, String name) throws IOException { CSVProperties p = new CSVProperties(r[0], name); for (int i = 1; i < r.length; i++) { CSVParser csv = new CSVParser(r[i], CSVStrategy.DEFAULT_STRATEGY); locate(csv, name, PROPERTIES, PROPERTIES1);...
[ "public", "static", "CSProperties", "properties", "(", "Reader", "[", "]", "r", ",", "String", "name", ")", "throws", "IOException", "{", "CSVProperties", "p", "=", "new", "CSVProperties", "(", "r", "[", "0", "]", ",", "name", ")", ";", "for", "(", "in...
Create a CSProperty from an array of reader. @param r @param name @return merged properties. @throws java.io.IOException
[ "Create", "a", "CSProperty", "from", "an", "array", "of", "reader", "." ]
d2b436bbdf951dc1fda56096a42dbc0eae4d35a5
https://github.com/TheHortonMachine/hortonmachine/blob/d2b436bbdf951dc1fda56096a42dbc0eae4d35a5/gears/src/main/java/oms3/io/DataIO.java#L1106-L1115
train
TheHortonMachine/hortonmachine
gears/src/main/java/oms3/io/DataIO.java
DataIO.merge
public static void merge(CSProperties base, CSProperties overlay) { for (String key : overlay.keySet()) { if (base.getInfo(key).containsKey("public")) { base.put(key, overlay.get(key)); } else { throw new IllegalArgumentException("Not public: " + key); ...
java
public static void merge(CSProperties base, CSProperties overlay) { for (String key : overlay.keySet()) { if (base.getInfo(key).containsKey("public")) { base.put(key, overlay.get(key)); } else { throw new IllegalArgumentException("Not public: " + key); ...
[ "public", "static", "void", "merge", "(", "CSProperties", "base", ",", "CSProperties", "overlay", ")", "{", "for", "(", "String", "key", ":", "overlay", ".", "keySet", "(", ")", ")", "{", "if", "(", "base", ".", "getInfo", "(", "key", ")", ".", "cont...
Merges two Properties, respects permissions @param base @param overlay
[ "Merges", "two", "Properties", "respects", "permissions" ]
d2b436bbdf951dc1fda56096a42dbc0eae4d35a5
https://github.com/TheHortonMachine/hortonmachine/blob/d2b436bbdf951dc1fda56096a42dbc0eae4d35a5/gears/src/main/java/oms3/io/DataIO.java#L1123-L1131
train
TheHortonMachine/hortonmachine
gears/src/main/java/oms3/io/DataIO.java
DataIO.properties
public static Properties properties(CSProperties p) { Properties pr = new Properties(); pr.putAll(p); return pr; }
java
public static Properties properties(CSProperties p) { Properties pr = new Properties(); pr.putAll(p); return pr; }
[ "public", "static", "Properties", "properties", "(", "CSProperties", "p", ")", "{", "Properties", "pr", "=", "new", "Properties", "(", ")", ";", "pr", ".", "putAll", "(", "p", ")", ";", "return", "pr", ";", "}" ]
Convert CSProperties into Properties @param p @return the Properties.
[ "Convert", "CSProperties", "into", "Properties" ]
d2b436bbdf951dc1fda56096a42dbc0eae4d35a5
https://github.com/TheHortonMachine/hortonmachine/blob/d2b436bbdf951dc1fda56096a42dbc0eae4d35a5/gears/src/main/java/oms3/io/DataIO.java#L1138-L1142
train
TheHortonMachine/hortonmachine
gears/src/main/java/oms3/io/DataIO.java
DataIO.table
public static CSTable table(File file, String name) throws IOException { return new FileTable(file, name); }
java
public static CSTable table(File file, String name) throws IOException { return new FileTable(file, name); }
[ "public", "static", "CSTable", "table", "(", "File", "file", ",", "String", "name", ")", "throws", "IOException", "{", "return", "new", "FileTable", "(", "file", ",", "name", ")", ";", "}" ]
Parse a table from a given File. @param file @param name @return a CSTable. @throws java.io.IOException
[ "Parse", "a", "table", "from", "a", "given", "File", "." ]
d2b436bbdf951dc1fda56096a42dbc0eae4d35a5
https://github.com/TheHortonMachine/hortonmachine/blob/d2b436bbdf951dc1fda56096a42dbc0eae4d35a5/gears/src/main/java/oms3/io/DataIO.java#L1185-L1187
train
TheHortonMachine/hortonmachine
gears/src/main/java/oms3/io/DataIO.java
DataIO.table
public static CSTable table(String s, String name) throws IOException { return new StringTable(s, name); }
java
public static CSTable table(String s, String name) throws IOException { return new StringTable(s, name); }
[ "public", "static", "CSTable", "table", "(", "String", "s", ",", "String", "name", ")", "throws", "IOException", "{", "return", "new", "StringTable", "(", "s", ",", "name", ")", ";", "}" ]
Parse a table from a Reader. @param s the Reader to read from @param name the name of the table @return the CSTable @throws IOException
[ "Parse", "a", "table", "from", "a", "Reader", "." ]
d2b436bbdf951dc1fda56096a42dbc0eae4d35a5
https://github.com/TheHortonMachine/hortonmachine/blob/d2b436bbdf951dc1fda56096a42dbc0eae4d35a5/gears/src/main/java/oms3/io/DataIO.java#L1206-L1208
train
TheHortonMachine/hortonmachine
gears/src/main/java/oms3/io/DataIO.java
DataIO.table
public static CSTable table(URL url, String name) throws IOException { return new URLTable(url, name); }
java
public static CSTable table(URL url, String name) throws IOException { return new URLTable(url, name); }
[ "public", "static", "CSTable", "table", "(", "URL", "url", ",", "String", "name", ")", "throws", "IOException", "{", "return", "new", "URLTable", "(", "url", ",", "name", ")", ";", "}" ]
Create a CSTable from a URL source. @param url the table URL @param name the name of the table @return a new CSTable @throws IOException
[ "Create", "a", "CSTable", "from", "a", "URL", "source", "." ]
d2b436bbdf951dc1fda56096a42dbc0eae4d35a5
https://github.com/TheHortonMachine/hortonmachine/blob/d2b436bbdf951dc1fda56096a42dbc0eae4d35a5/gears/src/main/java/oms3/io/DataIO.java#L1227-L1229
train
TheHortonMachine/hortonmachine
gears/src/main/java/oms3/io/DataIO.java
DataIO.columnExist
public static boolean columnExist(CSTable table, String name) { for (int i = 1; i <= table.getColumnCount(); i++) { if (table.getColumnName(i).startsWith(name)) { return true; } } return false; }
java
public static boolean columnExist(CSTable table, String name) { for (int i = 1; i <= table.getColumnCount(); i++) { if (table.getColumnName(i).startsWith(name)) { return true; } } return false; }
[ "public", "static", "boolean", "columnExist", "(", "CSTable", "table", ",", "String", "name", ")", "{", "for", "(", "int", "i", "=", "1", ";", "i", "<=", "table", ".", "getColumnCount", "(", ")", ";", "i", "++", ")", "{", "if", "(", "table", ".", ...
Check if a column exist in table. @param table the table to check @param name the name of the column @return
[ "Check", "if", "a", "column", "exist", "in", "table", "." ]
d2b436bbdf951dc1fda56096a42dbc0eae4d35a5
https://github.com/TheHortonMachine/hortonmachine/blob/d2b436bbdf951dc1fda56096a42dbc0eae4d35a5/gears/src/main/java/oms3/io/DataIO.java#L1237-L1244
train
TheHortonMachine/hortonmachine
gears/src/main/java/oms3/io/DataIO.java
DataIO.columnIndex
public static int columnIndex(CSTable table, String name) { for (int i = 1; i <= table.getColumnCount(); i++) { if (table.getColumnName(i).equals(name)) { return i; } } return -1; }
java
public static int columnIndex(CSTable table, String name) { for (int i = 1; i <= table.getColumnCount(); i++) { if (table.getColumnName(i).equals(name)) { return i; } } return -1; }
[ "public", "static", "int", "columnIndex", "(", "CSTable", "table", ",", "String", "name", ")", "{", "for", "(", "int", "i", "=", "1", ";", "i", "<=", "table", ".", "getColumnCount", "(", ")", ";", "i", "++", ")", "{", "if", "(", "table", ".", "ge...
Gets a column index by name @param table The table to check @param name the column name @return the index of the column
[ "Gets", "a", "column", "index", "by", "name" ]
d2b436bbdf951dc1fda56096a42dbc0eae4d35a5
https://github.com/TheHortonMachine/hortonmachine/blob/d2b436bbdf951dc1fda56096a42dbc0eae4d35a5/gears/src/main/java/oms3/io/DataIO.java#L1252-L1259
train
TheHortonMachine/hortonmachine
gears/src/main/java/oms3/io/DataIO.java
DataIO.extractColumns
public static CSTable extractColumns(CSTable table, String... colNames) { int[] idx = {}; for (String name : colNames) { idx = add(idx, columnIndexes(table, name)); } if (idx.length == 0) { throw new IllegalArgumentException("No such column names: " + Arrays.toS...
java
public static CSTable extractColumns(CSTable table, String... colNames) { int[] idx = {}; for (String name : colNames) { idx = add(idx, columnIndexes(table, name)); } if (idx.length == 0) { throw new IllegalArgumentException("No such column names: " + Arrays.toS...
[ "public", "static", "CSTable", "extractColumns", "(", "CSTable", "table", ",", "String", "...", "colNames", ")", "{", "int", "[", "]", "idx", "=", "{", "}", ";", "for", "(", "String", "name", ":", "colNames", ")", "{", "idx", "=", "add", "(", "idx", ...
Extract the columns and create another table. @param table the table @param colName the names of the columns to extract. @return A new Table with the Columns.
[ "Extract", "the", "columns", "and", "create", "another", "table", "." ]
d2b436bbdf951dc1fda56096a42dbc0eae4d35a5
https://github.com/TheHortonMachine/hortonmachine/blob/d2b436bbdf951dc1fda56096a42dbc0eae4d35a5/gears/src/main/java/oms3/io/DataIO.java#L1323-L1356
train
TheHortonMachine/hortonmachine
gears/src/main/java/oms3/util/Threads.java
Threads.par_ief
private static void par_ief(CompList<?> t, int numproc) throws Exception { if (numproc < 1) { throw new IllegalArgumentException("numproc"); } final CountDownLatch latch = new CountDownLatch(t.list().size()); // final ExecutorService e = Executors.newFixedThreadPool(numproc); ...
java
private static void par_ief(CompList<?> t, int numproc) throws Exception { if (numproc < 1) { throw new IllegalArgumentException("numproc"); } final CountDownLatch latch = new CountDownLatch(t.list().size()); // final ExecutorService e = Executors.newFixedThreadPool(numproc); ...
[ "private", "static", "void", "par_ief", "(", "CompList", "<", "?", ">", "t", ",", "int", "numproc", ")", "throws", "Exception", "{", "if", "(", "numproc", "<", "1", ")", "{", "throw", "new", "IllegalArgumentException", "(", "\"numproc\"", ")", ";", "}", ...
Runs a set of Compounds in parallel. there are always numproc + 1 threads active. @param comp @param numproc @throws java.lang.Exception
[ "Runs", "a", "set", "of", "Compounds", "in", "parallel", ".", "there", "are", "always", "numproc", "+", "1", "threads", "active", "." ]
d2b436bbdf951dc1fda56096a42dbc0eae4d35a5
https://github.com/TheHortonMachine/hortonmachine/blob/d2b436bbdf951dc1fda56096a42dbc0eae4d35a5/gears/src/main/java/oms3/util/Threads.java#L98-L122
train
TheHortonMachine/hortonmachine
gui/src/main/java/org/hortonmachine/gui/spatialtoolbox/core/ModuleDescription.java
ModuleDescription.addInput
public void addInput( String fieldName, String type, String description, String defaultValue, String uiHint ) { if (fieldName == null) { throw new IllegalArgumentException("field name is mandatory"); } if (type == null) { throw new IllegalArgumentException("field type is ...
java
public void addInput( String fieldName, String type, String description, String defaultValue, String uiHint ) { if (fieldName == null) { throw new IllegalArgumentException("field name is mandatory"); } if (type == null) { throw new IllegalArgumentException("field type is ...
[ "public", "void", "addInput", "(", "String", "fieldName", ",", "String", "type", ",", "String", "description", ",", "String", "defaultValue", ",", "String", "uiHint", ")", "{", "if", "(", "fieldName", "==", "null", ")", "{", "throw", "new", "IllegalArgumentE...
Adds an input field to the module. @param fieldName the name of the field (accessed through reflection). @param type the chanonical name of the class of the field. @param description a description of the field. @param defaultValue a default value or <code>null</code>. @param uiHint
[ "Adds", "an", "input", "field", "to", "the", "module", "." ]
d2b436bbdf951dc1fda56096a42dbc0eae4d35a5
https://github.com/TheHortonMachine/hortonmachine/blob/d2b436bbdf951dc1fda56096a42dbc0eae4d35a5/gui/src/main/java/org/hortonmachine/gui/spatialtoolbox/core/ModuleDescription.java#L118-L142
train
TheHortonMachine/hortonmachine
gui/src/main/java/org/hortonmachine/gui/spatialtoolbox/core/ModuleDescription.java
ModuleDescription.addOutput
public void addOutput( String fieldName, String type, String description, String defaultValue, String uiHint ) { if (fieldName == null) { throw new IllegalArgumentException("field name is mandatory"); } if (type == null) { throw new IllegalArgumentException("field type is...
java
public void addOutput( String fieldName, String type, String description, String defaultValue, String uiHint ) { if (fieldName == null) { throw new IllegalArgumentException("field name is mandatory"); } if (type == null) { throw new IllegalArgumentException("field type is...
[ "public", "void", "addOutput", "(", "String", "fieldName", ",", "String", "type", ",", "String", "description", ",", "String", "defaultValue", ",", "String", "uiHint", ")", "{", "if", "(", "fieldName", "==", "null", ")", "{", "throw", "new", "IllegalArgument...
Adds an output field to the module. @param fieldName the name of the field (accessed through reflection). @param type the chanonical name of the class of the field. @param description a description of the field. @param defaultValue a default value or <code>null</code>. @param uiHint
[ "Adds", "an", "output", "field", "to", "the", "module", "." ]
d2b436bbdf951dc1fda56096a42dbc0eae4d35a5
https://github.com/TheHortonMachine/hortonmachine/blob/d2b436bbdf951dc1fda56096a42dbc0eae4d35a5/gui/src/main/java/org/hortonmachine/gui/spatialtoolbox/core/ModuleDescription.java#L153-L177
train
TheHortonMachine/hortonmachine
dbs/src/main/java/org/hortonmachine/ssh/SshUtilities.java
SshUtilities.getPreference
public static String getPreference( String preferenceKey, String defaultValue ) { Preferences preferences = Preferences.userRoot().node(PREFS_NODE_NAME); String preference = preferences.get(preferenceKey, defaultValue); return preference; }
java
public static String getPreference( String preferenceKey, String defaultValue ) { Preferences preferences = Preferences.userRoot().node(PREFS_NODE_NAME); String preference = preferences.get(preferenceKey, defaultValue); return preference; }
[ "public", "static", "String", "getPreference", "(", "String", "preferenceKey", ",", "String", "defaultValue", ")", "{", "Preferences", "preferences", "=", "Preferences", ".", "userRoot", "(", ")", ".", "node", "(", "PREFS_NODE_NAME", ")", ";", "String", "prefere...
Get from preference. @param preferenceKey the preference key. @param defaultValue the default value in case of <code>null</code>. @return the string preference asked.
[ "Get", "from", "preference", "." ]
d2b436bbdf951dc1fda56096a42dbc0eae4d35a5
https://github.com/TheHortonMachine/hortonmachine/blob/d2b436bbdf951dc1fda56096a42dbc0eae4d35a5/dbs/src/main/java/org/hortonmachine/ssh/SshUtilities.java#L56-L60
train
TheHortonMachine/hortonmachine
dbs/src/main/java/org/hortonmachine/ssh/SshUtilities.java
SshUtilities.getProcessPid
public static String getProcessPid( Session session, String userName, String grep1, String grep2 ) throws JSchException, IOException { String command = "ps aux | grep \"" + grep1 + "\" | grep -v grep"; String remoteResponseStr = launchACommand(session, command); if (remoteResponseStr...
java
public static String getProcessPid( Session session, String userName, String grep1, String grep2 ) throws JSchException, IOException { String command = "ps aux | grep \"" + grep1 + "\" | grep -v grep"; String remoteResponseStr = launchACommand(session, command); if (remoteResponseStr...
[ "public", "static", "String", "getProcessPid", "(", "Session", "session", ",", "String", "userName", ",", "String", "grep1", ",", "String", "grep2", ")", "throws", "JSchException", ",", "IOException", "{", "String", "command", "=", "\"ps aux | grep \\\"\"", "+", ...
Get the pid of a process identified by a consequent grepping on a ps aux command. <P><b>THIS WORKS ONLY ON LINUX HOSTS</b></p> @param session the jsch sesssion to use. @param userName an optional username to check the process on. @param grep1 the first grep filter. @param grep2 the second grep filter, done in the jav...
[ "Get", "the", "pid", "of", "a", "process", "identified", "by", "a", "consequent", "grepping", "on", "a", "ps", "aux", "command", "." ]
d2b436bbdf951dc1fda56096a42dbc0eae4d35a5
https://github.com/TheHortonMachine/hortonmachine/blob/d2b436bbdf951dc1fda56096a42dbc0eae4d35a5/dbs/src/main/java/org/hortonmachine/ssh/SshUtilities.java#L92-L131
train
TheHortonMachine/hortonmachine
dbs/src/main/java/org/hortonmachine/ssh/SshUtilities.java
SshUtilities.killProcessByPid
public static void killProcessByPid( Session session, int pid ) throws Exception { String command = "kill -9 " + pid; String remoteResponseStr = launchACommand(session, command); if (remoteResponseStr.length() == 0) { return; } else { new Exception(remoteResponseS...
java
public static void killProcessByPid( Session session, int pid ) throws Exception { String command = "kill -9 " + pid; String remoteResponseStr = launchACommand(session, command); if (remoteResponseStr.length() == 0) { return; } else { new Exception(remoteResponseS...
[ "public", "static", "void", "killProcessByPid", "(", "Session", "session", ",", "int", "pid", ")", "throws", "Exception", "{", "String", "command", "=", "\"kill -9 \"", "+", "pid", ";", "String", "remoteResponseStr", "=", "launchACommand", "(", "session", ",", ...
Kills a process using its pid. <P><b>THIS WORKS ONLY ON LINUX HOSTS</b></p> @param session the session to use. @param pid the pid to use. @throws Exception
[ "Kills", "a", "process", "using", "its", "pid", "." ]
d2b436bbdf951dc1fda56096a42dbc0eae4d35a5
https://github.com/TheHortonMachine/hortonmachine/blob/d2b436bbdf951dc1fda56096a42dbc0eae4d35a5/dbs/src/main/java/org/hortonmachine/ssh/SshUtilities.java#L142-L151
train
TheHortonMachine/hortonmachine
dbs/src/main/java/org/hortonmachine/ssh/SshUtilities.java
SshUtilities.getRunningDockerContainerId
public static String getRunningDockerContainerId( Session session, String containerName ) throws JSchException, IOException { String command = "docker ps | grep " + containerName; String remoteResponseStr = launchACommand(session, command); if (remoteResponseStr.length() == 0) { retu...
java
public static String getRunningDockerContainerId( Session session, String containerName ) throws JSchException, IOException { String command = "docker ps | grep " + containerName; String remoteResponseStr = launchACommand(session, command); if (remoteResponseStr.length() == 0) { retu...
[ "public", "static", "String", "getRunningDockerContainerId", "(", "Session", "session", ",", "String", "containerName", ")", "throws", "JSchException", ",", "IOException", "{", "String", "command", "=", "\"docker ps | grep \"", "+", "containerName", ";", "String", "re...
Get the container id of a running docker container. @param session the session to use. @param containerName the name of the container, used in a grep filter. @return the id of the container or null. @throws JSchException @throws IOException
[ "Get", "the", "container", "id", "of", "a", "running", "docker", "container", "." ]
d2b436bbdf951dc1fda56096a42dbc0eae4d35a5
https://github.com/TheHortonMachine/hortonmachine/blob/d2b436bbdf951dc1fda56096a42dbc0eae4d35a5/dbs/src/main/java/org/hortonmachine/ssh/SshUtilities.java#L162-L185
train
TheHortonMachine/hortonmachine
dbs/src/main/java/org/hortonmachine/ssh/SshUtilities.java
SshUtilities.launchACommand
private static String launchACommand( Session session, String command ) throws JSchException, IOException { Channel channel = session.openChannel("exec"); ((ChannelExec) channel).setCommand(command); channel.setInputStream(null); ((ChannelExec) channel).setErrStream(System.err); ...
java
private static String launchACommand( Session session, String command ) throws JSchException, IOException { Channel channel = session.openChannel("exec"); ((ChannelExec) channel).setCommand(command); channel.setInputStream(null); ((ChannelExec) channel).setErrStream(System.err); ...
[ "private", "static", "String", "launchACommand", "(", "Session", "session", ",", "String", "command", ")", "throws", "JSchException", ",", "IOException", "{", "Channel", "channel", "=", "session", ".", "openChannel", "(", "\"exec\"", ")", ";", "(", "(", "Chann...
Launch a command on the remote host and exit once the command is done. @param session the session to use. @param command the command to launch. @return the output of the command. @throws JSchException @throws IOException
[ "Launch", "a", "command", "on", "the", "remote", "host", "and", "exit", "once", "the", "command", "is", "done", "." ]
d2b436bbdf951dc1fda56096a42dbc0eae4d35a5
https://github.com/TheHortonMachine/hortonmachine/blob/d2b436bbdf951dc1fda56096a42dbc0eae4d35a5/dbs/src/main/java/org/hortonmachine/ssh/SshUtilities.java#L196-L226
train
TheHortonMachine/hortonmachine
dbs/src/main/java/org/hortonmachine/ssh/SshUtilities.java
SshUtilities.runShellCommand
public static String runShellCommand( Session session, String command ) throws JSchException, IOException { String remoteResponseStr = launchACommand(session, command); return remoteResponseStr; }
java
public static String runShellCommand( Session session, String command ) throws JSchException, IOException { String remoteResponseStr = launchACommand(session, command); return remoteResponseStr; }
[ "public", "static", "String", "runShellCommand", "(", "Session", "session", ",", "String", "command", ")", "throws", "JSchException", ",", "IOException", "{", "String", "remoteResponseStr", "=", "launchACommand", "(", "session", ",", "command", ")", ";", "return",...
Launch a shell command. @param session the session to use. @param command the command to launch. @return the output of the command. @throws JSchException @throws IOException
[ "Launch", "a", "shell", "command", "." ]
d2b436bbdf951dc1fda56096a42dbc0eae4d35a5
https://github.com/TheHortonMachine/hortonmachine/blob/d2b436bbdf951dc1fda56096a42dbc0eae4d35a5/dbs/src/main/java/org/hortonmachine/ssh/SshUtilities.java#L280-L283
train
TheHortonMachine/hortonmachine
dbs/src/main/java/org/hortonmachine/ssh/SshUtilities.java
SshUtilities.runDemonShellCommand
public static String runDemonShellCommand( Session session, String command ) throws JSchException, IOException { String remoteResponseStr = launchACommandAndExit(session, command); return remoteResponseStr; }
java
public static String runDemonShellCommand( Session session, String command ) throws JSchException, IOException { String remoteResponseStr = launchACommandAndExit(session, command); return remoteResponseStr; }
[ "public", "static", "String", "runDemonShellCommand", "(", "Session", "session", ",", "String", "command", ")", "throws", "JSchException", ",", "IOException", "{", "String", "remoteResponseStr", "=", "launchACommandAndExit", "(", "session", ",", "command", ")", ";",...
Run a daemon command or commands that do not exit quickly. @param session the session to use. @param command the command to launch. @return the output of the command. @throws JSchException @throws IOException
[ "Run", "a", "daemon", "command", "or", "commands", "that", "do", "not", "exit", "quickly", "." ]
d2b436bbdf951dc1fda56096a42dbc0eae4d35a5
https://github.com/TheHortonMachine/hortonmachine/blob/d2b436bbdf951dc1fda56096a42dbc0eae4d35a5/dbs/src/main/java/org/hortonmachine/ssh/SshUtilities.java#L294-L297
train
TheHortonMachine/hortonmachine
dbs/src/main/java/org/hortonmachine/ssh/SshUtilities.java
SshUtilities.downloadFile
public static void downloadFile( Session session, String remoteFilePath, String localFilePath ) throws Exception { // exec 'scp -f rfile' remotely String command = "scp -f " + remoteFilePath; Channel channel = session.openChannel("exec"); ((ChannelExec) channel).setCommand(command); ...
java
public static void downloadFile( Session session, String remoteFilePath, String localFilePath ) throws Exception { // exec 'scp -f rfile' remotely String command = "scp -f " + remoteFilePath; Channel channel = session.openChannel("exec"); ((ChannelExec) channel).setCommand(command); ...
[ "public", "static", "void", "downloadFile", "(", "Session", "session", ",", "String", "remoteFilePath", ",", "String", "localFilePath", ")", "throws", "Exception", "{", "// exec 'scp -f rfile' remotely", "String", "command", "=", "\"scp -f \"", "+", "remoteFilePath", ...
Download a remote file via scp. @param session the session to use. @param remoteFilePath the remote file path. @param localFilePath the local file path to copy into. @throws Exception
[ "Download", "a", "remote", "file", "via", "scp", "." ]
d2b436bbdf951dc1fda56096a42dbc0eae4d35a5
https://github.com/TheHortonMachine/hortonmachine/blob/d2b436bbdf951dc1fda56096a42dbc0eae4d35a5/dbs/src/main/java/org/hortonmachine/ssh/SshUtilities.java#L307-L392
train