This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2023-01-27
Channels
- # announcements (4)
- # asami (6)
- # aws-lambda (1)
- # babashka (38)
- # babashka-sci-dev (20)
- # beginners (87)
- # calva (67)
- # cider (19)
- # clerk (13)
- # clojure (102)
- # clojure-europe (52)
- # clojure-filipino (1)
- # clojure-hungary (4)
- # clojure-nl (1)
- # clojure-norway (6)
- # clojure-sweden (3)
- # clojure-uk (1)
- # cursive (13)
- # data-science (7)
- # datomic (8)
- # deps-new (1)
- # emacs (3)
- # fulcro (16)
- # graphql (3)
- # humbleui (3)
- # kaocha (3)
- # leiningen (3)
- # malli (3)
- # off-topic (14)
- # pathom (34)
- # polylith (4)
- # rdf (12)
- # reitit (3)
- # releases (1)
- # remote-jobs (7)
- # rum (2)
- # sci (22)
- # shadow-cljs (115)
- # tools-deps (26)
- # tree-sitter (29)
As a German, I feel that this account often is not very accurate. But Moin! 😁
German-ness confirmed 😅
my only time speaking German to native speakers was in Scotland and they all teased me for saying Ich rather than Ish
I don‘t think anybody should be teased for speaking a foreign language. And „Ich“ vs „ish“ is a local thing, too, so you just had a different dialect 😉
I think the cultural and geographical borders between Denmark and Germany are not that sharp. In the Schleswig Holstein Region in Germany there is even a party in the regional parliament which represents the ethnically danish people
yeah, we also have a small German-speaking minority in Southern Denmark. I actually think they're quite defined compared to how it was historically (pre-1920) since the northern parts of Germany used to be primarily German-speaking territory of Denmark prior to the conquests of Prussia.
the 1920 vote is IMO quite unique and effective in how it resolved that border dispute, even if Denmark was ultimately made smaller
And it’s also rare that there are cultural minorities on both sides of the border and nobody seriously thinks or campaigns that they have claims on that land, seems really civil. Well, aside from that hog fence
morning
Morning!
Morning! Today I am dealing with a huge tree of data and need to find paths to all nodes that satisfy a predicate. Any tips? 🙏
Morning!
You could use https://github.com/aysylu/loom perhaps? nodes-filtered-by
and some pathfinding
I did not know about that, will have a look. Though I’d prefer adding a library.
impossible to give good advice without knowing the data structure you have now
walk gives you the form but not location
Well, maps and vectors nested in each other 🙂 Thx, have never really used zippers, will have a look
you can loop through a zipper, pause and navigate the tree from any point to have a look around, before you keep looping. The trade-off is that you need to build a little bit of imperative code to make the machine work.
Pretty good intro by @U07FP7QJ0: https://lambdaisland.com/blog/2018-11-26-art-tree-shaping-clojure-zip
@U0522TWDA Ah, okay. In many tree contexts, you've got a parent pointer from each node that you can trivially run up to the root. If you have a downward-only tree, you'll have to follow paths down from the root. Will there be nodes that satisfy the predicate beneath other nodes that satisfy the predicate? And, if so, what do you want to happen there?
jq has a paths function which I may or may not want to include in jet: https://github.com/borkdude/jet/issues/124
The predicate in this case only applies to leaf nodes Thank you all!
@U0522TWDA I'm now working on jet and I want to include this function in jet, like the jq one. Good timing.
$ echo '{:a {:b [1 2 3 {:x 2}] :c {:d 3}}}' | clojure -M -m jet.main -t 'jet/paths'
[[:a]
[:a :b]
[:a :c]
[:a :b 0]
[:a :b 1]
[:a :b 2]
[:a :b 3]
[:a :b 3 :x]
[:a :c :d]]
wonderful!
I'm thinking about something like this: return maps so you can do more stuff with the results
$ echo '{:a {:b [1 2 3 {:x 2}] :c {:d 3}}}' | clojure -M -m jet.main -t '(jet/paths {:pred odd?})'
({:path [:a :b 0], :val 1}
{:path [:a :b 2], :val 3}
{:path [:a :c :d], :val 3})
Or maybe just:
$ echo '{:a {:b [1 2 3 {:x 2}] :c {:d 3}}}' | clojure -M -m jet.main -t '(jet/paths) (filter #(and (number? (:val %)) (odd? (:val %))))'
({:path [:a :b 0], :val 1}
{:path [:a :b 2], :val 3}
{:path [:a :c :d], :val 3})
and not even the :pred
option@U0522TWDA I've now published a new #CM5HRADAA version with the jet/paths
function
Thank you! I'll give it a try when I'm online