Fork me on GitHub
#off-topic
<
2020-02-17
>
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 https://www.postgresqltutorial.com/, but I've read most of content here.

orestis06:02:17

I’ve bought “the art of PostgreSQL”, it’s an interesting read. The reddit community is also super helpful if you have specific questions.

dharrigan07:02:15

Whilst not PostgreSQL specific, it does have PostgreSQL examples, but this is a useful read: https://use-the-index-luke.com/

dharrigan07:02:23

There is the #sql channel too 🙂

orestis07:02:10

http://www.craigkerstiens.com/ of Citus data fame also has a nice blog

mloughlin11:02:12

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.

mloughlin11:02:01

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 😉

borkdude11:02:41

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

borkdude11:02:05

sometimes I use .impl as part of the key names to indicate this key is an implementation detail

☝️ 4
mloughlin11:02:38

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?

Oz13:02:45

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.

44
teodorlu13:02:27

It's done because it's simple to implement, I guess? Image automatically refers to the latest Clojars release.

💡 4
vemv15:02:06

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

👍 4
souenzzo18:02:26

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

😆 8
Old account18:02:58

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.

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!

seancorfield19:02:30

#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

hindol19:02:14

@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?

pez20:02:47

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.

hindol20:02:06

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
vemv21:02:44

> 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

Jimmy Miller03:02:11

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

hindol06:02:49

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

pez08:02:10

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