Car update
In a shock move, dealing with my insurance company was surprisingly straightforward, and everything got sorted pretty quickly.

Probably because everyone figured out pretty quickly that it definitely wasn't my fault, and the other driver's insurance company would be liable.

The worst part was spending about an hour on the phone with the insurers, where some call-centre agent basically read me all the contract details for getting my car repaired, and getting a courtesy car, and getting an insurance policy to protect me if the other insurer didn't pay up and the repair bill ended up coming back to me (which, despite being an insurance policy, is something I didn't have to pay for).

It seems like this is something they do all day, so not only are they completely familiar with the terminology, but when they read it off their screen all the words blur together, which makes everything doubly hard to understand. Also, when they've been explaining about repairs, and courtesy cars, and then rattle off some "small print" referring to "the service", it's not always clear which service they're talking about when. But when you ask them to slow down and go back a paragraph, sotheyaren'ttalkinglikethisanymore, they... start... talking... like... this... instead.

The weird part is when they go over something that seems pointless. Like "if you cancel the service within 15 days, you will then be charged for it and we won't cover it." "Uh, why might I do that? I mean, why would anyone cancel the service?" "I don't know. I can't think of any reason." "Why are you telling me this then?" "It's just something we have to make you aware of. Don't worry about it."

Surely, if you have to make me aware of something, then that means I have to understand it. If I didn't have to understand it, why bother? But in that case, why tell me things that don't make any sense?

Never mind. After all that, the next day I went to the mechanics they asked me to go to to get the damage assessed, and a guy just took some photos of the superficial damage to the body panels, noted down my mileage and a couple of other bits, and told me it would probably be uneconomical to repair. And that was that.

A couple of days later the insurance company got back to me, told me they'd determined that the car was uneconomical to repair, and they'd pay me the full value of the car in lieu of repairing it (~£750) but let me keep it.

So I took it to a mechanic near where I work and got them to actually check for mechanical damage. Even though I'd been driving it around for about a week at this point, and couldn't feel it pulling to one side or any strange vibrations, I had noticed that the wheel that had been struck wasn't entirely true anymore, and had no way of knowing whether anything was at all likely to suddenly snap or fall off.

Turns out everything was structurally sound. I just needed the wheel arch knocking out a bit to ensure it wouldn't rub against the wheel if I hit a vicious pothole, and the bumper riveting in place to make certain it wouldn't start flapping about at high speed, and a bit of (mismatched) undercoat on the bare metal to protect it from the elements. And a new rear numberplate light. That, plus a new MOT for the insurance company to let me keep my existing policy until it's original end, came to ~£150, all in.

So I made ~£600 on being hit, and now my car has authentic battle damage!
Tags: ,

Irony meter go spoing!
List of people who have petitioned for the right to be forgotten

Come to think of it, I can't quite tell if this is simply irony, or whether it's actually crossed the line into paradox. Yes, I'd like the online list of all people who have petitioned for the right to not be in online lists, please.

Minor car accident
Driving to work, I was passing a T-junction, and realised a little too late that the car coming up to the T wasn't actually stopping.

Fortunately, I was just coming out of a sharp bend in a 30 zone, so was only doing about 20mph, and the other car had slowed a lot for the junction, so they hit my left rear door/wheel arch/wheel/bumper with something more akin to an enthusiastic scrape than a proper thump. The car has a few interesting dings in the bodywork, and the rear bumper was half torn off, but no-one was hurt. (Phew!)

Also, the bumper mostly sort of clicked back into place with some careful shoving, and the car seems to still be drivable while the insurance is in the process of arranging estimates, repairs and hire cars. It sure is a sturdy old thing, despite the many annoying idiosyncracies it's picked up over the years.
Tags: ,

Terminator fanfic movies
As I mentioned in the pub on Friday, if you're a fan of either franchise and you've not seen this, then it's worth checking out: The v. stylish animated short (<5 min) Batman versus The Terminator

While I was looking for the above, a still for a T5 fan-trailer caught my eye, and I was compelled to check it out. Normally fan-trailers/fan-movies made from cobbled-together bits of other movies/shows don't really work very well, but I thought Movie Dood did a fantastic job of this one. Around the key-change at 2:05, I got goose bumps. Now I really want to see this nonexistent film, dammit! Terminator 5 Trailer.

Lard reminder
We're doing the 2nd Wednesday this month, Aug 13, at Street Food Chef on Arundel Street, 7:30pm. Meet in the Rutland beforehand for drinks.

Australia bans reporting of multi-nation corruption case involving Malaysia, Indonesia and Vietnam
The case concerns allegations of multi-million dollar inducements made by agents of the RBA subsidiaries Securency and Note Printing Australia in order to secure contracts for the supply of Australian-style polymer bank notes to the governments of Malaysia, Indonesia, Vietnam and other countries.

§4. The prohibition on publication in order 1 applies throughout Australia. Well, that's all right then. ;-)

Gilded Rose reflections
A few days ago I linked to the talk All The Little Things by Sandi Metz, which is about about creating small objects while programming, using the Gilded Rose kata as an example.

It makes heavy use of refactoring under test driven development (TDD), of which more later.

Of course, it infected me too, and I had to have a look at it.

First, I'll admit, having seen Sandi's talk, I am completely indebted to her for having seen through to the core of the problem, and outlining a strategy of isolating the special cases as being the key to solving it.

Also, while I don't identify as being boolean-impaired, I still find the original code a little intimidating. So, I decided to try and do my refactoring in as stupid a manner as possible, learning only as much as I needed to as I went, and only trying to understand the labrynthine conditionals when it became necessary.

So, I grabbed a copy of the kata from the internet.

Original codeCollapse )
Now, because "Aged Brie" is the first case mentioned in the code, that's the one I'm going to factor out first. The way I'm going to do that is to use an "if" to create one code path for "Aged Brie", and the "else" for everything else, and then I'm going to put all the code in both halves of the if statement:

Double troubleCollapse )
OK, that's a lot of code. The thing is, now I can simplify the first half because I know that items[i].name is always "Aged Brie", and I can simplify the second half because I know that items[i].name is never "Aged Brie". So there are places I can cut clauses out of "if" statements, places I can remove the "if" statement leaving just the body, places I can delete entire "else" clauses, et cetera...

Mmmmm.....brieCollapse )
Not bad. Now I can do the same thing with "Backstage passes". Create a new clause in the "if" chain, put all the code from the "else" statement in there, and then simplify both pieces:

Backstage passes!Collapse )
From there, even for those who are boolean-impaired, it's not that hard to figure out that no changes ever happen for "Sulfuras". Still, I'll add a new clause, copy the code and simplify as before, to get the "final" version of the code for this post:

Code CompleteCollapse )
Note that I did all that without really needing to understand what those massively nested "if" statements were doing, or even understanding what any of the tests do.

I just had to copy code, reduce some "if" clauses to "true" or "false", and then cut away code which was obviously useless or unreachable. If I had tests (the version I found didn't have any, unlike Sandi's) then they would be useful to ensure I hadn't made a stupid mistake. But I didn't need them as a guide to writing any new code.

Obviously, there's more work that could be done. The "x = x - 1" can be made more readable by transforming it to "x -= 1", some of the nested "if"s can be simplifed by using "&&", and if you wanted you could move the body of each case into its own function (or object). But right now the code is tractable, and adding "Conjured" is a case of following the new pattern.

And if that were it, my curiosity would have been satisfied, and you wouldn't be reading this.

But...Collapse )

It's normally a mistake to rewrite from scratch, unless you really understand what your code is doing, and why. Even if you have good tests. Good tests can be a massive help, but they can't save you every time.

This equine corpse is not yet a pulpy mush; must be beaten again.
Although, fittingly, this article is actually a post-mortem.

Why the Vivaldi tablet never came to market
All in all, Seigo found the effort to launch open hardware devices "amazingly stressful at times." Yet, asked if he would consider another effort, he replied, "Crazily enough, yes." He would currently be unable to finance it to the extent that he did MakePlayLive, but he would definitely like to try again. "Beyond all other things, I really hope that people see what we did as evidence that it is worth trying, rather than taking it as a lesson that it can't be done."

Vantablack, the blackest black. (Ultrablack, part 7)
Scientists develop a material so dark that you can't see it...
A British company has produced a "strange, alien" material so black that it absorbs all but 0.035 per cent of visual light, setting a new world record. [...] It is so dark that the human eye cannot understand what it is seeing. Shapes and contours are lost, leaving nothing but an apparent abyss.

(via /.)


One step closer to properly reusable spaceflight...
...and not that strip-down-and-rebuild-the-whole-engine-and-go "reusability" that the Shuttle had, but a proper refuel-and-go system.

SpaceX Soft Lands Falcon 9 Rocket First Stage
This test confirms that the Falcon 9 booster is able consistently to reenter from space at hypersonic velocity, restart main engines twice, deploy landing legs and touch down at near zero velocity.

If this can cut their current launch costs by 90% as they predict (it gets so much cheaper when you don't have to build a new rocket every time) then a new era of proper space exploration could be nearly upon us...