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/oms3/Controller.java | Controller.mapIn | void mapIn(String in, Object comp, String comp_in) {
if (comp == ca.getComponent()) {
throw new ComponentException("cannot connect 'In' with itself for " + in);
}
ComponentAccess ac_dest = lookup(comp);
FieldAccess destAccess = (FieldAccess) ac_dest.input(comp_in);
ch... | java | void mapIn(String in, Object comp, String comp_in) {
if (comp == ca.getComponent()) {
throw new ComponentException("cannot connect 'In' with itself for " + in);
}
ComponentAccess ac_dest = lookup(comp);
FieldAccess destAccess = (FieldAccess) ac_dest.input(comp_in);
ch... | [
"void",
"mapIn",
"(",
"String",
"in",
",",
"Object",
"comp",
",",
"String",
"comp_in",
")",
"{",
"if",
"(",
"comp",
"==",
"ca",
".",
"getComponent",
"(",
")",
")",
"{",
"throw",
"new",
"ComponentException",
"(",
"\"cannot connect 'In' with itself for \"",
"+... | Map two input fields.
@param in
@param comp
@param comp_in | [
"Map",
"two",
"input",
"fields",
"."
] | d2b436bbdf951dc1fda56096a42dbc0eae4d35a5 | https://github.com/TheHortonMachine/hortonmachine/blob/d2b436bbdf951dc1fda56096a42dbc0eae4d35a5/gears/src/main/java/oms3/Controller.java#L114-L134 | train |
TheHortonMachine/hortonmachine | gears/src/main/java/oms3/Controller.java | Controller.mapInVal | void mapInVal(Object val, Object to, String to_in) {
if (val == null) {
throw new ComponentException("Null value for " + name(to, to_in));
}
if (to == ca.getComponent()) {
throw new ComponentException("field and component ar ethe same for mapping :" + to_in);
}
... | java | void mapInVal(Object val, Object to, String to_in) {
if (val == null) {
throw new ComponentException("Null value for " + name(to, to_in));
}
if (to == ca.getComponent()) {
throw new ComponentException("field and component ar ethe same for mapping :" + to_in);
}
... | [
"void",
"mapInVal",
"(",
"Object",
"val",
",",
"Object",
"to",
",",
"String",
"to_in",
")",
"{",
"if",
"(",
"val",
"==",
"null",
")",
"{",
"throw",
"new",
"ComponentException",
"(",
"\"Null value for \"",
"+",
"name",
"(",
"to",
",",
"to_in",
")",
")",... | Directly map a value to a input field.
@param val
@param to
@param to_in | [
"Directly",
"map",
"a",
"value",
"to",
"a",
"input",
"field",
"."
] | d2b436bbdf951dc1fda56096a42dbc0eae4d35a5 | https://github.com/TheHortonMachine/hortonmachine/blob/d2b436bbdf951dc1fda56096a42dbc0eae4d35a5/gears/src/main/java/oms3/Controller.java#L142-L156 | train |
TheHortonMachine/hortonmachine | gears/src/main/java/oms3/Controller.java | Controller.mapInField | void mapInField(Object from, String from_field, Object to, String to_in) {
if (to == ca.getComponent()) {
throw new ComponentException("wrong connect:" + from_field);
}
ComponentAccess ca_to = lookup(to);
Access to_access = ca_to.input(to_in);
checkFA(to_access, to, t... | java | void mapInField(Object from, String from_field, Object to, String to_in) {
if (to == ca.getComponent()) {
throw new ComponentException("wrong connect:" + from_field);
}
ComponentAccess ca_to = lookup(to);
Access to_access = ca_to.input(to_in);
checkFA(to_access, to, t... | [
"void",
"mapInField",
"(",
"Object",
"from",
",",
"String",
"from_field",
",",
"Object",
"to",
",",
"String",
"to_in",
")",
"{",
"if",
"(",
"to",
"==",
"ca",
".",
"getComponent",
"(",
")",
")",
"{",
"throw",
"new",
"ComponentException",
"(",
"\"wrong con... | Map an input field.
@param from
@param from_field
@param to
@param to_in | [
"Map",
"an",
"input",
"field",
"."
] | d2b436bbdf951dc1fda56096a42dbc0eae4d35a5 | https://github.com/TheHortonMachine/hortonmachine/blob/d2b436bbdf951dc1fda56096a42dbc0eae4d35a5/gears/src/main/java/oms3/Controller.java#L165-L182 | train |
TheHortonMachine/hortonmachine | gears/src/main/java/oms3/Controller.java | Controller.mapOutField | void mapOutField(Object from, String from_out, Object to, String to_field) {
if (from == ca.getComponent()) {
throw new ComponentException("wrong connect:" + to_field);
}
ComponentAccess ca_from = lookup(from);
Access from_access = ca_from.output(from_out);
checkFA(fr... | java | void mapOutField(Object from, String from_out, Object to, String to_field) {
if (from == ca.getComponent()) {
throw new ComponentException("wrong connect:" + to_field);
}
ComponentAccess ca_from = lookup(from);
Access from_access = ca_from.output(from_out);
checkFA(fr... | [
"void",
"mapOutField",
"(",
"Object",
"from",
",",
"String",
"from_out",
",",
"Object",
"to",
",",
"String",
"to_field",
")",
"{",
"if",
"(",
"from",
"==",
"ca",
".",
"getComponent",
"(",
")",
")",
"{",
"throw",
"new",
"ComponentException",
"(",
"\"wrong... | Map a object to an output field.
@param from
@param from_out
@param to
@param to_field | [
"Map",
"a",
"object",
"to",
"an",
"output",
"field",
"."
] | d2b436bbdf951dc1fda56096a42dbc0eae4d35a5 | https://github.com/TheHortonMachine/hortonmachine/blob/d2b436bbdf951dc1fda56096a42dbc0eae4d35a5/gears/src/main/java/oms3/Controller.java#L191-L209 | train |
TheHortonMachine/hortonmachine | gears/src/main/java/oms3/Controller.java | Controller.connect | void connect(Object from, String from_out, Object to, String to_in) {
// add them to the set of commands
if (from == to) {
throw new ComponentException("src == dest.");
}
if (to_in == null || from_out == null) {
throw new ComponentException("Some field arguments a... | java | void connect(Object from, String from_out, Object to, String to_in) {
// add them to the set of commands
if (from == to) {
throw new ComponentException("src == dest.");
}
if (to_in == null || from_out == null) {
throw new ComponentException("Some field arguments a... | [
"void",
"connect",
"(",
"Object",
"from",
",",
"String",
"from_out",
",",
"Object",
"to",
",",
"String",
"to_in",
")",
"{",
"// add them to the set of commands",
"if",
"(",
"from",
"==",
"to",
")",
"{",
"throw",
"new",
"ComponentException",
"(",
"\"src == dest... | Connect out to in
@param from
@param from_out
@param to
@param to_in | [
"Connect",
"out",
"to",
"in"
] | d2b436bbdf951dc1fda56096a42dbc0eae4d35a5 | https://github.com/TheHortonMachine/hortonmachine/blob/d2b436bbdf951dc1fda56096a42dbc0eae4d35a5/gears/src/main/java/oms3/Controller.java#L218-L257 | train |
TheHortonMachine/hortonmachine | gears/src/main/java/oms3/Controller.java | Controller.feedback | void feedback(Object from, String from_out, Object to, String to_in) {
// add them to the set of commands
if (from == to) {
throw new ComponentException("src == dest.");
}
if (to_in == null || from_out == null) {
throw new ComponentException("Some field arguments ... | java | void feedback(Object from, String from_out, Object to, String to_in) {
// add them to the set of commands
if (from == to) {
throw new ComponentException("src == dest.");
}
if (to_in == null || from_out == null) {
throw new ComponentException("Some field arguments ... | [
"void",
"feedback",
"(",
"Object",
"from",
",",
"String",
"from_out",
",",
"Object",
"to",
",",
"String",
"to_in",
")",
"{",
"// add them to the set of commands",
"if",
"(",
"from",
"==",
"to",
")",
"{",
"throw",
"new",
"ComponentException",
"(",
"\"src == des... | Feedback connect out to in
@param from
@param from_out
@param to
@param to_in | [
"Feedback",
"connect",
"out",
"to",
"in"
] | d2b436bbdf951dc1fda56096a42dbc0eae4d35a5 | https://github.com/TheHortonMachine/hortonmachine/blob/d2b436bbdf951dc1fda56096a42dbc0eae4d35a5/gears/src/main/java/oms3/Controller.java#L266-L307 | train |
TheHortonMachine/hortonmachine | gears/src/main/java/oms3/Controller.java | Controller.callAnnotated | void callAnnotated(Class<? extends Annotation> ann, boolean lazy) {
for (ComponentAccess p : oMap.values()) {
p.callAnnotatedMethod(ann, lazy);
}
} | java | void callAnnotated(Class<? extends Annotation> ann, boolean lazy) {
for (ComponentAccess p : oMap.values()) {
p.callAnnotatedMethod(ann, lazy);
}
} | [
"void",
"callAnnotated",
"(",
"Class",
"<",
"?",
"extends",
"Annotation",
">",
"ann",
",",
"boolean",
"lazy",
")",
"{",
"for",
"(",
"ComponentAccess",
"p",
":",
"oMap",
".",
"values",
"(",
")",
")",
"{",
"p",
".",
"callAnnotatedMethod",
"(",
"ann",
","... | Call an annotated method.
@param ann | [
"Call",
"an",
"annotated",
"method",
"."
] | d2b436bbdf951dc1fda56096a42dbc0eae4d35a5 | https://github.com/TheHortonMachine/hortonmachine/blob/d2b436bbdf951dc1fda56096a42dbc0eae4d35a5/gears/src/main/java/oms3/Controller.java#L484-L488 | train |
TheHortonMachine/hortonmachine | gears/src/main/java/org/hortonmachine/gears/utils/math/interpolation/splines/ControlCurve.java | ControlCurve.addPoint | public double addPoint( double x, double y ) {
pts.add(new Coordinate(x, y));
return selection = pts.size() - 1;
} | java | public double addPoint( double x, double y ) {
pts.add(new Coordinate(x, y));
return selection = pts.size() - 1;
} | [
"public",
"double",
"addPoint",
"(",
"double",
"x",
",",
"double",
"y",
")",
"{",
"pts",
".",
"add",
"(",
"new",
"Coordinate",
"(",
"x",
",",
"y",
")",
")",
";",
"return",
"selection",
"=",
"pts",
".",
"size",
"(",
")",
"-",
"1",
";",
"}"
] | add a control point, return index of new control point | [
"add",
"a",
"control",
"point",
"return",
"index",
"of",
"new",
"control",
"point"
] | d2b436bbdf951dc1fda56096a42dbc0eae4d35a5 | https://github.com/TheHortonMachine/hortonmachine/blob/d2b436bbdf951dc1fda56096a42dbc0eae4d35a5/gears/src/main/java/org/hortonmachine/gears/utils/math/interpolation/splines/ControlCurve.java#L64-L67 | train |
TheHortonMachine/hortonmachine | gears/src/main/java/org/hortonmachine/gears/utils/math/interpolation/splines/ControlCurve.java | ControlCurve.setPoint | public void setPoint( double x, double y ) {
if (selection >= 0) {
Coordinate coordinate = new Coordinate(x, y);
pts.set(selection, coordinate);
}
} | java | public void setPoint( double x, double y ) {
if (selection >= 0) {
Coordinate coordinate = new Coordinate(x, y);
pts.set(selection, coordinate);
}
} | [
"public",
"void",
"setPoint",
"(",
"double",
"x",
",",
"double",
"y",
")",
"{",
"if",
"(",
"selection",
">=",
"0",
")",
"{",
"Coordinate",
"coordinate",
"=",
"new",
"Coordinate",
"(",
"x",
",",
"y",
")",
";",
"pts",
".",
"set",
"(",
"selection",
",... | set selected control point | [
"set",
"selected",
"control",
"point"
] | d2b436bbdf951dc1fda56096a42dbc0eae4d35a5 | https://github.com/TheHortonMachine/hortonmachine/blob/d2b436bbdf951dc1fda56096a42dbc0eae4d35a5/gears/src/main/java/org/hortonmachine/gears/utils/math/interpolation/splines/ControlCurve.java#L70-L75 | train |
TheHortonMachine/hortonmachine | hmachine/src/main/java/org/hortonmachine/hmachine/utils/oms/CLI.java | CLI.sim | public static Object sim( String file, String ll, String cmd ) throws Exception {
String f = CLI.readFile(file);
Object o = CLI.createSim(f, false, ll);
return CLI.invoke(o, cmd);
} | java | public static Object sim( String file, String ll, String cmd ) throws Exception {
String f = CLI.readFile(file);
Object o = CLI.createSim(f, false, ll);
return CLI.invoke(o, cmd);
} | [
"public",
"static",
"Object",
"sim",
"(",
"String",
"file",
",",
"String",
"ll",
",",
"String",
"cmd",
")",
"throws",
"Exception",
"{",
"String",
"f",
"=",
"CLI",
".",
"readFile",
"(",
"file",
")",
";",
"Object",
"o",
"=",
"CLI",
".",
"createSim",
"(... | Executes a simulation.
@param file the file to execute
@param ll the log level
@param cmd the command to call (e.g. run)
@throws Exception | [
"Executes",
"a",
"simulation",
"."
] | d2b436bbdf951dc1fda56096a42dbc0eae4d35a5 | https://github.com/TheHortonMachine/hortonmachine/blob/d2b436bbdf951dc1fda56096a42dbc0eae4d35a5/hmachine/src/main/java/org/hortonmachine/hmachine/utils/oms/CLI.java#L52-L56 | train |
TheHortonMachine/hortonmachine | hmachine/src/main/java/org/hortonmachine/hmachine/utils/oms/CLI.java | CLI.groovy | public static void groovy( String file, String ll, String cmd ) throws Exception {
String f = CLI.readFile(file);
Object o = CLI.createSim(f, true, ll);
} | java | public static void groovy( String file, String ll, String cmd ) throws Exception {
String f = CLI.readFile(file);
Object o = CLI.createSim(f, true, ll);
} | [
"public",
"static",
"void",
"groovy",
"(",
"String",
"file",
",",
"String",
"ll",
",",
"String",
"cmd",
")",
"throws",
"Exception",
"{",
"String",
"f",
"=",
"CLI",
".",
"readFile",
"(",
"file",
")",
";",
"Object",
"o",
"=",
"CLI",
".",
"createSim",
"... | Executed plain groovy.
@param file the groovy file
@param ll the log level.
@param cmd
@throws Exception | [
"Executed",
"plain",
"groovy",
"."
] | d2b436bbdf951dc1fda56096a42dbc0eae4d35a5 | https://github.com/TheHortonMachine/hortonmachine/blob/d2b436bbdf951dc1fda56096a42dbc0eae4d35a5/hmachine/src/main/java/org/hortonmachine/hmachine/utils/oms/CLI.java#L66-L69 | train |
TheHortonMachine/hortonmachine | hmachine/src/main/java/org/hortonmachine/hmachine/utils/oms/CLI.java | CLI.readFile | public static String readFile( String name ) throws IOException {
StringBuilder b = new StringBuilder();
BufferedReader r = new BufferedReader(new FileReader(name));
String line;
while( (line = r.readLine()) != null ) {
b.append(line).append('\n');
}
r.close()... | java | public static String readFile( String name ) throws IOException {
StringBuilder b = new StringBuilder();
BufferedReader r = new BufferedReader(new FileReader(name));
String line;
while( (line = r.readLine()) != null ) {
b.append(line).append('\n');
}
r.close()... | [
"public",
"static",
"String",
"readFile",
"(",
"String",
"name",
")",
"throws",
"IOException",
"{",
"StringBuilder",
"b",
"=",
"new",
"StringBuilder",
"(",
")",
";",
"BufferedReader",
"r",
"=",
"new",
"BufferedReader",
"(",
"new",
"FileReader",
"(",
"name",
... | Read a file and provide its content as String.
@param name the file name
@return the content as String
@throws IOException something bad happened. | [
"Read",
"a",
"file",
"and",
"provide",
"its",
"content",
"as",
"String",
"."
] | d2b436bbdf951dc1fda56096a42dbc0eae4d35a5 | https://github.com/TheHortonMachine/hortonmachine/blob/d2b436bbdf951dc1fda56096a42dbc0eae4d35a5/hmachine/src/main/java/org/hortonmachine/hmachine/utils/oms/CLI.java#L89-L98 | train |
TheHortonMachine/hortonmachine | hmachine/src/main/java/org/hortonmachine/hmachine/utils/oms/CLI.java | CLI.createSim | public static Object createSim( String script, boolean groovy, String ll ) throws Exception {
setOMSProperties();
Level.parse(ll); // may throw IAE
String prefix = groovy ? "" : "import static oms3.SimConst.*\n" + "def __sb__ = new oms3.SimBuilder(logging:'" + ll
+ "')\n" + "__sb... | java | public static Object createSim( String script, boolean groovy, String ll ) throws Exception {
setOMSProperties();
Level.parse(ll); // may throw IAE
String prefix = groovy ? "" : "import static oms3.SimConst.*\n" + "def __sb__ = new oms3.SimBuilder(logging:'" + ll
+ "')\n" + "__sb... | [
"public",
"static",
"Object",
"createSim",
"(",
"String",
"script",
",",
"boolean",
"groovy",
",",
"String",
"ll",
")",
"throws",
"Exception",
"{",
"setOMSProperties",
"(",
")",
";",
"Level",
".",
"parse",
"(",
"ll",
")",
";",
"// may throw IAE",
"String",
... | Create a simulation object.
@param script the script
@param groovy
@param ll
@return the simulation object. | [
"Create",
"a",
"simulation",
"object",
"."
] | d2b436bbdf951dc1fda56096a42dbc0eae4d35a5 | https://github.com/TheHortonMachine/hortonmachine/blob/d2b436bbdf951dc1fda56096a42dbc0eae4d35a5/hmachine/src/main/java/org/hortonmachine/hmachine/utils/oms/CLI.java#L108-L121 | train |
TheHortonMachine/hortonmachine | gears/src/main/java/oms3/dsl/BeanBuilder.java | BeanBuilder.getPropertyTypeValue | private Object getPropertyTypeValue(Class propertyType, Object value) {
if (propertyType.equals(String.class)) {
return value.toString();
} else if (propertyType.equals(Boolean.class) || propertyType.equals(Boolean.TYPE)) {
Boolean arg = null;
if (value instanceof Boo... | java | private Object getPropertyTypeValue(Class propertyType, Object value) {
if (propertyType.equals(String.class)) {
return value.toString();
} else if (propertyType.equals(Boolean.class) || propertyType.equals(Boolean.TYPE)) {
Boolean arg = null;
if (value instanceof Boo... | [
"private",
"Object",
"getPropertyTypeValue",
"(",
"Class",
"propertyType",
",",
"Object",
"value",
")",
"{",
"if",
"(",
"propertyType",
".",
"equals",
"(",
"String",
".",
"class",
")",
")",
"{",
"return",
"value",
".",
"toString",
"(",
")",
";",
"}",
"el... | converts ths incoming value to an object for the property type. | [
"converts",
"ths",
"incoming",
"value",
"to",
"an",
"object",
"for",
"the",
"property",
"type",
"."
] | d2b436bbdf951dc1fda56096a42dbc0eae4d35a5 | https://github.com/TheHortonMachine/hortonmachine/blob/d2b436bbdf951dc1fda56096a42dbc0eae4d35a5/gears/src/main/java/oms3/dsl/BeanBuilder.java#L115-L169 | train |
TheHortonMachine/hortonmachine | gears/src/main/java/org/hortonmachine/gears/utils/StreamUtils.java | StreamUtils.toMap | public static <T, K, V> Map<K, V> toMap( Stream<T> stream, Function<T, K> keySupplier, Function<T, V> valueSupplier ) {
return stream.collect(Collectors.toMap(keySupplier, valueSupplier));
} | java | public static <T, K, V> Map<K, V> toMap( Stream<T> stream, Function<T, K> keySupplier, Function<T, V> valueSupplier ) {
return stream.collect(Collectors.toMap(keySupplier, valueSupplier));
} | [
"public",
"static",
"<",
"T",
",",
"K",
",",
"V",
">",
"Map",
"<",
"K",
",",
"V",
">",
"toMap",
"(",
"Stream",
"<",
"T",
">",
"stream",
",",
"Function",
"<",
"T",
",",
"K",
">",
"keySupplier",
",",
"Function",
"<",
"T",
",",
"V",
">",
"valueS... | Collect stream to map.
@param stream the stream to convert.
@param keySupplier the supplier for the key, ex. Object::getId()
@param valueSupplier the value supplier, ex. Object::getValue()
@return the map. | [
"Collect",
"stream",
"to",
"map",
"."
] | d2b436bbdf951dc1fda56096a42dbc0eae4d35a5 | https://github.com/TheHortonMachine/hortonmachine/blob/d2b436bbdf951dc1fda56096a42dbc0eae4d35a5/gears/src/main/java/org/hortonmachine/gears/utils/StreamUtils.java#L149-L151 | train |
TheHortonMachine/hortonmachine | gears/src/main/java/org/hortonmachine/gears/utils/StreamUtils.java | StreamUtils.toMapGroupBy | public static <T, K, R> Map<R, List<T>> toMapGroupBy( Stream<T> stream, Function<T, R> groupingFunction ) {
return stream.collect(Collectors.groupingBy(groupingFunction));
// to get a set: Collectors.groupingBy(groupingFunction, Collectors.toSet())
} | java | public static <T, K, R> Map<R, List<T>> toMapGroupBy( Stream<T> stream, Function<T, R> groupingFunction ) {
return stream.collect(Collectors.groupingBy(groupingFunction));
// to get a set: Collectors.groupingBy(groupingFunction, Collectors.toSet())
} | [
"public",
"static",
"<",
"T",
",",
"K",
",",
"R",
">",
"Map",
"<",
"R",
",",
"List",
"<",
"T",
">",
">",
"toMapGroupBy",
"(",
"Stream",
"<",
"T",
">",
"stream",
",",
"Function",
"<",
"T",
",",
"R",
">",
"groupingFunction",
")",
"{",
"return",
"... | Collect a map by grouping based on the object's field.
@param stream the stream to collect.
@param groupingFunction the function supplying the grouping field, ex. Object::getField()
@return the map of lists. | [
"Collect",
"a",
"map",
"by",
"grouping",
"based",
"on",
"the",
"object",
"s",
"field",
"."
] | d2b436bbdf951dc1fda56096a42dbc0eae4d35a5 | https://github.com/TheHortonMachine/hortonmachine/blob/d2b436bbdf951dc1fda56096a42dbc0eae4d35a5/gears/src/main/java/org/hortonmachine/gears/utils/StreamUtils.java#L164-L167 | train |
TheHortonMachine/hortonmachine | gears/src/main/java/org/hortonmachine/gears/utils/StreamUtils.java | StreamUtils.toMapPartition | public static <T> Map<Boolean, List<T>> toMapPartition( Stream<T> stream, Predicate<T> predicate ) {
return stream.collect(Collectors.partitioningBy(predicate));
} | java | public static <T> Map<Boolean, List<T>> toMapPartition( Stream<T> stream, Predicate<T> predicate ) {
return stream.collect(Collectors.partitioningBy(predicate));
} | [
"public",
"static",
"<",
"T",
">",
"Map",
"<",
"Boolean",
",",
"List",
"<",
"T",
">",
">",
"toMapPartition",
"(",
"Stream",
"<",
"T",
">",
"stream",
",",
"Predicate",
"<",
"T",
">",
"predicate",
")",
"{",
"return",
"stream",
".",
"collect",
"(",
"C... | Split a stream into a map with true and false.
@param stream the stream to collect.
@param predicate the predicate to use to define true or false, ex. e->e.getValue().equals("test")
@return the map of lists. | [
"Split",
"a",
"stream",
"into",
"a",
"map",
"with",
"true",
"and",
"false",
"."
] | d2b436bbdf951dc1fda56096a42dbc0eae4d35a5 | https://github.com/TheHortonMachine/hortonmachine/blob/d2b436bbdf951dc1fda56096a42dbc0eae4d35a5/gears/src/main/java/org/hortonmachine/gears/utils/StreamUtils.java#L176-L178 | train |
TheHortonMachine/hortonmachine | gears/src/main/java/org/hortonmachine/gears/utils/StreamUtils.java | StreamUtils.findAny | public static <T> T findAny( Stream<T> stream, Predicate<T> predicate ) {
Optional<T> element = stream.filter(predicate).findAny();
return element.orElse(null);
} | java | public static <T> T findAny( Stream<T> stream, Predicate<T> predicate ) {
Optional<T> element = stream.filter(predicate).findAny();
return element.orElse(null);
} | [
"public",
"static",
"<",
"T",
">",
"T",
"findAny",
"(",
"Stream",
"<",
"T",
">",
"stream",
",",
"Predicate",
"<",
"T",
">",
"predicate",
")",
"{",
"Optional",
"<",
"T",
">",
"element",
"=",
"stream",
".",
"filter",
"(",
"predicate",
")",
".",
"find... | Find an element in the stream.
@param stream the stream to check. This should be parallel.
@param predicate the predicate to use.
@return the element or null. | [
"Find",
"an",
"element",
"in",
"the",
"stream",
"."
] | d2b436bbdf951dc1fda56096a42dbc0eae4d35a5 | https://github.com/TheHortonMachine/hortonmachine/blob/d2b436bbdf951dc1fda56096a42dbc0eae4d35a5/gears/src/main/java/org/hortonmachine/gears/utils/StreamUtils.java#L197-L200 | train |
TheHortonMachine/hortonmachine | dbs/src/main/java/org/hortonmachine/dbs/compat/ASpatialDb.java | ASpatialDb.createSpatialTable | public void createSpatialTable( String tableName, int tableSrid, String geometryFieldData, String[] fieldData )
throws Exception {
createSpatialTable(tableName, tableSrid, geometryFieldData, fieldData, null, false);
} | java | public void createSpatialTable( String tableName, int tableSrid, String geometryFieldData, String[] fieldData )
throws Exception {
createSpatialTable(tableName, tableSrid, geometryFieldData, fieldData, null, false);
} | [
"public",
"void",
"createSpatialTable",
"(",
"String",
"tableName",
",",
"int",
"tableSrid",
",",
"String",
"geometryFieldData",
",",
"String",
"[",
"]",
"fieldData",
")",
"throws",
"Exception",
"{",
"createSpatialTable",
"(",
"tableName",
",",
"tableSrid",
",",
... | Creates a spatial table with default values for foreign keys and index.
@param tableName
the table name.
@param tableSrid the table's epsg code.
@param geometryFieldData the data for the geometry column, ex. the_geom MULTIPOLYGON
@param fieldData
the data for each the field (ex. id INTEGER NOT NULL PRIMARY
KEY).
@thro... | [
"Creates",
"a",
"spatial",
"table",
"with",
"default",
"values",
"for",
"foreign",
"keys",
"and",
"index",
"."
] | d2b436bbdf951dc1fda56096a42dbc0eae4d35a5 | https://github.com/TheHortonMachine/hortonmachine/blob/d2b436bbdf951dc1fda56096a42dbc0eae4d35a5/dbs/src/main/java/org/hortonmachine/dbs/compat/ASpatialDb.java#L86-L89 | train |
TheHortonMachine/hortonmachine | dbs/src/main/java/org/hortonmachine/dbs/compat/ASpatialDb.java | ASpatialDb.createSpatialIndex | public void createSpatialIndex( String tableName, String geomColumnName ) throws Exception {
if (geomColumnName == null) {
geomColumnName = "the_geom";
}
String realColumnName = getProperColumnNameCase(tableName, geomColumnName);
String realTableName = getProperTableNameCase(... | java | public void createSpatialIndex( String tableName, String geomColumnName ) throws Exception {
if (geomColumnName == null) {
geomColumnName = "the_geom";
}
String realColumnName = getProperColumnNameCase(tableName, geomColumnName);
String realTableName = getProperTableNameCase(... | [
"public",
"void",
"createSpatialIndex",
"(",
"String",
"tableName",
",",
"String",
"geomColumnName",
")",
"throws",
"Exception",
"{",
"if",
"(",
"geomColumnName",
"==",
"null",
")",
"{",
"geomColumnName",
"=",
"\"the_geom\"",
";",
"}",
"String",
"realColumnName",
... | Create a spatial index.
@param tableName the table name.
@param geomColumnName the geometry column name.
@throws Exception | [
"Create",
"a",
"spatial",
"index",
"."
] | d2b436bbdf951dc1fda56096a42dbc0eae4d35a5 | https://github.com/TheHortonMachine/hortonmachine/blob/d2b436bbdf951dc1fda56096a42dbc0eae4d35a5/dbs/src/main/java/org/hortonmachine/dbs/compat/ASpatialDb.java#L165-L180 | train |
TheHortonMachine/hortonmachine | dbs/src/main/java/org/hortonmachine/dbs/compat/ASpatialDb.java | ASpatialDb.insertGeometry | public void insertGeometry( String tableName, Geometry geometry, String epsg ) throws Exception {
String epsgStr = "4326";
if (epsg == null) {
epsgStr = epsg;
}
GeometryColumn gc = getGeometryColumnsForTable(tableName);
String sql = "INSERT INTO " + tableName + " (" ... | java | public void insertGeometry( String tableName, Geometry geometry, String epsg ) throws Exception {
String epsgStr = "4326";
if (epsg == null) {
epsgStr = epsg;
}
GeometryColumn gc = getGeometryColumnsForTable(tableName);
String sql = "INSERT INTO " + tableName + " (" ... | [
"public",
"void",
"insertGeometry",
"(",
"String",
"tableName",
",",
"Geometry",
"geometry",
",",
"String",
"epsg",
")",
"throws",
"Exception",
"{",
"String",
"epsgStr",
"=",
"\"4326\"",
";",
"if",
"(",
"epsg",
"==",
"null",
")",
"{",
"epsgStr",
"=",
"epsg... | Insert a geometry into a table.
@param tableName
the table to use.
@param geometry
the geometry to insert.
@param epsg
the optional epsg.
@throws Exception | [
"Insert",
"a",
"geometry",
"into",
"a",
"table",
"."
] | d2b436bbdf951dc1fda56096a42dbc0eae4d35a5 | https://github.com/TheHortonMachine/hortonmachine/blob/d2b436bbdf951dc1fda56096a42dbc0eae4d35a5/dbs/src/main/java/org/hortonmachine/dbs/compat/ASpatialDb.java#L193-L210 | train |
TheHortonMachine/hortonmachine | dbs/src/main/java/org/hortonmachine/dbs/compat/ASpatialDb.java | ASpatialDb.isTableSpatial | public boolean isTableSpatial( String tableName ) throws Exception {
GeometryColumn geometryColumns = getGeometryColumnsForTable(tableName);
return geometryColumns != null;
} | java | public boolean isTableSpatial( String tableName ) throws Exception {
GeometryColumn geometryColumns = getGeometryColumnsForTable(tableName);
return geometryColumns != null;
} | [
"public",
"boolean",
"isTableSpatial",
"(",
"String",
"tableName",
")",
"throws",
"Exception",
"{",
"GeometryColumn",
"geometryColumns",
"=",
"getGeometryColumnsForTable",
"(",
"tableName",
")",
";",
"return",
"geometryColumns",
"!=",
"null",
";",
"}"
] | Checks if a table is spatial.
@param tableName
the table to check.
@return <code>true</code> if a geometry column is present.
@throws Exception | [
"Checks",
"if",
"a",
"table",
"is",
"spatial",
"."
] | d2b436bbdf951dc1fda56096a42dbc0eae4d35a5 | https://github.com/TheHortonMachine/hortonmachine/blob/d2b436bbdf951dc1fda56096a42dbc0eae4d35a5/dbs/src/main/java/org/hortonmachine/dbs/compat/ASpatialDb.java#L220-L223 | train |
TheHortonMachine/hortonmachine | dbs/src/main/java/org/hortonmachine/dbs/compat/ASpatialDb.java | ASpatialDb.getGeometriesIn | public List<Geometry> getGeometriesIn( String tableName, Envelope envelope, String... prePostWhere ) throws Exception {
List<Geometry> geoms = new ArrayList<Geometry>();
List<String> wheres = new ArrayList<>();
String pre = "";
String post = "";
String where = "";
if (pre... | java | public List<Geometry> getGeometriesIn( String tableName, Envelope envelope, String... prePostWhere ) throws Exception {
List<Geometry> geoms = new ArrayList<Geometry>();
List<String> wheres = new ArrayList<>();
String pre = "";
String post = "";
String where = "";
if (pre... | [
"public",
"List",
"<",
"Geometry",
">",
"getGeometriesIn",
"(",
"String",
"tableName",
",",
"Envelope",
"envelope",
",",
"String",
"...",
"prePostWhere",
")",
"throws",
"Exception",
"{",
"List",
"<",
"Geometry",
">",
"geoms",
"=",
"new",
"ArrayList",
"<",
"G... | Get the geometries of a table inside a given envelope.
@param tableName
the table name.
@param envelope
the envelope to check.
@param prePostWhere an optional set of 3 parameters. The parameters are: a
prefix wrapper for geom, a postfix for the same and a where string
to apply. They all need to be existing if the para... | [
"Get",
"the",
"geometries",
"of",
"a",
"table",
"inside",
"a",
"given",
"envelope",
"."
] | d2b436bbdf951dc1fda56096a42dbc0eae4d35a5 | https://github.com/TheHortonMachine/hortonmachine/blob/d2b436bbdf951dc1fda56096a42dbc0eae4d35a5/dbs/src/main/java/org/hortonmachine/dbs/compat/ASpatialDb.java#L282-L325 | train |
TheHortonMachine/hortonmachine | dbs/src/main/java/org/hortonmachine/dbs/compat/ASpatialDb.java | ASpatialDb.getGeometriesIn | public List<Geometry> getGeometriesIn( String tableName, Geometry intersectionGeometry, String... prePostWhere )
throws Exception {
List<Geometry> geoms = new ArrayList<Geometry>();
List<String> wheres = new ArrayList<>();
String pre = "";
String post = "";
String wh... | java | public List<Geometry> getGeometriesIn( String tableName, Geometry intersectionGeometry, String... prePostWhere )
throws Exception {
List<Geometry> geoms = new ArrayList<Geometry>();
List<String> wheres = new ArrayList<>();
String pre = "";
String post = "";
String wh... | [
"public",
"List",
"<",
"Geometry",
">",
"getGeometriesIn",
"(",
"String",
"tableName",
",",
"Geometry",
"intersectionGeometry",
",",
"String",
"...",
"prePostWhere",
")",
"throws",
"Exception",
"{",
"List",
"<",
"Geometry",
">",
"geoms",
"=",
"new",
"ArrayList",... | Get the geometries of a table intersecting a given geometry.
@param tableName
the table name.
@param intersectionGeometry
the geometry to check, assumed in the same srid of the table geometry.
@param prePostWhere an optional set of 3 parameters. The parameters are: a
prefix wrapper for geom, a postfix for the same and... | [
"Get",
"the",
"geometries",
"of",
"a",
"table",
"intersecting",
"a",
"given",
"geometry",
"."
] | d2b436bbdf951dc1fda56096a42dbc0eae4d35a5 | https://github.com/TheHortonMachine/hortonmachine/blob/d2b436bbdf951dc1fda56096a42dbc0eae4d35a5/dbs/src/main/java/org/hortonmachine/dbs/compat/ASpatialDb.java#L340-L382 | train |
TheHortonMachine/hortonmachine | gears/src/main/java/org/hortonmachine/gears/utils/math/NumericsUtilities.java | NumericsUtilities.fEq | public static boolean fEq( float a, float b, float epsilon ) {
if (isNaN(a) && isNaN(b)) {
return true;
}
float diffAbs = abs(a - b);
return a == b ? true : diffAbs < epsilon ? true : diffAbs / Math.max(abs(a), abs(b)) < epsilon;
} | java | public static boolean fEq( float a, float b, float epsilon ) {
if (isNaN(a) && isNaN(b)) {
return true;
}
float diffAbs = abs(a - b);
return a == b ? true : diffAbs < epsilon ? true : diffAbs / Math.max(abs(a), abs(b)) < epsilon;
} | [
"public",
"static",
"boolean",
"fEq",
"(",
"float",
"a",
",",
"float",
"b",
",",
"float",
"epsilon",
")",
"{",
"if",
"(",
"isNaN",
"(",
"a",
")",
"&&",
"isNaN",
"(",
"b",
")",
")",
"{",
"return",
"true",
";",
"}",
"float",
"diffAbs",
"=",
"abs",
... | Returns true if two floats are considered equal based on an supplied epsilon.
<p>Note that two {@link Float#NaN} are seen as equal and return true.</p>
@param a float to compare.
@param b float to compare.
@return true if two float are considered equal. | [
"Returns",
"true",
"if",
"two",
"floats",
"are",
"considered",
"equal",
"based",
"on",
"an",
"supplied",
"epsilon",
"."
] | d2b436bbdf951dc1fda56096a42dbc0eae4d35a5 | https://github.com/TheHortonMachine/hortonmachine/blob/d2b436bbdf951dc1fda56096a42dbc0eae4d35a5/gears/src/main/java/org/hortonmachine/gears/utils/math/NumericsUtilities.java#L170-L176 | train |
TheHortonMachine/hortonmachine | gears/src/main/java/org/hortonmachine/gears/utils/math/NumericsUtilities.java | NumericsUtilities.logGamma | public static double logGamma( double x ) {
double ret;
if (Double.isNaN(x) || (x <= 0.0)) {
ret = Double.NaN;
} else {
double g = 607.0 / 128.0;
double sum = 0.0;
for( int i = LANCZOS.length - 1; i > 0; --i ) {
sum = sum + (LANCZ... | java | public static double logGamma( double x ) {
double ret;
if (Double.isNaN(x) || (x <= 0.0)) {
ret = Double.NaN;
} else {
double g = 607.0 / 128.0;
double sum = 0.0;
for( int i = LANCZOS.length - 1; i > 0; --i ) {
sum = sum + (LANCZ... | [
"public",
"static",
"double",
"logGamma",
"(",
"double",
"x",
")",
"{",
"double",
"ret",
";",
"if",
"(",
"Double",
".",
"isNaN",
"(",
"x",
")",
"||",
"(",
"x",
"<=",
"0.0",
")",
")",
"{",
"ret",
"=",
"Double",
".",
"NaN",
";",
"}",
"else",
"{",... | Gamma function ported from the apache math package.
<b>This should be removed if the apache math lib gets in use by HortonMachine.</b>
<p>Returns the natural logarithm of the gamma function Γ(x).
The implementation of this method is based on:
<ul>
<li><a href="http://mathworld.wolfram.com/GammaFunction.html">
G... | [
"Gamma",
"function",
"ported",
"from",
"the",
"apache",
"math",
"package",
"."
] | d2b436bbdf951dc1fda56096a42dbc0eae4d35a5 | https://github.com/TheHortonMachine/hortonmachine/blob/d2b436bbdf951dc1fda56096a42dbc0eae4d35a5/gears/src/main/java/org/hortonmachine/gears/utils/math/NumericsUtilities.java#L293-L312 | train |
TheHortonMachine/hortonmachine | gears/src/main/java/org/hortonmachine/gears/utils/math/NumericsUtilities.java | NumericsUtilities.getNegativeRanges | public static List<int[]> getNegativeRanges( double[] x ) {
int firstNegative = -1;
int lastNegative = -1;
List<int[]> rangeList = new ArrayList<int[]>();
for( int i = 0; i < x.length; i++ ) {
double xValue = x[i];
if (firstNegative == -1 && xValue < 0) {
... | java | public static List<int[]> getNegativeRanges( double[] x ) {
int firstNegative = -1;
int lastNegative = -1;
List<int[]> rangeList = new ArrayList<int[]>();
for( int i = 0; i < x.length; i++ ) {
double xValue = x[i];
if (firstNegative == -1 && xValue < 0) {
... | [
"public",
"static",
"List",
"<",
"int",
"[",
"]",
">",
"getNegativeRanges",
"(",
"double",
"[",
"]",
"x",
")",
"{",
"int",
"firstNegative",
"=",
"-",
"1",
";",
"int",
"lastNegative",
"=",
"-",
"1",
";",
"List",
"<",
"int",
"[",
"]",
">",
"rangeList... | Get the range index for which x is negative.
@param x
@return | [
"Get",
"the",
"range",
"index",
"for",
"which",
"x",
"is",
"negative",
"."
] | d2b436bbdf951dc1fda56096a42dbc0eae4d35a5 | https://github.com/TheHortonMachine/hortonmachine/blob/d2b436bbdf951dc1fda56096a42dbc0eae4d35a5/gears/src/main/java/org/hortonmachine/gears/utils/math/NumericsUtilities.java#L337-L363 | train |
TheHortonMachine/hortonmachine | gears/src/main/java/org/hortonmachine/gears/utils/math/NumericsUtilities.java | NumericsUtilities.range2Bins | public static double[] range2Bins( double min, double max, int binsNum ) {
double delta = (max - min) / binsNum;
double[] bins = new double[binsNum + 1];
int count = 0;
double running = min;
for( int i = 0; i < binsNum; i++ ) {
bins[count] = running;
runni... | java | public static double[] range2Bins( double min, double max, int binsNum ) {
double delta = (max - min) / binsNum;
double[] bins = new double[binsNum + 1];
int count = 0;
double running = min;
for( int i = 0; i < binsNum; i++ ) {
bins[count] = running;
runni... | [
"public",
"static",
"double",
"[",
"]",
"range2Bins",
"(",
"double",
"min",
",",
"double",
"max",
",",
"int",
"binsNum",
")",
"{",
"double",
"delta",
"=",
"(",
"max",
"-",
"min",
")",
"/",
"binsNum",
";",
"double",
"[",
"]",
"bins",
"=",
"new",
"do... | Creates an array of equal bin from a range and the number of bins.
@param min the min value.
@param max the max value.
@param binsNum the number of wanted bins.
@return the array of bin bounds of size [binNum+1], since it contains the min and max. | [
"Creates",
"an",
"array",
"of",
"equal",
"bin",
"from",
"a",
"range",
"and",
"the",
"number",
"of",
"bins",
"."
] | d2b436bbdf951dc1fda56096a42dbc0eae4d35a5 | https://github.com/TheHortonMachine/hortonmachine/blob/d2b436bbdf951dc1fda56096a42dbc0eae4d35a5/gears/src/main/java/org/hortonmachine/gears/utils/math/NumericsUtilities.java#L373-L385 | train |
TheHortonMachine/hortonmachine | gears/src/main/java/org/hortonmachine/gears/utils/math/NumericsUtilities.java | NumericsUtilities.range2Bins | public static double[] range2Bins( double min, double max, double step, boolean doLastEqual ) {
double intervalsDouble = (max - min) / step;
int intervals = (int) intervalsDouble;
double rest = intervalsDouble - intervals;
if (rest > D_TOLERANCE) {
intervals++;
}
... | java | public static double[] range2Bins( double min, double max, double step, boolean doLastEqual ) {
double intervalsDouble = (max - min) / step;
int intervals = (int) intervalsDouble;
double rest = intervalsDouble - intervals;
if (rest > D_TOLERANCE) {
intervals++;
}
... | [
"public",
"static",
"double",
"[",
"]",
"range2Bins",
"(",
"double",
"min",
",",
"double",
"max",
",",
"double",
"step",
",",
"boolean",
"doLastEqual",
")",
"{",
"double",
"intervalsDouble",
"=",
"(",
"max",
"-",
"min",
")",
"/",
"step",
";",
"int",
"i... | Creates an array of bins from a range and a step to use.
<p>Note that if the step doesn't split the range exactly, the last bin
will be smaller if doLastEqual is set to <code>false</code>.</p>
@param min the min value.
@param max the max value.
@param step the wanted size of the bins.
@param doLastEqual make also the... | [
"Creates",
"an",
"array",
"of",
"bins",
"from",
"a",
"range",
"and",
"a",
"step",
"to",
"use",
"."
] | d2b436bbdf951dc1fda56096a42dbc0eae4d35a5 | https://github.com/TheHortonMachine/hortonmachine/blob/d2b436bbdf951dc1fda56096a42dbc0eae4d35a5/gears/src/main/java/org/hortonmachine/gears/utils/math/NumericsUtilities.java#L399-L422 | train |
TheHortonMachine/hortonmachine | hmachine/src/main/java/org/hortonmachine/hmachine/modules/statistics/kriging/OmsKriging.java | OmsKriging.verifyInput | private void verifyInput() {
if (inData == null || inStations == null) {
throw new NullPointerException(msg.message("kriging.stationproblem"));
}
if (pMode < 0 || pMode > 1) {
throw new IllegalArgumentException(msg.message("kriging.defaultMode"));
}
if (d... | java | private void verifyInput() {
if (inData == null || inStations == null) {
throw new NullPointerException(msg.message("kriging.stationproblem"));
}
if (pMode < 0 || pMode > 1) {
throw new IllegalArgumentException(msg.message("kriging.defaultMode"));
}
if (d... | [
"private",
"void",
"verifyInput",
"(",
")",
"{",
"if",
"(",
"inData",
"==",
"null",
"||",
"inStations",
"==",
"null",
")",
"{",
"throw",
"new",
"NullPointerException",
"(",
"msg",
".",
"message",
"(",
"\"kriging.stationproblem\"",
")",
")",
";",
"}",
"if",... | Verify the input of the model. | [
"Verify",
"the",
"input",
"of",
"the",
"model",
"."
] | d2b436bbdf951dc1fda56096a42dbc0eae4d35a5 | https://github.com/TheHortonMachine/hortonmachine/blob/d2b436bbdf951dc1fda56096a42dbc0eae4d35a5/hmachine/src/main/java/org/hortonmachine/hmachine/modules/statistics/kriging/OmsKriging.java#L486-L523 | train |
TheHortonMachine/hortonmachine | hmachine/src/main/java/org/hortonmachine/hmachine/modules/statistics/kriging/OmsKriging.java | OmsKriging.getCoordinate | private LinkedHashMap<Integer, Coordinate> getCoordinate( int nStaz, SimpleFeatureCollection collection, String idField )
throws Exception {
LinkedHashMap<Integer, Coordinate> id2CoordinatesMap = new LinkedHashMap<Integer, Coordinate>();
FeatureIterator<SimpleFeature> iterator = collection.f... | java | private LinkedHashMap<Integer, Coordinate> getCoordinate( int nStaz, SimpleFeatureCollection collection, String idField )
throws Exception {
LinkedHashMap<Integer, Coordinate> id2CoordinatesMap = new LinkedHashMap<Integer, Coordinate>();
FeatureIterator<SimpleFeature> iterator = collection.f... | [
"private",
"LinkedHashMap",
"<",
"Integer",
",",
"Coordinate",
">",
"getCoordinate",
"(",
"int",
"nStaz",
",",
"SimpleFeatureCollection",
"collection",
",",
"String",
"idField",
")",
"throws",
"Exception",
"{",
"LinkedHashMap",
"<",
"Integer",
",",
"Coordinate",
"... | Extract the coordinate of a FeatureCollection in a HashMap with an ID as
a key.
@param nStaz
@param collection
@throws Exception
if a fiel of elevation isn't the same of the collection | [
"Extract",
"the",
"coordinate",
"of",
"a",
"FeatureCollection",
"in",
"a",
"HashMap",
"with",
"an",
"ID",
"as",
"a",
"key",
"."
] | d2b436bbdf951dc1fda56096a42dbc0eae4d35a5 | https://github.com/TheHortonMachine/hortonmachine/blob/d2b436bbdf951dc1fda56096a42dbc0eae4d35a5/hmachine/src/main/java/org/hortonmachine/hmachine/modules/statistics/kriging/OmsKriging.java#L624-L651 | train |
TheHortonMachine/hortonmachine | hmachine/src/main/java/org/hortonmachine/hmachine/modules/statistics/kriging/OmsKriging.java | OmsKriging.variogram | private double variogram( double c0, double a, double sill, double rx, double ry, double rz ) {
if (isNovalue(rz)) {
rz = 0;
}
double value = 0;
double h2 = Math.sqrt(rx * rx + rz * rz + ry * ry);
if (pSemivariogramType == 0) {
value = c0 + sill * (1 - Mat... | java | private double variogram( double c0, double a, double sill, double rx, double ry, double rz ) {
if (isNovalue(rz)) {
rz = 0;
}
double value = 0;
double h2 = Math.sqrt(rx * rx + rz * rz + ry * ry);
if (pSemivariogramType == 0) {
value = c0 + sill * (1 - Mat... | [
"private",
"double",
"variogram",
"(",
"double",
"c0",
",",
"double",
"a",
",",
"double",
"sill",
",",
"double",
"rx",
",",
"double",
"ry",
",",
"double",
"rz",
")",
"{",
"if",
"(",
"isNovalue",
"(",
"rz",
")",
")",
"{",
"rz",
"=",
"0",
";",
"}",... | The gaussian variogram
@param c0
nugget.
@param a
range.
@param sill
sill.
@param rx
x distance.
@param ry
y distance.
@param rz
z distance.
@return the variogram value | [
"The",
"gaussian",
"variogram"
] | d2b436bbdf951dc1fda56096a42dbc0eae4d35a5 | https://github.com/TheHortonMachine/hortonmachine/blob/d2b436bbdf951dc1fda56096a42dbc0eae4d35a5/hmachine/src/main/java/org/hortonmachine/hmachine/modules/statistics/kriging/OmsKriging.java#L670-L684 | train |
TheHortonMachine/hortonmachine | gears/src/main/java/oms3/util/Components.java | Components.figureOutConnect | public static void figureOutConnect(PrintStream w, Object... comps) {
// add all the components via Proxy.
List<ComponentAccess> l = new ArrayList<ComponentAccess>();
for (Object c : comps) {
l.add(new ComponentAccess(c));
}
// find all out slots
for (Compone... | java | public static void figureOutConnect(PrintStream w, Object... comps) {
// add all the components via Proxy.
List<ComponentAccess> l = new ArrayList<ComponentAccess>();
for (Object c : comps) {
l.add(new ComponentAccess(c));
}
// find all out slots
for (Compone... | [
"public",
"static",
"void",
"figureOutConnect",
"(",
"PrintStream",
"w",
",",
"Object",
"...",
"comps",
")",
"{",
"// add all the components via Proxy.",
"List",
"<",
"ComponentAccess",
">",
"l",
"=",
"new",
"ArrayList",
"<",
"ComponentAccess",
">",
"(",
")",
";... | Figure out connectivity and generate Java statements.
@param comps | [
"Figure",
"out",
"connectivity",
"and",
"generate",
"Java",
"statements",
"."
] | d2b436bbdf951dc1fda56096a42dbc0eae4d35a5 | https://github.com/TheHortonMachine/hortonmachine/blob/d2b436bbdf951dc1fda56096a42dbc0eae4d35a5/gears/src/main/java/oms3/util/Components.java#L155-L185 | train |
TheHortonMachine/hortonmachine | gears/src/main/java/oms3/util/Components.java | Components.getComponentClasses | public static List<Class<?>> getComponentClasses(URL jar) throws IOException {
JarInputStream jarFile = new JarInputStream(jar.openStream());
URLClassLoader cl = new URLClassLoader(new URL[]{jar}, Thread.currentThread().getContextClassLoader());
List<Class<?>> idx = new ArrayList<Class<?>>();
... | java | public static List<Class<?>> getComponentClasses(URL jar) throws IOException {
JarInputStream jarFile = new JarInputStream(jar.openStream());
URLClassLoader cl = new URLClassLoader(new URL[]{jar}, Thread.currentThread().getContextClassLoader());
List<Class<?>> idx = new ArrayList<Class<?>>();
... | [
"public",
"static",
"List",
"<",
"Class",
"<",
"?",
">",
">",
"getComponentClasses",
"(",
"URL",
"jar",
")",
"throws",
"IOException",
"{",
"JarInputStream",
"jarFile",
"=",
"new",
"JarInputStream",
"(",
"jar",
".",
"openStream",
"(",
")",
")",
";",
"URLCla... | Get all components from a jar file
@param jar
@return the list of components from the jar. (Implement 'Execute' annotation)
@throws IOException
@throws ClassNotFoundException | [
"Get",
"all",
"components",
"from",
"a",
"jar",
"file"
] | d2b436bbdf951dc1fda56096a42dbc0eae4d35a5 | https://github.com/TheHortonMachine/hortonmachine/blob/d2b436bbdf951dc1fda56096a42dbc0eae4d35a5/gears/src/main/java/oms3/util/Components.java#L304-L331 | train |
TheHortonMachine/hortonmachine | gears/src/main/java/oms3/util/Components.java | Components.getDocumentation | public static URL getDocumentation(Class<?> comp, Locale loc) {
Documentation doc = (Documentation) comp.getAnnotation(Documentation.class);
if (doc != null) {
String v = doc.value();
try {
// try full URL first (external reference)
URL url = new U... | java | public static URL getDocumentation(Class<?> comp, Locale loc) {
Documentation doc = (Documentation) comp.getAnnotation(Documentation.class);
if (doc != null) {
String v = doc.value();
try {
// try full URL first (external reference)
URL url = new U... | [
"public",
"static",
"URL",
"getDocumentation",
"(",
"Class",
"<",
"?",
">",
"comp",
",",
"Locale",
"loc",
")",
"{",
"Documentation",
"doc",
"=",
"(",
"Documentation",
")",
"comp",
".",
"getAnnotation",
"(",
"Documentation",
".",
"class",
")",
";",
"if",
... | Get the documentation as URL reference;
@param comp The class to get the 'Documentation' tag from
@param loc The locale
@return the URL of the documentation file, null if no documentation is available. | [
"Get",
"the",
"documentation",
"as",
"URL",
"reference",
";"
] | d2b436bbdf951dc1fda56096a42dbc0eae4d35a5 | https://github.com/TheHortonMachine/hortonmachine/blob/d2b436bbdf951dc1fda56096a42dbc0eae4d35a5/gears/src/main/java/oms3/util/Components.java#L393-L419 | train |
TheHortonMachine/hortonmachine | gears/src/main/java/oms3/util/Components.java | Components.getDescription | public static String getDescription(Class<?> comp, Locale loc) {
Description descr = (Description) comp.getAnnotation(Description.class);
if (descr != null) {
String lang = loc.getLanguage();
Method[] m = descr.getClass().getMethods();
for (Method method : m) {
// ... | java | public static String getDescription(Class<?> comp, Locale loc) {
Description descr = (Description) comp.getAnnotation(Description.class);
if (descr != null) {
String lang = loc.getLanguage();
Method[] m = descr.getClass().getMethods();
for (Method method : m) {
// ... | [
"public",
"static",
"String",
"getDescription",
"(",
"Class",
"<",
"?",
">",
"comp",
",",
"Locale",
"loc",
")",
"{",
"Description",
"descr",
"=",
"(",
"Description",
")",
"comp",
".",
"getAnnotation",
"(",
"Description",
".",
"class",
")",
";",
"if",
"("... | Get the Component Description
@param comp the component class
@param loc the locale
@return the localized description | [
"Get",
"the",
"Component",
"Description"
] | d2b436bbdf951dc1fda56096a42dbc0eae4d35a5 | https://github.com/TheHortonMachine/hortonmachine/blob/d2b436bbdf951dc1fda56096a42dbc0eae4d35a5/gears/src/main/java/oms3/util/Components.java#L431-L452 | train |
enasequence/sequencetools | src/main/java/uk/ac/ebi/embl/api/validation/helper/Utils.java | Utils.stringListToArray | public static Object[] stringListToArray(List<String> list) {
Object[] params = null;
if (list != null) {
params = list.toArray(new String[list.size()]);
}
return params;
} | java | public static Object[] stringListToArray(List<String> list) {
Object[] params = null;
if (list != null) {
params = list.toArray(new String[list.size()]);
}
return params;
} | [
"public",
"static",
"Object",
"[",
"]",
"stringListToArray",
"(",
"List",
"<",
"String",
">",
"list",
")",
"{",
"Object",
"[",
"]",
"params",
"=",
"null",
";",
"if",
"(",
"list",
"!=",
"null",
")",
"{",
"params",
"=",
"list",
".",
"toArray",
"(",
"... | Converts list of strings to an array.
@param list a list of strings to be converted
@return an array | [
"Converts",
"list",
"of",
"strings",
"to",
"an",
"array",
"."
] | 4127f5e1a17540239f5810136153fbd6737fa262 | https://github.com/enasequence/sequencetools/blob/4127f5e1a17540239f5810136153fbd6737fa262/src/main/java/uk/ac/ebi/embl/api/validation/helper/Utils.java#L113-L119 | train |
enasequence/sequencetools | src/main/java/uk/ac/ebi/embl/api/validation/helper/Utils.java | Utils.notMatches | public static boolean notMatches(String value, String prefix, String middle,
String postfix) {
return !matches(value, prefix, middle, postfix);
} | java | public static boolean notMatches(String value, String prefix, String middle,
String postfix) {
return !matches(value, prefix, middle, postfix);
} | [
"public",
"static",
"boolean",
"notMatches",
"(",
"String",
"value",
",",
"String",
"prefix",
",",
"String",
"middle",
",",
"String",
"postfix",
")",
"{",
"return",
"!",
"matches",
"(",
"value",
",",
"prefix",
",",
"middle",
",",
"postfix",
")",
";",
"}"... | Check whether value NOT matches the pattern build with prefix, middle
part and post-fixer.
@param value a value to be checked
@param prefix a prefix pattern
@param middle a middle pattern
@param postfix a post-fixer pattern
@return true if value not matches pattern otherwise false | [
"Check",
"whether",
"value",
"NOT",
"matches",
"the",
"pattern",
"build",
"with",
"prefix",
"middle",
"part",
"and",
"post",
"-",
"fixer",
"."
] | 4127f5e1a17540239f5810136153fbd6737fa262 | https://github.com/enasequence/sequencetools/blob/4127f5e1a17540239f5810136153fbd6737fa262/src/main/java/uk/ac/ebi/embl/api/validation/helper/Utils.java#L131-L134 | train |
enasequence/sequencetools | src/main/java/uk/ac/ebi/embl/api/validation/helper/Utils.java | Utils.matches | public static boolean matches(String value, String prefix, String middle,
String postfix) {
String pattern = prefix + middle + postfix;
boolean result = value.matches(pattern);
return result;
} | java | public static boolean matches(String value, String prefix, String middle,
String postfix) {
String pattern = prefix + middle + postfix;
boolean result = value.matches(pattern);
return result;
} | [
"public",
"static",
"boolean",
"matches",
"(",
"String",
"value",
",",
"String",
"prefix",
",",
"String",
"middle",
",",
"String",
"postfix",
")",
"{",
"String",
"pattern",
"=",
"prefix",
"+",
"middle",
"+",
"postfix",
";",
"boolean",
"result",
"=",
"value... | Check whether value matches the pattern build with prefix, middle part
and post-fixer.
@param value a value to be checked
@param prefix a prefix pattern
@param middle a middle pattern
@param postfix a post-fixer pattern
@return true if value matches pattern otherwise false | [
"Check",
"whether",
"value",
"matches",
"the",
"pattern",
"build",
"with",
"prefix",
"middle",
"part",
"and",
"post",
"-",
"fixer",
"."
] | 4127f5e1a17540239f5810136153fbd6737fa262 | https://github.com/enasequence/sequencetools/blob/4127f5e1a17540239f5810136153fbd6737fa262/src/main/java/uk/ac/ebi/embl/api/validation/helper/Utils.java#L146-L151 | train |
enasequence/sequencetools | src/main/java/uk/ac/ebi/embl/api/validation/helper/Utils.java | Utils.matchesWithoutPrefixes | public static boolean matchesWithoutPrefixes(String value1, String prefix1,
String value2, String prefix2) {
if (!value1.startsWith(prefix1)) {
return false;
}
value1 = value1.substring(prefix1.length());
if (!value2.startsWith(prefix2)) {
return false;
}
value2 = value2.substring(prefix2.lengt... | java | public static boolean matchesWithoutPrefixes(String value1, String prefix1,
String value2, String prefix2) {
if (!value1.startsWith(prefix1)) {
return false;
}
value1 = value1.substring(prefix1.length());
if (!value2.startsWith(prefix2)) {
return false;
}
value2 = value2.substring(prefix2.lengt... | [
"public",
"static",
"boolean",
"matchesWithoutPrefixes",
"(",
"String",
"value1",
",",
"String",
"prefix1",
",",
"String",
"value2",
",",
"String",
"prefix2",
")",
"{",
"if",
"(",
"!",
"value1",
".",
"startsWith",
"(",
"prefix1",
")",
")",
"{",
"return",
"... | It removes prefixes from values and compare remaining parts.
@param value1 first value to be checked
@param prefix1 prefix of the first value
@param value2 second value to be checked
@param prefix2 prefix of the second value
@return true when both values without their prefixes are equal | [
"It",
"removes",
"prefixes",
"from",
"values",
"and",
"compare",
"remaining",
"parts",
"."
] | 4127f5e1a17540239f5810136153fbd6737fa262 | https://github.com/enasequence/sequencetools/blob/4127f5e1a17540239f5810136153fbd6737fa262/src/main/java/uk/ac/ebi/embl/api/validation/helper/Utils.java#L162-L175 | train |
enasequence/sequencetools | src/main/java/uk/ac/ebi/embl/api/validation/helper/Utils.java | Utils.shiftReferenceLocation | public static ValidationMessage shiftReferenceLocation(Entry entry,
long newSequenceLength) {
Collection<Reference> references = entry.getReferences();
for (Reference reference : references) {
for (Location rlocation : reference.getLocations().getLocations()) {
{
rlocation.setEndPosition(newSequenceL... | java | public static ValidationMessage shiftReferenceLocation(Entry entry,
long newSequenceLength) {
Collection<Reference> references = entry.getReferences();
for (Reference reference : references) {
for (Location rlocation : reference.getLocations().getLocations()) {
{
rlocation.setEndPosition(newSequenceL... | [
"public",
"static",
"ValidationMessage",
"shiftReferenceLocation",
"(",
"Entry",
"entry",
",",
"long",
"newSequenceLength",
")",
"{",
"Collection",
"<",
"Reference",
">",
"references",
"=",
"entry",
".",
"getReferences",
"(",
")",
";",
"for",
"(",
"Reference",
"... | Reference Location shifting | [
"Reference",
"Location",
"shifting"
] | 4127f5e1a17540239f5810136153fbd6737fa262 | https://github.com/enasequence/sequencetools/blob/4127f5e1a17540239f5810136153fbd6737fa262/src/main/java/uk/ac/ebi/embl/api/validation/helper/Utils.java#L532-L550 | train |
TheHortonMachine/hortonmachine | gears/src/main/java/org/hortonmachine/gears/utils/images/LineChartGenerator.java | LineChartGenerator.dumpChart | @SuppressWarnings("nls")
public void dumpChart( File chartFile, boolean autoRange, boolean withLegend, int imageWidth, int imageHeight )
throws IOException {
JFreeChart chart = ChartFactory.createXYLineChart(title, xLabel, yLabel, collection, PlotOrientation.VERTICAL, withLegend,
... | java | @SuppressWarnings("nls")
public void dumpChart( File chartFile, boolean autoRange, boolean withLegend, int imageWidth, int imageHeight )
throws IOException {
JFreeChart chart = ChartFactory.createXYLineChart(title, xLabel, yLabel, collection, PlotOrientation.VERTICAL, withLegend,
... | [
"@",
"SuppressWarnings",
"(",
"\"nls\"",
")",
"public",
"void",
"dumpChart",
"(",
"File",
"chartFile",
",",
"boolean",
"autoRange",
",",
"boolean",
"withLegend",
",",
"int",
"imageWidth",
",",
"int",
"imageHeight",
")",
"throws",
"IOException",
"{",
"JFreeChart"... | Creates the chart image and dumps it to file.
@param chartFile the file to which to write to.
@param autoRange flag to define if to auto define the range from the bounds.
@param withLegend flag to define the legend presence.
@param imageWidth the output image width (if -1 default is used).
@param imageHeight the outpu... | [
"Creates",
"the",
"chart",
"image",
"and",
"dumps",
"it",
"to",
"file",
"."
] | d2b436bbdf951dc1fda56096a42dbc0eae4d35a5 | https://github.com/TheHortonMachine/hortonmachine/blob/d2b436bbdf951dc1fda56096a42dbc0eae4d35a5/gears/src/main/java/org/hortonmachine/gears/utils/images/LineChartGenerator.java#L85-L125 | train |
TheHortonMachine/hortonmachine | gears/src/main/java/org/hortonmachine/gears/utils/style/StyleWrapper.java | StyleWrapper.getFirstRule | public RuleWrapper getFirstRule() {
if (featureTypeStylesWrapperList.size() > 0) {
FeatureTypeStyleWrapper featureTypeStyleWrapper = featureTypeStylesWrapperList.get(0);
List<RuleWrapper> rulesWrapperList = featureTypeStyleWrapper.getRulesWrapperList();
if (rulesWrapperList.s... | java | public RuleWrapper getFirstRule() {
if (featureTypeStylesWrapperList.size() > 0) {
FeatureTypeStyleWrapper featureTypeStyleWrapper = featureTypeStylesWrapperList.get(0);
List<RuleWrapper> rulesWrapperList = featureTypeStyleWrapper.getRulesWrapperList();
if (rulesWrapperList.s... | [
"public",
"RuleWrapper",
"getFirstRule",
"(",
")",
"{",
"if",
"(",
"featureTypeStylesWrapperList",
".",
"size",
"(",
")",
">",
"0",
")",
"{",
"FeatureTypeStyleWrapper",
"featureTypeStyleWrapper",
"=",
"featureTypeStylesWrapperList",
".",
"get",
"(",
"0",
")",
";",... | Facility to get the first rule, if available.
@return the first rule or <code>null</code>. | [
"Facility",
"to",
"get",
"the",
"first",
"rule",
"if",
"available",
"."
] | d2b436bbdf951dc1fda56096a42dbc0eae4d35a5 | https://github.com/TheHortonMachine/hortonmachine/blob/d2b436bbdf951dc1fda56096a42dbc0eae4d35a5/gears/src/main/java/org/hortonmachine/gears/utils/style/StyleWrapper.java#L63-L73 | train |
TheHortonMachine/hortonmachine | gui/src/main/java/org/hortonmachine/gui/spatialtoolbox/core/FieldData.java | FieldData.isSimpleType | public boolean isSimpleType() {
if (//
fieldType.equals(Double.class.getCanonicalName()) || //
fieldType.equals(Float.class.getCanonicalName()) || //
fieldType.equals(Integer.class.getCanonicalName()) || //
fieldType.equals(double.class.getCanonicalName())... | java | public boolean isSimpleType() {
if (//
fieldType.equals(Double.class.getCanonicalName()) || //
fieldType.equals(Float.class.getCanonicalName()) || //
fieldType.equals(Integer.class.getCanonicalName()) || //
fieldType.equals(double.class.getCanonicalName())... | [
"public",
"boolean",
"isSimpleType",
"(",
")",
"{",
"if",
"(",
"//",
"fieldType",
".",
"equals",
"(",
"Double",
".",
"class",
".",
"getCanonicalName",
"(",
")",
")",
"||",
"//",
"fieldType",
".",
"equals",
"(",
"Float",
".",
"class",
".",
"getCanonicalNa... | Checks if this field is a simple type.
<p>
Simple types are:
<ul>
<li>double</li>
<li>float</li>
<li>int</li>
<li>...</li>
<li>Double</li>
<li>Float</li>
<li>...</li>
<li>boolean</li>
<li>Boolean</li>
<li>String</li>
</ul>
</p>
@return true if the type is simple. | [
"Checks",
"if",
"this",
"field",
"is",
"a",
"simple",
"type",
"."
] | d2b436bbdf951dc1fda56096a42dbc0eae4d35a5 | https://github.com/TheHortonMachine/hortonmachine/blob/d2b436bbdf951dc1fda56096a42dbc0eae4d35a5/gui/src/main/java/org/hortonmachine/gui/spatialtoolbox/core/FieldData.java#L109-L124 | train |
enasequence/sequencetools | src/main/java/uk/ac/ebi/embl/api/validation/check/sourcefeature/SequenceCoverageCheck.java | SequenceCoverageCheck.checkLocation | private Long[] checkLocation(Location location) {
Long[] positions = new Long[2];
if (location.isComplement()) {
positions[0] = location.getEndPosition();
positions[1] = location.getBeginPosition();
} else {
positions[0] = location.getBeginPosition();
positions[1] = location.getEndPosition();
}
re... | java | private Long[] checkLocation(Location location) {
Long[] positions = new Long[2];
if (location.isComplement()) {
positions[0] = location.getEndPosition();
positions[1] = location.getBeginPosition();
} else {
positions[0] = location.getBeginPosition();
positions[1] = location.getEndPosition();
}
re... | [
"private",
"Long",
"[",
"]",
"checkLocation",
"(",
"Location",
"location",
")",
"{",
"Long",
"[",
"]",
"positions",
"=",
"new",
"Long",
"[",
"2",
"]",
";",
"if",
"(",
"location",
".",
"isComplement",
"(",
")",
")",
"{",
"positions",
"[",
"0",
"]",
... | Checks and swaps positions if in wrong order.
@param location location to be checked
@return an array of positions (in proper order) | [
"Checks",
"and",
"swaps",
"positions",
"if",
"in",
"wrong",
"order",
"."
] | 4127f5e1a17540239f5810136153fbd6737fa262 | https://github.com/enasequence/sequencetools/blob/4127f5e1a17540239f5810136153fbd6737fa262/src/main/java/uk/ac/ebi/embl/api/validation/check/sourcefeature/SequenceCoverageCheck.java#L179-L189 | train |
enasequence/sequencetools | src/main/java/uk/ac/ebi/embl/api/entry/sequence/Sequence.java | Sequence.getSequence | @Deprecated
@Override
public String getSequence(Long beginPosition, Long endPosition) {
if (beginPosition == null || endPosition == null
|| (beginPosition > endPosition) || beginPosition < 1
|| endPosition >getLength()) {
return null;
}
int length = (int) (endPosition.longValue() - beginPosi... | java | @Deprecated
@Override
public String getSequence(Long beginPosition, Long endPosition) {
if (beginPosition == null || endPosition == null
|| (beginPosition > endPosition) || beginPosition < 1
|| endPosition >getLength()) {
return null;
}
int length = (int) (endPosition.longValue() - beginPosi... | [
"@",
"Deprecated",
"@",
"Override",
"public",
"String",
"getSequence",
"(",
"Long",
"beginPosition",
",",
"Long",
"endPosition",
")",
"{",
"if",
"(",
"beginPosition",
"==",
"null",
"||",
"endPosition",
"==",
"null",
"||",
"(",
"beginPosition",
">",
"endPositio... | Overridden so we can create appropriate sized buffer before making
string.
@see uk.ac.ebi.embl.api.entry.sequence.AbstractSequence#getSequence(java.lang.Long,
java.lang.Long) | [
"Overridden",
"so",
"we",
"can",
"create",
"appropriate",
"sized",
"buffer",
"before",
"making",
"string",
"."
] | 4127f5e1a17540239f5810136153fbd6737fa262 | https://github.com/enasequence/sequencetools/blob/4127f5e1a17540239f5810136153fbd6737fa262/src/main/java/uk/ac/ebi/embl/api/entry/sequence/Sequence.java#L137-L173 | train |
TheHortonMachine/hortonmachine | gears/src/main/java/oms3/ngmf/util/IOCase.java | IOCase.convertCase | String convertCase(String str) {
if (str == null) {
return null;
}
return sensitive ? str : str.toLowerCase();
} | java | String convertCase(String str) {
if (str == null) {
return null;
}
return sensitive ? str : str.toLowerCase();
} | [
"String",
"convertCase",
"(",
"String",
"str",
")",
"{",
"if",
"(",
"str",
"==",
"null",
")",
"{",
"return",
"null",
";",
"}",
"return",
"sensitive",
"?",
"str",
":",
"str",
".",
"toLowerCase",
"(",
")",
";",
"}"
] | Converts the case of the input String to a standard format.
Subsequent operations can then use standard String methods.
@param str the string to convert, null returns null
@return the lower-case version if case-insensitive | [
"Converts",
"the",
"case",
"of",
"the",
"input",
"String",
"to",
"a",
"standard",
"format",
".",
"Subsequent",
"operations",
"can",
"then",
"use",
"standard",
"String",
"methods",
"."
] | d2b436bbdf951dc1fda56096a42dbc0eae4d35a5 | https://github.com/TheHortonMachine/hortonmachine/blob/d2b436bbdf951dc1fda56096a42dbc0eae4d35a5/gears/src/main/java/oms3/ngmf/util/IOCase.java#L221-L226 | train |
TheHortonMachine/hortonmachine | gears/src/main/java/org/hortonmachine/gears/utils/math/matrixes/RowVector.java | RowVector.set | private void set(Matrix m)
{
this.nRows = 1;
this.nCols = m.nCols;
this.values = m.values;
} | java | private void set(Matrix m)
{
this.nRows = 1;
this.nCols = m.nCols;
this.values = m.values;
} | [
"private",
"void",
"set",
"(",
"Matrix",
"m",
")",
"{",
"this",
".",
"nRows",
"=",
"1",
";",
"this",
".",
"nCols",
"=",
"m",
".",
"nCols",
";",
"this",
".",
"values",
"=",
"m",
".",
"values",
";",
"}"
] | Set this row vector from a matrix. Only the first row is used.
@param m the matrix | [
"Set",
"this",
"row",
"vector",
"from",
"a",
"matrix",
".",
"Only",
"the",
"first",
"row",
"is",
"used",
"."
] | d2b436bbdf951dc1fda56096a42dbc0eae4d35a5 | https://github.com/TheHortonMachine/hortonmachine/blob/d2b436bbdf951dc1fda56096a42dbc0eae4d35a5/gears/src/main/java/org/hortonmachine/gears/utils/math/matrixes/RowVector.java#L71-L76 | train |
TheHortonMachine/hortonmachine | gears/src/main/java/org/hortonmachine/gears/utils/math/matrixes/Matrix.java | Matrix.getRow | public RowVector getRow(int r) throws MatrixException
{
if ((r < 0) || (r >= nRows)) {
throw new MatrixException(MatrixException.INVALID_INDEX);
}
RowVector rv = new RowVector(nCols);
for (int c = 0; c < nCols; ++c) {
rv.values[0][c] = this.values[r][c];
... | java | public RowVector getRow(int r) throws MatrixException
{
if ((r < 0) || (r >= nRows)) {
throw new MatrixException(MatrixException.INVALID_INDEX);
}
RowVector rv = new RowVector(nCols);
for (int c = 0; c < nCols; ++c) {
rv.values[0][c] = this.values[r][c];
... | [
"public",
"RowVector",
"getRow",
"(",
"int",
"r",
")",
"throws",
"MatrixException",
"{",
"if",
"(",
"(",
"r",
"<",
"0",
")",
"||",
"(",
"r",
">=",
"nRows",
")",
")",
"{",
"throw",
"new",
"MatrixException",
"(",
"MatrixException",
".",
"INVALID_INDEX",
... | Get a row of this matrix.
@param r the row index
@return the row as a row vector
@throws numbercruncher.MatrixException for an invalid index | [
"Get",
"a",
"row",
"of",
"this",
"matrix",
"."
] | d2b436bbdf951dc1fda56096a42dbc0eae4d35a5 | https://github.com/TheHortonMachine/hortonmachine/blob/d2b436bbdf951dc1fda56096a42dbc0eae4d35a5/gears/src/main/java/org/hortonmachine/gears/utils/math/matrixes/Matrix.java#L82-L94 | train |
TheHortonMachine/hortonmachine | gears/src/main/java/org/hortonmachine/gears/utils/math/matrixes/Matrix.java | Matrix.getColumn | public ColumnVector getColumn(int c) throws MatrixException
{
if ((c < 0) || (c >= nCols)) {
throw new MatrixException(MatrixException.INVALID_INDEX);
}
ColumnVector cv = new ColumnVector(nRows);
for (int r = 0; r < nRows; ++r) {
cv.values[r][0] = this.values... | java | public ColumnVector getColumn(int c) throws MatrixException
{
if ((c < 0) || (c >= nCols)) {
throw new MatrixException(MatrixException.INVALID_INDEX);
}
ColumnVector cv = new ColumnVector(nRows);
for (int r = 0; r < nRows; ++r) {
cv.values[r][0] = this.values... | [
"public",
"ColumnVector",
"getColumn",
"(",
"int",
"c",
")",
"throws",
"MatrixException",
"{",
"if",
"(",
"(",
"c",
"<",
"0",
")",
"||",
"(",
"c",
">=",
"nCols",
")",
")",
"{",
"throw",
"new",
"MatrixException",
"(",
"MatrixException",
".",
"INVALID_INDE... | Get a column of this matrix.
@param c the column index
@return the column as a column vector
@throws numbercruncher.MatrixException for an invalid index | [
"Get",
"a",
"column",
"of",
"this",
"matrix",
"."
] | d2b436bbdf951dc1fda56096a42dbc0eae4d35a5 | https://github.com/TheHortonMachine/hortonmachine/blob/d2b436bbdf951dc1fda56096a42dbc0eae4d35a5/gears/src/main/java/org/hortonmachine/gears/utils/math/matrixes/Matrix.java#L102-L114 | train |
TheHortonMachine/hortonmachine | gears/src/main/java/org/hortonmachine/gears/utils/math/matrixes/Matrix.java | Matrix.set | protected void set(double values[][])
{
this.nRows = values.length;
this.nCols = values[0].length;
this.values = values;
for (int r = 1; r < nRows; ++r) {
nCols = Math.min(nCols, values[r].length);
}
} | java | protected void set(double values[][])
{
this.nRows = values.length;
this.nCols = values[0].length;
this.values = values;
for (int r = 1; r < nRows; ++r) {
nCols = Math.min(nCols, values[r].length);
}
} | [
"protected",
"void",
"set",
"(",
"double",
"values",
"[",
"]",
"[",
"]",
")",
"{",
"this",
".",
"nRows",
"=",
"values",
".",
"length",
";",
"this",
".",
"nCols",
"=",
"values",
"[",
"0",
"]",
".",
"length",
";",
"this",
".",
"values",
"=",
"value... | Set this matrix from a 2-d array of values.
If the rows do not have the same length, then the matrix
column count is the length of the shortest row.
@param values the 2-d array of values | [
"Set",
"this",
"matrix",
"from",
"a",
"2",
"-",
"d",
"array",
"of",
"values",
".",
"If",
"the",
"rows",
"do",
"not",
"have",
"the",
"same",
"length",
"then",
"the",
"matrix",
"column",
"count",
"is",
"the",
"length",
"of",
"the",
"shortest",
"row",
"... | d2b436bbdf951dc1fda56096a42dbc0eae4d35a5 | https://github.com/TheHortonMachine/hortonmachine/blob/d2b436bbdf951dc1fda56096a42dbc0eae4d35a5/gears/src/main/java/org/hortonmachine/gears/utils/math/matrixes/Matrix.java#L165-L174 | train |
TheHortonMachine/hortonmachine | gears/src/main/java/org/hortonmachine/gears/utils/math/matrixes/Matrix.java | Matrix.setRow | public void setRow(RowVector rv, int r) throws MatrixException
{
if ((r < 0) || (r >= nRows)) {
throw new MatrixException(MatrixException.INVALID_INDEX);
}
if (nCols != rv.nCols) {
throw new MatrixException(
MatrixException.INVALID_DIME... | java | public void setRow(RowVector rv, int r) throws MatrixException
{
if ((r < 0) || (r >= nRows)) {
throw new MatrixException(MatrixException.INVALID_INDEX);
}
if (nCols != rv.nCols) {
throw new MatrixException(
MatrixException.INVALID_DIME... | [
"public",
"void",
"setRow",
"(",
"RowVector",
"rv",
",",
"int",
"r",
")",
"throws",
"MatrixException",
"{",
"if",
"(",
"(",
"r",
"<",
"0",
")",
"||",
"(",
"r",
">=",
"nRows",
")",
")",
"{",
"throw",
"new",
"MatrixException",
"(",
"MatrixException",
"... | Set a row of this matrix from a row vector.
@param rv the row vector
@param r the row index
@throws numbercruncher.MatrixException for an invalid index or
an invalid vector size | [
"Set",
"a",
"row",
"of",
"this",
"matrix",
"from",
"a",
"row",
"vector",
"."
] | d2b436bbdf951dc1fda56096a42dbc0eae4d35a5 | https://github.com/TheHortonMachine/hortonmachine/blob/d2b436bbdf951dc1fda56096a42dbc0eae4d35a5/gears/src/main/java/org/hortonmachine/gears/utils/math/matrixes/Matrix.java#L183-L196 | train |
TheHortonMachine/hortonmachine | gears/src/main/java/org/hortonmachine/gears/utils/math/matrixes/Matrix.java | Matrix.setColumn | public void setColumn(ColumnVector cv, int c)
throws MatrixException
{
if ((c < 0) || (c >= nCols)) {
throw new MatrixException(MatrixException.INVALID_INDEX);
}
if (nRows != cv.nRows) {
throw new MatrixException(
MatrixExceptio... | java | public void setColumn(ColumnVector cv, int c)
throws MatrixException
{
if ((c < 0) || (c >= nCols)) {
throw new MatrixException(MatrixException.INVALID_INDEX);
}
if (nRows != cv.nRows) {
throw new MatrixException(
MatrixExceptio... | [
"public",
"void",
"setColumn",
"(",
"ColumnVector",
"cv",
",",
"int",
"c",
")",
"throws",
"MatrixException",
"{",
"if",
"(",
"(",
"c",
"<",
"0",
")",
"||",
"(",
"c",
">=",
"nCols",
")",
")",
"{",
"throw",
"new",
"MatrixException",
"(",
"MatrixException... | Set a column of this matrix from a column vector.
@param cv the column vector
@param c the column index
@throws numbercruncher.MatrixException for an invalid index or
an invalid vector size | [
"Set",
"a",
"column",
"of",
"this",
"matrix",
"from",
"a",
"column",
"vector",
"."
] | d2b436bbdf951dc1fda56096a42dbc0eae4d35a5 | https://github.com/TheHortonMachine/hortonmachine/blob/d2b436bbdf951dc1fda56096a42dbc0eae4d35a5/gears/src/main/java/org/hortonmachine/gears/utils/math/matrixes/Matrix.java#L205-L219 | train |
TheHortonMachine/hortonmachine | gears/src/main/java/org/hortonmachine/gears/utils/math/matrixes/Matrix.java | Matrix.transpose | public Matrix transpose()
{
double tv[][] = new double[nCols][nRows]; // transposed values
// Set the values of the transpose.
for (int r = 0; r < nRows; ++r) {
for (int c = 0; c < nCols; ++c) {
tv[c][r] = values[r][c];
}
}
return ne... | java | public Matrix transpose()
{
double tv[][] = new double[nCols][nRows]; // transposed values
// Set the values of the transpose.
for (int r = 0; r < nRows; ++r) {
for (int c = 0; c < nCols; ++c) {
tv[c][r] = values[r][c];
}
}
return ne... | [
"public",
"Matrix",
"transpose",
"(",
")",
"{",
"double",
"tv",
"[",
"]",
"[",
"]",
"=",
"new",
"double",
"[",
"nCols",
"]",
"[",
"nRows",
"]",
";",
"// transposed values",
"// Set the values of the transpose.",
"for",
"(",
"int",
"r",
"=",
"0",
";",
"r"... | Return the transpose of this matrix.
@return the transposed matrix | [
"Return",
"the",
"transpose",
"of",
"this",
"matrix",
"."
] | d2b436bbdf951dc1fda56096a42dbc0eae4d35a5 | https://github.com/TheHortonMachine/hortonmachine/blob/d2b436bbdf951dc1fda56096a42dbc0eae4d35a5/gears/src/main/java/org/hortonmachine/gears/utils/math/matrixes/Matrix.java#L229-L241 | train |
TheHortonMachine/hortonmachine | gears/src/main/java/org/hortonmachine/gears/utils/math/matrixes/Matrix.java | Matrix.add | public Matrix add(Matrix m) throws MatrixException
{
// Validate m's size.
if ((nRows != m.nRows) && (nCols != m.nCols)) {
throw new MatrixException(
MatrixException.INVALID_DIMENSIONS);
}
double sv[][] = new double[nRows][nCols]; // sum v... | java | public Matrix add(Matrix m) throws MatrixException
{
// Validate m's size.
if ((nRows != m.nRows) && (nCols != m.nCols)) {
throw new MatrixException(
MatrixException.INVALID_DIMENSIONS);
}
double sv[][] = new double[nRows][nCols]; // sum v... | [
"public",
"Matrix",
"add",
"(",
"Matrix",
"m",
")",
"throws",
"MatrixException",
"{",
"// Validate m's size.",
"if",
"(",
"(",
"nRows",
"!=",
"m",
".",
"nRows",
")",
"&&",
"(",
"nCols",
"!=",
"m",
".",
"nCols",
")",
")",
"{",
"throw",
"new",
"MatrixExc... | Add another matrix to this matrix.
@param m the matrix addend
@return the sum matrix
@throws numbercruncher.MatrixException for invalid size | [
"Add",
"another",
"matrix",
"to",
"this",
"matrix",
"."
] | d2b436bbdf951dc1fda56096a42dbc0eae4d35a5 | https://github.com/TheHortonMachine/hortonmachine/blob/d2b436bbdf951dc1fda56096a42dbc0eae4d35a5/gears/src/main/java/org/hortonmachine/gears/utils/math/matrixes/Matrix.java#L249-L267 | train |
TheHortonMachine/hortonmachine | gears/src/main/java/org/hortonmachine/gears/utils/math/matrixes/Matrix.java | Matrix.subtract | public Matrix subtract(Matrix m) throws MatrixException
{
// Validate m's size.
if ((nRows != m.nRows) && (nCols != m.nCols)) {
throw new MatrixException(
MatrixException.INVALID_DIMENSIONS);
}
double dv[][] = new double[nRows][nCols]; // ... | java | public Matrix subtract(Matrix m) throws MatrixException
{
// Validate m's size.
if ((nRows != m.nRows) && (nCols != m.nCols)) {
throw new MatrixException(
MatrixException.INVALID_DIMENSIONS);
}
double dv[][] = new double[nRows][nCols]; // ... | [
"public",
"Matrix",
"subtract",
"(",
"Matrix",
"m",
")",
"throws",
"MatrixException",
"{",
"// Validate m's size.",
"if",
"(",
"(",
"nRows",
"!=",
"m",
".",
"nRows",
")",
"&&",
"(",
"nCols",
"!=",
"m",
".",
"nCols",
")",
")",
"{",
"throw",
"new",
"Matr... | Subtract another matrix from this matrix.
@param m the matrix subrrahend
@return the difference matrix
@throws numbercruncher.MatrixException for invalid size | [
"Subtract",
"another",
"matrix",
"from",
"this",
"matrix",
"."
] | d2b436bbdf951dc1fda56096a42dbc0eae4d35a5 | https://github.com/TheHortonMachine/hortonmachine/blob/d2b436bbdf951dc1fda56096a42dbc0eae4d35a5/gears/src/main/java/org/hortonmachine/gears/utils/math/matrixes/Matrix.java#L275-L293 | train |
TheHortonMachine/hortonmachine | gears/src/main/java/org/hortonmachine/gears/utils/math/matrixes/Matrix.java | Matrix.multiply | public Matrix multiply(double k)
{
double pv[][] = new double[nRows][nCols]; // product values
// Compute values of the product.
for (int r = 0; r < nRows; ++r) {
for (int c = 0; c < nCols; ++c) {
pv[r][c] = k*values[r][c];
}
}
return... | java | public Matrix multiply(double k)
{
double pv[][] = new double[nRows][nCols]; // product values
// Compute values of the product.
for (int r = 0; r < nRows; ++r) {
for (int c = 0; c < nCols; ++c) {
pv[r][c] = k*values[r][c];
}
}
return... | [
"public",
"Matrix",
"multiply",
"(",
"double",
"k",
")",
"{",
"double",
"pv",
"[",
"]",
"[",
"]",
"=",
"new",
"double",
"[",
"nRows",
"]",
"[",
"nCols",
"]",
";",
"// product values",
"// Compute values of the product.",
"for",
"(",
"int",
"r",
"=",
"0",... | Multiply this matrix by a constant.
@param k the constant
@return the product matrix | [
"Multiply",
"this",
"matrix",
"by",
"a",
"constant",
"."
] | d2b436bbdf951dc1fda56096a42dbc0eae4d35a5 | https://github.com/TheHortonMachine/hortonmachine/blob/d2b436bbdf951dc1fda56096a42dbc0eae4d35a5/gears/src/main/java/org/hortonmachine/gears/utils/math/matrixes/Matrix.java#L300-L312 | train |
TheHortonMachine/hortonmachine | gears/src/main/java/org/hortonmachine/gears/utils/math/matrixes/Matrix.java | Matrix.multiply | public Matrix multiply(Matrix m) throws MatrixException
{
// Validate m's dimensions.
if (nCols != m.nRows) {
throw new MatrixException(
MatrixException.INVALID_DIMENSIONS);
}
double pv[][] = new double[nRows][m.nCols]; // product values
... | java | public Matrix multiply(Matrix m) throws MatrixException
{
// Validate m's dimensions.
if (nCols != m.nRows) {
throw new MatrixException(
MatrixException.INVALID_DIMENSIONS);
}
double pv[][] = new double[nRows][m.nCols]; // product values
... | [
"public",
"Matrix",
"multiply",
"(",
"Matrix",
"m",
")",
"throws",
"MatrixException",
"{",
"// Validate m's dimensions.",
"if",
"(",
"nCols",
"!=",
"m",
".",
"nRows",
")",
"{",
"throw",
"new",
"MatrixException",
"(",
"MatrixException",
".",
"INVALID_DIMENSIONS",
... | Multiply this matrix by another matrix.
@param m the matrix multiplier
@return the product matrix
@throws numbercruncher.MatrixException for invalid size | [
"Multiply",
"this",
"matrix",
"by",
"another",
"matrix",
"."
] | d2b436bbdf951dc1fda56096a42dbc0eae4d35a5 | https://github.com/TheHortonMachine/hortonmachine/blob/d2b436bbdf951dc1fda56096a42dbc0eae4d35a5/gears/src/main/java/org/hortonmachine/gears/utils/math/matrixes/Matrix.java#L320-L342 | train |
TheHortonMachine/hortonmachine | lesto/src/main/java/org/hortonmachine/lesto/modules/utilities/LasInfo.java | LasInfo.printInfo | public static void printInfo( String filePath ) throws Exception {
LasInfo lasInfo = new LasInfo();
lasInfo.inLas = filePath;
lasInfo.process();
} | java | public static void printInfo( String filePath ) throws Exception {
LasInfo lasInfo = new LasInfo();
lasInfo.inLas = filePath;
lasInfo.process();
} | [
"public",
"static",
"void",
"printInfo",
"(",
"String",
"filePath",
")",
"throws",
"Exception",
"{",
"LasInfo",
"lasInfo",
"=",
"new",
"LasInfo",
"(",
")",
";",
"lasInfo",
".",
"inLas",
"=",
"filePath",
";",
"lasInfo",
".",
"process",
"(",
")",
";",
"}"
... | Utility method to run info.
@param filePath the file to print info of.
@throws Exception | [
"Utility",
"method",
"to",
"run",
"info",
"."
] | d2b436bbdf951dc1fda56096a42dbc0eae4d35a5 | https://github.com/TheHortonMachine/hortonmachine/blob/d2b436bbdf951dc1fda56096a42dbc0eae4d35a5/lesto/src/main/java/org/hortonmachine/lesto/modules/utilities/LasInfo.java#L121-L125 | train |
TheHortonMachine/hortonmachine | hmachine/src/main/java/org/hortonmachine/hmachine/modules/networktools/trento_p/net/NetworkCalibration.java | NetworkCalibration.internalPipeVerify | private double internalPipeVerify( int k, double[] cDelays, double[][] net, double[][] timeDischarge,
double[][] timeFillDegree, int tp ) {
int num;
double localdelay, olddelay, qMax, B, known, theta, u;
double[][] qPartial;
qPartial = new double[timeDischarge.length][timeD... | java | private double internalPipeVerify( int k, double[] cDelays, double[][] net, double[][] timeDischarge,
double[][] timeFillDegree, int tp ) {
int num;
double localdelay, olddelay, qMax, B, known, theta, u;
double[][] qPartial;
qPartial = new double[timeDischarge.length][timeD... | [
"private",
"double",
"internalPipeVerify",
"(",
"int",
"k",
",",
"double",
"[",
"]",
"cDelays",
",",
"double",
"[",
"]",
"[",
"]",
"net",
",",
"double",
"[",
"]",
"[",
"]",
"timeDischarge",
",",
"double",
"[",
"]",
"[",
"]",
"timeFillDegree",
",",
"i... | verify of the no-head pipes.
<p>
It evaluate the discharge.
</p>
@param k ID of the pipe where evaluate the discharge.
@param cDelays delay matrix (for the evalutation of the flow wave).
@param net matrix that contains value of the network.
@return | [
"verify",
"of",
"the",
"no",
"-",
"head",
"pipes",
"."
] | d2b436bbdf951dc1fda56096a42dbc0eae4d35a5 | https://github.com/TheHortonMachine/hortonmachine/blob/d2b436bbdf951dc1fda56096a42dbc0eae4d35a5/hmachine/src/main/java/org/hortonmachine/hmachine/modules/networktools/trento_p/net/NetworkCalibration.java#L376-L432 | train |
TheHortonMachine/hortonmachine | hmachine/src/main/java/org/hortonmachine/hmachine/modules/networktools/trento_p/net/NetworkCalibration.java | NetworkCalibration.calculateDelays | private void calculateDelays( int k, double[] cDelays, double[][] net )
{
double t;
int ind, r = 1;
for( int j = 0; j < net.length; ++j ) {
t = 0;
r = 1;
ind = (int) net[j][0];
/*
* Area k is not included in delays
*... | java | private void calculateDelays( int k, double[] cDelays, double[][] net )
{
double t;
int ind, r = 1;
for( int j = 0; j < net.length; ++j ) {
t = 0;
r = 1;
ind = (int) net[j][0];
/*
* Area k is not included in delays
*... | [
"private",
"void",
"calculateDelays",
"(",
"int",
"k",
",",
"double",
"[",
"]",
"cDelays",
",",
"double",
"[",
"]",
"[",
"]",
"net",
")",
"{",
"double",
"t",
";",
"int",
"ind",
",",
"r",
"=",
"1",
";",
"for",
"(",
"int",
"j",
"=",
"0",
";",
"... | Calcola il ritardo della tubazione k.
@param k indice della tubazione.
@param cDelays matrice dei ritardi.
@param net matrice che contiene la sottorete. | [
"Calcola",
"il",
"ritardo",
"della",
"tubazione",
"k",
"."
] | d2b436bbdf951dc1fda56096a42dbc0eae4d35a5 | https://github.com/TheHortonMachine/hortonmachine/blob/d2b436bbdf951dc1fda56096a42dbc0eae4d35a5/hmachine/src/main/java/org/hortonmachine/hmachine/modules/networktools/trento_p/net/NetworkCalibration.java#L465-L491 | train |
TheHortonMachine/hortonmachine | hmachine/src/main/java/org/hortonmachine/hmachine/modules/networktools/trento_p/net/NetworkCalibration.java | NetworkCalibration.getHydrograph | private double getHydrograph( int k, double[][] Qpartial, double localdelay, double delay, int tp )
{
double Qmax = 0;
double tmin = rainData[0][0]; /* [min] */
int j = 0;
double t = tmin;
double Q;
double rain;
int maxRain = 0;
if (tMax == tpMaxCali... | java | private double getHydrograph( int k, double[][] Qpartial, double localdelay, double delay, int tp )
{
double Qmax = 0;
double tmin = rainData[0][0]; /* [min] */
int j = 0;
double t = tmin;
double Q;
double rain;
int maxRain = 0;
if (tMax == tpMaxCali... | [
"private",
"double",
"getHydrograph",
"(",
"int",
"k",
",",
"double",
"[",
"]",
"[",
"]",
"Qpartial",
",",
"double",
"localdelay",
",",
"double",
"delay",
",",
"int",
"tp",
")",
"{",
"double",
"Qmax",
"=",
"0",
";",
"double",
"tmin",
"=",
"rainData",
... | Restituisce l'idrogramma.
@param k tratto di tubazione.
@param Qpartial matrice delle portate temporanee necessarie per costriure 'idrogramma.
@param localdelay ritardo della tubazione k.
@param delay ritardo temporale. | [
"Restituisce",
"l",
"idrogramma",
"."
] | d2b436bbdf951dc1fda56096a42dbc0eae4d35a5 | https://github.com/TheHortonMachine/hortonmachine/blob/d2b436bbdf951dc1fda56096a42dbc0eae4d35a5/hmachine/src/main/java/org/hortonmachine/hmachine/modules/networktools/trento_p/net/NetworkCalibration.java#L501-L546 | train |
TheHortonMachine/hortonmachine | hmachine/src/main/java/org/hortonmachine/hmachine/modules/networktools/trento_p/net/NetworkCalibration.java | NetworkCalibration.geoSewer | @Override
public void geoSewer() throws Exception {
if (!foundMaxrainTime) {
evaluateDischarge(lastTimeDischarge, lastTimeFillDegree, tpMaxCalibration);
} else {
/*
* start to evaluate the discharge from 15 minutes,evaluate the nearsted value to 15 minutes.
... | java | @Override
public void geoSewer() throws Exception {
if (!foundMaxrainTime) {
evaluateDischarge(lastTimeDischarge, lastTimeFillDegree, tpMaxCalibration);
} else {
/*
* start to evaluate the discharge from 15 minutes,evaluate the nearsted value to 15 minutes.
... | [
"@",
"Override",
"public",
"void",
"geoSewer",
"(",
")",
"throws",
"Exception",
"{",
"if",
"(",
"!",
"foundMaxrainTime",
")",
"{",
"evaluateDischarge",
"(",
"lastTimeDischarge",
",",
"lastTimeFillDegree",
",",
"tpMaxCalibration",
")",
";",
"}",
"else",
"{",
"/... | Estimate the discharge for each time and for each pipes.
<p>
It can work with a single rain time step (if there is an actual rain) or search the maximum rain time, if the rain is unknown and
the rain data are builtthroghout the rain possibility curve.
</p>
<p>
It work throgout 2 loop:
<ol>
*
<li>The first on the head ... | [
"Estimate",
"the",
"discharge",
"for",
"each",
"time",
"and",
"for",
"each",
"pipes",
"."
] | d2b436bbdf951dc1fda56096a42dbc0eae4d35a5 | https://github.com/TheHortonMachine/hortonmachine/blob/d2b436bbdf951dc1fda56096a42dbc0eae4d35a5/hmachine/src/main/java/org/hortonmachine/hmachine/modules/networktools/trento_p/net/NetworkCalibration.java#L659-L689 | train |
TheHortonMachine/hortonmachine | hmachine/src/main/java/org/hortonmachine/hmachine/modules/networktools/trento_p/net/NetworkCalibration.java | NetworkCalibration.scanNetwork | private double scanNetwork( int k, int l, double[] one, double[][] net ) {
int ind;
/*
* t Ritardo accumulato dall'onda prima di raggiungere il tratto si sta
* dimensionando.
*/
double t;
/*
* Distanza percorsa dall'acqua dall'area dove e' caduta per ... | java | private double scanNetwork( int k, int l, double[] one, double[][] net ) {
int ind;
/*
* t Ritardo accumulato dall'onda prima di raggiungere il tratto si sta
* dimensionando.
*/
double t;
/*
* Distanza percorsa dall'acqua dall'area dove e' caduta per ... | [
"private",
"double",
"scanNetwork",
"(",
"int",
"k",
",",
"int",
"l",
",",
"double",
"[",
"]",
"one",
",",
"double",
"[",
"]",
"[",
"]",
"net",
")",
"{",
"int",
"ind",
";",
"/*\n * t Ritardo accumulato dall'onda prima di raggiungere il tratto si sta\n ... | Compila la mantrice net con tutte i dati del sottobacino con chiusura nel
tratto che si sta analizzando, e restituisce la sua superfice
@param k tratto analizzato del sottobacino chiuso in l.
@param l chiusura del bacino.
@param one indice dei versanti.
@param net sottobacino che si chiude in l. | [
"Compila",
"la",
"mantrice",
"net",
"con",
"tutte",
"i",
"dati",
"del",
"sottobacino",
"con",
"chiusura",
"nel",
"tratto",
"che",
"si",
"sta",
"analizzando",
"e",
"restituisce",
"la",
"sua",
"superfice"
] | d2b436bbdf951dc1fda56096a42dbc0eae4d35a5 | https://github.com/TheHortonMachine/hortonmachine/blob/d2b436bbdf951dc1fda56096a42dbc0eae4d35a5/hmachine/src/main/java/org/hortonmachine/hmachine/modules/networktools/trento_p/net/NetworkCalibration.java#L744-L835 | train |
TheHortonMachine/hortonmachine | gears/src/main/java/org/hortonmachine/gears/io/dxfdwg/libs/dwg/objects/DwgBlock.java | DwgBlock.readDwgBlockV15 | public void readDwgBlockV15(int[] data, int offset) throws Exception {
int bitPos = offset;
bitPos = readObjectHeaderV15(data, bitPos);
Vector v = DwgUtil.getTextString(data, bitPos);
bitPos = ((Integer)v.get(0)).intValue();
String text = (String)v.get(1);
name = text;
bitPos = readObjectTailV15(data, bit... | java | public void readDwgBlockV15(int[] data, int offset) throws Exception {
int bitPos = offset;
bitPos = readObjectHeaderV15(data, bitPos);
Vector v = DwgUtil.getTextString(data, bitPos);
bitPos = ((Integer)v.get(0)).intValue();
String text = (String)v.get(1);
name = text;
bitPos = readObjectTailV15(data, bit... | [
"public",
"void",
"readDwgBlockV15",
"(",
"int",
"[",
"]",
"data",
",",
"int",
"offset",
")",
"throws",
"Exception",
"{",
"int",
"bitPos",
"=",
"offset",
";",
"bitPos",
"=",
"readObjectHeaderV15",
"(",
"data",
",",
"bitPos",
")",
";",
"Vector",
"v",
"=",... | Read a Block 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",
"Block",
"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/DwgBlock.java#L42-L50 | train |
TheHortonMachine/hortonmachine | apps/src/main/java/org/hortonmachine/nww/gui/ViewControlsSelectListener.java | ViewControlsSelectListener.setRepeatTimerDelay | public void setRepeatTimerDelay(int delay)
{
if (delay <= 0)
{
String message = Logging.getMessage("generic.ArgumentOutOfRange", delay);
Logging.logger().severe(message);
throw new IllegalArgumentException(message);
}
this.repeatTimer.setDelay(dela... | java | public void setRepeatTimerDelay(int delay)
{
if (delay <= 0)
{
String message = Logging.getMessage("generic.ArgumentOutOfRange", delay);
Logging.logger().severe(message);
throw new IllegalArgumentException(message);
}
this.repeatTimer.setDelay(dela... | [
"public",
"void",
"setRepeatTimerDelay",
"(",
"int",
"delay",
")",
"{",
"if",
"(",
"delay",
"<=",
"0",
")",
"{",
"String",
"message",
"=",
"Logging",
".",
"getMessage",
"(",
"\"generic.ArgumentOutOfRange\"",
",",
"delay",
")",
";",
"Logging",
".",
"logger",
... | Set the repeat timer delay in milliseconds.
@param delay the repeat timer delay in milliseconds.
@throws IllegalArgumentException | [
"Set",
"the",
"repeat",
"timer",
"delay",
"in",
"milliseconds",
"."
] | d2b436bbdf951dc1fda56096a42dbc0eae4d35a5 | https://github.com/TheHortonMachine/hortonmachine/blob/d2b436bbdf951dc1fda56096a42dbc0eae4d35a5/apps/src/main/java/org/hortonmachine/nww/gui/ViewControlsSelectListener.java#L105-L114 | train |
TheHortonMachine/hortonmachine | apps/src/main/java/org/hortonmachine/nww/gui/ViewControlsSelectListener.java | ViewControlsSelectListener.setPitchIncrement | public void setPitchIncrement(double value)
{
if (value < 0)
{
String message = Logging.getMessage("generic.ArgumentOutOfRange", value);
Logging.logger().severe(message);
throw new IllegalArgumentException(message);
}
this.pitchStep = value;
} | java | public void setPitchIncrement(double value)
{
if (value < 0)
{
String message = Logging.getMessage("generic.ArgumentOutOfRange", value);
Logging.logger().severe(message);
throw new IllegalArgumentException(message);
}
this.pitchStep = value;
} | [
"public",
"void",
"setPitchIncrement",
"(",
"double",
"value",
")",
"{",
"if",
"(",
"value",
"<",
"0",
")",
"{",
"String",
"message",
"=",
"Logging",
".",
"getMessage",
"(",
"\"generic.ArgumentOutOfRange\"",
",",
"value",
")",
";",
"Logging",
".",
"logger",
... | Set the pitch increment value in decimal degrees. Doubling this value will double the pitch change speed. Must be
positive. Default value is 1 degree.
@param value the pitch increment value in decimal degrees.
@throws IllegalArgumentException | [
"Set",
"the",
"pitch",
"increment",
"value",
"in",
"decimal",
"degrees",
".",
"Doubling",
"this",
"value",
"will",
"double",
"the",
"pitch",
"change",
"speed",
".",
"Must",
"be",
"positive",
".",
"Default",
"value",
"is",
"1",
"degree",
"."
] | d2b436bbdf951dc1fda56096a42dbc0eae4d35a5 | https://github.com/TheHortonMachine/hortonmachine/blob/d2b436bbdf951dc1fda56096a42dbc0eae4d35a5/apps/src/main/java/org/hortonmachine/nww/gui/ViewControlsSelectListener.java#L197-L206 | train |
TheHortonMachine/hortonmachine | apps/src/main/java/org/hortonmachine/nww/gui/ViewControlsSelectListener.java | ViewControlsSelectListener.setFovIncrement | public void setFovIncrement(double value)
{
if (value < 1)
{
String message = Logging.getMessage("generic.ArgumentOutOfRange", value);
Logging.logger().severe(message);
throw new IllegalArgumentException(message);
}
this.fovStep = value;
} | java | public void setFovIncrement(double value)
{
if (value < 1)
{
String message = Logging.getMessage("generic.ArgumentOutOfRange", value);
Logging.logger().severe(message);
throw new IllegalArgumentException(message);
}
this.fovStep = value;
} | [
"public",
"void",
"setFovIncrement",
"(",
"double",
"value",
")",
"{",
"if",
"(",
"value",
"<",
"1",
")",
"{",
"String",
"message",
"=",
"Logging",
".",
"getMessage",
"(",
"\"generic.ArgumentOutOfRange\"",
",",
"value",
")",
";",
"Logging",
".",
"logger",
... | Set the field of view increment factor. At each iteration the current field of view will be multiplied or divided
by this value. Must be greater then or equal to one. Default value is 1.05.
@param value the field of view increment factor.
@throws IllegalArgumentException | [
"Set",
"the",
"field",
"of",
"view",
"increment",
"factor",
".",
"At",
"each",
"iteration",
"the",
"current",
"field",
"of",
"view",
"will",
"be",
"multiplied",
"or",
"divided",
"by",
"this",
"value",
".",
"Must",
"be",
"greater",
"then",
"or",
"equal",
... | d2b436bbdf951dc1fda56096a42dbc0eae4d35a5 | https://github.com/TheHortonMachine/hortonmachine/blob/d2b436bbdf951dc1fda56096a42dbc0eae4d35a5/apps/src/main/java/org/hortonmachine/nww/gui/ViewControlsSelectListener.java#L226-L235 | train |
TheHortonMachine/hortonmachine | apps/src/main/java/org/hortonmachine/nww/gui/ViewControlsSelectListener.java | ViewControlsSelectListener.setVeIncrement | public void setVeIncrement(double value)
{
if (value < 0)
{
String message = Logging.getMessage("generic.ArgumentOutOfRange", value);
Logging.logger().severe(message);
throw new IllegalArgumentException(message);
}
this.veStep = value;
} | java | public void setVeIncrement(double value)
{
if (value < 0)
{
String message = Logging.getMessage("generic.ArgumentOutOfRange", value);
Logging.logger().severe(message);
throw new IllegalArgumentException(message);
}
this.veStep = value;
} | [
"public",
"void",
"setVeIncrement",
"(",
"double",
"value",
")",
"{",
"if",
"(",
"value",
"<",
"0",
")",
"{",
"String",
"message",
"=",
"Logging",
".",
"getMessage",
"(",
"\"generic.ArgumentOutOfRange\"",
",",
"value",
")",
";",
"Logging",
".",
"logger",
"... | Set the vertical exaggeration increment. At each iteration the current vertical exaggeration will be increased or
decreased by this amount. Must be greater than or equal to zero. Default value is 0.1.
@param value the vertical exaggeration increment.
@throws IllegalArgumentException | [
"Set",
"the",
"vertical",
"exaggeration",
"increment",
".",
"At",
"each",
"iteration",
"the",
"current",
"vertical",
"exaggeration",
"will",
"be",
"increased",
"or",
"decreased",
"by",
"this",
"amount",
".",
"Must",
"be",
"greater",
"than",
"or",
"equal",
"to"... | d2b436bbdf951dc1fda56096a42dbc0eae4d35a5 | https://github.com/TheHortonMachine/hortonmachine/blob/d2b436bbdf951dc1fda56096a42dbc0eae4d35a5/apps/src/main/java/org/hortonmachine/nww/gui/ViewControlsSelectListener.java#L255-L264 | train |
TheHortonMachine/hortonmachine | apps/src/main/java/org/hortonmachine/nww/gui/ViewControlsSelectListener.java | ViewControlsSelectListener.computeSurfacePoint | protected Vec4 computeSurfacePoint(OrbitView view, Angle heading, Angle pitch)
{
Globe globe = wwd.getModel().getGlobe();
// Compute transform to be applied to north pointing Y so that it would point in the view direction
// Move coordinate system to view center point
Matrix transfor... | java | protected Vec4 computeSurfacePoint(OrbitView view, Angle heading, Angle pitch)
{
Globe globe = wwd.getModel().getGlobe();
// Compute transform to be applied to north pointing Y so that it would point in the view direction
// Move coordinate system to view center point
Matrix transfor... | [
"protected",
"Vec4",
"computeSurfacePoint",
"(",
"OrbitView",
"view",
",",
"Angle",
"heading",
",",
"Angle",
"pitch",
")",
"{",
"Globe",
"globe",
"=",
"wwd",
".",
"getModel",
"(",
")",
".",
"getGlobe",
"(",
")",
";",
"// Compute transform to be applied to north ... | Find out where on the terrain surface the eye would be looking at with the given heading and pitch angles.
@param view the orbit view
@param heading heading direction clockwise from north.
@param pitch view pitch angle from the surface normal at the center point.
@return the terrain surface point the view would ... | [
"Find",
"out",
"where",
"on",
"the",
"terrain",
"surface",
"the",
"eye",
"would",
"be",
"looking",
"at",
"with",
"the",
"given",
"heading",
"and",
"pitch",
"angles",
"."
] | d2b436bbdf951dc1fda56096a42dbc0eae4d35a5 | https://github.com/TheHortonMachine/hortonmachine/blob/d2b436bbdf951dc1fda56096a42dbc0eae4d35a5/apps/src/main/java/org/hortonmachine/nww/gui/ViewControlsSelectListener.java#L626-L641 | train |
TheHortonMachine/hortonmachine | dbs/src/main/java/org/hortonmachine/ssh/ProxyEnabler.java | ProxyEnabler.enableProxy | public static void enableProxy( String url, String port, String user, String pwd, String nonProxyHosts ) {
_url = url;
_port = port;
_user = user;
_pwd = pwd;
System.setProperty("http.proxyHost", url);
System.setProperty("https.proxyHost", url);
if (port != null ... | java | public static void enableProxy( String url, String port, String user, String pwd, String nonProxyHosts ) {
_url = url;
_port = port;
_user = user;
_pwd = pwd;
System.setProperty("http.proxyHost", url);
System.setProperty("https.proxyHost", url);
if (port != null ... | [
"public",
"static",
"void",
"enableProxy",
"(",
"String",
"url",
",",
"String",
"port",
",",
"String",
"user",
",",
"String",
"pwd",
",",
"String",
"nonProxyHosts",
")",
"{",
"_url",
"=",
"url",
";",
"_port",
"=",
"port",
";",
"_user",
"=",
"user",
";"... | Enable the proxy usage based on the url, user and pwd.
@param url the proxy server url.
@param port the server port.
@param user the proxy user.
@param pwd the proxy password.
@param nonProxyHosts hosts that do not go through proxy.
<p>Default is: <code>localhost|127.*|[::1]</code>.</p>
<p>Other example: *.foo.com|loc... | [
"Enable",
"the",
"proxy",
"usage",
"based",
"on",
"the",
"url",
"user",
"and",
"pwd",
"."
] | d2b436bbdf951dc1fda56096a42dbc0eae4d35a5 | https://github.com/TheHortonMachine/hortonmachine/blob/d2b436bbdf951dc1fda56096a42dbc0eae4d35a5/dbs/src/main/java/org/hortonmachine/ssh/ProxyEnabler.java#L48-L77 | train |
TheHortonMachine/hortonmachine | dbs/src/main/java/org/hortonmachine/ssh/ProxyEnabler.java | ProxyEnabler.disableProxy | public static void disableProxy() {
System.clearProperty("http.proxyHost");
System.clearProperty("http.proxyPort");
System.clearProperty("http.proxyUserName");
System.clearProperty("http.proxyUser");
System.clearProperty("http.proxyPassword");
System.clearProperty("https.... | java | public static void disableProxy() {
System.clearProperty("http.proxyHost");
System.clearProperty("http.proxyPort");
System.clearProperty("http.proxyUserName");
System.clearProperty("http.proxyUser");
System.clearProperty("http.proxyPassword");
System.clearProperty("https.... | [
"public",
"static",
"void",
"disableProxy",
"(",
")",
"{",
"System",
".",
"clearProperty",
"(",
"\"http.proxyHost\"",
")",
";",
"System",
".",
"clearProperty",
"(",
"\"http.proxyPort\"",
")",
";",
"System",
".",
"clearProperty",
"(",
"\"http.proxyUserName\"",
")",... | Disable the proxy usage. | [
"Disable",
"the",
"proxy",
"usage",
"."
] | d2b436bbdf951dc1fda56096a42dbc0eae4d35a5 | https://github.com/TheHortonMachine/hortonmachine/blob/d2b436bbdf951dc1fda56096a42dbc0eae4d35a5/dbs/src/main/java/org/hortonmachine/ssh/ProxyEnabler.java#L93-L110 | train |
TheHortonMachine/hortonmachine | gears/src/main/java/org/hortonmachine/gears/io/las/core/liblas/LiblasWrapper.java | LiblasWrapper.loadNativeLibrary | public static String loadNativeLibrary( String nativeLibPath, String libName ) {
try {
String name = "las_c";
if (libName == null)
libName = name;
if (nativeLibPath != null) {
NativeLibrary.addSearchPath(libName, nativeLibPath);
}
... | java | public static String loadNativeLibrary( String nativeLibPath, String libName ) {
try {
String name = "las_c";
if (libName == null)
libName = name;
if (nativeLibPath != null) {
NativeLibrary.addSearchPath(libName, nativeLibPath);
}
... | [
"public",
"static",
"String",
"loadNativeLibrary",
"(",
"String",
"nativeLibPath",
",",
"String",
"libName",
")",
"{",
"try",
"{",
"String",
"name",
"=",
"\"las_c\"",
";",
"if",
"(",
"libName",
"==",
"null",
")",
"libName",
"=",
"name",
";",
"if",
"(",
"... | Loads the native libs creating the native wrapper.
@param nativeLibPath the path to add or <code>null</code>.
@param libName the lib name or <code>null</code>, in which case "las_c" is used.
@return <code>null</code>, if the lib could be loaded, the error string else. | [
"Loads",
"the",
"native",
"libs",
"creating",
"the",
"native",
"wrapper",
"."
] | d2b436bbdf951dc1fda56096a42dbc0eae4d35a5 | https://github.com/TheHortonMachine/hortonmachine/blob/d2b436bbdf951dc1fda56096a42dbc0eae4d35a5/gears/src/main/java/org/hortonmachine/gears/io/las/core/liblas/LiblasWrapper.java#L55-L68 | train |
TheHortonMachine/hortonmachine | gears/src/main/java/org/hortonmachine/gears/io/geopaparazzi/geopap4/DaoLog.java | DaoLog.createTables | public static void createTables(Connection connection) throws Exception {
StringBuilder sB = new StringBuilder();
sB.append("CREATE TABLE ");
sB.append(TABLE_LOG);
sB.append(" (");
sB.append(COLUMN_ID);
sB.append(" INTEGER PRIMARY KEY AUTOINCREMENT, ");
sB.append(... | java | public static void createTables(Connection connection) throws Exception {
StringBuilder sB = new StringBuilder();
sB.append("CREATE TABLE ");
sB.append(TABLE_LOG);
sB.append(" (");
sB.append(COLUMN_ID);
sB.append(" INTEGER PRIMARY KEY AUTOINCREMENT, ");
sB.append(... | [
"public",
"static",
"void",
"createTables",
"(",
"Connection",
"connection",
")",
"throws",
"Exception",
"{",
"StringBuilder",
"sB",
"=",
"new",
"StringBuilder",
"(",
")",
";",
"sB",
".",
"append",
"(",
"\"CREATE TABLE \"",
")",
";",
"sB",
".",
"append",
"("... | Create the default log table.
@param connection the db connection to use.
@throws Exception if something goes wrong. | [
"Create",
"the",
"default",
"log",
"table",
"."
] | d2b436bbdf951dc1fda56096a42dbc0eae4d35a5 | https://github.com/TheHortonMachine/hortonmachine/blob/d2b436bbdf951dc1fda56096a42dbc0eae4d35a5/gears/src/main/java/org/hortonmachine/gears/io/geopaparazzi/geopap4/DaoLog.java#L57-L95 | train |
TheHortonMachine/hortonmachine | gears/src/main/java/org/hortonmachine/gears/io/grasslegacy/utils/Format.java | Format.convert | public static String convert( long x, int n, String d ) {
if (x == 0) {
return "0";
}
String r = "";
int m = 1 << n;
m--;
while( x != 0 ) {
r = d.charAt((int) (x & m)) + r;
x = x >>> n;
}
return r;
} | java | public static String convert( long x, int n, String d ) {
if (x == 0) {
return "0";
}
String r = "";
int m = 1 << n;
m--;
while( x != 0 ) {
r = d.charAt((int) (x & m)) + r;
x = x >>> n;
}
return r;
} | [
"public",
"static",
"String",
"convert",
"(",
"long",
"x",
",",
"int",
"n",
",",
"String",
"d",
")",
"{",
"if",
"(",
"x",
"==",
"0",
")",
"{",
"return",
"\"0\"",
";",
"}",
"String",
"r",
"=",
"\"\"",
";",
"int",
"m",
"=",
"1",
"<<",
"n",
";",... | Converts number to string
@param x value to convert
@param n conversion base
@param d string with characters for conversion.
@return converted number as string | [
"Converts",
"number",
"to",
"string"
] | d2b436bbdf951dc1fda56096a42dbc0eae4d35a5 | https://github.com/TheHortonMachine/hortonmachine/blob/d2b436bbdf951dc1fda56096a42dbc0eae4d35a5/gears/src/main/java/org/hortonmachine/gears/io/grasslegacy/utils/Format.java#L725-L738 | train |
TheHortonMachine/hortonmachine | gears/src/main/java/org/hortonmachine/gears/io/grasslegacy/utils/Format.java | Format.sprintf | public static String sprintf( String s, Object[] params ) {
if ((s == null) || (params == null)) {
return s;
}
StringBuffer result = new StringBuffer("");
String[] ss = split(s);
int p = 0;
for( int i = 0; i < ss.length; i++ ) {
char c = ss[i].char... | java | public static String sprintf( String s, Object[] params ) {
if ((s == null) || (params == null)) {
return s;
}
StringBuffer result = new StringBuffer("");
String[] ss = split(s);
int p = 0;
for( int i = 0; i < ss.length; i++ ) {
char c = ss[i].char... | [
"public",
"static",
"String",
"sprintf",
"(",
"String",
"s",
",",
"Object",
"[",
"]",
"params",
")",
"{",
"if",
"(",
"(",
"s",
"==",
"null",
")",
"||",
"(",
"params",
"==",
"null",
")",
")",
"{",
"return",
"s",
";",
"}",
"StringBuffer",
"result",
... | Sprintf multiple strings.
@param s
@param params
@return formated string | [
"Sprintf",
"multiple",
"strings",
"."
] | d2b436bbdf951dc1fda56096a42dbc0eae4d35a5 | https://github.com/TheHortonMachine/hortonmachine/blob/d2b436bbdf951dc1fda56096a42dbc0eae4d35a5/gears/src/main/java/org/hortonmachine/gears/io/grasslegacy/utils/Format.java#L887-L918 | train |
TheHortonMachine/hortonmachine | gears/src/main/java/oms3/ngmf/util/cosu/luca/ParameterData.java | ParameterData.setLowerAndUpperBounds | public void setLowerAndUpperBounds(double lower, double upper) {
if (data == null) {
return;
}
this.originalLowerBound = lower;
this.originalUpperBound = upper;
if (originalLowerBound < min) {
offset = Math.abs(originalLowerBound) + 10;
} else {
... | java | public void setLowerAndUpperBounds(double lower, double upper) {
if (data == null) {
return;
}
this.originalLowerBound = lower;
this.originalUpperBound = upper;
if (originalLowerBound < min) {
offset = Math.abs(originalLowerBound) + 10;
} else {
... | [
"public",
"void",
"setLowerAndUpperBounds",
"(",
"double",
"lower",
",",
"double",
"upper",
")",
"{",
"if",
"(",
"data",
"==",
"null",
")",
"{",
"return",
";",
"}",
"this",
".",
"originalLowerBound",
"=",
"lower",
";",
"this",
".",
"originalUpperBound",
"=... | Set the lower and upper bounds, and the actual bounds are determined. | [
"Set",
"the",
"lower",
"and",
"upper",
"bounds",
"and",
"the",
"actual",
"bounds",
"are",
"determined",
"."
] | d2b436bbdf951dc1fda56096a42dbc0eae4d35a5 | https://github.com/TheHortonMachine/hortonmachine/blob/d2b436bbdf951dc1fda56096a42dbc0eae4d35a5/gears/src/main/java/oms3/ngmf/util/cosu/luca/ParameterData.java#L229-L251 | train |
enasequence/sequencetools | src/main/java/uk/ac/ebi/embl/api/translation/CdsTranslator.java | CdsTranslator.checkLocations | private boolean checkLocations(long length, CompoundLocation<Location> locations) {
for(Location location : locations.getLocations()){
if(location instanceof RemoteLocation)
continue;
if(location.getIntBeginPosition() == null ||
location.getIntBeginPosition() ... | java | private boolean checkLocations(long length, CompoundLocation<Location> locations) {
for(Location location : locations.getLocations()){
if(location instanceof RemoteLocation)
continue;
if(location.getIntBeginPosition() == null ||
location.getIntBeginPosition() ... | [
"private",
"boolean",
"checkLocations",
"(",
"long",
"length",
",",
"CompoundLocation",
"<",
"Location",
">",
"locations",
")",
"{",
"for",
"(",
"Location",
"location",
":",
"locations",
".",
"getLocations",
"(",
")",
")",
"{",
"if",
"(",
"location",
"instan... | Checks that the locations are within the sequence length
@param length
@param locations
@return | [
"Checks",
"that",
"the",
"locations",
"are",
"within",
"the",
"sequence",
"length"
] | 4127f5e1a17540239f5810136153fbd6737fa262 | https://github.com/enasequence/sequencetools/blob/4127f5e1a17540239f5810136153fbd6737fa262/src/main/java/uk/ac/ebi/embl/api/translation/CdsTranslator.java#L248-L262 | train |
TheHortonMachine/hortonmachine | apps/src/main/java/org/hortonmachine/nww/utils/NwwUtilities.java | NwwUtilities.readFeatureSource | public static SimpleFeatureSource readFeatureSource( String path ) throws Exception {
File shapeFile = new File(path);
FileDataStore store = FileDataStoreFinder.getDataStore(shapeFile);
SimpleFeatureSource featureSource = store.getFeatureSource();
return featureSource;
} | java | public static SimpleFeatureSource readFeatureSource( String path ) throws Exception {
File shapeFile = new File(path);
FileDataStore store = FileDataStoreFinder.getDataStore(shapeFile);
SimpleFeatureSource featureSource = store.getFeatureSource();
return featureSource;
} | [
"public",
"static",
"SimpleFeatureSource",
"readFeatureSource",
"(",
"String",
"path",
")",
"throws",
"Exception",
"{",
"File",
"shapeFile",
"=",
"new",
"File",
"(",
"path",
")",
";",
"FileDataStore",
"store",
"=",
"FileDataStoreFinder",
".",
"getDataStore",
"(",
... | Get the feature source from a file.
@param path
the path to the shapefile.
@return the feature source.
@throws Exception | [
"Get",
"the",
"feature",
"source",
"from",
"a",
"file",
"."
] | d2b436bbdf951dc1fda56096a42dbc0eae4d35a5 | https://github.com/TheHortonMachine/hortonmachine/blob/d2b436bbdf951dc1fda56096a42dbc0eae4d35a5/apps/src/main/java/org/hortonmachine/nww/utils/NwwUtilities.java#L111-L116 | train |
TheHortonMachine/hortonmachine | apps/src/main/java/org/hortonmachine/nww/utils/NwwUtilities.java | NwwUtilities.getGeometryType | public static GEOMTYPE getGeometryType( SimpleFeatureCollection featureCollection ) {
GeometryDescriptor geometryDescriptor = featureCollection.getSchema().getGeometryDescriptor();
if (EGeometryType.isPolygon(geometryDescriptor)) {
return GEOMTYPE.POLYGON;
} else if (EGeometryType.is... | java | public static GEOMTYPE getGeometryType( SimpleFeatureCollection featureCollection ) {
GeometryDescriptor geometryDescriptor = featureCollection.getSchema().getGeometryDescriptor();
if (EGeometryType.isPolygon(geometryDescriptor)) {
return GEOMTYPE.POLYGON;
} else if (EGeometryType.is... | [
"public",
"static",
"GEOMTYPE",
"getGeometryType",
"(",
"SimpleFeatureCollection",
"featureCollection",
")",
"{",
"GeometryDescriptor",
"geometryDescriptor",
"=",
"featureCollection",
".",
"getSchema",
"(",
")",
".",
"getGeometryDescriptor",
"(",
")",
";",
"if",
"(",
... | Get the geometry type from a featurecollection.
@param featureCollection
the collection.
@return the {@link GEOMTYPE}. | [
"Get",
"the",
"geometry",
"type",
"from",
"a",
"featurecollection",
"."
] | d2b436bbdf951dc1fda56096a42dbc0eae4d35a5 | https://github.com/TheHortonMachine/hortonmachine/blob/d2b436bbdf951dc1fda56096a42dbc0eae4d35a5/apps/src/main/java/org/hortonmachine/nww/utils/NwwUtilities.java#L125-L136 | train |
TheHortonMachine/hortonmachine | apps/src/main/java/org/hortonmachine/nww/utils/NwwUtilities.java | NwwUtilities.insertBeforeCompass | public static void insertBeforeCompass( WorldWindow wwd, Layer layer ) {
// Insert the layer into the layer list just before the compass.
int compassPosition = 0;
LayerList layers = wwd.getModel().getLayers();
for( Layer l : layers ) {
if (l instanceof CompassLayer)
... | java | public static void insertBeforeCompass( WorldWindow wwd, Layer layer ) {
// Insert the layer into the layer list just before the compass.
int compassPosition = 0;
LayerList layers = wwd.getModel().getLayers();
for( Layer l : layers ) {
if (l instanceof CompassLayer)
... | [
"public",
"static",
"void",
"insertBeforeCompass",
"(",
"WorldWindow",
"wwd",
",",
"Layer",
"layer",
")",
"{",
"// Insert the layer into the layer list just before the compass.",
"int",
"compassPosition",
"=",
"0",
";",
"LayerList",
"layers",
"=",
"wwd",
".",
"getModel"... | Insert a layer before the compass layer.
@param wwd the {@link WorldWindow}.
@param layer the layer to insert. | [
"Insert",
"a",
"layer",
"before",
"the",
"compass",
"layer",
"."
] | d2b436bbdf951dc1fda56096a42dbc0eae4d35a5 | https://github.com/TheHortonMachine/hortonmachine/blob/d2b436bbdf951dc1fda56096a42dbc0eae4d35a5/apps/src/main/java/org/hortonmachine/nww/utils/NwwUtilities.java#L353-L362 | train |
TheHortonMachine/hortonmachine | gears/src/main/java/org/hortonmachine/gears/io/dxfdwg/libs/dwg/objects/DwgVertex2D.java | DwgVertex2D.readDwgVertex2DV15 | public void readDwgVertex2DV15(int[] data, int offset) throws Exception {
//System.out.println("readDwgVertex2D executing ...");
int bitPos = offset;
bitPos = readObjectHeaderV15(data, bitPos);
Vector v = DwgUtil.getRawChar(data, bitPos);
bitPos = ((Integer)v.get(0)).intValue();
int flags = ((Integer)v.get(... | java | public void readDwgVertex2DV15(int[] data, int offset) throws Exception {
//System.out.println("readDwgVertex2D executing ...");
int bitPos = offset;
bitPos = readObjectHeaderV15(data, bitPos);
Vector v = DwgUtil.getRawChar(data, bitPos);
bitPos = ((Integer)v.get(0)).intValue();
int flags = ((Integer)v.get(... | [
"public",
"void",
"readDwgVertex2DV15",
"(",
"int",
"[",
"]",
"data",
",",
"int",
"offset",
")",
"throws",
"Exception",
"{",
"//System.out.println(\"readDwgVertex2D executing ...\");",
"int",
"bitPos",
"=",
"offset",
";",
"bitPos",
"=",
"readObjectHeaderV15",
"(",
"... | Read a Vertex2D 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",
"Vertex2D",
"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/DwgVertex2D.java#L47-L89 | train |
TheHortonMachine/hortonmachine | gears/src/main/java/oms3/ngmf/util/cosu/Efficiencies.java | Efficiencies.runoffCoefficientError | public static double runoffCoefficientError(double[] obs, double[] sim, double[] precip) {
sameArrayLen(sim, obs, precip);
double mean_pred = Stats.mean(sim);
double mean_val = Stats.mean(obs);
double mean_ppt = Stats.mean(precip);
double error = Math.abs((mean_pred / mean_ppt) ... | java | public static double runoffCoefficientError(double[] obs, double[] sim, double[] precip) {
sameArrayLen(sim, obs, precip);
double mean_pred = Stats.mean(sim);
double mean_val = Stats.mean(obs);
double mean_ppt = Stats.mean(precip);
double error = Math.abs((mean_pred / mean_ppt) ... | [
"public",
"static",
"double",
"runoffCoefficientError",
"(",
"double",
"[",
"]",
"obs",
",",
"double",
"[",
"]",
"sim",
",",
"double",
"[",
"]",
"precip",
")",
"{",
"sameArrayLen",
"(",
"sim",
",",
"obs",
",",
"precip",
")",
";",
"double",
"mean_pred",
... | Runoff coefficient error ROCE
@param obs
@param sim
@param precip
@return | [
"Runoff",
"coefficient",
"error",
"ROCE"
] | d2b436bbdf951dc1fda56096a42dbc0eae4d35a5 | https://github.com/TheHortonMachine/hortonmachine/blob/d2b436bbdf951dc1fda56096a42dbc0eae4d35a5/gears/src/main/java/oms3/ngmf/util/cosu/Efficiencies.java#L409-L417 | train |
TheHortonMachine/hortonmachine | gears/src/main/java/org/hortonmachine/gears/utils/optimizers/particleswarm/Particle.java | Particle.update | public double[] update( double w, double c1, double rand1, double c2, double rand2, double[] globalBest ) {
for( int i = 0; i < locations.length; i++ ) {
particleVelocities[i] = w * particleVelocities[i] + //
c1 * rand1 * (particleLocalBests[i] - locations[i]) + //
... | java | public double[] update( double w, double c1, double rand1, double c2, double rand2, double[] globalBest ) {
for( int i = 0; i < locations.length; i++ ) {
particleVelocities[i] = w * particleVelocities[i] + //
c1 * rand1 * (particleLocalBests[i] - locations[i]) + //
... | [
"public",
"double",
"[",
"]",
"update",
"(",
"double",
"w",
",",
"double",
"c1",
",",
"double",
"rand1",
",",
"double",
"c2",
",",
"double",
"rand2",
",",
"double",
"[",
"]",
"globalBest",
")",
"{",
"for",
"(",
"int",
"i",
"=",
"0",
";",
"i",
"<"... | Particle swarming formula to update positions.
@param w inertia weight (controls the impact of the past velocity of the
particle over the current one).
@param c1 constant weighting the influence of local best
solutions.
@param rand1 random factor introduced in search process.
@param c2 constant weighting the influence... | [
"Particle",
"swarming",
"formula",
"to",
"update",
"positions",
"."
] | d2b436bbdf951dc1fda56096a42dbc0eae4d35a5 | https://github.com/TheHortonMachine/hortonmachine/blob/d2b436bbdf951dc1fda56096a42dbc0eae4d35a5/gears/src/main/java/org/hortonmachine/gears/utils/optimizers/particleswarm/Particle.java#L122-L173 | train |
TheHortonMachine/hortonmachine | gears/src/main/java/org/hortonmachine/gears/utils/optimizers/particleswarm/Particle.java | Particle.setParticleLocalBeststoCurrent | public void setParticleLocalBeststoCurrent() {
for( int i = 0; i < locations.length; i++ ) {
particleLocalBests[i] = locations[i];
}
} | java | public void setParticleLocalBeststoCurrent() {
for( int i = 0; i < locations.length; i++ ) {
particleLocalBests[i] = locations[i];
}
} | [
"public",
"void",
"setParticleLocalBeststoCurrent",
"(",
")",
"{",
"for",
"(",
"int",
"i",
"=",
"0",
";",
"i",
"<",
"locations",
".",
"length",
";",
"i",
"++",
")",
"{",
"particleLocalBests",
"[",
"i",
"]",
"=",
"locations",
"[",
"i",
"]",
";",
"}",
... | Setter to set the current positions to be the local best positions. | [
"Setter",
"to",
"set",
"the",
"current",
"positions",
"to",
"be",
"the",
"local",
"best",
"positions",
"."
] | d2b436bbdf951dc1fda56096a42dbc0eae4d35a5 | https://github.com/TheHortonMachine/hortonmachine/blob/d2b436bbdf951dc1fda56096a42dbc0eae4d35a5/gears/src/main/java/org/hortonmachine/gears/utils/optimizers/particleswarm/Particle.java#L196-L200 | train |
TheHortonMachine/hortonmachine | gui/src/main/java/org/hortonmachine/gui/utils/GuiUtilities.java | GuiUtilities.getLastFile | public static File getLastFile() {
Preferences preferences = Preferences.userRoot().node(GuiBridgeHandler.PREFS_NODE_NAME);
String userHome = System.getProperty("user.home");
String lastPath = preferences.get(LAST_PATH, userHome);
File file = new File(lastPath);
if (!file.exists... | java | public static File getLastFile() {
Preferences preferences = Preferences.userRoot().node(GuiBridgeHandler.PREFS_NODE_NAME);
String userHome = System.getProperty("user.home");
String lastPath = preferences.get(LAST_PATH, userHome);
File file = new File(lastPath);
if (!file.exists... | [
"public",
"static",
"File",
"getLastFile",
"(",
")",
"{",
"Preferences",
"preferences",
"=",
"Preferences",
".",
"userRoot",
"(",
")",
".",
"node",
"(",
"GuiBridgeHandler",
".",
"PREFS_NODE_NAME",
")",
";",
"String",
"userHome",
"=",
"System",
".",
"getPropert... | Handle the last set path preference.
@return the last set path or the user home. | [
"Handle",
"the",
"last",
"set",
"path",
"preference",
"."
] | d2b436bbdf951dc1fda56096a42dbc0eae4d35a5 | https://github.com/TheHortonMachine/hortonmachine/blob/d2b436bbdf951dc1fda56096a42dbc0eae4d35a5/gui/src/main/java/org/hortonmachine/gui/utils/GuiUtilities.java#L115-L125 | train |
TheHortonMachine/hortonmachine | gui/src/main/java/org/hortonmachine/gui/utils/GuiUtilities.java | GuiUtilities.setLastPath | public static void setLastPath( String lastPath ) {
File file = new File(lastPath);
if (!file.isDirectory()) {
lastPath = file.getParentFile().getAbsolutePath();
}
Preferences preferences = Preferences.userRoot().node(GuiBridgeHandler.PREFS_NODE_NAME);
preferences.put... | java | public static void setLastPath( String lastPath ) {
File file = new File(lastPath);
if (!file.isDirectory()) {
lastPath = file.getParentFile().getAbsolutePath();
}
Preferences preferences = Preferences.userRoot().node(GuiBridgeHandler.PREFS_NODE_NAME);
preferences.put... | [
"public",
"static",
"void",
"setLastPath",
"(",
"String",
"lastPath",
")",
"{",
"File",
"file",
"=",
"new",
"File",
"(",
"lastPath",
")",
";",
"if",
"(",
"!",
"file",
".",
"isDirectory",
"(",
")",
")",
"{",
"lastPath",
"=",
"file",
".",
"getParentFile"... | Save the passed path as last path available.
@param lastPath
the last path to save. | [
"Save",
"the",
"passed",
"path",
"as",
"last",
"path",
"available",
"."
] | d2b436bbdf951dc1fda56096a42dbc0eae4d35a5 | https://github.com/TheHortonMachine/hortonmachine/blob/d2b436bbdf951dc1fda56096a42dbc0eae4d35a5/gui/src/main/java/org/hortonmachine/gui/utils/GuiUtilities.java#L133-L140 | train |
TheHortonMachine/hortonmachine | gui/src/main/java/org/hortonmachine/gui/utils/GuiUtilities.java | GuiUtilities.setPreference | public static void setPreference( String preferenceKey, String value ) {
if (preferencesDb != null) {
preferencesDb.setPreference(preferenceKey, value);
return;
}
Preferences preferences = Preferences.userRoot().node(GuiBridgeHandler.PREFS_NODE_NAME);
if (value !... | java | public static void setPreference( String preferenceKey, String value ) {
if (preferencesDb != null) {
preferencesDb.setPreference(preferenceKey, value);
return;
}
Preferences preferences = Preferences.userRoot().node(GuiBridgeHandler.PREFS_NODE_NAME);
if (value !... | [
"public",
"static",
"void",
"setPreference",
"(",
"String",
"preferenceKey",
",",
"String",
"value",
")",
"{",
"if",
"(",
"preferencesDb",
"!=",
"null",
")",
"{",
"preferencesDb",
".",
"setPreference",
"(",
"preferenceKey",
",",
"value",
")",
";",
"return",
... | Set a preference.
@param preferenceKey
the preference key.
@param value
the value to set. | [
"Set",
"a",
"preference",
"."
] | d2b436bbdf951dc1fda56096a42dbc0eae4d35a5 | https://github.com/TheHortonMachine/hortonmachine/blob/d2b436bbdf951dc1fda56096a42dbc0eae4d35a5/gui/src/main/java/org/hortonmachine/gui/utils/GuiUtilities.java#L187-L199 | train |
TheHortonMachine/hortonmachine | gui/src/main/java/org/hortonmachine/gui/utils/GuiUtilities.java | GuiUtilities.showMultiInputDialog | @SuppressWarnings({"unchecked", "rawtypes"})
public static String[] showMultiInputDialog( Component parentComponent, String title, String[] labels, String[] defaultValues,
HashMap<String, String[]> fields2ValuesMap ) {
Component[] valuesFields = new Component[labels.length];
JPanel panel... | java | @SuppressWarnings({"unchecked", "rawtypes"})
public static String[] showMultiInputDialog( Component parentComponent, String title, String[] labels, String[] defaultValues,
HashMap<String, String[]> fields2ValuesMap ) {
Component[] valuesFields = new Component[labels.length];
JPanel panel... | [
"@",
"SuppressWarnings",
"(",
"{",
"\"unchecked\"",
",",
"\"rawtypes\"",
"}",
")",
"public",
"static",
"String",
"[",
"]",
"showMultiInputDialog",
"(",
"Component",
"parentComponent",
",",
"String",
"title",
",",
"String",
"[",
"]",
"labels",
",",
"String",
"[... | Create a simple multi input pane, that returns what the use inserts.
@param parentComponent
@param title
the dialog title.
@param labels
the labels to set.
@param defaultValues
a set of default values.
@param fields2ValuesMap a map that allows to set combos for the various options.
@return the result inserted by the u... | [
"Create",
"a",
"simple",
"multi",
"input",
"pane",
"that",
"returns",
"what",
"the",
"use",
"inserts",
"."
] | d2b436bbdf951dc1fda56096a42dbc0eae4d35a5 | https://github.com/TheHortonMachine/hortonmachine/blob/d2b436bbdf951dc1fda56096a42dbc0eae4d35a5/gui/src/main/java/org/hortonmachine/gui/utils/GuiUtilities.java#L315-L365 | train |
TheHortonMachine/hortonmachine | gui/src/main/java/org/hortonmachine/gui/utils/GuiUtilities.java | GuiUtilities.colorButton | public static void colorButton( JButton button, Color color, Integer size ) {
if (size == null)
size = 15;
BufferedImage bi = new BufferedImage(size, size, BufferedImage.TYPE_INT_RGB);
Graphics2D gr = (Graphics2D) bi.getGraphics();
gr.setColor(color);
gr.fillRect(0, 0... | java | public static void colorButton( JButton button, Color color, Integer size ) {
if (size == null)
size = 15;
BufferedImage bi = new BufferedImage(size, size, BufferedImage.TYPE_INT_RGB);
Graphics2D gr = (Graphics2D) bi.getGraphics();
gr.setColor(color);
gr.fillRect(0, 0... | [
"public",
"static",
"void",
"colorButton",
"(",
"JButton",
"button",
",",
"Color",
"color",
",",
"Integer",
"size",
")",
"{",
"if",
"(",
"size",
"==",
"null",
")",
"size",
"=",
"15",
";",
"BufferedImage",
"bi",
"=",
"new",
"BufferedImage",
"(",
"size",
... | Create an image to make a color picker button.
@param button the button.
@param color the color to set.
@param size the optional size of the image. | [
"Create",
"an",
"image",
"to",
"make",
"a",
"color",
"picker",
"button",
"."
] | d2b436bbdf951dc1fda56096a42dbc0eae4d35a5 | https://github.com/TheHortonMachine/hortonmachine/blob/d2b436bbdf951dc1fda56096a42dbc0eae4d35a5/gui/src/main/java/org/hortonmachine/gui/utils/GuiUtilities.java#L484-L494 | train |
TheHortonMachine/hortonmachine | gui/src/main/java/org/hortonmachine/gui/utils/GuiUtilities.java | GuiUtilities.setFileBrowsingOnWidgets | public static void setFileBrowsingOnWidgets( JTextField pathTextField, JButton browseButton, String[] allowedExtensions,
Runnable postRunnable ) {
FileFilter filter = null;
if (allowedExtensions != null) {
filter = new FileFilter(){
@Override
publ... | java | public static void setFileBrowsingOnWidgets( JTextField pathTextField, JButton browseButton, String[] allowedExtensions,
Runnable postRunnable ) {
FileFilter filter = null;
if (allowedExtensions != null) {
filter = new FileFilter(){
@Override
publ... | [
"public",
"static",
"void",
"setFileBrowsingOnWidgets",
"(",
"JTextField",
"pathTextField",
",",
"JButton",
"browseButton",
",",
"String",
"[",
"]",
"allowedExtensions",
",",
"Runnable",
"postRunnable",
")",
"{",
"FileFilter",
"filter",
"=",
"null",
";",
"if",
"("... | Adds to a textfield and button the necessary to browse for a file.
@param pathTextField
@param browseButton
@param allowedExtensions | [
"Adds",
"to",
"a",
"textfield",
"and",
"button",
"the",
"necessary",
"to",
"browse",
"for",
"a",
"file",
"."
] | d2b436bbdf951dc1fda56096a42dbc0eae4d35a5 | https://github.com/TheHortonMachine/hortonmachine/blob/d2b436bbdf951dc1fda56096a42dbc0eae4d35a5/gui/src/main/java/org/hortonmachine/gui/utils/GuiUtilities.java#L503-L542 | train |
TheHortonMachine/hortonmachine | gui/src/main/java/org/hortonmachine/gui/utils/GuiUtilities.java | GuiUtilities.setFolderBrowsingOnWidgets | public static void setFolderBrowsingOnWidgets( JTextField pathTextField, JButton browseButton ) {
browseButton.addActionListener(e -> {
File lastFile = GuiUtilities.getLastFile();
File[] res = showOpenFolderDialog(browseButton, "Select folder", false, lastFile);
if (res != nu... | java | public static void setFolderBrowsingOnWidgets( JTextField pathTextField, JButton browseButton ) {
browseButton.addActionListener(e -> {
File lastFile = GuiUtilities.getLastFile();
File[] res = showOpenFolderDialog(browseButton, "Select folder", false, lastFile);
if (res != nu... | [
"public",
"static",
"void",
"setFolderBrowsingOnWidgets",
"(",
"JTextField",
"pathTextField",
",",
"JButton",
"browseButton",
")",
"{",
"browseButton",
".",
"addActionListener",
"(",
"e",
"->",
"{",
"File",
"lastFile",
"=",
"GuiUtilities",
".",
"getLastFile",
"(",
... | Adds to a textfield and button the necessary to browse for a folder.
@param pathTextField
@param browseButton | [
"Adds",
"to",
"a",
"textfield",
"and",
"button",
"the",
"necessary",
"to",
"browse",
"for",
"a",
"folder",
"."
] | d2b436bbdf951dc1fda56096a42dbc0eae4d35a5 | https://github.com/TheHortonMachine/hortonmachine/blob/d2b436bbdf951dc1fda56096a42dbc0eae4d35a5/gui/src/main/java/org/hortonmachine/gui/utils/GuiUtilities.java#L550-L560 | train |
TheHortonMachine/hortonmachine | hmachine/src/main/java/org/hortonmachine/hmachine/modules/geomorphology/curvatures/OmsCurvaturesBivariate.java | OmsCurvaturesBivariate.calculateParameters | private static double[] calculateParameters( final double[][] elevationValues ) {
int rows = elevationValues.length;
int cols = elevationValues[0].length;
int pointsNum = rows * cols;
final double[][] xyMatrix = new double[pointsNum][6];
final double[] valueArray = new double[po... | java | private static double[] calculateParameters( final double[][] elevationValues ) {
int rows = elevationValues.length;
int cols = elevationValues[0].length;
int pointsNum = rows * cols;
final double[][] xyMatrix = new double[pointsNum][6];
final double[] valueArray = new double[po... | [
"private",
"static",
"double",
"[",
"]",
"calculateParameters",
"(",
"final",
"double",
"[",
"]",
"[",
"]",
"elevationValues",
")",
"{",
"int",
"rows",
"=",
"elevationValues",
".",
"length",
";",
"int",
"cols",
"=",
"elevationValues",
"[",
"0",
"]",
".",
... | Calculates the parameters of a bivariate quadratic equation.
@param elevationValues the window of points to use.
@return the parameters of the bivariate quadratic equation as [a, b, c, d, e, f] | [
"Calculates",
"the",
"parameters",
"of",
"a",
"bivariate",
"quadratic",
"equation",
"."
] | d2b436bbdf951dc1fda56096a42dbc0eae4d35a5 | https://github.com/TheHortonMachine/hortonmachine/blob/d2b436bbdf951dc1fda56096a42dbc0eae4d35a5/hmachine/src/main/java/org/hortonmachine/hmachine/modules/geomorphology/curvatures/OmsCurvaturesBivariate.java#L230-L262 | train |
TheHortonMachine/hortonmachine | dbs/src/main/java/jsqlite/Stmt.java | Stmt.column | public Object column(int col) throws jsqlite.Exception {
switch (column_type(col)) {
case Constants.SQLITE_INTEGER:
return new Long(column_long(col));
case Constants.SQLITE_FLOAT:
return new Double(column_double(col));
case Constants.SQLITE_BLOB:
return column_bytes(col);
case Constants.SQLITE3_TEXT... | java | public Object column(int col) throws jsqlite.Exception {
switch (column_type(col)) {
case Constants.SQLITE_INTEGER:
return new Long(column_long(col));
case Constants.SQLITE_FLOAT:
return new Double(column_double(col));
case Constants.SQLITE_BLOB:
return column_bytes(col);
case Constants.SQLITE3_TEXT... | [
"public",
"Object",
"column",
"(",
"int",
"col",
")",
"throws",
"jsqlite",
".",
"Exception",
"{",
"switch",
"(",
"column_type",
"(",
"col",
")",
")",
"{",
"case",
"Constants",
".",
"SQLITE_INTEGER",
":",
"return",
"new",
"Long",
"(",
"column_long",
"(",
... | Retrieve column data as object from exec'ed SQLite3 statement.
@param col column number, 0-based
@return Object or null | [
"Retrieve",
"column",
"data",
"as",
"object",
"from",
"exec",
"ed",
"SQLite3",
"statement",
"."
] | d2b436bbdf951dc1fda56096a42dbc0eae4d35a5 | https://github.com/TheHortonMachine/hortonmachine/blob/d2b436bbdf951dc1fda56096a42dbc0eae4d35a5/dbs/src/main/java/jsqlite/Stmt.java#L227-L239 | train |
TheHortonMachine/hortonmachine | gears/src/main/java/org/hortonmachine/gears/libs/modules/multiprocessing/GridMultiProcessing.java | GridMultiProcessing.processGrid | protected void processGrid( int cols, int rows, boolean ignoreBorder, Calculator calculator ) throws Exception {
ExecutionPlanner planner = createDefaultPlanner();
planner.setNumberOfTasks(rows * cols);
int startC = 0;
int startR = 0;
int endC = cols;
int endR = rows;
... | java | protected void processGrid( int cols, int rows, boolean ignoreBorder, Calculator calculator ) throws Exception {
ExecutionPlanner planner = createDefaultPlanner();
planner.setNumberOfTasks(rows * cols);
int startC = 0;
int startR = 0;
int endC = cols;
int endR = rows;
... | [
"protected",
"void",
"processGrid",
"(",
"int",
"cols",
",",
"int",
"rows",
",",
"boolean",
"ignoreBorder",
",",
"Calculator",
"calculator",
")",
"throws",
"Exception",
"{",
"ExecutionPlanner",
"planner",
"=",
"createDefaultPlanner",
"(",
")",
";",
"planner",
".... | Loops through all rows and cols of the given grid. | [
"Loops",
"through",
"all",
"rows",
"and",
"cols",
"of",
"the",
"given",
"grid",
"."
] | d2b436bbdf951dc1fda56096a42dbc0eae4d35a5 | https://github.com/TheHortonMachine/hortonmachine/blob/d2b436bbdf951dc1fda56096a42dbc0eae4d35a5/gears/src/main/java/org/hortonmachine/gears/libs/modules/multiprocessing/GridMultiProcessing.java#L33-L58 | train |
TheHortonMachine/hortonmachine | hmachine/src/main/java/org/hortonmachine/hmachine/modules/hydrogeomorphology/lwrecruitment/NetIndexComparator.java | NetIndexComparator.compare | @Override
public int compare( SimpleFeature f1, SimpleFeature f2 ) {
int linkid1 = (Integer) f1.getAttribute(LINKID);
int linkid2 = (Integer) f2.getAttribute(LINKID);
if (linkid1 < linkid2) {
return -1;
} else if (linkid1 > linkid2) {
return 1;
} else... | java | @Override
public int compare( SimpleFeature f1, SimpleFeature f2 ) {
int linkid1 = (Integer) f1.getAttribute(LINKID);
int linkid2 = (Integer) f2.getAttribute(LINKID);
if (linkid1 < linkid2) {
return -1;
} else if (linkid1 > linkid2) {
return 1;
} else... | [
"@",
"Override",
"public",
"int",
"compare",
"(",
"SimpleFeature",
"f1",
",",
"SimpleFeature",
"f2",
")",
"{",
"int",
"linkid1",
"=",
"(",
"Integer",
")",
"f1",
".",
"getAttribute",
"(",
"LINKID",
")",
";",
"int",
"linkid2",
"=",
"(",
"Integer",
")",
"... | establish the position of each net point respect to the others | [
"establish",
"the",
"position",
"of",
"each",
"net",
"point",
"respect",
"to",
"the",
"others"
] | d2b436bbdf951dc1fda56096a42dbc0eae4d35a5 | https://github.com/TheHortonMachine/hortonmachine/blob/d2b436bbdf951dc1fda56096a42dbc0eae4d35a5/hmachine/src/main/java/org/hortonmachine/hmachine/modules/hydrogeomorphology/lwrecruitment/NetIndexComparator.java#L28-L40 | train |
TheHortonMachine/hortonmachine | gears/src/main/java/org/hortonmachine/gears/utils/colors/ColorUtilities.java | ColorUtilities.colorFromRbgString | public static Color colorFromRbgString( String rbgString ) {
String[] split = rbgString.split(",");
if (split.length < 3 || split.length > 4) {
throw new IllegalArgumentException("Color string has to be of type r,g,b.");
}
int r = (int) Double.parseDouble(split[0].trim());
... | java | public static Color colorFromRbgString( String rbgString ) {
String[] split = rbgString.split(",");
if (split.length < 3 || split.length > 4) {
throw new IllegalArgumentException("Color string has to be of type r,g,b.");
}
int r = (int) Double.parseDouble(split[0].trim());
... | [
"public",
"static",
"Color",
"colorFromRbgString",
"(",
"String",
"rbgString",
")",
"{",
"String",
"[",
"]",
"split",
"=",
"rbgString",
".",
"split",
"(",
"\",\"",
")",
";",
"if",
"(",
"split",
".",
"length",
"<",
"3",
"||",
"split",
".",
"length",
">"... | Converts a color string.
@param rbgString the string in the form "r,g,b,a" as integer values between 0 and 255.
@return the {@link Color}. | [
"Converts",
"a",
"color",
"string",
"."
] | d2b436bbdf951dc1fda56096a42dbc0eae4d35a5 | https://github.com/TheHortonMachine/hortonmachine/blob/d2b436bbdf951dc1fda56096a42dbc0eae4d35a5/gears/src/main/java/org/hortonmachine/gears/utils/colors/ColorUtilities.java#L37-L55 | train |
TheHortonMachine/hortonmachine | gears/src/main/java/org/hortonmachine/gears/utils/colors/ColorUtilities.java | ColorUtilities.fromHex | public static Color fromHex( String hex ) {
if (hex.startsWith("#")) {
hex = hex.substring(1);
}
int length = hex.length();
int total = 6;
if (length < total) {
// we have a shortened version
String token = hex;
int tokenLength = to... | java | public static Color fromHex( String hex ) {
if (hex.startsWith("#")) {
hex = hex.substring(1);
}
int length = hex.length();
int total = 6;
if (length < total) {
// we have a shortened version
String token = hex;
int tokenLength = to... | [
"public",
"static",
"Color",
"fromHex",
"(",
"String",
"hex",
")",
"{",
"if",
"(",
"hex",
".",
"startsWith",
"(",
"\"#\"",
")",
")",
"{",
"hex",
"=",
"hex",
".",
"substring",
"(",
"1",
")",
";",
"}",
"int",
"length",
"=",
"hex",
".",
"length",
"(... | Convert hex color to Color.
@return the Color object. | [
"Convert",
"hex",
"color",
"to",
"Color",
"."
] | d2b436bbdf951dc1fda56096a42dbc0eae4d35a5 | https://github.com/TheHortonMachine/hortonmachine/blob/d2b436bbdf951dc1fda56096a42dbc0eae4d35a5/gears/src/main/java/org/hortonmachine/gears/utils/colors/ColorUtilities.java#L93-L113 | train |
TheHortonMachine/hortonmachine | gears/src/main/java/org/hortonmachine/gears/libs/modules/FlowNode.java | FlowNode.getFlowAt | public int getFlowAt( Direction direction ) {
switch( direction ) {
case E:
return eFlow;
case W:
return wFlow;
case N:
return nFlow;
case S:
return sFlow;
case EN:
return enFlow;
case NW:
ret... | java | public int getFlowAt( Direction direction ) {
switch( direction ) {
case E:
return eFlow;
case W:
return wFlow;
case N:
return nFlow;
case S:
return sFlow;
case EN:
return enFlow;
case NW:
ret... | [
"public",
"int",
"getFlowAt",
"(",
"Direction",
"direction",
")",
"{",
"switch",
"(",
"direction",
")",
"{",
"case",
"E",
":",
"return",
"eFlow",
";",
"case",
"W",
":",
"return",
"wFlow",
";",
"case",
"N",
":",
"return",
"nFlow",
";",
"case",
"S",
":... | Get the value of the flow in one of the surrounding direction.
@param direction the {@link Direction}.
@return the flow value. | [
"Get",
"the",
"value",
"of",
"the",
"flow",
"in",
"one",
"of",
"the",
"surrounding",
"direction",
"."
] | d2b436bbdf951dc1fda56096a42dbc0eae4d35a5 | https://github.com/TheHortonMachine/hortonmachine/blob/d2b436bbdf951dc1fda56096a42dbc0eae4d35a5/gears/src/main/java/org/hortonmachine/gears/libs/modules/FlowNode.java#L205-L226 | train |
TheHortonMachine/hortonmachine | gears/src/main/java/org/hortonmachine/gears/libs/modules/FlowNode.java | FlowNode.goDownstream | public FlowNode goDownstream() {
if (isValid) {
Direction direction = Direction.forFlow(flow);
if (direction != null) {
FlowNode nextNode = new FlowNode(gridIter, cols, rows, col + direction.col, row + direction.row);
if (nextNode.isValid) {
... | java | public FlowNode goDownstream() {
if (isValid) {
Direction direction = Direction.forFlow(flow);
if (direction != null) {
FlowNode nextNode = new FlowNode(gridIter, cols, rows, col + direction.col, row + direction.row);
if (nextNode.isValid) {
... | [
"public",
"FlowNode",
"goDownstream",
"(",
")",
"{",
"if",
"(",
"isValid",
")",
"{",
"Direction",
"direction",
"=",
"Direction",
".",
"forFlow",
"(",
"flow",
")",
";",
"if",
"(",
"direction",
"!=",
"null",
")",
"{",
"FlowNode",
"nextNode",
"=",
"new",
... | Get the next downstream node.
@return the next downstream node or <code>null</code> if the end has been reached. | [
"Get",
"the",
"next",
"downstream",
"node",
"."
] | d2b436bbdf951dc1fda56096a42dbc0eae4d35a5 | https://github.com/TheHortonMachine/hortonmachine/blob/d2b436bbdf951dc1fda56096a42dbc0eae4d35a5/gears/src/main/java/org/hortonmachine/gears/libs/modules/FlowNode.java#L233-L244 | train |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.