<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:dc="http://purl.org/dc/elements/1.1/" version="2.0"><channel><atom:link rel="hub" href="http://tumblr.superfeedr.com/" xmlns:atom="http://www.w3.org/2005/Atom"/><description>I write software to make lazy people lazier.



  var _gaq = _gaq || [];
  _gaq.push([‘_setAccount’, ‘UA-104776-13’]);
  _gaq.push([‘_trackPageview’]);

  (function() {
    var ga = document.createElement(‘script’); ga.type = ‘text/javascript’; ga.async = true;
    ga.src = (‘https:’ == document.location.protocol ? ‘https://ssl’ : ‘http://www’) + ‘.google-analytics.com/ga.js’;
    var s = document.getElementsByTagName(‘script’)[0]; s.parentNode.insertBefore(ga, s);
  })();</description><title>Hi, I'm Jeremy Foo.</title><generator>Tumblr (3.0; @ornyx)</generator><link>http://the.ornyx.net/</link><item><title>MNCoder</title><description>&lt;p align="center"&gt;&lt;img src="http://media.tumblr.com/tumblr_ly92uhARAx1qa4brm.png"/&gt;&lt;/p&gt;
&lt;p&gt;Its been about 3 weeks, but I’m finally done with a piece of work that will be used (hopefully) in the iCloud capable version of &lt;a href="http://www.mindnode.com"&gt;Mindnode&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;&lt;a href="http://github.com/echoz/mncoder"&gt;MNCoder&lt;/a&gt; is what I’d call a clever hack using NSKeyedArchiver and NSKeyedUnarchiver to help with portability of certain Apple classes between iOS and the Mac. If you worked on both platforms, you’d know that iOS has its own implementation for colors and fonts. With iOS 4 this has been extended to NSAttributedStrings that take Core Text attributes instead of the nicer AppKit additions to NSAttributedStrings.&lt;/p&gt;
&lt;p&gt;While I’d admit this is a somewhat complicated way of going about things, 2KSLOC to be exact, I figured this was the most straightforward and intuitive way to help people understand and possibly contribute additional code in the future.&lt;/p&gt;
&lt;p&gt;What MNCoder does is that it uses a neutral platform independent NSCoding compliant object to store the base attributes that is needed to reconstruct an equivalent on either platform. Using #ifs, the object will give you the appropriate object. Adding to the system is NSCoder which helps with the finding and replacement of objects at runtime when doing serialization.&lt;/p&gt;
&lt;p&gt;Its pretty much like old school language translation. Translate your source language into a intermediate version and then translate that to the target language. Nothing too fancy and easily understood.&lt;/p&gt;
&lt;p&gt;The work is released under a BSD license which Markus has nicely given his approval of so here’s hoping it’ll have more contributors as it goes along.&lt;/p&gt;
&lt;p&gt;Nice side effect of this is that I’ve had extensive time with Core Text and I’d say its pretty fun.&lt;/p&gt;</description><link>http://the.ornyx.net/post/16345535268</link><guid>http://the.ornyx.net/post/16345535268</guid><pubDate>Mon, 23 Jan 2012 20:11:00 +0800</pubDate><category>mncoder</category><category>portability</category><category>ios</category><category>mac</category><category>classes</category><category>objects</category><category>translation</category><category>interoperability</category><category>nscolor</category><category>uicolor</category><category>nsfont</category><category>uifont</category><category>nsattributedstring</category><dc:creator>andthirdly</dc:creator></item><item><title>Befriending Core Text</title><description>&lt;a href="http://www.cocoanetics.com/2011/01/befriending-core-text/"&gt;Befriending Core Text&lt;/a&gt;</description><link>http://the.ornyx.net/post/15890211525</link><guid>http://the.ornyx.net/post/15890211525</guid><pubDate>Mon, 16 Jan 2012 00:52:57 +0800</pubDate><dc:creator>andthirdly</dc:creator></item><item><title>The Word of Notch: Coding skill and the decline of stagnation</title><description>&lt;a href="http://notch.tumblr.com/post/15782716917/coding-skill-and-the-decline-of-stagnation"&gt;The Word of Notch: Coding skill and the decline of stagnation&lt;/a&gt;: &lt;p&gt;&lt;a class="tumblr_blog" href="http://notch.tumblr.com/post/15782716917/coding-skill-and-the-decline-of-stagnation"&gt;notch&lt;/a&gt;:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;I am a decent programmer. I know a decent amount of computer science theory, I can type correct code fairly easy. I don’t let my classes expand too much. But I still struggle some with math, and I have a tendency to have too many cross-dependencies in my code.&lt;/p&gt;
&lt;p&gt;I used to think I was an awesome…&lt;/p&gt;
&lt;/blockquote&gt;</description><link>http://the.ornyx.net/post/15819947803</link><guid>http://the.ornyx.net/post/15819947803</guid><pubDate>Sat, 14 Jan 2012 16:41:38 +0800</pubDate><dc:creator>andthirdly</dc:creator></item><item><title>Avoiding duplicate symbol errors during linking by removing classes from static libraries</title><description>&lt;a href="http://atnan.com/blog/2012/01/12/avoiding-duplicate-symbol-errors-during-linking-by-removing-classes-from-static-libraries/?utm_source=feedburner&amp;utm_medium=feed&amp;utm_campaign=Feed: atnan-articles (Atnan)"&gt;Avoiding duplicate symbol errors during linking by removing classes from static libraries&lt;/a&gt;: &lt;p&gt;Oh this is a gem!&lt;/p&gt;</description><link>http://the.ornyx.net/post/15727597313</link><guid>http://the.ornyx.net/post/15727597313</guid><pubDate>Fri, 13 Jan 2012 01:22:21 +0800</pubDate><dc:creator>andthirdly</dc:creator></item><item><title>A little advice to companies</title><description>&lt;p&gt;Before you engage a developer to build a mobile app for you, consider the following points,&lt;/p&gt;
&lt;ol&gt;&lt;li&gt;Are you shoving your web page into an app?&lt;/li&gt;
&lt;li&gt;Are you providing a catalogue of products/services/etc. with no useful way to purchase them beyond being just a showcase?&lt;/li&gt;
&lt;li&gt;Are you adding a “game” so that people will actually use your app?&lt;/li&gt;
&lt;li&gt;Are you using the app as nothing more than a marketing effort?&lt;/li&gt;
&lt;/ol&gt;&lt;p&gt;If you have answered yes to the above, here’s some cost saving advice.&lt;/p&gt;
&lt;ol&gt;&lt;/ol&gt;&lt;p&gt;Don’t do it.&lt;/p&gt;</description><link>http://the.ornyx.net/post/15493394600</link><guid>http://the.ornyx.net/post/15493394600</guid><pubDate>Mon, 09 Jan 2012 11:34:23 +0800</pubDate><category>freelance</category><category>work</category><category>advice</category><category>companies</category><category>SMEs</category><category>not to do</category><dc:creator>andthirdly</dc:creator></item><item><title>The iPhone Tab Bar</title><description>&lt;a href="http://www.significantpixels.com/2011/04/04/the-iphone-tab-bar/"&gt;The iPhone Tab Bar&lt;/a&gt;: &lt;p&gt;When designers get bored. Or a more sane way to do tab bars.&lt;/p&gt;</description><link>http://the.ornyx.net/post/15493759565</link><guid>http://the.ornyx.net/post/15493759565</guid><pubDate>Sun, 08 Jan 2012 13:16:38 +0800</pubDate><dc:creator>andthirdly</dc:creator></item><item><title>Mobile Progressive playback: An atom story.</title><description>&lt;a href="http://fabiensanglard.net/mobile_progressive_playback/index.php"&gt;Mobile Progressive playback: An atom story.&lt;/a&gt;: &lt;p&gt;For the people working with code that has to do with video.&lt;/p&gt;</description><link>http://the.ornyx.net/post/15380699009</link><guid>http://the.ornyx.net/post/15380699009</guid><pubDate>Fri, 06 Jan 2012 11:30:34 +0800</pubDate><dc:creator>andthirdly</dc:creator></item><item><title>Don't be STUPID: GRASP SOLID!</title><description>&lt;a href="http://nikic.github.com/2011/12/27/Dont-be-STUPID-GRASP-SOLID.html"&gt;Don't be STUPID: GRASP SOLID!&lt;/a&gt;</description><link>http://the.ornyx.net/post/15354643610</link><guid>http://the.ornyx.net/post/15354643610</guid><pubDate>Fri, 06 Jan 2012 03:13:22 +0800</pubDate><dc:creator>andthirdly</dc:creator></item><item><title>iOS and Mac Development Link Roundup: December 2011 – Ole Begemann</title><description>&lt;a href="http://oleb.net/blog/2012/01/ios-and-mac-development-link-roundup-december-2011/"&gt;iOS and Mac Development Link Roundup: December 2011 – Ole Begemann&lt;/a&gt;: &lt;p&gt;Such a gem.&lt;/p&gt;</description><link>http://the.ornyx.net/post/15133342447</link><guid>http://the.ornyx.net/post/15133342447</guid><pubDate>Mon, 02 Jan 2012 02:31:49 +0800</pubDate><dc:creator>andthirdly</dc:creator></item><item><title>A Core Data Primer</title><description>&lt;p&gt;Everyone’s first encounter with Core Data would be through books and the occasional glance at the documentation. No one tells you what are the base tips in bullet points that you need to know. Having worked on Core Data for the past 9 months, I thought it’ll be a service to the community to at least commit something to Google’s memory.&lt;/p&gt;
&lt;ul&gt;&lt;li&gt;Everything except NSManagedObjectContext is thread safe.&lt;/li&gt;
&lt;li&gt;Create NSManagedObjectContext in new threads prior to using them. Pass them the NSPersistentStoreCoordinator of any NSManagedObjects across threads is fine.&lt;/li&gt;
&lt;li&gt;NSManagedObjectID is your friend. Always use it if you are doing threading.&lt;/li&gt;
&lt;li&gt;NSManagedObjectID is sometimes temporary. Use obtainPermanentObjectIDs to ensure that they are permanent. &lt;/li&gt;
&lt;li&gt;Getting a permanent ID might cost disk access so use wisely.&lt;/li&gt;
&lt;li&gt;Process cross context saving on the thread that the NSManagedObjectContext was created.&lt;/li&gt;
&lt;li&gt;Instrument’s time profiler is your friend to find where Core Data calls are taking a long time.&lt;/li&gt;
&lt;li&gt;Additionally, you can also get SQL statements that are generated as debug messages in console by turning on a flag.&lt;/li&gt;
&lt;li&gt;Use as little relationships as possible when fetching objects. Easier to fetch criteria based on the actual operating object and have the fetch also fetch all relationships.&lt;/li&gt;
&lt;li&gt;Sometimes it is easier to spin off a thread to fetch results and process them before calling the completion block with results.&lt;/li&gt;
&lt;li&gt;Have a manager to handle all Core Data fetching of objects instead of being smart and trying to have individual managed object subclasses handle everything.&lt;/li&gt;
&lt;li&gt;NSFetchedResultsController is sometimes a bitch when sending notifications of changed content. Don’t use UITableView’s reloadSectionsWithAnimation and its siblings when crashy happens.&lt;/li&gt;
&lt;li&gt;Don’t look into [NSManagedObjectContext registeredObjects] to get objects back. They might already have been deleted but still cached. &lt;a href="http://the.ornyx.net/post/4413076718/checkregisteredobjectsbefore?40aa0600"&gt;Stupid stupid me&lt;/a&gt;.&lt;/li&gt;
&lt;li&gt;Always test Core Data performance on device.&lt;/li&gt;
&lt;li&gt;Always do fetches on entities that you are filtering criteria for then use inverse relationships that are prefetched to get the data you really want (Basically think topsy turvy; less database joins the better because this is an object graph).&lt;/li&gt;
&lt;/ul&gt;</description><link>http://the.ornyx.net/post/13490832872</link><guid>http://the.ornyx.net/post/13490832872</guid><pubDate>Tue, 29 Nov 2011 13:57:00 +0800</pubDate><category>core data</category><category>primer</category><category>ios</category><category>mac</category><category>development</category><category>programming</category><category>tips</category><dc:creator>andthirdly</dc:creator></item><item><title>Check registeredObjects before excuteFetchRequest:Error:</title><description>&lt;p&gt;Not too sure if this is the right way of doing this, or if anyone has even tried, but be sure to check the registeredObjects NSArray of the NSManagedContext prior to fetching stuff. This of course only applies to SQLite backed stores, and this is done to reduce SQLite queries and inevitably disk I/O.&lt;/p&gt;
&lt;p&gt;You can effectively query the registeredObjects using almost the same predicate as your subclassed NSManagedObjects in order to ensure that the NSManagedObject you want is the same.&lt;/p&gt;
&lt;!-- more --&gt;
&lt;p&gt;Here’s some code to describe what I’m talking about.&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;+(ManagedLocation *)locationWithCoord:(CLLocationCoordinate2D)coord 
                       managedContext:(NSManagedObjectContext *)moc {

    // loop through registered objects for the type 
    // you want and if they match your criteria

    // blocks rock!

    NSSet *result = [[moc registeredObjects] objectsPassingTest:^BOOL(id obj, BOOL *stop) {
        if ([obj isKindOfClass:[ManagedLocation class]]) {
            if ((((ManagedLocation *)obj).latValue == coord.latitude) &amp;&amp; 
                (((ManagedLocation *)obj).lngValue == coord.longitude)) {
                return YES;
            }
        }
        return NO;
    }];

    // so if it doesn't exist. i guess we will have
    // to fetch off the sqlite store

    if ([result count] == 0) {
        result = [moc fetchObjectsForEntityName:[ManagedLocation entityName] 
                                  withPredicate:@"(lat == %lf) &amp;&amp; (lng == %lf)", coord.latitude, coord.longitude];
    }

    // final check for existence.
    //
    // if it doesn't exist, create a new ManagedObject
    //  and return it for population of values.

    if ([result count] == 1) {
        return [result anyObject];
    } else {
        NSEntityDescription *locEntity = [NSEntityDescription entityForName:[ManagedLocation entityName] 
                                                     inManagedObjectContext:moc];

        ManagedLocation *loc = [[[ManagedLocation alloc] initWithEntity:locEntity
                                         insertIntoManagedObjectContext:moc] autorelease];

        loc.latValue = coord.latitude;
        loc.lngValue = coord.longitude;

        return loc;
    }

}
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;So yeah. I was able to reduce by an order of magnitude, the time spent creating stuff.&lt;/p&gt;</description><link>http://the.ornyx.net/post/4413076718</link><guid>http://the.ornyx.net/post/4413076718</guid><pubDate>Thu, 07 Apr 2011 18:07:00 +0800</pubDate><category>core data</category><category>ios</category><category>mac</category><category>object graph</category><category>persistence</category><category>nsfetchrequest</category><category>nsmanagedobjectcontext</category><category>nsmanagedobject</category><dc:creator>andthirdly</dc:creator></item><item><title>fork();</title><description>&lt;p&gt;Some exciting things are happening and I’m at the brunt of it. Will reveal more when I can. All signs point to yes at this present moment and I’m really excited for the days to come.&lt;/p&gt;</description><link>http://the.ornyx.net/post/4340393285</link><guid>http://the.ornyx.net/post/4340393285</guid><pubDate>Mon, 04 Apr 2011 23:37:34 +0800</pubDate><category>fork</category><dc:creator>andthirdly</dc:creator></item><item><title>Event-ed NSURLRequest</title><description>&lt;p&gt;Have been very much inspired by the work on &lt;a href="http://www.nodejs.org"&gt;nodejs&lt;/a&gt;. For those of you who don’t know, nodejs is a basically a system to do Evented I/O using Google’s V8 Javascript engine.&lt;/p&gt;
&lt;p&gt;One such application of nodejs is the development of servers both HTTP or socket based that doesn’t require the spinning up of threads to handle connections and/or network events. Callbacks are assigned to events and when those events happen, the callbacks are ran. No threads, easy peasey, low overheads, etc.&lt;/p&gt;
&lt;p&gt;Currently there are 2 ways to do NSURLRequests. You can either wrap it around a thread and execute the operation synchronously or implement its delegate methods and have it run within the runloop.&lt;/p&gt;
&lt;p&gt;&lt;a href="https://github.com/echoz/EdventurousFramework/tree/master/Classes/JONetwork"&gt;JOURLRequest&lt;/a&gt; is an encapsulation of the NSURLRequest and its delegate methods to provide for a way to easily implement run loop based event-ed NSURLRequests. &lt;!-- more --&gt; In addition to handling the delegate methods and providing its own, it also implements a blocks based system on top of the delegate methods to make development easier for developers who already know blocks.&lt;/p&gt;
&lt;p&gt;The class also takes into account authentication via blocks or delegate methods to provide the right response to such situations. So its kinda event-ed in its own right.&lt;/p&gt;
&lt;p&gt;If deployed on an iOS project, it also handles situations where network reachability is dropped as well as handle when apps go into background or return from foreground and return statuses accordingly.&lt;/p&gt;
&lt;p&gt;It also provides static methods to create NSURLRequests based upon a dictionary of POST values. By default, if it detects a NSData within the dictionary, it’ll assume its a file upload and prepare the URLRequests accordingly. If not, it will use the less network intensive &lt;em&gt;x-www-form-urlencoded&lt;/em&gt; method.&lt;/p&gt;
&lt;p&gt;I’ve started using it for projects and the experience thus far is one of more responsive applications with lesser pains when it comes to dealing with events. (Blocks for the win!)&lt;/p&gt;
&lt;p&gt;Its still very much a work in progress, but the bulk of it is there and working. Using it is simply including the files in your project and including the headers where you want to use this class.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Todo:&lt;/strong&gt;&lt;/p&gt;
&lt;ul&gt;&lt;li&gt;Further parallel between delegate methods and blocks&lt;/li&gt;
&lt;li&gt;NSStream for data downloaded for large files&lt;/li&gt;
&lt;li&gt;Suggestions?&lt;/li&gt;
&lt;/ul&gt;</description><link>http://the.ornyx.net/post/4303897986</link><guid>http://the.ornyx.net/post/4303897986</guid><pubDate>Sun, 03 Apr 2011 13:38:58 +0800</pubDate><category>ios</category><category>development</category><category>mac</category><category>osx</category><category>xcode</category><category>network</category><category>nsurlrequest</category><category>evented</category><dc:creator>andthirdly</dc:creator></item><item><title>Not that available </title><description>&lt;p&gt;By a stroke of luck or fate, I’m doing lots of work for a startup on their iOS app. Pretty ambitious goals they have for what they want to accomplish and I’m pretty much on the same page with them to see this well executed.&lt;/p&gt;

&lt;p&gt;As such, I won’t be that available for additional work. Still, contact me if you think I can help.&lt;/p&gt;</description><link>http://the.ornyx.net/post/2812440921</link><guid>http://the.ornyx.net/post/2812440921</guid><pubDate>Wed, 19 Jan 2011 00:37:36 +0800</pubDate><category>work</category><category>freelance</category><category>parttime</category><category>lobangclub</category><dc:creator>andthirdly</dc:creator></item><item><title>"Typical developer. Listened to what the customer wants and did what they want anyway."</title><description>“Typical developer. Listened to what the customer wants and did what they want anyway.”&lt;br/&gt;&lt;br/&gt; - &lt;em&gt;Scott Stevenson (NSConf 2009)&lt;/em&gt;</description><link>http://the.ornyx.net/post/2302230349</link><guid>http://the.ornyx.net/post/2302230349</guid><pubDate>Tue, 14 Dec 2010 01:51:53 +0800</pubDate><dc:creator>andthirdly</dc:creator></item><item><title>Advanced iPhone Development Course on iTunes University</title><description>&lt;a href="http://iphonedevelopment.blogspot.com/2010/11/opengl-es-course-on-itunes-university.html"&gt;Advanced iPhone Development Course on iTunes University&lt;/a&gt;: &lt;p&gt;Should be a good follow up after finishing CS193P&lt;/p&gt;</description><link>http://the.ornyx.net/post/1619710324</link><guid>http://the.ornyx.net/post/1619710324</guid><pubDate>Sat, 20 Nov 2010 01:26:51 +0800</pubDate><dc:creator>andthirdly</dc:creator></item><item><title>How to be a Successful Software Engineer</title><description>&lt;a href="http://blog.darkhax.com/2010/11/16/how-to-be-a-successful-software-engineer"&gt;How to be a Successful Software Engineer&lt;/a&gt;: &lt;p&gt;Pretty much everything I see as essential&lt;/p&gt;</description><link>http://the.ornyx.net/post/1597564465</link><guid>http://the.ornyx.net/post/1597564465</guid><pubDate>Wed, 17 Nov 2010 12:56:02 +0800</pubDate><dc:creator>andthirdly</dc:creator></item><item><title>Bradley Wright: Using Dropbox as a Git repository</title><description>&lt;a href="http://tumblr.intranation.com/post/766290743/using-dropbox-git-repository"&gt;Bradley Wright: Using Dropbox as a Git repository&lt;/a&gt;: &lt;p&gt;Useful and its kinda free for collaborative private work.&lt;/p&gt;</description><link>http://the.ornyx.net/post/1539481994</link><guid>http://the.ornyx.net/post/1539481994</guid><pubDate>Thu, 11 Nov 2010 11:25:52 +0800</pubDate><dc:creator>andthirdly</dc:creator></item><item><title>Competitive Analysis</title><description>&lt;p&gt;&lt;img style="padding: 10px" src="http://f.cl.ly/items/2da19ec38d4ab06ea72f/Content.png"/&gt;&lt;/p&gt;

&lt;h2&gt;Background&lt;/h2&gt;

&lt;p&gt;Recently &lt;a href="http://itunes.apple.com/sg/app/ntu-bus/id397665016?mt=8"&gt;an app&lt;/a&gt; was posted to the App Store that had exactly similar functionality to my first foray into proper iOS development, &lt;a href="http://the.ornyx.net/traversity"&gt;Traversity&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;Initially, I welcomed the new entrant. That lasted until I actually saw the app for myself. Right off the bat within the App Store, I could clearly seem some form of plagiarism (or flattery, but that would require some credit where its due). 
&lt;!-- more --&gt;
The icon looked a little familiar in its general idea, but I suppose one can’t really knock that. Reading the App Store Description was what got to me. It was similar to what I’ve written, down to the form of the paragraphs with just slight modifications for poor grammar. At least the UI was different but I’ll get to that in a bit.&lt;/p&gt;

&lt;p&gt;&lt;img width="320" height="480" src="http://f.cl.ly/items/5e871b22965fb0d9e9a1/IMG_1389.PNG" align="left" style="padding: 5px"/&gt;&lt;img width="320" height="480" src="http://f.cl.ly/items/dc77a595483f1c8e5bc4/IMG_1388.PNG" style="padding: 5px"/&gt;&lt;/p&gt;

&lt;p&gt;To add to that, these people also posted flyers at all the bus stops around the campus. While there’s nothing wrong with that, there are strict campus rules with regards to what sort of notices you can post. Prior approval to post such notices are also required or they will be taken down.&lt;/p&gt;

&lt;p&gt;&lt;a href="http://cl.ly/7f37c8a4f21475b20b92"&gt;&lt;img src="http://f.cl.ly/items/06e731b16ff70d0e5820/IMG_20101026_114835.jpg" width="384" height="518"/&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Astute readers will be able to figure out for themselves how effective their ad is.&lt;/p&gt;

&lt;h2&gt;Technical&lt;/h2&gt;

&lt;p&gt;Naturally, I was curious how they pulled it off considering I did place my code on Github along with a liberal open source license. I wanted to know if people were even using my code to do something.&lt;/p&gt;

&lt;p&gt;Getting a rough idea as to how an app was written is not a difficult process. In fact, OS X provides a built in command line app to give you some basic information about your binary. This wonderful tool is &lt;em&gt;otool&lt;/em&gt;. Provided the code is not obfuscated to begin with.&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;wellhello:~ jeremy$ otool
Usage: otool [-fahlLDtdorSTMRIHvVcXm] &lt;object file&gt; ...
    -f print the fat headers
    -a print the archive header
    -h print the mach header
    -l print the load commands
    -L print shared libraries used
    -D print shared library id name
    -t print the text section (disassemble with -v)
    -p &lt;routine name&gt;  start dissassemble from routine name
    -s &lt;segname&gt; &lt;sectname&gt; print contents of section
    -d print the data section
    -o print the Objective-C segment
    -r print the relocation entries
    -S print the table of contents of a library
    -T print the table of contents of a dynamic shared library
    -M print the module table of a dynamic shared library
    -R print the reference table of a dynamic shared library
    -I print the indirect symbol table
    -H print the two-level hints table
    -v print verbosely (symbolically) when possible
    -V print disassembled operands symbolically
    -c print argument strings of a core file
    -X print no leading addresses or headers
    -m don't use archive(member) syntax
    -B force Thumb disassembly (ARM objects only)
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;Before you do that, you have to unpack the iPhone application file itself (*.ipa), but running it through &lt;em&gt;unzip&lt;/em&gt; (Yes, the .ipa file is actually a zip file that has been renamed). Once that’s done, the app should be in a &lt;em&gt;Payload&lt;/em&gt; directory in its own directory with a .app extension. Get in there.&lt;/p&gt;

&lt;p&gt;First obvious place to look is the libraries that are linked to the binary. This only involves dynamic libraries, but it does give a good idea as to the OS specific features that are used.&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;otool -L
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;&lt;img src="http://f.cl.ly/items/88fbb058bca45d833559/Screen%20shot%202010-11-06%20at%20PM%2012.18.44.PNG"/&gt;&lt;/p&gt;

&lt;p&gt;Calling &lt;em&gt;otool -l&lt;/em&gt; will get you the load commands that are used by the binary to load the specific sections of code into address space once its loaded. It also will get you the libraries that are loaded along with other tidbits of low level OS related information.&lt;/p&gt;

&lt;p&gt;The next thing you can pull out of a binary are all the Objective-C related information. In this case we’re interested in Objective-C classes. Remember to add the -B flag in order to force Thumb disassembly. Most iOS apps are not compiled with Thumb mode.&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;otool -Bo | grep OBJC
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;&lt;img src="http://f.cl.ly/items/bd4289cc26f1afe023de/Screen%20shot%202010-11-06%20at%20PM%2012.26.26.PNG"/&gt;&lt;/p&gt;

&lt;p&gt;Good enough to tell you about what’s used and what’s not.&lt;/p&gt;

&lt;p&gt;Finally, if you are really keen, a full disassembly is what will get you a good idea of how the app actually works. For this if you have access to &lt;a href="http://www.hex-rays.com/idapro/"&gt;IDA Pro&lt;/a&gt;, you are golden, if not &lt;em&gt;otool&lt;/em&gt; also does provide for some form of disassembly that lets you take a look at what commands are called.&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;otool -BVvt
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;&lt;img src="http://f.cl.ly/items/1206a51c4ad6c19f0c62/Screen%20shot%202010-11-06%20at%20PM%2012.30.19.PNG"/&gt;&lt;/p&gt;

&lt;p&gt;If you are just concerned with the methods that get are available in the binary you can just do simple pattern matching using &lt;em&gt;grep&lt;/em&gt;.&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;otool -BVvt | grep ^.*:$
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;&lt;img src="http://f.cl.ly/items/f9d557f2f28bc0dc05ca/Screen%20shot%202010-11-06%20at%20PM%2012.30.09.PNG"/&gt;&lt;/p&gt;

&lt;p&gt;You can grab the &lt;em&gt;otool&lt;/em&gt; output &lt;a href="http://cl.ly/3e273fa4de45e790c3df"&gt;here&lt;/a&gt;.&lt;/p&gt;

&lt;h2&gt;Analysis&lt;/h2&gt;

&lt;p&gt;From the disassembly, the binary doesn’t seem to use any of my open source code, which means the plagiarism stopped at the App store. However, the usage of RegexKitLite (not credited) did seem interesting to me because from the contents of the app, the data used is held in static plist files while the only dynamic content that is available (in the form of bus arrival timings) would not require regular expression matching. There is a web service you can query via POST for such information.&lt;/p&gt;

&lt;p&gt;I was curious enough to run the app through Wireshark to sniff the traffic that was sent. Steps to  work that are as follows,&lt;/p&gt;

&lt;ol&gt;&lt;li&gt;Share your Mac’s internet connection via Airport&lt;/li&gt;
&lt;li&gt;Have your iPhone connect to that airport connect&lt;/li&gt;
&lt;li&gt;Start Wireshark and have it sniff packets with a filter to prevent excessive information overload&lt;/li&gt;
&lt;li&gt;Run app, capture data&lt;/li&gt;
&lt;li&gt;&lt;a href="http://cl.ly/10ab7715493adcade394"&gt;Analyse&lt;/a&gt;&lt;/li&gt;
&lt;/ol&gt;&lt;p&gt;Basically, calls were being made to the mobile version of the shuttle bus timings site. From there, they would parse the HTML files using regular expressions to figure out the details of such timings.&lt;/p&gt;

&lt;p&gt;While I applaud the hard work, I am a tad disappointed that they did not bother to even do more research and realise that there was an &lt;a href="https://github.com/echoz/EdventurousFramework/tree/master/Classes/JONTUBusCore/"&gt;open source project&lt;/a&gt; that specifically grabs the same data they want and does it in a better way.&lt;/p&gt;

&lt;p&gt;Still all in all, having a competitor did bring some good. The number of downloads for Traversity spiked by a little from the usual amount the day their app launched. So all’s not that bad after all.&lt;/p&gt;

&lt;p&gt;&lt;a href="http://cl.ly/26cc4ef78703840f5cbd"&gt;&lt;img src="http://f.cl.ly/items/0e82d996c4b6fe89647b/Screen%20shot%202010-11-06%20at%20PM%2012.47.57.PNG" width="515" height="477"/&gt;&lt;/a&gt;&lt;/p&gt;</description><link>http://the.ornyx.net/post/1493734073</link><guid>http://the.ornyx.net/post/1493734073</guid><pubDate>Sat, 06 Nov 2010 12:49:29 +0800</pubDate><category>disassembly</category><category>otool</category><category>ios</category><category>app</category><category>iphone</category><category>snarky</category><category>competition</category><category>ntubus</category><category>traversity</category><dc:creator>andthirdly</dc:creator></item><item><title>Marco.org: WWDC session spotlight: API Design</title><description>&lt;a href="http://www.marco.org/1412264548"&gt;Marco.org: WWDC session spotlight: API Design&lt;/a&gt;: &lt;p&gt;&lt;a href="http://www.marco.org/1412264548"&gt;marco&lt;/a&gt;:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;One of the surprisingly useful sessions from WWDC 2010 was &lt;strong&gt;#138: API Design for Cocoa and Cocoa Touch&lt;/strong&gt;.&lt;/p&gt;
&lt;p&gt;The title wasn’t a very good expression of its content. It’s more fairly (albeit verbosely) titled, “Conventions, naming styles, and structural guidelines that Apple has used for the Cocoa…&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;For anyone who did not attend WWDC10 and is into API/backend design. This is a must watch. It comes highly recommended.&lt;/p&gt;</description><link>http://the.ornyx.net/post/1412317078</link><guid>http://the.ornyx.net/post/1412317078</guid><pubDate>Wed, 27 Oct 2010 11:53:25 +0800</pubDate><category>marco,</category><category>api</category><category>wwdc10</category><category>design</category><category>cocoa</category><category>cocoatouch</category><category>foundation</category><category>development</category><category>backend</category><dc:creator>andthirdly</dc:creator></item></channel></rss>

