Thursday, November 03, 2005
Rahul's Birthday
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
The auxillary slashdot effect
The color of lights
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
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
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
Saturday, October 29, 2005
The (computer) gods must be crazy
Thursday, October 27, 2005
Battlefield
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.
Wednesday, October 26, 2005
One hot Cappuccino (before)
Tuesday, October 25, 2005
7th semester almost over
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
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
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 continued

Wednesday, October 19, 2005
Fork bomb
#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
The Big G
Sunday, October 16, 2005

Saturday, October 15, 2005
Pacman map editor
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

Friday, October 14, 2005
Obfuscated code
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
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...
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.

Monday, October 10, 2005
Shed skin
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
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
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
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
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
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
Friday, September 30, 2005
The Anatomy of a Search Engine
Thursday, September 29, 2005
The lone rider
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
Sunday, September 25, 2005
Back again.
Sunday, September 18, 2005
A late update
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 !!!
Sunday, September 04, 2005
Confusion confusion
Among other things I feel very weak although no one believes me.
Friday, September 02, 2005
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.

Wednesday, August 31, 2005
Site statistics
Sunday, August 28, 2005
Saturday, August 27, 2005
Another logo


Wednesday, August 24, 2005
Growth in Indian Offshoring Slowing
More on Google talk
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
Dooba Dooba
Sunday, August 21, 2005
Saturday, August 20, 2005
4 KM
Friday, August 19, 2005
Heli attack

Thursday, August 18, 2005
Back from Trivandrum
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
Brother crossing a river.
Sunday, August 14, 2005
Second revision to Pong
Happy Independence day
Addy gets placed
Saturday, August 13, 2005
Black and White
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 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
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
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?
Sunday, August 07, 2005
Loungevity
Saturday, August 06, 2005
360 site feeds
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 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.
Saturday, July 30, 2005
A day of cleaning
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
Among other things I heard that all your base are definitely belong to us.
Sunday, July 24, 2005
My first game
Saturday, July 23, 2005
Harry potter - 6
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
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
Tuesday, July 19, 2005
Counter Strike
Monday, July 18, 2005
Seminars
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.
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
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
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
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
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
Saturday, July 02, 2005
Back to square one
Monday, June 27, 2005
The Su-Doku solver improved
Sunday, June 26, 2005
A nice busy day.
Friday, June 24, 2005
Su-Doku Solver
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
Wednesday, June 22, 2005
Delhi heat
Sunday, June 19, 2005
Back at Delhi
Wednesday, June 15, 2005
Exams over once again..
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..
Saturday, June 11, 2005
Nearing the end..
Wednesday, June 08, 2005
An AJAX hack gone bad...
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 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.









