<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
     xmlns:content="http://purl.org/rss/1.0/modules/content/"
     xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
     xmlns:atom="http://www.w3.org/2005/Atom"
     xmlns:dc="http://purl.org/dc/elements/1.1/"
     xmlns:wfw="http://wellformedweb.org/CommentAPI/"
     >
  <channel>
    <title>Hwee-Boon Yar</title>
    <link>http://hboon.com</link>
    <description>Thoughts, links and braindumps</description>
    <pubDate>Mon, 06 May 2013 06:23:07 GMT</pubDate>
    <generator>Blogofile</generator>
    <sy:updatePeriod>hourly</sy:updatePeriod>
    <sy:updateFrequency>1</sy:updateFrequency>
    <item>
      <title>Different Settings for Development and Adhoc Builds in RubyMotion</title>
      <link>http://hboon.com/different-settings-for-development-and-adhoc-builds-in-rubymotion</link>
      <pubDate>Mon, 06 May 2013 08:37:00 EDT</pubDate>
      <category><![CDATA[Uncategorized]]></category>
      <guid isPermaLink="true">http://hboon.com/different-settings-for-development-and-adhoc-builds-in-rubymotion</guid>
      <description>Different Settings for Development and Adhoc Builds in RubyMotion</description>
      <content:encoded><![CDATA[<p>In our RubyMotion Rakefile, we'll want to be able to have different settings — especially for codesigning — when building for the simulator, device for development testing or device for adhoc/release testing. Based on this <a href="https://groups.google.com/forum/?fromgroups=#!topic/rubymotion/OUuhiClJ0EY">nice tip</a> from <a href="http://www.island94.org">Ben Sheldon</a>, I've derived something simple for myself. Here's the relevant parts: </p>
<pre><code>Motion::Project::App.setup do |app|
  env = if ENV['dev'] == '1'
          'dev'
        elsif ENV['adhoc'] == '1'
          'adhoc'
        else
          'dev' #default
        end

  #...

  if env == 'dev'
    #...
  elsif env == 'adhoc'
    #...
  end
end

task :set_adhoc do
  ENV['adhoc'] = '1'
end

task :tf =&gt; [
  :set_adhoc,
  :testflight
]
</code></pre>
<p>Use the :tf task instead of :testflight and everything will work as expected:</p>
<pre><code>rake retina=4   #This will default to dev=1, but it doesn't matter
rake device debug   #This will default to dev=1
rake tf notes="//"  #This will run testflight with adhoc=1
</code></pre>
<p>Note: Updated based on feedback from Ben Sheldon.</p>]]></content:encoded>
    </item>
    <item>
      <title>Stuck at OS X Startup, loginwindow Keeps Crashing</title>
      <link>http://hboon.com/stuck-at-os-x-startup,-loginwindow-keeps-crashing</link>
      <pubDate>Mon, 11 Mar 2013 02:47:00 EDT</pubDate>
      <category><![CDATA[Uncategorized]]></category>
      <guid isPermaLink="true">http://hboon.com/stuck-at-os-x-startup,-loginwindow-keeps-crashing</guid>
      <description>Stuck at OS X Startup, loginwindow Keeps Crashing</description>
      <content:encoded><![CDATA[<p>My retina MacBook Pro sometimes crashes randomly. It happened again yesterday and this time it refused to boot up to the login screen. After fighting it for 4 hours, trying out safe mode, recovery mode, single user mode, disk repair, I finally figured it out with some Google help. If you notice that your logs are noting loginwindow crashes due to lsregister and it keeps repeating, what you might want to try is delete your LaunchServices cached which looks like /private/var/folders/XX/YY/C/com.apple.LaunchServices-034ZZZ.csstore. See <a href="http://junkheap.net/post/10504111960/solving-a-login-loop-in-mac-os-x-lion-due-to-corrupt">here</a> for more details.</p>]]></content:encoded>
    </item>
    <item>
      <title>Write Synchronously to Campfire Room for Debugging</title>
      <link>http://hboon.com/write-synchronously-to-campfire-room-for-debugging</link>
      <pubDate>Wed, 05 Dec 2012 12:39:00 EST</pubDate>
      <category><![CDATA[Uncategorized]]></category>
      <guid isPermaLink="true">http://hboon.com/write-synchronously-to-campfire-room-for-debugging</guid>
      <description>Write Synchronously to Campfire Room for Debugging</description>
      <content:encoded><![CDATA[<p>I was debugging a very tricky crash in an iPhone app and it only happens on an adhoc build on the device. Not crashing on debug builds on the device means it is very time consuming to track and crash logs aren't helping. I whipped up a function that writes synchronously to a <a href="http://campfirenow.com">Campfire</a> room and sprinkled them around to help nail this down. Others might find this <a href="https://gist.github.com/4205927">function that writes a string to Campfire synchronously</a> useful.</p>]]></content:encoded>
    </item>
    <item>
      <title>iOS Development Tips Weekly Newsletter</title>
      <link>http://hboon.com/ios-development-tips-weekly-newsletter</link>
      <pubDate>Fri, 12 Oct 2012 15:12:00 EDT</pubDate>
      <category><![CDATA[Uncategorized]]></category>
      <guid isPermaLink="true">http://hboon.com/ios-development-tips-weekly-newsletter</guid>
      <description>iOS Development Tips Weekly Newsletter</description>
      <content:encoded><![CDATA[<p>There are many sources of information for iOS development such as <a href="http://www.mikeash.com/pyblog/">Mike Ash's NSBlog</a> or <a href="http://stackoverflow.com/">Stackoverflow</a>. They are often either in depth, technical articles, tutorials or Q&amp;A type of resources. They are great but there is room for a newsletter comprising of short nuggets that will only take a few minutes to read and to instantly benefit from. I've just started a weekly newsletter aiming to do just that. I've posted twice so far.</p>
<p>Interested? Visit <a href="http://tinyletter.com/iosdev">iOS Dev Tips Weekly</a> to subscribe.</p>
<p>Feel free to send me feedback via <a href="mailto:hboon@motionobj.com">email</a>.</p>]]></content:encoded>
    </item>
    <item>
      <title>Latency Between Heroku (AWS us-east) and Linode</title>
      <link>http://hboon.com/latency-between-heroku-(aws-us-east)-and-linode</link>
      <pubDate>Tue, 31 Jul 2012 11:17:00 EDT</pubDate>
      <category><![CDATA[Uncategorized]]></category>
      <guid isPermaLink="true">http://hboon.com/latency-between-heroku-(aws-us-east)-and-linode</guid>
      <description>Latency Between Heroku (AWS us-east) and Linode</description>
      <content:encoded><![CDATA[<p>On a project involving Heroku, I was considering placing some services on Linode and accessing them from Heroku, which is hosted on AWS us-east, so I spin up an EC2 instance in us-east as well as 1 Linode for each of their datacenters and ping each Linode from the EC2 instance. It isn't an extensive test but should give a good ballpark for anyone considering the same thing:</p>
<ul>
<li>Newark: 9ms</li>
<li>Atlanta: 16-19ms</li>
<li>Dallas: 34-35ms</li>
<li>Fremont: 72ms</li>
</ul>]]></content:encoded>
    </item>
    <item>
      <title>A Craftsman and His Tools</title>
      <link>http://hboon.com/a-craftsman-and-his-tools</link>
      <pubDate>Wed, 13 Jun 2012 17:02:00 EDT</pubDate>
      <category><![CDATA[Uncategorized]]></category>
      <guid isPermaLink="true">http://hboon.com/a-craftsman-and-his-tools</guid>
      <description>A Craftsman and His Tools</description>
      <content:encoded><![CDATA[<p>It is important for a craftsman to use the best tools reasonable to perform his art. In the software business, this involves not only having a <a href="http://www.apple.com/macbook-pro/">great hardware setup</a>, but also great software tools. Hardware is usually much easier. Order a prefered development machine that is within budget and that is about it. Many developers prefer Macbook Airs and Macbook Pros nowadays. It can be a little bit more work for other platforms such as Linux and Windows, but it shouldn't be overly so. It's the software that takes time and effort to choose, maintain, and master.</p>
<p>Recently, I've started making it a habit to continously try out new tools, evaluate them against old ones, as well as enhancing my learning and use of existing tools. For example, I am continuously on the lookout to learning more about <a href="http://code.google.com/p/macvim/">MacVim</a>, my primary editor, or otherwise playing around with different configurations, like switching to a different font. I'm recently testing <a href="http://ridiculousfish.com/shell/">fishfish</a> alongside bash. And I'm always evaluating open-source software libraries I can tap on.</p>
<p>I keep a text file open im MacVim all the time. It acts as my TODO list and worklog. For each piece of software that I am evaluating or want to get used to using, I just add a line that acts as a recurring TODO, to be reminded of it, as well as to add notes to.</p>
<p>Here's some of the other tools I have been evaluating recently:</p>
<ul>
<li><a href="http://giantcomet.com/flint">Flint</a> - Campfire chat client</li>
<li><a href="http://cocoatech.com/pathfinder/">Path Finder</a> - Finder replacement</li>
<li><a href="https://shinyplasticbag.com/dragondrop/">DragonDrop</a> - utility to help with drag and drops</li>
</ul>
<p>Some gems I found a while back:</p>
<ul>
<li><a href="http://iconfactory.com/software/xscope">Xscope</a> - several utilities in 1 for designers and developers, especially nice if you need to work at pixel-perfect levels</li>
<li><a href="http://www.alfredapp.com/">Alfred</a> - app launch</li>
<li><a href="http://www.jetbrains.com/objc/">App Code</a> - I still use MacVim, but that's just me</li>
<li><a href="http://crashlytics.com">Crashlytics</a> - Crash detection/reporting tool for iOS and OS X apps</li>
<li><a href="http://mizage.com/divvy/">Divvy</a> - Window management</li>
<li><a href="http://trello.com">Trello</a> - a flexible project management/TODO list software</li>
</ul>
<p>Have you been improving your toolset recently?</p>]]></content:encoded>
    </item>
    <item>
      <title>How a Developer Spent a Weekend With His Developer Wife</title>
      <link>http://hboon.com/how-a-developer-spent-a-weekend-with-his-developer-wife</link>
      <pubDate>Thu, 26 Apr 2012 23:16:00 EDT</pubDate>
      <category><![CDATA[Uncategorized]]></category>
      <guid isPermaLink="true">http://hboon.com/how-a-developer-spent-a-weekend-with-his-developer-wife</guid>
      <description>How a Developer Spent a Weekend With His Developer Wife</description>
      <content:encoded><![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://taps.motionobj.com/hb-blog-paperboard-appstore">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:encoded>
    </item>
    <item>
      <title>How does Square know my name in their app's registration process?</title>
      <link>http://hboon.com/how-does-square-know-my-name-in-their-app's-registration-process-</link>
      <pubDate>Thu, 29 Mar 2012 16:11:00 EDT</pubDate>
      <category><![CDATA[Uncategorized]]></category>
      <guid isPermaLink="true">http://hboon.com/how-does-square-know-my-name-in-their-app's-registration-process-</guid>
      <description>How does Square know my name in their app's registration process?</description>
      <content:encoded><![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:encoded>
    </item>
    <item>
      <title>I don't use Interface Builder</title>
      <link>http://hboon.com/i-don't-use-interface-builder</link>
      <pubDate>Sat, 27 Aug 2011 22:48:00 EDT</pubDate>
      <category><![CDATA[Uncategorized]]></category>
      <guid isPermaLink="true">http://hboon.com/i-don't-use-interface-builder</guid>
      <description>I don't use Interface Builder</description>
      <content:encoded><![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:encoded>
    </item>
    <item>
      <title>Comments about Straits Times iOS app</title>
      <link>http://hboon.com/comments-about-straits-times-ios-app</link>
      <pubDate>Mon, 01 Aug 2011 10:16:00 EDT</pubDate>
      <category><![CDATA[Uncategorized]]></category>
      <guid isPermaLink="true">http://hboon.com/comments-about-straits-times-ios-app</guid>
      <description>Comments about Straits Times iOS app</description>
      <content:encoded><![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:encoded>
    </item>
  </channel>
</rss>
