Just ported this site from Drupal 6 to Drupal 7 (finally) and making a new theme from scratch. Some things are probably broken and I'll get to them eventually (updated 2014-09-01).

Vancouver Needs Real Street Food

Travel to many cities in the world and you will find street food all over the place. Delicious street food. Walk in Vancouver and there is almost no street food. I can only think of 2 hot dog vendors on West 4th or West Broadway west of Granville St. The one near Future Shop just west of Burrard and the one at the corner of Graville and Broadway in front of the Chapters. You can walk a long time downtown before stumbling across any street food, and it's mostly just hot dogs or Crepes.

Tags: 

Drupal Audio Handling is a Mess

The state of Drupal audio files support in Drupal is a mess right now. The audio module, which is great by the way, has not been fully updated to 6.x. This effort has probably been hampered somewhat by the fact that "audio nodes" is not the way that most drupalers want to treat audio going forward.

Tags: 

Don't Rewrite Working Black-box Code

At work I am modifying an existing tool to work from the command line instead of a GUI. Currently everything is a bit coupled to the GUI. On Friday, the next problem I encounted was a global variable in Common.py that was not initialized.

""" Common.py """
def initHSCM():
    global hSCManager
    ...
    hSCManager = win32serviceOpenSCManager(None, None, win32con.SERVICE_ALL_ACCESS)
    ...
 
...
def startService(service):
    """ function that uses hSCManager """
    # These functions don't work when hSCManager is set to None
 
def stopService(service):
Tags: 

Weight Gain During Pregnancy Progress Tracker Spreadsheet

When woman get pregnant they are supposed to gain weight. Not gaining enough weight can cause problems just as gaining too much weight can cause problems. But when you are 4 months pregnant or when you are 7 months pregnant it is hard to know how much you should weigh at that point in your pregnancy. I made a spreadsheet to help my wife know at any point of her pregnancy whether she is underweight or overweight relative to the end target.

Tags: 

Using XML for Code Documentation is Just Plain Wrong

I was just looking at some C# code at work today and it had XML Documentation (like javadoc or python docstrings, only with XML). Who was the idiot that came up with that idea? It's the most insane thing I've ever seen. Let's look at the predecessors to C#'s XML documentation:

Javadoc:

Drupal Module Updater

This script will automatically update a drupal module if your drupal source code is stored in a Subversion respository. It first removes all files except for the .svn directories, then extracts the tarball for the new version of the module. Then it runs an svn status command to see which files are new, which files have been removed in the new version, and which files have changed.

Topic: 

Batch JPEG Photo Renamer

I used this script all the time before Picasa finally added this functionality. This script renames a whole bunch of photos, in a directory for example, appending numbers to the end of a base filename according to the EXIF dates stored inside the JPEGs. For example, a directory full of files that looks like this:

IMG_0123.jpg
IMG_0124.jpg
IMG_0127.jpg
IMG_0128.jpg
...
IMG_0248.jpg
IMG_0250.jpg

could be renamed to this:

Camping Photos_001.jpg
Camping Photos_002.jpg
Camping Photos_003.jpg
Camping Photos_004.jpg
...
Camping Photos_112.jpg
Topic: 

Low Disk Space Warning Script

Have you ever experienced a full disk on a server or a desktop? Not fun. This script would normally be run as a cron job and would notify you by email if any drive's free disk space has passed below a certain threshold. The code could be better; I wrote this one a long time ago when I was a bit of a n00b and I was in a rush as well. I might make take a look at it again and see if I can make some improvements.

Topic: 

mp3 Sample Clip Creator With Fade-In/Out

This script will create mp3 sample clips. I created it to automatically create sample mp3 clips for a friend of mine's (Will Stroet) website. You can tweak the length of the clip and the fadeout. Unfortunately it can only create samples that start at the beginning, however, it could be easily modified to start anywhere. It depends on the quelcom library, lame, and mpg123.

Topic: 

How To Stop Chrome Thrashing to Disk

Google Chrome will thrash to disk a lot to disk, at least in version 0.2.149.27, build 1583 (the first publically available beta) in Windows XP. It is so bad that my entire computer locks up a bit and becomes unresponsive. Disabling phishing and malware protection seems to stop the thrashing:

Pages

Subscribe to David Grant RSS