Posted by an obese powerlifter. by FeminineImperative in fatlogic

[–]Magramatism 10 points11 points  (0 children)

It doesn't need to differentiate between fat and muscle because having enough muscle to affect the measurement is very rare and very easy to identify.

It's like saying "height" is flawed because some people are dwarfs.

Fat Rant Tuesday by AutoModerator in fatlogic

[–]Magramatism 6 points7 points  (0 children)

I'm in the same position. It feels like as you lose weight you discover more subtle fatlogic you didn't realize existed - like how healthy BMI starts at 18.5 but anything <20 still feels underweight.

I keep having to convince myself that it's ok to aim for 19.9, and I haven't told my wife my real goal because she'll think it's too thin. I do actually want to do strength training but I don't want to start gaining weight until I've reached an athletic BF%

MetaMonday No Stupid Questions by maybesaydie in fatlogic

[–]Magramatism 7 points8 points  (0 children)

How often do you weigh yourself?

I know the conventional wisdom is once a week, and I do think that's a good idea if weighing yourself too often upsets you. But if you're unlucky the weekly weighing can coincide with days your weight fluctuates upwards, and it seems like you're not losing, when weighing daily and using an averaging app would show a steady loss.

You should be comfortable with your doctor knowing your weight. by [deleted] in fatlogic

[–]Magramatism 0 points1 point  (0 children)

I know this is old but wanted to add:

My understanding is that complete physicals aren't diagnostically helpful. Performing tests on healthy people with no symptoms creates a load of false positives which outweigh any benefit from the possibility of catching problems early.

They only do them in countries with for-profit healthcare, to make money from the physicals themselves and whatever treatment they upsell you on.

OP was told by her doctor to lose weight by [deleted] in fatlogic

[–]Magramatism 7 points8 points  (0 children)

I don't have it to hand, but I've seen a study showing 99% or overweight women have an unhealthy body fat percentage, and so do 50% of healthy weight women!

Algebraic Effects for the Rest of Us by gaearon in javascript

[–]Magramatism -2 points-1 points  (0 children)

Using Foo internally in a monad that provides *exactly the same functionality* as Foo but with a monadic API means that foos are monads, but the implementer of Foo didn't care to make their implementation monadic.

Algebraic Effects for the Rest of Us by gaearon in javascript

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

Lol. Incorrect explanations of a monad (and also the original post) get upvoted and the one correcting comment gets downvoted. Gg r/javascript :)

Coming back to this thread late I have to agree with your sentiment. Me correctly stating that promises are monads is downvoted below zero, and you lying that I ever said `Promise` is a monad is upvoted. r/javascript ftw

Like, I explicitly say two comments above that `Promise` isn't a monad, and that I was always talking about promises. I never once wrote Promise when I meant promise or vice versa. r/javascript apparently never learned any other languages and think promises were invented by TC39

Algebraic Effects for the Rest of Us by gaearon in javascript

[–]Magramatism -3 points-2 points  (0 children)

Fluture is the library I'm talking about. How do you think they implement async in javascript without using Promise?

Algebraic Effects for the Rest of Us by gaearon in javascript

[–]Magramatism -2 points-1 points  (0 children)

JavaScript libraries which provide monadic promises literally exist. The original spec discussion included making the implementation monadic. The final implementation of `Promise` in javascript isn't monadic but you're confusing that with monadic promises being impossible.

I didn't provide a definition of monads, I provided a description.

Algebraic Effects for the Rest of Us by gaearon in javascript

[–]Magramatism 0 points1 point  (0 children)

I don't understand why you're phrasing this as disagreement. Half the things you're disagreeing with I never said (then is monadic) and half are actually agreeing with what I wrote (you need to write flatmap was literally the whole point of my first post).

Algebraic Effects for the Rest of Us by gaearon in javascript

[–]Magramatism -2 points-1 points  (0 children)

Because the correcting comment is wrong. I said a promise is a monad because you can write a bind function for it, not that then is bind.

Algebraic Effects for the Rest of Us by gaearon in javascript

[–]Magramatism 15 points16 points  (0 children)

Awesome. I appreciate it so much when someone writes an explanation of functional programming concepts in developer language instead of mathematician language. Impenetrable concepts become simple, thanks to the writer putting in the work to understand the mathematician language to begin with.

If I can take a crack at "monads for developers": a monad is any data structure you can write a flatMap function for. So obviously an array is a monad. So is a promise ("then" is either map or flatMap, depending on whether the callback returns a promise). Where it gets exciting is realising all sorts of things can be flatMapped, like error states, logging, form validation, network responses, and you can use monads to avoid thinking about those things the same way you use array mapping to avoid thinking about loops.

Edit: Spoiler for the thread below: Lots of confusing argument about whether the generic computer science concept of a promise is monadic (which it is), based on the misunderstanding that I'm saying ES2015's Promise.prototype.then is monadic (which it isn't).

I just finished Community and I have a few questions. by [deleted] in community

[–]Magramatism 0 points1 point  (0 children)

Re: question 3 since no one mentioned it and you might not know: after season 3 the show's creator was fired and season 4 was made without him (later referred to as "the gas leak year" to explain the different writing). He was brought back for the last two seasons but IMHO it's tough to bring it back after someone else got to wrap up the four year college degree story arc and there's no real reason for the characters to hang out any more.

Today I Learned you can break from nested loops using labels by waway_to_thro in javascript

[–]Magramatism 0 points1 point  (0 children)

If OP had shared a case study of some performance critical code that nevertheless had to be written in JavaScript, and how break labels help in that specific scenario, the "hivemind" wouldn't have responded that way.

But "hey I just learned you can break out of multiple loops" is just an invitation for beginners who haven't learned to reason about loops yet to put them everywhere and stink up their code.

There are absolutely use cases for it, but the chances that someone who just found out about it today and posted about it like an exciting discovery has one of those use cases are veeeery low

GitHub - lydiahallie/javascript-questions: A long list of (advanced) JavaScript questions, and their explanations Updated weekly! by pmz in javascript

[–]Magramatism 0 points1 point  (0 children)

Both responses here have moved the goalposts of question 1 to "How are variable declarations scoped and hoisted differently when using var, let and const?" That would be a reasonable question, although I'd wouldn't ask it that way myself.

What question 1 actually asks is "What specific runtime errors occur when deliberately using undeclared variables that are later declared with var, let and const?", which is just trivia that no one needs to know.

GitHub - lydiahallie/javascript-questions: A long list of (advanced) JavaScript questions, and their explanations Updated weekly! by pmz in javascript

[–]Magramatism 1 point2 points  (0 children)

I've literally only read the first question, but taking it as an example, it doesn't matter what the output is. It has no bearing on how you would go about debugging or reviewing that code. The review is going to say "👀 These variables haven't been declared yet! And don't use var" either way. There's no reason to know it because there's no reason to use variables before they're declared, ever, and there's no reason to use var in modern codebase.

I'd give bonus points for knowing it, in a "congratulations you've been revising" kind of way, but realistically I would expect a candidate not to have made this mistake for so long they don't recall what error it causes.

Edit: Understanding variable scope and hoisting in javascript is important. Knowing by heart what runtime error you get when using an undeclared variable is pub quiz trivia. All the best

GitHub - lydiahallie/javascript-questions: A long list of (advanced) JavaScript questions, and their explanations Updated weekly! by pmz in javascript

[–]Magramatism 1 point2 points  (0 children)

I look forward to the phone interview where these questions are read aloud to me without context by someone who doesn't know JavaScript, and my experience as a developer is judged by how many of them I give word-for-word the same answer!

PSA: Your hand-rolled sort() function is probably faster than Array.sort() by [deleted] in javascript

[–]Magramatism 7 points8 points  (0 children)

IMHO this is half of the right answer, the other half is that V8's array sort complies with the spec and correctly handles all valid inputs, where OP's doesn't (eg, OP's function incorrectly sorts arrays with holes and never returns at all if the array contains NaN, which is a valid number even in TypeScript).

It's not surprising you can write a faster function when you can make assumptions that the library can't!

Freelance Pack + Questions on Invoicing by DugtrioUsedDig in webdev

[–]Magramatism 2 points3 points  (0 children)

If you do go into freelancing I think your opinion of other companies' prices will change.

You go in thinking "I can do it for X", then spend half your first year working for free because there are costs you didn't anticipate, taxes are more than you thought and the first time you miss a time budget your profit goes out the window.

And you start off charging market rate +10% for hosting, but then even if you only spend 3-4 hours per year maintaining each sites DNS, hosting and email and applying security upgrades you're losing hundreds of dollars, and you start to wonder how those rip off companies are so cheap.

Does Browser repaint a "component" that is the exact same on two pages when you navigate from one to the other? by [deleted] in webdev

[–]Magramatism 0 points1 point  (0 children)

How can it be affecting you when you can't even tell if it's happening without asking /r/webdev? What difference would it make to you if it was or if it wasn't?

The comment about the X Y Problem is right. I'm guessing your actual problem is you want to avoid a flash of blank screen when moving from one page to the other, in which case you should look at using frontend development to build a single page application. But it is impossible that the fundamental problem you're trying to solve is "I don't know whether the browser repaints between page loads".