5 ms·
I worked on an API that regularly got requests from the mobile app for GET /users/(null). I think that's Swift, or Obj-C's way of to-string'ing a null? I have
by deathanatos 6y ago
I worked on an API that regularly got requests from the mobile app for GET /users/(null). I think that's Swift, or Obj-C's way of to-string'ing a null?
I have a generational suffix on my name. I often include it, and quite often as the proper Unicode character, e.g., "Ⅲ". (Assuming HN displays it after I post this, try to select it; that's one character.) That wreaks a fair bit of havoc.
When I was in high-school, I took physics. I was assigned to room, say, 309, to a teacher whose name I didn't recognize. But I knew the teacher in room 309, and she even taught physics. So, I approached her, and asked, "I've been assigned 'Ms. Stewart', but it lists her as being in your room. Do you know what the correct room number is, Ms. Cook?" Right room; it was her maiden name, of course.
In my company's HR system, we have to note some contacts, for things like life insurance payouts. My fiancée is one. Then we transitioned to a new system, and the data from the old system was migrated over. Now she's my "fiancée". (And in a separate system, she's a he, because there was no option for "fiancée", only "fiancé".) Similarly (and a long time ago) I had to fix a contact/directory system when it escaped a '. E.g., it would emit "Marie O\'Conner". PHP magic quotes… shudders
(Character encodings and anything outside of ASCII, in particular, are an unending fountain of bugs.)
Just today, Azure's support system can't handle (among many things) the outlandish characters of "<" or ">". Which is great fun, since it's not like anyone would file a highly-technical support request with Azure… right?
The missing hour in the DST spring-forward and the duplicate one on the fall-back are great hunting grounds for bugs, too. E.g., Google Calendar has issues with them.
We have a git branch prefix at work that triggers a special CI action. Let's call it "branchprefix/". Every now and then a dev will make a branch with "BranchPrefix/" and the OS X machines all start having issues since OS X's file hierarchy isn't case sensitive. (We've also had issues w/ two files, same name different case. git supports it, but OS X can't cope.)
(All the names in this post are changed from their originals, of course. But you get the idea.)
- saagarjha 6y agoThat’s how C usually prints it. Swift will print “nil”.
- deathanatos 6y agoHuh. I feel like I distinctly remember it being both one of our mobile clients, and it being the string "(null)". Java, perhaps? (That was our Android app, of course.) Although we did have a desktop app (weirdly) and that was in C++.
- saagarjha 6y agoJava just prints “null” IIRC. To be fair, the “(null)” you’ll usually get from passing a null pointer to printf is implementation defined (really, undefined, but no implementation I’ve seen has done bad things with it).
- JimDabell 6y ago> Huh. I feel like I distinctly remember it being both one of our mobile clients, and it being the string "(null)". Objective-C will do that with the format string "%@" if you pass it nil.
- colejohnson66 6y agoI was curious, so I tested that[0], and 3 of the 4 major compilers (clang, gcc, and ICC) all output `(nil)` for a `%p` on a null pointer, but `(null)` for a `%s`. Godbolt doesn't support executing MSVC for some reason. However, it is my understanding that passing a non-null pointer to printf for `%s` is undefined behavior. [0]: https://godbolt.org/z/7K5qWv https://godbolt.org/z/7K5qWv
- saagarjha 6y agoAll three are probably using glibc, which does that, yes: https://github.com/ahjragaas/glibc/blob/82cfac84c7e24be587bb0b56c4ef2c80f7677aae/stdio-common/vfprintf-internal.c#L1037 https://github.com/ahjragaas/glibc/blob/82cfac84c7e24be587bb.... On Darwin Apple’s libc prints “(null)”: https://github.com/apple-open-source-mirror/Libc/blob/5e566be7a7047360adfb35ffc44c6a019a854bea/stdio/FreeBSD/vfprintf.c#L957 https://github.com/apple-open-source-mirror/Libc/blob/5e566b.... I should also note that passing a non-null pointer to printf is the only correct way to use it ;)
- ojbyrne 6y agoI still see \’ appearing on large well trafficked websites, like espn.com and cnn.com.
- zinekeller 6y ago> Just today, Azure's support system can't handle (among many things) the outlandish characters of "<" or ">". Which is great fun, since it's not like anyone would file a highly-technical support request with Azure… right? Someone in Azure is definitely using the Windows reserved characters for filenames.
- jannes 6y agoReminds me of the fact that filenames in OneDrive are even more restrictive because of some legacy SharePoint software that was representing filenames in URLs. "?" and "#" were not allowed in OneDrive for Business for a long time because they have a special meaning in URLs: https://techcommunity.microsoft.com/t5/microsoft-sharepoint-blog/new-support-for-and-in-sharepoint-online-and-onedrive-for/ba-p/60357 https://techcommunity.microsoft.com/t5/microsoft-sharepoint-... The Rclone documentation has a full list of problematic OneDrive characters: https://rclone.org/onedrive/#restricted-filename-characters https://rclone.org/onedrive/#restricted-filename-characters
- CodesInChaos 6y agoI think misguided XSS protection is the most likely culprit here.
- climb_stealth 6y agoJust as an aside, you can reformat the file system to be case-sensitive on MacOS. I think at $dayjob it's more or less policy to do so. The only downside I have seen so far is that some software only runs on case-insensitive file systems. For example Photoshop did this last I checked.
- TobTobXX 6y agoNeither does the Steam application (on macOS, not on Linux AFAIK). Thanks to that I could start to live without it. ^^
- masklinn 6y ago> Every now and then a dev will make a branch with "BranchPrefix/" and the OS X machines all start having issues since OS X's file hierarchy isn't case sensitive. (We've also had issues w/ two files, same name different case. git supports it, but OS X can't cope.) FWIW macOS is perfectly fine with it. The FS (both HFS+ and APFS) can be configured to work in CI or CS modes. The default is CI. Since git uses the FS for part of its data storage, things break. That’s more of an issue with Git not supporting CI FS, really.
- tobyhinloopen 6y agoA lot of software actually breaks running macOS in case sensitive mode, incl Adobe stuff
- masklinn 6y agoTrue, I was going to put a note on that but apparently forgot or removed it while editing: some software, mainly cross-platform from windows (which is CI) will break in CS file systems, while Unix software is more likely to break on CI.
- jannes 6y agoI was going to say the same thing. Everytime I format my hard drive I have to look up which mode is the one that doesn't break things...
- dash2 6y agoWhen I lived in the US I was amazed how many systems couldn't handle my (English) surname, which has a dash in it.
- jerf 6y ago'Just today, Azure's support system can't handle (among many things) the outlandish characters of "<" or ">".' My favorite way of breaking things is to go the other way... oh, you won't allow < or >? Well, how about < and >? That's ok then? Great! One I've done several times is encounter a field that "can't be left empty", and is smart enough to filter out the ASCII whitespace before the check... but isn't smart enough to filter out the Unicode zero-width space. "A computer wizard never says too much or too little, he says precisely what he means to."
- webmaven 6y ago> When I was in high-school, I took physics. I was assigned to room, say, 309, to a teacher whose name I didn't recognize. But I knew the teacher in room 309, and she even taught physics. So, I approached her, and asked, "I've been assigned 'Ms. Stewart', but it lists her as being in your room. Do you know what the correct room number is, Ms. Cook?" Right room; it was her maiden name, of course. I'm reasonably certain one of those two 'Ms.' instances should be 'Mrs.'.
- hnick 6y agoTraditionally yes, but there's no legal requirement and many people don't feel the need to make the change (my wife being one).
- webmaven 6y agoSo, you're saying your wife did change her last name, but not the honorific? That's an interesting combination I hadn't encountered before. Probably worth adding to the "Things Programmers Beleive About Names" list.
- hnick 6y agoAh no I missed your implication there. She didn't. It isn't unheard of though, some people stay with Ms as a default if they don't think their marital status is anyone's business. It's a less political version of Mz I guess, which is something one teacher I had used and made sure we knew about.
- webmaven 6y agoI suppose I assumed that anyone inclined to leave the honorific unchanged would also be inclined to leave their last name unchanged as well. But we all know what they say about assumptions...