drewish


blog index

Mac mini RAM Upgrades  14 August 2008

I bought a Mac mini last week to use as a work computer—now that I’ve got some income I’m finally appreciating the idea of a “work expense”. I didn’t spring for the RAM upgrade since I felt pretty ripped off after doing that for the MacBook.

Read more →

Dodged the Bullet Poker Ride  28 July 2008

It’s better to have an ex-fiance than an ex-wife so come help me celebrate not being married.

Read more →

Migrating from D6 upload.module to filefield.module  13 July 2008

So building on my last post for creating CCK fields, here’s some code I whipped up to migrate from the D6’s core upload.module to the filefield.module. This isn’t general purpose code but might help someone else out. The catch is I’d built a video node with and was using the upload module to attach exactly two files, an image and a video. The new node will have separate thumbnail and video fields. If you’ll be moving to a multi-value field this code won’t work for you.

Read more →

Building the C2 Morse code trainer on OSX  03 July 2008

I was trying to install Ward Cunningham and Jim Wilson’s Morse code trainer on OS X and it looks like their .dmg file doesn’t work on the new Intel machines. Here’s what I did to get it to build.

Read more →

Programatically creating a CCK field in Drupal 6  02 July 2008

I spent some time today trying to figure out how to create a CCK field as part of an hook_update_N function. Unlike previous versions of CCK, in 6 it’s very easy to manipulate the fields from code.

Read more →

Using Growl to tail a log file  24 June 2008

Mikey_p from the Portland Drupal Group pointed me towards a blog post he’d done on using Growl to watch for PHP errors. Always looking to put my fingerprints on something I decided to do the same but using PHP rather than Python.

Read more →

Prefilling the ImageCache cache with wget  23 June 2008

Today I needed to get Drupal’s ImageCache module to regenerate a bunch of resized images. ImageCache doesn’t create the images until a browser requests them and at that point the new image is saved to the disk for future use.

Read more →

DrupalCampPDX  10 May 2008

drupalcamppdx keynote

I took a break today from my work at Sticky building a website for a major sports apparel company that cannot be named, for DrupalCampPDX. Ben Kaplan and I did the keynote presentation this morning which was definitely an honor. I followed that up with a panel on best development practices which was a bit unplanned but went really well. This afternoon I’m doing a presentation on Views2 and Panels2, I’m a little freaked out on that since I’ve done zero preparation at this point.

Read more →

Drupal6: Display block for one node type  05 May 2008

This is a little snippet I came up with to get a block to show up on a single node type:

Read more →

Spring Break  21 March 2008

Almost done with classes for the term. Got to do the presentation for my Capstone class tonight. I think next weekend I’m going to try to get down to Reno for the StickerGuy 15th Anniversary. I worked at StickerGuy in Chris McClendon place while he when went on tour back in 2000-something. It wasn’t a good experience at the time but as Mr. Bynum always said:

Read more →

Getting PHP + GD + pdo_mysql working on OSX 10.5 (aka recompiling everything)  13 March 2008

This guide walks through the steps necessary to setup PHP on Leopard in order to run the HEAD version of Drupal. The basic steps are installing several prerequisites then recompiling Apache and PHP from source. It could totally bork your system, I’m just writing it down so the next time I need to do this I can remember what I did. I wish I could give credit to all the places I stole bits from but I didn’t do a good job of keeping notes early on.

Read more →

DrupalCon Day 1  03 March 2008

Made it out to Boston last night. I’d gotten upgraded to business class on the flight from Portland to NYC which was a nice treat. NYC to Boston in coach was a bit of a blow to my ego but the scenery made up for it. The highlight of the flight was looking out the window and seeing a white speck fly by, it was three white balloons. As the sun set we were flying through a beautify pink mist.

Read more →

Finally, applied to graduate  14 February 2008

I spent an hour or so working my way through the school’s bureaucracy to figure out how to apply to graduate. Met my CS Adviser… that I didn’t know I had. I hadn’t taken CS161 (Into to programming) and he helped me figure out how to get that waived. Once that was settled they pointed me in the right direction and I put in my papers to graduate at the end of the Spring term. Just need to finish up this term and then get my thesis taken care of and I’ll finally be a college graduate.

Read more →

Reason #902,423 why Java sucks  12 February 2008

I’ve grown increasingly annoyed at Java over the years. I’ve taken to describing the language designer’s philosophy as “If there’s two ways of doing anything, pick the one that involves more typing”.

Read more →

A smaller update  06 February 2008

Been keeping busy. The dog keeps getting bigger and smarter. She’s able to jump over the baby gates I’ve been using to pen her in the kitchen. She’s also figured out how to stretch up and reach the counter so she can steal treats off of it while I’m not looking. But she’s a great dog and I love her even when she is being a jerk.

Read more →

Replacing tabs with spaces in files  25 November 2007

I’ve got a bunch of source code that I’d written with 4-character wide tabs. I needed to replace them with spaces. I’m ashamed to admit how long it took me to figure out.

Read more →

Sorting numeric values stored in character fields with views.module  29 August 2007

I spent a good chunk of time this morning trying to figure out how to get the views module to sort a character field with numeric data correctly. The audio module has a normalized table of meta-data meaning that there’s one column for the tag name and one for the value. The value is stored as a character string which causes problem when sorting numeric data like the track numbers or years. If you’ve got a SELECT value FROM audio_metadata ORDER BY value that returns the range of numbers 1...13 it ends up sorted as 1,10,11,12,13,2,3...9. The trick as I discovered is to add zero to the field to coerce it to a numeric value: SELECT value + 0 AS v FROM audio_metadata ORDER BY v.

Read more →

Using SimpleXML with HTML  17 August 2007

PHP 5’s SimpleXML module is one of the the biggest reasons to upgrade to 5. If you’re parsing RSS feeds or the results of webservice requests it works beautifully and saves a ton of time. The only problem with it is that it’ll only load valid XML. I banged my head against it for way to long before coming up with the following:

Read more →

Using PHP and CURL to do an HTML file POST  17 July 2007

After scouring the internet to find out how to do multipart post operations and finding nothing nothing, I decided to save someone else some time. The trick is that @ before the file name:

Read more →

Pour one out for Steve Gilliard  04 June 2007

I was shocked to read today that Steve Gilliard, author of The News Blog, my favorite blogs for the past few years died on Saturday. He did an amazing job summarizing the news of the day with biting commentary. Before I found his site, I’d do several hours of news surfing each day. Once I started following it, I didn’t really bother surfing news anymore, if Steve didn’t post about it, it probably wasn’t that interesting. Since he fell ill, I’ve pretty much stopped reading the news. Sure I’ll take a look at Daily Kos every now and then but without Steve’s wonderful commentary, it’s just not worth the time. My deepest condolences to his family and all his other readers.

Read more →