Petter's blog

« Older
Nov 9th, 2009, 16:22

TekSavvy—the problem with “last mile” connections

Original estimate of connection date: November 11.

Revised estimate: December 7.

This is in no way, shape, or form the fault of TekSavvy, who can’t do a thing about it: The lines are owned by Telus, so I need a Telus technician to hook me up. (I would not be very surprised if this consists of little more than some hemming, hawing, and pushing a button somewhere geographically different.) Telus, it seems, are suffering a technician shortage in BC and Alberta—so, whoops, my estimate gets inflated by another month, and I have to wait a total of nearly five weeks instead of just one.

Now I am glad I decided to play it safe and not cancel my Shaw account until the TekSavvy service gets activated.

Nov 8th, 2009, 23:43

Hard drive misadventures

I just bought a new, larger hard drive, and today I installed it in my desktop computer. I bought this computer from NCIX and, in a moment of pure indulgent laziness, paid them to assemble it for me rather than assembling it myself. Today I had to open it and move things around—and oh, but my earlier laziness came back to bite me in the ass.

The case has two 3.5" drive cages. In spite of the case manual’s suggestion that one use the lower cage “for optimal cooling and noise reduction” (or something to that effect), both pre-installed drives were in the upper cage, which sits directly in front of the video card. By “directly” I mean that they were so close that the power cord of the lower drive was physically touching the card. By “physically touching” I mean that it was, in fact, blocked by the card, so that I had to remove the video card to unplug the drive. To remove the video card, I had to unplug the system power cord. …And so on.

And of course all the cords were zip-tied together so tightly that the drive cage could not be removed without unplugging the drives, and the lower cage could not be reached without cutting numerous zip ties. And no power connectors were left for expansions, so I had to dig through boxes to find spares; ditto SATA connectors. As a bonus, the upper and lower drive cages use different attachment systems (the upper cage has drive bays, the lower does not), and the necessary screws were of an unusual type, so I had to find those too (this one isn’t the installing tech’s fault, though).

I have never spent so much time just physically installing a hard drive, but on the bright side, I expect that moving all the drives to the lower bay will significantly improve system cooling (since the hard drives were between the front air intake and the video card, sigh), and the case could use the cleaning it got; it was a mite dusty, if you’ll pardon the pun.

Now, of course, grub reports an error, presumably because the drive order has changed, or something (the BIOS setup correctly reports all three HDDs). I don’t know, and I lack the energy to work at it tonight. Hopefully tomorrow night will be a quick fix to get the system running rather than something horribly wrong.

Nov 6th, 2009, 11:58

Evince for Windows

If you loathe the Adobe Acrobat reader half as much as I do, you might be happy to learn that Evince, the standard PDF reader for the GNOME platform, now has a Windows version (get it here). I have not used this Windows version myself, but expect good things. (This latest version of Evince also added support for the one feature I was missing: Displaying annotations.)

Evince is what made me stop hating PDF documents—it does nothing fancy, but displays PDF (and Postscript) documents cleanly, quickly and efficiently. Searching for text in a document resembles, well, searching for text in a text document rather than asking your computer to reindex all its documents while attempting to compute a cure for all cancers, or whatever Adobe make their reader do to slow it down to the startling degree I have come to expect. (If—if—this sounds like an exaggeration, it’s because (1) the Adobe reader for Linux is even worse than the Windows version, and/or (2) they have improved the Windows version since I last used it, reversing a long-standing tradition of adding more and more features that nobody uses except your CPU.)

More seriously and less sarcastically, Evince was the first application that really struck me with a “less is more” sort of beauty—an object lesson in UI design, if you will. It’s there to do one thing: Let me view PDF and Postscript files. It has almost no buttons, options, switches, or fiddly bits. And yet, in its stark simplicity, it was so vastly superior to the obvious alternative that it made me view PDFs as a good format for portable documents rather than a plague upon the internet.

Nov 5th, 2009, 14:22

SpiderOak: Impressions

I recently decided to try SpiderOak to backup documents that are either too large, or too sensitive to conveniently keep in my subversion repository. I signed up for one month at a cost of $10 to get 100 GiB of space. They offer 2 GiB completely free, and I can highly recommend this for storing smaller amounts of data (I would, except that I have, use, and like subversion for this).

Initial impressions: No problems with the packages¹ or UI. I can only assume that the Windows and Mac versions are identically smooth (with most products, after all, Linux gets the least attention and support). I had some issues where my upload speed would slow to a crawl, then a halt…but I think this is more due to Shaw, whether because the cable network gets overloaded at certain times of day, or because they throttle my connection.² However, this was not immediately obvious, so I asked SpiderOak tech support, just in case. Their response was prompt, friendly, and voiced in a way that didn’t seem to assume I’m an idiot (I’m very sensitive to perceived condescension). Thus, while SpiderOak’s support didn’t solve a problem for me, because there almost certainly was none on their part, their response seemed promising: Based on preliminary data, I like their customer support.

So far, I’ve backed up about 9 GiB of data. Of course, uploading this on a cable connection with a maximum of 0.5 Mbps upload rate, it’s rather painfully slow, but once I have the data uploaded, I won’t have to repeat it… Unlike services like DropBox, SpiderOak lets me specify which directories I want to upload (and exclude subdirectories, if I so desire), so I can keep my files organised how I want them. It also turns out to be trivial to synchronise files between different computers. Their FAQ has all the details. It’s as simple as it sounds, and probably simpler.

As you can probably tell, I’m very happy with the service so far, though I’ve only used it for a few days yet. It’s quick (except for my upload speed…), easy, and I like their security model a very great deal. Based on my limited experience, I would recommend it—especially to those among you who don’t currently have an online backup service. Why not? You can get 2 GiB of safe, automatic backup for free! And if you need more (as I do), $10 a month or $100 a year gets you 100 GiB, while most other services I’ve found charges the same for only 50 GiB of space.

Again, of course, if you decide to sign up, use my referral link and give me some extra space for free…


¹ When I installed it on Ubuntu Karmic, there was no “Ubuntu Karmic” package, but the Jaunty package worked fine. A few days later, a Karmic package was available—this was within perhaps a week of the initial Karmic release, mind. I believe the package was actually the same, though of course it’s reassuring to click a link with the correct legend.

² My solution? I’m switching to TekSavvy, who offer twice the upload speed and about the same download speed at a similar price, never throttle anything, are less likely as an ADSL provider to suffer congestion than cable, and are champions of net neutrality and deserve my money more than Shaw does. On the very remote chance that my upload issue was SpiderOak’s fault rather than Shaw’s, I expect I’ll be happy with TekSavvy. (On the very, very remote chance that I’m not, I’ll just switch back.)

Nov 3rd, 2009, 19:04

Today in BJJ: Noobs are bad for your health

I am rather irked.

Drilling armbars from knee-on-belly (not rolling, not sparring, just drills) with a rank beginner (no stripes). He cranks some armbars a little too fast for my liking—not enough to injure me, but enough to alarm me, so I give him a little friendly spiel on how he should do it slowly; how the amount of leeway he has for an armbar varies with position so he should always go slowly even if he thinks he has room for more, because the position and how deeply he can sink his hips will change that amount of room.

He nods understanding, we reset, and in his next move, he cranks an armbar from an awkward angle fast and hard enough for me to cry out in pain.

My first reaction—after the initial “Ow”, “Oh shit”, and (unspoken) “You stupid git” had flashed through my mind—was that this is no big deal; I should shrug and keep training. My next thought was that the last time I said “this is no big deal” and kept training, I had a sore elbow that I couldn’t straighten fully for several weeks (dim memory suggests that the initial pain was less that time). Thus, I am now sitting at home with an ice pack and a very foul temper, wishing I were in the advanced class running right now (which is harder, but full of people who know to apply an armbar slowly enough to give you time to tap).

Nov 1st, 2009, 21:05

Online backup: SpiderOak

After downloading this morning’s find, my first thought was I must never lose this!—so I spent some time thinking about backup strategies.

Most of my data are backed up by shoving them into a subversion repository containing most of my home directory. This is a techy, nerdy way of doing things that works very well for some data, and gives me the ability to perform very sophisticated change tracking.

It works rather poorly for some data, though. In particular, it’s not ideal for storing large sets of binary data…like an 8.1 GiB repository of scanned books [embedded] in PDF format (or like music, or video files). It also has another weakness, not intrinsic to the mechanism but significant in my usage: Because my subversion repository is housed on the same server and server account as my websites, I’m not 100% comfortable uploading very sensitive data. It’s a shared server (although I have of course disabled read permissions for other users), and it runs, with my user priveleges, my own webapps—which are of course no more secure than I made them.

So I decided it was finally time to look into alternative backup strategies. I’m quite happy with subversion for e.g. text files that I modify, my projects’ source code, and so forth, but for photos, videos, music, and large downloaded collections of RPG supplements that I’ll never edit anyway, I want something else. Having heard the name bandied about, I of course looked into DropBox, which looks quite OK. I did spend some extra time looking around, though, and came across a DropBox competitor I had not heard of: SpiderOak.

Both DropBox and SpiderOak offers a free 2 GiB storage account with paid upgrades to 50 GiB or more. Both offer secure, encrypted transport, synchronisation between multiple computers, etc. However, SpiderOak offers a few features that DropBox does not, some of which are quite interesting.

Client software is available for Linux, Windows, and OS X, so you can share data across platforms. (This is also true of DropBox, of course.) Unlike DropBox, much (though not all) of the client software is open source, and SpiderOak claims that they are moving towards a full OSS client. (They’ve already shared some code.)

On paper, then, SpiderOak is about as close to perfect as it can get for my needs. What remains to be seen is just how smooth and seamless the experience turns out to be when I start using it (it has a reputation in some parts for being a bit of a resource hog; to me, that sounds like a small price). If it’s as good as I’m hoping, I will recommend it to everyone I know.

If this convinces you to sign up, please use this referral link to give me some bonus space in return for my time writing this up. (Pretty please?)

Oct 31st, 2009, 22:33

Notes from Jedi Academy

When someone is using the power of the Force to perform a mighty leap across a gaping chasm is an excellent time to use said Force to push him in the other direction, cancelling out horizontal velocity in mid-air.

Contrary to an old Sith belief, it is not in fact possible to platitude a Jedi to death.

Oct 27th, 2009, 12:26

Speed in unit tests matters

It’s extremely frustrating to have to wait for over ten minutes when you’re ready to commit some new code, just because you have to wait for a big, slow unit test suite to complete. It’s also frustrating when you’re actively addressing a known bug that’s been exposed by unit tests and, having made a change that will hopefully fix it, sit and twiddle your thumbs as the tests re-run. Efficiency matters, even in unit tests.

I’ve spent a few workdays attacking the test suite for the module I’m working on with the proper tools—a profiler and KCacheGrind, a profiling data visualiser. By figuring out where the test suite spent most of its time and optimising the slow parts (largely by caching data that were recomputed superfluously, caching prepared statements, etc.), I cut down the expected running time for company-wide unit tests by an estimated 10% and my own module’s tests by approximately 80%—an improvement by a factor of 5, from 12:31 to 2:40!

Of course this number is going to creep up as the test suite grows, coverage improves, and setup becomes more involved. However, that’s all the more reason to do this, and just means that it may become relevant to do it again at some point in the future.

As a bonus, the majority of the performance improvements were to business code exercised by the unit tests rather than code exclusive to the test framework, so application performance will be improved as well. I should be cautious in my conclusions here, though: While there will be improvements, some of the code exercised very heavily by unit tests is not run very frequently by users.

Oct 25th, 2009, 23:26

SQLObjectInherit

I just threw a little code snippet onto my website: SQLObjectInherit, to add inheritance without foreign key relationships to SQLObject. Follow yonder link if you are curious (download link available here).

Oct 22nd, 2009, 20:22

Small injuries are so damned annoying

Case in point: Today, during the rolling at the end of the first class, someone accidentally heel-kicked my left knee. I briefly considered, and decided to take a two-minute break. I felt mostly fine and continued to roll, and the first half hour of the second class was fine. Then we moved to a position when I had to be on my knees and presto! soon it hurt to even touch.

Annoying: It’s painful enough that I decided to sit out and ice it lest I make it worse, but minor enough that I felt extremely silly for sitting out. Odds are I won’t even feel it tomorrow (having iced it, &c.).

Much as I would prefer not to, if I sprained an ankle or something, I wouldn’t feel foolish for sitting out…

Oh well. Better to play it safe, so I can get to fencing class on Saturday in good form (“Learn the eight cuts of the sidesword”—I can’t wait!…and I’d rather not limp) and get back to jits next week.

Oct 18th, 2009, 17:49

Oh, Google Ads

Oct 17th, 2009, 14:11

Fitness?

Just back from fencing class—it was fun, but compared to BJJ, not much of a workout (of course, these are beginner classes). Afterward, I did some pushups just to get that crawling I-need-to-exert-myself feeling out of my body.

On the one hand, I’ve never weighed as much as I currently do, and I’ve probably never carried as much fat. On the other hand, I’ve never before been able to do 40 consecutive pushups (a number which would impress no one at the gym, but for a sedentary nerd like me, who never before could do it, it’s a nice big number—I can distinctly recall struggling to get past 15).

I should still work to improve my snacking tendencies, and I still need to ramp up my training (or at least stick to the 2×2 classes I’m back to doing, rather than just one class at night, twice a week) but perhaps my general level of fitness isn’t as bad as I thought. Perhaps the BJJ gym has skewed my perception of where the bar should be.

Oct 8th, 2009, 22:23

Consequences

When I wrote my recent very mopey post about feeling terrible about BJJ progress, I wasn’t quite thinking about the fact that (1) I have Facebook set to pull the (public) posts from my blog feed, and (2) a bunch of guys from the gym have me in their Facebook feeds. It was intended as bloggy whining, and ended up as an accidental spill to a bunch of the guys.

True to the nature of BJJ as one of these modern, rough-and-tumble martial arts as opposed to the strict, formal, upstanding traditional martial arts, this has so far resulted in…well, two or three pep talks, some encouragement, and a promise to send a PDF copy of a freely available book on progress and plateaus in sports.

As a cherry on this rather nice pie, I’ve finally gone back to doing two classes back to back when I go (Tuesdays and Thursdays), after a patch of bad health and subsequent doubts about my ability to keep up. I seem to vacillate a bit on this, but right now I feel more energised than exhausted, so that’s very good.

I wonder if I can make myself resume going on Sundays. Open mat time is something I could really use, but on the other hand I really enjoy my lazy Sunday afternoons. We’ll see, I suppose.

Oct 2nd, 2009, 19:42

BJJ: Source of shame

I honestly do not understand how I can be quite so bad. I know that I have no talent for this, and I’ve long since made peace with that—I’m in it for continual improvement (however slow), not to beat anybody. I expect that everyone who walks in the door and sticks with it will pass me—eventually. I don’t mind. What does bother me is that it seems anyone can walk in the door and be able to beat me after a few weeks of classes. I am at a loss to explain this profound depth of ineptitude.

As a bonus, in spite of going to BJJ at least twice a week, biking to and from work 5 days a week, and rarely eating junk food (my diet isn’t great, but it could easily be and has been much worse; I can’t remember the last time I had chips…), I somehow manage to keep getting fatter. This, too, I am at a loss to explain. I know I shouldn’t fixate on this, but I can’t help it. And, of course, if I am to compete at least once, it’s a very terrible idea to get bumped up several weight classes just from fat.

Not infrequently (when I am in the grasp of these doubts) I feel like I ill deserve to even be a member of a gym, and question whether I should go back at all. And yet that would be a much greater failure still—and, of course, when I am not in the grasp of these doubts I love it, and physically it rarely fails to make me feel better.

I just wish I knew how to stop being so disproportionately inept.


¹ I do some things right. I never panic, I am methodical, and I am generally pretty good at using my weight and putting pressure on my opponent—I’m told I feel [even] heaver than I actually am. On the other hand, my game is slow, lazy, vastly over-defensive, hopeless against active and athletic opponents (whether skilled or not), and completely devoid of sweeps.

Sep 30th, 2009, 17:32

On vaccines and autism

The traditional argument against the claim that vaccines cause autism is that it’s bunk because there’s no evidence that it’s so, and that the perceived increase in autism prevalence is due to diagnostic substitution and changes in diagnostic criteria. This is most likely true, but somehow not very comforting (even if it makes sense to teachers…), and diagnostic substitution and critereon changes are fairly obscure: They don’t (in themselves) prove that there has been no increase; they merely make it impossible to tell by looking at prevalence data alone.

A more recent study by the British NHS did something different, and provided data completely consistent with this theory, but perhaps more digestible. They measured autism prevalence across age cohorts. If vaccines did cause autism, then the increase in vaccination over the past few decades should correlate to an increase in autism, which would be reflected in an age skew among the autistic: More young people should be autistic than old people, because old people would have been adults by the time mandatory vaccinations were introduced!

Unsurprisingly, it was found that autism prevalence is not associated with age cohorts: The rate is a constant 1% regardless of age (1.8% in men, 0.2% in women). As Dr. Steve Novella put it,

This is vital blow to the vaccine-autism hypothesis, because the vaccine schedule has been increasing over the last 20 years, the MMR was introduced in the early 1990s, and thimerosal exposure has risen and then fallen to almost nothing. Throughout all of these changes, autism rates have remained stable. This is important because in order to demonstrate toxicity you need to demonstrate a dose-response – the higher the exposure to the alleged toxin the greater the risk or severity of the disease or disorder you think is caused by the toxin. This burden of proof was met for smoking and lung cancer – there is a clear dose-risk response. This is no detectable dose-risk link between vaccines and autism.

It will be interesting to see how the antivaxers attempt to explain this away.

Sep 30th, 2009, 10:18

Nuisance

Got to the office this morning to have my IM client inform me that my AIM screen name is signed in from two locations. Presumably I left Pidgin running on my laptop last night. I thought I’d be able to ssh into it and kill the process, but…well; I can certainly ssh into my desktop, and though my laptop has a DHCP-assigned IP rather than a fixed address and cannot have login requests forwarded from the router, I can scan my LAN from my desktop (which I am accessing through ssh) using nmap to find all active hosts on the LAN. Connect to what I find from my desktop, and—curses! My laptop, of course, is not running sshd.

I wonder how many IMs will go astray today?

Sep 29th, 2009, 11:07

Today I give thanks

…To whoever came up with the decorator module for Python. (“Whoever”? It seems to be some guy named Michele Simionato.)

My page generation library uses a lot of decorators. For instance, if a method is invoked to generate a page, it is decorated with @makepage, and voilà! the proper methods for generating the page as a whole are invoked, and though the method only returns some content to go in the content <div>, it will be a proper XHTML document with menus, etc. A method that generates Javascript? @makejs and it returns it with the proper MIME type. Need to check permissions? @checkPerm('admin') ensures that mere users cannot delete what they should not be able to delete even if they craft their POST requests to target methods they shouldn’t.

The problem is that this interferes with another mechanism my pages use. POST data are used for various parameters: Some special variables are used to determine call type and authentication; some are used for __init__() parameters to set up page objects; others are used as arguments to the methods subsequently invoked. In order to figure out what should go where, the framework relies on inspect.getargspec() to figure out what the parameters to a method may be. Currently it can’t handle methods that take *args and/or **kwargs; if I ever need it I’ll add it. The problem is, when you write general decorators, the signature of the decorated functions will tend to end up in the form (*args, **kwargs)… Now my framwork using getargspec() is unable to figure out what POST variables should be passed in and, consequently, passes in no arguments.

Fortunately, it turns out that someone else had recognised that this was a general problem, and the decorator module is written precisely to solve the problem of decorated functions losing their signatures. The module page describes both problem and solution in greater detail. Go forth, enjoy, and stay Pythonic!

Sep 22nd, 2009, 19:25

Ever since I moved to Vancouver

Whenever I see a gay or lesbian couple
walking down the street, hand in hand
I smile
because it makes me happy to live in a time and place, where
for all its faults
they are able to do that, unafraid.
Then I try to hide my smile
because I don’t want them to feel regarded as a spectacle.

Sep 18th, 2009, 21:15

Currently drinking:

Midas Touch Ancient Ale from Dogfish Head brewery. Quite apart from the taste, the story behind it may make it the coolest beer I’ve ever had. As Dogfish puts it,

This recipe is the actual oldest-known fermented beverage in the world! It is an ancient Turkish recipe using the original ingredients from the 2700 year old drinking vessels discovered in the tomb of King Midas. Somewhere between wine & mead; this smooth, sweet, yet dry ale will please the Chardonnay of beer drinker alike.

And elsewhere:

Together, we bring ancient brewing history back to life. The first beer we created together is ourMidas Touch. This recipe is based on molecular evidence found in a Turkish tomb believed to have belonged to King Midas. The beer is brewed with honey, white Muscat grapes, and saffron.

If Wikipedia is to be trusted, it may not be exactly true, but pretty close:

In 1969, archaeologists connected with the University of Pennsylvania opened a chamber tomb at the heart of the Great Tumulus (height 53m, diameter about 300m) on the site of ancient Gordion (modern Yassihöyük, Turkey), where there are more than 100 tumuli of different sizes and from different periods. They discovered an early eighth century BC royal burial, complete with remains of the funeral feast and "the best collection of Iron Age drinking vessels ever uncovered". […] On a wooden bedstead in the corner of the chamber lay a skeleton of a man 1.59m in height and about 60 years old. In the room there were decorated furniture and panels plus many vessels with grave offerings. Though no identifying texts were associated with the site, it is popularly dubbed the "Tomb of Midas" (Penn). Later investigations showed that this funerary monument could not have been constructed after the Cimmerian invasion in the early seventh century BC. Therefore, it is now believed to be the monument for an earlier king than Midas.

Well, it may not actually be Midas’s tomb, but it’s still a beer reconstructed from molecular evidence from a 2,700-year-old drinking vessel, and that’s pretty damn cool in my books.

As for the beer itself…well, ideally you should try it!, or failing that, read the reviews on Beer Advocate where people actually know what they are talking about. I would agree that it’s halfway between beer and mead, and that it’s somewhat dry, and that it’s one of those beers that are intriguingly different in its finish from its start…but for all that, and for all that it’s halfway to mead, I have to say that part of what I find interesting and remarkable is that it’s still pretty similar to things that I’ve tried—not that I’ve had anything quite like it before, but this is a 2,700-year-old style of beer; something entirely outré would not have been surprising!

The only thing bothering me is that they make no mention of the fermentation process, so I cannot but suspect that it was made with yeast cultivars, whereas I’m pretty sure that 2,700 years ago, they were probably still relying on wild yeasts. I wonder how big a difference this has made for the flavour… All the same, a subtle and interesting beer to drink and a wonderful beer to contemplate.

Sep 18th, 2009, 15:01

What surprises me about Dan Brown

…Is that he has only (just) published five novels. I’ve read several of them: Angels & Demons, The Da Vinci Code, but also Deception Point and the absolutely hilarious Digital Fortress¹. I have, since I first read him, suggested that he is the literary equivalent of MacDonalds food: Cheap, convenient, easy to cram down, requires no real (further) processing—but it’s bad for you, and while I won’t condemn anyone for reading it (after all, I have), I might think less of someone to whom it is more than an occasional guilty pleasure…

So how has this man made a name for himself without writing dozens upon dozens of books? And, if he can sell so many copies of each poorly-researched and ill-written book, why doesn’t he write more?

Dan Brown fun: The Telegraph has a list of twenty(ish) of his clumsiest phrases. Slate has a Dan Brown novel plot generator.


¹ The most egregious and memorable mistakes (determined by being the ones I can still remember) are the following—it should here be kept in mind that this is a book that puts on airs of being intelligent, and has cryptography at the very core of the plot:

« Older