Thursday, September 07, 2006

11.2 km/s

Since I'm now busy in an office from morning to evening, I find I have plenty of time to blog when I get home. Strange how that turns out. When you have all the time in the world, you have zero motivation to do anything with it. When you're forced to squeeze every free minute out of your schedule, suddenly, you're inspired!

A friend mentioned in passing that it seemed that I'd finally returned to the corporate world. I don't think I truly ever left. I'm sure that when Sputnik was soaring through space, it too thought it had slipped from Earth's grip once and for all. But the great funnel of gravitational suck that is the Earth wasn't through yet. Within three months, it had dragged the spunky little satellite low enough that it burnt up in the upper atmosphere.

Escape velocity is hard to achieve, especially when having attained separation, you realise just how cold space is.

A streak of light in the sky;
celestial debris coming home.
Wish upon a falling star.


God, I sound depressing! :-/

Wednesday, September 06, 2006

Khaki Blues

Steve Irwin bites it. And good riddance!

Here's a man who spent his life running around after hapless beasts, provoking them into attacking him and then prancing around as if fending off animals with brains the size of walnuts is something to crow about.

"Lookit me! I'm sitting on the back of a trussed up croc while ten men hold it down! Ain't I the man!"


South Park 's caricature of him was biting and insightful. An empty headed, khaki shirt filling buffoon, running around shouting "I'm going to pin 'im down and jam my thumb up his arse!" in his trademark 'australian-for-beer' accent. Pray tell, how exactly does wrestling with a Dingo or putting the smack down on a Koala further the cause of either science or conservation? Will the fact that you clotheslined an alligator help protect the species or will giving a Kangaroo a pouch wedgie help spread environmental awareness? I don't see erstwhile Steve's audience of WWE watching mouth-breathers running out to embrace either trees or conservationism anytime soon.

Nature has the last laugh as usual though, as Steve is stabbed through the heart by Touche the Sting-ray; no doubt as he tried to wrestle it to the seabed and jam his thumb up its arse. Et tu Brute! and all that.

Now it's off to the happy hunting grounds for Steve, to spend the rest of eternity being chased by the spirits of the very animals he abused, as they for once, get to shove their thumbs, claws, pincers and what have you up his arse.

Crikey! Now that's what I would call some real entertainment!

Friday, June 23, 2006

Perfection Paralysis

It's taken me more than a month to finally get cracking on a pending project of mine. I've been wanting to get this thing done for months now, but could never seem to get started. The problem? Perfection Paralysis.

Being a bit of a perfectionist (HA!) and I'm always fussing over whatever I do. If I write a couple of classes, I'll spend the next few days/weeks/months constantly refactoring, re-designing and re-structuring them. Invariably, I'll either lose interest in the project before I finish or else trash the whole thing to start from the beginning. I was paralysed by my quest for perfection. It was incredibly frustrating.

In the case of this particular project, I was fussing as usual about the design and the technology to use (Spring? something simpler? JDBC? but I want to use Hibernate! etc...) and I just had enough. I finally just sat down and started to push out code (at my usual blazing rate :-). Viola, 2 days later and I've written some 700+ lines of working, tested code and I'm happy :-D. Every time I sit in front of the code, I get the itch to refactor, but I squash it. There'll be time enough for that when I get this out as Alpha. Right now, I want it DONE and I want it OUT!

So yeah, there's a bit of the ol' copy-paste in there, and I can maybe reduce the code size by 20% or so. There are several egregious instances of global variable use and a few too many static methods. One particular class is ballooning alarmingly and needs to be split up... but I'm consciously ignoring these warts. The code works, and it works quite well and at the end, slightly messy but working code trumps code that's beautifully designed, but which exists only on the whiteboard.

It's painful, but I'm learning to say it...

IT'S GOOD ENOUGH!

Wednesday, May 31, 2006

The Monsoon scale of privilege

The Monsoons are here in Mumbai and how happy you are about that seems to be directly proportional to how wealthy you are.

If you're in the Upper Middle Class and above, it's a great time. The weather is cooler, there's a refreshing breeze and finally there's some relief from the unrelenting humidity and heat of summer. A perfect time to visit Lunavala, Mahabalashwar or some other hill station or just to relax in front of a window with a hot cup of cocoa.

If you're a part of the teeming Middle and Lower Middle Classes, your emotions are more mixed. On the one hand, your home and work environment are now much cooler, but you also face terrible problems in your commute, dripping walls at home, flooded compounds and a higher incidence of disease. You're still glad of the rains, but only for a while. Then it's back to struggling to ensure that you survive another deluge. No trips to the green ghats for you!

If you're a part of the multitudinous Poor, you're in deep, deep trouble. You're probably going to enjoy the season for all of one day, before your shack starts to float off. If you're lucky enough to have a shack. If you're living on the streets (and a very large percentage of Mumbai's population does just that), you're going to be reduced to holding off the rain with a plastic sheet drawn over yourself, while you soak from below. You're in for several months of misery, as you're forced to live in several feet of fetid gutter water, struggling to find something clean to drink. But hey, at least the demolitions of your homes is on pause! :-(

Enjoy the 'soons!

Monday, May 29, 2006

Why Science Fiction is like Diabetes

I like Science Fiction (Sci-Fi). I like it a lot. While in the shower a couple of days ago, I got to thinking about it in a lot more detail than I usually do.

What is science fiction all about? What's at the core of it? How do you classify it? Why do we have a genre of fiction called science fiction at all? Is science fiction about space aliens and laser blasters and space fighters impossibly going 'whoosh' though the vacuum of space? (Well no, that's what crap sci-fi is about, but I'm getting ahead of myself...)

Or is it more?

It's more.

Allow me to broadly classify science fiction into two wide categories. I'll name them in the style of diabetes; Type 1 and Type 2 Sci-Fi. As I discuss this taxonomical system of mine, I hope it'll bring out what I believe is at the core of science fiction.

Type 1 Sci-Fi: Asking the right questions

Good science fiction, like good science, is all about asking interesting questions.

What if...?

What if there was no more scarcity and everyone could have whatever they wanted in whatever quantity they wanted? What if it were possible to indefinitely delay death? What if we faced an immediate, external existential threat? How would human society or a set of human being react to these situations?

You take human society and/or a human protagonist and place them in a new situation and you see what happens.

Individual episodes of Star Trek, for example, when they're not talking about 'reversing the polarity' of some gizmo or another, are usually of this type. So are BattleStar Galactica's episodes (the 're-imagined' series). For example, in the episode "Flesh and Bone" a very interesting issue that was dealt with, was that of torture. It's unethical to torture and summarily execute a human being, but is it ethical to torture an artificial but sapient creature? This raises other interesting questions. If it's ethical to prefer the safety of a human being over that of an animal's because of sentience, then shouldn't we prefer the safety of a machine over that of a human being if it's smarter?

If you start thinking of Sci-Fi in these terms, then many books which you might not have ever thought of as Sci-Fi, can actually be classified under it. A good example would be Orwell's 1984. Not too many people would call it 'science fiction', but it is a very good example of the genre in my opinion. The movie THX 1138 (Lucas' first proper movie) is basically an adaptation of 1984 and it's considered pucca Sci-Fi.

Good Sci-Fi is not about machines or robots or technology, it's about people and society.


Type 2 Sci-Fi: Space Opera

Space Opera is all about splashing about and painting on a broader canvas. Things like Star Wars, Firefly, Lost in Space etc. all fall under this category. Let's take Star Wars for example, since it's the most familiar. The entire story could just as easily have been set in a more contemporary time and 'galaxy', instead of being set "a long time ago, in a galaxy far far away". Replace light sabers with steel swords, X-Wings and TIE fighters with horses and the space ships with galleons and you don't really lose too much. At its heart, it's a take of adventure, war and magic and would fit right into the 14th century.

Having the story play out across an entire galaxy however, increases the sense of grandeur and 'space', if you will. Why have Vader destroy a village when you can have him blow up an entire planet? Why give him tuberculosis when you can have him breath like an asthmatic horse by putting him in a ventilator suit?

Type 2 Sci-Fi is not as deep as Type 1 Sci-Fi, but it can be a whole load of fun! :-)

Science Fiction: The thinking man's time-pass

Type 1 Sci-Fi is what I really love, though I don't mind Type 2 when I'm in the mood. I find Type 1 Sci-Fi, like the works of Banks or Baxter extremely enjoyable and I can say that some works have significantly broadened my mind. For example, it was one of Baxter's short stories that really helped me understand the concept of Space-Time! :-) My brother thinks it's a waste of time, but I can think of worse ways to relax.

Sunday, May 14, 2006

BarCamp Mumbai May-2006

It was the best of camps, it was the worst of camps...

So I went to the Mumbai BarCamp held appropriately on the 13th of May at IIT Mumbai; and was thoroughly disappointed by the quality of the vast majority of the speakers as well as the venue.

What went wrong? Where to begin!

1. It must have been 33-35 deg Celsius out, with very high humidity and all the slightly interesting talks were held in an unventilated, non air-conditioned room. I was sweating like a pig in sauna and my God, I stank! It just wasn't possible to concentrate in such circumstances.

2. This is supposed to be a BarCamp, not a conference. Sandeep was the one who really pointed this out. We were supposed to be discussing these topics interactively, not sitting in chairs listening to droning speakers...

3. ...and the speakers! Where did they find this bunch?! The first talk was on 'SMS Applications'. At the end of it, I knew nothing significant about this technology, but had learned that it may in fact be physically possible to be bored to death. I was really looking forward to a planned talk on OpenLaszlo and Flex, however, both turned out to be completely empty of content. The only bright spot was a talk by some guy from Pinstorm about the mechanics of optimising Google AdWords campaigns. That was interesting, however, the heat and humidity had sucked all the life out of me by then.

4. Let's not leave the audience out of this however! What a bunch of morons! In just about every talk I was in there were a couple of idiots (different ones every time!) who would bore everyone with endless, inane questions with very little relevance to the topic at hand. You're supposed to ask 'questions' in order to learn retards! Not to try and push your own agenda, you imbeciles! It's a good thing things weren't as interactive as BarCamps should be. I shudder to think of the quality of the discussion.

The only redeeming quality of the entire circus was that I got to meet Vinay and Chandrasing. We really clicked and ended up spending pretty much our entire free time holding spirited debates on everything from LISP to PHP, OOP to Procedural programming. After the fiasco that was BarCamp Mumbai finally ended, we went out to the Hirandani Complex where we held out own mini-BarCamp (FooCamp? / BazCamp?). I learnt a hell of a lot more in those few hours than I did in the entire day before it.

The plan's now to meet every month or so for our own, more exclusive and as yet un-named, gathering (FooCamp!) and discuss matters of importance to us. Code a bit too. Get our hands dirty.

Let's see how things work out! Even if all we end up doing is meeting up in the swamps and flinging poo at each other (PooCamp!), it'll be better than a BarCamp!

A fork() in the road

So I fired my employers last Friday; and boy do I feel great! :-D

Hmmm, that makes things sound more adversarial than they actually were. I'd actually given my notice some 3 months ago and the parting was as amicable as these things usually are. Lots of good-lucks and fare-thee-wells and such. No fireworks or artillery or bridges set ablaze, thank God. That stuff can be quite unpleasant.

Anyway. I've decided to head out on my own as an independent consultant/ contractor/ freelancer/ what have you. I tried to tread down this path some 2 years ago as well, but things didn't turn out too well then. I'm better prepared now, or at least, I hope I am :-)

So why the big change? Well, de jure, there's been no change at all! For the last year and a half, partly for tax reasons, I've been a 'consultant' anyway. So my official designation hasn't changed at all. Of course, de facto, there's all kinds of good stuff now. I've managed to shed one of the most irritating aspects of working in Mumbai; the commute. I used to spend around 1:30 hours each way, every day just to get to and from the office. That's out now and I have an extra 3 hours everyday to myself now, even if I continue to spend the normal 9 hours at work as I used to. And there's the other difference. I have a slightly unique style of working when I'm programming. I work in bursts of intense activity, with long breaks in the middle. The average work-place can't really accommodate such a style, preferring employees to work at a steady pace through out the day. So I used to end up frustratingly trapped in the office for several unproductive hours everyday. No more of that now! :-)

I like change too, so working on a myriad of different projects for different people seems very exciting... and once things get going, I'm hoping it'll be a lot more lucrative than being a wage-slave.

So I'm going to give it 2-3 months. Let's see how things work out in that time. Here's wishing me some much needed luck! :-D

Thursday, April 13, 2006

ZK and OpenLaszlo : Ajay and Vijay

Bhaiyaaaaaa!

You know the story; two brothers visit the Kumbh Mela and are separated in the crush. One grows up to be a policeman, while the other becomes a vagabond and eventually a hardened criminal. Both of them are then united under extremely contrived circumstances, only to find themselves set against each other. However, everything is eventually resolved, and both of them join hands to save their widowed mother from the hands of the (muwahahaha!) evil villain. Or something like that...

ZK and OpenLaszlo seem to me like the Ajay and Vijay of Web UI. On the one hand you have ZK, an extremely rich AJAX based Web UI Library which allows you to define the interface in XML, while OpenLaszlo is extremely rich Flash based Web UI Library which allows you to define the interface in XML. They're both Open Source, use JavaScript for scripting and are absolutely gorgeous.

Designing using these libraries is really straightforward too. Here's how to make a window with the canonical "Hello World".

ZK:

<window title="1st window" border="normal" width="200px">
Hello, World!
</window>
OpenLaszlo:
<canvas>
<window>
<text>Hello World!</text>
</window>
</canvas>

Not much to choose between huh? :-)

The difference between the two of them is in their emphasis. ZK bills itself as an easy to use AJAX library while OpenLaszlo is more ambitious, describing itself as a way to create "zero-install web applications with the user interface capabilities of desktop client software" In addition, OpenLaszlo can now be compiled into DHTML, not just Flash.

So which one will I use if I need something like this? I'm not exactly sure. It's not just a competition between these two libraries, but between using Flash or Ajax for your UI too. If I'm pushed to it, I'll probably side with OpenLaszlo. This is largely because it can also be compiled to DHTML as well as Flash and because the demos at www.openlaszlo.org really put it through it's paces and show what it can do. In addition, there's a Flash player available for mobile devices now, but Javascript support on those things can be spotty. Javascript windows and animations really crawl on Firefox under Linux too and since that's my primary platform at home and at work, it's a significant downside for me.

There really isn't that much to choose between them. It'll probably boil down to personal preferences. Both libraries are well supported, stable and under active development. Both make the task of creating absolutely stunning interfaces almost trivial.

Ajay or Vijay, it doesn't really matter. The bad guy goes down in the end.

Tuesday, March 28, 2006

Big Ball o' Links

Just a bit of link blogging on a not so slow Tuesday:

  1. Big Ball of Mud: "A BIG BALL OF MUD is a casually, even haphazardly, structured system..." You know it's a bad idea, I know it's a bad idea, so why is it so damned popular?
  2. The AppSec FAQ: Not exactly ground-breaking work, but it's a good recap of some common web app security boo-boo's.
  3. How to Create a REST Protocol: The name says it all. Also review Common Rest Mistakes.
  4. 43F Recap - The best of GTD: Some of the best posts about GTD at 43 Folders.

Tuesday, March 21, 2006

It's not a bug, it's a feature!

Here's a new one I've heard that's similar and a lot fresher:

It's not complex, it's comprehensive!

Made me smile.

Friday, February 24, 2006

Don't Ask, Do Tell

There's a great piece up at The Pragmatic Programmer about some very basic, but very important OOP concepts. Read the article for a complete explanation, but here's a very short summary...

  1. Don't ask an object for information about it's state and then make decisions based on that data. You shouldn't be making decisions about the state of an object and then changing that state yourself. This logic should be inside that particular object. Just tell it what you want done and then let it do that to itself.
  2. Don't tightly couple objects together by passing data around from one to another. Once you've returned some data from an object, any semantic meaning associated with it is lost. Basic OOP states that data should be stored along with it's state/methods; i.e. in its own object. Related to point 1.
  3. Don't use multiple methods to access/work upon a single invariant state variable. Multithreading will ensure that invariants can no longer be guaranteed invariable (unless you lock properly). Better to use something like a map() call to apply actions to data.
In other words, follow basic OOP fundamentals rigorously. Keep data and the methods/logic that act upon it together in one place. Don't scatter it all about.

Tuesday, February 21, 2006

S.P. Jain - Principles and Framework for Project Management

Five, 9 hour days of gruelling work later, I must admit that the course was totally worth it. The time literally flew by and I can say with a fair bit of confidence that my perspectives on the art and science of project management have shifted significantly.

I've learnt a lot and not just from the instructor (Prof. Ajay Parasrampuria). As he himself pointed out, with more than 200 man-years of experience in the room, there's not a whole lot he could have added. 'Course, he went right ahead and did just that! But more on that later...

There were around 20 participants from a wide range of backgrounds. We had people from USAID, GAIL and Emirates. Large corporations, small companies and one hopeful entrepreneur. People with more than 40 years of organisational management experience and those with very little.

And of course, me :-)

The most important and illuminating part of the entire 5 days was the sharing of past experiences by the participants. Some were more reserved than others and remained regrettably silent, but there was enough back and forth to keep everyone interested.

Now, I don't want to give the impression that we did all the work and Ajay just stood back and listened in :-). His knowledge of the PMBOK framework was outstanding, as was his ability to communicate with the rest of us. His ability to continually relate principles from the framework to his and others real life experiences was absolutely riveting.

Perhaps the most educational part of the course were the daily 'games' we participated in. Now I can't reveal the details since we were requested not to ruin the surprise for the next batch, but I hope I can say they were excellent learning experiences. For me, the moment of PMBOK epiphany came during one of them when I noticed just how easy managing the entire (rather complicated) project became once we abandoned our ad-hoc procedures and started to follow the process framework. Things started to slot into place almost immediately and it was shockingly easy to manage all that data and derive meaning from it.

The highlight of the course for me was the presentation on "Monitoring and Controlling IT Projects" by Mr. Tapan Bose, V.P. for Financial/Banking Projects at Satyam Computers. Lots of useful observations from the trenches and insights on what works and what doesn't. The main points I picked up was not to forget the human dimension (especially team building) and to treat the process as a part of the project, not as a template filling chore carried out under threat of audit.

Of course, the most depressing part of the entire exercise was the realisation by all concerned, of how little of what we'd learnt will actually be applied in real life. We might be all gung-ho about working according to the PMBOK framework in our next project, but without institutional support (what the PMBOK would call Enterprise Environmental Factors and Organisational Processes Assets :-), it's very difficult to be an agent of change. There has got to be buy in from top management, or it's all just an expensive waste of time.

Here's to hoping I can actually use what I've learnt!

Saturday, February 04, 2006

TurboGears - It's all in your head

Turbogears is absolutely, positively, definitely, unquestionably completely amazing!

I started out with very rusty python (I haven't coded in it for more than a year and they've managed to sneak in new language features in the meantime) and only a cursory knowledge of SQLObject, CherryPy and Kid (the three main components of the stack). Around 4 hours later, I have an almost working Todo List web application and a grin on my face that could eat a banana sideways.

The only reason it took me 4 hours is because of the ramp-up time associated with learning any new technology. I had to stop every few minutes and read the docs, scratch my head a little and then continue. And the only reason the application is 'almost working' is because I've decided to extend the capabilities significantly and so I'll be re-writing it.

But pause to consider what I've just accomplished. I've got the canonical 'Hello World' of web applications up and running (well, almost) in less than half a working day and I'm so charged up about it, I'm already thinking of version 2. A whole SDLC compressed into half a working day! And the size of the code! The entire controllers.py file is smaller than the Hibernate XML mappings I'd have had to write to get something similar in Java.

But the most important part of the experience is the pythonic characteristic of TurboGears.

You can hold it all in your head.

With most Java frameworks and ORMs, you're running to the docs every few minutes, every time. With TurboGears, now that I've done it once, I really don't have to go back to the docs at all; at least for the bits I've worked with. That's a real source of satisfaction and a major cause behind the speed boost.

Time to complete my next app of the same size and complexity? I'm guessing 45 minutes :-)

Thursday, February 02, 2006

Face Time and Free Stuff

I've blogged about the need to interact with people before here and here. Christopher Hawkins has written an excellent article that succinctly sums up what it's all about:

Face Time and Free Stuff

Tuesday, January 10, 2006

Ruby/Rails Redux

I tried. I really did.

If you've been following this blog, you'll know that I gave Ruby a look-see when the hype over Rails first started to build up. I didn't particularly like what I saw and being a bit of a Java weenie, I went back into its all encompassing, XML filled, embrace.

But I've absolutely had it with Java now. It's great for large complicated projects with teams of developers working together, but for a one man effort, cobbled together in what free time I have, Java is over-kill. It's official, I'm finally sick to death of the ginormous configuration files and over-engineered class hierarchies. Do I really need 10+ classes just to access the database? I hope not.

So I succumbed to the siren like call of the Rails fanboyz and decided to give Ruby on Rails a try... but I couldn't do it; I just couldn't. [cue weepy music]

The rational reason I'll trot out is that Ruby has terrible support for I18n/Unicode, but the real reason is that Ruby's syntax is just too much like Perl (aka 'line noise'). Enough to give me flashbacks about my time in the trenches writing that filth. They had to drag me out from under the bed and pull my thumb out of my mouth.

And don't get me started on the 'magical' ways of Rails. I hate config files as much as the next guy, but you can have too much of a good thing.

So what's the alternative?

Python.

Now, I don't need reminding that Python has it's warts, I've had to stare at them often enough. I dislike the explicit 'self' variable, the lack of access control modifiers and the almost-but-not-quite OOP schematics. But's it's leagues better than Ruby and it's got fairly decent I18n.

Pythons not been getting the buzz Ruby has as far as its frameworks go, but there are two that are certainly worth considering.

1. TurboGears
2. Django

Both promise Rails like speed of development and simplicity through a single integrated Web Application stack. TurboGears glues together various best of breed frameworks for it's needs while Django builds up everything from scratch.

Some people seem to prefer Django, but I haven't decided which way I'll go yet. This much however, is clear...

Ruby can ride the next train out of town and good riddance.

Tuesday, January 03, 2006

There are no uninteresting numbers


Jim Loy's theorem: There are no uninteresting numbers.

Proof: Assume that there are. Then there is a lowest uninteresting number. That would make that number very interesting... which is a contradiction.

Hmmm. Interesting... :-)

More at http://www.jimloy.com/math/math.htm


Monday, January 02, 2006

Friday, December 23, 2005

"My Golden Rule" -- Business 2.0 Magazine

My Golden Rule

49 business visionaries, collectively worth over $70 billion, state which single philosophy they swear by more than any other.

It's interesting, but as always take this stuff with a whole load of salt. Things are never as clear-cut as the blurb suggests. Who knows if it's these "rules" that made them successful or whether they just wish they had.

:-)

Are there no truly original ideas left?

Look it what I found. Openomy.

Let's see now...

  1. Online File System? Check.
  2. Tagging? Check.
  3. REST based? Check.
  4. 1 GB space free? Check.
  5. Transparent Integration coming? Check.
See this blog entry for an introduction to Openomy.

Sounds real similiar to this and this, doesn't it? :-)

Thursday, December 22, 2005

4 Rules for the Practical Entrepreneur -- Fragmented Markets

Ian Landsman has written an excellent article for the practical entrepreneur in this article. Definitely worth the time spent reading it.