This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2023-02-06
Channels
- # announcements (58)
- # babashka (43)
- # babashka-sci-dev (22)
- # beginners (8)
- # biff (8)
- # calva (62)
- # circleci (3)
- # clerk (6)
- # clj-kondo (27)
- # cljsrn (9)
- # clojure (61)
- # clojure-austin (4)
- # clojure-conj (3)
- # clojure-europe (11)
- # clojure-losangeles (2)
- # clojure-nl (2)
- # clojure-norway (4)
- # clojure-spain (5)
- # clojure-uk (2)
- # clojurescript (51)
- # data-science (1)
- # datascript (4)
- # emacs (33)
- # events (14)
- # funcool (14)
- # gratitude (13)
- # introduce-yourself (1)
- # jobs (9)
- # lsp (58)
- # malli (23)
- # missionary (31)
- # nextjournal (9)
- # off-topic (35)
- # proletarian (2)
- # re-frame (5)
- # remote-jobs (7)
- # shadow-cljs (2)
- # spacemacs (7)
- # sql (26)
- # testing (12)
- # vim (1)
- # web-security (3)
- # xtdb (2)
Happy monday Clojurians! Announcing https://github.com/ericdallo/jet.el: Parse edn/json/transit/yaml directly from Emacs using a magit-like interface ✨ Besides the main entrypoint, the package has lots of commands to parse edn and: • copy to clipboard • to a new buffer • print to messages • just paste at cursor Available at MELPA!
Eg, make an interactive command that sets input to JSON, output to EDN, and copies to the clipboard
This is possibly feedback to jet more than this glue, but it would be cool if jet was able to guess the input automatically - seems like it should be possible?
If transit can read both transit-specific JSON and just regular JSON, then there is no big problem? Default behavior with no -i
could be to try to parse as edn, then as transit, then as yml.
nice I use jet extensively for formatting in emacs and converting between json and edn, I will go install, @U04V15CAJ curious if it would be possible to add in other map types like say python dict's as a quick way to convert, between languages I guess custom parsers would be needed ?
@UU67HFS2X What does that look like?
(defun jet-to-clipboard (thing &optional args)
"Run jet for THING at cursor and ARGS copying to clipboard."
,,,)
It’s been a while since I wrote elisp… What’s thing
@UKFSJSM38?Got me wondering now, sure I would have tried the json version, need to go find a python map now and try that
I think where the python map fails is on the values, so you can have functions for example, the json parser does not like those, there maybe other data values but I imagine most are compatible
Usually (jet--thing-at-point)
@U9MKYDN4Q, the region selected or current form at point
@U9MKYDN4Q I improved the readme mentioning how to customize the functions so you can keybind
I ended up with these:
(require 'jet)
(defun copy-edn-as-json ()
(interactive)
(jet-to-clipboard
(jet--thing-at-point)
'("--from=edn" "--to=json"))
(keyboard-quit))
(defun copy-json-as-edn ()
(interactive)
(jet-to-clipboard
(jet--thing-at-point)
'("--from=json" "--to=edn" "--keywordize"))
(keyboard-quit))
(global-set-key (kbd "C-c j e j") 'copy-edn-as-json)
(global-set-key (kbd "C-c j j e") 'copy-json-as-edn)
this is honestly so damn useful @UKFSJSM38 thank you (and thanks again to borkers!)
New: Simple https://en.wikipedia.org/wiki/DBSCAN clustering: • Pure Clojure/Clojurescript implementation Hope it is helpful! :rightwards_hand: 🎁 And more to come :face_with_open_eyes_and_hand_over_mouth: https://github.com/zalky/dbscan-clj
Thanks! I'm releasing a library in the next couple of days for building Re-frame/React apps that includes a visual debugger that overlays graphical elements onto the live application. I needed a simple clustering algorithm for collecting and grouping certain visual elements on the screen.
Would you consider to "bind" your library closer to the upcoming Clojure data science stack by using a "tech.ml.dataset" (a column oriented table) as input data, instead of vector-of-maps TMD is living here: https://github.com/techascent/tech.ml.dataset If this is the case, you could as well considre to integrate the DBSCAN algorithm in one of the existing" collections of algorithms working on the same data format.
Sure, I actually use tech.ml.dataset
quite regularly, it's fantastic. But never thought to connect the two! I'd have to think about what that would entail, are there examples in the code-base of other grouping or clustering bindings I could look at as a pattern to follow?
It should be very easy . The "core" of your algorithm could even stay as is. You would just convert from dataset to vector-of-maps, run your stuff and convert back to a tech.ml.dataset This might come with small performance penalty (versus rebuilding the algorithm using the TMD primitives), but probably negligible. So you just need a functions like yours : https://github.com/zalky/dbscan-clj/blob/bb7aa0fae89cd9c8477278b0aae70e443517284c/src/dbscan_clj/core.cljc#L88 but it takes a "tech.ml.dataset" as input. (and reurn such dataset as well), so things can be chained easely. Probably you need some options to define on "which columns" your clustering is performed.
This new code would be a kind of "adapter" to TMD.
So where "physically" place your original code and teh adapter is a question to answer.
Doing the adapter will require a dependency to tech.ml.dataset
, so maybe you code in
https://github.com/zalky/dbscan-clj
wants to avoid that.
I would maybe even suggest to have the "adapter" standalone, depending on
io.zalky/dbscan-clj {:mvn/version "0.1.0"}
and
techascent/tech.ml.dataset {:mvn/version "7.000-beta-27"}
and it just does the data conversion and calls dbscan
and converts back.
A few lines of code in my view.(one reason being ClojureScript compatibility). TMD is a Clojure library, not compatible with ClojureScript
Yes, I agree with these points. I'll take a bit of a closer look to see what alternatives there are for integrating with tech.ml.dataset
's abstractions. There might be some protocols or interfaces that are easy to implement. Thanks for planting the seed, I don't think I would have made the connection otherwise.
com.walmartlabs/lacinia 1.2 Lacinia is an open-source implementation of the GraphQL specification, in Clojure. GraphQL is an outstanding approach to getting diverse clients and servers exchanging data cleanly and efficiently. GitHub repo: https://github.com/walmartlabs/lacinia Documentation: http://lacinia.readthedocs.io/en/latest/ Lacinia 1.2 fills in some gaps in Lacinia's functionality. Notable changes: • Direct control over the Executor used for callbacks • Subscription streamer functions are now on-par with ordinary field resolver functions by supporting directives and supporting access to the preview API • The entire http://lacinia.readthedocs.io/en/latest/tutorial has been rewritten to be more clear, and use modern standards (such as tools.deps for the build, and using Pascal Case field names). https://github.com/walmartlabs/lacinia/issues?q=is%3Aclosed+milestone%3A1.2
Announcing v0.3.0 of clerk-utils
, a library designed to help write interactive docs like https://clerk-utils.mentat.org with #clerk.
This release adds mentat.clerk-utils.build/{build!,serve!,halt!}
functions for building custom ClojureScript bundles for #clerk. This lets you use ~any JS or CLJS library when writing custom viewers in Clerk. See the interactive docs notebook section on Custom ClojureScript for more detail: https://clerk-utils.mentat.org/#custom-clojurescript-builds
0.3.0 also adds a clerk-utils/custom
#deps-new template (https://github.com/mentat-collective/clerk-utils/tree/main/resources/clerk_utils/custom) for generating a Clerk project with all of the custom ClojureScript stuff baked in. (Here’s https://github.com/mentat-collective/clerk-utils-custom-template.)
• Release notes: https://github.com/mentat-collective/clerk-utils/releases/tag/v0.3.0
• Clojars: https://clojars.org/org.mentat/clerk-utils
• Github: https://github.com/mentat-collective/clerk-utils
https://github.com/quoll/donatello v0.0.1 A simple Turtle writer. This library converts basic Clojure structures into formatted turtle files. It accepts nested maps, such as used by Asami, or identifiers paired with simple maps. For simplicity, keywords are treated as QNames/CURIEs, and will be written out this way.
what's a Turtle in this context?
ahhh ok
I really don't know much about RDF
thanks 😊
maybe I should read about it
so ask you instead?? 😜
I’m more than happy to help. But if you want something to read, you can start https://www.w3.org/TR/rdf11-primer/
Well, the partner library (for parsing Turtle files) is called https://github.com/quoll/raphael