Vampire Sestina

The first time I read this poem was in my teens, came across it again today as I was sorting through some of the books I left at my parents place. The poem was even the inspiration for a graphic arts project I did at college …

           Vampire Sestina 

I wait here at the boundaries of dream,
all shadow-wrapped. The dark air tastes of night,
so cold and crisp, and I wait for my love.
The moon has bleached the color from her stone.
She'll come, and then we'll stalk this pretty world
alive to darkness and the tang of blood.

It is a lonely game, the quest for blood,
but still, a body's got the right to dream
and I'd not give it up for all the world.
The moon has leeched the darkness from the night.
I stand in shadows, staring at her stone:
Undead, my lover . . . O, undead my love?

I dreamt you while I slept today and love
meant more to me than life -- meant more than blood.
The sunlight sought me, deep beneath my stone,
more dead than any corpse but still a-dream
until I woke as vapor into night
and sunset forced me out into the world.

For many centuries I've walked the world
dispensing something that resembled love --
a stolen kiss, then back into the night
contented by the life and by the blood.
And come the morning I was just a dream,
cold body chilling underneath a stone.

I said I would not hurt you. Am I stone
to leave you prey to time and to the world?
I offered you a truth beyond your dreams
while all you had to offer was your love.
I told you not to worry and that blood
tastes sweeter on the wing and late at night.

Sometimes my lovers rise to walk the night . . .
Sometimes they lie, cold corpse beneath a stone,
and never know the joys of bed and blood,
of walking through the shadows of the world;
instead they rot to maggots. O my love
they whispered you had risen, in my dream.

I've waited by your stone for half the night
but you won't leave your dream to hunt for blood.
Good night, my love. I offered you the world.

                         by Neil Gaiman


Amazon attempting to patent S3

The US Patent and Trademark Office has disclosed Amazon’s latest patent application for a “Distributed storage system with web services client interface” here’s an extract from the abstract:

A distributed, web-services based storage system. A system may include a web services interface configured to receive, according to a web services protocol, a given client request for access to a given data object, the request including a key value corresponding to the object. The system may also include storage nodes configured to store replicas of the objects, where each replica is accessible via a respective unique locator value, and a keymap instance configured to store a respective keymap entry for each object. For the given object, the respective keymap entry includes the key value and each locator value corresponding to replicas of the object. A coordinator may receive the given client request from the web services interface, responsively access the keymap instance to identify locator values corresponding to the key value and, for a particular locator value, retrieve a corresponding replica from a corresponding storage node.

I’m guessing that in light of a recent supreme court ruling this application would not be granted under the strengthened obviousness test as such a patent for a distributed storage system with a web services client interface is about as obvious as you can get. It wasn’t too long ago Amazon failed in their attempt to patent one-click technology which again should have been rejected on the basis of the obviousness test but wasn’t largely because Amazon has a history of bullying the Patent Office … Tim O’Reilly summed up why in this excellent little article.

The more we move towards a Web 2.0 world with applications delivered as SaaS by its very definition were dealing with applications that require distributed storage which is accessible through web services. I’m not knocking S3, its excellent service and Amazon deserve our plaudits for creating such a successful service. S3 isn’t a unique invention it’s simply the putting together of a bunch of technologies already available, and Amazon aren’t unique there are other platform’s available similar to Amazon’s S3 .. Tim might have written the following in reference to the One-Click patent but I believe its equally applicable to this one…

Patents like this are also incredibly short-sighted! The web has exploded because it was an open platform that sparked countless innovations by users. Fence in that platform, and who knows what opportunities will never come to light?

I’m not sure whether Amazon would ever try to enforce this patent and I’m no expert on patent law, it just strikes me as a worrying development.

Are we still evolving … biologically?

Had a rather impassioned debate with Amanda this evening on the subject of whether we, humans as a species, are still evolving biologically. Or even whether or not we need to. I was arguing that the human race might very well be stagnating or reaching ( or have even reached ) an evolutionary impasse due to the fact that we aren’t being forced to adapt to our environment anymore. Humans are unique as a species in that we are able to change the environment around us (even destroy it) … critically though we are no longer forced, at a biological level, to adapt to it. I was also suggesting that we are evolving culturally and technologically and that we can see that certain pockets of humanity suffer more than others because of the rate at which they can absorb or adapt to cultural and especially technological advances. 

Amanda was making the point that the advent of agriculture, arguably our first and most important technological advancement, might very well have been the point at which we no longer needed to adapt to survive in our environment. I’m no anthropologist but it certainly sounds reasonable. I said I was going to read a bit around the topic and try and rationalise my thoughts into a blog posting … as part of that I came cross this short piece by Marc West. I’m probably biased because, as Amanda will no doubt suggest, Marc makes almost exactly the same points I was except he does it much better than I did – even the notion that our biological evolution may very well be defined by some convergence between our biological bodies and technological enhancements – or as I put it to Amanda … the cyberisation of the human species

It’s well worth reading Marc’s posting and the podcast and panel discussion he links to … it’s amusing because some of the ideas do seem far fetched but it’s still interesting and insightful.

The Winds of Fate

One ship drives east and another drives west
With the selfsame winds that blow.
Tis the set of the sails
And not the gales
Which tells us the way to go.

Like the winds of the seas are the ways of fate,
As we voyage along through the life:
Tis the set of a soul
That decides its goal,
And not the calm or the strife.

                        by Ella Wheeler Wilcox

Semantic web and other ramblings with some fellow Talisians over a curry …

Danny AyersHad a wonderful evening tonight, Ian invited us all out for a curry with Danny and his lovely wife Caroline. Unfortunately due to the short notice fewer of us were able to attend than I suspect Ian had hoped for. In fact it was only Danny, Caroline, Ian, Amanda and myself.

Danny and Caroline are both wonderful people – both are self confessed geeks and each has a diverse range of interests. I’ve been looking forward to being able to catch up with Danny; the last time we had a chat was at the Talis Summer Ball but that evening was full of frolics and not really the forum for any meaningful conversations about the future of the semantic web, the flexibility of RDF or FOAF and it’s value.

Danny’s a tinkerer – he likes to play with things, he likes to experiment with ideas and create things, which means he  looks for new ways of thinking about old problems and in doing so I think he comes up with equally novel ideas on how to solve those problems. I really like that. Some of his ideas are fascinating, some just scary and others are simply beyond my grasp (but I im not worried about that as Danny said I’m still just a bloody youngster!) . Of course all this could just mean that he’s a total nutter … but guess what? if he is… then he’s come to the right place! 😉

I think I learnt a lot this evening about Danny, and a great deal from talking to him. He certainly has that infectious enthusiasm we’ve come to kind of expect from everyone in our team. But to top it all off he’s a great guy and I’m really looking forward to working more closely with him and hopefully learning a lot more from him now that he’s part of our team at Talis.

It’s been a great evening and I had a wonderful time! 🙂

Continuous Integration with PHP

I’m in the process of setting up a continuous integration environment for a new PHP project I’m starting. On our previous project, which was Java based, we used the following tools to support similar requirements on that project in order to allow us to implement the project using a test driven approach and automate build generation:

  • Cruise Control – For setting up a Continuous Build process.
  • Ant – A Java based build tool.
  • JUnit – A Java Based xunit testing framework
  • PMD – A tool that checks for common coding standards violations.
  • Corbetura – A Java based code coverage too that calculates the percentage of code accessed by unit tests

I’ve managed to set up an analogous process for our PHP project using the following tools:

  • Cruise Control – For setting up a Continuous Build process.
  • Ant – A Java based build tool.
  • PHPUnit – An Xunit testing framework for PHP
  • PHP_CodeSniffer – A PHP tool that checks for common coding standards violations.
  • Xdebug – Debugging tool, which when combined with PHPUnit, can provide Code Coverage Metrics

It seems to work quite well, here’s the relatively simple ant build script that controls it all.

  2. <?xml version="1.0" encoding="UTF-8"?>
  3. <project default="all" name="DummyProject" basedir=".">
  4.     <target name="all" depends="clean, init, test, sniff" />
  6.     <target name="clean">
  7.         <delete dir="doc/CodeCoverage" />
  8.         <delete dir="doc/UnitTestReport" />
  9.     </target>
  11.     <target name="init">
  12.         <mkdir dir="doc/CodeCoverage" />
  13.         <mkdir dir="doc/UnitTestReport" />
  14.     </target>
  16.     <target name="test" description="Run PHPUnit tests">
  17.         <exec dir="./" executable="TestRunner.bat" failonerror="true">
  18.         </exec>
  19.     </target>
  21.     <target name="sniff" description="">
  22.         <exec dir="./" executable="Sniffer.bat" failonerror="true">
  23.         </exec>
  24.     </target>
  25. </project>

I’m currently running this on a windows machine although it’s trivial to change it work in an *ix based environment which I’ll probably configure in the next day or so. I had a couple of problems installing PHP_CodeSniffer although it was because I hadn’t installed PEAR properly. If you have any problems installing PHP_CodeSniffer under Windows then follow these instructions:

To install PEAR under windows do the following, which assumes you have PHP5.2x installed in c:\php :

  cd c:\\php

The interactive installer presents you with some options, if you follow the defaults you should be fine.
Once PEAR has installed you can install PHP_CodeSniffer like this:

  cd c:\\php
  pear install PHP_CodeSniffer-beta

This will download the PHP_CodeSniffer package and install into into your php/PEAR folder.

Once this is done you can check to see if it has installed by calling phpcs with -h flag which will produce the following:

C:\\php>phpcs -h
Usage: phpcs [-nlvi] [--report=] [--standard=]
    [--generator=] [--extensions=]  ...
        -n           Do not print warnings
        -l           Local directory only, no recursion
        -v[v][v]     Print verbose output
        -i           Show a list of installed coding standards
        --help       Print this help message
        --version    Print version information
               One or more files and/or directories to check
         A comma separated list of file extensions to check
                     (only valid if checking a directory)
           The name of the coding standard to use
          The name of a doc genertor to use
                     (forces doc generation instead of checking)
             Print either the "full" or "summary" report

Now try it out …

C:\\php>phpcs C:\\Projects\\dummyproject\\test\\

FILE: C:\\Projects\\dummyproject\\test\\AllTests.php
  1 | ERROR | End of line character is invalid; expected "\n" but found "\r\n"
  2 | ERROR | Missing file doc comment
  3 | ERROR | Constants must be uppercase; expected 'PHPUNIT_MAIN_METHOD' but
    |       | found 'PHPUnit_MAIN_METHOD'
 12 | ERROR | Missing class doc comment
 14 | ERROR | Missing function doc comment
 19 | ERROR | Missing function doc comment
 30 | ERROR | Constants must be uppercase; expected PHPUNIT_MAIN_METHOD but
    |       | found PHPUnit_MAIN_METHOD

Check the documentation for what the various command line switches do, but you can generate summary reports as well on an entire directory tree:

C:\\php>phpcs --report=summary --standard=Squiz C:\\Projects\\dummyproject\\test\\

FILE                                                            ERRORS  WARNINGS
C:\\Projects\\dummyproject\\test\\AllTests.php                  24      0
C:\\Projects\\dummyproject\\test\\NodeTest.php                  10      0
C:\\Projects\\dummyproject\\test\\NodeTypeTest.php              11      0

Overall I’m quite happy with this set up which for the most part was pretty straight forward. I have no doubt it will evolve over time but I think it’s a good foundation on which to build upon.