All the statements and opinions expressed in this blog are solely mine and do not reflect the opinions of my employer.

Dreaming in Code

I finished reading Dreaming in Code last week. It’s Scott Rosenberg’s account of a software development team’s effort to build the ultimate Personal Information Manager (PIM). Led and funded by Mitch Kapor of Lotus 1-2-3 fame, the team goes through endless cycles of redesigns, people issues and other upheavals.

Rosenberg follows the team very closely, participating in their meetings, interviewing them and filling the narrative with his own insights.

If a developer were to read this book, s/he would recognize the events in it this as standard stuff when developing a product, and s/he would also identify with the team itself, with the occasional shaking of the head :)

The software they set out to develop was based on Kapor’s vision of Kapor’s of a game-changing PIM. They called it Chandler, after one of Kapor’s loved crossbred dogs.

This was the pre-Web 2.0 era, where most things, including product releases took longer to happen. The browser had not yet become the first medium for delivering any consumer facing application. Desktop applications for collaboration still looked as if they had potential.

Chandler’s ultimate aim was to be a all-in-one tool where users could access their email, personal notes, calendar events and to do lists through one interface. Kapor visualized all these different data collections as isolated information silos. Chandler would break open and combine them. It would let you view and move around all these disparate things in a unified manner. You could tag a note with labels, and then put a date on it and make it a calendar event, or send it off as an email. Grand vision? Yes. It’s something I would personally prefer to have around to manage things.

Due to numerous reasons, Chandler was late in delivering its promise. Gmail came in 2004, and opened the floodgates of what was possible using new Web technologies. Firefox arrived, and forced Microsoft to relook at IE (and make it better). Chandler was yet to release its 1.0 version. The browser was fast overtaking the desktop.

We have been spoilt by the seamless interconnectivity provided by the Internet – it’s always there – home or office or a mountaintop – and with it, our data. Chandler did attempt a Web interface where you could access your data (which would be synced between your desktop and a central server), but it was too late.

The Chandler project is still on with many faithful developers. I tried out the latest version after finishing the book. My impressions? It still has a long way to go, going by the number of bugs I encountered, and assuming it can convince the Web 2.0 crowd to switch to a desktop application by the sheer force of its design and the things it is supposed to do.

The most interesting chapter in the book is “Methods” – where Rosenberg does a brief and very readable survey of the evolution of development methods over the years. This chapter can be read standalone even if you don’t read the whole book.

Note: The Chandler logo image linked to here is used under a Creative Commons Attribution License 3.0.

SocialTwist Tell-a-Friend

A Ruby script to search bookstores online

I started dabbling in Ruby some weeks back. The initial interest was sparked after reading “Treating Code as an Essay” (Yukihiro Matsumoto) – one of the chapters in Beautiful Code. So I started doing these bootstrapping exercises in Ruby. Some of the exercises are good – but nothing beats doing a small project to learn a new language.

I buy a lot of books, mostly online. There are a few good online bookstores in India, notably Flipkart.com, Infibeam.com and Indiaplaza.in (Sadly, Amazon does not have full-fledged shipping to India yet). The way I usually search for a book in online bookstores is (was, till now)

  1. Go to books.google.com and enter the book title
  2. Click on the best match
  3. Click on ‘All Sellers’ on the left of the page
  4. The Indian bookstores are usually listed towards the bottom. It does not include all stores, and sometimes the prices are not listed. I have to go to each individual site and check them out.

I wanted to collapse these steps into one – a simple script that would accept the name of the book and show results from all these bookstores, with comparative pricing. And the result was this

http://github.com/talonx/book-search

It’s in Ruby, runs from the command line and writes the output to an HTML in the same directory called ’search.html’. Much needs to be done, like

  • Price based listing with the lowest on top
  • A web interface for the search
  • Add more bookstores – it’s only Flipkart.com, Infibeam.com, Indiaplaza and Bookadda.com right now.

To run the script, type this (you need Ruby 1.8.x, available from http://www.ruby-lang.org/en/downloads/ and the Hpricot HTML parser library, available from http://github.com/whymirror/hpricot)

ruby lib\book-search.rb “<book title (in quotes if it has spaces)>”

SocialTwist Tell-a-Friend

Do that side project

Do that side project.

How many times have you told yourself

  • I’ll start that open source project I’ve been thinking of
  • I’ll write that utility which will make my job easier
  • I’ll enroll for that course on Artificial Intelligence and write that amazing recommendation system

and then did nothing?

Well, guess what. Time passes. Yes, really.

Anne Dillard said

“How we spend our days is, of course, how we spend our lives.”

Think about that for a moment.

Don’t waste time on thinking about when to think about planning to think about thinking about when to start thinking about doing it. Do it now.

Here are some more resources on the subject -

  1. Shut up and Hack – http://www.slideshare.net/bluesmoon/shut-up-and-hack
  2. Do it Now – http://www.stevepavlina.com/articles/do-it-now.htm
  3. Do it Fucking now – http://seoblackhat.com/2007/01/29/do-it-fucking-now/
  4. Chris Wanstrath’s keynote – http://gist.github.com/6443
SocialTwist Tell-a-Friend

Adding MySQL server instances using mysqlmanager

The MySQL instance manager – mysqlmanager – provides a way to manage multiple MySQL server instances on the same installation. All these instances use a common my.cnf file – but each can be configured individually (using the same file). mysqlmanager itself provides a command line interface to control the individual instances.

Part of a sample mysql.cnf with multiple mysql instances

[mysqld1]
user = mysql
datadir = /data/mysql-1
socket = /tmp/mysql-1.sock
port = 3306

[mysqld2]
user = mysql
datadir = /data/mysql-2
socket = /tmp/mysql-2.sock
port = 3307

The ability to setup multiple database servers fast is particularly useful in development boxes where fresh DBs need to be created often. In my team, we often need to do this. Every time a new DB has to be setup, we have to go through the steps of creating a datadir, installing the system tables, adding a root password, adding the entries to the my.cnf file and starting the instance using the mysqlmanager shell.

So I whipped up a small Linux shell script which automates this process.

Here it is.

It’s still in a quite primitive state – but it works!

Usage is simple -
add-mysql-instance.sh mysql config-file-location datadir groupname username password instance port instance-name mysqlmanager-user mysqlmanager-password mysqlmanager-socket-file

Of course, mysqlmanager has to be running for this to work.

I’ll be adding improvements to this script – like the ability to generate a mysql instance name based on existing instances (instance names are usually mysqld1, mysqld2 etc), picking up the user name from the file itself etc.

SocialTwist Tell-a-Friend

India Needs an AntiSpam Law

The Problem
I dread it whenever I have to enter my email address at an Indian ecommerce site. It’s mandatory if I am buying something, and I do it reluctantly. After the product is bought, I go to the My Account link if there is one on the site and unsubscribe from all marketing notifications (because most of the times they do not bother to tell you at the time of registering or entering your email address that you have been autosubscribed to such mails).
Note that I do not mind receiving notifications from system administrators and mails related to the delivery of the product I bought. But I do not want to keep on receiving general mails about things I am not interested in.

The inevitable happens after a couple of weeks. I get emails from the site offering me discounts on new products, new deals; in short, commercial email. Unsolicited – because I did not opt in. And in some cases I opted out explicitly. In other words, Spam. Some of these mails have an Unsubscribe link at the bottom. After you have apparently ‘Unsubscribed’ using the said link, one of the following things happen -

1. Similar mails keep coming, with the same Unsubscribe link. Most of these links are just mailto: links as opposed to an http: link. An http: link usually means it’s a mailing list manager software, which actually works. But a mailto: link more often than not means that somebody has to manually do the removal. Which does not happen.

2. The Unsubscribe mail bounces. Either because the Unsubscribe mailbox does not exist (Surprise!) or it has exceeded its quota because people keep on Unsubscribing and nobody reads or deletes them (Surprise!)

Here are some sites that do not have a working Unsubscribe link in their emails. All my efforts to Unsubscribe from their unwanted mails have failed. Most of these are commercial sites I use regularly.

http://www.sulekha.com
http://www.pvrcinemas.com
http://www.citibank.co.in (These guys take the cake as far as repeated requests to remove my address and repeated responses that they have done so and the and sorry-sir-it-won’t-happen-again routine are concerned)
http://www.siliconindia.com
http://www.indiaplaza.in
http://www.bookmyshow.com

At this point I would distinguish between two kinds of spamming -

1. The kind I describe above. You cannot mark them as spam since you might be getting legitimate mails from the same address in future (like when you buy another product and there is a confirmation) and cannot afford to miss them.

2. The ‘normal’ spam that you get everyday in your junk mail folder. All mail providers detect and mark them as spam automatically. These are sent by people whose only job is to spam others, usually sitting in a country whose laws are lenient enough to allow it.
To start with, ecommerce sites need to understand that giving my email address for a necessary purpose does not imply that it entitles them send any email to that address.

My email address has a privacy status similar to my telephone number.

It’s like calling up someone every week with irrelevant news just because you happen to have their phone number. (On a related note, the Indian NDNC – National Do Not Call Registry – is a step in the right direction as far as controlling whom telemarketeers in India can call is concerned).

How do other countries deal with this?

Almost all progressive countries have laws and directives dealing with this explicitly.

EU : http://en.wikipedia.org/wiki/Directive_on_Privacy_and_Electronic_Communications
Aus : http://www.dbcde.gov.au/online_safety_and_security/spam
NZ : http://www.dia.govt.nz/DIAwebsite.nsf/wpg_URL/Services-Anti-Spam-Index
US : http://en.wikipedia.org/wiki/CAN-SPAM_Act_of_2003

Here is a more comprehensive list maintained by SpamLinks.
http://spamlinks.net/legal-laws.htm#country

More…

Then there are the ISPs (Internet Service Providers).

I have a Tata Indicom broadband connection. From time to time, these guys feel I need to know about their latest antivirus offerings, or some cool deal they have for the festive season. These mails don’t even have an Unsubscribe option. When I call them up and ask to be removed from receiving these mails, the customer service people are initially clueless, and on further pressing inform me that these mails are to keep me informed. Er, what? And what if I don’t want to receive them? They say they cannot remove my email.

India needs an enforceable AntiSpam law, and now.

The Indian IT Act of 2000 and its 2008 Amendment:

Disclaimer: I am not a lawyer nor do I claim to understand law well. The views below are based on a reading and an attempt to understand publicly available documents.

The only section in the Indian IT Act – the only law in the country that deals with cyber offences – that I could find dealing with unwanted email is Section 66(A).

        any electronic mail or electronic mail message for the purpose of causing
        annoyance or inconvenience or to deceive or to mislead the addressee or recipient
        about the origin of such messages

Section 66(A) does not even begin to address the spam problems I describe above.

Either the existing law needs to include sections for dealing more specifically with spam or we need a standalone set of laws for making this kind of unsolicited email criminally prosecutable.

SocialTwist Tell-a-Friend