<?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: Solution for Google Treasure Hunt "zipfile" question</title>
	<atom:link href="http://www.chrishardie.com/blog/2008/06/solution-for-google-treasure-hunt-zipfile-question.html/feed" rel="self" type="application/rss+xml" />
	<link>http://www.chrishardie.com/blog/2008/06/solution-for-google-treasure-hunt-zipfile-question.html</link>
	<description>Personal Blog for James Christopher Hardie</description>
	<pubDate>Tue, 02 Dec 2008 20:55:20 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.6.1</generator>
		<item>
		<title>By: etbnc</title>
		<link>http://www.chrishardie.com/blog/2008/06/solution-for-google-treasure-hunt-zipfile-question.html#comment-85348</link>
		<dc:creator>etbnc</dc:creator>
		<pubDate>Mon, 02 Jun 2008 01:42:22 +0000</pubDate>
		<guid isPermaLink="false">http://www.chrishardie.com/weblog/?p=271#comment-85348</guid>
		<description>A spreadsheet?! Oy.

&lt;a href="http://bashcurescancer.com/man/cmd/dc" rel="nofollow"&gt;man dc&lt;/a&gt;

(Sorry, couldn't resist.)</description>
		<content:encoded><![CDATA[<p>A spreadsheet?! Oy.</p>
<p><a href="http://bashcurescancer.com/man/cmd/dc" rel="nofollow">man dc</a></p>
<p>(Sorry, couldn't resist.)</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Ian Bicking</title>
		<link>http://www.chrishardie.com/blog/2008/06/solution-for-google-treasure-hunt-zipfile-question.html#comment-85347</link>
		<dc:creator>Ian Bicking</dc:creator>
		<pubDate>Mon, 02 Jun 2008 01:40:25 +0000</pubDate>
		<guid isPermaLink="false">http://www.chrishardie.com/weblog/?p=271#comment-85347</guid>
		<description>&lt;code&gt;import glob
fns = glob.glob('*bar*.xml')
fn_lines = [open(fn).readlines() for fn in fns]
xmls = sum(int(lines[3].strip()) for lines in fn_lines if len(lines) &#62;= 3)&lt;/code&gt;

Then I'd copy and paste for the second one if time was of the essence, as it'd be hard to do it faster via functions.  Otherwise obviously the glob pattern and line number would be parameters to a function.

I'd do it this way because my command-line-fu is weak, but my programming-fu is strong; the command-line technique is also quite clever.  Though doing calculations at the command-line always seemed unnecessarily hard.  Honestly globbing might not have occurred to me at first, leading to a much more complicated file traversal.</description>
		<content:encoded><![CDATA[<p><code>import glob<br />
fns = glob.glob('*bar*.xml')<br />
fn_lines = [open(fn).readlines() for fn in fns]<br />
xmls = sum(int(lines[3].strip()) for lines in fn_lines if len(lines) &gt;= 3)</code></p>
<p>Then I'd copy and paste for the second one if time was of the essence, as it'd be hard to do it faster via functions.  Otherwise obviously the glob pattern and line number would be parameters to a function.</p>
<p>I'd do it this way because my command-line-fu is weak, but my programming-fu is strong; the command-line technique is also quite clever.  Though doing calculations at the command-line always seemed unnecessarily hard.  Honestly globbing might not have occurred to me at first, leading to a much more complicated file traversal.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Thomas Kemp</title>
		<link>http://www.chrishardie.com/blog/2008/06/solution-for-google-treasure-hunt-zipfile-question.html#comment-85343</link>
		<dc:creator>Thomas Kemp</dc:creator>
		<pubDate>Sun, 01 Jun 2008 20:26:05 +0000</pubDate>
		<guid isPermaLink="false">http://www.chrishardie.com/weblog/?p=271#comment-85343</guid>
		<description>"How would you do it?" 
Um. I guess I wouldn't. Does that mean you're not going to hire me?</description>
		<content:encoded><![CDATA[<p>"How would you do it?"<br />
Um. I guess I wouldn't. Does that mean you're not going to hire me?</p>
]]></content:encoded>
	</item>
</channel>
</rss>
