Paul Findlay
25 July 2007
JSON: State Machine
Well I had fun making this (4 deterministic finite state machines that are joined together as a pushdown automaton to parse JSON). It has something like 75 73 74 states. I’m sure I could cut that number down if I made it less deterministic, but I can’t be bothered.
Just got to find some use for it..
If you can’t understand what I am on about, I’m sorry for you
Paul at 10:20 pm
20 July 2007
XML: Impossible to be original
I write a comment, then follow a couple of links to find that what I have imagined in my comment is already in production (and probably better): Simple XML Compiler.
I will have to one up it somehow.. the dream inside my head for several months has been a trie like system where you add a whole bunch of XPath’s to it (preferably doable on the fly) and by dint of acting like a trie, the common beginnings of the XPaths are bundled up so as to save space/states and to result in longest-prefix matching.. anyways the combination of these XPath expressions get applied like a giant state-machine/trie to the incoming XML events in something approximating log(n) time, so large numbers of XML streams can be handled efficiently.. probably sounds like Drools (trigger rules which are based on XPath expressions) even though I had never heard of it.
How am I supposed to get an interesting job unless I study, but how am I supposed to study when I keep trying to flesh out my interesting ideas.. but then how can I consider my ideas interesting when they are already taken
Paul at 9:11 am
26 June 2006
XML: People
Continuing with the theme…
There is the bitterly smart Fredrik Lundh and his excellent ElementTree (which will be in Python 2.5) “it makes XML documents look like a bunch of nested lists”. I find the iterparse function interesting. (Of course someone as made a similar python interface but with all libxml2’s functionality and compliance).
Another figure is the fatherly Uche Ogbuji who is heavily involved with the 4suite⢠“platform for XML and RDF processing” which is built on by the Amara XML toolkit. Very pythonic yet very concerned about the XML-Specs it would seem.
I should mention the bearded Tim Bray. He gives me hope, but not only that – he contributed to the XML standard (and the excellent Atom standard) and has ‘recently’ written a nice C library for generating XML called Genx. It seems Genx is pretty much feature complete, which is cool (because that means handling UTF-8 and namespaces ‘well’).
Paul at 2:26 pm
Comments Off
23 June 2006
XML: Digestion
Well, so I said:
– it seems the Jakarta Commons project has a Digester Component which does this programmatically. One of the Scribus developers made something similar for C++a custom XML parser (that maps onto application specific data structures) would be cool.
Paul at 2:00 am
Comments Off
17 June 2006
XML: See also
David Mertz’s XML Programming Paradigms
Also by the same author, The Xom Java Xml Api (which he calls a “A rigorously correct tree-oriented XML model”).
TagSoup, a SAX-compliant parser, for all that ‘wild’ HTML written in Java. Similarly BeautifulSoup written in Python.
From CUJ: Generating a custom XML parser (that maps onto application specific data structures) would be cool.
Paul at 4:22 pm
Comments Off
15 June 2006
XML Apis
(For future reference)
StAX
- JSR 173: Streaming API for XML
- XML.com article on StAX
- (Another) Blog post by Elliotte Rusty Harold
- StAX and XML related blog
- Woodstox is a StAX-compliant (JSR-173) Java implentation
- Don’t forget the convenience layer for the above
(Ok, so StAX is the reverse of SAX which makes it more like the normal parser/tokeniser behaviour, but SQLite goes the other way (like SAX) because the author is convinced it is better, and I’ve yet to experience any of these situations.)
A Conversation with Elliotte Rusty Harold
(About the experiences that led to nu.xom)
- What’s Wrong with XML APIs
- The Good, the Bad, and the DOM
- A Design Review of JDOM (He worked on JDOM)
- Lessons Learned from JDOM
- Design Principles and XOM (Also see the XOM Design Principles)
- Air Bags and Other Design Principles
- Designing by Dictatorship, Examples, and Tests
- The Human Side of XML
- Organic Schemas and Outlier Data
Rogers Cadenhead on XOM in Linux Magazine.
XML Pull parsing
XMLPULL
- The XMLPULL API
- Processing XML with the XML Pull Parser
- Building an in-memory tree with the Xml Pull Parser
(Even though “The API does not model XML correctly” – it preceded StAX.)
Paul at 7:48 pm
8 June 2006
Hilarious
// Preconditions: variable i in memory
// Post conditions: variable i incremented by one
// Method:
//1: fetch i from memory into register
//2: increase register value by 1
//3: write value of register into memory
i++;
Updated: This is interesting for two other reason, now I have the prefix operator (++i;) fixed in my head, and there is actually a need for such documentation: Interlocked.Increment Method (.NET’s System.Threading namespace).
Paul at 3:09 am
20 April 2006
Transferred
I moved off textpattern.
I had to redirect my atom and rss feeds. Here is the code I used for apache’s .htaccess:
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /paul/
RewriteCond %{QUERY_STRING} ^rss=1$
RewriteRule ^$ http://findlay.net.nz/paul/feed/ [R=301,L]
RewriteCond %{QUERY_STRING} ^atom=1$
RewriteRule ^$ http://findlay.net.nz/paul/feed/atom/ [R=301,L]
</IfModule>
Thanks to the helpful Rewriting URLs With Query Strings
Paul at 6:50 pm
Comments Off
14 March 2006
Using TortoiseCVS for COMP314
First step is to download TortoiseCVS from their download page. The version I downloaded is 1.8.25.
After installing TortoiseCVS (and probably restarting windows), you can right-click in any folder and do a CVS Checkout:

Once you come to the CVS Checkout dialog, there are three things to be done:
- Copy and paste the following into box 1:
:ext:login_d@cvs.scms.waikato.ac.nz:/usr/local/global-cvs/comp314a/ - Change login_id to your own University login in box 2.
- And make sure our group module, noname is entered into box 3.

The University server will need you to enter your password. Perhaps, it will just be the last 8 digits on your ID Card. Enter it in, in case you were wondering. (You’ll have to do this everytime it seems).

All the folders and files that are stored in the version control system (CVS), will be downloaded from the CVS server for the first time. This means they are listed as updated (the files are green and listed with a U).

You can the view checked out folder in Explorer:

Paul at 5:28 am
Comments Off
4 October 2005
COMP134 Project
Well, this is my big workload at the moment. I’m right in the middle of a six week assignment. The task at hand is to build a collaging application, and make it interesting.
So far it grabs photos from your hard drive or photo sharing website Flickr, downloads them if necessary and displays them randomly on a black square.
I can’t think how it can be interesting.
Makes me despair of becoming a fulltime programmer.
Not moaning, but we don’t even have a name.
Help
Paul at 9:27 am
Comments Off