Monthly ArchiveNovember 2007



Programming Languages &Science &Software 29 Nov 2007 04:32 pm

Comments on “A Program is an Idea”

“A computer is like a violin. You can imagine a novice trying first a phonograph and then a violin. The latter, he says, sounds terrible.”

Eugene Wallingford comments on comments received on his recent entry, ‘A Program is an Idea.’

This is timely given recent conversations I’ve had about getting kids interested in programming. Mark Guzdial’s recent discussion of introducing programming is relevant as well.

(Via Knowing and Doing.)

Muzak 24 Nov 2007 02:21 am

Andres Segovia Videos on Youtube

I am not sure why I never thought before to look for videos of the great classical guitarist Andres Segoiva on Youtube before, but, lo and behold, there are tens of them. I particularly enjoyed this: Andres Segovia – Sor Op. 9.

His performance of Asturias is also amazing.

Software 23 Nov 2007 07:06 pm

Using Google to Crack Hashed Passwords

Using Google to Crack Hashed Passwords is very clever, but only works if software developers are dumb enough to store raw password hashes anywhere, and if people choose passwords made out of real words.

(Via Crypto-Gram.)

Apple &Software 20 Nov 2007 05:59 pm

10.5.1 Kills Safari

I updated to 10.5.1 and Safari wouldn’t launch. Instead, it told me I could not use this app with this version of OS X.

This article on the Apple support discussion board has a fix for the problem.

Broken permissions. So, the quick solution. Drag the app (Safari) to the desktop, and then back to Applications. That essentially fixes the permissions. WTF Apple?

Programming Languages &Science 16 Nov 2007 02:08 pm

Ruby used on the Enterprise RubyWorks overview – ThoughtWorks Studios

RubyWorks at ThoughtWorks Studios
: “More than forty percent of ThoughtWorks’ new consulting projects in the U.S are now developed using Ruby on Rails.”

Sweet. I am not surprised at all.

Humor &Philosophy &Software 16 Nov 2007 01:06 pm

Rands In Repose: The Nerd Handbook

Rands In Repose: The Nerd Handbook is funny, though not completely accurate. Still, it’s funny and this bit is scary funny:

“Your nerd has built an annoyingly efficient relevancy engine in his head. It’s the end of the day and you and your nerd are hanging out on the couch. The TV is off. There isn’t a computer anywhere nearby and you’re giving your nerd the daily debrief. “Spent an hour at the post office trying to ship that package to your mom, and then I went down to that bistro — you know — the one next the flower shop, and it’s closed. Can you believe that?”

And your nerd says, “Cool”.

Cool? What’s cool? The business closing? The package? How is any of it cool? None of it’s cool. Actually, all of it might be cool, but your nerd doesn’t believe any of what you’re saying is relevant. This is what he heard, “Spent an hour at the post office blah blah blah…”

You can be rightfully pissed off by this behavior — it’s simply rude — but seriously, I’m trying to help here. Your nerd’s insatiable quest for information and The High has tweaked his brain in an interesting way. For any given piece of incoming information, your nerd is making a lightning fast assessment: relevant or not relevant? Relevance means that the incoming information fits into the system of things your nerd currently cares about. Expect active involvement from your nerd when you trip the relevance flag. If you trip the irrelevance flag, look for verbal punctuation announcing his judgment of irrelevance. It’s the word your nerd says when he’s not listening and it’s always the same. My word is “Cool”, and when you hear “Cool”, I’m not listening.”

And the real question: “what is your trip word?”

(Via Ranchero.)

Muzak 16 Nov 2007 03:35 am

Guitar Music

Kevin is looking for good music and I had been meaning to create a list of guitar-related music anyway. I repeat it here for my own reference.

Here’s a list, not just of Latin stuff, but of great guitar stuff. Be warned, I’ve been meaning to make this list for along time, so it got pretty long (future me says).

Paco de Lucia — Killer nuevo flamenco
anything on Cositas Buenas

Paco Peña — The best traditional flamenco player in the world
The Art of Paco Peña album is a good survey

John McLaughlin — Very progressive guitar from the 70’s.
He played with Miles Davis on Bitches Brew.
He also had a band called the Mahavishnu Orchestra.
The Dance of Maya on The Inner Mounting by Mahavishnu Orchestra is insane. Really.
Friday Night in San Francisco with him, Paco de Lucia, and Al DiMeola is an amazing album. I can’t froth enough. Particularly, Short Tales of the Black Forest

John Williams — Amazing Classical Guitarist
I am particularly enjoying his album The Great Paraguayan songs by Barrios
Vals No. 4 rocks

Andres Segovia’s Bach Recordings are superb, and very intricate stuff, might get a kid interested due to the technical complexity

AC/DC — Back in Black, Hells Bells, Highway to Hell

Sonic Youth — Alternate tunings inspired by PCP
Titanium Expose on Goo

The Allman Brothers Band — Duane Allman and Dickie Betts — dude
Blue Sky
In Memory of Elizabeth Reed
Hot Lanta
Les Brers in A Minor

Yes – Steve Howe rocks
Mood for a Day
The Clap

B.B. King — have him listen to how he phrases and uses slides between notes.

John Lee Hooker and Muddy Waters — Easy to play, but the soul of all rock
Boom Boom Boom

Howling Wolf
Little Red Rooster, Killing Floor

Stevie Ray Vaughn
Lenny
Cold Shot

Built to Spill — emo rock, but good stuff
The Plan

Charlie Hunter Quartet — Great guitarist, plays an 8 string: 3 bass 5 treble strings
Come as you are is a good intro

Cream — Eric Clapton
Anything

Django reinhardt — might be too far out for him, Great Gypsy Jazz from early last century

Enrique Coria — Superbly played latin music, many different south american and central american folk styles. He lives in San Rafael too.
Nevando Esta on The Guitar Artistry of Enrique Coria

Jane’s Addiction
Idiots Rule on Nothing’s Shocking

Jimi Hendrix
Add Crosstown Traffic to the list

Larry Coryell — Intense Jazz solo guitarist
Giant Steps on Dragon’s Gate

Steely Dan
Kid Charlemagne
Boddisattva

Led Zeppelin
Add, Since I’ve Been Loving You, Celebration Day — OK, all of III, In my Time of Dying form Physical Graffiti

Smashing Pumpkins
SilverFuck on Siamese Dreams

Metallica
Battery, Master of Puppets on Master of Puppets

Clapton
Add Sunshine of Your Love,

Neil Young
Down by the River

Piglet — Math Rock, A little repetitive, but fun and intricate cycles,
Little Bubble, Where You Going? on Lava Land

The Police
Synchronicity 2

The Raconteurs — Jack White from the White Stripes
Steady as She Goes, Level from Broken Boy Soldiers

The SilverSun Pickups new Song, Lazy Eye has some decent guitar

Queens of the Stone Age
Little Sister, Go with the Flow

Robert Cray
Smoking Gun

Robert Johnson
Cross Road Blues

Roy Rogers
Spanish blues

Santana,
I would pick Guajira, and Jungle Strut in addition to Black Magic Woman, and Soul Sacrifice because it is one of the best songs ever

Sugar
Gift on File Under Easy Listening

U2 —
11′ O Clock tick tock, Bullet the Blue Sky, Sunday Bloody Sunday

Unwound
Hexenzsene on New Plastic Ideas

Tortoise
Swung from the Gutters on TNT

Stray Cats
Stray Cat Strut

PJ Harvey
Sheela-Na-Gig on Dry — Note, this has pretty mature lyrics, but it’s tough music, and there is some great guitar in there as well.

Circle Jerks
When the Shit Hits the Fan, or Coup D’etat on Golden Shower of Hits — Punk Rock!

Dead Kennedys — East Bay Ray makes the guitar do his bidding, and besides everybody should enjoy the sarcasm of the Dead Kennedys
Holiday in Cambodia, California Uber Alles — Punk Rock!

Bad Brains — Bad Ass Rasta Punks from D.C.
Fearless Vampire Killers, Banned in D.C. on Rock for Light — produced by Ric Ocasek

Fugazi
Waiting Room on 13 Songs

OK, not punk, but also

Heart – Barracuda

Alright, I’m quitting now. I feel like John Cusack’s character in Hi Fidelity.

Language &Philosophy &Programming Languages &Software 12 Nov 2007 11:35 am

Document the Difficult Stuff, not the Easy: Rails Tutorials

I found Rails Tutorials pretty handy. They are short and sweet focusing on only one particularly problem per tutorial. I also found some good discussion in the comments of each tutorial. With their help, I finally got my head around how to deal with creating complex relationships of objects and dependent objects so that they are put in the database atomically, and so that they are available for error correction on the form if there were validation errors.

A big part of the problem I was having is that there are a million tutorials on the simple stuff in Rails and ActiveRecord, but very few on doing real work. There are many features of the Rails framework that I have just happened across accidentally, or that I had to scour the net and books looking for examples.

The one particular bug, err… feature, that has been haunting me is how to create an object that has a complex join model, and have all the other objects in that model get created automatically.

It is obvious enough for me to do it by hand. For example, creating a Registration for multiple People for multiple Courses, with other related information like Payment choices and related details to the Registration. When I get back a form, I could pick out each parameter set in my form fields. I could then create each object, Registration, People objects, Payment details, etc.. and then set them on the Registration object.

@registration = Registration.new(params[:registration])
new_payment = Payment.new(params[:payment])
@registration.payment = new_payment;
@registration.people = params[:people].collect { |[], person| Person.new(person) }
@registration.save

But rails should be able to do all this automatically since I already specified the relationships in the model objects. Well, turns out it can. You can use the build method on the model objects.

params[:people].each {|person| @registration.people.build(person) }

However, this doesn’t work for has_one or belongs_to objects, for those you have to call

@registration.build_payment(params[:payment])

Notice that this seems to be some sort of method_missing magic. I haven’t hunted down where this gets handled, but more troubling to me is that I never knew it even existed. I am glad I found it of course, but it is the first time in Ruby I have had the feeling that dynamic features could be bad.

I know the horror stories of dynamic languages and the claims for static typing and so on, but by and large I have not had this problem with Ruby, and I have probably written about 15-20kloc of Ruby now. Not a great amount, but not a trivial amount either given the expressiveness of the language.

Maybe I should have learned Rails by looking at the test suites. Perhaps within that code I would’ve found examples of build_x and that would have clued me in. I don’t know if those tests exist, but still I think that tutorials can be more efficient communication than test suites.

Of course that depends on what tutorials get written. My Request:

When writing tutorials for programmers, just write the tutorials for the hard stuff.

This should be the priority. Assume that programmers can figure out the obvious stuff, and spend your time on explaining the hard, hidden parts of the framework.

Programming Languages &Software 12 Nov 2007 10:29 am

LLVM Tutorials

LLVM Tutorials shows how to build your own language targeting the LLVM. The LLVM is a cross-platform low-level virtual machine that already comes with tools for bytecode analysis and optimization.

I’ll be curious to see how flexible it is for creating dynamic languages in comparison to the JVM.