Доработка селекторов search-view

Доработка селекторов search-view

--- radiolamp-6P3S/src/r6p3s/cpt/search_view.cljs
+++ radiolamp-6P3S/src/r6p3s/cpt/search_view.cljs
@@ -16,16 +16,29 @@
           :data      []}
          paginator/app-init))

+
+
+
+(defn data [app-v]
+  (app-v :data))
+
+(defn selected [app-v]
+  (->> app-v data
+       (filter c/omut-row-selected?)))
+
+(defn selected-first [app-v]
+  (first (selected app-v)))
+
+
+
 (defn app-data [app]
-  (@app :data))
+  (data @app))

 (defn app-data-selected [app]
-  (->> @app
-       :data
-       (filter c/omut-row-selected?)))
+  (selected @app))

 (defn app-data-selected-first [app]
-  (first (app-data-selected app)))
+  (selected-first @app))

 (defn component [app owner


Remove Trace logging

Remove Trace logging


bug fix

bug fix


-reset! should return the cache itself, not its contents


make it thinner

make it thinner


mv test

mv test

--- test/mojio_clj/core_test.clj
+++ test/mojio_clj/core_test.clj
@@ -1,7 +0,0 @@
-(ns mojio-clj.core-test
-  (:require [clojure.test :refer :all]
-            [mojio-clj.core :refer :all]))
-
-(deftest a-test
-  (testing "FIXME, I fail."
-    (is (= 0 1))))


Restructure tests.

Restructure tests.


forget in layout to wrap generated html in a [:html]


ignore out of range errors

ignore out of range errors

--- kafka-clj/src/kafka_clj/consumer.clj
+++ kafka-clj/src/kafka_clj/consumer.clj
@@ -443,7 +443,7 @@
                timer-ctx (.time m-consume-cycle)
                q (consume-brokers! producers group-conn broker-offsets2 msg-ch conf)]
 	       (let [[v errors] q]
-			    (if (> (count errors) 0)
+			    (if (> (count (filter #(> (:error-code %) 1) errors)) 0) ;exclude out of range errors
 			      (do
 			         (error "Error close and reconnect: " errors)


code cleanup

code cleanup

--- src/cljs/org/broadinstitute/firecloud_ui/page/method_repo.cljs
+++ src/cljs/org/broadinstitute/firecloud_ui/page/method_repo.cljs
@@ -1,39 +1,29 @@
 (ns org.broadinstitute.firecloud-ui.page.method-repo
   (:require
-   [clojure.string]
    [dmohs.react :as react]
-   [org.broadinstitute.firecloud-ui.common :as common]
    [org.broadinstitute.firecloud-ui.common.components :as comps]
    [org.broadinstitute.firecloud-ui.common.style :as style]
    [org.broadinstitute.firecloud-ui.common.table :as table]
    [org.broadinstitute.firecloud-ui.paths :refer [get-methods-path]]
-   [org.broadinstitute.firecloud-ui.utils :as utils :refer [rlog jslog cljslog]]
+   [org.broadinstitute.firecloud-ui.utils :as utils]
    ))

 (react/defc MethodsList
   {:render
    (fn [{:keys [props]}]
-     [:div {:style {:padding "0 4em"}}
-      (if (zero? (count (:methods props)))
-        (style/create-message-well "No methods to display.")
-        [table/Table
-         {:columns [{:header "Namespace" :starting-width 100}
-                    {:header "Name" :starting-width 100}
-                    {:header "Synopsis" :starting-width 300}]
-          :data (map (fn [m]
-                       [(m "namespace")
-                        (m "name")
-                        (m "synopsis")])
-                  (:methods props))}])])})
+     (if (zero? (count (:methods props)))
+       (style/create-message-well "No methods to display.")
+       [table/Table
+        {:columns [{:header "Namespace" :starting-width 150 :sort-by :value}
+                   {:header "Name" :starting-width 150 :sort-by :value}
+                   {:header "Synopsis" :starting-width 500 :sort-by :value}]
+         :data (map (fn [m]
+                      [(m "namespace")
+                       (m "name")
+                       (m "synopsis")])
+                 (:methods props))}]))})

-
-(defn- contains-text [text fields]
-  (fn [method]
-    (some #(not= -1 (.indexOf (method %) text)) fields)))
-
-(defn- filter-methods [methods fields text]
-  (filter (contains-text text fields) methods))

 (defn- create-mock-methods []
   (map
@@ -49,20 +39,16 @@
    (fn [{:keys [state]}]
      [:div {:style {:padding "1em"}}
       [:h2 {} "Method Repository"]
-      [:div {}
-       (cond
-         (:methods-loaded? @state) [MethodsList {:methods (filter-methods
-                                                            (:methods @state)
-                                                            ["namespace" "name" "synopsis"]
-                                                            (or (:filter-text @state) ""))}]
-         (:error @state) (style/create-server-error-message (get-in @state [:error :message]))
-         :else [comps/Spinner {:text "Loading methods..."}])]])
+      (cond
+        (:methods @state) [MethodsList {:methods (:methods @state)}]
+        (:error @state) (style/create-server-error-message (get-in @state [:error :message]))
+        :else [comps/Spinner {:text "Loading methods..."}])])
    :component-did-mount
    (fn [{:keys [state]}]
      (utils/call-ajax-orch
        (get-methods-path)
        {:on-success (fn [{:keys [parsed-response]}]
-                      (swap! state assoc :methods-loaded? true :methods parsed-response))
+                      (swap! state assoc :methods parsed-response))
         :on-failure (fn [{:keys [status-text]}]
                       (swap! state assoc :error {:message status-text}))
         :mock-data (create-mock-methods)}))})


Delete metrics from branches as well

Delete metrics from branches as well

--- src/cyanite_remover/core.clj
+++ src/cyanite_remover/core.clj
@@ -29,7 +29,7 @@
 (defn- get-paths
   "Get paths."
   [pstore tenant paths-to-lookup]
-  (let [paths (lookup-paths pstore tenant true false paths-to-lookup)
+  (let [paths (lookup-paths pstore tenant false false paths-to-lookup)
         title "Getting paths"]
     (newline)
     (clog/info (str title "..."))


fixed rel union in q3

fixed rel union in q3

--- src/datascript/query_v3.cljc
+++ src/datascript/query_v3.cljc
@@ -161,7 +161,8 @@
   (-size       [_])
   (-getter     [_ symbol])
   (-indexes    [_ symbols])
-  (-copy-tuple [_ tuple idxs target target-idxs]))
+  (-copy-tuple [_ tuple idxs target target-idxs])
+  (-union      [_ rel]))

 ;; (defn- #?@(:clj  [^long hash-arr]
 ;;            :cljs [^number  hash-arr]) [arr]
@@ -240,7 +241,11 @@
     (mapa offset-map syms))
   (-copy-tuple [_ tuple idxs target target-idxs]
     (dotimes [i (shim/alength idxs)]
-      (shim/aset target (shim/aget target-idxs i) (shim/aget tuple (shim/aget idxs i))))))
+      (shim/aset target (shim/aget target-idxs i) (shim/aget tuple (shim/aget idxs i)))))
+  (-union [_ rel]
+    (assert (instance? ArrayRelation rel))
+    (assert (= offset-map (:offset-map rel)))
+    (ArrayRelation. offset-map (concat coll (:coll rel)))))

 #?(:clj
    (defmethod print-method ArrayRelation [rel w]
@@ -272,7 +277,11 @@
     (mapa offset-map syms))
   (-copy-tuple [_ tuple idxs target target-idxs]
     (dotimes [i (shim/alength idxs)]
-      (shim/aset target (shim/aget target-idxs i) (nth tuple (shim/aget idxs i))))))
+      (shim/aset target (shim/aget target-idxs i) (nth tuple (shim/aget idxs i)))))
+  (-union [_ rel]
+    (assert (instance? CollRelation rel))
+    (assert (= offset-map (:offset-map rel)))
+    (CollRelation. offset-map (concat coll (:coll rel)))))

 (defn coll-rel [symbols coll]
   (let [offset-map (reduce-kv
@@ -390,13 +399,6 @@
   (reduce product rels)) ;; TODO check for empty rels

-;; union
-
-
-(defn union [rel1 rel2]
-  (throw (ex-info "Not implemented" [rel1 rel2])))
-
-
 ;; hash-join

@@ -424,6 +426,7 @@
               (do (conj! old t) hash))))
         (transient (fast-map)))
      (persistent!))))
+

 (defn hash-join [rel1 hash1 join-syms rel2]
   (let [syms1       (-symbols rel1)
@@ -454,10 +457,13 @@
                       (fast-arr))]
     (array-rel full-syms (persistent! coll))))

+
 ;;; Bindings
+

 (defn- bindable-to-seq? [x]
   (or (shim/seqable? x) (shim/array? x)))
+

 (defn- plain-tuple-binding? [binding]
   (and (instance? BindTuple binding)
@@ -465,17 +471,21 @@
                     (instance? BindIgnore %))
                (:bindings binding))))

+
 (defprotocol IBinding
   (-in->rel [binding value]))
+

 (extend-protocol IBinding
   BindIgnore
   (-in->rel [_ _]
     (singleton-rel))

+
   BindScalar
   (-in->rel [binding value]
     (array-rel [(get-in binding [:variable :symbol])] [(shim/array value)]))
+

   BindColl
   (-in->rel [binding coll]
@@ -498,7 +508,7 @@

         ;; something more complex, fallback to generic case
         :else
-          (reduce union
+          (reduce -union
             (map #(-in->rel inner-binding %) coll)))))

   BindTuple
@@ -793,7 +803,7 @@
           (if (empty? non-consts)
             context ;; join was by constants only, nothing changes
             (let [sets (map #(collect % non-consts) contexts)
-                  rel  (coll-rel non-consts (into (fast-set) cat sets))]
+                  rel  (coll-rel non-consts (into (first sets) cat (next sets)))]
               (hash-join-rel context rel))))))
     "resolve-or" (dp/source clause)))


Improve behaviour of text filtering

Improve behaviour of text filtering

- Make only the text itself clickable
- Stop propagation of the event any further, preventing the trace from
  also being toggled.

--- src/day8/re_frame/trace.cljs
+++ src/day8/re_frame/trace.cljs
@@ -172,14 +172,18 @@
                                      nil)}}
                [:td {:style row-style}
                 [:button (if show-row? "▼" "▶")]]
-               [:td {:style row-style
-                     :on-click #(save-query op-type)}
+               [:td {:style row-style}
                     [:div.op-string
-                     (str op-type)]]
-               [:td {:style row-style
-                     :on-click #(save-query op-name)}
+                     [:span {:on-click (fn [ev]
+                                         (save-query op-type)
+                                         (.stopPropagation ev))
+                             :style    {:cursor "pointer"}} (str op-type)]]]
+               [:td {:style    row-style}
                     [:div.op-string
-                     op-name]]
+                     [:span {:on-click (fn [ev]
+                                         (save-query op-name)
+                                         (.stopPropagation ev))
+                             :style {:cursor "pointer"}}] op-name]]
                [:td
                 {:style (merge row-style {
                                           ; :font-weight (if (< slower-than-bold-int duration)


Minor fix on test helpers.

Minor fix on test helpers.

--- test/uxbox/tests/helpers.clj
+++ test/uxbox/tests/helpers.clj
@@ -42,7 +42,7 @@
   (try
     (next)
     (finally
-      (mount/stop-except #'uxbox.config/config))))
+      (mount/stop))))

 (defn ex-info?
   [v]


Quit as soon as you see an empty name

Quit as soon as you see an empty name

--- src/tax_extractor/core.clj
+++ src/tax_extractor/core.clj
@@ -66,22 +66,14 @@
         doocr (fn [r] (.doOCR tess file r))
         _ (.setTessVariable tess "tessedit_char_whitelist" name-chars)
         name-and-title (-> y-off name-rect doocr parse-name-and-title)]
-    (.setTessVariable tess "tessedit_char_whitelist" number-chars)
-    (assoc name-and-title
-      :hours (parse-hours (doocr (hours-rect y-off)))
-      :reportable-internal-comp (parse-comp (doocr (reportable-internal-comp y-off)))
-      :reportable-external-comp (parse-comp (doocr (reportable-external-comp y-off)))
-      :other-comp (parse-comp (doocr (other-comp y-off))))))
+    (when-not (empty? (:name name-and-title))
+      (.setTessVariable tess "tessedit_char_whitelist" number-chars)
+      (assoc name-and-title
+        :hours (parse-hours (doocr (hours-rect y-off)))
+        :reportable-internal-comp (parse-comp (doocr (reportable-internal-comp y-off)))
+        :reportable-external-comp (parse-comp (doocr (reportable-external-comp y-off)))
+        :other-comp (parse-comp (doocr (other-comp y-off)))))))

-
-
-(defn read-file [fname-one fname-two idx]
-  (let [file-one (File. fname-one)
-        file-two (File. fname-two)]
-    (read-record file-one file-two idx)))
-
-(defn temp-png []
-  (File/createTempFile "cut" "png"))

 (defn read-pdf [pdf]
   (let [doc (doto (PDFDocument.)
@@ -95,18 +87,17 @@
     (ImageIO/write page-two "png" file-two)
     (loop [idx 0
            records []]
-      (let [record (try
-                     (read-record file-one file-two idx)
-                     (catch Exception e
-                       (println "Failed to read record" idx "from" (.getName pdf))
-                       (println "Exception:" (.getMessage e))
-                       nil))]
-        (if (empty? (:name record))
-          records
-          (do (print ".")
-              (flush)
-              (recur (inc idx)
-                     (conj records record))))))))
+      (if-let [record (try
+                        (read-record file-one file-two idx)
+                        (catch Exception e
+                          (println "Failed to read record" idx "from" (.getName pdf))
+                          (println "Exception:" (.getMessage e))
+                          nil))]
+        (do (print ".")
+            (flush)
+            (recur (inc idx)
+                   (conj records record)))
+        records))))

 (defn process-pdf [pdf out-path]
   (print "Processing" (.getName pdf))


azulenoids.clj: more laziness

azulenoids.clj: more laziness

--- clojure/org/gavrog/clojure/azulenoids.clj
+++ clojure/org/gavrog/clojure/azulenoids.clj
@@ -5,6 +5,12 @@

 (defn iterate-cycle [coll x]
   (reductions (fn [x f] (f x)) x (cycle coll)))
+
+(defn lazy-mapcat [f & colls]
+  (lazy-seq
+   (when (every? seq colls)
+     (concat (apply f (map first colls))
+             (apply lazy-mapcat f (map rest colls))))))

 (defn walk [ds D & idxs]
   (reduce (fn [D i] (.op ds i D)) D idxs))
@@ -31,8 +37,8 @@
 (defn syms-for [ds]
   (if (.isNegative (max-curvature ds))
     []
-    (filter (fn [ds] (= 0 (.curvature2D ds)))
-            (new DefineBranching2d ds 3 2 Whole/ZERO))))
+    (filter (fn [ds] (= Whole/ZERO (.curvature2D ds)))
+            (lazy-seq (new DefineBranching2d ds 3 2 Whole/ZERO)))))

 (def template
   (new DSymbol (str "1.1:60:"
@@ -67,11 +73,10 @@
     (doall (map finish (keys tmp2oct)))
     (-> tmp .dual .minimal .canonical)))

-(def octa-sets (new CombineTiles octagon))
+(defn octa-sets [] (lazy-seq (new CombineTiles octagon)))

-(def octa-syms (mapcat syms-for octa-sets))
+(defn octa-syms [] (lazy-mapcat syms-for (octa-sets)))

-(def azul-syms-raw
-  (mapcat (fn [ds] (map (partial apply-to-template ds) boundary-mappings))
-          octa-syms))
-  +(defn azul-syms-raw []
+  (lazy-mapcat (fn [ds] (map (partial apply-to-template ds) boundary-mappings))
+               (octa-syms)))


[WM] update clojure to 1.7.0

[WM] update clojure to 1.7.0

--- resources/leiningen/new/kraken/project.clj
+++ resources/leiningen/new/kraken/project.clj
@@ -3,7 +3,7 @@
   :url "http://example.com/FIXME"
   :license {:name "Eclipse Public License"
             :url "http://www.eclipse.org/legal/epl-v10.html"}
-  :dependencies [[org.clojure/clojure "1.7.0-RC1"]
+  :dependencies [[org.clojure/clojure "1.7.0"]
                  [org.clojure/tools.logging "0.3.1"]
                  [turbovote.resource-config "0.1.4"]
                  [com.novemberain/langohr "3.2.0"]


Refactor cheat-sheet for readability

Refactor cheat-sheet for readability

--- server/src/main/clojure/vimclojure/util.clj
+++ server/src/main/clojure/vimclojure/util.clj
@@ -441,19 +441,18 @@
   [& namespaces]
   (string/join
     "\n\n"
-    (map (fn [n]
-           (let [mdata (map #((juxt :ns :name (fn [m] (string/join \space (:arglists m)))) (meta %))
-                            (vals (ns-publics n)))
-                 {defs  true
-                  funcs false} (group-by (comp empty? last) mdata)
-                 len   (inc (apply max 0 (map (comp count str second) funcs)))
-                 defs  (map #(apply format "%s/%s" %) defs)
-                 funcs (map #(apply format (str "%s/%-" len "s%s") %) funcs)]
-             (str ";;; " n " {{{1\n\n"
-                  (string/join "\n" (sort defs))
-                  (when (seq defs) "\n")
-                  (string/join "\n" (sort funcs)))))
-         (sort-by ns-name namespaces))))
+    (map (fn [nspace]
+           (let [nsname (str nspace)
+                 mdata (map meta (vals (ns-publics nspace)))
+                 {funcs true defs false} (group-by #(contains? % :arglists) mdata)
+                 funclen (apply max 0 (map (comp count str :name) funcs))
+                 defnames (map #(str nsname "/" (:name %)) defs)
+                 funcnames (map #(format (str "%s/%-" funclen "s %s")
+                                         nsname (:name %)
+                                         (string/join \space (:arglists %))) funcs)]
+             (str ";;; " nsname " {{{1\n\n"
+                  (string/join "\n" (concat (sort defnames) (sort funcnames))))))
+         (sort-by str namespaces))))

 (defn print-cheat-sheet!
   "Print cheat sheets for extant namespaces filtered by optional regex."


cleaned up the logic a bit

cleaned up the logic a bit

--- server/src/gratefulplace/controllers/js.clj
+++ server/src/gratefulplace/controllers/js.clj
@@ -5,11 +5,8 @@
   [params]
   (let [session-js
         (fn [username]
-          {:body (str
-                  "angular.module('gratefulplaceApp').value('loadedSession', {username:'"
-                  username
-                  "'})")
+          {:body (str "angular.module('gratefulplaceApp').value('loadedSession', " value ")")
            :headers {"content-type" "application/javascript"}})]
     (if-let [auth (friend/current-authentication)]
-      (session-js (:username auth))
-      (session-js ""))))
+      (session-js "{username:'" (:username auth) "'}")
+      (session-js "null"))))


Removed unnecessary deps

Removed unnecessary deps

--- server/src/spira/service/garden_service.clj
+++ server/src/spira/service/garden_service.clj
@@ -14,15 +14,7 @@
 ;; along with this program. If not, see <http://www.gnu.org/licenses/>.

 (ns spira.service.garden-service
-  (:require [compojure.core :refer :all]
-            [spira.dm.garden :as garden]
-            [spira.dm.test-model :refer :all]
-            [hiccup.middleware :refer [wrap-base-url]]
-            [cheshire.core :as json]
-            [compojure.route :as route]
-            [compojure.handler :as handler]
-            [compojure.response :as response]
-            ))
+  (:require [spira.dm.garden :as garden]))

 (defn req-garden [id]
   "Respond to garden with id request"


Binary relation link added to description

--- src/foreclojure/data_set.clj
+++ src/foreclojure/data_set.clj
@@ -959,7 +959,7 @@
            {:_id 84
             :title "Transitive Closure"
             :times-solved 0
-            :description "Write a function which generates the transitive closure of a binary relation.  The relation will be represented as a set of 2 item vectors."
+            :description "Write a function which generates the transitive closure of a binary relation.  The relation will be represented as a set of 2 item vectors."
             :approved true
             :tags ["hard" "set-theory"]
             :tests ["(let [divides #{[8 4] [9 3] [4 2] [27 9]}]\n  (= (__ divides) #{[4 2] [8 4] [8 2] [9 3] [27 9] [27 3]}))"


Dump user-code printlns into /dev/nul. Fixes #113.

--- src/foreclojure/problems.clj
+++ src/foreclojure/problems.clj
@@ -177,15 +177,18 @@
     (let [{:keys [tests restricted] :as problem} (get-problem id)
           sb-tester (get-tester restricted)
           user-forms (s/join " " (map pr-str (read-string-safely code)))
+          devnull (java.io.StringWriter.) ;; TODO consider Apache Commons IO
           results (if (empty? user-forms)
                     ["Empty input is not allowed."]
                     (for [test tests]
                       (try
-                        (when-not (->> user-forms
-                                       (s/replace test "__")
-                                       read-string-safely
-                                       first
-                                       (sb sb-tester))
+                        (when-not (sb sb-tester
+                                      (->> user-forms
+                                           (s/replace test "__")
+                                           read-string-safely
+                                           first)
+                                      {#'*out* devnull
+                                       #'*err* devnull})
                           "You failed the unit tests")
                         (catch Throwable t (.getMessage t)))))
           [passed [fail-msg]] (split-with nil? results)]


Add full stop to end of sentence.

Add full stop to end of sentence.

--- src/isla/talk.clj
+++ src/isla/talk.clj
@@ -23,7 +23,7 @@

 ;; pick up

-(defn pick-up [name] (str "You have picked up the " name))
+(defn pick-up [name] (str "You have picked up the " name "."))

 (defn pick-not-here [name] (str "There is no " name " here."))


Use goog.dom for more cross-browserification

--- src/golden_kestrel/core.cljs
+++ src/golden_kestrel/core.cljs
@@ -2,6 +2,7 @@
   (:require
     [clojure.string :as string]
     [clojure.set :as set]
+    [goog.dom :as gdom]
     [om.core :as om :include-macros true]
     [om.dom :as dom :include-macros true]))

@@ -124,11 +125,11 @@

 (defn find-or-create-element
   [root class-name]
-  (let [possibles (. root (getElementsByClassName class-name))]
+  (let [possibles (gdom/getElementsByClass class-name root)]
     (if (= 0 (.-length possibles))
-      (let [form-elem (. js/document (createElement "div"))]
+      (let [form-elem (gdom/createElement "div")]
         (set! (.-className form-elem) class-name)
-        (. root (appendChild form-elem))
+        (gdom/appendChild root form-elem)
         form-elem)
       (aget possibles 0))))

@@ -141,7 +142,7 @@

 (defn ^:export init
   []
-  (when-let [rootdom (. js/document (getElementById "golden-kestrel"))]
+  (when-let [rootdom (gdom/getElement "golden-kestrel")]
     (let [form-element (find-or-create-element rootdom "embed-form")
           embed-element (find-or-create-element rootdom "embed-example")
           code-element (find-or-create-element rootdom "embed-code")]


yokogawa has libs with name beginning CSU

git-svn-id: 03a8048b5ee8463be5048a3801110fb50f378627@9136 d0ab736e-dc22-4aeb-8dc9-08def0aa14fd

--- buildscripts/buildcheck/src/buildcheck/core.clj
+++ buildscripts/buildcheck/src/buildcheck/core.clj
@@ -248,4 +248,4 @@
         (clojure.set/difference (set (map #(.toLowerCase %) (devices-using-serial-port)))
                                 (set (map #(.toLowerCase %) (unix-built-devices)))
                                 #{"pi_gcs" "pi_gcs_2" "xcite120pc_exacte" "skeleton" "crystal"
-                                  "imic2000" "polychrome5000"})))
+                                  "imic2000" "polychrome5000" "yokogawa"})))


is/sr/ts| bugfix | added period after roles of average attendee

--- src/cljs/conference_rating/conference_detail_page/aggregated_ratings.cljs
+++ src/cljs/conference_rating/conference_detail_page/aggregated_ratings.cljs
@@ -67,7 +67,7 @@
   (let [top-2-roles (->> roles
                          (top-2)
                          (map roles->sentence-fragment))]
-    (str "I am " (first top-2-roles) " or " (second top-2-roles))))
+    (str "I am " (first top-2-roles) " or " (second top-2-roles) ".")))

 (defn get-experience-sentence [experiences]
   (let [top-2-experience (->> experiences


Add GitHub issue form component.

Add GitHub issue form component.

--- src/cljs/hatnik/web/client/form/add_action.cljs
+++ src/cljs/hatnik/web/client/form/add_action.cljs
@@ -67,7 +67,8 @@
                                   :defaultValue (name (:type data))
                                   :onChange #(callback (keyword (.. % -target -value)))}
                              (dom/option (option-element-map "email" (= :email (:type data)))  "Email")
-                             (dom/option (option-element-map "noop" (= :noop (:type data))) "Noop")))))))
+                             (dom/option (option-element-map "noop" (= :noop (:type data))) "Noop")
+                             (dom/option (option-element-map "github-issue" (= :github-issue (:type data))) "GitHub issue")))))))

 (defn user-email-component [data owner]
   (reify
@@ -93,6 +94,31 @@
                                         :value (:template data)
                                         :onChange #((:template-handler data) (.. % -target -value))})))))

+(defn github-issue-component [data owner]
+  (reify
+    om/IRender
+    (render [this]
+      (dom/div nil
+               (dom/div #js {:className "form-group"}
+                        (dom/label nil "GitHub repository")
+                        (dom/input #js {:type "text"
+                                        :className "form-control"
+                                        :value (:value (:repo data))
+                                        :placeholder "your/repo"
+                                        :onChange #((:handler (:repo data)) (.. % -target -value))}))
+               (dom/div #js {:className "form-group"}
+                        (dom/label nil "Issue title")
+                        (dom/input #js {:type "text"
+                                        :className "form-control"
+                                        :value (:value (:title data))
+                                        :onChange #((:handler (:title data)) (.. % -target -value))}))
+               (dom/div #js {:className "form-group"}
+                        (dom/label nil "Issue body")
+                        (dom/textarea #js {:cols "40"
+                                           :className "form-control"
+                                           :value (:value (:body data))
+                                           :onChange #((:handler (:body data)) (.. % -target -value))}))))))
+
 (defn action-input-form [data owner]
   (reify
     om/IRender
@@ -103,7 +129,10 @@
                 (om/build user-email-component (:user-email data))

                 (when (= :email (-> data :action-type :type))
-                  (om/build email-template-component (:email data)))))))
+                  (om/build email-template-component (:email data)))
+
+                (when (= :github-issue (-> data :action-type :type))
+                  (om/build github-issue-component (:github-issue data)))))))

 (defn add-action-footer [data owner]
   (reify
@@ -173,14 +202,25 @@
        "Previous version was {{previous-version}}\n\n"
        "Your Hatnik"))

+(def default-github-issue-title "Release {{library}} {{version}}")
+(def default-github-issue-body "Time to update your project.clj to {{library}} {{version}}!")
+
 (defmulti get-init-state #(:type %))

+(def new-init-state {:artifact-value ""})
+(def email-init-state {:email-template default-email-template})
+(def github-issue-init-state
+  {:gh-repo ""
+   :gh-issue-title default-github-issue-title
+   :gh-issue-body default-github-issue-body})
+
 (defmethod get-init-state :add [data _]
-  {:artifact-value ""
-   :project-id (:project-id data)
-   :email-template default-email-template
-   :user-email (:user-email data)
-   :type :email})
+  (merge
+   {:project-id (:project-id data)
+    :email-template default-email-template
+    :user-email (:user-email data)
+    :type :email}
+   new-init-state email-init-state github-issue-init-state))

 (defmethod get-init-state :update [data _]
   (let [action (:action data)]
@@ -237,6 +277,14 @@
                             :action-type
                             {:type (:type state)
                              :handler #(om/set-state! owner :type %)}
+
+                            :github-issue
+                            {:repo {:value (:gh-repo state)
+                                    :handler #(om/set-state! owner :gh-repo %)}
+                             :title {:value (:gh-issue-title state)
+                                     :handler #(om/set-state! owner :gh-issue-title %)}
+                             :body {:value (:gh-issue-body state)
+                                    :handler #(om/set-state! owner :gh-issue-body %)}}

                             :email
                             {:template (:email-template state)


Update clojure game template to use new entity system

--- src/clojure/leiningen/new/game_clojure/core.clj
+++ src/clojure/leiningen/new/game_clojure/core.clj
@@ -4,22 +4,20 @@
            [com.badlogic.gdx.graphics.g2d BitmapFont]
            [com.badlogic.gdx.scenes.scene2d.ui Label Label$LabelStyle]))

-(defn on-show
-  [screen]
-  (create-renderer! screen :type :stage)
-  (let [style (Label$LabelStyle. (BitmapFont.) (Color. 1 1 1 1))
-        label (Label. "Hello world!" style)]
-    (set-entities! screen [label])))
-
-(defn on-render
-  [screen]
-  (clear!)
-  (draw! screen (get-entities screen)))
-
 (defscreen main-screen
-  :on-show on-show
-  :on-render on-render)
+  :on-show
+  (fn [screen entities]
+    (create-renderer! screen :type :stage)
+    (let [style (Label$LabelStyle. (BitmapFont.) (Color. 1 1 1 1))
+          label (Label. "Hello world!" style)]
+      [label]))
+  :on-render
+  (fn [screen entities]
+    (clear!)
+    (draw! screen entities)
+    entities))

 (defgame {{app-name}}
-  :on-create (fn [this]
-               (set-screen! this main-screen)))
+  :on-create
+  (fn [this]
+    (set-screen! this main-screen)))


s|fo|morph/fo|

s|fo|morph/fo|

--- src/babel/english.cljc
+++ src/babel/english.cljc
@@ -79,7 +79,7 @@
             :lexicon (:lexicon (medium))))

 (defn fo-ps [expr]
-  (parse/fo-ps expr fo))
+  (parse/fo-ps expr morph/fo))

 (defn analyze
   ([surface-form]


+(defn lookup)

+(defn lookup)

--- src/babel/english.cljc
+++ src/babel/english.cljc
@@ -176,3 +176,7 @@
                     true
                     (print (str to-print " "))))))
             (range 0 count)))))
+
+(defn lookup [surface]
+  (get (:lexicon (medium)) surface))
+


fix optional params

fix optional params

--- src/babel/english.cljc
+++ src/babel/english.cljc
@@ -46,10 +46,10 @@
   ((:lookup medium) lexeme))

 (defn generate
-  [spec & [model
-           {:keys [max-total-depth model truncate-children]
-            :or {max-total-depth generate/max-total-depth
-                 truncate-children true}}]]
+  [spec & {:keys [max-total-depth model truncate-children]
+           :or {max-total-depth generate/max-total-depth
+                truncate-children true
+                model medium}}]
   (log/debug (str "generating with spec: " (strip-refs spec) " with max-total-depth: " max-total-depth))
   (let [model (if model model medium)]
     (let [result (engine/generate spec model


Add config for number of seconds Elastic system waits for mellow

--- systems/elasticsearch/src/containium/systems/elasticsearch.clj
+++ systems/elasticsearch/src/containium/systems/elasticsearch.clj
@@ -42,9 +42,9 @@

 (defn- wait-until-started
   "Wait until elastic node/cluster is ready."
-  [node]
+  [node timeout-secs]
   (let [^ClusterHealthRequest chr (.. (ClusterHealthRequest. (make-array String 0))
-                                      (timeout "300s")
+                                      (timeout (str timeout-secs "s"))
                                       waitForYellowStatus)
         ^ClusterAdminClient admin (.. node client admin cluster)
         ^ActionFuture fut (.health admin chr)
@@ -73,7 +73,7 @@
             node (.node (NodeBuilder/nodeBuilder))]
         ;; (-> (Thread. monitor) .start)
         (info logger "Waiting for Embedded ElasticSearch node to have initialised.")
-        (when-not (wait-until-started node)
+        (when-not (wait-until-started node (or (:wait-for-yellow-secs config) 300))
           (throw (Exception. "Could not initialise ES within 300 seconds.")))
         (info logger "Embedded ElasticSearch node started.")
         (EmbeddedElastic. node logger)))))


Copy/cut/paste tweaks

Copy/cut/paste tweaks

--- src/brevis/ui/core.clj
+++ src/brevis/ui/core.clj
@@ -93,9 +93,9 @@
     #_(set-status "Wrote " filename ".")))

 (defn a-exit  [e] (System/exit 0))
-(defn a-copy  [e] (.copy (get-editor)))
-(defn a-cut   [e] (.cut (get-editor)))
-(defn a-paste [e] (.paste (get-editor)))
+(defn a-copy  [e] (.copy (:text-area (get-editor))))
+(defn a-cut   [e] (.cut (:text-area (get-editor))))
+(defn a-paste [e] (.paste (:text-area (get-editor))))

 (def repl-output (atom []))
 (def repl-input (atom []))
@@ -216,6 +216,7 @@
                           (menu :text "Edit" :items [a-copy a-cut a-paste])
                           (menu :text "Run" :items [a-eval-file])
                           (menu :text "Projects" :items (into [] a-projects))
+                          (menu :text "Git" :items [])
                           #_(menu :text "My Project" :items [(action :handler (fn [e] nil) :name "Open a project")
                                                             (action :handler (fn [e] nil) :name "in")
                                                             (action :handler (fn [e] nil) :name "projects menu")])])


Change msg object field

Change msg object field

--- src-shared/cljs/cljs_webrepl/repl_thread.cljs
+++ src-shared/cljs/cljs_webrepl/repl_thread.cljs
@@ -18,15 +18,15 @@
     :master))

 (defn- deserialize [reader msg]
-  (debugf "Deserialize: %s %s" (worker-type) (.-data.msg msg))
-  (some->> (.-data.msg msg)
-           (t/read reader)))
+  (let [transit (-> msg .-data .-transit)]
+    (debugf "Deserialize: %s %s" (worker-type) transit)
+    (t/read transit)))

 (defn- serialize [writer msg]
   (debugf "Serialize: %s %s" (worker-type) msg)
   (let [msg (t/write writer msg)]
     (debugf "Serialized: %s %s" (worker-type) msg)
-    (js-obj "msg" msg)))
+    (js-obj "transit" msg)))

 (defn post-message [target writer msg]
   (try


pretty works

pretty works

--- src/celestial/repl.clj
+++ src/celestial/repl.clj
@@ -7,6 +7,7 @@
     [celestial.security :refer (set-user current-user)]
     [taoensso.timbre  :as timbre :refer (set-level!)]
     [io.aviso.columns :refer (format-columns write-rows)]
+    [io.aviso.ansi :refer :all]
     ))

 (set-level! :debug)
@@ -44,9 +45,9 @@
 (def systems (Systems.))

 (defrecord Types [] Repl
-  (ls [this])
-  (ls [this & opts]
-   (clojure.pprint/pprint {:types (map t/get-type (t/all-types))}))
+  (ls [this]
+    {:types (map t/get-type (t/all-types))})
+  (ls [this & opts])
   (find [& opts])
   (rm [& opts]))

@@ -55,13 +56,28 @@
 (defn select-keys* [m & paths]
   (into {} (map (fn [p] [(last p) (get-in m p)])) paths))

-(defn format-systems
-  [{:keys [meta systems]}]
-  (let [formatter (format-columns  [:right 10] "  "  [:right 5] "  " :none)
-        systems' (map #(select-keys* % [:owner] [:machine :hostname] [:machine :os]) (map second systems))]
-      (write-rows *out* formatter  [:hostname :owner :os] systems')))
+
+
+(defmulti pretty
+  (fn [m] (clojure.set/intersection (into #{} (keys m)) #{:systems :types})))
+
+(defn render [[id m]]
+ (-> m
+   (select-keys* [:owner] [:machine :hostname] [:machine :os] [:machine :ip])
+   (assoc :id id)))
+
+(defmethod pretty #{:systems} [{:keys [meta systems]}]
+  (let [formatter (format-columns blue-font [:right 10] "  " reset-font [:right 2] "  "[:right 5] "  " [:right 12] "  " :none)]
+    (write-rows *out* formatter [:hostname :id :owner :os :ip] (map render systems))))
+
+(defmethod pretty #{:systems} [{:keys [meta systems]}]
+  (let [formatter (format-columns blue-font [:right 10] "  " reset-font [:right 2] "  "[:right 5] "  " [:right 12] "  " :none)]
+    (write-rows *out* formatter [:hostname :id :owner :os :ip] (map render systems))))

-(ls types :foo 1)
-(format-systems (ls systems))
-;; (ls types)
+(defmethod pretty #{:types} [{:keys [types]}]
+  (let [formatter (format-columns bold-white-font [:right 10] "  " reset-font [:right 10] "  "[:right 20] :none)]
+    (write-rows *out* formatter [:type (comp first keys) :description] types)))
+
+(pretty (ls types))
+(pretty (ls systems))


Convert files to strs, makes it easier to regex later

--- src/circle/util/fs.clj
+++ src/circle/util/fs.clj
@@ -16,9 +16,9 @@
   "Returns a list of all files in the repos"
   [dir]
   (when (fs/exists? dir)
-    (FileUtils/listFiles (io/as-file dir)
-                         symlink-filter
-                         symlink-filter)))
+    (map str (FileUtils/listFiles (io/as-file dir)
+                                  symlink-filter
+                                  symlink-filter))))

 (defn files-matching
   "Returns a list of files that match re."


add result-set reading fn arities

add result-set reading fn arities

--- src/asphalt/internal/result.clj
+++ src/asphalt/internal/result.clj
@@ -20,35 +20,60 @@

 (defn read-column-value
-  [^ResultSet result-set ^long column-index]
-  (let [data (.getObject result-set column-index)]
-    (cond
-      (instance? Clob data) (.getString result-set column-index)
-      (instance? Blob data) (.getBytes  result-set column-index)
-      (nil? data)           nil
-      :otherwise            (let [^String class-name (.getName ^Class (class data))
-                                  ^ResultSetMetaData rsmd (.getMetaData result-set)
-                                  ^String mdcn (.getColumnClassName rsmd column-index)]
-                              (cond
-                                (.startsWith class-name
-                                  "oracle.sql.DATE")                (if (#{"java.sql.Timestamp"
-                                                                           "oracle.sql.TIMESTAMP"} mdcn)
-                                                                      (.getTimestamp result-set column-index)
-                                                                      (.getDate      result-set column-index))
-                                (and (instance? java.sql.Date data)
-                                  (= "java.sql.Timestamp" mdcn))    (.getTimestamp result-set column-index)
-                                :otherwise                          data)))))
+  ([^ResultSet result-set ^long column-index]
+    (let [data (.getObject result-set column-index)]
+      (cond
+        (instance? Clob data) (.getString result-set column-index)
+        (instance? Blob data) (.getBytes  result-set column-index)
+        (nil? data)           nil
+        :otherwise            (let [^String class-name (.getName ^Class (class data))
+                                    ^ResultSetMetaData rsmd (.getMetaData result-set)
+                                    ^String mdcn (.getColumnClassName rsmd column-index)]
+                                (cond
+                                  (.startsWith class-name
+                                    "oracle.sql.DATE")                (if (#{"java.sql.Timestamp"
+                                                                             "oracle.sql.TIMESTAMP"} mdcn)
+                                                                        (.getTimestamp result-set column-index)
+                                                                        (.getDate      result-set column-index))
+                                  (and (instance? java.sql.Date data)
+                                    (= "java.sql.Timestamp" mdcn))    (.getTimestamp result-set column-index)
+                                  :otherwise                          data)))))
+  ([column-type ^ResultSet result-set ^long column-index]
+    (case (get t/single-typemap column-type)
+      :nil        (read-column-value result-set column-index)
+      :boolean    (.getBoolean   result-set column-index)
+      :byte       (.getByte      result-set column-index)
+      :byte-array (.getBytes     result-set column-index)
+      :date       (.getDate      result-set column-index)
+      :double     (.getDouble    result-set column-index)
+      :float      (.getFloat     result-set column-index)
+      :integer    (.getInt       result-set column-index)
+      :long       (.getLong      result-set column-index)
+      :nstring    (.getNString   result-set column-index)
+      :object     (.getObject    result-set column-index)
+      :string     (.getString    result-set column-index)
+      :time       (.getTime      result-set column-index)
+      :timestamp  (.getTimestamp result-set column-index)
+      (i/expected-result-type column-type))))

 (defn read-columns
-  [^ResultSet result-set ^long column-count]
-  (let [^objects row (object-array column-count)]
-    (loop [i (int 0)]
-      (when (< i column-count)
-        (let [j (unchecked-inc i)]
-          (aset row i (read-column-value result-set j))
-          (recur j))))
-    (vec row)))
+  ([^ResultSet result-set ^long column-count]
+    (let [^objects row (object-array column-count)]
+      (loop [i (int 0)]
+        (when (< i column-count)
+          (let [j (unchecked-inc i)]
+            (aset row i (read-column-value result-set j))
+            (recur j))))
+      (vec row)))
+  ([column-types ^ResultSet result-set ^long column-count]
+    (let [^objects row (object-array column-count)]
+      (loop [i (int 0)]
+        (when (< i column-count)
+          (let [j (unchecked-inc i)]
+            (aset row i (read-column-value (get column-types i) result-set j))
+            (recur j))))
+      (vec row))))

 ;; ----- read ResultSet columns with type information -----


Fix site generation

Fix site generation

--- demo/sitetools/core.cljs
+++ demo/sitetools/core.cljs
@@ -32,8 +32,8 @@

 (declare page-content)

-(defonce config (r/atom {:page-map {"index.html" [:div "Empty"]}
-                         :page-titles {}
+(defonce config (r/atom {;;:page-map {"index.html" [:div "Empty"]}
+                         ;;:page-titles {}
                          :body [page-content]
                          :main-content [:div]
                          :pages #{}
@@ -46,8 +46,8 @@
                          :default-title ""
                          :allow-html5-history false}))

-(defonce page (r/atom "index.html"))
-(defonce page-state (r/atom {:has-history false}))
+;; (defonce page (r/atom "index.html"))
+;; (defonce page-state (r/atom {:has-history false}))

 (defonce history nil)

@@ -204,8 +204,8 @@
 ;;            (base-path (.' js/window -location.pathname) p)))
 ;;   (reset! page p))

-(defn prefix [href]
-  (let [depth (-> #"/" (re-seq @page) count)]
+(defn prefix [href page]
+  (let [depth (-> #"/" (re-seq page) count)]
     (str (->> "../" (repeat depth) (apply str)) href)))

@@ -231,7 +231,7 @@
        [:meta {:charset "utf-8"}]
        [:meta {:name 'viewport
                :content "width=device-width, initial-scale=1.0"}]
-       [:base {:href (prefix "")}]
+       [:base {:href (prefix "" (:page-name page-conf))}]
        [:link {:href (str css-file timestamp) :rel 'stylesheet}]
        [:title title]]
       [:body
@@ -243,7 +243,8 @@
        [:script {:src main :type "text/javascript"}]]])))

 (defn gen-page [page-name timestamp]
-  (reset! page page-name)
+  ;; (reset! page page-name)
+  (dispatch [:set-page page-name])
   (let [b (r/render-component-to-string (body))]
     (str "<!doctype html>"
          (html-template {:title (:title @config) ;;(get-title)
@@ -285,6 +286,8 @@
   (write-file (path-join dir (:css-file @config))
               (read-css)))

+(defn as-relative [f]
+  (clojure.string/replace f #"^/" ""))

 ;;; Main entry points

@@ -293,8 +296,8 @@
   (swap! config merge (js->clj opts :keywordize-keys true))
   (let [dir (:site-dir @config)
         timestamp (str "?" (.' js/Date now))]
-    (doseq [f (keys (:page-map @config))]
-      (write-file (path-join dir f)
+    (doseq [f (:pages @config)]
+      (write-file (path-join dir (dbg (as-relative f)))
                   (gen-page f timestamp)))
     (write-resources dir))
   (log "Wrote site"))


Fixed missing function argument

Fixed missing function argument

--- src/main/clojure/io/alphatier/java/mappings.clj
+++ src/main/clojure/io/alphatier/java/mappings.clj
@@ -71,7 +71,7 @@
    :lifecycle-phase (from-LifecyclePhase (.getLifecyclePhase task))
    :resources (.getResources task)
    :metadata (.getMetadata task)
-   :metadata-version (.getMetadataVersion)})
+   :metadata-version (.getMetadataVersion task)})

 (defn- to-Snapshot' [snapshot]
   (Snapshot. (doall (into {} (map (fn [[k v]] [k (to-Executor v)]) (:executors snapshot))))


Added search by science keywords test with granule counts.

--- test/cmr/system_int_test/search/granule_counts_search_test.clj
+++ test/cmr/system_int_test/search/granule_counts_search_test.clj
@@ -38,23 +38,32 @@
   (let [{:keys [beginning-date-time ending-date-time]} (temporal-range start stop)]
     (str beginning-date-time "," ending-date-time)))

+(defn make-coll
+  ([n shape temporal-attribs]
+   (make-coll n shape temporal-attribs {}))
+  ([n shape temporal-attribs other-attribs]
+   (let [spatial-attribs (when shape
+                           {:spatial-coverage
+                            (dc/spatial :geodetic :geodetic shape)})
+         coll-attribs (merge {:entry-title (str "coll" n)}
+                             spatial-attribs
+                             temporal-attribs
+                             other-attribs)]
+     (d/ingest "PROV1" (dc/collection coll-attribs)))))
+
+(defn make-gran
+  [coll shape temporal-attribs]
+  (let [spatial-attribs (when shape {:spatial-coverage (dg/spatial shape)})
+        gran-attribs (merge {} spatial-attribs temporal-attribs)]
+    (d/ingest "PROV1" (dg/granule coll gran-attribs))))
+
 (deftest granule-related-collection-query-results-features-test
-  (let [make-coll (fn [n shape temporal-attribs]
-                    (let [spatial-attribs (when shape
-                                            {:spatial-coverage
-                                             (dc/spatial :geodetic :geodetic shape)})
-                          coll-attribs (merge {:entry-title (str "coll" n)}
-                                              spatial-attribs
-                                              temporal-attribs)]
-                      (d/ingest "PROV1" (dc/collection coll-attribs))))
-        make-gran (fn [coll shape temporal-attribs]
-                    (let [spatial-attribs (when shape {:spatial-coverage (dg/spatial shape)})
-                          gran-attribs (merge {} spatial-attribs temporal-attribs)]
-                      (d/ingest "PROV1" (dg/granule coll gran-attribs))))
-
-        ;; Create collections
-        ;; whole world, no temporal
-        coll1 (make-coll 1 m/whole-world nil)
+  (let [;; Create collections
+        ;; whole world, no temporal, and science keywords
+        coll1 (make-coll 1 m/whole-world nil {:science-keywords
+                                              [(dc/science-keyword {:category "Tornado"
+                                                                    :topic "Wind"
+                                                                    :term "Speed"})]})
         ;; western hemisphere
         coll2 (make-coll 2 (m/mbr -180 90 0 -90) (temporal-range 1 3))
         ;; eastern hemisphere
@@ -109,6 +118,12 @@
       (testing "granule counts for all collections"
         (let [refs (search/find-refs :collection {:include-granule-counts true})]
           (is (gran-counts/granule-counts-match? :xml {coll1 5 coll2 0 coll3 3 coll4 3 coll5 3 coll6 3} refs))))
+
+      ;; CMR-712
+      (testing "granule counts with science keywords query"
+        (let [refs (search/find-refs :collection {:include-granule-counts true
+                                                  :science-keywords {:0 {:category "Tornado"}}})]
+          (is (gran-counts/granule-counts-match? :xml {coll1 5} refs))))

       (testing "granule counts for spatial queries"
         (are [wnes expected-counts]


typos in descriptions

typos in descriptions

Signed-off-by: Chris Granger <5654cde260ae99bc4d30054171b8bcd902efd19a@gmail.com>

--- src/lt/objs/editor/pool.cljs
+++ src/lt/objs/editor/pool.cljs
@@ -637,7 +637,7 @@
                       (cmd/exec! :editor.codemirror.command "insertLineBefore"))})

 (cmd/command {:command :editor.sublime.selectNextOccurrence
-              :desc "Editor: Select next occurence of word"
+              :desc "Editor: Select next occurrence of word"
               :exec (fn []
                       (cmd/exec! :editor.codemirror.command "selectNextOccurrence"))})

@@ -657,7 +657,7 @@
                       (cmd/exec! :editor.codemirror.command "goToBracket"))})

 (cmd/command {:command :editor.sublime.swapLineUp
-              :desc "Editor: swap line up"
+              :desc "Editor: Swap line up"
               :exec (fn []
                       (cmd/exec! :editor.codemirror.command "swapLineUp"))})


remove references to merge

remove references to merge

--- src/babel/francais/grammar.cljc
+++ src/babel/francais/grammar.cljc
@@ -1,5 +1,5 @@
 (ns babel.francais.grammar
-  (:refer-clojure :exclude [get-in merge resolve])
+  (:refer-clojure :exclude [get-in resolve])
   (:require
    [clojure.set :refer [union]]
    #?(:clj [clojure.tools.logging :as log])
@@ -14,7 +14,7 @@
                      subcat-1-1-principle-comp-subcat-1 subcat-2-principle
                      subcat-2-2-principle subcat-5-principle]]
    [clojure.core.cache :as cache]
-   [dag_unify.core :refer (fail? get-in merge strip-refs unify unifyc)]))
+   [dag_unify.core :refer (fail? get-in strip-refs unify unifyc)]))
 (declare against-pred)
 (declare matching-head-lexemes)


add morph function

add morph function

--- src/clj/game/cards.clj
+++ src/clj/game/cards.clj
@@ -1,4 +1,10 @@
 (in-ns 'game.core)
+
+(defn morph [state side card new old]
+  (update! state side (assoc card :subtype (->> (remove #(= old %) (.split (:subtype card) " - "))
+                                                vec (concat [new]) distinct (join " - "))))
+  (update-ice-strength state side card)
+  (update-run-ice state side))

 (def trash-program {:prompt "Choose a program to trash" :label "Trash a program"
                     :msg (msg "trash " (:title target))


Fix Parasite infinite recursion with Grimoire out.

--- src/clj/game/cards.clj
+++ src/clj/game/cards.clj
@@ -1865,9 +1865,10 @@
               :effect (effect (ice-strength-bonus (- (get-virus-counters state side card))))}
              :ice-strength-changed
              {:req (req (and (= (:cid target) (:cid (:host card))) (<= (:current-strength target) 0)))
-              :effect (req (when (get-in card [:special :installing])
-                             (trigger-event state side :runner-install card)
-                             (update! state side (update-in card [:special] dissoc :installing)))
+              :effect (req (unregister-events state side card)
+                           (when (get-in card [:special :installing])
+                             (update! state side (update-in card [:special] dissoc :installing))
+                             (trigger-event state side :runner-install card))
                            (trash state side target))
               :msg (msg "trash " (:title target))}}}


Bumping project version for release

Bumping project version for release

--- project.clj
+++ project.clj
@@ -1,4 +1,4 @@
-(defproject booklet-chrome "0.2.0-SNAPSHOT"
+(defproject booklet-chrome "0.2.0"
   :license {:name "Eclipse Public License"
             :url  "http://www.eclipse.org/legal/epl-v10.html"}
   :dependencies [[org.clojure/clojure "1.7.0"]


debug env vars

debug env vars

--- src/clj/shale/core.clj
+++ src/clj/shale/core.clj
@@ -49,6 +49,9 @@
         host (if (and host (keyword? host) (namespace host) (= "env" (namespace host)))
                (get env/env host)
                host)]
+    (when (not host)
+      (logging/infof "env: %s" env/env))
+    (assert host)
     {:pool {} :spec {:host host :port port :db db}}))

 (defn keyvals->system [kv]


Add percent "range" to linear scale. This might be a terrible idea just for syntactic sugar...

--- src/cljs/c2/scale.cljs
+++ src/cljs/c2/scale.cljs
@@ -3,13 +3,21 @@
 (defn linear [& {:keys [domain range]
                  :or {domain [0 1]
                       range  [0 1]}}]
-  (let [domain-length (- (last domain) (first domain))
-        range-length (- (last range) (first range))]
-    (fn [x]
-      (+ (first range)
-         (* range-length
-            (/ (- x (first domain))
-               domain-length))))))
+
+  ;;Special arguments; what is this? RUBY!?!
+  ;;Terrible idea?
+  (if (= range :percent)
+    #(str
+      (apply (linear :domain domain :range [0 100]) %&)
+      "%")
+
+    (let [domain-length (- (last domain) (first domain))
+          range-length (- (last range) (first range))]
+      (fn [x]
+        (+ (first range)
+           (* range-length
+              (/ (- x (first domain))
+                 domain-length)))))))

 (defn log [& {:keys [domain range]


test hook

test hook

--- src/main/cawala/api/read.clj
+++ src/main/cawala/api/read.clj
@@ -6,7 +6,7 @@
                      :person/relation :friend}
                  2  {:db/id 2 :person/name "Sally" :person/age 22
                      :person/relation :friend}
-                 3  {:db/id 3 :person/name "Allie" :person/age 60
+                 3  {:db/id 3 :person/name "Allie" :person/age 59
                      :person/relation :enemy}
                  4  {:db/id 4 :person/name "Zoe" :person/age 32
                      :person/relation :friend}


docstrings, private vars

docstrings, private vars

--- src/main/compassus/core.cljs
+++ src/main/compassus/core.cljs
@@ -36,10 +36,7 @@
                       :props   route-data})
             (factory route-data)))))))

-(defprotocol ICompassus
-  (-mount! [this target]))
-
-(defrecord CompassusApplication [config state])
+(defrecord ^:private CompassusApplication [config state])

 (defn application?
   "Returns true if x is a Compassus application"
@@ -95,12 +92,12 @@
             (map? query) (get route))}])

 (defn dispatch
-  "Helper function for implementing the read and mutate multimethods.
+  "Helper function for implementing Compassus internal read and mutate multimethods.
    Dispatches on the remote target and the parser dispatch key."
   [{:keys [target]} key _]
   [target key])

-(defmulti read dispatch)
+(defmulti ^:private read dispatch)

 (defmethod read :default
   [{:keys [target] :as env} key params]
@@ -139,7 +136,7 @@
     (when-not (empty? ret)
       {:remote (parser/expr->ast (first ret))})))

-(defmulti mutate dispatch)
+(defmulti ^:private mutate dispatch)

 (defmethod mutate :default
   [{:keys [target] :as env} key params]


add application/wasm mime type

add application/wasm mime type

--- src/main/shadow/undertow.clj
+++ src/main/shadow/undertow.clj
@@ -346,6 +346,7 @@
             ;; FIXME: make this configurable?
             (.addMapping "map" "application/json")
             (.addMapping "edn" "application/edn")
+            (.addMapping "wasm" "application/wasm")
             (.build))

         handler-state


Implement Harbringer

Implement Harbringer

--- src/clj/game/cards-programs.clj
+++ src/clj/game/cards-programs.clj
@@ -145,6 +145,11 @@
                      :effect (effect (add-prop :runner card :counter 1))}}
     :abilities [{:counter-cost 1 :cost [:click 1] :msg "force the Corp to trash the top card of R&D"
                  :effect (effect (mill :corp))}]}
+
+    "Harbinger"
+    {:trash-effect
+      {:req (req (not (some #{:facedown} (:previous-zone card))))
+       :effect (effect (runner-install card {:facedown true}))}}

    "Hemorrhage"
    {:events {:successful-run {:effect (effect (add-prop card :counter 1))}}
@@ -268,7 +273,7 @@
                  :effect (req (let [ice target]
                            (resolve-ability
                               state :runner
-                              {:prompt (msg "Choose a type")
+                              {:prompt (msg "Choose a type")
                                :choices ["sentry" "code gate" "barrier"]
                                :msg (msg "give " (:title ice) " " target " until the end of next run this turn")}
                               card nil)))}]}


add rules to refresh data on info page based on event

--- src/clj/swarmpit/event/rule.clj
+++ src/clj/swarmpit/event/rule.clj
@@ -15,7 +15,17 @@
          (some? service-id)
          (contains? supported-actions (:Action event)))))

-(def service-container-event
+(defn- service-info-data
+  [event]
+  (let [service-id (get-in event [:Actor :Attributes :com.docker.swarm.service.id])
+        service (api/service service-id)
+        tasks (api/service-tasks service-id)
+        networks (api/service-networks service-id)]
+    {:service  service
+     :tasks    tasks
+     :networks networks}))
+
+(def service-list-container-event
   (reify Rule
     (match? [_ event]
       (service-container-event? event))
@@ -25,7 +35,29 @@
     (subscribed-data [_ event]
       (api/services-memo))))

-(def task-container-event
+(def service-info-by-name-container-event
+  (reify Rule
+    (match? [_ event]
+      (service-container-event? event))
+    (subscription [_ event]
+      (let [service-name (get-in event [:Actor :Attributes :com.docker.swarm.service.name])]
+        {:handler :service-info
+         :params  {:id service-name}}))
+    (subscribed-data [_ event]
+      (service-info-data event))))
+
+(def service-info-by-id-container-event
+  (reify Rule
+    (match? [_ event]
+      (service-container-event? event))
+    (subscription [_ event]
+      (let [service-id (get-in event [:Actor :Attributes :com.docker.swarm.service.id])]
+        {:handler :service-info
+         :params  {:id service-id}}))
+    (subscribed-data [_ event]
+      (service-info-data event))))
+
+(def task-list-container-event
   (reify Rule
     (match? [_ event]
       (service-container-event? event))
@@ -35,7 +67,7 @@
     (subscribed-data [_ event]
       (api/tasks-memo))))

-(def service-event
+(def service-list-event
   (reify Rule
     (match? [_ event]
       (= "service" (:Type event)))
@@ -45,7 +77,29 @@
     (subscribed-data [_ event]
       (api/services))))

-(def node-event
+(def service-info-by-name-event
+  (reify Rule
+    (match? [_ event]
+      (= "service" (:Type event)))
+    (subscription [_ event]
+      (let [service-name (get-in event [:Actor :Attributes :com.docker.swarm.service.name])]
+        {:handler :service-info
+         :params  {:id service-name}}))
+    (subscribed-data [_ event]
+      (service-info-data event))))
+
+(def service-info-by-id-event
+  (reify Rule
+    (match? [_ event]
+      (= "service" (:Type event)))
+    (subscription [_ event]
+      (let [service-id (get-in event [:Actor :Attributes :com.docker.swarm.service.id])]
+        {:handler :service-info
+         :params  {:id service-id}}))
+    (subscribed-data [_ event]
+      (service-info-data event))))
+
+(def node-list-event
   (reify Rule
     (match? [_ event]
       (= "node" (:Type event)))
@@ -55,7 +109,11 @@
     (subscribed-data [_ event]
       (api/nodes))))

-(def list [service-container-event
-           task-container-event
-           service-event
-           node-event])+(def list [service-list-container-event
+           service-list-event
+           service-info-by-name-container-event
+           service-info-by-id-container-event
+           service-info-by-name-event
+           service-info-by-id-event
+           task-list-container-event
+           node-list-event])


Fix var warnings from cljs

Fix var warnings from cljs

--- src/clj/todomvc/tuplerules.cljc
+++ src/clj/todomvc/tuplerules.cljc
@@ -7,19 +7,20 @@
     #?(:cljs (:require-macros todomvc.tuplerules)))

 ;; This technique borrowed from Prismatic's schema library (via clara).
-(defn compiling-cljs?
-  "Return true if we are currently generating cljs code.  Useful because cljx does not
-         provide a hook for conditional macro expansion."
-  []
-  (boolean
-    (when-let [n (find-ns 'cljs.analyzer)]
-      (when-let [v (ns-resolve n '*cljs-file*)]
-        ;; We perform this require only if we are compiling ClojureScript
-        ;; so non-ClojureScript users do not need to pull in
-        ;; that dependency.
-        (require 'clara.macros)
-        (require 'todomvc.macros)
-        @v))))
+#?(:clj
+    (defn compiling-cljs?
+      "Return true if we are currently generating cljs code.  Useful because cljx does not
+             provide a hook for conditional macro expansion."
+      []
+      (boolean
+        (when-let [n (find-ns 'cljs.analyzer)]
+          (when-let [v (ns-resolve n '*cljs-file*)]
+            ;; We perform this require only if we are compiling ClojureScript
+            ;; so non-ClojureScript users do not need to pull in
+            ;; that dependency.
+            (require 'clara.macros)
+            (require 'todomvc.macros)
+            @v)))))

 #?(:clj
    (defmacro def-tuple-session


Allow to add a task in the app state but that is ugly

--- src/cljs/clojure_rest/core.cljs
+++ src/cljs/clojure_rest/core.cljs
@@ -14,7 +14,7 @@
 (defonce next-task-id (atom 0))
 (defonce next-card-id (atom 0))

-(defn create-task
+(defn create-task!
   "Create a task to display in a card"
   [name done]
   (swap! next-task-id inc)
@@ -22,7 +22,7 @@
    :name name
    :done done})

-(defn create-card
+(defn create-card!
   "Create a card to display in the dash-board"
   [title description category status & tasks]
   (swap! next-card-id inc)
@@ -63,29 +63,37 @@

 (def card-list (r/atom []))

+(defn add-task-to!
+  [card-id task]
+  (defn add-if! [card]
+    (if (= card-id (:card-id card))
+      (update-in card [:tasks] conj (create-task! task false))
+      card))
+  (swap! card-list #(mapv add-if! %)))
+
 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

 (def init-card-list
   "Fake card list returned by the server"
-  [(create-card
+  [(create-card!
      "1st card"
      "This is my first description"
      :bug-fix
      :backlog
-     (create-task "Done some stuff" true))
-   (create-card
+     (create-task! "Done some stuff" true))
+   (create-card!
      "2nd card"
      "This is my second description"
      :enhancement
      :under-dev
-     (create-task "Done some stuff" true)
-     (create-task "Done some more stuff" false))
-   (create-card
+     (create-task! "Done some stuff" true)
+     (create-task! "Done some more stuff" false))
+   (create-card!
      "3rd card"
      "This is my third description"
      :bug-fix
      :under-dev)
-   (create-card
+   (create-card!
      "4th card"
      "This is my fourth description"
      :enhancement
@@ -132,7 +140,7 @@
         title-style #(if % :div.card__title--is-open :div.card__title)
         add-task (fn [card-id e]
                    (when (= "Enter" (.-key e))
-                     (js/alert "Find the task and add one task to it")
+                     (add-task-to! card-id (.. e -target -value))
                      (set! (.. e -target -value) "")
                    ))
         ]


Remove surface forms with added middle names

--- src/cljs/db_quiz/normalize.cljs
+++ src/cljs/db_quiz/normalize.cljs
@@ -4,6 +4,15 @@
             [db-quiz.state :refer [app-state]]
             [clojure.string :refer [join lower-case replace split trim]]))

+(def ^:private lowercase
+  "Regular expression for lowercase characters.
+  (Since JavaScript lacks Unicode character classes)"
+  "[a-záčďéíňóöřšťúž]")
+
+(def ^:private uppercase
+  "Regular expression for uppercase characters."
+  "[A-ZÁČĎÉÍŇÓÖŘŠŤÚŽ]")
+
 (defn abbreviate-tokens
   "Convert tokens into an abbreviation."
   [tokens]
@@ -14,6 +23,11 @@
   "Replace consecutive whitespace characters with a single space."
   [text]
   (replace text #"\s{2,}" " "))
+
+(defn tokenize
+  "Split s into tokens delimited by whitespace."
+  [s]
+  (split s #"\s+|-"))

 (defn clear-tokens
   "Filter out roman numerals"
@@ -28,6 +42,22 @@
   (-> text
       (replace #"\s*\([^)]+\)" "")
       (replace #"\s*\[[^\]]+\]" "")))
+
+(def name-like?
+  "Detect if `text` looks like a name.
+  It needs to have 2 capitalized words, e.g., 'Aaaa Aaaaaa'."
+  (let [name-regex (re-pattern (str "^" uppercase lowercase "+\\s+" uppercase lowercase "+$"))]
+    (fn [text]
+      (re-matches name-regex text))))
+
+(def name->regex
+  "Convert a name into a regular expression that matches it with a middle name added."
+  (let [name-regex (str uppercase lowercase "+")
+        apostrophes-regex "[\"']?"]
+    (fn [text]
+      (let [[first-name last-name] (take 2 (tokenize text))]
+        (re-pattern (str first-name "\\s+(" apostrophes-regex
+                         name-regex apostrophes-regex "\\s+){1,2}" last-name))))))

 (defn remove-punctuation
   "Remove punctuation from s.
@@ -240,11 +270,6 @@
   [s]
   (replace s #"\.(?=\u0041|\u0042|\u0043|\u0044|\u0045|\u0046|\u0047|\u0048|\u0049|\u004A|\u004B|\u004C|\u004D|\u004E|\u004F|\u0050|\u0051|\u0052|\u0053|\u0054|\u0055|\u0056|\u0057|\u0058|\u0059|\u005A|\u00C0|\u00C1|\u00C2|\u00C3|\u00C4|\u00C5|\u00C6|\u00C7|\u00C8|\u00C9|\u00CA|\u00CB|\u00CC|\u00CD|\u00CE|\u00CF|\u00D0|\u00D1|\u00D2|\u00D3|\u00D4|\u00D5|\u00D6|\u00D8|\u00D9|\u00DA|\u00DB|\u00DC|\u00DD|\u00DE|\u0100|\u0102|\u0104|\u0106|\u0108|\u010A|\u010C|\u010E|\u0110|\u0112|\u0114|\u0116|\u0118|\u011A|\u011C|\u011E|\u0120|\u0122|\u0124|\u0126|\u0128|\u012A|\u012C|\u012E|\u0130|\u0132|\u0134|\u0136|\u0139|\u013B|\u013D|\u013F|\u0141|\u0143|\u0145|\u0147|\u014A|\u014C|\u014E|\u0150|\u0152|\u0154|\u0156|\u0158|\u015A|\u015C|\u015E|\u0160|\u0162|\u0164|\u0166|\u0168|\u016A|\u016C|\u016E|\u0170|\u0172|\u0174|\u0176|\u0178|\u0179|\u017B|\u017D|\u0181|\u0182|\u0184|\u0186|\u0187|\u0189|\u018A|\u018B|\u018E|\u018F|\u0190|\u0191|\u0193|\u0194|\u0196|\u0197|\u0198|\u019C|\u019D|\u019F|\u01A0|\u01A2|\u01A4|\u01A6|\u01A7|\u01A9|\u01AC|\u01AE|\u01AF|\u01B1|\u01B2|\u01B3|\u01B5|\u01B7|\u01B8|\u01BC|\u01C4|\u01C7|\u01CA|\u01CD|\u01CF|\u01D1|\u01D3|\u01D5|\u01D7|\u01D9|\u01DB|\u01DE|\u01E0|\u01E2|\u01E4|\u01E6|\u01E8|\u01EA|\u01EC|\u01EE|\u01F1|\u01F4|\u01F6|\u01F7|\u01F8|\u01FA|\u01FC|\u01FE|\u0200|\u0202|\u0204|\u0206|\u0208|\u020A|\u020C|\u020E|\u0210|\u0212|\u0214|\u0216|\u0218|\u021A|\u021C|\u021E|\u0220|\u0222|\u0224|\u0226|\u0228|\u022A|\u022C|\u022E|\u0230|\u0232|\u023A|\u023B|\u023D|\u023E|\u0241|\u0243|\u0244|\u0245|\u0246|\u0248|\u024A|\u024C|\u024E|\u0370|\u0372|\u0376|\u0386|\u0388|\u0389|\u038A|\u038C|\u038E|\u038F|\u0391|\u0392|\u0393|\u0394|\u0395|\u0396|\u0397|\u0398|\u0399|\u039A|\u039B|\u039C|\u039D|\u039E|\u039F|\u03A0|\u03A1|\u03A3|\u03A4|\u03A5|\u03A6|\u03A7|\u03A8|\u03A9|\u03AA|\u03AB|\u03CF|\u03D2|\u03D3|\u03D4|\u03D8|\u03DA|\u03DC|\u03DE|\u03E0|\u03E2|\u03E4|\u03E6|\u03E8|\u03EA|\u03EC|\u03EE|\u03F4|\u03F7|\u03F9|\u03FA|\u03FD|\u03FE|\u03FF|\u0400|\u0401|\u0402|\u0403|\u0404|\u0405|\u0406|\u0407|\u0408|\u0409|\u040A|\u040B|\u040C|\u040D|\u040E|\u040F|\u0410|\u0411|\u0412|\u0413|\u0414|\u0415|\u0416|\u0417|\u0418|\u0419|\u041A|\u041B|\u041C|\u041D|\u041E|\u041F|\u0420|\u0421|\u0422|\u0423|\u0424|\u0425|\u0426|\u0427|\u0428|\u0429|\u042A|\u042B|\u042C|\u042D|\u042E|\u042F|\u0460|\u0462|\u0464|\u0466|\u0468|\u046A|\u046C|\u046E|\u0470|\u0472|\u0474|\u0476|\u0478|\u047A|\u047C|\u047E|\u0480|\u048A|\u048C|\u048E|\u0490|\u0492|\u0494|\u0496|\u0498|\u049A|\u049C|\u049E|\u04A0|\u04A2|\u04A4|\u04A6|\u04A8|\u04AA|\u04AC|\u04AE|\u04B0|\u04B2|\u04B4|\u04B6|\u04B8|\u04BA|\u04BC|\u04BE|\u04C0|\u04C1|\u04C3|\u04C5|\u04C7|\u04C9|\u04CB|\u04CD|\u04D0|\u04D2|\u04D4|\u04D6|\u04D8|\u04DA|\u04DC|\u04DE|\u04E0|\u04E2|\u04E4|\u04E6|\u04E8|\u04EA|\u04EC|\u04EE|\u04F0|\u04F2|\u04F4|\u04F6|\u04F8|\u04FA|\u04FC|\u04FE|\u0500|\u0502|\u0504|\u0506|\u0508|\u050A|\u050C|\u050E|\u0510|\u0512|\u0514|\u0516|\u0518|\u051A|\u051C|\u051E|\u0520|\u0522|\u0531|\u0532|\u0533|\u0534|\u0535|\u0536|\u0537|\u0538|\u0539|\u053A|\u053B|\u053C|\u053D|\u053E|\u053F|\u0540|\u0541|\u0542|\u0543|\u0544|\u0545|\u0546|\u0547|\u0548|\u0549|\u054A|\u054B|\u054C|\u054D|\u054E|\u054F|\u0550|\u0551|\u0552|\u0553|\u0554|\u0555|\u0556|\u10A0|\u10A1|\u10A2|\u10A3|\u10A4|\u10A5|\u10A6|\u10A7|\u10A8|\u10A9|\u10AA|\u10AB|\u10AC|\u10AD|\u10AE|\u10AF|\u10B0|\u10B1|\u10B2|\u10B3|\u10B4|\u10B5|\u10B6|\u10B7|\u10B8|\u10B9|\u10BA|\u10BB|\u10BC|\u10BD|\u10BE|\u10BF|\u10C0|\u10C1|\u10C2|\u10C3|\u10C4|\u10C5|\u1E00|\u1E02|\u1E04|\u1E06|\u1E08|\u1E0A|\u1E0C|\u1E0E|\u1E10|\u1E12|\u1E14|\u1E16|\u1E18|\u1E1A|\u1E1C|\u1E1E|\u1E20|\u1E22|\u1E24|\u1E26|\u1E28|\u1E2A|\u1E2C|\u1E2E|\u1E30|\u1E32|\u1E34|\u1E36|\u1E38|\u1E3A|\u1E3C|\u1E3E|\u1E40|\u1E42|\u1E44|\u1E46|\u1E48|\u1E4A|\u1E4C|\u1E4E|\u1E50|\u1E52|\u1E54|\u1E56|\u1E58|\u1E5A|\u1E5C|\u1E5E|\u1E60|\u1E62|\u1E64|\u1E66|\u1E68|\u1E6A|\u1E6C|\u1E6E|\u1E70|\u1E72|\u1E74|\u1E76|\u1E78|\u1E7A|\u1E7C|\u1E7E|\u1E80|\u1E82|\u1E84|\u1E86|\u1E88|\u1E8A|\u1E8C|\u1E8E|\u1E90|\u1E92|\u1E94|\u1E9E|\u1EA0|\u1EA2|\u1EA4|\u1EA6|\u1EA8|\u1EAA|\u1EAC|\u1EAE|\u1EB0|\u1EB2|\u1EB4|\u1EB6|\u1EB8|\u1EBA|\u1EBC|\u1EBE|\u1EC0|\u1EC2|\u1EC4|\u1EC6|\u1EC8|\u1ECA|\u1ECC|\u1ECE|\u1ED0|\u1ED2|\u1ED4|\u1ED6|\u1ED8|\u1EDA|\u1EDC|\u1EDE|\u1EE0|\u1EE2|\u1EE4|\u1EE6|\u1EE8|\u1EEA|\u1EEC|\u1EEE|\u1EF0|\u1EF2|\u1EF4|\u1EF6|\u1EF8|\u1EFA|\u1EFC|\u1EFE|\u1F08|\u1F09|\u1F0A|\u1F0B|\u1F0C|\u1F0D|\u1F0E|\u1F0F|\u1F18|\u1F19|\u1F1A|\u1F1B|\u1F1C|\u1F1D|\u1F28|\u1F29|\u1F2A|\u1F2B|\u1F2C|\u1F2D|\u1F2E|\u1F2F|\u1F38|\u1F39|\u1F3A|\u1F3B|\u1F3C|\u1F3D|\u1F3E|\u1F3F|\u1F48|\u1F49|\u1F4A|\u1F4B|\u1F4C|\u1F4D|\u1F59|\u1F5B|\u1F5D|\u1F5F|\u1F68|\u1F69|\u1F6A|\u1F6B|\u1F6C|\u1F6D|\u1F6E|\u1F6F|\u1FB8|\u1FB9|\u1FBA|\u1FBB|\u1FC8|\u1FC9|\u1FCA|\u1FCB|\u1FD8|\u1FD9|\u1FDA|\u1FDB|\u1FE8|\u1FE9|\u1FEA|\u1FEB|\u1FEC|\u1FF8|\u1FF9|\u1FFA|\u1FFB|\u2102|\u2107|\u210B|\u210C|\u210D|\u2110|\u2111|\u2112|\u2115|\u2119|\u211A|\u211B|\u211C|\u211D|\u2124|\u2126|\u2128|\u212A|\u212B|\u212C|\u212D|\u2130|\u2131|\u2132|\u2133|\u213E|\u213F|\u2145|\u2183|\u2C00|\u2C01|\u2C02|\u2C03|\u2C04|\u2C05|\u2C06|\u2C07|\u2C08|\u2C09|\u2C0A|\u2C0B|\u2C0C|\u2C0D|\u2C0E|\u2C0F|\u2C10|\u2C11|\u2C12|\u2C13|\u2C14|\u2C15|\u2C16|\u2C17|\u2C18|\u2C19|\u2C1A|\u2C1B|\u2C1C|\u2C1D|\u2C1E|\u2C1F|\u2C20|\u2C21|\u2C22|\u2C23|\u2C24|\u2C25|\u2C26|\u2C27|\u2C28|\u2C29|\u2C2A|\u2C2B|\u2C2C|\u2C2D|\u2C2E|\u2C60|\u2C62|\u2C63|\u2C64|\u2C67|\u2C69|\u2C6B|\u2C6D|\u2C6E|\u2C6F|\u2C72|\u2C75|\u2C80|\u2C82|\u2C84|\u2C86|\u2C88|\u2C8A|\u2C8C|\u2C8E|\u2C90|\u2C92|\u2C94|\u2C96|\u2C98|\u2C9A|\u2C9C|\u2C9E|\u2CA0|\u2CA2|\u2CA4|\u2CA6|\u2CA8|\u2CAA|\u2CAC|\u2CAE|\u2CB0|\u2CB2|\u2CB4|\u2CB6|\u2CB8|\u2CBA|\u2CBC|\u2CBE|\u2CC0|\u2CC2|\u2CC4|\u2CC6|\u2CC8|\u2CCA|\u2CCC|\u2CCE|\u2CD0|\u2CD2|\u2CD4|\u2CD6|\u2CD8|\u2CDA|\u2CDC|\u2CDE|\u2CE0|\u2CE2|\uA640|\uA642|\uA644|\uA646|\uA648|\uA64A|\uA64C|\uA64E|\uA650|\uA652|\uA654|\uA656|\uA658|\uA65A|\uA65C|\uA65E|\uA662|\uA664|\uA666|\uA668|\uA66A|\uA66C|\uA680|\uA682|\uA684|\uA686|\uA688|\uA68A|\uA68C|\uA68E|\uA690|\uA692|\uA694|\uA696|\uA722|\uA724|\uA726|\uA728|\uA72A|\uA72C|\uA72E|\uA732|\uA734|\uA736|\uA738|\uA73A|\uA73C|\uA73E|\uA740|\uA742|\uA744|\uA746|\uA748|\uA74A|\uA74C|\uA74E|\uA750|\uA752|\uA754|\uA756|\uA758|\uA75A|\uA75C|\uA75E|\uA760|\uA762|\uA764|\uA766|\uA768|\uA76A|\uA76C|\uA76E|\uA779|\uA77B|\uA77D|\uA77E|\uA780|\uA782|\uA784|\uA786|\uA78B|\uFF21|\uFF22|\uFF23|\uFF24|\uFF25|\uFF26|\uFF27|\uFF28|\uFF29|\uFF2A|\uFF2B|\uFF2C|\uFF2D|\uFF2E|\uFF2F|\uFF30|\uFF31|\uFF32|\uFF33|\uFF34|\uFF35|\uFF36|\uFF37|\uFF38|\uFF39|\uFF3A)" ". "))

-(defn tokenize
-  "Split s into tokens delimited by whitespace."
-  [s]
-  (split s #"\s+|-"))
-
 (defn trim-player-name
   "Trim player's name if it's too long.
   Returns a vector [trimmed-name font-class]."
@@ -298,17 +323,21 @@
         clean-label (clear-label label)
         tokens (clear-tokens (tokenize clean-label))
         abbreviation (abbreviate-tokens tokens)
+        labels [label clean-label]
+        ; Filter empty and < 2 characters long surface forms
+        filter-surface-form (every-pred (complement (partial re-matches #"^\s+$"))
+                                        (comp (partial < 2) count))
+        ; Expand name-like labels into regular expressions allowing middle name.
+        expand-name (fn [& names] (map name->regex (filter name-like? names)))
         ; Sort surface forms from the longest to the shortest, so that we first replace
-        ; the longer matches.
+        ; the longer matches.
         surface-forms (if despoilerify?
-                          (sort-by (comp - count)
-                               ; Filter empty and < 2 characters long surface forms
-                               (distinct (conj (filter (every-pred (complement (partial re-matches #"^\s+$"))
-                                                                   (comp (partial < 2) count))
-                                                       (split surfaceForms "|"))
-                                              clean-label
-                                              label)))
-                          [label clean-label])]
+                          (concat (expand-name label clean-label)
+                                  (sort-by (comp - count)
+                                           (distinct (concat labels
+                                                             (filter filter-surface-form
+                                                                     (split surfaceForms "|"))))))
+                          labels)]
     (assoc item
            :abbreviation abbreviation
            :description (-> description
@@ -343,5 +372,5 @@
                                         placeholder))
                                     tail
                                     tail-range))))
-              tokens
+              tokens
               (map range tail-offsets (rest tail-offsets))))))


Implements the first working version that shows the cells on UI

Still rough around the edges but it's working

--- src/cljs/game_of_life/core.cljs
+++ src/cljs/game_of_life/core.cljs
@@ -2,21 +2,117 @@
     (:require [reagent.core :as reagent :refer [atom]]
               [reagent.session :as session]
               [secretary.core :as secretary :include-macros true]
-              [accountant.core :as accountant]))
+              [accountant.core :as accountant]
+              [game-of-life.rules :as rules]
+              [clojure.core.matrix :as matrix]))
+
+(enable-console-print!)
+
+(def g [[1 0 0 0 0 1 0 0 0 1]
+        [0 1 0 0 1 0 0 0 0 0]
+        [0 0 1 1 0 0 0 0 0 0]
+        [0 0 1 1 0 0 0 0 0 0]
+        [0 1 0 0 1 0 0 0 0 0]
+        [1 0 0 0 0 1 0 0 0 0]
+        [0 0 0 0 0 0 0 0 0 0]
+        [0 0 0 0 0 0 0 0 0 0]
+        [0 0 0 0 0 0 0 0 0 0]
+        [1 0 0 0 0 0 0 0 0 1]
+        ])
+
+(def empty-grid [[0 0 0]
+                 [0 0 0]
+                 [0 0 0]])
+
+(def test-grid [0 1 0 1])
+
+(def app-state (atom {:grid g
+                      :test-grid test-grid
+                      ;;:running? false
+                      :timer nil
+                      :settings {:cell-size 10
+                                 :live-cell-color "red"
+                                 :dead-cell-color "white"}}))
+
+(println "empty grid: " empty-grid)
+(println "current grid: " (get-in @app-state [:grid]))
+;;(println "next gen: " (rules/next-generation g))
+
+(defn test-canvas
+  "Creates animated clock based on seconds only."
+  []
+  (let [comp-state (atom {})]
+    (reagent/create-class
+     {
+      :component-did-mount
+      (fn [comp]
+        (reset! comp-state {:ctx (.getContext (reagent/dom-node comp) "2d")}))
+      :display-name "game-of-life-grid"
+      :reagent-render (fn [comp]
+                        (let [ctx  (get-in @comp-state [:ctx])
+                              grid (get-in @app-state  [:grid])
+                              {:keys [cell-size
+                                      live-cell-color
+                                      dead-cell-color]} (get-in @app-state [:settings])]
+                          (if ctx
+                            (let [render-cell! (fn [[y x] item]
+                                              (if (= item 1)
+                                                (set! (.-fillStyle ctx) live-cell-color)
+                                                (set! (.-fillStyle ctx) dead-cell-color))
+                                              (let [slot-x (* cell-size x)
+                                                    slot-y (* cell-size y)]
+                                                (.fillRect ctx slot-x slot-y cell-size cell-size)))]
+                              (matrix/emap-indexed render-cell! grid)))
+
+                          )
+                        (println "comp-state: " @comp-state)
+                        (println "app-state: " @app-state)
+                        [:canvas {:width 200 :height 200 :style {:border "1px solid black" }}])})))
+
+(defn start-game! []
+  (swap! app-state update-in [:running] (constantly true))
+  ;; (loop []
+  ;;   (if (get-in @app-state [:running])
+  ;;     (do
+  ;;       (js/setTimeout #(println "running") 1000)
+  ;;       (recur))))
+  (let [next-gen! (fn []
+                    (let [next-gen (rules/next-generation (:grid @app-state))]
+                      (println "next gen: " next-gen)
+                      (swap! app-state update-in [:grid] (constantly next-gen))))
+        create-timer (js/setInterval next-gen! 2000)]
+    (swap! app-state update-in [:timer] (constantly create-timer))))
+
+(defn stop-game! []
+  ;; (swap! app-state update-in [:running] (constantly true))
+  ;; (loop []
+  ;;   (if (get-in @app-state [:running])
+  ;;     ))
+  (println "Stopping timer")
+  (js/clearInterval (:timer @app-state))
+  (swap! app-state update-in [:timer] (constantly nil))
+  ;;(js/alert "stop")
+  )

 ;; -------------------------
 ;; Views

 (defn home-page []
-  [:div [:h2 "Welcome to game-of-life"]
-   [:div [:a {:href "/about"} "go to about page"]]])
+  [:div [:h2 "Welcome to game-of-life 2"]
+   [:div [:a {:href "/about"} "go to about page"]
+    ]])

 (defn about-page []
   [:div [:h2 "About game-of-life"]
    [:div [:a {:href "/"} "go to the home page"]]])

 (defn current-page []
-  [:div [(session/get :current-page)]])
+  [:div ;;[(session/get :current-page)]
+   [:div [:h3 "Game of life"]
+    [test-canvas]]
+   [:div
+    [:button {:on-click #(start-game!) :disabled (not (nil? (:timer @app-state)))} "START"]
+    [:button {:on-click #(stop-game!)  :disabled (nil? (:timer @app-state))} "STOP"]]])

 ;; -------------------------
 ;; Routes


Update default music.

Update default music.


PLD: add missing funcs to interop

PLD: add missing funcs to interop

--- src/cljs/ona/utils/interop.cljs
+++ src/cljs/ona/utils/interop.cljs
@@ -3,10 +3,18 @@
             [goog.string.format]
             [goog.string]))

+(defn console-log [s]
+  "calls console.log after converting a cljs object to js."
+  (.log js/console (clj->js s)))
+
 (defn format
   "Formats a string using goog.string.format, so we can use format in cljx."
   [fmt & args]
   (apply goog.string/format fmt args))
+
+(defn redirect-to-url! [url]
+  "Re-directs the page to the given url."
+  (set! (.-location js/window) url))

 (defn safe-regex [s & {:keys [:ignore-case?]
                        :or    {:ignore-case? true}}]
@@ -36,4 +44,4 @@
 (defn format
   "Formats a string using goog.string.format, so we can use format in cljx."
   [fmt & args]
-  (apply goog.string/format fmt args))+  (apply goog.string/format fmt args))


added final refinement

added final refinement

--- src/mastersign/wordcloud.clj
+++ src/mastersign/wordcloud.clj
@@ -26,15 +26,16 @@
 (def default-args
   {:width 600
    :height 300
-   :precision 0.7
+   :precision 0.4
    :font base-font
    :min-font-size 14
    :max-font-size 60
    :max-test-radius 350
    :order-priority 0.7
-   :padding 3
-   :shape-mode :word-box ; :word-box, :glyph-box
+   :padding 4
+   :shape-mode :glyph-box ; :word-box, :glyph-box
    :allow-rotation true
+   :final-refine true
    :order-mode :value1 ; :id, :text, :value1, :value2
    :color-fn #'default-color-fn
    })
@@ -176,13 +177,46 @@
       [pos rotation]
       nil)))

+(defn- recur-seq
+  [f args]
+  (let [args* (apply f args)]
+    (if (nil? args*)
+      [args]
+      (cons
+       args
+       (recur-seq f args*)))))
+
+(defn- approach
+  [check-fn ref-pos pos rotation]
+  (let [sign #(if (< % 0) -1 1)
+        rx (int (.x ref-pos))
+        ry (int (.y ref-pos))
+        dx (- rx (int (.x pos)))
+        dy (- ry (int (.y pos)))
+        sx (sign dx)
+        sy (sign dy)
+        step-fn (fn [p r]
+                  (let [px (int (.x p))
+                        py (int (.y p))
+                        x (+ px sx)
+                        y (+ py sy)]
+                    (or
+                     (when (or (and (== sx -1) (> x rx)) (and (== sx 1) (< x rx))) (check-fn (point (+ (.x p) sx) (.y p)) r))
+                     (when (or (and (== sy -1) (> y ry)) (and (== sy 1) (< y ry))) (check-fn (point (.x p) (+ (.y p) sy)) r)))))]
+    (if (and (== 0 dx) (== 0 dy))
+      [pos rotation]
+      (last (recur-seq step-fn [pos rotation])))))
+
 (defn- find-position
-  [{:keys [allow-rotation] :as args} test-area boundaries point-sequence {:keys [word-bounds] :as word-info}]
-  (let [cp (partial check-position args test-area boundaries word-info)
-        cp (if allow-rotation
-               (fn [pos] (or (cp pos 0) (cp pos 90) (cp pos 270)))
-               (fn [pos] (cp pos 0)))]
-    (first (filter #(not (nil? %)) (map cp point-sequence)))))
+  [{:keys [allow-rotation final-refine] :as args} test-area boundaries point-sequence {:keys [word-bounds] :as word-info}]
+  (let [check (partial check-position args test-area boundaries word-info)
+        check* (if allow-rotation
+               (fn [pos] (or (check pos 0) (check pos 90) (check pos 270)))
+               (fn [pos] (check pos 0)))
+        [p a] (first (filter #(not (nil? %)) (map check* point-sequence)))]
+    (if (and final-refine (not (nil? p)))
+      (approach check (point) p a)
+      [p a])))

 (defn- add-word-to-area!
   [args *area* word-info pos rotation]


Checkpoint

Checkpoint

Signed-off-by: Gregory Haskins <640d9fe47775e6723f0355b7315e38f7d98d3539@gmail.com>

--- src/obcc/build/interface.clj
+++ src/obcc/build/interface.clj
@@ -73,7 +73,8 @@
 ;;-----------------------------------------------------------------
 (defn buildfields [ast]
   (let [rawfields (getfields ast)]
-    (map (fn [[index {:keys [modifier type fieldName]}]] (->Field modifier (let [[_ _type] type] _type) fieldName index)) rawfields)))
+    (map (fn [[index {:keys [modifier type fieldName]}]]
+           (->Field modifier (let [[_ _type] type] _type) fieldName index)) rawfields)))

 (defn buildmessage [ast]
   (let [name (->> ast zip/right zip/node)


Used wrong key in ack message

Used wrong key in ack message

--- src/onyx/messaging/aeron.clj
+++ src/onyx/messaging/aeron.clj
@@ -414,7 +414,7 @@
   (if ((:short-circuitable? messenger) channel)
     (ack-segment-short-circuit (lookup-channels messenger acker-id) ack)
     (let [pub-man (get-publication messenger conn-info)]
-      (let [buf (protocol/build-acker-message acker-id (:acker-id ack) (:completion-id ack) (:ack-val ack))]
+      (let [buf (protocol/build-acker-message acker-id (:id ack) (:completion-id ack) (:ack-val ack))]
         (pubm/write pub-man buf 0 protocol/ack-msg-length)))))

 (defmethod extensions/internal-ack-segments AeronConnection


Import `clojure.set` for `rename-keys` in `record-spec`.

--- src/active/clojure/record_spec.cljc
+++ src/active/clojure/record_spec.cljc
@@ -15,7 +15,8 @@
     [(:require
       [active.clojure.condition :as c]
       [cljs.spec.alpha :as s :include-macros true]
-      [cljs.spec.gen.alpha :as gen :include-macros true])
+      [cljs.spec.gen.alpha :as gen :include-macros true]
+      [clojure.set :as set])
      (:require-macros [active.clojure.macro :refer [if-cljs]])]))

 (defn throw-illegal-argument-exception


Support optional 'amount' query param to gendata, overriding default behavior of doubling.

--- src/org/scode/httpgctest.clj
+++ src/org/scode/httpgctest.clj
@@ -26,11 +26,15 @@
 (def data (ref ["data"]))

 (defn serve-gendata [request]
-  (dosync
-   (alter data #(concat %1 (repeat (count %1) "data"))))
+  (let [amount (let [amstr (:amount (:query-params request))]
+                 (if amstr
+                   (Integer/parseInt amstr)
+                   (count @data)))]
+    (dosync
+     (alter data #(concat %1 (repeat amount "data"))))
   {:status 200
    :headers {}
-   :body (str "size is now " (count @data))})
+   :body (str "size is now " (count @data))}))

 (defroutes greeter
   (GET "/gengarbage"


Don't publish presence of scsynth via rendezvous by default

--- src/overtone/sc/defaults.clj
+++ src/overtone/sc/defaults.clj
@@ -82,7 +82,7 @@
    :max-w-buffers    {:default 64    :flag "-w" :desc "Number of wire buffers"}
    :num-rand-seeds   {:default 64    :flag "-r" :desc "Number of random seeds"}
    :load-sdefs?      {:default 1     :flag "-D" :desc "Load synthdefs on boot? 0 or 1"}
-   :rendezvous?      {:default 1     :flag "-R" :desc "Publish to rendezvous? 0 or 1"}
+   :rendezvous?      {:default 0     :flag "-R" :desc "Publish to rendezvous? 0 or 1"}
    :max-logins       {:default 64    :flag "-l" :desc "Maximum number of named return addresses stored - also maximum number of txp connections accepted."}
    :pwd              {:default nil   :flag "-p" :desc "When using TCP, the session password must be the first command sent."}
    :non-realtime     {:default nil   :flag "-N" :desc "Non-realtime mode. Requires a space separated string of <cmd-fielname> <input-filename> <output-filename> <sample-rate> <header-format> <sample-format>"}


alias naming

alias naming

--- src/cljs/client/components/activity/core.cljs
+++ src/cljs/client/components/activity/core.cljs
@@ -4,7 +4,8 @@
             [re-frame.core :as re-frame]
             [client.components.activity.handlers]
             [client.components.activity.subs]
-            [cljs-time.core :as ct]
+            [cljs-time.core :as t]
+            [cljs-time.coerce :as ct]
             [cljs-time.periodic :refer [periodic-seq]]
             [common.util :refer [log js-log]]))

@@ -13,9 +14,9 @@
 (def height 400)

 (defn- compute-date [week day]
-  (let [dow (- 7 (ct/day-of-week (ct/now)))]
-    (-> (ct/ago (ct/weeks (- 52 week)))
-        (ct/minus (ct/days (-  (- 6 day) dow))))))
+  (let [dow (- 7 (t/day-of-week (t/now)))]
+    (-> (t/ago (t/weeks (- 52 week)))
+        (t/minus (t/days (-  (- 6 day) dow))))))

 (defn- cal-grid []
   (let [weeks 53
@@ -69,10 +70,10 @@
                                       (attr "height" #(.-edge %))
                                       (attr "fill" "#fff")
                                       (attr "stroke" (fn [d]
-                                                       (when (ct/within?
-                                                               (ct/ago
-                                                                 (ct/years 1))
-                                                               (ct/now)
+                                                       (when (t/within?
+                                                               (t/ago
+                                                                 (t/years 1))
+                                                               (t/now)
                                                                (.-date d))
                                                          "#ddd")))
                                       (on "mouseover"
@@ -82,7 +83,7 @@
                                                 (duration 50)
                                                 (style "opacity" 0.9))
                                             (.. div
-                                                (html (.-date d)))))
+                                                (html (ct/to-local-date (.-date d))))))
                                       (on "mouseout"
                                           (fn [d]
                                             (.. div


only filter by book when not in edit-mode

--- src/cljs/iwaswhere_web/ui/entry/briefing.cljs
+++ src/cljs/iwaswhere_web/ui/entry/briefing.cljs
@@ -241,8 +241,10 @@
                 (let [allocation (get-in entry [:briefing :time-allocation k] 0)
                       actual (get-in (:time-by-book day-stats) [k] 0)
                       remaining (- allocation actual)
-                      click (fn [_]
-                              (swap! local update-in [:selected] #(if (= k %) nil k)))]
+                      click
+                      (fn [_]
+                        (when-not edit-mode?
+                          (swap! local update-in [:selected] #(if (= k %) nil k))))]
                   ^{:key (str :time-allocation k)}
                   [:div
                    (when (or (pos? allocation) (get actual-times k) edit-mode?)


Ditto

Ditto

--- src/clojure/clojurewerkz/cassaforte/query.clj
+++ src/clojure/clojurewerkz/cassaforte/query.clj
@@ -1,3 +1,12 @@
+;; Copyright (c) 2012-2014 Michael S. Klishin, Alex Petrov, and the ClojureWerkz Team
+;;
+;; The use and distribution terms for this software are covered by the
+;; Eclipse Public License 1.0 (http://opensource.org/licenses/eclipse-1.0.php)
+;; which can be found in the file epl-v10.html at the root of this distribution.
+;; By using this software in any fashion, you are agreeing to be bound by
+;; the terms of this license.
+;; You must not remove this notice, or any other, from this software.
+
 (ns clojurewerkz.cassaforte.query
   "Functions for building dynamic CQL queries, in case you feel
    that `cql` namespace is too limiting for you."


make logout a button

make logout a button

--- src/chat/client/views/pages/me.cljs
+++ src/chat/client/views/pages/me.cljs
@@ -73,8 +73,8 @@
         (dom/div #js {:className "content"}

           (dom/h2 nil "Log Out")
-          (dom/div #js {:className "logout"
-                        :onClick (fn [_] (dispatch! :logout nil))} "Log Out")
+          (dom/button #js {:className "logout"
+                           :onClick (fn [_] (dispatch! :logout nil))} "Log Out")

           (dom/h2 nil "Update Nickname")
           (om/build nickname-view (data :session))


Just warn if web server was already running.

Open the browser window if requested even so.

--- src/afterglow/core.clj
+++ src/afterglow/core.clj
@@ -118,17 +118,20 @@
 (defn start-web-server
   "Start the embedded web UI server on the specified port. If a truthy
   value is supplied for browser, opens a web browser window on the
-  newly launched server."
+  newly launched server. If the server was already running, logs a
+  warning. Either way, makes sure the background thread which cleans
+  up expired sessions is running."
   ([port]
    (start-web-server port false))
   ([port browser]
-   (when @web-server (throw (IllegalStateException. "Web UI server is already running.")))
-   (reset! web-server
-           (http-kit/run-server
-            app
-            {:port port}))
-   ;;Start the expired session cleanup job
-   (reset! session-cleaner (session/start-cleanup-job!))
+   (swap! web-server #(if %
+                       (timbre/warn "Not starting web server because it is already running.")
+                       (http-kit/run-server app {:port port})))
+
+   ;;Start the expired session cleanup job if needed
+   (swap! session-cleaner #(or % (session/start-cleanup-job!)))
+
+   ;; Launch the browser if requested
    (when browser (browse/browse-url (str "http://localhost:" port)))))

 (defn start-osc-server


Support vectors of device filters.

Support vectors of device filters.

Because of the increased complexity required by auto-binding support in
Windows, let device filters be vectors of filters, which match if any of
the constituents match.

--- src/afterglow/midi.clj
+++ src/afterglow/midi.clj
@@ -827,6 +827,9 @@
     (= (type device-filter) :midi-device)
     (describe-device-filter (:info device-filter))

+    (vector? device-filter)
+    (clojure.string/join "or " (map describe-device-filter device-filter))
+
     (ifn? device-filter)
     (format "returning true when passed to %s " device-filter)

@@ -858,6 +861,9 @@
   only the device it describes.

   * A `:midi-device` map, which will match only itself.
+
+  * A `vector` of device filters, which will match any device that
+  matches any filter.

   * A function, which will be called with each device, and the device
   will be included if the function returns a `true` value.
@@ -875,7 +881,10 @@
     (filter #(= (:info %) device-filter) devices)

     (= (type device-filter) :midi-device)
-    (filter #(= (@midi-device-key %) (@midi-device-key device-filter)) devices)
+    (filter #(= (:info %) (:info device-filter)) devices)
+
+    (vector? device-filter)
+    (filter (fn [device] (some seq (map #(filter-devices % [device]) device-filter))) devices)

     (ifn? device-filter)
     (filter device-filter devices)


Switch cond to case in view-dispatcher

Switch cond to case in view-dispatcher

--- src/discuss/views.cljs
+++ src/discuss/views.cljs
@@ -234,20 +234,20 @@
                 (dom/span nil (:dom-post reference))))))

 (defn view-dispatcher
-  "Dispatch current template in main view by the app state. "
+  "Dispatch current template in main view by the app state."
   [data]
   (reify om/IRender
     (render [_]
       (let [view (lib/current-view)]
         (dom/div #js {:className "panel panel-default"}
                  (dom/div #js {:className "panel-body"}
-                          (cond
-                            (= view :login) (om/build login-form {})
-                            (= view :options) (om/build options/view data)
-                            (= view :reference-usages) (om/build ref/usages-view data)
-                            (= view :reference-create-with-ref) (om/build ref/create-with-reference-view data)
-                            (= view :find) (om/build find/view data)
-                            :else (discussion-elements data))
+                          (case view
+                            :login (om/build login-form {})
+                            :options (om/build options/view data)
+                            :reference-usages (om/build ref/usages-view data)
+                            :reference-create-with-ref (om/build ref/create-with-reference-view data)
+                            :find (om/build find/view data)
+                            (discussion-elements data))
                           (if (or (= view :login) (= view :options) (= view :find) (= view :reference-usages))
                             (om/build close-button data)
                             (om/build control-elements data))))))))


+[babel.english.morphology :as morph]

+[babel.english.morphology :as morph]

--- src/babel/english.cljc
+++ src/babel/english.cljc
@@ -4,6 +4,7 @@
    [dag_unify.core :refer (fail-path get-in unifyc)]
    [babel.generate :as generate]
    [babel.english.grammar :as grammar]
+   [babel.english.morphology :as morph]
    [babel.over :refer [over truncate]]
    [babel.parse :as parse]
    [clojure.repl :refer [doc]]


Return an empty map if the config.clj resource does not exist.

--- src/cadence/config.clj
+++ src/cadence/config.clj
@@ -4,7 +4,8 @@
   (:import [java.net URL]))

 (def config-from-file
-  (load-file (.getPath (io/resource "config.clj"))))
+  (if-let [cres (io/resource "config.clj")]
+    (-> cres (.getPath) (load-file)) {}))

 (defn read-config [config-var]
   (or (System/getenv config-var)


fix broken link to SoundCloud logo

fix broken link to SoundCloud logo

The previous one was 404'ing.

--- src/clj/clojuredocs/pages/intro.clj
+++ src/clj/clojuredocs/pages/intro.clj
@@ -208,7 +208,7 @@
                :url "https://www.heroku.com"}
               {:src "https://img.brightcove.com/logo-corporate-new.png"
                :url "http://www.brightcove.com"}
-              {:src "https://upload.wikimedia.org/wikipedia/en/9/92/SoundCloud_logo.svg"
+              {:src "https://upload.wikimedia.org/wikipedia/commons/f/f4/SoundCloud_logo%2C_orange_color%2C_plain.svg"
                :url "https://soundcloud.com"}
               {:src "/img/puppet-logo.jpg"
                :url "https://puppet.com"}


Forgot to screen by period

Forgot to screen by period

--- src/clj/forma/hadoop/jobs/forma.clj
+++ src/clj/forma/hadoop/jobs/forma.clj
@@ -163,7 +163,7 @@
         (static-src ?s-res ?mod-h ?mod-v ?s ?l _ _ ?eco _)
         (apply-betas [?beta] ?eco ?val ?neighbor-val :> ?prob)
         (log/mk-timeseries ?pd ?prob :> ?prob-series)
-        ;; (= ?pd 827)
+        (= ?pd 827)
         (:distinct false)
         ;;(:trap (hfs-seqfile trap-tap))
         )))


Don't make the API call if we nothing has changed

--- src/cljs/comic_reader/handlers.cljs
+++ src/cljs/comic_reader/handlers.cljs
@@ -44,16 +44,17 @@
   (rf/register-handler
    :read
    (fn [db [page site location]]
-     (api/get-comic-pages site location)
      (if (and (= (:site db) site)
               (= (get-in db [:location  :comic])
                  (get-in      location [:comic])))
        (assoc db :location location)
-       (assoc db
-              :page page
-              :site site
-              :location location
-              :comic-imgs []))))
+       (do
+         (api/get-comic-pages site location)
+         (assoc db
+               :page page
+               :site site
+               :location location
+               :comic-imgs [])))))

   (rf/register-handler
    :site-list
@@ -92,7 +93,7 @@

   (rf/register-handler
    :next-image
-   (fn [db [_ img-tag]]
+   (fn [db [_ img-data]]
      (-> db
          (assoc :waiting false)
-         (update-in [:comic-imgs] conj img-tag)))))
+         (update-in [:comic-imgs] conj img-data)))))


Fix for deckbuilder duplicate cards

Fix for deckbuilder duplicate cards

--- src/cljs/netrunner/deckbuilder.cljs
+++ src/cljs/netrunner/deckbuilder.cljs
@@ -70,7 +70,7 @@
   (let [base-list (reduce #(if-let [card (parse-line side %2)] (conj %1 card) %1) [] (split-lines deck))
         ;; in case there were e.g. 2 lines with Sure Gambles, we need to sum them up in deduplicate
         duphelper (fn [currmap line]
-                    (let [title (:title :card line)
+                    (let [title (:title (:card line))
                           qty (:qty line)]
                       (if (contains? currmap title)
                         (assoc-in currmap [title :qty] (+ (get-in currmap [title :qty]) qty))