Back to front pageView on Hacker News (opens in a new tab)Show HN: XKCD-inspired StackSort (opens in a new tab)gkoberger.github.com948 pointsby gkoberger (on Hacker News)13 years agoComments (198) 66 threadsShow all commentsShowing thread 3 of 66[-]gkoberger13 years ago2 replies#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.[-]fwenzel13 years ago2 replies#Do you test the result, or just hope if it runs, it actually worked?jstanley13 years ago#I found one that returned the wrong result, so it seems to just assume it works as long as it runs.[-]gkoberger13 years ago1 reply#It doesn't test for two reasons:1) I thought it would defeat the purpose2) "Sort" is very arbitrary. Do you want to sort by key or value? Is "1000" bigger or smaller than "2"? etcfwenzel13 years ago1 reply#Fair; also, it's called an 'ineffective' sort, and if you tested it, it'd become effective (not efficient, of course). So, good point!Continue this thread — 1 reply[-]crusso13 years ago1 reply#Nicely done. I enjoyed looking at the code.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"unfletch13 years ago#FYI, you can link to a specific line on GitHub by appending #L to the URL. In this case: https://github.com/gkoberger/stacksort/blob/master/js/script...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.)
Show HN: XKCD-inspired StackSort (opens in a new tab)gkoberger.github.com948 pointsby gkoberger (on Hacker News)13 years ago
gkoberger13 years ago2 replies#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.
jstanley13 years ago#I found one that returned the wrong result, so it seems to just assume it works as long as it runs.
gkoberger13 years ago1 reply#It doesn't test for two reasons:1) I thought it would defeat the purpose2) "Sort" is very arbitrary. Do you want to sort by key or value? Is "1000" bigger or smaller than "2"? etc
fwenzel13 years ago1 reply#Fair; also, it's called an 'ineffective' sort, and if you tested it, it'd become effective (not efficient, of course). So, good point!
crusso13 years ago1 reply#Nicely done. I enjoyed looking at the code.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"
unfletch13 years ago#FYI, you can link to a specific line on GitHub by appending #L to the URL. In this case: https://github.com/gkoberger/stacksort/blob/master/js/script...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.)
Comments (198) 66 threads
Show all comments
Showing thread 3 of 66
It tries to sort a list or JSON by fetching code from StackOverflow until it properly sorts the input.
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
Continue this thread — 1 reply
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.)