It’s frightening to realize how close to the truth Eric Burke is.
Did you know that your installation of Leopard comes with a built-in performance monitor? It’s called “Instruments” and you can attach it to any process currently running. In the screenshot you see here I attached it to an instance of Eclipse while running some unittests.
Instruments has some nice templates for you to choose from, and you can monitor CPU activity per thread, disk I/O, User Interface activity, Object allocations, and leaks. Just so you know, it might come in handy.
If you’re a SQuirreL SQL fan like me, and you use a Mac, you probably also want to know how to add a driver to the OSX version of the application. Most people just point to an external jar file, but you can also add drivers to the application bundle. There’s not much to it, but it took me some time to discover that I actually had to edit the plist file in the bundle after adding the driver.
As you can see on the left, my SQuireLSQL.app now comes with the Oracle OCI and Thin driver built in, and because they are part of the application bundle, I can’t wreck my installation by misplacing jarfiles or reconfiguring classpaths. Nice.
If you want to drivers to your SQuireLSQL.app yourself, here’s what you need to do:

I recently downloaded Eclipse 3.4.1 for Mac OSX, and tried starting it using the eclipse.app icon. It did not work, and I noticed a message in /var/log/system.log telling me that the JVM could not be loaded.
If you’re working on some source code and you quickly need to insert a hexadecimal color code for a color you currently have on your screen, then here is a neat little trick I found:
First, install Hex Color Picker by Waffle software. It will add an extra option to the built-in OSX color picker to show you the selected color in Hex.
To reach the color picker, you usually start up any application which uses the standard OSX color picker and just choose “choose color”. What you can also do, is have the OSX color picker behave as a standalone application in 3 simple steps:
On StackOverflow, there is a question asking for the greatest programmer quotes you know. In the top 3 quotes are the following two quotes which I think hold much truth:
“Always code as if the guy who ends up maintaining your code will be a violent psychopath who knows where you live.” – Rick Osborne
“Debugging is twice as hard as writing the code in the first place. Therefore, if you write the code as cleverly as possible, you are, by definition, not smart enough to debug it.” – Brian Kernighan
These two quotes are briliantly summing up the usual rant I always use. “if my phone rings at 3 a.m. for a prio 1 production issue, I want to be able to easily read the code. And I’m not going to be awake or cheerful at that time of night.” I guess at that time of night, it’s easy to awaken the violent psychopath in me, and so it better not be “smart” code. CVS blame support anybody?
Last wednesday I was at J-Fall 2008, a fairly large event for Java programmers in the Netherlands. This event is organized by NLJUG. You can read some of my notes on the different sessions in my public evernote.
At work, we’ve got two Oracle databases and a Java web application. One of the tasks of the web application is to copy tables over from one database to the other. Last week we ran into a funny problem which turns out to be an Oracle bug.
I’ve posted a question about this last week on stackoverflow.com but it seems that not many people are affected by this particular problem, or at least not many people know the answer to this particular little problem. We set out to tackle this and we did.
I ran across this wiki page which has a nice piece on the virtues of a good programmer. I found it so recognizable that I decided to copy it over for you to enjoy:
“We will encourage you to develop the three great virtues of a programmer: laziness, impatience, and hubris.” — Larry Wall, Programming Perl (1st edition), O’Reilly and Associates
Laziness
The quality that makes you go to great effort to reduce overall energy expenditure. It makes you write labor-saving programs that other people will find useful, and document what you wrote so you don’t have to answer so many questions about it. Hence, the first great virtue of a programmer. Also hence, this book. See also impatience and hubris. (p.609)Impatience
The anger you feel when the computer is being lazy. This makes you write programs that don’t just react to your needs, but actually anticipate them. Or at least pretend to. Hence, the second great virtue of a programmer. See also laziness and hubris. (p.608)Hubris
Excessive pride, the sort of thing Zeus zaps you for. Also the quality that makes you write (and maintain) programs that other people won’t want to say bad things about. Hence, the third great virtue of a programmer. See also laziness and impatience. (p.607)
(The original context can be found at
http://c2.com/cgi/wiki?LazinessImpatienceHubris)
When using POI in any of your projects, and the application you’re building is a web application, you probably have it running on a Windows machine. If not, you know all about the struggle with the “headless mode” environment setting to tell the JVM how to handle graphics rendering.
I always like to keep my applications as clean as possible to the users. The system administrator is also a user of the software (during installation at least). So I wanted the application to set the environment properties itself, In this case, I built a nice little Spring bean to handle this. The solution is so simple, that it is almost a brilliant display of what Spring can solve for you. Suddenly, all these environment setting problems turned into a simple Spring configuration problem. Here’s how: