Fork me on GitHub
Ahmed Hassan06:02:06

What are great resources for learning PostgreSQL from intermediate to advanced level? Official docs are very dense. (Or I'm approaching docs wrong way?)

Ahmed Hassan06:02:56

There's also, 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:


There is the #sql channel too 🙂

orestis07:02:10 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)
(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

☝️ 4

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.

💡 4

I guess one could extend to also change I have implemented a little something along those lines

👍 4

pigeon is the JVM The wings are the class/type system

😆 8

New community chat on Telegram intended to be like IRC just more async and mobile friendly. So you can chat on the go.

Michael J Dorian19:02:45

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

Michael J Dorian19:02:05

Thanks, I'll at least join it for now simple_smile


@pez I was super impressed by your thread on prime sieve: I am now totally hung up on optimizing a prime factorization sieve: 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%.

calva 4

> 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 machine


(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.


doseq seems to use loop internally. Not sure if it retains the primitive-ness of numbers though. It will be good to know.


BTW. The experience from this exercise helped land me a Clojure job. At least it played a part in it.