Archive for 2007

how Norwegians play football

February 7th, 2007

Yes, this is one of those sweeping generalizations. Doesn't apply to everyone, of course, in fact the professionals don't fit into this profile, but it describes the casual practitioners (and the semi-serious ones) to fairly wide extent.

It's a Norwegian saying that "you're born with skis on your feet". This sounds silly, I have the feeling that skiing is losing ground and going from completely universal (as it was when I grew up) to more of a special interest discipline. Mind you, going that way, I'm not at all suggesting skiing isn't popular anymore.

Now football is the biggest sport, everyone's played at one point, most boys have played on a team as well. But when you see people play football, they approach it as an exercise, less so as a game where you play to win. I was out Saturday night on the astroturf by the Rosenborg stadium, great field, we've played there for years. With us, two young (~15-16) kids, looked maybe Turkish. Out in the rain and wind, playing for almost 2 hours, just like we've done all these years. Commendable, they have the drive for it no doubt, and judging by their skill they do this often.

So how did they play? You could see from far away that they play at a club, and they've had that Norwegian football influence shape their concept of the game. It's uncanny, Norwegians treat football as a stamina exercise. A way to get sweaty and feel good about yourself. No wonder they dress up for football just the way they do for cross country skiing, because what they're doing out there is very reminiscent of it.

The mindset has changed, it's more about ball skills now. You see little kids out there with waay more skills on the ball than my generation had. The pitches are better too now, we used to play on gravel. The Norwegian classic is the corner kick. If you see about 7-8 guys playing, with one guy taking a corner and the rest stacked in the box, waiting for the ball (and not really caring whether it comes to them or not), you can be sure they're Norwegians.

But in a sweet kind of irony, those kids with ball skills and decent general ability still play like it were cross country skiing. There's intensity to the game that comes from running and keeping up a pace, but there's no explosiveness, there's no sprints, no real athletic kind of desire to win. These kids that played on the other side of the field from us, what were they up to? They passed the ball to each other, ran around in small circles and took shots on goal. But not once did they accelerate at full pace, not once did they take a really strong shot, not once did they launch a forward pass way ahead for a real run. It was all so casual and shy, so Norwegian. It's almost as if there's more aggression in cross country than in football with these people.

It's like, if I run at full pace, then the guy marking me will too, because it's his responsibility (and Norwegians have a very strong sense of that) to not let me go past him. But he will *never* sprint on his own account, because it's just not in his blood.

Of course, when you play competitively for a club then you don't do this, when you run you actually run. But when it's casual and "just for fun", that real instinct never comes out, and that's something I've never been able to understand. If you never run at full pace in practice, how are you ever going to do it in a match? Are you saving yourself or something? If so, why? The whole point of playing is to do the best you can, that's when it's the most fun. So why hold back?

keepalive.sh: restarting flaky applications

February 5th, 2007

Sometimes you just want an application to run in the background for whatever reason. One that tends to crash. Well, if you're not there when it crashes, you can't start it up again. So what to do? The obvious answer is "fix the damn application already!" But maybe you don't have the source code. Or you don't know how. Or you can't be bothered. Or whatever. And you just want a way to automatically restart the application whenever it crashes.

I didn't know how to do that before, so I never had a solution for those rare cases when this was needed. But it's very easy to do.

#!/bin/sh

if [ "x$1" = "x" ]; then echo "usage: $0 <application>"; exit 1; fi


app=$1
echo "Running $app"


$app &
pid=$!
while ((1)); do
	if ! ps $pid; then 
		echo "Restarting $app"
		$app &
		pid=$!
	fi
	echo "pid: $pid"
	wait $pid
	sleep 30
done

Here's how keepalive.sh works.

  1. It starts the application.
  2. It captures the pid.
  3. Now it starts an infinite loop.
    1. Check the pid to see if the app is running.
    2. If the app is not running, start it and capture the pid.
    3. Otherwise just wait for it to finish.
    4. Goto 3.1.

It doesn't matter if you stop the application in a standard way, if you kill it, or if it dies on its own. Within 30 seconds it will be restarted. The short delay is included so that an application that dies instantly won't keep restarting and dieing all the time, bringing your system to its knees. Until you stop keepalive.sh, it will keep looping forever.

impossible to find: socks

February 4th, 2007

Sometimes it's the simplest problems that are the most difficult. Like buying socks. In the last month or so I've looked all over the place, spanning three different countries, and come up with zip. How hard is it to find socks? Hard. The socks I own were rare finds in the first place, and it's times like these that make me wish I had bought 4 times as many of them. It's not that socks wear out, which they do. But they also have a way of going missing. A couple years down the line you suddenly have fewer pairs than you used to, for unexplained reasons.

This is what I'm looking for. Cotton socks. Cotton, okay? Not polyester, polyamide or any other plastic-like sweaty fabrics. When you pick up a pair you can tell right away if the fabric is good, or if it feels more like it's plastic mixed in that will make your feet sweat. Even 20% polyester will do that. I don't mind elastics, though, that's fine. But the rest has to be cotton, or the deal is off. And while I've bought cotton socks lots of times, they're always rare. So rare for the moment that I can't find them anywhere. Maybe I should look on ebay.

where is your company again?

February 3rd, 2007

Location, location, location! Remember when that used to be important for business? Well, it's not important for e-business. Take GNi (mentioned in the last gentoo newsletter). Nowhere on the front page does it mention where their offices are. It doesn't say "we're a San Jose-based company ... ". How many clicks does it take you to find their location? I first went to "About Us", but that had no mention of it. Apparently, location is not relevant to a page about the company. Then I went to "Contact Us", which is usually a safe last resort. And sure enough, there it is. But GNi has a small website, on some company sites it takes me a bit of effort to even locate the "Contact Us" page, it's buried somewhere deep in the hierarchy, or the link is in 6pt font, so you're not meant to see it.

So I can only conclude from this that location doesn't matter. And in our globally interconnected world that may seem obvious. On the other hand, it may not. If you're looking for a web host, wouldn't you rather pick one in your timezone? So that when the server crashes, they have office hours at the same time as you? Or wouldn't you prefer a partner in your timezone for just about any kind of business? Or in fact in your vicinity, so that you don't have to fly to Cape Town for meetings?

powerpoint productivity

February 2nd, 2007

I find it interesting that office suites are often dubbed "productivity suites" by vendors. Of course, they are "productive" software compared to say.. Solitaire, but are they really "productive" in the absolute meaning of the word?

Claim
By making office software easy to use, the user doesn't have to waste time on learning how to use the software, because it's so intuitive that any idiot can use it. And thus you're more productive.

Counterclaim
If it's easy enough for idiots to use, won't idiots use it? Or rather, to be a little more accurate, won't users use it at the intellectual level of an idiot? How, and why, would they rise above that level if it's all they need to get by?

As someone who thinks about software, writes software, uses software, and comments on software, it pains me to see how some people use software. It really makes me sad.

The whole office suite concept was never my cup of tea. I used it because it seemed to be "the way" to write documents, but deep down it always bugged me. Then I got into using latex for document creation and it's like a whole new world opened up. Structured documents, what an amazing thing. It took me a while to get used to the latex way, but that's because I had to de-program myself of those bad habits. Now I wouldn't use an office suite for anything ever.

Here's how Ms Office works. You sit down at the desk, your friend points to the keyboard, you press a key, the character comes up on the screen. This is pretty much the intellectual level at which most people use Ms Word. Of course, the software has other features, it has functions to get things done faster/better/nicer. But most people, and that's probably 90% or more, don't know/don't care/wouldn't care about them. As long as they can just plug along.

I gave a presentation about two weeks ago, I had 20 slides, and it took me a couple of hours to write the presentation in latex. I didn't have to re-learn anything, because latex is the same whatever document you're writing. The process was entirely smooth, as it wasn't my first time, so I knew what I was doing. I've done maybe three presentations in latex, and by the third one I felt completely comfortable.

Last week my group was obliged to give another presentation, and this time another guy did the honors. But we all wrote it together, so he manned the computer while we discussed the content. A computer screen tends to draw your eyes in, but I was fighting the urge, I really couldn't stand it. First the guy designed a little logo in Ms Paint, which he included into the slides. When I said the logo could use a slight modification, he had to change the image on every slide one by one. Then he thought it would be nice to have a little index of the presentation on the side of the slides, which was a nice touch. So everytime he added a slide or renamed another, he would update the index on every single slide manually. Then it was the layout.. when he combined images with text, or even just when adding lists of points, often the layout wouldn't fit, there would be a forced linebreak, or something would clash, so he had to reposition the text fields. He spent more time doing these updates than actually adding content, in the form of keywords mostly. I felt like chewing my arm off watching this.

Yes, Ms Powerpoint might just have templates. And it might just have indexing. But what's the difference when noone uses this? It was certainly not the first time the guy made a presentation, I'm sure he'd done plenty of them before. But this was his level of usage. Because Powerpoint encourages you to act an idiot, that's what people become.

Needless to say, this has very little to do with productivity. Busy work, that's what this is. It's the computer equivalent of digging holes and then filling them. The general level of document creation is just appalling to me. That Ms Office be the standard for exchanging documents, and seeing how bad they look and how incredibly messy the whole process is, it's astounding.