Alvin Alexander | Java, Scala, Unix, Perl, Mac OS X

Subversion/SVN checkout FAQ: How do I checkout a project with Subversion?

svn checkout command example

I currently work at a consulting company, so we organize our projects first by client, and then by project. So, assuming I have a customer named ACME, and a project named Project1, this svn checkout command (svn co) worked for me:

Java Log4J FAQ: Can you share a simple Log4J example?

I don't have a lot of time today to get into all the Log4J properties and configuration options you can use, but I wanted to share at least one Java Log4J example here, so here goes.

A Log4J example Java class

The following Java Log4J example class is a simple example that initializes, and then uses, the Log4J logging library for Java applications. As you can see the configuration is pretty simple.

A co-worker today mentioned the Lessig method for presentations, embodied by this Identity 2.0 presentation. That seems like great fun for short discussions, and possibly a Tufte-approved use of PowerPoint.

Some time in the very near future I will make the switch. Yesterday I placed an order for a MacBook Pro, and now I anxiously await its arrival.

Before discussing my reasons for making the switch, let me first state that I am not currently an iPod or iTunes user. I may get to those things eventually, but for now those things are non factors, and what I'm most interested in is developing new software for customers, and designing new software systems.

To put the JGoodies FormLayout into debug mode, when you're creating a builder, instead of doing this:

PanelBuilder builder = new PanelBuilder(layout);

add in a FormDebugPanel, like this:

// debug mode
PanelBuilder builder = new PanelBuilder(layout, new FormDebugPanel());

This enables what I think is a terrific debug feature, showing red lines around whatever grid structure you've created. (Sorry I don't have an image out here for this tutorial, but it really is a terrific GUI debugging feature.)


There is a disease I see so often in the software development industry that I've decided to give it a name. I call it "Kirk/Scotty Syndrome". This disease is related to the concept of "software rot" and "spaghetti code" inflicted by the management team. You'll know this disease when you hear it, because it will sound a lot like the following conversation, taken from most Star Trek episodes:

Here you want to use the "describe" command in Postgresql. Assuming that you want to get information about a database table named users, and you're logged into a Postgresql database using the psql client, issue this command at the psql prompt:

\d users

This will provide a description of the table named users. Your output from this command should look like this:

"Postgres show tables" FAQ: How do I list all the tables in my current Postgresql database?

Once you're logged into a Postgresql database using the psql client, issue this command at the psql prompt to show all the tables in your Postgres database:


This will list all of the tables in the current database.


Question: How do I list the Postgres slash commands, i.e., the commands available from the Postgres command line?

Once you're logged into a Postgresql database, you can issue the \? command to see the list of available Postgres "slash" commands, like this:

mydatabase=> \?

For my own convenience, I'm listing these Postgres commands here. These are the commands available in the Postgresql 8.0.3 client:

First, I issue the call for Postgres command line help:

"Postgres login" FAQ: How do I log into a Postgres database from the command line?

To log into a Postgres database from the command line, use the psql command. Let's take a look at a few psql command line options you can use.

Postgres login commands

If you are logged into the same computer that Postgres is running on you can use the following psql login command, specifying the database (mydb) and username (myuser):

For some reason or another today I was curious about this question: If you flipped a coin ten times, what are the odds that the coin would come up heads ten times, or tails ten times)?

I'm sure there is a way to determine this statistically, but I don't know how to do that, so, being new to Ruby, I wrote a little Ruby simulation program -- essentially a Monte Carlo simulation of the problem -- to find the answer. (Pretty boring, I know, but hey, I was bored, interested in learning Ruby, and didn't feel like reading any more of The Stand right now.)

Assuming you are the root user on a Linux computer, here's a quick example of how to run a program with a Linux crontab entry as another user. Specifically in this example, the program being executed is run as the user nobody.

I recently started to model an application that makes extensive use of web service calls, and my customer asked me to include a UML sequence diagram to show the flow of calls in the system. This prompted me to wonder, "What is the correct way to show distributed systems (like a web service) in a UML sequence diagram?"

If this link is correct, in a UML diagram you show remote systems as actors.

I was just modifying a Perl program so I could use a regular expression (regex) to search a Perl array for all less-than (<) and greater-than (>) symbols, and replace those with their HTML equivalents tags ("&lt;", and "&gt;", respectively).

Here's the source code I created to perform this Perl array search and replace operation (a Perl replace regex operation):

As a small business employer, I've watched the cost of health insurance increase by 200-300% over the last four years. Last year we were "fortunate" to have an increase of only around 10%. It's gotten to the point where paying health insurance for a family is well over $1,000 per month now.

Here are a couple of notes I just sent someone on how to get started writing a software requirements specification.

They may be a little vague, but I hope they show my intent, or perhaps my frame of mind, when writing a software specification.


Here are two notes on my mental approach when writing software requirements specifications:

I don't know if you've ever had UML use case burnout, but I think I just hit the wall. Here's a link to some use case prose that shows I've written way too many use cases recently.

Maybe this is a good way to know when you need a vacation?


Question: I want to show how my application classes are segregated into packages. Is there a UML diagram for this?

Yes, you pretty much named it. A UML package diagram is good for demonstrating the packages (or packaging) in a software application, as well as the dependencies between packages.


Question: I want to look at the relationships between the classes in my software application. What UML diagram should I use?

UML Class diagrams are very good for showing the static relationships between classes, such as inheritance and aggregation, one to many relationships, and many other class relationship details.