Perl Excel example - A Perl program to parse Microsoft Excel XLS files

A co-worker, Chris Smith, created a very elegant Perl program to parse a Microsoft Excel XLS file for me some time ago. I recently modified that program to convert what was essentially a "glossary" in an Access database.

I first saved the Access database table as an Excel file. Then I used the following Perl program to extract the contents of the second and third columns from that file, and write them out to another file. The output file was in a Wiki (technically TWiki) format.

Java Windows exe - a tool for creating Windows executable files

Here's a link to a tool named JSmooth that lets you create Windows executable files from standard Java JAR files. It looks like this can make the installation process on the Windows platform much more friendly.

 

An Ant build script for web applications

Ant web build script FAQ: Can you share an example Ant build script for a web application?

Sure, here's a sample Ant build script for a Java web application. I've included other example Ant scripts for Java Swing/JFC/GUI applications on this website, but this one demonstrates how to use Ant to build a web app instead.

Ant Swing - A sample ant build script for a Java Swing application (FPTracker)

Ant Swing build script FAQ: Can you share an example of an Ant build script for Java Swing applications?

Here is another sample Ant build script for a Java application. Again, I hope it can help you "Learn Java by Example", or in this case, "Learn Ant by Example".

A sample ant build script for a standalone Java application

Ant Java build scripts: Can you share an example of an Ant build script for a standalone Java application?

This is a sample Ant build script for a Java application I wrote. It is a GUI/Swing application named "AlwaysOnTop". I include it here because I'm a big believer in learning by example, and maybe this Ant script can help you create an Ant script for your own applications.

Mon, Mar 7, 2005 (Don't take programming shortcuts)

Note to self: Don't *ever* take shortcuts when writing code, even prototypes. Every time an application gets to a certain size, you'll regret those shortcuts, because you won't be able to do what you want to do in a timely manner.

There's something good to be said about "the simplest thing that could possibly work", but don't take that to mean "taking really dumb shortcuts is okay".

 

Java - Find the longest String in an array of Strings

Java String array FAQ: Can you share an example of how to determine the largest String in a Java String array?

Sure, in this tutorial I'll share the source code for a complete Java class with a method (getLengthLongestString) that demonstrates how to determine the longest String in a Java String array.

Java Date format example - Format a Date so humans can read it

Java Date format FAQ: Can you show me how to format a Java Date object in a human-readable format?

It's pretty easy to get a Date in a Java program, but it takes a little more work to print a Date in a human-readable format.

Java Date format example

Here's a snippet of Java date formatting code I'm working on right now:

HSQLDB timestamp - How to specify a default date/time

Here's a quick example of how to set a default value for an HSQLDB TIMESTAMP field:

create cached table directories (
  dir_id identity NOT NULL,
  directory varchar(255) NOT NULL,
  time timestamp default 'now'
);

There are other ways to do this, but the important line that sets the default timestamp in the above SQL is this:

time timestamp default 'now'

This is where I'm creating a timestamp field named "time" that automatically defaults to the current date/time when a record is created.

 

LaTeX - Simple referencing is another reason to use LaTeX for requirements specifications

I've written a lot of use case documents lately for software requirements specifications, and as use cases get more complex, I find the need for "sub use cases" or "alternate scenarios". When referring to these from the main use case (or anywhere else), it's nice to be able to use LaTeX's reference capability.

Syndicate content