It seems that you're using an outdated browser. Some things may not work as they should (or don't work at all).
We suggest you upgrade newer and better browser like: Chrome, Firefox, Internet Explorer or Opera

×
Just playing around with system calls in Python and sometimes I get some interesting error messages. Note that these examples assume a POSIX-like system (like Linux or Mac OS; these examples might not work on Windows).

Also, while these examples are in Python, one can, of course, get similar results by writing C code that does the same thing; Python just has a nicer interface and is much nicer for doing experiments.

Example 1:

Python 3.5.2+ (default, Dec 13 2016, 14:16:35)
[GCC 6.2.1 20161124] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import os
>>> os.set_inheritable(0, False)
>>> os.execl('/bin/cat', 'cat')
cat: -: Bad file descriptor
cat: closing standard input: Bad file descriptor
Explanation: I just ran the "cat" program, but with stdin not present; hence, when "cat" tries to read from stdin (which it expects to exist and be open), it gets errors it's not expecting.

Example 2 (you will need to wait a second after the call to signal.alarm():

Python 3.5.2+ (default, Dec 13 2016, 14:16:35)
[GCC 6.2.1 20161124] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import signal
>>> signal.alarm(1)
0
>>> Alarm clock
"Alarm clock"? Isn't that a strange message to appear as an error message?

Well, what happened is that we arranged for a signal to be sent to the process, but we *did not* actually write a signal handler. By default (at least on Linux), the signal terminates the process with a strange-sounding error.
Post edited March 08, 2017 by dtgreene
Can you please keep these posts in a single thread about your programming questions\experiences?
Post edited March 08, 2017 by phaolo
avatar
phaolo: Can you please keep these posts in a single thread about your programming questions\experiences?
IMHO this is not how thread naming works. Labeling thread as "My programming experiences" would go straight off-topic and be useless. Imagine if everyone opens "own thread" and only communicates there..

I think dtgreene has done it perfectly ok, its always fun to read strange error messages/warnings since its related to game programming.


The one I know:

$ ar m God
ar: creating God
avatar
Lin545: IMHO this is not how thread naming works. Labeling thread as "My programming experiences" would go straight off-topic and be useless.
I wasn't suggesting a name, I just asked to create a single programming thread, instead of one for each question\error\thought\etc..
This isn't a programming forum, after all.
Well, it's a general discussion forum and seems to be full of topics and discussions of all sorts. I don't see why programming related topics specifically should be swept under the rug of a single topic.
avatar
clarry: Well, it's a general discussion forum and seems to be full of topics and discussions of all sorts. I don't see why programming related topics specifically should be swept under the rug of a single topic.
A single thread = "swept under the rug" now?
Anyway I asked, but if nobody agrees.. nevermind.
i haven't done any programming since november 2013 but once i had a small problem with first browser game i made in javascript. it was a Perspico game version 4x4 in which i used the least cost branch and bound algorithm so that the computer can play almost as a human. problem was that i used the name "in" for an index variable not knowing that it's reserved. i asked for help from students on facebook but of course nobody helped for shit. and after i figured it out, i said to a guy "thank you! may god help you as much as you helped me!" and he blocked me! hehe top kek! well that was fun... :P
https://en.wikipedia.org/wiki/Printer_on_fire
Here is a program in brainfuck that outputs itself as an error message

Parseing error: ] with no matching [
If you use this interpreter
http://www.iamcal.com/misc/bf_debug/

Of course different interpreters will give you a different error message. I believe there is a name for this kind of quines (where the program itself is printed not in the output but as an error), but I can't remember what it is.
Post edited March 08, 2017 by ZFR
avatar
phaolo: I wasn't suggesting a name, I just asked to create a single programming thread, instead of one for each question\error\thought\etc..
This isn't a programming forum, after all.
Not a huge fan of dtgreene most of the time either, but seriously, what has she done wrong here? This is perfectly fine. It's not like she posts it on a daily basis. It's an interesting find, at least. I don't get the "stay in your own place" idea... Are more discussion threads on a discussion board a bad thing?
avatar
phaolo: I wasn't suggesting a name, I just asked to create a single programming thread, instead of one for each question\error\thought\etc..
This isn't a programming forum, after all.
avatar
paladin181: Not a huge fan of dtgreene most of the time either, but seriously, what has she done wrong here? This is perfectly fine. It's not like she posts it on a daily basis. It's an interesting find, at least. I don't get the "stay in your own place" idea... Are more discussion threads on a discussion board a bad thing?
That, and we get tons of daily threads "haw haw haw i farted today" from Fortune_P_Dawg and the like. If anything, it's those that should be kept to a single thread. At least these programming ones are useful.
avatar
paladin181: Not a huge fan of dtgreene most of the time either, but seriously, what has she done wrong here? This is perfectly fine. It's not like she posts it on a daily basis. It's an interesting find, at least. I don't get the "stay in your own place" idea... Are more discussion threads on a discussion board a bad thing?
Not every critics is an attack O_o
I saw that she created various threads on limited programming topics, so I asked if she could keep them together.
I'd prefer less mess in the general thread, at least by the active users.
Anyway, as I said.. nevermind!
Post edited March 08, 2017 by phaolo
avatar
phaolo: Not everything must be an attack O_o
I saw that she created various threads on limited programming topics, so I asked if she could keep them together.
I'd prefer less mess in the general thread, at least by the active users.
Anyway, as I said.. nevermind!
Fair enough. It just seemed like you were telling her to go play in her corner. I'm not the only one who saw that. No hard feelings though. I'm not mad, I'm sure you're not (Well, I HOPE you're not). I'm not reprimanding you cause it's not my place. I think this place is still a little too hostile over all.
There are literally hundreds of forum threads that are not "on topic" on a multitude of other topics. (whatever "on topic" is supposed to mean, and who gets to decide that anyway?)

People who aren't interested in a particular forum topic should just silently skip over it, because popping in and telling someone to not post is not going to generate good positive results for any thread. If a topic is in violation of forum rules then it should arguably be reported to GOG's community manager, but if not then one should just skip over it peacefully and move on with their day really.
Found it! It's called Kimian Quine
[url=https://www.nyx.net/~gthompso/self_kim.txt]https://www.nyx.net/~gthompso/self_kim.txt[/url]


Here is a codegolf that contains someinteresting examples:
http://codegolf.stackexchange.com/questions/36260/make-an-error-quine