<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	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/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	xmlns:georss="http://www.georss.org/georss" xmlns:geo="http://www.w3.org/2003/01/geo/wgs84_pos#" xmlns:media="http://search.yahoo.com/mrss/"
	>

<channel>
	<title>Code Comments</title>
	<atom:link href="http://codecomments.wordpress.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://codecomments.wordpress.com</link>
	<description></description>
	<lastBuildDate>Wed, 04 Jan 2012 14:50:11 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.com/</generator>
<cloud domain='codecomments.wordpress.com' port='80' path='/?rsscloud=notify' registerProcedure='' protocol='http-post' />
<image>
		<url>http://s2.wp.com/i/buttonw-com.png</url>
		<title>Code Comments</title>
		<link>http://codecomments.wordpress.com</link>
	</image>
	<atom:link rel="search" type="application/opensearchdescription+xml" href="http://codecomments.wordpress.com/osd.xml" title="Code Comments" />
	<atom:link rel='hub' href='http://codecomments.wordpress.com/?pushpress=hub'/>
		<item>
		<title>Parsing Text Files in Java</title>
		<link>http://codecomments.wordpress.com/2008/07/14/parsing-text-files-in-java/</link>
		<comments>http://codecomments.wordpress.com/2008/07/14/parsing-text-files-in-java/#comments</comments>
		<pubDate>Mon, 14 Jul 2008 15:08:38 +0000</pubDate>
		<dc:creator>utah_guy</dc:creator>
				<category><![CDATA[CodeSnippet]]></category>
		<category><![CDATA[Java]]></category>

		<guid isPermaLink="false">http://codecomments.wordpress.com/?p=32</guid>
		<description><![CDATA[The following code is designed to parse (comma, tab, etc.) delimited files in Java. private static ArrayList parseDelimitedFile(String filePath, String delimiter) throws Exception { &#160;&#160;ArrayList rows = new ArrayList(); &#160;&#160;FileReader fr = new FileReader(filePath); &#160;&#160;BufferedReader br = new BufferedReader(fr); &#160;&#160;String currentRecord; &#160;&#160;while((currentRecord = br.readLine()) != null) &#160;&#160;&#160;&#160;rows.add(currentRecord.split(delimiter)); &#160;&#160;br.close(); &#160;&#160;return rows; }<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=codecomments.wordpress.com&amp;blog=324313&amp;post=32&amp;subd=codecomments&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>The following code is designed to parse (comma, tab, etc.) delimited files in Java.</p>
<p><code>private static ArrayList parseDelimitedFile(String filePath, String delimiter) throws Exception<br />
{<br />
&nbsp;&nbsp;ArrayList rows = new ArrayList();</code></p>
<p><code>&nbsp;&nbsp;FileReader fr = new FileReader(filePath);<br />
&nbsp;&nbsp;BufferedReader br = new BufferedReader(fr);</code></p>
<p><code>&nbsp;&nbsp;String currentRecord;<br />
&nbsp;&nbsp;while((currentRecord = br.readLine()) != null)<br />
&nbsp;&nbsp;&nbsp;&nbsp;rows.add(currentRecord.split(delimiter));</code></p>
<p><code>&nbsp;&nbsp;br.close();</code></p>
<p><code>&nbsp;&nbsp;return rows;<br />
}</code></p>
<br /><img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/codecomments.wordpress.com/32/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/codecomments.wordpress.com/32/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/codecomments.wordpress.com/32/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/codecomments.wordpress.com/32/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/codecomments.wordpress.com/32/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/codecomments.wordpress.com/32/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/codecomments.wordpress.com/32/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/codecomments.wordpress.com/32/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/codecomments.wordpress.com/32/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/codecomments.wordpress.com/32/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/codecomments.wordpress.com/32/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/codecomments.wordpress.com/32/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/codecomments.wordpress.com/32/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/codecomments.wordpress.com/32/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/codecomments.wordpress.com/32/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/codecomments.wordpress.com/32/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=codecomments.wordpress.com&amp;blog=324313&amp;post=32&amp;subd=codecomments&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://codecomments.wordpress.com/2008/07/14/parsing-text-files-in-java/feed/</wfw:commentRss>
		<slash:comments>12</slash:comments>
	
		<media:content url="" medium="image">
			<media:title type="html">utah_guy</media:title>
		</media:content>
	</item>
		<item>
		<title>Peeking at Large Files in Python</title>
		<link>http://codecomments.wordpress.com/2008/07/14/reading-large-files-in-python/</link>
		<comments>http://codecomments.wordpress.com/2008/07/14/reading-large-files-in-python/#comments</comments>
		<pubDate>Mon, 14 Jul 2008 15:07:10 +0000</pubDate>
		<dc:creator>utah_guy</dc:creator>
				<category><![CDATA[Python]]></category>
		<category><![CDATA[development]]></category>
		<category><![CDATA[programming]]></category>

		<guid isPermaLink="false">http://codecomments.wordpress.com/?p=31</guid>
		<description><![CDATA[I have been parsing files that are in the multi-gigabyte range. Python can handle them pretty well, but it can still take awhile to chug through them. I have to be honest in saying I don&#8217;t know of any great tricks to speed this up. However, one thing that can be helpful when parsing large [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=codecomments.wordpress.com&amp;blog=324313&amp;post=31&amp;subd=codecomments&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>I have been parsing files that are in the multi-gigabyte range. Python can handle them pretty well, but it can still take awhile to chug through them. I have to be honest in saying I don&#8217;t know of any great tricks to speed this up. However, one thing that can be helpful when parsing large files is to read a few lines to be able to see the format. The following code will allow you to look at the first 100 lines of a text file with Python (like when you want to see the format of a large file without reading through all of it). To read the entire file, you just would take out the if statement.</p>
<p>inFileName = &#8220;associations.txt&#8221;<br />
inFile = open(inFileName, &#8216;r&#8217;)<br />
outFile = open(&#8220;peek_%s&#8221; % inFileName, &#8216;w&#8217;)</p>
<p>count = 0</p>
<p>for line in inFile:<br />
&nbsp;&nbsp;count += 1</p>
<p>if count &lt;= 100:<br />
&nbsp;&nbsp;outFile.write(line)<br />
else: break</p>
<p>outFile.close()<br />
inFile.close()</p>
<br /><img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/codecomments.wordpress.com/31/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/codecomments.wordpress.com/31/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/codecomments.wordpress.com/31/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/codecomments.wordpress.com/31/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/codecomments.wordpress.com/31/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/codecomments.wordpress.com/31/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/codecomments.wordpress.com/31/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/codecomments.wordpress.com/31/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/codecomments.wordpress.com/31/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/codecomments.wordpress.com/31/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/codecomments.wordpress.com/31/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/codecomments.wordpress.com/31/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/codecomments.wordpress.com/31/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/codecomments.wordpress.com/31/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/codecomments.wordpress.com/31/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/codecomments.wordpress.com/31/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=codecomments.wordpress.com&amp;blog=324313&amp;post=31&amp;subd=codecomments&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://codecomments.wordpress.com/2008/07/14/reading-large-files-in-python/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="" medium="image">
			<media:title type="html">utah_guy</media:title>
		</media:content>
	</item>
		<item>
		<title>How to Concatenate Two String Values in SQL</title>
		<link>http://codecomments.wordpress.com/2008/07/12/how-to-concatenate-two-string-values-in-sqlite/</link>
		<comments>http://codecomments.wordpress.com/2008/07/12/how-to-concatenate-two-string-values-in-sqlite/#comments</comments>
		<pubDate>Sat, 12 Jul 2008 17:35:46 +0000</pubDate>
		<dc:creator>utah_guy</dc:creator>
				<category><![CDATA[CodeSnippet]]></category>
		<category><![CDATA[SQL]]></category>

		<guid isPermaLink="false">http://codecomments.wordpress.com/?p=30</guid>
		<description><![CDATA[(The following example was tested in SQLite, but it should work for most versions of SQL.) The syntax for combining two string values is the following. SELECT Column1 &#124;&#124; Column2 FROM TheTable<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=codecomments.wordpress.com&amp;blog=324313&amp;post=30&amp;subd=codecomments&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>(The following example was tested in SQLite, but it should work for most versions of SQL.)</p>
<p>The syntax for combining two string values is the following.</p>
<p><code>SELECT Column1 || Column2<br />
FROM TheTable</code></p>
<br /><img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/codecomments.wordpress.com/30/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/codecomments.wordpress.com/30/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/codecomments.wordpress.com/30/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/codecomments.wordpress.com/30/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/codecomments.wordpress.com/30/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/codecomments.wordpress.com/30/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/codecomments.wordpress.com/30/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/codecomments.wordpress.com/30/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/codecomments.wordpress.com/30/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/codecomments.wordpress.com/30/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/codecomments.wordpress.com/30/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/codecomments.wordpress.com/30/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/codecomments.wordpress.com/30/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/codecomments.wordpress.com/30/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/codecomments.wordpress.com/30/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/codecomments.wordpress.com/30/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=codecomments.wordpress.com&amp;blog=324313&amp;post=30&amp;subd=codecomments&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://codecomments.wordpress.com/2008/07/12/how-to-concatenate-two-string-values-in-sqlite/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
	
		<media:content url="" medium="image">
			<media:title type="html">utah_guy</media:title>
		</media:content>
	</item>
		<item>
		<title>How to Do an IF Statement in SQL</title>
		<link>http://codecomments.wordpress.com/2008/07/12/how-to-do-an-if-statement-in-sql/</link>
		<comments>http://codecomments.wordpress.com/2008/07/12/how-to-do-an-if-statement-in-sql/#comments</comments>
		<pubDate>Sat, 12 Jul 2008 17:34:22 +0000</pubDate>
		<dc:creator>utah_guy</dc:creator>
				<category><![CDATA[CodeSnippet]]></category>
		<category><![CDATA[SQL]]></category>

		<guid isPermaLink="false">http://codecomments.wordpress.com/?p=29</guid>
		<description><![CDATA[(The following example has been tested in SQLite, but it should work for most versions of SQL.) Technically there is not a way to do IF statements in the SQLite query language like there is in some other versions of SQL. But you can essentially do it with the CASE statement. The following statement is [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=codecomments.wordpress.com&amp;blog=324313&amp;post=29&amp;subd=codecomments&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>(The following example has been tested in <a href="http://www.sqlite.org" rel="nofollow">SQLite</a>, but it should work for most versions of SQL.)</p>
<p>Technically there is not a way to do IF statements in the SQLite query language like there is in some other versions of SQL. But you can essentially do it with the CASE statement. The following statement is similar to doing an IF, ELSE IF, ELSE statement.</p>
<p>SELECT (CASE InRome<br />
WHEN &#8216;Yes&#8217; Then &#8216;Do As the Romans Do&#8217;<br />
WHEN &#8216;No&#8217; Then &#8216;Do As the French Do&#8217;<br />
ELSE &#8216;Who knows what to do&#8217;<br />
)</p>
<br /><img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/codecomments.wordpress.com/29/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/codecomments.wordpress.com/29/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/codecomments.wordpress.com/29/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/codecomments.wordpress.com/29/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/codecomments.wordpress.com/29/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/codecomments.wordpress.com/29/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/codecomments.wordpress.com/29/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/codecomments.wordpress.com/29/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/codecomments.wordpress.com/29/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/codecomments.wordpress.com/29/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/codecomments.wordpress.com/29/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/codecomments.wordpress.com/29/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/codecomments.wordpress.com/29/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/codecomments.wordpress.com/29/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/codecomments.wordpress.com/29/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/codecomments.wordpress.com/29/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=codecomments.wordpress.com&amp;blog=324313&amp;post=29&amp;subd=codecomments&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://codecomments.wordpress.com/2008/07/12/how-to-do-an-if-statement-in-sql/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="" medium="image">
			<media:title type="html">utah_guy</media:title>
		</media:content>
	</item>
		<item>
		<title>Check to See If File Exists in Python</title>
		<link>http://codecomments.wordpress.com/2008/07/11/check-to-see-if-file-exists-in-python/</link>
		<comments>http://codecomments.wordpress.com/2008/07/11/check-to-see-if-file-exists-in-python/#comments</comments>
		<pubDate>Fri, 11 Jul 2008 21:20:16 +0000</pubDate>
		<dc:creator>utah_guy</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://codecomments.wordpress.com/?p=28</guid>
		<description><![CDATA[import os os.path.exists(fileName) This returns a boolean value.<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=codecomments.wordpress.com&amp;blog=324313&amp;post=28&amp;subd=codecomments&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p><code>import os<br />
os.path.exists(fileName)</code></p>
<p>This returns a boolean value.</p>
<br /><img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/codecomments.wordpress.com/28/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/codecomments.wordpress.com/28/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/codecomments.wordpress.com/28/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/codecomments.wordpress.com/28/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/codecomments.wordpress.com/28/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/codecomments.wordpress.com/28/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/codecomments.wordpress.com/28/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/codecomments.wordpress.com/28/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/codecomments.wordpress.com/28/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/codecomments.wordpress.com/28/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/codecomments.wordpress.com/28/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/codecomments.wordpress.com/28/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/codecomments.wordpress.com/28/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/codecomments.wordpress.com/28/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/codecomments.wordpress.com/28/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/codecomments.wordpress.com/28/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=codecomments.wordpress.com&amp;blog=324313&amp;post=28&amp;subd=codecomments&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://codecomments.wordpress.com/2008/07/11/check-to-see-if-file-exists-in-python/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
	
		<media:content url="" medium="image">
			<media:title type="html">utah_guy</media:title>
		</media:content>
	</item>
		<item>
		<title>Increase the Text Size on Axes of Plots in R</title>
		<link>http://codecomments.wordpress.com/2008/07/11/increase-the-text-size-on-axes-of-plots-in-r/</link>
		<comments>http://codecomments.wordpress.com/2008/07/11/increase-the-text-size-on-axes-of-plots-in-r/#comments</comments>
		<pubDate>Fri, 11 Jul 2008 19:27:56 +0000</pubDate>
		<dc:creator>utah_guy</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[R-project]]></category>

		<guid isPermaLink="false">http://codecomments.wordpress.com/?p=26</guid>
		<description><![CDATA[An easy way to do this is to use the cex.lab parameter of the plot (or barplot, etc.) function. The abbreviation cex stands for character expansion. If you set this value to 2, the characters will be twice as large as they will be if you don&#8217;t set this. Similarly, you can modify the size [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=codecomments.wordpress.com&amp;blog=324313&amp;post=26&amp;subd=codecomments&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>An easy way to do this is to use the cex.lab parameter of the plot (or barplot, etc.) function. The abbreviation <em>cex</em> stands for character expansion. If you set this value to 2, the characters will be twice as large as they will be if you don&#8217;t set this.</p>
<p>Similarly, you can modify the size of the text labels on the axis using cex.axis and cex.names.</p>
<p>barplot(x,<br />
    ylab=&#8217;Proportion&#8217;,<br />
    cex.names=2.0,<br />
    cex.axis=2.0,<br />
    cex.lab=2.0<br />
  )</p>
<br /><img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/codecomments.wordpress.com/26/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/codecomments.wordpress.com/26/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/codecomments.wordpress.com/26/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/codecomments.wordpress.com/26/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/codecomments.wordpress.com/26/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/codecomments.wordpress.com/26/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/codecomments.wordpress.com/26/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/codecomments.wordpress.com/26/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/codecomments.wordpress.com/26/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/codecomments.wordpress.com/26/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/codecomments.wordpress.com/26/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/codecomments.wordpress.com/26/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/codecomments.wordpress.com/26/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/codecomments.wordpress.com/26/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/codecomments.wordpress.com/26/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/codecomments.wordpress.com/26/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=codecomments.wordpress.com&amp;blog=324313&amp;post=26&amp;subd=codecomments&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://codecomments.wordpress.com/2008/07/11/increase-the-text-size-on-axes-of-plots-in-r/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="" medium="image">
			<media:title type="html">utah_guy</media:title>
		</media:content>
	</item>
		<item>
		<title>Find Files in Directory Using Python</title>
		<link>http://codecomments.wordpress.com/2008/07/10/find-files-in-directory-using-python/</link>
		<comments>http://codecomments.wordpress.com/2008/07/10/find-files-in-directory-using-python/#comments</comments>
		<pubDate>Thu, 10 Jul 2008 17:53:30 +0000</pubDate>
		<dc:creator>utah_guy</dc:creator>
				<category><![CDATA[CodeSnippet]]></category>
		<category><![CDATA[Python]]></category>

		<guid isPermaLink="false">http://codecomments.wordpress.com/?p=25</guid>
		<description><![CDATA[A nice solution to this is the path Python module. However, the following simple solution will do the trick. It doesn&#8217;t support wildcards at this point, but that could easily be added with some regular expression code. def getFilesMatchingPattern(directory, nonWildCardPattern): &#160;&#160;fileList=os.listdir(directory) &#160;&#160;return [f for f in fileList if f.find(nonWildCardPattern) &#62; -1]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=codecomments.wordpress.com&amp;blog=324313&amp;post=25&amp;subd=codecomments&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>A nice solution to this is the <a href="http://www.jorendorff.com/articles/python/path/" rel="nofollow">path Python module</a>. However, the following simple solution will do the trick. It doesn&#8217;t support wildcards at this point, but that could easily be added with some regular expression code.</p>
<p><code>def getFilesMatchingPattern(directory, nonWildCardPattern):<br />
&nbsp;&nbsp;fileList=os.listdir(directory)<br />
&nbsp;&nbsp;return [f for f in fileList if f.find(nonWildCardPattern) &gt; -1]</code></p>
<br /><img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/codecomments.wordpress.com/25/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/codecomments.wordpress.com/25/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/codecomments.wordpress.com/25/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/codecomments.wordpress.com/25/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/codecomments.wordpress.com/25/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/codecomments.wordpress.com/25/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/codecomments.wordpress.com/25/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/codecomments.wordpress.com/25/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/codecomments.wordpress.com/25/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/codecomments.wordpress.com/25/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/codecomments.wordpress.com/25/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/codecomments.wordpress.com/25/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/codecomments.wordpress.com/25/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/codecomments.wordpress.com/25/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/codecomments.wordpress.com/25/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/codecomments.wordpress.com/25/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=codecomments.wordpress.com&amp;blog=324313&amp;post=25&amp;subd=codecomments&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://codecomments.wordpress.com/2008/07/10/find-files-in-directory-using-python/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
	
		<media:content url="" medium="image">
			<media:title type="html">utah_guy</media:title>
		</media:content>
	</item>
		<item>
		<title>How Many Files in a Linux Directory</title>
		<link>http://codecomments.wordpress.com/2008/07/04/how-many-files-in-a-linux-directory/</link>
		<comments>http://codecomments.wordpress.com/2008/07/04/how-many-files-in-a-linux-directory/#comments</comments>
		<pubDate>Fri, 04 Jul 2008 06:14:15 +0000</pubDate>
		<dc:creator>utah_guy</dc:creator>
				<category><![CDATA[Linux]]></category>

		<guid isPermaLink="false">http://codecomments.wordpress.com/?p=24</guid>
		<description><![CDATA[The following command will tell you how many files matching the *.csv pattern are in the current directory: ls -1R &#124; grep .*.csv &#124; wc -l<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=codecomments.wordpress.com&amp;blog=324313&amp;post=24&amp;subd=codecomments&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>The following command will tell you how many files matching the *.csv pattern are in the current directory:</p>
<p>ls -1R | grep .*.csv | wc -l</p>
<br /><img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/codecomments.wordpress.com/24/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/codecomments.wordpress.com/24/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/codecomments.wordpress.com/24/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/codecomments.wordpress.com/24/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/codecomments.wordpress.com/24/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/codecomments.wordpress.com/24/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/codecomments.wordpress.com/24/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/codecomments.wordpress.com/24/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/codecomments.wordpress.com/24/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/codecomments.wordpress.com/24/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/codecomments.wordpress.com/24/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/codecomments.wordpress.com/24/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/codecomments.wordpress.com/24/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/codecomments.wordpress.com/24/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/codecomments.wordpress.com/24/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/codecomments.wordpress.com/24/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=codecomments.wordpress.com&amp;blog=324313&amp;post=24&amp;subd=codecomments&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://codecomments.wordpress.com/2008/07/04/how-many-files-in-a-linux-directory/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
	
		<media:content url="" medium="image">
			<media:title type="html">utah_guy</media:title>
		</media:content>
	</item>
		<item>
		<title>Converting a String to a Boolean in Python</title>
		<link>http://codecomments.wordpress.com/2008/04/08/converting-a-string-to-a-boolean-value-in-python/</link>
		<comments>http://codecomments.wordpress.com/2008/04/08/converting-a-string-to-a-boolean-value-in-python/#comments</comments>
		<pubDate>Tue, 08 Apr 2008 01:11:48 +0000</pubDate>
		<dc:creator>utah_guy</dc:creator>
				<category><![CDATA[CodeSnippet]]></category>
		<category><![CDATA[Python]]></category>
		<category><![CDATA[Tip]]></category>

		<guid isPermaLink="false">http://codecomments.wordpress.com/?p=19</guid>
		<description><![CDATA[Let&#8217;s say you have a string value that you want to convert to a boolean, but you&#8217;re not sure the format it will be in. Some languages have built-in functions for doing this, but to my knowledge Python doesn&#8217;t. Here&#8217;s a way to do it (though it&#8217;s not comprehensive). (Thanks to the commenter who helped [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=codecomments.wordpress.com&amp;blog=324313&amp;post=19&amp;subd=codecomments&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>Let&#8217;s say you have a string value that you want to convert to a boolean, but you&#8217;re not sure the format it will be in. Some languages have built-in functions for doing this, but to my knowledge Python doesn&#8217;t. Here&#8217;s a way to do it (though it&#8217;s not comprehensive). (Thanks to the commenter who helped me see a simpler way to do this.)</p>
<p>def parseBoolString(theString):<br />
&nbsp;&nbsp;return theString[0].upper()==&#8217;T&#8217;</p>
<p>parseBoolString(&#8220;true&#8221;)</p>
<p>True</p>
<p>parseBoolString(&#8220;false&#8221;)</p>
<p>False</p>
<br /><img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/codecomments.wordpress.com/19/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/codecomments.wordpress.com/19/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/codecomments.wordpress.com/19/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/codecomments.wordpress.com/19/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/codecomments.wordpress.com/19/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/codecomments.wordpress.com/19/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/codecomments.wordpress.com/19/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/codecomments.wordpress.com/19/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/codecomments.wordpress.com/19/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/codecomments.wordpress.com/19/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/codecomments.wordpress.com/19/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/codecomments.wordpress.com/19/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/codecomments.wordpress.com/19/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/codecomments.wordpress.com/19/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/codecomments.wordpress.com/19/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/codecomments.wordpress.com/19/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=codecomments.wordpress.com&amp;blog=324313&amp;post=19&amp;subd=codecomments&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://codecomments.wordpress.com/2008/04/08/converting-a-string-to-a-boolean-value-in-python/feed/</wfw:commentRss>
		<slash:comments>10</slash:comments>
	
		<media:content url="" medium="image">
			<media:title type="html">utah_guy</media:title>
		</media:content>
	</item>
		<item>
		<title>Simple Method to Search a Python List</title>
		<link>http://codecomments.wordpress.com/2008/04/04/simple-method-to-search-a-python-list/</link>
		<comments>http://codecomments.wordpress.com/2008/04/04/simple-method-to-search-a-python-list/#comments</comments>
		<pubDate>Fri, 04 Apr 2008 15:19:27 +0000</pubDate>
		<dc:creator>utah_guy</dc:creator>
				<category><![CDATA[Python]]></category>
		<category><![CDATA[Tip]]></category>

		<guid isPermaLink="false">http://codecomments.wordpress.com/?p=18</guid>
		<description><![CDATA[Let&#8217;s say you have a list of objects of type Individual and that list is called individuals. The Individual type contains an ID, name, and email address. Let&#8217;s say you have an ID and want to get the corresponding Individual object from the list. How would you go about doing that? match = [ind for [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=codecomments.wordpress.com&amp;blog=324313&amp;post=18&amp;subd=codecomments&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>Let&#8217;s say you have a list of objects of type <em>Individual</em> and that list is called <em>individuals.</em></p>
<p>The Individual type contains an ID, name, and email address.</p>
<p>Let&#8217;s say you have an ID and want to get the corresponding Individual object from the list. How would you go about doing that?</p>
<p><code>match = [ind for ind in individuals if ind.id == theID]</code></p>
<br /><img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/codecomments.wordpress.com/18/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/codecomments.wordpress.com/18/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/codecomments.wordpress.com/18/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/codecomments.wordpress.com/18/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/codecomments.wordpress.com/18/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/codecomments.wordpress.com/18/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/codecomments.wordpress.com/18/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/codecomments.wordpress.com/18/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/codecomments.wordpress.com/18/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/codecomments.wordpress.com/18/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/codecomments.wordpress.com/18/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/codecomments.wordpress.com/18/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/codecomments.wordpress.com/18/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/codecomments.wordpress.com/18/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/codecomments.wordpress.com/18/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/codecomments.wordpress.com/18/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=codecomments.wordpress.com&amp;blog=324313&amp;post=18&amp;subd=codecomments&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://codecomments.wordpress.com/2008/04/04/simple-method-to-search-a-python-list/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
	
		<media:content url="" medium="image">
			<media:title type="html">utah_guy</media:title>
		</media:content>
	</item>
	</channel>
</rss>
