Building Strings using Java MessageFormat

March 15th, 2010

Until I used SL4J, I didn’t know that we can templatize String objects in a simple way. As most of us, use Log4J & apache commons logging framework for logging, we know general logging using these widely used open source frameworks. But there is more we can learn from these open source packages than just logging.

Read More »

Web Application Performance Tuning tips related to MySQL

January 15th, 2010

While I was browsing for MySQL Performance Tuning tips online, I found these presentations. You already might know some of these tips. Some are very trivial but yet miss our mind during design process. Some of them are unconventional, followed by high traffic websites. First one is an video presentation by Jay Pipes in Google. Second is a set of slides from MySQL Conference 2008 by Bjørn Hansen.

Read More »

Reversing a String using Recursion (substring) and StringBuilder in Java

December 13th, 2009

Recently I attended a job interview, in which they asked me to write an algorithm to reverse a String – “Hello World” to “dlroW olleH”. After the interview, I was tempted to test a few possible methods for reversing a String. I started with recursion, manual reverse using multiple ways and finally using Java’s StringBuilder.reverse(). I was surprised with the results.

Read More »

Use Timestamp instead of Date when results are bound by time – Hibernate SQLQuery

November 12th, 2009

I was debugging a problem in our existing java application. It was ignoring the time while sorting. This article contains debug results & fix for this problem.

Read More »

Testing memcached from command line

October 27th, 2009

We use memcached to cache static or less dynamic content and use java client to communicate with memcached. Memcached is a simple but powerful cache server which sits out side of JVM. Since it sits out of JVM, a cluster of java servers can use single instance of memcached for storing content. Many argue that [...]

Read More »

String Date property in a spring bean – No need for CustomDateEditor

February 17th, 2009

A while back I struggled to use java.util.Date as property of a spring bean, as it is not straight forward. We need to write custom property editors. Spring is a fantastic framework which simplifies our lives to a great extent. But I couldn’t digest this custom property editor logic for a basic object like Date.
After [...]

Read More »