Show HN: XKCD-inspired StackSort
81–90 of 210 posts
Re: Show HN: XKCD-inspired StackSort
#82Earlier quoted context omitted.
Try this in Forth, or Factor. And be sure to read up on genetic programming. http://en.wikipedia.org/wiki/Genetic_programming
I will read more about GP for future attempts, thanks.
Re: Show HN: XKCD-inspired StackSort
#83Earlier 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.
No kidding... :-)
rm999 is correct; it was a joke about the halting problem. (The best kind of joke, obviously.) The broader point I was trying to make with the joke, though, is it's very hard to write code that will predict what another piece of code will do.
Re: Show HN: XKCD-inspired StackSort
#84Earlier 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
Re: Show HN: XKCD-inspired StackSort
#85Re: Show HN: XKCD-inspired StackSort
#86That'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
#87I also like this thought of an algorithm failing publicly and anybody being able to jump in and fix it.
I guess people have coded in Etherpad before, but still: how about implementing some program wiki-style, with editing rights for everyone?
Re: Show HN: XKCD-inspired StackSort
#88If 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 tried a basic version of that 1.5 weeks ago. At first it was generating random characters, then I tried some Markov chains trained on valid code. After running it overnight (it was attempting 40+ programs per second), the very best program looked something like this: package main; func main() { i := 0 // wae64309i Next step I wanna try is to use tokens of the language instead of series of random characters. Edit: H…
Though if you spend enough time your probably going to be reimplementing some type of http://en.wikipedia.org/wiki/Genetic_programming