[PARAGRAPH TRUNCATED]
fun fact: when people didn't talk to me about what i write in cs300 last semester, i like to count the number of words across all my answers to get some personal satisfaction. this post i wrote for example sits comfortably at top ten:
# of course, when i am showing you this list, i
# am sort of intending you to, uh... read them.
# i am... actually quite proud of writing them.
$ for f in $(find [0-9]* -type f -name '[0-9]*.md' -o -name '[0-9]*.txt'); do printf '%s %s\n' $(wc -w $f | awk '{print $1}') $f; done | sort -rnk 1 | head -10 | column -t | cat -n | sed 2d\;6d\;9d
1 802 832/1740375987.md
3 601 815/f1/1740302309.md
4 601 702/1739958294.md
5 590 798/f1/1740296751.md
7 504 785/f1/1740275075.md
8 488 745/f1/1740086814.md
10 431 724/1740040221.md
(I did the same thing with byte count and @724 still came in 10th place, which is... something. (actually, this is completely wrong, since i was not accounting for multiple revisions. so it counted @832 twice, or otherwise this post would have been in the 9th place. but ugh... i don't care enough to correct that. (read: i can't think of a way to do that in a one-liner)))
and oh yeah, this was totally going to be just a show-off (sorry, i am a bit egotistical when it comes to stuff i am good at X) that's what the ability to stay anonymous does to you i guess lol) but i'm still gonna show the statistics and central tendency to satisfy my obsessive mathy mind:
$ count () { for f in $(find [0-9]* -type f -name [0-9]*.md -o -name [0-9]*.txt); do wc -w $f | awk \{print\$1\}; done }
$ count | python3 -c 'import sys; from statistics import median, mean, stdev; d=list(map(int, sys.stdin)); print(len(d),median(d),mean(d),round(stdev(d),2),sep=",")'
40,212.0,265.05,208.04
$ alias histw='count | perl -e '"'"'chomp(@d=<STDIN>); $N=shift; while (@d=grep{$i<=$_}@d) { printf "%3d %s\n", $i, "=" x grep{$_<$i+$N}@d; } continue { $i+=$N }'"'"
$ histw 120
0 =============
120 ========
240 ========
360 ===
480 ====
600 ===
720 =
so my posts are clearly right-skewed... though not as right-skewed as it was for cs300..... sorry i got too carried away writing this. thanks for the compliment anyways! ^^
(still, if you allow me to be self-indulgent for one last moment, my
favorite answer i've written here has to be the pipeline in @785_f1 (that is the 7th longest post of
mine)---it certainly is nasty that i have to read the whole buffer
twice, but as a one-liner i can't complain... i had tons of fun
assembling that pipeline (i sort of cheated with the zlib decoding
because Python's is very much a batteries-included language but we don't
talk about that XD), and to see it actually work is an amazing feeling
you can't get from reading other people's code. :) (not by reading the
cs400 script at least (cough cough git... cough
pull... cough why.......))