This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2015-11-26
Channels
- # admin-announcements (70)
- # aws (1)
- # beginners (17)
- # boot (37)
- # business (1)
- # cider (2)
- # cljs-dev (56)
- # cljsrn (6)
- # clojure (151)
- # clojure-germany (1)
- # clojure-nl (5)
- # clojure-poland (5)
- # clojure-russia (34)
- # clojure-taiwan (1)
- # clojurescript (289)
- # clojurex (2)
- # cursive (16)
- # datavis (3)
- # datomic (12)
- # editors (10)
- # emacs (3)
- # hoplon (17)
- # ldnclj (5)
- # lein-figwheel (12)
- # leiningen (1)
- # liberator (1)
- # off-topic (23)
- # om (116)
- # onyx (39)
- # parinfer (44)
- # portland-or (1)
- # reagent (34)
- # yada (6)
Hi guys, I'm trying to get a duct app with postgres to connect to postgres in another container, but I can't for the life of me figure out it out. I can connect to it in the repl using the straight jdbc driver like (sql/query "
but I can't figure out how to configure the hikaricp component in the same way. I just get a ConnectException every time
nvm.. my container wasn't picking up changes I was making
What do I have to change so this code https://www.refheap.com/112089 is outputtting [ 1 1 2 2 ] instead of [ ( 1 1 ) ( 2 2 )]
Use mapcat
instead of reduce
?
@seancorfield: could be a solution but I think this could be done with reduce only
(mapcat #(conj %1 (repeat amount %2)) list) gives this error : clojure.lang.ArityException: Wrong number of args (1) passed to: core/duplicate/fn--6055
Has anyone taken a look at TJOC's lazy quicksort algorithm:
(defn sort-parts "Lazy, tail-recursive, incremental quicksort. Works against and creates partitions based on the pivot, defined as 'work'." [work] (lazy-seq (loop [[part & parts] work] (if-let [[pivot & xs] (seq part)] (let [smaller? #(< % pivot)] (recur (list* (filter smaller? xs) pivot (remove smaller? xs) parts))) (when-let [[x & parts] parts] (cons x (sort-parts parts))))))) (defn qsort [xs] (sort-parts (list xs)))