Live data from Hacker News

Show HN: XKCD-inspired StackSort

gkoberger.github.com

71–80 of 210 posts

Re: Show HN: XKCD-inspired StackSort

#73
I can actually imagine a gist-like repo of algorithms which would be callable as Web services, each with its own URL. It would then be possible to run a search based on some predefined parameters, like in a unit test, and when an algorithm is found that performs accordingly it would be listed with stats how quick it ran.

Damn, if I only had the time to write this... |-(

Re: Show HN: XKCD-inspired StackSort

#74
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…

I've created a weekend hack that allows you to specify a minimal grammar and then generates text (which can be code) using it.

It's called Choice Words (https://github.com/fdb/choicewords) It can generate poems but also generative designs (see the README).

Re: Show HN: XKCD-inspired StackSort

#76
post #57

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...

Genetic programming; type that into google scholar and look at the late-80s and early-90s papers.

Thanks!, I used to play with GP back in the university. It's really fun!

However, GP is more like an oriented random search where the space of search is really big. Here the space is somehow filtered by humans, where each hypothesis had been generated by a human and not by a machine. It would be interesting if the machine could evolve those solutions that are not quite but close to be the proper one :)

Re: Show HN: XKCD-inspired StackSort

#77

Earlier quoted context omitted.

I attempt to block anything that does DOM manipulation, uses Backbone or underscore, uses "Date()" (since it's probably a benchmark and those are slow), and a few others.

Can you also write code to detect whether a program will run forever for a given input? ducks

I looked for a way, but turns out it's not possible with JS. Browsers will stop infinite loops after a few seconds, though.

EDIT: Ah, I missed the joke.. what I meant was that I looked for a way to stop the JS if it ran for more then a second.

Re: Show HN: XKCD-inspired StackSort

#78

Earlier quoted context omitted.

Can you also write code to detect whether a program will run forever for a given input? ducks

I looked for a way, but turns out it's not possible with JS. Browsers will stop infinite loops after a few seconds, though. EDIT: Ah, I missed the joke.. what I meant was that I looked for a way to stop the JS if it ran for more then a second.

I believe this is the joke: http://en.wikipedia.org/wiki/Halting_problem

>In computability theory, the halting problem ... is equivalent to the problem of deciding, given a program and an input, whether the program will eventually halt when run with that input, or will run forever. Alan Turing proved in 1936 that a general algorithm to solve the halting problem for all possible program-input pairs cannot exist.

Re: Show HN: XKCD-inspired StackSort

#79
That's awesome. Think about it, if we were able to extract the meaning (what it does and under which assumptions) of the algorithms on SO we could use them as an API. You declare "what you need" and which assumptions and you just made a call to an API to download the best, peer reviewed, code. Like something code as service.

Re: Show HN: XKCD-inspired StackSort

#80

Earlier quoted context omitted.

In theory, sure. However, I only use answers posted before the comic was released to avoid this very problem :)

Are you taking edits into account?

Doesn't seem like it.

Code:

  var common_url = '&pagesize=100&order=desc&site=stackoverflow&todate=1363473554';
SO /questions api:

  todate – Unix timestamp of the maximum creation date on a returned item
Post reply on HN