3 ms·
My first chance ever to be that guy! My solution: curl "https://unawaz.github.io/stochastic-hill-climbing/tasks/" \ | awk '{ print length, $0 }' \ |
by TeMPOraL 7y 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.
- edm0nd 7y agoCongrats on being that guy!
- chrismorgan 7y agoThe 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.
- TeMPOraL 7y agoFirst, 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.)