This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2023-12-11
Channels
- # adventofcode (33)
- # babashka (1)
- # beginners (11)
- # biff (3)
- # calva (2)
- # cider (24)
- # clj-kondo (9)
- # cljfx (5)
- # clojure (39)
- # clojure-austin (2)
- # clojure-europe (11)
- # clojure-nl (1)
- # clojure-norway (22)
- # clojure-uk (10)
- # community-development (18)
- # data-science (24)
- # datahike (3)
- # events (3)
- # hyperfiddle (11)
- # lsp (22)
- # malli (3)
- # matrix (1)
- # off-topic (24)
- # other-languages (3)
- # overtone (7)
- # pathom (5)
- # reitit (2)
- # shadow-cljs (34)
- # sql (20)
- # squint (13)
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
As usual, shims to the rescue. :) https://www.npmjs.com/package/set.prototype.difference
so it seems to be a recent addition, although the docs pretend that it's generally available
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.
the icon appears on the left, not in the section about those methods itself which is what I was reading
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.
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 :)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?
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.
Too bad I don’t know any Java. But good to know that it’s not a drop-in replacement for mod_xsendfile