<?xml version="1.0" encoding="UTF-8"?>
<feed
  xmlns="http://www.w3.org/2005/Atom"
  xmlns:thr="http://purl.org/syndication/thread/1.0"
  xml:lang="en"
   >
  <title type="text">Hwee-Boon Yar</title>
  <subtitle type="text">Thoughts, links and braindumps</subtitle>

  <updated>2012-05-05T16:18:54Z</updated>
  <generator uri="http://blogofile.com/">Blogofile</generator>

  <link rel="alternate" type="text/html" href="http://hboon.com" />
  <id>http://hboon.com/feed/atom/</id>
  <link rel="self" type="application/atom+xml" href="http://hboon.com/feed/atom/" />
  <entry>
    <author>
      <name></name>
      <uri>http://hboon.com</uri>
    </author>
    <title type="html"><![CDATA[How a Developer Spent a Weekend With His Developer Wife]]></title>
    <link rel="alternate" type="text/html" href="http://hboon.com/how-a-developer-spent-a-weekend-with-his-developer-wife" />
    <id>http://hboon.com/how-a-developer-spent-a-weekend-with-his-developer-wife</id>
    <updated>2012-04-26T23:16:00Z</updated>
    <published>2012-04-26T23:16:00Z</published>
    <category scheme="http://hboon.com" term="Uncategorized" />
    <summary type="html"><![CDATA[How a Developer Spent a Weekend With His Developer Wife]]></summary>
    <content type="html" xml:base="http://hboon.com/how-a-developer-spent-a-weekend-with-his-developer-wife"><![CDATA[<p>It was a saturday. <a href="http://www.fiftythree.com/paper">Paper</a>, by FIFTYTHREE was released a few days ago and I had been toying with the app. I had no artistic talent whatsoever so I was searching and browsing what other people had drawn with Paper and shared on Twitter. Examples like these came up:</p>
<p><a href="http://p.twimg.com/Ap8IZTrCQAAnl3m.jpg"><img src="http://p.twimg.com/Ap8IZTrCQAAnl3m.jpg"></a></p>
<p><a href="http://twitter.com/#!/francyx30/status/188907370691305473"><img src="http://p.twimg.com/Ap8iQLXCIAAhmqm.jpg"></a></p>
<p>I don't know how well Paper did in sales, but I thought to myself, if an app makes you feel like getting an accessory (a stylus) for it, it is already a successful app.</p>
<p>I told my wife, "hey, wouldn't it be fun if we skip over our usual work and work on a little side project over the weekend?"</p>
<p>When dealing with apps and services that deal with visual content, I'm a great fan of chromeless displays. Since the content is pictorial, we decided to just show them in a grid. I have been toying with <a href="http://parse.com">Parse</a> and thought this would be a good chance to build something with it, leaning on its datastore functionality. We pulled the shared drawings from Twitter's Streaming API and stored them into Parse, then wrote a web app that pulls the latest drawings from the database and display them. We did a quick wireframe and she went off to do the design while I coded.</p>
<p>This became <a onclick="_gaq.push(['_trackPageview', '/thepaperboard.com']); return true;" href="http://thepaperboard.com">Paper Board</a>, the website.</p>
<p>When we were finally done with it, she said, "Why don't we build an iPhone app?" You can see where this is going (and using Parse was brilliant foresight!) So we did. We wanted to keep a similar, simple user experience where the content was front and center (and because we didn't want to spend too much time on it).</p>
<p>After more coding, using and testing the app, we submitted it and waited. And waited. The app was rejected.[1] After appealing and more waiting, it was finally approved yesterday.</p>
<p>Here it is: <a onclick="_gaq.push(['_trackPageview', '/paperboardappstore']); return true;" href="http://motionobj.com/paperboardappstore">Paper Board</a>, the iPhone app.</p>
<p>And this is how a geek couple spent a weekend (and a few more days) together :)</p>
<p>PS: I just learned about <a href="http://madewithpaper.fiftythree.com/">this</a> while I was writing up this post.</p>
<p>[1] Rejected for the reason: "Apps that are simply web clippings, content aggregators, or a collection of links, may be rejected", while apps that con users into thinking they offer lock-screen functionality is approved and floating in the top 10 continues to amaze me.</p>]]></content>
  </entry>
  <entry>
    <author>
      <name></name>
      <uri>http://hboon.com</uri>
    </author>
    <title type="html"><![CDATA[How does Square know my name in their app's registration process?]]></title>
    <link rel="alternate" type="text/html" href="http://hboon.com/how-does-square-know-my-name-in-their-app's-registration-process-" />
    <id>http://hboon.com/how-does-square-know-my-name-in-their-app's-registration-process-</id>
    <updated>2012-03-29T16:11:00Z</updated>
    <published>2012-03-29T16:11:00Z</published>
    <category scheme="http://hboon.com" term="Uncategorized" />
    <summary type="html"><![CDATA[How does Square know my name in their app's registration process?]]></summary>
    <content type="html" xml:base="http://hboon.com/how-does-square-know-my-name-in-their-app's-registration-process-"><![CDATA[<p>There's a post on Quora titled <a href="http://www.quora.com/Square-company/How-does-Square-know-my-name-in-their-apps-registration-process?srid=TjL">How does Square know my name in their app's registration process?</a>.</p>
<p><a href="http://www.quora.com/Square-company/How-does-Square-know-my-name-in-their-apps-registration-process/answer/John-Feminella">John Feminella's answer</a> is very interesting. I thought many apps will benefit from this so I implemented this proof-of-concept - <a href="https://github.com/hboon/guessIdentity">guessIdentity</a>.</p>]]></content>
  </entry>
  <entry>
    <author>
      <name></name>
      <uri>http://hboon.com</uri>
    </author>
    <title type="html"><![CDATA[I don't use Interface Builder]]></title>
    <link rel="alternate" type="text/html" href="http://hboon.com/i-don't-use-interface-builder" />
    <id>http://hboon.com/i-don't-use-interface-builder</id>
    <updated>2011-08-27T22:48:00Z</updated>
    <published>2011-08-27T22:48:00Z</published>
    <category scheme="http://hboon.com" term="Uncategorized" />
    <summary type="html"><![CDATA[I don't use Interface Builder]]></summary>
    <content type="html" xml:base="http://hboon.com/i-don't-use-interface-builder"><![CDATA[<p>I don't use Interface Builder (IB). Not anymore.</p>
<p>Somewhere between going through the iPhone to iPad display transition, supporting both portrait and landscape orientation and building screens that are dynamic and parts of it animated, I discovered that life without IB is much sweeter.</p>
<h2>Why IB?</h2>
<p>IB lets you lay out your user interface visually, with inspectors to tweak the controls' properties. If you work with a designer who is not into programming, it is supposed to let you send the XIBs/NIBs to them and who can tweak it directly without requiring additional work from the developer.</p>
<p>If you have custom built components or do even a little bit of layout in code, your designer wouldn't be able to see how the UI looks like in IB. Also, tweaks could mean animate this button for 0.1 seconds longer which requires changes in the code to see the result.</p>
<h2>UI Reuse</h2>
<p>You need to keep 2 set of NIBs, 1 for iPhone and 1 for iPad. Controls may need to be laid out differently in different screens, or you might have more functionality when running on the iPad due to the additional screen real estate available.</p>
<p>But often, there is UI that is re-usable across the two screen sizes. Creating your view programmatically makes it much easier to share them. For example, you can detect or pass in the actual screen size.</p>
<p>When you have your views written in code, you can decompose them into functions, methods, classes. Much better than in IB which pretty much can't be reused.</p>
<h2>Portrait and Landscape Orientation</h2>
<p>Let's face it: the layout system in IB is quite primitive. It lacks the layout managers provided in systems such as Java and Smalltalk. If you use IB, you often do up the portrait mode screen in NIBs and then run code to adjust them when changing to landscape orientation. This mixing of IB and code makes things more confusing and hard to architect.</p>
<h2>Fine. So How Do We Do It in Code Instead?</h2>
<p>For each screen, I have a controller class and view class pair. Here's the controller class:</p>
<pre><code>@interface MyViewController : UIViewController

@property (nonatomic,retain) UIView* mainView;

@end

@implementation MyViewController

@synthesize mainView;

- (void)loadView {
    self.view = [[[UIView alloc] initWithFrame:
        [UIScreen mainScreen].bounds] autorelease];
    self.view.autoresizingMask = UIViewAutoresizingFlexibleWidth |
        UIViewAutoresizingFlexibleHeight;
    self.view.backgroundColor = [UIColor whiteColor];
}

- (void)viewDidLoad {
    [super viewDidLoad];

    self.mainView.autoresizingMask = UIViewAutoresizingFlexibleWidth |
        UIViewAutoresizingFlexibleHeight;
    //self.mainView.delegate = self;  //good to have
    [self.view addSubview:self.mainView];

    /* TODO: controller is displayed for the first time, do things like
        load data, etc */
}

- (void)viewDidUnload {
    [super viewDidUnload];

    self.mainView = nil;
}

- (void)dealloc {
    /* Call -viewDidUnload here so all releasing of view resources is
        only done at 1 place. */
    [self viewDidUnload];
    //TODO: Release other owned ivars here

    [super dealloc];
}

- (MainView*)mainView {
    if (!mainView) {
        /* We use [UIScreen mainScreen].bounds instead of
            self.view.bounds so we don't create self.view as a
            side-effect. It's messy because creating self.view will
            trigger creation of self.mainView itself */
        self.mainView = [[[MyView alloc] initWithFrame:
            CGRectMake(0, 0, [UIScreen mainScreen].bounds.size.width,
            [UIScreen mainScreen].bounds.size.height)] autorelease];
    }

    return mainView;
}

@end
</code></pre>
<p>And here's the corresponding view class:</p>
<pre><code>@interface MyView: UIView

@end

@implementation MyView

- (id)initWithFrame:(CGRect)frame {
    if (self = [super initWithFrame:frame]) {
        //TODO: assemble your subview and add them to self.view
    }

    return self;
}

@end
</code></pre>
<p>I often build a UIViewController and UIView subclass containing common code which serves as the base class for most view controllers and views in an application.</p>]]></content>
  </entry>
  <entry>
    <author>
      <name></name>
      <uri>http://hboon.com</uri>
    </author>
    <title type="html"><![CDATA[Comments about Straits Times iOS app]]></title>
    <link rel="alternate" type="text/html" href="http://hboon.com/comments-about-straits-times-ios-app" />
    <id>http://hboon.com/comments-about-straits-times-ios-app</id>
    <updated>2011-08-01T10:16:00Z</updated>
    <published>2011-08-01T10:16:00Z</published>
    <category scheme="http://hboon.com" term="Uncategorized" />
    <summary type="html"><![CDATA[Comments about Straits Times iOS app]]></summary>
    <content type="html" xml:base="http://hboon.com/comments-about-straits-times-ios-app"><![CDATA[<p>I saw a few tweets about the Straits Times app being available for the iPad and thought I check it out. Some initial thoughts and suggestions:</p>
<h2>Straits Times app on the iPad</h2>
<ul>
<li>EULA should go into the EULA accessible in the App store instead. There's a least 1 mistake in the EULA, referring to the "I Do not Accept Button" as the "Cancel" button.</li>
<li>UI is jerky, it doesn't respond immediately to finger dragging the screen.</li>
<li>Sometimes when you swipe to a new page, the images flashes.</li>
<li>Get rid of the animation for unrolling the paper after tapping on the "iPad Edition", "PDF Edition" or "Breakign News" buttons. It's unintuitive, especially as there's a pause before the animation to reveal the article starts.</li>
<li>The "Breaking News" UI seems quite different from the "iPad Edition", e.g. you can scroll articles up and down in "Breaking News" and website-like tabs are used for sections, but you swipe left-right in "iPad Edition" and tab buttons at the bottom are used for sections.</li>
<li>There isn't a clear visual response when you tap on the screen (especially articles) to indicate what you have tapped on. The articles suddenly pop up fullscreen.</li>
<li>Crashes within 1 minute of initial use, crashes again within the next few minutes.</li>
<li>I like that tapping on the photo thumbnails bring up a fullsize image with the caption. I wonder if there is something interesting that can be done along the lines of <a href="http://www.boston.com/bigpicture/">The Big Picture</a>.</li>
</ul>
<h2>Straits Times app on the iPhone</h2>
<ul>
<li>EULA (see comment for EULA for app running on iPad).</li>
<li>Has an irritating ad that animates after each refresh. Perhaps move it to the top or bottom, but either way, just keep it stationary and don't flash it?</li>
<li>App slows down while reloading.</li>
<li>In a few minutes testing, seems more stable than running on the iPad.</li>
</ul>]]></content>
  </entry>
  <entry>
    <author>
      <name></name>
      <uri>http://hboon.com</uri>
    </author>
    <title type="html"><![CDATA[Trying out Safari again]]></title>
    <link rel="alternate" type="text/html" href="http://hboon.com/trying-out-safari-again" />
    <id>http://hboon.com/trying-out-safari-again</id>
    <updated>2011-07-11T17:55:00Z</updated>
    <published>2011-07-11T17:55:00Z</published>
    <category scheme="http://hboon.com" term="Uncategorized" />
    <summary type="html"><![CDATA[Trying out Safari again]]></summary>
    <content type="html" xml:base="http://hboon.com/trying-out-safari-again"><![CDATA[<p>Trying out Safari again since I migrated to a new machine. (I actually couldn't download Chrome with Safari on both my old and new machine. Had to use Firefox to download. Very strange!)</p>
<p>What I missed from Chrome</p>
<ul>
<li>Multiple undo of tabs closed and the restored tab(s) preserves history</li>
<li><strike>Opening a link in a new tab goes to the right of the current tab</strike> (Update: Safari 5.1 does this now) </li>
<li>It's still faster</li>
<li>Omnisearch bar</li>
<li>The way tabs are displayed</li>
</ul>
<p><strike>What I hate about Safari</strike></p>
<ul>
<li><strike>Safari has this annoying behavoir where when you open a new window, press Cmd+L quickly to go to location bar, start typing and it suddenly loses focus. Everytime. Annoys me to no end.</strike> (Update: finally gotten down to it. It's the Handoff extension. Removed it and the problem is gone)</li>
</ul>
<p>What's good about Safari</p>
<ul>
<li>It's a much better Mac citizen, e.g. QuickCursor support which I think requires using the accessibility API.</li>
</ul>
<p>Other than that, they aren't that different for day-to-day web browsing.</p>]]></content>
  </entry>
  <entry>
    <author>
      <name></name>
      <uri>http://hboon.com</uri>
    </author>
    <title type="html"><![CDATA[Migrated from Posterous to Blogofile]]></title>
    <link rel="alternate" type="text/html" href="http://hboon.com/migrated-from-posterous-to-blogofile" />
    <id>http://hboon.com/migrated-from-posterous-to-blogofile</id>
    <updated>2011-07-11T10:46:00Z</updated>
    <published>2011-07-11T10:46:00Z</published>
    <category scheme="http://hboon.com" term="Uncategorized" />
    <summary type="html"><![CDATA[Migrated from Posterous to Blogofile]]></summary>
    <content type="html" xml:base="http://hboon.com/migrated-from-posterous-to-blogofile"><![CDATA[<p>I have migrated this blog from Posterous to being self-hosted on <a href="http://blogofile.com/">Blogofile</a> over the weekend. It's easy to get started and I like simpler tools whenever reasonable. If you have been subscribing to my RSS feed at http://hboon.posterous.com, now's the time to change it to <a href="http://hboon.com/feed">http://hboon.com/feed</a>.</p>]]></content>
  </entry>
  <entry>
    <author>
      <name></name>
      <uri>http://hboon.com</uri>
    </author>
    <title type="html"><![CDATA[In-app Purchase Patent and What iOS developers Should Know About It]]></title>
    <link rel="alternate" type="text/html" href="http://hboon.com/in-app-purchase-patent-and-what-ios-developers-should-know-about-it" />
    <id>http://hboon.com/in-app-purchase-patent-and-what-ios-developers-should-know-about-it</id>
    <updated>2011-05-17T23:11:00Z</updated>
    <published>2011-05-17T23:11:00Z</published>
    <category scheme="http://hboon.com" term="Uncategorized" />
    <summary type="html"><![CDATA[In-app Purchase Patent and What iOS developers Should Know About It]]></summary>
    <content type="html" xml:base="http://hboon.com/in-app-purchase-patent-and-what-ios-developers-should-know-about-it"><![CDATA[<p>There has been a <a href="http://www.lodsys.com/">patent troll</a> going around contacting iOS developers who are offering in-app purchases, informing them of patent infringement. <a href="http://fosspatents.blogspot.com/">FOSSpatents</a> has put up an article detailing <a href="http://fosspatents.blogspot.com/2011/05/what-app-developers-need-to-know-about.html">what iOS developers should know about it</a>. It also mentions (note that this are educated guesses, not facts) about how Apple and other companies including Google who also run similar app store might react. Do yourself a favor and read it even if you are not utilitzing in-app purchase today.</p>]]></content>
  </entry>
  <entry>
    <author>
      <name></name>
      <uri>http://hboon.com</uri>
    </author>
    <title type="html"><![CDATA[Using ctags with MacVim for Objective C on OS X]]></title>
    <link rel="alternate" type="text/html" href="http://hboon.com/using-ctags-with-macvim-for-objective-c-on-os-x" />
    <id>http://hboon.com/using-ctags-with-macvim-for-objective-c-on-os-x</id>
    <updated>2011-01-12T22:24:00Z</updated>
    <published>2011-01-12T22:24:00Z</published>
    <category scheme="http://hboon.com" term="Uncategorized" />
    <summary type="html"><![CDATA[Using ctags with MacVim for Objective C on OS X]]></summary>
    <content type="html" xml:base="http://hboon.com/using-ctags-with-macvim-for-objective-c-on-os-x"><![CDATA[<ol>
<li>Install <a href="http://mxcl.github.com/homebrew/">Homebrew</a> if you haven't.</li>
<li>Run <code>brew install ctags</code>. The version of ctags that ship of OS X is an antique.</li>
<li>Run <code>echo "--langdef=objc" &amp;gt;&amp;gt; ~/.ctags &amp;amp;&amp;amp; echo "--langmap=objc:.m" &amp;gt;&amp;gt; ~/.ctags &amp;amp;&amp;amp; echo "--regex-objc=/^[\t ]*(\-|\+)[\t ]*\([_a-zA-Z0-9][_a-zA-Z0-9]*\)([_a-zA-Z0-9][_a-zA-Z0-9]*)/\2/f/" &amp;gt;&amp;gt; ~/.ctags</code></li>
<li>cd to the directory to write the tags file in</li>
<li>Run <code>ctags -R mytargetdirectory</code></li>
<li>Press ^] in MacVim over a function name to go to declaration/definitions</li>
</ol>
<p>PS: Creating the .ctags file is so convoluted because I can't figure out how to put a multiliner without ruining the formatting in the instructions.</p>]]></content>
  </entry>
  <entry>
    <author>
      <name></name>
      <uri>http://hboon.com</uri>
    </author>
    <title type="html"><![CDATA[Glass Buttons in iPhone Apps Without Using Image Files]]></title>
    <link rel="alternate" type="text/html" href="http://hboon.com/glass-buttons-in-iphone-apps-without-using-image-files" />
    <id>http://hboon.com/glass-buttons-in-iphone-apps-without-using-image-files</id>
    <updated>2010-07-06T12:03:00Z</updated>
    <published>2010-07-06T12:03:00Z</published>
    <category scheme="http://hboon.com" term="Uncategorized" />
    <summary type="html"><![CDATA[Glass Buttons in iPhone Apps Without Using Image Files]]></summary>
    <content type="html" xml:base="http://hboon.com/glass-buttons-in-iphone-apps-without-using-image-files"><![CDATA[<p>For folks who want to <a href="http://github.com/hboon/GlassButtons">create glass buttons in iPhone apps without using private APIs and image files</a>.</p>
<p>From the README:</p>
<p>Uses public APIs to create native-looking glass buttons. No image files used. Buttons can be created in IB (and configured programmatically) or fully by code.</p>
<ul>
<li>Include Quartz Core framework.</li>
<li>Add Global.h, MOButton.h/.m, MOGlassButton.h/.m</li>
<li>See demo project.</li>
</ul>
<div style="text-align:center">
    <img src="/images/glass-buttons-in-iphone-apps-without-using-image-files.png"/>
</div>]]></content>
  </entry>
  <entry>
    <author>
      <name></name>
      <uri>http://hboon.com</uri>
    </author>
    <title type="html"><![CDATA[My SimplyTweet Punch Card]]></title>
    <link rel="alternate" type="text/html" href="http://hboon.com/my-simplytweet-punch-card" />
    <id>http://hboon.com/my-simplytweet-punch-card</id>
    <updated>2010-06-03T23:11:00Z</updated>
    <published>2010-06-03T23:11:00Z</published>
    <category scheme="http://hboon.com" term="Uncategorized" />
    <summary type="html"><![CDATA[My SimplyTweet Punch Card]]></summary>
    <content type="html" xml:base="http://hboon.com/my-simplytweet-punch-card"><![CDATA[<p>I use GitHub to manage my code and I thought it's interesting to look at my commit activity for SimplyTweet. GitHub has an excellent tool for this called Punch Card. This is how it looks like for SimplyTweet:</p>
<div style="text-align:center">
    <img src="/images/my-simplytweet-punch-card.png"/>
</div>

<p>It shows the relative number of commits (rough equivalents of changes if you are consistent) performed across the duration of the project. You can see that</p>
<ol>
<li>I am most productive (again, commit-wise) the few hours around 12am and 12pm.</li>
<li>I am least productive on Fridays.</li>
<li>I seem to be slightly more productive during midnight than noon.</li>
<li>I work on Saturday nights.</li>
<li>I work on Sunday nights</li>
<li>I work everyday.</li>
</ol>
<p>Does anyone else has Punch Card graphs they like to share?</p>]]></content>
  </entry>
</feed>

