Friday, February 27, 2009

Compiler goodies, part 2...

The DeSmet C compiler uses a "hand-built" parser.

Most compilers these days start with Lex and Yacc. It's simple to build a compiler with them.

But it loses the "personal" flavor...

Wednesday, February 25, 2009

Catching up with history...

OK, I'll admit it. I read comic books as a kid.

I even collected them, since
1) I'm a bit of a packrat
2) I wanted to see how the story started

But this makes me feel bad for people today, who are even furthur away from the characters origins, and have even more to catch up with (who is really going to track down and buy 500+ old issues?). Fortunately, it's easier today.

GIT corp has (for at least some titles) tracked them down for you, and put them conveniently on DVD. Now all you have to do is spend (mumble) hours on your computer reading them all...

Or wait for a Kindle with high resolution color screen and take them all with you...

Wednesday, February 18, 2009

Compiler goodies...

Want to know more about compilers? Read the book (for free)!

_Compiler Construction_ by Nikulas Wirth.

And, a note: I will be out of town for a few days. Next blog update will be on Wednesday, Feb 25th.

Monday, February 16, 2009

The infinite circuit...

Some years ago (2004?) I was writing a simulator for a PIC microcontroller. I though it was a neat project, and maybe someon else would be intersted. So, I put up a website for it.

I wanted to make it look better, so I did a background for it.

Website backgrounds often (though not always) consist of a image that is repeated "forever" (or at least enough to fill the page). So, for a good background, the image should "make sense" when the right/left/top/bottom of one image connets to the corresponding left/right/bottom/top of the adject image (think of the image as the 2-D equivalent to the unit cell in crystalography).

Since I was dealing with microcontrollers and circuits, I decided to make a large "mesh" circuit that could go on forever.

I started with a simple circuit:

that was drawn so that connections on the top would match the connections on the bottom, and connections on the right would match the connections on the left.

So, doing a cut-and-paste, you can see how the circuit matches on top, bottom, right, and left (click on the picture for a better view):


And since each of the new circuit placements can have their own connections, you get a complete grid (click on the picture for a better view):


For the website background, I greyed-out the image so that the text could be read.

I occasionally toyed with the idea of writing software for the processors in the mesh -- something simple that would do a state change based on the linkages to it's neighbors, and see what would evolve in the system. Differences in startup timing and power-up RAM values would create a random starting point for every power cycle, and a new pattern every time.

Why did I use the full-featured (i.e. expensive) 12F675 instead of it's cheaper cousin, the 12F629, or even the lowly 12F508? Because I was working my 12F675 simulator at the time. If it ever gets built, save yourself some money with a simpler chip.

(Note: Edited 2/18/2009 -- I was off by a pixel on my tiled images)

Wednesday, February 11, 2009

Net Neutrality is important!

Sure, you've heard it before.

I'm going to say it again.



And, right now (Feb 11th, 2009), it is under attack by Senator Diane Feinstein. She is trying to put a rider on the bailout bill. It failed when attached in public, but she's trying to put it again, without public knowledge or comment, when the house and senate versions are reconciled.

Don't you love how your rights are sold for a pittace to corporations?

Tuesday, February 10, 2009

Fanboys...

...the movie.

Many years ago, the movie Wargames came out. I saw it with a bunch of my "hacker" friends (before the word gained it's negative connotations). We really enjoyed the movie. Yah, it's a good movie, but it was *REAL*. We knew the people in the movie. They had the culture right. We caught all the little in-jokes, and had a better time than the rest of the audience.

This weekend, my wife and I saw Fanboys. OK, it's not as good as Wargames, but it doesn't deserve the bad reviews it has been getting. If you don't understand the culture it is lampooning, you won't get the jokes.

For us, we know the people in the movie. We understand the culture. We laughed and had a good time.

It's not a "general release" movie, because the general public doesn't know the culture. I want to see the DVD release, to see what it was before they tried to make it "accessable" to the general public. I'll bet it's even better.

Wednesday, February 4, 2009

Satisfy your urges...

Want to indulge your craving for "Space Geek" porn? Head over to Hobbyspace.

Be sure to check out _The Rocket Company_. It's availble at Amazon (buy it through the hobbyspace website, give them some money...)

Monday, February 2, 2009

The metric of a man...

So, my manager decides to talk to myself and two other people (the other software engineer and the EE) the other day, and says that they will be starting an "incentive bonus" plan. We can write our own performance metrics for the bonuses.

In a recession... When sales are flat...

The theory is that we will be going to a 4 day work week, but since the three of us will need to keep working full time, this is a way to keep paying us full salary, despite the fiction of not working full time.

But, this brings up an interesting question -- I write very low level software, to satisfy some very vague specifications. I normally get the schematics from the EE, and start planning, and later get the prototype hardware. Then I have to test the prototype to make sure the EE didn't make any mistakes (I often find one or two, usually something like a missing trace. His layout software is very good, and it uses the netlist from the schematic to try to make sure that all connections are accounted for, but in the last couple of boards we have found that somehow a ground trace gets lost by the software, and so a ground trace is missing. Very annoying...).

Then, I have to get the "application" working. Occasionally I get to write it from scratch. Often I have to take some code written 10 years ago (or longer...) for a different system (that writes down to the bare metal), and get it working on new hardware.

I can give an estimate, but the larger the project (and the more the customer gets to change the specs in the middle), the harder it is to give any estimate at all, let alone one with any accuracy.

So, how do you setup "performace metrics" for such a situation? I sure don't know, and my income will depend on it...