Lurker News

Comments (198) 66 threads

Earlier comments
checksum1 reply#
So if I make a post on stackoverflow with the tags "javascript" and "sort", and put some dirty JS in there, could it take down people's browsers?
gkoberger1 reply#
In theory, sure. However, I only use answers posted before the comic was released to avoid this very problem :)
mrgoldenbrown1 reply#
Are you taking edits into account?
kevjiang#
Doesn't seem like it.

Code:

  var common_url = '&pagesize=100&order=desc&site=stackoverflow&todate=1363473554';
SO /questions api:

  todate – Unix timestamp of the maximum creation date on a returned item
xfreax#
I saw that this thing fetches a Javascript code and runs in my machine and am very dubious about its "script" action.
mortan#
This is absolutely genius, made my day! :D
anonymous1 reply#
Those two don't work in the general case.

The first only leaves the unique members of the list, so you get a sorted set. The second sorts lexicographically, because javascript's .sort() method on arrays sorts lexicographically. This means that if you have a list of numbers like [1, 2, 10], it will get sorted as [1, 10, 2]. Unless you pass your own comparator in.
What this page really demonstrates is that there is precisely one answer on stackoverflow containing a complete generic sort function in javascript (quicksort in fact).

thedufer#
Sorry; I should have specified that I only used the example input.
gkoberger1 reply#
Well, yeah... it's an algorithm. Hit "keep trying" (big yellow button) to find more results.

Or, fork it and play with the StackOverflow queries.

fwenzel#
Yeah sounds like shuffling the result set before running might add a bit more spice to this.

Load more comments