Thursday, November 03, 2005

Rahul's Birthday

I don't know whats with us and PLs. I mean, everytime before exams we do crazy things. Like during the last 6th semester PL we went to Munnar. The trip was planned, cancelled and replanned in a duration of one hour, and that hour being from 12 a.m to 1 a.m. Today, roughly 3 days away from our first exam, we went all the way from our house to Cocoa Tree just to have a cup of coffee (did I mention that this was also around midnight). The sad part is whenever we end up planning things in detail, it never works out.
Today was Rahul's 22nd Birthday. Due to some misunderstanding we ended up with 2 cakes instead of one. But, who am I to complain about extra cakes. The more the merrier.

Tuesday, November 01, 2005

Pretty candles


Pretty candles
Originally uploaded by [Rohit].
Our extremely well lit porch.

The auxillary slashdot effect

I had made a comment on slashdot about Rahul's HDR enabled screenshots of Farcry. In a few hours the views for those photos went from around 10-12 to around 900 each. A small but fullfilling slashdot effect. He sure was surprised :)

The color of lights

This has to go down as the best Diwali ever.
We all contributed in 200 bucks and got us a lot of sweets, lots of crackers and lots of food (well we were 7 people so it totalled to Rs 1400/-). We started bursting crackers at around 7:30 pm and continued up till 9pm. There were the usual "Anar", rockets, "gola bomb", "lakshmi bomb" and also the ethnic Kerala based crackers (which are basically something like the "bijli bomb" but in wrapped in coconut leaves.). Had a gala dinner (lots of it is still left) and then had an entertaining game of cards. A major portion of the sweets and food is still left, I guess that will be our midnight snack.
We have taken lots of pictures. Will upload them as soon as Sujit gets Rahul's bluetooth dongle.

Garbage collection

Well I was reading about shared memory in my parallel processing text. Interestingly shared memory is *not* deallocated when the program terminates. I didn't know that and unfortunately all of my programs which use shared memory don't explicitly deallocate it :(
The interesting thing is that shared memory and heap allocated memory are similar in the extent that both need to be explicitly allocated and deallocated. So I asked to myself, if that is the case can garbage collection be applied to shared memory? As in, the shared memory gets deallocated automatically when all the processes using that shared memory die. There is no need to explicitly deallocate the shared memory. If there needs to be this kind of a GC then I guess it should be built right into the operating system, so that it can conveniently keep track of the processes and the references to the shared memory.
Aw well I don't know why I wrote all this. Don't know if this is practical or of any use.

Monday, October 31, 2005

One year of blogging

All of a sudden I realized that it has been one year since I posted my first entry on this blog. So, Errr.. Happy Birthday Blog (????). With over 1200 hits, 180 entries and a whole lot of Ninjutsu this should make other blogs turn a shade of green (or maybe not). This would have to be the most memorable entry for me.
The blog started as a log of my day to day activities and things which I found interesting on the web. It still remains like that although I have decreased reporting *everything* I do on each day.
Anyway other than that, Happy Diwali to everyone and I guess the best Diwali gift we all received was Dhoni's marvellous innings against Sri-Lanka. This series will surely revive the interest in cricket, which was lost due to all the politics and the Indian team not performing.
Exams are closing by and studies seem to be balanced by an equal dose of Counter Strike.

Sunday, October 30, 2005

Code blog

I started a code blog (yawn) for I had nothing else to do during my exam holidays. I should start studying more seriously :(

Saturday, October 29, 2005

The (computer) gods must be crazy

So, here I am reading my text on analysis and design of algorithms (I have exams :( )when I see a mention of Donald E. Knuth's paper on "The complexity of Songs" (PDF). Whether it is supposed to be humorous or a mathematical description of songs, I couldn't decide because I suck at analysis. God help me.

Thursday, October 27, 2005

Battlefield

After doing a lot of sleeping in the afternoon and evening we all went outside to have dinner in South Star. We had a more than a filling meal and came back. After coming back I went to Rahul's place (who is now the proud owner of a GeForce 7800 GTX. Yep, he has a SLI enabled motherboard.) to play Battlefield 2 Demo. Now Battlefield 2 is a team deathmatch/domination kind of game. The scenario being that of war. The demo has only one map: Gulf of Omaha.
Now the best part of the game is that you get to do all kind ofthings which you would do in a war (that is other than killing people). You get to drive tanks, drive boats, fly fighter jets (my favorite) etc. Today I had a nice time flying the F-16. The dog fighting experience was pretty cool. Me and another guy were hell bent on blowing up each others aircraft. The only thing which sucked was the damned slow net connection which was causing lag at some times. Other than that the experience was pretty entertaining.
The Google key chain which I was talking about. The results for the written test have not come out yet :( Posted by Picasa

Wednesday, October 26, 2005

One hot Cappuccino (before)


One hot Cappuccino (before)
Originally uploaded by [Rohit].
Me and Rahul had gone to Cocoa tree (yesterday) to get RK's birthday cake. Had a nice cup of coffee followed by a high speed bike race. Did I mention that Rahul is an extremely fast (yet safe) biker. One poor Unicorn guy got his ass kicked by a CBZ and I had front row seats to the action.
Poor Nishant forgot to #include <math.h> in his graphics lab internal and didn't get output. Followed by the humilation on the net (see pic below), my heart really goes out for him (mwhwahahaaha). Posted by Picasa

Tuesday, October 25, 2005

7th semester almost over

All our classes are over and so are our internal exams. Now what is left is the university exam which is coming up on Novemeber 7th. With a preparatory leave of just about 12 days its going to be an uphill task.
Had my graphics lab internal today. We got a pretty simple program to make and animate a planetary system consisting of a star, three planets and some randomly moving rocks (asteroids??). Given that the lab was conducted in TurboC (yuck!), there were no eye catching effects. They were all plain circles going around one another. The viva also went smoothly.

Sunday, October 23, 2005

The game on Linux

As I had previously said the Pacman game which I had made ran very slowly on Linux. So I made some posts on forums and got to know of the cause. Now it runs pretty nicely on both windows and linux. I have updated the sources and included a makefile for Linux also.
Update: I had my demonstration today and it went pretty well :) The faculty was impressed. I would like to thank all those people who have played the game and/or given me feedback. Thanks a ton !!

Pacman aftermath

So, I completed Pacman and the demo is to be tomorrow. I don't care how it goes. But there are a few things which I learnt while making this project and which I do care about.

First of all: designing before you actually code helps later. While making this project I never layed pen to paper. Everything was directly typed onto the computer without actually thinking it through. That is the reason why at some parts the collision detection doesn't work. I don't think that I will be able to rectify that without doing a total overhaul of the code.

Secondly, making tools which aid some part of the program are not only cool but also an excellent saviour of time. I made the pacman map editor because I was lazy to actually put in all of the coordinates of the maze into the program. In the end it was a big convenience in testing the program.

Thirdly, something which works fine on your computer may not work the same, somewhere else. The game ran smoothly on my windows machine. It ran extremely fast on my friend (Rakesh's) P.C (maybe because of a better graphics card) and extremely slowly on my Linux box. I'm still trying to figure out why it is running slowly on Linux. By the way did I mention that the game was portable :D

And finally the only tough part in doing any project is .... starting the project. Once you have started it doesn't take much time to finish it..

Saturday, October 22, 2005

Pacman finished

Pacman finished !!! Well ya you could say it is "finished", because it is not exactly same as the original pacman. The monsters don't look the same and they move randomly in the maze. But thats not the main point. You have only one life and you can't eat the monsters. If you eat the super pill you will just be able to pass through them (disguised as one of them). And there is no score, the reason being I didn't want to go into the trouble of setting up fonts in OpenGL. The windows executables can be found here and the source code can be found here. I haven't commented it too much, at the moment. This project has been done in OpenGL , SDL compiled using Bloodshed Dev C++ (I don't like the IDE part of it that much) and edited using good old xemacs. Should run on Linux through wine but I guess it can also be built for Linux.  Posted by Picasa

Pacman continued

Well I'm back working on Pacman again. I did the collision detection part, but it is not working everywhere :( I don't think that I will be able to correct that before the deadline (which is monday). I did the sounds also and they are working fine. The only remaining part being the monsters. One real bad thing which I noticed about OpenGL is that to write some text on the screen is not that straightforward. The common ways are not cross platform and the other ways (like using SDL_ttf) are...well, a bit complex (at least right now). Posted by Picasa

Wednesday, October 19, 2005

Fork bomb

Ever since I had heard about fork bombs (last semester Operating Systems course), I wanted to create one for myself and see its effect. Please don't try this if you don't want to waste your *nix system.



#include <sys/types.h>
#include <unistd.h>
int main() {
while(1)
fork();
return 0;
}


I ran it on my Gentoo system and it was brought to its knees in a few seconds. I couldn't open any new processes or even login in another terminal (well login is again a process, so I guess that was redundant). Couldn't even terminate the fork bomb by Ctrl+C. Ctrl+Alt+Del (reboot) also didn't work. So had to push the power off button.
It was pretty cool :D

Tuesday, October 18, 2005

Google 2084

 Posted by Picasa


This will surely increase my job prospects :))

The Big G

Google was in campus today for recruitment today. The presentation was followed by a written round consisting of objective questions and one programming problem. It was ok. The results will take around one week to be announced :( We got Google key chains after the whole thing got over.

Sunday, October 16, 2005

This is a screenshot of a maze (created by the map editor) loaded by the pacman game. A few things are still missing at the moment. There is no collision detection (meaning pacman can roam through and out of the boundaries) and no monsters. With my internal exams coming up I don't think I will get to work on this, this week. Posted by Picasa

Saturday, October 15, 2005

Pacman map editor

I was working on creating the maze for my Pacman project. To do that I divided the screen into cells of dimensions 40x40. Each cell can either be a boundary entity, a pill , a super pill or empty. The boundary entities are the ones which actually form the maze (the blue thingies).

Now I had done all the coding for the Cell class, but I was really not in the mood to type in all the values (namely the x,y coordinates and the type) for all the cells to make the maze (I hate magic numbers in a program). So I made a map editor which is basically a WYSIWYG editor with which you can create mazes for my pacman game. It is very basic at the moment. You just hover the mouse on to a region and click. The cell's type, in which the region belongs, is changed with each mouse click. The map can then be saved into a file which is read by the Pacman game.

I think it is pretty neat :D Posted by Picasa

Friday, October 14, 2005

Obfuscated code

I was tempted many times to make one. Here is the first one in my life:

main (U
,C
) {
scanf(" %s",
C);sscanf(
C,"%x ",&
U
) ;
printf ( "%d ",U) ;
}


Runs in gcc and converts hex (input) to decimal(output).

I hate myself

Two days back (the day before the "last date of submission" of our major project abstract), I was getting frustrated scouting for ideas for the major project. I was not liking the topics suggested by the sites. The reason being: I like making projects which are technical but can be understood and appreciated by everyone.
So, coming back to my deranged state of mind, while scouting I came across this article on linuxdevcenter.com . It was basically an interview with the lead developer of an open source 3-D graphics engine called Irrlicht. Anyway a 3-D graphics engine fit my "reason for making projects". So, in a fit of inspiration I typed out an abstract and submitted it today (it seems the "last date" was flexible).
The only problem being: my relative inexperience in graphics programming. Yes, I'm doom(ed). And yes I'm doing this alone..

Among other things we went to play a match (basketball) in UC College (Aluva) against MCC, Calicut on the same day. Given the fact that we had not practised and MCC was a sports college we were bound to lose. And yes we did, but by a reasonable margin :D Everyone was being cycled through the fives as no one had enough stamina.

Thursday, October 13, 2005

Pacman started...

I had decided to make a Pacman clone as a part of the graphics (micro) mini project. The project should have started (ended??) a long time ago, but we lazy people like to keep things for the last moment.
Anyway I finally started coding a few things for the project. I basically have three entities of the game almost ready i.e Pacman, the pills and the super pills. The monsters and the maze are yet to be taken care of. The bigger pill is the super pill and the smaller one is the normal one. The yellow thingie is Pacman. I have the keyboard controls working and animations for pacman and the super pill too. Posted by Picasa

Monday, October 10, 2005

Shed skin

I first came to know about shed skin when Mark Dufour (the guy who is making shed skin ) mailed me. He said that he wanted to use one of my python programs to use as a unit test case for a python-to-c++ compiler he was working on (that is what shed skin is). I did a little more research on the project and I find out that it is actually one of the projects funded by the "Google summer of code" thingie. The project is pretty cool and shed skin can effectively convert a lot of python programs into C++ code.
Today while I was trying to compile a program with shed skin I got an error which had something to do with "dlopen". So I googled for it and got a lot of interesting stuff.
dlopen, along with a few other functions, is used to dynamically load in libraries. Basically it is used so that you can make your program more "plugin friendly". You can find a lot of interesting reads on this topic.
Among other things, I still don't have any bright ideas for my major project :(

Sunday, October 09, 2005

The day after

Today was the last day of Inspire '05. We had events like programming, web designing etc taking place today. Followed by the grand finale the DJ show. I couldn't attend the DJ show as I was busy munching pizzas courtesy my cousin Neethu (who got placed in Infosys).
Among other things I'm wondering if this is an year of disasters, with the latest being the quake in north India/Pakistan.

Saturday, October 08, 2005

Inspire '05 Hackathon

Today was the first day of our computer science fest : Inspire '05. I was helping out in an event titled "Hackathon" which had to do with cracking and cryptography. We didn't expect much participation for our event but a healthy number of 8 teams turned up. There were two parts to the event: cracking and cryptography. In the cracking part the participants were given three executables (which I downloaded from various sites and was able to crack myself) which they had to crack. The tools provided were ollydbg, w32dasm and xvi32.
For the cryptography part they were given three simple ciphers designed by me, which they had to decipher. The three were something like this:

Cryptography challenge 1 - More than Caesar

guvf xvaq bs pvcure vf xabja nf gur ebgngvba pvcure. gur nafjre gb guvf ceboyrz vf ebgngvba


Cryptography challenge 2 - Bad numbers

69 66 20 79 6f 75 20 64 69 64 20 74 68 69 73 20 63 68 61 6c 6c 65 6e 67 65 20 77 69 74 68 6f 75 74 20 74 68 65 20 68 65 6c 70 20 6f 66 20 61 20 70 72 6f 67 72 61 6d 20 74 68 65 6e 20 79 6f 75 20 6d 75 73 74 20 68 61 76 65 20 74 68 65 20 61 73 63 69 69 20 74 61 62 6c 65 20 69 6e 20 79 6f 75 72 20 68 65 61 64 2e 20 74 68 65 20 61 6e 73 77 65 72 20 74 6f 20 74 68 69 73 20 63 68 61 6c 6c 65 6e 67 65 20 69 73 20 68 65 78 63 6f 64 65 7a

Cryptography challenge 3 - A nice compliment

10011101
10010110
10010001
10011110
10001101
10000110
10001100
10001011
10001101
10010110
10010001
10011000


All these were generated by programs written by me and are pretty simple.

Solution for Cryptography 1

The cipher is a simple shift cipher also known as ROT-13. The letters a-z are translated to n-za-m. A simple PERL program solves it.

$a="guvf xvaq bs pvcure vf xabja nf gur ebgngvba pvcure. gur nafjre gb guvf ceboyrz vf ebgngvba";
$a=~tr/n-za-m/a-z/;
print $a;

Which reveals:
this kind of cipher is known as the rotation cipher. the answer to this problem is rotation

Solution for Cryptography 2

The cipher is basically ASCII codes written in hex. Here is a simple python program to solve it:

s="""69 66 20 79 6f 75 20 64 69 64 20 74 68 69 73 20 63 68 61 6c 6c 65 6e 67 65 20 77 69 74 68 6f 75 74 20 74 68 65 20 68 65 6c 70 20 6f 66 20 61 20 70 72 6f 67 72 61 6d 20 74 68 65 6e 20 79 6f 75 20 6d 75 73 74 20 68 61 76 65 20 74 68 65 20 61 73 63 69 69 20 74 61 62 6c 65 20 69 6e 20 79 6f 75 72 20 68 65 61 64 2e 20 74 68 65 20 61 6e 73 77 65 72 20 74 6f 20 74 68 69 73 20 63 68 61 6c 6c 65 6e 67 65 20 69 73 20 68 65 78 63 6f 64 65 7a """
l=s.split()
m=""
for k in l:m+=chr(int(k,16))
print m

Which reveals:

if you did this challenge without the help of a program then you must have the ascii table in your head. the answer to this challenge is hexcodez

Solution to cryptography 3

This was basically ASCII code changed to binary and complimented by 1. Again python does the job for us :)

s="""10011101 10010110 10010001 10011110 10001101 10000110 10001100 10001011 10001101 10010110 10010001 10011000"""
l=s.split()
m=""
for k in l:
m+=chr(~int(k,2)+256)
print m


Which reveals
binarystring

The event went of pretty smoothly and I'm happy that it got a good response. The winners were from MCA CUSAT. Thanks to Chandan, Saurav and all the other juniors who ran around for this event :)

Thursday, October 06, 2005

A Python one liner

I was just fiddling around with IDLE, when I made up this one line program to reverse a string and display it.

print (raw_input()[::-1])


Well it is not too clever, but what the heck it is my blog and I put in whatever I want to.

Wednesday, October 05, 2005

Quake 2 Nostalgia

With the last date for the submission of the major project abstract drawing closer, I was scouting the web for ideas. When I was making my chess engine (6th semester mini project), I was intrigued by the idea of making a bot for a FPS like quake 3, UT etc. Although we take these bots for granted while playing the game, a lot of effort actually goes into making these bots life like. The majority of information on bot programming available on the web seems to be restricted to quake 2. After reading through a few of these sites I decided against making one. The reason being 1) It won't seem too academic. 2) The information is confined to quake 2 (I was hoping at least quake 3)
Anyway looking at all that info about quake 2 made me download the demo. That being one of the first games I ever played (I guess at that time I was in 10th standard). Surprisingly I could remember most of the things and the demo lasted for a fiery 20 minutes of gameplay (no saves). It is still fun playing it :) Come to think of it I have been playing on the quake 2 engine all these days. Counter strike condition zero is built on the Half life engine. The half life engine is actually a highly tweaked quake 2 engine which was brought by valve from id software.
Among other things I again got hit on the nose by the basketball.

Monday, October 03, 2005

Harvey Danger

Well, there was this article on slashdot which said that a Seattle based rock band called Harvey Danger had released their newest album Little by little for free download. So, I went right ahead and downloaded the album.
The verdict: It is pretty good and even better because it is free.
Among other things, I got hit right on the nose by the basketball while playing. It is not a nice feeling.

Permutation

Well, there was this sample google question on the notice board which went something like this: "How will you find whether string A is a permutation of string B?" . One method will be to actually make all the permutations and keep on comparing them with the other string. This is obviously inefficient as it takes O(N!) time. I did something else which takes O((N)^3) time (I think. I am not too good at analysis.). You just check whether all the characters in one string are there in the other string and their lengths are equal (obviously).

Friday, September 30, 2005

The Anatomy of a Search Engine

With google coming here and all I have been trying to dig up stuff related to the way search engines crawl and index web pages. I stumbled upon Sergey Brin and Larry Page's paper on google. Should be an interesting read.

Thursday, September 29, 2005

The lone rider

I woke up to a nice morning. I had my breakfast as today was a holiday (usually I don't). We had an Inspire meeting today at 10 in the morning. After taking care of that I went to see the EC fest which was taking place. Some of my friends suggested that I keep my project in the project presentation. So, as I had nothing better to do, I brought my project (a chess engine) over there.
I was surrounded by Electronics projects on all sides. Half of the projects had something to do with robots on wheels. I being the only CS guy over there. Also my team had only one member: me. Other teams had 2-4 people. The good thing was as the judges were from electronics background they couldn't ask too many tricky questions.
The results are not out yet, but at least I got lunch and tea so I'm happy.

Monday, September 26, 2005

The Big Bang

I walked into the college building expecting the same boring schedule to repeat itself. My eyes went to the notice board when I saw those 6 letters. On top of the letters was written "Are you feeling lucky today?" . I couldn't believe my eyes: Google was going to come to our campus!!!! Let's see what happens. Fingers and toes crossed and yes I do feel lucky ;)

Sunday, September 25, 2005

Back again.

The moment you set foot on the station you get the same feeling: "Back to the same damned place again." The feeling hasn't changed since the first time I returned from Delhi, after my first year was over. Three and a half years gone by like the wind blows.

Sunday, September 18, 2005

A late update

It's been quite a while since I put up anything here. Reason being that I'm having a ball in Delhi. The past one week has been a blur.
Everyday its like : get up, drop mom to school, have breakfast and then zoooom away with friends for rest of the day. I went to places which I always wanted to go (like cafe mocha). Best part is I'm now getting the car more easily (yahoooo).
I made mom watch Swades and she was pretty impressed by it. I also wanted to make her see Iqbal and we did go to wave noida, but unfortunately they had stopped showing it.
I hope the remaining week is even better than the week which just went by.

Tuesday, September 06, 2005

Exmas over !!!

My internal exams are finally over. Fortunately all of them went fine. I leave for Delhi tomorrow.

Sunday, September 04, 2005

Confusion confusion

We have two internal exams scheduled for tomorrow (Networks and Neural networks). While reading the newspaper in the afternoon we noticed at one corner that PDP was going to call a hartal tomorrow. This started the panic wave (which is soo famous in CUSAT). A rapid exchange of messages over messengers, phone, word of mouth started. More people wanted the Hartal not to happen as this would jeopardize their (Onam) vacation plans. The 8' O clock evening news confirmed that the Hartal will be there tomorrow, which meant that the exams will be postponed. One hour later we get another flash news that the hartal had in fact been called off. So back to the books.
Among other things I feel very weak although no one believes me.

Friday, September 02, 2005

A week back we had nothing to do so we decided to do some stunts. This is just one of them.
The bottom tier of the "Human pyramid" is made up by Anshul, Rahul and myself. Sujit and Sourav are enjoying their stay on the top at our expense.
This stunt was preceded by me carrying Anshul (weighs over a ton) and Sujit together. I'm sooo strong :)
We even had two rounds of piggy back fighting, both of which my team won.

Note: These stunts were carried out by professionals. Do not try them at home.  Posted by Picasa

Wednesday, August 31, 2005

Another logo. This one for the quiz. Pretty simple enough I guess. The lightning is a bit Harry Potterish. Posted by Picasa

Site statistics

One of my favorite passtimes is to keep track of who all are visiting my site(s). This lets me see how many hits I'm getting and from where all. My home page received the most number of hits (164) this month. My blog also received the most number of hits (300) this month. You can check out the stats for my site here. The site stats of this blog can be accessed by clicking at the counter on the bottom of this page :)

Monday, August 29, 2005

Programming event logo. Hurried up effort. This one deviates from the white background thing. Posted by Picasa

Sunday, August 28, 2005

Logo for the paper presentation. Among other things we have street lights outside our house yahoooo!!!!! We now have the power of sight in the dark.  Posted by Picasa

Saturday, August 27, 2005

Another logo

Surprise surprise!! I made another logo. This one now adorns the make shift ACES site, courtesy myself. Posted by Picasa

Wednesday, August 24, 2005

Growth in Indian Offshoring Slowing

Slashdot had an article on "Growth in Indian Offshoring Slowing". An interesting read. With companies opting out for places like Eastern Euprope, Latin America, China this was bound to happen.

More on Google talk

Google talk has a nice clean UI. The installation is very small (900K) and very fast. I did make a PC to PC call and it sounds very clear. The downsides are quite a few though.
No emoticons. When you try some of the emoticon combos like :) or :D etc they turn blue but you don't get any smileys. Font face and color cannot be changed. No avatars or buddy icons. No "buzzes", "nudges", "audibles" etc. All in all if google wants to stay in the IM race they will have to improve. I still like Yahoo messenger the most.

Tuesday, August 23, 2005

Google Talk

Google Talk is Google's newest offering. It is an instant messaging service based on the jabber protocol. I haven't tried it out yet, but I soon will :)

Dooba Dooba


doobadooba
Originally uploaded by zadeus.
My brother is in TCS Bombay. He was busy clicking pictures in the recent flood. This one shows the scale of destruction which happened there.
Another logo. This one is for the web site designing event. It is a blend of the previous two ideas. The e is from Internet explorer and the background is from Firefox. I'm a fair person. Posted by Picasa

Sunday, August 21, 2005

This one I made for the gaming event. The name of the event hasn't been finalized yet so I gave it a name: "Headshot". :) Posted by Picasa
I guess logo designing is getting to be the latest fashion these days (especially with Inspire and a lot of other fests coming up). So I said why not try my hand at this thing.


This one being a logo for an event which I shall be handling. The event is a set of progressive hacking challenges.

Posted by Picasa

Saturday, August 20, 2005

4 KM

I got my shoe repaired after 5 days (so now I don't have to play basketball barefoot anymore). Unfortunately nobody turned up to play in the evening. So, I ran. I first took a few rounds alone then I had Rahul Bhai for company. He took some 15 rounds and I took some 10. We had a sprint for the last round. I won the sprint in seabiscuit style. But, yes, I had the "I ran 5 rounds less" advantage. It was fun. I got completely dehydrated after that.

Friday, August 19, 2005

Heli attack

Who says you can't make good games in flash. Heli attack 3 is a game on miniclip. The game is a side scrolling 2-D flash game. Basic objective is to shoot at helicopters and other things that try to piss you off. The best part of the game, which I liked, is that you get to choose from a lot of weapons like the rail gun, sniper rifle, rocket launcher, grenade launcher, chain gun etc (seems to be inspired by quake). Also the game has quite a few levels. Pretty interesting.
My good friend Rakesh managed to make this wonderful logo for our annual Computer Science fest: Inspire. It looks pretty cool. I just hope that others like it too. Posted by Picasa
We had a virus attack on our systems by the W32.Pinfi virus. Till now we have detected it on 3 computers out of 4, on our LAN. It infected over 550 files on my system. The impressive fact was that it was able to do all this in one day. Fortunately Norton Antivirus was able to detect and remove it from my system. Although it is gone I would like to format the drive. Posted by Picasa

Thursday, August 18, 2005

Back from Trivandrum

I had left for Trivandrum day before yesterday for my uncle's housewarming. I had Sunu with me for the train journey to Trivandrum so I didn't get bored.
The housewarming took place yesterday. We had the usual stuff, which take place in a Hindu Brahmin ceremony. I was mostly involved in taking snaps and doing some small help work (when needed). I spent some nice time with my cousin brothers and sisters. I returned today morning at around 10:30 am. Fortunately my friends had taken care of my attendance :) while I was away. So, no worries.

Monday, August 15, 2005

Sarovar.org

Sarovar is an Indian site where you can upload your projects something like sourceforge. The good thing is that almost all of sourceforge's facilities are provided and it is easier, than sourceforge, to get your project approved. Check out my page at Sarovar.org.

Brother crossing a river.

DSCN0892
DSCN0892,
originally uploaded by zadeus.
This is my brother crossing a "river" (which apparently doesn't have any water, duh!). This was in his "Outbound learning module". I don't know why these companies use such complex terms for a simple thing called "picnic".

Sunday, August 14, 2005

Second revision to Pong

I made a few cosmetic changes to my game: Pong. The game pauses when the ball hits the ground and then plays a "smash" sound. The computer now does get defeated, although I was unable to remove the to and fro motion. The controls are the same and the bat still moves at its usual "fast" pace. Source and executables.

Happy Independence day

India turns 58 today. Salutes to all those who helped us gain our freedom. We are truly indebted to them and their sacrifice towards the country. Jai Hind !

Addy gets placed

Addy finally got placed in Hexaware. He had worked hard for it and I'm happy that he cleared it. Hard work finally pays its dividend. Time to party.

Saturday, August 13, 2005

Black and White

Spoiler warning: Certain plot details of the movie Mangal Pandey: The rising, follow. Do not read if you don't want to.

Today was one day after the release of the much awaited movie : "Mangal Pandey: The rising". After a long wait of 4 years we finally had a movie starring Aamir Khan. We had done the bookings in advance at Sridhar. Sourav had booked 10 tickets for us all but unfortunately not everyone could make it. So it was just me, Anshul, Sujit and Sourav along with some juniors who went to see the movie. Two of my classmates had asked Sourav to book tickets for them too, but they couldn't make it on time. So we were left with two spare tickets. The movie was about to start and we needed to get rid of them fast. So, we started asking other people if they needed two balcony tickets. Now, we did this at a great risk, because we were surrounded with a lot people who were selling tickets in black. There was a pretty good chance of us getting beaten up. Even though we were selling the tickets at the same rate at which we brought them, there were no takers.
When there were 5 minutes to the start we went to the people who were selling tickets in black and asked them if they needed two balcony tickets !!! Two of them said "No", when suddenly one of them came and brought the tickets at Rs 100/-. We earned a profit of Rs 10/- Hurray!!!
Mangal Pandey as a movie doesn't live up to it's hype. It is a nice movie all right, but it is not something of the scale of Lagaan. The songs are not too great and seem to be inserted forcefully into the movie. The title song is good though. The movie rolls along smoothly in the first half and the final thirty minutes are good. The scene where you have Mangal Pandey firing shots alone at the whole Rangoon regiment is quite awesome. As expected Rani Mukherjee's role is confined to just the songs. Amisha Patel's role is not even that much. The English actor who plays the role of "Captain Gordon" has done a good job. Aamir Khan is obviously good.
All in all I would say you should see this movie at least once.

Friday, August 12, 2005

Another day in my life.

Today was special, because the day started of with me falling into the wet mud outside our house. I was planning to distribute the lab records today. So I asked Bhupen to give me lift on his bike. The bike hadn't gone two feet when the bike slipped and we fell along with the bike. I was more dirty than hurt. So I had to cleanup before going to class. I arrived a full 40 minutes late *big grin* to class and got away with it.
Today was special also because it was the first day in our 7th semester when we had full day class. We have faculty shortage and two of our subjects didn't have a faculty until recently. We had all 3 hours in the morning and lab in the afternoon.
Evening was spent in playing basketball. We had players from Sacred hearts and we had a nice 3 hours of full court action. During the game I also managed to destroy the sole of one of my shoes (which, by the way, costed 5 grand).
I now have a good long weekend in front of me. Hope to sleep right through it.

Wednesday, August 10, 2005

My second game

Well I am supposed to be making Pac-man for my graphics micro-mini project. Instead I made a game of pong (It would be surprising if you haven't played it). No idea why I made it.
Anyway the controls are the usual "LEFT" to move left, "RIGHT" to move right and "SPACE" to stop the bat. Why does one need "SPACE" to stop? Well, because the bat moves really fast. Right now it is very tough to play the game, forget winning. The computer near about plays a perfect game and I haven't scored a single point against it. The reason being the algorithm driving the game of the computer is stupidly written.
If you want to play the game you can get the executables. You can also get the source code. It has been written in xemacs and compiled using Bloodshed Dev C++. You will be needing the SDL libraries to compile the program. They are provided with the executables.
It took me two nights to finish this program and thus it has not been well commented. I will soon take care of that.

Tuesday, August 09, 2005

5 point someone

I was reading the book "5 point someone" for the past 3 days. Although it is supposed to be "unputdownable" it took me some days to finish the book, as I had other work (lab / basketball) to do.
The story is pretty good and relates pretty well to our lives. It is a nice joy ride and I really liked it.
Among other things the weather has become hot for the past two days. But right now it has started pouring again. I wonder if I will be able to go and play.

Monday, August 08, 2005

Sudoku solver getting popular?

I had made a sudoku solver a few days back in python. I had submitted it to uselesspython.com. Quite surprisingly it has become pretty popular and at the moment it is at the top of this week's most downloaded programs at uselesspython. Check out its statistics.

Sunday, August 07, 2005

Loungevity

We (Me, Sujit, Rahul and Bhatta) had been to Loungevity yesterday. It is a one of a kind lounge in Cochin. You really don't expect to see such plush interiors and a nice crowd. It was a fun evening.

Saturday, August 06, 2005

360 site feeds

I rarely use my account on yahoo 360. I just read the blogs of my friends on it.
Anyway, so I came to know that you could put RSS feeds onto your 360 yahoo page. So, I gave the feeds of this blog.
Another thing about yahoo 360 is that, whenever you modify anything on your page you get "star" alongside your name in yahoo messenger.
The interesting part is as soon as I publish a new post on this blog, those changes get reflected onto the feeds and thus on my yahoo 360 page. Thus getting the "star" alongside my name on Y! messenger. Pretty cool.

Friday, August 05, 2005

Player Vs Player

I got the link to PvP (Player Vs Player) from PA a few days back when Gabe announced that PA will be forming a guild against PvP (for World of Warcraft).
I found that PvP was much hilarious than PA and I have become addicted very fast. Here is an example.

Sunday, July 31, 2005

A small revision to my game.

My first game (aptly titled "shooter") had square balls. Which was a big disgrace. I have now made them disc shaped, which now makes the game-play less boring. If anyone wants to take a look at it you can check it out here. If you want you can take a look at the source too.

Saturday, July 30, 2005

A day of cleaning

After a long period of deliberation we decided to clean our house.
As anyone who has been here would know that, our house remains in a state of utter orgranized chaos. You will find bills, books, newspaper, clothes, pens, hangers, CDs etc all in the same pile (with a layer of dust on top). Apart from this, our house also serves as a breeding ground for all kinds of insects and reptiles. Thus helping the ecological system maintain its balance. If an insect died we let the ants take care of it. If an ant died.. hmmm well I don't know what happens. Maybe next time I will try and find out. You see we respect the food cycle unlike most people. We take the teachings of Charles Darwin very seriously. It is survival of the fittest all the way (ya but mostly or maybe only in the case of food).
Anyway, enough of the lame excuses. The house is clean. All are invited to come have a look as it won't remain the same for many days (ya, the "ecological system" is expected to rise its head again).

Wednesday, July 27, 2005

The seminar

I had my seminar on Denial of service attacks today. Although mine was the shortest seminar with the largest font, it went well. I am pretty happy and relieved that it is over.
Among other things I heard that all your base are definitely belong to us.

Sunday, July 24, 2005

My first game

I had been playing around with SDL and OpenGL for the past few days. It was about time that I did something constructive with what I had gained. So I came with an idea for this game where you have to shoot randomly moving balls with the help of a mouse. I sat down and started coding. At the end of an hour I had a playable game. The balls, well, didn't look like balls. They had turned out to be square ! But rest of the things were fine. The cross hair did look like a cross hair. When I clicked the mouse it did give me the sound of a gun shot. So all in all I'm satisfied with my ugly looking game which has no future whatsoever. The source code and executables are (as always) available. The program was written using Bloodshed Dev C++ IDE and xemacs. You will be needing SDL.dll and SDL_mixer.dll to compile the file under windows and the same corresponding libraries under Linux . These dlls are provided with the executables or you can get them from here.

Saturday, July 23, 2005

Harry potter - 6

After a lot of debating with myself I came to the conclusion that it would be a waste of time to read the book. The main reason to read the book, for a lot of people would be the popularity of the series. I guess thats why I read the first five. But, I guess I have grown a bit more impatient these days. So, instead I just read the whole plot summary on wikipedia. After reading the summary I would give it a 3/5, but certainly not worth Rs 900.
Amongst other things I have a new found respect for the Arctic Warfare Magnum (aka AWP).


Currently my favorite weapon in Counter Strike.

Friday, July 22, 2005

Cross compatibility with OpenGL and SDL

I was trying to make OpenGL work through SDL. It took me some time to get things right and I was able to make a small program which animated a multicolored triangle. The rotation of the triangle is controlled by the mouse.
The beautiful thing about it was I was able to compile and run the program in both Windows and Linux without a single modification. Neither did I run into any trouble during the build process. Here is the source and Windows executable. Call me crazy, but I then tried to run the Windows executable in Linux through wine and it worked again.

Thursday, July 21, 2005

War of the worlds

I had heard that "War of the worlds", Steven Spielberg's latest offering, was not upto the mark. They were all wrong. War of the worlds is in fact a well paced sci-fi movie. It has the common theme of aliens attacking the planet, but it separates itself from the others by showing that: In the face of danger not everyone can act as a hero and/or think morally. The graphics and sound effects are really nice. And yes the big alien machines did look like the striders of Half-Life 2 (look below).



Tuesday, July 19, 2005

Counter Strike

After a long wait, our house has been blessed by Counter strike Condition Zero (shame on you if you haven't heard about it). Now follow the sleepless nights with all the screaming and shouting, with gun fire in the background.

Monday, July 18, 2005

Seminars

So, I was sitting here happily thinking that no one would have done a seminar on DoS (Denial of service not MS-DOS), turns out that one person of the very first batch (1997) of CS CUSAT had done it. As repetitions are not allowed in our department, my seminar topic would be rejected. But, interestingly I could find a lot of topics which have been repeated, in the register.
I also recieved our seminar guidelines. Apart from the usual ones, I found the last one amusing.


5. Refreshments: Arrange for some refreshments during the seminar session
(Preferably tea/coffee +snacks) . Expenses should be met by the four persons taking the seminar on that day.



Sunday, July 17, 2005

Efforts to create acceptable programs.

In a previous post I said that I will try to create stand alone python appilcations. So, I tried and failed. But the one thing which I did find out, was that when you try to create a standalone program (which basically means that you won't be needing python for it to run) you get a really bloated final package. The executable may be small, but the other pyd, pyc and dlls really take up a lot of space. The unfortunate part is that the python interpreter is not as popular as the JVM, so you have to try and create a standalone program for a larger target audience. The other alternative I guess would be to use Jython, to create bytecodes out of programs and run them on a JVM.
Talking about Java, I managed to find a blog entry of John Carmack (The guy who made the graphics engine of wolf, doom, quake, quake 2, quake 3, doom 3 etc) about his latest endeavor to make a doom-rpg on a cell phone. He talks about how Java restricts the speed of execution of a program. An interesting read.

The infinite mokey theorem

The infinite mokey theorem states that almost surely (i.e. with probability equal to 1) a monkey hitting keys at random on a typewriter keyboard will eventually type out the collected works of William Shakespeare.
So, does it really happen? Some people (who had spare PCs and spare time) tried it out. This quote from the wikipedia article

""In 2003, scientists at Paignton Zoo and the University of Plymouth, in Devon in England reported that they had left a computer keyboard in the enclosure of six Sulawesi Crested Macaques for a month; not only did the monkeys produce nothing but five pages consisting largely of the letter S, they started by attacking the keyboard with a stone, and continued by urinating and defecating on it.""


Come to think of it maybe even before "infinity" occurs, the monkey(s) could actually evolve into a more intelligent lifeform and then take over the world.

Friday, July 15, 2005

Game programming

I had been reading a few articles on gamedev, as well as reading the Black Book of graphics programming by Michael Abrash (and yes, penny arcade too). The thing which sets game development apart from other areas of development in CS, is that it has almost a little bit of everything.
Here is something which I dug up from an article in penny arcade.

"You have to understand, game programming is the hardest type of programming there is (although my friend Epistax claims that advanced accounting software is), and it makes perfect sense: while ordinary software has a very specific goal, games create a world, an experience, a virtual reality, and therefore incorporating a little bit of each programming domain: AI, graphics, database, math, optimization, etc. That will take more lines of code, more art sketches, more music... I really didn't think such a commitment could ever be achieved by me. But all that was about to change..."

Tuesday, July 12, 2005

The First class

Today was the first day of the 7th semester. I did a fabulous job of turning up late to class. We didn't have much of studies. We were given a list of our graphics lab cycle. The unfortunate part is that the lab will be done in Turbo C++, which I consider as outdated. We will be using the BGI library for our programs. It would have been nicer if he had some exposure to something like openGL. Some of the programs given involved animation.
I wrote a program which simulated a ball (gravity and stuff). It is written in python using pythoncard. Source can be found here and the resource file can be found here.
Unfortunately you need python, wxPython and pythoncard to run it. I guess I will try to write a standalone application next time.

Sunday, July 10, 2005

A GUI for the SuDoku solver

At the request of Sourav, I have made a GUI for the SuDoku solver using pythoncard. The source code can be found here and the resource file is here. You will be needing python, wxPython and pythoncard to run it.
The GUI code is not pretty as this is my first day with pythoncard but it works all right.

Tuesday, July 05, 2005

A little bit of programming

I managed to dig up another programming challenge site which promises to be good : mathschallenge.net. I was able to solve a few of the problems with my new found knowledge of python.

Saturday, July 02, 2005

Back to square one

I returned from Delhi to Cochin today. The two days of travel were not too uncomfortable given the fact that I was coming in AC and I had Venkat, Vikas, Siddharth and Sumit for company. Patni is in the campus today and as I speak Anshul and Addy have gone to give the GD. My lab exam is on 6th and I came to know that the college will open on 11th *damn* .

Monday, June 27, 2005

The Su-Doku solver improved

I improved the Su-Doku solver by adding some recursion and backtracking. It can now handle the really ugly puzzles which require backtracking. It can also solve ambiguous puzzles which can have more than one solutions. I am proud of it :)

Sunday, June 26, 2005

A nice busy day.

I woke up to rain today :) which was a nice change after so much of heat. I had to go pick up Dad from New Delhi railway station in the morning. So I got to take out the car and go all the way till there, with mom. Dad's train was around half an hour late due to the rains. We had an "extended breakfast" at some restaurant in CP and then left for Lajpat Nagar to do some shopping. I got myself some shorts and t-shirts. Mom ended up buying a salwar suit for Rs 1,399 because when she saw the price tag she though that it was only Rs 399. We reached back home at around 2pm. I had my Lunch and left for Center Stage Mall (Noida) with my friend Rakesh to watch "Kung-Fu Hustle". It was not too great, the stunts were good but no story as such. After that we went to Superstars. It was pretty nice.

Friday, June 24, 2005

Su-Doku Solver

I was first introduced to Su-Doku a few days back by my friends Sujit and Addy. It was a daily feature in one of the newspapers: The Hindu. It is a placement puzzle and each puzzle could have only one solution. I could do the puzzles but it took me around 1/2 an hour to finish them. Now, this is good if you want to kill time and it helped me during the long tiring train journey from Cochin to Delhi in June 2005. On the train I was wondering that it would be pretty easy to write a program which solves the puzzle.


When I reached Delhi I started learning Python, mainly because the language intrigued me and there were a lot of people ( Eric. S. Raymond and Bruce Eckel to name a few ) had given it a thumbs up. Now it has been around 3 days since I started learning it and I must say it is a beautiful language in it's own rights.


So, I wrote a Su-Doku puzzle solver today in the evening of 24th June because it was too hot outside and I wanted to learn python.


Here is the python code. I have just used two test cases for it, which can be found here and here.

[update 25th June] The solver is in fact broken. I guess I should have used more test cases. It solves easy puzzles but gets stuck in some of the medium to hard puzzles. I will try to get it working for them also.

[update 25th June]Took care of the problem. Now it is solving the hard and medium puzzles also. I will feed it some more test cases before announcing success.

Thursday, June 23, 2005

Rahul's PC

Rahul's PC
Rahul's PC,
originally uploaded by [Rohit].
The cabinet has a giant fan inside which can be seen throught the window and imported blue case lights. The car on top of the monitor is a scaled replica of a Nissan Skyline. The other frills are: a wireless mouse, a bluetooth thingie, altec speakers and a nice graphics card.

Wednesday, June 22, 2005

Delhi heat

So the days are passing by without me getting too bored. I go and play basketball early in the morning at our school. Sleep or try to learn a bit of python in the afternoon. Evenings are again for excursions outside the house with friends. Thats about it.

Sunday, June 19, 2005

Back at Delhi

I reached Delhi yesterday evening. The train journey was pretty tiresome due to the heat. Temperatures here are soaring. I got to meet most of my "old school" friends yesterday itself. I will have to book my return tickets fast as they too are drying up in the heat (whatever).

Wednesday, June 15, 2005

Exams over once again..

I finished up my 6th semester exams today. Today's exam (control systems) was not that great though. The paper was tough and I made some silly mistakes :( .
I leave for Delhi tomorrow. I hope to have some fun there although I don't have too much time ( The college reopens on 1st July *damn* ).

Monday, June 13, 2005

Last one..

I had my Microprocessor exam today. It went ok. I got soaked in the rain while coming back. The last and final exam is Control Systems Engineering two days from now. I just hope it goes of well. Then I am of to Delhi the next day.

Saturday, June 11, 2005

Nearing the end..

of another semester exam and you get the same feeling all over again. Yep, not in the mood to study. Two more exams to go. When will wednesday come??

Wednesday, June 08, 2005

An AJAX hack gone bad...

The latest buzz over the web these days is AJAX aka XMLHttpRequest . I thought I should at least try to find out what it is, so I somehow managed to dig up this site . There are two files client.html and server.php which demostrate AJAX. Now what is interesting to note is, that the "server" need not be a PHP etc file as long as what it spews out is XML.
I thought this can be used to somehow serve content remotely. Suppose you have a web site and are running short of storage space, which is obviously expensive. What you could do is store your HTML document in an encoded format in one of the free web hosts found over the web and use XMLHttpRequest to fetch the page for you. Thus you don't need to worry about the ads of the free web hosting site (ads are placed on HTML documents and we will be using a text file).
The encoding could be the one like which we have at osix, meaning using a '[' and ']' instead of a '<' and '>' for html tags.
For an example check this

The client will request for the document using AJAX and then parse it, basically replacing each '[' and ']' with a '<' and '>' and then display the page by (maybe) using document.write .

It looked to me that it will work and it even did when I tried it locally on my PC. But unfortunately when I try to do it over the internet it doesn't work. In my case I uploaded the client over at geocities and the server (the document which has to be served, rather) here at osix. But when I run the client nothing happens. Is it because the request is coming from another domain name ? If I keep both the client and server in the same directory at geocities it works.

Anyone know what is going wrong. Is, what I am trying to do even possible??

Monday, June 06, 2005

Random thoughts

I have my Operating Systems exam tomorrow. Although it is not a tough paper, the amount of stuff we have to study is quite extensive. Hope it goes well..
I wrote another article. I guess I am getting a bit bored of all the exams, even though only one is over.
Slashdot had an article about a guy making a home brewn CPU. Pretty cool.

Saturday, June 04, 2005

Pi

So, Rahul was telling me about Super PI a few days back, it basically allows you to calculate the value of PI upto a really large amount of precision. On my machine (Athlon XP 2000 + with 256 Megs of RAM) it took 1 min 26 seconds to calculate till 1 million (it can calculate upto 32 million max). Here is what is looks like.

Thursday, June 02, 2005

Summer of code??

Google announced the summer of code a few days back. I would like to participate but I don’t know if I am upto the mark and with exams going on I really don’t know if I will be able to churn up any good ideas for a project.

Exams started

My exams have begun. Today it was DSP for me. The exam went fine for me. The EC guys got screwed as they had a relatively tough paper. Next exam is OS on 7th. I will start studying for that in a few days... (hopefully).