Archive for August, 2007

Server Side Push and Comet

August 10, 2007

At my current project at work, we need the ability to push events/data to clients using a typical web application which already has some XHR elements in it. Our current approach has been to use a Java Applet and let it make a socket connection back to the web server. This persistent network connection allows us to send events to the client, independent of client’s own requests. However, this solution is not super clean, mainly because applets are old-school and it takes an insane amount of effort to maintain the applet-JavaScript communication.

So, I set up on a quest to find other technologies available for server side push, and came across Comet. Comet is essentially a style of programming that allows event-driven server-side push data streaming. The best example of Comet is Google Talk inside GMail. Zhou Renjian has already cracked this and created a plain JavaScript implementation. There is no dearth for implementations of this technology. However, none of those fit our needs exactly.

Fortunately, many web containers are already beginning to realize the value of such technology. Most of the major containers look like they will have support one way or another in the near future. Jetty is working on continuations. Tomcat is introducing a CometEvent. WebSphere is relying on DOJO. Weblogic has an AbstractAsynServlet.

In any case, I ended up using a persistent XHR connection between the server and the client. This worked like a charm, although I haven’t been able to test the scalability part of it yet. Fortunately , or unfortunately, our project does not have high performance expectations, and so it will take some more time until I can figure out the scalability aspect of this solution.


Metal and Glass

August 7, 2007

If you are following the mac community or apple inc, you must know by now that the new imac’s, ilife and iwork suites are out. After glancing at the new imac design, it looked kinda familiar, and after reading this post at 37 signals, it hit me in the head. Apple’s design team do follow a neat pattern, when it comes to product design. Absolutely stunning.

I’m waiting for the new ipod to show up.

Context Free Grammar and Venba

August 4, 2007

At work, I have been meddling with voice applications and grammars – primarily the Speech Recognition Grammar Specification. In the realm of voice recognition, a grammar is used to provide a limited set of choices (and permutations of these choices) to the recognition engine. Basically, a grammar specifies the vocabulary for the recognition engine for a particular turn in the speech application.

SRGS is a type of context free grammar. And while looking into already available parsers for such context free grammar, a co-worker of mine chanced to see this Wikipedia entry about Venba, and their relation to context free grammar. (Although the Wikipedia entry spells Venba with a ‘p’, I believe the actual pronunciation in Tamil warrants a ‘b’.) This one really brought back all the school memories, where we trying to identify seer, pulima, karuvilam and koovilam.

In any case, this wiki entry led me to a paper that analzes various venba’s to see if they adhere to the grammar rules. Here is a breakdown the paper does for a kural.

Derivation Tree for Tirukkural

It is amazing that the Tamil poets intuitively followed such grammar rules several thousand years ago.