Wednesday, February 25, 2009

Prime Factors of 8051

Find the prime factors of 8051 withouts using any computing devices. Do not even use paper and pen. It's pretty simple, actually, once you see it. :) Put the answer in the comments.

Sunday, February 22, 2009

The Accidental Time Machine by Joe Haldeman

The Accidental Time Machine by Joe Haldeman is a delightful story. After a long, long did something force me to pull and all nighter. I started reading the book at about 11 in the evening because I usually read myself to sleep and it gripped me so that I could not go to sleep. Kept reading till 6 in the morning.

The story in the same spirit as H G Well's time machine. An unsuspecting MIT grad student accidentally invents a time machine. After losing his job /and/ his girlfriend to the same guy, he decides to travel in time in a desperate lunge for fame. But he finds that no matter what future he travels to, he can never find one that he can feel at home in.

In the spirit of Well's 'Time Machine', Haldeman describes a dichotomous future but this time pertaining largely to America, unlike the broader human divisions that Wells decided to explore. In Haldeman's future, America is divided into two states. One, a regressive, theocratic Christian state, where the government creates the myth of the return of Christ and rules people through the fear of god. Second, is a secular, technologically advanced state which is profoundly anti-intellectual and deeply capitalist-consumerist.

In outlining these two possible futures for America, Haldeman delineates the two threats to intellectual thought present in the US today. The first are the religious conservatives and the second are the capitalist-consumerists.

I do have to add that I found the novel a little isolationist in its point of view. No effort is spent in writing about what the rest of the world is doing while the One Year War is going on the US. Indeed, it is as if the rest of the world doesn't even exist in Haldeman's universe. Only towards the end of the story do we see Australia cropping up from somewhere, which, I think, is put there merely for it's geographical separation from the rest of the world than anything else.

Rating: 3.5/5

A R Rahman Wins the Oscar

A R Rahman has just won two Oscar Awards – one for Best Original Score and another for Best Original Song, for Jai Ho.

I must say I'm a little overwhelmed with emotion. I have been an ardent fan of his music since many years. I can be said that I seldom listen to any music that is not his. Once you get addicted to his work, other stuff appears,w ell, a little bland to begin with.

The man is a genius, in the true sense of the word.

In this one instance, I can safely say that it's the Academy Awards which have been honored today.

Thursday, February 19, 2009

Best Spam Ever

Got this in my inbox just a few minute ago.

Dear Sir,

We AFRICA PRECIOUS COMMODITIES COMPANY LTD are ready and able to supply you with Alluvial gold of very fine purity, we require end Buyer’s or representative’s presence for a preliminary assay at the geological survey department fully controlled by the local government of Sierra Leone before any shipment could be effectuated.

The contractual quantity for sale to the Buyer Under the terms of this Agreement shall be a purchase of gold dust and bars of 250kg with rolls & extensions up to 500kg.The total price payable by the Buyer is fixed at (16.000.00$ per kilo of gold dust and 18 000 for gold bars). If you are interested, kindly contact us back for more

Best Regards
Chief Abdul kanu

Wednesday, February 11, 2009

Why I Went Back to Gnome

aka Why I Think Linus Trovalds Did

We heard a few days ago that Linus Trovalds has stopped using KDE. Well, so have I, same pinch. But over the past few weeks I’ve been wondering what really is wrong with KDE4.

And why would we wonder what’s wrong with KDE4. That’s because KDE4.2 is here. It is stable, it is functional, it has features and yet it is unusable. Why should a stable, functional, featureful piece of software be utterly unusable? Lets could the reasons.

(Disclaimer: the problems that I recount here might not have to do with KDE. They might be the problems with the kernel, Qt, Kubuntu or just me. But Joe User doesn’t care about that. Joe User wants his software to do what he wants it to do. If it does not he whines. So you either fix his problem or you educate him. And if you educate him he doesn’t remain Joe User after that.)

I love plasma. It is immensely powerful and has infinite potential. To realize just how powerful plasma is, do this in 4.2. Click on the clock to open the calendar. Now drag the calendar onto the desktop. No other desktop environment can ever let you do that. It’s awesome!

However, also do this. Drag the weather plasmoid onto the panel. Or try dragging the analog clock onto the panel. Try to put your panel on the side rather than the bottom. The results are awful. Plasma is wonderful and all that, but things aren’t working. It is not that they can’t work. It is just that the developers haven’t yet figured out the best way to make them work.

Take activities for example. I like the concept. I have a use case for them. When I’m working on my computer I like to have the notes and calendar widget on my desktop. When I’m reading and listening to music I like to have the now playing widget on my desktop. But everytime I want to switch an activity, I have to zoom out using the cashew and then zoom in.

You know what, in one context I like the windows panel better than the KDE panel. It is that the Windows panel has ‘levels’. For example if I have my panel made larger so that it is three times as high as the regular panel, I can have the taskbar on the top level, iTunes toolbar at the second and quicklaunch at the third. It is a highly efficient way to use your panel space.

With KDE you can only stack your things horizontally and not vertically. That renders the panel a little less usable. And yes, this was a problem with KDE3 too and they’ve not fixed it in KDE4.

The systemtray! Will someone finally fix it please?! Why does it have to flicker every time I minimize a window? Why do the icons take forever to load? I thought the systemtray would be first thing that people would fix!

I really like the idea of animations being coded into the window manager. I really do. It removes one level of complexity from the desktop environment and makes life easier for the developers.

However, the animations in kwin just aren’t right. In windows or even with compiz, when you restore a window, it first grows slowly and then faster and faster until the window appears to ‘pop up’ on your screen. KWin animations are linear and don’t have that ‘zing’ to them. Second, they aren’t smooth enough. They stutter. I can visibly make out the maximizing window stop in mid motion and then continue growing after a while. It is highly irritating. So much so that I actually turned the effect off.

KWin people, take a look at compiz. Run the same effects side by side on two machines, one with compiz and other with kwin. And learn.

Those are my reasons for staying away from KDE4. They are small reasons but when you used computers for 10 hours every day for your work, they tend to get onto your nerves. (Just like the Vista permission dialogs. Small detail but over time just irritates the hell out of you.)
What KDE4 lacks is not stability, functionality or features. It is that elusive quality called maturity.

(To dole out some praise, I think KDE4 has some absolutely kickass apps. Dolphin, Gwenview, and Okular are just awesome. I use them even with gnome!)

Why I Suck at Playing Video Games

I have never been good at playing video games. It is not that I lack eye-hand coordination. I’m good at other tasks that require this skill. And yet I suck at playing video games.

My gaming history goes back some years. It goes back to when I was a kid. My first experience with video games was in Chhatarpur, where my nani lived. We (my brother and I) used to visit, along with our mother for about a month or so in the summers. There was nothing exciting about the trip. I mean, it was good to see nani and nanji and mama and mami but then there were no kids to play around with (not until our cousins came along) and nothing to do, except eat and sleep. As an 8 or 10 year old kid, life was highly frustrating.

This is when I discovered that you could play video games for a price of 2 or 3 rupees an hour. It wasn’t exactly at a game parlour. It a small town kirana shop – the kind that keep everyday groceries, candy and other knick-knacks. At the back of the shop, the kirana-wala had installed some cheap TVs and gaming machines. The games available were the old classics – Contra, Mario, Road Fighter, Bomber Man. The gaming machines were the old 8-bit ones (from Sega or Nintendo, I don’t remember) that came with joysticks which had arrow keys on one end and four buttons at the other.

My mother had absolutely no idea what video gaming was about. For the longest time she thought that it was gambling of some sort. Her only experience with shiny, flickering displays had probably been with casino scenes in movies. Needless to say, she was completely scandalized when one day I shyly suggested that I be allowed to go and play for a while.

The other issue was money. For my mother, spending money on playing games, video or not, was completely unthinkable. So for the longest time all I got to do was stand at the kirana-wala’s and watch other kids play.

The first I got to play was when one of my uncles took me along when he himself went to play. He was only one and a half year older than me, (you know how it gets in extended families), and quite keen on spoiling this young man under his wing. We played some game that involved boxing the hell out of street thugs. It was great fun. I don’t even remember what that game was called and never ever found it again anywhere even though I looked and looked. And the best part was, we played on a colour TV.

It was not as if colour TVs were anything exclusive by that time. We’d had one at our home for many years by that time. But black and white TVs were still cheaper. So the kirana-wala would have a number of black and white TVs and have only a few colour TVs. And then he’d charge more for playing on the colour TV. If the black and white TV charge was 3 rupees, say, then the colour TV charge was 5 rupees.

But the real gaming experience came along when my nanaji was posted in Panna and we spent one summer with him in Panna.

Now Panna is a weird town. It is a mining town. (They have diamond mines there.) And needless to say, people are abjectly poor. The town has (or had) an uncharacteristically large number of tea shops which sold an uncharacteristically large number of rusks along with the tea. It seemed as though all the city ever had was tea and rusks.

Panna also seemed to have an uncharacteristically large number of mentally disturbed people. Nanaji always used to say it’s the diamonds. He said that being the most powerful ‘ratn’ the diamond was apt to drive people crazy.

We had this old man who used to come every day to the well right across the street. Our house was on the second floor and we could watch him from the building. He used to arrive at about 7 in the morning and bathe at the well till 3 in the afternoon. Yes, bathe. He lived nearby and brought all the big utensils in his house to the well one by one. Then he used to wash each of these meticulously. At times we’d watched him wash one utensil as many as five times over. Then he used to take his bath, again washing himself many times over. He used to do this till late afternoon. And along with this he used to shout things out. We never understood what they were.

Yes, if there was nothing to do in Chhatarpur, Panna was a recreational vacuum. I was so bored with my life that summer that I actually began reading this Hindi novel that nanaji had on table. (Much to his alarm. The novel was way beyond the understanding of a kid my age.) It was something called ‘Hansali Baank ki Lok’katha’. It was one of those regional novels whose sole purpose is to bore the reader with every excruciating detail from the lives of people from some remote village in India no one knows about.

So, seeing that I was getting bored out of my wits, my mother finally relented and let me go play the video games. The fact that the charges in Panna were a full rupee cheaper (per hour) than Chhatarpur might also have something to do with it.

Obviously, I played on the black and white TVs because it cost less. That was when I discovered Mario. The shop used to be hot (and you have to live in Bundelkhand to realize what heat means) and cramped. Sometimes we kids were sitting with not more than a foots distance between the TV and our heads. Every time a kid had to move, all of us had to pause our games, get up and make way. These used to pauses with much restrained anger. It took a whole minute or two off your playing time, after all.

I thought I was better at Mario than I was at Contra but I never made it beyond the fourth level.

In the subsequent years video games became more commonplace and people even bought them for home. Playing them was no more a taboo for my mother. Money was still an issue but then nothing beats the persistence of bored kids on hot summer evening. My brother had grown up a bit and I had to take him along every time I went playing. Obviously he wanted to play. But usually I didn’t let him and he had to stay content just to watch. Sometimes I used to let him play for a while. (Looking back, I feel so guilty about it.)

But gradually I lost interest in video games. Truth of the matter was, I completely and utterly sucked at it. Very soon, my brother who was barely half as tall as me could outdo me at any game. There’s no point in playing a game you can’t win.

Enter computer games. The first time I played a game, it was one a 12 inch monochrome display. It was a game called dave. There was this little man who had to jump over obstacles and shoot pretty little monsters with his gun to clear levels. I played it at a friend’s dad’s office.
We learnt computers at school. I also did some classes outside of school. At both places the teacher would sometimes let us play. There was the classic pacman and various spurious versions of Mario. There were sky, dave and yes, the legendary wolfenstien 3D. Wolf 3D made me realize how much I really sucked at playing games. Not only could I not make any sense of the 3D world, I could never remember my way around the map. (Even today I can’t find my way around a map in an FPS. Has something to do with my ability of not being able to navigate properly even in the real world.)

I never owned a computer until I was 20 years old and was in college. So these experiences with computer gaming were limited.

I did however code a pacman clone in qbasic when I was 16 year old. Yes, I am good at programming.

The only game that I’m moderately good at today is Age of Empires. I daresay I was an okay player in my wing at IITK. Other than that, I’m a complete and utter dolt at playing video games. I don’t know why. Perhaps the answer lies somewhere in this post. But I don’t know what it is.

Sunday, February 08, 2009

25 Random Things

I generally don’t do tags. But I’ve not blogged in quite some time so what the hell. Twenty five is a big number. Let me see how much time it takes me to do this.
  1. I have gray hair.
  2. Reading books is a way of life for me.
  3. I’m a big fan of A R Rahman and Star Trek.
  4. I’m a complete linux junkie. I spend an inordinate amount of time playing around with linux, reading news and articles about FOSS.
  5. I spend a lot of time online. Lord Google know me. Search for my name in google and you’ll know what I mean.
  6. I like trying out different kinds of food. I have always been a food theorist – always knew how a certain kind of food was cooked. That’s why I never faced much problem in learning how to cook. I daresay I enjoy cooking.
  7. Science Fiction and Fantasy is the biggest passion.
  8. Writing code gives me near visceral pleasure.
  9. When I was in school, I invented a script of my own.
  10. I had read the Feynman Lectures in physics in high school.
  11. I fell in love for the first time at the age of 16.
  12. Some of the most powerful emotional experiences I’ve had have been at Khajuraho and Konark temples.
  13. The Lord of the Rings and American Gods are the only two books I’ve read more than once.
  14. I obsessively maintain a collection of Bollywood actress wallpapers.
  15. I obsessively type capitals and punctuations everywhere – chat, email, blog, TODO lists. Everywhere.
  16. That’s because I’m a touch typist.
  17. I enjoy typing. There have been times when I’ve just typed random things to feel the keys under my fingers.
  18. I enjoy writing on paper. There have been times when I’ve just written down random things to feel the pen move against paper.
  19. But I enjoy writing on paper only with a fountain pen.
  20. I love reading horoscopes.
  21. If you take me to an ice cream shop, I’m very likely to have a flavour that I’ve never had.
  22. I enjoy walking.
  23. I’m easily intimidated by people, both men and women.
  24. I tend to get uncharacteristically rude and downright insulting while having ideological discussions.
  25. I hate poetry. Detest it in all its form. I think a world without poems will be a much better place to live in. Ironically, almost all of my close friends are good poets.