OMG Ponies (Aka Humanity: Epic Fail)
msmvps.com
OMG Ponies (Aka Humanity: Epic Fail)
1–10 of 30 posts
Re: OMG Ponies (Aka Humanity: Epic Fail)
#2Re: OMG Ponies (Aka Humanity: Epic Fail)
#3 >>> s = unicode('Les Misérables','utf-8')
>>> print s[::-1]
selbarésiM seLRe: OMG Ponies (Aka Humanity: Epic Fail)
#4Argentina's 11-day notice for changing their DST rules wreaked all sorts of unexpected havoc. It's sort of awesome (small worlds are more fun) and also totally exasperating.
Re: OMG Ponies (Aka Humanity: Epic Fail)
#5Re: OMG Ponies (Aka Humanity: Epic Fail)
#6It's important to note that choice of language affects a lot of these issues. For example, the unicode issue in Python: >>> s = unicode('Les Misérables','utf-8') >>> print s[::-1] selbarésiM seL
Re: OMG Ponies (Aka Humanity: Epic Fail)
#7I've gotten to the point where I automatically dislike anything containing the phrase "Epic Fail."
Re: OMG Ponies (Aka Humanity: Epic Fail)
#8It looks like you're trying to refer to NEL, which is in Unicode because it was distinct in EBCDIC, and who doesn't want lossless round-trips?
Re: OMG Ponies (Aka Humanity: Epic Fail)
#9It's important to note that choice of language affects a lot of these issues. For example, the unicode issue in Python: >>> s = unicode('Les Misérables','utf-8') >>> print s[::-1] selbarésiM seL
>>> print u'Les Mise\u0301rables'[::-1] #2
>>> print('Les Mise\u0301rables'[::-1]) #3
selbaŕesiM seL
Almost no implementation will fuck up LATIN SMALL LETTER E WITH ACUTE U+00E9, but nearly all programming languages will royally fuck up a COMBINING ACUTE ACCENT U+0301 even in much easier cases like string length. Almost all implementations that claim to be UTF-16 are actually UCS-2, and can't handle surrogates in the slightest.Re: OMG Ponies (Aka Humanity: Epic Fail)
#10Doubles in .net are IEEE 64-bit (8-byte) double-precision floating-point numbers . I've written a few different comparers to deal with problems like the one he demoed. He should have typed it to be a decimal if it was currency or he wanted it to have an exact value instead of be a double-precision floating-point number.
As for the reverse on the string. He reversed the characters, which are defined in .net as char / byte. Not unicode. If you want to play nice with unicode in .net you need to parse it as unicode. A hugely common mistake for all of us who have done some internationalization in .net.
I remember or sorts of trouble with java.util.GregorianCalendar back in the day. Ugh.
I'm not defending .net or C#. I'm just not surprised he ran into these newbie problems. You guys should see the evilness that is Access, the inconsistencies there make this look like nothing. And it's a black art with almost no documentation anywhere.