Thursday, October 07, 2010

A season in the saddle

Three months ago, I finally got around to getting a cheap and cheerful trip computer for my bike. Three months later I have done 767.4 miles at an average of 11 mph, as well as measuring that the final part of my journey to work that I couldn't measure with the car odo, starting with an off-road part, comes to just over 1.6 miles each way.

This also measures up to my order of magnitude guesswork that I average closer to 2000 miles in the saddle each year than 1000.

Tuesday, October 05, 2010

Computing per-service SIDs without sc.exe

How it's done is well known:

When configured to have a per-service SID (i.e. type of SID either "Unrestricted" or "Restricted"), the service SID is computed as S-1-5-80-{SHA-1(service name in uppercase)}

Here's a quick script to do it, that can be the basis for including the computation programmatically into e.g. installer generation.

So running it we get:

>& 'C:\Program Files\FSharp-2.0.0.0\bin\fsi.exe' .\ssid.fsx MyService
S-1-5-80-517257762-1253276234-605902578-3995580692-1133959824
>

which compares nicely with:

>sc showsid MyService

NAME: MyService
SERVICE SID: S-1-5-80-517257762-1253276234-605902578-3995580692-1133959824
>

where each of the 5 trailing facets is just the decimal representation of 4 bytes of the SHA-1 hash taken as a little-endian unsigned integer.

Saturday, September 25, 2010

Film — True Legend (Su Qi-Er)

Woo-Ping Yuen's latest chop-socky film about Beggar Su, the master of Dunken Fist wu-shu had its UK première here this evening.

It was almost solid martial arts mayhem, with just a few pauses for breath; however the structure of the film was a bit of a mess -- the intrusive 'now put on your 3D glasses/OK take them off again' around the training arc and what looked like it was going to be the Boss Fight didn't help (nor did the 3D itself where the actors often seemed to be floating detached from the rather washed-out scene around them.

The story itself seems to be a fairly direct one about Su and his adopted brother Yuan who spurns the generosity of his adopted family, and cue two-way revenge tragedy -- then just when you think it's all over, a long coda culminating in the real Boss Fight out of nowhere.

Clearly it must be following the high points of a well known tale -- but it ends up feeling unresolved because of the broken narrative rhythm, whereas stopping at the tragedy of the 3/4 mark would have given closure (if you don't ask too deeply why a martial artist of Su's calibre would dig a box out of sandy ground with his bare hands, rather than using some one-inch-punch technique to break open the lid in situ).

In all, not entirely satisfying popcorn fare.

Wednesday, September 22, 2010

Film — Henri Quatre (Henry of Navarre)

Added to the Film Festival programme after the program went to print, a competently done edited-highlights costume drama (German production, dialogue in French with some Italian and Latin) of the life and turbulent times of the eponymous French King.

Not something I would have gone out of my way to see, had I not already earmarked this week for the festival, but equally not something where I felt I'd wasted the afternoon.

Sunday, September 19, 2010

Anime — Kemono no souja Erin

Where 2007's Seirei no Moribito adapted the first of a series of ten novels by Nahoko Uehashi over 26 episodes, this 2009 series adapted the first two of a separate quartet of hers over 50 episodes; and while they are, in broad, fantasy, there is none of even the limited magic from the Moribito series.

We follow Erin -- crabapple -- for a decade or so from her childhood, where her mother, Soyon, tends some of the ferocious war lizards -- touda -- that the Grand Duke of the land employs as the ultimate weapon against potential invaders, and Erin herself is a keen observer of her mother's craft and of the natural world around her. As an outsider, from a despised people, who had only married into the touda raising village, Soyon is the obvious scapegoat when the whole colony fall to some mysterious sickness.

Literally cast adrift after her mother's death, Erin is eventually fostered by a kindly bee-keeper, under whose care she discovers more about the natural world -- and encounters for the first time the ohju, the wolf/roc lord beasts with their iridescent plumage. Being fascinated by these creatures, and nature as a whole, she finally manages to be inducted into the prestigious school-cum-ohju care centre near the capital, in the peaceful lands of the True Queen, whom the Grand Duke protects.

And as Erin takes to her craft, and violates all manner of traditions of ohju-care in doing so, politics and dissension amongst the successors of both the throne and the dukedom brew up and engulf her, against all her desires, until a final resolution that changes the status quo forever.

Being spread over so many episodes, the pacing is glacial during the first arc, until Erin is cast into exile (part of the reason why this review is somewhat belated); but once that is past, and the story starts to move, albeit at a leisurely pace, it becomes gently compelling, in the same quiet way that Aria is.

It is clearly an anime aimed at younger children -- not only are there some comic relief characters whose function is purely that; but the last episode concluded with an announcement that there would be a 10 episode summary then broadcast on an education channel. As such, where there is violence involving touda or ohju, the art moves from realistic to an effective highly stylized mode; and the person-to-person combats are almost bloodless; this being Japan, though, there are several themes, including Erin's preference for suicide to being used as a tool by any of the competing factions, that are probably not sanitizable for sensitive Western tastes.

Overall, good, but not great. Being on Crunchyroll, it's viewable without fansub guilt -- but equally it's unlikely to make it to DVD.

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.