211 karma · joined September 20, 2015
(start) <- A <- B <- C <- D <- E
and you want to see the combined effect of, say, A C D:1. make a branch at "start", i.e. at the previous of A
2. cherrypick A C D onto it
3. diff your branch with "start".
They discuss a problem in the article where you want to see the sum of diffs from separate branches and it's not clear which change should be diffed first, or what if they conflict.
This problem is solved using this branch/cherrypick/diff method because the order in which you cherrypick the commits is the order you'll see in the diffs; if you don't like that order, do the cherrypick in a different order.
If you have more money than time, use Splunk.
If you are on AWS, dump your logs into Redshift -- you already know SQL and you don't have to learn another query language; and it's easy to see how to run extract/transform/load jobs. If you're on GCP, I'd investigate BigQuery before bothering with Splunk or Sumologic.
(defn at-least-two [x] (max x 2))
with this: (def at-least-two (partial max 2)) (ns fourmls.core
(:gen-class))
(defn csv-line-to-doubles
[line]
(map #(Double. %)
(clojure.string/split line #",")))
(defn barf-if-different-lengths
[s1 s2]
(if (not= (count s1)
(count s2))
(throw (Exception. "Mismatched lengths"))
s2))
(defn sum-csv-lines
[prev curr]
(if (nil? prev)
(csv-line-to-doubles curr)
(->> curr
csv-line-to-doubles
(barf-if-different-lengths prev)
(interleave prev)
(partition 2)
(map (partial apply +)))))
(defn -main
"I don't do a whole lot ... yet."
[filename]
(println
(clojure.string/join
","
(map str
(reduce sum-csv-lines
nil
(->> filename
clojure.java.io/reader
line-seq))))))