Warning: Java caches DNS to IP address lookups forever!

Found an interesting problem this morning after the IP address of a web server was changed in our DNS.

Web browsers could see the site at the new address, the command line of ping server could see the site just fine, but the long-running Java pinger application could not see the server at all. All we received were messages informing us that it could not contact the moved server.

After some digging on the internet I quickly found the reason why:

networkaddress.cache.ttl (default: -1)
Specified in java.security to indicate the caching policy for successful name lookups from the name service.. The value is specified as as integer to indicate the number of seconds to cache the successful lookup.

A value of -1 indicates "cache forever".
Sourced from: J2SE 1.4.2 Networking Properties

This is also mentioned in another post on how to Disable DNS caching.

So you need to restart the JVM to pick up recent DNS changes... or you could change the networkaddress.cache.ttl System property. But this doesn't work in some cases due to bug 6247501 - although the bug is closed, read the comments at the bottom of the page - not sure if the bug was closed after these comments or before...

Technorati Tags: , , , ,

Xalan classes go missing once Java is upgraded from 1.4 to 1.5

We found a bit of a strange problem today at work - some Xalan classes seemed to have disappeared. This week we upgraded some of our Tomcat web servers from Java 1.4 to Java 1.5. Everything appeared to work seamlessly, but today we noticed that one section of one site failed with a 'ClassNotFoundException'.

It was complaining about a couple of Xalan classes. We cracked open the rt.jar file ($JAVA_HOME/jre/lib/rt.jar) of 1.4 to see what used to be there. Lo and behold the Xalan classes were there right in the middle of rt.jar.

We then moved over to our new 1.5 install and cracked open it's rt.jar. This time the Xalan classes were hidden out of the way with a 'com.sun' prefix to every class. Obviously Sun don't want you using their shipped version of Xalan...

We decided that the best thing to do was to download a proper Xalan distro and put that in the application's WEB-INF/lib directory.

We downloaded xalan-j_2_7_0-bin.tar.gz from the UK mirror of Xalan's binaries and extracted xalan.jar & serializer.jar to be copied to our web server.

After a Tomcat restart our problem was solved!

Technorati Tags: , ,

How to restore missing transitions and effects in Windows Movie Maker

I use Windows Movie Maker (WMM) to create little movies of my 2-year old daughter so that I can burn them to DVD. The source of the footage is from my digital camcorder that takes Mini DV tapes.

It had been quite a while since I last edited one of these tapes and so was now using my recently upgraded and reinstalled PC. I opened WMM last night to edit the tape only to be confronted with a message that all the transitions and effects were missing. I don't use many of these effects but fade in/out to black is a must.

I searched around on the internet today to try and find a solution and here is one way that got it working for me:

* Open Windows Explorer (Start -> Programs -> Accessories -> Windows Explorer)
* Browse to C:\WINDOWS\inf
* Locate moviemk.inf
* Right-click on it and select 'Install'
* Pop your WinXP (service pack 2) disk in let Windows reinstall WMM
* Fire up WMM and be amazed that everything is back to normal!

I'm so pleased that I got it working again so quickly, there are many people out there that seem to have the problem and can't find a fix for it - hopefully by blogging this there will be one more solution to try!

Technorati Tags: , ,

Sorry for not blogging!

I'm having major internet connection problems at the moment with my net connection dropping every few minutes (hope it hangs in there whilst I post this!). I'm with Pipex although after tests it's looks like a problem with my BT line...

Will hopefully get a post out soon but what with Christmas shopping, last minute project dashes and no internet I can't promise anything! :)

Upgrading Ubuntu - Migrating from Dapper Drake (6.06) to Edgy Eft (6.10)

Ever since Firefox 2.0 was released I've been checking to see when Ubuntu (the Linux distro that I use as my desktop at work) will offer it as an installable package.

Did the search again yesterday and found out that a new release of Ubuntu was out - 6.10 codenamed 'Edgy Eft'.

I followed these instructions from the Ubuntu site, Upgrading using Update Manager and had no problems but another source of good information regarding the upgrade can be found on the Daily Cup of Tech blog in a post called Upgrade Ubuntu 6.06 to 6.10.

I did have problems though, it reported that it couldn't continue with the install as I had "broken packages". I was able to fix these by running Synaptic Package Manager , filtering out just the broken ones and then right-clicking on them and choosing "reinstall". After a quick reboot I then re-ran the Update Manager which continued the install.

It does take quite a long time to perform the upgrade, mine was still downloading the required packages after two hours but I now have a fully working Ubunutu with Firefox 2.0! :)

Technorati Tags: , , , , , ,

Using Apache to display a list of available Subversion repositories

If you have setup Apache to be able to serve multiple Subversion repositories from one parent Subversion path then you are probably wondering if there is a way to display the list of repositories available in that parent directory.

By default Apache will give you a 403 permissions error reporting:

403 Forbidden

You don't have permission to access /parent-subversion-directory on this server.
To enable the repository listing you need to use the SVNListParentPath option (see "Listing available repositories in mod_dav_svn (server)" under "Enhancements and Bugfixes" in the 1.3 release notes) in the Apache virtual host setup.
Note: this will only work in Subversion 1.3 and higher.

Edit your Subversion Apache configuration file to add the SVNListParentPath On line, an example is given below:
# Subversion
<Location "/svn">
DAV svn
SVNParentPath /svn
SVNListParentPath On
SVNIndexXSLT "/svnindex.xsl"
If you now visit http://some-website.com/svn you will see a page entitled "Collection of Repositories" with a listing of links pointing to each Subversion repository!

Technorati Tags: , , ,

Wireless USB hub (UWB) - I gotta have one!

I don't normally post 'I read this and thought it was cool!' blog posts but I had to pass this one on...

First UWB Wireless USB Hub Ships (source DailyTech)

How long will it be before the USB port disappears due to the devices using UWB instead?

Makes me wonder if I should start investing in battery companies...

Technorati Tags: , , , ,

A combined Stop/Reload button for Firefox 2.0

Firefox 2I can't stand 'desktop clutter' and my Firefox toolbar is one such place that I try to keep as minimalistic as possible. I often wondered why there was a 'Stop' and a 'Reload' button when only one of them is active at a time.

I've been using Firefox for quite some time and found an extension called Stop-or-Reload Button that merged the two buttons together therefore reducing the screen real-estate that the navigation toolbar took up.

I upgraded to Firefox 2.0 this week and found that the extension was disabled as it wasn't compatible. After a little searching on the web I found an old but still valid blog post by Erik Arvidsson entitled "Stop-Reload-Button in Firefox" that not only solves my problem but does so in a very minimalistic way! Ignore his references to IE7 he really means Firefox (he mentions this in the comments).

Now I need to try and get rid of those annoying "GO" buttons from the Address and Search bars...

Technorati Tags: , , ,

How to switch your working copy when the Subversion repository URL has moved

If you followed my previous post on Supporting multiple Subversion (SVN) repositories with Apache you may have noticed that I moved the repositories from:




If you had a working copy checked out of either of these Subversion repositories then you would have received an error when attempting an update due to the repository being moved since you checked out the code.

You need to update your working copy to point to the new repository but maintain any local changes that you might have made - my colleague Guy Francis pointed out that you use the svn switch command to do this.

Here is how you update your working copy's repository URL:

  • Change directory so that you are inside the working copy
  • Run svn switch --relocate http://some-url/a http://some-url/svn/team-a .
This will go through the whole directory structure updating the source URL to point to the new location, the --relocate option forces Subversion to just update the files locally no access to the remote repository is required.

Technorati Tags: , , ,

Supporting multiple Subversion (SVN) repositories with Apache

My previous posts about Subversion on Debian Linux (installing, configuring, backported packages) showed how I installed and configured my local repository that I use for my home projects. I also used these tutorials when installing Subversion at work.

After creating a couple of repositories for different teams (all within the base /svn directory) I noticed that my Apache configuration file was starting to look a little repetitive:

# Subversion - team A
<Location "/a">
DAV svn
SVNPath /svn/team-a
SVNIndexXSLT "/svnindex.xsl"

# Subversion - team B
<Location "/b">
DAV svn
SVNPath /svn/team-b
SVNIndexXSLT "/svnindex.xsl"
I plan on creating at least two more repositories for other teams and so this was repetition was starting to bother me. A colleague pointed out that SVNParentPath (scroll about 1/4 down) should be the solution.
I rewrote my conf file to be the following:
# Subversion
<Location "/svn">
DAV svn
SVNParentPath /svn
SVNIndexXSLT "/svnindex.xsl"

Now any repositories that are created within the parent /svn directory will be available via http://some-url/svn/<repository name>, so my existing repository become:


Technorati Tags: , , ,

Decompiling Java .class files using JAD

I gave myself quite a fright today when after having a problem moving some CVS-backed Java source files around, I found that the code that I had written yesterday (and failed to check in) was now nowhere to be found.

Tracked it down to just one missing source file, and luckily I had a compiled class file of the old code. Now all I needed was a tool to resurrect the source file from the ashes...

After 5 minutes of searching around on Google I found what I was looking for, a Java decompiler called JAD. I downloaded the statically linked Intel Linux version, extracted the zip and placed my class file in the extracted directory.

Running JAD was as easy as ./jad IveMessedUp.class which produced the original in double quick time.

JAD was a life-saver (well time-saver at least) and so I wanted to spread the word about this lovely tool.

Technorati Tags: , , , ,

Reduce Firefox's memory usage

This month's CustomPC has a great tip for reducing the amount of memory that Firefox consumes when it's running in the background.

If you've ever watched your process list when firefox is in use you won't be surprised to hear that it can consume vast amounts of memory - multiple open tabs or windows is the major culprit.

To force Firefox to trim it's footprint when minimised do the following:

  • Type "about:config" in the URL address bar
  • Right-click in the window and choose "New" and then "Boolean"
  • Enter "config.trim_on_minimize" as the preference name
  • Select "True" as the default value
  • Restart Firefox
That's it! Now watch the amount of memory it uses rapidly drop when Firefox is minimised...

Technorati Tags: , , ,

Agile North Conference 2006 Report

Today was the annual Agile North conference held in Preston, Lancashire. It was a one day event with three different session tracks going on at once. Obviously there were lots of sessions that I wanted to attend but the ones that stood out the most were "Dealing with Customers" and "Storytelling with FIT".

The day started with a keynote speech from Rachel Davies who is a member of the Agile Alliance. It was great to finally meet a "face" of the Agile Alliance and to hear about how they formed and what their focus was. Rachel was a good presenter and kept the audience captured for the duration of her talk.
There was also a good amount of discussion in the Questions & Answers part at the end of her talk.

I had two key "take aways" from her talk:

  • Don't stick rigidly to the process if situations are changing
  • Get hold of a copy of "Waltzing with Bears" book

Dealing with Customers by Charles Weir of Penrillian

Charles held this session as a goldfish bowl (scroll down a bit) discussion forum and it worked really well. I've never seen it before and it was interesting how it really held the discussion to the inner circle rather than multiple conversations starting up at once. Charles was an excellent moderator and ran a very tight, focused discussion group.

My key take aways from his session were:
  • If multiple stakeholders are involved, get them to fight it out over the available (and normally very limited) resources
  • Gaining an onsite customer was very difficult so one company moved the development team to the customer (and located them in the middle of a call centre!)
  • Sometimes there is too much customer communication to the point of communication overload
  • In cases where no onsite customer was permitted, some teams resorted to more covert measures to access "real users"
  • Customers could get an update from the team by listening in to the daily standup.
  • To stop onsite customers disturbing developers, various "busy working" tokens were used to mark the times of day when the developer was coding rather than available for discussion.
  • It was generally agreed that when a developer was working on multiple projects at once it was more productive to get one project completed before moving on to the next. The perceived progress if both projects were worked on at once was misleading and productivity was actually reduced.

Storytelling with FIT by Steve Freeman (M3P) and Mike Hill (Mandu)

This session ran for the whole afternoon and covered what FIT was and how to implement acceptance tests in FIT as well as some very interesting exercises around the ideas of capturing, explaining and communicating requirements. Steve and Mike were an excellent double act, I particularly enjoyed their customer/developer role play around the capture of a large number of quirky requirements.

The predominant message that came across was that communicating requirements is hard work and requires lots and lots of communication between the customer(s) and developers. They require a domain language to effectively communicate, should focus on the "what" rather than the "how", readability is very important - use examples and descriptions to explain tabular data.

Again, here are my key take aways from this session:
  • For the specification to provide real meaning it needs to include both explanations and examples
  • It needs concrete acceptance criteria so that the developers know when they are done
  • When using FIT the real benefit comes when both customer and developer work together to create the FIT tests - they are "communicating" requirements
  • Production and collaboration are the important points when using FIT to create acceptance tests.
  • FIT test documents can be written in HTML, Word or Excel format (HTML is best as far as developers are concerned as it can be version controlled correctly).
  • One cost of FIT is the refactoring of the tests, this is not easily automated due to class, method and member names appearing in both the fixture code and the test HTML pages.
  • Full test coverage is binary - you either have it or you don't. It means that all code has a purpose and allows you to move quickly by giving you confidence in the codebase.

It was an excellent day and I'm really fired up to try and get FIT running our acceptance tests, I've been wanting to automate some of the testing for a while and JUnit never felt quite right. Can't wait to get into work tomorrow... ;)

Technorati Tags: , , , , ,

Problems with Trac and backported Subversion on Debian Linux

After installing the backported package of Subversion last week and importing a pre-existing codebase into it I decided that now was a good time to put Trac on the server.

Following my previously blogged Trac installation & configuration guides I was able to get Trac up and running fairly smoothly with one small problem: the "Browse Source" button was failing reporting some issue with "svn" being an unknown repository type.

After some searching and thinking I realised that this was most probably due to conflict between the newer backported version of Subversion and the older Python Subversion bindings libraries.

Here's how I resolved this issue:

apt-get remove python2.3-subversion
apt-get install python-subversion

Refreshed my browser and everything worked correctly!

Technorati Tags: , , , , ,

Installing Subversion 1.3.2 using Backports on Debian (Sarge) Linux

Following on from my previous posts about installing Subversion from source, here are some notes on how to do it using backported Debian packages.

Add the following lines to your sources.list file in /etc/apt:

# backports
deb http://www.backports.org/debian sarge-backports main contrib non-free

Update your Apt sources list:

apt-get update

Uninstall any old Subversion packages:

apt-get remove subversion
apt-get remove libsvn0

Install Subversion with 1.3.2 as a specific version (this causes the backported version to override the stable version):

apt-get install libsvn0=1.3.2-5~bpo1
apt-get install subversion=1.3.2-5~bpo1

Check that the installed Subversion is the right one by using svn --version you should get something like:

svn, version 1.3.2 (r19776)
compiled Aug 12 2006, 12:05:49

Install the Apache2 Subversion modules:

apt-get install libapache2-svn=1.3.2-5~bpo1

Follow my instructions on Configuring Subversion (svn) on Linux (Debian Stable).

There you go!

Technorati Tags: , , , ,

Resize web form text areas on the fly

Sorry that I've been very quiet lately, been doing some major DIY and preparing for a new kitchen to be fitted! :(

Found this little gem over on The Man in Blue blog, looks like it could be really useful...

FormTextResizer: Bookmarklet for resizing textareas and text fields

Technorati Tags: ,

Upgrading Subversion (svn) to 1.3.2 on Linux (Debian Stable)

I upgraded my Subversion repository tonight from 1.2.1 to 1.3.2 and it was an absolute breeze!
I followed the Subversion installation instructions that I've blogged about before (using the newly downloaded 1.3.2) ignoring the bit about installing Apache.

Ran through the usual Linux make, make install stuff, restarted Apache and accessed the repository browser webpage which displayed the updated version number at the bottom.

Couldn't have been simpler!

Technorati Tags: , , ,

Dead broadband routers & fantastic customer service from 3Com!

My 3Com wireless broadband router decided to stop working last week leaving us without any internet at home. It was a 3Com OfficeConnect ADSL Wireless 11g Firewall Router, a rather excellent piece of kit that I purchased from Amazon.co.uk when my Linksys WAG54G started playing games with the wired lan ports.
I bought it in January and it's been rock-solid ever since, very easy to setup, and the only downside was that it shipped with extremely old firmware but that was easily solved with a visit to the 3Com support website.

It stopped working in the afternoon last Wednesday (5th July) whilst I was at work. The ADSL and wireless didn't work any more, and I couldn't get into the administration interface. I fished out my old Linksys router as that had working wireless and internet and got onto the 3Com support site late that evening. It comes with a 3 year warranty (I've had it 6 months) so I managed to submit an RMA (returns) request.

The next morning was an email informing me that they were going to send an "Advance Replacement" which means they send you a replacement first before you send the defective unit back. That lunchtime I had an email informing me that my replacement router had been shipped! It was shipped from 3Com in Germany and so it took a few days to get to me, but the fully-working replacement arrived yesterday (Monday 10th July) - a total of 5 days.

I've got it all up and running again now and I've been extremely impressed with the quality of the service that 3Com have offered. It's a quality piece of kit at a great price (I paid about £50 for mine) with superb customer service to boot! I will be recommending this router and 3Com as a networking provider to anyone who will listen!

Technorati Tags: , , , , ,

Ruby on Rails at June's AgileNorth meetup

Tonight was June's AgileNorth meetup and the topic was Ruby on Rails. It was hosted by David Draper who did an excellent job of introducing Rails in an easy to digest way even though he has very little Rails experience himself. Just shows what a good trainer can do!

He demo'ed a shortened version of Curt Hibbs's Recipe Cookbook tutorial using the RadRails plugin for Eclipse as his IDE. David started by creating the database in mysql (note: just the database - no tables) and then used RadRails to create the initial 'cookbook' application environment. He used the 'migration' feature of rails to create the database tables which were auto-generated by ruby code - this was one feature of rails that I was not aware of and was particularly impressive (for me at least!).

A great Ruby on Rails bookHe used the scaffolding tools of rails to auto-generate the recipe & category models, the cookbook and category controllers and all the associated views. All of this was done in little steps so that he could show the changes that were made to the code at each stage. I lot of this I had seen before as I ran through the 'Four Days on Rails' last Christmas but it was a nice refresher on the power of Rails.

Following David's walk-through we had a thirty minute discussion around the benefits of Rails and how to introduce Rails to systems with an existing database structure - could it be used to map onto this schema rather than creating a Rails-friendly one from scratch?

I really enjoyed this evening's talk, David did an excellent job if giving a brief overview of how to get kick-started with Rails, and it has re-energised me to think about how I can introduce it in some aspect at work.

Note: I've tagged quite a few of the items discussed with the 'agilenorth' tag over on del.icio.us.

Technorati Tags: , , , ,

Solving Ubuntu permission problems when mounting a Windows SAMBA drive

After using Ubuntu desktop for a while I decided that a backup of my files would be a good idea and so went about attempting to mount and copy a whole host of files.

I attempted to mount the SAMBA drive running on my Windows fileserver as myself:
smbmount //backups/andrew.beacock shares/backups -o username=andrew.beacock,password=********
but was told that I didn't have permission to, only root can mount to SAMBA drives. So I popped the word 'sudo' in front of the command and tried again. This time it connected successfully and I was able to browse around the shared directories.

I then attempted to use rsync to back up my important folders but ran into problems again. It complained that I didn't have permission to delete files off my share, so again I popped the sudo command in front of the rsync command and thought it was me being stupid.

I then ran into a really strange problem where even though I was running as root and the files on the server were owned by root I didn't have permission to delete some of the files and directories!

After wiping the problem files from the fileserver as root (the problem was due to the share being mounted as root rather than as me), I was advised to set the 's bit' of smbmount and trying again. I did that and Ubuntu just complained that smbmount was not allowed to run with the 's bit' set!

So I went off to Google and found the answer on the LinuxQuestions.org forum.

Although smbmount cannot be setuid root, smbmnt (a program used by smbmount) can. This means that you can run smbmount as your own user and it will setuid to root when connecting to the SAMBA mount point.

Here's what I did to get it all working:

Change the permissions of /usr/bin/smbmnt to be setuid root:
cd /usr/bin
sudo chmod u+s smbmnt

Check that the s bit is set:
abeacock@ab100:/usr/bin$ ls -l smb*
-rwxr-xr-x 1 root root 1588348 2006-05-17 11:05 smbcacls
-rwxr-xr-x 1 root root 775340 2006-05-17 11:05 smbclient
-rwxr-xr-x 1 root root 512332 2006-05-17 11:04 smbcontrol
-rwxr-xr-x 1 root root 1493884 2006-05-17 11:05 smbcquotas
-rwxr-xr-x 1 root root 1551224 2006-05-17 11:05 smbget
-rwsr-xr-x 1 root root 8488 2006-05-17 11:05 smbmnt
-rwxr-xr-x 1 root root 709888 2006-05-17 11:05 smbmount
-rwxr-xr-x 1 root root 1500284 2006-05-17 11:05 smbpasswd
-rwxr-xr-x 1 root root 700872 2006-05-17 11:05 smbspool
-rwxr-xr-x 1 root root 498860 2006-05-17 11:04 smbstatus
-rwxr-xr-x 1 root root 4896 2006-05-17 11:04 smbtar
-rwxr-xr-x 1 root root 705704 2006-05-17 11:05 smbtree
-rwxr-xr-x 1 root root 6108 2006-05-17 11:05 smbumount

Mount the Windows SAMBA share as yourself (no sudo required):
smbmount //backups/andrew.beacock shares/backups -o username=andrew.beacock,password=********

You can now copy files over as yourself and all the permissions remain correct!

Technorati Tags: , , , , , , , ,

Time Management Tracker extension for Firefox

Sorry for not blogging for over a month it's a bit crazy in my life at the moment! Been doing tons of DIY, trying to choose and order a new kitchen plus a short break to Paris.

Hope to be doing something soon that is worth blogging but for now how about a rather clever little timer that records how long to spend surfing the net when you are meant to be working...

TimeTracker Firefox Extension

Technorati Tags: , , , ,

Solving XPlanner's $DISPLAY issues on a headless Linux (Debian) server

A month or so ago at work we started playing around with XPlanner, a project planning and tracking tool for eXtreme Programming (XP) teams. I downloaded it to my Ubuntu workstation, unzipped it and ran startup_xplanner.sh. Everything worked fine, all the graphs displayed, all the reports, etc.

We then decided that we would start to use it seriously and so it needed moving to a central server. This is when our problems started. We started to get errors such as:

java.lang.InternalError: Can't connect to X11 window server using ':0.0' as the value of the DISPLAY variable.
at sun.awt.X11GraphicsEnvironment.initDisplay(Native Method)

This was due to XPlanner now running on a headless server but it requires the Java AWT graphics libraries to draw the graphs. These in turn use the underlying system's X server, which requires some kind of X server running.

After some investigation I found Xvfb, an X server virtual framebuffer which will happily run on a headless server.

To install Xvfb, login as root and then apt-get the package:

apt-get install xvfb

We now need to create a couple of start/stop scripts so that both Xvfb and XPlanner are started when the system reboots.

Create a file in /etc/init.d called xvfb with the contents below:


if [ -z "$1" ]; then
echo "`basename $0` {start|stop}"

case "$1" in
/usr/bin/X11/Xvfb :0.0 &

killall Xvfb

Create another file in /etc/init.d called xplanner with the contents below:


export DISPLAY

export JAVA_HOME


if [ -z "$1" ]; then
echo "`basename $0` {start|stop}"


case "$1" in


cd -

We need to ensure that Xvfb is up and running before XPlanner attempts to start, so we need to force the order in which the start/stop scripts are executed:

update-rc.d xvfb defaults 10
update-rc.d xplanner defaults 80

Now reboot the server and you should have an auto-starting XPlanner which actually displays the graphs!

Technorati Tags: , , , , , ,

A list of US 'time zone IDs' for use with java.util.TimeZone

If you program in Java and have to convert dates and times between different timezones then you will know that the Date, Calendar & TimeZone objects of the java.util package are the way to go.

The JavaDoc for java.util.TimeZone mentions that you can use a 'time zone ID' of "America/Los_Angeles" to get the US Pacific Time. It doesn't give examples of any other time zone ID, so here is a list of the standard US time zone IDs:

AreaAbbrevZone Name
Eastern TimeESTAmerica/New_York
Central TimeCSTAmerica/Chicago
Mountain TimeMSTAmerica/Denver
Pacific TimePSTAmerica/Los_Angeles
Alaska TimeASTAmerica/Anchorage
Hawaii-Aleutian TimeHSTAmerica/Adak

(Table sourced from Statoids: Time Zones of the United States.)

Technorati Tags: , , , , ,

Never forget to attach a file to an email with the AttachmentRemember Thunderbird extension

AttachmentRemember is a rather nifty Thunderbird extension checks your outgoing email message for words that indicate that you might have wanted to attach a file to your email before you sent it.

So the message "Please see the attached file" would trigger if there was no attachment (once you add the keyword "attach" to the extension).

Talk about saving face in the work place.

Technorati Tags: , , , ,

Programming is easy?

Over on the 37signals blog they had this comment from a customer:

A feature request came in that told us: “Programming wise it is fairly simple.” Jamis responded, “Some people have no clue.”
Click here for the rest of the post. Right on brother!

Technorati Tags: ,

Surely software developer magazines doomed for failure?

There is an interesting post from Eric Sink regarding the eventual death of developer magazines.

I used to subscribe to a couple of software development magazines, EXE was one of those - an excellent magazine that I would probably still subscribe to. It was bought out by Dr. Dobbs and was killed off as soon as it was bought.

Since 2000 I've not referred to one magazine for any help in software development, why bother when there is so many fantastic resources on the net?

Technorati Tags: ,

Resetting a PostgreSQL sequence

To reset a sequence so that the next time it's used it returns 1 run the following SQL:

select setval('my_sequence_sq1', 1, false);

The first parameter is the sequence name to set the value of, the next is the value to set it to, and the third field is whether the sequence should return this value or the next increment when it is used next.

For the official documentation please read chapter 9.12. Sequence Manipulation Functions from the PostgreSQL 8.0.7 Documentation.

Technorati Tags: , ,

Your priorities are what you DO

Do you ever wonder how you are meant to work on high priority long term tasks when you seem to have a never ending list of "urgent" (but non-important) tasks to work on?

Mark Horstman from the excellent Manager Tools podcast has a few words to say on the matter. My key takeaway from his post is:

What is it that you DO? How do you spend your time? Because what you DO really IS what your priorities ARE.
This really hits home on what you should be doing rather than what you are doing. It also indicates why it can start to get you down when you don't get to work on the them. Mark covers this when he says:
The disparity between what they know their jobs to be and what they spend their time doing is the primary source of their dissatisfaction in their role.
What you need to do is figure out how to spend less time dealing with the non-important but "urgent" work and more time on the important strategic stuff. Stephen Covey covers this with Habit 3: "Put First Things First" of The Seven Habits of Highly Effective People. His four quadrant model detailed in the book covers more on this topic.

Technorati Tags: , , , ,

Google Page Creator - Nice & Easy! Unsafe

I discovered Google Page Creator this morning (via the technology section of memeorandum) and then spent the next 5 minutes signing up and creating my first GPage.Check it out!

It looks like a very simple, easy to use tool that will make creating webpages very easy for non-techies (but you can still get access to the raw HTML for those more tricky issues).

Update: In my haste to spread the word I failed to notice something pointed out over on the One Degree blog, your Gmail username is part of your URL so it's trivial for spammers to figure out your Gmail email address.

Technorati Tags: , , ,

Why do you want that feature?

37signals have got their heads screwed on the right way. Over on their Signal vs. Noise blog Jason has posted about why they have many 'features' missing. His response: "It just doesn't matter".

Their latest product is "easy group chat for business" called Campfire. It's a web-based IRC-type service which allows you to chat, share files and pictures. They have left a large number of so called 'features' out and many people have been asking why on their forum.

They take the view that if it's not essential for the service to operate correctly then you have to make the hard decision of whether to include it or not. Any feature no matter how small costs, whether in time, complexity of the resulting code or in the usability of the final product.

When you are designing software for someone other than yourself how do you take the same approach? If they are paying the wages then surely what they want wins? My thoughts at the moment revolve around splitting out the 'non-essential' requirements into separate stories and estimating those individually. Then you can explain the cost of that requirement to the customer to see if they still really want it now that there is a concrete cost associated.

Anyone else got any other ideas?

Technorati Tags: , , ,

Restricting Firefox's memory leak usage

There has been a lot written recently about the "memory leaks" of Firefox 1.5. The lead engineer for Mozilla Firefox, Ben Goodger posted about this over on the Inside Firefox blog.

Get Firefox!Apparently one possible "leak" is actually a feature - Firefox caches a number of the previously viewed pages in memory so that should you want to go "back" they don't have to be downloaded again.

Obviously this can be a tremendous performance boost when going back but the default rules that Ben posts abouts got me a little concerned. Here is a table of the system ram size and the default number of cached pages:

RAMNumber of Cached Pages

As you can see if you have 1GB of RAM or above it will cache 8 pages by default, but if you have 512MB then it will only cache 5. I have 1GB in my machine but will be caching the same about in memory as a 4GB machine - so I changed this setting to only cache 6 pages.

Here's how I did it:
  • On a new tab type about:config (this displays all the configuration values)
  • type browser.sessionhistory.max_total_viewers in the "Filter" box
  • By default it will be showing the value of -1 (meaning use the default value from the above table)
  • Double-click the -1, a popup box will appear, replace the -1 with 6 and click OK
  • Restart Firefox
You will now have changed the in-memory cache setting from 8 pages down to 6. If you want to cache more pages in memory then you can also make this value greater than 8 - I'm not sure of how much memory each page takes up...

Technorati Tags: , , , ,

Webapp design hints & tips from the del.icio.us founder

Joshua Schachter presented at the The Future of Web Apps summit in London this week and both Peter Cooper & Simon Willison have posted some excellent notes from that session.

The key findings from these notes for me are:

  • Keep URLs simple. Leave all the framework invisible, it doesn't help the user, keep URLs clean. "Nobody cares" about complex URLs.

  • Some latency in the system is OK - work out where you have leeway, e.g. RSS
    feeds can fall a few minutes behind without anyone minding.

  • Keep API simple - REST, etc.

  • When people ask for features, get to the bottom of why they are asking for
    that exact thing. Solve the problem, rather than doing exactly what your asked

  • The features you put in are as important as the ones you leave out.

  • Don't waste time building features nobody uses.

These cover similar points to the ones I raised in yesterday's post about stripping requirements down to the bare-bones.

Technorati Tags: , , , ,

Stripping requirements down to the bare-bones

Jason Fried of 37signals posted recently about how they choose the essential vs. non-essential requirements for v1.0 of their products. This got me thinking that:

a) what a great idea, it makes perfect sense
b) how many client-driven projects would allow such a thing to happen?

With agile development and the process of release & iteration planning in particular, essential requirements would be moved in front of non-essential ones, so maybe when dealing with external client-driven projects the first iteration (or so) would produce the 37signals' v1.0 release?

Technorati Tags: , , , , ,

Tidy up your Windows PC with the excellent CCleaner

CCleaner is a free utility for Windows XP which will clean up your system and generally get your machine back in order. It can clean up Internet Explorer and Firefox histories, cookies and temporary files. It removes the temporary files and log files that Windows updates leave lying around and it also has an excellent registry cleaner built in. This is particularly good at getting rid of old problematic startup errors that occur after you've uninstalled certain applications.

I ran CCleaner for the first time on Thursday last week and it found 280MB of stuff that it wanted to delete! Most of that was internet cache files and Windows update rubbish, although I did have to uncheck it from deleting all my Firefox cookies. It also fixed about 90 issues with my registry. Just be careful to check all the settings prior to cleaning your system as it's pretty thorough ;)

CCleaner - Freeware Windows OptimizationIt's an excellent free tool and is now on my "must install" list!

Technorati Tags: , , ,

Monkey Patch - a Band-Aid for code?

Yesterday Chad Fowler made a post about the virtues of monkey patching. It mentioned that his code "monkey patches some of the Rails core classes" but does not provided a definition. It wasn't something that I had heard of before so I went in search for answers.

I found it within the documentation section of Plone.org (an open source content management system). Their definition is:

A monkey patch is a way to modify the behaviour of Zope or a Product without altering the original code. Useful for fixes that have to live alongside the original code for a while, like security hotfixes, behavioural changes, etc. The term "monkey patch" seems to have originated as follows: First it was "guerilla patch", referring to code that sneakily changes other code at runtime without any rules. In Zope 2, sometimes these patches engage in battle with each other. This term went around Zope Corporation for a while. People heard it as "gorilla patch", though, since the two words sound very much alike, and the word gorilla is heard more often. So, when someone created a guerilla patch very carefully and tried to avoid any battles, they tried to make it sound less forceful by calling it a monkey patch. The term stuck.
You learn something new each day don't you! So is that why GreaseMonkey is called what it is?

Technorati Tags: , ,

del.icio.us search to replace Google?

Well maybe I've blown the title up a bit to big but I wanted to share an interesting experience I had this afternoon with search.

A number of months ago I came across a website that helps you organise an event. You enter your name & email address and a title for the event. Then you add possible dates for that event along with a list of email addresses to send the invites to.

I used it a couple of times and then forgot about it, deleted it from my (del.icio.us) bookmarks and removed all trace of it from my memory. This afternoon I wanted to find that site again, so I turned to Google. No matter what keywords I typed in be it "event", "meeting", "invite" or "plan a party", it couldn't find it.

I turned to del.icio.us and entered 'event' in the search box, the second result from "Everyone's items" was the one I was looking for, a site called MeetWithApproval.com.

It's a very cool service and now that I've found a real need for it, I've got it safely tagged in del.icio.us.

Technorati Tags: , , , , ,

Mozilla's Thunderbird email client turns 1.5!

It's not the newest news in the world (it's been out a few days) but I wanted to share that Thunderbird, the free and rather excellent email client has been upgraded significant from 1.0.7 to 1.5. I've been using Thunderbird for quite a while now both on Windows XP and Ubuntu Linux and find it to be extremely stable and a pleasure to use.

Technorati Tags: , ,

Summary of January's AgileNorth Meetup

Update 19/01/06: Phran Ryder informs me that my unnamed pair is in fact Stephen Hutchison.

Monday night was the January meetup of the UK north-west AgileNorth group. It was again kindly hosted by Katie at computing department of the University of Central Lancashire, Preston. There were 11 attendees, and like last time it was run by Murray Tait (with laptop and software setup provided by David Draper).

We continued off from last time with more coding dojos, the first being a simple problem of reversing a sentence. Given "AgileNorth meets once a month" we had to produce "month a once meets AgileNorth" (maybe we could call this "Yoda-speak").

David Draper & Charles Weir took to the laptop to be the coding pair mainly responsible for typing in the code to implement the unit tests and referring to the JavaDoc where necessary. The rest of us were communicating to the 'customer' (Murray) and deciding what the next unit test should be (which was also noted down by Murray). This exercise ran from 7:00 till 8:00 and we managed to satisfy to the customer that we had provided a complete solution including what to do with symbols and numbers, double-spaced words, etc.

We had a quick coffee break and then dived into the next dojo that ran from 8:15 till 9:15. It was to write a 10-pin bowling scoring system and the customer was Isobel Nicholson, with Ant Grinyer making a note of the next unit tests. We did ok on this one, I was pairing at the laptop with ???? (sorry I have no idea of your name! please post it to the AgileNorth mailing list) Stephen Hutchison. At first I was running the unit tests for the previous dojo, and that got quite confusing! :(

We managed to get basic scoring working per frame (a frame was two balls), and managed to get 'spare' scoring working correctly. We were about to start moving onto strikes but ran out of time. We struggled with this one on how to start, it felt like we wanted to write a large object framework of balls, frames, game scores, tries, etc. without ever having a failing test. Even the initial failing test was tough to get started on. Once the first test was written and a very stupid "return 5;" implementation done we started to pick up speed - I really like writing that first immature implementation to get some working code out and a green bar to give me a boost.

From my point of view it was good to get through a couple of different dojos in the evening (admittedly we didn't finish the second one) as it mixed up the pair programmers, and mean that different people were leading different sections of the problem domain. I also enjoyed meeting quite a number of new faces, and coding Java with 10 other people watching my every keystroke on a projection screen is a very strange feeling!

Technorati Tags: , , , , , , , , ,

A list of annoying CVS habits

Rob Sanheim posted today with a humourous list of annoying CVS habits, my personal favourite is bullet point 3:

Or, commit sweeping changes to 45 files all with the same comment: “changed the foo baz system”.

I have a few more to add that I can think of at the moment:

* Create a tag for the current software release that bears no resemblance to any tags that have existed for previous releases.

* Commit any changed files but forget to add & commit any new files, then go on vacation, leaving your machine switched off with an unknown root password.

* Commit compiled Java class files so that when you run cvs diff you get a very colourful output.

Got anymore to add?

BTW, a small but incredibly useful book to have is O'Reilly's CVS Pocket Reference. It's cheap but full of detail which has saved me on a number of occasions when I'm asked to fix some obscure CVS issue.

Technorati Tags: , , ,