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.

Cake Day

One of the things I miss dearly about not working at DataCol or ATR is cake day. DataCol’s where much more lavish, but the numbers to feed where smaller, so a few extra dollars made a big difference.

Anyway, I was busy debugging my latest project, that has a really annoying windows message pump stall, and Michaela’s mother drove up the driveway, with a cake. Due to too many ripe bananas.

Anyway, I’ve have a big bit already, and I have the jug boiling so I can have some coffee and another slice.

Banana Cake
Banana Cake

First “home” app - A homework timer.

I have completed my first bespoke development. A “homework timer”. The spec was very loose, so I decided a XP style would suit this project well. I opened Visual Studio, created a new project, drag on a Timer, Button and NumericalUpDown, did some event wiring, and then added some SystemSounds.Exclamation

This was good, but then the spec was changed as the customer wanted “custom” sounds. So I pulled in my voice artist, fired up Audacity, and laid down a couple of tracks. Inserted a SoundPlayer when “sound.wav” exists, and the project was done. Another round of acceptance testing, and monitored user trails, found the application was a success.

A few minutes and those professional touches like Anchoring the controls and the project was delivered. See attached picture.

I felt the RAD environment provided by Microsoft cut nearly all the time off this project, and I therefore would like to offer this as a success story for Microsoft if they need material in the home dev market space.

Homework Timer
Homework Timer

Mathematical Mysteries: The Beauty and Magic of Numbers

I was reading Mathematical Mysteries for the last few weeks. Wow there are some beautiful relations, and some mind bending logic in maths.

I only read the first 2/3 of the book. So am not sure how it finishes, but I first part was thought provoking. I was also taking back by the level understanding in B.C. and early A.D. times.

[Edit 6-May: Noticed I’d called the book Magic of Munbers (via a google search for munbers) so fixed.]

In Search of Stupidity

I have just finished reading In Search of Stupidity on Monday. I found it gripping enough that I read it in two days.

I found the different perspective on why the software industry is in its current form (or circa 2003) really enlighten. The insight to how damaging marketing confusion, misplaced products, or in some cases lack of marketing direction has on products, and mind share of the buying public.

[RANT] The Cost of Not been Losers

Well, seeing as I have not been employed for the last month. I got this crazy idea, that I might be eligible for some form of support from the government. Sure enough we (my wife and two children) were eligible for some housing support as my wife’s income is not very large and we have rent to pay. So I filling the booklet, and went to see a WINZ consultant today. But we have an Asset that is over $16,000 (a deposit for a house that will be brought as soon as I get a job, so the bank is happy that I can pay the mortgage) as this is the limit for people (couples) who want help.

So because we have been saving money for the last four years, just like the government wants people to-do, we cannot get a helping hand. So if I had

  • drunk lots of alcohol
  • smoked
  • used drugs
  • got a flashy stereo and game consoles

All in the name of live for the now, WINZ would give me money. But I didn’t, so they won’t.

Sure I understand the idea, people with lots of money in there pocket should use it before asking for help. I get that. But if I had used the money to buy a house last month, then I’d get even more money. Even though my part of the assert was the same, and ignoring the fact I get the total value of capital gain, which seems to be the rage at the moment. But alas I didn’t do that.

I’m surprised that they don’t ask if you own more than 16K of the worth of your house, and stop you been applicable for that reason, because it’s the same thing really. It makes me so grumpy.

There are only two work a rounds, buy an asset (that I can get my money back out of) that is not an asset (can only think of a house). Or buy lots of cool computer/game type stuff.

It’s not that I want to receive a hand out, but the only reason to not be aloud to get one been that we’ve saving to buy a house, seems really FUCKED.

I see why it’s called a poverty trap. You get no encouragement to better your self.