Blog Archives

Build RESTful Web Service using Spring MVC Framework

Overview The post is about how to build a RESTful web service using Spring MVC framework.The main advantage of using Spring Framework is the modules within the application are loosely coupled achieved by Dependency Injection (Inversion of Control). Project Structure

Tagged with: , ,
Posted in Java, Programming

Eclipse hangs at the Android SDK Content Loader

Have you experienced Eclipse hangs at the Android SDK Content Loader? I ran into this problem once in a while. Try this: Locate your Eclipse executable Run command “eclipse -clean” to launch Eclipse in “Clean Mode” Once the Eclipse starts

Tagged with:
Posted in Android, Programming

How to use cronjob to execute periodical MySQL queries?

For my new project, I needed to aggregate user view counts periodically.  After i googling around, i figured using cronjob probably was the most popular way of doing it. So i wrote my sql queries to a file and schedule

Tagged with: , ,
Posted in Programming

Back up your MySQL database!

Couple days ago, short after I woke up in the morning, I decided to do some  data cleaning work to my live MySQL database. So I wrote a not so complicated SQL statement based on the logic in my head

Tagged with: ,
Posted in Programming

Hibernate query optimization

Today I would like to share my experience of Query Optimization. I’ve heard of Query Optimization for a long time, but I’ve never realized how powerful it was until now. Following are some graphs showing how my system performed before

Tagged with: , ,
Posted in Programming

Monitoring latency in Jetty request log

Are you interested in the response time of your web page/service? As the number of users grows, my web service started to show some performance degradation. But I couldn’t know how slow it was since I didn’t have elapse time

Tagged with: ,
Posted in Programming

Step-by-step of how to add pinch and double-tap zoom to ImageView

Recently, I added pinch/double-tap zoom feature to one of my projects. I would like to share how I did it in case other people need to do exactly same thing. There are a couple of solutions out there. But not

Tagged with: ,
Posted in Android, Programming

New features in .NET 4.0

I know .NET 4.0 has been released more than 1 year already. Finally, today I have some time to pay attention to it. I saw a very nice presentation given by Scott Hanselman about the new features of .NET 4.0. There are

Tagged with:
Posted in Programming

How to start a new Thread?

Java: First, we need a class that implement Runnable interface. Next, we instantiate the runnable class and pass it into the Thread constructor. Finally, we call the start() method of the Thread object. This will spawn a new thread from

Tagged with: , ,
Posted in Programming

Abstract method vs Virtual method

I was confused about the difference between abstract method and virtual method. They both provide the ability for derived class to override the base class’ behavior. They both could be used for achieving OOP’s greatest polymorphic characteristics. The biggest difference

Tagged with: ,
Posted in Programming