The BullsNCows Application in AngularJS

About 5 years back, when I was still dabbling with client-side technologies for the first time, I had written the BullsNCows game in pure Javascript.

My knowledge of Javascript and client side technologies has evolved quite a bit since then. So, recently when I was looking at this code I thought, “This code could be better if we use AngularJS“.

So today I thought of rewriting this in AngularJS and using Bootstrap for styling. Here is the code in Github in case you want to play with it and here is the game in case you want to play.

bullsncows

So what’s changed?

  • All the code related to styling has been moved to Bootstrap. The alternate table coloring seems so much easier now!
  • The update of the table is done with AngularJS so I don’t need to do complex DOM manipulation – it is a straight-forward binding to the tr element of the table.
  • The data handling and algorithm to compute bulls and cows is slightly improved. It used to be a O(n^2) algorithm. It’s now linear.
  • Elimination of globals – except the app object nothing is global now.

Jnaapti – The Problems We’re After

Check out this statement from a report on National Employability by Aspiring Minds [pdf]:

Even though India produces more than five lakh engineers annually, only 17.45% of them are employable for the IT services sector, while a dismal 3.51% are appropriately trained to be directly deployed on projects. Further, only 2.68% are employable in IT product companies, which require greater understanding of computer science and algorithms. – National Employability Report by Aspiring Minds

While on one side, there is an ever increasing demand for skilled employees in organizations, the unemployment situation is getting out of control.

Concentrating on increasing quantity of engineers has impacted quality drastically. – National Employability Report by Aspiring Minds

Here, we list the most important reasons that we believe, are causing this (a lot of this is after interviews I conducted with a series of students from various colleges in India):

  • Mis-guidance/Lack of guidance: Ask a student of a Tier-2 college, why he joined Engineering and how he chose his branch or college and the answer is mostly along these lines:
    • Because my parents/friends told me to
    • Because my uncle said Computer Science is outdated, Mechanical Engineering is ever-green
    • Computer Science is in “scope” now (another way of putting this is, I have better chances of getting a job)
    • I like Computers since childhood, so my friend’s dad told me I should go for Computer Science
    • This college is closest to my house
    • I really don’t care about where I get a degree or in which branch, all I care about is that I am an “Engineer”

    Hmm, something seems terribly wrong. The lack of counseling is apparent in the way students answer this question. Students don’t know what they are getting into when they join engineering. While many are misguided, some are even pressurized to join the branch of their parent’s choice. Most students don’t have a clue of what their career options are post engineering. While on one side there is a clear upsurge in the requirement for skilled IT force, the comparative dearth of good jobs in other fields is pushing people into IT (or related fields).

  • Lack of motivation: I guess this follows the previous point. If you are not interested to do something in the first place, you cannot expect a lot of motivation or focus now, can you? Students mostly wade through the semesters and find themselves having a degree but no skills to back it. This results in a clear skill-set deficiency, but for the most parts, the industry doesn’t seem to care as they have gotten used to this (in other words the expectations are low).
  • The lack of industry-institute interaction: While “Engineering” is a lot to do with “application”, students are not given the necessary context and guidance to apply what they know. It’s quite possible that students complete a course and have no idea how they are going to use this course once they are employed. While students these days have a good understanding of good apps in Facebook and Android, most have no clue what it takes to build these systems.
  • Faculty quality issues: Most professors/lecturers in Tier2 colleges in India teach not because they like it, but because they have to. The low pay-scales of an engineering faculty (this is a lot better now, but not good enough) compared to an entry-level engineer makes this an unattractive proposition for many who may be interested to teach but also need to think of their cost of living. The dearth of motivated and trained faculty in engineering colleges has further aggravated the problem of student quality.
  • Outdated learning/teaching models: In this day and age, with the advent of technology, the classroom teaching model seems too outdated to be relevant. Sal Khan has outlined it well in this video about Education Predictions for Year 2060. Here are some of Sal’s predictions:
    1. Classroom model fundamentally changes
    2. Instead of our credentials being seat time based and the variable being how well you actually understood the materials, the time is fixed and the variable is your level of achievement.
    3. Role of the teacher rather than being a lecturer, and often giving similar lecture year on year and at the same pace, the teacher will now be a coach or a mentor.
    4. We are going to get to a 99% global literacy rate.

    These are “predictions” and is not the case right now. But we can clearly see a trend in the direction of these predictions.

  • Lack of a fool-proof globally recognized metric for assessment that evaluates a person independent of the way he acquired his knowledge:

    The long tail of employable engineers is getting missed out by corporations. The report found that the top 100 colleges have higher employability as compared to the rest of the colleges (as much as two to four times). Despite this, more than 70% of employable candidates for any sector are in campuses other than the top 100. It was found that 50% of employable candidates for IT services companies and 28% of employable candidates for IT product companies are not even in the top 750 colleges, and thus form invisible pool to most employers. This signals that a large proportion of employable engineers are ending up without any opportunity, which is a dangerous trend for higher education. – National Employability Report by Aspiring Minds

    Organizations lack a good metric system to compare and evaluate students from different universities, so they end up relying on other signals: the marks, the degree and the college name. They then conduct their own entrance tests and interviews. Is it not possible to find a gem in a Tier2+ college? Most organizations do believe that there are gems out there, but they don’t have a process to approach them. The low conversion rate makes this a no-go. We at Jnaapti have already proven the issues with this and have successfully connected students with companies that are more aligned with their interests. Over time, we will be building an alternate metric system that is more fool-proof and reliable and there are a few companies that are solving this problem alone some with a global focus.

It is these problems that we have set out to solve…

Why I started Jnaapti

Note: This is a personal account and forms the prologue for why I started Jnaapti. To know about the problems we are after, read this subsequent post.

Connecting the dots…

It is 1999. I am reading an article in a magazine which describes the problem of Information Overload and how it has become severe due to the Internet; the fact that until recently, getting information was a problem, but now that’s no longer the case. The problem now is of being drowned with so much information; it’s more of finding the needle in the haystack than not having the haystack.

I personally had already felt this problem, so this gets me started with the “Quest For Knowledge” project – a personal project to increase my own knowledge about technology and put it in a framework. With frequent visits to the cyber cafes, I bring home floppies full of data about various things – technology related. I slowly start developing an interest in Personal Information Management and Knowledge Management in general.

Fast-forward to 2002. I am an engineering student doing my BE in SJCE, Mysore. Grand goals, big dreams. I believed that Engineering is all about learning concepts and then applying it to build things that solve real problems. I envisioned hacker spaces in college (if not the word, atleast the concept). I am terribly disappointed.

Nobody knows ahead of time how long it takes anyone to learn anything. – Dr. Tae

I soon realize that I cannot rely on the system in general (college/faculty etc) for my education – if I have to succeed, I have to take the onus to educate myself.

The right kind of education begins with the educator, who must understand himself and be free from established patterns of thought; for what he is, that he imparts.- Jiddu Krishnamurti

But that said, my dreams never died. My 2nd year in college and I am already envisioning building “Hibernate in Linux” (like I said, I had big dreams, and this shouldn’t come as a surprise. Most students do before education kills it). Not that I knew what it meant, but I knew what it would look like.

We have a system of education that is modeled on the interest of industrialism and in the image of it. School are still pretty much organized on factory lines ? ringing bells, separate facilities, specialized into separate subjects. We still educate children by batches. Why do we do that? – Sir Ken Robinson

2 years pass by. The project to build Hibernate in Linux never takes off the ground, and a couple of other projects (TTS for Kannada and building a Microprocessor simulation environment) also fail before they start.

Meanwhile, other experiments are made to self-educate. We form a small group and decide on a bunch of subjects that we go learn and then teach each other. Friends are excited about this, but a series of incidents makes this dormant.

The lack of guidance and need for an eco-system that supports innovation and application is apparent.

When learning is the goal and learning is the reward, there is no point in cheating. – Dr. Tae

It’s 2004 and I am in my 6th semester now and IBM India Software Lab is visiting campus for internships. I attend the interviews and is one of six people selected. The internship lasts for 6 months (2 months training + 4 months project) – and is an eye-opener. For the first time, I begin to understand “how to learn”, “how to think in abstractions” and “how the industry functions”.

My team leads then tell me the actual motive behind the internship. They wanted to give back to the college and we’re told that it’s about time now that we did the same. I am more than happy to help out and start getting involved in university relations – via workshops, internship projects, etc.

It’s 2007; I am in my college to select the cream for an internship project that I want them to work on. This project has been running in my mind since a long time – how do you leverage existing features of Eclipse and bring it into a browser with minimal efforts and maximal reuse. The project statement is very simple to understand and understandably difficult to implement, especially for students who are still in college. But hey, isn’t that what an internship experience is all about?

A self-motivated student paired with a right mentor can learn a lot. – Dr. Tae

After a few failed attempts, my interns make me proud. Eclifox is a run-away hit within IBM and to some extent even outside. It catches the attention of multiple brands (Eclipse is used by all the 5 brands of IBM – Websphere, Rational, DB2, Lotus and Tivoli). I demo this to the CTO of Websphere and also have talks with the CTO of Rational. (Eclifox is something that I still demonstrate to students and professionals to show what can be achieved if interns are provided the right guidance and understandably my interns who are now in elite companies/startups still talk about it.)

This project gets me thinking.

If this is what “interns” can achieve in 6 months, and with minimal guidance, what talent and potential are we wasting every year? What kind of an ecosystem can we build that helps leverage this?

Eclifox, although was a hit, was not very scalable, so we start trying out other initiatives – including faculty development programs (train the trainer), curriculum development programs (better connectivity between concepts and application), workshops in colleges etc. After several such attempts, I understand a few things that work and a few that just don’t.

The traditional model, it penalizes you for experimentation and failure, but it does not expect mastery. We encourage you to experiment. We encourage you to failure. But we do expect mastery. – Sal Khan

It’s 2008 now. I quit IBM to understand startup dynamics and never looked back. The fast-paced environment to deliver, the relentless pursuit to achieve what we set out to achieve got me hooked. For the next 4 years, I am isolated from University Relations, but in hind-sight it seems like a “degree” I had to take before starting on my entrepreneurial pursuit. Also, I was not totally isolated either, as I interviewed quite a few of them in the startups that I worked for. One thing was very obvious – the problem still remained, and if anything it was far more wide-spread and had worsened. This was apparent in the quality of the answers provided by the students in interviews.

It’s 2011 and I am keen to startup. I now have enough confidence to chase my dreams. Having worked in a couple of startups, I feel I now have the skills that I need to execute, and the few things that I didn’t get to learn, I am fine bumping into it, figuring it all out and applying it. I need a goal that’s hard to achieve. The problem needs to be much bigger than just a technical challenge, but software being my strength, I am looking for a problem that can be solved with technology. After evaluating 3 ideas, I decide to attack the education problem head-on. After-all, it’s worth the adventure!

April 2011: I spend a significant amount of time researching the field, learning the terminologies used, learning about the people, the companies, the startups involved and the scenario in general. I discover people like Sir Ken Robinson, Dr. Tae, Jiddu Krishnamurti, Salman Khan among several others and also discover that the issue is global.

Jnaapti was founded on 19th of May 2011

Jnaapti – One Year On…

Time flies!

It has been a year since I started Jnaapti and it is time to take a step back and reflect on how things have fared during the last one year. I was reading through the mails and the Jnaapti weekly reports and was wondering if there is anything that I have to add to the 6 month report that I wrote back in December or if there is anything that I don’t agree to among the things I mentioned in that list.

So here goes:

  • Naming: Somehow, I don’t recall reading this anywhere, or atleast, didn’t think it was important. But, just like you do usability testing of your product, I think it is important to get the name tested with a few people before you christen your company. While choosing an Indian name, also remember to include people from various parts of India and abroad.
    The name Jnaapti is a Sanskrit word which means to “acquire knowledge”. I had a few things in mind when choosing the name:

    1. I wanted an Indian name – because the target segment was Indian to begin with
    2. I didn’t want to have a problem with branding, in acquiring domains etc
    3. Finally, I wanted the name to be generic enough to be used until the vision of the company has been achieved and shouldn’t require a change as I pivot.

    Turns out, people don’t get it.


    Here are some suggestions to people about naming a company:

    • Make sure the word is such that it can be pronounced by anyone and is easy to spell over the phone. You will loose out on a lot of branding if people search for the wrong keywords.
    • How would people come across your name? Would you expect people to search for it – if not, the logo along with the name should be catchy.
    • What are the closest other names to the name of your company? Is it easy to mis-spell it? If people search for it now, will Google suggest a more popular alternative? Do you expect to override it anytime soon?
    • Is your audience global or local? If global, go for something that is not specific to your geography or atleast easy for people outside your geography to pronounce.
    • Stay with the chosen word for atleast 3-4 days. Imagine yourself using it in conversations and see if you are comfortable with the word even after 3-4 days.

    Personally, I prefer short, single words for company names.

  • Pivoting is not free: Don’t get me wrong. I am a big fan of lean principles and I still religiously follow a lot of them. And I do understand that pivoting is not about abandoning one idea and moving onto the other or changing your vision as if caught in a tornado but I guess it is possible that people think pivoting comes without a cost when in fact the reality is not so. In short, pivoting has the same issues as knowing when to shut down your startup – should we persevere or should we rethink?
    When you have validated a part of your business model (eg: the demand, the problem/solution fit or say portions of your product) and decide to pivot another aspect of it, there is a good chance of temporary disruption in the flow (read target segment, getting users, revenue streams etc). It’s quite possible that you had been generating revenues due to your efforts, but now you don’t see it to be sustainable, so you decide to pivot. This may mean, you have to re-design your site/app experience, come up with a new marketing message and start over on the marketing efforts, and you need to be prepared to bear the cost. This may be tough, especially when you are bootstrapping the company. But then, you don’t have a choice because the whole idea of pivoting is to reduce the likelihood of reaching a destination that you didn’t intend to reach in the first place.
    Between validation and scale is an important step – “validating the scale”. As described in the lean stack, there are 4 stages when it comes to building a product – Understand Problem, Define Solution, Validate Qualitatively, Verify Quantitatively. However the MVP that works in Stage 3 need not work in Stage 4 and may require a strategy pivot, so be careful in Stage 3 to ensure that the same solution holds when you get to Stage 4. This is easier said than done.
    Recognize failures early – atleast have a weekly review of how things are going with regard to the company’s directions and make sure you make corrections in your path. Get it validated by people who can guide you.
  • Follow the ant philosophy: Learn from the horse’s mouth as he has described it well.
    Perseverance is important. Sometimes it feels like you are putting in a lot of effort, but things don’t seem to work, but sometimes the exact opposite is true. I have seen this with marketing efforts. It takes time for marketing to reach fruition and it is important not to lose your patience when the going gets tough.
  • Have a strong social network or add someone to your team who does: I can’t say this enough and this builds on the 2 things I mentioned in my previous post – “Get out of the building” and “The strange story of co-incidences and chance meetings”. It always helps to have a strong social network (both online and offline). The number of new people I have met (online/offline) has crossed 200 since the time I started Jnaapti.
  • Self discipline revisited: If you have decided on a rhythm, stick with it. Get good at reducing interruptions and handling unavoidable interruptions well. When meeting clients, time is not under your control, so get good at squeezing tasks into available slots between unavoidable interruptions. Time discipline is extremely important especially when you are working alone. Maintain a log of where you are spending your time and optimize what you can optimize. Get good at continual automation not just with engineering processes but with life! Make a note of key metrics that you want to track on a daily/weekly basis.
  • Be prepared to learn: This may seem obvious, but sometimes you may not realize the effort involved. Running a one-person startup has meant that I had to learn how businesses function, understand sales and marketing, negotiation, valuation, funding, recruitment, building and maintaining relationships, understand lead generation, cost of customer acquisition, designing usable products, build a great user experience and a host of other things in addition to engineering. I like it and is one of the reasons I am doing this, but then, not everyone does.

When I started this journey, it was supposed to be a one year stride. The fact that it is Jun 2012 and I haven’t lost confidence means that this is going somewhere and I intend to continue along this path into the near future…

Jnaapti – A 6 month Report

This post is not quite about Jnaapti‘s vision and why I am doing it, but more about things that I have learnt since I founded Jnaapti.

I can’t believe it has been more than 6 months already and what an experience it has been! I can easily blog a few hundred pages about my experiences, but here is the MVP (Minimum Valuable Post) – the key things that other wantrepreneurs and newbie entrepreneurs can learn from:

  • The art of self-discipline: If there is one thing that I should pick among the various things that I learnt in the last 6 months, I would pick being self-disciplined and maintaining a rhythm in the face of distractions that are not under your control. Time management is extremely important. When you are handling all aspects of business, there is a good chance that you need to meet someone at their convenience, or you are asked to provide a service (in my case training) and these are not under your control. So you need to get really good at handling these, and getting back to your work as soon as this is complete. For productivity freaks, I use a combination of Pomodoro technique, Hamster, Workrave, this hack and a simple Libreoffice document to manage all my data. I wish it could have been simpler and someday, I hope to continue my efforts in building productivity tools.
  • Get out of the building: I can’t stress this enough. Nearly everytime I got out of the building and started speaking to people, there was some new insight or a business deal that happened. A lot of the times, it seems purely co-incidental (read the next point). The initial couple of weeks were very haphazard and it just seemed like a humongous project that was lying in front of me. While I did have a huge list of tasks/ideas to work on, I didn’t know where to begin. What should I build now? No clear answers. As I started hunting for answers, I ran into the Lean Startup concepts and fell in love with Ash Maurya, Eric Ries and Steve Blank‘s philosophies. I followed the lean canvas way of capturing the business model religiously and it has worked out very well. If anything, it helped reduce noise, cut to the chase and build something of value “now”. The idea of prioritizing validation and learning before scale has worked in my favor. The first cut of Jnaapti’s offering didn’t even have a software component and was entirely conducted over email – because I realized that the MVP didn’t need a software component. I concentrated less on the website messaging, since most of my contacts were through my personal network.
  • The strange story of co-incidences and chance meetings: Nearly every business contract I got seems like a pure chance meeting and the more this happens the more you believe in what is written here. This kind of also proves that there is a critical mass of startups in Bangalore now, and there is a good chance that you will bump into someone who is a startup founder or early employee when you visit coffee shops or technical events. This has worked out so well that I have made it a point to meet, on an average one or two new people every week. Till date, I have met more than 80 new people (including Jnaapti Learners), and that’s an average of 10 people per month!
  • My experiments with pricing: An early learning for me was about how you need to get pricing right and it’s almost always never. The inital couple of months I was demanding way too less for my services and slowly as I found out the value of my services, I tweaked it to a point which seems reasonable both for me and my clients. But that said, every new assignment is a new negotiation.
  • Understanding waste reduction: When you are the only person working, and you have the 3 aspects of an organization in front of you – business, product and engineering – every moment you spend, you need to think twice. Is this the best use of my time? It helps a lot to reflect on how you spent your time and look at what you could have rather NOT done. This is the art of waste reduction.

    On a similar note, I have started maintaining what are called “Implementation reports” for Jnaapti’s product development phases. An implementation report is an assessment of

    • how a specific phase fared
    • what features we set out to build
    • what was our reasoning about why they should be built
    • how are the features being used now
    • if they are not beng used, why so
    • can its usage be improved
    • should it be chucked
    • how can we ensure that we don’t have such waste in future
  • Getting to ramen profitability: There is one thing I can tell you. We, as software engineers in India, don’t value money (I am speaking generally). We get an awesome package (stop cribbing you guys) right out of college, and then we get into this spiral of work-get paid-work harder-get promoted-ask for a raise. And when things don’t work in our favor, we start complaining or switch our jobs looking for a better role or more pay. If you want to value money better, quit your job to know what others go through. In the face of inflation, the rupee v/s dollar prices and rising infrastructure costs it has been tough to keep up, but then you got to pay a price. I am close to achieveing ramen profitability and I hope things will be better next year. And while achieving ramen profitability is important, it is equally important to ensure that you achieve profitability via the business you are in and not via some job that doesn’t help you validate or learn more about your business. And yeah, if you want a piece of advice, to get to ramen profitability soon, just invest your savings in some place that is not easy to suck from!

I have taken enough breaks and I never felt that this was too demanding (although I do put in long hours once in a while). Needless to say, I am loving the freedom and the flexibility that I have and I wish I can continue this forever! Overall, it has been an amazing 6 months!

Trip to Jog Falls, Aghoreshwara Temple – Ikkeri, Varadamoola and Varadahalli

It has been a long time since we went on a trip. This is our first trip of 2011! And boy, what a trip it turned out to be!


Our last trip to Shimoga was towards Thirthahalli (south of Shimoga). We had covered Mandagadde, Kuppalli, Sakrebailu, Gajanur Dam and Mattur. This time we headed westward towards Sagar and covered places around it.

Our journey started at 3:30am on Saturday morning. There were 3 of us, and we took an Indica. The roads were mostly good and we had no major hiccups due to road condition almost during the entire journey which included several village roads as well.

The road from Shimoga to Sagar was awesome. It has a resemblance to the Thirthahalli route; there are lots of trees on either sides of the road. One striking difference is that there are more plain lands than the Thirthahalli route. This is what is referred to as Bayalu Seeme.

We reached Sagar at around 10:00am. We had not made any arrangements for stay. Considering that it was a long weekend, we wanted to get that daemon out of the way and then enjoy our day. So we first started hunting for a good place to stay. Unfortunately, as expected, most good places were full. We then decided to stay in a place, which was both expensive and bad.

Continue reading

Lalbagh Flower Show – August 2011

It has been 2 years since I went to the Lalbagh Flower Show. The flower show is hosted twice a year once during Independence Day (i.e. in August), the other during Republic Day (i.e. in January). It is hosted in the Lalbagh Glass House.

If you plan to use your vehicle to reach Lalbagh, there is a decent amount of parking space near the East gate.

This is my third visit to the flower show. The last time I visited was in 2009 when I was new to SLR photography and prior to that I visited in 2007.

The flowers were mostly the same as my previous visit. The attraction this time was the Lotus Temple built using roses.

Continue reading

Moving your WordPress blog from Apache to Cherokee in 30 minutes

In my post on VPS Hosting experiences, I had mentioned that inspite of doing server configuration tweaking, I found that load times were gradually increasing and I was experimenting with an alternative server named Cherokee.

The whole migration took less than half a day – including learning Cherokee, trying out locally and then using it in my blog. So what are the steps I followed to move to Cherokee?

I use Ubuntu 10.04 LTS as my dev system as well as on the production server – so one of the things that I am confident about is that, if something works in my dev environment, it is bound to work in the production setup, with minimal pains during deployment. So I wanted to first try out the entire setup – make sure everything is fine, and then replicate the setup on the production server.

I started by installing Cherokee from the PPA and also php5-cgi:

add-apt-repository ppa:cherokee-webserver/ppa
apt-get update
apt-get install cherokee
apt-get install php5-cgi

Continue reading