Archive for the ‘Geekery’ Category

Geek Poetry

Wednesday, April 29th, 2009

I was recently compelled to write a verse of geek poetry in an archaic rhyme scheme.  I think it might be the first iambic quadrameter I’ve ever written, and it turned out flawlessly except that it’s indecipherable to non-geeks.  Enjoy if you can:

And after all the code was made,
compilers with their flags were silent,
linkers slept, their objects laid,
and weary hands and headaches vi’lent
statements to the shell conveyed
and started code meant for a client.
“Perhaps it’s done!” they all exult:
Behold! A segmentation fault.

Can We Get Some Statistics Education In The House

Thursday, March 26th, 2009

Wow, this is pretty impressive.  Let’s read some stunning examples of misleading statistics.

To begin with, the pope is certainly right about at least one thing: Condoms have been disappointingly ineffective in the fight against AIDS in Africa. In Cameroon, for example, the country the pope was flying to when he made his notorious remark, condom sales more than doubled from 6 million in 1992 to 15 million in 2001. Meanwhile, HIV prevalence tripled from three per cent to nine per cent. Botswana, one of the best-governed countries in Africa, was quick to jump on the condom bandwagon in the early 1990s. Its reward: about a quarter of its adults are infected with HIV.

It’s hard to even know where to begin here.  Condom sales in Cameroon more than doubled to 15 million in 2001 and the infection rate is increasing: the country had 16 million people in 2003, meaning that people were using about 1.88 condoms per year (two people use one at once, technically).  Botswana, a country of just under two million in 2003, bought about three million condoms in 2001.  That’s about 3 condoms per year1.  I don’t know, maybe they sell reusable ones.  Maybe I’m just a huge slut and my idea of how often people have sex is hyperinflated.  Maybe priests are more in touch.  But clearly, condoms are a failure, and we should stop promoting their use.

Well, I wound up showing these numbers are stupid and misleading even before getting to the fact that they’re bad statistics, but they are: does promoting condom use cause an increase in infection rates, or does an increase in infection rates cause promotion of condom use?  Gee, that’s a hard one.

But wait, there’s more!  And “better”!

A shift in sexual norms? Partner-reduction? Hmmm, isn’t that what Pope Benedict is promoting? With, by the way, much enthusiastic support from African women who find the notion of faithful husbands rather endearing. And with some success. Uganda, for example, which has long emphasized abstinence and fidelity over condoms, has seen its HIV prevalence rate drop from more than 15 per cent to less than six per cent in 10 years. And campaigns to discourage multiple partnerships have also had encouraging results in Kenya and Swaziland, with corresponding drops in HIV rates.

Wow!

First of all, a “prevalence” rate is the percentage of infected adults.  Having the prevalence rate drop from 15% to 6% over a decade doesn’t mean you’ve stopped the spread of AIDS, it means one of two things:

  1. 9% of your population has keeled over dead.
  2. Your uninfected population has more than doubled.

I don’t know about you, but I’m leaning towards number two.

Also, over the period in question, Uganda heavily promoted the use of condoms.  And to boot, since they jumped on the abstinence-based bandwagon, the infection rate has risen again.

So seriously, for Chist’s sake (literally), learn some statistics.  Or, you know, go on deliberately misleading the general public at the expense of millions of Africans.

1) For amusement’s sake, looking for the numbers in Botswana brought up this article, which calls 3 condoms per couple-year “condom-flooded.”

I Miss Fun Computing

Friday, January 23rd, 2009

Something has fundamentally changed in my computing experience in the last few years, and I don’t really like it.

Now, back in, say, 2002, people were amazed that a version of windows was available that could usually run for a few hours without crashing (XP).  OS X was at Jaguar, and it was pretty slick, but also limiting, in a strange way.  In the Linux world, GNOME’s window manager wasn’t doing a good job with Xinerama hints (so windows would pop up right in the middle of those two 17″ CRTs heating your computer area) and running KDE smoothly required a whopping 256MB of RAM.  Only OS X could do antialiased text without serious tweaking, and getting 3D acceleration on Linux required some pretty serious wizardry: recompiling kernels with DRI, adding poorly documented sections to /etc/X11/XF86Config, waving chickens over the monitor, and so on.

Roughly, it was the bloody dark ages.  Since then, those of us who escaped to a Mac have seen successive waves of improvement, to the point where almost no grievance has been left untouched; meanwhile, GNOME and KDE have become beautiful, tightly integrated and intensely productive environments.  It’s hard not to look back with astonishment that we ever actually got anything done1.

But amidst that barbarism, there were some things that had an aura of magic to them.  If you could spend a couple of days tweaking your environment, reading documentation and adding the appropriate cantrips and sigils to configuration files, you could get to the point where your entire workflow—including goofing off—was effortless.  There was a lot of strangely fun stuff like writing a quick perl script to rip through a text file full of lab results, crunch them and spit out a LaTeX table to include in the report.

That doesn’t really seem to happen anymore.  The process of serious work seems to be: start web browser, start Outlook, start crappy custom software.  I’m getting pretty fluent at window juggling in XP, which is painful once there are twenty or so windows up, but there’s no magic here.  Even at home, with my lovely Mac, everything’s pretty inane.

The change is twofold, really.  One is in user interfaces and interoperability.  As usability issues are addressed, one way of doing things is becoming dominant.  This is actually a pretty good thing for the most part, but I have to admit that I occasionally miss rolling my own custom-fitted workflow.  The other part, and definitely the bigger of the two, is the nature of what I do on computers.  Back then, it was “here’s a problem, here are some tools, solve the problem.”  Now, it’s “here’s a problem, here’s the solution, now do it nine hundred times.”

Sigh.


1) I suppose people running windows don’t feel much different now than they did then.

The Next Level of Mac

Friday, April 11th, 2008

I’ve been a half-assed user of since it came out. Several of my friends were really impressed and immediately started incorporating it into their workflows, but I never really picked up on it. Lately, that’s starting to change.

I have a lot of stuff in my Applications folder. Even on my MacBook Pro’s 1920×1200 display, the dock would be severely cluttered if I actually had all of the stuff that I use fairly frequently on it. Instead of having a cluttered dock, I started launching things through Spotlight. This was a step in the right direction, because it saved me from going to the finder for Applications I used more rarely, and it’s easier than looking through a stack for the Applications folder. The only problem is that the spotlight search feels slow, since I’m comparing it to the the run menu in or . Quicksilver is fast. I find myself removing things from the dock unless I run them every time I log in, because running them through quicksilver is inevitably faster.

I am also enjoying Quicksilver’s ability to figure out what text is. Bringing up quicksilver, typing a url or an email address, and having a Safari or Mail.app window open is great. Putting ideas into —which I am just starting to use—is also pretty straightforward once you toggle the “switch to text mode if no match is found” option.

There’s a lot of power behind Quicksilver. Try it, and soon you’ll miss it wherever you don’t have it.

The Curse of Literacy

Wednesday, March 5th, 2008

When it comes to spelling and grammar, I’m a jerk. I’m going to explain why.

Remember ? Predictably, it’s wrong in a great number of complex ways. Significantly:

“Regardless of semantic, syntactic, or orthographic predictability, the eye seems to process individual letters … Disruptions in adult readers’ eye movements indicate that the visual system tends to catch the slightest misspelling.”1

Those disruptions cause slowdowns, which I personally find frustrating. Grammatical mistakes do the same. I like to read ideas, opinions and information, not words.

Earlier today I discovered ; apparently there’s an almighty (but probably positive) shitstorm brewing in the Vancouver progressive-left community. Ivan Drury’s letter and many of the responses—Messrs Boxall, Ages and Beeching and Mmes Elise and Stephanie—are absolute pleasures to read. They’re insightful and clear, not just conveying ideas but also emotions.

On the other hand, we see flamebait comments from individuals like “Yours Truely.” It’s notable that the most angry comments and those with the least to contribute are also the ones with the poorest spelling, grammar and punctuation. One wonders why spell-checkers don’t exist for the angry.

This pattern is highly pronounced here, but it exists everywhere, and I suspect that it boils down to two fundamental points: passion for your ideas and respect for your audience. Those who believe they have something to say and are adequately cluestruck are more likely to care about communicating clearly, and are also more likely to know how to form sentences as well as understand the impact of bad writing on communication. Those who have respect for their audience are more likely to take the time to make their reading experience pleasant, while those who believe they are coming down from the mountain to share their wisdom with the unwashed peasants are probably not going to read like Zarathustra.

Everyone on the internet has an opinion, and anyone who wants to express theirs should consider that nobody is begging to hear it. Tell it clearly and respectfully, or don’t expect anyone to care.

I also have some thoughts on progressive leftism to bring up (respectfully), but they haven’t congealed into something easily slingable yet.

1) from Adams, M. J. (1990) Beginning to Read: Thinking and Learning About Print. Cambridge, MA: MIT Press, p. 101

Self-Documenting My Ass

Monday, February 4th, 2008

As I mentioned previously, a lot of the projects I’ve been working on over the past year have been largely uncommented. This wasn’t viewed as an issue by the people working on these projects because the company had a heavy focus on using a “self-documenting” coding style. I’d like to take a moment to explain in somewhat greater detail why this is, frankly, very stupid, especially on any non-trivial project that doesn’t have a permanent team.

I’d like to start with an english language example of self-documenting code. It’s for building Lego.

Take an 8×2 red brick. Now take four red bricks which are 2×2 on the bottom and 1×2 at the top (slant pieces, as I called them when I was a kid). Put them on top of the 8×2 in two pairs with the thick parts together. Take two red upside-down slant pieces (2×2 on top and 1×2 on the bottom) and put them on the bottom of the 8×2 at the far ends with the thick parts facing inside. Put a 6×2 red brick between them. Take another two red upside-down slant pieces and put them so the thick parts are on the outermost bumps of the 6×2 with the slope facing outwards, and put a 4×2 red brick between them. Repeat this, but with a 2×2 brick in the middle. Finally, put two red upside-down slant pieces on the bottom, with the thick parts together.

If you followed these instructions properly, and if I wrote them properly, you’ve now made a red heart, because I love you.

So here’s the thing about self-documenting styles: they document what’s being done to solve a problem, but not the problem that’s being solved. If the self-documenting code above had appeared after a comment that said “this makes a red heart,” everyone could have saved their time.

Here’s the fundamental point: code is a solution to a problem. To use code, you need to know exactly what problem the code solves, so you can find a way to express your problem in the same terms. If you have a digestive system (a solution to a problem) and a sandwich (data) and you’re hungry (a problem), you can solve the problem1 by breaking the sandwich into pieces that are suitable for your digestive system (this is one problem that the mouth is a solution for). But self-documenting code does not explicitly document the problem that it solves; it only documents how it solves it. If it’s clear enough, you can figure out the problem from the solution, but it takes a while, sometimes longer than solving the problem took—as is probably the case in the lego example above. If you’re given a disembodied digestive system and all you know about it is that it’s a bunch of funny tubes, you’re not going to be able to do much with it. You might make sausage.

Even in cases where most of the problem can be immediately figured out, say a function called DisplayImage(), there’s still the issue of figuring out how the problem should be expressed. Say you’re passing it the pixel data and the length and width: is the pixel data an array of rows of pixels, or is it just a lump of pixels that gets divided up given the length and width? Is it one image where every value is RGBA, or is it four images, one for each channel? With a self-documenting implementation, you still need to read the code and figure it out from how the data is used. A Doxygen header here could answer would answer all of these questions concisely.

Now, self-documenting style is still vitally important, as anyone who has gone bug-hunting in a pile of 2 with one letter variable names will tell you. It makes bug-hunting infinitely less painful. Everyone should always use it, but if your code is meant to be used as a library or elsewhere in the application, it should never, ever, ever constitute “documentation.” It should become a black box with labels on it. “Chips and pop go in, web sites come out.” This part can only be done with documentation that is separate from the code.

  1. You can also solve the related poo-generation problem.
  2. The disembodied intestines are spaghetti code in several ways: they’re tangled, uncomfortable to debug and they solve the problem of what to do with spaghetti.

Yet Another Geek Badge

Sunday, September 23rd, 2007

On Saturday morning, I earned a new geek badge. It’s one that takes a long time to get:

(charon)~> uptime
13:46:22 up 366 days, 14:14, 1 user, load average: 0.01, 0.00, 0.00

Yes, that’s one year, one day and fourteen hours with out a reboot.

Bye bye, b2evo!

Tuesday, July 24th, 2007

So, after a long run with b2evolution, I’m moving to wordpress. This isn’t to say that I haven’t had a blast with b2evo, and I definitely have nothing bad to say about it.

The thing is that it wound up being a lot of work. I’d rewritten the anti-spam on the comments so I could leave them unmoderated, but then some jerk invented trackback spam. Eventually, it got to the point of needing a captcha for people to prove that they were human. This worked perfectly well on my own server, where php sessions lived for hours, but on a third party host that isn’t a dedicated server, well, you’d better type fast. Remind me to rant about PHP’s ridiculous default behaviour when it comes to sessions. Oh, lordy.

I have to admit, I’m just a fan of how lazy I can be with this setup.I actually did have a post to write; something about the destructive effect of a specific and incredibly valid self-criticism on my post volume, but it’s late and I’ll do it tomorrow.