TIL (about the Dark Arts of HTML)
-
@Arantor said in TIL (about the Dark Arts of HTML):
Have you seen the abominations people do in React?
I picked one of the examples off the React site, picked a component basically at random.
render() { return ( <div className="component-emoji-results"> {this.props.emojiData.map(emojiData => ( <EmojiResultRow key={emojiData.title} symbol={emojiData.symbol} title={emojiData.title} /> ))} </div> ); }
So return a div as markup (with React magic applied), but also iterate over an object and return one sub component from it per entry inside said div.
The line between native HTML, HTML-React-Component and JS… and not even do much as a quote between them in some cases.
My understanding is that there is NO native HTML here, just react-components rendering to plain simple HTML elements like div named the same as the tags they render to.
@topspin said in TIL (about the Dark Arts of HTML):
@Arantor the thing that surprised me the most was how this could possibly work, syntactically. However, it appears thats handled by a pre-processing step?!
The HTML-like tags are compiled to appropriate component factories. I believe the entirety of HTML in a React application is a stub
<body>
that runs the main javascript entry point fromonload
and all the content is built with DOM calls from the components as they are rendered.Also, this does look like the old days of
<?php
or whatever (coldfusion?!) where you just randomly mixed the code and the mark-up. I'm skeptical this isn't a step back.It is nothing like PHP. More like XAML, GtkBuilder or QtQuick. You are building the tree of widgets and binding functionality to them. And using a syntax that accidentally resembles HTML.
@Arantor said in TIL (about the Dark Arts of HTML):
@topspin PHP has mostly moved on from that nonsense unless you’re working in WordPress…
It's not a nonsense. Inline logic has better whipuptitude¹, but worse manipulexity¹, so it depends on what you are up to.
but yeah React is precompiled and I still have no idea how it actually works in practice because React feels so fragile and whenever I write it I end up guessing at it until it compiles. Then I guess at it until I get it to behave.
I suspect you, out of habit, treat the parts that look like HTML as HTML, and get thrown off every time the preprocessor that translates them to pure javascript does not understand something.
¹ Terms coined long ago by Larry Wall in some talk about perl … I think he was talking about how some languages have one and some have the other, but perl 6 will have plenty of both!!eleven!.
-
@Bulb said in TIL (about the Dark Arts of HTML):
using a syntax that accidentally resembles HTML
Accidentally, but on purpose.
-
@Gribnit Indeed on purpose, but for all the wrong reasons.
-
@Bulb said in TIL (about the Dark Arts of HTML):
My understanding is that there is NO native HTML here
You're probably right. My only actual exposure to React in terms of writing it is taking someone else's existing project and doing bug fixes in a hurry, and with the syntax being more confusing than enlightening in terms of 'when the fuck am I meant to put it in {} and when am I not because there is no clear reason when/when not in the code in front of me'.
It's not a nonsense. Inline logic has better whipuptitude¹, but worse manipulexity¹, so it depends on what you are up to.
Also good for security holes in actual practice, again I direct you to WordPress. Separating your actual business logic from display-time logic helps solve a whole raft of issues and in practice... isn't much slower than the supposed whipuptitude of intermashing it.
I, like many PHP beginners in the early 00s treated it exactly the way ColdFusion et al treats it: it's first and foremost a templating language with crap glued on. With everything that implies. I stopped treating it as a template language in 2005 and never looked back, except for the times I work in WordPress. And even in WordPress I go out of my fucking way to avoid this.
My theme framework that I build shit in professionally has a template engine grafted into it precisely so I don't have to deal with this bullshit. The other folks who use it are so grateful because they're all pissed off with having to navigate the 'let's jam fragments of things in random PHP files'.
Pretty much everyone in the wider PHP ecosystem moved on from this mindset years ago - the only ones who didn't are WordPress because they're kinda stuck with it, and even they're moving on. It's just too easy to write bad shit that stinks and never gets fixed.
-
@Arantor said in TIL (about the Dark Arts of HTML):
@topspin PHP has mostly moved on from that nonsense unless you’re working in WordPress… but yeah React is precompiled and I still have no idea how it actually works in practice because React feels so fragile and whenever I write it I end up guessing at it until it compiles. Then I guess at it until I get it to behave.
Huh. The CSS of frameworks.
-
-
-
“Stayin Alive” is often taught as the beat to use when performing CPR.
TIL that sometimes, probably mostly Austria, they say to use the beat of the Radetzky March.
-
-
@topspin said in TIL (about the Dark Arts of HTML):
“Stayin Alive” is often taught as the beat to use when performing CPR.
TIL that sometimes, probably mostly Austria, they say to use the beat of the Radetzky March.I feel like "Never Gonna Give You Up" could work too
-
@izzion said in TIL (about the Dark Arts of HTML):
@topspin said in TIL (about the Dark Arts of HTML):
“Stayin Alive” is often taught as the beat to use when performing CPR.
TIL that sometimes, probably mostly Austria, they say to use the beat of the Radetzky March.I feel like "Never Gonna Give You Up" could work too
That's for the Heimlich Maneuver, another thing, like CPR, that you should probably not do.
-
@izzion said in TIL (about the Dark Arts of HTML):
@topspin said in TIL (about the Dark Arts of HTML):
“Stayin Alive” is often taught as the beat to use when performing CPR.
TIL that sometimes, probably mostly Austria, they say to use the beat of the Radetzky March.I feel like "Never Gonna Give You Up" could work too
-
TIL that Gentoos are a kind of penguin. Which fits the theme, of course, so it should not have been that surprising.
-
@Rhywden I seem to recall it was picked specifically because it's supposed to be the fastest penguin?
Fake edit: Wikipedia's article on Gentoo Linux agrees: fastest swimming penguin.
-
TIL that wild pumpkins are (mildly) poisonous.
This is apparently becoming slightly more common here nowadays because we're getting more and more pumpkins for carving at Halloween and those are from varieties not intended for eating and thus actually not good for eating (but people aren't aware (I wasn't!) and sometimes still eat them).
I found out because my SIL was at some sort of big church meeting and amongst the dishes available for dinner was a pumpkin soup, and everybody who ate it got sick. Which meant my SIL (she's a doctor) ended up coordinating some sort of "public emergency" plan with the public health authorities, since there were a couple of hundreds of people overall (not all sick, but quite a few were). times for her.
Also, since it was a church-related event, there was a wiseass who mentioned 2 Kings 4 the next day.
-
@remi yet none of them could chelate on the fly
-
@remi said in TIL (about the Dark Arts of HTML):
TIL that wild pumpkins are (mildly) poisonous.
This is apparently becoming slightly more common here nowadays because we're getting more and more pumpkins for carving at Halloween and those are from varieties not intended for eating and thus actually not good for eating (but people aren't aware (I wasn't!) and sometimes still eat them).
I found out because my SIL was at some sort of big church meeting and amongst the dishes available for dinner was a pumpkin soup, and everybody who ate it got sick. Which meant my SIL (she's a doctor) ended up coordinating some sort of "public emergency" plan with the public health authorities, since there were a couple of hundreds of people overall (not all sick, but quite a few were). times for her.
The actual thing is that these poisonous varieties can cross-breed with your regular pumpkins. If you have been growing edible heirloom varieties in your garden for years but your neighbour has planted a batch of ornamental gourds then bees can spread the pollen to your plants. That year's pumpkins will still be fine (because the pumpkin is mostly formed from the female flower's ovary and has the same genetic material as the rest of the plant), but the seeds might then be a poisonous cross-breed when planted the year after when it starts producing cucurbitacins.
-
TIL: Ornamental gourds aren't just decorative, but also useful for preventing hippies.
-
-
But what if I want to ship a black hole?
-
@Zerosquare Or people...
-
@Applied-Mediocrity said in TIL (about the Dark Arts of HTML):
@Zerosquare Or people...
Not sure if fat joke or dense joke.
-
@Zerosquare Today's XKCD seems relevant:
-
@topspin said in TIL (about the Dark Arts of HTML):
@Applied-Mediocrity said in TIL (about the Dark Arts of HTML):
@Zerosquare Or people...
Not sure if fat joke or dense joke.
-
@topspin said in TIL (about the Dark Arts of HTML):
@Applied-Mediocrity said in TIL (about the Dark Arts of HTML):
@Zerosquare Or people...
Not sure if fat joke or dense joke.
Q.E.D.
-
I'd known that he'd done the calculations but hadn't heard any of these details.
-
@Arantor said in TIL (about the Dark Arts of HTML):
@Bulb said in TIL (about the Dark Arts of HTML):
My understanding is that there is NO native HTML here
You're probably right. My only actual exposure to React in terms of writing it is taking someone else's existing project and doing bug fixes in a hurry, and with the syntax being more confusing than enlightening in terms of 'when the fuck am I meant to put it in {} and when am I not because there is no clear reason when/when not in the code in front of me'.
It's not a nonsense. Inline logic has better whipuptitude¹, but worse manipulexity¹, so it depends on what you are up to.
Also good for security holes in actual practice, again I direct you to WordPress. Separating your actual business logic from display-time logic helps solve a whole raft of issues and in practice... isn't much slower than the supposed whipuptitude of intermashing it.
I, like many PHP beginners in the early 00s treated it exactly the way ColdFusion et al treats it: it's first and foremost a templating language with crap glued on. With everything that implies. I stopped treating it as a template language in 2005 and never looked back, except for the times I work in WordPress. And even in WordPress I go out of my fucking way to avoid this.
My theme framework that I build shit in professionally has a template engine grafted into it precisely so I don't have to deal with this bullshit. The other folks who use it are so grateful because they're all pissed off with having to navigate the 'let's jam fragments of things in random PHP files'.
Pretty much everyone in the wider PHP ecosystem moved on from this mindset years ago - the only ones who didn't are WordPress because they're kinda stuck with it, and even they're moving on. It's just too easy to write bad shit that stinks and never gets fixed.
After reading this I'm convinced most of my team would make just awful PHP developers. Not a days’ experience between them in PHP but I'm confident they would go from complete fuck ups in Java to just fuck ups in PHP.
-
@DogsB said in TIL (about the Dark Arts of HTML):
I'm confident they would go from complete fuck ups in Java to just fuck ups in PHP.
Languages that allow for confusion of ideas,
-
@Arantor said in TIL (about the Dark Arts of HTML):
@Bulb said in TIL (about the Dark Arts of HTML):
It's not a nonsense. Inline logic has better whipuptitude¹, but worse manipulexity¹, so it depends on what you are up to.
Also good for security holes in actual practice, again I direct you to WordPress.
The big difference is that there is no serialization and deserialization going on in React.
React never emits any HTML that would be parsed. It builds the DOM directly with its API. So whenever a function returns a string, it is assigned as
text
of the parent node, so there is no opportunity for HTML or JavaScript injection.
-
TIL: A current-model Folger's can vastly improves a recent-model Samsung phone's bass response, oto 10db.
This is no tonal-quality titchiness, either, it's nearly as good as a proper bassbox. And the distortion is... well, tolerable.
-
-
Deliberately creating a schedule that's so slow-paced that you'll be long dead before it's even 5% complete? Now, that's a nifty trick to bury a project with plausible deniability. I wonder if we could play the same game with IT managers.
-
@Zerosquare said in TIL (about the Dark Arts of HTML):
I wonder if we could play the same game with IT managers.
The project will be completed on February 30
-
@TimeBandit said in TIL (about the Dark Arts of HTML):
The project will be completed on February 30
but what year?
-
@Luhmann said in TIL (about the Dark Arts of HTML):
@TimeBandit said in TIL (about the Dark Arts of HTML):
The project will be completed on February 30
but what year?
Last one was 1712...
-
@Carnage said in TIL (about the Dark Arts of HTML):
1712
I propose a new slave revolt in NY ... it can only improve ...
-
@Luhmann said in TIL (about the Dark Arts of HTML):
@Carnage said in TIL (about the Dark Arts of HTML):
1712
I propose a new slave revolt in NY ... it can only improve ...
Your only option currently is Florida, iirc all other states have got rid even of punitive manumission. But not them.
But, don't forget the key theorem of the 1712 revolt - "Nits breed lice.".
-
-
@Gribnit said in TIL (about the Dark Arts of HTML):
But, don't forget the key theorem of the 1712 revolt - "Nits breed lice.".
What if you grib em?
-
@hungrier how much nits could a Gribnit grib if a Gribnit could grib nits?
-
Send Me To Heaven (officially stylized as S.M.T.H.) is an Android application developed by Carrot Pop which measures the vertical distance that a mobile phone is thrown. Players compete against each other by seeking to throw their phones higher than others, often at the risk of damaging their phones.
According to Svarovsky, the first demo of the game took place at a music festival in Oslo, Norway. Attendees were so enthusiastic with the idea that many began throwing their phones into the air without bothering to download the app.
-
https://youtu.be/IZUotBUzoQ0?t=865
(until ~16'30")… people used to believe they can get a unicorn horn, and if they touch their drink or food with it, it will neutralize any poison in it. Well, in 15th century there was a doctor who said he never saw a genuine one and didn't think it works. So he conducted some rather unethical tests, poisoned a bunch of prisoners that all died. See, it does not work. And was told by majority “no, no, no, it does work, but you don't know what you are talking about.”
… it has important parallels with some garagey current topics that are still banned on YouTube.
-
I already knew about a murder of crows. I wanted to know if that’s also used for ravens. First search results lead me to believe that’s actually called a conspiracy of ravens. But then, it turns out, A Conspiracy of Ravens is the title of a book detailing many such weird names for collectives of birds. Back to ravens, though, they’re apparently called an unkindness of ravens.
English is weird as fuck.
-
@topspin I've always wondered how real most of the collective names are (apart from a few that are well attested, such as a murder, a pride...). To me it sounds like the names for all weird phobias, something that sounds possible but that is never actually used except when listing all those weird things, and which very likely was invented by e.g. one writer, and then copied over from there.
-
@remi Like the factoid about swallowing a murder of spiders while you're asleep
-
@hungrier said in TIL (about the Dark Arts of HTML):
@remi Like the factoid about swallowing a murder of spiders while you're asleep
Indeed. The proper collective term for that quantity is a
fuckton
.
-
@Gribnit said in TIL (about the Dark Arts of HTML):
@hungrier said in TIL (about the Dark Arts of HTML):
@remi Like the factoid about swallowing a murder of spiders while you're asleep
Indeed. The proper collective term for that quantity is a
fuckton
.Bow before me for I am Ḟ̡͉̣̜̭͔͍͔̪̤̥̫͈̪̝͇̰̙ͨ͐̇̏̽̎ͬ̑́̽̐̊ͮ͐̌̐͘͟͢ͅu̷̷̶̡̠̦̣͙̲̜̝̟͚̥͉͙͈͙̘͎̽̒̅́͟ͅc̸̸̷̺͎̤̻͖̫͎͍̩͓̬̮͙̖͍̪̹̥͗ͭ͂̅̓͋ͫͦḳ̺̞̝̹͕͉̞̜͉̬̹̌ͭͮ̂̌ͤͯ̈ͯͦ̒́́̓͌ͯ̀͐ͨ̀͘͜͟ͅͅt̵̨̝̲̪̹̗̰͕̉ͯͤ͌̈́̈̽̑͆́͡ͅǒ̷̡̼̩̘̙̙̮̼̰͛̿̈̐́͜nͩ͐̓ͧ͊ͨ́ͪͯ͆̒͂ͪ͏̷̵͏̼̝̣̼̫̮̥͇̻͍͞.
-
@remi said in TIL (about the Dark Arts of HTML):
very likely was invented by e.g. one writer, and then copied over from there.
I've posted this before, but:
https://youtu.be/S9y4qjNVIMo
-
TIL J. Picard has gone were no man had gone before.
-
TIL C++23 not only gets
std::print
but alsostd::println
, which does what it should.
So after about 25 years, I can finally write Pascal again! Well, plus the boilerplate.(that was writeln, println is Java, but besides the point)