Live data from Hacker News

Show HN: Bo, the Swiss army knife of data examination and manipulation

github.com

21–22 of 22 posts

Re: Show HN: Bo, the Swiss army knife of data examination and manipulation

#21

Earlier quoted context omitted.

The HN crowd are my UX testers. Whatever people don't understand is easily fixed with a git push!

I'll attempt to possibly convert the grandparent comment into something more constructive. I'd note that your tool is probably the appropriate complexity level compared to utilities of the same sort (ie: sed, awk, dd, etc). But let's say we want to improve the UX of the tool for new users. As a strawman, you could offer longhand forms of the mode switching flags for them. For example: bo -n oh1l2 Pc if4b 1.5 1.25 ii2…

That's actually another part that fell between the cracks and I'm attempting to address... Aside from the -n, everything is parsed as a whitespace-delimited stream. They just happen to be passed as command line arguments, but they're really just stream data. So all the input, output, formatting, and data commands can be passed as one big string argument

    bo -n "oh1l2 Pc if4b 1.5 1.25 ii2b 1000 2000 3000 ih1 ff fe 7a ib1 10001011"
Or as multiple arguments (no point here, just that you can do it):

    bo -n "oh1l2 Pc if4b 1.5 1.25" "ii2b 1000 2000 3000" "ih1 ff fe 7a ib1 10001011"
Or as a file from disk:

    echo "oh1l2 Pc if4b 1.5 1.25 ii2b 1000 2000 3000 ih1 ff fe 7a ib1 10001011" >mycommands.txt
    bo -n -i mycommands.txt
Or as multiple files from disk:

    echo "oh1l2 Pc if4b 1.5 1.25 ii2b 1000 2000" >mycommands1.txt
    echo "3000 ih1 ff fe 7a ib1 10001011" >mycommands2.txt
    bo -n -i mycommands1.txt -i commands2.txt
Or as stdin:

    echo "oh1l2 Pc if4b 1.5 1.25 ii2b 1000 2000 3000 ih1 ff fe 7a ib1 10001011" | bo -n -i -
Or as a crazy mix of all of that:

    echo "if4b 1.5 1.25" >float-32s.txt
    echo "ii2b 1000 2000 3000" >int-16s.txt
    echo "ih1 ff fe 7a" >hex-bytes.txt
    echo "ib1 10001011" >binary-bytes.txt
    bo -n -i float-32s.txt -i int-16s.txt -i hex-bytes.txt -i binary-bytes.txt oh1l2 Pc
It's designed to fit in with the unix file and pipe paradigm, and also be composeable so that you can have saved data chunks to use in multiple cases, which by necessity makes it a bit opaque for someone approaching it for the first time, but also makes it incredibly powerful when mixed with other unix tools.

Re: Show HN: Bo, the Swiss army knife of data examination and manipulation

#22

Earlier quoted context omitted.

I'll attempt to possibly convert the grandparent comment into something more constructive. I'd note that your tool is probably the appropriate complexity level compared to utilities of the same sort (ie: sed, awk, dd, etc). But let's say we want to improve the UX of the tool for new users. As a strawman, you could offer longhand forms of the mode switching flags for them. For example: bo -n oh1l2 Pc if4b 1.5 1.25 ii2…

That's actually another part that fell between the cracks and I'm attempting to address... Aside from the -n, everything is parsed as a whitespace-delimited stream. They just happen to be passed as command line arguments, but they're really just stream data. So all the input, output, formatting, and data commands can be passed as one big string argument bo -n "oh1l2 Pc if4b 1.5 1.25 ii2b 1000 2000 3000 ih1 ff fe 7a i…

You might be interested in docopt (http://docopt.org/), which is a multi-language command line parser that removes almost all of the boiler plate. Whereas the versions of docopts for Python, etc. just require an import, the C version emits C code to do the parsing. It may be worth a look!
Post reply on HN