<?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>CodeFab LLC&#187; Friends</title>
	<atom:link href="http://www.codefab.com/tag/friends/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.codefab.com</link>
	<description>News about fevered minds at CodeFab</description>
	<lastBuildDate>Tue, 20 Jul 2010 05:22:32 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.1</generator>
		<item>
		<title>CodeFab iPhone/iPad After Hours Party</title>
		<link>http://www.codefab.com/2010/06/01/codefab-iphoneipad-after-hours-party/</link>
		<comments>http://www.codefab.com/2010/06/01/codefab-iphoneipad-after-hours-party/#comments</comments>
		<pubDate>Tue, 01 Jun 2010 09:23:53 +0000</pubDate>
		<dc:creator>abc</dc:creator>
				<category><![CDATA[Cocoa]]></category>
		<category><![CDATA[CodeFab News]]></category>
		<category><![CDATA[Friends]]></category>
		<category><![CDATA[Geek Out]]></category>
		<category><![CDATA[Music]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[Software]]></category>
		<category><![CDATA[Training]]></category>
		<category><![CDATA[iPhone]]></category>
		<category><![CDATA[iPhone Training]]></category>
		<category><![CDATA[iPad]]></category>
		<category><![CDATA[Parties]]></category>

		<guid isPermaLink="false">http://www.codefab.com/2010/06/01/codefab-iphoneipad-after-hours-party/</guid>
		<description><![CDATA[Title: CodeFab iPhone/iPad After Hours PartyLocation: CodeFab iPhone Mansion SFLink out: Click hereDescription: Late night party for iPhone/iPad/Cocoa coders and all our crazy friends at the CodeFab iPhone Mansion in SF (1045 Divisidero St, SF CA) starting at 9:30. Big victorian mansion. Great music. Hot tub (clothing optional). Beer and tequila and late night munchies. [...]]]></description>
			<content:encoded><![CDATA[<p><strong>Title: </strong>CodeFab iPhone/iPad After Hours Party<br /><strong>Location: </strong>CodeFab iPhone Mansion SF<br /><strong>Link out: </strong><a href="http://whitepalacesf.com/" target="_blanck">Click here</a><br /><strong>Description: </strong>Late night party for iPhone/iPad/Cocoa coders and all our crazy friends at the CodeFab iPhone Mansion in SF (1045 Divisidero St, SF CA) starting at 9:30.  Big victorian mansion.  Great music.  Hot tub (clothing optional).  Beer and tequila and late night munchies.  Bring your latest masterpiece to show off to all!!  Let&#8217;s out-do last year&#8217;s crazy bash!<br /><strong>Start Time: </strong>21:00<br /><strong>Date: </strong>2010-06-08</p>
]]></content:encoded>
			<wfw:commentRss>http://www.codefab.com/2010/06/01/codefab-iphoneipad-after-hours-party/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>NSNotifications &#8211; Your friend except when they aren&#8217;t&#8230;</title>
		<link>http://www.codefab.com/2010/05/31/nsnotifications-your-friend-except-when-they-arent/</link>
		<comments>http://www.codefab.com/2010/05/31/nsnotifications-your-friend-except-when-they-arent/#comments</comments>
		<pubDate>Tue, 01 Jun 2010 04:02:19 +0000</pubDate>
		<dc:creator>abc</dc:creator>
				<category><![CDATA[Cocoa]]></category>
		<category><![CDATA[Geek Out]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[Software]]></category>
		<category><![CDATA[Training]]></category>
		<category><![CDATA[iPhone]]></category>
		<category><![CDATA[iPhone Training]]></category>
		<category><![CDATA[Class]]></category>
		<category><![CDATA[Development]]></category>
		<category><![CDATA[Friends]]></category>
		<category><![CDATA[iPad]]></category>
		<category><![CDATA[Parties]]></category>

		<guid isPermaLink="false">http://www.codefab.com/?p=392</guid>
		<description><![CDATA[So here is the question just asked of me: Is it better to have a single notification (name) sent out and have all interested parties check the user info to see if the notification contains information for them, or to have the differentiator encoded in the notification name, thus having potentially hundreds or thousands of [...]]]></description>
			<content:encoded><![CDATA[<p>So here is the question just asked of me:  <em>Is it better to have a single notification (name) sent out and have all interested parties check the user info to see if the notification contains information for them, or to have the differentiator encoded in the notification name, thus having potentially hundreds or thousands of &#8220;types&#8221; of notifications sent out, but have only one listener get the message?</em></p>
<p>Well, in the simplest cases, when there are only a few messages, and only a few listeners, and few objects that wake up to look at the userInfo to see if it is interesting, one might opt for the simpler programming / inheritance model and have very little code, reused via inheritance that does all the work.  E.G. all objects inheriting from BaseObject listen for message &#8220;foo&#8221; and then inherit the code for:<br />
<code><br />
-(void)fooNotification:(NSNotification *)notif {<br />
&nbsp;&nbsp;if ([self.id isEqual:[notif.userInfo objectForKey:@"id"]]) {<br />
&nbsp;&nbsp;&nbsp;&nbsp;[self handleFoo:userInfo]; // do something<br />
&nbsp;&nbsp;}<br />
}<br />
</code><br />
The BaseObject class has the id filter notification handler (above), a no-op handleFoo:, which sub-classes can override, and the sender always sends out the same &#8220;foo&#8221; notification, with the differentiator tucked away in the userInfo for the recipient.</p>
<p>Sounds good, no?  Lots of inheritance, code reuse, simplicity.  The &#8220;leaf-node&#8221; classes just implement handleFoo: if they need to.  All works great.  But where does this break down?</p>
<p>Say you had a thousand BaseObject subclass instances.  When they are created, they ask a Loader for some resource and listen for loaderDone Notifications.  Loader finishes each request, sends a notification, moves on to the next.  (You are using an NSOperationsQueue to manage your Loader pool, right?)  Instances get pinged after operations complete and one says &#8220;Hey!  That&#8217;s me!&#8221; and does something significant, like update a bit of UI, while the others pass.  The rub?  One thousand objects wake up and run a few lines of code for each one that does anything.  Code is simple, easy to test.  Low message dispatch cost.  Probably insignificant overhead on your spiffy new PowerMac.  Zero problem in testing with a few objects.  But on the iPhone / iPad this is 9,999 objects too many involved in handling the event.</p>
<p>What do you do?  </p>
<p>First is just good practice:  if you don&#8217;t care, don&#8217;t listen.  Don&#8217;t register to observe a notification until you are sure you care, then if you no longer need to listen, unregister.  For our pseudo-code, only listen between &#8220;I need a foo&#8221; and &#8220;I got a foo&#8221; &#8211; outside that take yourself out of the loop.  That can only help.</p>
<p>The real trick, when you see this pattern, is to find a way from our default case above, where response time depends on number of potentially interested objects, to a response time dependent on just number of actual interested objects.  In the base case, where we have N potentially interested objects and just 1 interested object, we are going from a fluctuating case, based on set size N, to a stable linear case.  This in turn leads to more predictable and scale-free (or close to it) response times.</p>
<p>(In our initial example above, response time is equal to &#8220;([number of objects] * ([filter time per object] + [message time per object])) + ([number of interested objects] * [handle time per object])&#8221;.  What we want is to only message the interested objects, so we can be &#8220;[number of interested objects] * ([message time per object] + [handle time per object])&#8221;.)</p>
<p>So what is the simple trick to do this?  Have the listening objects listen for a NSNotification with a name like:</p>
<p><code>&nbsp;&nbsp;NSString *notifName = [NSString stringWithFormat:@"foo-%@-notification", self.id];</code></p>
<p>and have the Loaders post matching notifications.  The observer lookup table will be a bit larger, with more messages registered, but the observer count will be the same.  The lookup will mostly be a hashed lookup based on the memory location of the notification name&#8217;s unique string, and on ObjC / Foundation, that kind of lookup is FAST for the set size we are looking at.  And even for large sets, we are so much better off paying the price to look up a single observer, than to have to run 4 lines of code in a very large number of objects. </p>
<p>Things that can make the bad case worse?  </p>
<ol>
<li>Side-effect cost: You never know what the cost is of asking an object you haven&#8217;t written yet a simple question.  (&#8220;My id?  Sure, that&#8217;s stored in my NIB file.  Which needs to be (re)loaded sometimes.  Which instantiates other objects.  Which do stuff.&#8221;)</li>
<li>Threads: An even worse cost is the per-object code that does something that launches or spans thread boundaries.  (&#8220;My id?  Let me fetch that in a new thread.  Or in the main thread, which could block stuff.&#8221;)  Opportunity for thread overload or lock-ups with contention for resources.</li>
</ol>
<p>Linear response is your friend.  Do a little extra work.  Easier to debug.  Easier to optimize.  Happier users.</p>
<p>Remember &#8211; your iPhone is like a 100mhz Pentium.  CPU cycles are your most precious resource.  And less executing code in less objects usually means less less memory, which is our second most precious resource.  Less work, less memory, app runs faster, users happier.  Everyone wins.</p>
<p><em><strong>NOTE:</strong> For everyone going to WWDC this year, CodeFab will be hosting several iPad/iPhone related events at the <a href="http://whitepalacesf.com/">SF iPhone Mansion</a> again.  On the Saturday and Sunday before WWDC we will be hosting a Mini iPad/iPhone DevCamp (<a href="http://www.eventbrite.com/event/668296894">Register Here</a>) in conjunction with our LA iPhone DevCamp/Developer Meetup partners.  We will also be hosting a fabulous iPhone Party on (tentative) Tuesday Night.  (Hope you remember last year&#8217;s blast!)<br />
</em></p>
]]></content:encoded>
			<wfw:commentRss>http://www.codefab.com/2010/05/31/nsnotifications-your-friend-except-when-they-arent/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>iTunes Genius Mixes</title>
		<link>http://www.codefab.com/2010/01/12/itunes-genius-mixes/</link>
		<comments>http://www.codefab.com/2010/01/12/itunes-genius-mixes/#comments</comments>
		<pubDate>Tue, 12 Jan 2010 08:09:28 +0000</pubDate>
		<dc:creator>abc</dc:creator>
				<category><![CDATA[CodeFab News]]></category>
		<category><![CDATA[Geek Out]]></category>
		<category><![CDATA[Music]]></category>
		<category><![CDATA[Software]]></category>
		<category><![CDATA[Art]]></category>
		<category><![CDATA[Friends]]></category>
		<category><![CDATA[Genius]]></category>
		<category><![CDATA[iTunes]]></category>

		<guid isPermaLink="false">http://www.codefab.com/?p=255</guid>
		<description><![CDATA[I love these things. I&#8217;m not a big Playlist builder and iTunes Genius Mixes are just what I need when I look up from coding and think &#8220;I need some music now!&#8221; Every now and then I stop and marvel / scratch my head at the interesting choices iTunes makes for my &#8220;Magic 12&#8243; Genius [...]]]></description>
			<content:encoded><![CDATA[<p>I love these things.  I&#8217;m not a big Playlist builder and iTunes Genius Mixes are just what I need when I look up from coding and think &#8220;I need some music now!&#8221;  Every now and then I stop and marvel / scratch my head at the interesting choices iTunes makes for my &#8220;Magic 12&#8243; Genius Mixes from the fairly random accretion of digital music collected over the last decade.  I have roughly similar collections on my three primary computers: Laptop (smallest, 20GB), MacPro (more, 30GB) and MediaServer (most, 80GB), but the Mix &#8220;Genres&#8221; vary in odd ways and do not represent what I would guess are the twelve biggest groupings of content.</p>
<p>On the MacPro (where I am sitting now) the Mixes are:<br />
<img src="http://www.codefab.com/wp-content/uploads/2010/01/iTunes-GeniusMixes.jpg" alt="" title="iTunes: Genius Mixes" width="475" height="380" class="aligncenter size-full wp-image-257" /><br />
<strong>• Electric Blues Mix</strong> &#8211; Based on: T-Bone Walker, B.B. King, Lightnin&#8217; Hopkins with Sonny Terry, Brownie McGhee, and Big Joe Williams &#038; others.<br />
<strong>• Electronica Mainstream Mix</strong> &#8211; Based on: Fatboy Slim, DJ Shadow, Chemical Brothers, &#038; others.<br />
<strong>• Classic R&#038;B Mix</strong> &#8211; Based on: James Brown, Parliament, Bootsy Collins, &#038; others.<br />
<strong>• Adult Alternative Mix</strong> &#8211; Based on: Ani Difranco, Tom Waits, Poi Dog Pondering, &#038; others.<br />
<strong>• Brit Pop Mi</strong>x &#8211; Based on: U2, R.E.M., Radiohead, &#038; others.<br />
<strong>• Punk Mix</strong> &#8211; Based on: Nirvana, Mojo Nixon, Alice In Chains, &#038; others.<br />
<strong>• Jazz Mix</strong> &#8211; Based on: Bill Evans, Ella Fitzgerald, Charlie Parker, &#038; others.<br />
<strong>• Old School Rap Mix</strong> &#8211; Based on: Public Enemy, Digital Underground, Beastie Boys, &#038; others.<br />
<strong>• New Wave Mix</strong> &#8211; Based on: Blondie, Talking Heads, The B-52&#8242;s, &#038; others. (Playing)<br />
<strong>• Indie Rock Mix</strong> &#8211; Based on: Pixies, Breeders, They Might Be Giants, &#038; others.<br />
<strong>• Classic Rock Mix</strong> &#8211; Based on: Family, The Rolling Stones, Eric Clapton, &#038; others.<br />
<strong>• Alternative Pop/Rock Mix</strong> &#8211; Based on: White Stripes, Porno for Pyros, Jane&#8217;s Addiction, &#038; others.</p>
<p>OK, not unreasonable, but some things pop out.  I have huge amounts of Blues, but at least half is acoustic &#8211; why Electronic Blues? I have lots of Electronica thanks to a mid-90&#8242;s fondness for Techno and lots suggestions from friend <a href="http://friday.com/bbum" target="bbum">Bill Bumgarner</a>, but the bulk is definitely NOT &#8220;Mainstream&#8221;. Adult Alternative?  Shoot me now.  At least it isn&#8217;t &#8220;Adult Contemporary&#8221;!  While I definitely have the required Brit Pop and lots of Indie and Alternative Pop/Rock, you could roll all three together, add the New Wave and Punk and still have less songs than are in my Jazz collection.  Why are they broken out like that while Jazz and Blues just get one Mix each?</p>
<p>Looking at the big media server (more than twice the content) the categories are oddly similar, but still oddly distributed: <strong>Jazz Mix, Classic R&#038;B Mix, Electric Blues Mix, Classic Rock Mix, Indie Rock Mix, New Age Mix, Electronica Mainstream Mix, Classical Mix, Grunge Mix, Brit Pop Mix, Hip Hop/Rap Mix, Art &#038; Experimental Rock Mix</strong>.  OK, Classical mostly lives here, so makes sense it gets a Mix, but there was plenty on my MacPro dev box.  I like the label of &#8220;Art &#038; Experimental Rock&#8221; but I cannot think of much that is on the main server that isn&#8217;t also on my other systems.  And if Alice In Chains and Nirvana fall under &#8220;Punk&#8221;, what is in Grunge?</p>
<p>There are some interesting quirks in the rest of the iTunes 9 Genius Mix implementation.  It seems odd that I cannot see into a Genius Mix to see what music matches, nor can I change from Grid to List view.  List view might have made capturing these lists less frustrating &#8211; Mix names and &#8220;based on&#8221; info only shows up as mouse-overs or for the currently playing Mix.  Why the magic twelve Mixes?  If I <em>must</em> be limited to twelve, I&#8217;d love to see a bigger list of possible MIxes and choose the twelve myself.  In List view we could even have more than 12 to choose from!  After some investigation, it seems the list of Mixes only changes after significant changes to the library and after &#8220;Genius Updates&#8221;.  I&#8217;d love to have a &#8220;Refresh&#8221; button to request twelve new lists chosen by my friend DJ Genius&#8230;</p>
<p>What&#8217;s in <em>YOUR</em> Genius Mix list?</p>
]]></content:encoded>
			<wfw:commentRss>http://www.codefab.com/2010/01/12/itunes-genius-mixes/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>We Will Miss You Greg Dawson</title>
		<link>http://www.codefab.com/2007/10/21/we-will-miss-you-greg-dawson/</link>
		<comments>http://www.codefab.com/2007/10/21/we-will-miss-you-greg-dawson/#comments</comments>
		<pubDate>Sun, 21 Oct 2007 23:25:45 +0000</pubDate>
		<dc:creator>abc</dc:creator>
				<category><![CDATA[CodeFab News]]></category>
		<category><![CDATA[Friends]]></category>
		<category><![CDATA[Art]]></category>
		<category><![CDATA[death]]></category>
		<category><![CDATA[heaven]]></category>
		<category><![CDATA[obituary]]></category>

		<guid isPermaLink="false">http://www.codefab.com/wordpress/index.php/2007/10/21/we-will-miss-you-greg-dawson/</guid>
		<description><![CDATA[Gregory Dawson, a friend of mine for many years and a friend of CodeFab&#8217;s, has passed on. Greg was surrounded by friends and family today when he and the doctors decided the time had come. We will all miss him very much. Greg had a rich and varied life, producing theater, radio and television, as [...]]]></description>
			<content:encoded><![CDATA[<p><img src="http://dawsonwork.com/paintings/images/toheaven.jpeg" alt="To Heaven" width="216" height="156" border="0" align="left" hspace="6"/>Gregory Dawson, a friend of mine for many years and a friend of CodeFab&#8217;s, has passed on.  Greg was surrounded by friends and family today when he and the doctors decided the time had come.  We will all miss him very much.</p>
<p>Greg had a rich and varied life, producing theater, radio and television, as well as the cabaret at the Rainbow Room at Rockefeller Center in New York. He was also the creative force and founding partner for the trend setting New York cabaret and restaurant The Ballroom in the 1980&#8242;s.</p>
<p>Greg was an artist and sculptor his whole life, with a prodigious and amazingly varied output.  He achieved a cult status in the 80&#8242;s and 90&#8242;s with elaborate tableaux of tiny sculpted wax and clay figurines, many depicting the wild side of New York night life of the era.  His recent work has been a joyful explosion of constructivist abstract sculpture and paintings which can be viewed at his website <a href="http://dawsonwork.com">DaWsoNWoRK</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.codefab.com/2007/10/21/we-will-miss-you-greg-dawson/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
