Wednesday, November 4, 2009
Nasty Oracle ADO bug
When you run a query like select N'X' from dual in an ADO recordset and you are using AL16UTF16 as the national characterset, then if you look at the value of DefinedSize and ActualSize in ADO, you will get a DefinedSize of 1 and an ActualSize of 2.
That's obviously wrong, because DefinedSize is the maximum capacity of the field, and in this case it will be returned as a adVarWChar type. Therefore, it should be being returned as 2, as the letter 'X' in AL16UTF16 is represented as 2 bytes and as it's an adVarWChar type that's all it needs to store the value.
Now if it was the supplementary Han character 𧉧, which is U+27267, the ActualSize will be 4 and DefinedSize will be 4 also. That's because in UTF-16, the actual encoding is 0xD85C-DE67, which is 4 bytes long.
This particular issue has caused my company a great deal of grief, and it took Oracle a long time to acknowledge there was a problem. However, we have been told that this will be fixed in Windows patch bundle 26 for the Oracle 10g client (bug number is 8301952), and even better I believe that it was fixed in Oracle 11g R2.
Monday, October 19, 2009
Great story
Norbert Wiener was perhaps the greatest U.S. mathematician in the first half of the twentieth century, revered among his colleagues for his brilliance. He was also famous for his absent-mindedness.After a few years at MIT, Norbert Wiener moved to a larger house. His wife, knowing his nature, figured that he would forget his new address and be unable to find his way home after work. So she wrote the address of the new home on a piece of paper which she made him put in his shirt pocket. At lunchtime that day, the professor had a inspiring idea. He pulled the paper out of his pocket and used it to scribble down some calculations. Finding a flaw, he threw the paper away in disgust. At the end of the day he realized he had thrown away his address. He now had no idea where he lived.
Putting his mind to work, he came up with a plan. He would go to his old house and await rescue. His wife would surely realize that he was lost and go to his old house to pick him up. Unfortunately, when he arrived at his old house there was no sign of his wife, only a small girl standing in front of the house. "Excuse me little girl," he said, "but do you happen to know where the people who used to live here moved to?" "It's okay daddy," said the little girl. "Mommy sent me to get you."
P.S. Norbert Wiener's daughter was recently tracked down by a mathematics newsletter. She denies he forgot who she was, but admits he lost the house.
(source)
Monday, October 12, 2009
Planet Gnome
Honestly, I can understand the controversy over RMS's presentation at the Gran Canaria Desktop Summit, which really was sexist, but it appears that it has sparked a wave of self-righteous indignation amongst Gnome people. Seems quite ridiculous.
Saturday, October 10, 2009
Evil... but totally cool. Debugging apps remotely via IRC
Basically, you get the GNU Debugger (gdb) and hook it up to IRC.
Of course, you'd want to know who you are talking to. Very Insecure.