mattwhite

And the wallet is safe again

Having got all excited about the new iPhone last night it seems I may have jumped the gun a little. Unlike in previous years, there is no early upgrade path for existing iPhone customers. According to the O2 Website:

If you’re already with us on Pay Monthly, you can upgrade to the new iPhone 3G when it’s time to upgrade. It’s usually the last month of your contract, but you can check at My O2.

So for me, that means no upgrade until the end of the year. Oh well, I shall have to make do with the new OS in the meantime.

So there goes the wallet for the summer…

The Apple WWDC Keynote has just finished and we’ve been promised some real treats. You can get all the details elsewhere but from my point of view the new iPhone 3GS 32GB and the MacBook Pro 15″ refresh look very compelling.

So there goes my spending money for the summer… and the winter. I can’t change my laptop until Christmas so from September I’ll definitely be upgrading to Snow Leopard for $29 (I’m assuming that will translate into around £20).

Got to give kudos to TWIT Live as well where they managed to get a hooky feed direct from the Moscone Center. All very impressive and enjoyable in a very geeky sort of way.

Running XPages 8.5.0 in IE8

The first thing you’ll notice when you try and open an XPages website in IE8 is a Javascript error. The version of Dojo that ships with 8.5.0 is 1.1.1, this does not support IE8. Hopefully in 8.5.1 Dojo 1.3 will ship so this is a very short term fix.

The aim is for us to set a meta tag in our HTML to tell IE8 to run in IE7 compatability mode. Unfortunately, the built in way of setting meta tags in Domino Designer does not work properly yet so we have to manually add our own tag to the servlet response that the Domino server generates for us.

So if you put the following code into the “beforeRenderResponse” event of your XPage then you should find your site will work properly now.

try {
  if (context.getUserAgent().isIE(8, 8)) {
   var exCon = facesContext.getExternalContext();
       var response = exCon.getResponse();
       response.setHeader(“X-UA-Compatible”, “IE=EmulateIE7”);
    }
} catch (e) {
}

Kudos to Michael Gollmick for this solution.

UKLUG Progressing

During the week we published the first round of approved sessions on the UKLUG site. So far we have some really great looking sessions that are going to be given by stalwarts of the Lotus Community such as Rob Novak, Paul Mooney, Bill Buchan, Warren Elsmore, Steve McDonagh, Gab Davis, John Head, Ben Poole and Stuart McIntyre (amongst others), but the real beauty of events like UKLUG is that it gives an opportunity for some new speakers to enter the fray as well.

There is still a little bit of time to get your session in if you want to get into the Lotus speaking world. As a new entrant myself, I can’t recommend it highly enough, it’s a lot of work and scary as hell, but ultimately good fun and good for your CV as well.

If you don’t fancy speaking and hadn’t decided whether to attend UKLUG, hopefully the sessions we’ve published so far will help you make the decision.

How to migrate Blogsphere data into a Squarespace Blog

Having said yesterday that I wasn’t going to migrate the old blog across here fully, I got an attack of guilt overnight and so the obvious thing to do on a beautiful Saturday was sit on the balcony with a bottle of beer and write a migration agent that took all of the blog posts from my old blog and converted them into an XML format that can be imported by Squarespace. (In the Website Management –> Blog Importer section). The results can be found here.

There is no direct route to take from Blogsphere to Squarespace (unsurprisingly) so I set up a temporary WordPress blog, worked out the XML format that it uses when you export data and simply wrote a LotusScript agent (still a guilt pleasure occasionally)  that creates an XML files that matches the same pattern. So in theory now, if you go here you find all of the old entries and comments working properly (I suspect that the older they get, the less reliable the conversion will be), but it was surprisingly easy.

The Lotusscript needed can be downloaded here. I’m not sure whether it’s good or bad that the whole of my seven years of blogging resulted in an XML file that is just under 3.5mb in size!

Anyway, the code itself, to get geeky for a minute, uses some very simple Notes DOM XML processing and takes around 30 seconds to run against my blog. A couple of caveats are that my old blog was highly modified so I’m not sure if it will run properly against your version, if you have problems, hopefully they should be fairly easy to fix.

A new beginning for the blog

I’ve been running my blog on Domino since it started back in 2002 but I decided that it’s time to branch out a little into the wider world of t’internet.

Hopefully if you’re seeing this then all of the RSS redirections worked so you shouldn’t have to do anything for future entries. But, frankly, I couldn’t face going through the migration of the old content so you can still get to it here.

Anyway, welcome to Squarespace hopefully we’ll all enjoy my new home 🙂

How to get complicated data on the clientside in XPages without AJAX

So by now, if you’ve been playing with XPages at all, hopefully you’ll know about the #{id:myfield} syntax for referring to fields in your client side javascript. If not then you can read about it here.

But I thought it might be useful to break down that syntax and look at a couple of things which may not be so obvious.

Firstly is the hash sign (or pound sign for our American cousins). This basically tells the server that it can expect to process some server side Javascript dynamically, rather than as a one time calculation. If you had some totally static piece of information you wanted to compute you could use a dollar ($) sign instead. If you look at the source XML of your XPage then you can often see $ signs in the code for calculating the contents of your combo box options for example.

The second thing to mention is the “id:” element, this just tells the server that is is looking for a field on the XPage, in other words, it’s a reserved word. We are still in the stage of working out other reserved words here (that aren’t documented) but one option which really offers a lot of opportunities is to use “javascript:” instead. This will tell the server to run some server side javascript when it comes across the code. So, as a very simple example, in one of my XPages, I have some client side script that looks like this in DDE:

return contractorApprove("#{id:mybutton}", 
    "#{javascript:@UserName()}", 
    "#{javascript:document1.getDocument().getUniversalID()}", 
    #{javascript:document1.getItemValueInteger("numberfield")}, 
    "#{javascript:document1.getItemValueString('textfield')}"
)

becomes

return contractorApprove("view:_id1:_id4:_id6:mybutton", 
    "CN=Matt White/O=UITDemo", 
    "9B669EB8FC27551B802575C10040E62C", 
    8.0, 
    "Yes"
)

So going line by line. We are calling a client side Javascript function (which is written in a Script Library so has no context for where it is being called from, we want to pass in all of the data it needs to run) called contractorApprove. The first parameter is the HTML ID of the button which is being clicked, in DDE it’s called “mybutton” but on the browser it’s called “view:_id1:_id4:_id6:mybutton”, the server has done that translation for us.

The second parameter is where we get into the cooler stuff. I want to pass in the current user name, so I use the “#{javascript:” syntax and evaluate an @UserName() on the server and pass the result on the client side.

Likewise for the third, fourth and fifth parameters, I have a document binding set up on my XPage and I want to pass the document UNID and a couple of field values, one is a number, the other some text and I can pull these values from the document on the server side which means I can avoid having to put any more field controls into my XPage design. But you can see, hopefully, that if I had a more complicated piece of business logic, I could write it in a Server Side Script library and get the result using this technique and pass it to the browser without having to wrap it in a standalone agent, page or other Ajax wrapper that we might have used in classic Domino web dev.

Get your UKLUG abstracts in

We’re getting into that stage before UKLUG where we are starting to plan the actual content for the conference days. We’ve already had a lot of submissions from people who would like to speak, but we are looking for more, we have four rooms available and three tracks (Admin, Dev and Management) so hopefully we’ll be able to cover your area of interest.

So if you’ve ever wanted to try your hand at public speaking, or you’re a seasoned veteran and haven’t yet got your abstract in, go to the UKLUG site, log in (or register if you haven’t yet), go to your profile and click the “Propose Session”. We’ll be notifying the few, the proud, the brave, who have been accepted in the next couple of weeks.

Rebuilding my Mac

I have been thinking about doing a clean install on my main work Mac for a couple of weeks, and last night I bit the bullet and went for it. All in all an incredibly easy process (with just one reboot) and my machine now feels significantly faster for the effort.

The beauty of the Mac is that when you get a new one, you can just run the migration assistant software and your new machine will be up and running as soon as the files are copied across. Inevitably over time the OS builds up cruft and begins to slow down (we’re not talking Windows here which I used to reinstall every 4 months when I ran it as my main machine). According to the entries in my keyring file the profile I had been running started back in 2004, so it was about time to start with a clean slate.

As much for my own benefit as anything, here is my checklist of the process I went through:

1) Backup machine using Super Duper!
2) Backup machine again to another disk using Super Duper! again. (This is my livelihood, can’t be too careful)
3) Make sure you have the original disks for your machine, any old copy of OS X will not necessarily work unless you bought a shrink wrapped copy of the OS.
4) Wipe out the hard drive and install OS X from the DVDs
5) Disconnect iPhone and external drives (just for belt and braces)
6) While this is going on download any missing install files for your required software list, this is mine:
  – 1Password
  – Adium
  – Adobe Digital Editions
  – Balsamiq
  – Billable
  – Chicken of the VNC
  – CSSEdit
  – Cyberduck
  – DoubleTake
  – Evernote
  – Firefox
  – Flickr Uploader
  – Goto Meeting
  – Grand Perspective
  – iSquint
  – iStopMotion
  – JungleDisk
  – Mouseposé
  – NetNewsWire
  – Notes
  – OpenOffice
  – Parallels
  – PathFinder
  – QuickSilver
  – Skitch
  – Skype
  – SuperDuper
  – TextMate
  – TimeMachineEditor
  – Tweetie
  – VLC
  – VMWare Fusion
  – Vuze
  – Wireshark
  – HP Printer Drivers
  – Eclipse
  – iWork
  – Adobe Air
  – Stuffit
  – Growl
  – MenuMeters
7) Dig up the license keys for everything
8) After OS X install has finished, run a Software Update
9) Reboot
10) Install the above software list
11) Don’t open iTunes or iPhoto yet
12) From the SuperDuper! backup, copy your old iTunes directory over the new one
13) Do the same with the iPhoto directory
14) Do the same with the Documents directory
15) Copy in the iCal and Contacts as described here
16) Set up Time Machine
17) Set up SuperDuper! schedule
18) Start work

In all the process took me five hours from start to finish and my machine feels a lot better for it, so if you have a spare half day (or night in my case) then I’d highly recommend it. All usual rules apply, this list worked for me, if I’ve forgotten something then don’t blame me etc etc.

This is a screenshot of what I commonly run during the day hence the reason for wanting to squeeze every last ounce of performance I can get.

New Desktop

New (old) Car

I last owned a car about 18 months ago, living in London really does make it fairly uneconomic to have one. But over the last couple of months two things have conspired to make it necessary for me to get a new (well second hand) car at least for the next few months. I am driving out of London quite frequently which used to work well with StreetCar, the hourly car rental service that I have been using. But I need to get to client offices for “normal” hours which means a 5.30am start which, frankly, I have just got out of the habit of doing since I stopped commuting. Also StreetCar have reduced the number of rentals cars available near my flat which means I have to walk a fair distance before I can even get going of a morning, the cancellation of a booking this week was the last straw, so onto eBay I went.

Buying a second hand car is a risky game at the best of times, using eBay adds it’s own risk as well, but if you plan ahead it can work out very well, as it seems to have done for me this time. I got a very good price on a 2003 Volvo S60, but then spent a little bit of extra money on some HP checks, mechanical checks and insurance to make sure that if things don’t work out that I’m covered.

So yesterday I went and picked up my brand spanking old car…

New Car

Not very exciting, but that was pretty much my weekend.