Saturday, 18 July 2009

TamSung

http://www.tamsung.com

I got bored of the IT contracting life and have been thinking about doing something different for a while. With the current market down turn and the economic situation around the world, it seems like a good time to carry out the plan.

Priya mentioned that it would be interesting to build site where people can share cooking recipes with others. Having checked out the existing offerings on the web, I found most of them either too complicated, try to do too much, or don't have working/sensible searches. So I decided to build my own.

I set myself a few aims.

1. Creating a new recipe should be a painless process. I want the users to simply write the cooking instructions and not having to worry about specifying the ingredients or cooking methods separately. The site should be able to intelligently recognise the important terms from the instructions automatically.

2. The search has to work. The site not only needs to be able to search based on the important terms that it recongised. It also needs to understand that different combination of words means different ingredients. For example, when I search for "spring onion", I want to see recipes that use "spring onion", not "onion" with the term "spring" appearing somewhere in the recipe. When searching for "egg rice", it needs to understand that I am looking for recipes that use "egg" and "rice", not strictly having "egg rice" as a string appearing together somewhere in the recipe.

3. The site needs to allow users to attach multiple pictures to illustrate the cooking process, not just a single cover image. Most of the recipe site out there only allow attaching one image per recipe. I thought this was a bit odd, having a series of pictures would/should help clarify the cooking process.

For this site, I forgo my beloved GWT (good for building sites with complicated front-end) and decided on Grails due to the data centric nature of the requirements.

Anyway, I named the site TamSung. In Thailand, it's a type of eatery where customers can order dishes to be cooked up given the availability of ingredients. I thought it's quite fitting with the theme where the site produces recipes based on given ingredients.

Monday, 6 October 2008

Knowledge I learnt recently

Went through a phone interview recently, got caught a little off guard by the interviewer's questions. He asked me a lot of questions about practices and areas of technologies that I normally avoid or simply not on my mind.

1. How do you make Singleton thread safe? By using a violate double checked locking, note that double checked locking doesn't work prior to JDK 1.5. See here. Singleton is bad, it's something I normally avoid and it's not the best thing to use in a multi-threaded environment. Why is it bad? A few good arguments here.

2. How do you serialise a Singleton class (Something smells foul, I wish I had asked him why do you serialise a Singleton class)? By implementing the Serializable interface and override the readResolve method so only one instance of the class is created. (Or you can use an Enum, but using an Enum for this purpose sounds a bit wrong)

3. How does garbage collection (GC) know what objects to free up? By using a reachability map. See here. Being a Java developer, GC is not something I think about constantly. As long as I set the references of the unused objects to null, JVM will come and free them up anyway.

4. What is weak reference? This I didn't know, and it's actually something worth learning. It's something that maintains references to objects without preventing garbage collection to free up these objects. It doesn't sound very useful, but it does have a few uses in certain situations. See this blog for a good explanation.

If I get asked these questions again, I am ready.

Saturday, 8 September 2007

Avatar: The Last Airbender

I have been watching the animation series (cartoons) from Nickelodeon called Avatar: The Last Airbender. I was not a big fan of Rugrats/Nickelodeon, so I started with some skepticism.

After I watched a few episodes, I realised it was actually very good. It's got interesting plots and colourful characters...etc, what caught my attention was the amount of subtle details that went into the series. All the fights were based on real Chinese/Asian martial art moves. The idea of Avatar reincarnation was from Tibetan Dalai Lama. All the writings, letters, street signs, posters...etc, were all written in Chinese (took me a while to get used to it since the dialogs were in English), not only they were written correctly, they were actually written in an old way that seemed suitable to the time line of the stories.

I thoroughly enjoyed the series. I especially appreciated the fact that once the production team decided to adopt the Chinese calligraphy, they did a proper job rather than put in gibberish and hoped no one would notice. I have just finished season 1 and 2. Can't wait for the next one. Highly recommended.

Sunday, 2 September 2007

London Inline Marathon

I used to be a keen skater when I was at university. After 12 years of inactivity, my physical shape has degraded somewhat. Anyway, I've decided to skate again, so I bought a pair of skates, found myself an instructor and have been practicing quite a bit.

Today is the London Inline Marathon, thought it's a good opportunity to see a bit of skate actions and utilise my Sigma 55-200 tele-lens which has been collecting dust since I bought it.

The photos can be found here.

Tuesday, 17 July 2007

Discovering facebook

I have been neglecting this blog a bit recently due to facebook taking us most of my free time nowadays. It was one of those personal profile sites that allows you to collect a list of your contacts. However, once I dig in deeper, I actually find it quite addictive and fun. You can share photos easily, review movies and create groups...etc. But most importantly, it is a very effective tools to keep in touch with "acquaintances" whom you may not necessarily explicitly contact often ;-).

Tuesday, 5 June 2007

Carrantuohill

Climbed the highest mountain in Ireland on the weekend, it was alright, certainly more exciting than my average gaming/TV/internet weekend. If I was to go through something like this again, I would have done a few things differently,

1. Travel insurance a must,
2. wear proper hiking boots,
3. leave unnecessary gears at home, such as cameras and lenses.

The things I remember the most about this trip, were the rocks. Hiking up the mountain wearing a pair of trainers was pretty stupid. I could feel every freaking rock cutting into my feet as I stepped on them. The trainers had little grip on the rocky surface, so I was too busy looking down (trying not to fall 1050 metres to my death than looking up) to enjoy the view.

Anyway, I managed to take some pictures before the pleasant day walk turned into fighting for survival. You can find the pictures here.

Tuesday, 15 May 2007

Tapestry

Tapestry is framework for building web applications. It differs from the MVC based framework like Struts and Spring MVC in terms of design approaches and configurations.

We use it for our web project at work, while I appreciate the convenience and the ease of programming it brings, a lot of other people don't agree. Most of people here compliant that it's too hard to alter its default behaviours and quite often makes easy tasks difficult, such as adding simple buttons or URL links.

I do wish Tapestry was simpler, however, I believe most of the complaints are due to the lack of knowledge rather than the fault of the framework itself. Tapestry is a component based framework, every part of a page is an intelligent self contained component and is responsible for rendering itself and controlling its own behaviours. Building a site using Tapestry is like putting together the Lego blocks, you just simply plug in the bit you need to suit the requirements. I find it simple to use and helps me to speed up the development (of course, after you understand how Tapestry works properly).

One compliant I do have, is that it's too easy to end up with spaghetti code using Tapestry if you don't plan properly. If you don't modularise and structure your pages carefully, quite often you end up with pages with lots of low level components stuck in them. We have gone through a related refactoring task at work recently. The original page was developed when we were still newbies. The data was displayed on the page using the Insert tag all over the place. That made the code confusing and hard to follow. To fix this, we broke up logical sections of page into several layers of self organised components and pass in the data objects required from the top layer for the lower layers to render themselves.

Code written in Tapestry can be made nice, as long as you plan your code carefully and follow the good design practice. I guess its draw back is that it lacks good documentation to explain what this good practice is (or I haven't looked hard enough) and it's too easy to write crap code. Eventhough we had to learn it the hard way, I still appreciate the convenience it brings me and am happy with the fact that I don't need to code all the low level operations (such as overriding form actions or query parameter parsing) myself from scratch.

Sunday, 29 April 2007

Hyde Park Corner

I was there to show support this afternoon. It was obvious that the event could do with a bit more organisation, the whole thing sort of ran out of steam not long after it started, it was a shame really, the intention was good. Nevertheless, it was good to see the Taiwanese communities in the UK trying to do something positive for the country.









Anyway, it was good day out. It would be good to see more and better attempts to raise the awareness of this serious issue.

Saturday, 28 April 2007

A short stroll in London

Had to go out to get a new camera bag, and I decided to take a short stroll along the Oxford street afterwards. Part of the Oxford street remained closed due to the fire on Thursday, so it became a pedestrians only area. The closed street attracted more people than usual, the whole street was packed (one word of advise for Ken, if you want to attract more tourists and boost local economics, close the streets).

Left, Porsche Boxster, the car I like.
Centre, Oxford Circus, where the rest of street was closed off.
Right, people enjoying the sunny afternoon.

The car I likeOxford Circus, closed offPeople enjoying the sunny afternoon






Left, crazy people singing and dancing on the street.
Centre, you could see the burnt building on the right.
Right, my most frequent store on the street.








TCR, my favorite road, I feel right at home here.
Ultimate buger was where we used to have lunch frequently prior to the office move.








Our old office, it was cool working in the West End, many happy memories, I had a good time.
I often walked pass the Warren Street station on my way home.








London can have its share of problems, but I find it a very charming place to live in. I was going to take more pictures on my way home, but a guy standing next to the Warren Street station selling "big issues" advised me, "You better watch out for that camera mate, they steal it from you around here.", so I put my camera away.

Monday, 23 April 2007

Chislehurst

I have upgraded my camera to a Canon 30D recently, it's essentially a 10D, with all the little nagging issues fixed or improved. The startup time is almost instant, sharper and richer pictures, faster read/write time, just generally feels more snappy. It handles and weights like a 10D, so I guess the familiarity has been maintained there.

Did a bit of trekking with Priya in Chislehurst on the weekend, it was the perfect opportunity to utilise my 30D again (I have got it already before Songkran ;-)), I am quite happy with the outputs, pictures below.