<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0" 
  xmlns:dc="http://purl.org/dc/elements/1.1/"
  xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
  xmlns:admin="http://webns.net/mvcb/"
  xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
  xmlns:content="http://purl.org/rss/1.0/modules/content/"
  xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
  xmlns:trackback="http://madskills.com/public/xml/rss/module/trackback/">
<channel>
<title>Aquarionics - Category - Python and Subcategories</title>
<link>http://www.aquarionics.com/category/Python</link>
<description></description>
<dc:language>en-gb</dc:language>
<dc:creator>Aquarion (nicholas@aquarionics.com)</dc:creator>
<dc:rights>Copyright 2008 Aquarion</dc:rights>
<dc:date>2008-08-29T05:26:19+00:00</dc:date>
<admin:generatorAgent rdf:resource="http://www.aquarionics.com/epistula/?v=2.0.3" />
<admin:errorReportsTo rdf:resource="mailto:nicholas@aquarionics.com"/>
<sy:updatePeriod>daily</sy:updatePeriod>
<sy:updateFrequency>8</sy:updateFrequency>
<sy:updateBase>2000-01-01T12:00+00:00</sy:updateBase>
<item>
	<title>Djingle Django Scarecrow</title>
	<link>http://www.aquarionics.com/journal/2006/10/29/Djingle_Django_Scarecrow</link>
	<comments>http://www.aquarionics.com/journal/2006/10/29/Djingle_Django_Scarecrow</comments>
	<description>One of the concepts you may run into if you read into Python and its fans in great depth (and here I mean Python of the programming type rather than the Monty type) is that of &amp;#8220;Guido&amp;#8217;s Time Machine&amp;#8221;, the number of times when you are thinking &amp;#8220;Would it be nice if Python did this&amp;#8230;&amp;#8221; and you suddenly find that yes, that&amp;#8217;s exactly how Python does it, to the...</description>
	<guid isPermaLink="true">http://www.aquarionics.com/journal/2006/10/29/Djingle_Django_Scarecrow</guid>
	<content:encoded><![CDATA[<p>One of the concepts you may run into if you read into Python and its fans in great depth (and here I mean Python of the programming type rather than the Monty type) is that of &#8220;Guido&#8217;s Time Machine&#8221;, the number of times when you are thinking &#8220;Would it be nice if Python did this&#8230;&#8221; and you suddenly find that yes, that&#8217;s exactly how Python does it, to the point where the only way Guido could have possibly considered all this would be if he already knew.</p>

	<p>I&#8217;m having the same kind of thing with Django. Frameworks for validation, existing user system, that kind of thing. Stuff like &#8220;Do you know what would be nice? If I could do something so that my Logged in User&#8217;s Profile appeared in the default scope of a template, so I didn&#8217;t have to pass it in every time, and keep throwing it around the program.&#8221; and suddenly, there are Context Processors.</p>

	<p>The annoying bits are where stuff is under development, or half documented. For example, Having spent a while creating a User Profile system to associate information specific to this system (Authentication code, invite code, email me alerts, for example) and joined it one-to-one with the user system, I then find a tiny little bit of text in the User Auth system docs which says:</p>

<code>get_profile() -- Returns a site-specific profile for this user. Raises django.contrib.auth.models.SiteProfileNotAvailable if the current site doesn't allow profiles.</code>

	<p>This sound really close to what I&#8217;ve spend a while doing myself, but that is the first, last and only reference to it in the docs that I can find.</p>

	<p><span class="caps">OTOH</span>, I&#8217;ve now got a system you can log into and register for, and I&#8217;ve got a deeper understanding of how Django works. Yay.</p>]]></content:encoded>
	<dc:date>2006-10-29T14:36:14+00:00</dc:date>
	<dc:subject>Cantrip</dc:subject>
	<dc:subject>Django</dc:subject>
	<slash:comments>1</slash:comments>
	<slash:section>journal</slash:section>
	<trackback:ping>http://www.aquarionics.com/trackback/journal/1954</trackback:ping>
</item>
<item>
	<title>Aquaintances 2</title>
	<link>http://www.aquarionics.com/journal/2005/05/01/Aquaintances_2</link>
	<comments>http://www.aquarionics.com/journal/2005/05/01/Aquaintances_2</comments>
	<description>Aquaintances 2 is an XML Feed reader for Microsoft Windows, Linux and Apple OSX. It will support baysian filtering of posts &amp;#8211; meaning posts you are more interested in will float to the top of your reading lists &amp;#8211; as well as regex field matching. It is built in GTK/Python (on top of LibGlade) using the Mozilla Firefox GTK bindings. It parses feeds with the Ultra Liberal Feed Parser,...</description>
	<guid isPermaLink="true">http://www.aquarionics.com/journal/2005/05/01/Aquaintances_2</guid>
	<content:encoded><![CDATA[<p>Aquaintances 2 is an <span class="caps">XML </span>Feed reader for Microsoft Windows, Linux and Apple <span class="caps">OSX</span>. It will support baysian filtering of posts &#8211; meaning posts you are more interested in will float to the top of your reading lists &#8211; as well as regex field matching. It is built in <span class="caps">GTK</span>/Python (on top of LibGlade) using the Mozilla Firefox <span class="caps">GTK</span> bindings. It parses feeds with the <a href="http://sourceforge.net/projects/feedparser/">Ultra Liberal Feed Parser</a>, stores them (and most other things) in an <a href="http://www.sqlite.org/">SQLite</a> database. It will revolutionise the way you keep track of the world.</p>

	<p>Natually, it doesn&#8217;t work yet.</p>

	<p>This morning I fired up Glade and put down the main interface for the system, which involved a certian amount of farting around with <span class="caps">GTK</span>&#8217;s box model, and all was fine until I had to attempt to tie the web browser to this.</p>

	<p>My preference for this project was to use Mozilla&#8217;s &#8220;Gecko&#8221; rendering engine for the actual displaying of feeds, which was made more difficult by the fact that there are three sets of pages refering to the <span class="caps">GTK</span> bindings I was looking for. <a href="http://sourceforge.net/projects/pygtkmoz">PyGTKMoz</a> is an aborted attempt to get it working, Mozilla itself has <a href="http://www.mozilla.org/unix/gtk-embedding.html">a website on the subject</a>, and PyGTKMoz refers me to <a href="http://www.pygtk.org/">PyGTK</a>, which doesn&#8217;t mention the bindings at all. Eventually it transpires that the Mozilla bindings are now part of &#8220;python-gnome-extras&#8221;, which an apt-get installed for me.</p>

	<p>That failed to work, because it doesn&#8217;t require &#8220;mozilla-dev&#8221; or &#8220;mozilla-firefox-dev&#8221; and even when those are installed, I had to manually <del>add /usr/lib/mozilla-firefox</del> <ins>add /usr/lib.mozilla</ins> to /etc/ld.so.conf so that Python could find it.</p>

	<p>Then I had to work out how to get a Widget Glade doesn&#8217;t know about into my nice Gladey interface, for which <a href="http://patrick.wagstrom.net/tutorials/pygtkmozembed/pygtkmozembed.html">this article</a> was a handy guide, although it&#8217;s bitrotted a bit.</p>

	<p>Okay, so we have an interface that happily displays a webpage. time to put some actual feed data in it. Importing my <span class="caps">OPML</span> file from Bloglines, I wrote a thing to parse the <span class="caps">XML </span>(Starting with minidom, which failed because I needed to keep track of recursive <outline /> tags. so I rebuilt it in <acronym title="Simple Aplication Programming Interface for eXtendable Markup Language">SAX</acronym> (An acronym with too many abbreviations in it) with the standard push/pop method of keeping track of where the hell we are, a method I&#8217;ve always found exceedingly ugly, but at least it&#8217;s quick&#8230;</p>

	<p>The tree interface to the subscriptions list was next. The GtkTreeView element caused me a number of problems, partially because I was trying to use it before I really understood it. Also, all the tutorials for using it I found (<a href="http://liw.iki.fi/liw/texts/gtktreeview-tutorial.html">iki fi</a>, &#38; <a href="http://www.moeraki.com/pygtktutorial/pygtk2tutorial/ch-TreeViewWidget.html">moeraki</a> were the most useful, as well as the <a href="http://www.pygtk.org/pygtk2reference/class-gtktreemodel.html">Real Docs</a>) assume you&#8217;re building the thing from scratch, rather than editing an already existing TreeView object. Also, there was an interchangability between &#8220;TreeStore&#8221; and &#8220;TreeModel&#8221; that was starting to give me a headache. Then, in a blinding flash of light, my screensaver kicked in, englightenment dawned, and I finally grokked it.</p>

	<p>So, I have an interface with working buttons that displays the home page of every feed I subscribe to. Except three, which causes a segmentation fault for reasons I don&#8217;t understand, but are probably Not My Fault.</p>

	<p>Aim is to get it reading and displaying feeds by tonight, with the Bayesian stuff happening tomorrow, at which point I release Real Code and start making it both cool and useable.</p>

	<p><ins>2005-05-02: Changed gtkmozbinding instructions, the firefox library appears to crash if you need a plugin</ins></p>]]></content:encoded>
	<dc:date>2005-05-01T13:26:47+00:00</dc:date>
	<dc:subject>Aquaintances</dc:subject>
	<dc:subject>Python</dc:subject>
	<slash:comments>3</slash:comments>
	<slash:section>journal</slash:section>
	<trackback:ping>http://www.aquarionics.com/trackback/journal/1641</trackback:ping>
</item>
<item>
	<title>Project Scout</title>
	<link>http://www.aquarionics.com/journal/2005/04/02/Project_Scout</link>
	<comments>http://www.aquarionics.com/journal/2005/04/02/Project_Scout</comments>
	<description>Somewhat to my suprise, I have recieved not one, but two patches to open source projects that I run. That is that gilmae submitted a better install document for AqWiki, and  John Meadows has submitted a new version of the viewer file for MusicDB 

	Flush with this success, I&amp;#8217;ve started a new project. Well, two. Threeish, really. First, I&amp;#8217;ve gone back to the base system that Cantrip...</description>
	<guid isPermaLink="true">http://www.aquarionics.com/journal/2005/04/02/Project_Scout</guid>
	<content:encoded><![CDATA[<p>Somewhat to my suprise, I have recieved not one, but two patches to open source projects that I run. That is that <a href="http://avocadia.net/">gilmae</a> submitted a better install document for <a href="http://aqwiki.sf.net">AqWiki</a>, and  <a href="http://www.meadowsonline.com/">John Meadows</a> has submitted a new version of the viewer file for <a href="http://freshmeat.net/projects/musicdb/">MusicDB</a> </p>

	<p>Flush with this success, I&#8217;ve started a new project. Well, two. Threeish, really. First, I&#8217;ve gone back to the base system that Cantrip and Escape will be built on, which is actually the Epistula execution model rebuilt in python and mod_python. This is almost finished (yay) and is far neater than the <span class="caps">PHP</span> version (double yay) but I&#8217;m having trouble with one thing. So, pythonites who are still reading this crap: How do I initalise a class where the name of the class is contained in a variable?</p>

	<p>Two, and more importantly, how should I have known this?</p>

	<p>The third thing is a collision of a few technologies I&#8217;ve been wanting to use for a while: <a href="http://www.xmltv.org"><span class="caps">XMLTV</span></a>, SQLite and <span class="caps">AJAX</span>, or <span class="caps">DHTML</span>, or whatever we&#8217;re calling it today, with a dash of new-media <span class="caps">SMS</span> stuff thrown in. Basic premise for project Scout is that it sends you an <span class="caps">SMS</span> ten minutes before a TV program that you wanted is due to start. It&#8217;s a little more complicated than that, but not much (Until you get to the <span class="caps">AJAX</span> bits, really). Enough for me to be able to use it to drink even more of the Python kool-aid, while having something more useful at the end than a random philosophy generator.</p>]]></content:encoded>
	<dc:date>2005-04-02T18:54:04+00:00</dc:date>
	<dc:subject>programming</dc:subject>
	<dc:subject>projects</dc:subject>
	<dc:subject>Python</dc:subject>
	<dc:subject>web development</dc:subject>
	<slash:comments>0</slash:comments>
	<slash:section>journal</slash:section>
	<trackback:ping>http://www.aquarionics.com/trackback/journal/1617</trackback:ping>
</item>
<item>
	<title>Mounting Python</title>
	<link>http://www.aquarionics.com/journal/2005/01/15/Mounting_Python</link>
	<comments>http://www.aquarionics.com/journal/2005/01/15/Mounting_Python</comments>
	<description>How do you work with Python and web development? Do you use quixote, mod_python, normal CGI, Zope or something I&amp;#8217;ve never heard of? Why do you use that instead of something else?</description>
	<guid isPermaLink="true">http://www.aquarionics.com/journal/2005/01/15/Mounting_Python</guid>
	<content:encoded><![CDATA[<p>How do you work with Python and web development? Do you use <a href="http://www.mems-exchange.org/software/quixote/">quixote</a>, mod_python, normal <span class="caps">CGI</span>, Zope or something I&#8217;ve never heard of? Why do you use that instead of something else?</p>]]></content:encoded>
	<dc:date>2005-01-15T16:19:43+00:00</dc:date>
	<dc:subject>Python</dc:subject>
	<slash:comments>5</slash:comments>
	<slash:section>journal</slash:section>
	<trackback:ping>http://www.aquarionics.com/trackback/journal/1576</trackback:ping>
</item>
<item>
	<title>Vampire: The Maskerade: Bloodlines. Plus: Python</title>
	<link>http://www.aquarionics.com/journal/2004/12/10/Vampire%3A_The_Maskerade%3A_Bloodlines._Plus%3A_Python</link>
	<comments>http://www.aquarionics.com/journal/2004/12/10/Vampire%3A_The_Maskerade%3A_Bloodlines._Plus%3A_Python</comments>
	<description>(Too much punctuation in one title, perhaps?)

Aquarion returns from playing Bloodlines 
Mandy_Away: good?
Aquarion: Sort of
Aquarion: The story is well done, the characters are very well done, and I'm enjoying it.
Aquarion: And it uses the HL2 engine, so it looks cool
Aquarion: OTOH, it runs like a dog (Even though HL2 - which is far more visually complicated - glides)
Aquarion: and...</description>
	<guid isPermaLink="true">http://www.aquarionics.com/journal/2004/12/10/Vampire%3A_The_Maskerade%3A_Bloodlines._Plus%3A_Python</guid>
	<content:encoded><![CDATA[<p>(Too much punctuation in one title, perhaps?)</p>

<blockquote cite=""><p>Aquarion returns from playing <a href="http://www.vampirebloodlines.com/">Bloodlines</a> <br>
<a href="http://www.andystanford.me.uk/weblog/">Mandy_Away</a>: good?<br>
Aquarion: Sort of<br>
Aquarion: The story is well done, the <a href="http://www.planetvampire.com/bloodlines/gallery/concept/">characters</a> are very well done, and I'm enjoying it.<br>
Aquarion: And it uses the <a href="http://www.valvesoftware.com/sourcelicense/default.htm">HL2 engine</a>, so it looks cool<br>
Aquarion: OTOH, it runs like a <a href="http://www.aquarionics.com/diarystuff/2003/02/IMG_0416.jpg">dog</a> (Even though HL2 - which is far more visually complicated - glides)<br>
Aquarion: and there are occasional scripting glitches which are annoying.<br>
Aquarion: (Like a bad-guy who crashes though the door, gun at the ready, and then stands up and still for a while because I'm hiding behind a box and he can't see me. Which just looks silly)<br>
Aquarion: Oh, and the combat system is a bitch, but that may be because it tends to sink the frame-rate though the floor.<br>
Aquarion: OTOH, I've been playing it for about six or so hours, apparently, which is a bit of a shock. So it must be bearable :-)</p></blockquote>

<p>Talking of scripting, though, here is an example of Bloodlines' scripting:</p>

<pre><code>## after the masquerade pop-up in the chopshop office
def OnMasqueradeEnd():
    if IsClan(FindPlayer(), "Nosferatu"):
        popup = Find("popup_24")
        popup.OpenWindow()
    else:
        popup = Find("popup_15")
        popup.OpenWindow()

    trig = Find("trig_popup_masquerade")
    trig.Enable()</code></pre>

<p>Yup, Bloodlines' scripting is pure, 100% unadulterated Python code, so if it doesn't work, I can at least try to fix it...</p>]]></content:encoded>
	<dc:date>2004-12-10T16:23:50+00:00</dc:date>
	<dc:subject>Computer Games</dc:subject>
	<dc:subject>Python</dc:subject>
	<dc:subject>RPG</dc:subject>
	<slash:comments>0</slash:comments>
	<slash:section>journal</slash:section>
	<trackback:ping>http://www.aquarionics.com/trackback/journal/1558</trackback:ping>
</item>
<item>
	<title>Cantrip Diary - ZopeTastic</title>
	<link>http://www.aquarionics.com/journal/2004/09/22/Cantrip_Diary_-_ZopeTastic</link>
	<comments>http://www.aquarionics.com/journal/2004/09/22/Cantrip_Diary_-_ZopeTastic</comments>
	<description>Okay, so my new workplace use Zope, so it&amp;#8217;s probably a good idea for me to use that as a framework. I mean, enough people use it for it not to be too bad, right?

	Dear god does it suck. I mean, Whales though really thin gauze, it sucks that badly. I got it working on my local network after swearing at it quite loudly. It&amp;#8217;s own personal religion of &amp;#8220;Not Invented Here&amp;#8221; is...</description>
	<guid isPermaLink="true">http://www.aquarionics.com/journal/2004/09/22/Cantrip_Diary_-_ZopeTastic</guid>
	<content:encoded><![CDATA[<p>Okay, so my <a href="http://www.evolvingmedia.co.uk">new workplace</a> use Zope, so it&#8217;s probably a good idea for me to use that as a framework. I mean, enough people use it for it not to be too bad, right?</p>

	<p>Dear god does it suck. I mean, Whales though really thin gauze, it sucks that badly. I got it working on my local network after swearing at it quite loudly. It&#8217;s own personal religion of &#8220;Not Invented Here&#8221; is going to really annoy me, I can tell.</p>

	<p>Lets start with the web server. It doesn&#8217;t run though Apache without a tremendous amount of futzing around. I like Apache, and run everything else off Apache, so the fact that all my Zope applications will run off a non-standard port (There are fixes for this, yes, but they also require a tremendous amount of futzing around). This is annoying.</p>

	<p>Then there is the user system. I have a user account on this machine, you could even talk to it though <span class="caps">LDAP</span>. Requiring your own little world to run in &#8211; let alone where you don&#8217;t tell me the initial username &#38; password, or where the access file is, or anything &#8211; is really annoying. Also, it should be noted that in every <b><span class="caps">SINGLE</span></b> guide I found on how to reset the password manually it missed the fairly basic piece of information that once you have reset the password, you must <em>restart the Zope server</em> otherwise you will spend half an hour working out why it doesn&#8217;t take the data. This, admittedly, is partly a Debian Package problem, but since delving has lead me to believe that it <em>used</em> to ask you for a default username and password on configure, and now doesn&#8217;t, I&#8217;m leaping to the conclusion that whining isn&#8217;t going to fix this any.</p>

	<p>It should be a <em>default</em> requirement that <em>every</em> Debian package contains a file in /usr/share/docs explaining a) Which configure options were used, b) What you&#8217;re going to have to do next to make the package work, and c) Common pitfalls of the above. </p>

	<p>Three, the interface. In the last six months or so, the bar for a web-based interface has gone from a minor hurdle to a max-height pole-vault, mostly due to GMail. However, I can state with no fear of derision that &lt;textarea /&gt; is the <em>single most fucking <b>awful</b> method of inputting code since I used a <span class="caps">C64</span> with a broken delete key</em>, and the fact that the physical location of the source files is shielded from me (and will, I suspect, be chowned something silly anyway) means the best way I can see to develop with this pile of shit is to copy/paste from my <a href="http://www.editplus.com">default text editor</a>, which is just <em>retarded</em> (And yes, that is exactly how I compose blog entries, but I don&#8217;t normally need to keep blog entries in <span class="caps">CVS</span>). I suspect there is a better way to do this. In fact, I&#8217;m sure there must be, or else Zope would be deader than a very dead thing, which brings me to my next point.</p>

	<p><a href="http://zope.org/Documentation/Books/ZopeBook/2_6Edition/">The Docs</a></p>

	<p>My first problem with the docs is the inline commenting system. When I&#8217;m trying to digest a reasonably complex idea it is of no use whatsoever for the flow of the text to be interrupted constantly by inane slashdotesque comment. On the other hand, without the inline commenting I&#8217;d not have known that the <a href="http://zope.org/Members/jwhitener/zopeZoo_2_6">introduction to Zope</a> tutorial &#8211; which is far better than the one included in the distro &#8211; existed, also, I&#8217;d have read the chapter on <span class="caps">DTML </span><em>before</em> the chapter on the more advanced, easier to use, designer friendly and new paradigm of Zope Page Templates, which starts off by pointing out how crap everything you read in the previous chapter was. <b><span class="caps">ARGH</span></b></p>

	<p>Nevertheless, I shall persevere with this Evil, because I&#8217;ve got no choice but to know it, in the hope that I will learn my way around it.</p>

	<p>Okay, so &#8220;find / -iname ZopeZoo&#8221; has failed to find any of the files that are part of the tutorial. Where the hell is Zope putting the bloody files? *<strong><span class="caps">ARGH</span></strong>*</p>]]></content:encoded>
	<dc:date>2004-09-22T17:20:12+00:00</dc:date>
	<dc:subject>Cantrip</dc:subject>
	<dc:subject>programming</dc:subject>
	<dc:subject>Python</dc:subject>
	<slash:comments>4</slash:comments>
	<slash:section>journal</slash:section>
	<trackback:ping>http://www.aquarionics.com/trackback/journal/1514</trackback:ping>
</item>
<item>
	<title>The explaination &amp; Python</title>
	<link>http://www.aquarionics.com/journal/2004/09/10/The_explaination_%5Band%5D_Python</link>
	<comments>http://www.aquarionics.com/journal/2004/09/10/The_explaination_%5Band%5D_Python</comments>
	<description>After a number of similer requests, I&amp;#8217;ve done a Goodbye Browserangel FAQ at holistic.

	I leave BA on Friday 15th October, I enter Those Who Evolve so that&amp;#8217;ll be fun.

	Today I&amp;#8217;ve spent attempting to work out how to do Python Web Apps sensibly without being tied to Zope. I&amp;#8217;m grasping the Python Way, I think, but I still think in PHP and Web Dev terms, so actually learning...</description>
	<guid isPermaLink="true">http://www.aquarionics.com/journal/2004/09/10/The_explaination_%5Band%5D_Python</guid>
	<content:encoded><![CDATA[<p>After a number of similer requests, I&#8217;ve done a <a href="http://hol.istic.net/goodbyeBrowserAngel">Goodbye Browserangel <span class="caps">FAQ</span></a> at holistic.</p>

	<p>I leave <a href="http://www.browserangel.com">BA</a> on Friday 15th October, I enter <a href="http://hol.istic.net/ThoseWhoEvolve">Those Who Evolve</a> so that&#8217;ll be fun.</p>

	<p>Today I&#8217;ve spent attempting to work out how to do Python Web Apps sensibly without being tied to Zope. I&#8217;m grasping the Python Way, I think, but I still <em>think</em> in <span class="caps">PHP</span> and Web Dev terms, so actually learning by creating a site &#8211; rather than the abstract card games I&#8217;ve been doing &#8211; would probably be more useful.</p>

	<p>So far I&#8217;ve been playing with <a href="http://quixote.ca/">Quixote</a> mostly, but since Evolving seem to have centralised on Zope, that would probably be more useful. Thing is, every time I look at it I think something along the lines of &#8220;Crikey, that&#8217;s a bit overkill for this&#8221; and look for something simpler, but the more I go into it, the more Zope looks like The Thing I Should Know, since all the alternatives seem to start with comparing themselves to it. Input from those who know more about this than I do would be handy :-)</p>]]></content:encoded>
	<dc:date>2004-09-10T21:25:46+00:00</dc:date>
	<dc:subject>BrowserAngel</dc:subject>
	<dc:subject>Those who evolve</dc:subject>
	<dc:subject>Python</dc:subject>
	<dc:subject>Work</dc:subject>
	<slash:comments>0</slash:comments>
	<slash:section>journal</slash:section>
	<trackback:ping>http://www.aquarionics.com/trackback/journal/1504</trackback:ping>
</item>
<item>
	<title>Sunday Morning &amp; Python</title>
	<link>http://www.aquarionics.com/journal/2004/08/08/Sunday_Morning_%5Band%5D_Python</link>
	<comments>http://www.aquarionics.com/journal/2004/08/08/Sunday_Morning_%5Band%5D_Python</comments>
	<description>Saturday we had a barbeque. People came around, we played games, we ate home made burgers, nice sausages and barbequed bananas. We dragged people though the streets of Letchworth, forcing them against their will to buy sweets from the World&amp;#8217;s Nicest Sweetshop. Truely, we are bad people.

	Today, being Sunday, I rose late (10 am being late to my commuter-bound sleep patterns), put some...</description>
	<guid isPermaLink="true">http://www.aquarionics.com/journal/2004/08/08/Sunday_Morning_%5Band%5D_Python</guid>
	<content:encoded><![CDATA[<p>Saturday we had a barbeque. People came around, we played games, we ate home made burgers, nice sausages and barbequed bananas. We dragged people though the streets of Letchworth, forcing them against their will to buy sweets from the World&#8217;s Nicest Sweetshop. Truely, we are bad people.</p>

	<p>Today, being Sunday, I rose late (10 am being late to my commuter-bound sleep patterns), put some classical music on the stereo, read comics, drank black coffee with cinnamon bark in it, and genrerally did very little. Later, I watched the <span class="caps">DVD</span> of the <a href="http://www.thedivinecomedy.com">Divine Comedy Concert</a> that <a href="http://www.livejournal.com/~malfranks">Mal</a> sent me, read more comics <a href="http://www.cus.org.uk/~ccooke/">ccooke</a> pimped at me, and drank tea.</p>

	<p>I&#8217;ve hit a stumbling block on my currently swapped in project (Which is still Cantrip. I&#8217;d hoped to release AqWiki before I got distracted by something else, but anyway) in the templating system I&#8217;m using (<a href="http://www.owlfish.com/software/simpleTAL/">SimpleTAL</a>) doesn&#8217;t appear to  be able to return the resulting document as anything other than a file handle, which seems a little strange to me. I&#8217;ve fired off an email to the mailing list to ask, but it may be because I&#8217;m still thinking in <acronym title="PHP Hypertext Preprosessor">PHP</acronym> or something.</p>

	<p>Answers on a postcard please&#8230;</p>]]></content:encoded>
	<dc:date>2004-08-08T11:50:06+00:00</dc:date>
	<dc:subject>Personal</dc:subject>
	<dc:subject>Python</dc:subject>
	<slash:comments>0</slash:comments>
	<slash:section>journal</slash:section>
	<trackback:ping>http://www.aquarionics.com/trackback/journal/1486</trackback:ping>
</item>
<item>
	<title>PFd4-II Design Diary - Part One: Start of a Brand New World</title>
	<link>http://www.aquarionics.com/journal/2004/06/06/PFd4-II_Design_Diary_-_Part_One%3A_Start_of_a_Brand_New_World</link>
	<comments>http://www.aquarionics.com/journal/2004/06/06/PFd4-II_Design_Diary_-_Part_One%3A_Start_of_a_Brand_New_World</comments>
	<description>In the first part of a brand new series, I'm going to document the entire process of getting a web-app working.

I've been promising a new version of PFd4 for a while now. I have also been meaning to learn Python properly, so I've decided to combine these two projects into one handy package.

PFd4 was originally concieved when 2d10 - which my girlfriend and a number of my other friends were...</description>
	<guid isPermaLink="true">http://www.aquarionics.com/journal/2004/06/06/PFd4-II_Design_Diary_-_Part_One%3A_Start_of_a_Brand_New_World</guid>
	<content:encoded><![CDATA[<p>In the first part of a brand new series, I'm going to document the entire process of getting a web-app working.</p>

<p>I've been promising a new version of PFd4 for a while now. I have also been meaning to learn Python properly, so I've decided to combine these two projects into one handy package.</p>

<p>PFd4 was originally concieved when 2d10 - which my girlfriend and a number of my other friends were playing an RPG on - went AWOL for two weeks. At the time I was staying with one of the players and her (now) husband, who hosts both this site and my main site <a href="http://www.aquarionics.com">Aquarionics</a>. So, Girlfriend, Provider of Free Hosting (both real and virtual), and small number of other friends need a web site. At the time I was unemployed, homeless and about to slide into the dark pit of depression, so I took on the project.</p>

<p>I coded the original version of PFd4 in three days flat, including one day designing the data structures, and as such it isn't the greatest piece of coding I've ever done. The interface for the messaging was messy, and it only barely did what they wanted it to do well. Nevertheless it existed until the game ended a couple of months later, and during that time I consistantly promised myself that I would rewrite it. Now I'm unemployed again, although not homeless this time, and I want to learn a new language and skillset, so I'm using this.</p>

<p>The original structure for v1 is <a href="http://www.aquarionics.com/diarystuff/2004/06/design.html">here</a>.</p>

<p>These are the design principles for PFd4-II:</p>

<h2>Technical</h2>

<h3>A new name.</h3>

<p>I've never really liked the name PFd4, partly because my brain wants to parse it as PDF4. It stands for "Point First d4" (A d4 being a four sided dice) which is a play on 2D10 - the system it replaced - and the fact that it's quick, painful, and RPGish. (d4s are pyramid shaped, if you stand on them it hurts).</p>

<h3>python/mod_python</h3>

<p>It'll be written in python, built on mod_python, backending onto a mysql database - as the last one did. This is the tricky bit. I am a PHP programmer by trade - though I did both C++ and Java at University - and am just getting into this python lark. Most of the reason I'm doing this now is to learn python.</p>

<h3>XML/XSLT</h3>

<p>The python will generate XML, which will be fed though an XSLT stylesheet and passed to the user (Actually, I may not even do this to start with and leave the XSLT client-side, it's slightly quicker) </p>

<p>In fact, even quicker would be to generate XHTML by default - rather than an arbitary XML form - and transform from that.</p>

<h3>XHTML/CSS3</h3>

<p>The XSLT stylesheet will generate XHTML/CSS3 code that degrades gracefully to older browsers (If it isn't already, see above). It may also produce PDF versions of logs etc.</p>


		<h3>External Access</h3>

<p>Allow XML-RPC interface, NNTP, SMTP access etc. Possibly</p>


		<h2>Gameplay</h2>

		<h3>Campaigns</h3>
		
<p>Games will belong to campaigns. Any number of active games can be in a campaigns. This may involve subcampaigns, though that might be a little too far.</p>

<p>Characters will belong to Games too, rather than campaign, meaning a character can't be in two games at once. I'm open to negotiation on this bit, because whilst I can see that having three characters for "Bob the Avenger" is duplication of effort, having Bob level up in one game and suddenly be levelled up in the other two is silly. This is also an interface problem, since I don't want duplicate  names, but if they're in the same campaign - though different games - and they are the same person (Say, Bob The Avenger aged 16 and Bob the Avenger aged 25) that should be allowed (Yes, I <i>do</i> like the idea of Bob the Avenger, why do you ask?)</p>

		<h3>Voices</h3>

<p>When a character makes a "play" they can do it as a 'voice'. So a thief pretending to be the lady of the person whose house she's robbing would be "Bobette the Thief <i>as</i> Lady Fitzdamnation", with Fitzdamnation as the 'voice'. This concept was popular with those who understood it, but complicated to explain. It remains (I like the idea, and it's my system, damnit) but may end up being on some kind of "advanced" system. Plus, I want to be able to use it so that GMs can use it without the players being aware of it, so instead of "GM <i>as</i> Lord Fitzdamnation" you just see "Lord Fitzdamnation". In fact, it's possible that all GM plays would be made this way, and make the GM register a character for any persistant avatars same as anyone else.</p>

		<h3>Other Players</h3>

<p>At an option for the GM, no player should be able to see what other PCs are playing, or even whether a given play is made by a PC, NPC or GM. NPC is the tricky one of those, because PCs and GM characters can - and will - have profiles, whereas small NPCs probably won't.</p>

		<h3>Artifacts &amp; Encyclopaedia</h3>

<p>Every campaign will get an Enyclopaedia where they can put articles (Text (&amp; Images?)) relating to the campaign. GMs will also be able to upload "Artifacts", a file - any type - which groups can view. (Needs to be worked on to avoid becoming arbitary gallery space)</p>

		<h3>Groups</h3>

<p>Characters can be lassoed into groups, which can then be given permissions. For example, if the GM wanted the group to find an article in Elvish, s/he'd upload the file as an Artifact with the group of "Characters who understand Elvish" being the only group allowed access. Inside this group s/he'd put all the characters who - duh - understood Elvish, and only they would be able to read it.</p>

<p>'Play's can also be restricted to a group, or some groups, or a list of people (For example, all those didn't fail an observation roll might see that the carpet by the bookshelf is trapped, nobody else would see that message), though the list of people might be better off as a message. A message then just becomes a play that only the other person can see, which neatly stops me having to write another bloody e-mail replacement. </p>

<p>Tasks:</p>

<ul>
	<li> Implement the database</li>
	<li> Login system</li>
	<li> first-cut templating</li>
	<li> User add/admin</li>
	<li> Campaigns</li>
	<li> Message Events</li>
	<li> Games</li>
	<li> Characters</li>
	<li> Plays</li>
	<li> [1]</li>
	<li> Groups</li>
	<li> Plays Mk2 (With groups)</li>
	<li> Character Profiles</li>
	<li> Encylopaedia</li>
	<li> Artifacts</li>
	<li> Design Cut 2</li>
	<li> Bugfixen</li>
	<li> Release.</li>
</ul>
	
<p>[1] is the point where the system is usable for testing.</p>]]></content:encoded>
	<dc:date>2004-06-06T15:12:38+00:00</dc:date>
	<dc:subject>Cantrip</dc:subject>
	<dc:subject>Python</dc:subject>
	<dc:subject>web development</dc:subject>
	<dc:subject>webRPG</dc:subject>
	<slash:comments>1</slash:comments>
	<slash:section>journal</slash:section>
	<trackback:ping>http://www.aquarionics.com/trackback/journal/1433</trackback:ping>
</item>
<item>
	<title>Python annoyance</title>
	<link>http://www.aquarionics.com/journal/2004/05/11/Python_annoyance</link>
	<comments>http://www.aquarionics.com/journal/2004/05/11/Python_annoyance</comments>
	<description>Given the following code:

def index():
        try:
                import MySQLdb
        except:
                return "Couldn't import MySQL module"
        return "Yay Workyness"

	inside a mod_python instance, is there any reason why it should return &amp;#8220;Yay Workyness&amp;#8221; and &amp;#8220;Couldn&amp;#8217;t import MySQL module&amp;#8221; in roughly equal amounts? (MySQLdb in this case is a sub...</description>
	<guid isPermaLink="true">http://www.aquarionics.com/journal/2004/05/11/Python_annoyance</guid>
	<content:encoded><![CDATA[<p>Given the following code:</p>

<pre><code>def index():
        try:
                import MySQLdb
        except:
                return "Couldn't import MySQL module"
        return "Yay Workyness"</code></pre>

	<p>inside a mod_python instance, is there <b>any</b> reason why it should return &#8220;Yay Workyness&#8221; and &#8220;Couldn&#8217;t import MySQL module&#8221; in roughly equal amounts? (<a href="http://sourceforge.net/projects/mysql-python">MySQLdb</a> in this case is a sub directory of the current working directory). Bugs I can cope with, but this inconsistancy is driving me insane&#8230;</p>]]></content:encoded>
	<dc:date>2004-05-11T15:25:01+00:00</dc:date>
	<dc:subject>Python</dc:subject>
	<slash:comments>3</slash:comments>
	<slash:section>journal</slash:section>
	<trackback:ping>http://www.aquarionics.com/trackback/journal/1400</trackback:ping>
</item>
<item>
	<title>Accomplish</title>
	<link>http://www.aquarionics.com/journal/2004/05/10/Accomplish</link>
	<comments>http://www.aquarionics.com/journal/2004/05/10/Accomplish</comments>
	<description>Todays accomplishment:

	XML + XSLT + Python = HTML

	(I should point out that the above has required my relearning Python from scratch &amp;#8211; previous efforts have been basically PHP in Python &amp;#8211; learning XSLT, and learning how mod_python works. Lots of work for so little gain)</description>
	<guid isPermaLink="true">http://www.aquarionics.com/journal/2004/05/10/Accomplish</guid>
	<content:encoded><![CDATA[<p>Todays accomplishment:</p>

	<p><a href="http://character.istic.net/hello.xml"><span class="caps">XML</span></a> + <a href="http://character.istic.net/hello.xslt"><span class="caps">XSLT</span></a> + <a href="http://character.istic.net/hello.txt">Python</a> = <a href="http://character.istic.net/hello.py/hello?xmlfile=hello.xml&#38;sheet=hello.xslt"><span class="caps">HTML</span></a></p>

	<p>(I should point out that the above has required my relearning Python from scratch &#8211; previous efforts have been basically <span class="caps">PHP</span> in Python &#8211; learning <span class="caps">XSLT</span>, and learning how mod_python works. Lots of work for so little gain)</p>]]></content:encoded>
	<dc:date>2004-05-10T19:06:08+00:00</dc:date>
	<dc:subject>Python</dc:subject>
	<dc:subject>XML</dc:subject>
	<slash:comments>0</slash:comments>
	<slash:section>journal</slash:section>
	<trackback:ping>http://www.aquarionics.com/trackback/journal/1398</trackback:ping>
</item>
<item>
	<title>Write first time</title>
	<link>http://www.aquarionics.com/journal/2004/04/15/Write_first_time</link>
	<comments>http://www.aquarionics.com/journal/2004/04/15/Write_first_time</comments>
	<description>Workrave is telling me I should stop for the day. I trust it. This should not take long.

	RSI back. Sentances shorter. Feel like am in a bad Bridget Jones parody.

	Possibly Shatner impersonation.

	Learning Python. Have taught python to play Foursquare solitare.

	Badly.

	Am positive that are better ways of doing things I&amp;#8217;m doing. Doing it anyway. Learning Process Considered...</description>
	<guid isPermaLink="true">http://www.aquarionics.com/journal/2004/04/15/Write_first_time</guid>
	<content:encoded><![CDATA[<p>Workrave is telling me I should stop for the day. I trust it. This should not take long.</p>

	<p><span class="caps">RSI</span> back. Sentances shorter. Feel like am in a bad Bridget Jones parody.</p>

	<p>Possibly Shatner impersonation.</p>

	<p>Learning Python. Have taught python to play Foursquare solitare.</p>

	<p>Badly.</p>

	<p>Am positive that are better ways of doing things I&#8217;m doing. Doing it anyway. Learning Process Considered Nonhalmful.</p>

	<p>Recent Things Seen:</p>

	<p>(Blinks not working. No idea why. Suspect aliens. Possibly Allens.)</p>

	<p>Aquarionics now has <a href="http://www.amazon.com/exec/obidos/ASIN/B0000C0G2L">its own Amazon <span class="caps">ASIN</span> code</a>. Counting days until am in bargain basement.</p>

	<p><a href="http://www.invention.com/kuhuski.htm">Fanpants</a>. I&#8217;ve no idea what I can say about this.</p>

	<p><a href="http://slashdot.org/article.pl?sid=04/04/15/1323240">Real ask Apple to open up <span class="caps">AAC DRM</span></a> because Real are famous for opening up formats and everything.</p>

	<p><a href="http://pc.ign.com/articles/506/506536p1.html?fromint=1">Freedom Force 2 Diary</a> for great justice.</p>

	<p>Am getting tired of sentances fragmented are they. Am going to cast Summon Gramatical Ability, to see what happens.<br>
&#8212;<br>
Ahh, better this is. Irritating that structure was getting.<br>
&#8212;<br>
Try that again. Right. It&#8217;s been an dull week on Planet Aquarion. I&#8217;m attempting to make the most of my employment limbo by learning how Python actually works. Despite having written Aquaintances in it, I&#8217;ve little to no idea how the language actually works (Aquaintances is very much cargo cult programming, and anyway, I&#8217;m no longer using it, I&#8217;ve switched to Bloglines instead along with the rest of the known world). This has involved working though <a href="http://www.diveintopython.org/">Dive into Python</a> and applying the new knowledge gained to solving the problem, which is making FourSquare work.</p>

	<h2>FourSquare Patience</h2>

	<ol>
	<li>Shuffle normal 1c52 deck.</li>
		<li>Deal four cards into seperate &#8220;play&#8221; piles</li>
		<li>Remove any Kings from the top of any &#8220;play&#8221; pile.</li>
		<li>If any cards on the top of any of the play piles add up to 13 (A=1, J=11, Q=12) remove those two cards to the Win pile.</li>
		<li>If any play piles are empty, deal one card to each empty space and go to step 3.</li>
		<li>Otherwise, go to step 2.</li>
		<li>Once you run out of cards to be dealt. Add play piles together, do <b>not</b> shuffle and go to step two.</li>
		<li>When all cards are in the win deck, you&#8217;ve won.</li>
	</ol>

	<p>(1c52 == 1 standard deck of 52 cards, meaning no jokers. Contrast with 2c52, 1c104 (Include latin suites), 1c54 etc) </p>

	<p>For a patience game, it&#8217;s very simple, can be completely automated, but can be made more or less complicated more or less arbitarily. For example, you may want to consider which cards are underneath at step 4, to see if removing <b>this</b> pair rather than <em>that</em> pair will gain you access to <em>that</em> queen which matches <em>that</em> ace.</p>

	<p>In short, it&#8217;s a nice progamming exercise for learning a language, but the real test is to see how much of the code you can reuse for writing BlackJack further down the line.</p>

	<p>And no, I&#8217;m not publishing the code for at least another four lessons or so :-D</p>

	<p>Also, I&#8217;m still playing x<sup>2</sup>, Tropico 2, and &#8211; thanks it getting posted back to me &#8211; Battlefield 1942 (Actually, mostly <a href="http://www.innerempire.com/bfpirates/">Battlefield Pirates</a>) and waiting for my life to get interesting again.</p>]]></content:encoded>
	<dc:date>2004-04-15T19:01:03+00:00</dc:date>
	<dc:subject>Gaming</dc:subject>
	<dc:subject>MLP</dc:subject>
	<dc:subject>Python</dc:subject>
	<dc:subject>Computer Games</dc:subject>
	<slash:comments>0</slash:comments>
	<slash:section>journal</slash:section>
	<trackback:ping>http://www.aquarionics.com/trackback/journal/1371</trackback:ping>
</item>
<item>
	<title>Python Question</title>
	<link>http://www.aquarionics.com/journal/2003/05/08/Python_Question</link>
	<comments>http://www.aquarionics.com/journal/2003/05/08/Python_Question</comments>
	<description>I need to save a list into a tab-deliminated text-file. (Mark&amp;#8217;s RSSParser sends me the last-modified of the feed as a list which I need to save to the config file so I can recall it when I next run and feed it to the site to make sure I&amp;#8217;m not grabbing a duplicate).

	The logical way to do this is to serialize the list and save it. For this, I find Pickle which does exactly that. The...</description>
	<guid isPermaLink="true">http://www.aquarionics.com/journal/2003/05/08/Python_Question</guid>
	<content:encoded><![CDATA[<p>I need to save a list into a tab-deliminated text-file. (Mark&#8217;s <span class="caps">RSS</span>Parser sends me the last-modified of the feed as a list which I need to save to the config file so I can recall it when I next run and feed it to the site to make sure I&#8217;m not grabbing a duplicate).</p>

	<p>The logical way to do this is to serialize the list and save it. For this, I find <a href="www.python.org/doc/current/lib/module-pickle.html">Pickle</a> which does exactly that. The problem is that the format it saves out to contains line breaks, unideal in a tab-deliminated file.</p>

	<p>The question is how do I save (or indeed print anywhere) a string as a raw string? The <a href="http://www.python.org/doc/current/tut/">tutorial</a> says that to output a raw string I prefix it with r, which causes logical problems when I&#8217;m trying to output from a variable.</p>

	<p>Extra bonus points if you can tell me where I should have found this information.</p>]]></content:encoded>
	<dc:date>2003-05-08T17:49:19+00:00</dc:date>
	<dc:subject>Aquaintances</dc:subject>
	<dc:subject>Python</dc:subject>
	<slash:comments>1</slash:comments>
	<slash:section>journal</slash:section>
	<trackback:ping>http://www.aquarionics.com/trackback/journal/1096</trackback:ping>
</item>
</channel>
</rss>