<?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"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
		>
<channel>
	<title>Comments on: How-To: Get human-friendly dates in Java using the Calendar class</title>
	<atom:link href="http://r3dux.org/2011/10/how-to-get-human-friendly-dates-in-java-using-the-calendar-class/feed/" rel="self" type="application/rss+xml" />
	<link>http://r3dux.org/2011/10/how-to-get-human-friendly-dates-in-java-using-the-calendar-class/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=how-to-get-human-friendly-dates-in-java-using-the-calendar-class</link>
	<description>A number-pimping side project from the valleys in *NEW* upside-down flavour.</description>
	<lastBuildDate>Mon, 13 May 2013 03:00:11 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=</generator>
	<item>
		<title>By: r3dux</title>
		<link>http://r3dux.org/2011/10/how-to-get-human-friendly-dates-in-java-using-the-calendar-class/#comment-7009</link>
		<dc:creator>r3dux</dc:creator>
		<pubDate>Thu, 06 Oct 2011 22:47:33 +0000</pubDate>
		<guid isPermaLink="false">http://r3dux.org/?p=5461#comment-7009</guid>
		<description><![CDATA[Ah - just figured it out: We were talking about diff posts.

I thought you meant the one with code in it, but you meant the one that I hadn&#039;t seen which had tripedp the spam filter - so the &quot;The class extends the Exception class&quot; comment was held for moderation.

Just approved it and deleted the dupe!

Normal service resumes!]]></description>
		<content:encoded><![CDATA[<p>Ah &#8211; just figured it out: We were talking about diff posts.</p>
<p>I thought you meant the one with code in it, but you meant the one that I hadn&#8217;t seen which had tripedp the spam filter &#8211; so the &#8220;The class extends the Exception class&#8221; comment was held for moderation.</p>
<p>Just approved it and deleted the dupe!</p>
<p>Normal service resumes!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: r3dux</title>
		<link>http://r3dux.org/2011/10/how-to-get-human-friendly-dates-in-java-using-the-calendar-class/#comment-7008</link>
		<dc:creator>r3dux</dc:creator>
		<pubDate>Thu, 06 Oct 2011 22:42:46 +0000</pubDate>
		<guid isPermaLink="false">http://r3dux.org/?p=5461#comment-7008</guid>
		<description><![CDATA[Um, I don&#039;t think you&#039;ve broken anything.. I reformated your post a little to add the &lt;pre lang=&quot;java&quot;&gt; and &lt;/pre&gt; tags, but that&#039;s it - it is as you entered it, or at least as the site saw it.

There&#039;s currently 85 comments on &lt;a href=&quot;http://r3dux.org/2009/07/how-to-hacksoftmod-your-wii-to-run-pretty-much-anything/&quot; rel=&quot;nofollow&quot;&gt;this post&lt;/a&gt; and it&#039;s working just fine, 8 post max? Non! =P]]></description>
		<content:encoded><![CDATA[<p>Um, I don&#8217;t think you&#8217;ve broken anything.. I reformated your post a little to add the &lt;pre lang=&#8221;java&#8221;&gt; and &lt;/pre&gt; tags, but that&#8217;s it &#8211; it is as you entered it, or at least as the site saw it.</p>
<p>There&#8217;s currently 85 comments on <a href="http://r3dux.org/2009/07/how-to-hacksoftmod-your-wii-to-run-pretty-much-anything/">this post</a> and it&#8217;s working just fine, 8 post max? Non! =P</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: shetboy</title>
		<link>http://r3dux.org/2011/10/how-to-get-human-friendly-dates-in-java-using-the-calendar-class/#comment-7006</link>
		<dc:creator>shetboy</dc:creator>
		<pubDate>Thu, 06 Oct 2011 12:27:55 +0000</pubDate>
		<guid isPermaLink="false">http://r3dux.org/?p=5461#comment-7006</guid>
		<description><![CDATA[Holy moly!  Did I just break your site?  Last comment added because the number went up.  Maxed out at 8 huh?]]></description>
		<content:encoded><![CDATA[<p>Holy moly!  Did I just break your site?  Last comment added because the number went up.  Maxed out at 8 huh?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: shetboy</title>
		<link>http://r3dux.org/2011/10/how-to-get-human-friendly-dates-in-java-using-the-calendar-class/#comment-7005</link>
		<dc:creator>shetboy</dc:creator>
		<pubDate>Thu, 06 Oct 2011 12:22:55 +0000</pubDate>
		<guid isPermaLink="false">http://r3dux.org/?p=5461#comment-7005</guid>
		<description><![CDATA[The class extends the Exception class, which implements the Serializable interface.

The use of this identifier is explained within this howto for &lt;a href=&quot;http://www.javapractices.com/topic/TopicAction.do?Id=45&quot; rel=&quot;nofollow&quot;&gt;Implementing Serializable&lt;/a&gt;.

Only implement Serializable when you have to!

Eclipse gives you a right-click option to resolve the compiler warning/issue, it basically auto-generates the code and unique number.]]></description>
		<content:encoded><![CDATA[<p>The class extends the Exception class, which implements the Serializable interface.</p>
<p>The use of this identifier is explained within this howto for <a href="http://www.javapractices.com/topic/TopicAction.do?Id=45">Implementing Serializable</a>.</p>
<p>Only implement Serializable when you have to!</p>
<p>Eclipse gives you a right-click option to resolve the compiler warning/issue, it basically auto-generates the code and unique number.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: r3dux</title>
		<link>http://r3dux.org/2011/10/how-to-get-human-friendly-dates-in-java-using-the-calendar-class/#comment-7004</link>
		<dc:creator>r3dux</dc:creator>
		<pubDate>Thu, 06 Oct 2011 10:22:38 +0000</pubDate>
		<guid isPermaLink="false">http://r3dux.org/?p=5461#comment-7004</guid>
		<description><![CDATA[Thread record broken! Crown rightfully provided! =D

I didn&#039;t put any exception code in because I was planning to get the date from a JCalendar &quot;date picker&quot;, so it should be pretty impossible to provide bad values and cause the conversion to fail.

Good point &amp; well made tho. Also, what&#039;s with the serialVersionUID?]]></description>
		<content:encoded><![CDATA[<p>Thread record broken! Crown rightfully provided! =D</p>
<p>I didn&#8217;t put any exception code in because I was planning to get the date from a JCalendar &#8220;date picker&#8221;, so it should be pretty impossible to provide bad values and cause the conversion to fail.</p>
<p>Good point &amp; well made tho. Also, what&#8217;s with the serialVersionUID?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: shetboy</title>
		<link>http://r3dux.org/2011/10/how-to-get-human-friendly-dates-in-java-using-the-calendar-class/#comment-7003</link>
		<dc:creator>shetboy</dc:creator>
		<pubDate>Thu, 06 Oct 2011 09:11:45 +0000</pubDate>
		<guid isPermaLink="false">http://r3dux.org/?p=5461#comment-7003</guid>
		<description><![CDATA[And another suggestion.  Where you have...
&lt;pre lang=&quot;java&quot;&gt;
default:
	friendly = &quot;BadDayValue&quot;;
	break;
&lt;/pre&gt;

...consider using your apps own exceptions...
&lt;pre lang=&quot;java&quot;&gt;
default:
	throw new InvalidDayValueWithinDate();
	break;
&lt;/pre&gt;

or,

&lt;pre lang=&quot;java&quot;&gt;
default:
	throw new InvalidDayValueWithinDate(&quot;Could not determine day for calendar &quot; + theDate.toString());
	break;
&lt;/pre&gt;

Because an invalid date would be an error in most cases.  Depends on the app though.

Note that InvalidDayValueWithinDate is defined by the app writer like...

&lt;pre lang=&quot;java&quot;&gt;
package org.r3dux.appname.exceptions;

public class InvalidDayValueWithinDate extends Exception {
	private static final long serialVersionUID = -911413132467019924L;

	public InvalidDayValueWithinDate(String s) {
		super(s);
	}
}&lt;/pre&gt;

// surely this must be a thread record now  :)]]></description>
		<content:encoded><![CDATA[<p>And another suggestion.  Where you have&#8230;</p>

<div class="wp_syntax"><table><tr><td class="code"><pre class="java" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">default</span><span style="color: #339933;">:</span>
	friendly <span style="color: #339933;">=</span> <span style="color: #0000ff;">&quot;BadDayValue&quot;</span><span style="color: #339933;">;</span>
	<span style="color: #000000; font-weight: bold;">break</span><span style="color: #339933;">;</span></pre></td></tr></table></div>

<p>&#8230;consider using your apps own exceptions&#8230;</p>

<div class="wp_syntax"><table><tr><td class="code"><pre class="java" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">default</span><span style="color: #339933;">:</span>
	<span style="color: #000000; font-weight: bold;">throw</span> <span style="color: #000000; font-weight: bold;">new</span> InvalidDayValueWithinDate<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
	<span style="color: #000000; font-weight: bold;">break</span><span style="color: #339933;">;</span></pre></td></tr></table></div>

<p>or,</p>

<div class="wp_syntax"><table><tr><td class="code"><pre class="java" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">default</span><span style="color: #339933;">:</span>
	<span style="color: #000000; font-weight: bold;">throw</span> <span style="color: #000000; font-weight: bold;">new</span> InvalidDayValueWithinDate<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;Could not determine day for calendar &quot;</span> <span style="color: #339933;">+</span> theDate.<span style="color: #006633;">toString</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
	<span style="color: #000000; font-weight: bold;">break</span><span style="color: #339933;">;</span></pre></td></tr></table></div>

<p>Because an invalid date would be an error in most cases.  Depends on the app though.</p>
<p>Note that InvalidDayValueWithinDate is defined by the app writer like&#8230;</p>

<div class="wp_syntax"><table><tr><td class="code"><pre class="java" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">package</span> <span style="color: #006699;">org.r3dux.appname.exceptions</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #000000; font-weight: bold;">public</span> <span style="color: #000000; font-weight: bold;">class</span> InvalidDayValueWithinDate <span style="color: #000000; font-weight: bold;">extends</span> <span style="color: #003399;">Exception</span> <span style="color: #009900;">&#123;</span>
	<span style="color: #000000; font-weight: bold;">private</span> <span style="color: #000000; font-weight: bold;">static</span> <span style="color: #000000; font-weight: bold;">final</span> <span style="color: #000066; font-weight: bold;">long</span> serialVersionUID <span style="color: #339933;">=</span> <span style="color: #339933;">-</span>911413132467019924L<span style="color: #339933;">;</span>
&nbsp;
	<span style="color: #000000; font-weight: bold;">public</span> InvalidDayValueWithinDate<span style="color: #009900;">&#40;</span><span style="color: #003399;">String</span> s<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
		<span style="color: #000000; font-weight: bold;">super</span><span style="color: #009900;">&#40;</span>s<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
	<span style="color: #009900;">&#125;</span>
<span style="color: #009900;">&#125;</span></pre></td></tr></table></div>

<p>// surely this must be a thread record now  <img src='http://r3dux.org/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
]]></content:encoded>
	</item>
	<item>
		<title>By: shetboy</title>
		<link>http://r3dux.org/2011/10/how-to-get-human-friendly-dates-in-java-using-the-calendar-class/#comment-6997</link>
		<dc:creator>shetboy</dc:creator>
		<pubDate>Wed, 05 Oct 2011 06:18:07 +0000</pubDate>
		<guid isPermaLink="false">http://r3dux.org/?p=5461#comment-6997</guid>
		<description><![CDATA[A great &lt;a href=&quot;http://kaioa.com/node/59&quot; rel=&quot;nofollow&quot;&gt;article&lt;/a&gt; on String vs StringBuffer vs StringBuilder, and what to use when you wish to concatenate

// Going for the thread post record]]></description>
		<content:encoded><![CDATA[<p>A great <a href="http://kaioa.com/node/59">article</a> on String vs StringBuffer vs StringBuilder, and what to use when you wish to concatenate</p>
<p>// Going for the thread post record</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: r3dux</title>
		<link>http://r3dux.org/2011/10/how-to-get-human-friendly-dates-in-java-using-the-calendar-class/#comment-6996</link>
		<dc:creator>r3dux</dc:creator>
		<pubDate>Wed, 05 Oct 2011 00:07:34 +0000</pubDate>
		<guid isPermaLink="false">http://r3dux.org/?p=5461#comment-6996</guid>
		<description><![CDATA[Your input is very much appreciated, mate - I&#039;m learning stuff, and at a fair old lick, too!

I thought that because I&#039;m not using the &lt;strong&gt;new&lt;/strong&gt; keyword at any point, any instance variables are placed on the stack, and get thrown away as soon as the method completes - no garbage collection necessary.

I believe you&#039;re right in that String concatenation (+= style) uses copy-by-value instead of copy-by-reference (which I assume StringBuffer or StringBuilder is capable of), but as above, no heap usage so method&#039;s stack container gets instantly deallocated on completion of the method and we get the memory back, like, BAAAAM! =D

That was my take on the memory management side of things from Head First Java, but it wouldn&#039;t surprise me in the least if I&#039;d got it a bit wrong.]]></description>
		<content:encoded><![CDATA[<p>Your input is very much appreciated, mate &#8211; I&#8217;m learning stuff, and at a fair old lick, too!</p>
<p>I thought that because I&#8217;m not using the <strong>new</strong> keyword at any point, any instance variables are placed on the stack, and get thrown away as soon as the method completes &#8211; no garbage collection necessary.</p>
<p>I believe you&#8217;re right in that String concatenation (+= style) uses copy-by-value instead of copy-by-reference (which I assume StringBuffer or StringBuilder is capable of), but as above, no heap usage so method&#8217;s stack container gets instantly deallocated on completion of the method and we get the memory back, like, BAAAAM! =D</p>
<p>That was my take on the memory management side of things from Head First Java, but it wouldn&#8217;t surprise me in the least if I&#8217;d got it a bit wrong.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: shetboy</title>
		<link>http://r3dux.org/2011/10/how-to-get-human-friendly-dates-in-java-using-the-calendar-class/#comment-6995</link>
		<dc:creator>shetboy</dc:creator>
		<pubDate>Tue, 04 Oct 2011 23:03:20 +0000</pubDate>
		<guid isPermaLink="false">http://r3dux.org/?p=5461#comment-6995</guid>
		<description><![CDATA[ha.. ok I submit to your victory.

This will also save you a lot of problems down the road...
Strings are IMMUTABLE.  Once set they cannot be changed.
Say for example I have a 1k string and I want to add 1 character to it, what happens is that the original 1k string gets copied to a completely new string with the extra character.  So now the memory contains just over 2k of strings until the garbage collector cleans up the unused and de-referenced strings.

Your code is creating new strings and moving object references from the old string to the new string all over the place in your example.

So what&#039;s the solution?  Use StringBuffer, or its newer cousin StringBuilder.  They are virtually the same in how they&#039;re used.  The serialize method example shows how to do this.


Sorry to rip on your code so much; I made exactly the same mistakes too, I just want to help you avoid the pitfalls more quickly than I resolved myself.]]></description>
		<content:encoded><![CDATA[<p>ha.. ok I submit to your victory.</p>
<p>This will also save you a lot of problems down the road&#8230;<br />
Strings are IMMUTABLE.  Once set they cannot be changed.<br />
Say for example I have a 1k string and I want to add 1 character to it, what happens is that the original 1k string gets copied to a completely new string with the extra character.  So now the memory contains just over 2k of strings until the garbage collector cleans up the unused and de-referenced strings.</p>
<p>Your code is creating new strings and moving object references from the old string to the new string all over the place in your example.</p>
<p>So what&#8217;s the solution?  Use StringBuffer, or its newer cousin StringBuilder.  They are virtually the same in how they&#8217;re used.  The serialize method example shows how to do this.</p>
<p>Sorry to rip on your code so much; I made exactly the same mistakes too, I just want to help you avoid the pitfalls more quickly than I resolved myself.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: r3dux</title>
		<link>http://r3dux.org/2011/10/how-to-get-human-friendly-dates-in-java-using-the-calendar-class/#comment-6994</link>
		<dc:creator>r3dux</dc:creator>
		<pubDate>Tue, 04 Oct 2011 23:00:13 +0000</pubDate>
		<guid isPermaLink="false">http://r3dux.org/?p=5461#comment-6994</guid>
		<description><![CDATA[That is actually really, really good - I think I&#039;m coming around to Joda-Time.]]></description>
		<content:encoded><![CDATA[<p>That is actually really, really good &#8211; I think I&#8217;m coming around to Joda-Time.</p>
]]></content:encoded>
	</item>
</channel>
</rss>
