Archive for the ‘Uncategorized’ Category
On ugly teams, hiring and cocktail parties
Came across three short essays:
- Why Ugly Teams Win by Scott Berkun: Scott Berkun discusses his experiences working in the IE team at Microsoft, and ponders why Ugly Teams Win.
- Designer, Owner, Manager – 1: Hiring the Right People: Tips on hiring designers. Most of the points applicable to programmers too.
- Strangers at a cocktail party: Why do people at cocktail parties discuss weather, sports and other inconsequential things? What happens when you have a team consisting of cocktail-party-strangers?
Important tips for building great teams!
Setting up URL Shortening Servlet behind Apache
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>.
CSS Cheatsheet Wallpaper in Helvetica
Found this useful link through digg.
My print article appears in Linux For You May 2009 edition
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.
Larry Page's University of Michigan Commencement Address
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!
Linux Screen Rulers
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
Playing with CouchDB
I have been playing with CouchDB recently. It is a Document store:
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 is written in Erlang.
Buildr becomes Apache top level project
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!
Serving Static and Dynamic Resources in JSR 286
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>
The next baby step in Haskell
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.
Haskell: The first step (Installing Haskell Compiler in Linux)
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
New Year Resolution: Language to learn
We are in the mid-January of 2009, and I have taken the decision to learn one of these languages this year:
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!
JavaDoc: Avoid Manually Escaping HTML Special Characters
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.
James A Gosling's Cool Projects
Gosling, father of Java, contributes to some cool projects too. I found the following two:
Quick WebService Client in Groovy
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.


