Monthly Archive for September, 2007

PERU ANA — ANA PERU painting in lower east side

Another PERU ANA - ANA PERU spotting. This time an elaborate pre-made painting affixed to a street sign in the lower east side, directly outside of Pianos if I remember correctly.

PERU ANA - ANA PERU vertical painting in lower east side

Wanted: More elegant syntax for adding associations to hashes in PHP and Ruby

Certain situations when adding elements to a hash result in pretty ugly code. I want the experience to be more like string concatenation. Consider these operations on strings, and their hash equivalents:

PHP:
  1. $string . ( $condition ? $morestring : '' );
  2. array_merge( $hash, ( $condition ? array( 'newkey' => 'newvalue' ) : array() )

RUBY:
  1. @string + ( @condition ? @morestring : '' );
  2. @hash.merge( @condition ? { :newkey => 'newvalue' } : {} )

Ruby's direct syntax for hashes is clearly a step forward, but I think this code could be even nicer. Why not alias + and << to merge and merge! ? I suppose there is a bit of a conceptual incongruity when comparing these operations to numbers or strings (because merge will replace elements in the left hash with those from the right hash in the case of key collision). But can you just imagine it...

RUBY:
  1. @hash.merge( @condition ? { :newkey => 'newvalue' } : {} )
  2. # Becomes...
  3. @hash + ( @condition ? { :newkey => 'newvalue' } : {} )

Ahhhh, much better. What do you think?

It’s 2007, and ring silencers are a hot feature on mobile phones in the US

This should be in The Onion, not an advertisement.

If we lose net neutrality, computer/web/internet advertisements might start to look similar: "Email attachments -- it's a Verizon thing."

Palm Advertisement showing off the phone’s ring silencer button.

How to use a RAM / memory disk for MySQL in Rails

I wanted to use a RAM disk for my MySQL data files when running my tests for a Rails project. I succeeded, but it only cut 2 seconds off of my ~30 second test suite for my functional tests, and didn't cut any time off of my unit tests. But nevertheless, here is how I achieved this, in case it is useful to others. All of this is on OS X, using MySQL 5 from Macports.

What we are doing is creating a RAM disk, and then creating a seperate MySQL instance that stores its data on that RAM disk.

BASH:
  1. # Create the RAM disk
  2. hdid -nomount ram://52428800
  3. newfs_hfs /dev/disk1
  4. mkdir /tmp/ramdisk1
  5. mount -t hfs /dev/disk1 /tmp/ramdisk1
  6.  
  7. # Initialize the MySQL environment
  8. mysql_install_db5 --datadir=/tmp/ramdisk1
  9.  
  10. # Start the MySQL server
  11. /opt/local/libexec/mysqld --basedir=/opt/local --datadir=/tmp/ramdisk1  --pid-file=/tmp/mysql_memory_localhost.pid --port=10000 --socket=/tmp/mysql_memory.sock
  12.  
  13. # Create your test database
  14. mysqladmin5 --socket=/tmp/mysql_memory.sock -uroot create projectname_test

Now in your database.yml file, add socket: /tmp/mysql_memory.sock to the test database configuration.

(thanks to this tutorial for how-to create a RAM disk in OS X)

UNC victory over Duke 2006

Here are some photos I dug up off of an old cameraphone. UNC and Duke have a ferocious basketball rivalry. These photos are from the celebration in Chapel Hill after a UNC victory, I think in the first of 2 UNC-Duke games in 2006, when i was working at ibiblio. The celebrations are happening on Franklin Street, just a 5 minute walk from the ibiblio office.

I didn't have any UNC garb at the time, but I had various blue clothing items, the shade of which were, unfortunately, an even mix between Duke blue and UNC blue, so I got a lot of confused looks and the occasional expletive.

The photos are really poor quality, but the general idea is that there are couches and random piles of debris set aflame in the street, and there are people jumping through the fire.

The next day in a class I was taking, there was a kid whose arm and I think leg were wrapped in bandages, from burn wounds.

UNC Victory celebration - gathering around a fire

UNC Victory celebration - jumping over fire

UNC victory celebration

PERU ANA - ANA PERU chair

I've seen the tag "PERU ANA - ANA PERU" around my neighborhood quite a bit. The other night, I found this right around the corner from my apartment.

PERU ANA — ANA PERU tag on a chair left for garbage pickup

An extreme case of the value/effort/ephemerality balance of street art -- a really fun, unique, and perhaps powerful presentation, but of course it will only last until the garbage is picked up the next day.

IRL Comments

I like how this notice on the wall of my apartment building was seen as an opportunity to give feedback to the management. An indication of blog and wiki concepts permeating our culture? Or the human traditions of expression and dissent that have existed for millennia and inspired such tools in the first place? Truth is, I'm too young to know the answer.

Change your smoke detector batteries reminder, with tenant message “paint the walls a nicer color!”

My anonymous neighbor is right, the walls are pretty nasty:

The ugly wall color in question.

Walter Murch’s film editing metaphors

How important is music to the process [of editing]? It's tremendously important. I think if you kept a running list of the metaphors that I use when I try to talk about editing, most of them are about music. And those that aren't about music are about architecture, which is famously frozen music. And the rest have to do with cooking hamburgers or something.

--Walter Murch




Close
Powered by ShareThis