indiWiz.com

Subhash's Tech Log

Archive for the ‘Uncategorized’ Category

On ugly teams, hiring and cocktail parties

without comments

Came across three short essays:

Important tips for building great teams!

Written by Subhash Chandran

July 23rd, 2009 at 12:21 pm

Posted in Uncategorized

Tagged with

Setting up URL Shortening Servlet behind Apache

without comments

Today I worked on setting up my URL redirection servlet (download) in our office to share internal links with my colleagues. I deployed it in JBoss. When I deployed this module as r.war, JBoss complained saying java.lang.IllegalArgumentException: Prefix string too short. I renamed the war as redir.war and deployed it.

When I tried accessing the JBoss URL from another system in the network, I found that JBoss was not accepting connection from other systems in the network. Then I configured Apache to use ProxyPass:

ProxyPass /r http://localhost:1111/redir
ProxyPassReverse /r http://localhost:1111/redir


Note: JBoss was listening in port 1111 in my case. I added this to my apache configuration and restarted Apache. Now I have a cute URL shortening service which is accessible as http://myhost/r/<string>.

Written by Subhash Chandran

June 18th, 2009 at 10:33 am

Posted in Uncategorized

Tagged with ,

CSS Cheatsheet Wallpaper in Helvetica

without comments

Found this useful link through digg.

Written by Subhash Chandran

June 16th, 2009 at 9:38 am

Posted in Uncategorized

Tagged with

My print article appears in Linux For You May 2009 edition

without comments

The article is titled Testing RESTful WebServices Made Easy. You can read a small synopsis here. For those of you who cannot get a copy of Linux for You, the article will be made available by the publisher with Creative Commons License next month.

Written by Subhash Chandran

May 11th, 2009 at 9:22 am

Posted in Uncategorized

Tagged with

Larry Page's University of Michigan Commencement Address

without comments

Larry Page has given a wonderful address. He has reinforced the value of family so well. All my compatriots in Indian software industry, don’t waste your time in your virtual world and spend countless hours in your cubicle! Your family is waiting for you!

Written by Subhash Chandran

May 7th, 2009 at 9:08 am

Posted in Uncategorized

Tagged with

Linux Screen Rulers

with 3 comments

Recently I have been working with a demanding Web Designer based client. She was insisting on pixel-level spacing and detail. Thus I wanted to have a Screen Ruler for measuring her template. I use Ubuntu-based Linux, and found the following tools in its repository:

For KDE users:


$ sudo apt-get install kruler

For GNOME users:


$ sudo apt-get install screenruler

Written by Subhash Chandran

April 21st, 2009 at 3:13 pm

Posted in Uncategorized

Tagged with , ,

Playing with CouchDB

without comments

I have been playing with CouchDB recently. It is a Document store:

CouchDB Documents

As can be seen in the above screenshot, we can store any number of attributes (key-value pairs) for the document. And one document may have any number of attachments.

CouchDB provides RESTful-JSON API to access and download documents:

CouchDB JSON Representation

CouchDB JSON Representation

CouchDB is written in Erlang.

Written by Subhash Chandran

April 13th, 2009 at 10:41 pm

Posted in Uncategorized

Tagged with , , ,

Buildr becomes Apache top level project

without comments

Apache Buildr is now a top-level Apache project. Buildr is a Java build tool which uses Ruby (and JRuby) and provides dependency management functionalities. Think Maven has got some real competition now!

Written by Subhash Chandran

February 25th, 2009 at 10:22 pm

Posted in Uncategorized

Tagged with , ,

Serving Static and Dynamic Resources in JSR 286

with 2 comments

To serve static content packaged as part of the portlet WAR, we generally take this approach:

<%=response.encodeURL(request.getContextPath()+"/js/project.js")%>

For generating dynamic content what do we do? In JSR 168 this was not possible. Thankfully, JSR 286 introduced this important concept. For creating dynamic content, just override the void serveResource(ResourceRequest request, ResourceResponse response) method in javax.portlet.ResourceServingPortlet (implemented by javax.portlet.GenericPortlet). A simple example:

    @Override
    public void serveResource(ResourceRequest request, ResourceResponse response)
            throws PortletException, IOException {
        String paramValue = request.getParameter("abc");
        System.out.println(paramValue);
        response.setCharacterEncoding("UTF-8");
        response.setContentType("text/plain");
        PrintWriter pw = response.getWriter();
        pw.println(paramValue);
        pw.close();
    }

To link to this dynamic content:

<portlet:resourceURL var="url">
  <portlet:param name="abc" value="Hello World"/>
</portlet:resourceURL>

<a href="<%=url%>">Dynamic link</a>

Written by Subhash Chandran

February 20th, 2009 at 5:15 pm

Posted in Uncategorized

Tagged with , ,

The next baby step in Haskell

without comments

One important parameter in learning a new language is the language’s approachability. I remember the difficulty I faced when learning Java. I was asked to know things like package, static function, etc. I was kept in the blank about these features till I reached the these trails in my learning. This is disappointing, and can intimidate learners from learning such language.

Haskell, just like Python (and other languages like Ruby, Perl, Groovy, etc.) provides a simple interactive shell called ghci. This allows one to immediately jump into Haskell, experimenting with its syntax without further ado.

Written by Subhash Chandran

January 24th, 2009 at 1:08 pm

Posted in Uncategorized

Tagged with ,

Haskell: The first step (Installing Haskell Compiler in Linux)

without comments

Today visited the Chennai Book Fair. And in pursuit of my New Year Resolution, I bought Real World Haskell book. I am running Mint Linux, and installed the GHC compiler thus:

$ sudo apt-get install ghc6
$ sudo apt-get install libghc6-mtl-dev

Written by Subhash Chandran

January 17th, 2009 at 9:54 pm

Posted in Uncategorized

Tagged with ,

New Year Resolution: Language to learn

without comments

We are in the mid-January of 2009, and I have taken the decision to learn one of these languages this year:

  1. Haskell
  2. Erlang
  3. Clojure

In the recent past I have been hearing some great stuff about these languages. Haskell and Erlang I have been attracted due to their powerful concurrency support. After reading Paul Graham‘s preface in On Lisp, I became attracted to Lisp (and Clojure). Haskell also has a JVM implementation, Jaskell. Coming from a Java background, I think this should be easy for me. Time will tell which one of these I will pick and learn!

Written by Subhash Chandran

January 13th, 2009 at 10:50 pm

Posted in Uncategorized

Tagged with

JavaDoc: Avoid Manually Escaping HTML Special Characters

without comments

I discovered this new tip: when writing JavaDoc comments, we do not need to escape HTML characters. The magic happens when we enclose such content inside {@literal ...}. So typically, a comment would look like:

{@literal x < y}

There is another JavaDoc quickie in this line. It is {@code ...}. This is also like {@literal ...}, but displays the code in a different mono-spaced font.

Written by Subhash Chandran

December 14th, 2008 at 5:10 am

Posted in Uncategorized

Tagged with

James A Gosling's Cool Projects

without comments

Gosling, father of Java, contributes to some cool projects too. I found the following two:

  1. Huckster: This is a simple Swing application to build presentations.
  2. Bloged: This again, is a Swing application to post blogs without launching your browser.

Written by Subhash Chandran

December 12th, 2008 at 7:43 am

Posted in Uncategorized

Quick WebService Client in Groovy

without comments

Writing WebService client in Groovy is simple.

import groovy.net.soap.SoapClient

def proxy = new SoapClient("http://localhost:7777/path/to/endpoint?WSDL")
def result = proxy.sayHello("Subhash")

println result

sayHello() is the operation name.

More details here. See the Installation part, you need to put the Groovy SOAP Jar in ${user.home}/.groovy/lib.

Written by Subhash Chandran

November 18th, 2008 at 9:50 am

Posted in Uncategorized

Tagged with ,