All posts in 'Shortcuts'

Division by zero

26-May-08

Just a quick reminder for myself: int a = 0/0; // Throws ArithmeticException double d1 = 0/0.0; // d1 is NaN double d2 = 1/0.0; // d2 is Infinity double d3 = -1/0.0; // d3 is -Infinityint a = 0/0; // Throws ArithmeticException double d1 = 0/0.0; // d1 is NaN double d2 = 1/0.0; […]

Read the complete article »

Ampersands and XHTML

25-May-08

A regular expression to replace all ampersands (&) in a text that are not part of an entity: t = t.gsub(/&(?!#?\w+;)/, ‘&’)t = t.gsub(/&(?!#?\w+;)/, ‘&’) Language is ruby. The regexp feature used is called a negative lookahead.

Read the complete article »

Handle EXIF data with ruby (and style…)

09-Mar-08

I use rmagick when it comes to deal with images. I’m not that disappointed like Zed Shaw with rmagick (but Zed is totally right when he points out on page 4: “[…] and is difficult to install (unless your computer is nearly exactly the same as the author’s).”), but when it comes to deal with […]

Read the complete article »

Weird java generics…

07-Feb-08

Generics are not totally bad but one can write really creepy things: final FutureTask<Collection<LeitungsachseTK25>[]> ft = new FutureTask<Collection<LeitungsachseTK25>[]>( new Callable<Collection<LeitungsachseTK25>[]>() { public Collection<LeitungsachseTK25>[] call() throws Exception {final FutureTask<Collection<LeitungsachseTK25>[]> ft = new FutureTask<Collection<LeitungsachseTK25>[]>( new Callable<Collection<LeitungsachseTK25>[]>() { public Collection<LeitungsachseTK25>[] call() throws Exception { Seems like XML and Java finally married… 😉

Read the complete article »

Notes on RedHat / Oracle Enterprise Linux, ADS und Samba

17-Jan-08

Recently i needed windows clients to access a directory on the database server from which CLOBs where created. Since the server is an Oracle Enterprise Linux, i could follow the steps explained behind the following link to get Samba up and running with the Active Directory run by a Windows 2k3 server: Which steps must […]

Read the complete article »