TIL (about the Dark Arts of HTML)
-
@dkf said in TIL (about the Dark Arts of HTML):
That sounds like serious effort. What do you take me for, a moderator?
Obviously not, if he's expecting you to expend effort.
-
-
-
-
@r10pez10 Maybe I'm just slow today, but that took a bit to mentally process.
So essentially, to estimate a power of two where the exponent has two digits (for example 257):
- you take the units digit of the exponent to find a power of two between 20 and 29 (for 257, the 7th power of two is 128);
- you take the tens digit of the exponent and add triple as many zeroes (for 257, you add 15 which is the triple of 5. Or, you multiply by 1000 five times.)
So the end result for this example is 257 is approximately 128 000 000 000 000 000.
It's actually 144 115 188 075 855 870, so that's about a 11.2% error, which isn't bad for a top-of-the-head estimation.
-
TIL that JS doesn't have base64 encode/decode functions that work reliably across browsers...
-
@Onyx Name and Shame!
-
-
@dkf seriously though, it looks like IE pre-10 is the one to really blame.
Everything else has
btoa
andatob
functions which, despite being poorly named, work. Sort of. They don't play nicely with Unicode at all. There's a hack to get it to work properly, but it's hacky.
-
@anotherusername said in TIL (about the Dark Arts of HTML):
There's a hack to get it to work properly, but it's hacky.
Hacks tend to be hacky.
This message was brought to you by the Department of Redundancy Department
-
@anotherusername said in TIL (about the Dark Arts of HTML):
They don't play nicely with Unicode at all.
Since Unicode itself doesn't describe a byte sequence anyway, and base64 only works to encode/decode byte sequences, you need an extra step whatever you do. That step is to explicitly encode the string as, say, UTF-8 and get that byte sequence; then you can base64 it. The reverse direction is a de-base64 followed by a conversion from (supposedly) UTF-8 byte sequence to a real string.
So yet another brick on the pile of “strings are harder than they appear to be”.
-
@dkf right, but where's the built-in function to convert a JS string to UTF-8 and then convert it to a byte sequence?
...or to go in the reverse direction...
It sure would be nice if
btoa
was able to do that all by itself. Like... give it a string, tell it to use UTF-8 encoding, and boom.
-
@anotherusername said in TIL (about the Dark Arts of HTML):
where's the built-in function to convert a JS string to UTF-8 and then convert it to a byte sequence?
You mean there isn't one?
Definitely indeed…
-
@dkf no.
Currently the best/simplest hack that I've seen is:
function toUTF8String(str) { return unescape(encodeURI(str)); }
...but
unescape
is deprecated...
-
@anotherusername said in TIL (about the Dark Arts of HTML):
the best/simplest hack that I've seen
-
TIL that the Atkins Diet is back, or maybe it just never went away and I stopped noticing it.
Sweet Bibby Jebus, is that snake oil ever going to die? It's worse than 'mega-vitamin therapy' the way it keeps coming back like a poorly-written but inexplicably popular comic book villain.
Seriously, since when was making yourself dangerously sick just to temporarily lose a few pounds a good idea? Oh, never mind, stupid question - it's always been popular to risk your health for some minor improvement in your looks. Feh.
-
@ScholRLEA to be fair, is delicious and any excuse to eat it is great.
To be fairer, is more delicious so fuck that nonsense.
-
@ScholRLEA said in TIL (about the Dark Arts of HTML):
Seriously, since when was making yourself dangerously sick just to temporarily lose a few pounds a good idea?
Eh?
-
@boomzilla While Atkins himself gave a lot of bogus arguments for why you lose weight on his diet, pretty much every other nutritionist on the planet who isn't working for a diet-plan company holds that the low-carb, high protein approach 'works' because it interferes with metabolism to such a severe degree that the dieters lose weight due to being too ill to process the nutrients correctly.
-
TIL just how badly Ayn Rand misunderstood the Austrian School economists. It really, really puts the idiocies I've heard from Randroids in perspective.
Basically, Rand never bother to read what Menger, Mises, etc. said, and just assumed that their focus on transactions between individuals was based on an ethical stance. The problem? Their whole goal was to eliminate the entire idea of applied economics, and focus on making it an empirical science; they were studying individuals, not because they thought individualism was great, but because they thought that macroeconomic behaviors were fundamentally too complex to model accurately. They explicitly disavowed any and all ethical, moral, and ideological aspects of the field, including political capitalism.
That, plus the fact that they rejected out of hand the concept of objective value, which Rand was really, really hot for. The subjective nature of value was and remains a core part of their research methodology.
-
@ScholRLEA said in TIL (about the Dark Arts of HTML):
While Atkins himself gave a lot of bogus arguments for why you lose weight on his diet, pretty much every other nutritionist on the planet who isn't working for a diet-plan company holds that the low-carb, high protein approach 'works' because it interferes with metabolism to such a severe degree that the dieters lose weight due to being too ill to process the nutrients correctly.
I've never heard that. I mean, diabetic ketoacidosis is a thing, but a different thing. And I have to say that when I successfully followed it I felt the opposite of ill, serious or no.
The biggest problem with it that I've heard seems to be the risk of stuff like kidney stones. But I don't get the impression that's what you're talking about.
Also, are these the same guys who can't figure out if butter or eggs or fat or sugar is good for us?
-
@boomzilla said in TIL (about the Dark Arts of HTML):
I've never heard that. I mean, diabetic ketoacidosis is a thing, but a different thing. And I have to say that when I successfully followed it I felt the opposite of ill, serious or no.
If the Authorities tell you that you were ill, then you were ill and how you felt at the time is irrelevant.
@boomzilla said in TIL (about the Dark Arts of HTML):
Also, are these the same guys who can't figure out if butter or eggs or fat or sugar is good for us?
Yes.
-
-
@ScholRLEA said in TIL (about the Dark Arts of HTML):
TIL that the Atkins Diet is back, or maybe it just never went away and I stopped noticing it.
The Atkins diet--as well as other low-car diets--work quite well as long as you take vitamins if necessary. I'm sure all the people who've lost hundreds of pounds on low-carb diets are surprised to know how sick and/or dead they are.
-
@ScholRLEA said in TIL (about the Dark Arts of HTML):
weight due to being too ill
Anyone who thinks this is true is wildly uneducated. I'm not surprised to see it coming from you.
-
@boomzilla said in TIL (about the Dark Arts of HTML):
The biggest problem with [the Atkins diet] that I've heard seems to be the risk of stuff like kidney stones.
Ah, so contraindicated for me until I at least get around to getting my kidney function checked. (50% chance of having the bum end of genetic inheritance, ahoy!)
Good to know…
-
@boomzilla said in TIL (about the Dark Arts of HTML):
Also, are these the same guys who can't figure out if butter or eggs or fat or sugar is good for us?
No, those are diet-book 'doctors'. At the risk of sounding like a 'No True Scotsman' argument, I will tell you right now that real, accredited nutritionists - you know, the ones who actually have medical degrees rather just saying they do - don't talk about foods being good or bad at all; they talk about balancing the diet, about controlling portion sizes, and about getting a small but sufficient amount of all the nutrients one needs. They don't talk about losing weight, because most weight problems are primarily psychological in nature, not dietary - they will advise people on how to change their diet in helpful ways over time, which will generally help them reach a healthy weight (provided the patients also address the underlying emotional issues as well), but weight loss would not be a goal in and of itself, and they would usually warn you against dieting just for the sake of weight loss.
Nutritionists don't write diet books, frauds do.
-
@ScholRLEA said in TIL (about the Dark Arts of HTML):
I will tell you right now that real, accredited nutritionists - you know, the ones who actually have medical degrees rather just saying they do - don't talk about foods being good or bad at all;
Bullshit. Anyways, plenty of them do all those ridiculous studies.
@ScholRLEA said in TIL (about the Dark Arts of HTML):
Nutritionists don't write diet books, frauds do.
I think you may just have fallen for different fraudsters.
-
sigh 'Tis a fair cop, m'lord. I may in fact have a tiny bit of bitterness about the subject - a bit the size of the Rock of Gibraltar. When I was between the ages of 8 and 17, my mother dragged me to every quack diet doctor she could find, despite the fact that I wasn't particularly overweight at the time (I was maybe 10 lbs overweight at first, and it did feed cyclically on my already established depression, but in retrospect it wasn't much of a much).
I am now, though, very much so. I'll leave drawing the line between point A and point B as an exercise for the reader.
-
-
TIL
The best way to truly understand how OAuth2 works is to write your own client.
-
@cartman82 Open source in a nutshell?
-
TIL kangaroo claws are fucking terrifying
-
@anonymous234 said in TIL (about the Dark Arts of HTML):
TIL kangaroo claws are fucking terrifying
God's little fish and trousers! Now we know what happened to the velociraptors.
-
@FrostCat I thought they just went into philosophy...
-
-
-
Creepy as fuck IMO (sorry for the people who have that).
But amazingly ingenious.
Filed under: FUCKING HELL WHY CAN'T I REPLY TO A POST AFTER I UPVOTE?
-
TIL this exists
-
@loopback0 That was posted a couple months back, wasn't it?
-
@RaceProUK Maybe. If it was, I either missed it or forgot.
-
@loopback0 said in TIL (about the Dark Arts of HTML):
I either missed it or forgot.
Sounds like you don't give a
-
@loopback0 said in TIL (about the Dark Arts of HTML):
TIL this exists
Someone might want to suggest to her that she pull down her pants first.
-
@El_Heffe said in TIL (about the Dark Arts of HTML):
Squatty Potty
It gets
betterworse:
https://www.youtube.com/watch?v=YbYWhdLO43Q
-
@loopback0 said in TIL (about the Dark Arts of HTML):
TIL this exists
Squatty PottyI hope you watched the video on the home page.
Fake edit: yeah, that video.
-
Despite seeing hundreds before TIL that rainbows have red on the outside.
For some reason I always thought of them with the red on the inside. There are a fair few drawings in GIS that share my misgivings.
Are they always the same way?
-
@coldandtired said in TIL (about the Dark Arts of HTML):
Despite seeing hundreds before TIL that rainbows have red on the outside.
For some reason I always thought of them with the red on the inside. There are a fair few drawings in GIS that share my misgivings.
Are they always the same way?
Yes , they are in wavelength order, so red to violet
-
@cabrito Unless it's a double rainbow. One of them is inverted then.
-
@aliceif Isn't it the third that is inverted?
-