We love Wikipedia
In no other encyclopedia will you find a link like this:
In no other encyclopedia will you find a link like this:
Could this be the moment where John Howard jumped the shark? He has just attacked the US Democratic party and presidential candidate Obama as being the party/candidate that terrorists “pray” for. Apart from being a bizarre and hypocritical attack on another nations domestic politics (he strongly criticised the previous opposition leader for an attack on George Bush, but notably not the entire Republican party), it seems to be completely out of touch with both Australian and US opinion on the war. I’m sure that his motivation was just to shift debate from domestic matters where he is taking a thumping, but this seems to have backfired spectacularly - the opposition has used it masterfully to demonstrate Howard is once again an ideologue, has endangered the long-term AU/US relationship and to portray him as subservient to Bush. More amusing is that the level of press coverage that the story has received in the US, which may actually help Obama’s candidacy. Nyah ha!
I have been playing around with replacing or renovating parts of OpenSSH’s sshd server, especially replacing the hand-crafted (and brittle) mainloop with Niels’ libevent. While playing with this on the bus, it occurred to me that several large chunks of the application would be more clear if the state machines they implemented were more explicit. The privilege separation monitor and the channels system (port forwarding, login session, etc.) are good examples of this.
Because there are several places I’d like to do this, I wrote a small code generator to help: cfsm. cfsm takes a simple text state machine specification and outputs a C source and header file and optionally a graphviz dot file for plotting (see below). The code it generates includes transition checking, so it should be impossible to make any transition not expliclty defined. It also allows for the definition of precondition callbacks that muct be satisfied before a transition is allowed. A small example:
state T1a
initial-state
next-state T2
onexit-func do_something
state T1b
initial-state
next-state T2
state T2
next-state T3
exit-precondition is_bottom_half_of_the_hour
state T3
next-state T2
next-state T3
next-state T4
state T4
entry-precondition am_i_in_a_good_mood
This produces the following FSM API: (comments abridged)
enum state { T1a = 0, T1b = 1, T2 = 2, T3 = 3, T4 = 4, };
struct fsm;
struct fsm *state_init(enum state initial_state,
char *errbuf, size_t errlen); /* Allocate a FSM */
void state_free(struct fsm *fsm); /* Free a FSM */
int state_advance(struct fsm *fsm, enum state new_state,
char *errbuf, size_t errlen); /* Move to a new state */
const char *state_ntop(enum state); /* State number -> name */
const char *state_ntop_safe(enum state); /* Same, but doesn't return NULL */
enum state state_current(struct fsm *fsm); /* Returns the current state */
The user of the API will need to provide the callback functions:
/* Preconditions - must return 0 on success */ int is_bottom_half_of_the_hour(enum state current_state, enum state new_state); int am_i_in_a_good_mood(enum state current_state, enum state new_state); /* Transition function */ int do_something(enum state current_state, enum state new_state);
In case you are wondering what the graphviz output looks like, here is an example:
(yes, I know I am abusing standard notation)
This is all very basic stuff, but I think that having simple tools like this around saves time (well, when amortised over their lifespans) and reduces mistakes. The code for cfsm is in anonymous CVS (:ext:anoncvs@anoncvs.mindrot.org/cvs via SSH) and is browsable via cvsweb. If anyone is interested I can make a tarball release of it - just let me know via email.
Peter Gutmann released an excellent paper: A Cost Analysis of Windows Vista Content Protection that does a brilliant job in explaining the horrendous costs that Microsoft’s misguided attempt at currying favour with the media industry will foist on producers and comsumers of computing equipment. It is full of his fine wit, so it is depressing and amusing.
Spooky Hugo just celebrated his first Halloween, shortly after his 1/4 birthday:
The ABC has axed its most popular comedy program, The Glass House one week after a government senator criticised it for being “biased”. Perhaps they should have been more “balanced” in satirising the powerless as well as the powerful… I was disgusted enough by this latest interference in our supposedly independent national broadcaster to write an angry letter to The Age newspaper, but I was a bit late and they didn’t publish it. Here it is:
The axing of The Glass House demonstrates that a government need not appoint a censor to exert editorial influence over a broadcaster; it need only demonstrate that the way to a position of power, influence or money lies through publicly and faithfully holding an approved ideological line. How is this achieved? Look at the constituents of the ABC board - political appointees chosen for ideological compatibility and not for broadcasting experience or business acumen. Once the carrot is waved, the greedy and sycophantic will follow.
Hugo is about to celebrate his 2 month birthday on Thursday. He is growing well and is smiling all the time now, though this is pretty difficult to catch on camera because he tends to get distracted. Even when he isn’t smiling, he is very cute:
Simone, Hugo and I are one week into an eight week stay in California (Mountain View) while I start my new job. Hugo tolerated the ~16 hour transit very well, not crying once on the plane. Driving on the wrongright side of the road isn’t as difficult as I thought it would be, but being a pedestrian accustomed to left hand driving is decidedly dangerous - cars just seem to leap out from surprising directions at intersections.
Unfortunately, I don’t have any photos to post yet as I managed to lose the camera on our second day here. Worse, the camera contained all of our photos from Fathers’ day onwards and there is no getting those back. Mum, who has just arrived for a two week visit, has picked up a replacement on the way so I’ll have to take more to compensate.
We are about to head up the 101 to San Francisco, so today should be interesting…
Baby Hugo is going great so far. He has one terrible “witching hour” in the everning when we requires a lot of attention in the form of rocking, patting, being sung to, being walked, offered visual stimulation and frequent food (I’m told this is very normal). Apart from this he is a very happy and contented child who loves to observe the world around him, and the faces of his extended family.
A collection of Hugo photos is online, covering roughly the first two weeks of his life. More to come :)
Umberto Eco’s essay on proto-fascism should be read by every thinking person, and re-read until the horror of how much of it we already tolerate sinks in.