My (just-discovered) workaround to the WebKit letter-spacing bug

WebKit, the rendering engine “under the hood” in both Safari and Chrome, has a known issue handling the CSS letter-spacing property at certain small increments, and at certain font sizes.

Specifically, if defining letter-spacing in increments smaller than 1px or 0.1em, it seems to just ignore the property altogether… except at larger-than-default sizes.

I typically use em or % these days to define text sizes in CSS. So in my situation, I’ve found that my letter-spacing: 0.05em works if I also specify font-size: 125% (or larger), but if I have font-size set to 100% or less, the letter-spacing gets ignored.

Typically, after loading reset.css, I set a baseline font size for the document with body { font-size: 100%; } (or some size… actually it’s usually 80% but these days I’ve been leaning towards larger type).

I decided to play around with this a bit to see if I could resolve the letter-spacing issue, and I found a nice, easy solution that works at least for the particular site I’m currently testing it on. Your experience may vary, depending on how your HTML is structured and how complex your design is.

Here’s the solution:

body {
  font-size: 125%;
  letter-spacing: 0.05em;
  line-height: 1.3em;
}

body>* {
  font-size: 85%;
  line-height: 1.3em;
}

You may want to adjust the exact values of font-size to suit your needs. (And, yes, I’m aware that mathematically 125% and 85% don’t cancel each other out, but they’re close enough for my purposes.) It’s important to include the line-height property in body>* to define your target line height; otherwise your lines will be too far apart. Set it to whatever your ideal value is. (I usually prefer line-height: 1.5em personally, but for larger type, as on the site I’m currently working on, it gets too spaced-out.)

So what’s going on here? Well, strangely, it seems WebKit can actually render smaller type with line-spacing less than 1px or 0.1em just fine, but it won’t unless somewhere in the “cascade” the type has been defined as being a certain amount larger than 100%. I don’t get it, but until the bug (which it seems clearly to be after all of this) gets fixed, at least this seems to be a reasonably clean workaround.

It’s very important that you use body>* and not just body *. If you don’t know why, well… try it out and see. (The upshot: we’re applying a uniform scaling-down across the board on all elements directly under body, which is practically the same as just defining our target font size directly on body itself, but with the benefit of working around the letter-spacing bug.)

Note: I have only tested this using em as the unit of measure for letter-spacing. I’m aware of the issue with px as well, but I’m not sure this solution will work for that. But… really… just use em instead!

How are open source CMSes like Microsoft enterprise software?

Aside from the fact that both topics would put the average blog reader to sleep before the end of the first…

OK, now that they’re asleep, let’s talk. Throughout most of my career, open source software and Microsoft’s (or, really, any software behemoth’s) enterprise “solutions” have seemed diametrically opposed. But the more I think about the situation, I begin to find some startling similarities, at least in their implementation (and reasons for said implementation), if not in their actual structure and licensing.

If you’re the one person (besides me) who’s spent any significant amount of time reading this blog, you probably know two things: 1) I don’t like Microsoft, and 2) I don’t like Drupal. So these are the objects of my scorn in today’s post as well, although the problems I’m describing can be generalized, I think, to the broader sectors of the software industry that they represent.

When I worked in the corporate world, I resented Microsoft’s dominance across the board from operating systems to desktop software to enterprise systems. It just seemed that most of their tools weren’t really that good, and eventually I began to realize that the reason they were successful was that Microsoft’s customers were not the end users, but rather the IT managers who made purchasing decisions. These decisions were largely based on their own knowledge and experience with Microsoft’s software (to the detriment of other, possibly superior options), but also (I believe cynically) to preserve their own jobs and those of their staffs. Microsoft’s systems require(d?) constant maintenance and support. Not only did this mean bigger IT staffs on the corporate payroll, but it meant lots of highly paid “consulting” firms whose sole job was to promote and then support the sales and implementation of Microsoft products.

In the indie developer world, where I now reside, the culture and software platforms are different, but perhaps not as different as they seem. Apple’s computers dominate the desktops in small studios, and the tabletops in coffeehouses where freelancers can frequently be spotted hunched over their MacBooks hard at work while sipping lattes and meeting (usually a little too loudly) with clients. And open source software dominates at the server level.

But just like Microsoft’s platforms, I think most open source software just isn’t really very good. And the problem, once again, is the customer (or… well… whatever you call the person who makes the decisions when selecting a free product). It seems that the end user experience is rarely given much priority when most open source software is being designed and developed. Part of the problem is a lack of direct contact between the development teams and those end users (or, to be honest, even between the geographically scattered members of the development teams themselves). Devs don’t really know what end users want or need. They only know what they want or need, along with what’s been submitted to their bug trackers.

It’s not that these devs are bad people, or bad at what they do. There’s just a disconnect between coder and user, and as a result the goal of building good software isn’t met.

So, why do independent developers still use tools that are not really the best for their clients? Again, cynically, I wonder sometimes if job security isn’t a factor. It’s a lot easier to build something that works, but that requires indefinite, ongoing attention and support, than to build something that is flawless, that you can hand off to your client and never touch again. It’s easier… and it provides built-in job security.

Now, I’m not perfect, and I’m not above all of this. There is no such thing as flawless software, and I have ongoing support contracts with some of my bigger clients. But I’m proud to say that’s mostly because I’m constantly building new sites for them, or building functional enhancements onto the sites they already have, rather than doing endless bug fixes and technical support because the tools I’ve sold them are too confusing or simply don’t work right. Sure, the bug fixes and tech support do happen. But the tools — primarily WordPress and cms34, my own CMS — are built much more with the end user in mind, and have managed to avoid the pitfalls that mean a guaranteed job for me at the expense of a mediocre user experience for my clients.

That’s harder, and riskier. But it’s better. I’m delivering a higher quality product to the clients, and I’m keeping my own work interesting and moving forward.

Blog redesign

Aside

The new design is here! About a week ago I revealed on Tumblr that I was working on a new logo for the blog. And now I’ve mustered the energy to do the bare minimum to my CSS to implement what can be called a “redesign.” Enjoy!

On instruction vs. understanding

I’ve assembled a lot of IKEA furniture in my life, and along the way I’ve learned a few things, such as:

  • Every piece of IKEA furniture comes with an identical Allen wrench, which you will only ever use to assemble that piece of furniture, and which will forever after gather dust in a drawer in your basement with all of the other identical Allen wrenches you’ve acquired at IKEA.
  • A lot of stuff that looks like wood is actually a woodgrain pattern printed on plastic-coated paper, wrapped around a block of glued-together sawdust.
  • Every piece of IKEA furniture will take two hours to assemble, no matter how large or small, or how many separate pieces it contains.
  • Assembly might take slightly less time if you possess a Ph.D in archaeology with a special emphasis in either Egyptian or Mayan hieroglyphics.
  • You will almost always realize 2/3 of the way through the process that you are doing it backwards.
  • It never gets any easier.

Those universal hieroglyphic assembly instructions are, along with the ubiquitous Allen wrench and product names featuring umlauts or o’s with slashes through them, the most easily mocked symbol of IKEA. The pictures are often inscrutable, and the overall impression overwhelming. More than once I have felt compelled simply to curl up in the corner of the room and weep silently.

But written assembly instructions (from other companies, of course) are often far, far worse. If I can’t make sense of a diagram showing exactly how the parts fit together, how am I possibly supposed to understand written instructions along the lines of “insert the ball socket assembly into the reverse threaded wall mount bracket and affix with the supplied 8mm Torx screws and self-locking bushings”? (OK, I just made that up, but it sounds real, doesn’t it? Wait, what are you doing over there in the corner?)

And therein lies the problem: there is a great mental chasm between instructions and understanding. It doesn’t matter what form the instructions take: written, visual, verbal, semaphore. Whether you approach them in an unthinking, just-get-it-done, “paint by numbers” fashion, or you attempt to read and absorb them all before beginning, instructions can only communicate so much.

Recently I attempted to assemble and install a curtain wire system from IKEA, for the purpose of hanging posters from bulldog clips at the new Room 34 studio. The instructions supplied with the curtain wire were some of the most panic-inducing I’ve ever seen from IKEA, and that’s saying something.

The first two times I tried to put this thing together, I just gave up. Then I decided not even to bother with the instructions. Instead, I closely examined the various parts, until I came to my own understanding of how they fit together, and how it all attached to the wall. From that point, I was able to refer back to the instructions in a new way, as a reminder of my own thought processes, rather than as a bizarre alien communication from some distant Hömwørld.

I’ve been in IKEA’s shoes, though. Not literally. I don’t think they sell shoes, although I have seen fuzzy slippers there in a big wire bin for 99 cents a pair. But I have had to prepare instructions myself, and to lead training sessions where I attempt to communicate to my clients how to use web applications I have developed for them. It’s a challenge.

How much information is too much; how much is too little? What is the right information to convey, and what can they do without? Is it better to provide a broad foundation of knowledge or a targeted “cheat sheet” of most commonly used tasks? How do I stop instructing people and help them to understand?

I don’t have the answers. I’m still exploring. In my own experience, it’s direct, hands-on activities that are directly applicable to solving real-world problems that best allow me to develop my own unique understanding of how a system works. But it can be incredibly difficult and time-consuming as an instructor to develop suitable training materials and create an environment where that type of learning can take place.

Beware the self-identified “expert”

Every field of human endeavor has its experts: those individuals who, through the right combination of talent, practice, and experience, acquire the highest levels of knowledge and skill within that field.

It is also one of the most basic observations about life and learning that the more you know, the more you realize you don’t know. As such, those who know the most are also (often) the most keenly aware of their own limitations, and are therefore the least likely to comfortably inhabit the identity of “expert.”

And yet, plenty of people proudly inflate their own status to that level, be they charlatans seeking unearned power and influence, or earnest practitioners of lesser abilities, who are simply benignly unaware of their own limitations (if such ignorance can truly be benign). It doesn’t help that we live in a world of “resumé inflation”, where everyone is an expert in everything, simply by virtue of putting those words on a piece of paper.

Of course there are also the occasional “true” experts who act as provocateurs — or simply have raging egos — who may be aware not only of their own limitations, but also of the even more extreme limitations of everyone else around them, and who leverage that knowledge for greater personal gain. But we have another word for these people. (Assholes.)

The challenge then is this: how do we identify those on whom we can most rely to share their “expertise”, if the true expert refuses the label and the self-identified expert is anything but?

I think the answer is simple: we find experts by the admiration of their peers.

Unless they’re all assholes too.

A note about the photo above: That’s Pete Prodoehl, a guy I don’t know much about but whose website I’ve long been aware of, and who does not appear to self-identify as an expert (except in the seemingly tongue-in-cheek way of this photo). But I found the photo on a post on a douchey motivational website for aspiring entrepreneurs, encouraging “expert” self-identification, while not bothering to identify, credit, or link to Pete’s website. Take all of this as you will.

The :first-child conundrum

I like to think I’m a pretty adept CSS developer. I may not have written the book, but I have a solid understanding of CSS and can do some sophisticated things with it.

But one place I always get snagged with CSS is in using the :first-child pseudoclass. The idea behind :first-child is that you can apply different styles to the first child element inside a parent element than for the rest of the instances of that child element inside the same parent.

A way I end up wanting to use it a lot is to give the first child different margins than the rest. Maybe most of them need margin-top: 2em; for instance, but I want the first one to be flush to the top of the parent by using margin-top: 0; to override the default margin.

The full CSS might end up looking like this:

div>h2 { margin-top: 2em; }
div>h2:first-child { margin-top: 0; }

And then that would be put together with some HTML like this:

<div id="content">

<h2>First header</h2>
<p>This is the first paragraph!</p>

<h2>Second header</h2>
<p>And, surprise! This is the second paragraph!</p>

</div>

So far, so good. The problem is, what if you stick something else into the <div> before the first <h2> that isn’t another <h2>? Say, something like this:

<div id="content">

<div class="floating_sidebar">This should be floating to
the right of the content.</div>

<h2>First header</h2>
<p>This is the first paragraph!</p>

<h2>Second header</h2>
<p>And, surprise! This is the second paragraph!</p>

</div>

You may have guessed at this point that I’m not describing a hypothetical situation here. This is a stripped-down version of exactly what I’m building right now. The problem is, now the first <h2> is no longer the first child element of the parent <div> overall, so the :first-child CSS gets ignored.

True, it’s not the first child element, altogether, inside the parent. But it is the first <h2> child inside the parent. I can understand how, in other circumstances — say, if the inserted <div> wasn’t a float — you’d want the h2:first-child not to apply here. But in general it seems to me that if you’re specifying a tag with your :first-child, it should only matter that it’s the first tag of that type under the parent, even if there are other different tags before it.

I guess the real solution here would be to create another pseudo-class that does what I want. Now I just need to convince the standards folks and the browser makers to do that.

Note: The sample HTML was kind of a mess when I originally posted this. That’s what happens when you write a blog post in a hurry before rushing out the door for a meeting. It has now been corrected, and I made some other edits for clarity while I was at it.

The real reason Android is (and has always been) in trouble

Over on Daring Fireball, John Gruber links to a Business Insider piece by Jay Yarow, called “Android Is Suddenly in a Lot of Trouble.”

Gruber responds:

It’s not that Android is suddenly in a lot of trouble — it’s that a lot of people are suddenly realizing that Android has been in trouble all along.

Exactly. But he doesn’t go on to mention why it’s been in trouble all along (though as I recall, he has in the past). I’ve seen plenty of reports, like this one from comScore that iPhones use WiFi networks significantly more than Android phones in the U.S. and U.K. This is one way of measuring the qualitative differences in how people use iPhones compared to how they use Android phones. You could also talk about app revenue, for instance.

All of these measurements and analysis revolve around one clear conclusion, especially when one considers how people end up walking out of a store with either an iPhone or an Android phone. Carriers are pushing Android because they can control the experience more. They’re giving away Android phones as stock upgrade models when customers’ contracts come up. People who don’t even care about owning a “smartphone” are bringing home Android phones because that’s just what the sales rep at the store recommended.

Android is in trouble because a lot of its users (the majority? the vast majority?) are just using it as a phone. It’s a commodity. A lot of the people buying it don’t really know or care what it is, and will never actively use its full potential. It’s just a phone. It may be capable of much more, but if it’s not being used for more, what difference does that make?

People who go into a store wanting to purchase a smartphone predominantly choose the iPhone. Not all of them, of course. Tech-savvy people do choose other smartphone platforms, including Android, especially those who want to tinker with the system. But the rest take whatever they are told to buy by their carriers’ sales reps.

This is the biggest reason Android tablets haven’t taken off, and it’s been discussed too. There’s a built-in market for the apathetic purchase of an Android smartphone. But no one (well, I hope) is walking into a cellular carrier’s store and saying “I want a tablet. What tablet do you recommend?” People who want a tablet don’t just want a tablet; overwhelmingly they want an iPad. Most people who don’t want an iPad don’t want a tablet at all. (Almost) everybody needs a phone.

The problem for the carriers, and the reason they’ve been promoting Android, has typically been that Apple retains too much control (from the carriers’ perspective) over the iPhone. That’s not likely to change, but with Windows Phone, suddenly the carriers have other options. Microsoft is definitely keeping a tighter rein on Windows Phone than Google does with Android, but with Windows Phone, the carriers still have options they don’t get with the iPhone. (Not that this lack of control has prevented them from selling millions of the things.)

If Verizon is serious about pushing Windows Phone (along with the fact that they still sell huge numbers of iPhones), then we’ll soon begin to see just how Android was, as Gruber says, in trouble all along. The success it has achieved to date was largely dependent upon carriers pushing it on unsuspecting or indifferent customers. If they stop doing that…

Where’ve I been?

Image

It’s been nearly a month since my last blog post. What happened?

Well, this happened:

That would be the reception area at the front of the new Room 34 Creative Services studio. The business has moved out of my house and into a real storefront space. It’s been a lot of work (plus, I’ve had a lot of work to do anyway), so the blog has suffered. Never fear, I’m still here!

More to come…

Bracing for the HD web

Joshua Johnson has an excellent new post over on Design Shack called Ready or Not, Here Comes HD Web Design, discussing adapting your web design techniques for the imminent HD revolution, being led by the new iPad.

I’ve been adapting my designs for the Retina Display on the iPhone 4/4S for a while now, but it’s easy enough to build a responsive web design that just shrinks down large desktop website images to half their size for display on a tiny iPhone screen. Making an essentially desktop-sized display support high-resolution graphics is a whole other story, and even though I knew (or presumed, along with the rest of the world) that a Retina iPad was coming, I think some small part of me was still in denial about what it would mean for web design.

Well, that future is here. Sure, most of the world is not browsing the web on a Retina Display iPad. But if you think the HD revolution ends there, think again. It’s just getting started. I’m about to enter the implementation phase on a handful of big web projects over the next month. Accommodating the new iPad’s display is going to be one of my top tasks.

I’ve been thinking for the past month or so that I was going to need to address this, and I’ve made the decision that, moving forward, on any site that has responsive web design as a component (which will probably be all sites I do), full-size “Retina Display” graphics are essential.

I posted a comment on Joshua Johnson’s post, where I noted that “Retina” (or, to avoid using Apple’s marketing term, “HD web”) graphics don’t really need to be 326 pixels per inch (ppi), the iPhone 4/4S’s resolution, or even 264 ppi, the new iPad’s resolution.

The standard practice with web images has always been to render them at 72 ppi, but the fact is, browsers don’t care what resolution an image is set to. A pixel is a pixel, and web images get displayed at the screen’s native resolution (unless, of course, you resize the image dynamically in the browser using HTML dimension attributes or CSS). The Retina Display approach Apple uses is to simply double the resolution (quadrupling the number of pixels). Web images by default get “pixel-doubled” in this scenario, displaying at the same relative size as they would if the iPad still had a low-res display, but appearing pixilated or blurry as a result.

You don’t need to render your images at 264 ppi for display on the new iPad. In fact, you can leave the resolution at 72 ppi, because the browser still doesn’t care. (Well, maybe it does; I haven’t actually had an opportunity to test it, but I strongly suspect the answer is no.) You just need to make the pixel dimensions of the image twice what they were before. In fact, even if you do change the resolution, you still need to double the dimensions. That’s the key.

After mulling all of this over for the past week, I’ve decided I’m going to have to get a new iPad (what a hardship, I know). I could technically do this work without it, but I think it’s important to be able to see what I’m producing, if for no other reason than to remind myself how important it is.

This is going to be an ongoing process, and because web design (or, more accurately, web design implementation — I usually work with designers who produce the initial UI in Illustrator or Photoshop) is only one part of my job, I can’t give it my undivided attention. But it’s something I am preparing now to immerse myself in as fully as possible. From now on, this is just how I do things. And with that in mind, there are some key points to consider:

1. Some images are more important to represent high-res than others. Logos, absolutely, 100%. Design elements that are on all pages (backgrounds, borders, navigation) come next. One-off photos are not as critical, but probably still are if they’re on the home page. But consider the next point as well.

2. Bandwidth is a concern. I’ve been somewhat dismissive of this up to now, as I’ve been focusing on high-res logos for the iPhone’s Retina Display — it can just take the regular web images and show them at half size to achieve high-res — but if you’re suddenly talking about downloading 4 or 5 high-res photos for a home page slideshow, it’s going to be a problem. Making users with standard resolution download unnecessarily large images is bad; making iPad users eat up their 4G data plan downloading your perfect-looking photos is bad too. Most of the attention paid to bandwidth in this discussion that I’ve seen so far has focused on the former, but both need to be addressed.

3. CSS and SVG. Joshua Johnson talks about this in his post. If we can render elements using CSS instead of images (things like curved corners, gradients, shadows, etc.), we should do that. More complex vector graphics can be displayed in SVG. All modern browsers now (finally) support SVG. Up to now it’s been a cool but essentially useless technology, due to lack of widespread support. But IE8 and earlier don’t support SVG, so if those browsers matter (and unfortunately they probably still do), you need a backup plan.

It is an exciting time to be working in web design and development. More and more, the challenges center around adapting your techniques to take advantage of cool new features and capabilities, not accommodating the limitations of crap browsers. But they’re still challenges, and we’re just beginning to discover their depth, along with their solutions.

Update: Over at Daring Fireball, John Gruber just linked to Duncan Davidson’s post detailing an issue with WebKit (the rendering engine inside Safari) automatically scaling down images above a certain size, specifically over 2 megapixels. Looks like sending huge, high-res images to the new iPad might present even more challenges than the ones I’d been considering.

I still don’t have that new iPad, so we’ll see what happens when I get it. (Tomorrow?)

Update #2 (March 25, 2012): A few more days have passed, and more has been learned on this topic. Duncan Davidson has a follow-up post that further explores the issue and a tentative path forward.

P.S. I did get that new iPad, and Duncan’s demo of an 1800-pixel JPEG on the iPad’s Retina Display is truly impressive. But what I find really interesting about it is that the 1800-pixel version of the photo looks better than the 900-pixel version even on a regular computer display… because, as I’ve observed, WebKit downscales images better than Photoshop does.

Vexed by OpenX: the case of the missing statistics

I am not a huge fan of online ads. But I recognize they are a necessary part of some business models, including those of some of my clients. As such, it is my obligation to offer — and support — a solution.

Knowing what I now know, I would not be likely to recommend OpenX to any client. In 2008, however, I was new to the world of ad server software, and took someone else’s recommendation to go with OpenX. Much has changed since 2008, but — for better or worse, and I’m leaning toward worse, mainly because I’ve come to realize how bad OpenX is, and that there’s probably not any better alternative — that client is still relying on OpenX for their web ads.

The intervening years have brought a handful of challenges where OpenX is concerned. Besides its excessive complexity (143 data tables! most of which by this point either contain 0 records or over 2 million!) and inscrutable structure (why are statistics a “plugin”? and why are the built-in plugins not actually installed automatically?), it is notoriously susceptible to security exploits.

Such was the case about a year ago, the first time I ran into the problem of missing statistics, when I ran the version 2.8.8 upgrade to patch a hacked installation.

This time around, I had only myself to blame. An errant maintenance script in my own CMS had inadvertently deleted all of the files in the openx directory, effectively wiping out OpenX, though thankfully leaving the precious data tables untouched. I had an outdated backup that contained most of the ad assets, and the client was able to provide replacements for the newer ones, so within the same day we were back up and running, serving ads on the website again.

Except… no statistics.

My second mistake was that I hadn’t made notes of the solution I had eventually discovered the first time we ran into this problem, so I was forced to spend several days once again trying in vain to hunt down the solution on Google. Today I finally did, so I would like to share it here, with the deepest gratitude to its author, Frederik Schøning.

Before I detail precisely what did, at long last, restore statistics to our OpenX installation, I want to describe a few of the things I did before that, which did not solve the problem, but which may have been critical to my ultimate success. (I’ve learned over the years that, when debugging, one problem may obscure another, and that there’s rarely only one thing wrong.)

First, installation itself. For quite a while, OpenX required you to jump through a number of frustrating hoops just to get the actual installer. Recently, they’ve cut the crap and provided a direct download link. I ran the installation, snagging briefly on the fact that my data tables already existed. The installer sort of accounts for this situation, however, allowing you to upgrade the existing data tables instead of creating a brand new database. (This, I believe, is where my problems with statistics began. More on that in a minute.)

After installation, I went through several iterations of repairing data tables, fixing file permissions, copying files from my old installation (be sure to keep that around, if possible!), etc. Lather, rinse, repeat. I spent a lot of time in the Maintenance section of the OpenX admin system, trying to get the plugins to stop reporting errors.

Here’s a key problem: statistics in OpenX require the openXDeliveryLog plugin (possibly among others). Although it comes with the installer, it is not installed by default. There are empty folders under plugins where the plugins should be. Instead, the plugins are all zipped, inside the etc/plugins directory. Fortunately, when running OpenX as the administrator account, you can go to the Plugins tab and install them. Unfortunately, they still probably won’t stop reporting errors, because not all of the files end up in the right places. I had to extract openXDeliveryLog.zip and manually place the files for the deliveryDataPrepare plugin, a prerequisite for openXDeliveryLog.

A few more lather-rinse-repeat cycles and I got the plugins to stop reporting errors. But I still wasn’t getting stats. That’s when I discovered Frederik Schøning’s blog post, and was reminded that last time this happened, the problem was a second administrator account in the database. As he suggests, last time I was convinced this happened when the system got hacked. This time, I’m pretty sure there was no hack; the duplicate administrator account seems to have been created while I was running the installation/upgrade process (as hinted at above).

If this is the case, then the OpenX installer is broken on upgrade, and it creates a situation that breaks statistics reporting. Fortunately, it’s pretty easy, if you have direct database access, to remove the duplicate administrator account. Check the ox_accounts table for more than one record with account_type set as ADMIN:

SELECT * FROM `ox_accounts` WHERE `account_type` = 'ADMIN';

One of these should have account_id equal to 1 since it’s the first account you create. Delete the other:

DELETE FROM `ox_accounts` WHERE `account_type` = 'ADMIN' AND `account_id` != 1;

(Be sure to change 1 in that query to whatever the lower numbered account ID is, if it’s not 1. Or you could make the last bit = 80 or whatever the higher numbered account ID is. In my case, it was 80, but I suspect that will vary.)

Next, you need to make the proper admin account the system’s configured admin account again. That’s in the ox_application_variable table. As per Frederik Schøning:

UPDATE ox_application_variable SET `value` = 1 WHERE `name` = 'admin_account_id';

(Again, if your correct admin account’s ID is not 1, change the 1 to the appropriate value.)

As soon as I made these changes in the database, statistics were instantly working again. And I could stop thinking about OpenX… until the next crisis hits.

But before I stop thinking about it entirely, I want to pose a couple of questions to ponder:

1. Why, when updating an existing installation, does OpenX create a new administrator account?

2. Why are broken statistics the only (readily apparent) problem resulting from the presence of that second administrator account?