Gareth Lennox

Panoramics

I recently found some useful software that automatically stitches together multiple images to create panoramics. Other panoramic software requires you to manually identify which picture goes where, but Autostitch does it all automatically.

You give it all the images, and it works out what image goes where, adjusting each one so they blend together. It works suprisingly well.

As an example, I have stitched together a panoramic I made while in the Cedarberg, during Easter 2005 (click the image for a larger version).

Cedarburg, Stadsaal, Easter 2005

I didn’t do any tweaking at all, this is the raw output. Pretty impressive stuff.

Keeping a session alive

One of the problems we found with people using our content management system was that, frequently, they would take very long editing a page, causing the session to time out, thereby losing their changes.

We could have written code to catch the timout session, and somehow not lose their changes, but we decided on a different course of action, one that I think is much cleaner.

I made use of some javascript and ajax (aka XMLHttpRequest) to ping the server every five minutes. On the server I wrote a special page that would just refresh the session, when requested.

The code is quite simple, we use the setTimeout javascript method to initiate the ping, and ajax to make the call back to the server.

var timeout = 300000; //5 mins
function pingServer()
{
    http = getHTTPObject();
    http.open("GET", 'http://server/admin/ping/', false);
    http.send(null);
    setTimeout('pingServer()', timeout);
}
setTimeout('pingServer()', timeout);

the setTimeout method takes two arguments, a function name, and a timeout value in milliseconds. The getHTTPObject function, is defined on this blog.

Result? The session timeout of 20 minutes is never hit, as long as the user has their browser open. A much better user experience, I would say!

New blog

Welcome to my new blog, we shall see if this lasts…

I will be talking about anything that interests me, the industry that I work in, and anything else I want (it is my site after all!). I work in the software development industry, developing mostly in C# and PHP. I also design websites, and am a keen supporter of web standards.

I am a part owner and director of Dwakn Consulting, a company a couple of mates and I started after varsity. We are concentrating on website design and web application development, and have developed our own content management system (hopefully, I will find some time to reveal some detail about this system).

This site is hosted on Dwakn’s server, and is powered by wordpress.

Hopefully, this won’t be the only post on this site 🙂