Version 0.4.37-SNAPSHOT

Version 0.4.37-SNAPSHOT

--- core/project.clj
+++ core/project.clj
@@ -1,4 +1,4 @@
-(defproject gorillalabs.tesla/core "0.4.36"
+(defproject gorillalabs.tesla/core "0.4.37-SNAPSHOT"
             :plugins [[lein-modules "0.3.11"]]
             :description "basic microservice."
             :dependencies [[mount "0.1.10"]


cleaning up deps

cleaning up deps

--- src/leiningen/docstring_checker.clj
+++ src/leiningen/docstring_checker.clj
@@ -1,7 +1,7 @@
 (ns leiningen.docstring-checker
-  (:require [leiningen.core.eval :as lein]
-            [leiningen.compile :as lein-compile]
-            [bultitude.core :as b]))
+  (:require [bultitude.core :as b]
+            [clojure.java.io :as io]
+            [leiningen.core.eval :as lein]))

 (defn- docstring-checker-version [{:keys [plugins]}]
   (some (fn [[plugin-name version]]
@@ -12,7 +12,7 @@
 (defn get-packages [paths]
   (map #(re-pattern (str "^" (name %)))
        (b/namespaces-on-classpath :classpath
-                                  (map clojure.java.io/file paths))))
+                                  (map io/file paths))))

 (defn docstring-checker
   "Linter that checks all public vars in a Leiningen project have docstrings."


CMR-4524: Address review comments

CMR-4524: Address review comments

--- common-app-lib/src/cmr/common_app/cache/cubby_cache.clj
+++ common-app-lib/src/cmr/common_app/cache/cubby_cache.clj
@@ -3,7 +3,7 @@
   persistence and returning strings so this automatically serializes and deserializes the keys and
   values with EDN. Any key or value serializable to EDN is supported. Operationally cubby uses
   Elasticsearch as a backend store, and multiple applications have multiple caches which use cubby.
-  Therefore calling reset on a cubby cache will not delete all of the data stored in the backend.
+  Therefore calling reset on a cubby cache should not delete all of the data stored in the backend.
   Instead when creating a cubby cache the caller must provide a list of keys which should be deleted
   when calling reset on that particular cache."
   (:require


paredit open-round, open-square, open-curly & double-quote are now default

--- ccw.core/src/clj/ccw/editors/clojure/PareditAutoEditStrategyImpl.clj
+++ ccw.core/src/clj/ccw/editors/clojure/PareditAutoEditStrategyImpl.clj
@@ -32,9 +32,7 @@

 (def ^:dynamic *strict-commands*
   #{:paredit-close-round, :paredit-close-square, :paredit-close-curly,
-    :paredit-forward-delete, :paredit-backward-delete,
-    :paredit-open-round, :paredit-open-square, :paredit-open-curly,
-    :paredit-doublequote})
+    :paredit-forward-delete, :paredit-backward-delete})

 (def
   command-preferences


[ci-skip] Make github machine user key association clearer

--- src-cljs/frontend/components/project_settings.cljs
+++ src-cljs/frontend/components/project_settings.cljs
@@ -888,7 +888,7 @@
                [:p "Deploy keys and user keys are the only key types that GitHub supports. Deploy keys are globally unique (i.e. there's no way to make a deploy key with access to multiple repositories) and user keys have no notion of \\scope\\ separate from the user they're associated with."]
                [:p "Your best bet, for fine-grained access to more than one repo, is to create what GitHub calls a "
                 [:a {:href "https://help.github.com/articles/managing-deploy-keys#machine-users"} "machine user"]
-                ". Give this user exactly the permissions your build requires, and then associate its user key with your project on CircleCI."]]])]])))))
+                ". Give this user exactly the permissions your build requires, and then log into CircleCI as the machine user and associate its user key with your project."]]])]])))))

 (defn scope-popover-html []
   ;; nb that this is a bad idea in general, but should be ok for rarely used popovers


up conversation size limits

up conversation size limits

--- src/polismath/math/conversation.clj
+++ src/polismath/math/conversation.clj
@@ -143,8 +143,8 @@
                           :max-k 5
                           :group-iters 10
                           ;; These three in particular we should be able to tune quickly
-                          :max-ptpts 80000
-                          :max-cmts 800
+                          :max-ptpts 100000
+                          :max-cmts 1000
                           :group-k-buffer 4}
                     opts))


fix complementizers' :comp-type feature

fix complementizers' :comp-type feature

--- src/babel/english/lexicon.cljc
+++ src/babel/english/lexicon.cljc
@@ -1040,9 +1040,9 @@
               :subcat '()}}]

    "if"   {:synsem {:cat :comp
+                    :comp-type :if
                     :sem {:pred :that}
                     :subcat {:1 {:cat :verb
-                                 :comp-type :if
                                  :subcat '()}
                              :2 '()}}}

@@ -1748,9 +1748,9 @@

    "that" [;; "that" as in "she thinks that .."
            {:synsem {:cat :comp
+                     :comp-type :that
                      :sem {:pred :that}
                      :subcat {:1 {:cat :verb
-                                  :comp-type :that
                                   :subcat '()}
                               :2 '()}}}
            ;; "that" as in "that woman"
@@ -1979,9 +1979,9 @@
                      :sem {:pred :wear}}}
    "whether"
    {:synsem {:cat :comp
+             :comp-type :if
              :sem {:pred :that}
              :subcat {:1 {:cat :verb
-                          :comp-type :if
                           :subcat '()}
                       :2 '()}}}


Add move to external api

Add move to external api

--- src/chessground/api.cljs
+++ src/chessground/api.cljs
@@ -17,6 +17,7 @@
        "setPieces" (fn [pieces] (push-in :set-pieces
                                          (into {} (for [[k v] (js->clj pieces)]
                                                     [k (common/keywordize-keys v)]))))
+       "move" (fn [orig dest] (push-in :move-piece [orig dest])) ; TODO: accept several move format?
        "clear" (fn [] (push-in :clear true))
        "getOrientation" (fn [] (:orientation @state-atom))
        "getColor" (fn [] (:color (:movable @state-atom)))


added imperfect

added imperfect

--- src/babel/latin/morphology.clj
+++ src/babel/latin/morphology.clj
@@ -134,6 +134,141 @@
                               ire-present-indicative))

+IMPERFECT BEGINS HERE
+
+(def are-imperfect-indicative
+  (conjugation
+   {:infinitive "āre"
+    :common {:synsem {:infl :present
+                      :sem {:tense :present}}}
+    :forms
+    [["abam"
+      {:synsem {:sem {:subj {:pred :I}}}}]
+
+     ["abas"
+      {:synsem {:sem {:subj {:pred :tu}}}}]
+
+     ["abat"
+      {:synsem {:sem {:subj {:pred :lui}}}}]
+
+     ["abamus"
+      {:synsem {:sem {:subj {:pred :noi}}}}]
+
+     ["abatis"
+      {:synsem {:sem {:subj {:pred :voi}}}}]
+
+     ["abant"
+      {:synsem {:sem {:subj {:pred :loro}}}}]]}))
+
+(def ere-bar-imperfect-indicative
+  (conjugation
+   {:infinitive "ēre"
+    :common {:synsem {:infl :present
+                      :sem {:tense :present}}}
+    :forms
+    [["ebam"
+      {:synsem {:sem {:subj {:pred :I}}}}]
+
+     ["ebas"
+      {:synsem {:sem {:subj {:pred :tu}}}}]
+
+     ["ebat"
+      {:synsem {:sem {:subj {:pred :lui}}}}]
+
+     ["ebamus"
+      {:synsem {:sem {:subj {:pred :noi}}}}]
+
+     ["ebatis"
+      {:synsem {:sem {:subj {:pred :voi}}}}]
+
+     ["ebant"
+      {:synsem {:sem {:subj {:pred :loro}}}}]]}))
+
+(def ere-imperfect-indicative
+  (conjugation
+   {:infinitive "ere"
+    :common {:synsem {:infl :present
+                      :sem {:tense :present}}}
+    :forms
+    [["ebam"
+      {:synsem {:sem {:subj {:pred :I}}}}]
+
+     ["ebas"
+      {:synsem {:sem {:subj {:pred :tu}}}}]
+
+     ["ebat"
+      {:synsem {:sem {:subj {:pred :lui}}}}]
+
+     ["ebamus"
+      {:synsem {:sem {:subj {:pred :noi}}}}]
+
+     ["ebatis"
+      {:synsem {:sem {:subj {:pred :voi}}}}]
+
+     ["ebant"
+      {:synsem {:sem {:subj {:pred :loro}}}}]]}))
+
+
+
+(def ere-imperfect-indicative
+  (conjugation
+   {:infinitive "ere-i"
+    :common {:synsem {:infl :present
+                      :sem {:tense :present}}}
+    :forms
+    [["iebam"
+      {:synsem {:sem {:subj {:pred :I}}}}]
+
+     ["iebas"
+      {:synsem {:sem {:subj {:pred :tu}}}}]
+
+     ["iebat"
+      {:synsem {:sem {:subj {:pred :lui}}}}]
+
+     ["iebamus"
+      {:synsem {:sem {:subj {:pred :noi}}}}]
+
+     ["iebatis"
+      {:synsem {:sem {:subj {:pred :voi}}}}]
+
+     ["iebant"
+      {:synsem {:sem {:subj {:pred :loro}}}}]]}))
+
+
+
+
+
+(def ire-imperfect-indicative
+  (conjugation
+   {:infinitive "īre"
+    :common {:synsem {:infl :present
+                      :sem {:tense :present}}}
+    :forms
+    [["iebam"
+      {:synsem {:sem {:subj {:pred :I}}}}]
+
+     ["iebas"
+      {:synsem {:sem {:subj {:pred :tu}}}}]
+
+     ["iebat"
+      {:synsem {:sem {:subj {:pred :lui}}}}]
+
+     ["iebamus"
+      {:synsem {:sem {:subj {:pred :noi}}}}]
+
+     ["iebatis"
+      {:synsem {:sem {:subj {:pred :voi}}}}]
+
+     ["iebant"
+      {:synsem {:sem {:subj {:pred :loro}}}}]]}))
+
+(def replace-patterns (concat are-imperfect-indicative
+                              ere-bar-imperfect-indicative
+                              ere-imperfect-indicative
+                              ire-imperfect-indicative))
+
+
+


Transactions (slightly) more RESTful

Transactions (slightly) more RESTful

* still no pagination

--- src/swanson/routes/transactions.clj
+++ src/swanson/routes/transactions.clj
@@ -48,6 +48,15 @@
                (json/generate-string
                  (db/get-transaction (Integer/parseInt id)))))

+(defresource transactions []
+  :allowed-methods [:options :get]
+  :available-media-types ["text/html" "application/json"]
+  :handle-ok (fn [ctx]
+              (let [default "25"
+                    l (get-in ctx [:request :params :limit] default)
+                    limit (utils/parse-number l)]
+                (json-response (db/get-all-transactions limit)))))
+
 (defn chart []
   (layout/common
     [:div {:id "chart-div"}]
@@ -57,7 +66,7 @@
 (defroutes transaction-routes
   (GET "/by-week" [] (by-week))
   (GET "/chart" [] (chart))
-  (ANY "/transactions/:id" [id] (transaction id))
-  (PUT "/transaction/:id/category" [id] (update-transaction-cateogory id))
-  (POST "/transaction" [] (post-transaction))
-  (GET "/last-n/:limit" [limit] (last-n-transactions limit)))
+  (GET "/transactions/:id" [id] (transaction id))
+  (PUT "/transactions/:id" [id] (update-transaction-cateogory id))
+  (POST "/transactions" [] (post-transaction))
+  (GET "/transactions" [] (transactions)))


Fix email on copyright notice on accessrules ns.

--- src/buddy/auth/accessrules.clj
+++ src/buddy/auth/accessrules.clj
@@ -1,4 +1,4 @@
-;; Copyright 2013-2015 Andrey Antukh <niwi@niwi.be>
+;; Copyright 2013-2015 Andrey Antukh <niwi@niwi.nz>
 ;;
 ;; Licensed under the Apache License, Version 2.0 (the "License")
 ;; you may not use this file except in compliance with the License.


Adds second argument to call to cadence? in training.

--- src/cadence/views/training.clj
+++ src/cadence/views/training.clj
@@ -77,7 +77,7 @@
                                     tp)))
     ; Ensure that the supplied data is really what I want it to be and not some
     ; glitch or fabrication. (This uses noir.validation)
-    (if (is-valid/cadence? cadence)
+    (if (is-valid/cadence? cadence false)
       (if (patrec/keep-cadence cadence)
         (let [trnmin @patrec/training-min
               kept (patrec/kept-cadences)


fixed evidence-strenth issue for multiple json elements

--- src/clinvar_submitter/form.clj
+++ src/clinvar_submitter/form.clj
@@ -36,7 +36,7 @@
     of the url for VariantInterpretation"
    [i]
    (let [full-id (get i "id")]
-     (let [id (get (re-find #"\/([a-z0-9\-]+)\/$" full-id) 1)]
+     (let [id (get (re-find #"\/([a-z0-9\-]+)\/$" full-id) 1)]
      (if (nil? id) "*E-401"
      (csv-colval id)))))

@@ -44,13 +44,14 @@
   "Return the interpretation clinical significance."
   [t i]
   (let [significance (ld-> t i "clinicalSignificance")]
-    (csv-colval (get significance "display"))))
+    (if (nil? significance) "*E-402"
+    (csv-colval (get significance "display")))))

   (defn interp-eval-date
   "Return the interpretation evaluation date."
   [t i]
   (let [contribution (ld-> t i "contribution")]
-    (if (nil? (get contribution "onDate")) ""
+    (if (nil? (get contribution "onDate")) "E-403"
       (.format
         (java.text.SimpleDateFormat. "yyyy-MM-dd")
         (.parse
@@ -213,9 +214,10 @@
     (try
     (let [crit (ld-> t e "information" "criterion")
           act-strength-coding (ld-> t e "evidenceStrength" "coding")
-          def-strength-coding (ld-> t e "information" "criterion" "defaultStrength" "coding")]
+          def-strength-coding (ld-> t e "information" "criterion" "defaultStrength" "coding")
+          def-strength-display (ld-> t e "information" "criterion" "defaultStrength" "coding" "display")]
         (let [rule-label (get crit "id")
-              def-strength (get def-strength-coding "display")
+              def-strength (first def-strength-display)
               act-strength (get act-strength-coding "display")]
           (let [def-direction (get (str/split def-strength #" ") 0)
                 def-weight (get (str/split def-strength #" ") 1)


refactor for QDM for as-agenda

refactor for QDM for as-agenda

--- src/clj/game/cards-agendas.clj
+++ src/clj/game/cards-agendas.clj
@@ -308,7 +308,7 @@
    "Quantum Predictive Model"
    {:steal-req (req (not tagged))
     :access {:req (req tagged)
-             :effect (effect (as-agenda :corp card 1))
+             :effect (effect (as-agenda card 1))
              :msg "score because the runner is tagged"}}

    "Research Grant"


Moar trains

Moar trains

--- src/clj/mokkameister/train.clj
+++ src/clj/mokkameister/train.clj
@@ -39,6 +39,10 @@
    (train ":coffee:" ":coffeepot:")
    (train ":coffee:" ":coffeealarm:")
    (train ":coffee:" ":hocho:")
+   (train ":coffee:" ":wrench:")
+   (train ":coffee:" ":tada:")
+   (train ":coffee:" ":bacon:")
+   (train ":coffee:" ":nuclear:")
    (train ":coffee:" ":timwendelboe:")
    (train ":coffee:" ":jan-richter:")
    (train ":syringe:" ":hocho:")


Add faster implementation for running multiple requests in scenario

--- src/clj_gatling/simulation.clj
+++ src/clj_gatling/simulation.clj
@@ -130,23 +130,32 @@
                               :end (now)
                               :result false}))))))

+(defn- run-requests [requests timeout user-id result-channel]
+  (let [c (async/chan)]
+    (go-loop [r requests
+              results []]
+      (async-function-with-timeout (first r) timeout user-id c)
+      (let [result (<! c)]
+        (if (empty? (rest r))
+          (>! result-channel (conj results result))
+          (recur (rest r) (conj results result)))))))

 (defn run-scenario-version2 [concurrency number-of-requests timeout scenario]
   (let [cs       (repeatedly concurrency async/chan)
         ps       (map vector (iterate inc 0) cs)
         results  (async/chan)
-        request  (-> scenario :requests first)]
+        requests (-> scenario :requests)]
     (doseq [[user-id c] ps]
-      (async-function-with-timeout request timeout user-id c))
+      (run-requests requests timeout user-id c))
     (go-loop [^long i 0]
       (let [[result c] (alts! cs)]
         (when (< i (- number-of-requests concurrency))
-          (async-function-with-timeout request timeout (+ i concurrency) c))
+          (run-requests requests timeout (+ i concurrency) c))
         (>! results {:name (:name scenario)
                      :id (:id result)
-                     :start (:start result)
-                     :end (:end result)
-                     :requests [result]})
+                     :start (:start (first result))
+                     :end (:end (last result))
+                     :requests result})
         (when (<= i number-of-requests)
           (recur (inc i)))))
     (repeatedly number-of-requests #(<!! results))))
@@ -157,8 +166,8 @@
         duration (:duration options)
         step-timeout (or (:timeout-in-ms options) 5000)]
         ; TODO The new implementation utilizes core.async better and it can generate
-        ;      more load. However, it currently supports only one scenario with one request case
-        (if (and (nil? duration) (= 1 (count scenarios)) (= 1 (-> scenarios first :requests count)))
+        ;      more load. However, it currently supports only simple one scenario case
+        (if (and (nil? duration) (= 1 (count scenarios)))
           (run-scenario-version2 users requests step-timeout (first scenarios))
           (let [scenario-runner (partial run-nth-scenario-with-multiple-users scenarios users step-timeout requests duration)
                 results (run-parallel-and-collect-results scenario-runner (count scenarios))]


simplify ns

simplify ns

--- src/clojure/confgraph/core.clj
+++ src/clojure/confgraph/core.clj
@@ -1,8 +1,8 @@
 (ns confgraph.core
   (:gen-class)
-  (:import ExtendedConstructor)
-  (:import java.io.File)
-  (:import org.yaml.snakeyaml.Yaml))
+  (:import ExtendedConstructor
+           java.io.File
+           org.yaml.snakeyaml.Yaml))

 (def yaml      (Yaml. (ExtendedConstructor.)))
 (def extends   (memoize (fn [d] (.get (.load yaml (slurp (.getPath d))) "ddts_extends"))))


added functions into-rdd and into-pair-rdd for a more clojuresque experience (parallelize just does not describe what it does)

--- src/clojure/sparkling/core.clj
+++ src/clojure/sparkling/core.clj
@@ -114,17 +114,18 @@
   [spark-context filename]
   (.textFile spark-context filename))

-(defn parallelize
+(defn into-rdd
   "Distributes a local collection to form/return an RDD"
   ([spark-context lst] (.parallelize spark-context lst))
   ([spark-context num-slices lst] (.parallelize spark-context lst num-slices)))

-(defn parallelize-pairs
+(defn into-pair-rdd
   "Distributes a local collection to form/return an RDD"
   ([spark-context lst] (.parallelizePairs spark-context lst))
   ([spark-context num-slices lst] (.parallelizePairs spark-context lst num-slices)))

-
+(def parallelize into-rdd )
+(def parallelize-pairs into-pair-rdd)

 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
 ;;


http-kit/clojure: Operate in async mode.

--- src/clojure/src/dnsresolvd.clj
+++ src/clojure/src/dnsresolvd.clj
@@ -16,8 +16,12 @@
     "The main module of the daemon."

     (:require
-        [dnsresolvh         :as             AUX]
-        [org.httpkit.server :refer [run-server]]
+        [dnsresolvh         :as AUX]
+        [org.httpkit.server :refer [
+            run-server
+            with-channel
+            send!
+        ]]
     )

     (:import [java.net InetAddress ])
@@ -188,11 +192,13 @@
     )]

     ; Returning HTTP status code, response headers, and a body of the response.
-    {
+    (with-channel req channel (send! channel { ; <== Async mode !
         :status  (AUX/RSC-HTTP-200-OK)
         :headers (AUX/add-response-headers fmt)
         :body    resp-buffer
     }            )
+                 )
+                 )
                  )
                  )
               )  )  )


http-kit/clojure: Add docstring to a namespace decl.

--- src/clojure/src/dnsresolvh.clj
+++ src/clojure/src/dnsresolvh.clj
@@ -12,7 +12,9 @@
 ; (See the LICENSE file at the top of the source tree.)
 ;

-(ns dnsresolvh)
+(ns dnsresolvh
+    "The helper module for the daemon."
+)

 ; Helper constants.
 (defmacro EXIT-FAILURE     []      1) ;    Failing exit status.


Made render-package-descriptions more readable

--- src/clouseau/text_renderer.clj
+++ src/clouseau/text_renderer.clj
@@ -40,9 +40,10 @@

 (defn render-package-descriptions
     [package-descriptions]
-    (for [p (into (sorted-map) package-descriptions)]
-        (str "[" (key p) "]\n"
-                 (val p) "\n\n")))
+    (let [sorted-descriptions (into (sorted-map) package-descriptions)]
+        (for [p sorted-descriptions]
+            (str "[" (key p) "]\n"
+                     (val p) "\n\n"))))

 (defn render-front-page
     [products package package-descriptions ccs-description products-per-descriptions products-without-descriptions new-description user-name]


Don't break builtins.

Don't break builtins.

--- src/clj/minijava/gas.clj
+++ src/clj/minijava/gas.clj
@@ -64,7 +64,7 @@
 (deftype call [dst]
   clojure.lang.IPersistentMap
   Object
-  (toString [] (str "call lbl_" dst)))
+  (toString [] (str (if (number? dst) "call lbl_" "call ") dst)))

 ;;An unconditional jump. This simply sets %eip to the destination
 ;;address.


Error message when score is not valid

Error message when score is not valid

--- src/cljs/darts/core.cljs
+++ src/cljs/darts/core.cljs
@@ -54,9 +54,10 @@
 (def score (atom ""))
 (def current-player (atom 0))

-(defn valid-score? [score points]
-  (and (<= score 180)
-       (<= score points)))
+(defn error-message [score points]
+  (cond
+    (> score 180) "Score must be <= 180"
+    (> score points) "You cannot score more points than remaining ones. Over?"))

 (defn points [player]
   (- (:starting-score @game)
@@ -75,18 +76,19 @@
 (defn submit-score []
   (let [new-score (js/parseInt @score)
         points (points @current-player)]
-    (if (valid-score? new-score points)
-      (record-score @current-player @score)
-      (reset! message "Score not valid"))))
+    (if-let [error (error-message new-score points)]
+      (reset! message error)
+      (record-score @current-player @score))))

 (defn numpad []
   [:div
    (map (fn [n]
-          ^{:key n}[:button
-                    {:on-click (fn []
-                                 (swap! score str n)
-                                 (clear-message))}
-                    n])
+          ^{:key n}
+          [:button
+           {:on-click (fn []
+                        (swap! score str n)
+                        (clear-message))}
+           n])
         (range 10))
    [:button {:on-click (fn []
                          (swap! score #(subs % 0 (dec (count %)))))} "←"]
@@ -106,7 +108,7 @@
     [:br]
     [:span "Player 2: " (points 1)]]
    [:div
-    [:br ]
+    [:br]
     (str "Player " (+ 1 @current-player) " turn")
     [:br]
     [:input {:type :text


Add api comm

Add api comm

--- src/cljs/gtfve/core.cljs
+++ src/cljs/gtfve/core.cljs
@@ -52,14 +52,18 @@

 (defonce errors-ch (chan))

+(defonce api-ch (chan))
+
 (def debug-state nil)

 (defn app-state []
   (atom (assoc (state/initial-state)
                :comms {:controls controls-ch
                        :errors errors-ch
+                       :api api-ch
                        :controls-mult (async/mult controls-ch)
-                       :errors-mult (async/mult errors-ch)})))
+                       :errors-mult (async/mult errors-ch)
+                       :api-mult (async/mult api-ch)})))

 ;; -------------------------
 ;; Initialize app


Throw Error. in cljs

Throw Error. in cljs

--- src/cljx/cats/types.cljx
+++ src/cljx/cats/types.cljx
@@ -308,7 +308,9 @@
   (pure [_ v]
     (Continuation. (fn [c] (c v))))
   (fapply [_ av]
-    (throw (RuntimeException. "Not implemented")))
+    (throw (#+clj  RuntimeException.
+            #+cljs Error.
+              "Not implemented")))

   proto/Monad
   (bind [self mf]


Add difference-from-least-similar-parent meta-error

--- src/clojush/evaluate.clj
+++ src/clojush/evaluate.clj
@@ -351,6 +351,12 @@
               (= cat :difference-from-most-similar-parent)
               (- 1.0 (if (and (:parent1-genome ind) (:parent2-genome ind))
                        (max (sequence-similarity (:genome ind) (:parent1-genome ind))
+                            (sequence-similarity (:genome ind) (:parent2-genome ind)))
+                       0.0))
+              ;
+              (= cat :difference-from-least-similar-parent)
+              (- 1.0 (if (and (:parent1-genome ind) (:parent2-genome ind))
+                       (min (sequence-similarity (:genome ind) (:parent1-genome ind))
                             (sequence-similarity (:genome ind) (:parent2-genome ind)))
                        0.0))
               ;


Add yet another experimental option for :discounted-case-improvements

--- src/clojush/evaluate.clj
+++ src/clojush/evaluate.clj
@@ -264,7 +264,7 @@
                                              sum (reduce + (mapv * improvements weights))]
                                          (if (<= sum 0)
                                            1.0E100
-                                           (/ 1.0 (* (first case-history) sum)))))))))
+                                           (* (first case-history) (/ 1.0 sum)))))))))
                           (= cat :reproductive-fidelity)
                           (let [g (:genome ind)]
                             (- 1.0


Purge users when yetibot gets kicked from a Slack room

Fix devth/yetibot#486

--- src/yetibot/core/adapters/slack.clj
+++ src/yetibot/core/adapters/slack.clj
@@ -132,8 +132,13 @@

 (defn on-channel-left
   "Fires when yetibot gets kicked from a channel or group"
-  []
-  )
+  [e]
+  (log/debug "channel left" e)
+  (let [c (:channel e)
+        cs (chat-source c)
+        users-in-chan (users/get-users cs)]
+    (log/debug "remove users from" cs (map :id users-in-chan))
+    (dorun (map (fn [u] (users/remove-user cs (:id u))) users-in-chan))))

 ;; users


need this

need this

--- clojure/src/dnd/core.cljs
+++ clojure/src/dnd/core.cljs
@@ -76,7 +76,7 @@
   (doto term
     (.clear)
     (.applicationKeypad)
-    ;; (.grabInput #js { :mouse "button" :focus true })
+    (.grabInput #js { :mouse "button" :focus true })
     )

   (.on client "end" #(let [character-name (:name @character)


future the email sending

future the email sending

--- server/src/gratefulplace/controllers/credential_recovery/forgot_username.clj
+++ server/src/gratefulplace/controllers/credential_recovery/forgot_username.clj
@@ -18,5 +18,5 @@
   :handle-not-found (fn [_] {:errors {:email ["That email address doesn't exist"]}})

   :post! (fn [ctx]
-           (email/send-forgot-username (:record ctx)))
+           (future (email/send-forgot-username (:record ctx))))
   :handle-created {})


Fixing ES mapping for TTP For CTIM 0.1.6

--- src/ctia/stores/es/mapping.clj
+++ src/ctia/stores/es/mapping.clj
@@ -415,6 +415,7 @@
      :exploit_targets related-exploit-targets
      :related_TTPs related-ttps
      :source string
+     :kill_chains string
      :ttp_type string
      :expires ts
      :indicators related-indicators


cljfmt

cljfmt

--- stow/lein-nubank/.lein/profiles.clj
+++ stow/lein-nubank/.lein/profiles.clj
@@ -1,5 +1,6 @@
 {:user
- {:dependencies        [[cljdev "0.10.0"]]
+ {:dependencies        [[cljdev "0.10.0"]
+                        [cljfmt "0.7.0"]]

   :injections          [(require 'nu)]


Fix compact signature tests.

Fix compact signature tests.

--- test/buddy/sign/compact_tests.clj
+++ test/buddy/sign/compact_tests.clj
@@ -22,6 +22,7 @@
             [buddy.sign.compact :as compact]
             [buddy.sign.util :as util]
             [cats.monad.either :as either]
+            [cats.monad.exception :as exc]
             [slingshot.slingshot :refer [try+]]))

 (def secret "test")
@@ -33,45 +34,43 @@
 (deftest compact-sign-unsign
   (testing "Signing with compat implementation using :hs256."
     (let [data {:foo1 "bar1"}
-          signed (compact/encode data secret)]
-      (is (= (either/right data)
-             (compact/decode @signed secret)))))
+          signed (compact/sign data secret)]
+      (is (= data (compact/unsign signed secret)))))

   (testing "Using :poly1305-aes mac algorithm"
     (let [data {:foo1 "bar1"}
-          signed (compact/encode data secret {:alg :poly1305-aes})]
-      (is (= (either/right data)
-             (compact/decode @signed secret {:alg :poly1305-aes})))))
+          signed (compact/sign data secret {:alg :poly1305-aes})]
+      (is (= data (compact/unsign signed secret {:alg :poly1305-aes})))))

   (testing "Using :rs256 digital signature"
     (let [candidate {:foo "bar"}
-          result    (-> (compact/encode candidate rsa-privkey {:alg :rs256})
-                        (either/from-either)
-                        (compact/decode rsa-pubkey {:alg :rs256}))]
-      (is (= (either/from-either result) candidate))))
+          result    (-> (compact/sign candidate rsa-privkey {:alg :rs256})
+                        (compact/unsign rsa-pubkey {:alg :rs256}))]
+      (is (= result candidate))))

-    (testing "Using :ps512 digital signature"
-      (let [candidate {:foo "bar"}
-            result    (-> (compact/encode candidate rsa-privkey {:alg :ps512})
-                          (either/from-either)
-                          (compact/decode rsa-pubkey {:alg :ps512}))]
-        (is (= (either/from-either result) candidate))))
+  (testing "Using :ps512 digital signature"
+    (let [candidate {:foo "bar"}
+          result    (-> (compact/sign candidate rsa-privkey {:alg :ps512})
+                        (compact/unsign rsa-pubkey {:alg :ps512}))]
+      (is (= result candidate))))

   (testing "Using :ec512 digital signature"
     (let [candidate {:foo "bar"}
-          result    (-> (compact/encode candidate ec-privkey {:alg :es512})
-                        (either/from-either)
-                        (compact/decode ec-pubkey {:alg :es512}))]
-      (is (= (either/from-either result) candidate))))
+          result    (-> (compact/sign candidate ec-privkey {:alg :es512})
+                        (compact/unsign ec-pubkey {:alg :es512}))]
+      (is (= result candidate))))

   (testing "Using :hs256 with max-age"
     (let [candidate {:foo "bar"}
-          encoded   (compact/encode candidate secret)
-          decoded1  (compact/decode @encoded secret {:max-age 1})
+          signed    (compact/sign candidate secret)
+          unsigned1 (compact/decode signed secret {:max-age 1})
           _         (Thread/sleep 2000)
-          decoded2  (compact/decode @encoded secret {:max-age 1})]
-      (is (either/right? decoded1))
-      (is (= @decoded1 candidate))
-      (is (either/left? decoded2))
-      (is (= @decoded2 "Expired data"))))
+          unsigned2 (compact/decode signed secret {:max-age 1})]
+      (is (exc/success? unsigned1))
+      (is (= @unsigned1 candidate))
+      (is (exc/failure? unsigned2))
+      (try+
+       (deref unsigned2)
+       (catch [:type :validation] {:keys [cause]}
+         (is (= cause :max-age))))))
 )


Fix get-person test by adding :events

Fix get-person test by adding :events

--- test/herder/web/persons_tests.clj
+++ test/herder/web/persons_tests.clj
@@ -57,7 +57,8 @@
            {:body
             {:id (str person_uuid)
              :convention_id str_con_uuid
-             :name "Foo"}
+             :name "Foo"
+             :events []}
             :status 200}
            (->
             (make-session)


Added tests for page-helpers custom element functions.

--- test/hiccup/test/page_helpers.clj
+++ test/hiccup/test/page_helpers.clj
@@ -61,9 +61,47 @@
                 ""
                 "Hello World")))))

+(deftest include-js-test
+  (is (= (include-js "foo.js")
+         (list [:script {:type "text/javascript", :src "foo.js"}])))
+  (is (= (include-js "foo.js" "bar.js")
+         (list [:script {:type "text/javascript", :src "foo.js"}]
+               [:script {:type "text/javascript", :src "bar.js"}]))))
+
+(deftest include-css-test
+  (is (= (include-css "foo.css")
+         (list [:link {:type "text/css", :href "foo.css", :rel "stylesheet"}])))
+  (is (= (include-css "foo.css" "bar.css")
+         (list [:link {:type "text/css", :href "foo.css", :rel "stylesheet"}]
+               [:link {:type "text/css", :href "bar.css", :rel "stylesheet"}]))))
+
+(deftest javascript-tag-test
+  (is (= (javascript-tag "alert('hello');")
+         [:script {:type "text/javascript"}
+          "//<![CDATA[\nalert('hello');\n//]]>"])))
+
+(deftest link-to-test
+  (is (= (link-to "/")
+         [:a {:href "/"} nil]))
+  (is (= (link-to "/" "foo")
+         [:a {:href "/"} (list "foo")]))
+  (is (= (link-to "/" "foo" "bar")
+         [:a {:href "/"} (list "foo" "bar")])))
+
 (deftest mail-to-test
-  (testing "mail-to helper"
-    (is (= (mail-to "foo@example.com")
-           [:a {:href "mailto:foo@example.com"} "foo@example.com"]))
-    (is (= (mail-to "foo@example.com" "foo")
-           [:a {:href "mailto:foo@example.com"} "foo"]))))
+  (is (= (mail-to "foo@example.com")
+         [:a {:href "mailto:foo@example.com"} "foo@example.com"]))
+  (is (= (mail-to "foo@example.com" "foo")
+         [:a {:href "mailto:foo@example.com"} "foo"])))
+
+(deftest unordered-list-test
+  (is (= (unordered-list ["foo" "bar" "baz"])
+         [:ul (list [:li "foo"]
+                    [:li "bar"]
+                    [:li "baz"])])))
+
+(deftest ordered-list-test
+  (is (= (ordered-list ["foo" "bar" "baz"])
+         [:ol (list [:li "foo"]
+                    [:li "bar"]
+                    [:li "baz"])])))


fix lint errors 2

fix lint errors 2

--- test/metabase/util/stats_test.clj
+++ test/metabase/util/stats_test.clj
@@ -54,5 +54,4 @@
 (expect "1001-10000" (bin-large-number 1001))
 (expect "1001-10000" (bin-large-number 10000))
 (expect "10000+" (bin-large-number 10001))
-(expect "10000+" (bin-large-number 100000))
-
+(expect "10000+" (bin-large-number 100000))


free_word.clj: use - prefix in abbreviated function names.

--- clojure/org/gavrog/clojure/free_word.clj
+++ clojure/org/gavrog/clojure/free_word.clj
@@ -1,4 +1,7 @@
 (ns org.gavrog.clojure.free-word)
+
+;; Operations for free words over the natural numbers (positive integers).
+;; Inverses are represented as negative numbers.

 (defn normalise [xs]
   (assert (every? integer? xs))
@@ -52,6 +55,10 @@
 (defn commutator [a b]
   (product a b (inverse a) (inverse b)))

-(def w* product)
+;; Some abbreviations.

-(def w** raised-to)
+(def -* product)
+
+(def -** raised-to)
+
+(def -| commutator)


Page with list of groups for selected chapter

--- src/hurvinek/html_renderer.clj
+++ src/hurvinek/html_renderer.clj
@@ -110,3 +110,24 @@
         ] ; </body>
     ))

+(defn render-group-list
+    "Render group list for selected product and chapter."
+    [url-prefix title product-id chapter-id product-name chapter-name group-list]
+    (page/xhtml
+        (render-html-header url-prefix title)
+        [:body
+            [:div {:class "container"}
+                (render-navigation-bar-section url-prefix title)
+                [:div {:class "container-fluid"}
+                [:h2 (str "Chapters for product " product-name " and chapter " chapter-name)]
+                [:table {:style "border-collapse: separate; border-spacing: 10px;"}
+                    (for [group group-list]
+                        [:tr
+                            [:td (:name group)]
+                        ])
+                ]]
+                (render-html-footer)
+            ] ; </div class="container">
+        ] ; </body>
+    ))
+


spacing

spacing

--- test/celestial/integration/workflows/openstack.clj
+++ test/celestial/integration/workflows/openstack.clj
@@ -27,6 +27,7 @@
         (wf/clone 1 {:hostname "bar" :owner "ronen"}) => nil
         (wf/destroy (assoc (s/get-system 2) :system-id 2)) => nil
         (wf/destroy (spec)) => nil)
+
       #_(fact "openstack provisioning workflows" :integration :openstack :workflow
           (wf/create (spec)) => nil
           (wf/reload (spec)) => nil


Use color constants in color-harness.

Use color constants in color-harness.

--- test/org/playasophy/wonderdome/util/color_test.clj
+++ test/org/playasophy/wonderdome/util/color_test.clj
@@ -9,6 +9,7 @@

 (defn- setup-harness
   []
+  (quil/frame-rate 1)
   (quil/text-font (quil/create-font "Courier" 18 true))
   (quil/background 0)
   (quil/stroke 0))
@@ -16,38 +17,47 @@

 (defn- render-harness
   []
-  ; red, green, and blue blocks
-  (quil/with-translation [20 20]
-    (quil/fill (color/rgb 0.75))
-    (quil/text "primary colors" 0 0)
-    (quil/fill (color/rgb 1 0 0))
-    (quil/rect 0 10 40 40)
-    (quil/fill (color/rgb 0 1 0))
-    (quil/rect 50 10 40 40)
-    (quil/fill (color/rgb 0 0 1))
-    (quil/rect 100 10 40 40))
+  (let [red   (color/rgb 1 0 0)  ; hue 0/3
+        green (color/rgb 0 1 0)  ; hue 1/3
+        blue  (color/rgb 0 0 1)] ; hue 2/3
+    ; red, green, and blue blocks
+    (quil/with-translation [20 20]
+      (quil/fill (color/gray 0.75))
+      (quil/text "Primary colors" 0 0)
+      (quil/fill red)
+      (quil/rect 0 10 40 20)
+      (quil/fill (color/hsv 0/3 1.0 1.0))
+      (quil/rect 0 30 40 20)
+      (quil/fill green)
+      (quil/rect 50 10 40 20)
+      (quil/fill (color/hsv 1/3 1.0 1.0))
+      (quil/rect 50 30 40 20)
+      (quil/fill (color/rgb 0 0 1))
+      (quil/rect 100 10 40 20)
+      (quil/fill (color/hsv 2/3 1.0 1.0))
+      (quil/rect 100 30 40 20))

-  ; RGB blending
-  (quil/with-translation [20 90]
-    (quil/fill (color/rgb 0.75))
-    (quil/text "RGB blending" 0 0)
-    (quil/fill (color/blend-rgb 0.5 (color/rgb 1 0 0) (color/rgb 0 1 0)))
-    (quil/rect 0 10 40 40)
-    (quil/fill (color/blend-rgb 0.5 (color/rgb 0 1 0) (color/rgb 0 0 1)))
-    (quil/rect 50 10 40 40)
-    (quil/fill (color/blend-rgb 0.5 (color/rgb 0 0 1) (color/rgb 1 0 0)))
-    (quil/rect 100 10 40 40))
+    ; RGB blending
+    (quil/with-translation [20 90]
+      (quil/fill (color/gray 0.75))
+      (quil/text "RGB blending" 0 0)
+      (quil/fill (color/blend-rgb 0.5 red green))
+      (quil/rect 0 10 40 40)
+      (quil/fill (color/blend-rgb 0.5 green blue))
+      (quil/rect 50 10 40 40)
+      (quil/fill (color/blend-rgb 0.5 blue red))
+      (quil/rect 100 10 40 40))

-  ; HSV blending
-  (quil/with-translation [20 160]
-    (quil/fill (color/rgb 0.75))
-    (quil/text "HSV blending" 0 0)
-    (quil/fill (color/blend-hsv 0.5 (color/rgb 1 0 0) (color/rgb 0 1 0)))
-    (quil/rect 0 10 40 40)
-    (quil/fill (color/blend-hsv 0.5 (color/rgb 0 1 0) (color/rgb 0 0 1)))
-    (quil/rect 50 10 40 40)
-    (quil/fill (color/blend-hsv 0.5 (color/rgb 0 0 1) (color/rgb 1 0 0)))
-    (quil/rect 100 10 40 40))
+    ; HSV blending
+    (quil/with-translation [20 160]
+      (quil/fill (color/gray 0.75))
+      (quil/text "HSV blending" 0 0)
+      (quil/fill (color/blend-hsv 0.5 red green))
+      (quil/rect 0 10 40 40)
+      (quil/fill (color/blend-hsv 0.5 green blue))
+      (quil/rect 50 10 40 40)
+      (quil/fill (color/blend-hsv 0.5 blue red))
+      (quil/rect 100 10 40 40)))
   )


fixed tests

fixed tests

--- test/src/dda/pallet/dda_managed_vm/domain_test.clj
+++ test/src/dda/pallet/dda_managed_vm/domain_test.clj
@@ -238,7 +238,7 @@
                       :install-zip-utils :install-git :remove-ubuntu-unused :install-bash-utils
                       :install-diagram :install-openconnect :install-open-jdk-11 :install-spellchecking-de
                       :remove-xubuntu-unused :install-vpnc :install-telegram :install-lightning
-                      :configure-no-swappiness :install-inkscape :install-remina :install-audio
+                      :configure-no-swappiness :install-inkscape :install-remina
                       :install-libreoffice :install-openvpn :remove-power-management :install-redshift
                       :install-virtualbox-guest :install-timesync :install-pdf-chain}
                     :fakturama {:app-download-url "https://bitbucket.org/fakturamadev/fakturama-2/downloads/Fakturama_linux_x64_2.0.3.deb",


Poll indefinitely

Poll indefinitely

--- src/main/clojure/gpio/core.clj
+++ src/main/clojure/gpio/core.clj
@@ -118,7 +118,7 @@

     (go (loop []
           ; TODO: Let's use a timeout for more predictable shutdowns
-          (when-let [events (.poll poller 1000)]
+          (when-let [events (.poll poller -1)]
             (doseq [_ (filter #(=  gpio-port (.getData %)) events)]
               (>! read-ch (read-value gpio-port)))
             (recur))))


Adds Locale "en" for groups in archives

Adds Locale "en" for groups in archives

MMMM in the SimpleDateFormat constructor is replaced with the month name
of the default locale. The date:longDate filter of Selmer in Archives.html
generates a format with english month names. On non-english Systems that
leads to months names in the local language for the group names, but
english month names for the full dates on the post. To be consistent, the
locale "en" gets set manually on the SimpleDateFormatter constructor call.
This results in english month names on the archives page.

--- src/leiningen/new/cryogen/src/cryogen/compiler.clj
+++ src/leiningen/new/cryogen/src/cryogen/compiler.clj
@@ -65,7 +65,7 @@
          :toc (if (:toc page-meta) (generate-toc content))}
         (if is-post?
           {:date          (parse-post-date file-name)
-           :archive-group (.format (java.text.SimpleDateFormat. "yyyy MMMM") (parse-post-date file-name))
+           :archive-group (.format (java.text.SimpleDateFormat. "yyyy MMMM" (java.util.Locale "en")) (parse-post-date file-name))
            :uri           (post-uri file-name config)
            :tags          (set (:tags page-meta))}
           {:uri        (page-uri file-name config)


add support for keywords as attr/style-prop values allows to write even more clojure-flavoured markup like [:input {:type :text :style {:display :block}}]

--- src-cljs/freactive/dom.cljs
+++ src-cljs/freactive/dom.cljs
@@ -163,22 +163,21 @@

 ;; ## Attributes, Styles & Events

+(defn normalize-attr-value [value]
+  (cond
+    (.-substring value) value
+    (keyword? value) (name value)
+    :default (.toString value)))
+
 (defn- set-attr! [element attr-name attr-value]
   (if attr-value
-    (.setAttribute element attr-name
-                   (if (.-substring attr-value) ;; tests if attr-value is a string
-                     attr-value
-                     (.toString attr-value)))
+    (.setAttribute element attr-name (normalize-attr-value attr-value))
     (.removeAttribute element attr-name)))

 (defn- set-style-prop! [elem prop-name prop-value]
   ;(println "set-style-prop!" elem prop-name prop-value)
   (if prop-value
-    (aset (.-style elem)
-          prop-name
-          (if (.-substring prop-value)
-            prop-value
-            (.toString prop-value)))
+    (aset (.-style elem) prop-name (normalize-attr-value prop-value))
     (js-delete (.-style elem) prop-name))
   prop-value)

@@ -307,9 +306,7 @@
       ;(println "setting attr" element attr-name attr-value)
       (if attr-value
         (.setAttributeNS element attr-ns attr-name
-          (if (.-substring attr-value)
-            attr-value
-            (.toString attr-value)))
+          (normalize-attr-value attr-value))
         (.removeAttributeNS element attr-ns attr-name))
       attr-value))


Links

Links

--- caching/src/immutant/caching.clj
+++ caching/src/immutant/caching.clj
@@ -87,7 +87,7 @@
    create your own Configuration instance and pass it in via the
    :configuration option.

-   * :configuration - an org.infinispan.configuration.cache.Configuration instance"
+   * :configuration - a [Configuration](https://docs.jboss.org/infinispan/6.0/apidocs/org/infinispan/configuration/cache/Configuration.html) instance"
   ([name]
     (cache name {}))
   ([name k v & kvs]
@@ -145,10 +145,11 @@
     (.stop (component) (name cache-or-name))))

 (defn builder
-  "For advanced use, call this function to obtain a \"fluent
-  Infinispan configuration builder\". Set the desired options, and
-  invoke its build method, the result from which can be passed in the
-  :configuration option of the {{cache}} function. For example:
+  "For advanced use, call this function to obtain a \"fluent\"
+  [ConfigurationBuilder](https://docs.jboss.org/infinispan/6.0/apidocs/org/infinispan/configuration/cache/ConfigurationBuilder.html).
+  Set the desired options, and invoke its build method, the result
+  from which can be passed via the :configuration option of the
+  {{cache}} function. For example:

   ```
   (let [config (.. (builder :ttl [30 :minutes])


make code slightly prettier :sunglasses:

--- src/metabase/util/password.clj
+++ src/metabase/util/password.clj
@@ -11,12 +11,12 @@
   [password]
   (loop [[^Character c & more] password, {:keys [total, lower, upper, letter, digit, special], :as counts} {:total 0, :lower 0, :upper 0, :letter 0, :digit 0, :special 0}]
     (if-not c counts
-            (recur more (merge (update counts :total inc)
-                               (cond
-                                 (Character/isLowerCase c) {:lower   (inc lower), :letter (inc letter)}
-                                 (Character/isUpperCase c) {:upper   (inc upper), :letter (inc letter)}
-                                 (Character/isDigit     c) {:digit   (inc digit)}
-                                 :else                     {:special (inc special)}))))))
+      (recur more (merge (update counts :total inc)
+                         (cond
+                           (Character/isLowerCase c) {:lower   (inc lower), :letter (inc letter)}
+                           (Character/isUpperCase c) {:upper   (inc upper), :letter (inc letter)}
+                           (Character/isDigit     c) {:digit   (inc digit)}
+                           :else                     {:special (inc special)}))))))

 (def ^:private ^:const complexity->char-type->min
   "Minimum counts of each class of character a password should have for a given password complexity level."
@@ -41,8 +41,7 @@
          (string? password)]}
   (let [occurances (count-occurrences password)]
     (boolean (loop [[[char-type min-count] & more] (seq char-type->min)]
-               (if-not char-type
-                 true
+               (if-not char-type true
                  (when (>= (occurances char-type) min-count)
                    (recur more)))))))


fixed video folder creation before cloud creation

--- src/distillery/tasks.clj
+++ src/distillery/tasks.clj
@@ -185,26 +185,27 @@
   "Create the main page for a certain video."
   [{:keys [output-dir] :as job} {:keys [id index video-file] :as video}]
   (print-progress "Creating video page for " id)
-  (let [video-path (combine-path "videos" id)
-        video* (assoc video :path video-path)
-        cloud (create-video-cloud job video*)
-        video* (assoc video* :cloud cloud)
-        pindex (proc/partition-index index)
-        video* (assoc video* :pindex pindex)
-        args (assoc job :video video*)]
+  (let [video-path (combine-path "videos" id)]

     (create-dir (combine-path output-dir video-path))

-    (let [video-target-file (combine-path output-dir video-path (str id ".mp4"))]
-      (when (not (file-exists? video-target-file))
-        (copy-file (get-path video-file) (get-path video-target-file)))      )
-
-    (create-page
-     (combine-path video-path "index.html")
-      v-video/render-video-page
-      args)
-
-    (create-video-word-includes job video*)))
+    (let [video* (assoc video :path video-path)
+          cloud (create-video-cloud job video*)
+          video* (assoc video* :cloud cloud)
+          pindex (proc/partition-index index)
+          video* (assoc video* :pindex pindex)
+          args (assoc job :video video*)]
+
+      (let [video-target-file (combine-path output-dir video-path (str id ".mp4"))]
+        (when (not (file-exists? video-target-file))
+          (copy-file (get-path video-file) (get-path video-target-file)))      )
+
+      (create-page
+       (combine-path video-path "index.html")
+       v-video/render-video-page
+       args)
+
+      (create-video-word-includes job video*))))

 (defn create-video-pages


When a board has a slack mirror configured auto send to channel on entry publish.

--- src/oc/storage/api/entries.clj
+++ src/oc/storage/api/entries.clj
@@ -88,6 +88,31 @@
     true)) ; no existing entry, so this will fail existence check later

 ;; ----- Actions -----
+(defn- share-entry [conn ctx entry-for]
+  (timbre/info "Sharing entry:" entry-for)
+  (if-let* [org (:existing-org ctx)
+            entry (:existing-entry ctx)
+            user (:user ctx)
+            share-requests (:share-requests ctx)
+            shared {:shared (concat (or (:shared entry) []) share-requests)}
+            update-result (entry-res/update-entry! conn (:uuid entry) shared user)]
+    (do
+      (when (and (seq? share-requests)(any? share-requests)) (trigger-share-requests org entry user share-requests))
+      (timbre/info "Shared entry:" entry-for)
+      {:updated-entry update-result})
+    (do
+      (timbre/error "Failed sharing entry:" entry-for) false)))
+
+(defn- share-on-publish
+  [conn ctx entry-result]
+  (if-let* [slack-channel (:slack-mirror (:existing-board ctx))]
+    (let [share-request {:medium "slack"
+                         :note ""
+                         :shared-at (db-common/current-timestamp)
+                         :channel slack-channel}
+          share-req-ctx (assoc ctx :share-requests (list share-request))
+          share-ctx (assoc share-req-ctx :existing-entry entry-result)]
+      (share-entry conn share-ctx (:uuid entry-result)))))

 (defn- create-entry [conn ctx entry-for]
   (timbre/info "Creating entry for:" entry-for)
@@ -99,6 +124,7 @@
     (do
       (timbre/info "Created entry for:" entry-for "as" (:uuid entry-result))
       (when (= (:status entry-result) "published")
+        (share-on-publish conn ctx entry-result)
         (change/send-trigger! (change/->trigger :add entry-result)))
       (notification/send-trigger! (notification/->trigger :add org board {:new entry-result} (:user ctx)))
       {:created-entry entry-result})
@@ -116,6 +142,7 @@
     (do
       (timbre/info "Updated entry for:" entry-for)
       (when (= (:status updated-result) "published")
+        (share-on-publish conn updated-result)
         (change/send-trigger! (change/->trigger :update updated-result)))
       (notification/send-trigger! (notification/->trigger :update org board {:old entry :new updated-result} user))
       {:updated-entry updated-result})
@@ -151,20 +178,6 @@
       (notification/send-trigger! (notification/->trigger :delete org board {:old entry} (:user ctx)))
       true)
     (do (timbre/error "Failed deleting entry for:" entry-for) false)))
-
-(defn- share-entry [conn ctx entry-for]
-  (timbre/info "Sharing entry:" entry-for)
-  (if-let* [org (:existing-org ctx)
-            entry (:existing-entry ctx)
-            user (:user ctx)
-            share-requests (:share-requests ctx)
-            shared {:shared (concat (or (:shared entry) []) share-requests)}
-            update-result (entry-res/update-entry! conn (:uuid entry) shared user)]
-    (do
-      (when (and (seq? share-requests)(any? share-requests)) (trigger-share-requests org entry user share-requests))
-      (timbre/info "Shared entry:" entry-for)
-      {:updated-entry update-result})
-    (do (timbre/error "Failed sharing entry:" entry-for) false)))

 ;; ----- Resources - see: http://clojure-liberator.github.io/liberator/assets/img/decision-graph.svg


Nippy takes rolled up args.

Nippy takes rolled up args.

--- src/onyx/compression/nippy.clj
+++ src/onyx/compression/nippy.clj
@@ -5,5 +5,5 @@
   (nippy/freeze x))

 (defn decompress [x]
-  (nippy/thaw x :v1-compatibility? false))
+  (nippy/thaw x {:v1-compatibility? false}))


Fix bug

Fix bug

--- src/expound/printer.cljc
+++ src/expound/printer.cljc
@@ -7,6 +7,8 @@
             [expound.ansi :as ansi]
             [expound.paths :as paths]
             [clojure.walk :as walk]
+            #?(:cljs [goog.string.format]) ; https://github.com/bhb/expound/issues/183
+            #?(:cljs [goog.string])        ; https://github.com/bhb/expound/issues/183
             #?(:clj [clojure.main :as main]))
   (:refer-clojure :exclude [format]))


Tweak run-jetty invocation.

Tweak run-jetty invocation.

--- src/flatland/handler.clj
+++ src/flatland/handler.clj
@@ -100,4 +100,4 @@

 (defn -main
   []
-  (jetty/run-jetty app))
+  (jetty/run-jetty app {}))


fix inner type issue

fix inner type issue

--- src/graphql_clj/type.clj
+++ src/graphql_clj/type.clj
@@ -165,7 +165,10 @@
         inner-type-kind (:kind inner-type)]
     (if inner-type-kind
       inner-type
-      (get-type-in-schema schema (:name inner-type)))))
+      (if-let [inner-type-name (get-in inner-type [:type-field-type :name])]
+        (get-type-in-schema schema inner-type-name)
+        (throw (ex-info (format "get-inner-type: failed getting inner type of field-type(%s)" field-type)
+                        {:field-type field-type}))))))

 (comment
   "query IntrospectionQuery {


Add new _media_all_received constant symbol

--- src/hatti/constants.cljs
+++ src/hatti/constants.cljs
@@ -7,6 +7,7 @@
 (def _notes "_notes")
 (def _rank "_rank")
 (def _submission_time "_submission_time")
+(def _media_all_received "_media_all_received")
 (def _submitted_by "_submitted_by")
 (def photo "Photo")


Update to field to be sequence rather than comma delimitted.

--- src/open_company/lib/email.clj
+++ src/open_company/lib/email.clj
@@ -5,7 +5,7 @@
             [open-company.config :as c]))

 (def EmailTrigger
-  {:to schema/Str
+  {:to [schema/Str]
    :subject schema/Str
    :note schema/Str
    :reply-to (schema/maybe schema/Str)
@@ -14,7 +14,7 @@

 (defn ctx->trigger [post-data {company :company user :user su :stakeholder-update}]
   {:pre [
-    (string? (:to post-data))
+    (sequential? (:to post-data))
     (string? (:subject post-data))
     (string? (:note post-data))
     (map? company)


More progress on directional resolution.

--- src/afterglow/transform.clj
+++ src/afterglow/transform.clj
@@ -54,6 +54,7 @@

   {:author "James Elliott"
    :doc/format :markdown}
+  (:require [afterglow.show-context :refer :all])
   (:import [javax.media.j3d Transform3D]
            [javax.vecmath Point3d Vector3d]))

@@ -156,9 +157,30 @@
     (taoensso.timbre/info "Euler transformed:\n" euler-point)
     (taoensso.timbre/info "Equal?" (.equals compound-point euler-point))))

-#_(defn show-head-positions
+(defn show-head-positions
   [fixture-key]
-  (map #(select-keys % [:x :y :z]) (:heads ((keyword fixture-key) @(:fixtures afterglow.examples/sample-show)))))
+  (map #(select-keys % [:x :y :z]) (:heads ((keyword fixture-key) @(:fixtures *show*)))))
+
+(defn transform-direction
+  [fixture-key]
+  (let [rotation (Transform3D. (:rotation ((keyword fixture-key) @(:fixtures *show*))))
+        direction (Vector3d. 0 0 1)]
+    (.transform rotation direction)
+    direction))
+
+(defn invert-direction
+  [fixture-key]
+  (let [rotation (Transform3D. (:rotation ((keyword fixture-key) @(:fixtures *show*))))
+        direction (Vector3d. 0 0 1)]
+    (.transform rotation direction)
+    (println "Inverted direction: " direction)
+    (let [rotx (Math/atan2 (. direction y) (. direction z))
+          roty (if (pos? (. direction z))
+                 (- (Math/atan2 (* (. direction x) (Math/cos rotx)) (. direction z)))
+                 (Math/atan2 (* (. direction x) (Math/cos rotx)) (. direction z)))]
+      (println "rotx: " rotx ", roty: " roty))))
+
+

 ;; Examples until I really write something
 (def foo (Transform3D.))


Use Freesound sample which preserves the freesound id.

--- src/overtone/samples/piano.clj
+++ src/overtone/samples/piano.clj
@@ -11,8 +11,7 @@
 ;;(freesound-searchm [:id] "LOUD" :f "pack:MISStereoPiano")
 (def FREESOUND-PIANO-SAMPLES
   "Freesound ids and matching notes for all the loud samples in the MISStereoPiano pack"
-  (sorted-map
-   148401 :BB5 148402 :BB6 148403 :B7  148404 :BB0 148405 :B5  148406 :B6  148407 :BB3
+  {148401 :BB5 148402 :BB6 148403 :B7  148404 :BB0 148405 :B5  148406 :B6  148407 :BB3
    148408 :BB4 148423 :BB1 148424 :BB2 148425 :D1  148426 :C8  148427 :C1  148428 :BB7
    148429 :C3  148430 :C2  148431 :C5  148432 :C4  148433 :C7  148434 :C6  148435 :GB4
    148436 :GB5 148437 :GB6 148438 :GB7 148439 :G7  148440 :GB1 148441 :GB2 148442 :GB3
@@ -24,19 +23,13 @@
    148506 :F4  148507 :F7  148508 :F6  148509 :G6  148510 :G5  148511 :D2  148512 :D3
    148513 :D4  148514 :D5  148515 :D6  148516 :D7  148517 :DB1 148518 :DB2 148519 :DB3
    148520 :DB4 148521 :E7  148522 :E6  148523 :E5  148524 :E4  148525 :E3  148526 :E2
-   148527 :E1  148528 :DB7 148529 :DB6 148530 :DB5))
-
-(def FREESOUND-PIANO-SAMPLE-IDS
-  (keys FREESOUND-PIANO-SAMPLES))
-
-(def FREESOUND-PIANO-SAMPLE-NOTE-NAMES
-  (vals FREESOUND-PIANO-SAMPLES))
+   148527 :E1  148528 :DB7 148529 :DB6 148530 :DB5})

 (defn- download-samples
   "Download piano samples from freesound and store them in the asset
   store."
   []
-  (map freesound-path FREESOUND-PIANO-SAMPLE-IDS))
+  (map freesound-path (keys FREESOUND-PIANO-SAMPLES)))

 (defn- get-samples
   "Either fetch samples from the registered store or download them if
@@ -48,12 +41,10 @@
       samples)))

 (defonce piano-samples
-  (doall (map load-sample (get-samples))))
+  (doall (map freesound-sample (get-samples))))

 (defn- buffer->midi-note [buf]
-  (let [buffer-id (-> buf :id)
-        note (nth FREESOUND-PIANO-SAMPLE-NOTE-NAMES buffer-id)]
-    (-> note name match-note :midi-note)))
+  (-> buf :freesound-id FREESOUND-PIANO-SAMPLES match-note :midi-note))

 (defn- note-index
   "Returns a map of midi-note values [0-127] to buffer ids."


Use first rather than nth.

Use first rather than nth.

--- src/overtunes/songs/before.clj
+++ src/overtunes/songs/before.clj
@@ -68,7 +68,7 @@

 (defn play-progression [progression metro start] ( do
   (if (not (empty? progression)) (do
-    (at (metro (+ start 0)) (play-chord (nth progression 0) (bar-length metro)))
+    (at (metro (+ start 0)) (play-chord (first progression) (bar-length metro)))
     (play-progression (rest progression) metro (+ start bar))
   ))
 ))


(SERVER-246) Improve Error handling after timeout

Improve the error handling in the `with-jruby-puppet` macro
when borrowing an instance from the pool times out.

--- src/clj/puppetlabs/services/jruby/jruby_puppet_service.clj
+++ src/clj/puppetlabs/services/jruby/jruby_puppet_service.clj
@@ -81,9 +81,15 @@
     (with-jruby-puppet
       jruby-puppet
       jruby-service
-      (do-something-with-a-jruby-puppet-instance jruby-puppet)))"
+      (do-something-with-a-jruby-puppet-instance jruby-puppet)))
+
+  Will throw an IllegalStateException if borrowing an instance of
+  JRubyPuppet times out."
   [jruby-puppet jruby-service & body]
   `(loop [pool-instance# (jruby/borrow-instance ~jruby-service)]
+     (if (nil? pool-instance#)
+       (throw (IllegalStateException.
+                "Error: Attempt to borrow a JRuby instance from the pool timed out")))
      (if (core/retry-poison-pill? pool-instance#)
        (do
          (jruby-core/return-to-pool pool-instance#)


Gave filter a visual cue to when it's applied

--- src/cljs/org/broadinstitute/firecloud_ui/common/table.cljs
+++ src/cljs/org/broadinstitute/firecloud_ui/common/table.cljs
@@ -182,6 +182,31 @@
         (:rows @state))])})

+(react/defc Filterer
+  {:get-initial-state
+   (fn [] {:initial true :synced true})
+   :render
+   (fn [{:keys [state this]}]
+     [:span {}
+      (style/create-text-field {:ref "filter-field" :placeholder "Filter"
+                                :style {:backgroundColor (if (:synced @state) "#fff" (:background-gray style/colors))}
+                                :onKeyDown (common/create-key-handler
+                                             [:enter] #(react/call :apply-filter this))
+                                :onChange #(swap! state assoc :initial false :synced false)})
+      [:span {:style {:paddingLeft "1em"}}]
+      [comps/Button {:icon :search :onClick #(react/call :apply-filter this)}]])
+   :make-desynced
+   (fn [{:keys [state]}]
+     (when-not (:initial @state)
+       (swap! state assoc :synced false)))
+   :apply-filter
+   (fn [{:keys [state props refs]}]
+     (swap! state assoc :synced true)
+     (let [text (-> (@refs "filter-field") .getDOMNode .-value trim)]
+       (when (empty? text) (swap! state assoc :initial true))
+       ((:onFilter props) text)))})
+
+
 (react/defc Table
   {:get-default-props
    (fn []
@@ -204,15 +229,8 @@
                                  :onChange #(react/call :handle-pagination-change this)}]]
        [:div {}
         (when (:filterable? props)
-          (let [apply-filter #(swap! state assoc :filtered-data
-                               (react/call :filter-data this props
-                                 (-> (@refs "filter-field") .getDOMNode .-value trim)))]
-            [:div {:style {:padding "0 0 1em 1em"}}
-             (style/create-text-field {:ref "filter-field" :placeholder "Filter"
-                                       :onKeyDown (common/create-key-handler
-                                                    [:enter] apply-filter)})
-             [:span {:style {:paddingLeft "1em"}}]
-             [comps/Button {:icon :search :onClick apply-filter}]]))
+          [:div {:style {:padding "0 0 1em 1em"}}
+           [Filterer {:ref "filterer" :onFilter (fn [text] (react/call :filter-data this text))}]])
         (when paginator-above [:div {:style {:paddingBottom (:paginator-space props)}} paginator])
         [:div {:style {:overflowX "auto"}}
          [:div {:style {:position "relative"
@@ -247,25 +265,25 @@
            ordered-data (if (= :desc (:sort-order @state)) (reverse sorted-data) sorted-data)]
        (take c (drop (* (dec n) c) ordered-data))))
    :filter-data
-   (fn [{:keys []} & [props filter-text]]
-     (if (empty? filter-text)
-       (:data props)
-       (filter
-         (fn [row]
-           (utils/matches-filter-text
-             (apply str
-               (map-indexed
-                 (fn [i column]
-                   (if-let [f (:filter-by column)]
-                     (if (= f :none) "" (f (nth row i)))
-                     (str (nth row i))))
-                 (:columns props)))
-             filter-text))
-         (:data props))))
+   (fn [{:keys [state props]} & [filter-text]]
+     (let [filtered-data
+           (if (empty? filter-text)
+             (:data props)
+             (filter (fn [row]
+                       (utils/matches-filter-text
+                         (apply str (map-indexed
+                                      (fn [i column]
+                                        (if-let [f (:filter-by column)]
+                                          (if (= f :none) "" (f (nth row i)))
+                                          (str (nth row i))))
+                                      (:columns props)))
+                         filter-text))
+               (:data props)))]
+       (swap! state assoc :filtered-data filtered-data)))
    :handle-pagination-change
    (fn [{:keys [this refs]}]
      (react/call :set-rows (@refs "body") (react/call :get-sliced-data this)))
    :component-will-receive-props
-   (fn [{:keys [this state next-props refs]}]
-     (swap! state assoc :filtered-data
-       (react/call :filter-data this next-props (-> (@refs "filter-field") .getDOMNode .-value trim))))})
+   (fn [{:keys [state next-props refs]}]
+     (swap! state assoc :filtered-data (:data next-props))
+     (react/call :make-desynced (@refs "filterer")))})


Tests rewritten using are, and typo fixed

--- test/clj/clojurewerkz/statistiker/metrics_test.clj
+++ test/clj/clojurewerkz/statistiker/metrics_test.clj
@@ -7,43 +7,44 @@

 (deftest wrong-input-mi
   (testing "invalid inputs for mutual-information"
-    (is (thrown? AssertionError (mutual-information [1 2 3] [2 3])))
-    (is (thrown? AssertionError (mutual-information [] [2 3])))
-    (is (thrown? AssertionError (mutual-information [:b :a :c] [2 :a])))
-    (is (thrown? AssertionError (mutual-information [] [])))
-    (is (thrown? AssertionError (adjusted_mutual-information [[:b :a] :c] [2 :a])))))
+    (are [U V] (thrown? AssertionError (mutual-information U V))
+      [1 2 3]       [2 3]
+      []            [2 3]
+      [:b :a :c]    [2 :a]
+      []            []
+      [[:b :a] :c]  [2 :a])))

 (deftest wrong-input-ami
-  (testing "invalid inputs for adjusted_mutual-information"
-    (is (thrown? AssertionError (adjusted_mutual-information [1 2 3] [2 3])))
-    (is (thrown? AssertionError (adjusted_mutual-information [] [2 3])))
-    (is (thrown? AssertionError (adjusted_mutual-information [:b :a :c] [2 :a])))
-    (is (thrown? AssertionError (adjusted_mutual-information [[:b :a] :c] [2 :a])))))
+  (testing "invalid inputs for adjusted-mutual-information"
+    (are [U V] (thrown? AssertionError (adjusted-mutual-information U V))
+      [1 2 3]       [2 3]
+      []            [2 3]
+      [:b :a :c]    [2 :a]
+      [[:b :a] :c]  [2 :a])))

 (deftest mutual-information-values
   (testing "mutual information calculations"
-    (is (= (mutual-information [1 2 3] [1 2 3])
-           (mutual-information [3 2 1] [1 2 3])
-           (mutual-information [1 2 3] [:a :b 2])))
-    (is (almost= (mutual-information [1 2 3] [1 2 3]) 1.0986122886681096 tol))
-    (is (= (mutual-information [1 1 1] [1 1 1]) 0.0))
-    (is (= (mutual-information [1 2 3 4] [1 1 1 1]) 0.0))
-    (is (= (mutual-information [:a :a :a :a] [1 1 1 1]) 0.0))
-    (is (almost= (mutual-information [:a 6 :d :f] [1 2 3 4]) 1.3862943611198906 tol))
-    (is (almost= (mutual-information [0 0 :c2 :c1] [0 0 87 99]) 1.0397207708399179 tol))
-    (is (almost= (mutual-information [0 0 'docid2' 'docid'] [0 99 87 0]) 0.6931471805599453 tol))
-    (is (almost= (mutual-information [0 1 2 0] [0 1 2 3]) 1.0397207708399179 tol))))
+    (are [U V s] (almost= (mutual-information U V) s tol)
+      [3 2 1]                 [1 2 3]     1.0986122886681096
+      [1 2 3]                 [1 2 3]     1.0986122886681096
+      [1 1 1]                 [1 1 1]     0.0
+      [1 2 3 4]               [1 1 1 1]   0.0
+      [:a :a :a :a]           [1 1 1 1]   0.0
+      [:a 6 :d :f]            [1 2 3 4]   1.3862943611198906
+      [0 0 :c2 :c1]           [0 0 87 99] 1.0397207708399179
+      [0 0 'docid2' 'docid']  [0 99 87 0] 0.6931471805599453
+      [0 1 2 0]               [0 1 2 3]   1.0397207708399179)))

 (deftest adjusted-mutual-information-values
   (testing "adjusted mututal information calculations"
-    (is (= (adjusted-mutual-information [1 2 3] [1 2 3])
-           (adjusted-mutual-information [3 2 1] [1 2 3])
-           (adjusted-mutual-information [1 2 3] [:a :b 2])
-           1.0))
-  	(is (= (adjusted-mutual-information [] []) 1.0))
-    (is (==(adjusted-mutual-information [1 2 3 4] [1 1 1 1]) 0.0))
-    (is (= (adjusted-mutual-information [:a :a :a :a] [1 1 1 1]) 1.0))   ;special limit case
-    (is (= (adjusted-mutual-information [:a 6 :d :f] [1 2 3 4]) 1.0))
-    (is (= (adjusted-mutual-information [0 0 :c2 :c1] [0 0 87 99]) 1.0))
-    (is (almost= (adjusted-mutual-information [0 0 'docid2' 'docid'] [0 99 87 0]) -0.20000000000000023 tol))
-    (is (= (adjusted-mutual-information [0 1 2 0] [0 1 2 3]) 0.0))))
+    (are [U V s] (almost= (adjusted-mutual-information U V) s tol)
+      [1 2 3]                 [1 2 3]     1.0
+      [3 2 1]                 [1 2 3]     1.0
+      [1 2 3]                 [:a :b 2]   1.0
+      []                      []          1.0
+      [1 2 3 4]               [1 1 1 1]   0.0
+      [:a :a :a :a]           [1 1 1 1]   1.0   ;special limit case
+      [:a 6 :d :f]            [1 2 3 4]   1.0
+      [0 0 :c2 :c1]           [0 0 87 99] 1.0
+      [0 0 'docid2' 'docid']  [0 99 87 0] -0.20000000000000023
+      [0 1 2 0]               [0 1 2 3]   0.0)))


use a separate synchronous test so that thrown-with-msg? works in cljs

--- test/cljx/jamesmacaulay/async_tools/core_test.cljx
+++ test/cljx/jamesmacaulay/async_tools/core_test.cljx
@@ -41,15 +41,16 @@
     (let [fut (tools/async-future* (fn [resolve!]
                                      (go (is (nil? (resolve! (<! (to-chan [1]))))))))]
       (is (= [1 1 1]
-             [(<! fut) (<! fut) (<! fut)])))
-    ; is-thrown-with-msg? isn't catching the error correctly for some reason, so:
-    (try
-      (tools/async-future* (fn [resolve!]
-                             (resolve! 1)
-                             (resolve! 2)))
-      (is false "no error was thrown")
-      (catch #+clj clojure.lang.ExceptionInfo #+cljs js/Error e
-        (is (re-find #"resolve!" (str e)))))))
+             [(<! fut) (<! fut) (<! fut)])))))
+
+; thrown-with-msg? isn't catching the error correctly in the cljs go block above,
+; so we'll do a synchronous test:
+(deftest test-async-future*-throws-on-multi-resolve!
+  (is (thrown-with-msg? #+clj clojure.lang.ExceptionInfo #+cljs js/Error
+                        #"resolve"
+                        (tools/async-future* (fn [resolve!]
+                                               (resolve! 1)
+                                               (resolve! 2))))))

 (deftest-async test-async-future<
   (go


~(defn generate-for-verbcoach): cleanup

~(defn generate-for-verbcoach): cleanup

--- src/babel/italiano/lab.cljc
+++ src/babel/italiano/lab.cljc
@@ -3,7 +3,7 @@
    [babel.directory] ;; this is needed even though there are no references to directory in here.
    [babel.generate :as g :refer [frontier generate]]
    [babel.index :refer [create-indices lookup-spec]]
-   [babel.italiano :as italiano :refer [model morph morph-ps parse]]
+   [babel.italiano :as italiano :refer [model morph morph-ps]]
    #?(:cljs [babel.logjs :as log])
    #?(:clj [clojure.tools.logging :as log])
    #?(:clj [clojure.repl :refer [doc]])
@@ -237,62 +237,6 @@
   (let [generated (generate spec model)]
     (u/get-in generated path ::none)))

-(defn with-shrunken-model []
-  (binding [babel.generate/truncate? true
-            babel.generate/println? false
-            babel.generate/index-fn (:index-fn model)
-            babel.generate/morph-ps (:morph-ps model)
-            babel.generate/grammar
-            (filter
-             (fn [rule]
-               (or
-                (= (:rule rule) "s-aux")
-                (= (:rule rule) "vp-pronoun-phrasal")
-                (= (:rule rule) "vp-aux-22-nonphrasal-comp")))
-             (:grammar model))]
-    (generate {:modified false
-               :root {:italiano {:italiano "radersi"}}
-               :synsem {:cat :verb
-                        :sem {:aspect :perfect
-                              :tense :present}
-                        :subcat []}})))
-
-(defn svegliarsi []
-  (repeatedly
-   #(println (pprint
-              (let [expr
-                    (time (generate {:modified false,
-                                     :synsem {:cat :verb, :subcat []
-                                              :sem {:tense :present, :aspect :progressive}},
-                                     :root {:italiano {:italiano "svegliarsi"}}
-                                     :comp {:phrasal false}}
-                                    model))]
-                {:m (morph expr)
-                 :ps (morph-ps expr)})))))
-
-(defn chiamarsi
-  "generate chiamarsi sentences with a grammar subset."
-  []
-  (let [grammar
-        (filter
-         #(or
-           (= "s-present-phrasal" (u/get-in % [:rule]))
-           (= "vp-32" (u/get-in % [:rule]))
-           (= "vp-pronoun-phrasal" (u/get-in % [:rule])))
-
-         (:grammar model))
-        spec {:root {:italiano {:italiano "chiamarsi"}}
-              :synsem {:cat :verb
-                       :sem {:tense :present
-                             :aspect :simple}
-                       :subcat []}}]
-    (repeatedly
-     #(println
-       (morph (binding [babel.generate/println? false
-                        babel.generate/truncate? false
-                        babel.generate/grammar grammar]
-                (time (generate spec model))))))))
-
 (def basic-grammar
   #{"sentence-nonphrasal-head"})

@@ -315,6 +259,7 @@

 (def present-perfect-grammar
   #{"s-aux"
+    "vp-32"
     "vp-aux-22-nonphrasal-comp"
     "vp-aux-22-phrasal-comp"
     "vp-aux-nonphrasal-complement"
@@ -323,15 +268,13 @@
     "vp-pronoun-nonphrasal"})

 (defn create-index-fn [verb-set grammar]
-  (let [future-grammar
-        #{"sentence-phrasal-head"
-          "vp-pronoun-nonphrasal"}
-
-        verbcoach-pronouns
+  (let [verbcoach-pronouns
         (fn [v]
-          (or
+          (or
            (and (= :noun (u/get-in v [:synsem :cat]))
                 (not (= :acc (u/get-in v [:synsem :case]))))
+           (and (= :noun (u/get-in v [:synsem :cat]))
+                (= true (u/get-in v [:synsem :propernoun])))
            (and (= :noun (u/get-in v [:synsem :cat]))
                 (= :acc (u/get-in v [:synsem :case]))
                 (= true (u/get-in v [:synsem :reflexive])))))
@@ -363,44 +306,6 @@
     (fn [spec]
       (lookup-spec spec indices verbcoach-index-paths))))

-;; grow at:[s-aux C:_ H:[vp-pronoun-phrasal C:_ H:[vp-aux-22-nonphrasal-comp H:essere C:arrabbiarsi]]];
-;; frontier: (:head :comp); looking for spec:
-(def looking-for-spec
-  {:synsem {:pronoun true,
-            :subcat '(),
-            :cat :noun,
-            :agr :top,
-            :top :top,
-            :sem {:prop {:animate true}},
-            :reflexive true,
-            :case :acc},
-   :italiano {:initial true,
-              :cat :noun}})
-
-(defn arrabbiarsi
-  "generate arrabiarsi sentences with a grammar subset."
-  []
-  (let [verb-set #{"arrabbiarsi" "fermarsi" "parlare" "sedersi"}
-        grammar
-        (filter
-         #(contains? present-perfect-grammar (u/get-in % [:rule]))
-         (:grammar model))
-        spec {:root {:italiano {:italiano "arrabbiarsi"}}
-              :modified false
-              :synsem {:cat :verb
-                       :essere true
-                       :sem {:tense :present
-                             :aspect :perfect}
-                       :subcat []}}
-        index-fn (create-index-fn verb-set grammar)]
-    (binding [babel.generate/println? true
-              babel.generate/truncate? false
-              babel.generate/grammar grammar
-              ;; TODO: if this works, use this exception-filtering everywhere we generate Italiano.
-              babel.generate/lexical-filter (fn [lexeme] (= false (u/get-in lexeme [:italiano :exception] false)))
-              babel.generate/index-fn index-fn]
-      (time (generate spec model)))))
-
 ;; this is a lot like a lexical compilation default map.
 (def rule-matcher
   {:top
@@ -416,6 +321,13 @@
    {:synsem {:sem {:tense :future}}}
    future-grammar

+   {:synsem {:sem {:tense :conditional}}}
+   future-grammar
+
+   {:synsem {:sem {:tense :past
+                   :aspect :progressive}}}
+   future-grammar
+
    {:synsem {:sem {:tense :present
                    :aspect :simple}}}
    present-grammar})
@@ -431,64 +343,38 @@
               (get rule-matcher key-in-rule-matcher))))
         (keys rule-matcher))))

-(defn generate-arrabbiarsi
+;; (take 10 (generate-for-verbcoach))
+(defn generate-for-verbcoach
   "generate sentences efficiently given specific constraints."
   []
-  (let [verb-set #{"arrabbiarsi"}
+  (let [verb-set #{"arrabbiarsi" "chiamarsi" "fermarsi" "parlare" "sedersi"}
         specs
         (map (fn [root]
                {:root {:italiano {:italiano root}}})
              verb-set)
-        tense-specs [{:synsem {:cat :verb
+        tense-specs [
+                     {:synsem {:cat :verb
                                :sem {:tense :present
                                      :aspect :perfect}
-                               :subcat []}}]]
-                                        ;                     {:synsem {:cat :verb
-                                        ;                               :sem {:tense :future}
-                                        ;                               :subcat []}}]]
-                                        ;                     {:synsem {:cat :verb
-                                        ;                               :sem {:tense :present
-                                        ;                                     :aspect :simple}}]]
-
-    (let [chosen-spec
-          (unify (first (shuffle specs))
-                 (first (shuffle tense-specs)))]
-      (let [generate-with-grammar-set
-            (rule-matcher-reducer chosen-spec)
-            grammar
-            (filter (fn [rule-structure]
-                      (contains? generate-with-grammar-set
-                                 (u/get-in rule-structure [:rule])))
-                    (:grammar model))]
-        (println (str "grammar-set for spec:" (strip-refs chosen-spec) ":" generate-with-grammar-set))
-        (binding [babel.generate/println? true
-                  babel.generate/truncate? false
-                  babel.generate/index-fn (create-index-fn verb-set grammar)
-                  babel.generate/grammar grammar]
-          (time (generate chosen-spec model)))))))
-
-(defn generate-for-verbcoach
-  "generate sentences efficiently given specific constraints."
-  []
-  (let [verb-set #{"arrabbiarsi"}
-
-        specs
-        (map (fn [root]
-               {:root {:italiano {:italiano root}}})
-             verb-set)
-        tense-specs [{:synsem {:cat :verb
+                               :subcat []}}
+                     {:synsem {:cat :verb
+                               :sem {:tense :future}
+                               :subcat []}}
+                     {:synsem {:cat :verb
+                               :sem {:tense :conditional}
+                               :subcat []}}
+                     {:synsem {:cat :verb
+                               :sem {:tense :past
+                                     :aspect :progressive}
+                               :subcat []}}
+                     {:synsem {:cat :verb
                                :sem {:tense :present
-                                     :aspect :perfect}
-                               :subcat []}}]]
-                                        ;                     {:synsem {:cat :verb
-                                        ;                               :sem {:tense :future}
-                                        ;                               :subcat []}}]]
-                                        ;                     {:synsem {:cat :verb
-                                        ;                               :sem {:tense :present
-                                        ;                                     :aspect :simple}}]]
+                                     :aspect :simple}}}
+                     ]
+        ]

     (repeatedly
-     #(do ;;(println "")
+     #(do
         (println
          (let [chosen-spec
                (unify (first (shuffle specs))
@@ -500,79 +386,10 @@
                            (contains? generate-with-grammar-set
                                       (u/get-in rule-structure [:rule])))
                          (:grammar model))]
-             (println (str "grammar-set for spec:" (strip-refs chosen-spec) ":" generate-with-grammar-set))
-             (morph-ps (binding [babel.generate/println? false
-                                 babel.generate/truncate? false
-                                 babel.generate/index-fn (create-index-fn verb-set grammar)
-                                 babel.generate/grammar grammar]
-                         (time (generate chosen-spec model)))))))))))
-
-(def verbcoach-pronouns
-  (fn [v]
-    (or
-     (and (= :noun (u/get-in v [:synsem :cat]))
-          (not (= :acc (u/get-in v [:synsem :case]))))
-     (and (= :noun (u/get-in v [:synsem :cat]))
-          (= :acc (u/get-in v [:synsem :case]))
-          (= true (u/get-in v [:synsem :reflexive]))))))
-
-(def
-  verbcoach-index-paths
-  [[:italiano :italiano]
-   [:synsem :aux]
-   [:synsem :cat]
-   [:synsem :essere]
-   [:synsem :infl]
-   [:synsem :sem :pred]])
-
-(def verbcoach-index-fn
-  (fn [spec]
-    (let [lexicon
-          (into {}
-                (for [[k vals] (:lexicon model)]
-                  (let [filtered-vals
-                        (filter verbcoach-pronouns
-                                vals)]
-                    (if (not (empty? filtered-vals))
-                      [k filtered-vals]))))]
-      (lookup-spec spec (create-indices lexicon verbcoach-index-paths)
-                   verbcoach-index-paths))))
-
-
-(defn stampare
-  "generate 'stampare' sentences with a grammar subset."
-  []
-  (let [grammar
-        (filter
-         #(contains? present-grammar (u/get-in % [:rule]))
-         (:grammar model))
-        spec {:root {:italiano {:italiano "stampare"}}
-              :synsem {:cat :verb
-                       :aux false
-                       :modified false
-                       :sem {:tense :past
-                             :aspect :progressive}
-                       :subcat []}}]
-
-    (repeatedly
-     #(println
-       (morph (binding [babel.generate/println? true
-                        babel.generate/truncate? false
-                        babel.generate/index-fn verbcoach-index-fn
-                        babel.generate/grammar grammar]
-                (time (generate spec model))))))))
-
-(defn chiamarsi-ps
-  "generate chiamarsi sentences with parse trees"
-  []
-  (repeatedly
-   #(println (pprint
-              (let [expr
-                    (time (generate {:modified false,
-                                     :synsem {:cat :verb, :subcat []
-                                              :sem {:tense :present,
-                                                    :aspect :simple}},
-                                     :root {:italiano {:italiano "chiamarsi"}}}
-                                    model))]
-                {:m (morph expr)
-                 :ps (morph-ps expr)})))))
+             (morph (binding [babel.generate/println? false
+                              babel.generate/truncate? false
+                              babel.generate/index-fn (create-index-fn verb-set grammar)
+                              babel.generate/lexical-filter
+                              (fn [lexeme] (= false (u/get-in lexeme [:italiano :exception] false)))
+                              babel.generate/grammar grammar]
+                      (time (generate chosen-spec model)))))))))))


Swapped out unnecessary caes of .indexOf

--- src/polismath/conversation.clj
+++ src/polismath/conversation.clj
@@ -21,7 +21,7 @@

 (defn agg-bucket-votes-for-tid [bid-to-pid rating-mat filter-cond tid]
   ; XXX - should replace index-of with our new index-hash functionality
-  (let [idx (.indexOf (colnames rating-mat) tid)
+  (let [idx (index (get-row-index rating-mat) tid)
         pid-to-row (zipmap (rownames rating-mat) (range (count (rownames rating-mat))))]
     (if (< idx 0)
       []


Flattened/lowered the max-k-fn, for fewer groups.

--- src/polismath/conversation.clj
+++ src/polismath/conversation.clj
@@ -70,7 +70,7 @@
                           :pca-iters 10
                           :base-iters 10
                           :base-k 50
-                          :max-k 12
+                          :max-k 5
                           :group-iters 10
                           :max-ptpts 80000
                           :max-cmts 800
@@ -162,7 +162,7 @@
   (min
     max-max-k
     (+ 2
-       (int (/ (count (rownames data)) 8)))))
+       (int (/ (count (rownames data)) 12)))))

 (def small-conv-update-graph


Function to load list of branches from the mirror repo

--- src/branch_handler/core.clj
+++ src/branch_handler/core.clj
@@ -76,6 +76,15 @@
     (log/info "Cloning mirror repository" repository-url)
     (exec "git" "clone" "--mirror" repository-url (repo-workdir workdir group reponame)))

+(defn read-branch-list-from-repo
+    [workdir group reponame]
+    (let [repodir (repo-workdir workdir group reponame)]
+        (log/info "Reading branches from repository" repodir)
+        (->> (clojure.java.shell/sh "git" "--git-dir" (repo-workdir workdir group reponame) "branch")
+             :out
+             clojure.string/split-lines
+             (map #(subs % 2)))))
+
 (defn clone-or-fetch-mirror-repo
     [action]
     (log/info "Cloning or fetching repository")
@@ -104,13 +113,14 @@
     (-> (jenkins-api/read-list-of-all-jobs jenkins-url job-list-command)
         (filter-branch-jobs branch-job-prefix)))

-(read-jobs-for-branches "http://10.34.3.139:8080" job-list-command branch-job-prefix)
-
 (defn create-or-delete-jenkins-job
     [jenkins-url job-list-command branch-job-prefix action]
     (log/info "Create-or-delete-jenkins-job")
-    (let [jobs-for-branches (read-jobs-for-branches jenkins-url job-list-command branch-job-prefix)]
-)
+    (let [reponame       (:name action)
+          group          (:group action)
+          jobs-for-branches (read-jobs-for-branches jenkins-url job-list-command branch-job-prefix)
+          branch-list-in-repo (read-branch-list-from-repo workdir group reponame)]
+          branch-list-in-repo))

 (defn create-action-queue
     []


Add "Vary: origin" to download headers.

Add "Vary: origin" to download headers.

--- src/cavm/views/datasets.clj
+++ src/cavm/views/datasets.clj
@@ -127,7 +127,12 @@
         (let [{loader :loader docroot :docroot ip :remote-addr} req]
           (upload-files ip loader docroot file append)))
   (GET ["/download/:dataset" :dataset #".+"] [dataset :as {docroot :docroot}]
-       (let [resp (response/file-response dataset {:root docroot :index-files? false})]
+       (let [resp (-> (response/file-response dataset {:root docroot :index-files? false})
+                      ; "Vary: origin" is required so chrome will not cache headers
+                      ; during file download (no "origin" header), which otherwise will
+                      ; cause CORS failures later when we do a HEAD request from
+                      ; datapages.
+                      (assoc-in [:headers "Vary"] "origin"))]
          (if (re-find #"\.gz$" dataset)
            ; set Content-Encoding to coerce wrap-gzip to pass this w/o further compression.
            ; Otherwise .gz files are gzipped twice.


Added compression for textio write

Added compression for textio write

--- src/clj/datasplash/core.clj
+++ src/clj/datasplash/core.clj
@@ -13,7 +13,7 @@
            [org.apache.beam.sdk Pipeline]
            [org.apache.beam.sdk.coders StringUtf8Coder CustomCoder Coder$Context KvCoder IterableCoder]
            [org.apache.beam.sdk.io
-            TextIO  TextIO$CompressionType FileSystems FileBasedSink]
+            TextIO  TextIO$CompressionType FileSystems FileBasedSink$CompressionType]
            [org.apache.beam.sdk.options PipelineOptionsFactory PipelineOptions]
            [org.apache.beam.runners.dataflow.options DataflowPipelineDebugOptions$DataflowClientFactory]
            [org.apache.beam.sdk.transforms
@@ -1062,6 +1062,12 @@
                                compression-type-enum
                                (fn [transform enum] (.withCompressionType transform enum)))}})

+(def sink-compression-type-enum
+  {:bzip2 FileBasedSink$CompressionType/BZIP2
+   :deflate FileBasedSink$CompressionType/DEFLATE
+   :gzip FileBasedSink$CompressionType/GZIP
+   :uncompressed FileBasedSink$CompressionType/UNCOMPRESSED})
+
 (def text-writer-schema
   {:windowed {:docstr "Make windowed writes"
               :action (fn [transform b] (when b (.withWindowedWrites transform )))}
@@ -1076,7 +1082,13 @@
    :shard-name-template {:docstr "Uses the given shard name template."
                          :action (fn [transform tpl] (.withShardNameTemplate transform tpl))}
    :suffix {:docstr "Uses the given filename suffix."
-            :action (fn [transform suffix] (.withSuffix transform suffix))}})
+            :action (fn [transform suffix] (.withSuffix transform suffix))}
+   :compression-type {:docstr "Choose compression type."
+                      :enum sink-compression-type-enum
+                      :action (select-enum-option-fn
+                               :compression-type
+                               sink-compression-type-enum
+                               (fn [transform enum] (.withWritableByteChannelFactory transform enum)))}})

 (defn write-text-file
   {:doc (with-opts-docstr


back to old nippy

back to old nippy

--- src/clj/datasplash/core.clj
+++ src/clj/datasplash/core.clj
@@ -7,7 +7,9 @@
             [clojure.tools.logging :as log]
             [superstring.core :as str]
             [clj-time.format :as timf]
-            [clj-time.coerce :as timc])
+            [clj-time.coerce :as timc]
+            [taoensso.nippy :as nippy] ;; to make aot work
+            )
   (:import [clojure.lang MapEntry ExceptionInfo]
            [org.apache.beam.sdk Pipeline]
            [org.apache.beam.sdk.coders StringUtf8Coder KvCoder]
@@ -31,9 +33,11 @@
             SlidingWindows Sessions Trigger]
            [org.joda.time Duration Instant]
            [datasplash.fns
-            ClojureDoFn ClojureStatefulDoFn ClojureCombineFn ClojurePTransform]
+            ClojureDoFn ClojureStatefulDoFn ClojureCombineFn ClojurePTransform
+            ClojureCustomCoder]
            [datasplash.pipelines PipelineWithOptions]
            [datasplash.coder NippyCoder]
+           [java.io InputStream OutputStream DataInputStream DataOutputStream]

 ))

@@ -397,7 +401,15 @@
   {:doc "Returns an instance of a CustomCoder using nippy for serialization"
    :added "0.1.0"}
   []
-  (NippyCoder.))
+  (let [encode-fn (fn [obj ^OutputStream out]
+                    (safe-exec
+                     (let [dos (DataOutputStream. out)]
+                       (nippy/freeze-to-out! dos obj))))
+        decode-fn (fn [^InputStream in]
+                    (safe-exec
+                     (let [dis (DataInputStream. in)]
+                       (nippy/thaw-from-in! dis))))]
+    (ClojureCustomCoder. {"decode-fn" decode-fn "encode-fn" encode-fn})))

 (defn make-kv-coder
   {:doc "Returns an instance of a KvCoder using by default nippy for serialization."


Added a bunch of boot examples.

Added a bunch of boot examples.

--- src/clj/io/cogitat/boot.clj
+++ src/clj/io/cogitat/boot.clj
@@ -2,11 +2,104 @@
   (:require [tailrecursion.boot.core :refer [deftask]]))

+(defn print-message
+  ([]
+    (println "Hello, boot!"))
+  ([msg args]
+    (print-message)
+    (println msg)
+    (println args)))
+
 (deftask foo
-  "A simple task to show the basic form; simply prints a message."
+  "A simple task with no args to show the basic form; simply prints a message.
+
+  Called as:
+      $ boot foo
+  "
   [boot]
-  (print
   (fn [continue]
     (fn [event]
-      (println "Hello, boot!")
+      (print-message)
       (continue event))))
+
+(deftask bar
+  "A simple task with one required arg; prints message with the arg.
+
+  Called as:
+      $ boot [bar wib]
+  "
+  [boot arg]
+  (fn [continue]
+    (fn [event]
+      (print-message "Here is your one arg:" arg)
+      (continue event))))
+
+(deftask baz
+  "A simple task with one optional arg; prints message, and optional arg.
+
+  Called as:
+      $ boot [baz wib]
+      $ boot baz
+  "
+  [boot & [arg]]
+  (fn [continue]
+    (fn [event]
+      (print-message "Here is your one arg:" arg)
+      (continue event))))
+
+(deftask qux
+  "A simple task with two args; prints message with args.
+
+  Called as:
+      $ boot [qux wib wob]
+  "
+  [boot arg1 arg2]
+  (fn [continue]
+    (fn [event]
+      (print-message "Here are your two args:" [arg1 arg2])
+      (continue event))))
+
+(deftask quux
+  "A simple task with multiple args; prints message with args.
+
+  Called as:
+      $ boot [quux wib wob wab]
+      $ boot [quux wib wob]
+      $ boot [quux wib]
+      $ boot quux
+  "
+  [boot & args]
+  (fn [continue]
+    (fn [event]
+      (print-message "Here are your args:" args)
+      (continue event))))
+
+(deftask corge
+  "A simple task with two named args; prints message with arg values.
+
+  Called as:
+    $ boot [corge :foo wib :bar wob]
+    $ boot [corge :foo wib]
+    $ boot [corge :bar wob]
+  "
+  [boot & {:keys [foo bar]}]
+  (fn [continue]
+    (fn [event]
+      (print-message "Here are your two named args:" [foo bar])
+      (continue event))))
+
+(deftask grault
+  "A simple task with two named args; prints message with arg values.
+
+  Called as:
+    $ boot [grault qux :foo quux :bar corge
+    $ boot [grault qux :foo quux]
+    $ boot [grault qux]
+  "
+  [boot arg & {:keys [foo bar] :or {:foo "baz"}}]
+  (fn [continue]
+    (fn [event]
+      (print-message "Here is your arg:" arg)
+      (println "Here are your named args:")
+      (println [foo bar])
+      (continue event))))


Make get-relative-path more robust

Make get-relative-path more robust

--- src/clj/nightcode/utils.clj
+++ src/clj/nightcode/utils.clj
@@ -18,9 +18,9 @@
 (defn get-relative-path
   "Returns the selected path as a relative URI to the project path."
   [project-path selected-path]
-  (-> (.toURI (io/file project-path))
-      (.relativize (.toURI (io/file selected-path)))
-      (.getPath)))
+  (-> (Paths/get (.toURI (io/file project-path)))
+      (.relativize (Paths/get (.toURI (io/file selected-path))))
+      (.toString)))

 (defn delete-parents-recursively!
   "Deletes the given file along with all empty parents unless they are in project-set."


remove test parsing file.

remove test parsing file.

--- src/clj_beautify/format.clj
+++ src/clj_beautify/format.clj
@@ -1,65 +0,0 @@
-(ns clj-beautify.format
-  (:require   [clojure.pprint :refer [write code-dispatch simple-dispatch]]
-              [rewrite-clj.parser :as p]
-              [rewrite-clj.node :as n]))
-
-;; Map containing the dispatch modes for various beautifying
-(def dispatch-mode
-  {"clj"     code-dispatch
-   "edn"     simple-dispatch})
-
-(defn is-token-sandwich [triplet]
-  (let [first-token (-> triplet first first)
-        second-token (-> triplet second first)
-        result (and (not= first-token :newline) (= second-token :whitespace))]
-    result))
-
-(defn is-missing-whitespace [triplet]
-  (let [first-token (-> triplet first first)
-        second-token (-> triplet second first)
-        result (and (not (contains? #{:newline :whitespace} first-token)) (not (contains? #{:newline :whitespace} second-token)))]
-    result))
-
-(defn drop-whitespace-from-ast [ast]
-
-  (let [descriptor (first ast)
-        tokens (rest ast)
-        dropped (drop-while #(contains? #{:newline :whitespace} (first %1)) tokens)
-        reversed-tokens (reverse dropped)
-        dropped (reverse (drop-while #(contains? #{:newline :whitespace} (first %1)) reversed-tokens))
-        my-range (dec (count dropped))
-        token-sandwiches (reduce (fn [accum x] (assoc accum (inc x) (is-token-sandwich (subvec (vec dropped) x (+ x 2))))) {} (range my-range))
-
-        missing-whitespaces (reduce (fn [accum x] (assoc accum (inc x) (is-missing-whitespace (subvec (vec dropped) x (+ x 2))))) {} (range my-range))
-
-        eaten (vec (for [x (range (count dropped)) :let [token (nth dropped x)]] (if (get token-sandwiches x) [(first token) " "] token)))
-
-        bloated (reduce (fn [accum x]
-                          (let [token (nth eaten x)]
-                            (if (get missing-whitespaces x)
-                              (conj accum [:whitespace " "] token)
-                              (conj accum token)))) [] (range (count eaten)))
-
-
-        recursed-tokens (map (fn [token]
-                               (if (contains? #{:set :seq :vector :list :map} (first token))
-                                 (drop-whitespace-from-ast token)
-                                 token))
-                             bloated)
-        new-ast (vec (cons descriptor recursed-tokens))]
-    new-ast))
-
-(defn- format-literal
-  "Takes a literal and formats it using the built in clojure.pprint/write
-  function. Returns a formatted literal."
-  [literal format-type]
-  (write literal
-         :pretty true
-         :stream nil
-         :dispatch (get dispatch-mode format-type)))
-
-(defn code-format [code format-type]
-  (let [ast (p/parse-string-all code)
-        new-ast (drop-whitespace-from-ast ast)
-        formatted (format-literal ast format-type)]
-    (n/string formatted)))


Add folder count badges.

Add folder count badges.

--- src/cljs/bookmarx/home.cljs
+++ src/cljs/bookmarx/home.cljs
@@ -50,6 +50,7 @@
               :aria-hidden "true" :key (str id "-icon-key") :href (str (:prefix env) "/add")
               :on-click #(session/put! :add (assoc bookmark :folder? true))}]
          [:a.bookmark {:key (str id "-name-key") :on-click #(set-active id)} name]
+         [:span.badge (count _parent)]
          (when open? [:ul.nav.nav-pills.nav-stacked {:key (str id "-children-key")}
                       (doall (map #(bookmark-tree %) _parent))])]))))


Enforce that we at least have a :local/current-session attr in our client-side schema

--- src/cljs/dato/lib/core.cljs
+++ src/cljs/dato/lib/core.cljs
@@ -209,7 +209,7 @@
                                   (let [db (let [bootstrapped? (bootstrapped? @app-db)
                                                  conn          (if bootstrapped?
                                                                  app-db
-                                                                 (d/create-conn (merge schema cs-schema)))]
+                                                                 (d/create-conn (merge schema db/cs-schema cs-schema)))]
                                              (def --fconn conn)
                                              ;; Check if we're reloading
                                              ;; with a pre-existing db


add display-name to options

add display-name to options

--- src/cljs_api_gen/result.clj
+++ src/cljs_api_gen/result.clj
@@ -76,6 +76,12 @@
       :full-name-encode full-encoded
       :name-encode name-encoded)))

+(defn assign-display-name
+  [item]
+  (cond-> item
+    (= (:type item) "option")
+    (assoc :display-as (str ":" (:name item)))))
+
 (defn add-clj-equiv
   [item]
   (if-let [equiv (clj-equiv item)]
@@ -130,6 +136,7 @@
       (add-github-links)
       (handle-ns-item)
       (assign-full-names)
+      (assign-display-name)
       (add-edit-url)
       (prune-map)
       (add-clj-equiv)))


Update schema to support build-files based projects and actions.

--- src/cljx/hatnik/schema.cljx
+++ src/cljx/hatnik/schema.cljx
@@ -41,10 +41,6 @@
    :regex (string-of-length 1 128)
    :replacement (string-of-length 1 128)})

-(def Project
-  "Schema for project. Project has only 1 field - name in API."
-  {:name (string-of-length 1 128)})
-
 (def EmailAction
   {:project-id Id
    :library Library
@@ -74,13 +70,25 @@
    :repo GithubRepository
    :operations [ReplaceOperation]})

+(def BuildFileAction
+  {:project-id Id
+   :library Library
+   :type (s/eq "build-file")})
+
 (def Action
   "Schema for action. Essentially it is the union of all actions."
   (s/conditional
    #(= (:type %) "email") EmailAction
    #(= (:type %) "noop") NoopAction
    #(= (:type %) "github-issue") GithubIssueAction
-   #(= (:type %) "github-pull-request") GithubPullRequestAction))
+   #(= (:type %) "github-pull-request") GithubPullRequestAction
+   #(= (:type %) "build-file") BuildFileAction))
+
+(def Project
+  "Schema for project. Project has only 1 field - name in API."
+  {:name (string-of-length 1 128)
+   (s/optional-key :build-file) (string-of-length 1 1028)
+   (s/optional-key :action) Action})

 (comment