Hertfordshire

The first leg of my 2005 County Challenge was a trip to Hertfordshire just north of London.

I had planned to visit Knebworth House but in an act of stupidity hadn’t actually checked to see if it was open (something I’ll have to remember for future trips). So instead the first destination shifted to be Berkamsted Castle a very old Mot and Bailey fortified castle. Even though the weather wasn’t the best it was actually really very interesting and picturesque.

Last night I went to see National Treasure in Stevenage, a truly horrible town. Admittedly I only drove through but there didn’t seem to be a single redeeming feature about the place.

The plan (which by now was pretty much out of the window) was to spend the day today at Elstree Studios but I had arranged to pick up my new car so I made an early start and had a long walk around Elstree village itself at about 7 o’clock this morning just as the sun was coming up. Very beautiful.

So the trip was nothing like planned but very nice nonetheless.

Group shopping trip

It looks like a few people have the same idea to stock up on Apple products on the Sunday at Lotusphere.

I think most of the people going will be at the Gonzo party at ESPN on Saturday night, judging by the numbers it could either be a convoy or Bill’s idea of a stretch limo will be necessary. Anyway it can be sorted out then when the beer consumption will define the start time no doubt.

Scary Stuff

I carry a multi tool in my bag at all times (except flying) because it’s extremely useful. When someone in the office asked if they could borrow some scissors I just opened up one of the blades and they used that instead. While chatting one of the guys mentioned that he thought it was probably illegal and sent me this article in which it appears that pen-knifes with locking blades can indeed lead to being arrested.

It’s an interesting read as well.

A worrying trend

Yet another blogger has been fired because of their online activites. Joe worked for Waterstones, a bookseller, in Edinburgh. On his weblog he mentioned work a few times (who of us hasn’t) and apparently this was enough to get him fired for gross misconduct. Several worrying aspects to this case which are well worth reading about. I think this is the first UK based blogger I have heard about who has been fired and hopefully the last. Unless you are revealing confidential information I can’t see any reason for such an extreme reaction. As Joe himself said, a quiet word would have been sufficient to stop his mentioning work in public.

How to test @Formulae quickly

An oldie but a goodie. I’m always surprised by the number of people who don’t know about this feature.

If you have a formula which you just want to test quickly without creating a new form, you can paste it into a text field on any new document (the Subject field on a new Memo for example) and simply press Shift-F9. This will evaluate the formula and overwrite the formula you just pasted with the results or any error messages. Great when you are trying to debug problems in production systems.

Simple example:

Create a new Memo
Type @UserName in the Subject
Press Shift-F9
@UserName will be replaced with your canonical name

Check a users' session hasn't expired before submitting

When running session authentication, especially on a secure connection (SSL) it can be hugely annoying for a user if they try and submit a form only to be told that their session has expired. To combat this I wrote a bit of Javascript in conjunction with a couple of HTML pages which checks your session before trying to submit the data. If the session has expired then you’re prompted to log in again before being allowed to continue.

So step 1, before submitting your form use the following script:

//**************************************************************************************
//First check if the session is alive
 var xml = new ActiveXObject(“Microsoft.XMLHTTP”);
 var pos=0;
 currURL = (document.location.href).toLowerCase();
 pos = currURL.indexOf(‘://’);
 pos += 3;
 pos = currURL.indexOf(‘/’, pos);
 vurl = trim(currURL.substring(0, pos));
 xml.open(“GET”, vurl + “/authchecker.nsf/auth?readform”, false);
 xml.send(null);
 var bError = false;
 if (xml.responseText.indexOf(“Anonymous”) > -1) {
  //The session has expired so prompt user to login again before submitting
  var validSession = window.showModalDialog(“/authchecker.nsf/commonframeset?readform&bottomframe=/authchecker.nsf/QuickLogin.html”, “Login”, “dialogHeight: 270px; dialogWidth: 400px; dialogTop: px; dialogLeft: px; edge: Raised; center: Yes; help: No; resizable: No; status: No;”);
  if (validSession != “true”){
   bError = true;
   if (validSession != “”)
    alert(validSession);
  }
 }
//End Session Checker (Except for bError check around following chunk
//************************************************************************
 if (!bError)
  document.forms[0].submit();

What it does is open a URL using the XMLHTTP ActiveX control in Internet Explorer. I always have a form on the server which will return the current username and rights as an XML document (in this case accessed at “/authchecker/auth?readform”):

<?xml version=”1.0″ encoding=”utf-8″ ?>
<userinformation>
  <name>CN=Matthew White/O=FCL</name>
  <accesslist>
    <access>CN=Matthew White/O=FCL</access>
    <access>*</access>
    <access>*/O=FCL</access>
    <access>Administrators</access>
    <access>[FCLAdmin]</access>
  </accesslist>
  <cookie>DomAuthSessId=24A0C25E003E5F604B5A1CAC544D7C98</cookie>
</userinformation>

The XML returned is checked to see if your username is Anonymous, if it is then we know that your session has expired so we have to prompt for your username and password instead of submitting the form. So we open the quick login screen using the ShowModalDialog method in IE. If the user enters a correct username and password then the modal dialog closes down and the submit continues, otherwise the login screen with reappear until they have logged in or they cancel by closing the dialog box. Even if they can’t log in it means that they do not lose any work.

Download the sample NSF

Ben Rose is attempting the impossible

Ben Rose is going to try and do something for charity far harder than any marathon – he plans to not use a computer for two weeks. At all.

It would certainly be a great challenge and not something I think I could pull off. Almost every aspect of my life involves a computer to some degree – work (obviously), leisure in the form of browsing, digital photography even booking travel. I would imagine that my reading levels might increase dramatically.