Copy This!

I read Copy This! by Paul Orfalea this last week.

It is the story of how he started Kinko’s copy centres, and expanded the business.

I found it a wonderful book about building a company from the ground up. He gives a lot of insight into how he directed the culture, how to be on you business verse be in your business, trusting people to-do what they have been tasked and ideas like the co-workers and profits sharing as mechanism to align co-workers with company growth/success.

Fun with Win32 message pump

For the last week I have been working with some circa 1999 simulator code for a flight sim (fully 3D rotating environment etc). The idea of the current development is releasing the game as a standalone/multiplayer shareware game. The code base is Win32 C++ and used to run on a dual Pentium Pro 200 machines with 256 Megabytes of RAM, plus a ~$3,000 professional OpenGL video card.

My major problem this week has been that the menu system key strokes get/got lost. After a lot fiddling/debugging and restoring original code from Subversion (god bless source control) I found that the messages (key strokes) where in the message queue, just not coming out. I could press a key (like up) and have the UI do nothing. If I then grabbed the diagnostics window and pulled it across the OpenGL window, the menu action would occur. Very strange.

The program uses the message pump to co-ordinate between threads, but as there are a few threads, and a lot of messages, it took a while before I knew what each message was doing and why.

So yesterday, I finally noticed that the number of messages might be the problem.

It turns out that the code that check for input and checking for the end of the current render cycle was running too fast that the system delayed the keyboard input.

I now have a very dirty sleep(5) in a critical place, which slows it down enough that I can explore the menu system. The problem with this is it’s easy to turn off some part of the graphics pipeline and speed the whole thing up, so that input is missed again, and thus you cannot turn the feature back on.

Anyway, in my current to-do list is change to use Direct Input to manage the keyboard/joystick, and look at a different game message pump/queue, than the main windows message pump.

TCP/IP Sockets In C#

TCP/IP Sockets In C# is a gem of book if you need TCP/IP sockets in C#. This book describes how to-do what you need, and the different available approaches.

It’s very concise (170 pages), but it’s well written. Covering sync/async, TCP, UDP, multicast and the TCP life cycle.

The Winsock errors in the appendix was the icing on the cake.

C++ Programming Fundamentals

I read C++ Programming Fundamentals on Friday. After skimming the first third I checked the back, and noted the beginner level. I sped through the rest of the book having a catch-up and seeing the highlights.

For a beginner I think the book covers most topics well. It comes across as a more C book than C++ due to OO not been discussed until the second half of the book.

I would how ever run a mile from its wrong discussion on virtual function and pure-virtual functions. Earlier in the book it shows you how to override a function, and then shows you how to make a function virtual. But does not tell you why you want virtual functions and mixes up the idea of pure-virtual functions with the description of virtual functions.

So with this in mind I would not recommend the book to anybody…

Since Otar Left

One of the joys of have parent in-laws is been passed art-house films that we would have otherwise never watch.

Since Otar Left was a wonderful movie. With a major plot line of not upsetting the grandmother when her beloved son dies over seas, it then rides the after effects of this decision.

Set in the city of Tbilisi, which was in post-Soviet ruin. This made for a bleak back drop, on life and future prospects.

[Slight Plot discussion]

I saw the ending coming, not from a stance of obviousness, but more of both paths had equal cost in failure, but only had any real chance for gain. So it was with sadness and hope that the movie ends.

What I found the most beautiful was the grandmothers handling of the ‘I know you have been hiding his death from me’ bit.