RailsConf wrapped up this afternoon and I'm heading back to reality. Before I fly home to Amsterdam, I'm staying one night in actual downtown Chicago. It's a great relief after so many nights in O'Hare Airportsville. Luckily the quality of the conference made up for the terrible location.
It's been a fun and worthwhile trip that's introduced me to a whole new community. Unlike an ETech or an XTech, there were only a few familiar faces from my usual conference circuit. I think I made a reasonable impression on my new friends with my talk on Saturday morning: Putting the BBC's Programme Catalogue on Rails. There was a great turnout and people hung around after the talk to ask some very interesting and intelligent questions. I spotted Martin Fowler at the back of the room, which threw me for a few seconds. His books on refactoring and software patterns are essential reading for any developer and I have enormous respect for his opinions.
Without the audio, I'm afraid the slides are just a vague visual outline. There was a dedicated team recording the talks throughout the conference, and I'm told that the audio will be available soon. Sadly you'll have to pay for access to this, although the cost may be justifiable judging from the quality of the talks that I was able to attend.
I've had quite a few requests for the source code of the Flickr screen for Second Life that I wrote about a few weeks ago. Here's the code, annotated with links to the Second Life coding wiki and a few notes.
I'm only publishing the LSL code, because the serverside code isn't very interesting and does pretty much exactly what it says in the previous post. If you want to run your own flickr screen, the URLs in the code below should work just as well for your objects as they do for mine. If you have problems, let me know. I reserve the right to switch off the code if the traffic gets too high, but I'll post here if I have to do that.
UPDATE: Sorry, but I no longer have the server capacity to run the backend for this service.
The code uses SL's streaming media feature to load the jpeg into a texture. This comes with a number of restrictions: 'You are allowed one movie (or "media" resource) per land parcel. The movie will be played by replacing a texture on an object with the movie. Users will only see the movie when they are standing on your land parcel. Otherwise they will see the static texture. Script functions only work for objects owned by the land owner or deeded to the group that owns the land. (Remember to set asset permissions on your script and object as well as sharing it with the group!)'. I'm hoping for much better media support than this in future Second Life versions.
// A place to remember the ID for the latest http request we made, so the callback doesn't process out-of-order responses
key http_id;
// Test pattern - Used as default video texture when one is missing in parcel media
key VIDEO_DEFAULT = "6e0f05ad-1809-4edc-df29-fae3d2a6c9b8";
// Set the texture to the jpeg provided by url
seturl(string url)
{
key video_texture = llList2Key(llParcelMediaQuery( [PARCEL_MEDIA_COMMAND_TEXTURE]), 0);
if(video_texture == NULL_KEY)
{
video_texture = VIDEO_DEFAULT;
llParcelMediaCommandList([PARCEL_MEDIA_COMMAND_TEXTURE, VIDEO_DEFAULT]);
}
llSetTexture(video_texture,ALL_SIDES);
llParcelMediaCommandList([PARCEL_MEDIA_COMMAND_URL,url]);
llParcelMediaCommandList([PARCEL_MEDIA_COMMAND_PLAY]);
llParcelMediaCommandList([PARCEL_MEDIA_COMMAND_AUTO_ALIGN,TRUE]);
}
default
{
state_entry()
{
// set a default jpeg
seturl("http://www.flickr.com/images/flickr_logo_gamma.gif.v1.2");
// start listening for nearby speech
llListen(1,"",NULL_KEY,"");
// start sensing nearby agents once a minute
llSensorRepeat("",NULL_KEY,AGENT,10,10,60);
}
sensor(integer num_detected)
{
integer i;
for (i = 0; i < num_detected; i++)
{
// ping the server so we know who's around
string url = "http://www.hackdiary.com/secondlife/experiments/seen?name="+llDetectedName(i);
// but don't record the request ID, because we don't need
// http_response to care about this request
llHTTPRequest(url,[],"");
}
}
listen(integer channel, string name, key id, string message)
{
llSay(0,"Setting the tag for "+name+" to "+message);
string url = "http://www.hackdiary.com/secondlife/experiments/set_tag?name="+name+"&tag="+message;
llHTTPRequest(url,[],"");
}
touch_start(integer total_number)
{
// ask the server for a jpeg appropriate to the agent who touched us
string url = "http://www.hackdiary.com/secondlife/experiments/sensed?name="+llDetectedName(0);
llSetText("Finding a picture for "+llDetectedName(0),<0,0,1>,1);
llParcelMediaCommandList([PARCEL_MEDIA_COMMAND_STOP]);
http_id = llHTTPRequest(url,[],"");
}
http_response(key request_id, integer status, list metadata, string body) {
// make sure we're processing a response we care about
if(request_id == http_id) {
// only on request success
if(status == 200) {
// data is coming back as pipe-delimited
list data = llParseString2List(body,["|"],[]);
// url is the first field
string url = llList2String(data,0);
if(url == "UNKNOWN") {
llWhisper(0,"I don't know what kind of picture to show you.
Type '/1 sometag' to tell me what tag to search for on flickr and I'll remember it.");
} else {
// name is the second field
string name = llList2String(data,1);
llSetText("Showing a picture for "+name,<0,0,1>,0.5);
seturl(url);
}
}
}
}
}
My name is Matt Biddulph. Since October 2005, I've been an independent freelancer, open to new work. I'm currently based in London but I'm open to travel and have worked remotely for clients in a number of countries. I specialise in the design of software systems for the internet. I have a particular interest in digital media, social software and data on the web.
I'm an experienced developer in most of the languages and systems you'd expect from more than ten years of work in the industry: Ruby (and Rails), Python, Java, Perl, Unix, databases, web servers and so forth. These days I spend as much time consulting on the design and modelling of systems as I do writing code for them. I write about my personal experiments in technology here on hackdiary, and it's always a good reflection of my interests at any given time.
Before I went freelance, I spent several years working at the Press Association and the BBC. There's a lot more about that period in my CV.
I consulted on the data model for programmes in this new social TV platform from the founders of Skype and Kazaa.
I created a system in Second Life for importing 3D models from real-world data created by the European Molecular Biology Lab.
I also developed a number of patches to Movabletype and modules for Ruby on Rails to enhance Nature's ability to publish over XML/RPC and Atom Publishing Protocol in their internal editorial systems.
Edd Dumbill and I developed a two-day Ruby on Rails quickstart training programme which we taught at the XTech 2006 conference and at the BBC.
Using Ruby on Rails, I was the developer and information architect on the first public experimental prototype of the BBC Programme Catalogue. The site exposes the database of the BBC's enormous archive to the internet via a search engine and web APIs.
Consulting on the technical architecture and implications of Thinglink, the free product code for creative work.
In just 5 days, built a prototype of a mobile application for local government in Ruby on Rails.