Monday, February 21, 2011

Firefox 4 to the future

I just installed Firefox 4.0 beta this weekend. More than any new features, I was impressed by the first run artwork that they are using to market the FF 4 beta. All the illustrations are retro-futuristic, highly detailed, scenes of future technology, space colony landscapes and jet packs. Although the actual browser is just a browser, no self-aware robots or jet packs involved I still liked the concept. Here is an example (from http://www.mozilla.com/en-US/firefox/3.6.13/whatsnew/)


After a bit of digging, the artwork is by artist: Steven Olds.


The marketing blog for Mozilla attributes some of the inspiration for this campaign to "20th century futurist" Klaus Bürgle.

This also reminds me of the amazing paintings I used to read about in space books as a kid, often borrowing images from the 1975 "Stanford Torus" NASA Ames/Stanford study on building a colony in space for 10,000 people. One of the artists for that project was Dan Davis and others such as Rick Guidice who contributed artwork to Gerard O'neill's book the High Frontier

Will using Firefox help me live there? Can someone at least make a persona of this stuff?

Saturday, February 12, 2011

Listing files in a folder to a text file on Windows

One endless source of annoyance in my work is copying and a list of file names from some folder to paste in another document.

In the Windows UI, your only option is really right-clicking on individual file names, clicking Rename and then selecting the name to copy. This must be done for each file.

The fastest way I have found to achieve this uses a DOS Command Prompt and flags for the dir command.

To open a Command Prompt window, in pretty much all versions of Windows. Go to Start > Run > type "cmd" (without quotes).

To get a list of files and directories into a text file use the "dir" command with "/B" option

C:\java>dir /B
Apache Software Foundation
apache-ant-1.8.2-bin
apache-ant-1.8.2-bin.zip
apache-ant-1.8.2-manual
apache-ant-1.8.2-manual.zip
chrome.dmp
databene-benerator-0.6.3-dist
databene-benerator-0.6.3-dist.zip
eclipse-jee-ganymede-SR1-win32
eclipse-SDK-3.6.1-win32
eclipse-SDK-3.6.1-win32.zip
javadb-10_5_3_0
javadb-10_5_3_0.zip
MiniConnectionPoolManager.zip
opencsv-2.2
opencsv-2.2-src-with-libs.tar.gz
swt-3.6.1-cocoa-macosx
swt-3.6.1-cocoa-macosx.zip
swt-3.6.1-gtk-linux-x86
swt-3.6.1-gtk-linux-x86.zip
swt-3.6.1-gtk-linux-x86_64
swt-3.6.1-gtk-linux-x86_64.zip
swt-3.6.1-win32-win32-x86
swt-3.6.1-win32-win32-x86.zip
TimeTrack_win32


To have the output of this command piped to a file "C:\output.txt" use the ">" symbol:
dir /B > C:\output.txt

To only show files, no directories you can use the /A:-D flag ("/A:" is for attribute matching filters, "D" is directories, "-" is for not):
dir /A:-D/B > C:\output.txt

Results in the file contents being:

apache-ant-1.8.2-bin.zip
apache-ant-1.8.2-manual.zip
chrome.dmp
databene-benerator-0.6.3-dist.zip
eclipse-SDK-3.6.1-win32.zip
javadb-10_5_3_0.zip
MiniConnectionPoolManager.zip
opencsv-2.2-src-with-libs.tar.gz
output.txt
swt-3.6.1-cocoa-macosx.zip
swt-3.6.1-gtk-linux-x86.zip
swt-3.6.1-gtk-linux-x86_64.zip
swt-3.6.1-win32-win32-x86.zip


Note: on some versions of Windows you can't save a file to C:\ without running the cmd.exe as an Administrator.

For more information on the other flags for more control over your output:
C:\java>dir /?
Displays a list of files and subdirectories in a directory.

DIR [drive:][path][filename] [/A[[:]attributes]] [/B] [/C] [/D] [/L] [/N]
[/O[[:]sortorder]] [/P] [/Q] [/R] [/S] [/T[[:]timefield]] [/W] [/X] [/4]

[drive:][path][filename]
Specifies drive, directory, and/or files to list.

/A Displays files with specified attributes.
attributes D Directories R Read-only files
H Hidden files A Files ready for archiving
S System files I Not content indexed files
L Reparse Points - Prefix meaning not
/B Uses bare format (no heading information or summary).
/C Display the thousand separator in file sizes. This is the
default. Use /-C to disable display of separator.
/D Same as wide but files are list sorted by column.
/L Uses lowercase.
/N New long list format where filenames are on the far right.
/O List by files in sorted order.
sortorder N By name (alphabetic) S By size (smallest first)
E By extension (alphabetic) D By date/time (oldest first)
G Group directories first - Prefix to reverse order
/P Pauses after each screenful of information.
/Q Display the owner of the file.
/R Display alternate data streams of the file.
/S Displays files in specified directory and all subdirectories.
/T Controls which time field displayed or used for sorting
timefield C Creation
A Last Access
W Last Written
/W Uses wide list format.
/X This displays the short names generated for non-8dot3 file
names. The format is that of /N with the short name inserted
before the long name. If no short name is present, blanks are
displayed in its place.
/4 Displays four-digit years

Switches may be preset in the DIRCMD environment variable. Override
preset switches by prefixing any switch with - (hyphen)--for example, /-W.

Sunday, February 6, 2011

Introducing the Time Track Project

The Time Track application is a small side-project I have been developing since late November 2010. It is a simple application that lets a user keep track of time spent on work, projects, tasks etc.


Time Track main window, Windows Vista x64

The main requirements for the Time Track application were

  • Be a software version of a time punch clock, for any purpose

  • Keep track of time in a persistant format that can be saved

  • Cross-platform support (at least Windows, Mac OS X)

  • Needs a GUI

  • Lightweight, simple to use and set up

I developed this in Java as a standalone desktop program with a GUI using all OpenSource components. I am nearly complete with an initial version that meets all this functionality and I intend to release it as a free-ware app for now, maybe it can be made released as open source by itself in the future.


Implementation


I had really two paths I could have taken with this, one would be to build a dynamic webapp with a RDBMS backend. The second approach was to develop a standalone self-contained application that could be somewhat portable itself. I was hesitant to take on a project that required any sort of server set up and hosting, I am just not set up to do that now, so although the webapp was pretty easily cross-platform being browser based, I didn't like the idea of the dependency on the remote server.


I went with the standalone app approach, in order to be cross-platform and easy for me to develop I went with Java as the source language. I didn't want the program looking like a Java Swing application so I opted for the SWT api which is the basis for the Eclipse IDE and platform, it tends to look more "solid" in my opinion as one of its main features is native look and feel for UI components on every OS. I think so far it is coming along nicely. You can see a side-by-side comparison of the interface in Windows Vista, and on Linux (Ubuntu 10.04, 64-bit)




I have probably spent around 5 weekends and the occasional hour on a weeknight in total since I started building this application. Probably overall time spent has been under 80 hours. It was enjoyable to more or less go through the full development life-cycle for a new project. I got to do design, open-source research, coding and integration, source-control, and complete build scripts in Ant. Even though I may never release a line of code from this, I am building like I could.

In terms of the OpenSource projects that I used a variety of different components in my stack.

For my build environment, I am using Java JDK 1.6.0_17, Eclipse Ganymede IDE, Junit 3 (for the few automated unit tests that were really helpful with Derby), SVN for source control and builds are done with ANT. Testing was done on Windows Vista SP2 x64 and Ubuntu Linux 64-bit GTK.


RoadMap
On my to do list I still have a number of items I'd like to close out before really wrapping up this release.
  • The main table needs to update when changes occur. Currently it is loaded at start up.
  • Need to think about an import data function.
  • Testing on a Mac
  • Implement a more solid connection pool mechanism
  • Release strategy. Post on this site? or create an OpenSource project page?