When my console throws a NaN I kinda think of it as an Halloween kid receiving a fruit instead of a candy. They won’t say “That’s a fruit”. They’ll say “That’s not a treat”.
I’m personally pissed more often by a falsy 0.
Did you know that early analog computers would literally explode when asked to divide by 0?
Now computers just say “Hey stupid, that shit is not even a Number in a mathematical sense, but sure I’ll add one to it.” instead of “Why would you kill me like this?”
You can’t really define Infinity as a number, yet it is part of their world.
So typeof NaN === ‘number’ totally makes sense in that regard.
If you ever worked with arrays of dates, don’t judge NaN too harshly.
It works with everything except of course for falsy values
<span style="color:#323232;">myThing.number = someNumberThatShouldNotBeEqualToZero
</span><span style="color:#323232;">
</span><span style="color:#323232;">if (myThing.number) {
</span><span style="color:#323232;"> // do something very important with that number that should not be equal to zero
</span><span style="color:#323232;">}
</span><span style="color:#323232;">
</span><span style="color:#323232;">// This can fail at anytime without warning
</span>
So you’ve got to be extra careful with that logic when you’re dealing with numbers.
I am not saying it’s wrong though. I’m saying it’s often annoying.
Besides, null is a perfectly valid value for a property, just as 0. Working with API Platform, I couldn’t tell the number of times I used this kind of statement:
<span style="color:#323232;">if (property || property === null) {
</span><span style="color:#323232;"> // do some stuff
</span><span style="color:#323232;">}
</span>
Probably just as much as
<span style="color:#323232;">if (property || property === 0) {
</span><span style="color:#323232;"> // do some stuff
</span><span style="color:#323232;">}
</span>
We have forced it, quite hamfistedly, to do anything. The organic hell-evolution of web browsers turned them into do-anything sandboxed mini-OS. It meant whatever hellish code you used to write your corporate mandated web app could now become a perfectly bloated standalone application. And the demonic language that would enable it was called Javascript. It does the backend and it does the frontend. You could consider those advantages over other devices, like toasters and those handheld electronic games from the 80s.
Even some of the ones that are edible still secretly want to kill you. From the Wikipedia entry for “chicken of the woods”:
In some cases eating the mushroom "causes mild reactions … for example, “swollen lips” or in rare cases “nausea, vomiting, dizziness and disorientation” to those who are sensitive. This is believed to be due to a number of factors that include allergies to the mushroom’s protein or toxins which are only somewhat stable at high temperatures.
I’ll eat portabellos if they come on pasta or pizza (though I’ve started taking them off the latter because they turn to rubber in the microwave) but I sure as hell am not going out of my way to order any dish that features them (mushrooms) as the main protein.
If you have a stove I can definitely recommend heating your pizza in a dry (with no oil) frying pan. Set the temperature medium-low and heat a slice or two at a time for a few minutes. It comes out like it was freshly cooked.
Oof, that sucks. It seems like the universe really does enjoy a cruel prank sometimes. I hope you’ve found something equally enjoyable to fill the pizza shaped hole in your meals.
I finally got around to trying this. I don’t see the point. By the time the cheese was re-melted, the crust turned into a hard cracker and it took ten times longer than the microwave. It’s quite possible I had the stove up too high (it’s an electric stove and I had it on 4/10), but I’d still say the point goes to the microwave for being quicker and having greater margin for error.
Hmmm, it’s hard to debug pizza remotely, but maybe the heat wasn’t high enough, it normally only takes a minute or two to heat through and cooking it for longer probably would make the base go hard.
Thanks for reporting bavk though, and I’m sorry you had a suboptimal pizza result.
Here’s a hint for you. Lower the power of the microwave to 4/10 and cook about 50% longer. Once you get the timing down you leftover pizza will be much better and less rubbery.
Most people are clueless about how to properly use a microwave, because no one teaches us, but max all the time is not how it should be used.
That’s effectively what I do, I don’t just blast it for a minute and a half.
I normally don’t futz with the power settings but I’ll do 30s at a time and check if it’s heated, then move it around so the hotspots in the microwave hit different parts of it (the turntable only does so much).
Some people also get mild to severe reactions to pizza. They’re sensitive to night shade. Or lactose intolerant. Or have celiac’s. Or are allergic to one of the toppings.
Happens to some SE Asians in North America too, because the edible straw mushroom from SE Asia resembles one here called “death cap”. Amanita phalloides. What’s fucked up is right before it kills you your symptoms actually improve, so people get discharged from the hospital and think they are going to be ok. I forage mushrooms but I stay away from white gilled mushrooms completely.
Yeah I had my yard full of destroying angels last summer, when they first showed up I was all “sweet! Mushrooms!” Because they look real similar to agaricus. But then I saw the white gills, and was all :(.
And I made sure to tell my kids not to mess with them and why.
What’s even wilder is if you look at the code of that package, all it does is include the is-odd package and then return !is. And the is-odd package isn’t much better, it does some basic checks on the input and then returns n % 2 === 1.
I thought I was missing something. JS is one of my main languages and I always just write the is-odd function myself since it’s like 10 characters. It boggles the mind that is-even has 176k weekly downloads
To be fair having a name can make things easier to read. I get that i % 2 == 0 is a common pattern and most programmers will quickly recognize what is happening. But isEven(i) is just that much easier to grok and leaves that brainpower to work on something else.
But I would never import a package for it. I would just create a local helper for something this trivial.
Even if the code isn’t reused adding names to sub-expressions can be very valuable. Often times I introduce new functions or variables even if they are only used once so that I can give them a descriptive name which helps the reader more quickly understand what is happening.
Yeah, I do that with pretty much every separate operation in c# since our solutions are pretty big. Most of my JS scripts are just done in ServiceNow which are separated and named appropriately.
Don’t use mushroom ID apps and don’t trust random guidebooks from Amazon, they’re probably AI-generated crap.
The deadly mycotoxin orellanine, which is present in Cortinarius rubellus, the deadly webcap, may not cause symptoms in those who ingested the mushroom until one or two weeks have passed – after detectable traces of the toxin are already gone, and late-stage kidney failure has already begun. Connecting the sickness with certainty to a misidentified wild mushroom that was eaten weeks earlier with no obvious ill effects is not always possible.
lemmy.ml
Newest