Contraceptive underwear update

I did a little more looking for information on the use of special underwear as a form of male contraception. In particular I went and found the 1994 Mieusset and Bujan paper. Unfortunately for some reason McGill's subscription does not cover online access to the International Journal of Andrology, so I had to go down into the literally dusty bowels of the library. To give you some idea what I was dealing with, I picked this no-doubt fascinating book off the shelves at random:

Don't worry, the actual paper is rather less ancient, though it was in an obscure enough journal to be in the rolling stacks — gear handles and all. But find it I did, and while they sadly don't have a photo of the contraceptive underwear, they do have a diagram. Since it is conceivably NSFW, I'll put it below the jump.

Full post

ipython notebooks: second impressions

I've kept working with ipython's notebook mode; it really is very well suited to my python-as-a-scratchpad style of figuring certain things out. So I've come up with a few more comments:
  • SVG plots work fine and look better, at least for modestly-sized output (thousands of points on a plot, megapixel images). They're also bigger on the screen, for some reason.
  • Be careful with commands that generate a lot of output; they can make your browser grind to a halt while it tries to render the output of that debugging print statement in that inner loop. During this time you also can't save your document. It might be nice if ipython noticed giant output and collapsed it.
  • It would sometimes be nice to be able to collapse blocks down to a little plus sign. For example, the first block normally needs to be the imports and maybe some ipython boilerplate (setting SVG mode, for example). It'd be nice to be able to hide it while working on the rest of the document.
  • It'd be nice to be able to break up class definitions into multiple blocks (for example to be able to have rendered math explanations for each method).
  • In PNG mode, the images are included using data URIs. This doesn't work on the very old web browser I have at work.
  • If you start pushing the memory limits of your machine it can be very hard to interact with the browser enough to kill the kernel.
For me, the most important of these is embedding the output in a blog post. It already sort of works: SVG is embedded in the output HTML, and PNG is encoded in a data: URI, so it's almost enough to strip out all the contents of the body tag and paste them into an HTML editor. Of course proper display depends on CSS, but I've added all the CSS that seemed relevant into the "custom CSS" field of my blog. The output still has some weird spacing issues; in particular, input blocks are all the same height for some reason.

Edited to add: notebooks have improved a lot since this review. I'm going to write another soon.

Full post

Digital in the Facebook age

Some time ago I posted about a lovely retrocomputing-style ren'ai game called "Digital: a Love Story". The same author has pubished a sequel, titled "don't take it personally, babe, it just ain't your story". It too is lovely, and has something interesting to say about privacy. If you haven't played ren'ai, be aware that it does have some genre conventions that take some getting used to, but it is a medium in which clever writing can produce a fascinating immersive story. In this case with dollops of facebook and 4chan.

Full post

Faster-than-light neutrinos: keeping time

There's been a recent announcement of evidence that muon neutrinos may travel faster than light. That would be really weird - in particular it would pose serious problems for Einstein's theories of relativity. But even the discoverers aren't ready to claim that; they just describe their results and say they're puzzling. Personally I think it's unlikely they're right, but figuring out why not may be very interesting.

Faster than Light? par CNRS

Fortunately for us, they have posted a preprint of their paper on All images below are from that paper.

I can't say much about the particle physics, or the details of instrument calibration, but I can address one possible way people have suggested the result may be wrong: inaccuracies in the time standards at the two endpoints.

Full post

A captcha problem

Hmm. Think it would cope with \( M_2(\mathbb{Z})\tilde m \)? Or $M_2(\mathbb{Z})\tilde m$? Or just plain M_2(\mathbb{Z})\tilde m? In principle it might, since recaptcha is crowd-sourced; if I came up with the same LaTeX representation all previous recaptcha users had, all would be fine...

Full post

Male contraception

The Pill — hormonal contraception for women — is sometimes credited with making possible the sexual revolution. There is as yet no hormonal contraception for men. My feeling is that this is for real biological reasons — the female reproductive system is more complicated and easier to interfere with. And of course in the era of HIV/AIDS and other STIs, condoms have a unique role. Other methods of contraception remain important. There's a new supposedly-reversible one for men and there's always vasectomy. But there's another method for men that I'd never heard of, but find amusing: testicular heating.
[update — pictures! sort of]

Full post

Source Code

No, I mean the movie. It's science fiction, of the Twilight Zone flavour: soft, set here and now, and with a little pointed topical relevance. Jake Gyllenhaal plays a soldier who gets sent into the "Source Code", eight minutes before a terrorist attack, and told that he must do whatever he can to figure out who the bomber is. He can retry it as many times as he likes. It's very like the brilliant interactive fiction Varicella (described below the jump).

Full post

The Core

I've worked with data from X-ray satellites before, and among the many messy things one has to deal with in real data were blocks of time marked SAA. I knew this stood for "South Atlantic Anomaly", but I had only the vague idea that it was a part of the sky that was geomagnetically inconvenient, so that I had to trim it out of my data. The other day I came across a fascinating BBC documentary, titled "The Core":

This documentary talks about the Earth's core and how we're studying it, from seismology to diamond anvils to huge liquid-sodium dynamo experiments. It makes very interesting watching, but I particularly liked that they used the South Atlantic Anomaly as a hook: it caused problems with certain instruments on Hubble, and the documentary is framed as an investigation into why. (More below the jump if you're not worried about spoilers.)

Full post


When looking at the ipython notebook interface, I came across a neat tool: mathjax. It's designed to allow embedding math in web documents. Now, MathML was supposed to do this, but support for MathML is still very spotty, and it's also really nasty trying to write MathML manually. So mathjax allows you to simply enter TeX format math and have it look okay in supposedly all browsers: both inline as \(e^{i\pi}=-1\) and displayed as $$\int_{-\infty}^{\infty}f(t)e^{2\pi i f t}dt. $$

The way that it does this is kind of amazing to me: it's essentially a TeX renderer written in javascript and running in your browser. I'm used to thinking of TeX as a batch-mode compiler that takes an appreciable time to run, but TeX has become the de facto standard way to write mathematics, and there are now several reimplementations of its renderer. Matplotlib has one, for example, though it can also call out to real TeX if you ask it to. But javascript!

Anyway, as you can see above, I've added it to the template for this blog, so I'll be a little freer with math from now on. Though I'm willing to bet it doesn't work in the RSS feed. Let me know if you have any problems with it.

Full post

Review: ipython notebooks

The development version of ipython recently added a "notebook" interface mode. This resembles the interface of MAPLE or Mathematica, in which you can intermingle blocks of formatted text, blocks of code and output, and plots. My feeling, after working with it for a bit, is that it is very well suited to the kind of work I do when (for example) writing blog posts demonstrating some algorithm. For developing actual reusable software, not so much.

In order to give it a proper test, I applied it to a problem that a friend asked me about. It's about the card game Set: how often do you run into a tableau with no sets? The game quotes a figure of one time in 25, but that's for tableaux dealt from scratch. As you play the game, you remove and replace sets, and it often seems as if no-set tableaux arise more often when the cards are not freshly-dealt. The game's rules are a lovely minimalist mathematical exercise, but once you start removing and replacing cards an analytical solution becomes impractical. Simulation to the rescue! And this seemed like a nice test problem for ipython.

You can see the results here (PDF). For my comments on ipython, read on.

Edited to add: notebooks have improved a lot since this review, or the later one.

Full post
There was an error in this gadget