Is it just me, or do none of them sort this array correctly? ["zebra","apple","banana","5","bapple","banana","banana"] Correction, the page finally found this algorithm that sorts my array[1]. So I am disappointed with the verifier function on this web page and may need to submit a PR 1 - http://stackoverflow.com/questions/3730510/#3730579
the website doesn't verify the accuracy of sort output. it just gives you the first SO answer that a) has a code snippet b) which is error-free c) and has a function that can be extracted and run ...for your input format, and returns the output of passing your input code into it. It's true to the xkcd mission, which is just to find SO answers until it returns something, not to actually confirm it was sorted correctly…
Stacksort – Searches StackOverflow for sorting functions and runs them (2013)
21–30 of 86 posts
Re: Stacksort – Searches StackOverflow for sorting functions and runs them (2013)
#22Well done
Re: Stacksort – Searches StackOverflow for sorting functions and runs them (2013)
#23Highlights:
- GenghisKhanSort: delete all elements except for the first, repopulate the list with successors of the first element - HitlerSort: Choose an element in the list you think is the best, then loop through the list removing any element that does not match. - ThanosSort: delete half the array. The arrays may or not be sorted, but it'll help for future sorting - TrumpSort O(0): the array is always sorted. Anyone who says otherwise is fake news.
Re: Stacksort – Searches StackOverflow for sorting functions and runs them (2013)
#24Is it just me, or do none of them sort this array correctly? ["zebra","apple","banana","5","bapple","banana","banana"] Correction, the page finally found this algorithm that sorts my array[1]. So I am disappointed with the verifier function on this web page and may need to submit a PR 1 - http://stackoverflow.com/questions/3730510/#3730579
Re: Stacksort – Searches StackOverflow for sorting functions and runs them (2013)
#25Re: Stacksort – Searches StackOverflow for sorting functions and runs them (2013)
#26Hilariously awesome. I'm curious whether the multiple warnings about running untrusted code in the browser are necessary. I feel like all websites are already untrusted code, and the browser is quite well sandboxed and protected from anything too bad happening. What is the worst case scenario here for the user within the JS ecosystem, under known avenues of attack, not counting an unknown zero day browser exploit?
The way you would do this is create an answer to one of these questions on stack overflow that includes malicious javascript.
However, it's kind of unlikely there is much you can do with it. Sometimes a site will share cookies with subdomains, but this is not likely for github because you are allowed to publish arbitrary js there, so that would be a huge security hole.
Re: Stacksort – Searches StackOverflow for sorting functions and runs them (2013)
#27Hilariously awesome. I'm curious whether the multiple warnings about running untrusted code in the browser are necessary. I feel like all websites are already untrusted code, and the browser is quite well sandboxed and protected from anything too bad happening. What is the worst case scenario here for the user within the JS ecosystem, under known avenues of attack, not counting an unknown zero day browser exploit?
Re: Stacksort – Searches StackOverflow for sorting functions and runs them (2013)
#28Hilariously awesome. I'm curious whether the multiple warnings about running untrusted code in the browser are necessary. I feel like all websites are already untrusted code, and the browser is quite well sandboxed and protected from anything too bad happening. What is the worst case scenario here for the user within the JS ecosystem, under known avenues of attack, not counting an unknown zero day browser exploit?
The standard attack in this case is that someone could steal your cookies (if they are Js cookies) or execute instructions on gkoberger.github.io without your permission, since that is the context. The way you would do this is create an answer to one of these questions on stack overflow that includes malicious javascript. However, it's kind of unlikely there is much you can do with it. Sometimes a site will share coo…
Re: Stacksort – Searches StackOverflow for sorting functions and runs them (2013)
#29Re: Stacksort – Searches StackOverflow for sorting functions and runs them (2013)
#30It only checks that the output is sorted, not that it's a sorted version of the original string. The first answer that apparently works has a comment stating that it fails with more than 2 duplicates; indeed I tried a list with three 3s and the resulting passing answer only had one of those threes.