Sunday, August 26, 2007

How to read C declarators PART 1

Reading C declarators in a precise manner.

The rule goes like this:

"Start at the variable name (or innermost construct if no identifier is present. Look right without jumping over a right parenthesis; say what you see. Look left again without jumping over a parenthesis; say what you see. Jump out a level of parentheses if any. Look right; say what you see. Look left; say what you see. Continue in this manner until you say the variable type or return type."

The degenerate case is:
 int i;

Starting at i, you look right and find nothing. You look left and find the type int, which you say. Done.

Ok, now a more complicated one:

 int *a[3];

Start at a. Look right, say array of size 3. Look left and say pointer. Look right and see nothing. Look left and say int. All together you say a is an array of size 3 pointers to int.

Adding parentheses is when it gets weird:

 int (*a)[3];

The parentheses change the order just like in an expression. When you look right after a, you see the right parenthesis, which you cannot jump over until you look left. Hence, you would say a is a pointer to an array of 3 ints.

bye for now
Al

Saturday, August 25, 2007

pass/fail - profit/loss

When a person fails at something they may mistakenly believe they are heading in the opposite direction from the success they desire. Yet when you really think about the positive implications of failure you have to conclude that being a failure at anything is a sure step in the right direction to your success. Both failure and success are steps in the right direction and they are more like twin sisters than distant relatives.


We start with failure because most of us are experts in this field. If you ask a random person if they considered themselves a failure or a success they would most likely tell you they have failed more than a time or two in the past. They may even go on to tell you a juicy story of a recent failing and falling and how they missed reaching a goal or a dream.

After they conclude their litany of disaster ask them about their successes. They would confront you angrily saying, "I just told your how I failed and that should have showed you clearly that I am not a success."

Real self development and self improvement come in
recognizing this larger understanding about failure.

Because we value success so much, we tend to exaggerate the effects of failure. We wrongly conclude that failure means we did not succeed. But failure isn't the end of the world. You won't die from it. With failure -- you fail, you pick yourself up and you go on.

Have at it right now. Go ahead and take the risk. Go ahead and fail. Because that means you are well on your way to your sure success. So you see in order to succeed all you have to do is fail a lot and learn from it.

SHAKIRA - HIPS DON'T LIE LYRICS

SHAKIRA - HIPS DON'T LIE LYRICS:

Ladies up in here tonight
no fighting, no fighting
We got the refugees up in here
No fighting, no fighting

Shakira, Shakira

I Never really knew that she could dance like this
She makes a man want to speak Spanish
Como si llama, bonita, mi casa, su casa

Shakira, Shakira

Oh baby when you talk like that
You make a woman go mad
So be wise and keep on
Reading the signs of my body

and I'm on tonight
You know my hips don't lie
And I'm starting to feel it's right
all the attraction, the tention
Don't you see baby, this is perfection

Hey Girl, I can see your body moving
And it's driving me crazy
And I, didn't have the slightest idea
Until I saw you dancing

And when you walk up on the dance floor
Nobody cannot ignore the way you move your body, girl
And everything so unexpected -the way you right and left it
So you can keep on shaking it

I never really knew that she could dance like this
She makes a man want to speak Spanish
Como si llama,si bonita, si mi casa, su casa

Shakira, Shakira

Oh baby when you talk like that
You make the woman go mad
So be wise and keep on
Reading the signs of my body

I am on tonight
You know my hips don't lie
And I am starting to feel you boy
Come on lets go, real slow
Don't you see baby asi es perfecto

Oh I know I am on tonight my hips don't lie
And I am starting to feel it's right
All the attraction, the tension
Don't you see baby, this is perfection

Shakira, Shakira

Oh boy, I can see your body moving
Half animal, half man

I don't, don't really know what I'm doing

But you seem to have a plan
My will and self restraint
Have come to fail now, fail now
See, I am doing what I can, but I can't so you know
That's a bit too hard to explain

Baila en la calle de noche
Baila en la calle de noche

Baila en la calle de noche
Baila en la calle día

I never really knew that she could dance like this
She makes a man want to speak Spanish
Como si llama,si bonita, si mi casa, su casa

Shakira, Shakira

Oh baby when you talk like that
You know you got me hypnotized
So be wise and keep on
Reading the signs of my body



Señorita, feel the conga, let me see you move like you come from Colombia

Mira en Barranquilla se baila así, say!
Mira en Barranquilla se baila así

Yeah

She's so sexy every man's fantasy a refugee like me back with the refugees from a 3rd world country
I go back like when 'pac carried crates for Humpty Humpty
We need a whole club dizzy
Why the CIA wanna watch?
From Colombians and Haitians

I ain't guilty, it's a musical transaction
No more do we snatch ropes
Refugees run the seas 'cause we own our own boats

I'm on tonight, my hips don't lie
And I'm starting to feel you boy
Come on let's go, real slow
Baby, like this is perfecto



Oh, you know I'm on tonight and my hips don't lie
And I am starting to feel it's right
The attraction, the tension
Baby, like this is perfection.



no fighting!

no Fighting.

Thursday, August 23, 2007

philosophy mingled

thou who say tomorrow never comes.... thou shalt never see new dawn of future....

It's not that hard to imagine this truth that lies solely in our mind. One who tries to avoid something, is the one who fear from it the most. And the biggest disadvantage that he has is this point only.
To gain something in future you have to devote a part of your present.... and it sure matters in which way even if you don't accept it. It can be mapped to the complication of making a choice. It doesn't matter for others how you make a choice but when it is made they are there right in front of you.

Rest later
AL

Thursday, July 26, 2007

Programing style review

Hi comp folks .....

Everyone who have some sort of coding style might find this interesting.

Coding fundas -
1. Follow the single-entry/single-exit rule. Never write multiple return statements in the same function.

2. Never, ever, EVER return references to local objects.

3. Prefer preincrement, avoid postincrement.

4. Prefer passing const& instead of copied values.

5. Watch out for hidden temporaries created by parameter conversions. One good way to avoid this is to make ctors explicit when possible.

read more on Guru of the week.


Bye for now....
Al

Thursday, June 7, 2007

Friday, May 18, 2007

Pray for me brother


Singers: A.R.Rahman and Blaaze

Pray for me brother
Pray for me brother
Pray for me sister
Are you searchin’….

Pray for me brother
Lookin’ for the answers To all the questions In my life
Will I be alone Will you be there By my side
Is it something he said Is it something he did
I wonder why He is searchin’ For the answers
To stay alive
Could you ever listen Could you ever care
To speak your mind
Only for a minute For only one moment
In time

The joy is around us But show me the love
That we must find
Are you searchin’ For a reason to be kind, to be kind…
He said… Pray for me brother
Pray for me brother Pray for me sister
Pray for me brother

Say what you wanna say now
But keep your hearts open
Be what you wanna be now
Let’s heal the confusion
Pray for me brother

Don’t let me take When you don’t wanna give
Don’t be afraid Just let me live
Don’t let me take When you don’t wanna give
Don’t be afraid Say what you wanna say now
But keep your hearts open
Be what you wanna be now Let’s heal the confusion
Pray for me brother Pray for me brother

I’m ashamed ah, brother be dying of poverty
when he down on his knees its only then he prays
And it’s a shame ah, brother be dying of ignorance
cos the world is a trip and everybody’s a hypocrite
Need to stop ah , taking a look at the other
I’m not ashamed of poverty
need to be making his life better
So think about it, think about it once more
cos life is a blessing and it’s not justa show, ah

Round and round the world is spinning around
We need to be singing a prayer, we need to be singing it now
Round and round the world is turning around
We need to be singing a prayer, we need to be singing it now
Need to be feeling the power, need to be feeling the faith
We need to coming together just to win this race
Need to be feeling the power, need to be feeling the faith
We need to coming together just to win this race (twice)
Are you searching for a reason to be kind ?

Saturday, April 21, 2007

Ugliness Bamboozled

Hey folks

Last day only I was watching the pilot episode of Ugly Betty ( y last .. it was today only, well who cares), with America Ferrera (Betty Suarez) in the lead role. Here are the two pics of her ......



Monday, April 16, 2007

RSA Cryptography Explained

RSA is an algorithm for public-key encryption.

Let p and q be two different large primes. A large number p can be tested for primeness by applying Fermat's theorem, which states that if p is prime, then ap-1 == 1 (mod p)
for every positive integer a not divisible by p. (A double equal sign (==) is used instead of the usual symbol for congruence, which is not supported by all Web browsers.) A number p which passes this test for several hundred randomly selected values of a in the range (1, p-1) is almost surely prime.
Then find two large integers d and e, both less than (p-1)(q-1), such that de == 1 (mod (p-1)(q-1)).
The easiest way to do this is to choose e at random and use the Euclidean algorithm to find gcd(e, (p-1)(q-1)) and integers d and s such that de - s(p-1)(q-1) = gcd(e, (p-1)(q-1)).If the right member is not 1, try again.

The public key is (e, pq) and private key is (d, pq), or vice-versa. The number e or d is called the exponent, and the number pq is called the modulus, for reasons to be made clear later. The modulus pq is published with the public key, but the separate values of p and q must be kept secret. In fact, they are not used for either encryption or decryption and may be discarded.
Let m be a message in the range [0, pq). It is encrypted to c in the range [0, pq) such that:
c == me (mod pq).

Decryption is similar:
m == cd (mod pq).
We must prove that encryption and decryption are inverse operations, i.e., that (me)d = (md)e = mde == m (mod pq).
Because of the way d and e were constructed, de = 1 + s(p-1)(q-1)

for some positive integer s.
If p does not divide m, then by Fermat's theorem
mp-1 == 1 (mod p).
Raising both sides to the s(q-1) power and multiplying by m shows that
mde = m1 + s(p-1)(q-1) == m (mod p),
which is obviously also true if p does divide m.

Similarly,
mde == m (mod q).
Hence both p and q divide mde - m. Since p and q are relatively prime, so does pq. Hence
mde == m (mod pq).


PALM ......... mystery

The shape of your hand reveals that you are especially Good at Listening to your Heart



The signs we read in your palm indicate you have much to gain by listening to your intuition when making decisions — even if it doesn't seem rational. By putting directed energy toward the wisdom of your heart, your efforts will be returned multi-fold.

THE LINES OF YOUR PALM
Palmists can learn a substantial amount from the lines of your palm. The four major lines are your Life Line, Head Line, Heart Line, and Destiny Line. From your Life Line, a palmist can tell what your general approach to life is and how you deal with life's challenges. Your Head Line reveals how you process information and think through problems. Your Heart Line can give a palmist insight into your personal relationships, including friends, family, and significant other(s). Your Destiny Line pertains to changes in your personal drive and focus over time. In addition, a palmist can read some of the lesser lines — if they are present in your palm — for information on your level of creativity, communication skill, and attachments you may have or will have with others throughout your life.

LIFE LINE
The Life Line reveals your approach to life and how you handle uncertainty or hardship. It is a common misconception that the Life Line can tell you when you will die. Even persons with relatively short Life Lines can live a long life. Generally, the information that can be gleaned from your Life Line pertains to your overall outlook and the ease with which you will travel through your life.


You have a natural ability to show your love and sympathy for others. You are generally supportive when friends or family come to you for assistance.

One of the most important things to you in life is to make sure that you are living your life to its fullest. When you have regrets, they are likely to stem from a sense of not having done enough or wishing that you had done something differently.

When you are confronted with difficulties in life, you may sometimes have trouble expressing yourself. With this challenge, it is hard to ask for help when you really need it.

HEAD LINE
The Head Line reveals how you process information and think through problems. It is a common misconception that the Head Line can tell you how intelligent you are. Persons with various styles of Head Lines can be very smart, but in different ways. Primarily, the information that can be gathered from your Head Line pertains to your particular way of understanding the information you come into contact with throughout your life.


When it comes to leadership, you are probably quite comfortable in either the role of the leader or the follower. Since taking charge is not necessarily something you covet, you are usually fine with stepping aside to let someone else take the lead. However, if no one else steps up, you know you are capable of taking on the leader role.

Your thought process tends to be based on intuition. You probably enjoy letting your imagination get the best of you during your decision-making process, and you may lean on some psychic abilities. Your knack to draw on your intuition may leave others feeling lost or confused about your thought process.

You can enjoy a wide range of projects and may possess an array of problem solving skills. However, the intensity of your ability to focus or concentrate can widely vary, depending on what you are doing.

When you have a choice, you'd probably rather research and investigate multiple options simultaneously. You are likely a master multi-tasker who enjoys having many balls in the air at the same time.

HEART LINE
The Heart Line reveals how you handle the relationships in your life and how comfortable you are with intimacy. It is a common misconception that the Heart Line can tell you definitively what relationships you will have in the future. On average, the information that can be collected from your Heart Line indicates the influences in your life that have in the past or will in the future affect your personal relationships, including friends, family, and significant other(s).

Your ability to be intimate with others may be influenced by a lack of commitment. You may find it difficult to make emotional promises, even if you are married. People you don't know well may find you somewhat distant.

In a tight knit relationship, you tend to be an independent person with a calm and cool disposition. Your ideal life mate will likely prize you for your loyalty and practicality. At times, you may find that you get yourself into trouble in your relationships by being too isolated and inattentive.

Try to take the test HERE.

tornado

*Where do they come from?
Tornadoes come from the energy released in a thunderstorm. As powerful as they are, tornadoes account for only a tiny fraction of the energy in a thunderstorm. What makes them dangerous is that their energy is concentrated in a small area, perhaps only a hundred yards across. Not all tornadoes are the same, of course, and science does not yet completely understand how part of a thunderstorm's energy sometimes gets focused into something as small as a tornado.

*Where do they occur?
Whenever and wherever conditions are right, tornadoes are possible, but they are most common in the central plains of North America, east of the Rocky Mountains and west of the Appalachian Mountains. They occur mostly during the spring and summer; the tornado season comes early in the south and later in the north because spring comes later in the year as one moves northward. They usually occur during the late afternoon and early evening. However, they have been known to occur in every state in the United States, on any day of the year, and at any hour. They also occur in many other parts of the world, including Australia, Europe, Africa, Asia, and South America.

*What type of damage can they do?
The damage from tornadoes comes from the strong winds they contain. It is generally believed that tornadic wind speeds can be as high as 300 mph in the most violent tornadoes. Wind speeds that high can cause automobiles to become airborne, rip ordinary homes to shreds, and turn broken glass and other debris into lethal missiles. The biggest threat to living creatures (including humans) from tornadoes is from flying debris and from being tossed about in the wind. It used to be believed that the low pressure in a tornado contributed to the damage by making buildings "explode" but this is no longer believed to be true.

*How are they detected?
Today, the development of Doppler radar has made it possible, under certain circumstances, to detect a tornado's winds with a radar. However, human beings remain an important part of the system to detect tornadoes, because not all tornadoes occur in situations where the radar can "see" them. Ordinary citizen volunteers make up what is called the SKYWARN network of storm spotters, who work with their local communities to watch out for approaching tornadoes, so that those communities can take appropriate action in the event of a tornado. Spotter information is relayed to the National Weather Service, which operates the Doppler radars and which issues warnings (usually relayed to the public by radio and TV) for communities ahead of the storms, using all the information they can obtain from weather maps, modern weather radars, storm spotters, monitoring power line breaks, and so on.

*Can they be predicted?
Yes, but only to a limited extent. Although the process by which tornadoes form is not completely understood, scientific research has revealed that tornadoes usually form under certain types of atmospheric conditions. Those conditions can be predicted, but not perfectly. When forecasters see those conditions, they can predict that tornadoes are likely to occur. However, it is not yet possible to predict in advance exactly when and where they will develop, how strong they will be, or precisely what path they will follow. There are some "surprises" every year, when tornadoes form in situations that do not look like the right conditions in advance, but these are becoming less frequent. Once a tornado is formed and has been detected, warnings can be issued based on the path of the storm producing the tornado, but even these cannot be perfectly precise about who will or will not be struck.

*How can I keep myself safe?
The main point is to be protected from flying and falling debris. A storm shelter is your best choice, if you have one. If you have a basement, go there and get under something sturdy to shelter you from falling debris (for instance, a strong workbench, or a staircase).
If you have no basement or storm shelter, go to an interior room without windows on the first floor of your home. Bathrooms are a good choice because the plumbing reinforces the walls. Closets are also a good choice since they normally have no windows. The idea is to put as many walls between you and an approaching tornado as possible; flying debris can penetrate exterior walls.
Stay away from windows entirely! It used to be thought that opening windows would reduce a tornado's damage to a home. This is no longer considered to be good advice: leave windows alone completely and get to a safe place immediately.
If you live in a mobile home, it should be abandoned; seek shelter in a neighboring frame home or, better yet, a storm shelter. If you are in a motor vehicle in an populated area, do not try to drive away from a tornado; abandon your vehicle and seek shelter nearby.
If you are traveling in a rural area, drive away from the tornado at a right angle to its path. If caught in the open, get down in a sheltered low spot, and cover your head with your arms; hang on to something if it is available.
If you are at school or work, your school or workplace should have an approved tornado safety plan, which you should follow. If no such plan exists, complain to someone that a plan needs to be developed!! Knowing what to do in a specific situation means you are less likely to panic and do something dangerous without realizing it. Have a plan within your family about what you would do, and follow it exactly, including where you will go if you are separated.
If you hear a tornado warning, you should seek immediate shelter and not waste precious seconds to see if it is true for you; wasting a few minutes in a safe place once in awhile is better than becoming another tornado statistic!

*Should I seek shelter under a bridge over-pass during a tornado?
It is not advisable to seek shelter under a bridge. This is due to increased wind speeds that result from a phenomenon known as Bernoulli's principle, which states that air moving through a constriction or over a curved surface will undergo a pressure drop and an increase in wind speed. This translates to higher potential for injury from flying tornado debris.
To illustrate this principle, think of what happens when you constrict the flow of water through a garden hose. The water speeds up. Likewise, the air speeds up when forced through a narrow overpass.

*What is the smallest, largest, average size?
The answer to this depends on what is being measured ... the easiest way to answer this is by the size of the damage path. Also, it is important to note that the "average" can be misleading, since most tornadoes are small ... a simple average puts too much emphasis on the infrequent large events. A way around this is to use what is called the "median" to represent what is typical. The typical tornado damage path is about one or two miles, with a width of about 50 yards. The largest tornado path widths can exceed one mile, and the smallest widths can be less than 10 yards. Widths can vary considerably during a single tornado, because the size of the tornado can change considerably during its lifetime. Path lengths can vary from what is basically a single point to more than 100 miles. Note that tornado intensity (the peak wind speeds) is not necessarily related to the tornado size ... bigger is not necessarily stronger!

*How long is a tornado usually on the ground?
Detailed statistics about the time a tornado is on the ground are not available. This time can range from an instant to several hours ... what is typical is roughly 5 minutes or so.

*How fast do tornadoes move?
As with tornado duration, detailed statistics about forward speed are not available. Movement can range from virtually stationary to more than 60 miles per hour ... what is typical is roughly 10-20 miles per hour.

*How do I know if it is a tornado or just a funnel?
The definition of a tornado means that the vortex of rapidly rotating air must be in contact with the ground. This means that to be a tornado, the swirling winds must be at the surface, capable of doing damage. If you see debris (dust and other objects swirling in the winds), it is definitely a tornado, even if there is no visible funnel cloud. If you can't see debris with a funnel cloud, then it might be a tornado but you can not be certain that it is (or is not). A tornado can move over a surface with few objects to be picked up and swirled about, or you may not be able to see all the way to the surface beneath a funnel cloud because of intervening hills, trees, or buildings. All funnel clouds should be treated as if they are tornadoes, unless you can be certain that they will not touch down...and being certain about such things is difficult. Even if the funnel is not in contact with the surface when you first see it, that situation can change quite rapidly!

Sunday, April 15, 2007

t.y.p.o.r.g.a.n.i.s.m : ASCII-O-Matic

hey everybody check this link out ................................................

t.y.p.o.r.g.a.n.i.s.m : ASCII-O-Matic

Takes any image and turns it into a pure ASCII (letters, numbers, and symbols) art.
Choice of B&W, Color, or blocks.

The Most Famous Love Poem


Love poems have been written for centuries to inspire lovers and create romance. When you give your special someone a love poem, you can express your feelings through eloquent words in a memorable way. Many famous love poems are written by classical poets, such as Lord Byron, Elizabeth Barrett Browning, and Shakespeare. But a famous love poem by a modern poet may appeal to a younger person who likes a less formal tone.

The poet e.e. cummings wrote what is probably the most famous love poem currently. It has been featured in other books and movies, used as inspiration for other writers.

i carry your heart with me
by e. e. cummings

i carry your heart with me (i carry it in my heart)
i am never without it (anywhere
i go you go, my dear; and whatever is done
by only me is your doing, my darling)
i fear
no fate (for you are my fate, my sweet) i want
no world (for beautiful you are my world, my true)
and it's you are whatever a moon has always meant
and whatever a sun will always sing is you
here is the deepest secret nobody knows
(here is the root of the root and the bud of the bud
and the sky of the sky of a tree called life; which grows
higher than soul can hope or mind can hide)
and this is the wonder that's keeping the stars apart
i carry your heart (i carry it in my heart)

The poet e.e. cummings is quite a unique writer in that he used new methods of creating mood and setting the words to paper. He explored the use of white space on the page and made the words' appearance just as important as their sound when the poem was read aloud.

This poem is a perfect example of his use of parentheses and unusual stanza variation. He found a wonderful way of expressing very abstract ideas with some concrete grammatical forms. Use this poem to express to your loved one just how much they mean to you.

Visit to find out more about famous love poems.

Saturday, April 7, 2007

Programming query

Hello

for any query regarding OS, C, JAVA programming you can leave a comment in here.
remarks, reviews, suggestions, flak, ideas all are welcomed.

OS RATING

Hello,

let's see how do you find different available free operating systems - You are supposed to rate the Linux environments based on your personal experience or on expert advice....
RED HAT
MANDRAKE
FEDORA
SOLARIS
UBUNTU
DEBIAN
KNOPPIX
( u can surely add any other as per your liking)

Genesis

Hello
Well, so here I am with my very own blog, just thought now it's a good time to do this. Well many would like the idea of google owning this blogging space and now Picassa. Such a big software hunk that google is, i personally feel lot of features are missing.. like the inability of addition of comment in googlepages, there are others as well, but this is not a page to discuss that.
That doesnot take anything away from google, as it's simple features are very strong in itself.

On popular request I have created an offline site in googlepages -

http://alokadvin.googlepages.com

My online site should hopefully be up and running in coming months, so patiently wait for that.

You can visit my above stated site and leave comments in here, for me to just change it for better.

bye for now.. c u soon

RSS Reader