File this under #shell #functions I should have written years ago:
function grepc {
#Do a grep -c, but skipping files with no results
grep -c "$@" |grep -v ':0$'
}
File this under #shell #functions I should have written years ago:
function grepc {
#Do a grep -c, but skipping files with no results
grep -c "$@" |grep -v ':0$'
}
Oh, didn't know about -c. I usually just pipe to wc -l I guess.
-c, -l, -h, -H, and -q are my favorite #grep flags. :D
Huh, that almost became a [Marcel Duchamp] reference. 😅
I just use -v and -E
...and bash instead of zsh
...and grep/awk/sed instead of jq
...and firefox instead of chrome
...and the fediverse instead of facebook
Face it... I'm an unpopular-opinion neckbeard level boss. XD
cc: @mirabilos
@rl_dane Those are so not comparable!
@sotolf @thedoctor @rl_dane @mirabilos
Mm, not really though? ripgrep is meant for bulk grepping of files
@sotolf @thedoctor @rl_dane @mirabilos
I mostly just use it to run rg TODO and see all the spots in a codebase I marked as still needing work.
@amin @sotolf @thedoctor @mirabilos
Why is ripgrep better than just grep -R?
@kabel42 @amin @sotolf @thedoctor @mirabilos
Interesting! I wonder what kind of algorithmic optimizations (as opposed to compiler optimizations) they're using to do that, and if regular (GNU/BSD) grep could do the same.
Because I'll wear clown shoes and a tutu before changing to a "rewrite the world in rust!" utility 😂
@kabel42 @thedoctor @rl_dane @sotolf @amin ah, I think English distinguishes between "taking a shortcut" (sanctioned or not), a middle thing I get to below, and (dishonest) cheating.
The middle thing: for some reasons, they have this "time-honoured tradition of cheating" (e.g. in the Triwizard Tournament) which they sometimes see as heroic or at least obvious in the sense that everyone does it and nobody talks about it.
@kabel42 @rl_dane @amin @thedoctor @mirabilos Yeah, cheating as in Schummeln, not as in Betrügen.
I also saw now when looking the word up that it comes from german "juxen" which is "playing around, having fun" which is kind of a fun way that the word has been wandering :)
@sotolf @kabel42 @rl_dane @thedoctor @amin there’s meanings of to take a shortcut that aren’t related to cheating ;)
Consider a Venn diagram between both; they merely overlap, not subset.
@mirabilos @sotolf @kabel42 @thedoctor @amin
lol do give in, I'd love to see how you create it. xfig? teX? ASCII art?
@kabel42 @mirabilos @sotolf @thedoctor @amin
lol beat me to it.
@kabel42 @mirabilos @sotolf @thedoctor @amin
You can do plenty worse!!! ;)
@mirabilos @sotolf @kabel42 @thedoctor @amin
Sounds like me using GIMP 3.
Horrrrrid UI changes in GTK3. Horrid. Horrid.
@rl_dane @sotolf @kabel42 @thedoctor @amin that too, but Inkscape is just… Inkscape.
If I were a little better at SVG, I’d possibly use Inkscape’s XML window to write SVG as XML directly and just see it auto-updating the graphical representation, like some Tₑχ/LᴬTᴇΧ editors can.
@mirabilos @sotolf @kabel42 @thedoctor @amin
That would definitely be a nerd flex! ;)
@mirabilos @kabel42 @rl_dane @thedoctor @amin
Yeah, I mean if I would actually take this seriously for a moment, yeah cheating really depends on the goal, my goal for going to work is not excercise, so technically taking a shortcut is more about efficiency rather than doing something that lessens the thing, if I however did the walk to have excercise it would be, even though the physical action done was exactly the same, the only way to differenciate is the goal.
@kabel42 @mirabilos @rl_dane @thedoctor @amin
There are also different assumptions, I sped up an import job today, that dealt with barcodes, they get printed in batches, and I sped the runtime up from 2 hours + to 30 sek by checking the first item in each batch before splitting them up and having to deal with 40 000 + items, it's cheating / optimisation since I check only if the first one in the batch got imported, but because they do the writing within a transaction, if the first one of the batch is imported the rest are as well.
@kabel42 @mirabilos @rl_dane @thedoctor @amin
English (Traditional)
English (Simplified)
@kabel42 @mirabilos @rl_dane @thedoctor @amin
Yeah the fucker that decided that "ennui" is a good word should be taken behind the shed...
@sotolf @kabel42 @rl_dane @thedoctor @amin more like
@sotolf @kabel42 @mirabilos @thedoctor @amin
> English (Traditional)
> English (Simplified)
@kabel42 @mirabilos @sotolf @thedoctor @amin
If you rely on relativistic/Einsteinian accuracy, yes? ;)
#KSP cheats by not computing gravity between the various planets and moons. They're all on (invisible) rails. Only ships, crew, and asteroids are affected by actual gravity.
@sotolf @kabel42 @mirabilos @thedoctor @amin
Sometimes the cheats are a valid way to make a system more efficient ;)

Attached: 1 image @[email protected] HA :) Reminds me of something I saw today... #LossyPNG
@mirabilos @kabel42 @sotolf @thedoctor @amin
That game uses all kinds of crazy tricks to keep the various calculations away from floating point dead zones.
Folks have found tricks to force KSP to plot things with reduced precision, and the outcome is kind of hilarious. Things like very jagged plots and incredibly unpredictable trajectories. ;)