This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2022-07-06
Channels
- # aleph (1)
- # announcements (3)
- # asami (32)
- # aws (12)
- # babashka (6)
- # beginners (43)
- # calva (36)
- # cider (3)
- # clj-kondo (3)
- # cljs-dev (2)
- # clojars (6)
- # clojure (66)
- # clojure-europe (14)
- # clojure-uk (2)
- # clojurescript (12)
- # conjure (1)
- # core-async (27)
- # cursive (17)
- # data-science (9)
- # datahike (1)
- # datomic (28)
- # emacs (34)
- # events (1)
- # girouette (3)
- # jobs (1)
- # klipse (4)
- # lsp (26)
- # malli (5)
- # off-topic (38)
- # portal (1)
- # releases (1)
- # shadow-cljs (72)
- # sql (7)
- # tools-deps (5)
- # vim (9)
- # xtdb (18)
Any reference repository of "testing java code with clojure"?
I don't wanna use clj
or lein
, I'm trying to keep at mvn/pom
There is a maven plugin offering integration - https://github.com/vivid-inc/clojure-maven-plugin but I’m not sure if it does what you asked though
zach tellman made some functional data structures in java and uses clojure to test. I’m trying to find them
ah, but he uses a very traditional clojure project structure to test: https://github.com/lacuna/bifurcan
Bit of a basic-CS question: I’m looking for a function that I give a variable length string, and produces a consistent-but-arbitrary value in a small range. A bit like Java’s hashCode, but limited in range, and less serial.
Yeah I know, but … I cant find an easy one with a diffusion property like I want
This is what I meant, found it while looking around FNV1: https://en.wikipedia.org/wiki/Avalanche_effect
I mean, Java’s hashcode gives serial values for “a”, “b”, “c”, … I dont want that.
No, he meant the other hash function, not the one that Java uses for Objects. For instance SHA256.
user=> (hash "a")
1455541201
user=> (hash "b")
516420758
user=> (hash "c")
1219591486
user=>
ah sure
if I need to write hash function the fnv family is simple to implement, but not great
It doesn’t need to be great, it just needs to produce convincible “unpredictable” values for alphabetical data
Yeah fnv looks exactly like what I want, thanks!
Is it me or the developer that wrote this into code was... let's say... paranoid? They have three references to shadowRoot (Thanks, now I learned what it is). But well... they really didn't want you to find the elements that are inside that tree. And they also had one shadowRoot subtree just to confuse the searcher. I'm shocked. Also why does shadowRoot even exist...
The idea of shadow roots is to be able to encapsulate components in much the same way native html elements do (like input, text area, …)
So you shouldn’t care about their internals
I know. But there is some kind of a dread when I try to find elements using document.querySelectorAll
and... there is nothing. And then you look for iframes and there are none.
(You are lucky btw, that the shadow roots are “open”, if someone really wants you to stop looking inside, thats also an option to close them that you are discouraged to use)
Doesn't that mean that a closed shadow DOM becomes a closed iframe?
.shadowRoot
returns null if closed
Not so sure about the intricacies of iframes tho
Yes but if it's closed it still spins under the hood. And then it's as you said -- you can't get in to inspect it. And you can have some malware but DOM wouldn't even show that anything is there. 😕
well behaving webcomponents allow you to compose them using slots, so in the ideal world you shouldn’t have to query inside their shadow root. From the outside you manage the host (say ‘theme-builder’) and its children (‘custom-base’ or whatever), and the webcomponent projects those children inside its shadow root via slots.
(this example, clearly, is not implemented that way, they probably put too much in the shadow root of theme-builder
, that you wanted to get out again :p)
They've put everything into the shadow root. In the top-level of the document they had a shadow-root and two empty divs 😄
Yeah, thats not how thats supposed to work lol :’)
Anyway. It's an alternative to obfuscation... but why then they didn't do code obfuscation :thinking_face: Probably then that's some kind of component-based framework... Maybe we're missing out here...
or better yet, start a "clojure-memes" channel?