The Lucene search library has something like this. Data is stored /retrieved via codecs. Most write binary data, but one codec actually writes out all data as text. It is, of course, too slow for production use, but it is great for figuring out what is going on under the covers.
This is a really neat idea! I wonder how close you could get the prose to actually explaining the codes purpose as opposed to just saying "this is a for loop"?
The purpose (intent) wouldn’t be explained, but it could be useful for tools which have oddball syntax and are only used sometimes (infrequent enough for you to forget).
This is neat. Though when I ran a fairly simple ffmpeg command through here to try and make sense of it, it was only semi-useful. (Not a knock against this service, but just a testament to the complexity of ffmpeg lol)
> (Not a knock against this service, but just a testament to the complexity of ffmpeg lol)
I found a modified a ffmpeg shell script no later than yesterday that finds all my movies files and generates one jpeg with 16 "tiles" thumbnails for each movie to try to make sense of the countless family "MOV40931.MOV" and whatnots and I've got to say: I agree with you.
My big moment of solitude was when I started to work on parallelizing my shell script only to realize that, of course, ffmpeg already makes good use of all the cores so there's no point in parallelizing the shell script.
> I found a modified a ffmpeg shell script no later than yesterday that finds all my movies files and generates one jpeg with 16 "tiles" thumbnails for each movie
I wrote a script called dovid I left on Pastebin that creates contact sheets (what you are describing) for every video file of any popular format in the directory executed and then combines them into a webpage or pdf. But it isn't an exceptional script because it just utilizes vcs[1] and convert (ImageMagick). At some point, I stopped using the script and just aliased this command (arbitrarily as 'peak') in my ~/.bash_profile
alias peak='for i in *.mkv *.mpg *.wmv *.avi *.mov *.m4v *.mp4; do echo "$i"; /opt/local/bin/vcs -q -q -j -dt -ds -dp -u "0" -n 16 -c 4 -H 162 "$i"; done; echo ".......... converting jpgs to a pdf"; /opt/local/bin/convert *.jpg index.pdf; /bin/rm *.jpg'
Creates a pdf of contact sheets 4x4@162dpi, much neater than a directory filled with as many jpegs as videos. Obviously, this is dangerous and destructive if there are other jpeg files in that directory.
The service is pretty neat. It's probably parsing the man pages somehow to create this. I wonder if it would be possible to utilize this parsed information to create type checking tools for shell scripts... Something which checks if correct count of arguments is given for command etc.
You can see how the parsing works in the source code (with a specific high level explanation of how this part works), as the site is an open source project.
I wrote a Linux CLI tool [0] that parses the man/help pages to extract option details. Works most of the time for me, but there are plenty of corner cases that don't work.
* https://news.ycombinator.com/item?id=24525999 63 points, Sept 2020, 12 comments
* https://news.ycombinator.com/item?id=19124480 329 points, Feb 2019, 52 comments
* https://news.ycombinator.com/item?id=6834791 1372 points, Dec 2013, 171 comments
* https://news.ycombinator.com/item?id=6296634 275 points, Aug 2013, 82 comments