Live data from Hacker News

Show HN: XKCD-inspired StackSort

gkoberger.github.com

151–160 of 210 posts

Re: Show HN: XKCD-inspired StackSort

#151
post #5

If you give it about 30 seconds it works eventually, this is beautiful. I had a good laugh. Edit: It makes me want to do something crazy like setup a tool chain that cobbles whole programs together with trial and error like this. Throw enough resources at it maybe it will be faster and cheaper than your avg. developer. It will be an unmaintainable mess as if you used Brainfuck or Perl. But it will run, by god, it wil…

> if you used Brainfuck or Perl TMTOWTDI, dammit.

"There's more than one way to do it", if anyone else was as puzzled as I was.

Re: Show HN: XKCD-inspired StackSort

#152
post #108

Earlier quoted context omitted.

The key last step is to have it automatically post questions to StackOverflow to fill in the last code snippets it can't complete.

I did this in my machine learning class. I started by simply coding up requirements for numerical functions (in the form of test cases), then set up a PHP script that would Google each function based on the keywords in my comments, and try to run any code on the resulting links (in a sandbox) against the requirements, seeing if it worked heuristically. Usually one of the top 5-10 pages of results results would have c…

I now really want to know what part of this story is true.

Re: Show HN: XKCD-inspired StackSort

#153
post #108

Earlier quoted context omitted.

The key last step is to have it automatically post questions to StackOverflow to fill in the last code snippets it can't complete.

I did this in my machine learning class. I started by simply coding up requirements for numerical functions (in the form of test cases), then set up a PHP script that would Google each function based on the keywords in my comments, and try to run any code on the resulting links (in a sandbox) against the requirements, seeing if it worked heuristically. Usually one of the top 5-10 pages of results results would have c…

I was still hoping this was real 5 lines in.

Re: Show HN: XKCD-inspired StackSort

#154
post #37

Earlier quoted context omitted.

This is called TDD.

Not really the same. TDD just give you the requirements for implementation. The intention of what I said is to given those requirements find a set of solutions. PG's idea is more ambitious, since is more like a set of plugins attached to the compiler so it could perform very high level optimizations (like finding an iterative solution given a recursive process)

I know. It was sort of a jab at TDD, implying that people following TDD only care about their tests. Oh well.

Re: Show HN: XKCD-inspired StackSort

#156

Wow.. beautiful! I know this is only for fun, but it can start something bigger. Basically, given an input and output we could search for an algorithm that works. It reminds me a talk that PG gave in which he states people making bots to optimize code and then an intelligent compiler could be done. It sounded very futuristic, but maybe it is not that futuristic after all...

you mean like this? https://news.ycombinator.com/item?id=5396535

Re: Show HN: XKCD-inspired StackSort

#157

For the numbers it eventually ends up here : http://stackoverflow.com/questions/14761032/infinite-recursi... but by and large this is a great hack. I worry however if someone meta-exploits this by creating a javascript XSS in a stack exchange answer waiting patiently ...

"The site will only fetch accepted answers, and it only uses answers that were posted before the xkcd was released (meaning that if someone posted malicious code now, it wouldn't matter)."

I think it might still be vulnerable to people editing one of those old answers though.

Re: Show HN: XKCD-inspired StackSort

#158
post #94

If a site like StackOverflow/Github had a more powerful search, better semantic data, etc. maybe people would be able to create things primarily by searching through it? In this example, one would type "sort array" and it would auto-find a function that sorts an array, but perhaps more advanced things can also be done? I guess it depends somewhat on how re-usable code really is, besides on the ability of a computer t…

On a more serious note, Hoogle[1] does something similar for the Haskell standard libraries: You give it a type signature (essentially a sort of specification of what the function should do) and it tells you if there are any functions that match it.

[1] http://www.haskell.org/hoogle/

Re: Show HN: XKCD-inspired StackSort

#159
post #124

Is this really an 'alt text' what the author of this page is referring to? Isn't 'alt text' a piece of text that shows when the image is unavailable?

Hover over an image with an alt-text attribute, and a tooltip with the alt-text pops up. All of the xkcd comics have alt-text, and it's a good practice in general, for accessibility software.

Actually, as other people mentioned, the real attribute that XKCD is using is "title":

    

Re: Show HN: XKCD-inspired StackSort

#160
post #53
post #33

Has anybody made a gallery of real implementations of Randall Munroe's hilarious ideas yet? I recall at least three exhibitions: this, M-x butterfly, and Hell Tetris; there are probably many others.

Also, geohashing I'm waiting for 1Password to implement 936. http://xkcd.com/936/ It's not that I don't trust 1Passwords generation algorithm, but when I'm on a borrowed PC (wife's laptop, inlaws desktop or even at work where I can't install 1P) this would help. It's much easier to open 1P on my iPhone, look up a password and type in "correct horse battery staple" than to constantly have to refer back to my phone.

Dropbox did implement this one in their password strength meter; try typing any of the passwords from the xkcd strip :).

See also:

https://tech.dropbox.com/2012/04/zxcvbn-realistic-password-s...

Post reply on HN