Lurker News

Comments (198) 66 threads

Earlier comments
JosephRedfern#
'test.js':

   Hahahahahahahaha

   Oh.. you were serious.

   Well, the fact that you're reading this means GitHub hasn't taken the repo down yet... so I guess things are still going pretty well?
BHSPitMonkey2 replies#
"The site will only fetch accepted answers, and it only uses answers that were posted before the xkcd was released (meaning that if someone posted malicious code now, it wouldn't matter)."
fnordfnordfnord#
That was right neighborly of him.
ufo1 reply#
I think it might still be vulnerable to people editing one of those old answers though.
BHSPitMonkey#
This is true. It doesn't look like the code digs down into an answer's revision history or anything like that.
tlrobinson1 reply#
Would they even be able to do much damage? The site is hosted on a subdomain of Github, so I presume they wouldn't be able to do much. Right?

I mean I hope sites hosted on *.github.com can't compromise my Github account...

apendleton#
At a very basic level, it could redirect you to some other page hosting a browser exploit and drive-by-install malware. Certainly seems like there are enough Java exploits laying around for that to be a problem.

But no, I don't think it has access to anything privileged.

arikrak2 replies#
If a site like StackOverflow/Github had a more powerful search, better semantic data, etc. maybe people would be able to create things primarily by searching through it?

In this example, one would type "sort array" and it would auto-find a function that sorts an array, but perhaps more advanced things can also be done? I guess it depends somewhat on how re-usable code really is, besides on the ability of a computer to find the right code.
At the very least, there should be better search/help when one is coding. SO's current search isn't good at returning the best results.

ardrabczyk#
Yeah, I thought about the same. The Internet is just the enormous knowledge base. And the Internet is not only WWW, it's also IRC, Usenet, FTP servers, TOR, all kinds of darknets. It's worth more than any printed encyclopedia or dictionary. Yet, there is still no a good way to find a particular information fast, especially for non-IT people. Therefore, every initiative to make simpler is worth attention.
ufo#
On a more serious note, Hoogle[1] does something similar for the Haskell standard libraries: You give it a type signature (essentially a sort of specification of what the function should do) and it tells you if there are any functions that match it.

[1] http://www.haskell.org/hoogle/

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.)

Load more comments