Thursday, November 16, 2017

Shimoga to Sringeri


Shimoga or Shivamogga (originating either from Shiva-Mukha: Face of Shiva, Shivana-Moogu: Nose of Shiva, Shivana-Mogge: Flowers to be offered to Shiva or "Sihi-Mogge", meaning "sweet pot), is a scenic town on the banks of river Tunga, the gateway of Malnad.

A road trip from Shimoga to Sringeri, to visit the Sharada Peeta established by Adi Shankara proved a spiritual joyride en route lush green paddy fields, arecanut and coconut groves.

Adi Sankara is believed to have seen a snake protecting a she-frog from the hot Sun during its labour here. Overwhelmed by the sanctity of this place, he founded the Sharadamba Temple in the 8th-century, the first of the four mutts that he established pan India.

Passing through Thirthahalli, the Neolithic archaeological site, one recalled two popular legends:

At the behest of his father Jamadagni, the sage Parashurama beheaded Renuka's head with an axe. He tried to wash the blood stains off the axe by dipping it in various rivers, but a sesame-sized blood stain remained, until he dipped his axe in Tunga near Thirthahalli. From this Parashurama Thirtha, came the name Thirthahalli. According to a Ramanaya legend, Maricha (in deer form) was killed by Lord Ram near Thirthahalli, at a place which was named Mrugvadhe (killing of a deer)

Shivmoga is a tranquil place, with a bustling bazaar, cheerful people and a rich collage of mandirs and masjids, invariably built adjacent to each other. Scenic waterfalls, majestic hills, dense forests, landmark forts, swaying palms and paddy fields...you find them all in this region which was ruled by Kadambas, Gangas, Chalukyas, Rastrakutas, Keladi and Vijaynagar Kings. More than a tourist destination, Shimoga is an industrial town and an educational hub.




Saturday, November 11, 2017

A byte of an Eternal Dream


Meet Swaroop C H, The Dreamer



Engineering manager, Machine learning, Helpshift, San Francisco,

Author of A Byte of Python and A Byte of Vim
Passionate Runner, Trekker, Cyclist
A round peg in a square hole, Rebel with many a cause and not a single pause (like his mentor and Helpshift co-founder Baishampayan BG Ghose)


Was programming a conscious career choice?


Yes indeed! I have fond memories of my introduction to computers at school. We had a computer lab class, probably in the 7th or 8th standard, where we were taught Logo. I was simply blown away when I typed in something and it did something! By the time we made it draw triangles and circles, I was hooked. I knew this is something I wanted to pursue life-long. And I would say, that pursuit, which has now manifested into an aspiration of becoming a good programmer, continues to this day. Mine was a typical middle-class upbringing. My grandfather and father were both doctors. I was sure the medical profession didn't suit me, so I was glad that I found my calling in the equally radical field of software.

Your entrepreneurial strides are beyond doubt phenomenal. How did it all unfold?

That's a lot of memories we are talking about! I feel I must elaborate in terms of milestones:

Early Entrepreneurship
I studied B.E. Computer Science at PESIT in Bangalore. Looking back, I feel blessed to have joined this college, as also my batch. My classmates were an enterprising bunch and I learnt a lot from them. It was here that I met my project partner Yashwanth C P (now a senior engineering manager at Amazon). Yashwanth was an entrepreneur at heart. When I showed him my CD burner one day, he came back with an idea, of downloading Linux ISOs, burning them to CDs and selling them. We were not sure if we'd make any money this way, but hoped to meet interesting people at least, which did happen! We ended up shipping CDs to far-off places including Mombasa in Kenya. This was about 12 years ago, when Internet bandwidth was truly expensive and much slower.

College MySQL experience
During my B.E. 6th semester at VTU, we had a DBMS lab for practical application of database concepts and SQL. Going against the prevalent student norm of using pirated Oracle and VB copies, Yashwanth and myself decided to tread a different path. We were big open source fans by then, and our personal manifesto had no place for Windows programming (No offence meant to Windows and its users)

Coming back to DBMS lab, both of us sought to do a "real world" project, and finally zeroed in on creating a medical lab management software for a doctor uncle. We were absolutely thrilled when he insisted on Linux. This preference was unexpected, coming from the user side. We worked on the "analysis" and database design during the pre-semester vacation. I called our brainchild Diamond which stood for DIAgnostic Medical centre OrgaNizing Device. Our chosen database was MySQL since it was easy to get by, at that time. For our GUI toolkit, I preferred GTK but Yashwanth was adamantly in favour of Qt. Finally, I had to relent, and, in hindsight, I feel it was a good decision. We pored over the tutorials to feel at home with the rocking Qt Designer.

While registering our project details, our teacher asked us not to use MySQL, belittling it as a small utility in Linux to store data. He recommended Oracle. We took several moments to recover from the rude shock and when we did, I vociferously fought the MySQL case citing its wide industry application. When he refused to budge, we escalated the matter to the Asst. HOD who posed a fresh round of resistance. After a grueling duel, he ultimately gave up, overwhelmed by the sheer weight of our conviction. That I had a rapport with him also helped.
We had an awesome time learning MySQL and Qt. The demo in our lab exam went well and our invigilator was impressed. Unfortunately, after all that hard work and tenacity, my uncle never used Diamond due to reasons beyond my comprehension. Nevertheless, I was glad that I did the project because I learnt a lot which has kept me in good stead.

Yahoo escapades
I remember asking our department's Assistant HOD whether our semester laboratory internals tests could be postponed so that we could attend the 2003 Linux Bangalore. He shooed me away from his office. My partner Yashwanth and myself wished to be at Linux Bangalore at any cost. So, on the first day of the event, we reached our college lab early and requested Shrividya ma'am (she was a GCC contributor in the early 90s) to have a look at our project right away so that we could reach the venue in time. Fortunately, she agreed and sent us off even before clearing the prior batch projects. Hopping on to our bikes, we reached IISc and had a terrific time there. The Miguel-and-Nat show was the highlight of course, and I relished every moment.
Later that day, we rushed back home for our Perl/CGI project due for submission the next day. We had made no progress on the project for the whole semester, thanks to our time spent for the (erstwhile) LinCDs.com where we sold CDs with Linux at cost-effective prices. We made the CD website venture our term project the same and since it was already running live, we tweaked it to make it VTU-compatible in just a few hours.

The next day of the Linux event, Yashwanth parked himself at the Yahoo! booth while I was glued to Miguel and Nat. Eventually, he got into Yahoo! interviews and eventually joined as an intern. During his interviews, he mentioned our LinCDs.com venture. The interviewers were (sort of) impressed and when they learnt I had written it, they asked me to send my resume. I then got into the programming tests. When I was asked to write a shell. I was happy I got a problem which I had some clue about.

I was asked to implement program execution, tab completion and a history, and was given any choice of language (the platform had to be FreeBSD though), and about 3-4 hours of time. So, I chose Python and although they were surprised, they asked me to go ahead. I struggled for nearly 2 hours trying to get character-by-character input working! I just didn't know how. I finally asked Kalyan (who was sitting in the same cubicle as me) whether I could use the internet and he said of course. Duh! Then, in two seconds Google (yes, Google) led me to a Python Cookbook recipe which solved the problem for me. After that, it was a piece of cake to use the os.spawn method to run the commands, used os.listdir to get the directory contents for tab completion, and finally just used a list to maintain history. I was so relieved that I got it working.
When a different set of interviewers came to ask me about the implementation, they were surprised to know that I wrote the program in Python and even wrote a "book" on it. A funny moment was when they asked how much history I was maintaining, and I said unlimited, because the Python list can store as much as the computer's memory allows, and they didn't quite expect that, mostly because they were used to #define SIZE 100 in C++ programs written by other students. So, that's the story of how I got into Yahoo! It's interesting how it all started with Yashwanth and myself playing around with Red Hat 7 Linux and getting interested in open source...


Days of ‘Ionic’ bonding

Ion was a hardware that a few friends and I built and sold. It was a wall-socket charger for the iPod. Back then, the iPod came with only a wire that connected to the USB. If you needed to connect to a wall-socket, it would cost a bomb, something like Rs. 1200. We made and sold one for Rs. 400. The parts were bought and manufactured in Bengaluru itself. I handled the ecommerce side of things. We sold well only with minimal media publicity. We thought we could do a lot more and incepted IonLab. Sadly though, we were guilty of a few typical startup blunders and folded within a year.



Few Ionic (read Iconic) lessons that Swaroop feels duty bound to share with the community:

Stop reading. Start doing.
Simply reading A-Z of books and essays is not important, you must internalize the learnings by testing it out on the field and realizing the value for yourself, instead of exclaiming "that makes sense" and forgetting about it a few minutes later.

Empathy matters.
For someone to gauge the depth of what you are going through calls for the key element of empathy, which in turn merits a deeper understanding of the context, which in turn comes about best only with personal experience of having walked on the same forsaken path. Else, even friends-who-know-you may not get you, even though they are intelligent and mean well. Now imagine how much empathy you should have for the motivations and work life of your customers!

Business is not a big deal, it's only a mindset.
Doing a tech business means you should know both tech and business really well.

Focus matters.
Maintain good relationships with partners, vendors, mentors, and all other folks that you meet in the course of your business. Don't look at these relationships as opportunistic, look at it as an opportunity to co-create and learn. Track your cash flow. Yes, you will earn millions later, but if you don't have money now, you'll die. You may not realize that the single highest factor why startups die is because of bad cash flow.

Don't trivialize any aspect
Whether your legal company paperwork or your project timelines or thinking long-term as well as short-term, or networking with similar folks…don’t trivialize anything! Tech people think technology is everything and other people have it easy. I learnt the hard way that "Easy is a term you use to define other people's jobs." I have a lot of respect for marketing and sales folks now. They have a really tough job, because it is about tenacity and psychology, compared to tech work which is write-once and scalable.

Have a sense of urgency
For every decision (and you will have a lot more of them than you realize), make sure that you do due diligence but at the same time, have a sense of urgency.

Bottom-up always wins
This is the single most important learning, if I had to pick one. Time and again, I've observed that bottom-up always beats top-down approach to problems. Note that I'm not discouraging you from planning, but I'm discouraging you from focusing purely on the plan. The plan is a guide to your actions, you should not spend more time on the plan vs. the actions and results!
As Linus Torvalds says, "Software is grown, not built." Mull that!

Learn to accept failure before defying it
You walk into a new restaurant, and try the food. It can be good or bad. But you still have to pay the bill! You don't know whether your effort is going to succeed or not, but you still have to put in the effort. The problem with most people is, they don't want to risk eating bad food, that's why they keep going to the same restaurant, even if they are bored of it!

When to call yourself an entrepreneur
I have this personal demarcation that I will call myself an entrepreneur when I have
(1) created something new
(2) made money.
Until then, I'm only a startupper (someone who has done or been in a startup).

Realm of Infibeam
I joined Infibeam to work on the Build-a-Bazaar platform (like Shopify). I had great fun there. I, along with two co-founders, built the architecture. It's heartening to see that Infibeam launched an IPO last year, largely soaring on the success of the Build-a-Bazaar platform.

Freelancing stints
After Infibeam, I got into consulting because I was yearning for flexible timings. I first went on memorable jaunts during this period: Bengaluru to Mysore road trip for a half-marathon, visit to Mulki for my wife’s surfing lessons and a Goa vacation for chilling out.

Joshua Schachter
Rejuvenated after the break, I went into consulting mode and worked with Joshua Schachter, founder of del.icio.us, the bookmarking website which made “social filtering”, “tagging” (at the same time as Flickr) and “Web 2.0” common buzzwords. I stumbled upon his tweet calling for remote Python developers for his pet projects. I responded, and we exchanged many a great idea. Over time, what interested me the most was not the idea itself but rather the evolution of the idea while iterating over prototypes and how Joshua creates this evolution. It’s been fascinating to be a “fly on the wall” in this process.



The first project was ClueDB, a “tips and tricks” website, or a “lifehacker, by the people” as I like to call it. Built using MongoDB, Flask, my flask-boilerplate project, HTML5 Boilerplate, jQuery, jQueryUI, Twitter/OAuth integration, and Fabric. Standard stuff. The latest project was StackParts.com - a simple catalog of parts for a web stack so that developers can weigh in their options and discover new ones for their next webapp. Built using Tornado, Python, Fabric and YAML files as the NoSQL database. This project was again interesting for the use of tags to organize projects and their relationships, evident on any project page on stackparts.com.

NextDrop
NextDrop was seeded by a group of Berkeley students including a Ph.D researcher in environmental science. One of the team members, Thejovardhana Kote did his masters thesis on NextDrop and made the initial prototype. Eventually he had to make the hard decision of moving on to something else and he asked me to step in. Since I had just then made the decision of freelancing, it was perfect for me to earn money as well as make a social contribution at the same time, so I readily agreed.



NextDrop gathers water supply information from the valve men through SMS and IVR and disseminates the information to residents of respective areas. What’s so critical about this broadcast, you may ask! Well, outside of major cities, water gets delivered once in several days, and on those “water days,” someone (usually the women) has to stay back and ensure to collect enough water. They usually don’t have enough water storage capacity for that many days and end up having to collect as much water as possible in vessels and pots.

Registered users of NextDrop spread across Karnataka get an advance intimation text message on their phone informing them of the time of water supply in their area. Users can also ask for specific information related to water supply through an SMS. It took me some time to figure out a different domain (SMS, IVR, non-computer-literate users) but eventually I got the hang of it. The challenge for me was to get the system to a production level and subsequently, I embarked on a complete rewrite of the system.

In ‘Auto Shift’ mode - Automatic and Helpshift

Since I knew Thejo Kote from my NextDrop stint, I joined him in his next adventure Automatic.com which was a "FitBit for your car": studying and analysing car performance, diagnosing issues, tracking trips & miles for business and the like. I worked here for a good five years – 2.5 years remotely from India, and 2.5 years in San Francisco when the team grew from 6 to 60. Automatic was acquired by Sirius XM this year, which was a big event for us.




My recent career path has been bizarre given that it’s gone furiously back and forth, in ‘Auto Shift mode’ literally: Automatic (India) to Helpshift (India) to Automatic (USA) to Helpshift (India)…



I first joined Helpshift because my wife and I got to know we are having a baby and we didn't want to move continents during this time. Automatic came back to me the very next year and urged me to join its San Francisco team. We took the hard decision of leaving Helpshift and moved to the US, not wanting to miss the illuminating experience of life in different country and environment. In hindsight, I'm glad for having done so as it proved momentous. We learnt a lot more about ourselves and what we seek from life, as also met many great people.

Baishampayan Ghose (BG), my friend, mentor, and co-founder of Helpshift, moved to San Francisco soon after and formed a new team focused on machine learning. When he asked me to be a part of it, I immediately said yes, because I was happy to be back with the Helpshift team again. They're an awesome lot, astutely assembled by the Helpshift co-founders Abinash Tripathi and BG.

You are distinctly open source in conviction and character. What drew you to the movement?


I was instinctively drawn to the movement, thanks solely to my seniors at PESIT, like Kalyan Varma, who introduced us to Linux and free & open source software.

I simply loved the idea of free software, where it is licensed under a copyleft license which guarantees you the freedom to run it, and that people who make changes contribute back those changes to the software, thereby enabling improved versions for community use.
In hindsight, I wish I had spent a lot more time reading code in depth. For instance, I contributed towards SQLite support in Django long ago, but I feel I should have delved deeper in the Django project. College students these days have the right idea and initiative, thanks to Google Summer of Code.

How did the thought of writing books on Python and the Vim germinate? Any new books in the offing?

My first brush with Python happened when I needed to write an installer for enabling Diamond installation. software I had to choose between Python and Perl bindings for the Qt library. I did some research on the web and I came across an article by Eric S. Raymond, a revered hacker, where he talked about how Python had become his favourite programming language. I also found out that the PyQt bindings were more mature compared to Perl-Qt. So, I zeroed in on Python. This prompted a new search for a good book on Python. I couldn't find any! I did find some O'Reilly books, but they were either too expensive or were more like a reference manual than a guide. So, I settled for the Python documentation which was too brief. It did give a good idea about Python but was not complete. I could work with it given my programming experience, but it was unsuitable for newbies.


When I installed the (then) latest Red Hat 9.0 Linux, I was playing around with KWord. I got so excited about it that I suddenly got the idea of writing some stuff on Python. I wrote a few pages, that soon became 30 pages. This rapid progress inspired me to capture the writing in book form. After a lot of rewrites, it has reached a stage where it has become a useful guide to learning the Python language. I consider this book to be my contribution and tribute to the open source community. In the true spirit of open source, I have received lots of constructive suggestions, criticisms and feedback from enthusiastic readers which has helped me improve this book a lot. It needs the help of its readers to point out any parts of the book which are not good, not comprehensible or are simply wrong. (drop a Mail to blog@swaroopch.com or post a tweet to @swaroopch)

After the Python book, several years later, I wanted to learn to use Vim in depth, so I read the mammoth documentation and then proceeded to explain it in my words, and it became A Byte of Vim. Interestingly, after writing that book, I was quite disillusioned with the VimScript scripting language.

Several years later, when I joined Helpshift, backend code was written mostly in Clojure - Clojure and other Lisp languages are best written with Emacs, so I was introduced to Emacs and I enjoyed the Elisp scripting language. After that, the Spacemacs project commenced, and I loved the idea of preconfigured Emacs with "batteries included". Spacemacs is a new way to experience Emacs -- a sophisticated and polished set-up focused on ergonomics, mnemonics, and consistency. I contributed many changes to the Spacemacs project, and I'm now an ardent user of Spacemacs & OrgMode. In fact, I wrote this text using OrgMode.

There are no plans of writing new books as of now. If I see a "beginner's guide" gap in some other project and field that I know in greater depth, I might take up that challenge. Until then, I am content with reading, learning, and implementing.


How was the environment at Yahoo during your intern days? Any specific learnings?


Yahoo! Bangalore in 2004-2006 was one of the best environments I ever worked in. Simply because of the immense talent of people in that small office back then, and the steep learning curve that I was rapidly taken through. It made me realize the value of the first job in any career. If things go right, it sets your trajectory in the right direction. I was lucky that Yahoo! happened to me. I hope more college students acknowledge the importance of the debut job, and then research and plan meticulously.


Could you describe your current role in the Helpshift machine learning team?


After attending a remarkable AIFrontiers conference in Santa Clara, California, I enrolled for the Udacity Deep Learning course, slogged through it and successfully graduated.

The good part about the course was the weekly schedule of lessons and projects. As I keep saying to friends and colleagues, nothing in the modern world ever gets done without a deadline. The bad part was that the course was literally being built while we were enrolled, so we would see a mad rush by instructors to write and create content every week for the upcoming week, which was okay by me, because introducing a topic that has only become feasible in recent years and making it accessible in a way for people who don’t have PhD in machine learning, is tough and I was grateful. Getting introduced to data science, machine learning and deep learning in a few months has been a grueling and happy experience.

Just when I was thinking of venturing into machine learning space for actual work, my mentor BG offered the Helpshift opportunity. It was a no-brainer to say yes. At Helpshift, we are focused on building a machine learning platform to enable our data scientists to do more and better experiments, and take it to production. We believe in a strong engineering mindset, also applies to data science, and we take inspiration from papers such as those by Google.

What in your reckoning are the top machine learning challenges? Both from demand side and supply side?

We feel Machine Learning challenges lie in the ability and agility to think in terms of right tool for the right job, reliability, explainability and intuitive user experience. Currently, AI is being oversold and unfortunately not all of it is substance. There’s a pressing need to rightsize expectations about what Machine Learning can do and can’t do. For example, there’s so much buzz around new ML algorithms, but few realize the real need is lots of manually labelled data, which is what makes the magic happen. I also find ethical usage of Machine Learning a huge concern.

On the demand side, proper engineering from feature engineering to training to monitoring are key aspects. AI readiness is as important as AI. On the supply side, there’s clearly a talent shortage. But the situation is gradually improving.

Any courses that you would recommend to aspirants?

Udacity Deep Learning course and Fast.AI courses are definitely a good idea. Beyond that, I believe in what BG says "Read papers. Read code. Read history."

Would Python play an integral role in the fast-evolving ML revolution - how does it compare with MATLAB/Octave and R?

Yes! Data Science world has mostly converged on Python in the form of Numpy, Pandas, SciKit-Learn to TensorFlow, PyTorch. I don't have commensurate knowledge of Matlab and R, so I can't compare. What I know is that if someone is getting started on data science now, there's a 99% likelihood that they will start with Python.

Given your Python credentials, any plans of authoring a book devoted to say SciPy stack or the scikit-learn framework.

Nope. The greats have already done that, e.g. Python for Data Analysis by Wes McKinney and Python Data Science Handbook by Jake VanderPlas. Those books are so good, there's no way I can better that. There’s no need either.




Any life mantra you deeply believe in?


I'm currently reading the Daily Stoic book by Ryan Holiday, and I have found so many invaluable lessons and insights into stoicism, an ancient Greek philosophy. It's such a practical approach to day-to-day life, there's no talk of heaven or hell or other things that are not relevant to day-to-day life.

I feel, irrespective of the situation, we should learn to pause and examine. If the situation is in your control, decide what to do about it, do it and stop worrying. If it is not in your control, there's nothing you can do anyway, so don't worry! To summarize, either decide the action or be indifferent. There's so much to do to improve ourselves - whether at the workplace or back home. If we mean business (and mind our own business), we won’t have the time to waste on worry, anger, and other negative impulses. Easier said than done, of course, but we should put this philosophy into practice right away.