Saturday, October 30, 2010


First time I saw her, I fell in love with her. She was so divine and perfect, I couldn't take my eyes off her. I wanted to go talk to her and be friends with her. I think, the case was of love at first sight. I didn't believe in these theories until today, when I experienced it myself. The feeling was so different, so new. I knew what I wanted but how to get it, I didn't. I tried so many times to catch her attention but I just can't say whether she noticed me or not. Everyday was the same story, I just used to gaze at her all day long. It's said that "hard-work is the key to success". But in my case it was "hesitation is the key to failure". I kept waiting for the right time to make a move but that right time never came.

Actually, this is the kind of crap I hear from most of the guys in my friend circle. The others are what I call "Dudes" :)

Monday, October 18, 2010

When I feel like Writing..

It starts with a feeling of doing something other than the daily chores. Everyday schedule is so fixed and pre-decided that it's very difficult for any new stuff to find a place in, what we can call "a chart of daily activities". Or rather we are so obsessed with our daily routine that we don't find time to do anything else.

But sooner or later, one always takes out sometime for doing stuff one always liked. One thing that everyone complains about is shortage of time. I think that one thing we are here to learn is to how to manage time. If we just learn this one thing then nothing is out of your reach. Everything is attainable and nothing is impossible. Well, may be I am deviating from the topic, but as the blog title says, "Learning to express myself..", I think I am very much on the right track!

My mind is always cluttered with these random thoughts. And once someone asked me as to what I write about, I instantly answered,"Any random thought that comes to my mind!". Why does mind keeps thinking about something or the other? Every time you come across something either new or familiar, your mind takes you to this whole new place. And you are there until someone wakes you up. People call that day-dreaming but that's where you wish to be. These places are so fun and easygoing that if no one disturbed you, then you would have sailed from one thought to the other without any restrictions whatsoever.

I always like advocating, that one should always follow his interests! I came across these very nice lines somewhere,
"You are never at work when you like your work!"
Though reality is tough but all you day-dreamers, your thoughts can transform into a wonderful reality with little extra effort and governing time.

See you till I feel like writing again..!!

Sunday, July 18, 2010

FaCeBoOk Is A sTuPiD iDiOt

Everything was going well, with sending scraps on orkut and chatting with friends on gtalk. Google's monopoly couldn't be questioned. But then came facebook and the entire scenario changed. Slowly, facebook creeped into our lives and what followed was my quiting orkut just like others. At first I didn't know how to use it (facebook) and wondered what others did gazing at the home page all day long. But I would admit, like others even I got addicted to facebook. With so many applications being offered, you can't resist yourself. Logging on to facebook and checking the updates every now and then became a habit. Well, this may be acceptable during normal days. But even during exams and assignments, I had the facebook page in front of my eyes all the time.

Now, if this was not enough, I don't know from where I came to know about Famville and Mafia Wars. Oh, I remember!! One of my friends asked me to become her neighbour on Farmville and I thought what the hell is that. And now I think one big bad decision was to accept her neighbour request ;) . All my friends followed and we all became neighbours on farmville doing nothing but sowing seeds and reaping crops all the time. You wont believe this but ask the farmville users, we used to plan our day according to farmville :(

Somehow I managed to escape the claws of farmville, but the devotion towards facebook still persists. The friends-list is large and still growing. I've been on facebook for a less than two years now but the friends-list exceeds the number of friends I made in past two decades. I never knew I was so friendly :P

Facebook eats up all your time and everyone realizes this sooner or later. I've tried deactivating the account several times but I am so obsessed that I always end up re-activating it everytime.
I tried switching back to orkut but no use. Twitter seems a better option but still there's no match for facebook. Right now I have my account deactivated but don't know for how long it will last.

I would say facebook users are helpless souls who don't know what facebook is for and what's the use of being on facebook . Here's a song about facebook and after listening this, I really feel that
"Facebook is a stupid idiot"

Wednesday, July 7, 2010

Representation of Numbers

Working with floating point numbers, I came across some weird results.
Here's a sample program.

This is because of the way these numbers are actually represented in memory.

A brief explanation of how binary integers and floating point numbers are represented in memory:-

Signed Binary Integers

We don't use a minus sign to represent negative numbers. We would like to represent our binary numbers with only two symbols, 0 and 1. There are a few ways to represent negative binary numbers. The simplest of these methods is called ones complement, where the sign of a binary number is changed by simply toggling each bit (0's become 1's and vice-versa). This has some difficulties, among them the fact that zero can be represented in two different ways (for an eight bit number these would be 0000 0000 and 1111 1111).

Hence, a method called two's complement notation which avoids the pitfalls of one's complement is used.

To represent an n bit signed binary number the leftmost bit, has a special significance. The difference between a signed and an unsigned number is given in the table below for an 8 bit number.

The value of bits in signed and unsigned binary numbers

Bit 7 Bit 6 Bit 5 Bit 4 Bit 3 Bit 2 Bit 1 Bit 0
Unsigned 27 = 128 26 = 64 25 = 32 24= 16 23= 8 22 = 4 21 = 2 20 = 1
Signed -(27) = -128 26 = 64 25 = 32 24 = 16 23 = 8 22 = 4 21= 2 20 = 1

Let's look at how this changes the value of some binary numbers

Binary Unsigned Signed
0010 0011 35 35
1010 0011 163 -93
1111 1111 255 -1
1000 0000 128 -128

If Bit 7 is not set (as in the first example) the representation of signed and unsigned numbers is the same. However, when Bit 7 is set, the number is always negative. For this reason Bit 7 is sometimes called the sign bit. Signed numbers are added in the same way as unsigned numbers, the only difference is in the way they are interpreted. It means that numbers can be added regardless of whether or not they are signed.

To form a two's complement number that is negative you simply take the corresponding positive number, invert all the bits, and add 1. The example below illustrated this by forming the number negative 11 as a two's complement integer:

1110 = 0000 10112
invert -> 1111 01002
add 1 -> 1111 01012

So 1111 0101 is two's complement representation of -11. We can check this by adding up the contributions from the individual bits

1111 01012 = -128 + 64 + 32 + 16 + 0 + 4 + 0 + 1 = -11.

The same procedure (invert and add 1) is used to convert the negative number to its positive equivalent. If we want to know what number is represented by 1111 1101, we apply the procedure again

? = 1111 11012
invert -> 0000 00102
add 1 -> 0000 00112

Since 0000 0011 represents the number 3, we know that 1111 1101 represents the number -3.

Floating point numbers

IEEE floating point numbers have three basic components:

1. sign

2. exponent


The mantissa is composed of the fraction and an implicit leading digit (explained below). The exponent base (2) is implicit and need not be stored.

The following figure shows the layout for single (32-bit) and double (64-bit) precision floating-point values. The number of bits for each field are shown (bit ranges are in square brackets):

Sign Exponent Fraction Bias
Single Precision 1 [31] 8 [30-23] 23 [22-00] 127
Double Precision 1 [63] 11 [62-52] 52 [51-00] 1023

The Sign Bit

The sign bit is as simple as it gets. 0 denotes a positive number; 1 denotes a negative number. Flipping the value of this bit flips the sign of the number.

The Exponent

The exponent field needs to represent both positive and negative exponents. To do this, a bias is added to the actual exponent in order to get the stored exponent. For IEEE single-precision floats, this value is 127. Thus, an exponent of zero means that 127 is stored in the exponent field. A stored value of 200 indicates an exponent of (200-127), or 73. Exponents of -127 (all 0s) and +128 (all 1s) are reserved for special numbers.

For double precision, the exponent field is 11 bits, and has a bias of 1023.

The Mantissa

The mantissa, also known as the significand, represents the precision bits of the number. It is composed of an implicit leading bit and the fraction bits.

To find out the value of the implicit leading bit, consider that any number can be expressed in scientific notation in many different ways. For example, the number five can be represented as any of these:

 5.00 × 100
0.05 × 102
5000 × 10-3

In order to maximize the quantity of representable numbers, floating-point numbers are typically stored in normalized form. This basically puts the radix point after the first non-zero digit. In normalized form, five is represented as 5.0 × 100.

A nice little optimization is available to us in base two, since the only possible non-zero digit is 1. Thus, we can just assume a leading digit of 1, and don't need to represent it explicitly. As a result, the mantissa has effectively 24 bits of resolution, by way of 23 fraction bits.

Putting it All Together

So, to sum up:

  1. The sign bit is 0 for positive, 1 for negative.
  2. The exponent's base is two.
  3. The exponent field contains 127 plus the true exponent for single-precision, or 1023 plus the true exponent for double precision.
  4. The first bit of the mantissa is typically assumed to be 1. And thus the mantissa becomes 1.f, where f is the field of fraction bits.

Ranges of Floating-Point Numbers

Let's consider single-precision floats for a second. Note that we're taking essentially a 32-bit number and re-jiggering the fields to cover a much broader range. Something has to give, and it's precision. For example, regular 32-bit integers, with all precision centered around zero, can precisely store integers with 32-bits of resolution. Single-precision floating-point, on the other hand, is unable to match this resolution with its 24 bits. It does, however, approximate this value by effectively truncating from the lower end. For example:

      11110000 11001100 10101010 00001111  // 32-bit integer
= +1.1110000 11001100 10101010 x 231 // Single-Precision Float
= 11110000 11001100 10101010 00000000 // Corresponding Value

This approximates the 32-bit value, but doesn't yield an exact representation. On the other hand, besides the ability to represent fractional components (which integers lack completely), the floating-point value can represent numbers around 2127, compared to 32-bit integers maximum value around 232.

Special Values

IEEE reserves exponent field values of all 0s and all 1s to denote special values in the floating-point scheme.


Zero is not directly representable in the straight format, due to the assumption of a leading 1 (we'd need to specify a true zero mantissa to yield a value of zero). Zero is a special value denoted with an exponent field of zero and a fraction field of zero. Note that -0 and +0 are distinct values, though they both compare as equal.


If the exponent is all 0s, but the fraction is non-zero (else it would be interpreted as zero), then the value is a denormalized number, which does not have an assumed leading 1 before the binary point. Thus, this represents a number (-1)s × 0.f × 2-126, where s is the sign bit and f is the fraction. For double precision, denormalized numbers are of the form (-1)s × 0.f × 2-1022. From this zero can be interpreted as a special type of denormalized number.


The values +infinity and -infinity are denoted with an exponent of all 1s and a fraction of all 0s. The sign bit distinguishes between negative infinity and positive infinity. Being able to denote infinity as a specific value is useful because it allows operations to continue past overflow situations. Operations with infinite values are well defined in IEEE floating point.

Not A Number

The value NaN (Not a Number) is used to represent a value that does not represent a real number. NaN's are represented by a bit pattern with an exponent of all 1s and a non-zero fraction. There are two categories of NaN: QNaN (Quiet NaN) and SNaN (Signalling NaN).

A QNaN is a NaN with the most significant fraction bit set. QNaN's propagate freely through most arithmetic operations. These values pop out of an operation when the result is not mathematically defined.

An SNaN is a NaN with the most significant fraction bit clear. It is used to signal an exception when used in operations. SNaN's can be handy to assign to uninitialized variables to trap premature usage.

Semantically, QNaN's denote indeterminate operations, while SNaN's denote invalid operations.

References and Further Reading

Wednesday, June 9, 2010

Digital Root ...!!

The digits of a number, x are rearranged i.e. x is permuted resulting in a new number, y. Now subtracting the smaller of x and y from the other gives the result as r. If the digits of r are added such that the result is obtained to be a single digit, then it always come to be 9. i.e. the digital root of r will be 9.

For example,
Let x=6732
Rearranging the digits randomly gives, y=3762
Now, x-y=2970
Adding the digits => 2+9+7+0=18 => 1+8 = 9

Now, here's something very interesting. The above fact can be utilized to device a very clever trick that you can try with your friends.

The trick goes like this:-
Tell your friend that you have some psychic qualities. ;)
Ask him to write a number on a piece of paper without showing it to you. Then ask him to rearrange the digits of the number to obtain a new number. Now, subtract the smaller from the larger number.
Now, add the digits to obtain a single digit. Ask him to add 4 to the resulting number and bring the answer in single digit. Now select the English alphabet corresponding to that number and write the name of a country starting with that alphabet. Ask him to write the name of an animal with the second character in the name of that country.
You can now surprise him just by saying " There are no elephants in Denmark!!".

This is because almost every guy would choose the country to be Denmark and the animal will be elephant. You can try it yourself..!!

Saturday, February 13, 2010

Experience Opera...

Today, technology is driving the world. And, Internet has been perhaps most outstanding innovation in field of communication in history of mankind. By the advent of computer’s Internet, our earth has reduced and has attained the form of a global village.Information is probably the biggest advantage internet is offering. The Internet is a virtual treasure trove of information. Any kind of information on any topic under the sun is available on the Internet.

The foremost target of internet has always been the communication. And internet has excelled beyond the expectations. Still, innovations are going on to make it faster, more reliable.

Talking of internet, first thing that comes to our mind is a web browser.
One such product that I've been using and which in my opinion stands much above the rest because of its very unique and excellent features is Opera Web Browser.
I've been using opera for quite a time now and some of its features without which I feel browsing the web to be incomplete are:

Speed Dials. It is a set of visual bookmarks you see when you open a new tab. It is like a dashboard for your online life.

Integrated Web Search
lets you get quick access to your favorite search engine directly from the resizable search box, in the address field or from the context menu. You can also add any search engine.

Mail Client
(This is the best of them) It enables you access all of your e-mail even when you are not connected to the Web. When you're back online, Opera Mail synchronizes with your Web e-mail service, keeping you organized and productive.

Visual Tabs
allows you to open tabs as larger thumbnails to identify them more easily.

Mouse Gestures
....these are the coolest thing to play around with and at the same time saves a lot of time.

These are just a few to mention.Plus, it's faster than the other browsers. In addition there are a number of widgets and 100 of skins to choose from to customize your browser the way you like. :)
I must say, I've had a wonderful experience with Opera...and I would recommend it to all the web surfers........cheers !!!

Sunday, January 31, 2010

Time Limit Exceeded..

I believe, everyone is familiar with this term, TIME LIMIT EXCEEDED. As soon as this status(You know what I am talking about) appears in front of me, I find myself in the middle of nowhere. Completely baffled, I have no idea as to what is to be done next. All the knowledge starts appearing meagre and insufficient in front of a problem that I considered very insignificant. Time just slips away and I can't think of nothing.

But this is not the case only with me, as I felt it during Effy'MM9-Limite de Plazo. It was just another online coding contest, I being the organizer. The time limit was very stringent this time and many intellectual minds found themselves ill at ease, scuffling with the problems.

Till here, it was just a consolation for all the guys who love programming.

Lets keep programming aside now. In the real world also, I am experiencing a same kind of problem. And I think everyone of us is in a similar situation right now. There is so much to do and time appears to be so less. I just can't decide as to which path to follow and where to concentrate more. Even though the credit hours in our curriculum have decreased but this doesn't bring any relief.Semester projects, Labs Assignments, Electives and daily lectures are too much to be handled by a single soul. I must say, I've never had a more hectic schedule than this.

Moreover, there is a lot of confusion about the future options. Research, Management and Experience(Job) are a few that I know of. I am sure, many of us would be finding it difficult to decide from among the many options that we have.

3Idiots,the movie did encourage many and left the others confused.

In the end, I would just like to inform you to get geared up and be prepared because the worst is yet to come and the time limit is indeed exceeded.
Copyright ©FANATIC'S DEN