This is my blog in English, about the stuff I do for a living, and about the stuff I read about the stuff I do for a living - when I am not working.

Thursday, March 19, 2009

I learned a new thing today...

I finally understood what weak references are for:

http://weblogs.java.net/blog/enicholas/archive/2006/05/understanding_w.html

Simply put, the referenced object (by one of the reference classes) can be claimed by the garbage collector at any time, and you wouldn`t have that object anymore. Why the hell would I want to use that, then?

The answer is simply: caching.

By doing some hack around the class SoftReference, you could have a caching mechanism that would delete objects from the cache when the Java VM needs more memory. Instead of crashing, you would lose some objects from the cache, which would have to be obtained later, but no big deal - that`s just a small performance penalty.

I would like to have that knowledge 5 years ago. It would have been useful.

Friday, March 13, 2009

8 rules to discourage your employees

If you are committed to pissing off your employees, but can’t quite find the way to do so, you can follow these rules and achieve success...

read more | digg story

Monday, March 9, 2009

LINQ

Pretty interesting stuff.

Too bad I am not working with C# anymore :-(.

Thursday, March 5, 2009

Why does Google messes up with my iGoogle page?

Every now and then I open my homepage (which is an iGoogle page), and everything is messed up - ugly frames, ugly check-boxes, and now tabs on the side of the page instead of the top.

Is it beta, is it lab or is it just an annoyance?

EDIT: Add the gl=all parameter to your home page URL, such as in: http://www.google.com/ig?gl=all.

That should solve this annoyance.

Stack Overflow and the human developers

We are all human! We all like to be recognized.

In my humble opinion that's why Stack Overflow is such a huge success.

I am leaving, I am leaving

Today it's being announced that I am going to leave my current company to work on a different company. From Voice applications in Java using Eclipse to Corporate applications in Java using IntelliJ. It's going to be fine as well, closer to home, probably not as challenging as Voice but still a programming job with all the perks that it brings.

Wednesday, March 4, 2009

Maven with Eclipse, not anymore...

I am a happier person now. I've disabled Maven + Eclipse integration in my current Eclipse installation and I went a little bit further - I haven't installed the Maven plugin in my current Eclipse installation.

How is that possible? Here is the answer: http://maven.apache.org/plugins/maven-dependency-plugin/

I associated the plugin execution with the phase "validate" in Maven, so every time I run the targets "validate" or "generate-sources" (or with the compilation targets "compile" or "build"), all the maven dependencies are copied to an output folder inside the "target" folder. After that, I can add these copied dependencies statically to the Eclipse project from Eclipse. And here you go, no Maven + Eclipse integration is needed anymore.

Advantages:

. Eclipse works better - the ammount of annoyance generated by eclipse is directly related to the number of plugins that are installed on it;
. It's common that all the versions of a dependency are include in the classpath when running a project with Maven integration enabled - for example, commons-lang-2.1 and commons-lang-2.4. When the dependencies are copied to the target folder, only the resolved dependencies are copied (in that case, it probably will be commons-lang-2.4);
. Less heuristic, more deterministic - things magically start happening in the way there are supposed to.

Disadvantages:

. You have to remember to invoke the "mvn validate" or "mvn generate-sources" on the command-line before trying to compile your project inside Eclipse.

So far, it's paying off. I have way less bugs to worry about and a lot of "down-time" was saved after I started using Eclipse without Maven.

Eclipse for software development...

...is a good tool, but with a lot of bugs (particularly if using WTP).

I started playing with IntelliJ now - a good tool, but with a weird "feeling" after working for so many years with Visual Studio and Eclipse.

This is going to be...

... a blog of short posts about technical stuff and not much yada-yada-yada. I am not good at that.