Wednesday, June 06, 2007

I got my copy :-)

This is my first post related to my SoC.
So let me just introduce things.
I am doing Google Summer Of Code under Mozilla Foundation . My mentors are Nagappan from Novell, Bangalore and Emily Chen from Sun, China.

When i started working for my SoC, i got a mail from Google SoC team saying
"Hello everyone,

In keeping with last year's tradition, we will be sending a surprise
to all students. Last year we sent a cool Google notebook (complete
with paper legacy interface), and this year we have something even
cooler in the works.

If you really feel you must, go ahead and start a barrage of "I wonder
what it could be" posts to the list. But please don't. You'll have
the ultra-cool surprise in hand soon.

One final reminder, when you get your surprise, please don't tell the
rest of the world until June 4, 2007. We'd like to keep it a surprise
for as many folks as possible.

After that, by all means blog, post, etc. :)

Cheers,
LH "

The moment someone tells you that you are going to get a surprise, you start thinking only about it and nothing else. :-) . And of course i am no exception. All i knew was it is a book signed by its author. There is long discussion in the Google soc group guessing whether it can be Linus or someone else.

Finally i got the book few days back. It is
Producing Open Source Software: How to Run a Successful Free Software Project by karl fogel.

Wow :) i never thought just a book will make me so happy. This is the first book i have ever got which is signed by its author :) and i felt so happy that i can't describe it here :-)

I really can't wait to get back to college so that i can scan the first page ;-) and put it up here. Man, just a simple signature with a text saying "Happy Hacking" but whenever i see it ,makes me feel happy and proud :-).

And yes, the best part was that the author was kind enough to post a blog about it. So if you don't believe what i am telling you, check out his blog about the book here.

The review about the book in one line. "The more i read it, the more i love it." There are many places where the author has taken care to give appropriate examples, funny incidents, etc.

Finally
Thanks a ton for Google for such a nice idea. :-)

Tuesday, June 05, 2007

Oath for Software Engineers

Never write a line of code that someone else can understand.

Make the simplest line of code appear complex. Use long counter intuitive names. Don't ever code "a=b", rather do something like:

AlphaNodeSemaphore=*(int)(&(unsigned long)(BetaFrameNodeFarm));

Type fast, think slow.

Never use direct references to anything ever. Bury everything in macros. Bury the macros in include files. Reference those include files indirectly from other include files. Use macros to reference those include files.

Never include a comment that will help someone else understand your code. If they understand it, they don't need you.

Never generate new sources. Always ifdef the old ones. Every binary in the world should be generated from the same sources.

Never archive all the sources necessary to build a binary. Always hide on your own disk. If they can build your binary, they don't need you.

Never code a function to return a value. All functions must return a pointer to a structure which contains a pointer to a value.

Never discuss things in concrete terms. Always speak in abstract. If they can understand you, they don't need you.

Never complete a project on time. If you do, they will think it was easy and anyone can do it and they don't need you.

When someone stops by your office to ask a question, talk forever but don't answer the question. If they get their questions answered they don't need you.

Load all sentences either written or spoken with alphabet soup. When someone asks you out to lunch, reply:

"I can't because I've almost got my RISC-based OSI/TCP/IP client connected by BIBUS VMS VAX using SMTP over TCP sending SNMP inquiry results to be encapsulated in UDP packets for transmission to a SUN 4/280 NFS 4.3 BSD with release 3.6 of RPC/XDR supporting our ONC effort working."

Never clean your office. Absolutely never throw away an old listing.

Never say hello to someone in hallway. Absolutely never address someone by name. If you must address someone by name, mumble or use the wrong name. Always maintain the mystique of being spaced out from concentrating on complex logic.

Never wear a shirt that matches your pants. Wear a wrinkled shirt whenever possible. Your shirt must never be tucked in completely. Button the top button without wearing a tie. This will maximize your mystique.

Sunday, June 03, 2007

Hols are bad for health

Well, i never thought i will ever say this but really
"Hols @home sucks".
This is the first time i am actually staying at home after joining college (was lucky enough to keep myself busy with something or other during hols :-) ) and i never realized it will be so boring :(.

Not that i don't like my home but i simply miss college.
Even though i chat with my friends 24*7 , i simply miss people . The best part about being with a group is that you don't have to do everything alone. You're with your friends. Working alone is really not the kind of thing which i would like to do and now i have to work all alone. Wish college reopens soon ( even if reopens tomorrow, it is fine with me :-) :-) )

This quote is so true

Just as a puppy can be more of a challenge than a gift, so too can the holidays.
John Clayton

Wednesday, May 23, 2007

Coding Style ...

I have never thought much about coding style before i did my NOSIP in Novell. But once i started coding for ldtprecord, according to the coding style suggested to me by nags, i was surprised to see how nice and neat the final code looks.

Some tips/tricks for nice coding skills are,

1. Do spend some time to think about the variable names and the function names. This sometimes might be bit boring, especially when you want to concentrate much on the program logic and performance. But this is Rule 0 for coding conventions. A variable name "k" can imply anything like "kappa, kozhukattai, katthu, kaadhal, kerala, kozhuppu..." to someone who might have to read your code later. This is again mentioned here clearly. Many thanks to emacs, you can always use the auto complete, if your variable name is too long. :-) .

2. The actual coding convention depends much on the language and the standards your team is using already. The following style won't work for someone, whose team is already using a totally different style.

A few examples for C is posted here .

Sample Code 1 :

if (a == 5) {
    b = 10;
}
else {
    b = 20;
}


Things to be noticed in the above snippet are.

1. A space between if and "(" .
2. Space in both the sides of the comparison operator.
3. Space between ")" and "{"
4. Space between both the sides of assignment operator (line 2 & 5) . This is true for almost all the operators.
5. Proper indentation of lines 2 & 5. If you are using emacs or vi, check here for your .emacs or .vimrc file .

Well, your code will compile and run even if you don't give these spaces, but a program coded with a bad coding style is equivalent to an inefficient code.

Sample Code 2

Let us have a function which takes two integers and returns their sum .
The code should be like

int add_numbers (int num1, int num2) {

    return (num1 + num2);
}


The function call will be something like,

int sum;
sum = add_numbers (10, 20);

Things to be noticed in the above snippet is

In the first line in the function declaration,

1. The function name should be as clear as possible.
2. A space between the end of function name and "(" .
3. Spaces are given after every "," in the function argument list.
4. A space is given between ")" and "{".

In the second line in the function declaration,

1. A space before "(". [ This rule is almost global. Apply it everywhere whenever you use "(" ] .
2. There is a space on both the sides of the addition operator. This is again almost global. A space between both the sides of operator makes the code look real neat.
3. The indentation about which was mentioned earlier.

But yes, if your girl friend is a geek or a nerd or a psycho or a fundoo, then you better go for this. ;-)

#define MAGIC "eilouvy43605321"
#define _(p,o,q) (t o#p[0])?(q)
#define __(p,o,q) _(p,o,t-q)
int main(){int t, i; for(i=8;i>0;i--)printf("%c", MAGIC[(((t=(MAGIC+7)[i-1])=='_')?62:_(.,==,63):_(@,==,64):__(a,>=,'a'+36):__(A,>=,'A'+10):(t-'0'))]);}

Note :: I wont say the coding style i use is the perfect one. It always depends upon what your team was using till now and how easy it is to read, debug and maintain the code.

Useful Links :
The guide coding standards in GNOME is really a nice one.
Even better was this one i found recently. Though i didn't read it completely, it was quite interesting.
This article was short and sweet.

Monday, May 21, 2007

Feel My Pain...

One day in heaven, the Lord decided He would visit the earth and take a stroll. Walking down the road, He encountered a man who was crying.

The Lord asked the man, "Why are you crying, my son?" The man said that he was blind and had never seen a sunset. The Lord touched the man who could then see and was happy.

As the Lord walked further, He met another man crying and asked, "Why are you crying, my son?" The man was born a cripple and was never able to walk. The Lord touched him and he could walk and he was happy.

Farther down the road, the Lord met another man who was crying and asked, "Why are you crying, my son?" The man said, "Lord, I am an engineer."

...and the Lord sat down and cried with him.

Sunday, May 20, 2007

PODWORKS.in

India's Biggest Event on Audio & Video Podcasting

Date: June 9 & 10 (Saturday & Sunday)

Venue: Tidel Park Auditorium, Chennai.

Cost: Rs.200

Alagappan designed banners saying I'm Attending Podworks.in and I'm speaking at Podworks.in. You can grab those here.

PodWorks is an ideal place to learn how to start your own podcast or to discover the latest tips and tricks for taking your show to the next level. The presentations offered will cover the whole spectrum from content production, technical how-to, business podcasting, marketing and monetization. Each session is an exchange of ideas.

I am really looking forward for this event, coz apart from the podcasting , it will be a re-union kind , where i will be meeting alagappan :) :) . Infact that's the main reason why i am attending this ;-)

You can register here and make the event a big success :)

Friday, May 18, 2007

Hello World ...

I love Hello World programs.
The reason is simple. Whenever i code a hello world, it means i am learning something new. I once found a huge collection of hello world programs here.

And yes, i did a hello world program today. It is related cluster programming using MPI . :-) .

The code for the hello world

#include <stdio.h>
#include <mpi/mpi.h>
int main(int argc, char *argv[]) {
int err;
err = MPI_Init(&argc, &argv);
printf ("Hello World\n");
err = MPI_Finalize();
}

Since i dont have a cluster at home, i had to simulate a cluster. That can be done using the mpirun command .

hari@home:~/spider/cluster$ mpirun -np 3 a.out
Hello World
Hello World
Hello World
hari@home:~/spider/cluster$

For the first time, this asked for my password 3 times ( the number of process i mentioned ) . After that i created a keygen for myself and then things went fine . But it took a long time when i gave the number of processes as 100 .

Planning to code for a fractal using MPI in my free time :) .

Wednesday, May 09, 2007

Life ...

Life is a beautiful poem with so many pages of lyrics written on every page. It depends on whether you sing a song with it or think it as a greek stupid probability junk and leave it .
I am gonna sing :-) :-)

Thursday, May 03, 2007

Seg Fault

Wikipedia says,
A segmentation fault (often shortened to segfault) is a particular error condition that can occur during the operation of computer software. A segmentation fault occurs when a program attempts to access a memory location that it is not allowed to access, or attempts to access a memory location in a way that is not allowed (for example, attempting to write to a read-only location, or to overwrite part of the operating system)."

I have seen hundreds and hundreds of seg faults ;-) while coding for record module of LDTP and Spider SMS. But the one i saw yesterday was new, strange and fascinating. I am not sure whether i will be able to reproduce it again. The screenshot says why it is strange and fascinating :-) .




-bash-3.1$ man su
says

AUTHOR
Written by David MacKenzie.

REPORTING BUGS
Report bugs to <bug-coreutils@gnu.org>.


Maybe i should consider reporting this :P .

Saturday, April 28, 2007

Kelaaaaaaaa

Few days back got a message from one of my friend saying ,

Hey i sent you many messages but i have not received even a single message from you . So i will delete your number ... gud bye ...


Well i was kind of shocked and surprised to get such a message since she was one of my best friend . I checked my inbox after i got this message and found no new messages . Cursing my bsnl network n times and the ECE enginner who would have desinged my mob another n times , i decided to call her and explain what happened .

I called her and was kind of surprised to see her laughing. I asked her ¨What happened ?¨
She asked me to read the message. I was about to explain her what happened, but something sounded fishy. So i told her that i will do that and this time the message said

Hey i sent you many messages but i have not received even a single message from you . So i will delete your number ... gud bye ...


Sardar sends this message to customer care ;-) Be cool Good evening .

Note :: A big time Kela but seems even she got it when she got the message ;)
So no probs :) :) . "Memories saved" :) :)

Friday, April 20, 2007

Gift time :) :)

Gifts are always fun :)
Finally i managed to give a nice senti gift for alagu.
It was a small painting, but a nice one :)
But better than the painting is the small C snippet which we wrote for alagu

It goes like this

#include <lrsl.h>
#include <kadalai.h>
using namespace freenet;
#define work fun
#define alagu YAHOO MAN
int main () {
int gujjala, gujjalambal, lab :)
string alagu[] = { "deltaman",
"npiuman",
"Yahoo !! man ",
"dealboy"
};
cout << "It is fun to have you in sunlab !! ";
cout << "We will miss you !!! " << endl;
}


That says it all :) .
I will surely miss him next sem :-( :-( :-( :-( :- ( .....

Thursday, April 19, 2007

The meeting starts at 8 ....

"Punctuality is the art of guessing how late the other fellow is going to be "
I have admired this quote many a times . :-) :-) . Infact it is one of my fav .

Today i got a message saying
"Hey..Dulta meeting today.. At 8pm .. Sun Lab ..Every1 must come.. So be there.. !

Being confused about whether i am a dulta member or not, i finally decided to attend this meeting . Not because i decided to work dulta, neither i am afraid about chucked out of dulta , but i was jobless and anyway i will be in SUN lab working for my SOC. So i did not mind attending the meeting .

But things went really great . I never realised that the 8 PM is "dulta's 8 PM" . And just today i came to know that there is a timezone difference of 30 minutes between IST and Dulta's Time :) :)

I went to sun lab at around 7.45 (foolish me) and started coding for LDTP in the SUN systems. Yazhini,
Padmini and Deepak Kumar Jha came there on time (all three compsci's ) . Some 10 mins after that , Nitin (a prod guy ) came to me asking whether there was a dulta meeting there or not ? .

I was really really curious to know who sent that message. I really hoped that DK sent that message ( he was the only senior present there ) . But seems he did not send that message . Finally i asked yazhini and padmini not to waste their time and they went back to their hostel by 8.30 . DK also went to room saying that he has to finish his English report.

Finally "the man" who sent that message came exactly at 8.35 :) :) . I expected him to say a sorry to the members waiting there . But again i was surprised to see him to start directly as
"Ok everyone check http://dulta/info and i want it to be nitt.edu by tonight . Think we have to work tonight blah blah blah blah ...".

I also like this quote
If I have made an appointment with you, I owe you punctuality, I have no right to throw away your time, if I do my own.
Richard Cecil

I really wish these people learn this someday soon .

But yes , i learnt some new stuff from this strange experience .
1. Dulta is always waste of time.
2. Never ever make anyone wait for you.

Saturday, April 14, 2007

Two stories :)

This is my blog and i have all rights to crap here . This blog may appear as total crap for few, may mean more to few . I really don't care what you are gonna think about me after you read this .

Read the following two stories

Story 1
Once upon a time , there was a crow and a fox . Both of them were hungry and the crow somehow managed to steal a vada from a paatti . It flew to a near by tree and planned to eat it there . This fox was very cunning and planned to steal the vada from the crow . It said all nice nice things about the crow and asked it to sing a song . The crow started singing kaka and the vada fell down . Fox ate the vada and ran away .

Moral of the story
Dont bring the vada outside the canteen and don't sing while eating a vada.

Story 2
Once upon a time there lived a crow . It was very thirsty . It searched for a water everywhere but could not find water anywhere . Finally it found a pot with very little water . But the water level was too low for it to reach . But this was a clever crow and saw pebbles lying around the pot. It dropped these pebbles into the pot one by one and slowly the water level rose. The crow drank water and flew away happily

Moral of the story
Dont know :)

Friday, April 13, 2007

My Seniors :) :)

Again i was jobless :P googling something arbit , when i saw the "I am Feeling Lucky" button in google.
It is one of the features in google which i have never used. I always prefer seeing the list of search results and click atleast 10 of them :P

But it made me think for a moment . Am i lucky. And the answer is "YES" .

Why should i be feeling lucky ???

I think i have got the best seniors one could ever have . They are friendly, simple and spending time with them , anyone will have loads and loads of fun :) :) :) . And yes they are real "fundoos" who has done amazing things during their college life :) :) :)

And the best part is i never felt anyone as my senior. They are actually my "best friends".
The list goes like this .

Satya Madhav Kompella (Madhav)
Met him in my first year . Taught me C and C++ in the cry classes :) . A real fundoo but simple down to earth . Wish i could meet him sometime
Shankar Ganesh (Shagan)
My LDTP senior :P . OMG . This guy surely rocks . FUN FUN FUN . That's all i had when i spend time with this guy.
Manu (Manu)
Learnt a lot from him . An ideal senior :) . Mr . Perfect in everything. Only kandu without a GF in college :)
Allagappan Muthuraman (Alagu)
Helped me learn lots and lots during my second year in lrsl . :) He is really an amazing guy
Manas Garg (Manas)
My Spider senior . God . That explains everything :)

Note :: Sorry for few mistakes in the blog :P . I wrote this one in prasanna's algorithmic tricks class and obviously you tend to make mistakes when someone is disturbing you with dfs , bfs , dp etc :) :) .
So got confused betweeen a mallu and a kandu :) :)
And yes , i should have put "AJAX alagu" there , that would have made things clear :P

Thursday, March 15, 2007

Shutdownday :O



This is what www.shutdownday.org says
--
It is obvious that people would find life extremely difficult without computers, maybe even impossible. If they disappeared for just one day, would we be able to cope?
Be a part of one of the biggest global experiments ever to take place on the internet. The idea behind the experiment is to find out how many people can go without a computer for one whole day, and what will happen if we all participate!
Shutdown your computer on this day and find out! Can you survive for 24 hours without your computer?
International Shutdown Day
--

I voted for "I Can" , though i have no clue what i am gonna do on that day.

Hmmm , maybe sleep , spend time chaating with friends. I just hope i dont go mad after few hours without computers :P . Cha without computers no movies, no coding , no songs , no games , no browsing :( :(

I am planning to shutdown few servers under my control . Let us see how it goes :) :)

Friday, February 16, 2007

I hate CT's :(

In examinations, the foolish ask questions the wise cannot answer
---Oscar Wilde

Wow , this suits my college cycle tests also . The one and only thing which i hate in my college is CT's :( :(.
Those 3 days ,
I try to read something and end up sleeping the whole day.
I think that i wont go to octa, end up making a night out there.
At the end i always find that i have never read the syllabus even once and wont be able to finish the full portions :)

And this time i noticed that some of my friends who are real padipps were also getting frust coz of CT's

Some of the messages or quotes which they mentioned during their peak of frustration .

1. Dude , tell me one thing . Why do i feel so sleepy when i try to study and never when i'm in lab ?

2. It is study time :( i mean sleepy time ;)

3. Aah i never disliked studies so much

4. Cycles prep Aa? It sucks !

5. :( :( I'm going to himalayas. No more CT's in my life.I will take lots of food stuff, eat and roam aroud there.

6. CT SUCKS

7. If there were one more CT, i would have killed one of these prof and gone to jail..

8. Lets kill mala, then they will postpone the CT's

9. Lets mail Bush that Osama is hiding in CSE dept . He will bomb the dept and they will cancel the CT's :)

The list is long and i cant post everything here . God save these frust people. Save me from my dept :) :)

Monday, February 05, 2007

The end of internet

Was checking out the settings of google reader and found this quite interesting .

The next bookmark is an innovative way to read your subscriptions. It allows you to use Google Reader through just one link - clicking on it takes you to the next unread item, marking it as read in the process. It is particularly useful for subscriptions which only include snippets or when you want to read an article in context.

But when i clicked the tab i got a page saying

I myself dont believe in end of internet and the page was not the end of the internet , since that page still had a link to some other page . The links said it all
http://www.shibumi.org/eoti.htm

The contents of the page (for those who dont want to go to end of the internet )
The End of the Internet
Congratulations! This is the last page.
Thank you for visiting the End of the Internet. There are no more links.
You must now turn off your computer and go do something productive.
Go read a book, for pete's sake.


Tuesday, January 30, 2007

Forgot mysql root pass ?

Recently forgot mysql root password for one of the servers i maintain . Little bit googling helped me to reset the password .
Just copy pasted the tutorials i saw so that i need not google again .

If you have set a root password, but forgot what it was, you can set a new password with the following procedure:

  1. Take down the mysqld server by sending a kill (not kill -9) to the mysqld server. The pid is stored in a `.pid' file, which is normally in the MySQL database directory:
    shell> kill `cat /mysql-data-directory/hostname.pid`
    You must be either the Unix root user or the same user mysqld runs as to do this.
  2. Restart mysqld with the --skip-grant-tables option.
  3. Set a new password with the mysqladmin password command:
    shell> mysqladmin -u root password 'mynewpassword'
  4. Now you can either stop mysqld and restart it normally, or just load the privilege tables with:
    shell> mysqladmin -h hostname flush-privileges
  5. After this, you should be able to connect using the new password.
Alternatively, you can set the new password using the mysql client:
  1. Take down and restart mysqld with the --skip-grant-tables option as described above.
  2. Connect to the mysqld server with:
    shell> mysql -u root mysql
  3. Issue the following commands in the mysql client:
    mysql> UPDATE user SET Password=PASSWORD('mynewpassword')
    -> WHERE User='root';
    mysql> FLUSH PRIVILEGES;
  4. After this, you should be able to connect using the new password.
  5. You can now stop mysqld and restart it normally.

Friday, January 19, 2007

Quiz is finally over :) :)

If at all if someone gives me the right to scrap three events from pragyan i will surely opt for junkyard wars, technical quiz and udaaan . These three are actually very good events when you are a participant. But when if you are the one who is responsible for the quiz software for these events, that too with all three events starting one after another , surely you will go mad.

Everything started when i made a foolish decision to attend a delta meeting . The meeting is to discuss about delta induction. I was trying to make a quiz manager at that time ( inspired from manu's quiz manager ) and thought i will do one for delta induction, which can be used for pragyan also . ( never realized this was such a big blunder ) . Somehow managed to changed few things in manu's code and finished the delta inductions.

The whole headache started few days before pragyan . All three event manager contacted us few days before their events. Actually i was kind of shocked by what they asked me . One wants a timer while the other says i dont need a timer :( :( . Err what is your fscking problem if there is a timer :(.

The worst part i did not code a single line in the pragyan quiz manager :( . It is coded by one of my junior and i saw the code just 3 hrs before the event. Of course i went mad , called up my junior every now and then asking to explain about what the code actually does.

Finally junkyard wars started 4 hrs late , udaan 5 hrs late and tq some 14 hrs late :P

Took a resolution that will never take up any more work in pragyan :( .

Tuesday, January 16, 2007

Pragyan '07

The big event is gonna start soon !!!

"So where will you be from
February 1 - 4 ?" .

Thats what the website says :).

I am doing bytecode and quiz management this time :) . Bad that i could not do anything for dalal this time :( .