jang: (Default)
So I signed the contract of engagement (I'm not employed by them, with all that entails) with the University. The work's nothing like what I was doing (infrastructure architect / devops / geek without portfolio) and is actually letting me flex my coding muscles.
the day's geekery )
Saw the hot IT support girl in Pret; bought her a coffee. She took me out to lunch again. I think she likes me.
jang: (Default)
Whilst SQLAlchemy does it all automagically, nicely reminds me of Hibernate, and is basically more complete out-of-the-box, there was some whining from the local Django fanboy about dropping the ORM. So, I persisted: django-model-utils provides a cast() method that'll appropriately downcast on request.

Why you would ever not want to downcast is beyond me; however, there are cost implications to doing so (a join, perhaps a second DB roundtrip - it all depends on how clever your ORM is). Having said that, the cost in terms of this particular problem still looks low compared to what it's been doing before.

Since we're basically just using pgsql as a persistence tool, I don't really care how it may or may not split my object attributes across tables (the alternative is a big munged table with lots of NULLs; Postgres has a potential third alternative using its own inherited tables, but they all amount to much of the same thing). We're typically looking at pulling back anything from a dozen to a few hundred objects, none of which is huge; so this isn't too big a deal.

The non-geeky day

I had the damp people come and measure my kitchen again; a great deal drier, will need a repeat monitoring visit, though, and next time they'll come armed and ready to tent the party wall.

After that, I headed in late. Stopped off for the morning coffee. Louise (the Dutch girl in Pret) asked if I wanted anything with that. It wasn't clear if she was directing the question to me or the woman standing next to me, so I asked, "did you mean me, or her?" That sounds awfully brusque ("who's she, the cat's mother?") so I apologised and corrected myself: I should have said, "do you mean me or the young lady to my right?"

"Ooh," said she (the cat's mother), "I like the young part," and actually honest-to-god fluttered her eyelashes at me as she blushed. Clearly I still have it.

Anyway, having so improved someone's day, I headed into Berkeley Square. There was a chap lying on the pavement, looking up between his feet at the door to the library building. He seemed quite bemused. Having ascertained that he wasn't hurt, just embarrassed, I hauled him up slightly more carefully than I might a sack of spuds and headed inside to discover that my early-morning rant on the failings of Django's ORM had led to a mini IRC explosion. "Why would you need that?" Well, perhaps you're doing something marginally more complicated than writing yet another blog. Meanwhile, I kept a weather-eye out of the window on the old chap I'd helped up; whilst he had said he was alright (refused the offer of a sit-down, coffee/scotch, fetching any further help, etc.), he did seem to just wander around a little aimlessly for about forty minutes before picking a destination and sticking with it.

The end of the geeky day

I must confess that I was irritated by the "why would you ever want to do that?"s on IRC. The problem here is that the chap in question and I have a completely different notion of what KISS means. To me it means: express the problem simply and clearly using the tools available to you in your language of choice; to him it means: it's easier to just hack some more elifs in.

The discussion culminated with a "I'm not even sure what an abstract factory is, why would you ever want to use one of those?" to which I was, at least, able to say, "why don't you ask the Django guys why they used one for their ENGINE?"

That all is irrelevant, because now we need to figure out what approach we're going to take to support i18n in user-supplied content; this is a big deal, I think, and very hard to express in a sensible UI, too. We're pretty much at the point of being able to produce a first-pass import of the metadata from the old system into the new to figure out what's broken; it's pretty much an accident that it handles Korean at the moment.

I will probably use SQLAlchemy to cast the old system's data into an object model that our new system groks :-)

In other news, as a cunning approach to handling repeated instances of sub-forms, and the attendant issues with handling the resulting data analysis, we appear to have reinvented the computed goto.
jang: (Default)
looking downcast )

Having said that, my desktop was in place and working perfectly when I popped in last week to pre-install it, and everything that depends on the local sysadmin and/or the local IT support girl (who is a total fox, incidentally, and who invited me out to lunch on my first day) has been done in plenty of time with nary a hitch.

Oh, for what it's worth, I'm pretty much convinced that the right thing to do is to throw away Django's ORM in favour of SQLAlchemy, because it does all this - and so much more - out of the box. Yes, type discriminants are ugly; but they are a necessary evil if you want your ORM to go fast (the alternative is a bunch of speculative joins; an approach that SQLAlchemy supports for a single database round-trip). What we lose, principally, is the admin interface (for the bits that don't use Django's ORM), and perhaps some of the manage.py capability. But it still looks worth it..!
jang: (Default)
Me too. http://jang.dreamwidth.org/

Stuff, like it says, will be crossposted to LJ for the rest of the year, or thereabouts.
jang: (Default)
Nice time to get your credit-card compromised.
jang: (Default)
From the BBC:

Human rights laws can be applied to British troops on active service, a High Court judge has ruled.

Ministers are appealing against the ruling.

Nice way to support the troops, don't you think?
jang: (Default)
http://www.guardian.co.uk/society/2008/feb/26/mentalhealth.medicalresearch

So, Prozac in the usual light doses it's prescribed in is indistinguishable from a placebo. But that's not what this is about. What this is about is the following gem:

[[[
The only exception is in the most severely depressed patients, according to the authors - Prof Irving Kirsch from the department of psychology at Hull University and colleagues in the US and Canada. But that is probably because the placebo stopped working so well, they say, rather than the drugs having worked better.
]]]

Let's have that once again.

But that is probably because the placebo stopped working so well, they say, rather than the drugs having worked better.

This kind of crap is enough to put one in a mood that is as likely to be affected by placebos as SSRIs :-/
jang: (Default)
From the Guardian (and elsewhere), a position paper on NATO. What an excellent quote:

"The first use of nuclear weapons must remain in the quiver of escalation as the ultimate instrument to prevent the use of weapons of mass destruction."

Let's have that once again.

"The first use of nuclear weapons must remain in the quiver of escalation as the ultimate instrument to prevent the use of weapons of mass destruction."

If you're reading this from a NATO member state then you're more likely to die in a road accident than in a terrorist attack. But let's just be clear on that:

"The first use of nuclear weapons must remain in the quiver of escalation as the ultimate instrument to prevent the use of weapons of mass destruction."

For fuck's sake.
jang: (Default)
Turns out that the two centaur bad guys are easy to kill, once you understand how to reliably perform the adrenaline dodge.

The secret is not to treat it like a twitch game but to be running in plenty of time as the horse charges you. Then when time slows, you just tap the dodge button. I was doing the move/dodge combination in under half a second which isn't enough for Lara to actually be moving fast enough to roll out of the way.

The other thing which might help is to spot which of the centaurs is going to charge you: when an enemy rages, there's a small orange flash around their head. You can lock on (with L2) at that point to the one who is going to charge, which helps with camera angles etc. I have no idea if the lock is necessary to perform the head-shot, but having done this right the first time I tried it (thanks to Ruth for actually trawling through a million internet posts saying, "I cannot perform the adrenaline dodge!" until she found one with a useful description) I wasn't about to blow it on trying again.

Still can't use the move against the smaller raging monsters, but typically the shotgun to knock them down followed by the desert eagles to finish them off does the trick.
jang: (Default)
... so here's the idea. Take a dozen or so of the usual misfits, chuck them in a house for 10 weeks or whatever it is. Usual production team making up pointless and barbaric rules as they go along.

And don't screen any of it.

When the housemates nominate evictees, the one chucked out is selected by the toss of a coin. They go outside to find a waiting taxi. When they get in you might film five minutes of their expression as you tell them that they haven't been on TV for the last how long. You whisk them home and don't broadcast the resulting 30 minutes of total footage for at least two years.

For added bonuses the capricious producers can repeatedly lower the prize money (because it's clearly not about the prize money anyway, that wouldn't be Keeping It Real, would it?) until the value of "winning"* is 15 bob.

Now, I'd pay to not see _that_.

* The only way to win is not to play the game.
jang: (Default)
then back from Paddington. Bloke sitting opposite me was in a wheelchair, bald with a scar over one eye. As we passed through Reading station, he looks up and says, "curses! I was meant to go to Brighton!" "Don't worry, Blofeld," says I, and pull the emergency cord. "Your train of error stops here."
jang: (Default)
These unmarried lesbians lost their bid to get their marriage legally recognised in the UK. The government's defence was that, since the rights due to a married couple are identical to those of a civil partnership (which, note, Ruth and I cannot enter into - unless, possibly, we both claim to be gay) there can be no discrimination. Why, then, prevent them applying the label of marriage to their union?

Summary: I disagree with the decision. Having said that, if a bunch of greengrocer's went to court to get their misuse of an apostrophe legally recognised, I'd be one of the morally outraged crowd who couldn't see past the syntactical issue. Conclusion: I am a hypocrite. (But God intended that an apostrophe be used to indicate possession or an elision of letters, not a plural form, dammit.)
jang: (Default)
The register is a rag, let's face it. Here's an example: Code inheritance and reuse: a delicate balancing act. Read down the first page.

[[[
Changes to the external protocol

When a subclass adds new methods that are available outside the class, it changes the external protocol of the superclass. This happens in a number of different situations:

...

* The subclass restricts methods provided by the superclass. This may include removing methods, or changing method parameters to types that are more restrictive. Currently, there is no way in Java to restrict the methods inherited from a class.
]]]

Nor will there ever be. How very 90s: the author doesn't understand what "is-a" means. Clueless feckwit.

Note, it's perfectly OK for a subclass to provide a method that accepts broader types as parameters, or whose return type specification is a subtype of the parent method's. (Although the JVM has a little trouble with this due to the way it locates methods; you have to fake this, but that's an implementatino detail.)

One might find it surprising that the author doesn't mention contracts in his discussion of componentisation. On the other hand, the error here wouldn't be made by someone who understood them.
jang: (Default)
Each person in the world with a handheld calculator would still take decades to do the same calculations Blue Gene is now able to do every second.

Rather ambiguous, that. But I can understand how an innumerate "journalist" might think it would take "decades" for a single person to perform 40-50,000 floating-point additions or multiplications with the aid of a calculator. Even if you assume it talks about the population of the world who now possesses a calculator, I still think they could put in 280 trillion operations in under a year.
jang: (Default)
Or spell either. Something's wrong.

For what it's worth, I don't think I had any hallucinations last night after all, so maybe Sudaca food wasn't responsible for my previous trippy night.
Page generated Aug. 22nd, 2017 12:44 pm
Powered by Dreamwidth Studios