Back to blogging and a quick update

WordPress LogoIt’s been a while since I last blogged. Life has been so hectic that I hardly have the time to blog (not that I have been blogging regularly). I have been working on multiple projects since the beginning of the year. So I have been super busy with work.

In the beginning of the year, I have been toying with the idea of creating a new business in producing my own independent software products. But after careful consideration, I decided to focus on developing my consulting services in mobile and digital interaction development to establish a more steady stream of cash flow. I am still incubating these product ideas of mine on the side. Hopefully, I can start spending more time by Fall and turn one of these ideas into a viable business.

Materials for my iOS frameworks talk at MobileCamp Boston

Presentation Screen IconI will be speaking at MobileCamp Boston on Feb 19, 2011 (later today). I will be giving a presentation on building RESTful iOS apps using Three20 and RESTKit frameworks. I will write a blog entry with a more detailed coverage of my talk later. For now, here are the presentation slides and the TwitterReader Source Code I will use at the talk. Enjoy.

Icon credits: Jack Cai

TTTableViewController showMenu:forCell: example

iOS SDKA week ago, I was looking for ways in Three20 to create an animated row menu similar to the behavior in the Facebook app where a the table cell switches to a view with a “Like” and a “Comment” button. Upon more investigation, I discovered showMenu:forCell: in TTTableViewController that does exactly what I am looking for. Unfortunately Three20 documentation and samples shed little light on how showMenu:forCell: should be used. I also googled around and found a simple example and found this post on Three20 discussion thread on Google Groups, which was enough to get me started in right direction.

iPhone table view iPhone table view show menu

I messed around with the code further and came up with a more coherent technique in creating the animated show menu effect using showMenu:forCell: Here’s a snippet of the same code demonstrating how you can trigger the menu view by swipe gesture.

- (void) viewDidLoad {
  // Register the swipe gesture.
  UISwipeGestureRecognizer *recognizer = [[UISwipeGestureRecognizer alloc]
  [recognizer setDirection:(UISwipeGestureRecognizerDirectionRight |
  [self.view addGestureRecognizer:recognizer];
  [recognizer release];

  [super viewDidLoad];

- (void) swipeDidOccur:(UISwipeGestureRecognizer *)recognizer {
  // Get the start point so that we can do a hit test on the table view.
  CGPoint startPoint = [recognizer locationInView:self.tableView];
  NSIndexPath *path = [self.tableView indexPathForRowAtPoint:startPoint];
  TTTableViewCell* cell = (TTTableViewCell*) [self.tableView

  // Add menuView to the cell.
  UIView *menuView = [[UIView alloc] initWithFrame:cell.contentView];

  // Now call showMenu with the menu to display on the associated cell.
  [self showMenu:menuView forCell:cell animated:YES];
  [menuView release];
The code relies on detecting swipe touch gesture on TTTableViewController and using a selector to handle the gesture. Given a gesture touch point, you can determine the cell where the swipe occurred. Once you have a reference to a cell, you can call the showMenu:forCell:
What if we need to trigger the menu view by touch a button on the table view cell? This is what I did:
Create a subclass of TTTableViewCell and add a UIButton to the view.

The code relies on detecting swipe touch gesture on TTTableViewController and using a selector to handle the gesture. Given a gesture touch point, you can determine the cell where the swipe occurred. Once you have a reference to a cell, you can call the showMenu:forCell:
What if we need to trigger the menu view by touch a button on the table view cell? This is what I did:

Create a subclass of TTTableViewCell and add a UIButton to the view.

@interface MyViewCell : TTTableViewCell {

- (id) initWithName:(NSString *)name target:(id)target action:(SEL)action {
  // ...

  UIButton *moreButton = [UIButton buttonWithType:UIButtonTypeCustom];
  moreButton.frame = CGRectMake(268.0f, 6.0f, 32.0f, 32.0f);
  [moreButton setImage:TTIMAGE(@"bundle://Icon_More.png")
  [moreButton addTarget:target action:action
  [self moreButton];

  // ...

Next, create a subclass of TTTableViewController and add the custom TTTableViewCell to the data source.

@interface MyTableViewController : TTTableViewController {

- (void) createModel {
  self.dataSource = [TTListDataSource dataSourceWithObjects:
    [[[ContactViewCell alloc] initWithName:@"Cell 1"
    [[[ContactViewCell alloc] initWithName:@"Cell 2"

In the action handler, that’s where showMenu:forCell: is called. The trick is to determine which cell the button belongs to and consequently replace that cell withe the menu view. This is how I did.

- (void) plusButtonDidPress:(id)sender {
  // Load our custom menu view from a nib.
  UIView *menuView = [[UIView alloc] initWithFrame:cell.contentView];

  UIButton *moreButton = (UIButton *) sender;
  // Convert plusButton bounds to the the coordinate system of table view
  // and then get the cell containing the button.
  CGRect coord = [plusButton convertRect:moreButton.bounds toView:self.tableView];
  NSIndexPath *path = [self.tableView indexPathForRowAtPoint:coord.origin];
  TTTableViewCell* cell = (TTTableViewCell*) [self.tableView

  // Now call showMenu with the menu to display on the associated cell.
  [self showMenu:menuView forCell:cell animated:YES];

Here’s the entire source code on GitHub. Enjoy.


Since some of you asked, I have updated the sample on GitHub to include an example of you can “wire” the buttons on the MenuView to the appropriate action handlers.

First, create a base view controller called BaseCatalogViewController containing the action handlers and have the other 3 controllers inherit the base class. The file’s owner of MenuView.xib should be of type BaseCatalogViewController. Lastly, associate each button in MenuView.xib to an IBAction. You can find the source code at GitHub. Good luck.

Proper URL (Percent) Encoding in iOS

iOS SDKIf you are developing an iPhone app makes RESTful remote calls to a server in the Internet, you will likely need to encode your parameter to a percent encoded string (aka URL-encoding) so that you can properly embed the information in a URI before passing it to the remote server. For example, say you have an address that looks like this:

One Broadway, Cambridge, MA

Under URL encoding, the string becomes:


To encode a string using URL-encodng, simply use following method in NSString:


Conversely, you can use the following method to decode a URL-encoded string to back to its original text:


Full example:

NSString *rawText = @"One Broadway, Cambridge, MA";

NSString *encodedText = [rawText stringByAddingPercentEscapesUsingEncoding:NSUTF8StringEncoding];
NSLog(@"Encoded text: %@", encodedText);
NSString *decodedText = [encodedText stringByReplacingPercentEscapesUsingEncoding:NSUTF8StringEncoding];
NSLog(@"Original text: %@", decodedText);

Here’s the output:
Encoded text: One%20Broadway,%20Cambridge,%20MA
Original text: One Broadway, Cambridge, MA

But there’s just one problem, stringByAddingPercentEscapesUsingEncoding doesn’t encode reserved characters like ampersand (&) and slash (/). For example:

NSString *rawText = @"Bed Bath & Beyond - URL=";

NSString *encodedText = [rawText stringByAddingPercentEscapesUsingEncoding:NSUTF8StringEncoding];
NSLog(@"Encoded text: %@", encodedText);
NSString *decodedText = [encodedText stringByReplacingPercentEscapesUsingEncoding:NSUTF8StringEncoding];
NSLog(@"Original text: %@", decodedText);

Here’s the output:

Encoded text: Bed%20Bath%20&%20Beyond%20-%20URL=
Original text: Bed Bath & Beyond – URL=

As you can see, & and / (in bold red) aren’t encoded. As a workaround, use Foundation function CFURLCreateStringByAddingPercentEscapes instead (as suggested by Simon). Full example here:

// Encode a string to embed in an URL.
NSString* encodeToPercentEscapeString(NSString *string) {
  return (NSString *)
                                          (CFStringRef) string,
                                          (CFStringRef) @"!*'();:@&=+$,/?%#[]",

// Decode a percent escape encoded string.
NSString* decodeFromPercentEscapeString(NSString *string) {
  return (NSString *)
                                                          (CFStringRef) string,

int main (int argc, const char * argv[]) {
  NSAutoreleasePool * pool = [[NSAutoreleasePool alloc] init];

  NSString *rawText = @"Bed Bath & Beyond - URL=";

  NSString *encodedText = encodeToPercentEscapeString(rawText);
  NSLog(@"Encoded text: %@", encodedText);
  NSString *decodedText = decodeFromPercentEscapeString(encodedText);
  NSLog(@"Original text: %@", decodedText);

  [pool drain];
  return 0;

And the output:

Encoded text:
Original text: Bed Bath & Beyond – URL=

This time it correct encode the & and / characters. Of course, you won’t be encoding the entire URL but only the URI parameters. There’s no code download for this, simply cut the above code snippets to your code and paste to your code base.

Errata (Feb 18, 2011)

CFURLCreateStringByAddingPercentEscapes returns a string reference with a retain count of +1. So remember to release it when you are done using it.

Code display and highlight plugin for WordPress

WordPress LogoI shopped around this weekend for a WordPress plugin that not only allows me to display code snippets on my blog but is also capable of syntax highlighting – thereby allowing the posted code to look pretty. For starters, this article provides a list of the top 12 WordPress code syntax display/highlight plugins. After installing and playing around with several plugins, I eventually settled for SyntaxHighlighter Evolved, which not only offers a great looking syntax highlighting theme against a dark background but is easily configurable and supports all of the programming languages I want to display on my blog, namely Objective-C, C#, Java, and JavaScript/HTML. Good stuff.

MassTLC Seminar: SaaS Business Model Update – Creating and Managing Revenues

GloveLast Thursday, I attended a seminar organized by Massachusetts Technology Leadership Council (Mass TLC) where speakers shared and discussed their experience and provided real life examples of how they had implemented SaaS business model in their organizations. Topics discussed in the session were focused around specific areas such as revenue model, customer acquisition, customer retention, and pricing. Here are the notes I took at the event.

David Skok, General Partner at Matrix Partners

David keynoted the event and provided a detailed framework for analyzing profitability, cashflow, and sales strategy in a SaaS business.

David presented these key metrics for anyone in operating in the business of SaaS:

  • (Customer) Lifetime Time Value (LTV) – this is an indicator of how well a SaaS business is performing. LTV relates to how much an average customer will return in value to the business over its predicted lifetime. In plain speak, LTV measures a SaaS business monetization performance.
  • Customer Acquisition Cost (CAC) – this is the business sales and marketing expense incurred over a period to acquire a customer. Basically, CAC measures a SaaS business cost.
  • Churn Rate – known also as attrition rate, this is a measure of net customers acquired or lost (through service or subscription cancellation) in a SaaS business.

David compared LTV with CAC and stressed that every SaaS company should strive for a CAC/LTV balance of:

LTV > 3*CAC (and good SaaS business are in the 5+ range)

David also talked about the growth of a SaaS company. It’s all about timing, don’t invest too early and burn cash as a company spends a lot of money during growth phase. SaaS companies need to know how to best utilize capital to maintain the key metrics and understand when is the best time to grow a company. On the latter point, David emphasizes that company growth usually coincides with one of the phases of a SaaS company. Get them right first before growing.

  • Search for product/market fit
  • Search for repeatable and scalable sales model
  • Scaling the business

David’s presentation can be found here.

William Daly, Manager of Professional Services at Iron Mountain

William gave an introduction to Iron Mountain and talked about their first customer, a leading financial company, they acquired. He highlighted how addressing the needs of their first customer changed their product/service offerings and business model. He ended the presentation emphasizing personal touch and connection goes a long way for any SaaS business.

Bill’s presentation can be found here.

Jim Kizielewicz, Senior VP and CMO at Kronos

Jim started his presentation with an overview of Kronos’s product offerings. It has been challenging for Kronos transitioning from a license-driven business model to one that provides both SaaS and perpetual-licensing. At the end, Kronos adopted a system that includes their traditional business model of offering perpetual licensing and one offering SaaS. They then broke their product/service offerings along the dimensions of pay, deploy, and manage, and designed bundles that comprise varying degrees of these dimensions.

Traditional License Managed Services Hosted License SaaS
Pay License License License Subscription
Deploy (Hosting) at Customer at Customer at Kronos at Kronos
Manage by Customer by Kronos by Kronos by Kronos

Under this strategy, Kronos first let the customers select a product and then allow them to pick a bundle that fits the customers requirements and budget.

Jim’s presentation can be found here.

Drew Fortin, Senior Manager of Internet Marketing at Compete

Drew gave a recount on one of Compete’s past marketing campaigns on driving free account holders to convert to paying customers. A few years ago, the company started speaking their brand and engaging more deeply with free account holders through a more streamlined online presence. The result created Compete Pulse, the company’s online magazine/blog, a series of white papers (to get white papers, users have to ask questions which turned out to be great), and expert educational content where partners in other domains are involved (Compete don’t claim to be an expert in everything, they refer to other partners who know their domains better). Conversion jumped from 0.85% to 1.25% while number of free accounts increase. There were no change in product and just marketing alone increased sales by 30%.

Drew Fortin’s presentation can be found here.

Cory von Wallenstein, VP of Product Management at Dyn

Cory discussed two tactics that the were used at Dyn to combat churn rate (reducing attrition and improving retention):

  • Don’t ask customers whose accounts are due to expire on Friday, Saturday, or Sunday to renew their subscription because their motivation to renew is low during the weekend. Defer notifying the customers about the renewal till Monday. This tactic change increased renewal rate from an average of 62% to 85%.
  • The Support team typically hears from people who dislike or love the product, but not from people from the middle. The company implemented a policy that whenever Support has the time, they proactively reach out to the customers in the middle asking them about the renewing their subscription. The team also asks if customers want to auto-renew, which generates huge upsell.

Cory also mentioned that customers love transparency and simplicity. It seemed contradictory to conventional wisdom at first to consolidate all DNS services into one service package. But Dyn did it anyway with a simple call to action, and all key metrics increased as a result.

Cory’s presentation can be found here.

The speakers were insightful and provided valuable information about the SaaS business model. The event was definitely a good one.


Icon by Shine 7. Free for personal use.

Frisbee thrower

Frisbee throwerA few months ago, my friend Yoav uncovered a stash of videos showing SDM students performing the development of a product in various phases of the project. The videos were shot in 2005 during the development of a frisbee thrower that our team built for the course entitled 15.980 – Product Design and Development, an interdisciplinary course at MIT that provides students a set of frameworks and tools for designing, developing, and commercializing a product.

I uploaded the videos to YouTube a month ago. And seeing the videos (again) today brings a big smile to my face. We had so much fun working on the project and actually built a working product that throws frisbees reliably. Great memories and kudos to team members Christian, David, Eugene, Matt, Spiros, and Yoav. Here are the videos.

We experimented with different ways of launching the frisbee from the machine.

The building of the frisbee thrower.

Field testing the frisbee thrower.

Demoed the frisbee thrower to the MIT ultimate frisbee team.

Boston mobile startup weekend (Nov 12-14)

Startup weekendLast weekend, Doerte and I attended our first Startup Weekend in Boston. For those who are unfamiliar with Startup Weekend, it is a franchise-based event that takes place in various cities around the world to promote entrepreneurship across the globe. The event takes connects entrepreneurs with like-minded people germinate an idea over a weekend – so even if you have a day job you can still fully participate in this event.

I hope that this blog provides some insights and what to expect at Startup Weekend with my recount of the last Boston Mobile Startup Weekend, which took place from November 12th through 14th. Before we even talk about what happens at Startup Weekend, we have to ask ourselves why bother going to one? Here are some of my reasons:

  1. You got an idea, stop being a wannapreneur. Maybe you are still in a funk or are too afraid. Well, stop procrastinating, and  do something about it. Attend a Startup Weekend.
  2. Network and meet potential co-founders. You may be a non-techie with a tech idea or a developer who needs a business person. Guess what? You need to connect with people and get them join you in your venture. Sitting at home isn’t going to do it. Go spend a weekend with other passionate people and think about how you can change the world. And what better way to find and work with a potential co-founder under pressure during Startup Weekend.
  3. Build a product. What good is an idea if you can’t bring it to fruition? Build a prototype of what you or your team envisions.
  4. Form a business around it. You are not only launch a product but a business. Why should MBA students have all the fun. Analyze and figure out your target market, customer demand, industrial trends, competition, and go-to-market strategies. Many teams continue with their projects and even turn them to viable business after Startup Weekend ends.
  5. Awesome learning experience. The event provides you with opportunity of doing something new. You get to learn form your team mates about a new skill or idea. Execution is hard – making difficult decisions, working under constraints, and doing tradeoffs; but you learn by doing.
  6. Have fun. Need I say more.

Boston Mobile Startup Weekend Friday Night

Boston Mobile Startup Weekend Friday Night

Now that you know the why’s. How do you sign up for one? First, you need to stay tuned for future Startup Weekends in your area. To do that follow @startupweekend on Twitter, look out for announcements on the official Startup Weekend website, or start plugging into your local startup community and stay abreast of what’s happening in your area – perhaps the best place to start is to subscribe to the local edition of Startup Digest. Anyone (techie or non-techie) can register for an upcoming event in the local area. Even if an event is over subscribed, don’t get discouraged. Talk to the organizers, they can get you in especially if you are a developer or designer.

Doerte pitching at Boston Mobile Startup Weekend

Doerte pitching at Boston Mobile Startup Weekend

Startup Weekend kicks off on Friday evening with a series of keynote speeches by established local entrepreneurs to prep the participants up for the event. These speeches are terse so that activities on the first night can move along quickly. Immediately after the keynote speech, you can either pitch an idea of yours and form a team or join a team to pursue the idea.

Sometimes there may even be a workshop scheduled just before Startup Weekend officially begins. In our case, we had a developer’s workshop on developing for Android, iPhone, and Windows Phone 7 in the afternoon before the official start to assist developers get up to speed with the skills and technology in the mobile space. Don’t expect to pick up new skills in one afternoon with this pre-event workshop, it is just a crash course to get yourself set up for contributing at Startup Weekend.

Our team, tired but focused

Our team, tired but focused

On day 2 (Saturday), you go back to the hosting venue, meet and work with the new team to develop the idea as far as the team can go; often to the mock-up stage, some to working prototype stage, and a few even to production stage (one team published a WP7 app by Sunday night, this is rare but possible). The first few hours involves a lot of brainstorming in defining the scope of the product and the business model. By early-afternoon, most team would have determined the market viability of the product and devised go-to-market strategies as well as coming up with basic design of the prototype. My advice for people new to Startup Weekend is to think big and come up with a compelling but realistic business model. For product development, start small by developing a simple but functioning prototype, which by the way score your team points in the product development category, for Sunday night presentation.

Michael and I demoed our prototype at Boston Mobile Startup Weekend

Michael and I demoed our prototype at Boston Mobile Startup Weekend

On the third day (Sunday), you get the whole morning and afternoon to refine your product and slide deck before presenting your team (now a startup) in front of panel of judges, participants, and even press and investors. It’s really gratifying to see how much teams can accomplish in setting a foundation of a startup in a weekend. As for our team, we didn’t take home the bacon but it was fun and we are planning to pursue the idea. Also congratulations to Hitchery who won for their social game based on virtual hitchhiking.

If you still have questions about Startup Weekend? Check out the official FAQ from Startup Weekend, a great read for a first-timer to the event. The most important thing is to stay motivated, be a team player, and have fun during Startup Weekend. Needless to say, I had a blast last weekend.

Remember that Startup Weekend is just a start. The team, business model, and product you built at Startup Weekend can turn into something real and big. Do continue the project and relationships outside of Startup Weekend.

Credits: Hacker Chick for some of the pictures taken at Boston Mobile Startup Weekend

Reading materials for building a digital media startup

I often look to the Internet for inspiration and information for starting a company. Now that I am starting a software/web company, I find the online resource indispensable and relevant to my endeavor. So I have compiled a list of relevant online articles and blog posts that I read and have provided some value to me in starting and building a digital media startup. Here’s the list:

Entrepreneurship Wisdom and Advice


Strategy and Framework


Product Design

  • Minimum Viable Product (MVP) – Nivi, Venture Hacks (Recommended)
    Intro to minimum viable product, a strategy for a rapid development and release of a product or feature to help validate product and market assumptions. A follow-up to this post includes real world examples of MVP.
  • Minimum Desirable Product (MDP) – Andrew Chen (Recommended)
    One criticism of Minimum Viable Product (MVP) is that the framework helps answers questions about a startup from a business perspective. A variant of MVP, calls Minimum Desirable Product (MDP) looks at the startup from a usability and user perspective. Great read if you are committed to creating an insanely great product experience. Here’s a follow-up to the post (with slides included).
  • Design Tips for Startups – Thomas Petersen
    Great design tips for web startups.

Product Development and Management

Business Model

Sales and Marketing

Leadership, People, and Culture

Funding and Pitching

I also want to give a shout-out to Stanley Tang. While compiling this list, I constantly referred to his blog post: 256 Must-Read Content for All Tech Entrepreneurs. It’s a great resource.

The success of WP7 depends on developers

Windows Phone 7 (WP7) was officially introduced on Oct 13 and the devices are set to be released in the market on Nov 8. This blog captures my thoughts on WP7, in particular how software developers can strongly influence the success of the platform.

In a network-based market, the value of the WP7 platform is proportional to the number of other users who use the product. It is commonly known in the business of hardware/software that software sells hardware and vice versa. And through this consumption, the demand of one good becomes directly proportional to the demand of the other. Take the case of Micosoft-Intel PC market, the buyer typically purchase a PC primarily for Windows and the applications the operating system runs.

So software matters and a higher proportion of quality apps can attract more people to adopt the phone platform. As the installed base grows, more software developers begin to see a market potential for developing apps for the platform. As more developers enter the market, a wider variety of software is produced. This is the self-reinforcing cycle of the hardware/software market. However I don’t think the number of available apps available only is enough to drive mass adoption. At this writing there are about 250,000 apps available on the iPhone and 100,000 on the Android. WP7 has a lot of catch-up to do in order achieve the same number of app offerings – don’t forget that old Windows Mobile apps don’t even run on the new platform. Quantity alone is not the determinant of higher adoption, diversity and quality of software titles are important drivers too. It is imperative Microsoft must attract software developers to create apps for the platform. But building a thriving software developer ecosystem isn’t something new to Microsoft. Ballmer famously said in the past that Microsoft business is about developers, developers, developers (I still laugh whenever I watch this video). For WP7 to compete successfully, Microsoft needs to build a base of developers to build apps for the platform and initiate this self-reinforcing cycle. Are there any interest from developers so far? It’s hard to tell. Right now, iPhone and Android apps development are keeping most software and mobile app companies busy. It’s difficult for developers to develop for multiple platforms at once. There are already numerous solutions available in the market to address multi-mobile-platform development. I won’t be surprised if Adobe would release a developer tool to compile Flash apps to native WP7 apps.

The technology used to develop WP7 apps isn’t something new. WP7 apps can be built using Silverlight or XNA. Both technologies are already well established in the software development world. Silverlight is based on existing, mature .NET technology while XNA is used by game studios to develop DirectX hardware-accelerated games on XBox and PC. Microsoft should exploit its 3D development suite and existing network with software developers, software retailers, and content partners to develop new titles or port existing best sellers to WP7. While all these initial complementary assets may not have been the only factors influencing the two companies’ successes, they certainly helped the companies to overcome initial entry to market barriers.

I give Microsoft a lot of credit for revamping the Windows Mobile platform and redesigning the user interface. This is a gutsy move but I think it will pay off in the future. I haven’t played with the user interface, but it looks promising. And thank you for eliminating the corner Windows Start button. I quite like the utility of a task-oriented UI of WP7 as opposed to iPhone UI, which is app-oriented.

As a late entrant to the highly competitive smartphone market, Microsoft faces tough competition. Microsoft has strong complementary assets and products which put them in a good position to compete effectively in this market. While I don’t see Microsoft faltering, I don’t see the company emerging as the market leader in this market space anytime soon. But seriously, who knows how this market will play out. For me, I am adopting an (optimistic) wait-and-see stance on developing software for the platform and using a WP7 device.