On Monday I willl receive my brand new Samsung Star mobile phone. This day will be the start of a new series of this blog about Samsung Widget Development! Stay tuned!
First information sources for this:
On Monday I willl receive my brand new Samsung Star mobile phone. This day will be the start of a new series of this blog about Samsung Widget Development! Stay tuned!
First information sources for this:
Using Cobertura 1.9.2 with JDK 1.6.0_14 raised the following exceptions:
Exception in thread "Thread-0" java.lang.ExceptionInInitializerError
at java.io.File.deleteOnExit(File.java:939)
at net.sourceforge.cobertura.util.FileLocker.
at net.sourceforge.cobertura.coveragedata.ProjectData.saveGlobalProjectData(ProjectData.java:230)
at net.sourceforge.cobertura.coveragedata.SaveTimer.run(SaveTimer.java:31)
at java.lang.Thread.run(Thread.java:619)
Caused by: java.lang.IllegalStateException: Shutdown in progress
at java.lang.Shutdown.add(Shutdown.java:62)
at java.lang.System$2.registerShutdownHook(System.java:1146)
at java.io.DeleteOnExitHook.
The newer versions of Cobertura fixed this issue!
Today i had to access a matlab script from a java program. After some hours of trying to get it work by using matlabs command line i found a method to call a matlab script without using the command line. Using matlab -r “functionName” didn’t work because of some unknown charset erros i haven’t found till now. The basic idea is based on this blog-post.
Therefore, a process must be created:
String command = "matlab -nosplash -nodesktop";
Process process = Runtime.getRuntime().exec(command);
Afterwards we obtain the standard-input of the process and send a command to be interpreted by matlab:
BufferedWriter out = new BufferedWriter(new OutputStreamWriter(process.getOutputStream()));
out.write("function_to_be_executed");
out.write("\n");
out.write("exit;") // this will close matlab after the execution finished!
If you like to see what is happening, try to read from the process.getInputStream()
hope that helps some of you!
Recent Comments