3 ms·
> There exists an algorithm which transforms names and can be reversed losslessly. (Yes, yes, you can do it if your algorithm returns the input. You get a gol
by chris_7 10y ago
> There exists an algorithm which transforms names and can be reversed losslessly. (Yes, yes, you can do it if your algorithm returns the input. You get a gold star.)
What am I missing here? Any lossless compression algorithm works, even "string.reverse" would apply.
- Bartweiss 10y agoI think the implication is that a transformation won't be reversible if you don't know exactly what was applied? Like, I've had the situation of seeing a poorly-marked name string and going "I think that's 'Last, First' formatting, but I'm really not certain..." Or if you do any formatting change you'll get bizarre problems like apostrophes becoming directional quotes. But yes, the rule-as-written isn't right, and I'm not sure what was meant.
- LolWolf 10y agoI'm not sure I understand either. Any one-to-one function where the name falls under the inverse image of the range works (notably, stupid things like the identity mapping along with, you know, binary representations, etc).
- knz42 10y agoI think the challenge is to find a way to tranform the name so that it's still legible by a human. Like transform "Mister" to "Mr"
- gweinberg 10y agoI think what is meant is, if you combine a first name and a last name, you can't break the full name back into first and last name. Because people have names with spaces in them, among other problems.
- flukus 10y agoWhat if the name has spaces in it? How do you differentiate reliably between a middle name and a name with spaces? It gets even worst when there may have been previous transforms, like forcing family name to be the last name.
- mjevans 10y agoThe answer is; you don't. Always ask the question you actually mean to ask. Frequently someone's /name/ is part of a mailing ADDRESS. You can, and maybe should, limit this to a individual lines. However the only way to be SURE is to give an actual freeform multi-line input box, like a textarea. If you want a string to greet someone as, ask for that, and store it separately. If you want a title to display within a directory listing, accept that. Generally, do not decompose things for your users, EXCEPT possibly client side while populating form elements for their convenience (and verification/correction).
- flukus 10y agoExactly that's the point of the falsehoods article on names. Now if I could just convince management...