<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	>
<channel>
	<title>Comments on: Suicidal Code</title>
	<atom:link href="http://www.red-sweater.com/blog/371/suicidal-code/feed" rel="self" type="application/rss+xml" />
	<link>http://www.red-sweater.com/blog/371/suicidal-code</link>
	<description>Mac &#38; Technology Writings by Daniel Jalkut</description>
	<pubDate>Sat,  6 Sep 2008 05:05:08 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.6</generator>
		<item>
		<title>By: Matthias</title>
		<link>http://www.red-sweater.com/blog/371/suicidal-code#comment-132151</link>
		<dc:creator>Matthias</dc:creator>
		<pubDate>Wed, 18 Jul 2007 11:52:51 +0000</pubDate>
		<guid isPermaLink="false">http://www.red-sweater.com/blog/371/suicidal-code#comment-132151</guid>
		<description>I've released a class called ESSTimeTrialClass for this purpose. You can get it over at http://codebeach.org/code/show/36

Long time ago, maybe brian even took this as inspiration :)

Take care!</description>
		<content:encoded><![CDATA[<p>I&#8217;ve released a class called ESSTimeTrialClass for this purpose. You can get it over at <a href="http://codebeach.org/code/show/36" rel="nofollow">http://codebeach.org/code/show/36</a></p>
<p>Long time ago, maybe brian even took this as inspiration :)</p>
<p>Take care!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Christopher Humphries</title>
		<link>http://www.red-sweater.com/blog/371/suicidal-code#comment-132144</link>
		<dc:creator>Christopher Humphries</dc:creator>
		<pubDate>Wed, 18 Jul 2007 02:18:09 +0000</pubDate>
		<guid isPermaLink="false">http://www.red-sweater.com/blog/371/suicidal-code#comment-132144</guid>
		<description>Definitely bookmarking this idea</description>
		<content:encoded><![CDATA[<p>Definitely bookmarking this idea</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: vasi</title>
		<link>http://www.red-sweater.com/blog/371/suicidal-code#comment-132126</link>
		<dc:creator>vasi</dc:creator>
		<pubDate>Mon, 16 Jul 2007 22:42:34 +0000</pubDate>
		<guid isPermaLink="false">http://www.red-sweater.com/blog/371/suicidal-code#comment-132126</guid>
		<description>I think the 'safe' Cocoa way to do it is:

nowDate = [NSCalendarDate dateWithString: nowString calendarFormat: @"%b %e %Y" locale: nil];

I still think that dateWithString:... is somewhat underspecified, it's certainly not as clear as the POSIX strptime(3). But it seems to Do What I Mean in all the reasonable cases, so I guess that's good enough for me.

Just watch out for that Year Ten-Thousand bug! :-)</description>
		<content:encoded><![CDATA[<p>I think the &#8217;safe&#8217; Cocoa way to do it is:</p>
<p>nowDate = [NSCalendarDate dateWithString: nowString calendarFormat: @"%b %e %Y" locale: nil];</p>
<p>I still think that dateWithString:&#8230; is somewhat underspecified, it&#8217;s certainly not as clear as the POSIX strptime(3). But it seems to Do What I Mean in all the reasonable cases, so I guess that&#8217;s good enough for me.</p>
<p>Just watch out for that Year Ten-Thousand bug! :-)</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Daniel Jalkut</title>
		<link>http://www.red-sweater.com/blog/371/suicidal-code#comment-132125</link>
		<dc:creator>Daniel Jalkut</dc:creator>
		<pubDate>Mon, 16 Jul 2007 19:18:50 +0000</pubDate>
		<guid isPermaLink="false">http://www.red-sweater.com/blog/371/suicidal-code#comment-132125</guid>
		<description>E. Wing: Good to know! That should mean the technique is highly portable, even to other platforms.  Since the format is so predictable maybe the best thing is just to parse it myself, but of course I bet some standard Posix call will do it given the right template.</description>
		<content:encoded><![CDATA[<p>E. Wing: Good to know! That should mean the technique is highly portable, even to other platforms.  Since the format is so predictable maybe the best thing is just to parse it myself, but of course I bet some standard Posix call will do it given the right template.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: E. Wing</title>
		<link>http://www.red-sweater.com/blog/371/suicidal-code#comment-132124</link>
		<dc:creator>E. Wing</dc:creator>
		<pubDate>Mon, 16 Jul 2007 19:13:27 +0000</pubDate>
		<guid isPermaLink="false">http://www.red-sweater.com/blog/371/suicidal-code#comment-132124</guid>
		<description>__DATE__ is actually defined by the ANSI C standard and is not just a gcc extension. I don't think there is any locale support.

&lt;i&gt;
The date of translation of the preprocessing translation unit: a character 
string literal of the form"Mmm dd yyyy", where the names of the 
months are the same as those generated by the asctime function, and the 
first character of dd is a space character if the value is less than 10. If the 
date of translation is not available, an implementation-defined valid date 
shall be supplied. 
&lt;/i&gt;</description>
		<content:encoded><![CDATA[<p>__DATE__ is actually defined by the ANSI C standard and is not just a gcc extension. I don&#8217;t think there is any locale support.</p>
<p><i><br />
The date of translation of the preprocessing translation unit: a character<br />
string literal of the form&#8221;Mmm dd yyyy&#8221;, where the names of the<br />
months are the same as those generated by the asctime function, and the<br />
first character of dd is a space character if the value is less than 10. If the<br />
date of translation is not available, an implementation-defined valid date<br />
shall be supplied.<br />
</i></p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Rosyna</title>
		<link>http://www.red-sweater.com/blog/371/suicidal-code#comment-132090</link>
		<dc:creator>Rosyna</dc:creator>
		<pubDate>Sun, 15 Jul 2007 20:47:48 +0000</pubDate>
		<guid isPermaLink="false">http://www.red-sweater.com/blog/371/suicidal-code#comment-132090</guid>
		<description>&lt;a href="http://developer.apple.com/documentation/Cocoa/Reference/Foundation/Classes/NSDate_Class/Reference/Reference.html#//apple_ref/occ/clm/NSDate/dateWithNaturalLanguageString:" rel="nofollow"&gt; dateWithNaturalLanguageString:&lt;/a&gt; is completely dependent on the user's locale and settings. This means it may "mysteriously" fail in "really bad ways" depending on the user's settings. 

From the documentation:
"This method supports only a limited set of colloquial phrases, primarily in English. It may give unexpected results, and its use is strongly discouraged."</description>
		<content:encoded><![CDATA[<p><a href="http://developer.apple.com/documentation/Cocoa/Reference/Foundation/Classes/NSDate_Class/Reference/Reference.html#//apple_ref/occ/clm/NSDate/dateWithNaturalLanguageString:" rel="nofollow"> dateWithNaturalLanguageString:</a> is completely dependent on the user&#8217;s locale and settings. This means it may &#8220;mysteriously&#8221; fail in &#8220;really bad ways&#8221; depending on the user&#8217;s settings. </p>
<p>From the documentation:<br />
&#8220;This method supports only a limited set of colloquial phrases, primarily in English. It may give unexpected results, and its use is strongly discouraged.&#8221;</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Dan Grover</title>
		<link>http://www.red-sweater.com/blog/371/suicidal-code#comment-132062</link>
		<dc:creator>Dan Grover</dc:creator>
		<pubDate>Sat, 14 Jul 2007 21:01:39 +0000</pubDate>
		<guid isPermaLink="false">http://www.red-sweater.com/blog/371/suicidal-code#comment-132062</guid>
		<description>I thought that was a pretty cool idea since you mentioned in the other night. Thanks for posting the code!</description>
		<content:encoded><![CDATA[<p>I thought that was a pretty cool idea since you mentioned in the other night. Thanks for posting the code!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: David Van Brink</title>
		<link>http://www.red-sweater.com/blog/371/suicidal-code#comment-132047</link>
		<dc:creator>David Van Brink</dc:creator>
		<pubDate>Sat, 14 Jul 2007 03:49:09 +0000</pubDate>
		<guid isPermaLink="false">http://www.red-sweater.com/blog/371/suicidal-code#comment-132047</guid>
		<description>Nice!

I'll add my 1 cent to Dds Dunham &#38; Wareing -- in your startup, #if EXPIREAFTERDAYS print "this application will expire soon", to the console, and the splash screen.

You'll remember pretty quick about the suicide code then. Or someone else will, before the 14 days are up. Transparency is next to godliness.</description>
		<content:encoded><![CDATA[<p>Nice!</p>
<p>I&#8217;ll add my 1 cent to Dds Dunham &amp; Wareing &#8212; in your startup, #if EXPIREAFTERDAYS print &#8220;this application will expire soon&#8221;, to the console, and the splash screen.</p>
<p>You&#8217;ll remember pretty quick about the suicide code then. Or someone else will, before the 14 days are up. Transparency is next to godliness.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Daniel Jalkut</title>
		<link>http://www.red-sweater.com/blog/371/suicidal-code#comment-132040</link>
		<dc:creator>Daniel Jalkut</dc:creator>
		<pubDate>Sat, 14 Jul 2007 00:00:51 +0000</pubDate>
		<guid isPermaLink="false">http://www.red-sweater.com/blog/371/suicidal-code#comment-132040</guid>
		<description>rentzsch: Agreed and amended.</description>
		<content:encoded><![CDATA[<p>rentzsch: Agreed and amended.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: David Wareing</title>
		<link>http://www.red-sweater.com/blog/371/suicidal-code#comment-132039</link>
		<dc:creator>David Wareing</dc:creator>
		<pubDate>Fri, 13 Jul 2007 23:58:05 +0000</pubDate>
		<guid isPermaLink="false">http://www.red-sweater.com/blog/371/suicidal-code#comment-132039</guid>
		<description>To avoid leaving the code in, print out a release checklist and step through it methodically. Once your project is sizable and you have support files to build and add, temp files to remove, server data (e.g. RSS feeds) to upload, scripts to run, etc. then you don't really want to have to remember crucial stuff. Especially on release day (aka the busiest day of your year).

I find it helps to put all version-specific stuff like this in one header, so that as I go through the release checklist I can make several changes in one place.

One other thing:  you may want to check the user's clock.  It's far from uncommon for a user to report problems with beta time-outs or license validation due to their clock having been set back (either accidentally or otherwise). Get the build date and compare against the current date as returned from the OS. If there's more than a few days difference (remember your friends in future time zones!) then show a notice to the effect "check your clock" and exit.

Note: if you do this, don't be tempted to bypass __DATE__ by checking date stamps on arbitrary system or preference files. (They are not at all reliable.)

Note 2: be careful with __DATE__.  It represents the time of compilation of that source file only. Thus, if you put your check in some source file, compile it, and never recompile it before release, then __DATE__ will not reflect the overall build date of your project.</description>
		<content:encoded><![CDATA[<p>To avoid leaving the code in, print out a release checklist and step through it methodically. Once your project is sizable and you have support files to build and add, temp files to remove, server data (e.g. RSS feeds) to upload, scripts to run, etc. then you don&#8217;t really want to have to remember crucial stuff. Especially on release day (aka the busiest day of your year).</p>
<p>I find it helps to put all version-specific stuff like this in one header, so that as I go through the release checklist I can make several changes in one place.</p>
<p>One other thing:  you may want to check the user&#8217;s clock.  It&#8217;s far from uncommon for a user to report problems with beta time-outs or license validation due to their clock having been set back (either accidentally or otherwise). Get the build date and compare against the current date as returned from the OS. If there&#8217;s more than a few days difference (remember your friends in future time zones!) then show a notice to the effect &#8220;check your clock&#8221; and exit.</p>
<p>Note: if you do this, don&#8217;t be tempted to bypass __DATE__ by checking date stamps on arbitrary system or preference files. (They are not at all reliable.)</p>
<p>Note 2: be careful with __DATE__.  It represents the time of compilation of that source file only. Thus, if you put your check in some source file, compile it, and never recompile it before release, then __DATE__ will not reflect the overall build date of your project.</p>
]]></content:encoded>
	</item>
</channel>
</rss>

<!-- Dynamic Page Served (once) in 0.232 seconds -->
