Wednesday, November 9, 2011

Occupy Melbourne

I went to my first Occupy Melbourne general assembly this evening (the 16th they've had). It wasn't deliberate, I was walking on Swanston St, eating my chips & tomato sauce, and there they were. I stayed for a couple of hours. My impressions follow.

I'm not very good with numbers, maybe there were 100 people. They used the (predominate) megaphone and the human microphone. Decisions were run on a consensus basis.

It was very much a left ghetto event. However, it was as though the factions had set their differences aside for participation in Occupy Melbourne.

The first hour was reports from various workgroups (legal, direct action, media, etc.) on what they’d been doing since the last GA. The legal team were going to court over whether Occupy Melbourne could have structures and political posters at Treasury Gardens. They wanted people to await the outcome of legal proceedings before Occupy Melbourne decided to do anything more.

I was disinterested by the first hour. If I were a part of Occupy Melbourne, maybe I’d have been more interested (but probably not).

After the reports there were some more substantial suggestions. The first motion was that Occupy Melbourne has a minute silence for the dead of WWI. I was shocked. I had thought that nothing so conservative would ever dare to be tabled. A show of hands for, then against. There was massive dissent. It was quickly reformulated as "all that have died in all wars". There was massive dissent. Others spoke against war per se. They didn’t want to honour victims, they wanted to attack the perpetrators of war, the 1%. I was encouraged by this, but by then, 10-20min of my life had already disappeared before the motion was thrown out. (I definitely would have walked away forever if it had been accepted in any of its forms.)

After, there was a proposal that we build structures on Saturday, regardless of the legal outcome. There was general (60-70%) support for this. One dissenter made an absurd analogy to guerrilla tactics saying "now is not the time to attack but harry the enemy." This received quite a bit of support. One commenter riposte with "This isn't the Vietnam war." Another dissenter talked of not wanting to jeopardise legal proceedings (the interim outcome, everyone already knew, would be known before Saturday). This rhetorical nonsense (clearly suffering for causal misdirection), received even more support than the guerrilla fighter. However, speakers for or against were unable to sway the numbers significantly. (I voted for occupation with structures, too horrified by the nonsense of the dissenters to abstain any longer.) It was decided to revisit the issue on Saturday. After that, I left.

I was generally quite impressed. For all my critical thoughts, it seemed like a movement with promise. Are the "Occupys" around the world the beginnings of a 21st century soviet? I don't know. I don't think anyone could know that. They probably aren't though. They'll probably fizzle and burn out. To avoid that fait, they need to inspire people to take control of their lives. I have no idea how they're going to do that. Hundreds of years of failure gnaws at the edges of the general assembly.

Friday, October 7, 2011

Steve Jobs once said

"Live every day as though it were your last." Absolutely, do not do this. You will be wrong for every day except for one.

Wednesday, September 14, 2011

Some funny code...

I often sigh while reading the source code at me new job. Occasionally, I have a few laughs too. For example:

            catch (Exception exception)
            {
                throw new Exception(exception.ToString());
            }


I'm not sure what it is about exception handling but it seems to be the most frequently mis-understood/mis-used area of programming C#. The lines above are not nearly has bad as:

            catch (Exception exception)
            {
            }

which I've seen a lot of too, but it's more of a sigh moment than laugh.

Thursday, August 25, 2011

I ran home after work tonight...

I ran home after work tonight; first time ever. What would spur on such extreme activity? I've been wanting to run/ride more frequently, but it's been difficult to find the motivation. I thought back to a time where I always tried to ride just that little bit harder. Turns out that was when I had a bike computer. It was decided, geekdom is to be my exercise motivator.

Last week I bought the Forerunner 310XT, designed for running and riding. It has a heart rate monitor, cadence monitor, and a GPS for tracking a whole bunch of data.

After installing a bunch of drivers and plugins, I updated the 301XT's firmware and was ready to go... Except first you need to plug in your height, weight and age for energy burning calculations. Then setup the display screens, make sure the HRM is detected, turn on/off auto settings like auto pause (for traffic lights, etc.), auto lap, and auto scroll. It's all very detailed. Thus far, however, I've been very happy with the features and user interface.

I think the exercise plan is going to work. I barely noticed that I was running, too busy looking at BPMs, time/distance, and trying to outrun my virtual partner that was doing 5:45 minute kms. The jerk beat me by 2mins.

My first run is recorded on the Garmin website.

Friday, July 15, 2011

Tools for learning F#

Every few months I try to learn me some more F#. It isn’t easy.

I stumbled across a nice learning tool by Chris Marinos. It works on the premise that you learn by making the unit tests pass (initially, they all fail). It's a nice idea. The only issue is that the testing framework it uses was written in NUnit. I don't use NUnit anymore. With a couple of little changes I switched it to Microsoft's unit testing framework. You can get my version here.

There is also http://www.tryfsharp.org/. It gives a good intro to F# that you can do online (don't need Visual Studio or nothink).

I tried to do some interoperability between C# and F#. When testing an F# console app in a C# test project, my functions didn't return results. I changed my F# console app to a F# library and it worked correctly. (Don't know why C# can't use an F# console app.)

Thursday, June 30, 2011

Le Jeu de la Guerre thoughts

During 2005 I tried to make a computer game version of Le Jeu de la Guerre (war game) by Guy Debord. I never finished it. It didn't help that the translation was poor (and still is in the latest English translation. Corrections here and here.)

I stumbled on Kriegspiel again while writing a negamax algorithm to play noughts and crosses. Debord said of Kriegspiel:
So I have studied the logic of war. Indeed I succeeded long ago in representing its essential movements on a rather simple game-board… I played this game, and in the often difficult conduct of my life drew a few lessons from it — setting rules for my life, and abiding by them. The surprises vouchsafed by this Kriegspiel of mine seem endless; I rather fear it may turn out to be the only one of my works to which people will venture to accord any value. As to whether I have made good use of its lessons, I shall leave that for others to judge. (Panegyric, 1989)


Debord need not have feared, I doubt Kriegspiel will ever be accorded much value. It's not a terrible game, but it doesn't offer all that much either.

One concept that Kriegspiel does very well is the lines of support. I've always loved how you need to keep your units supplied from the arsenal and relay units, else they become useless. That idea is evocative and well implemented.

Nevertheless, I think Heller sums up the game nicely: "Between the arithmetic and the boggling geometries, it may, in fact, be reminiscent of a certain dream you had the night before the SAT." (What is it good for? Guy Debord believed his war board game would be his legacy)

Of more interest, however, is trying to determine who Debord was by the rules he defined for Kriegspiel.

Kriegspiel is a perfect information game. In war, there are spies, scouts, propaganda, miscommunication, stealth, radar, etc. I don't see how a perfect information game captures the "essential movements" of warfare. I wonder why he chose it. Did Debord not like leaving anything to chance? Was he always completely honest (wasn't interested in hidden units/movement)?

The terrain is asymmetric, yes, but the opponents face each other as equals. For someone who lived the class war, I find it strange that Debord didn't apply the asymmetry to the players. There has probably never been a battle where opponents faced each other with equal force. Not Bored discuss this lack of asymmetry in Dispensing with Clausewitz, though I don't agree with their defence of Kriegspiel/Debord. As McHugh points out, Debord would have experienced asymmetry in '68, yet it's not there in Kriegspiel. Yes, '68 wasn't a war but it was an armed conflict and even so, there are hundreds of historical examples of asymmetrical conflicts (Battle of Thermopylae, Battle of Rorke's Drift, US vs Vietnamese, US vs Afgans, etc.)

Debord designed Kriegspiel as a zero-sum game. Zero-sum games are great but they often don't reflect the subtly of reality. They are just on/off, binary type games. Zero-sum games are not what I imagine a communist or someone who thinks dialectically would create.

Still, Kriegspiel is an interesting game. I noticed that the two computer implementations of it don't have a computer opponent. One day I might get around to writing one. I wonder what Debord would have thought when a computer plays the game better than he could ever have.

Tuesday, June 28, 2011

Computer Opponent: Noughts & Crosses

The next task on my list for making a strategy game is writing a computer opponent. In the tutorial I describe how I’ve used variations on the minimax algorithm to play noughts and crosses (tic-tac-toe). I chose noughts and crosses because it’s finite (always ends in 5-9 moves) and simple, yet there are thousands of different solutions. Eventually, I plan on using a minimax type algorithm for a game which will use the hex board tutorial I created in Unity earlier.

The C# source code for this project is available here.
The tutorial is available here.

The end result of this project is a console application that plays noughts and crosses with itself. It cycles through games using negamax, alpha-beta pruning and negascout. Every game is, of course, a draw. (You may notice that negascout is slower than alpha-beta pruning. This is because I haven’t ordered the search tree, it’s such a simple game that it isn’t worth it.) There is also a test project that runs a number of tests to make sure that the algorithms are doing what I expect them to do.