<?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 for Anand Nalya</title>
	<atom:link href="http://anandnalya.com/comments/feed/" rel="self" type="application/rss+xml" />
	<link>http://anandnalya.com</link>
	<description>blog</description>
	<lastBuildDate>Thu, 31 Dec 2009 01:27:56 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9</generator>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
		<item>
		<title>Comment on Running Glassfish as a service on CentOS by Adam Vollrath</title>
		<link>http://anandnalya.com/2009/04/07/running-glassfish-as-a-service-on-centos/comment-page-1/#comment-35</link>
		<dc:creator>Adam Vollrath</dc:creator>
		<pubDate>Thu, 31 Dec 2009 01:27:56 +0000</pubDate>
		<guid isPermaLink="false">http://anandnalya.com/?p=56#comment-35</guid>
		<description>Thank you, I&#039;ve modified this script for our own Glassfish installations.</description>
		<content:encoded><![CDATA[<p>Thank you, I&#8217;ve modified this script for our own Glassfish installations.</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on Running Glassfish as a service on CentOS by anand</title>
		<link>http://anandnalya.com/2009/04/07/running-glassfish-as-a-service-on-centos/comment-page-1/#comment-23</link>
		<dc:creator>anand</dc:creator>
		<pubDate>Fri, 30 Oct 2009 10:31:40 +0000</pubDate>
		<guid isPermaLink="false">http://anandnalya.com/?p=56#comment-23</guid>
		<description>@nairdaen
fixed</description>
		<content:encoded><![CDATA[<p>@nairdaen<br />
fixed</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on Bing/Google toggle bookmarklet by dmdmdm</title>
		<link>http://anandnalya.com/2009/10/06/binggoogle-toggle-bookmarklet/comment-page-1/#comment-21</link>
		<dc:creator>dmdmdm</dc:creator>
		<pubDate>Tue, 13 Oct 2009 00:58:54 +0000</pubDate>
		<guid isPermaLink="false">http://anandnalya.com/?p=100#comment-21</guid>
		<description>Good article. Very well written</description>
		<content:encoded><![CDATA[<p>Good article. Very well written</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on Running Glassfish as a service on CentOS by nairdaen</title>
		<link>http://anandnalya.com/2009/04/07/running-glassfish-as-a-service-on-centos/comment-page-1/#comment-19</link>
		<dc:creator>nairdaen</dc:creator>
		<pubDate>Fri, 25 Sep 2009 21:18:55 +0000</pubDate>
		<guid isPermaLink="false">http://anandnalya.com/?p=56#comment-19</guid>
		<description>I think you&#039;re missing a &quot;-&quot; in the line &quot;#chkconfig -add glassfish&quot; so that it is &quot;#chkconfig --add glassfish&quot;</description>
		<content:encoded><![CDATA[<p>I think you&#8217;re missing a &#8220;-&#8221; in the line &#8220;#chkconfig -add glassfish&#8221; so that it is &#8220;#chkconfig &#8211;add glassfish&#8221;</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on Running Glassfish as a service on CentOS by JPill</title>
		<link>http://anandnalya.com/2009/04/07/running-glassfish-as-a-service-on-centos/comment-page-1/#comment-18</link>
		<dc:creator>JPill</dc:creator>
		<pubDate>Fri, 11 Sep 2009 05:29:35 +0000</pubDate>
		<guid isPermaLink="false">http://anandnalya.com/?p=56#comment-18</guid>
		<description>Thanks for that post, the only one</description>
		<content:encoded><![CDATA[<p>Thanks for that post, the only one</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on Embedding flash object in Facebook Apps (FBML) by tvance</title>
		<link>http://anandnalya.com/2009/01/15/embedding-flash-object-in-facebook-apps-fbml/comment-page-1/#comment-17</link>
		<dc:creator>tvance</dc:creator>
		<pubDate>Fri, 10 Jul 2009 02:14:53 +0000</pubDate>
		<guid isPermaLink="false">http://anandnalya.com/?p=30#comment-17</guid>
		<description>Thank you thank you thank you!!!  I could not figure out how to get Amazon widgets into my php page and you solved my problem!
thanks!!!!!</description>
		<content:encoded><![CDATA[<p>Thank you thank you thank you!!!  I could not figure out how to get Amazon widgets into my php page and you solved my problem!<br />
thanks!!!!!</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on Humanizing the time difference ( in django ) by Graham Ullrich</title>
		<link>http://anandnalya.com/2009/05/20/humanizing-the-time-difference-in-django/comment-page-1/#comment-10</link>
		<dc:creator>Graham Ullrich</dc:creator>
		<pubDate>Thu, 11 Jun 2009 04:03:45 +0000</pubDate>
		<guid isPermaLink="false">http://anandnalya.com/?p=70#comment-10</guid>
		<description>Hi Anand,

Thanks for sharing naturalTimeDifference(). I made two changes to improve your code, feel free to share with others. First, if the filter is passed a datetime.timedelta object it uses that instead of calculating datetime.now() - value. Second, with one additional conditional it now says &quot;1 hour ago&quot; for (7200 &gt; delta.seconds &gt;= 3600) and &quot;N hours ago&quot; for delta &gt;= 7200. Small changes for a grammatically correct result.

Here is the updated filter code:

def naturalTimeDifference(value):
    &quot;&quot;&quot;
    Finds the difference between the datetime value given and now()
    and returns appropriate humanize form
    &quot;&quot;&quot;
 
    from datetime import datetime, timedelta
    
    if isinstance(value, timedelta):
        delta = value
    elif isinstance(value, datetime):
        delta = datetime.now() - value
    else:
        delta = None
        
    if delta:
        if delta.days &gt; 6:
            return value.strftime(&quot;%b %d&quot;)                    # May 15
        if delta.days &gt; 1:
            return value.strftime(&quot;%A&quot;)                       # Wednesday
        elif delta.days == 1:
            return &#039;yesterday&#039;                                # yesterday
        elif delta.seconds &gt;= 7200:
            return str(delta.seconds / 3600 ) + &#039; hours ago&#039;  # 3 hours ago
        elif delta.seconds &gt;= 3600:
            return &#039;1 hour ago&#039;                               # 1 hour ago
        elif delta.seconds &gt;  MOMENT:
            return str(delta.seconds/60) + &#039; minutes ago&#039;     # 29 minutes ago
        else:
            return &#039;a moment ago&#039;                             # a moment ago
        return defaultfilters.date(value)
    else:
        return str(value)</description>
		<content:encoded><![CDATA[<p>Hi Anand,</p>
<p>Thanks for sharing naturalTimeDifference(). I made two changes to improve your code, feel free to share with others. First, if the filter is passed a datetime.timedelta object it uses that instead of calculating datetime.now() &#8211; value. Second, with one additional conditional it now says &#8220;1 hour ago&#8221; for (7200 &gt; delta.seconds &gt;= 3600) and &#8220;N hours ago&#8221; for delta &gt;= 7200. Small changes for a grammatically correct result.</p>
<p>Here is the updated filter code:</p>
<p>def naturalTimeDifference(value):<br />
    &#8220;&#8221;"<br />
    Finds the difference between the datetime value given and now()<br />
    and returns appropriate humanize form<br />
    &#8220;&#8221;"</p>
<p>    from datetime import datetime, timedelta</p>
<p>    if isinstance(value, timedelta):<br />
        delta = value<br />
    elif isinstance(value, datetime):<br />
        delta = datetime.now() &#8211; value<br />
    else:<br />
        delta = None</p>
<p>    if delta:<br />
        if delta.days &gt; 6:<br />
            return value.strftime(&#8220;%b %d&#8221;)                    # May 15<br />
        if delta.days &gt; 1:<br />
            return value.strftime(&#8220;%A&#8221;)                       # Wednesday<br />
        elif delta.days == 1:<br />
            return &#8216;yesterday&#8217;                                # yesterday<br />
        elif delta.seconds &gt;= 7200:<br />
            return str(delta.seconds / 3600 ) + &#8216; hours ago&#8217;  # 3 hours ago<br />
        elif delta.seconds &gt;= 3600:<br />
            return &#8216;1 hour ago&#8217;                               # 1 hour ago<br />
        elif delta.seconds &gt;  MOMENT:<br />
            return str(delta.seconds/60) + &#8216; minutes ago&#8217;     # 29 minutes ago<br />
        else:<br />
            return &#8216;a moment ago&#8217;                             # a moment ago<br />
        return defaultfilters.date(value)<br />
    else:<br />
        return str(value)</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on Running Glassfish as a service on CentOS by Diego</title>
		<link>http://anandnalya.com/2009/04/07/running-glassfish-as-a-service-on-centos/comment-page-1/#comment-2</link>
		<dc:creator>Diego</dc:creator>
		<pubDate>Wed, 22 Apr 2009 15:21:01 +0000</pubDate>
		<guid isPermaLink="false">http://anandnalya.com/?p=56#comment-2</guid>
		<description>GREAT! Justo lo que estaba buscando</description>
		<content:encoded><![CDATA[<p>GREAT! Justo lo que estaba buscando</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on Hello world! by Mr WordPress</title>
		<link>http://anandnalya.com/2008/10/15/hello-world/comment-page-1/#comment-1</link>
		<dc:creator>Mr WordPress</dc:creator>
		<pubDate>Thu, 16 Oct 2008 05:01:53 +0000</pubDate>
		<guid isPermaLink="false">http://anandnalya.com/?p=1#comment-1</guid>
		<description>Hi, this is a comment.&lt;br /&gt;To delete a comment, just log in and view the post&#039;s comments. There you will have the option to edit or delete them.</description>
		<content:encoded><![CDATA[<p>Hi, this is a comment.<br />To delete a comment, just log in and view the post&#039;s comments. There you will have the option to edit or delete them.</p>
]]></content:encoded>
	</item>
</channel>
</rss>

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