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?
See title
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...
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.
A gcc compiler usually gives you a very good idea about the location of a missing ;.
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".
I run into the "long dash" frequently enough when people copy-paste things from MS word or web pages. It looks like a "-" but is some other character. When used as input it also breaks my lazily written and optimistic regex parsers. Anyway, if I start seeing syntax errors in places that make absolutely no sense I would catch on fairly quickly as I generally drop into a hex editor to look for anomalies, but putting it all back would be anger inducing. I have enough problems writing code as-is, I don't need some jackass pulling everything out from under me, even as a joke. Retaliation would be quite easy to want to do but I'd probably bring it up to management for a public shaming. If it were something on github, I'd just leave the project.
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!
I am impervious, since I use classic IBM Codepage 437 (the one that all PCs start up with), and thus the munged characters appear on my terminal as such.
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.
maybe we should just stick to ASCII after all.
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?
Fastest way to get punched in the face.
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."
Do you want to be dead? Because that's how you get killed. - Archer
Like punctuations mark syntax errors don't cause enough trouble without some asshole pulling this.
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
Use a real editor and this a complete, total non-issue.
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.
just before hand in a student came in a panic. some of the links in her PDF were not resolving. the pdf was exported from word.
after much fecking about we realised that the links all had hyphens in them. during entry word was replacing the hyphen with a unicode character. even though straight afterwords it recognised the URL as a URL and created a link from it, it did not change the link.
a modern development environment would make this obvious.
its pretty funny seeing people lose their patience in other threads when its a no-brainer to expose and fix
I hate internationalisation. Which is hilarious because i just spelled that with an S instead of a Z. But it serves me well, because that greek semi colon is just gonna show up as an invalid character most likely in the font I am using.
...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.
VS and ReSharper. You will never goto fail like a fag.
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.
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
That would be great as a StackOverflow answer: you post correct code, ready to be copied 'n pasted by newbies. Get upvotes and everything from people understanding the posted code.
But every script kiddie that copies and pastes it, without even trying to understand it, gets the deserved punishment.
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...
I did this in computer lab with ANSI key remappings. I used ALT+255 () to replace space. Hilarity ensued when people would hit space in a command and get "Bad Command or Filename"
I've experienced problems such as this in real life on multiple occasions (normally triggered by poor software). What usually happens in practice is that, after about 20 minutes puzzling, you delete and retype the whole erroneous statement, and it works. So you go back and figure out, character by character, what was wrong with it. If the code still doesn't compile on other statements, you mentally shrug, distrust all similar instances of the same character in the current code, and do a global replace. Then you mentally file the issue away for future reference, and move on.
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
No, plain Perl code is not evil. But here's the perl port of mimic to be evil using Perl: https://metacpan.org/pod/mimic
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"
And have an plugin that changes the color of all non "ASCII" UTF-8 chars...
Seriously, somebody does this to my code, they're getting kicked in the balls. Hard. Then I'm going to fuck his wife too.
...has a minor mode for detecting these things, and has had for years.
Heh, I am immune to this hackery because I use python! ;
"I'm highly satisfied by the amount of butthurt I apparently caused you by simply asking for the source code to your malware" - by fisted (2295862) on Sunday October 25, 2015 @12:19PM (#50797625)
See subject: MalwareBytes' hpHosts Admin (MalwareBytes employee) hosts & recommends it -> http://hosts-file.net/?s=Downl... & MalwareBytes = BEST antivirus per this VERY recent testing of them all http://www.av-test.org/en/news...
&
It's safe proven by 57 antivirus programs recently in BOTH its 64-bit model https://www.virustotal.com/en/...
+
In its 32-bit model too https://www.virustotal.com/en/...
For "good measure" & to make a libelous LITTLE BLOWARD DO NOTHING WORM like you "eat his words" more? This too:
http://f.virscan.org/APKHostsF...
APK
P.S.=> R O T F L M A O - @ the risk of furthering fisted the BLOWHARD's "FoAmiNg-@-TeH-MouTh" impotent rage some more (trust me, the spittle will FLY from his piehole as you're all about to see, lol)?
Last time I requested this "the great genius" (not, lol) Fisted flew into a "RaGe" being made helpless as USUAL @ my SUPERIOR hands -> http://it.slashdot.org/comment... LMAO... apk
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.
"I'm highly satisfied by the amount of butthurt I apparently caused you by simply asking for the source code to your malware" - by fisted (2295862) on Sunday October 25, 2015 @12:19PM (#50797625)
See subject: MalwareBytes' hpHosts Admin (MalwareBytes employee) hosts & recommends it + verified the sourcecode as safe -> http://hosts-file.net/?s=Downl... & MalwareBytes = BEST antivirus per this VERY recent testing of them all http://www.av-test.org/en/news...
&
It's safe proven by 57 antivirus programs recently in BOTH its 64-bit model https://www.virustotal.com/en/...
+
In its 32-bit model too https://www.virustotal.com/en/...
For "good measure" & to make a libelous LITTLE BLOWARD DO NOTHING WORM like you "eat his words" more? This too:
http://f.virscan.org/APKHostsF...
APK
P.S.=> R O T F L M A O - @ the risk of furthering fisted the BLOWHARD's "FoAmiNg-@-TeH-MouTh" impotent rage some more (trust me, the spittle will FLY from his piehole as you're all about to see, lol)?
Last time I requested this "the great genius" (not, lol) Fisted flew into a "RaGe" being made helpless as USUAL @ my SUPERIOR hands -> http://it.slashdot.org/comment... LMAO... apk
Probably 2/3rds of the bugs at Google in production code are fixed within minutes via the 1-button "Rollback CL" function of the change system. This would solve the problem without hair loss.
"Are they trustworthy? No. Are they shit? Yes." - by fisted (2295862) on Tuesday October 20, 2015 @06:51PM (#50769409)
Even IF he came up with one that's what you'd do you disgusting little MORONIC limited little prick.
APK
P.S.=> After all, that's what you said about a number of antivirus company sources I used, so IF IT DOESN'T FIT FISTED'S LIMITED FRAMING OF THINGS, it's shit no matter what... apk
of a poor decision to ever allow unicode in source code files.
Depending on how many of these there are, couldn't one just write in an alias for the similar characters? That way you don't need to find ever single instance of the character, fix them all in one swoop.
If I actually hired a programmer who was smart enough to do this kind of thing, I'd have him promoted immediately.
"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.