emperor: (Default)
"time" is a reserved keyword in bash, not a builtin as one might naively expect[1,2]. Even more amusingly, many UN*X systems also have /usr/bin/time which has rather less nice output.

This leads to some irritating edge-cases if you forget this (or didn't realise it in the first place). Consider:

bash-3.2$ time sleep 1

real    0m1.009s
user    0m0.000s
sys     0m0.002s
bash-3.2$ FOO=bar time sleep 1
        1.00 real         0.00 user         0.00 sys
bash-3.2$ time FOO=bar sleep 1

real    0m1.002s
user    0m0.000s
sys     0m0.002s


...and things only get worse if you actually start chaining things together...

bash-3.2$ time sleep 1 | time sleep 4
        4.00 real         0.00 user         0.00 sys

real    0m4.004s
user    0m0.001s
sys     0m0.005s


Not perhaps the best design decision ever...

[1] #chiark thinks this was to make it possible to time entire pipelines, although there would be several obvious idioms for doing that if time were a builtin
[2] See the "Pipelines" section in bash(1) for more details
emperor: (Default)
posted by [personal profile] emperor at 12:54pm on 22/06/2009 under ,
There are 10 MPs trying to get the job, under the new selection system. Which will it be?

[Poll #1419398]

ETA: the ordering above is the order in which they are to speak this afternoon, according to the BBC.
emperor: (Default)
posted by [personal profile] emperor at 06:06pm on 22/06/2009 under , , ,
I would like to remind everyone of rule 163 [0]. It exists to protect a vulnerable minority who are regularly subjected to abuse and intimidation by a more powerful group. That intimidation and abuse nearly always goes unpunished unless injury results, and if this minority are killed and a prosecution occurs, the penalties are relatively small. I'm talking about cyclists.

Rule 163 states, amongst other things "give motorcyclists, cyclists and horse riders at least as much room as you would when overtaking a car", which is sadly not very clear, but is helpfully illustrated:



It is my experience that many many drivers ignore this rule entirely if obeying it would mean the slightest delay to their journey. When you're in a car, please remember rule 163, and give cyclists plenty of room; if you're not driving, encourage the driver to do so, especially if they are a professional driver.

When commuting, I find I often have an unpleasant choice to make - either I cycle in the primary position, in the center of my lane, and get shouted and honked at and overtaken dangerously by some drivers who want to punish me for holding them up, or I cycle in the secondary position (about 1m from the kerb) and get people squeezing past with inches to spare because they are trying to overtake even though there is oncoming traffic and it's not safe to do so. This is quite frankly unacceptable.

On one evening cycle home, one taxi driver passed me twice (I overtook him while he was queuing in traffic). On both occasions, he sounded his horn repeatedly, revved his engine hard, and overtook dangerously close - if he'd misjudged it, or I'd wobbled, he would surely have hit me. I complained to the council's taxi licensing officer who said he'd do nothing unless there was a prosecution. The police/CPS won't prosecute unless a cyclist is injured, so taxi drivers can (and do) behave dangerously around cyclists they don't like without fear of any comeback.

There are a few further points I'd like to raise:

Cycle facilities are often worse than useless. The recommended width of a cycle lane is 2m; almost none that are not also bus lanes are this wide. That means that motorists overtaking at the white line (which many of them do) are passing at much less than the Rule 163 distance. Furthermore, the surface of these on-road cycle lanes is often poorer than the rest of the road, and they fill with debris from the road. I often cycle just outside these sort of lanes for these reasons. Shared-use paths for pedestrians and cycles are dangerous, for both cyclists and pedestrians; indeed there is research showing they are more dangerous to cycle on than the road proper. If you cycle much faster than walking pace, there is a risk of collision with pedestrians who meander across the shared-use path as if it were a pavement, and for all cyclists, there is a risk of collision wherever the path crosses a side-street - it seems that drivers don't expect to meet cyclists at these points, so fail to spot them. Indeed, I'd go as far as to say that many cycle facilities actually make cycling more dangerous, as drivers are more likely to bully cyclists using the road if they see such a facility that the cyclist isn't using.

Accordingly, I'd like to remind drivers that cyclists are not obliged to use these facilities, and you should not shout at those that choose not to. As I say above, often the cyclist is safer on the road. More generally, though don't intimidate cyclists who you feel are delaying you. Cyclists are perfectly entitled to be on the roads, and are a vulnerable group of road users. If you feel a cyclist has made an odd decision about whether to use a cycle facility or not, whether or not to wear a helmet, or whatever, consider that they are entitled to make their own minds up about these things, and have probably given the matter more thought than you have. Shouting "helpful" comments to them is bullying.

Finally, and it shouldn't need saying, driving dangerously to intimidate or punish cyclists is immoral and illegal. Don't do it! I should be able to cycle to and from work free from people threatening to kill or maim me with their vehicles. In an ideal world, there would be effective sanctions against dangerous drivers who collide with cyclists, even if the cyclist is not seriously injured. In practice, this doesn't happen, and even when drivers kill cyclists, they not infrequently escape being charged with any offense.

So yes, remember rule 163, and give cyclists a chance!

ETA This DfT article is quite sensible.

[0] No, this isn't a joke about rules about porn on the internet

July

SunMonTueWedThuFriSat
    1
 
2
 
3 4
 
5
 
6
 
7
 
8
 
9
 
10
 
11
 
12
 
13
 
14
 
15
 
16
 
17
 
18
 
19
 
20
 
21
 
22
 
23
 
24
 
25
 
26
 
27
 
28
 
29
 
30
 
31