Monday, August 27, 2007 -- trawl the web

I received the much awaited beta release invite few minutes before.

Here is a screen shot

The real-time search is obviously slower than the Google search and also not ranked. Filtering by website feature is pretty helpful.

UPDATE: I just observed everytime you search for something mylivesearch hits the website explicitly. I confirmed this using my web analytics (StatCounter -- used for this blog) to test.

Sunday, August 19, 2007

Google Reader Helper for Firefox

Google Reader is one of the most popular web services and I personally use it everyday. One of the features that I miss using a RSS reader is the ability to view comments. In this post I would share a simple hack to help with this issue and to more importantly serve as a proof-of-concept for possibilities around web application extensions. It is written on a framework called Chickenfoot for Firefox that I recently stumbled upon.

What is Chickenfoot?

Chickenfoot for Firefox is itself a Firefox extension that puts programming environment in the browser's sidebar that allows you to write scripts to manipulate the web pages. Chickenfoot is a superset of JavaScript and puts the user in control of writing quick extensions to web pages. There is a detailed quick start tutorial of Chickenfoot here and the extension can be installed from here.

Google Reader Hack

While reading a post in Google Reader there will be only one expanded view of the post which lives under the <div> with id='current-entry'. This hack leverages this to identify the post that user is currently reading and loads that page in another tab automatically. If you're interested in quickly checking/leaving a comment for the post, then you can switch to the other tab and do so immediately without having to click and wait for it to load.

Once you have installed Chickenfoot, download the script here and open Google Reader on Firefox and start the script. If you're familiar with JavaScript then it should be self-explanatory.


Chickenfoot programming paradigm could be used to enhance web experience for user's convenience. Also the intersection of Chickenfoot with concepts like Programming Collective Intelligence will fuel greater innovation by allowing user to be more in control of the experience.


Chickenfoot For Firefox

Chickenfoot Blog

Google Reader Helper Script

Technorati tags: , ,

Sunday, August 12, 2007

Caching: Memcached and Terracotta

Applications are generally built with an expected user base but soon might be overwhelmed due to business demand. This is especially particularly true in the context of consumer facing applications. Caching is one of the most important aspect to improve application performance by storing object in Cache (memory) reducing database load.

Caching in a clustered environment requires a Distributed Caching solution which can support failover scenarios and data reliability. In this post I would like to explore the capabilities of Memcached and Terracotta as distributed caching solutions.

Memcached is a high-performance distributed object caching system with client APIs for Perl, PHP, Python, Ruby and Java. Here are some of its capabilities and limitations (using Java client API):

  • Requires objects to be Serializable
  • Object Identity is NOT preserved
  • Supports cache expiration
  • Does NOT handle failover scenarios
  • For a given object selects a server from a pool of cache server based on hash of the key
  • Easy to configure (through SockIOPool class)

Terracotta is an open-source Java based clustering solution for JVM. Distributed Caching can be achieved using Terracotta by using a java.util.HashMap or open-source caching solutions like EHCache, OSCache and JBoss TreeCache.

  • Preserves Object identity
  • Manages memory efficiently through Virtual Heap
  • Declarative requirement for lock support
  • Simple configuration file with Eclipse Tool support
  • Good documentation, support and active development
  • Due to the nature of its implementation certain classes are not Portable and hence cannot be used
  • Hard to determine which third-party classes are portable
  • Does NOT require classes to be serializable
  • Easy to configure and get started!
Technorati tags: ,

Thursday, August 09, 2007

Data Services in Spring

In today's web applications the need for returning model data from controllers in XML/JSON format is quite common. Mostly these requirements are met by writing custom code in controllers. In this post I will present technical approach that would enable your applications to return data model in XML/JSON or data format of your choice to the web tier using Spring MVC without modifying your applications.

Basically the idea is to return XML(or JSON, etc) whenever we encounter a request to the controller with parameter returnData=XML. This can be accomplished by writing a HandlerInterceptorAdapter with postHandle method to do the following:

void postHandle(HttpServletRequest request, HttpServletResponse response, Object handler, ModelAndView modelAndView)

if ( request.getParamter("returnData") != null && request.getParamter("returnData")="XML" )

// add a XML Serializer to the model
// Find the model object names and add the list to model attribute "xmlModules"
// Set the view name to "xmlView"



In your xmlView (JSP or Velocity Template) for each attribute in xmlModules use the XML Serializer to generate XML and render it. There are few applications for this approach:

1. Enable front-end to readily use AJAX for existing controllers
2. Use this as a strategy to get a debug view of model data during development
3. Based on some additional key use this to get debug view from production for troubleshooting purpose


1. XStream for XML Serialization

Tags: java spring ajax

Wednesday, August 08, 2007

Kudos for AOL local

I stumbled upon a feature on AOL Local Search which I felt is really innovative. Lets say you search for "pizza" near a particular address and then you drag the map, it automatically searches and plots businesses relevant to the search in the current focus of the map.

Disqus for techtalk