Sunday, June 29, 2014

Another new syntax?

Ever get the feeling that there's a lot of syntax of different programming languages that could have been kept similar? Having learned a multitude of programming languages, I've seen myself moving from a state of knowing a language very well, to a state of finding it difficult to remember the subtleties of the syntax, a few years after not having used the language.

I also know of a multitude of programmers who go through the same problem. Suddenly, at one point in their careers, it becomes difficult to program, without being able to use a search engine to refer the syntax of the language. Not because they're bad programmers, but just because every different language has been created in a different way.

People who create programming languages: If you're listening, can we please do things a bit differently?

Not that I'm against having new syntaxes. For example, I like the fact that languages like Python don't need semicolons, and I simply love the way MATLAB allows a programmer to write code.
Removing a column from a cell array matrix is this simple with MATLAB:
model(:,2) = [];

In any other programming language, you'd have to create a loop to iterate through an array or even create a temporary array and copy relevant content into it. Of course, MATLAB might be doing the same thing internally, but I understand that this is why the people who create languages want to put in their own style (which is often awesome style!) into the language.

But think about the programmer. The person who'd eventually use the language. They'd have to learn an entirely new syntax from scratch. While it is fun to learn a new concept, and a new, easier way of writing a language, the greater fun, is in being able to create awesome software quickly. It isn't really necessary to create a different syntax for the same old for loops etc.

So when I mention "Can we do things a bit differently", I'm asking if we can ensure that when a new language is created, the syntaxes for all basic operations, constructs, containers, imports/includes etc. are kept uniform across languages? If there are abstractions to be created above these basic syntaxes, then sure, go ahead and create something that's specific to the functionality you're creating a new programming language for. But otherwise, for the syntax that serves as the building tool for a software, let the syntax be uniform (perhaps we could select a popular language as a baseline?). Programmers will love you for it!

As for you awesome dudes creating esoteric programming languages, do go ahead, unleash your creativity and surprise us! We won't be using those languages in production code at least ;-) Y'know, I never actually believed it initially, when I heard that Brainfuck was a programming language!!!

p.s.: Not wanting to just leave this as a blog post, I wrote to the creators of some popular programming languages. Mr.Bjarne Stroustrup and Mr.Guillaume LaForge were kind enough to reply and the gist of their replies indicated that this problem is well known, and although there's nothing much that could be done about it, it's important to allow languages to evolve. Although I agree with what they replied, I do hope people get talking about this and at least new languages would be created with familiar syntax.

Thursday, June 19, 2014

How to make an old version of Matlab work in Windows 7

It's pretty simple to solve the issue of Matlab 2007 not working with Windows 7.

Type "matlab" in the search bar of the start menu, right click the first executable you see, go to 'properties'.

Select the 'compatibility' tab and run the program in compatibility mode for Windows 2000. That's all. Now click the same Matlab executable, and it will work!

Sunday, June 15, 2014

How to contact Amazon customer care?

Normally, online stores have a customer care number directly available. Amazon has a slightly innovative approach to it (which is more efficient, but confusing to first-time users).
So here's how you go about it:

Click on the "Customer Service" link:

Sign in: (perhaps you could use the "skip sign in" option too, but I haven't tried that)

Select an issue (now this is the confusing part. People would expect a "Submit" button at this stage, but there isn't any) .
After selecting an issue, just go to the third step (shown by the second red arrow below) and click the phone button.

This is the awesome part, where you click on the "Call me now" button, and Amazon will call you on your number (which you'll have to specify).

My experience with their customer service has been good. Even the book house from where I ordered a book (Shah book house) was very helpful. Apparently there's also a general customer service number mentioned for Amazon, 1800-30009009 through which I couldn't get through.


Epilogue: A better user experience

It would've been more helpful if Amazon had designed the web-page to give instructions to the user about the next step involved. Like for example, in step 2, a message could have been shown to proceed to select an option in step 3.
Or if the options were designed as part of a wizard where the next step is shown only after all selections are made in a particular step.

But still, nice ideas, Amazon team!

Saturday, June 14, 2014

null Meetup: OWASP

People who are into software security (web app security and the like...), you'd be happy to know that OWASP Bangalore organizes meetups every now-and-then to share knowledge. Today, there were around 40 people who attended the session at ThoughtWorks, Koramangala.

For those of you who haven't heard of null: "null is India's largest open security community. Registered as a non-profit society in 2010. null is Open, is professional, is inclusive, responsible and most importantly completely volunteer driven".

The agenda today was:
  • OWASP Mobile Top 10 - Part 2 by Anant Shrivastava 
  • Security NEWS Bytes by Nishanth Kumar 
  • Flash based XSS by Abeer Banerjee
  • BEeF by Prashanth Sivarajan  
  • ESAPI  by Satish

Although I couldn't attend the entire session, I did get to hear about the need for encryption (SSL/TLS), the discovery of Heartbleed, the use of msfconsole (I mentioned to them as a word of caution that it should be used only for testing vulnerabilities in one's own application, and never be used on other websites on the internet, as it is not legal to do so) and Perfect Forward Secrecy.
Also briefly covered, were topics on BEeF, BURP suite for app security, ESAPI, WebGoat, PE studio and some news feeds (one of which surprised me - apparently, TrueCrypt isn't secure anymore).

What's more important than the knowledge sharing here, is the networking. They have a networking session, where experts in various security domains stand at different corners of the room and you get a chance to meet them and talk to them. Makes sense, and worth attending the meetup for this very reason. You get to network with many other people who are into security, and can learn from them.

If you'd like to attend future sessions, registrations are on swachalit.

p.s.: A session can only be as interesting as the persons conducting it. This particular session had speakers who were very slow, so you might want to use your discretion on whether a session is helping you or not.

Sunday, June 8, 2014

Conference: Analytics for startups

While you would get a bunch of knowledge by reading my blog posts, I strongly encourage you to actually attend conferences, interact with experts in the field, grow your network and get more knowledge. It's a different experience being present there. You see their expressions, the way they talk, the jokes they crack, the extra wisdom they share. There's also the sense of belonging.

You'd have heard that "data is the future"? Yesterday, I had been to the conference on Analytics at IIM-B, and through the conference, I found that analytics is at a very nascent stage. The panelists themselves, although experienced, were able to share only a rather generalized view of analytics; not just because it is a very vast field, but also because there's not enough of study done about it.


The panel:
  • Prof. Dinesh Kumar (moderator)
  • Mr. Vivek Subramanyam, Co-founder & CEO of iCreate
  • Mr. Shantanu, Co-Founder, Meshlabs
  • Mr. Mahesh R, Co-Founder & CEO of NanoBI analytics

The introduction to analytics:
Professor Dinesh is a person students would love to have as a professor. His entire lecture was riddled with jokes and wit which kept the audience giggling away.

We were introduced to three different situations of decision making, via three stories:

1. Dosa King. The story of Mr.Narayanan, who did not have much data when he started off. One example was of how although machines for preparing dosas were eventually set up, they realized that the taste of the dosa changed, depending on every hour that the dosa batter was left uncooked. Decision making with not much data.
2. Tylenol having cyanide: When a couple of people died of cyanide poisoning after consuming Tylenol (the equivalent of Crocin), the CEO of Johnson & Johnson had just a few hours to take a decision of what message to send to the public, because of the innumerable number of capsules already in medical shops.
Apparently he consulted his people of whether there was any cyanide in their plant, and they said no. Later, they said yes. This was a time when companies didn't widely use ERP software. Prof. Dinesh emphasized that if ERP was used effectively, the information the CEO wanted, would have been available at his fingertips in no time. This was an example of decision making with incomplete data.
3. Captain Peter Burkill of British Airways: Close to the airport, when the passenger plane was still airborne, both engines of the plane failed. The pilot had 30 seconds to take a decision on what to do, and the professor told us, that he had at his disposal, around half a terabyte of data to sift through for taking a decision. The case of too much data.

When you enter the field of analytics, you'll notice that 80 to 90% of an analytics project, is spent on just cleaning the data. Making it useful for analysis.
[ Navin's note: So it's very important to find people who enjoy sifting through data and making sense of it. Most people would find it boring ]

So how do you define big data? : The non-profit Akshaya Patra tries to provide mid-day meals for children, keeping the cost per meal at 7.50 rupees. As part of optimizing costs, they also have to find the shortest paths for their transport vehicles, to minimize on fuel. Now the number of paths to be calculated here, is twenty factorial. Even if you had a computer that could do 1 million computations per second, it'd take around 76000 years to compute the data.
When you have a situation where our existing IT technology isn't enough to solve a problem, you have at your hands, a big data problem.

Types of analytics
  • Descriptive analytics: This is where you want to visualize your data. Quick View and Tabulo help with this. Data synthesis and visualization. Gramener in Bangalore does this. One other example of descriptive analytics was the use of spot maps. During the cholera outbreak in 1854, there were around 400 theories of how the cholera was spread. Most people thought it spread through air. But John Snow. A doctor, mapped the pattern of the outbreak and correctly located a water pump which seemed to be the source of it. (anecdotally, when he approached the authorities, they asked if that was the case, then why weren't any of the people in the nearby brewery falling sick of cholera, and John found that it was because the workers weren't drinking water from the pump. They were drinking only beer from the brewery :-) )
  • Predictive analytics: When you want to use data and trends to predict consumption patterns in the future for example. Or like how Google and the CDC predict diseases based on data they receive and capture from people. Milk consumption is also an example where people need data to predict how much of milk would be consumed before the expiry date and how much of it they'd have to sell to restaurants who are waiting for a discount a few hours before the expiry. Also about how much of the remaining milk beyond expiry date, would go for preparing paneer, cheese and to sweet shops (apparently many sweet shops use milk that's crossed the expiry date).
  • Prescriptive analytics: This is the toughest of them all. To be able to prescribe a solution, based on the data you have. Of course, this also involves using predictive analytics.

Framework for decision making
This section went very fast. Not much info to share here, but these were the main points:

  • Problem identification: As an example of what Target retail chain did: What would you do if you wanted to find out which of your store customers were pregnant? If you identify these people, you could advertise and sell the slew of products for baby care.
  • Ask the right questions: Asking, requires good domain knowledge.
  • Collection of relevant data: The data has to be in a certain format. One of the reasons companies aren't able to make good use of the data they have in their ERP systems, is because is not built on analytics. Such data is useless to them. The solution to this, is to redesign the ERP systems, with analytics at its core.
  • Pre-processing: Decide how you're going to use the data.
  • Model building: Create data models that will be useful for analysis.

For a company that uses analytics, it's important to build the right talent and build the right infrastructure.
As an example of how hospitals work, the first day the patient is admitted, is the most profitable for the hospital. The series of (many times un-necessary) tests the patient pays for and the profits made on treatment during the duration of stay. But when it comes to discharging the patient, it would be most economically viable for the hospital to get the patient out as fast as possible and to get the next patient admitted (this often becomes a problem, as doctors aren't available to sign the discharge slips). Data analytics can help by mapping this trend and maximizing profit for the hospital.

As competition increases, analytics becomes more important. For example, if you're setting up a food court, you'd need to predict how many people are going to eat there. One creative way of predicting it is by calculating the number of cars parked in the surrounding area and the time at which people come out to eat and the availability of eateries nearby.
[ Navin's note: An excellent opportunity to attract customers with discount offers and a cleaner and less-noisy environment than the competition. Adding music would be another perk ]

Another example where predictive analytics is used, is in the sports industry. Get a load of this: While the sports industry is said to be at 300 billion dollars, the sports-betting industry, is said to be at 400 billion dollars worth!!!

You might also want to have a look at the Analytics Society of India.

The panel discussion
Following Prof.Dinesh's lecture, the panel shared their experience with the audience. Some key points in random:

  • The world is going SMAC: Social Mobile Analytics Cloud
  • Machine learning, Bayesian calculations, Hadoop and DevOps are the 'in-thing' for analytics right now.
  • Opportunities in analytics: Anything that generates a lot of data as part of its functioning, would be good for analytics.
  • Analytics for a small business: One of the challenges faced is in how to explain analytics to business people, in Hindi or Kannada?
  • Learning analytics: Apparently Bangalore University offers courses in analytics. There are five colleges in Bangalore offering a course. Word of caution though, is that no matter what tools you learn through these courses, what really matters is the experience of actually working with data, statistical data, models and open data movement.
  • Surviving and succeeding: Ask the right questions, solve the right problems.
In humour: Can an analytics company use analytics to predict it's own success? :-)
  • Advice: Don't venture into a field in analytics where people are already doing a lot, and you don't have anything different to offer or you don't know how to do it better.
  • How analytics helps: Many times, business people tend to rely on intuition and despise analytics and data.  But analytics helps better than intuition: Like for example, a retail chain located at a place where hurricanes were frequent, wanted to know what people tend to purchase just before a hurricane. Employees guessed torches, raincoats, beer etc. But when they looked at the data, they saw that what sold the most just before and during a hurricane, were strawberry pop-tarts. Amazing, isn't it? Would intuition ever have given you that info?
  • Three most important things for a startup: 1. Talent 2. Talent 3. Talent. All other things can be purchased with money. You have to find the right talent for analytics, and the supply is scarce. Because you have to know what problem to solve, and who will solve it for you. Find people who are at least good at linear programming problems. They'll have to scale their skill more for bigger data problems.
  • The go-to-market is more important than decisions on what technology to use.

Also happened to meet a software architect-turned-entrepreneur who very interestingly, has a startup which helps athletes find grounds in Bangalore. He, like me, was already up-to-date about the latest trends in databases and was all for the JavaScript stack of technologies (which btw, is the future; just like mobile devices are).

Sunday, June 1, 2014


Continued from the previous LOL page.

Heroine rescue
share with this link

How heroes rescue the heroine in Bollywood movies (some Hollywood movies too)

Dream commute
share with this link

Indiscriminately created road-humps are the funniest example of the "prevention is better than cure"belief

Continued in the next LOL page