mutterings of a cynic

Wednesday, August 30, 2006

subversive simplicity

Last night I decided to make a start on a flickr project that I've decided to undertake. It's tentatively named "The desktop flickr software that doesn't suck".

Coding without a version control system is like sight. If you've ever had it, you can't be without it. Given that, I decided to install subversion on my server. It wasn't really a task I was looking forward to - I'd never done it before and frankly expected it to be a complete pain.

After a little googling, I found this: svn1clicksetup. I liked the sound of an installer that would install subversion for me so I downloaded it. After the file arrived, I double clicked on it and was faced with a very normal looking windows installer. A couple of clicks later I had entered some very basic info, a couple of clicks after that the svn command line tools were installed and a couple of clicks after that, tortoise svn was installed. TortoiseSVN incidentally was the only thing that said it needed a reboot, but that's because it was written by idiots that insist on perpetuating the rumour of windows needing continual reboots. So after not rebooting, I went to my shell and typed "svn ls http://localhost/"

That was it! A single installer and about 2 minutes of time. It took me as long to find out the svn port to open on my windows firewall so I could access it across the network (I should probably let them know that they can do that from the installer).

I was highly impressed. A complex thing has never been so simple.


Friday, August 25, 2006

superman minireview



Enjoyably corny.


Thursday, August 24, 2006

falsche adresse



I just got home and looked in my mailbox. In it, I found a letter from the post office. The letter itself isn't really interesting, but the address on it was. The post office had managed to send me a mail shot to my old address, but then correct it manually to my new address. Idiots.


Monday, August 21, 2006

we're in a tight spot

Yesterday a new game arrived that I ordered a while back. I wouldn't usually blog about a game I'm playing, but the sheer style of this one warrants something.

Now when I stay stylish, don't confuse that with sensical (sic); it's odd, weird and strange too. It's also, however, confusing and intriguing. All in all, it's a game that inspires quite a lot of emotion.

So, in one sentence - the game: Killer 7 is an unconventional, quasi-violent, comic book styled on-rails shooter with puzzles.



Most people that would see a screenshot of the game would question my use of the word quasi. It's actually really quite violent, except, at least in my opinion, in such an unusual manner that I feel it tones the game down. Example 1: When you kill someone they spray blood all over the floors and walls. Sounds violent right? How about if I tell you that the blood resembles silly string and is more yellow than red? It's clearly blood, but at the same time it's wholly unrealistic. Example 2: Yesterday I found a clothes drier that was spinning. I turned it off and found a decapitated head inside. Violent right? Well then it told me off for disturbing it and have me a ring to go away...

Anyway, let me give you a flavour of the game.


  • One of the many unusual things in the game is the TV Room. In this room there is a TV and a woman called Samantha. Using the TV you can switch between 7 personalities and also upgrade them. If you talk to Samantha she lets you save your progress... but only if she's wearing a maid's outfit...
  • The enemies in the game are zombie like creatures that charge at you and then blow up... but they're invisible.
  • When you die you have to carry on the game as another of the 7 personalities... unless you resurrect it by collecting its head in a paper bag and returning it to a TV...


If you were wondering about the title of this post it's down to a character called Wenzel Diel Boris Iwazarskof VII (I googled it). Throughout the early levels of the game (the first of which being the only one I'm qualified to talk about at the moment) you occasionally find him hanging from the ceiling from what looks like S&M style bindings. He starts all his conversations with "we're in a tight spot" and signs off with "in the name of harman".

It's totally unorthodox, and just lovely.

in the name of harman...


Thursday, August 17, 2006

microsoft ipod

What if Microsoft designed the ipod?



The scary thing here is that I believe the spoof. The box actually looks like a product that I would expect to see on the shelves. It's so easy to over design in all areas - the one that irritates me the most is in code, but I think that's expected since it's all I do all day.


Wednesday, August 16, 2006

fish out of water

Pasting code snippets into a blog is a complete pain. Essentially, code outside of an IDE is like a fish out of water - it looks terrible if it loses syntax highlighting or indentation and disastrous if it looses both. Also - in order to fit it on a thin blog page the code has to be renamed and reformatted to fit into the available space - that ensures additional loss of clarity.

Here's what I mean:

Code snippet pasted directly into blog editor
/**
* This {@link Runnable} will update the models from the data store outside the dispatch thread.
* To avoid race conditions, the swing models are updated within the dispatch thread while the
* querying of the models from the {@link WorkflowStore} happens outside the EDT.
*/
private final class WorkflowRefresher extends RunnableSwingWorker[]> {
@Override
public ActivityModel[] construct() {
SwingUtilities.invokeLater(new Runnable() {
public void run() {
client.startBusyFeedback("Refreshing workflows");
}
});
return getModels();
}
@Override
public void finished() {
refreshPrivate(get());
client.stopBusyFeedback(null);
}
}

Code snippet inside <pre> tags

/**
* This {@link Runnable} will update the models from the data store outside the dispatch thread.
* To avoid race conditions, the swing models are updated within the dispatch thread while the
* querying of the models from the {@link WorkflowStore} happens outside the EDT.
*/
private final class WorkflowRefresher extends RunnableSwingWorker[]> {
@Override
public ActivityModel[] construct() {
SwingUtilities.invokeLater(new Runnable() {
public void run() {
client.startBusyFeedback("Refreshing workflows");
}
});
return getModels();
}
@Override
public void finished() {
refreshPrivate(get());
client.stopBusyFeedback(null);
}
}


Code snippet inside <code> tags

/**
* This {@link Runnable} will update the models from the data store outside the dispatch thread.
* To avoid race conditions, the swing models are updated within the dispatch thread while the
* querying of the models from the {@link WorkflowStore} happens outside the EDT.
*/
private final class WorkflowRefresher extends RunnableSwingWorker[]> {
@Override
public ActivityModel[] construct() {
SwingUtilities.invokeLater(new Runnable() {
public void run() {
client.startBusyFeedback("Refreshing workflows");
}
});
return getModels();
}
@Override
public void finished() {
refreshPrivate(get());
client.stopBusyFeedback(null);
}
}


Code as it was intended to look


Man - sometimes I feel like such an html newbie.


EDIT!!

I didn't need to look hard to find a nice tool for converting java code to html with nice formatting - complete with convenient applet

Sadly it still doesn't solve my code -> blog problem, but it's nice nonetheless.


elegance

Today I wrote a TreeModel that proxies for another TreeModel, but via a filter. The code itself is quite simple - it works by creating a map from visible indices to underlying indices for each child node. Before you complain about it not working for infinite trees - it works as intended. If I need it to work outside the current constraints, I'll change it.

Anyway, it's been a while since I'd written a nice recursive method and the elegance of them always surprises me.

Here's a snippet of the tree filtering code:

(assume Map<TreeNode, IntList> maps has been declared in global scope)


Wednesday, August 09, 2006

clarity in darkness

Sometimes I code while asleep. Well, solve problems while I'm sleeping anyway. Although I don't think that's such an unusual thing to do for a professional developer, I'm pretty sure it's unusual to do it with such clarity.


I solved the problem, created a nice level of abstraction with simple and easy mechanisms providing the communication between the areas, designed the system around it and came up with a design plan for the unit tests. Maybe I should have stayed in bed this morning.


Tuesday, August 08, 2006

old guys

I feel that I should explain my comment about setting fire to shit, if only because it's funny. A few weeks ago I went for lunch at Claraplatz and adjacent to the Kiosk there, where the "old men" hang out with their special brew and meths, there was an upturned buckled bicycle with various pieces of litter crammed into each and every available orifice. It was actually surprisingly arty considering none of its artists were of sound mind, but the very little stops art.



So the story continues. Not to be outdone by their inebriated peers, the next time I went to Claraplatz a couple of days later, the bent and rusty bike had been removed (or perhaps reclaimed by its owner..) and in its place was a pile of clothes. They didn't look particularly tatty or old, but also not the high quality H&M gear that seems to be all the rage with the youth. Anyway, the thing that stuck me about this particular pile of clothes was that it was on fire. The game, by the looks of it, was to set the clothes alight, sway back to your flea infested pals, giggle a little then return to the clothes and put them out with your preferred hooch.

At some point, of course, the police arrive to dampen the fun. Sadly this scene was far less boring that it could have been. No senseless police violence, no drawing of guns, no shouting and even no complaining by the offending party as he / she / it was arrested. Life should be more like Cops. Oh wait - that is real life isn't it - Heaven help me when I move there.


Monday, August 07, 2006

resident


I've now officially lived in Switzerland long enough to have an opinion. I'm now going to quit my job and spend my afternoons with the old guys at Claraplatz setting fire to shit.


Saturday, August 05, 2006

gamer's quiz



I came across this quiz today and thought it was great. I failed on only 4 of the 50 questions (see comments for which ones) giving me a score of 92%. What did you get? Be honest!


Friday, August 04, 2006

street urine



This afternoon a guy on the street gave me a sealed glass of urine. I tried some of it a couple of moments ago. It tasted as good as it sounds. It made me swear.