Download all xkcd comics in one go…specially for xkcd fans

Long time no blogging and again now with a new piece of code just for xkcd fans.. I am a big fan of it and love reading it when I get bored. This sunday I thought how good it would be to have all the comics on my hard drive however I had one little problem that is there were around 700 comics in all together and I had no patience to get them by right clicking it. So I decided to write a small snippit for it too and put it on my blog.

The pages in xkcd are in the format of http://xkcd/<some number>/. What I did was navigate through all the pages and extracted the link of the image using a simple regex. After extracting the hotlinks of the images, I downloaded them to a folder.

Get the code from here

Now compile the code using javac and run it using java. Please note that all the images would be stored in the directory in which the compiled script lies and yes make sure you have got a working internet connection. Once you start it sit back and relax.

My script with a little modification can be applied to a lot of other sites too like onemanga etc

Disclaimer : I dont know whether it is legal or illegal so if anyone has any objection towards my script please leave a comment saying so and citing proper references


A typical day at a Govt Office

A guy xyz is very interested to move into his first day of his job. With full enthusiasm he leaves his home and reaches his office on time. On reaching there he finds the office is as silent as the graveyard except for the usual snores of the watchman. He wakes him up and asks when would others come and he gets a honey coated reply, that the rest of the employees would be coming any moment now. The young man waits on for another hour and then the room starts filling in.

As it was his first day of meeting, he meets his boss and asks him for his assignment. The boss says, “Tum hi woh nahe bache ho naa… ek kam karo aaj tum aaram karo shaam ko meeting hai, meeting aatend karo udhar hi tumhara hum baaki logon ke saath parichay bhi kara denge aur tumhe kaam bhi de denge.. Tumne koi chai naashta kiya ki nahi..”. After this dialogue the boss asks for tea for both them and speaks to him about his family and all the worldly things except work. By the time, they are over with their talk its lunch time and so they leave.

The meeting as the boss said was scheduled after lunch and once again the young man out of habit was on time for the meeting and the other employees again by sheer habit were late as usual. The young man for the first time was attending a meeting and expected to find some work related talks to be going over there but instead he found that people were more busy in speaking about their family affairs and discussing the last night parties they had and the new movie which was released the last week. An hour later, the young man’s immediate head arrived and called out to everyone “Dekho bhai log ye naya bacha aaya hai aur ise kaam chahiye kisiko koi kaam dena hai to ise de do “. The other people in the office looked at him, chuckled and then continued with their talks. Thus the meeting was over with all the people having tea and snacks and the young guy being totally frustrated and pitying himself at the kind of place he landed himself upon…

C++ brainteaser

Today one of my friends came to my room to ask a doubt in C++

The he came up with was a very simple one but had a very interesting solution and exhibited the difference in the computations of 32 bit and 64 bit processors and had literally taken us to a stand still

The Code was:


void main()


int i = 0;

i = 400*400/400;




This was the piece of code, and would like as many people to think about it and give answers with reasons.

1 2 3 4 5 6 7 8 9

Well a curious name for my blog isn’t it but like the Unix time a weeks back we are going to one more interesting pattern again on August 7 this year, the time and date will be

12:34:56 07/08/09

1 2 3 4 5 6 7 8 9

This will never happen in your life again.

So made a blog entry of it

Rubik’s 360

Well by now everyone has seen RUBIK’s cube but now Erno Rubik has come up with yet more challenging exercise RUBIK’s 360

The puzzle involves changing the position of six balls, each a different color, in a central sphere to six compartments in the outer sphere. This is done by shaking them through a middle sphere that only has two holes. There are three spheres that make up the puzzle. It has only one solution