Thursday, October 30, 2008

Multi-line String Literals in Java

You want multi-line string literals in Java which work in Java 1.4 and up? Can't be done, you say?

Sven Efftinge found a way.

Monday, October 27, 2008

Compile VMware tools on openSUSE 10.3

I just tried to install the VMware tools on openSUSE 10.3 (Linux kernel 2.6.22.18) so the virtual machine would survive more than 10 days on an ESX server and failed. If you have the same problem, the solution is here.

Errors you'll see during the installation otherwise:

The directory of kernel headers (version @@VMWARE@@ UTS_RELEASE) does not match your running kernel (version 2.6.22.18-0.2-default). Even if the module were to compile successfully, it would not load into the running kernel.

Wednesday, October 22, 2008

Failure is not an Option

Everyone loves war stories. Here is one of mine. I need a special diet, especially bread. So one Friday evening, I was taking the train home after buying a couple of custom made loafs of bread. In Dübendorf, I left the train and walked home.

About halfway home, I noticed that I had my head, my arms, my bag ... but not my bread! ARGH! Stupid, stupid, stupid! I knew I should have stuffed them in my rucksack but didn't because it was so full and ... yeah ... okay. My baker needs three days to make these breads so that meant about a week without any for me.

Arriving home, an idea struck me and I fired up the VBZ online service to find out where the train was and when the driver would make the next break. A few moments later, the SBB Train Police got a really strange call by me: "I need my bread. It's in this train and can you please, please ask the driver to check if the white plastic bag with the bread is still there?"

The woman on the other end was surprised and promised to call me back.

Ten minutes can be sooo long.

From the timetable, I knew that my train would probably come through my town in about twenty minutes when I got the call. Yes, they found it and the driver would take the plastic bag into his cabin and she told me where to wait on the platform so he could hand it over.

Try train was on time (as usual), the driver handed me my bag (and it really was mine and all the bread was still there) and I was really relieved. After thanking him, I went home to have my dinner. Thanks to the SBB train police, a train driver and an unknown person who put my bread in the overhead compartment when I left it behind, I didn't go hungry that weekend.

Lesson: If all seems lost, take a step back, do something else and you might have the idea which will save the day.

Train related joke: The SBB (Schweizer Bundesbahn - Swiss federation train company) and the German Bundesbahn (the counterpart of the SBB in Germany) wanted to save some money and decided to buy the same information system to inform about arriving trains on the platform. After a longer evaluation, the plan was dropped. The SBB needed signs which said "Train is 1, 2, 3, 4, 5 minutes late" and the German Bundesbahn needed "Train is half an hour, 1 hour, 2 hours, 3 hours, 4 hours, Train Cancelled."

Tuesday, October 14, 2008

So... You want your code to be maintainable.

A great post if you're interested in TDD or testing in general: So... You want your code to be maintainable. by Uncle Bob. Thanks, Bob!

Saturday, October 11, 2008

Good Games for the PS3

I've recently upgraded to a PlayStation 3. I kept my old PS2, though, since the new PS3 can't emulate the PS2. I wonder why that is ... maybe it's because Sony is still selling so many PS2's? Ah, rumors :) Easy to create and hard to kill.

So what good games are there? Here is my list:

  • Burnout Paradise City
  • PixelJunk Eden
  • Ratchet & Clank - Tools of Destruction
  • Flow

Burnout Paradise City

Mindless street racing with a high adrenaline level. Ideal to waste a couple of minutes or an hour. Great graphics, no blood, no violence (it's more like auto scooter) and nice ideas like smashing ads or the super jumps. If you don't like some events (haven't managed to win a single race, yet. I excel at kicking other cars off the street), you can simply ignore them and still complete enough of the game to have fun.

PixelJunk Eden

A definitive feel of Tarzan or Spiderman when you want to relax a bit. Simple, fitting graphics, no violence, no agression. All that and at the price it's a steal.

Ratchet & Clank - Tools of Destruction

My favorite jump'n'run. Lots of insane weapons, Ratchet's ears look great on the PS3, the story has more depth than usual; not sure I like the depressive realization at the end, though. Judge for yourself.

Flow

Like Eden, it's a brand new kind of game. One of a kind. I play that when I want to come down from all the stress in my life. Go get it!

Bad games

I've got a couple of other games. First, we have the Orange Box with Half Life 2, two of the extra episodes, Portal and Team Fortress. I liked the puzzles in Portal. That games was much too short. I didn't like Half Life 2 much and I hate the episodes. The story was great, the levels gigantic and intelligent. You could almost always find a way around without getting killed. But the handling ... Freeman feels like a block of wood when you move him through the levels: You'll get stuck all the time at hand rails and stuff like that. Sometimes, he'll be able to jump on something, sometimes not. Sometimes, he'll stay on top of a barrel, sometimes not. This sucks. And then those stupid zombie levels. Yeah, I'm stuck in the elevator scene in the first episode. Got killed five times in the dark and now, the games goes where it belongs: The trash.

Resistance - Fall of Man. I like the other games by Insomniac and I like this one, too. It's just too violent for my taste. I like shooting pixels or push empty cars off the street or zoom down a highway at break-neck speed. I don't like shooting at people. I finished the game but it left me asking: Is that all? Running around, shooting people, blow up stuff? Is that the result of many years of game evolution? Better graphics?

Uncharted: Drake's Fortune. Oh well. Okay, the levels look great. When you scale the wall of the castle, there is a sense of vertigo. It's breath taking. The jeep escape is a lot of fun. Smart story (mostly). The game character moves smart. You press a button and he takes cover. He's smart, not a dead puppet like Freeman. He moves as if he was real. Again the violence cooled me off quickly. Too much killing, not enough puzzles.