Custom Search

Saturday, December 17, 2011

My thoughts on talent, passion, hard-work and success

I don't know if success can be defined or measured. To me, it's the ability of a person to attain happiness at his will. In that sense, it can be measured to some extent by means of money, friends and other tangible items. But more than any of that, it is the freedom to do what makes you happy which may or many not involve any of the above.
So how exactly do you find success? It starts with finding what you are passionate about, what makes you get up from sleep and be recharged by the mere thought of it. For some people it may be painting, for some it's photography. Or for folks like me, it's an idea to create something, something that makes my life as well as others' easier. Passion motivates you to keep going in spite of the obstacles or the energy you need to spend. It makes you put that extra into something where you could have gotten away without it. But that extra in fact makes a world of difference. Remember that lady at the closed counter, who came out to help you when you really needed it? She didn't have to help you, but when she did, that made a big difference.
It's not always easy to find what you are passionate about, and sometimes you are forced into doing something out of circumstances. I admire those who still manage to find the little things within that they find interesting.

Talent is probably a little easier to define, yet it's more profound. It's an innate skill that lets you do things easily even if you are doing it the first time. Most people are talented in one thing or the other, but few actually find what they are talented in. And even fewer people realize its full potential. I am reminded of this speech by Harsha Bhogle, where he talks about the importance of attitude. I believe that attitude stems from passion. Whether or not that's true, it pushes you to work hard. Working hard is not just about spending too much time, it's as much about applying it the right way. And diligence is perhaps the most important factor for success. A good example I could think of are some of the best players in tennis - Pete Sampras, Andre Agassi and Roger Federer. Based on the variety of shots they were capable of, I always thought Agassi was perhaps more talented than Sampras. But their head-to-head record says otherwise. And that's the difference hard-work can play. Federer is perhaps the best example in tennis for someone who realized his true potential, the summation of talent and diligence.

Friday, December 31, 2010

Happy new year

I have learned a lot in the past two years. I don't wish to list all of them here, but a few things have changed me a lot more than others. This is something which I learned from my friend- life is a like a train travel. To be more precise, it is like a series of train trips, each having a destination. In each of the journey, you will have to share it with your peers who you might become friends with. And sometimes you make friends with people who just happen to be in a nearby coach. You may see some of these people again over another expedition. But you always have to keep in mind that each of us have a different journey to undertake and may have to part at different stations.

It is a great thing to have a clear destination in mind. But you also have to remember, that when you reach your destination, the only thing you can look back to is how your journey was. If you are lucky enough, you may have some of your friends to share the joy with. If you don't have any friends, then it is likely that you missed the person who was in the coach right next to you.

On the eve of the new year, I wish to share something which I learned through experience in the past year.
"Treat the day like any other; Embrace the year as a new lease"
I know this could be interpreted in different ways. I choose to interpret it this way-
Each day is no different in its tediousness. How we put all those days together is what matters. Each year offers the opportunity to forget the past and get on with our lives. In other words, an year is a big picture. If you have that picture in mind, days make more sense. The beauty of each task is in its details. Each day gives you a chance to go into those details. Make the most of it.

Wish you a happy new year!!

Saturday, June 6, 2009

Comparison of Java and C

After 2 blogs on completely different things, it’s finally my turn to go techie. Something which I have always believed I was born to be. A couple of weeks into learning Java, I just couldn’t help but compare it to my beloved C. This is not a comprehensive comparison, as I think it would take an entire book to do that. Neither do I have the time, nor do I have the patience to write that much right now. I don’t make any comments on my knowledge.

I will make sincere effort to make it as unbiased as possible, but sometimes I just can’t help myself, as C is the language in which I think. And to be frank, these languages have their own strength and weaknesses, which can’t be weighed against in all circumstances.

First of all C was developed with system software in mind, the honor going to revered Dennis Ritchie. That was the time when programmers thought about the intricacies of the instruction execution being handled by the processor. What was required at that time was a straight-forward compiler which can translate high-level code into machine code. It was intended for an elite community of programmers who would make minimal number of errors. (“No offense to the try-catch way of thinking being enforced by the Java textbooks”). The basic assumption was that the programmer using C will know exactly what his code is going to do, which is not entirely true anymore.
By the time Java came up, there were a plethora of machines using different kinds of OS running on entirely different architectures. So the focus was on creating a language which is portable, and easy to program. Although it is not difficult to write a portable code in C, it requires a re-compilation which is what Java claims to eliminate. As the kids playing with Java say, Java has a Virtual Machine (which acts as an intermediate interpreter) to convert the byte code to machine code. This has actually made me wonder why they created an intermediate byte code concept. Why didn’t they create something which can directly run the Java code? Well, my guess would be that doing this would have resulted in Java being called a scripting language.
Anyway, Java has a very good support for multithreading and networking, and according to me this is probably one of the main factors which gave it the popularity that it has now. To be frank, implementing these in C requires a lot of effort and time in addition to the knowledge. During the 90’s when internet was fast developing, developing applications in minimal time was a priority. Because of these numerous inherent functionalities that Java provides, programming in Java is all about knowing the language. In comparison, C language is very simple and concise; programming in C requires using a good amount of ingenuity to use the limited resources to satisfy limitless possibilities.

The first example that comes to my mind is the use of function pointers in C. Any complex code in C involves function pointers (I don’t call others complex btw). You need to implement them if you want to implement a call-back mechanism. At the same time Java offers a more obvious way of doing the same using the concept of abstract class. (Note that the same thing can be implemented in a cruder way using interface). Let me give you a code snippet to ponder.

Background: For a particular set of data available, an operator has to operate upon, the type of operator being known only at runtime.

This is what I would use in C:

int Operate(int *operate_function (int, int), int data1, int data2) {

out = operate_function(data1, data2);

}

The function pointer operate_function will point to one implementation which will be chosen dynamically. The different implementations can be done using different functions with the same parameter list and return value.
Now in Java,
abstract class operator {
abstract int operate(int data1, int data2);
}
Class operator1 extends operator {
int operate(int data1, int data2) {
return funct1(data1, data2);
}
}

Class operator2 extends operator {
int operate(int data1, int data2) {
return funct1(data1, data2);
}
}

operator dynop;
dynop = new operator1();// or new operator2() which is to be decided dynamically.
out = dynop.operate(data1, data2);

Object-oriented Implementation in C:

If there is anyone thinking that OO concepts can only be implemented in OO languages, then this is what I would tell them. “I don’t know about other languages, but they definitely can be implemented in C”. And by the way, almost all of them use function pointers. Well, here is how:
1. Data Abstraction
Isn’t it all about hiding the details of the implementation, which is what I have described above?
2. Data Encapsulation
Again, function pointers come into play here. You define a structure containing a function pointer which points to the function to be performed on its data, and what you get is data encapsulation.
3. Inheritance
Well, this is simple. I will use a code snippet here.
typedef struct super {
int a, b;
};
typedef struct child {
super sup;
int c,d;
};
You got it.
4. Modularity
I don’t think anybody questioned the modular nature of C. If they do let them remember that functions are the way to implement modularity.
5. Polymorphism
Function pointer is back. We need to go a step further from our earlier discussion on function pointers. Here is how I am going to do it:
Suppose we need 2 implementations of a function add which looks like
- add(num1, num2)
- add(num1, num2, num3)
The overloading can be done like this:
typedef struct {
int n1;
}numArr1;
typedef struct {
int n1;
int n2;
}numArr2;

typedef union {
numArr1 num1;
numArr2 num2;
}utype;
Define the functions to do the operations:
int add_numarr1(int n1, numArr1 narr1) {
return n1+narr1.num1.n1;
}
int add_numarr2(int n1, numArr2 narr2) {
return n1+narr2.num2n1+ narr2.num2.n2;
}

Now define the function pointer:
int (*add)(num1, utype numarr);
Now, what will you do if you want to have overloading involving different data types? The way is similar, and upon doing a google search, I found someone who has already done that. Here is the link: http://thewizardstower.org/thelibrary/programming/polyc.html

I did not really expect this to go so long, but I think it would not have made any sense unless I wrote what I have written. Hope this makes a good reading.

PS: The codes provided are only samples and no guarantee is provided as to whether they are compilable or not. However, I expect the code to work with minimal changes in which case, there shall be no litigation initiated from my side against the user for using it.


Thursday, October 2, 2008

Comeback of a true champion

“Any man can win when things go his way, it's the man who overcomes adversity that is the true champion.”

Time after time there have been champions from a motley group who have proved this true. But this time, it was special. Federer is an ethereal “human” as hailed by the media and the fans. His reign was the longest in tennis history, which smashed probably half the open era records. He has been an achiever with so much in his repertoire, so much so that what qualifies to be an year of achievement for others is considered as a hapless year for him.

Only a few men who have been noted during their early years for talent have made it to the big stage in their career to become as successful as Federer in Tennis. After being the junior champion in 1998, he came into the spotlight of men’s tennis by defeating Sampras in 2001 Wimbledon. From then on he slowly and consistently moved up to the top position which he deserved. His was not a coronation, unlike the one that Nadal had. It was more of winning a race competing against all others, for at that time there were no kings- all being jacks with ephemeral sinecure. Federer was the one who brought in value and respect to the top position. From a talented short-tempered new kid-on-the-block to the world number one, he has transcended himself beyond the imagination of many. And he has proved his caliber by dominating 4 consecutive years and maintaining himself as an untouchable for most of this time. Such was his level of the game that it took more than 4 years for others to come up to challenge it. Such was the beauty of his game that tennis has many more fans and much more coverage than it used to have a few years back. Such was his poise that people used to admire his candidness rather than abhorring his comments for being arrogance. Probably, no other world number one in any field would have enjoyed so much respect from fellow players and admiration from media.

Very few players in history, if any, would have had such a huge fan following for a game which is not considered as a national game in any country. But this is a man who is what he is and deserves everything he has got and a lot more. But when the year started badly, there were murmurs, and when it continued, it became huge outcries. Hollers enouncing that his time is over and crown prince Nadal is ready for his coronation replacing him. The same media which used to adulate him for his elegance of play and dominance started decrying him for his “human”ness. There have been questions about his confidence level, and “suggestions” from desperate fans which were literally derogatory as far as he is concerned. Imagine the plight of a person hailed as an all-time great receiving instructions from viewers. But he remained calm and aplomb continuing his work. True, his game was not in the celestial heights it used to be couple of years back. But champions are not the ones who win every game when they are playing in peak. They are the ones who find ways to win even when they are playing badly, and self-belief is the last thing they lose. After all, champions are those who don’t quit, and who believe that they can always come back, and who prove it by doing it. And by winning the 2008 US Open, Federer has established himself as a true champion, a role model for the coming generations to emulate, and an inspiration for all.

Sunday, September 14, 2008

My philosophies on life - How to make things better?

Ever been in a situation when you thought nothing is going your way?
Ever felt that the whole world is conspiring against you?
Ever been pulled low by the incidents happening to you and around you?

Essentially all the above questions are fundamentally same; and the situation in which you are in can be basically categorized as bad luck. Now, I would say that this can happen to any human being at any point of time. There was a time that my mother would say that you should pray and have faith in god, that he will set everything straight. For those who have staunch belief in god this may sound relieving. But, since I am closest to an agnostic and since such kind of people are not uncommon, the above “words of relief” does not offer any consolation to many.
First I would tell why those words does not offer any solace to me. Well, I have been reading a lot of Ayn Rand in the past 4 years. So much so that I came up with my own philosophy, which is apparently similar to hers. According to me, it’s up to each one of us to choose our own destiny. If you observe nature, there is a definite duty for every being on Earth. This duty is critically linked to its survival, and fulfilling this duty is the fairest thing one has to do. For example, for its survival a carnivore has to prey on another animal. I know I might invoke criticism if I compare humans to animals; anyway my intention was to give an example. So those who did not like it can probably get things clarified when I write my next article. For the time being, I would just say that nature considers all beings as equal and ideally I would also want to do the same.
Without wasting any more of anybody’s time I would get back to the topic at hand. I have seen a few adolescents and teenagers asking questions like “Why do they say that God will set things right?”, “Why not us?” I would say you people are thinking in the right direction. If it is something that concerns us, we have the highest responsibility to set it right. To people who come up with questions like “What would you do in a situation which is not in your control?” I would say no situation is generated as out of control. It gets out of control because you were not responsible enough at the right time, at a time when it was in your control. Once it gets out of your control, you just need to have faith in yourself and be ready to take things as they come.
For those who are caught up in a world between the agnostic and the believer, let me tell you one thing- it is alright if you do not believe in God, but it is never okay if you do not believe in yourself.
So I would say the most necessary thing that you need to come out of the abysmal situation is to have faith in yourself. You should have the confidence to make decisions, and to justify it. You should have the guts to stay responsible for your actions and its consequences. I don’t believe in classifying actions as right or wrong- it depends on perspective, and it might even change with time. Important thing is “hold-on”, be persistent till you reach your goal. You never know how close you were to success if you quit before you reach there. So go for it, be there.


Epilogue:
For those who want more motivation, I am giving a link to the Wikisource of the poem "If"

PS: This being my first blog, I am expecting a lot of comments and criticisms.