On professional motivation (or changing the world isn’t just for entrepreneurs)

I came across this post by Micah Baldwin via Hacker News and I could empathize with the content just a few lines in. Although, I am not an entrepreneur (by choice), I agree with the essence of the post that …

The world is fucked up place. There are more problems than solutions.

But, with the acceleration of the capacity of technology to make important and
lasting change, we need more of our great minds caring about changing the world
than clicking an ad.

I’ve often wondered (and people have questioned me about this too) — why I do what I do ? why did I chose to work at the companies I did ? Especially since I know for a fact that there at least a few dozen of places out there, that would not only offer me a better pay packet but also offer the technical challenges and stimulation that I crave.

Every time this question crops up, it doesn’t take too long to come to the conclusion that it’s because, for me to feel like showing up, it isn’t enough that I enjoy the technical aspects of my job, or the flexibility to nurture creativity or the big monitors and comfortable chairs — all of which, yeah, I do care about — however, at the end of the day, I want to feel like my work, the stuff that I do on a daily basis, needs to have a impact on society at large.

This is why I worked at Red Hat …and at the UNFCCC …and now at Largeblue (focusing mainly on openideo.com ). I have worked at other places too and except for the places where I transformed and grew as a programmer, I wasn’t really satisfied just ‘pushing the bits‘ so to speak on the path to successful acquisition or market leadership.

Which brings me to the other point I’d like to make with regards to the Micah’s post — It isn’t just the entrepreneurs who are continually chasing the software industry equivalent of producing penile enlargement pills instead of cancer research, regular software developers, the foot-soldiers too do not see beyond the toys that they get to play with.

I am, by choice, a foot-soldier of technology[1]. I do not have the motivation nor the tenacity to be a entrepreneur. However, as a foot-soldier, I still deeply care about the cause I am committing to. So, it isn’t just a choice made by entrepreneurs. In fact, I’d go as far as saying that the foot-soldiers eventually make all the difference. You cannot change the world all by yourself even if you have the best of ideas.

Regardless of that last point though, ultimately it is the choice of every single one of us in the software industry to be part of either the ad-revenue generation business or that of ‘the agents of change’ in the world[2].

Thanks for reading. Please leave any thoughts/comments you might have.

[1] of open source technology specifically.
[2] Note that, I do not think these two things are mutually exclusive.

fragile and uncontrollable

This is yet another gyaan-giving post. I just needed to collect my thoughts and clear my mind. So, don’t bother reading unless you enjoy listening to lonetwin baba ;-)

The fragility of existence slapped me in the face (yet again) recently with the news of the earthquake + tsunami + the possibility of nuclear meltdown in Japan. As of right now, there are a couple of thousand people reported dead or missing but final estimates are being spoken of in terms of tens of thousands. This got me thinking about the illusion of being in control of our lives that most of us seem to suffer from.

Those of us not in Japan at this moment still feel like our lives won’t drastically change in the next 24 hours. We believe, our homes, the people we love, the things we enjoy will still be around. Why ? Is that just a coping mechanism developed by our species as a means of survival ? (after all, what would life be without hope ?).

I read that the people in Japan are taught to deal with earthquakes right from childhood. They carry quake kits that include at least a flash-light, food and documents. They have periodic drills and follow procedure in the event of a quake. Their cities are planned and built around the possibilities of quakes, floods, and other natural phenomena Japan is exposed to. This may lower the extent of possible damage.

However, they hadn’t been prepared for a nuclear meltdown. Are any or us ?

There is the practical[1] outlook that, as far as life is concerned, all we can hope to achieve is to minimize the effect of external factors rather than control the outcome. However, in day to day life, how many of us remember that ? I know a lot of people who live under the constant illusion that they are in complete control of their lives. How egoistical is that ? Worse still, not only do they think they are in control, they also feel justified to control in the best case (for them) or at least be able to dictate in the worst, the way others should live their lives.

So, what are we supposed to do ? My own take is:

  • remember constantly that we aren’t in control. We are all bound together. Existence is fluid. A change anywhere in the world transmits (in whatever minute manner) to us. We need to remember that always. When interacting with anyone. When doing anything. Our actions affect not just everyone directly involved but also society and the world at large …and this is not in a controllable deterministic manner. So lose the illusion of being able to influence anything by your actions — for yourself or for others.
  • remember that we are fragile and so incredibly easily destructible. Each one of us. We and the people we love and the things we love — all fragile.

So, fragile and uncontrollable, that’s what life is. Everything else is an illusion.
Have any thoughts ? Please share, I’d love to know what people who read this think.[2]
Thanks for reading, have a nice one.

[1] wrote existential first, but not sure if am I using that concept correctly. Am I ?
[2] you can post anonymously too, so feel free to make fun of me, I won’t know who you are ;)

On religion, relationships and mind hacks

This is going to be personal, so if you know me in person and also can tolerate the random gyaan I spew every once in a while, read on. If you don’t, I’m glad you are here but maybe (just maybe) you’d want to skip this one.

This post is inspired by two posts by two people I know and is about two (slightly related) things I’ve been thinking about for sometime.

The first one was this innocuous tweet (also Facebook status) by Rahul about Stephen Hawkings declaring that the universe did not need a creator. That generated a couple of comments on Facebook about the (ir)relevance of religion. I chimed in with the comment:

Religion is good as something that provides a moral compass, but it
need not be required to answer questions of existence. That's why I
like Buddhism. True Buddhism is a practical religion without the need
for an existence of a God (let alone a creator). Science is excellent
in answering the questions "who are we ?" and "How did we get here ?"
although the answers aren't comprehensive yet. Religions like Buddhism
are excellent in answering the question - "All that's great and
logical, now what ?"

To which he replied:

Now what? Free will Steve. Go forth and do good :-) Like all
religions, Buddhism started out with good ideas but now it is corrupt
and no one seems to practise the original ideas anymore.

While I don’t claim to know anything about the second part, I do feel the need to address the first — `Go forth and do good`. You see ‘do good’ is often fairly subjective. I don’t think I need to give examples about this. Every day we are faced with questions on morality, which may range from the simple and mundane to the extremely hard to decide on. So, my definition of good might not necessarily be the same as yours …but here’s the thing – It should be !

These questions only appear to be subjective. One of the many things I like about the teachings of the Buddha[1] is this — There is always a very simple, straight forward, unchanging, binary (yes or no) answer to every ‘Is this good or bad ?’ question. What makes the answer hard to reach is external to the question. The answer is often clouded by our own emotions, which tends to make us `prefer` or `justify` one answer to the other. Even when we choose the right answer we tend to choose it for the wrong reasons. It is hard to say something is ‘right‘ or ‘wrong‘ when we are feeling anger, hatred, depression …or even love, attachment, sympathy, compassion. Should a rapist be hanged ? Should a mass-murderer have any rights ? Is it right to be angry when someone hurts you ? Is it wrong to forgive but not forget ? The answer to such questions lie not in the morality of the question but whether we can answer any of them with detachment from our feelings.

I know it might not sound profound or on the other hand only sound profound but be too abstract with zero relation to reality.

If you feel that way, I encourage you to think of any conflict you are facing right now (big or small — for instance, do you feel conflicted about reading this post when you ought to be working ? — there you go ! :-) ). Now, that you are feeling conflicted think about your preferred answer and then dwell not on the answer but why you came to it. Was that insightful ? If it wasn’t you haven’t dug deep enough !

It’s a neat mind trick that the Buddhists have been trying to teach for a long time …and that IMHO, is what Buddhism is all about — a whole bunch of life/mind-hacks to be happy — and `do good`.

Now, about that second post. My ex vented out in her latest blog post[2] about `what the hell do men want ?` I was initially tempted to reply back there but wanted to be as unobtrusive as possible. So here is my attempt at an answer to the question which vexes her.

You see, the question never was about ‘what does he want ?’[3]. What’s unfortunate is that (and this is why I said this bit and the earlier one were related), all the time she was asking the question ‘what the hell do men want ?’, she was really trying to answer the question ‘why am I not getting what I want in return ?‘. She was unsatisfied with the way her life was. Unsatisfied with her job, her health and me. Could I have done anything to satisfy what she wanted ? No ! As a matter of fact, nobody can do anything that would satisfy anybody ! If one is conflicted and in need of something, it cannot be satisfied by something external. No matter how contrary this might sound to real life experience. The reason I say external things cannot truly satisfy, is because when we feel they do, what is really happening is we are making peace with our wants …until they resurface again. One has to find peace and balance in one’s own life, internally. It is a hard thing to do. Bloody hard.

The failure of our relationship was because neither of us could be at peace nor could find balance. I expected patience and a little less ‘craziness’ from her. She wanted me to be a loving, caring, romantic person. Were we not that way ? Well, the mind trick that I hope I knew (/know) how to apply was to detach my wants and see things as they were. I wish, I had the patience for her and she had the freedom from her ‘want-in-return’ and both had the ability to meditate on life’s little problems.

Well, that said tho’, I don’t think I would have come to this conclusion without separation. I was morally conflicted at more levels than just our ‘needs’ and it wouldn’t have resolved when we were together (or at least, it would’ve taken a huge amount of effort for both of us, which I think neither of us could put in at that time).

So, what’s the bottom line of this whole post, it is:

KISS. Learning how to is bloody hard but once you know how, it is
extremely gratifying.[4]

Thanks for reading, cheers !

[1] I am not a practising Buddhist (or a practising anything, when it comes to it)
[2] Yes, I read her blog, does that make me sad and pathetic ? If you think it is, read the preceding paragraph again
[3] but still to humor, what I wanted was for her to be herself and be happy at being that
[4] KISS == Keep It Simple Stupid

zodb export import from zeo debug prompt – the simple built in way !

I am beginning to enjoy working with zodb. Again this is a quick note, pretty much like my previous post on zodb undo and conflict resolution..

I knew from my early Zope days that one could export and import arbitrary zope objects but never had a reason to code it or inspect its innards. Today though I wanted to export only a sub-section of our new beta site so that we could merge its contents with an already up and running ‘live’ site. So, I decided to search. One of the biggest problems with zope (and it’s related components) is the lack of authoritative and comprehensive documentation.

I found various scripts on the interwebs which showed how to walk a zodb object hierarchy. For instance:

However, there was very less information on how to actually export arbitrary objects using some built-in api (after all there had to be one !) and every less how to import exported .zexp files ! So, I hit the code. ZODB has a nicely named module ExportImport.py which exposes two neat functions exportFile() and importFile(). They do what they say and you’ll see the code is pretty much what you’d expect — walk the oids and serialize/load the objects …but wait there is more ! ZODB Connection class actually derive from ExportImport ! So, these functions may be used quite simply like this:

>>> # ...assuming you are in the debug prompt with context as the
>>> # object you want to export
>>>
>>> oid = context._p_oid
>>> conn = context._p_jar
>>> conn.exportFile(oid, 'context.zexp')
.....
>>> # ...assuming you are in the debug prompt, you have an exported
>>> # zexp and context is the parent where you want to import and
>>> # place your imported 'new_folder'
>>>
>>> conn = context._p_jar
>>> imported = conn.importFile('new_folder.zexp')
>>> context['new_folder'] = imported
>>> import transaction
>>> transaction.commit()    # Do not forget to do this

Simple innit ? Hope someone out there finds this useful.

zodb undo and conflict resolution

This is going to be a quick post without much by way of explanation. It’s more for my own reference later (I tend to forget stuff I haven’t used in a while …or rather, I tend to forget …everything).

Last Friday a freak accident caused part of openideo.com disappear. I won’t get into the details but basically we needed to undo a delete operation on one of the top-level objects. Although we did have backup, it was a few hours old and with a site like openideo, a few hours translates to a lot of data. Now, I haven’t really had a reason to do a zodb undo from a script/debug prompt ever, so, I was really quite clueless. Also, the resident ‘all-things-zope’ guy was on leave so perfect friday night disaster. Well, I’ll cut to the chase. Here’s how simple zodb undo really is (note: code written for clarity not efficiency):


import time
import transaction
from ZODB import FileStorage, DB

# init the storage object
storage = FileStorage.FileStorage('Data.fs')

# create a db object
db = DB(storage)

# now, zope records all transactions in a log which is available as
# the db.undoLog(). Note that at the time of this writing the zope
# documentation is incorrect (bug report:
# https://bugs.launchpad.net/zodb/+bug/622828). The first and second
# parameters are the index within the list of undoable transactions,
# instead of time in seconds since epoch.
log = db.undoLog(0, sys.maxint)

# We wanted to undo transactions based on the time, since we knew
# exactly when the delete occured. However, undo-ing based on time is
# not necessary. undoLog() returns back a list of dicts with the keys,
# 'id' (unique identifier for the transaction), 'time' (time measured
# in seconds since epoch), 'description' (the .description attribute
# of the transaction) and 'user' (the .user attribute of the
# transaction). We could use any of these keys.

t = time.mktime((2010, 8, 20, 15, 12, 00, 00, 00, 00))
undo_list = []
for i in log:
    if i['time'] >= t:
        undo_list.append(i['id'])

for i in range(len(undo_list)): # Doing it this way so that if for
    tid = undo_list.pop(0)      # some reason the undo fails, we'd at
    db.undo(tid)                # least know which ones did not go
    transaction.commit()        # through

Now, while I was there I also came across this bit about resolving conflicts during commits. I have seen this ConflictError occur a number of times on openideo.com (coincidentally, in sections of code quite similar in intent to the hit counter example mentioned in the document). Fortunately though, these things don’t happen in a critical section of the site nor do they break it in any manner. So seeing this is more of an annoyance than a problem. I intend to try out that bit when I get the time. For now however, learning that the document is way back from 2002[1] and is not likely to be correct, I am less motivated to spend time researching whether that solution works.

If anyone knows for sure that this solution works for resolving conflicts please leave a note in the comments. Thanks !

[1] https://mail.zope.org/pipermail/zodb-dev/2010-August/013594.html