http://www.scribd.com/doc/48750547/AJS
Nice presentation touches main concept of the language.
Monday, March 11, 2013
Saturday, March 9, 2013
Function Literal vs Function definition
Function Literal
var Class = function () {};
vs
Function Definition
Function Definition
function Class () {};
the former is "hoisted" to the top of the current scope before execution. For the latter, the variable declaration is hoisted, but not the assignment. For example:
// Error, fn is called before the function is assigned!
fn();
var fn = function () { alert("test!"); }
// Works as expected: the fn2 declaration is hoisted above the call
fn2();
function fn2() { alert("test!"); }
http://stackoverflow.com/questions/4508313/advantages-of-using-prototype-vs-defining-methods-straight-in-the-constructor
Adding methods to a class vs adding methods to a class's prototype
https://www.quora.com/JavaScript/What-are-advantages-to-adding-methods-to-a-class-vs-adding-methods-to-a-classs-prototype
var myClass = function(prop1, prop2) {
http://stackoverflow.com/questions/4508313/advantages-of-using-prototype-vs-defining-methods-straight-in-the-constructor
Snippet 1 (Adding methods to a class)
var myClass = function(prop1, prop2) {
this.prop1 = prop1;
this.prop2 = prop2;
this.method1 = function() {//blah}
this.method2 = function() {//blahblah}
}
Snippet 2 (Adding methods to a class's prototype)
this.prop1 = prop1;
this.prop2 = prop2;
}
myClass.prototype.method1 = function() {//blah}
myClass.prototype.method2 = function() {//blahblah}
Snippet 1
- Two functions are created for every construction of
myClass can give you access to private variables and constructor arguments
Snippet 2
- the two functions are created once: when the prototype is filled.
- gives better memory usage
- Methods that inherit via the prototype chain can be changed universally for all instances
- For instance, you can extend the built-in String object by adding a trim function to it and all future instance of that object will share the trim function.
http://stackoverflow.com/questions/4508313/advantages-of-using-prototype-vs-defining-methods-straight-in-the-constructor
Sunday, July 29, 2012
Ten point everyone - ten commandants
1. We usually make mistake in things we are proficient in.
2. Anything that can go wrong, will go wrong. (Murphy Law)
3. Never tell a lie for a mistake , accept it. (Universal Truth)
4. Don’t let yourself free, keep yourself busy in doing things. There are no free lunches.
5. You may not reap for your intelligence but you will be paid for your sincerity and hard work.
6. Don’t consider yourself over smart. People around you can be smarter than you.
7. In this fast life get some time for self-review (introspection).
8. Your conscience will tell you whenever you are doing wrong. Listen it carefully.
9. Remember that you are human being, not machine therefore act wisely. Your brain is 1 feet above your heart so use it first.
10. People above your hierarchy are usually smarter than you , so don’t fool them.
2. Anything that can go wrong, will go wrong. (Murphy Law)
3. Never tell a lie for a mistake , accept it. (Universal Truth)
4. Don’t let yourself free, keep yourself busy in doing things. There are no free lunches.
5. You may not reap for your intelligence but you will be paid for your sincerity and hard work.
6. Don’t consider yourself over smart. People around you can be smarter than you.
7. In this fast life get some time for self-review (introspection).
8. Your conscience will tell you whenever you are doing wrong. Listen it carefully.
9. Remember that you are human being, not machine therefore act wisely. Your brain is 1 feet above your heart so use it first.
10. People above your hierarchy are usually smarter than you , so don’t fool them.
Tuesday, January 26, 2010
Republic day at Big Bazaar
This republic day we decided to shop at big bazaar for our regular grocery stuff completely unaware of what’s going on there? The big bazaar was celebrating 4 days of saving offer and 26th was the last day. The crowd at Big Bazaar can easily beat the Haridwar kumbh . People were flowing like water. The fear started to flow into our nerves as soon as we enter into Bazaar. There was no cart to place the stuff and buckets are always difficult to carry. Somehow we manage to arrange 2 bucket which could be utilized for our shopping. People were nudging each other and making their way. There was definite need of traffic policemen to control the human traffic. The situation was ideal for stampede and a single announcement of free stuff could have made it possible.
After buying couple of stuff we have decided to keep our buckets in a place and then bring other stuff to it instead of carrying it, as carrying them was more difficult than scoring a century in Perth. Someone also need to stand near it as there was also scarcity of bucket and the most expensive part is, in case it is hijacked then you need to again shop for things, which was next to impossible. As I was standing near our shopping buckets I got enough time to analyze different consumers. As Jan 26 was national holiday people have decided to bring whole family to Big Bazaar shopping because it was economical than taking them to other places. First time I realized that kids are no more over head to any trip and they could bring delight to your shopping. The parents have asked them to explore different items kept across the aisle and inform them. The kids were acting as spy in getting all the info and their movement were so swift (due to their size) that having more kids turned out to be the boon. The vitality of this information can be understood by the fact that a big bazaar worker asked me “Where is the Horlicks sir?”. Standing beside the chocolate shelf and as a responsible person I was arranging them as soon as a small nudge from deluge of persons made them fall. It kept me busy till the time my friend came after discovering Vim bar. Suddenly I heard the election campaign with loud speaker. I was surprise to know that Noida is still having some election pending. Soon I realized that this campaign is for shirt which was available at 999 for 3. A man was leading the campaign with a mic followed by person with placard describing the offer.
Another surprising fact was that the most common item bought was packets of aluminum foil. My sarcastic brain thought that are so much food is still packed from home? Then I soothe myself acknowledging the fact that men have also learnt to cook.
The climax was still left, the billing counter. As we Indian always believe in jugaad, so how we could be left behind here. As we have not forget to keep handkerchief to reserve our places similarly ambassador were sent earlier to reserve the billing slot so that they can save time while billing. The stuff were billed and kept adding by their fellow. Some have objected and others were mute spectator, but I was smiling murmuring "Happy Republic Day".
I don’t know whether we got some good stuff or saved some rupees while shopping at this place but definitely I could not justify the 3hr time of 2 engineers for this shopping. We have definitely paid more price than debit card swipe.
After buying couple of stuff we have decided to keep our buckets in a place and then bring other stuff to it instead of carrying it, as carrying them was more difficult than scoring a century in Perth. Someone also need to stand near it as there was also scarcity of bucket and the most expensive part is, in case it is hijacked then you need to again shop for things, which was next to impossible. As I was standing near our shopping buckets I got enough time to analyze different consumers. As Jan 26 was national holiday people have decided to bring whole family to Big Bazaar shopping because it was economical than taking them to other places. First time I realized that kids are no more over head to any trip and they could bring delight to your shopping. The parents have asked them to explore different items kept across the aisle and inform them. The kids were acting as spy in getting all the info and their movement were so swift (due to their size) that having more kids turned out to be the boon. The vitality of this information can be understood by the fact that a big bazaar worker asked me “Where is the Horlicks sir?”. Standing beside the chocolate shelf and as a responsible person I was arranging them as soon as a small nudge from deluge of persons made them fall. It kept me busy till the time my friend came after discovering Vim bar. Suddenly I heard the election campaign with loud speaker. I was surprise to know that Noida is still having some election pending. Soon I realized that this campaign is for shirt which was available at 999 for 3. A man was leading the campaign with a mic followed by person with placard describing the offer.
Another surprising fact was that the most common item bought was packets of aluminum foil. My sarcastic brain thought that are so much food is still packed from home? Then I soothe myself acknowledging the fact that men have also learnt to cook.
The climax was still left, the billing counter. As we Indian always believe in jugaad, so how we could be left behind here. As we have not forget to keep handkerchief to reserve our places similarly ambassador were sent earlier to reserve the billing slot so that they can save time while billing. The stuff were billed and kept adding by their fellow. Some have objected and others were mute spectator, but I was smiling murmuring "Happy Republic Day".
I don’t know whether we got some good stuff or saved some rupees while shopping at this place but definitely I could not justify the 3hr time of 2 engineers for this shopping. We have definitely paid more price than debit card swipe.
Friday, November 27, 2009
Love insurance
Series of incidents from few months have inspired me to pen down my thoughts. The haunting thought of people and their moral values frighten me. A young charming boy agrees for arrange marriage to soothe his parents, want to palliate his pre-marital gal frnd by fighting with his wife and alleviate himself from all responsibilities by suicide. The wife also follows the same step to assuage her pain. This is not a hypothetical story but an incident which came to me like a thunder bolt. Similarly there are plenty of incidents where people find it hard to decouple themselves from their past and their acts.
Looking from the eye of an entrepreneur I see a business opportunity here. What about love insurance? Like we have kidnap and ransom insurance in countries like Mexico , Venezuela and Nigeria where such crime are common someone can think abt luv insurance in India. I have chosen India because ours is the only country where you can bet on these values. The family system is so strong in our country that it has surpassed many recessions and depressions in which the richest economies like America and Britain collapsed. I am also hurt by the current trend which is precursor of deterioration of such values. I could see that 10 years from now people will start insuring their engagements and marriage. The company has to pay the victim insured amount for their break ups. The premium would be decided on the basis of risk involved so it is obvious that engagement would be having more premium than marriage. Premium will reduce to almost half amount once you are married and will again decrease further once you are blessed with a child. No premium has to be paid after age of 50 but you would continue to be insured under it.
Huh.. I am really disappointing while writing this. Who could think of that there would be price tag of your tears and emotions? Is I am seeing apocalypse in near future? This is very hard to describe. It is ‘I’ which is creating problem. It is ‘me’ which is causing turbulence, it is ‘mine’ which is reason for all agony. Nobody cares about ‘they’ ‘them’ or ‘theirs’.
Looking from the eye of an entrepreneur I see a business opportunity here. What about love insurance? Like we have kidnap and ransom insurance in countries like Mexico , Venezuela and Nigeria where such crime are common someone can think abt luv insurance in India. I have chosen India because ours is the only country where you can bet on these values. The family system is so strong in our country that it has surpassed many recessions and depressions in which the richest economies like America and Britain collapsed. I am also hurt by the current trend which is precursor of deterioration of such values. I could see that 10 years from now people will start insuring their engagements and marriage. The company has to pay the victim insured amount for their break ups. The premium would be decided on the basis of risk involved so it is obvious that engagement would be having more premium than marriage. Premium will reduce to almost half amount once you are married and will again decrease further once you are blessed with a child. No premium has to be paid after age of 50 but you would continue to be insured under it.
Huh.. I am really disappointing while writing this. Who could think of that there would be price tag of your tears and emotions? Is I am seeing apocalypse in near future? This is very hard to describe. It is ‘I’ which is creating problem. It is ‘me’ which is causing turbulence, it is ‘mine’ which is reason for all agony. Nobody cares about ‘they’ ‘them’ or ‘theirs’.
Sunday, September 27, 2009
Importance of higher education in India
With recession round the corner, getting jobs is biggest nightmare in current scenario. Current slowdown has opened the pandora box and challenged the education system in India. If I could flashback period before 15-20 years ago, getting graduate degree from a college would open many new avenues for employment but now BA/BSc are far from even considered to be a degree and BE/BTech has replaced BA/BSc. There is hardly any guy who is ready to settle down for less than an engineering degree. Now this again raises the bigger question regarding employability of the candidate. Recent study says those more than 50 % of the engineers are unemployable. As per 2008 stats around 8 lakh engineers are graduating every year from approximately 2400 engineering college across the country. The irony of it all is that the engineering colleges which supposed to churn out professionals are actually getting reduced to degree vending machines producing largely good for nothing engineers.
Here is the time to seriously introspect ourselves and think about getting back the identity you lost among such large number of professional. The young Indian youth has come out of his comfort zone of mere job after graduation and started thinking for stability in future. Current recession was an eye opener which paved the way for higher education ME/MTech/MBA in India. The count of engineering graduates fighting for these courses has suddenly increased by leaps and bound. The coaching institutes have become active and one can easily see the spike in the count of students enrolling for these courses.
Hey students! What are you thinking now? It’s not about quantity but its quality which matters. We have progressed generation by generation. Our 10+2+3 education system has changed to 10+2+4 which will soon transform to 10+2+4+2, once every individual realize the power of higher education.
In the word of Aristotle “The roots of education are bitter, but the fruits are sweet”.
Here is the time to seriously introspect ourselves and think about getting back the identity you lost among such large number of professional. The young Indian youth has come out of his comfort zone of mere job after graduation and started thinking for stability in future. Current recession was an eye opener which paved the way for higher education ME/MTech/MBA in India. The count of engineering graduates fighting for these courses has suddenly increased by leaps and bound. The coaching institutes have become active and one can easily see the spike in the count of students enrolling for these courses.
Hey students! What are you thinking now? It’s not about quantity but its quality which matters. We have progressed generation by generation. Our 10+2+3 education system has changed to 10+2+4 which will soon transform to 10+2+4+2, once every individual realize the power of higher education.
In the word of Aristotle “The roots of education are bitter, but the fruits are sweet”.
Subscribe to:
Posts (Atom)