TheJoyOfHack

For people who like to make things

Sometimes Text Files Are Better Than Databases

A File
A File

I remember in my first Computer Programming class in college, the instructors wanted to make sure we understood the concept of persistence by saving application data to disk.  To keep things simple we would serialize data and save it to text files.  Once we learned advanced concepts we migrated to using relational databases.  As a professional, most of the apps I see use an RDBMS like DB2, PostgreSQL, Sybase or Oracle.  Text files have been relegated to the simple homework assignments of Programming 101.

There are, however, many classes of applications for which text files are the preferred means of storing data.  One of the main reasons is that when data is stored in a relational database, editing it is not a trivial task.  A well-normalized database is not easily updated via an SQL command line.  More often than not, a dedicated, graphical editor is needed to model the complex relationships.

Adding a Grid to Your Websites

190 S. La Salle St. - Downtown Chicago
190 S. La Salle St. - Downtown Chicago

The #grid website has a great tool for web designers -it “inserts a layout grid in web pages, allows you to hold it in place, and toggle between displaying it in the foreground or background.”  Go to their website and have a look.  It’s pretty impressive. Simple, but impressive.  I think I’m gonna give this a shot for the next web site I design.  I think it would be really useful in development, not as much in a production environment.

The Most Dangerous Programming Errors

Streams at the Great Smoky Mountains
Streams at the Great Smoky Mountains

The Common Weakness Enumeration (CWE) has released their list of Top 25 Most Dangerous Programming Errors. This list and the explanations of the errors are very instructive and should help both novice and expert programmers.  If you’re a developer, I strongly urge you to read this document and make sure you understand the concepts it covers.

The Tautline Hitch Knot

The Tautline Hitch
The Tautline Hitch

Humans have been using rope as a tool for thousands of years, even before we started recording history.  Knots and rope-tying is one of the few technologies that have persisted essentially unchanged in all of the known human history.  As you can imagine, there are different knots for different applications, and in this series of posts, I would like to share with you the knots that I’ve found most useful both at home and outdoors.

Navigating the Directory Stack in ‘Bash’

If you’re like me, you spend a lot of time jumping from project to project in a Linux shell.  I find that I have to switch back and forth between directories.  The bash shell has commands to maintain a stack of directories.  I’ve written some functions that use these utilities to make directory navigation easier. I’ve found these functions very useful, and perhaps you will too. Let’s see them in action first with some examples, and then look at the code:

Follow Up: Google Admits Buzz Was Only Tested Internally

In yesterday’s article about Google Buzz, I guessed that “the problem was that the population for whom the system was designed wasn’t necessarily the only population actually using the system.”  I gave Google the benefit of the doubt:

I am certain Google tested their application thoroughly.  They’ve been known to do extensive usability tests for the seemingly tiniest of changes to their web site.  But even the most well-implemented tests are incomplete if they’re not performed on a statistically representative sample of the audience.

But today, the BBC reported that Google has admitted that they only tested Buzz internally, and bypassed their regular rigorous testing procedures – possibly in an attempt to get it out the door as soon as possible. I’ll let the pundits decide if it did more harm than good to the firm, but it’s a warning to other software developers: skipping testing can lead to embarrassing failures.

Sometimes Testing Isn’t Enough

A bee.  Buzzing.
A bee. Buzzing.

In the first few days after the release of Google Buzz many people (including myself) criticized Google for exposing their users’ private information.  This was a couple of weeks after Apple got a lot flak for their unfortunately-named iPad, and the same week that we heard reports of a woman who broke up with her boyfriend after finding some suggestive text messages on his cell phone - messages that came pre-loaded on the phone.  I think that all these cases were not caused by a lack testing, but by testing the wrong audience.  Let’s examine these three cases and see what we can learn from them:

Camera Clock Correction After the Fact

I had this dilemma a few days ago: I had taken almost 4,000 pictures during a vacation 12 months ago. The vacation was in Asia (two continents over), and the time on my camera was wrong. I was importing the pictures into Adobe’s Lightroom, and wanted them to have the correct time just in case I wanted to know when in the day certain pictures were taken. I thought of looking for pictures taken during sunset, and then using solar calendars to figure out when sunset was at a certain landmark on a certain day of the year. But then I had a better idea: