Platinum Solutions Corporate Website

Rick Witter's blog

Inconsistent escaping in Spring MVC resource bundles

While our team was working on a Spring MVC application, we found that sometimes a message retrieved from a resource bundle had to have apostrophes escaped (by doubling them) and other times we didn't. I did some research to find out what was happening.

It turns out that Spring requires escaping or not depending upon how the resource is referenced.

Selecting HTML Elements by Label

Here's a little trick that I wish every web page with a form would use:

Easy toString() Creation

Overriding the toString() method is an all too common Java developer experience. It’s also somewhat tedious: Write out the class name… write out some properties and their values… format it so it doesn’t look hideous… repeat for lots of other classes.

Wouldn't it be better if there were an automatic way to generate decent looking toString() methods?

Apache to the rescue!

Analyzing Open Source Projects with Ohloh

Did you know that the Hudson project has grown from 200,000 to 500,000 lines of code since January of 2007?

Did you know there's a guy in France (Jim Meyering) who has contributed to the GCC, CVS, Emacs, and Perl projects?

The website ohloh.com has this and lots of other interesting information about open source projects.

Updating Multiple Systems in One Step

I just got back from a trip where our team had to install a bunch of machines. There were fifteen machines total, but with the Solaris zones, we had twenty-eight total operating systems to work on. And on each of these systems, we had a number of things we had to do as we prepared them for production use -- create user accounts, disable unneeded services, copy some configuration files in place, set up some cron jobs... multiply that by twenty-eight, and it wasn't long before I was very, very tired of typing the same login and password.

It seemed to me that these very repetitive tasks were something that should be automatable. Then I remembered a tool I used years ago that might very well be just the trick.

Better Web Browsing through Keymarks

One of the more overlooked features of the Firefox browser is "keymarks". Essentially, these are special kinds of bookmarks that allow you to slip in a string as part of the bookmarked URL.  This allows you to often jump right to a dynamically generated page, rather than going through some landing page first.

Creating a keymark is easy enough: when the search uses an HTTP GET command, you can just bookmark the result of a search and then modify the URL in the keymark.

As an example, let's say you're tired of going to the www.ebay.com homepage every time you want to search for the latest must-have product. Creating a keymark is easy:

Reverse Engineering Oracle

On my current project, our team inherited a system that had already been in production for years.

We were immediately tasked with making some modifications. One problem: we didn't have a development system. Setting up one would be easy enough -- except that we found that the production Oracle database had been modified over the years, so that the build scripts that we inherited no longer could create an accurate clone of the database. Adding to the complication was the fact that the production database was on a classified system, so I had to avoid retrieving the data (I got an OK on the DB structure).

What we needed to do was regenerate the build scripts from the existing database -- essentially reverse engineering the Oracle database.

Stored Procedures vs. Code

I’m currently working on a project that was clearly written by people who were very familiar with databases and not so comfortable with Java coding.  The database is beautiful – well laid out and fully normalized.  The code… well, it looks like they copied some examples from the early chapters of books on servlets and JDBC.

It’s not surprising that the developers avoided manipulating objects in Java, and did most of the work via stored procedures written in PL/SQL where they were more comfortable.  And they did a lot in the stored procedures:  not only did the procedures do data manipulation (converting NULL to “”, converting time formats), but also pagination (useful if there would be a lot of data returned), and even auditing (easy to do when you know a procedure will be called every time data is modified).

Virtual Windows

There are lots of times that we want to have several logged in sessions open at once. Maybe you are logged in as different users in each one. Maybe you need to watch the output of a command while you are working in another window. Maybe you are working in multiple directories and don't want to have to "cd" so often. Opening up all those windows can be a bit of a hassle, especially if they are on a remote system, where you have to log in each time. Then there's the issue of screen clutter -- all those windows, so little screen real estate.

It sure would be helpful if there was a program to allow us to share a window between several "virtual" windows.

A better way of working with Oracle

Oracle has now been the dominant database for quite some time now. It is indeed a powerful database, with a plethora of high end features. Why is it then that the primary interface for the database administrator is a poor command line tool, which has remained essentially unchanged for more than 10 years?

Yes, I'm talking about good old SQL*Plus. Despite being used by a generation of DB administrators, it lacks simple functionality which would greatly ease the administrator’s life.
In particular:

•    Line editing capabilities. I can't tell you how many times I've typed a long SQL statement just to realize that I had typed "selct" way back at the beginning.  Sqlplus does have (weak) sed-like editing capabilities, and the ability to edit the previously run command in your choice of editor, but that's only AFTER you've executed your faulty command.  From what I've seen, "backspace" seems to be the editing method of choice.
•    History. Sqlplus only stores the last command you have run. But when I'm looking around in several tables, I need to go back and recover previous commands. Almost invariably, I end up opening another window just so I can copy the commands that I need to run repeatedly.
•    Table/Field name completion. Every modern IDE has the useful feature of allowing code completion -- you type part of a command, and the IDE can suggest what you want to enter.