Hello, I am an Engineering Manager at Facebook with 13+ years in Ad Technology, Natural Language Processing and Data mining. (Learn More)



What I look for in my hires

In here, I discuss the 7 qualities I look for in my hires - Predictability, Empathy, Autonomy, Adaptability, Growth potential, Ownership and Problem solving.


What I learnt about hiring

During the last year, Affectv has experienced rapid growth. We have doubled the engineering team in the last 8 months. This is a compilation of some of the things I learnt about the hiring process.


Cookie Mapping in Advertising

In this article, we will cover the process of cookie mapping (or cookie syncing) and how advertising companies use it to exchange information with websites and advertising platforms to serve relevant advertising to a user.

Building a url shortener in 10 mins

A 10 minute guide to building your own url shortener i.e. a service that lets you shorten a long url to a shorter url that takes up less number of characters.


Apache Pig Tutorial

An unofficial Apache Pig tutorial for the beginning and intermediate user which covers the basics of Pig and moves on to the more advanced concepts.

Summarisation Demo

Working demo of a summarization module I wrote a few years ago. This webapp lets you create summaries of large pieces of text.

Going Text-mode

I spend a great deal of time working on the Terminal. Here, I list my must-have console applications for email, www browsing, and programming in Linux, Windows and Mac OSX.

Setting up Replica sets in MongoDB

A 5-minute guide to setting up replica sets on MongoDB. Covers downloading, installation on various flavours of linux, editing the config file and initiating replica sets!


Super quick Find & Replace

This article explores a number of ways of performing a find/replace and compares the various implementations for different sizes of the find/replace list and input text.

Set data structures & Implementation

Sets are an important concept and extremely useful in various computer science applications. We take a look at some of the ways a set data structure can be implemented.

Manage your wireless with nmcli

This article shows you how to use the command line tool nmcli to manage your wireless networks. If you prefer cli over gui, go ahead and take a look.

Binary heaps & Priority Queues

Heaps and Queues can be a powerful data structure. This article goes into the implementation of a binary heap and extends the data structure to act as a priority queue.

Natural language Processing Resources

This page contains a list of resources for people interested in NLP. It includes links to research material, university software and datasets.


Recursive functions, Stack overflows and Python

Here we look at recursive functions in Python, and explore some ways of avoiding the maximum stack depth limit by using alternate functions like reduce().

Lesson 5 - Adding standard GUI elements

In this lesson, we'll learn how to add standard GUI elements like the statusbar and the toolbar.

Facebook puzzle - Find Sophie

Today we solve the FB engineering puzzle - [Find Sophie](http://www.facebook.com/careers/puzzles.php?puzzle_id=11). We start with a naive solution and improve the algorithm until we can pass the Facebook Puzzlebot. In closing, I leave you with open-ended questions on improving the algorithm further.

Win7Keys - Enable Windows 7 shortcuts on XP and Vista

An application to emulate Windows 7 shortcuts on Windows XP and Windows Vista.

Palindromic sub-sequences in python

This bit of python code returns all palindromic subsequences in the input string. Nothing to see here, I was just having a meh moment.

Writing a spider in 10 mins using Scrapy

I came across [Scrapy](http://scrapy.org) a few days back and have grown to really love it. This tutorial will illustrate how you can write a simple spider using Scrapy to scrape data off [Paul Smith](http://www.paulsmith.co.uk/paul-smith-london-308/category.html). All this in 10 minutes.


Script to generate URS from Wikipedia

A person's URS is a phrase that could be used instead of his/her usual name in all circumstances, which makes it absolutely clear who he/she is. ex. Bhagat Singh was executed by the British in 1931.

NLP classes for PHP

This is an ongoing project to develop a set of classes for Natural Language Processing. Some code would be ported from the NLTK project.

XML DOM in Java

Of late, I have been working with Java. One of the issues that I faced was XML parsing. With so many libraries available, I decided to stick to jaxp. What follows is sample code to Tree walk over the nodes.

Hacking wp-syntax plugin to show header

Learn to modify the wp-syntax plugin to display a header. This is very useful if you want to include, say, the file name of the code snippet you are syntax highlighting.

Exporting Opera email to mbox format

The following snippet combines the various opera mbs into one mbox format which can be used by other email clients like Evolution to import mail.


Indic to English Transliterator

Transliteration is the process of converting a word from one language to another while retaining its phonetic characteristics. This application lets you convert a word from any major Indian language (currently supports Hindi, Marathi, Sanskrit and Bengali) to English.

Deebot - an IRC chat bot

Deeb0t is an IRC chat bot capable of making meaningful conversation with other users. It also responds to commands issued by its owner.

Todo Plugin for Wordpress

I wanted a wordpress plugin to manage a list of ToDos and display them on my blog. Having found none quite suitable, I decided to write it myself.

Free Wordpress Templates

A collection of Wordpress templates that I designed over the years. Released as open source under the Creative Commons Attribution License.

I just wanted to be sure of you

Some Winnie the Pooh wisdom. Sometimes you learn a great deal from reading books for young children. Just a quote from the Hundred acre woods.

GPRS over linux

This article tells you how I configured my ubuntu linux based laptop to connect to the internet over GPRS. I own a Nokia E51 and I used a USB cable to connect it to my laptop.

Euclidean Distance Calculator

The following snippet returns the euclidean distance between two places on the globe using the Yahoo Maps API.


Using Devanagari in Latex

This article shows you how you can use the Devanagari script (Hindi, Marathi, Sanskrit) in Latex.

Yammy - Yahoo Messenger Archives Decoder

Yammy is an app that allows you to decode and view not only yours but other's archived YM conversations. You don't even need a password!

Document Tagger

DocTagger lets you automatically classify text documents. Use this as a starting point to write apps that can sort through volumes of unorganized data.

Weekday Stats for Wordpress

This plugin is capable of displaying two graphs - Posts per Day and Comments per Day for the days of the week.

Twitter Timeline Javascript

This snippet draws a bar graph that tells you your twitter posting frequency per hour in the last 24 hours.

Windows shell (explorer.exe) replacement in C#

This document will teach you to make your own windows shell replacement. If you don't know what a shell replacement is, take a look at [Shellfront](http://www.shellfront.org/).


Limerick Generator - Part I

The following code demonstrates an alien [limerick](http://en.wikipedia.org/wiki/Limerick_(poetry)) generator. The code illustrates a very simple random word generator that generates rhyming words.

Running bbpress on sourceforge

Sourceforge does not allow php mailers. Software like bbpress which use the mailer to send newly registered users their password fails. This article will describe how I went about solving this problem.

RediffBlog Crawler

BlogCrawler enables you to save your entire rediffblogs blog to disk along with all the comments!

FindWindow Illustration

The following code illustrates the use of FindWindow API. This program blanks out the ad in Yahoo Messenger buddy window

Implementing Emoticons in C#

This piece of code shows you one way of replacing emoticons with their images. It uses a Hashtable (hashmap) to do a find replace.


Yux - Yahoo Messenger for *nix

Yux is an alternative Yahoo Messenger client for *nix systems. What distinguishes Yux from other clients is that Yux attempts to match the look and feel of the official version of the Windows client.


Auto-tagging of TagBoards

This Perl snippet illustrates how one can automatically post data to http://www.tag-board.com tag boards. Learn how Perl does POST requests.

Lesson 4 - Code Documentation and Code Versioning

Today we're going to take a look at two very important development practices - Code documentation and Code Versioning.


Lesson 3 - Resources - Icons, Dialogs and Menus

In this lesson we'll take a look at Windows Resources. You'll learn to add an icon to your application, add a menu, and version information. You'll also learn to include a very important kind of resource - the Dialog resource.


This is an ongoing series on win32 programming on the Windows PC. In this article, I introduce the subject and discuss ways of getting in touch.

Lesson 2 - Creating a basic window

In this lesson you will be introduced to the event-driven programming model. You will learn how Windows uses messages to communicate with applications, how event based programming works, what callback functions are, and while doing this create a basic windows application.

Yahoo Messenger Packet Analyser

This tool will show you the raw YMSG (Yahoo Messenger) packets passing through your machine. Developers and non-developers can use this to understand the YMSG protocol better.


Anonymous ftp scanner

This code illustrates how you can use unix socket programming to scan for open ftp ports accepting anonymous logins in a given IP range.

Lesson 1 - Your first windows application

Welcome to your first lesson. You will learn to create your first windows application which will display 'Hello World!' in a message box.