Chats sreen design

Chats sreen design

--- src/mobile_patient/events.cljs
+++ src/mobile_patient/events.cljs
@@ -8,6 +8,7 @@
    [re-frame.loggers :as rf.log]
    [mobile-patient.ui :as ui]
    [clojure.spec.alpha :as s]
+   [clojure.string :as str]
    [mobile-patient.db :as db :refer [app-db]]))

 (def warn (js/console.warn.bind js/console))
@@ -37,6 +38,7 @@
 ;; -- Views----------------------------------------------------------

 (def ds (ui/ReactNative.ListView.DataSource. #js{:rowHasChanged (fn[a b] false)}))
+(def font-size 18)

 (def chat-row-comp
   (r/reactify-component
@@ -44,24 +46,28 @@
      (let [row (props :row)
            navigation (props :navigation)
            chat @row]
-       [ui/touchable-highlight
-        {:style {:border-top-width 1 :border-color "#000"}
-         :on-press #(do
-                      (dispatch [:set-chat chat])
-                      (navigation.navigate "Chat" #js{:chat-name (:name chat)}))}
+       [ui/touchable-highlight {:on-press #(do
+                                             (dispatch [:set-chat chat])
+                                             (navigation.navigate "Chat" #js{:chat-name (:name chat)}))
+                                :underlay-color "white"}
         [ui/view {:style {:flex 1
                           :flex-direction :row
                           :margin-top 10
                           :margin-bottom 10
-                          :margin-left 10}}
+                          :margin-left 20}}
          [ui/view {:style {:flex 0.9}}
-          [ui/text {:style {:color "black"}}
+          [ui/text {:style {:color "black"
+                            :font-weight :bold
+                            :font-size font-size}}
            (:name chat)]
-          [ui/text "Participants: abafjalkfjalfkajfl;kajflkasjfalskfjaslkfjaslkfjaslfkasjflkasjflak;sjfaslk;fjaslkfjsalkfjaslkfsjaflksjflksjmslkafjslkmqpofmslad;kmn"]]
-         [ui/icon {:style {:flex 0.1}
-                   :name "chevron-right"
-                   :size 36
-                   :color color/pink}]]]))))
+          [ui/text {:style {:color "#919291"
+                            :font-size font-size}}
+           (str/join ", " (map :id (:participants chat)))]]
+          [ui/icon {:style {:flex 0.1
+                            :align-self :center}
+                    :name "chevron-right"
+                    :size 36
+                    :color color/pink}]]]))))

 (defn dispatch-get-chats-event []
   (dispatch [:get-chats]))
@@ -74,13 +80,28 @@
 (defonce do-get-chats (js/setInterval dispatch-get-chats-event 3000))
 (defonce do-get-messages (js/setInterval dispatch-get-messages-event 1000))

+(def chat-row-sep
+  (r/create-element
+   (r/reactify-component
+    (fn [_] [ui/view {:style {:border-width 1
+                              :border-color "#d7d7d7"}}]))
+   #js{}))
+
 (defn ChatsScreen [{:keys [navigation]}]
   (fn [_]
     (let [chats (subscribe [:chats])
           source (map #(r/atom %) @chats)]
-      [ui/view
+      [ui/view {:style {:background-color "white"
+                        :flex 1}}
+       [ui/text {:style {:margin-left 20
+                         :margin-top 20
+                         :margin-bottom 20
+                         :color color/pink
+                         :font-size font-size}}
+        "Practice Groups"]
        [ui/list-view {:dataSource (.cloneWithRows ds (clj->js source))
                       :enableEmptySections true
+                      :render-separator (fn [_] chat-row-sep)
                       :render-row (fn [row]
                                     (r/create-element
                                      chat-row-comp
@@ -118,11 +139,15 @@
   (let [this (r/current-component)]
     [ui/touchable-highlight {:style {:margin-left 5
                                      :margin-right 5}
+                             :underlay-color "#cccccc"
                              :on-press #(do
                                           (.setNativeProps @input #js{:text ""})
                                           (.dismiss (.-Keyboard ui/ReactNative))
                                           (dispatch [:send-message]))}
-     [ui/icon {:name "send" :size 36 :color "deepskyblue" :margin-right 8}]]))
+     [ui/icon {:name "send"
+               :size 36
+               :color "deepskyblue"
+               :margin-right 8}]]))

 (defn ChatScreen [_]
   (let [this (r/current-component)
@@ -133,6 +158,7 @@
         [ui/view {:style {:flex 1
                           :background-color "#f4f4f4"}}
          [ui/list-view {:style {:flex 1}
+                        :enableEmptySections true
                         :dataSource (.cloneWithRows ds (clj->js source))
                         :render-row (fn [row]
                                       (r/create-element


Remove dependency

Remove dependency

--- frontend/src/cruncher/views.cljs
+++ frontend/src/cruncher/views.cljs
@@ -1,7 +1,6 @@
 (ns cruncher.views
   (:require [om.next :as om :refer-macros [defui]]
             [om.dom :as dom :include-macros true]
-            [goog.dom :as gdom]
             [cruncher.communication.auth :as auth]
             [cruncher.communication.favorites :as favorites]
             [cruncher.communication.main :as com]
@@ -170,9 +169,7 @@
                         (dom/tbody nil
                                    (interleave
                                      (map #(poketable-entry (lib/merge-react-key %)) (lib/inventory-pokemon))
-                                     (map #(poketable-entry-details (lib/merge-react-key %)) (lib/inventory-pokemon)))))
-             #_(let [jquery (js* "$")]
-                 (.stickyTableHeaders (jquery "#poketable"))))))
+                                     (map #(poketable-entry-details (lib/merge-react-key %)) (lib/inventory-pokemon))))))))
 (def poketable (om/factory PokeTable {}))


Made table column resizing continuous

Made table column resizing continuous

--- src/cljs/org/broadinstitute/firecloud_ui/common/table.cljs
+++ src/cljs/org/broadinstitute/firecloud_ui/common/table.cljs
@@ -147,14 +147,16 @@
        [:div {:style {:display "inline-block" :position "relative"
                       :minWidth (reduce + (:column-widths @state))
                       :cursor (when (:dragging? @state) "ew-resize")}
-              :onMouseUp (fn [e]
-                           (when (:dragging? @state)
-                             (swap! state assoc :dragging? false)
-                             (let [widths (:column-widths @state)
-                                   current-width (nth widths (:drag-column @state))
-                                   drag-amount (- (.-clientX e) (:drag-start @state))]
-                               (swap! state assoc :column-widths
-                                 (assoc widths (:drag-column @state) (+ current-width drag-amount))))))}
+              :onMouseMove (fn [e]
+                             (when (:dragging? @state)
+                               (let [widths (:column-widths @state)
+                                     current-width (nth widths (:drag-column @state))
+                                     new-mouse-x (.-clientX e)
+                                     drag-amount (- new-mouse-x (:mouse-x @state))]
+                                 (swap! state update-in [:column-widths]
+                                   assoc (:drag-column @state) (+ current-width drag-amount))
+                                 (swap! state assoc :mouse-x new-mouse-x))))
+              :onMouseUp #(swap! state assoc :dragging? false)}
         (style/create-unselectable :div {:style {:whiteSpace "nowrap" :overflow "hidden" :textOverflow "clip"}}
           [:div {}
            (map-indexed
@@ -162,10 +164,10 @@
                (let [width (nth (:column-widths @state) col-num)]
                  [:div {:style {:float "left" :position "relative" :width width}}
                   (when (get column :resizable? true)
-                    [:div {:style {:float "right" :position "absolute" :width 4 :top 0 :bottom 0 :left (- width 4)
+                    [:div {:style {:position "absolute" :width 20 :top 0 :bottom 0 :left (- width 10) :zIndex 1
                                    :cursor "ew-resize"}
                            :onMouseDown (fn [e] (swap! state assoc
-                                                  :dragging? true :drag-start (.-clientX e) :drag-column col-num))}])
+                                                  :dragging? true :mouse-x (.-clientX e) :drag-column col-num))}])
                   (:header-component column)]))
              (:columns props))])
         [:div {:style {:clear "both"}}]


Load bytedeco MKL in a blocking agent.

Load bytedeco MKL in a blocking agent.

--- src/clojure/uncomplicate/neanderthal/internal/host/mkl.clj
+++ src/clojure/uncomplicate/neanderthal/internal/host/mkl.clj
@@ -6,34 +6,38 @@
 ;;   the terms of this license.
 ;;   You must not remove this notice, or any other, from this software.

-(ns uncomplicate.neanderthal.internal.host.mkl
-  (:require [uncomplicate.commons
-             [core :refer [with-release let-release info Releaseable release]]
-             [utils :refer [dragan-says-ex generate-seed direct-buffer]]]
-            [uncomplicate.fluokitten.core :refer [fmap!]]
-            [uncomplicate.neanderthal
-             [core :refer [dim]]
-             [math :refer [f=] :as math]
-             [block :refer [create-data-source initialize]]]
-            [uncomplicate.neanderthal.internal
-             [api :refer :all]
-             [navigation :refer [full-storage]]
-             [common :refer [check-stride check-eq-navigators real-accessor]]]
-            [uncomplicate.neanderthal.internal.host
-             [buffer-block :refer :all]
-             [cblas :refer :all]
-             [lapack :refer :all]])
-  (:import [java.nio ByteBuffer FloatBuffer DoubleBuffer LongBuffer IntBuffer ShortBuffer
-            ByteBuffer  DirectByteBuffer DirectFloatBufferU DirectDoubleBufferU
-            DirectLongBufferU DirectIntBufferU DirectShortBufferU]
-           [uncomplicate.neanderthal.internal.api DataAccessor RealBufferAccessor
-            Block RealVector Region LayoutNavigator DenseStorage RealNativeMatrix]
-           [uncomplicate.neanderthal.internal.host.buffer_block IntegerBlockVector RealBlockVector
-            RealGEMatrix RealUploMatrix RealBandedMatrix RealPackedMatrix RealDiagonalMatrix]))
 (try
-  (clojure.lang.RT/loadClassForName "org.bytedeco.mkl.global.mkl_rt")
-  (finally
-    (import [uncomplicate.neanderthal.internal.host CBLAS MKL LAPACK])))
+  (await (send-off (agent :mkl)
+                   (fn [state]
+                     (try
+                       (clojure.lang.RT/loadClassForName "org.bytedeco.mkl.global.mkl_rt")
+                       (finally :success)))))
+ (finally
+   (ns uncomplicate.neanderthal.internal.host.mkl
+     (:require [uncomplicate.commons
+              [core :refer [with-release let-release info Releaseable release]]
+              [utils :refer [dragan-says-ex generate-seed direct-buffer]]]
+             [uncomplicate.fluokitten.core :refer [fmap!]]
+             [uncomplicate.neanderthal
+              [core :refer [dim]]
+              [math :refer [f=] :as math]
+              [block :refer [create-data-source initialize]]]
+             [uncomplicate.neanderthal.internal
+              [api :refer :all]
+              [navigation :refer [full-storage]]
+              [common :refer [check-stride check-eq-navigators real-accessor]]]
+             [uncomplicate.neanderthal.internal.host
+              [buffer-block :refer :all]
+              [cblas :refer :all]
+              [lapack :refer :all]])
+   (:import [java.nio ByteBuffer FloatBuffer DoubleBuffer LongBuffer IntBuffer ShortBuffer
+             ByteBuffer  DirectByteBuffer DirectFloatBufferU DirectDoubleBufferU
+             DirectLongBufferU DirectIntBufferU DirectShortBufferU]
+            [uncomplicate.neanderthal.internal.api DataAccessor RealBufferAccessor
+             Block RealVector Region LayoutNavigator DenseStorage RealNativeMatrix]
+            [uncomplicate.neanderthal.internal.host.buffer_block IntegerBlockVector RealBlockVector
+             RealGEMatrix RealUploMatrix RealBandedMatrix RealPackedMatrix RealDiagonalMatrix]
+            [uncomplicate.neanderthal.internal.host CBLAS MKL LAPACK]))))

 (defn ^:private not-available [kind]
   (throw (UnsupportedOperationException. "Operation not available for %s matrix")))


[#9583] Overlapping with system bar on "Send transaction" screen (LG phones)

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

--- src/status_im/ui/screens/wallet/send/views.cljs
+++ src/status_im/ui/screens/wallet/send/views.cljs
@@ -82,36 +82,47 @@
 (views/defview sheet [_]
   (views/letsubs [{:keys [amount-error amount-text from token to sign-enabled? from-chat?] :as tx}
                   [:wallet.send/prepare-transaction-with-balance]
-                  small-screen? [:dimensions/small-screen?]]
-    [react/view (styles/sheet small-screen?)
-     [header small-screen?]
-     [react/view (merge {:flex-direction :row :padding-horizontal 24 :align-items :center}
-                        (when-not small-screen?
-                          {:margin-top 16 :margin-bottom 16}))
-      [react/text-input
-       {:style               {:font-size (if small-screen? 24 38)
-                              :color (when amount-error colors/red)
-                              :flex-shrink 1}
-        :keyboard-type       :numeric
-        :accessibility-label :amount-input
-        :default-value       amount-text
-        :auto-focus          true
-        :on-change-text      #(re-frame/dispatch [:wallet.send/set-amount-text %])
-        :placeholder         "0.0 "}]
-      [asset-selector tx]
-      (when amount-error
-        [tooltip/tooltip amount-error {:bottom-value 2
-                                       :font-size    12}])]
-     [components/separator]
-     [list-item/list-item {:type :section-header :title :t/from}]
-     [render-account from token]
-     [list-item/list-item {:type :section-header :title :t/to}]
-     [render-contact to from-chat?]
-     [toolbar/toolbar
-      {:center {:label               :t/wallet-send
-                :accessibility-label :send-transaction-bottom-sheet
-                :disabled?           (not sign-enabled?)
-                :on-press            #(re-frame/dispatch [:wallet.ui/sign-transaction-button-clicked tx])}}]]))
+                  window-height [:dimensions/window-height]
+                  keyboard-height [:keyboard-height]]
+    (let [small-screen? (< (- window-height keyboard-height) 450)]
+      [react/view {:style (styles/sheet small-screen?)}
+       [header small-screen?]
+       [react/view {:flex-direction :row :padding-horizontal 24 :align-items :center
+                    :margin-vertical (if small-screen? 8 16)}
+        [react/text-input
+         {:style               {:font-size (if small-screen? 24 38)
+                                :color (when amount-error colors/red)
+                                :flex-shrink 1}
+          :keyboard-type       :numeric
+          :accessibility-label :amount-input
+          :default-value       amount-text
+          :auto-focus          true
+          :on-change-text      #(re-frame/dispatch [:wallet.send/set-amount-text %])
+          :placeholder         "0.0 "}]
+        [asset-selector tx]
+        (when amount-error
+          [tooltip/tooltip amount-error {:bottom-value 2
+                                         :font-size    12}])]
+       [components/separator]
+       (when-not small-screen?
+         [list-item/list-item {:type :section-header :title :t/from}])
+       [react/view {:flex-direction :row :flex 1 :align-items :center}
+        (when small-screen?
+          [react/i18n-text {:style {:width 50 :text-align :right :color colors/gray} :key :t/from}])
+        [react/view {:flex 1}
+         [render-account from token]]]
+       (when-not small-screen?
+         [list-item/list-item {:type :section-header :title :t/to}])
+       [react/view {:flex-direction :row :flex 1 :align-items :center}
+        (when small-screen?
+          [react/i18n-text {:style {:width 50 :text-align :right :color colors/gray} :key :t/to}])
+        [react/view {:flex 1}
+         [render-contact to from-chat?]]]
+       [toolbar/toolbar
+        {:center {:label               :t/wallet-send
+                  :accessibility-label :send-transaction-bottom-sheet
+                  :disabled?           (not sign-enabled?)
+                  :on-press            #(re-frame/dispatch [:wallet.ui/sign-transaction-button-clicked tx])}}]])))

 (defview prepare-transaction []
   (letsubs [tx [:wallet/prepare-transaction]]


Previous update to compare-files was actually doing the coercion and then comparing the output whereas we need to plan-schema to do the coercion and the test to only compare files and identify coercion issues in plan-schema.

--- test/clj/testing/pamela/plan_schema.clj
+++ test/clj/testing/pamela/plan_schema.clj
@@ -11,8 +11,7 @@
             [plan-schema.core :as psc]
             [clojure.java.io :as io]
             [clojure.string :as str]
-            [clojure.pprint :refer :all]
-            [avenir.utils :refer [keywordize]])
+            [clojure.pprint :refer :all])
   (:import [java.io.File]))

 ;; NOTE ["test/pamela/cannon.pamela" "(game.main)"]
@@ -93,7 +92,7 @@
 (defn read-clj [filename]
   (read-string (slurp filename)))

-(defn json->edn
+#_(defn json->edn
   "Perform basic HTN/TPN data conversion"
   {:added "0.6.0"}
   ([m]
@@ -120,11 +119,23 @@
        ;;   (println "k:" k "v:" v " -> " v2))
        v2))))

-;; NOTE that the full edn map must be keywordized so that the
-;; keys in edn argsmaps will match those in the json map
-;; (which passes through keywordize).
+; The output produced by plan-schema (edn and json) is being compared to find coercion issues.
+; Note: plan-schema reads edn and json (produced by pamela) and spits out the version of the same after coercion.
+; If the coercion is working correctly, output produced by plan-schema should be identical for both.
+; If there coercion issues, the output will be different and that's exactly what we are looking for.
+
+; Ex:
+; This is output produced by plan-schema after coercion for edn file.
+;<  {:uid :hem-100,
+;<   :type :htn-expanded-method,
+;---
+; This is output produced by plan-schema after coercion for json file.
+;>  {:uid "hem-100",
+;    >   :type "htn-expanded-method",
 (defn compare-files [edn json]
-  (let [edn-sorted (into (sorted-map) (keywordize (read-clj edn)))
+  (= (read-clj edn) (read-clj json))
+  ; This is a bad test because it is actually performing the same coercion that plan-schema should be doing.
+  #_(let [edn-sorted (into (sorted-map) (keywordize (read-clj edn)))
         json-sorted (into (sorted-map) (json->edn (read-clj json)))
         equal? (= edn-sorted json-sorted)]
     ;; DEBUGGING


Fix also the publish entry function.

Fix also the publish entry function.

--- src/oc/storage/api/entries.clj
+++ src/oc/storage/api/entries.clj
@@ -173,11 +173,10 @@
   (if-let* [user (:user ctx)
             org (:existing-org ctx)
             board (:existing-board ctx)
-            old-board (:moving-board ctx)
             entry (:existing-entry ctx)
             updated-entry (:updated-entry ctx)
             publish-result (entry-res/publish-entry! conn (:uuid updated-entry) updated-entry user)]
-    (do
+    (let [old-board (:moving-board ctx)]
       (undraft-board conn user org board)
       ;; If we are moving the entry from a draft board, check if we need to remove the board itself.
       (when old-board


CMR-4118: updated test.

CMR-4118: updated test.

--- system-int-test/test/cmr/system_int_test/ingest/provider_ingest_test.clj
+++ system-int-test/test/cmr/system_int_test/ingest/provider_ingest_test.clj
@@ -1,8 +1,8 @@
 (ns cmr.system-int-test.ingest.provider-ingest-test
   "CMR provider ingest integration test"
   (:require
+    [clj-http.client :as client]
     [clojure.set :as set]
-    [clj-http.client :as client]
     [clojure.test :refer :all]
     [cmr.access-control.test.util :as access-control]
     [cmr.common.mime-types :as mt]
@@ -17,6 +17,7 @@
     [cmr.system-int-test.utils.metadata-db-util :as mdb]
     [cmr.system-int-test.utils.search-util :as search]
     [cmr.system-int-test.utils.url-helper :as url]
+    [cmr.system-int-test.utils.variable-util :as variables]
     [cmr.transmit.config :as transmit-config]))

 (use-fixtures :each (ingest/reset-fixture {"provguid1" "PROV1" "provguid2" "PROV2"}))
@@ -122,6 +123,12 @@
                                                                               :ShortName "S3"
                                                                               :Version "V3"}))
           gran4 (d/ingest "PROV2" (dg/granule-with-umm-spec-collection coll3 "C1-PROV1"))
+          variable1 (variables/ingest-variable-with-attrs {:native-id "var1"
+                                                           :Name "Variable1"})
+
+          variable2 (variables/ingest-variable-with-attrs {:native-id "var2"
+                                                           :Name "Variable2"
+                                                           :provider-id "PROV2"})
           ;; create an access group to test cascading deletes
           access-group (u/map-keys->kebab-case
                         (access-control/create-group
@@ -137,12 +144,12 @@
                                                                 :target "CATALOG_ITEM_ACL"}}))
           _ (index/wait-until-indexed)
           acl2 (u/map-keys->kebab-case
-                 (access-control/create-acl token
-                                            {:group_permissions [{:permissions [:read :order]
-                                                                  :user_type "guest"}]
-                                             :catalog_item_identity {:name "PROV1 read, order"
-                                                                     :collection_applicable true
-                                                                     :provider_id "PROV1"}}))
+                (access-control/create-acl token
+                                           {:group_permissions [{:permissions [:read :order]
+                                                                 :user_type "guest"}]
+                                            :catalog_item_identity {:name "PROV1 read, order"
+                                                                    :collection_applicable true
+                                                                    :provider_id "PROV1"}}))
           acl3 {:concept-id
                 (e/grant (merge
                           {:token (transmit-config/echo-system-token)}
@@ -157,6 +164,8 @@

       (is (= 2 (count (:refs (search/find-refs :collection {:provider-id "PROV1"})))))
       (is (= 3 (count (:refs (search/find-refs :granule {:provider-id "PROV1"})))))
+      (is (= 1 (:hits (variables/search {:name "Variable1"}))))
+      (is (= 1 (:hits (variables/search {:name "Variable2"}))))

       ;; ensure PROV1 group is indexed
       (is (= [(:concept-id access-group)]
@@ -184,6 +193,7 @@
         gran1
         gran2
         gran3
+        variable1
         access-group
         acl1
         acl2)
@@ -200,7 +210,8 @@
       (are [concept]
         (mdb/concept-exists-in-mdb? (:concept-id concept) (:revision-id concept))
         coll3
-        gran4)
+        gran4
+        variable2)

       ;; search on PROV1 finds nothing
       (is (d/refs-match?
@@ -216,7 +227,11 @@
            (search/find-refs :collection {:provider-id "PROV2"})))
       (is (d/refs-match?
            [gran4]
-           (search/find-refs :granule {:provider-id "PROV2"})))))
+           (search/find-refs :granule {:provider-id "PROV2"})))
+      ;; Variable on PROV1 is not found in search
+      (is (= 0 (:hits (variables/search {:name "Variable1"}))))
+      ;; Variable on PROV2 is still found in search
+      (is (= 1 (:hits (variables/search {:name "Variable2"}))))))

   (testing "delete non-existent provider"
     (let [{:keys [status errors content-type]} (ingest/delete-ingest-provider "NON_EXIST")]


Schema import no longer required for compression.

--- src/onyx/compression/nippy.clj
+++ src/onyx/compression/nippy.clj
@@ -1,6 +1,5 @@
 (ns onyx.compression.nippy
-  (:require [taoensso.nippy :as nippy])
-  (:import [schema.utils ValidationError NamedError]))
+  (:require [taoensso.nippy :as nippy]))

 (def messaging-compress-opts
   {:v1-compatibility? false


Open notification docs link in a new tab

--- src-cljs/frontend/components/account.cljs
+++ src-cljs/frontend/components/account.cljs
@@ -355,7 +355,8 @@
           "denied" [:div.section
                     "It looks like you've denied CircleCI access to send you web notifications.
                     Before you can change your web notification preferences please "
-                    [:a (open-ext {:href "https://circleci.com/docs/web-notifications/#turning-notifications-permissions-back-on"})
+                    [:a {:href "https://circleci.com/docs/web-notifications/#turning-notifications-permissions-back-on"
+                         :target "_blank"}
                      "turn on permissions for your browser."]]
           "default" [:div.section
                      "You haven't given CircleCI access to notify you through the browser — "


Now jumps to the correct div.

Now jumps to the correct div.

With a fix to handle the 50px banner at the top as well.

--- src-cljs/kixi/hecuba/tabs/programmes.cljs
+++ src-cljs/kixi/hecuba/tabs/programmes.cljs
@@ -70,7 +70,6 @@
                          (merge {:response-format :json :keywords? true}))))))
     (recur)))

-
 (defn selected-range-change
   [selected selection-key {{ids :ids search :search} :args}]
   (let [new-selected (get ids selection-key)]
@@ -131,7 +130,7 @@
             history (om/get-shared owner :history)]
         (dom/div #js {:id (str table-id "-container")}
          (dom/table
-          #js {:id table-id
+          #js {;; :id table-id
                :className "table table-hover hecuba-table"} ;; table-hover table-stripedso,
           (dom/thead
            nil
@@ -188,9 +187,15 @@
       (let [programmes (-> tables :programmes)]
         (html
          ;; hide div if we've already chosen something
-         [:div {:id "programmes" :class (if (:active programmes) "hidden" "")}
+         [:div {:id "programmes-div"}
           [:h1 "Programmes"]
           (om/build programmes-table programmes)])))))
+
+;; our banner is 50px so we need to tweak the scrolling
+(defn fixed-scroll-to-element [element]
+  (-> (.getElementById js/document element)
+                                    .scrollIntoView)
+  (.scrollBy js/window 0 -50))

 (defn programmes-table [cursor owner]
   (reify
@@ -207,7 +212,8 @@
              (let [{:keys [id lead-organisations name description created-at]} row]
                [:tr {:onClick (fn [_ _]
                                 (om/update! cursor :selected id)
-                                (history/update-token-ids! history :programmes id))
+                                (history/update-token-ids! history :programmes id)
+                                (fixed-scroll-to-element "projects-div"))
                      :className (if (= id (:selected cursor)) "success")
                      :id (str table-id "-selected")}
                 [:td id [:a {:id (str "row-" id)}]] [:td lead-organisations] [:td name] [:td created-at]]))]])))))
@@ -223,13 +229,14 @@
       (let [{:keys [programmes projects active-components]} tables
             history (om/get-shared owner :history)]
         (html
-         [:div {:id "projects" :class (if (:projects active-components) "hidden" "")}
+         [:div {:id "projects-div"}
           [:h2 "Projects"]
           [:ul {:class "breadcrumb"}
            [:li [:a
                  {:onClick (fn projects-div-history-change
                              [_ _]
-                             (history/update-token-ids! history :programmes nil))}
+                             (history/update-token-ids! history :programmes nil)
+                             (fixed-scroll-to-element "programmes-div"))}
                  (title-for programmes)]]]
           (om/build table projects {:opts {:histkey :projects}})])))))

@@ -240,17 +247,19 @@
       (let [{:keys [programmes projects properties active-components]} tables
             history (om/get-shared owner :history)]
         (html
-         [:div {:id "properties" :class (if (:properties active-components) "hidden" "")}
+         [:div {:id "properties-div"}
           [:h2 "Properties"]
           [:ul {:class "breadcrumb"}
            [:li [:a
                  {:onClick (fn [_ _]
                              (history/update-token-ids! history :projects nil)
-                             (history/update-token-ids! history :programmes nil))}
+                             (history/update-token-ids! history :programmes nil)
+                             (fixed-scroll-to-element "programmes-div"))}
                  (title-for programmes)]]
            [:li [:a
                  {:onClick (fn [_ _]
-                             (history/update-token-ids! history :projects nil))}
+                             (history/update-token-ids! history :projects nil)
+                             (fixed-scroll-to-element "projects-div"))}
                  (title-for projects)]]]
           (om/build table properties {:opts {:histkey :properties}})])))))

@@ -261,22 +270,26 @@
       (let [{:keys [programmes projects properties devices active-components]} tables
             history (om/get-shared owner :history)]
         (html
-         [:div {:id "devices"}
+         [:div {:id "devices-div"}
           [:h2  "Devices"]
           [:ul {:class "breadcrumb"}
            [:li [:a
                  {:onClick (fn [_ _]
+                             (history/update-token-ids! history :properties nil)
                              (history/update-token-ids! history :projects nil)
-                             (history/update-token-ids! history :programmes nil))}
+                             (history/update-token-ids! history :programmes nil)
+                             (fixed-scroll-to-element "programmes-div"))}
                  (title-for programmes)]]
            [:li [:a
                  {:onClick (fn [_ _]
                              (history/update-token-ids! history :properties nil)
-                             (history/update-token-ids! history :projects nil))}
+                             (history/update-token-ids! history :projects nil)
+                             (fixed-scroll-to-element "projects-div"))}
                  (title-for projects)]]
            [:li [:a
                  {:onClick (fn [_ _]
-                             (history/update-token-ids! history :properties nil))}
+                             (history/update-token-ids! history :properties nil)
+                             (fixed-scroll-to-element "projects-div"))}
                  (title-for properties :title-key :addressStreetTwo)]]]
           (om/build table devices {:opts {:histkey :devices}})])))))


More landing page support

More landing page support

--- frontend/components/landing.cljs
+++ frontend/components/landing.cljs
@@ -142,6 +142,323 @@
      [:div.hero-unit-cta
       home-cta]]]])

+(defn customer-image [customer-name image]
+  [:div.big-company
+   [:img {:title customer-name
+          :src image}]])
+
+(def home-customers
+ [:section.customers
+  [:div.container
+   [:div.row.span12]
+   [:div.center
+    [:div.were-number-one
+     [:h2
+      "CircleCI is the #1 hosted continuous deployment provider.But don't take our word for it, read what our awesome customers have to say."]]]
+   [:div.customers-trust.row
+    [:h4 [:span "Trusted By"]]
+    (customer-image "Salesforce" "img/logos/salesforce.png")
+    (customer-image "Samsung" "img/logos/samsung.png")
+    (customer-image "Kickstarter" "img/logos/kickstarter.png")
+    (customer-image "Cisco" "img/logos/cisco.png")
+    (customer-image "Shopify" "img/logos/shopify.png")
+    [:span.stretch]]
+  [:div.container
+   [:div.row
+    [:div.customer.span4.well
+     [:p
+      "CircleCI has significantly improved our testing infrastructure. Tests finish faster. We add new projects rapidly and continuous integration happens from the get-go. "
+      [:strong "I'm a huge fan."]]
+     " + $c(HAML.john_collison_image())"
+     [:h4 "John Collison"]
+     [:p
+      "Founder at "
+      [:a
+       {:title "Stripe",
+        :href "https://stripe.com/",
+        :alt-there "Stripe"}
+       "Stripe"]]]
+    [:div.customer.span4.well
+     [:p
+      "It's super fun and helpful to see test results hit our Hipchat room a few minutes after a push. "
+      [:strong "The first time it happened, my team cheered."]
+      "The fact that we don't have to admin the server ourselves is a big timesaver."]
+     " + $c(HAML.jon_crawford_image())"
+     [:h4 "Jon Crawford"]
+     [:p
+      "CEO of "
+      [:a
+       {:title "Storenvy",
+        :href "http://www.storenvy.com/",
+        :alt "Storenvy"}
+       "Storenvy"]]]
+    [:div.customer.span4.well
+     [:p
+      "CircleCI was super simple to set up and we started reaping the benefits immediately. It lets us ship code quickly and confidently. "
+      [:strong "CircleCI's customer support is outstanding."]
+      "We get quick, thorough answers to all our questions."]
+     " + $c(HAML.aaron_suggs_image())"
+     [:h4 "Aaron Suggs"]
+     [:p
+      "Operations Engineer at "
+      [:a
+       {:title "Kickstarter",
+        :href "http://www.kickstarter.com/",
+        :alt "Kickstarter"}
+       "Kickstarter"]]]]]]
+  [:a.customer-story-link.center-text {:href "stories/shopify"}
+   "Read how Shopify grew with Circle"]])
+
+(def home-features
+  [:div.benefits
+   [:div.container
+    [:div.row-fluid
+     [:div.span12
+      [:h2 "Features & Benefits of CircleCI"]
+      [:h3
+       "A professional continuous integration setup for your team today, tomorrow and beyond."]]]
+    [:div.row-fluid
+     [:div.clearfix.quick-setup.section.span4
+      [:div.section-graphic [:i.fa.fa-magic]]
+      [:div.section-content
+       [:h3 "Quick Setup"]
+       [:p
+        [:strong "Set up your continuous integration in 20 seconds"]
+        ", not two days. With one click CircleCI detects test settings for a wide range of web apps, and sets them up automatically on our servers."]]]
+     [:div.clearfix.fast-tests.section.span4
+      [:div.section-graphic [:i.fa.fa-bolt]]
+      [:div.section-content
+       [:h3 "Fast Tests"]
+       [:p
+        "Your productivity relies on fast test results. CircleCI runs your tests"
+        [:strong "faster than your Macbook Pro"]
+        ", EC2, your local server, or any other service."]]]
+     [:div.clearfix.deep-customization.section.span4
+      [:div.section-graphic [:i.fa.fa-flask]]
+      [:div.section-content
+       [:h3 "Deep Customization"]
+       [:p
+        "Real applications often deviate slightly from standard configurations, so CircleCI does too. Our configuration is so flexible that it's easy to "
+        [:strong "tweak almost anything"]
+        " you need."]]]]
+    [:div.row-fluid
+     [:div.clearfix.debug-with-ease.section.span4
+      [:div.section-graphic [:i.fa.fa-cog]]
+      [:div.section-content
+       [:h3 "Debug with Ease"]
+       [:p
+        "When your tests are broken, we help you get them fixed. We auto-detect errors, have great support, and even allow you to "
+        [:strong "SSH into our machines"]
+        " to test manually."]]]
+     [:div.clearfix.section.smart-notifications.span4
+      [:div.section-graphic [:i.fa.fa-bullhorn]]
+      [:div.section-content
+       [:h3 "Smart Notifications"]
+       [:p
+        "CircleCI intelligently notifies you via email, Hipchat, Campfire and more. You won't be flooded with useless notifications about other people's builds and passing tests, "
+        [:strong "we only notify you when it matters."]]]]
+     [:div.clearfix.incredible-support.section.span4
+      [:div.section-graphic [:i.fa.fa-heart]]
+      [:div.section-content
+       [:h3 "Loving support"]
+       [:p
+        "We respond to support requests as soon as possible, every day. Most requests get a response responded to "
+        [:strong "within an hour."]
+        " No-one ever waits more than 12 hours for a response."]]]]
+    [:div.row-fluid
+     [:div.automatic-parallelization.clearfix.section.span4
+      [:div.section-graphic [:i.fa.fa-fullscreen]]
+      [:div.section-content
+       [:h3 "Automatic Parallelization"]
+       [:p
+        "We can automatically parallelize your tests across multiple machines. "
+        [:strong "With up to 16-way parallelization"]
+        ", your test turn-around time can be massively reduced."]]]
+     [:div.clearfix.continuous-deployment.section.span4
+      [:div.section-graphic [:i.fa.fa-refresh]]
+      [:div.section-content
+       [:h3 "Continuous Deployment"]
+       [:p
+        [:strong "Get code to your customers faster"]
+        ", as soon as the tests pass. CircleCI supports branch-specific deployments, SSH key management and supports any hosting environment using custom commands, auto-merging, and uploading packages."]]]
+     [:div.clearfix.more-to-come.section.span4
+      [:div.section-graphic [:i.fa.fa-lightbulb-o]]
+      [:div.section-content
+       [:h3 "More to come."]
+       [:p
+        "At CircleCI we are always listening to our customers for ideas and feedback. If there is a specific feature or configuration ability you need, we want to know."]]]]]])
+
+(def home-technology
+  [:section.technology
+   [:div.container
+    [:h2 "We support your stack"]
+    [:div.tabbable
+     [:div.row-fluid
+      [:div.nav-tabs-container.span12
+       [:ul#tech.nav.nav-tabs
+        [:li.active
+         [:a
+          {:language "language",
+           :tab:_ "tab:_",
+           :properties:_ "properties:_",
+           :stack "stack",
+           :test "test",
+           :event:_ "event:_",
+           :data-bind "\\track:",
+           :data-toggle "tab",
+           :href "#languages"}
+          "Languages"]]
+        [:li
+         [:a
+          {:databases "databases",
+           :tab:_ "tab:_",
+           :properties:_ "properties:_",
+           :stack "stack",
+           :test "test",
+           :event:_ "event:_",
+           :data-bind "\\track:",
+           :data-toggle "tab",
+           :href "#databases"}
+          "Databases"]]
+        [:li
+         [:a
+          {:queues "queues",
+           :tab:_ "tab:_",
+           :properties:_ "properties:_",
+           :stack "stack",
+           :test "test",
+           :event:_ "event:_",
+           :data-bind "\\track:",
+           :data-toggle "tab",
+           :href "#queues"}
+          "Queues"]]
+        [:li
+         [:a
+          {:browsers "browsers",
+           :tab:_ "tab:_",
+           :properties:_ "properties:_",
+           :stack "stack",
+           :test "test",
+           :event:_ "event:_",
+           :data-bind "\\track:",
+           :data-toggle "tab",
+           :href "#browsers"}
+          "Browsers"]]
+        [:li
+         [:a
+          {:libraries "libraries",
+           :tab:_ "tab:_",
+           :properties:_ "properties:_",
+           :stack "stack",
+           :test "test",
+           :event:_ "event:_",
+           :data-bind "\\track:",
+           :data-toggle "tab",
+           :href "#libraries"}
+          "Libraries"]]
+        [:li
+         [:a
+          {:deployment "deployment",
+           :tab:_ "tab:_",
+           :properties:_ "properties:_",
+           :stack "stack",
+           :test "test",
+           :event:_ "event:_",
+           :data-bind "\\track:",
+           :data-toggle "tab",
+           :href "#deployment"}
+          "Deployment"]]
+        [:li
+         [:a
+          {:custom "custom",
+           :tab:_ "tab:_",
+           :properties:_ "properties:_",
+           :stack "stack",
+           :test "test",
+           :event:_ "event:_",
+           :data-bind "\\track:",
+           :data-toggle "tab",
+           :href "#custom"}
+          "Custom"]]]]]
+     [:div.tab-content
+      [:div#languages.active.tab-pane
+       [:div.row-fluid
+        [:div.span6 " + $c(HAML.languages_image())"]
+        [:div.span6
+         "CircleCI automatically infers how to run your Ruby, Node, Python and Java tests.You can customize any step, or set up your test steps manually for PHP or other languages."]]]
+      [:div#databases.tab-pane
+       [:div.row-fluid
+        [:div.span6 " + $c(HAML.dbs_image())"]
+        [:div.span6
+         "If you use any of the dozen most common databases, we have them pre-installed for you, set up to be trivial to use.Postgres and MySQL have their permissions set and are running, Redis, Mongo and Riak are running for you, and the other DBs are just a configuration switch away."]]]
+      [:div#queues.tab-pane
+       [:div.fluid.row
+        [:div.span6 " + $c(HAML.queues_image())"]
+        [:div.span6
+         "If you need to test against queues, we have them installed on our boxes.We support RabbitMQ and Beanstalk, have Redis installed so you can use Resque, and can install anything else you need."]]]
+      [:div#browsers.tab-pane
+       [:div.row-fluid
+        [:div.span6 " + $c(HAML.browsers_image())"]
+        [:div.span6
+         "We support continuous integration testing in your apps against a wide range of browsers.We have latest Chrome, Firefox and webkit installed using xvfb, as well as PhantomJS and CasperJS.Headless browser testing is completely supported, so you can test using Selenium, directly against PhantomJS, or using abstraction layers such as Capybara and Cucumber."]]]
+      [:div#libraries.tab-pane
+       [:div.row-fluid
+        [:div.offset2.span8
+         [:p
+          "We run a recent version Ubuntu and have installed all of the libraries you need for development.We have common libs like libxml2, uncommon ones like libblas, and downright rare libraries like libavahi-compat-libdnssd-dev.As new important libraries come out it's trivial for us to add them for you."]]]]
+      [:div#deployment.tab-pane
+       [:div.row-fluid
+        [:div.span6 " + $c(HAML.deployment_image())"]
+        [:div.span6
+         "Continuous Deployment means that you can deploy your fresh code to production fast and with no fear.Many of our customers deploy directly after a green push to master or another branch.We manage SSH keys and allow you to deploy any way you wish, whether directly to a PaaS, using Capistrano, Fabric, or arbitrary bash commands, or – for you autoscalers – by auto-merging to another branch, or packaging code up to S3."]]]
+      [:div#custom.tab-pane
+       [:div.row-fluid
+        [:div.offset2.span8
+         [:p
+          "Although we do our best to set up your tests in one click, occasionally developers have custom setups.Need to use npm in your PHP project?Using Haskell?Use a specific Ruby patchset?Do you depend on private repos?We have support for dozens of different ways to customize, and we make it trivial to customize basically anything.Custom language versions, environment variables, timeouts, packages, databases, commands, etc, are all trivial to set up."]]]]]]]])
+
+(def home-get-started
+  [:div.get-started
+   [:div.container
+    [:div.row
+     [:div.offset3.span6
+      [:div.box
+       [:h2 "Get Started"]
+       [:hr]
+       [:p.center
+        [:strong "Set up your continuous integration in 20 seconds."]]
+       [:ol
+        [:li "Choose a GitHub repository."]
+        [:li "Watch your tests run faster than ever."]
+        [:li "Get your team into the flow."]]
+       [:div.center
+        [:div.main-cta
+         [:div.ctabox
+          [:a.btn.btn-action-orange.btn-jumbo
+           {:event:_ "event:_",
+            :source:_ "source:_",
+            :auth "auth",
+            :ci.github.authurl "ci.github.authurl",
+            :github "github",
+            :get_started_section "get_started_section",
+            :properties:_ "properties:_",
+            :data-bind "\\attr:",
+            :href:_ "href:_",
+            :track_link:_ "track_link:_"}
+           "RUN YOUR TESTS"]]]]
+       [:p.center
+        [:i
+         "CircleCI keeps your code safe. "
+         [:a
+          {:title "Privacy and Security", :href "/privacy"}
+          "Learn how."]]]
+       [:p.center
+        "Plans start at "
+        [:i "$19 per month"]
+        [:br]
+        "All plans include a "
+        [:strong [:i "Free 14 Day Trial."]]]]]]]])
+
 (utils/defrender home
   []
   (let [ab-tests nil]
@@ -149,9 +466,9 @@
            [:div.banner]
            [:div
             (home-hero-unit ab-tests)
-            ;; home-customers
-            ;; home-features-old
-            ;; home-get-started]]))
-            ]])))
-
-
+            home-customers
+            home-features
+            home-technology
+            home-get-started]])))
+
+


Added speed-up before repetition.

Added speed-up before repetition.

--- src/overtunes/songs/at_all.clj
+++ src/overtunes/songs/at_all.clj
@@ -73,4 +73,4 @@

 (defn play# [] (-> (bpm 120) (from 2) intro# first-bit# (speed-up 3/2) first-bit#))

-(play#)
+; (play#)


typo fix in howler library name

typo fix in howler library name

--- resources/leiningen/new/threejs_game/project.clj
+++ resources/leiningen/new/threejs_game/project.clj
@@ -4,7 +4,7 @@
   :dependencies [[org.clojure/clojure "1.9.0-beta2"]
                  [org.clojure/clojurescript "1.9.946"]
                  [cljsjs/three "0.0.87-0"]
-                 [cljsjs/howler "2.5.0-0"]
+                 [cljsjs/howler "2.0.5-0"]
                  [reagent "0.8.0-alpha1"]]
   :plugins [[lein-cljsbuild "1.1.7"]
             [lein-figwheel "0.5.14"]]


Some modifications of TITANIC

Some modifications of TITANIC

nothing good, though.

Signed-off-by: Daniel Borchmann <25857343a15bf1edafebc2912e82ecf775c585c1@mailbox.tu-dresden.de>

--- src/conexp/contrib/algorithms/titanic.clj
+++ src/conexp/contrib/algorithms/titanic.clj
@@ -41,21 +41,21 @@

   "
   [X X-weight base-set keys set-weight closure]
-  (let [keys (map first (take-while #(not= (second %) X-weight) keys))]
-    (loop [Y        (apply union X (map #(closure (disj X %)) X)),
-           elements (difference base-set Y)]
+  (let [keys  (doall (map first (take-while #(not= (second %) X-weight) keys))),
+        start (reduce #(union %1 (closure (disj X %2)))
+                      X X)]
+    (loop [Y        (transient start),
+           elements (difference base-set start)]
       (if-not (empty? elements)
         (let [m    (first elements),
               X+m  (conj X m),
               add? (if-let [s (set-weight X+m)]
                      (= s X-weight)
-                     (not (first (for [K keys,
-                                       :when (and (contains? K m)
-                                                  (subset? K X+m))]
-                                   K))))]
-          (recur (if add? (conj Y m) Y)
+                     (not (exists [K keys]
+                            (and (contains? K m) (subset? K X+m)))))]
+          (recur (if add? (conj! Y m) Y)
                  (rest elements)))
-        Y))))
+        (persistent! Y)))))

 (defn- titanic-generate
   "Computes the next candidate set."
@@ -91,9 +91,8 @@
       (if (seq next-key-set)            ;i.e. (not (empty? next-key-set))
         (recur closure,
                set-weight,
-               next-key-set
-               (sort (fn [X Y]
-                       (weight-order (second X) (second Y)))
+               next-key-set,
+               (sort #(weight-order (second %1) (second %2))
                      (concat next-key-set keys)))
         (distinct (vals closure))))))

@@ -127,6 +126,7 @@
   (let [num-of-objects (count (objects context)),
         minnum (* minsupp num-of-objects)]
     (fn [coll]
+      ;; this should be done in one run through the context
       (into {} (for [atts coll]
                  [atts (let [num (count (attribute-derivation context atts))]
                          (if (< num minnum)


Fix non-boolean test code

Fix non-boolean test code

--- test/cljam/io/bigwig_test.clj
+++ test/cljam/io/bigwig_test.clj
@@ -177,11 +177,7 @@
        (= (:auto-sql ah) (:auto-sql bh))
        (= (:extended-header ah) (:extended-header bh))
        (= (:bpt-header ah) (:bpt-header bh))
-       (map (fn [a b]
-              (and (= (:name a) (:name b))
-                   (= (:id a) (:id b))
-                   (= (:size a) (:size b))))
-            (:bbi-chrom-info ah) (:bbi-chrom-info bh))
+       (apply = (map #(map (juxt :name :id :size) (:bbi-chrom-info %))) [ah bh])
        (= (:cir-tree ah) (:cir-tree bh))
        (let [eps 1e-4
              x (:total-summary ah)
@@ -195,24 +191,26 @@
 (defn- same-wig?
   "Returns true if the given arguments are same wig formats and same values."
   [as bs]
-  (map (fn [a b]
-         (and (= (:track a) (:track b))
-              (= (:chr a) (:chr b))
-              (= (:start a) (:start b))
-              (= (:end a) (:end b))
-              (-> (- (:value a) (:value b)) Math/abs (< 1e-4))))
-       as bs))
+  (->> (map (fn [a b]
+              (and (= (:track a) (:track b))
+                   (= (:chr a) (:chr b))
+                   (= (:start a) (:start b))
+                   (= (:end a) (:end b))
+                   (-> (- (:value a) (:value b)) Math/abs (< 1e-4))))
+            as bs)
+       (every? true?)))

 (defn- same-bedgraph?
   "Returns true if the given arguments are same BedGraph values."
   [as bs]
-  (map (fn [a b]
-         (and (= (:track a) (:track b))
-              (= (:chr a) (:chr b))
-              (= (:start a) (:start b))
-              (= (:end a) (:end b))
-              (-> (- (:value a) (:value b)) Math/abs (< 1e-4))))
-       as bs))
+  (->> (map (fn [a b]
+              (and (= (:track a) (:track b))
+                   (= (:chr a) (:chr b))
+                   (= (:start a) (:start b))
+                   (= (:end a) (:end b))
+                   (-> (- (:value a) (:value b)) Math/abs (< 1e-4))))
+            as bs)
+       (every? true?)))

 (deftest reader
   (testing "make reader instance"


Test equality w/ 2 literals & fn call

Test equality w/ 2 literals & fn call

--- test/desdemona/query_test.clj
+++ test/desdemona/query_test.clj
@@ -32,7 +32,17 @@
                   [:identifier "ip"]
                   [:identifier "y"]]]]
          (#'q/infix-parser "ip(x) = ip(y)"))
-      "equality between two fn calls"))
+      "equality between two fn calls")
+  (is (= [:expr [:eq
+                 [:fn-call
+                  [:identifier "ip"]
+                  [:identifier "x"]]
+                 [:fn-call
+                  [:identifier "ip"]
+                  [:identifier "y"]]
+                 [:ipv4-address "10" "0" "0" "1"]]]
+         (#'q/infix-parser "ip(x) = ip(y)"))
+      "equality between two fn calls & literal"))

 (deftest infix->dsl-tests
   (is (= '(= (:ip x) "10.0.0.1")


CMR-6136: Fixed paging and harvesting tests.

--- indexer-app/src/cmr/indexer/data/index_set.clj
+++ indexer-app/src/cmr/indexer/data/index_set.clj
@@ -56,34 +56,44 @@
   "The index to use for the latest collection revisions."
   {:default "1_collections_v2" :type String})

+(defconfig max-result-window
+  "Number of max results can be returned in an Elasticsearch query."
+  {:default 1000000 :type Long})
+
 (def collection-setting-v1 {:index
                             {:number_of_shards (elastic-collection-index-num-shards)
                              :number_of_replicas 1,
+                             :max_result_window (max-result-window),
                              :refresh_interval "1s"}})

 (def collection-setting-v2 {:index
                             {:number_of_shards (elastic-collection-v2-index-num-shards),
                              :number_of_replicas 1,
+                             :max_result_window (max-result-window),
                              :refresh_interval "1s"}})

 (def tag-setting {:index
                   {:number_of_shards (elastic-tag-index-num-shards)
                    :number_of_replicas 1,
+                   :max_result_window (max-result-window),
                    :refresh_interval "1s"}})

 (def deleted-granule-setting {:index
                               {:number_of_shards (elastic-deleted-granule-index-num-shards)
                                :number_of_replicas 1,
+                               :max_result_window (max-result-window),
                                :refresh_interval "1s"}})

 (def variable-setting {:index
                        {:number_of_shards (elastic-variable-index-num-shards)
                         :number_of_replicas 1,
+                        :max_result_window (max-result-window),
                         :refresh_interval "1s"}})

 (def service-setting {:index
                        {:number_of_shards (elastic-service-index-num-shards)
                         :number_of_replicas 1,
+                        :max_result_window (max-result-window),
                         :refresh_interval "1s"}})

 (defnestedmapping attributes-field-mapping
@@ -718,11 +728,13 @@
 (def granule-settings-for-individual-indexes
   {:index {:number_of_shards (elastic-granule-index-num-shards),
            :number_of_replicas 1,
+           :max_result_window (max-result-window),
            :refresh_interval "1s"}})

 (def granule-settings-for-small-collections-index
   {:index {:number_of_shards (elastic-small-collections-index-num-shards),
            :number_of_replicas 1,
+           :max_result_window (max-result-window),
            :refresh_interval "1s"}})

 (def index-set-id


Fixing tests.

Fixing tests.

--- test/helloworld/core_test.clj
+++ test/helloworld/core_test.clj
@@ -2,10 +2,6 @@
   (:require [clojure.test :refer :all]
             [helloworld.core :refer :all]))

-(deftest a-test
-  (testing "FIXME, I fail."
-    (is (= 0 0))))
-
 (deftest myadd-test
   (testing "Addition"
-    (is 2 (my-add 1 1))))
+    (is (= 2 (my-add 1 1)))))


add participant count "n"

add participant count "n"

--- src/polismath/conversation.clj
+++ src/polismath/conversation.clj
@@ -63,14 +63,21 @@
                     opts))
    :rating-mat  (plmb/fnk [conv votes]
                   (update-nmat (:rating-mat conv)
-                    (map #(map % [:pid :tid :vote]) votes)))})
+                               (map #(map % [:pid :tid :vote]) votes)))
+  :n (plmb/fnk [rating-mat]
+               "count the participants"
+               (count (:rows rating-mat)))
+
+   })

 (def small-conv-update-graph
   "For computing small conversation updates (those without need for base clustering)"
   (merge
    base-conv-update-graph
-   {:mat
+   {
+
+    :mat
     (plmb/fnk
      [rating-mat]
      "swap nils for zeros - most things need the 0s, but repness needs the nils"


retrieves git branch name (#1020)

retrieves git branch name (#1020)

--- waiter/src/waiter/util/client_tools.clj
+++ waiter/src/waiter/util/client_tools.clj
@@ -198,24 +198,12 @@
   `(using-waiter-url
      (time-it ~name ~@body)))

-(defn- git-show->branch-name [text]
-  (->
-    text
-    (str/trim)
-    (str/split #", ")
-    (last)
-    (str/replace ")" "")
-    (str/replace #"^.+/" "")))
-
-(deftest test-git-show->branch-name
-  (is (= "master" (git-show->branch-name "(HEAD, origin/master)")))
-  (is (= "foo" (git-show->branch-name " (HEAD, origin/foo, foo)"))))
-
 (defn- retrieve-git-branch []
   (->
-    (shell/sh "git" "show" "-s" "--pretty=%d" "HEAD")
-    (:out)
-    (git-show->branch-name)))
+    (shell/sh "git" "rev-parse" "--abbrev-ref" "HEAD")
+    :out
+    (or "_unknown_branch_")
+    str/trim))

 (defn make-http-clients
   "Instantiates and returns http1 and http2 clients without a cookie store"


Decided I want to keep the tests for streams/update-index after all.

--- test/riemann/test/streams.clj
+++ test/riemann/test/streams.clj
@@ -604,6 +604,28 @@
            (doseq [m metrics] (r {:metric m}))
            (is (= expect (vec (map (fn [s] (:metric s)) (deref output)))))))

+(deftest update-test
+         (let [i (index/index)
+               s (update-index i)
+               states [{:host 1 :state "ok"}
+                       {:host 2 :state "ok"}
+                       {:host 1 :state "bad"}]]
+           (doseq [state states] (s state))
+           (is (= (set (.values i))
+                  #{{:host 1 :state "bad"}
+                    {:host 2 :state "ok"}}))))
+
+(deftest delete-from-index-test
+         (let [i (index/index)
+               s (update-index i)
+               d (delete-from-index i)
+               states [{:host 1 :state "ok"}
+                       {:host 2 :state "ok"}
+                       {:host 1 :state "bad"}]]
+           (doseq [state states] (s state))
+           (doseq [state states] (d state))
+           (is (= (vec (.values i)) []))))
+
 (deftest ewma-timeless-test
          (test-stream (ewma-timeless 0)
                       (em 1 10 20 -100 4)


Another baby-step toward switching from user to connection-manager ns

--- src/frereth_server/connection-manager.clj
+++ src/frereth_server/connection-manager.clj
@@ -1,4 +1,4 @@
-(ns frereth-server.user
+(ns frereth-server.connection-manager
   (:require [com.stuartsierra.component :as component]
             [frereth-server.comm :as comm]
             [schema.core :as s])
@@ -50,6 +50,6 @@
   (swap! (:users system) (fn [current]
                            (into current credentials))))

-(defn new
+(defn new-directory
   []
   (->Directory))


fix(ccw.swt): exclude dosync, correctly re-throw exception

--- ccw.core/src/clj/ccw/swt.clj
+++ ccw.core/src/clj/ccw/swt.clj
@@ -1,5 +1,5 @@
 (ns ccw.swt
-  (:refer-clojure :exlude (dosync))
+  (:refer-clojure :exclude (dosync))
   (:import ccw.util.DisplayUtil))

 (import 'org.eclipse.swt.SWT)
@@ -132,7 +132,7 @@
          (deliver a (f))
          (catch Exception exc (deliver e exc))))
     (if (realized? e)
-      (throw e)
+      (throw (deref e))
       (deref a))))

 (defmacro doasync


Commands needed for client connection selection.This paritally reverts 65ebb33f3940940b120e98754a2c8a5570d120c2

--- lein-light-nrepl/src/lighttable/nrepl/core.clj
+++ lein-light-nrepl/src/lighttable/nrepl/core.clj
@@ -18,7 +18,17 @@
 (def old-*err* *err*)
 (def my-settings (atom {:name "clj"
                         :dir (fs/absolute-path fs/cwd)
-                        :type "lein-light-nrepl"}))
+                        :type "lein-light-nrepl"
+                        :commands [:editor.eval.clj
+                                   :editor.clj.doc
+                                   :editor.cljs.doc
+                                   :editor.clj.hints
+                                   :editor.cljs.hints
+                                   :docs.clj.search
+                                   :docs.cljs.search
+                                   :editor.eval.clj.cancel
+                                   :editor.eval.cljs
+                                   :cljs.compile]}))

 (defmulti handle :op)


Test webhook

Test webhook

Signed-off-by: Tom Marble <b248307e886b80bf9cb4014595572a835b049bf4@info9.net>

--- src/main/cljs/clojurebridgemn/client.cljs
+++ src/main/cljs/clojurebridgemn/client.cljs
@@ -590,7 +590,7 @@
      ;;  " for our Fall/Winter workshop November 13-14!"
      ;; "Save the date! Our next ClojureBridgeMN workshop is scheduled for 11/13-14"
      ;; "Stay tuned for our next ClojureBridgeMN workshop (tentatively scheduled for November 4-5)"
-     "Our next ClojureBridgeMN workshop is scheduled for 11/4-5"
+     "Our next ClojureBridgeMN workshop is coming soon on Nov 4 & 5 !!!"
      [:br]
      [:br]
      "Sign up NOW on "


Just tidiness

Just tidiness

--- src/midje/parsing/util/error_handling.clj
+++ src/midje/parsing/util/error_handling.clj
@@ -9,6 +9,8 @@

 (def ^{:dynamic true} *wrap-count* 0)
 (def bail-out-of-parsing (gensym))
+
+(defn inside-an-error-handling-wrapper? [] (pos? *wrap-count*))

 ;; Note: this could be a macro, but it's easy to
 ;; get confused by macros assisting in the execution
@@ -29,20 +31,22 @@
    Note that the parsing code should take care not to let
    unparsed code escape from this function via lazy seqs."
   [form-being-parsed parser]
-  (if (pos? *wrap-count*)
-    (parser)
-    (binding [*wrap-count* (inc *wrap-count*)]
-      (try+
-        (parser)
-      (catch (partial = bail-out-of-parsing) _
-        false)
-      (catch Exception ex
-        (emit/fail {:type :exception-during-parsing
-                    :macro-form form-being-parsed
-                    :stacktrace (user-error-exception-lines ex)
-                    :position (form-position form-being-parsed)})
-        false)))))
-
+  (letfn [(report-exception [ex]
+            (emit/fail {:type :exception-during-parsing
+                        :macro-form form-being-parsed
+                        :stacktrace (user-error-exception-lines ex)
+                        :position (form-position form-being-parsed)}))]
+    (if (inside-an-error-handling-wrapper?)
+      (parser)
+      (binding [*wrap-count* (inc *wrap-count*)]
+        (try+
+         (parser)
+         (catch (partial = bail-out-of-parsing) _
+           false)
+         (catch Exception ex
+           (report-exception ex)
+           false))))))
+

 (defn report-error [form & notes]


Locks: housekeeping

Locks: housekeeping

--- src/taoensso/carmine/locks.clj
+++ src/taoensso/carmine/locks.clj
@@ -26,6 +26,7 @@

 (defn acquire-lock
   "Attempts to acquire a distributed lock, returning an owner UUID iff successful."
+  ;; TODO Waiting on http://goo.gl/YemR7 for simpler (non-Lua) solution
   [lock-name lock-timeout-ms wait-timeout-ms]
   (let [max-udt (+ wait-timeout-ms (System/currentTimeMillis))
         uuid    (str (java.util.UUID/randomUUID))]
@@ -42,7 +43,7 @@
                   {:lkey            (lkey lock-name)}
                   {:uuid            uuid
                    :lock-timeout-ms lock-timeout-ms})
-                 car/parse-bool car/with-replies)
+                 car/with-replies car/as-bool)
            (car/return uuid)
            (do (Thread/sleep 1) (recur))))))))

@@ -60,7 +61,7 @@
        end"
         {:lkey (lkey lock-name)}
         {:uuid owner-uuid})
-       car/parse-bool wcar))
+      wcar car/as-bool))

 (comment
   (when-let [uuid (acquire-lock "my-lock" 2000 500)]


Add spaces back or the leiningen template thingy gets confused :(

--- src/leiningen/new/chestnut/project.clj
+++ src/leiningen/new/chestnut/project.clj
@@ -67,7 +67,7 @@

                    :env {:is-dev true}

-                   :cljsbuild {:test-commands {{{{test-command-name}}} {{{test-command}}}}
+                   :cljsbuild {:test-commands { {{{test-command-name}}} {{{test-command}}} }
                                :builds {:app {:source-paths ["env/dev/cljs"]}
                                         :test {:source-paths ["src/cljs" {{{test-src-path}}}]
                                                :compiler {:output-to     "resources/public/js/app_test.js"


add add-query-filter!

add add-query-filter!

--- src/thi/ng/fabric/triples.cljc
+++ src/thi/ng/fabric/triples.cljc
@@ -182,6 +182,17 @@
                 (add-param-query! g (keyword (gensym)) b))
      more)
     (add-param-query! g (keyword (gensym)) a)))
+
+(defn add-query-filter!
+  [g q-vertex flt]
+  (let [fv (f/add-vertex!
+            g {:val (delay nil)
+               ::f/collect-fn
+               (f/collect-pure
+                (fn [_ incoming]
+                  (delay (sequence (comp (mapcat deref) (filter flt)) incoming))))})]
+    (f/add-edge! g q-vertex fv f/signal-forward nil)
+    fv))

 (defn collect-inference
   [g production]
@@ -308,10 +319,12 @@
         all (:result (add-query! g :all [nil nil nil]))
         num-projects (add-counter! g projects)
         num-types (add-counter! g types)
-        inf1 (add-rule! g :symmetric '[[?a ?prop ?b] [?prop type symmetric-prop]]
-                        (fn [{:syms [?a ?prop ?b]}] [[?b ?prop ?a]]))
-        inf2 (add-rule! g :domain '[[?a ?prop nil] [?prop domain ?d]]
-                        (fn [{:syms [?a ?prop ?d]}] [[?a 'type ?d]]))
+        inf1 (add-rule!
+              g :symmetric '[[?a ?prop ?b] [?prop type symmetric-prop]]
+              (fn [{:syms [?a ?prop ?b]}] [[?b ?prop ?a]]))
+        inf2 (add-rule!
+              g :domain '[[?a ?prop nil] [?prop domain ?d]]
+              (fn [{:syms [?a ?prop ?d]}] [[?a 'type ?d]]))
         pq (:qvar-result (add-param-query! g :pq '[?s knows ?o]))
         jq (:qvar-result (add-join-query! g '[[?p author ?prj] [?prj type project] [?p type person]]))
         ctx (f/async-context {:graph g :processor f/eager-vertex-processor :timeout nil})]


Add helper function to test for atom?

Add helper function to test for atom?

--- src/untangled/client/core.cljc
+++ src/untangled/client/core.cljc
@@ -282,6 +282,12 @@
         merge-data {:untangled/merge {ident (util/deep-merge existing-data marked-data)}}]
     {:merge-query merge-query
      :merge-data  merge-data}))
+
+(defn- is-atom?
+  "Returns TRUE when x is an atom."
+  [x]
+  (instance? #?(:cljs cljs.core.Atom
+                :clj  clojure.lang.Atom) x))

 (defn integrate-ident!
   "Integrate an ident into any number of places in the app state. This function is safe to use within mutation


(maint) Allow any valid tk config to be used by benchmark tool

This commit changes the benchmark tool to use the trapperkeeper
load-config function instead of the kitchensink ini parser so that we
can use any valid pdb config file for the benchmarking tool.

--- src/puppetlabs/puppetdb/cli/benchmark.clj
+++ src/puppetlabs/puppetdb/cli/benchmark.clj
@@ -40,6 +40,7 @@
   (:require [clojure.tools.logging :as log]
             [puppetlabs.puppetdb.catalog.utils :as catutils]
             [puppetlabs.trapperkeeper.logging :as logutils]
+            [puppetlabs.trapperkeeper.config :as config]
             [puppetlabs.puppetdb.cheshire :as json]
             [fs.core :as fs]
             [clojure.java.io :as io]
@@ -292,7 +293,7 @@
   (assoc factset "certname" hostname))

 (def supported-cli-options
-  [["-c" "--config CONFIG" "Path to config.ini or conf.d directory (required)"]
+  [["-c" "--config CONFIG" "Path to config or conf.d directory (required)"]
    ["-F" "--facts FACTS" "Path to a directory containing sample JSON facts (files must end with .json)"]
    ["-C" "--catalogs CATALOGS" "Path to a directory containing sample JSON catalogs (files must end with .json)"]
    ["-R" "--reports REPORTS" "Path to a directory containing sample JSON reports (files must end with .json)"]
@@ -308,9 +309,9 @@
 (defn activate-logging!
   [options]
   (-> (:config options)
-      (ks/inis-to-map)
+      config/load-config
       (get-in [:global :logging-config])
-      (logutils/configure-logging!)))
+      logutils/configure-logging!))

 (defn validate-options
   [options action-on-error-fn]
@@ -395,7 +396,7 @@
   [& args]
   (let [options         (validate-cli! args)
         config          (-> (:config options)
-                            (ks/inis-to-map))
+                            config/load-config)

         {:keys [catalogs reports facts]} (load-data-from-options options)
         nhosts          (:numhosts options)


Only return the first 3 lines of input when JSON fails to parse

Fix devth/yetibot#442

--- src/yetibot/core/util/http.clj
+++ src/yetibot/core/util/http.clj
@@ -1,5 +1,6 @@
 (ns yetibot.core.util.http
   (:require
+    [yetibot.core.util.format :refer [limit-and-trim-string-lines]]
     [http.async.client :as client]
     [taoensso.timbre :refer [info warn error]]
     [clojure.string :as s]
@@ -36,7 +37,8 @@
       (xml/parse raw)
       (catch Exception e
         (error "Exception trying to fetch xml" args)
-        (throw (Exception. (str "Unable to parse XML from response:" raw)))))))
+        (let [limited-raw (str (limit-and-trim-string-lines 3 raw) "...")]
+          (throw (Exception. (str "Unable to parse XML from response:" limited-raw))))))))

 (defn encode [s]
   (URLEncoder/encode (str s) "UTF-8"))


Extend test case for compatible subcontexts

Signed-off-by: Daniel Borchmann <3d0f3b9ddcacec30c4008c5e030e6c13a478cb4f@algebra20.de>

--- src/test/clojure/conexp/fca/misc_test.clj
+++ src/test/clojure/conexp/fca/misc_test.clj
@@ -23,14 +23,16 @@
          (compatible-subcontext? empty-context ctx))))

 (deftest test-compatible-subcontexts
-  (are [ctx] (let [ctx (reduce-context ctx)]
-               (every? #(compatible-subcontext? % ctx)
-                       (compatible-subcontexts ctx)))
-       test-ctx-01
-       test-ctx-04
-       test-ctx-06
-       test-ctx-07
-       test-ctx-08)
+  (are [ctx nr] (let [ctx (reduce-context ctx)
+                      sct (compatible-subcontexts ctx)]
+                  (and (every? #(compatible-subcontext? % ctx)
+                               (compatible-subcontexts ctx))
+                       (= nr (count sct))))
+       test-ctx-01 3
+       test-ctx-04 1
+       test-ctx-06 2
+       test-ctx-07 10
+       test-ctx-08 10)
   (is (let [some-context (make-context #{1 2 3} '#{c d e} '#{[1 c] [2 c] [2 e] [3 e]})]
         (some #(= some-context %) (compatible-subcontexts test-ctx-08)))))


Multiline IO

Multiline IO

Clojure

--- utilities/nonvisualstudio/clojure/Implementation/hr-io.clj
+++ utilities/nonvisualstudio/clojure/Implementation/hr-io.clj
@@ -50,3 +50,11 @@
 ;(let [a (read-line)
 ;      b (read-line)]
 ;          (print (str (sumStrings b))))
+
+;;IO for multiple lines to print
+;(let [sizeOfStaircase (read-string (read-line))
+;      dataToPrint (create-staircase sizeOfStaircase)]
+;      (doall
+;        (map
+;          #(println %)
+;          dataToPrint)))


Story ID: develop Summary: ResultLines are now initially folded with a mini title showing until they are expanded, which is when they should their full data

--- src/untangled_spec/reporters/browser.cljs
+++ src/untangled_spec/reporters/browser.cljs
@@ -9,27 +9,40 @@

     [untangled-spec.reporters.impl.browser :as impl]))

-(defui ResultLine
+(defui Foldable
        Object
        (initLocalState [this] {:folded? true})
        (render [this]
-               (let [{:keys [title value stack] type- :type} (om/props this)
-                     {:keys [folded?]} (om/get-state this)]
+               (let [{:keys [folded?]} (om/get-state this)
+                     {:keys [render]} (om/props this)
+                     {:keys [title value classes]} (render folded?)]
+                 (dom/div nil
+                          (dom/a #js {:href "javascript:void(0);"
+                                      :className classes
+                                      :onClick #(om/update-state! this update :folded? not)}
+                                 (if folded? \u25BA \u25BC)
+                                 (if folded?
+                                   (str (apply str (take 40 title)) "...")
+                                   (str title)))
+                          (dom/div #js {:className (when folded? "hidden")}
+                                   value)))))
+(def ui-foldable (om/factory Foldable))
+
+(defui ResultLine
+       Object
+       (render [this]
+               (let [{:keys [title value stack] type- :type} (om/props this)]
                  (dom/tr nil
-                         (dom/td #js {:className (str "test-result-title " (name type-))} title)
+                         (dom/td #js {:className (str "test-result-title "
+                                                      (name type-))}
+                                 title)
                          (dom/td #js {:className "test-result"}
                                  (dom/code nil
-                                           (if stack
-                                             (dom/a #js {:href "#"
-                                                         :className "error"
-                                                         :onClick #(om/update-state! this update :folded? not)}
-                                                    (if folded? \u25BA \u25BC)
-                                                    (str value))
-                                             (str value))
-                                           (when stack
-                                             (dom/div #js {:className (if folded? "hidden" "stack-trace")}
-                                                      stack))))))))
-
+                                           (ui-foldable
+                                             {:render (fn [folded?]
+                                                        {:title (if stack (str value) (if folded? (str value)))
+                                                         :value (if stack stack (if-not folded? (str value)))
+                                                         :classes (if stack "stack")})})))))))
 (def ui-result-line (om/factory ResultLine))

 (defui TestResult
@@ -42,11 +55,11 @@
                                                     :title "ASSERTION: "
                                                     :value message}))
                                  (ui-result-line {:type :normal
-                                                  :title "Actual"
+                                                  :title "Actual: "
                                                   :value actual
                                                   :stack stack})
                                  (ui-result-line {:type :normal
-                                                  :title "Expected"
+                                                  :title "Expected: "
                                                   :value (or expected "")})
                                  (when extra
                                    (ui-result-line {:type :normal
@@ -54,16 +67,10 @@
                                                     :value extra}))
                                  (when diff
                                    (ui-result-line {:type :diff
-                                                    :title "Updates "
-                                                    :value (:mutations diff)}))
-                                 (when diff
-                                   (ui-result-line {:type :diff
-                                                    :title "Removals "
-                                                    :value (:removals diff)}))
-                        )
+                                                    :title "Diff: "
+                                                    :value diff})))
                       (dom/table nil)
                       (dom/li nil)))))
-
 (def ui-test-result (om/factory TestResult {:keyfn :id}))

 (declare ui-test-item)
@@ -83,7 +90,6 @@
                                   (dom/ul #js {:className "test-list"}
                                           (mapv (comp ui-test-item #(assoc % :report/filter filter))
                                                 (:test-items test-item-data))))))))
-
 (def ui-test-item (om/factory TestItem {:keyfn :id}))

 (defui TestNamespace
@@ -96,7 +102,7 @@
                {:keys [folded?]} (om/get-state this)]
            (dom/li #js {:className "test-item"}
                    (dom/div #js {:className "test-namespace"}
-                            (dom/a #js {:href "#"
+                            (dom/a #js {:href "javascript:void(0)"
                                         :style #js {:textDecoration "none"} ;; TODO: refactor to css
                                         :onClick   #(om/update-state! this update :folded? not)}
                                    (dom/h2 #js {:className (impl/itemclass (:status tests-by-namespace))}
@@ -105,7 +111,6 @@
                             (dom/ul #js {:className (if folded? "hidden" "test-list")}
                                     (mapv (comp ui-test-item #(assoc % :report/filter filter))
                                           (:test-items tests-by-namespace))))))))
-
 (def ui-test-namespace (om/factory TestNamespace {:keyfn :name}))

 (defui FilterSelector
@@ -117,7 +122,6 @@
                                           "selected" "")
                              :onClick (set-filter! this-filter)}
                         (str this-filter)))))
-
 (def ui-filter-selector (om/factory FilterSelector {:keyfn :this-filter}))

 (defui Filters
@@ -131,7 +135,6 @@
                                                       :set-filter! set-filter!
                                                       :this-filter %})
                                 [:all :manual :failed])))))
-
 (def ui-filters (om/factory Filters ))

 (defui TestCount
@@ -149,7 +152,6 @@
                                        passed " passed "
                                        failed " failed "
                                        error  " errors"))))))
-
 (def ui-test-count (om/factory TestCount))

 (defui TestReport


remove applications from gallery

remove applications from gallery

--- src/cljs/salava/extra/application/ui/routes.cljs
+++ src/cljs/salava/extra/application/ui/routes.cljs
@@ -10,8 +10,8 @@
     #(layout/default site-navi content)))

 (defn ^:export routes [context]
-  {(str (base-path context) "/gallery") [["/application" a/handler]]})
+  {} #_{(str (base-path context) "/gallery") [["/application" a/handler]]})

 (defn ^:export navi [context]
-  {(str (base-path context) "/gallery/application")         {:weight 45 :title (t :extra-application/Application)  :site-navi true :breadcrumb (t :gallery/Gallery " / " :extra-application/Application)}})
+  {} #_{(str (base-path context) "/gallery/application")         {:weight 45 :title (t :extra-application/Application)  :site-navi true :breadcrumb (t :gallery/Gallery " / " :extra-application/Application)}})


Aggregator refactoring

Aggregator refactoring

--- src/cljx/simplection/canvasgraph/aggregator.cljx
+++ src/cljx/simplection/canvasgraph/aggregator.cljx
@@ -29,11 +29,10 @@

 (defn aggregate-table
   "Group, aggregate, filter, sort, etc. the whole table."
-  [table-to-organize organization-map]
-  (merge-table
-   (group-table
-    (filter-table-columns table-to-organize (keys organization-map))
-    definition/groupings)
-   organization-map))
-
-(def aggregated-table (aggregate-table @g-data/data-source definition/organize-rules))
+  [table-to-aggregate]
+  (let [aggregate-rules (definition/get-aggregate-rules)]
+    (merge-table
+     (group-table
+      (filter-table-columns table-to-aggregate (keys aggregate-rules))
+      (definition/get-groupings))
+     aggregate-rules)))


Дополнение для обработки ошибок

Дополнение для обработки ошибок

--- radiolamp-6P3/src/ixinfestor/core.clj
+++ radiolamp-6P3/src/ixinfestor/core.clj
@@ -1345,3 +1345,22 @@

 ;; END anytext entity
 ;;..................................................................................................
+
+
+
+
+
+(defmacro try-catch [& body]
+  `(try
+     (do ~@body)
+     (catch java.sql.BatchUpdateException ex-buth#
+       (let [ex# (.getNextException ex-buth#)]
+         (-> ex#
+             .getMessage
+             ((fn [message#] (println message#) message#)))))
+     (catch Exception ex#
+       (do
+         (clojure.stacktrace/print-stack-trace ex#)
+         (-> ex#
+             .getMessage
+             ((fn [message#] (println message#) message#)))))))


mvp sq phrase clojure

mvp sq phrase clojure

--- tech-int/src/tech_int/core.clj
+++ tech-int/src/tech_int/core.clj
@@ -35,25 +35,41 @@

 (use '[clojure.string :only (join split capitalize ends-with?)])

+; (defn printPhrase
+;     [inputVector width]
+;     (loop [v inputVector
+;             w width
+;             i 0]
+;         (println (count v))
+;         (println i)
+;         (println (<= i (count v)))
+;         (if (<= i (count v))
+;             (if (<= (count (v i)) w)
+;                 (do
+;                     (println (apply str "* " (v i) (apply str (repeat (- w (count (v i))) " ")) " *"))
+;                 )
+;                 (println (apply str "* " (v i) " *"))
+;             )
+;         )
+;         (recur v w (inc i))
+;     )
+; )
+
 (defn printPhrase
-    [inputVector width]
-    (loop [v inputVector
-            w width
-            i 0]
-        (println (count v))
-        (println i)
-        (println (<= i (count v)))
-        (if (< i (count v))
-            (if (<= (count (v i)) w)
-                (do
-                    (println (apply str "* " (v i) (apply str (repeat (- w (count (v i))) " ")) " *"))
-                )
-                (do
-                    (println (apply str "* " (v i) " *"))
+    [v w]
+    (def i (atom 0))
+    (while (< @i (count v))
+        (do
+            (if (<= @i (count v))
+                (if (<= (count (v @i)) w)
+                    (do
+                        (println (apply str "* " (v @i) (apply str (repeat (- w (count (v @i))) " ")) " *"))
+                    )
+                    (println (apply str "* " (v @i) " *"))
                 )
             )
         )
-        (recur v w (inc i))
+        (swap! i inc)
     )
 )


devcards demos

devcards demos

--- src/devcards/devcards_om_next/devcards/core.cljs
+++ src/devcards/devcards_om_next/devcards/core.cljs
@@ -11,7 +11,7 @@

     The `om-next-root` will render Om Next components, much the way `om.core/add-root!` does.
     It takes one or two arguments. The first argument is the Om Next component. The second (optional)
-    argument is either a map with the state to pass to the component, or an Om Next reconciler.
+    argument is either a map or atom with the state to pass to the component, or an Om Next reconciler.

     The `defcard-om-next` is a shortcut to `(defcard (om-next-root ...))`.
     Its arguments are the same of a normal `defcard`, with the following exception:
@@ -34,18 +34,24 @@

 (defonce om-next-root-data {:text "yep"})

-#_(defcard om-next-card-ex
-  "This card calls `om-next-root` with one argument, the component"
+(defcard om-next-card-ex-1
+  "This card calls `om-next-root` with one argument, the component. The initial data
+   is passed as an argument to `defcard`."
   (om-next-root Widget)
-  {:text "yep"})
+  om-next-root-data)

-#_(defcard om-next-card-reconciler-ex
+(defcard om-next-card-ex-2
+  "This is the same example but `om-next-root` now takes two arguments."
+  (om-next-root Widget om-next-root-data))
+
+(defcard om-next-card-reconciler-ex
   "This card calls `om-next-root` with 2 args, the component and the Om Next reconciler"
   (om-next-root Widget
-    (om/reconciler {:state om-next-root-data
-                    :parser (om/parser {:read (fn [] {:value om-next-root-data})})})))
+    (om/reconciler
+      {:state om-next-root-data
+       :parser (om/parser {:read (fn [] {:value om-next-root-data})})})))

-#_(defcard-om-next om-next-no-reconciler
+(defcard-om-next om-next-no-reconciler
   "This `defcard-om-next` card takes the initial state map as its last arg"
   Widget
   om-next-root-data)
@@ -89,7 +95,7 @@
                                       :mutate counter-mutate})
                   :shared {:title "First counter "}}))

-#_(defcard-om-next om-next-card-shared-ex-1
+(defcard-om-next om-next-card-shared-ex-1
   om-next-counter-inc
   rec1)

@@ -101,7 +107,7 @@
                                       :mutate counter-mutate})
                   :shared {:title "Second counter "}}))

-#_(defcard-om-next om-next-card-shared-ex-2
+(defcard-om-next om-next-card-shared-ex-2
   om-next-counter-dec
   rec2)

@@ -129,4 +135,10 @@
 (defcard-om-next local-state-om-next-card
   "we can define components with `:once` metadata"
   ComponentWithLocalState
-  local-reconciler)
+  {})
+
+
+;; TODO:
+;; - Docs saying that if we pass a map to `defcard-om-next`, we will `defonce` a reconciler automatically
+;; - Docs saying that `om-next-root` is not as powerful and doesn't have that ability (so the code won't be reloadable)
+;; -


feat: follow uglify-js versionning

feat: follow uglify-js versionning

--- build.boot
+++ build.boot
@@ -19,7 +19,7 @@
          '[boot.core        :as core :refer [deftask]]
          '[nha.run])

-(def +version+ "0.0.8-SNAPSHOT")
+(def +version+ "2.7.4-SNAPSHOT")

 (bootlaces! +version+)


Remove boot deps

Remove boot deps

--- build.boot
+++ build.boot
@@ -4,12 +4,6 @@
   :dependencies '[[org.clojure/test.check "0.9.0" :scope "test"]
                   ; project deps
                   [org.clojure/clojure "1.9.0-alpha7"]
-                  [boot/core "2.6.0"]
-                  [boot/base "2.6.0"]
-                  [boot/aether "2.6.0"]
-                  [boot/worker "2.6.0"]
-                  [boot/pod "2.6.0"]
-                  [adzerk/boot-test "1.1.1"]
                   [leiningen "2.6.1" :exclusions [leiningen.search]]
                   [ring "1.4.0"]
                   [clojail "1.0.6"]])


Minor changes on deps.

Minor changes on deps.

--- profiles.clj
+++ profiles.clj
@@ -41,7 +41,7 @@
    :dependencies [[org.clojure/clojurescript "1.7.228"]
                   [funcool/cuerdas "0.7.1"]
                   [rum "0.6.0" :exclusions [sablono]]
-                  [sablono "0.5.4-SNAPSHOT"]
+                  [sablono "0.5.3"]
                   [cljsjs/react "0.14.3-0"]
                   [cljsjs/react-dom "0.14.3-1"]
                   [cljsjs/react-dom-server "0.14.3-0"]


Fix format-commands #1

Fix format-commands #1

--- build.boot
+++ build.boot
@@ -156,7 +156,7 @@
         (compile-cljs :id "node/index")
         (target)
         (with-pass-thru _
-          (util/dosh "/bin/sh" "-c" "'cd target'")
+          ;(util/dosh "/bin/sh" "-c" "'cd target'")
           (util/dosh "/bin/bash" "-c" "'cd target'")
           (util/dosh "bash" "-c" "'cd target ; ls -l'"))))))
         ;(with-pass-thru _


Add my bootlaces

Add my bootlaces

--- build.boot
+++ build.boot
@@ -1,13 +1,16 @@
 (set-env!
  :source-paths #{"src"}
- :dependencies '[[radicalzephyr/boot-junit "0.2.0-SNAPSHOT" :scope "test"]
-                 [jeluard/boot-notify "0.1.2"      :scope "test"]
+ :dependencies '[[radicalzephyr/bootlaces "0.1.14"          :scope "test"]
+                 [radicalzephyr/boot-junit "0.2.0-SNAPSHOT" :scope "test"]
                  [net.sf.jopt-simple/jopt-simple "4.9"]])

 (def +version+ "0.1.0-SNAPSHOT")

-(require '[radicalzephyr.boot-junit :refer [junit]]
-         '[jeluard.boot-notify      :refer [notify]])
+(bootlaces! +version+)
+(set-env! :resource-paths #{}) ;; Must undo bootlaces! adding "src" to
+                               ;; the resource-paths. Will be fixed in 0.1.15
+
+(require '[radicalzephyr.boot-junit :refer [junit]])

 (task-options!
  pom {:project 'http-server


newest boot-cljs-test snapshot (#42)

newest boot-cljs-test snapshot (#42)

--- build.boot
+++ build.boot
@@ -42,7 +42,6 @@
       (test-cljs
         :js-env :node
         :namespaces #{'lumo.js-deps-tests 'lumo.repl-tests}
-        :ids ["output"]
         :cljs-opts {:parallel-build true}
         :exit? exit?))))


Replace :whitespace optimization with :none

Because :whitespace is not compatible with nodejs target.

--- scripts/build.clj
+++ scripts/build.clj
@@ -13,7 +13,7 @@
     :output-to "out/tests.js"
     :output-dir "out"
     :parallel-build false
-    :optimizations :whitespace
+    :optimizations :none
     :language-in  :ecmascript5
     :language-out :ecmascript5
     :target :nodejs


thread the fns for better readability.

thread the fns for better readability.

--- clojure/atbash-cipher/atbash.clj
+++ clojure/atbash-cipher/atbash.clj
@@ -1,15 +1,19 @@
 (ns atbash
-  (require [clojure.string :as str :only [lower-case]]))
+  (require [clojure.string :as string :only [lower-case]]))

 (let [letters (map char (range
                          (int \a)
                          (inc (int \z))))
-      total-letters (dec (count letters))
-      ]
-  (defn transpose
+      total-letters (dec (count letters))]
+  (defn- transpose
     [c]
-    (nth letters (- total-letters
-                    (.indexOf letters c))))
+    (->> c
+         (.indexOf letters)
+         (- total-letters)
+         (nth letters)))
   (defn encode
     [s]
-    (apply str (map transpose (str/lower-case s)))))
+    (->> s
+         string/lower-case
+         (map transpose)
+         (apply str))))


Use set as function

Use set as function

--- clojure/nucleotide-count/dna.clj
+++ clojure/nucleotide-count/dna.clj
@@ -5,8 +5,8 @@
     (merge empty (frequencies dna-string))))

 (defn count [strand dna-string]
-  (let [allowed-nucleotide [\A \T \C \G \U]]
-    (when (not (some #{strand} allowed-nucleotide))
+  (let [allowed-nucleotide #{\A \T \C \G \U}]
+    (when (not (allowed-nucleotide strand))
        (throw (Exception. "invalid nucleotide"))))

   (let [dna (nucleotide-counts dna-string)]


Be a bit more strict about SSL connection exception handling

--- test/puppetlabs/master/bootstrap_test.clj
+++ test/puppetlabs/master/bootstrap_test.clj
@@ -56,8 +56,10 @@
   (try
     (f)
     (is false "Connection succeeded but should have failed")
-    (catch IOException e)
-    (catch ConnectionClosedException e))
+    (catch ConnectionClosedException e)
+    (catch IOException e
+      (if-not (= (.getMessage e) "Connection reset by peer")
+        (throw e))))
   nil)

 (deftest test-app-startup-against-crls


(PDB-2075) Shorten command-test SECONDS references

--- test/puppetlabs/puppetdb/command_test.clj
+++ test/puppetlabs/puppetdb/command_test.clj
@@ -32,7 +32,8 @@
             [puppetlabs.trapperkeeper.app :refer [get-service]]
             [clojure.core.async :as async]
             [puppetlabs.kitchensink.core :as ks])
-  (:import [org.joda.time DateTime DateTimeZone]))
+  (:import [java.util.concurrent TimeUnit]
+           [org.joda.time DateTime DateTimeZone]))

 (use-fixtures :each with-test-db)

@@ -838,17 +839,18 @@
                               :environment nil
                               :producer_timestamp (-> 2 days ago)}))

-      (with-redefs [scf-store/update-facts! (fn [fact-data]
-                                              (.put hand-off-queue "got the lock")
-                                              (.poll hand-off-queue 5 java.util.concurrent.TimeUnit/SECONDS)
-                                              (storage-replace-facts! fact-data))]
+      (with-redefs [scf-store/update-facts!
+                    (fn [fact-data]
+                      (.put hand-off-queue "got the lock")
+                      (.poll hand-off-queue 5 TimeUnit/SECONDS)
+                      (storage-replace-facts! fact-data))]
         (let [first-message? (atom false)
               second-message? (atom false)
               fut (future
                     (test-msg-handler command publish discard-dir
                       (reset! first-message? true)))

-              _ (.poll hand-off-queue 5 java.util.concurrent.TimeUnit/SECONDS)
+              _ (.poll hand-off-queue 5 TimeUnit/SECONDS)

               new-facts (update-in facts [:values] (fn [values]
                                                      (-> values
@@ -1034,17 +1036,18 @@
        (scf-store/add-certname! certname)
        (scf-store/replace-catalog! nonwire-catalog (-> 2 days ago)))

-      (with-redefs [scf-store/replace-catalog! (fn [catalog timestamp]
-                                                 (.put hand-off-queue "got the lock")
-                                                 (.poll hand-off-queue 5 java.util.concurrent.TimeUnit/SECONDS)
-                                                 (storage-replace-catalog! catalog timestamp))]
+      (with-redefs [scf-store/replace-catalog!
+                    (fn [catalog timestamp]
+                      (.put hand-off-queue "got the lock")
+                      (.poll hand-off-queue 5 TimeUnit/SECONDS)
+                      (storage-replace-catalog! catalog timestamp))]
         (let [first-message? (atom false)
               second-message? (atom false)
               fut (future
                     (test-msg-handler command publish discard-dir
                       (reset! first-message? true)))

-              _ (.poll hand-off-queue 5 java.util.concurrent.TimeUnit/SECONDS)
+              _ (.poll hand-off-queue 5 TimeUnit/SECONDS)

               new-wire-catalog (assoc-in wire-catalog [:edges]
                                          #{{:relationship "contains"
@@ -1079,17 +1082,18 @@
        (scf-store/add-certname! certname)
        (scf-store/replace-catalog! nonwire-catalog (-> 2 days ago)))

-      (with-redefs [scf-store/replace-catalog! (fn [catalog timestamp]
-                                                 (.put hand-off-queue "got the lock")
-                                                 (.poll hand-off-queue 5 java.util.concurrent.TimeUnit/SECONDS)
-                                                 (storage-replace-catalog! catalog timestamp))]
+      (with-redefs [scf-store/replace-catalog!
+                    (fn [catalog timestamp]
+                      (.put hand-off-queue "got the lock")
+                      (.poll hand-off-queue 5 TimeUnit/SECONDS)
+                      (storage-replace-catalog! catalog timestamp))]
         (let [first-message? (atom false)
               second-message? (atom false)
               fut (future
                     (test-msg-handler command publish discard-dir
                       (reset! first-message? true)))

-              _ (.poll hand-off-queue 5 java.util.concurrent.TimeUnit/SECONDS)
+              _ (.poll hand-off-queue 5 TimeUnit/SECONDS)

               new-wire-catalog (update wire-catalog :resources
                                        conj


master > Fix key locking on window lose focus.

--- sewerdemon/src/sewerdemon/events.cljs
+++ sewerdemon/src/sewerdemon/events.cljs
@@ -1,4 +1,4 @@
-(ns sewerdemon.events
+(ns ^:figwheel-always sewerdemon.events
   (:require [goog.dom :as dom]
             [goog.events :as events]
             [goog.style :as style]))
@@ -51,4 +51,9 @@
 (defn capture-key-events []
   (let [w (dom/getWindow)]
     (events/listen w (.-KEYUP events/EventType) capture-key-event)
-    (events/listen w (.-KEYDOWN events/EventType) capture-key-event)))
+    (events/listen w (.-KEYDOWN events/EventType) capture-key-event)
+    (events/listen w (.-FOCUS events/EventType) disable-key-events)))
+
+(defn disable-key-events []
+  (doseq [key (into [] (range 221))]
+    (set-key-state (get-key-from-charcode key) false)))


Performance optimizations for remote solution: it too long to collect response/diff after evolving

--- src/flatgui/samples/forms/fdemowindow.clj
+++ src/flatgui/samples/forms/fdemowindow.clj
@@ -138,7 +138,10 @@
     :main
     {:clip-size (m/defpoint 40 25)
      :background (awt/color 9 17 26)
+
+     :closed-focus-root true
      :focus-state {:mode :has-focus
                    :focused-child nil}}
+
     focus-window
     focus-window-2))


removed another case of accidentally changing project/usable-containers to project/linux-containers

--- src-cljs/frontend/models/project.cljs
+++ src-cljs/frontend/models/project.cljs
@@ -142,7 +142,7 @@

 (defn buildable-parallelism [plan project]
   (min (plan-model/max-parallelism plan)
-       (linux-containers plan project)))
+       (usable-containers plan project)))

 (defn has-scope? [project scope]
   (let [scope (keyword scope)]


Add missing refer

Add missing refer

--- src/braid/client/ui/views/thread.cljs
+++ src/braid/client/ui/views/thread.cljs
@@ -4,7 +4,7 @@
   (:require
     [clojure.set :refer [difference]]
     [clojure.string :as string]
-    [cljs.core.async :refer [chan put!]]
+    [cljs.core.async :refer [alts! chan put!]]
     [reagent.core :as r]
     [re-frame.core :refer [dispatch subscribe]]
     [braid.client.helpers :as helpers]


Add get-card-info function

Add get-card-info function

--- src/clj/decktouch/mtg_card_master.clj
+++ src/clj/decktouch/mtg_card_master.clj
@@ -17,3 +17,8 @@
   (let [match-query (partial match query)]
     (map (fn [thing] (str thing))
       (filter match-query card-names))))
+
+(defn get-card-info
+  "Given a card name, return a map containing all the info for the card"
+  [card-name]
+  (mtg-cards card-name))


extract transactions/older-item

extract transactions/older-item

--- src/clj_money/models/transactions.clj
+++ src/clj_money/models/transactions.clj
@@ -737,6 +737,21 @@
                         (map #(get-previous-item storage %)))]
     (update-in context [:base-items] #(concat % base-items))))

+(defn- older-item
+  "Given a transaction item and an existing transaction
+  (in the context of processing a transaction update),
+  returns the earlier of the specified item
+  or the corresponding item from the
+  existing transaction"
+  [existing-tx current-item]
+  (if-let [existing-item (some #(= (:id %) (:id current-item))
+                               (:items existing-tx))]
+    (if (> 0 (compare (:transaction-date current-item)
+                      (:transaction-date existing-tx)))
+      existing-item
+      current-item)
+    current-item))
+
 (defn- process-updated-items
   "Processes the updated items in the transaction
   in the context and appends items to the :base-items attribute
@@ -748,14 +763,7 @@
                                 (assoc i :transaction-id (:id transaction))
                                 (before-save-item i)
                                 (upsert-item storage i)))
-                        (map (fn [current-item]
-                               ; TODO: no need to find the matching item, just use the value from the transaction
-                               (let [existing-item (some #(= (:id %) (:id current-item))
-                                                         (:items existing-tx))]
-                                 (if (> 0 (compare (:transaction-date current-item)
-                                                   (:transaction-date existing-item)))
-                                   existing-item
-                                   current-item))))
+                        (map #(older-item existing-tx %))
                         (mapv #(get-previous-item storage %)))]
     (update-in context [:base-items] #(concat % base-items))))


Small extended test for «close-under-implication»

Signed-off-by: Daniel Borchmann <25857343a15bf1edafebc2912e82ecf775c585c1@mailbox.tu-dresden.de>