Author Archives: steve - Page 2

Passive Aggressive, who me ?

I like to think of my self as a peaceful composed person who doesn’t get rattled too easily. Yes, i do have my peeves and yes, I might not appear to be calm and composed all the time but people who know me, know that I don’t get angry too often. Mildly annoyed, irritated, frustrated and agitated at times …rarely in fact, but not furious.

Few people have witnessed me really angry and more often than not they are confused why something seemingly insignificant or at the worst mildly annoying trigged off that fury.

I felt angry today.

So, I decided to examine that feeling and tried to analyse how I reacted. Now, ever since I heard the term passive aggressive, I was confused about it, it seemed to fit what I felt and the manner I react when I am angry, that is to say — I would be passive but also deliberately subversive/non-cooperative and clamed up until the time something triggered out all out active aggression. So, anyway, I looked it up:

Passive aggressive behaviour at wikipedia

Seems pretty close to what I am like, at least when I’m angry. However, on further reading, I am not too sure I want to be called passive aggressive. Although I am ok with been known as mostly passive in fact downright nice, perhaps non-confrontational but who can get aggressive in all sorts of surprisingly uncharacteristic rages if pushed too far.

What does one call that ?

Well, doesn’t matter, I feel better now (reading always does that to me), I also feel like putting this out there — When nice people accept all the crap and nonsense you send their way, they are just being nice. They are not stupid or easily manipulated or too dumb to realize that you are trying to handle/manage them. They are being nice because they know what’s important in the long run. Don’t push it though, because suddenly you’ll wake up one morning and find the whole day shitting all over you.

Enough ranting. Have a good one ! šŸ™‚

cheers,
-steve

Mayawati’s garland 21 lakh ? Pretty unlikely …

I watched the NDTV news report about Mayawati’s garland in utter disgust at not just the revolting show of excess but also the utter disregard to the value of Indian currency. I was even more appalled at the BSP minion justify the garland and put the figure of 21 lakhs for it’s value. That instinctively struck me at BS. That number does not even seem statistically possible.

Considering the 21 lakh amount, if that were true, it would imply that the garland was made of 2100, one thousand rupee notes. Looking at even a low resolution picture of that garland, a conservative estimate would put one layer within the garland to be at least made up of 10 notes. So, that would imply that for a 21 lakh rupee worth of garland to be made up of just 210 such layers. Is that even possible ? Take a look at the pictures again. I’m willing to bet at least 50 notes make up a layer. The number of layers that make up the garland is a proper mathematician’s task. I think any mathematician worth his degree would be interested in calculating this. I hope some Indian mathematician actually does it.

Reblog this post [with Zemanta]

vim backups using git

I am a vim guy. I’ve been hooked on to it ever since my first introduction to Unix (back in ~1995). One of the things I like about vim is that it is just an editor. Nothing more, nothing less. It does allow for creation of plugins, but only as far as they complement editing tasks. So, although you’ll find vim plugin scripts that provide file browsers, IDE features, encryption etc in vim, you will almost certainly never find an integrated mail client, IRC client, web browser etc (things which are rumoured to exist for a long time in that other editor which shall not be named).

The reason I mention this is because, I recently came across this interesting plugin named VimLocalHistory which maintains a backup of files that you edit in vim using git at every write to the file. Cool, ehe ? btw, git is another really cool tool that I’ve fallen in love with recently but more of that in another post probably.

The second reason for this post is, considering how i have waste^H^H^H^H^Hspent a lot of time creating, maintaining and tweaking my preferred vim configuration and plugins(*), it only makes sense that I share it with friends who share my preferences and style of working but don’t/can’t look for the tools that’ll help them at it . So, here is my vim configuration: http://github.com/lonetwin/lonetvim

Obviously, you’d have to rename dot_vimrc and dot_vim to ~/.vim and ~/.vimrc respectively. The dot_vimrc file is well commented (i think) so reading that and adopting it to suit your needs should not be a problem. Enjoy.

(*) I created the file in 2004, IIRC and have maintained it ever since

Reblog this post [with Zemanta]

Macs for Me Lord ?

I am happy. Not over-the-moon happy, at least not yet.

Earlier last month, someone on the ILUGC mailing list posted news about a government tender floated on behalf of the Supreme court of India, inviting authorized vendors to supply quotes for …get this — “supply and installation of Apple Laptops for Supreme Court of India”.

Yes, that’s right, the judges at the SC apparently are Mac fanbois and think they have the right to spend public funds on eye candy laptops even when there exist Indian laptop manufactures who are capable of providing similar or even better hardware, at lower prices, to satisfy any possible requirement that an SC official might need a laptop for.

That wasn’t all though. The tender further required that the said laptops come preloaded with Microsoft Windows XP !

Now, I don’t have anything against people buying Macs or using Windows. If buying good looking expensive toys loaded with junk is your thing, surely, go right ahead and splurge, but please don’t dig into my tax money when you are doing it. Especially not when there are more affordable, open and altogether immensely more appropriate options available.

So, as expected, there was outrage expressed, on mailing lists[1], blogs[2] and a petition campaign.

As this happened, I wondered what might have led to the tender ? Did the people at the National Informatics Centre, the guys responsible for advising the government on all things IT, really believe that the ‘Honorable Me Lords’ work demanded a Mac ? …or was it something else ? Knowing a bit about how the Great Indian bureaucracy works, I came up with the following possibilities:

a. Some high up babu (or his/her favorite son/daughter/nephew/niece) knew that Macs look cool. So, carrying a mac to work, especially in front of visiting firang babus would add to their coolness. So, the babu express this desire to the presiding NIC representative whose professional cadre is a class or two lower than the babu. Wanting the impress, the submissive NIC representative creates the tender, pushes the file and the tender gets published without so much as a review by any higher ups at the NIC, because, well, you know, they are busy doing other more important IT things.

b. Some high up SC babu decides it is time that the SC gets onto this IT thing. Especially considering that the government has just pushed for a larger IT initiative and all the different bureaucracies involved have been allocated the budget. So, the babu thinks — I have this much money, and these many people, how do I spend it without having to bother what I am spending on as long as it looks IT enough ? I know, I’ll buy laptops (laptops are IT things right ?) and lets spend all our budget on that. Our presiding NIC representative should know what’s the most expensive laptop around …

c. …and this, unfortunately, is probably the most likely. Our presiding NIC representative’s brother-in-law’s-son’s-wife has a cousin who recently became an authorized Apple vendor and is looking to get his foot into some sweet government deals.

d. …the least likely though, is that, the computing needs of the ‘Honorable, Me Lords’ were evaluated and matched against the available platforms that satisfy these needs and Macs were eventually found to be the best choice.

So, returning back, why am I happy ? Well, it seems like democracy works in India. I read today that the petition filed has reached the hands of people important enough to influence the outcome:

Petition to Cancel Proprietary Tender by NIC given to CJI and DG NIC

As far as I can tell, none of the organizations protesting the tender have any thing to directly gain by doing so.

Sure, this is in no way a win. Sure, in all likely hood, ‘Me Lords’ will get their ‘Honorable’ hands on their Macs but the fact that there are people with a social conscience in our IT sector who are willing to take the effort to make their discontent known, is good enough to begin with.

Things are changing and that’s what I am happy about.

[1] http://www.ae.iitm.ac.in/pipermail/ilugc/2009-September/thread.html#51495
http://www.ae.iitm.ac.in/pipermail/ilugc/2009-September/thread.html#51527
[2] http://blog.livemint.com/play-things/2009/10/02/apple-fanboys-at-the-supreme-court-of-india/

On reading code efficiently

As someone who learned to program the non-traditional way (ie: by reading and hacking on already written code) rather than ground up (ie: by writing hello world and progressing from there on), I feel the ability to read code is often under-stated when people offer advice on good programming practices. Especially considering that any good programmer, in her entire programming career would end up reading more lines of code than writing !

I have thought a bit about this subject (and also observed good programmers read code). While there are many tools which can be used to efficiently read code, I’d like to share my thoughts on the methodology.

Good programmers read code the same way most of us read a newspaper

  • They’ll look at the main entry and exit bits (the headlines) to get a ‘feel’ or overview of the nature of the application. This might also involve reading any design docs or UML diagrams or even badly drawn out bunch of boxes. The better that people are at looking and understanding the big picture, the less they have to look at to get it.
  • After that, they might jump into the bits that interest them (in our analogy — the sports section, the comics or *shudder* page 3). So, coders interested in just using the API will start exploring the headers. Those interested in hacking on the code, will start looking at the source files that are possibly named according their area of interest (that’s why naming and source file layout also is important while writing code). This is where cross-referencing tools help.
  • When looking at the code itself, for example, when tracing through a function, some bits are more or less taken at face value (as we do with phrases like ‘from reliable sources’ or ‘an independent study’) …at least during the first reading. In other words, faced with a statement like this:
    devices = probe_for_devices(args)
    …good programmers would only dive-into the definition of probe_for_devices() after they have a general enough understanding of why doing that is necessary in the caller (unless of course, /that/ function was what they were interested in looking at all along)
  • Now, when the time comes to not just passively reading but /interacting/ with the code, good programmers would first look for tell-tales signs on making such interactions easy (ie: what kind of logging/debugging facilities does the code provide ? can sub-components be built and tested independently ? Are there any compile time options available to assist this effort ? Can we get an intern to figure all this stuff out[1] …etc)

Doing all of the above of course is fun only if (again like natural written language), the quality of the code you are reading is good. Bad written code is also badly read code.

Now all that said, knowing how to use your tools well (ie: your editor, code cross-referencing tool, the man pages, API docs ..etc) improves the efficiency with which you read /immensely/. That’s how good programmers are able to ‘walk’ through the source in the same manner as the system would during execution.

FWIW: My tools of choice are, vim, cscope and a decently fast internet connection

Thanks for reading. Your views and comments are welcome.

[1] That’s where I usually came in šŸ™‚