<?xml version="1.0"?>
<rdf:RDF
	xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:foaf="http://xmlns.com/foaf/0.1/"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns="http://purl.org/rss/1.0/"
>
<channel rdf:about="http://www.planetpython.org/">
	<title>unofficial planet python</title>
	<link>http://www.planetpython.org/</link>
	<description>unofficial planet python - http://www.planetpython.org/</description>

	<items>
		<rdf:Seq>
			<rdf:li rdf:resource="tag:blogger.com,1999:blog-3604515438787408842.post-5278085607235820612" />
			<rdf:li rdf:resource="http://www.peterbe.com/plog/domstripper" />
			<rdf:li rdf:resource="http://python.genedrift.org/2008/11/19/creating-an-interface-for-the-motif-finding-script-final/" />
			<rdf:li rdf:resource="http://www.sauria.com/blog/2008/11/19/python-in-netbeans/" />
			<rdf:li rdf:resource="http://blog.vrplumber.com/index.php?/archives/2226-guid.html" />
			<rdf:li rdf:resource="tag:blogger.com,1999:blog-8212254010436871241.post-3136577706601695197" />
			<rdf:li rdf:resource="http://nedbatchelder.com/blog/200811/pathological_backtracking.html" />
			<rdf:li rdf:resource="tag:www.cmlenz.net,2008-07-03:a2608fcc991a48a7bc3301fdfc9163c0" />
			<rdf:li rdf:resource="http://simonwillison.net/2008/Nov/19/django/" />
			<rdf:li rdf:resource="tag:blogger.com,1999:blog-11788780.post-991813146212854373" />
			<rdf:li rdf:resource="http://www.djangoproject.com/weblog/2008/nov/18/102/" />
			<rdf:li rdf:resource="http://blog.vrplumber.com/index.php?/archives/2225-guid.html" />
			<rdf:li rdf:resource="http://jtauber.com/blog/2008/11/18/discrete_cosine_transforms_part_1" />
			<rdf:li rdf:resource="tag:blogger.com,1999:blog-10678074.post-2580251818399697002" />
			<rdf:li rdf:resource="http://nedbatchelder.com/blog/200811/victoria_marcus_olds_19112008.html" />
			<rdf:li rdf:resource="http://www.protocolostomy.com/?p=401" />
			<rdf:li rdf:resource="tag:blogger.com,1999:blog-3776799.post-5280401170045483801" />
			<rdf:li rdf:resource="http://python.genedrift.org/2008/11/18/creating-an-interface-for-the-motif-finding-script-some-corrections/" />
			<rdf:li rdf:resource="http://www.protocolostomy.com/?p=399" />
			<rdf:li rdf:resource="tag:blogger.com,1999:blog-8935780327334775165.post-4004223490366147661" />
			<rdf:li rdf:resource="http://simonwillison.net/2008/Nov/18/lawrencecom/" />
			<rdf:li rdf:resource="http://radian.org/notebook/?p=213" />
			<rdf:li rdf:resource="http://radian.org/notebook/?p=187" />
			<rdf:li rdf:resource="tag:blogger.com,1999:blog-4637631607249418081.post-8268002134299298672" />
			<rdf:li rdf:resource="tag:blogger.com,1999:blog-11788780.post-5643205556171093374" />
			<rdf:li rdf:resource="http://jtauber.com/blog/2008/11/17/fixing_relative_links_in_entries" />
			<rdf:li rdf:resource="http://www.eflorenzano.com/blog/post/wsgi-middlware-awesome-django-use-it-more/" />
			<rdf:li rdf:resource="http://www.fishandcross.com/blog/?p=785" />
			<rdf:li rdf:resource="http://homepage.mac.com/s_lott/iblog/architecture/C412398194/E20081117061023/index.html" />
			<rdf:li rdf:resource="http://yeoldeclue.com/cgi-bin/blog/blog.cgi?rm=viewpost&amp;nodeid=1226893221" />
			<rdf:li rdf:resource="tag:blogger.com,1999:blog-18669215.post-4455795161758732484" />
			<rdf:li rdf:resource="http://www.eflorenzano.com/blog/post/writing-markov-chain-irc-bot-twisted-and-python/" />
			<rdf:li rdf:resource="http://blog.tplus1.com/?p=253" />
			<rdf:li rdf:resource="tag:blogger.com,1999:blog-11149365.post-3506334622974570972" />
			<rdf:li rdf:resource="http://www.super-cooper.com/?p=62" />
			<rdf:li rdf:resource="tag:blogger.com,1999:blog-5440028356946346379.post-1801432173062312297" />
			<rdf:li rdf:resource="http://eli.thegreenplace.net/?p=1125" />
			<rdf:li rdf:resource="http://baijum81.livejournal.com/27913.html" />
			<rdf:li rdf:resource="http://www.djangoproject.com/weblog/2008/nov/15/101/" />
			<rdf:li rdf:resource="http://kunxi.org/?p=315" />
			<rdf:li rdf:resource="tag:blogger.com,1999:blog-5236867476487043111.post-8151339980271907606" />
			<rdf:li rdf:resource="http://shriphani.com/blog/?p=279" />
			<rdf:li rdf:resource="tag:blogger.com,1999:blog-18669215.post-5728863137702729627" />
			<rdf:li rdf:resource="http://blog.showmedo.com/?p=361" />
			<rdf:li rdf:resource="tag:blogger.com,1999:blog-4161159973198205072.post-604494209638809951" />
			<rdf:li rdf:resource="http://www.sauria.com/blog/2008/11/15/d3-report/" />
			<rdf:li rdf:resource="http://jimmyg.org/2008/11/14/the-pylons-book-is-finished/" />
			<rdf:li rdf:resource="tag:openhex.org,2008-09-08:nicoe:200811141120_Inheritance-aware_dictionnary" />
			<rdf:li rdf:resource="tag:blogger.com,1999:blog-8550962.post-327042159640767593" />
			<rdf:li rdf:resource="http://kunxi.org/archives/2008/11/temporary-post-used-for-theme-detection-655821fa-4f63-4a13-8e57-01e54b3153b8-3bfe001a-32de-4114-a6b4-4005b770f6d7/" />
			<rdf:li rdf:resource="tag:blogger.com,1999:blog-5236867476487043111.post-4106325622085940445" />
			<rdf:li rdf:resource="tag:www.groovie.org,:Article/773" />
			<rdf:li rdf:resource="tag:blogger.com,1999:blog-9238405.post-6525719291955306220" />
			<rdf:li rdf:resource="tag:blogger.com,1999:blog-6237161444180571452.post-4105061370419272569" />
			<rdf:li rdf:resource="tag:blogger.com,1999:blog-6237161444180571452.post-6554831624036757266" />
			<rdf:li rdf:resource="tag:blogger.com,1999:blog-4161159973198205072.post-5510387239255385161" />
			<rdf:li rdf:resource="http://www.alobbs.com/1357/A_new_community_has_been_born.html" />
			<rdf:li rdf:resource="http://homepage.mac.com/s_lott/iblog/architecture/C412398194/E20081113062510/index.html" />
			<rdf:li rdf:resource="http://yeoldeclue.com/cgi-bin/blog/blog.cgi?rm=viewpost&amp;nodeid=1226574014" />
			<rdf:li rdf:resource="tag:openhex.org,2008-09-08:nicoe:200811130741_Phrase_from_nearest_book_meme" />
		</rdf:Seq>
	</items>
</channel>

<item rdf:about="tag:blogger.com,1999:blog-3604515438787408842.post-5278085607235820612">
	<title>IronPython Url's: Silverlight 2 and Dynamic Languages</title>
	<link>http://feeds.feedburner.com/~r/IronpythonUrls/~3/458969036/silverlight-2-and-dynamic-languages.html</link>
	<content:encoded>Well my backlog is logged so far back that I haven't even blogged about the final release of &lt;a href=&quot;http://www.silverlight.net/&quot;&gt;Silverlight 2&lt;/a&gt;.&lt;br /&gt;&lt;br /&gt;In case you've been living under a rock for the last year, Silverlight 2 is a browser plugin from Microsoft. It is similar to Flash (aimed at games, media streaming and rich internet applications) and is cross-platform (Mac OS X and Windows - the officially blessed Linux port Moonlight by the Mono guys is making good progress though) and cross browser (IE 7+, Safari &amp;amp; Firefox 2+). Unlike Flash it can be programmed with a choice of languages, and through the Dynamic Language Runtime it can be programmed in Python, Ruby and Javascript.&lt;br /&gt;&lt;br /&gt;Silverlight 2 final is now out, and &lt;a href=&quot;http://weblogs.asp.net/scottgu/archive/2008/11/16/update-on-silverlight-2-and-a-glimpse-of-silverlight-3.aspx&quot;&gt;according to Scott Guthrie&lt;/a&gt; has now been installed on over 100 million consumer computers.&lt;br /&gt;&lt;br /&gt;Naturally Jimmy Schementi, who maintains the Dynamic Language Support for Silverlight, released an updated version of the Silverlight Dynamic Languages SDK (sucky name - more on this in a bit):&lt;br /&gt;&lt;ul&gt;&lt;li&gt;&lt;a href=&quot;http://blog.jimmy.schementi.com/2008/10/dynamic-languages-in-silverlight-2-rtw.html&quot;&gt;Dynamic Languages in Silverlight RTW (Release To Web)&lt;/a&gt;&lt;/li&gt;&lt;/ul&gt;In preparation for my talk at the &lt;a href=&quot;http://pyworks.mtacon.com/&quot;&gt;PyWorks&lt;/a&gt; conference I updated my &lt;a href=&quot;http://www.voidspace.org.uk/ironpython/webide/webide.html&quot;&gt;IronPython Web IDE&lt;/a&gt; (tool for experimenting with the Silverlight APIs from Python in the browser) and &lt;a href=&quot;http://www.trypython.org/&quot;&gt;Try Python&lt;/a&gt; (interactive Python interpreter in the browser) for Silverlight 2:&lt;br /&gt;&lt;ul&gt;&lt;li&gt;&lt;a href=&quot;http://www.voidspace.org.uk/python/weblog/arch_d7_2008_11_08.shtml#e1031&quot;&gt;Try Python and IronPython Web IDE Updated for Silverlight 2&lt;/a&gt;&lt;/li&gt;&lt;/ul&gt;Of course if you're interested in building internet applications with Silverlight then you will want the extended controls that come as part of the &lt;a href=&quot;http://www.microsoft.com/downloads/details.aspx?FamilyID=c22d6a7b-546f-4407-8ef6-d60c8ee221ed&amp;amp;DisplayLang=en&quot;&gt;Visual Studio Tools for Silverlight 2&lt;/a&gt; (this works with Visual Studio Professional or the free &lt;a href=&quot;http://www.microsoft.com/express/&quot;&gt;Visual Web Developer Express&lt;/a&gt;).  The assemblies that come with the tools include the data grid, extra controls like the date picker and various other useful APIs.&lt;br /&gt;&lt;br /&gt;Even better is the &lt;a href=&quot;http://www.codeplex.com/Silverlight&quot;&gt;Silverlight Toolkit&lt;/a&gt;. This is by Microsoft, but Open Source (living on Codeplex and with Unit Tests). As it is a separate project it can have a separate release cycle, including experimental components and being updated more frequently than Silverlight itself.&lt;br /&gt;&lt;br /&gt;The toolkit includes charting components plus new controls covering &lt;span id=&quot;ctl00_ctl00_MasterContent_TabContentPanel_Content_wikiSourceLabel&quot;&gt;styling, layout, and user input.&lt;br /&gt;&lt;br /&gt;Since these releases Jimmy Schementi has been far from idle. His latest blog entries track what he has been up to:&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;ul&gt;&lt;li&gt;&lt;a href=&quot;http://blog.jimmy.schementi.com/2008/11/adding-scripting-to-c-silverlight-app.html&quot;&gt;Adding Scripting to a C# Silverlight Application&lt;/a&gt;&lt;/li&gt;&lt;/ul&gt;Though, for certain scenarios, running scripts in a VB/C# application would be useful. For example, a shopping application that has a bunch of business rules, like &quot;when someone has three items in their cart that all have to do with cooking, give them 10% off.&quot; These type of rules can change all the time, and traditionally you'd either store the rules in a database and implement a engine to understand the rules, or hand-code them yourself and have to redeploy the system every time you want to change them. Or, you could save yourself the hassle and store the rules as Python or Ruby code, and then host the DLR in your application to run the code. Want to update the rules? Just update the code, nothing more.&lt;br /&gt;&lt;ul&gt;&lt;li&gt;&lt;a href=&quot;http://blog.jimmy.schementi.com/2008/11/repls-in-silverlight.html&quot;&gt;&quot;console=true&quot;: REPLs in Silverlight&lt;/a&gt;&lt;/li&gt;&lt;/ul&gt;Embedding an IronRuby REPL (interactive interpreter) in a Silverlight application.&lt;br /&gt;&lt;ul&gt;&lt;li&gt;&lt;a href=&quot;http://blog.jimmy.schementi.com/2008/11/agdlr-silverlight-dlr-open-source.html&quot;&gt;agdlr: Silverlight + DLR + Open Source &lt;/a&gt;&lt;br /&gt;&lt;/li&gt;&lt;/ul&gt;This is the good one! Jimmy posted this email to the IronRuby and IronPython mailing lists:&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;font-style: italic;&quot;&gt;First and foremost, I want to thank anyone who has used the bits on &lt;a href=&quot;http://codeplex.com/sdlsdk&quot;&gt;http://codeplex.com/sdlsdk&lt;/a&gt;, and accepting my bullshit version of open-source. While getting monthly binaries/sources is nice, it should be about working on the project together ... not just me throwing stuff over the wall to you. That's changing, now ...&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;font-style: italic;&quot;&gt;Oh, and remember me complaining about the crappy &quot;sdlsdk&quot; name ... well, I'm trying to get rid of that acronym ...&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;a href=&quot;http://github.com/jschementi/agdlr&quot;&gt;&lt;span style=&quot;font-style: italic;&quot;&gt;http://github.com/jschementi/agdlr&lt;/span&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;font-style: italic;&quot;&gt;Above the public repository for the DLR integration in Silverlight. The following post explains what's in there, what's not, what's git, and how to contribute: &lt;a href=&quot;http://blog.jimmy.schementi.com/2008/11/agdlr-silverlight-dlr-open-source.html&quot;&gt;http://blog.jimmy.schementi.com/2008/11/agdlr-silverlight-dlr-open-source.html&lt;/a&gt;&lt;/span&gt;&lt;a href=&quot;http://blog.jimmy.schementi.com/2008/11/agdlr-silverlight-dlr-open-source.html&quot;&gt;&lt;br /&gt;&lt;/a&gt;&lt;br /&gt;&lt;span style=&quot;font-style: italic;&quot;&gt;My first order of collaboration is this simple new feature, &quot;console=true&quot;:&lt;a href=&quot;http://blog.jimmy.schementi.com/2008/11/repls-in-silverlight.html&quot;&gt; http://blog.jimmy.schementi.com/2008/11/repls-in-silverlight.html&lt;/a&gt;. If you like this, please feel free to look at what's been done, and if you want to fix something that doesn't yet work correctly, I won't stop you.&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;font-style: italic;&quot;&gt;Also, as I mentioned in a previous mail, I want to make the filesystem-&amp;gt;XAP/isolatedstorage metaphor stronger, so feel free to experiment with that as well. Over the next week I'll get some website-presence/wiki/etc, and we can run this project up and running. There are still some hurdles I need to clear with getting contributed code back into our internal codebase, and shipping on Codeplex, but there are no problems with keeping things on GitHub for now.&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;font-style: italic;&quot;&gt;Let me know if there are any question. I know I've been a bit silent on the Silverlight front, but take this as me making it up to you. &lt;/span&gt;&lt;br /&gt;&lt;br /&gt;The resulting discussion also revealed where the Silverlight development tool Chiron got its name from:&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;font-style: italic;&quot;&gt;Yep, Ag is Silver … made pretty obvious by &lt;/span&gt;&lt;a style=&quot;font-style: italic;&quot; href=&quot;http://blog.jimmy.schementi.com/2008/11/agdlr-silverlight-dlr-open-source.html&quot;&gt;my little logo for it&lt;/a&gt;&lt;span style=&quot;font-style: italic;&quot;&gt;.&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;font-style: italic;&quot;&gt;As far as &lt;/span&gt;&lt;a style=&quot;font-style: italic;&quot; href=&quot;http://en.wikipedia.org/wiki/2060_Chiron&quot;&gt;Chiron&lt;/a&gt;&lt;span style=&quot;font-style: italic;&quot;&gt;. It's a planetoid between Saturn and Uranus. The port that Chiron.exe runs on by default, 2060, is Chiron's &quot;object&quot; number. It was derived from the Cassini ASP.NET Web server that Dmitry Robsman wrote. Cassini was a probe mission to explore the moons of Saturn, and Chiron was initially thought to be a moon of Saturn.&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;Plus this from Michael Letterle:&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;font-style: italic;&quot;&gt; More importantly, it's also the name of one of Jonathan Coulton's songs: &quot;&lt;/span&gt;&lt;a style=&quot;font-style: italic;&quot; href=&quot;http://www.jonathancoulton.com/songdetails/Chiron%20Beta%20Prime&quot;&gt;Chiron Beta Prime&lt;/a&gt;&lt;span style=&quot;font-style: italic;&quot;&gt;&quot;.&lt;/span&gt;&lt;br /&gt; &lt;br /&gt;&lt;span style=&quot;font-style: italic;&quot;&gt; Because of this I knew how to pronounce the name :)&lt;/span&gt;
&lt;p&gt;&lt;a href=&quot;http://feeds.feedburner.com/~a/IronpythonUrls?a=aPJAQz&quot;&gt;&lt;img src=&quot;http://feeds.feedburner.com/~a/IronpythonUrls?i=aPJAQz&quot; border=&quot;0&quot; /&gt;&lt;/a&gt;&lt;/p&gt;&lt;img src=&quot;http://feeds.feedburner.com/~r/IronpythonUrls/~4/458969036&quot; height=&quot;1&quot; width=&quot;1&quot; /&gt;</content:encoded>
	<dc:date>2008-11-20T00:03:37+00:00</dc:date>
	<dc:creator>Fuzzyman</dc:creator>
</item>
<item rdf:about="http://www.peterbe.com/plog/domstripper">
	<title>Peter Bengtsson: domstripper - A lxml.html test project</title>
	<link>http://www.peterbe.com/plog/domstripper</link>
	<content:encoded>&lt;p&gt;I'm just playing with the impressive &lt;a href=&quot;http://codespeak.net/lxml/lxmlhtml.html&quot;&gt;lxml.html&lt;/a&gt; package. It makes it possible to easily work with HTML trees and manipulate them. &lt;/p&gt;
&lt;p&gt;I had this crazy idea of a &quot;DOM stripper&quot; that removes all but specified elements from an HTML file. For example you want to keep the contents of the &lt;code&gt;&amp;lt;head&amp;gt;&lt;/code&gt; tag intact but you just want to keep the &lt;code&gt;&amp;lt;div id=&quot;content&quot;&amp;gt;...&amp;lt;/div&amp;gt;&lt;/code&gt; tag thus omitting &lt;code&gt;&amp;lt;div id=&quot;banner&quot;&amp;gt;...&amp;lt;/div&amp;gt;&lt;/code&gt; and &lt;code&gt;&amp;lt;div id=&quot;nav&quot;&amp;gt;...&amp;lt;/div&amp;gt;&lt;/code&gt;. &lt;a href=&quot;http://pypi.python.org/pypi/domstripper/&quot;&gt;domstripper&lt;/a&gt; now does that. This can be used for example as a naive proxy that tranforms a bloated HTML page into a more stripped down smaller version suitable for say mobile web browsers. It's more a proof of concept that anything else. &lt;/p&gt;
&lt;p&gt;To test you just need a virtual python environment and the right system libs to needed to install lxml. This worked for me:
&lt;br /&gt;&lt;/p&gt;&lt;div class=&quot;my_code_default&quot;&gt; $ &lt;span class=&quot;p_36&quot;&gt;sudo&lt;/span&gt; &lt;span class=&quot;p_36&quot;&gt;apt&lt;/span&gt;&lt;span class=&quot;p_38&quot;&gt;-&lt;/span&gt;&lt;span class=&quot;p_36&quot;&gt;get&lt;/span&gt; &lt;span class=&quot;p_36&quot;&gt;install&lt;/span&gt; &lt;span class=&quot;p_36&quot;&gt;cython&lt;/span&gt; &lt;span class=&quot;p_36&quot;&gt;libxslt1&lt;/span&gt;&lt;span class=&quot;p_38&quot;&gt;-&lt;/span&gt;&lt;span class=&quot;p_36&quot;&gt;dev&lt;/span&gt;
&lt;br /&gt; $ &lt;span class=&quot;p_36&quot;&gt;cd&lt;/span&gt; &lt;span class=&quot;p_38&quot;&gt;/&lt;/span&gt;&lt;span class=&quot;p_36&quot;&gt;tmp&lt;/span&gt;
&lt;br /&gt; $ &lt;span class=&quot;p_36&quot;&gt;virtualenv&lt;/span&gt; &lt;span class=&quot;p_38&quot;&gt;--&lt;/span&gt;&lt;span class=&quot;p_36&quot;&gt;no&lt;/span&gt;&lt;span class=&quot;p_38&quot;&gt;-&lt;/span&gt;&lt;span class=&quot;p_36&quot;&gt;site&lt;/span&gt;&lt;span class=&quot;p_38&quot;&gt;-&lt;/span&gt;&lt;span class=&quot;p_36&quot;&gt;packages&lt;/span&gt; &lt;span class=&quot;p_36&quot;&gt;testenv&lt;/span&gt;
&lt;br /&gt; $ &lt;span class=&quot;p_36&quot;&gt;cd&lt;/span&gt; &lt;span class=&quot;p_36&quot;&gt;testenv&lt;/span&gt;
&lt;br /&gt; $ &lt;span class=&quot;p_36&quot;&gt;source&lt;/span&gt; &lt;span class=&quot;p_36&quot;&gt;bin&lt;/span&gt;&lt;span class=&quot;p_38&quot;&gt;/&lt;/span&gt;&lt;span class=&quot;p_36&quot;&gt;activate&lt;/span&gt;
&lt;br /&gt; $ &lt;span class=&quot;p_36&quot;&gt;easy_install&lt;/span&gt; &lt;span class=&quot;p_36&quot;&gt;domstripper&lt;/span&gt;&lt;br /&gt;&lt;/div&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Now you can use it like this:
&lt;br /&gt;&lt;/p&gt;&lt;div class=&quot;my_code_default&quot;&gt; &lt;span class=&quot;p_38&quot;&gt;&amp;gt;&amp;gt;&amp;gt;&lt;/span&gt; &lt;span class=&quot;p_43&quot;&gt;from&lt;/span&gt; &lt;span class=&quot;p_36&quot;&gt;domstripper&lt;/span&gt; &lt;span class=&quot;p_43&quot;&gt;import&lt;/span&gt; &lt;span class=&quot;p_36&quot;&gt;domstripper&lt;/span&gt;
&lt;br /&gt; &lt;span class=&quot;p_38&quot;&gt;&amp;gt;&amp;gt;&amp;gt;&lt;/span&gt; &lt;span class=&quot;p_36&quot;&gt;help&lt;/span&gt;&lt;span class=&quot;p_38&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;p_36&quot;&gt;domstripper&lt;/span&gt;&lt;span class=&quot;p_38&quot;&gt;)&lt;/span&gt;
&lt;br /&gt; &lt;span class=&quot;p_38&quot;&gt;...&lt;/span&gt;
&lt;br /&gt; &lt;span class=&quot;p_38&quot;&gt;&amp;gt;&amp;gt;&amp;gt;&lt;/span&gt; &lt;span class=&quot;p_36&quot;&gt;domstripper&lt;/span&gt;&lt;span class=&quot;p_38&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;p_30&quot;&gt;'bloat.html'&lt;/span&gt;&lt;span class=&quot;p_38&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;p_38&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;p_30&quot;&gt;'#content'&lt;/span&gt;&lt;span class=&quot;p_38&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;p_30&quot;&gt;'h1.header'&lt;/span&gt;&lt;span class=&quot;p_38&quot;&gt;])&lt;/span&gt;
&lt;br /&gt; &lt;span class=&quot;p_38&quot;&gt;&amp;lt;!&lt;/span&gt;&lt;span class=&quot;p_36&quot;&gt;DOCTYPE&lt;/span&gt;&lt;span class=&quot;p_38&quot;&gt;...&lt;/span&gt;
&lt;br /&gt; &lt;span class=&quot;p_38&quot;&gt;...&lt;/span&gt;&lt;br /&gt;&lt;/div&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Best to just play with it and see if makes sense. I'm not saying this is an amazing package but it goes to show what can be done with &lt;code&gt;lxml.html&lt;/code&gt; and the extremely user friendly CSS selectors. &lt;/p&gt;</content:encoded>
	<dc:date>2008-11-19T22:00:00+00:00</dc:date>
</item>
<item rdf:about="http://python.genedrift.org/2008/11/19/creating-an-interface-for-the-motif-finding-script-final/">
	<title>Paulo Nuin: Creating an interface for the motif finding script, final</title>
	<link>http://feedproxy.google.com/~r/BeginningPythonForBioinformatics/~3/NVMl1fzdZz4/</link>
	<content:encoded>&lt;p&gt;We can say that this would be our final version of the script. There are many nice wxPython programming resources, and one is a very good book called &lt;a href=&quot;http://manning.com/rappin/&quot;&gt;wxPython in Action&lt;/a&gt;, which is co-written by Robin Dunn, the wxPython maintainer. Go check it out.&lt;/p&gt;
&lt;p&gt;So for the last entry in this series, we just need to add a couple of changes to our interface and motif finding scripts. Basically on the interface script we need to add a line that gets the value entered (or the default one, if not changed) in the motif width input box. And we can do that by including the line below in the &lt;code&gt;run_finder&lt;/code&gt; function.&lt;/p&gt;
&lt;pre name=&quot;code&quot; class=&quot;python&quot;&gt;width = self.motif_width.GetValue()
&lt;/pre&gt;
&lt;p&gt;This line tells the script to get the value of the box and assign to the variable width. This method will get whatever is inside the input box and save as a string to the variable assigned. Now, we need to create the structure to actually send this value to the motif finder functions. Last version of our function &lt;code&gt;calculate_motifs&lt;/code&gt; received two parameters, we need to add an extra one, and also change the lines that call the function that get the quorums. Basically the first lines of the function will be&lt;/p&gt;
&lt;pre name=&quot;code&quot; class=&quot;python&quot;&gt;def calculate_motifs(input_seqs, input_seqs2, width):

    print input_seqs, input_seqs2
    input_seqs = fasta.read_seqs(open(input_seqs).readlines())
    input_seqs2 = fasta.read_seqs(open(input_seqs2).readlines())

    foreground = get_quorums(input_seqs, width)
    background = get_quorums(input_seqs2, width)
&lt;/pre&gt;
&lt;p&gt;And that’s it. Our simple interface is ready to primetime. OK, not prime primetime, we didn’t add a series of features that will make it useful by everyone. For instance, there is no error control, so someone could enter ‘ABC’ in the width input box and that value would be sent and an error will occur. Also you can click the run button without any file selected. And we could go on and on. But this is just a primer, and we can build from it.&lt;/p&gt;
&lt;p&gt;The code is on &lt;a href=&quot;http://github.com/nuin/beginning-python-for-bioinformatics/tree/master/scripts%2Fmotifs&quot;&gt;Github&lt;/a&gt;, so get it there and have fun. Next time we will see … no plans yet. We’ll see … &lt;/p&gt;
&lt;p&gt;Technorati Tags: &lt;a href=&quot;http://technorati.com/tag/wxPython&quot; class=&quot;performancingtags&quot; rel=&quot;tag&quot;&gt;wxPython&lt;/a&gt;, &lt;a href=&quot;http://technorati.com/tag/motifs&quot; class=&quot;performancingtags&quot; rel=&quot;tag&quot;&gt;motifs&lt;/a&gt;, &lt;a href=&quot;http://technorati.com/tag/Python&quot; class=&quot;performancingtags&quot; rel=&quot;tag&quot;&gt;Python&lt;/a&gt;, &lt;a href=&quot;http://technorati.com/tag/bioinformatics&quot; class=&quot;performancingtags&quot; rel=&quot;tag&quot;&gt;bioinformatics&lt;/a&gt;&lt;/p&gt;
&lt;div class=&quot;feedflare&quot;&gt;
&lt;a href=&quot;http://feedproxy.google.com/~f/BeginningPythonForBioinformatics?a=KS93ckdM&quot;&gt;&lt;img src=&quot;http://feedproxy.google.com/~f/BeginningPythonForBioinformatics?d=41&quot; border=&quot;0&quot; /&gt;&lt;/a&gt; &lt;a href=&quot;http://feedproxy.google.com/~f/BeginningPythonForBioinformatics?a=45vbws5L&quot;&gt;&lt;img src=&quot;http://feedproxy.google.com/~f/BeginningPythonForBioinformatics?i=45vbws5L&quot; border=&quot;0&quot; /&gt;&lt;/a&gt; &lt;a href=&quot;http://feedproxy.google.com/~f/BeginningPythonForBioinformatics?a=yiR48hKJ&quot;&gt;&lt;img src=&quot;http://feedproxy.google.com/~f/BeginningPythonForBioinformatics?d=50&quot; border=&quot;0&quot; /&gt;&lt;/a&gt; &lt;a href=&quot;http://feedproxy.google.com/~f/BeginningPythonForBioinformatics?a=wBPzuNGC&quot;&gt;&lt;img src=&quot;http://feedproxy.google.com/~f/BeginningPythonForBioinformatics?d=52&quot; border=&quot;0&quot; /&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src=&quot;http://feedproxy.google.com/~r/BeginningPythonForBioinformatics/~4/NVMl1fzdZz4&quot; height=&quot;1&quot; width=&quot;1&quot; /&gt;</content:encoded>
	<dc:date>2008-11-19T21:57:24+00:00</dc:date>
	<dc:creator>Paulo Nuin</dc:creator>
</item>
<item rdf:about="http://www.sauria.com/blog/2008/11/19/python-in-netbeans/">
	<title>Ted Leung on the Air: Python in NetBeans</title>
	<link>http://www.sauria.com/blog/2008/11/19/python-in-netbeans/</link>
	<content:encoded>&lt;p&gt;Along with today’s launch of &lt;a href=&quot;http://www.netbeans.org/community/releases/65/&quot;&gt;NetBeans 6.5&lt;/a&gt;, Sun, in cooperation with the NBPython community, are releasing an early access version of Python support for NetBeans. This is a result of the &lt;a href=&quot;http://www.sauria.com/blog/2008/07/08/python-in-netbeans-nbpython/&quot;&gt;collaboration&lt;/a&gt; between Sun people and the NBPython project that I wrote about back in July. This release has been tested by folks in the NetBeans community and some folks from Sun’s NetBeans QA team, and it’s in pretty good shape for an early access release. We’re interested in getting people’s feedback. We would also love to see more people get involved with NBPython.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;How to get it?&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;You can get NetBeans Python from the NetBeans &lt;a href=&quot;http://download.netbeans.org/netbeans/6.5/python/ea/&quot;&gt;download page&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;What’s in it?&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;The basic feature set for the early access release consists of an editor for Python, the ability to execute Python programs (using CPython or Jython), and a debugger.&lt;/p&gt;
&lt;p&gt;There’s a &lt;a href=&quot;http://wiki.netbeans.org/NetBeansPythonTutorial&quot;&gt;tutorial&lt;/a&gt; up on the NetBeans wiki.&lt;/p&gt;
&lt;p&gt;Tor Norbye, who did most of the work on the editor, has written a series of blog posts detailing various features of the Python editor.&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href=&quot;http://blogs.sun.com/tor/date/20080715&quot;&gt;Code folding, semantic highlighting, and instant rename&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;http://blogs.sun.com/tor/date/20080726&quot;&gt;Code completion and quick fixes&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;http://blogs.sun.com/tor/date/20081110&quot;&gt;Import management&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;http://blogs.sun.com/tor/date/20081111&quot;&gt;Finding unresolved symbols&lt;/a&gt; - Tor used this to discover a long standing bug in Jython&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;http://blogs.sun.com/tor/date/20081113&quot;&gt;Support for __all__&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;http://blogs.sun.com/tor/date/20081114&quot;&gt;Code completion in detail&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;strong&gt;Who did it&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;&lt;a href=&quot;http://codesnakes.blogspot.com/&quot;&gt;Allan Davis&lt;/a&gt; - project and platform management, interactive console.&lt;/p&gt;
&lt;p&gt;Jean-Yves Mengant - Jean-Yves is the author of the jpydbg debugger, which he’s merged into NBPython.&lt;/p&gt;
&lt;p&gt;&lt;a href=&quot;http://blogs.sun.com/amitsaha/&quot;&gt;Amit Saha&lt;/a&gt; - documentation and help sets - Amit works for Sun, but he’s doing Python on his own time.&lt;/p&gt;
&lt;p&gt;&lt;a href=&quot;http://blogs.sun.com/tor/&quot;&gt;Tor Norbye&lt;/a&gt; (Sun) - editing.&lt;/p&gt;
&lt;p&gt;Tomas Zezula (Sun) - project and platform management.&lt;/p&gt;
&lt;p&gt;Ted Leung (me) (Sun) - various behind the scenes stuff.&lt;/p&gt;
&lt;p&gt;&lt;a href=&quot;http://fwierzbicki.blogspot.com/&quot;&gt;Frank Wierzbicki&lt;/a&gt; (Sun) - NBPython is using Jython’s parser and Frank worked with Tor to add support for positions and better error reporting.&lt;/p&gt;
&lt;p&gt;Peter Lam (Sun) - Sun QA&lt;/p&gt;
&lt;p&gt;Tony Beckham (Sun) - Sun QA&lt;/p&gt;
&lt;p&gt;The NetBeans CAT community as well as those folks who drove by and reported bugs.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;How to get involved&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;NBPython has become a full fledged NetBeans project, so the main &lt;a href=&quot;http://wiki.netbeans.org/Python&quot;&gt;project page&lt;/a&gt; is now on NetBeans.org, as are the &lt;a href=&quot;http://www.netbeans.org/community/issues.html&quot;&gt;issue tracker&lt;/a&gt; and mailing lists:&lt;/p&gt;
&lt;p&gt;&lt;a href=&quot;mailto:nbpython-dev-subscribe@netbeans.org&quot;&gt;nbpython-dev@netbeans.org&lt;/a&gt;&lt;a href=&quot;mailto:nbpython-dev-subscribe@netbeans.org&quot;&gt;&lt;/a&gt;&lt;br /&gt;
&lt;a href=&quot;mailto:nbpython-dev-subscribe@netbeans.org&quot;&gt;nbpython-issues@netbeans.org&lt;/a&gt;&lt;br /&gt;
&lt;a href=&quot;mailto:nbpython-dev-subscribe@netbeans.org&quot;&gt;nbpython-commits@netbeans.org&lt;/a&gt;&lt;a href=&quot;mailto:nbpython-dev-subscribe@netbeans.org&quot;&gt;&lt;/a&gt;&lt;br /&gt;
&lt;a href=&quot;mailto:nbpython-dev-subscribe@netbeans.org&quot;&gt;nbpython@netbeans.org&lt;/a&gt;&lt;/p&gt;</content:encoded>
	<dc:date>2008-11-19T16:56:00+00:00</dc:date>
	<dc:creator>Ted Leung</dc:creator>
</item>
<item rdf:about="http://blog.vrplumber.com/index.php?/archives/2226-guid.html">
	<title>Mike Fletcher: Now we need 3 million dollars...</title>
	<link>http://blog.vrplumber.com/index.php?/archives/2226-Now-we-need-3-million-dollars....html</link>
	<content:encoded>I chose 1 million dollars as a small number that should be possible to raise if we have a good enough proposal.  The top three voted projects focus on, one way or another, performance and applicability.  The winning project essentially was to improve Python's concurrency storing markedly.  Basically spend the money on hiring people to really pound on multi-processing and maybe even fine-grained locking (concurrent threading) in CPython to produce far better coarse-grained concurrency support.  We'd have to see who would be interested in funding this type of research... we saw concurrency as a problem with the current CPython implementation (though there was the hint that it's a problem of perception, rather than necessarily a practical problem).&lt;br /&gt;&lt;br /&gt;The pan-mobile SDK project was more of an immediate-term goal, but it requires significant compiler technology and a lot of hard work in order to produce a commercial-quality resulting platform/SDK.  There was some question as to whether $1 million would be enough to produce the requisite quality, but as it's a commercial project, the $1 million could be seed money and you might be able to draw handset manufacturers in to further funding.  The project seems very doable, it's just a question of money, time, vision and effort.&lt;br /&gt;&lt;br /&gt;The idea of fine-grained concurrency (e.g. spreading for loops across processors automatically if you can prove there's no dependencies in the loop code) was seen more as a PyPy project, as was the addition of explicit asynchronous operation syntax. We spent a while discussing what would be needed for each project, and the idea that PyPy would make the mobile-targeting SDK easier, and that concurrency/performance issues would be best worked out in PyPy came up a number of times. Effectively, while we had proposals that said &quot;Python should be&quot;, we didn't get a lot of support for the idea of using CPython as the platform for figuring out how to do those things beyond minor changes to the current approaches.&lt;br /&gt;&lt;br /&gt;PyPy development was, by our rough estimates, 10 person-years from being a robust platform for widespread real-world development, that's cutting it close for a mere 1 million dollars, but maybe if we partnered with other people who would have a stake in the result.  Performance improvements, concurrency primitives and back-ends targeting mobile-type platforms were all identified as areas that would make sense to focus energy.  Realistically, though, the core PyPy tool chain probably needs to be the first focus and then we can look at the extras.&lt;br /&gt;&lt;br /&gt;</content:encoded>
	<dc:date>2008-11-19T16:14:08+00:00</dc:date>
	<dc:creator>Mike Fletcher</dc:creator>
</item>
<item rdf:about="tag:blogger.com,1999:blog-8212254010436871241.post-3136577706601695197">
	<title>Malthe Borch: Speedup</title>
	<link>http://mockit.blogspot.com/2008/11/speedup.html</link>
	<content:encoded>&lt;p&gt;You can now have your cake and eat it, too.&lt;/p&gt;&lt;img src=&quot;http://www.testingunderground.com/%7Emborch/plone-benchmark.png&quot; alt=&quot;Plone benchmark comparing Chameleon to ZPT&quot; style=&quot;width: 400px; height: 195px;&quot; /&gt;&lt;br /&gt;&lt;br /&gt;Disclaimer: Don't try this at home! Or actually, do try it, but only on Plone trunk. Simply pull in the &lt;a href=&quot;http://pypi.python.org/pypi/five.pt&quot;&gt;five.pt&lt;/a&gt; egg and load its configuration. It's a whole-sale drop-in replacement of Zope Page Templates.&lt;br /&gt;&lt;br /&gt;If you're interesting in sponsoring this on-going effort, there's an excellent sponsorship opportunity for the upcoming performance-sprint in Bristol. Please contact me by e-mail at &lt;a href=&quot;mailto:mborch@gmail.com&quot;&gt;mborch@gmail.com&lt;/a&gt;.</content:encoded>
	<dc:date>2008-11-19T14:03:00+00:00</dc:date>
	<dc:creator>malthe</dc:creator>
</item>
<item rdf:about="http://nedbatchelder.com/blog/200811/pathological_backtracking.html">
	<title>Ned Batchelder: Pathological backtracking</title>
	<link>http://nedbatchelder.com/blog/200811/pathological_backtracking.html</link>
	<content:encoded>&lt;p&gt;At work we've been using the well-regarded &lt;a href=&quot;http://www.feedparser.org/&quot; class=&quot;offsite&quot;&gt;feedparser&lt;/a&gt;
module to parse RSS feeds, and it works great for the most part, but we'd occasionally
get a stuck server process.  The CPU would spike to 100%, and wouldn't make any progress.
&lt;/p&gt;&lt;p&gt;We discovered a particular feed would cause a particular regular expression in
the code to spin endlessly.  The regex was intended to determine if a style
attribute is valid CSS:&lt;/p&gt;&lt;blockquote class=&quot;code&quot;&gt;&lt;tt&gt;&lt;span class=&quot;p_word&quot;&gt;if&lt;/span&gt;&lt;span class=&quot;p_default&quot;&gt; &lt;/span&gt;&lt;span class=&quot;p_word&quot;&gt;not&lt;/span&gt;&lt;span class=&quot;p_default&quot;&gt; &lt;/span&gt;&lt;span class=&quot;p_identifier&quot;&gt;re&lt;/span&gt;&lt;span class=&quot;p_operator&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;p_identifier&quot;&gt;match&lt;/span&gt;&lt;span class=&quot;p_operator&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;p_string&quot;&gt;&quot;^(\s*[-\w]+\s*:\s*[^:;]*(;|$))*$&quot;&lt;/span&gt;&lt;span class=&quot;p_operator&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;p_default&quot;&gt; &lt;/span&gt;&lt;span class=&quot;p_identifier&quot;&gt;style&lt;/span&gt;&lt;span class=&quot;p_operator&quot;&gt;):&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;p_default&quot;&gt;    &lt;/span&gt;&lt;span class=&quot;p_word&quot;&gt;return&lt;/span&gt;&lt;span class=&quot;p_default&quot;&gt; &lt;/span&gt;&lt;span class=&quot;p_character&quot;&gt;''&lt;/span&gt;&lt;br /&gt;
&lt;/tt&gt;&lt;/blockquote&gt;&lt;p&gt;Breaking this out into
&lt;a href=&quot;http://nedbatchelder.com/blog/200304/verbose_python_regular_expressions.html&quot;&gt;verbose regex syntax&lt;/a&gt;
shows how it matches valid CSS:&lt;/p&gt;&lt;blockquote class=&quot;code&quot;&gt;&lt;tt&gt;&lt;span class=&quot;p_tripledouble&quot;&gt;&quot;&quot;&quot;(?x)             # use verbose regex syntax&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;p_tripledouble&quot;&gt;    ^(&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;p_tripledouble&quot;&gt;                    # A single CSS clause is:&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;p_tripledouble&quot;&gt;    \s*             #   leading whitespace&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;p_tripledouble&quot;&gt;    [-\w]+          #   a dash-word, the property name&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;p_tripledouble&quot;&gt;    \s*:\s*         #   space, colon, space&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;p_tripledouble&quot;&gt;    [^:;]*          #   anything but :;, the value&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;p_tripledouble&quot;&gt;    (;|$)           #   ends with a semi or the end of the string&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;p_tripledouble&quot;&gt;    &lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;p_tripledouble&quot;&gt;    )*              # Valid CSS is any number of clauses&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;p_tripledouble&quot;&gt;    $&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;p_tripledouble&quot;&gt;&quot;&quot;&quot;&lt;/span&gt;&lt;br /&gt;
&lt;/tt&gt;&lt;/blockquote&gt;&lt;p&gt;And here's the snippet discovered in the feed that spun us hard (with
whitespace added for readability):&lt;/p&gt;&lt;blockquote class=&quot;code&quot;&gt;&lt;tt&gt;&amp;lt;var style=&quot;COLOR: #fffafe; coming: ; basket: ; philologist: ; gradually: ;&lt;br /&gt;encyclic: ; whitechapel: ; left: ; albino: ; lamelliform: ; foment: ;&lt;br /&gt;adjuvant: ; Room:  ; Milk:  ; buynow: ; wheelwork: ; unseal: ; reasons: ;&lt;br /&gt;socalled: ; dazed: ; Brain:  ; Kaleidoscope:  ; hardheaded: ; asthenic: ;&lt;br /&gt;preferred: ;  Barbecue:  ; Comet:  ; Nail:  ; lubberly: ; School:  ;&lt;br /&gt;Mist:  ; undercurrent: ; intwine: ; isotonic: ; Chief:  ; miscellaneous: ;&lt;br /&gt;Book:  ; Shoes:  ; Chocolates:  ; deuced: ; you: ; Man:  ; federalize: ;&lt;br /&gt;Rainbow:  ; Satellite:  ; Printer:  ; amicus: ; tautophony: ; taking: ;&lt;br /&gt;regrater: ; waggon: ; prescient: ; God:  ; prosing: ; Bank:  ; hariolation: ;&lt;br /&gt;patriarchs: ; Pyramid:  ; Data Base:  ; PaintBrush:  ; ingenu: ; Rope:  ;&lt;br /&gt;parenchyma: ; price: ; Alphabet:  ; Circle:  ; seeks: ; frankhearted: ;&lt;br /&gt;vituperate: ; dysmeromorph: ; Shop:  ; firm: ;  imperforation: ; lane: ;&lt;br /&gt;Gemstone:  ; slatternly: ; Fire:  ; impudence: ; Carrot:  ; Fan:  ;&lt;br /&gt;inoccupation: ; uncover: ; Liquid:  ; drawee: ; Pocket:  ;barbacan: ;&lt;br /&gt;fornicatress: ; chimes: ; Crystal:  ;innovation: ; years: ; untiring: ;&lt;br /&gt;Freeway:  ;desertful: ; unreined: ; Compass:  ; Hose:  ;prelusive: ;&lt;br /&gt;impenetrability: ; Fruit:  ; direct: ; &quot;&amp;gt;&amp;lt;/var&amp;gt;&lt;br /&gt;&lt;/tt&gt;&lt;/blockquote&gt;&lt;p&gt;(yes, it's garbage, and yes, spam sucks.)&lt;/p&gt;&lt;p&gt;It's hard to see the problem here, but this is not valid CSS because they used
&quot;Data Base&quot; as a property name about half-way through and spaces aren't allowed
in property names.&lt;/p&gt;&lt;p&gt;The CPU spins because when the regex encounters the failure to match &quot;Data Base&quot;,
it backtracks to reconsider previous matches in the hopes that it can still make
the regex work.  In fact, it isn't in an infinite loop, just a very very very long
one.  Eventually this regex will finish and decide that the string doesn't match.&lt;/p&gt;&lt;p&gt;But we don't need it to backtrack: going back to re-match previous CSS clauses
isn't going to help.&lt;/p&gt;&lt;p&gt;Some regex libraries offer solutions to this problem.
&lt;a href=&quot;http://www.regular-expressions.info/possessive.html&quot; class=&quot;offsite&quot;&gt;Possessive quantifiers&lt;/a&gt;
let you use *+ to mean, match as many as possible, and once matched, don't try
matching fewer during backtracking.  They're called possessive because once the
operator claims part of the string, it won't give it back for other operators to
match later.&lt;/p&gt;&lt;p&gt;But Python doesn't offer possessive quantifiers
(&lt;a href=&quot;http://bugs.python.org/issue2636&quot; class=&quot;offsite&quot;&gt;yet&lt;/a&gt; &lt;a href=&quot;http://bugs.python.org/issue3825&quot; class=&quot;offsite&quot;&gt;yet&lt;/a&gt;).
So we have to choose a different technique than trying to match the whole string
in one large regex. In this case, since we don't need the match data, we're just
checking that the whole string matches, so we can use re.sub to remove matching
clauses and then check that there's nothing left over:&lt;/p&gt;&lt;blockquote class=&quot;code&quot;&gt;&lt;tt&gt;&lt;span class=&quot;p_word&quot;&gt;if&lt;/span&gt;&lt;span class=&quot;p_default&quot;&gt; &lt;/span&gt;&lt;span class=&quot;p_identifier&quot;&gt;re&lt;/span&gt;&lt;span class=&quot;p_operator&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;p_identifier&quot;&gt;sub&lt;/span&gt;&lt;span class=&quot;p_operator&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;p_string&quot;&gt;&quot;\s*[-\w]+\s*:\s*[^:;]*;?\s*&quot;&lt;/span&gt;&lt;span class=&quot;p_operator&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;p_default&quot;&gt; &lt;/span&gt;&lt;span class=&quot;p_character&quot;&gt;''&lt;/span&gt;&lt;span class=&quot;p_operator&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;p_default&quot;&gt; &lt;/span&gt;&lt;span class=&quot;p_identifier&quot;&gt;style&lt;/span&gt;&lt;span class=&quot;p_operator&quot;&gt;):&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;p_default&quot;&gt;    &lt;/span&gt;&lt;span class=&quot;p_word&quot;&gt;return&lt;/span&gt;&lt;span class=&quot;p_default&quot;&gt; &lt;/span&gt;&lt;span class=&quot;p_character&quot;&gt;''&lt;/span&gt;&lt;br /&gt;
&lt;/tt&gt;&lt;/blockquote&gt;&lt;p&gt;Because re.sub grabs matches, performs the replacement, and moves on, there's
no needless backtracking to throw a wrench in the works.  Now our crazy CSS spam
is speedily dispatched as invalid.&lt;/p&gt;&lt;p&gt;As an interesting side effect, if the string is not empty, what remains is
the invalid part of the string.&lt;/p&gt;</content:encoded>
	<dc:date>2008-11-19T13:14:18+00:00</dc:date>
</item>
<item rdf:about="tag:www.cmlenz.net,2008-07-03:a2608fcc991a48a7bc3301fdfc9163c0">
	<title>Christopher Lenz: The Truth About Unicode In Python</title>
	<link>http://www.cmlenz.net/archives/2008/07/the-truth-about-unicode-in-python</link>
	<content:encoded>&lt;p&gt;The unicode support in Python is generally considered to be pretty good. And in comparison to many other languages, it's good indeed.&lt;/p&gt;
&lt;p&gt;But compared to what is provided by the &lt;a href=&quot;http://icu-project.org/&quot;&gt;International Components for Unicode&lt;/a&gt; (ICU) project, there's also a lot missing, including &lt;a href=&quot;http://www.cmlenz.net/archives/python/feed.xml#collation&quot;&gt;collation&lt;/a&gt;, &lt;a href=&quot;http://www.cmlenz.net/archives/python/feed.xml#case-conversion&quot;&gt;special case conversions&lt;/a&gt;, &lt;a href=&quot;http://www.cmlenz.net/archives/python/feed.xml#regular-expressions&quot;&gt;regular expressions&lt;/a&gt;, &lt;a href=&quot;http://www.cmlenz.net/archives/python/feed.xml#text-segmentation&quot;&gt;text segmentation&lt;/a&gt;, and &lt;a href=&quot;http://www.cmlenz.net/archives/python/feed.xml#bidi-text&quot;&gt;bidirectional text handling&lt;/a&gt;. Not to mention extensive support for locale-specific formatting of dates and numbers and time calculations with different calendars.&lt;/p&gt;
&lt;p&gt;Basically what Python &lt;em&gt;does&lt;/em&gt; provide out of the box is “only” encoding/decoding, &lt;a href=&quot;http://unicode.org/faq/normalization.html&quot;&gt;normalization&lt;/a&gt;, and some other bits such as simple case conversion and splitting on whitespace. It's the absolute minimum you need to do anything useful with unicode, but often not enough to build truly internationalized applications. (Fortunately, most applications get away without true internationalization.)&lt;/p&gt;
&lt;p&gt;In this post, I'm going to talk about a couple of the problems with unicode in Python. Please note that this is not intended as a criticism of Python's unicode support or the people who designed and implemented it. Most of those people probably know a whole lot more about unicode than I do, and the limitations discussed here are the result of a pragmatic approach to implementing unicode support, rather than due to a lack of knowledge.&lt;/p&gt;
      &lt;p&gt;
        &lt;a href=&quot;http://www.cmlenz.net/archives/2008/07/the-truth-about-unicode-in-python#more&quot;&gt;read on …&lt;/a&gt;
      &lt;/p&gt;</content:encoded>
	<dc:date>2008-11-19T09:05:44+00:00</dc:date>
</item>
<item rdf:about="http://simonwillison.net/2008/Nov/19/django/">
	<title>Simon Willison's Weblog: Django 1.0.2 released</title>
	<link>http://simonwillison.net/2008/Nov/19/django/</link>
	<content:encoded>&lt;div class=&quot;blogmark segment&quot;&gt;&lt;p&gt;&lt;a href=&quot;http://www.djangoproject.com/weblog/2008/nov/18/102/&quot;&gt;Django 1.0.2 released&lt;/a&gt;. An update to last week’s 1.0.1 release, which I failed to link to. 1.0.2 mainly fixes some packaging issues, while 1.0.1 contains “over two hundred fixes to the original Django 1.0 codebase”. The team are holding up the promise to move to a regular release cycle after 1.0.&lt;/p&gt;
&lt;/div&gt;</content:encoded>
	<dc:date>2008-11-19T08:46:27+00:00</dc:date>
</item>
<item rdf:about="tag:blogger.com,1999:blog-11788780.post-991813146212854373">
	<title>Shannon -jj Behrens: Misspelled Variables</title>
	<link>http://jjinux.blogspot.com/2008/11/misspelled-variables.html</link>
	<content:encoded>Care to guess what happens when you execute the following PHP?&lt;pre&gt;define('FOO', 'Hi');&lt;br /&gt;print(FO);&lt;/pre&gt;It prints 'FO'.&lt;br /&gt;&lt;br /&gt;I do believe PHP got this from Perl:&lt;pre&gt;perl&lt;br /&gt;print FOO . &quot;FOO&quot;;  # Prints FOOFOO&lt;/pre&gt;It works even if you're strict:&lt;pre&gt;perl -w&lt;br /&gt;use strict;&lt;br /&gt;print FOO . &quot;FOO&quot;;  # Prints FOOFOO&lt;/pre&gt;Ruby behaves differently depending on whether you try to print an undefined variable/method or an undefined attribute:&lt;pre&gt;irb&lt;br /&gt;&amp;gt;&amp;gt; print a&lt;br /&gt;NameError: undefined local variable or method `a' for main:Object&lt;br /&gt; from (irb):1&lt;br /&gt;&amp;gt;&amp;gt; print @a&lt;br /&gt;nil=&amp;gt; nil&lt;/pre&gt;Python raises an exception:&lt;pre&gt;python&lt;br /&gt;&amp;gt;&amp;gt;&amp;gt; print a&lt;br /&gt;Traceback (most recent call last):&lt;br /&gt;  File &quot;&amp;lt;stdin&amp;gt;&quot;, line 1, in &amp;lt;module&amp;gt;&lt;br /&gt;NameError: name 'a' is not defined&lt;/pre&gt;In a compiled language, these sorts of errors would be caught at compile time.  However, a compiled language would never let me do something like:&lt;pre&gt;python&lt;br /&gt;&amp;gt;&amp;gt;&amp;gt; var_name = 'a'&lt;br /&gt;&amp;gt;&amp;gt;&amp;gt; locals()[var_name] = 'yep'&lt;br /&gt;&amp;gt;&amp;gt;&amp;gt; print a&lt;br /&gt;yep&lt;/pre&gt;This example is a bit contrived, but I've definitely done things like it.&lt;br /&gt;&lt;br /&gt;Personally, I like the flexibility of a scripting language.  I like it even more when there's a tool like pychecker that can catch these sorts of errors.  However, just because a scripting language doesn't have a compilation step that can catch stupid spelling mistakes doesn't mean it should accept them at runtime.  I'd much rather deal with an exception than spend half an hour fighting a bug caused by a spelling error!&lt;br /&gt;&lt;br /&gt;As a general rule, I think software should fail fast rather than glossing over bugs that will surely cause trouble later.  I can handle the exception if I need to, but what I can't handle is a silent bug.</content:encoded>
	<dc:date>2008-11-19T05:59:51+00:00</dc:date>
	<dc:creator>Shannon -jj Behrens</dc:creator>
</item>
<item rdf:about="http://www.djangoproject.com/weblog/2008/nov/18/102/">
	<title>Django Weblog: Django 1.0.2 released</title>
	<link>http://www.djangoproject.com/weblog/2008/nov/18/102/</link>
	<content:encoded>&lt;p&gt;Shortly after last week's &lt;a href=&quot;http://www.djangoproject.com/weblog/2008/nov/15/101/&quot;&gt;Django 1.0.1 release&lt;/a&gt;, several people noted that the packaging script used to produce the release omitted several directories from the Django source tree; mostly this affected some unit tests, but at least one of the omitted directories affected the use of Django itself (specifically, of &lt;code&gt;django.contrib.gis&lt;/code&gt;). So tonight we're issuing Django 1.0.2, which is built around an updated packaging script and should resolve these problems.&lt;/p&gt;

&lt;p&gt;This is a recommended upgrade for anyone using or targeting Django 1.0 or Django 1.0.1; to obtain a copy, swing by &lt;a href=&quot;http://www.djangoproject.com/download/&quot;&gt;the downloads page&lt;/a&gt;, and don't forget to read &lt;a href=&quot;http://docs.djangoproject.com/en/dev/releases/1.0.2/&quot;&gt;the release notes&lt;/a&gt;. For the security conscious, &lt;a href=&quot;http://media.djangoproject.com/pgp/Django-1.0.2-final.checksum.txt&quot;&gt;a signed file containing the package's checksums&lt;/a&gt; is, as always, available.&lt;/p&gt;</content:encoded>
	<dc:date>2008-11-19T05:52:39+00:00</dc:date>
</item>
<item rdf:about="http://blog.vrplumber.com/index.php?/archives/2225-guid.html">
	<title>Mike Fletcher: Million Dollar Ideas Wrap-up from PyGTA</title>
	<link>http://blog.vrplumber.com/index.php?/archives/2225-Million-Dollar-Ideas-Wrap-up-from-PyGTA.html</link>
	<content:encoded>&lt;br /&gt;
&lt;p&gt;Great fun at PyGTA this evening.  We had an overly complex voting&lt;br /&gt;
scheme, basically you could vote from 0 to 5 (5 being the highest) for&lt;br /&gt;
each project, total count wins.  We had &lt;a href=&quot;http://www.engcorp.com/mailman/private/pygta-general/2008/000411.html&quot;&gt;quite a few proposals&lt;/a&gt;, and&lt;br /&gt;
laughed rather a lot during the process.&lt;/p&gt;&lt;p&gt;My take-aways:&lt;/p&gt;&lt;ul&gt;&lt;li&gt;Concurrency matters in multi-core systems, Python needs work here&lt;/li&gt;&lt;li&gt;Performance/scaling matters, we want to take Python to smaller hardware and mobile devices particularly&lt;/li&gt;&lt;li&gt;PyPy is seen as the vehicle for radical improvements to the language, not CPython&lt;/li&gt;&lt;li&gt;We want to make public services better&lt;/li&gt;&lt;li&gt;We want to help educate people &lt;/li&gt;&lt;li&gt;We'd like to &lt;a href=&quot;http://www.engcorp.com/mailman/private/pygta-general/2008/000412.html&quot;&gt;stop spam&lt;/a&gt;&lt;/li&gt;&lt;li&gt;Disinterest in Python 3000 is strong, but not universal, and seems to be weakening&lt;/li&gt;&lt;/ul&gt;&lt;br /&gt;
We also discussed the sorry state of the PyGTA web-site.  We really need to get it updated.  I'm thinking a simple CMS-type site, with:&lt;br /&gt;&lt;br /&gt;
&lt;ul&gt;&lt;li&gt;a calendar&lt;/li&gt;&lt;li&gt;a trace of the announcements (a blog...)&lt;/li&gt;&lt;li&gt;the ability for a few people to post notices/topics (i.e. I shouldn't be the single point of failure)&lt;/li&gt;&lt;li&gt;maybe an RSS feed&lt;/li&gt;&lt;li&gt;pointers to&lt;br /&gt;
the mailing-lists&lt;/li&gt;&lt;/ul&gt;&lt;p&gt;&lt;br /&gt;
The Wiki features just don't get used enough to bother with them it seems.  I've got the pygta.org domain registered with Vex, so we can redirect it wherever we want once we know where we want to direct it.&lt;br /&gt;
[Update] Since the PyGTA-general list is subscriber only, here's the summary reposted:&lt;/p&gt;&lt;pre&gt;Given:&lt;br /&gt;   o 1 million (CDN) dollars&lt;br /&gt;   o around 5 years (maximum) for core benefits to be realized&lt;br /&gt;   o must enhance Python in some way or use Python to provide some&lt;br /&gt;     benefit to the world&lt;br /&gt;         o you need to explain how your project will benefit the world&lt;br /&gt;           and/or investors&lt;br /&gt;         o you are trying to convince &quot;us&quot; to invest, so make it good&lt;br /&gt;   o can be commercial, philanthropic, Open Source or what have you&lt;br /&gt;&lt;br /&gt;Ideas:&lt;/pre&gt;&lt;pre&gt;   o Concurrency  45&lt;br /&gt;         o Threads (coarse grained concurrency)&lt;br /&gt;         o Multiprocessing module&lt;br /&gt;         o Twisted constructs into the core (syntactic extensions)&lt;br /&gt;         o HTTP Client Library (beyond all current C or Python versions)&lt;br /&gt;         o CPython GIL Elimination&lt;br /&gt;&lt;br /&gt;   o Mobile Applications 35&lt;br /&gt;         o Frameworks for developing mobile applications for cell&lt;br /&gt;           phones, smart devices etceteras&lt;br /&gt;         o Unified application development framework&lt;br /&gt;         o Optimization&lt;br /&gt;         o Experts for devices&lt;br /&gt;         o IDE Development/GUI tools&lt;br /&gt;         o Money-maker&lt;br /&gt;&lt;br /&gt;   o PyPy finishing 34&lt;br /&gt;         o Performance&lt;br /&gt;         o Concurrency&lt;br /&gt;         o Targeting low-level hardware (mobiles)&lt;br /&gt;&lt;br /&gt;   o Public Transportation System 33&lt;br /&gt;         o Cooler signaling system for the subways&lt;br /&gt;         o Timing for bus-stops and bus-stations&lt;br /&gt;         o Electronic monitoring system for the public transport system&lt;br /&gt;         o Central server in Python&lt;br /&gt;         o Mathematicians&lt;br /&gt;         o Money maker, increases ridership, no monthly-pass increases&lt;br /&gt;         o On-demand signaling and routing?&lt;br /&gt;&lt;br /&gt;   o Training for non-programmers in Python (or Programming)  29&lt;br /&gt;         o Extending the utility of computers in non-technical environments&lt;br /&gt;         o Mechanism for replacing spreadsheets and the like&lt;br /&gt;         o Reduces effort for getting jobs done&lt;br /&gt;         o Seminars, presentations, TV programs&lt;br /&gt;&lt;br /&gt;   o Kids need to be empowered with computers 28&lt;br /&gt;         o Programming education for the young (8 years)&lt;br /&gt;         o Gulag method versus fun and games education&lt;br /&gt;         o Game writing, game sales&lt;br /&gt;         o Robots, turtles, lego mindstorms&lt;br /&gt;         o Good of the world&lt;br /&gt;         o No top-end to the language involved&lt;br /&gt;         o It's an Empowerment Project, Not a Programming Project&lt;br /&gt;&lt;br /&gt;   o Write a game to teach kids history/geography  25&lt;br /&gt;         o Grade school or high-school level&lt;br /&gt;         o Fun (constructivist) games&lt;br /&gt;         o Where in the World is Carmen Sandiego&lt;br /&gt;         o Commercial quality games&lt;br /&gt;         o Educational input from government or the like&lt;br /&gt;         o Some programmers required, user testing&lt;br /&gt;         o Postgresql, Python, Web Application&lt;br /&gt;         o Test driven environment, agile development methods&lt;br /&gt;         o Google Software:  E-Learning&lt;br /&gt;&lt;br /&gt;   o Seneca's Tuition 25&lt;br /&gt;         o ???&lt;br /&gt;&lt;br /&gt;   o UI Design, user feedback 22&lt;br /&gt;         o Video camera showing the screen&lt;br /&gt;         o Tracking and correlation of details and video of user&lt;br /&gt;               + Eye tracking mechanism&lt;br /&gt;         o Analytics regarding task-oriented completion (statistical&lt;br /&gt;           analysis)&lt;br /&gt;         o Frustration measurement instrumentation&lt;br /&gt;               + Heartbeat, pulse, blood pressure monitors&lt;br /&gt;         o Adjustable screen arrangements&lt;br /&gt;               + UI design in-test&lt;br /&gt;         o Meta queries for optimizations&lt;br /&gt;               + Feedback in the middle the tests&lt;br /&gt;         o Maybe money maker&lt;br /&gt;&lt;br /&gt;   o CPython JIT 20&lt;br /&gt;&lt;br /&gt;   o Eliminate Python 3000 19&lt;br /&gt;&lt;br /&gt;   o Genome Study 19&lt;br /&gt;         o Non-academic access to genomic research&lt;br /&gt;         o Organization/body to grant access to non-professional or&lt;br /&gt;           non-academic researchers&lt;br /&gt;         o Open Access&lt;br /&gt;         o Python as the server for the data&lt;br /&gt;         o Python on a cluster to perform ad-hoc processing of genomic data&lt;br /&gt;         o Sci-Py/Numpy and distributed cluster&lt;br /&gt;         o Money maker&lt;br /&gt;&lt;br /&gt;   o Voting Software 18&lt;br /&gt;         o Web-base ad-hoc voting systems&lt;/pre&gt;&lt;p&gt;and the after-the-vote proposal:&lt;br /&gt;
&lt;/p&gt;&lt;p&gt;Create an AI-like system that can respond to all incoming spams in a way which requires the spammers to respond with a non-trivial response, something that convinces the spammers that they have a mark.  Installing on millions upon millions of machines, the spammers are deluged with possible marks and must spend real time and effort to sort out the back-spams from the real marks.  We effectively hide the marks in a forest of fake marks to target the spammer's ability to make money.&lt;/p&gt;</content:encoded>
	<dc:date>2008-11-19T05:44:02+00:00</dc:date>
	<dc:creator>Mike Fletcher</dc:creator>
</item>
<item rdf:about="http://jtauber.com/blog/2008/11/18/discrete_cosine_transforms_part_1">
	<title>James Tauber: Discrete Cosine Transforms Part 1</title>
	<link>http://jtauber.com/blog/2008/11/18/discrete_cosine_transforms_part_1/</link>
	<content:encoded>&lt;p&gt;I've often been intrigued by the lossy part of JPEG compression so I thought I'd explore Discrete Cosine Transforms and their use in JPEG as a short multi-part blog series.
&lt;/p&gt;
&lt;p&gt;
In this part, lets just talk about what a &quot;discrete cosine&quot; function is and then in the next couple of posts look at how the concept can be combined with basic linear algebra to break up images into components in such a way that you can throw out some components with minimal effect on the perceived image. It's quite clever but the mathematics is fairly straightforward.
&lt;/p&gt;
&lt;p&gt;
Let's start with a single cycle of a cosine function shifted up and scaled so its values range from 0-255 instead of from -1 to +1. To make it discrete, we'll divide it up into four and simply take the value of the scaled cosine function at the midpoint of each of our four sections:
&lt;/p&gt;
&lt;p&gt;
&lt;img src=&quot;http://jtauber.com/2008/11/discrete_cosine2.png&quot; title=&quot;2/2 cycles&quot; /&gt;
&lt;/p&gt;
&lt;p&gt;
Here our four discrete values are 217, 39, 39, 217 .
&lt;/p&gt;
&lt;p&gt;
Now let's do the same for one and a half cycles:
&lt;/p&gt;
&lt;p&gt;
&lt;img src=&quot;http://jtauber.com/2008/11/discrete_cosine3.png&quot; title=&quot;3/2 cycles&quot; /&gt;
&lt;/p&gt;
&lt;p&gt;
which yields values of 176, 11, 245 and 80.
&lt;/p&gt;
&lt;p&gt;
Now half a cycle:
&lt;/p&gt;
&lt;p&gt;
&lt;img src=&quot;http://jtauber.com/2008/11/discrete_cosine1.png&quot; title=&quot;1/2 cycles&quot; /&gt;
&lt;/p&gt;
&lt;p&gt;
which yields 245, 176, 80 and 11 and zero cycles:
&lt;/p&gt;
&lt;p&gt;
&lt;img src=&quot;http://jtauber.com/2008/11/discrete_cosine0.png&quot; title=&quot;0/2 cycles&quot; /&gt;
&lt;/p&gt;
&lt;p&gt;
which gives us 255, 255, 255, 255
&lt;/p&gt;
&lt;p&gt;
We've basically calculated values for 0 thru 3 half cycles. If we wanted to split the cosine into N pieces instead of 4, we'd calculate values for 0 thru N-1 half cycles.
&lt;/p&gt;
&lt;p&gt;
But, in summary, for N = 4:
&lt;/p&gt;
&lt;ul&gt;&lt;li&gt;k = 3: 176, 11, 245, 80
&lt;/li&gt;
&lt;li&gt;k = 2: 217, 39, 39, 217
&lt;/li&gt;
&lt;li&gt;k = 1: 245, 176, 80, 11
&lt;/li&gt;
&lt;li&gt;k = 0: 255, 255, 255, 255
&lt;/li&gt;&lt;/ul&gt;</content:encoded>
	<dc:date>2008-11-19T00:30:11+00:00</dc:date>
	<dc:creator>James Tauber</dc:creator>
</item>
<item rdf:about="tag:blogger.com,1999:blog-10678074.post-2580251818399697002">
	<title>Rene Dudfield: pygame reloaded</title>
	<link>http://renesd.blogspot.com/2008/11/pygame-reloaded.html</link>
	<content:encoded>So &lt;a href=&quot;http://www.sysfault.org/&quot;&gt;Marcus&lt;/a&gt; has been working away in the background refactoring/rewriting &lt;a href=&quot;http://www.pygame.org/&quot;&gt;pygame&lt;/a&gt;.  Hopefully his work will become part of pygame 2.0... but in the mean time we hope to do another set of 1.x pygame releases.&lt;br /&gt;&lt;br /&gt;The main pieces I see for another pygame release are the evolution of the testing frame work into a library, examples as a library, the camera module, and many other changes are coming to pygame... including pygame coming to another implementation of python... &lt;a href=&quot;http://www.tinypy.org/&quot;&gt;tinypy&lt;/a&gt;!&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Below are Marcus's notes about the pygame reloaded release.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Features&lt;br /&gt;--------&lt;br /&gt;* New FRect class for high precision rectangle handling using floating point&lt;br /&gt; values.&lt;br /&gt; FRect and Rect share the same properties and functions and can be converted&lt;br /&gt; into the other rectangle type without any problems.&lt;br /&gt;* New PixelFormat class that wraps up SDL_PixelFormat.&lt;br /&gt;* New CDTrack class that keeps information about CD tracks.&lt;br /&gt;* New physics module integrated. Zhang Fan's GSoC work on an easy to use&lt;br /&gt; physics simulation is now available.&lt;br /&gt;* New sdlgfx module, which wraps up the SDL_gfx library and adds features&lt;br /&gt; such as fast zoom and drawing primitives or FPS management.&lt;br /&gt;* Improved C API.&lt;br /&gt;* Improved SDL sound and channel handling. Though not perfect, they are more&lt;br /&gt; robust now.&lt;br /&gt;* Completely rewritten build system, allowing a fine grained build&lt;br /&gt; configuration for nearly any purpose.&lt;br /&gt;* Completely rewritten documentation system.&lt;br /&gt;* Installation is compatible towards pygame - it goes into a new&lt;br /&gt; namespace and module hierarchy, so having pygame and pygame2 installed&lt;br /&gt; won't hurt your pygame 1.x applications.&lt;br /&gt;&lt;br /&gt;Besides those great things about which we all can get excited, there are&lt;br /&gt;some downsides to it - otherwise it would not be pygame.&lt;br /&gt;&lt;br /&gt;Changes&lt;br /&gt;-------&lt;br /&gt;* Module, class and package layout changed.&lt;br /&gt;* Completely different API in nearly all places for both, Python and C.&lt;br /&gt;* No ABI or API compatibility towards pygame 1.x (and it is not planned!)&lt;br /&gt;* Feature compatibility towards pygame 1.x only in limited areas.&lt;br /&gt;* Overhauled test system.&lt;br /&gt;&lt;br /&gt;Downsides&lt;br /&gt;---------&lt;br /&gt;* Early development stage. Expect weird things to happen when you use it.&lt;br /&gt;* Not many examples and tests yet.&lt;br /&gt;* API likely to change before an official release is made.&lt;br /&gt;* MacOS support not available yet.&lt;br /&gt;* physics module not working yet.&lt;br /&gt;* Many other issues to be revealed.</content:encoded>
	<dc:date>2008-11-19T00:19:28+00:00</dc:date>
	<dc:creator>illume</dc:creator>
</item>
<item rdf:about="http://nedbatchelder.com/blog/200811/victoria_marcus_olds_19112008.html">
	<title>Ned Batchelder: Victoria Marcus Olds, 1911–2008</title>
	<link>http://nedbatchelder.com/blog/200811/victoria_marcus_olds_19112008.html</link>
	<content:encoded>&lt;p&gt;My grandmother died this morning.  She was 97 years old, a good long life.
She lived in New York City most of my life, but lived in a nursing home near me
in Boston for the last year, so I saw her a few times, and
&lt;a href=&quot;http://nedbatchelder.com/text/victoria-olds.html&quot;&gt;those visits taught me some things about her&lt;/a&gt;.
&lt;/p&gt;</content:encoded>
	<dc:date>2008-11-19T00:14:08+00:00</dc:date>
</item>
<item rdf:about="http://www.protocolostomy.com/?p=401">
	<title>Brian Jones: MySQL Problem and Solution Posts: r0ck.</title>
	<link>http://www.protocolostomy.com/2008/11/18/mysql-problem-and-solution-posts-r0ck/</link>
	<content:encoded>&lt;p&gt;Taming MySQL is… challenging. Especially in very large, fast-growth, ‘always-on’ environments. It’s one of those things where you seemingly can never know all there is to know about it. That’s why I really like coming across posts like &lt;a href=&quot;http://www.freshbooks.com/blog/2008/09/09/now-were-flying/&quot;&gt;this one from FreshBooks&lt;/a&gt; that describes a very real problem that was affecting their users, how they dealt with it, why *that* failed, and what the final fix was. Post a link to your favorite MySQL Problem and Solution post in the comments (oh yeah, and “subscribe to comments” should be working now!)&lt;/p&gt;</content:encoded>
	<dc:date>2008-11-18T21:30:50+00:00</dc:date>
	<dc:creator>m0j0</dc:creator>
</item>
<item rdf:about="tag:blogger.com,1999:blog-3776799.post-5280401170045483801">
	<title>Sean McGrath: Open Source Considered Harmful</title>
	<link>http://feeds.feedburner.com/~r/SeanMcGrath/~3/457564266/open-source-considered-harmful.html</link>
	<content:encoded>&lt;ul&gt;&lt;i&gt;&quot;It is hot in this kitchen and getting hotter all the time. What to do? Find a way to reduce the heat or leverage the latest asbestos suits? We are mostly doing the latter. -- &lt;a href=&quot;http://www.itworld.com/open-source/57525/open-source-considered-harmful&quot;&gt;Open Source Considered Harmful&lt;/a&gt;&lt;/i&gt;&lt;/ul&gt;</content:encoded>
	<dc:date>2008-11-18T20:02:00+00:00</dc:date>
	<dc:creator>Sean</dc:creator>
</item>
<item rdf:about="http://python.genedrift.org/2008/11/18/creating-an-interface-for-the-motif-finding-script-some-corrections/">
	<title>Paulo Nuin: Creating an interface for the motif finding script, some corrections</title>
	<link>http://feedproxy.google.com/~r/BeginningPythonForBioinformatics/~3/d-xPuvKEix8/</link>
	<content:encoded>&lt;p&gt;We need to pause a bit and do some corrections on our code. First the code I posted on the last entry for the pymotif.py module is wrong. Ok, not wrong, but some of the code I use to test ended up on the blog. Ths first two lines of the calculate_motifs function contained a link to the files I use for testing and should be replaced by&lt;/p&gt;
&lt;pre name=&quot;code&quot; class=&quot;python&quot;&gt;input_seqs = fasta.read_seqs(open(input_seqs).readlines())
input_seqs2 = fasta.read_seqs(open(input_seqs2).readlines())
&lt;/pre&gt;
&lt;p&gt;Also both variables that store the filenames and paths in pymoteGUI.py are declared in the wrong scope. The should have be declared at the pymotGUI class level, so it is accessible to all the functions in that class. This also means that every time we access the variable it should be preceded by the class name in order for the interpreter to know where the to get the value from. So both corrected files would be&lt;/p&gt;
&lt;pre name=&quot;code&quot; class=&quot;python&quot;&gt;#!/usr/bin/env python

import wx
import pymot
import pymotif
import fasta
import os

class pymot(wx.App):

    def __init__(self, redirect=False):
        wx.App.__init__(self, redirect)

class pymotGUI(wx.Frame):

    fore_file = ''
    back_file = ''

    def __init__(self, parent, id):
        wx.Frame.__init__(self, parent, id,  'Python Motif Finder', style=wx.DEFAULT_FRAME_STYLE)
        self.__do_layout()

    def __do_layout(self):

        #adding the panel
        panel = wx.Panel(self)

        #defines the menubar
        menubar = wx.MenuBar()

        #file menu
        filemenu = wx.Menu()
        foreground_menu = filemenu.Append(-1, 'Select foreground file')
        background_menu = filemenu.Append(-1, 'Select background file')
        sep = filemenu.AppendSeparator()
        quitmenu = filemenu.Append(-1, 'Quit')

        #appends the menu to the menubar and creates it
        menubar.Append(filemenu, 'File')
        self.SetMenuBar(menubar)

        #input box for motif width, and label
        self.one_label = wx.StaticText(panel, -1, 'Motif width', (10,50))
        self.motif_width = wx.TextCtrl(panel, -1, '10', (95, 50), (40,18))
        #result textbox
        self.results = wx.TextCtrl(panel, -1, '', (150, 50), (200, 100), wx.TE_MULTILINE | wx.TE_AUTO_SCROLL | wx.HSCROLL)

        #run bbutton
        self.run_button = wx.Button(panel, -1, 'Run', (10, 80))

        #labels
        self.fore_label = wx.StaticText(panel, -1, 'Select the foreground file', (10, 10))
        self.back_label = wx.StaticText(panel, -1, 'Select the background file', (10, 30))

        #binding the menus to functions
        self.Bind(wx.EVT_MENU, self.on_foreground, foreground_menu)
        self.Bind(wx.EVT_MENU, self.on_background, background_menu)
        self.Bind(wx.EVT_BUTTON, self.run_finder, self.run_button)

    def on_foreground(self, event):
        dialog = wx.FileDialog(self, style=wx.OPEN)
        if dialog.ShowModal() == wx.ID_OK:
            pymotGUI.fore_file = dialog.GetPath()
            self.fore_label.SetLabel(pymotGUI.fore_file)

    def on_background(self, event):
        dialog = wx.FileDialog(self, style=wx.OPEN)
        if dialog.ShowModal() == wx.ID_OK:
            pymotGUI.back_file = dialog.GetPath()
            self.back_label.SetLabel(pymotGUI.back_file)

    def run_finder(self, event):
        print pymotGUI.fore_file
        result = pymotif.calculate_motifs(pymotGUI.fore_file, pymotGUI.back_file)
        for motif in result:
            self.results.WriteText(motif + 'n')
        #wx.MessageBox('It should run, eh?')

#if __name__ == '__main__':
app = pymot()
frame = pymotGUI(parent=None, id = -1)
#frame.CentreOnScreen()
frame.Show()
app.MainLoop()
&lt;/pre&gt;
&lt;p&gt;and &lt;/p&gt;
&lt;pre name=&quot;code&quot; class=&quot;python&quot;&gt;#!/usr/bin/env python

import fasta
import sys
from collections import defaultdict

def choose(n, k):
    if 0 &amp;lt;= k &amp;lt;= n:
        ntok = 1
        ktok = 1
        for t in xrange(1, min(k, n - k) + 1):
            ntok *= n
            ktok *= t
            n -= 1
        return ntok // ktok
    else:
        return 0

def get_quorums(seqs, mlen):
    &quot;&quot;&quot;
    add seq id_no to a set
    use explicit counter to create seq_no
    &quot;&quot;&quot;
    quorum = defaultdict(int)
    for seq in seqs:
        for n in range(len(seq) - mlen):
            quorum[seq[n:n + mlen]] += 1
    return quorum

def calculate_motifs(input_seqs, input_seqs2):

    print input_seqs, input_seqs2
    input_seqs = fasta.read_seqs(open(input_seqs).readlines())
    input_seqs2 = fasta.read_seqs(open(input_seqs2).readlines())

    foreground = get_quorums(input_seqs, 10)
    background = get_quorums(input_seqs2, 10)

    N = len(input_seqs) + len(input_seqs2)

    res_motifs = []
    for i in foreground:
        term1 = choose(background[i], foreground[i])
        term2 = choose((N - background[i]), len(input_seqs) - 1)
        term3 = choose(N, len(input_seqs))
        p = (float(term1) * float(term2)) / term3
        if 0 &amp;lt; p &amp;lt;= 0.0001:
            res_motifs.append(i + 't' + str(foreground[i]) + 't' + str(background[i]) + 't' + str(p))

    res_motifs.sort()
    return res_motifs
&lt;/pre&gt;
&lt;p&gt;On the next post, the last in the series, we will just check how to get the value from the width input box and wrap-up everything.&lt;/p&gt;
&lt;p&gt;Technorati Tags: &lt;a href=&quot;http://technorati.com/tag/wxPython&quot; class=&quot;performancingtags&quot; rel=&quot;tag&quot;&gt;wxPython&lt;/a&gt;, &lt;a href=&quot;http://technorati.com/tag/python&quot; class=&quot;performancingtags&quot; rel=&quot;tag&quot;&gt;python&lt;/a&gt;, &lt;a href=&quot;http://technorati.com/tag/motifs&quot; class=&quot;performancingtags&quot; rel=&quot;tag&quot;&gt;motifs&lt;/a&gt;, &lt;a href=&quot;http://technorati.com/tag/GUI&quot; class=&quot;performancingtags&quot; rel=&quot;tag&quot;&gt;GUI&lt;/a&gt;&lt;/p&gt;
&lt;div class=&quot;feedflare&quot;&gt;
&lt;a href=&quot;http://feedproxy.google.com/~f/BeginningPythonForBioinformatics?a=AvknOvzG&quot;&gt;&lt;img src=&quot;http://feedproxy.google.com/~f/BeginningPythonForBioinformatics?d=41&quot; border=&quot;0&quot; /&gt;&lt;/a&gt; &lt;a href=&quot;http://feedproxy.google.com/~f/BeginningPythonForBioinformatics?a=8ccfTl6v&quot;&gt;&lt;img src=&quot;http://feedproxy.google.com/~f/BeginningPythonForBioinformatics?i=8ccfTl6v&quot; border=&quot;0&quot; /&gt;&lt;/a&gt; &lt;a href=&quot;http://feedproxy.google.com/~f/BeginningPythonForBioinformatics?a=LX3ZM9b8&quot;&gt;&lt;img src=&quot;http://feedproxy.google.com/~f/BeginningPythonForBioinformatics?d=50&quot; border=&quot;0&quot; /&gt;&lt;/a&gt; &lt;a href=&quot;http://feedproxy.google.com/~f/BeginningPythonForBioinformatics?a=OsURXcPV&quot;&gt;&lt;img src=&quot;http://feedproxy.google.com/~f/BeginningPythonForBioinformatics?d=52&quot; border=&quot;0&quot; /&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src=&quot;http://feedproxy.google.com/~r/BeginningPythonForBioinformatics/~4/d-xPuvKEix8&quot; height=&quot;1&quot; width=&quot;1&quot; /&gt;</content:encoded>
	<dc:date>2008-11-18T19:45:31+00:00</dc:date>
	<dc:creator>Paulo Nuin</dc:creator>
</item>
<item rdf:about="http://www.protocolostomy.com/?p=399">
	<title>Brian Jones: On Remote Workers and Working Remotely</title>
	<link>http://www.protocolostomy.com/2008/11/18/on-remote-workers-and-working-remotely/</link>
	<content:encoded>&lt;p&gt;I’ve been on both sides of the remote worker relationship. On the manager side, I’ve managed some good-sized projects using an all-remote work force. Indeed, I’ve hired, managed, fired, and promoted workers without ever knowing what they look like. On the worker side, I do most of my work remotely, and I have for some time now. Judging by the amount of repeat business I get, I’d say that I’m more than acceptably productive working remotely.&lt;/p&gt;
&lt;p&gt;In dealing with various clients, recruiters, prospective employers, business owners, and talking to friends who manage people for a living, I’ve heard pretty much every excuse/reason there is for not wanting to deal with a remote work force. I’ve heard and experienced successes with remote workers as well, and they all have a few key things in common, which are missing from the stories of failure. I’ll talk about them in a minute.&lt;/p&gt;
&lt;p&gt;I first want to just say that I’m not some kind of fanboy who thinks remote workers are the answer to every problem. There are valid reasons for not having remote workers. For example, it’d be hard to build cars with a remote work force. Some things (some!) just require a physical presence. Whoever maintains the printers at your company really has to be around to change out ink cartridges and stuff like that.&lt;/p&gt;
&lt;p&gt;There are certain classes of jobs, though, that are well-suited to working remotely. There are even classes of jobs that are necessarily performed remotely to some degree (field sales and support technicians for example), that could be made 100% remote with the proper tools and processes in place.&lt;/p&gt;
&lt;p&gt;So what makes a remote worker success story different from a story of failure?&lt;/p&gt;
&lt;h2&gt;Always be prepared…&lt;/h2&gt;
&lt;p&gt;The number one difference I’ve seen between success and failure in managing a remote work force is that  successful managers spent the time to prepare the managers, the team, the department, the organization, and the remote workers themselves to work remotely.&lt;/p&gt;
&lt;p&gt;If you don’t prepare for a remote work force, you will fail miserably. As a result, I’m a big advocate of treating “Let’s go remote!” as an internal project with goals and milestones just like any other project. Preparing an organization to manage a remote work force takes a good deal of forethought, with a focus on communication and collaboration tools, reporting, accountability, scheduling, etc. In addition, you have to prepare the remote workers themselves, to insure they know what’s expected of them in terms of reporting their status, scheduling, communication, etc. They also need to know *about*, and *how to use* the tools they’ll be expected to use from home.&lt;/p&gt;
&lt;p&gt;You have to plan this. You have to prepare, or you’re going to be like the HR manager who told me their company no longer allows for remote workers because “we tried it once and the guy made a complete mess of things”. When I asked the HR manager why he attributed that to the geographic location of the worker, he said “good point, he could just as well have made a mess here in the office”. You need good workers no matter where they’re going to work. The workers need expectations and goals from the manager, and the manager needs feedback and communication (and results!) from the worker. Tools help to facilitate these things. This is already a long post, so I’ll probably make a tools list in another post.&lt;/p&gt;
&lt;h2&gt;Communicate, and set expectations&lt;/h2&gt;
&lt;p&gt;Before the tools come other higher-level decisions and communication. For example, one problem I’ve heard more than once about remote workers is “we can’t hire a remote worker full-time, because then everyone will want to work from home”. As if they didn’t already all want to work from home! Everyone would love to have the option! Even if they didn’t take advantage of it, they’d consider it a really cool perk! They’d tell all of their friends about it, because it would make them jealous, and guess who their friends will contact first when they start to look for other opportunities?&lt;/p&gt;
&lt;p&gt;You have to start somewhere, and you can’t just swing the barn doors open and let everyone go their own way on day 1. If you have an existing corporate structure in place with assets and services and regular meetings and the like, then you have to decide who can make the most benefit from a remote situation the soonest, make them the pilot group, and manage the expectations of the rest of the organization while the pilot group prepares to move to a remote workspace.&lt;/p&gt;
&lt;h2&gt;1, 10, 100, 1000&lt;/h2&gt;
&lt;p&gt;A common software application rollout strategy is to make it accessible to 1 user, then 10, then 100, then 1000, then… move up from there. In preparing your organization or department, you might consider a similar strategy.&lt;/p&gt;
&lt;p&gt;I work for a client right now where I’m the “1″. If I can work effectively with the rest of the team (in the office), if I can produce results, remain accessible as-needed during working hours, manage the expectations of my team with regards to my presence (appointments happen), and overall be an asset to the team, then the management may decide that it can work on some larger scale - even if ‘larger’ means 2 instead of 1. It might also be useful to do a ‘remote rotation’ so that glitches can be caught early before making a physical presence in the office optional.&lt;/p&gt;
&lt;p&gt;Success, of course, means getting together with the team and figuring out what tools will be used to best emulate an office working environment. We use IRC for 99% of our communication, falling back to email when we need to cc managers, we have a wiki for documentation and status updates, we have a trouble ticket system, everyone has everyone else’s phone number, blackberry PIN, or whatever. We’re a technical group doing system administration. It’s working wonderfully.&lt;/p&gt;
&lt;p&gt;“But if the sysadmins work from home, the developers will want to work from home!” Maybe so. That’s where you have to manage expectations, and communicate with your workers to let them know that the company’s ‘office optional’ project is in an early alpha stage, that it’s being tested on the group most familiar with the technologies involved, and most capable of exploiting those technologies successfully to produce results. Once the geeks work out the shortcomings, and management is able to evaluate the effectiveness of the plan, the tests will become more widespread.&lt;/p&gt;
&lt;p&gt;Really, it’s not a whole lot different from doing anything else that affects the whole company: changing payroll providers, healthcare options, software and desktop hardware upgrades and replacements… it just takes communication. The process has to be managed, just like every other process.&lt;/p&gt;
&lt;h2&gt;There’s more than one way to do it!&lt;/h2&gt;
&lt;p&gt;There’s no one solution out there. When I joined php|architect Magazine in 2003, it was run by Marco Tabini, and I was a remote editor. A couple of months after joining, I became editor in chief, and was in charge of remotely managing the magazine. I did it differently from Marco, but he still remained involved and engaged through good communication.&lt;/p&gt;
&lt;p&gt;Python Magazine was created and managed by me, and for the entire lifespan of the magazine, I have not seen anyone else involved in its production in person. Ever. Design, production, web site admin, executive administration, tech editors, authors, accountants… time lines, budgets and planning documents… all remote, and mostly delegated. I started the magazine with the thought that at some point someone more engaged in the community and with Python should take charge — I was just a “temp” to get the vision off the ground. Sure enough, when I handed the magazine over to Doug Hellmann, he did things differently from me, and it’s working out wonderfully for him as well!&lt;/p&gt;
&lt;p&gt;Everyone has their own management style. Don’t think that just because your management style is a little unique you can’t handle remote workers. Good managers are creative, and aren’t afraid to execute on creative solutions.&lt;/p&gt;</content:encoded>
	<dc:date>2008-11-18T18:39:49+00:00</dc:date>
	<dc:creator>m0j0</dc:creator>
</item>
<item rdf:about="tag:blogger.com,1999:blog-8935780327334775165.post-4004223490366147661">
	<title>Simon Wittber: Fibra grows events.</title>
	<link>http://entitycrisis.blogspot.com/2008/11/fibra-grows-events.html</link>
	<content:encoded>&lt;a href=&quot;http://code.google.com/p/fibra&quot;&gt;Fibra&lt;/a&gt; has grown an event handling plugin.&lt;pre&gt;  1 import fibra&lt;br /&gt;  2 &lt;br /&gt;  3 &lt;br /&gt;  4 def task_a():&lt;br /&gt;  5     for i in xrange(10):&lt;br /&gt;  6         yield fibra.Send('AN_EVENT')&lt;br /&gt;  7 &lt;br /&gt;  8 def task_b():&lt;br /&gt;  9     while True:&lt;br /&gt; 10         msg = yield fibra.Recv('AN_EVENT')&lt;br /&gt; 11         print 'Received:', msg&lt;br /&gt; 12 &lt;br /&gt; 13 def test():&lt;br /&gt; 14     s = fibra.schedule()&lt;br /&gt; 15     s.install(task_a())&lt;br /&gt; 16     s.install(task_b())&lt;br /&gt; 17     s.run()&lt;br /&gt; 18 &lt;br /&gt; 19 if __name__ == &quot;__main__&quot;:&lt;br /&gt; 20     test()&lt;/pre&gt;Now I need to reinstate the networking layer... and think about adding multi-core features via the new (in 2.6) multiprocessing module. It would be nice to have events magically transferred across process boundaries. FibraNet used to do this, but I haven't found a clean way of adding this to fibra, yet.</content:encoded>
	<dc:date>2008-11-18T15:02:11+00:00</dc:date>
	<dc:creator>Simon Wittber</dc:creator>
</item>
<item rdf:about="http://simonwillison.net/2008/Nov/18/lawrencecom/">
	<title>Simon Willison's Weblog: The new Lawrence.com</title>
	<link>http://simonwillison.net/2008/Nov/18/lawrencecom/</link>
	<content:encoded>&lt;div class=&quot;blogmark segment&quot;&gt;&lt;p&gt;&lt;a href=&quot;http://www.lawrence.com/&quot;&gt;The new Lawrence.com&lt;/a&gt;. The world’s best local entertainment website, relaunched on Django 1.0 with an accompanying substantial redesign.&lt;/p&gt;
&lt;/div&gt;</content:encoded>
	<dc:date>2008-11-18T14:25:34+00:00</dc:date>
</item>
<item rdf:about="http://radian.org/notebook/?p=213">
	<title>Ivan Krstic: DeepSec</title>
	<link>http://radian.org/notebook/deepsec-2008</link>
	<content:encoded>&lt;p&gt;Last Friday, I delivered my keynote at &lt;a href=&quot;https://deepsec.net/&quot;&gt;DeepSec ‘08&lt;/a&gt; in Vienna. Anton Chuvakin from Qualys posted some &lt;a href=&quot;http://chuvakin.blogspot.com/2008/11/blogging-from-deepsec-2008-in-vienna.html&quot;&gt;thoughts on my talk&lt;/a&gt;, and ORF has a more detailed &lt;a href=&quot;http://futurezone.orf.at/stories/1500167/&quot;&gt;interview with me&lt;/a&gt; in German.&lt;/p&gt;</content:encoded>
	<dc:date>2008-11-18T13:16:50+00:00</dc:date>
	<dc:creator>Ivan Krstić</dc:creator>
</item>
<item rdf:about="http://radian.org/notebook/?p=187">
	<title>Ivan Krstic: No yin for Jerry Yang</title>
	<link>http://radian.org/notebook/yang</link>
	<content:encoded>&lt;p&gt;Yahoo CEO Jerry Yang announced his departure yesterday in a &lt;a href=&quot;http://kara.allthingsd.com/20081117/jerry-yangs-entire-memo-to-his-employees-on-stepping-down-as-ceo/&quot;&gt;fluffy memo&lt;/a&gt; to his employees. The reader’s guide:&lt;/p&gt;
&lt;blockquote&gt;&lt;p&gt;the board of directors and I have agreed to initiate a succession process for the ceo role of yahoo!.&lt;/p&gt;&lt;/blockquote&gt;
&lt;p&gt;The board got its head out of its ass long enough to fire me. Given their track record, I’m as shocked as you are.&lt;/p&gt;
&lt;blockquote&gt;&lt;p&gt;once a successor is named, i will return to my previous role as chief yahoo and continue to serve as a director on the board.&lt;/p&gt;&lt;/blockquote&gt;
&lt;p&gt;Once a successor is named, I will return to complete irrelevance and hopefully crawl under a very large rock.&lt;/p&gt;
&lt;blockquote&gt;&lt;p&gt;
we have created a more open, competitive yahoo! and we believe the time is now right to transition to a new ceo who can take the company to the next level.
&lt;/p&gt;&lt;/blockquote&gt;
&lt;p&gt;Zeus have mercy on the poor sod who comes in to fix the mess I’ve made.&lt;/p&gt;
&lt;blockquote&gt;&lt;p&gt;
the fact remains that yahoo! is now a significantly different company
&lt;/p&gt;&lt;/blockquote&gt;
&lt;p&gt;Since, you know, I erased $30 billion in shareholder value by rejecting the Microsoft deal and then drove &lt;i&gt;a hundred and twenty-five&lt;/i&gt; of my top executives to &lt;a href=&quot;http://www.techcrunch.com/2008/06/21/updated-yahoo-exec-tracker-114-execs-left-since-january-2007/&quot;&gt;quit&lt;/a&gt;.&lt;/p&gt;
&lt;blockquote&gt;&lt;p&gt;
that is stronger in many ways than it was just 18 months ago.
&lt;/p&gt;&lt;/blockquote&gt;
&lt;p&gt;And by “stronger”, I mean “more colorfully fucked”.&lt;/p&gt;
&lt;blockquote&gt;&lt;p&gt;
while this step will be an adjustment for all of us
&lt;/p&gt;&lt;/blockquote&gt;
&lt;p&gt;I’ll be adjusting to golf, you’ll be adjusting to unemployment. &lt;/p&gt;
&lt;blockquote&gt;&lt;p&gt;
i will continue to do everything i can to make yahoo! fulfill its full potential.
&lt;/p&gt;&lt;/blockquote&gt;
&lt;p&gt;So long, suckers.&lt;/p&gt;</content:encoded>
	<dc:date>2008-11-18T11:14:32+00:00</dc:date>
	<dc:creator>Ivan Krstić</dc:creator>
</item>
<item rdf:about="tag:blogger.com,1999:blog-4637631607249418081.post-8268002134299298672">
	<title>Kelly Yancey: RFC868 UDP Time Protocol Client</title>
	<link>http://kbyanc.blogspot.com/2008/11/rfc868-udp-time-protocol-client.html</link>
	<content:encoded>Here is an &lt;a href=&quot;http://www.faqs.org/rfcs/rfc868.html&quot;&gt;RFC 868&lt;/a&gt; UDP Time Protocol Client implementation in less than 30 lines of python.&lt;br /&gt;I know...just what you always wanted.  It is a long story, but I needed a time protocol client (that would run on Windows) for testing a service we're developing at work.  There are tons of implementations of the TCP version of the protocol, but I couldn't find a UDP implementation for Windows to save my life.  Python to the rescue.&lt;br /&gt;&lt;pre&gt;from socket import *&lt;br /&gt;from struct import unpack&lt;br /&gt;from time import ctime, sleep&lt;br /&gt;from sys import argv&lt;br /&gt;&lt;br /&gt;argv = argv[1:]&lt;br /&gt;if len(argv) == 0:&lt;br /&gt;   argv = [ 'time-nw.nist.gov' ]&lt;br /&gt;&lt;br /&gt;s = socket(AF_INET, SOCK_DGRAM)&lt;br /&gt;s.settimeout(5.0)&lt;br /&gt;&lt;br /&gt;for server in argv:&lt;br /&gt;   print server, &quot;:&quot;,&lt;br /&gt;   try:&lt;br /&gt;       s.sendto('', 0, (server, 37))&lt;br /&gt;       t = long(unpack('!L', s.recv(16)[:4])[0])&lt;br /&gt;       # Convert from 1900/01/01 epoch to 1970/01/01 epoch&lt;br /&gt;       t -= 2208988800&lt;br /&gt;       print ctime(t)&lt;br /&gt;   except timeout:&lt;br /&gt;       print &quot;TIMEOUT&quot;&lt;br /&gt;   except:&lt;br /&gt;       print &quot;ERROR&quot;&lt;br /&gt;&lt;br /&gt;s.close()&lt;br /&gt;sleep(2)&lt;br /&gt;&lt;/pre&gt;In case you are curious, the sleep(2) at the end is there so our testers can simply click the icon on their desktop and have time to actually see the results before Windows closes the console window.&lt;br /&gt;&lt;br /&gt;By default, it queries the &lt;a href=&quot;http://tf.nist.gov/tf-cgi/servers.cgi&quot;&gt;time-nw.nist.gov&lt;/a&gt; server, but you can specify any number of servers to query on the command-line.</content:encoded>
	<dc:date>2008-11-18T09:21:35+00:00</dc:date>
	<dc:creator>Kelly Yancey</dc:creator>
</item>
<item rdf:about="tag:blogger.com,1999:blog-11788780.post-5643205556171093374">
	<title>Shannon -jj Behrens: AI: Thankful for Bad AI</title>
	<link>http://jjinux.blogspot.com/2008/11/ai-thankful-for-bad-ai.html</link>
	<content:encoded>Imagine if the first computers man was able to create worked in pretty much the same way the human brain works.  Imagine if they were pretty decent at reasoning, and terrible at calculating things quickly without error.  Image that instead of having a quest for artificial intelligence, we had a quest for a &quot;really fast, really accurate data cruncher.&quot;  It'd be a different world.  It definitely makes me grateful that we have humans *and* computers, each very useful in their own way.&lt;br /&gt;&lt;br /&gt;&lt;i&gt;The question of whether computers can think is like the question of whether submarines can swim -- Edsger W. Dijkstra&lt;/i&gt;</content:encoded>
	<dc:date>2008-11-18T03:34:59+00:00</dc:date>
	<dc:creator>Shannon -jj Behrens</dc:creator>
</item>
<item rdf:about="http://jtauber.com/blog/2008/11/17/fixing_relative_links_in_entries">
	<title>James Tauber: Fixing Relative Links In Entries</title>
	<link>http://jtauber.com/blog/2008/11/17/fixing_relative_links_in_entries/</link>
	<content:encoded>&lt;p&gt;Occasionally I hear from someone who finds the links in my entries are broken in their feed reader, especially if they are reading a syndicated version of my entries.
&lt;/p&gt;
&lt;p&gt;
The reason is that I have relative links which are not being made absolute by the reader (or syndication code).
&lt;/p&gt;
&lt;p&gt;
Many readers (such as Google Reader) treat relative links as being relative to the feed itself, so &lt;a href=&quot;http://jtauber.com/blog/&quot;&gt;/blog/&lt;/a&gt; gets converted to &lt;a href=&quot;http://jtauber.com/blog/&quot; class=&quot;external&quot;&gt;http://jtauber.com/blog/&lt;/a&gt;. But even if the reader does, this, that doesn't help with syndicated entries unless the syndicator does some processing. Some do but others don't.
&lt;/p&gt;
&lt;p&gt;
There's nothing wrong with relative links in Atom content, but if you use them you really should have an xml:base attribute to help a reader deal with them properly. I've now updated all my entries to include an xml:base. I'll see how many planets and other syndications pass that through when placed on the entry. I wonder if the content element would be better.
&lt;/p&gt;
&lt;p&gt;
In the process of making the change, though, I noticed my entry/link[@rel=&quot;alternative&quot;] were also relative which is, I suspect, a no no. So I've made them absolute as well.
&lt;/p&gt;
&lt;p&gt;
I'm going to do a little bit more experimentation, but things should work now. I may still have goofed up somewhere but I'm fairly confident now that if links are broken then it's either a bad reader or bad syndication involved. Either way, please let me know in a comment below if you encounter any problems here on in.
&lt;/p&gt;
&lt;p&gt;
&lt;b&gt;UPDATE 1&lt;/b&gt;: The atom feed of the &lt;a href=&quot;http://www.planetpython.org&quot; class=&quot;external&quot;&gt;unofficial planet python&lt;/a&gt; doesn't pass through the xml:base but it doesn't need to as it has made all links absolute (and was doing so before my change)
&lt;/p&gt;
&lt;p&gt;
&lt;b&gt;UPDATE 2&lt;/b&gt;: I'm afraid that &lt;a href=&quot;http://www.advogato.org/&quot; class=&quot;external&quot;&gt;Advogato&lt;/a&gt;'s syndication is just plain broken. In their RSS 2.0 feed (why not provide Atom!?), they make content links absolute but they do so by treating them relative to www.advogato.org !! My only suggestion is to just avoid Advogato syndication all together. I'm tempted to turn it off.&lt;/p&gt;</content:encoded>
	<dc:date>2008-11-17T22:50:09+00:00</dc:date>
	<dc:creator>James Tauber</dc:creator>
</item>
<item rdf:about="http://www.eflorenzano.com/blog/post/wsgi-middlware-awesome-django-use-it-more/">
	<title>Eric Florenzano: WSGI middleware is awesome, and Django should use it more</title>
	<link>http://www.eflorenzano.com/blog/post/wsgi-middlware-awesome-django-use-it-more/</link>
	<content:encoded>&lt;p&gt;Most people in the Django community are deploying their apps these days with
&lt;a href=&quot;http://code.google.com/p/modwsgi/&quot; class=&quot;reference&quot;&gt;mod_wsgi&lt;/a&gt;.  If not, then you're at least using &lt;a href=&quot;http://wsgi.org/wsgi/&quot; class=&quot;reference&quot;&gt;WSGI&lt;/a&gt; as a communication layer
with your application server, in one way or another.  The great thing about
WSGI is that it gives everyone a common interface through which to talk.  It
also has the added benefit of being a common abstraction that many people have
built these great, really useful tools on top of.&lt;/p&gt;
&lt;p&gt;Consider &lt;a href=&quot;http://repoze.org/&quot; class=&quot;reference&quot;&gt;Repoze&lt;/a&gt;.  If you navigate to the &lt;a href=&quot;http://repoze.org/repoze_components.html#middleware&quot; class=&quot;reference&quot;&gt;middleware section&lt;/a&gt; of their
website, they have some really cool stuff available!  There are utilities for
logging, authentication, security, profiling, templating, etc.  All of these
pieces of middleware are designed to be totally pluggable, because they are
designed to work solely based on what's available through WSGI.&lt;/p&gt;
&lt;p&gt;My personal favorite of that lot is &lt;tt class=&quot;docutils literal&quot;&gt;&lt;span class=&quot;pre&quot;&gt;repoze.profile&lt;/span&gt;&lt;/tt&gt;.  It accumulates
Python profiling information about whatever app is being run, and allows you to
view that profile information via a web interface by visiting a special URL.
There is absolutely no reason that the Pylons, TurboGears, or CherryPy guys
should be able to get away with keeping this stuff for themselves, so I want to
show just how easy it is to integrate this profiling module with Django.&lt;/p&gt;
&lt;p&gt;First, though, here's a typical .wsgi file that might be used in conjunction
with &lt;tt class=&quot;docutils literal&quot;&gt;&lt;span class=&quot;pre&quot;&gt;mod_wsgi&lt;/span&gt;&lt;/tt&gt;:&lt;/p&gt;
&lt;div class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;span style=&quot;color: #008000; font-weight: bold;&quot;&gt;import&lt;/span&gt; &lt;span style=&quot;color: #0000FF; font-weight: bold;&quot;&gt;os&lt;/span&gt;&lt;span style=&quot;color: #666666;&quot;&gt;,&lt;/span&gt; &lt;span style=&quot;color: #0000FF; font-weight: bold;&quot;&gt;sys&lt;/span&gt;
sys&lt;span style=&quot;color: #666666;&quot;&gt;.&lt;/span&gt;stdout &lt;span style=&quot;color: #666666;&quot;&gt;=&lt;/span&gt; sys&lt;span style=&quot;color: #666666;&quot;&gt;.&lt;/span&gt;stderr

os&lt;span style=&quot;color: #666666;&quot;&gt;.&lt;/span&gt;environ[&lt;span style=&quot;color: #BA2121;&quot;&gt;'DJANGO_SETTINGS_MODULE'&lt;/span&gt;] &lt;span style=&quot;color: #666666;&quot;&gt;=&lt;/span&gt; &lt;span style=&quot;color: #BA2121;&quot;&gt;'settings'&lt;/span&gt;

&lt;span style=&quot;color: #008000; font-weight: bold;&quot;&gt;import&lt;/span&gt; &lt;span style=&quot;color: #0000FF; font-weight: bold;&quot;&gt;django.core.handlers.wsgi&lt;/span&gt;

application &lt;span style=&quot;color: #666666;&quot;&gt;=&lt;/span&gt; django&lt;span style=&quot;color: #666666;&quot;&gt;.&lt;/span&gt;core&lt;span style=&quot;color: #666666;&quot;&gt;.&lt;/span&gt;handlers&lt;span style=&quot;color: #666666;&quot;&gt;.&lt;/span&gt;wsgi&lt;span style=&quot;color: #666666;&quot;&gt;.&lt;/span&gt;WSGIHandler()
&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;There's really nothing special going on here, and if you would like to learn
more about how to set up this WSGI file, visit
&lt;a href=&quot;http://code.google.com/p/modwsgi/wiki/IntegrationWithDjango&quot; class=&quot;reference&quot;&gt;mod_wsgi's documentation on the subject&lt;/a&gt;.  Now if you'll notice,
&lt;tt class=&quot;docutils literal&quot;&gt;&lt;span class=&quot;pre&quot;&gt;application&lt;/span&gt;&lt;/tt&gt; is simply an instance of &lt;tt class=&quot;docutils literal&quot;&gt;&lt;span class=&quot;pre&quot;&gt;WSGIHandler&lt;/span&gt;&lt;/tt&gt;, which is simply a
callable.  A WSGI middleware is just a wrapper around that callable.  Here's how
easy it is to add the profiling middleware:&lt;/p&gt;
&lt;div class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;span style=&quot;color: #008000; font-weight: bold;&quot;&gt;from&lt;/span&gt; &lt;span style=&quot;color: #0000FF; font-weight: bold;&quot;&gt;repoze.profile.profiler&lt;/span&gt; &lt;span style=&quot;color: #008000; font-weight: bold;&quot;&gt;import&lt;/span&gt; AccumulatingProfileMiddleware
application &lt;span style=&quot;color: #666666;&quot;&gt;=&lt;/span&gt; AccumulatingProfileMiddleware(
    application,
    log_filename&lt;span style=&quot;color: #666666;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: #BA2121;&quot;&gt;'/tmp/djangoprofile.log'&lt;/span&gt;,
    discard_first_request&lt;span style=&quot;color: #666666;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: #008000;&quot;&gt;True&lt;/span&gt;,
    flush_at_shutdown&lt;span style=&quot;color: #666666;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: #008000;&quot;&gt;True&lt;/span&gt;,
    path&lt;span style=&quot;color: #666666;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: #BA2121;&quot;&gt;'/__profile__'&lt;/span&gt;)
&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;There we go!  We have imported the profiling middleware, and passed the Django
WSGI application as the first argument.  The rest is just setting options for
the middleware.  You can restart apache and the WSGI profiling middleware is
already working.&lt;/p&gt;
&lt;p&gt;Sometimes, though, you don't want all of Apache just to run some middleware.
You want to be able to do the same thing, but locally.  Believe it or not,
Django's local development server is just a WSGI server itself, so one option
would be to do the wrapping directly in django, &lt;a href=&quot;http://code.djangoproject.com/browser/django/trunk/django/core/management/commands/runserver.py#L60&quot; class=&quot;reference&quot;&gt;right here&lt;/a&gt;.  But you really
don't want to be hacking inside of Django internals if you don't have to.
Fortunately there are many alternative WSGI servers out there.  Brian Rosner
has created a custom management command to use the excellent CherryPy WSGI
server with Django, on &lt;a href=&quot;http://oebfare.com/blog/2008/nov/03/writing-custom-management-command/&quot; class=&quot;reference&quot;&gt;his blog&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;Let's say you just want to try this out quickly after reading this blog post,
though.  If you're running Python 2.5 or greater, you're in luck, because a
script less than 10 lines long can get you up and running:&lt;/p&gt;
&lt;div class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;span style=&quot;color: #408080; font-style: italic;&quot;&gt;#!/usr/bin/env python&lt;/span&gt;

&lt;span style=&quot;color: #008000; font-weight: bold;&quot;&gt;import&lt;/span&gt; &lt;span style=&quot;color: #0000FF; font-weight: bold;&quot;&gt;sys&lt;/span&gt;
&lt;span style=&quot;color: #008000; font-weight: bold;&quot;&gt;from&lt;/span&gt; &lt;span style=&quot;color: #0000FF; font-weight: bold;&quot;&gt;wsgiref.simple_server&lt;/span&gt; &lt;span style=&quot;color: #008000; font-weight: bold;&quot;&gt;import&lt;/span&gt; make_server

&lt;span style=&quot;color: #008000; font-weight: bold;&quot;&gt;if&lt;/span&gt; __name__ &lt;span style=&quot;color: #666666;&quot;&gt;==&lt;/span&gt; &lt;span style=&quot;color: #BA2121;&quot;&gt;&quot;__main__&quot;&lt;/span&gt;:
    &lt;span style=&quot;color: #008000;&quot;&gt;execfile&lt;/span&gt;(sys&lt;span style=&quot;color: #666666;&quot;&gt;.&lt;/span&gt;argv[&lt;span style=&quot;color: #666666;&quot;&gt;1&lt;/span&gt;])
    httpd &lt;span style=&quot;color: #666666;&quot;&gt;=&lt;/span&gt; make_server(&lt;span style=&quot;color: #BA2121;&quot;&gt;''&lt;/span&gt;, &lt;span style=&quot;color: #666666;&quot;&gt;8000&lt;/span&gt;, application)
    httpd&lt;span style=&quot;color: #666666;&quot;&gt;.&lt;/span&gt;serve_forever()
&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;Now, to run it, simply invoke it like this:&lt;/p&gt;
&lt;div class=&quot;highlight&quot;&gt;&lt;pre&gt;python runserver.py my_wsgi_file.wsgi
&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;Now, navigate around your app for a little bit and then point your browser to
&lt;a href=&quot;http://localhost:8000/__profile__&quot; class=&quot;reference&quot;&gt;the profile url&lt;/a&gt; and see how freaking awesome middleware can be.&lt;/p&gt;
&lt;p&gt;I'm not trying to stir up any controversy, I'm not saying we should stop making
Django middleware or anything like that.  But I seriously, seriously hope that
someone tries this out and realizes the multitudes of great WSGI apps out there
that can be taken advantage of.  &lt;a href=&quot;http://compoundthinking.com/blog/&quot; class=&quot;reference&quot;&gt;Mark Ramm&lt;/a&gt; wasn't full of hot air when he
talked about this at DjangoCon or &lt;a href=&quot;http://compoundthinking.com/blog/index.php/2008/10/06/wsgi-middleare-is-cool/&quot; class=&quot;reference&quot;&gt;blogged about it&lt;/a&gt; later.  He was right, and
I for one wish I had listened sooner.&lt;/p&gt;</content:encoded>
	<dc:date>2008-11-17T21:26:48+00:00</dc:date>
</item>
<item rdf:about="http://www.fishandcross.com/blog/?p=785">
	<title>Ed Taekema: Mondays are for Duarte</title>
	<link>http://feeds.feedburner.com/~r/RoadWarriorCollaborationPython/~3/456246773/</link>
	<content:encoded>&lt;p&gt;Well its cold and wintery this Monday.  So what better way to warm up the brain than by reviewing some great Duarte content.  Nancy recently appeared at the Apple Store in San Franscisco and let the word out of the apearance through &lt;a href=&quot;http://twitter.com/nancyduarte&quot; target=&quot;_blank&quot;&gt;twitter&lt;/a&gt;.  &lt;a href=&quot;http://www.bertdecker.com/experience/2008/11/nancy-duarte-twitter-and-flip-video.html&quot; target=&quot;_blank&quot;&gt;Sounds like the event was a success&lt;/a&gt;.  Here are some good Duarte Vids to get things moving on a Monday:&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;div class=&quot;feedflare&quot;&gt;
&lt;a href=&quot;http://feeds.feedburner.com/~f/RoadWarriorCollaborationPython?a=RmBlN&quot;&gt;&lt;img src=&quot;http://feeds.feedburner.com/~f/RoadWarriorCollaborationPython?i=RmBlN&quot; border=&quot;0&quot; /&gt;&lt;/a&gt; &lt;a href=&quot;http://feeds.feedburner.com/~f/RoadWarriorCollaborationPython?a=mNE0n&quot;&gt;&lt;img src=&quot;http://feeds.feedburner.com/~f/RoadWarriorCollaborationPython?i=mNE0n&quot; border=&quot;0&quot; /&gt;&lt;/a&gt; &lt;a href=&quot;http://feeds.feedburner.com/~f/RoadWarriorCollaborationPython?a=OVOyn&quot;&gt;&lt;img src=&quot;http://feeds.feedburner.com/~f/RoadWarriorCollaborationPython?i=OVOyn&quot; border=&quot;0&quot; /&gt;&lt;/a&gt; &lt;a href=&quot;http://feeds.feedburner.com/~f/RoadWarriorCollaborationPython?a=hpWxN&quot;&gt;&lt;img src=&quot;http://feeds.feedburner.com/~f/RoadWarriorCollaborationPython?i=hpWxN&quot; border=&quot;0&quot; /&gt;&lt;/a&gt; &lt;a href=&quot;http://feeds.feedburner.com/~f/RoadWarriorCollaborationPython?a=VOJvn&quot;&gt;&lt;img src=&quot;http://feeds.feedburner.com/~f/RoadWarriorCollaborationPython?i=VOJvn&quot; border=&quot;0&quot; /&gt;&lt;/a&gt; &lt;a href=&quot;http://feeds.feedburner.com/~f/RoadWarriorCollaborationPython?a=siTxN&quot;&gt;&lt;img src=&quot;http://feeds.feedburner.com/~f/RoadWarriorCollaborationPython?i=siTxN&quot; border=&quot;0&quot; /&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src=&quot;http://feeds.feedburner.com/~r/RoadWarriorCollaborationPython/~4/456246773&quot; height=&quot;1&quot; width=&quot;1&quot; /&gt;</content:encoded>
	<dc:date>2008-11-17T17:36:55+00:00</dc:date>
	<dc:creator>Ed Taekema</dc:creator>
</item>
<item rdf:about="http://homepage.mac.com/s_lott/iblog/architecture/C412398194/E20081117061023/index.html">
	<title>S.Lott: Concealing the code base -- in Python. I think not.</title>
	<link>http://homepage.mac.com/s_lott/iblog/architecture/C412398194/E20081117061023/index.html</link>
	<content:encoded>&lt;br /&gt;The &quot;how do we protect our intellectual property?&quot; question comes up from time to time because we're using Python. It also came up on Stack Overflow. Here's the approach we're taking.&lt;br /&gt;</content:encoded>
	<dc:date>2008-11-17T11:10:23+00:00</dc:date>
</item>
<item rdf:about="http://yeoldeclue.com/cgi-bin/blog/blog.cgi?rm=viewpost&amp;nodeid=1226893221">
	<title>Michael Sparks: Actor Model vs Denial of Service</title>
	<link>http://yeoldeclue.com/cgi-bin/blog/blog.cgi?rm=viewpost&amp;nodeid=1226893221</link>
	<content:encoded>Kamaelia implements something similar to, but not the same as the Actor Model. Since I'd not heard of the actor model for the majority of time whilst working on Kamaelia (kamaelia is more like occam, unix pipes, hardware, etc), I've been reading up on it. One thing that I've come across about it that suprises me is this:&lt;br /&gt;&lt;blockquote&gt;&lt;i&gt;Communications among actors occur asynchronously: that is, the sending
actor does not wait until the message is received before proceeding
with computation.&lt;/i&gt;&lt;br /&gt;(this summary courtesy of the Wikipedia page on the &lt;a href=&quot;http://en.wikipedia.org/wiki/Actor_model&quot;&gt;Actor Model&lt;/a&gt;, but the literature supports this view as well)&lt;br /&gt;&lt;/blockquote&gt;The difference between Kamaelia and the Actor Model is in a few places, but possibly the most fundamental is this:&lt;br /&gt;&lt;ul&gt;&lt;li&gt;With the actor model (as I understand it)&lt;br /&gt;&lt;/li&gt;&lt;ul&gt;&lt;li&gt;You have a mailbox where you receive messages. (&quot;recv from inbox&quot;)&lt;/li&gt;&lt;li&gt;communications defaults to unidirectional, though you can build bi-directional&lt;/li&gt;&lt;/ul&gt;&lt;ul&gt;&lt;li&gt;&lt;b&gt;When you send a message, you know the recipient and send it direct to the recipient. (&quot;send to bob&quot;)&lt;/b&gt;&lt;/li&gt;&lt;li&gt;Message sending is asynchronous&lt;br /&gt;&lt;/li&gt;&lt;li&gt;&lt;b&gt;ie sender knows receiver&lt;/b&gt;, receiver does not (necessarily) know sender&lt;br /&gt;&lt;/li&gt;&lt;ul&gt;&lt;li&gt;This potentially introduces coupling in ways that makes co-ordination languages harder to build&lt;br /&gt;&lt;/li&gt;&lt;/ul&gt;&lt;/ul&gt;&lt;li&gt;With Kamaelia's model:&lt;br /&gt;&lt;/li&gt;&lt;ul&gt;&lt;li&gt;You receive messages from multiple named inboxes (ala receiving data on stdin, or receiving signals)&lt;/li&gt;&lt;li&gt;communications defaults to unidirectional, though you can build bi-directional&lt;/li&gt;&lt;li&gt;&lt;b&gt;You send messages to named outboxes (ala sending to stdout, stderr)&lt;/b&gt;&lt;/li&gt;&lt;li&gt;A higher level co-ordination language (effectively) joins the dots between outboxes to inboxes (generally)&lt;/li&gt;&lt;li&gt;Message sending &lt;b&gt;defaults&lt;/b&gt; to asynchronous, but you can define a &quot;pipewidth&quot; or &quot;max number of messages in transit&quot; to allow synchrony, where needed (such as a producer that produces data faster than the consumer can consume it)&lt;br /&gt;&lt;/li&gt;&lt;li&gt;&lt;b&gt;ie sender does NOT know receiver&lt;/b&gt;, receiver does not (necessarily) know sender&lt;/li&gt;&lt;ul&gt;&lt;li&gt;Much like a CPU doesn't know whether it's plugged into a motherboard or a testing harness for example.&lt;/li&gt;&lt;li&gt;This defaults to needing a co-ordination language - but this encourages greater reusability of components, through a dataflow model&lt;/li&gt;&lt;/ul&gt;&lt;li&gt;I say &quot;kamaelia's&quot; model here, but this is pretty similar to hardware, unix pipes, etc.&lt;br /&gt;&lt;/li&gt;&lt;/ul&gt;&lt;/ul&gt;Now the thing I can't tell by looking at literature is what the general case is for most actor systems &lt;i&gt;in practice:&lt;/i&gt;&lt;br /&gt;&lt;ul&gt;&lt;li&gt;Do they do the literal, and solely asynchronous thing? (ie always return immediately without error when you send a message)&lt;br /&gt;&lt;/li&gt;&lt;li&gt;Or do they introduce the ability to add in synchrony where necessary? (block or return an exception when a maximum inbox size is reached)&lt;br /&gt;&lt;/li&gt;&lt;/ul&gt;The reason I ask is because if you don't have the ability to define pipewidths, maximum inbox sizes, maximum outbox sizes or &lt;b&gt;something&lt;/b&gt; then you can easily cause a denial of service attack in that scenario by having producers overload consumers. Consider a frame grabber feeding a slow, experimental video codec. In that scenario, it becomes rather important to be able to have a form of blocking (or EAGAIN) behaviour available. Indeed, this is such a common issue, that it's why unix pipes &amp;amp; filehandles will buffer a small amount of data, but block if you send too much data (or exhibit EAGAIN behaviour :). Similarly this is what's behind the socket.listen(argument) call in a server - to allow a certain number of connections to queue up, before refusing connections...&lt;br /&gt;

&lt;br /&gt;So, the question I really have is this: if you use or implement an actor model system, do you have any ability in your implementation to be able to say &quot;maximum number of pending incoming messages&quot; ? If you don't, then it is remarkably easy to write code that can break an actor based system by mistake, with problems in dealing with that - making code more complex, and less reusable. &lt;br /&gt;&lt;br /&gt;I'd really be interested in hearing both positives and negatives here...&lt;br /&gt;&lt;br /&gt;</content:encoded>
	<dc:date>2008-11-17T03:40:21+00:00</dc:date>
	<dc:creator>Michael</dc:creator>
</item>
<item rdf:about="tag:blogger.com,1999:blog-18669215.post-4455795161758732484">
	<title>Tales of a Programming Hobo - Christopher Armstrong: Twisted 8.2.0pre1</title>
	<link>http://radix.twistedmatrix.com/2008/11/twisted-820pre1.html</link>
	<content:encoded>Please try out the first (and hopefully only) pre-release of Twisted 8.2.0, the first Twisted release since April.&lt;br /&gt;&lt;br /&gt;&lt;a href=&quot;http://twistedmatrix.com/users/radix/8.2.0pre1/&quot;&gt;Downloads&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;a href=&quot;http://twistedmatrix.com/users/radix/8.2.0pre1/NEWS.txt&quot;&gt;Release notes&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;Please try it out and report any bugs.</content:encoded>
	<dc:date>2008-11-17T01:59:55+00:00</dc:date>
	<dc:creator>Christopher Armstrong</dc:creator>
</item>
<item rdf:about="http://www.eflorenzano.com/blog/post/writing-markov-chain-irc-bot-twisted-and-python/">
	<title>Eric Florenzano: Writing an Markov-Chain IRC Bot with Twisted and Python</title>
	<link>http://www.eflorenzano.com/blog/post/writing-markov-chain-irc-bot-twisted-and-python/</link>
	<content:encoded>&lt;p&gt;&lt;a href=&quot;http://twistedmatrix.com/trac/&quot; class=&quot;reference&quot;&gt;Twisted&lt;/a&gt; is one of Python's great secret weapons.  It is an absolute workhorse,
allowing for insanely fast network applications to be written with very little
effort.  So let's do what everyone does when they want to learn more about
Twisted: let's write an IRC bot!  This bot is going to use &lt;a href=&quot;http://en.wikipedia.org/wiki/Markov_chain&quot; class=&quot;reference&quot;&gt;Markov Chains&lt;/a&gt; to
simulate human speech.  For whatever reason, I named this bot &quot;YourMomDotCom&quot;.&lt;/p&gt;
&lt;p&gt;First let's create a skeleton on top of which the rest of the bot will be
created:&lt;/p&gt;
&lt;div class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;span style=&quot;color: #008000; font-weight: bold;&quot;&gt;from&lt;/span&gt; &lt;span style=&quot;color: #0000FF; font-weight: bold;&quot;&gt;twisted.words.protocols&lt;/span&gt; &lt;span style=&quot;color: #008000; font-weight: bold;&quot;&gt;import&lt;/span&gt; irc
&lt;span style=&quot;color: #008000; font-weight: bold;&quot;&gt;from&lt;/span&gt; &lt;span style=&quot;color: #0000FF; font-weight: bold;&quot;&gt;twisted.internet&lt;/span&gt; &lt;span style=&quot;color: #008000; font-weight: bold;&quot;&gt;import&lt;/span&gt; protocol

&lt;span style=&quot;color: #008000; font-weight: bold;&quot;&gt;class&lt;/span&gt; &lt;span style=&quot;color: #0000FF; font-weight: bold;&quot;&gt;MomBot&lt;/span&gt;(irc&lt;span style=&quot;color: #666666;&quot;&gt;.&lt;/span&gt;IRCClient):
    &lt;span style=&quot;color: #008000; font-weight: bold;&quot;&gt;def&lt;/span&gt; &lt;span style=&quot;color: #0000FF;&quot;&gt;_get_nickname&lt;/span&gt;(&lt;span style=&quot;color: #008000;&quot;&gt;self&lt;/span&gt;):
        &lt;span style=&quot;color: #008000; font-weight: bold;&quot;&gt;return&lt;/span&gt; &lt;span style=&quot;color: #008000;&quot;&gt;self&lt;/span&gt;&lt;span style=&quot;color: #666666;&quot;&gt;.&lt;/span&gt;factory&lt;span style=&quot;color: #666666;&quot;&gt;.&lt;/span&gt;nickname
    nickname &lt;span style=&quot;color: #666666;&quot;&gt;=&lt;/span&gt; &lt;span style=&quot;color: #008000;&quot;&gt;property&lt;/span&gt;(_get_nickname)

    &lt;span style=&quot;color: #008000; font-weight: bold;&quot;&gt;def&lt;/span&gt; &lt;span style=&quot;color: #0000FF;&quot;&gt;signedOn&lt;/span&gt;(&lt;span style=&quot;color: #008000;&quot;&gt;self&lt;/span&gt;):
        &lt;span style=&quot;color: #008000;&quot;&gt;self&lt;/span&gt;&lt;span style=&quot;color: #666666;&quot;&gt;.&lt;/span&gt;join(&lt;span style=&quot;color: #008000;&quot;&gt;self&lt;/span&gt;&lt;span style=&quot;color: #666666;&quot;&gt;.&lt;/span&gt;factory&lt;span style=&quot;color: #666666;&quot;&gt;.&lt;/span&gt;channel)
        &lt;span style=&quot;color: #008000; font-weight: bold;&quot;&gt;print&lt;/span&gt; &lt;span style=&quot;color: #BA2121;&quot;&gt;&quot;Signed on as &lt;/span&gt;&lt;span style=&quot;color: #BB6688; font-weight: bold;&quot;&gt;%s&lt;/span&gt;&lt;span style=&quot;color: #BA2121;&quot;&gt;.&quot;&lt;/span&gt; &lt;span style=&quot;color: #666666;&quot;&gt;%&lt;/span&gt; (&lt;span style=&quot;color: #008000;&quot;&gt;self&lt;/span&gt;&lt;span style=&quot;color: #666666;&quot;&gt;.&lt;/span&gt;nickname,)

    &lt;span style=&quot;color: #008000; font-weight: bold;&quot;&gt;def&lt;/span&gt; &lt;span style=&quot;color: #0000FF;&quot;&gt;joined&lt;/span&gt;(&lt;span style=&quot;color: #008000;&quot;&gt;self&lt;/span&gt;, channel):
        &lt;span style=&quot;color: #008000; font-weight: bold;&quot;&gt;print&lt;/span&gt; &lt;span style=&quot;color: #BA2121;&quot;&gt;&quot;Joined &lt;/span&gt;&lt;span style=&quot;color: #BB6688; font-weight: bold;&quot;&gt;%s&lt;/span&gt;&lt;span style=&quot;color: #BA2121;&quot;&gt;.&quot;&lt;/span&gt; &lt;span style=&quot;color: #666666;&quot;&gt;%&lt;/span&gt; (channel,)

    &lt;span style=&quot;color: #008000; font-weight: bold;&quot;&gt;def&lt;/span&gt; &lt;span style=&quot;color: #0000FF;&quot;&gt;privmsg&lt;/span&gt;(&lt;span style=&quot;color: #008000;&quot;&gt;self&lt;/span&gt;, user, channel, msg):
        &lt;span style=&quot;color: #008000; font-weight: bold;&quot;&gt;print&lt;/span&gt; msg

&lt;span style=&quot;color: #008000; font-weight: bold;&quot;&gt;class&lt;/span&gt; &lt;span style=&quot;color: #0000FF; font-weight: bold;&quot;&gt;MomBotFactory&lt;/span&gt;(protocol&lt;span style=&quot;color: #666666;&quot;&gt;.&lt;/span&gt;ClientFactory):
    protocol &lt;span style=&quot;color: #666666;&quot;&gt;=&lt;/span&gt; MomBot

    &lt;span style=&quot;color: #008000; font-weight: bold;&quot;&gt;def&lt;/span&gt; &lt;span style=&quot;color: #0000FF;&quot;&gt;__init__&lt;/span&gt;(&lt;span style=&quot;color: #008000;&quot;&gt;self&lt;/span&gt;, channel, nickname&lt;span style=&quot;color: #666666;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: #BA2121;&quot;&gt;'YourMomDotCom'&lt;/span&gt;):
        &lt;span style=&quot;color: #008000;&quot;&gt;self&lt;/span&gt;&lt;span style=&quot;color: #666666;&quot;&gt;.&lt;/span&gt;channel &lt;span style=&quot;color: #666666;&quot;&gt;=&lt;/span&gt; channel
        &lt;span style=&quot;color: #008000;&quot;&gt;self&lt;/span&gt;&lt;span style=&quot;color: #666666;&quot;&gt;.&lt;/span&gt;nickname &lt;span style=&quot;color: #666666;&quot;&gt;=&lt;/span&gt; nickname

    &lt;span style=&quot;color: #008000; font-weight: bold;&quot;&gt;def&lt;/span&gt; &lt;span style=&quot;color: #0000FF;&quot;&gt;clientConnectionLost&lt;/span&gt;(&lt;span style=&quot;color: #008000;&quot;&gt;self&lt;/span&gt;, connector, reason):
        &lt;span style=&quot;color: #008000; font-weight: bold;&quot;&gt;print&lt;/span&gt; &lt;span style=&quot;color: #BA2121;&quot;&gt;&quot;Lost connection (&lt;/span&gt;&lt;span style=&quot;color: #BB6688; font-weight: bold;&quot;&gt;%s&lt;/span&gt;&lt;span style=&quot;color: #BA2121;&quot;&gt;), reconnecting.&quot;&lt;/span&gt; &lt;span style=&quot;color: #666666;&quot;&gt;%&lt;/span&gt; (reason,)
        connector&lt;span style=&quot;color: #666666;&quot;&gt;.&lt;/span&gt;connect()

    &lt;span style=&quot;color: #008000; font-weight: bold;&quot;&gt;def&lt;/span&gt; &lt;span style=&quot;color: #0000FF;&quot;&gt;clientConnectionFailed&lt;/span&gt;(&lt;span style=&quot;color: #008000;&quot;&gt;self&lt;/span&gt;, connector, reason):
        &lt;span style=&quot;color: #008000; font-weight: bold;&quot;&gt;print&lt;/span&gt; &lt;span style=&quot;color: #BA2121;&quot;&gt;&quot;Could not connect: &lt;/span&gt;&lt;span style=&quot;color: #BB6688; font-weight: bold;&quot;&gt;%s&lt;/span&gt;&lt;span style=&quot;color: #BA2121;&quot;&gt;&quot;&lt;/span&gt; &lt;span style=&quot;color: #666666;&quot;&gt;%&lt;/span&gt; (reason,)
&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;We've now created an &lt;tt class=&quot;docutils literal&quot;&gt;&lt;span class=&quot;pre&quot;&gt;IRCClient&lt;/span&gt;&lt;/tt&gt; subclass which will hold our application
logic, and we've also written a factory class which will create instances of
that &lt;tt class=&quot;docutils literal&quot;&gt;&lt;span class=&quot;pre&quot;&gt;MomBot&lt;/span&gt;&lt;/tt&gt; client.  Let's tie these together and start the event loop:&lt;/p&gt;
&lt;div class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;span style=&quot;color: #008000; font-weight: bold;&quot;&gt;import&lt;/span&gt; &lt;span style=&quot;color: #0000FF; font-weight: bold;&quot;&gt;sys&lt;/span&gt;
&lt;span style=&quot;color: #008000; font-weight: bold;&quot;&gt;from&lt;/span&gt; &lt;span style=&quot;color: #0000FF; font-weight: bold;&quot;&gt;twisted.internet&lt;/span&gt; &lt;span style=&quot;color: #008000; font-weight: bold;&quot;&gt;import&lt;/span&gt; reactor

&lt;span style=&quot;color: #008000; font-weight: bold;&quot;&gt;if&lt;/span&gt; __name__ &lt;span style=&quot;color: #666666;&quot;&gt;==&lt;/span&gt; &lt;span style=&quot;color: #BA2121;&quot;&gt;&quot;__main__&quot;&lt;/span&gt;:
    chan &lt;span style=&quot;color: #666666;&quot;&gt;=&lt;/span&gt; sys&lt;span style=&quot;color: #666666;&quot;&gt;.&lt;/span&gt;argv[&lt;span style=&quot;color: #666666;&quot;&gt;1&lt;/span&gt;]
    reactor&lt;span style=&quot;color: #666666;&quot;&gt;.&lt;/span&gt;connectTCP(&lt;span style=&quot;color: #BA2121;&quot;&gt;'irc.freenode.net'&lt;/span&gt;, &lt;span style=&quot;color: #666666;&quot;&gt;6667&lt;/span&gt;, MomBotFactory(&lt;span style=&quot;color: #BA2121;&quot;&gt;'#'&lt;/span&gt; &lt;span style=&quot;color: #666666;&quot;&gt;+&lt;/span&gt; chan))
    reactor&lt;span style=&quot;color: #666666;&quot;&gt;.&lt;/span&gt;run()
&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;Now already we have a complete working IRC bot.  Right now all it will do is
connect to an IRC channel and echo all of the output to the command line.  Not
bad for how little code we've written. Now all we have to do is implement our
application logic.  Let's first start by creating the 'brain' of our Markov
chain responder, and adding a function to train the brain:&lt;/p&gt;
&lt;div class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;span style=&quot;color: #008000; font-weight: bold;&quot;&gt;from&lt;/span&gt; &lt;span style=&quot;color: #0000FF; font-weight: bold;&quot;&gt;collections&lt;/span&gt; &lt;span style=&quot;color: #008000; font-weight: bold;&quot;&gt;import&lt;/span&gt; defaultdict

markov &lt;span style=&quot;color: #666666;&quot;&gt;=&lt;/span&gt; defaultdict(&lt;span style=&quot;color: #008000;&quot;&gt;list&lt;/span&gt;)
STOP_WORD &lt;span style=&quot;color: #666666;&quot;&gt;=&lt;/span&gt; &lt;span style=&quot;color: #BA2121;&quot;&gt;&quot;&lt;/span&gt;&lt;span style=&quot;color: #BB6622; font-weight: bold;&quot;&gt;\n&lt;/span&gt;&lt;span style=&quot;color: #BA2121;&quot;&gt;&quot;&lt;/span&gt;

&lt;span style=&quot;color: #008000; font-weight: bold;&quot;&gt;def&lt;/span&gt; &lt;span style=&quot;color: #0000FF;&quot;&gt;add_to_brain&lt;/span&gt;(msg, chain_length, write_to_file&lt;span style=&quot;color: #666666;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: #008000;&quot;&gt;False&lt;/span&gt;):
    &lt;span style=&quot;color: #008000; font-weight: bold;&quot;&gt;if&lt;/span&gt; write_to_file:
        f &lt;span style=&quot;color: #666666;&quot;&gt;=&lt;/span&gt; &lt;span style=&quot;color: #008000;&quot;&gt;open&lt;/span&gt;(&lt;span style=&quot;color: #BA2121;&quot;&gt;'training_text.txt'&lt;/span&gt;, &lt;span style=&quot;color: #BA2121;&quot;&gt;'a'&lt;/span&gt;)
        f&lt;span style=&quot;color: #666666;&quot;&gt;.&lt;/span&gt;write(msg &lt;span style=&quot;color: #666666;&quot;&gt;+&lt;/span&gt; &lt;span style=&quot;color: #BA2121;&quot;&gt;'&lt;/span&gt;&lt;span style=&quot;color: #BB6622; font-weight: bold;&quot;&gt;\n&lt;/span&gt;&lt;span style=&quot;color: #BA2121;&quot;&gt;'&lt;/span&gt;)
        f&lt;span style=&quot;color: #666666;&quot;&gt;.&lt;/span&gt;close()
    buf &lt;span style=&quot;color: #666666;&quot;&gt;=&lt;/span&gt; [STOP_WORD] &lt;span style=&quot;color: #666666;&quot;&gt;*&lt;/span&gt; chain_length
    &lt;span style=&quot;color: #008000; font-weight: bold;&quot;&gt;for&lt;/span&gt; word &lt;span style=&quot;color: #AA22FF; font-weight: bold;&quot;&gt;in&lt;/span&gt; msg&lt;span style=&quot;color: #666666;&quot;&gt;.&lt;/span&gt;split():
        markov[&lt;span style=&quot;color: #008000;&quot;&gt;tuple&lt;/span&gt;(buf)]&lt;span style=&quot;color: #666666;&quot;&gt;.&lt;/span&gt;append(word)
        &lt;span style=&quot;color: #008000; font-weight: bold;&quot;&gt;del&lt;/span&gt; buf[&lt;span style=&quot;color: #666666;&quot;&gt;0&lt;/span&gt;]
        buf&lt;span style=&quot;color: #666666;&quot;&gt;.&lt;/span&gt;append(word)
    markov[&lt;span style=&quot;color: #008000;&quot;&gt;tuple&lt;/span&gt;(buf)]&lt;span style=&quot;color: #666666;&quot;&gt;.&lt;/span&gt;append(STOP_WORD)
&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;In this, we are creating a defaultdict of lists.  For every n-word sliding
window, the word after that window is appended to the list of possible words.
Here's an image which hopefully depicts better than words how the algorithm
populates the brain:&lt;/p&gt;
&lt;img src=&quot;http://media.eflorenzano.com/img/markov.png&quot; alt=&quot;http://media.eflorenzano.com/img/markov.png&quot; /&gt;
&lt;p&gt;But what good is a brain like this if we can't get words back from it.  We're
going to need to write a function to generate sentences from that brain:&lt;/p&gt;
&lt;div class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;span style=&quot;color: #008000; font-weight: bold;&quot;&gt;def&lt;/span&gt; &lt;span style=&quot;color: #0000FF;&quot;&gt;generate_sentence&lt;/span&gt;(msg, chain_length, max_words&lt;span style=&quot;color: #666666;&quot;&gt;=10000&lt;/span&gt;):
    buf &lt;span style=&quot;color: #666666;&quot;&gt;=&lt;/span&gt; msg&lt;span style=&quot;color: #666666;&quot;&gt;.&lt;/span&gt;split()[:chain_length]
    &lt;span style=&quot;color: #008000; font-weight: bold;&quot;&gt;if&lt;/span&gt; &lt;span style=&quot;color: #008000;&quot;&gt;len&lt;/span&gt;(msg&lt;span style=&quot;color: #666666;&quot;&gt;.&lt;/span&gt;split()) &lt;span style=&quot;color: #666666;&quot;&gt;&amp;gt;&lt;/span&gt; chain_length:
        message &lt;span style=&quot;color: #666666;&quot;&gt;=&lt;/span&gt; buf[:]
    &lt;span style=&quot;color: #008000; font-weight: bold;&quot;&gt;else&lt;/span&gt;:
        message &lt;span style=&quot;color: #666666;&quot;&gt;=&lt;/span&gt; []
        &lt;span style=&quot;color: #008000; font-weight: bold;&quot;&gt;for&lt;/span&gt; i &lt;span style=&quot;color: #AA22FF; font-weight: bold;&quot;&gt;in&lt;/span&gt; &lt;span style=&quot;color: #008000;&quot;&gt;xrange&lt;/span&gt;(chain_length):
            message&lt;span style=&quot;color: #666666;&quot;&gt;.&lt;/span&gt;append(random&lt;span style=&quot;color: #666666;&quot;&gt;.&lt;/span&gt;choice(markov[random&lt;span style=&quot;color: #666666;&quot;&gt;.&lt;/span&gt;choice(markov&lt;span style=&quot;color: #666666;&quot;&gt;.&lt;/span&gt;keys())]))
    &lt;span style=&quot;color: #008000; font-weight: bold;&quot;&gt;for&lt;/span&gt; i &lt;span style=&quot;color: #AA22FF; font-weight: bold;&quot;&gt;in&lt;/span&gt; &lt;span style=&quot;color: #008000;&quot;&gt;xrange&lt;/span&gt;(max_words):
        &lt;span style=&quot;color: #008000; font-weight: bold;&quot;&gt;try&lt;/span&gt;:
            next_word &lt;span style=&quot;color: #666666;&quot;&gt;=&lt;/span&gt; random&lt;span style=&quot;color: #666666;&quot;&gt;.&lt;/span&gt;choice(markov[&lt;span style=&quot;color: #008000;&quot;&gt;tuple&lt;/span&gt;(buf)])
        &lt;span style=&quot;color: #008000; font-weight: bold;&quot;&gt;except&lt;/span&gt; &lt;span style=&quot;color: #D2413A; font-weight: bold;&quot;&gt;IndexError&lt;/span&gt;:
            &lt;span style=&quot;color: #008000; font-weight: bold;&quot;&gt;continue&lt;/span&gt;
        &lt;span style=&quot;color: #008000; font-weight: bold;&quot;&gt;if&lt;/span&gt; next_word &lt;span style=&quot;color: #666666;&quot;&gt;==&lt;/span&gt; STOP_WORD:
            &lt;span style=&quot;color: #008000; font-weight: bold;&quot;&gt;break&lt;/span&gt;
        message&lt;span style=&quot;color: #666666;&quot;&gt;.&lt;/span&gt;append(next_word)
        &lt;span style=&quot;color: #008000; font-weight: bold;&quot;&gt;del&lt;/span&gt; buf[&lt;span style=&quot;color: #666666;&quot;&gt;0&lt;/span&gt;]
        buf&lt;span style=&quot;color: #666666;&quot;&gt;.&lt;/span&gt;append(next_word)
    &lt;span style=&quot;color: #008000; font-weight: bold;&quot;&gt;return&lt;/span&gt; &lt;span style=&quot;color: #BA2121;&quot;&gt;' '&lt;/span&gt;&lt;span style=&quot;color: #666666;&quot;&gt;.&lt;/span&gt;join(message)
&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;We start out our seed buffer with the first few words of the message, and if the
message wasn't long enough, we fill the seed buffer with some random words from
the markov's brain.  Then we use the buffer as a key into the markov brain and
randomly pick one of the values as our next word.  Then we slide that buffer
so that the chosen word is now the next word in the buffer (ejecting the oldest
word in the buffer).  If we ever see a stop word, we stop and return the
generated sentence.&lt;/p&gt;
&lt;p&gt;Now it's a matter of expanding our bot to take advantage of our markov brain.
The first change we will need to make is to mo