<?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"
	>

<channel>
	<title>Lap Cat Software Blog</title>
	<atom:link href="http://lapcatsoftware.com/blog/feed/" rel="self" type="application/rss+xml" />
	<link>http://lapcatsoftware.com/blog</link>
	<description>Coding under the close supervision of cats</description>
	<pubDate>Mon, 25 Aug 2008 15:19:06 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.6</generator>
	<language>en</language>
			<item>
		<title>Cocoa memory management for smarties, Part 2: working with a nib</title>
		<link>http://lapcatsoftware.com/blog/2008/08/25/cocoa-memory-management-for-smarties-part-2-working-with-a-nib/</link>
		<comments>http://lapcatsoftware.com/blog/2008/08/25/cocoa-memory-management-for-smarties-part-2-working-with-a-nib/#comments</comments>
		<pubDate>Mon, 25 Aug 2008 15:19:06 +0000</pubDate>
		<dc:creator>Jeff</dc:creator>
		
		<category><![CDATA[Cocoa]]></category>

		<category><![CDATA[Vienna]]></category>

		<guid isPermaLink="false">http://lapcatsoftware.com/blog/?p=83</guid>
		<description><![CDATA[Well, it&#8217;s back to work for the moment. I was offered the VP slot, but I had to turn it down because they refused to accept the NDA: my name would be on the ticket, but nobody could talk about me publicly. Also, they wouldn&#8217;t get rid of the brown M&#38;Ms. I am waiting for [...]]]></description>
			<content:encoded><![CDATA[<p>Well, it&#8217;s back to work for the moment. I was offered the VP slot, but I had to turn it down because they refused to accept the NDA: my name would be on the ticket, but nobody could talk about me publicly. Also, they wouldn&#8217;t get rid of the brown M&amp;Ms. I am waiting for an offer by email from another guy, but I don&#8217;t hold out much hope, since I&#8217;m also waiting for him to learn how to use email.</p>
<p>In <a href="http://lapcatsoftware.com/blog/2008/07/28/cocoa-memory-management-for-smarties-part-1-release-me-not/" title="Cocoa memory management for smarties, Part 1: release me not">part 1 of this series</a> I talked about Cocoa memory management. For a summary of that post, load it in your browser, select all, and pass it to the Summarize system service. And now for something completely the same, in part 2 I&#8217;m going to talk about Cocoa memory management. As you all know, I love nibs. I find them to be a very human-friendly interface, much like the gom jabbar. A nib file contains archived Objective-C objects that are instantiated when the nib is instantiated, so their memory needs to be managed just as objects instantiated programmatically. Fortunately, if the nib File&#8217;s Owner is an <code>NSWindowController</code> or (new in Leopard) <code>NSViewController</code>, the File&#8217;s Owner takes care of the memory management automatically. Otherwise, it&#8217;s your job.</p>
<p>According to the <a href="http://developer.apple.com/documentation/Cocoa/Conceptual/LoadingResources/CocoaNibs/chapter_3_section_3.html#//apple_ref/doc/uid/10000051i-CH4-SW6" title="Nib Objet Retention">documentation</a>, <q>Objects in a nib file are initially created with a retain count of 1. As it rebuilds the object hierarchy, however, Cocoa autoreleases any objects that have a parent or owning object, such as views nested inside view hierarchies. By the time the nib-loading code is complete, only the top-level objects in the nib file have a positive retain count and no owning object. This makes the top-level objects a potential memory leak if your code does not assume responsibility for them.</q> If you look at your nib with the icon view in Interface Builder, the top-level objects consist of everything except the proxy objects such as File&#8217;s Owner, First Responder, and (new in Leopard) Application. Thus, top-level objects include not only windows but also contextual menus, array controllers, etc. For example, <a href="http://vienna-rss.sourceforge.net/vienna2.php" title="Vienna">Vienna&#8217;s</a> <code>MainMenu.nib</code>, pictured below, contains 14 top-level objects. (Kids, don&#8217;t try this at home.)</p>
<div><img src="http://lapcatsoftware.com/downloads/img/vienna-mainmenu-nib.png" alt="MainMenu.nib"/></div>
<p>By the way, the <code>MainMenu.nib</code> file, or whatever is specified by <code>NSMainNibFile</code> in <code>Info.plist</code>, is actually a special case, because the File&#8217;s Owner is <code>NSApplication</code> (or whatever is specified by <code>NSPrincipalClass</code>). You don&#8217;t need to worry about its memory management either, although the objects in the nib will usually remain in memory for the lifetime of the app. On termination, <code>NSApplication</code> may or may not choose to <code>release</code> those objects, as it pleases, so don&#8217;t depend on any code in <code>dealloc</code>. Cleaning up memory on app termination is like sweeping your floor right before a tornado hits.</p>
<p>In order to manage the memory of the nib&#8217;s top-level objects, you&#8217;ll need a reference to them. The method <code>-[NSNib instantiateNibWithOwner: topLevelObjects:]</code> is handy in this respect. The <a href="http://developer.apple.com/documentation/Cocoa/Reference/ApplicationKit/Classes/NSNib_Class/Reference/Reference.html#//apple_ref/occ/instm/NSNib/instantiateNibWithOwner:topLevelObjects:" title="NSNib Class Reference">documentation</a> of the <code>(NSArray **) topLevelObjects</code> argument may be a little confusing, though: <q>On input, a variable capable of holding an <code>NSArray</code> object. On output, this variable contains an autoreleased <code>NSArray</code> object containing the top-level objects from the nib file.</q> Although the <code>NSArray</code> is autoreleased, the top-level objects themselves are not. Each object in the <code>NSArray</code> will have a retain count of at least 2. Thus, after the <code>NSArray</code> is deallocated and releases its objects, they will each still have a retain count of at least 1. A typical way to handle this is as follows.</p>
<pre><code>
@interface MyObject : NSObject
{ NSArray * _topLevelObjects; }
@end

@implementation MyObject

-(id) init
{
	self = [super init];
	if (self)
	{
		NSNib * nib = [[[NSNib alloc] initWithNibNamed:@"MyNib" bundle:nil] autorelease];
		if (nib &amp;&amp; [nib instantiateNibWithOwner:self topLevelObjects:&amp;_topLevelObjects])
		{
			// The array is autoreleased, so we need to retain it.
			// Release the objects now so that they'll be deallocated along with the array.
			[[_topLevelObjects retain] makeObjectsPerformSelector:@selector(release)];
		}
	}
	return self;
}

-(void) dealloc
{
	[_topLevelObjects release];
	[super dealloc];
}

@end
</code></pre>
<p>If you use a different method to instantiate the nib, such as <code>+[NSBundle loadNibNamed:owner:]</code>, or if you don&#8217;t want to keep an array of the top-level objects, you&#8217;ll need to create an <code>IBOutlet</code> for each top-level object in the nib and release the objects in <code>dealloc</code> along with any other ivars.</p>
<p>A major caveat for do-it-yourself nib loading is that even if you take care to release your top-level objects, you can still get a memory leak if you use Cocoa bindings in your nib. This occurs when an object in the nib binds to the File&#8217;s Owner. The File&#8217;s Owner never gets deallocated in this case, and thus neither do the top-level objects. Again, <code>NSWindowController</code> and <code>NSViewController</code> already take care of this problem automatically, but you&#8217;ll need to deal with it if the File&#8217;s Owner is not one of those classes or their subclasses. Basically, there are three possible solutions:</p>
<ol>
<li>Unbind the bindings programmatically. You&#8217;ll need to do this elsewhere than the File Owner&#8217;s <code>dealloc</code>, which won&#8217;t get called unless you unbind.</li>
<li>Bind to a different object in the nib rather than to the File&#8217;s Owner.</li>
<li>Don&#8217;t use Cocoa bindings and nibs, because they&#8217;re teh suck.</li>
</ol>
]]></content:encoded>
			<wfw:commentRss>http://lapcatsoftware.com/blog/2008/08/25/cocoa-memory-management-for-smarties-part-2-working-with-a-nib/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Slow news day: favorite feeds updated</title>
		<link>http://lapcatsoftware.com/blog/2008/08/05/slow-news-day-favorite-feeds-updated/</link>
		<comments>http://lapcatsoftware.com/blog/2008/08/05/slow-news-day-favorite-feeds-updated/#comments</comments>
		<pubDate>Tue, 05 Aug 2008 16:46:40 +0000</pubDate>
		<dc:creator>Jeff</dc:creator>
		
		<category><![CDATA[Personal]]></category>

		<category><![CDATA[Vienna]]></category>

		<guid isPermaLink="false">http://lapcatsoftware.com/blog/?p=81</guid>
		<description><![CDATA[It&#8217;s been a while since I&#8217;ve updated my Favorite Feeds in the Downloads section of the sidebar of my blog front page. (Sounds like AppleScript, eh?) I would export from Vienna and update it every day, but I have to manually edit the .opml file first to remove embarrassing subscriptions such as porn and the [...]]]></description>
			<content:encoded><![CDATA[<p>It&#8217;s been a while since I&#8217;ve updated my Favorite Feeds in the Downloads section of the sidebar of my <a href="http://lapcatsoftware.com/blog/" title="Lap Cat Software Blog">blog front page</a>. (Sounds like AppleScript, eh?) I would export from <a href="http://vienna-rss.sourceforge.net/" title="Vienna">Vienna</a> and update it every day, but I have to manually edit the <code>.opml</code> file first to remove embarrassing subscriptions such as porn and the New York Times. For your convenience and amusement, the latest version is up now.</p>
]]></content:encoded>
			<wfw:commentRss>http://lapcatsoftware.com/blog/2008/08/05/slow-news-day-favorite-feeds-updated/feed/</wfw:commentRss>
		</item>
		<item>
		<title>C4: I&#8217;m a twit</title>
		<link>http://lapcatsoftware.com/blog/2008/08/02/c4-im-a-twit/</link>
		<comments>http://lapcatsoftware.com/blog/2008/08/02/c4-im-a-twit/#comments</comments>
		<pubDate>Sat, 02 Aug 2008 15:57:21 +0000</pubDate>
		<dc:creator>Jeff</dc:creator>
		
		<category><![CDATA[Personal]]></category>

		<category><![CDATA[Rogue Amoeba]]></category>

		<guid isPermaLink="false">http://lapcatsoftware.com/blog/?p=78</guid>
		<description><![CDATA[In September I&#8217;m traveling to Illinois, affectionately known as the Land of 10,000 Tollbooths, in order to attend C4, affectionately known as C4. This year will be C4&#8217;s third, signified by the title C4[2] because programmers are terrible counters. In any case, I&#8217;ll be making an appearance there for the first, or nilth, time. The [...]]]></description>
			<content:encoded><![CDATA[<p>In September I&#8217;m traveling to Illinois, affectionately known as the Land of 10,000 Tollbooths, in order to attend <a href="http://rentzsch.com/c4/" title="C4">C4</a>, affectionately known as C4. This year will be C4&#8217;s third, signified by the title C4[2] because programmers are terrible counters. In any case, I&#8217;ll be making an appearance there for the first, or <code>nil</code>th, time. The <a href="http://www.rogueamoeba.com/" title="Rogue Amoeba - Quality Audio Software for Mac OS X">Rogue Amoeba</a> army is planning to invade and conquer the conference, which we&#8217;ll subsequently rename to R4 (give or take an R, depending on how many of us show up).</p>
<p>The C4[2] online registration was unusual in requiring a <a href="http://twitter.com/home" title="Twitter">Twitter</a> ID. (@rentzsch I forgot to mention my special diet: Kobe fillet with Ch&acirc;teau Lafite.) As we all know, it&#8217;s against the law to ignore * in a web form. Thus, at the urging of my attorney, my agent, and my astrologer (all the same person), I signed up. Fedaykin, <a href="http://twitter.com/lapcat" title="Twitter / lapcat">follow me</a>!</p>
]]></content:encoded>
			<wfw:commentRss>http://lapcatsoftware.com/blog/2008/08/02/c4-im-a-twit/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Cocoa memory management for smarties, Part 1: release me not</title>
		<link>http://lapcatsoftware.com/blog/2008/07/28/cocoa-memory-management-for-smarties-part-1-release-me-not/</link>
		<comments>http://lapcatsoftware.com/blog/2008/07/28/cocoa-memory-management-for-smarties-part-1-release-me-not/#comments</comments>
		<pubDate>Mon, 28 Jul 2008 14:09:49 +0000</pubDate>
		<dc:creator>Jeff</dc:creator>
		
		<category><![CDATA[Cocoa]]></category>

		<guid isPermaLink="false">http://lapcatsoftware.com/blog/?p=76</guid>
		<description><![CDATA[If I were to offer one bit of advice to young programmers, I would say always &#8230; uh &#8230; never &#8230; forget to check your references. Not to mention your optics and your closet. Supposedly, the rules of Cocoa memory management are simple. Just set GCC_ENABLE_OBJC_GC = required and wait for the money to roll [...]]]></description>
			<content:encoded><![CDATA[<p>If I were to offer one bit of advice to young programmers, I would say always &hellip; uh &hellip; never &hellip; forget to check your references. Not to mention your optics and your closet. Supposedly, the rules of Cocoa memory management are simple. Just set <code>GCC_ENABLE_OBJC_GC = required</code> and wait for the money to roll in, right? For those who don&#8217;t enjoy the smell of Objective-C garbage collection, we have the tried-and-true manual rules. If you obtain a reference to an object by calling <code>+alloc</code>, <code>+allocWithZone:</code>, <code>+new</code>, or <code>-copy</code>, then the reference should remain valid indefinitely. A reference obtained in any other way is guaranteed to be valid only during the current event loop, so you&#8217;ll need to call <code>-retain</code> if the reference should remain valid for longer (e.g., if you want to store it in an instance variable). Each of the aforementioned method calls must be balanced at some point by a call to <code>-release</code>, if it&#8217;s safe for the object to deallocate immediately, or <code>-autorelease</code>, if you need the object to stick around until the end of the event loop.</p>
<p>In theory, these rules are foolproof. In practice, however, they&#8217;re not even expert-proof, as we see when the experts&#8217; apps unexpectedly quit. Thus, I believe that writing a series of posts exploring the subtleties of Cocoa memory management is a worthy endeavor. Moreover, I need to kill some time before football season kicks off.</p>
<p>Below is a simplified version of a crasher I once discovered and fixed. I&#8217;m only giving the bare essentials here. There was a lot of code involved, which made it more difficult to diagnose.</p>
<pre><code>
@implementation MYChild

-(void)doSomething
{
	...
	if (...)
	{
		[self setMyProperty:theValue];
	}
	if ([_myArray count] > 0)
	...
}

@end

@implementation MYParent

-(void)start
{
	...
	_myChild = [[MYChild alloc] init];
	[_myChild addObserver:self forKeyPath:@"myProperty" options:0 context:NULL];
	...
}

-(void)stop
{
	...
	[_myChild removeObserver:self forKeyPath:@"myProperty"];
	[_myChild release];
	_myChild = nil;
	...
}

-(void)observeValueForKeyPath:(NSString*)keyPath ofObject:(id)object change:(NSDictionary*)change context:(void*)context
{
	...
	[self stop];
	...
}

@end
</code></pre>
<p>Can you guess where the crash occurred? The particularly tricky part is that <code>observeValueForKeyPath:</code> is called by the Cocoa runtime rather than by the app&#8217;s own code, which means that if you&#8217;re not already aware of the key-value observer, the cause of the crash is rather mystifying.</p>
<p>My solution, by the way, was to replace <code>[_myChild release]</code> with <code>[_myChild autorelease]</code>. Ideally, you would probably access all ivars via getters and setters, but that&#8217;s a topic for a later post in this series.</p>
<p>In light of the above example, let&#8217;s now attempt to add to the rules of memory management:</p>
<ul>
<li>Rules are for suckers, simpletons, and lawyers.</li>
<li>No method is safe, only call paths are safe. You can&#8217;t look at a method in isolation and determine that it handles memory management properly. On the other hand, if you&#8217;re doing object-oriented encapsulation correctly, you shouldn&#8217;t have to worry about the implementation of other objects. The proper unit of analysis, I believe, is the entire call path within the object&#8217;s implementation.</li>
<li>Don&#8217;t release any method arguments. It&#8217;s almost always possible for the caller of <code>aMethod:</code> to have code such as <code>{ [anObject aMethod:anArgument]; [anArgument anotherMethod]; }</code>, so don&#8217;t invalidate <code>anArgument</code> during the current event loop. This is the reason why <code>-autorelease</code> was invented. (Also, it would be pretty silly to have <code>NSAutoreleasePool</code> without anything to go in the pool.</li>
</ul>
<p>As for the jello, I can explain. I was hungry and preparing for gravity to reverse.</p>
]]></content:encoded>
			<wfw:commentRss>http://lapcatsoftware.com/blog/2008/07/28/cocoa-memory-management-for-smarties-part-1-release-me-not/feed/</wfw:commentRss>
		</item>
		<item>
		<title>SECURITY ALERT: check your DNS servers</title>
		<link>http://lapcatsoftware.com/blog/2008/07/22/security-alert-check-your-dns-servers/</link>
		<comments>http://lapcatsoftware.com/blog/2008/07/22/security-alert-check-your-dns-servers/#comments</comments>
		<pubDate>Tue, 22 Jul 2008 06:13:51 +0000</pubDate>
		<dc:creator>Jeff</dc:creator>
		
		<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://lapcatsoftware.com/blog/?p=75</guid>
		<description><![CDATA[The full details of the infamous DNS vulnerability have been inadvertently disclosed. The post was pulled, but I can still read it in my Vienna database.
The vulnerability is bad, folks. I completely agree with the decision to keep the details secret while vendors patch their DNS servers. The secret is out now, though, so there&#8217;s [...]]]></description>
			<content:encoded><![CDATA[<p>The full details of the <a href="http://www.kb.cert.org/vuls/id/800113" title="Vulnerability Note VU#800113">infamous DNS vulnerability</a> have been <a href="http://www.matasano.com/log/1105/regarding-the-post-on-chargen-earlier-today/" title="Regarding The Post On Chargen Earlier Today">inadvertently disclosed</a>. The post was pulled, but I can still read it in my <a href="http://www.vienna-rss.org/vienna2.php" title="Vienna">Vienna</a> database.</p>
<p>The vulnerability is bad, folks. I completely agree with the decision to keep the details secret while vendors patch their DNS servers. The secret is out now, though, so there&#8217;s no time to wait. Perform the <a href="https://www.dns-oarc.net/oarc/services/dnsentropy" title="Web-based DNS Randomness Test">web-based test</a> of your DNS servers, and switch to different servers if the results are POOR. If you need to switch, one decent option is <a href="https://www.opendns.com/start" title="Enable OpenDNS">OpenDNS</a>.</p>
<p>Laptop users should be especially careful, because your ISP changes when you take your computer to different locations. Even if you pass the test at home, you may be vulnerable at the coffee shop. I recommend hard-coding DNS server IP addresses in the Network pane of System Preferences. You might also want to check the DNS settings of any routers you use.</p>
]]></content:encoded>
			<wfw:commentRss>http://lapcatsoftware.com/blog/2008/07/22/security-alert-check-your-dns-servers/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Compiler indirectives and metaphorical keypaths</title>
		<link>http://lapcatsoftware.com/blog/2008/07/02/compiler-indirectives-and-metaphorical-keypaths/</link>
		<comments>http://lapcatsoftware.com/blog/2008/07/02/compiler-indirectives-and-metaphorical-keypaths/#comments</comments>
		<pubDate>Wed, 02 Jul 2008 16:16:06 +0000</pubDate>
		<dc:creator>Jeff</dc:creator>
		
		<category><![CDATA[C]]></category>

		<category><![CDATA[Cocoa]]></category>

		<guid isPermaLink="false">http://lapcatsoftware.com/blog/?p=74</guid>
		<description><![CDATA[I am, like, literally ROTFRTFMIMHOLOLYMMVIIRCFUBAROTOH!
[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(likeNoWay:) name:@"ROTFRTFMIMHOLOLYMMVIIRCFUBAROTOH" object:nil];
A string literal is a sequence of characters enclosed in quote-unquote &#8216;\&#8221;quotation marks\&#8221;&#8216; (wiggles index and middle fingers). In the C programming language &#8212; so-named because its inventors lacked imagination &#8212; a string literal represents an array of char terminated by a null (or by a [...]]]></description>
			<content:encoded><![CDATA[<p>I am, like, literally ROTFRTFMIMHOLOLYMMVIIRCFUBAROTOH!</p>
<pre><code>[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(likeNoWay:) name:@"ROTFRTFMIMHOLOLYMMVIIRCFUBAROTOH" object:nil];</code></pre>
<p>A string literal is a sequence of characters enclosed in quote-unquote &#8216;\&#8221;quotation marks\&#8221;&#8216; (wiggles index and middle fingers). In the C programming language &mdash; so-named because its inventors lacked imagination &mdash; a string literal represents an array of <code>char</code> terminated by a null (or by a comma when the feeling&#8217;s not that strong). In the Objective-C programming language &mdash; otherwise known as The O.C. &mdash; a string literal in a compiler directive (e.g., <code>@"NSBirdJustFlewIntoMyWindowException"</code>) defines a constant <code>NSString</code> object.</p>
<p>Chris Hanson and Sanjay Samani have offered some <a href="http://chanson.livejournal.com/186135.html" title="Always use notification name globals, not literal strings!">excellent advice</a> about avoiding the use of these <code>NSString</code> literals in your method calls. The problem is that the compiler will accept pretty much any directive: with Objective-C 1.0 the compiler only warns about non-ASCII characters, and with Objective-C 2.0 it doesn&#8217;t even do that (for better or worse, but that&#8217;s a subject for a different post). Thus, if you happen to misspell a notification name, you&#8217;ll never know until your app misbehaves at runtime. <q>I&#8217;m sorry, Dave, I&#8217;m afraid I can&#8217;t do that.</q></p>
<p>I recommend replacing <code>NSString</code> literals with macros or constant variables (huh?) wherever spelling matters. (Spelling matters everywhere. I&#8217;ve seen some pretty bad method names.) Here&#8217;s a little trick for handling arbitrary keypaths:</p>
<pre>
#define KEY1 @"key1"
#define KEY2 @"key2"
#define KEY3 @"key3"
#define DOT @"."

[self valueForKeyPath:KEY1 DOT KEY2 DOT KEY3];
</pre>
<p>Unfortunately, we&#8217;re still at the mercy of misspellings in nib bindings. Yet another reason to do without nibs. But that&#8217;s also a subject for a <a href="http://lapcatsoftware.com/blog/2007/05/16/working-without-a-nib-part-1/" title="Working without a nib, Part 1">different post</a> and horse of a different color (dried poop).</p>
]]></content:encoded>
			<wfw:commentRss>http://lapcatsoftware.com/blog/2008/07/02/compiler-indirectives-and-metaphorical-keypaths/feed/</wfw:commentRss>
		</item>
		<item>
		<title>WordPress hacking: more comments in your feeds</title>
		<link>http://lapcatsoftware.com/blog/2008/06/15/wordpress-hacking-more-comments-in-your-feeds/</link>
		<comments>http://lapcatsoftware.com/blog/2008/06/15/wordpress-hacking-more-comments-in-your-feeds/#comments</comments>
		<pubDate>Sun, 15 Jun 2008 16:22:35 +0000</pubDate>
		<dc:creator>Jeff</dc:creator>
		
		<category><![CDATA[Vienna]]></category>

		<category><![CDATA[WordPress]]></category>

		<guid isPermaLink="false">http://lapcatsoftware.com/blog/?p=73</guid>
		<description><![CDATA[Unless you&#8217;re the Tolstoy of blogging &#8212; Does that even make sense? It&#8217;s like being the Gandhi of boxing &#8212; you&#8217;re probably not writing thirty WordPress posts a day. At my rate &#8212; the Def Leppard of blogging &#8212; I&#8217;m lucky to produce thirty a year (not counting my posts under the pen name &#8220;Arianna [...]]]></description>
			<content:encoded><![CDATA[<p>Unless you&#8217;re the Tolstoy of blogging &mdash; Does that even make sense? It&#8217;s like being the Gandhi of boxing &mdash; you&#8217;re probably not writing thirty <a href="http://wordpress.org/" title="WordPress">WordPress</a> posts a day. At my rate &mdash; the Def Leppard of blogging &mdash; I&#8217;m lucky to produce thirty a year (not counting my posts under the pen name &#8220;Arianna Huffington&#8221;). However, it is possible for one post to receive thirty comments in one day, especially if it contains provocative statements, e.g., <q>AppleScript, Die! Die! Die!</q> or <q>Please leave your comments below.</q> (This is assuming that you allow comments. And that someone reads your blog. And that the someone is not an NSA agent.)</p>
<p>Unfortunately, WordPress uses the same limit on the number of items in a syndicated feed for both the main post feed of the blog and for the comments feed of an individual post. By default, that limit is 10 items. Thus, if you try to follow an active comments thread on a post via the feed, you&#8217;re likely to miss comments (unless you&#8217;re one of the scourges of the internet who have their feed readers set to check for new articles every two minutes). It completely defeats the purpose of subscribing to the comments feed if you can&#8217;t track the comments with the feed. As a solution, you could raise the overall WordPress item limit, for both posts and comments, but this may increase the bandwidth of your web site significantly, enormously if you&#8217;re one of the angels of the internet who put the full text of their posts in the feed.</p>
<p>Fellow <a href="http://www.red-sweater.com/blog/" title="Red Sweater Blog">blogger</a> Daniel Jalkut of <a href="http://www.red-sweater.com/" title="Red Sweater - Amazing Mac Software">Red Sweater Software</a> has filed a <a href="http://trac.wordpress.org/ticket/7092" title="Should support separate setting for limiting comments feed">feature request</a> for a separate limit on comments feeds. However, you don&#8217;t need to wait until WordPress 2.7 for this request to be implemented, because you can implement it now by hacking your own WordPress installation. With Daniel&#8217;s help, I was able to get this to work in WordPress 2.5.1. You just need to modify one file, <code>wp-includes/query.php</code>. The ending of line 1380 in <code>query.php</code> is currently</p>
<pre>	DESC LIMIT " . get_option('posts_per_rss'));</pre>
<p>You need to modify it as below, replacing 100 with your desired item limit for comments feeds.</p>
<pre>	DESC LIMIT 100");</pre>
<p>You also need to modify the ending of line 1437, replacing</p>
<pre>	DESC LIMIT " . get_option('posts_per_rss');</pre>
<p>with</p>
<pre>	DESC LIMIT 100";</pre>
<p>That&#8217;s all there is to it! My usual disclaimers apply here: I take no responsibility for breaking anything of yours, for breaking anything of anyone else&#8217;s, or indeed for anything that happens in the universe. I do offer this guarantee: if my hack doesn&#8217;t work for you, I&#8217;ll gladly refund my consulting fee.</p>
<p>Please leave your comments below. AppleScript, Die! Die! Die!</p>
]]></content:encoded>
			<wfw:commentRss>http://lapcatsoftware.com/blog/2008/06/15/wordpress-hacking-more-comments-in-your-feeds/feed/</wfw:commentRss>
		</item>
		<item>
		<title>I&#8217;m a Rogue</title>
		<link>http://lapcatsoftware.com/blog/2008/06/07/im-a-rogue/</link>
		<comments>http://lapcatsoftware.com/blog/2008/06/07/im-a-rogue/#comments</comments>
		<pubDate>Sat, 07 Jun 2008 19:58:43 +0000</pubDate>
		<dc:creator>Jeff</dc:creator>
		
		<category><![CDATA[Apple]]></category>

		<category><![CDATA[Cocoa]]></category>

		<category><![CDATA[Personal]]></category>

		<category><![CDATA[Rogue Amoeba]]></category>

		<guid isPermaLink="false">http://lapcatsoftware.com/blog/?p=72</guid>
		<description><![CDATA[I&#8217;m delighted to announce that I&#8217;ve been hired as Rogue Amoeba Employee 008. (Employee 007 is Longwell, Justin Longwell.) I&#8217;ll be working on Rogue Amoeba&#8217;s apps as a software engineer, as well as providing comic relief. Thanks to Alex, Paul, and Quentin for this once-in-a-lifetime opportunity. My coworkers at Rogue Amoeba Software, LLC include fellow [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;m delighted to announce that I&#8217;ve been hired as <a href="http://www.rogueamoeba.com/utm/2008/06/06/welcome-another-new-rogue-amoeba/" title="Welcome Another New Rogue Amoeba!">Rogue Amoeba Employee 008</a>. (Employee 007 is Longwell, Justin Longwell.) I&#8217;ll be working on Rogue Amoeba&#8217;s apps as a software engineer, as well as providing comic relief. Thanks to Alex, Paul, and Quentin for this once-in-a-lifetime opportunity. My coworkers at <a href="http://rogueamoeba.com/" title="Rogue Amoeba - Quality Audio Software for Mac OS X">Rogue Amoeba Software, LLC</a> include fellow bloggers <a href="http://www.mikeash.com/?page=pyblog/" title="NSBlog">Mike Ash</a> and <a href="http://www.kickingbear.com/blog/" title="Kickingbear Blog">Guy English</a>. Together we form perhaps the most talented group of Mac programmers outside of <a href="http://www.apple.com/" title="Apple Inc.">Apple</a>. (Yes, I&#8217;m talking to you, Adobe and Microsoft.) Indeed, I haven&#8217;t seen such an array of stars in one place since the Ghostbusters music video.</p>
<p>I&#8217;ve joined Rogue Amoeba just in time to miss <a href="http://developer.apple.com/wwdc/" title="Apple Worldwide Developers Conference">WWDC &#8216;08</a>. In an <a href="http://lapcatsoftware.com/blog/2007/07/21/what-ive-been-doing-recently/" title="What I’ve been doing recently">earlier post</a>, I mentioned that I left <a href="http://www.karppinen.fi/" title="MK&amp;C">Marko Karppinen &amp; Co. LLC</a> just in time to miss WWDC &#8216;07. (I&#8217;ll make it there someday! <img src='http://lapcatsoftware.com/blog/wp-includes/images/smilies/icon_sad.gif' alt=':-(' class='wp-smiley' /> ) The question is, what have I been doing in the meantime? Backpacking through Europe? Rotting in Gitmo? Running for President? No, I&#8217;ve been working on super-secret projects for <a href="http://francistech.com/" title="Francis Technical Services = Mac Cocoa Developers">Francis Technical Services, LLC</a>. Although FTS is a little-known company, its software is well-known, at least inside Apple. For example, FTS is responsible for Radar, the Apple-internal Cocoa app that opens when employees click on the funny-looking <a href="rdar://problem/" title="rdar problem URL">rdar://problem/</a> URLs you often see. The number at the end of the URL corresponds to the problem ID of the bugs you file on the web with <a href="https://bugreport.apple.com/" title="Apple Bug Reporter">Apple Bug Reporter</a> (also known as RadarWeb). It&#8217;s useful to have one of these URLs available when communicating with Apple engineers, because their managers forbid them from lifting a finger without a Radar problem number.</p>
<p>While at FTS, I did some bug analysis for Radar: that is, analysis of bugs in Radar&#8217;s source code, not analysis of bugs in Radar&#8217;s database, to which as a contractor I had extremely limited access. However, I mostly worked on other projects, such as Radar&#8217;s sibling app Sonar. Apple&#8217;s <a href="http://developer.apple.com/technicalsupport/" title="Developer Technical Support">DTS</a> uses Sonar to communicate with <a href="http://developer.apple.com/" title="Apple Developer Connection">ADC</a> members (such as me!). If you&#8217;ve ever seen <a href="sonr://request/" title="sonr request URL">sonr://request/</a> URLs &mdash; the Mighty Quinn provides one in an <a href="http://lists.apple.com/archives/filesystem-dev/2008/Mar/msg00003.html" title="Re: Strange behavior iterating the directory tree of a volume">Apple Mailing List post</a> &mdash; those open in Sonar. (By the way, I&#8217;ve read all of your emails to DTS. No, you haven&#8217;t been accepted to the iPhone Developer Program. Stop whining.) Another project that I worked on was Merlin, an app for Apple&#8217;s Human Resources department. I think that Steve Jobs is doing an outstanding job at Apple, so before I left I used Merlin to double his annual salary.</p>
<p>I&#8217;d like to thank Dave Francis, the owner and founder of Francis Tech, for the opportunity to work there. Despite appearances, I&#8217;m not really the type to hop from job to job. I&#8217;ve just been looking for Mr. Right, LLC, a company to fall in love with, marry, and have baby apps with. (As for any other support claims, sorry Billie Jean.) I can see myself growing old with Rogue Amoeba. (Easy to see when you&#8217;re already old?) Besides, someone has to stick around and keep an eye on mikeash, stop him from taking over the world.</p>
<p>Now without further ado, please take out your credit card and buy some of our <a href="https://www.rogueamoeba.com/store/" title="Rogue Amoeba - Store">fine software</a>. As a special bonus for our Leopard customers, your purchase will be (code-)signed by your favorite Rogue Amoeba star.</p>
]]></content:encoded>
			<wfw:commentRss>http://lapcatsoftware.com/blog/2008/06/07/im-a-rogue/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Vienna not dead yet, but RIP Panther</title>
		<link>http://lapcatsoftware.com/blog/2008/06/01/vienna-not-dead-yet-but-rip-panther/</link>
		<comments>http://lapcatsoftware.com/blog/2008/06/01/vienna-not-dead-yet-but-rip-panther/#comments</comments>
		<pubDate>Sun, 01 Jun 2008 17:20:24 +0000</pubDate>
		<dc:creator>Jeff</dc:creator>
		
		<category><![CDATA[Apple]]></category>

		<category><![CDATA[Vienna]]></category>

		<guid isPermaLink="false">http://lapcatsoftware.com/blog/?p=71</guid>
		<description><![CDATA[Alas, poor Panther! I knew him, Horatio. You, Horatio, I don&#8217;t know so well, and you&#8217;re creeping me out. Why did you bring me to the cemetery?
The good news is that the first beta version of Vienna 2.3.0 is now available for download. Actually, it&#8217;s more of a zeta version, if you know what I [...]]]></description>
			<content:encoded><![CDATA[<p>Alas, poor Panther! I knew him, Horatio. You, Horatio, I don&#8217;t know so well, and you&#8217;re creeping me out. Why did you bring me to the cemetery?</p>
<p>The good news is that the first beta version of Vienna 2.3.0 is now available for <a href="http://sourceforge.net/project/showfiles.php?group_id=142635&amp;package_id=157268&amp;release_id=603612" title="Vienna 2.3.0.2300">download</a>. Actually, it&#8217;s more of a zeta version, if you know what I mean. (You don&#8217;t.) The changes from 2.2.2 are listed in the <a href="http://forums.cocoaforge.com/viewtopic.php?f=18&amp;t=17464" title="Vienna 2.3.0 beta available (not for OS X 10.3 Panther)">release notes</a>. The bad news is that Vienna 2.3 won&#8217;t run on Mac OS X Panther. Vienna 2.2.2 is the last release that supports Panther. That sucks, but if you&#8217;re still running 10.3.9, you probably don&#8217;t care much about the latest and greatest software anyway. Vienna 2.2.2 will continue to be available at <a href="http://sourceforge.net/project/showfiles.php?group_id=142635&amp;package_id=178858&amp;release_id=563940" title="Vienna 2.2.2">Sourceforge</a>.</p>
<p>Yeeha, Jester&#8217;s dead! I am dangerous, ice man.</p>
]]></content:encoded>
			<wfw:commentRss>http://lapcatsoftware.com/blog/2008/06/01/vienna-not-dead-yet-but-rip-panther/feed/</wfw:commentRss>
		</item>
		<item>
		<title>SECURITY ALERT: Mac OS X 10.5.2 subverts FileVault</title>
		<link>http://lapcatsoftware.com/blog/2008/05/10/security-alert-mac-os-x-1052-subverts-filevault/</link>
		<comments>http://lapcatsoftware.com/blog/2008/05/10/security-alert-mac-os-x-1052-subverts-filevault/#comments</comments>
		<pubDate>Sat, 10 May 2008 19:37:54 +0000</pubDate>
		<dc:creator>Jeff</dc:creator>
		
		<category><![CDATA[Apple]]></category>

		<category><![CDATA[Unix]]></category>

		<guid isPermaLink="false">http://lapcatsoftware.com/blog/2008/05/10/security-alert-mac-os-x-1052-subverts-filevault/</guid>
		<description><![CDATA[I apologize for not posting this earlier. I&#8217;ve been extremely busy lately, and I had discussed the issue with someone who said that he or she (he) was going to post about it (but hasn&#8217;t).
The security alert is for FileVault users running Mac OS X 10.5.2. You thought that FileVault encrypted your personal data, right? [...]]]></description>
			<content:encoded><![CDATA[<p>I apologize for not posting this earlier. I&#8217;ve been extremely busy lately, and I had discussed the issue with someone who said that he or she (he) was going to post about it (but hasn&#8217;t).</p>
<p>The security alert is for FileVault users running Mac OS X 10.5.2. You thought that FileVault encrypted your personal data, right? Wrong! In Mac OS X 10.5.2, the location of the <code>CFNetwork</code> caches was moved from <code>~/Library/Caches</code>, which is within your home directory and thus encrypted, to <code>/private/var/folders</code>, which is not within your home directory and thus not encrypted. This means that anyone with physical access to your hard drive could, for example, determine which URLs you&#8217;ve loaded, even if your computer is shut down.</p>
<p>Note that nothing about this change was mentioned in the <a href="http://support.apple.com/kb/HT1327" title="About the Mac OS X 10.5.2 Update">Mac OS X 10.5.2 release notes</a>.</p>
<p>For further reference on this issue, see the thread that began in the <a href="http://lists.apple.com/archives/Webkitsdk-dev/2008/Apr/msg00028.html" title="Leopard and Cache.db files">WebKit SDK</a> mailing list and was moved by me to the <a href="http://lists.apple.com/archives/Macnetworkprog/2008/Apr/msg00033.html" title="Re: Leopard and Cache.db files">Macintosh Network Programming</a> mailing list. Thanks to Eric Long, who noticed the change in the first place, and Ron Hunsinger, who performed testing that I was too lazy to do. (In my defense, I haven&#8217;t yet migrated my FileVault account from Tiger to Leopard, so the issue doesn&#8217;t affect me directly.)</p>
]]></content:encoded>
			<wfw:commentRss>http://lapcatsoftware.com/blog/2008/05/10/security-alert-mac-os-x-1052-subverts-filevault/feed/</wfw:commentRss>
		</item>
	</channel>
</rss>
