<?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>UMBC ebiquity &#187; Python</title>
	<atom:link href="http://ebiquity.umbc.edu/blogger/tag/python/feed/" rel="self" type="application/rss+xml" />
	<link>http://ebiquity.umbc.edu/blogger</link>
	<description>EBB is the ebiquity research group\\\'s blog at the University of Maryland, Baltimore County (UMBC).  We focus on technologies that facilitate the design, implementation and control of distributed, intelligent information systems -- mobile and pervasive computing, ad hoc networking, multiagent systems, knowledge representation and reasoning, and the semantic web.  As the tides of technology ebb and flow, we hope the good ideas wash up on our beach and the bad ones drift back out to sea.</description>
	<lastBuildDate>Fri, 20 Nov 2009 13:50:39 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.4</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Python: Basic of the future !?!</title>
		<link>http://ebiquity.umbc.edu/blogger/2009/04/28/python-basic-of-the-future/</link>
		<comments>http://ebiquity.umbc.edu/blogger/2009/04/28/python-basic-of-the-future/#comments</comments>
		<pubDate>Tue, 28 Apr 2009 16:48:34 +0000</pubDate>
		<dc:creator>Tim Finin</dc:creator>
				<category><![CDATA[Programming]]></category>
		<category><![CDATA[basic]]></category>
		<category><![CDATA[Python]]></category>

		<guid isPermaLink="false">http://ebiquity.umbc.edu/blogger/?p=1842</guid>
		<description><![CDATA[Guido van Rossum has been blogging about the lack of support for optimizing tail recursion in Python (he&#8217;s agin it).  His most recent post, Final Words on Tail Calls, includes this paragraph near the end.
 &#8216;And here it ends. One other thing I learned is that some in the academic world scornfully refer to [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://en.wikipedia.org/wiki/Guido_van_Rossum">Guido van Rossum</a> has been blogging about the lack of support for optimizing tail recursion in Python (he&#8217;s agin it).  His most recent post, <a href="http://neopythonic.blogspot.com/2009/04/final-words-on-tail-calls.html">Final Words on Tail Calls</a>, includes this paragraph near the end.</p>
<blockquote><p> &#8216;And here it ends. One other thing I learned is that some in the academic world scornfully refer to Python as &#8220;the Basic of the future&#8221;. Personally, I rather see that as a badge of honor, and it gives me an opportunity to plug a book of <a href="http://oreilly.com/catalog/9780596515171/">interviews with language designers</a> to which I contributed, side by side with the creators of Basic, C++, Perl, Java, and other academically scorned languages &#8212; as well as those of ML and Haskell, I hasten to add. (Apparently the creators of Scheme were too busy arguing whether to say &#8220;tail call optimization&#8221; or &#8220;proper tail recursion.&#8221; <img src='http://ebiquity.umbc.edu/blogger/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' /> &#8217; </p></blockquote>
<p>I&#8217;ve not yet been able to track down any sources calling Python the &#8216;Basic of the future&#8217; &#8212; all I could find is one person who referred to Java this way and another referring to Javascript. But for a programming language, it is a great slur, or maybe, to take Guido&#8217;s stance, a great compliment.</p>
]]></content:encoded>
			<wfw:commentRss>http://ebiquity.umbc.edu/blogger/2009/04/28/python-basic-of-the-future/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Perl/Python Phrasebook</title>
		<link>http://ebiquity.umbc.edu/blogger/2009/02/05/perlpython-phrasebook/</link>
		<comments>http://ebiquity.umbc.edu/blogger/2009/02/05/perlpython-phrasebook/#comments</comments>
		<pubDate>Thu, 05 Feb 2009 18:03:47 +0000</pubDate>
		<dc:creator>Tim Finin</dc:creator>
				<category><![CDATA[Programming]]></category>
		<category><![CDATA[Perl]]></category>
		<category><![CDATA[Python]]></category>

		<guid isPermaLink="false">http://ebiquity.umbc.edu/blogger/?p=1761</guid>
		<description><![CDATA[People who&#8217;s native language is Perl might find the Perl/Python phrasebook handy.  When talking to the Python interpreter, some try hand gestures, typing slowly or using ALL CAPS, but these seldom work and can often annoy or even alarm the interpreter.  This phrasebook covers the most common things you need to say to [...]]]></description>
			<content:encoded><![CDATA[<p>People who&#8217;s native language is Perl might find the <a href="http://wiki.python.org/moin/PerlPhrasebook">Perl/Python phrasebook</a> handy.  When talking to the Python interpreter, some try hand gestures, typing slowly or using ALL CAPS, but these seldom work and can often annoy or even alarm the interpreter.  This phrasebook covers the most common things you need to say to a simple Python system.  For example, if you wanted to tell it to read your file as a list of lines, there&#8217;s a <a href="http://wiki.python.org/moin/PerlPhrasebook#Readingafileasalistoflines">phrasebook entry</a> that that shows just how to say it.</p>
<blockquote>
<p>my $filename = &#8220;cooktest1.1-1&#8243;;<br />
open my $f, $filename or die &#8220;can&#8217;t open $filename: $!\n&#8221;;<br />
@lines = &lt;$f>;</p>
<p>&#8211;</p>
<p>filename = &#8220;cooktest1.1-1&#8243;<br />
f = open(filename) # Python has exceptions with somewhat-easy to<br />
                   # understand error messages. If the file could<br />
                   # not be opened, it would say &#8220;No such file or<br />
                   # directory: %filename&#8221; which is as<br />
                   # understandable as &#8220;can&#8217;t open $filename:&#8221;<br />
lines = f.readlines()
</p></blockquote>
<p>Many of the entries also contain helpful facts and advice about the customs and social norms of native Python speakers.  Not only can this keep you out of trouble, it will deepen your understanding of the colorful and sometimes quaint Python speakers.   I hope that the pocket travel version of the phrasebook, suitable for downloading onto an ipod, will be out soon.</p>
]]></content:encoded>
			<wfw:commentRss>http://ebiquity.umbc.edu/blogger/2009/02/05/perlpython-phrasebook/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>octo.py: quick and easy MapReduce for Python</title>
		<link>http://ebiquity.umbc.edu/blogger/2009/01/02/octopy-quick-and-easy-mapreduce-for-python/</link>
		<comments>http://ebiquity.umbc.edu/blogger/2009/01/02/octopy-quick-and-easy-mapreduce-for-python/#comments</comments>
		<pubDate>Fri, 02 Jan 2009 17:34:37 +0000</pubDate>
		<dc:creator>Tim Finin</dc:creator>
				<category><![CDATA[MC2]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[cloud computing]]></category>
		<category><![CDATA[distributed computing needs]]></category>
		<category><![CDATA[MapReduce]]></category>
		<category><![CDATA[Python]]></category>

		<guid isPermaLink="false">http://ebiquity.umbc.edu/blogger/?p=1718</guid>
		<description><![CDATA[The amount of free, interesting, and useful data is growing explosively. Luckily, computer are getting cheaper as we speak, they are all connected with a robust communication infrastructure, and software for analyzing data is better than ever.  That&#8217;s why everyone is interested in easy to use frameworks like MapReduce for every-day programmers to run [...]]]></description>
			<content:encoded><![CDATA[<p>The amount of free, interesting, and useful data is growing explosively. Luckily, computer are getting cheaper as we speak, they are all connected with a robust communication infrastructure, and software for analyzing data is better than ever.  That&#8217;s why everyone is interested in easy to use frameworks like <a href="http://en.wikipedia.org/wiki/MapReduce">MapReduce</a> for every-day programmers to run their data crunching in parallel.</p>
<p><a href="http://code.google.com/p/octopy/">octo.py</a> is a very simple MapReduce like system inspired by Ruby&#8217;s <a href="http://tech.rufy.com/2006/08/mapreduce-for-ruby-ridiculously-easy.html"> Starfish</a>.</p>
<blockquote><p>
&#8220;<a href="http://code.google.com/p/octopy/">Octo.py</a> doesn&#8217;t aim to meet all your distributed computing needs, but its simple approach is amendable to a large proportion of parallelizable tasks. If your code has a for-loop, there&#8217;s a good chance that you can make it distributed with just a few small changes. If you&#8217;re already using Python&#8217;s map() and reduce() functions, the changes needed are trivial!&#8221;
</p></blockquote>
<p>triangular.py is the simple example given in the documentation that is used with octo.py to compute the first 100 <a href="http://wikipedia.org/wiki/Triangular_number">triangular numbers</a>.</p>
<blockquote>
<pre>
# triangular.py compute first 100 triangular numbers. Do
# 'octo.py server triangular.py' on server with address IP
# and 'octo.py client IP' on each client. Server uses source
# &#038; final, sends tasks to clients, integrates results. Clients
# get tasks from server, use mapfn &#038; reducefn, return results.

source = dict(zip(range(100), range(100)))

def final(key, value):
    print key, value

def mapfn(key, value):
    for i in range(value + 1):
        yield key, i

def reducefn(key, value):
    return sum(value)
</pre>
</blockquote>
<p>Put <a href="http://ebiquity.umbc.edu/blogger/wp-content/uploads/2009/01/octo.py">octo.py</a> on all of the machines you want to use. On the machine you will use as a server (with ip address &lt;ip&gt;), also install <a href="http://ebiquity.umbc.edu/blogger/wp-content/uploads/2009/01/triangular.py"> triangular.py</a>, and then execute:</p>
<pre>
     python octo.py server triangular.py &amp;
</pre>
<p>On each of your clients, run </p>
<pre>
     python octo.py client &lt;ip&gt; &amp;
</pre>
<p>You can try this out using the same machine to run the server process and one or more client processes, of course.</p>
<p>When the clients register with the server, they will get a copy of <em>triangular.py</em> and wait for tasks from the server.  The server access the data from <em>source</em> and distributed tasks to the clients. These in turn use <em>mapfn</em> and <em>reducefn</em> to complete the tasks, returning the results.  The server integrates these and, when all have completed, invokes <em>final</em>, which in this case just prints the answers, and halts.  The clients continue to run, waiting for more tasks to do. </p>
<p>Octo.py is not a replacement for more sophisticated frameworks like Hadoop or Disco but if you are working in Python, its <a href="http://en.wikipedia.org/wiki/KISS_principle">KISS</a> approach is a good way to get started with the MapReduce paradigm and might be all you need for a small projects.</p>
<p>(Note: The package has not been updated since April 2008, so it&#8217;s status is not clear.  But further development would run the risk of making it more complex and would be self-defeating.)</p>
]]></content:encoded>
			<wfw:commentRss>http://ebiquity.umbc.edu/blogger/2009/01/02/octopy-quick-and-easy-mapreduce-for-python/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Disco: a Map reduce framework in Python and Erlang</title>
		<link>http://ebiquity.umbc.edu/blogger/2008/12/21/disco-a-map-reduce-framework-in-python-and-erlang/</link>
		<comments>http://ebiquity.umbc.edu/blogger/2008/12/21/disco-a-map-reduce-framework-in-python-and-erlang/#comments</comments>
		<pubDate>Sun, 21 Dec 2008 17:45:43 +0000</pubDate>
		<dc:creator>Tim Finin</dc:creator>
				<category><![CDATA[Multicore Computation Center]]></category>
		<category><![CDATA[Semantic Web]]></category>
		<category><![CDATA[Web]]></category>
		<category><![CDATA[Erlang]]></category>
		<category><![CDATA[Python]]></category>

		<guid isPermaLink="false">http://ebiquity.umbc.edu/blogger/?p=1705</guid>
		<description><![CDATA[Disco is a Python-friendly, open-source Map-Reduce framework for distributed computing with the slogan &#8220;massive data &#8211; minimal code&#8221;.  Disco&#8217;s core is written in Erlang, a functional language designed for concurrent programming, and users typically write Disco map and reduce jobs in Python. So what&#8217;s wrong with using Hadoop?  Nothing, according to the Disco [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://discoproject.org/">Disco</a> is a Python-friendly, open-source Map-Reduce framework for distributed computing with the slogan <i>&#8220;massive data &#8211; minimal code&#8221;</i>.  Disco&#8217;s core is written in <a href="http://en.wikipedia.org/wiki/Erlang_(programming_language)">Erlang</a>, a functional language designed for concurrent programming, and users typically write Disco map and reduce jobs in Python. So what&#8217;s wrong with using <a href="http://en.wikipedia.org/wiki/Hadoop">Hadoop</a>?  Nothing, according to the Disco site, but&#8230;<br />
<blockquote> &#8220;We see that platforms for distributed computing will be of such high importance in the future that it is crucial to have a wide variety of different approaches which produces healthy competition and co-evolution between the projects. In this respect, Hadoop and Disco can be seen as complementary projects, similar to Apache, Lighttpd and Nginx.</p>
<p>It is a matter of taste whether Erlang and Python are more suitable for the task than Java. We feel much more productive with Python than with Java. We also feel that Erlang is a perfect match for the Disco core that needs to handle tens of thousands of tasks in parallel.</p>
<p>Thanks to Erlang, the Disco core remarkably compact, currently less than 2000 lines of code. It is relatively easy to understand how the core works, and start experimenting with it or adapt it to new environments. Thanks to Python, it is easy to add new features around the core which ensures that Disco can respond quickly to real-world needs.&#8221;
</p></blockquote>
<p>The <a href="http://discoproject.org/doc/start/tutorial.html">Disco tutorial</a> uses the standard word counting task to show how to set up and use Disco on both a local cluster and Amazon EC2. There is also <a href="http://discoproject.org/doc/py/homedisco.html">homedisco</a>, which lets programmers develop, debug, profile and test Disco functions on one local machine before running on a cluster. The word counting example from the tutorial is certainly nicely compact:</p>
<blockquote>
<div style="font-family:Arial;font-size:0.8em">
<pre>
from disco.core import Disco, result_iterator

def fun_map(e, params):
    return [(w, 1) for w in e.split()]

def fun_reduce(iter, out, params):
    s = {}
    for w, f in iter:
        s[w] = s.get(w, 0) + int(f)
    for w, f in s.iteritems():
        out.add(w, f)

results = Disco("disco://localhost").new_job(
		name = "wordcount",
                input = ["http://discoproject.org/chekhov.txt"],
                map = fun_map,
		reduce = fun_reduce).wait()

for word, frequency in result_iterator(results):
	print word, frequency
</pre>
</div>
</blockquote>
]]></content:encoded>
			<wfw:commentRss>http://ebiquity.umbc.edu/blogger/2008/12/21/disco-a-map-reduce-framework-in-python-and-erlang/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>The Python Challenge</title>
		<link>http://ebiquity.umbc.edu/blogger/2008/11/06/the-python-challenge/</link>
		<comments>http://ebiquity.umbc.edu/blogger/2008/11/06/the-python-challenge/#comments</comments>
		<pubDate>Thu, 06 Nov 2008 16:23:19 +0000</pubDate>
		<dc:creator>Tim Finin</dc:creator>
				<category><![CDATA[Programming]]></category>
		<category><![CDATA[education]]></category>
		<category><![CDATA[puzzle]]></category>
		<category><![CDATA[Python]]></category>

		<guid isPermaLink="false">http://ebiquity.umbc.edu/blogger/?p=1666</guid>
		<description><![CDATA[ A student in my programming languages class pointed me to the Python Challenge site.  It looks like a great way for someone new to Python to test her skills and learn new ones.
It&#8217;s a riddle site in the style of notpron, but one where solving each riddle requires a little bit of Python [...]]]></description>
			<content:encoded><![CDATA[<p><img src="http://ebiquity.umbc.edu/blogger/wp-content/uploads/2008/11/home_b1.jpg" alt="Python Challenge" title="pythonChallenge" width="100" height="90" align="right" /> A student in my programming languages class pointed me to the <a href="http://www.pythonchallenge.com/">Python Challenge</a> site.  It looks like a great way for someone new to Python to test her skills and learn new ones.</p>
<p>It&#8217;s a riddle site in the style of <a href="http://www.deathball.net/notpron/">notpron</a>, but one where solving each riddle requires a little bit of Python programming.  The solutions are entered by changing the URL of the current page to take you to the next riddle page.  The problems are &#8220;designed to be solvable by Python newcomers and yet challenging even for Python experts.&#8221;</p>
<p>This type of site could be a good educational tool for many subjects.</p>
]]></content:encoded>
			<wfw:commentRss>http://ebiquity.umbc.edu/blogger/2008/11/06/the-python-challenge/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
