Posted on 23 October 2008 at 22:05
Filed under (diary) by Pete

At home (Cowplain, Hampshire) my family has been getting milk delivered to the doorstep in 1-pint glass bottles basically forever. I don’t remember a time when we usually bought milk from a shop/supermarket along with the rest of our food, though we have done it on occasion (usually on a Sunday, when Friday’s milk wasn’t quite enough for the whole weekend and Monday morning before the milkman comes). Despite that, in the 4 or so years I’ve been living in Swansea (actually 5 years, but I was in Germany for the 3rd) I’ve bought my milk in plastic bottles of 2 or 4 litres from a shop.

This year, for a change, I’m living in what might be considered a household of more than one person, so we buy milk for 4 or 5 people at once. That needs to happen a couple of times a week, but it’s a bit inconvenient to go shopping for 5 that frequently (we’ve only actually had two communal shopping trips since I moved in at the start of the month). Moreover, I really hate throwing away a 6 litre plastic bottle every week; glass bottles from the milkman, which get collected and reused, don’t consume (much) oil in their manufacture and don’t go into landfill, so are far more environmentally friendly. So I decided to set up milk deliveries. Observing our milk consumption before that point I decided we’d need about 3 pints on Monday and Wednesday and 5 on Friday (to cover the weekend). And the consensus was to get semi-skimmed. So on Friday morning a couple of weeks ago five pints of milk appeared on the doorstep.

Five pints of skimmed milk.

Well, sometimes that happens. The milkman might not have had 5 pints of semi-skimmed available when he got to my house. (Usually though you manage to get a pint or two of the right kind and the rest of something else.) So I put up with it, and we used the milk over the weekend.

On Monday, there appeared on the doorstep three pints of skimmed milk. And again on Wednesday, and another five pints on Friday. There was still a pint or two left over from Friday when we got Monday’s milk, partly because skimmed isn’t as nice as semi-skimmed so we didn’t use as much, but also because it was starting to go off, despite being kept in the fridge and its best before date being Wednesday. (I’ve always thought skimmed milk tastes like it’s started to go off even before you get it.) I checked the order on two occasions to make sure the order was actually for semi-skimmed (annoyingly you can’t actually view your existing order on the Dairy Crest website) but still we kept getting skimmed, and it went off before it was supposed to.

This Monday I got the bill. Pricing on the Dairy Crest website for ordinary milk is “at current prices”. Now I found out that it costs 58p per pint, about twice as much as getting it from Tesco. I expected it would be more expensive since they have to deliver it, but for stuff that doesn’t taste nice and goes off prematurely so we end up throwing half of it away, that’s just not acceptable. So today I cancelled the order.

So this little experiment lasted about two and a half weeks, and was thoroughly unsatisfactory. A crying shame. Surely the milkmen in Uplands can’t be that much less competent than the ones in Cowplain?

(1) Comment    Read More   
Posted on 3 July 2008 at 17:17
Filed under (legal, rant, news) by Pete

We all know the USA badly needs some sane data protection legislation, and this is a good illustration of why:

Yesterday, in the Viacom v. Google litigation, the federal court for the Southern District of New York ordered Google to produce to Viacom (over Google’s objections):

all data from the Logging database concerning each time a YouTube video has been viewed on the YouTube website or through embedding on a third-party website

The court’s order grants Viacom’s request and erroneously ignores the protections of the federal Video Privacy Protection Act (VPPA), and threatens to expose deeply private information about what videos are watched by YouTube users. The VPPA passed after a newspaper disclosed Supreme Court nominee Robert Bork’s video rental records. As Congress recognized, your selection of videos to watch is deeply personal and deserves the strongest protection.

(Fortunately this ruling appears to be illegal, but you can easily imagine that less-rich companies couldn’t afford to appeal.) Time to log out of YouTube and start using Tor.

(2) Comments    Read More   
Posted on 18 April 2008 at 13:24
Filed under (politics, QOTD, language) by Pete

I have always been of the mind that when you visit a foreign country you’re the one that should make the effort to communicate with the locals. Speaking your birth tongue slower and louder doesn’t make yourself any more understandable, it just makes you look like a jackass. The onus to learn the local language is even heavier if you’re an immigrant. After all, you’re the one asking for the privilege of becoming a part of someone else’s community. That means you can bloody well learn the language; you don’t even have to succeed, you just have to show that you’re willing to try.

Illiad (author of the webcomic UserFriendly). The subtitle is “Not multiculturalism, but covert colonialism”, the idea being that (for example) a Chinatown in Vancouver where nobody speaks English is a colony, in the worst sense of the word. Perhaps not everyone is interested in learning a language for its own sake like I would be (the only reason I don’t learn more languages is lack of time), but when the language is entrenched, not making the effort to learn it is simply rude.

(0) Comments    Read More   
Posted on 21 March 2008 at 01:43
Filed under (news) by Pete

Arthur C. Clarke died yesterday (OK, the day before yesterday) at the grand old age of 90.

One of the last of the Golden Age writers, one of the best and most foresighted, and probably the most optimistic. He will be missed.

(0) Comments    Read More   
Posted on 19 March 2008 at 22:52
Filed under (computing, thinking aloud, code) by Pete

I’ve been pointed to a post by Joel Spolsky advocating Hungarian notation so that code that fails to properly sanitise strings “looks wrong”.

Here’s Joel’s example. The idea is that you prefix the names of all string variables and functions returning strings with either “s” or “us” depending on whether they’re safe or unsafe respectively. Then assignments that have “s” on one side and “us” on the other just look wrong.

us = UsRequest("name") // ok, both sides start with US
s = UsRequest("name") // bug
usName = us // ok
sName = us // certainly wrong.
sName = SEncode(us) // certainly correct.

Well I can think of one pitfall already. How do you mark whether a function expects safe or unsafe data in a way that makes wrong code look wrong?

us = UsRequest("name") // okay
RandomMangler(s) // okay
RandomMangler(us) // errm... wrong?

If you’re using a language that supports it, there is a far better way. Read the rest of this entry »

(0) Comments    Read More   
Posted on 26 February 2008 at 01:35
Filed under (language) by Pete

If you thought it was hard to remember the gender of French nouns, take heart: apparently French people don’t always get it “right” either.

Depending on your perspective, this says something about either the silliness of French grammar or the factual authority of dictionaries. (Personally I think written French is silly for still inflecting adjectives for number when the spoken language did away with that centuries ago, but calling gender silly would be going too far.)

(0) Comments    Read More   
Posted on 15 February 2008 at 21:44
Filed under (philosophy, QOTD, language, funny) by Pete

Vagueness is standardly defined as the possession of borderline cases. For example, ‘tall’ is vague because a man who is 1.8 meters in height is neither clearly tall nor clearly non-tall. No amount of conceptual analysis or empirical investigation can settle whether a 1.8 meter man is tall. Borderline cases are inquiry resistant. Indeed, the inquiry resistance typically recurses. For in addition to the unclarity of the borderline case, there is normally unclarity as to where the unclarity begins. In other words ‘borderline case’ has borderline cases. This higher order vagueness shows that ‘vague’ is vague.

— Roy Sorensen, Stanford Encyclopedia of Philosophy, “Vagueness” (from Language Log).

(1) Comment    Read More   
Posted on 9 February 2008 at 02:27
Filed under (play, code, Haskell) by Pete

At freshers’ fayre (yeah, a long time ago now) I was handed a slip from Mensa. I intended to follow it up later but being busy I never got round to it. Today I rediscovered it on my desk, and of course it had a couple of puzzles on it. One is a pretty simple number sequence. The other has you find an anagram:

Rearrange the letters of ‘ANY TIME‘ to give a seven letter word. What is it?

Obviously “anytime” is excluded (well, we’re not Americans ;). I tried to find one manually for a while, but then realised I could just solve it with a couple of commands:

[pwb@rhuidean ~]$ ghci -e 'Monad.mapM_ putStrLn (let s = "anytime" in filter (\s2 -> all (`elem` s2) s) $ Control.Monad.replicateM 7 s)' > words
[pwb@rhuidean ~]$ grep -f words /usr/share/dict/words

This was taking a long time. But then I realised you can cut out a big chunk of the search space by filtering out all the non-anagrams, which you can do easily with grep.

[pwb@rhuidean ~]$ grep '^[anytime]{7}$' /usr/share/dict/words | grep -f words
amenity
anytime

I wonder how this reflects on my intelligence… :)

(0) Comments    Read More   
Posted on 22 November 2007 at 18:19
Filed under (politics, QOTD, funny) by Pete

“The fact that there has not been a serious incident involving liquid explosives indicates, I would have thought, that the measures that we have put in place so far have been very effective.”

Ah, that’s how. On which basis the measures against asteroid strike, alien invasion and unexplained nationwide floods of deadly boiling custard have also been remarkably effective.

— From The Register. (Yes, it’s old, but I’ve been behind on Bruce Schneier’s blog.)

(0) Comments    Read More   
Posted on 31 August 2007 at 20:55
Filed under (philosophy, QOTD, funny, comics) by Pete

A non-textual one this time:

Free Beer? Anything is possible!

– From Wednesday’s Girl Genius strip.

(0) Comments    Read More