Mine Blogging
I say what I mean, and I mean what I say

Fun with digital photography

December 5th, 2009 by admin
Posted in Uncategorized | No Comments »

Recently I've been diving into High Dynamic Range (HDR) photography. Initially I used Bracketeer to combine three photos that had been taken with different exposure (-2, 0, +2 stops). But very quickly I became unsatisfied with the output from Bracketeer. After a little research, it turns out Bracketeer only fuse photos with different exposures. Whereas other HDR software also perform tone mapping. After listening to a TWiP podcast about HDR and read through the HDR tutorial by Trey Ratcliff, I decided to try Photomatix Pro last week to see what different result I would get.

To demostrate the difference between Bracketeer and Photomatix, here are two identical photos processed by each software (Bracketeer on the left, Photomatix Pro on the right):
Lower East Side Synagogue - BracketeerLower East Side Synagogue - Photomatix

As you can see, the result from Photomatix is so much more natural looking (though it can also produce extremely psychadelic version) than Bracketeer. And more importantly, I get to this very good photo very easily, whereas the options in Bracketeer are extremely technical and confusing.

For comparison, here is the raw photo from the 0 stop exposure of the same scene:
class="enclosure enclosure-center enclosure-medium photo-enclosure"
style="text-align: center;">

style="padding: 9px; border: 1px solid; width: px; margin: 10px auto;"
>

Lower East Side Synagogue

Lower East Side Synagogue

Both are commercial software with Bracketeer a little bit less expensive than Photomatix. But judging from the output quality, I would thoroughly recommend going straight to Photomatix if you want to experiment with HDR.

Read and post comments |
Send to a friend

Extending iPhone battery life

November 27th, 2009 by admin
Posted in Uncategorized | No Comments »

Since my first iPhone, I've never had any issue with its battery life. As long as I get access to the charger by the end of the work day the battery life on the iPhone 2G or 3G have been perfectly adequate. That is until I started working on a project down in Atlanta and my weekly commute now extends to around 6-8 hours, depending on flight delays.

I began looking for battery extender for my iPhone. Initially I wanted a battery extender that can charge the iPhone 3G and 3GS, as well as possibly the Kindle. This means the ability to attach different cables to the battery. Also the 'green' side of me wanted a solar charging battery so that it'd be possible to charge the battery up using solar energy alone. Unfortunately after perusing iLounge's extensive list of battery extender reviews, it was pretty obvious that there weren't any battery out there that would satisfy my initial list of requirements. The closest one is the IceTECH Solar i9005. With its large solar panel, large battery capacity (2500 mAh), and large collection of connector tips, it would be ideal. The only issue is it doesn't currently support the iPhone 3GS, as Apple in its infinite wisdom has changed something with regard to charging on the 3GS.
So the search was back to regular battery extender. There are plenty of options out there but none of them really excite me. At least not at the price they are charging for. That is until I came across MonoPrice's iPhone backup battery. With a rather large capacity (2200 mAh *) and very affordable price (~$15, depending on quantity purchased), it is perfect.
It arrived two weeks ago and I have so far used it twice. From about 10-15% charge in the iPhone, it would take about two hours to fully charge the phone from the backup battery. During that time, I was able to continue to use the iPhone with podcast playing in the background while online twittering and browsing. The only thing that is annoying is the 'cyclon'-like blue LEDs in the front which move from left to right during the charging process (both from main to battery, and battery to phone). They are very bright and very distracting while using the phone with the battery attached, especially in a dark backseat of a taxi! To charge the backup battery, simply plug the iPhone cable to the bottom of the battery and charge it just like the phone. Unfortunately the battery does not pass the data through to the phone so you can't sync with iTunes while charging both the phone and the battery.
But overall, the MonoPrice iPhone backup battery is priced just right and perform as advertised. High recommended if you are looking for a simple backup battery for your iPhone.
* For comparison, iPhone 3G battery capacity is 1150 mAh which means the MonoPrice battery can potentially charge the iPhone from 10-15% charge to full twice!

Read and post comments |
Send to a friend

UITableView scrolling performance gotcha

September 30th, 2009 by admin
Posted in Uncategorized | No Comments »

After a few months of .NET reporting/SSIS development work, I'm back to an iPhone project this week. One enhancement I added yesterday was a better formatted table section title in a UITableView. Before, the section title is either a bunch of unformatted (also incorrectly by locale) dates (e.g. 2009-09-30), or times (e.g. 14:58) straight from the data source. The enhancement/bug fix is to format the date or time to be locale aware so the title would either be "Wed Sep, 30 2009" or "2:58 PM" if you are in the US.

Pretty straightforward I thought, and after a couple of trips to NSDateFormatter and use the output in UITableView's titleForHeaderInSection:section method, it was all working very well in the simulator. That was until I put the app onto my iPhone for some real in-device testing.
The scrolling performance in the table was horrible! My first thought was that it had to do with the background view I added to the custom table cell view for colouring the table cell background. But after nearly an hour of debugging through the code I still couldn't find anything wrong.
Turns out that the titleForHeaderInSection:section method is not just called once per controller instantiation. It is called once per table cell display!
Once I moved the code to format the section title into viewDidLoad and cached a copy of the nicely formatted titles in an array, the scrolling is back to normal speed.

Read and post comments |
Send to a friend

QotD: The One Historical Event I'd Like to Witness

September 12th, 2009 by admin
Posted in Uncategorized | No Comments »

If you could have personally witnessed one event in history, which one would you want to have seen?

July 16, 1969 Landing of Apollo 11 on the Moon.

Read and post comments |
Send to a friend

Portland photos

September 11th, 2009 by admin
Posted in Uncategorized | No Comments »

class="enclosure enclosure-center enclosure-auto embed-enclosure"
style="text-align: center;">

style="width: 400px;"
>

Read and post comments |
Send to a friend

How safe do you feel?

August 16th, 2009 by admin
Posted in Uncategorized | No Comments »

Most people I know do not have any plan to backup their data. Somehow they put their trust to a piece of 3.5" glass disc, spinning at 5400 times a second or more with a sharp metal spike fraction of a hair above it. Me? I like to spread my risk and backup my data, especially after suffering a total data lost about 12 years ago. As Alex Lindsay from the PixelCorps often says on podcasts, "Unless the data is stored in 3 different places, it doesn't exist". This may sound over the top but with all the online file sharing or storage services available it is actually pretty easy to have decent backup strategy with minimum cost. To achieve comprehensive backup coverage, it would definitely cost a few dollars.

Like computer security, any backup strategy should be constructed in layers. This applies to both time, location, and accessibility. Let me use my backup strategy as an example.
The least time consuming (in terms of setup and maintenance) backup component in my setup is Time Machine that comes with OS X. I setup Time Machine to backup to an external drive (more on that later) that is the same size as my main bootup drive and that's it. Time Machine will then backup everything on the drive and updates the backup copy with any changes every hour. This provides the first layer in my backup strategy; files that are used most will always be backed up and available to restore quickly.
In the event of my bootup hard disk fails, I can restore from the Time Machine backup. But that can take a while given most hard disk is rather large nowadays. So to keep down time to the minimum, every week I also clone the entire hard disk to an external disk (separated from the one Time Machine uses). I use Carbon Copy Cloner for this and while it is not a 'set and forget' setup like Time Machine, it only requires 5-10 minutes of actual effort every week on my part to clone the hard disk. This copy will allow me to boot my Mac up from the external drive within minutes of any internal hard disk failure. At the most, I'll have 6 days of data to catch up using Time Machine and that would not take long at all.
So I have two copies of my internal hard disk on two different external drives, e.g. data in two places. Pretty safe, right? Yes, pretty safe but not very safe. What if any of these two external drives fails? Then I can easily back to having no backup at all.
class="enclosure enclosure-left enclosure-small photo-enclosure"
style="text-align: center; float: left;">

style="padding: 9px; border: 1px solid; width: px; margin: 0 20px 20px 0;"
>

Drobe on Mac Pro - 3

Drobe on Mac Pro – 3

To mitigate that, the external drive that Time Machine uses is actually a Drobo. Drobo is a fully redundant disk array so data will be stored in a way that only all the drives fail at the same time in order to loss the data. This means my Time Machine copy is actually safer than just being stored on a regular external drive. The problem is that the Drobo drive is still sitting right where my machine is. What if someone break into my apartment and steals my computer, the clone external drive, and the Drobo? What if there is a fire in the building and all my computer equipment are lost?
For that eventuality, only an offsite backup will save my data. Again, time, location, and accessibility guide which services I choose to use. For files that I access and save often, I store them on Dropbox. It is ultra fast (way faster to sync to the cloud than MobileMe, for example) which makes it a pleasure to use. The free option let you store up to 2GB of data and it is more than adequate for my day-to-day data. This also have the added advantage of allow me to access files on different computers, e.g. my work laptop. For files that I need less often and larger (for example, video files that I want to share online), I store them on MobileMe's iDisk. Data syncing is nowhere as fast as Dropbox but it provides more data storage.
I also use a separate online service to store my code. cvsdude provides online storage of code using CVS or Subversion. I also use GitHub for my latest code project. Eventually all of my code will be stored on GitHub once my subscription with cvsdude expires.
But what about all the music, photos, and videos files that I own? Their large size make it difficult to backup to the cloud. Right now I store all of them on the Drobo so they are protected against disk failure but that means they exist only in one place (strictly speaking more than one copy is stored by Drobo). To guard against total loss, I am currently in the process of using Mozy to backup all of the media files which come to about 600+GB. The MozyHome Unlimited plan is not free but it will be tough to ask someone to provide that amount of backup storage at no cost! The issue with Mozy is the time requires to upload that much data to their data centre. Even with a decent upload connection of ~2Mbps I am expecting the upload to take at least 3-4 months to complete.
To recap, here is where my data exists:
1) Files (e.g. documents, emails, applications, etc.) – Internal hard disk, Time Machine on Drobo, clone on USB external drive = 3 places
2) Important/Frequent use documents (subset of #1) – Internal hard disk, Time Machine, clone drive, Dropbox, MobileMe's iDisk = 4 places
3) Code files – Internal hard disk, Time Machine, clone drive, MobileMe's iDisk, cvsdude/GitHub = 5 places
3) Media files (iTunes library, iPhoto library, iMovie Events & Projects) – Drobo, Mozy = 2 places
Am I crazy? Ask me again when you have a hard disk failure and want some advice on how to recover your precious data.

Read and post comments |
Send to a friend

My first published iPhone app

August 6th, 2009 by admin
Posted in Uncategorized | No Comments »

One of the two iPhone app that I worked on during earlier part of this year has landed on iTunes AppStore! As part of the sponsor for Agile 2009 conference, a small team of ThoughtWorkers developed a conference app to help the attendees. I left my fingerprints on the Twitter, Maps, and Schedule screens. The other interesting parts include the cloud computing (on Google App Engine) that provides up-to-date sync of conference schedules, ability to mark sessions that you plan to attend, and provide feedback to the presenters. The app also includes the Agile Manifesto, the 12 principles, allows you to sign the manifesto, or even send email to your friends to sign up.

Splash ScreenConference Schedule ScreenTwitter feed ScreenAgile Manifesto Screen

Read and post comments |
Send to a friend

The High Line

August 1st, 2009 by admin
Posted in Uncategorized | No Comments »

Having a brand new camera body encourages me to take more photos during the weekend (funny that always works). Today, Leah and I went to the High Line after having brunch with some friends. From the Wikipedia, the High Line is

The High Line is a 1.45-mile (2.33 km) section of the former elevated freight railroad of the West Side Line, along the lower west side of Manhattan, which has been redesigned and planted as a greenway. The High Line runs from the former 34th Street freightyard, near the Javits Convention Center, through the neighborhood of Chelsea to Gansevoort Street in the Meat Packing District of the West Village.

class="enclosure enclosure-center enclosure-auto embed-enclosure"
style="text-align: center;">

style="width: 400px;"
>

Read and post comments |
Send to a friend

Naples photos

July 25th, 2009 by admin
Posted in Uncategorized | No Comments »

class="enclosure enclosure-center enclosure-auto embed-enclosure"
style="text-align: center;">

style="width: 400px;"
>

Read and post comments |
Send to a friend

Objective-C discourages good OO design/code?

June 28th, 2009 by admin
Posted in Uncategorized | No Comments »

I started learning Objective-C when Apple released the iPhone SDK over a year ago, and started programming in it seriously at the beginning of this year. While there are many things I like about Objective-C as a OO language, there is one thing that continuously bother me.

One of the four main tenant of object-oriented design is Encapsulation. Meaning, the inner working of an object is hidden from public view.
In Objective-C, an instance method can be declared in the implementation file (.m file) in the following ways:
  • Implement the method without declaring it in the header file. This is (almost) equivalent to private method in C#/Java.
  • Declare the method signature in the header file, and implement the method in the .m file. This is like declaring a method public in C#/Java.
So how does this discourages me from writing good OO code with respect to encapsulation?
If I choose the first option, I have two choices. Either I implement the method before its first usage which does no good with readability re Uncle Bob's Clean Code's newspaper metaphor, OR implement it after and put up with the compiler warning about the method call may not exist.
To get the freedom of placing the method anywhere in the .m file, I have to choose the second option and declare the method signature in the header file. The downside of this is that now the method is exposed as part of the class public interface and break encapsulation. (Yes, I know that the method can still be called without the header file declaration. Again, a compiler warning greets you.)
All three options are undesirable to me. It is really a case of pick my poison! Right now, I choose option one and put the method before first usage. Readability suffers because I like reading methods after the usage but at least the header file is clean and represents the intended public interface.
Update: Martin Pilkington makes a suggestion to me via Twitter. I'll have to try it out and see.
Update #2: Someone else on Twitter also suggests using Extension to solve this issue. The Apple's documentation here (at the end of the page) shows how an extension of a class can be used to define private method, separated from the main class interface definition.
My initial feel? Pretty inelegant workaround to an inherited problem of Objective-C legacy linkage to C. No thanks, I'll stick with declaring private methods before usage.

Read and post comments |
Send to a friend

« Previous Entries
  • Last 5 Posts

    • Fun with digital photography
    • Extending iPhone battery life
    • UITableView scrolling performance gotcha
    • QotD: The One Historical Event I'd Like to Witness
    • Portland photos
  • Pages

    • About
  • Archives

    • December 2009
    • November 2009
    • September 2009
    • August 2009
    • July 2009
    • June 2009
    • March 2008
    • August 2006
    • July 2006
    • June 2006
    • May 2006
    • April 2006
    • March 2006
    • February 2006
    • January 2006
    • December 2005
    • November 2005
    • October 2005
    • September 2005
    • August 2005
    • July 2005
    • June 2005
    • May 2005
    • April 2005
    • March 2005
    • February 2005
    • January 2005
    • December 2004
    • November 2004
    • October 2004
    • September 2004
    • August 2004
    • July 2004
    • June 2004
    • May 2004
    • April 2004
    • March 2004
    • February 2004
    • January 2004
    • December 2003
    • November 2003
    • October 2003
    • September 2003
    • August 2003
    • July 2003
    • June 2003
    • May 2003
    • April 2003
  • Categories

    • Apple (45)
    • Books (8)
    • Current Affairs (28)
    • ecto (21)
    • Entertainment (55)
    • Film (2)
    • Food and Drink (16)
    • Gadgets (69)
    • Games (7)
    • Humor (26)
    • MoBlog (9)
    • Music (12)
    • My Life (104)
    • Photos (63)
    • Rants (45)
    • Science (27)
    • Sports (21)
    • Television (2)
    • Travel (29)
    • Uncategorized (11)
    • Web/Tech (63)
    • Weblogs (29)
  • Blogroll

    • bra.in.f.art
    • Lost in Colonisation
    • Twitter
    • Virb
  • Twitter


      follow AlexHung at http://twitter.com
  • Meta

    • Log in
    • Valid XHTML
    • XFN
    • WordPress

Mine Blogging is proudly powered by WordPress
Entries (RSS) and Comments (RSS).