programming.dev

DiabloD3, to programmer_humor in Release notes of an open source app. Someone is pretty mad at Canonical for Snap

Good on them. Snap is a plague.

pkill,

Why are they even still pushing that nonsense when flatpak at least somewhat gets closer to getting bwrap implemented right?

hunger,
@hunger@programming.dev avatar

To be fair: snaps can work for all kinds of things all over the stack from the kernel to individual applications, while flatpak just does applications. Canonical is building a lot around those abilities to handle lower level things, so I guess it makes sense for them.

IMHO flatpak does the applications better and more reliably and those are what I personally care for, so I personally stay away from snaps.

pkill,

Fair point. For instance one thing that sucks about flatpaks is that you can’t torsocks them

Dirk,
@Dirk@lemmy.ml avatar

Why are they even still pushing that nonsense

It’s a for-profit corporation. They only have one goal.

aes, to programmer_humor in Manager: This task only takes 30 minutes. Why did it take you the whole day?

Psst,

git add -p

dukk, (edited )

Better yet, git commit -p

sip,

uuuuuuuu. and you could do -m to describe the commit.

next they’ll add --push/-P.

perhaps add -r for fetch/rebase then commit.

one command to rule them all! 😈

Johanno,

What does this?

foxymulder,
@foxymulder@lemmy.ml avatar

“patch mode” - Patch mode allows you to stage parts of a changed file, instead of the entire file. This allows you to make concise, well-crafted commits that make for an easier to read history.

AnarchistArtificer,

Yay, learning!

pomodoro_longbreak,
@pomodoro_longbreak@sh.itjust.works avatar

Highly recommend throwing –patch on any git commands you’re used to using. You will have the prettiest, most atomic fkn commit, I’m serious people will love you for it.

I mean many people won’t care, but the quality folk will notice and approve.

Johanno,

We make a singular commit per feature.

KairuByte,
@KairuByte@lemmy.dbzer0.com avatar

I always find this hard to follow personally.

pomodoro_longbreak,
@pomodoro_longbreak@sh.itjust.works avatar

Trunk based, eh? Yeah, we do that on a couple teams where I’m at, too. I like the philosophy, but force pushing the same commit over and over as you’re incorporating review feedback is antisocial, especially when you’ve got devs trying to test your changes out on their machines.

Omgpwnies,

eh, just squash and merge. Feature branch can be messy as long as main is clean

Johanno,

Yep. You have to make sure your feature branch works.

oce, (edited )
@oce@jlai.lu avatar

Or just use a good IDE that makes doing atomic commits pretty natural.

pomodoro_longbreak,
@pomodoro_longbreak@sh.itjust.works avatar

I’ve only tried the VS code hunk stager thing, and found it cumbersome compared to command line, but if you can make a GUI work for you ya go for it. I’ve never found it worth the trouble personally

dukk,

Shout out to Lazygit for letting me stage individual lines

pomodoro_longbreak,
@pomodoro_longbreak@sh.itjust.works avatar

Looks pretty neat. I like that it shows the commands it’s issuing!

oce,
@oce@jlai.lu avatar

You should try the JetBrains IDEs, as the other said, you can pick changes line by line graphically, when you commit, when you do a diff with another branch or when you fix conflicts. It’s much more convenient than commands and terminal text editors.

sag, to programmer_humor in 1 follower on GitHub = 1000 followers on other platforms 😅
@sag@lemy.lol avatar

I have 21 : () I am pretty famous

Alcatorda, to memes in 6÷2(1+2)

Hi! Nice blog post. Since you asked for feedback I’ll point out the one thing I didn’t really understand. You explain the difference between the calculators by showing excerpts from the manuals and you highlight that in the first manual, implicit multiplication is prioritised. But the text you underlined only refers to implicit multiplication involving special expressions(?) like pi, e, sqrt or log, and nothing about “regular” implicit multiplication like 2(1+3). So while your photos of the calculator results are great proof that the two models use a different order of operations, to me the manuals were a bit confusing since they did not actually seem to prove your point for the example math problems you are discussing. Or maybe I missed something?

wischi,

You are right the manual isn’t very clear here. My guess is that parentheses are also considered Type B functions. I actually chose those calculators because I have them here and can test things and because they split the implicit multiplication priority. Most other calculators just state “implicit multiplication” and that’s it.

My guess is that the list of Type B functions is not complete but implicit multiplication with parentheses should be considered important enough for it to be documented.

Pulptastic,

Negative reviews for the calculator that does OOO wrong.

CallumWells, to memes in 6÷2(1+2)

I love that the calculators showing different answers are both from the same manufacturer XD

wischi, (edited )

In the blog post there are even more. Texas Instruments, HP and Canon also have calculators, and some of them show 9 and some 1.

Jesus_666, to programmer_humor in GitHub Desktop or Git CLI?

Fork.

scottyjoe9,

All hail the fork!

dgmib, to memes in 6÷2(1+2)

You state that the ambiguity comes from the implicit multiplication and not the use of the obelus.

I.e. That 6 ÷ 2 x 3 is not ambiguous

What is your source for your statement that there is an accepted convention for the priority of the iinline obelus or solidus symbol?

As far as I’m aware, every style guide states that a fraction bar (preferably) or parentheses should be used to resolve the ambiguity when there are additional operators to the right of a solidus, and that an obelus should never be used.

Which therefore would make it the division expressed with an obelus that creates the ambiguity, and not the implicit multiplication.

(Rest of the post is great)

wischi, (edited )

In this case it’s actually the absence of sources. I couldn’t find a single credible source that states that ÷ has somehow a different operator priority than / or that :

The only things there are a lot of are social media comments claiming that without any source.

My guess is that this comes from a misunderstanding that the obelus sign is forbidden in a lot of standards. But that’s because it can be confused with other symbols and operations and not because the order of operations is somehow unclear.

dgmib,

What is your source for the priority of the / operator?

i.e. why do you say 6 / 2 * 3 is unambiguous?

Every source I’ve seen states that multiplication and division are equal priority operations. And one should clarify, either with a fraction bar (preferably) or parentheses if the order would make a difference.

wischi, (edited )

Same priority operations are solved from left to right. There is not a single credible calculator that would evaluate “6 / 2 * 3” to anything else but 9.

But I challenge you to show me a calculator that says otherwise. In the blog are about 2 or 3 dozend calculators referenced by name all of them say the same thing. Instead of a calculator you can also name a single expert in the field who would say that 6 / 2 * 3 is anything but 9.

dgmib,

Will you accept wolfram alpha as credible source?

mathworld.wolfram.com/Solidus.html

Special care is needed when interpreting the meaning of a solidus in in-line math because of the notational ambiguity in expressions such as a/bc. Whereas in many textbooks, “a/bc” is intended to denote a/(bc), taken literally or evaluated in a symbolic mathematics languages such as the Wolfram Language, it means (a/b)×c. For clarity, parentheses should therefore always be used when delineating compound denominators.

wischi,

Did you read the blog post? I also quoted the exact same thing.

SkiDude, to memes in 6÷2(1+2)

It’s also clearly not a bug as some people suggest. Bugs are – by definition – unintended behavior.

There are plenty of bugs that are well documented. I can’t tell you the number of times that I’ve seen someone do something wrong, that they think is 100% right, and “carefully” document it. Then someone finds an edge case and points out the defined behavior has a bug, because the human forgot to account for something.

The other thing I’d point out that I didn’t see in your blog is that I’ve seen many many people say they need to evaluate the 2(3) portion first because “parenthesis”. No matter how many times I explain that this is a notation for multiplication, they try to claim it doesn’t matter because parenthesis. screams into the void

The fact of the matter is that any competent person that has to write out one of these equations will do so in a way that leaves no ambiguity. These viral math posts are just designed to insert ambiguity where it shouldn’t be, and prey on people who can’t remember middle school math.

wischi,

Regarding your first part in general true, but in this case the sheer amount of calculators for both conventions show that this is indeed intended behavior.

Regarding your second point I tried to address that in the “distributive property” section, maybe I need to rewrite it a bit to be more clear.

Makeitstop, to risa in The name of the place is Deep Space 5

Fun fact: Patricia Tallman has played more characters on Star Trek than Jeffrey Combs.

Jaccident, (edited )

That depends on how you feel about what constitutes playing a character.

In raw numbers we’ve had Combs play 7 main characters (Brunt, Tiron, Mulkahey, Penk, Krem, Shran, Agimus) that aren’t Weyouns and at least 3 of them that I recall. This discounts his appearances in video games.

Whereas though PT has been on screen a lot, maybe as many times as Combs, it’s worth remembering that stuntpersons aren’t playing the character, they are playing the actor. She was also in Jurassic Park, not as Ellie, but as “Laura Dern’s Stunt Double”.

Edit: an earlier version of this comment started “that’s not strictly true” but I’m not the person who gets to decide that. To me it doesn’t seem true, but to someone else perhaps it does. I changed it because I’m not the arbiter of such things, and to open a comment that way was frankly a bit dickish.

Makeitstop,

It does depend on how you count it.

For Combs, I was only counting Weyoun as one character, even if he’s playing multiple copies of him.* And I’m only counting TV and movies, not video games. This also means that Tallman doesn’t get to have her Romulan appearance counted twice because the trading card game turned it into a different character.

For Tallman, I’m not counting any work as a double,** but I am counting her unnamed Starfleet officers that each had the misfortune of being played by a stuntwoman, and therefore tended to die. She gets one redshirt role each in TNG, Generations, DS9 and Voyager. She also plays one of the trilithium thieves from die hard in space, one of the aliens that knocked up a warbird’s engines, an immortalish prisoner in the gamma quadrant, a Bajoran nurse, and one of the space succubi that tried to beat Harry Kim with a large phallic object and drain him of his genetic material.

So, by that count, Tallman has 9 roles while Combs has 8.


  • Obviously this is a matter of preference and interpretation, and the more you think about it the more you start to open Pandora’s box. Are clones with the same look and personality all the same character? What about clones that are wildly different? What about parallel universe versions? Is a doppelganger added to the count? Or a time travel duplicate? What about body swaps or possessions, do they count as being a different character? What about a character who is playing another character in an in universe fiction? What about versions that appear in dreams or simulations?

** If we’re going to nitpick, I’d argue that stunt doubles are intended to be seen as the character by the audience, so it’s not unreasonable to count them that way, even if I’m not.

Jaccident,

I must have missed some Tallman background characters as I had fewer than that before moving on to tallying up her stunting for various main cast. (I checked two sources as I was worried this might be the case but as always Roles, Stunts and Secondary Artist work are not credited equally or properly).

Jaccident, when his maths failed.

EmpathicVagrant,

I see PT in the future of Risa

loopedcandle,

Be the change you want to see in the world.

EmpathicVagrant,

I’m the most abysmal at making memes, I’m but a collector/dealer

EmperorHenry, to programmer_humor in Manager: This task only takes 30 minutes. Why did it take you the whole day?
@EmperorHenry@discuss.tchncs.de avatar

reminds me of what youtube was doing to firefox users for awhile.

hypnotic_nerd,
@hypnotic_nerd@programming.dev avatar

git commit -m “break codec sync if UA = firefox/gecko”

Lemmygradwontallowme, (edited ) to memes in 6÷2(1+2)
@Lemmygradwontallowme@hexbear.net avatar

The real question here is BODMAS or PEMDAS?

hashbrowns4life, (edited )

Up here in the canada, we did BEDMAS

Brackets, Exponents, Division/Multiplication, Addition/Subtraction

Lemmygradwontallowme,
@Lemmygradwontallowme@hexbear.net avatar

Exponents, Oxponents, I honestly could give less of a shit until now…

keepcarrot,

Also PIMDAS (we had this conversation in my class this semester as we had a very wide range of ages and regions present in the class) (I is for indices) (I don’t remember what the Colombian students said, for some reason we had a group of 3 Colombians in our class of 12 nowhere near Colombia)

That said, the question is ambiguously written. Maybe the popularity of this will result in calculators being more consistent with how they interpret implicit multiplication signs.

(my preference is to show two lines, one with the numerator and one with the divisor)

Lemmygradwontallowme,
@Lemmygradwontallowme@hexbear.net avatar

PIMDAS? Isn’t that the same as PEMDAS?

keepcarrot,

So’s BOMDAS etc.? Just different words for things

Lemmygradwontallowme,
@Lemmygradwontallowme@hexbear.net avatar

Mutiplication or Division first then? Thus, BEDMAS or PEMDAS?

TankieTanuki,

POOTIS or PINGAS?

CarbonScored, (edited ) to memes in 6÷2(1+2)
@CarbonScored@hexbear.net avatar

A fair criticism. Though I think the hating on PEDMAS (or BODMAS as I was taught) is pretty harsh, as it very much does represent parts of the standard of reading mathematical notation when taught correctly. At least I personally was taught its true form was a vertical format:

B

O

DM

AS

I’d also say it’s problematic to rely on calculators to implement or demonstrate standards, they do have their own issues.

But overall, hey, it’s cool. The world needs more passionate criticisms of ambiguous communication turning into a massive interpration A vs interpretation B argument rather than admitting “maybe it’s just ambiguous”.

wischi, (edited )

The problem with BODMAS is that everybody is taught to remember “BODMAS” instead of “BO-DM-AS” or “BO(DM)(AS)”. If you can’t remember the order of operations by heart you won’t remember that “DM” and “AS” are the same priority, that’s why I suggested dropping “division” and “subtraction” entirely from the mnemonic.

It’s true that calculators also don’t dictate a standard but they implement what conventions are typically used in practice. If a convention would be so dominating (let’s say 95% vs 5%) all calculator manufacturers would just follow the 95% convention, except maybe for some very special-purpose calculators.

CarbonScored,
@CarbonScored@hexbear.net avatar

In fairness, I did quite like the suggestion to just remove division and subtraction! One that should be taken to heart :)

kogasa, (edited )
@kogasa@programming.dev avatar

Calculators do not implement “what conventions are typically used in practice.” Entering symbols one by one into a calculator is a fundamentally different process from writing them in a sentence. A basic traditional calculator will evaluate each step as you enter it, so e.g. writing 1 + 2 * 3 will print 1, then 3, then 6. It only gets one digit at a time, so it has no choice. But also, this lends itself to iterative calculation, which is inherently ordered. People using calculators get used to this order of operations specifically while using calculators, and now even some of the fancy ones that evaluate expressions use it. Others switched to the conventional order of operations.

fallingcats, (edited )

Entering symbols one by one into a calculator is a fundamentally different process from writing them in a sentence.

Citation needed.

No but seriously, why do you think it necessarily needs to be different? There are calculators that use actual fraction notation and all that

kogasa,
@kogasa@programming.dev avatar

It’s not that it needs to be different, it’s that it is. The fact that there are calculators with fractional notation is completely irrelevant.

Perfide, (edited ) to memes in 6÷2(1+2)

You lost me on the section when you started going into different calculators, but I read the rest of the post. Well written even if I ultimately disagree!

The reason imo there is ambiguity with these math problems is bad/outdated teaching. The way I was taught pemdas, you always do the left-most operations first, while otherwise still following the ordering.

Doing this for 6÷2(1+2), there is no ambiguity that the answer is 9. You do your parentheses first as always, 6÷2(3), and then since division and multiplication are equal in ordering weight, you do the division first because it’s the left most operation, leaving us 3(3), which is of course 9.

If someone wrote this equation with the intention that the answer is 1, they wrote the equation wrong, simple as that.

abraxas, (edited )

There has apparently been historical disagreement over whether 6÷2(3) is equivalent to 6÷2x3

As a logician instead of a mathemetician, the answer is “they’re both wrong because they have proven themselves ambiguous”. Of course, my answer would be RPN to be a jerk or just have more parens to be a programmer

wischi,

The calculator section is actually pretty important, because it shows how there is no consensus. Sharp is especially interesting with respect to your comment because all scientific Sharp calculators say it’s 1. For all the other brands for hardware calculators there are roughly 50:50 with saying 1 and 9.

So I’m not sure if you are suggesting that thousands of experts and hundreds of engineers at Casio, Texas Instruments, HP and Sharp got it wrong and you got it right?

There really is no agreed upon standard even amongst experts.

kogasa,
@kogasa@programming.dev avatar

Hi, expert here, calculators have nothing to do with it. There’s an agreed upon “Order of Operations” that we teach to kids, and there’s a mutual agreement that it’s only approximately correct. Calculators have to pick an explicit parsing algorithm, humans don’t have to and so they don’t. I don’t look to a dictionary to tell me what I mean when I speak to another human.

fallingcats, (edited )

Thanks for putting my thoughts into words, that’s exactly why I hate math. It was supposed to be the logical one, but since it only needs to be parsed by humans it failed at even that. It’s just conventions upon conventions to the point where it’s notably different from one teacher/professor to the next.

I guess you can tell why I went into comp-sci (and also why I’m struggling there too)

Perfide,

No, those companies aren’t wrong, but they’re not entirely right either. The answer to “6 ÷ 2(1+2)” is 1 on those calculators because that is a badly written equation and you(not literally you, to be clear) should feel bad for writing it, and the calculators can’t handle it with their rigid hardcoded logic. The ones that do give the correct answer of 9 on that equation will get other equations wrong that it shouldn’t be, again because the logic is hardcoded.

That doesn’t change the fact that that equation worked out on paper is absolutely 9 based on modern rules of math. Calculate the parentheses first, you then have 6 ÷ 2(3). We could solve from here, but to make the point extra clear I’m going to actually expand this out to explicit multiplication. “2(3)” is the same as “2 x 3”, so we can rewrite the equation as “6 ÷ 2 x 3”. All operators now inarguably have equal precedence, which means the only factor left in which order to do the operations is left to right, and thus division first. The answer can only be 9.

MeetInPotatoes,

If you’d ever taken any advanced math, you’d see that the answer is 1 all day. The implicit multiplication is done before the division because anyone taking advanced math would see 2(1+2) as a term that must be resolved first. The answer still lies in the ambiguity of the way the problem is written though. If the author used fractions instead of that stupid division symbol, there would be no ambiguity. It’s either 6/2 x 3 = 9 or [6/(2x3)] = 1. Comment formatting aside, if someone put 6 in the numerator, and then did or did NOT put all the rest in the denominator underneath a horizontal bar, it would be obvious.

TL;DR It’s still a formatting issue, but 9 is definitely not the clear and only answer.

brisk, to memes in 6÷2(1+2)

My only complaint is the suggestion that engineers like to be clear. My undergrad classes included far too many things like 2 cos 2 x sin y

fallingcats,

I’d say engineers like to be exact, but they like being lazy even more

AVincentInSpace, (edited ) to programmer_humor in Manager: This task only takes 30 minutes. Why did it take you the whole day?

Every time I commit I have to look through git diff, figure out what the hell I actually did, come up with something intelligent to say about jt, possibly split the commit into multiple commits if I changed multiple things, do some shuffling with git reset and git add

For some reason all my personal projects are all like 4K SLoC with 50 total commits, all of which include apologies for not doing more smaller commits

PoolloverNathan,

^psst,^ ^git^ ^add^ ^-p^

etchinghillside, (edited )

Remind me what -p does.

Edit: never mind - I see it mentioned below.

PoolloverNathan,

Patch add - it shows you particular changes you made, and you choose whether or not to include them in the commit. (You can then use git stash -k to stash only the changes you did not add, so you can test before you commit.)

Anticorp,

There’s a bigger issue than your commit message if you don’t even know what you just coded and are committing.

AVincentInSpace, (edited )

You see, sometimes I code something, go to bed before finishing it, come back, decide not to commit because then I’d have to think of a commit message and I just want to code, start working on an unrelated feature, do that for a couple days, get distracted by life stuff and put the project down for a few weeks/months, rinse and repeat, and then I finally get around to writing a commit message because I’m about to start a huge change and I want a restore point and I’m like. Okay, it’s been like 3 months since my last commit, I’m pretty sure my code can now do something it couldn’t 3 months ago but come on, I can’t even remember what I had for lunch last Thursday

I’m well aware this is terrible practice but I don’t know how to stop doing it

dukk,

Commit more often. Maybe work in a different feature branch, and don’t be afraid to commit your half-working crappy code. If it’s a personal project/fork, it’s totally acceptable to commit often with bad commit names and small unfinished changes: you can always amend/squash the commits later. That’s how I tend to work: create a new branch, work on the feature, rebase and merge (fast forward, no merge commit). Also, maybe don’t jump around working on random features :P

AVincentInSpace, (edited )

but…but new feature shiny

Fr tho this is all excellent advice

ExtraMedicated,

Jumping around to random features is how my ADHD brain works most efficiently.

Slotos,

Good news, TDD is methylphenidate of software development!

adrian783,

you can setup a on-save script to force you to commit when the number of changes is greater than a certain number from the previous commit.

Anticorp,

You can help yourself a lot here by making commits every time you make a meaningful change. A feature doesn’t need to be complete to commit major checkpoints along the path to completion. That’s what feature branches are for. Commit often. It’ll help you think of messages, and it’ll help you recover in the case of catastrophe.

adrian783,

it means you commit too infrequently. your commit messages should be able to describe what u just did within 10 words.

akkajdh999,

I just get too excited about actually implementing/fixing something (random things that I see along the way) more than commit ceremony (nobody will care about it in my project anyway other than one random guy who gave the repo a star)

oce,
@oce@jlai.lu avatar

Nah, I’m that guy, I gave your repo a star for the effort, but I’m not reading your history.

PixxlMan,

I spend much time splitting them up inside visual studio by file and individual lines changed to try and separate my many simultaneous changes into several somewhat usable commits. If I was stupid enough to make some big refactor at the same time I might just have to throw in the towel… It’s really painful after a few weeks to try and pick up the pieces of what I was doing but never commited too lol.

  • All
  • Subscribed
  • Moderated
  • Favorites
  • localhost
  • All magazines
  • Loading…
    Loading the web debug toolbar…
    Attempt #

    Fatal error: Allowed memory size of 134217728 bytes exhausted (tried to allocate 18878464 bytes) in /var/www/kbin/kbin/vendor/symfony/http-kernel/Profiler/FileProfilerStorage.php on line 171

    Fatal error: Allowed memory size of 134217728 bytes exhausted (tried to allocate 10502144 bytes) in /var/www/kbin/kbin/vendor/symfony/error-handler/Resources/views/logs.html.php on line 33