October 24th, 2008
Uncategorized
No Comments »
I got an email from Amazon.ca yesterday with a promotion: “Loonie Deals on Books”. The introductory text to the deal says:
Take advantage of the robust loonie with special discounts on thousands of titles. Browse through our lists to discover great bargains on new and former bestsellers across all categories, as well as perennial favourites.
Last time I checked:
CDN: 1, USD: 0.78
October 4th, 2008
software
1 Comment »
_ /|
\'o.O'
=(___)=
U ack!
|
find . -name “*.some_ext” | xargs grep ’some_pattern’
Man does this not age very well when you do it al lot. Yeah yeah, you’re a smart-ass and you can write a shell script and make that easier. But what if there was a tool you could use to do it smartly? With highlighting and a slew of other features? Enter ack.
I’ve been ignoring my homies on #pso with a stupid kind of ‘i got fingers and i can type’ smugness. So wrong was I. His name is Bill, he’s my new friend.
September 23rd, 2008
business, entrepreneurship
1 Comment »
I love failure and I want to fail more. While looking at videos over at Stanford’s Entrepreneur’s corner, I stumbled upon one video from Randy Komisar of Kleiner Perkins, the VC firm. What he says is true of the valley, and of entrepreneurship in general; one must embrace failure. ‘Fail often, fail fast‘ is a mantra typically enunciated by startup types.
This goes hand-in-hand with the idea that execution is king and rapid iteration comes to mind. There is no point to wait on the perfect idea, the perfect plan. Does that imply that we should throw away the adage ‘Measure twice, cut once‘? But does that mean that we have a free license to push out a lot of crappy code? I think not.
Another rule of thumb I came across was ‘Be pessimistic in the short term, optimistic in the long term‘ which I think ties both ideas together.
The time to act is NOW. The best plan to execute is the one right NOW. Innovation is driven by failure. Success is a by-product of failure… or is it?
August 22nd, 2008
software
No Comments »
I have found little or no documentation on this on the net, so here I’m trying to give back a little from what I learnt. Hopefully that will be the beginning of a solution for others.
Rails version: 2.1.0
The problem:
I have certain ActiveRecord models that I want to monkeypatch (i.e. inject functionality to an existing class on runtime). That’s the beauty of dynamic languages, poor Java sods, no need for an AbstractFactoryFactory for j00!
My first approach was to write a script in ./config/initializers that would be invoked on initialization. However, as it turns out, while this works fine for an immediate use of the said monkeypatched object, this wouldn’t work for later instances of this class. In my case, an ActionController method, when calling one of the monkeypatched functionality would raise a NoMethodException.
It took me a bit to realize what was going on and how rails was actually running through its initialization process.
The solution:
Rail’s initialization code has a method called to_prepare which can be invoked in the initialization block. Now looking at the rails source code for initialization, the method requires dispatcher which loads ActionController::Dispatcher and invokes the method to_prepare. Bingo!
What to do next is simple. In my script found in ./config/initializers, the only change i needed to do is to require 'dispatcher' and to monkeypatch as follows:
Done. Profit.
April 25th, 2008
humor
No Comments »
I am rectum’al about some things though probably not when I reek of alcohol (sometimes) or almost falling asleep, like now. One of those things is spelling. The people that I chat with often have to endure my misspellings : ‘ey man’, ‘transcenadnce’ and ‘eligjtment’ are samples from my chat logs the other day.
No matter that when I read chats/blogs from people, I expect none other than perfection. Another anality of mine, which I gratuitously violate(d), is grammar. The denizens of the interwebs have got their tubes connected to their rears when it comes to grammar and spelling; stool samples are easily collected: ‘rediculous’, ‘there’ instead of ‘their’, ’should of’, ‘could of’ and incorrect use of the semi-colon.
GOD! Grammar isn’t rocket surgery*! That’s how we get stupid expressions that don’t make any sense anymore! The old expressions are pardoned because they help gave birth to hotforwords.
This is a long-winded post to mention the awesomely rad Computer Science Unplugged, about computer science and how it has little to do with computers**.
* Thanks DHH for this new (to me, and stupid) internet meme probably automagically rendered a gazillion times more popular after startupschool. DHH is actually a very nice guy, no ill feeling.
** Notice how real sciences don’t have “science” affixed? Thanks, Richard for the observation the other day.