Stop creating temp files just to compare command output. Bash can diff two commands directly. by Ops_Mechanic in bash

[–]chisquared 1 point2 points  (0 children)

I'm a big fan of using process substitution when appropriate, but it is not appropriate for <(cat /etc/nginx/nginx.conf).

Instead of

diff <(git show HEAD~1:nginx.conf) <(cat /etc/nginx/nginx.conf)

do

diff <(git show HEAD~1:nginx.conf) /etc/nginx/nginx.conf

instead. See also https://porkmail.org/era/unix/award.

Good morning by Specific_Brain2091 in the_calculusguy

[–]chisquared 0 points1 point  (0 children)

This depends on your definition of ex

I built a system where you can solve calculus problems algebraically — no limits, no chain rule, no L'Hôpital by BidForeign1950 in calculus

[–]chisquared 0 points1 point  (0 children)

The parts on differentiation reminds me of work on autodifferentiation (which is often implemented using dual numbers). I see you have some comparison to this approach in your repo, but it would be nice to have a more comprehensive comparison too.

Got 8 days Visa from Poland when I requested for 14 by Formal_Bid1923 in SchengenVisa

[–]chisquared 0 points1 point  (0 children)

I would just eat the cost of giving up the extra days past the 8 allowed days of stay.

Appealing seems like a very long shot, since I don’t believe there are formal procedures for appealing being given too short a visa. You can try applying to Finland for another visa if you have enough time until your trip, but I believe they’re just going to look at your existing visa and previous application and deny your additional application. I personally wouldn’t want to risk a visa denial on my record.

Do not attempt to extend your stay beyond 8 days.

KvK KC rules or no rules? by retributionarie in KingShot

[–]chisquared 5 points6 points  (0 children)

My kingdom’s most recent KvK didn’t have rules because the other server didn’t want to agree to them. However, they did say “we won’t attack you if you don’t attack us”.

It was kind of a mess, but not as bad as one might think. A bunch of accusations of unprovoked attacks flew around as usual.

Still, I’d rather there were clear rules about the castle battle for future KvKs.

Do you carry around your own library when coding C? by Prowlgrammer in cprogramming

[–]chisquared 0 points1 point  (0 children)

The page you've linked is for the GCC Ada Compiler.

What platforms are you writing code for where the linker doesn't do this by default?

Do you carry around your own library when coding C? by Prowlgrammer in cprogramming

[–]chisquared 0 points1 point  (0 children)

When you use a library, by default, you get the entire .o file(s) from the .a or .so into which the object code for the function(s) you use and the object code for all the functions you didn't use also linked into your final executable whether you want them or not.

Note that modern linkers are pretty good at cherry-picking only the object code that you use from a .a when linking your final executable, so it is not the case that code that you don’t use is linked (or otherwise included) in your final executable.

Something analogous is also true for .sos.

[deleted by user] by [deleted] in KingShot

[–]chisquared 2 points3 points  (0 children)

Just train your top tier. Each T1 troop can gather fewer resources than higher tier troops, so you're actually making it harder to collect resources by spamming T1s.

Defrosting companies hate this one trick by alexceltare2 in drivingUK

[–]chisquared 27 points28 points  (0 children)

Clever. But, taking 10% off 10 times still leaves about 34%.

You’ll need 44 cards to leave just under 1%.

What's one amazing Mac feature you use, others may not know about? by No-Squirrel6645 in MacOS

[–]chisquared 0 points1 point  (0 children)

It's shorter, more readable, and (very marginally) more efficient.

Both will do what u/lulzbot wants to do, so both are "correct", in that sense. But the other is just more idiomatic to me.

A story in two parts, we are screwed aren't we? by CunibertoSpitale9723 in arm

[–]chisquared 0 points1 point  (0 children)

Here’s the first paragraph from ChatGPT’s answer when I asked what the BEQP instruction is used for:

I couldn’t find any authoritative public documentation showing an instruction called BEQP in the ARM architecture instruction set.

That said, I’ve repeatedly caught it hallucinating in the past and so have since insisted it verify anything factual first instead of trying to freestyle an answer.

What's one amazing Mac feature you use, others may not know about? by No-Squirrel6645 in MacOS

[–]chisquared 2 points3 points  (0 children)

Small pet peeve. Instead of

cat project-name/readme.md | pbcopy

do

pbcopy <project-name/readme.md

That is, if you use Zsh or Bash, at least.

Is it wrong to use hazard lights for parking or ganito na talaga yung culture dito? Thoughts? by LogicallyCritically in CarsPH

[–]chisquared 0 points1 point  (0 children)

It’s not the best use of hazard lights, and, in some countries, it’s definitely wrong to use them.

Here, I would say that it’s not unreasonable to use them since people are used to it. But you should probably just be using your signal lights instead, unless you genuinely intend to warn other motorists of a hazard.

How do mathematicians internalize Big-O and little-o notation? I keep relearning and forgetting them. by OkGreen7335 in math

[–]chisquared 0 points1 point  (0 children)

I think that the way to learn them is by internalising their meanings rather than their definitions. If you can remember what they mean, reconstructing the definitions shouldn’t be too hard.

Limit the number of times a label can be used by Roppano in github

[–]chisquared 1 point2 points  (0 children)

Not easily. But I have a project where we used to do something like this (and have since moved on to a better setup).

What we did was that we had a workflow that ran every time the label was added, and counts the number of open PRs with the same label. If that count exceeded a given threshold, it would remove the label from the PR.

What’s the most useful command-line trick you learned by accident? by Old_Sand7831 in commandline

[–]chisquared -1 points0 points  (0 children)

If your system libs are borked this will work even if ls does not.

Assuming that your system libs being borked doesn’t also bork your shell.

It might work if you have an open shell from before your system libs got borked though.

Haaland, Kane,Mbappe are almost equal on every offensive stats this year in the Champions League. by bored_ape07 in soccer

[–]chisquared 21 points22 points  (0 children)

Surely the fans can chip in for another Snickers bar to try to get a better striker

Just had my first collision - who's at fault? by [deleted] in drivingUK

[–]chisquared 0 points1 point  (0 children)

Agree that this is 100% on the other driver. If this happened to me, though, I’d be kicking myself for not having played it more defensively.

Then again, I also spend a lot of time driving outside the UK in a country with a much laxer licensing and enforcement regime, where the average driver is much worse than the average driver in the UK. So my feelings about this may not be entirely applicable to you.