Thursday, November 27, 2008


Thanksgiving is my favorite holiday. There are no gifts, just enjoy each-others company. And in Bensen family tradition, we will enjoy the sunny 70 degree weather at the beach.

If you've been reading my blog this year, thanks for giving me the chance to teach.

If you've been blogging and teaching, especially talking about Delphi, and doing it without regard for repayment, thanks. We appreciate it more than you know.

If you help people in real need, you have my deepest thanks.

Thank you.

Tuesday, November 25, 2008

Cocoa and iPod Touch

Yesterday's post was a very popular post. Maybe it's because I've been neglecting this blog. Anyhow, I got my iPod Touch because my sister is a college student and my Dad bought her an iMac when Apple had their last back to school promotion. So I was pretty stoked to get a free to me iPod touch even if it's the older generate and 8 gigs.

t's an awesome little device. So I started learning Objective C and Cocoa last Wednesday evening. It takes a bit to get your head wrapped around Objective C, but once you get in the right mind-space it's pretty clear. At first it looks like C with a bunch of garbage. Then you start seeing how the C is decorated with the objective part and bam, your in the mind-space that's required to program in Objective C.

When I get into a new language/framework I try to pick something interesting that I want to create, even if I don't finish it, just to have a goal. I then try to figure out how the language and framework are designed so I can understand the advantages of the platform. For instance something I find interesting about Objective C is all method calls of objects are actually messages that go through a dispatch mechanism. Every time the compiler encounters a method call of the form [objectInstance func] the compiler replaces it with a C call to objc_msgSend. This means that method calls on an object in Objective C are a bit slower than a virtual method call to an object in C++ or Delphi.

My little pet project that has turned out to be a lot more work than I anticipated is to port DCannon2 to the iPhone. In toying around with the OpenGL ES I've had to modify much of the existing OpenGL code since things like glBegin and glEnd are removed for performance reasons from OpenGL ES. But DCannon for the iPhone is coming along.

Monday, November 24, 2008

iPod Touch

I've been using an iPod Touch for a few months now and I really like it. I only have a few songs on it and don't use it for video. I've got a few complaints but it's still the best PDA I've used. I used a Palm Pilot for years.

The v2.0 added the ability for iCal support for multiple calendars. This is huge and worth the $10 upgrade.

The Remote app is super cool. I can imagine it being totally awesome if you had an Apple TV.

The display is really bright and easy to look at.

The feel of the unit is really solid. The only part of the unit that doesn't feel solid is the power off button on the top.

I've held the latest version and it is easier to hold. The original iPod Touch had squared off edges which are sharp on your fingers. The volume control and external speaker on the new one would be two really nice features to have.

I wish the battery life was better.

I upgraded to v2.2 over the weekend and Safari hasn't crashed yet.

Lack of a To Do list in my opinion is a huge problem. I've tried every free 3rd party ToDo list and they all simply suck. I hope Apple makes one that syncs with the ToDos in iCal.

I wish the iPod Touch could sync with my Mac without plugging in the cable, running iTunes and pressing the sync button. But they probably don't want to run out of batteries in the middle of a sync.

Friday, November 21, 2008

Bathroom Remodel Project Nearing Completion

Here are some photos taken of the last few months of our master bedroom and master bathroom remodel:

We finally got tired of the really slow progress having only time after work and on weekends all the while trying to work around our daughters afternoon nap. So we hired a tile guy to finish the tile. Pretty good timing since the economy totally tanked.

DCanon 2

DCannon 2 is finally done and can be downloaded DCannon 2 here. It will require a a graphics card that can handle OpenGL. The entire game was built with Delphi 2009 and written in Delphi using OpenGL and SDL (used for the sound library and dynamically linked of course). David Lock deserves most of the credit.

Update: The original ZIP file uploaded omitted the sounds and graphics. This new one has it all.

DCannon 2 is a two player action packed arcade style game based on the original only with a whole lot more going on. We added night and day, volcanos, lava, lava waves, ice, lightening and thunder, meteorites, and lots of new weapons.

They keyboard controls for the red player (left player) are:

Move Left - A
Move Right - D
Aim Up - W
Aim Down - S
Increase Power - R
Decrease Power - F
Fire - SPACE
Next Weapon - Q
Previous Weapon - E
Toggle Lights - Z
Fire Jump Jets - X
Deploy Shields - C
Weapon Group 1 - 1
Weapon Group 2 - 2
Weapon Group 3 - 3
Weapon Group 4 - 4
Weapon Group 5 - 5

They keyboard controls for the blue player (right player) are:

Move Left - NUMPAD 8
Move Right - NUMPAD 5
Aim Up - NUMPAD 4
Aim Down - NUMPAD 6
Increase Power - +
Decrease Power - -
Next Weapon - NUMPAD 9
Previous Weapon - NUMPAD 7
Toggle Lights - NUMPAD 1
Fire Jump Jets - NUMPAD 2
Deploy Shields - NUMPAD 3
Weapon Group 1 - INSERT
Weapon Group 2 - HOME
Weapon Group 3 - PAGE UP
Weapon Group 4 - DELETE
Weapon Group 5 - END

Tuesday, November 18, 2008

Using TInterfaceList with for in Syntax

In Delphi 2009 you may have notice that IInterfaceListEx has added to the list of interfaces supported by TInterfaceList:

TInterfaceList = class(TInterfacedObject, IInterfaceList, IInterfaceListEx)
For those of you who use interfaces this will be of interest but I've found that most people use the class directly rather than the interface. As it turns out we couldn't modify IInterfaceList because it would break a published interface, so we had to create a new interface to allow a developer using interfaces to use enumerators which are required for the for in syntax. So there you have it. If you like to use interfaces and you use IInterfaceList, you can now use the for in syntax.

Wednesday, November 5, 2008

November Photo of the Month

Here's a photo from my September backpacking trip of the Kern River.