Thursday, March 19, 2009

Eval is Evil ...

The Eval method is JS takes a string containing JavaScript code, compiles it and runs it.It is probably the most powerful and most misused method in JavaScript.
In the majority of cases, eval is used like a sledgehammer swatting a fly -- it gets the job done, but with too much power. It's slow, it's unwieldy, and tends to magnify the damage when you make a mistake. Please spread the word far and wide: if you are considering using eval then there is probably a better way. Think hard before you use eval. eval starts a compiler. Before you use it, ask yourself whether there is a better way to solve this problem than starting up a compiler!

Here few points that force to not use Eval.

Debugability: what is easier to debug, a program that dynamically generates new code at runtime, or a program with a static body of code?

Maintainability: What's easier to maintain, a table or a program that dynamically spits new code?

Speed: which do you think is faster, a program that dereferences an array, or a program that starts a compiler?

think about string more than 10,000 persons name and we want to eval that string ... JavaScript encountered with problem on manipulating and eval()ing very large strings.


Memory: which uses more memory, a program that dereferences an array, or a program that starts a compiler and compiles a new chunk of code every time you need to access an array?


Learn More ....

http://blogs.msdn.com/ericlippert/archive/2003/11/04/53335.aspx

http://blogs.msdn.com/ericlippert/archive/2003/11/01/53329.aspx


Saturday, March 14, 2009

Holi ... celebration of colors ..

Holi is celebrated after the full moon day in the month of phalgun (February – March). It is traditionally a harvest festival. Like all Hindu festivals, the reason for the celebration of Holi can be traced to Hindu scriptures and it commemorates the victory of good over evil. The significance of Holi is that victory of good over evil is achieved by a young devotee through his unshakable devotion for the Lord.

The date of Holi celebration depends on the moon and lunar calendar.

Holi Myth based on Prahlada and Demon Holika

Young Prahlada was an ardent devotee of Lord Vishnu but this was detested by his arrogant father, Hirnakashyipu, who was the king of the land. The father constantly sought for ways to eliminate his son and each time he failed miserably. But this only hardened his stance.

Now, the king had a sister named Holika who was immune to fire. So, she took young Prahlada and entered into fire. Legend has it that Prahlada came out of the fire without any burns but Holika was consumed by the fire. Huge bonfires that are burnt on the day prior to Holi symbolize this event from mythology.

Holi Legend based on Krishna and Radha

Holi is also associated with the evergreen love of Krishna and Radha. KrishnaKrishna was waiting for an idea for a prank and did exactly as his mother suggested. was jealous of Radha’s fair color and asked mother Yashoda for the reason for Radha’s fair color. Yashoda jokingly said if you are so jealous change her complexion by smearing color. Naughty young

For Krishna devotees, the festival is spread over two weeks. The most important events are held at Vrindavan, Mathura, Barsnar and Nandgaon.

Holi Myth based on Kamdev and Lord Shiva

Another important Holi legend is associated with Kamdev, the god of love. After the death of Sati, Lord Shiva took to severe meditation. Sati took rebirth as Parvati and tried to impress Lord Shiva. When her feminine charms failed, she took the help of Kamdev. Not knowing the seriousness of Lord Shiva’s meditation, Kamdev used his arrow of love on Shiva. The infuriated Shiva opened his third eye and turned Kamdev into ashes. This happened on the Holi day.

Monday, March 2, 2009

Here i am sitting in my office at night…

Here i am sitting in my office at night…
Thinking hard about life How it changed from a maverick college life to strict professional life…...

How tiny pocket money changed to huge monthly paychecks
but then why it gives lesss happiness….

How a few local denim jeans changed to new branded wardrobe but then why there are less people to use them

How a single plate of samosa changed to a full Pizza or burger But then why there is less hunger…..

Here i am sitting in my office at night…
Thinking hard about life How it changed…..

How a bike always in reserve changed to bike always on
but then why there are less places to go on……

How a small coffee shop changed to cafe coffee day
but then why its feels like shop is far away…..

How a limited prepaid card changed to postpaid package
but then why there are less calls & more messages……

Here i am sitting in my office at night…
Thinking hard about life How it changed…...

How a general class journey changed to Flight journey
But then why there are less vacations for enjoyment….

How an old assembled desktop changed to new branded laptop but then why there is less time to put it on……….

How a small bunch of friends changed to office mate
But then why we always feel lonely n miss those college frnz.….

Here i am sitting in my office at night…
Thinking hard about life How it changed….. How it changed……..