Saturday, September 19, 2009

Migration

Well, I'm moving this blog to http://ameypar.co.cc. I haven't posted anything in a while, so I doubt that anyone will care, but just thought I'd leave a non-NULL pointer...

Wednesday, May 13, 2009

The Sieve of Eratosthenes

Sift the Twos and sift the Threes,
The Sieve of Eratosthenes.
When the multiples sublime,
The numbers that remain are Prime.

Monday, May 4, 2009

Atom

Blog authors usually put a lot of effort into the look of their blogs. And then their readers, ungrateful ingrates that they are, go ahead and just use a feed reader to scrape posts off the blog, thereby making the author's efforts an exercise in futility.

Ok, nevermind that. My point here is that Atom and RSS have really changed the world we use the web. Instead of periodically visiting hundreds of sites regularly, we just import their feeds into our favourite feed-reader, and sit back and enjoy the periodic updates, never understanding the true marvels that feeds are.

For me, till five minutes back, a feed was just this magical thing that pulled new stuff from my favourite site(s) and showed it to me at one central location. I had only a vague idea as to how feeds work, and as long as they worked as intended, I didn't really care how they managed to do what they do.

That is, until I set about creating my own Atom feed.

Our college compres are going on right now, and, as usually happens during a series of tests, I felt the urge to try out something cool and new. So I went over to Google sites, and spent the past three hours making my own site. And then I discovered that I can create a mini-blog there, and post updates and stuff. So I created a page that would allow me to post updates on my progress on my GSoC project, and I looked for the familiar radio symbol that appears in the right corner of Firefox's URL bar to indicate that the current page has a feed, and found that none existed.

So... I set about creating my own.

I always thought that feeds work by some internal logic by which they automatically update themselves whenever the page that they are monitoring changes (yes, I know that sounds ridiculous, live with it). As it turns out, however, feeds are simply XML files that the feed reader parses and extracts data from. So, everytime something new is added to the site, the feed has to be manually (as in manually, not by hand. A script can be written to take care of this) updated to reflect the changes.

And, thanks to a very helpful guide found here, I have created my first Atom feed!

(I picked Atom over RSS because RSS is old, and Atom is supposedly newer, better and shinier)

Next, I'll write a simple Python script that'll scrape my website and update my local feed xml file, which I will then have to manually (yes, by hand here) upload to the site.

Now, however, it's time to study a bit more of OR and then sleep..

Monday, April 27, 2009

Greener grass

I really want to write a long post about this, but sometime this semester I became a quickfix-junkie, and seem to have lost whatever patience I had for long things: long conversations, long walks, long posts.. So I'll just say what I want to say and keep it short.

By and large, most of the students here at BITS complain about how most of the professors suck, about how courses are not handled properly, about how the exams are more focussed on learning formulae and solving problems than about actually testing what the student knows. Needless to say, most of these complainers are people in the 6-8 CG range, but what they say is right for the most part.

I downloaded a couple of video lectures from Berkeley's site last semester when I was having trouble with the Microelectronic Circuits course, and I was simply blown away by the professionalism shown by the professor. He was teaching, answering doubts, talking about stuff that was going on in the industry at that time, urging his students to read papers, attend conferences, and a lot more. What I found the most striking was that he seemed to be in absolutely no hurry to complete the course. He had no qualms about clearing doubts which were only remotely related to the topic at hand. At one point, he talked on for about fifteen minutes about processors and their clock speeds, while the lecture was about frequency response of circuits.

Contrast this with professors here, who teach only that which is there on the handout, and skillfully skirt around doubts which are unrelated to the topic being taught. I always naively believed that this was a shortcoming on the professor's part, but now I think I know better. The reason why professors here seem so bad is not because their knowledge is limited, it's because of the restrictions imposed upon them by the administration. They HAVE to finish the course on time, no leeway allowed. While I don't know what'll happen if they don't finish it on time, I'm pretty sure that it won't be anything good. And then there are professors who have done PhDs in specific courses, and are being forced to teach Probability and Statistics to first yearites. Can you really blame them for their disinterest?

The source of this enlightenment on my part in the course Analog and Digital VLSI Design, handled by prof. Anu Gupta. It is, without a doubt, the best course that I've done here. We had regular lectures, we had two assignments (one analog, one digital), we had vivas on those assignments. In each assignment, we actually did stuff that engineers designing chips do. We created the circuits, generated layouts, extracted parasitics, minimized power consumption, and a whole lot of stuff besides. We had seniors who cleared our doubts. And anyone could enter Prof. Anu Gupta's chamber at any time during the day, and she would entertain their doubts instead of shooing them away. This is the only course in which I have not fallen asleep during the lectures. There is just so much to learn, and she manages to cram so much stuff into one 50-minute lecture, that even I, despite my hatred for electronics, found myself wide awake and attentive.

And at the end of the course, she did something that no other prof has done so far for us: she asked us for feedback. She stood in front of the board, and she asked us to suggest ways in which the course could be improved. She explained the problems that she faces while handling the course, the problems associated with using the bright and shiny software available at Olab (our vlsi design lab), and she asked us to put across to her anything new that we learnt about the course or the tools so that she could improve the course accordingly.

And I believe that almost every professor here would like to do that, but they find themselves, as I said before, teaching probability and statistics to first yearites.

What a waste

Monday, April 20, 2009

Google Summer of Code

Well, my proposal for WorldForge got accepted for GSoC. I guess that means that I'll be "flipping bits instead of burgers" these hols...

Sunday, March 22, 2009

Home

After ten years of searching, I've finally found a place where I fit :)

Monday, March 16, 2009

Haunted

I heard your voice through a photograph
I thought it up and brought up the past
Once you know you can never go back
I've got to take it on the otherside

Centuries are what it meant to me
A cemetery where I marry the sea
Stranger things that changeed my mind
I've got to take it on the otherside

Scarlet starlet and she's in my bed
A candidate for a soulmate bled
I push the trigger and I pull the thread
I've got to take it on the otherside

(parts of Otherside by RHCP)

Monday, March 9, 2009

Untitled


They say that one picture is worth a thousand words...

Sunday, March 8, 2009

Daemon

Well, as you might (or might not) have gathered from my previous post, I've recently had the good fortune of reading "Daemon" by Daniel Suarez. Those interested in finding out more about the book can either visit its official site, or they can go to the trouble of googling for it. The book has got some awesome reviews, and it's the best geek-book I've read (although I understand that it's very easy and interesting for non-geeks as well) since Snow Crash by Neal Stephenson, but that's what this post is about.

Apparently, the last page of the book mentions something about something, and points the reader to the About the author page for further details. On visiting the said page, one will see a rather strange picture of the author. One that fans of ASCII art might find familiar. However, what is different about this particular sample of coloured ASCII art, is that the text itself hides a message in encrypted form.

Now, it seems that not many readers are aware of this, because on googling for it, I only found one relevant link: the one at Ethical Hacker. The people there have given a long and rather complicated guide to decoding the code by writing a program in C#. After which they've given rather vague and cryptic hints about writing a script to scrape the webpage periodically, as the author suggests. After several attempts (and several failed executions), I was about to hurl my keyboard across the room in frustration when I saw the "Forums" link at the top of the page.

There I saw that one of the users had had success in decrypting the code in merely 10 lines of Python code (excluding "include" statements). However, his code was rather incomplete (at best), so I set about writing my own.

And so, after two hours, I've written a script that checks the page, gets the RegexDate from there, compares it with a date stored in a local config file, and if the two are different then it proceeds to decrypt the web page and creates a text file containing the decrypted message on the user's desktop. And to top it off, it also uses gnome's libnotify to pop off a permanent notification announcing that the page has been updated.

To run this script, one will need to install pyDes, a python library that allows the user to decrypt base64 DES encoded strings. This library can be found here. It's a small download, just follow the instructions given on the page to install it on your system.

Windows users will need to modify my script to save the location of the config file. I believe changing sys.path.expanduser('~') to sys.environ('home') should do the trick. And you will also need to comment out the lines in which I call upon the notification system to display a notification. If you want something similar, try calling up dialog boxes from win32.

Oh, and the Ethical Hacker people have tried to ensure that only readers of the book will be able to decrypt the message by putting the encryption key as "Gragg's key" in their code. I have no such qualms, and hence have put the actual key in my code. The reason behind doing this is that only readers of the book would actually be interested in my script, so there seems to be little reason to stop them, or to force them to rack their brains trying to solve the "little riddle".

Tuesday, March 3, 2009

Irony


I find it mildly amusing that Daniel Suarez, the author of Daemon, the novel that's captured the imagination of every geek worldwide, can't make his home page in such a way that one part of it doesn't overlap with another.

Sunday, February 22, 2009

Of mice and seniors

I remember, in my first year I was quite close to a department senior named Ayshwarya. We used to talk about a range of topics, and once I complained to her about how I was barely getting any time for myself, what with lectures for eight hours a day, two to three quizzes each week (as part of the much-hyped "continuous evaluation system" here at BITS) and two hours of department work. She assured me that I was leading the "ideal" BITSian life, and that departments had after all been created with the aside of giving jobless BITSians something to occupy themselves with, there being very little to do here, what with we being in the middle of nowhere and all.

My main gripe at that time was that I had no time for introspection, for thinking about where I was and where I was headed. Now, I find myself in a situation wherein I have more spare time on my hands than I know what to do with. Life is indeed ironic to the extreme.

Anyways, talking about senior-junior relationships, it's occurred to me that "ragging" (although what happens here can barely be called ragging) is probably a unique way for losers to increase their own self-esteem. Ok, I realize that the above statement was really vague, so let me make myself clearer.

Basically, to the gullible juniors who come on campus, seniors come across as have-been-theres. Meaning individuals who've "been there, done that". I'm not exactly sure as to how this comes to pass, but most seniors, even those individuals whom you would judge to be complete losers under normal circumstances, come across as larger than life heroes (and heroines) during "interactions", as a consequence of which most juniors end up regarding their seniors as their own personal heroes, their mentors, someone they look up to and seek to emulate. In the junior's eye, nothing that the senior does could possibly be wrong, and they are correct and infallible in every possible way.

So what happens when these illusions are shattered? When the juniors come to realize that their seniors are human after all, and that they have their own weaknesses and glaring faults?

Well, just ask my juniors.

Saturday, February 14, 2009

Minor Grievances

Out of all the fond memories I have of my first year warden, Mr. Sanjiv Chandran, one particular memory stands out high above the rest.

It was the starting of my second sem. Tapan, my then-sidee, had just got a new comp and had set it up, and Harsh, his roomie, was particularly eager to play the game Prince of Persia: Warrior Within. So, at his behest, I'd gotten my copy of the game, and we were installing the game on Tapan's comp with the door wide open and game music pouring out of the speakers, when our beloved warden walks in.

Now let me outline the positions of all the players in this scenario. Harsh was sitting in a chair at the comp, peering at the screen, while I was next to him and maneuvering through the game's installation screens. Tapan was behind us somewhere, doing his own thing. Chandran walks in, and stares at Harsh for a couple of minutes, and Harsh stares back, unable to move, akin to a deer caught in the headlights of an incoming truck.

"What are you doing?"

"Installing a game... Sir," Harsh manages to speak.

"Get up."
(If this were a baseball game, this would be strike 1 against Mr. Chandran.)

Harsh gets up, and Mr. Chandran kicks the chair behind. And I kid you not here, he literally kicked it back. Then he opened his mouth to say something, and realized that the music would undermine his soprano, so he ordered us to stop the music.

Now, the game had chosen this time to ask us to insert the next disk, and Tapan's hands were probably shaking, so he couldn't quite manage to exit the installer. All this time, Harsh was mumbling something I don't quite remember. Anyways, Mr. Chandran finally got tired of the music and switched the comp off from the mains.
That was strike 2.

Unfortunately for him, he probably had no knowledge of what a UPS is, because to his everlasting amazement the computer refused to switch off and instead started beeping, which only aggravated him further. He got apopelectic with rage and started yelling at us. Fortunately, Harsh had the presence of mind to switch off the speakers and switch the mains back on.

After this Mr. Chandran proceeded to threaten us with, progressively, suspension, expulsion and deportation, as was (and is) his norm. And then he picked up Tapan's 8k TFT monitor with two fingers and threated to throw it at him.
That was strike 3.

And this is just one example of what Mr. Chandran does. In my first year, he wouldn't let us:
1) Sit in one room and talk
2) Sit in one room and watch a movie
3) Walk around in the hostel wearing shorts
4) Play music
5) Watch movies (even alone)
6) Play computer games

All of the aforementioned activities had to be carried out in a clandestine fashion, with sentries posted to warn us if the warden were to be sighted.

Mr. Chandran is still here, and from what I hear he still rules over his hostel inmates the way a prison warden rules over the prisoners. In the aforementioned game of baseball, Mr. Chandran would have been out at strike 3, with a probability of him losing his job for
a) Invasion of personal privacy
b) Threatening a person with damage to him or his personal property
c) Alienation of our basic human rights provided by the constitution

Ok, so maybe not the third one, but he was definitely out on the first two counts.

So why am I writing this here? Well, I don't know, guess I'm just venting. And plus, I hear that several BITSian profs regularly monitor BITSian blogs looking for miscreants washing the institute's dirty laundry in public, so...

Thursday, January 22, 2009

Confusion

Well, for those of you who still read this blog (statcounter says there were two visits yesterday and 13 in this week, so guess not everyone has given up on me) might be wondering how I went from three posts a week to one in three months, the simple answer is that I just couldn't think of anything to write.

I mean, in the beginning, when I first made my blog (not this one, this is the third one. Or maybe the fourth, I forget) I blogged about all the cool stuff that was happening to me at BITS. You know, stuff like meeting religious zealouts, my first interaction with the (in)famous Sajiv Chandran, experiences with drunk friends and so on. Later, in my second year, I blogged about disappointment, dashed expectations and heartbreak. Most of my posts were metaphoric, thereby ensuring that nobody other than those I was really close to would be able to fathom the depth of the posts. And considering that the people falling in that category numbered three of four, well, you get the picture.

The central driving factor behind all of my posts was, as Ramya pointed out to me, intensity. The stuff that I blogged about was stuff I intensely felt something about, be the essence of the feelings joy or sorrow. What changed over the summer holidays was that I lost most of whatever intensity I had. And no, it wasn't because something disasterous happened to me in the hols.

Another small reason for my not blogging was that my vocabulary and command over the English language seem to have diminished, no doubt due to the brojen combination of English, Hindi and Tamil that most BITSians converse in. Which is a very bad thing, considering that I will have to appear for GRE these hols.

Anyways, moving on... I guess what I'm trying to say here, is that I'd stopped blogging for all the wrong reasons. You don't have to blog to let the world know how much you're hurting, or to make the whole world laugh with you and get their appreciation. You blog because you want to. Because you've just found or done something cool that you want to shout out for the whole world (or atleast your subscribers) to hear. And maybe, in the process, to get a small bit of satisfaction from knowing that there are people who take time out of their busy lives to find out what is going on in yours.

So, what is going on in my life right now is...


And no, I haven't gotten a job at Apple. not even an internship (though not for lack of trying. Basically, I got Leopard working on my PC (and I know that's illegal, thank you for asking) and I have to say, while all the flak and criticism that Apple is getting for their stubborn policy of having one and only one way of doing anything might be well and justified, Mac OS X is still one magnificent piece of art. You know how all Apple fanboys will tell you that everything "Just Works"? Well, there's right. Everything does just work. Even on my PC, on which Mac OS X is not supposed to run, so I'm sure you can imagine how well it would work on Macintosh computers.

And surprizingly, all of this is on a Unix backend. That's right, the glittery GUI of Mac OS X runs on the same system as FreeBSD, OpenBSD and the other BSD's. And everything works, at the first try. I've been using it for over two weeks now, and I haven't had to open the console even once (although I did open it, but that's because I love the commandline). Compare this with linux, where chances are high that you'll have to open up the trusty console and tinker around with the system within an hour of installing the system, whether it be to get your lan card working, or to get some sound to pour out of your speakers.

And Linux (Ubuntu 8.04), even with a custom-compiled kernel, takes atleast a minute to boot and a little less than a minute to shut down, while Leopard, running on my hardware with a generic intel kernel, boots in 15 seconds and shuts down in 5.

Now why can't Linux be more like this?

Saturday, January 17, 2009

Amen

"For someone who claims to not believe in God, you sure have a lot of faith in the concept of destiny."

A wry smile. What else could he have done? She'd hit the nail right on the head.

"Let's just say that while we can control most things, there are some things that are beyond our grasp."

She rolls her eyes, an all-too-familiar smile tugging at the corners of her mouth. He silently urges the smile to spread, to light up her face the way it used to.

But his prayer goes unanswered. Will conquers habit, and the smile is forcefully winked out of existence.

"So, how are you?"

A million-dollar question. No family, no kids, no welcoming arms, nothing but the glare of an lcd screen and a job that had once seemed fascinating but had lost it's charm long ago. He had achieved everything he'd set out to achieve, had more than enough money, had his own house, a car, several gadgets and a dog to boot.
But happiness? The fleeting state that few achieve and none can keep for long?

He'd never truly been happy. The most that he had been able to achieve was a state of indifference. Indifference that had seemed like a blessing when compared to the pain of waking up to the creaking of the house and the dryness of unshed tears.

So how was he?

"I'm fine. Got a good job now, working at Techgrat. I'm working on this new processor, it's got this pipeline thing that-"

But she'd already lost interest. Had fished out her cell-phone out of her jeans and was typing away on it. Just like old times, except with one little difference. A not-so-little ring gleaming on her finger.

"Ah, so you're engaged now?"

"Yeah! You remember Jason, don't you? He was at college with us..."

"Oh yeah, Jason.."

"Anyways, we've been going out for nearly a year now. We're getting married next month!"

"Oh, how nice!"

Several moments of silence pass by, she gazing at his face, and he striving to keep his face expressionless while suddenly developing an inexplicable fascination for a little spot on his coat that just won't rub off...

"Hey, listen, I'm meeting him for dinner at 9, we have some time till then. You want to get a cup of coffee or something...?"

Say yes. Say yes you damn fool. Say yes. Tell her everything, she has the right to know.

"Ah.. No, I'm afraid not.. I have this, errr.. business meeting tomorrow that I, umm.. need to prepare for.."

The excuse sounded lame, even in his own ears.

"Oh, right, of course.." She trailed off, an unreadable expression flitting across her face.

"So.. I'll see you around I guess. Might even come for your wedding!"

"Yeah, I'll see you around. Don't be a stranger..."

An awkward hug, a wave, and they parted ways. He could feel her eyes burning holes in his back, but he resolutely walked on till he turned around the corner, and then sagged against the wall, fishing in his coat pocket, feeling an all-too-familiar hunger taking over him. Put it in his mouth with shaky hands, lit it, and let the comforting numbness wash over him. Let it convince him that he'd done the right thing.

After all, what could he have told her? That he still loved her, as ludicrous as that might seem. After all, how could you be in love with someone you hadn't spoken to in twenty years?
Would he tell her that he'd sabotaged their relationship on purpose? That there had never been any future for them, that their destinies were forever intertwined but could never meet, because his road would end a lot before hers? Would he have told her the doctor had given him only a year more? Or that the only person at his bedside would be the nurse he would hire to take care of him in his final days?

But then he'd planned on all of this, in that irritatingly rational way of his. He'd known that his story would have an early ending, and had arrived at the logical conclusion that nobody else should be made to suffer along with him. Had put up so many walls to ensure that nobody could get through. So how could he complain now?

His life had been filled with irony. It was only befitting that he would develop the urge to live only after finding out that he would die soon.

Well, nothing could be done about it. It was too late. Go home, work, down some alcohol to dull the constant ache, and lie in bed staring at the clock ticking away minutes that stretched into hours. C'est la vie

Cell

"The mind can calculate, but the spirit yearns, and the heart knows what the heart knows"

- The Head, Cell