<?xml version="1.0" encoding="iso-8859-1"?>
<!-- generator="Movable Type/2.661" -->
<rss version="0.91">
  <channel>
    <title>Live from Tokyo: Tech Blog</title>
    <link>http://www.stuartwoodward.com/tech/</link>
    <description>Notes of a Software Developer in Tokyo, Japan who still has a soft spot for  C#, Java and Python</description>
    <language>en-us</language>
    <webMaster></webMaster>
    <lastBuildDate>2004-07-04T15:18:03+09:00</lastBuildDate>
    <pubDate>2006-07-10T09:27:05+09:00</pubDate>

    <item>
      <title>ZSI</title>
      <description>I was playing with ZSI today and installed the example script in my Apache cgi-bin folder to try to create a simple SOAP service on top of CGI#!&quot;C:\Documents and Settings\Stuart\My Documents\Python\Python23\python.exe&quot; def hello(): return &quot;Hello, world&quot; def echo(*args): return args def average(*args): sum = 0 for i in args: sum += i return sum / len(args) from ZSI import dispatch dispatch.AsCGI()On the client side I made a script to call this service:import sys from ZSI.client import Binding IN, OUT = sys.stdin, sys.stdout b = Binding( port=&quot;8765&quot;, url=&quot;/cgi-bin/soaptest.py&quot;, tracefile=OUT) print b.echo( ) print b.echo( &quot;1&quot;, &quot;2&quot; ) print b.hello() a =...</description>
      <link>http://www.stuartwoodward.com/tech/archives/000401.html</link>
    </item>

    <item>
      <title>Cog: Simple Python Object Database</title>
      <description>&quot;Cog is the Checkpointed Object Graph object database, providing semi-transparent persistence for large sets of interrelated Python objects. It handles automatic loading of objects on reference, and saving of modified objects back to disk. Reference counting is used to automatically remove no longer referenced objects from storage, and objects will be automatically be attached to the database if a persistent object references them.&quot; Looks like an interesting base for projects...if only I will be able to think of it when the need arises....</description>
      <link>http://www.stuartwoodward.com/tech/archives/000387.html</link>
    </item>

    <item>
      <title>Switch Statements in Python</title>
      <description>Simon Willison posts an interesting example of how to code the equivalent of switch statement in Python. The example is really neat and syntactly cleaner than the example of a more usual switch statement, however anyone coming across that code for first time would most likely be mystifed by it. Not mystified in the same way as having to decode read-only Perl which uses all the tricks in one line, but mystified in that it is so simple but uses constructs like lambda statements that you don&apos;t really need to know to understand most of the Python code you will...</description>
      <link>http://www.stuartwoodward.com/tech/archives/000383.html</link>
    </item>

    <item>
      <title>Charm</title>
      <description>After getting PyBloxsom working on my local machine (XP with Apache) I went off in search of a way to download all my old LiveJournal entries locally. My long term plan is to migrate everything on my site to PyBloxsom and retire both LiveJournal and MT. By chance,I found an interesting tool: Charm: A command line livejournal client written in Python which should allow me to archive old entries into a text files. I have one minor problem with it right now. It expects &quot;vi&quot; to be in the path. Not a big deal for me as I have Vim...</description>
      <link>http://www.stuartwoodward.com/tech/archives/000381.html</link>
    </item>

    <item>
      <title>Threading</title>
      <description>While poking around various Python projects related to webcams I found an email threading module written in Python which implements JWZs threading algorithm....</description>
      <link>http://www.stuartwoodward.com/tech/archives/000380.html</link>
    </item>

    <item>
      <title>Python Webcam</title>
      <description>After looking at a lot of webcam software, most of which basically seems to be a shell around a Windows DLL which does the hard work, I have decided to take a look at Video Capture &quot;A Win32 Python Extension for Accessing Video Devices (e.g. a USB WebCam, a TV-Card, ...)&quot;. The example code looks really easy:from VideoCapture import Device cam = Device() cam.saveSnapshot(&apos;image.jpg&apos;)...</description>
      <link>http://www.stuartwoodward.com/tech/archives/000379.html</link>
    </item>

    <item>
      <title>Skinning Cats</title>
      <description>I was just trying to get some Python to work and decided to wrap it in a shell script in Cygwin on Windows XP so that I wouldn&apos;t have to convert a batch file to a shell script later on when I copied it to a Unix server. Of course, when I ran the script, Bash complained that the interprerter mentioned in the #! line wasn&apos;t there. In a fit of non Unix compatibility I just replaced /usr/bin with the correct path of my Python exe on Windows. I should have tested this before updating all my files as Bash...</description>
      <link>http://www.stuartwoodward.com/tech/archives/000374.html</link>
    </item>

    <item>
      <title>Cleaning up your mailbox</title>
      <description>This is a really neat tool that one day you may find useful. poptool.py is a python script that allows you to clean up your POP mailbox. Usage is like this: poptool.py -n -uUserName -Ppassword hostname --kill &quot;subject.startswith(&apos;Obvious spam signature&apos;)&quot; The text after the --kill is Python code that is excuted to produce a boolean value whether or not to kill the mail in question. Note that you have full access to all the headers and can make the expression as complicated as you like. n.b. -n means dry run......</description>
      <link>http://www.stuartwoodward.com/tech/archives/000253.html</link>
    </item>

    <item>
      <title>Ludicrously simple templates with Python</title>
      <description>There should be a law stopping functionality as powerful as this being so easy to use: Ludicrously simple templates with Python...</description>
      <link>http://www.stuartwoodward.com/tech/archives/000249.html</link>
    </item>

    <item>
      <title>Python Command Line parsing</title>
      <description>Over on Guido&apos;s blog there was a post about command line parsing. Everyone needs it once in a while and it&apos;s useful for most programs. I was shocked and amazed to see so many people repeating the option names in the getopt setup code and then in the logic to decode the arguements. Someone mentioned Optik in the ensuing discussion and I think that this definately looks the way to go....</description>
      <link>http://www.stuartwoodward.com/tech/archives/000243.html</link>
    </item>

    <item>
      <title>Gallery</title>
      <description>I must get around to taking a look at this Picture Gallery Python script. It even supports EXIF so I wonder what it will make of the GPS information embedded in some of my pictures....</description>
      <link>http://www.stuartwoodward.com/tech/archives/000242.html</link>
    </item>

    <item>
      <title>Repetive HTML</title>
      <description><![CDATA[I had to write some HTML that required an alphabetical list of tags, one for each of the letters of the alphabet and cooked up some Python to do it: for c in range(ord('A'),ord('Z')+1): text = text + '&lt;a href=&quot;vgLink.SearchProducts?next=Next&amp;previous=Previous \ &amp;results_per_page=10&amp;vgvar_1_name=productname \ &amp;vgvar_1_operator=VALUE_STARTS_WITH \ &amp;vgvar_1_value=%c&quot;&gt;%c&lt;/a&gt;' %(c,c) print text...]]></description>
      <link>http://www.stuartwoodward.com/tech/archives/000238.html</link>
    </item>

    <item>
      <title>Accessing the WIndows clipboard with Python</title>
      <description>I was lookin for a way to access the WIndows clipboard with Python and found this Windows Clipboard Class on Python Bits and Piece Then I found this wild piece of code. A windows clipboard daemon you can run on a machine a post this to the windowd clipboard via telnet (why??). It useful as an example of how to use the win32clipboard...</description>
      <link>http://www.stuartwoodward.com/tech/archives/000237.html</link>
    </item>

    <item>
      <title>Procmail Replacement in Python</title>
      <description>A quick search on Google came up with something that I knew someone must have written: pycmail, A Procmail Replacement in Python. Everytime I tinker with my procmail scripts I have the feel that I might touch a live wire and get electrocuted. The syntax is so terse and easy to forget that you are bound to make a mistake. Turning on the full logging has helped though. A least you can see it&apos;s lizard brain chundering through the script after the fact. I wonder if pycmail will be any better......</description>
      <link>http://www.stuartwoodward.com/tech/archives/000236.html</link>
    </item>

  </channel>
</rss>