This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2017-10-23
Channels
- # aws-lambda (1)
- # bangalore-clj (3)
- # beginners (80)
- # boot (8)
- # clojars (1)
- # clojure (200)
- # clojure-dev (37)
- # clojure-greece (26)
- # clojure-italy (11)
- # clojure-norway (3)
- # clojure-russia (14)
- # clojure-spec (21)
- # clojure-uk (30)
- # clojurescript (50)
- # core-logic (10)
- # core-matrix (1)
- # cursive (15)
- # data-science (21)
- # datomic (45)
- # devcards (2)
- # emacs (4)
- # fulcro (12)
- # garden (2)
- # jobs (5)
- # juxt (1)
- # lambdaisland (1)
- # leiningen (4)
- # luminus (20)
- # lumo (26)
- # off-topic (33)
- # onyx (27)
- # parinfer (1)
- # pedestal (3)
- # perun (5)
- # re-frame (20)
- # reagent (27)
- # ring (1)
- # ring-swagger (21)
- # shadow-cljs (259)
- # spacemacs (14)
- # yada (3)
morning
it worked before I went on holiday.... now it has stopped working and it is the only thing that has changed. most annoying.
I only use lein in terms of boot boot.lein/generate
so that Cursive can understand my projects
morning
@nomiskatz found the video for that talk - looks super interesting. as does rewrite-clj
As I don’t feel like rummaging for source code right now, I’m settling for a pprint.
morning
@thomas I've seen several people report problems with Leiningen 2.8.0 and have to downgrade to 2.7.1 -- what sort of things are you seeing?
Hmm, yeah, I seem to recall seeing a commit on Leiningen that referenced a specific version of Java 8 as a minimum. Don't remember what functionality that was related to...
...cgroups memory limit, I think.
Looks like 2.8.1 is out already with a fix for that?
Ah, not out yet. But updated in the code/readme https://github.com/technomancy/leiningen/compare/04b88e57c4026b0e644d02d2fc7e2bd13197eaa2...master
user> (defn partition-by-seq
"Takes a seq giving the template for expected key values (say
timestamps in a series with a regular period, a predicate pred to
compare the template value with the data values to take or drop in
order to create partitions."
[template pred data]
(lazy-seq
(when (seq template)
(let [tprime (first template)
predprime (partial pred tprime)]
(cons [tprime (take-while predprime data)]
(partition-by-seq (drop 1 template) pred (drop-while predprime data)))))))
#'user/partition-by-seq
user> (partition-by-seq [0 2 4 6 8]
(fn [x y] (<= y x))
[0 2 3 4 7 9])
([0 (0)] [2 (2)] [4 (3 4)] [6 ()] [8 (7)])
There are times where I need to combine time series that need to have the same period so I'd use this with a period-seq from clj-time or similar and a more complicated pred function to work on a map with a timestamp and a value in a map
If you think of the output as a seq of vector tuples where the first is millis since the epoc and the second is the seq of all the things that happen in that time period (or not).