I tried to open an non existent page on stackoverflow and received "Page Not Found" warning however didn't understand what the code next means.
Do you know what SO try to tell?
1 Answer
This is polyglot code : it works in several languages. This one is valid in in C, Python, Perl, Ruby, Befunge-93, and Brainf*ck.
In Python/Perl/Ruby the only code that gets executed is print(202*2);exit();
.
This means it shows 404 then exists the page.
The rest is commented code because of the '#'.
In C, the code executed code is:
main(){putchar(4+putchar(putchar(52)-4));return 0;};exit();
Brainf*ck is an esoteric programming language which only read 8 symbols : [ ] < > + - . ,
so the code read is :
+->
++++++++
[>++++++<-]
>++++.
----.
++++.
>.
I didn't come up with this on myself, but had the same curiosity some time ago and found this answer https://meta.stackoverflow.com/a/252187/2047249 on meta stackoverflow.
That answer explains it better than I ever could.