Spread Firefox Affiliate Button

Pages

XULRunner Nightlies now available

As Mossop mentioned, I’ve been working for the past week on getting XULRunner nightly builds up and running.

I’m happy to announce that they’re now available!

The first builds of XULRunner for Linux (i686 and x86_64), Windows and OS X (i386 and ppc) for both mozilla-1.9.1 and mozilla-central (1.9.2) are finishing up, and are available (or will be soon!) at http://ftp.mozilla.org/pub/mozilla.org/xulrunner/nightly/. Fresh builds will be available every night.

Enjoy!

Around the Bay Race

I ran my first Around the Bay Race yesterday!

I was pretty nervous when I got up Sunday morning at 6. It was pouring rain, and the weather forecast for Hamilton said that the rain wouldn’t be letting up until the afternoon. I also had to really ease up on my training over the last 3 weeks due to a cold. I tried pushing myself to do the long runs with the cold, but I could barely manage to finish 5km.

I managed to force a bowl of oatmeal down my throat, along with a few cups of coffee, despite my nervous stomach. I knew I’d need the energy from the oatmeal, and I didn’t want to deal with caffeine withdrawal during the race!

When we arrived in Hamilton, it was still pouring rain. Ugh. And 5°C. Ugh. At least it wasn’t freezing rain!

I felt a bit cold in the first few kilometers, but after my body warmed up I was pretty comfortable. I concentrated on having a comfortable pace; I didn’t want to burn out too early. I started out behind the 3:00 pace bunny, and passed him around 10 kilometers in. Those first 10 kilometers really flew by. I was doing around 5:30 per kilometer and feeling pretty relaxed, with plenty of fuel still left in the tank. The rain was still off and on, but I didn’t really notice.

After crossing the bridge and turning west along North Shore Boulevard, I knew the hardest part of the race was coming up. It’s about 9km of hills, finishing with one killer hill just past the Woodland Cemetery. I was actually really excited when I got to that hill. I had done it before, so I knew what to expect. I had plenty of energy left, and so I really powered up the hill. After getting to the top, I felt like I had all but finished the race! There were a little more than 3km left to go, on pretty much flat ground.

Man, those last 3km were killers. I was running into the wind at that point, and my knees were starting to protest against all this abuse. My average pace had slowed to 5:48 by this point, and my current pace was around 6:10. I tried to speed up a bit, but my legs just weren’t listening any more. I had wanted to finish with an average pace of 5:45, but by this point in the race I knew that wasn’t going to happen, so I concentrated on just finishing. Those last few kilometers went by very very slowly.

Finally, the Copps Coliseum was in view. Only a few hundred meters left! Entering the coliseum was a great feeling; I found the energy to pick up my pace a little and make a strong finish. And nothing was better than having Melissa and Thomas there to greet me after I finished!

Overall, a great race despite the weather. Now I need to figure out if I should sign up for the Mississauga Marathon!

The official course map is available on Google Maps, or my GPS track is available on MapMyRun.com (hopefully I followed the course!)

Exporting MQ patches

I’ve been trying to use Mercurial Queues to manage my work on different tasks in several repositories. I try to name all my patches with the name of the bug it’s related to; so for my recent work on getting Talos not skipping builds, I would call my patch ‘bug468731′.

I noticed that I was running this series of steps a lot:
cd ~/mozilla/buildbot-configs
hg qdiff > ~/patches/bug468731-buildbot-configs.patch
cd ~/mozilla/buildbotcustom
hg qdiff > ~/patches/bug468731-buildbotcustom.patch

…and then uploading the resulting patch files as attachments to the bug. There’s a lot of repetition and extra mental work in those steps:

  • I have to type the bug number manually twice. This is annoying, and error-prone. I’ve made a typo on more than one occasion and then wasted a few minutes trying to track down where the file went.
  • I have to type the correct repository name for each patch. Again, I’ve managed to screw this up in the past. Often I have several terminals open, one for each repository, and I can get mixed up as to which repository I’ve currently got active.
  • mercurial already knows the bug number, since I’ve used it in the name of my patch.
  • mercurial already knows which repository I’m in.

I wrote the mercurial extension below to help with this. It will take the current patch name, and the basename of the current repository, and save a patch in ~/patches called [patch_name]-[repo_name].patch. It will also compare the current patch to any previous ones in the patches directory, and save a new file if the patches are different, or tell you that you’ve already saved this patch.

To enable this extension, save the code below somewhere like ~/.hgext/mkpatch.py, and then add “mkpatch = ~/.hgext/mkpatch.py” to your .hgrc’s extensions section. Then you can run ‘hg mkpatch’ to automatically create a patch for you in your ~/patches directory!

import os, hashlib
 
from mercurial import commands, util
from hgext import mq
 
def mkpatch(ui, repo, *pats, **opts):
    """Saves the current patch to a file called <patch_name>-<repo_name>.patch
    in your patch directory (defaults to ~/patches)
    """
    repo_name = os.path.basename(ui.config('paths', 'default'))
    if opts.get('patchdir'):
        patch_dir = opts.get('patchdir')
        del opts['patchdir']
    else:
        patch_dir = os.path.expanduser(ui.config('mkpatch', 'patchdir', "~/patches"))
 
    ui.pushbuffer()
    mq.top(ui, repo)
    patch_name = ui.popbuffer().strip()
 
    if not os.path.exists(patch_dir):
        os.makedirs(patch_dir)
    elif not os.path.isdir(patch_dir):
        raise util.Abort("%s is not a directory" % patch_dir)
 
    ui.pushbuffer()
    mq.diff(ui, repo, *pats, **opts)
    patch_data = ui.popbuffer()
    patch_hash = hashlib.new('sha1', patch_data).digest()
 
    full_name = os.path.join(patch_dir, "%s-%s.patch" % (patch_name, repo_name))
    i = 0
    while os.path.exists(full_name):
        file_hash = hashlib.new('sha1', open(full_name).read()).digest()
        if file_hash == patch_hash:
            ui.status("Patch is identical to ", full_name, "; not saving")
            return
        full_name = os.path.join(patch_dir, "%s-%s.patch.%i" % (patch_name, repo_name, i))
        i += 1
 
    open(full_name, "w").write(patch_data)
    ui.status("Patch saved to ", full_name)
 
mkpatch_options = [
        ("", "patchdir", '', "patch directory"),
        ]
cmdtable = {
    "mkpatch": (mkpatch, mkpatch_options + mq.cmdtable['^qdiff'][1], "hg mkpatch [OPTION]... [FILE]...")
}

Maybe he’s right?

The Pope has been taking quite a bit of heat over the past few weeks in the press. The latest media frenzy is over recent statements he made regarding the Church’s consistent teaching that condoms are not the answer to the AIDS crisis in Africa, or anywhere else in the world.

It seems like most people automatically assume that condoms are an important part of the solution to combating AIDS. It makes sense on some level I suppose; we’re reminded constantly of the importance of having “safe sex”, and how using a condom is the responsible thing to do. And I’m sure that condoms do reduce the risk of HIV transmission for any one given sexual encounter. But what are the effects over time? If condoms have a 99% success rate, that’s still 1 out of 100 failures. I’m not going to bet my life on a 1% chance of failure. Something with a 1% chance of occurring in a single event, has a 63% chance of occurring at least once over 100 events. Let’s say the prevention of transmission rate is 99.9%; there’s still a 9.5% chance of transmission over 100 sexual encounters in this scenario.

Now, big giant disclaimer here, I don’t know what the accepted statistics are on the effectiveness of condoms in preventing HIV transmission, either in ideal circumstances, or in actual usage.

I do know that the chances of failure for something definitely add up quickly over time, and they add up fast.

So it shouldn’t be a surprise to hear that, “We have found no consistent associations between condom use and lower HIV-infection rates, which, 25 years into the pandemic, we should be seeing if this intervention was working.” The full article can be read over at the National Review Online.

In two places I know of that have had success in combating AIDS, Uganda and the Philippines, the primary focus was on having faithful, monogamous sexual practices. And it makes sense why this works. If people have fewer sexual partners, then the risk of transmission in the general population is reduced.

So maybe the Pope is right when he said, “If the soul is lacking, if Africans do not help one another, the scourge cannot be resolved by distributing condoms; quite the contrary, we risk worsening the problem. The solution can only come through a twofold commitment: firstly, the humanization of sexuality, in other words a spiritual and human renewal bringing a new way of behaving towards one another; and secondly, true friendship, above all with those who are suffering, a readiness – even through personal sacrifice – to be present with those who suffer. And these are the factors that help and bring visible progress.” (my emphasis)

I think he is.

Thanks to Mulier Fortis for the link to the National Review article.

Give Firefox 3.1 Beta 3 a try!

We just released the third beta of Firefox 3.1. Read more about it over at Mozilla Developer Center, or if you’re impatient, go download it now!