Live data from Hacker News

Stacksort – Searches StackOverflow for sorting functions and runs them (2013)

gkoberger.github.io

51–60 of 86 posts

Re: Stacksort – Searches StackOverflow for sorting functions and runs them (2013)

#51
post #7
post #4

Earlier quoted context omitted.

I can't speak to the worst case scenario as I'm not very knowledgeable about browser sandboxing or what JS can['t] do in a given context. But as a developer I do think there's a pretty significant difference between running code that someone wrote on their own website and loading arbitrary code from a third party then executing that without any human looking at the code.

That’s more or less what all iframed ads are. Plus most popular web sites load libraries for services where the site owners can’t easily see what’s happening under the covers. Google analytics would be an example of this, but there are many , and lots of sites use multiple such services.

Of note though, cross-domain iframes have intense restrictions on them to prevent them from XSS-ing the host page or its domain.

Of course, if you’re running 3rd party ad scripts on your actual page, you’re at their mercy.

Re: Stacksort – Searches StackOverflow for sorting functions and runs them (2013)

#52
post #29

this reminds me of the 4chan's sleepsort: for each number $n in the array, spin a thread that sleeps $n and then append $n to the result array.

Would the algorithmic runtime of this be O(N)?

No, the runtime complexity is just hidden in the scheduler of your OS

Re: Stacksort – Searches StackOverflow for sorting functions and runs them (2013)

#54
post #29

this reminds me of the 4chan's sleepsort: for each number $n in the array, spin a thread that sleeps $n and then append $n to the result array.

Would the algorithmic runtime of this be O(N)?

Technically yes... rather genius if you only care about cpu time and not real return time.

Re: Stacksort – Searches StackOverflow for sorting functions and runs them (2013)

#55
post #43

Earlier quoted context omitted.

This is unintentionally fucking hilarious. You already concede that review is a “maybe”... so we have to assume it won’t happen. So basically your argument boils down to web code meeting the high standards of being “written by someone” and put in “some form” of a production environment. Any http server on a routable ip address qualifies as “some form” of production environment.

You don't think there's the slightest bit of difference between production code written at even very dysfunctional organizations with mediocre developers, and random answers on StackOverflow? And you've only been here for a few weeks so I'll give you the benefit of the doubt, but calling something "unintentionally...hilarious" is usually taken as just another way of calling someone an idiot. I'd suggest you try to fi…

> You don't think there's the slightest bit of difference between production code written at even very dysfunctional organizations with mediocre developers, and random answers on StackOverflow?

I do; a random SO answer will be miles better than anything coming out of an average organisation.

To write an SO answer, you need to actually care about answering SO questions. To write code in an average company, you need to... have a pulse, it seems.

Re: Stacksort – Searches StackOverflow for sorting functions and runs them (2013)

#56
post #43

Earlier quoted context omitted.

This is unintentionally fucking hilarious. You already concede that review is a “maybe”... so we have to assume it won’t happen. So basically your argument boils down to web code meeting the high standards of being “written by someone” and put in “some form” of a production environment. Any http server on a routable ip address qualifies as “some form” of production environment.

You don't think there's the slightest bit of difference between production code written at even very dysfunctional organizations with mediocre developers, and random answers on StackOverflow? And you've only been here for a few weeks so I'll give you the benefit of the doubt, but calling something "unintentionally...hilarious" is usually taken as just another way of calling someone an idiot. I'd suggest you try to fi…

Well I speculated the that you were not going for hilarious. And I found it funny so that’s why I said unintentionally. And here’s why. Your general comment follows the classical salesman or marketing response to “why should I trust you?” And the expected response being oh well we have the finest, best trained developers from the best schools and everything is carefully reviewed, and we run everything on the best maintained equipment in a secure data center. Except what you said had those things with no minimum standard... basically demolishing your premise. I read it like a sales pitch and it made me chuckle. “Our code is written by someone, maybe reviewed, and runs on some form of production hardware.”

And the serious thing is... there is no minimum standard for the code that will run on your browser and anybody that works in this field really should understand that. Anybody that believes anything other than the web is a 100% untrustable shithole is liable the type to architect the next Equifax. And I felt your comment inadvertently just supported this opinion, so there’s that.

https://www.google.com/amp/s/www.networkworld.com/article/30...

Also yes I fully expect most code on stackoverflow to be of higher quality than most internal LOB code written (i’ve seen a lot of code at this point). If anything stackoverflow makes the mediocre shops better insofar as they copy from it.

Re: Stacksort – Searches StackOverflow for sorting functions and runs them (2013)

#59

Hey, creator here! I built this a few years ago on a whim, and am surprised how well it still works. Thanks for sharing again :) (Psst, if you're an engineer and like dev tools, I'm hiring! https://readme.io/careers )

do you hire remote?

Re: Stacksort – Searches StackOverflow for sorting functions and runs them (2013)

#60
post #29

this reminds me of the 4chan's sleepsort: for each number $n in the array, spin a thread that sleeps $n and then append $n to the result array.

Would the algorithmic runtime of this be O(N)?

Comparison-based sorts have O(1) complexity on the size of the elements being sorted. I.e., comparison between two numbers is a single instruction assuming numbers fit within a word. Even if you assume very very large numbers then comparison would be O(k), where k is number of bits needed to represent a number. So a more accurate runtime of O(nlogn) algorithms should be O(k.nlogn).

The runtime of this algorithm is O(n.2^k).

Post reply on HN