"Exposeè" on my Linux-Box

Nikolaus Gradwohl2007-01-27T20:23:00+00:00


I have used macos X for some time now and resently switched my main console back to linux.

No problem so far because most of the tools ive used in macos X where unix tools i knew from conding on linux - the only thing I realy missed was exposeè.

For this reason I gave compiz a try now

Installation was realy simple on my gentoo box all I had to do was emerge compiz and reemerge kde with the useflag "xcomposite" acvite

then add a

Section "Extensions"
    Option "Composite" "Enable"

at the end of xorg.conf and add

Option "AddARGBGLXVisuals" "True"

to the "Device" Section. This option is very important, because wihout it the kde-window-decorator doesnt draw any window headers.

after restarting X11 compiz can be started with


in a shell. To let it start automatically i have put a little shellscript in my .kde/Autostart folder. I also have deactivated the wobbly plugin. This is realy funny in the beginning but start getting REALY annoing very fast :-)

Compiz can be downloaded on their website (http://www.go-compiz.org). They also have some very nice tutorials showing how to install it on various systems

read more ...

the Future and Java 1.5

Nikolaus Gradwohl2007-01-21T11:09:00+00:00

Java 1.5 introduced a bunch of new classes for handling multithreaded programming. The one I realy like the most is Future.

With future its possible to start the calculation of something you know you will need at a later point in yout programm. When you reach that point you can call Future.get() to fetch the result of the calculation. If it is already avaliable the result is returned immediately, if the calculation is still running or has not started yet Future.get() blocks until the results are here.

one gets a future by submitting an object implementing Runnable or Callable to an ExecutorService. This is an interface that is implemented by ThreadPoolExecutor.

ExecutorService e = Executors.newSingleThreadExecutor();
Future<String> future = e.submit(callable);
String result = future.get();

This Class implements a queue and a threadpool. using ExecutorService.submit() you can put some Workload in an queue, from where the threads of the pool will fetch and execute them. the submit method returns an Future which can be used to fetch the results of the workload.

There are various preconfigured Threadpools available from Executors Class. For example

ExecutorService e = Executors.newSingleThreadExecutor(); 

creates a degenerated Threadpool using just one thread. This is very usefull if one has to garantee that no two instances of the submitted callable are executed at the same time. If you have to use an external service that is implemented by offering an api via webservice thats not threadsave beacause of a missing transaction handling, this SingleThreadExecutor can be used to serialize the requests comming from a webapplication. All the clientrequests can be spooled in the executor service but all the calls to the service api are strictly searialized.

Another very usefull class is

ExecutorService e = Executors.newCachedThreadPool()

this is what most people think of when they refere to a threadpool. The class generatets new threads if needed but reuses existing ones if they do idle. Threads that are not used for 60 seconds are removed from the pool.

ExecutorService e = Executors.newFixedThreadPool(n)

creates a Threadpool containing n threads. No new threads are generated an there also is no timeout. SingleThreadExecutor is an fixedThreadPool with n = 1.

I think the java.util.concurrent package is the one of the best things that got introduced with java 1.5.

read more ...

7 million an one

Nikolaus Gradwohl2006-09-16T18:40:00+00:00

so i have done it - ive started another blog :-)

read more ...