Arnt Gulbrandsen
About meAbout this blog
2015-03-30

Making X11 usable across the internet. A sigh.

I am the fool who tweaked Qt to work with long-distance X11. The main problem was slow startup; if the ping time to the display was 0.1s, then applications needed 0.5s or more to start. So I fixed that, tested it using Qt/X11 applications on a transatlantic link, then fixed whatever else that I noticed because of the slow link.

As far as I know, noone ever made use of this work.

That didn't prevent someone at Trolltech from trying some of the same again twelve years later, except this time with better buzzwords and more effort.

So why did I do it? I don't remember. Perhaps someone had told me that X11 was network-agnostic by design and Qt's implementation fell short of the design, and I let myself be persuaded. Perhaps I told myself. One thing is sure: Noone had told me that this was a problem for their actual, concrete, existing application.

Maybe my work helped sell a seat or two for Qt. Many people are willing to pay for features or performance they don't need, so it's entirely possible. But I think it was probably waste. I feel good about it, though, because quite recently I was able to avoid a mistake by having learned from those two.

I've been a professional programmer for twenty years now. That seems to be long enough that for whatever mistake anyone proposes to make, I have made or watched a similar mistake at least once before. I'm not sure whether that's good or bad. Seeing a mistake be repeated is such a sad feeling.

2014-04-23

Too much hate for my taste

All the hate against openssl at the moment makes me sick. Yes, it was a bad bug, and yes, the API is frustrating. Still, it reminds me of an episode at, I think, Linux-Kongress in Cologne in 2002, and it is not a pleasant memory.

I wasn't wearing any badge, and hadn't been to many linux events in the eighteen months since I left Trolltech, so some people had forgotten how I look. Including one person, who talked at length about how evil Trolltech was. About 30% falsehood and 50% opinion, and the opinion wasn't favourable. He also mentioned me specifically, with me standing slightly more than one meter to his side.

Haters gonna hate, I suppose, but it was deeply dispiriting all the same. I haven't been to Linux-Kongress since.

2014-03-25

Newfound wealth

I have found fifty-three dollars on my desk. I remember why they're there: 15-20 years ago, someone whose name I have forgotten gave me a dollar to help pay for a haircut and three others then chipped in. Their four dollars have littered my various offices since.

One of the three must've had too much to drink, because now that I look closely, I observe that one bill bears a portrait of Ulysses S. Grant and the number 50. Good. $49 is an appropriate fine for a joke as poor as that one. Justice has been served.

2013-11-18

Someone has to make the decisions

It's weasel wording and angers me. The real meaning of the statement is almost always that someone is me, and we both know I'm not particularly well qualified.

Another ancient Trolltech principle was the person who did the work had final authority over how it was done. Not exactly a result of planning — I think that principle came to be when the passion for quality clashed with the workload. A serendipitous compromise.

2013-10-31

Parsing documentation to find bugs

This is mostly a footnote for my review of Knuth's Literate Programming book. Read that first.

Undocumented arguments often occur where an argument wasn't considered in the code, or where the design is wrong. 50-60% of undocumented arguments were also buggily handled at Trolltech.

That correlation depends on the documentation being written by hand and by programmers. Generating documentation like Ghostdoc does breaks the correlation completely, and starting with mostly-generated text like that from Eclipse also weakens it to uselessness. If you, as a programmer, forget something about the argument while implementing, but someone/something else writes the documentation, then there is little or no correlation between what you forget to implement and what Ghostdoc, Eclipse or a technical writer forgets to mention.

The same applies to undocumented public functions in a class: If there were any at Trolltech, those functions were usually not ready for production use. Scanning for undocumented functions was a quick way to find functions with other problems.

Undocumented nulls and other edge cases are frequently unhandled; at Trolltech I had something to scan for pointer arguments where the word null wasn't mentioned in the same sentence as the argument. It found treasure quite often, but the text analysis was too poor to use it all the time, for example because the null was mentioned in a following sentence. Warnings have to be good, and quite often may or may not be enough.

I've never had a tool that parses both the implementation and the documentation. I wish I had one. It could look for differences and use them. Here are two examples:

When a caller and a callee disagree, the documentation status can be used to point at the most likely guilty function. Suppose x() calls y() and doesn't catch an exception y() may throw. Is that best reported as a problem in x() or y()? That depends on whether the documentation for y() mentions the exception.

If a function takes an enum argument, and the set of enum values mentioned in the code and in the documentation differ, then something is almost always wrong. It may be in the documentation, but in my experience it's more often in the code and sometimes in both.

2013-05-08

Someone should

The should rules went out of fashion at Trolltech after I left. I don't know when, but some people who started in 2006 didn't learn them.

Which is a pity, they were good rules and in my opinion they still are.

The rules were: In a meeting (which at early-Trolltech usually meant over lunch), the phrase we should … meant I will …, and someone should … meant I immediately will ….

The rationale for this is what we should and someone should was weasel wording for I think we should …, but I know I can't persuade anyone else to take on the work. Often (but far from always) noone else thought the result was important enough to justify the working time. Sometimes there were many other reasons. But the reasons don't matter, the results matter, and the should rules made people speak more realistically.

For what it's worth, the rules were suggested by Paul Olav Tvete.

2013-04-12

The Openlinux Lizard

One evening in November 1998, drinking with some of the trolls at Suetelane Paludo's place, I ranted grievously about how installing linux still sucked. I'd spent the day installing a new server. In typical Trolltech fashion, the discussion quickly turned to what we could do about it. We decided that noone at Red Hat or Debian would talk to us because Trolltech was so very evil, Suse suffered from NIH syndrome, but we could talk to Caldera (ie. the German team Caldera formed by buying LST) and maybe get something done.

I put together a proposal (a single-page email, just text). Ralf Flaxa and Stefan Probst at Caldera immediately accepted it.

What followed was great. (more…)

2013-02-06

SEO at Trolltech ca. 1996

My cron-driven alter ego ran several scripts on the Trolltech web server. This is about one I wrote in 1996 and ran every half-hour to make sure that qt-related subjects were well covered by the search engines. At the time, some search requests didn't give as good results as they could have, and I thought the likely reason was that the search engines hadn't crawled the right pages.

But the pages tended to be in the Trolltech referrer log, or if not, then some other page very close to them were.

So I wrote a crontab script to watch for new referrers in our apache logs, and whenever it saw one, it did the following.

First, get rid of spam (yes, even then there were spam pages). The test was simple: At most x% of the text could be links, the page should mention one of a set of keywords, the page could contain at most y links, and at least one link had to point to Trolltech.

If the page passed that test, the script tried to clean up the URL a bit (delete session cookies, delete index.html). Next it tried to locate a higher-level index page linking to the candidate page and other related pages (since submitting an index page gave the search engine more to work with).

Finally, the script would submit either the payload page or the index page to Altavista, Hotbot, Lycos and a fourth engine whose name I've forgotten. I don't think it was Google, Google came later.

It worked very well. Searches for Qt-related subjects gave better results than before, and yes, the search engines saw more links to troll.no. The script ran until shortly before I left Trolltech in 2001. By that time Google had learned to crawl well, and the script laid unused and forgotten until I found it today, while going through and wiping my old hard disks. (Update: The reason I don't know the name of the fourth search engine is that I had put the submission URLs in a configuration file.)

Update: The fourth was, of course, Excite, whose existence I had quite forgotten.