2012-06-14

Java Classes Fun Fact

java.lang.NoClassDefFoundError can be caused by runtime exception (i.e. NPE) in static initialization blocks or even variable initialization of class you are trying to use.

2012-02-09

Reading outlook .msg files under Linux

Got an email in format unreadable for your mail reader?
I always forget that there is great tool for doing just that: http://code.google.com/p/ruby-msg/

2012-01-07

Valgrind - "client switching stacks"

If you ever start to receiving following warning from Valgrind:
Warning: client switching stacks?
Followed by many error messages like "Invalid read/write" containing a note: "Address  is on thread 1's stack" then the cause is very simple. You are just allocating too large variables on stack - in my case I had too large array, as local variable, in one of functions. If you can't or don't want to use heap it is possible to tune valgrind with "--max-stackframe" parameter i.e.
valgrind --max-stackframe=10485760 ./a.out
This will prevent false positive detection  of stack switching up to 10MB.

One additional, much more obvious tip, use "-fno-inline" when building C++ binaries for use with valgrind, otherwise there won't be line numbers in stacktraces for any template functions.

2011-06-14

Subversion not working under Netbeans on fresh linux system

Simple and annoying bug. Solution: 
http://stackoverflow.com/questions/1679099/netbeans-subversion-authentication-failed