Sunday, September 19, 2010

Caught in the Act -- Again!

This evening, after I'd made sure that the cat-flap was set to inbound-only, I heard the door swinging, and thought to myself "but all the cats who know how to use it are in, unless this is a visitor" -- but there was no sound of challenge from the cats who had just a little while before been at their feeding station nearby.

So, I wander into the lobby, just in time to see the hindquarters of a cat exiting through the 'In' door, clearly having hooked it open by the rubber rim and stuck a nose under.

Some cats are too clever for their own good!

Saturday, September 18, 2010

Film — The Extraordinary Adventures of Adèle Blanc-Sec

For someone who announced his retirement a few years ago, Luc Besson remains remarkably active...

The 30th Cambridge Film Festival opened with his latest film, an adaptation of a 1970s bande dessinĂ©e about the eponymous Adèle, who is an Edwardian Lara Croft, with a touch of Tintin, in a turn of the century Paris, populated mainly by bumbling gentlemen with florid moustaches and ghastly haircuts. And, for reasons that become apparent as the film progresses, a rapacious pterodactyl which serves as the maguffin.

For a comedy adventure, the humour is uneven, sometimes leaden, some gags are over used (the rule of three is callously disregarded at times), sometimes a little too knowing (in the form of a certain quip about a change in the Parisian landscape that post-dates the original publication), but in the main, works.

Two strikes against the film -- an anachronistic attitude to tobacco (fixable by tweaking one line of dialog), and two uses of bullet time.

Oh -- and you do have to stay through the credits for this one.

Sunday, September 05, 2010

Film — L'Illusioniste

A new feature directed by Sylvain Chaumet (Triplettes de Belleville) to a 1956 screenplay by Jacques Tati. This 100+ minute animation is very clearly a Tati film -- it's almost done in mime, an absolute mimimum of dialogue -- with a strong air of melancholy under the veneer of humour (an example of the mood being the scene where the girl, who has attached herself to the middle-aged, slightly past-it stage magician of the title, serves up rabbit stew to him, and some of the other stage acts who share their digs, while he is surreptitiously looking for where the obnoxious creature which he pulls out of hats has gone). Although the CGI leaps out at you in a slightly obnoxious fashion in a couple of shots, for the most part it could be line and watercolour after the style of Oliver Postgate.

Its evocation of Britain (some London, a lot of Scotland) c1960 rings very true, both in the looks -- I'm sure there were photographic references underlying the scenery -- but also the cultural references, as the old music hall acts are elbowed out by the new rock'n'rollers exemplified by Billy Boy and the Britoons. And there are some more knowing, more contemporary, jokes embedded in some of the signage (it's very worth reading all the text, like the menu at the chippie, and the pawnbroker's hoardings).

And look out for the actual Tati to make a brief appearance, as well as the namesake central character.

Likely to be the best film I see all year.

Wednesday, September 01, 2010

Caught in the act!

For a while now, I've had my suspicions as to who was responsible for the level of food in an open tin going down. Now I have the suspect red-handed --

Call me Arthur

"Call me Arthur"

At least that's not as bad as bringing a pigeon in through the cat-flap, which is what I came home to today -- a flurry of feathers and a bemused looking half-plucked bird standing in the middle of the living room floor, and needing shooing out,

Tuesday, August 31, 2010

Cambridge Film Festival

An even more dreary and schlocky or right-on selection in the program (though the list on the printed program differs slightly from what are listed on the web-site) this year; down to only 2 that caught my eye

Let us hope that neither is a disappointment, since the generally tawdry, often cheap and nasty looking, selection of films definitely is. (Clearly no money or enthusiasm available for anything like Miyazaki's Arietty.)

Friday, August 27, 2010

Cycling Holiday


View August 2010 in a larger map

Equipped with the new car and, more importantly, a bike-rack, I strapped my trusty old mount on the back, programmed the satnav, and set off for a couple of mights' stay in one of the country inns that I've stayed in as part of a Cycle Breaks holiday -- this time going to the King's Head in Great Bircham, thereby cutting out a couple of days messing around near Swaffham (and, equally important, the drive home down the A11).

After an easy run through showery weather, I got to my destination in good time to unship the bike and head off to the Gin Trap Inn at Ringstead for lunch. Alas, the after lunch amble down the lanes was interrupted by unexpected rain, first a cautionary sprinkle, then, a mile or so from base, the heavens opened.

Tuesday I trusted the forecast when it said light showers, late afternoon, so set out on a long loop, expecting to pick up some provisions in Fakenham, then head up to the coast. Not finding any obvious place to buy big cartons of juice in Fakenham, I just loaded up with some Lucozade Sport, then started following the cycle route to the coast.

Evidence of previous rain was there in the need to get off and wheel the bike around some big puddles on a short stretch of green lane; but by the time I got to Gt Walsingham, the sun was shining, and I could shed the brushed cotton shirt that had been providing warmth. And then I noticed the wall of weather heading my way. With not enough time and land to avoid it, I skipped the off-road path through Holkham Hall grounds, did as best as possible to skirt Wells, and got to the main road as the sun shone through again, and revealed another squall line following.

I got to the Jockey in Burnham Market just ahead of the weather and then waited for it to pass, before heading back slightly damp and in strong cold wind to the hotel.

On the last day, I looped west, through good weather that started to develop a high haze, discovering a convenient superette in Heacham -- even though I didn't need anything; a useful stretch of cyclepath along the main road between Heacham and Hunstanton, and eventually back to the Gin Trap for lunch, before heading back through distinctly overcast weather. This time I beat the rain on the route to the hotel -- but it arrived earlier than forecast during the drive home.

Thursday, August 12, 2010

Shiny new toy

After six and a bit years, and 37,509 miles, I traded in the old Smart -- chosen as one they had in stock and wanted to shift -- for one customised as I would originally have wanted, only this time it's the 2.0 model, a Passion rather than a Pure.

Shiny new toy

This one came with 14 miles not reset on the clock, digital audio input as standard and a bike-rack as custom -- which I shall be putting to use as part of the first serious outing it will get.

Links for 12-Aug

Using the Reactive Extensions:

F# Silverlight template.

PartCover patched to avoid writing to HKLM (my first patch to someone else's FOSS project!)

Untangling expression trees.

Using Code coverage -- did the right tests get written?

How we approach unfamiliar code (study).

Cosmos (C# OS kit) reaches milestone 5 with Visual Studio integration.

Saturday, July 17, 2010

Building PartCover 4 on Vista

Updated again: PartCover Revision 35 includes a patch I provided that builds the same functionality in C#, transiently registering the COM component in HKCU during build, and also providing a --register command line option which is equivalent to the old nCover //r option.

Updated with new complete registry frobbing script, based on actually diffing the before and after states of HKCR when using regsvr32 on the PartCover dll.

Following on from earlier in the week, I pulled the current trunk from SourceForge, and set about building it then putting it to work on some F# code which had caused an earlier version (the most recent available at the end of last year) to balk.

Unzipping the tools (Boost, ATL server) into the appropriate libraries, guided by the include paths (and moving the Debug relative paths to match the Release ones) was trivial, and then it's just a case of firing up MSBuild. Or so I thought.

First hiccup -- it attempts to register the PartCover assembly during the build, and I don't run as administrator by default. So I replaced the

regsvr32 /s /c "$(TargetPath)"

by a manual registry frobbing trick (akin to what NCover 1.5.8 used for its //r option)

"$(ProgramFiles)\FSharp-2.0.0.0\bin\fsi.exe" "$(ProjectDir)\partcover.fsx" "$(TargetPath)"

where partcover.fsx is

This updated per-user registration permits both building and running the PartCover utility without needing full administrator privilege.

So emitting

...\PartCover.exe --target "..\..\..\_Tools\Microsoft Fxcop 10.0\FxCopCmd.exe"  --target-work-dir . --target-args "/q /s /console /f:Tinesware.Recorder.dll /f:Tinesware.Instrumentation.exe /f:Tinesware.Infrastructure.dll /f:Tinesware.Rules.dll /f:Tinesware.InfrastructureTests.dll /f:BaseTests.dll /rule:Tinesware.Rules .dll /o:fxcop.xml /dictionary:..\..\..\CustomDictionary.xml" --include [Tinesware.*]* --include [CSharpTests]* --output PartCoverage.xml

to monitor code coverage when using an FxCop rule written in F#, this reported

open driver pipe
modify target environment variables
create target process
wait for driver connection
[00000] [05724] Options dump:
[00000] [05724]   VerboseLevel: -842150451
[00016] [05724]   Log file: ...\Infrastructure\_Binaries\Tinesware.InfrastructureTe
sts4\Debug+AnyCPU\partcover.driver.log
[00016] [05724]   Log pipe: yes
[00016] [05724]   Count Coverage - ON
[00016] [05724]   Count Call Tree - OFF
[00016] [05724]   Exclude [mscorlib]*
[00016] [05724]   Exclude [System*]*
[00016] [05724]   Include [Tinesware.*]*
[00016] [05724]   Include [CSharpTests]*
Project : warning : CA0060 : The indirectly-referenced assembly 'Microsoft.VisualStudio.CodeAnalysis, Version=10.0.0.0,
Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' could not be found. This assembly is not required for analysis, howeve
r, analysis results could be incomplete. This assembly was referenced by: ...\Infra
structure\_Binaries\Tinesware.InfrastructureTests4\Debug+AnyCPU\FxCopSdk.dll.
[04774] [05724] CorProfiler is turned off
Target PageFaultCount: 33536
Target PagefileUsage: 84246528
Target PeakPagefileUsage: 87359488
Target PeakWorkingSetSize: 92827648
Target QuotaNonPagedPoolUsage: 10920
Target QuotaPagedPoolUsage: 328336
Target QuotaPeakNonPagedPoolUsage: 43160
Target QuotaPeakPagedPoolUsage: 374344
Target WorkingSetSize: 89481216
Total 0 bytes ...\Infrastructure\_Binaries\Tinesware.InfrastructureTests4\Debug+AnyCPU

which completed cleanly, unlike before, and gave a sane looking output file. There is now obvious code in the system for doing the short branch instruction fix-up, which seems to have resolved the issue I had last time I tried this tool.

So, it really does look good to go for .net 4 code -- and I just have to add hooks to consume that format as well as the old NCover style.

Monday, July 12, 2010

dotCover 1.0 beta -- first impressions

The beta of the coverage tool from the same people who brought you Resharper came out late last week, and I took the chance to have a quick play with what it offers.

As expected, it integrates smoothly with the R# unit test running -- you can see exactly what code your test or set of tests cover; marked in green overlay in the source view for covered by the test(s) you just ran, red elsewhere, in a manner reminiscent of NCoverExplorer.

There is also a command-line option

Usage: JetBrains.dotCover.ConsoleRunner.exe /Executable='executable' [/Arguments='arguments'] [/WorkingDir='working dir'] /Output='output' 

Not having R# at home -- because I rarely use C# even if I'm writing for .net -- it's this which interested me more. So, I gave it a try on my current F# project

>& 'C:\Program Files\JetBrains\dotCover\v1.0\Bin\JetBrains.dotCover.ConsoleRunner.exe' /executable='..\..\..\_Tools\Microsoft FxCop 1.36\FxCopCmd.exe' /Arguments='/q /s /console /f:Tinesware.Recorder.dll /f:Tinesware.Instrumentation.exe /f: Tinesware.Infrastructure.dll /f:Tinesware.Rules.dll /f:Tinesware.InfrastructureTests.dll /f:BaseTests.dll  /rule:Tinesware.Rules.dll /o:fxcop.xml  /rule:.\Rules /dictionary:..\..\..\CustomDictionary.xml' /workingdir=. /output=dotcover.xml

which yields a bald total coverage number

JetBrains dotCover Console Runner v1.0.56.11 JetBrains s.r.o.
Coverage session started [12/07/2010 20:14:16]
Coverage session finished [12/07/2010 20:14:28]
Index files: ...AppData\Local\Temp\ssc06AE2.tmp
Log files: ...AppData\Local\Temp\lgc02A14.tmp
Opening snapshot...
Done.
Generating report...
Done.
Total coverage: 78%

and an XML report file that makes it clear that that percentage is based on all assemblies dragged into the AppDomain, counting those which have no pdb information as containing no statements to cover, which means if you're running unit tests with Rhino.Mocks that it includes things like

<Assembly Name="021925b1-cbe9-42d3-ad44-a39206195c2a" CoveredStatements="0" TotalStatements="0" CoveragePercent="0">
    <Type Name="IsolatorProxyb66a653c9a984566ac790c4fa654cab5" CoveredStatements="0" TotalStatements="0" CoveragePercent="0">
      <Type Name="InvocationShouldCallOriginal_1" CoveredStatements="0" TotalStatements="0" CoveragePercent="0">
        <Member Name="HandleEvent" CoveredStatements="0" TotalStatements="0" CoveragePercent="0" />

emanating from dynamic assemblies. And it seems from simple experiment that the filters that you can apply in Visual Studio don't seem to carry over to the command-line version.

The report is formatted as shown above, with hierarchy

Root -> Assembly -> Namespace -> Type -> Nested Type or Member (repeating Type as often as necessary)

There’s also no granularity below Member, so even for code with .pdb information available the reports only look like

<Type Name="Local" CoveredStatements="166" TotalStatements="173" CoveragePercent="95">
...
        <Member Name="get_Mutex" CoveredStatements="0" TotalStatements="0" CoveragePercent="0" />
        <Member Name="ExpandFile" CoveredStatements="2" TotalStatements="4" CoveragePercent="50" />
        <Member Name="LoadFile" CoveredStatements="4" TotalStatements="7" CoveragePercent="57" />
        <Member Name="op_GreaterQmarkGreater" CoveredStatements="4" TotalStatements="4" CoveragePercent="100" />
        <Member Name="op_GreaterPlusQmarkQmark" CoveredStatements="1" TotalStatements="1" CoveragePercent="100" />
        <Member Name="op_GreaterMultiplyGreater" CoveredStatements="4" TotalStatements="5" CoveragePercent="80" />
        <Member Name="op_GreaterPlusQmark" CoveredStatements="1" TotalStatements="1" CoveragePercent="100" />
        <Member Name="op_GreaterPlus" CoveredStatements="1" TotalStatements="1" CoveragePercent="100" />
        <Member Name="GetXmlData" CoveredStatements="1" TotalStatements="1" CoveragePercent="100" />
        <Member Name="DoWithLock" CoveredStatements="1" TotalStatements="1" CoveragePercent="100" />
        <Member Name="op_Append" CoveredStatements="1" TotalStatements="1" CoveragePercent="100" />
        <Member Name="GetByName" CoveredStatements="1" TotalStatements="1" CoveragePercent="100" />
        <Member Name="SetByName" CoveredStatements="1" TotalStatements="1" CoveragePercent="100" />
        <Member Name="GetStatementRange" CoveredStatements="2" TotalStatements="2" CoveragePercent="100" />
        <Member Name="FindSignatureForMethod" CoveredStatements="8" TotalStatements="8" CoveragePercent="100" />
        <Member Name="FindXmlForMethod" CoveredStatements="7" TotalStatements="7" CoveragePercent="100" />
        <Member Name="get_DeclaredExempt" CoveredStatements="0" TotalStatements="0" CoveragePercent="0" />
        <Member Name="get_AutomaticExempt" CoveredStatements="0" TotalStatements="0" CoveragePercent="0" />
...
      </Type>

So there can be no useful equivalent of NCoverExplorer for after the fact detail – to get detailed line un-coverage information you actually have to run every one of your unit tests in Visual Studio in one big bang.

Its metric of what counts as a statement is subtly different from what NCover (free) and the other tools I've been working on recently. It reports an F# property like

let AutomaticExempt = "-2"

or an equivalent C# automatic property, for that matter, as having 0 lines, rather than N/A and 1 respectively; but that aside it seems to be counting the self-same list of sequence points.

So, it seems that this is primarily a tool for interactive use and positive coverage testing -- "Does this set of tests cover this line, and if so, which one(s)?"; in a build process environment the lack of ability to focus down to only the assemblies of interest in the report (discarding tool and system code), and of per-statement reporting it is less interesting.

However it did take the F# code which PartCover had balked at in its stride.

Meanwhile in other news

There is a branch of PartCover that supports .net 4 originally on GitHub and which has now been merged into the main-line at SourceForge, removing one of the objections to using this tool. There also seems to be rather more life in this than there was six months ago when I tried it, so I shall have to revisit it and see if the IL issue is also resolved.

Sunday, June 06, 2010

Cycling Holiday

This time based at Seckford Hall Hotel, just across the A12 from Woodbridge. This meant that going anywhere by bike meant heading west into the country lanes first; and that routes were circumscribed by not wanting to cross the A12 or A14.

After a wet day on Tuesday, driving to the hotel and dining there, the rest of the week was glorious early summer -- bright, dry, and with cooling onshore breezes holding the temperature to sensible levels.

First day I decided to strike out a long route, starting with following a cycle route across the top of Ipswich, then clipping a corner -- with a little bit of dead reckoning -- and around, arriving at Pin Mill for lunch.

Pin Mill

Pin Mill

I did a loop round Alton Water to return, and then into Ipswich and through rather than retrace the loop. There had been enough cycle provision in the bit I had done before that it seemed resonable; though on the return leg there were a lot of cyclelanes interrupted by traffic calming islands. The bit through the centre I wheeled the bike, but otherwise it was no problem.


View 2-Jun-2010 in a larger map

Second day, out to the coast, into the strong breeze; cool enough by the time I was approaching Orford to want to put a long-sleeved shirt on. This time, crossing the A12 at a cycle crossing with lights, and cruising through Woodbridge.

Castle and chestnuts

Orford Castle

Return via Snape, and a familiar route -- indeed a lot of the suggested routes on this holiday were ones I'd taken when wanting to lengthen the ride on others.


View 3-Jun-2010 in a larger map

The last day started and finished the same, and I headed up to Framlingham, to check out whether Off the Square was functional again for lunch -- alas it seemed to be re-booting (adverts in the windows for head and sous-chef; no menu displayed). So looped back after a pub lunch at the Old Mill House at Saxtead Green.

Saxtead Mill

Saxtead Mill


View 4-Jun-2010 in a larger map