Friday, November 30, 2012

43 miles to go

Due to some unforeseen opportunities for cycling. including a wonderful ride by the light of the full moon, to and from dinner out on Wednesday, I'm now closer than I had expected to my stretch goal for the year (making a total 5500 miles on my bike alone in 2.5 years) with a month to go. And with things to do over the weekend, and dry if cold weather, doing the best part of that remaining 43 miles in the next two days seems quite plausible.

Might I have to aim at 5555 rather than 5500? That would be pushing it, trying to fit in just under a hundred miles in the next month.

48 Hours Later: Two thirds of that 43 miles achieved, running errands in cold and dry (except where the sun had thawed things out by Sunday afternoon) conditions.

Tuesday, November 27, 2012

.Net under the covers

An interesting little oddity I stumbled across the other day, involving StringBuilder.AppendFormat, and a string which it turned out had had a GUID already expanded into it, and an unexpected exception result

so it looks like the parse for a number is run before checking that the format is even sane; not what one would have expected.

Recent Reading

I've actually gotten around to reading something that isn't on-line chat or technical over the last few months, so time for a round-up

The Clockwork Rocket by Greg Egan

Having skipped his intervening fantasy Iran novel, the return to physics driven story, albeit with a gimmick given away by a glance at the blurb, seemed worth a go.

Now, half the plot of his earlier Incandescence was how a woman in a pre-industrial society managed to avert an existential threat to her world by being Newton and Einstein rolled into one. Now, stop me if you've heard this one before, but the whole plot of this latest book is how a woman in a pre-industrial society manages to begin to mitigate an existential threat to her world by being Newton and Einstein rolled into one.

When, some chapters in, it became clear that this was indeed what was going on, I just went to the online auctorial physics infodump, because it had failed the "Who are these people, and why should I care?" test. One canon Sue was OK, but this got a bit too much.

Rivers of London by Ben Aaronovitch

By contrast, this book is covered with all the warning signs that normally turn me off -- fantasy, urban fantasy, secret wizards...

But there was something that seemed intriguing about it anyway, so I gave it a try. And such a contrast -- or to coin a phrase "That's the way to do it!"

And there are sequels. The second, Moon over Soho benefits from having set the scene already, and gives a chance to thicken the plot. The third, Whispers Underground then veers away from the line set by the first two into a more "secret London" sort of story, with a central mystery that wasn't really the same sort of police procedural sort of mystery that had driven the others.

Still, two out of three ain't bad. I just hope he doesn't just flog this setting to death.

Thursday, November 08, 2012

Take a hike, Wiggo.

On the news this morning, there was an item about Bradley Wiggins having been knocked off his bike and rushed to hospital -- which is not a nice thing to happen to anyone. But then they had a clip from him where in the first breath, he was invoking the sledgehammer of State against the victims.

If he'd said "I'm glad I was wearing a helmet, and I think all cyclists should.", that would have been fine; but we know that compulsion results in lowered cycling participation, as indeed does even the perception that you have to dress funny to do it. Certainly, I've cycled more since I decided that choosing headgear for the weather (to shade the back of the neck, to keep the head dry, or warm) made it more appealing than the one size fits all conditions notion of armour that I used to do.

Sunday, November 04, 2012

Out of touch?

There has been much waxing lyrical about touch UI in the last few days, from the likes of Jeff Atwood and even Herb Sutter. But somehow I don't feel that I'm in with this particular party.

Let's face it -- touch, just plain touch, has been around since the Apple Newton, and was workaday fare when it was called a Palm Pilot. And back in those days, around the turn of the century, even those 160x160 px screens and 16Mb of memory were good all-around workhorses. I had a couple of the Handspring PDAs, and later one of the Compaq palm-tops, and used them to death -- with the MessagEase keyboard, I could type as fast as I could compose, tapping and dragging the stylus; and I could do easy and accurate cursor navigation and text selection. With the PLua app, I could even code on and for the device (and have a single PalmOS app to prove it, for rolling various dice combinations for role playing games).

Fast-forward almost a decade, and I picked up one of the early and unofficial Android 2.1 tablets (the ViewQuest Slate); and though my skills on the MessagEase keyboard were somewhat rusty, I was still able to type faster than the device could keep up with, despite the ~3 iterations of Moore's law gone past in the interim. And the text selection model, combined with the necessarily fat-fingered capacitative screen, was pretty much unusable. While I could conveniently browse the web while on the khazi and compose terse forum posts, which was a plus over the old PDAs, anything that would involve quoting a section of another post just had to wait until I got onto a real computer.

This year, I've upgraded to an Asus Transformer, currently running JellyBean; and you know what? Despite the quad-core processor, the touch keyboard is still not as responsive as the Handspring one was, and is still way more intrusive. The big bonus to this device, though, is that it has a real physical keyboard and touchpad, which actually lets me select text in a way that isn't intrinsically painful.

So, what is touch good for? Well, even with the keyboard docked, scrolling pages is easier; and the multi-touch zoom makes it easy to expand web-comics so I can read the speech balloons. And I will prod at hyperlinks directly rather than use the pointer via the touchpad (except on really cluttered pages where the pointer precision is indispensable), because the tap-to-activate isn't in my muscle memory at all.

Overall, the device is something that suffices for me as a connection to the Wired when I'm on a cycling holiday, and don't expect to do more than read mail and blogs, and post a bit in the forums (or use it, at pinch, as a camera). But it's really a tool for snacking, rather than cooking -- for example, though I used the Asus while having coffee in bed this morning, I'm now composing this post on my 5 year old laptop running Vista, because it's still simpler to cut and paste hyperlinks that way, and the touchpad plus buttons are just like extensions of my will; and as such, I don't get the urge to reach forward and physically touch the screen, because my intent already has the same effect without conscious intervention, and with greater precision to boot.

And talking the transformation of will into reality with precision, these modern touch devices suck at accessibility. If you are in a state where you are left with just limited use of one hand (and not your even your preferred one at that), a touch device becomes essentially unusable, in a way that mouse plus on-screen keyboard manages to avoid.

Side rant -- one of the things I really, really do not like, even though I now have an Android device with the full Google experience (i.e. I can use Google Play, rather than go to one of the other flaky app depots out there, or scavenge for out of the way DDLs), are websites that detect Android and divert you to a "here's our app" page. No, I don't want your copiously and sulphurously qualified app, I just want your web page written in responsive and universal HTML+CSS+JavaScript, thank you very much -- just the text and the pictures, ta, very much.

Saturday, November 03, 2012

Updating the last vsvars32.ps1 you'll ever need for x64

I've been using Chris Tavares' ultimate vsvars32.ps1 in my powershell start-up script pretty much since it was first posted. But of course, it shows its age in that it assumes you're running 32-bit, given the registry path it uses.

Now, you can hard-code based on your hardware, or assume that anything you're using nowadays is 64-bit (except, of course, when you explicitly run the x86 version of powershell); and there are various ways of detecting current bit-ness. But the simplest way of doing things is to take the behaviour-driven style of detection used as standard in JavaScript and just write

or reversing the order of the two registry keys to taste.

There are of course alternative ways of getting the path we're eventually aiming at e.g. via environment variable like VS###COMNTOOLS where the ### is a number like 90, 100 or, nowadays, 110, depending on VS version.


With the end of summer time, and temperatures getting into single figures C most of the time, this weekend it's time to declare the tomatoes and courgettes done, even the ones in the greenhouse, which have mildewed rather than ripen. One last courgette will go into tomorrow's supper as will the last picking of runner beans, and then for veg it will just be the perpetual spinach until the broccoli (last years or this) decide to come on stream, if at all.

We did actually get about a couple of pies' worth off the Bramley in the end, in the form of windfalls that had been concealed in the main foliage -- and there are still a dozen or so fruit on the Charles Ross; so the harvest may just aboue last us through the month, rather than into the new year.

Meanwhile, the car passed 7000 miles on the way home last night.

Later: The runner beans actually were enough for two dinners, so we had the last on Tuesday.