Remove trailing whitespace

Remove trailing whitespace

--- cljs/paredit/atom.cljs
+++ cljs/paredit/atom.cljs
@@ -13,13 +13,13 @@
   (.-buffer editor))

 (defn offset->point [editor offset]
-  (let [buffer (ed->buffer editor)]
+  (let [buffer (ed->buffer editor)]
     (.positionForCharacterIndex buffer offset)))

 (defn point->offset [editor point]
-  (let [buffer (ed->buffer editor)]
+  (let [buffer (ed->buffer editor)]
     (.characterIndexForPosition buffer point)))

 (defn transact [editor f]
-  (let [buffer (ed->buffer editor)]
+  (let [buffer (ed->buffer editor)]
     (.transact buffer f)))


Add docstring to mux/*dispatched-codec*.

--- src/multicodec/codecs/mux.clj
+++ src/multicodec/codecs/mux.clj
@@ -15,7 +15,12 @@

 ;; This var can be bound to find out what codec the mux used internally when
 ;; encoding or decoding a value.
-(def ^:dynamic *dispatched-codec*)
+(def
+  ^{:dynamic true
+    :doc "This var can be bound to nil in a thread to discover what codec was
+         actually invoked by a mux codec operation. Encoding or decoding sets
+         the var to the selected subcodec's keyword."}
+  *dispatched-codec*)

 (defn- find-encodable


New blogpost: Englishify

New blogpost: Englishify

--- src/odinodinstatic/layout.clj
+++ src/odinodinstatic/layout.clj
@@ -18,9 +18,9 @@
       [:div {:class "navbar flex-item"}
        [:div {:class "title"} "Odin"]
        [:a {:class "nav-item"
-            :href "/"} "Poster"]
+            :href "/"} "Posts"]
        [:a {:class "nav-item ender"
-            :href "http://github.com/odinodin/odinodinstatic"} "Kildekode"]]
+            :href "http://github.com/odinodin/odinodinstatic"} "Source"]]
       [:div.content {:class "flex-item"} page]
       [:div {:id "bottom" :class "flex-item horizontal-list"}
        (link-to {:class "bottom-box"} "http://www.kodemaker.no/cv/odin/" "CV")


fix paren issue

fix paren issue

--- src/overtone/studio/mixer.clj
+++ src/overtone/studio/mixer.clj
@@ -239,7 +239,7 @@
   (swap! studio* (fn [s]
                    (let [insts (:instruments s)
                          insts (dissoc insts (name i-name))]
-                     (assoc s :instruments insts)))))
+                     (assoc s :instruments insts))))
   (event :inst-removed :inst-name i-name))

 (defn clear-instruments []


fixes to compile-native

fixes to compile-native

--- tasks.clj
+++ tasks.clj
@@ -1,29 +1,42 @@
 (ns user
-  (:use cake cake.ant)
-  (:import [org.apache.tools.ant.taskdefs Copy ExecTask]))
+  (:use cake cake.ant
+        [useful :only [verify]]
+        [cake.tasks.dependencies :only [os-name os-arch]])
+  (:import [org.apache.tools.ant.taskdefs Copy ExecTask Replace]))

-(defn build [srcdir dest environment]
-  (ant ExecTask {:dir (file srcdir) :executable "./configure"}
-       (args [(str "--prefix=" dest)])
-       (env environment))
-  (ant ExecTask {:dir (file srcdir) :executable "make"})
-  (ant ExecTask {:dir (file srcdir) :executable "make"} (args ["install"])))
-
-(deftask compile-native
-  (let [dest (file "build/native")]
-    (when-not (.exists dest)
-      (.mkdirs dest)
-      (let [dest (.getPath dest)]
-        (build "src/tokyocabinet-1.4.45" dest {})
-        (build "src/tokyocabinet-java-1.23" dest
-               {"JAVA_HOME" (System/getProperty "java.home")
-                "CPPFLAGS"  (str "-I" dest "/include -L" dest "/lib")})
-        (ant Copy {:todir (file "classes")}
-             (add-zipfileset {:src (str dest "/lib/tokyocabinet.jar") :includes "**/*.class"}))))))
+(def tokyocabinet      "tokyocabinet-1.4.45")
+(def tokyocabinet-java "tokyocabinet-java-1.23")

 (defn clean [srcdir]
-  (ant ExecTask {:dir (file srcdir) :executable "make"} (args ["clean"])))
+  (when (.exists (file srcdir "Makefile"))
+    (ant ExecTask {:dir (file srcdir) :executable "make"} (args "distclean"))))

 (deftask clean
-  (clean "src/tokyocabinet-1.4.45")
-  (clean "src/tokyocabinet-java-1.23"))
+  (clean (file "src" tokyocabinet))
+  (clean (file "src" tokyocabinet-java)))
+
+(deftask compile-native #{clean}
+  (log (format "Compiling tokyocabinet for %s/%s" (os-name) (os-arch)))
+  (let [dest    (.getPath (file "build" "native"))
+        prefix  (str "--prefix=" dest)
+        classes (file "classes")
+        arch    (case (os-arch) "x86_64" "-m64" "x86" "-m32" "")]
+    (let [src (file "src" tokyocabinet)]
+      (ant ExecTask {:executable "./configure" :dir src :failonerror true}
+           (args prefix)
+           (env {"CFLAGS" arch "LDFLAGS" arch}))
+      (ant ExecTask {:executable "make" :dir src :failonerror true})
+      (ant ExecTask {:executable "make" :dir src :failonerror true}
+           (args "install")))
+    (let [cflags (format " %s -I%s/include -L%s/lib " arch dest dest)
+          src    (file "src" tokyocabinet-java)]
+      (ant ExecTask {:executable "./configure" :dir src :failonerror true}
+           (args prefix)
+           (env {"JAVA_HOME" (System/getProperty "java.home") "CFLAGS" cflags}))
+      (let [token "\nCFLAGS ="] ; hack because configure doesn't set CFLAGS correctly in Makefile
+        (ant Replace {:file (file src "Makefile") :token token :value (str token cflags)}))
+      (ant ExecTask {:executable "make" :dir src :failonerror true})
+      (ant ExecTask {:executable "make" :dir src :failonerror true}
+           (args "install")))
+    (ant Copy {:todir classes}
+         (add-zipfileset {:src (str dest "/lib/tokyocabinet.jar") :includes "**/*.class"}))))


jobs/web/assignids.clj: fix to save next docid!

--- src/org/altlaw/jobs/web/assignids.clj
+++ src/org/altlaw/jobs/web/assignids.clj
@@ -40,7 +40,8 @@
 (def reducer-reduce (partial h/standard-reduce my-reduce))

 (defn reducer-close [this]
-  (ids/save-docids "altcrawl"))
+  (ids/save-docids "altcrawl")
+  (ids/save-next-docid))

 (defn tool-run [this args]


nested-n-square layout to n=40

nested-n-square layout to n=40


Implement tree traversal asking user about features

--- src/fp_contest_solution_tree/core.clj
+++ src/fp_contest_solution_tree/core.clj
@@ -80,9 +80,18 @@
         (for [{:keys [feature answer]} tree]
           [feature answer])))

+(defn get-subtree [tree option]
+  (first (filter #(= (:answer %) option) tree)))
+
+;; (get-subtree (solve-tree beetles-matrix) "Да")
+
 (defn find-out [tree]
-  (let [chosen-option (ask-question (answers tree))]
-    (println "Chosen option: " chosen-option)))
+  (let [chosen-option (ask-question (answers tree))
+        chosen-subtree (get-subtree tree chosen-option)]
+    (if-let [children (:children chosen-subtree)]
+      (find-out children)
+      (:alternatives chosen-subtree))))
+

 ;; (find-out (solve-tree beetles-matrix))

@@ -93,7 +102,8 @@
     (time (pprint tree))
     (pprint beetles-matrix)
     (println "Now let's define what is the beetle in front of you by answering questions")
-    (find-out tree)))
+    (let [alternatives (find-out tree)]
+      (println "You got following alternatives" alternatives))))

 (comment
   (-main)


bumped up cljs

bumped up cljs

--- src/leiningen/new/reagent/project.clj
+++ src/leiningen/new/reagent/project.clj
@@ -18,7 +18,7 @@
                  [compojure "1.3.3"]
                  [hiccup "1.0.5"]
                  [environ "1.0.0"]
-                 [org.clojure/clojurescript "0.0-3211" :scope "provided"]
+                 [org.clojure/clojurescript "0.0-3255" :scope "provided"]
                  [secretary "1.2.3"]{{{app-dependencies}}}]

   :plugins [[lein-ring "0.9.1"]


Fix bugs for self-join-prop

Fix bugs for self-join-prop

--- src/aurora/btree.cljs
+++ src/aurora/btree.cljs
@@ -388,7 +388,7 @@
         (set! ix old-ix)))

 (defn iterator [tree]
-  (let [iterator (Iterator. (.-max-keys tree) (.-root tree) 0 false (.-key-len tree))]
+  (let [iterator (Iterator. (.-max-keys tree) (.-root tree) 0 nil nil false (.-key-len tree))]
     (.reset iterator)
     iterator))

@@ -442,7 +442,7 @@
          (.down this -1))
   (key [this]
        (when (false? end?)
-         seek-key))
+         (aclone seek-key)))
   (search [this var]
           ;; assumes prefixes all equal, keys not all equal, iterators sorted by ascending key, nothing at end
           (let [iterators (aget var->iterators var)
@@ -494,7 +494,6 @@
               (doto (aget iterators i) (.reset) (.seek seek-key))) ;; TODO this could be implemented more efficiently
             (when (>= old-var 0)
               (aset seek-key old-var old-key))
-            (assert (every? #(not (.end? %)) iterators) (js/console.log iterators)) ;; TODO remove this when debugged
             (js/goog.array.sort iterators (fn [i0 i1] (compare (.key-at i0 new-var) (.key-at i1 new-var))))
             (if (== (.key-at (aget iterators 0) new-var) (.key-at (aget iterators (- (alength iterators) 1)) new-var))
               (.down this new-var (.key-at (aget iterators 0) new-var))
@@ -736,10 +735,11 @@
 (defn run-self-join-prop [min-keys key-len actions movements]
   (let [tree (apply-to-tree (tree min-keys key-len) actions)
         iterator-results (apply-to-iterator (iterator tree) movements)
-        iterator-a (trieterator (iterator tree))
-        iterator-b (trieterator (iterator tree))
+        iterator-a (iterator tree)
+        iterator-b (iterator tree)
+        _ (iter-seq 10 (join #js [iterator-a iterator-b] key-len #js [(into-array (repeat key-len true)) (into-array (repeat key-len true))]))
         join-results (apply-to-iterator
-                      (treeterator (join #js [iterator-a iterator-b] key-len #js [(into-array (repeat key-len true)) (into-array (repeat key-len true))]))
+                      (join #js [iterator-a iterator-b] key-len #js [(into-array (repeat key-len true)) (into-array (repeat key-len true))])
                       movements)]
     (= (map vec iterator-results) (map vec join-results))))


Fix self-join

Fix self-join

--- src/aurora/btree.cljs
+++ src/aurora/btree.cljs
@@ -416,7 +416,7 @@
       (assert (> moving-key-ix 0))
       (when (false? end?)
         (.seek iterator pinned-key))
-      (aset seek-key moving-key-ix greatest)
+      (aset seek-key moving-key-ix least)
       (set! moving-key-ix (- moving-key-ix 1))
       (when (>= moving-key-ix 0)
         (aset pinned-key moving-key-ix greatest))
@@ -427,7 +427,7 @@
          (.reset iterator)))

 (defn trieterator [iterator]
-  (let [trieterator (Trieterator. iterator (greatest-key (.-key-len iterator)) (greatest-key (.-key-len iterator)) 0 false (.-key-len iterator))]
+  (let [trieterator (Trieterator. iterator (least-key (.-key-len iterator)) (greatest-key (.-key-len iterator)) 0 false (.-key-len iterator))]
     (.maintain trieterator)
     trieterator))

@@ -445,6 +445,7 @@
   (search [this current]
           (when (false? end?)
             (loop [current current]
+              (prn :current current (.key this))
               (let [max-key (.key (aget iterators (mod (- current 1) (alength iterators))))
                     min-key (.key (aget iterators current))]
                 (when-not (== min-key max-key)
@@ -499,22 +500,22 @@
         (assert (false? end?)) ;; have to be at a key to descend
         (assert (< key-ix (- (alength key-ix->intersection) 1)))
         (set! key-ix (+ key-ix 1))
-        (.maintain (aget key-ix->intersection key-ix))
         (let [iterator->present? (aget key-ix->iterator->present? key-ix)]
           (dotimes [i (alength iterator->present?)]
             (if (aget iterator->present? i)
               (.down (aget iterators i))
               (.mark (aget iterators i))))
+          (.maintain (aget key-ix->intersection key-ix))
           (.maintain this)))
   (up [this]
       (assert (> key-ix 0))
       (set! key-ix (- key-ix 1))
-      (.maintain (aget key-ix->intersection key-ix))
       (let [iterator->present? (aget key-ix->iterator->present? key-ix)]
         (dotimes [i (alength iterator->present?)]
           (if (aget iterator->present? i)
             (.up (aget iterators i))
             (.reset (aget iterators i))))
+        (.maintain (aget key-ix->intersection key-ix))
         (.maintain this))))

 (defn join [iterators num-vars iterator->vars]
@@ -832,7 +833,6 @@
                  movements (gen/vector (gen-next key-len))] ;; TODO use gen-movement once Treeterator supports seek
                 (run-self-join-prop min-keys key-len actions movements)))

-
 (comment
   (dc/quick-check 1000 (least-prop 1))
   (dc/quick-check 1000 (least-prop 2))
@@ -860,8 +860,8 @@
   (dc/quick-check 10000 (trie-tree-prop 2))
   (dc/quick-check 10000 (trie-tree-prop 3))
   (dc/quick-check 10000 (self-join-prop 1))
-  (dc/quick-check 100 (self-join-prop 2))
-  (dc/quick-check 100 (self-join-prop 3))
+  (dc/quick-check 10000 (self-join-prop 2))
+  (dc/quick-check 10000 (self-join-prop 3))

   (defn f []


Removes call to is-valid/user? from add-user function.

--- src/cadence/model.clj
+++ src/cadence/model.clj
@@ -3,6 +3,7 @@
   (:require [monger.core :as mg]
             [monger.collection :as mc]
             [cadence.model.validators :as is-valid]
+            [noir.validation :as vali]
             [cemerick.friend :as friend])
   (:use clojure.walk
         [cemerick.friend.credentials :only [hash-bcrypt]]))
@@ -25,8 +26,11 @@
   (mc/find-one-as-map "users" {:username username}))

 (defn add-user [user]
-  (if (is-valid/user? user)
-    (mc/save "users" (assoc user :password (hash-bcrypt (:password user))))))
+  (mc/save "users"
+           (assoc (select-keys
+                    user
+                    (for [[k v] user :when (vali/has-value? v)] k))
+                  :password (hash-bcrypt (:password user)))))

 (def identity #(get friend/*identity* :current))


Make the collation of braille items more DRY

--- src/catalog/vubis.clj
+++ src/catalog/vubis.clj
@@ -288,7 +288,13 @@
          not-empty)) ; only pick entries that are non-empty
    (dissoc :volumes :braille-grade)))

-(defn collate-duplicate-items
+(defn collate-duplicate-items [items]
+  (->> items
+       (group-by (juxt :source :title))
+       vals
+       (map #(merge-braille-catalog-items %))))
+
+(defn collate-all-duplicate-items
   "Merge duplicate braille `items` into one. Typically we have
   multiple entries for the same braille book for all the different
   braille grades. In the catalog we want one entry"
@@ -298,24 +304,13 @@
         taktile-items (filter #(= (:format %) :taktilesbuch) items)
         others (remove #(#{:braille :musiknoten :taktilesbuch} (:format %)) items)]
     (concat
-     (->> braille-items
-          (group-by (juxt :source :title))
-          vals
-          (map #(merge-braille-catalog-items %)))
-     (->> musiknoten-items
-          (group-by (juxt :source :title))
-          vals
-          (map #(merge-braille-catalog-items %)))
-     (->> taktile-items
-          (group-by (juxt :source :title))
-          vals
-          (map #(merge-braille-catalog-items %)))
+     (mapcat collate-duplicate-items [braille-items musiknoten-items taktile-items])
      others)))

 (defn order-and-group [items]
   (->>
    items
-   collate-duplicate-items
+   collate-all-duplicate-items
    (sort-by (juxt :creator :title))
    (reduce
     (fn [m {:keys [format genre sub-genre] :as item}]


Extend native JS function with function context


fix misplaced docstring (found with clj-kondo)

--- src/cheshire/core.clj
+++ src/cheshire/core.clj
@@ -110,8 +110,9 @@
      (.flush generator)
      writer)))

-(defn create-generator [writer]
+(defn create-generator
   "Returns JsonGenerator for given writer."
+  [writer]
   (.createGenerator
    ^JsonFactory (or factory/*json-factory*
                     factory/json-factory)


Catch exceptions when parsing json files

--- src/civil_ci/data.clj
+++ src/civil_ci/data.clj
@@ -29,9 +29,14 @@

 (defn- get-value [file repo]
   (if (fs/file? file)
-    (let [file-ref (atom (json/parse-string (slurp file) true))]
-      (add-value-watcher file-ref file repo)
-      file-ref)))
+    (try
+      (let [file-ref (atom (json/parse-string (slurp file) true))]
+        (add-value-watcher file-ref file repo)
+        file-ref)
+      (catch Exception e
+        (println "Exception when parsing file:" (fs/absolute-path file))
+        (println e)
+        nil))))

 (defn- assoc-file [path filename repo]
   (fn [hash id]


add missing fast path protocols

add missing fast path protocols

--- src/clj/cljs/core.clj
+++ src/clj/cljs/core.clj
@@ -157,7 +157,7 @@
                  ISeqable ISequential IList IRecord IReversible ISorted IPrintable IWriter
                  IPrintWithWriter IPending IWatchable IEditableCollection ITransientCollection
                  ITransientAssociative ITransientMap ITransientVector ITransientSet
-                 IMultiFn])
+                 IMultiFn IChunkedSeq IChunkedNext IComparable])
           (iterate (fn [[p b]]
                      (if (core/== 2147483648 b)
                        [(core/inc p) 1]


Agenda steal-costs framework.

Agenda steal-costs framework.

--- src/clj/game/core.clj
+++ src/clj/game/core.clj
@@ -764,10 +764,21 @@
          (swap! state update-in [:runner :register :made-run] #(conj % (first s)))
          (trigger-event state :runner :run s)))))

+(defn steal-cost-bonus [state side costs]
+  (swap! state update-in [:bonus :steal-cost] #(merge-costs (concat % costs))))
+
+(defn steal-cost [state side card]
+  (-> (if-let [costfun (:steal-cost-bonus (card-def card))]
+        (costfun state side card nil)
+        nil)
+      (concat (get-in @state [:bonus :steal-cost]))
+      merge-costs flatten vec))
+
 (defn handle-access [state side cards]
   (swap! state assoc :access true)
   (doseq [c cards]
     (swap! state update-in [:bonus] dissoc :trash)
+    (swap! state update-in [:bonus] dissoc :steal-cost)
     (let [cdef (card-def c)
           c (assoc c :seen true)]
       (when-let [name (:title c)]
@@ -785,14 +796,17 @@
             (when-not (= (:type c) "Agenda")
               (prompt! state :runner c (str "You accessed " (:title c)) ["OK"] {}))))
         (when (= (:type c) "Agenda")
-          (if-let [cost (:steal-cost (card-def c))]
-            (optional-ability state :runner c (str "Pay " (costs-to-symbol cost) " to steal " name "?")
-                              {:cost cost
-                               :effect (effect (system-msg (str "pays " (costs-to-symbol cost)
-                                                                " to steal " (:title c)))
-                                               (steal c))} nil)
-            (when (or (not (:steal-req cdef)) ((:steal-req cdef) state :runner c nil))
-              (steal state :runner c))))
+          (trigger-event state side :pre-steal-cost c)
+          (let [cost (steal-cost state side c)]
+            (prn (pr-str cost))
+            (if (pos? (count cost))
+              (optional-ability state :runner c (str "Pay " (costs-to-symbol cost) " to steal " name "?")
+                                {:cost cost
+                                 :effect (effect (system-msg (str "pays " (costs-to-symbol cost)
+                                                                  " to steal " (:title c)))
+                                                 (steal c))} nil)
+              (when (or (not (:steal-req cdef)) ((:steal-req cdef) state :runner c nil))
+                (steal state :runner c)))))
         (trigger-event state side :access c)))))

 (defn max-access [state side n]


fix can-rez? flag check condition

fix can-rez? flag check condition

--- src/clj/game/core.clj
+++ src/clj/game/core.clj
@@ -1559,10 +1559,9 @@
 (defn can-rez?
   ([state side card] (can-rez? state side card nil))
   ([state side card {:as args}]
-   (cond
-     (run-flag? state side card :can-rez-ice) true
-     (turn-flag? state side card :can-rez-ice) true
-     :else false)))
+   (and
+     (run-flag? state side card :can-rez-ice)
+     (turn-flag? state side card :can-rez-ice))))

 (defn rez
   ([state side card] (rez state side card nil))


Fix gaining MU when trashing facedown programs. Add modified-install-cost function for Street Peddler.

--- src/clj/game/core.clj
+++ src/clj/game/core.clj
@@ -128,8 +128,8 @@
          (doseq [psub pvec]
            (swap! state update-in [:prevent ptype psub] (fn [pv] (remove #(= (:cid %) (:cid card)) pv))))))
      (unregister-events state side card)
-     (when-let [mu (:memoryunits card)]
-       (gain state :runner :memory mu))
+     (when (and (:memoryunits card) (:installed card) (not (:facedown card)))
+       (gain state :runner :memory (:memoryunits card)))
      c)))

 (defn get-nested-host [state card]
@@ -585,6 +585,14 @@
                         (when-let [instfun (:install-cost-bonus (card-def card))] (instfun state side card nil)))
             merge-costs flatten))))

+(defn modified-install-cost
+  ([state side card] (modified-install-cost state side card nil))
+  ([state side card additional]
+    (trigger-event state side :pre-install card)
+    (let [cost (install-cost state side card (merge-costs (concat additional [:credit (:cost card)])))]
+      (swap! state update-in [:bonus] dissoc :install-cost)
+      cost)))
+
 (defn damage-count [state side dtype n {:keys [unpreventable unboostable] :as args}]
   (-> n
       (+ (or (when (not unboostable) (get-in @state [:damage :damage-bonus dtype])) 0))


allow access of hosted assets on Worlds Plaza

--- src/clj/game/core.clj
+++ src/clj/game/core.clj
@@ -1192,7 +1192,8 @@
   (concat (get-in @state [:corp :discard]) (get-in @state [:corp :servers :archives :content])))

 (defmethod access :remote [state side server]
-  (get-in @state [:corp :servers (first server) :content]))
+  (let [contents (get-in @state [:corp :servers (first server) :content])]
+    (concat contents (mapcat :hosted contents))))

 (defn access-bonus [state side n]
   (swap! state update-in [:run :access-bonus] #(+ % n)))


check that datasource exists before close

--- src/clj/tictag/db.clj
+++ src/clj/tictag/db.clj
@@ -34,7 +34,8 @@
                 :crypto-key (:crypto-key db-spec)}
            :pends (atom (ring-buffer 16))))
   (stop [component]
-    (hikari/close-datasource (get-in component [:db :datasource]))
+    (when-let [ds (get-in component [:db :datasource])]
+      (hikari/close-datasource ds))
     (dissoc component :db)))

 (defn add-pend! [rb id long-time]
@@ -135,34 +136,50 @@
 (defn make-pings-sleepy! [db pings]
   (update-tags! db (map sleep pings)))

-(defn write-beeminder [db user username token]
+(defn beeminder-record [crypto-key user username token enabled?]
+  (let [{:keys [encrypted iv]} (crypto/encrypt token crypto-key)]
+    {:user_id         (:id user)
+     :username        username
+     :encrypted_token encrypted
+     :encryption_iv   iv
+     :is_enabled      enabled?}))
+
+(defn write-beeminder-sql [crypto-key user username token enabled?]
+  (-> (insert-into :beeminder)
+      (values [(beeminder-record crypto-key user username token enabled?)])))
+
+(defn write-beeminder [db user username token enabled?]
   (let [{:keys [encrypted iv]} (crypto/encrypt token (:crypto-key db))]
     (j/execute!
      (:db db)
-     [(str/join " "
-                ["INSERT INTO beeminder"
-                 "(user_id, username, encrypted_token, encryption_iv)"
-                 "VALUES"
-                 "(?, ?, ?, ?)"])
-      (:id user)
-      username
-      encrypted
-      iv])))
-
-(defn write-slack [db user username token channel-id]
+     (sql/format (write-beeminder-sql (:crypto-key db) user username token enabled?)))))
+
+(defn slack-record [crypto-key user username token channel-id slack-user-id]
+  (let [{:keys [encrypted iv]} (crypto/encrypt token crypto-key)]
+    {:user_id                    (:id user)
+     :username                   username
+     :encrypted_bot_access_token encrypted
+     :encryption_iv              iv
+     :channel_id                 channel-id
+     :slack_user_id              slack-user-id}))
+
+(defn write-slack-sql [crypto-key user username token channel-id slack-user-id]
+  (-> (insert-into :slack)
+      (values [(slack-record crypto-key user username token channel-id slack-user-id)])))
+
+
+(defn write-slack [db user username token channel-id slack-user-id]
   (let [{:keys [encrypted iv]} (crypto/encrypt token (:crypto-key db))]
     (j/execute!
      (:db db)
-     [(str/join " "
-                ["INSERT INTO slack"
-                 "(user_id, username, encrypted_bot_access_token, encryption_iv, channel_id)"
-                 "VALUES"
-                 "(?, ?, ?, ?, ?)"])
-      (:id user)
-      username
-      encrypted
-      iv
-      channel-id])))
+     (sql/format
+      (write-slack-sql
+       (:crypto-key db)
+       user
+       username
+       token
+       channel-id
+       slack-user-id)))))

 (defn beeminder-from-db
   [db {:as user :keys [beeminder_username


Add admin util for verifying group names from repl

--- src/clojars/admin.clj
+++ src/clojars/admin.clj
@@ -83,6 +83,16 @@
           (when-not version (search/delete! *search* group-id jar-id))))
       (println "No artifacts found under" group-id jar-id version))))

+(defn verify-group!
+  "Adds the group if it doesn't exist and isn't an illegal name, then
+  verifies the group if it isn't already verified. Will throw if the
+  group is a reserved name or the user doesn't have access to
+  it. Returns the verification record."
+  [username group-name]
+  (db/check-and-add-group *db* username group-name)
+  (db/verify-group! *db* username group-name)
+  (db/find-group-verification *db* group-name))
+
 (defn handler [mapping]
   (nrepl/default-handler
     (with-meta


pretty logging handled by systems-toolbox

--- iwaswhere-web/src/clj/iwaswhere_web/core.clj
+++ iwaswhere-web/src/clj/iwaswhere_web/core.clj
@@ -9,12 +9,8 @@
             [iwaswhere-web.specs]
             [clojure.tools.logging :as log]
             [clj-pid.core :as pid]
-            [io.aviso.logging :as pretty]
             [iwaswhere-web.store :as st]
             [iwaswhere-web.imports :as i]))
-
-(pretty/install-pretty-logging)
-(pretty/install-uncaught-exception-handler)

 (defonce switchboard (sb/component :server/switchboard))


fix test

fix test

--- test/babel/test/it.cljc
+++ test/babel/test/it.cljc
@@ -174,9 +174,9 @@
     (is (= "io mi ero addormentata" (morph result)))))

 (deftest parse-ci-before-vowel
-  (let [result (:parses (first (parse "c'è stato")))]
+  (let [result (-> "c'è stato" parse first :parses)]
     (is (not (empty? result)))
-    (is (= "c'è stato") (morph (first (:parses (first result)))))))
+    (is (= "c'è stato") (morph (first result)))))

 ;; this should succeed to parse...
 (deftest passato-prossimo-parsing-positive


-(defn analyze)

-(defn analyze)

--- test/babel/test/it.cljc
+++ test/babel/test/it.cljc
@@ -3,7 +3,7 @@
   (:require
    [babel.directory :refer [models]]
    [babel.generate :as generate]
-   [babel.italiano :as italiano :refer [generate morph preprocess]]
+   [babel.italiano :as italiano :refer [analyze generate morph preprocess]]
    [babel.italiano.grammar :as grammar]
    [babel.italiano.lexicon :as lexicon]
    [babel.italiano.morphology :as morph :refer [analyze-regular]]
@@ -53,9 +53,6 @@

 (defn fo-ps [expr]
   (morph-ps expr))
-
-(defn analyze [str]
-  (italiano/analyze str model))

 (deftest analyze-1
   (let [singular (analyze "compito")


+(deftest furniture-sentence)

+(deftest furniture-sentence)

--- test/babel/test/it.cljc
+++ test/babel/test/it.cljc
@@ -483,3 +483,17 @@
     (is (= (fo expr)
            "davanti il tavolo"))))

+(deftest furniture-sentence
+  (let [expr (generate {:synsem {:sem {:obj {:pred :table :mod '() :spec {:def :def}
+                                             :number :sing}
+                                       :pred :in-front-of
+                                       :subj {:pred :chair :mod '() :spec {:def :def}
+                                              :number :sing}
+                                       :tense :present
+                                       :aspect :progressive}
+                                 :cat :verb}
+                        :comp {:synsem {:agr {:person :3rd}}}
+                        :modified false})]
+    (is (= (fo expr)
+           "la sedia è davanti il tavolo"))))
+


Failing test for conversation manager integration

--- test/conv_man_tests.clj
+++ test/conv_man_tests.clj
@@ -2,39 +2,57 @@
   (:use polismath.utils
         test-helpers)
   (:require [clojure.test :refer :all]
-            [polismath.conv-man :refer :all]))
+            ;[clojure.test.check :as tc]
+            ;[clojure.test.check.generators :as gen]
+            ;[clojure.test.check.properties :as prop]
+            [clojure.core.async :as async]
+            [clojure.tools.logging :as log]
+            [polismath.math.conversation :as conv]
+            [polismath.math.named-matrix :as nm]
+            [polismath.conv-man :as conv-man]
+            [polismath.system :as system]
+            [polismath.components.config :as config]
+            ))

-(deftest get-or-set-test
-  (testing "should work when not set"
-    (let [a (atom {})]
-      (get-or-set! a :shit (fn [] "stuff"))
-      (is (= (:shit @a) "stuff"))))
-  (testing "should work when set"
-    (let [a (atom {:shit "stuff"})]
-      (is (= (get-or-set! a :shit (fn [] "crap"))
-             "stuff")))))
+;(gen/sample gen/->Generator
+
+;(let [random-matrix (gen/vector (partial gen/vector (ge
+
+;; Should make this generative
+(deftest integration-test
+  (testing "of some votes"
+    (let [messages [{:vote  0 :pid 0 :tid 0 :zid 0 :created 9000}
+                    {:vote  1 :pid 1 :tid 1 :zid 0 :created 9003}
+                    {:vote -1 :pid 2 :tid 0 :zid 0 :created 9005}
+                    {:vote -1 :pid 1 :tid 2 :zid 0 :created 9009}]
+          config {}]
+      (testing "in a new conv"
+        (let [system (system/create-and-run-base-system! config)
+              conv-man (:conversation-manager system)
+              result-chan (async/chan)
+              ;; Need to hook this up
+              error-chan (async/chan)]
+          ;; Since the conversation manager is asynchronous, we'll create a channel where we'll put the
+          ;; results of the conversation update.
+          ;; Should add an error listener as well... so we can catch information there as well
+          (conv-man/add-listener! conv-man (fn [conv] (async/>!! result-chan conv)))
+          (conv-man/queue-message-batch! conv-man :votes 0 messages)
+          ;; For right now, let's just use a timeout to check for whether the conversation updated; Really
+          ;; need to fix this... XXX
+          (is (if-let [conv (first (async/alts!! [result-chan (async/timeout 20000)]))]
+                (let [matrix (-> conv :rating-mat nm/get-matrix)]
+                  (is (m=? [[0   nil nil]
+                            [nil  1  -1 ]
+                            [-1  nil nil]] matrix)
+                      "The conversation does not have the correct rating matrix post conversation update")
+                  (not (nil? conv)))
+                ;; There's a problem; the timeout was hit
+                (do (log/error "There was an update timeout in integration-test; check log...")
+                    (/ 1 0)))))))))

-; Initialization test
-(deftest split-batches-test
-  (testing "of a missing param"
-    (let [messages [[:votes [{:a 4} {:b 5} {:c 6}]]
-                    [:votes [{:d 7} {:e 8} {:f 9}]]]]
-      (is (= (split-batches messages)
-             {:votes [{:a 4} {:b 5} {:c 6} {:d 7} {:e 8} {:f 9}]}))
-      (is (nil? (:moderation (split-batches messages))))))
-  (testing "of one message"
-    (let [messages [[:votes [{:a 4} {:b 5} {:c 6}]]]]
-      (is (= (split-batches messages)
-             {:votes [{:a 4} {:b 5} {:c 6}]}))))
-  (testing "of combined messages"
-    (let [messages [[:votes [{:a 4} {:b 5} {:c 6}]]
-                    [:votes [{:d 7} {:e 8} {:f 9}]]
-                    [:moderation [{:g 4} {:h 5} {:i 6}]]
-                    [:moderation [{:j 7} {:k 8} {:l 9}]]]]
-      (is (= (split-batches messages)
-             {:votes [{:a 4} {:b 5} {:c 6} {:d 7} {:e 8} {:f 9}]
-              :moderation [{:g 4} {:h 5} {:i 6} {:j 7} {:k 8} {:l 9}]})))))
+(defn -main []
+  (run-tests 'conv-man-tests)
+  )

-


Plumb more vcs_type in project-settings navigation

This fixes breadcrumbs on the project settings page linking to
http://{org-name}/{repo-name} (note the missing base url)

--- src-cljs/frontend/controllers/navigation.cljs
+++ src-cljs/frontend/controllers/navigation.cljs
@@ -312,7 +312,7 @@
     (set-page-title! "Invite teammates")))

 (defmethod navigated-to :project-settings
-  [history-imp navigation-point {:keys [project-name subpage org repo] :as args} state]
+  [history-imp navigation-point {:keys [project-name subpage org repo vcs_type] :as args} state]
   (-> state
       state-utils/clear-page-state
       (assoc :navigation-point navigation-point
@@ -322,10 +322,12 @@
              :project-settings-project-name project-name)
       (assoc-in state/crumbs-path [{:type :settings-base}
                                    {:type :org
-                                    :username org}
+                                    :username org
+                                    :vcs_type vcs_type}
                                    {:type :project
                                     :username org
-                                    :project repo}])
+                                    :project repo
+                                    :vcs_type vcs_type}])
       (#(if (state-utils/stale-current-project? % project-name)
           (state-utils/reset-current-project %)
           %))))


Fix dm domain -- put back parked as default

--- src/angelic/domains/discrete_manipulation.clj
+++ src/angelic/domains/discrete_manipulation.clj
@@ -192,7 +192,7 @@
                                       border-cells)
                                    obstacle-cells)}
                          (for [[o _ goal] objects :when goal] [[:goal o] (set goal)]))
-            [:base] base [:gripper-offset] [0 0] [:holding] nil [:parked?] false #_ true} ;; Note: changed.
+            [:base] base [:gripper-offset] [0 0] [:holding] nil [:parked?] true}
            (apply concat
             (for [cell all-cells]    [[:object-at cell] nil])
             (for [cell border-cells] [[:object-at cell] :border])
@@ -431,6 +431,7 @@
                (list :domain 'DM) sep sep

                (concat [:objects sep2]
+                       ["dummy - object " sep2]
                        (for [[name _ g-set] objects :when (seq g-set)]
                          (str name " - object " sep2))
                        (for [x (range width)] (str (xc x) " - xc " sep2))
@@ -486,7 +487,7 @@
                        [sep2]

                        ;; Robot base
-                       (when (state/get-var init [:parked?]) ['(parked) sep2])
+                       (when (state/get-var init [:parked?]) ['(parked) '(placing dummy) sep2])
                        (let [[x y] (state/get-var init [:base])]
                          [(str (list 'base-pos (xc x) (yc y))) sep2])
                        [sep2]


GG+CM - render objective with single or multiple goal fields

--- src/objective8/handlers/front_end.clj
+++ src/objective8/handlers/front_end.clj
@@ -26,8 +26,8 @@
                                  :doc-description (t' :index/doc-description)
                                  :signed-in (signed-in?)}))

-(defn sign-in [{{refer :refer} :params
-                :keys [t' locale]
+(defn sign-in [{{refer :refer} :params
+                :keys [t' locale]
                 :as request}]
   (-> (rendered-response sign-in-page {:translation t'
                                        :locale (subs (str locale) 1)
@@ -86,9 +86,12 @@
                                            :signed-in (signed-in?)
                                            :status-code 404})
         (let [comments (http-api/retrieve-comments objective-id)
+              goals (if (objective :goals)
+                       (list (objective :goals))
+                       (remove clojure.string/blank? [(:goal-1 objective) (:goal-2 objective) (:goal-3 objective)]))
               formatted-objective (-> objective
                                     (update-in [:end-date] utils/date-time->pretty-date)
-                                    (assoc :goals (remove clojure.string/blank? [(:goal-1 objective) (:goal-2 objective) (:goal-3 objective)]))
+                                    (assoc :goals goals)
                                     (dissoc :goal-1 :goal-2 :goal-3))]
             (rendered-response objective-view-page {:translation t'
                                                     :locale (subs (str locale) 1)


Change default character encoding to UTF-8

--- ring-jetty-adapter/src/ring/adapter/jetty.clj
+++ ring-jetty-adapter/src/ring/adapter/jetty.clj
@@ -17,6 +17,7 @@
       (let [request-map  (servlet/build-request-map request)
             response-map (handler request-map)]
         (when response-map
+          (.setCharacterEncoding response "UTF-8")
           (servlet/update-servlet-response response response-map)
           (.setHandled base-request true))))))


Add some required props that were missing from launch analysis. Also, the returned submission object is no longer an array, but a single object.

--- src/cljs/org/broadinstitute/firecloud_ui/page/workspace/launch_analysis.cljs
+++ src/cljs/org/broadinstitute/firecloud_ui/page/workspace/launch_analysis.cljs
@@ -47,7 +47,7 @@
             :on-done (fn [{:keys [success? get-parsed-response status-text]}]
                        (swap! state dissoc :launching?)
                        (if success?
-                         (on-success (get-in (get-parsed-response) [0 "submissionId"]))
+                         (on-success ((get-parsed-response) "submissionId"))
                          (js/alert (str "Launch failed: " status-text))))}))
        (js/alert "Please select an entity.")))})

@@ -123,7 +123,10 @@
            (style/create-message-well "No data found.")
            :else
            [:div {:style {:marginTop "-1em"}}
-            [LaunchForm {:entities entities
+            [LaunchForm {:on-success (:on-success props)
+                         :config-id (:config-id props)
+                         :workspace-id (:workspace-id props)
+                         :entities entities
                          :entity-types entity-types
                          :root-entity-type (:root-entity-type props)}]]))]])
    :component-did-mount


fix stack overflow bug

fix stack overflow bug

--- src/main/shadow/cljs/devtools/server/web/common.clj
+++ src/main/shadow/cljs/devtools/server/web/common.clj
@@ -6,7 +6,7 @@

 (defn not-found
   ([req]
-    (not-found "Not found."))
+    (not-found req "Not found."))
   ([req msg]
    {:status 404
     :headers {"content-type" "text/plain"}


didn't need that parameter

didn't need that parameter

--- src-cljs/hello.cljs
+++ src-cljs/hello.cljs
@@ -10,6 +10,6 @@
     (js/document.body.appendChild canvas)
     (.getContext canvas "2d")))

-(defn ^:export main [n]
+(defn ^:export main []
   (let [context (create-canvas)]
     (.fillRect context 10 10 200 200)))


Some work on autogenerated schemas

Some work on autogenerated schemas

--- src/icecap/schema.clj
+++ src/icecap/schema.clj
@@ -3,17 +3,17 @@
   (:require [schema.core :as s]
             [icecap.handlers.http]
             [icecap.handlers.delay]
-            [icecap.handlers.core :refer [get-schema]]
-            [icecap.execute :refer [supported-scheme?]]))
+            [icecap.handlers.core :refer [get-schema]]))

 (def Step
   "The schema for the description of a single step.

   An step is a small, atomic part of a capability. It includes things
   like HTTP requests or delays."
-  (s/conditional
-   #(= (:type %) :http) (get-schema {:type :http})
-   #(= (:type %) :delay) (get-schema {:type :delay})))
+  (apply s/conditional
+         (flatten (for [type (keys (methods get-schema))]
+                    [#(= (:type %) type)
+                     (get-schema {:type type})]))))

 (defn with-one-or-more
   "Constrain a seq schema to require one or more items.


Some lines of code are refactored.

Some lines of code are refactored.

--- src/sweet_crossplane/core.clj
+++ src/sweet_crossplane/core.clj
@@ -66,7 +66,7 @@
   [& args]
   (apply radial-mount/property-message-key args))

-(declare entity-class-keys input-property-keys parse-property-param)
+(declare entity-class-keys inputtable-property-keys parse-property-param)

 (defn wrap-entity-params
   [handler]
@@ -82,7 +82,7 @@
                                    (cond-> request
                                      (.startsWith (name param-key) (name (sweet-crossplane.core/param-key entity-class-key property-key))) (#(or (assoc-entity-param % param-key entity-class-key property-key) %))))
                                  request
-                                 (combinatorics/cartesian-product (input-property-keys entity-class-key) (keys (:params request)))))
+                                 (combinatorics/cartesian-product (inputtable-property-keys entity-class-key) (keys (:params request)))))
                        request
                        (entity-class-keys))))))

@@ -154,18 +154,33 @@
   ([entity-class-key]
    (property-keys entity-class-key :columns :many-to-one-relationships :one-to-many-relationships)))

-(defn input-property-keys  ; TODO: オプションで制御できるようにする。
+(defn inputtable-property-keys
   [entity-class-key]
   (property-keys entity-class-key :columns :many-to-one-relationships))
+
+(defn representative-property-key
+  [entity-class-key]
+  (or (:representative (entity-class-schema entity-class-key))
+      (some #{:name} (property-keys entity-class-key))
+      (first (property-keys entity-class-key))))
+
+(defn placeholder
+  [entity-class-key property-key]
+  (get-in (entity-class-schema entity-class-key) [:placeholders property-key]))

 (defn search-condition-property-keys
   [entity-class-key]
   (or (get-in (entity-class-schema entity-class-key) [:search-condition :properties])
-      (input-property-keys entity-class-key)))
+      (inputtable-property-keys entity-class-key)))

 (defn list-property-keys
   [entity-class-key]
   (or (get-in (entity-class-schema entity-class-key) [:list :properties])
+      (property-keys entity-class-key)))
+
+(defn input-property-keys
+  [entity-class-key]
+  (or (get-in (entity-class-schema entity-class-key) [:input :properties])
       (property-keys entity-class-key)))

 (defn sort-keyfn-and-comp
@@ -174,22 +189,12 @@
     [(or keyfn (first (list-property-keys entity-class-key)))
      (or comp  compare)]))

-(defn representative-property-key
-  [entity-class-key]
-  (or (:representative (entity-class-schema entity-class-key))
-      (some #{:name} (property-keys entity-class-key))
-      (first (property-keys entity-class-key))))
-
 (defn property-schema
   [entity-class-key property-key]
   (let [entity-class-schema (entity-class-schema entity-class-key)]
     (or (get-in entity-class-schema [:columns                   property-key])
         (get-in entity-class-schema [:many-to-one-relationships property-key])
         (get-in entity-class-schema [:one-to-many-relationships property-key]))))
-
-(defn placeholder
-  [entity-class-key property-key]
-  (get-in (entity-class-schema entity-class-key) [:placeholders property-key]))

 (defn property-type
   [entity-class-key property-key]
@@ -655,7 +660,7 @@
    [method uri]
    (hidden-field :index-params (get-in *request* [:params :index-params]))
    (error-message-control entity-class-key (get-in *request* [:entity-param-errors]) radial-mount-errors)
-   (map #(input-control entity-class-key entity % (get radial-mount-errors %)) (property-keys entity-class-key))
+   (map #(input-control entity-class-key entity % (get radial-mount-errors %)) (input-property-keys entity-class-key))
    [:p
     (submit-button {:class "btn btn-primary"} (string/capitalize (dog-mission/translate submit-button-caption)))
     " "
@@ -797,14 +802,16 @@
   [entity-class-key database entity-key view-fn]
   (let [entity-class-schema (entity-class-schema entity-class-key)
         database            (->> (reduce (fn [database property-key]
-                                           (let [many-to-one? (= (property-type entity-class-key property-key) :many-to-one)
-                                                 column-key   (cond-> property-key
-                                                                many-to-one? (many-to-one-relationship-key-to-physical-column-key))
-                                                 param-key    (cond-> (param-key entity-class-key property-key)
-                                                                many-to-one? (#(keyword (format "%s-key" (name %)))))
-                                                 errors       (not-empty (get-in *request* [:entity-param-errors param-key]))]
-                                             (cond-> database
-                                               (not errors) (assoc-in [entity-class-key entity-key column-key] (get-in *request* [:entity-params param-key])))))
+                                           (if (some #{property-key} (inputtable-property-keys entity-class-key))
+                                             (let [many-to-one? (= (property-type entity-class-key property-key) :many-to-one)
+                                                   column-key   (cond-> property-key
+                                                                  many-to-one? (many-to-one-relationship-key-to-physical-column-key))
+                                                   param-key    (cond-> (param-key entity-class-key property-key)
+                                                                  many-to-one? (#(keyword (format "%s-key" (name %)))))
+                                                   errors       (not-empty (get-in *request* [:entity-param-errors param-key]))]
+                                               (cond-> database
+                                                 (not errors) (assoc-in [entity-class-key entity-key column-key] (get-in *request* [:entity-params param-key]))))
+                                             database))
                                          database
                                          (input-property-keys entity-class-key)))]
     (if (not-empty (get-in *request* [:entity-param-errors]))


Use config in serve function.

Use config in serve function.

--- src/incise/server.clj
+++ src/incise/server.clj
@@ -49,12 +49,10 @@

 (defn serve
   "Start the development server"
-  [& [port thread-count]]
-  (load-all)
-  (run-server app {:port (or port
-                             (Integer. (getenv "PORT" "5000")))
-                   :thread (or thread-count
-                               (Integer. (getenv "THREAD_COUNT" "4")))}))
+  []
+  (run-server app {:port (Integer. (conf/get :port (getenv "PORT" "5000")))
+                   :thread (Integer. (conf/get :thread-count
+                                               (getenv "THREAD_COUNT" "4")))}))

 (defonce server (atom nil))


Fix atom entry link href

Fix atom entry link href

--- src/io/perun/atom.clj
+++ src/io/perun/atom.clj
@@ -33,7 +33,8 @@
          [:entry
           [:id permalink]
           [:title name]
-          (if canonical-url [:link canonical-url])
+          (if canonical-url
+            [:link {:href canonical-url}])
           [:updated (iso-datetime (updated post))]
           [:content {:type "html"} (str content)]
           [:author


add `index-route` to fixture app

add `index-route` to fixture app

--- src/test/compassus/tests.cljs
+++ src/test/compassus/tests.cljs
@@ -28,7 +28,7 @@

 (defn wrap-app [test-fn]
   (binding [*app* (c/application
-                    {:routes {:index Home
+                    {:routes {:index (c/index-route Home)
                               :about About}
                      :reconciler-opts
                      {:state (atom init-state)


Automatically wrap Reader in PushbackReader in 'parse'


SSH info fits very nicely in the tabbed interface

--- frontend/components/build_head.cljs
+++ frontend/components/build_head.cljs
@@ -141,19 +141,13 @@

 (defn build-ssh [nodes owner]
   (reify
-    om/IDidMount
-    (did-mount [_]
-      (utils/popover "#ssh-popover-hack"
-                     {:placement "right"
-                      :content "You can SSH into this build. Use the same SSH public key that you use for GitHub. SSH boxes will stay up for 30 minutes. This build takes up one of your concurrent builds, so cancel it when you are done."
-                      :title "SSH"}))
     om/IRender
     (render [_]
       (html
-       [:section.build-ssh
+       [:div.ssh-info-container
         [:div.build-ssh-title
-         [:strong "SSH Info "]
-         [:i.fa.fa-question-circle {:id "ssh-popover-hack" :title "SSH"}]]
+         [:p "You can SSH into this build. Use the same SSH public key that you use for GitHub. SSH boxes will stay up for 30 minutes."]
+         [:p "This build takes up one of your concurrent builds, so cancel it when you are done."]]
         [:div.build-ssh-list
          [:dl.dl-horizontal
           (map (fn [node i]
@@ -290,8 +284,12 @@
     om/IRender
     (render [_]
       (let [build-data (:build-data data)
-            selected-tab (get build-data :selected-header-tab :commits)
+            user (:user data)
+            logged-in? (not (empty? user))
             build (:build build-data)
+            show-ssh-info? (and logged-in? (utils/inspect (build-model/ssh-enabled-now? build)))
+            ;; default to ssh-info for SSH builds if they haven't clicked a different tab
+            selected-tab (get build-data :selected-header-tab (if show-ssh-info? :ssh-info :commits))
             build-id (build-model/id build)
             build-num (:build_num build)
             vcs-url (:vcs_url build)
@@ -299,8 +297,6 @@
             run-queued? (build-model/in-run-queue? build)
             usage-queued? (build-model/in-usage-queue? build)
             plan (get-in data [:project-data :plan])
-            user (:user data)
-            logged-in? (not (empty? user))
             config-data (:config-data build-data)]
         (html
          [:div.sub-head
@@ -326,6 +322,11 @@
                                                    :build_num (:build_num @build)}]))}
                 "Queue"]])

+            (when show-ssh-info?
+              [:li {:class (when (= :ssh-info selected-tab) "active")}
+               [:a {:on-click #(raise! owner [:build-header-tab-clicked {:tab :ssh-info}])}
+                "SSH info"]])
+
             ;; tests don't get saved until the end of the build (TODO: stream the tests!)
             (when (build-model/finished? build)
               [:li {:class (when (= :tests selected-tab) "active")}
@@ -356,7 +357,8 @@

              :usage-queue (om/build build-queue {:build build
                                                  :builds (:builds usage-queue-data)
-                                                 :plan plan}))]])))))
+                                                 :plan plan})
+             :ssh-info (om/build build-ssh (:node build)))]])))))

 (defn build-head [data owner]
   (reify
@@ -506,7 +508,4 @@
                   "Cancel"]))]]
             [:div.no-user-actions]]

-           (when (and logged-in? (build-model/ssh-enabled-now? build))
-             (om/build build-ssh (:node build)))
-
            (om/build build-sub-head data)]])))))


Update project.clj

Update project.clj

--- template/resources/leiningen/new/friboo/project.clj
+++ template/resources/leiningen/new/friboo/project.clj
@@ -7,7 +7,7 @@
   :dependencies [[org.clojure/clojure "1.8.0"]
                  [com.fzakaria/slf4j-timbre "0.3.4"]
                  [com.taoensso/timbre "4.8.0"]
-                 [org.zalando.stups/friboo "2.0.0-beta7-SNAPSHOT"]]
+                 [org.zalando.stups/friboo "2.0.0-beta7"]]
   :main ^:skip-aot {{namespace}}.core
   :uberjar-name "{{name}}.jar"
   :target-path "target/%s"


Fix comment indent

Fix comment indent

--- src/less4clj/core.clj
+++ src/less4clj/core.clj
@@ -63,7 +63,7 @@
       (util/dbug "importing %s at %s\n" import-filename parent)
       (if-let [[uri parent type]
                (or (find-local-file import-filename parent)
-                                        ; Don't search from other source-paths if looking for import from resource
+                  ;; Don't search from other source-paths if looking for import from resource
                   (and (= type :file) (some #(find-local-file import-filename %) (:source-paths ctx)))
                   (find-resource (io/resource import-filename))
                   (find-resource (io/resource (join-url parent import-filename)))


move feedback to the left of the button

move feedback to the left of the button

--- src/cljs/foosball/locations/report_match.cljs
+++ src/cljs/foosball/locations/report_match.cljs
@@ -262,27 +262,27 @@
                    {:opts {:change-ch matchdate}})

          [:div.form-group.col-lg-12
+          (when status
+            (let [[alert-class
+                   content] (if (= :ok status)
+                   [:alert-success
+                    [:p
+                     [:strong "Success! "]
+                     [:span "Match reported successfully. "]
+                     [:a {:href (routes/player-statistics-path)} "Player statistics"]]]
+                   [:alert-danger
+                    [:p [:strong "Error! "] [:span "Oh oh! Something went wrong."]]])]
+              [:div.form-group.col-lg-7.alert
+               {:class alert-class}
+               content]))
+
           [:div.form-group.col-lg-5.pull-right
            [:button.btn.btn-primary.btn-lg.btn-block
             (merge {:on-click (fn [e] (submit-report! match-report))}
                    (when-not enabled? {:disabled "disabled"}))
             "Report Match Result " (if submitting
                                      [:span.glyphicon.glyphicon-time]
-                                     [:span.glyphicon.glyphicon-ok])]]]
-         (when status
-           (let [[alert-class
-                  content] (if (= :ok status)
-                             [:alert-success
-                              [:p
-                               [:strong "Success! "]
-                               [:span "Match reported successfully. "]
-                               [:a {:href (routes/player-statistics-path)} "Player statistics"]]]
-                             [:alert-danger
-                              [:p [:strong "Error! "] [:span "Oh oh! Something went wrong"]]])]
-             [:div.form-group.col-lg-12
-              [:div.form-group.col-lg-5.pull-right.alert
-               {:class alert-class}
-               content]]))]]))))
+                                     [:span.glyphicon.glyphicon-ok])]]]]]))))

 (defn render [app]
   (if (:auth app)


task info message if service shutdown

task info message if service shutdown

--- src/cljs/swarmpit/component/service/info.cljs
+++ src/cljs/swarmpit/component/service/info.cljs
@@ -100,13 +100,17 @@
       (comp/card-header
         {:className "Swarmpit-table-card-header"
          :title     (comp/typography {:variant "h6"} "Tasks")})
-      (comp/card-content
-        {:className "Swarmpit-table-card-content"
-         :key       "ftcc"}
-        (list/responsive
-          custom-metadata
-          (filter #(not (= "shutdown" (:state %))) tasks)
-          tasks/onclick-handler)))))
+
+      (if (= "not running" (:state service))
+        (comp/card-content
+          {}
+          (html [:div "No running tasks."]))
+        (comp/card-content
+          {:className "Swarmpit-table-card-content"}
+          (list/responsive
+            custom-metadata
+            (filter #(not (= "shutdown" (:state %))) tasks)
+            tasks/onclick-handler))))))

 (defn form-actions
   [service service-id]
@@ -183,10 +187,8 @@
 (defn form-secrets-grid [secrets service-id]
   (comp/grid
     {:item true
-     :key  "slgs"
-     :xs   12}
-    (rum/with-key
-      (secrets/form secrets service-id) "slgsf")))
+     :xs   12}
+    (secrets/form secrets service-id)))

 (defn form-configs-grid [configs service-id]
   (comp/grid


Changing error message to a warning message.

--- src/cmr/indexer/services/concepts/granule.clj
+++ src/cmr/indexer/services/concepts/granule.clj
@@ -38,9 +38,8 @@
     (let [gsr (get-in parent-collection [:spatial-coverage :granule-spatial-representation])]
       (if (= gsr :geodetic)
         (spatial/spatial->elastic-docs gsr granule)
-        (error
-          (format "Only geodetic is supported for granule spatial representation currently. GSR: [%s]"
-                  gsr))))))
+        (warn
+          "Only geodetic is supported for granule spatial representation currently. Ignoring this area.")))))

 (defmethod idx/concept->elastic-doc :granule
   [context concept umm-granule]


Fix cursor blinking and color

Fix cursor blinking and color

--- src/zaffre/components/ui.cljc
+++ src/zaffre/components/ui.cljc
@@ -70,7 +70,7 @@
                                :display :flex
                                :flex-direction :row
                                :cursor-char-on \u2592
-                               :cursor-char-off \space
+                               :cursor-char-off \_
                                :cursor-fg (zcolor/color 255 255 255 255)
                                :cursor-bg (zcolor/color 0 0 0 255)}}
         props (assoc (merge default-props props)
@@ -81,6 +81,7 @@
                 cursor-char-off
                 cursor-fg
                 cursor-bg]} (get props :style)
+        cursor-fg (if (and focused show-cursor) cursor-fg (zcolor/color 255 255 255))
         cursor (if (and focused show-cursor) cursor-char-on cursor-char-off)]

      (g/use-effect (fn []


fixed public key selector

fixed public key selector

--- src/dda/pallet/dda_managed_vm/domain/user.clj
+++ src/dda/pallet/dda_managed_vm/domain/user.clj
@@ -6,7 +6,6 @@
 ; "License"); you may not use this file except in compliance
 ; with the License. You may obtain a copy of the License at
 ; http://www.apache.org/licenses/LICENSE-2.0
-;
 ;
 ; Unless required by applicable law or agreed to in writing, software
 ; distributed under the License is distributed on an "AS IS" BASIS,
@@ -23,14 +22,14 @@
   [user]
   (let [{:keys [ssh]} user]
     (if (contains? user :ssh)
-      {:authorized-keys [(user-env/string-to-pub-key-config (:ssh-pub-key ssh))]}
+      {:authorized-keys [(user-env/string-to-pub-key-config (:ssh-public-key ssh))]}
       {})))

 (defn ssh-personal-key
   [user]
   (let [{:keys [ssh]} user]
     (if (contains? user :ssh)
-      {:personal-key {:public-key (user-env/string-to-pub-key-config (:ssh-pub-key ssh))
+      {:personal-key {:public-key (user-env/string-to-pub-key-config (:ssh-public-key ssh))
                       :private-key (:ssh-private-key ssh)}}
       {})))


clean up

clean up

--- src/frontend/cljs/alibi/entry_page_state.cljs
+++ src/frontend/cljs/alibi/entry_page_state.cljs
@@ -80,12 +80,10 @@
             (conj errs [field-name msg])))
         errors
         (->> []
-             (validate #(seq (form-selected-task %)) "SelectedItem" "Task not selected")
-             (validate #(try-parse-time (form-start-time %))
-                       "Start time",
+             (validate (comp seq form-selected-task) "SelectedItem" "Task not selected")
+             (validate (comp try-parse-time form-start-time) "Start time",
                        "Please enter a valid time value (e.g. 13:37)")
-             (validate #(try-parse-time (form-end-time %))
-                       "End time",
+             (validate (comp try-parse-time form-end-time) "End time",
                        "Please enter a valid time value (e.g. 13:37)"))
         has-field-error? (into {} errors)]
     (if (or (has-field-error? "Start time") (has-field-error? "End time"))


:zzz:

:zzz:

--- src/main/clj/agency/irl/instagrammer/core.clj
+++ src/main/clj/agency/irl/instagrammer/core.clj
@@ -20,7 +20,7 @@
    :client-secret (env :ig-client-secret)
    :redirect-uri  (env :ig-redirect-uri)
    :website-url   (env :ig-website-url)
-   :callback-url  "http://fierce-retreat-1705.herokuapp.com/callback-url"})
+   :callback-url  "https://fierce-retreat-1705.herokuapp.com/callback-url"})

 (defn handle-websocket


WIP CLJ-1910 for edn reader

WIP CLJ-1910 for edn reader

--- src/main/clojure/clojure/tools/reader/edn.clj
+++ src/main/clojure/clojure/tools/reader/edn.clj
@@ -293,6 +293,38 @@
   (doto rdr
     (read true nil true)))

+(defn namespace-keys [ns keys]
+  (for [key keys]
+    (if (or (symbol? key)
+            (keyword? key))
+      (let [[key-ns key-name] ((juxt namespace name) key)
+            ->key (if (symbol? key) symbol keyword)]
+        (cond
+          (nil? key-ns)
+          (->key ns key-name)
+
+          (= "_" key-ns)
+          (->key key-name)
+
+          :else
+          key))
+      key)))
+
+(defn- read-namespaced-map
+  [rdr _ opts pending-forms]
+  (let [token (read-token rdr (read-char rdr))]
+    (if-let [ns (some-> token parse-symbol peek)]
+      (let [ch (read-past whitespace? rdr)]
+        (if (identical? ch \{)
+          (let [items (read-delimited \} rdr opts pending-forms)]
+            (when-not (even? (count items))
+              (throw (Exception.)))
+            (let [keys (take-nth 2 items)
+                  vals (take-nth 2 (rest items))]
+              (zipmap (namespace-keys (str ns) keys) vals)))
+          (throw (Exception.))))
+      (throw (Exception.)))))
+
 (defn- macros [ch]
   (case ch
     \" read-string*
@@ -316,6 +348,7 @@
     \< (throwing-reader "Unreadable form")
     \! read-comment
     \_ read-discard
+    \: read-namespaced-map
     nil))

 (defn- read-tagged [rdr initch opts]


Update names used in test to reflect new scheme

--- test/uruk/core_test.clj
+++ test/uruk/core_test.clj
@@ -17,8 +17,7 @@

 (deftest default-request-options
   (testing "Creating a request with no explicitly-set options must reflect default options"
-    (is (= (let [req-opts (request-options {})]
-             (describe-request-options req-opts))
+    (is (= (request-options->map (make-request-options {}))
            {:timezone nil,
             :cache-result true,
             :locale nil,
@@ -65,23 +64,23 @@
 (deftest sample-request-options
   (testing "Set sample option on request"
     (is (= 6000
-           (.getTimeoutMillis (request-options {:timeout-millis 6000}))))))
+           (.getTimeoutMillis (make-request-options {:timeout-millis 6000}))))))

 (deftest roundtrip-request-options
   (testing "All request options must be set as indicated"
-    (is (= (let [req-opts (request-options {:timezone (TimeZone/getTimeZone "Pacific/Chuuk")
-                                            :cache-result false,
-                                            :locale (Locale. "ru"),
-                                            :request-time-limit 156,
-                                            :default-xquery-version "xquery version \"0.9-ml\";",
-                                            :timeout-millis 763,
-                                            :query-language "Elvish"
-                                            :result-buffer-size 23,
-                                            :effective-point-in-time 14701453805890320
-                                            :request-name "JigoroKano",
-                                            :auto-retry-delay-millis 991,
-                                            :max-auto-retry 3})]
-             (describe-request-options req-opts))
+    (is (= (let [req-opts (make-request-options {:timezone (TimeZone/getTimeZone "Pacific/Chuuk")
+                                                 :cache-result false,
+                                                 :locale (Locale. "ru"),
+                                                 :request-time-limit 156,
+                                                 :default-xquery-version "xquery version \"0.9-ml\";",
+                                                 :timeout-millis 763,
+                                                 :query-language "Elvish"
+                                                 :result-buffer-size 23,
+                                                 :effective-point-in-time 14701453805890320
+                                                 :request-name "JigoroKano",
+                                                 :auto-retry-delay-millis 991,
+                                                 :max-auto-retry 3})]
+             (request-options->map req-opts))
            {:timezone (TimeZone/getTimeZone "Pacific/Chuuk")
             :cache-result false,
             :locale (Locale. "ru"),
@@ -264,7 +263,7 @@
             :quality 0
             :namespace nil
             :temporal-collection nil}
-           (describe-content-creation-options (content-creation-options {}))))))
+           (content-creation-options->map (content-creation-options {}))))))

 (deftest content-options-roundtrip
   (testing "Round-trip options through creation and description"
@@ -285,7 +284,7 @@
                     :resolve-entities true
                     :temporal-collection "my-temp"}]
           (= opts
-             (describe-content-creation-options (content-creation-options opts)))))))
+             (content-creation-options->map (content-creation-options opts)))))))

 (deftest accept-only-valid-content-options
   (testing "Content Options that don't exist must raise an error"
@@ -301,9 +300,10 @@
   (testing "Non-string variables passed to request object are not converted to strings"
     (is (instance? com.marklogic.xcc.types.impl.DocumentImpl
                    (-> (with-open [session (create-session db)]
-                         (.getVariables (#'uruk.core/request-obj (.newAdhocQuery session "hello world")
-                                                                 nil {:derp {:value "<foo/>"
-                                                                             :type :document}})))
+                         (.getVariables (#'uruk.core/make-request-obj
+                                         (.newAdhocQuery session "hello world")
+                                         nil {:derp {:value "<foo/>"
+                                                     :type :document}})))
                        first
                        .getValue)))))

@@ -408,7 +408,7 @@
 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

 ;; (comment
-;;   (describe-session-options (create-session {:uri "xdbc://localhost:8383/"
+;;   (session->map (create-session {:uri "xdbc://localhost:8383/"
 ;;                                     :user "rest-admin" :password "x"
 ;;                                     :content-base "TutorialDB"}
 ;;                                    {} (uri-content-source "xdbc://localhost:8383/"