ImperialViolet

Iraq (18 Sep 2002)

This isn't a warblog and, as such, I'm not making any value judgements about the whole Iraq situation. However, I can't stop cracking a smile at the wonderful bait-and-switch that Iraq has pulled. Only 6 days ago, Iraq was saying that inspectors would never be let in (wrapped in a lot of anti-US rhetoric). Now, Bush wants a war (not a value judgement) and saw this as a perfect point of conflict that would bring in the rest of the Security Council. That was the bait and Bush/Blair took it completely saying that Iraq wouldn't be attacked if inspectors went in.

Then yesterday, Iraq switched and listening to the US trying to rebuild their case on Radio4 was just delicious.

Coding

When I know what I'm doing I can actually turn out a fair few lines in a day. None of it was anything stunningly deep, but I did about 500 (with some testing and debugging).

Also, I'm going to play about with using weak pointers in this project. Having many interlinked structures (as this code has) can be a real pain when it comes to deleting anything because any dangling pointers left over and pop goes the process.

And this is interesting. To find the highest key in a STL map the second code snippet works and the first prints 0:

printf ("%d\n", (m.end()--)->first);
map<int,int>::iterator i;

i = m.end();
i--;
printf ("%d\n", i->first);
Kernel Wish list

Two things consistently bug me about the kernel, if anyone can send me a solution to either of these I would be most grateful:

  • When a process that was listening on a socket dies it can leave connections in the TIME_WAIT state which stops anything from binding to the same port for about a minute. I'm sure there is a very good reason for this on a LAN/WAN scale, but when developing stuff it's a total pain.
  • There's no good way to get a consistent time from the kernel. Something like milliseconds since the process started would be great, but most of the clocks the kernel provides either measure the wrong thing (e.g. times(2)) or are affected whenever someone changes the system clock (e.g. gettimeofday(2)). The closest I can get is the ITIMER_REAL timer, but it has a maximum setting of about 240 days on Linux and it could be much less under other kernels.
Tao Te Ching

Leaving on a more thoughtful note, here's an interesting quote I found reading through the Tao Te Ching (section 38, Stan Rosenthal's translation)

The man who is truly wise and kind
leaves nothing to be done,
but he who only acts
according to his nation's law
leaves many things undone.