5. Oktober 2006

Arrays in VB.net

As a c and c# programmer i think i will never learn it: in vb.net, arrays (e.g. stringarrays) start by default with the index 0 and end with the dimensionparameter. So, a ReDim a(6) creates an array from a(0) to a(6), so it contains 7 (!) elements.

Hopefully, i learned the lesson now...

4. Oktober 2006

is a kilometer 1024 meters?

I just received as a gift (oh lucky me) an usb memory stick labeled 2GB. I just discovered, that there are only 1,86 GB shown in the filesystem. What is wrong?
Well, a closer look to the package of the sticks showed a small star near the sizelabel. The star had to tell me, that this is a 2GB stick, when 2GB are 2.000.000.000 Bytes.
Ok, for some people the real sizes of Memory sound stupid. But there is a reason for the strange boundaries. Decimal Systems do not always work good. I fear, the only reason for the 2GB label is marketing. So, again, marketing caught technical specifications...
In some sense this reminded me to the old story, that physicists think, a kilobyte is 1000 bytes and computer programmers think, that a kilometer is 1024 meters...