Andrew Cook

Feb 20, 2012

I've just updated Recruitment Modeller with a Spotlight Importer.

I thought it'd be reasonably simple - just create the importer as a sub project of Recruitment Modeller, sign it, and copy it to the right place (./Library/Spotlight) when building the main app.

It's not so simple. It's vital not to sign the Spotlight importer (or I presume similar embeded binaries such as quicklook plugins) or you get an invalid binary warning when you upload to the AppStore.

Having realised that, the new version of Recruitment Modeller is now waiting for review.

Feb 7, 2012

"All trials are in the past, all patients to whom the results will be applied are in the future."

A very true statement from Richard Peto - which must have implications for the generalisability of trials. We take alot of effort to make sure they're appropriately generalisable to the present day population of interest - but can pay less attention to how relevant they will be once the results are available.

Jan 26, 2012
Apple could have made this easier

It's not unreasonable to want to show an NSPopover from an NSToolbar - probably originating from an item on the toolbar - like this:

Popover from Toolbar Item

Unfortunately, showing a popover in Cocoa relies on the method

-(void)showRelativeToRect:(NSRect)positioningRect ofView:(NSView *)positioningView preferredEdge:(NSRectEdge)preferredEdge

but as NSToolbarItem inherits from NSObject rather than NSControl (which was possibly a sensible design decision 20 years ago) there's no easy way to get the NSToolbarItem's view - and hence to show the popover from the right place.

The trick is to put an NSButton inside the toolbar item, then use a property to keep track of it, and get its bounds when clicked. The code looks something like :

@property (nonatomic, strong) IBOutlet NSToolbarItem *showPopoverToolbarButton;

and

NSView *viewToShowFrom = [self.showPopoverToolbarButton view];

PopverDetailViewController *pdvc = [[PopoverDetailViewController alloc] initWithNibName:@"PopoverDetailViewController" bundle:nil];

self.popover                       = [[NSPopover alloc] init];
self.popover.contentViewController = pdvc;
self.popover.delegate              = self;
[self.popover showRelativeToRect:[viewToShowFrom bounds] ofView:viewToShowFrom preferredEdge:0];

And there's one more thing. As presented, when clicked the toolbar item will show a nasty light square around itself, like this:

Nasty Light Square

You can get rid of this by changing the button cell type to Momentary Change using Interface Builder.

IBPopover

Jan 16, 2012
It seems to work

FoCal is some potentially useful software which performs focus microadjustment for some Canon cameras, automatically. The obvious major flaw is that it's currently Windows only, but the developer has promised a Mac version in future - and if you buy a key for the Windows version now he says that it'll work later for the Mac.

Having bought the Windows version, the next challenge was how to run it on my MacBook. It turned out there was only one answer - Boot Camp. While FoCaL ran in virtual machines on both VMWare Fusion and Parallels, it couldn't see my 7D. I don't think that's FoCaL's fault, as Canon's EOS Utility couldn't either. I blame the virtual machine software. In summary - neither VMWare or Parallels are up to the job, so Boot Camp it was.

FoCal wouldn't start until it had updated .NET - even though I'd just updated it from the Microsoft website. For someone who usually uses Mac software, running software designed for Windows was rather a shock. I'd forgotten how clunky, and frankly how ugly, Windows software can be.

And so to the FoCaL interface - which is functional, but plain. It lags a bit and is a touch unresponsive (on a MacBook Pro, 2.66 GHz i7, 4GB RAM), but that could possibly be put down to running inside .NET. The buttons are big - but the text is small. It does seems like that would be a simple interface issue which could be improved.

But does it work? - It appears that it does.

I set out to calibrate lenses for my 7D using the plus version of FoCaL. Using the provided target, printed on an inkjet, it's easy enough to position a camera on a tripod. It's then just a matter of hitting the autocalibrate button, and off it goes. Around three minutes later it's diagnosed what the appropriate adjustment should be, and offers to reprogramme the camera.

I calibrated 5 lenses, ranging from focal lengths of 15mm to 250mm in less than half an hour - and they all appear to be getting better focus.

So - the software seems to work. It's just very unfortunate you need to use Windows (and a real Windows installation, not a virtual machine) to run it.

Jan 15, 2012
Why is Windows installation so awkward?

I thought I'd give FoCal a go. FoCal is some potentially useful software which performs focus microadjustment for some Canon cameras, automatically. The obvious major drawback to FoCal is it's currently Windows only software - and that meant installing Windows on my Mac.

Luckily, I had a copy of Windows 7 lying around from a few years ago, and due to a problem with virtual machines, I've had three goes at installing Windows in the past week - once into a Parallels virtual machine, once into a Fusion virtual machine, and once into a partition on a MacBook Pro via Boot Camp.

Why is the Windows installation experience so poor? I know it's something people don't do very often - and most people don't do at all - but it's not a good first impression.

I really don't get why Windows still has to reboot when it finds new drivers - but not all the time. And why the inevitable set of updates after a new installation also require multiple reboots. One, to make sure all the fresh code is loaded, sure. But why more than one?

BeOS had this right over a decade ago. MacOSX gets it right. Linux, while challenging as a desktop OS, doesn't have to reboot for updates at all.

Jan 2, 2012

Eye of the Rhino by ajcook ) on 500px.com
Eye of the Rhino by ajcook

Marwell Zoo has a collection of three rhinos, who I guess are reasonably happy with their lot. I came across them (unusually) indoors, and rather close.

Dec 22, 2011
A little bit about the SCT Conference in May 2011

In December 2010 I was fortunate enough to have a proposal for an oral presentation accepted for the 32nd Society for Clinical trials meeting in Vancouver, Canada. So in May 2011 off I went for 4 days of conference and a pre-conference workshop.

The Society for Clinical Trials is an international organisation dedicated to the development and dissemination of knowledge about the design, conduct and analysis of clinical trial methodologies - rather like HTAi but with a focus on clinical trials rather than systematic review. Despite its claim to be international its meetings are almost always in North America - of those 32 meetings 1 has been in London and one in Brussels. The attendance this year reflected a similar pattern with 600 attendees, of whom less than 100 were not from either the USA or Canada. Of those 100 however, there were several HTA grant holders, and at least one Commissioning Board member.

I started off with a pre-conference workshop on Adaptive Clinical Trials, delivered by Roger Lewis (an Emergency Physician from UCLA), and Jason Connor (a statistician from a private consultancy, and the University of Central Florida). This mix was reflected in the rest of the conference, with people from Universities and public funders mixing with those doing trials in industry and Contract Research Organisations (CROs) - a type of organisation I only found out about at this conference.

There then followed 3 days of insight about other people’s experience in designing and delivering trials in both the public and private sector. Possibly the most eye-opening session was one on The CATT trial - the North American equivalent of our IVAN trial. They relayed a horrific story of the interactions the trial team had had to have with health insurance companies and Medicare (the federal health insurance system for pensioners) in order to get the drugs to patients. A particular problem had been with the co-pay system that Medicare uses. Rather than a flat prescription charge, people on Medicare pay a percentage of the retail cost of a prescription, with one drug having a co-pay of $10 and the other a co-pay of $100, the bills received would have rapidly unmasked the study. The effort required to overcome these issues was gargantuan, and puts our challenges with excess treatment costs into perspective.

This was a high quality conference. Of all the sessions I went to, only one was less than excellent - and that was because the clinician involved in the session had had his aeroplane diverted, so the unfortunate statistician who did manage to get there had to try to relay the clinical importance and effects of the various cancer treatments discussed.

It’s a conference which you may consider worth targeting, for presentation of RoR projects with a particular clinical trial bent. I certainly hope I’ll be able to go again. It’s held every May, with the abstract submission deadline the previous December.