I often describe myself as “a late convert to mathematics” and it's about time I explained what I mean.

From my early teenage years, I was a radio ham and an electronics hobbyist. I was pretty certain that I wanted to be an electronic engineer from the age of about 15, but, somewhat unusually for a would-be engineer, I intensely disliked mathematics. Everything else came very easily to me, maths required effort, and I was very lazy. I was also somewhat unfortunate in having maths teachers who were, shall we say, less inspirational than, say, my physics and chemistry teacher. I regarded mathematics as something of a necessary evil. I had to repeat maths to get the grade needed to get into engineering, despite good grades in everything else.

For three years of engineering, I struggled with maths. Spending too much time in the bar and not enough in the library didn't help, but as in school, pretty much everything else came very easily. I broke up with a girl the night before my third year maths final, failed spectacularly, and had to repeat in the autumn. Then, while studying for the repeat, something happened…

I had a mathematical epiphany. I was studying moment-generating functions and noticed their similarity to Fourier transforms. Then I started seeing other previously unnoticed connections between areas of mathematics I'd previously studied and it was interesting. Before that time interesting and mathematics were not two words I would have in the same paragraph.

I passed my third-year repeat maths exam comfortably; not a stellar performance, but more easily than I ever had before. Then, in my final year, my continuous assessment grade in maths was 96.25%. For the 3.75% that I lost, the lecturer called me into his office: he told me that one of my solutions was wrong, so he couldn't give me that marks for that problem, but he was intrigued to know how in hell I'd come up with it; he dubbed it interesting and creative… but wrong. Not the worst way to lose a few marks, I think. The final was of the “8 questions, pick 5” type and there were 6 questions I was perfectly comfortable with. I was then, and still am, somewhat slow when writing and particularly when working with mathematics, and only got 4 questions done in the available time. It was frustrating not to have time to do another question, which would've been easy. My exam grade was bang-on 80%. I got everything I was able to answer right, something I'd never, ever done before. The only thing that stopped me getting 100% was a lousy half-hour.

Since then, I've been particularly interested in connections between different areas of mathematics. Fundamentals, category theory, logic. Last year I took courses in abstract algebra and advanced logic. I loved them, but basically didn't have the mathematical chops to develop my knowledge and skills in the available time to be certain of a 5 (a Swedish “A”) in the exam — I never sit exams to “just pass”, instead I regard them as tests of my own understanding of the subject matter, which I expect to be complete before I'll sit an exam — so I haven't sat either exam yet. Unfortunately, my mathematical background, and the 10 intervening years between the times I've studies mathematics seriously, means that there are huge gaping holes in my knowledge.

Finally, there's one more thing that I've come to understand. Mathematics is an intellectual botanic garden of transcendent beauty, and mathematicians are the custodians and botanists who tend the flowers and breed new orchids. The attitude of most engineering students to mathematics is akin to rudely tramping through the flower-beds in hob-nailed boots, uprooting ornamental flowers to use for pig fodder — mea culpa, mea culpa, mea maxima culpa — to all of the maths lecturers I had in college: I'm sorry. Really. I get it now. I'm sorry.

Over at Pharyngula people often ask how to install killfile, which selectively hides comments in blogs.

Here's how.

First, it's assumed that you're running Firefox. AFAIK, there is no analogous functionality for other browsers (please comment below if you know otherwise).

Now:

  1. Install the Greasemonkey user script extension.
  2. Restart Firefox
  3. Install the killfile script by clicking on the large black Install this script button at the top of the page.

Now, when you load a page on ScienceBlogs (and any of several other blogs) each post will have two new bits of hot text in the Posted by: line: [kill], which hides all comments by this poster in every thread; and [hide comment], which hides only the single comment.

In place of a hidden comment, a one-line notice appears saying “Comment by User Foo blocked [unkill] [show comment]”. Clicking on [unkill] reveals all of the posts by that user; clicking on [show comment] reveals just the single comment.

Over at Pharyngula, people regularly ask how to format posts in particular ways. Here's a rough guide to the half-dozen most common things people want to do.

In all cases, you use HTML (or HTML-like) tags, which (with a few exceptions) occur in opening/closing pairs with your text in between, like this (for an imaginary tag “foo”): <foo>some text</foo>. You have to be very careful to get the syntax right or you will get unexpected results. Preview is your friend.

Quoting

In order to quote a previous text, use <blockquote>. If you write

“<blockquote>John McCain is a tool.</blockquote>”, it comes out looking like this (indented and possibly with other decoration, such as a bar down the left):

John McCain is a tool.

Italics

You can get italics with <em> or <i>, like this: “John McCain is <em>definitely</em> a tool” produces “John McCain definitely a tool”.

Bold

You can get bold with <strong> or <b>, like this: “John McCain is <strong>definitely</strong> a tool” produces “John McCain definitely a tool”.

Strikethrough

You can strike text with <s>, like this: “John McCain is <s>not</s> a tool” produces “John McCain is not a tool”.

Underline

You can underline text with <u>, like this: “John McCain is <u>such</u> a tool” produces “John McCain is such a tool”.

Links

You can produce links with <a>. The text to be linked appears between the elements, and the URL appears in the href attribute. “<a href="http://www.google.com/">Google</a>” comes out as “Google”. Note that the quotes around the URL and the http:// are not optional. Also, including more than a certain number (2 or 3) links may result in your comment being held for moderation as an anti-spam measure. Preview is your friend.

Physical vs. Logical Markup

Not that it makes much difference in the tag soup that is the blogosphere, but to satisfy the pedants, I should note that the <em> element is preferred for emphasis and <i> for non-emphatic italics. Similarly, <strong> is preferred for strong emphasis and <b> for non-emphatic emboldening.

In an earlier post I said that I'd post details on how to manually remove stale diversions with dpkg-divert if anyone wanted them. Uwe Koch asked, so here it is!

Solution

The first problem is to find the stale diversions. If you type something like:

$ dpkg-divert --list
You'll get several lines like this:
diversion of /usr/lib/libGL.so.1.2 to /usr/lib/fglrx/libGL.so.1.2.xlibmesa by xorg-driver-fglrx

Since you want to filter out the ones that apply to the ATI drivers, and all of them contain fglrx, you can do this:

$ dpkg-divert --list | grep fglrx

The bit you want is the first path. You can extract that with either:

$ dpkg-divert --list | grep fglrx | cut -d' ' -f3

or

$ dpkg-divert --list | awk '/fglrx/ {print $3}'

You should get a list like this:

/usr/lib/libGL.so.1.2
/usr/X11R6/lib/libGL.so.1.2
/usr/X11R6/lib32/libGL.so.1.2
/usr/X11R6/lib32/libGL.so.1
/usr/lib32/libGL.so.1.2
/usr/lib32/libGL.so.1

You can then manually go through the list, removing the diversions one-by-one:

$ sudo dpkg-divert --remove /usr/lib/libGL.so.1.2

Alternatively, if you're highly confident in your own bash-fu skills:

$ dpkg-divert --list | awk '/fglrx/ {print $3}' | \
> while read; do \
>    sudo dpkg-divert --remove $REPLY; \
> done

The above is shown broken over four lines just so that it isn't too wide for the web-page: in practice, I would type it all on one line. This is what is “really looks like” completely: the backslashes (\) are typed in and escape the newline which must follow immediately. Bash supplies the > character at the start of each line, which is the secondary shell prompt.

Job done!

Crackergate Redux

| | TrackBacks (0)

The purpose of this post is to briefly explain the background to PZ Myers's involvement in Crackergate. This is a quick post, and lacks both links and detail. As an atheist ex-Catholic who posts regularly on PZ's site and has followed the story, I'm reasonably informed, but I'm not unbiased.

The reason for this post is to inform the staggering number of Catholics who are indignantly posting on PZ's Pharyngula blog without understanding the background. It's as if they're assuming that PZ woke up one morning and decided to piss off Catholics for no reason.

Crackergate

A 19 year-old Catholic student at UCF went to a mass organised on campus. He brought a non-Catholic friend, who was interested in Catholicism, to the mass. During the mass, he explained various aspect of the proceedings to his friend. His friend was curious to see the Eucharistic host, so at communion, Webster tried to bring the host back to his seat to show it to his friend before consuming it in the usual way. In Webster's church, this wouldn't have been a big deal as, apparently, in some Catholic traditions, it is quite normal to pray back in the pew before consuming the host.

Another student, with whom Webster had had some previous disagreements, spotted him walking away from the altar without having immediately consumed the wafer, apparently the norm in most Catholic congregations, and grabbed hold of him, creating a scene. Webster shook off his assailant and went back to his seat. She pursued him, trying to take the host from his hands. Webster tried to fend her off, putting the host in his pocket to prevent her getting it, and subsequently fled the church.

Webster demanded an apology from the other student, holding on to the host in his student dorm for almost a week before returning it.

Now, there's no doubt that Webster had a rush of blood to the head and behaved unwisely in his anger, but who can say they never made a mistake?

In the mean-time, the offended student made complaints to the university authorities, the student council, and the Catholic League. Bill Donohue weighed in with a fatwa condemning Webster Cooke. As a result, Webster received 1000's of condemnatory emails including threats of violence and a couple of death-threats from the lunatic fringe of the Catholic church. Ultimately, Webster believed that he was in real danger, which contributed to his decision to return the wafer.

A couple of media outlets picked up on the story.

PZ blogged about this crazy storm-in-a-teacup. Now, one may think that what Webster did was wrong, but it was a religious wrong and the penalty should be religious. If his priest had given him a dressing-down for his behaviour, no problem, but Webster did not deserve threats of violence and death, nor did he deserve to be subject to a witch-hunt in his secular life, with people demanding that he be dismissed from the student senate at UCF and expelled from the university. Separation of church and state: remember?

PZ was, I guess, pretty angry. In defence of this kid, he said (paraphrasing) “You think that's desecration? I'll show you desecration!”. Not being a Catholic, he said “if anyone can score me some crackers, I'll desecrate them”, which was interpreted by some as inciting disruption of religious services, but the point is that ruining a kids life over a magic cracker is grossly excessive.

Now all hell breaks loose as Bill Donohue issues a second fatwa against PZ. PZ himself now receives thousands of condemnatory emails including a number of threats of violence and even a few death threats.

A fairly common feature in the tens of thousands of posts at Pharyngula was “you wouldn't dare desecrate the Qur'an, you pussy” from Catholic posters. PZ received several communion wafers and two Qur'ans in the mail.

Today, PZ posted a photograph of some communion wafers, some pages from the Qur'an, and some pages from Richard Dawkins's The God Delusion in the bin. He held off on posting the photograph until after the garbage collection, presumably so there would be no question of the religious artifacts being anywhere other than the city landfill.

Over at Pharyngula, there's an ongoing discussion about Barack Obama vs. John McCain (This is how Obama could make me happy to vote for him).

I see a huge, if not the, important issue in this election being the balance of the SCOTUS. The new President is going to appoint at least one liberal judge almost immediately (Stevens, I think, is hanging on until there's a Democrat in the Whitehouse), and maybe two (+Ginsburg?) in his first term. If McCain gets in, I see one or two more Nino Scalias being appointed, tipping the balance firmly to the right for a long time (Scalia won't be the same age as Stevens is now for almost 20 years). The consequences could be church/state separation being compromised, Roe vs. Wade overturned, gay marriage being torpedoed, and even successful appeals to recent judgements disallowing educational crapola in schools. It could be devastating.

As an international spectator, I selfishly want Obama because I think he'll be able to use his mixed-race, mixed-heritage, international background, foreign policy education, and civil rights record to help build peace and rehabilitate America's overseas reputation in a way that another old militarist Republican WASP, up to his oxters in political debt to the hawks and the religious right, simply couldn't do. From an international perspective, Obama is damn-near perfect: realistically, the international community couldn't ask for a better prospective President.

But it strikes me that, from an American and, ultimately, even an international perspective, the SCOTUS issue could be even bigger in the long term: I really don't want American core values (1st Amendment, particularly) and education compromised for a generation.

Thoughts?

Here's the problem: you have a software package in a Subversion repository and you're using the GNU Autotools build-chain. You'd really like to have the revision number from subversion as the subminor revision in the PACKAGE_VERSION preprocessor object macro #define-d in config.h so that it automatically appears in your software.

Sounds easy enough, but it's both surprisingly difficult and surprisingly easy to achieve.

The problem is that the ways of achieving this I've found online embed something in the distribution files that require that the person building the software for installation has to have subversion or the Autotools or both installed in order to get a meaningful version number. That's a pain.

This solution requires only that the developer is working on a Unix-like system with sh, tr and a recent version of subversion installed.

The Solution

The solution is really this easy. Put the following in configure.ac:

define([svnversion], esyscmd([sh -c "svnversion|tr -d '\n'"]))dnl
AC_INIT([myprog], [0.1.svnversion], [myprog@example.com])

I also include a line like this so I can get the SVN version seperately:

AC_DEFINE(SVN_REVISION, "svnversion", [SVN Revision])

This assumes that you have a recent version of subversion installed with the svnversion program and you're developing on a Unix-like platform with sh and tr (which includes pretty well every flavour of Unix/Linux).

What this does is use m4, the macro language autoconf is built on, to define a macro, svnversion which uses the m4 function esyscmd (which calls a program and captures its stdout) to call the svnversion program and trim the bothersome trailing newline from its output using tr.

Now, one apparent shortcoming turns out to be a feature, not a bug. If you run autoreconf in a directory that's been modified from the repository version, the subminor revision number obtained from svnversion is non-numeric — it embeds information about the revisions used, not just the topmost revision — so you get a subminor revision like “42:43M”. This causes some difficulty building because the SVN_VERSION macro (if you include it), which should be be a valid C literal, is not an integer literal. So why is this a feature and not a bug? Because you shouldn't be building the software for distribution from a stale repository and this ensures that you're not doing that. In practice, it turns out to be very useful, rather than a pain, since it helps makes sure that make distcheck will fail if you've modified files and not done a svn commit and/or svn update.

On Ubuntu 8.04 “Hardy”, the ATI Catalyst 8.4 Driver .deb packages for amd64 will build from the ATI download, but one of the four packages, xorg-driver-fglrx_8.476, will not install out of the box when you try to install the packages in the usual way.

The problem is an error in the preinstall script for the package. In a Debian package, one of the things that a package script sometimes does is “divert” files. The idea is that a package can specify that any attempt by a future package to install a file having a particular name is to be handled by renaming the file to something else, or diverting it. In this way, a package can protect files from being overwritten without causing another package to fail to install. If you have customised a package-supplied file, which might be overwritten by a package upgrade, you can use dpkg-divert to protect your version.

The ATI xorg driver package uses this facility to stop MesaGL, a software Open GL renderer, from overwriting the ATI hardware drivers. That's a good thing, but the problem is that the preinstall script diverts two files to the same target. In other words, it says “instead of installing /foo/bar, rename it /foo/quux” then a second later, “instead of installing /foo/baz, rename it /foo/quux as well”. That's not allowed (because it's obviously stupid).

This accounts for the seemingly bizarre error-message that xorg-driver-fglrx_8.476 is trying to divert to a file target that it, itself, has already diverted another file to!

I suspect that the person who wrote the script copy'n'pasted the line, remembered to edit the filename to divert, but forgot to change where it was diverted to. An easy, if silly, mistake to make. ATI have made a lot of progress in providing decent Linux driver, maybe we shouldn't be too hard on them for lousy QA.

The fix follows below the fold…

In reading Nick Trefethen's Group velocity interpretation of the stability theory of Gustafsson, Kreiss, and Sundström and Group velocity in finite difference schemes, the thought occurred to me that if instability is a result of reflections at boundaries, can the theory be extended to meshes? This is somewhat analogous to reading a wave-theoretical exposition of Snell's Law and asking if the theory can be extended to anisotropic inhomogeneous media. I suspect that it can, but I don't know if it's worthwhile.

Now, the velocity of propogation of light in a medium is determined by the permittivity and permeability of that medium. From these quantities, we can also calculate the characteristic impedance of the medium. We generally think of media as linear, isotropic, and homogeneous, but this is not the case in general. We often think of monochromatic light but, again, this is not the case in general. When light passes from one medium to another, a difference in the characteristic impedance of the media leads to reflections at the boundary.

What Trefethen started me thinking was, is there a kind of “permittivity” of a grid and a “permeability” for a method which would give a wavenumber-dependent “characteristic impedance” for the grid/method combination and a different characteristic impedance for boundaries, owing to either imposed or numerically necessary boundary conditions, and allowing instability to be determined easily?

Generalising to an irregular mesh, the mesh analogue of permittivity would be a wavenumber-dependent discrete tensor. However intimidating it might sound, and however intractable it might be for a human to calculate, it would surely allow a computer to predict, given a mesh and a method, what Fourier modes would cause instability and, perhaps more importantly, where in the mesh this might arise. A potential end-product might be a software tool which takes a mesh from, say, COMSOL Multiphysics, and identifies “hot spots” (analogous to “shiny lumps” in an optical medium) where particular Fourier modes would reflect, giving rise to instability. Given the Fourier transform of a particular initial condition or forcing function, instability might be predicted and avoided by mesh refinement.

Now, it may be that this analysis would end up being equivalent to solving the problem on the mesh in full generality, or be obscenely computationally costly for some other reason, in which case, I admit, the entire idea is utterly worthless, but there's no harm in asking, right?

Someone mentioned the idea of handing out flyers outside screenings of Expelled: No Intelligence Allowed, so I drew up a list of bullet-points that I'd like to include. Of course, it's too long for a flyer, but maybe it might give someone ideas or they might pick out a few of them.

I intend to annotate this with hyperlinks to relevant online documents and other media. If you can suggest links, please do. I'm particularly interesting in a video of one of Stephen Meyer's lectures: in the Q&A at the end, an evolutionary biologist makes a fool of Meyer by describing a half-dozen precursor structures to the rotary bacterial flagellum beloved by cdesign proponentsists.

This post is dedicated to the public domain. Do with it as you wish.

About

Find recent content on the main index or look in the archives to find all content.

Get Firefox Ubuntu Linux HD DVD Media Key Fiasco Richard Dawkins Foundation PZ Myers's Pharyngula Blog
Creative Commons License
This weblog is licensed under a Creative Commons License.