Stansted Airport

I’m sat having a bit of breakfast in Stansted Airport at the moment. The flight to New York is due to board in about an hour so a bit of time to catch up on all of the blogs out there. I’m so early because I thought I’d try the new road to the airport and so left plenty of time for delay, to be honest I prefer it that way. After the last manic trip down to Gatwick it’s far less stressful.

This is the first time I’ve flown from Stansted to New York, I’m trying out a new “all business class” flight from an airline called Max Jet. To be honest I wouldn’t have done except they were offering a cheap flight deal with a return to JFK costing “only” £400. Still expensive but given the shorter journey from home (only 45 minutes this morning) hopefully worth it. Apparently they run a 767 with just 102 seats (as opposed to up to 200 in some configurations). I get the feeling it won’t be up to true business class standards but it’s only a 7 hour flight so whatever it’s like won’t be a problem.

Today’s the start of a two leg journey, I’m staying in Manhattan tonight and then doing another early flight from JFK tomorrow to Los Angeles (via Dallas) where I pick up the car and begin the long drive back to New York over the next few weeks. I’m really looking forward to it all, driving right across the States is something that I’ve wanted to do for a long time, now is just the perfect opportunity to indulge myself (just a little more than usual).

So expect no techy posts for a while, apologies if travelogue is not what you’re looking for, but hey I’ve got to crow to someone haven’t I!

Grand National Win (well each way at least)

My un-natural luck on the Grand National has continued this year. I put two each way bets on Hedgehunter and Nil Desperandum. Both came in the places so I’ve come out with £43.50 profit (mostly thanks to Nil Desperandum which was a 40/1 outsider). It’s the only race in the year that I actually put any money on but over the years it’s been good to me. The winner was Numbersixvalverde at 11/1, a good punt for a lot of people I guess.

I think I’ll treat the winnings as money for the pot for Las Vegas next week. Now to brush up on my Blackjack and Craps 🙂

Lotus Advisor Summit

I’ve just noticed that I arrive in Las Vegas next week on the last day of the Lotus Advisor Summit. If anyone’s around drop me a line if you fancy a drink on the Thursday or Friday night (13th or 14th April).

Update: It looks like Declan and Terri are going to be around at the same time, so anyone else want to join?

Old School on TV

There was a new programme on TV last night called That’ll Teach ‘Em, a fairly standard reality show where 16 year olds are “sent back to a 1950’s education”. I was watching it and thinking how familiar the school looked and then I realised why… it’s set at my old school. Very strange to see it on TV, especially in this context but it does fit the requirements very well with some of the old buildings (where I used to have my Geography lessons) near the chapel, where my sister got married, being used for the classes.

Yet another internet survey

Rocky and Libby pointed out this personality “DNA” survey which asks a whole load of questions to analyse your personality. I come out as an “Independent Analyst”:


Like Rocky I think it’s a fairly accurate assessment of my character. It only takes about 15 minutes, well worth a look during your lunch hour.

11TMR is four today

No Show’n’Tell today as I’m off to London for the first time in several weeks (it’s been the longest run without going down for several years).

But I thought I should just mention that this site is four years old today. It’s still nowhere near as big as I’d like but the readership continues to expand as does the Lotus blogging community in general. I don’t think any of us would do this unless we enjoyed it, but the thing I like most is all of the communication from everyone else out there… the comments and the emails are gratefully received.

There are now 830 blog entries of which only 167 have been created in the last year. So I really need to buck my ideas up over the next year to get back to an acceptable level don’t I!

New Design for 50 Word Review

I’ve been playing around for the last few days with a new “AJAX” design for 50WordReview.com a site which myself and a few other people contribute to. The aim was to make an entire Domino application work purely with AJAX methodologies so everything from creating a new review through to searching and commenting are all handled within the one and only form in the database.

In terms of design I’ll probably play with it over the next few weeks but the basic code is there and tested (at least to some degree) in Firefox, Internet Exploder 6 and Safari 1.2.

The whole thing has been written in less than 2,500 lines of Javascript plus 10 views and 2 agents. So it’s a pretty small application in the scheme of things but in terms of responsiveness and general usability I am quite proud of it (now is that setting myself up for a fall or what!).

Please do go and have a play, feel free to write reviews etc, the more the merrier!

Apologies for Downtime

I’ve been playing around with some server settings for the last hour or so, I had to restart 3 or 4 times, apologies for that.

Normal service resumes.

Road Trip Ahead

I’ve decided that I may as well take advantage of my time off work at the moment so am going on a bit of a road trip across the States during April and May.

The plan is to fly out to New York and then take an internal flight across to Los Angeles. From there I’m going to drive back to New York stopping off to see places along the way. Because I’m not time limited I can take a few weeks to drive the 3,000 odd miles. I haven’t really got a route planned out yet but there are several good site out there which offer suggested directions and things to do.

There’s no point in having all this time off and not doing anything with it after all is there?

Now Playing: Break Me Gently
Lost Souls
Doves

Sorting categories by count

Yet more XML and AJAX, what can I say, it’s just so much fun playing around with this stuff.

While in Sweden we were talking about how a real “nice to have” would be to be able to get a list of categories sorted by the number of documents in each category. As has become patently obvious I am not a Notes client guy, but on the browser this is really pretty simple. There are two steps that we need to go through.

So what we’re aiming to get is a list of the categories that are in this blog and then sort them by the number of documents within each category.

Step 1 – Getting the data
This is where the AJAX comes in. Recently I have switched over to using prototype for all of my AJAX calls, it’s a really powerful (and free) javascript library which handles all of your AJAX needs and some more besides. You may have noticed the new “Now Playing” block over on the left which is using prototype to make a request every 5 minutes to see what I’m listening to in iTunes.

So to get the XML for the categories I do the following:

function getCategories()
{
var a=$H(
{
collapseview: “true”,
count: 1000
}
);
var myAjax = new Ajax.Request(
‘http://www.11tmr.com/11tmr.nsf/BlogByCategoryCount?readviewentries’,
{method: ‘get’, parameters: a.toQueryString(), onComplete: outputCategories}
);
}

To me this is why prototype is so great, I just need to give it a URL and some parameters and it will go and handle everything else for me including browser issues. The final URL we’re building here is:

http://www.11tmr.com/11tmr.nsf/BlogByCategoryCount?readviewentries&count=1000&collapseview=true

When the URL is loaded then prototype will call the “outputCategories” function and pass in the response from the URL (whether that be XML or HTML or text doesn’t matter at this point).

Step 2 – Sorting the Data
OK, now we have the XML of the view, one entry per category thanks to the “collapseview” URL parameter. The attributes of each entry tell us the number of blog entries under each category (the “children” attribute) and also the total number of documents for the category (i.e. the number of blog entries plus the number of comments as well) in the “descendants” attribute:

This next bit I can’t claim credit for, instead I pass on thanks to Breaking Par Consulting who posted a great tip about sorting multi dimensional arrays in javascript. The pattern is to create a class function, in this case it has three properties – Category Title, Count and Number of Comments. We loop through the XML and create a category object for each category and place the new object into an array. After the array has been populated it’s just a matter of calling the sort method but making sure that you give it a function to define the sort rule:


for (i=0; i {
cat = getInnerText(results[i].getElementsByTagName(“entrydata”)[0]);
count = parseInt(results[i].attributes[2].value, 10);
comments = parseInt(results[i].attributes[3].value, 10) – count;
aCats.push(new category(cat, count, comments));
}

aCats.sort(sortCount);

function category(title, count, comments)
{
this.Title = editReplace(title, “\n”, “”);
this.Count = count;
this.Comments = comments;
}

/*
sorting pattern courtesy of Breaking Par
http://www.breakingpar.com/bkp/home.nsf/0/87256B280015193F87256C8D00514FA4
*/
function sortCount(a, b)
{
var x = a.Count;
var y = b.Count;
return ((x > y) ? -1 : ((x }

The Result
Hopefully that makes sense. If not then go and have a look at the final result and follow through the whole code there.