Work In Progress
[Add workshop description]
[Describe number of workshop meetings, time and length]
[ | |
{ | |
"Promo": 1, | |
"Sales": 5263 | |
}, | |
{ | |
"Promo": 1, | |
"Sales": 5020 | |
}, | |
{ |
day | hour | overlaps | |
---|---|---|---|
monday | 0 | 1 | |
monday | 1 | 1 | |
monday | 2 | 2 | |
monday | 3 | 3 | |
monday | 4 | 3 | |
monday | 5 | 3 | |
monday | 6 | 2 | |
monday | 7 | 1 | |
monday | 8 | 0 |
;; Creates a lazy sequence of days from 1970-01-01 | |
(defn days-from-epoch | |
([] (days-from-epoch (java.time.LocalDate/parse "1970-01-01"))) | |
([local-date] | |
(prn local-date) | |
(lazy-seq (cons local-date (days-from-epoch (.plusDays local-date 1)))))) | |
(take 2 (days-from-epoch)) | |
;; => (#time/date "1970-01-01" #time/date "1970-01-02") |
# See here: https://git.521000.bestmunity/t5/How-to-use-Git-and-GitHub/Checkout-a-branch-from-a-fork/td-p/77 | |
git ls-remote --refs origin -- will list refs for remote `origin`, some will look like `refs/pull/<some-num>/head` | |
git fetch origin pull/123/head:pr/123 && git checkout pr/123 # fetch and checkout PR #123, eg. |
(defn factorial [n] | |
(if (= n 1) | |
1 | |
(* n (factorial (- n 1))))) | |
;; Datomic example code | |
;; demonstrates various update scenarios, using a news database | |
;; that contains stories, users, and upvotes | |
;; grab an in memory database | |
(use '[datomic.api :only (q db) :as d]) | |
(def uri "datomic:mem://foo") | |
(d/create-database uri) | |
(def conn (d/connect uri)) |
## Function to wrap long strings | |
# Source: http://stackoverflow.com/a/7367534/496488 | |
wrap_strings <- function(vector_of_strings,width) { | |
as.character( | |
sapply(vector_of_strings, FUN=function(x) { | |
paste(strwrap(x, width=width), collapse="\n") | |
}) | |
) | |
} |