<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>zaphCoder &#187; Uncategorized</title>
	<atom:link href="http://zaph.com/blog/?cat=1&#038;feed=rss2" rel="self" type="application/rss+xml" />
	<link>http://zaph.com/blog</link>
	<description>All About Code</description>
	<lastBuildDate>Fri, 19 Aug 2016 18:02:31 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>How not to perform encryption</title>
		<link>http://zaph.com/blog/?p=1579</link>
		<comments>http://zaph.com/blog/?p=1579#comments</comments>
		<pubDate>Tue, 16 Aug 2016 15:58:34 +0000</pubDate>
		<dc:creator>zaph</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://zaph.com/blog/?p=1579</guid>
		<description><![CDATA[An answer from StackOverflow by a &#8220;Senior iOS Developer&#8221;: I just ended up taking two keypairs. One of them I used to encrypt the other one. Then I broke up the encrypted form into many shards and stashed them all &#8230; <a href="http://zaph.com/blog/?p=1579">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>An answer from StackOverflow by a &#8220;Senior iOS Developer&#8221;:</p>
<p>I just ended up taking two keypairs. One of them I used to encrypt the other one. Then I broke up the encrypted form into many shards and stashed them all over the place&#8230; in the cloud&#8230; on servers&#8230; in obfuscated strings on my app&#8230; etc.</p>
<p>None of the strings involved in the encryption or keys is in string or binary format in the compiled app. It is all generated programatically in a quite obfuscated fashion.</p>
<p>At runtime we use arcane math functions to build method names that call hidden methods around the app to assemble the first key, then we go get the encrypted shards of the second key from all over the internet and decrypt them with the first key, then we use the second key to decrypt the important client data.</p>
<p>Then we use a special sauce method where none of the code that&#8217;s involved in this obfuscation is anywhere in our repository. It gets loaded in dynamically at a special time. <img src='http://zaph.com/blog/wp-includes/images/smilies/icon_biggrin.gif' alt=':D' class='wp-smiley' />  That&#8217;s all I will say about that.</p>
<p>—and—</p>
<p>I know using someone else&#8217;s encrypting software would be faster and easier but this is more fun, plus it can run on my phone. &#8230; you are basically saying there are better ways to do it, and I&#8217;m just saying mine is not a bad way.</p>
]]></content:encoded>
			<wfw:commentRss>http://zaph.com/blog/?feed=rss2&#038;p=1579</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Code Quality</title>
		<link>http://zaph.com/blog/?p=1576</link>
		<comments>http://zaph.com/blog/?p=1576#comments</comments>
		<pubDate>Fri, 17 Apr 2015 12:40:26 +0000</pubDate>
		<dc:creator>zaph</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://zaph.com/blog/?p=1576</guid>
		<description><![CDATA[&#8220;I honestly didn&#39;t think you could even USE emoji in variable names. Or that there were so many different crying ones.&#8221;]]></description>
			<content:encoded><![CDATA[<p><img src="http://imgs.xkcd.com/comics/code_quality.png" border="0" width="673" height="234" style="float:left;" /></p>
<p><br clear=all><br /> &#8220;I honestly didn&#39;t think you could even USE emoji in variable names. Or that there were so many different crying ones.&#8221;</p>
]]></content:encoded>
			<wfw:commentRss>http://zaph.com/blog/?feed=rss2&#038;p=1576</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Open Office</title>
		<link>http://zaph.com/blog/?p=1566</link>
		<comments>http://zaph.com/blog/?p=1566#comments</comments>
		<pubDate>Wed, 18 Mar 2015 14:57:29 +0000</pubDate>
		<dc:creator>zaph</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://zaph.com/blog/?p=1566</guid>
		<description><![CDATA[]]></description>
			<content:encoded><![CDATA[<p><img src="http://zaph.com/blog/wp-content/uploads/2015/03/Screen-Shot-2015-03-18-at-11.02.59-AM.png" alt="Screen Shot 2015 03 18 at 11 02 59 AM" title="Screen Shot 2015-03-18 at 11.02.59 AM.png" border="0" width="607" height="666" style="float:left;" /></p>
]]></content:encoded>
			<wfw:commentRss>http://zaph.com/blog/?feed=rss2&#038;p=1566</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Offices to Clown Car</title>
		<link>http://zaph.com/blog/?p=1477</link>
		<comments>http://zaph.com/blog/?p=1477#comments</comments>
		<pubDate>Sat, 03 Aug 2013 17:14:02 +0000</pubDate>
		<dc:creator>zaph</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://zaph.com/blog/?p=1477</guid>
		<description><![CDATA[Headphones are the new office.]]></description>
			<content:encoded><![CDATA[<p><img src="http://zaph.com/blog/wp-content/uploads/2013/08/DilbertClownCar-1200x382.jpg" alt="Dilbert Clown Car" title="Dilbert Clown Car" border="0" width="600" height="191" /></p>
<p><a href="http://www.amazon.com/Bose®-QuietComfort®-Acoustic-Cancelling®-Headphones/dp/B0054JJ0QW">Headphones</a> are the new office.</p>
]]></content:encoded>
			<wfw:commentRss>http://zaph.com/blog/?feed=rss2&#038;p=1477</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Return multiple objects from a method</title>
		<link>http://zaph.com/blog/?p=1422</link>
		<comments>http://zaph.com/blog/?p=1422#comments</comments>
		<pubDate>Sun, 05 Aug 2012 18:36:46 +0000</pubDate>
		<dc:creator>zaph</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://zaph.com/blog/?p=1422</guid>
		<description><![CDATA[With the new literals in Xcode 4.4 (and presumably a version for iOS) returning multiple objects from a method becomes almost as easy as in Python. The last example below returns a tuple with very little ceremony in a manner &#8230; <a href="http://zaph.com/blog/?p=1422">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<div id="z-content">
<div class="z-font">
<div id="z-objc">
<br />
With the new literals in Xcode 4.4 (and presumably a version for iOS) returning multiple objects from a method becomes almost as easy as in Python. The last example below returns a tuple with very little ceremony in a manner reasonably close to Python. The only thing missing is automatic unboxing into multiple variables.</p>
<p>Below are seven methods running from the oldest form supported bt K&#038;R &#8220;C&#8221; so true tuple returning supported by the latest LLVM 4.x compiler and Xcode 4.4.</p>
<p>The oldest method is to return the results via reference variables<br />
This method violates Apple coding guidelines that returning results via method references is to be avoided whenever possible.</p>
<p class="p1"><span class="s11">@implementation</span> ViaReferenceVars</p>
<p class="p1">- (<span class="s11">void</span>)userName:(<span class="s12">NSString</span> **)userName userID:(<span class="s12">NSString</span> **)userID {</p>
<p class="p10"><span class="s1"><span>    </span></span>// &#8230;</p>
<p class="p1"><span>    </span>*userName = computedUserName;</p>
<p class="p1"><span>    </span>*userID <span>  </span>= computedUserID;</p>
<p class="p1">}</p>
<p class="p3"></p>
<p class="p1">- (<span class="s11">void</span>)test {</p>
<p class="p1"><span>    </span>NSString *userName;</p>
<p class="p1"><span>    </span>NSString *userID;</p>
<p class="p1"><span>    </span>[<span class="s11">self</span> <span class="s14">userName</span>:&amp;userName <span class="s14">userID</span>:&amp;userID];</p>
<p class="p11"><span class="s1"><span>    </span></span><span class="s15">NSLog</span><span class="s1">(</span>@&#8221;ViaReferenceVars &#8211; name: &#8216;%@&#8217;, userID: &#8216;%@&#8217;&#8221;<span class="s1">, userName, userID);</span></p>
<p class="p1">}</p>
<p class="p12">@end</p>
<p>Return via ivar properties<br />
Pollutes ivar space</p>
<p class="p12">@interface<span class="s1"> </span><span class="s16">ViaIVars</span><span class="s1"> ()</span></p>
<p class="p1"><span class="s11">@property</span> <span class="s12">NSString</span> *userNameProperty;</p>
<p class="p1"><span class="s11">@property</span> <span class="s12">NSString</span> *userIDProperty;</p>
<p class="p12">@end</p>
<p class="p3"></p>
<p class="p12">@implementation<span class="s1"> ViaIVars</span></p>
<p class="p3"></p>
<p class="p1">- (<span class="s11">void</span>)userNameUserID {</p>
<p class="p10"><span class="s1"><span>    </span></span>// &#8230;</p>
<p class="p1"><span>    </span><span class="s11">self</span>.<span class="s16">userNameProperty</span> = computedUserName;</p>
<p class="p1"><span>    </span><span class="s11">self</span>.<span class="s16">userIDProperty</span> <span>  </span>= computedUserID;</p>
<p class="p1">}</p>
<p class="p3"></p>
<p class="p1">- (<span class="s11">void</span>)test {</p>
<p class="p14"><span class="s1"><span>    </span>[</span><span class="s11">self</span><span class="s1"> </span>userNameUserID<span class="s1">];</span></p>
<p class="p11"><span class="s1"><span>    </span></span><span class="s15">NSLog</span><span class="s1">(</span>@&#8221;ViaIVars &#8211; name: &#8216;%@&#8217;, userID: &#8216;%@&#8217;&#8221;<span class="s1">, </span><span class="s11">self</span><span class="s1">.</span><span class="s16">userNameProperty</span><span class="s1">, </span><span class="s11">self</span><span class="s1">.</span><span class="s16">userIDProperty</span><span class="s1">);</span></p>
<p class="p1">}</p>
<p class="p12">@end</p>
<p>Return via class</p>
<p class="p1"><span class="s11">@interface</span> DataModel : <span class="s12">NSObject</span></p>
<p class="p1"><span class="s11">@property</span> <span class="s12">NSString</span> *userName;</p>
<p class="p1"><span class="s11">@property</span> <span class="s12">NSString</span> *userID;</p>
<p class="p12">@end</p>
<p class="p3"></p>
<p class="p12">@implementation<span class="s1"> DataModel</span></p>
<p class="p12">@end</p>
<p class="p3"></p>
<p class="p12">@implementation<span class="s1"> ViaClass</span></p>
<p class="p1">- (<span class="s16">DataModel</span> *)userNameUserID {</p>
<p class="p10"><span class="s1"><span>    </span></span>// &#8230;</p>
<p class="p1"><span>    </span><span class="s16">DataModel</span> *nameAndID = [<span class="s16">DataModel</span> <span class="s17">new</span>];</p>
<p class="p1"><span>    </span>nameAndID.<span class="s16">userName</span> = computedUserName;</p>
<p class="p1"><span>    </span>nameAndID.<span class="s16">userID</span> <span>  </span>= computedUserID;</p>
<p class="p3"></p>
<p class="p1"><span>    </span><span class="s11">return</span> nameAndID;</p>
<p class="p1">}</p>
<p class="p3"></p>
<p class="p1">- (<span class="s11">void</span>)test {</p>
<p class="p1"><span>    </span><span class="s16">DataModel</span> *dataModel = [<span class="s11">self</span> <span class="s14">userNameUserID</span>];</p>
<p class="p11"><span class="s1"><span>    </span></span><span class="s15">NSLog</span><span class="s1">(</span>@&#8221;ViaClass &#8211; name: &#8216;%@&#8217;, userID: &#8216;%@&#8217;&#8221;<span class="s1">, dataModel.</span><span class="s16">userName</span><span class="s1">, dataModel.</span><span class="s16">userID</span><span class="s1">);</span></p>
<p class="p1">}</p>
<p class="p12">@end</p>
<p>Return via class factory</p>
<p class="p1"><span class="s11">@interface</span> DataModel1 : <span class="s12">NSObject</span></p>
<p class="p1"><span class="s11">@property</span> <span class="s12">NSString</span> *userName;</p>
<p class="p1"><span class="s11">@property</span> <span class="s12">NSString</span> *userID;</p>
<p class="p1">+ (<span class="s11">id</span>)userName:(<span class="s12">NSString</span> *)userName userID:(<span class="s12">NSString</span> *)userID;</p>
<p class="p12">@end</p>
<p class="p3"></p>
<p class="p12">@implementation<span class="s1"> DataModel1</span></p>
<p class="p1">+ (<span class="s11">id</span>)userName:(<span class="s12">NSString</span> *)userName userID:(<span class="s12">NSString</span> *)userID {</p>
<p class="p1"><span>    </span><span class="s16">DataModel1</span> *nameAndID = [<span class="s16">DataModel1</span> <span class="s17">new</span>];</p>
<p class="p1"><span>    </span>nameAndID.<span class="s16">userName</span> = userName;</p>
<p class="p1"><span>    </span>nameAndID.<span class="s16">userID</span> <span>  </span>= userID;</p>
<p class="p1"><span>    </span><span class="s11">return</span> nameAndID;</p>
<p class="p1">}</p>
<p class="p12">@end</p>
<p class="p3"></p>
<p class="p1"><span class="s11">@implementation</span> ViaClassFactory</p>
<p class="p1">- (<span class="s16">DataModel1</span> *)userNameUserID {</p>
<p class="p10"><span class="s1"><span>    </span></span>// &#8230;</p>
<p class="p1"><span>    </span><span class="s11">return</span> [<span class="s16">DataModel1</span> <span class="s14">userName</span>:computedUserName <span class="s14">userID</span>:computedUserID];</p>
<p class="p1">}</p>
<p class="p3"></p>
<p class="p1">- (<span class="s11">void</span>)test {</p>
<p class="p1"><span>    </span><span class="s16">DataModel1</span> *dataModel = [<span class="s11">self</span> <span class="s14">userNameUserID</span>];</p>
<p class="p11"><span class="s1"><span>    </span></span><span class="s15">NSLog</span><span class="s1">(</span>@&#8221;ViaClassFactory &#8211; name: &#8216;%@&#8217;, userID: &#8216;%@&#8217;&#8221;<span class="s1">, dataModel.</span><span class="s16">userName</span><span class="s1">, dataModel.</span><span class="s16">userID</span><span class="s1">);</span></p>
<p class="p1">}</p>
<p class="p12">@end</p>
<p>Return via dictionary<br />
Meets Apple coding guidelines, messy</p>
<p class="p12">@implementation<span class="s1"> ViaDictionary</span></p>
<p class="p1">- (<span class="s12">NSDictionary</span> *)userNameUserID {</p>
<p class="p10">// &#8230;</p>
<p class="p1"><span>    </span><span class="s11">return</span> [<span class="s12">NSDictionary</span> <span class="s17">dictionaryWithObjectsAndKeys</span>:computedUserName, <span class="s18">@"name"</span>, computedUserID, <span class="s18">@"id"</span>, <span class="s11">nil</span>];</p>
<p class="p1">}</p>
<p class="p3"></p>
<p class="p1">- (<span class="s11">void</span>)test {</p>
<p class="p1"><span>    </span><span class="s12">NSDictionary</span> *nameAndID = [<span class="s11">self</span> <span class="s14">userNameUserID</span>];</p>
<p class="p11"><span class="s1"><span>    </span></span><span class="s15">NSLog</span><span class="s1">(</span>@&#8221;ViaDictionary &#8211; name: &#8216;%@&#8217;, userID: &#8216;%@&#8217;&#8221;<span class="s1">, [nameAndID </span><span class="s17">objectForKey</span><span class="s1">:</span>@"name"<span class="s1">], [nameAndID </span><span class="s17">objectForKey</span><span class="s1">:</span>@"id"<span class="s1">]);</span></p>
<p class="p1">}</p>
<p class="p12">@end</p>
<p>Return via dictionary literals<br />
Meets Apple coding guidelines, neat, concise</p>
<p class="p1"><span class="s11">@implementation</span> ViaDictionaryLiterals</p>
<p class="p1">- (<span class="s12">NSDictionary</span> *)userNameUserID {</p>
<p class="p10"><span class="s1"><span>    </span></span>// &#8230;</p>
<p class="p1"><span>    </span><span class="s11">return</span> <span class="s13">@{</span><span class="s18">@&#8221;name&#8221;</span>:computedUserName, <span class="s18">@&#8221;id&#8221;</span>:computedUserID<span class="s13">}</span>;</p>
<p class="p1">}</p>
<p class="p3"></p>
<p class="p1">- (<span class="s11">void</span>)test {</p>
<p class="p1"><span>    </span><span class="s12">NSDictionary</span> *nameAndID = [<span class="s11">self</span> <span class="s14">userNameUserID</span>];</p>
<p class="p11"><span class="s1"><span>    </span></span><span class="s15">NSLog</span><span class="s1">(</span>@&#8221;ViaDictionaryLiterals &#8211; name: &#8216;%@&#8217;, userID: &#8216;%@&#8217;&#8221;<span class="s1">, nameAndID[</span>@"name"<span class="s1">], nameAndID[</span>@"id"<span class="s1">]);</span></p>
<p class="p1">}</p>
<p class="p12">@end</p>
<p>Return via array (new style)<br />
Closest to python style</p>
<p class="p1"><span class="s11">@implementation</span> ViaArrayLiterals</p>
<p class="p1">- (<span class="s12">NSArray</span> *)userNameUserID {</p>
<p class="p10"><span class="s1"><span>    </span></span>// &#8230;</p>
<p class="p1"><span>    </span><span class="s11">return</span> <span class="s13">@[</span>computedUserName, computedUserID<span class="s13">]</span>;</p>
<p class="p1">}</p>
<p class="p3"></p>
<p class="p1">- (<span class="s11">void</span>)test {</p>
<p class="p1"><span>    </span><span class="s12">NSArray</span> *nameAndID = [<span class="s11">self</span> <span class="s14">userNameUserID</span>];</p>
<p class="p11"><span class="s1"><span>    </span></span><span class="s15">NSLog</span><span class="s1">(</span>@&#8221;ViaArrayLiterals &#8211; name: &#8216;%@&#8217;, userID: &#8216;%@&#8217;&#8221;<span class="s1">, nameAndID[</span><span class="s13">0</span><span class="s1">], nameAndID[</span><span class="s13">1</span><span class="s1">]);</span></p>
<p class="p1">}</p>
<p class="p12">@end</p>
</div>
</div>
</div>
]]></content:encoded>
			<wfw:commentRss>http://zaph.com/blog/?feed=rss2&#038;p=1422</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Medical costs</title>
		<link>http://zaph.com/blog/?p=1401</link>
		<comments>http://zaph.com/blog/?p=1401#comments</comments>
		<pubDate>Sun, 03 Jun 2012 21:42:23 +0000</pubDate>
		<dc:creator>zaph</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://zaph.com/blog/?p=1401</guid>
		<description><![CDATA[A month ago my wife was bitten by a stray cat. A series or Rabies shots was found necessary so we went the hospital for treatment. The initial treatment was a series of shots followed by subsequents shots at 3, &#8230; <a href="http://zaph.com/blog/?p=1401">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>A month ago my wife was bitten by a stray cat. A series or Rabies shots was found necessary so we went the hospital for treatment.</p>
<p>The initial treatment was a series of shots followed by subsequents shots at 3, 7, 14 and 28 days.</p>
<p>The hospital billed $18,621 in total, we were amazed when we saw the bills!<br />
The insurance provider paid $6,911 and denied $11,213 which the hospital accepted.<br />
We paid $497 in co-pay.</p>
<p>If we had not had insurance we would have had to pay the full amount of $18,621.</p>
<p>The interesting part is that because we had insurance the hospital accepted $11,213 less than if we had not had insurance. One has to wonder why a person paying out of his own pocket would be expected to pay that much more,over twice as much, for the same treatment.</p>
<p>So, is our medical system broken?</p>
]]></content:encoded>
			<wfw:commentRss>http://zaph.com/blog/?feed=rss2&#038;p=1401</wfw:commentRss>
		<slash:comments>8</slash:comments>
		</item>
		<item>
		<title>How to make your users hate you</title>
		<link>http://zaph.com/blog/?p=1384</link>
		<comments>http://zaph.com/blog/?p=1384#comments</comments>
		<pubDate>Thu, 12 Apr 2012 01:01:42 +0000</pubDate>
		<dc:creator>zaph</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://zaph.com/blog/?p=1384</guid>
		<description><![CDATA[Today I wanted to edit a file on my server. I tend to use Fetch so I fired it up, navigated to my WordPress directory, selected a .php file and clicked on the edit icon. Now I usually use BBEdit &#8230; <a href="http://zaph.com/blog/?p=1384">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<div id="z-content">
<div class="z-font">
<p>Today I wanted to edit a file on my server. I tend to use Fetch so I fired it up, navigated to my WordPress directory, selected a .php file and clicked on the edit icon. Now I usually use BBEdit so boy was I surprised when it opened in &#8220;Ready Lisp&#8221;. Wow! I don&#8217;t use &#8220;Ready Lisp&#8221;</p>
<p>I looked through Fetch for an option to set the default editor and could not fine it. I remember that there is sone &#8220;funny&#8221; non-obvious method to set the editor. Finally I transferred the file to my computer and looked at the Finder Info on the file. Sure enough there is was, Apple had decided that &#8220;Ready Lisp&#8221; was the default editor for .php files. Huh? OK, in Apple&#8217;s infinite wisdom it had set &#8220;Ready Lisp&#8221; to be the default application for .php files as best as I can figure just because I had installed &#8220;Ready Lisp&#8221; and tried it once. Bad Apple!</p>
<p>But, just because Apple does something stupid that should not make Fetch do something stupid. Right? Shouldn&#8217;t Fetch be able to establish its own file editor associations. It used to be able to but someone at Fetch thought better. Better?</p>
<p>The concept of &#8220;Least Surprise&#8221; was certainly violated here.</p>
</div>
</div>
]]></content:encoded>
			<wfw:commentRss>http://zaph.com/blog/?feed=rss2&#038;p=1384</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Sort times for NSMutableArray</title>
		<link>http://zaph.com/blog/?p=1345</link>
		<comments>http://zaph.com/blog/?p=1345#comments</comments>
		<pubDate>Sun, 08 Apr 2012 20:38:49 +0000</pubDate>
		<dc:creator>zaph</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://zaph.com/blog/?p=1345</guid>
		<description><![CDATA[The impetus behind this sort timing test is from the Coursers &#8220;algo&#8221; course and in particular the Quicksort section. One comment was that sorting was so fast that the cost need not even be considered. It seem that on an &#8230; <a href="http://zaph.com/blog/?p=1345">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<div id="z-content">
<div class="z-font">
<p>The impetus behind this sort timing test is from the Coursers &#8220;algo&#8221; course and in particular the Quicksort section. One comment was that sorting was so fast that the cost need not even be considered. It seem that on an iPad (version 3) sort times of short NSString objects in an NSArray are cheap for approximately n &lt; 10,000.</p>
<p><img src="http://zaph.com/blog/wp-content/uploads/2012/04/sort.png" border="0" width="600" height="403" style="float:left;" /><br />
<br clear=left></p>
<p>The NSMutablearray contains unique strings of 8 digits in random order. The sort was statement was:<br />
[ma sortUsingSelector:@selector(caseInsensitiveCompare:)];<br />
where ma is the afore mentioned NSMutablearray.</p>
<p>Times were calculated in 1,2,5 step increments from 10 to 500,000 items on an iPad (version 3).</p>
<p>The three lines on the graph are:<br />
Blue: the time in ms to sort the array<br />
Green: n log(n) for a visual slope reference<br />
Yellow: n^2 for a visual slope reference </p>
<p>It can be seen (and numerically verified) that the sort time is very slightly greater than n log(n). This is in agreement with sort times to be expected from the Quicksort algorithm.</p>
<p>The table below contain the sort times as well a n log(n and n^2 for comparison:</p>
<table>
<thead>
<tr>
<th align=right> items</th>
<th align=right>iPad (3) ms</th>
<th align=right>iPhone 3GS ms</th>
<th align=right>n log(n)</th>
<th align=right>            n^2</th>
</tr>
</thead>
<tbody>
<tr>
<td align=right>    10</td>
<td align=right>    0.104</td>
<td align=right>    0.488</td>
<td align=right>      1</td>
<td align=right>            100</td>
</tr>
<tr>
<td align=right>    20</td>
<td align=right>    0.081</td>
<td align=right>    0.161</td>
<td align=right>      3</td>
<td align=right>            400</td>
</tr>
<tr>
<td align=right>    50</td>
<td align=right>    0.185</td>
<td align=right>    0.699</td>
<td align=right>      8</td>
<td align=right>          2,500</td>
</tr>
<tr>
<td align=right>   100</td>
<td align=right>    0.415</td>
<td align=right>    0.814</td>
<td align=right>     20</td>
<td align=right>         10,000</td>
</tr>
<tr>
<td align=right>   200</td>
<td align=right>    0.948</td>
<td align=right>    1.827</td>
<td align=right>     46</td>
<td align=right>         40,000</td>
</tr>
<tr>
<td align=right>   500</td>
<td align=right>    0.963</td>
<td align=right>    5.373</td>
<td align=right>    135</td>
<td align=right>        250,000</td>
</tr>
<tr>
<td align=right>  1000</td>
<td align=right>    2.963</td>
<td align=right>   12.247</td>
<td align=right>    300</td>
<td align=right>      1,000,000</td>
</tr>
<tr>
<td align=right>  2000</td>
<td align=right>    6.464</td>
<td align=right>   27.365</td>
<td align=right>    660</td>
<td align=right>      4,000,000</td>
</tr>
<tr>
<td align=right>  5000</td>
<td align=right>   14.330</td>
<td align=right>   83.051</td>
<td align=right>  1,849</td>
<td align=right>     25,000,000</td>
</tr>
<tr>
<td align=right> 10000</td>
<td align=right>   41.180</td>
<td align=right>  182.578</td>
<td align=right>  4,000</td>
<td align=right>    100,000,000</td>
</tr>
<tr>
<td align=right> 20000</td>
<td align=right>  196.408</td>
<td align=right>  406.931</td>
<td align=right>  8,602</td>
<td align=right>    400,000,000</td>
</tr>
<tr>
<td align=right> 50000</td>
<td align=right>  565.032</td>
<td align=right> 1,140.463</td>
<td align=right> 23,495</td>
<td align=right>  2,500,000,000</td>
</tr>
<tr>
<td align=right>100000</td>
<td align=right>1,244.928</td>
<td align=right> 2,487.088</td>
<td align=right> 50,000</td>
<td align=right> 10,000,000,000</td>
</tr>
<tr>
<td align=right>200000</td>
<td align=right>2,703.192</td>
<td align=right> 5,396.767</td>
<td align=right>106,021</td>
<td align=right> 40,000,000,000</td>
</tr>
<tr>
<td align=right>500000</td>
<td align=right>7,476.271</td>
<td align=right>15,125.481</td>
<td align=right>284,949</td>
<td align=right>250,000,000,000</td>
</tr>
</tbody>
</table>
</div>
</div>
]]></content:encoded>
			<wfw:commentRss>http://zaph.com/blog/?feed=rss2&#038;p=1345</wfw:commentRss>
		<slash:comments>7</slash:comments>
		</item>
		<item>
		<title>Coursera UX in browser</title>
		<link>http://zaph.com/blog/?p=1333</link>
		<comments>http://zaph.com/blog/?p=1333#comments</comments>
		<pubDate>Sun, 08 Apr 2012 17:13:00 +0000</pubDate>
		<dc:creator>zaph</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://zaph.com/blog/?p=1333</guid>
		<description><![CDATA[Notice the size of the &#8220;Play/Pause&#8221; button relative the the &#8220;Previous&#8221; button (outlined in red). From this it seems obvious that the more important of the two is the &#8220;Previous&#8221; button. Also notice the close proximity of the two buttons &#8230; <a href="http://zaph.com/blog/?p=1333">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<div id="z-content">
<div class="z-font">
<p><img src="http://zaph.com/blog/wp-content/uploads/2012/04/Screen Shot 2012-04-08 at 12.46.27 PM.png" border="0" width="133" height="100" style="float:left;" /><br />
Notice the size of the &#8220;Play/Pause&#8221; button relative the the &#8220;Previous&#8221; button (outlined in red). From this it seems obvious that the more important of the two is the &#8220;Previous&#8221; button. Also notice the close proximity of the two buttons that have very dissimilar actions.</p>
<p>Typically one actually used the &#8220;play/pause&#8221;button very often and the &#8220;Previous&#8221; button only on rare occasions. Additionally the &#8220;Previous&#8221; button does not indicate what it will go back to.</p>
<p>In practice, particularly on an iPad, when one wants to pause the video to consider the content being presented, unless one is very careful one ends canceling out of the current video and being tossed back to the previous video which will start playing. The user will need to pause the video again, carefully not to be sent back even further. When desiring to resume the user will have to click the &#8220;Next&#8221; button which will cause the desired video to start playing—but at the beginning. Next the user will have to try and find the approximate place where he was when originally attempting to pause the video in-order to resume.</p>
<p>The solution is really simple, separate the two buttons either vertically or horizontally.</p>
<p>The take-away: The UX designer needs to do two things: 1) Actually try a real usage case himself and 2) Have a new user try the UX, without any prompting, and observer. Of course this may require an iteration of the UX.</p>
<p>Perverse as I am, I can&#8217;t wait to bring this up in the upcoming &#8220;Human-Computer Interaction&#8221; course. <img src='http://zaph.com/blog/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' /> </p>
</div>
</div>
]]></content:encoded>
			<wfw:commentRss>http://zaph.com/blog/?feed=rss2&#038;p=1333</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>UX in the Large</title>
		<link>http://zaph.com/blog/?p=1205</link>
		<comments>http://zaph.com/blog/?p=1205#comments</comments>
		<pubDate>Tue, 03 Apr 2012 15:51:05 +0000</pubDate>
		<dc:creator>zaph</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://zaph.com/blog/?p=1205</guid>
		<description><![CDATA[Sinage video (2 minutes) as great UX, excerpt from the BBC documentary The Tube This is a great example of well thought-out UX policy that is completely focused on the user with an overall benefit to the users as a &#8230; <a href="http://zaph.com/blog/?p=1205">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<div id="z-content">
<div class="z-font">
<a href="http://zaph.com/images/TubeUX.mp4">Sinage video</a> (2 minutes) as great UX, excerpt from the BBC documentary <cite>The Tube</cite> This is a great example of well thought-out UX policy that is completely focused on the user with an overall benefit to the users as a whole.
</div>
</div>
]]></content:encoded>
			<wfw:commentRss>http://zaph.com/blog/?feed=rss2&#038;p=1205</wfw:commentRss>
		<slash:comments>1</slash:comments>
<enclosure url="http://zaph.com/images/TubeUX.mp4" length="21182344" type="video/mp4" />
<enclosure url="http://zaph.com/images/TubeUX.mp4" length="21182344" type="video/mp4" />
		</item>
	</channel>
</rss>
