KBD

Keith Devens .com

Friday, March 19, 2010 Flag waving
Got truth decay? Brush up on your Bible! – a billboard in New Brunswick, NJ

Archive: August 05, 2003

← August 04, 2003August 06, 2003 →

Daily link icon Tuesday, August 5, 2003

Yet another XML API (for Python)

Uche Ogbuji: Anobind - A Python/XML data binding, serving as a very Pythonic XML API

Example: given this:

<monty>
 <python spam="eggs">What do you mean "bleh"</python>
 <python ministry="abuse">But I was looking for argument</python>
</monty>

You write things like this:

binding.monty.python.spam

There are other such tools for Python, and what makes Anobind unique is that it's driven by a very declarative rules-based system for binding XML to the Python data. One can register rules that are triggered by XPath-like expressions or plain Python code in order to register specialized binding behavior.

Ok, I'll have to check that out Smiley

See, a language that allows you to overload its syntax (unlike Java) can allow much more natural programming that has a much lower "cognitive load".

Declarative Programming

ONLamp.com: Advanced OOP: Declarative Programming and Mini-Languages, by David Mertz.

What we are interested in for this installment is ways of writing programs that are declarative rather than imperative. In many cases, simply notating facts is more concise and less error prone than providing instructions. A number of less common programming languages make declarative styles predominant, but it is also possible to use a declarative style within generally imperative languages. In this article, as with the others in this series, I will focus on techniques as exemplified in Python.

Neat stuff in Ruby 1.8.0

Why (real name?) has a list of What's Shiny and New in Ruby 1.8.0, and there's some neat stuff in there. Particularly interesting is the native Ruby XML parser, REXML (also see a tutorial and an introduction to REXML at IBM developerWorks by David Mertz).

Also, YAML is included as standard with Ruby 1.8.0 (way to go guys), and what's especially neat is that it seems like it's been integrated into the Ruby debugger (scroll down to the bottom of Why's page for an example). Check out YAML for Ruby's API documentation too.

Finally, for a neat name for message-style OO polymorphism I've never heard before, check out Duck Typing.

Future-proof Movable Type URLs

Via James, a tutorial on how to Future-proof URLs in Movable Type. This is a great idea. I never realized this could be done with MovableType, and I also never considered using a timestamp as a permalink. That might be a good thing to do in general if you don't want to use IDs and you don't reasonably expect two posts to be made at the same exact second.

XPath queries in PostgreSQL XML text blobs

Even though I mostly hate XML, and don't use PostgreSQL, this is just damn cool:

Bill Humphries: PostgreSQL and XML:

I missed these extensions to PostgreSQL that allow you to store an XML document as a text blob, and use XPath expressions in the WHERE clauses of SQL statements.

Check out that link for lots of examples.

Unison File Synchronizer

Via Leslie, check out the Unison File Synchronizer:

Unison is a file-synchronization tool for Unix and Windows. (It also works on OSX to some extent, but it does not yet deal with 'resource forks' correctly; more information on OSX usage can be found on the unison-users mailing list archives.) It allows two replicas of a collection of files and directories to be stored on different hosts (or different disks on the same host), modified separately, and then brought up to date by propagating the changes in each replica to the other.

Unison shares a number of features with tools such as configuration management packages (CVS, PRCS, etc.), distributed filesystems (Coda, etc.), uni-directional mirroring utilities (rsync, etc.), and other synchronizers (Intellisync, Reconcile, etc). However, there are several points where it differs:

Unison works between any pair of machines connected to the internet, communicating over either a direct socket link or tunneling over an rsh or an encrypted ssh connection. It is careful with network bandwidth, and runs well over slow links such as PPP connections. Transfers of small updates to large files are optimized using a compression protocol similar to rsync.

Unison is free; full source code is available under the GNU Public License.

I hate not blogging this type of stuff, because inevitably a week later I wind up wanting it and not being able to remember where I saw it. Plus, even now I think I'll have a use for this. It seems like I can use this as a distributed revision control system (only without revision history) without needing CVS. It seems perfect for something I'm going to need to do very soon.

← August 04, 2003August 06, 2003 →
March 2010
SunMonTueWedThuFriSat
 123456
78910111213
14151617181920
21222324252627
28293031 



RSS feed RSS feed for Keith's Weblog
Atom feed Atom feed for Keith's Weblog
Weblog archive
Recent comments
  on 2 posts

Recent comments XML

I hate ASP.NET

I hate ASP... I was doing wonders​with PHP, then suddenly one of my​clients...

Johnies: Mar 17, 6:14am

Quantum physics and free will

I knew you were going to say that....

Tom Massey: Mar 15, 9:26pm

Generated in about 0.061s.

(Used 7 db queries)