Thursday, June 30, 2005

Reading again...

Looks like I've found something interesting to read again...this time it's Ursula LeGuin's Earthsea Trilogy. I've just devoured the first two books - A Wizard of Earthsea and The Tombs of Atuan. Two more to go...If you happen to like fantasy, this comes highly recommended. LeGuin has a rather strange style, or so it seems to me. On the other hand it might just be typical of the fantasy genre - I haven't read much fantasy, so I wouldn't know. In any event, the story holds the attention superbly.

I always used to wonder why fantasy titles were grouped together with Science Fiction in bookstores - they seemed like opposites to me. I've since come to realize that the difference between SF and fantasy is like the difference between physics and mathematics - physics(the theoretical part) is essentially concerned with axiomatic systems that are isomorphic to the real world, whereas mathematics concerns itself with all possible axiomatic systems, irrespective of the realities they might correspond to...People interested in the weird interplay of physics and maths should look at this paper by the Nobel Laureate Eugene Wigner.

The odd thing is that I never used to appreciate fantasy a couple of years ago - why the sudden change? I wonder if this has something to do with my immersion into programming - after all, wizards weave spells and coders write classes - both of them manipulate what seems(to outsiders) to be a strange and mysterious universe...On the other hand, this might just be one of those specious analogies that you could make to relate any two things...

Also saw Batman Begins today, and the verdict is: this is definitely the best Batman movie ever made! Emphasised all the right aspects - the dark side of Batman, the way he uses the enemy's fear to his advantage, the elevation of Batman from man to symbol - brilliantly done. Katie Holmes' role is nicely downplayed - the other 'Bat babes'(Mr. Bond, forgive the paraphrase...) had too much screen time and played too central a part. Here the central character is always Batman/Bruce Wayne - the others are important, but not really central - as it should be. Add in the ninjutsu angle and the awesome Batmobile, and you've got a rocking movie. Hats off to Christopher Nolan for creating the first movie truly worthy of the Dark Knight. I hear a sequel is in the works - if it can live up to this movie, it'll be well worth the price of admission.

Wow, I'm starting to sound like a film critic...

TopCoder news: Pushed my rating up to 1100, coming in 3rd in my room. This time I heeded the lessons of the last few SRMs and didn't rush. It paid off - I still pulled off the fastest 250 and a fairly quick 500. Just have to keep this up now...

And now to dinner and The Farthest Shore.

Wednesday, June 29, 2005

Bugged by Shaping Regions

Some time ago I got through to section 2 of the USACO training gateway. For those not in the know, it's a pretty cool website where you can learn algorithmic programming. They basically give you a few problems to solve, and as you do them, you can go on ahead, learning more stuff along the way. Very nice way to do things...

Anyway, section 2 is basically graph theory, and I was expecting something to do with flood fill algorithms on the first problem - Shaping Regions. What I found instead was a really painful question involving stacking different coloured rectangles on a large rectangular white sheet. Each new rectangle covers something up, and what you have to do at the end of this is to figure out the visible colors and the associated areas.

My first thought on seeing this was - It's too easy! The most obvious technique is to have a matrix(read 2-D array) holding the colors of every unit square on the sheet. Initialize it to the sheet color to begin with, and overwrite the relevant sections with the color of each rectangle as it comes in. At the end of it, just iterate through the matrix and count the entries for each color.

I would have solved it right there - but with newfound wisdom, I looked at the constraints, and ruled out my solution - the sheet size can go up to 10000x10000...that adds up to a whopping 400 MB of memory! No chance there...

So I looked at their hint, and they said: only keep track of the rectangle bounds and chop up rectangles as new ones are added. Since there are only a maximum of 1000 rectangles - this sounded like a good idea. But how to chop up the rectangles? Figured that out yesterday - there's a neat way to do it by imagining that the new rectangle is completely inside the one you're intersecting with. Then just check all the newly formed rectangles and rule them out if they're not viable...Coding this is a little dirty, but I wanted to get it over with. Fate however, had other plans...

Ended up looking through the Java Collections framework for something useful to hold rectangles - started with an ArrayList and ran into a concurrent access exception. Briefly considered using some kind of Set, then gave up and used an array instead. Not as clean, but no concurrent access problems...

I submitted the solution - it barrelled through a couple of test cases. Then along came the killer - and my program produced some crap results...

So now we come to the central dilemma - how the hell do you debug something so damn ugly? I'm at sea...

Last night, after doing the Mumbai Mirror crossword, four words suddenly flashed through my mind - window to viewport transformation - straight out of Computer Graphics. And that gave me a way to use the original idea - why keep the whole sheet in memory? Instead, break it up into smaller sheets and only keep one in memory at a time. Apply the old algorithm in each case. Simplicity itself...

Coded it up last night and submitted - this one was much cleaner than the other one. It ran all the way through 10 test cases(and really fast too - 0.06 seconds was the slowest one), then failed on the 11th one - weirdly enough, it threw an ArrayIndexOutOfBoundsException at an index value of 1000...and there doesn't seem to be any way that my array indices can ever exceed 999...I fixed that up with a couple of half hearted Math.min()s...but the answer to 11 gets screwed up. To top it off, my IDE began doing weird stuff at the same time. At this point I gave up and decided to try my luck the next day.

Haven't really given it a try yet, though I did reinstall the IDE. Maybe I'll do the other 3 problems first - at least I'll learn some graph theory in the process...From what I've read on the net, I'm not the only one who hates Shaping Regions...

What really gets me is that I can't stop thinking about this damn thing - I have this way of spending an infinite amount of time trying to crack something interesting, but this is getting way out of line. It's not even difficult - but the bloody thing just doesn't work in one case!

Hopefully I'll get it to work...there's probably no way to get out of section 2 without finishing it...

The only other interesting piece of news is that my wisdom teeth are starting to give me trouble...one of them on the left side has begun to painfully lacerate the inside of my mouth.

Can't resist ripping off Confucius...here goes, with bad Chinese flavored English too:

Confucius say: If man know he grow wisdom teeth, he never bother to grow wise. This beginning of wisdom, and so he grow wisdom teeth anyway. When man realise this vicious circle, he become truly wise. But only when he have wisdom teeth removed do he become great sage.

Confusing? Try making sense of these Zen koans then...

Monday, June 27, 2005

Of Mindsport and other things...

A couple of weeks ago, one of my posts mentioned Mindsport, which for those who came in late, is a weekly puzzle column that turns up every Sunday in The Sunday Times. Anyway, the subject of my post was my sending in a ludicrously simple solution to one of the puzzles. Now every week the writer complains about people demanding that their solution be published, since they've sent in 3000 solutions already, etc...Apparently only a few make it to the actual column - not surprising, since it's so tiny.

Anyway, you can imagine my surprise when I began reading yesterday's Mindsport, and found a suspiciously familiar train of comments. Sure enough, there it was - my solution, along with my ranting that it was too easy, barely worth five minutes, etc...Wonderful - my first solution, and it gets published too!

For those who want the question, here it is:
Consider N chairs, numbered 1 to N, arranged in a circle. Two people, A and B, are initially in chair 1(don't ask me how...). At every stage, A moves 'a' chairs around the circle, and B moves 'b' chairs around the circle. How many moves before A and B end up in the same chair again?
It's fairly simple, took less than 5 minutes to work out...(Note to Sagar: This might be good practice for the CAT, provided you can work it out in less than a minute...Of course, they'll probably give you real numbers...)

Check out my solution in the Sunday Times if you don't get it...and if you don't get the Sunday times, drop me a line...

News Flash: Had my first bhutta(Corn on the cob, Indian style) for this rainy season...Yum!

Next up: solve the recurrence Qn = (1 + Qn-1)/Qn-2, where Q0 = α and Q1 = β...Interesting, it repeats in cycles of 5...

For those greedy for more intellectual stimulation, here's a little variation on the Towers of Hanoi problem that I was working on yesterday: Move n disks from the left pole(A) to the right pole(B), but without direct moves between A and B. All moves must be to or from the middle pole(C). The layout is obviously A C B. As usual, larger disks cannot be placed on top of smaller ones.

Final verdict: Recurrences rock!

Saturday, June 25, 2005

Follow the white rabbit...

Just finished reading Nick Bostrom's thought provoking paper - Are you living in a computer simulation? He makes a terrifying case for the possibility that we might be simulations in a computer run by our posthuman descendants. I didn't really take this possibility seriously until now, but his arguments are quite compelling.

Basically, he claims that at least one of the following is true:
  1. A very small fraction of all human level civilizations eventually reach posthuman levels.
  2. A very small fraction of all posthuman civilizations are interested in running ancestor-simulations.
  3. The fraction of all people(real or simulated) with our kind of experiences, that are living in a simulation, is very close to one.
Excuse the mathematical style, but the argument hinges on a nice little equation, which produces these three possibilities. Basically, the gist of the idea is that a super advanced future civilization(the posthumans just mentioned) will have a mind boggling amount of computing power available to them. If they do decide to run ancestor sims, then chances are that there will be a much greater number of simulated ancestors than real ancestors. Thus it is overwhelmingly likely that we are living in a simulation rather than the *real* world...If this isn't the case, then chances are that very few posthuman level civilizations really develop, in which case we either die out, or fall back to primitive levels. Finally, it may be possible that posthumans simply don't want to run ancestor simulations. We can't say why this is so - trying to understand their intentions is comparable to an ant trying to figure out ours...Frankly, it's hard enough today to figure out the intentions of our elected representatives, let alone future humans with expanded minds...

Now here's a really interesting concept which most readers who survived the last paragraph should have seen coming - how do you know that the chaps simulating you are not simulations themselves? Their level of *reality* may just be another simulation run by an even more advanced civilization...and so on. Russian babushka dolls, anyone?

BTW, a really interesting take on this is David Brin's short story Stones of Significance. I highly recommend it.

Time to get back to Halo...

Friday, June 24, 2005

Down came the rain and washed the spider out...

As I mentioned some time ago, the monsoons have finally begun in earnest. In fact, for the last two days or so, it's been raining almost nonstop. This bugs the hell out of my sister, who has to go to college and coaching classes. Meanwhile, I can relax like the lazy bum that I am and spend all my time indoors...and watch the steadily growing puddle(about the size of a small pond) in front of the park outside. Thankfully the other half of the road is clear, so people can move around without trouble.

Yesterday a rather weird thing happened to my monitor - I turned it on and things were weirdly out of focus. Following the time tested First Law of Computer Fixes, I turned off the machine, jiggled the appropriate cables, and turned it on again. Presto - instant fix.

The same thing happened again today, and this time I fixed it with two restarts. Provisional theory: excess moisture content in the air is causing dew formation on the electron guns. The heat from turning it on is enough to fix it... Solution: stick silica bags around the monitor. Anyone else who has had this problem, drop me a line...

And now, on to cryptography and recurrence relations...

Thursday, June 23, 2005

Me and my big mouth...

As promised, here's the lowdown on the TCS experience. It's just a short bit, as my posts go, but it should showcase my monumental foolishness wonderfully...

The entire recruitment process was divided into three sections: an aptitude test, a technical interview, and an HR interview. Most of my friends correctly predicted that the first two would be no trouble for me at all. Most of them also said something similar about the HR interview - and that's where the real interesting stuff happened.

Some background - at the time the HR interview took place, those who flunked the tech interview had already gone off home, and the rest of us were sitting and getting bored, waiting for the HR to start.

I got lucky - I was the second person sent in. There was a panel of two people, and they did the usual HR sort of stuff - questions that are obviously meant to see how well you'll fit into the company, work with a team, etc, etc...

Then the bombshell - "Any plans for further studies?"

Me: At some point in the future, perhaps. I'm thinking of picking up some experience first.
(Not strictly true, but not strictly false either...)

Them: Have you given the GRE?

Me: Yes. (Foot on an intercept course with mouth...)

Them: How much?

Me: (Foot enters mouth...) 1600.

Now unlike the tech guys, these chaps knew the significance of this kind of GRE score - plus the shock value of a perfect score is enough to grab anyone's attention. Consequently, the two chaps, who had showed no emotion whatsoever, suddenly seemed to become slightly more animated...

Then they began the usual thing - "So you'll definitely be going abroad then? After all, with this kind of score..." and I'm struggling to dance around the subject, equivocating like a politician.

They actually stayed on this subject for a few minutes. That should have tipped me off. No HR guy wants to get his company to spend money on a chap who is almost sure to be gone within the next 4 or 5 years at most - never mind attrition rates. My dad says this has something to do with not looking like a dumbass in front of your boss...

Should be obvious what happens now - at the end of the day, when they finally announced the people they'd picked up - I wasn't one of them. I had a sneaking feeling about this - one of the Electronics guys was talking to someone about how they'd grilled him about his sister being in the US. Stuff like "You can always go there now...what prevents you from going there to study..." and so on. If that was what they were thinking, no wonder I got eliminated. I suspect that a significant fraction of the people selected don't actually accept - under these circumstances it makes sense to eliminate anyone who has a good reason to reject their offer...

Looks like I'll have to learn to keep my big mouth shut, or rather, to lie with a straight face - I never brought up the topic - they asked me. If this is a common campus placement question, then the truth is one thing I can't tell them...

Impaled upon the sword of my own achievement - who ever said honesty was the best policy?

Moving on to more interesting topics - looks like I'm finally coming out of my TC rating slump. I passed over the 500 in favor of the 1000 this time(500 had a closed form combinatoric solution, which hit me in a flash of inspiration - about ten minutes after the match ended.), but for some odd reason, I couldn't get the 1000 pointer to work. The solution was perfect - but it just kept doing weird things. A little debugging showed that certain sections were seemingly not getting executed, but for the life of me I couldn't understand where the problem was...

I've actually had this kind of problem a couple of times before - something is obviously screwy, but you can't figure out what. The only solution I've found that works is to code it all over again. Never mind if it's identical - the second time it always works, and the first time it doesn't...

No points for guessing what happened when I rewrote the solution...

The interesting thing is that I finally made my first challenge - I've never challenged anyone's code before(25 point penalty if your challenge fails). This time I saw a solution that just had to be wrong, and pocketed 50 points.

Next SRM is more than a week away...better do some training until then...

Sunday, June 19, 2005

The best laid plans of mice and men...

So there I was in the TC Arena, ready to attack the problems they threw at me, and tear them limb from limb. With my newfound ability, I was ready to destroy the opposition, jump to division 1, and maybe make the leader board...I was gonna kick ass.

Did it happen? Not on your life.

Instead, I came out of this SRM with my lowest score ever, and dropped to my lowest rating yet. To add insult to injury, it wasn't because I was unable to solve all the problems - I actually did all 3, including the 1000 pointer. Carelessness and stupidity killed the medium and the hard in systests, and sent me spiralling into the void...

The truly unforgivable mistake I made was the 500 pointer - under other circumstances I would have cracked it instantly. Instead of seeing the obvious solution, I came up with an ugly approach that eventually failed systests...Even worse was that it managed all three examples from the problem statement. What should have tipped me off was the inordinate complexity of the solution - no div 2 medium could be that weird. If I'd been a little less impatient, I'd probably have seen the obvious attack and been the first to submit a solution. Since I already had the first submission for the 250 pointer, I could have comfortably finished somewhere at the top, even if I didn't get the 1000.

The 1000 was really sad - the solution was correct in every detail. It just so happens that it took into account one extra item of input, and so returned 0 where it should have returned -1...I'm still surprised by the cavalier way in which I read the problem statement - unforgivable!

NOTE: I was gonna write a lot of stuff here, but I accidentally navigated away from the page and lost my post. No longer in the mood to rewrite everything, so the gist follows...

Here's a quote from Jonathan Livingston Seagull that perfectly sums up the lessons of SRM 247:
The gulls who scorn perfection for the sake of travel go nowhere, slowly. Those who put aside travel for the sake of perfection go anywhere, instantly.
It's about seagulls, but the symbolism should be obvious...

And here are a couple of guidelines I've come up with to improve my approach:
  1. Never get caught up in the sheer excitement of your power, newfound though it may be. If you do, your delusions of grandeur will remain just that - delusions.
  2. Forget details like timing, ratings and rankings. Focus on the problems - if you master those, all else will follow.
  3. The point value is usually a pretty good guide to the difficulty level of a problem. If your solution seems overly complex by that measure, then it may be worth exploring alternative approaches.
  4. Read the problem statement - pay specific attention to constraints and details - your solution may break if you miss something.
  5. Forget about your speed of coding relative to other coders - just code. (This is properly a part of (2), but it's worth mentioning as a separate point.)
  6. All this is easier said than done. Internalize it - reduce it to instinct.
Let's hope this works out - I'm getting rather tired of being a humble green coder...

*The writer suddenly experiences a moment of transcendental enlightenment.*

Hey, all this writing has suddenly made the true problem clear - in fact, it's summed up wonderfull by Morpheus in The Matrix when he tells Neo:
There's a difference between knowing the path, and walking the path.
For those who haven't understood this - you're either extremely dense, or I'm not a very clear writer. Either of these is possible, but I lean towards the former...

I have a feeling blogging has actually improved my coding and problem solving ability - presumably because it helps identify problem areas. And of course, writing stuff down cements your understanding of it.

Okay, time for other news - I have TCS placements tomorrow. Unfortunately, this means we have to go over to RAIT in Nerul, and rather early in the morning. Huge pain, but no choice...

There's been an ugly side to this recruitment thingy - the form they've put up on the website for campus recruitment registrations - it's a sort of resume - it's a marvel of bad design. Rather surprising, considering the size and quality that TCS is known for. It has serious compatibility issues with Firefox - you can't see the cursor - stuff is rendered in grey...not exactly a good intro with all the techies using Firefox these days. When I finally got around to opening it in IE(yecch!), it turned out to be weirdly set up - all sorts of useless details were mandatory for submission, and there were unexpected maximum size restrictions on some fields as well. I suppose 'campus recruitment' is a fairly wide ranging thing, involving people who haven't yet graduated, those who are just out of college, and postgrads as well - so you can chalk up the useless details to that aspect. Still, if anyone from TCS happens by, please tell the guys in charge of the website to fix it...technical incompetence from such a reputed company is a real turnoff.

I suppose that's it for now. Will blog about the TCS experience tomorrow or day after...

Saturday, June 18, 2005

The monsoons make an entrance...

Looks like the rainy season has finally begun in earnest, announcing its presence(to me, at any rate) with a thunderclap so loud that it seemed to come from right outside my window...The rain started a few minutes later, and for the first couple of minutes, the word 'torrential' would have been an understatement...

Mumbaikars have a weird love-hate relationship with the monsoons - on one hand, they welcome them as salvation from the inhuman humidity of May, and on the other, they curse them when the streets begin flooding up and staying dry becomes a virtual impossibility. And yet, year after year, I see dozens of people in college fleeing without any kind of protection. I neatly avoid this problem by tossing my umbrella in my bag at the first sign of rain, and keep it there until the monsoons are long gone. The last part isn't really caution, just laziness...

On the algorithms front, the TC arena is working again, and I did manage to solve the 1000 pointer in the practice room. Once again I was a little astonished by the ease with which I did it. It was a simple brute force attack which involved generating subsets of the input, but the way the solution just seemed to develop itself was unbelievable. This might have something to do with the fact that I've really got the hang of recursion now. After I solved it, I was going through the match editorial to see their solutions, and I saw the magic word 'bitmasks'.

For seasoned algorithms people, this doesn't hold any mystery, but this doesn't apply to me. I've been seeing this word on and off for a while in the match editorials, but I never really knew what it was. Most statements I've seen were of the form, "$CoderName wrote a nice solution using bitmasks." Back then I never had much time to follow them, and somehow I came to the conclusion that a bitmask was an array of booleans...not sure how that happened...

Anyway, I finally found out that a bitmask was a single number whose bits you wanted to piddle around with. Since I'm rather fascinated by the way binary numbers fit into all sorts of mathematical applications, I had to take a look. Turns out there's a nice iterative way to generate subsets by simply incrementing an integer and looking at its bits. I'm surprised I hadn't thought of that, since I've always noted the neat way in which binary numbers count up...In fact, the solution is far cleaner in this case. Generating subsets involves choosing whether to include an element or not, so you have to divide and conquer - include in one recursive call, exclude in another. With bitmasks, all that is handled implicitly by incrementing the counter. The 1's and 0's manage this perfectly.

This abstraction seems a little superior to the recursive one - though the recursive one shows you the choice explicitly(which you might want - though I don't see why), the bitmask implementation handles all that without you having to bother - which in the end is what an abstraction is all about - hiding the fancy details. Plus you don't have the overhead of recursive calls, which doesn't hurt either...

Now to sit back, eat, enjoy the cool weather, and learn flood fill algorithms...

Friday, June 17, 2005

Life goes on...

It's been a couple of days since I last posted - fairly eventful days actually...finally got down to doing some USACO algorithms training now that the vacations are on. Just finished off section 1, and the good news is that I've improved spectacularly. I've been musing on what caused the sudden improvement, aside from high spirits due to sudden influx of freedom into my system...

It's so much better than intuitive hacking, where all you really do is think about the problem until you get ideas, which you then have to think about implementing...Algorithmic programming expands your perspective hugely. Earlier I would have thought something like, "This looks just like that one I did earlier..." Now I think, "Hey, depth first search with memoization!"

What amazes me the most is the way a few simple abstractions clean up things - naturally, you expect them to simplify stuff - that's what they're there for - but you don't realize the true extent of it until after you've internalized the concept and put it to use in a problem solving situation. Unbelievable...

Just tested out my improved skills in the TC practice room(SRM 153, div 2 in case anyone's interested). Finished off the first two probs with no difficulty at all. Was about to start on the 1000 pointer - the real challenge - but something went screwy with my connection, and now I can't get into the applet long enough to see the problem statement...Just my luck. Ah well, I'll give it a whirl before tomorrow's match...I'm planning on solving all three this time - but let's face it - my new skills are limited to a few new abstractions related to search problems - I haven't had time to do much graph theory, and haven't reached dynamic programming yet. My rudimentary skills with those two might be my downfall in the third problem...and let's not even start about computational geometry...

Looks like Kill Bill 2 is on tonight...missed it during the exams, so looks like it's katana time! Might catch Fist of Fury too, just to pass the time.

Tuesday, June 14, 2005

Fabulously rich...NOT!

As my last post might have mentioned, I had a little meeting today with my GRE prof. Turns out he was making good on the promise he'd made during all his seminars - the first of his students to get a perfect GRE score wins an all expenses paid trip to Goa! Since yours truly managed to get lucky(damn I'm good!), the Goa trip was mine!

By now, anyone who knows me is thinking, "Nadeem in Goa? Have unicorns been spotted walking the streets of New York?"

Let's face it - I'm one of those people for whom Goa doesn't hold any real attraction. My idea of a fun place is probably the Googleplex...anyway, since this was the case, I ended up with a check for Rs. 12000...Whoopee!

OK, cancel that. The truth is, I'm not gonna be using that money for anything fun...It's all gonna go towards registering for the CompSci GRE and the TOEFL, so my poor pals aren't gonna receive a treat(though they've been begging for it like hungry dogs...).

The other interesting thing is the formation of a little study group for the CS GRE...my prof has decided to form a little group of 10-12 students, who'll learn all this stuff together and teach each other. Guess who's in on the fun...For more details, you might want to see http://www.kiceducation.com. And the fact that there's a bad photo of me plastered on the front page has absolutely nothing to do with this...

Other than that, today was rather eventful - I did a couple of interesting coding problems and kicked up my algorithmic skills a notch. Still stuck on one - surprisingly, it's not the algorithm that's giving me trouble, but the implementation...coding up all the fancy abstract actions with which I conceived the solution is a doozy. That's rather odd, since it's a greedy algorithm, and those are usually pretty simple to code...

Still, I'm looking forward to the next TC match on Saturday. All the stuff I've done should stand me in good stead. By then I should have got a lot more practice in, too. Maybe now I'll be able to get out of division 2 permanently...

Back to discrete mathematics - counting was never so much fun!

PS: BOFH has been updated! And all this time I never noticed...shame.

Monday, June 13, 2005

Back again...

Got back from our weekend trip to Pune a few hours ago. Pretty ok, as trips go - especially since we took one of the airconditioned Volvo buses back and forth. Did some interesting reading en route - and actually solved a couple of TopCoder problems from the last SRM(which I sadly missed).

Unlike some places I've been(like Lucknow - blech!), Pune has a lot of stuff to read - my uncle has a Ph.D in Geography, so National Geographic is all over the place, plus other stuff. I lugged over three books to be on the safe side, but thankfully there was no trouble on that front.

The real trouble was the lack of computing support - halfway through the stay I had already begun to experience acute withdrawal symptoms...

Also got a call from my GRE class - have to go over tomorrow for something to do with CompSci GRE that I plan to give. Looked that up a while ago - except for software engineering stuff, all the stuff covered is related to what we've already done in college. Nothing surprising there - the design of our syllabus is perfect - it's the implementation that fails miserably...Anyway, the test is multiple choice, so no need to sit and cram - I've made a point of absorbing most of that sort of stuff anyway - it's the useless details that kill me...

I suspect the real challenge for MU students will come in the mathematical background that they expect us to have - our computer engineering and IT courses don't emphasise it to any great extent - and the maths that we were taught was almost completely unrelated to computing. Thankfully I've already begun a program of increasing my skill in algorithms, discrete mathematics, problem solving, data structures, and so forth...

So here's my itinerary for the vacations:
  • Go through all the stuff we've learnt over the past 2 years(First year was a complete waste) and absorb the stuff that really matters.
  • Pay special attention to the mathematical aspects. This should be no trouble - TopCoder will take care of algorithms, data structures, complexity, and discrete mathematics.
  • Start hacking Greasemonkey.
  • Do some more Python - in particular, learn some of the libraries so I can do advanced stuff.
  • Read like blazes.
  • Do puzzles and problems, and actually generate new problems if possible - this skill comes in real handy, and cements understanding.
  • Last but not least - watch Revenge of the Sith, Batman Begins, Kung Fu Hustle, and so on...
All this business about generating problems reminds me of a certain thing from Dune. For those unfortunates who haven't read this magnificent saga, here's a little background. The thing I'm talking about involves Mentats - human beings with minds trained to the greatest extreme so they can function as computers. Back story - all thinking machines were outlawed after humans defeated a bunch of AIs that had enslaved them for generations. Since people still felt the need for computational help, the order of Mentat was formed...All this is set in a general atmosphere of humans forsaking a lot of technological help and developing their own capabilities...

Anyway, the thing I'm talking about has to do with a certain attitude that Mentats adopt. This quote from Chapterhouse: Dune should be a good introduction:
Mentats accumulated questions the way others accumulated answers. Questions created their own patterns and systems. This produced the most important shapes. You looked at your universe through self-created patterns -- all composed of images, words, and labels(everything temporary), all mingled in sensory impulses that reflected off your internal constructs the way light bounced from bright surfaces.
Notice the bit about accumulating questions. I think it's true that most of us go through life gathering answers - not many of us consider shifting focus to the questions instead. Indeed, such a shift might really shake up one's mental moorings. Everything would take on a temporary flavour - every fact would be reduced to the status of 'the current answer' and few absolutes would remain. Dune actually cautions against absolutes - adherence to too many absolutes can cause terrible problems in the long run...

Here's a little bit more on Mentats from the same book - the person mentioned in it is Duncan Idaho, who received Mentat training in several incarnations, and gained access to his old memories and training in the last book:
A Mentat's real skills lay in that mental construct they called "the great synthesis." It required a patience that non-Mentats did not even imagine possible. Mentat schools defined it as perseverance. You were a primitive tracker, able to read minuscule signs, tiny disturbances in the environment, and follow where these led. At the same time, you remained open to broad motions all around and within. This produced naivete, the basic Mentat posture, akin to that of Truthsayers but far more sweeping.

"You are open to whatever the universe may do," his first instructor had said. "Your mind is not a computer; it is a response-tool keyed to whatever your senses display."
The fleeting, ephemeral nature of a Mentat's world view is captured here:
Doing this, you never thought of yourself as clever, that you had the formula to provide the solution. You remained as responsive to new questions as you did to new patterns. Testing, re-testing, shaping and re-shaping. A constant process, never stopping, never satisfied. It was your own private pavane, similar to that of other Mentats but it carried always your own unique posture and steps.

"You are never truly a Mentat. That is why we call it 'The Endless Goal.' "

And in conclusion, one of my favourite parts:

A Mentat came at his universe fresh in each instant. Nothing old, nothing new, nothing set in ancient adhesives, nothing truly known. You were the net and you existed only to examine the catch.

I'm thinking about twisting my consciousness into this mold. Wonder if it's humanly possible...The image of an annoyingly precocious kid asking "Why?" at every opportunity comes to mind - only now, the kid is in your own head, and the questions aren't as limited.

The kid metaphor actually has another important characteristic - the famous Mentat naivete. That is the real challenge - throwing away preconceptions and older knowledge, and developing a sense of idealism that we lose all too easily today...As the Mentats learn, it isn't old age that prevents learning, but an accumulation of "things I know."

Socrates would have loved this...

That's about it for this post. Confusion to your enemies...

PS: The 'the' experiment - see previous post - turned out as expected. The posting was named blog-post.html.

Friday, June 10, 2005


This says it far better than I ever could... Posted by Hello

the

If you happen to be one of those hawk-eyed readers they talk about, then you'll have noticed the rather interesting title of this post. Before you give in to the impulse to instantly scroll down and post a dozen comments on this subject, you might wanna read the explanation below...

Some time back, an interesting chain of events transpired, with the result that I began to notice the filenames that Blogger gives my posts. For example the URL of the post that brought this to my notice is http://abstractwhiz.blogspot.com/2005/06/i-can-see-finish-line.html. For nontech readers, the thing I'm talking about is the bit after the last slash. Apparently they took the title of my post, cut it down to lower case, stuck '-' characters between the words, and(this is the most important thing) removed the word 'the'. A little study of the previous posts showed that this is normal policy.

It should be obvious where I'm going by now...If all 'the's are removed, what happens when the title is a big fat 'the' itself? I don't have any idea now, but I should know once I publish this post.

Since we're on the subject of definite articles, I have to mention an interesting phenomenon. For some reason, Indians have a huge amount of trouble with 'a's and 'the's - the latter is especially misused left and right. I once had a prof who could not string a sentence together without using 'the' at least 3 times. At least two of them would be wrongly used, and that was on a good day...There are rumours that he once used over a thousand in just half an hour. Example: "Why for you are the late? Is this the time to make the entry in the class? You will find the great difficulty in the exam..."

We waited for an entire year to hear him say "Get the out." Sadly it never came. Sigh....

The other extreme is represented by a guy who taught me Marathi back in school. At one point he was explaining some sort of passage in which some guy picks up a grain of rice. His translation: "He picked up a rice." WTF?!!!

Then there was the other guy who taught me maths and never pluralized anything. When he wanted a bunch of people to stand up, he would say "Stand up boy." In fact, his entry into the class went something like this....

Him: "Stand up boy."
(We stand up)

Him: "Say good morning boy."
(We resist the temptation to say "Good morning boy" and manage a weak "Good morning sir")

Him: "Sit down boy."
(We sit down and start hunting under our desks for pens that have *accidentally* been dropped. An observer with good ears might have noticed the faintest sound of stifled snickering from beneath the desk. Why this observer would be in a seventh standard maths class, I cannot say.)

There was an interesting incident when he caught some guys chatting nineteen to the dozen while he was trying to teach us congruence of triangles. This is what happened:

Him: "You boy, get out."
(One of the culprits sheepishly slinks out. He seems almost happy...)

Him: (to another of the offenders) "Why are you still here? I told you to get out."

Offender: "Sir? I thought you were talking to him."

Him: (roaring with rage) "I was talking to both of you! And that fellow behind you - both of you boy, get out!"

(The proceedings are interrupted by someone who can no longer take this and gives a devastatingly loud SNORT! Thankfully he manages to convert his guffaws into hacking coughs just in time to avoid detection...)

Of course, once you could translate his *singular* argot, he wasn't a bad teacher after all...

This isn't entirely restricted to non English speakers. My 10th standard geography teacher, who certainly never spoke a word of anything but English, once said "Please may I have the this?"

And to top it off, I myself am not immune to the odd attack of linguistic ineptitude...

Ah well, off I go to mess around with union-find algorithms...

Current browser name: Mozilla Seaturkey.

Tuesday, June 07, 2005

I can see the finish line!

Just one more exam left, and I'll be a free man once again! Free to waste my time, sleep at odd hours, hack all day, watch a bunch of movies, read some more books...the list goes on.

Thursday evening is when I'll finally be able to start doing all these things - once Computer Graphics is over. I suspect Thite and Sagar will probably produce a blog post each(at least if Thite's exams end tomorrow too....). Looks like I'm the only one who blogged during the exams (and produced my biggest post yet!).

Before I forget again, this is for my uncle in New Zealand - Happy Birthday! Forgot to put this in earlier, but since he's one of the most avid readers of my blog (he says it's his homepage at work!), I had to do something...Family record: First person in the family to get wished on a blog! Of course that makes me the first person in the family to wish someone on a blog...What the heck, it sure beats searching for ecards online...

Seriously, whatever happened to the times when free ecards were all over the place? Nowadays, you surf over to any of the *free* sites and all you get are a bunch of substandard cards. The good places which used to be free (BlueMountain!) are all paid sites now. This sucks...

Just noticed a tiny moth sitting on the wall of my room. Can't resist painting a picture of my sister's reaction...

Me: "Check out that moth on the wall...."

Sis: "EEEEEEEEEK!" (flees in terror...)

(Reappears ten minutes later at the door peering around anxiously)
Sis: "Is it gone yet?"

Me: "Nope, but it's not even a moth, just a butterfly without the usual Nerolac color scheme...Oh look, it's on the curtain right next to you!"

Sis: "EEEEEEEEEK!" (flees once again)

The day usually ends with her demanding that I kill it, or catch it and throw it out or something...

Incidentally, what is the difference between a butterfly and a moth anyway? Anyone in the know, drop me a line...I'm feeling too lazy to search around...

Time to chow down. Expected time of next post: Thursday evening.

Current browser name: Mozilla Powerape!

Monday, June 06, 2005

Home stretch

Looks like my ordeal is almost over. Two more exams to go, and the first of those is only about14 hours away. Then it's one last day of studying, followed by the last exam, and then - freedom!

To my complete lack of surprise, I find my mind brimming over with ideas on stuff to do in the vacations - and for once, they're all unbelievably geeky, involving lots of coding, mathematics and puzzle solving...Looks like my True Self(see Heretics of Dune - Miles Teg's training on Chapterhouse) is awakening. Long overdue, but since most major evolutionary jumps in my life seem to come a year or two after those of my contemporaries, that's about par...

Naturally I have to try and control myself - don't want to mess up these last exams just because they're so close to the end. I already have a feeling that I haven't really done enough for OOAD, but thankfully our teacher grilled us on that quite well. At least some of our teachers are really competent...

Better buzz off to bed now - plan to get up early and do some studying. The weirdest part is that you can actually bone up on the entire theory section pretty fast. All you have to do is learn to see past the repetitions. So if I wake up at around 8, I should be able to bone up on the remaining fancy theory, cast a practiced eye over the diagrams, turn on my MeaninglessParagraphGeneratorTM, activate the NearlyEndlessRepetitionTM module, and we should be all set.

Off to rest the mental circuitry - next post probably due tomorrow night...Stay tuned.

Friday, June 03, 2005

Halfway through...

This just in - the exams are officially half done. Three more and freedom will be mine! In fact, I'm only really concerned about the next one (Operating Systems) - the remaining two aren't exceptionally large or difficult to remember.

I was considering ranting a bit about our OS syllabus, but on second thought - forget it. Suffice it to say that we, who should properly have been trained on BACI and Nachos, are reduced to memorizing useless facts about modern operating systems in the guise of so called "case studies."

Back to more(or less) mundane things. Interestingly, I've actually read two books during the exams - Eragon by Christopher Paolini and Trickster's Choice by Tamora Pierce. Brilliant pieces of work, both of them. I'm rather looking forward to reading the sequel, since both are parts of trilogies - the Inheritance trilogy for the first, and Daughter of the Lioness for the second. Looks like my taste in reading now incorporates fantasy as well. Not that that's odd for a hard core SF fan - the two go together quite well - that's why it's often called SF&F.

I remember someone once asking me why I read so much SF when they were so many other good books around. I don't recall having much of an answer back then, aside from "It's interesting!" A couple of days ago, I remembered this incident, and then a little thing I'd read in an interview of Marvin Minsky.

The interviewer asked Minsky what kind of books he read, and his response was "Aside from technical literature, only science fiction." When pressed a bit, Minsky remarked that all other types of literature were horribly cliched - they've all been done thousands of times over. It really isn't worth reading anything except SF, simply because it's the only truly original genre of literature around.

This idea wandered around in my exam addled mind for a while, and eventually connected with another one(yes - my mind really does work this way - and so does yours...maybe), which at first sight seems rather antithetical to it. It came from a small article I'd read about Frank Herbert - the guy who wrote Dune. His greatest insight - and the reason he revolutionized SF forever - was to realize that SF wasn't the newest of literary genres, but the oldest. It's just a modern repackaging of the oldest type of story around - the fantastic tale. Remember all those old myths about gods and heroes and dragons, with wizards and witches tossed into the mix? Guess what - it's SF! The Ramayana and Mahabharata - SF! Homer's Iliad and Odyssey - SF!

So that's why SF appeals to people - because it stirs ancient memories of tribes gathered around the campfire, listening to the storyteller. Dune fans - doesn't this sound oddly familiar?

Looks like it's time to get back to work now. Loads to do, and miles to go before I sleep...

PS: Current browser name - Mozilla Seajaguar.

Wednesday, June 01, 2005

A brief respite...

This little post is meant as a bit of a break for me. Systems Programming is as devastating as always, and having to cram it into one's head in a single day is not a feat to be taken lightly. Anyway, the story so far: exams are on in full swing - 2 down, 4 to go. The exams themselves aren't that bad - it's the mind numbing drudgery of studying for them that gets you. After that, it's all autopilot really. Over 10 years of doing memory intensive exams like these does that to you. Probably a subconscious defense mechanism designed to protect more important areas of the brain...

And now the part we all love, Firefox extensions! Whoopee...
Epsum factorial non deposit quid pro quo hic escorol. Olypian quarrels et gorilla congolium sic ad nauseum. Souvlaki ignitus carborundum e pluribus unum. Defacto lingo est igpay atinlay.
Before you start trying to translate that, a word of advice - it's just gibberish. Part of this cute little Firefox extension called the Lorem Ipsum Generator. Not exactly useful, but then computers were made for goofing off anyway...

In the same spirit, another interesting extension is the hilarious Firesomething . This little piece of work generates a new browser name every time you open a new window. Which is why I'm currently typing this in Mozilla Hypnosalmon...

People with an overdeveloped aesthetic sense, Nuke Anything is just for you. With this little baby you can remove annoying objects from pages - kill ads, revolting graphics, or just manifestations of really ugly design...In case you get the wrong idea, this doesn't *really* change the page, just your view of it. So don't yell to everyone, "I deleted the Google logo! Come and see!" Sorry chaps, you'll need to learn how to hack for that...

If you're anything like me, then you have music playing while you're surfing, coding, studying or just messing around. FoxyTunes gives you the power to control your favourite player through Firefox, via this little toolbar that appears in the status bar at the bottom of the screen. Of course, the toolbar is only for novices - the true geek will only use keyboard shortcuts!

Note to those who're falling over each other to download it: You might want to reconfigure the default shortcuts - some of them interfere with the kind of keyboard work you do while typing into text areas(like when you blog).
(PS: If you aren't the kind of person who can select multiple lines of text using the keyboard, this preceding warning does not apply to you.)

Time for me to get back to studying. Feeling nice and refreshed now...Macro processors, here I come!

BTW, I recommend Yanni's Flight of Fantasy and Swept Away while studying. No words to distract you, and a superbly measured dash of optimistic elements to keep your spirits up. Hats off to the master...