Skip to content

Instantly share code, notes, and snippets.

View miho's full-sized avatar

Michael Hoffer miho

View GitHub Profile
package eu.mihosoft.vrl.user;
@ComponentInfo(name="HeatDiscretization1DTemplate", category="Custom")
public class HeatDiscretization1DTemplate implements java.io.Serializable {
private static final long serialVersionUID=1L;
@OutputInfo(name="Results:", style="multi-out",
elemTypes=[VectorRhsODEInterface.class, JacobianInputInterface.class, double[].class],
elemNames=["f", "Df", "u0"]
)
public Object[] discretize(
package eu.mihosoft.vrl.user;
import eu.mihosoft.vrl.user.VectorRhsODEInterface;
/**
* Explicit Euler Method
*/
@ComponentInfo(name="VectorExplicitEuler", category="ODE")
public class VectorExplicitEuler implements java.io.Serializable {
private static final long serialVersionUID=1L;
@miho
miho / virtualwall_irremote.pde
Created October 13, 2017 18:46 — forked from mschmitt/virtualwall_irremote.pde
A trivial Arduino sketch to mimic iRobot Virtual Wall for Roomba
/*
A trivial Arduino sketch to mimic iRobot Virtual Wall for Roomba
----------------------------------------------------------------
Based on information found at:
http://sites.google.com/site/irobotcreate2/createanirbeacon
Uses "A Multi-Protocol Infrared Remote Library for the Arduino":
http://www.arcfn.com/2009/08/multi-protocol-infrared-remote-library.html
@miho
miho / Send infrared commands from the Arduino to the iRobot Roomba
Created October 13, 2017 18:43 — forked from probonopd/Send infrared commands from the Arduino to the iRobot Roomba
Send infrared commands from the Arduino to the iRobot Roomba. Use a transistor to drive the IR LED from pin D3 for maximal range.
#include <IRremote.h>
/*
Send infrared commands from the Arduino to the iRobot Roomba
by probono
2013-03-17 Initial release
import java.nio.file.Files;
@ComponentInfo(name="SaveStringToFile", category="Custom")
public class SaveStringToFile implements java.io.Serializable {
private static final long serialVersionUID=1L;
// add your code here
public void saveStringTheJavaWay(String s, @ParamInfo(name="", style="save-dialog", options="") File f) {
Files.write(f.toPath(), s.getBytes()) // overwrite file if it exists
}
package eu.mihosoft.vrl.user;
@ComponentInfo(name="CSVReader", category="Custom")
public class CSVReader implements java.io.Serializable {
private static final long serialVersionUID=1L;
// ---- add your code here -----
public void plot(
@ParamInfo(name="CSV File", style="load-dialog", options="") File input,
@ParamInfo(name="Separator", options="value=\",\"") String sep,
@miho
miho / TangentLine.groovy
Last active May 30, 2017 07:08
VRL-Studio Component for plotting tangent lines
import edu.gcsc.vrl.jfreechart.TrajectoryPlotter;
import org.jfree.chart.JFreeChart;
@ComponentInfo(name="TangentLine", category="Custom")
public class TangentLine implements java.io.Serializable {
private static final long serialVersionUID=1L;
// plotter object
private transient TrajectoryPlotter plotter;
package eu.mihosoft.vrl.user;
@ComponentInfo(name="Dopri45Scheme", category="ODE")
public class Dopri45Scheme implements EmbeddedRKSchemeInterface, java.io.Serializable {
private static final long serialVersionUID=1L;
public double[] getC() {
// add your code
}
package eu.mihosoft.vrl.user;
import eu.mihosoft.vrl.user.VectorTrajectory;
@ComponentInfo(name="VectorTrajectoryToFile", category="JFreeChart")
public class VectorTrajectoryToFile implements java.io.Serializable {
private static final long serialVersionUID=1L;
public void toFile(
@ParamInfo(name="VectorTrajectory", style="default", options="") VectorTrajectory vt,
@ParamInfo(name="", style="save-dialog", options="") File file) {
file.newWriter().withWriter{w->
@miho
miho / VectorInput.groovy
Created November 19, 2016 22:36
Demonstrates how to develop a vector input component
package eu.mihosoft.vrl.user;
@ComponentInfo(name="VectorInput", category="ODE")
public class VectorInput implements java.io.Serializable {
private static final long serialVersionUID=1L;
// add your code here
@MethodInfo(name="", valueName="v", valueStyle="default", valueOptions="", hide=false)
public double[] vector(@ParamInfo(name="", style="array", options="") Double[] v) {
return v
}