Tuesday, November 30, 2010

Change at lifeblob

I still remember the day when I put in my papers at Trilogy over 3 years back to start lifeblob. Since then, the journey that Pranav, I and the rest of the team took, was nothing short of a roller-coaster ride! We had a fun filled and exciting period working on something that we believed so passionately about. I hope to share some of the insights and my learnings in the future.

Last week lifeblob was acquired by Printo, and the details can be found here.  I am quite excited about this step that brings together the largest retail printing player in India and an elegant personalized photo merchandising platform, which results in a great and consistent customer experience when they visit Printo both online and offline.

Post this change, the team has already started work to integrate and quickly launch the platform for both online ( printo.in ) and offline (over 15 stores and increasing)  channels.

If you need to reach out to me, you can email me at rakeshxp at gmail dot com or catch me on @xp.

Wednesday, October 13, 2010

Tuesday, September 14, 2010

Auto Complete with Redis & Java

Salvatore ( @antirez Redis creator ) recently wrote a nice article on implementing auto completion using Redis Set. Since we use redis at lifeblob and we have been thinking of enabling auto complete for some search options,  I came up with a java equivalent. You can grab it from github.

Sample usage:

Note that I am using Jedis java library since that looks like the only java based redis library that supports ZRank.

Monday, January 14, 2008

Reverse Geocoding Using GeoName Data

I have be using GeoNames data for implementing reverse geocoding.

It took me a while to get it working and thought of sharing the steps that I followed ( Postgres + Postgis ) to get the reverse geocoding work ( and it is fast! )
1) Created and loaded the table by following link or link.

2) Created a geometry column
SELECT AddGeometryColumn( 'public', 'geoname', 'latlon_point', 2163, 'POINT', 2 );
Note that I am using 2163 as SRID ( the unit is meter )

3) Populated the column
update geoname set latlon_point =
transform(GeomFromText('POINT(' || longitude || ' ' || latitude || ')',4326),2163)

4) Created a clustered gist index
CREATE INDEX geoname _latlon_place_index
ON geoname
USING gist
ALTER TABLE geoname CLUSTER ON geoname _latlon_place_index;

5) To find nearest 5 records (within 5 kms) for the given lat/long ( 12.97199/77.60483)

SELECT * FROM geoname
WHERE feature_class = 'P'
and st_dwithin(latlon_point, transform(GeomFromText('POINT(77.60483 12.97199)',4326),2163),5000)
order by ST_Distance(latlon_point, transform(GeomFromText('POINT(77.60483 12.97199)',4326),2163))
limit 5

The above query should be extremely fast if the gist index is created properly. One way to confirm whether is it using the index or not, is by looking at the query planner output :

"Limit (cost=9.82..9.82 rows=1 width=175)"
" -> Sort (cost=9.82..9.82 rows=1 width=175)"
" Sort Key: st_distance(latlon_point, '...'::geometry)"
" -> Index Scan using geoname1_latlon_place_index on geoname1 (cost=0.00..9.81 rows=1 width=175)"
" Index Cond: (latlon_point && '..'::geometry)"
" Filter: ((feature_class = 'P'::bpchar) AND (latlon_point && '..'::geometry) AND ('..'::geometry && st_expand(latlon_point, 5000::double precision))

As with any user generated data, there are dirty data present in this dump like duplicate place record, empty place name etc. Also since I am interested only in cities, I added a filter on feature_code = 'PPL' and feature_class = 'P'.

This is just the first pass, and I still need to do couple more processing for cases where the place name contains punctuation, duplicate places across state/country etc. I'm calling it a night! The alarm clock is going to go off in just six hours.


Friday, October 19, 2007

LifeBlob is Live !!!

We are feature complete and passed out invites to our first set of users!

My Timeline

Tuesday, September 18, 2007

Running Memcached on Windows

I was trying to run memcached server on windows as that is my current development OS. Unfortunately the memcached's windows port has given only source code for libevent ( a dependency) and it needs VC to compile :P. With obvious lack ( read: interest ) in VC tools, I set on a big google hunt for finding the windows build of libevent.

I was finally able to get some luck from this site. Thanks to them, I was able to get memcached running successfully.

I have attached the memcached ( 1.2.1 ) setup here

Sets to run the server
1) Unzip the folder to any directory
2) Within the folder, run memcached.exe -d install ( One time )
3) For
starting the server: memcached.exe -d start
stopping the server: memcached.exe -d stop
4) To uninstall the service, run memcached.exe -d uninstall

You can also run memcached.exe -h to find all the properties that can be configured.


Wednesday, August 22, 2007

Excellent Y! Support

The closure Y! photo's was indeed a bad news. I was totally in love with their interface and obviously unlimited storage:P The day the news came in, I decided to move my photos ( > 2 GB ) quickly ( read: bad judgment ) to flickr. The decision was pretty much based on Flickr's brand name over other options. After the image transfer, I realized that I would have been better off using either Shutterfly/SnapFish service which offers unlimited storage.

But as expected, after doing the photo transfer to Flickr, my Y! photo account got locked. ( It was mentioned in their FAQ that the transfer is a one time only operation). I shot a mail to Y! support ( with the least expectation ) on whether it is possible for them to reactivate my Y! account so that I could migrate to another photo service.

I received a mail from their support within 2 days and was a positive reply :)


Thank you for writing to Yahoo! Photos.

Thank you for contacting us regarding your attempted move of your Yahoo! Photos to another service. We are very sorry to hear that you are having problems moving to the affiliate of your choice.

We have released your Yahoo! Photos account so that you can attempt the move again. If you are having continuing problems moving to the same affiliate, you may want to try moving to a different affiliate or simply downloading your images to your computer yourself and then manually uploading them to the affiliate of your choice.

If you have any additional questions or concerns please let us know as soon as possible as we'd be more than happy to help!

- http://help.yahoo.com/l/us/yahoo/photos/

We appreciate your time in writing to us -- your input helps us to identify ways to help make this the easiest and most hassle-free way to transition all of your favorite photos to one of these great services above!

Thank you again for contacting Yahoo! Photos.


Jamie Lynn

Yahoo! Photos Customer Care

This kind of support is truly amazing and very much appreciated!

PS: I moved my photos to ShutterFly. My new preference is Google Photos but sadly they don't provide "free" unlimited storage :(