Archive for October, 2006

Fluent Interfaces

October 26, 2006

company.hires(“law firm”, “criminal law”) was Alef’s example of a fluent interface. If you found it interesting here’s the link to Martin Fowler’s website where he talks about it.

The good way to configure Java in Ubunto

October 25, 2006

After I wrote the previous post, I found out I should not have configured Java like that. So after following some tips from the comments and from “Installing Sun’s Java environment in Debian systems” here is a better way to do it:

  • Go Repositories/Ubuntu where you will find information on how to add the “Universe” repository.
  • Open your Synaptic Package Manager and search for java-package. Mark for install and apply.
  • After downloading the JDK bin file, go to a terminal and type
  1. make-jpkg jre-1_5_0_03-linux-i586.bin
  2. sudo dpkg -i sun-j2sdk1.5_1.5.0+update09_i386.deb
  3. sudo update-alternatives –config java (here choose the one that points to the JDK you installed)
  4. sudo update-alternatives –config javac

This is a better way since it will take care of the system variables for every user (you can verify that java and javac are working on the console) and it will be easier to manage updates.

If you’re using Eclipse you need to update the Installed JREs in Window->Preferences->Java and add a new one that points to /usr/lib/j2sdk1.5-sun/ e.g..

Configuring Java in Ubuntu

October 25, 2006

Here is a simple way to configure Java in Ubunu Linux. After following these steps, commands like java and javac will be available in the terminal window.

  • Download the JDK and unpack it somewhere on your system. Let’s use /home/user/bin as an example.
  • Set the file you download to executable. You can do this by right-clicking the file, choose Properties->Permissions.
  • Excecute the file by double-clicking it and choose “Run in terminal” . Say yes a few times and you’re done.

Now you need to make Java available in the path so you can use it from any terminal.

  • Edit the file .bashrc under your home directory and add the following lines

export JAVA_HOME=/home/user/bin/jdk1.5.0_09

export PATH=$JAVA_HOME/bin:$PATH

  • Open a new terminal window and type java -version to make sure you’re running the java version you expected. Type env and verify that PATH variable contains the path to the JDK that you exported before.

Ubuntu on Dell Latitude D610

October 24, 2006

I installed Ubuntu 6.0.6 in my laptop last week and was getting nuts by a high pitched noise it made when it was idle. To get rid of this noise I had to edit the file /boot/grug/menu.lst and add pci=bios idle=halt acpi_sleep=s3_bios to the kernel line. So in the end it will look something like this:

kernel /boot/vmlinuz-2.6.15-27-386 root=/dev/sda1 ro pci=bios idle=halt acpi_sleep=s3_bios quiet splash

I think that consequently the laptop will spend more battery but at least it won’t drive me crazy! :P

Officially Java

October 23, 2006

Just to keep in the record (for myself :P ), I officially moved from the C++ team to the Java team! The last two weeks have been great. I’ve had the opportunity to attend really great sessions given by Alef Arendsen from Interface21:

  • Introduction to Java EE
  • Introduction to Spring
  • Spring Core

Although the training was mostly about Spring, Alef also talked about Unit Testing, EasyMock and Eclipse shortcut keys (very usefull)!

Deeplinking on EarthPOI

October 16, 2006

If you’re tired of making drawings to tell your friends where a certain place is, then you can use a new feature of EarthPOI called deeplinking. Simple send the link of your POI to your friends by email, or post it on your blog or website. You can find the link url on your POI details.

And because I don’t want you to think that lately I don’t write anything about Java, here is a deeplink to a Java historical fact.

EarthPOI releases IE compatibility

October 14, 2006

Good news for IE fans our there, since EarthPOI supports Internet Explorer as of today. :)

EarthPOI debuts in Ajaxian

October 12, 2006

EarthPOI has a dedicated article on Ajaxian! Hooray!

One of the comments to the article is about IE support, or “unsupport”, in this case. As I said previously we are working on this issue, and in the mean time if you want to browse happy install Firefox!

I want to say thanks to all my friends and all the other people out there supporting us!

October Books

October 12, 2006

Effective Java (amazon.co.uk)
by Josh Bloch

A must have!

(…) Bloch provides 57 items (did he reject “varieties”?) grouped by subject. Each item highlights a “gotcha”, expands on best practice or argues for deprecating a common practice. For example, among the gotchas, he points out problems with relying on finalisers, whose implementation varies from one JVM to another and may not run at all under some circumstances. (…)

Head First Design Patterns
by Elisabeth Freeman, Eric Freeman and Bert Bates (amazon.co.uk)

With all respect for the “Gang of Four” design patterns book (which is a must have), I also bought this one because it is simply a great read, with funny examples. Just the way you need to remember design patterns and how to use them.

At any given moment, somewhere in the world someone struggles with the same software design problems you have. You know you don’t want to reinvent the wheel (or worse, a flat tire), so you look to Design Patterns–the lessons learned by those who’ve faced the same problems. With Design Patterns, you get to take advantage of the best practices and experience of others, so that you can spend your time on…something else. Something more challenging. Something more complex. Something more fun. (…)

JFall was “OK”

October 11, 2006

The sessions I attended this time:

Sun Technical Demo Keynote: Unleash the power of Java
Reginald Hutcherson, Angela M. Caicedo & Simon Ritter

Very nice session, with a couple of cool demos about the “Sun Spot”, controlling robots remotely using web services, and a new cool idea on how to search music, not based on mp3 tags, but on the content of the music itself. Same applies to photos and videos, all still a technology in research by Sun.

Is That the Enterprise in You Pocket?
Brian Leonard

I’ve heard before that with Netbeans you can easily and quickly build an application for a mobile phone, and after this session I really feel like getting a hang of it and trying it out asap. I’ve done some programming for embedded devices before, but with Java ME and Netbeans it seems much straightforward. Brian gave a small workshop on how to build an application that displays the results of calling to web services via HTTP. Easy and pretty nifty! This is the 2nd place of my favorite sessions!

Swing looking good: Synth L&F
Arjan Schaaf

The idea of Synth is pretty interesting. In short words with Synth it is possible to configure the look and feel of your Swing application using XML. It’s a pity that it does not have much support in terms of documentation and it doesn’t seem to exit a big community using it. But I’m sure that with the improvements that have been made by Swing Labs for Mustang this problem will start changing pretty soon and all kinds of cool swing applications will start popping up all over!

The Vocabulary of Enterprise Applications
Adrian Colyer

I knew this was going to be a great session, and it turned out to be my number 1 favorite of the day. Adrian is a great speaker with a lot of humor. I like AOP, and this session was an introduction to it and how you can use it. If you don’t know about AOP, please have a look! OOP and AOP together make your applications more powerful!

Java Knobs: How to change performance with the Sun JVM
Simon Ritter

I was only in this session for 20 minutes. It was not Simon, but it was the huge amount of options that can be tuned to achieve all kinds of stuff that actually depend on the profile of your application…

Desktop Patterns and Data Binding
Karsten Binding

Well this just made me more confused about MVC and MVP so I gotta go read some more, also on JGoodies.

In the end, it was quite a good conference. And the big news are that we had a very nice booth this time.