Nov 05

Finally, one-line endianness detection in the C preprocessor

In 30 years of C programming, I thought I’d seen everything. Well, every bizarre trick you could pull with the C preprocessor, anyway. I was wrong. Contemplate this:

#include <stdint .h>

#define IS_BIG_ENDIAN (*(uint16_t *)"\0\xff" < 0x100)

That is magnificently awful. Or awfully magnificent, I'm not sure which. And it pulls off a combination of qualities I've never seen before:

Continue reading

Oct 30

Dell UltraSharp 2713 monitor – bait and switch warning

I bought a Dell-branded product this afternoon. That was a mistake I will not repeat.

Summary: the 2713UM only reaches its rated 2560×1440 resolution when connected via DVI-D. On HDMI it is limited to 1920×1080; on VGA to 2048×1152. This $700 and supposedly professional-grade monitor is thus functionally inferior to the $300 Auria I still have connected to the other head of the same video card, which does 2560×1440 over any of these cables.

Two things make this extra infuriating:

I spent more than four hours on the phone with three different Dell technical-support people to find out that not only don’t they know how to fix this, nobody can give any reason for it. It’s a completely arbitrary, senseless limit. The monitor’s EDID hardware apparently tells lies to the host system that low-ball its capabilities. This couldn’t happen by accident; somebody designed in this nonsense.

And then neglected to tell potential customers about it. Nothing anywhere in the promotional material for this monitor even hints at these limits, and Dell’s own technical support people haven’t been clued in either. Bait and switch taken to a whole new level.

(Why did I buy a Dell product? Because it was the only thing I could get my hands on same-day that matched the specs of my other Auria, which went flickery-crazy early this afternoon.)

When I unloaded about this on Tech Support Guy #3, he passed me to a marketing representative. I explained, relatively politely under the circumstances, that I has over 15K social-media followers and was planning to give Dell a public black eye over their repeated bungling unless somebody gave me a really good reason not to.

She declined to send me $400 so I wouldn’t have been taken worse than by buying another Auria, then passed me to somebody she described as a manager. But I could tell by the accent he was just another drone in a call center in East Fuckistan who had neither the ability nor the intention to improve my day. After two more iterations of this I had had enough and hung up.

Dell. You pay more, but you’ll get less. Pass it on.

(Yes, I typoed the model number originally.)

Oct 29

Your money or your spec

reposurgeon has been stable for several months now, since the Subversion dump analyzer got to the point where people stopped appearing in my mailbox with the Pathological Subversion Repository Fuckup Of The Week.

Still, every once in a longer while somebody will materialize telling me they have some situation in a repo conversion that they want me to help them fix. The general form of these requests is like this. “I have {detailed description of a branch/merge topology nightmare that makes Eric’s brain hurt to contemplate}. What do I do to fix it?”

I am now going to announce a policy about this. There are exactly two ways ways you can get me to solve your repository problem.

Continue reading

Oct 19

Stratum 1 time server on a tiny SBC?

I’ve been working on GPSD a lot recently – we’re heading towards a 3.10 release with a lot of new features. As part of this release I’ve decided to ship a HOWTO on setting up a high-quality NTP time server using GPSD. In the course of working on that, I’ve had an idea.

The idea has two antecedents. One is that if you start with any one of several inexpensive GPS modules (my favorite of which is the u-blox 6), and add GPSD to read it and feed an ntpd instance, it’s possible to build an NTP server that meets the usual standard for public Stratum 1 time servers – 10mSec or better accuracy to UTC.

The other is that there is a raft of inexpensive SBCs that run Linux out there – Arduino, Raspberry Pi and the current new hotness BeagleBone. So here’s my thought: why not build a low-power Stratum 1 timeserver on a credit-card-sized SBC?

Continue reading

Oct 06

Sometimes I hear voices

I had a very curious experience recently. I discovered that I know what it’s like to be insane. No, save the obvious jokes; this is interesting.

This came about because I read a magazine article somewhere which I cannot now identify – recent, online, a relatively prestigious publication with a tradition of think pieces – about patterns in delusional schizophrenia. [UPDATE: the article was How reality caught up with paranoid delusions.] The thesis of the article was simple: though the content of schizophrenic delusions changes wildly in different cultural contexts, there’s an underlying motivation for them that never varies and produces a fundamental sameness.

Continue reading

Sep 25

coverity-submit 1.10 is released

coverity-submit automates the process of running the Coverity static checker’s front-end tools and shipping the results to their public server for analysis.

One bug fix, two minor features. The build-version (-b) and description (-t) options now have sensible defaults. When run from a repository, the default for -b is the commit ID of the head revision. The default for -t is an ISO8601 release timestamp.

Actually, the build-version default presently only works in a git repo. I’ll cheerfully take patches that support other version-control systems.

Code here.

Sep 24

Can micropatronage save the net?

How can we fund common Internet infrastructure without risking that it will be captured by corporations or governments? He who pays the piper tends to call the tune, which is a bad thing when you don’t actually want the content of your network to be controlled.

This is a problem I’ve been worrying about a lot for the last couple of years. I’ve been working on one organized attack on it that I’m not ready to talk about in public yet (but will be soon; some of this blog’s regulars are already briefed in). I’ve just found something else that might help which I can talk about: micropatronage.

Continue reading

Sep 03

The Smartphone Wars: Nokia gives it up for Microsoft

It’s been quite a while since I wrote a Smartphone Wars post; I let the series lapse when I concluded that the source I was using for U.S. market share figures had likely disconnected from reality (and more recent surveys from other sources suggest I was right). But the developments of the last couple of days demand comment. Nokia has sold its phone business to Microsoft; Stephen Elop has returned to Microsoft to head its devices group; and there is talk he might succeed Ballmer.

You couldn’t make this stuff up for a satirical novel and have it believed. The conspiracy theorists who maintained that Elop was a Microsoft mole sent in to set up a takeover look prescient now – but a takeover to what purpose? Nokia’s phone business, the world’s most successful and respected a few short years ago, is now a shattered wreck.

And as for Elop: he masterminded what was probably the biggest destruction in shareholder value ever – and this is the guy who’s being talked of as Ballmer’s successor? Astonishing. On his record, the man isn’t competent to run a Taco Bell store; that that he’s even in consideration suggests Microsoft’s board has developed some perverse desire to replace a strategic idiot with an even more wrongheaded strategic idiot.

Continue reading

Aug 30

Fixing the fast-food strike

So, thousands of fast-food workers are out on strike against the national burger chains, demanding that their wages be doubled to $15 per hour. But the national chains don’t control employee wages; how much to pay their people is in the hands of local franchise owners,

Therefore, if you are one of the concerned, caring, and vastly indignant activists behind this strike, I’m here to tell you that your social-justice problem has a simple solution. Take out a loan (or put together the money from your like-minded activist friends), buy a franchise from one of the chains, and hire workers at $15 an hour.

There, that was simple, wasn’t it? You’ll make money hand over fist and demonstrate to all those eeevil corporations that they can too pay a “just wage”; they just don’t want to because they’re greedy.

Or…maybe not. If it were that simple, everyone would be doing it. The commercial landscape would be alive with virtuous workers’ collectives paying their members fat wages and thumbing their noses at top-hatted plutocrats. Why doesn’t this happen?

Continue reading

Aug 27

Hunger Games for real

“Students can only have one serving of meat or other protein. However, rich kids can buy a second portion each day on their own dime.” This is from coverage of Michelle Obama’s national school-lunch regulations.

Protein-starving the peasantry so it will remain docile and biddable is a tyrant’s maneuver thousands of years old. I was unaware until today that this has become official policy in the American public school system.

How clever of them to sell it as a healthy-eating measure! That’ll get all the gentry liberals on board; of course, their kids will be buying that second serving.

Aug 24

Questioning transsexuality

In Bradley Manning Is Not a Woman, Kevin Willamson makes a case that feeling like a transsexual – that is, that one is either a man in the body of a woman or vice-versa – should be regarded as a mental illness to be treated by therapy rather than with sex-reassignment surgery.

The article surprised me by presenting a coherent case for this position that I cannot dismiss as garden-variety social-conservative chuntering. I found the parallel with what Willamson calls BIID particularly troubling. If we treat people who desire to electively amputate their own arms and legs as mentally ill, why do we judge people who want to amputate the genitals they were born with any differently? What makes one an illness and the other a lifestyle choice?

Continue reading

Aug 23

vms-empire 1.10 released

There’s a genre of computer games called 4X (explore/expand/exploit/exterminate). well-known examples of which include the Civilization series and Master of Orion.

Ever wonder what the ur-progenitor of this genre was, the game at the root of 4X in the way Colossal Cave Adventure created the genre of dungeon-crawl games? It was Walter Bright’s game “Empire” from the early 1970s. You can read about it at his page on Classic Empire.

Since 1994 I’ve maintained an early Empire workalike written by Chuck Simmons in 1987 to run under the now-extinct VMS operating system; it was ported to Unix immediately, and remains to my best of knowledge the only open-source version or variant of Empire available.

Walter Bright does not acknowledge this version’s existence on his Empire page, which is fair because he didn’t write it and probably doesn’t consider it to be “Empire” at all. But it is close in gameplay and style to the earliest of Bright’s versions, except for being able to display its crude character-cell maps in color (I added that back when color terminals were cutting-edge technology).

If you love Civ or MOO, try this out for a look at what the computer 4X game was like before pixel graphics. The display and command interface are primitive by today’s standards, but the AI and general gameplay have held up surprisingly well. It’s instructive to see how many of the core tropes of later 4X games are already present in this one.

You can get version 1.10 of VMS-Empire here.

Aug 14

Summer vacation 2013

The last couple of weeks have been my vacation, and full of incident.This explains the absence of blogging.

First, World Boardgaming Championships. I did respectably, making quarter- and semi-finals in a couple of events, but failed in my goal to make the Power Grid finals again this year and place higher than fifth.

I did very well in Conflict of Heroes, though; my final game – with the tournament organizer – was a an epic slugfest that attracted the attention of Uwe Eickert (the game’s designer) who watched the last half enthralled. I lost by only 1 point and was told I’d be put on the Wall of Honor. I like my chances at the finals next year.

Then Summer Weapons Retreat. Huge fun as usual; I spent most of the week working on Florentine (two-sword) technique. with some excursions into polearm and hand-and-a-half sword. I’ve posted a few pictures on my G+ feed.

First full day I was home, a thunderstorm blew out the router in my basement. Yes I had it on a UPS, but ground surges (though rare) do happen; this one toasted the Ethernet switch. Diagnosing, replacing, and dealing with the second-order effects of that ate most of yesterday.

Now life is back to relatively normal, though it will take a few days for the muscle aches from a week of hard training to entirely subside. Blogging will resume.

Jul 28

Victory is sweet

Ever since the open-source rebranding in 1998, I’ve been telling people that “open source” should not be capitalized because it’s an engineering term of art, and that we would have achieved victory when the superiority of (uncapitalized) open source seeped into popular culture as a taken-for-granted background assumption.

There’s a thriller writer named Brad Thor who I never heard of until he publicly offered to buy George Zimmerman any weapon he likes as a replacement for the pistol the police impounded after the Trayvon Marin shooting. What Thor was really protesting, it seems, was the fact that Zimmerman didn’t get his pistol back when he was acquitted; instead, the federal Justice Department has impounded it while they look into trumping up civil-rights charges against Zimmerman.

This made me curious. The books are pretty routine airport-novel stuff, full of exotic locations and skulduggery and firefights. Like a lot of the genre, they have a substantial component of equipment porn – lovingly detailed descriptions of weapons and espionage devices.

Amidst all this equipment porn the characters casually use “open source” (specifically of encryption software) as a way of conveying that it’s the best available. And the author writes as though he expects his readers to understand this.

Victory is sweet.

Jul 26

Preventing visceral racism

I’ve been writing about race and politics a lot recently. Now I’m going to reveal the reason: in the relatively recent past I had a very disturbing, novel, and unwelcome educational experience. For the first time in the fifty-five years of my life I found out what it was like to feel racist, from the inside.

I think I now understand the pathology behind racism better than I did before, and have some ideas about what is required to prevent and cure it. And no, my prescription won’t be any of the idiotic nostrums normally peddled by self-described “anti-racists”; in fact what I have to say is likely to offend most of them – which I don’t mind a bit.

Continue reading

Jul 17

Objective evidence against racism

A theme I have touched on several times in my blogging is that the best way to defeat racism and other forms of invidious discrimination is to develop and apply objective psychometric tests.

Usually I make this argument with respect to IQ. But: one of my commenters, an obnoxious racist who I refrain from banning only on free-speech principle, recently argued that drug use should be (as, in fact, it now often illegally is) treated differently by police depending on the subject’s race.

His argument (if you want to call it that) is that blacks, due to a low baseline level of self-regulation, are significantly more prone to criminality and violence than whites when intoxication further impairs that ability. Thus, the law should treat these cases differently as a matter of public safety.

As presented, this prescription is racist, repugnant, and wrong. Because even if you believe that blacks as a group have less ability on average to self-regulate, this belief tells you nothing about any individual black person. Acting on it would infringe the foundational right of individuals to be treated equally by the law.

But now let’s perform a thought experiment. Actually, a couple of related ones.

Continue reading

Jul 06

After such knowledge…

I have read very little in the last few decades that is as shocking to me as this: Essay by a teacher in a black high school.

My first reaction was that I wanted to believe it was a bigot’s fabrication. I’d still like to believe that, but it was reposted by a black man who claims it is representative of “dirty laundry”: bad stuff [known among blacks] about black folk never to be said around whites.

My second reaction, afterwards, was: for those of us who insist that people ought to be judged by the content of their characters rather than the color of their skins, what emotionally compelling argument do we have against anti-black racism that reading this doesn’t blow to smithereens?

This is a question with more point now than it would have had thirty or fifty years ago, because of one thing this account makes harrowingly clear. White people didn’t impose the depraved, thuggish underculture it describes on black people; they did it to themselves, using a debased form of the rhetoric of white “anti-racists” and multiculturalists as rationalization.

Of course, all the rational arguments against racism are still sound; I’ve written about them pretty extensively on this blog. The mass is not the individual, etcetera, etcetera. Nothing about the ugly, barbaric rampaging of these high-schoolers predicts the behavior of the blacks of the same age or older I know from martial-arts schools, SF conventions, and other places where the lives of black individuals intersect with mine.

But if this is really where they came from – if this is what they’re right-end-of-the-bell-curve exceptions to, and that reality becomes widely known or believed – rational argument won’t be enough. How can we keep the bigots from winning?

UPDATE: I’ve replaced the link I got from the blog “Maggie’s Farm” with a link to what seems to be the original. The Maggie’s-Farm link is now behind the word “reposted”.