<?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/"
	>

<channel>
	<title>gnucom.cc &#187; python</title>
	<atom:link href="http://blog.gnucom.cc/tag/python/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.gnucom.cc</link>
	<description>Code snippets and more...</description>
	<lastBuildDate>Wed, 18 Jan 2012 23:50:48 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	
		<item>
		<title>Calculating a square root.</title>
		<link>http://blog.gnucom.cc/2010/calculating-a-square-root/</link>
		<comments>http://blog.gnucom.cc/2010/calculating-a-square-root/#comments</comments>
		<pubDate>Thu, 23 Dec 2010 02:19:01 +0000</pubDate>
		<dc:creator>sholsapp</dc:creator>
				<category><![CDATA[Programming]]></category>
		<category><![CDATA[math]]></category>
		<category><![CDATA[python]]></category>
		<category><![CDATA[scheme]]></category>

		<guid isPermaLink="false">http://blog.gnucom.cc/?p=1130</guid>
		<description><![CDATA[I was just recently asked to calculate the square root of 17 without a math library. I couldn&#8217;t do it when I was asked to, so the question has been bugging me of awhile. I was bored today, so I decided to figure it out. The following is a Python function that calculates the square [...]]]></description>
		<wfw:commentRss>http://blog.gnucom.cc/2010/calculating-a-square-root/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Hadoop example for Exim logs with Python.</title>
		<link>http://blog.gnucom.cc/2010/hadoop-example-for-exim-logs-with-python/</link>
		<comments>http://blog.gnucom.cc/2010/hadoop-example-for-exim-logs-with-python/#comments</comments>
		<pubDate>Sun, 22 Aug 2010 01:52:58 +0000</pubDate>
		<dc:creator>sholsapp</dc:creator>
				<category><![CDATA[Programming]]></category>
		<category><![CDATA[exim]]></category>
		<category><![CDATA[hadoop]]></category>
		<category><![CDATA[hadoop-streaming]]></category>
		<category><![CDATA[python]]></category>

		<guid isPermaLink="false">http://blog.gnucom.cc/?p=915</guid>
		<description><![CDATA[The following is an example of parsing an exim_mainlog using Hadoop streaming. I&#8217;ve implemented both the mapper and the reducer in Python. The mapper and reducer don&#8217;t handle all of Exim&#8217;s log formats yet but this can be easily extended in the mapper and reducer if you actually end up using the output (this is [...]]]></description>
		<wfw:commentRss>http://blog.gnucom.cc/2010/hadoop-example-for-exim-logs-with-python/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Heap sort in Python.</title>
		<link>http://blog.gnucom.cc/2010/heap-sort-in-python/</link>
		<comments>http://blog.gnucom.cc/2010/heap-sort-in-python/#comments</comments>
		<pubDate>Tue, 17 Aug 2010 01:15:54 +0000</pubDate>
		<dc:creator>sholsapp</dc:creator>
				<category><![CDATA[Programming]]></category>
		<category><![CDATA[exersize]]></category>
		<category><![CDATA[python]]></category>
		<category><![CDATA[sorting]]></category>

		<guid isPermaLink="false">http://blog.gnucom.cc/?p=854</guid>
		<description><![CDATA[Here is an example of heapsort in Python. This sorting method happens to be my favorite of the bunch &#8211; I like to think that this is the most elegant sorting method, but I&#8217;m sure you could argue against me. Edit: I renamed percolateDown to percolateUp because I realized its really more of a &#8220;move [...]]]></description>
		<wfw:commentRss>http://blog.gnucom.cc/2010/heap-sort-in-python/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Generators in Python.</title>
		<link>http://blog.gnucom.cc/2010/generators-in-python/</link>
		<comments>http://blog.gnucom.cc/2010/generators-in-python/#comments</comments>
		<pubDate>Fri, 30 Jul 2010 01:28:15 +0000</pubDate>
		<dc:creator>sholsapp</dc:creator>
				<category><![CDATA[Programming]]></category>
		<category><![CDATA[python]]></category>

		<guid isPermaLink="false">http://blog.gnucom.cc/?p=847</guid>
		<description><![CDATA[The following examples are using Python 2.x but now after seeing Python 3.x released I&#8217;m interested in generators larger role in Python. Generators remind me of accumulators: generators accumulate a comprehensive result that you can add to with calls to yield. Take the following as an example. def cubes&#40;c&#41;: for i in range&#40;c&#41;: yield i [...]]]></description>
		<wfw:commentRss>http://blog.gnucom.cc/2010/generators-in-python/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Generate list of random integers in Python.</title>
		<link>http://blog.gnucom.cc/2010/generate-list-of-random-integers-in-python/</link>
		<comments>http://blog.gnucom.cc/2010/generate-list-of-random-integers-in-python/#comments</comments>
		<pubDate>Thu, 29 Jul 2010 02:14:03 +0000</pubDate>
		<dc:creator>sholsapp</dc:creator>
				<category><![CDATA[Programming]]></category>
		<category><![CDATA[python]]></category>
		<category><![CDATA[randomization]]></category>
		<category><![CDATA[testing]]></category>

		<guid isPermaLink="false">http://blog.gnucom.cc/?p=841</guid>
		<description><![CDATA[I use this for testing and that is about it. import random def randomArr&#40;length, max&#41;: arr = &#91;&#93; for i in range&#40;0, length&#41;: arr.append&#40;random.randint&#40;0, max&#41;&#41; return arr]]></description>
		<wfw:commentRss>http://blog.gnucom.cc/2010/generate-list-of-random-integers-in-python/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Insertion sort in Python.</title>
		<link>http://blog.gnucom.cc/2010/insertion-sort-in-python/</link>
		<comments>http://blog.gnucom.cc/2010/insertion-sort-in-python/#comments</comments>
		<pubDate>Thu, 29 Jul 2010 02:12:12 +0000</pubDate>
		<dc:creator>sholsapp</dc:creator>
				<category><![CDATA[Programming]]></category>
		<category><![CDATA[exersize]]></category>
		<category><![CDATA[python]]></category>
		<category><![CDATA[sorting]]></category>

		<guid isPermaLink="false">http://blog.gnucom.cc/?p=839</guid>
		<description><![CDATA[I&#8217;m losing faith in my programming skills today, so I&#8217;ve decided to re-implement sorting functions. Each day I&#8217;ll try to decrease the complexity of the algorithms, but, this day being the first, I&#8217;ll give you a quadratic insertion sort. This is an insertion sort, right, or is it shell sort? Heh&#8230; def insertionSort&#40;arr&#41;: for i [...]]]></description>
		<wfw:commentRss>http://blog.gnucom.cc/2010/insertion-sort-in-python/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Using reduce in Python.</title>
		<link>http://blog.gnucom.cc/2010/using-reduce-in-python/</link>
		<comments>http://blog.gnucom.cc/2010/using-reduce-in-python/#comments</comments>
		<pubDate>Tue, 27 Jul 2010 01:46:36 +0000</pubDate>
		<dc:creator>sholsapp</dc:creator>
				<category><![CDATA[Programming]]></category>
		<category><![CDATA[functional programming]]></category>
		<category><![CDATA[python]]></category>

		<guid isPermaLink="false">http://blog.gnucom.cc/?p=825</guid>
		<description><![CDATA[Python has a built in operator called reduce. This is just another name for what a functional programmer would called a fold. They&#8217;re really useful, but you don&#8217;t know so until you actually need one. The easiest example to understand is listed below and is the same example provided on Python&#8217;s documentation. lon = &#91;1, [...]]]></description>
		<wfw:commentRss>http://blog.gnucom.cc/2010/using-reduce-in-python/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Using the Stanford Parser with Jython.</title>
		<link>http://blog.gnucom.cc/2010/using-the-stanford-parser-with-jython/</link>
		<comments>http://blog.gnucom.cc/2010/using-the-stanford-parser-with-jython/#comments</comments>
		<pubDate>Fri, 16 Jul 2010 21:16:06 +0000</pubDate>
		<dc:creator>sholsapp</dc:creator>
				<category><![CDATA[NLP]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[jython]]></category>
		<category><![CDATA[python]]></category>
		<category><![CDATA[stanford parser]]></category>

		<guid isPermaLink="false">http://blog.gnucom.cc/?p=798</guid>
		<description><![CDATA[The following code is a Jython adaptation of the example Java code that comes with the Stanford Parser. I felt like this would be pretty useful to have as a resource because Python doesn&#8217;t have a parser that generates grammatical relationships in a sentence, and I wasn&#8217;t able to find any example code to help [...]]]></description>
		<wfw:commentRss>http://blog.gnucom.cc/2010/using-the-stanford-parser-with-jython/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Applying functions to arguments in Python.</title>
		<link>http://blog.gnucom.cc/2010/applying-functions-to-arguments-in-python/</link>
		<comments>http://blog.gnucom.cc/2010/applying-functions-to-arguments-in-python/#comments</comments>
		<pubDate>Fri, 16 Jul 2010 00:59:23 +0000</pubDate>
		<dc:creator>sholsapp</dc:creator>
				<category><![CDATA[Programming]]></category>
		<category><![CDATA[functional programming]]></category>
		<category><![CDATA[python]]></category>

		<guid isPermaLink="false">http://blog.gnucom.cc/?p=791</guid>
		<description><![CDATA[One of my favorite features of functional programming languages is that you can treat functions like values. You can assign them like any other value, but most interestingly you can apply them! Though Python requires that you use a special notation to do so, I wanted to write this down so that it is clear [...]]]></description>
		<wfw:commentRss>http://blog.gnucom.cc/2010/applying-functions-to-arguments-in-python/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Randomize cron entries with python.</title>
		<link>http://blog.gnucom.cc/2010/randomize-cron-entries-with-python/</link>
		<comments>http://blog.gnucom.cc/2010/randomize-cron-entries-with-python/#comments</comments>
		<pubDate>Tue, 13 Jul 2010 05:18:47 +0000</pubDate>
		<dc:creator>sholsapp</dc:creator>
				<category><![CDATA[Programming]]></category>
		<category><![CDATA[cron]]></category>
		<category><![CDATA[python]]></category>
		<category><![CDATA[randomization]]></category>

		<guid isPermaLink="false">http://blog.gnucom.cc/?p=759</guid>
		<description><![CDATA[I use this to prevent network brownouts when heavy bandwidth usage is expected. The script only randomizes the minute and hour fields of the cron entry, but can very easily be modified so that it randomizes all or selected entries. The script also only modifies entries that use the commands in the target list &#8211; [...]]]></description>
		<wfw:commentRss>http://blog.gnucom.cc/2010/randomize-cron-entries-with-python/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

