Wednesday, September 25, 2013

Is this the real one?

I've been giving a lot of thought to virtualization recently. Some while ago I wrote a Z80 emulator and the experience taught me some interesting things.

I think that an algorithm, given the correct system of inquiry, can ascertain that it is an algorithm.

I think however that an algorithm cannot discover the structure of the machine that ultimately underlies it's embodiment.

This is to say that there is no guarantee, for example, that a simulator is not itself running inside yet another simulator and indeed that it might be running encapsulated in yet another ad-infinitum.

There is therefore a certain level of abstraction that cannot be comprehensible to the system that is doing the work.

I think for example that I could write a program that ascertained the registers used in the program within a Z80 assembly code system and could test and analyse the various instructions used in such a way that the program could map its own flow and internal storage. However, if that system were "hosted" on a PC running a Z80 simulator then the system would necessarily stop at the boundaries of what it must consider as it's own "universe"

This means to say that a Turing machine can know that it is a Turing machine but never be sure that it is not encapsulated within another Turing machine.

Interesting eh?



Saturday, September 21, 2013

Not enough danger

Today, a parent will say to a child; "Do (insert something here)" and the usual response is "Why should I"

It used to be that the Father would say "Climb that tree!" or mum would say "Don't touch that" and before the child had the chance to stop and ask "Wh..........." something large and dangerous would have ripped the little bugger's head off and be chewing on their genitals or the kid would be foaming at the mouth and rolling its little eyes back in its head from the bite or the toxic plant effects mum was just telling them about.

Nowadays they just say "Why should I?" and there isn't a real excuse to turn around and suggest that "if you don't you will die in a horrifically-painful-and-not-neccesarily-quick way"

Monday, September 16, 2013

Oracle and Entity Framework a bad mix

I've been working with entity framework since it came out. For so long in fact that I wrote my first EDMX file by hand instead of using the designer which wasn't finished. I get along ok with EF but for the first time this year I've been using it on an Oracle database. What a miserable experience that is!

I was unable to begin with a Code-First approach because our local DB guru created a database in the PL/SQL designer. This apparently presented no problem when creating the EDMX file except that for some reason the database was not generating unique primary key IDs for any of the rows.

A bit of digging showed that the Oracle tools refuse to propagate the StoreGeneratedPattern="Identity" back into the model so each time you do a database refresh you have to go an add these back in by hand. You could write a macro or make some sort of XDocument parser/munger to do it but why the heck should you?

Another problem is that the Oracle EF components are uniquely 32 bit. This has proven to be a nuisance when writing for a system that cam pre-loaded with the corporate 64 bit drive image.

Ellison's hate of all things Microsoft shine through on this one. If you have a choice of database. Go with SQL Server.