Waiting for Vista

It’s my own limited homage to Samuel Beckett. 🙂
Direct3D 10 (AKA DirectX 10) is a Vista only item. Considering the driver model changes for Vista I can see how you would have a problem shoehorning the API back into XP. The problem is that they keep delaying the release for various reasons meaning that the games keep being delayed. The longer you delay the OS the later it will be adopted. I’m not planning on an upgrade until I’ve heard a reasonable amount of feedback as I can’t afford to waste time troubleshooting problems. Considering that everything native I’m developing has to be backwards compatible with Windows 2000, my upgrade path has been restricted somewhat.

The new toy has the dreaded ‘Windows Vista Capable‘, which is a tad suspicious.

Never had a hibernate problem with 1GB ram

Christ, but it was annoying – I close the laptop case and shove it in the bag. I pull it out a while later and there’s a dialog saying: ‘Insufficient system resources exist to complete the API. And my hibernate tab is missing. A bit of googling led me to and entry in Bryce Yehl’s weblog. I followed the guide, contacted Microsoft, got the hotfix and now hibernate seems to be working just fine. I’m running Delphi, SQL server Visual Studio have a few mounted CD images and things seem to be just fine – everything hibernates just dandily. All this because I have more than a gig of RAM? That’s annoying to say the least.

music.podshow.com – id3 tag suggestions

There’s a little message in the middle of Adam Curry’s Daily Source Code, from a man in Greece about dynamically adding ID3 tags to the file just prior to downloading. I just remembered that Version 2 id3 tags are put at the beginning of the file. All you need to know is how long the tag is, add it to the content-length for the download and the feed the tag out before the file. Adam’s idea of the golden ticket is doable without too much processor overhead.
Theoretically, you can embed ID tags into mp3 files once they are out of frame. The property of the tag is that it appears as junk for non-supporting applications. Embedding audio bumpers at the start and finish is trivial (you may need to eat a v1.1 tag at the end of the file).
Other trivial pieces of information I discovered today – WiFi is a pun-term of HiFi, and doesn’t stand for Wireless Fidelity, it was simply the name that the ad execs came up with when asked (as 802.11 doesn’t have a ring to it). [via The old new thing]

[Listening to: Untitled 4 – Sigur Rós – ( ) (7:33)]

XP on the mac

It’s unofficially doable; a few folks won the $14,000 odd prize for it. Practically nothing on the machine works, though. I am reminded of the situation of Solaris on X86 – noone wants it because the hardware support is so poor. The reason for the poor hardware support is that there isn’t anywhere the number of driver developers as there would be for such beasts as Linux or Windows.
640×480 (or 800×600 I think) VGA graphics drive, no wifi, no networking, no bluetooth. Pretty much useless from the usable laptop front. I’d take Linux on it before Windows if that’s the case. Of course theres a fully functional unix machine under the hood for Mac OS X, and while someone will probably want to shoot me for it, the fact that it’s proprietary isn’t too much of a big loss.
I was talking to my mate Mark on St. Paddys day about Hyper Threading processors, and he was mentioning that they’re not the best at high-performance computation (without extensive and expensive hints in the code). I agreed, mentioning that the latest generation of multi-core processors offer roughly equivalent cost and scale almost multi-processorly. I then went on to explain that the multi-threaded processors are better for I/O workloads, you shove a lot of the scheduling cost back into the silicon where it belongs, rather than having the OS deal with it in software.
For a big server, performing lots of I/O, a multi-core and multi-threaded processor would be the best of both worlds, and based on the direction that Sun is taking with the Niagra system, one can see that this can be taken to a scary extreme – consider 8 core with 8 threads per core all on the one processor module. The power-savings alone would be enough to warrant buying these machines.
Im still waiting for quotes on a few more laptops. I can wait, I just don’t know for how much longer. Meanwhile I’ll probably buy a phone. Nokia 6230i looks like a cheap and easy option – buyable from €260.19. Or maybe an annoying smartphone like the iMate PDA 2K (it’s the original of the O2 XDA IIs).

Network protocol design

Let’s make this one easy for the protocol writers. Front load the important information in the packet. That way we can more easily detect it and send it on to the correct handler. Stop putting the decision making information in the middle of the packet. We don’t have infinite processor time on these handlers.
This complaint was brought to you by people who care how network bandwidth is being consumed.

I had a nightmare last night

It started out quite simply. I was with a few friends in an internet café just shooting the breeze when I noticed this perceptual shiver run through all the people there. When I asked what was going on nobody was talking. Finaly I convinced one of my friends to tell me and he informed me that one of the folks from the data retention section of the Gardaí was here to install the recording software for the shop.
This was in foot of the new legislation that had been introduced for the storage of all internet communications for an arbitrary time. Every bit was being recorded just in case it needed to be checked at a later time for terrorist activities.
This nightmare took a strange turn when I examined the data gathering software. It was performing a simple data dump of everything that was passing through. Because of the vast quantity of data, nothing was being done to ensure that it could not be tampered with by anyone should they have access to the data. At a later point one of my friends found himself in court facing a criminal charge of conspiracy to commit murder based on the content of one of the logs that had been recorded.
It’s scary, but it is possible for it to happen. The question beomes how do we ensure the integrity of the data that is in the recording? If you wanted to prevent accidental tampering with the data, then using some form of checksum on individual blocks of data would provide for that, however a malicious tamperer could simply alter the checksum for the given blocks to prevent their detection. Based on the quantity of information being gathered, you could chain the checksums. Initialize the first block to some random piece of information. checksum it. For the next checksum initialize it from the content of the previous checksum. The principle is used in various encryption systems (Cipher Block Chaining). If you wish to tamper with the data in-stream you need to alter the checksum from the point of alteration to the end of the recording.
As simulteneously you have a program continually writing new blocks of information to the storage device, you would need to either (a) insinuate a program that would alter the checksums as they are written to the device, or (b) interfere with the recording program to possess the new checksum just prior to the next write to the device, thereby having it perform the updating for you.
Both techniques are not impossible to perform, in fact the first is downright trivial. The only way of bypassing this sort of tampering is to ensure that the recording device is isolated in some way from the data that it is recording.
For this purpose, it would need to be a specially assembled recording device which possesses two fail-hot network interfaces as it’s only method of communication to the outside world. A fail-hot network interface pair is one that when the power is removed simply keeps the network traffic passing through without interruption.
Secondly it would just record the data, it would have no interpretation capabilities. The reason for this is to remove any chance that it could be subverted through maliciously formed network packets.
The box should be tamper-evident. by having this facility, any efforts to extract the data through physical manipulation of the recording device would be easily noticed, thus rendering the data recorded inadmissable in a court. Tampering with the device would be a criminal offence.
The device would need to be regularly inspected, hot-swapping new devices for old ones so the data recording could carry on uninterrupted.

You don’t need Administrator access for that

I encountered a real dunderhead of a program. It claims to be completely NT, 2K and XP happy, yet it doesn’t tell us it needs administrator access because it creates it’s temp files in C:\, yes, the root of the C drive. There is a perfectly good API available for making good, clean temp files – it’s called GetTempFileName. for a bonus there’s GetTempPath, which gets you a directory for creating temp files, and this directory stands a really good chance of being user isolated (being that it’s %USERPROFILE%\Local Settings\Temp on most NT based OSes). But no, you go and ruin my perfectly working ordinary user program by insisting that you run as administrator. Bloody not written by me sub-programs. You deserve great pain for what you have done.

At least one cause of ‘multi-step ADO operation generated errors’

I was experiencing this occasionally when implementing the delete functionality for a browse window. It turns out that I was not positioned on a record, but instead was either before first or after the last record. Simple problem, really but a bit of a pain to discover the reason as the error isn’t really informative.
The solution was to do move to either the first or last record. Thanks to the magic of the ‘meta bof/eof records’. I have to use the description loosely, as they definitely ain’t records and the correctness police would be rapping my knuckles for such a statement.
Discovering the solution was not helped by the browse grid control I was using – it seemed to indicate that I was on a record when in reality it wasn’t. Another case of model does not match the implementation.