Skip to main content


Showing posts from 2010

Dream comes true - a movie directing experience

For random reason, I was assigned for a project of a cheesy 10 minute film, including script writing, film directing and editing. Although all the actors and the producer involved are all nerdy software engineers and managers, one of them does have professional movie acting experience with a best director in the world. Schedule is tight, actors are not trained, and budget is zero. However the project went well and film went out on time.

Java closure shows his face - Lambda expression

JSR335 , Lambda expression started review ballot stage on November 16th 2010. Java closure finally show the new breath taking expression. Citing from the detail of JSR request: ... 2.7 Please give a short description of the underlying technology or technologies: We propose extending the Java Language to support compact lambda expressions (otherwise known as closures or anonymous methods.) Additionally, we will extend the language to support a conversion known as "SAM conversion" to allow lambda expressions to be used where a single-abstract-method interface or class is expected, enabling forward compatibility of existing libraries. We propose extending the semantics of interfaces in the Java Language to support virtual extension methods, whereby an interface can nominate a static default method to stand in for the implementation of an interface method in the event that an implementation class does not provide an implementation of the extension method. This enables interfaces

My day

8:00 Time to get up. First thing first, before Yilin wakes up, I have a few minutes to prepare her breakfast. Fortunately, this is done with my mom's help. 8:10 Yilin usually starts her day at this point, which leads to diaper changing, cloth changing, running and chasing, etc. 8:20 - 9:20 A full hour can slip so quickly, when it's time to feed Yilin. Again, my life would be much more painful if my mom weren't here. Sometimes I take chance to have my breakfast, sometimes I miss. 9:20 It's time to take Yilin to day care. It's already late since the morning activity time is from 9AM to 10 AM. If lucky Yilin can enjoy the sunshine for 30 minutes. 9:50 - 10:30 After good bye with Yilin, finally it's time to take a bus and go to work. This 40 minutes is one of my most relaxing time in a day. Sometimes I pick a book to read. But more and more often, I play little games on iphone. 10:30 It's an awkward time to come to office and start work this late. However I'

11 reasons to be a fulltime dad

11. Escape from paid job 10. Lose weight 9. Appreciate wife and parents more 8. Speak a new language, baby talk 7. Change a lot of diaper, clean a lot of mess and do a lot of cooking 6. Survive without sleeping 5. Understand why day care is expensive 4. Live with priorities 3. Learn to do everything with plan 2. Learn to do anything without plan 1. Become a patient person

This blog has moved

This blog is now located at You will be automatically redirected in 30 seconds, or you may click here . For feed subscribers, please update your feed subscriptions to

RESTful service with JAX-RS is so easy, a caveman could do it

A recent project requires me to build a RESTful service that supports supports stream input, output and JAXB binding. After a quick research, I was amazed when I found how easy it is to build RESTful service using JAX-WS(JSR-311) and Apache CXF . Cut the chase, let the code talk. import*; @Path( "/hello" ) public interface Greeter { @GET @Path( "/{user}") @Produces( "text/plain" ) public String sayHelloTo( @PathParam( "user" )String userName ); } It seems the annotations in the interface above provides everything client needs to know, and that's exactly right. Following CXF class returns an implementation of Greeter that knows to send HTTP request to and return the HTML response as a String. There's zero coding work involved to create fully functional client. import org.apache.cxf.jaxrs.client.JAXRSClientFactory; ... Greeter greeter = JAXRSClientFactory.create( "http://hel