This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2020-02-17
Channels
- # announcements (1)
- # aws (40)
- # babashka (37)
- # beginners (305)
- # chlorine-clover (15)
- # cider (5)
- # cljs-dev (40)
- # clojure (62)
- # clojure-europe (13)
- # clojure-nl (4)
- # clojure-spec (10)
- # clojure-sweden (2)
- # clojure-uk (59)
- # clojurescript (9)
- # core-async (13)
- # cursive (5)
- # data-science (2)
- # datascript (2)
- # datomic (29)
- # emacs (8)
- # fulcro (58)
- # lambdaisland (9)
- # leiningen (2)
- # lumo (3)
- # mid-cities-meetup (1)
- # midje (1)
- # off-topic (28)
- # shadow-cljs (32)
- # spacemacs (3)
- # sql (5)
- # tools-deps (1)
- # tree-sitter (1)
- # vscode (2)
- # yada (2)
What are great resources for learning PostgreSQL from intermediate to advanced level? Official docs are very dense. (Or I'm approaching docs wrong way?)
There's also https://www.postgresqltutorial.com/, but I've read most of content here.
I’ve bought “the art of PostgreSQL”, it’s an interesting read. The reddit community is also super helpful if you have specific questions.
Whilst not PostgreSQL specific, it does have PostgreSQL examples, but this is a useful read: https://use-the-index-luke.com/
http://www.craigkerstiens.com/ of Citus data fame also has a nice blog
Happy Monday!
What do Clojurians think about hiding the implementation of a data-structure vs "it's just data"?
For example, the first chapter of Elements of Clojure has a moon map of the solar system: { :sol { :jupiter { :callisto { ... } }}}
The author writes a function that effectively aliases get-in, introducing indirection:
(get-jovian-moon m :callisto)
vs
(get-in m [:sol :jupiter :callisto])
On the one hand, I see the benefit of hiding the implementation to outside callers of the lib, but on the other hand, defining the function get-jovian-moon
is transferring explicit knowledge from the structure of the data into implicit knowledge, coupling the data to the function.My object oriented brain tells me get-jovian-moon
is great because Clean Code tells me to make as many small functions as humanly possible, using their names as self-documentation 😉
if the data organization is an implementation detail that is subject to breaking changes, but the API functions are stable, I think it's good to document that
sometimes I use .impl
as part of the key names to indicate this key is an implementation detail
is it normal to have a canonical form of data that acts as an interface (and adheres to all the versioning/API stability rules that implies) in addition to .impl structures?
Is it just me thinking that the commonly seen clojars links are silly? I mean, it's an image of the text that I usually, want to copy, and I need to click it and then copy it from another page.
It's done because it's simple to implement, I guess? Image automatically refers to the latest Clojars release.
I guess one could extend https://github.com/technomancy/leiningen/blob/47243751579ae4cc198650b717c7ba75a9326c09/doc/DEPLOY.md#overriding-the-default-release-tasks to also change
README.md.
I have implemented a little something along those lines
New community chat on Telegram https://t.me/Clojurasts intended to be like IRC just more async and mobile friendly. So you can chat on the go.
Hey friends, got tips for finding clojure gigs? Are there technologies that everyone wants to see on the resume? Concepts clojure veterans are going to look for that a reformed php dev might not have encountered yet? I'm pretty thrilled with clojure, coming from a 6 year php background, it's just such a joy to write in. I'm just shy of 200 commits into my genetic algorithm based game project I've been doing, but I'm not sure if that's considered much of a qualification by itself! Thanks!
#jobs-discuss is a good channel for those sorts of discussions, if you don't get much feedback here @doby162
Thanks, I'll at least join it for now
@pez I was super impressed by your thread on prime sieve: https://clojureverse.org/t/eratosthenes-party-time-a-k-a-feedback-wanted-on-this-implementation-of-eratosthenes-sieve/3801/7 I am now totally hung up on optimizing a prime factorization sieve: https://gist.github.com/Hindol/e2a3f724b19b07186945e981cdce3e15 You or anyone else want(s) to take a shot at it?
Haha, @hindol.adhya, it really is rabbit hole! I had so much fun with that. I hope we can inspire more people to have a go.
Unfortunately, I am already deep in the rabbit whole. Spent so much time trying out different things today. By the way, thank you for your work on Calva. Loving it 100%.
> If I mash it into a vector afterwards (bitset->vec), it takes me 1220 msecs, so it seems faster to avoid immutable data structures here
Actual bottleneck was the lack of type hint in bitset->vec
argv :)
One also can shave a few msecs by prefering transducers to ->>:
(defn bitset->vec [^java.util.BitSet bs]
(into []
(filter (fn [x] (.get bs x)))
(range (.size bs))))
29ms on my machineI had to learn that later, @U45T93RA6 😃 https://clojureverse.org/t/how-to-efficiently-convert-a-java-bitset-to-a-vector/5264
(defn primes [n]
(let [sieve (boolean-array n true)]
(doseq [p (range 3 (int (Math/ceil (Math/sqrt n))) 2)]
(when (aget sieve p)
(doseq [i (range (* p p) n (* p 2))]
(aset sieve i false))))
(filterv #(aget sieve %) (cons 2 (range 3 n 2)))))
Takes about 14-17 milliseconds on my machine (after warm up). You can cut the space requirement in half with the sieve by only putting in odd numbers. I have a python version that does that but didn’t bother here.
This seems to run at least as fast the other versions I’ve seen listed and is, I think, much more straight forward.