Lurker News

Comments (198) 66 threads

Show all comments

Showing thread 8 of 66

gjulianm2 replies#
Noticed that there was a lot of "Potentially bad code" answers. I read you are avoiding scripts with "cookie" or written after the comic was written, but are there other restrictions? For example, this was banned: http://stackoverflow.com/questions/14800987/javascript-sorti...

Just curious about it.

ajanuary#
I'm guessing there are attempts to blacklist DOM manipulation.
gkoberger2 replies#
I attempt to block anything that does DOM manipulation, uses Backbone or underscore, uses "Date()" (since it's probably a benchmark and those are slow), and a few others.
asveikau3 replies#
Can you also write code to detect whether a program will run forever for a given input? ducks
gkoberger3 replies#
I looked for a way, but turns out it's not possible with JS. Browsers will stop infinite loops after a few seconds, though.

EDIT: Ah, I missed the joke.. what I meant was that I looked for a way to stop the JS if it ran for more then a second.

Continue this thread — 3 replies

rozap#
Pray, gkoberger, if you put into the machine wrong figures, will the right answers come out?
nixhope#
if (eval(code_sample)) {return true;} else { return false;}

// Running time: O(1), for values of 1 approaching infinity

abecedarius#
Isn't Caja supposed to deal with this family of issues? Could you just use that? (Well, last I looked it needed a program on the server to preprocess the foreign JS code.)