Kung Fu Crimewave’s Capitol Punishment

I recorded the Kung Fu Crimewave album Capitol Punishment in autumn/winter 2009. Neil just posted a great music video for “Kill for the Side”. While I’m at it, I’m also sharing Preston’s video for “What do I do?”.

Posted in Recordings, Videos | Leave a comment

Rails’s DB-Insensitive Case Insensitivity

I’ve been working with Rails for the past few weeks. But seriously, folks, it’s been great. Anyway, what are we all here for? To hear about my first big trouble with Rails.

We had a simple request at work to make a database field case-insensitive. Which is all to say, we had to make this touch field’s once defaultly true case sensitivity:

validates_uniqueness_of :a_touchy_field

into a blatant lie:

validates_uniqueness_of :a_touchy_field, :case_sensitive => false

And this is why Rails is so great. We’re done!

BUT WAIT. WHAT ABOUT THE BIG TROUBLE?

Oh right! Well, this field is very touchy. Touchy like… millions of rows touchy. And it didn’t like all this insensitivity we we’re giving it. And neither did MySQL. There’s a lighthouse ticket all about it.

The issue is that to keep things DB-neutral, Rails is having MySQL perform a LOWER() on that field on each row to do a binary comparison for the uniqueness validation. How unkind to our conveniently indexed database field.

By default, MySQL does a case-insensitive string comparison. So we rolled our own uniqueness validation…

def TouchyModel < ActiveRecord::Base
  validate :ensure_unique_case_insensitive_touchy_field

  def ensure_unique_case_insensitive_touchy_field
    if new_record? || a_touchy_field_changed?
      if TouchyModel.exists?(:a_touchy_field => a_touchy_field)
        errors.add(:a_touchy_field, "must be alone, or else it'll get whiny")
      end
    end
  end
end

This lets us tip-toe around the call to LOWER() and get on with our validations using the default MySQL comparison.

Posted in Computing | Tagged , , | Leave a comment

Road Fooding

More photos from my cross country adventure with Erin.

4 quarts of food, cooked in the Badlands during a rainstorm. Uneaten.

4 quarts of uneaten Indian food

The badlands campsite.

A blue tent and covered table on the Badlands

Nighttime Cooking.

Erin stirring up an evening brew

Crabill’s Hamburgers

The tiny burger joint

Tiny burgers in a tiny diner

Tiny burgers in a tiny diner

Mug n’ Buns Drive-in

Paper menu and big metal box to summon the server

Paper menu and big metal block

Rainy day soda shop

The soda shop on a rainy day

Campsite Cooking

Sour cream raisin pie and a sticky roll

Pie and sticky roll on diner table

Bob’s

The large diner sign for Bob's

No Parking Except for BOB

The mega bob meal – burger, two sodas, fries

Mega Bob Meal - burger, two sodas, fries

Posted in Images, Writings | Leave a comment

Hard drive backups

My reliable-so-far computer has been making a “tick tick” sound in the fan recently. I’ve never been one to keep backups of my personal work, but doing freelance work for the past year and a half has made me a bit paranoid about losing my personal and work data. Time to backup!

Jamie Zawinski’s backup PSA is my favorite document about backing up data. So I ordered one of the new hybrid drives mentoned on Coding Horror and got it in the mail a few days ago.

I’ve copied disks using dd in the past, but it’s silent output always leaves me concerned. This time I went with Clonezilla Live, a simple-to-use Debian-based live CD whose sole purpose is to duplicate disks. Easy!

My next little hurdle was when I put in my hybrid drive and put the old drive into an external enclosure. My machine booted fine, but when I plugged in the external disk, it wouldn’t mount. Ubuntu 10.10 was attempting to mount the external disk to the root of the filesystem. This line in /etc/fstab was the culprit:

# <file system>  <mount point>   <type>  <options>         <dump>  <pass>
# / was on /dev/sda1 during installation
UUID=<some-uuid> /               ext4    errors=remount-ro 0       1

The first change I had to make was to change the UUID on the external disk. I used the following command to do so:

tune2fs -U random /dev/sdb1

Then, I updated the fstab like so:

# <file system> <mount point>   <type>  <options>                         <dump>  <pass>
UUID=<new-uuid> /media/backup   ext4    user,nobootwait,errors=remount-ro 0       2

The external now mounts to /media/backup, is mountable automatically by ubuntu since the user option is set, and fsck will check the drive last since pass is now set to 2. nobootwait prevents the machine from booting if the disk is not present.

I dropped this in a file, and now I have an easy command to backup to a bootable drive!

#!/bin/sh
sudo rsync -vaxE --delete --ignore-errors / /media/backup/
Posted in Computing | Leave a comment

Fears of Toy

I really like Toby’s art blog. We did a drawing with Preston which I didn’t get to see the end of until it showed up there.

a drawing by toby goodshank, preston spurlock, and myself

Drawing is really fun when amazingly talented artists help finish your work.

Posted in Images | Tagged , , , | Leave a comment

Wordsmith Words

limen (LY-muhn) noun

A threshold of response: point at which a stimulus is of sufficient intensity to generate a response.

[From Latin limen (threshold).]


Pygmalionism (pig-MAY-lee-uh-niz-uhm) noun

1. The state of being in love with an object of one’s own making.

2. The condition of loving an inanimate object such as a statue or image.

[In Greek mythology, Pygmalion was the king of Cyprus who carved a female
figure in ivory so realistic and beautiful that he fell in love with her.
The goddess Aphrodite took pity on him and responded by bringing the statue
to life as Galatea. Pygmalion married her.]


cathect (kuh-THEKT) verb tr.

To invest mental or emotional energy in an idea, object, or person.

[Back-formation from Greek kathexis (the investment of emotional energy in
something). Ultimately from the Indo-European root segh- (to hold) that is
also the source of words such as victory (to hold in a battle), hectic,
scheme, and scholar.]


cerebrate (SER-uh-brayt) verb tr., intr.

To use the mind: to think, reason.

[Back-formation from cerebration (act of thinking), from cerebrum (brain).
Ultimately from the Indo-European root ker- (horn or head), which is also the
source of words such as unicorn, horn, hornet, rhinoceros, reindeer, migraine,
carrot, carat, and Hindi sirdar (leader, from Persian sar: head).]


psychopomp

A guide of souls, one who escorts sould of a newly-deceased to the afterlife

[From Greek psychopompos (conductor of souls), from psycho-, from psyche (breath, spirit, soul) + pompos (conductor, guide).]

Posted in Writings | Tagged , | Leave a comment

Car Tripping

All from a cross-country drive spanning June 7-21.

A low-riding Volvo from New Jersey to Philadelphia…

A low riding '93 Volvo wagon

…drove to Kooser State Park in Pennsylvania on June 7…

A headlamp-lit tent in the evening hours.

The Volvo's doors are wide open while the tent is deconstructed

…through Ohio to Shades State Park, Indiana on June 9…

Indiana Campsite

… to a campsite off the Mississippi in Illinois on June 10 …

Car door open, tent and table above.

… then Great River Bluffs State Park in Minnesota on June 11 …

Camp packed, the car is ready to go

… outside of Bob’s Diner on June 12, we check in on low riding-ness …

Ride low, sweet Volvo

… still low. Continue to Vermillion State Recreation Area, June 12 …

The tent sits behind a wagon-style covered table

… and then see some Presidents on June 15th …

The dead presidents faces peek out of Mount Rushmore

… and also Crazy Horse …

A silhouette of the projected crazy horse sits in front of the actual sculpture

… but before all that, we got to see The House on the Rock’s Infinity Room …

A seemingly infinitely long room

… which looks like this from the outside …

Photo of a photo of the infinity room exterior

… but not backwards, forwards, cross the Utah Salt Flats …

A sea of Salt

I stand on salt

A close up of the salt - it looks like snow.

… and into Sonoma county …

Silhouette of a winemaker standing above the sunset-lit highway

Posted in Images, Writings | Leave a comment

Sort Criteria not used in Drupal View

I was having trouble with the Drupal Views module. I have a view of a CCK Node, and I wanted to sort the view by one of the CCK data fields. The view was sorting on node id by default.

Adding the CCK content field to the “Sort Criteria” gave no change in the SQL query. I struggled with this for a good hour before deciding to create my view from scratch.

Once I recreated the view, I found that sorting by columns is handled in the table style settings. The not correctly sorted view was using the table style; I went back to my original view’s table settings and was able to sort by other columns by default.

Posted in Computing | Tagged , , | 3 Comments

Multiple Images for Ubercart Products

I’m working on a Drupal site with the Ubercart package. I’m learning both at the same time, which is a challenge since they each offer so many options. Below I’ve listed some troubles I came across while I fighting to get multiple images for the UC Product content type.

Don’t Change Product’s Display Field “Image”

Well, you can if you know what you’re doing. But I had mistakenly updated the display fields for the product content type at Home › Administer › Content management › Product › Display Fields to be ‘product_full image linked to image’ for ‘full node’. The reason I shouldn’t have done this is because UberCart handles the images itself. Head over to Home › Administer › Store administration › Configuration › Product Settings to choose a Product Image Widget.

None available? Install one off the Lightbox2 or Thickbox modules to have an option.

Uploading Multiple Images

Oh! the pains of learning. Months ago I attempted to add another Image field to the Product content type. It led nowhere and took up a lot of my time. Today I learned that the CCK Image Field offers the option of multiple images. Simple!

Head over to Home › Administer › Content management › Product › Manage Fields › Image. Under “Global Settings” there is an option for number of images to allow.

Contemplates for UberCart Products

Now: my image fields are hidden from the product pages. I have an image widget set for UberCart. I’m using the Contemplate module for product node rendering. How do I show the image widget?

There is probably a better way, but I found it by using the get_defined_vars() function. Reviewing the output of that function from my product node template revealed the image widget to be in $content['image']['#value']. I dropped that in the template and had the lightbox triggering widget showing all product images.

For easier review of get_defined_vars output, install the Devel module, and use this line of code:

<?php dpm(get_defined_vars()); ?>
Posted in Computing | Tagged , , , | 1 Comment

Make Love, Speak Tongues

It’s December 2009. I just performed a show with Sam James from The Wowz. Sam spouts words like few people, and with a guitar in hand he lets loose melodies that shortcircuit my brain with their unpredictable perfection. Working with others, especially those I rarely work with, always shifts my perspective on my own work. Sometimes it changes everything; sometimes it changes nothing. Other times it gives me ideas – new or stolen.

I wake up on Saturday morning, with no plans for the day. The temperature in my home drops low, low, low. Wrapped in a too big blanket, I stand in my living room looking at my breath, looking at Tarot cards. While strumming a stolen idea on my guitar, I imagine a being outside of time and space explaining the images to me, and next thing I know I have way too many words written down.


Below sits another 4-track tape recording, this time from early January 2010. The recording is of the song in progress. I’ve since updated some lyrics. The lyrics are below, coupled with the Camoin/Jodorowsky Tarot de Marseille cards that the being described.

Audio clip: Adobe Flash Player (version 9 or above) is required to play this audio clip. Download the latest version here. You also need to have JavaScript enabled in your browser.

Download “Make Love, Speak Tongues” by Dibson T Hoffweiler

XVI - The Tower

Outside of my mansion is rock garden made of gold,
and the people I tend to it are as ageless as they’re old.
If they’re on their hands and knees, I’ll set them to their feet,
And if they look up to me then I’ll set myself beneath.
Cos I’ll never get to meet them – no, I’ll never quite there be,
So I just want to give them the love they give to me.

But I don’t know anything
about making love
I just wanna speak in their tongues.

XVII - The Star

I see the stars above me make a perfect figure eight.
They’re still but ever-moving at an infinite rate.
I know that they’ve been there for as long as I’ve been me,
And they’ll continue to be there until I set them all free.
When I make that true, none will be alone,
And love will cover this world like a melting ice cream cone.

But I don’t know anything
about making love
I just wanna speak in their tongues.

XVIII - The Moon

I swim inside the swimming pool that sep’rates two dumb kings
In kingdoms situated such that none’s allowed to sing.
I say that that is silly, and then I sing that it’s so.
They say I must stay away, and I say they both blow.
But if they really blew they’d not be so down in the dumps.
They’d be just like their dogs, whose legs they wanna hump.

But I don’t know anything
about making humps.
I just wanna speak in their tongues.

I travel back in time, now, to see you standing on the stage.
I’ve words to share with you, but that time I’ll never change.
It’s as perfect now, as it was back then.
It’ll be perfect later when it happens again.
I made it happen once now, and that’ll be enough.
If you go back to change it, then I’ll know true love.

But I don’t know anything
about making love.
I just wanna speak in their tongues.

Posted in Recordings | Tagged , , , , | Leave a comment