The Wiert Corner – irregular stream of stuff

Jeroen W. Pluimers on .NET, C#, Delphi, databases, and personal interests

  • My badges

  • Twitter Updates

  • My Flickr Stream

  • Pages

  • All categories

  • Enter your email address to subscribe to this blog and receive notifications of new posts by email.

    Join 2,977 other subscribers

Archive for August, 2009

Delphi – good article on pointers and memory structures by Rudy Velthuis

Posted by jpluimers on 2009/08/31

While explaining someone the concept of pointers, I came across this excellent article by Rudy Velthuis with the deceptivly simple title Addressing pointers.

It takes you step by step through almost anything you want to know about pointers in Delphi.

Highly recommended!


Posted in Delphi, Development, Software Development | Leave a Comment »

HotSwap! – hot eject and hot insert SATA hard-drives – practical use with ICY BOX 266StUSD

Posted by jpluimers on 2009/08/30

RaidSonic ICY BOX IB-266StUSD-B and IB-266StUS-BOver the last couple of years, I have upgraded a few SATA laptop hard-disk drives to larger ones.
The easiest way to reuse these drives, is to put them into an external USB enclosure.
But: USB does not deliver the speed of SATA.

So, a few years ago, I found the ICY BOX IB-266StUSD-B from RaidSonic – the picture at the top.
This box contains both the actual enclosure part IB-266StUS-B (note the missing D from the part number) – the picture on the bottom, and a docking station that fits in a regular 3.5″ external bay (now normally used for multi-card readers, in the past used for floppy drives or ZIP drives).

The cool thing is that the enclosure has both an USB and an eSATA connection:
IB-266StUS-B has both eSATA and USB connections 

Even cooler is that the docking station also has a SATA connection. Which means that as soon as you insert the HDD, you have full SATA speed.

Now the not so cool thing is that Windows does not allow you to hot eject or hot insert a SATA drive.
Or does it?
In fact it does allow inserts, and even ejects, but with a lot of fiddling with Device Manager, and only if your SATA driver allows it from within the Device Manager.

This is where HotSwap! kicks in… Read the rest of this entry »

Posted in Development, Hardware Interfacing | 1 Comment »

Foto’s van KatwijnBinse Truckrun 2009

Posted by jpluimers on 2009/08/24

Zaterdag was de jaarlijkse KatwijkBinse Truckrun: een evenement waar gehandicapte mensen als bijrijder in een Truck (97 stuks!) of Bus (3 stuks) een rit van ongeveer 4.5 uur mee mogen maken.

Het festijn begint met een kennismaking tussen de bijrijders en chauffeurs, foto sessie, groepsfoto, lunch en dan de hele rit.

Reuze gaaf, het gaat de halve bollenstreek, een stukje Leiden en een stuk kust door.
Vertrek en aankomst zijn op het voormalige Marine Vliegkamp Valkenburg.

Mijn broer Martijn (met een groene body warmer op een aantal foto’s) was een van de bijrijders, en ik heb een leuke camera, dus deze keer foto’s gemaakt.

De glimlach van bijrijders, chauffeurs, medewerkers en kijkers is onbetaalbaar!

Om een lang verhaal kort te maken, hier wat sets met foto’s:


Boulevard Katwijk:



Posted in About, Personal, Truckrun | Leave a Comment »

Answered @ Stackoverflow – on Parsing a record of unknown structure: use classes with published properties and the Delphi streaming mechanism

Posted by jpluimers on 2009/08/24

At Stackoverflow, user AB asked about Delphi: Parsing a record of unknown structure.

Basically his question came down to iterating over the fields of a record, then writing out the values to some sort of human readable file, and then reading them back in.

His idea was to use INI files, but also needed support for multi-line strings.
I suggested to use classes in stead of records, and published properties in stead of fields, then use the Delphi built-in streaming mechanism to stream to/from Delphi dfm files.

Normally, Delphi uses dfm files (they have been human readable text files since Delphi 6 or so) to store Forms, DataModules and Frames.
But why not use them to store your own components?
Read the rest of this entry »

Posted in Component Development, Conference Topics, Conferences, Delphi, Development, Event, Package Development, Pingback, Software Development, Stackoverflow | 5 Comments »

Delphi – getting the sourcefile name from a source file with an Assert trick using EAssertionFailed

Posted by jpluimers on 2009/08/21

For one of our projects, we have a set of configuration files that we want to be able to locate automatically.

(in this case they are XML files as most development environments have one way or the other to do some XML Data Binding that maps objects or interfaces to/from XML; in Delphi you can use the XML Data Binding Wizard for that: it has been there since Delphi 6, and CodeBeach has a nice Delphi XML data binding wizard video tuturoial on how to use that wizard)

We usually have a few instances of those config files hanging around:

  1. for testing; this one goes into the same directory as the Delphi source file generated by the XML Data Binding Wizard
  2. for the Delphi IDE (which might be relative to the Delphi IDE .exe)
  3. for the application (which usually is relative to the Appliation .EXE, or user settings directory)

If a specific version (higher numbers in the list above) does not exist, we want to revert to a more generic version (with lower numbre in the list above).
Ultimately we want to revert to the one for testing, which is in the subdirectory of a specific sourcefile.

Since all our development machines are configured in a similar way (i.e. having the same root path like C:\DEVELOP for our sources), it would be nice to be able to somehow automatically detect the file name of a source file.
Read the rest of this entry »

Posted in Delphi, Development | 3 Comments »

%d bloggers like this: