Leex And Yecc
leex and yecc are the Lex and Yacc of the Erlang toolset. Whilst there is ample documentation about using the standard Unix lexer and parser generators, the Erlang equivalents are far less documented. This article demonstrates how to use leex and yecc to build a parser in Erlang that can process a subset of SQL-92.
TLS Support In The AS3 AMQP Client
Experimental TLS/SSL support was introduced to the AS3 library for AMQP in version 0.1.2. This provides TLS-based tunneling to an AMQP broker that provides this functionality. This article describes how to set up transport layer encryption for the interaction between an AS3 client and the RabbitMQ broker.
Pet Store Part 1
Pet Store is a sample application that demonstrates how an AS3 client can communicate with a remote application written in Erlang. It exemplifies the usage of AMQP as remoting technology and Cotton as an object serialization protocol. The Cotton Over AMQP library is a high level wrapper around the low level AMQP and Cotton libraries. This provides a Flex client with a very simple programming interface. The interaction with the server is an asynchronous RPC mechanism using the RabbitMQ broker.
Proposed Serialization Protocol in AS3
Release 0.3.2 of Cotton introduces an AS3 client library which implements a proposed type negotiation extension to the Hessian binary serialization protocol. This article demonstrates the protocol extension using the AS3 library as a client that speaks to a remote server implemented in Erlang. The first section discusses the design principles and protocol flow, so if you are more interested in the working example, you can skip to that section.
Converting Monotone To Mercurial
Today I had to convert a Monotone repository to Mercurial. Tailor is a tool that can convert changesets from one SCM into the format of another SCM. It currently supports many major SCM systems, including Monotone and Mercurial.
Tailor is written in Python and you can check out the latest version from their source repository:
$ darcs get --partial http://darcs.arstecnica.it/tailor
To do this, you will need to have darcs installed. Once you've got this, install tailor by running:
$ [sudo] python setup.py install
To be able to perform any conversions, you will need to have both the source and target systems installed in your environment. For this scenario, I needed to have both Monotone and Mecurial installed locally.
Using Tailor involves a two step process:
- Use Tailor to create a configuration file that describes the source and target repositories;
- Supply this configuration file to Tailor and tell it to run the conversion.
There is a good manual page that describes all of the options you can supply, but I just want to demonstrate how to convert all revisions of a particular branch in a Monotone repository to a Mercurial repository.
To do this, I ran Tailor with the following options, redirecting the output into a configuration file, which will be used in step two:
$ tailor -s monotone -t hg -R mtn.db \
-module com.acme.your_branchname \
target_dir --verbose > config.tailor
This indicates the location of the Monotone database and the particular branch to be converted. To perform the conversion, run the following:
$ tailor --configfile config.tailor
On the first attempt, the conversion was successful, apart from the way the commit comments had been migrated. Instead of copying the committer's actual comments, Tailor had produced comments that look this:
[project @ 4ff5bc70bed0ed59cbbc736d486044cb31047f6c]
To remedy this, there is an attribute called patch-name-format that you can set in the configuration file to tell Tailor to keep the original comments. You can see this option in the final version of my configuration file:
[DEFAULT]
verbose = True
[project]
target = hg:target
start-revision = INITIAL
root-directory = /tmp
state-file = tailor.state
source = monotone:source
subdir = target_dir
patch-name-format = ""
[hg:target]
[monotone:source]
module = com.acme.your_branchname
repository = /tmp/mtn.db
After adjusting this, I reran the conversion and everything was fine.
If you want to, you can skip step 1 and just use this configuration file, adjusting the paths and branch names where necessary.
