16 Nov 2010

Hokkaido, Japan : Dining in the Future

I finally posted some long overdue photos I took during my trip to Japan back in Feb.

They're not so great, but I just thought I'd share them with every body because I've been dying to blog about some interesting things I did and saw there but couldn't because there were no pictures.

In Otaru (小樽) up in Hokkaido, we had kaiten sushi (aka, conveyer belt sushi, sushi train, sushi go round). It was pretty amazing, not really the food, but the technology on display.

QR Code Waiting List

Right from the start, the table booking system was fully automated. So instead of having to talk to the waitress, you put in your details on this machine with your name, number of people and you're given an estimated time of seating. Then if you have a Japanese cell phone, you can scan the QRcode and bring up the live view of the waiting list page. So you can wonder out for a walk or get notified as soon as your number is up.

Once you're seated, you're confronted with this double decker conveyer belt. Talk about space optimization. The sushi goes on top and miscellanous bits like mugs go in the bottom.

Todays Special

Although, at this stage, turns out the manual interaction with the sushi chef is required as there aren't any fancy screens to order custom bits and pieces. In fact, the specials are written in Japanese on these pieces of paper. Once something is sold out, they get removed.

When we asked for the bill, instead of counting the plates by hand, the waitress comes over with this RFID scanner and just sweeps it across the plates we've accumulated. We were so fascinated with it we asked her to do it again. In fact, she does it twice anyway as to make sure there's some error checking (?). Turns out underneath each plate is an RFID that identifies the plate and the type of plate it is.


After the bill is totaled, we're given this blank plastic card which is our token for the bill. We take the bill to the payment counter and the amount we owed is stored inside. The bill is scanned by the checkout lady and we're told the amount we have to pay.

All in all, it was a fascinating experience. We never stumbled across other hi-tech sushi establishments in Tokyo - but maybe we were just going to the wrong places.

... Read More

13 Nov 2010

WebViewScreenSaver for Mac

I just released a small project called WebViewScreenSaver for Mac. It is available on github and is open-sourced. You can download the binary for 10.6.

The idea is very simple: Make any page on the web a screensaver.

The screensaver takes care (the relatively simple task) of ensuring no keyboard or mouse events leak into the web view and so you can display a website and not worry that someone could subvert it and access your account, or maliciously rickroll you.


You can use it in a variety of ways. Currently, I use it at work as an ambient display to display tweets about our product (via sites like visibletweets.com) or to display an internal feeds driven through a web server. I also use it to display a flickr slideshow. More and more dashboards and visualization are running on the web, either with maps, javascript or flash and many of them look great as a screensaver.

The screensaver's options will allow you to set a list of URLs to cycle through with a custom time interval.


I don't think this is a new idea, but I couldn't find anyone who had done it for the Mac. We often build dashboards that are hosted on a website, they're very easy to build and there are now even more sophisticated ones like geckoboard that look super-sexy.

However, running a web browser in a logged in account is dangerous. I've seen people build proper full blown apps and do many secret keystrokes or password protects in order to make sure someone can't quit the app and access the console or desktop.

I noticed there was already a perfectly well tested mechanism for this, which is the screen saver framework. It can take care of password protection, screen locking, screen blanking etc. All I had to do was create a webview that would embed into the screensaver view and some rudimentary preferences.


  1. Download and install the screensaver from the github download page.

  2. See the project description for how to activate it and some sample URLs you can use that make great screensavers.


... Read More

08 Jul 2010

Mobile Data SIM in Greece

Part of my travel rituals these days is to try and get mobile data on a prepaid SIM card.

This time I travelled to Greece and managed to get a data-only SIM with Vodafone. I went into a Vodafone shop in Athens and asked for a prepay SIM card with data on it. They asked me whether I wanted to make voice calls on it, and I said no.

They gave me a Vodafone Mobile Broadband on Demand SIM with a 10GB for 10 days voucher. This cost me €19. All the instructions were in Greek and all the literature that came with the card assumed you have a Vodafone branded USB modem. In fact, you don't need one. You just need to make sure the device settings on your handset (in my case an iPhone and a Nexus One) is set to:

APN: web.session

User: <blank>

Password: <blank>

Online you can find a few references to different APN settings like internet, vmckarta and such. Those do not work on this SIM, you need to use web.session. I only found out after calling the support line.

Once you get the SIM working, you need to fire up a web browser and browse any page, you'll be redirected to the vodafone voucher entry page. From here, you can just enter your voucher number and accept the terms.

From then on, you'll get 10GB of data for 10 days. €19 for 10 days is pretty cheap considering how much hotel wifi goes for, and the convenience of having Google Maps or Google Translate where ever you go.

I only had one hitch with Vodafone where they expired my credit for a day after 5 days. I don't know whether I did something or if their systems were down, but the next day I could use it normally again.

... Read More

13 Mar 2010

Back in London

Arrived back to London last Thursday morning. Had a great flight back, and got home in good time. And as usual, I got asked at customs about whether I had food in my luggage. Every. Single. Time. At. Heathrow. My arms were so sore from snowboarding and lugging my luggage from one side of Tokyo to another that I could barely make it down the stairs with my luggage (yes, welcome to London) when changing at Bank/Monument. I avoided taking the taxi since I wasn't really in a rush.

On Friday, I rocked into work that seemed to have surprised some people who thought I wouldn't be in till Monday. Mainly spent the day catching up on 2 weeks of email and updating everyone with a different anecdote from my awesome trip to Japan. Caught up with Jess in the evening who lives in Amsterdam but was passing by London. Hadn't seen each other for over a year. We didn't really have any plans (yes, I'm like that), so we ended up trekking from Covent Garden to Chinatown and had dinner a Leongs Legend, followed up by drinks at the Bedford and Strand. It was a lot more packed than the last time I was there. So time to find a new place.

On Saturday, I lazed around home till the afternoon, and caught a quick double caffeine shot at the Flat White in Soho. I hung out there for around an hour, saw the pulse of the cafe heave and sink as people came in tides rather than a constant stream. Trekked over to Notting Hill-ish area for some delicious modern Spanish Tapas and birthday dinner with friends.

On Sunday, I cleaned the kitchen a bit, and practised making 雞蛋仔 in the morning. I'm getting better and better at this, but still much room for improvement. Not sure what I did for the rest of the day, but I think it just involved doing laundry and probably writing some code for some personal projects.

Getting back to work after a vacation is always tough. This week was more tough than usual, lots of crazy deadlines to chase, lots of meetings to be had and things to do. It really felt like I had done two weeks of work in one. I cringed when I saw people using my app - so much more to improve on but so much more new stuff to add. One shining light at the end of the week was proof that my code was awesome when things worked in a totally different context than what we wrote it for. Good times.

I got excited about Street View launch in Hong Kong, provided me with hours of fun. Then the iPad pre-orders started in the US, but I couldn't manage to get an order in because (a) the launch is on a Saturday, so sending it to the US Office might not of been the best idea and (b) I didn't have enough money in my US accounts to get one and they wouldn't accept my UK credit card.

I finally got around to updating the address on my driver's license which I was supposed to do a year ago. I finally submitted the application online through their website (which was an ordeal because they closed the website at night!) and sent my cut up license on Monday. Managed to receive my new license on Friday which I thought was a quick turnaround.

Sent off some US checks for depositing so that I could try and shore up my US account for the iPad purchase. I should of done this months ago, but then today I just received another US check I could of deposited. I'm lazy like that, some day I need to figure out how to change the address of that account so that I can receive my new card!

Wrapped up the week with a TGIF drinks, been a while since I hadn't had to rush off to somewhere on a Friday night. Ended the night with a really late drinks and dinner in Canary Wharf at Wahaca. It's actually quite interesting Mexican food, a far cry from the huge portions and dense burritos I've had in SF. To be honest, I kinda enjoyed Wahaca a lot more than I expected.

Trying out a new way to force myself to blog more by trying to summarize the week. Let's see if this sticks. See you next week, maybe.

... Read More

08 Feb 2010

in the future, everyone will have an appstore.

this is getting more and more real, but not quite how you expect.

a lot of innovation in terms of aggregating and selling not just apps, but services. see these two beautifully designed "appstores" for talent. you can now choose your design studio or app developer based on an image, description and price.

is a "store" for advertising iphone developers.


sortfolio is a store for finding a web designer.


... Read More

24 Nov 2009

MacBook Pro on 802.11n 5GHz with Time Capsule

If you have a mixture of US, Hong Kong and European Apple 802.11n (5GHz) equipment in your home, then it is likely you'll not be able to use 5GHz because the overlap in channels is small between the 3 regions. To make matters worse, Apple's Airport Extreme or Time Capsule doesn't allow you to manually select the channels when in 5GHz mode.

More over, UK computers are not workable with the "Use wide channel" option on Airport Extremes.

See http://support.apple.com/kb/SP20:

  • Channels 1-11, 36-48, and 149-165 approved for use in the United States and Canada.

  • Channels 1-14, 36-64 approved for use in Japan

  • Channels 1-13, 36-140 approved for use in Europe

  • Channels 1-13, 36-64 approved for use in Australia, Hong Kong and New Zealand

So that means the overlap for US and Europe for 5GHz is only 36-48. That is barely 12 channels out of 100+ channels. Because you cannot set the channels manually on the Time Capsule, 5 times out of 6 your Time Capsule will not work with any 5GHz devices bought in Europe.


... Read More

30 Sep 2009

iphone safari font size changes on rotation

i've been doing some web development targetting iphone, and one of the things you have to learn to support is rotation.

one thing that has annoyed me recently is that when you rotate, the font size changes. google didn't reveal anything, so i thought i'd blog here about it.

if you set:

html {
-webkit-text-size-adjust: none;

then it will not automatically adjust the fonts of the page when it rotates. the downside of this is that the font size also does not adjust in a regular webkit browser. but if you're targetting iphone specifically, then it is not such a big deal.

... Read More

07 Jul 2009

Calculating Height of Multi-Line Text on the iPhone SDK

If you've done some text layout on iPhone, you'll know that the documentation isn't really the greatest and clearest. The most frequently annoying thing about text layout is that there are these NSString UIStringDrawing additions that you would think can help you determine the size required to render a piece of text with a given font.


- (CGSize)sizeWithFont:(UIFont *)font
- (CGSize)sizeWithFont:(UIFont *)font constrainedToSize:(CGSize)size
- (CGSize)sizeWithFont:(UIFont *)font constrainedToSize:(CGSize)size lineBreakMode:(UILineBreakMode)lineBreakMode
- (CGSize)sizeWithFont:(UIFont *)font forWidth:(CGFloat)width lineBreakMode:(UILineBreakMode)lineBreakMode

Only one of the four above gives you sizes with multi-line text. Worse still, even if you choose the right one, you probably will end up passing the wrong thing into the size parameter.

In order to get the height of a piece of multi line text constrained by a given width, you must do this:

CGSize boundingSize = CGSizeMake(desiredWidth, CGFLOAT_MAX);
CGSize requiredSize = [someText sizeWithFont:someFont
CGFloat requiredHeight = requiredSize.height;

Things to note:

  1. You must pass in CGFLOAT_MAX (or a big number) for the height, otherwise your text will never flow outside of the boundingSize. This is the bit I always get wrong.

  2. All the other sizeWithFont methods do not work with multi-line text. It says so in the documentation, even though it is not easy to spot.

  3. You must use UILineBreakModeWordWrap for the lineBreakMode

... Read More

28 Jun 2009

HP Mini 1000 (1030NR) with Mac OS X 10.5.7

After WWDC 2009, I was torn. I wanted to buy a MacBook Air with SSD as my travel laptop since every time I go on a trip, there's always a struggle to bring along my 5 lbs laptop. The price drop announced was very attractive, US$700 less for the MacBook Air, but still it would cost $1700.

HP Mini 1000 (1030NR)

While I was in the US, I came across the HP Mini 1000. It cost only US$329 (a quarter of the MacBook Air) and reportedly would be able to run Mac OS X. So on impulse (well, after a fair amount of research), I ran into Best Buy to pick up one.

Various Models of HP Mini 1000.

HP Mini 1000 is a series designation for a wide range of differently configured netbooks. Mine was a 1030NR which sported a 1.6 GHz Atom processor, 1GB RAM and most importantly a 16GB solid state hard drive. The chassis also has a built in SDHC card slot so I could technically expand my storage to a second volume if necessary.

There are other models of the 1000, such as one called the HP Mini with Mi which comes with Linux instead of Windows XP. I couldn't find those for sale in a regular brick and mortar store. One odd note, the XP version which I got says it is only expandable to 1GB of RAM, however the Linux version says 2GB. They are technically the same, so I was puzzled why the spec sheet said that. Turns out that the reason HP reports the XP one can only have 1GB of RAM is because of licensing agreements when it comes to getting XP on a netbook. I can reportedly upgrade to 2GB without any problems. I have yet to try this.

In the UK, they do not sell the HP Mini 1000. Instead, they sell it as the Compaq Mini 700, which is the same as the HP Mini 1000 except it has a 60GB hard disk rather than a 16GB solid state drive. I would definitely prefer the solid state drive over the hard disk as it clearly is much faster and the lack of RAM doesn't hurt the performance as much.

Mac OS X Installation

The installation was not easy, but there are some very good instructions on the net. I won't go into the detailed instructions but will cover some interesting things you should note.

First up, all instructions say you need a 8GB SD Card or USB drive, or an external DVD drive. I had neither of those. I only had a 4GB USB drive. The reason why it specifies a 8GB requirement is because the installation DVD image is 4.7GB, so you cannot fit it on to a 4GB USB drive.

Since I was using the USB drive installation method, you can get around this restriction by mounting the DVD install image and deleting files and packages that you don't need. For instance, I deleted all the third party programs that were included in the hacked install image and also removed a large portion of the language packs that come with OSX.

Once you do that, you can restore the image on to your partitioned USB drive, and then run the UInstaller program (from the "Essential Tools" archive on the instuctions) to patch your USB partition with the PC EFI boot sequence. Once you do that, your USB drive will be bootable and not have the same size restrictions of a DVD.

Secondly, because the screen on the HP Mini 1000 is only 1024x576, most of the installation screens are too tall. Most of the time, the buttons are placed off the bottom of the screen, so there was a lot of guessing which buttons were where. Most often I would have to tab two times and then press space bar to select the "Continue" option.

Thirdly, once you've installed Mac OS X on to the HP Mini, the resolution would revert to 640x480 (even worse than 1024x576). One of the final steps in the installation is to do a System Update to 10.5.7. However, in order to accept the EULA, you must manually press the Accept button with a mouse, and that doesn't work! One solution I found was to turn on "VoiceOver" in the "Universal Access" of the "System Preferences". Once you have that turned on, you can actually use your arrow keys to focus on controls that you would otherwise have to focus on with your mouse.

Finally, if you update to 10.5.7, you must use the newer AppleIntelGMA950 drivers to get back the native resolution (1024x576). To do that, there's a separate bundle of Kernel Extensions you need to install attached to this forum post.

After all is said and done, the installation for me took around 3 hours, 2 of which was downloading the 10.5.7 update off the net, and 30 minutes of which was copying the installation image to a USB drive.

The installation itself will take around 8GB on the hard disk, which left me with around 7.5GB storage on the main partition. Which is actually fine as I don't intend to store much on this machine. But if you're planning to store more, you'd probably want to get a large SD card as a second "hard disk".

Compatibility-wise, I am shocked that the Hackintosh version of OS X manages to get the sound, graphics, wifi, sleep/suspend, screen brightness buttons, volume buttons and the camera are all working. The only odd issue is the power management. When using the default Apple battery monitor, it would randomly warn about low battery even though the battery is fully charged. The solution is to not use the Apple battery monitor on the menu bar and use a third party called "Slim Battery" which gives a more accurate charge indicator.


The biggest reservation I had when I bought this was "how well will it run Mac OS X?" The answer was that it runs very well. The graphics with the patched drivers were seemingly accelerated with Quartz Extreme.

One surprising thing is that this machine works pretty well with only 1GB RAM. Maybe it is because when when it goes to swap it is still fairly fast because of the SSD. I'll try to upgrade to 2GB RAM to see if it is any better.

I did a side by side with my MacBook Pro comparing how fast it would boot up and how fast it launches Safari from a cold boot. Boot up time is around 10-20 seconds slower on the HP Mini.

Safari shockingly launches a couple seconds faster on the HP Mini compared to the MacBook Pro. I'm guessing the reason is that it is way faster loading Safari from flash compared to loading it from a regular HDD.

Flash videos (like YouTube) do not play at full frame rate, but are otherwise viewable. Oddly enough, when you use Vimeo, it stutters even more than YouTube. I think maybe the Vimeo player is doing more compared to the YouTube player. I managed to watch an hour of Wimbledon tennis on this using the BBC Flash player and it worked well full screen.

The battery reportedly lasts for two hours, but I've not stressed it enough to know. The battery meter right now says it has 2:30hrs remaining fully charged, but its probably not accurate.


This is my first weekend of using this machine, and already I've not bothered to turn on my MacBook Pro unless I'm doing some Xcode work. For web browsing and tweeting, this has been a fine machine. I'm even drafting this post using it through Google Docs and I barely notice the difference. I guess the only thing that is problematic is the lack of vertical screen real estate. That means I'm particularly sensitive to how much chrome there is at the top of websites and applications.

The keyboard is a 92% full size keyboard, so the keys are slightly squished. Once you get a hang of it, it isn't too bad. My hands are pretty small so it's fairly comfortable.

I can't say the same about the trackpad though. Although the trackpad supports two finger drag, because it is so short, it isn't very effective. There is an area on the right hand side where you can drag to scroll like regular Windows machines and it actually works on OS X. I tend to use that more than two finger scroll. The tap-to-click mechanism also works, but has a noticable lag compared to the MacBook Pro. I'm not sure whether that is because of the different drivers or the hardware. Note that the trackpad and keyboard uses an alternative Voodoo driver.

At night, the extra light between the keyboard and the trackpad is very distracting. So distracting that I am considering sticking a piece of electrical tape over it. One interesting touch is that there the breathing light when a Mac is suspended. The same thing happens with the power light on the HP Mini, but it only blinks on and off because it is a binary light.

The SD card slot is a little hard to get access to. It is receded with the curve of the device, and that is difficult to feel without looking. Finally, the fan is sometimes a little noisy, but it is no where near as noisy as my MacBook Pro's fan.


I'm really happy with the HP Mini 1000. It is very light and fast. I love having a solid state drive because I don't have to worry about bumping this thing and the hard drive failing. The installation was a little tedious, but once I've done it I know how to do it in the future. Compared to the MacBook Air, it doesn't have such good build quality, the keyboard flexes a little and the touchpad is too small with the odd button placement. However, at a quarter of the price, I'm willing to give up those luxuries.


I own a licensed copy of Leopard which I bought the day it came out. So I'm not feeling particularly bad about installing it on this non-Apple hardware.

... Read More

04 Jan 2009

happy new year

just thought i'd say this to everyone.

... Read More