some realizations…

These were some of the realizations that i had when i fell down with jaundice on september 2005. It is actually copy pasted from here. I have modified some according to what i felt.

1) home rocks!! specially when one falls ill!!
2) falling ill is a good time to figure out who are the people who really care for you.
3) the world is not gonna stop running, just coz i ain’t not participating right now.
4) there is no right or wrong decision..decisions seem right at the right time.
5) life may not work out the way I envision it, but it does work out.
6) negative emotions are just passing and not reality. don’t act on them!!
7) ‘woh lamhe’ from ‘zehar’ still rocks, even though aashique banaaya is hot!
8) never try to get in touch with old flames..the flame is out..accept it!!. Some people move on faster than other people. Though the original author says that men move on faster, but i feel that it is just a matter of who is better at “letting go” first. It can be either.
9) you get to know a lot of gud and caring friends when you fall ill.

It was a bad experience, my jaundice period. I had a relapse and the jaundice extended to a 3 month bed rest and torture. Anyways… some day down the time line, i might write down about how i fell ill, what i felt, and how things changed while i stood static.

how and why of my bullet

This is a loooong due post. Why i decided to get a bullet and how i got one…

I like bikes. And in bikes i love cruisers. Have seen cruisers from Harley Davison and from yamaha and there would be nothing better than riding one of those.

Anyways, the first bike i bought was a pulsar 150 cc. At that time it costed me 50k INR. I had a small salary and my dad financed the bike to me. So that i do not have to commute thru buses. The condition of buses in delhi is bad, very bad… The gud part was that i got my pulsar sometime in august 2002. And the bad part was that i had never driven any bike in my life till that time. Dad told me not to worry and go ahead. Welllll, so i drove the bike from the showroom to my office the very first day. Every thing does not go well all the time… so there had to be a small accident. Nothing was damaged except my leg where i got a bad bruise.

Pulsar is a gud bike and i am sure other variants of 150cc+ bikes would also be gud. I used to drive my bike at 100 kmph after the run in. Pickup was gud. And the bike was comfortable. Only problem was that at high speeds, the bike used to feel like a feather and it felt like even a small wind will blow the bike away with me on it… I had 2 accidents on the bike after the initial one and out of the two only one was somewhat major where i skid on the road and got some terrible cuts and destroyed a new trouser.

In fact, before purchasing the bike, i had a chance to take a look at bullet on some of the websites. I was impressed with it. The reason, i did not buy the bull at that time was that i was not so strong financially and owning a bullet is almost similar to owning a maruti 800. The price and maintenance come to be around the same.

After about 3 years of driving the pulsar, i had a chance to drive a bullet electra. One of my friends had got one and i just took a test drive. The bull i drove had gears on the right and brakes on the left. So i felt a bit uncomfortable driving the bull. But the best thing i noticed is the feel that comes while driving the bull. You feel different, a bit higher, something out of the world. This was the point in my life when i decided that i would need to get a bullet no matter what happens…

To start off the process i had to:

  • Do some research about what type of bullet i would prefer. There were 4 variants available, the normal bullet electra 350cc, bullet machismo 350cc, bullet thunderbird 350cc and bullet electra 500cc.
  • Get rid of my old pulsar
  • Get a finance option available for the new bike.
  • And the most major point, get the idea of a new bike across to my parents. It is difficult to explain to my parents as to why would i go for a bike at 80k when i can get a maruti at the same price.

I started off with the research and found that only machismo and thunderbird have left foot gear shift. Others had right foot gear shift, with which i was not that comfortable. Machismo and Thunderbird are almost exact. The only difference i could find at that point of time was that machismo had gas filled shock absorbers whereas thunderbird had hydraulic shock absorbers. And of course the looks were different. I liked the cruiser looks of the thunderbird, which is why i decided to go for it.

Went down to a local dealer, got a test ride and enquired about the pricing and finance options. And also a way in which i cud get rid of my old pulsar. What i got was this
Onroad price : 78k
Disk brake : 4k
finance – one time processing fee : 2k
value of old bike : 23k
Monthly EMI for 1 year : 4k

Almost everything landing into place, my final and most difficult job was to explain to my family members why am i going for a bike for 84k when i can get a maruti at the same price. With help from my sisters and some luck, my parents agreed.

So, on the 1st may 2005, i decided to get the thunderbird home. There was a bit of fun in that. I went down to the showroom and told the owner that i need to get the bike today. And that i dont care whether the loan papers are approved or not. If he can give me the bike today, then its ok, else i will move to some other dealer. At that time i wanted a black thunderbird. But the show room did not have a black thunderbird. So i took home a silver one and was promised that it would be converted to black as soon as the stocks were replenished. Gave up my old bike at the same spot. The show room owner was really confused with my being a genuine customer. So he sent a person to take a look at where i was putting up. Just in case i decide to run away with the bike!!!

Next day, i was supposed to go over and get the color changed to black and get the disk brakes installed. But most people told me that silver is a much better color than black and i also realized it. So i stuck to the silver color.

Thats how i got a bullet t’bird for myself.

There is something different about driving a bullet. You feel different. It feels as like a person instead of a bike. The thumps of a bullet sound like a heart of a person. You feel the weight of the bike, the hugeness and the heavyness. I cannot express all this much clearly in my words. In a single phrase “ITs Different!!”

Maybe some day i will own a harley VRSCD Night Rod.

I wont say anything…

You Are 72% Abnormal

You are at high risk for being a psychopath. It is very likely that you have no soul.

You are at high risk for having a borderline personality. It is very likely that you are a chaotic mess.

You are at medium risk for having a narcissistic personality. It is somewhat likely that you are in love with your own reflection.

You are at high risk for having a social phobia. It is very likely that you feel most comfortable in your mom’s basement.

You are at medium risk for obsessive compulsive disorder. It is somewhat likely that you are addicted to hand sanitizer.

Party@sunday

Had a party at one of our collegue’s place. Name’s Udit. Lives at Rohini – north delhi. Me another collegue started off to his place on sunday around 10 am. And it took us 90 minutes to reach his place. And then we came to know that we had come by the looooong way. If we had taken the shorter route, we could have reached in 45 minutes. But whatever’s done is done…

Next we sat down in his room saw and heard his home theater system that he had plugged in, saw a few scenes from James Bond movies. Had some snacks.

Here is where the story actually starts. The snacks were really very good. We had french fries, potato smileys for veggies and fish fingers and chicken lolipops for non-veggies. And there was lots of mayonese.

I just love fish. I dont know why. May-be it is the way they swim in water….

In the mean time, people were still joining us. So the final group had me, deepak, sujith (we 3 roomies), amresh, noopur, amardeep and of-course udit. Had lunch at around 2:30 pm. There was dahi-vada (with nice fillings), rajma, mutton and nutri-palak. Food was gud. The way it was served was better.

The best thing was the ice-cream. I have never tasted any better ice-cream in my life. My guess is – it had – perk, biscuit, some dry fruits and lots of things. And the taste was just great. Wish i had not eaten other food so much, then i wud have just had a few more helpings with the ice-cream.

We finished off the party with a movie “Pyare Mohan”. Another of bollywood flops. But we did not have another option, since there was no other movie at that time worth watching. It is like the saying “in a desert even the cactus is a tree” or something like “Andho mein kana raja”.

Finally, me and my roomie – deepak rode back to our room at noida via his place at naraina.

Anyways, had a great time. I had a long drive on my bullet – something around 150 kms and around 3 hrs of drive in delhi. Just a wish that this would have been on a highway and then i wud have enjoyed the drive even more…

And i know that i am not that good at penning down these types of events. But am trying and with practice like this, some day i will be a gud event writer.

A journey with mysql

It has been a long time since i wrote anything. Actually there has been nothing to write about, since nothing has happened. So, i thought why not share some knowledge about mysql. HE HE…

I came across mysql in my college days during a summer project that we did at ORG-MARG India now known as Ac Nielson. It is now the third largest market research organization in the world. There is a person over there in the IT-Department known as Mr. Sanjay Bhatia who was very enthusiast about linux. And he asked us to develop a small site. It was more of a DB entry and retrieveing information type of work. The challenge was that we had never had any experience on using linux for web development. We started by choosing apache-tomcat, jsp and mysql for developing our application. Everything gor set up fine, except we were unable to use JDBC to connect JSP to MySQL and so we gave up on mysql at that time. And shifted to PostgreSQL.

Next i encountered MySQL in my first job. And though i never had a chance to look at the administration part, mysql did a good job. I had no idea about indexes, storage engines etc etc. But we used it.

To sum it, mysql is a good db for beginers as well for advanced people. Without any knowledge of how to use mysql, we can start off with SQL queries. Enough of blah blah… lets go on with mysql.

Firstly, lets see what type of database mysql is. MySQL is an engine pluggable database. Which means that you can write your own storage engine and plug it in with mysql. Quite geeky!!!. Most common engines are MyISAM, INNODB, HEAP, BDB. New engines that have come up with mysql 5.x are FEDERATED, ARCHIVE and CSV engines. Now you would say, this is information overload. Well actually it is… My main encounter has been with MYISAM and so, to avoid information overload, we will discuss that only. Though some of the concepts that i will write may be cover up the whole of mysql

What is MYISAM? Well, it is the default and legendary storage engine of MySQL. Here, each database is a directory and each table is divided into 3 files namely
.frm -> table structure
.MYD -> Data
.MYI -> Index

MyISAM tables are generally OS independent. So if you need to copy a table from one m/c to another all you need to do is copy the 3 files for that table to another machine, irrespective of the OS. The default size of a MYISAM table is 4 GB. After 4 GB, you need to change certain parameters and the table can be expanded to infinity. 😉

Actually, the size of table is not not limited in MYSQL. Once you reach a 4 GB limit, you will need to convert the table from Dynamic to Static format. Use the query

Alter table <tablename> AVG_ROW_LENGTH=<size in bytes> MAX_ROWS=<no of rows>.
AVG_ROW_LENGTH = current table size in bytes / no of rows in the table.
current table size = size of .MYD file

Once this is done, the table can be expanded to whatever limit the OS has on the max size of file. For Linux – kernel 2.4+ (using ext3 file system) the limit is 4TB. That is too much.

There is too much to write about if I start off with this… Lets move to a bit about mysql performance optimizations.

Firstly indexes. Very important. All indexes are generlly stored as B-Trees. Points to remember about indexes

1. Always run a query with indexed columns being utitlized in the where clause. Makes a huge difference. Maybe of about 90% gain.

2. Secondly, do not have unwanted indexes on a table. The more indexes that you have, the slower the inserts/updates would be on this table. Because for every insert/update the index needs to be updated.

3. Try to avoid having 2 or more indexes on the same column. This generally used to happen with me. Firstly, i used to make the column unique and then index it. This is not required. Remember that unique key is also an index.

For more information on how to use indexes effectively check out
http://dev.mysql.com/doc/refman/5.1/en/mysql-indexes.html

Secondly mysql configuration. Generally in the my.cnf file in /etc directory in linux. Things to remember about configuring mysql

1. Key_cache = memory on system / 2.
Key cache is used to load index in the memory. Frequently used blocks of indexes are loaded in the key cache and used whenever required. Key cache should be a bit more than the max size of .MYI file which is frequently used. It should not exceed the half of (memory on system). Else mysql may start using swap and slow down. As of mysql 4.1, multiple threads can access the key cache simultaneously. Earlier than that access to key cache was sequential. Which is why, mysql 4.1+ has better performance gain over older versions of mysql.

2. Read_buffer_size
Generally used for sequential scan of a table. Each thread that does a sequential scan allocates a buffer of this size for each table it scans. So, if you do many sequential scans, you should increase this value.

3. Sort_buffer_size
Used for Order by ans group by caluses. Each thread that needs to do a sort allocates a buffer of this size. So, you need to increase this value for faster ORDER BY or GROUP BY operations.

4. Max connections
Determines how many simultaneous connections can be there in mysql. Since each connection eats up some memory/system resources, following calculation should be used to decide this.

total memory = (read_buffer + sort_buffer)*max_connection + key_buffer.

If, your total memory exceeds the physical ram limit, then mysql may use the virtual memory/swap and slow down or may even crash. These parameters should be balanced out depending on the requirements. There is no fixed good/bad value for this. It all depends on how and where mysql is being used. Also remembet that both read and sort buffers should be reasonable. Too high or too low value for either of them is not good.

5. table_cache
Defines the no of tables which are opened and cached in memory. The best way to set this is to run a query

Show status like ‘%opened_tables%’;

If this parameter is increasing at a good rate, then mysql is using up resouces in opening and closing tables. so increase the table cache.

6. thread_cache_size
Defines the no of threads cached in memory. To set this run

Show status like ‘%threads_created%’;

Again, if this parameter is increasing rapidly, just increase the thread cache.

Adjusting the last 2 parameters is very important, since if not done, mysql may use up system resources for opening/closing tables and creating/destroying threads. In this case you will see that system usage of CPU is high in top command.

And pls note, i m a linux junkie, so all commands over here are for linux only. I have no clue what their counter part commands will be in windoze… Maybe i will rant about mysql later is my some other blog.

Thats all for today. Lots of technical stuff. Next blog would be much better – and it would be non-technical.

HTTP protocol : absolute / relative urls

The question here is which one is better using absolute urls or using relative urls? Aim is to obtain better performance from the httpd server.

Performance wise there is no difference between an absolute and a relative url. Though relative urls need to be converted to absolute urls before they can be used. But who does the conversion? The client/browser or the http server. If the resolution is done at server end then use of absolute urls is better since extra processing required for conversion of relative to absolute would be avoided at the server end.

According to http://www.htmlhelp.com/faq/html/basics.html the browser resolves the relative URLs and not the server. Relative urls are resolved and converted to absolute urls before sending request to the server.

To quote exactly

Before the browser can use a relative URL, it must resolve the relative URL to produce an absolute URL. If the relative URL begins with a double slash (e.g., //www.htmlhelp.com/faq/html/), then it will inherit only the base URL’s scheme. If the relative URL begins with a single slash (e.g., /faq/html/), then it will inherit the base URL’s scheme and network location.

If the relative URL does not begin with a slash (e.g., all.html , ./all.html or ../html/), then it has a relative path and is resolved as follows.

1. The browser strips everything after the last slash in the base document’s URL and appends the relative URL to the result.
2. Each “.” segment is deleted (e.g., ./all.html is the same as all.html, and ./ refers to the current “directory” level in the URL hierarchy).
3. Each “..” segment moves up one level in the URL hierarchy; the “..” segment is removed, along with the segment that precedes it (e.g., foo/../all.html is the same as all.html, and ../ refers to the parent “directory” level in the URL hierarchy).

Please note that the browser resolves relative URLs, not the server. The server sees only the resulting absolute URL. Also, relative URLs navigate the URL hierarchy. The relationship (if any) between the URL hierarchy and the server’s filesystem hierarchy is irrelevant.

From this following things can be derived:

1. In case of using relative urls, the processing for resolution of relative to absolute is done at client/browser end.
2. Relative urls are smaller to use and take up somewhat less bandwidth
3. Shifting documents from one server to another is easier when you use relative urls, since you dont need to go and change the urls in all the html documents.
4. The only disadvantage in using relative urls is that all content has to be on the same server. If you need to spread out the page content on different servers then you will need to use absolute urls.

This is what i got from the web…

All types of discussions on this are welcome.

why students fail in exams?

It’s not the fault of the student if he/she fails b/c the year has an only 365 days.

Typical academic year for a student.

52 Sundays in a year which are rest days.
Balance 313 days.

Summer holidays 50 where weather is too hot & difficult to study
Balance 263 days

8hrs daily sleep means 122 days.
Balance 141 days

1 hr for daily playing (good for health) means15 days.
Balance 126 days.

2hrs daily 1 for food & other delicacies (chew properly & eat) means 30 days.
Balance 96 days.

1hr for talking (human is a social animal) means
15 days.

Balance 81 days.

Exam days per year at least 35 days.
Balance46 days

Quarterly, half yearly & festival holidays means 40 days.
Balance 6 days.

For sickness at least 3 days.
Balance 3 days.

Movies & functions at least 2 days.
Balance 1 day.

That 1 day is your birthday.

How can a student pass??

GREEN!!! Not my favourite color… But thats the color blogthings gave to my heart… I was hoping it was pink 😉

Your Heart Is Green

Love completes you, but that doesn’t mean you seek it out.
When love comes your way, you integrate it peacefully into the rest of you life.

Your flirting style: Laid back

Your lucky first date: Walking around aimlessly and talking

Your dream lover: Is both enthusiastic and calm

What you bring to relationships: Balance