Beijing, August 2008

August 26th, 2008 by mortenw

Security at this year’s Olympic Games in Beijing was impressive, at least to my five-year old son, _L_: one of the first things he built with his limited supply of Lego was a security checkpoint. I am less impressed.

It started in the airport. They wanted to scan all carry-on luggage upon arrival. I have no idea what they were looking for, but the scanning took place after people collected their checked luggage and had had a long time to move things back and forth thus making the scan effectively optional and thus pointless.

All subway entrances and all sporting venues had checks too, so authorities must have hired and trained thousands of new security people. All these people have no real experience and are constrained by having to maintain the flow of people uninterrupted. Just like when TSA was created, that makes for lousy security.

For example, when entering the venue for the US-China basketball game — where the US President was expected to attend — I arrive with my bag and camera. The bag goes into a scanner and gets hand-checked afterwards. Apart from a lot of fuss over an epipen, nothing happens. My camera comes with me through the metal detector which, of course, beeps. I get hand scanned. In other words, I just walked through with three pounds of unscanned equipment that looks like a camera! (It happens to be a camera, but how could they know?) That same equipment I later pointed at George and got a few pictures of him looking rather silly. Using the same tickets I could have walked through several times, so the size of a camera is not a limitation.

At another venue I accidentally brought a bottle of water with me. As you may know, water is a substance that is dangerous at sporting events, but not in subways. When found at a security checkpoint for a sporting venue it will be confiscated, but as a side effect, the security officer who found it will be so happy with himself that nothing else you carry will be checked. That is humanly understandable and shows that checking for liquids in the first place probably lowers the level of security. There are simply too many false positives, i.e., cases where harmless liquids are detected. Think of that the next time you wait in line at the airport.

Also, I have noticed — both in Beijing and in airports around the world — that when I put my camera equipment into my backpack, the backpack gets hand searched. I am fairly certain that it is because the operator of the scanner just sees a pile of stuff that he cannot identify, so a hand check is in order. The backpack I use is nothing special, but happens to have a lot of compartments. Generally, when the backpack is searched they miss half the compartments unless I feel like telling them.

This is all from passive observation while minding my own business. I am not trying to probe, let alone evade, security anywhere.

Conclusion: since stuff is not blowing up left and right, either the bad guys (a) are not trying; (b) are not thinking like I do; or (c) get caught or scared off by less visible parts of the security apparatus.

Applications

July 16th, 2008 by mortenw

I my optics, computers are here to get certain jobs done. That means it is all about applications, not eye candy: bouncing icons, themes, semi-transparent windows. My real-life work desk is not transparent, and I do not use semi-transparent paper.

Producing large applications is a lot of work, so when I write a piece of (hopefully) well-designed code, I want that code to stay written. I do not want next week’s GTK+ deprecation to come along and, effectively, cause my code to bitrot. (and I really do not want to write two different pieces of code for the job: one for “old” GTK+ and one for “new” GTK+.)

Moving from GTK+ 1.x to GTK+ 2.x was painful. I do not need anything like that again. Talks about breaking API every 3-4 years and advice like “Stay up to date, adapt your application code early” (and, by implication, often) is a clear indication that keeping applications running is likely to mean spending much time cleaning up after someone with an attention span of a few years.

Maintaining code like GTK+ is not hard. Calling it hard because you want to play with some new toy is deceiving.  Maintaining can be tedious, but if you do not want to maintain, please do not start writing new GTK+ code. You will surely abandon that prematurely too, so you have no business writing library code. Instead, go write a useful application: if you abandon that, I probably do not have to care.

tab = lose

July 13th, 2008 by mortenw

The best thing about tabs that I can think of is that it will keep certain people from doing more harmful things like changing the gtk+ api for no good reason.

(The header line is a translation from Danish into English.)

Economics, Part II

February 15th, 2008 by mortenw

I like to turn Robert’s economics articles up-side-down. They make so much more sense when you do that.

So, out there we have a set of holders of mortgage backed instruments that they got through various middle men from borrowers of poor financial strength. The current holders ought to have done their due diligence before they bought in — if they did not, we have no sympathy over their fates. So let us assume that they did.

Clearly they saw the risk of a market wide event affecting a very large number of people, lots of those being voters. Clearly they researched the history of political response to such situations. Clearly they saw the serious risk of the rules being changed underneath them. They saw that, they understood that, and surely they priced that into their bids. Thus, if the rules are changed underneath them, they are not suffering any consequence the risk of which they were not paid to take. One could go as far as saying that a lack of political intervention would be an unforeseen windfall for them. That would be a subsidy they do not deserve.

Actually, the investors likely did not have full information available, but had to rely on the representations of the financially engineering banks and the ratings institutes. Investors should have priced such a lack of knowledge in too, but might have a case against the middle men if they were defrauded.

That being said, I have not read and I do not intend to read the specifics of the proposed plans. In fact, paying attention to the promises of political candidates in right races is a waste of time — they will promise you anything. It is in their blood.

Economics

February 4th, 2008 by mortenw

It seems like Robert has been reading too many books on economy again. Or rather, has failed to apply the necessary simple sanity checks to what he has been reading.

Authors on books on economy like simplifications and words like “equilibrium”. For example, they might discuss an equilibrium governing the hourly wages and claim that absent any floor on wages, they will find a level where everyone who wants to work is employed. The sanity check for the is the great depression period: no floor, but widespread unemployment. Conclusion: something is seriously wrong with the model or the assumptions.

Robert this time brings us this gem: “The tax on capital gains is a burden on investing. The tax lowers the returns on investment, thus discouraging investment below where it would be in equilibrium [...]“.

First simplification: “equilibrium”. We do not live in a static world so assuming an equilibrium is not reasonable. Why should there be one?

Second simplification: assuming the potential investor has a choice between investing or not investing, presumably in some stock. In reality, someone with spare (or borrowed) cash has multiple choices: investing [high return; high risk], stuff the mattress [no return; sore back], put in bank [low return; high tax], etc. Notice the total lack of “not investing” as a choice. The general assumption is that the would-be investor does what is optimal (whatever that means). I don’t buy the argument that a capital gains tax makes people put more money in the mattresses.

Third simplification: the government is also not faced with a choice of imposing the tax or not imposing it. Really. Those two choices do not come with the same revenue, obviously, and the real choice is thus more between imposing the tax and not imposing combined with not building this or that highway. Or taxing elsewhere. Or borrow the balance. Or whatever. The historically aware reader will recall that lowering taxes while hand-waving and saying that revenue would go up as a consequence was proven wrong last time.

Fourth simplification: “The tax lowers the returns on investment.” That is true, but incomplete. The tax works on the loss side too and thus also lowers the risk of an investment which, presumably, encourages investment.

The conclusion of that is that we have a partial proposal whose effects have been judged by a hopelessly oversimplified model. Hence predictions on the effects are meaningless.

For the record, my income is primarily classified as capital gains. I would actually stand to make a killing if the capital gains tax went away. I am just the mouse who wants to know the price of that yummy cheese before I eat it.

Themes Are Evil, Part II

February 2nd, 2008 by mortenw

In a previous post, I showed how a GTK+ theme engine can corrupt memory of any application unfortunate enough to be used with it.

In today’s edition, our guest star is the Qt theme engine. It does not, as far as I know, corrupt your memory or otherwise make your innocent application crash.[*] Instead it changes how your program works. For example, for Gnumeric it changes how numbers imported are handled.

If you import the number “8,5″ in a decimal-comma locale then you would hope to get eight-and-a-half, right? Well, with the Qt theme you get eight and we, the Gnumeric team, look incompetent. The problem arises because the Qt theme, quite reasonably, initializes the qt library. During that, less reasonably, the following code gets executed:

setlocale( LC_ALL, “” ); // use correct char set mapping
setlocale( LC_NUMERIC, “C” ); // make sprintf()/scanf() work

I am not kidding. The Qt library thinks it should change your locale. What on Earth have the Trolls been drinking? Impure home destilled booze in large quantities?

This problem in various disguises have had us puzzled for quite a while and only very recently was the Qt theme identified as the triggering factor. Once that happened, it was not too hard to locate, but before that we have spent maybe 40 hours looking for this bug. The workaround is to set up a one-shot idle handler that resets the locale properly when the gui comes us. (Repeat this for every GTK+ program that displays or accepts floating-point values.)

The Qt theme people never caught this. If they are mostly “theme” people I can understand, but if they are mostly “Qt” people they really should have known. In either case, it is another exhibit for the case that the GTK+ theme model is seriously flawed.

[*] Well, if you use threads it might. The Qt library calls setlocale to change locale and that’s not allowed in a threaded program.

Progress in the Printing World

January 25th, 2008 by mortenw

With gedit moving from gnome-print to gtk-print there is probably only one gnome-print user left, namely abiword.

This is amazing progress in the sense that instead of using gnome-print which is basically unmaintained and doesn’t work on Win32, we can now simply use gtk-print which is basically unmaintained and doesn’t work on Win32.

Toys…

December 25th, 2007 by mortenw

_C_ managed to find a Wii at msrp locally and turned it into a Christmas gift, allegedly for the kids. We have all been playing all evening and I am all sore.

I feel a little bit sorry for all you guys who have to wait until Christmas morning to open the gifts, :-)

Murray, A Retraction is in Order

November 26th, 2007 by mortenw

(By blog and email.)

Murray, a retraction of that post is in order.

Here is why: I do not think, and you have certainly offered no evidence, that you are competent to diagnose the mental state and ditto ailments of other people. If you in fact do have such credentials from a respectable medical school, now would be a good time to display them. (And to inspect an inquiry from the relevant ethics committee.)

The truth or falsity of the rest of your post is utterly irrelevant. I do not know if it is true or false; I do not care. You have evinced seriously bad judgment and deep character flaws.

main-menu

November 14th, 2007 by mortenw

I have noticed that main-menu on my system is a bit of a pig. It takes up something like 30 cpu minutes per day. That is kind of crazy considering I don’t really use it much. Certainly not every day. So what does it do?

  • It reads /proc/mounts and /proc/partitions. It then stats everything mentioned in there.
  • It appears to be talking to NetworkManager via dbus.
  • It stats about 100 directories like /usr/local/share/icons

And it does all of those every few seconds.