Fork me on GitHub
#off-topic
<
2023-12-11
>
borkdude10:12:15

The Set Object provides some methods like difference https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Set#set_composition but ... where? When I try this out in the browser console I don't see these

thomas10:12:36

dang... Safari supports this and nothing else (basically)

borkdude10:12:40

so it seems to be a recent addition, although the docs pretend that it's generally available

p-himik10:12:17

Which docs?

p-himik10:12:02

On the page that you linked, the difference method is marked as experimental and is also mentioned in the browser support table at the bottom as being largely unsupported ATM.

borkdude10:12:59

oh so that's what they mean with that icon

borkdude10:12:18

I'm clearly not awake yet

p-himik10:12:47

Hower over it with your mouse for a second to get a descriptive tooltip. :)

borkdude10:12:34

the icon appears on the left, not in the section about those methods itself which is what I was reading

borkdude10:12:46

I more of text person than an icon with tooltips guy

p-himik10:12:36

Right. But that method also has a dedicated page where it's laid out in more detail, in plain text. Not every single mention of difference shows it as an experimental method, true, but most do mark it as such.

👍 1
borkdude13:12:34

Since this is off-topic I feel entitled to respond with an off-topic JS question.

const seqFrom = ["a","b","c","d"];
const startIdx = seqFrom.indexOf("b"); // 1
seqFrom.splice(startIdx, seqFrom.length - 1);
console.log('huh', seqFrom); // ["a"] instead of ["b","c","d"]
why does seqFrom become [a] here instead of [b,c,d]. Again, I'm having a bad Monday probably, but thanks :)

borkdude13:12:18

and again I didn't read the docs of splice properly facepalm

👍 1
thomas13:12:24

docs can be very confusing

Mno17:12:19

Ask chatgpt to read docs for you but only on Monday mornings

Mno17:12:40

Or if it's Kafka javadocs

DrLjótsson12:12:42

Anyone familiar with range http file responses? We use the Apache mod_xsendfile to "stream" audio and video files but it would prefer to use a Clojure solution. I've found this script https://gist.github.com/tawus/1835734a47bea6cbb5e1 which works well to stream audio files, so it should also work with video files. But does mod_xsendfile use caching or other techniques to improve performance/reduce load on the server and is therefore preferable?

jonahbenton14:12:09

It's been a long time but I recall mod_xsendfile using mmap and maybe zero copy so the kernel side file system buffer was used to ship directly out on the network without bringing the data up into userspace. java.nio should support zero copy techniques. That script definitely brings data up into userspace and makes it subject to JVM GC, then sends it back down, so it would be much more expensive at scale.

💯 1
👍 1
DrLjótsson20:12:41

Too bad I don’t know any Java. But good to know that it’s not a drop-in replacement for mod_xsendfile