Archive for the ‘Tips and Tricks’ Category

Installing hMailServer on a 64-bit Operating System

Wednesday, December 23rd, 2009

hMailServer is my prefered email server. It is really good – very user friendly and its configuration is quite detailed and versatile. And of course it is free. :)

I recently installed it on a clean installation of a 64-bit operating system. On startup, the installer told me that the .NET framework version 2 is required and will now be downloaded. So I let it download and (I thought) install .NET. However, when it got to the step of configuring the database, the application would not start. All I got was the relatively non descriptive error “failed to initialize properly”. And the same error occurred when trying to start up the tools from the start menu.

I was just about ready to give up, having found no helpful hints online. However, when I got to the “Add or Remove Programs” dialog, I realised that the .NET framework is in fact still not installed. Curious but solvable. So I downloaded the .NET framework manually, and tried to install it. As it turns out, I accidentally downloaded the 32-bit version – which cannot be installed on a 64-bit operating system. The 64-bit version is about 10MB larger than the 32-bit, which made me realise that the hMailServer installer downloaded the wrong version for my operating system. I had to uninstall and reinstall hMailServer after this whole process, but now it is running perfectly.

Moral of the story – when installing hMailServer on a 64-bit OS, make sure that you have the .NET framework version 2 installed first!. :)

NetBeans Platform Refcard

Tuesday, December 22nd, 2009

DZone has a number of refcardz – cheat sheets for developers. They are free and can be viewed on the website, but you have to be signed in (registration is also free) to download them. Useful refcardz include: Core Java, Design Patterns and NetBeans IDE. And now there is also a brand new refcard for the NetBeans Platform!

Selection in Dia

Thursday, November 19th, 2009

Dia is an open source tool for drawing structured diagrams. I used it quite extensively recently, and I discovered a very useful feature. How selection of multiple objects take place depends on where you start to draw the selection box (the dotted line in the screenshot below).

Dia screenshot showing the selection area

Dia screenshot showing the selection area

If you start the selection at the bottom right corner such as in the screenshot above, the selection will include any object touched by the area. So the result of this operation would be as shown below.

Dia selection - area selected from bottom right to top left

Dia selection - area selected from bottom right to top left

However, if you start the selection by starting at the top left corner and dragging towards the bottom right… only the objects enclosed completely by the chosen area will be selected (as shown below).

Dia selection - area from top left to bottom right

Dia selection - area selected from top left to bottom right

If this description does not quite make sense… go ahead, try it out. :)

Speeding Up NetBeans Platform Builds

Thursday, November 5th, 2009

Developers that build NetBeans platform applications will be very familiar with one of the steps in the build process: “Generating Information for Auto Update”. The reason is that it takes quite a while compared to most of the other steps in the process (see this e-mail, for example). Since I have not been able to find an exact answer anywhere (the mentioned e-mail conversation contains only part of the answer), I decided this afternoon to embark on the journey to find where this is triggered.

The short answer is… it is performed by the ‘netbeans’ target in the <NetBeans platform folder>/harness/common.xml ant script. The task is called ‘genlist’. If you comment this out, the “Generating Information for Auto Update” step will not be performed.

For those that are interested in how I found this out, here is the explanation. :) Using V-Grep, one of my favourite freeware tools, I searched through the NetBeans platform source code (version 6.1, the only source version I have downloaded) for the log message “Generating Information for Auto Update”. I finally found it in nbbuild\antsrc\org\netbeans\nbbuild\MakeListOfNBM.java. Armed with the knowledge that the ant target class that is responsible for this process is called MakeListOfNBM, I searched through the ‘harness’ folder in my NetBeans installation. I found out that the ant task is called ‘genlist’, and searching for that I found where it is called.

Edit: I found the same question on Geertjan’s blog too.