| User | Post |
|
11:56 am March 15, 2011
| sheila
| | mindsided by Blindsight | |
| Moderator
| posts 515 | |
|
|
Spent too much time beanplating generating random alphanumeric strings for member ids wondering whether I should try to control for any rude language. Which would make me laugh if I had a member id, but not everyone.
Someone told me that it is highly unlikely one would show up, so I think I'm just going to take it off my mind and get on with the code.
btw, this apache commons lang method signature is really silly.
random(int count, int start, int end, boolean letters, boolean numbers, char[] chars, Random random)
oh look, it is already almost 1pm.
|
|
|
10:57 pm March 15, 2011
| Flanders
| | |
| Member | posts 113 | |
|
|
|
7:34 am March 16, 2011
| sheila
| | mindsided by Blindsight | |
| Moderator
| posts 515 | |
|
|
You might want to skip to part 3
Part ! of this saga
I got distracted from real work wondering if the member codes being randomly generated would have any curse words in them. Probably a good idea to avoid the automated curse generator unless users have a sense of humor.
for member code think if you had a frequent flyer code of 12FUCK3. This would be awesome, right? If you are not you, wrong!
so then you might think, huh, how do I avoid that. man, it would be really stupid if I had to write some stupid filter to filter out likely curse words that I never thought of (I'm not a particularly good curser, woe betide me if I have a stroke). maybe disemvowel? but then I wonder how many curse words there are without vowels in languages that don't have vowels when you romanisize the letters. also, FVCK YOU!
then someone tells me, you know, I've never seen a curse word generated for our locator codes in all the time I've been here.
Part the 2
also, I am a lazy programmer and already have apache lang commons available to me, and who wants to re-invent the wheel. you'd imagine someone already has created a library to generated random strings. google. indeed, there is RandomStringUtil.
happy programmer goes to read the docs. sad programmer sees that the method signature is stupid. why?
Let's say you come along and read, random(10, 0, 10, false, false, alphanumSomething, myLittleRandom)
What do the 10s mean? what is that 0? what am I setting with those falses? alphanumSomething is probably the set of characters that get used in the random string I generate. that random thing is probably a random number generator.
It's an anti-pattern. One should try to avoid creating a method like that that doesn't just read in a way that is obvious for what it is doing. I hate it when I end up doing something like that. I'm glad I didn't make this method. Let's say I did. Maybe I would have remembered what exactly all those things do for a while, but a year later I am not and I'll have to refer to the docs, or to some comments somewhere. That is bogus. comments lie. looking up comments that lie is bogus. looking up docs is bogus. they just made me context switch. also, if you go read the docs for that, one of the numbers up there is seriously non-idiomatic for a programming thing, so that is another hit to one's cognitive load.
I don't want to be thinking all that crap, I want to be thinking about real stuff.
Part 3 wherein I edit part 1 and part 2 but those were the translation to english and would have made for an entertaining watch the nerd conversation, but maybe you didn't ask for that
It's a bad idea to generate member codes, e.g. frequent flyer numbers, that inadvertently contain offensive language. Most of the solutions to avoid this are going to be stupid. … and the likelihood of it happening in my case is vanishingly small, so I should stop over-thinking it. (slang for over-thinking something is called beanplating)
Now on to the part where one wants to write source code for generating random alphanumeric strings to be member codes. Usually when you want to do something obvious like that, you can bet that someone has already done it. So you go look for it. In a library that we have already included in our app for other things, there is a handy method that will do what I want. But the way in which you call the method is silly, because it is not mnemonic and will interrupt your thought flow when you come upon it later.
Part 4
man, part 3 is still too long. I'm sure I could do a better job than that but I apologize because I don't want to.
Part 5
did you know that I love haikus? I specially love writing them. One would not think that.
|
|
|
7:34 am March 16, 2011
| Hljothlegur
| | |
| Moderator
| posts 367 | |
|
|
sheila said:
Spent too much time beanplating generating random alphanumeric strings for member ids wondering whether I should try to control for any rude language. Which would make me laugh if I had a member id, but not everyone.
Someone told me that it is highly unlikely one would show up, so I think I'm just going to take it off my mind and get on with the code.
btw, this apache commons lang method signature is really silly.
random(int count, int start, int end, boolean letters, boolean numbers, char[] chars, Random random)
oh look, it is already almost 1pm.
Ahahahhaha. So, an infinite number of code monkeys on an infinite number of alphanumeric string generators would eventually output every curse word in every language ever spoken on the planet?
Every so often I will hear how some smart alec in this area has gotten a curse word in his own obscure language onto his personalized license plate past the censors at the state level that issue the numbers. You know, "vagina" in Eritrean or something….
|
|
|
7:36 am March 16, 2011
| sheila
| | mindsided by Blindsight | |
| Moderator
| posts 515 | |
|
|
also, that post was like "WHAT ARE you READING this instant! expect with work and thinking" but next time I might try to contain it in 17 syllables or less.
|
|
|
7:45 am March 16, 2011
| sheila
| | mindsided by Blindsight | |
| Moderator
| posts 515 | |
|
|
Hljothlegur said:
[...]
Ahahahhaha. So, an infinite number of code monkeys on an infinite number of alphanumeric string generators would eventually output every curse word in every language ever spoken on the planet?
[...]
unless there exists a language that someone hasn't ever used in the context of typing on western keyboards, and one uses an inadequate encoding. then maybe not.
Ps. lolplates > vulgar plates. but I don't know if beanplates > lolplates.
|
|
|
3:04 pm March 16, 2011
| Andrea_A
| | Germany | |
| Member | posts 147 | |
|
|
sheila said:
Hljothlegur said:
[...]
Ahahahhaha. So, an infinite number of code monkeys on an infinite number of alphanumeric string generators would eventually output every curse word in every language ever spoken on the planet?
[...]
unless there exists a language that someone hasn't ever used in the context of typing on western keyboards, and one uses an inadequate encoding. then maybe not.
Ps. lolplates > vulgar plates. but I don't know if beanplates > lolplates.
Kurd Laßwitz (so-called father of science fiction in Germany) wrote a short story about this topic hundred years ago [1]. He suggested to use indices for special characters (maths, foreign language). This works well: TeX is only ASCII code; in HTML Unicode characters are encoded as entities. And if you really need graphics in this "Universal Library", they might be encoded SETI-code like …
Even more simple: hyphenating anal-ysis (though Websters says this is allowed) … http://www.merriam-webster.com…..y/analysis
_____
[1] http://gutenberg.spiegel.de/buch/3130/1 (Kurd Laßwitz, Die Universalbibliothek) [German]
|
|
|
7:54 pm March 16, 2011
| sheila
| | mindsided by Blindsight | |
| Moderator
| posts 515 | |
|
|
Andrea_A said:
[...]
Kurd Laßwitz (so-called father of science fiction in Germany) wrote a short story about this topic hundred years ago [1]. He suggested to use indices for special characters (maths, foreign language). This works well: TeX is only ASCII code; in HTML Unicode characters are encoded as entities. And if you really need graphics in this "Universal Library", they might be encoded SETI-code like …
Even more simple: hyphenating anal-ysis (though Websters says this is allowed) … http://www.merriam-webster.com…..y/analysis
_____
[1] http://gutenberg.spiegel.de/buch/3130/1 (Kurd Laßwitz, Die Universalbibliothek) [German]
You might enjoy reading about Goedel numbers.
I can't read German, but will see how google translate works on that story. It will probably be good enough to get some ideas across.
|
|
|
8:15 pm March 16, 2011
| sheila
| | mindsided by Blindsight | |
| Moderator
| posts 515 | |
|
|
Thanks for posting about that short story. I skimmed a little in google translate.
It reminded me of the library of Borges, so I looked up the wikipedia article thinking for certain it would be mentioned. The Library of Babel which does give a tip of the pen to the author. And this sources the idea to Gustav Fechner, who was an experimental psychologist. He did interesting work for the time, though, so read his wiki page if you have a mind to. I studied about him in a lab course in the senses and perception, and also in a history course on psychology.
and I seem to have this very vague memory of being very depressed a long time ago, with someone emailing me that Gustav Fechner had been depressed until he had some insight about plants, and wrote a little book called the soul life of plants which I should read. :) I probably don't even remember that conversation right, but anytime I see a page about Fechner, I check his bibliography for the mythical book.
|
|
|
12:25 am March 17, 2011
| Andrea_A
| | Germany | |
| Member | posts 147 | |
|
|
sheila said:
Thanks for posting about that short story. I skimmed a little in google translate.
It reminded me of the library of Borges, so I looked up the wikipedia article thinking for certain it would be mentioned. The Library of Babel which does give a tip of the pen to the author. And this sources the idea to Gustav Fechner, who was an experimental psychologist. He did interesting work for the time, though, so read his wiki page if you have a mind to. I studied about him in a lab course in the senses and perception, and also in a history course on psychology.
and I seem to have this very vague memory of being very depressed a long time ago, with someone emailing me that Gustav Fechner had been depressed until he had some insight about plants, and wrote a little book called the soul life of plants which I should read. :) I probably don't even remember that conversation right, but anytime I see a page about Fechner, I check his bibliography for the mythical book.
Goedel numbers: sorry, this goes over my mind … Sometimes I have to use TeX at work, but this doesn't mean that I understand the formulas.
Laßwitz (who had also edited Fechner's work) wrote two novels using his ideas: "Aspira", about intelligent clouds, and "Sternentau. Die Pflanze vom Neptunsmond", in which a plant called Star Dew comes from outer space (Neptune's moon). Didn't read them until now, but the books are waiting on my cellphone …
|
|
|
10:19 am March 17, 2011
| sheila
| | mindsided by Blindsight | |
| Moderator
| posts 515 | |
|
|
Andrea_A said:
[...]
Goedel numbers: sorry, this goes over my mind … Sometimes I have to use TeX at work, but this doesn't mean that I understand the formulas.
Laßwitz (who had also edited Fechner's work) wrote two novels using his ideas: "Aspira", about intelligent clouds, and "Sternentau. Die Pflanze vom Neptunsmond", in which a plant called Star Dew comes from outer space (Neptune's moon). Didn't read them until now, but the books are waiting on my cellphone …
If I understood the concepts well enough I could explain them. It would not go over your mind with a good teacher. I had a friend who was a grad student of Douglas Hofstadter and I could have conversations with my friend about these things. He likes to translate poetry, and somehow we got in to a conversation about language translation, Goedel numbers, and telephone numbers. If I remember correctly, he was using the telephone numbers as an analogy to approach explaining Goedel numbers.
I like ideas from Douglas Hofstadter's books but I could not finish GEB because he often got on my nerves with his writing style. Instead I had some text books and classes on the material to entertain me. But there is one on language translation that I am not sure which books to read instead of, so I might read that at some point.
Anyway, I will try to review the material, reteach myself, teach myself, and maybe come up with a good enough explanation to make things clear because the ideas are fun enough that I want to share.
On to the book topic, I did a search and it looks like the only one of his work that was translated is The Two Planets, but if you know of translations for the ones you mentioned, please tell me. I'd like to read htem.
|
|
|
3:16 pm March 17, 2011
| Andrea_A
| | Germany | |
| Member | posts 147 | |
|
|
Post edited 12:07 am – March 18, 2011 by Andrea_A
sheila said:
If I understood the concepts well enough I could explain them. It would not go over your mind with a good teacher.
Especially with math this is crucial … I changed school and in the new class they had been much farther. Understood absolutely nothing — no point of contact — until my neighbour (engineer) explained it. And then I went really good. Alas — now I realize that I shut down this part of my mind … never needed this skills after finishing school …
…
On to the book topic, I did a search and it looks like the only one of his work that was translated is The Two Planets, but if you know of translations for the ones you mentioned, please tell me. I'd like to read htem.
Sadly not. But maybe wait ten years, and Google Translate would provide perfect translations …
The Two Planets has been released in English rather late (1971); so Laßwitz had not much influence on American science fiction. The book is full of (in its time) innovative ideas. For example, the Martians had synthetic food — "coal sausages" went modern on earth, too (well … Peter's 'Cyclers are more than hundred years old).
|
|
|
3:44 pm March 17, 2011
| Andrea_A
| | Germany | |
| Member | posts 147 | |
|
|
Hljothlegur said:
…
Every so often I will hear how some smart alec in this area has gotten a curse word in his own obscure language onto his personalized license plate past the censors at the state level that issue the numbers. You know, "vagina" in Eritrean or something….
Works reversed, too. Harmless words in one language, offensive in another. There's a small Austrian village cursed with the name "Fucking" … And I read about a broker, unable to send mails about FAG Kugelfischer (German ball-bearing company) via Bloombergs mail system: "inappropriate word".
|
|
|
7:07 pm March 19, 2011
| Hljothlegur
| | |
| Moderator
| posts 367 | |
|
|
Andrea_A said:
Hljothlegur said:
…
Every so often I will hear how some smart alec in this area has gotten a curse word in his own obscure language onto his personalized license plate past the censors at the state level that issue the numbers. You know, "vagina" in Eritrean or something….
Works reversed, too. Harmless words in one language, offensive in another. There's a small Austrian village cursed with the name "Fucking" … And I read about a broker, unable to send mails about FAG Kugelfischer (German ball-bearing company) via Bloombergs mail system: "inappropriate word".
Oh no! And no way to get around that easiily, is there? I don't remember seeing the town of Fucking on our drive NE from Innsbruck toward Wien, but I thought I remembered seeing the name on the map. Is it one of those tiny picturesque towns with very narrow streets?
|
|
|
7:56 pm March 19, 2011
| Flanders
| | |
| Member | posts 113 | |
|
|
Meanwhile, I will be incorporating "Kugelfischer" into my swearing vocabulary.
Aw, Kugelfischer!
|
|
|
|
|
3:03 am March 20, 2011
| Andrea_A
| | Germany | |
| Member | posts 147 | |
|
|
Post edited 3:37 am – March 20, 2011 by Andrea_A
Hljothlegur said:
Andrea_A said:
Works reversed, too. Harmless words in one language, offensive in another. There's a small Austrian village cursed with the name "Fucking" … And I read about a broker, unable to send mails about FAG Kugelfischer (German ball-bearing company) via Bloombergs mail system: "inappropriate word".
Oh no! And no way to get around that easiily, is there? I don't remember seeing the town of Fucking on our drive NE from Innsbruck toward Wien, but I thought I remembered seeing the name on the map. Is it one of those tiny picturesque towns with very narrow streets?
Never been there. But on Google maps it looks like a rural idyll (probably with more cattle than humans). The only tourist attraction is their traffic sign (frequently been stolen until specially secured). And the [see above] probably most famous sociopathic leader came from the neighbourhood …
Flanders said:
Meanwhile, I will be incorporating "Kugelfischer" into my swearing vocabulary.
Aw, Kugelfischer!
Be careful. They've got good lawyers … and those fags may sue you for damaging their company's reputation.
Maybe swear words are them per definitionem. I like Larry Niven's idea of the Human society of Known Universe having replaced any swear word with the "Beep" — in the end Beep became a swear word itself …
Among my very early science fiction readings had been Foster's Iceriggers. Sir Hunnar's "Trinska!" is actively in use …
|
|