<?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: Boost library rocks!</title>
	<atom:link href="http://blog.nixternal.com/2007.12.26/boost-library-rocks/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.nixternal.com/2007.12.26/boost-library-rocks/</link>
	<description>Free Software Chicago Style: letting proprietary solutions sleep with the fishes</description>
	<pubDate>Sat, 30 Aug 2008 03:48:08 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.6.1</generator>
		<item>
		<title>By: RichB</title>
		<link>http://blog.nixternal.com/2007.12.26/boost-library-rocks/#comment-3525</link>
		<dc:creator>RichB</dc:creator>
		<pubDate>Sat, 29 Dec 2007 14:24:21 +0000</pubDate>
		<guid isPermaLink="false">http://blog.nixternal.com/2007.12.26/boost-library-rocks/#comment-3525</guid>
		<description>Correction: That's not a Zellers Congruence algorithm. It's from Tomohiko Sakamoto - see comp.lang.c faq for details.</description>
		<content:encoded><![CDATA[<p>Correction: That&#8217;s not a Zellers Congruence algorithm. It&#8217;s from Tomohiko Sakamoto - see comp.lang.c faq for details.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: RichB</title>
		<link>http://blog.nixternal.com/2007.12.26/boost-library-rocks/#comment-3524</link>
		<dc:creator>RichB</dc:creator>
		<pubDate>Sat, 29 Dec 2007 14:06:02 +0000</pubDate>
		<guid isPermaLink="false">http://blog.nixternal.com/2007.12.26/boost-library-rocks/#comment-3524</guid>
		<description>JavaScript version using Zeller's Congruence (doesn't anyone read the comp.lang.c FAQ nowadays?). I haven't timed it, but it's on the order of milliseconds:

window.Zeller={};

Zeller.getDayOfWeek = function(y, m, d) {
  var t = [0,3,2,5,0,3,5,1,4,6,2,4];
  y-=m&#60;3;
  return (y+Math.floor(y/4)-Math.floor(y/100)+Math.floor(y/400)+t[m-1]+d)%7;
}

var sundayCount=0;

for(var i=1901; i&#60;=2000; i++) {
  for(var j=1; j&#60;=12; j++) {
    if(Zeller.getDayOfWeek(i, j, 1)==0) {
      sundayCount++;
    }
  }
}
document.write("Number of sundays between 1901-01-01 and 2000-12-31 is " + sundayCount);</description>
		<content:encoded><![CDATA[<p>JavaScript version using Zeller&#8217;s Congruence (doesn&#8217;t anyone read the comp.lang.c FAQ nowadays?). I haven&#8217;t timed it, but it&#8217;s on the order of milliseconds:</p>
<p>window.Zeller={};</p>
<p>Zeller.getDayOfWeek = function(y, m, d) {<br />
  var t = [0,3,2,5,0,3,5,1,4,6,2,4];<br />
  y-=m&lt;3;<br />
  return (y+Math.floor(y/4)-Math.floor(y/100)+Math.floor(y/400)+t[m-1]+d)%7;<br />
}</p>
<p>var sundayCount=0;</p>
<p>for(var i=1901; i&lt;=2000; i++) {<br />
  for(var j=1; j&lt;=12; j++) {<br />
    if(Zeller.getDayOfWeek(i, j, 1)==0) {<br />
      sundayCount++;<br />
    }<br />
  }<br />
}<br />
document.write(&#8221;Number of sundays between 1901-01-01 and 2000-12-31 is &#8221; + sundayCount);</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: depesz</title>
		<link>http://blog.nixternal.com/2007.12.26/boost-library-rocks/#comment-3513</link>
		<dc:creator>depesz</dc:creator>
		<pubDate>Fri, 28 Dec 2007 11:54:54 +0000</pubDate>
		<guid isPermaLink="false">http://blog.nixternal.com/2007.12.26/boost-library-rocks/#comment-3513</guid>
		<description>hmm - there should be *3* spaces in sed. i dont know how to add them in comment box. but it should be like:
sed 's/XXX/\n/g'
where "X" is space.</description>
		<content:encoded><![CDATA[<p>hmm - there should be *3* spaces in sed. i dont know how to add them in comment box. but it should be like:<br />
sed &#8217;s/XXX/\n/g&#8217;<br />
where &#8220;X&#8221; is space.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: depesz</title>
		<link>http://blog.nixternal.com/2007.12.26/boost-library-rocks/#comment-3512</link>
		<dc:creator>depesz</dc:creator>
		<pubDate>Fri, 28 Dec 2007 11:12:04 +0000</pubDate>
		<guid isPermaLink="false">http://blog.nixternal.com/2007.12.26/boost-library-rocks/#comment-3512</guid>
		<description>this version of shell should be a bit faster:

for a in `seq 1901 2000`; do cal $a; done &#124; sed 's/   /\n/g' &#124; grep -c '^ 1  2  3  4  5  6  7'</description>
		<content:encoded><![CDATA[<p>this version of shell should be a bit faster:</p>
<p>for a in `seq 1901 2000`; do cal $a; done | sed &#8217;s/   /\n/g&#8217; | grep -c &#8216;^ 1  2  3  4  5  6  7&#8242;</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Yacin</title>
		<link>http://blog.nixternal.com/2007.12.26/boost-library-rocks/#comment-3511</link>
		<dc:creator>Yacin</dc:creator>
		<pubDate>Fri, 28 Dec 2007 04:04:23 +0000</pubDate>
		<guid isPermaLink="false">http://blog.nixternal.com/2007.12.26/boost-library-rocks/#comment-3511</guid>
		<description>Ugh, it messes up the spaces, this one actually works :P

for i in `seq 1 12` ; do for j in `seq 1901 2000`; do cal $i $j &#124; sed 's/ //g' &#124; grep 1234567 ; done; done &#124; wc -l</description>
		<content:encoded><![CDATA[<p>Ugh, it messes up the spaces, this one actually works <img src='http://blog.nixternal.com/wp-includes/images/smilies/icon_razz.gif' alt=':P' class='wp-smiley' /> </p>
<p>for i in `seq 1 12` ; do for j in `seq 1901 2000`; do cal $i $j | sed &#8217;s/ //g&#8217; | grep 1234567 ; done; done | wc -l</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Yacin</title>
		<link>http://blog.nixternal.com/2007.12.26/boost-library-rocks/#comment-3510</link>
		<dc:creator>Yacin</dc:creator>
		<pubDate>Fri, 28 Dec 2007 03:45:21 +0000</pubDate>
		<guid isPermaLink="false">http://blog.nixternal.com/2007.12.26/boost-library-rocks/#comment-3510</guid>
		<description>&lt;code&gt;for i in `seq 1 12` ; do for j in `seq 1901 2000`; do cal $i $j &#124; grep " 1  2  3  4  5  6  7"; done; done &#124; wc -l&lt;/code&gt;

fixt</description>
		<content:encoded><![CDATA[<p><code>for i in `seq 1 12` ; do for j in `seq 1901 2000`; do cal $i $j | grep " 1  2  3  4  5  6  7"; done; done | wc -l</code></p>
<p>fixt</p>
]]></content:encoded>
	</item>
</channel>
</rss>

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