работы надо свертывателем

работы надо свертывателем

--- src-cljs/ixinfestor/omut.cljs
+++ src-cljs/ixinfestor/omut.cljs
@@ -76,11 +76,12 @@
   (assoc row omut-row-key omut-row-app-state))

 (defn omut-row-if-not-init-init!! [app]
-  (om/transact! app omut-row-key
-                (fn [app]
-                  (if (omut-row-key app)
-                    app
-                    (omut-row-init app)))))
+  (om/transact!
+   app
+   (fn [app]
+     (if (omut-row-key app)
+       app
+       (omut-row-init app)))))

 (defn omut-row-row [row]
   (dissoc row omut-row-key))
@@ -101,13 +102,21 @@

+
+
 (defn omut-row-set-collapsed!! [app-row k v]
-  (om/update! app-row [omut-row-key :collapsed k] v))
+  (om/transact!
+   app-row
+   (fn [app-row]
+     (assoc-in app-row [omut-row-key :collapsed k] v))))

 (defn omut-row-set-collapsed-not!! [app-row k]
-  (om/transact! app-row [omut-row-key :collapsed]
-                (fn [app-row]
-                  (if app-row (update-in app-row [k] not) {k false}))))
+  (om/transact!
+   app-row
+   (fn [app-row]
+     (println (app-row omut-row-key))
+     (let [v (get-in app-row [omut-row-key :collapsed k])]
+       (assoc-in app-row [omut-row-key :collapsed k] (if (nil? v) false (not v)))))))

 (defn omut-row-collapsed? [app-row k]
   (get-in app-row [omut-row-key :collapsed k] true))
@@ -542,7 +551,7 @@
 ;;**************************************************************************************************

-(defn text-collapser [app owner {k :k}]
+(defn text-collapser [app _ {k :k}]
   (reify
     om/IWillMount
     (will-mount [_]
@@ -562,6 +571,31 @@
                  text))))))

 ;; END Long text collapser
+;;..................................................................................................
+
+;;**************************************************************************************************
+;;* BEGIN collapser
+;;* tag: <collapser>
+;;*
+;;* description: Свертыватель
+;;*
+;;**************************************************************************************************
+
+                                        ;TODO: Перемиеноывать в ui-hidder
+(defn ui-collapser [app text k show? collapsed-body]
+  (dom/p #js {:style #js {:display (if show? "" "none")}}
+         (ui-button {:text text
+                     :type :info
+                     :active? (not (omut-row-collapsed? @app k))
+                     :on-click #(omut-row-set-collapsed-not!! app k)})
+
+         (dom/div #js {:style #js {:display (if (omut-row-collapsed? @app k) "none" "")}}
+                  collapsed-body)))
+
+
+
+
+;; END collapser
 ;;..................................................................................................


Cookie tests no longer depend on hash-map ordering

--- ring-core/test/ring/middleware/test/cookies.clj
+++ ring-core/test/ring/middleware/test/cookies.clj
@@ -1,4 +1,5 @@
 (ns ring.middleware.test.cookies
+  (:require [clojure.string :as str])
   (:use clojure.test
         ring.middleware.cookies
         [clj-time.core :only (interval date-time)]))
@@ -50,12 +51,16 @@
     (is (= {"Set-Cookie" (list "a=b")}
            (:headers resp)))))

+(defn- split-set-cookie [headers]
+  (letfn [(split-header [v] (set (mapcat #(str/split % #";") v)))]
+    (update-in headers ["Set-Cookie"] split-header)))
+
 (deftest wrap-cookies-set-extra-attrs
   (let [cookies {"a" {:value "b", :path "/", :secure true, :http-only true }}
         handler (constantly {:cookies cookies})
         resp    ((wrap-cookies handler) {})]
-    (is (= {"Set-Cookie" (list "a=b;Path=/;Secure;HttpOnly")}
-           (:headers resp)))))
+    (is (= {"Set-Cookie" #{"a=b" "Path=/" "Secure" "HttpOnly"}}
+           (split-set-cookie (:headers resp))))))

 (deftest wrap-cookies-always-assocs-map
   (let [req  {:headers {}}
@@ -96,8 +101,8 @@
                       :max-age 123}}
         handler (constantly {:cookies cookies})
         resp    ((wrap-cookies handler) {})]
-    (is (= {"Set-Cookie" (list "a=b;Path=/;Secure;HttpOnly;Max-Age=123")}
-           (:headers resp)))))
+    (is (= {"Set-Cookie" #{"a=b" "Path=/" "Secure" "HttpOnly" "Max-Age=123"}}
+           (split-set-cookie (:headers resp))))))

 (deftest wrap-cookies-accepts-expires
   (let [cookies {"a" {:value "b", :path "/",
@@ -105,8 +110,8 @@
                       :expires "123"}}
         handler (constantly {:cookies cookies})
         resp    ((wrap-cookies handler) {})]
-    (is (= {"Set-Cookie" (list "a=b;Path=/;Secure;HttpOnly;Expires=123")}
-           (:headers resp)))))
+    (is (= {"Set-Cookie" #{"a=b" "Path=/" "Secure" "HttpOnly" "Expires=123"}}
+           (split-set-cookie (:headers resp))))))

 (deftest wrap-cookies-accepts-max-age-from-clj-time
   (let [cookies {"a" {:value "b", :path "/",
@@ -116,8 +121,8 @@
         handler (constantly {:cookies cookies})
         resp    ((wrap-cookies handler) {})
         max-age 94694400]
-    (is (= {"Set-Cookie" (list (str "a=b;Path=/;Secure;HttpOnly;Max-Age=" max-age))}
-           (:headers resp)))))
+    (is (= {"Set-Cookie" #{"a=b" "Path=/" "Secure" "HttpOnly" (str "Max-Age=" max-age)}}
+           (split-set-cookie (:headers resp))))))

 (deftest wrap-cookies-accepts-expires-from-clj-time
   (let [cookies {"a" {:value "b", :path "/",
@@ -126,8 +131,8 @@
         handler (constantly {:cookies cookies})
         resp    ((wrap-cookies handler) {})
         expires "Thu, 31 Dec 2015 00:00:00 +0000"]
-    (is (= {"Set-Cookie" (list (str "a=b;Path=/;Secure;HttpOnly;Expires=" expires))}
-           (:headers resp)))))
+    (is (= {"Set-Cookie" #{"a=b" "Path=/" "Secure" "HttpOnly" (str "Expires=" expires)}}
+           (split-set-cookie (:headers resp))))))

 (deftest wrap-cookies-throws-exception-when-not-using-intervals-correctly
   (let [cookies {"a" {:value "b", :path "/",


Fix SQLite "last month" behavior edge case :scream_cat:

--- src/metabase/driver/sqlite.clj
+++ src/metabase/driver/sqlite.clj
@@ -90,7 +90,7 @@
                                    :quarter [3 "months"]
                                    :year    [1 "years"])]
     ;; Make a string like DATETIME(DATE('now', 'start of month'), '-1 month')
-    ;; The date bucketing will end up being done twice since `date` is called on the results of `date-interval` automatically. This shouldn't be a big deal because it's used for relative dates and only needs to be done once in a given query.
+    ;; The date bucketing will end up being done twice since `date` is called on the results of `date-interval` automatically. This shouldn't be a big deal because it's used for relative dates and only needs to be done once.
     ;; It's important to call `date` on 'now' to apply bucketing *before* adding/subtracting dates to handle certain edge cases as discussed in issue #2275 (https://github.com/metabase/metabase/issues/2275).
     ;; Basically, March 30th minus one month becomes Feb 30th in SQLite, which becomes March 2nd. DATE(DATETIME('2016-03-30', '-1 month'), 'start of month') is thus March 1st.
     ;; The SQL we produce instead (for "last month") ends up looking something like: DATE(DATETIME(DATE('2015-03-30', 'start of month'), '-1 month'), 'start of month'). It's a little verbose, but gives us the correct answer (Feb 1st).


Automatically skip post on song end and song error

--- src/reddio_frontend/core.cljs
+++ src/reddio_frontend/core.cljs
@@ -14,6 +14,14 @@
                     :duration nil
                     :progress 0
                     :loaded 0})
+
+(defn next-post [coll el]
+  "Get the next post"
+  (get (zipmap coll (rest coll)) el))
+
+(defn prev-post [coll el]
+  "Get the previous post"
+  (get (zipmap (rest coll) coll) el nil))

 (rf/reg-event-db :initialize
                  (fn [_ _]
@@ -68,13 +76,11 @@

 (rf/reg-event-db :player-ended
                  (fn [db [_ _]]
-                   (js/console.log :player-ended)
-                   db))
+                   (assoc db :post (next-post (:all-posts db) (:post db)))))

 (rf/reg-event-db :player-error
                  (fn [db [_ _]]
-                   (js/console.log :player-error)
-                   db))
+                   (assoc db :post (next-post (:all-posts db) (:post db)))))

 (rf/reg-event-db :player-command-play
                  (fn [db [_ _]]
@@ -83,14 +89,6 @@
 (rf/reg-event-db :player-command-pause
                  (fn [db [_ _]]
                    (assoc db :player-state :paused)))
-
-(defn next-post [coll el]
-  "Get the next post"
-  (get (zipmap coll (rest coll)) el))
-
-(defn prev-post [coll el]
-  "Get the previous post"
-  (get (zipmap (rest coll) coll) el nil))

 (rf/reg-event-db :player-command-next
                  (fn [db [_ _]]


Add alias to client's project.clj to match README

--- satellite-slave/project.clj
+++ satellite-slave/project.clj
@@ -24,4 +24,5 @@
                   :exclusions [log4j]]
                  [riemann-clojure-client "0.3.1"]]
   :aot [satellite-slave.core]
-  :main satellite-slave.core)
+  :main satellite-slave.core
+  :aliases {"release-jar" ["do" "clean," "uberjar"]})


RS | #0 | Simplify/refactor hiccup->content-string function

--- src/objective8/draft_diffs.clj
+++ src/objective8/draft_diffs.clj
@@ -83,12 +83,7 @@
     content-strings))

 (defn hiccup->content-string [draft]
-  (if (empty? draft)
-    ""
-    (let [first-draft-element (first draft)
-          first-element-strings (strings-for-element first-draft-element)
-          rest-element-strings (hiccup->content-string (rest draft))]
-      (clojure.string/join (into [] (concat first-element-strings rest-element-strings))))))
+  (clojure.string/join (mapcat strings-for-element draft)))

 (defn diff-hiccup-content [hiccup-1 hiccup-2]
   (-> (dmp/diff (hiccup->content-string hiccup-1) (hiccup->content-string hiccup-2))
@@ -100,7 +95,6 @@
         previous-draft-content (utils/sanitise-hiccup (:content previous-draft))
         diffs (diff-hiccup-content previous-draft-content current-draft-content)
         previous-draft-diffs (remove-hiccup-elements diffs :ins)
-        current-draft-diffs (remove-hiccup-elements diffs :del)
-        result {:previous-draft-diffs (insert-diffs-into-drafts previous-draft-diffs previous-draft-content)
-                :current-draft-diffs (insert-diffs-into-drafts current-draft-diffs current-draft-content)}]
-    result))
+        current-draft-diffs (remove-hiccup-elements diffs :del)]
+    {:previous-draft-diffs (insert-diffs-into-drafts previous-draft-diffs previous-draft-content)
+     :current-draft-diffs (insert-diffs-into-drafts current-draft-diffs current-draft-content)}))


Fix add-bookmark! and remove-bookmark! calls, add entry bookmark with trailing slash route.

--- src/oc/storage/api/entries.clj
+++ src/oc/storage/api/entries.clj
@@ -267,7 +267,7 @@
             board (:existing-board ctx)
             entry (:existing-entry ctx)
             user (:user ctx)]
-    (if-let [updated-entry (entry-res/add-bookmark! conn entry user)]
+    (if-let [updated-entry (entry-res/add-bookmark! conn (:uuid entry) user)]
       (do
         (timbre/info "Bookmark created for entry:" entry-for "and user" (-> ctx :user :user-id))
         {:updated-entry (api-common/rep updated-entry)})
@@ -284,7 +284,7 @@
             board (:existing-board ctx)
             entry (:existing-entry ctx)
             user (:user ctx)]
-    (if-let [updated-entry (entry-res/remove-bookmark! conn entry user)]
+    (if-let [updated-entry (entry-res/remove-bookmark! conn (:uuid entry) user)]
       (do
         (timbre/info "Bookmark removed for entry:" entry-for "and user" (-> ctx :user :user-id))
         {:updated-entry (api-common/rep updated-entry)})
@@ -838,4 +838,8 @@
       (ANY "/orgs/:org-slug/boards/:board-slug/entries/:entry-uuid/bookmark"
         [org-slug board-slug entry-uuid]
         (pool/with-pool [conn db-pool]
+          (bookmark conn org-slug board-slug entry-uuid)))
+      (ANY "/orgs/:org-slug/boards/:board-slug/entries/:entry-uuid/bookmark/"
+        [org-slug board-slug entry-uuid]
+        (pool/with-pool [conn db-pool]
           (bookmark conn org-slug board-slug entry-uuid))))))


Remove unused function, thanks eastwood.

--- src/oc/storage/api/entries.clj
+++ src/oc/storage/api/entries.clj
@@ -176,14 +176,6 @@
      :existing-board (api-common/rep board)
      :existing-entries (api-common/rep entries)}
     false))
-
-(defn- boards-for [conn org user]
-  (let [org-id (:uuid org)
-        boards (board-res/list-boards-by-org conn org-id [:created-at :updated-at :authors :viewers :access])
-        allowed-boards (map :uuid (filter #(access/access-level-for org % user) boards))
-        board-uuids (map :uuid boards)
-        board-slugs-and-names (map #(array-map :slug (:slug %) :access (:access %) :name (:name %)) boards)]
-    (zipmap board-uuids board-slugs-and-names)))

 ;; ----- Actions -----


Fix nippy filter compression with latest nippy version

--- src/onyx/compression/nippy.clj
+++ src/onyx/compression/nippy.clj
@@ -42,12 +42,12 @@
 (defn window-log-decompress [x]
   (nippy/thaw x window-log-decompress-opts))

-(def localdb-compress-opts {:skip-header? true :compressor nil :encryptor nil :password nil})
+(def localdb-compress-opts {:v1-compatibility? false :compressor nil :encryptor nil :password nil})

 (defn localdb-compress [x]
   (nippy/freeze x localdb-compress-opts))

-(def local-db-decompress-opts {:v1-compatibility? false :compressor nil :encryptor nil})
+(def local-db-decompress-opts {:v1-compatibility? false :compressor nil :encryptor nil :password nil})

 (defn localdb-decompress [x]
   (nippy/thaw x local-db-decompress-opts))


Defined the full version's metronome inline for symmetry and clarity.

--- src/overtunes/songs/before.clj
+++ src/overtunes/songs/before.clj
@@ -53,7 +53,6 @@
   (chord :Eb4 :major)
 ])

-(def metro (metronome 60))
 (defn beat-length [metro] (- (metro 1) (metro 0)))

 (defn play-note [tone instrument duration]
@@ -108,5 +107,5 @@
   (play-progression (concat chords finish) metro (metro))
 ))

-(defn full-version [] (play (concat start middle start middle variation) metro))
+(defn full-version [] (play (concat start middle start middle variation) (metronome 60)))
 (defn short-version [] (play variation (metronome 200)))


Add a check pass for non-def top level forms

--- src/oxcart/passes/warnings.clj
+++ src/oxcart/passes/warnings.clj
@@ -201,3 +201,30 @@
             "Errors were generated in checking."))
   (-> whole-ast
       (record-pass check-ops)))
+
+
+(defn check-top-level
+  "λ Whole-AST → options → Whole-AST
+
+  Traverses the argument AST on a form by form basis to make sure that
+  the program does not constitute a \"script\", for script defined to
+  be a Clojure program which uses top level forms for load time side
+  effects. Such programs, while valid Clojure, may not be supported by
+  all Oxcart emitters.
+
+  Options
+  -----------
+  This pass takes no options."
+  [whole-ast options]
+  (let [error?   (atom false)]
+    (doseq [ast (whole-ast->forms whole-ast)]
+      (when-not (pattern/def? ast)
+        (reset! error? true)
+        (error (util/format-line-info ast)
+               ", Program makes use of non-def top level form!"))
+
+    (assert (not @error?)
+            "Errors were generated in checking."))
+
+    (-> whole-ast
+        (record-pass check-top-level))))


added rule description fields and label propagation

--- kabob-build/src/main/resources/edu/ucdenver/ccp/kabob/build/rules/temp/irefweb/irefweb.clj
+++ kabob-build/src/main/resources/edu/ucdenver/ccp/kabob/build/rules/temp/irefweb/irefweb.clj
@@ -1,24 +1,37 @@

 `{:name "irefweb-binary-interactions"
-  :description ""
+  :description "IRefWeb distinguishes among three different categories of protein interactions:
+  those that involve a single protein interacting with itself (intra-molecular),
+  those that involve two proteins (binary), and those that involve >2 proteins (n-ary).
+  This rule generates bio-representations for all binary protein interactions cataloged by
+  IRefWeb. Binary interactions are indicated by an 'X' in the 'edge type' column of IRefWeb
+  records. For each binary interaction, this rule creates a subclass of the 'interaction type'
+  (MI Ontology concept), and that subclass is restricted using ro:has_participant to the two
+  interacting proteins. The rule also places a cardinality restriction of 2 on the interaction
+  subclass for the ro:has_participant property."
   :head ((?/interaction rdfs/subClassOf ?/int_type_id) ;interaction
+         (?/interaction rdfs/label ?/int_type_label) ; transfer label to the subclass

          ;; create subclasses of the proteins
          (?/protein1_sc rdfs/subClassOf ?/protein1)
+         ;; TODO: UNCOMMENT below once kabob proteins have labels
+         ;;(?/protein1_sc rdfs/label ?/protein1_label) ; transfer label to the subclass
          (?/protein2_sc rdfs/subClassOf ?/protein2)
+         ;; TODO: UNCOMMENT below once kabob proteins have labels
+         ;;(?/protein2_sc rdfs/label ?/protein2_label) ; transfer label to the subclass
+
+         (?/r1 rdf/type owl/Restriction)
+         (?/r1 owl/onProperty obo/RO_0000057) ; has_participant
+         (?/r1 owl/someValuesFrom ?/protein1_sc)
+
+         (?/r2 rdf/type owl/Restriction)
+         (?/r2 owl/onProperty obo/RO_0000057) ; has_participant
+         (?/r2 owl/someValuesFrom ?/protein2_sc)

          ;; create a cardinality restriction of 2 on the has_participant property
          (?/rcard rdf/type owl/Restriction)
          (?/rcard owl/onProperty obo/RO_0000057) ; has_participant
          (?/rcard owl/cardinality 2) ;; binary interactions must have 2 participants.
-
-         (?/r1 rdf/type owl/Restriction)
-         (?/r1 owl/onProperty obo/RO_0000057) ; has_participant
-         (?/r1 owl/someValuesFrom ?/protein1_sc)
-
-         (?/r2 rdf/type owl/Restriction)
-         (?/r2 owl/onProperty obo/RO_0000057) ; has_participant
-         (?/r2 owl/someValuesFrom ?/protein2_sc)

          (?/interaction rdfs/subClassOf ?/r1)
          (?/interaction rdfs/subClassOf ?/r2)
@@ -29,29 +42,6 @@
   ((_/edge_field kiao/hasTemplate iaoirefweb/IRefWebInteraction_edgeTypeDataField1)
    (_/edge_field obo/IAO_0000219 ["X" "en"])   ;; "X" signifies binary interaction
    (_/interaction_record obo/BFO_0000051 _/edge_field)  ;; bfo/has_part
-
-   ;; get the unique interaction identifier
-   (_/interaction_record obo/BFO_0000051 _/interaction_checksum_field) ;; bfo/has_part
-   (_/interaction_checksum_field kiao/hasTemplate iaoirefweb/IRefWebInteraction_checksumInteractionDataField1)
-   (_/interaction_checksum_field obo/IAO_0000219 ?/unique_interaction_id) ;; iao/denotes
-
-   ;; get the interaction type name and ID
-   (_/interaction_record obo/BFO_0000051 _/interaction_type_record) ;; bfo/has_part
-   (_/interaction_type_record kiao/hasTemplate iaoirefweb/IRefWebInteractionTypeSchema1)
- ;;  (?/interaction_type_record obo/BFO_0000051 ?/int_type_name_field) ;; bfo/has_part
- ;;  (?/int_type_name_field kiao/hasTemplate iaoirefweb/IRefWebInteractionType_interactionTypeNameDataField1)
- ;;  (?/int_type_name_field obo/IAO_0000219 ?/int_type_name) ;; iao/denotes
-   (_/interaction_type_record obo/BFO_0000051 _/int_type_id_field) ;; bfo/has_part
-   (_/int_type_id_field kiao/hasTemplate iaoirefweb/IRefWebInteractionType_interactionTypeIdDataField1)
-   (_/int_type_id_field obo/IAO_0000219 _/int_type_id_ice) ;; iao/denotes
-   (_/int_type_id_ice obo/IAO_0000219 ?/int_type_id) ;; iao/denotes
-
-   ;; get the detection method
-   (_/interaction_record obo/BFO_0000051 _/interaction_detection_method_record) ;; bfo/has_part
-   (_/interaction_detection_method_record kiao/hasTemplate iaoirefweb/IRefWebInteractionDetectionMethodSchema1)
-   (_/interaction_detection_method_record obo/BFO_0000051 _/detection_method_id_field) ;; bfo/has_part
-   (_/detection_method_id_field kiao/hasTemplate iaoirefweb/IRefWebInteractionDetectionMethod_detectionMethodIdDataField1)
-   (_/detection_method_id_field obo/IAO_0000219 ?/detection_method_id) ;; iao/denotes

    ;; there is a "super" record in IRefWeb that contains references
    ;; to the interaction record and interactor record(s)
@@ -70,11 +60,41 @@
    (_/id_field1 obo/IAO_0000219 _/id1) ;; iao/denotes
    (_/id1 obo/IAO_0000219 ?/protein1) ;; iao/denotes

+   ;; TODO: UNCOMMENT below once kabob proteins have labels
+   ;;(?/protein1 rdfs:label ?/protein1_label) ;; get the protein label so that it can be
+   ;; transfered to the generated protein subclass
+
    ;; get the bioentity (protein) corresponding to interactor 2
    (?/interactor_record2 obo/BFO_0000051 _/id_field2) ;; bfo/has_part
    (_/id_field2 kiao/hasTemplate iaoirefweb/IRefWebInteractor_uniqueIdDataField1)
    (_/id_field2 obo/IAO_0000219 _/id2) ;; iao/denotes
-   (_/id2 obo/IAO_0000219 ?/protein2)) ;; iao/denotes
+   (_/id2 obo/IAO_0000219 ?/protein2) ;; iao/denotes
+
+   ;; TODO: UNCOMMENT below once kabob proteins have labels
+   ;;(?/protein2 rdfs:label ?/protein2_label) ;; get the protein label so that it can be
+   ;; transfered to the generated protein subclass
+
+
+   ;; get the unique interaction identifier
+   (_/interaction_record obo/BFO_0000051 _/interaction_checksum_field) ;; bfo/has_part
+   (_/interaction_checksum_field kiao/hasTemplate iaoirefweb/IRefWebInteraction_checksumInteractionDataField1)
+   (_/interaction_checksum_field obo/IAO_0000219 ?/unique_interaction_id) ;; iao/denotes
+
+   ;; get the interaction type name and ID
+   (_/interaction_record obo/BFO_0000051 _/interaction_type_record) ;; bfo/has_part
+   (_/interaction_type_record kiao/hasTemplate iaoirefweb/IRefWebInteractionTypeSchema1)
+   (_/interaction_type_record obo/BFO_0000051 _/int_type_id_field) ;; bfo/has_part
+   (_/int_type_id_field kiao/hasTemplate iaoirefweb/IRefWebInteractionType_interactionTypeIdDataField1)
+   (_/int_type_id_field obo/IAO_0000219 _/int_type_id_ice) ;; iao/denotes
+   (_/int_type_id_ice obo/IAO_0000219 ?/int_type_id) ;; iao/denotes
+   (?/int_type_id rdfs/label ?/int_type_label) ;; grab the interaction_type label so that it can be
+   ;;                                             applied to the generated interaction_type subclass
+   ;; get the detection method
+   (_/interaction_record obo/BFO_0000051 _/interaction_detection_method_record) ;; bfo/has_part
+   (_/interaction_detection_method_record kiao/hasTemplate iaoirefweb/IRefWebInteractionDetectionMethodSchema1)
+   (_/interaction_detection_method_record obo/BFO_0000051 _/detection_method_id_field) ;; bfo/has_part
+   (_/detection_method_id_field kiao/hasTemplate iaoirefweb/IRefWebInteractionDetectionMethod_detectionMethodIdDataField1)
+   (_/detection_method_id_field obo/IAO_0000219 ?/detection_method_id)) ;; iao/denotes

   ;; we take advantage of the fact that IRefWeb has
   ;; created a unique id for the interaction. This will allow us to reproducibly create
@@ -85,28 +105,45 @@
                  :ns "kbio" :prefix "R_"}]
           [?/r2 {:ln (:restriction)
                  :ns "kbio" :prefix "R_"}]
+          [?/rcard {:ln (:restriction)
+                    :ns "kbio" :prefix "R_"}]
           [?/protein1_sc {:ln (:sha-1 ?/interaction ?/protein1)
                           :ns "kbio" :prefix "P_"}]
           [?/protein2_sc {:ln (:sha-1 ?/interaction ?/protein2)
                           :ns "kbio" :prefix "P_"}])

-  :options {:magic-prefixes [["franzOption_clauseReorderer" "franz:identity"]]}
+  :options {:magic-prefixes [["franzOption_clauseReorderer" "franz:identity"]
+                             ["franzOption_chunkProcessingAllowed" "franz:yes"]]}
   }

+
 `{:name "irefweb-unary-interactions"
-  :description ""
+  :description "IRefWeb distinguishes among three different categories of protein interactions:
+  those that involve a single protein interacting with itself (intra-molecular),
+  those that involve two proteins (binary), and those that involve >2 proteins (n-ary).
+  This rule generates bio-representations for all unary (intra-molecular) protein interactions
+  cataloged by IRefWeb. Unary interactions are indicated by an 'Y' in the 'edge type' column of
+  IRefWeb records. For each unary interaction, this rule creates a subclass of the
+  'interaction type' (MI Ontology concept), and that subclass is restricted using ro:has_participant
+  to the single `interacting` protein. It is important to note that this these are intra-molecular
+  interactions (one protein molecule interacting with itself), and not for example interactions
+  that form a dimer using two identical molecules of the same protein. The rule also places a
+  cardinality restriction of 1 on the interaction subclass for the ro:has_participant property."
   :head ((?/interaction rdfs/subClassOf ?/int_type_id) ;interaction
+         (?/interaction rdfs/label ?/int_type_label) ; transfer label to the subclass

          ;; create subclasses of the single protein involved
          (?/protein1_sc rdfs/subClassOf ?/protein1)
+         ;; TODO: UNCOMMENT below once kabob proteins have labels
+         ;;(?/protein1_sc rdfs/label ?/protein1_label) ; transfer label to the subclass

          (?/r1 rdf/type owl/Restriction)
          (?/r1 owl/onProperty obo/RO_0000057) ; has_participant
          (?/r1 owl/someValuesFrom ?/protein1_sc)

-          ;; create a cardinality restriction of 2 on the has_participant property
+         ;; create a cardinality restriction of 2 on the has_participant property
          (?/rcard rdf/type owl/Restriction)
          (?/rcard owl/onProperty obo/RO_0000057) ; has_participant
          (?/rcard owl/cardinality 1) ;; unary interactions must have 1 participant.
@@ -135,6 +172,8 @@
    (?/int_type_id_field kiao/hasTemplate iaoirefweb/IRefWebInteractionType_interactionTypeIdDataField1)
    (?/int_type_id_field obo/IAO_0000219 ?/int_type_id_ice) ;; iao/denotes
    (?/int_type_id_ice obo/IAO_0000219 ?/int_type_id) ;; iao/denotes
+   (?/int_type_id rdfs/label ?/int_type_label) ;; grab the interaction_type label so that it can be
+   ;;                                             applied to the generated interaction_type subclass

    ;; get the detection method
    (?/interaction_record obo/BFO_0000051 ?/interaction_detection_method_record) ;; bfo/has_part
@@ -155,7 +194,11 @@
    (?/interactor_record1 obo/BFO_0000051 ?/id_field1) ;; bfo/has_part
    (?/id_field1 kiao/hasTemplate iaoirefweb/IRefWebInteractor_uniqueIdDataField1)
    (?/id_field1 obo/IAO_0000219 ?/id1) ;; iao/denotes
-   (?/id1 obo/IAO_0000219 ?/protein1)) ;; iao/denotes
+   (?/id1 obo/IAO_0000219 ?/protein1) ;; iao/denotes
+   ;; TODO: UNCOMMENT below once kabob proteins have labels
+   ;;(?/protein1 rdfs:label ?/protein1_label) ;; get the protein label so that it can be
+   ;; transfered to the generated protein subclass
+   )

   ;; we take advantage of the fact that IRefWeb has
   ;; created a unique id for the interaction. This will allow us to reproducibly create
@@ -164,6 +207,8 @@
                           :ns "kbio" :prefix "I_"}]
           [?/r1 {:ln (:restriction)
                  :ns "kbio" :prefix "R_"}]
+          [?/rcard {:ln (:restriction)
+                    :ns "kbio" :prefix "R_"}]
           [?/protein1_sc {:ln (:sha-1 ?/interaction ?/protein1)
                           :ns "kbio" :prefix "P_"}])

@@ -173,18 +218,35 @@

 `{:name "irefweb-n-ary-interactions"
-  :description "interactions with >2 participants. IRefWeb refers to them as complexes,
-  but these interactions don't necessarily form complexes."
+  :description "IRefWeb distinguishes among three different categories of protein interactions:
+  those that involve a single protein interacting with itself (intra-molecular),
+  those that involve two proteins (binary), and those that involve >2 proteins (n-ary).
+  This rule generates bio-representations for all n-ary protein interactions cataloged by
+  IRefWeb, where n>2. N-ary interactions are indicated by an 'C' in the 'edge type' column of
+  IRefWeb records. The 'C' is referred to as 'complex' in the IRefWeb documentation, however this
+  is misleading as many of the n-ary interactions are only associations determined from an assay,
+  and are not necessarily protein complexes (as defined by the GO:protein_complex concept [GO:0043234]:
+  'A stable macromolecular complex composed (only) of two or more polypeptide subunits...').
+  For each n-ary interaction, this rule creates a subclass of the 'interaction type' (MI Ontology concept),
+  and that subclass is restricted using ro:has_participant to one of the n interacting proteins. N-ary
+  interactions are composed from multiple IRefWeb records as each record catalogs only a single
+  participant in the n-ary interaction. IRefWeb records involved in an n-ary interaction share a unique
+  interaction identifier which is used by the rule to connect all n participants for a given n-ary interaction.
+  The rule also places a minimum-cardinality restriction of 2 on the interaction subclass for the
+  ro:has_participant property."
   :head ((?/interaction rdfs/subClassOf ?/int_type_id) ;interaction
+         (?/interaction rdfs/label ?/int_type_label) ; transfer label to the subclass

          ;; create subclasses of the proteins
          (?/protein1_sc rdfs/subClassOf ?/protein1)
+         ;; TODO: UNCOMMENT below once kabob proteins have labels
+         ;;(?/protein1_sc rdfs/label ?/protein1_label) ; transfer label to the subclass

          (?/r1 rdf/type owl/Restriction)
          (?/r1 owl/onProperty obo/RO_0000057) ; has_participant
          (?/r1 owl/someValuesFrom ?/protein1_sc)

-           ;; create a cardinality restriction of >2 on the has_participant property
+         ;; create a cardinality restriction of >2 on the has_participant property
          (?/rcard rdf/type owl/Restriction)
          (?/rcard owl/onProperty obo/RO_0000057) ; has_participant
          (?/rcard owl/minCardinality 3) ;; n-ary interactions must have >2 participant.
@@ -213,6 +275,8 @@
    (?/int_type_id_field kiao/hasTemplate iaoirefweb/IRefWebInteractionType_interactionTypeIdDataField1)
    (?/int_type_id_field obo/IAO_0000219 ?/int_type_id_ice) ;; iao/denotes
    (?/int_type_id_ice obo/IAO_0000219 ?/int_type_id) ;; iao/denotes
+   (?/int_type_id rdfs/label ?/int_type_label) ;; grab the interaction_type label so that it can be
+   ;;                                             applied to the generated interaction_type subclass

    ;; get the detection method
    (?/interaction_record obo/BFO_0000051 ?/interaction_detection_method_record) ;; bfo/has_part
@@ -237,7 +301,11 @@
    (?/id_field1 kiao/hasTemplate iaoirefweb/IRefWebInteractor_uniqueIdDataField1)
    (?/id_field1 obo/IAO_0000219 ?/id1) ;; iao/denotes
    (!= ?/id1 ?/unique_interaction_id)
-   (?/id1 obo/IAO_0000219 ?/protein1)) ;; iao/denotes
+   (?/id1 obo/IAO_0000219 ?/protein1) ;; iao/denotes
+   ;; TODO: UNCOMMENT below once kabob proteins have labels
+   ;;(?/protein1 rdfs:label ?/protein1_label) ;; get the protein label so that it can be
+   ;; transfered to the generated protein subclass
+   )

   ;; we take advantage of the fact that IRefWeb has
   ;; created a unique id for the interaction. This will allow us to reproducibly create
@@ -246,6 +314,8 @@
                           :ns "kbio" :prefix "I_"}]
           [?/r1 {:ln (:restriction)
                  :ns "kbio" :prefix "R_"}]
+          [?/rcard {:ln (:restriction)
+                    :ns "kbio" :prefix "R_"}]
           [?/protein1_sc {:ln (:sha-1 ?/interaction ?/protein1)
                           :ns "kbio" :prefix "P_"}])


Started vis nested associative state.

Started vis nested associative state.

--- src/cbfg/core.cljs
+++ src/cbfg/core.cljs
@@ -8,9 +8,6 @@
             [cljs.core.async :refer [<! >! put! chan timeout merge map<]]
             [goog.dom :as gdom]
             [goog.events :as gevents]
-            [om.core :as om :include-macros true]
-            [om.dom :as dom :include-macros true]
-            [sablono.core :as html :refer [html] :include-macros true]
             cbfg.ddl
             [cbfg.fence :refer [make-fenced-pump]]))

@@ -61,7 +58,7 @@
            (let [[chs result] args] 2))}})

 (defn vis-init [cmds cmd-handlers]
-  (let [vis {}
+  (let [vis (atom {:actxs {} :chs {}})
         max-inflight (atom 10)
         event-delay (atom 0)
         event-ch (chan)


Remove dead code (notifications.el)

Remove dead code (notifications.el)

--- src/pepa/web/notifications.clj
+++ src/pepa/web/notifications.clj
@@ -1,76 +0,0 @@
-(ns pepa.web.notifications
-  (:require [com.stuartsierra.component :as component]
-            [pepa.bus :as bus]
-            [pepa.db :as db]
-            [pepa.model :as m]
-            [clojure.core.async :as async :refer [<!!]]))
-
-(defrecord Notificator [db bus output])
-
-(defmulti ^:private bus->web
-  (fn [notificator bus-message]
-    (bus/topic bus-message)))
-
-(defmethod bus->web :default
-  [notificator message]
-  (println "Got unhandled bus message:" (bus/topic message))
-  (prn message))
-
-(defmethod bus->web :pages/new [notificator message]
-  (let [db (:db notificator)
-        file (:file/id message)]
-    ;; TODO(mu): Also add relevant documents
-    {:message/topic :pages/new
-     :pages (m/page-ids db file)}))
-
-;;; TODO: Auto-dissoc :pepa.bus/topic
-(defmethod bus->web :files/new [notificator message]
-  (-> message
-      (select-keys [:files])
-      (assoc :message/topic :files/new)))
-
-(defmethod bus->web :inbox/new [notificator message]
-  (-> message
-      (select-keys [:pages])
-      (assoc :message/topic :inbox/new)))
-
-(defmethod bus->web :inbox/removed [notificator message]
-  (-> message
-      (select-keys [:pages])
-      (assoc :message/topic :inbox/removed)))
-
-(defmethod bus->web :documents/new [notificator message]
-  (-> message
-      (dissoc :pepa.bus/topic)))
-
-(defmethod bus->web :documents/updated [notificator message]
-  (-> message
-      (dissoc :pepa.bus/topic)
-      (assoc :message/topic :document/updated)))
-
-(extend-type Notificator
-  component/Lifecycle
-  (start [component]
-    (println ";; Starting web notificator")
-    (let [messages (bus/subscribe-all (:bus component))
-          input (async/chan)
-          output (async/mult input)]
-      (async/thread
-        (loop []
-          (when-let [message (<!! messages)]
-            (when-let [lock ((set db/advisory-locks) (bus/topic message))]
-              (db/with-transaction [db (:db component)]
-                (db/advisory-xact-lock! db lock)))
-            (when-let [web-message (bus->web component message)]
-              (println "sending web message..." (pr-str web-message)))
-            (recur))))
-      (assoc component
-             :output output)))
-
-  (stop [component]
-    (println ";; Stopping web notificator")
-    (async/untap-all (:output component))
-    (dissoc component :output)))
-
-(defn make-component []
-  (map->Notificator {}))


Fix temp path function within tests

Fix temp path function within tests

--- src/test/hawk/test_helper.clj
+++ src/test/hawk/test_helper.clj
@@ -6,7 +6,10 @@
 (def timeout 30000)

 (defn new-temp-path []
-  (str (System/getProperty "java.io.tmpdir") (gensym "hawk") "/"))
+  (.getPath
+   (io/file
+    (System/getProperty "java.io.tmpdir")
+    (str (gensym "hawk")))))

 (defn create-file [file]
   (doto file .createNewFile))


(maint) Updates to `ezbake build`

(maint) Updates to `ezbake build`

Migrate `ezbake build` to calling the new tasks and add `ezbake
legacy-build` to maintain existing functionality. These changes to
`ezbake build` should be nearly transparent, the only real change is
that you will need to pass in a jenkins auth token since all modern
jenkins instances use authentication.

--- src/puppetlabs/ezbake/core.clj
+++ src/puppetlabs/ezbake/core.clj
@@ -819,6 +819,14 @@
   (action "stage" lein-project build-target)
   (exec/exec "rake" "package:bootstrap" :dir staging-dir)
   (let [downstream-job nil
+        rake-call ["rake" "pl:jenkins:trigger_build_local_auth"]]
+    (exec/lazy-sh rake-call {:dir staging-dir})))
+
+(defmethod action "legacy-build"
+  [_ lein-project build-target]
+  (action "stage" lein-project build-target)
+  (exec/exec "rake" "package:bootstrap" :dir staging-dir)
+  (let [downstream-job nil
         rake-call ["rake" "pl:jenkins:uber_build[5]"]]
     (exec/lazy-sh rake-call {:dir staging-dir})))


nicer stats page more device tweaking

nicer stats page
more device tweaking

--- src/unspun/screens/stats.cljs
+++ src/unspun/screens/stats.cljs
@@ -41,18 +41,18 @@
 (defn story-icon [palette name]
   (n-icon {:name  name
            :key   (gensym "story")
-           :style {:flex       0
-                   :width      50
-                   :marginLeft 20
+           :style {:flex  0
+                   :width 30
                    ;:borderWidth 1
                    ;:borderColor "red"
-                   :color      (:text-icons palette)
-                   :transform  [{:scale (iscale 1.5)}]}
+                   :color (:text-icons palette)
+                   ;:transform  [{:scale (iscale 1.5)}]
+                   }
            }))

 (defn show-icon
   [palette]
-  (n-icon {:name  "ios-arrow-forward"
+  (n-icon {:name  "ios-open-outline"
            :key   (gensym "icon-foo")
            :style {:width           30
                    :flex            0
@@ -147,8 +147,6 @@
                                             :alignItems     "center"
                                             :padding        0}}
                                    (view {:style {:flex        0
-                                                  :borderColor "red"
-                                                  :borderWidth 1
                                                   :marginLeft  tffsz}}
                                          (story-icon palette (:icon scenar)))
                                    (view {:style {:flex         1


Fix typo

Fix typo

--- src-cljs/frontend/components/documentation.cljs
+++ src-cljs/frontend/components/documentation.cljs
@@ -101,7 +101,7 @@
                    :src (-> "/img/outer/docs/%s.svg" (gstring/format slug) utils/cdn-path)}]
             [:h3 (:title category)]
             [:ul.list-unstyled
-             [:li [:a {:href (-> category :chilren first :url)}
+             [:li [:a {:href (-> category :children first :url)}
                    (-> category :children first :title)]]
              [:li [:a {:href (:url category)} [:em (gstring/format "%d more" (-> category :children rest count))]]]]]))]])))


Fix indenting

Fix indenting

--- src-cljs/frontend/components/pieces/topbar.cljs
+++ src-cljs/frontend/components/pieces/topbar.cljs
@@ -21,10 +21,10 @@
           [:div
            [:div.navs-container
             [:a.logomark.hidden-sm-down {:href "/dashboard"
-                          :aria-label "Dashboard"}
+                                         :aria-label "Dashboard"}
              (common/ico :logo)]
             [:a.logomark-narrow.hidden-md-up {:href "/dashboard"
-                          :aria-label "Dashboard"}
+                                              :aria-label "Dashboard"}
              [:img {:src (utils/cdn-path "/img/inner/icons/Logo-Wordmark.svg")}]]
             [:ul.nav-items.collapsing-nav
               [:li
@@ -43,73 +43,73 @@
                 [:a.has-icon {:href "/team"
                               :aria-label "Teams"}
                   [:i.material-icons "group"] "Teams"]]]
-             [:ul.nav-items.nav-items-left.collapsing-nav
-              [:li
-                [:a.has-icon {:href "/build-insights"
-                              :aria-label "System Status"}
-                  [:i.material-icons.status.operational "grain"] "System Status"]] ;; blur_on leak_add network_check
-              [:li.dropdown
-               [:button.dropdown-toggle
-                {:data-toggle "dropdown"
-                 :aria-haspopup "true"
-                 :aria-expanded "false"}
-                 "What's New" [:i.material-icons "keyboard_arrow_down"]]
-               [:ul.dropdown-menu.pull-right.animated.slideInDown
-                (when-not (config/enterprise?)
-                  [:li [:a (html/open-ext {:href "https://circleci.com/changelog/"}) "Changelog"]])
-                  [:li [:a (html/open-ext {:href "https://discuss.circleci.com/c/announcements"}) "Announcements"]]]]
-              [:li.dropdown
-               [:button.dropdown-toggle
-                {:data-toggle "dropdown"
-                 :aria-haspopup "true"
-                 :aria-expanded "false"}
-                "Get Help" [:i.material-icons "keyboard_arrow_down"] ]
-               [:ul.dropdown-menu.pull-right.animated.slideInDown
-                [:li
+            [:ul.nav-items.nav-items-left.collapsing-nav
+             [:li
+               [:a.has-icon {:href "/build-insights"
+                             :aria-label "System Status"}
+                 [:i.material-icons.status.operational "grain"] "System Status"]] ;; blur_on leak_add network_check
+             [:li.dropdown
+              [:button.dropdown-toggle
+               {:data-toggle "dropdown"
+                :aria-haspopup "true"
+                :aria-expanded "false"}
+               "What's New" [:i.material-icons "keyboard_arrow_down"]]
+              [:ul.dropdown-menu.pull-right.animated.slideInDown
+               (when-not (config/enterprise?)
+                 [:li [:a (html/open-ext {:href "https://circleci.com/changelog/"}) "Changelog"]])
+               [:li [:a (html/open-ext {:href "https://discuss.circleci.com/c/announcements"}) "Announcements"]]]]
+             [:li.dropdown
+              [:button.dropdown-toggle
+               {:data-toggle "dropdown"
+                :aria-haspopup "true"
+                :aria-expanded "false"}
+               "Get Help" [:i.material-icons "keyboard_arrow_down"]]
+              [:ul.dropdown-menu.pull-right.animated.slideInDown
+               [:li
                  ;; FIXME: NEED TO ADD QUICK START PAGE
-                 [:a {:href "/quick-start"}
-                  "Quick Start"]]
-                [:li
-                 [:a (html/open-ext {:href "https://circleci.com/docs/"})
-                  "Docs"]]
-                [:li
-                 [:a (html/open-ext {:href "https://discuss.circleci.com/"})
-                  "Discuss"]]
-                [:li
+                [:a {:href "/quick-start"}
+                 "Quick Start"]]
+               [:li
+                [:a (html/open-ext {:href "https://circleci.com/docs/"})
+                 "Docs"]]
+               [:li
+                [:a (html/open-ext {:href "https://discuss.circleci.com/"})
+                 "Discuss"]]
+               [:li
                  ;; FIXME: NEED TO ADD LINK TO SUPPORT
-                 [:a.support-info {:href "/suport"}
-                  "Support"]]
-                [:li
-                 [:a (html/open-ext {:href "/"})
-                  "Suggest a feature"]]
-                [:li
-                 [:a (html/open-ext {:href "/"})
-                  "Report an issue"]]]]
+                [:a.support-info {:href "/suport"}
+                 "Support"]]
+               [:li
+                [:a (html/open-ext {:href "/"})
+                 "Suggest a feature"]]
+               [:li
+                [:a (html/open-ext {:href "/"})
+                 "Report an issue"]]]]

-              [:li.dropdown.user-menu
-               [:button.dropdown-toggle
-                {:data-toggle "dropdown"
-                 :aria-haspopup "true"
-                 :aria-expanded "false"}
-                [:img.gravatar {:src (gh-utils/make-avatar-url user :size 60)}]]
-               [:ul.dropdown-menu.pull-right.animated.slideInDown
-                [:li [:a {:href "/account"} "User Settings"]]
-                (when (:admin user)
-                  [:li [:a {:href "/admin"} "Admin"]])
-                [:li [:a {:href "/logout/"} "Logout"]]]]]
+             [:li.dropdown.user-menu
+              [:button.dropdown-toggle
+               {:data-toggle "dropdown"
+                :aria-haspopup "true"
+                :aria-expanded "false"}
+               [:img.gravatar {:src (gh-utils/make-avatar-url user :size 60)}]]
+              [:ul.dropdown-menu.pull-right.animated.slideInDown
+               [:li [:a {:href "/account"} "User Settings"]]
+               (when (:admin user)
+                 [:li [:a {:href "/admin"} "Admin"]])
+               [:li [:a {:href "/logout/"} "Logout"]]]]]

-             [:ul.nav-items.nav-items-left.hidden-md-up
-              [:li
-                [:a.has-icon {:href "/build-insights"
-                              :aria-label "Status"}
-                  [:i.material-icons.status.operational "grain"]]]] ;; blur_on leak_add network_check
-             [:button.navbar-toggler.hidden-md-up {:type "button"
-                                                           :data-toggle "collapse"
-                                                           :data-target "collapsing-nav"
-                                                           :aria-controls "collapsing-nav"
-                                                           :aria-expanded "false"
-                                                           :aria-label "Toggle navigation"}
-                [:i.material-icons "menu"]]]])))))
+            [:ul.nav-items.nav-items-left.hidden-md-up
+             [:li
+               [:a.has-icon {:href "/build-insights"
+                             :aria-label "Status"}
+                 [:i.material-icons.status.operational "grain"]]]] ;; blur_on leak_add network_check
+            [:button.navbar-toggler.hidden-md-up {:type "button"
+                                                          :data-toggle "collapse"
+                                                          :data-target "collapsing-nav"
+                                                          :aria-controls "collapsing-nav"
+                                                          :aria-expanded "false"
+                                                          :aria-label "Toggle navigation"}
+               [:i.material-icons "menu"]]]])))))

 (dc/do
   (defcard topbar


Remove unused nav links

Remove unused nav links

--- src-cljs/frontend/components/pieces/topbar.cljs
+++ src-cljs/frontend/components/pieces/topbar.cljs
@@ -81,17 +81,7 @@
                  "Suggest a feature"]]
                [:li
                 [:a (html/open-ext {:href "https://discuss.circleci.com/c/bug-reports"})
-                 "Report an issue"]]
-               [:li
-                   ;; FIXME: NEED TO ADD QUICK START PAGE
-                  [:a {:href "/quick-start"}
-                   "Quick start"]]
-               [:li
-                 [:a.has-icon {:href "/build-insights"
-                               :aria-label "System status"}
-                  "System status" [:i.material-icons.status.operational "grain"]]]]] ;; blur_on leak_add network_check
-
-
+                 "Report an issue"]]]]
              [:li.dropdown.user-menu
               [:button.dropdown-toggle
                {:data-toggle "dropdown"
@@ -103,12 +93,6 @@
                (when (:admin user)
                  [:li [:a {:href "/admin"} "Admin"]])
                [:li [:a {:href "/logout/"} "Log out"]]]]]
-
-            [:ul.nav-items.nav-items-left.hidden-md-up
-             [:li
-               [:a.has-icon {:href "/build-insights"
-                             :aria-label "Status"}
-                 [:i.material-icons.status.operational "grain"]]]] ;; blur_on leak_add network_check
             [:button.navbar-toggler.hidden-md-up {:type "button"
                                                           :data-toggle "collapse"
                                                           :data-target "collapsing-nav"


Fix #454, add missing gobj/set parameter

--- src/reagent/impl/template.cljs
+++ src/reagent/impl/template.cljs
@@ -47,7 +47,7 @@
     (if-some [k' (cache-get prop-name-cache (name k))]
       k'
       (let [v (util/dash-to-prop-name k)]
-        (gobj/set prop-name-cache (name k))
+        (gobj/set prop-name-cache (name k) v)
         v))
     k))


Tweak to resilient decoder multipart parsing functions.

--- src/ais/resilient_decoder.clj
+++ src/ais/resilient_decoder.clj
@@ -146,11 +146,11 @@
           (recur (rest pairs) result)))
       result)))

-(defn send-multipart [frag-groups unpaired-frags out-ch]
+(defn parse-multipart [frag-groups unpaired-frags]
   (if-let [frag-set (assemble-multipart frag-groups)]
-    (async/>!! out-ch frag-set)
-    (doseq [match (find-matches! frag-groups unpaired-frags)]
-      (async/>!! out-ch match))))
+    (list frag-set)
+    (for [match (find-matches! frag-groups unpaired-frags)]
+      match)))

 (defn passthru? [supported-types m]
   (or
@@ -178,12 +178,12 @@
                   (if (nil? (group-key line))
                     (recur (inc dropped) invalid) ; untagged multipart fragment -- can't deterministically group
                     (let [lines (conj (consume (- (m "frag-count") 1) in-ch) line)
-                          all-groups (group-fragments lines)
-                          frag-groups (dissoc all-groups :drop :send)]
-                      (doseq [msg (all-groups :send)]
+                          groups (group-fragments lines)]
+                      (doseq [msg (groups :send)]
                         (async/>!! out-ch [msg]))
-                      (send-multipart frag-groups unpaired-frags out-ch)
-                      (recur (+ dropped (count (all-groups :drop))) invalid))))
+                      (doseq [msg (parse-multipart (dissoc groups :drop :send) unpaired-frags)]
+                        (async/>!! out-ch msg))
+                      (recur (+ dropped (count (groups :drop))) invalid))))
                 (recur (inc dropped) invalid)))
             (do
               (logging/debug (format "Invalid message syntax: %s" line))


get zones

get zones

--- stuf/src/sandbox/4clojure.clj
+++ stuf/src/sandbox/4clojure.clj
@@ -1135,5 +1135,19 @@
   (let [base (quot (count t) 2)]
     (get-in t [(+ base y) (+ base x)])))

-(defn divs [x]
-  (for [i (range 1 (inc x)) j (range 1 (inc x)) :when (= x (* i j))] [i j]))
+(defn divs [len x]
+  (for [i (range 1 (inc len)) j (range 1 (inc len)) :when (= x (* i j))] [i j]))
+
+(defn pows [lim]
+  (for [i (iterate #(* 2 %) 1) :while (< i lim)] i))
+
+(defn zone [ktor [start-y start-x] [y x]]
+  (for [dy (range y) dx (range x)]
+    (get-in-tor ktor [(- start-y dy) (- start-x dx)])))
+
+(defn zones [kmap point]
+  (let [ktor (torus kmap)
+        len (count kmap)
+        corners (mapcat #(divs len %) (pows (* len len)))]
+    (map #(zone ktor point %) corners)))
+


Add more "Basic" statistics

Add more "Basic" statistics

--- src/clj/clojurewerkz/statistiker/statistics.clj
+++ src/clj/clojurewerkz/statistiker/statistics.clj
@@ -1,5 +1,6 @@
 (ns clojurewerkz.statistiker.statistics
-  (:import [org.apache.commons.math3.stat.descriptive.rank Percentile])
+  (:import [org.apache.commons.math3.stat.descriptive.rank Percentile]
+           [org.apache.commons.math3.stat StatUtils])
   (:require [clojurewerkz.statistiker.fast-math :refer [sqrt pow]]))

 (defn mean
@@ -25,8 +26,19 @@

 (defn geometric-mean
   [values]
-  (pow (reduce * values) (/ 1 (count values))))
+  (StatUtils/geometricMean (double-array values)))

+(defn mode
+  [values]
+  (vec (StatUtils/mode (double-array values))))
+
+(defn normalize
+  [values]
+  (vec (StatUtils/normalize (double-array values))))
+
+(defn product
+  [values]
+  (StatUtils/product (double-array values)))

 (def ^:private percentile-mappings
   {:min    1
@@ -60,12 +72,12 @@

 (defn percentiles
   [values percentiles]
-  (let [p              (Percentile.)
-        _              (.setData p (double-array values))]
+  (let [p (Percentile.)
+        _ (.setData p (double-array values))]
     (mapv #(.evaluate p (double %)) percentiles)))

 (defn percentile
   [values percentile]
-  (let [p              (Percentile.)
-        _              (.setData p (double-array values))]
+  (let [p (Percentile.)
+        _ (.setData p (double-array values))]
     (.evaluate p (double percentile))))


checking exit code and logging output on success

--- src/com/narkisr/celestial/puppet_standalone.clj
+++ src/com/narkisr/celestial/puppet_standalone.clj
@@ -31,11 +31,14 @@
 (defn copy [server module]
   (put (:host server) (str (module :src) (module :name) ".tar.gz")  "/tmp"))

-(defn execute [server & batch]
-  (let [agent (ssh-agent {}) session (session agent (server :host) ssh-opts) ]
-    (with-connection session
-      (let [result (ssh session {:in  (join "\n" batch ) })]
-        (println result)))))
+(defn execute [{:keys [host]} & batch]
+  (with-session host
+    (fn [session]
+      (with-connection session
+        (let [{:keys [out exit] :as result} (ssh session {:in  (join "\n" batch ) })]
+          (if (= exit 0)
+            (debug out)
+            (throw+ (assoc result :type ::exec) "Failed to execute remotly")))))))

 (defn extract [server module]


moved pintar to the right alphabetical order

--- src/babel/espanol/lexicon.clj
+++ src/babel/espanol/lexicon.clj
@@ -140,9 +140,6 @@

    "echar" {:synsem {:cat :verb
                      :sem {:pred :throw-out}}}
-
-   "pintar" {:synsem {:cat :verb
-                      :sem {:pred :paint}}}

    "el"
    (unify determiner
@@ -330,7 +327,11 @@
     "pensar" {:spanish {:boot-stem1 "piens"
                         :boot-stem2 "pens"}
              :synsem {:cat :verb
-                      :sem {:pred :think}}}
+                      :sem {:pred :think}}}
+
+
+    "pintar" {:synsem {:cat :verb
+                      :sem {:pred :paint}}}

    "quedarse" (let [subject-semantics (ref {:animate true})
                     subject-agr (ref :top)]


Make web component idempotent

Make web component idempotent

--- clstreams/src/clstreams/webapi/component.clj
+++ clstreams/src/clstreams/webapi/component.clj
@@ -7,15 +7,19 @@
   component/Lifecycle

   (start [component]
-    (log/info "Starting web server")
-    (let [handler (app-factory component)
-          server (aleph/start-server handler config)]
-      (assoc component :server server)))
+    (if server
+      component
+      (do (log/info "Starting web server")
+          (let [handler (app-factory component)
+                server (aleph/start-server handler config)]
+            (assoc component :server server)))))

   (stop [component]
-    (log/info "Stopping web server")
-    (.close (:server component))
-    (assoc component :server nil)))
+    (if server
+      (do (log/info "Stopping web server")
+          (.close server)
+          (assoc component :server nil))
+      component)))

 (defn new-aleph [app-factory config]
   (map->AlephWebServer {:app-factory app-factory :config config}))


adding core/console-log helper function

adding core/console-log helper function

also replacing all direct calls to js/console.log and println with console-log

--- src/saved_for_reddit/core.cljs
+++ src/saved_for_reddit/core.cljs
@@ -22,6 +22,10 @@

 (enable-console-print!)

+;; helper function to print to js/console
+(defn console-log [msg & more-msgs]
+  (.log js/console (str msg more-msgs)))
+
 ;; setting reddit-api properties for dev or prod
 (if (= "pvik.github.io" (get (clojure.string/split (str (.-location js/window)) #"/") 2))
   (do
@@ -42,11 +46,11 @@
     (if (= "saved-for-reddit-app-state"
            (re-find #"saved-for-reddit-app-state" (.key js/localStorage c)))
       (do
-        (println c)
+        (.log js/console c)
         (reset! app-state-exists? true)))))

 (if (not app-state-exists?)
-  (println "app-state-does not exists"))
+  (console-log "app-state-does not exists"))

 ;; save app data in local-storage so that it doesn't get over-written on page reload
 (defonce app-state (local-storage (r/atom {:username ""
@@ -58,6 +62,7 @@
 (def saved-posts (r/atom {}))
 (def subreddits (r/atom {}))
 (def get-posts? (r/atom true))
+

 (defn clear-and-refresh-app []
   (alandipert.storage-atom/remove-local-storage! :saved-for-reddit-app-state)
@@ -76,13 +81,13 @@

 (defn reddit-get-username [token callback]
   ;; request username
-  (js/console.log "in get-username")
+  (console-log "in get-username")
   (go (let [response (<! (http/get "https://oauth.reddit.com/api/v1/me"
                                    {:with-credentials? false
                                     :oauth-token token}))
             body  (:body response)
             error (:error body)]
-        (println body)
+        (console-log body)
         (if (or (nil? error) (clojure.string/blank? error))
           (let [username (:name body)]
             (set-app-state-field :username username))
@@ -92,9 +97,9 @@

 (defn reddit-request-auth-token [client-id redirect-uri code state callback]
   ;; request reddit api token from code provided by reddit
-  (js/console.log "in reddit-request-auth-token")
-  (js/console.log "checking is state returned from reddit api is same as randomly generated in webapp")
-  (js/console.log (str "state in app-state is " (:state @app-state)))
+  (console-log "in reddit-request-auth-token")
+  (console-log "checking is state returned from reddit api is same as randomly generated in webapp")
+  (console-log (str "state in app-state is " (:state @app-state)))
   (if (not (= state (:state @app-state)))
     (handle-error "Invalid state returned from reddit."))
   (go
@@ -110,7 +115,7 @@
           ;;{:keys [error access-token]} body
           error  (:error body)
           access-token (:access_token body)]
-      (println response) ;; will it block here till body is available?
+      (console-log response) ;; will it block here till body is available?
       (if (clojure.string/blank? error)
         (set-app-state-field :token access-token)
         (handle-error error)))
@@ -120,8 +125,8 @@
 ;; Starting point
 ;; making sure reddit api is initialized properly and proceed accordingly
 (defn init []
-  (println "Initiazlizing...")
-  (println @app-state)
+  (console-log "Initiazlizing...")
+  (console-log @app-state)
   (let [query-vars (keywordize-keys (:query (url/url (-> js/window .-location .-href)))) ;; obtain all GET query params, if present
         code (:code query-vars)
         state (:state query-vars)
@@ -134,32 +139,32 @@
           ;; redirect to reddit for requesting authorization
           (let [gen-state (clojure.string/replace (str (rand 50)) "." "")]
             (set-app-state-field :state gen-state)
-            (println @app-state)
+            (console-log @app-state)
             (set! (.-location js/window) (reddit-auth-url client-id redirect-uri gen-state)))
           ;; code query param is not nil or token is populated in app state
           (do
-            (println @app-state)
+            (console-log @app-state)
             (if (clojure.string/blank? (:token @app-state))
               ;; app-state does not contain auth-token
               ;; retreive auth-token from reddit api
               (let [auth-token-callback-chan (chan)
                     username-callback-chan (chan)]
-                (js/console.log "acquiring auth token")
+                (console-log "acquiring auth token")
                 (reddit-request-auth-token client-id redirect-uri code state auth-token-callback-chan)
                 ;; start process that waits for auth-token; before obtaining username
                 (go (let [token (<! auth-token-callback-chan)]
-                      (js/console.log "received callback from request-auth-token")
-                      (js/console.log (str "reeceived token " token))
+                      (console-log "received callback from request-auth-token")
+                      (console-log (str "reeceived token " token))
                       (reddit-get-username token username-callback-chan)))
                 ;; starts process that waits for username; before retreiving all posts
                 (go (let [username (<! username-callback-chan)]
-                      (js/console.log "received callback from get-username")
+                      (console-log "received callback from get-username")
                       (get-all-saved-posts (:token @app-state) username saved-posts))))
               ;; all reddit auth and setup is already in app-state
               ;;  retreive all saved posts
               (get-all-saved-posts (:token @app-state) (:username @app-state) saved-posts))))
         ;; render html doms
-        (println subreddits)
+        (console-log subreddits)
         (r/render-component [loggedin-html (:username @app-state)] (dommy/sel1 :#loggedin))
         (r/render-component [search-bar-html] (dommy/sel1 :#search-form))
         (r/render-component [main-html app-state saved-posts subreddits] (dommy/sel1 :#app)))


Added a save button on the temp front page

--- src/wishlistd/views/common.clj
+++ src/wishlistd/views/common.clj
@@ -42,7 +42,9 @@
                 [:div.content
                  [:div.page-header
                   [:h1 "Wishlistd"]
-                  [:input {:id "create-wishlist" :class "btn primary" :type "submit" :value "Create wishlist" :style "margin-left:550px;margin-right:-100px"}]]
+                  [:p {:style "margin-left:550px;margin-right:-100px"}
+                   [:input {:id "save-wishlist" :class "btn primary" :type "submit" :value "Save wishlist"}]
+                   [:input {:id "create-wishlist" :class "btn primary" :type "submit" :value "New wishlist"}]]]
                 [:div.row
                  [:div.span10
                   content]]]


Handle nil text for message event.

Handle nil text for message event.

--- src/defbot/bot.clj
+++ src/defbot/bot.clj
@@ -83,7 +83,7 @@

 (defmethod handle-event :message
   [{:keys [channel text]} state send!]
-  (when (.startsWith text ",")
+  (when (and text (.startsWith text ","))
     (try
       (let [form (clojail/safe-read (unescape-html-entities text))
             _ (log/debugf "read form for eval: '%s'" (pr-str form))


Refactor async-pipeline-go counting.

Refactor async-pipeline-go counting.

--- src/dsbdp/main.clj
+++ src/dsbdp/main.clj
@@ -239,16 +239,16 @@
                                    (fn []
                                      (async/<!! out-chan)
                                      (.inc out-cntr))))
-          async-count-channel (when
-                                (and
-                                  (.endsWith scenario "-async-pipeline-go")
-                                  (not (nil? in-data)))
-                                (println "Starting async-pipeline-go counting.")
-                                (async/go
-                                  (loop []
-                                    (async/<! out-chan)
-                                    (.inc ^Counter out-cntr)
-                                    (recur))))
+          async-count-go (when
+                           (and
+                             (.endsWith scenario "-async-pipeline-go")
+                             (not (nil? in-data)))
+                           (println "Starting async-pipeline-go counting.")
+                           (async/go
+                             (loop []
+                               (async/<! out-chan)
+                               (.inc ^Counter out-cntr)
+                               (recur))))
           async-pipeline (if
                            (and
                              (.contains scenario "-async-pipeline")


Integrate new out-fn.

Integrate new out-fn.

--- src/dsbdp/main.clj
+++ src/dsbdp/main.clj
@@ -284,13 +284,13 @@
                        (not (.contains scenario "async-pipeline")))
                      (create-local-processing-pipeline
                        @proc-fns
-                       (fn [_ _]
-                         (.inc out-cntr))))
+                       (fn [in _]
+                         (out-fn in))))
           in-chan (if (.contains scenario "async-pipeline")
                     (async/chan queue-size))
           out-chan (if (.contains scenario "async-pipeline")
                      (async/chan queue-size))
-          in-fn (prepare-in-fn options scenario in-data in-cntr out-cntr in-chan pipeline queue-size)
+          in-fn (prepare-in-fn options scenario in-data in-cntr out-fn in-chan pipeline queue-size)
           in-loop (ProcessingLoop.
                     "DataGenerationLoop"
                     in-fn)
@@ -301,8 +301,7 @@
                                  (ProcessingLoop.
                                    "AsyncOutputCountLoop"
                                    (fn []
-                                     (async/<!! out-chan)
-                                     (.inc out-cntr))))
+                                     (out-fn (async/<!! out-chan)))))
           async-count-go (when
                            (and
                              (.endsWith scenario "-async-pipeline-go")
@@ -310,8 +309,7 @@
                            (println "Starting async-pipeline-go counting.")
                            (async/go
                              (loop []
-                               (async/<! out-chan)
-                               (.inc ^Counter out-cntr)
+                               (out-fn (async/<! out-chan))
                                (recur))))
           direct-proc-fn (create-direct-proc-fn scenario)
           async-pipeline (if


Add :print-and-braille as a genre

Add :print-and-braille as a genre

so it will be sorted correctly

--- src/catalog/layout/common.clj
+++ src/catalog/layout/common.clj
@@ -15,7 +15,7 @@
 (def game-genres [:lernspiel :solitairspiel :denkspiel :geschicklichkeitsspiel
                   :kartenspiel :legespiel :rollenspiel :würfelspiel :ratespiel
                   :bücher-über-spiel])
-(def braille-genres (conj genres :musiknoten :taktilesbuch))
+(def braille-genres (conj genres :print-and-braille :taktilesbuch :musiknoten))
 (def subgenres [;; Belletristik
                 :action-und-thriller :beziehungsromane :fantasy-science-fiction
                 :gesellschaftsromane :historische-romane :hörspiele :krimis


Add source entry to gamepad events.

Add source entry to gamepad events.

--- src/org/playasophy/wonderdome/input/gamepad.clj
+++ src/org/playasophy/wonderdome/input/gamepad.clj
@@ -39,10 +39,10 @@
           new-val (get new-state button)]
       (cond
         (and new-val (not old-val))
-        {:type :button/press, :button button}
+        {:type :button/press, :button button, :source :gamepad}

         (and old-val (not new-val))
-        {:type :button/release, :button button}))))
+        {:type :button/release, :button button, :source :gamepad}))))

 (defn- repeat-events


browser REPL needs to respect :output-dir

--- src/clj/cljs/repl/browser.clj
+++ src/clj/cljs/repl/browser.clj
@@ -282,10 +282,12 @@
         opts (merge (BrowserEnv.)
                {:port           9000
                 :optimizations  :simple
-                :working-dir    (->> [".repl" (util/clojurescript-version)]
-                                  (remove empty?) (string/join "-"))
+                :working-dir    (or (:output-dir opts)
+                                    (->> [".repl" (util/clojurescript-version)]
+                                      (remove empty?) (string/join "-")))
                 :serve-static   true
-                :static-dir     ["." "out/"]
+                :static-dir     (cond-> ["." "out/"]
+                                  (:output-dir opts) (conj (:output-dir opts)))
                 :preloaded-libs []
                 :src            "src/"
                 ::env/compiler  compiler-env


dont need that

dont need that

--- src/clj/shadow/cljs/build.clj
+++ src/clj/shadow/cljs/build.clj
@@ -1045,56 +1045,55 @@
    return resource maps with a :scan key which is either :new :modified :delete"
   [{:keys [logger sources] :as state}]
   (let [reloadable-paths (get-reloadable-source-paths state)]
-    (->>
-      (loop [i 0
-             sources (->>  (vals sources)
-                           (filter :file)
-                           (filter #(contains? reloadable-paths (:source-path %)))
-                           (into []))
-
-             known-files (->> sources
-                              (map (fn [{:keys [source-path name]}]
-                                     [source-path name]))
-                              (into #{}))]
-
-        (when (zero? i)
-          (log-progress logger (format "Watching %d files" (count sources))))
-
-
-        ;; don't scan for new files to frequently
-        ;; quite a bit more expensive than just checking a known file
-        (if (zero? (mod i 5))
-          ;; look for new files
-          (let [new-sources (->> reloadable-paths
-                                 (mapcat find-fs-resources)
-                                 (remove (fn [{:keys [source-path name]}]
-                                           (contains? known-files [source-path name])))
-                                 (map #(assoc % :scan :new))
-                                 (into []))]
-            (if (seq new-sources)
-              new-sources
-              (recur (inc i) sources known-files)))
-
-          ;; normal cycle
-          (let [modified (->> sources
-                              (reduce (fn [result {:keys [name ^File file last-modified] :as rc}]
-                                        (cond
-                                         (not (.exists file))
-                                         (conj result (assoc rc :scan :delete))
-
-                                         (> (.lastModified file) last-modified)
-                                         (conj result (assoc rc :scan :modified))
-
-                                         :else
-                                         result))
-                                      []))]
-            (if (seq modified)
-              modified
-
-              ;; nothing modified, wait and repeat
-              (do (Thread/sleep 500)
-                  (recur (inc i) sources known-files)))))
-        ))))
+    (loop [i 0
+           sources (->>  (vals sources)
+                         (filter :file)
+                         (filter #(contains? reloadable-paths (:source-path %)))
+                         (into []))
+
+           known-files (->> sources
+                            (map (fn [{:keys [source-path name]}]
+                                   [source-path name]))
+                            (into #{}))]
+
+      (when (zero? i)
+        (log-progress logger (format "Watching %d files" (count sources))))
+
+
+      ;; don't scan for new files to frequently
+      ;; quite a bit more expensive than just checking a known file
+      (if (zero? (mod i 5))
+        ;; look for new files
+        (let [new-sources (->> reloadable-paths
+                               (mapcat find-fs-resources)
+                               (remove (fn [{:keys [source-path name]}]
+                                         (contains? known-files [source-path name])))
+                               (map #(assoc % :scan :new))
+                               (into []))]
+          (if (seq new-sources)
+            new-sources
+            (recur (inc i) sources known-files)))
+
+        ;; normal cycle
+        (let [modified (->> sources
+                            (reduce (fn [result {:keys [name ^File file last-modified] :as rc}]
+                                      (cond
+                                       (not (.exists file))
+                                       (conj result (assoc rc :scan :delete))
+
+                                       (> (.lastModified file) last-modified)
+                                       (conj result (assoc rc :scan :modified))
+
+                                       :else
+                                       result))
+                                    []))]
+          (if (seq modified)
+            modified
+
+            ;; nothing modified, wait and repeat
+            (do (Thread/sleep 500)
+                (recur (inc i) sources known-files)))))
+      )))

 (defn wait-and-reload!
   "wait for modified files, reload them and return reloaded state"


Changes

Changes

--- src/cljs/cljweb/gen_prob.cljs
+++ src/cljs/cljweb/gen_prob.cljs
@@ -59,7 +59,6 @@

 ;; Checking answers
 (defn answer-handler [response]
-  (.log js/console response)
   (reset! current-time (.getTime (js/Date.)))
   (reset! counter 0)
   (random-problem))


Print 'Zero cases best number of zero cases'.

--- src/clojush/pushgp/report.clj
+++ src/clojush/pushgp/report.clj
@@ -170,6 +170,8 @@
     (println "Zero cases best number of elite cases:" (apply + (map #(if (== %1 %2) 1 0)
                                                                   (:errors most-zero-cases-best)
                                                                   min-error-by-case)))
+    (println "Zero cases best number of zero cases:" (apply + (map #(if (< %1 min-number-magnitude) 1 0)
+                                                                   (:errors most-zero-cases-best))))
     (println "Zero cases best total error:" (:total-error most-zero-cases-best))
     (println "Zero cases best mean error:" (float (/ (:total-error most-zero-cases-best)
                                                    (count (:errors most-zero-cases-best)))))


CMR-183: Added API for querying cache.

CMR-183: Added API for querying cache.

--- src/cmr/search/api/routes.clj
+++ src/cmr/search/api/routes.clj
@@ -280,6 +280,21 @@
         (query-svc/clear-cache request-context)
         {:status 204})

+      ;; Querying cache
+    (context "/caches" []
+      (GET "/" {:keys [params]}
+        {:status 200})
+      (GET "/:cache-name" {{:keys [cache-name] :as params} :params
+                           request-context :request-context
+                           headers :headers}
+        (let [context (acl/add-authentication-to-context request-context params headers)
+              ;_ (acl/verify-ingest-management-permission context :read)
+              result (keys (get-in context [:system :caches (keyword cache-name)]))]
+          (println "CACHES.....")
+          (println (get-in context [:system :caches]))
+          (when result {:status 200
+                        :body result}))))
+
       ;; Clears the cache.
       (POST "/clear-cache" {:keys [request-context params headers]}
         (acl/verify-ingest-management-permission


Store options data in the channel state structure

--- web-app/src/cljs/potato/core.cljs
+++ web-app/src/cljs/potato/core.cljs
@@ -431,7 +431,20 @@
                                                                             [])}))))))))

 (defn- handle-interactive-option [e]
-  (cljs.pprint/cl-format true "Interactive options command: ~s" e))
+  (cljs.pprint/cl-format true "Interactive options command: ~s" e)
+  (let [cid (:channel e)]
+    (om/transact! (state-root) [:channels cid :options]
+      (fn [_]
+        ;; We rewrite the JSON message from the server into the
+        ;; internal form here. The internal form is currently almost
+        ;; identical to the external form, so this conversion probably
+        ;; looks a bit weird.
+        {:title (:title e)
+         :code (:option-code e)
+         :options (map (fn [option]
+                         {:title (:title option)
+                          :code (:response option)})
+                       (:options e))}))))

 (defn dispatch-notification-entry [entry async-channel]
   (cljs.pprint/cl-format true "Got server message: ~s" entry)


Add bolth dep.

Add bolth dep.

--- .lein/profiles.clj
+++ .lein/profiles.clj
@@ -1,6 +1,7 @@
 {:user {:dependencies [[clj-stacktrace "0.2.8"]
                        [spyscope "0.1.5"]
                        [debugger "0.1.4"]
+                       [bolth "0.1.0"]
                        [com.aphyr/prism "0.1.2"]
                        [slamhound "1.5.5"]]
         :plugins [[lein-difftest "2.0.0"]


[#11690] Invisible digits in Request transaction dialog in 1-1 chat on Android

Signed-off-by: andrey <b713972e59b8e606e23253c4a13e948139fea4d1@gmail.com>

--- src/status_im/ui/screens/wallet/send/views.cljs
+++ src/status_im/ui/screens/wallet/send/views.cljs
@@ -171,7 +171,7 @@
                      :margin-vertical 16}
          [react/text-input
           {:style               {:font-size   38
-                                 :color       (when amount-error colors/red)
+                                 :color       (if amount-error colors/red colors/black)
                                  :flex-shrink 1}
            :keyboard-type       :decimal-pad
            :auto-capitalize     :words


Revert "ignore cljs test failure on jdk >= 1.9, due to CLJS-2377"

This reverts commit b73e53bcf74ab688ca4fedf362f66dece2e2b431.

--- src/test/clojure/clojure/data/xml/test_cljs.clj
+++ src/test/clojure/clojure/data/xml/test_cljs.clj
@@ -15,17 +15,12 @@
   (try
     (require 'clojure.data.xml.cljs-testsuite)
     (eval '(clojure.data.xml.cljs-testsuite/run-testsuite! "target/cljs-test-nashorn"))
-    (when (not (neg? (compare (System/getProperty "java.runtime.version")
-                              "1.9")))
-      (println "CELEBRATION: CLJS-2377 has been fixed. Hooray! Please add jdk >= 1.9 back to the test matrix"))
     (catch Exception e
       (if (or (neg? (compare ((juxt :major :minor) *clojure-version*)
                              [1 8]))
               (neg? (compare (System/getProperty "java.runtime.version")
-                             "1.8"))
-              (not (neg? (compare (System/getProperty "java.runtime.version")
-                                  "1.9"))))
-        (println "WARN: ignoring cljs testsuite error on clojure < 1.8 or jdk < 1.8 also on jdk >= 1.9, see CLJS-2377"
+                             "1.8")))
+        (println "WARN: ignoring cljs testsuite error on clojure < 1.8 or jdk < 1.8"
                  *clojure-version* (System/getProperty "java.runtime.name")
                  (System/getProperty "java.vm.version") (System/getProperty "java.runtime.version")
                  \newline (str e))


Also allow keywords when storing vals to app state

--- src/discuss/utils/common.cljs
+++ src/discuss/utils/common.cljs
@@ -53,9 +53,9 @@

   Example: (store-to-app-state! 'foo \"bar\")"
   [field value]
-  (store-multiple-values-to-app-state! [[field value]]))
+  (store-multiple-values-to-app-state! [[(symbol field) value]]))
 (s/fdef store-to-app-state!
-  :args (s/cat :field symbol? :value any?))
+  :args (s/cat :field (s/or :symbol symbol? :keyword keyword?) :value any?))

 (defn load-from-app-state
   "Load data from application state."


Update tools-deps to 1.11.1.1155

Update tools-deps to 1.11.1.1155


whitespace

whitespace

--- example/dev/example/core.cljs
+++ example/dev/example/core.cljs
@@ -3,7 +3,7 @@
    [figwheel.client :as fw]
    [example.core :as core])
   (:require-macros
-   [figwheel.client.utils :refer [enable-dev-blocks!]]   ))
+   [figwheel.client.utils :refer [enable-dev-blocks!]]))

 (enable-console-print!)


added :paredit-wrap-round / :paredit-wrap-square / :paredit-wrap-curly

--- ccw.core/src/ccw/editors/antlrbased/PareditAutoEditStrategy.clj
+++ ccw.core/src/ccw/editors/antlrbased/PareditAutoEditStrategy.clj
@@ -18,26 +18,25 @@
   [editor preference-store] [[] (ref {:editor editor :prefs-store preference-store})])

 ; TODO move this into paredit itself ...
-(def *one-char-command*
-  {"(" :paredit-open-round
-   "[" :paredit-open-square
-   "{" :paredit-open-curly
-   ")" :paredit-close-round
-   "]" :paredit-close-square
-   "}" :paredit-close-curly
-   "\"" :paredit-doublequote
-   "\t" :paredit-indent-line
-   "\n" :paredit-newline
+;  each command : trigger-str  [:paredit-command-name only-one-char-command?]
+(def *commands*
+  {"(" [:paredit-open-round true]
+   "[" [:paredit-open-square true]
+   "{" [:paredit-open-curly true]
+   ")" [:paredit-close-round true]
+   "]" [:paredit-close-square true]
+   "}" [:paredit-close-curly true]
+   "\"" [:paredit-doublequote true]
+   "\t" [:paredit-indent-line true]
+   "\n" [:paredit-newline true]
    })
+
+(defn par-command? [command] (contains? *commands* (:text command)))
+(defn par-command [command] (-> *commands* (get (:text command)) first))
+(defn one-char-par-command? [command] (-> *commands* (get (:text command)) second))

 (defn- call-paredit [command document-text]
   (cond
-    (and (zero? (:length command)) ; TODO enhance to also handle the replace of a bunch of text
-         (contains? *one-char-command* (:text command)))
-      (paredit (get *one-char-command* (:text command))
-               {:text (:text document-text)
-                :offset (:offset command)
-                :length 0})
     (and (zero? (-> command #^String (:text) .length))
          (= 1 (:length command)))
       (let [paredit-command (if (= (:offset command) (:caret-offset document-text))
@@ -45,8 +44,13 @@
         (paredit paredit-command
                  {:text (:text document-text)
                   :offset (if (= paredit-command :paredit-backward-delete) (inc (:offset command)) (:offset command))
-                  :length 1}))))
-
+                  :length 1}))
+    (and (par-command? command)
+         (one-char-par-command? command)) ; TODO enhance to also handle the replace of a bunch of text
+      (paredit (par-command command)
+               {:text (:text document-text)
+                :offset (:offset command)
+                :length (:length command)})))

 (defn paredit-enabled?
   [#^org.eclipse.jface.preference.IPreferenceStore prefs-store]
@@ -57,8 +61,12 @@
   (when (and (paredit-enabled? (-> this .state deref :prefs-store))
              (.doit command))
     (let [signed-selection (bean (-> this .state deref #^ccw.editors.antlrbased.AntlrBasedClojureEditor (:editor) .getSignedSelection))
-          document-text {:text (.get document) :caret-offset (+ (:offset signed-selection) (:length signed-selection)) :selection-length (:length signed-selection)}
+          _ (println (str "signed-selection:" signed-selection))
+          document-text {:text (.get document)
+                         :caret-offset (+ (:offset signed-selection) (:length signed-selection))
+                         :selection-length (:length signed-selection)}
           par-command {:text (.text command) :offset (.offset command) :length (.length command)}
+          _ (println (str "par-command:" par-command))
           result (call-paredit par-command document-text)]
       (when (and result (not= :ko (-> result :parser-state)))
         (if-let [modif (-?> result :modifs first)]
@@ -74,4 +82,7 @@
             (set! (.text command) "")
             (set! (.doit command) false)))
         (set! (.shiftsCaret command) false)
-        (set! (.caretOffset command) (:offset result))))))+        (set! (.caretOffset command) (:offset result))
+        (when-not (zero? (:length result))
+          (println (str "result:" result))
+          (.selectAndReveal (-> this .state deref :editor) (:offset result) (:length result)))))))


update boot-cljs

update boot-cljs

--- resources/leiningen/new/tenzing/build.boot
+++ resources/leiningen/new/tenzing/build.boot
@@ -1,7 +1,7 @@
 (set-env!
  :source-paths    {{{source-paths}}}
  :resource-paths  #{"resources"}
- :dependencies '[[adzerk/boot-cljs      "0.0-2629-8" :scope "test"]
+ :dependencies '[[adzerk/boot-cljs      "0.0-2629-9" :scope "test"]
                  [adzerk/boot-cljs-repl "0.1.8"      :scope "test"]
                  [adzerk/boot-reload    "0.2.4"      :scope "test"]
                  [pandeiro/boot-http    "0.5.2"      :scope "test"]{{{deps}}}])


Added additional keyword specific field tests.

--- test/cmr/system_int_test/search/collection_keyword_search_test.clj
+++ test/cmr/system_int_test/search/collection_keyword_search_test.clj
@@ -52,7 +52,8 @@
         coll15 (d/ingest "CMR_PROV2" (dc/collection {:entry-title "coll15" :processing-level-id "plid1"
                                                      :collection-data-type "cldt" :platforms [p1]
                                                      :summary "summary" :temporal-keywords ["tk1" "tk2"]}))
-        coll16 (d/ingest "CMR_PROV2" (dc/collection {:entry-id "entryid4"}) :dif)]
+        coll16 (d/ingest "CMR_PROV2" (dc/collection {:entry-id "entryid4"}) :dif)
+        coll17 (d/ingest "CMR_PROV2" (dc/collection {:associated-difs ["DIF-1" "DIF-2"]}))]

     (index/refresh-elastic-index)

@@ -65,7 +66,6 @@
                (println "Actual:" (map :name (:refs refs))))
              matches?)
            "ABC" [coll2 coll5]
-           "XYZ" [coll2 coll13]
            "place" [coll6]
            "Laser" [coll5 coll7 coll9 coll14]
            "ABC place Hurricane" [coll2 coll5 coll6 coll9]
@@ -100,13 +100,21 @@
            ;; temporal keywords
            "tk1" [coll15]

+           ;; spatial keywords
+           "in" [coll10]
+
+           ;; associated difs
+           "dif-1" [coll17]
+
+           ;; two d coord
+           "xyz" [coll2 coll13]
+
+           ;; archive center
+           "some" [coll6]

            ;; TODO
-           ;; spatial keywords
-           ;; associated dif
-           ;; two d coord
-           ;; archive center
            ;; attributes
+           "charlie" [coll12]

            ;; Platforms
            ;; - short name
@@ -138,11 +146,7 @@
            "Level2-2" [coll9]
            "Level2-3" [coll9]
            ;; - detailed-variable
-           "SUPER" [coll9]
-
-
-
-           ))
+           "SUPER" [coll9]))

     (testing "search by keywords using wildcard *."
       (are [keyword-str items]


better logging when deps cannot be resolved

--- src/cake/deps.clj
+++ src/cake/deps.clj
@@ -4,7 +4,7 @@
         [cake.utils :only [cake-exec]]
         [bake.core :only [log os-name os-arch]]
         [clojure.java.shell :only [sh]]
-        [clojure.string :only [split]]
+        [clojure.string :only [split join]]
         [useful.map :only [map-to]])
   (:require depot.maven
             [depot.deps :as depot])
@@ -43,7 +43,12 @@
   (binding [depot/*repositories* default-repos
             depot/*exclusions*   (when (= :dev-dependencies type)
                                    '[org.clojure/clojure org.clojure/clojure-contrib])]
-    (depot/fetch-deps *project* type)))
+    (try (depot/fetch-deps *project* type)
+         (catch org.apache.tools.ant.BuildException e
+           (println "\nUnable to resolve the following dependencies:\n")
+           (doall (map println (filter (partial re-matches #"\d+\) .*")
+                                       (split (.getMessage e) #"\n"))))
+           (println)))))

 (defn deps [type]
   (get @dep-jars type))


Making timeline

Making timeline

--- src/webapp/framework/client/system_globals.cljs
+++ src/webapp/framework/client/system_globals.cljs
@@ -153,3 +153,15 @@
                        :touch-id
                        (swap! touch-id inc)
                        ))))
+
+
+
+(def timeline (atom {}))
+
+(add-watch timeline  :change
+           (fn [_ _ old-val new-val]
+             (. js/console log (str "***** " new-val))
+             )
+           )
+
+(reset! timeline {:a 24})


Cleans up 'no acceptable compute cluster' log (#1988)

--- scheduler/src/cook/scheduler/scheduler.clj
+++ scheduler/src/cook/scheduler/scheduler.clj
@@ -991,7 +991,7 @@
     (when-let [jobs (:no-acceptable-compute-cluster compute-cluster->jobs)]
       (log/info "In" pool-name
                 "pool, there are jobs with no acceptable compute cluster for autoscaling"
-                {:first-10-jobs (take 10 jobs)}))
+                {:first-10-jobs (->> jobs (take 10) (map :job/uuid) (map str))}))
     (dissoc compute-cluster->jobs :no-acceptable-compute-cluster)))

 (defn trigger-autoscaling!


fix failing api_test due ns conflict

fix failing api_test due ns conflict

--- test/clj/swarmpit/api_test.clj
+++ test/clj/swarmpit/api_test.clj
@@ -1,21 +1,21 @@
 (ns swarmpit.api-test
-    (:require [clojure.test :refer :all]
-              [digest :refer [digest]]
-              [swarmpit.api :refer :all]
-              [swarmpit.config :refer [config]]
-              [swarmpit.couchdb.mapper.outbound :refer [->password]]))
+  (:require [clojure.test :refer :all]
+            [digest :refer [digest]]
+            [swarmpit.api :refer :all]
+            [swarmpit.config :as cfg]
+            [swarmpit.couchdb.mapper.outbound :refer [->password]]))

 (deftest password-check-test
   (let [pass "heslo"
         hashed (->password pass)]

     (testing "speed"
-      (swarmpit.config/update! {:password-hashing
-                                {:alg :pbkdf2+sha512 :iterations 100000}})
-      (println "Evaluating baseline" (config :password-hashing))
+      (cfg/update! {:password-hashing
+                    {:alg :pbkdf2+sha512 :iterations 100000}})
+      (println "Evaluating baseline" (cfg/config :password-hashing))
       (time (is (some? (->password pass))))
-      (swarmpit.config/update! {})
-      (println "Evaluating defaults" (config :password-hashing))
+      (cfg/update! {})
+      (println "Evaluating defaults" (cfg/config :password-hashing))
       (time (is (some? (->password pass)))))

     (testing "check"


Reset counter so the test can be run multiple times in repl.

--- test/cmr/common/test/cache.clj
+++ test/cmr/common/test/cache.clj
@@ -12,6 +12,7 @@
 (deftest cache-test
   (testing "cache hit, miss and reset"
     (let [cache-atom (c/create-cache)]
+      (reset! counter 0)
       (is (= 1 (c/cache-lookup cache-atom "key" increment-counter)))
       ;; look up again will not call the increment-counter function
       (is (= 1 (c/cache-lookup cache-atom "key" increment-counter)))


Stop infoing

Stop infoing

--- test/caesium/binding_test.clj
+++ test/caesium/binding_test.clj
@@ -63,7 +63,6 @@

 (declare check-method check-const-method)

-    (info method)
 (deftest interface-test
   (doseq [method (.getMethods Sodium)]
     (if-let [params (seq (.getParameters ^Method method))]


RR: Make tab links inactive if disabled

RR: Make tab links inactive if disabled

--- src/hatti/views/dataview.cljs
+++ src/hatti/views/dataview.cljs
@@ -105,11 +105,14 @@
             dataviews (->> app-state :views :all
                            (map dataview-map) (remove nil?))
             dv->link (fn [{:keys [view label]}]
-                       (if (and (= view :map) no-geodata?)
-                         [:a {:class "inactive" :title "No geodata"}
-                          (name view)]
-                         [:a {:href (str "#/" (name view))
-                              :class (view->cls view)} label]))]
+                       (let [active? (some #(= view %) (-> app-state :views :active))]
+                         (if (and (= view :map) no-geodata?)
+                           [:a {:class "inactive" :title "No geodata"}
+                            (name view)]
+                           [:a
+                            {:href (when active? (str "#/" (name view)))
+                             :class (if active? (view->cls view)
+                                                "inactive")} label])))]
         (html
          [:div.tab-container.dataset-tabs
           [:div.tab-bar


made defpoly work great

made defpoly work great

--- test/epicea/poly/core_test.clj
+++ test/epicea/poly/core_test.clj
@@ -149,8 +149,14 @@
                    '(kattskit :default mjao
                       ([[[:pred number?] a] b] (+ a b))
                       ([a] (* a a))))))
-(defpoly my-add
-   ([[[:pred number?] aa]
-     [[:pred number?] bb]]
-     (+ aa bb))
-   ([aa bb] (str aa " + " bb)))
+(defpoly my-add
+  ([[[:pred keyword?] a]] [:keyword a])
+  ([[[:pred number?] aa]
+    [[:pred number?] bb]]
+   (+ aa bb))
+  ([aa bb] (str aa " + " bb)))
+
+(deftest my-add-test
+  (is (= [:keyword :a] (my-add :a)))
+  (is (= 12 (my-add 9 3)))
+  (is (= "a + b" (my-add "a" "b"))))


Fix repetition of base-url constant for cascade climbers.

--- project/scrape-trs/src/scrape_trs/core.clj
+++ project/scrape-trs/src/scrape_trs/core.clj
@@ -29,8 +29,8 @@
 (defn get-implementation
   [url]
   (let [base-url (re-find #"https?://.*?/" url)]
-    (case base-url
-      "http://cascadeclimbers.com/" (cc/->CCScrapeTripReport))))
+    (condp = base-url
+      cc/base-url (cc/->CCScrapeTripReport))))

 (defn get-trip-reports
   ""


Bump cider-nrepl dependency

Bump cider-nrepl dependency

--- dot/lein/profiles.clj
+++ dot/lein/profiles.clj
@@ -1,7 +1,7 @@
 {:user
  {:plugins [[lein-vanity "0.2.0"]
             [jonase/eastwood "0.1.3"]
-            [cider/cider-nrepl "0.7.0-SNAPSHOT"]
+            [cider/cider-nrepl "0.8.0-SNAPSHOT"]
             [com.palletops/pallet-lein "0.8.0-alpha.1"]]
   :dependencies [[slamhound "1.5.0"]]
   :aliases {"slamhound" ["run" "-m" "slam.hound"]}}}


no-dommy dev fix up

no-dommy dev fix up

--- src-cljs/frontend/core.cljs
+++ src-cljs/frontend/core.cljs
@@ -322,14 +322,14 @@
     (.appendChild (.-head js/document) link)))

 (defn refresh-css! []
-  (doseq [link (goog.dom/getElementsByTagNameAndClass "link")
+  (doseq [link (utils/node-list->seqable (goog.dom/getElementsByTagNameAndClass "link"))
           :when (let [href (inspect (.getAttribute link "href"))]
                   (re-find #"/assets/css/app.*?\.css(?:\.less)?" href))]
     (.removeChild (.-head js/document) link))
   (add-css-link "/assets/css/app.css"))

 (defn fix-figwheel-css! []
-  (doseq [link (goog.dom/getElementsByTagNameAndClass "link")
+  (doseq [link (utils/node-list->seqable (goog.dom/getElementsByTagNameAndClass "link"))
           :when (re-find #"3449resources" (.getAttribute link "href"))]
     (add-css-link (string/replace (.getAttribute link "href") #"3449resources" "3449/resources"))
     (.removeChild (.-head js/document) link))


no need to deref the state again, we can just use swap!'s return value

--- src-cljs/frontend/core.cljs
+++ src-cljs/frontend/core.cljs
@@ -146,12 +146,12 @@
   (when true
     (mlog "Controls Verbose: " value))
   (binding [frontend.async/*uuid* (:uuid (meta value))]
-    (let [previous-state @state]
-      ;; TODO: control-event probably shouldn't get browser-state
-      (swap! state (partial controls-con/control-event browser-state (first value) (second value)))
-      (controls-con/post-control-event! browser-state (first value) (second value) previous-state @state)
+    (let [previous-state @state
+          ;; TODO: control-event probably shouldn't get browser-state
+          current-state (swap! state (partial controls-con/control-event browser-state (first value) (second value)))]
+      (controls-con/post-control-event! browser-state (first value) (second value) previous-state current-state)
       ;; TODO: enable a way to set the event separate from the control event
-      (analytics/track-control (first value)))))
+      (analytics/track-control (first value) current-state))))

 (defn nav-handler
   [value state history]


Adding re-frame to cljs part of project

Adding re-frame to cljs part of project

--- src-cljs/tea_time/core.cljs
+++ src-cljs/tea_time/core.cljs
@@ -5,7 +5,9 @@
             [goog.events :as events]
             [goog.history.EventType :as EventType]
             [markdown.core :refer [md->html]]
-            [ajax.core :as ajax :refer [GET POST]])
+            [ajax.core :as ajax :refer [GET POST]]
+            [re-frame.core :as re-frame])
+  (:require-macros [reagent.ratom :refer [reaction]])
   (:import goog.History))


Broke it.  assoc-in not working for ratoms?

--- src-cljs/tea_time/core.cljs
+++ src-cljs/tea_time/core.cljs
@@ -64,7 +64,7 @@
               {:__html (md->html docs)}}]]])])

-(def teas-list (reagent/atom nil))
+;; (def teas-list (reagent/atom nil))
 (def new-tea (reagent/atom nil))
 (def edit-tea-id (reagent/atom nil))
 (def edit-tea (reagent/atom nil))
@@ -81,8 +81,9 @@
 (defn get-teas
   "Gets the list of all teas from the website"
   []
-  (ajax/GET "/api/teas" :handler (fn [response] (reset! teas-list response))))
-
+  (ajax/GET "/api/teas" :handler (fn [response] (println (assoc-in app-db [:teas-list] response)))))
+
+ ;;(reset! app-db (assoc-in app-db [:teas-list] response))
 (defn delete-tea
   "Sends a get request that deletes the tea argument"
   [name]
@@ -119,7 +120,6 @@
   "The page component for listing tea"
   []
   (fn []
-    (get-teas)
     [:div.row
      [:ul
       [:table.table.table-striped
@@ -129,19 +129,19 @@
          [:th "Tea Name"]
          [:th "Edit"]]]
        [:tbody
-        (map (fn [tea] [tea @teas-list]
+        (map (fn [tea] ;[tea @teas-list]
                ^{:key tea}
                [:tr
                 [:td [:li]]
                 [:td (second tea)]
-                [:td [:input.btn.btn-success {:type "button" :value "Edit" :on-click (fn [_] (update-edit-form (first tea) (second tea)))}]]]) @teas-list)]]]]))
+                [:td [:input.btn.btn-success {:type "button" :value "Edit" :on-click (fn [_] (update-edit-form (first tea) (second tea)))}]]]) (:teas-list @app-db))]]]]))

 (defn sync-atom-to-event
-  [atom target-value]
-  (reset! atom (->
-                 target-value
-                 .-target
-                 .-value)))
+  [the-atom target-value]
+  (reset! the-atom (->
+                    target-value
+                    .-target
+                    .-value)))

 (def sync-new-tea (partial sync-atom-to-event new-tea))
 (def sync-edit-tea (partial sync-atom-to-event edit-tea))
@@ -236,5 +236,6 @@

 (defn init! []
   ;; (fetch-docs!)
+  (get-teas)
   (hook-browser-navigation!)
   (mount-components))


Use a set to filter services.

Use a set to filter services.

--- test/riemann/streams_test.clj
+++ test/riemann/streams_test.clj
@@ -541,7 +541,7 @@
                                [{:metric 2}]))

          (testing "using sets as predicates"
-                  (test-stream (where (service "service1" "service2"))
+                  (test-stream (where (service #{"service1" "service2"}))
                                [{:service "service1"}
                                 {:service "service2"}
                                 {:service "service-doesnt-match"}]


Remove insights dashboard LD feature flag

--- src-cljs/frontend/components/insights.cljs
+++ src-cljs/frontend/components/insights.cljs
@@ -415,8 +415,7 @@
              (om/build svg {:class "badge-icon"
                             :src (-> latest-build build/status-icon common/icon-path)})]
             [:span.project-name
-             (if (and (feature/enabled? :insights-dashboard)
-                      show-insights?)
+             (if show-insights?
                [:a {:href (routes/v1-insights-project-path {:org org-name
                                                             :repo repo-name
                                                             :branch (:default_branch project)