one of my favorite things about star trek is how people will routinely be in some first contact situation and get a computer built by some civilization they know literally nothing about to do stuff for them, whereas i, a 21st century computer professional, am basically incapacitated if i sit down at a computer running the same operating system i use but configured slightly differently or try to use a telephone manufactured by a different company than the one i'm used to.
@earthtopus a fair counterpoint, but it is kind of a setup for the bit where scotty then does some sort of CAD wizard shit and lays out a major advance in materials science from memory on the spot
@brennen an unrelated question: say I have a big text file and I want to find the line(s) with the most instances of a substring on it. Say the most instances of the letter R.
What's a good (and by good I mean lazy) way to do that?
@earthtopus i feel like some common utility does this but i wrote a stupid perl script:
...now to figure out how you'd actually best get it...
@earthtopus ok, so i'm too fried right now for man pages and stackoverflow searches, but this is what i wound up adding to my personal utility collection in case i want to do this again:
you could save that and run it like:
perl ./matches-per-line "R" file.txt | sort -n | tail -1
and it should give you the line with the most R. leave off the tail in case there might be lines with the same number of occurrences of the substring.
@earthtopus it's a properly lazy script because it doesn't bother trying to be smart about what's the most of anything, you can just outsource that to "sort -n" if you need it, it doesn't have to worry about keeping track of a max value, and this way you could use it for plotting frequencies or whatever.
@brennen I'm using match-substrings which does almost precisely what I want but gives me a yak to shave, thank you for providing a yak customization service for me and I hope things are way less dire in your parts than might be feared!
@earthtopus bespoke-yaks-r-us, at your service.
and thanks - things are in decent shape right now, just hoping they stay that way.
A community centered on the Twin Cities of Minneapolis and St. Paul, Minnesota, and their surrounding region. Predominantly queer with a focus on urban and social justice issues.