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

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):

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.

Question: Is there a UML diagram to visually show the processes in a system?

Yes, you can use use case diagrams to represent the use cases (processes) in a software system. Use case diagrams show the actors in a system, and the ways in which these actors use the system.

This is why I use the terms "use cases" and "processes" interchangeably. IMHO, "use case" is a fancy way of saying "process", or perhaps more accurately, user-initiated processes, or event-driven processes.


Question: What UML diagram can I use to show how my application will be distributed in the real world?

Use a UML deployment diagram. They can be used to conceptually show the physical nodes and software components that will be distributed in a software application.


Question: What UML diagram can I use to show how an object state changes during its lifetime?

A UML state diagram will do the trick. A state diagram is very good for showing how an object state changes over the lifetime of a software application, and the triggers (triggering events) that cause the state to be changed.


Need to show how objects collaborate during the lifetime of a software application? You'll want to use a UML interaction diagram -- either a sequence diagram or a collaboration diagram.

I prefer the sequence diagram, because the time sequence of events it displays more easily demonstrates the interaction of objects over time, but other developers prefer collaboration diagrams.


Question: I want to visually model a multi-threaded software application. Can UML help?

Yes, UML activity diagrams can be a great tool for visually modeling the flow of control in a multi-threaded application. A UML state diagram can also be used to show the states objects can be in during their lifetimes.