Finite State Machines

ø

You don’t really understand something until you can explain it to someone else.  I took some time this weekend to try to explain finite state machines.  I’m very grateful to the Reddit community for all their help editing and pointing out things that could be made more clear.

10 Minutes of Programming in Tapestry 5

ø

This demo shows what you can do with 10 minutes of programming in Tapestry 5.  It shows a web application built from the ground up to allow submission of links/title that users can vote on.  It also incorporates some data validation and an Ajax refresh with surprisingly little code.  The source code is also available for this Tapestry demo.

Online Backups

ø

Arjun at The Productive Student questions whether online backup strategies make sense. He raises some good points.  I’m still a fan of online backups as one part of my backup strategy.  Specifically I use Jungle Disk to backup my frequently changing and important files to Amazon S2 infrastructure.  As Arjun points out, this doesn’t give me the ability to get a bootable drive, but it does protect me in case I’m traveling and it gives me the ability to restore files to a previous version.  I use Jungle Disk to backup DevonTHINK, iPhoto and specific document folders.

When I’m not traveling I use Time Machine and occasionally image a hard drive for safe keeping and to have an easily bootable option that I can bring up on another laptop if something catastrophic happens to my system.

Subversion Backup

ø

I once was offered a job at a small development shop. I asked all the right questions: Were they using version control? Did they have automated testing? etc. The answers all sounded good so I accepted the offer.

My plan for the first day was to get their software product building and running on my laptop and then start looking through the version control system to see what a typical change set looked like so I’d know a bit more about what to expect when looking at the system.

They were using CVS, but after a few queries, I couldn’t find any commits that were more than just a few days old. It was as if the source had been loaded into CVS a day or two before I started work. When I asked why there wasn’t any history in CVS I heard the following horror story.

They needed a server for an onsite demonstration, so they decided to use the CVS server. They installed the software on it and shipped it out to a customer’s location for a few weeks. I guess they decided they could just hold off on updating CVS during that period.

I never got the full story about what exactly happened–just that the hard drives “crashed”. Given the RAID setup, I doubt that hardware failure was the root problem. I’m guessing that someone reformatted it.

Anyway, when they got the server back, they weren’t too worried because they could always restore from their backup. The backup ran automatically every night and backed up all of CVS’s datafiles. Unfortunately they had never tested this backup and none of them realized that if CVS is running you can’t get a backup of its files. So all of their backups were corrupted.

In the end they just copied the contents of a developers laptop back into CVS and ran with that. Unfortunately they had several very large clients with custom installations that were built from source code that was in a branch of CVS. This meant there wasn’t anyway to give them bug fixes because their source code was completely gone.

Obviously I wanted to avoid that situation again. Since their current system didn’t really have any history I suggested we change to Subversion. Everyone was fine with this because they still thought the whole fiasco was somehow the fault of CVS.

Once Subversion was installed and running, I wanted to come up with a foolproof way to back it up. Subversion has some very nice commands for dumping the repository out to a text file, but I wanted something that would guarantee that not only had it been backed up, but that the backup was good.

Here is the subversion backup plan we eventually ended up with:

  1. Dump the repository to a file.
  2. Zip the file and save it with the date/time in the filename.
  3. Copy the zip to another server
  4. Delete the unzipped file.
  5. Copy the zip file back down from the server to a temp directory.
  6. Unzip the file
  7. Create a new repository
  8. Load the dump file into the new repository
  9. Checkout the trunk to a temporary directory
  10. Delete the temp directories

This entire process ran as a cron job and had the quiet options enabled everywhere. If there was a problem, data would be output and I’d get an email with the error.

This SVN backup process made it very easy to guarantee that the backup process was producing didn’t have any issues, could produce a valid repository and that trunk could be checked out without any errors.

I refined the process over the years and eventually posted it as a perl script if you want to try this svn backup process.

Congressman Sues Congressional Cafeteria

ø

Dennis Kuckinich is suing the congressional cafeteria for $150,000 because he bit into an olive pit. Aren’t his dental benefits paid for by tax dollars already? I vote for shutting down the congressional cafeteria and letting congress bring their own sack lunches just like millions of other Americans do everyday.

Debt Snowball

ø

I have a big problem with the debt snowball idea. In a nutshell it is this:

If you are trying to get out of debt, start with your smallest debt and pay it off first.  Then your next biggest debt, etc.

The idea is that the mental benefit of making a debt go away is a greater advantage than the money savings of paying off your higher interest debt first.  While I can see this point, it seems like it is encouraging a lack of financial literacy.  People who are going to the debt counselors who are advocating the debt snowball are in financial trouble.  If they are in trouble with debt, they probably lack some of the basic financial literacy that they need to properly manage their finances. The debt snowball doesn’t fix the core problem of financial illiteracy. In fact it makes it worse because it encourages them to do things that are financially unwise.

If people can’t learn to get the same psychological “buzz” out of really saving money by choosing an optimal payoff strategy, I would question whether they have really learned anything about managing their finances. The only way I think it makes sense is if you decide that the people you are trying to educate aren’t smart enough to understand the benefits of an optimal strategy where you pay off higher interest debt first. Then maybe the debt snowball makes sense.

I got into an argument with some family members about this. They finally admitted that the debt snowball strategy is designed “for dumb people” but that they don’t like to refer to them as dumb because “that seems mean”.

WSJ Sues for Medicare Database

ø

The Wall Street Journal is suing to get the Medicare database made public.  They want people to be able to see what each doctor was paid and for what procedures.  They had access to the database for a recent story and found some glaring examples of abuse.  Of course the real question is going to be whether this information can be released publicly without violating patient privacy.  The AMA is opposed to the release of this information because they feel it violates doctors privacy.

While I understand the privacy issues, I think that the way government money is spent should be as open as possible.  Anything that says hidden is very likely to be abused.

State of the Union

ø

I think the health of the nation can be accessed by looking at the percentage of people who watch the State of the Union address.  If that number is going up every year, then we are probably headed in a good direction.  If it is going down, I fear for our future.

It isn’t a matter of whether or not people like the President.  It is an indication of people’s willingness to be involved and to pay attention to what is happening in government.  The worse thing that can happen in our country is for people not to care and feel like their opinions don’t matter–that they can’t change anything.

Boring Jobs

ø

Awhile back I wrote a post on Productivity501 titled How to deal with a boring job. FMF wrote further on the idea of a boring job and made some interesting points.   FMF has some good advice about how to go about asking an employer for more responsibility without just coming out and saying “I’m bored”.

FMF doesn’t think there are many jobs out there where you are just getting paid to sit around. I think it is probably more common than most people realize–particularly in areas like tech support where you are basically there in case something breaks. This is particularly true in areas where the group responsible for tech support isn’t the same group that is responsible for making sure that things don’t break in the first place.  When someone only has responsibility for support, but not authority to do the things that can fix the need for support, the amount of work they have to do can vary dramatically depending on what changes other people have made to the it system.

Here is a slightly related story that I like to tell clients when talking about unintended consequences of management decisions:

There was an IT department where management decided to reward employees based on the number of help desk tickets they closed.  It was a small department so the people responsible for fixing tickets were the same people responsible for maintaining the infrastructure, doing upgrades, etc.

The IT department was proactive and did their best to keep things running without downtime.  However, the better they got at keeping everything working smoothly the fewer tickets were opened.  The fewer tickets they opened, the fewer tickets were closed and the smaller their bonus.

Finally they came up with a solution.  Once a week, they would go to the close, and unplug a switch.  This would shut down access to a couple key systems, but keep the ticket system up and running.  Users throughout the organization would create ticket saying that a service was down and requesting helpdesk fix it.  After about 15 minutes, the IT department would plug the switch back in again restoring access for everyone.  Then they would go close the hundred or so tickets that had been opened and keep their metrics up so they could get their bonus.

Goldilocks Bill

ø

It looks like the president just signed a the “anti-hunger, anti-obesity school lunch bill”. I think it should have been called the, “just right school lunch bill”.

Log in