Learning Ruby – Day 13

Day 13 – Putting the Pieces together

Alright, we’re back to Ruby. My apologies for slowing down, and with only 8 days to go. Let’s jump right into day 13.

On the outset, Slagell explains the notion of Ruby being a ‘glue language’, like Perl. A language coordinating multiple programs or processes. Historically, AppleScript has been my glue of choice. AppleScript’s strength is also it’s greatest weakness – it’s not a real programming language. On the other side, I’m still looking for a comparable Windows-based scripting language.

I was first exposed to dot syntax back when Macromedia shoehorned it into Director’s Lingo language. It took me exactly 1 project to appreciate the simplicity and power. After that, it was REALbasic which has a great dot syntax. Especially useful for asking about files things – can I write to you? are you a folder? do you exist?

Rather than the FileName.exists syntax I’m accustomed to, Ruby prefers File.exists?(FileName). Though it feels a little backwards, I appreciate the question mark.

Ran into a little trouble today. Not sure what to make of it. Slagell, asks us to create two files, one with a puts string in it, and one with a string manipulation in it.

I was able to get them working just fine in the Terminal with: > ruby file.rb

He then uses the pipe character to route a string through the string manipulator: > system("echo foo | repeat.rb")

Terminal responded with: Badly placed ()'s

Hmmmm. Not what I expected. Removing the ()’s returned: No such file or directory

Perhaps one of you following along could illuminate me.

In the last exercise for today, my Ruby didn’t like the line:
Dir.entries(dir)
map {|f| File.join(dir,f)}.

to parse through a directory structure. It gave me a undefined method `map` for main:Object error. Odd I thought, so I read ahead and combined the two lines into:
Dir.entries(dir).map {|f| File.join(dir,f)}.
Looks like the map method needs an explicit list of things to go through. Good to know. Dot syntax to the rescue.

Tonight’s Soundtrack included:
Sing for the Moment‘ – Eminem
Alright‘ – Kinnie Star

Next, we officially start week 23. Exciting.


This post documents my journey through Sam’s Teach Yourself Ruby in 21 days. I’ll be joining Al Abut in his effort to learn Ruby and blog along the way.


Productivity Tip: Empty Your Dock

Back in the pre-OS X days, I used DragThing religiously to keep applications, websites, and documents at my finger tips. That mentality migrated with me to OS X – put everything in the Dock, keep it handy.

Today, I shed it.

Inspired partially by my preparation for the Tiger upgrade and partially by my proficiency with QuickSilver, I’ve emptied everything out of the doc. Only the Finder and Trash are persistent. Everything else, in when in use, out when not.

Even in the half-a-day I’ve made the change, I feel less distracted and more focused. Fewer temptations by Mail (finally a way to turn it off), IM, and NetNewsWire. Plus, I’m more aware of which applications I’m using and what I’m using them for.

Here’s a special half-tip for you (this one, I’ve been using as long as I can remember). Set your desktop to a solid, neutral color – I’m partial to OS X’s ‘Solid Grey’. This way, colors will shift less when you’re trying to find the right hex value and there’s generally less visual noise.

The Opposite of the Treo 650

I want a new phone. The menu interface on my SonyEricsson T610 is annoying and frustrating. Part of it is T-Mobile (a text message for each voice message isn’t necessary), part of it is SonyEricsson (a 12-step process for writing an SMS?), and part of it is me (highly critical behavior strategist & interaction designer).

I’ve been eyeing the Treo 650 for a while now and if T-Mobile was offering it I’d probably already have it. But they don’t and I don’t.

I’ve already talked about how BluePhoneElite is a necessity in my world. I use it for all my SMS writing and 90% of my phone calls. With BluePhoneElite, I only need to touch the handset to talk – if my Jabra was charged up, I wouldn’t even need to do that.

The more I think about how I use my phone currently (dial-up internet, voice calls, some text messaging, address book and calendar back-up), the more I want the opposite of the Treo.

Rather than a pocket computer, I want a peripheral – something that’s nearly useless on it’s own. I’m thinking of the phone version of the iPod Shuffle.

Here’s what I’m looking for:

  • No keypad, just a single button for dial/hang-up
  • Bluetooth for voice, data, dialing, address book and calendar synchronization
  • Voice-activated dialing
  • Audio Caller ID
  • No ringtones, just vibrate
  • Call Recording
  • Access call recordings, voice & text messages with a web browser
  • That’s it. Nothing more.

If you’ve seen anything like this, let me know.

PalmOne’s LifeDrive with Skype might be the answer (20 May 2005)

Captain Subtext and the Curse of Jeff Murdoch

Last weekend, Jen and I received BBC’s Coupling Season 1 off the Netflix.

The debut episode showed promise yet fell flat on us.

While I plugged away on some programming, Jen watched the remaining 4 episodes. Then we watched them again. Good stuff. They should have made the debut episode a hidden track, it didn’t belong with the others.

The lighting and camera work feels like Absolutely Fabulous plus the 1993 Hitchhiker’s Guide to the Galaxy (by the way, Jack Davenport would make an excellent Author Dent); a little over-exposed up front, extra-dark in the back, with all on-stage lighting eerily glowing in a cheap sci-fi movie way.

As soon as we finished Season 1, Seasons 2 and 3 were at the top of our Netflix queue. We gobbled up about half of Disc 1, Season 2 last night. I haven’t laughed that hard in a couple years.

Couldn’t breath. Laughing so hard.

First Crack 38. The Long Term Commitment of Placemaking

A conversation with Minneapolis urban planners Sam Newberg, from Joe Urban, and Jay on how making a place distinct takes a hundred years.

This conversation was recorded at Keegan’s Irish Pub in Minneapolis with two Radio Shack lapel mics going into an iPod running Podzilla.

Listen to the Long Term Commitment of Placemaking [12 min]

Got questions about coffee or comments about the show? Call: 206-20-BEAN-1

Like the show? Support the First Crack Podcast

Learning from the 24 Hour Comic Challenge

Yesterday, I attempted to create a 24 page comic in 24 hours. Here is what I learned from my first attempt.

  1. Have the story finished.
    I knew how the story started, that got me 6 pages along. Half way into page 7, I was stuck. Seven characters moving, a handful of relationships established, and nowhere to go. It’d be better to have a complete story ready and use the 24 hours to illustrate it.
  2. Like a marathon, training is required.
    The act of illustrating was stressful for both my brain and my hand. Numerous times throughout the 6 1/2 pages I completed, both refused to cooperate. Maybe there’s a Couch-to-5K plan for illustrators.
  3. Start early.
    I was reviewing student graphic design portfolios during the day, so the first time I put pen-to-paper was 6 hours into the 24. I should have gotten the students to help with the story.

Congrats to all those that participated and completed the challenge.

For the rest of us, next year will also have an April 23rd.

How to Set Up a Linksys Router with Mac OS X

B00007KDVI.01._SCTZZZZZZZ_.jpg

“INSERT CD FIRST”, screamed the sticker on the back of the Linksys wrt54g router.

A decade with Macintoshes has taught me the suggestions are normally for Windows machines. The router was persistent – and the sticker was blocking the power port – so, I thought I’d humor it. I was right. The CD shipping was filled with setup software for Windows. Nothing about how to setup from a Macintosh. Anywhere.

Everyone at Amazon said I’d be up and running in seconds. The Linksys site barely acknowledges Macintoshes exist.

Here’s the steps I took to setup a Linksys Router with Mac OS X

  1. Peel off the sticker on the back of the router.
  2. Plug in the router’s power cord.
  3. Connect the router to your modem via the supplied Ethernet cord and the port marked ‘Internet’.
  4. Connect the router to your Mac via Ethernet.
  5. Open up the ‘Network’ panel in the Mac’s System Preferences and plug-in the following specs:

    IP Address: 192.168.1.5
    Subnet Mask: 255.255.255.0
    Router: 192.168.1.1

  6. After applying the settings, open a browser to http://192.168.1.1 using the password 'admin'

Now you’re in the router’s control panel. Enter all your ISP’s settings and name your new wireless network something other than ‘linksys’.

Now you’ll finally be able to program from the gazebo in your backyard.

Greater Productivity By Turning Things Off

A couple weeks ago, I was having a tough time focusing. The culprit turned out to be a little red dot in my NetNewWire dock icon – the unread post count. I’ve unchecked that count in the preferences and my ability to focus has increased (Manton Reece did the same).

First, biologically, our peripheral vision is more sensitive than our direct vision. Second, our eyes are highly sensitive to the color red. Needless to say, tiny red dots arbitrarily showing up in the corner of computer screens are highly distracting.

Next step, find a way to turn off Apple Mail’s unread count.

Odd Friday in Minneapolis

I’ve been working out of the home office most of the week. Today was my first opportunity to spend some time around the city. You know – with other people. Glad I did.

I caught a slightly-punk late-twentysomething, walking casually down Nicollet Mall with full-grown macaw on his right shoulder. Yes, they were deep in conversation.

There isn’t a Dress Like a Pirate Day – I checked – and we’re months from Talk Like a Pirate Day, so I think this is normal in his world. Sweet. I was on the phone with Kari, so no photo. Sorry.

Hey, parrot guy, if you’re reading this, I’d love to interview your macaw on my podcast.

My neighbor’s roof is being redone. I get home, settle into my office and watch one of the roofers walk to the opposite side of my house and drink from my hose. Speechless.

First Crack 37. From Betty’s Bikes & Buns

A big thanks to everyone that helped keep Betty’s open. Betty’s is a great independent coffee shop and I’m happy to see the community pull together and keep it open.

Tom Roe owner of Betty’s Bikes and Buns and I talk motorcycles, community, and the best coffee in Minneapolis.

The First Crack podcast website has been recently redesigned. It now has episode voting courtesy of the Votio plugin from Asymptomatic.net. I want to thank First Crack subscriber Jonas Rullo for identifying and resolving a CSS issue with the new site. Thanks Jonas and good luck on your quest for a West Bend Poppery I.

Listen to From Betty’s Bikes & Buns [18 min]

Got questions about coffee or comments about the show? Call: 206-20-BEAN-1

Like the show? Support the First Crack Podcast