TIL (about the Dark Arts of HTML)
-
Don't put semicolons in T-SQL. Kept getting inexplicable errors when trying to create a stored procedure, then accidentally left out a semicolon and realized what was going on.
-
@boomzilla T-SQL is a $pecial
-
I love the dedication put into this joke:
https://en.wikipedia.org/wiki/They're_Coming_to_Take_Me_Away,_Ha-Haaa!
B-side
Continuing the theme of insanity, the flip or B-side of the single was simply the A-side played in reverse, and given the title "!aaaH-aH ,yawA eM ekaT oT gnimoC er'yehT" (or "Ha-Haaa! Away, Me Take to Coming They're") and the performer billed as . Most of the label affixed to the B-side was a mirror image of the front label (as opposed to simply being spelled backward), including the letters in the "WB" shield logo. Only the label name, disclaimer, and record and recording master numbers were kept frontward. The reverse version of the song is not included on the original Warner Bros. album, although the title is shown on the front cover, where the title is actually spelled backward.In his Book of Rock Lists, rock music critic Dave Marsh calls the B-side the "most obnoxious song ever to appear in a jukebox", saying the recording once "cleared out a diner of forty patrons in two minutes flat."
I'll link the (moderately safe) original instead:
-
Status: TIL X (in Linux) treats NumLock as a modifier key that affects all keyboard and mouse keys.
This means that, (for example) in the eyes of X, a mouse click with Num Lock enabled is totally different than a mouse click with it disabled.
I guess it's consistent but wow...
The place I learned this factoid from is from the on-prem Stack Overflow, where someone was confuzzled at why some buttons on their FVWM panel would work with Num Lock on and some would not.
-
@Tsaukpaetra If it's a modifier, then it gets mapped to a bit in the
state
field of the event (present inXKeyEvent
,XButtonEvent
,XMotionEvent
andXCrossingEvent
). Some of those bits are more useful than others; the one for NumLock is one of the less relevant ones IIRC…
-
@Tsaukpaetra said in TIL (about the Dark Arts of HTML):
mouse click with Num Lock enabled is totally different than a mouse click with it disabled.
It's not totally different. It just has a bit set somewhere. An application that does not ignore that bit for mouse is .
-
@dkf said in TIL (about the Dark Arts of HTML):
the one for NumLock is one of the less relevant ones
Basically the
X
{mb
,wc
,utf8
}LookupString
functions are the only ones that are ever supposed to look at it. Because the event itself only contains the scan code, so that function needs the flag to know whether to resolve the numeric keypad key to the digit or to the arrow.
-
@Bulb said in TIL (about the Dark Arts of HTML):
Basically the X{mb,wc,utf8}LookupString functions are the only ones that are ever supposed to look at it. Because the event itself only contains the scan code, so that function needs the flag to know whether to resolve the numeric keypad key to the digit or to the arrow.
You need the information elsewhere so you can do things like Shift-Click handling. You don't want to track the modifier state model by hand.
-
@dkf The field as a whole, yes. That particular bit in it, no. But it's easy to fumble the masks if you are not paying attention.
-
@Bulb said in TIL (about the Dark Arts of HTML):
it's easy to fumble the masks if you are not paying attention.
-
@JBert said in TIL (about the Dark Arts of HTML):
I love the dedication put into this joke:
https://en.wikipedia.org/wiki/They're_Coming_to_Take_Me_Away,_Ha-Haaa!
B-side
Continuing the theme of insanity, the flip or B-side of the single was simply the A-side played in reverse, and given the title "!aaaH-aH ,yawA eM ekaT oT gnimoC er'yehT" (or "Ha-Haaa! Away, Me Take to Coming They're") and the performer billed as . Most of the label affixed to the B-side was a mirror image of the front label (as opposed to simply being spelled backward), including the letters in the "WB" shield logo. Only the label name, disclaimer, and record and recording master numbers were kept frontward. The reverse version of the song is not included on the original Warner Bros. album, although the title is shown on the front cover, where the title is actually spelled backward.In his Book of Rock Lists, rock music critic Dave Marsh calls the B-side the "most obnoxious song ever to appear in a jukebox", saying the recording once "cleared out a diner of forty patrons in two minutes flat."
I'll link the (moderately safe) original instead:
And for anyone interested in subjecting themselves to the B-side reversed version, but too to look it up:
https://www.youtube.com/watch?v=lfu58_fIPnA
-
Today I learned that IOS has glyphs for Egyptian hieroglyphs. Like I knew that 𓂀 (Eye of Horus) was in spec but that I’d never seen it rendered by the browser before.
I guess Gribnit’s nonsense is good for something, if only accidentally.
-
@Arantor surrealist performance art is rarely appreciated by contemporaries.
INB4 someone tells me I'm wrong because I make my shitposting up on the spot instead of fact checking it first.
-
@topspin I’ll give you that it’s performative, and I’ll give you that it’s surrealist.
But, to quote George from the Ukulele Orchestra of Great Britain, from his days at the art department at the university of Heidelberg, “is it art or is it rubbish?”
I find myself contemplative in general, because some of the posts come so close to the vicinity of an actual point (say, within the same room as one), and others are so theatrically overblown that to describe them as missing the mark implies they were ever in the same vicinity (say, within the same continental land mass as one)
Then again, I am a fool, and a dreamer, who seeks to find the meaning in all things; The Hanged Man card writ large.
But some days I’m simply appreciative of learning something random, obscure and trivial to the marginal edge of banality.
-
@Arantor said in TIL (about the Dark Arts of HTML):
Today I learned that IOS has glyphs for Egyptian hieroglyphs. Like I knew that 𓂀 (Eye of Horus) was in spec but that I’d never seen it rendered by the browser before.
Today I learned the Egyptian Hieroglyphs are part of the core font set.
… I am wondering though, is iOS freeloading on the work done by Google (the “No Tofu” fonts come from Google), or would it be sufficiently insulting Apple's pride that they got their own?
-
@Bulb as they say in related fields, you need to keep your eye on the blit.
-
@Bulb looks like it's Google Noto alright. MacOS definitely ships that with current iterations and it looks the same on my iPad but obviously I can't prise the lid off to see what's in it.
(Note this is not an excuse to bash Apple ad nauseum. No-one needs that. I'm certain I can't just pop the lid on most mobiles to see what fonts are installed locally and if installing an app is fair game, I can do that on both platforms just fine.)
-
𓁲 𓁆 𓀻
𓁇 𓁅 𓀣 𓀿
-
@Arantor said in TIL (about the Dark Arts of HTML):
looks like it's Google Noto alright.
wins over pride – fairly expected.
-
@hungrier said in TIL (about the Dark Arts of HTML):
𓁲 𓁆 𓀻
𓁇 𓁅 𓀣 𓀿
-
@Zerosquare I guess you don't have the Egyptian hieroglyphs in your font
-
@hungrier is this... a sack of doorknobs?
-
TIL "Zulu time" is another word for UTC. Despite that the actual timezone of Zulu is Central Africa Time (UTC+2).
-
@Zerosquare You can't see it? Your loss.
-
I can't decipher hieroglyphs anyways.
-
@Gąska said in TIL (about the Dark Arts of HTML):
TIL "Zulu time" is another word for UTC.
-
@Gąska I've always assumed it's Zulu as in "Z in the phonetic alphabet", with no relation to any particular place. (other than the relevant meridian)
Edit:
-
https://en.wikipedia.org/wiki/List_of_military_time_zones said:
Military time zones are defined in the ACP 121(I) standard,[1] which is used by the armed forces for Australia, […]
The letters are assigned to whole hours only, but Australia has zones with half-hour offset, so there seems to be something missing…
-
@dkf Interestingly, Quebec time zone is actually the timezone that Quebec is in (at least for half the year), but India time zone doesn't correspond to India
-
@Gąska said in TIL (about the Dark Arts of HTML):
TIL "Zulu time" is another word for UTC. Despite that the actual timezone of Zulu is Central Africa Time (UTC+2).
But you don't want to be there at dawn.
-
TIL I'm not supposed to win that conquest of Ethiopia at the beginning of my Hearts of Iron campaigns if I want to remain historically accurate.
-
TIL something about dynamic linking and ABI for generics in swift:
Or maybe not so much. It can be mostly partitioned in 1) general stuff I already knew, 2) stuff I didn't understand, and 3) stuff that would have been more understandable by giving a C version of what that ABI actually boils down to (as is done in the beginning). Still kind of interesting.
AFAIUI, seems to be a compromise of "know everything statically and monomorphize" and "do everything dynamically", where the former is used inside the library and the latter at library boundaries.I also learned that apparently the pendulum has swung back to CoW. I thought the consensus had been that's actually not great for performance and so people had mostly gone back to preferring copies.
And TIAL, since I looked it up after guessing that's what it means from just looking at the code snippets, that swift has two names for function parameters: argument labels (the name used when calling the function) and parameter names (the name used in the body of the function). The argument label defaults to the parameter name if only one is given, and you can completely omit it with
_
.
Why two names? Guess the answer to that lies in the following:
"If a parameter has an argument label, the argument must be labeled when you call the function."
-
@topspin said in TIL (about the Dark Arts of HTML):
I also learned that apparently the pendulum has swung back to CoW. I thought the consensus had been that's actually not great for performance and so people had mostly gone back to preferring copies.
That depends on whether you have cheap operations for determining whether to make a copy, which is a tremendously subtle problem that tangles very deeply into the thread model. Basically, if memory is only used by a single thread then you don't need to have any locks associated with any reference counts it uses, and checking if something is unshared is just a matter of reading one field and the compiler can probably optimise a lot of the refcount management noise out. If you can avoid copying when you're the only reference holder, you save a lot of time and effort; this matters both for small values (because they're really common) and big ones (because they're naturally costly to copy).
Once you go multithreaded in the handling of an object, the “is this shared?” decision becomes a huge pain in the ass that dominates all design decisions relating to it.
-
@topspin said in TIL (about the Dark Arts of HTML):
I also learned that apparently the pendulum has swung back to CoW. I thought the consensus had been that's actually not great for performance and so people had mostly gone back to preferring copies.
My understanding is that C++ actually switched to always copying
std::string
because copy-on-write can't be actually implemented correctly in the face of mutable indexing.@dkf said in TIL (about the Dark Arts of HTML):
Once you go multithreaded in the handling of an object, the “is this shared?” decision becomes a huge pain in the ass that dominates all design decisions relating to it.
Many languages do copy on every write, which I'd still call CoW. As in, it's still not copy all the time like
std::string
.
-
@Bulb said in TIL (about the Dark Arts of HTML):
@topspin said in TIL (about the Dark Arts of HTML):
I also learned that apparently the pendulum has swung back to CoW. I thought the consensus had been that's actually not great for performance and so people had mostly gone back to preferring copies.
My understanding is that C++ actually switched to always copying
std::string
because copy-on-write can't be actually implemented correctly in the face of mutable indexing.What do you mean by that? It was unspecified pre-11 and gcc actually had CoW. Qt’s QString still does. They changed the spec in a way that doesn’t allow it in C++11, as far as I can tell, not because CoW was impossible to do right but because the alternative was considered preferable. (I mean, it’s now technically impossible, but that’s due to the spec.)
-
@topspin Gcc did do CoW at one time, but I believe they dropped it quite some time before C++11 not because it was slower, but because it was a massive footgun. And that it got defined also for that reason and not for performance.
-
@Bulb the foot gun part is certainly true, as you get a lot more iterator invalidation in unexpected ways.
-
@topspin Regarding performance, the copies (especially the allocations) are still quite a bit more expensive than the reference counting, but since the reference counting is not free either, most code already used const references whenever possible, and then most copies only happen when the content will end up being copied anyway and removing the copy-on-write optimization didn't bring much penalty.
But for languages that don't distinguish between owned and borrowed instances, copy-on-write is pretty much essential. At least copy-on-every-write (i.e. the objects are immutable) like Java or Python do.
-
@Bulb said in TIL (about the Dark Arts of HTML):
But for languages that don't distinguish between owned and borrowed instances, copy-on-write is pretty much essential.
It greatly reduces the amount of memory allocation activity required and the number of buffer copies. The trick is that if all values are immutable, you don't need to track ownership at all, just reference counts. (Typically you don't implement low level data structures using that model, such as cells in a doubly-linked list, and instead have the overall list be the logical holder of the references to its contents.)
If you're able to guarantee that the value hasn't been shared with another thread, reference counting is pretty cheap; it's just a counter sitting beside the pointer (probably in the same cache row). It also allows you to decide whether you're dealing with an actually unshared reference, letting you skip the copy part of a copy-on-write in many situations that really do come up in practice a lot. But logical immutability is still pretty good; it means that values don't change unexpectedly if you have a reference to them and that gets rid of whole classes of common weird bugs in programs. The primary downside is that the data structures you can build within the model are restricted to being acyclic.
Yes, I do know rather a lot about this as a topic.
-
@dkf Back many years ago when I was looking at Vala, I remember someone did some comparison with C# and was somewhat surprised the Vala code (using reference-counting) was a bit slower than the C# code even in Mono with it's fairly poor garbage collector. The reference counting wasn't that cheap.
-
@Bulb They were probably copying too much. It's easily done. Either that or they were boxing numbers, which is ghastly expensive, a 5–10× slowdown. That's also the primary source of slowdown in most scripting languages. (Except Python, which carries around a few extra boat anchors like the GIL as well.)
-
@dkf No, Vala transpiles to C with libgobject for objects. Ints are just plain old dumb C ints there. I think there was even a profile showing that the
g_object_ref
andg_object_unref
are fairly significant. Might be because they weren't inlined though.
-
@Bulb said in TIL (about the Dark Arts of HTML):
Might be because they weren't inlined though.
Oh yes, that'd have a big impact.
-
@dkf … even now the functions are exported by
libgobject-2.0.so
, so yeah, almost certainly not inlined. Not a big problem when programming in C, because the programmer just relies on the object being owned elsewhere and does not increment and decrement the ref-counts, but in Vala they'd generally be generated for all returns and local variables (variables can be declared asowned
orunowned
and ref-count isn't incremented for the later, but by default only arguments are unowned (as it's obvious the caller must have a reference) and everything else defaults to owned.
-
TIL instant brain reward system stimulation button is not only a real thing, but has been around for decades. Also TIL curing gay with electric shocks is more than a meme - it actually works!
-
TIL this is a thing https://en.wikipedia.org/wiki/Employee_Appreciation_Day
TIAL my company is celebrating it. I wonder how well it would go if I ask to be appreciated by getting an extra paycheck.
-
@Gąska Wow.
Maybe the scariest thing in that article is how experimenters didn't really seem to give much fuck about the patient's health:
At its most frequent, the patient self-stimulated throughout the day, neglecting personal hygiene and family commitments. A chronic ulceration developed at the tip of the finger used to adjust the amplitude dial and she frequently tampered with the device in an effort to increase the stimulation amplitude. At times, she implored her to limit her access to the stimulator, each time demanding its return after a short hiatus. [...] compulsive use has become associated with frequent attacks of anxiety, depersonalization, periods of psychogenic polydipsia and virtually complete inactivity.
That seems pretty bad. So obviously they stopped the experiment as soon as they noticed it, right? Right?
During the past two years
-
This post is deleted!
-
TIL about Juhyo:
It's not unique to that place though, Finland for example has it as well:
A phenomenon similar to juhyo is observed in Finland at the Riisitunturi National Park. The Finnish call it “tykky”.
-
@JBert said in TIL (about the Dark Arts of HTML):
TIL about Juhyo:
It's not unique to that place though, Finland for example has it as well:
A phenomenon similar to juhyo is observed in Finland at the Riisitunturi National Park. The Finnish call it “tykky”.
Cool.