R
This is technically not an error but a warning but nevertheless it's ridiculous, and occurs for completely esoteric reasons.
[[EDIT]] It seems that the cause of some parts of the funny warnings resides in RStudio rather than R per se, so it's less interesting than I first thought. The first example i.e plot(1:2, NotAGraphicalParameter = "ignore.me")
is, however, still reproducible in "naked" R and is funny enough on its own right.[[/EDIT]]
> plot(1:2, NotAGraphicalParameter = "ignore.me")
# produces a nice scatterplot with two points, [1,1] and [2,2]
Warning messages:
1: In plot.window(...) :
"NotAGraphicalParameter" is not a graphical parameter
2: In plot.xy(xy, type, ...) :
"NotAGraphicalParameter" is not a graphical parameter
3: In axis(side = side, at = at, labels = labels, ...) :
"NotAGraphicalParameter" is not a graphical parameter
4: In axis(side = side, at = at, labels = labels, ...) :
"NotAGraphicalParameter" is not a graphical parameter
5: In box(...) : "NotAGraphicalParameter" is not a graphical parameter
6: In title(...) : "NotAGraphicalParameter" is not a graphical parameter
> plot(2:3)
# another nice scatterplot: [2,2] and [3,3]
# but there should be nothing wrong this time!
# however ...
There were 12 warnings (use warnings() to see them)
> warnings()
Warning messages:
1: "NotAGraphicalParameter" is not a graphical parameter
2: "NotAGraphicalParameter" is not a graphical parameter
3: "NotAGraphicalParameter" is not a graphical parameter
4: "NotAGraphicalParameter" is not a graphical parameter
5: "NotAGraphicalParameter" is not a graphical parameter
6: "NotAGraphicalParameter" is not a graphical parameter
7: "NotAGraphicalParameter" is not a graphical parameter
8: "NotAGraphicalParameter" is not a graphical parameter
9: "NotAGraphicalParameter" is not a graphical parameter
10: "NotAGraphicalParameter" is not a graphical parameter
11: "NotAGraphicalParameter" is not a graphical parameter
12: "NotAGraphicalParameter" is not a graphical parameter
# but let's try once more:
> plot(2:3)
# yup. no warnings this time. we had to do it twice
It's like R remembers our insults. But not for long.
I can't really explain why this happens - but it is reproducible. Actually it occurs every time when you supply some "not a graphical parameter" to plot 1, and then do a plot 2 in a completely impeccable way. It is especially funny that we get 12 "not a graphical parameter" warnings for the second plot but only 6 for the first one. Another funny thing is that if you supply "not a graphical parameter" with a value NULL then no condition is thrown:
plot(1:2, Nonsense=NULL)
# no warnings
# however
plot(1:2, Nonsense="gibberish")
# gives the usual 6-pack of warnings
And to get even more ridiculous, let's draw some lines on top of the previously drawn plot:
plot(1:2)
# you will see the number of warnings growing with each line:
lines(1:2, 1:2, mumbo = 1)
lines(1:2, 1:2, jumbo = 2)
lines(1:2, 1:2, bimbo = 3)
lines(1:2, 1:2, cucaracha = 4)
lines(1:2, 1:2, karaoke = 5)
lines(1:2, 1:2, radiogaga = 6)
lines(1:2, 1:2, reptiles = 7)
lines(1:2, 1:2, cowsonmoon = 8)
lines(1:2, 1:2, stainlessSteelLadderToTheMoon = 9)
lines(1:2, 1:2, frambuesa = 10)
lines(1:2, 1:2, fresa = 11)
lines(1:2, 1:2, limonYNada = 12)
lines(1:2, 1:2, slingsAndArrows = 13)
# ... and now you have 25 warnings:
warnings()
Warning messages:
1: "mumbo" is not a graphical parameter
2: "jumbo" is not a graphical parameter
3: "bimbo" is not a graphical parameter
4: "cucaracha" is not a graphical parameter
5: "karaoke" is not a graphical parameter
6: "radiogaga" is not a graphical parameter
7: "reptiles" is not a graphical parameter
8: "cowsonmoon" is not a graphical parameter
9: "stainlessSteelLadderToTheMoon" is not a graphical parameter
10: "frambuesa" is not a graphical parameter
11: "fresa" is not a graphical parameter
12: "limonYNada" is not a graphical parameter
13: "mumbo" is not a graphical parameter
14: "jumbo" is not a graphical parameter
15: "bimbo" is not a graphical parameter
16: "cucaracha" is not a graphical parameter
17: "karaoke" is not a graphical parameter
18: "radiogaga" is not a graphical parameter
19: "reptiles" is not a graphical parameter
20: "cowsonmoon" is not a graphical parameter
21: "stainlessSteelLadderToTheMoon" is not a graphical parameter
22: "frambuesa" is not a graphical parameter
23: "fresa" is not a graphical parameter
24: "limonYNada" is not a graphical parameter
25: In plot.xy(xy.coords(x, y), type = type, ...) :
"slingsAndArrows" is not a graphical parameter
This should not win big time unless there is no justice.
2Making Python segfault is easy:
import sys; sys.setrecursionlimit(~-2**31); x=lambda x:x(x); x(x);
– marinus – 2012-08-04T01:53:07.840Peter: whoops. I repurposed the question half way through writing it :S – Wug – 2012-08-05T23:48:19.073
...what about malbolge or INTERCAL? i'm pretty sure they'd have some pretty insane errors, probably can do it with a single char as well. – acolyte – 2012-08-06T21:26:32.977
1
This is definitely the best link to go for the solution: https://www.destroyallsoftware.com/talks/wat :-)
– seri – 2012-08-13T17:50:14.910I've seen that one. :D – Wug – 2012-08-13T18:04:40.430
1
Possible duplicate of http://stackoverflow.com/q/1146014/736054.
– Konrad Borowski – 2014-01-06T12:29:32.637There's a whole book on these for Java: http://www.javapuzzlers.com/
– ntoskrnl – 2014-01-09T16:52:06.760Also see http://codegolf.stackexchange.com/q/1956/7416
– aditsu quit because SE is EVIL – 2014-01-10T00:01:46.873Damn, I have so many of them but I don't remember how to produce them... I've found a way to make EDT consistently generate a runtime exception during compilation, and I've got me some SQL where a comparison generates an overflow error but I never write down exactly how to get those :p – Tal – 2014-06-06T09:22:59.230