Month: November 2005

One of my goals after Brent’s DNUG talk was to port my old QuickBasic Line Curve (not sure what other people call them) to C# code. So this evening that’s what I’ve been doing.

My first big thanks is to the Visual Studio team, because VS2005 can open and understand old QuickBasic .BAS files. I’m sure it actually basic of VB.Net, but it colour codes correctly and every thing. This made cut-n-pasting the code so much easier. Previously I’d opened QB and screen scraped it out 19 lines at a time.

An odd side effect of this was that when I had a .BAS file open, and did a Solution Build, the .BAS file would be compiled and it’s errors highlighted, even though it is not in any of my projects. So I keep closing and opening the file. Only with the power of hindsight do I even think of the remotely clever idea I opening it file in a second instance of VS.

So I got the code drawing the pretty graph. In the original I had it animated to appear to scroll, giving a pseudo 3D effect. Which I’d always wanted to use in a game. So I rigged up the MouseWheel event. For quite some time I couldn’t get it to work. I finally wired up MouseClick and then the mouse wheel event would fire after the first click. It appears to be a focus related issue, so I made my panel get Focus() when ever the MouseEnter event fires.

It is working pretty neat I think. The only current bug is the scrolling is done by drawing the four sub-polygon in each polygon, but you can see a tear between polygons as the outer points are not common. This will be my next task to fix.

After that I want to be able to drag the three control points of the graph around. I have some ideas that should be cool for focus of the drag points. So I’m looking forward to battling with those.

I absolutely loved this book. I found it made me think about things in ways I had not before.

I liked the first of the 2050 questions of “How many minutes of work will a loaf of bread cost?” made me think that currently it takes 2.4 minutes (white bread) to 6 minutes (for a nice loaf). Wow I can’t even eat it that fast, let alone a whole loaf would make me sick.

I’ll quote his closing paragraph because I liked it so much:

The remarkable thing about economics is that once you’ve been exposed to the big ideas, they begin to show up everywhere. The sad irony of Encon 101 is that students too often suffer through dull, esoteric lectures while economics is going on all around them. Economics offers insight into wealth, poverty, gender relations, the environment, discriminations, politics — just to name a few of the things we’ve touched upon. How could that possible not be interesting?