Partying like it's 1999
I just got around to upgrading my website to Drupal 6. In the process I decided that I was going to redo the theme using 960.gs for a nice grid based design and then I got it into my head that I wanted a nice retro 1990 theme. So here it is, my stab at recreating the Netscape 2 experience. I'm not sure how long I'll be able to stand it but I'm going to enjoy it while it lasts.
Simple Arduino serial communications
I've been playing around with some Arduino stuff I bought from adafruit industries and needed to rough out some serial communications between the Arduino and Processing. This just sets the Arduino up to echo characters back at the Processing sketch which buffers a line of output and displays the last line from the serial port.
Creating a CCK field in hook_install()
My rule of thumb for deciding what to post on this blog has been to document anything I've spent more than an hour trying to figure out. Today I've got a good one for anyone trying to create CCK fields as part of a module's installation process.
Back in Drupal 5 the Station module was made up of lot of custom code to track various values like a playlist's date or program's genre and DJs. During the upgrade to Drupal 6 I migrated that data into locked, CCK fields that were created when the module was installed. As people started to install the 6.x version of module I began getting strange bug reports about the Station Schedule that I couldn't seem to replicate on my machine.
Everything is an update
For some work projects we've started making all the configuration changes via update functions. These get checked into version control and from there deployed to the staging site for testing, and then eventually deployed on the production site. The nice thing about update functions is that you can test it on staging and be sure that exactly the same changes will occur on the production site.
Here's a few examples, I'll continue to update it as I get more good examples.
Installing a module
Simple one liner to enable several modules:
<?php
function foo_update_6000(&$sandbox) {
$ret = array();
drupal_install_modules(array('devel', 'devel_node_access'));
return $ret;
}
?>A busy week... or two...
The total number of hours I've worked in the last seven days has been hovering between 60 and 70. We're on a deadline so compromised must be made and corners must be cut. Sections of the site are basically large JPGs with image maps of links on top. It looks good but when I peek into .tpl.php my head swims and I feel faint at the though of the kludges in place. It's lead to some fun exchanges:
coworker: "do you ever get to do a project where you don't have to end up hacking it at the end of the day"
me: "yeah the ones that never got finished :)"
Themeing a specific CCK field
I wasted more time that I want to admit do trying to figure this out. I was trying theme a specific CCK field named field_images on all the nodes where it appears. The devel_themer module was listing content-field-field_images.tpl.php as a candidate:

But after copying CCK's content-field.tpl.php into my theme and renaming it I couldn't seem to get the theme to pick it up. Roger López gave me the frustratingly simple answer on irc: "i think you need to have both templates in place"... duh. Copied content-field.tpl.php into my theme and everything worked great.
Text mode Cover Flow
My side project has been writing some code to display data from iTunes on my Heathkit H19 terminal.
Requirements
You'll need to use MacPorts to install ImageMagick and jp2a:
sudo port install jp2a imagemagickYou need to use Ruby's gem to install ncurses and appscript:
sudo gem install ncurses rb-appscriptThe Code
As of 24 May 2009, I've move this code to GitHub Repository. Now there's publicly accessible version control and people can fork and share changes.
Remi Pinaud is an accused Thief
I've just started reading Clay Shirky's new book Here Comes Everybody which opens by describing the story of a stolen Sidekick which is eventually returned after the owner's friend posts a webpage and an ad hoc group forms to help return it. It's an interesting story and fits nicely into Shirky's thesis.
It took on a new importance this morning when I received an email from my friend Dan telling me about Remi Pinaud, a French guy who'd been subletting his apartment, had stolen three iPods, two external hard drives and a digital camera. The worst part was that Remi is heading to Panama the tomorrow. Dan had been started doing his detective work locating the guy on social networking sites and wondered what I'd do.
My answer was that I'd start emailing everyone I knew about it then get on all the social networking site and start messaging all his friends telling them about it. Then I'd get make a video describing what he'd done and post it on every one of his YouTube videos. Basically an internet wide shaming process.
Dan's been busy today. He files a police report, tracked down a bunch of personal info on Mr. Pinaud, started working on the YouTube response video and started a blog titled: Remi Pinaud is a Thief to document it. The odds of Dan getting his stuff back are pretty remote at this point but I'm hoping that we can Google bomb that blog so that when ever anyone Googles his name they find out he's an accused thief.
Edited to make it clear that it's an accusation at this point. If Remi makes it back to NYC for his day in court we'll know one way or another.
Street View for the Historical Society
I was walking the dog around my the block at my grandma's house and started thinking that genre of historical cityscape photos that you'd find at a city or state's historical society. I find it absolutely fascinating to be able to peer into a snapshot of a place and time. It's both exciting and a bit scary to think how new technologies/databases like Google's Street View will probably be this period's equivalent. The exciting part is that the record would be exponentially more complete but the scary part is how fragile it is. You can't just drop a server off at the Historical Society and wish them well... even if you could it's hard to believe that any computerized record is going to last longer than silver based negatives and prints.
That then got pondering the possibility of using the modern techniques to record a city in the older, more stable medium of film. I don't see any way of making it commercially viable so framing it as an art project and looking for a grant would probably be the only way of funding it. Since it'd be an artistic undertaking I'd want the purity of capturing the image directly onto film rather than storing them digitally and then printing an analog image.
Having properly geo-coding images would be the entire point of the project so it would be critical to record the time and location that each image was taken. This would, in turn, require some custom (or customized) cameras. I'd want to use the same type of imprinting technology that records the date and time on a negative to also store the latitude and longitude--even cooler would be to record the approximate address. Rather than constantly changing film it seems logical to use the 1000 foot rolls of 35mm film that you'd find in a movie camera. The final component would be a computer and GPS to control the camera and provide the location.
The really interesting part that I haven't yet given any thought to would be figuring out how to present the images.
Getting PHP + GD + PostgreSQL working on OSX 10.5 (aka recompiling everything)
Finding myself in need of a PostgreSQL server to test some patches for Drupal core, I've decided to do a follow up to my guide to getting PHP + GD + MySQL installed on OS X.
Fortunately for me John VanDyk wrote up Beginning with Drupal 6 and PostgreSQL on OS X 10.5 Leopard which covers the nitty gritty of getting PostgreSQL server installed. He doesn't address recompiling PHP so I'll pick up the story there.
Last Updated: June 1, 2009
HOWTO: Views 2 Relationships
After getting sick of closing issues in various module's issue queues that boiled down to people not knowing how to use Views 2's relationship feature I decided to make a screencast explaining it:
http://drewish.blip.tv/file/1593750/
I think I need to get a microphone, and figure out all the features of the tool I was using but I'm excited to do more of these.
Obama/Biden vs. McCain/Palin: November is coming
My mom forwarded this to me. I usually don't get too many of this type of email from other relatives since they're mostly republican--and I tend to reply back fact checking them. But it's interesting to me to see this type of stuff flying around from the dem side... and I agree with it completely.
---------- Forwarded message ----------
From: Sacred Soaps <sacredsoaps@yahoo.com>
Date: Mon, Sep 22, 2008 at 10:54 AM
Subject: Obama/Biden vs. McCain/Palin: November is coming
To: My mom and 999 other people...
"I'm a little confused. Let me see if I have this straight...
* If you grow up in Hawaii, raised by your grandparents, you're "exotic, different."
* Grow up in Alaska eating moose burgers, a quintessential American story.
* If your name is Barack you're a radical, unpatriotic Muslim.
* Name your kids Willow, Trig and Track, and you're a maverick.
* Graduate from Harvard law School and be President of the Law Review, and you are unstable.
* Attend 5 different small colleges in 6 years before graduating, you're well grounded.
* If you spend 3 years as a community organizer, create a voter registration drive that registers 150,000 new voters, spend 12 years as a Constitutional Law professor, spend 8 years as a State Senator representing a district with over 750,000 people, become chairman of the state Senate's Health and Human Services committee, spend 4 years in the United States Senate representing a state of 13 million people while sponsoring 131 bills and serving on the Foreign Affairs, Environment and Public Works and Veteran's Affairs committees, you don't have any real leadership experience.
* If your total resume is: local weather girl, 4 years on the city council and 6 years as the mayor of a town with less than 7,000 people, 20 months as the governor of a state with only 650,000 people, then you're qualified to become the country's second highest ranking executive.
* If you have been married to the same woman for 19 years while raising 2 daughters, all within Protestant churches, you're not a real Christian.
* If you cheated on your first wife with a rich heiress, and left your disfigured wife and married the heiress the next month, you're a Christian.
* If you teach responsible, age appropriate sex education, including the proper use of birth control, you are eroding the fiber of society.
* If, while governor, you staunchly advocate abstinence only, with no other option-even in the case of incest or rape, in sex education in your state's school system while your unwed teen daughter ends up pregnant, you're very responsible.
* If your wife is a Harvard graduate lawyer who gave up a position in a prestigious law firm to work for the betterment of her inner city community, then gave that up to raise a family, your family's values don't represent America's.
* If your husband is nicknamed "First Dude," with at least one DUI conviction and no college education, who didn't register to vote until age 25 and once was a member of a group that advocated the secession of Alaska from the USA, your family is extremely admirable.
OK, it's all much clearer now.
Jack Weingarten"Mac mini RAM Upgrades
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.
Apple only sells them with 2GB of RAM but I'd read that you could upgrade them to 3GB. I figured what the fuck I'll just buy the 4GB and stick it all in and see what happens. Well the good news is that--as you can see from the screen shot--it'll use all 4GB.

If you do try to do the home upgrade read through this RAM upgrade walk through but skip their advice for getting the case off and watch this video instead. It has a much better technique that resulted in zero scratches. Be really careful putting it back together though, I tried to rush that and bent some of the tabs in the back so it doesn't seat quite right now.
Dodged the Bullet Poker Ride
It's better to have an ex-fiance than an ex-wife so come help me celebrate not being married.
Date: Saturday, August 9, 2008 - 6pm until late.
Get your bike ride on. We'll be hitting up five bars all over the city. The idea of the poker ride is that you throw down $1 as your buy in to get your first card at the Good Foot (2845 SE Stark Street, Portland, OR).
We'll stop at four more bars all over the city and you get an additional card at each stop. At the end of the night the person with the best poker hand wins the pot. The ride ends at my house and there's a keg of homebrew.
I'll be throwing $50 into the pot to make it interesting--and still a whole lot cheaper than a wedding. You can swap cards with other riders if you want to make some kind of a deal, so bring your friends.
Media sprinting
So back in April I started talking to Keiran at about doing a media and files sprint... well it's finally happening. aaronwinborn in in Portland and dopry is going to be helping remotely. Aaron posted a great writeup on what we're hoping to accomplish so I'll blockquote at length:
Andrew Morton (drewish), Darrel O'Pry (dopry, remotely), and I are heading up a Media Code Sprint in Portland this week! Come help, in person or remotely, if you're interested in multimedia and Drupal! It has now officially started, and as I've volunteered to help keep folks updated, here goes...
First the reasons.
Number One: Better Media Handling in Core
Dries conducted a survey prior to his State of Drupal presentation at Boston Drupalcon 2008, and number one on the top ten (or 11) list of what would make THE KILLER DRUPAL 7 Release was "Better media handling".
Let me repeat that. Better media handling.
People have done really amazing stuff in contrib, but it is difficult (if not impossible in many cases) for developers to coordinate the use of files, as there is no good means for file handling in the core of Drupal. Thus, we have several dozen (or more) media modules doing some small part, or even duplicating functionality, sometimes out of necessity.

