Windows – Tips

October 5th, 2009

Networking Error

http://www.chr.at/blog/2007/11/05/windows-fuer-diesen-befehl-ist-nicht-genuegend-serverspeicher-verfuegbar/

Address 
Radius
Enter Your Address or Zip Code Above.

Number Precision for IO in Matlab

September 16th, 2009

By default matlab number format precision is set to 5 digits only. Together with the E notation and a wide value range this may cause numbers to be unreadable.  Use format long g for 15 digit precision

http://www.math.uic.edu/~hanson/MATLAB/MATLABformat.html

Java Application Settings and System Properties

April 7th, 2009

use System.getProperty() and for loading and persisting Java Properties java.util.Properties

Matlab and Java Tips

December 10th, 2008


Oscilliscope for Matlab (not Simulink)

http://www.oscilloscope-lib.com/

Using Java in Matlab
Attention to various settings when using Java in Matlab.

  • Java Version – Matlab 7.0 e.g. needs Java byte code compiled with 1.4. To get the Matlab VM Version use version -java
  • To find the *.jar or *.class in Matlab use which classpath.txt and edit classpath.txt This settings is read once on Matlab startup.
  • JNI DLL Reference – For using Java Native Interface the compiled Native.dll needs to be referenced in Matlab too. Use edit librarypath.txt to add to the library path. This settings is read once on Matlab startup.

Common pitfall when using Java Code in Matlab

  • Especially arrays work different index in Matlab starts with 1, see here
  • java.lang.float == Double in Matlab – For a float[] array i needed to convert the value with double(float x) else i did not get a valid value for computation. Some of this is explained here.
  • Read input without wait from the keyboard in Matlabs main thread, here and see the related tutorial.
  • There is even a good blog for Matlab related tasks and problems

Java and Ant with Visual Studio Compiler

November 18th, 2008

Although JAVA_HOME is pointing to the JDK, the problem with the ant task javac is that the javac command in tools.jar in %JDK%/lib is not found. Either copy tools.jar or do some registry change.
http://forums.sun.com/thread.jspa?threadID=556816

CPP Compiletask in Ant involves following settings (XML Code):








Visual Studio Environment Variables
Problems involving environment variables with the command line Visual Studio Compiler cl.exe can be found here. These must be set:

vs2005 c:\program files\microsoft visual studio 8\
psdk c:\program files\microsoft platform sdk\

First, go to vs2005 install path c:\program files\microsoft visual studio 8\vc, run vcvarsall.bat to set environment variable; then c:\program files\microsoft platform sdk\, run setenv command: eg: setenv /SRV32 /DEBUG. I use it to make the program work properly.

Using C:\Programme\Microsoft Visual Studio 8\VC\vcvarsall.bat adds the following to the PATH Var
c:\Programme\Microsoft Visual Studio 8\Common7\IDE
c:\Programme\Microsoft Visual Studio 8\VC\BIN
c:\Programme\Microsoft Visual Studio 8\Common7\Tools
c:\Programme\Microsoft Visual Studio 8\Common7\Tools\bin
c:\Programme\Microsoft Visual Studio 8\VC\PlatformSDK\bin
c:\Programme\Microsoft Visual Studio 8\SDK\v2.0\bin
c:\WINDOWS\Microsoft.NET\Framework\v2.0.50727
c:\Programme\Microsoft Visual Studio 8\VC\VCPackages

JNI – Calls between Win32 and Java

October 23rd, 2008

JNI Native Tutorial

JNI is a decent way to communicate between the WIn32 World and Javas Virtual Machine for self-written programs. However since DLLs with Java is mostly needed for interfacing third party Libraries a JNI dll wrapper is needed that requires an additional c compiling step.

So to use https://jna.dev.java.net/

Windows Tips

October 2nd, 2008

Change User Settings (Benutzerkonfiguration)
Type gpedit.msc in commandline

Change default Save Places of all Apps

http://www.raymond.cc/blog/archives/2008/02/29/how-to-change-windows-default-save-as-or-open-location/de/

Windows Useful commands

rerusively rename folder and files (also works with files like *.c –> *.cpp)
for /r %x in (metadata) do ren “%x” m

Recursively delete folder
1) FOR /F “tokens=*” %%G IN (‘DIR /B /AD /S *.svn*’) DO RMDIR /S /Q “%%G”
2) rmdir c:\test\ “garbage” -s – q
3.) for /f “usebackq” %d in (`”dir *.svn /ad/b/s”`) do rd /s/q “%d”

Books

October 2nd, 2008

Martin Fowler
UML Modelling

Algorithmen und Datenstrukturen (Pomberger, Dobler)

http://www.amazon.de/Algorithmen-Datenstrukturen-systematische-Einf%C3%BChrung-Programmierung/dp/3827372682/ref=sr_1_1?ie=UTF8&s=books&qid=1222930364&sr=8-1

Design Patterns (Gamma et al.)

http://www.amazon.com/Design-Patterns-Object-Oriented-Addison-Wesley-Professional/dp/0201633612/ref=pd_bbs_1?ie=UTF8&s=books&qid=1222930552&sr=8-1

UML Distilled (Martin Fowler)

http://www.amazon.de/UML-Distilled-Languange-Addison-Wesley-Technology/dp/0321193687/ref=sr_1_1?ie=UTF8&s=books-intl-de&qid=1222930741&sr=8-1

Head First Design Patterns (Head First)

http://www.amazon.com/Head-First-Design-Patterns/dp/0596007124/ref=pd_bbs_2?ie=UTF8&s=books&qid=1222930552&sr=8-2

Office – Excel – Word Tipps

September 25th, 2008

Einfügen von Smart Objects
(zBsp editierbare Excel Worksheets) mit STRG+C in Excel kopieren und in Word mit dem Button Einfügen -> als Excel Diagramm auswählen. Der gesamte Worksheet inklusive der Tabellen wird als Vektorgrafik hinterlegt

Mehrere Ebenen Nummrierung für Formatvorlagen in Word 2007

http://www.microsoft.com/communities/newsgroups/en-us/default.aspx?dg=microsoft.public.de.word&tid=ff4c691c-1dbd-44a5-bb47-1e2d0bd2fe6f&cat=&lang=&cr=&sloc=&p=1

Working with Date and Time in Java

August 12th, 2008

JODA is a very good API for working with DateTime paradigms in a much more comfortable way than the basic JDK functions do. See on Userfriendly for a good summary what JODA has to offer.

One good thing about JODA is its well organized Date and Time structures. For example from a Object with Time 19:33 you can getMinutes() == 33 or toStandardMinutes.getMinutes() == 19* 60 + 33 without having the conversion work. This works for all Years, Weeks, Month, Hours, Days, Minutes, Seconds, Milliseconds even the exceptions like differing february days every 4 years.

Formating Java Util Date (and TIme)
java.text.SimpleDateFormat dateFormatter = new java.text.SimpleDateFormat("HHmmssSSS");
String theFormattedTime = dateFormatter.format(new java.util.Date());