Archis's Blog

August 28, 2008

Is poverty a choice we make?

Filed under: Uncategorized — Tags: , , , , , , , , , , , , , — archisgore @ 7:03 am

Bernard Shaw once said, “The worst of our crimes is Poverty.” This was a few decades ago, and yet, it is so applicable to all of us. I say this now, in the context of the local Indian culture, society and norms.

Hear me out before you flame. I do admit that most Indians are poor and desperate. They have no hope for a better life in the near future. They have no opportunities for education (no, this is not going to turn into one of my pro-reservation rants). They have no opportunities for any respect or better treatment. And I have all the sympathy for them. Now that I’ve put in this rather detailed disclaimer, these aren’t the people I’m talking about (and neither was Bernard Shaw.)

Poverty , for those who don’t have to face it, is full of romanticism and nobility. It somehow propels the most worthless loser on earth to some kind of holy self-less Jedi-Knight level (perhaps the same way I claim to want to be a Jedi so long as I don’t have to endure their hardships daily). No, this isn’t the typical “be happy with what you have because there are people poorer than you” crap either! And for the record – I hate that kinda crap.

This is about how we choose poverty to escape responsibility and accountability. This is about how we use poverty as an excuse to do what we want while feigning helplessness. This is about transforming poverty into a heroic virtue, and pretending it has been chosen to avoid the struggle to escape it.

Let me begin by a controversial claim, and one that gets most of my friends mad when I make it – India has never really faced severe hardship due to natural causes and that this has made us a very complacent society. We have natural resources, tropical climate where plenty of food is available, temperate climate, and a rich forest. Alright alright, so we need people to actually go and farm, but there’s not been much to complain of naturally. It’s not like we were in the middle of a desert, or a place that’s buried in snow half the year. There have been places that faced inevitable hardships and problems – where people had to work together to avoid extinction, not just inconvenience. Indians on the other hand have always faced artificial hardships – 99% of them caused by the then-rulers, whoever they may be. In other cultures, there would be mass revolts, but we just keep on whining and do nothing. And the reason, in my opinion, is plain and simple – there really is nothing we faced more than a minor inconvenience. If someone goes into examples of farmers in Maharashtra committing suicide – they’ll be proving my point – a few deaths really don’t matter to us, which is why we’re so complacent and smug to discuss this in civilized society to appear concerned but do nothing beyond that. Those farmers dying is, at best, a minor inconvenience for the rest of us because now we need to appear to be concerned in our next social outing and waste a few moments talking about it.

The effects of this complacency are seen throughout our culture – we’ve always idolized artificial challenges – our great Sadhus fasted for a thousand years which makes sense in a society where food was plentiful. The same would be called idiots in places where the daily survival was to find food to get through that day, and instead their heroes would be those who struggled to gather food and perhaps feed a couple of mouths more. Whenever someone talks about problems in India, we snap back, “We invented the zero.” A phrase that makes me proud of whoever invented the zero a thousand years ago, and then equally ashamed of the 200 generations in between who didn’t use it until the Europeans told us to (if you’ve read my previous entries you’ll know the one thing I demand above all is responsibility and accountability – if we’re responsible for inventing the zero, we’re accountable for not having used it.) Here again, we find that being able to do tabular arithmetic due to the decimal system was valuable where resources were scant and they needed to be managed efficiently. Let’s face it, India’s illiteracy is as much voluntary as it is due to circumstances. I’ve lived in a rural village all my childhood and people looked down upon us “educated”-types who were thought to be wasting their lives by studying. Here again we see that education is really a previledge and not a necessity.

I’ll come to the point now – is poverty a choice we’ve made to allow us to be lazy, and complacent and irresponsible and unaccountable? I’ll leave that as an open question for you and will give some points to think about.

India is not a poor country by any means. Poor countries demonstrate need. The US is a poor country – I feel sorry for them. They have problems like the recession, and they discuss those problems, they face them, and they ask for help. They take steps to fix the problems. That’s the evidence of being poor. If you’re wondering whether Indians discuss and face these problems or whether we live in denial, you’ll get your answer in the responses to this post. We have 3% population that pays income tax, and those 3% are called “stupid” for not being able to evade taxes – what’s worse is that those 3% are also the ones who lose out in every red-taped procedure. Those 3% rich people offset the costs for servicing the “poor people” with black money who get instant services (I would be happy to arrange a demonstration for the skeptics, at their leisure.) Meaning, those 3% like me are stinking rich who’ve supporting our poor below-poverty-line minsters who can’t make a decent living.

We go around claiming we’re a “poor country” and hence don’t have money for academic research (or any research for that matter.) Look closely though and you find that it’s a choice we’ve made. I don’t blame us for not wanting to do it – research is hard and thankless work, but have the guts to say we’re lazy. Don’t blame it on lack of resources.

One of the most visible (and admittedly not very critical) examples is IIT Mumbai’s is sky bridge in their gents’ hostel. Sure, it looks impressive, but playing table-tennis on a sky-bridge 100-feel-high, in my opinion (the great IIT scientists may disagree), adds no academic value to the country whatsoever. That money could have funded thousands of research projects in thousands of institutions all over the country. A “poor” society, is by definition, a utilitarian one. It is supposed to divert every single resource to satisfy a “need” before allocating them to a “nice-to-have” feature. Isn’t this the same institution that claims they don’t get enough teachers

On a larger scale, the entire educational system is filled with reservations – no, not for the lower-castes, for the institutions. We fund Rs. 700 crore per-year-per-IIM, and Rs. 500 crore per-year-per-IIT – in the same breath we are proud of all pass-outs being hired outside the country. This is reservation – a non-competitive market – if you’re in the “IIM” caste, you’re given a free ride. A grant without accountability and without responsibility. (This isn’t an anti-IIM rant but those are the big numbers – there are hundreds of universities/colleges the government funds without any accountability whatsoever.) If the UGC instead declared that every year they’ll allocate this 700 crore to any management institution based on a competitive criteria – heck I’ll allow the IIMs to define that criteria – but once defined, it should be immutable. Let other institutions in the game – let the IIMs have the possibility of losing those funds for one year. If they’re so good, they won’t mind. In a “poor country” funds are competitively allocated where they bring back maximum benefit. Still want to claim we’re poor?

All in all, we as a society, have turned into whiners. Poverty allows us to escape/justify whatever faults people find in us. Can’t do research? We’re poor. Can’t pay taxes? Taxes are for the rich, even our ministers are on welfare here.

Can anyone deny that poverty is the biggest crime we’re all guilty of?

August 21, 2008

Code merges are a damned dangerous affair!

Filed under: Uncategorized — Tags: , , , , — archisgore @ 6:15 pm
I learnt a valuable lesson today. Some code that I had safe-merged about 6 weeks ago, caused a strange behaviour to manifest itself in the last couple of days.The code crept in during a conflict-less merge. Who knew? We do such merges 10 times a day, 5 days a week, and then some more on weekends.

The issue crept up behind our backs – and manifested as a bug in some totally different part of code. Took a few days of back-tracing until we realised where it was coming from. Took a couple more hours to narrow down the symptoms. And then took a line-by-line code-trace to find the probable cause, and then another diff-history review to look at where it came from.

Turns out that was just a single line of code that the merge didn’t detect as a conflict. Imagine what could happen if it were just a few lines. And the nightmare worsens if it happened to multiple files.

All in all, a valuable lesson learnt. Don’t ever accept a merge without at least a quick once-over review.

August 20, 2008

Handwriting fonts with slight randomization

Filed under: Uncategorized — Tags: , , , , , , — archisgore @ 7:54 pm

I’m working in a paper-aging process to create an authentic 18-century looking library at my office cube (but more on that in a later post). And I realised a major snag I hit. Out of all the fonts I searched – no matter how realistic they look like handwritten text, they still render two characters identically.

I’ve always heard how the TTF spec has a full fledged turing-complete language in it. I’m waiting to be impressed. I’m looking for a font (again, a college project I am willing to fund), that will contain metadata on standard deviance or allowable variance on each gylph on each character. What I want is a realistic-looking handwriting font with “mistakes” in it.

Anyone aware of such a font? Anyone think this is an interesting thing worth doing? Unfortunately for me, the one thing I dont have is time. Fortunately for me, I don’t mind going through some expense if this needs to be custom-developed.

August 16, 2008

Where can I get a punch card machine?

Filed under: Uncategorized — Tags: , , , — archisgore @ 6:27 am

This may be the rare occasion where I use my blog to ask questions rather than bombard my opinions on the few readers who care to read it.

I was talking to a friend one night and she mentioned an interest in looking at punch cards once – just for the fascination and respect one feels when we look at how our forefathers brought about the computing revolution. This spiked that instrumentation-spark in me (a Dark Side that I try to hide).

Old instruments always inspire us us with awe and admiration at their novetly – it makes us believe in our future. I know mathematicians still learn the Slide Rule out of fun and curiosity. People still want to know how to use the Abacus. And then why do we throw away our past, our history, our legacy so easily and at the slightest whim?

Here’s the deal – I want a punch card machine – a reader of some sort. If someone manufactures them, I’d be happy to buy it. If not, will some college students enthusiastic about recreating the founding steps of computing, just build one? Build a card reader that will read a fortran program, run it on the desktop and provide the output on a printer (for a close recreation, I do have an old dot matrix printer).

It’s easy to blame our programming tools – but I’ve got this itch to write code using punch cards – run it and debug it. I want to look at deploying it – I wanna try and send a “program” to my friends over punch cards which they can run and use. Maybe its just plain old stupidity. But it’s an urge and I’m ready to do all I can to satisfy it.

If anyone has any information on where I might get my hands on a punch-card instrument, please I beg you, contact me and tell me how I may get my hands on it. People love to sail on old ships. I’d bet there are many captains who would want nothing better than to sail on a 16th century ship. That’s the way my obsession with punch cards stands.

I have some crazy friends who play with Slide Rules and teach them to enthusiastic students. Given such an instrument, I’m sure their ever-mischievous brains will think up some way of making it the rage amongst the upcoming computer science students – perhaps re-igniting that interest in the core science that we all claim has been lost lately.

August 12, 2008

How to really handle the "back" key on a Smartphone

Filed under: Uncategorized — Tags: , , , , , , — archisgore @ 2:06 pm

There’s a lot of documentation and blogs on using the SHSendBackToFocusWindow API on Smartphones for intercepting back keys and sending them to EDIT controls on your window. As anyone who has actually taken the trouble to code on a smartphone will soon realise, this isn’t always enough to give you the complete effect you need.

Specifically, here’s how the EDIT controls are supposed to respond to the back key:
1. If the EDIT control is empty or has no focus, and the user presses the back key, it should behave as the default behaviour – which is to take you back to the previous window that had focus.
2. If the EDIT has focus, and is non-empty, the back-key should behave like a backspace.

Most docs that I found recommend the following usage of the back key handling in your WM_HOTKEY message (perhaps because that’s the example given on MSDN):

WM_HOTKEY:
{
if(HIWORD(lParam) == VK_TBACK)
SHSendBackToFocusWindow(uMessage, wParam, lParam);
}


However, the behaviour this creates is to trap all back key presses and send them back to the focussed window and hence once your window has focus, the back key is effectively disabled unless it’s used as a backspace by an EDIT control. I’m sure you’ve found this quite irritating – it drove me nuts trying to figure this one out – and there aren’t many code-samples explaining this.

Heck, I didn’t even know about the SHNavigateBack API which allows you to cause the default back-key behaviour. Once you get your hands on this, things are pretty simple. In your WM_HOTKEY handler, all you do is get the currently focussed window:

HWND hWndFocussed = GetFocus()

Then check whether it’s an edit control by getting it’s class (probably with one of the Class Info APIs). And finally, get the window’s text (using GetWindowText) and strcmp it with a blank string (a pair of double-quotes). The pesudocode should look something like (I don’t include actual code to protect both you and me):

WM_HOTKEY:
{
HWND hWndFocussed = GetFocus();
if(HIWORD(lParam) == VK_TBACK &&
IsEditControl(hWndFocussed) &&
IsNonEmptyText(hWndFocussed)
)
{
SHSendBackToFocusWindow(uMessage, wParam, lParam);
}
else if ( //your dialog has a default cancel action
{
//Do cancel behaviour here
}
else
{
SHNavigateBack();
}
}

With any luck, this should give your apps a “native” feel making them behave like any other Smartphone apps.

August 10, 2008

Firefox on Ubuntu sucks bigtime!

Filed under: Uncategorized — Tags: , , — archisgore @ 9:54 pm

Ughhhh! Damnit! I was okay with facebook scripting totally sucking on by firefox at home, since at least I could access it from work. But come on – it sucks bigtime.

For one, the browser looks God-awful ugly! You know, all the wobbly windows and rotating-cube-desktop is worthless if my browser isn’t usable (there’s a difference between showing an ugly browser with translucency and an opage browser which us usable). The windows version of FireFox is much much better looking. Considering that they have all the sources to KDE and GNOME and all the X-variants and all the thousands of distros custom patches, you’d have thought the UX would have been a lot better than the puny common windows that has the same lame API on thousands of machines.

What really got me ticked off right now is that I’m in the middle of a poker tournament on facebook and the shitty thing won’t open. The Javascript has always been unreliable – works sometimes, and doesn’t at other times. But it was okay. So much for “reliable just-works experiences”.

I don’t give a damn if this is facebook’s fault or FireFox’s fault. I want it fixed! If you can spare time and energy harassing and terrorising Apple for their working iPhones, I can expect that you at least pretend to show your users some amount of attention.

Flash doesn’t work. I don’t care that it’s not an open format. Again, prove ESR’s (I dare not say Stallman’s because the man prefers a non-working Machine if it gives him the freedom to prevent it from working – I on the other hand, _need_ a working machine) principles and create a common working format that guarantees developers some semblance of a platform and deploy it and people will use it. Don’t dare give me some half-assed reason in the comments section about why you can’t do it. Either show me a working alternative, or STFU!

And please don’t insult yourself or my intelligence by giving me the “It works for me!” answers. I’m a developer who has a hundred bugs to resolve at work to ensure my code is resilient to whims of wierd users. Spare me!

Theme: Silver is the New Black. Blog at WordPress.com.

Follow

Get every new post delivered to your Inbox.

Join 122 other followers