What Makes "Good Software?"

June 10, 2017 by Matt in /Reflections with No Comments

In the nearly five years since I changed careers to become a full-time firefighter I have kept my distance from developing software of any consequence. To be honest, I had lost my desire to sit at a keyboard and relished the chance to spend my time in other ways. Sure, I've made the switch from Linux to FreeBSD, written a few scripts here and there, created a wiki for firefighters and even dabbled in automated stock market analysis for my own interest but I have otherwise turned down for-profit programming gigs in favour of freedom to spend my time elsewhere.

Although my day job as a firefighter has little to do with software development my prior experience building software has come in handy from time to time. In late 2015 I began working on a couple of small programs to replace a shared spreadsheet used by firefighters to record productivity metrics. Using the old system, only one person could enter data at any given time and it was too easy to accidentally wipe-out changes made by others. To solve this problem, I created two small programs using VBScript and HTML Applications as the foundation. Both of these scripts present simple, domain-specific interfaces that make sense to the users and hide the relative complexity of Excel by recording data in spreadsheet files in the background. One script allows users to record productivity information and the other generates a report from this information for use by management-level personnel. The program went live after about 80 or 90 hours of design, development, end-user documentation and testing. It solves all of the problems of the previous system, is simple to maintain and runs with minimal dependencies. It was distributed by placing a link on our intranet that opens a folder where the relevant scripts can be double-clicked and launched. Since it launched I have received a great deal of feedback that indicated that users were happy with the new system and that it ultimately made their job easier.

Recently I began to develop another piece of software. This time we're dealing with the management of annual hose testing information. The problem is significantly more complicated than the previous project which merely dealt with the recording and reporting of numbers for different categories but I'm hopeful that goals of this project will have similar positive results for the fire department.

As I found myself back at the keyboard for the second time I have begun to think about the considerations that will ensure that the current project is as much of a success as the last one. Here are my thoughts, in no particular order, about what makes "good software."

Read More

Falling Into You

November 24, 2016 by Matt in /Music with No Comments

I have this song labeled as recorded sometime in 2003 however I don't have any recollection of the exact situation so it's possible that it was a year or two earlier. Like Spanish Orgasm, it was probably composed using a simple WAV editor with tracks layered over one another.

Shockingly racist? An open response to Queen's University and Celeste Yim

November 24, 2016 by Matt in /Opinion with No Comments

The CBC recently posted an article titled Queen's University investigates 'shockingly racist' student costume party wherein the university's Alma Mater Society described party-goers costumes as "inappropriate" and were decried by Toronto comedian Celeste Yim as "shockingly racist." This article brings to mind another decade-old costume related news bite prompted by Prince Harry's choice to wear a swastika armband to a friend's fancy dress party. It's generally accepted that the prince's costume was actually offensive and inappropriate but are the costumes worn, presumably by Queen's students, truly "shockingly racist?"

Read More

The Night Pat Murphy Died by Great Big Sea

November 23, 2016 by Matt in /Music with No Comments

This was recorded sometime after December 2015 using nothing more than my cell phone and a less crappy audio recording app that isn't as prone to cutting out. I have many fond memories of listening to this song being played while having one too many beers in the Irish pubs found in Kingston, Ontario.

With apologies to Great Big Sea.

gvfs-trash and NFS

November 23, 2016 by Matt in /FreeBSD with No Comments

My wife and I use a couple of desktops at home for most of our computing needs. Most of our user files (e.g., /usr/home) are stored on a separate server, shared over NFS and amounted via autofs. Said server also provides an NFS export that we use for our shared documents - stuff that we both need read-write access to. For the sake of simplicity I take advantage of the -mapall parameter in the exports file on the server. This nifty little option ensures that whomever has access to mount the NFS export read-write will read, write and delete files as a single user on the server. This effectively solves the problem of setting up more complicated permissions for file sharing between a small group of people. The /etc/exports file looks like this:

/usr/home       -alldirs                client1 client2
/srv/fileshare  -mapall=fileshare       client1 client2

The problem with this setup rears its ugly head when you're interacting with the NFS mounts on the client through Thunar, the default file manager for XFCE (I've come to appreciate a lot of what XFCE brings to the table over the past 6 or 7 years since we escaped the insanity that is Gnome3). Thunar uses some glib magic for interacting with the file system, and when a user hits the "Delete" key or picks to "Move to Trash" from the context menu, a poorly-documented gvfs binary named gvfs-trash is invoked and in both cases it is supposed to move the offending file to the user's waste bin. On the NFS mount this function failed with the following unhelpful message:

Error trashing file: Unable to find or create trash directory.

After digging around with truss to figure out what the heck gvfs-trash was actually doing and scouring the FreeDesktop.org Trash specification, I discovered that gvfs-trash is supposed to look for a directory named .Trash in the root of the NFS mount and that this directory must have the sticky bit set.

Okay. Makes sense. I guess.

# mkdir /srv/fileshare/.Trash
# chmod 1777 /srv/fileshare/.Trash

At first glance this seems to work fine. Running gvfs-trash FILE-TO-TRASH now executes without error and gvfs (and in turn glib) goes ahead and creates /srv/fileshare/.Trash/1001, puts a couple of sub-directories under the one named after my effective UID, moves the offending file and Bob's your uncle. Because we're using the -mapall option, everything is created using the user we specified on the server in the exports file (in this case the user name is fileshare).

Unfortunately the problem also occurs the second time gvfs-trash is run to trash a file. It fails again with the same damned error message. Okay, thanks gvfs.

It turns out that not only must .Trash exist with the sticky bit, but the UID directory immediately below must be owned by the user who is trashing the file, never mind that this didn't matter when we were trashing the first file. To "fix" this problem I ran the following commands:

# chown matt:matt /srv/fileshare/.Trash/1001
# chmod 1777 /srv/fileshare/.Trash/1001

Since I have a limited number of user accounts this ungainly fix appears to work, at least for the short-term.

I think the moral of the story here is that when you are implementing anything that tries to be halfway "smart" about what it is doing (in this case, gvfs-trash and the ungodly mess of glib below it), you need to be VERY careful that your process a) provides a more helpful error message when it fails, and b) doesn't work in weird and unexpected ways (in this case, working the first time but failing the second time). Generally speaking, your users shouldn't have to run system-level debugging tools and refer to the spec when easily returned and friendly error messages would otherwise save them a lot of time.