Editor’s note: Former Triangle tech entrepreneur-turned-academic Vivek Wadhwa is a frequent contributor to WRAL TechWire.

SAN FRANCISCO – I still remember the first time I heard about computers. They were straight out of science fiction. I began to dream about working with them. Then I got my big chance. I enrolled in one of the first courses in computer technology at what is now the University of Canberra. I couldn’t imagine doing anything but writing computer code for a living.

And that is what I did for the first ten years of my career.

Then an opportunity came along that I couldn’t resist. The technology that I had built at First Boston (now Credit Suisse First Boston) was so advanced that IBM offered to fund a spinoff to market it. This would require me leaving a ridiculously high-paying job in the investment banking industry. I knew that most startups fail; I was no risk taker and I had a child on the way. Yet I listened to my heart and took the plunge. I became an entrepreneur.

We grew the startup, called Seer Technologies, to 1,000 employees and $120 million in annual revenue in a short five years. Then we took it public. The IPO was fun, but the experience afterwards was like a nasty hangover. The excitement was gone. I got sick of the big-company politics and the obsession with meeting short-term revenue goals. I wanted out.

Microsoft tried recruiting me and told me they would have offered stock that was worth a fortune, but I could not stomach the thought of going back to the corporate world and working for someone else. So I chose to stay an entrepreneur — and start another company.

The new company, Relativity Technologies, was an amazing success until it ran into trouble after the dot-com bubble burst in 2000 and the economic shock of 9/11. I fought the battles to turn the company around and won — until my body gave in on me and I had a stress-induced heart attack.

Then I had to make an involuntary transition — out of the tech world and out of the stress. My new transition was into academia, which I knew little about. I wanted to teach and mentor students but had never done such a thing before. I figured it out and ended up with simultaneous appointments at several universities including Duke, Harvard, UC-Berkeley, Stanford, Emory, and Singularity University.

Now I teach, write, mentor startups, and do some professional speaking. I had none of these skills when I was young and I could not even have imagined that I would be doing anything but computer programming.

The key lesson I have learned is that life makes its own plans and you have to go with the flow. You can fight, be upset, long for what has changed. But you can’t change destiny when your body breaks down, things go direly wrong, or a disaster happens. And you have to be ready to jump on great opportunities when they come along — even if it means leaving your previous successes behind.

You also have to accept failure when it happens. We all make mistakes and things go wrong at every junction. We have to learn how to learn from these. Admit that you did something wrong and see what lessons you can learn from this. We can turn defeat into a victory by learning from it.

Another important lesson I have learned is that one can do everything right and fail — and do everything wrong and succeed. Luck and timing play a big role in success. To maximize our chances of success we need to work hard and keep trying. We need to keep reinventing ourselves and learning. To me, that is what life is all about.

(C) Vivek Wadhwa