Wednesday, December 31, 2014

December cycling

This month I only used the old bike, and the trips I logged on the Cycle Challenge site came to 293.7; but my bike odo ended at 11040.7 or 291 miles -- but I did have a couple of drop-outs. So comfortably over the 4200, possibly up to 4215 for the year.

That includes a couple of runs in the cool and occasionally bright holiday weather; one of which took in the first stretch of the Roman road, which was good firm going, apart from the bit near the Fulbourn road where vehicles crossing had pounded it into deep ruts and slurry -- indeed some vehicles crossed as I approached that bit, and while I dismounted to carry the bike across, the sound of revving of engines suggested that all was not well with the hindmost of the convoy. I watched him fail to do anything but dig in deeper for a while, before heading on, having had my daily ration of schadenfreude.

Now, can I beat that distance in the coming year?

Monday, December 01, 2014

PowerShell -- dynamically typed, except when it isn't

Consider

PowerShell is dynamically typed, so it should just work, right?"

Wrong. The output goes

System.Xml.XmlDocument
System.Xml.XmlDocument
Cannot convert value "23" to type "System.Xml.XmlDocument". Error: "Data at the root level is invalid. Line 1, position 1."
At line:5 char:3
+ $y <<<<  = 23
    + CategoryInfo          : MetadataError: (:) [], ArgumentTransformationMetadataException
    + FullyQualifiedErrorId : RuntimeException

So you can make static typed values, but can't even tell by inspecting the object whether it's static type or not. Combine this with the loose scoping that makes separate scopes nigh impossible (unless you want to write a proper closure, when it doesn't work), this makes little local scratch variables a lurking menace in any non-trivial script.

If only more people would get with the program and use F# as their .net scripting language.

November cycling

The numbers for the month are 10749.7/890.7, plus 3 miles where I noticed the odo drop out or +145.0/+145.1 or 293 miles, so 3921 miles year-to-date, lower than it might have been due to a couple of days where I needed to work from home, and with most weekends being at home too; but starting to be affected by bad weather too.

So, 4000 will happen; but with more home-working on the cards, 4200 will depend on how much I manage to get out for rides in the country at the end of the month.