Mimic, the Evil Script That Will Drive Programmers To Insanity (github.com)
JustAnotherOldGuy writes: Mimic implements a devilishly sick idea floated on Twitter by Peter Ritchie: "Replace a semicolon (;) with a Greek question mark (;) in your friend's C# code and watch them pull their hair out over the syntax error." There are quite a few characters in the Unicode character set that look, to some extent or another, like others – homoglyphs. Mimic substitutes common ASCII characters for obscure homoglyphs. Caution: using this script may get you fired and/or beaten to a pulp.
git revert [commit]
"Your commit broke the build. Fix it."
Bonus points if your continuous integration build server catches it automatically.
Then have a talk with the author of this non-sense commit about wasting corporate resources.
not.
Somebody reverts your code.
At least Slashdot will never fall victim to this.
How can I believe you when you tell me what I don't want to hear?
Wouldn't they see your change to the file in the history/blame for the line?
Or do they suggest you hack your co-workers machine to run this script on their system?
Things you think are in the Constitution, but are not.
is reserved for these kind of people...
The surname Ritchie got me for a second though.
One thing that always drove me crazy was the Unix "make" command because of the syntax of the Makefiles. The problem was, unlike just about every other language, Makefiles distinguish between TAB and SPACE characters, and they can look indistinguishable in printouts. I always avoided make for that reason and just wrote shell scripts to compile my code. I've also stayed away from Python because of its use of indentation to indicate the scope of control structures. Too easy to screw up by mixing tabs and spaces. In many fonts used in early terminals and printers, zeros were drawn with a slash through them so they wouldn't be confused with uppercase O's. Now with Unicode replacing ASCII as the encoding for source code in most languages, let the nightmares begin!
If I can be modded down for being a troll, can I be modded up for being an orc, or a balrog?
using this script may get you fired and/or beaten to a pulp
and not necessarily in that order.
Knowledge is how to play a game, intelligence is how to win, wisdom is knowing what game to play.
That is certainly good to be reminded of. In case of weird errors, pass your code through something that checks for characters beyond ASCII.
In fact, I am often bitten by something similar on Macs: when typing the pipe character on my keyboard (Alt-7), followed by a space, I end up typing Alt-space, which ends up as a nicode non-breaking space or something. It took me a while to get used to and understand the error saying "-bash: grep: command not found".
My students regularly copy-paste from an otherwise excellent source in which plain vertical double quotes have been auto-replaced with pretty slanted quotes. GCC complains about the illegal character on line XXX, I usually have to explain, and that's it. No hair-pulling involved, only git pulling.
similar than the non-standard MS symbols, which still hunt me sometimes. Since more than a decade, I use https://www.fourmilab.ch/webto... to get rid of nonstandard Latin 1. There is nothing more frustrating than have two versions of a program, which both look the same, but only one actually does the right thing.
Semi-related: Back when Windows XP was new and LAN parties were still a thing, I would sometimes look around for some dope who shared the root of their C:\ drive with full write permissions and create a folder on the computer's desktop with some name or other telling the person to lock down their computer, substituting ALT+0255 for the space character. It looks like a normal space, but Windows Explorer couldn't rename it, move it, or delete it (Microsoft has since fixed that little bug, unfortunately). You had to open a command prompt and delete it and type the ALT+0255 space, a regular space wouldn't work.
Back in the day, we used to hit alt-255 when naming executable files in dos. That would put an ascii character in the file name that looked like a space (spaces themselves were not allowed in dos file names.) You could see the file there when you issued a "dir" command (if you put the alt-255 at the end of the file name then you wouldn't have much of a clue that the character was there.) But if you tried to execute the file w/o using the alt-255 trick then you would get a "command not found" error. Ah old useless dos tricks!
Unicode in code is for people that do not understand what they are doing.
Most ACs are not even worth the keystrokes to insult them. Be generically insulted by this and ignored otherwise.
that Revision Control instantly beats this bullshit.
Have gnu, will travel.
SomeScriptKiddie writes:
Mimic rehashes an old idea that we all thought died out with MSN: "Replace normal characters like a semicolon (;) with a Greek question mark (;) in your friend's batch files and watch them pull out the previous branch from version control." There are quite a few characters in the Unicode character set that look, to some extent or another, like others – so almost homoglyphs, but not quite. Mimic is a horribly convoluted implementation of what is essentially search & replace. Caution: using this script may get you laughed at and/or promoted to entry level computer hardware mover.
Slashdot social media options: AIM, ICQ, Yahoo, Jabber and Mobile Text. Why no MySpace?
In the late 1980s as a student I spent several hours feverishly debugging an inscrutable syntax error on a green monochrome monitor at a school lab. I just managed to make the deadline, because on that crappy monitor with its crappy font, ( and { looked too much alike. This took enough time away so that I lost points for not properly formatting my output; but at that point I was happy just to *have* output.
For all intensive purposes, "whom" is no longer a word. That begs the question, "who cares"?
I often get the symbol for before (__*__) and after (__O__) confused.
"If any question why we died, Tell them because our fathers lied."
I understand perfectly that other languages have different symbols. But when those symbols are effectively identical to an existing symbol, JUST USE THAT SYMBOL. What idiot decided they had to make a different Unicode character for the greek questionmark, rather than simply using the semicolon? What, the dot above the comma in the greek questionmark is more squarish? Big deal
excitingthingstodo.blogspot.com
Just wait a few weeks... the next version of systemd will catch these sort of errors for you.
This would only work on people who don't understand how syntax errors work. Any time an error occurs that I feel is impossible I examine the ordinal values of the characters, or I will delete and retype the line. No real programmer is going to be stumped by this for longer than 5 minutes.
BeauHD. Worst editor since kdawson.
...when editors were so very incompetent at displaying non-printing characters that "try deleting the line and retyping it" was a standard debugging technique. It worked often enough to stay in the toolbox. (Helping this was one compiler bug that occasionally wrote into the source file.)
I like to think that we have passed that stage. For many years, I believe that was true. Perhaps the dark times are about to return.
Some things are eternal, though; if you're editing machine code in hex or octal, you're probably safe.
promoted to entry level computer hardware mover
If it's up to me, the new title will be "exit-level developer".
APK quotes people (including myself) without context and should not be trusted. Just thought you should know.
1976 - Our high school ran time shared BASIC on a PDP-8. We wrote a program that would read in a program source file, and randomly replace one or two zeros with letter O, commas with semi colons and round brackets with square brackets. Not all of them, just a few. Drove our well deserving victims nuts.
A classic trick, but hardly new.
It is much easier to destroy than to create.
Values of "destroy" range from petty theft, vandalism, gaming the system, being a jerk, apathy and sloth, active sabotage, and outright war.
Be nice, even if nobody is watching. Looters should be shot.
This issue is a bit more complicated than you think.
Helvitica font displays lowercase l capital I identically. Do this trick on the co worker who leaves the work station unguarded. The code will compile and throw up run time errors. They are lot more fun to watch.
sed -e 's/Chuck Norris/Rajnikant/g' joke > fact
Well, once you suspect it, it's easy to detect. Just use a font that only displays in ASCII.
I think we've pushed this "anyone can grow up to be president" thing too far.
When dealing with a problem that I cannot identify in source, I usually comment out the offending line(s) and retype them from scratch if I have to.
No matter the subject matter, troubleshooting starts by isolating the problem.
Then a sane language would not allow strings in the source code to be presented to the user, as a string presented to a user might contain characters outside US-ASCII. I'm curious what sort of syntactic salt your preferred language has to force developers to use internationalization best practices.
\xFF is no-break space in CP 437. It looks identical to ascii \x20 space. But I assure you Turbo C and djgpp think of it very differently.
“Common sense is not so common.” — Voltaire
It's funny or not, but it does illustrate a real problem. We've seen the discussion about whether or not URLs should have unicode support. Yes it's nice to non-western languages. But it introduces the same kind of problems and suddenly you are not on the website you think you are on anymore.
The more I look at it, the more I decide that Unicode is simply evil.
Assorted stuff I do sometimes: Lemuria.org
So we made a DOS TSR program that hooked in the keyboard interrupt, and if it detected that it was called from Turbo Pascal, and that the sequence for compilation was keyed in, it would locate Turbo Pascal's editor buffer and randomly change a couple of semicolons to colons.
This was both annoying as hell (plenty of syntax errors), and difficult to positively blame on mischief as:
The TSR was called <shift-space>.com and so a cursory perusal of the autoexec.bat would not reveal its presence, as shift-space just looks like a normal space (... but can be the name of a command)
IT spend an entire day trying to re-install Turbo Pascal, and the problem still persisted... (because it was in an independent TSR rather than in the Turbo Pascal itself)
Then, the next day, they re-installed the entire system...
Another fun TSR one was the "annoying keyboard beep". The TSR had a timetable of the classes build in, so that the keyboard click would be very short and almost unnoticable at the beginning of the class, and then gradually grew longer and longer during the class (first a faint click, than a more obvious click, and by the end of the hour an annoying beeeeeeeeeep). Fun thing is, as it was gradual, nobody really noticed when/how it started, but eventually that background noise was "just there"...
A, those were the days of highschool pranks...
the oldest solution to this 'mimic bug' is a hex editor. also many 'reveal codes' in complex word processors will show the actual data as to which character is in use, it is only the novice who are going to be tricked by this stuff!
https://www.gnu.org/philosophy/free-sw.html
STEP 1: Just write a couple thousand lines of C code replete with memory pointers ("->") and accidentally type one with an underscore instead of a hyphen ("_>") because you pressed the shift key too soon. STEP 2: Try to figure out why you're getting hundreds of errors and warnings that point to lines that don't have anything wrong with them. STEP 3: Definitely not "PROFIT".
"Outdated business models" is code for "I don't like paying for things, but want them anyway"
that is not a greek question mark, in the second example, it is another plain ascii colon.
; is a greek question mark.
if you're dumb enough to write code with an unicode editor, you deserve to be caught by these things.
fixed pitch font, seven bit ascii text, and NO microsod crlfs.
of a poor decision to ever allow unicode in source code files.
"substitutes common ASCII characters for obscure homoglyphs"
I believe the post reversed the logic here. It substitutes obscure homoglyphs for common ASCII characters. Otherwise we'd all have to be coding with obscure Greek question marks every day. Only then would substituting common ASCII for homoglyphs be a problem.