February 27, 2012
Chennai power cutoff timings plotted on a Google Map

TNEB released timings of power cutoff in Chennai. Here is the report

Its a pain to find your locality in this huge chunk of text. All newspapers published it, but none cared to plot it on a map

I made a quick tool and plotted the areas and timings on a Google map.

http://www.yemkay.com/power-cutoff-timings/

How this map was made?

  • Extract the region names from the report
  • Geocode the regions using the Google Maps Geocoder API.
  • Create a spreadsheet by populating Name, geo-coordinates & the time of all the regions
  • The last column of this spreadsheet represents the JSON coded array of that row
  • Create a simple Google Maps mashup by creating markers for the regions.
  • The icons representing the cutoff time were created using this awesome tool
  • The tool uses Twitter Bootstrap for visual features like push button and round cornered boxes

8:56pm  |   URL: http://tmblr.co/ZkjYJyH7aduk
(View comments
Filed under: hacks 
December 19, 2010
Released new version of “Daily Cartoons” App

Published next version of my Android app - Daily Cartoons. New features are,

  • Ability to browse and view cartoons from various channels like AnderToons, Cricinfo, Times Of India, Deccan Chronicle, Amul.
  • More channels will be added on the fly, without needing to upgrade the app
  • Cartoons are now grouped by publishing date viz. Today, Yesterday, 2 days ago and older.

Download by clicking this link from an Android phone. Or scan this QR code 


Browse CartoonsView cartoonChoose cartoon channels

12:57pm  |   URL: http://tmblr.co/ZkjYJy2DKexz
(View comments
Filed under: products 
October 19, 2010
Daily Cartoons - Android app

My first Android app is in market now. Its a simple app to browse cartoons from CricInfo

Cartoons androidCartoons android

Download by clicking this link from an Android phone 

OR

Search for “Daily Cartoons” in market

OR

Scan this QR code

 

Future releases will add Cartoons from magazines like Times of India, Indian Express, Deccan Chronicle.

I also hope to add features like notifications, unread items, custom subscriptions in future releases.

September 7, 2010
Twitter OAuth PHP library

Twitter API shut down Basic Auth on August 31. I was a big fan of the Arc90 Twitter library, but its no longer usable because of the shutdown. Even before the shutdown, I’d been using Abraham’s twitterOAuth for Twitter Signin integration with my websites. Its a nice library that hides the OAuth security aspects from developers. But after having used Arc90 library in all my projects, migrating the code to another library was costly and time consuming.

So, I merged both the libraries. I enabled OAuth in Arc90 library by making some internal calls to twitterOAuth library. This way, I could continue using Arc90 library in my projects just by porting the new library and adding few lines of code to pass access tokens to the library object.

I’ve published the library in GitHub at http://github.com/yemkay/arc90-twitteroauth, which is also my first Open Source contribution. 

Here is a code snippet that retrieves Twitter home timeline using the new library:

<?php

require_once("lib/Arc90/Service/Twitter.php");
$twitter = new Arc90_Service_Twitter();
//Pass consumer key, secret of Oauth app and user's access token, secret
$twitter->useOAuth('OAUTH_CONSUMER_KEY', 'OAUTH_CONSUMER_SECRET', 'USER_TOKEN', 'USER_SECRET');
//Get tweets from user's timeline
$response = $this->twitter->getFriendsTimeline('json', array('count' => 200, 'page' => $page));
echo ('HTTP code: '.$response->getHttpCode());

if (!$response->isError())
{
	$messages = $response->getJsonData();
	echo 'Found '.count($messages).' new tweets';	
	/* GO AHEAD AND PROCESS TWEETS */
}
else
{
	echo 'Error description: '.$response->getData();
}


?>

11:23pm  |   URL: http://tmblr.co/ZkjYJy10VU_F
(View comments
Filed under: Projects 
August 21, 2010
Combining MySQL FULLTEXT match with other WHERE conditions

I was too late to realize that a query like the following, which combines FULLTEXT match and another where condition is not scalable.

SELECT * FROM mytable

WHERE MATCH(message) AGAINST (‘inception’) AND is_member = 1

(In this table message is FULLTEXT indexed and the boolean type column is_member is B-Tree indexed)

The query is not scalable, because MySql can’t use both the indices (It can use only one index per table). And, we can’t index both these columns together too.

The solution is pretty simple. While inserting message into the table, append an unique value to identify the record as member’s one. I’d do something like this,

INSERT INTO mytable(message, is_member)

VALUES(‘Just saw inception ismember’, 1)

Now, MySql indexes the word “ismember” along with other texts in the record, and we can use a query like the following, without the extra WHERE condition,

SELECT * FROM mytable

WHERE MATCH(message) AGAINST (‘+inception +ismember’)

This query will return only the member records that matched “inception”. This query uses just one index and runs pretty faster than the previous one. The difference can be seen, when you have millions of records in your table.

This example showed a boolean column. But this can be extended to columns of any type. We just have to make sure to append unique identifiers to the FULLTEXT indexed column.

July 6, 2010
Associated Parsers: FootTweet and Twitter Streaming API

My post on AP blog about how we used Streaming API for gathering Twitter posts to FootTweet

FootTweet is a virtual FootBall game played on the platform of Twitter. We use the powerful Twitter Streaming API to get the tweets to FootTweet in a few seconds after they were posted to Twitter.

When you have number of keywords to track and you want the information in real time,…

July 3, 2010
Associated Parsers: Foottweet !

Our first launch from Associated Parsers. Go check out!!!

Introducing FootTweet, a very advanced web app that displays and categorizes tweets according to their content !

We’ve decided to show our technology applied to the World Cup, ‘cause there’s about 3 billion ppl watching, and we thought some of them could be tweeting as well ;)

Twitter.com…

3:22pm  |   URL: http://tmblr.co/ZkjYJyq8S0x
(View comments  
Filed under: Projects Twitter 
May 11, 2010
Quick hack on Twitter Follow bug

We made a quick hack to find out the most demanded followers during the Twitter follow bug drama.

Associated parsers:

Seemingly Twitter had a small bug tonight. Here are the top “requests” for acceptance made by users : http://www.associated-parsers.com/accept/

3:25pm  |   URL: http://tmblr.co/ZkjYJyqhRF7
(View comments  
Filed under: Twitter hacks 
April 18, 2009
CricTwits



Check out my biggest launch till date: CricTwits - an aggregator of Twitter conversations revolving around Cricket matches. This project was inspired from Title Tweets, a similar initiative for a basketball tournament in USA.

It took 2 weeks to build this website after getting an inspiration from Title Tweets. CricTwits collects twitter posts containing references to cricket matches, team names, player names. The match page shows tweets favoring the two teams and also allows you to post to your twitter timeline from within the Website. There is also a live scoreboard on the match page. So, you have one reason less to leave the website.

I timed the launch to coincide with IPL. CricTwits is a great platform for IPL fans to stay close to thier favorite club. Go Tweet!!

CricTwits

August 16, 2008
Postal Address Locator (PAL) - an innovation by India Post

Those who think Postal Services are not meant for this generation, rethink!!!. India post has proposed to replace the age old Postal Index (PIN) code with 8 digit Postal Address Locator (PAL) code. In the past we have seen such revolutions in Telecom industry, when the number of digits in our telephone number increased from five to six and then to eight. Now we will soon see our pin codes also changing this way, but your new code is not going to be your old code prefixed with the state/city code.

As per this proposal, the new PAL code will have 8 digits. First two digits denote the state, next two digits denote either the metro or the district. For a metro locality, the fifth digit denotes its zone and the last three digits denote the locality. For a non-metro locality, the 5th digit denotes a town in the district and the last 3 digits denote the village.

For metro localities


22015248



{State}{Metro City}{Metro Zone}{Locality}



For non-metro localities


22106178



{State}{District}{Town}{village}



In third and fourth digits, the range 01 to 09 is used to denote a metro in the state and values 10 to 99 are used for districts. So, this code can accommodate 9 metros and 90 districts in a state, which is good enough even for the largest state U.P, which has 70 districts. It’s imminent that the code for state capital will be 01. Metro, in this context, doesn’t mean metropolitan cities but municipal cities. So second tier cities like Coimbatore, Pune, Surat, Mysore will be identified from each state and metro codes are assigned for them. There can be 9 such cities from a state.

If the fifth digit is between one and five, it denotes a zone in metro and other values denote a town in the district. As this system accommodates just 5 towns in a district, it’s not clear on what basis such towns are identified from districts.

At maximum, the system supports 9999 villages in a district or same number of localities in a metro. So the smallest entity identified by this code will be a village or a metro locality, regardless of whether it has a post office or not. A question arises here is that a small district in the state of Pondichery and the Mumbai city, which has a population of 2 crore, will get the same number of slots for their localities according to this design. I think, for postal department geography is more important than the demography. So Mumbai with an area comparable with that of a district will get the same number of slots for its localities. Rather I feel, by allotting single digit metro code value (01 to 09) in the third and fourth positions, they are wasting a precious digit in the PAL code. We could increase the number of locality slots for a metro by 10 fold, if just the third digit is used for the metro code and the last 5 digits are used for the localities. India post encourages citizens to send their views on the new PAL system. Note the email address - deputydgpoi at gmail.com. I’ve just sent the above suggestion to this email.

The proposal document claims that the first half of the code will be used to segregate the outgoing mails and second half will be used in delivering the incoming mails.

Another interesting aspect I noted from this document is about the increasing passion in Government organizations like India Post and BSNL. See this excerpt from a slide for popularizing the PAL system,

Launch a bold and innovative publicity campaign for 2 months before introduction that should catch the imagination of the nation like wild fire - Something like KBC or IPL


Would you have imagined this passion in a Govt. organization? Though they are far behind the private organizations in terms of liberal decision making, there are already promising signs of improvement. One should note that unlike growth in the private sector, the growth in Government sector triggers growth of the Nation by multifold.

Liked posts on Tumblr: More liked posts »