Michael Buffington

I Heap Scorn Upon Ruby's Time Class

Tuesday, October 10 2006

So this is a pure out and out rant against Ruby, and it’s short, and when it comes down to it it’s the kind of rant that gets hard core developers to say “so just do it the right way yourself”. To them, I say “do it the right way yourself” preemptively and launch into my rant.

The Ruby Time class sucks. If I do Time.now, I get back a time object tied to my current time zone, which it determines by looking at what time zone my computer is set to. Not that big of a deal.

>> Time.now
=> Wed Oct 11 00:01:43 PDT 2006

The problem is, I can’t adjust that time zone at all, not without some pretty serious hacks, and that’s stupid. I can’t even create a UTC time (essentially Greenwich Mean Time) and say “Hey, this time here, let’s convert it to Mountain Standard Time”, or even GMT-7 for that matter. Once it’s UTC, always UTC. Once it’s PDT, always PDT.

Of course there are hacks (and truthfully, I’ve already come up with a not so elegant solution which I won’t yet share [can’t effectively rant and foam at the mouth with a solution in hand]) but Ruby should just make this easy. I should be able to do:

>>t = Time.now
=> Wed Oct 11 00:01:43 PDT 2006
>>t.convert(“GMT-6”)
=> Wed Oct 11 01:01:43 MDT 2006

But I can’t. I can’t even extend the Time class by making a Time#convert that will return the time as MDT without converting the original time to a string, individually poking at it’s parts, messing with system internals that may break other stuff, and hope that it’ll go quickly.

Ruby, why do you hurt me so?

Also, I know about TZinfo and it’s giganté sized pile of international time zones. It’s a good library, but not very fast, and converting one time to another time when you don’t know exactly what zone you’re converting too or from is nigh impossible.

Perhaps when Ruby is back in my good graces (tomorrow morning after a vigorous night of sleeping) I’ll write up my solution.

In Which I Describe My Lovely Saturday

Saturday, October 07 2006

Today was full of ambition, full of failure. To start:

Went to get the truck’s crunchy feeling brake pads replaced. Had an appointment and everything, and after the mechanic looked at if for two hours, he came back out and said “All set, we made some adjustments and replaced your wiper blades. And oh, the only way to fix that crunchy feeling is to replace your brake pads, otherwise the rotor will get messed up.”

I asked if he could just do that now, and, seriously, he said “Oh, well, we’re all booked up now, you’ll have to make an appointment.”

Later on I figured I’d have a better hand at making some code work for a client project I’m finishing up. In this case, I needed to get ImageMagick and Ruby to work nicely with each other on my machine.

Let me just say this – if the journey to get that combo working starts in say, Los Angeles, then the destination is, I don’t know, somewhere at the core of Jupiter. I have never in my life seen such a brittle installation of software. One part requires another part, which requires another part of a certain version, which in turn needs all parts to be Capricorns unless they were born in a leap year at which point they need be Sagitarius, and you must make sure you already have a natural gas dryer, fourteen boa constrictors, three of them female, an Audi Quattro balancing on two wheels, a Pygmy who can speak Mandarin while feeding narcaleptic goats with his belly button, and a bathtub full of nachos, cats, and silent children.

And so, I spent nearly my entire day working feverishly, but getting absolutely nothing accomplished.

This sort of thing grinds me up because it’s hard enough to get deeply into flow in the first place to solve these kinds of problems – when it’s fruitless is seems like all the more the waste, and especially so when you’re working on a Saturday so that when Monday comes you can work on the good stuff without feeling swamped.

Strokes and Christina Aguilera Mashup

Thursday, October 05 2006

This has been floating around for a while but I seem to forget where to find the Strokes + Christina Aguilera mashup everytime I want it. It’s a prime example of what might be possible if record labels stopped locking down music and began opening up.

Here’s the MP3 of the mashup (which is of course wonderful) but even more wonderful is that there’s a video mashup as well.

llor.nu Up Again

Tuesday, October 03 2006

I’ll be doing a presentation on llor.nu tomorrow at the AjaxWorld Conference in Santa Clara, so I decided to pull llor.nu out of sabattical and get it back online and ready for play. I’ll leave it this way until the new version comes out.

If you’re at the conference, come say hello. Here’s what I look like.

Enjoy!

Happy Birthday Kid

Wednesday, September 27 2006

Exactly four years ago Carrie was starting to go into labor with Leah, our first child, and I was not as calm as I seemed at the time.

Four years later and I’m simply dumbfounded over how intelligent, creative, funny and serious Leah can be. It’s funny how you can look back at a child from the day their born and say “ah, yep, she was like that the second her head hit the air”. You have no idea then that those same sorts of behaviors and personality traits will stick around and strengthen.

A month or so after Leah was born she became very disciplined at screaming her head off from about 7:00am to 10:00pm, all day long for three months solid. It was the test of all tests. She timed the screaming to coincide with our first winter in Oregon which was quite the shocker having come from Southern California (and having lived in perfect weather our entire lives). We assumed every day for the rest of our lives would be dark and dreadful, filled with the sounds of screaming children. We went slightly insane to say the least.

At exactly three months (to the nanosecond) of screaming she stopped. She turned into a pudgy happy little baby who was content with the world. Everything was interesting, and everything was something she needed to be a part of. She figured out that her appendages were on her team, and she made quick work of convincing them with different ploys to do what she wanted.

She still excels at this sort of thing today, and she can be quite convincing. What were once merely grunts and wiggles have now turned into multi-dimensional plots with traps that pit parent against parent in a way that assures she wins. I’m considering hiring a lawyer to just sort of hang out and who can pull apart her machinations and combinations so I can at least have some advantage.

The tricky thing about being able to look back on your child’s life thus far and say you could have predicted something is that you really can’t. It all makes sense in the end, but if you were to ask me right now what kind of stuff I think Leah would be interested in in five years and I could only venture a guess.

Asked today, I’d say she’ll be Goth, as she’s already pretty obsessed with anything gruesome or disgusting. One of her first sentences was “It’s dead!”, referring to a dead dragon fly which she studied for a long time. She broke down in screaming laughing fits once after seeing some kid on TV tentatively poke a dog in the anus, the dog jumping from the intrusion. Ask what her favorite movies are and she’ll say “Nightmare Before Christmas, Spirited Away, and Howles Moving Castle”. Not your exact four year old fare. I suspect on some level she’ll always allude the norm and I can only hope and pray she continues to be weird and do and like what she likes. This is a girl who, when finding a snake in the backyard, carries it around and kisses it for hours, and I wouldn’t trade that for anything on this planet.

Happy Fourth!

Firefox Gaining Ground

Wednesday, September 27 2006

Some quick stats: for the month of August 49% of visitors to this site used Firefox. For September so far, over 57% of visitors use Firefox. In both months, visitors who use Internet Explorer are only in the 20% range, with other unknown browsers making up the rest.

September was a high traffic month as well, so I would have actually expected it to shift less in favor of Firefox.

If you’re on a PC and you’re not yet using Firefox you might as well just give up. Children in Indonesia own your computer despite your best efforts. Go get it and never open Internet Explorer again.

In Which I Discuss the Ways of the Presumed Secret Service

Tuesday, September 26 2006

Yesterday I was nearly killed in what was almost a serious car accident. Traffic in front of me on a city street stopped abruptly, and I was able to come to a pretty smooth stop. Looking in my rearview mirror revealed that the rather massive black SUV who had been following some distance behind hadn’t yet understood that traffic in front of him was at a dead stop. I realized, as he rapidly approached, that he still hadn’t noticed and unless I got out of his way was going to slam right into me at what I estimated to be about 45-50 miles per hour.

So I gunned my underpowered hybrid while steering out into the middle turn lane, and he noticed just in time and swerved off to the right, very narrowly missing me and taking flight off the curb, travelling at least ten car lengths down the sidewalk, coming to a stop on the bank.

I went through several very rapid phases immediately during and after this near death experience. There was the Many Obscenities Phase, the You Crazy Bastard You Nearly Killed Me phase, the I’m So Glad I’m Still Alive phase (which didn’t really kick in until I’d begun moving again for a few minutes), then there was the final I’m Glad That’s Over, What’s For Lunch phase.

I was happily into the final phase of this experience when I entered an entirely new and wholly unanticipated phase – the That Black Suburban Is Now Pulling Me Over phase. The human brain is capable of many things, and it’s most discomforting when it goes into a fit trying to discover the meaning of some sort of event. In the span of three seconds, about fifteen things went through my mind, only one of which I remember.

I thought he was pulling me over for something drug related. I have to put this delicately to explain the thought, but basically someone I know recently was arrested for a big sort of illegal drug operation. I thought that just by knowing them, I was somehow guilty as well (which is entirely not true, but this is what your brain does to you).

I pulled over, totally and completely confused. A man in a grey suit stepped out, red tie, white shirt, black sunglasses, perfect hair, and walked up to my window. He said (not asked), very officially “You ok.”

I said “Uh, yeah”. And he said “Good.” and walked back to his car. No badge. No apology, nothing beyond a single word answer to my response. I half suspsect he was a robot, but a more accurate description might be that he was an FBI agent, or Secret Service.

Upon telling the story to Vic last night, I wondered outloud if my family would have been given some insane compensation package if the Secret Service had squished me and ever the skeptic of his government he said “No, you’d just cease to exist.” Total buzzkill, as I half believe he’s right, a belief no doubt strenghtened by the complete bizarre manner in which my Meet Your Maker agent confirmed that he wouldn’t have to initiate an Incident Sterilization and Subduction Phase on me.

Do What You Love, Do It Well and Love Sharing It With Others.

Sunday, September 24 2006

I’ve happened upon what I think is a universal trait among people that other people consider successful and it’s dead simple. If you want to be famous, rich, powerful, admired, sought after, or all of those things you need but follow one rule:

Do what you love, do it well and love sharing it with others.

Let’s see if I’m right – I’ll pick a few people I admire and see if he/she follows the rule. Just of the top off my head here:

Laird Hamilton – pro surfer, total wildman. Laird lives to surf, so there’s no doubt he does what he loves, and he does it well. More importantly though, he talks to everyone he can about why he loves it, and tells people how they can do it.

Jimmy Carter – builds homes for the needy, humanitarian, also ex US president. Say what you will about his politics, when it comes to building homes for the needy Jimmy is king. He obviously loves Habit for Humanity, but again, it’s his life’s mission. He’s a helper, and gets down and dirty and builds alongside other volunteers, and helps others follow his passion.

Jeff Veen – I had to think for a while exactly what Jeff does, which might break the rule a bit, but decided Jeff is a proponent of doing things the right way on the web. A bit broad, for sure, but if you’ve ever seen Jeff speak, or read his blog, you might have to agree. I happen to know Jeff, and I know he does what he loves, and he most certainly loves sharing with others.

Almost universally I think that the real measure of true success isn’t exactly how rich or famous you are, but how much you’re willing to give everything you’ve learned and everything you’re good at doing back to the community. That sort of free and open behavior creates an amplified echo that refines your skills, and incidentally brings fame and some degree of fortune most of the time.

I’m interested in hearing what you think about others who fit the rule (and if it always works).

Getting Into Flow

Monday, September 18 2006

I’ve been thinking heavily lately about Getting Things Done, and getting into flow. Lately I’ve been hearing the term flow used to describe something I’ve been accutely aware of for most of my life. It essentially means “in the zone” or “highly focused”. It’s when the only thing important at any given moment is the task at hand, and nothing else matters. Your mind is working like a perfect machine and is in a sort of unstoppable state.

Everyone gets into this state at one point or another – think of times when you’ve either been engrossed in creating artwork, photography, playing video games, being athletic, hiking, etc.

I’ve been noticing as I get older that it’s much harder for me to get into this zone. Even the slightest distraction can keep me away from getting into this highly productive state. So I decided to begin describing what seems to work, and what doesn’t. I’m not trying to be another Merlin Mann here, but by sharing my experiences I’m hoping that I’ll make stronger associations for myself.

That said, it took me four hours this morning to get to the point where I could even begin to focus on a single task for a several hour stretch. This is mostly because it’s Monday morning and I have ideas to capture, and communication that I need to conduct with clients and partners (as well as the desire to capture this process here on my blog).

But with all that behind me, here’s what’s getting me in the zone far:

  • Tools that help me quickly dump all my ideas and tasks into a single spot with minimal interface, and a high degree of trust that I’ll be able to get those ideas back out of the tools.
  • Sound isolating headphones. They block out any noise, even with no music playing, and because I’ve been productive while wearing them in the past, they’re helping now.
  • Music I’ve heard over and over again. New music tends to distract me (because I love new music, and like to savour and untangle the new sounds).
  • Three apps open and only those three – iTunes, Terminal and Textmate. I risk serious distraction with anything else open.
  • A cold office. Heat slows me down and makes me sleepy (though my office is threatening to warm up now).
  • Pepsi. Sad but true, the caffeine seems to help steady me. I will feel the sugar crash in about 2 hours though, so this needs to be solved. Any more caffeine than a single 12oz can scatters me.
  • Competition. When I feel like what I’m doing is in close competition with something else, I get a bit crazy and engrossed. I also get engrossed in games for this same reason.
  • Approaching cutoff time. I have four hours to get good work done. Surprisngly, this is a powerful trigger for me.

I plan on revisiting some these triggers to productivity in the near future as I take more interest in this. For now, I’m sitting on a surge of flow and I’m going to ride it out.

Subversion and svnrepository.com

Tuesday, September 12 2006

I love subversion, the version control software. It seems crazy to me that only a little over a two years ago I didn’t really get it. I understand and used version control software before, but not something as clean and easy to use as subversion. I can’t imagine not using it for any development project now.

But I don’t like maintaining subversion repositories on web accessible servers. It’s not that it’s all that hard, but it’s just one more thing I have to worry about, one more step in my perfect stack.

I recently started using svnrepository.com to host a lot of my personal projects, and even a few client projects. I have eight Rails application repos currently being hosted (some of them quite large) and I’m using a sum total of 430kb in space. For $6.95 a month, svnrepository.com gives me 2GB of repo space (which I’ll likely never fill at my current pace) and provides a very usable interface to build repos and control user access. The interface doesn’t yet allow you to give anonymous checkout access (something I needed for one of my repos) but sending an email to the admins got an instant response.

If you have any subversion repositories at all, I highly recommend svnrepository.com. I find them worth every penny.

Update

I totally forgot to mention one more killer feature. Hosted Trac, as well as a web interface to administering Trac. That alone is worth $6.95 a month, and you can associate an entire Trac instance for each svn repository, as well as control who else has admin rights to that instance.