This was inspired by the alt-text from last week's "Ineffective Sorts" xkcd (http://xkcd.com/1185/).
It tries to sort a list or JSON by fetching code from StackOverflow until it properly sorts the input.
It tries to sort a list or JSON by fetching code from StackOverflow until it properly sorts the input.
For those of you who want to jump straight to the meat of it, go here: https://github.com/gkoberger/stacksort/blob/master/js/script...
Search down for "run_snippet_go"
GitHub even adds the anchor for you if you click on the line number in the gutter. (shift-click to select a range of lines.)
1) I thought it would defeat the purpose
2) "Sort" is very arbitrary. Do you want to sort by key or value? Is "1000" bigger or smaller than "2"? etc