Spawn enemies according to player level

Spawn enemies according to player level

--- desktop/src-common/con_world/cell.clj
+++ desktop/src-common/con_world/cell.clj
@@ -165,8 +165,9 @@
    5 [135 3]
    6 [170 3]})

-(defn spawn-enemy [screen]
-  (let [index (+ 1 (rand-int 6))
+(defn spawn-enemy [screen entities]
+  (let [{:keys [level] :as player} (find-cell entities)
+         index (+ level 1 (rand-sign 1))
         sheet (u/memo-texture (str "entities/ennemi" index ".png"))
         _ (println "------------- SHEET")
         _ (println sheet)
@@ -235,7 +236,7 @@
     (do
       (println "spawn!")
       (spawn-enemy-sound (find-cell entities))
-      [(play-clj.core/update! screen :last-spawn (int total-time)) (conj entities (spawn-enemy screen))])
+      [(play-clj.core/update! screen :last-spawn (int total-time)) (conj entities (spawn-enemy screen entities))])
     [screen entities]))

 (defn animate-cell [screen entities]


More fixes.

More fixes.

--- src/oc/email/async/ses_monitor.clj
+++ src/oc/email/async/ses_monitor.clj
@@ -55,15 +55,14 @@
   (some-> email-rec :bounce-count (> 1)))

 (defn- bounce-msg [email email-rec]
-  (let [msg-type (if (repeated-bounce? email-rec) :info :warn)]
-    (cond (some-> email-rec :bounce-count (> 0))
-          (bounce-warn-msg email-rec)
-
-          (map? email-rec)
-          (bounce-info-msg email-rec)
-
-          :else
-          (first-bounce-info-msg email))))
+  (cond (repeated-bounce? email-rec)
+        (bounce-warn-msg email-rec)
+
+        (map? email-rec)
+        (bounce-info-msg email-rec)
+
+        :else
+        (first-bounce-info-msg email)))

 (defn- flag-recipients!
   [recipients]
@@ -72,7 +71,7 @@
     (timbre/debugf "Lookup user with email %s" recipient)
     (let [email-rec (bounced-email/retrieve-email c/dynamodb-opts recipient)
           msg (bounce-msg recipient email-rec)]
-      (when (bounced-email/store-hard-bounce! recipient)
+      (when (bounced-email/store-hard-bounce! c/dynamodb-opts recipient)
         (if (repeated-bounce? email-rec)
           (timbre/info msg)
           (timbre/warn msg))


guard against update errors

guard against update errors

--- src/org/spootnik/cyanite/store.clj
+++ src/org/spootnik/cyanite/store.clj
@@ -119,10 +119,13 @@
    resulting set in path-db"
   [session interval]
   (while true
-    (->> (alia/execute session pathq)
-         (map :path)
-         (set)
-         (reset! path-db))
+    (try
+      (->> (alia/execute session pathq)
+           (map :path)
+           (set)
+           (reset! path-db))
+      (catch Exception e
+        (error e "could not update path database")))
     (Thread/sleep (* interval 1000))))

 (defn cassandra-metric-store


Add styling example to ‘simple’.

Add styling example to ‘simple’.


Retrieve a user's playlist in action handlers

--- src/trak/action_handlers.cljs
+++ src/trak/action_handlers.cljs
@@ -8,38 +8,55 @@

 (def api-result-handler)

-(defmulti handler (fn [action params *db] action))
+(defmulti handler (fn [action params *db]
+                    (utils/debug "Action handler " action " with params " params)
+                    action))

 (defmethod handler :find-albums [_ _ _]
   (api/find-albums "blues"))

 (defmethod handler :api-call-result [_ params db]
-  (utils/info "Api call result " params)
   (api-result-handler (:call params) (:response params) db))

 (defmethod handler :login-on-arrival [_ params db]
-  (utils/info "Trying to log in user on arrival " params)
   (when-let [auth (globals/get-spotify-auth-token)]
-    (utils/info db)
-    (d/transact! db [{:me/identifier :me
-                      :me/status     :loading}])
-    (d/transact! db [(merge {:me/identifier :me}
+    (d/transact! db [(merge {:me/identifier :me
+                             :me/status     :loading}
                             (db/convert-atrrs-to-datascript auth :me))])
-    (utils/info (:access_token auth))
-    (api/me (:access_token auth))))
+    (api/me (:access_token auth))
+    ))

-(defmulti api-result-handler (fn [api result *db] api))
+(defmulti api-result-handler (fn [api result *db]
+                               (utils/debug "API result handler " api " with result " result)
+                               api))

 (defmethod api-result-handler :find-albums [action response *db]
-  (utils/info "Action received " action response)
   (when-let [{{{albums :items} :albums} :body} response]
     (d/transact! *db (db/json-to-datascript albums :album))))

 (defmethod api-result-handler :me [action response *db]
-  (utils/info "Action received " action response)
   (cond
     (= 401 (:status response)) (d/transact! *db [{:me/identifier :me :me/status :logged-out}])
     (= 200 (:status response))
-    (d/transact! *db [(merge {:me/identifier :me :me/status :logged-in}
-                             (db/convert-atrrs-to-datascript (:body response) :me))])))
+    (do
+      (d/transact! *db [(merge {:me/identifier :me :me/status :logged-in}
+                               (db/convert-atrrs-to-datascript (:body response) :me))])
+      (let [me (db/me @*db)]
+        (api/user-playlists (:me/href me) (:me/access_token me))))))
+
+(defmethod api-result-handler :user-playlists [action response *db]
+  (let [body (:body response)
+        items (:items body)
+        db-playlists {:playlists/limit    (:limit body)
+                      :playlists/next     (utils/ifnil? (:next body) -1)
+                      :playlists/offset   (:offset body)
+                      :playlists/previous (utils/ifnil? (:previous body) -1)
+                      :playlists/total    (:total body)
+                      :playlists/owner    :me}
+        owned-items (map (fn [item] (merge item {:owner :me})) items)
+        db-items (db/json-to-datascript owned-items :playlist)
+        ]
+    (d/transact! *db [db-playlists])
+    (d/transact! *db db-items)
+    ))


Fixing auto-complete problem on ipython console

--- src/ipython_clojure/messaging/auto_complete.clj
+++ src/ipython_clojure/messaging/auto_complete.clj
@@ -7,8 +7,10 @@
 (defmethod reply-to-message "complete_request"
   [message shell-socket iopub-socket repl-client]
   (let [code (get-in message [:content :code])
+        _ (println code)
         cursor-pos (get-in message [:content :cursor_pos])
-        code-up-to-cursor (subs code 0 (inc cursor-pos))
+        _ (println cursor-pos)
+        code-up-to-cursor (subs code 0 cursor-pos)
         last-space (.lastIndexOf code-up-to-cursor " ")
         last-non-space-symbol (if (>= last-space 0) (subs code-up-to-cursor (inc last-space)) code-up-to-cursor)
         actual-symbol (clojure.string/replace last-non-space-symbol #"[(\[{,}\])]+" "")


Moved auxiliary testcase functions to Ekeko (are of use to all Ekeko-based projects).

--- EkekoAspectJ/test/test/damp/ekeko/aspectj.clj
+++ EkekoAspectJ/test/test/damp/ekeko/aspectj.clj
@@ -2,8 +2,9 @@
   (:refer-clojure :exclude [== type declare])
   (:use [clojure.core.logic :exclude [is]] :reload)
   (:use [damp.ekeko logic])
-  (:use [damp.ekeko])
+  (:use [damp.ekeko])
   (:require
+    [test.damp [ekeko :as test]]
     [damp.ekeko.workspace
      [workspace :as ws]]
     [damp.ekeko.soot
@@ -20,85 +21,6 @@
 ;NOTE: do not forget to clean all tested projects before running the tests
 ;TODO: fix that :)

-
-;see http://richhickey.github.com/clojure/clojure.test-api.html for api
-;followed http://twoguysarguing.wordpress.com/2010/03/24/fixies/ to workaround limitations regarding setup/teardown of in
-
-
-;; Supporting functions
-;; --------------------
-
-;; Test setup / teardown
-
-(defn
-  with-ekeko-disabled
-  [f]
-  (println "Disabling Ekeko nature on all projects.")
-  (spm/workspace-disable-soot!)
-  (ws/workspace-disable-ekeko!)
-  (ws/workspace-wait-for-builds-to-finish)
-  (f))
-
-(defn
-  against-project
-  [p enable-soot? f]
-  (try
-    (println "Enabling Ekeko nature on project: " p)
-    (ws/workspace-project-enable-ekeko! p)
-    (ws/workspace-wait-for-builds-to-finish)
-    (when
-      enable-soot?
-      (do
-        (println "Enabling Soot nature on project: " p)
-        (spm/enable-soot-nature! p)))
-    (f)
-    (finally
-      (println "Disabling Ekeko nature for project: " p)
-      (when
-        enable-soot?
-        (do
-          (println "Disabling Soot nature for project: " p)
-          (spm/disable-soot-nature! p)))
-      (ws/workspace-project-disable-ekeko! p))))
-
-(defn
-  against-project-named
-  [n enable-soot? f]
-  (against-project (ws/workspace-project-named n) enable-soot? f))
-
-
-;; Query results
-
-(defn
-  tuples-to-stringset
-  "For a sequence of sequences (e.g., query results), converts each inner sequence
-   element to a string and returns the resulting set of converted inner sequences."
-  [seqofseqs]
-  (set (map (partial map str) seqofseqs)))
-
-(defn
-  tuples-to-stringsetstring
-  "For a sequence of sequences (e.g., query results), converts each inner sequence
-   element to a string and returns the string representation of the resulting set of
-   converted inner sequences.
-
-   Run this on the results of a working query to transform them to a string that is
-   used for the tests. For example:
-   (tuples-to-stringsetstring (damp.ekeko/ekeko [?itmethod]
-           (assumptions/intertypemethod-unused ?itmethod)))"
-  [seqofseqs]
-  (str (tuples-to-stringset seqofseqs)))
-
-(defn
-  tuples-are
-  "Verifies whether the stringset representation of the tuples corresponds to the given string
-   (obtained through tuples-to-stringsetstring)."
-  [tuples stringsetstring]
-  (is
-    (empty?
-      (clojure.set/difference
-        (tuples-to-stringset tuples)
-        (read-string stringsetstring)))))

 ;; Actual Tests
 ;; ------------
@@ -117,14 +39,14 @@

 (deftest
   explicit-decprec+-test
-  (tuples-are
+  (test/tuples-are
     (ekeko [?dom ?sub]
            (world/aspect-dominates-aspect-explicitly+ ?dom ?sub))
 "#{(\"cl.pleiad.ajlmp.testPrecedence.FirstAspect\" \"cl.pleiad.ajlmp.testPrecedence.FifthAspect\") (\"cl.pleiad.ajlmp.testPrecedence.ThirdAspect\" \"cl.pleiad.ajlmp.testPrecedence.EightAspect\") (\"cl.pleiad.ajlmp.testPrecedence.FirstAspect\" \"cl.pleiad.ajlmp.testPrecedence.SecondAspect\") (\"cl.pleiad.ajlmp.testPrecedence.SeventhAspect\" \"cl.pleiad.ajlmp.testPrecedence.FifthAspect\") (\"cl.pleiad.ajlmp.testPrecedence.ThirdAspect\" \"cl.pleiad.ajlmp.testPrecedence.FourthAspect\") (\"cl.pleiad.ajlmp.testPrecedence.SecondAspect\" \"cl.pleiad.ajlmp.testPrecedence.FifthAspect\")}"))

 (deftest
   implicit-precedence+-test
-  (tuples-are
+  (test/tuples-are
     (ekeko [?dom ?sub]
            (world/aspect-dominates-aspect-implicitly+ ?dom ?sub))
  "#{(\"cl.pleiad.ajlmp.testPrecedence.FourthAspect\" \"cl.pleiad.ajlmp.testPrecedence.ThirdAspect\") (\"cl.pleiad.ajlmp.testPrecedence.SixthAspect\" \"cl.pleiad.ajlmp.testPrecedence.FourthAspect\") (\"cl.pleiad.ajlmp.testPrecedence.SixthAspect\" \"cl.pleiad.ajlmp.testPrecedence.ThirdAspect\") (\"cl.pleiad.ajlmp.testPrecedence.EightAspect\" \"cl.pleiad.ajlmp.testPrecedence.SeventhAspect\")}"))
@@ -138,21 +60,21 @@
 ; but should also be between 4 and 5
 (deftest
   aspect-dominates-aspect-test
-  (tuples-are
+  (test/tuples-are
     (ekeko [?dom ?sub]
            (world/aspect-dominates-aspect ?dom ?sub))
 "#{(\"cl.pleiad.ajlmp.testPrecedence.FourthAspect\" \"cl.pleiad.ajlmp.testPrecedence.SeventhAspect\") (\"cl.pleiad.ajlmp.testPrecedence.SixthAspect\" \"cl.pleiad.ajlmp.testPrecedence.FifthAspect\") (\"cl.pleiad.ajlmp.testPrecedence.FirstAspect\" \"cl.pleiad.ajlmp.testPrecedence.FifthAspect\") (\"cl.pleiad.ajlmp.testPrecedence.ThirdAspect\" \"cl.pleiad.ajlmp.testPrecedence.EightAspect\") (\"cl.pleiad.ajlmp.testPrecedence.EightAspect\" \"cl.pleiad.ajlmp.testPrecedence.FifthAspect\") (\"cl.pleiad.ajlmp.testPrecedence.SixthAspect\" \"cl.pleiad.ajlmp.testPrecedence.SeventhAspect\") (\"cl.pleiad.ajlmp.testPrecedence.SixthAspect\" \"cl.pleiad.ajlmp.testPrecedence.FourthAspect\") (\"cl.pleiad.ajlmp.testPrecedence.FirstAspect\" \"cl.pleiad.ajlmp.testPrecedence.SecondAspect\") (\"cl.pleiad.ajlmp.testPrecedence.FourthAspect\" \"cl.pleiad.ajlmp.testPrecedence.EightAspect\") (\"cl.pleiad.ajlmp.testPrecedence.ThirdAspect\" \"cl.pleiad.ajlmp.testPrecedence.FifthAspect\") (\"cl.pleiad.ajlmp.testPrecedence.SixthAspect\" \"cl.pleiad.ajlmp.testPrecedence.ThirdAspect\") (\"cl.pleiad.ajlmp.testPrecedence.EightAspect\" \"cl.pleiad.ajlmp.testPrecedence.SeventhAspect\") (\"cl.pleiad.ajlmp.testPrecedence.FourthAspect\" \"cl.pleiad.ajlmp.testPrecedence.FifthAspect\") (\"cl.pleiad.ajlmp.testPrecedence.SeventhAspect\" \"cl.pleiad.ajlmp.testPrecedence.FifthAspect\") (\"cl.pleiad.ajlmp.testPrecedence.SixthAspect\" \"cl.pleiad.ajlmp.testPrecedence.EightAspect\") (\"cl.pleiad.ajlmp.testPrecedence.ThirdAspect\" \"cl.pleiad.ajlmp.testPrecedence.SeventhAspect\") (\"cl.pleiad.ajlmp.testPrecedence.ThirdAspect\" \"cl.pleiad.ajlmp.testPrecedence.FourthAspect\") (\"cl.pleiad.ajlmp.testPrecedence.SecondAspect\" \"cl.pleiad.ajlmp.testPrecedence.FifthAspect\")}"))

 (deftest
   overriden-implicit-precedence-test
-  (tuples-are
+  (test/tuples-are
     (ekeko [?first ?second]
            (assumptions/overriden-implicit-precedence ?first ?second))
     "#{(\"cl.pleiad.ajlmp.testPrecedence.FourthAspect\" \"cl.pleiad.ajlmp.testPrecedence.ThirdAspect\")}"))

 (deftest
   overriden-implicit-precedence-shadow-test
-  (tuples-are
+  (test/tuples-are
     (ekeko [?first ?second ?shadow]
            (assumptions/overriden-implicit-precedence-shadow ?first ?second ?shadow))
     "#{(\"cl.pleiad.ajlmp.testPrecedence.FourthAspect\" \"cl.pleiad.ajlmp.testPrecedence.ThirdAspect\" \"baseMethod1()\")}"))
@@ -160,14 +82,14 @@
 ; OK 16 oct
 (deftest
   incomplete-precedence-test
-  (tuples-are
+  (test/tuples-are
     (ekeko [?first ?second]
            (assumptions/incomplete-precedence ?first ?second))
     "#{(\"cl.pleiad.ajlmp.testPrecedence.FirstAspect\" \"cl.pleiad.ajlmp.testPrecedence.EightAspect\") (\"cl.pleiad.ajlmp.testPrecedence.EightAspect\" \"cl.pleiad.ajlmp.testPrecedence.FirstAspect\") (\"cl.pleiad.ajlmp.testPrecedence.SecondAspect\" \"cl.pleiad.ajlmp.testPrecedence.SeventhAspect\") (\"cl.pleiad.ajlmp.testPrecedence.SecondAspect\" \"cl.pleiad.ajlmp.testPrecedence.FourthAspect\") (\"cl.pleiad.ajlmp.testPrecedence.SixthAspect\" \"cl.pleiad.ajlmp.testPrecedence.SecondAspect\") (\"cl.pleiad.ajlmp.testPrecedence.FirstAspect\" \"cl.pleiad.ajlmp.testPrecedence.SixthAspect\") (\"cl.pleiad.ajlmp.testPrecedence.ThirdAspect\" \"cl.pleiad.ajlmp.testPrecedence.FirstAspect\") (\"cl.pleiad.ajlmp.testPrecedence.SecondAspect\" \"cl.pleiad.ajlmp.testPrecedence.ThirdAspect\") (\"cl.pleiad.ajlmp.testPrecedence.EightAspect\" \"cl.pleiad.ajlmp.testPrecedence.SecondAspect\") (\"cl.pleiad.ajlmp.testPrecedence.FourthAspect\" \"cl.pleiad.ajlmp.testPrecedence.FirstAspect\") (\"cl.pleiad.ajlmp.testPrecedence.SeventhAspect\" \"cl.pleiad.ajlmp.testPrecedence.FirstAspect\") (\"cl.pleiad.ajlmp.testPrecedence.FirstAspect\" \"cl.pleiad.ajlmp.testPrecedence.SeventhAspect\") (\"cl.pleiad.ajlmp.testPrecedence.FirstAspect\" \"cl.pleiad.ajlmp.testPrecedence.FourthAspect\") (\"cl.pleiad.ajlmp.testPrecedence.SecondAspect\" \"cl.pleiad.ajlmp.testPrecedence.EightAspect\") (\"cl.pleiad.ajlmp.testPrecedence.ThirdAspect\" \"cl.pleiad.ajlmp.testPrecedence.SecondAspect\") (\"cl.pleiad.ajlmp.testPrecedence.FirstAspect\" \"cl.pleiad.ajlmp.testPrecedence.ThirdAspect\") (\"cl.pleiad.ajlmp.testPrecedence.SixthAspect\" \"cl.pleiad.ajlmp.testPrecedence.FirstAspect\") (\"cl.pleiad.ajlmp.testPrecedence.FourthAspect\" \"cl.pleiad.ajlmp.testPrecedence.SecondAspect\") (\"cl.pleiad.ajlmp.testPrecedence.SecondAspect\" \"cl.pleiad.ajlmp.testPrecedence.SixthAspect\") (\"cl.pleiad.ajlmp.testPrecedence.SeventhAspect\" \"cl.pleiad.ajlmp.testPrecedence.SecondAspect\")}"))

 (deftest
   incomplete-precedence-shadow-test
-  (tuples-are
+  (test/tuples-are
     (ekeko [?first ?second ?shadow]
            (assumptions/incomplete-precedence-shadow ?first ?second ?shadow))
 "#{(\"cl.pleiad.ajlmp.testPrecedence.FirstAspect\" \"cl.pleiad.ajlmp.testPrecedence.ThirdAspect\" \"baseMethod1()\") (\"cl.pleiad.ajlmp.testPrecedence.FirstAspect\" \"cl.pleiad.ajlmp.testPrecedence.FourthAspect\" \"baseMethod1()\") (\"cl.pleiad.ajlmp.testPrecedence.FourthAspect\" \"cl.pleiad.ajlmp.testPrecedence.FirstAspect\" \"baseMethod1()\") (\"cl.pleiad.ajlmp.testPrecedence.ThirdAspect\" \"cl.pleiad.ajlmp.testPrecedence.FirstAspect\" \"baseMethod1()\")}"))
@@ -175,14 +97,14 @@

 (deftest
   concretization-test
-  (tuples-are
+  (test/tuples-are
     (ekeko [?abpointcut ?concpointcut1 ?concpointcut2]
            (assumptions/abstractpointcut-concretized-reconcretized ?abpointcut ?concpointcut1 ?concpointcut2))
     "#{(\"pointcut cl.pleiad.ajlmp.testPointcuts.AbstractAspect.abstractpc1()\" \"pointcut cl.pleiad.ajlmp.testPointcuts.FirstAspect.abstractpc1()\" \"pointcut cl.pleiad.ajlmp.testPointcuts.SecondAspect.abstractpc1()\")}"))

 (deftest
   intertypemethod-unused-test
-  (tuples-are
+  (test/tuples-are
     (ekeko [?itmethod]
            (assumptions/intertypemethod-unused ?itmethod))
     "#{(\"(BcelTypeMunger ResolvedTypeMunger(Method, void cl.pleiad.ajlmp.testITD.BaseClass.itdB()))\")}"))
@@ -198,26 +120,26 @@
 (deftest
   test-suite
   ;sanity check
-  (against-project-named "AJ-LMP-Precedence" false aspect-test )
+  (test/against-project-named "AJ-LMP-Precedence" false aspect-test )

   ;precedence logic -- commented out for speed
-  (against-project-named "AJ-LMP-Precedence" false explicit-decprec+-test)
-  (against-project-named "AJ-LMP-Precedence" false implicit-precedence+-test)
-  (against-project-named "AJ-LMP-Precedence" false aspect-dominates-aspect-test)
+  (test/against-project-named "AJ-LMP-Precedence" false explicit-decprec+-test)
+  (test/against-project-named "AJ-LMP-Precedence" false implicit-precedence+-test)
+  (test/against-project-named "AJ-LMP-Precedence" false aspect-dominates-aspect-test)

   ;assumptions
-  (against-project-named "AJ-LMP-Precedence" false overriden-implicit-precedence-test)
-  (against-project-named "AJ-LMP-Precedence" false overriden-implicit-precedence-shadow-test)
-  (against-project-named "AJ-LMP-Precedence" false incomplete-precedence-test)
-  (against-project-named "AJ-LMP-Precedence" false incomplete-precedence-shadow-test)
-  (against-project-named "AJ-LMP-Pointcuts" false concretization-test)
-  (against-project-named "AJ-LMP-ITD" true intertypemethod-unused-test)
+  (test/against-project-named "AJ-LMP-Precedence" false overriden-implicit-precedence-test)
+  (test/against-project-named "AJ-LMP-Precedence" false overriden-implicit-precedence-shadow-test)
+  (test/against-project-named "AJ-LMP-Precedence" false incomplete-precedence-test)
+  (test/against-project-named "AJ-LMP-Precedence" false incomplete-precedence-shadow-test)
+  (test/against-project-named "AJ-LMP-Pointcuts" false concretization-test)
+  (test/against-project-named "AJ-LMP-ITD" true intertypemethod-unused-test)
   )

 (defn
   test-ns-hook
   []
-  (with-ekeko-disabled test-suite))
+  (test/with-ekeko-disabled test-suite))

 ;; Example REPL Session that runs the test
 ;; ---------------------------------------


Remove printlns.

Remove printlns.

--- src/uxbox/data/workspace.cljs
+++ src/uxbox/data/workspace.cljs
@@ -139,7 +139,7 @@
              (assoc-in state [:workspace :selected]))))))

 (defn add-shape
-  "Mark a shape selected for drawing in the canvas."
+  "Create and add shape to the current selected page."
   [shape props]
   (sc/validate! +shape-schema+ shape)
   (sc/validate! +shape-props-schema+ props)
@@ -232,7 +232,6 @@
   (reify
     rs/UpdateEvent
     (-apply-update [_ state]
-      (println "toggle-shape-visibility" sid)
       (let [shape (get-in state [:shapes-by-id sid])
             hidden? (:hidden shape false)]
         (if hidden?
@@ -244,7 +243,6 @@
   (reify
     rs/UpdateEvent
     (-apply-update [_ state]
-      (println "toggle-shape-blocking" sid)
       (let [shape (get-in state [:shapes-by-id sid])
             blocked? (:blocked shape false)]
         (if blocked?


more inspect keyboard control

more inspect keyboard control

--- src/main/shadow/cljs/ui/components/inspect.cljs
+++ src/main/shadow/cljs/ui/components/inspect.cljs
@@ -89,15 +89,23 @@
 (def seq-vlist
   (vlist/configure :fragment-vlist
     {:item-height 22}
-    (fn [{:keys [val] :as entry} idx opts]
-      (<< [:div.border-b.flex
-           {:on-click [::inspect-nav! idx]}
-           [:div.pl-4.px-2.border-r.text-right {:style {:width "60px"}} idx]
-           [:div.px-2.flex-1.truncate (render-edn-limit val)]]))))
+    (fn [{:keys [val] :as entry} {:keys [idx focus] :as opts}]
+      (<< [:div
+           {:class (if focus
+                     "border-b flex bg-gray-200"
+                     "border-b flex hover:bg-gray-100")
+            :on-click [::inspect-nav! idx]}
+           [:div
+            {:class "pl-4 px-2 border-r text-right"
+             :style {:width "60px"}}
+            idx]
+           [:div.px-2.flex-1.truncate
+            (render-edn-limit val)]]))))

 (defn render-seq
   [object active?]
   (seq-vlist {:ident (:db/ident object)
+              :select-event [::kb-select!]
               :tabindex (if active? 0 -1)}))

 (defmethod render-view :vec [data active?]
@@ -117,18 +125,25 @@
       :grid-template-columns "min-content minmax(25%, auto)"
       :grid-row-gap "1px"
       :grid-column-gap ".5rem"}}
-    (fn [{:keys [key val] :as entry} idx opts]
-      (<< [:div.whitespace-no-wrap.font-bold.px-2.border-r.truncate.bg-gray-100.hover:bg-gray-300
-           {:on-click [::inspect-nav! idx]}
+    (fn [{:keys [key val] :as entry} {:keys [idx focus] :as opts}]
+      (<< [:div
+           {:on-click [::inspect-nav! idx]
+            :class
+            (str "whitespace-no-wrap font-bold px-2 border-r truncate bg-gray-100"
+                 (if focus
+                   " bg-gray-200"
+                   " hover:bg-gray-100"))}
            (render-edn-limit key)]
-          [:div.whitespace-no-wrap.truncate
-           {:on-click [::inspect-nav! idx]}
+          [:div
+           {:on-click [::inspect-nav! idx]
+            :class "whitespace-no-wrap truncate"}
            (render-edn-limit val)])
       )))

 (defmethod render-view :map
   [object active?]
   (map-vlist {:ident (:db/ident object)
+              :select-event [::kb-select!]
               :tabindex (if active? 0 -1)}))

 (def lazy-seq-vlist
@@ -138,7 +153,7 @@
      (fn [entry]
        (<< [:div "Show more ... " (pr-str entry)]))}

-    (fn [{:keys [val] :as entry} idx opts]
+    (fn [{:keys [val] :as entry} {:keys [idx focus] :as opts}]
       (<< [:div.border-b.flex
            {:on-click [::inspect-nav! idx]}
            [:div.pl-4.px-2.border-r.text-right {:style {:width "60px"}} idx]
@@ -180,6 +195,9 @@

   (event ::inspect-switch-display! [env display-type]
     (sg/run-tx env [::m/inspect-switch-display! ident display-type]))
+
+  (event ::kb-select! [env key-idx data]
+    (sg/run-tx env [::m/inspect-nav! ident key-idx panel-idx]))

   (render


Add a singular-backref-attr? helper to identify singular backrefs

--- src/main/workflo/macros/query/util.cljc
+++ src/main/workflo/macros/query/util.cljc
@@ -4,7 +4,8 @@
             [clojure.string :as string]
             #?(:cljs [cljs.spec.impl.gen :as gen]
                :clj  [clojure.spec.gen :as gen])
-            [clojure.string :refer [capitalize]]))
+            [clojure.string :refer [capitalize]]
+            [inflections.core :as inflections]))

 (s/fdef one-item?
   :args (s/cat :coll coll?)
@@ -91,3 +92,12 @@
   (let [ns (namespace attr)
         nm (name attr)]
     (and ns (string/starts-with? nm "_"))))
+
+(defn singular-backref-attr?
+  "Returns true if a backref attribute represents a singular (as
+   opposed to plural) result, that is, if the namespace is
+   singular."
+  [attr]
+  (let [ns (namespace attr)]
+    (and (backref-attr? attr)
+         (= ns (inflections/singular ns)))))


grammar improvement

grammar improvement

--- src/pc/views/blog/product_hunt_wake_up_call.clj
+++ src/pc/views/blog/product_hunt_wake_up_call.clj
@@ -59,7 +59,7 @@

     [:article
      [:h3 "Product Hunt loved Precursor, and we loved the feedback."]
-     [:p "By mid-day Precursor had been shared on several other sites, but Product Hunt was still responsible for the majority of our traffic.
+     [:p "By mid-day Precursor was being shared on several other sites, but Product Hunt was still responsible for the majority of our traffic.
          What we found most interesting about the Product Hunt traffic was not its volume, but its quality of feedback.
          Over and over again, the Product Hunt community offered us insightful and actionable feedback."]
      [:p "Users understood that Precursor just got started, and that it was a minimum viable product to a more well-defined prototyping solution.


Revert translating gitignores to basenames

Path-agnostic basenames were too agressive. Was causing issues e.g.
LightTable has deploy/plugins -> plugins which caused issues with
other LT plugins in other workspaces

--- src/lt/plugins/smart_ignore.cljs
+++ src/lt/plugins/smart_ignore.cljs
@@ -20,9 +20,10 @@
                     (if (and (files/dir? (files/join parent relative))
                              (not (.endsWith relative "/")))
                       (str relative "/") relative)))
-             ;; Only return basename since ignore-pattern
-             ;; is used by walkdir2.js which only matches against basenames
-             (map #(str "^" (gs/regExpEscape (re-find #"[^/]+/?$" %)) "$")))))
+             ;; This can return non-basenames e.g. dir/file1 which isn't compatible with walkdir2.js.
+             ;; However, only returning basenames is too agressive to apply across multiple workspaces.
+             ;; Per-workspace ignores would resolve this.
+             (map #(str "^" (gs/regExpEscape %) "$")))))

 (defn update-ignore-pattern [dir]
   (let [gitignore (files/join dir ".gitignore")]


Basic Nodes and assoc working

Basic Nodes and assoc working

--- src/main/cljs/fast_map/core.cljs
+++ src/main/cljs/fast_map/core.cljs
@@ -1 +1,135 @@
-(ns cljs.fast-map.core)
+(ns cljs.fast-map.core
+  (:refer-clojure :exclude [Box ->Box BitmapIndexedNode ->BitmapIndexedNode
+                            HashCollisionNode ->HashCollisionNode
+                            create-inode-seq create-array-node-seq create-node
+                            mask bitmap-indexed-node-index bitpos]))
+
+(deftype Box [^:mutable added ^:mutable modified])
+
+(declare create-inode-seq create-array-node-seq create-node)
+
+(defn- mask [hash shift]
+  (bit-and (bit-shift-right-zero-fill hash shift) 0x01f))
+
+(defn- bitmap-indexed-node-index [bitmap bit]
+  (bit-count (bit-and bitmap (dec bit))))
+
+(defn- bitpos [hash shift]
+  (bit-shift-left 1 (mask hash shift)))
+
+(defn- node-at [arr nodemap bit]
+  (- (alength arr) 1 (bitmap-indexed-node-index nodemap bit)))
+
+(defn- can-edit [x y]
+  (and (not= x nil) (not= y nil) (identical? x y)))
+
+(deftype BitmapIndexedNode [edit ^:mutable datamap ^:mutable nodemap ^:mutable arr]
+  Object
+  (copy-and-set-node [inode e bit node]
+    (let [idx (node-at arr nodemap bit)]
+      (if (can-edit e edit)
+        (do
+          (aset arr idx node)
+          inode)
+        (let [new-arr (aclone arr)]
+          (aset new-arr idx node)
+          (BitmapIndexedNode. e datamap nodemap new-arr)))))
+
+  (copy-and-set-value [inode e bit val]
+    (let [idx (inc (* 2 (bitmap-indexed-node-index datamap bit)))]
+      (if (can-edit e edit)
+        (do
+          (aset arr idx val)
+          inode)
+        (let [new-arr (aclone arr)]
+          (aset new-arr idx val)
+          (BitmapIndexedNode. e datamap nodemap new-arr)))))
+
+  (copy-and-migrate-to-node [inode e bit node]
+    (let [idx-old (* 2 (bitmap-indexed-node-index datamap bit))
+          idx-new (- (alength arr) 2 (* 2 (bitmap-indexed-node-index nodemap bit)))
+          dst (make-array (dec (alength arr)))]
+      (array-copy arr 0 dst 0 idx-old)
+      (array-copy arr (+ 2 idx-old) dst idx-old (- idx-new idx-old))
+      (aset dst idx-new node)
+      (array-copy arr (+ idx-new 2) dst (inc idx-new) (- (alength arr) idx-new 2))
+      (BitmapIndexedNode. e (bit-or datamap bit) (bit-xor nodemap bit) dst)))
+
+  (inode-assoc [inode aedit shift hash key val changed?]
+    (let [bit (bitpos hash shift)]
+      (cond
+        (not (zero? (bit-and datamap bit)))
+        (let [idx (bitmap-indexed-node-index datamap bit)
+              k (aget arr (* 2 idx))]
+          (set! (.-modified changed?) true)
+          (if (= k key)
+            (do
+              (set! (.-added changed?) true)
+              (.copy-and-set-value inode aedit bit val))
+            (let [v (aget arr (inc (* 2 idx)))
+                  new-node (create-node aedit (+ shift 5) k v hash key val)]
+              (.copy-and-migrate-to-node inode aedit bit new-node))))
+        (not (zero? (bit-and nodemap bit)))
+        (let [sub-node (node-at arr nodemap bit)
+              sub-node-new (.inode_assoc sub-node shift hash key val changed?)]
+          (if (.-modified changed?)
+            (.copy-and-set-node inode aedit bit sub-node-new)
+            inode))
+        :else
+        (let [n (bit-count datamap)
+              idx (bitmap-indexed-node-index datamap bit)
+              new-arr (make-array (* 2 (inc n)))]
+          (array-copy arr 0 new-arr 0 (* 2 idx))
+          (aset new-arr (* 2 idx) key)
+          (aset new-arr (inc (* 2 idx)) val)
+          (array-copy arr (* 2 idx) new-arr (* 2 (inc idx)) (* 2 (- n idx)))
+          (set! (.-added changed?) true)
+          (BitmapIndexedNode. aedit (bit-or datamap bit) nodemap new-arr))))))
+
+(set! (.-EMPTY BitmapIndexedNode) (BitmapIndexedNode. nil 0 0 (make-array 0)))
+
+(deftype HashCollisionNode [edit
+                            ^:mutable collision-hash
+                            ^:mutable cnt
+                            ^:mutable arr]
+  Object
+  (inode-assoc [inode hedit shift hash key val added-leaf?]
+    (assert (== hash collision-hash))
+    (let [idx (hash-collision-node-find-index arr cnt key)]
+      (if (== idx -1)
+        (let [len     (* 2 cnt)
+              new-arr (make-array (+ len 2))]
+          (array-copy arr 0 new-arr 0 len)
+          (aset new-arr len key)
+          (aset new-arr (inc len) val)
+          (set! (.-val added-leaf?) true)
+          (HashCollisionNode. nil collision-hash (inc cnt) new-arr))
+        (if (= (aget arr idx) val)
+          inode
+          (HashCollisionNode. nil collision-hash cnt (clone-and-set arr (inc idx) val)))))))
+
+(defn- create-node [edit shift key1 val1 key2hash key2 val2]
+  (let [key1hash (hash key1)]
+    (if (== key1hash key2hash)
+      (HashCollisionNode. nil key1hash 2 (array key1 val1 key2 val2))
+      (let [changed? (Box. false false)]
+        (-> (.-EMPTY BitmapIndexedNode)
+            (.inode-assoc edit shift key1hash key1 val1 changed?)
+            (.inode-assoc edit shift key2hash key2 val2 changed?))))))
+
+(comment
+    (let [em (.-EMPTY BitmapIndexedNode)
+          sent (js-obj)]
+      (let [bn1 (.inode-assoc em nil 0 (hash :foo1) :foo1 :bar  (Box. false false))
+            bn2 (.inode-assoc bn1 nil 0 (hash :foo1) :foo1 :not-bar  (Box. false false))
+            bn3 (.inode-assoc bn1 nil 0 (hash :foo2) :foo2 :bar2  (Box. false false))
+            nn1 (.inode-assoc bn3 nil 0 (hash :foo2) :foo3 :split-bar  (Box. false false))]
+        (println "Pesistent Assoc")
+        (println [(.-arr em) (.-arr bn1) (.-arr bn2) (.-arr bn3) (.-arr nn1)
+                  (.-arr (aget (.-arr nn1) 2))]))
+      (let [bn1 (.inode-assoc em nil 0 (hash :foo1) :foo1 :bar  (Box. false false))
+            tbn1 (.inode-assoc bn1 sent 0 (hash :foo1) :foo1 :my-bar  (Box. false false))
+            tbn2 (.inode-assoc tbn1 sent 0 (hash :foo1) :foo1 :another-bar  (Box. false false))
+            tbn3 (.inode-assoc tbn2 sent 0 (hash :foo1) :foo1 :changed  (Box. false false))]
+        (println "Transient Assoc")
+        (println [(.-arr em) (.-arr bn1) (.-arr tbn1) (.-arr tbn2) (.-arr tbn3)])) ))


Return only the name of an attack move

Return only the name of an attack move

--- frontend/src/cruncher/moves/main.cljs
+++ frontend/src/cruncher/moves/main.cljs
@@ -1,7 +1,7 @@
 (ns cruncher.moves.main
   (:require [cruncher.moves.data :as data]))

-(defn get
+(defn get-name
   "Return move object from moves-database by the move id."
   [id]
-  (id data/all))+  (:name (get data/all id)))


corrected comment

corrected comment

--- Clojure-Websockets/MainApp/src/clj/birdwatch/http/component.clj
+++ Clojure-Websockets/MainApp/src/clj/birdwatch/http/component.clj
@@ -22,7 +22,7 @@
            (GET  "/dev" [] (static-html "index-dev.html"))
            (GET  "/chsk" req ((:ajax-get-or-ws-handshake-fn comm) req))
            (POST "/chsk" req ((:ajax-post-fn comm) req))
-           (route/resources "/") ; Static files, notably public/main.js (our cljs target)
+           (route/resources "/") ; Static files, e.g. /js/build/birdwatch-opt.js (our cljs target)
            (route/not-found "Page not found"))
          (let [my-ring-handler   (ring.middleware.defaults/wrap-defaults my-routes ring-defaults-config)
                server (http-kit-server/run-server my-ring-handler {:port (:port conf)})


Test arguments in local processing element.

--- test/dsbdp/test/data_processing_pipeline_tests.clj
+++ test/dsbdp/test/data_processing_pipeline_tests.clj
@@ -39,4 +39,19 @@
     (is (flag-set? flag))
     (interrupt proc-element)))

+(deftest simple-local-processing-element-in-args-test
+  (let [in-queue (LinkedTransferQueue.)
+        flag (prepare-flag)
+        in-arg (atom nil)
+        out-arg (atom nil)
+        proc-element (create-local-processing-element in-queue
+                                                      (fn [in out]
+                                                        (reset! in-arg in)
+                                                        (reset! out-arg out)
+                                                        (set-flag flag)))]
+    (.put in-queue (LocalTransferContainer. "in" "out"))
+    (await-flag flag)
+    (is (= "in" @in-arg))
+    (is (= "out" @out-arg))
+    (interrupt proc-element)))


`throw-on-invalid-body` test was removed, because now there are no invalid methods


Choose correct separator-ix when rotating

--- src/aurora/btree.cljs
+++ src/aurora/btree.cljs
@@ -163,10 +163,11 @@
                   (let [left-node (aget (.-children parent) (- parent-ix 1))
                         min-keys (js/Math.floor (/ max-keys 2))]
                     (if (> (alength (.-keys left-node)) min-keys)
-                      (let [key&val&child (.pop! left-node (- (alength (.-keys left-node)) 1) right-child)]
-                        (.push! this 0 #js [(aget (.-keys parent) parent-ix) (aget (.-vals parent) parent-ix) (aget key&val&child 2)] left-child)
-                        (aset (.-keys parent) parent-ix (aget key&val&child 0))
-                        (aset (.-vals parent) parent-ix (aget key&val&child 1))
+                      (let [key&val&child (.pop! left-node (- (alength (.-keys left-node)) 1) right-child)
+                            separator-ix (- parent-ix 1)]
+                        (.push! this 0 #js [(aget (.-keys parent) separator-ix) (aget (.-vals parent) separator-ix) (aget key&val&child 2)] left-child)
+                        (aset (.-keys parent) separator-ix (aget key&val&child 0))
+                        (aset (.-vals parent) separator-ix (aget key&val&child 1))
                         (.maintain! this max-keys)
                         (.maintain! left-node max-keys)
                         (.maintain! parent max-keys))
@@ -177,10 +178,11 @@
                    (let [right-node (aget (.-children parent) (+ parent-ix 1))
                          min-keys (js/Math.floor (/ max-keys 2))]
                      (if (> (alength (.-keys right-node)) min-keys)
-                       (let [key&val&child (.pop! right-node 0 left-child)]
-                         (.push! this (alength keys) #js [(aget (.-keys parent) parent-ix) (aget (.-vals parent) parent-ix) (aget key&val&child 2)] right-child)
-                         (aset (.-keys parent) parent-ix (aget key&val&child 0))
-                         (aset (.-vals parent) parent-ix (aget key&val&child 1))
+                       (let [key&val&child (.pop! right-node 0 left-child)
+                             separator-ix parent-ix]
+                         (.push! this (alength keys) #js [(aget (.-keys parent) separator-ix) (aget (.-vals parent) separator-ix) (aget key&val&child 2)] right-child)
+                         (aset (.-keys parent) separator-ix (aget key&val&child 0))
+                         (aset (.-vals parent) separator-ix (aget key&val&child 1))
                          (.maintain! this max-keys)
                          (.maintain! right-node max-keys)
                          (.maintain! parent max-keys))
@@ -429,12 +431,6 @@
                  movements (gen/vector gen-movement)]
                 (run-iterator-prop min-keys actions movements)))

-(run-building-prop 1
-                   [[:assoc! 90 0] [:assoc! 0 0] [:assoc! 1 0]
-                    [:assoc! 2 0] [:assoc! -1 0] [:assoc! -2 0]
-                    [:assoc! "" 0] [:assoc! 91 0] [:assoc! " " 0]
-                    [:assoc! 3 0] [:dissoc! 90]])
-
 (comment
   (dc/quick-check 1000 least-prop)
   (dc/quick-check 1000 greatest-prop)


Don't log "macro-expanded" query when it has no macros

--- src/metabase/driver/query_processor.clj
+++ src/metabase/driver/query_processor.clj
@@ -111,7 +111,8 @@
   (fn [query]
     (qp (if (structured-query? query)
           (let [macro-expanded-query (macros/expand-macros query)]
-            (when (not *disable-qp-logging*)
+            (when (and (not *disable-qp-logging*)
+                       (not= macro-expanded-query query))
               (log/debug (u/format-color 'cyan "\n\nMACRO/SUBSTITUTED: 😻\n%s" (u/pprint-to-str macro-expanded-query))))
             (-> macro-expanded-query
                 expand/expand


Make sure name-of-part is extracted from vubis export

--- src/catalog/vubis.clj
+++ src/catalog/vubis.clj
@@ -194,7 +194,7 @@
   "Return a proper production based on a raw item, e.g.
   translate the language tag into proper ISO 639-1 codes"
   [{:keys [record-id source description source-publisher
-           library-signature title subtitles creator
+           library-signature title subtitles name-of-part creator
            price product-number language format producer
            genre genre-code genre-text
            produced-commercially? source-date general-note
@@ -217,6 +217,7 @@
                   :record-id record-id
                   :title (remove-nonprintable-chars title)
                   :subtitles (seq (map remove-nonprintable-chars subtitles))
+                  :name-of-part name-of-part
                   :creator creator
                   :description description
                   :source-publisher source-publisher


Placeholder process-fn-body.

Placeholder process-fn-body.

--- src/cbfg/zgo/core.clj
+++ src/cbfg/zgo/core.clj
@@ -46,8 +46,11 @@
 (defn c2g [sym]
   (string/replace (str sym) "-" "_"))

-(defn process-fn-body [params body]
-  body)
+(defn process-fn-body [params forms]
+  (map-indexed (fn [idx form]
+                 [(when (= idx (dec (count forms))) "return")
+                  form ";"])
+               forms))

 (defn process-fn [params body]
   ["func" ["(" (interpose "," (map c2g params)) ")"]


Fixed util dependency

Fixed util dependency

--- kuona-core/src/kuona_core/collector/snapshot.clj
+++ kuona-core/src/kuona_core/collector/snapshot.clj
@@ -7,7 +7,8 @@
     [kuona-core.stores :as stores]
     [kuona-core.git :refer :all]
     [kuona-core.cloc :as cloc]
-    [kuona-core.builder :as builder])
+    [kuona-core.builder :as builder]
+    [kuona-core.util :as util])
   (:gen-class))

@@ -60,7 +61,7 @@
         name (-> repo :name)]
     (try+
       (log/info "Creating repository snapshot id" id "name" name "from " url "to " local-dir)
-      (if (directory? local-dir)
+      (if (util/directory? local-dir)
         (git-pull url local-dir)
         (git-clone url local-dir))
       (let [loc-data      (cloc/loc-collector (fn [a] a) local-dir)


breakout protocol warning code, prep for protocol impl tracking

--- src/clj/cljs/core.clj
+++ src/clj/cljs/core.clj
@@ -550,6 +550,22 @@
 (defn to-property [sym]
   (symbol (core/str "-" sym)))

+(defn warn-and-update-protocol [p env]
+  (when-not (= 'Object p)
+    (if (:undeclared cljs.analyzer/*cljs-warnings*)
+      (if-let [var (cljs.analyzer/resolve-existing-var (dissoc env :locals) p)]
+        (do
+          (when-not (:protocol-symbol var)
+            (cljs.analyzer/warning env
+              (core/str "WARNING: Symbol " p " is not a protocol")))
+          (when (and (:protocol-deprecated cljs.analyzer/*cljs-warnings*)
+                  (-> var :deprecated)
+                  (not (-> p meta :deprecation-nowarn)))
+            (cljs.analyzer/warning env
+              (core/str "WARNING: Protocol " p " is deprecated"))))
+        (cljs.analyzer/warning env
+          (core/str "WARNING: Can't resolve protocol symbol " p))))))
+
 (defmacro extend-type [tsym & impls]
   (let [resolve #(let [ret (:name (cljs.analyzer/resolve-var (dissoc &env :locals) %))]
                    (assert ret (core/str "Can't resolve: " %))
@@ -559,25 +575,11 @@
                      (recur (assoc ret (first s) (take-while seq? (next s)))
                             (drop-while seq? (next s)))
                      ret))
-        warn-if-not-protocol #(when-not (= 'Object %)
-                                (if (:undeclared cljs.analyzer/*cljs-warnings*)
-                                  (if-let [var (cljs.analyzer/resolve-existing-var (dissoc &env :locals) %)]
-                                    (do
-                                     (when-not (:protocol-symbol var)
-                                       (cljs.analyzer/warning &env
-                                         (core/str "WARNING: Symbol " % " is not a protocol")))
-                                     (when (and (:protocol-deprecated cljs.analyzer/*cljs-warnings*)
-                                                (-> var :deprecated)
-                                                (not (-> % meta :deprecation-nowarn)))
-                                       (cljs.analyzer/warning &env
-                                         (core/str "WARNING: Protocol " % " is deprecated"))))
-                                    (cljs.analyzer/warning &env
-                                      (core/str "WARNING: Can't resolve protocol symbol " %)))))
         skip-flag (set (-> tsym meta :skip-protocol-flag))]
     (if (base-type tsym)
       (let [t (base-type tsym)
             assign-impls (fn [[p sigs]]
-                           (warn-if-not-protocol p)
+                           (warn-and-update-protocol p &env)
                            (let [psym (resolve p)
                                  pfn-prefix (subs (core/str psym) 0 (clojure.core/inc (.indexOf (core/str psym) "/")))]
                              (cons `(aset ~psym ~t true)
@@ -589,7 +591,7 @@
             prototype-prefix (fn [sym]
                                `(.. ~tsym -prototype ~(to-property sym)))
             assign-impls (fn [[p sigs]]
-                           (warn-if-not-protocol p)
+                           (warn-and-update-protocol p &env)
                            (let [psym (resolve p)
                                  pprefix (protocol-prefix psym)]
                              (if (= p 'Object)


A bit better error handling if you make a mistake with an explainer

--- src/structural_typing/assist/oopsie.clj
+++ src/structural_typing/assist/oopsie.clj
@@ -41,7 +41,9 @@
   "Convert an [[oopsie]] into a string explaining the error,
    using the `:explainer` within it."
   [oopsie]
-  ((:explainer oopsie) oopsie))
+  (if-let [explainer (:explainer oopsie)]
+    (explainer oopsie)
+    (boom! "Oopsie `%s` has no explainer function" oopsie)))

 (defn explanations
   "Convert a collection of [[oopsies]] into a lazy sequence of explanatory strings.


WIP: Fixed fn emit to refer to property access

--- src/clj/cljs/core.clj
+++ src/clj/cljs/core.clj
@@ -357,9 +357,8 @@
         prefix (protocol-prefix p)
         methods (if (string? (first doc+methods)) (next doc+methods) doc+methods)
         expand-sig (fn [fname slot sig]
-                     (println [:===> fname slot sig])
                      `(~sig
-                       (if (and ~(first sig) (. ~(first sig) ~slot))
+                       (if (and ~(first sig) (. ~(first sig) ~(symbol (str "-" slot)))) ;; HERE
                          (. ~(first sig) ~slot ~@sig)
                          ((or
                            (aget ~(fqn fname) (goog.typeOf ~(first sig)))


Fix bug in REPL require special fn. Need to preserve the old specs of the current namespace.

--- src/clj/cljs/repl.clj
+++ src/clj/cljs/repl.clj
@@ -13,6 +13,7 @@
   (:require [clojure.java.io :as io]
             [cljs.compiler :as comp]
             [cljs.analyzer :as ana]
+            [cljs.analyzer.api :as ana-api]
             [cljs.env :as env]
             [cljs.tagged-literals :as tags]
             [cljs.closure :as cljsc]
@@ -183,7 +184,10 @@
       form
       (wrap-fn form))))

-(defn update-require-spec [specs & additions]
+(defn update-require-spec
+  "Given the specification portion of a ns form and require spec additions
+  return an updated specification."
+  [specs & additions]
   (let [[before [requires & other-specs]]
         (split-with
           (fn [[x _]] (not= :require x))
@@ -217,12 +221,14 @@
        ([repl-env env form]
          (self repl-env env form nil))
        ([repl-env env [_ [quote spec]] opts]
-         (evaluate-form repl-env env "<cljs repl>"
-           (with-meta
-             `(~'ns ~ana/*cljs-ns*
-                (:require ~spec))
-             {:line 1 :column 1})
-           identity opts)))
+         (let [original-specs (ana-api/ns-specs ana/*cljs-ns*)
+               new-specs      (update-require-spec original-specs spec)]
+           (evaluate-form repl-env env "<cljs repl>"
+             (with-meta
+               `(~'ns ~ana/*cljs-ns*
+                  ~@new-specs)
+               {:line 1 :column 1})
+             identity opts))))
      'load-file load-file-fn
      'clojure.core/load-file load-file-fn
      'load-namespace


copy over some stuff from clojure.main

copy over some stuff from clojure.main

--- src/clj/cljs/repl.clj
+++ src/clj/cljs/repl.clj
@@ -7,9 +7,8 @@
 ;; You must not remove this notice, or any other, from this software.

 (ns cljs.repl
+  (:import (java.io PushbackReader))
   (:refer-clojure :exclude [load-file])
-  (:import java.io.File
-           javax.xml.bind.DatatypeConverter)
   (:require [clojure.java.io :as io]
             [cljs.compiler :as comp]
             [cljs.analyzer :as ana]
@@ -20,9 +19,74 @@
             [cljs.source-map :as sm]
             [clojure.tools.reader :as reader]
             [clojure.tools.reader.reader-types :as readers]
-            [cljs.util :as util]))
+            [cljs.util :as util])
+  (:import [java.io File PushbackReader]
+           [javax.xml.bind DatatypeConverter]))

 (def ^:dynamic *cljs-verbose* false)
+
+;; =============================================================================
+;; Copied over from clojure.main
+
+(defn skip-if-eol
+  "If the next character on stream s is a newline, skips it, otherwise
+  leaves the stream untouched. Returns :line-start, :stream-end, or :body
+  to indicate the relative location of the next character on s. The stream
+  must either be an instance of LineNumberingPushbackReader or duplicate
+  its behavior of both supporting .unread and collapsing all of CR, LF, and
+  CRLF to a single \\newline."
+  [s]
+  (let [c (.read s)]
+    (cond
+      (= c (int \newline)) :line-start
+      (= c -1) :stream-end
+      :else (do (.unread s c) :body))))
+
+(defn skip-whitespace
+  "Skips whitespace characters on stream s. Returns :line-start, :stream-end,
+  or :body to indicate the relative location of the next character on s.
+  Interprets comma as whitespace and semicolon as comment to end of line.
+  Does not interpret #! as comment to end of line because only one
+  character of lookahead is available. The stream must either be an
+  instance of LineNumberingPushbackReader or duplicate its behavior of both
+  supporting .unread and collapsing all of CR, LF, and CRLF to a single
+  \\newline."
+  [s]
+  (loop [c (.read s)]
+    (cond
+      (= c (int \newline)) :line-start
+      (= c -1) :stream-end
+      (= c (int \;)) (do (.readLine s) :line-start)
+      (or (Character/isWhitespace (char c)) (= c (int \,))) (recur (.read s))
+      :else (do (.unread s c) :body))))
+
+(defn repl-read
+  "Default :read hook for repl. Reads from *in* which must either be an
+  instance of LineNumberingPushbackReader or duplicate its behavior of both
+  supporting .unread and collapsing all of CR, LF, and CRLF into a single
+  \\newline. repl-read:
+    - skips whitespace, then
+      - returns request-prompt on start of line, or
+      - returns request-exit on end of stream, or
+      - reads an object from the input stream, then
+        - skips the next input character if it's end of line, then
+        - returns the object."
+  [request-prompt request-exit]
+  (or ({:line-start request-prompt :stream-end request-exit}
+        (skip-whitespace *in*))
+    (let [input (read)]
+      (skip-if-eol *in*)
+      input)))
+
+(defmacro with-read-known
+  "Evaluates body with *read-eval* set to a \"known\" value,
+   i.e. substituting true for :unknown if necessary."
+  [& body]
+  `(binding [*read-eval* (if (= :unknown *read-eval*) true *read-eval*)]
+     ~@body))
+
+;; =============================================================================
+;; CLJS Specifics

 (defprotocol IJavaScriptEnv
   (-setup [this opts] "initialize the environment")
@@ -278,6 +342,8 @@
       (let [env {:context :expr :locals {}}
             special-fns (merge default-special-fns special-fns)
             is-special-fn? (set (keys special-fns))
+            request-prompt (Object.)
+            request-exit (Object.)
             read-error (Object.)]
         (-setup repl-env opts)
         (evaluate-form repl-env env "<cljs repl>"


Add event :agenda-counter-spent.

Add event :agenda-counter-spent.

--- src/clj/game/core.clj
+++ src/clj/game/core.clj
@@ -292,7 +292,8 @@
                       (update-in [:advance-counter] #(- (or % 0) (or advance-counter-cost 0)))
                       (update-in [:counter] #(- (or % 0) (or counter-cost 0))))]
             (when (or counter-cost advance-counter-cost)
-              (update! state side c))
+              (update! state side c)
+              (when (= (:type card) "Agenda") (trigger-event state side :agenda-counter-spent card)))
             (when msg
               (let [desc (if (string? msg) msg (msg state side card targets))]
                 (system-msg state (to-keyword (:side card))


stop triggering :leave-play on cards turned facedown by Apocalypse

--- src/clj/game/core.clj
+++ src/clj/game/core.clj
@@ -117,11 +117,12 @@
 (defn desactivate
   ([state side card] (desactivate state side card nil))
   ([state side card keep-counter]
-   (let [c (dissoc card :current-strength :abilities :rezzed :special :facedown)
-         c (if (= (:side c) "Runner") (dissoc c :installed :counter :rec-counter :pump) c)
+   (let [c (dissoc card :current-strength :abilities :rezzed :special :named-target)
+         c (if (and (= (:side c) "Runner") (not= (last (:zone c)) :facedown))
+             (dissoc c :installed :facedown :counter :rec-counter :pump) c)
          c (if keep-counter c (dissoc c :counter :rec-counter :advance-counter))]
      (when-let [leave-effect (:leave-play (card-def card))]
-       (when (or (and (= (:side card) "Runner") (:installed card))
+       (when (or (and (= (:side card) "Runner") (:installed card) (not (:facedown card)))
                  (:rezzed card)
                  (= (first (:zone card)) :current)
                  (not (empty? (filter #(= (:cid card) (:cid %)) (get-in @state [:corp :scored])))))
@@ -243,13 +244,14 @@
        (let [dest (if (sequential? to) (vec to) [to])
              c (if (and (= side :corp) (= (first dest) :discard) (:rezzed card))
                  (assoc card :seen true) card)
-             c (if (or (and (= dest [:rig :facedown]) installed)
-                       (and (or installed host (#{:servers :scored :current} (first zone)))
-                            (#{:hand :deck :discard} (first dest))
-                            (not (:facedown c))))
+             c (if (and (or installed host (#{:servers :scored :current} (first zone)))
+                        (#{:hand :deck :discard} (first dest))
+                        (not (:facedown c)))
                  (desactivate state side c) c)
              c (if (= dest [:rig :facedown]) (assoc c :facedown true :installed true) (dissoc c :facedown))
              moved-card (assoc c :zone dest :host nil :hosted nil :previous-zone (:zone c))
+             moved-card (if (and (:facedown moved-card) (:installed moved-card))
+                          (desactivate state side moved-card) moved-card)
              moved-card (if (and (= side :corp) (#{:hand :deck} (first dest)))
                           (dissoc moved-card :seen) moved-card)]
          (if front


basic auth middleware and endpoints

basic auth middleware and endpoints

--- src/cljsbin/auth.cljs
+++ src/cljsbin/auth.cljs
@@ -4,36 +4,56 @@
      [clojure.string :as string]
      [macchiato.util.response :as r]))

-;; TODO first create a single handler that implements the basic auth
-;; when we have it break into mw + handler
-
 (defn parse-basic
   "Decode Authorization header value and return a [user pass] sequence"
   [value]
   (let [encoded (second (string/split value #" "))
         decoded (base64/decodeString encoded)]
-    (println encoded decoded)
     (string/split decoded #":")))

 (defn respond-unauth
-  [res]
+  [req res]
   (-> (r/unauthorized "")
       (r/header "WWW-Authenticate" "Basic realm=\"fake realm\"")
       (res)))

-(defn basic-auth
-  "Challenges HTTPBasic Auth"
-  [req res raise]
-  (if-let [value (get-in req [:headers "authorization"])]
-    (let [[user pass] (parse-basic value)
-          expected-user (get-in req [:route-params :user])
-          expected-pass (get-in req [:route-params :pass])]
-      (if-not (and (= user expected-user) (= pass expected-pass))
-        (respond-unauth res)
-        (-> {:user user :authenticated true}
-            (r/ok)
-            (r/content-type "application/json")
-            (res))))
-    (respond-unauth res)))
+(defn wrap-basic-auth
+  "Middleware to handle Basic authentication."
+  ([handler authorize-fn] (wrap-basic-auth handler authorize-fn respond-unauth))
+  ([handler authorize-fn unauthorized]
+   (fn [req res raise]
+     (if-let [value (get-in req [:headers "authorization"])]
+       (let [[user pass] (parse-basic value)]
+         (if (or (not user) (not pass))
+           (unauthorized req res)
+           (if-let [user (authorize-fn req user pass raise)]
+             (handler (assoc req :user user) res raise)
+             (unauthorized req res))))
+       (unauthorized req res)))))

-(def routes {["/basic-auth/" :user "/" :pass] {:get basic-auth}})
+(defn auth-from-route-params
+  "Authenticate the user based on the user/pass provided in the route."
+  [req user pass raise]
+  (let [expected-user (get-in req [:route-params :user])
+        expected-pass (get-in req [:route-params :pass])]
+    (if (and (= user expected-user) (= pass expected-pass))
+      user)))
+
+;; FIXME this should use a json handler and probably be in the endpoints file
+(defn user-data-handler
+  [req res next]
+  (-> {:user (:user req) :authenticated true}
+      (r/ok)
+      (r/content-type "application/json")
+      (res)))
+
+(def basic-auth "Challenges HTTPBasic Auth."
+  (wrap-basic-auth user-data-handler auth-from-route-params))
+
+(def hidden-basic-auth "404'd BasicAuth."
+  (wrap-basic-auth user-data-handler
+                   auth-from-route-params
+                   (fn [req res] (res (r/not-found "")))))
+
+(def routes {["/basic-auth/" :user "/" :pass] {:get basic-auth}
+             ["/hidden-basic-auth/" :user "/" :pass] {:get hidden-basic-auth}})


Move fake gensym out into a macro

Move fake gensym out into a macro


Fix for reading sample names, due to parallel cgdata change.

--- src/cavm/cgdata.clj
+++ src/cavm/cgdata.clj
@@ -215,7 +215,7 @@
 (defmethod matrix-data :default
   [metadata features lines]
   (with-meta (chunked-pmap #(data-line features (tabbed %)) (rest lines))
-             {:samples (rest (first lines))}))
+             {:samples (rest (tabbed (first lines)))}))

 (defn- transpose [lines]
   (apply mapv vector lines))


[FIX #3748] align toolbar titles to the left for network & offline-mess

Signed-off-by: Julien Eluard <c768e13f1ba4c3ebed2909a1fc1e4b50bb021a2f@gmail.com>

--- src/status_im/ui/components/toolbar/styles.cljs
+++ src/status_im/ui/components/toolbar/styles.cljs
@@ -36,7 +36,9 @@
   {:color          colors/black
    :letter-spacing -0.2
    :font-size      17
-   :text-align     :center})
+   :ios            {:text-align     :center}
+   :android        {:text-align     :left
+                    :margin-left    22}})

 (def toolbar-actions
   {:flex           0


stateofus ens name in wallet

stateofus ens name in wallet

--- src/status_im/wallet/choose_recipient/core.cljs
+++ src/status_im/wallet/choose_recipient/core.cljs
@@ -9,7 +9,9 @@
             [status-im.i18n :as i18n]
             [status-im.utils.money :as money]
             [status-im.utils.fx :as fx]
-            [status-im.ui.screens.navigation :as navigation]))
+            [status-im.ui.screens.navigation :as navigation]
+            [clojure.string :as string]
+            [status-im.ethereum.stateofus :as stateofus]))

 (fx/defn toggle-flashlight
   {:events [:wallet/toggle-flashlight]}
@@ -94,19 +96,23 @@
   {:events [:wallet.send/set-recipient ::recipient-address-resolved]}
   [{:keys [db]} recipient]
   (let [chain (ethereum/chain-keyword db)]
-    (if (ens/is-valid-eth-name? recipient)
+    (cond
+      (ethereum/address? recipient)
+      (let [checksum (eip55/address->checksum recipient)]
+        (if (eip55/valid-address-checksum? checksum)
+          {:db       (-> db
+                         (assoc-in [:wallet/prepare-transaction :to] checksum)
+                         (assoc-in [:wallet/prepare-transaction :modal-opened?] false))
+           :dispatch [:navigate-back]}
+          {:ui/show-error (i18n/label :t/wallet-invalid-address-checksum {:data recipient})}))
+      (not (string/blank? recipient))
       {::resolve-address {:registry (get ens/ens-registries chain)
-                          :ens-name recipient
+                          :ens-name (if (= (.indexOf recipient ".") -1)
+                                      (stateofus/subdomain recipient)
+                                      recipient)
                           :cb       #(re-frame/dispatch [::recipient-address-resolved %])}}
-      (if (ethereum/address? recipient)
-        (let [checksum (eip55/address->checksum recipient)]
-          (if (eip55/valid-address-checksum? checksum)
-            {:db       (-> db
-                           (assoc-in [:wallet/prepare-transaction :to] checksum)
-                           (assoc-in [:wallet/prepare-transaction :modal-opened?] false))
-             :dispatch [:navigate-back]}
-            {:ui/show-error (i18n/label :t/wallet-invalid-address-checksum {:data recipient})}))
-        {:ui/show-error (i18n/label :t/wallet-invalid-address {:data recipient})}))))
+      :else
+      {:ui/show-error (i18n/label :t/wallet-invalid-address {:data recipient})})))

 (fx/defn request-uri-parsed
   {:events [:wallet/request-uri-parsed]}


fix saving text when you click on canvas

--- src-cljs/frontend/controllers/controls.cljs
+++ src-cljs/frontend/controllers/controls.cljs
@@ -852,7 +852,7 @@
     (let [intents (mouse-depressed-intents previous-state button ctrl? shift?)]
       (doseq [intent intents]
         (case intent
-          :finish-text-layer (handle-text-layer-finished-after current-state)
+          :finish-text-layer (handle-text-layer-finished-after previous-state current-state)
           :open-radial (handle-radial-opened-after current-state previous-state)
           :start-drawing nil
           :submit-layer-properties (handle-layer-properties-submitted-after current-state)


Remove unused method

Remove unused method

--- src/cljs/org/broadinstitute/firecloud_ui/common/table.cljs
+++ src/cljs/org/broadinstitute/firecloud_ui/common/table.cljs
@@ -221,10 +221,6 @@
          :onChange #(swap! state assoc :initial false :synced false)})
       [:span {:style {:paddingLeft "1em"}}]
       [comps/Button {:icon :search :onClick #(react/call :apply-filter this)}]])
-   :make-desynced
-   (fn [{:keys [state]}]
-     (when-not (:initial @state)
-       (swap! state assoc :synced false)))
    :apply-filter
    (fn [{:keys [this state props]}]
      (swap! state assoc :synced true)


Coerce values to strings in simple-value->ltree

A few values from the db can be integers, which `str/blank?` won't
handle, and the value field is TEXT anyway.

--- src/vip/data_processor/db/translations/util.clj
+++ src/vip/data_processor/db/translations/util.clj
@@ -38,7 +38,7 @@
    (simple-value->ltree column-name (column->xml-elment column-name)))
   ([column-name xml-element]
    (fn [idx-fn base-path row]
-     (let [value (get row column-name)]
+     (let [value (str (get row column-name))]
        (when-not (str/blank? value)
          (let [path (str base-path "." xml-element "." (idx-fn))]
            (list


oops, handle the obvious nil case

oops, handle the obvious nil case

--- support/src/figwheel/client/file_reloading.cljs
+++ support/src/figwheel/client/file_reloading.cljs
@@ -334,7 +334,8 @@
     (:figwheel-no-load meta-pragmas)))

 (defn ns-exists? [namespace]
-  (some? (reduce gobj/get goog.global (string/split (name namespace) "."))))
+  (some? (reduce (fnil gobj/get #js{})
+                 goog.global (string/split (name namespace) "."))))

 (defn reload-file? [{:keys [namespace] :as file-msg}]
   (dev-assert (namespace-file-map? file-msg))


Fixed ring server start

Fixed ring server start

--- src/freecoin/core.clj
+++ src/freecoin/core.clj
@@ -194,9 +194,10 @@
 (defn lein-ring-init []
   (prn "lein-ring-init")
   (swap! app-state connect-db)
+  (assert (:db @app-state) "The DB is not set")
   (swap! lein-ring-handler
                   (fn [_] (let [config-m (config/create-config)
-                                db (:db app-state)
+                                db (:db @app-state)
                                 stores-m (storage/create-mongo-stores db)
                                 blockchain (blockchain/new-stub db)]
                             (prn "Restarting server....")


naming

naming

--- Clojure-Websockets/MainApp/src/cljs/birdwatch/stats/wordcount.cljs
+++ Clojure-Websockets/MainApp/src/cljs/birdwatch/stats/wordcount.cljs
@@ -20,13 +20,15 @@

 (defn get-words
   "get vector of maps with word as :key and count as :value"
-  [app n]
-  (vec (map (fn [w] (let [[k v] w] {:key k :value v})) (take n (:words-sorted-by-count app)))))
+  [state n]
+  (vec (map
+        (fn [w] (let [[k v] w] {:key k :value v}))
+        (take n (:words-sorted-by-count state)))))

 (defn get-words2
   "get vector of maps with word as :key and count as :value"
-  [app n]
-  (vec (take n (:words-sorted-by-count app))))
+  [state n]
+  (vec (take n (:words-sorted-by-count state))))

 (defn words-in-tweet
   "process tweet: split, filter, lower case, replace punctuation, add word"


Whitespace fix

Whitespace fix

--- src/icecap/schema.clj
+++ src/icecap/schema.clj
@@ -2,7 +2,6 @@
   "The schemata for icecap plans."
   (:require [schema.core :as s]
             [icecap.execute :refer [supported-scheme?]]))
-

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


Disable metrics server side

Disable metrics server side

--- src/clj/onyx_dashboard/http/server.clj
+++ src/clj/onyx_dashboard/http/server.clj
@@ -62,12 +62,6 @@
   (doseq [uid (:any @connected-uids)]
     (send-fn! uid msg)))

-(defn metrics-handler [send-f request]
-  (http-kit-server/with-channel request channel
-    (http-kit-server/on-receive
-     channel
-     (fn [data] (send-f [:metrics/event (read-string data)])))))
-
 (defrecord HttpServer [peer-config]
   component/Lifecycle
   (start [{:keys [sente] :as component}]
@@ -78,7 +72,6 @@
       (defroutes routes
         (GET  "/" [] (page))
         (GET  "/chsk" req ((:ring-ajax-get-or-ws-handshake sente) req))
-        (GET  "/metrics" req (partial metrics-handler send-f))
         (POST "/chsk" req ((:ring-ajax-post sente) req))
         (resources "/")
         (resources "/react" {:root "react"})


Only search build indices here

Only search build indices here

--- src/clj/runbld/notifications/slack.clj
+++ src/clj/runbld/notifications/slack.clj
@@ -46,7 +46,8 @@
                  {:size 2
                   :query {:term {:build.job-name job}}
                   :sort {:process.time-end {:order "desc"}}}}
-          previous (doc/search (-> opts :es :conn) query)]
+          previous (doc/search (-> opts :es :conn)
+                               (-> opts :es :build-index-search) query)]
       (-> previous
           :hits
           :hits


Show 0 fails

Show 0 fails

--- src/cljs/avalon/play/quest_detail.cljs
+++ src/cljs/avalon/play/quest_detail.cljs
@@ -12,10 +12,8 @@
     (-> palette (aget color))))

 (def card-styles
-  #js {:root #js {:background (fn [js-props]
-                                (-> js-props (props->color) (aget "main")))
-                  :color      (fn [js-props]
-                                (-> js-props (props->color) (aget "contrastText")))}})
+  #js {:root #js {:background #(-> % (props->color) (aget "main"))
+                  :color      #(-> % (props->color) (aget "contrastText"))}})

 (def with-card-styles (ui/withStyles card-styles))

@@ -25,10 +23,10 @@
    [:> ui/CardContent
     (if (= color "primary")
       [:<>
-       [:> ui/Typography {:variant "h5"} (.-success result)]
+       [:> ui/Typography {:variant "h5"} (or (.-success result) 0)]
        [:> icons/CheckCircleOutlineOutlined {:font-size "large"}]]
       [:<>
-       [:> ui/Typography {:variant "h5"} (.-failure result)]
+       [:> ui/Typography {:variant "h5"} (or (.-failure result) 0)]
        [:> icons/HighlightOffOutlined {:font-size "large"}]])]])

 (def color-card


Make getenv a bit more concise.

Make getenv a bit more concise.

--- src/incise/server.clj
+++ src/incise/server.clj
@@ -28,8 +28,8 @@
 (defn getenv
   "A nice wrapper around System/getenv that allows a second argument to be
   passed in as the default."
-  ([variable default] (or (System/getenv variable) default))
-  ([variable] (getenv variable nil)))
+  [variable & [default]]
+  (or (System/getenv variable) default))

 (defn serve
   "Start the development server"


add missing re-pattern call around file separator

--- src/io/perun/core.clj
+++ src/io/perun/core.clj
@@ -56,13 +56,12 @@
   [url]
   (apply create-filepath (string/split url #"/")))

-(def file-separator (java.util.regex.Pattern/quote java.io.File/separator))
+(def file-separator-re (re-pattern (java.util.regex.Pattern/quote java.io.File/separator)))

 (defn path-to-url
   "Converts a path to url"
   [path]
-  (->> file-separator
-       re-pattern
+  (->> file-separator-re
        (string/split path)
        (string/join "/")))

@@ -73,7 +72,7 @@
     filepath))

 (defn filename [name]
-  (second (re-find #"(.+?)(\.[^.]*$|$)" (last (string/split name file-separator)))))
+  (second (re-find #"(.+?)(\.[^.]*$|$)" (last (string/split name file-separator-re)))))

 (defn ^String extension [name]
   (last (seq (string/split name #"\."))))


minor - new lisp city :)

minor - new lisp city :)

--- cljs-cheatsheet/cljs_cheatsheet/tooltips.cljs
+++ cljs-cheatsheet/cljs_cheatsheet/tooltips.cljs
@@ -67,9 +67,7 @@

         ;; this little hack prevents bugs with the tooltip width calculation
         ;; when it is near the edge of the page
-        _ (.css $tooltip-el (js-obj "display" "none"
-                                    "left" 0
-                                    "top" 0))
+        _ (.css $tooltip-el #js {:display "none", :left 0, :top 0})

         tooltip-height (.outerHeight $tooltip-el)
         tooltip-width (.outerWidth $tooltip-el)


A fix, still broken

A fix, still broken

--- src/angelic/search/incremental/implicit.clj
+++ src/angelic/search/incremental/implicit.clj
@@ -71,6 +71,10 @@
 (defn make-blocked-summary [max-reward] (SimpleSummary. max-reward :blocked nil))
 (defn make-solved-summary [max-reward opt-sol] (SimpleSummary. max-reward :solved opt-sol))

+(defn blocked? [summary]
+  (and (not (live? summary))
+       (not (optimal-solution summary))))
+

 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; Common Ops ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

@@ -272,11 +276,20 @@

 (defn osp-plan-summary [osp] (osn-plan-summary @(:node-atom osp)))

+;; Used when deciding when to split.
+(defn osp-descendent-summary [osp excluded-child-set]
+  (min-summary (:alt-summary osp)
+               (osn-summary @(:node-atom osp) excluded-child-set)))
+
+(defn osp-ancestor-summary [osp]
+  (apply max-summary (map osn-plan-summary (osp-ancestors osp))))
+
+
 (defn active-osp-summary [osp excluded-child-set]
   (min-summary (:alt-summary osp)
-              (apply max-summary
-                     (osn-summary @(:node-atom osp) excluded-child-set)
-                     (map osn-plan-summary (osp-ancestors osp)))))
+              (max-summary (osp-descendent-summary osp excluded-child-set)
+                           (osp-ancestor-summary osp))))
+

 (defn refine-osp!
   "Repeatedly refine an ancestor or descendent of this node."
@@ -295,12 +308,17 @@
     plans-by-output-set))

 (defn split-osp
-  "Return new-child-osps.  Currently splits children < min-reward when parent >= min-reward."
+  "Return new-child-osps.  Currently splits children >= min-reward when parent < min-reward."
   [osp min-reward excluded-child-set]
-  (when (> (max-reward (osp-plan-summary osp)) min-reward)
-    (filter #(<= (max-reward (full-osp-summary %)))
-            (remove excluded-child-set
-                    (osn-child-pointers @(:node-atom osp))))))
+  (when (< (max-reward (max-summary (osp-plan-summary osp) (osp-ancestor-summary osp))) min-reward)
+    (filter #(>= (max-reward (full-osp-summary %)) min-reward)
+            (remove excluded-child-set (osn-child-pointers @(:node-atom osp))))))
+
+(defn can-split-osp? [osp excluded-child-set]
+  (> (apply max is/neg-inf (map (comp max-reward #(osp-descendent-summary % #{}))
+                                (remove excluded-child-set (osn-child-pointers @(:node-atom osp)))))
+     (max-reward (max-summary (osp-plan-summary osp) (osp-ancestor-summary osp)))))
+

@@ -348,6 +366,7 @@
 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; Plans ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

+; TODO: available splits must contribute to live status.

 (defrecord PlanNode [sub-output-set-pointer excluded-child-set output-constraint
                      summary-bound output-set output-summary])
@@ -356,22 +375,29 @@
   (state-set/constrain (state/transfer-effects input-set (osp-output-set sub-output-set-pointer))
                        output-constraint))

-(defn compute-plan-node-output-summary [input-summary sub-output-set-pointer summary-bound]
+
+(defn make-live-for-split [sub-osp ecs summary]
+  (if (and (blocked? summary) (can-split-osp? sub-osp ecs))
+    (make-live-summary (max-reward summary))
+    summary))
+
+
+(defn compute-plan-node-output-summary [input-summary sub-output-set-pointer ecs summary-bound]
   (->> (full-osp-summary sub-output-set-pointer)
-       (min-summary summary-bound )
+       (min-summary summary-bound)
+       (make-live-for-split sub-output-set-pointer ecs)
        (add-summaries input-summary)))

 (defn make-plan-node [input-set input-summary sub-output-set-pointer
                       excluded-child-set output-constraint summary-bound]
   (PlanNode. sub-output-set-pointer excluded-child-set output-constraint summary-bound
              (compute-plan-node-output-set input-set sub-output-set-pointer output-constraint)
-             (compute-plan-node-output-summary input-summary sub-output-set-pointer summary-bound)))
+             (compute-plan-node-output-summary input-summary sub-output-set-pointer excluded-child-set summary-bound)))

 (defn make-initial-plan-node [action [input-set input-summary]]
   (let [sub (get-subproblem-root-pointer input-set action (constantly is/pos-inf))]
     (make-plan-node input-set input-summary sub #{} {} +best-summary+)))

-
 (defn plan-node-output-set-and-summary [pn]
   [(:output-set pn) (:output-summary pn)])

@@ -383,7 +409,7 @@
 (defn refine-pn [pn input-summary min-reward]
   (let [{:keys [sub-output-set-pointer excluded-child-set summary-bound]} pn]
     (refine-osp! sub-output-set-pointer min-reward excluded-child-set)
-    (assoc pn :output-summary (compute-plan-node-output-summary input-summary sub-output-set-pointer summary-bound))))
+    (assoc pn :output-summary (compute-plan-node-output-summary input-summary sub-output-set-pointer excluded-child-set summary-bound))))

 (defn split-pn-output [pn input-set input-summary min-step-reward]
@@ -396,8 +422,8 @@
        (for [child split-children] (make-plan-node input-set input-summary child nil {} +best-summary+))))))

 (defn patch-pn-summary-tuple- [pn new-input-summary]
-  (let [{:keys [sub-output-set-pointer summary-bound output-set]} pn
-        new-output-summary (compute-plan-node-output-summary new-input-summary sub-output-set-pointer summary-bound)]
+  (let [{:keys [sub-output-set-pointer excluded-child-set summary-bound output-set]} pn
+        new-output-summary (compute-plan-node-output-summary new-input-summary sub-output-set-pointer excluded-child-set summary-bound)]
     (when (viable-summary? new-output-summary)
       [[false output-set new-output-summary] (assoc pn :output-summary new-output-summary)])))

@@ -410,7 +436,7 @@
           (patch-pn-summary-tuple- pn new-input-summary)
           (let [new-pn (make-plan-node new-input-set new-input-summary new-osp nil
                                 (osp-output-set sub-output-set-pointer)
-                                (make-blocked-summary (max-reward (full-osp-summary sub-output-set-pointer))))
+                                (make-blocked-summary (max-reward (full-osp-summary sub-output-set-pointer)))) ;; This is just the bound, equal to the initial thing.
                 new-output-pair (plan-node-output-set-and-summary new-pn)]
             (when (viable-output-set-and-summary? new-output-pair)
               [(cons (not (= (:output-set new-pn) output-set)) new-output-pair) new-pn]))))
@@ -495,4 +521,6 @@

 ; (use 'edu.berkeley.ai.util '[angelic env hierarchy] 'angelic.domains.nav-switch 'angelic.search.incremental.implicit)
-; +; user> (require '[ angelic.search.incremental.explicit :as eis ])
+;user> (eis/explicit-cn-dash-a* (make-nav-switch-hierarchy (make-random-nav-switch-env 5 2 0) true))
+;  (implicit-random-dash-a* (make-nav-switch-hierarchy (make-random-nav-switch-env 5 2 0) true))


satellite-master: Prevent error when not all task totals arrive.

If any of the 3 counts (failed, finished, started) are missing
(e.g. haven't been sent by the slave yet), don't consider the host for
black hole status.

--- satellite-master/src/satellite/recipes.clj
+++ satellite-master/src/satellite/recipes.clj
@@ -115,7 +115,7 @@

 (defn exceeds-threshold?
   [{divisor :metric}  {dividend :metric} threshold]
-  (and (pos? divisor)
+  (and divisor dividend (pos? divisor)
        (or (zero? dividend)
            (> (/ divisor dividend) threshold))))


Be able to remove items from the trolley

--- src/cljs/ikea_clojure_cup/select_items.cljs
+++ src/cljs/ikea_clojure_cup/select_items.cljs
@@ -61,6 +61,20 @@
               :choice-fn (partial select-item! search-state trolley-state)}]
        search-state])))

+(defn trolley-item
+  [idx {:keys [desc name image-src packages id]} remove-fn add-another-fn]
+  [:li {:key idx}
+   name desc
+   [bootstrap/button {:bs-size :sm
+                      :bs-style :danger
+                      :on-click remove-fn}
+    [bootstrap/glyph {:glyph :remove}] " Remove"]])
+
+(defn- remove-item-from-trolley
+  [trolley-state item]
+  (swap! trolley-state update-in [:items]
+   (partial remove #(= % item))))
+
 (defn trolley-list-contents
   [trolley-state]
   [:div.trolley-contents
@@ -69,7 +83,7 @@
      [:ul
       (map-indexed
        (fn [idx item]
-         [:li {:key idx} (:name item) (:desc item)])
+         [trolley-item idx item (partial remove-item-from-trolley trolley-state item)])
        (:items @trolley-state))])])

 (defn select-items-view


Ditto

Ditto

--- src/clojure/clojurewerkz/cassaforte/cql.clj
+++ src/clojure/clojurewerkz/cassaforte/cql.clj
@@ -16,7 +16,7 @@
 ;;

 (defn drop-keyspace
-  "Executes `DROP KEYSPACE` statement, which results in the immediate, irreversible removal of an existing keyspace,
+  "Drops a keyspace: results in immediate, irreversible removal of an existing keyspace,
    including all column families in it, and all data contained in those column families.

    Example:
@@ -26,8 +26,9 @@
   (execute- [ks] query/drop-keyspace-query))

 (defn create-keyspace
-  "Executes `CREATE KEYSPACE` statement, which creates a new top-level keyspace. A keyspace is a namespace that
-   defines a replication strategy and some options for a set of tables.
+  "Creates a new top-level keyspace. A keyspace is a namespace that
+   defines a replication strategy and some options for a set of tables,
+   similar to a database in relational databases.

    Example:

@@ -39,31 +40,33 @@
   (execute- query-params query/create-keyspace-query))

 (defn create-index
-  "Executes `CREATE INDEX` statement, which creates a new (automatic) secondary index for a given (existing)
+  "Creates a new (automatic) secondary index for a given (existing)
    column in a given table.If data already exists for the column, it will be indexed during the execution
    of this statement. After the index is created, new data for the column is indexed automatically at
    insertion time.

-   Example, create index on `users` table, `city` column:
+   Example, creates an index on `users` table, `city` column:

      (create-index :users :city)"
   [& query-params]
   (execute- query-params query/create-index-query))

 (defn drop-index
-  "Executes `DROP INDEX` statement is used to drop an existing secondary index. The argument of the statement
+  "Drop an existing secondary index. The argument of the statement
    is the index name.

-   Example, drop index on `users` table, `city` column:
+   Example, drops an index on `users` table, `city` column:

      (drop-index :users :city)"
   [& query-params]
   (execute- query-params query/drop-index-query))

 (defn create-table
-  "Executes `CREATE TABLE` statement, which creates a new table. Each such table is a set of rows (usually
-   representing related entities) for which it defines a number of properties. A table is defined by a name,
-   it defines the columns composing rows of the table and have a number of options.
+  "Creates a new table. A table is a set of rows (usually
+   representing related entities) for which it defines a number of properties.
+
+   A table is defined by a name, it defines the columns composing rows
+   of the table and have a number of options.

    Example:

@@ -78,8 +81,8 @@
 (def create-column-family create-table)

 (defn drop-table
-  "Executes the `DROP TABLE` statement results in the immediate, irreversible removal of a table, including
-   all data contained in it.
+  "Drops a table: this results in the immediate, irreversible removal of a table, including
+   all data in it.

    Example:

@@ -99,14 +102,14 @@
   (execute- [ks] query/use-keyspace-query))

 (defn alter-table
-  "Executes `ALTER` statement, which is used to manipulate table definitions. It allows to add new
+  "Alters a table definition. Use it to add new
    columns, drop existing ones, change the type of existing columns, or update the table options."
   [& query-params]
   (execute- query-params query/alter-table-query))

 (defn alter-keyspace
-  "Executes `ALTER KEYSPACE` statement, which  alters the properties of an existing keyspace. The
-   supported properties are the same that for the CREATE KEYSPACe statement."
+  "Alters properties of an existing keyspace. The
+   supported properties are the same that for `create-keyspace`"
   [& query-params]
   (execute- query-params query/alter-keyspace-query))

@@ -115,15 +118,16 @@
 ;;

 (defn insert
-  "Executes the `INSERT` statement, which writes one or more columns for a given row in a table.
-   Note that since a row is identified by its PRIMARY KEY, the columns that compose it must be
+  "Inserts a row in a table.
+
+   Note that since a row is identified by its primary key, the columns that compose it must be
    specified. Also, since a row only exists when it contains one value for a column not part of
-   the PRIMARY KEY, one such value must be specified too."
+   the primary key, one such value must be specified too."
   [& query-params]
   (execute- query-params query/insert-query))

 (defn insert-batch
-  "Executes batch of `INSERT` queries."
+  "Performs a batch insert (inserts multiple records into a table at the same time)"
   [table records]
   (->> (map #(query/insert-query table %) records)
        (apply query/queries)
@@ -132,14 +136,14 @@
        client/execute))

 (defn update
-  "Executes `UPDATE` statement writes one or more columns for a given row in a table. Where clause
+  "Updates one or more columns for a given row in a table. The `where` clause
    is used to select the row to update and must include all columns composing the PRIMARY KEY.
    Other columns values are specified through assignment within the `set` clause."
   [& query-params]
   (execute- query-params query/update-query))

 (defn delete
-  "Executes `DELETE` statement that deletes columns and rows. If `columns` clause is provided,
+  "Deletes columns and rows. If the `columns` clause is provided,
    only those columns are deleted from the row indicated by the `where` clause, please refer to
    KV guide (http://clojurecassandra.info/articles/kv.html) for more details. Otherwise whole rows
    are removed. The `where` allows to specify the key for the row(s) to delete."
@@ -147,14 +151,14 @@
   (execute- query-params query/delete-query))

 (defn select
-  "Executes `SELECT` statements, which reads one or more columns for one or more rows in a table.
-   It returns a resultset of rows, where each row contains the collection of columns corresponding
-   to the query."
+  "Retrieves one or more columns for one or more rows in a table.
+   It returns a result set, where every row is a collection of columns returned by the query."
   [& query-params]
   (execute- query-params query/select-query))

 (defn truncate
-  "Executes `TRUNCATE` statement, which permanently and irreversably removes all data from a table."
+  "Truncates a table: permanently and irreversably removes all rows from the table,
+   not removing the table itself."
   [table]
   (execute- [table] query/truncate-query))


4clojure:: find and interpose perfect-squared-numbers from a num-string-sequence

--- src/clojure_learning/4clojure-exercises.clj
+++ src/clojure_learning/4clojure-exercises.clj
@@ -2277,3 +2277,90 @@

 ;; work:
 (filter prime? (nnext (range))) ;; (2 3 5 ... lazyseq to infinite)
+
+;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; Filter Perfect Squares
+;; Difficulty:	Medium
+;; Topics:
+;; Given a string of comma separated integers, write a function which returns a new comma
+;; separated string that ONLY CONTAINS the numbers which are perfect squares.
+;; (= (__ "4,5,6,7,8,9") "4,9")
+;; how i think? create a lazy-pow-seq of each num started from 2. then extract the string-seq
+;; into workable real numbers seq. then found a way to check lazily(as we started with a lazy-solution)
+;; to iterate and check each realified-number in the lazy-pow-seq
+
+;; Step1:
+(defn lazy-pows-start-with [x]
+  (letfn [(pow [x] (reduce * [x x]))]
+  (lazy-seq
+     (cons (pow x) (lazy-pows-start-with (inc x))))))
+
+;; demo:
+(reduce * [8 8]) ;; 64
+
+(class (lazy-pows-start-with 2))  ;; clojure.lang.LazySeq
+(lazy-pows-start-with 2)          ;; (4 9 16 25 36 ...)
+
+;; Step2: impl function to tranform the comma-sep string-seq into a seq of numbers
+(defn to-num-seq [str-seq reg]
+  (map read-string (clojure.string/split str-seq reg)))
+
+;; demo:
+(to-num-seq "4,5,6,7,8,9" #",") ;; (4,5,6,7,8,9)
+
+;; Step3: using a lazy-sequence + recursivity version, over filter which blocks when comparing using predicate
+;; and the produced lazy-pows-seq
+(defn contained-nums
+  [lazy-xs nums acc]
+  (if (empty? nums)
+    acc
+    (if (> (first lazy-xs) (apply max nums))
+      (recur (rest lazy-xs) (rest nums) acc)
+      (if-let [contained-x ((set nums) (first lazy-xs))]
+        (recur (rest lazy-xs) (rest nums) (conj acc contained-x))
+        (recur (rest lazy-xs) nums acc)))))
+
+;; demo:
+(if-let [lazy-pows-seq (lazy-seq [4 9 16 25 36 42 100])]
+  (contained-nums lazy-pows-seq [4 5 6 7 8 9 16] [])) ;; [4 9 16]
+
+(if-let [lazy-pows-seq (lazy-seq [4 9 16 25 36 49 64 81])]
+  (contained-nums lazy-pows-seq [15,16,25,36,37] [])) ;; [16 25 36]
+
+
+;; Real implementation composed of the 3 implemented funcs:
+(defn filter-perf-squares [seq-str]
+  (letfn [(pow-x-start-with
+             [start]
+             (letfn [(pow [x] (reduce * [x x]))]
+               (lazy-seq
+                 (cons (pow start) (pow-x-start-with (inc start))))))
+          (split-by-comma
+            [str-seq]
+             (map read-string (clojure.string/split str-seq #",")))
+          (find-squares
+            [lazy-pows-seq xs acc]
+            (if (empty? xs)
+              (apply str (interpose "," acc))
+              (if (> (first lazy-pows-seq) (apply max xs))
+                (recur (rest lazy-pows-seq) (rest xs) acc)
+                (if-let [contained-x ((set xs) (first lazy-pows-seq))]
+                  (recur (rest lazy-pows-seq) (rest xs) (conj acc contained-x))
+                  (recur (rest lazy-pows-seq) xs acc)))))]
+
+    (find-squares (pow-x-start-with 2) (split-by-comma seq-str) [])))
+
+;; demo:
+(filter-perf-squares "4,5,6,7,8,9")  ;; "4,9"
+(filter-perf-squares "15,16,25,36,37")  ;; "16,25,36"
+
+;; some clojure-doc
+(doc interpose)             ;; interpose sep coll -> lazy-seq items separated by sep
+(interpose "," [1 2 3])             ;; (1 "," 2 "," 3)
+(apply str (interpose "," [1 2 3])) ;; "1,2,3"
+
+;;;;;;; another user interesting solution ;;;;;;;
+(fn [s]
+  (let [xs (map #(Integer. %) (clojure.string/split s #","))
+        p? (fn [x] (some #(= x (* % %)) (range 2 x)))]
+    (clojure.string/join "," (filter p? xs))))


Use build-name

Use build-name

--- src/circle/backend/build/run.clj
+++ src/circle/backend/build/run.clj
@@ -39,7 +39,7 @@
 (defn run-build [build & {:keys [cleanup-on-failure]
                           :or {cleanup-on-failure true}}]
   (def last-build build)
-  (infof "starting build: %s #%s" (-> build :project-name) (-> build :build-num))
+  (infof "starting build: %s" (build/build-name build))
   (when (= :deploy (:type build))
     (throw-if-not (:vcs-revision build) "version-control revision is required for deploys"))
   (try


guarding map chart updates from initial @stats value


Handle trasact! correctly

Handle trasact! correctly


Fix duplicate orgs in the piggyback orgs list

If clojure.set/union is passed a general seq and a set it doesn't
actually perform a set union, instead it returns a list of all the
entries in its argument collections.

--- frontend/components/org_settings.cljs
+++ frontend/components/org_settings.cljs
@@ -383,8 +383,7 @@
           elligible-piggyback-orgs (-> (map :login user-orgs)
                                        (set)
                                        (conj user-login)
-                                       (disj org-name)
-                                       (sort))
+                                       (disj org-name))
           ;; This lets users toggle selected piggyback orgs that are already in the plan. Merges:
           ;; (:piggieback_orgs plan): ["org-a" "org-b"] with
           ;; selected-orgs:           {"org-a" false "org-c" true}
@@ -411,7 +410,8 @@
              [:form
               [:div.controls
                ;; orgs that this user can add to piggyback orgs and existing piggyback orgs
-               (for [org (clojure.set/union elligible-piggyback-orgs (set (:piggieback_orgs plan)))]
+               (for [org (sort (clojure.set/union elligible-piggyback-orgs
+                                                  (set (:piggieback_orgs plan))))]
                  [:div.control
                   [:label.checkbox
                    [:input


CMR-2454 fix indentation

CMR-2454 fix indentation

--- transmit-lib/src/cmr/transmit/echo/soap/authentication.clj
+++ transmit-lib/src/cmr/transmit/echo/soap/authentication.clj
@@ -23,7 +23,6 @@
 (defn login
   "Perform a login request against the SOAP API and return the generated token."
   [user pass]
-  (let [[status body-xml]
-        (soap/post-soap :authentication
-          (login-request user pass))]
+  (let [[status body-xml] (soap/post-soap :authentication
+                            (login-request user pass))]
       (xp/value-of body-xml "/Envelope/Body/LoginResponse/result")))


Introduce new intro to references

Introduce new intro to references

--- src/discuss/references/main.cljs
+++ src/discuss/references/main.cljs
@@ -10,6 +10,7 @@
             [discuss.communication.lib :as comlib]
             [discuss.config :as config]
             [discuss.references.lib :as rlib]
+            [discuss.texts.references :as textref]
             [discuss.translations :refer [translate] :rename {translate t}]
             [discuss.utils.bootstrap :as bs]
             [discuss.utils.common :as lib]
@@ -62,11 +63,10 @@
 (defui ReferenceUsageForSingleArgumentView
   "Build single usage of a reference in an argument."
   static om/IQuery
-  (query [this]
-         `[:argument])
+  (query [this] [:argument :intro])
   Object
   (render [this]
-          (let [{:keys [argument]} (om/props this)
+          (let [{:keys [argument intro]} (om/props this)
                 {:keys [author issue]} argument]
             (html [:div.bs-callout.bs-callout-info
                    [:div.pull-right
@@ -75,24 +75,22 @@
                      (vlib/fa-icon "fa-search"))]
                    [:a {:href "javascript:void(0)"
                         :onClick #(comlib/jump-to-argument (:slug issue) (:uid argument))}
-                    [:strong (vlib/safe-html (:text argument))]]
+                    [:strong (vlib/safe-html intro)]]
                    [:div (t :common :author) ": " (:nickname author)]
                    [:div (t :common :issue) ": " (:title issue)]]))))
 (def reference-usage-for-single-argument (om/factory ReferenceUsageForSingleArgumentView {:keyfn :argument}))

 (defui ReferenceUsagesForArgumentsView
   static om/IQuery
-  (query [this]
-         `[:arguments])
+  (query [this] [:arguments])
   Object
   (render [this]
-          (let [{:keys [issue arguments author]} (om/props this)]
+          (let [{:keys [arguments raw]} (om/props this)]
             (html [:div
                    (map
                     #(reference-usage-for-single-argument
-                      {:author author
-                       :issue issue
-                       :argument %})
+                      {:argument %
+                       :intro (textref/reference-usage-intro (get-in % [:author :nickname]) (:conclusions raw) (:premises raw))})
                     arguments)]))))
 (def reference-usages-for-arguments (om/factory ReferenceUsagesForArgumentsView {:keyfn :arguments}))

@@ -100,7 +98,7 @@
   "Complete list of all references and all their usages in their arguments."
   static om/IQuery
   (query [this]
-         `[:references/usages :references/selected])
+         [:references/usages :references/selected])
   Object
   (render [this]
           (let [{:keys [references/usages references/selected]} (om/props this)]


Upgrade shadow-cljs to 2.8.83

Upgrade shadow-cljs to 2.8.83

--- src/leiningen/new/re_frame/project.clj
+++ src/leiningen/new/re_frame/project.clj
@@ -4,7 +4,7 @@
                   :exclusions [com.google.javascript/closure-compiler-unshaded
                                org.clojure/google-closure-library
                                org.clojure/google-closure-library-third-party]]
-                 [thheller/shadow-cljs "2.8.80"]
+                 [thheller/shadow-cljs "2.8.83"]
                  [reagent "0.8.1"]
                  [re-frame "0.10.9"]{{#re-com?}}
                  [re-com "2.6.0"]{{/re-com?}}{{#routes?}}


morphing dispatcher to use phoenix client

--- dispatcher/src/systems/casemgr/utils/dispatcher/dispatcher.cljs
+++ dispatcher/src/systems/casemgr/utils/dispatcher/dispatcher.cljs
@@ -11,6 +11,12 @@
             )
   (:import goog.net.WebSocket))

+
+
+
+
+
+;; todo we need to replace this
 (defn ^:private startup
   "Actually connects the web socket to the server and starts the local event loop."
   [global-state {:keys [socket] :as local-state}]
@@ -28,11 +34,16 @@
     )
   )

+;; call close on the channel or the socket?
 (defn ^:private shutdown
   "Tears down the web socket connection."
   [{:keys [socket]}]
   (.close socket))

+;; this is where we do the socket connection and room:lobby
+;; how do we connect to a different channel?
+;; log in should id the shop
+;; one per shop
 (defn ^:private make-init-state
   "Creates the initial state for the web socket widget.  In particular, this
   instantiates a WebSocket instance and creates a core.async channel for
@@ -113,6 +124,7 @@
                 component-id (:component-id v)
                 message (:message v)]
             ;(println "current-state:" current-state)
+            ;; get rid of match
             (match [destination topic            component-id         message  ]
                    [_           :server-msg      _                    _        ] (generic-server-msg socket v)
                    [_           :dispatcher      :socket              :opened  ] (socket-opened socket publisher v)


CMR-2112 Remove debug code

CMR-2112 Remove debug code

--- umm-spec-lib/test/cmr/umm_spec/test/generate_and_parse.clj
+++ umm-spec-lib/test/cmr/umm_spec/test/generate_and_parse.clj
@@ -78,7 +78,6 @@
             :let [metadata (slurp example-file)
                   umm (core/parse-metadata test-context :collection metadata-format metadata)]]

-      (def umm umm)
       ;; input file is valid
       (check-failure
        (is (empty? (core/validate-xml :collection metadata-format metadata))


Fixes logic when querying the executing job

* Changes the term `running` to `executing` to match the Quartz
  API

--- reports/src/reports/scheduler.clj
+++ reports/src/reports/scheduler.clj
@@ -13,7 +13,7 @@
          opts "opts"} (qc/from-job-data ctx)]
     (exp/doexport exportType base-url sid opts)))

-(defn running-jobs []
+(defn get-executing-jobs []
   "Returns a list of executing jobs in form of JobExecutionContext"
   (.getCurrentlyExecutingJobs @qs/*scheduler*))

@@ -24,9 +24,8 @@
     (j/key (str k))
     k))

-
-(defn job-running? [k]
+(defn job-executing? [k]
   "Returns true if there is a running job for that particular `job key`"
   (let [jkey (get-job-key k)]
-    (> 0 (count
-           (filter #(= (.getKey (.getJobDetail %)) jkey) running-jobs)))))+    (= 1 (count
+           (filter #(= (.getKey (.getJobDetail %)) jkey) (get-executing-jobs))))))


rum trigger

rum trigger

--- dev/snippets/modal/live.cljs
+++ dev/snippets/modal/live.cljs
@@ -2,23 +2,19 @@
 (:require [om-bootstrap.modal :as md]
           [rum])

-(defn trigger [app-state owner]
-  (reify
-    om/IInitState
-    (init-state [_]
-      {:visible? false})
-    om/IRender
-    (render [_]
-      (d/div
-        (md/modal {:header        (d/h4 "This is a Modal")
-                   :footer        (d/div (b/button {} "Save")
-                                         (b/button {} "Send"))
-                   :close-button? true
-                   :visible?      (om/get-state owner :visible?)}
-                  "This is in the modal body")
-        (b/button {:bs-style "primary"
-                   :bs-size "large"
-                   :on-click (fn [_] (om/set-state! owner :visible? true))}
-                  "Click to open Modal")))))
+(rum/defcs trigger
+  < (rum/local false :visible?)
+  [{:keys [visible?]}]
+  [:div
+   (md/modal {:header        [:h4 "This is a Modal"]
+              :footer        [:div (b/button {} "Save")
+                                    (b/button {} "Send")]
+              :close-button? true
+              :visible?      @visible?}
+             "This is in the modal body")
+   (b/button {:bs-style "primary"
+              :bs-size "large"
+              :on-click (fn [_] (reset! visible? true))}
+             "Click to open Modal")])

-(om/build trigger {})
+(trigger)


Update Indention

Update Indention

--- src-cljs/frontend/components/insights.cljs
+++ src-cljs/frontend/components/insights.cljs
@@ -408,18 +408,15 @@
    [:div
     [:div.content
     (let [project (first (filter (fn [project]
-                     (and
-                       (= (:reponame project)
-                          (get-in data [:navigation-data :repo]))
-                       )
-                       (= (:username project)
-                          (get-in data [:navigation-data :org]))
-                       )
-                     (get-in data state/projects-path)
-                     ))]
-        (println project)
+                    (and
+                      (= (:reponame project)
+                        (get-in data [:navigation-data :repo])))
+                      (= (:username project)
+                        (get-in data [:navigation-data :org])))
+                    (get-in data state/projects-path)
+                    ))]
         (om/build project-insights (decorate-project
-                                    (get-in state state/user-plans-path) project)))]]))
+                                    (get-in data state/user-plans-path) project)))]]))

 (defrender build-insights [state owner]
   (let [projects (get-in state state/projects-path)]