Hacker News new | ask | show | jobs
by TeMPOraL 2458 days ago
My first chance ever to be that guy!

My solution:

  curl "https://unawaz.github.io/stochastic-hill-climbing/tasks/" \
    | awk '{ print length, $0 }' \
    | sort -n -s \
    | sed 's/<li>//' \
    | (tail -n +11 | head; tail)
Updated to remove noise.
2 comments

The problem with such a pipeline is that it’s not interactive. Now if you had a REPL that would memoize the steps so that it only ever did one `curl` request, that’d be different and useful.
First,

  curl [address] > /tmp/foo
Then, build up the pipeline starting with:

  cat /tmp/foo |
(And I know this is probably "useless abuse of cat", but whatever.)
Congrats on being that guy!