Wednesday, July 09, 2014

July 9, 2014

Drat, I forgot to set the alarm and slept through the Brazil-Germany match. The match must have really been weighing on my mind as I drifted off to sleep, because I dreamt that I actually watched the match, and that Germany beat Brazil 7-1, with five of those seven goals scored before thirty minutes.

Oh wait, that wasn't a dream.

You know you're losing badly when the broadcaster needs to employ scrolling in the onscreen display to accommodate all the goals scored by your opponent.

Jokes aside, the match reminded me of something similar that happened in the eighties. Some genius in India's football administration had the idea of bringing PSV Eindhoven over to India and having them play one of the Calcutta 'giants' in a series of games. Needless to say, the giants had their asses handed to them (if I remember right, the score was 8-0 or something similar in all the matches) -- it was a master class in tactics and skills more than anything else. As I mentioned at that time, we would have been better served if we had invited one more team (say Ajax) and asked them to play each other. Heck, a cheaper option would have been to divide PSV into two elevens (throwing in a bunch of Indian players if the numbers were insufficient) and make them play each other.

While the Brazilian fans should be commended for not abusing their players, throwing stones at the players' houses, and so on (Update: I guess I spoke too soon), their grief was way overblown. Folks, reserve such emotions for more important things in life, like say, having your entire town leveled by artillery fire, losing dear ones and becoming refugees (Novorussia, in case you're wondering. The Saker has some gut-wrenching videos if you have the stomach for it). Passing on your passion to your child who weeps uncontrollably at the sight of the mauling your team is getting borders on child abuse to me.

Two defining images from the match: a shell-shocked Brazilian spectator hugging a replica Jules Rimet trophy, even as the chances of his team lifting the real one are all but gone in smoke, and Luiz and Gustavo sinking to their knees at the end of the match, eyes tightly shut as they said their prayers to God (folks, this is Faith. With a capital F).

Monday, June 30, 2014

June 30, 2014

Some brilliant prose about Tony Blair via xymphora. Choice bits (the entire thing is definitely worth a read):
Tony Blair rises every couple of months, like a bubble of swamp gas. First there’s an uneasy buried rumbling, then small tremors shake the surface, and then suddenly he bursts through, a gassy eruption stinking of farts and sulphur. It doesn’t matter how many rounds you fire into his shambling frame; he just won’t die. Whenever something unpleasant happens in the Middle East, whenever some huge corporation is discovered to be starving people to death or poisoning them through calculated negligence, whenever the chaos of the international order starts to wobble into another death-spiral, a damp wind blows through a graveyard somewhere in England and Tony Blair emerges from his tomb. There’s something viscerally revolting about the man. His fake chumminess and his sham gravitas are both as nauseatingly contrived as his shiny oily skin, hiding what can only be bloated rotting organs inside. He’s a gremlin, an incubus, very strange and very cruel and very foreign to our world. But still there’s a decaying vestige of that charm, the memory of the love in which he was once held, that universal joy when he finally ended a generation of Conservative rule by ending the Tory monopoly on evil. We’ve deluded ourselves into thinking that we’ve learned from the experience, we’re past all that now, but every time Tony Blair re-emerges there’s still a shock. There he stands, with his jug ears and his peg teeth and his manic eyes full of an otherworldly certainty – it’s like the shock of seeing a former lover going through your bins at night, or a long-forgotten childhood toy waiting for you on your bed. He represents something that’s been repressed, and even though the repressed always returns, it’s always a surprise. Who is this hideous figure? Why is he still alive? Why won’t he just leave us alone? Of course, Tony Blair was never alive. He’ll never leave us alone.
While on the subject, The Saker hits one out of the park as well ('see who will get the title of "employee of the month" from Uncle Sam').

***
I haven't been following the World Cup as closely as I'd like to. To be honest, I'm not sure whether I'd really like to; I know this sounds like heresy coming from somebody who watched every match in Italia 90 at least twice--once live, one or more times the repeats, but the fact is that most of the action in a football match seems to have become quite pointless to me. There are spells when somebody does something breathtaking on the field or when a team is laying siege to the opponents' goal in a do-or-die battle to survive as the clock is ticking inexorably, but the rest of the time the action is not dissimilar to the Simpsons parody of soccer. The cynical attitude of the players doesn't help either. I have mentioned this earlier too, but the one question that comes to mind when watching their antics is "Dude, what the hell were you thinking when you did that?", be it van Persie's blatant shirt-pulling in the opposition penalty area, or Arjen "The word you're looking for is sissy" Robben's *ahem* 'simulation'.

Friday, June 20, 2014

June 20, 2014

I made this table mainly to confirm and schadenfreude over (a. yeah, not a verb, and b. can't believe I spelled 'schadenfreude' correctly on the first try) England's misery, then thought I might as well share it -- joy shared is joy doubled and all that. The only scenario where England makes it to the knockout is the one in red, even then subject to other factors (goal difference? phase of the moon?). All this is based on the assumption that England beat Costa Rica, of course.


The violation of the law of conservation of points (ever since they introduced three points for a win) grates as usual.

Friday, May 30, 2014

May 29, 2014

So these are the Club of Rome predictions (via Dmitry Orlov):


I am as much of a collapse porn aficionado as the next guy, but if these predictions are an important component of the collapse story, the script needs to be rewritten. If you look at the graphs carefully, the trend predictions could have been done by a layman simply through visual inspection of the data (aka, take a ruler and just extend the lines), and you wouldn't have been too far off the mark for any of the parameters (in fact, your prediction would've been more accurate vis-a-vis food per capita). We have not reached the years corresponding to the predicted peaks yet (except maybe for per capita industrial output), so we need to go a bit easy on the hosannahs for the accuracy of the predictions so far.

Thursday, May 22, 2014

May 22, 2014

(This year's obligatory IPL post will be in the form of bilious haikus)

Kingfisher ad sucks
Celebs demeaning themselves
Yodelling eunuchs

Ex-celebs pimping
Wares in their commentary
Danny please shut up

None cares what you think
Oh random Twitter posters
#FuckAllHashTags

Flag-waving faux fans
Long-dead purists spin in graves
Monkeys jump at fruits

Zoomi zoomi ka
Je se va ke po shi kumm
musho va
re va [*]

[*] Dead horses scream "Stop!"
Stuff that nightmares are made of
Incubus R  Us

Saturday, May 17, 2014

May 17, 2014

I've recently taken to chess again after a long hiatus. Online chess has come a long way in the last 15 years (which was when I last checked things out); I signed up at chess.com, and it's been great fun all the way. If you want to keep up with what I've been doing there, simply follow the buzz there about the mysterious stranger from India who's been making waves and giving the highly-rated old-timers a run for their money (just kidding, I'm the guy with the puppy avatar who's languishing with a tactical rating in the 1290s after briefly touching 1344).

This post is not about the cerebral aspects of the game, the strategy, the tactics, and so on, but about the emotional aspects. Consider this Daily Puzzle entry from yesterday:


It's white's turn to move, and a cursory look at the board immediately shows the danger: the white king is all alone on the right side, seemingly at the mercy of a phalanx of attackers led by the black queen. Also, the black knight is a move away from forking the white queen. All the white pieces look helpless, stuck on the wrong side of the board (with the exception of the rook on a3, who looks like he may be able to charge to the king's rescue and die heroically on the king's lap--ignoring for the moment what an elephant lying on a person's lap would mean to said person's state of health--in the process, gasping out an "Alas, I have but one life to give to my emperor"). I used the word "seemingly" upstream because, as I mentioned earlier, it's white's turn to move, which means appearances are deceptive, and there is some avenue of escape (maybe even victory?) open to white. Is it the bishop on e2 who can produce the check, ineffectual though it may be? Can the white queen somehow find the time to rush forward and cause a back-rank mate? Should the king charge forward boldly to g2 and meet the attack head-on? Would such a charge enable the other white rook to find some action on the h-file? One can cut the tension with a knife. Or considering the context, maybe I should say 'saber'.

Cerebral the game may be, but take away the emotions and the drama, and you might as well sit with paper and pencil and solve partial differential equations.

Thursday, May 15, 2014

May 15, 2014

Michelle Obama's Instagram picture backfiring spectacularly, as it rightly should. The more accurate content for her sign would have been '#Doh' (or alternately, '#I am the wife of the most powerful man in the world, and the best way I think I can help is hold a piece of paper with a hashtag and look seriously dumb').

On a related note, compare Putin's recent address to the Russian Duma with the usual hopey-changey rhetoric from Obama. And folks still wonder why Putin is held in higher esteem globally. The problem is, Mr Hopey-Changey's target audience are, to quote JimQ from Washingon's Blog: 
...the technologically entranced zombies shuffling along the sidewalks staring blankly at a tiny screen, tapping away on an itsy bitsy keypad as if whatever they are conveying is of vital importance to the future of mankind. # Give me a break.

Tuesday, April 29, 2014

April 29, 2014

GoDaddy doesn't have much of a reputation in their place of origin, and they're not doing anything to remedy this in India. Nothing says 'Pimp!' better than using a gaudily-dressed Mithun "Dude, where's my neck?" Chakraborty and an entourage of scantily-clad women for selling their wares here.

Staying on the subject of TV ads, I think the phrase you're looking for is "Botox Barbie".

I think it's time to invent a new acronym, unwieldy as it may be, IKIGTHFT: I Know I'm Going To Hell For This, considering the amount of snark I've been using recently.

***
Dileep Premachandran's excellent article on Chelsea's recent win over Liverpool. Master tactician my ass, indeed. To me Mourinho will always be a crass boor with a perennial chip on his shoulder. I did applaud the second goal (a little schadenfreude now and then never hurt anybody), but I'm of two minds as to whether I want City or Liverpool to win the Premiership. No two ways about how I would feel if Chelsea sneaked in.

Saturday, April 19, 2014

April 19, 2014

If the AAP government in Delhi rouses some people from Africa on suspicion of drug dealing and other illegal activities, it's called racism. When The Hindu calls the entire state of Arizona 'rednecks', it's not. Got it.

Friday, April 04, 2014

April 4, 2014



A couple of questions (disclaimer: I love Dave's writing):
  1. What is a conspiracy theorist doing on LinkedIn?
  2. How the %^&$ does LinkedIn know my interest in Dave's writing? I bought Programmed to Kill eons ago, but I can't for the life of me think of any other connection.

Thursday, April 03, 2014

April 3, 2014

Long ago I made a promise to myself that I would not read anything from The New York Times, but I have broken this promise on multiple occasions since. This piece is the latest one benefiting from my lack of resolve. Well, 'benefit' might be a misnomer, since I don't have anything nice to say about it. As the saying goes, if you don't have anything nice to say, move your ass pronto to your personal blog, so move my ass I did.

Let's focus on a couple of things.
Don’t mindlessly favor people with high G.P.A.s. Students who get straight As have an ability to prudentially master their passions so they can achieve proficiency across a range of subjects. But you probably want employees who are relentlessly dedicated to one subject. In school, those people often got As in subjects they were passionate about but got Bs in subjects that did not arouse their imagination.
Students who get straight A's have demonstrated something quite valuable from an employer's point of view: giving their best and excelling in all courses, even the ones which may not have been their favourites (let's face it, even when you major in a discipline of your choice, you will not love all of them. If you do, we get it, you're really exceptional; hold on a sec while I finish this post, I'll go get your candy treat). Replace courses with projects on the job, and you have stick-it-to-vity.
Bias hiring decisions toward dualists. The people you want to hire should have achieved some measure of conventional success, but they should have also engaged in some desperate lark that made no sense from a career or social status perspective. Maybe a person left a successful banking job to rescue the family dry-cleaning business in Akron. Maybe another had great grades at a fancy East Coast prep school but went off to a Christian college because she wanted a place to explore her values. These peoples have done at least one Deeply Unfashionable Thing. Such people have intrinsic motivation, native curiosity and social courage.
Nope, rescuing the family dry-cleaning business or going off to a Christian college to explore one's values is not a Deeply Unfashionable Thing; these are things that get you brownie points in the 'right' circles (and probably help you get laid a lot too, come to think of it. Chicks dig deep guys who explore their values. Not to mention clean laundry). You know what's a really Deeply Unfashionable thing? Taking a year off to explore the dynamics of violence-based sexual relationships by becoming a serial rapist. Try spinning that one in your first interview coming in from the cold.

Monday, March 31, 2014

March 31, 2014

Book review time again. An oldie which I discovered only recently.

I'd like to say I enjoyed reading Flow, but the style and prose are not exactly conducive to a, whatchamacallit, a flow experience (pun quota for blog post exceeded, please contact our staff immediately). The text is mercifully bereft of footnotes and references, but this still doesn't lead to a very pleasant reading experience.

Having said this, this is an extremely important book, a must-read for anyone looking for personal growth, reinventing themselves and rediscovering their calling. Buddhists have every right to say "I told you so", but it's still good to have scientific backing and research for such common-sense intuitions.

Quick summary, more for self-reference, as I had to return the book to the library: pleasure vs enjoyment, matching of skills vs challenges, feeling of being in control, constant feedback, integration and differentiation. Oh, another important aspect: the flow experience is value-neutral (it's possible to be in the flow and still do things that are immoral or make others think you're crazy).

If at all there is any criticism of the book, it is an effort to, in my opinion, shoehorn enjoyable experiences into the flow paradigm even when it seems somewhat contrived. I'd provide examples, but no book, so no go.

Friday, February 28, 2014

February 28, 2014

Holy shit, it's obvious when you start on the thought experiment that Greer is talking about Hitler, but the superficial similarities with AAP practically jump out at you (not least the similar-sounding names). Example (the entire post is well worth a read):
Through all this, the new party keeps building momentum. As spring comes, Halliot begins a nationwide speaking tour. He travels in a school bus painted green and black, the NPAPP colors, and a Celtic tree-of-life symbol, the party’s new emblem.  The bus goes from town to town, and the crowds start to build. A handful of media pundits start talking about Halliot and the NPPAP, making wistful noises about how nice it is to see young idealists in politics again; a few others fling denunciations, though they don’t seem to have any clear sense what exactly they’re denouncing.  Both mainstream parties, as well as the Libertarians and the Greens, launch youth organizations with their own t-shirts and slogans, but their lack of anything approaching new ideas or credible responses to the economic mess make these efforts a waste of time.
*****

Why do some sites (I'm looking at you, LinkedIn) frown upon the use of Privoxy when accessing their services? Try accessing them this way, and all you get is a 'We detect unusual activity from your network' or something similar, and there's no way to continue till you turn Privoxy off.

Thursday, February 20, 2014

February 20, 2014

Dear Flipkart,

Thank you very much for your very thoughtful question "How has your experience using Chhota Bheem been?".

Bheem been. Bheem been. Bheem been. Hee hee hee.

Sorry, got carried away a bit there.

Anyway, the experience has been simply wonderful; I can't for the life of me imagine how things would have turned out, had I used, say, Red Bird or Blue Bird, or, god forbid, Yellow Bird. I'm sure these characters have their share of hardcore supporters, but I'm a Chhota Bheemer myself, and wouldn't have it any other way.

With that out of the way, here are the ways the Chhota Bheem figurine has enriched my life:
  1. He is an excellent paperweight. I would like to highlight the stellar role he played when there was a sudden gust of breeze from the open window. But for his weighty presence, all the papers below him would have been blown clean off the table.

  2. He also makes a very effective blunt instrument. My last three adventures as a stalker-cum-serial-killer have been a hoot because of him. Just one firm blow, the satisfying crunch of weapon on skull, and very little blood (I can actually buy another Chotta Bheem figurine just from the money I saved on cleaning fluid, but I digress).

  3. He is an excellent conversation piece. I've lost count of the number of new friends I have made since getting him -- all I have to do while walking down the street is to suddenly whip him out of my bag at random strangers and start humming the signature tune from Pogo. Instant friendship, I tell you. In fact, I acquired my last three 'special' friends this way; see also #2 above.
However, it would be remiss of me if I claim that it's been a bed of roses all the way, and I must point out ways I've felt let down by CB (hope you don't mind me calling him that).

  1. He doesn't respond to commands. "Get me that book on the table" elicits only the same village-boy-in-awe-of-modern-gadgets look. Adding a "Please" doesn't work, either.

  2. He doesn't seem to have an appetite at all. Going by the gusto with which he gulps down laddus before doing a number on the baddies, you'd think he'd react at least a little bit favorably when I offer him similar (if not better) laddus. Nope, same village idiot look.

  3. I don't have any proof for this, but I think he's been playing naughty with my other toys. The stuffed Chutki on the top shelf has a distinct look of horror on her face -- something she definitely did not have when I stole received her as a gift from that kid on the bus. Nothing I can take to the court, but still.
But all in all, a five-stars experience. Would I recommend him to my friends? You bet. In fact, I would be surprised if you haven't already received a glut of orders for the figurine, with a special add-on request for  a handy, removable velcro grip (makes removing the bloodstains a lot easier) -- I sure have been spreading the good word among my Stalker Club buddies.

Yours,

Tuesday, February 11, 2014

February 11, 2014

The Hindu with some rare egg on its face. No, make that a Baked Florentine Omelette with spinach, Mozzarella, Ricotta and other great stuff. It strains one's credulity to believe that they got such a critical quote wrong, and that too in the editorial of all places. I'm not a conspiracy theorist (ha, whom are we kidding), but it sure looks like national security concerns trumped adversarial journalism. The simultaneous appearance of the opinion piece by Praveen Swami is interesting, not just for the fine line he walks trying to stay on the side of democracy, morals and all the good stuff, while also trying to ensure that access to sources in the national security apparatus remains in place ("Everything has a context" -- verily, verily).

*****
Meanwhile, things are heating up in IPL Land, and our friends at DC are practically slipping and sliding over their drool, climbing to the rooftops to shout out the good news. They must have been really slighted by the BCCI coterie when the Chargers were in the IPL, I tell you.

Sunday, January 26, 2014

January 25, 2014

(Disclaimer: I donated some money to Aam Aadmi Party quite a while back, so I might be a member, if they confer membership automatically on all donors; other than this, I have no link to them that I'm aware of, past results do not indicate future performance, please read the instructions carefully before proceeding, goods once sold ... somebody please take the keyboard away from me)

This post was prompted by two things: 1. A series of discussions I've been having with folks who a) supported AAP till their dharna and other 'antics' turned them off or b) still support AAP, but wish they'd behave in a more responsible and mature manner and 2. This post (while it's a bit over the top, I agree fully with its gist).

Before proceeding further, let me get this off my chest first:

Screw you, Congress. Screw you, BJP. Screw you, the Indian one-percenters. Screw you, corrupt, high-handed, lapdogs-of-the-powerful figures in authority. And while we're at it, screw you, Guy Who Kept Honking At Me in Traffic When There Was No Frigging Way To Move Forward.

That felt good. Would have been even better if I could have been freer in my choice of verbs.

Question time. Out of the following list, identify the things AAP folks are accused of:

1. Awarding government contracts and otherwise showing favour to people who *ahem* helped you to come to power.

2. Nepotism -- as in neta's son's/daughter's genes inheriting parent's charisma, leadership and sagacity, so he/she is automatically eminently qualified to ru(i)n the country/state as successfully as the parent.

3. Driving in SUVs bearing party flags and terrorizing/intimidating other motorists into giving way to them ("Appa, I keep noticing these coloured lights when I drive through some intersections, what are they? Why do they have only three colours? It would look much better if we had more.")

4. Letting loose your followers to wreak havoc on your enemies. Taken to its extreme, carrying out pogroms.

5. Arranging for a plane, at taxpayers' expense, natch, to go to Mumbai to pick up the shoes you're planning to wear for your birthday party tomorrow.

6. Shutting down the entire street for five minutes to celebrate the ex-Minister's visit to your locality by lighting x-walla crackers (replace 'x' with suitable integer that produces requisite noise for five minutes).

7. Doing a dharna that inconveniences folks for a short time in the interests of fixing issues long-term.

8. Coughing incessantly.

Three charges that merit a response are that they:
  1. Encourage anarchy, 
  2. Are socialist/populist and 
  3. They don't know how to govern properly
These charges are respectively countered by three questions:
  1. Golly, is this anarchy? Waiter, I'd like two more plates. And extra sauce, please.
  2. Are they any more socialist/populist than the Congress?
  3. Um, how long have they been in power exactly? What? Twenty months? Oh, twenty days. For a moment there I thought you said "months".
The anarchy bit needs some explaining. Anarchy does not mean 'absence of law and order'; it means 'absence of authority'. 'Authority' as in all-powerful, unapproachable entities (be they government, corporate or bureaucratic) who screw over the common man (Aam aadmi. Get it?) in myriad ways while imposing their solutions and diktats from far way, liberally using violence (physical or economic) to achieve their ends. Any move towards breaking this stranglehold (there was this guy called Mohandas Gandhi -- no, he was NOT Indira Gandhi's father -- who had this weird idea of giving more autonomy to village councils, something called Panchayat Raj?) is long overdue. The textbook definition of anarchy goes even further, but we need not go there. And staying on the subject of Mahatma Gandhi, I'm sure there were naysayers shaking their heads in disapproval when he said "Guys, listen to this great idea I had last night when I was spinning my charka -- ha ha, very funny, Jawaharji, can we get serious for a minute? -- I call it satyagraha, here's how it works...".

All this does not mean that I hold a torch for AAP unconditionally: only that, unless they're accused of things like #1 to #6 in the list above (and no, false stings do not count), and these charges stick, I'll be an AAP supporter (sans the topi; to be honest, I think it looks quite silly).

In closing, a fun factoid from the People-in-Glass-Houses department: did you know that Kiran Bedi invoiced an NGO for executive class tickets when she actually traveled economy class? It's becoming clearer and clearer that "What do you think about AAP?" is the litmus test for judging people.

Monday, January 13, 2014

January 13, 2014

Some public service activism for a change.

Considering the recent (failing) drive by the government to rein in the Chennai auto drivers and the fact that I've been personally on the receiving end of the fleecing from the scumbags on innumerable occasions, I've been thinking long and hard about the most effective way to solve the problem: something that doesn't rely on either government fiat/initiatives or a law-and-order approach (the first is easily defeated by the time-tested perversion of the Gandhian way of protests, road-blocks, general hooliganism and court stays; the second by the level of corruption in the system in the form of hidden ownership, false or non-existent documentation abetted by the bureaucracy, and so on).

One of the first solutions that came to mind was a somewhat frivolous one: a Tumblr page called 'Do an Auto Today', where participants anonymously post reports of their surreptitious actions on an auto whose driver fleeced them that day -- actions that, shall we say, are mildly inimical to the vehicle in question (a strategically applied razor blade to the vinyl seat cushion suggests itself). But this is illegal and immoral, and this blog does not condone such activities in any manner or form (I love you, Internet Thought Police, and consider your service yeoman. Please don't hurt me), so it's out of the question.

The solution I'm going to propose is however similar, and is called 'Boycott All Autos Day'.  It's conceptually quite simple: everybody agrees not to use autos on a designated/pre-arranged day. Yeah, I know, getting everybody to coordinate their actions is quite difficult, in the absence of a common messaging platform. Maybe this will become practical someday in the future and somebody will invent a wireless phone that's small enough to fit in our pockets and yet be as powerful as our mainframes, and somebody will figure out a way to connect all these phones/computers so that we can share our thoughts instantly on a single platform ('It's like a yearbook with the faces of all your friends, but the kicker is that the captions underneath the pictures keep changing based on their thoughts')...

Having beaten the straw horse to death, moving on to the details.
  1. If you use autos to commute to work, resolve to take the public transport or call a cab. The extra stress or money for one day is worth the long-term benefit.
  2. Ditto for traveling to the railway station or the airport.
  3. If it's a planned trip -- shopping, visiting friends or relatives, going to the mall -- postpone it to the next day.
  4. Unplanned trips like emergency visits to the hospital are exempt from this boycott.
  5. If you use autos for a part of your commute, use a share auto. Or better still, walk.
  6. If you feel bad because you will be hurting your friendly neighbourhood auto stand folks, please move to the side over there; our trained staff will be shortly with you to administer our in-house behaviour modification regimen that will wean you off the practice of being friendly with unethical and unsavory characters.
  7. Lather, rinse and repeat once every month for the next six months, or till all autos run on meters (whichever occurs earlier).
I think that about covers it. I'll update this list when I think of more scenarios and objections.

One objection is what if the tables are turned on us in the form of an auto strike? There are two answers to this:
  1. Thanks very much for the pre-season practice.
  2. To paraphrase the IRA's rejoinder to Maggie Thatcher, 'We can do this every month; heck, every week. Your wallets will allow you to do this only a few times'.
One can always dream.

Friday, January 10, 2014

January 10, 2014

... and the award for Honesty in Nomenclature goes to The Centre With Potential for Excellence in Environmental Science.

In this age of shameless self-promotion and hyperbole, it's refreshing to see somebody state exactly where they are: they've not achieved excellence yet, but the potential is there. Although I'm somewhat skeptical of the claim of potential too, considering that they're a government organization (going by the 'G' on their vehicle's license plate). But still. Well played, sirs.

Tuesday, December 31, 2013

Book Review: Keeping Up With the Quants

When all you have is a six-step formula, even a philosopher running naked through the streets of Athens, genitals flapping furiously in the breeze, can be shoehorned to fit into your pet paradigm.

Don't. Buy. This. Book.

Credit is however due to the authors for turning what should have been nothing more than a lengthy blog post into a book with all of 200-odd double-spaced pages. It does help when you can liberally quote blog posts and other more-or-less unrelated text snippets as well, not to mention repeat your six-step mantra every opportunity you get. No credit to you if you were unlucky enough to have bought the book rather than borrowing it from the library like I did.

While on the subject of inducements to buy, here's a pro-tip for aspiring authors: liberal application of maalish, in the form of quotes for your book from popular figures (Larry Summers excluded; the page containing his words of wisdom alone is enough grounds for taking the book to the shredder and torturing it slowly, while giving it false hopes by periodically pretending to put it back on the bookshelf) can persuade these quoters (don't bother; it's not a real word) to provide some more quotes to adorn the back of the dust jacket.

One might argue that the book is targeted at senior executives who don't know quantitative analytics, but if a senior executive reads gems like "Since data itself does not tell us anything, we need to analyze it in order to decipher its meaning and relationships" and a light bulb goes off in his brain, it's time to short his company's stock, folks.

The book does have some good things, stuff like when to use which statistical technique, references to other material, and so on, but as I mentioned earlier, nothing that can't be said in a crisp blog post.

Oh, and providing free advertising for NCSU's MSA program? You've got to be kidding me.

Friday, December 20, 2013

Building a Lisp Interpreter from Scratch: -- Part 13: Updates

(This is Part 13 of a series of posts on pLisp)

Quite a few of the posts in this series are woefully out of sync with the current code base, so I thought I'd do a post on the most significant developments.

Memory System

It turns out that we can have our cake and eat it too: native pointers/memory via malloc/free that still allow us to tag them with object types. The magic incantation that makes this possible is posix_memalign(), which allows us to create aligned memory chunks; if we request for memory aligned to a specified boundary, we can get pointers with the corresponding lower bits zeroed-out. Voila, we now have a place to tag our object types.

Using native pointers this way means that we don't need to manage the heap ourselves. No more mucking around with free lists, start and end segments, and so on. Life just became a whole lot simpler.

Object System

OBJECT_PTRs are still unsigned ints, but they're no longer indexes into the heap that are decorated with tag values; they are uintptr_t values (derived from posix_memalign(); see above) to which the tag has been appended. The same logic for marshalling and unmarshalling objects still applies, of course, the only catch being that the number we get after lopping off the tag bits is not an index into a heap managed by ourselves, but is a native pointer.

The other change in the object system has to do with integers/floats and with continuation objects. Integers and floats are also created using posix_memalign() and the corresponding tag appended to the pointers; quite a bit inefficient, since new space will be created for each occurrence of the number, but this doesn't seem to affect performance that much. Coming to continuation objects, we create a one-word space and plonk the relevant stack object there. The earlier hackery is thus mercifully done away with.

Garbage Collection

The main change here is that garbage collection no longer happens only after each top-level expression is evaluated. While this approach is simpler, it breaks down when a large computation is in progress and there is no memory available because GC hasn't happened yet. The solution is to trigger GC after every, say, 1000 instructions of the virtual machine. The trick is to protect the VM's ISA elements (reg_accumulator, reg_current_env, and their brethren) from being garbage collected -- this is done by keeping them pinned to the grey set.

Serialization

Since we're not managing the heap ourselves, using TPL for serialization is no longer feasible, since we don't have a single pointer to serialize. We therefore serialize and deserialize the relevant OBJECT_PTRs ourselves. The format chosen is JSON, and we use the cJSON library for this (Update: have replaced this with a homegrown JSON parser, on account of the need to handle large JSON arrays in a performant way). One positive impact of this change is that the size of the image file is now practically tiny (about 600K), when compared to earlier, when the entire heap -- whether used fully or not -- was dumped to hard disk. Oh, we also now 'serialize' the loaded foreign libraries. Update: serialization and deserialization is now possible at the level of individual objects too, through the SAVE-OBJECT and LOAD-OBJECT special forms.

The UI

The UI is a bit more user-friendly now; there is parens matching, some rudimentary indentation (nothing fancy, but better than nothing), and using the workspace efficiently got a bit easier. Not sure whether I mentioned this in one of the earlier posts, but there is now a debugger window that helpfully shows the in-progress frames and their respective local variables. We're are not in Smalltalkville yet, but getting there.

P.S. There is now also a special form called 'profile' which takes as argument an expression and prints the profiling information: for each sub-expression called by this expression, the number of times the sub-expression was called, how much wall- and CPU time the sub-expression took, and the number of words allocated during the evaluation of the sub-expression. Screenshots below.



Tuesday, December 10, 2013

December 9, 2013

Ivory tower jargon (actual quote from a scientific article):
In the everyday exercise of controlling their locomotion, humans rely on their optic flow of the perceived environment to achieve collision-free navigation
Translation for us mere mortals:
While walking, people use their eyes to avoid bumping into things.
Gah.

Monday, November 25, 2013

November 25, 2013

Nice (italics mine):
It wasn't entirely a shock to Fallon, as he'd always been aware that he was someone especially motivated by power and manipulating others. Additionally, his family line included seven alleged murderers, including Lizzie Borden, infamously accused of killing her father and stepmother in 1892. Many of us would hide this discovery and never tell a soul, out of fear or embarrassment of being labeled a psychopath. Perhaps because boldness and disinhibition are noted psychopathic tendencies, Fallon has gone in the opposite direction, telling the world about his finding in a TED Talk, an NPR interview and now a new book published last month, The Psychopath Inside.

Thursday, November 14, 2013

November 15, 2013

What can you do with, say, Rs 15 crores?
  1. Lifesaving heart surgeries for one thousand children @ Rs 1,50,000 per child
  2. School tuition for a year of Rs 10,000 for 15,000 children (we're talking about a less-than-middling school, nothing fancy)
  3. Splurge it on a luxury condominium with seven-level security, personal elevators, designer sanitary and bath fittings, gym, terrace pool with jacuzzi, a panic room and a quick-safe room (I don't even know what the last two are for; maybe sanctuaries to quickly escape to when you're paralyzed by terror at the thought of what will happen when the Revolution comes for you?)
(In case it wasn't clear by now, this is post #17384 on what's wrong with our country).

The full front-page ad in The Hindu yesterday shows an airport runway with a just landed aircraft, and a well-heeled lady climbing out of a limousine, with a concierge/butler type helping her out, holding her gloved -- naturally -- hand  while protecting her from the elements with an umbrella (disclosure: I do not know for sure whether the umbrella is diamond encrusted). Oh, and in the background you can see a highrise, no doubt housing the above condominium with the panic room.

The sad part is that these condominiums will probably be overbooked and will anyway be on an invitation-only basis to keep out the mere millionaires. You can try having your secretary call the numbers provided (they actually say this in the ad: 'Have your secretary call us at ..."), but unless your net worth is in three figures (we're not talking rupees here, but crores) be prepared to take a number and wait.

The other ridiculous aspect of the whole thing is that, when you step out to your balcony in the morning, with the platinum cup of coffee made from beans shat out by an endangered civet, Central Park you ain't getting: on a lucky day, there will not be any street dogs crapping (if you're feeling bored, you can amuse yourself by wondering what kind of beans you'll find in their poo) in front of your building; on an unlucky (or extra-lucky, if you're into that sort of thing) day the canines might very well be replaced by a member of homo sapiens.

Tuesday, October 22, 2013

Multi-Stage Programming in Lisp

I have been reading up on MSP recently, and trying to grok the examples in Walid Taha's Gentle Introduction. When all you have is a Lispy hammer, every problem calls for a program with parentheses, so the next order of business is to find Lisp equivalents of Bracket, Escape and Run.

'Run' is trivial; to run a Lisp program, we evaluate expressions; so 'eval' it is.

'Escape' is for dropping in actual values into placeholders, so a comma seems appropriate. However, a comma has to occur within the context of a backquote, so it seems we're stuck. But wait, an Escape has to occur within the context of a Bracket, so maybe we can use backquotes for Brackets? Further analysis, in the form of seeing how well the two words rhyme, proves that backquotes are indeed the equivalents of Brackets in Lisp.

I went through a slightly more involved process in arriving at the above mapping, but this version of the story is a lot more fun.

Without further ado, here is the famous MSP power example in Lisp:

CL-USER> (defun mypower (x n)
           (if (eq n 0)
               `1
               `(* ,x ,(mypower x (- n 1)))))
MYPOWER


CL-USER> (mypower 10 3)
(* 10 (* 10 (* 10 1)))


CL-USER> (eval (mypower 10 3))
1000
CL-USER>


Yeah, we're missing the well-typed and well-formed guarantees, but Lisp's 'code-is-data' proves its worth once again. And we're not even using macros.

If we want to bring more structure to the staged expressions, we can express them as, say, closures. That's probably a topic for a future post.

I still have a lingering doubt whether we have accomplished truly multi-stage programming, seeing how trivial it has been to implement.

On a related note, what's common between the power and the logger functions? They are the only use cases that provide credibility to their respective patron saint programming paradigms, viz. MSP and aspect oriented programming. Just kidding.

***
With all the recent changes at the helm, can we expect less of full front-page real estate ads promising free gold coins?

Wednesday, October 16, 2013

October 16, 2013

Deccan Chronicle has an irritating daily feature called 'Word Spy' where they (on second thought, they're not smart enough to do this; it's probably syndicated) tweak regular words slightly, in a way nobody else would, and create supposedly charming and quirky new words that make you -- in theory -- smile and nod your head intelligently.

Example from a recent edition: 'Trialogue'. Before looking at the answer, let's try to figure it out ourselves: hmm, sounds like 'dialogue' which is a conversation between two people, so could this be a conversation among three people? Bingo! You win a free subscription to DC for a year! What? You don't have a to-be-potty-trained pet? Maybe you have a cat litter to fill up? OK then.

To see how easy it is to make up new (crappy) words from regular ones, here are three of my own inventions:
  1. Polisex: 1. Using sex as a weapon in politics 2. The dynamics of physical relations between people
  2. Furvasive: Condition of too much fur on a dog's back
  3. Introduckory: Evasive behaviour of someone who wants to avoid meeting new people.
I did say they're crappy words.They have to be, since I took about 1.2 seconds to make up each.
**** 
Kudos to John Michael Greer for being the first person from the native English-speaking world to use the word 'crores' in a normal way (at least to us Indians).

 

Wednesday, October 09, 2013

October 9, 2013

From the shedding-crocodile-tears department:
“What is the need to privatise the profitable Chennai airport? After investing over Rs. 2,000 crore to modernise the airport, why should a private party run the airport? After Delhi and Mumbai airports were privatised, passengers are being charged an exorbitant User Development Fee,” said L. George, regional secretary of the AAEU.
Yeah, they care for passengers that much. Why not be honest and admit that they fear a threat to their livelihoods because of the possible loss of jobs?

Monday, September 30, 2013

September 30, 2013

Ignoring for the moment the need for the RBI to get intimately involved in transactions between retailers and consumers, this is precisely what is wrong with our country:
Babu Jayaram and his family have been waiting to replace their nine-year-old television with an LCD TV. They have also set their sights on acquiring an SLR camera.
Their dream to own these high-value products by swiping their credit cards is, however, unlikely to be realised this Diwali with the Reserve Bank of India (RBI) coming down on banks offering zero per cent-interest consumer finance schemes.
“We were banking on such schemes. Though a processing fee was levied, it used to be adjusted against the second instalment. I ended up paying only the cost of the product. But with the ban on zero-interest schemes, it will be some time before we get access to such easy consumer finance,” he said.
The need for instant gratification, buy-now-pay-later, pledging future earnings to pay off usurious loan sharks masquerading as your friendly corporate banker/credit card company. It's not obvious how much of our economy is underpinned by easy credit. No wonder everybody's keeping their eyes peeled for the RBI's latest pronouncements about the repo and other policy rates -- if businesses (and consumers) relied only on money in the bank to buy stuff, our GDP would probably be lesser by 20%.

***
"Also, by 2100, all our brains will be in vats, with our needs being fulfilled by electric impulses fed to our neurons, while machines will harvest our brains' excess energy to power themselves in their continued domination of humankind". Oh wait, that was the plot for The Matrix.

Tuesday, August 13, 2013

Look Ma, no console!

pLisp is now officially a GUI app. The code still contains #ifdefs to revert to console mode if required, but the results are decent enough to persist with this change. I zeroed in on GTK+ after dithering over this decision for a long time, and, while doing GUI development in a C environment without any handy things like drag and drop, WYSIWYG layouts, and so on is a bit of a pain, I think I've got the hang of it now. Speaking of GTK+, it looks overwhelming at first, but it's manageable if you adopt an approach of just taking what you need and getting it to work (supplemented with liberal copy/paste of code strewn all over the internet).

Screenshots:




Yeah, I know: Transcript and Workspace? It's almost as if pLisp is a cover tribute to VisualWorks Smalltalk.

Thursday, July 04, 2013

Building a Lisp Interpreter from Scratch -- Part 12: Exception Handling and Object System

(This is Part 12 of a series of posts on pLisp)

This post is almost an afterthought, since I initially thought of winding up with Part 11. But then I got to working on exceptions and an object system, and decided to write about them as well.

Exception handling

Exception handling turned out to be extremely trivial to implement in pLisp, on account of its support for continutations. All we need to do when we invoke a function is to capture the current continuation and create a new continuation object that incorporates the exception code and, optionally, the 'finally' code. This continuation is invoked whenever an exception occurs (through a (throw ...) special form [Update: not exactly a special form, as it's implemented in the library]). The system maintains a stack of these exception handlers, to be unwound as the exception travels up the call stack.

The only support from the core system (i.e., that requires changes to the source code of pLisp as opposed to changes to the pLisp library) is to reset the global exception handler stack after each return to the top level.

Here's the full exception system code from pLisp.lisp (in image form to avoid code wrapping and other ugly things; one of these days I should figure out how to get those pretty boxes with scroll bars in Blogger for displaying code):


Object System

"Give a man functions and procedures, and he'll never have closure. 
Give a man closures, and he'll write his own object system"

(I was googling for Paul Graham's quote on closures and object oriented programming, but couldn't find it, so the above dodgy quote will have to do).

As the quote implies, a more-or-less fully functional object oriented system can be developed just with closures (and macros, of course; what will we do without them?). The meat of pLisp's object system (unfortunately named POS) is in two macros, DEFINE-CLASS and CREATE-INSTANCE, and a closure called CALL-METHOD. Though these macros look quite intimidating, they are conceptually quite simple; they create closures that store the class/instance variables and methods, and return a list of CONS pairs that map symbols to the class'/instance's methods.

Once a class or an instance has been created, we invoke methods on it by invoking CALL-METHOD.

When we define a class, we specify the following pieces of information:
  • The name of the class
  • The name of its superclass
  • List of instance variables with their initial values and getter/setter names
  • Ditto for class variables
  • Closures that perform initialization for the class and its instances
  • List of class methods
  • List of instance methods
An example:

(DEFINE-CLASS 
              ;name of the class
              SQUARE
              ;name of its superclass
              SHAPE
              ;list of class variables
              NIL
              ;list of instance variables
              ((A NIL GET-A SET-A))
              NIL ;class initialization code
              ;instance initialization
              (LAMBDA (VAR) (SET A VAR)) 
              ;class methods
              NIL
              ;instance methods
              ((AREA () (* A A))))  

;MAKE-INSTANCE is a convenience macro
(DEFINE A-SQUARE (MAKE-INSTANCE SQUARE))

;sets instance variable A to 10
(CALL-METHOD A-SQUARE 'SET-A 10)

;invokes the function AREA that returns (* A A), i.e. 100
(CALL-METHOD A-SQUARE 'AREA)

Inheritance, data encapsulation, information hiding -- all there in about 100 lines of pure library code (polymorphism via the dynamic typing already in place).

One current deficiency is the inability to refer directly to class variables from instance methods; the workaround is to invoke CALL-METHOD on the class with the relevant symbol/message.

Monday, June 17, 2013

Building a Lisp Interpreter from Scratch -- Part 11: This and that

(This is the final part of a series of posts on pLisp)

Well, it's time to wind up the series. It's been fun, spending time doing two of my favourite things (programming and writing; the only way this could have been topped is if I were to write about the coding involved in a Lisp-based first-player porn video game [just kidding]). I'll use this post to record stuff that doesn't really fit in any of the topics covered so far, and other random things.
  1. I have continued to work on the code since starting the series, and the posts are already somewhat out of sync with the code. One notable change is that WHILE is now a special form as opposed to a macro. There was nothing wrong with the macro (other than making your head hurt every time you looked at the definition), but since WHILE figures in the definitions of quite a few standard macros (DOLIST, DOTIMES, etc.), this makes sense from a performance perspective.

  2. I am in the process of adding a RETURN-FROM special form to handle non-local returns. This is pretty straightforward to implement using continuations, but things are still flaky -- it works fine for simple function calls, but barfs for functions that call macros internally.

  3. Performance-wise, pLisp has become slow as molasses. I probably need to do something about the implementation of arrays, and look at seriously optimizing the code, particularly memory management. Update: I replaced the custom binary search tree implementation with a red black tree, and the speedup has been phenomenal.

  4. The debug stacktrace at present, to put it politely, sucks big time. This is a direct consequence of moving to a compiler/VM architecture -- the execution trace at the VM level does not make sense for the application programmer; there needs to be a way to map (and display) source forms to the VM instructions, similar to how conventional debuggers manage things.

  5. The next major goal is the IDE -- something that approaches the power of a typical Smalltalk IDE with a system browser where we can browse all the symbols/packages, view/edit the code in a  pane, workspace and transcript windows to replace the command line top-level, a debugger UI, and so on. Man, I miss Smalltalk, especially after mucking around so much with Emacs, gcc and gdb.

  6. I realized that the NUATE instruction (used to invoke continuations) is not used at all, for the simple reason that the compiler never emits it. Just a simple matter of making the compiler inspect a symbol and see if it is bound to a continuation object (similar to how it handles macros now), will probably get around to implementing this soon.

  7. An object system is also in the works (not at the level of sophistication of CLOS or similar), but a functioning system nevertheless, with classes, inheritance, slots, and methods.